faf-cli 6.6.1 → 6.7.0

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.
package/dist/cli.js CHANGED
@@ -1,176 +1,176 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as e7}from"node:module";var c7=Object.create;var{getPrototypeOf:p7,defineProperty:z6,getOwnPropertyNames:l7}=Object;var i7=Object.prototype.hasOwnProperty;function n7($){return this[$]}var r7,s7,a7=($,Z,X)=>{var z=$!=null&&typeof $==="object";if(z){var J=Z?r7??=new WeakMap:s7??=new WeakMap,Q=J.get($);if(Q)return Q}X=$!=null?c7(p7($)):{};let Y=Z||!$||!$.__esModule?z6(X,"default",{value:$,enumerable:!0}):X;for(let q of l7($))if(!i7.call(Y,q))z6(Y,q,{get:n7.bind($,q),enumerable:!0});if(z)J.set($,Y);return Y};var A=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var o7=($)=>$;function t7($,Z){this[$]=o7.bind(null,Z)}var Z9=($,Z)=>{for(var X in Z)z6($,X,{get:Z[X],enumerable:!0,configurable:!0,set:t7.bind(Z,X)})};var S=($,Z)=>()=>($&&(Z=$($=0)),Z);var L0=e7(import.meta.url);var B1=A(($z)=>{class J6 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 X9 extends J6{constructor($){super(1,"commander.invalidArgument",$);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}$z.CommanderError=J6;$z.InvalidArgumentError=X9});var y2=A((Qz)=>{var{InvalidArgumentError:zz}=B1();class z9{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 zz(`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 Jz($){let Z=$.name()+($.variadic===!0?"...":"");return $.required?"<"+Z+">":"["+Z+"]"}Qz.Argument=z9;Qz.humanReadableArgName=Jz});var Q6=A((Wz)=>{var{humanReadableArgName:Gz}=y2();class J9{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)=>Gz(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(U,V){return Z.formatItem(U,X,V,Z)}let Q=[`${Z.styleTitle("Usage:")} ${Z.styleUsage(Z.commandUsage($))}`,""],Y=Z.commandDescription($);if(Y.length>0)Q=Q.concat([Z.boxWrap(Z.styleCommandDescription(Y),z),""]);let q=Z.visibleArguments($).map((U)=>{return J(Z.styleArgumentTerm(Z.argumentTerm(U)),Z.styleArgumentDescription(Z.argumentDescription(U)))});if(Q=Q.concat(this.formatItemList("Arguments:",q,Z)),this.groupItems($.options,Z.visibleOptions($),(U)=>U.helpGroupHeading??"Options:").forEach((U,V)=>{let K=U.map((N)=>{return J(Z.styleOptionTerm(Z.optionTerm(N)),Z.styleOptionDescription(Z.optionDescription(N)))});Q=Q.concat(this.formatItemList(V,K,Z))}),Z.showGlobalOptions){let U=Z.visibleGlobalOptions($).map((V)=>{return J(Z.styleOptionTerm(Z.optionTerm(V)),Z.styleOptionDescription(Z.optionDescription(V)))});Q=Q.concat(this.formatItemList("Global Options:",U,Z))}return this.groupItems($.commands,Z.visibleCommands($),(U)=>U.helpGroup()||"Commands:").forEach((U,V)=>{let K=U.map((N)=>{return J(Z.styleSubcommandTerm(Z.subcommandTerm(N)),Z.styleSubcommandDescription(Z.subcommandDescription(N)))});Q=Q.concat(this.formatItemList(V,K,Z))}),Q.join(`
3
- `)}displayWidth($){return Q9($).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 Y=$.padEnd(Z+$.length-z.displayWidth($)),q=2,W=(this.helpWidth??80)-Z-q-2,U;if(W<this.minWidthToWrap||z.preformatted(X))U=X;else U=z.boxWrap(X,W).replace(/\n/g,`
2
+ import{createRequire as WX}from"node:module";var tz=Object.create;var{getPrototypeOf:ez,defineProperty:W6,getOwnPropertyNames:$X}=Object;var ZX=Object.prototype.hasOwnProperty;function zX($){return this[$]}var XX,JX,QX=($,Z,z)=>{var X=$!=null&&typeof $==="object";if(X){var J=Z?XX??=new WeakMap:JX??=new WeakMap,Q=J.get($);if(Q)return Q}z=$!=null?tz(ez($)):{};let Y=Z||!$||!$.__esModule?W6(z,"default",{value:$,enumerable:!0}):z;for(let q of $X($))if(!ZX.call(Y,q))W6(Y,q,{get:zX.bind($,q),enumerable:!0});if(X)J.set($,Y);return Y};var A=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var YX=($)=>$;function qX($,Z){this[$]=YX.bind(null,Z)}var Y9=($,Z)=>{for(var z in Z)W6($,z,{get:Z[z],enumerable:!0,configurable:!0,set:qX.bind(Z,z)})};var S=($,Z)=>()=>($&&(Z=$($=0)),Z);var N0=WX(import.meta.url);var L1=A((GX)=>{class G6 extends Error{constructor($,Z,z){super(z);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=Z,this.exitCode=$,this.nestedError=void 0}}class q9 extends G6{constructor($){super(1,"commander.invalidArgument",$);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}GX.CommanderError=G6;GX.InvalidArgumentError=q9});var f4=A((BX)=>{var{InvalidArgumentError:KX}=L1();class W9{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,z)=>{if(!this.argChoices.includes(Z))throw new KX(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(Z,z);return Z},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function HX($){let Z=$.name()+($.variadic===!0?"...":"");return $.required?"<"+Z+">":"["+Z+"]"}BX.Argument=W9;BX.humanReadableArgName=HX});var U6=A((MX)=>{var{humanReadableArgName:TX}=f4();class G9{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((X)=>!X._hidden),z=$._getHelpCommand();if(z&&!z._hidden)Z.push(z);if(this.sortSubcommands)Z.sort((X,J)=>{return X.name().localeCompare(J.name())});return Z}compareOptions($,Z){let z=(X)=>{return X.short?X.short.replace(/^-/,""):X.long.replace(/^--/,"")};return z($).localeCompare(z(Z))}visibleOptions($){let Z=$.options.filter((X)=>!X.hidden),z=$._getHelpOption();if(z&&!z.hidden){let X=z.short&&$._findOption(z.short),J=z.long&&$._findOption(z.long);if(!X&&!J)Z.push(z);else if(z.long&&!J)Z.push($.createOption(z.long,z.description));else if(z.short&&!X)Z.push($.createOption(z.short,z.description))}if(this.sortOptions)Z.sort(this.compareOptions);return Z}visibleGlobalOptions($){if(!this.showGlobalOptions)return[];let Z=[];for(let z=$.parent;z;z=z.parent){let X=z.options.filter((J)=>!J.hidden);Z.push(...X)}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((z)=>TX(z)).join(" ");return $._name+($._aliases[0]?"|"+$._aliases[0]:"")+($.options.length?" [options]":"")+(Z?" "+Z:"")}optionTerm($){return $.flags}argumentTerm($){return $.name()}longestSubcommandTermLength($,Z){return Z.visibleCommands($).reduce((z,X)=>{return Math.max(z,this.displayWidth(Z.styleSubcommandTerm(Z.subcommandTerm(X))))},0)}longestOptionTermLength($,Z){return Z.visibleOptions($).reduce((z,X)=>{return Math.max(z,this.displayWidth(Z.styleOptionTerm(Z.optionTerm(X))))},0)}longestGlobalOptionTermLength($,Z){return Z.visibleGlobalOptions($).reduce((z,X)=>{return Math.max(z,this.displayWidth(Z.styleOptionTerm(Z.optionTerm(X))))},0)}longestArgumentTermLength($,Z){return Z.visibleArguments($).reduce((z,X)=>{return Math.max(z,this.displayWidth(Z.styleArgumentTerm(Z.argumentTerm(X))))},0)}commandUsage($){let Z=$._name;if($._aliases[0])Z=Z+"|"+$._aliases[0];let z="";for(let X=$.parent;X;X=X.parent)z=X.name()+" "+z;return z+Z+" "+$.usage()}commandDescription($){return $.description()}subcommandDescription($){return $.summary()||$.description()}optionDescription($){let Z=[];if($.argChoices)Z.push(`choices: ${$.argChoices.map((z)=>JSON.stringify(z)).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 z=`(${Z.join(", ")})`;if($.description)return`${$.description} ${z}`;return z}return $.description}argumentDescription($){let Z=[];if($.argChoices)Z.push(`choices: ${$.argChoices.map((z)=>JSON.stringify(z)).join(", ")}`);if($.defaultValue!==void 0)Z.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`);if(Z.length>0){let z=`(${Z.join(", ")})`;if($.description)return`${$.description} ${z}`;return z}return $.description}formatItemList($,Z,z){if(Z.length===0)return[];return[z.styleTitle($),...Z,""]}groupItems($,Z,z){let X=new Map;return $.forEach((J)=>{let Q=z(J);if(!X.has(Q))X.set(Q,[])}),Z.forEach((J)=>{let Q=z(J);if(!X.has(Q))X.set(Q,[]);X.get(Q).push(J)}),X}formatHelp($,Z){let z=Z.padWidth($,Z),X=Z.helpWidth??80;function J(U,V){return Z.formatItem(U,z,V,Z)}let Q=[`${Z.styleTitle("Usage:")} ${Z.styleUsage(Z.commandUsage($))}`,""],Y=Z.commandDescription($);if(Y.length>0)Q=Q.concat([Z.boxWrap(Z.styleCommandDescription(Y),X),""]);let q=Z.visibleArguments($).map((U)=>{return J(Z.styleArgumentTerm(Z.argumentTerm(U)),Z.styleArgumentDescription(Z.argumentDescription(U)))});if(Q=Q.concat(this.formatItemList("Arguments:",q,Z)),this.groupItems($.options,Z.visibleOptions($),(U)=>U.helpGroupHeading??"Options:").forEach((U,V)=>{let K=U.map((L)=>{return J(Z.styleOptionTerm(Z.optionTerm(L)),Z.styleOptionDescription(Z.optionDescription(L)))});Q=Q.concat(this.formatItemList(V,K,Z))}),Z.showGlobalOptions){let U=Z.visibleGlobalOptions($).map((V)=>{return J(Z.styleOptionTerm(Z.optionTerm(V)),Z.styleOptionDescription(Z.optionDescription(V)))});Q=Q.concat(this.formatItemList("Global Options:",U,Z))}return this.groupItems($.commands,Z.visibleCommands($),(U)=>U.helpGroup()||"Commands:").forEach((U,V)=>{let K=U.map((L)=>{return J(Z.styleSubcommandTerm(Z.subcommandTerm(L)),Z.styleSubcommandDescription(Z.subcommandDescription(L)))});Q=Q.concat(this.formatItemList(V,K,Z))}),Q.join(`
3
+ `)}displayWidth($){return U9($).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,z,X){let Q=" ".repeat(2);if(!z)return Q+$;let Y=$.padEnd(Z+$.length-X.displayWidth($)),q=2,G=(this.helpWidth??80)-Z-q-2,U;if(G<this.minWidthToWrap||X.preformatted(z))U=z;else U=X.boxWrap(z,G).replace(/\n/g,`
4
4
  `+" ".repeat(Z+q));return Q+Y+" ".repeat(q)+U.replace(/\n/g,`
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 Y=Q.match(z);if(Y===null){J.push("");return}let q=[Y.shift()],G=this.displayWidth(q[0]);Y.forEach((W)=>{let U=this.displayWidth(W);if(G+U<=Z){q.push(W),G+=U;return}J.push(q.join(""));let V=W.trimStart();q=[V],G=this.displayWidth(V)}),J.push(q.join(""))}),J.join(`
6
- `)}}function Q9($){let Z=/\x1b\[\d*(;\d*)*m/g;return $.replace(Z,"")}Wz.Help=J9;Wz.stripColor=Q9});var Y6=A((Bz)=>{var{InvalidArgumentError:Kz}=B1();class q9{constructor($,Z){this.flags=$,this.description=Z||"",this.required=$.includes("<"),this.optional=$.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test($),this.mandatory=!1;let X=Hz($);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 Kz(`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 Y9(this.name().replace(/^no-/,""));return Y9(this.name())}helpGroup($){return this.helpGroupHeading=$,this}is($){return this.short===$||this.long===$}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class G9{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 Y9($){return $.split("-").reduce((Z,X)=>{return Z+X[0].toUpperCase()+X.slice(1)})}function Hz($){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 Y=Q[0],q=`option creation failed due to '${Y}' in option flags '${$}'`;if(/^-[^-][^-]/.test(Y))throw Error(`${q}
5
+ ${Q}`)}boxWrap($,Z){if(Z<this.minWidthToWrap)return $;let z=$.split(/\r\n|\n/),X=/[\s]*[^\s]+/g,J=[];return z.forEach((Q)=>{let Y=Q.match(X);if(Y===null){J.push("");return}let q=[Y.shift()],W=this.displayWidth(q[0]);Y.forEach((G)=>{let U=this.displayWidth(G);if(W+U<=Z){q.push(G),W+=U;return}J.push(q.join(""));let V=G.trimStart();q=[V],W=this.displayWidth(V)}),J.push(q.join(""))}),J.join(`
6
+ `)}}function U9($){let Z=/\x1b\[\d*(;\d*)*m/g;return $.replace(Z,"")}MX.Help=G9;MX.stripColor=U9});var V6=A((wX)=>{var{InvalidArgumentError:AX}=L1();class K9{constructor($,Z){this.flags=$,this.description=Z||"",this.required=$.includes("<"),this.optional=$.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test($),this.mandatory=!1;let z=IX($);if(this.short=z.shortFlag,this.long=z.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,z)=>{if(!this.argChoices.includes(Z))throw new AX(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(Z,z);return Z},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return V9(this.name().replace(/^no-/,""));return V9(this.name())}helpGroup($){return this.helpGroupHeading=$,this}is($){return this.short===$||this.long===$}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class H9{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,z)=>{if(this.positiveOptions.has(z))this.dualOptions.add(z)})}valueFromOption($,Z){let z=Z.attributeName();if(!this.dualOptions.has(z))return!0;let X=this.negativeOptions.get(z).presetArg,J=X!==void 0?X:!1;return Z.negate===(J===$)}}function V9($){return $.split("-").reduce((Z,z)=>{return Z+z[0].toUpperCase()+z.slice(1)})}function IX($){let Z,z,X=/^-[^-]$/,J=/^--[^-]/,Q=$.split(/[ |,]+/).concat("guard");if(X.test(Q[0]))Z=Q.shift();if(J.test(Q[0]))z=Q.shift();if(!Z&&X.test(Q[0]))Z=Q.shift();if(!Z&&J.test(Q[0]))Z=z,z=Q.shift();if(Q[0].startsWith("-")){let Y=Q[0],q=`option creation failed due to '${Y}' in option flags '${$}'`;if(/^-[^-][^-]/.test(Y))throw Error(`${q}
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
- - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(z.test(Y))throw Error(`${q}
9
+ - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(X.test(Y))throw Error(`${q}
10
10
  - too many short flags`);if(J.test(Y))throw Error(`${q}
11
11
  - too many long flags`);throw Error(`${q}
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}}Bz.Option=q9;Bz.DualOptions=G9});var W9=A((Oz)=>{function Tz($,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 Mz($,Z){if(!Z||Z.length===0)return"";Z=Array.from(new Set(Z));let X=$.startsWith("--");if(X)$=$.slice(2),Z=Z.map((Y)=>Y.slice(2));let z=[],J=3,Q=0.4;if(Z.forEach((Y)=>{if(Y.length<=1)return;let q=Tz($,Y),G=Math.max($.length,Y.length);if((G-q)/G>Q){if(q<J)J=q,z=[Y];else if(q===J)z.push(Y)}}),z.sort((Y,q)=>Y.localeCompare(q)),X)z=z.map((Y)=>`--${Y}`);if(z.length>1)return`
13
- (Did you mean one of ${z.join(", ")}?)`;if(z.length===1)return`
14
- (Did you mean ${z[0]}?)`;return""}Oz.suggestSimilar=Mz});var H9=A((Ez)=>{var Az=L0("node:events").EventEmitter,q6=L0("node:child_process"),k0=L0("node:path"),k2=L0("node:fs"),m=L0("node:process"),{Argument:wz,humanReadableArgName:Iz}=y2(),{CommanderError:G6}=B1(),{Help:Fz,stripColor:Rz}=Q6(),{Option:U9,DualOptions:Pz}=Y6(),{suggestSimilar:V9}=W9();class U6 extends Az{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)=>m.stdout.write(Z),writeErr:(Z)=>m.stderr.write(Z),outputError:(Z,X)=>X(Z),getOutHelpWidth:()=>m.stdout.isTTY?m.stdout.columns:void 0,getErrHelpWidth:()=>m.stderr.isTTY?m.stderr.columns:void 0,getOutHasColors:()=>W6()??(m.stdout.isTTY&&m.stdout.hasColors?.()),getErrHasColors:()=>W6()??(m.stderr.isTTY&&m.stderr.hasColors?.()),stripColor:(Z)=>Rz(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,Y]=$.match(/([^ ]+) *(.*)/),q=this.createCommand(Q);if(z)q.description(z),q._executableHandler=!0;if(J.isDefault)this._defaultCommandName=q._name;if(q._hidden=!!(J.noHelp||J.hidden),q._executableFile=J.executableFile||null,Y)q.arguments(Y);if(this._registerCommand(q),q.parent=this,q.copyInheritedSettings(this),z)return this;return q}createCommand($){return new U6($)}createHelp(){return Object.assign(new Fz,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 wz($,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",Y=this.createCommand(z);if(Y.helpOption(!1),J)Y.arguments(J);if(Q)Y.description(Q);if(this._addImplicitHelpCommand=!0,this._helpCommand=Y,$||Z)this._initCommandGroup(Y);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 G6($,Z,X));m.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 U9($,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,Y)=>{if(J==null&&$.presetArg!==void 0)J=$.presetArg;let q=this.getOptionValue(X);if(J!==null&&$.parseArg)J=this._callParseArg($,J,q,Q);else if(J!==null&&$.variadic)J=$._collectValue(J,q);if(J==null)if($.negate)J=!1;else if($.isBoolean()||$.optional)J=!0;else J="";this.setOptionValueWithSource(X,J,Y)};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 U9)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 Y=z;z=(q,G)=>{let W=Y.exec(q);return W?W[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(m.versions?.electron)Z.from="electron";let z=m.execArgv??[];if(z.includes("-e")||z.includes("--eval")||z.includes("-p")||z.includes("--print"))Z.from="eval"}if($===void 0)$=m.argv;this.rawArgs=$.slice();let X;switch(Z.from){case void 0:case"node":this._scriptPath=$[1],X=$.slice(2);break;case"electron":if(m.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
- - 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(k2.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
- - if '${X}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
12
+ - unrecognised flag format`)}if(Z===void 0&&z===void 0)throw Error(`option creation failed due to no flags found in '${$}'.`);return{shortFlag:Z,longFlag:z}}wX.Option=K9;wX.DualOptions=H9});var B9=A((EX)=>{function PX($,Z){if(Math.abs($.length-Z.length)>3)return Math.max($.length,Z.length);let z=[];for(let X=0;X<=$.length;X++)z[X]=[X];for(let X=0;X<=Z.length;X++)z[0][X]=X;for(let X=1;X<=Z.length;X++)for(let J=1;J<=$.length;J++){let Q=1;if($[J-1]===Z[X-1])Q=0;else Q=1;if(z[J][X]=Math.min(z[J-1][X]+1,z[J][X-1]+1,z[J-1][X-1]+Q),J>1&&X>1&&$[J-1]===Z[X-2]&&$[J-2]===Z[X-1])z[J][X]=Math.min(z[J][X],z[J-2][X-2]+1)}return z[$.length][Z.length]}function _X($,Z){if(!Z||Z.length===0)return"";Z=Array.from(new Set(Z));let z=$.startsWith("--");if(z)$=$.slice(2),Z=Z.map((Y)=>Y.slice(2));let X=[],J=3,Q=0.4;if(Z.forEach((Y)=>{if(Y.length<=1)return;let q=PX($,Y),W=Math.max($.length,Y.length);if((W-q)/W>Q){if(q<J)J=q,X=[Y];else if(q===J)X.push(Y)}}),X.sort((Y,q)=>Y.localeCompare(q)),z)X=X.map((Y)=>`--${Y}`);if(X.length>1)return`
13
+ (Did you mean one of ${X.join(", ")}?)`;if(X.length===1)return`
14
+ (Did you mean ${X[0]}?)`;return""}EX.suggestSimilar=_X});var M9=A((fX)=>{var jX=N0("node:events").EventEmitter,K6=N0("node:child_process"),f0=N0("node:path"),g4=N0("node:fs"),d=N0("node:process"),{Argument:SX,humanReadableArgName:bX}=f4(),{CommanderError:H6}=L1(),{Help:xX,stripColor:yX}=U6(),{Option:L9,DualOptions:kX}=V6(),{suggestSimilar:N9}=B9();class L6 extends jX{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)=>d.stdout.write(Z),writeErr:(Z)=>d.stderr.write(Z),outputError:(Z,z)=>z(Z),getOutHelpWidth:()=>d.stdout.isTTY?d.stdout.columns:void 0,getErrHelpWidth:()=>d.stderr.isTTY?d.stderr.columns:void 0,getOutHasColors:()=>B6()??(d.stdout.isTTY&&d.stdout.hasColors?.()),getErrHasColors:()=>B6()??(d.stderr.isTTY&&d.stderr.hasColors?.()),stripColor:(Z)=>yX(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,z){let X=Z,J=z;if(typeof X==="object"&&X!==null)J=X,X=null;J=J||{};let[,Q,Y]=$.match(/([^ ]+) *(.*)/),q=this.createCommand(Q);if(X)q.description(X),q._executableHandler=!0;if(J.isDefault)this._defaultCommandName=q._name;if(q._hidden=!!(J.noHelp||J.hidden),q._executableFile=J.executableFile||null,Y)q.arguments(Y);if(this._registerCommand(q),q.parent=this,q.copyInheritedSettings(this),X)return this;return q}createCommand($){return new L6($)}createHelp(){return Object.assign(new xX,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 SX($,Z)}argument($,Z,z,X){let J=this.createArgument($,Z);if(typeof z==="function")J.default(X).argParser(z);else J.default(z);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 z=$??"help [command]",[,X,J]=z.match(/([^ ]+) *(.*)/),Q=Z??"display help for command",Y=this.createCommand(X);if(Y.helpOption(!1),J)Y.arguments(J);if(Q)Y.description(Q);if(this._addImplicitHelpCommand=!0,this._helpCommand=Y,$||Z)this._initCommandGroup(Y);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 z=["preSubcommand","preAction","postAction"];if(!z.includes($))throw Error(`Unexpected value for event passed to hook : '${$}'.
16
+ Expecting one of '${z.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,z){if(this._exitCallback)this._exitCallback(new H6($,Z,z));d.exit($)}action($){let Z=(z)=>{let X=this.registeredArguments.length,J=z.slice(0,X);if(this._storeOptionsAsProperties)J[X]=this;else J[X]=this.opts();return J.push(this),$.apply(this,J)};return this._actionHandler=Z,this}createOption($,Z){return new L9($,Z)}_callParseArg($,Z,z,X){try{return $.parseArg(Z,z)}catch(J){if(J.code==="commander.invalidArgument"){let Q=`${X} ${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 z=$.long&&this._findOption($.long)?$.long:$.short;throw Error(`Cannot add option '${$.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${z}'
17
+ - already used by option '${Z.flags}'`)}this._initOptionGroup($),this.options.push($)}_registerCommand($){let Z=(X)=>{return[X.name()].concat(X.aliases())},z=Z($).find((X)=>this._findCommand(X));if(z){let X=Z(this._findCommand(z)).join("|"),J=Z($).join("|");throw Error(`cannot add command '${J}' as already have command '${X}'`)}this._initCommandGroup($),this.commands.push($)}addOption($){this._registerOption($);let Z=$.name(),z=$.attributeName();if($.negate){let J=$.long.replace(/^--no-/,"--");if(!this._findOption(J))this.setOptionValueWithSource(z,$.defaultValue===void 0?!0:$.defaultValue,"default")}else if($.defaultValue!==void 0)this.setOptionValueWithSource(z,$.defaultValue,"default");let X=(J,Q,Y)=>{if(J==null&&$.presetArg!==void 0)J=$.presetArg;let q=this.getOptionValue(z);if(J!==null&&$.parseArg)J=this._callParseArg($,J,q,Q);else if(J!==null&&$.variadic)J=$._collectValue(J,q);if(J==null)if($.negate)J=!1;else if($.isBoolean()||$.optional)J=!0;else J="";this.setOptionValueWithSource(z,J,Y)};if(this.on("option:"+Z,(J)=>{let Q=`error: option '${$.flags}' argument '${J}' is invalid.`;X(J,Q,"cli")}),$.envVar)this.on("optionEnv:"+Z,(J)=>{let Q=`error: option '${$.flags}' value '${J}' from env '${$.envVar}' is invalid.`;X(J,Q,"env")});return this}_optionEx($,Z,z,X,J){if(typeof Z==="object"&&Z instanceof L9)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let Q=this.createOption(Z,z);if(Q.makeOptionMandatory(!!$.mandatory),typeof X==="function")Q.default(J).argParser(X);else if(X instanceof RegExp){let Y=X;X=(q,W)=>{let G=Y.exec(q);return G?G[0]:W},Q.default(J).argParser(X)}else Q.default(X);return this.addOption(Q)}option($,Z,z,X){return this._optionEx({},$,Z,z,X)}requiredOption($,Z,z,X){return this._optionEx({mandatory:!0},$,Z,z,X)}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,z){if(this._storeOptionsAsProperties)this[$]=Z;else this._optionValues[$]=Z;return this._optionValueSources[$]=z,this}getOptionValueSource($){return this._optionValueSources[$]}getOptionValueSourceWithGlobals($){let Z;return this._getCommandAndAncestors().forEach((z)=>{if(z.getOptionValueSource($)!==void 0)Z=z.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(d.versions?.electron)Z.from="electron";let X=d.execArgv??[];if(X.includes("-e")||X.includes("--eval")||X.includes("-p")||X.includes("--print"))Z.from="eval"}if($===void 0)$=d.argv;this.rawArgs=$.slice();let z;switch(Z.from){case void 0:case"node":this._scriptPath=$[1],z=$.slice(2);break;case"electron":if(d.defaultApp)this._scriptPath=$[1],z=$.slice(2);else z=$.slice(1);break;case"user":z=$.slice(0);break;case"eval":z=$.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",z}parse($,Z){this._prepareForParse();let z=this._prepareUserArgs($,Z);return this._parseCommand([],z),this}async parseAsync($,Z){this._prepareForParse();let z=this._prepareUserArgs($,Z);return await this._parseCommand([],z),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
+ - 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,z){if(g4.existsSync($))return;let X=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
+ - if '${z}' 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(W,U){let V=k0.resolve(W,U);if(k2.existsSync(V))return V;if(z.includes(k0.extname(U)))return;let K=z.find((N)=>k2.existsSync(`${V}${N}`));if(K)return`${V}${K}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Q=$._executableFile||`${this._name}-${$._name}`,Y=this._executableDir||"";if(this._scriptPath){let W;try{W=k2.realpathSync(this._scriptPath)}catch{W=this._scriptPath}Y=k0.resolve(k0.dirname(W),Y)}if(Y){let W=J(Y,Q);if(!W&&!$._executableFile&&this._scriptPath){let U=k0.basename(this._scriptPath,k0.extname(this._scriptPath));if(U!==this._name)W=J(Y,`${U}-${$._name}`)}Q=W||Q}X=z.includes(k0.extname(Q));let q;if(m.platform!=="win32")if(X)Z.unshift(Q),Z=K9(m.execArgv).concat(Z),q=q6.spawn(m.argv[0],Z,{stdio:"inherit"});else q=q6.spawn(Q,Z,{stdio:"inherit"});else this._checkForMissingExecutable(Q,Y,$._name),Z.unshift(Q),Z=K9(m.execArgv).concat(Z),q=q6.spawn(m.execPath,Z,{stdio:"inherit"});if(!q.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((U)=>{m.on(U,()=>{if(q.killed===!1&&q.exitCode===null)q.kill(U)})});let G=this._exitCallback;q.on("close",(W)=>{if(W=W??1,!G)m.exit(W);else G(new G6(W,"commander.executeSubCommandAsync","(close)"))}),q.on("error",(W)=>{if(W.code==="ENOENT")this._checkForMissingExecutable(Q,Y,$._name);else if(W.code==="EACCES")throw Error(`'${Q}' not executable`);if(!G)m.exit(1);else{let U=new G6(1,"commander.executeSubCommandAsync","(error)");U.nestedError=W,G(U)}}),this.runningCommand=q}_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 Y=`error: command-argument value '${z}' is invalid for argument '${X.name()}'.`;Q=this._callParseArg(X,z,J,Y)}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,Y)=>{return $(X,Y,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(W){return W.length>1&&W[0]==="-"}let Q=(W)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(W))return!1;return!this._getCommandAndAncestors().some((U)=>U.options.map((V)=>V.short).some((V)=>/^-\d$/.test(V)))},Y=null,q=null,G=0;while(G<$.length||q){let W=q??$[G++];if(q=null,W==="--"){if(z===X)z.push(W);z.push(...$.slice(G));break}if(Y&&(!J(W)||Q(W))){this.emit(`option:${Y.name()}`,W);continue}if(Y=null,J(W)){let U=this._findOption(W);if(U){if(U.required){let V=$[G++];if(V===void 0)this.optionMissingArgument(U);this.emit(`option:${U.name()}`,V)}else if(U.optional){let V=null;if(G<$.length&&(!J($[G])||Q($[G])))V=$[G++];this.emit(`option:${U.name()}`,V)}else this.emit(`option:${U.name()}`);Y=U.variadic?U:null;continue}}if(W.length>2&&W[0]==="-"&&W[1]!=="-"){let U=this._findOption(`-${W[1]}`);if(U){if(U.required||U.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${U.name()}`,W.slice(2));else this.emit(`option:${U.name()}`),q=`-${W.slice(2)}`;continue}}if(/^--[^=]+=/.test(W)){let U=W.indexOf("="),V=this._findOption(W.slice(0,U));if(V&&(V.required||V.optional)){this.emit(`option:${V.name()}`,W.slice(U+1));continue}}if(z===Z&&J(W)&&!(this.commands.length===0&&Q(W)))z=X;if((this._enablePositionalOptions||this._passThroughOptions)&&Z.length===0&&X.length===0){if(this._findCommand(W)){Z.push(W),X.push(...$.slice(G));break}else if(this._getHelpCommand()&&W===this._getHelpCommand().name()){Z.push(W,...$.slice(G));break}else if(this._defaultCommandName){X.push(W,...$.slice(G));break}}if(this._passThroughOptions){z.push(W,...$.slice(G));break}z.push(W)}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
+ - ${X}`;throw Error(J)}_executeSubCommand($,Z){Z=Z.slice();let z=!1,X=[".js",".ts",".tsx",".mjs",".cjs"];function J(G,U){let V=f0.resolve(G,U);if(g4.existsSync(V))return V;if(X.includes(f0.extname(U)))return;let K=X.find((L)=>g4.existsSync(`${V}${L}`));if(K)return`${V}${K}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Q=$._executableFile||`${this._name}-${$._name}`,Y=this._executableDir||"";if(this._scriptPath){let G;try{G=g4.realpathSync(this._scriptPath)}catch{G=this._scriptPath}Y=f0.resolve(f0.dirname(G),Y)}if(Y){let G=J(Y,Q);if(!G&&!$._executableFile&&this._scriptPath){let U=f0.basename(this._scriptPath,f0.extname(this._scriptPath));if(U!==this._name)G=J(Y,`${U}-${$._name}`)}Q=G||Q}z=X.includes(f0.extname(Q));let q;if(d.platform!=="win32")if(z)Z.unshift(Q),Z=T9(d.execArgv).concat(Z),q=K6.spawn(d.argv[0],Z,{stdio:"inherit"});else q=K6.spawn(Q,Z,{stdio:"inherit"});else this._checkForMissingExecutable(Q,Y,$._name),Z.unshift(Q),Z=T9(d.execArgv).concat(Z),q=K6.spawn(d.execPath,Z,{stdio:"inherit"});if(!q.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((U)=>{d.on(U,()=>{if(q.killed===!1&&q.exitCode===null)q.kill(U)})});let W=this._exitCallback;q.on("close",(G)=>{if(G=G??1,!W)d.exit(G);else W(new H6(G,"commander.executeSubCommandAsync","(close)"))}),q.on("error",(G)=>{if(G.code==="ENOENT")this._checkForMissingExecutable(Q,Y,$._name);else if(G.code==="EACCES")throw Error(`'${Q}' not executable`);if(!W)d.exit(1);else{let U=new H6(1,"commander.executeSubCommandAsync","(error)");U.nestedError=G,W(U)}}),this.runningCommand=q}_dispatchSubcommand($,Z,z){let X=this._findCommand($);if(!X)this.help({error:!0});X._prepareForParse();let J;return J=this._chainOrCallSubCommandHook(J,X,"preSubcommand"),J=this._chainOrCall(J,()=>{if(X._executableHandler)this._executeSubCommand(X,Z.concat(z));else return X._parseCommand(Z,z)}),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 $=(z,X,J)=>{let Q=X;if(X!==null&&z.parseArg){let Y=`error: command-argument value '${X}' is invalid for argument '${z.name()}'.`;Q=this._callParseArg(z,X,J,Y)}return Q};this._checkNumberOfArguments();let Z=[];this.registeredArguments.forEach((z,X)=>{let J=z.defaultValue;if(z.variadic){if(X<this.args.length){if(J=this.args.slice(X),z.parseArg)J=J.reduce((Q,Y)=>{return $(z,Y,Q)},z.defaultValue)}else if(J===void 0)J=[]}else if(X<this.args.length){if(J=this.args[X],z.parseArg)J=$(z,J,z.defaultValue)}Z[X]=J}),this.processedArgs=Z}_chainOrCall($,Z){if($?.then&&typeof $.then==="function")return $.then(()=>Z());return Z()}_chainOrCallHooks($,Z){let z=$,X=[];if(this._getCommandAndAncestors().reverse().filter((J)=>J._lifeCycleHooks[Z]!==void 0).forEach((J)=>{J._lifeCycleHooks[Z].forEach((Q)=>{X.push({hookedCommand:J,callback:Q})})}),Z==="postAction")X.reverse();return X.forEach((J)=>{z=this._chainOrCall(z,()=>{return J.callback(J.hookedCommand,this)})}),z}_chainOrCallSubCommandHook($,Z,z){let X=$;if(this._lifeCycleHooks[z]!==void 0)this._lifeCycleHooks[z].forEach((J)=>{X=this._chainOrCall(X,()=>{return J(this,Z)})});return X}_parseCommand($,Z){let z=this.parseOptions(Z);if(this._parseOptionsEnv(),this._parseOptionsImplied(),$=$.concat(z.operands),Z=z.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(z.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let X=()=>{if(z.unknown.length>0)this.unknownOption(z.unknown[0])},J=`command:${this.name()}`;if(this._actionHandler){X(),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))X(),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 X(),this._processArguments()}else if(this.commands.length)X(),this.help({error:!0});else X(),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((z)=>{let X=z.attributeName();if(this.getOptionValue(X)===void 0)return!1;return this.getOptionValueSource(X)!=="default"});$.filter((z)=>z.conflictsWith.length>0).forEach((z)=>{let X=$.find((J)=>z.conflictsWith.includes(J.attributeName()));if(X)this._conflictingOption(z,X)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(($)=>{$._checkForConflictingLocalOptions()})}parseOptions($){let Z=[],z=[],X=Z;function J(G){return G.length>1&&G[0]==="-"}let Q=(G)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(G))return!1;return!this._getCommandAndAncestors().some((U)=>U.options.map((V)=>V.short).some((V)=>/^-\d$/.test(V)))},Y=null,q=null,W=0;while(W<$.length||q){let G=q??$[W++];if(q=null,G==="--"){if(X===z)X.push(G);X.push(...$.slice(W));break}if(Y&&(!J(G)||Q(G))){this.emit(`option:${Y.name()}`,G);continue}if(Y=null,J(G)){let U=this._findOption(G);if(U){if(U.required){let V=$[W++];if(V===void 0)this.optionMissingArgument(U);this.emit(`option:${U.name()}`,V)}else if(U.optional){let V=null;if(W<$.length&&(!J($[W])||Q($[W])))V=$[W++];this.emit(`option:${U.name()}`,V)}else this.emit(`option:${U.name()}`);Y=U.variadic?U:null;continue}}if(G.length>2&&G[0]==="-"&&G[1]!=="-"){let U=this._findOption(`-${G[1]}`);if(U){if(U.required||U.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${U.name()}`,G.slice(2));else this.emit(`option:${U.name()}`),q=`-${G.slice(2)}`;continue}}if(/^--[^=]+=/.test(G)){let U=G.indexOf("="),V=this._findOption(G.slice(0,U));if(V&&(V.required||V.optional)){this.emit(`option:${V.name()}`,G.slice(U+1));continue}}if(X===Z&&J(G)&&!(this.commands.length===0&&Q(G)))X=z;if((this._enablePositionalOptions||this._passThroughOptions)&&Z.length===0&&z.length===0){if(this._findCommand(G)){Z.push(G),z.push(...$.slice(W));break}else if(this._getHelpCommand()&&G===this._getHelpCommand().name()){Z.push(G,...$.slice(W));break}else if(this._defaultCommandName){z.push(G,...$.slice(W));break}}if(this._passThroughOptions){X.push(G,...$.slice(W));break}X.push(G)}return{operands:Z,unknown:z}}opts(){if(this._storeOptionsAsProperties){let $={},Z=this.options.length;for(let z=0;z<Z;z++){let X=this.options[z].attributeName();$[X]=X===this._versionOptionName?this._version:this[X]}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 m.env){let Z=$.attributeName();if(this.getOptionValue(Z)===void 0||["default","config","env"].includes(this.getOptionValueSource(Z)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,m.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new Pz(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 Y=Q.attributeName(),q=this.getOptionValue(Y),G=this.options.find((U)=>U.negate&&Y===U.attributeName()),W=this.options.find((U)=>!U.negate&&Y===U.attributeName());if(G&&(G.presetArg===void 0&&q===!1||G.presetArg!==void 0&&q===G.presetArg))return G;return W||Q},z=(Q)=>{let Y=X(Q),q=Y.attributeName();if(this.getOptionValueSource(q)==="env")return`environment variable '${Y.envVar}'`;return`option '${Y.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((Y)=>Y.long).map((Y)=>Y.long);z=z.concat(Q),J=J.parent}while(J&&!J._enablePositionalOptions);Z=V9($,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=V9($,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 Iz(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=k0.basename($,k0.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=(Y)=>this._outputConfiguration.writeErr(Y),z=this._outputConfiguration.getErrHasColors(),J=this._outputConfiguration.getErrHelpWidth();else X=(Y)=>this._outputConfiguration.writeOut(Y),z=this._outputConfiguration.getOutHasColors(),J=this._outputConfiguration.getOutHelpWidth();return{error:Z,write:(Y)=>{if(!z)Y=this._outputConfiguration.stripColor(Y);return X(Y)},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(m.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
- 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 K9($){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 W6(){if(m.env.NO_COLOR||m.env.FORCE_COLOR==="0"||m.env.FORCE_COLOR==="false")return!1;if(m.env.FORCE_COLOR||m.env.CLICOLOR_FORCE!==void 0)return!0;return}Ez.Command=U6;Ez.useColor=W6});var T9=A((bz)=>{var{Argument:B9}=y2(),{Command:V6}=H9(),{CommanderError:jz,InvalidArgumentError:N9}=B1(),{Help:Sz}=Q6(),{Option:L9}=Y6();bz.program=new V6;bz.createCommand=($)=>new V6($);bz.createOption=($,Z)=>new L9($,Z);bz.createArgument=($,Z)=>new B9($,Z);bz.Command=V6;bz.Option=L9;bz.Argument=B9;bz.Help=Sz;bz.CommanderError=jz;bz.InvalidArgumentError=N9;bz.InvalidOptionArgumentError=N9});var v=A((oz)=>{var K6=Symbol.for("yaml.alias"),D9=Symbol.for("yaml.document"),f2=Symbol.for("yaml.map"),A9=Symbol.for("yaml.pair"),H6=Symbol.for("yaml.scalar"),g2=Symbol.for("yaml.seq"),f0=Symbol.for("yaml.node.type"),pz=($)=>!!$&&typeof $==="object"&&$[f0]===K6,lz=($)=>!!$&&typeof $==="object"&&$[f0]===D9,iz=($)=>!!$&&typeof $==="object"&&$[f0]===f2,nz=($)=>!!$&&typeof $==="object"&&$[f0]===A9,w9=($)=>!!$&&typeof $==="object"&&$[f0]===H6,rz=($)=>!!$&&typeof $==="object"&&$[f0]===g2;function I9($){if($&&typeof $==="object")switch($[f0]){case f2:case g2:return!0}return!1}function sz($){if($&&typeof $==="object")switch($[f0]){case K6:case f2:case H6:case g2:return!0}return!1}var az=($)=>(w9($)||I9($))&&!!$.anchor;oz.ALIAS=K6;oz.DOC=D9;oz.MAP=f2;oz.NODE_TYPE=f0;oz.PAIR=A9;oz.SCALAR=H6;oz.SEQ=g2;oz.hasAnchor=az;oz.isAlias=pz;oz.isCollection=I9;oz.isDocument=lz;oz.isMap=iz;oz.isNode=sz;oz.isPair=nz;oz.isScalar=w9;oz.isSeq=rz});var N1=A((BJ)=>{var J0=v(),H0=Symbol("break visit"),F9=Symbol("skip children"),x0=Symbol("remove node");function h2($,Z){let X=R9(Z);if(J0.isDocument($)){if(C$(null,$.contents,X,Object.freeze([$]))===x0)$.contents=null}else C$(null,$,X,Object.freeze([]))}h2.BREAK=H0;h2.SKIP=F9;h2.REMOVE=x0;function C$($,Z,X,z){let J=P9($,Z,X,z);if(J0.isNode(J)||J0.isPair(J))return E9($,z,J),C$($,J,X,z);if(typeof J!=="symbol"){if(J0.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let Q=0;Q<Z.items.length;++Q){let Y=C$(Q,Z.items[Q],X,z);if(typeof Y==="number")Q=Y-1;else if(Y===H0)return H0;else if(Y===x0)Z.items.splice(Q,1),Q-=1}}else if(J0.isPair(Z)){z=Object.freeze(z.concat(Z));let Q=C$("key",Z.key,X,z);if(Q===H0)return H0;else if(Q===x0)Z.key=null;let Y=C$("value",Z.value,X,z);if(Y===H0)return H0;else if(Y===x0)Z.value=null}}return J}async function v2($,Z){let X=R9(Z);if(J0.isDocument($)){if(await j$(null,$.contents,X,Object.freeze([$]))===x0)$.contents=null}else await j$(null,$,X,Object.freeze([]))}v2.BREAK=H0;v2.SKIP=F9;v2.REMOVE=x0;async function j$($,Z,X,z){let J=await P9($,Z,X,z);if(J0.isNode(J)||J0.isPair(J))return E9($,z,J),j$($,J,X,z);if(typeof J!=="symbol"){if(J0.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let Q=0;Q<Z.items.length;++Q){let Y=await j$(Q,Z.items[Q],X,z);if(typeof Y==="number")Q=Y-1;else if(Y===H0)return H0;else if(Y===x0)Z.items.splice(Q,1),Q-=1}}else if(J0.isPair(Z)){z=Object.freeze(z.concat(Z));let Q=await j$("key",Z.key,X,z);if(Q===H0)return H0;else if(Q===x0)Z.key=null;let Y=await j$("value",Z.value,X,z);if(Y===H0)return H0;else if(Y===x0)Z.value=null}}return J}function R9($){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 P9($,Z,X,z){if(typeof X==="function")return X($,Z,z);if(J0.isMap(Z))return X.Map?.($,Z,z);if(J0.isSeq(Z))return X.Seq?.($,Z,z);if(J0.isPair(Z))return X.Pair?.($,Z,z);if(J0.isScalar(Z))return X.Scalar?.($,Z,z);if(J0.isAlias(Z))return X.Alias?.($,Z,z);return}function E9($,Z,X){let z=Z[Z.length-1];if(J0.isCollection(z))z.items[$]=X;else if(J0.isPair(z))if($==="key")z.key=X;else z.value=X;else if(J0.isDocument(z))z.contents=X;else{let J=J0.isAlias(z)?"alias":"scalar";throw Error(`Cannot replace node with ${J} parent`)}}BJ.visit=h2;BJ.visitAsync=v2});var B6=A((DJ)=>{var _9=v(),TJ=N1(),MJ={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},OJ=($)=>$.replace(/[!,[\]{}]/g,(Z)=>MJ[Z]);class A0{constructor($,Z){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},A0.defaultYaml,$),this.tags=Object.assign({},A0.defaultTags,Z)}clone(){let $=new A0(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new A0(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:A0.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},A0.defaultTags);break}return $}add($,Z){if(this.atNextDocument)this.yaml={explicit:A0.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},A0.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+OJ($.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&&_9.isNode($.contents)){let J={};TJ.visit($.contents,(Q,Y)=>{if(_9.isNode(Y)&&Y.tag)J[Y.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((Y)=>Y.startsWith(Q)))Z.push(`%TAG ${J} ${Q}`)}return Z.join(`
28
- `)}}A0.defaultYaml={explicit:!1,version:"1.2"};A0.defaultTags={"!!":"tag:yaml.org,2002:"};DJ.Directives=A0});var u2=A((RJ)=>{var C9=v(),wJ=N1();function IJ($){if(/[\x00-\x19\s,[\]{}]/.test($)){let X=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(X)}return!0}function j9($){let Z=new Set;return wJ.visit($,{Value(X,z){if(z.anchor)Z.add(z.anchor)}}),Z}function S9($,Z){for(let X=1;;++X){let z=`${$}${X}`;if(!Z.has(z))return z}}function FJ($,Z){let X=[],z=new Map,J=null;return{onAnchor:(Q)=>{X.push(Q),J??(J=j9($));let Y=S9(Z,J);return J.add(Y),Y},setAnchors:()=>{for(let Q of X){let Y=z.get(Q);if(typeof Y==="object"&&Y.anchor&&(C9.isScalar(Y.node)||C9.isCollection(Y.node)))Y.node.anchor=Y.anchor;else{let q=Error("Failed to resolve repeated object (this should not happen)");throw q.source=Q,q}}},sourceObjects:z}}RJ.anchorIsValid=IJ;RJ.anchorNames=j9;RJ.createNodeAnchors=FJ;RJ.findNewAnchor=S9});var N6=A((jJ)=>{function L1($,Z,X,z){if(z&&typeof z==="object")if(Array.isArray(z))for(let J=0,Q=z.length;J<Q;++J){let Y=z[J],q=L1($,z,String(J),Y);if(q===void 0)delete z[J];else if(q!==Y)z[J]=q}else if(z instanceof Map)for(let J of Array.from(z.keys())){let Q=z.get(J),Y=L1($,z,J,Q);if(Y===void 0)z.delete(J);else if(Y!==Q)z.set(J,Y)}else if(z instanceof Set)for(let J of Array.from(z)){let Q=L1($,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 Y=L1($,z,J,Q);if(Y===void 0)delete z[J];else if(Y!==Q)z[J]=Y}return $.call(Z,X,z)}jJ.applyReviver=L1});var p0=A((xJ)=>{var bJ=v();function b9($,Z,X){if(Array.isArray($))return $.map((z,J)=>b9(z,String(J),X));if($&&typeof $.toJSON==="function"){if(!X||!bJ.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 $}xJ.toJS=b9});var m2=A((gJ)=>{var kJ=N6(),x9=v(),fJ=p0();class y9{constructor($){Object.defineProperty(this,x9.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(!x9.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},Y=fJ.toJS(this,"",Q);if(typeof z==="function")for(let{count:q,res:G}of Q.anchors.values())z(G,q);return typeof J==="function"?kJ.applyReviver(J,{"":Y},"",Y):Y}}gJ.NodeBase=y9});var T1=A((cJ)=>{var vJ=u2(),uJ=N1(),S$=v(),mJ=m2(),dJ=p0();class k9 extends mJ.NodeBase{constructor($){super(S$.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=[],uJ.visit($,{Node:(J,Q)=>{if(S$.isAlias(Q)||S$.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 q=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(q)}let Y=X.get(Q);if(!Y)dJ.toJS(Q,null,Z),Y=X.get(Q);if(Y?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(J>=0){if(Y.count+=1,Y.aliasCount===0)Y.aliasCount=d2(z,Q,X);if(Y.count*Y.aliasCount>J)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return Y.res}toString($,Z,X){let z=`*${this.source}`;if($){if(vJ.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 d2($,Z,X){if(S$.isAlias(Z)){let z=Z.resolve($),J=X&&z&&X.get(z);return J?J.count*J.aliasCount:0}else if(S$.isCollection(Z)){let z=0;for(let J of Z.items){let Q=d2($,J,X);if(Q>z)z=Q}return z}else if(S$.isPair(Z)){let z=d2($,Z.key,X),J=d2($,Z.value,X);return Math.max(z,J)}return 1}cJ.Alias=k9});var $0=A((sJ)=>{var lJ=v(),iJ=m2(),nJ=p0(),rJ=($)=>!$||typeof $!=="function"&&typeof $!=="object";class V$ extends iJ.NodeBase{constructor($){super(lJ.SCALAR);this.value=$}toJSON($,Z){return Z?.keep?this.value:nJ.toJS(this.value,$,Z)}toString(){return String(this.value)}}V$.BLOCK_FOLDED="BLOCK_FOLDED";V$.BLOCK_LITERAL="BLOCK_LITERAL";V$.PLAIN="PLAIN";V$.QUOTE_DOUBLE="QUOTE_DOUBLE";V$.QUOTE_SINGLE="QUOTE_SINGLE";sJ.Scalar=V$;sJ.isScalarValue=rJ});var M1=A((XQ)=>{var tJ=T1(),K$=v(),f9=$0(),eJ="tag:yaml.org,2002:";function $Q($,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 ZQ($,Z,X){if(K$.isDocument($))$=$.contents;if(K$.isNode($))return $;if(K$.isPair($)){let V=X.schema[K$.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:Y,sourceObjects:q}=X,G=void 0;if(z&&$&&typeof $==="object")if(G=q.get($),G)return G.anchor??(G.anchor=J($)),new tJ.Alias(G.anchor);else G={anchor:null,node:null},q.set($,G);if(Z?.startsWith("!!"))Z=eJ+Z.slice(2);let W=$Q($,Z,Y.tags);if(!W){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let V=new f9.Scalar($);if(G)G.node=V;return V}W=$ instanceof Map?Y[K$.MAP]:(Symbol.iterator in Object($))?Y[K$.SEQ]:Y[K$.MAP]}if(Q)Q(W),delete X.onTagObj;let U=W?.createNode?W.createNode(X.schema,$,X):typeof W?.nodeClass?.from==="function"?W.nodeClass.from(X.schema,$,X):new f9.Scalar($);if(Z)U.tag=Z;else if(!W.default)U.tag=W.tag;if(G)G.node=U;return U}XQ.createNode=ZQ});var c2=A((YQ)=>{var JQ=M1(),y0=v(),QQ=m2();function L6($,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 Y=[];Y[Q]=z,z=Y}else z=new Map([[Q,z]])}return JQ.createNode(z,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var g9=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class h9 extends QQ.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)=>y0.isNode(X)||y0.isPair(X)?X.clone($):X),this.range)Z.range=this.range.slice();return Z}addIn($,Z){if(g9($))this.add(Z);else{let[X,...z]=$,J=this.get(X,!0);if(y0.isCollection(J))J.addIn(z,Z);else if(J===void 0&&this.schema)this.set(X,L6(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(y0.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&&y0.isScalar(J)?J.value:J;else return y0.isCollection(J)?J.getIn(z,Z):void 0}hasAllNullValues($){return this.items.every((Z)=>{if(!y0.isPair(Z))return!1;let X=Z.value;return X==null||$&&y0.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 y0.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(y0.isCollection(J))J.setIn(z,Z);else if(J===void 0&&this.schema)this.set(X,L6(this.schema,z,Z));else throw Error(`Expected YAML collection at ${X}. Remaining path: ${z}`)}}}YQ.Collection=h9;YQ.collectionFromPath=L6;YQ.isEmptyPath=g9});var O1=A((KQ)=>{var UQ=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function T6($,Z){if(/^\n+$/.test($))return $.substring(1);return Z?$.replace(/^(?! *$)/gm,Z):$}var VQ=($,Z,X)=>$.endsWith(`
29
- `)?T6(X,Z):X.includes(`
24
+ `),this.outputHelp({error:!0});let z=Z||{},X=z.exitCode||1,J=z.code||"commander.error";this._exit(X,J,$)}_parseOptionsEnv(){this.options.forEach(($)=>{if($.envVar&&$.envVar in d.env){let Z=$.attributeName();if(this.getOptionValue(Z)===void 0||["default","config","env"].includes(this.getOptionValueSource(Z)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,d.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new kX(this.options),Z=(z)=>{return this.getOptionValue(z)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(z))};this.options.filter((z)=>z.implied!==void 0&&Z(z.attributeName())&&$.valueFromOption(this.getOptionValue(z.attributeName()),z)).forEach((z)=>{Object.keys(z.implied).filter((X)=>!Z(X)).forEach((X)=>{this.setOptionValueWithSource(X,z.implied[X],"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 z=(Q)=>{let Y=Q.attributeName(),q=this.getOptionValue(Y),W=this.options.find((U)=>U.negate&&Y===U.attributeName()),G=this.options.find((U)=>!U.negate&&Y===U.attributeName());if(W&&(W.presetArg===void 0&&q===!1||W.presetArg!==void 0&&q===W.presetArg))return W;return G||Q},X=(Q)=>{let Y=z(Q),q=Y.attributeName();if(this.getOptionValueSource(q)==="env")return`environment variable '${Y.envVar}'`;return`option '${Y.flags}'`},J=`error: ${X($)} cannot be used with ${X(Z)}`;this.error(J,{code:"commander.conflictingOption"})}unknownOption($){if(this._allowUnknownOption)return;let Z="";if($.startsWith("--")&&this._showSuggestionAfterError){let X=[],J=this;do{let Q=J.createHelp().visibleOptions(J).filter((Y)=>Y.long).map((Y)=>Y.long);X=X.concat(Q),J=J.parent}while(J&&!J._enablePositionalOptions);Z=N9($,X)}let z=`error: unknown option '${$}'${Z}`;this.error(z,{code:"commander.unknownOption"})}_excessArguments($){if(this._allowExcessArguments)return;let Z=this.registeredArguments.length,z=Z===1?"":"s",J=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${Z} argument${z} but got ${$.length}.`;this.error(J,{code:"commander.excessArguments"})}unknownCommand(){let $=this.args[0],Z="";if(this._showSuggestionAfterError){let X=[];this.createHelp().visibleCommands(this).forEach((J)=>{if(X.push(J.name()),J.alias())X.push(J.alias())}),Z=N9($,X)}let z=`error: unknown command '${$}'${Z}`;this.error(z,{code:"commander.unknownCommand"})}version($,Z,z){if($===void 0)return this._version;this._version=$,Z=Z||"-V, --version",z=z||"output the version number";let X=this.createOption(Z,z);return this._versionOptionName=X.attributeName(),this._registerOption(X),this.on("option:"+X.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 z=this.parent?._findCommand($);if(z){let X=[z.name()].concat(z.aliases()).join("|");throw Error(`cannot add alias '${$}' to command '${this.name()}' as already have command '${X}'`)}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((z)=>{return bX(z)});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=f0.basename($,f0.extname($)),this}executableDir($){if($===void 0)return this._executableDir;return this._executableDir=$,this}helpInformation($){let Z=this.createHelp(),z=this._getOutputContext($);Z.prepareContext({error:z.error,helpWidth:z.helpWidth,outputHasColors:z.hasColors});let X=Z.formatHelp(this,Z);if(z.hasColors)return X;return this._outputConfiguration.stripColor(X)}_getOutputContext($){$=$||{};let Z=!!$.error,z,X,J;if(Z)z=(Y)=>this._outputConfiguration.writeErr(Y),X=this._outputConfiguration.getErrHasColors(),J=this._outputConfiguration.getErrHelpWidth();else z=(Y)=>this._outputConfiguration.writeOut(Y),X=this._outputConfiguration.getOutHasColors(),J=this._outputConfiguration.getOutHelpWidth();return{error:Z,write:(Y)=>{if(!X)Y=this._outputConfiguration.stripColor(Y);return z(Y)},hasColors:X,helpWidth:J}}outputHelp($){let Z;if(typeof $==="function")Z=$,$=void 0;let z=this._getOutputContext($),X={error:z.error,write:z.write,command:this};this._getCommandAndAncestors().reverse().forEach((Q)=>Q.emit("beforeAllHelp",X)),this.emit("beforeHelp",X);let J=this.helpInformation({error:z.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(z.write(J),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",X),this._getCommandAndAncestors().forEach((Q)=>Q.emit("afterAllHelp",X))}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(d.exitCode??0);if(Z===0&&$&&typeof $!=="function"&&$.error)Z=1;this._exit(Z,"commander.help","(outputHelp)")}addHelpText($,Z){let z=["beforeAll","before","after","afterAll"];if(!z.includes($))throw Error(`Unexpected value for position to addHelpText.
26
+ Expecting one of '${z.join("', '")}'`);let X=`${$}Help`;return this.on(X,(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((X)=>Z.is(X)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function T9($){return $.map((Z)=>{if(!Z.startsWith("--inspect"))return Z;let z,X="127.0.0.1",J="9229",Q;if((Q=Z.match(/^(--inspect(-brk)?)$/))!==null)z=Q[1];else if((Q=Z.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(z=Q[1],/^\d+$/.test(Q[3]))J=Q[3];else X=Q[3];else if((Q=Z.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)z=Q[1],X=Q[3],J=Q[4];if(z&&J!=="0")return`${z}=${X}:${parseInt(J)+1}`;return Z})}function B6(){if(d.env.NO_COLOR||d.env.FORCE_COLOR==="0"||d.env.FORCE_COLOR==="false")return!1;if(d.env.FORCE_COLOR||d.env.CLICOLOR_FORCE!==void 0)return!0;return}fX.Command=L6;fX.useColor=B6});var I9=A((mX)=>{var{Argument:O9}=f4(),{Command:N6}=M9(),{CommanderError:vX,InvalidArgumentError:D9}=L1(),{Help:uX}=U6(),{Option:A9}=V6();mX.program=new N6;mX.createCommand=($)=>new N6($);mX.createOption=($,Z)=>new A9($,Z);mX.createArgument=($,Z)=>new O9($,Z);mX.Command=N6;mX.Option=A9;mX.Argument=O9;mX.Help=uX;mX.CommanderError=vX;mX.InvalidArgumentError=D9;mX.InvalidOptionArgumentError=D9});var m=A((YJ)=>{var T6=Symbol.for("yaml.alias"),R9=Symbol.for("yaml.document"),h4=Symbol.for("yaml.map"),P9=Symbol.for("yaml.pair"),M6=Symbol.for("yaml.scalar"),v4=Symbol.for("yaml.seq"),g0=Symbol.for("yaml.node.type"),eX=($)=>!!$&&typeof $==="object"&&$[g0]===T6,$J=($)=>!!$&&typeof $==="object"&&$[g0]===R9,ZJ=($)=>!!$&&typeof $==="object"&&$[g0]===h4,zJ=($)=>!!$&&typeof $==="object"&&$[g0]===P9,_9=($)=>!!$&&typeof $==="object"&&$[g0]===M6,XJ=($)=>!!$&&typeof $==="object"&&$[g0]===v4;function E9($){if($&&typeof $==="object")switch($[g0]){case h4:case v4:return!0}return!1}function JJ($){if($&&typeof $==="object")switch($[g0]){case T6:case h4:case M6:case v4:return!0}return!1}var QJ=($)=>(_9($)||E9($))&&!!$.anchor;YJ.ALIAS=T6;YJ.DOC=R9;YJ.MAP=h4;YJ.NODE_TYPE=g0;YJ.PAIR=P9;YJ.SCALAR=M6;YJ.SEQ=v4;YJ.hasAnchor=QJ;YJ.isAlias=eX;YJ.isCollection=E9;YJ.isDocument=$J;YJ.isMap=ZJ;YJ.isNode=JJ;YJ.isPair=zJ;YJ.isScalar=_9;YJ.isSeq=XJ});var N1=A((wJ)=>{var J0=m(),H0=Symbol("break visit"),C9=Symbol("skip children"),y0=Symbol("remove node");function u4($,Z){let z=j9(Z);if(J0.isDocument($)){if(C$(null,$.contents,z,Object.freeze([$]))===y0)$.contents=null}else C$(null,$,z,Object.freeze([]))}u4.BREAK=H0;u4.SKIP=C9;u4.REMOVE=y0;function C$($,Z,z,X){let J=S9($,Z,z,X);if(J0.isNode(J)||J0.isPair(J))return b9($,X,J),C$($,J,z,X);if(typeof J!=="symbol"){if(J0.isCollection(Z)){X=Object.freeze(X.concat(Z));for(let Q=0;Q<Z.items.length;++Q){let Y=C$(Q,Z.items[Q],z,X);if(typeof Y==="number")Q=Y-1;else if(Y===H0)return H0;else if(Y===y0)Z.items.splice(Q,1),Q-=1}}else if(J0.isPair(Z)){X=Object.freeze(X.concat(Z));let Q=C$("key",Z.key,z,X);if(Q===H0)return H0;else if(Q===y0)Z.key=null;let Y=C$("value",Z.value,z,X);if(Y===H0)return H0;else if(Y===y0)Z.value=null}}return J}async function m4($,Z){let z=j9(Z);if(J0.isDocument($)){if(await j$(null,$.contents,z,Object.freeze([$]))===y0)$.contents=null}else await j$(null,$,z,Object.freeze([]))}m4.BREAK=H0;m4.SKIP=C9;m4.REMOVE=y0;async function j$($,Z,z,X){let J=await S9($,Z,z,X);if(J0.isNode(J)||J0.isPair(J))return b9($,X,J),j$($,J,z,X);if(typeof J!=="symbol"){if(J0.isCollection(Z)){X=Object.freeze(X.concat(Z));for(let Q=0;Q<Z.items.length;++Q){let Y=await j$(Q,Z.items[Q],z,X);if(typeof Y==="number")Q=Y-1;else if(Y===H0)return H0;else if(Y===y0)Z.items.splice(Q,1),Q-=1}}else if(J0.isPair(Z)){X=Object.freeze(X.concat(Z));let Q=await j$("key",Z.key,z,X);if(Q===H0)return H0;else if(Q===y0)Z.key=null;let Y=await j$("value",Z.value,z,X);if(Y===H0)return H0;else if(Y===y0)Z.value=null}}return J}function j9($){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 S9($,Z,z,X){if(typeof z==="function")return z($,Z,X);if(J0.isMap(Z))return z.Map?.($,Z,X);if(J0.isSeq(Z))return z.Seq?.($,Z,X);if(J0.isPair(Z))return z.Pair?.($,Z,X);if(J0.isScalar(Z))return z.Scalar?.($,Z,X);if(J0.isAlias(Z))return z.Alias?.($,Z,X);return}function b9($,Z,z){let X=Z[Z.length-1];if(J0.isCollection(X))X.items[$]=z;else if(J0.isPair(X))if($==="key")X.key=z;else X.value=z;else if(J0.isDocument(X))X.contents=z;else{let J=J0.isAlias(X)?"alias":"scalar";throw Error(`Cannot replace node with ${J} parent`)}}wJ.visit=u4;wJ.visitAsync=m4});var O6=A((CJ)=>{var x9=m(),PJ=N1(),_J={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},EJ=($)=>$.replace(/[!,[\]{}]/g,(Z)=>_J[Z]);class A0{constructor($,Z){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},A0.defaultYaml,$),this.tags=Object.assign({},A0.defaultTags,Z)}clone(){let $=new A0(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new A0(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:A0.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},A0.defaultTags);break}return $}add($,Z){if(this.atNextDocument)this.yaml={explicit:A0.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},A0.defaultTags),this.atNextDocument=!1;let z=$.trim().split(/[ \t]+/),X=z.shift();switch(X){case"%TAG":{if(z.length!==2){if(Z(0,"%TAG directive should contain exactly two parts"),z.length<2)return!1}let[J,Q]=z;return this.tags[J]=Q,!0}case"%YAML":{if(this.yaml.explicit=!0,z.length!==1)return Z(0,"%YAML directive should contain exactly one part"),!1;let[J]=z;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 ${X}`,!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[,z,X]=$.match(/^(.*!)([^!]*)$/s);if(!X)Z(`The ${$} tag has no suffix`);let J=this.tags[z];if(J)try{return J+decodeURIComponent(X)}catch(Q){return Z(String(Q)),null}if(z==="!")return $;return Z(`Could not resolve tag: ${$}`),null}tagString($){for(let[Z,z]of Object.entries(this.tags))if($.startsWith(z))return Z+EJ($.substring(z.length));return $[0]==="!"?$:`!<${$}>`}toString($){let Z=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],z=Object.entries(this.tags),X;if($&&z.length>0&&x9.isNode($.contents)){let J={};PJ.visit($.contents,(Q,Y)=>{if(x9.isNode(Y)&&Y.tag)J[Y.tag]=!0}),X=Object.keys(J)}else X=[];for(let[J,Q]of z){if(J==="!!"&&Q==="tag:yaml.org,2002:")continue;if(!$||X.some((Y)=>Y.startsWith(Q)))Z.push(`%TAG ${J} ${Q}`)}return Z.join(`
28
+ `)}}A0.defaultYaml={explicit:!1,version:"1.2"};A0.defaultTags={"!!":"tag:yaml.org,2002:"};CJ.Directives=A0});var d4=A((yJ)=>{var y9=m(),SJ=N1();function bJ($){if(/[\x00-\x19\s,[\]{}]/.test($)){let z=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(z)}return!0}function k9($){let Z=new Set;return SJ.visit($,{Value(z,X){if(X.anchor)Z.add(X.anchor)}}),Z}function f9($,Z){for(let z=1;;++z){let X=`${$}${z}`;if(!Z.has(X))return X}}function xJ($,Z){let z=[],X=new Map,J=null;return{onAnchor:(Q)=>{z.push(Q),J??(J=k9($));let Y=f9(Z,J);return J.add(Y),Y},setAnchors:()=>{for(let Q of z){let Y=X.get(Q);if(typeof Y==="object"&&Y.anchor&&(y9.isScalar(Y.node)||y9.isCollection(Y.node)))Y.node.anchor=Y.anchor;else{let q=Error("Failed to resolve repeated object (this should not happen)");throw q.source=Q,q}}},sourceObjects:X}}yJ.anchorIsValid=bJ;yJ.anchorNames=k9;yJ.createNodeAnchors=xJ;yJ.findNewAnchor=f9});var D6=A((vJ)=>{function T1($,Z,z,X){if(X&&typeof X==="object")if(Array.isArray(X))for(let J=0,Q=X.length;J<Q;++J){let Y=X[J],q=T1($,X,String(J),Y);if(q===void 0)delete X[J];else if(q!==Y)X[J]=q}else if(X instanceof Map)for(let J of Array.from(X.keys())){let Q=X.get(J),Y=T1($,X,J,Q);if(Y===void 0)X.delete(J);else if(Y!==Q)X.set(J,Y)}else if(X instanceof Set)for(let J of Array.from(X)){let Q=T1($,X,J,J);if(Q===void 0)X.delete(J);else if(Q!==J)X.delete(J),X.add(Q)}else for(let[J,Q]of Object.entries(X)){let Y=T1($,X,J,Q);if(Y===void 0)delete X[J];else if(Y!==Q)X[J]=Y}return $.call(Z,z,X)}vJ.applyReviver=T1});var l0=A((dJ)=>{var mJ=m();function g9($,Z,z){if(Array.isArray($))return $.map((X,J)=>g9(X,String(J),z));if($&&typeof $.toJSON==="function"){if(!z||!mJ.hasAnchor($))return $.toJSON(Z,z);let X={aliasCount:0,count:1,res:void 0};z.anchors.set($,X),z.onCreate=(Q)=>{X.res=Q,delete z.onCreate};let J=$.toJSON(Z,z);if(z.onCreate)z.onCreate(J);return J}if(typeof $==="bigint"&&!z?.keep)return Number($);return $}dJ.toJS=g9});var c4=A((iJ)=>{var pJ=D6(),h9=m(),lJ=l0();class v9{constructor($){Object.defineProperty(this,h9.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:z,onAnchor:X,reviver:J}={}){if(!h9.isDocument($))throw TypeError("A document argument is required");let Q={anchors:new Map,doc:$,keep:!0,mapAsMap:Z===!0,mapKeyWarned:!1,maxAliasCount:typeof z==="number"?z:100},Y=lJ.toJS(this,"",Q);if(typeof X==="function")for(let{count:q,res:W}of Q.anchors.values())X(W,q);return typeof J==="function"?pJ.applyReviver(J,{"":Y},"",Y):Y}}iJ.NodeBase=v9});var M1=A((tJ)=>{var rJ=d4(),sJ=N1(),S$=m(),aJ=c4(),oJ=l0();class u9 extends aJ.NodeBase{constructor($){super(S$.ALIAS);this.source=$,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve($,Z){let z;if(Z?.aliasResolveCache)z=Z.aliasResolveCache;else if(z=[],sJ.visit($,{Node:(J,Q)=>{if(S$.isAlias(Q)||S$.hasAnchor(Q))z.push(Q)}}),Z)Z.aliasResolveCache=z;let X=void 0;for(let J of z){if(J===this)break;if(J.anchor===this.source)X=J}return X}toJSON($,Z){if(!Z)return{source:this.source};let{anchors:z,doc:X,maxAliasCount:J}=Z,Q=this.resolve(X,Z);if(!Q){let q=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(q)}let Y=z.get(Q);if(!Y)oJ.toJS(Q,null,Z),Y=z.get(Q);if(Y?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(J>=0){if(Y.count+=1,Y.aliasCount===0)Y.aliasCount=p4(X,Q,z);if(Y.count*Y.aliasCount>J)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return Y.res}toString($,Z,z){let X=`*${this.source}`;if($){if(rJ.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`${X} `}return X}}function p4($,Z,z){if(S$.isAlias(Z)){let X=Z.resolve($),J=z&&X&&z.get(X);return J?J.count*J.aliasCount:0}else if(S$.isCollection(Z)){let X=0;for(let J of Z.items){let Q=p4($,J,z);if(Q>X)X=Q}return X}else if(S$.isPair(Z)){let X=p4($,Z.key,z),J=p4($,Z.value,z);return Math.max(X,J)}return 1}tJ.Alias=u9});var $0=A((JQ)=>{var $Q=m(),ZQ=c4(),zQ=l0(),XQ=($)=>!$||typeof $!=="function"&&typeof $!=="object";class V$ extends ZQ.NodeBase{constructor($){super($Q.SCALAR);this.value=$}toJSON($,Z){return Z?.keep?this.value:zQ.toJS(this.value,$,Z)}toString(){return String(this.value)}}V$.BLOCK_FOLDED="BLOCK_FOLDED";V$.BLOCK_LITERAL="BLOCK_LITERAL";V$.PLAIN="PLAIN";V$.QUOTE_DOUBLE="QUOTE_DOUBLE";V$.QUOTE_SINGLE="QUOTE_SINGLE";JQ.Scalar=V$;JQ.isScalarValue=XQ});var O1=A((VQ)=>{var qQ=M1(),K$=m(),m9=$0(),WQ="tag:yaml.org,2002:";function GQ($,Z,z){if(Z){let X=z.filter((Q)=>Q.tag===Z),J=X.find((Q)=>!Q.format)??X[0];if(!J)throw Error(`Tag ${Z} not found`);return J}return z.find((X)=>X.identify?.($)&&!X.format)}function UQ($,Z,z){if(K$.isDocument($))$=$.contents;if(K$.isNode($))return $;if(K$.isPair($)){let V=z.schema[K$.MAP].createNode?.(z.schema,null,z);return V.items.push($),V}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:X,onAnchor:J,onTagObj:Q,schema:Y,sourceObjects:q}=z,W=void 0;if(X&&$&&typeof $==="object")if(W=q.get($),W)return W.anchor??(W.anchor=J($)),new qQ.Alias(W.anchor);else W={anchor:null,node:null},q.set($,W);if(Z?.startsWith("!!"))Z=WQ+Z.slice(2);let G=GQ($,Z,Y.tags);if(!G){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let V=new m9.Scalar($);if(W)W.node=V;return V}G=$ instanceof Map?Y[K$.MAP]:(Symbol.iterator in Object($))?Y[K$.SEQ]:Y[K$.MAP]}if(Q)Q(G),delete z.onTagObj;let U=G?.createNode?G.createNode(z.schema,$,z):typeof G?.nodeClass?.from==="function"?G.nodeClass.from(z.schema,$,z):new m9.Scalar($);if(Z)U.tag=Z;else if(!G.default)U.tag=G.tag;if(W)W.node=U;return U}VQ.createNode=UQ});var l4=A((LQ)=>{var HQ=O1(),k0=m(),BQ=c4();function A6($,Z,z){let X=z;for(let J=Z.length-1;J>=0;--J){let Q=Z[J];if(typeof Q==="number"&&Number.isInteger(Q)&&Q>=0){let Y=[];Y[Q]=X,X=Y}else X=new Map([[Q,X]])}return HQ.createNode(X,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var d9=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class c9 extends BQ.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((z)=>k0.isNode(z)||k0.isPair(z)?z.clone($):z),this.range)Z.range=this.range.slice();return Z}addIn($,Z){if(d9($))this.add(Z);else{let[z,...X]=$,J=this.get(z,!0);if(k0.isCollection(J))J.addIn(X,Z);else if(J===void 0&&this.schema)this.set(z,A6(this.schema,X,Z));else throw Error(`Expected YAML collection at ${z}. Remaining path: ${X}`)}}deleteIn($){let[Z,...z]=$;if(z.length===0)return this.delete(Z);let X=this.get(Z,!0);if(k0.isCollection(X))return X.deleteIn(z);else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${z}`)}getIn($,Z){let[z,...X]=$,J=this.get(z,!0);if(X.length===0)return!Z&&k0.isScalar(J)?J.value:J;else return k0.isCollection(J)?J.getIn(X,Z):void 0}hasAllNullValues($){return this.items.every((Z)=>{if(!k0.isPair(Z))return!1;let z=Z.value;return z==null||$&&k0.isScalar(z)&&z.value==null&&!z.commentBefore&&!z.comment&&!z.tag})}hasIn($){let[Z,...z]=$;if(z.length===0)return this.has(Z);let X=this.get(Z,!0);return k0.isCollection(X)?X.hasIn(z):!1}setIn($,Z){let[z,...X]=$;if(X.length===0)this.set(z,Z);else{let J=this.get(z,!0);if(k0.isCollection(J))J.setIn(X,Z);else if(J===void 0&&this.schema)this.set(z,A6(this.schema,X,Z));else throw Error(`Expected YAML collection at ${z}. Remaining path: ${X}`)}}}LQ.Collection=c9;LQ.collectionFromPath=A6;LQ.isEmptyPath=d9});var D1=A((AQ)=>{var OQ=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function I6($,Z){if(/^\n+$/.test($))return $.substring(1);return Z?$.replace(/^(?! *$)/gm,Z):$}var DQ=($,Z,z)=>$.endsWith(`
29
+ `)?I6(z,Z):z.includes(`
30
30
  `)?`
31
- `+T6(X,Z):($.endsWith(" ")?"":" ")+X;KQ.indentComment=T6;KQ.lineComment=VQ;KQ.stringifyComment=UQ});var u9=A((TQ)=>{function LQ($,Z,X="flow",{indentAtStart:z,lineWidth:J=80,minContentWidth:Q=20,onFold:Y,onOverflow:q}={}){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 W=[],U={},V=J-Z.length;if(typeof z==="number")if(z>J-Math.max(2,Q))W.push(0);else V=J-z;let K=void 0,N=void 0,O=!1,B=-1,M=-1,F=-1;if(X==="block"){if(B=v9($,B,Z.length),B!==-1)V=B+G}for(let b;b=$[B+=1];){if(X==="quoted"&&b==="\\"){switch(M=B,$[B+1]){case"x":B+=3;break;case"u":B+=5;break;case"U":B+=9;break;default:B+=1}F=B}if(b===`
32
- `){if(X==="block")B=v9($,B,Z.length);V=B+Z.length+G,K=void 0}else{if(b===" "&&N&&N!==" "&&N!==`
33
- `&&N!=="\t"){let x=$[B+1];if(x&&x!==" "&&x!==`
34
- `&&x!=="\t")K=B}if(B>=V)if(K)W.push(K),V=K+G,K=void 0;else if(X==="quoted"){while(N===" "||N==="\t")N=b,b=$[B+=1],O=!0;let x=B>F+1?B-2:M-1;if(U[x])return $;W.push(x),U[x]=!0,V=x+G,K=void 0}else O=!0}N=b}if(O&&q)q();if(W.length===0)return $;if(Y)Y();let _=$.slice(0,W[0]);for(let b=0;b<W.length;++b){let x=W[b],y=W[b+1]||$.length;if(x===0)_=`
35
- ${Z}${$.slice(0,y)}`;else{if(X==="quoted"&&U[x])_+=`${$[x]}\\`;_+=`
36
- ${Z}${$.slice(x+1,y)}`}}return _}function v9($,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}TQ.FOLD_BLOCK="block";TQ.FOLD_FLOW="flow";TQ.FOLD_QUOTED="quoted";TQ.foldFlowLines=LQ});var A1=A((RQ)=>{var R0=$0(),l0=u9(),l2=($,Z)=>({indentAtStart:Z?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),i2=($)=>/^(%|---|\.\.\.)/m.test($);function wQ($,Z,X){if(!Z||Z<0)return!1;let z=Z-X,J=$.length;if(J<=z)return!1;for(let Q=0,Y=0;Q<J;++Q)if($[Q]===`
38
- `){if(Q-Y>z)return!0;if(Y=Q+1,J-Y<=z)return!1}return!0}function D1($,Z){let X=JSON.stringify($);if(Z.options.doubleQuotedAsJSON)return X;let{implicitKey:z}=Z,J=Z.options.doubleQuotedMinMultiLineLength,Q=Z.indent||(i2($)?" ":""),Y="",q=0;for(let G=0,W=X[G];W;W=X[++G]){if(W===" "&&X[G+1]==="\\"&&X[G+2]==="n")Y+=X.slice(q,G)+"\\ ",G+=1,q=G,W="\\";if(W==="\\")switch(X[G+1]){case"u":{Y+=X.slice(q,G);let U=X.substr(G+2,4);switch(U){case"0000":Y+="\\0";break;case"0007":Y+="\\a";break;case"000b":Y+="\\v";break;case"001b":Y+="\\e";break;case"0085":Y+="\\N";break;case"00a0":Y+="\\_";break;case"2028":Y+="\\L";break;case"2029":Y+="\\P";break;default:if(U.substr(0,2)==="00")Y+="\\x"+U.substr(2);else Y+=X.substr(G,6)}G+=5,q=G+1}break;case"n":if(z||X[G+2]==='"'||X.length<J)G+=1;else{Y+=X.slice(q,G)+`
39
-
40
- `;while(X[G+2]==="\\"&&X[G+3]==="n"&&X[G+4]!=='"')Y+=`
41
- `,G+=2;if(Y+=Q,X[G+2]===" ")Y+="\\";G+=1,q=G+1}break;default:G+=1}}return Y=q?Y+X.slice(q):X,z?Y:l0.foldFlowLines(Y,Q,l0.FOLD_QUOTED,l2(Z,!1))}function M6($,Z){if(Z.options.singleQuote===!1||Z.implicitKey&&$.includes(`
42
- `)||/[ \t]\n|\n[ \t]/.test($))return D1($,Z);let X=Z.indent||(i2($)?" ":""),z="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
43
- ${X}`)+"'";return Z.implicitKey?z:l0.foldFlowLines(z,X,l0.FOLD_FLOW,l2(Z,!1))}function b$($,Z){let{singleQuote:X}=Z.options,z;if(X===!1)z=D1;else{let J=$.includes('"'),Q=$.includes("'");if(J&&!Q)z=M6;else if(Q&&!J)z=D1;else z=X?M6:D1}return z($,Z)}var O6;try{O6=new RegExp(`(^|(?<!
31
+ `+I6(z,Z):($.endsWith(" ")?"":" ")+z;AQ.indentComment=I6;AQ.lineComment=DQ;AQ.stringifyComment=OQ});var l9=A((PQ)=>{function RQ($,Z,z="flow",{indentAtStart:X,lineWidth:J=80,minContentWidth:Q=20,onFold:Y,onOverflow:q}={}){if(!J||J<0)return $;if(J<Q)Q=0;let W=Math.max(1+Q,1+J-Z.length);if($.length<=W)return $;let G=[],U={},V=J-Z.length;if(typeof X==="number")if(X>J-Math.max(2,Q))G.push(0);else V=J-X;let K=void 0,L=void 0,O=!1,B=-1,M=-1,F=-1;if(z==="block"){if(B=p9($,B,Z.length),B!==-1)V=B+W}for(let b;b=$[B+=1];){if(z==="quoted"&&b==="\\"){switch(M=B,$[B+1]){case"x":B+=3;break;case"u":B+=5;break;case"U":B+=9;break;default:B+=1}F=B}if(b===`
32
+ `){if(z==="block")B=p9($,B,Z.length);V=B+Z.length+W,K=void 0}else{if(b===" "&&L&&L!==" "&&L!==`
33
+ `&&L!=="\t"){let x=$[B+1];if(x&&x!==" "&&x!==`
34
+ `&&x!=="\t")K=B}if(B>=V)if(K)G.push(K),V=K+W,K=void 0;else if(z==="quoted"){while(L===" "||L==="\t")L=b,b=$[B+=1],O=!0;let x=B>F+1?B-2:M-1;if(U[x])return $;G.push(x),U[x]=!0,V=x+W,K=void 0}else O=!0}L=b}if(O&&q)q();if(G.length===0)return $;if(Y)Y();let E=$.slice(0,G[0]);for(let b=0;b<G.length;++b){let x=G[b],y=G[b+1]||$.length;if(x===0)E=`
35
+ ${Z}${$.slice(0,y)}`;else{if(z==="quoted"&&U[x])E+=`${$[x]}\\`;E+=`
36
+ ${Z}${$.slice(x+1,y)}`}}return E}function p9($,Z,z){let X=Z,J=Z+1,Q=$[J];while(Q===" "||Q==="\t")if(Z<J+z)Q=$[++Z];else{do Q=$[++Z];while(Q&&Q!==`
37
+ `);X=Z,J=Z+1,Q=$[J]}return X}PQ.FOLD_BLOCK="block";PQ.FOLD_FLOW="flow";PQ.FOLD_QUOTED="quoted";PQ.foldFlowLines=RQ});var I1=A((yQ)=>{var P0=$0(),i0=l9(),n4=($,Z)=>({indentAtStart:Z?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),r4=($)=>/^(%|---|\.\.\.)/m.test($);function SQ($,Z,z){if(!Z||Z<0)return!1;let X=Z-z,J=$.length;if(J<=X)return!1;for(let Q=0,Y=0;Q<J;++Q)if($[Q]===`
38
+ `){if(Q-Y>X)return!0;if(Y=Q+1,J-Y<=X)return!1}return!0}function A1($,Z){let z=JSON.stringify($);if(Z.options.doubleQuotedAsJSON)return z;let{implicitKey:X}=Z,J=Z.options.doubleQuotedMinMultiLineLength,Q=Z.indent||(r4($)?" ":""),Y="",q=0;for(let W=0,G=z[W];G;G=z[++W]){if(G===" "&&z[W+1]==="\\"&&z[W+2]==="n")Y+=z.slice(q,W)+"\\ ",W+=1,q=W,G="\\";if(G==="\\")switch(z[W+1]){case"u":{Y+=z.slice(q,W);let U=z.substr(W+2,4);switch(U){case"0000":Y+="\\0";break;case"0007":Y+="\\a";break;case"000b":Y+="\\v";break;case"001b":Y+="\\e";break;case"0085":Y+="\\N";break;case"00a0":Y+="\\_";break;case"2028":Y+="\\L";break;case"2029":Y+="\\P";break;default:if(U.substr(0,2)==="00")Y+="\\x"+U.substr(2);else Y+=z.substr(W,6)}W+=5,q=W+1}break;case"n":if(X||z[W+2]==='"'||z.length<J)W+=1;else{Y+=z.slice(q,W)+`
39
+
40
+ `;while(z[W+2]==="\\"&&z[W+3]==="n"&&z[W+4]!=='"')Y+=`
41
+ `,W+=2;if(Y+=Q,z[W+2]===" ")Y+="\\";W+=1,q=W+1}break;default:W+=1}}return Y=q?Y+z.slice(q):z,X?Y:i0.foldFlowLines(Y,Q,i0.FOLD_QUOTED,n4(Z,!1))}function w6($,Z){if(Z.options.singleQuote===!1||Z.implicitKey&&$.includes(`
42
+ `)||/[ \t]\n|\n[ \t]/.test($))return A1($,Z);let z=Z.indent||(r4($)?" ":""),X="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
43
+ ${z}`)+"'";return Z.implicitKey?X:i0.foldFlowLines(X,z,i0.FOLD_FLOW,n4(Z,!1))}function b$($,Z){let{singleQuote:z}=Z.options,X;if(z===!1)X=A1;else{let J=$.includes('"'),Q=$.includes("'");if(J&&!Q)X=w6;else if(Q&&!J)X=A1;else X=z?w6:A1}return X($,Z)}var F6;try{F6=new RegExp(`(^|(?<!
44
44
  ))
45
45
  +(?!
46
- |$)`,"g")}catch{O6=/\n+(?!\n|$)/g}function p2({comment:$,type:Z,value:X},z,J,Q){let{blockQuote:Y,commentString:q,lineWidth:G}=z.options;if(!Y||/\n[\t ]+$/.test(X))return b$(X,z);let W=z.indent||(z.forceBlockIndent||i2(X)?" ":""),U=Y==="literal"?!0:Y==="folded"||Z===R0.Scalar.BLOCK_FOLDED?!1:Z===R0.Scalar.BLOCK_LITERAL?!0:!wQ(X,G,W.length);if(!X)return U?`|
46
+ |$)`,"g")}catch{F6=/\n+(?!\n|$)/g}function i4({comment:$,type:Z,value:z},X,J,Q){let{blockQuote:Y,commentString:q,lineWidth:W}=X.options;if(!Y||/\n[\t ]+$/.test(z))return b$(z,X);let G=X.indent||(X.forceBlockIndent||r4(z)?" ":""),U=Y==="literal"?!0:Y==="folded"||Z===P0.Scalar.BLOCK_FOLDED?!1:Z===P0.Scalar.BLOCK_LITERAL?!0:!SQ(z,W,G.length);if(!z)return U?`|
47
47
  `:`>
48
- `;let V,K;for(K=X.length;K>0;--K){let y=X[K-1];if(y!==`
49
- `&&y!=="\t"&&y!==" ")break}let N=X.substring(K),O=N.indexOf(`
50
- `);if(O===-1)V="-";else if(X===N||O!==N.length-1){if(V="+",Q)Q()}else V="";if(N){if(X=X.slice(0,-N.length),N[N.length-1]===`
51
- `)N=N.slice(0,-1);N=N.replace(O6,`$&${W}`)}let B=!1,M,F=-1;for(M=0;M<X.length;++M){let y=X[M];if(y===" ")B=!0;else if(y===`
52
- `)F=M;else break}let _=X.substring(0,F<M?F+1:M);if(_)X=X.substring(_.length),_=_.replace(/\n+/g,`$&${W}`);let x=(B?W?"2":"1":"")+V;if($){if(x+=" "+q($.replace(/ ?[\r\n]+/g," ")),J)J()}if(!U){let y=X.replace(/\n+/g,`
53
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${W}`),R=!1,i=l2(z,!0);if(Y!=="folded"&&Z!==R0.Scalar.BLOCK_FOLDED)i.onOverflow=()=>{R=!0};let C=l0.foldFlowLines(`${_}${y}${N}`,W,l0.FOLD_BLOCK,i);if(!R)return`>${x}
54
- ${W}${C}`}return X=X.replace(/\n+/g,`$&${W}`),`|${x}
55
- ${W}${_}${X}${N}`}function IQ($,Z,X,z){let{type:J,value:Q}=$,{actualString:Y,implicitKey:q,indent:G,indentStep:W,inFlow:U}=Z;if(q&&Q.includes(`
48
+ `;let V,K;for(K=z.length;K>0;--K){let y=z[K-1];if(y!==`
49
+ `&&y!=="\t"&&y!==" ")break}let L=z.substring(K),O=L.indexOf(`
50
+ `);if(O===-1)V="-";else if(z===L||O!==L.length-1){if(V="+",Q)Q()}else V="";if(L){if(z=z.slice(0,-L.length),L[L.length-1]===`
51
+ `)L=L.slice(0,-1);L=L.replace(F6,`$&${G}`)}let B=!1,M,F=-1;for(M=0;M<z.length;++M){let y=z[M];if(y===" ")B=!0;else if(y===`
52
+ `)F=M;else break}let E=z.substring(0,F<M?F+1:M);if(E)z=z.substring(E.length),E=E.replace(/\n+/g,`$&${G}`);let x=(B?G?"2":"1":"")+V;if($){if(x+=" "+q($.replace(/ ?[\r\n]+/g," ")),J)J()}if(!U){let y=z.replace(/\n+/g,`
53
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${G}`),R=!1,i=n4(X,!0);if(Y!=="folded"&&Z!==P0.Scalar.BLOCK_FOLDED)i.onOverflow=()=>{R=!0};let C=i0.foldFlowLines(`${E}${y}${L}`,G,i0.FOLD_BLOCK,i);if(!R)return`>${x}
54
+ ${G}${C}`}return z=z.replace(/\n+/g,`$&${G}`),`|${x}
55
+ ${G}${E}${z}${L}`}function bQ($,Z,z,X){let{type:J,value:Q}=$,{actualString:Y,implicitKey:q,indent:W,indentStep:G,inFlow:U}=Z;if(q&&Q.includes(`
56
56
  `)||U&&/[[\]{},]/.test(Q))return b$(Q,Z);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(Q))return q||U||!Q.includes(`
57
- `)?b$(Q,Z):p2($,Z,X,z);if(!q&&!U&&J!==R0.Scalar.PLAIN&&Q.includes(`
58
- `))return p2($,Z,X,z);if(i2(Q)){if(G==="")return Z.forceBlockIndent=!0,p2($,Z,X,z);else if(q&&G===W)return b$(Q,Z)}let V=Q.replace(/\n+/g,`$&
59
- ${G}`);if(Y){let K=(B)=>B.default&&B.tag!=="tag:yaml.org,2002:str"&&B.test?.test(V),{compat:N,tags:O}=Z.doc.schema;if(O.some(K)||N?.some(K))return b$(Q,Z)}return q?V:l0.foldFlowLines(V,G,l0.FOLD_FLOW,l2(Z,!1))}function FQ($,Z,X,z){let{implicitKey:J,inFlow:Q}=Z,Y=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:q}=$;if(q!==R0.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(Y.value))q=R0.Scalar.QUOTE_DOUBLE}let G=(U)=>{switch(U){case R0.Scalar.BLOCK_FOLDED:case R0.Scalar.BLOCK_LITERAL:return J||Q?b$(Y.value,Z):p2(Y,Z,X,z);case R0.Scalar.QUOTE_DOUBLE:return D1(Y.value,Z);case R0.Scalar.QUOTE_SINGLE:return M6(Y.value,Z);case R0.Scalar.PLAIN:return IQ(Y,Z,X,z);default:return null}},W=G(q);if(W===null){let{defaultKeyType:U,defaultStringType:V}=Z.options,K=J&&U||V;if(W=G(K),W===null)throw Error(`Unsupported default string type ${K}`)}return W}RQ.stringifyString=FQ});var w1=A((yQ)=>{var EQ=u2(),i0=v(),_Q=O1(),CQ=A1();function jQ($,Z){let X=Object.assign({blockQuote:!0,commentString:_Q.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 SQ($,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(i0.isScalar(Z)){z=Z.value;let J=$.filter((Q)=>Q.identify?.(z));if(J.length>1){let Q=J.filter((Y)=>Y.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 bQ($,Z,{anchors:X,doc:z}){if(!z.directives)return"";let J=[],Q=(i0.isScalar($)||i0.isCollection($))&&$.anchor;if(Q&&EQ.anchorIsValid(Q))X.add(Q),J.push(`&${Q}`);let Y=$.tag??(Z.default?null:Z.tag);if(Y)J.push(z.directives.tagString(Y));return J.join(" ")}function xQ($,Z,X,z){if(i0.isPair($))return $.toString(Z,X,z);if(i0.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=i0.isNode($)?$:Z.doc.createNode($,{onTagObj:(G)=>J=G});J??(J=SQ(Z.doc.schema.tags,Q));let Y=bQ(Q,J,Z);if(Y.length>0)Z.indentAtStart=(Z.indentAtStart??0)+Y.length+1;let q=typeof J.stringify==="function"?J.stringify(Q,Z,X,z):i0.isScalar(Q)?CQ.stringifyString(Q,Z,X,z):Q.toString(Z,X,z);if(!Y)return q;return i0.isScalar(Q)||q[0]==="{"||q[0]==="["?`${Y} ${q}`:`${Y}
60
- ${Z.indent}${q}`}yQ.createStringifyContext=jQ;yQ.stringify=xQ});var c9=A((hQ)=>{var g0=v(),m9=$0(),d9=w1(),I1=O1();function gQ({key:$,value:Z},X,z,J){let{allNullValues:Q,doc:Y,indent:q,indentStep:G,options:{commentString:W,indentSeq:U,simpleKeys:V}}=X,K=g0.isNode($)&&$.comment||null;if(V){if(K)throw Error("With simple keys, key nodes cannot have comments");if(g0.isCollection($)||!g0.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let N=!V&&(!$||K&&Z==null&&!X.inFlow||g0.isCollection($)||(g0.isScalar($)?$.type===m9.Scalar.BLOCK_FOLDED||$.type===m9.Scalar.BLOCK_LITERAL:typeof $==="object"));X=Object.assign({},X,{allNullValues:!1,implicitKey:!N&&(V||!Q),indent:q+G});let O=!1,B=!1,M=d9.stringify($,X,()=>O=!0,()=>B=!0);if(!N&&!X.inFlow&&M.length>1024){if(V)throw Error("With simple keys, single line scalar must not span more than 1024 characters");N=!0}if(X.inFlow){if(Q||Z==null){if(O&&z)z();return M===""?"?":N?`? ${M}`:M}}else if(Q&&!V||Z==null&&N){if(M=`? ${M}`,K&&!O)M+=I1.lineComment(M,X.indent,W(K));else if(B&&J)J();return M}if(O)K=null;if(N){if(K)M+=I1.lineComment(M,X.indent,W(K));M=`? ${M}
61
- ${q}:`}else if(M=`${M}:`,K)M+=I1.lineComment(M,X.indent,W(K));let F,_,b;if(g0.isNode(Z))F=!!Z.spaceBefore,_=Z.commentBefore,b=Z.comment;else if(F=!1,_=null,b=null,Z&&typeof Z==="object")Z=Y.createNode(Z);if(X.implicitKey=!1,!N&&!K&&g0.isScalar(Z))X.indentAtStart=M.length+1;if(B=!1,!U&&G.length>=2&&!X.inFlow&&!N&&g0.isSeq(Z)&&!Z.flow&&!Z.tag&&!Z.anchor)X.indent=X.indent.substring(2);let x=!1,y=d9.stringify(Z,X,()=>x=!0,()=>B=!0),R=" ";if(K||F||_){if(R=F?`
62
- `:"",_){let i=W(_);R+=`
63
- ${I1.indentComment(i,X.indent)}`}if(y===""&&!X.inFlow){if(R===`
57
+ `)?b$(Q,Z):i4($,Z,z,X);if(!q&&!U&&J!==P0.Scalar.PLAIN&&Q.includes(`
58
+ `))return i4($,Z,z,X);if(r4(Q)){if(W==="")return Z.forceBlockIndent=!0,i4($,Z,z,X);else if(q&&W===G)return b$(Q,Z)}let V=Q.replace(/\n+/g,`$&
59
+ ${W}`);if(Y){let K=(B)=>B.default&&B.tag!=="tag:yaml.org,2002:str"&&B.test?.test(V),{compat:L,tags:O}=Z.doc.schema;if(O.some(K)||L?.some(K))return b$(Q,Z)}return q?V:i0.foldFlowLines(V,W,i0.FOLD_FLOW,n4(Z,!1))}function xQ($,Z,z,X){let{implicitKey:J,inFlow:Q}=Z,Y=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:q}=$;if(q!==P0.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(Y.value))q=P0.Scalar.QUOTE_DOUBLE}let W=(U)=>{switch(U){case P0.Scalar.BLOCK_FOLDED:case P0.Scalar.BLOCK_LITERAL:return J||Q?b$(Y.value,Z):i4(Y,Z,z,X);case P0.Scalar.QUOTE_DOUBLE:return A1(Y.value,Z);case P0.Scalar.QUOTE_SINGLE:return w6(Y.value,Z);case P0.Scalar.PLAIN:return bQ(Y,Z,z,X);default:return null}},G=W(q);if(G===null){let{defaultKeyType:U,defaultStringType:V}=Z.options,K=J&&U||V;if(G=W(K),G===null)throw Error(`Unsupported default string type ${K}`)}return G}yQ.stringifyString=xQ});var w1=A((cQ)=>{var fQ=d4(),n0=m(),gQ=D1(),hQ=I1();function vQ($,Z){let z=Object.assign({blockQuote:!0,commentString:gQ.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),X;switch(z.collectionStyle){case"block":X=!1;break;case"flow":X=!0;break;default:X=null}return{anchors:new Set,doc:$,flowCollectionPadding:z.flowCollectionPadding?" ":"",indent:"",indentStep:typeof z.indent==="number"?" ".repeat(z.indent):" ",inFlow:X,options:z}}function uQ($,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 z=void 0,X;if(n0.isScalar(Z)){X=Z.value;let J=$.filter((Q)=>Q.identify?.(X));if(J.length>1){let Q=J.filter((Y)=>Y.test);if(Q.length>0)J=Q}z=J.find((Q)=>Q.format===Z.format)??J.find((Q)=>!Q.format)}else X=Z,z=$.find((J)=>J.nodeClass&&X instanceof J.nodeClass);if(!z){let J=X?.constructor?.name??(X===null?"null":typeof X);throw Error(`Tag not resolved for ${J} value`)}return z}function mQ($,Z,{anchors:z,doc:X}){if(!X.directives)return"";let J=[],Q=(n0.isScalar($)||n0.isCollection($))&&$.anchor;if(Q&&fQ.anchorIsValid(Q))z.add(Q),J.push(`&${Q}`);let Y=$.tag??(Z.default?null:Z.tag);if(Y)J.push(X.directives.tagString(Y));return J.join(" ")}function dQ($,Z,z,X){if(n0.isPair($))return $.toString(Z,z,X);if(n0.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=n0.isNode($)?$:Z.doc.createNode($,{onTagObj:(W)=>J=W});J??(J=uQ(Z.doc.schema.tags,Q));let Y=mQ(Q,J,Z);if(Y.length>0)Z.indentAtStart=(Z.indentAtStart??0)+Y.length+1;let q=typeof J.stringify==="function"?J.stringify(Q,Z,z,X):n0.isScalar(Q)?hQ.stringifyString(Q,Z,z,X):Q.toString(Z,z,X);if(!Y)return q;return n0.isScalar(Q)||q[0]==="{"||q[0]==="["?`${Y} ${q}`:`${Y}
60
+ ${Z.indent}${q}`}cQ.createStringifyContext=vQ;cQ.stringify=dQ});var r9=A((nQ)=>{var h0=m(),i9=$0(),n9=w1(),F1=D1();function iQ({key:$,value:Z},z,X,J){let{allNullValues:Q,doc:Y,indent:q,indentStep:W,options:{commentString:G,indentSeq:U,simpleKeys:V}}=z,K=h0.isNode($)&&$.comment||null;if(V){if(K)throw Error("With simple keys, key nodes cannot have comments");if(h0.isCollection($)||!h0.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let L=!V&&(!$||K&&Z==null&&!z.inFlow||h0.isCollection($)||(h0.isScalar($)?$.type===i9.Scalar.BLOCK_FOLDED||$.type===i9.Scalar.BLOCK_LITERAL:typeof $==="object"));z=Object.assign({},z,{allNullValues:!1,implicitKey:!L&&(V||!Q),indent:q+W});let O=!1,B=!1,M=n9.stringify($,z,()=>O=!0,()=>B=!0);if(!L&&!z.inFlow&&M.length>1024){if(V)throw Error("With simple keys, single line scalar must not span more than 1024 characters");L=!0}if(z.inFlow){if(Q||Z==null){if(O&&X)X();return M===""?"?":L?`? ${M}`:M}}else if(Q&&!V||Z==null&&L){if(M=`? ${M}`,K&&!O)M+=F1.lineComment(M,z.indent,G(K));else if(B&&J)J();return M}if(O)K=null;if(L){if(K)M+=F1.lineComment(M,z.indent,G(K));M=`? ${M}
61
+ ${q}:`}else if(M=`${M}:`,K)M+=F1.lineComment(M,z.indent,G(K));let F,E,b;if(h0.isNode(Z))F=!!Z.spaceBefore,E=Z.commentBefore,b=Z.comment;else if(F=!1,E=null,b=null,Z&&typeof Z==="object")Z=Y.createNode(Z);if(z.implicitKey=!1,!L&&!K&&h0.isScalar(Z))z.indentAtStart=M.length+1;if(B=!1,!U&&W.length>=2&&!z.inFlow&&!L&&h0.isSeq(Z)&&!Z.flow&&!Z.tag&&!Z.anchor)z.indent=z.indent.substring(2);let x=!1,y=n9.stringify(Z,z,()=>x=!0,()=>B=!0),R=" ";if(K||F||E){if(R=F?`
62
+ `:"",E){let i=G(E);R+=`
63
+ ${F1.indentComment(i,z.indent)}`}if(y===""&&!z.inFlow){if(R===`
64
64
  `&&b)R=`
65
65
 
66
66
  `}else R+=`
67
- ${X.indent}`}else if(!N&&g0.isCollection(Z)){let i=y[0],C=y.indexOf(`
68
- `),g=C!==-1,S0=X.inFlow??Z.flow??Z.items.length===0;if(g||!S0){let b0=!1;if(g&&(i==="&"||i==="!")){let e=y.indexOf(" ");if(i==="&"&&e!==-1&&e<C&&y[e+1]==="!")e=y.indexOf(" ",e+1);if(e===-1||C<e)b0=!0}if(!b0)R=`
69
- ${X.indent}`}}else if(y===""||y[0]===`
70
- `)R="";if(M+=R+y,X.inFlow){if(x&&z)z()}else if(b&&!x)M+=I1.lineComment(M,X.indent,W(b));else if(B&&J)J();return M}hQ.stringifyPair=gQ});var D6=A((dQ)=>{var p9=L0("process");function uQ($,...Z){if($==="debug")console.log(...Z)}function mQ($,Z){if($==="debug"||$==="warn")if(typeof p9.emitWarning==="function")p9.emitWarning(Z);else console.warn(Z)}dQ.debug=uQ;dQ.warn=mQ});var s2=A((iQ)=>{var F1=v(),l9=$0(),n2="<<",r2={identify:($)=>$===n2||typeof $==="symbol"&&$.description===n2,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new l9.Scalar(Symbol(n2)),{addToJSMap:i9}),stringify:()=>n2},lQ=($,Z)=>(r2.identify(Z)||F1.isScalar(Z)&&(!Z.type||Z.type===l9.Scalar.PLAIN)&&r2.identify(Z.value))&&$?.doc.schema.tags.some((X)=>X.tag===r2.tag&&X.default);function i9($,Z,X){if(X=$&&F1.isAlias(X)?X.resolve($.doc):X,F1.isSeq(X))for(let z of X.items)A6($,Z,z);else if(Array.isArray(X))for(let z of X)A6($,Z,z);else A6($,Z,X)}function A6($,Z,X){let z=$&&F1.isAlias(X)?X.resolve($.doc):X;if(!F1.isMap(z))throw Error("Merge sources must be maps or map aliases");let J=z.toJSON(null,$,Map);for(let[Q,Y]of J)if(Z instanceof Map){if(!Z.has(Q))Z.set(Q,Y)}else if(Z instanceof Set)Z.add(Q);else if(!Object.prototype.hasOwnProperty.call(Z,Q))Object.defineProperty(Z,Q,{value:Y,writable:!0,enumerable:!0,configurable:!0});return Z}iQ.addMergeToJSMap=i9;iQ.isMergeKey=lQ;iQ.merge=r2});var I6=A(($Y)=>{var aQ=D6(),n9=s2(),oQ=w1(),r9=v(),w6=p0();function tQ($,Z,{key:X,value:z}){if(r9.isNode(X)&&X.addToJSMap)X.addToJSMap($,Z,z);else if(n9.isMergeKey($,X))n9.addMergeToJSMap($,Z,z);else{let J=w6.toJS(X,"",$);if(Z instanceof Map)Z.set(J,w6.toJS(z,J,$));else if(Z instanceof Set)Z.add(J);else{let Q=eQ(X,J,$),Y=w6.toJS(z,Q,$);if(Q in Z)Object.defineProperty(Z,Q,{value:Y,writable:!0,enumerable:!0,configurable:!0});else Z[Q]=Y}}return Z}function eQ($,Z,X){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(r9.isNode($)&&X?.doc){let z=oQ.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)+'..."';aQ.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)}$Y.addPairToJSMap=tQ});var n0=A((QY)=>{var s9=M1(),XY=c9(),zY=I6(),a2=v();function JY($,Z,X){let z=s9.createNode($,void 0,X),J=s9.createNode(Z,void 0,X);return new o2(z,J)}class o2{constructor($,Z=null){Object.defineProperty(this,a2.NODE_TYPE,{value:a2.PAIR}),this.key=$,this.value=Z}clone($){let{key:Z,value:X}=this;if(a2.isNode(Z))Z=Z.clone($);if(a2.isNode(X))X=X.clone($);return new o2(Z,X)}toJSON($,Z){let X=Z?.mapAsMap?new Map:{};return zY.addPairToJSMap(Z,X,this)}toString($,Z,X){return $?.doc?XY.stringifyPair(this,$,Z,X):JSON.stringify(this)}}QY.Pair=o2;QY.createPair=JY});var F6=A((VY)=>{var H$=v(),a9=w1(),t2=O1();function GY($,Z,X){return(Z.inFlow??$.flow?UY:WY)($,Z,X)}function WY({comment:$,items:Z},X,{blockItemPrefix:z,flowChars:J,itemIndent:Q,onChompKeep:Y,onComment:q}){let{indent:G,options:{commentString:W}}=X,U=Object.assign({},X,{indent:Q,type:null}),V=!1,K=[];for(let O=0;O<Z.length;++O){let B=Z[O],M=null;if(H$.isNode(B)){if(!V&&B.spaceBefore)K.push("");if(e2(X,K,B.commentBefore,V),B.comment)M=B.comment}else if(H$.isPair(B)){let _=H$.isNode(B.key)?B.key:null;if(_){if(!V&&_.spaceBefore)K.push("");e2(X,K,_.commentBefore,V)}}V=!1;let F=a9.stringify(B,U,()=>M=null,()=>V=!0);if(M)F+=t2.lineComment(F,Q,W(M));if(V&&M)V=!1;K.push(z+F)}let N;if(K.length===0)N=J.start+J.end;else{N=K[0];for(let O=1;O<K.length;++O){let B=K[O];N+=B?`
71
- ${G}${B}`:`
72
- `}}if($){if(N+=`
73
- `+t2.indentComment(W($),G),q)q()}else if(V&&Y)Y();return N}function UY({items:$},Z,{flowChars:X,itemIndent:z}){let{indent:J,indentStep:Q,flowCollectionPadding:Y,options:{commentString:q}}=Z;z+=Q;let G=Object.assign({},Z,{indent:z,inFlow:!0,type:null}),W=!1,U=0,V=[];for(let O=0;O<$.length;++O){let B=$[O],M=null;if(H$.isNode(B)){if(B.spaceBefore)V.push("");if(e2(Z,V,B.commentBefore,!1),B.comment)M=B.comment}else if(H$.isPair(B)){let _=H$.isNode(B.key)?B.key:null;if(_){if(_.spaceBefore)V.push("");if(e2(Z,V,_.commentBefore,!1),_.comment)W=!0}let b=H$.isNode(B.value)?B.value:null;if(b){if(b.comment)M=b.comment;if(b.commentBefore)W=!0}else if(B.value==null&&_?.comment)M=_.comment}if(M)W=!0;let F=a9.stringify(B,G,()=>M=null);if(O<$.length-1)F+=",";if(M)F+=t2.lineComment(F,z,q(M));if(!W&&(V.length>U||F.includes(`
74
- `)))W=!0;V.push(F),U=V.length}let{start:K,end:N}=X;if(V.length===0)return K+N;else{if(!W){let O=V.reduce((B,M)=>B+M.length+2,2);W=Z.options.lineWidth>0&&O>Z.options.lineWidth}if(W){let O=K;for(let B of V)O+=B?`
67
+ ${z.indent}`}else if(!L&&h0.isCollection(Z)){let i=y[0],C=y.indexOf(`
68
+ `),g=C!==-1,b0=z.inFlow??Z.flow??Z.items.length===0;if(g||!b0){let x0=!1;if(g&&(i==="&"||i==="!")){let e=y.indexOf(" ");if(i==="&"&&e!==-1&&e<C&&y[e+1]==="!")e=y.indexOf(" ",e+1);if(e===-1||C<e)x0=!0}if(!x0)R=`
69
+ ${z.indent}`}}else if(y===""||y[0]===`
70
+ `)R="";if(M+=R+y,z.inFlow){if(x&&X)X()}else if(b&&!x)M+=F1.lineComment(M,z.indent,G(b));else if(B&&J)J();return M}nQ.stringifyPair=iQ});var R6=A((oQ)=>{var s9=N0("process");function sQ($,...Z){if($==="debug")console.log(...Z)}function aQ($,Z){if($==="debug"||$==="warn")if(typeof s9.emitWarning==="function")s9.emitWarning(Z);else console.warn(Z)}oQ.debug=sQ;oQ.warn=aQ});var o4=A((ZY)=>{var R1=m(),a9=$0(),s4="<<",a4={identify:($)=>$===s4||typeof $==="symbol"&&$.description===s4,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new a9.Scalar(Symbol(s4)),{addToJSMap:o9}),stringify:()=>s4},$Y=($,Z)=>(a4.identify(Z)||R1.isScalar(Z)&&(!Z.type||Z.type===a9.Scalar.PLAIN)&&a4.identify(Z.value))&&$?.doc.schema.tags.some((z)=>z.tag===a4.tag&&z.default);function o9($,Z,z){if(z=$&&R1.isAlias(z)?z.resolve($.doc):z,R1.isSeq(z))for(let X of z.items)P6($,Z,X);else if(Array.isArray(z))for(let X of z)P6($,Z,X);else P6($,Z,z)}function P6($,Z,z){let X=$&&R1.isAlias(z)?z.resolve($.doc):z;if(!R1.isMap(X))throw Error("Merge sources must be maps or map aliases");let J=X.toJSON(null,$,Map);for(let[Q,Y]of J)if(Z instanceof Map){if(!Z.has(Q))Z.set(Q,Y)}else if(Z instanceof Set)Z.add(Q);else if(!Object.prototype.hasOwnProperty.call(Z,Q))Object.defineProperty(Z,Q,{value:Y,writable:!0,enumerable:!0,configurable:!0});return Z}ZY.addMergeToJSMap=o9;ZY.isMergeKey=$Y;ZY.merge=a4});var E6=A((GY)=>{var QY=R6(),t9=o4(),YY=w1(),e9=m(),_6=l0();function qY($,Z,{key:z,value:X}){if(e9.isNode(z)&&z.addToJSMap)z.addToJSMap($,Z,X);else if(t9.isMergeKey($,z))t9.addMergeToJSMap($,Z,X);else{let J=_6.toJS(z,"",$);if(Z instanceof Map)Z.set(J,_6.toJS(X,J,$));else if(Z instanceof Set)Z.add(J);else{let Q=WY(z,J,$),Y=_6.toJS(X,Q,$);if(Q in Z)Object.defineProperty(Z,Q,{value:Y,writable:!0,enumerable:!0,configurable:!0});else Z[Q]=Y}}return Z}function WY($,Z,z){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(e9.isNode($)&&z?.doc){let X=YY.createStringifyContext(z.doc,{});X.anchors=new Set;for(let Q of z.anchors.keys())X.anchors.add(Q.anchor);X.inFlow=!0,X.inStringifyKey=!0;let J=$.toString(X);if(!z.mapKeyWarned){let Q=JSON.stringify(J);if(Q.length>40)Q=Q.substring(0,36)+'..."';QY.warn(z.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${Q}. Set mapAsMap: true to use object keys.`),z.mapKeyWarned=!0}return J}return JSON.stringify(Z)}GY.addPairToJSMap=qY});var r0=A((BY)=>{var $5=O1(),VY=r9(),KY=E6(),t4=m();function HY($,Z,z){let X=$5.createNode($,void 0,z),J=$5.createNode(Z,void 0,z);return new e4(X,J)}class e4{constructor($,Z=null){Object.defineProperty(this,t4.NODE_TYPE,{value:t4.PAIR}),this.key=$,this.value=Z}clone($){let{key:Z,value:z}=this;if(t4.isNode(Z))Z=Z.clone($);if(t4.isNode(z))z=z.clone($);return new e4(Z,z)}toJSON($,Z){let z=Z?.mapAsMap?new Map:{};return KY.addPairToJSMap(Z,z,this)}toString($,Z,z){return $?.doc?VY.stringifyPair(this,$,Z,z):JSON.stringify(this)}}BY.Pair=e4;BY.createPair=HY});var C6=A((DY)=>{var H$=m(),Z5=w1(),$2=D1();function TY($,Z,z){return(Z.inFlow??$.flow?OY:MY)($,Z,z)}function MY({comment:$,items:Z},z,{blockItemPrefix:X,flowChars:J,itemIndent:Q,onChompKeep:Y,onComment:q}){let{indent:W,options:{commentString:G}}=z,U=Object.assign({},z,{indent:Q,type:null}),V=!1,K=[];for(let O=0;O<Z.length;++O){let B=Z[O],M=null;if(H$.isNode(B)){if(!V&&B.spaceBefore)K.push("");if(Z2(z,K,B.commentBefore,V),B.comment)M=B.comment}else if(H$.isPair(B)){let E=H$.isNode(B.key)?B.key:null;if(E){if(!V&&E.spaceBefore)K.push("");Z2(z,K,E.commentBefore,V)}}V=!1;let F=Z5.stringify(B,U,()=>M=null,()=>V=!0);if(M)F+=$2.lineComment(F,Q,G(M));if(V&&M)V=!1;K.push(X+F)}let L;if(K.length===0)L=J.start+J.end;else{L=K[0];for(let O=1;O<K.length;++O){let B=K[O];L+=B?`
71
+ ${W}${B}`:`
72
+ `}}if($){if(L+=`
73
+ `+$2.indentComment(G($),W),q)q()}else if(V&&Y)Y();return L}function OY({items:$},Z,{flowChars:z,itemIndent:X}){let{indent:J,indentStep:Q,flowCollectionPadding:Y,options:{commentString:q}}=Z;X+=Q;let W=Object.assign({},Z,{indent:X,inFlow:!0,type:null}),G=!1,U=0,V=[];for(let O=0;O<$.length;++O){let B=$[O],M=null;if(H$.isNode(B)){if(B.spaceBefore)V.push("");if(Z2(Z,V,B.commentBefore,!1),B.comment)M=B.comment}else if(H$.isPair(B)){let E=H$.isNode(B.key)?B.key:null;if(E){if(E.spaceBefore)V.push("");if(Z2(Z,V,E.commentBefore,!1),E.comment)G=!0}let b=H$.isNode(B.value)?B.value:null;if(b){if(b.comment)M=b.comment;if(b.commentBefore)G=!0}else if(B.value==null&&E?.comment)M=E.comment}if(M)G=!0;let F=Z5.stringify(B,W,()=>M=null);if(O<$.length-1)F+=",";if(M)F+=$2.lineComment(F,X,q(M));if(!G&&(V.length>U||F.includes(`
74
+ `)))G=!0;V.push(F),U=V.length}let{start:K,end:L}=z;if(V.length===0)return K+L;else{if(!G){let O=V.reduce((B,M)=>B+M.length+2,2);G=Z.options.lineWidth>0&&O>Z.options.lineWidth}if(G){let O=K;for(let B of V)O+=B?`
75
75
  ${Q}${J}${B}`:`
76
76
  `;return`${O}
77
- ${J}${N}`}else return`${K}${Y}${V.join(" ")}${Y}${N}`}}function e2({indent:$,options:{commentString:Z}},X,z,J){if(z&&J)z=z.replace(/^\n+/,"");if(z){let Q=t2.indentComment(Z(z),$);X.push(Q.trimStart())}}VY.stringifyCollection=GY});var s0=A((TY)=>{var HY=F6(),BY=I6(),NY=c2(),r0=v(),$4=n0(),LY=$0();function R1($,Z){let X=r0.isScalar(Z)?Z.value:Z;for(let z of $)if(r0.isPair(z)){if(z.key===Z||z.key===X)return z;if(r0.isScalar(z.key)&&z.key.value===X)return z}return}class o9 extends NY.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(r0.MAP,$);this.items=[]}static from($,Z,X){let{keepUndefined:z,replacer:J}=X,Q=new this($),Y=(q,G)=>{if(typeof J==="function")G=J.call(Z,q,G);else if(Array.isArray(J)&&!J.includes(q))return;if(G!==void 0||z)Q.items.push($4.createPair(q,G,X))};if(Z instanceof Map)for(let[q,G]of Z)Y(q,G);else if(Z&&typeof Z==="object")for(let q of Object.keys(Z))Y(q,Z[q]);if(typeof $.sortMapEntries==="function")Q.items.sort($.sortMapEntries);return Q}add($,Z){let X;if(r0.isPair($))X=$;else if(!$||typeof $!=="object"||!("key"in $))X=new $4.Pair($,$?.value);else X=new $4.Pair($.key,$.value);let z=R1(this.items,X.key),J=this.schema?.sortMapEntries;if(z){if(!Z)throw Error(`Key ${X.key} already set`);if(r0.isScalar(z.value)&&LY.isScalarValue(X.value))z.value.value=X.value;else z.value=X.value}else if(J){let Q=this.items.findIndex((Y)=>J(X,Y)<0);if(Q===-1)this.items.push(X);else this.items.splice(Q,0,X)}else this.items.push(X)}delete($){let Z=R1(this.items,$);if(!Z)return!1;return this.items.splice(this.items.indexOf(Z),1).length>0}get($,Z){let z=R1(this.items,$)?.value;return(!Z&&r0.isScalar(z)?z.value:z)??void 0}has($){return!!R1(this.items,$)}set($,Z){this.add(new $4.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)BY.addPairToJSMap(Z,z,J);return z}toString($,Z,X){if(!$)return JSON.stringify(this);for(let z of this.items)if(!r0.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 HY.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:X,onComment:Z})}}TY.YAMLMap=o9;TY.findPair=R1});var x$=A((wY)=>{var DY=v(),t9=s0(),AY={collection:"map",default:!0,nodeClass:t9.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,Z){if(!DY.isMap($))Z("Expected a mapping for this tag");return $},createNode:($,Z,X)=>t9.YAMLMap.from($,Z,X)};wY.map=AY});var a0=A((CY)=>{var FY=M1(),RY=F6(),PY=c2(),X4=v(),EY=$0(),_Y=p0();class e9 extends PY.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(X4.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let Z=Z4($);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get($,Z){let X=Z4($);if(typeof X!=="number")return;let z=this.items[X];return!Z&&X4.isScalar(z)?z.value:z}has($){let Z=Z4($);return typeof Z==="number"&&Z<this.items.length}set($,Z){let X=Z4($);if(typeof X!=="number")throw Error(`Expected a valid index, not ${$}.`);let z=this.items[X];if(X4.isScalar(z)&&EY.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(_Y.toJS(J,String(z++),Z));return X}toString($,Z,X){if(!$)return JSON.stringify(this);return RY.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 Y of Z){if(typeof z==="function"){let q=Z instanceof Set?Y:String(Q++);Y=z.call(Z,q,Y)}J.items.push(FY.createNode(Y,void 0,X))}}return J}}function Z4($){let Z=X4.isScalar($)?$.value:$;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}CY.YAMLSeq=e9});var y$=A((xY)=>{var SY=v(),$5=a0(),bY={collection:"seq",default:!0,nodeClass:$5.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,Z){if(!SY.isSeq($))Z("Expected a sequence for this tag");return $},createNode:($,Z,X)=>$5.YAMLSeq.from($,Z,X)};xY.seq=bY});var P1=A((gY)=>{var kY=A1(),fY={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,Z,X,z){return Z=Object.assign({actualString:!0},Z),kY.stringifyString($,Z,X,z)}};gY.string=fY});var z4=A((vY)=>{var Z5=$0(),X5={identify:($)=>$==null,createNode:()=>new Z5.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Z5.Scalar(null),stringify:({source:$},Z)=>typeof $==="string"&&X5.test.test($)?$:Z.options.nullStr};vY.nullTag=X5});var R6=A((dY)=>{var mY=$0(),z5={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new mY.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:Z},X){if($&&z5.test.test($)){let z=$[0]==="t"||$[0]==="T";if(Z===z)return $}return Z?X.options.trueStr:X.options.falseStr}};dY.boolTag=z5});var k$=A((lY)=>{function pY({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 Y=Q.indexOf(".");if(Y<0)Y=Q.length,Q+=".";let q=Z-(Q.length-Y-1);while(q-- >0)Q+="0"}return Q}lY.stringifyNumber=pY});var E6=A((oY)=>{var nY=$0(),P6=k$(),rY={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:P6.stringifyNumber},sY={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():P6.stringifyNumber($)}},aY={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let Z=new nY.Scalar(parseFloat($)),X=$.indexOf(".");if(X!==-1&&$[$.length-1]==="0")Z.minFractionDigits=$.length-X-1;return Z},stringify:P6.stringifyNumber};oY.float=aY;oY.floatExp=sY;oY.floatNaN=rY});var C6=A((Jq)=>{var J5=k$(),J4=($)=>typeof $==="bigint"||Number.isInteger($),_6=($,Z,X,{intAsBigInt:z})=>z?BigInt($):parseInt($.substring(Z),X);function Q5($,Z,X){let{value:z}=$;if(J4(z)&&z>=0)return X+z.toString(Z);return J5.stringifyNumber($)}var Zq={identify:($)=>J4($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,Z,X)=>_6($,2,8,X),stringify:($)=>Q5($,8,"0o")},Xq={identify:J4,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,Z,X)=>_6($,0,10,X),stringify:J5.stringifyNumber},zq={identify:($)=>J4($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,Z,X)=>_6($,2,16,X),stringify:($)=>Q5($,16,"0x")};Jq.int=Xq;Jq.intHex=zq;Jq.intOct=Zq});var Y5=A((Bq)=>{var Gq=x$(),Wq=z4(),Uq=y$(),Vq=P1(),Kq=R6(),j6=E6(),S6=C6(),Hq=[Gq.map,Uq.seq,Vq.string,Wq.nullTag,Kq.boolTag,S6.intOct,S6.int,S6.intHex,j6.floatNaN,j6.floatExp,j6.float];Bq.schema=Hq});var G5=A((wq)=>{var Lq=$0(),Tq=x$(),Mq=y$();function q5($){return typeof $==="bigint"||Number.isInteger($)}var Q4=({value:$})=>JSON.stringify($),Oq=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:Q4},{identify:($)=>$==null,createNode:()=>new Lq.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Q4},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:Q4},{identify:q5,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,Z,{intAsBigInt:X})=>X?BigInt($):parseInt($,10),stringify:({value:$})=>q5($)?$.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:Q4}],Dq={default:!0,tag:"",test:/^/,resolve($,Z){return Z(`Unresolved plain scalar ${JSON.stringify($)}`),$}},Aq=[Tq.map,Mq.seq].concat(Oq,Dq);wq.schema=Aq});var x6=A((Pq)=>{var E1=L0("buffer"),b6=$0(),Fq=A1(),Rq={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,Z){if(typeof E1.Buffer==="function")return E1.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 Y=X,q;if(typeof E1.Buffer==="function")q=Y instanceof E1.Buffer?Y.toString("base64"):E1.Buffer.from(Y.buffer).toString("base64");else if(typeof btoa==="function"){let G="";for(let W=0;W<Y.length;++W)G+=String.fromCharCode(Y[W]);q=btoa(G)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(Z??(Z=b6.Scalar.BLOCK_LITERAL),Z!==b6.Scalar.QUOTE_DOUBLE){let G=Math.max(z.options.lineWidth-z.indent.length,z.options.minContentWidth),W=Math.ceil(q.length/G),U=Array(W);for(let V=0,K=0;V<W;++V,K+=G)U[V]=q.substr(K,G);q=U.join(Z===b6.Scalar.BLOCK_LITERAL?`
78
- `:" ")}return Fq.stringifyString({comment:$,type:Z,value:q},z,J,Q)}};Pq.binary=Rq});var q4=A((Sq)=>{var Y4=v(),y6=n0(),_q=$0(),Cq=a0();function W5($,Z){if(Y4.isSeq($))for(let X=0;X<$.items.length;++X){let z=$.items[X];if(Y4.isPair(z))continue;else if(Y4.isMap(z)){if(z.items.length>1)Z("Each pair must have its own sequence indicator");let J=z.items[0]||new y6.Pair(new _q.Scalar(null));if(z.commentBefore)J.key.commentBefore=J.key.commentBefore?`${z.commentBefore}
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]=Y4.isPair(z)?z:new y6.Pair(z)}else Z("Expected a sequence for this tag");return $}function U5($,Z,X){let{replacer:z}=X,J=new Cq.YAMLSeq($);J.tag="tag:yaml.org,2002:pairs";let Q=0;if(Z&&Symbol.iterator in Object(Z))for(let Y of Z){if(typeof z==="function")Y=z.call(Z,String(Q++),Y);let q,G;if(Array.isArray(Y))if(Y.length===2)q=Y[0],G=Y[1];else throw TypeError(`Expected [key, value] tuple: ${Y}`);else if(Y&&Y instanceof Object){let W=Object.keys(Y);if(W.length===1)q=W[0],G=Y[q];else throw TypeError(`Expected tuple with one key, not ${W.length} keys`)}else q=Y;J.items.push(y6.createPair(q,G,X))}return J}var jq={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:W5,createNode:U5};Sq.createPairs=U5;Sq.pairs=jq;Sq.resolvePairs=W5});var f6=A((gq)=>{var V5=v(),k6=p0(),_1=s0(),kq=a0(),K5=q4();class B$ extends kq.YAMLSeq{constructor(){super();this.add=_1.YAMLMap.prototype.add.bind(this),this.delete=_1.YAMLMap.prototype.delete.bind(this),this.get=_1.YAMLMap.prototype.get.bind(this),this.has=_1.YAMLMap.prototype.has.bind(this),this.set=_1.YAMLMap.prototype.set.bind(this),this.tag=B$.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(V5.isPair(z))J=k6.toJS(z.key,"",Z),Q=k6.toJS(z.value,J,Z);else J=k6.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=K5.createPairs($,Z,X),J=new this;return J.items=z.items,J}}B$.tag="tag:yaml.org,2002:omap";var fq={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:B$,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,Z){let X=K5.resolvePairs($,Z),z=[];for(let{key:J}of X.items)if(V5.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 B$,X)},createNode:($,Z,X)=>B$.from($,Z,X)};gq.YAMLOMap=B$;gq.omap=fq});var T5=A((uq)=>{var H5=$0();function B5({value:$,source:Z},X){if(Z&&($?N5:L5).test.test(Z))return Z;return $?X.options.trueStr:X.options.falseStr}var N5={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new H5.Scalar(!0),stringify:B5},L5={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new H5.Scalar(!1),stringify:B5};uq.falseTag=L5;uq.trueTag=N5});var M5=A((nq)=>{var cq=$0(),g6=k$(),pq={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:g6.stringifyNumber},lq={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():g6.stringifyNumber($)}},iq={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let Z=new cq.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:g6.stringifyNumber};nq.float=iq;nq.floatExp=lq;nq.floatNaN=pq});var D5=A((ZG)=>{var O5=k$(),C1=($)=>typeof $==="bigint"||Number.isInteger($);function G4($,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 Y=BigInt($);return J==="-"?BigInt(-1)*Y:Y}let Q=parseInt($,X);return J==="-"?-1*Q:Q}function h6($,Z,X){let{value:z}=$;if(C1(z)){let J=z.toString(Z);return z<0?"-"+X+J.substr(1):X+J}return O5.stringifyNumber($)}var oq={identify:C1,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,Z,X)=>G4($,2,2,X),stringify:($)=>h6($,2,"0b")},tq={identify:C1,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,Z,X)=>G4($,1,8,X),stringify:($)=>h6($,8,"0")},eq={identify:C1,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,Z,X)=>G4($,0,10,X),stringify:O5.stringifyNumber},$G={identify:C1,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,Z,X)=>G4($,2,16,X),stringify:($)=>h6($,16,"0x")};ZG.int=eq;ZG.intBin=oq;ZG.intHex=$G;ZG.intOct=tq});var v6=A((qG)=>{var V4=v(),W4=n0(),U4=s0();class N$ extends U4.YAMLMap{constructor($){super($);this.tag=N$.tag}add($){let Z;if(V4.isPair($))Z=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)Z=new W4.Pair($.key,null);else Z=new W4.Pair($,null);if(!U4.findPair(this.items,Z.key))this.items.push(Z)}get($,Z){let X=U4.findPair(this.items,$);return!Z&&V4.isPair(X)?V4.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=U4.findPair(this.items,$);if(X&&!Z)this.items.splice(this.items.indexOf(X),1);else if(!X&&Z)this.items.push(new W4.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(W4.createPair(Q,null,X))}return J}}N$.tag="tag:yaml.org,2002:set";var YG={collection:"map",identify:($)=>$ instanceof Set,nodeClass:N$,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,Z,X)=>N$.from($,Z,X),resolve($,Z){if(V4.isMap($))if($.hasAllNullValues(!0))return Object.assign(new N$,$);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return $}};qG.YAMLSet=N$;qG.set=YG});var m6=A((HG)=>{var UG=k$();function u6($,Z){let X=$[0],z=X==="-"||X==="+"?$.substring(1):$,J=(Y)=>Z?BigInt(Y):Number(Y),Q=z.replace(/_/g,"").split(":").reduce((Y,q)=>Y*J(60)+J(q),J(0));return X==="-"?J(-1)*Q:Q}function A5($){let{value:Z}=$,X=(Y)=>Y;if(typeof Z==="bigint")X=(Y)=>BigInt(Y);else if(isNaN(Z)||!isFinite(Z))return UG.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((Y)=>String(Y).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var VG={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})=>u6($,X),stringify:A5},KG={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:($)=>u6($,!1),stringify:A5},w5={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(w5.test);if(!Z)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,X,z,J,Q,Y,q]=Z.map(Number),G=Z[7]?Number((Z[7]+"00").substr(1,3)):0,W=Date.UTC(X,z-1,J,Q||0,Y||0,q||0,G),U=Z[8];if(U&&U!=="Z"){let V=u6(U,!1);if(Math.abs(V)<30)V*=60;W-=60000*V}return new Date(W)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};HG.floatTime=KG;HG.intTime=VG;HG.timestamp=w5});var F5=A((EG)=>{var TG=x$(),MG=z4(),OG=y$(),DG=P1(),AG=x6(),I5=T5(),d6=M5(),K4=D5(),wG=s2(),IG=f6(),FG=q4(),RG=v6(),c6=m6(),PG=[TG.map,OG.seq,DG.string,MG.nullTag,I5.trueTag,I5.falseTag,K4.intBin,K4.intOct,K4.int,K4.intHex,d6.floatNaN,d6.floatExp,d6.float,AG.binary,wG.merge,IG.omap,FG.pairs,RG.set,c6.intTime,c6.floatTime,c6.timestamp];EG.schema=PG});var y5=A((fG)=>{var _5=x$(),CG=z4(),C5=y$(),jG=P1(),SG=R6(),p6=E6(),l6=C6(),bG=Y5(),xG=G5(),j5=x6(),j1=s2(),S5=f6(),b5=q4(),R5=F5(),x5=v6(),H4=m6(),P5=new Map([["core",bG.schema],["failsafe",[_5.map,C5.seq,jG.string]],["json",xG.schema],["yaml11",R5.schema],["yaml-1.1",R5.schema]]),E5={binary:j5.binary,bool:SG.boolTag,float:p6.float,floatExp:p6.floatExp,floatNaN:p6.floatNaN,floatTime:H4.floatTime,int:l6.int,intHex:l6.intHex,intOct:l6.intOct,intTime:H4.intTime,map:_5.map,merge:j1.merge,null:CG.nullTag,omap:S5.omap,pairs:b5.pairs,seq:C5.seq,set:x5.set,timestamp:H4.timestamp},yG={"tag:yaml.org,2002:binary":j5.binary,"tag:yaml.org,2002:merge":j1.merge,"tag:yaml.org,2002:omap":S5.omap,"tag:yaml.org,2002:pairs":b5.pairs,"tag:yaml.org,2002:set":x5.set,"tag:yaml.org,2002:timestamp":H4.timestamp};function kG($,Z,X){let z=P5.get(Z);if(z&&!$)return X&&!z.includes(j1.merge)?z.concat(j1.merge):z.slice();let J=z;if(!J)if(Array.isArray($))J=[];else{let Q=Array.from(P5.keys()).filter((Y)=>Y!=="yaml11").map((Y)=>JSON.stringify(Y)).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(j1.merge);return J.reduce((Q,Y)=>{let q=typeof Y==="string"?E5[Y]:Y;if(!q){let G=JSON.stringify(Y),W=Object.keys(E5).map((U)=>JSON.stringify(U)).join(", ");throw Error(`Unknown custom tag ${G}; use one of ${W}`)}if(!Q.includes(q))Q.push(q);return Q},[])}fG.coreKnownTags=yG;fG.getTags=kG});var r6=A((cG)=>{var i6=v(),vG=x$(),uG=y$(),mG=P1(),B4=y5(),dG=($,Z)=>$.key<Z.key?-1:$.key>Z.key?1:0;class n6{constructor({compat:$,customTags:Z,merge:X,resolveKnownTags:z,schema:J,sortMapEntries:Q,toStringDefaults:Y}){this.compat=Array.isArray($)?B4.getTags($,"compat"):$?B4.getTags(null,$):null,this.name=typeof J==="string"&&J||"core",this.knownTags=z?B4.coreKnownTags:{},this.tags=B4.getTags(Z,this.name,X),this.toStringOptions=Y??null,Object.defineProperty(this,i6.MAP,{value:vG.map}),Object.defineProperty(this,i6.SCALAR,{value:mG.string}),Object.defineProperty(this,i6.SEQ,{value:uG.seq}),this.sortMapEntries=typeof Q==="function"?Q:Q===!0?dG:null}clone(){let $=Object.create(n6.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}cG.Schema=n6});var k5=A((nG)=>{var lG=v(),s6=w1(),S1=O1();function iG($,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=s6.createStringifyContext($,Z),{commentString:Q}=J.options;if($.commentBefore){if(X.length!==1)X.unshift("");let G=Q($.commentBefore);X.unshift(S1.indentComment(G,""))}let Y=!1,q=null;if($.contents){if(lG.isNode($.contents)){if($.contents.spaceBefore&&z)X.push("");if($.contents.commentBefore){let U=Q($.contents.commentBefore);X.push(S1.indentComment(U,""))}J.forceBlockIndent=!!$.comment,q=$.contents.comment}let G=q?void 0:()=>Y=!0,W=s6.stringify($.contents,J,()=>q=null,G);if(q)W+=S1.lineComment(W,"",Q(q));if((W[0]==="|"||W[0]===">")&&X[X.length-1]==="---")X[X.length-1]=`--- ${W}`;else X.push(W)}else X.push(s6.stringify($.contents,J));if($.directives?.docEnd)if($.comment){let G=Q($.comment);if(G.includes(`
81
- `))X.push("..."),X.push(S1.indentComment(G,""));else X.push(`... ${G}`)}else X.push("...");else{let G=$.comment;if(G&&Y)G=G.replace(/^\n+/,"");if(G){if((!Y||q)&&X[X.length-1]!=="")X.push("");X.push(S1.indentComment(Q(G),""))}}return X.join(`
77
+ ${J}${L}`}else return`${K}${Y}${V.join(" ")}${Y}${L}`}}function Z2({indent:$,options:{commentString:Z}},z,X,J){if(X&&J)X=X.replace(/^\n+/,"");if(X){let Q=$2.indentComment(Z(X),$);z.push(Q.trimStart())}}DY.stringifyCollection=TY});var a0=A((PY)=>{var IY=C6(),wY=E6(),FY=l4(),s0=m(),z2=r0(),RY=$0();function P1($,Z){let z=s0.isScalar(Z)?Z.value:Z;for(let X of $)if(s0.isPair(X)){if(X.key===Z||X.key===z)return X;if(s0.isScalar(X.key)&&X.key.value===z)return X}return}class z5 extends FY.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(s0.MAP,$);this.items=[]}static from($,Z,z){let{keepUndefined:X,replacer:J}=z,Q=new this($),Y=(q,W)=>{if(typeof J==="function")W=J.call(Z,q,W);else if(Array.isArray(J)&&!J.includes(q))return;if(W!==void 0||X)Q.items.push(z2.createPair(q,W,z))};if(Z instanceof Map)for(let[q,W]of Z)Y(q,W);else if(Z&&typeof Z==="object")for(let q of Object.keys(Z))Y(q,Z[q]);if(typeof $.sortMapEntries==="function")Q.items.sort($.sortMapEntries);return Q}add($,Z){let z;if(s0.isPair($))z=$;else if(!$||typeof $!=="object"||!("key"in $))z=new z2.Pair($,$?.value);else z=new z2.Pair($.key,$.value);let X=P1(this.items,z.key),J=this.schema?.sortMapEntries;if(X){if(!Z)throw Error(`Key ${z.key} already set`);if(s0.isScalar(X.value)&&RY.isScalarValue(z.value))X.value.value=z.value;else X.value=z.value}else if(J){let Q=this.items.findIndex((Y)=>J(z,Y)<0);if(Q===-1)this.items.push(z);else this.items.splice(Q,0,z)}else this.items.push(z)}delete($){let Z=P1(this.items,$);if(!Z)return!1;return this.items.splice(this.items.indexOf(Z),1).length>0}get($,Z){let X=P1(this.items,$)?.value;return(!Z&&s0.isScalar(X)?X.value:X)??void 0}has($){return!!P1(this.items,$)}set($,Z){this.add(new z2.Pair($,Z),!0)}toJSON($,Z,z){let X=z?new z:Z?.mapAsMap?new Map:{};if(Z?.onCreate)Z.onCreate(X);for(let J of this.items)wY.addPairToJSMap(Z,X,J);return X}toString($,Z,z){if(!$)return JSON.stringify(this);for(let X of this.items)if(!s0.isPair(X))throw Error(`Map items must all be pairs; found ${JSON.stringify(X)} instead`);if(!$.allNullValues&&this.hasAllNullValues(!1))$=Object.assign({},$,{allNullValues:!0});return IY.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:z,onComment:Z})}}PY.YAMLMap=z5;PY.findPair=P1});var x$=A((SY)=>{var CY=m(),X5=a0(),jY={collection:"map",default:!0,nodeClass:X5.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,Z){if(!CY.isMap($))Z("Expected a mapping for this tag");return $},createNode:($,Z,z)=>X5.YAMLMap.from($,Z,z)};SY.map=jY});var o0=A((hY)=>{var xY=O1(),yY=C6(),kY=l4(),J2=m(),fY=$0(),gY=l0();class J5 extends kY.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(J2.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let Z=X2($);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get($,Z){let z=X2($);if(typeof z!=="number")return;let X=this.items[z];return!Z&&J2.isScalar(X)?X.value:X}has($){let Z=X2($);return typeof Z==="number"&&Z<this.items.length}set($,Z){let z=X2($);if(typeof z!=="number")throw Error(`Expected a valid index, not ${$}.`);let X=this.items[z];if(J2.isScalar(X)&&fY.isScalarValue(Z))X.value=Z;else this.items[z]=Z}toJSON($,Z){let z=[];if(Z?.onCreate)Z.onCreate(z);let X=0;for(let J of this.items)z.push(gY.toJS(J,String(X++),Z));return z}toString($,Z,z){if(!$)return JSON.stringify(this);return yY.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:z,onComment:Z})}static from($,Z,z){let{replacer:X}=z,J=new this($);if(Z&&Symbol.iterator in Object(Z)){let Q=0;for(let Y of Z){if(typeof X==="function"){let q=Z instanceof Set?Y:String(Q++);Y=X.call(Z,q,Y)}J.items.push(xY.createNode(Y,void 0,z))}}return J}}function X2($){let Z=J2.isScalar($)?$.value:$;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}hY.YAMLSeq=J5});var y$=A((dY)=>{var uY=m(),Q5=o0(),mY={collection:"seq",default:!0,nodeClass:Q5.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,Z){if(!uY.isSeq($))Z("Expected a sequence for this tag");return $},createNode:($,Z,z)=>Q5.YAMLSeq.from($,Z,z)};dY.seq=mY});var _1=A((iY)=>{var pY=I1(),lY={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,Z,z,X){return Z=Object.assign({actualString:!0},Z),pY.stringifyString($,Z,z,X)}};iY.string=lY});var Q2=A((rY)=>{var Y5=$0(),q5={identify:($)=>$==null,createNode:()=>new Y5.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Y5.Scalar(null),stringify:({source:$},Z)=>typeof $==="string"&&q5.test.test($)?$:Z.options.nullStr};rY.nullTag=q5});var j6=A((oY)=>{var aY=$0(),W5={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new aY.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:Z},z){if($&&W5.test.test($)){let X=$[0]==="t"||$[0]==="T";if(Z===X)return $}return Z?z.options.trueStr:z.options.falseStr}};oY.boolTag=W5});var k$=A(($q)=>{function eY({format:$,minFractionDigits:Z,tag:z,value:X}){if(typeof X==="bigint")return String(X);let J=typeof X==="number"?X:Number(X);if(!isFinite(J))return isNaN(J)?".nan":J<0?"-.inf":".inf";let Q=Object.is(X,-0)?"-0":JSON.stringify(X);if(!$&&Z&&(!z||z==="tag:yaml.org,2002:float")&&/^\d/.test(Q)){let Y=Q.indexOf(".");if(Y<0)Y=Q.length,Q+=".";let q=Z-(Q.length-Y-1);while(q-- >0)Q+="0"}return Q}$q.stringifyNumber=eY});var b6=A((Yq)=>{var zq=$0(),S6=k$(),Xq={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:S6.stringifyNumber},Jq={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():S6.stringifyNumber($)}},Qq={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let Z=new zq.Scalar(parseFloat($)),z=$.indexOf(".");if(z!==-1&&$[$.length-1]==="0")Z.minFractionDigits=$.length-z-1;return Z},stringify:S6.stringifyNumber};Yq.float=Qq;Yq.floatExp=Jq;Yq.floatNaN=Xq});var y6=A((Hq)=>{var G5=k$(),Y2=($)=>typeof $==="bigint"||Number.isInteger($),x6=($,Z,z,{intAsBigInt:X})=>X?BigInt($):parseInt($.substring(Z),z);function U5($,Z,z){let{value:X}=$;if(Y2(X)&&X>=0)return z+X.toString(Z);return G5.stringifyNumber($)}var Uq={identify:($)=>Y2($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,Z,z)=>x6($,2,8,z),stringify:($)=>U5($,8,"0o")},Vq={identify:Y2,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,Z,z)=>x6($,0,10,z),stringify:G5.stringifyNumber},Kq={identify:($)=>Y2($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,Z,z)=>x6($,2,16,z),stringify:($)=>U5($,16,"0x")};Hq.int=Vq;Hq.intHex=Kq;Hq.intOct=Uq});var V5=A((wq)=>{var Tq=x$(),Mq=Q2(),Oq=y$(),Dq=_1(),Aq=j6(),k6=b6(),f6=y6(),Iq=[Tq.map,Oq.seq,Dq.string,Mq.nullTag,Aq.boolTag,f6.intOct,f6.int,f6.intHex,k6.floatNaN,k6.floatExp,k6.float];wq.schema=Iq});var H5=A((Sq)=>{var Rq=$0(),Pq=x$(),_q=y$();function K5($){return typeof $==="bigint"||Number.isInteger($)}var q2=({value:$})=>JSON.stringify($),Eq=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:q2},{identify:($)=>$==null,createNode:()=>new Rq.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:q2},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:q2},{identify:K5,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,Z,{intAsBigInt:z})=>z?BigInt($):parseInt($,10),stringify:({value:$})=>K5($)?$.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:q2}],Cq={default:!0,tag:"",test:/^/,resolve($,Z){return Z(`Unresolved plain scalar ${JSON.stringify($)}`),$}},jq=[Pq.map,_q.seq].concat(Eq,Cq);Sq.schema=jq});var h6=A((kq)=>{var E1=N0("buffer"),g6=$0(),xq=I1(),yq={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,Z){if(typeof E1.Buffer==="function")return E1.Buffer.from($,"base64");else if(typeof atob==="function"){let z=atob($.replace(/[\n\r]/g,"")),X=new Uint8Array(z.length);for(let J=0;J<z.length;++J)X[J]=z.charCodeAt(J);return X}else return Z("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:Z,value:z},X,J,Q){if(!z)return"";let Y=z,q;if(typeof E1.Buffer==="function")q=Y instanceof E1.Buffer?Y.toString("base64"):E1.Buffer.from(Y.buffer).toString("base64");else if(typeof btoa==="function"){let W="";for(let G=0;G<Y.length;++G)W+=String.fromCharCode(Y[G]);q=btoa(W)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(Z??(Z=g6.Scalar.BLOCK_LITERAL),Z!==g6.Scalar.QUOTE_DOUBLE){let W=Math.max(X.options.lineWidth-X.indent.length,X.options.minContentWidth),G=Math.ceil(q.length/W),U=Array(G);for(let V=0,K=0;V<G;++V,K+=W)U[V]=q.substr(K,W);q=U.join(Z===g6.Scalar.BLOCK_LITERAL?`
78
+ `:" ")}return xq.stringifyString({comment:$,type:Z,value:q},X,J,Q)}};kq.binary=yq});var G2=A((uq)=>{var W2=m(),v6=r0(),gq=$0(),hq=o0();function B5($,Z){if(W2.isSeq($))for(let z=0;z<$.items.length;++z){let X=$.items[z];if(W2.isPair(X))continue;else if(W2.isMap(X)){if(X.items.length>1)Z("Each pair must have its own sequence indicator");let J=X.items[0]||new v6.Pair(new gq.Scalar(null));if(X.commentBefore)J.key.commentBefore=J.key.commentBefore?`${X.commentBefore}
79
+ ${J.key.commentBefore}`:X.commentBefore;if(X.comment){let Q=J.value??J.key;Q.comment=Q.comment?`${X.comment}
80
+ ${Q.comment}`:X.comment}X=J}$.items[z]=W2.isPair(X)?X:new v6.Pair(X)}else Z("Expected a sequence for this tag");return $}function L5($,Z,z){let{replacer:X}=z,J=new hq.YAMLSeq($);J.tag="tag:yaml.org,2002:pairs";let Q=0;if(Z&&Symbol.iterator in Object(Z))for(let Y of Z){if(typeof X==="function")Y=X.call(Z,String(Q++),Y);let q,W;if(Array.isArray(Y))if(Y.length===2)q=Y[0],W=Y[1];else throw TypeError(`Expected [key, value] tuple: ${Y}`);else if(Y&&Y instanceof Object){let G=Object.keys(Y);if(G.length===1)q=G[0],W=Y[q];else throw TypeError(`Expected tuple with one key, not ${G.length} keys`)}else q=Y;J.items.push(v6.createPair(q,W,z))}return J}var vq={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:B5,createNode:L5};uq.createPairs=L5;uq.pairs=vq;uq.resolvePairs=B5});var m6=A((iq)=>{var N5=m(),u6=l0(),C1=a0(),pq=o0(),T5=G2();class B$ extends pq.YAMLSeq{constructor(){super();this.add=C1.YAMLMap.prototype.add.bind(this),this.delete=C1.YAMLMap.prototype.delete.bind(this),this.get=C1.YAMLMap.prototype.get.bind(this),this.has=C1.YAMLMap.prototype.has.bind(this),this.set=C1.YAMLMap.prototype.set.bind(this),this.tag=B$.tag}toJSON($,Z){if(!Z)return super.toJSON($);let z=new Map;if(Z?.onCreate)Z.onCreate(z);for(let X of this.items){let J,Q;if(N5.isPair(X))J=u6.toJS(X.key,"",Z),Q=u6.toJS(X.value,J,Z);else J=u6.toJS(X,"",Z);if(z.has(J))throw Error("Ordered maps must not include duplicate keys");z.set(J,Q)}return z}static from($,Z,z){let X=T5.createPairs($,Z,z),J=new this;return J.items=X.items,J}}B$.tag="tag:yaml.org,2002:omap";var lq={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:B$,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,Z){let z=T5.resolvePairs($,Z),X=[];for(let{key:J}of z.items)if(N5.isScalar(J))if(X.includes(J.value))Z(`Ordered maps must not include duplicate keys: ${J.value}`);else X.push(J.value);return Object.assign(new B$,z)},createNode:($,Z,z)=>B$.from($,Z,z)};iq.YAMLOMap=B$;iq.omap=lq});var I5=A((sq)=>{var M5=$0();function O5({value:$,source:Z},z){if(Z&&($?D5:A5).test.test(Z))return Z;return $?z.options.trueStr:z.options.falseStr}var D5={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new M5.Scalar(!0),stringify:O5},A5={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new M5.Scalar(!1),stringify:O5};sq.falseTag=A5;sq.trueTag=D5});var w5=A((zW)=>{var tq=$0(),d6=k$(),eq={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:d6.stringifyNumber},$W={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():d6.stringifyNumber($)}},ZW={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let Z=new tq.Scalar(parseFloat($.replace(/_/g,""))),z=$.indexOf(".");if(z!==-1){let X=$.substring(z+1).replace(/_/g,"");if(X[X.length-1]==="0")Z.minFractionDigits=X.length}return Z},stringify:d6.stringifyNumber};zW.float=ZW;zW.floatExp=$W;zW.floatNaN=eq});var R5=A((UW)=>{var F5=k$(),j1=($)=>typeof $==="bigint"||Number.isInteger($);function U2($,Z,z,{intAsBigInt:X}){let J=$[0];if(J==="-"||J==="+")Z+=1;if($=$.substring(Z).replace(/_/g,""),X){switch(z){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let Y=BigInt($);return J==="-"?BigInt(-1)*Y:Y}let Q=parseInt($,z);return J==="-"?-1*Q:Q}function c6($,Z,z){let{value:X}=$;if(j1(X)){let J=X.toString(Z);return X<0?"-"+z+J.substr(1):z+J}return F5.stringifyNumber($)}var YW={identify:j1,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,Z,z)=>U2($,2,2,z),stringify:($)=>c6($,2,"0b")},qW={identify:j1,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,Z,z)=>U2($,1,8,z),stringify:($)=>c6($,8,"0")},WW={identify:j1,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,Z,z)=>U2($,0,10,z),stringify:F5.stringifyNumber},GW={identify:j1,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,Z,z)=>U2($,2,16,z),stringify:($)=>c6($,16,"0x")};UW.int=WW;UW.intBin=YW;UW.intHex=GW;UW.intOct=qW});var p6=A((NW)=>{var H2=m(),V2=r0(),K2=a0();class L$ extends K2.YAMLMap{constructor($){super($);this.tag=L$.tag}add($){let Z;if(H2.isPair($))Z=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)Z=new V2.Pair($.key,null);else Z=new V2.Pair($,null);if(!K2.findPair(this.items,Z.key))this.items.push(Z)}get($,Z){let z=K2.findPair(this.items,$);return!Z&&H2.isPair(z)?H2.isScalar(z.key)?z.key.value:z.key:z}set($,Z){if(typeof Z!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof Z}`);let z=K2.findPair(this.items,$);if(z&&!Z)this.items.splice(this.items.indexOf(z),1);else if(!z&&Z)this.items.push(new V2.Pair($))}toJSON($,Z){return super.toJSON($,Z,Set)}toString($,Z,z){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),Z,z);else throw Error("Set items must all have null values")}static from($,Z,z){let{replacer:X}=z,J=new this($);if(Z&&Symbol.iterator in Object(Z))for(let Q of Z){if(typeof X==="function")Q=X.call(Z,Q,Q);J.items.push(V2.createPair(Q,null,z))}return J}}L$.tag="tag:yaml.org,2002:set";var LW={collection:"map",identify:($)=>$ instanceof Set,nodeClass:L$,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,Z,z)=>L$.from($,Z,z),resolve($,Z){if(H2.isMap($))if($.hasAllNullValues(!0))return Object.assign(new L$,$);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return $}};NW.YAMLSet=L$;NW.set=LW});var i6=A((IW)=>{var OW=k$();function l6($,Z){let z=$[0],X=z==="-"||z==="+"?$.substring(1):$,J=(Y)=>Z?BigInt(Y):Number(Y),Q=X.replace(/_/g,"").split(":").reduce((Y,q)=>Y*J(60)+J(q),J(0));return z==="-"?J(-1)*Q:Q}function P5($){let{value:Z}=$,z=(Y)=>Y;if(typeof Z==="bigint")z=(Y)=>BigInt(Y);else if(isNaN(Z)||!isFinite(Z))return OW.stringifyNumber($);let X="";if(Z<0)X="-",Z*=z(-1);let J=z(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 X+Q.map((Y)=>String(Y).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var DW={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:z})=>l6($,z),stringify:P5},AW={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:($)=>l6($,!1),stringify:P5},_5={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(_5.test);if(!Z)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,z,X,J,Q,Y,q]=Z.map(Number),W=Z[7]?Number((Z[7]+"00").substr(1,3)):0,G=Date.UTC(z,X-1,J,Q||0,Y||0,q||0,W),U=Z[8];if(U&&U!=="Z"){let V=l6(U,!1);if(Math.abs(V)<30)V*=60;G-=60000*V}return new Date(G)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};IW.floatTime=AW;IW.intTime=DW;IW.timestamp=_5});var C5=A((fW)=>{var PW=x$(),_W=Q2(),EW=y$(),CW=_1(),jW=h6(),E5=I5(),n6=w5(),B2=R5(),SW=o4(),bW=m6(),xW=G2(),yW=p6(),r6=i6(),kW=[PW.map,EW.seq,CW.string,_W.nullTag,E5.trueTag,E5.falseTag,B2.intBin,B2.intOct,B2.int,B2.intHex,n6.floatNaN,n6.floatExp,n6.float,jW.binary,SW.merge,bW.omap,xW.pairs,yW.set,r6.intTime,r6.floatTime,r6.timestamp];fW.schema=kW});var v5=A((lW)=>{var x5=x$(),hW=Q2(),y5=y$(),vW=_1(),uW=j6(),s6=b6(),a6=y6(),mW=V5(),dW=H5(),k5=h6(),S1=o4(),f5=m6(),g5=G2(),j5=C5(),h5=p6(),L2=i6(),S5=new Map([["core",mW.schema],["failsafe",[x5.map,y5.seq,vW.string]],["json",dW.schema],["yaml11",j5.schema],["yaml-1.1",j5.schema]]),b5={binary:k5.binary,bool:uW.boolTag,float:s6.float,floatExp:s6.floatExp,floatNaN:s6.floatNaN,floatTime:L2.floatTime,int:a6.int,intHex:a6.intHex,intOct:a6.intOct,intTime:L2.intTime,map:x5.map,merge:S1.merge,null:hW.nullTag,omap:f5.omap,pairs:g5.pairs,seq:y5.seq,set:h5.set,timestamp:L2.timestamp},cW={"tag:yaml.org,2002:binary":k5.binary,"tag:yaml.org,2002:merge":S1.merge,"tag:yaml.org,2002:omap":f5.omap,"tag:yaml.org,2002:pairs":g5.pairs,"tag:yaml.org,2002:set":h5.set,"tag:yaml.org,2002:timestamp":L2.timestamp};function pW($,Z,z){let X=S5.get(Z);if(X&&!$)return z&&!X.includes(S1.merge)?X.concat(S1.merge):X.slice();let J=X;if(!J)if(Array.isArray($))J=[];else{let Q=Array.from(S5.keys()).filter((Y)=>Y!=="yaml11").map((Y)=>JSON.stringify(Y)).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(z)J=J.concat(S1.merge);return J.reduce((Q,Y)=>{let q=typeof Y==="string"?b5[Y]:Y;if(!q){let W=JSON.stringify(Y),G=Object.keys(b5).map((U)=>JSON.stringify(U)).join(", ");throw Error(`Unknown custom tag ${W}; use one of ${G}`)}if(!Q.includes(q))Q.push(q);return Q},[])}lW.coreKnownTags=cW;lW.getTags=pW});var e6=A((tW)=>{var o6=m(),rW=x$(),sW=y$(),aW=_1(),N2=v5(),oW=($,Z)=>$.key<Z.key?-1:$.key>Z.key?1:0;class t6{constructor({compat:$,customTags:Z,merge:z,resolveKnownTags:X,schema:J,sortMapEntries:Q,toStringDefaults:Y}){this.compat=Array.isArray($)?N2.getTags($,"compat"):$?N2.getTags(null,$):null,this.name=typeof J==="string"&&J||"core",this.knownTags=X?N2.coreKnownTags:{},this.tags=N2.getTags(Z,this.name,z),this.toStringOptions=Y??null,Object.defineProperty(this,o6.MAP,{value:rW.map}),Object.defineProperty(this,o6.SCALAR,{value:aW.string}),Object.defineProperty(this,o6.SEQ,{value:sW.seq}),this.sortMapEntries=typeof Q==="function"?Q:Q===!0?oW:null}clone(){let $=Object.create(t6.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}tW.Schema=t6});var u5=A((zG)=>{var $G=m(),$8=w1(),b1=D1();function ZG($,Z){let z=[],X=Z.directives===!0;if(Z.directives!==!1&&$.directives){let W=$.directives.toString($);if(W)z.push(W),X=!0;else if($.directives.docStart)X=!0}if(X)z.push("---");let J=$8.createStringifyContext($,Z),{commentString:Q}=J.options;if($.commentBefore){if(z.length!==1)z.unshift("");let W=Q($.commentBefore);z.unshift(b1.indentComment(W,""))}let Y=!1,q=null;if($.contents){if($G.isNode($.contents)){if($.contents.spaceBefore&&X)z.push("");if($.contents.commentBefore){let U=Q($.contents.commentBefore);z.push(b1.indentComment(U,""))}J.forceBlockIndent=!!$.comment,q=$.contents.comment}let W=q?void 0:()=>Y=!0,G=$8.stringify($.contents,J,()=>q=null,W);if(q)G+=b1.lineComment(G,"",Q(q));if((G[0]==="|"||G[0]===">")&&z[z.length-1]==="---")z[z.length-1]=`--- ${G}`;else z.push(G)}else z.push($8.stringify($.contents,J));if($.directives?.docEnd)if($.comment){let W=Q($.comment);if(W.includes(`
81
+ `))z.push("..."),z.push(b1.indentComment(W,""));else z.push(`... ${W}`)}else z.push("...");else{let W=$.comment;if(W&&Y)W=W.replace(/^\n+/,"");if(W){if((!Y||q)&&z[z.length-1]!=="")z.push("");z.push(b1.indentComment(Q(W),""))}}return z.join(`
82
82
  `)+`
83
- `}nG.stringifyDocument=iG});var b1=A((XW)=>{var sG=T1(),f$=c2(),w0=v(),aG=n0(),oG=p0(),tG=r6(),eG=k5(),a6=u2(),$W=N6(),ZW=M1(),o6=B6();class t6{constructor($,Z,X){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,w0.NODE_TYPE,{value:w0.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 o6.Directives({version:Q});this.setSchema(Q,X),this.contents=$===void 0?null:this.createNode($,z,X)}clone(){let $=Object.create(t6.prototype,{[w0.NODE_TYPE]:{value:w0.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=w0.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(g$(this.contents))this.contents.add($)}addIn($,Z){if(g$(this.contents))this.contents.addIn($,Z)}createAlias($,Z){if(!$.anchor){let X=a6.anchorNames(this);$.anchor=!Z||X.has(Z)?a6.findNewAnchor(Z||"a",X):Z}return new sG.Alias($.anchor)}createNode($,Z,X){let z=void 0;if(typeof Z==="function")$=Z.call({"":$},"",$),z=Z;else if(Array.isArray(Z)){let B=(F)=>typeof F==="number"||F instanceof String||F instanceof Number,M=Z.filter(B).map(String);if(M.length>0)Z=Z.concat(M);z=Z}else if(X===void 0&&Z)X=Z,Z=void 0;let{aliasDuplicateObjects:J,anchorPrefix:Q,flow:Y,keepUndefined:q,onTagObj:G,tag:W}=X??{},{onAnchor:U,setAnchors:V,sourceObjects:K}=a6.createNodeAnchors(this,Q||"a"),N={aliasDuplicateObjects:J??!0,keepUndefined:q??!1,onAnchor:U,onTagObj:G,replacer:z,schema:this.schema,sourceObjects:K},O=ZW.createNode($,W,N);if(Y&&w0.isCollection(O))O.flow=!0;return V(),O}createPair($,Z,X={}){let z=this.createNode($,null,X),J=this.createNode(Z,null,X);return new aG.Pair(z,J)}delete($){return g$(this.contents)?this.contents.delete($):!1}deleteIn($){if(f$.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return g$(this.contents)?this.contents.deleteIn($):!1}get($,Z){return w0.isCollection(this.contents)?this.contents.get($,Z):void 0}getIn($,Z){if(f$.isEmptyPath($))return!Z&&w0.isScalar(this.contents)?this.contents.value:this.contents;return w0.isCollection(this.contents)?this.contents.getIn($,Z):void 0}has($){return w0.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(f$.isEmptyPath($))return this.contents!==void 0;return w0.isCollection(this.contents)?this.contents.hasIn($):!1}set($,Z){if(this.contents==null)this.contents=f$.collectionFromPath(this.schema,[$],Z);else if(g$(this.contents))this.contents.set($,Z)}setIn($,Z){if(f$.isEmptyPath($))this.contents=Z;else if(this.contents==null)this.contents=f$.collectionFromPath(this.schema,Array.from($),Z);else if(g$(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 o6.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 o6.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 tG.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 Y={anchors:new Map,doc:this,keep:!$,mapAsMap:X===!0,mapKeyWarned:!1,maxAliasCount:typeof z==="number"?z:100},q=oG.toJS(this.contents,Z??"",Y);if(typeof J==="function")for(let{count:G,res:W}of Y.anchors.values())J(W,G);return typeof Q==="function"?$W.applyReviver(Q,{"":q},"",q):q}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 eG.stringifyDocument(this,$)}}function g$($){if(w0.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}XW.Document=t6});var x1=A((QW)=>{class N4 extends Error{constructor($,Z,X,z){super();this.name=$,this.code=X,this.message=z,this.pos=Z}}class f5 extends N4{constructor($,Z,X){super("YAMLParseError",$,Z,X)}}class g5 extends N4{constructor($,Z,X){super("YAMLWarning",$,Z,X)}}var JW=($,Z)=>(X)=>{if(X.pos[0]===-1)return;X.linePos=X.pos.map((q)=>Z.linePos(q));let{line:z,col:J}=X.linePos[0];X.message+=` at line ${z}, column ${J}`;let Q=J-1,Y=$.substring(Z.lineStarts[z-1],Z.lineStarts[z]).replace(/[\n\r]+$/,"");if(Q>=60&&Y.length>80){let q=Math.min(Q-39,Y.length-79);Y="…"+Y.substring(q),Q-=q-1}if(Y.length>80)Y=Y.substring(0,79)+"…";if(z>1&&/^ *$/.test(Y.substring(0,Q))){let q=$.substring(Z.lineStarts[z-2],Z.lineStarts[z-1]);if(q.length>80)q=q.substring(0,79)+`…
84
- `;Y=q+Y}if(/[^ ]/.test(Y)){let q=1,G=X.linePos[1];if(G?.line===z&&G.col>J)q=Math.max(1,Math.min(G.col-J,80-Q));let W=" ".repeat(Q)+"^".repeat(q);X.message+=`:
83
+ `}zG.stringifyDocument=ZG});var x1=A((VG)=>{var JG=M1(),f$=l4(),I0=m(),QG=r0(),YG=l0(),qG=e6(),WG=u5(),Z8=d4(),GG=D6(),UG=O1(),z8=O6();class X8{constructor($,Z,z){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,I0.NODE_TYPE,{value:I0.DOC});let X=null;if(typeof Z==="function"||Array.isArray(Z))X=Z;else if(z===void 0&&Z)z=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"},z);this.options=J;let{version:Q}=J;if(z?._directives){if(this.directives=z._directives.atDocument(),this.directives.yaml.explicit)Q=this.directives.yaml.version}else this.directives=new z8.Directives({version:Q});this.setSchema(Q,z),this.contents=$===void 0?null:this.createNode($,X,z)}clone(){let $=Object.create(X8.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(g$(this.contents))this.contents.add($)}addIn($,Z){if(g$(this.contents))this.contents.addIn($,Z)}createAlias($,Z){if(!$.anchor){let z=Z8.anchorNames(this);$.anchor=!Z||z.has(Z)?Z8.findNewAnchor(Z||"a",z):Z}return new JG.Alias($.anchor)}createNode($,Z,z){let X=void 0;if(typeof Z==="function")$=Z.call({"":$},"",$),X=Z;else if(Array.isArray(Z)){let B=(F)=>typeof F==="number"||F instanceof String||F instanceof Number,M=Z.filter(B).map(String);if(M.length>0)Z=Z.concat(M);X=Z}else if(z===void 0&&Z)z=Z,Z=void 0;let{aliasDuplicateObjects:J,anchorPrefix:Q,flow:Y,keepUndefined:q,onTagObj:W,tag:G}=z??{},{onAnchor:U,setAnchors:V,sourceObjects:K}=Z8.createNodeAnchors(this,Q||"a"),L={aliasDuplicateObjects:J??!0,keepUndefined:q??!1,onAnchor:U,onTagObj:W,replacer:X,schema:this.schema,sourceObjects:K},O=UG.createNode($,G,L);if(Y&&I0.isCollection(O))O.flow=!0;return V(),O}createPair($,Z,z={}){let X=this.createNode($,null,z),J=this.createNode(Z,null,z);return new QG.Pair(X,J)}delete($){return g$(this.contents)?this.contents.delete($):!1}deleteIn($){if(f$.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return g$(this.contents)?this.contents.deleteIn($):!1}get($,Z){return I0.isCollection(this.contents)?this.contents.get($,Z):void 0}getIn($,Z){if(f$.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(f$.isEmptyPath($))return this.contents!==void 0;return I0.isCollection(this.contents)?this.contents.hasIn($):!1}set($,Z){if(this.contents==null)this.contents=f$.collectionFromPath(this.schema,[$],Z);else if(g$(this.contents))this.contents.set($,Z)}setIn($,Z){if(f$.isEmptyPath($))this.contents=Z;else if(this.contents==null)this.contents=f$.collectionFromPath(this.schema,Array.from($),Z);else if(g$(this.contents))this.contents.setIn($,Z)}setSchema($,Z={}){if(typeof $==="number")$=String($);let z;switch($){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new z8.Directives({version:"1.1"});z={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=$;else this.directives=new z8.Directives({version:$});z={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;z=null;break;default:{let X=JSON.stringify($);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${X}`)}}if(Z.schema instanceof Object)this.schema=Z.schema;else if(z)this.schema=new qG.Schema(Object.assign(z,Z));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:$,jsonArg:Z,mapAsMap:z,maxAliasCount:X,onAnchor:J,reviver:Q}={}){let Y={anchors:new Map,doc:this,keep:!$,mapAsMap:z===!0,mapKeyWarned:!1,maxAliasCount:typeof X==="number"?X:100},q=YG.toJS(this.contents,Z??"",Y);if(typeof J==="function")for(let{count:W,res:G}of Y.anchors.values())J(G,W);return typeof Q==="function"?GG.applyReviver(Q,{"":q},"",q):q}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 WG.stringifyDocument(this,$)}}function g$($){if(I0.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}VG.Document=X8});var y1=A((BG)=>{class T2 extends Error{constructor($,Z,z,X){super();this.name=$,this.code=z,this.message=X,this.pos=Z}}class m5 extends T2{constructor($,Z,z){super("YAMLParseError",$,Z,z)}}class d5 extends T2{constructor($,Z,z){super("YAMLWarning",$,Z,z)}}var HG=($,Z)=>(z)=>{if(z.pos[0]===-1)return;z.linePos=z.pos.map((q)=>Z.linePos(q));let{line:X,col:J}=z.linePos[0];z.message+=` at line ${X}, column ${J}`;let Q=J-1,Y=$.substring(Z.lineStarts[X-1],Z.lineStarts[X]).replace(/[\n\r]+$/,"");if(Q>=60&&Y.length>80){let q=Math.min(Q-39,Y.length-79);Y="…"+Y.substring(q),Q-=q-1}if(Y.length>80)Y=Y.substring(0,79)+"…";if(X>1&&/^ *$/.test(Y.substring(0,Q))){let q=$.substring(Z.lineStarts[X-2],Z.lineStarts[X-1]);if(q.length>80)q=q.substring(0,79)+`…
84
+ `;Y=q+Y}if(/[^ ]/.test(Y)){let q=1,W=z.linePos[1];if(W?.line===X&&W.col>J)q=Math.max(1,Math.min(W.col-J,80-Q));let G=" ".repeat(Q)+"^".repeat(q);z.message+=`:
85
85
 
86
86
  ${Y}
87
- ${W}
88
- `}};QW.YAMLError=N4;QW.YAMLParseError=f5;QW.YAMLWarning=g5;QW.prettifyError=JW});var y1=A((VW)=>{function UW($,{flow:Z,indicator:X,next:z,offset:J,onError:Q,parentIndent:Y,startOnNewline:q}){let G=!1,W=q,U=q,V="",K="",N=!1,O=!1,B=null,M=null,F=null,_=null,b=null,x=null,y=null;for(let C of $){if(O){if(C.type!=="space"&&C.type!=="newline"&&C.type!=="comma")Q(C.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");O=!1}if(B){if(W&&C.type!=="comment"&&C.type!=="newline")Q(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");B=null}switch(C.type){case"space":if(!Z&&(X!=="doc-start"||z?.type!=="flow-collection")&&C.source.includes("\t"))B=C;U=!0;break;case"comment":{if(!U)Q(C,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let g=C.source.substring(1)||" ";if(!V)V=g;else V+=K+g;K="",W=!1;break}case"newline":if(W){if(V)V+=C.source;else if(!x||X!=="seq-item-ind")G=!0}else K+=C.source;if(W=!0,N=!0,M||F)_=C;U=!0;break;case"anchor":if(M)Q(C,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(C.source.endsWith(":"))Q(C.offset+C.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);M=C,y??(y=C.offset),W=!1,U=!1,O=!0;break;case"tag":{if(F)Q(C,"MULTIPLE_TAGS","A node can have at most one tag");F=C,y??(y=C.offset),W=!1,U=!1,O=!0;break}case X:if(M||F)Q(C,"BAD_PROP_ORDER",`Anchors and tags must be after the ${C.source} indicator`);if(x)Q(C,"UNEXPECTED_TOKEN",`Unexpected ${C.source} in ${Z??"collection"}`);x=C,W=X==="seq-item-ind"||X==="explicit-key-ind",U=!1;break;case"comma":if(Z){if(b)Q(C,"UNEXPECTED_TOKEN",`Unexpected , in ${Z}`);b=C,W=!1,U=!1;break}default:Q(C,"UNEXPECTED_TOKEN",`Unexpected ${C.type} token`),W=!1,U=!1}}let R=$[$.length-1],i=R?R.offset+R.source.length:J;if(O&&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&&(W&&B.indent<=Y||z?.type==="block-map"||z?.type==="block-seq"))Q(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:b,found:x,spaceBefore:G,comment:V,hasNewline:N,anchor:M,tag:F,newlineAfterProp:_,end:i,start:y??i}}VW.resolveProps=UW});var L4=A((HW)=>{function e6($){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(e6(Z.key)||e6(Z.value))return!0}return!1;default:return!0}}HW.containsNewline=e6});var $8=A((TW)=>{var NW=L4();function LW($,Z,X){if(Z?.type==="flow-collection"){let z=Z.end[0];if(z.indent===$&&(z.source==="]"||z.source==="}")&&NW.containsNewline(Z))X(z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}TW.flowIndentCheck=LW});var Z8=A((DW)=>{var h5=v();function OW($,Z,X){let{uniqueKeys:z}=$.options;if(z===!1)return!1;let J=typeof z==="function"?z:(Q,Y)=>Q===Y||h5.isScalar(Q)&&h5.isScalar(Y)&&Q.value===Y.value;return Z.some((Q)=>J(Q.key,X))}DW.mapIncludes=OW});var c5=A((PW)=>{var v5=n0(),wW=s0(),u5=y1(),IW=L4(),m5=$8(),FW=Z8(),d5="All mapping items must start at the same column";function RW({composeNode:$,composeEmptyNode:Z},X,z,J,Q){let q=new(Q?.nodeClass??wW.YAMLMap)(X.schema);if(X.atRoot)X.atRoot=!1;let G=z.offset,W=null;for(let U of z.items){let{start:V,key:K,sep:N,value:O}=U,B=u5.resolveProps(V,{indicator:"explicit-key-ind",next:K??N?.[0],offset:G,onError:J,parentIndent:z.indent,startOnNewline:!0}),M=!B.found;if(M){if(K){if(K.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 K&&K.indent!==z.indent)J(G,"BAD_INDENT",d5)}if(!B.anchor&&!B.tag&&!N){if(W=B.end,B.comment)if(q.comment)q.comment+=`
90
- `+B.comment;else q.comment=B.comment;continue}if(B.newlineAfterProp||IW.containsNewline(K))J(K??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",d5);X.atKey=!0;let F=B.end,_=K?$(X,K,B,J):Z(X,F,V,null,B,J);if(X.schema.compat)m5.flowIndentCheck(z.indent,K,J);if(X.atKey=!1,FW.mapIncludes(X,q.items,_))J(F,"DUPLICATE_KEY","Map keys must be unique");let b=u5.resolveProps(N??[],{indicator:"map-value-ind",next:O,offset:_.range[2],onError:J,parentIndent:z.indent,startOnNewline:!K||K.type==="block-scalar"});if(G=b.end,b.found){if(M){if(O?.type==="block-map"&&!b.hasNewline)J(G,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(X.options.strict&&B.start<b.found.offset-1024)J(_.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let x=O?$(X,O,b,J):Z(X,G,N,null,b,J);if(X.schema.compat)m5.flowIndentCheck(z.indent,O,J);G=x.range[2];let y=new v5.Pair(_,x);if(X.options.keepSourceTokens)y.srcToken=U;q.items.push(y)}else{if(M)J(_.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(b.comment)if(_.comment)_.comment+=`
91
- `+b.comment;else _.comment=b.comment;let x=new v5.Pair(_);if(X.options.keepSourceTokens)x.srcToken=U;q.items.push(x)}}if(W&&W<G)J(W,"IMPOSSIBLE","Map comment with trailing content");return q.range=[z.offset,G,W??G],q}PW.resolveBlockMap=RW});var p5=A((bW)=>{var _W=a0(),CW=y1(),jW=$8();function SW({composeNode:$,composeEmptyNode:Z},X,z,J,Q){let q=new(Q?.nodeClass??_W.YAMLSeq)(X.schema);if(X.atRoot)X.atRoot=!1;if(X.atKey)X.atKey=!1;let G=z.offset,W=null;for(let{start:U,value:V}of z.items){let K=CW.resolveProps(U,{indicator:"seq-item-ind",next:V,offset:G,onError:J,parentIndent:z.indent,startOnNewline:!0});if(!K.found)if(K.anchor||K.tag||V)if(V?.type==="block-seq")J(K.end,"BAD_INDENT","All sequence items must start at the same column");else J(G,"MISSING_CHAR","Sequence item without - indicator");else{if(W=K.end,K.comment)q.comment=K.comment;continue}let N=V?$(X,V,K,J):Z(X,K.end,U,null,K,J);if(X.schema.compat)jW.flowIndentCheck(z.indent,V,J);G=N.range[2],q.items.push(N)}return q.range=[z.offset,G,W??G],q}bW.resolveBlockSeq=SW});var h$=A((kW)=>{function yW($,Z,X,z){let J="";if($){let Q=!1,Y="";for(let q of $){let{source:G,type:W}=q;switch(W){case"space":Q=!0;break;case"comment":{if(X&&!Q)z(q,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let U=G.substring(1)||" ";if(!J)J=U;else J+=Y+U;Y="";break}case"newline":if(J)Y+=G;Q=!0;break;default:z(q,"UNEXPECTED_TOKEN",`Unexpected ${W} at node end`)}Z+=G.length}}return{comment:J,offset:Z}}kW.resolveEnd=yW});var n5=A((pW)=>{var gW=v(),hW=n0(),l5=s0(),vW=a0(),uW=h$(),i5=y1(),mW=L4(),dW=Z8(),X8="Block collections are not allowed within flow collections",z8=($)=>$&&($.type==="block-map"||$.type==="block-seq");function cW({composeNode:$,composeEmptyNode:Z},X,z,J,Q){let Y=z.start.source==="{",q=Y?"flow map":"flow sequence",W=new(Q?.nodeClass??(Y?l5.YAMLMap:vW.YAMLSeq))(X.schema);W.flow=!0;let U=X.atRoot;if(U)X.atRoot=!1;if(X.atKey)X.atKey=!1;let V=z.offset+z.start.source.length;for(let M=0;M<z.items.length;++M){let F=z.items[M],{start:_,key:b,sep:x,value:y}=F,R=i5.resolveProps(_,{flow:q,indicator:"explicit-key-ind",next:b??x?.[0],offset:V,onError:J,parentIndent:z.indent,startOnNewline:!1});if(!R.found){if(!R.anchor&&!R.tag&&!x&&!y){if(M===0&&R.comma)J(R.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${q}`);else if(M<z.items.length-1)J(R.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${q}`);if(R.comment)if(W.comment)W.comment+=`
92
- `+R.comment;else W.comment=R.comment;V=R.end;continue}if(!Y&&X.options.strict&&mW.containsNewline(b))J(b,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(M===0){if(R.comma)J(R.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${q}`)}else{if(!R.comma)J(R.start,"MISSING_CHAR",`Missing , between ${q} items`);if(R.comment){let i="";$:for(let C of _)switch(C.type){case"comma":case"space":break;case"comment":i=C.source.substring(1);break $;default:break $}if(i){let C=W.items[W.items.length-1];if(gW.isPair(C))C=C.value??C.key;if(C.comment)C.comment+=`
93
- `+i;else C.comment=i;R.comment=R.comment.substring(i.length+1)}}}if(!Y&&!x&&!R.found){let i=y?$(X,y,R,J):Z(X,R.end,x,null,R,J);if(W.items.push(i),V=i.range[2],z8(y))J(i.range,"BLOCK_IN_FLOW",X8)}else{X.atKey=!0;let i=R.end,C=b?$(X,b,R,J):Z(X,i,_,null,R,J);if(z8(b))J(C.range,"BLOCK_IN_FLOW",X8);X.atKey=!1;let g=i5.resolveProps(x??[],{flow:q,indicator:"map-value-ind",next:y,offset:C.range[2],onError:J,parentIndent:z.indent,startOnNewline:!1});if(g.found){if(!Y&&!R.found&&X.options.strict){if(x)for(let e of x){if(e===g.found)break;if(e.type==="newline"){J(e,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(R.start<g.found.offset-1024)J(g.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(y)if("source"in y&&y.source?.[0]===":")J(y,"MISSING_CHAR",`Missing space after : in ${q}`);else J(g.start,"MISSING_CHAR",`Missing , or : between ${q} items`);let S0=y?$(X,y,g,J):g.found?Z(X,g.end,x,null,g,J):null;if(S0){if(z8(y))J(S0.range,"BLOCK_IN_FLOW",X8)}else if(g.comment)if(C.comment)C.comment+=`
94
- `+g.comment;else C.comment=g.comment;let b0=new hW.Pair(C,S0);if(X.options.keepSourceTokens)b0.srcToken=F;if(Y){let e=W;if(dW.mapIncludes(X,e.items,C))J(i,"DUPLICATE_KEY","Map keys must be unique");e.items.push(b0)}else{let e=new l5.YAMLMap(X.schema);e.flow=!0,e.items.push(b0);let H1=(S0??C).range;e.range=[C.range[0],H1[1],H1[2]],W.items.push(e)}V=S0?S0.range[2]:g.end}}let K=Y?"}":"]",[N,...O]=z.end,B=V;if(N?.source===K)B=N.offset+N.source.length;else{let M=q[0].toUpperCase()+q.substring(1),F=U?`${M} must end with a ${K}`:`${M} in block collection must be sufficiently indented and end with a ${K}`;if(J(V,U?"MISSING_CHAR":"BAD_INDENT",F),N&&N.source.length!==1)O.unshift(N)}if(O.length>0){let M=uW.resolveEnd(O,B,X.options.strict,J);if(M.comment)if(W.comment)W.comment+=`
95
- `+M.comment;else W.comment=M.comment;W.range=[z.offset,B,M.offset]}else W.range=[z.offset,B,B];return W}pW.resolveFlowCollection=cW});var r5=A(($U)=>{var iW=v(),nW=$0(),rW=s0(),sW=a0(),aW=c5(),oW=p5(),tW=n5();function J8($,Z,X,z,J,Q){let Y=X.type==="block-map"?aW.resolveBlockMap($,Z,X,z,Q):X.type==="block-seq"?oW.resolveBlockSeq($,Z,X,z,Q):tW.resolveFlowCollection($,Z,X,z,Q),q=Y.constructor;if(J==="!"||J===q.tagName)return Y.tag=q.tagName,Y;if(J)Y.tag=J;return Y}function eW($,Z,X,z,J){let Q=z.tag,Y=!Q?null:Z.directives.tagName(Q.source,(K)=>J(Q,"TAG_RESOLVE_FAILED",K));if(X.type==="block-seq"){let{anchor:K,newlineAfterProp:N}=z,O=K&&Q?K.offset>Q.offset?K:Q:K??Q;if(O&&(!N||N.offset<O.offset))J(O,"MISSING_CHAR","Missing newline after block sequence props")}let q=X.type==="block-map"?"map":X.type==="block-seq"?"seq":X.start.source==="{"?"map":"seq";if(!Q||!Y||Y==="!"||Y===rW.YAMLMap.tagName&&q==="map"||Y===sW.YAMLSeq.tagName&&q==="seq")return J8($,Z,X,J,Y);let G=Z.schema.tags.find((K)=>K.tag===Y&&K.collection===q);if(!G){let K=Z.schema.knownTags[Y];if(K?.collection===q)Z.schema.tags.push(Object.assign({},K,{default:!1})),G=K;else{if(K)J(Q,"BAD_COLLECTION_TYPE",`${K.tag} used for ${q} collection, but expects ${K.collection??"scalar"}`,!0);else J(Q,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Y}`,!0);return J8($,Z,X,J,Y)}}let W=J8($,Z,X,J,Y,G),U=G.resolve?.(W,(K)=>J(Q,"TAG_RESOLVE_FAILED",K),Z.options)??W,V=iW.isNode(U)?U:new nW.Scalar(U);if(V.range=W.range,V.tag=Y,G?.format)V.format=G.format;return V}$U.composeCollection=eW});var Y8=A((QU)=>{var Q8=$0();function XU($,Z,X){let z=Z.offset,J=zU(Z,$.options.strict,X);if(!J)return{value:"",type:null,comment:"",range:[z,z,z]};let Q=J.mode===">"?Q8.Scalar.BLOCK_FOLDED:Q8.Scalar.BLOCK_LITERAL,Y=Z.source?JU(Z.source):[],q=Y.length;for(let B=Y.length-1;B>=0;--B){let M=Y[B][1];if(M===""||M==="\r")q=B;else break}if(q===0){let B=J.chomp==="+"&&Y.length>0?`
96
- `.repeat(Math.max(1,Y.length-1)):"",M=z+J.length;if(Z.source)M+=Z.source.length;return{value:B,type:Q,comment:J.comment,range:[z,M,M]}}let G=Z.indent+J.indent,W=Z.offset+J.length,U=0;for(let B=0;B<q;++B){let[M,F]=Y[B];if(F===""||F==="\r"){if(J.indent===0&&M.length>G)G=M.length}else{if(M.length<G)X(W+M.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(J.indent===0)G=M.length;if(U=B,G===0&&!$.atRoot)X(W,"BAD_INDENT","Block scalar values in collections must be indented");break}W+=M.length+F.length+1}for(let B=Y.length-1;B>=q;--B)if(Y[B][0].length>G)q=B+1;let V="",K="",N=!1;for(let B=0;B<U;++B)V+=Y[B][0].slice(G)+`
97
- `;for(let B=U;B<q;++B){let[M,F]=Y[B];W+=M.length+F.length+1;let _=F[F.length-1]==="\r";if(_)F=F.slice(0,-1);if(F&&M.length<G){let x=`Block scalar lines must not be less indented than their ${J.indent?"explicit indentation indicator":"first line"}`;X(W-F.length-(_?2:1),"BAD_INDENT",x),M=""}if(Q===Q8.Scalar.BLOCK_LITERAL)V+=K+M.slice(G)+F,K=`
98
- `;else if(M.length>G||F[0]==="\t"){if(K===" ")K=`
99
- `;else if(!N&&K===`
87
+ ${G}
88
+ `}};BG.YAMLError=T2;BG.YAMLParseError=m5;BG.YAMLWarning=d5;BG.prettifyError=HG});var k1=A((DG)=>{function OG($,{flow:Z,indicator:z,next:X,offset:J,onError:Q,parentIndent:Y,startOnNewline:q}){let W=!1,G=q,U=q,V="",K="",L=!1,O=!1,B=null,M=null,F=null,E=null,b=null,x=null,y=null;for(let C of $){if(O){if(C.type!=="space"&&C.type!=="newline"&&C.type!=="comma")Q(C.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");O=!1}if(B){if(G&&C.type!=="comment"&&C.type!=="newline")Q(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");B=null}switch(C.type){case"space":if(!Z&&(z!=="doc-start"||X?.type!=="flow-collection")&&C.source.includes("\t"))B=C;U=!0;break;case"comment":{if(!U)Q(C,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let g=C.source.substring(1)||" ";if(!V)V=g;else V+=K+g;K="",G=!1;break}case"newline":if(G){if(V)V+=C.source;else if(!x||z!=="seq-item-ind")W=!0}else K+=C.source;if(G=!0,L=!0,M||F)E=C;U=!0;break;case"anchor":if(M)Q(C,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(C.source.endsWith(":"))Q(C.offset+C.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);M=C,y??(y=C.offset),G=!1,U=!1,O=!0;break;case"tag":{if(F)Q(C,"MULTIPLE_TAGS","A node can have at most one tag");F=C,y??(y=C.offset),G=!1,U=!1,O=!0;break}case z:if(M||F)Q(C,"BAD_PROP_ORDER",`Anchors and tags must be after the ${C.source} indicator`);if(x)Q(C,"UNEXPECTED_TOKEN",`Unexpected ${C.source} in ${Z??"collection"}`);x=C,G=z==="seq-item-ind"||z==="explicit-key-ind",U=!1;break;case"comma":if(Z){if(b)Q(C,"UNEXPECTED_TOKEN",`Unexpected , in ${Z}`);b=C,G=!1,U=!1;break}default:Q(C,"UNEXPECTED_TOKEN",`Unexpected ${C.type} token`),G=!1,U=!1}}let R=$[$.length-1],i=R?R.offset+R.source.length:J;if(O&&X&&X.type!=="space"&&X.type!=="newline"&&X.type!=="comma"&&(X.type!=="scalar"||X.source!==""))Q(X.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(B&&(G&&B.indent<=Y||X?.type==="block-map"||X?.type==="block-seq"))Q(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:b,found:x,spaceBefore:W,comment:V,hasNewline:L,anchor:M,tag:F,newlineAfterProp:E,end:i,start:y??i}}DG.resolveProps=OG});var M2=A((IG)=>{function J8($){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 z of Z.start)if(z.type==="newline")return!0;if(Z.sep){for(let z of Z.sep)if(z.type==="newline")return!0}if(J8(Z.key)||J8(Z.value))return!0}return!1;default:return!0}}IG.containsNewline=J8});var Q8=A((PG)=>{var FG=M2();function RG($,Z,z){if(Z?.type==="flow-collection"){let X=Z.end[0];if(X.indent===$&&(X.source==="]"||X.source==="}")&&FG.containsNewline(Z))z(X,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}PG.flowIndentCheck=RG});var Y8=A((CG)=>{var c5=m();function EG($,Z,z){let{uniqueKeys:X}=$.options;if(X===!1)return!1;let J=typeof X==="function"?X:(Q,Y)=>Q===Y||c5.isScalar(Q)&&c5.isScalar(Y)&&Q.value===Y.value;return Z.some((Q)=>J(Q.key,z))}CG.mapIncludes=EG});var r5=A((kG)=>{var p5=r0(),SG=a0(),l5=k1(),bG=M2(),i5=Q8(),xG=Y8(),n5="All mapping items must start at the same column";function yG({composeNode:$,composeEmptyNode:Z},z,X,J,Q){let q=new(Q?.nodeClass??SG.YAMLMap)(z.schema);if(z.atRoot)z.atRoot=!1;let W=X.offset,G=null;for(let U of X.items){let{start:V,key:K,sep:L,value:O}=U,B=l5.resolveProps(V,{indicator:"explicit-key-ind",next:K??L?.[0],offset:W,onError:J,parentIndent:X.indent,startOnNewline:!0}),M=!B.found;if(M){if(K){if(K.type==="block-seq")J(W,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in K&&K.indent!==X.indent)J(W,"BAD_INDENT",n5)}if(!B.anchor&&!B.tag&&!L){if(G=B.end,B.comment)if(q.comment)q.comment+=`
90
+ `+B.comment;else q.comment=B.comment;continue}if(B.newlineAfterProp||bG.containsNewline(K))J(K??V[V.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(B.found?.indent!==X.indent)J(W,"BAD_INDENT",n5);z.atKey=!0;let F=B.end,E=K?$(z,K,B,J):Z(z,F,V,null,B,J);if(z.schema.compat)i5.flowIndentCheck(X.indent,K,J);if(z.atKey=!1,xG.mapIncludes(z,q.items,E))J(F,"DUPLICATE_KEY","Map keys must be unique");let b=l5.resolveProps(L??[],{indicator:"map-value-ind",next:O,offset:E.range[2],onError:J,parentIndent:X.indent,startOnNewline:!K||K.type==="block-scalar"});if(W=b.end,b.found){if(M){if(O?.type==="block-map"&&!b.hasNewline)J(W,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(z.options.strict&&B.start<b.found.offset-1024)J(E.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let x=O?$(z,O,b,J):Z(z,W,L,null,b,J);if(z.schema.compat)i5.flowIndentCheck(X.indent,O,J);W=x.range[2];let y=new p5.Pair(E,x);if(z.options.keepSourceTokens)y.srcToken=U;q.items.push(y)}else{if(M)J(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(b.comment)if(E.comment)E.comment+=`
91
+ `+b.comment;else E.comment=b.comment;let x=new p5.Pair(E);if(z.options.keepSourceTokens)x.srcToken=U;q.items.push(x)}}if(G&&G<W)J(G,"IMPOSSIBLE","Map comment with trailing content");return q.range=[X.offset,W,G??W],q}kG.resolveBlockMap=yG});var s5=A((mG)=>{var gG=o0(),hG=k1(),vG=Q8();function uG({composeNode:$,composeEmptyNode:Z},z,X,J,Q){let q=new(Q?.nodeClass??gG.YAMLSeq)(z.schema);if(z.atRoot)z.atRoot=!1;if(z.atKey)z.atKey=!1;let W=X.offset,G=null;for(let{start:U,value:V}of X.items){let K=hG.resolveProps(U,{indicator:"seq-item-ind",next:V,offset:W,onError:J,parentIndent:X.indent,startOnNewline:!0});if(!K.found)if(K.anchor||K.tag||V)if(V?.type==="block-seq")J(K.end,"BAD_INDENT","All sequence items must start at the same column");else J(W,"MISSING_CHAR","Sequence item without - indicator");else{if(G=K.end,K.comment)q.comment=K.comment;continue}let L=V?$(z,V,K,J):Z(z,K.end,U,null,K,J);if(z.schema.compat)vG.flowIndentCheck(X.indent,V,J);W=L.range[2],q.items.push(L)}return q.range=[X.offset,W,G??W],q}mG.resolveBlockSeq=uG});var h$=A((pG)=>{function cG($,Z,z,X){let J="";if($){let Q=!1,Y="";for(let q of $){let{source:W,type:G}=q;switch(G){case"space":Q=!0;break;case"comment":{if(z&&!Q)X(q,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let U=W.substring(1)||" ";if(!J)J=U;else J+=Y+U;Y="";break}case"newline":if(J)Y+=W;Q=!0;break;default:X(q,"UNEXPECTED_TOKEN",`Unexpected ${G} at node end`)}Z+=W.length}}return{comment:J,offset:Z}}pG.resolveEnd=cG});var t5=A((eG)=>{var iG=m(),nG=r0(),a5=a0(),rG=o0(),sG=h$(),o5=k1(),aG=M2(),oG=Y8(),q8="Block collections are not allowed within flow collections",W8=($)=>$&&($.type==="block-map"||$.type==="block-seq");function tG({composeNode:$,composeEmptyNode:Z},z,X,J,Q){let Y=X.start.source==="{",q=Y?"flow map":"flow sequence",G=new(Q?.nodeClass??(Y?a5.YAMLMap:rG.YAMLSeq))(z.schema);G.flow=!0;let U=z.atRoot;if(U)z.atRoot=!1;if(z.atKey)z.atKey=!1;let V=X.offset+X.start.source.length;for(let M=0;M<X.items.length;++M){let F=X.items[M],{start:E,key:b,sep:x,value:y}=F,R=o5.resolveProps(E,{flow:q,indicator:"explicit-key-ind",next:b??x?.[0],offset:V,onError:J,parentIndent:X.indent,startOnNewline:!1});if(!R.found){if(!R.anchor&&!R.tag&&!x&&!y){if(M===0&&R.comma)J(R.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${q}`);else if(M<X.items.length-1)J(R.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${q}`);if(R.comment)if(G.comment)G.comment+=`
92
+ `+R.comment;else G.comment=R.comment;V=R.end;continue}if(!Y&&z.options.strict&&aG.containsNewline(b))J(b,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(M===0){if(R.comma)J(R.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${q}`)}else{if(!R.comma)J(R.start,"MISSING_CHAR",`Missing , between ${q} items`);if(R.comment){let i="";$:for(let C of E)switch(C.type){case"comma":case"space":break;case"comment":i=C.source.substring(1);break $;default:break $}if(i){let C=G.items[G.items.length-1];if(iG.isPair(C))C=C.value??C.key;if(C.comment)C.comment+=`
93
+ `+i;else C.comment=i;R.comment=R.comment.substring(i.length+1)}}}if(!Y&&!x&&!R.found){let i=y?$(z,y,R,J):Z(z,R.end,x,null,R,J);if(G.items.push(i),V=i.range[2],W8(y))J(i.range,"BLOCK_IN_FLOW",q8)}else{z.atKey=!0;let i=R.end,C=b?$(z,b,R,J):Z(z,i,E,null,R,J);if(W8(b))J(C.range,"BLOCK_IN_FLOW",q8);z.atKey=!1;let g=o5.resolveProps(x??[],{flow:q,indicator:"map-value-ind",next:y,offset:C.range[2],onError:J,parentIndent:X.indent,startOnNewline:!1});if(g.found){if(!Y&&!R.found&&z.options.strict){if(x)for(let e of x){if(e===g.found)break;if(e.type==="newline"){J(e,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(R.start<g.found.offset-1024)J(g.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(y)if("source"in y&&y.source?.[0]===":")J(y,"MISSING_CHAR",`Missing space after : in ${q}`);else J(g.start,"MISSING_CHAR",`Missing , or : between ${q} items`);let b0=y?$(z,y,g,J):g.found?Z(z,g.end,x,null,g,J):null;if(b0){if(W8(y))J(b0.range,"BLOCK_IN_FLOW",q8)}else if(g.comment)if(C.comment)C.comment+=`
94
+ `+g.comment;else C.comment=g.comment;let x0=new nG.Pair(C,b0);if(z.options.keepSourceTokens)x0.srcToken=F;if(Y){let e=G;if(oG.mapIncludes(z,e.items,C))J(i,"DUPLICATE_KEY","Map keys must be unique");e.items.push(x0)}else{let e=new a5.YAMLMap(z.schema);e.flow=!0,e.items.push(x0);let B1=(b0??C).range;e.range=[C.range[0],B1[1],B1[2]],G.items.push(e)}V=b0?b0.range[2]:g.end}}let K=Y?"}":"]",[L,...O]=X.end,B=V;if(L?.source===K)B=L.offset+L.source.length;else{let M=q[0].toUpperCase()+q.substring(1),F=U?`${M} must end with a ${K}`:`${M} in block collection must be sufficiently indented and end with a ${K}`;if(J(V,U?"MISSING_CHAR":"BAD_INDENT",F),L&&L.source.length!==1)O.unshift(L)}if(O.length>0){let M=sG.resolveEnd(O,B,z.options.strict,J);if(M.comment)if(G.comment)G.comment+=`
95
+ `+M.comment;else G.comment=M.comment;G.range=[X.offset,B,M.offset]}else G.range=[X.offset,B,B];return G}eG.resolveFlowCollection=tG});var e5=A((GU)=>{var ZU=m(),zU=$0(),XU=a0(),JU=o0(),QU=r5(),YU=s5(),qU=t5();function G8($,Z,z,X,J,Q){let Y=z.type==="block-map"?QU.resolveBlockMap($,Z,z,X,Q):z.type==="block-seq"?YU.resolveBlockSeq($,Z,z,X,Q):qU.resolveFlowCollection($,Z,z,X,Q),q=Y.constructor;if(J==="!"||J===q.tagName)return Y.tag=q.tagName,Y;if(J)Y.tag=J;return Y}function WU($,Z,z,X,J){let Q=X.tag,Y=!Q?null:Z.directives.tagName(Q.source,(K)=>J(Q,"TAG_RESOLVE_FAILED",K));if(z.type==="block-seq"){let{anchor:K,newlineAfterProp:L}=X,O=K&&Q?K.offset>Q.offset?K:Q:K??Q;if(O&&(!L||L.offset<O.offset))J(O,"MISSING_CHAR","Missing newline after block sequence props")}let q=z.type==="block-map"?"map":z.type==="block-seq"?"seq":z.start.source==="{"?"map":"seq";if(!Q||!Y||Y==="!"||Y===XU.YAMLMap.tagName&&q==="map"||Y===JU.YAMLSeq.tagName&&q==="seq")return G8($,Z,z,J,Y);let W=Z.schema.tags.find((K)=>K.tag===Y&&K.collection===q);if(!W){let K=Z.schema.knownTags[Y];if(K?.collection===q)Z.schema.tags.push(Object.assign({},K,{default:!1})),W=K;else{if(K)J(Q,"BAD_COLLECTION_TYPE",`${K.tag} used for ${q} collection, but expects ${K.collection??"scalar"}`,!0);else J(Q,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Y}`,!0);return G8($,Z,z,J,Y)}}let G=G8($,Z,z,J,Y,W),U=W.resolve?.(G,(K)=>J(Q,"TAG_RESOLVE_FAILED",K),Z.options)??G,V=ZU.isNode(U)?U:new zU.Scalar(U);if(V.range=G.range,V.tag=Y,W?.format)V.format=W.format;return V}GU.composeCollection=WU});var V8=A((BU)=>{var U8=$0();function VU($,Z,z){let X=Z.offset,J=KU(Z,$.options.strict,z);if(!J)return{value:"",type:null,comment:"",range:[X,X,X]};let Q=J.mode===">"?U8.Scalar.BLOCK_FOLDED:U8.Scalar.BLOCK_LITERAL,Y=Z.source?HU(Z.source):[],q=Y.length;for(let B=Y.length-1;B>=0;--B){let M=Y[B][1];if(M===""||M==="\r")q=B;else break}if(q===0){let B=J.chomp==="+"&&Y.length>0?`
96
+ `.repeat(Math.max(1,Y.length-1)):"",M=X+J.length;if(Z.source)M+=Z.source.length;return{value:B,type:Q,comment:J.comment,range:[X,M,M]}}let W=Z.indent+J.indent,G=Z.offset+J.length,U=0;for(let B=0;B<q;++B){let[M,F]=Y[B];if(F===""||F==="\r"){if(J.indent===0&&M.length>W)W=M.length}else{if(M.length<W)z(G+M.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(J.indent===0)W=M.length;if(U=B,W===0&&!$.atRoot)z(G,"BAD_INDENT","Block scalar values in collections must be indented");break}G+=M.length+F.length+1}for(let B=Y.length-1;B>=q;--B)if(Y[B][0].length>W)q=B+1;let V="",K="",L=!1;for(let B=0;B<U;++B)V+=Y[B][0].slice(W)+`
97
+ `;for(let B=U;B<q;++B){let[M,F]=Y[B];G+=M.length+F.length+1;let E=F[F.length-1]==="\r";if(E)F=F.slice(0,-1);if(F&&M.length<W){let x=`Block scalar lines must not be less indented than their ${J.indent?"explicit indentation indicator":"first line"}`;z(G-F.length-(E?2:1),"BAD_INDENT",x),M=""}if(Q===U8.Scalar.BLOCK_LITERAL)V+=K+M.slice(W)+F,K=`
98
+ `;else if(M.length>W||F[0]==="\t"){if(K===" ")K=`
99
+ `;else if(!L&&K===`
100
100
  `)K=`
101
101
 
102
- `;V+=K+M.slice(G)+F,K=`
103
- `,N=!0}else if(F==="")if(K===`
102
+ `;V+=K+M.slice(W)+F,K=`
103
+ `,L=!0}else if(F==="")if(K===`
104
104
  `)V+=`
105
105
  `;else K=`
106
- `;else V+=K+F,K=" ",N=!1}switch(J.chomp){case"-":break;case"+":for(let B=q;B<Y.length;++B)V+=`
107
- `+Y[B][0].slice(G);if(V[V.length-1]!==`
106
+ `;else V+=K+F,K=" ",L=!1}switch(J.chomp){case"-":break;case"+":for(let B=q;B<Y.length;++B)V+=`
107
+ `+Y[B][0].slice(W);if(V[V.length-1]!==`
108
108
  `)V+=`
109
109
  `;break;default:V+=`
110
- `}let O=z+J.length+Z.source.length;return{value:V,type:Q,comment:J.comment,range:[z,O,O]}}function zU({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],Y=0,q="",G=-1;for(let K=1;K<J.length;++K){let N=J[K];if(!q&&(N==="-"||N==="+"))q=N;else{let O=Number(N);if(!Y&&O)Y=O;else if(G===-1)G=$+K}}if(G!==-1)z(G,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${J}`);let W=!1,U="",V=J.length;for(let K=1;K<Z.length;++K){let N=Z[K];switch(N.type){case"space":W=!0;case"newline":V+=N.source.length;break;case"comment":if(X&&!W)z(N,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");V+=N.source.length,U=N.source.substring(1);break;case"error":z(N,"UNEXPECTED_TOKEN",N.message),V+=N.source.length;break;default:{let O=`Unexpected token in block scalar header: ${N.type}`;z(N,"UNEXPECTED_TOKEN",O);let B=N.source;if(B&&typeof B==="string")V+=B.length}}}return{mode:Q,indent:Y,chomp:q,comment:U,length:V}}function JU($){let Z=$.split(/\n( *)/),X=Z[0],z=X.match(/^( *)/),Q=[z?.[1]?[z[1],X.slice(z[1].length)]:["",X]];for(let Y=1;Y<Z.length;Y+=2)Q.push([Z[Y],Z[Y+1]]);return Q}QU.resolveBlockScalar=XU});var G8=A((NU)=>{var q8=$0(),qU=h$();function GU($,Z,X){let{offset:z,type:J,source:Q,end:Y}=$,q,G,W=(K,N,O)=>X(z+K,N,O);switch(J){case"scalar":q=q8.Scalar.PLAIN,G=WU(Q,W);break;case"single-quoted-scalar":q=q8.Scalar.QUOTE_SINGLE,G=UU(Q,W);break;case"double-quoted-scalar":q=q8.Scalar.QUOTE_DOUBLE,G=VU(Q,W);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 U=z+Q.length,V=qU.resolveEnd(Y,U,Z,X);return{value:G,type:q,comment:V.comment,range:[z,U,V.offset]}}function WU($,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 s5($)}function UU($,Z){if($[$.length-1]!=="'"||$.length===1)Z($.length,"MISSING_CHAR","Missing closing 'quote");return s5($.slice(1,-1)).replace(/''/g,"'")}function s5($){let Z,X;try{Z=new RegExp(`(.*?)(?<![ ])[ ]*\r?
111
- `,"sy"),X=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
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=" ",Y=Z.lastIndex;X.lastIndex=Y;while(z=X.exec($)){if(z[1]==="")if(Q===`
110
+ `}let O=X+J.length+Z.source.length;return{value:V,type:Q,comment:J.comment,range:[X,O,O]}}function KU({offset:$,props:Z},z,X){if(Z[0].type!=="block-scalar-header")return X(Z[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:J}=Z[0],Q=J[0],Y=0,q="",W=-1;for(let K=1;K<J.length;++K){let L=J[K];if(!q&&(L==="-"||L==="+"))q=L;else{let O=Number(L);if(!Y&&O)Y=O;else if(W===-1)W=$+K}}if(W!==-1)X(W,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${J}`);let G=!1,U="",V=J.length;for(let K=1;K<Z.length;++K){let L=Z[K];switch(L.type){case"space":G=!0;case"newline":V+=L.source.length;break;case"comment":if(z&&!G)X(L,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");V+=L.source.length,U=L.source.substring(1);break;case"error":X(L,"UNEXPECTED_TOKEN",L.message),V+=L.source.length;break;default:{let O=`Unexpected token in block scalar header: ${L.type}`;X(L,"UNEXPECTED_TOKEN",O);let B=L.source;if(B&&typeof B==="string")V+=B.length}}}return{mode:Q,indent:Y,chomp:q,comment:U,length:V}}function HU($){let Z=$.split(/\n( *)/),z=Z[0],X=z.match(/^( *)/),Q=[X?.[1]?[X[1],z.slice(X[1].length)]:["",z]];for(let Y=1;Y<Z.length;Y+=2)Q.push([Z[Y],Z[Y+1]]);return Q}BU.resolveBlockScalar=VU});var H8=A((FU)=>{var K8=$0(),NU=h$();function TU($,Z,z){let{offset:X,type:J,source:Q,end:Y}=$,q,W,G=(K,L,O)=>z(X+K,L,O);switch(J){case"scalar":q=K8.Scalar.PLAIN,W=MU(Q,G);break;case"single-quoted-scalar":q=K8.Scalar.QUOTE_SINGLE,W=OU(Q,G);break;case"double-quoted-scalar":q=K8.Scalar.QUOTE_DOUBLE,W=DU(Q,G);break;default:return z($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${J}`),{value:"",type:null,comment:"",range:[X,X+Q.length,X+Q.length]}}let U=X+Q.length,V=NU.resolveEnd(Y,U,Z,z);return{value:W,type:q,comment:V.comment,range:[X,U,V.offset]}}function MU($,Z){let z="";switch($[0]){case"\t":z="a tab character";break;case",":z="flow indicator character ,";break;case"%":z="directive indicator character %";break;case"|":case">":{z=`block scalar indicator ${$[0]}`;break}case"@":case"`":{z=`reserved character ${$[0]}`;break}}if(z)Z(0,"BAD_SCALAR_START",`Plain value cannot start with ${z}`);return $Z($)}function OU($,Z){if($[$.length-1]!=="'"||$.length===1)Z($.length,"MISSING_CHAR","Missing closing 'quote");return $Z($.slice(1,-1)).replace(/''/g,"'")}function $Z($){let Z,z;try{Z=new RegExp(`(.*?)(?<![ ])[ ]*\r?
111
+ `,"sy"),z=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
112
+ `,"sy")}catch{Z=/(.*?)[ \t]*\r?\n/sy,z=/[ \t]*(.*?)[ \t]*\r?\n/sy}let X=Z.exec($);if(!X)return $;let J=X[1],Q=" ",Y=Z.lastIndex;z.lastIndex=Y;while(X=z.exec($)){if(X[1]==="")if(Q===`
113
113
  `)J+=Q;else Q=`
114
- `;else J+=Q+z[1],Q=" ";Y=X.lastIndex}let q=/[ \t]*(.*)/sy;return q.lastIndex=Y,z=q.exec($),J+Q+(z?.[1]??"")}function VU($,Z){let X="";for(let z=1;z<$.length-1;++z){let J=$[z];if(J==="\r"&&$[z+1]===`
114
+ `;else J+=Q+X[1],Q=" ";Y=z.lastIndex}let q=/[ \t]*(.*)/sy;return q.lastIndex=Y,X=q.exec($),J+Q+(X?.[1]??"")}function DU($,Z){let z="";for(let X=1;X<$.length-1;++X){let J=$[X];if(J==="\r"&&$[X+1]===`
115
115
  `)continue;if(J===`
116
- `){let{fold:Q,offset:Y}=KU($,z);X+=Q,z=Y}else if(J==="\\"){let Q=$[++z],Y=HU[Q];if(Y)X+=Y;else if(Q===`
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 q={x:2,u:4,U:8}[Q];X+=BU($,z+1,q,Z),z+=q}else{let q=$.substr(z-1,2);Z(z-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${q}`),X+=q}}else if(J===" "||J==="\t"){let Q=z,Y=$[z+1];while(Y===" "||Y==="\t")Y=$[++z+1];if(Y!==`
119
- `&&!(Y==="\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 KU($,Z){let X="",z=$[Z+1];while(z===" "||z==="\t"||z===`
121
- `||z==="\r"){if(z==="\r"&&$[Z+2]!==`
122
- `)break;if(z===`
123
- `)X+=`
124
- `;Z+=1,z=$[Z+1]}if(!X)X=" ";return{fold:X,offset:Z}}var HU={"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 BU($,Z,X,z){let J=$.substr(Z,X),Y=J.length===X&&/^[0-9a-fA-F]+$/.test(J)?parseInt(J,16):NaN;if(isNaN(Y)){let q=$.substr(Z-2,X+2);return z(Z-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${q}`),q}return String.fromCodePoint(Y)}NU.resolveFlowScalar=GU});var o5=A((wU)=>{var L$=v(),a5=$0(),TU=Y8(),MU=G8();function OU($,Z,X,z){let{value:J,type:Q,comment:Y,range:q}=Z.type==="block-scalar"?TU.resolveBlockScalar($,Z,z):MU.resolveFlowScalar(Z,$.options.strict,z),G=X?$.directives.tagName(X.source,(V)=>z(X,"TAG_RESOLVE_FAILED",V)):null,W;if($.options.stringKeys&&$.atKey)W=$.schema[L$.SCALAR];else if(G)W=DU($.schema,J,G,X,z);else if(Z.type==="scalar")W=AU($,J,Z,z);else W=$.schema[L$.SCALAR];let U;try{let V=W.resolve(J,(K)=>z(X??Z,"TAG_RESOLVE_FAILED",K),$.options);U=L$.isScalar(V)?V:new a5.Scalar(V)}catch(V){let K=V instanceof Error?V.message:String(V);z(X??Z,"TAG_RESOLVE_FAILED",K),U=new a5.Scalar(J)}if(U.range=q,U.source=J,Q)U.type=Q;if(G)U.tag=G;if(W.format)U.format=W.format;if(Y)U.comment=Y;return U}function DU($,Z,X,z,J){if(X==="!")return $[L$.SCALAR];let Q=[];for(let q of $.tags)if(!q.collection&&q.tag===X)if(q.default&&q.test)Q.push(q);else return q;for(let q of Q)if(q.test?.test(Z))return q;let Y=$.knownTags[X];if(Y&&!Y.collection)return $.tags.push(Object.assign({},Y,{default:!1,test:void 0})),Y;return J(z,"TAG_RESOLVE_FAILED",`Unresolved tag: ${X}`,X!=="tag:yaml.org,2002:str"),$[L$.SCALAR]}function AU({atKey:$,directives:Z,schema:X},z,J,Q){let Y=X.tags.find((q)=>(q.default===!0||$&&q.default==="key")&&q.test?.test(z))||X[L$.SCALAR];if(X.compat){let q=X.compat.find((G)=>G.default&&G.test?.test(z))??X[L$.SCALAR];if(Y.tag!==q.tag){let G=Z.tagString(Y.tag),W=Z.tagString(q.tag),U=`Value may be parsed as either ${G} or ${W}`;Q(J,"TAG_RESOLVE_FAILED",U,!0)}}return Y}wU.composeScalar=OU});var t5=A((RU)=>{function FU($,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 $}RU.emptyScalarPosition=FU});var ZZ=A((yU)=>{var EU=T1(),_U=v(),CU=r5(),e5=o5(),jU=h$(),SU=t5(),bU={composeNode:$Z,composeEmptyNode:W8};function $Z($,Z,X,z){let J=$.atKey,{spaceBefore:Q,comment:Y,anchor:q,tag:G}=X,W,U=!0;switch(Z.type){case"alias":if(W=xU($,Z,z),q||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(W=e5.composeScalar($,Z,G,z),q)W.anchor=q.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(W=CU.composeCollection(bU,$,Z,X,z),q)W.anchor=q.source.substring(1);break;default:{let V=Z.type==="error"?Z.message:`Unsupported token (type: ${Z.type})`;z(Z,"UNEXPECTED_TOKEN",V),W=W8($,Z.offset,void 0,null,X,z),U=!1}}if(q&&W.anchor==="")z(q,"BAD_ALIAS","Anchor cannot be an empty string");if(J&&$.options.stringKeys&&(!_U.isScalar(W)||typeof W.value!=="string"||W.tag&&W.tag!=="tag:yaml.org,2002:str"))z(G??Z,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(Q)W.spaceBefore=!0;if(Y)if(Z.type==="scalar"&&Z.source==="")W.comment=Y;else W.commentBefore=Y;if($.options.keepSourceTokens&&U)W.srcToken=Z;return W}function W8($,Z,X,z,{spaceBefore:J,comment:Q,anchor:Y,tag:q,end:G},W){let U={type:"scalar",offset:SU.emptyScalarPosition(Z,X,z),indent:-1,source:""},V=e5.composeScalar($,U,q,W);if(Y){if(V.anchor=Y.source.substring(1),V.anchor==="")W(Y,"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 xU({options:$},{offset:Z,source:X,end:z},J){let Q=new EU.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 Y=Z+X.length,q=jU.resolveEnd(z,Y,$.strict,J);if(Q.range=[Z,Y,q.offset],q.comment)Q.comment=q.comment;return Q}yU.composeEmptyNode=W8;yU.composeNode=$Z});var zZ=A((mU)=>{var gU=b1(),XZ=ZZ(),hU=h$(),vU=y1();function uU($,Z,{offset:X,start:z,value:J,end:Q},Y){let q=Object.assign({_directives:Z},$),G=new gU.Document(void 0,q),W={atKey:!1,atRoot:!0,directives:G.directives,options:G.options,schema:G.schema},U=vU.resolveProps(z,{indicator:"doc-start",next:J??Q?.[0],offset:X,onError:Y,parentIndent:0,startOnNewline:!0});if(U.found){if(G.directives.docStart=!0,J&&(J.type==="block-map"||J.type==="block-seq")&&!U.hasNewline)Y(U.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}G.contents=J?XZ.composeNode(W,J,U,Y):XZ.composeEmptyNode(W,U.end,z,null,U,Y);let V=G.contents.range[2],K=hU.resolveEnd(Q,V,!1,Y);if(K.comment)G.comment=K.comment;return G.range=[X,V,K.offset],G}mU.composeDoc=uU});var U8=A((rU)=>{var cU=L0("process"),pU=B6(),lU=b1(),k1=x1(),JZ=v(),iU=zZ(),nU=h$();function f1($){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 QZ($){let Z="",X=!1,z=!1;for(let J=0;J<$.length;++J){let Q=$[J];switch(Q[0]){case"#":Z+=(Z===""?"":z?`
116
+ `){let{fold:Q,offset:Y}=AU($,X);z+=Q,X=Y}else if(J==="\\"){let Q=$[++X],Y=IU[Q];if(Y)z+=Y;else if(Q===`
117
+ `){Q=$[X+1];while(Q===" "||Q==="\t")Q=$[++X+1]}else if(Q==="\r"&&$[X+1]===`
118
+ `){Q=$[++X+1];while(Q===" "||Q==="\t")Q=$[++X+1]}else if(Q==="x"||Q==="u"||Q==="U"){let q={x:2,u:4,U:8}[Q];z+=wU($,X+1,q,Z),X+=q}else{let q=$.substr(X-1,2);Z(X-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${q}`),z+=q}}else if(J===" "||J==="\t"){let Q=X,Y=$[X+1];while(Y===" "||Y==="\t")Y=$[++X+1];if(Y!==`
119
+ `&&!(Y==="\r"&&$[X+2]===`
120
+ `))z+=X>Q?$.slice(Q,X+1):J}else z+=J}if($[$.length-1]!=='"'||$.length===1)Z($.length,"MISSING_CHAR",'Missing closing "quote');return z}function AU($,Z){let z="",X=$[Z+1];while(X===" "||X==="\t"||X===`
121
+ `||X==="\r"){if(X==="\r"&&$[Z+2]!==`
122
+ `)break;if(X===`
123
+ `)z+=`
124
+ `;Z+=1,X=$[Z+1]}if(!z)z=" ";return{fold:z,offset:Z}}var IU={"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 wU($,Z,z,X){let J=$.substr(Z,z),Y=J.length===z&&/^[0-9a-fA-F]+$/.test(J)?parseInt(J,16):NaN;if(isNaN(Y)){let q=$.substr(Z-2,z+2);return X(Z-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${q}`),q}return String.fromCodePoint(Y)}FU.resolveFlowScalar=TU});var zZ=A((SU)=>{var N$=m(),ZZ=$0(),PU=V8(),_U=H8();function EU($,Z,z,X){let{value:J,type:Q,comment:Y,range:q}=Z.type==="block-scalar"?PU.resolveBlockScalar($,Z,X):_U.resolveFlowScalar(Z,$.options.strict,X),W=z?$.directives.tagName(z.source,(V)=>X(z,"TAG_RESOLVE_FAILED",V)):null,G;if($.options.stringKeys&&$.atKey)G=$.schema[N$.SCALAR];else if(W)G=CU($.schema,J,W,z,X);else if(Z.type==="scalar")G=jU($,J,Z,X);else G=$.schema[N$.SCALAR];let U;try{let V=G.resolve(J,(K)=>X(z??Z,"TAG_RESOLVE_FAILED",K),$.options);U=N$.isScalar(V)?V:new ZZ.Scalar(V)}catch(V){let K=V instanceof Error?V.message:String(V);X(z??Z,"TAG_RESOLVE_FAILED",K),U=new ZZ.Scalar(J)}if(U.range=q,U.source=J,Q)U.type=Q;if(W)U.tag=W;if(G.format)U.format=G.format;if(Y)U.comment=Y;return U}function CU($,Z,z,X,J){if(z==="!")return $[N$.SCALAR];let Q=[];for(let q of $.tags)if(!q.collection&&q.tag===z)if(q.default&&q.test)Q.push(q);else return q;for(let q of Q)if(q.test?.test(Z))return q;let Y=$.knownTags[z];if(Y&&!Y.collection)return $.tags.push(Object.assign({},Y,{default:!1,test:void 0})),Y;return J(X,"TAG_RESOLVE_FAILED",`Unresolved tag: ${z}`,z!=="tag:yaml.org,2002:str"),$[N$.SCALAR]}function jU({atKey:$,directives:Z,schema:z},X,J,Q){let Y=z.tags.find((q)=>(q.default===!0||$&&q.default==="key")&&q.test?.test(X))||z[N$.SCALAR];if(z.compat){let q=z.compat.find((W)=>W.default&&W.test?.test(X))??z[N$.SCALAR];if(Y.tag!==q.tag){let W=Z.tagString(Y.tag),G=Z.tagString(q.tag),U=`Value may be parsed as either ${W} or ${G}`;Q(J,"TAG_RESOLVE_FAILED",U,!0)}}return Y}SU.composeScalar=EU});var XZ=A((yU)=>{function xU($,Z,z){if(Z){z??(z=Z.length);for(let X=z-1;X>=0;--X){let J=Z[X];switch(J.type){case"space":case"comment":case"newline":$-=J.source.length;continue}J=Z[++X];while(J?.type==="space")$+=J.source.length,J=Z[++X];break}}return $}yU.emptyScalarPosition=xU});var YZ=A((cU)=>{var fU=M1(),gU=m(),hU=e5(),JZ=zZ(),vU=h$(),uU=XZ(),mU={composeNode:QZ,composeEmptyNode:B8};function QZ($,Z,z,X){let J=$.atKey,{spaceBefore:Q,comment:Y,anchor:q,tag:W}=z,G,U=!0;switch(Z.type){case"alias":if(G=dU($,Z,X),q||W)X(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(G=JZ.composeScalar($,Z,W,X),q)G.anchor=q.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(G=hU.composeCollection(mU,$,Z,z,X),q)G.anchor=q.source.substring(1);break;default:{let V=Z.type==="error"?Z.message:`Unsupported token (type: ${Z.type})`;X(Z,"UNEXPECTED_TOKEN",V),G=B8($,Z.offset,void 0,null,z,X),U=!1}}if(q&&G.anchor==="")X(q,"BAD_ALIAS","Anchor cannot be an empty string");if(J&&$.options.stringKeys&&(!gU.isScalar(G)||typeof G.value!=="string"||G.tag&&G.tag!=="tag:yaml.org,2002:str"))X(W??Z,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(Q)G.spaceBefore=!0;if(Y)if(Z.type==="scalar"&&Z.source==="")G.comment=Y;else G.commentBefore=Y;if($.options.keepSourceTokens&&U)G.srcToken=Z;return G}function B8($,Z,z,X,{spaceBefore:J,comment:Q,anchor:Y,tag:q,end:W},G){let U={type:"scalar",offset:uU.emptyScalarPosition(Z,z,X),indent:-1,source:""},V=JZ.composeScalar($,U,q,G);if(Y){if(V.anchor=Y.source.substring(1),V.anchor==="")G(Y,"BAD_ALIAS","Anchor cannot be an empty string")}if(J)V.spaceBefore=!0;if(Q)V.comment=Q,V.range[2]=W;return V}function dU({options:$},{offset:Z,source:z,end:X},J){let Q=new fU.Alias(z.substring(1));if(Q.source==="")J(Z,"BAD_ALIAS","Alias cannot be an empty string");if(Q.source.endsWith(":"))J(Z+z.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let Y=Z+z.length,q=vU.resolveEnd(X,Y,$.strict,J);if(Q.range=[Z,Y,q.offset],q.comment)Q.comment=q.comment;return Q}cU.composeEmptyNode=B8;cU.composeNode=QZ});var WZ=A((aU)=>{var iU=x1(),qZ=YZ(),nU=h$(),rU=k1();function sU($,Z,{offset:z,start:X,value:J,end:Q},Y){let q=Object.assign({_directives:Z},$),W=new iU.Document(void 0,q),G={atKey:!1,atRoot:!0,directives:W.directives,options:W.options,schema:W.schema},U=rU.resolveProps(X,{indicator:"doc-start",next:J??Q?.[0],offset:z,onError:Y,parentIndent:0,startOnNewline:!0});if(U.found){if(W.directives.docStart=!0,J&&(J.type==="block-map"||J.type==="block-seq")&&!U.hasNewline)Y(U.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}W.contents=J?qZ.composeNode(G,J,U,Y):qZ.composeEmptyNode(G,U.end,X,null,U,Y);let V=W.contents.range[2],K=nU.resolveEnd(Q,V,!1,Y);if(K.comment)W.comment=K.comment;return W.range=[z,V,K.offset],W}aU.composeDoc=sU});var L8=A((XV)=>{var tU=N0("process"),eU=O6(),$V=x1(),f1=y1(),GZ=m(),ZV=WZ(),zV=h$();function g1($){if(typeof $==="number")return[$,$+1];if(Array.isArray($))return $.length===2?$:[$[0],$[1]];let{offset:Z,source:z}=$;return[Z,Z+(typeof z==="string"?z.length:1)]}function UZ($){let Z="",z=!1,X=!1;for(let J=0;J<$.length;++J){let Q=$[J];switch(Q[0]){case"#":Z+=(Z===""?"":X?`
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 YZ{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Z,X,z,J)=>{let Q=f1(Z);if(J)this.warnings.push(new k1.YAMLWarning(Q,X,z));else this.errors.push(new k1.YAMLParseError(Q,X,z))},this.directives=new pU.Directives({version:$.version||"1.2"}),this.options=$}decorate($,Z){let{comment:X,afterEmptyLine:z}=QZ(this.prelude);if(X){let J=$.contents;if(Z)$.comment=$.comment?`${$.comment}
129
- ${X}`:X;else if(z||$.directives.docStart||!J)$.commentBefore=X;else if(JZ.isCollection(J)&&!J.flow&&J.items.length>0){let Q=J.items[0];if(JZ.isPair(Q))Q=Q.key;let Y=Q.commentBefore;Q.commentBefore=Y?`${X}
130
- ${Y}`: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:QZ(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(cU.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(Z,X,z)=>{let J=f1($);J[0]+=Z,this.onError(J,"BAD_DIRECTIVE",X,z)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let Z=iU.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 k1.YAMLParseError(f1($),"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 k1.YAMLParseError(f1($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Z=nU.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 k1.YAMLParseError(f1($),"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 lU.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}}}rU.Composer=YZ});var WZ=A((zV)=>{var aU=Y8(),oU=G8(),tU=x1(),qZ=A1();function eU($,Z=!0,X){if($){let z=(J,Q,Y)=>{let q=typeof J==="number"?J:Array.isArray(J)?J[0]:J.offset;if(X)X(q,Q,Y);else throw new tU.YAMLParseError([q,q+1],Q,Y)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return oU.resolveFlowScalar($,Z,z);case"block-scalar":return aU.resolveBlockScalar({options:{strict:Z}},$,z)}}return null}function $V($,Z){let{implicitKey:X=!1,indent:z,inFlow:J=!1,offset:Q=-1,type:Y="PLAIN"}=Z,q=qZ.stringifyString({type:Y,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
- `}];switch(q[0]){case"|":case">":{let W=q.indexOf(`
134
- `),U=q.substring(0,W),V=q.substring(W+1)+`
135
- `,K=[{type:"block-scalar-header",offset:Q,indent:z,source:U}];if(!GZ(K,G))K.push({type:"newline",offset:-1,indent:z,source:`
136
- `});return{type:"block-scalar",offset:Q,indent:z,props:K,source:V}}case'"':return{type:"double-quoted-scalar",offset:Q,indent:z,source:q,end:G};case"'":return{type:"single-quoted-scalar",offset:Q,indent:z,source:q,end:G};default:return{type:"scalar",offset:Q,indent:z,source:q,end:G}}}function ZV($,Z,X={}){let{afterKey:z=!1,implicitKey:J=!1,inFlow:Q=!1,type:Y}=X,q="indent"in $?$.indent:null;if(z&&typeof q==="number")q+=2;if(!Y)switch($.type){case"single-quoted-scalar":Y="QUOTE_SINGLE";break;case"double-quoted-scalar":Y="QUOTE_DOUBLE";break;case"block-scalar":{let W=$.props[0];if(W.type!=="block-scalar-header")throw Error("Invalid block scalar header");Y=W.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:Y="PLAIN"}let G=qZ.stringifyString({type:Y,value:Z},{implicitKey:J||q===null,indent:q!==null&&q>0?" ".repeat(q):"",inFlow:Q,options:{blockQuote:!0,lineWidth:-1}});switch(G[0]){case"|":case">":XV($,G);break;case'"':V8($,G,"double-quoted-scalar");break;case"'":V8($,G,"single-quoted-scalar");break;default:V8($,G,"scalar")}}function XV($,Z){let X=Z.indexOf(`
137
- `),z=Z.substring(0,X),J=Z.substring(X+1)+`
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}=$,Y="indent"in $?$.indent:-1,q=[{type:"block-scalar-header",offset:Q,indent:Y,source:z}];if(!GZ(q,"end"in $?$.end:void 0))q.push({type:"newline",offset:-1,indent:Y,source:`
139
- `});for(let G of Object.keys($))if(G!=="type"&&G!=="offset")delete $[G];Object.assign($,{type:"block-scalar",indent:Y,props:q,source:J})}}function GZ($,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 V8($,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})}}}zV.createScalarToken=$V;zV.resolveAsScalar=eU;zV.setScalarValue=ZV});var UZ=A((GV)=>{var qV=($)=>("type"in $)?M4($):T4($);function M4($){switch($.type){case"block-scalar":{let Z="";for(let X of $.props)Z+=M4(X);return Z+$.source}case"block-map":case"block-seq":{let Z="";for(let X of $.items)Z+=T4(X);return Z}case"flow-collection":{let Z=$.start.source;for(let X of $.items)Z+=T4(X);for(let X of $.end)Z+=X.source;return Z}case"document":{let Z=T4($);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 T4({start:$,key:Z,sep:X,value:z}){let J="";for(let Q of $)J+=Q.source;if(Z)J+=M4(Z);if(X)for(let Q of X)J+=Q.source;if(z)J+=M4(z);return J}GV.stringify=qV});var HZ=A((VV)=>{var K8=Symbol("break visit"),UV=Symbol("skip children"),VZ=Symbol("remove item");function T$($,Z){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};KZ(Object.freeze([]),$,Z)}T$.BREAK=K8;T$.SKIP=UV;T$.REMOVE=VZ;T$.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};T$.parentCollection=($,Z)=>{let X=T$.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 KZ($,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 Y=0;Y<Q.items.length;++Y){let q=KZ(Object.freeze($.concat([[J,Y]])),Q.items[Y],X);if(typeof q==="number")Y=q-1;else if(q===K8)return K8;else if(q===VZ)Q.items.splice(Y,1),Y-=1}if(typeof z==="function"&&J==="key")z=z(Z,$)}}return typeof z==="function"?z(Z,$):z}VV.visit=T$});var O4=A((OV)=>{var H8=WZ(),HV=UZ(),BV=HZ(),B8="\uFEFF",N8="\x02",L8="\x18",T8="\x1F",NV=($)=>!!$&&("items"in $),LV=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function TV($){switch($){case B8:return"<BOM>";case N8:return"<DOC>";case L8:return"<FLOW_END>";case T8:return"<SCALAR>";default:return JSON.stringify($)}}function MV($){switch($){case B8:return"byte-order-mark";case N8:return"doc-mode";case L8:return"flow-error-end";case T8:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
128
+ `)+(Q.substring(1)||" "),z=!0,X=!1;break;case"%":if($[J+1]?.[0]!=="#")J+=1;z=!1;break;default:if(!z)X=!0;z=!1}}return{comment:Z,afterEmptyLine:X}}class VZ{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Z,z,X,J)=>{let Q=g1(Z);if(J)this.warnings.push(new f1.YAMLWarning(Q,z,X));else this.errors.push(new f1.YAMLParseError(Q,z,X))},this.directives=new eU.Directives({version:$.version||"1.2"}),this.options=$}decorate($,Z){let{comment:z,afterEmptyLine:X}=UZ(this.prelude);if(z){let J=$.contents;if(Z)$.comment=$.comment?`${$.comment}
129
+ ${z}`:z;else if(X||$.directives.docStart||!J)$.commentBefore=z;else if(GZ.isCollection(J)&&!J.flow&&J.items.length>0){let Q=J.items[0];if(GZ.isPair(Q))Q=Q.key;let Y=Q.commentBefore;Q.commentBefore=Y?`${z}
130
+ ${Y}`:z}else{let Q=J.commentBefore;J.commentBefore=Q?`${z}
131
+ ${Q}`:z}}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:UZ(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose($,Z=!1,z=-1){for(let X of $)yield*this.next(X);yield*this.end(Z,z)}*next($){if(tU.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(Z,z,X)=>{let J=g1($);J[0]+=Z,this.onError(J,"BAD_DIRECTIVE",z,X)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let Z=ZV.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,z=new f1.YAMLParseError(g1($),"UNEXPECTED_TOKEN",Z);if(this.atDirectives||!this.doc)this.errors.push(z);else this.doc.errors.push(z);break}case"doc-end":{if(!this.doc){this.errors.push(new f1.YAMLParseError(g1($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Z=zV.resolveEnd($.end,$.offset+$.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),Z.comment){let z=this.doc.comment;this.doc.comment=z?`${z}
132
+ ${Z.comment}`:Z.comment}this.doc.range[2]=Z.offset;break}default:this.errors.push(new f1.YAMLParseError(g1($),"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 z=Object.assign({_directives:this.directives},this.options),X=new $V.Document(void 0,z);if(this.atDirectives)this.onError(Z,"MISSING_CHAR","Missing directives-end indicator line");X.range=[0,Z,Z],this.decorate(X,!1),yield X}}}XV.Composer=VZ});var BZ=A((KV)=>{var QV=V8(),YV=H8(),qV=y1(),KZ=I1();function WV($,Z=!0,z){if($){let X=(J,Q,Y)=>{let q=typeof J==="number"?J:Array.isArray(J)?J[0]:J.offset;if(z)z(q,Q,Y);else throw new qV.YAMLParseError([q,q+1],Q,Y)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return YV.resolveFlowScalar($,Z,X);case"block-scalar":return QV.resolveBlockScalar({options:{strict:Z}},$,X)}}return null}function GV($,Z){let{implicitKey:z=!1,indent:X,inFlow:J=!1,offset:Q=-1,type:Y="PLAIN"}=Z,q=KZ.stringifyString({type:Y,value:$},{implicitKey:z,indent:X>0?" ".repeat(X):"",inFlow:J,options:{blockQuote:!0,lineWidth:-1}}),W=Z.end??[{type:"newline",offset:-1,indent:X,source:`
133
+ `}];switch(q[0]){case"|":case">":{let G=q.indexOf(`
134
+ `),U=q.substring(0,G),V=q.substring(G+1)+`
135
+ `,K=[{type:"block-scalar-header",offset:Q,indent:X,source:U}];if(!HZ(K,W))K.push({type:"newline",offset:-1,indent:X,source:`
136
+ `});return{type:"block-scalar",offset:Q,indent:X,props:K,source:V}}case'"':return{type:"double-quoted-scalar",offset:Q,indent:X,source:q,end:W};case"'":return{type:"single-quoted-scalar",offset:Q,indent:X,source:q,end:W};default:return{type:"scalar",offset:Q,indent:X,source:q,end:W}}}function UV($,Z,z={}){let{afterKey:X=!1,implicitKey:J=!1,inFlow:Q=!1,type:Y}=z,q="indent"in $?$.indent:null;if(X&&typeof q==="number")q+=2;if(!Y)switch($.type){case"single-quoted-scalar":Y="QUOTE_SINGLE";break;case"double-quoted-scalar":Y="QUOTE_DOUBLE";break;case"block-scalar":{let G=$.props[0];if(G.type!=="block-scalar-header")throw Error("Invalid block scalar header");Y=G.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:Y="PLAIN"}let W=KZ.stringifyString({type:Y,value:Z},{implicitKey:J||q===null,indent:q!==null&&q>0?" ".repeat(q):"",inFlow:Q,options:{blockQuote:!0,lineWidth:-1}});switch(W[0]){case"|":case">":VV($,W);break;case'"':N8($,W,"double-quoted-scalar");break;case"'":N8($,W,"single-quoted-scalar");break;default:N8($,W,"scalar")}}function VV($,Z){let z=Z.indexOf(`
137
+ `),X=Z.substring(0,z),J=Z.substring(z+1)+`
138
+ `;if($.type==="block-scalar"){let Q=$.props[0];if(Q.type!=="block-scalar-header")throw Error("Invalid block scalar header");Q.source=X,$.source=J}else{let{offset:Q}=$,Y="indent"in $?$.indent:-1,q=[{type:"block-scalar-header",offset:Q,indent:Y,source:X}];if(!HZ(q,"end"in $?$.end:void 0))q.push({type:"newline",offset:-1,indent:Y,source:`
139
+ `});for(let W of Object.keys($))if(W!=="type"&&W!=="offset")delete $[W];Object.assign($,{type:"block-scalar",indent:Y,props:q,source:J})}}function HZ($,Z){if(Z)for(let z of Z)switch(z.type){case"space":case"comment":$.push(z);break;case"newline":return $.push(z),!0}return!1}function N8($,Z,z){switch($.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":$.type=z,$.source=Z;break;case"block-scalar":{let X=$.props.slice(1),J=Z.length;if($.props[0].type==="block-scalar-header")J-=$.props[0].source.length;for(let Q of X)Q.offset+=J;delete $.props,Object.assign($,{type:z,source:Z,end:X});break}case"block-map":case"block-seq":{let J={type:"newline",offset:$.offset+Z.length,indent:$.indent,source:`
140
+ `};delete $.items,Object.assign($,{type:z,source:Z,end:[J]});break}default:{let X="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:z,indent:X,source:Z,end:J})}}}KV.createScalarToken=GV;KV.resolveAsScalar=WV;KV.setScalarValue=UV});var LZ=A((TV)=>{var NV=($)=>("type"in $)?D2($):O2($);function D2($){switch($.type){case"block-scalar":{let Z="";for(let z of $.props)Z+=D2(z);return Z+$.source}case"block-map":case"block-seq":{let Z="";for(let z of $.items)Z+=O2(z);return Z}case"flow-collection":{let Z=$.start.source;for(let z of $.items)Z+=O2(z);for(let z of $.end)Z+=z.source;return Z}case"document":{let Z=O2($);if($.end)for(let z of $.end)Z+=z.source;return Z}default:{let Z=$.source;if("end"in $&&$.end)for(let z of $.end)Z+=z.source;return Z}}}function O2({start:$,key:Z,sep:z,value:X}){let J="";for(let Q of $)J+=Q.source;if(Z)J+=D2(Z);if(z)for(let Q of z)J+=Q.source;if(X)J+=D2(X);return J}TV.stringify=NV});var MZ=A((DV)=>{var T8=Symbol("break visit"),OV=Symbol("skip children"),NZ=Symbol("remove item");function T$($,Z){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};TZ(Object.freeze([]),$,Z)}T$.BREAK=T8;T$.SKIP=OV;T$.REMOVE=NZ;T$.itemAtPath=($,Z)=>{let z=$;for(let[X,J]of Z){let Q=z?.[X];if(Q&&"items"in Q)z=Q.items[J];else return}return z};T$.parentCollection=($,Z)=>{let z=T$.itemAtPath($,Z.slice(0,-1)),X=Z[Z.length-1][0],J=z?.[X];if(J&&"items"in J)return J;throw Error("Parent collection not found")};function TZ($,Z,z){let X=z(Z,$);if(typeof X==="symbol")return X;for(let J of["key","value"]){let Q=Z[J];if(Q&&"items"in Q){for(let Y=0;Y<Q.items.length;++Y){let q=TZ(Object.freeze($.concat([[J,Y]])),Q.items[Y],z);if(typeof q==="number")Y=q-1;else if(q===T8)return T8;else if(q===NZ)Q.items.splice(Y,1),Y-=1}if(typeof X==="function"&&J==="key")X=X(Z,$)}}return typeof X==="function"?X(Z,$):X}DV.visit=T$});var A2=A((EV)=>{var M8=BZ(),IV=LZ(),wV=MZ(),O8="\uFEFF",D8="\x02",A8="\x18",I8="\x1F",FV=($)=>!!$&&("items"in $),RV=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function PV($){switch($){case O8:return"<BOM>";case D8:return"<DOC>";case A8:return"<FLOW_END>";case I8:return"<SCALAR>";default:return JSON.stringify($)}}function _V($){switch($){case O8:return"byte-order-mark";case D8:return"doc-mode";case A8:return"flow-error-end";case I8: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}OV.createScalarToken=H8.createScalarToken;OV.resolveAsScalar=H8.resolveAsScalar;OV.setScalarValue=H8.setScalarValue;OV.stringify=HV.stringify;OV.visit=BV.visit;OV.BOM=B8;OV.DOCUMENT=N8;OV.FLOW_END=L8;OV.SCALAR=T8;OV.isCollection=NV;OV.isScalar=LV;OV.prettyToken=TV;OV.tokenType=MV});var O8=A((kV)=>{var g1=O4();function P0($){switch($){case void 0:case" ":case`
143
- `:case"\r":case"\t":return!0;default:return!1}}var BZ=new Set("0123456789ABCDEFabcdef"),xV=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),D4=new Set(",[]{}"),yV=new Set(` ,[]{}
144
- \r `),M8=($)=>!$||yV.has($);class NZ{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}EV.createScalarToken=M8.createScalarToken;EV.resolveAsScalar=M8.resolveAsScalar;EV.setScalarValue=M8.setScalarValue;EV.stringify=IV.stringify;EV.visit=wV.visit;EV.BOM=O8;EV.DOCUMENT=D8;EV.FLOW_END=A8;EV.SCALAR=I8;EV.isCollection=FV;EV.isScalar=RV;EV.prettyToken=PV;EV.tokenType=_V});var F8=A((pV)=>{var h1=A2();function _0($){switch($){case void 0:case" ":case`
143
+ `:case"\r":case"\t":return!0;default:return!1}}var OZ=new Set("0123456789ABCDEFabcdef"),dV=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),I2=new Set(",[]{}"),cV=new Set(` ,[]{}
144
+ \r `),w8=($)=>!$||cV.has($);class DZ{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 z=this.next??"stream";while(z&&(Z||this.hasChars(1)))z=yield*this.parseNext(z)}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
- `;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
- `||!z&&!this.atEnd)return $+X+1}return Z===`
148
- `||X>=this.indentNext||!Z&&!this.atEnd?$+X:-1}if(Z==="-"||Z==="."){let X=this.buffer.substr($,3);if((X==="---"||X==="...")&&P0(this.buffer[$+3]))return-1}return $}getLine(){let $=this.lineEndPos;if(typeof $!=="number"||$!==-1&&$<this.pos)$=this.buffer.indexOf(`
149
- `,this.pos),this.lineEndPos=$;if($===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[$-1]==="\r")$-=1;return this.buffer.substring(this.pos,$)}hasChars($){return this.pos+$<=this.buffer.length}setNext($){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=$,null}peek($){return this.buffer.substr(this.pos,$)}*parseNext($){switch($){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let $=this.getLine();if($===null)return this.setNext("stream");if($[0]===g1.BOM)yield*this.pushCount(1),$=$.substring(1);if($[0]==="%"){let Z=$.length,X=$.indexOf("#");while(X!==-1){let J=$[X-1];if(J===" "||J==="\t"){Z=X-1;break}else X=$.indexOf("#",X+1)}while(!0){let J=$[Z-1];if(J===" "||J==="\t")Z-=1;else break}let z=(yield*this.pushCount(Z))+(yield*this.pushSpaces(!0));return yield*this.pushCount($.length-z),this.pushNewline(),"stream"}if(this.atLineEnd()){let Z=yield*this.pushSpaces(!0);return yield*this.pushCount($.length-Z),yield*this.pushNewline(),"stream"}return yield g1.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let $=this.charAt(0);if(!$&&!this.atEnd)return this.setNext("line-start");if($==="-"||$==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let Z=this.peek(3);if((Z==="---"||Z==="...")&&P0(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,Z==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!P0(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[$,Z]=this.peek(2);if(!Z&&!this.atEnd)return this.setNext("block-start");if(($==="-"||$==="?"||$===":")&&P0(Z)){let X=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=X,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let $=this.getLine();if($===null)return this.setNext("doc");let Z=yield*this.pushIndicators();switch($[Z]){case"#":yield*this.pushCount($.length-Z);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(M8),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return Z+=yield*this.parseBlockScalarHeader(),Z+=yield*this.pushSpaces(!0),yield*this.pushCount($.length-Z),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let $,Z,X=-1;do{if($=yield*this.pushNewline(),$>0)Z=yield*this.pushSpaces(!1),this.indentValue=X=Z;else Z=0;Z+=yield*this.pushSpaces(!0)}while($+Z>0);let z=this.getLine();if(z===null)return this.setNext("flow");if(X!==-1&&X<this.indentNext&&z[0]!=="#"||X===0&&(z.startsWith("---")||z.startsWith("..."))&&P0(z[3])){if(!(X===this.indentNext-1&&this.flowLevel===1&&(z[0]==="]"||z[0]==="}")))return this.flowLevel=0,yield g1.FLOW_END,yield*this.parseLineStart()}let J=0;while(z[J]===",")J+=yield*this.pushCount(1),J+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(J+=yield*this.pushIndicators(),z[J]){case void 0:return"flow";case"#":return yield*this.pushCount(z.length-J),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(M8),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let Q=this.charAt(1);if(this.flowKey||P0(Q)||Q===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let $=this.charAt(0),Z=this.buffer.indexOf($,this.pos+1);if($==="'")while(Z!==-1&&this.buffer[Z+1]==="'")Z=this.buffer.indexOf("'",Z+2);else while(Z!==-1){let J=0;while(this.buffer[Z-1-J]==="\\")J+=1;if(J%2===0)break;Z=this.buffer.indexOf('"',Z+1)}let X=this.buffer.substring(0,Z),z=X.indexOf(`
150
- `,this.pos);if(z!==-1){while(z!==-1){let J=this.continueScalar(z+1);if(J===-1)break;z=X.indexOf(`
151
- `,J)}if(z!==-1)Z=z-(X[z-1]==="\r"?2:1)}if(Z===-1){if(!this.atEnd)return this.setNext("quoted-scalar");Z=this.buffer.length}return yield*this.pushToIndex(Z+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let $=this.pos;while(!0){let Z=this.buffer[++$];if(Z==="+")this.blockScalarKeep=!0;else if(Z>"0"&&Z<="9")this.blockScalarIndent=Number(Z)-1;else if(Z!=="-")break}return yield*this.pushUntil((Z)=>P0(Z)||Z==="#")}*parseBlockScalar(){let $=this.pos-1,Z=0,X;$:for(let J=this.pos;X=this.buffer[J];++J)switch(X){case" ":Z+=1;break;case`
146
+ `;return!1}charAt($){return this.buffer[this.pos+$]}continueScalar($){let Z=this.buffer[$];if(this.indentNext>0){let z=0;while(Z===" ")Z=this.buffer[++z+$];if(Z==="\r"){let X=this.buffer[z+$+1];if(X===`
147
+ `||!X&&!this.atEnd)return $+z+1}return Z===`
148
+ `||z>=this.indentNext||!Z&&!this.atEnd?$+z:-1}if(Z==="-"||Z==="."){let z=this.buffer.substr($,3);if((z==="---"||z==="...")&&_0(this.buffer[$+3]))return-1}return $}getLine(){let $=this.lineEndPos;if(typeof $!=="number"||$!==-1&&$<this.pos)$=this.buffer.indexOf(`
149
+ `,this.pos),this.lineEndPos=$;if($===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[$-1]==="\r")$-=1;return this.buffer.substring(this.pos,$)}hasChars($){return this.pos+$<=this.buffer.length}setNext($){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=$,null}peek($){return this.buffer.substr(this.pos,$)}*parseNext($){switch($){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let $=this.getLine();if($===null)return this.setNext("stream");if($[0]===h1.BOM)yield*this.pushCount(1),$=$.substring(1);if($[0]==="%"){let Z=$.length,z=$.indexOf("#");while(z!==-1){let J=$[z-1];if(J===" "||J==="\t"){Z=z-1;break}else z=$.indexOf("#",z+1)}while(!0){let J=$[Z-1];if(J===" "||J==="\t")Z-=1;else break}let X=(yield*this.pushCount(Z))+(yield*this.pushSpaces(!0));return yield*this.pushCount($.length-X),this.pushNewline(),"stream"}if(this.atLineEnd()){let Z=yield*this.pushSpaces(!0);return yield*this.pushCount($.length-Z),yield*this.pushNewline(),"stream"}return yield h1.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let $=this.charAt(0);if(!$&&!this.atEnd)return this.setNext("line-start");if($==="-"||$==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let Z=this.peek(3);if((Z==="---"||Z==="...")&&_0(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,Z==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!_0(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[$,Z]=this.peek(2);if(!Z&&!this.atEnd)return this.setNext("block-start");if(($==="-"||$==="?"||$===":")&&_0(Z)){let z=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=z,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let $=this.getLine();if($===null)return this.setNext("doc");let Z=yield*this.pushIndicators();switch($[Z]){case"#":yield*this.pushCount($.length-Z);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(w8),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return Z+=yield*this.parseBlockScalarHeader(),Z+=yield*this.pushSpaces(!0),yield*this.pushCount($.length-Z),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let $,Z,z=-1;do{if($=yield*this.pushNewline(),$>0)Z=yield*this.pushSpaces(!1),this.indentValue=z=Z;else Z=0;Z+=yield*this.pushSpaces(!0)}while($+Z>0);let X=this.getLine();if(X===null)return this.setNext("flow");if(z!==-1&&z<this.indentNext&&X[0]!=="#"||z===0&&(X.startsWith("---")||X.startsWith("..."))&&_0(X[3])){if(!(z===this.indentNext-1&&this.flowLevel===1&&(X[0]==="]"||X[0]==="}")))return this.flowLevel=0,yield h1.FLOW_END,yield*this.parseLineStart()}let J=0;while(X[J]===",")J+=yield*this.pushCount(1),J+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(J+=yield*this.pushIndicators(),X[J]){case void 0:return"flow";case"#":return yield*this.pushCount(X.length-J),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(w8),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let Q=this.charAt(1);if(this.flowKey||_0(Q)||Q===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let $=this.charAt(0),Z=this.buffer.indexOf($,this.pos+1);if($==="'")while(Z!==-1&&this.buffer[Z+1]==="'")Z=this.buffer.indexOf("'",Z+2);else while(Z!==-1){let J=0;while(this.buffer[Z-1-J]==="\\")J+=1;if(J%2===0)break;Z=this.buffer.indexOf('"',Z+1)}let z=this.buffer.substring(0,Z),X=z.indexOf(`
150
+ `,this.pos);if(X!==-1){while(X!==-1){let J=this.continueScalar(X+1);if(J===-1)break;X=z.indexOf(`
151
+ `,J)}if(X!==-1)Z=X-(z[X-1]==="\r"?2:1)}if(Z===-1){if(!this.atEnd)return this.setNext("quoted-scalar");Z=this.buffer.length}return yield*this.pushToIndex(Z+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let $=this.pos;while(!0){let Z=this.buffer[++$];if(Z==="+")this.blockScalarKeep=!0;else if(Z>"0"&&Z<="9")this.blockScalarIndent=Number(Z)-1;else if(Z!=="-")break}return yield*this.pushUntil((Z)=>_0(Z)||Z==="#")}*parseBlockScalar(){let $=this.pos-1,Z=0,z;$:for(let J=this.pos;z=this.buffer[J];++J)switch(z){case" ":Z+=1;break;case`
152
152
  `:$=J,Z=0;break;case"\r":{let Q=this.buffer[J+1];if(!Q&&!this.atEnd)return this.setNext("block-scalar");if(Q===`
153
- `)break}default:break $}if(!X&&!this.atEnd)return this.setNext("block-scalar");if(Z>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=Z;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let J=this.continueScalar($+1);if(J===-1)break;$=this.buffer.indexOf(`
154
- `,J)}while($!==-1);if($===-1){if(!this.atEnd)return this.setNext("block-scalar");$=this.buffer.length}}let z=$+1;X=this.buffer[z];while(X===" ")X=this.buffer[++z];if(X==="\t"){while(X==="\t"||X===" "||X==="\r"||X===`
155
- `)X=this.buffer[++z];$=z-1}else if(!this.blockScalarKeep)do{let J=$-1,Q=this.buffer[J];if(Q==="\r")Q=this.buffer[--J];let Y=J;while(Q===" ")Q=this.buffer[--J];if(Q===`
156
- `&&J>=this.pos&&J+1+Z>Y)$=J;else break}while(!0);return yield g1.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(P0(J)||$&&D4.has(J))break;Z=X}else if(P0(z)){let J=this.buffer[X+1];if(z==="\r")if(J===`
157
- `)X+=1,z=`
158
- `,J=this.buffer[X+1];else Z=X;if(J==="#"||$&&D4.has(J))break;if(z===`
159
- `){let Q=this.continueScalar(X+1);if(Q===-1)break;X=Math.max(X,Q-2)}}else{if($&&D4.has(z))break;Z=X}if(!z&&!this.atEnd)return this.setNext("plain-scalar");return yield g1.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(M8))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let $=this.flowLevel>0,Z=this.charAt(1);if(P0(Z)||$&&D4.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(!P0(Z)&&Z!==">")Z=this.buffer[++$];return yield*this.pushToIndex(Z===">"?$+1:$,!1)}else{let $=this.pos+1,Z=this.buffer[$];while(Z)if(xV.has(Z))Z=this.buffer[++$];else if(Z==="%"&&BZ.has(this.buffer[$+1])&&BZ.has(this.buffer[$+2]))Z=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
153
+ `)break}default:break $}if(!z&&!this.atEnd)return this.setNext("block-scalar");if(Z>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=Z;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let J=this.continueScalar($+1);if(J===-1)break;$=this.buffer.indexOf(`
154
+ `,J)}while($!==-1);if($===-1){if(!this.atEnd)return this.setNext("block-scalar");$=this.buffer.length}}let X=$+1;z=this.buffer[X];while(z===" ")z=this.buffer[++X];if(z==="\t"){while(z==="\t"||z===" "||z==="\r"||z===`
155
+ `)z=this.buffer[++X];$=X-1}else if(!this.blockScalarKeep)do{let J=$-1,Q=this.buffer[J];if(Q==="\r")Q=this.buffer[--J];let Y=J;while(Q===" ")Q=this.buffer[--J];if(Q===`
156
+ `&&J>=this.pos&&J+1+Z>Y)$=J;else break}while(!0);return yield h1.SCALAR,yield*this.pushToIndex($+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let $=this.flowLevel>0,Z=this.pos-1,z=this.pos-1,X;while(X=this.buffer[++z])if(X===":"){let J=this.buffer[z+1];if(_0(J)||$&&I2.has(J))break;Z=z}else if(_0(X)){let J=this.buffer[z+1];if(X==="\r")if(J===`
157
+ `)z+=1,X=`
158
+ `,J=this.buffer[z+1];else Z=z;if(J==="#"||$&&I2.has(J))break;if(X===`
159
+ `){let Q=this.continueScalar(z+1);if(Q===-1)break;z=Math.max(z,Q-2)}}else{if($&&I2.has(X))break;Z=z}if(!X&&!this.atEnd)return this.setNext("plain-scalar");return yield h1.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 z=this.buffer.slice(this.pos,$);if(z)return yield z,this.pos+=z.length,z.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(w8))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let $=this.flowLevel>0,Z=this.charAt(1);if(_0(Z)||$&&I2.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(!_0(Z)&&Z!==">")Z=this.buffer[++$];return yield*this.pushToIndex(Z===">"?$+1:$,!1)}else{let $=this.pos+1,Z=this.buffer[$];while(Z)if(dV.has(Z))Z=this.buffer[++$];else if(Z==="%"&&OZ.has(this.buffer[$+1])&&OZ.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)}}kV.Lexer=NZ});var D8=A((gV)=>{class LZ{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}}}}gV.LineCounter=LZ});var A8=A((mV)=>{var vV=L0("process"),TZ=O4(),uV=O8();function o0($,Z){for(let X=0;X<$.length;++X)if($[X].type===Z)return!0;return!1}function MZ($){for(let Z=0;Z<$.length;++Z)switch($[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function DZ($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function A4($){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 v$($){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 OZ($){if($.start.type==="flow-seq-start"){for(let Z of $.items)if(Z.sep&&!Z.value&&!o0(Z.start,"explicit-key-ind")&&!o0(Z.sep,"map-value-ind")){if(Z.key)Z.value=Z.key;if(delete Z.key,DZ(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 AZ{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 uV.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=$,vV.env.LOG_TOKENS)console.log("|",TZ.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let Z=TZ.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")OZ(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&&MZ(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(MZ($.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=A4(this.peek(2)),X=v$(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,z;do z=this.buffer[++Z];while(z===" "||$&&z==="\t");let X=Z-this.pos;if(X>0)yield this.buffer.substr(this.pos,X),this.pos=Z;return X}*pushUntil($){let Z=this.pos,z=this.buffer[Z];while(!$(z))z=this.buffer[++Z];return yield*this.pushToIndex(Z,!1)}}pV.Lexer=DZ});var R8=A((iV)=>{class AZ{constructor(){this.lineStarts=[],this.addNewLine=($)=>this.lineStarts.push($),this.linePos=($)=>{let Z=0,z=this.lineStarts.length;while(Z<z){let J=Z+z>>1;if(this.lineStarts[J]<$)Z=J+1;else z=J}if(this.lineStarts[Z]===$)return{line:Z+1,col:1};if(Z===0)return{line:0,col:$};let X=this.lineStarts[Z-1];return{line:Z,col:$-X+1}}}}iV.LineCounter=AZ});var P8=A((aV)=>{var rV=N0("process"),IZ=A2(),sV=F8();function t0($,Z){for(let z=0;z<$.length;++z)if($[z].type===Z)return!0;return!1}function wZ($){for(let Z=0;Z<$.length;++Z)switch($[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function RZ($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function w2($){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 v$($){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 FZ($){if($.start.type==="flow-seq-start"){for(let Z of $.items)if(Z.sep&&!Z.value&&!t0(Z.start,"explicit-key-ind")&&!t0(Z.sep,"map-value-ind")){if(Z.key)Z.value=Z.key;if(delete Z.key,RZ(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 PZ{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 sV.Lexer,this.onNewLine=$}*parse($,Z=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let z of this.lexer.lex($,Z))yield*this.next(z);if(!Z)yield*this.end()}*next($){if(this.source=$,rV.env.LOG_TOKENS)console.log("|",IZ.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let Z=IZ.tokenType($);if(!Z){let z=`Not a YAML token: ${$}`;yield*this.pop({type:"error",offset:this.offset,message:z,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 z=this.peek(1);if(Z.type==="block-scalar")Z.indent="indent"in z?z.indent:0;else if(Z.type==="flow-collection"&&z.type==="document")Z.indent=0;if(Z.type==="flow-collection")FZ(Z);switch(z.type){case"document":z.value=Z;break;case"block-scalar":z.props.push(Z);break;case"block-map":{let X=z.items[z.items.length-1];if(X.value){z.items.push({start:[],key:Z,sep:[]}),this.onKeyLine=!0;return}else if(X.sep)X.value=Z;else{Object.assign(X,{key:Z,sep:[]}),this.onKeyLine=!X.explicitKey;return}break}case"block-seq":{let X=z.items[z.items.length-1];if(X.value)z.items.push({start:[],value:Z});else X.value=Z;break}case"flow-collection":{let X=z.items[z.items.length-1];if(!X||X.value)z.items.push({start:[],key:Z,sep:[]});else if(X.sep)X.value=Z;else Object.assign(X,{key:Z,sep:[]});return}default:yield*this.pop(),yield*this.pop(Z)}if((z.type==="document"||z.type==="block-map"||z.type==="block-seq")&&(Z.type==="block-map"||Z.type==="block-seq")){let X=Z.items[Z.items.length-1];if(X&&!X.sep&&!X.value&&X.start.length>0&&wZ(X.start)===-1&&(Z.indent===0||X.start.every((J)=>J.type!=="comment"||J.indent<Z.indent))){if(z.type==="document")z.end=X.start;else z.items.push({start:X.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(wZ($.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=w2(this.peek(2)),z=v$(Z),X;if($.end)X=$.end,X.push(this.sourceToken),delete $.end;else X=[this.sourceToken];let J={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:z,key:$,sep:X}]};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
- `,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 Y=0;Y<Z.sep.length;++Y){let q=Z.sep[Y];switch(q.type){case"newline":Q.push(Y);break;case"space":break;case"comment":if(q.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(o0(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let Q=v$(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(o0(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(DZ(Z.key)&&!o0(Z.sep,"newline")){let Q=v$(Z.start),Y=Z.key,q=Z.sep;q.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:Y,sep:q}]})}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(o0(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&&!o0(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||o0(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=A4(X),J=v$(z);OZ($);let Q=$.end.splice(1,$.end.length);Q.push(this.sourceToken);let Y={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:J,key:$,sep:Q}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=Y}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let Z=this.source.indexOf(`
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 z="end"in Z.value?Z.value.end:void 0;if((Array.isArray(z)?z[z.length-1]:void 0)?.type==="comment")z?.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 X=$.items[$.items.length-2]?.value?.end;if(Array.isArray(X)){Array.prototype.push.apply(X,Z.start),X.push(this.sourceToken),$.items.pop();return}}Z.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let z=!this.onKeyLine&&this.indent===$.indent,X=z&&(Z.sep||Z.explicitKey)&&this.type!=="seq-item-ind",J=[];if(X&&Z.sep&&!Z.value){let Q=[];for(let Y=0;Y<Z.sep.length;++Y){let q=Z.sep[Y];switch(q.type){case"newline":Q.push(Y);break;case"space":break;case"comment":if(q.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(X||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(X||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(t0(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let Q=v$(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(t0(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(RZ(Z.key)&&!t0(Z.sep,"newline")){let Q=v$(Z.start),Y=Z.key,q=Z.sep;q.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:Y,sep:q}]})}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||X)$.items.push({start:J,key:null,sep:[this.sourceToken]});else if(t0(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(X||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&&!t0(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(z)$.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 z="end"in Z.value?Z.value.end:void 0;if((Array.isArray(z)?z[z.length-1]:void 0)?.type==="comment")z?.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 X=$.items[$.items.length-2]?.value?.end;if(Array.isArray(X)){Array.prototype.push.apply(X,Z.start),X.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||t0(Z.start,"seq-item-ind"))$.items.push({start:[this.sourceToken]});else Z.start.push(this.sourceToken);return}if(this.indent>$.indent){let z=this.startBlockValue($);if(z){this.stack.push(z);return}}yield*this.pop(),yield*this.step()}*flowCollection($){let Z=$.items[$.items.length-1];if(this.type==="flow-error-end"){let z;do yield*this.pop(),z=this.peek(1);while(z?.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 X=this.flowScalar(this.type);if(!Z||Z.value)$.items.push({start:[],key:X,sep:[]});else if(Z.sep)this.stack.push(X);else Object.assign(Z,{key:X,sep:[]});return}case"flow-map-end":case"flow-seq-end":$.end.push(this.sourceToken);return}let z=this.startBlockValue($);if(z)this.stack.push(z);else yield*this.pop(),yield*this.step()}else{let z=this.peek(2);if(z.type==="block-map"&&(this.type==="map-value-ind"&&z.indent===$.indent||this.type==="newline"&&!z.items[z.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&z.type!=="flow-collection"){let X=w2(z),J=v$(X);FZ($);let Q=$.end.splice(1,$.end.length);Q.push(this.sourceToken);let Y={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:J,key:$,sep:Q}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=Y}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=A4($),X=v$(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=A4($),X=v$(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()}}}mV.Parser=AZ});var PZ=A((aV)=>{var wZ=U8(),cV=b1(),h1=x1(),pV=D6(),lV=v(),iV=D8(),IZ=A8();function FZ($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new iV.LineCounter||null,prettyErrors:Z}}function nV($,Z={}){let{lineCounter:X,prettyErrors:z}=FZ(Z),J=new IZ.Parser(X?.addNewLine),Q=new wZ.Composer(Z),Y=Array.from(Q.compose(J.parse($)));if(z&&X)for(let q of Y)q.errors.forEach(h1.prettifyError($,X)),q.warnings.forEach(h1.prettifyError($,X));if(Y.length>0)return Y;return Object.assign([],{empty:!0},Q.streamInfo())}function RZ($,Z={}){let{lineCounter:X,prettyErrors:z}=FZ(Z),J=new IZ.Parser(X?.addNewLine),Q=new wZ.Composer(Z),Y=null;for(let q of Q.compose(J.parse($),!0,$.length))if(!Y)Y=q;else if(Y.options.logLevel!=="silent"){Y.errors.push(new h1.YAMLParseError(q.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&X)Y.errors.forEach(h1.prettifyError($,X)),Y.warnings.forEach(h1.prettifyError($,X));return Y}function rV($,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=RZ($,X);if(!J)return null;if(J.warnings.forEach((Q)=>pV.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 sV($,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(lV.isDocument($)&&!z)return $.toString(X);return new cV.Document($,z,X).toString(X)}aV.parse=rV;aV.parseAllDocuments=nV;aV.parseDocument=RZ;aV.stringify=sV});var SZ={};Z9(SZ,{orange:()=>E0,italic:()=>uK,fafCyan:()=>I,dim:()=>L,bold:()=>k});var F8=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,k,L,uK,I=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,E0=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var p=S(()=>{k=F8("1"),L=F8("2"),uK=F8("3")});var x8=A((dO,sH)=>{sH.exports={name:"faf-cli",version:"6.6.1",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 --outdir dist --target=node --minify --sourcemap=linked --external faf-scoring-kernel --external open && bun build src/index.ts --outdir dist --target=node --minify --sourcemap=linked --external faf-scoring-kernel --external open",compile:"bun build src/cli.ts --compile --bytecode --minify --outfile faf","compile:all":"bun build src/cli.ts --compile --bytecode --minify --target=bun-darwin-arm64 --outfile faf-darwin-arm64 && bun build src/cli.ts --compile --bytecode --minify --target=bun-darwin-x64 --outfile faf-darwin-x64 && bun build src/cli.ts --compile --bytecode --minify --target=bun-linux-x64 --outfile faf-linux-x64 && bun build src/cli.ts --compile --bytecode --minify --target=bun-windows-x64 --outfile faf-windows-x64.exe",test:"bun test --timeout=30000","test:watch":"bun test --watch --timeout=30000",lint:"eslint src/**/*.ts",format:"prettier --write 'src/**/*.ts'","check:no-hardcode":"! grep -rEln '/(Users|home/runner|private/var)/' dist/ || (echo '❌ Hardcoded build-machine path leaked into dist — see grep output above. Externalize the offending dep in the build script.'; exit 1)",prepublishOnly:"bun run build && bun run check:no-hardcode"},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:"^11.0.0",yaml:"^2.4.1"},optionalDependencies:{"@anthropic-ai/sdk":"^0.91.1"},devDependencies:{"@types/node":"^22.15.0","@typescript-eslint/eslint-plugin":"^8.41.0","@typescript-eslint/parser":"^8.41.0",eslint:"^9.39.2",prettier:"^3.2.5",typescript:"^5.3.3","typescript-eslint":"^8.59.1"},engines:{node:">=18.0.0"},publishConfig:{access:"public"}}});function w($,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 H($,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 h0=()=>{};var f8=function(){let{crypto:$}=globalThis;if($?.randomUUID)return f8=$.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 v0($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var l1=($)=>{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 P,X0,W0,X$,p$,l$,i$,n$,r$,s$,a$,o$,t$;var B0=S(()=>{P=class P extends Error{};X0=class X0 extends P{constructor($,Z,X,z,J){super(`${X0.makeMessage($,Z,X)}`);this.status=$,this.headers=z,this.requestID=z?.get("request-id"),this.error=Z,this.type=J??null}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 X$({message:X,cause:l1(Z)});let J=Z,Q=J?.error?.type;if($===400)return new l$($,J,X,z,Q);if($===401)return new i$($,J,X,z,Q);if($===403)return new n$($,J,X,z,Q);if($===404)return new r$($,J,X,z,Q);if($===409)return new s$($,J,X,z,Q);if($===422)return new a$($,J,X,z,Q);if($===429)return new o$($,J,X,z,Q);if($>=500)return new t$($,J,X,z,Q);return new X0($,J,X,z,Q)}};W0=class W0 extends X0{constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}};X$=class X$ extends X0{constructor({message:$,cause:Z}){super(void 0,void 0,$||"Connection error.",void 0);if(Z)this.cause=Z}};p$=class p$ extends X${constructor({message:$}={}){super({message:$??"Request timed out."})}};l$=class l$ extends X0{};i$=class i$ extends X0{};n$=class n$ extends X0{};r$=class r$ extends X0{};s$=class s$ extends X0{};a$=class a$ extends X0{};o$=class o$ extends X0{};t$=class t$ extends X0{}});function C4($){if(typeof $!=="object")return{};return $??{}}function v8($){if(!$)return!0;for(let Z in $)return!1;return!0}function hX($,Z){return Object.prototype.hasOwnProperty.call($,Z)}var wB,gX=($)=>{return wB.test($)},g8=($)=>(g8=Array.isArray,g8($)),h8,vX=($,Z)=>{if(typeof Z!=="number"||!Number.isInteger(Z))throw new P(`${$} must be an integer`);if(Z<0)throw new P(`${$} must be a positive integer`);return Z},j4=($)=>{try{return JSON.parse($)}catch(Z){return}};var A$=S(()=>{B0();wB=/^[a-z][a-z0-9+.-]*:/i,h8=g8});var uX=($)=>new Promise((Z)=>setTimeout(Z,$));var z$="0.91.1";function IB(){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 RB(){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,Y=z[3]||0;return{browser:Z,version:`${J}.${Q}.${Y}`}}}return null}var pX=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"},FB=()=>{let $=IB();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":z$,"X-Stainless-OS":dX(Deno.build.os),"X-Stainless-Arch":mX(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":z$,"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":z$,"X-Stainless-OS":dX(globalThis.process.platform??"unknown"),"X-Stainless-Arch":mX(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let Z=RB();if(Z)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":z$,"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":z$,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},mX=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},dX=($)=>{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"},cX,lX=()=>{return cX??(cX=FB())};var u8=()=>{};function iX(){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 m8(...$){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 S4($){let Z=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return m8({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 i1($){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 nX($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let Z=$.getReader(),X=Z.cancel();Z.releaseLock(),await X}var rX=({headers:$,body:Z})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(Z)}};function sX($){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 P(`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("&")}var aX=S(()=>{B0()});function eX($){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 n1($){let Z;return(oX??(Z=new globalThis.TextEncoder,oX=Z.encode.bind(Z)))($)}function d8($){let Z;return(tX??(Z=new globalThis.TextDecoder,tX=Z.decode.bind(Z)))($)}var oX,tX;class J${constructor(){T0.set(this,void 0),M0.set(this,void 0),w(this,T0,new Uint8Array,"f"),w(this,M0,null,"f")}decode($){if($==null)return[];let Z=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?n1($):$;w(this,T0,eX([H(this,T0,"f"),Z]),"f");let X=[],z;while((z=_B(H(this,T0,"f"),H(this,M0,"f")))!=null){if(z.carriage&&H(this,M0,"f")==null){w(this,M0,z.index,"f");continue}if(H(this,M0,"f")!=null&&(z.index!==H(this,M0,"f")+1||z.carriage)){X.push(d8(H(this,T0,"f").subarray(0,H(this,M0,"f")-1))),w(this,T0,H(this,T0,"f").subarray(H(this,M0,"f")),"f"),w(this,M0,null,"f");continue}let J=H(this,M0,"f")!==null?z.preceding-1:z.preceding,Q=d8(H(this,T0,"f").subarray(0,J));X.push(Q),w(this,T0,H(this,T0,"f").subarray(z.index),"f"),w(this,M0,null,"f")}return X}flush(){if(!H(this,T0,"f").length)return[];return this.decode(`
166
- `)}}function _B($,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 $7($){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 T0,M0;var c8=S(()=>{h0();T0=new WeakMap,M0=new WeakMap;J$.NEWLINE_CHARS=new Set([`
167
- `,"\r"]);J$.NEWLINE_REGEXP=/\r\n|[\n\r]/g});function r1(){}function b4($,Z,X){if(!Z||x4[$]>x4[X])return r1;else return Z[$].bind(Z)}function q0($){let Z=$.logger,X=$.logLevel??"off";if(!Z)return CB;let z=Z7.get(Z);if(z&&z[0]===X)return z[1];let J={error:b4("error",Z,X),warn:b4("warn",Z,X),info:b4("info",Z,X),debug:b4("debug",Z,X)};return Z7.set(Z,[X,J]),J}var x4,p8=($,Z,X)=>{if(!$)return;if(hX(x4,$))return $;q0(X).warn(`${Z} was set to ${JSON.stringify($)}, expected one of ${JSON.stringify(Object.keys(x4))}`);return},CB,Z7,u0=($)=>{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 y4=S(()=>{A$();x4={off:0,error:200,warn:300,info:400,debug:500};CB={error:r1,warn:r1,info:r1,debug:r1},Z7=new WeakMap});async function*jB($,Z){if(!$.body){if(Z.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new P("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 P("Attempted to iterate over a response with no body")}let X=new X7,z=new J$,J=i1($.body);for await(let Q of SB(J))for(let Y of z.decode(Q)){let q=X.decode(Y);if(q)yield q}for(let Q of z.flush()){let Y=X.decode(Q);if(Y)yield Y}}async function*SB($){let Z=new Uint8Array;for await(let X of $){if(X==null)continue;let z=X instanceof ArrayBuffer?new Uint8Array(X):typeof X==="string"?n1(X):X,J=new Uint8Array(Z.length+z.length);J.set(Z),J.set(z,Z.length),Z=J;let Q;while((Q=$7(Z))!==-1)yield Z.slice(0,Q),Z=Z.slice(Q)}if(Z.length>0)yield Z}class X7{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 s1,O0;var l8=S(()=>{h0();B0();c8();A$();y4();B0();O0=class O0{constructor($,Z,X){this.iterator=$,s1.set(this,void 0),this.controller=Z,w(this,s1,X,"f")}static fromSSEResponse($,Z,X){let z=!1,J=X?q0(X):console;async function*Q(){if(z)throw new P("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");z=!0;let Y=!1;try{for await(let q of jB($,Z)){if(q.event==="completion")try{yield JSON.parse(q.data)}catch(G){throw J.error("Could not parse message into JSON:",q.data),J.error("From chunk:",q.raw),G}if(q.event==="message_start"||q.event==="message_delta"||q.event==="message_stop"||q.event==="content_block_start"||q.event==="content_block_delta"||q.event==="content_block_stop"||q.event==="message"||q.event==="user.message"||q.event==="user.interrupt"||q.event==="user.tool_confirmation"||q.event==="user.custom_tool_result"||q.event==="agent.message"||q.event==="agent.thinking"||q.event==="agent.tool_use"||q.event==="agent.tool_result"||q.event==="agent.mcp_tool_use"||q.event==="agent.mcp_tool_result"||q.event==="agent.custom_tool_use"||q.event==="agent.thread_context_compacted"||q.event==="session.status_running"||q.event==="session.status_idle"||q.event==="session.status_rescheduled"||q.event==="session.status_terminated"||q.event==="session.error"||q.event==="session.deleted"||q.event==="span.model_request_start"||q.event==="span.model_request_end")try{yield JSON.parse(q.data)}catch(G){throw J.error("Could not parse message into JSON:",q.data),J.error("From chunk:",q.raw),G}if(q.event==="ping")continue;if(q.event==="error"){let G=j4(q.data)??q.data,W=G?.error?.type;throw new X0(void 0,G,void 0,$.headers,W)}}Y=!0}catch(q){if(v0(q))return;throw q}finally{if(!Y)Z.abort()}}return new O0(Q,Z,X)}static fromReadableStream($,Z,X){let z=!1;async function*J(){let Y=new J$,q=i1($);for await(let G of q)for(let W of Y.decode(G))yield W;for(let G of Y.flush())yield G}async function*Q(){if(z)throw new P("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");z=!0;let Y=!1;try{for await(let q of J()){if(Y)continue;if(q)yield JSON.parse(q)}Y=!0}catch(q){if(v0(q))return;throw q}finally{if(!Y)Z.abort()}}return new O0(Q,Z,X)}[(s1=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 O0(()=>z($),this.controller,H(this,s1,"f")),new O0(()=>z(Z),this.controller,H(this,s1,"f"))]}toReadableStream(){let $=this,Z;return m8({async start(){Z=$[Symbol.asyncIterator]()},async pull(X){try{let{value:z,done:J}=await Z.next();if(J)return X.close();let Q=n1(JSON.stringify(z)+`
169
- `);X.enqueue(Q)}catch(z){X.error(z)}},async cancel(){await Z.return?.()}})}}});async function k4($,Z){let{response:X,requestLogID:z,retryOfRequestLogID:J,startTime:Q}=Z,Y=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 O0.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 K=await X.json();return i8(K,X)}return await X.text()})();return q0($).debug(`[${z}] response parsed`,u0({retryOfRequestLogID:J,url:X.url,status:X.status,body:Y,durationMs:Date.now()-Q})),Y}function i8($,Z){if(!$||typeof $!=="object"||Array.isArray($))return $;return Object.defineProperty($,"_request_id",{value:Z.headers.get("request-id"),enumerable:!1})}var n8=S(()=>{l8();y4()});var a1,Q$;var f4=S(()=>{h0();n8();Q$=class Q$ extends Promise{constructor($,Z,X=k4){super((z)=>{z(null)});this.responsePromise=Z,this.parseResponse=X,a1.set(this,void 0),w(this,a1,$,"f")}_thenUnwrap($){return new Q$(H(this,a1,"f"),this.responsePromise,async(Z,X)=>i8($(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(H(this,a1,"f"),$));return this.parsedPromise}then($,Z){return this.parse().then($,Z)}catch($){return this.parse().catch($)}finally($){return this.parse().finally($)}};a1=new WeakMap});var g4,r8,o1,j0,l;var t=S(()=>{h0();B0();n8();f4();A$();r8=class r8{constructor($,Z,X,z){g4.set(this,void 0),w(this,g4,$,"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 P("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await H(this,g4,"f").requestAPIList(this.constructor,$)}async*iterPages(){let $=this;yield $;while($.hasNextPage())$=await $.getNextPage(),yield $}async*[(g4=new WeakMap,Symbol.asyncIterator)](){for await(let $ of this.iterPages())for(let Z of $.getPaginatedItems())yield Z}};o1=class o1 extends Q${constructor($,Z,X){super($,Z,async(z,J)=>new X(z,J.response,await k4(z,J),J.options))}async*[Symbol.asyncIterator](){let $=await this;for await(let Z of $)yield Z}};j0=class j0 extends r8{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:{...C4(this.options.query),before_id:Z}}}let $=this.last_id;if(!$)return null;return{...this.options,query:{...C4(this.options.query),after_id:$}}}};l=class l extends r8{constructor($,Z,X,z){super($,Z,X,z);this.data=X.data||[],this.next_page=X.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let $=this.next_page;if(!$)return null;return{...this.options,query:{...C4(this.options.query),page:$}}}}});function w$($,Z,X){return a8(),new File($,Z??"unknown_file",X)}function t1($,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 yB($){let Z=typeof $==="function"?$:$.fetch,X=z7.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 z7.set(Z,z),z}var a8=()=>{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`.":""))}},o8=($)=>$!=null&&typeof $==="object"&&typeof $[Symbol.asyncIterator]==="function",e$=async($,Z,X=!0)=>{return{...$,body:await kB($.body,Z,X)}},z7,kB=async($,Z,X=!0)=>{if(!await yB(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])=>s8(z,J,Q,X))),z},fB=($)=>$ instanceof Blob&&("name"in $),s8=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,w$([await X.blob()],t1(X,z),J))}else if(o8(X))$.append(Z,w$([await new Response(S4(X)).blob()],t1(X,z)));else if(fB(X))$.append(Z,w$([X],t1(X,z),{type:X.type}));else if(Array.isArray(X))await Promise.all(X.map((J)=>s8($,Z+"[]",J,z)));else if(typeof X==="object")await Promise.all(Object.entries(X).map(([J,Q])=>s8($,`${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 $1=S(()=>{z7=new WeakMap});async function e1($,Z,X){if(a8(),$=await $,Z||(Z=t1($,!0)),gB($)){if($ instanceof File&&Z==null&&X==null)return $;return w$([await $.arrayBuffer()],Z??$.name,{type:$.type,lastModified:$.lastModified,...X})}if(hB($)){let J=await $.blob();return Z||(Z=new URL($.url).pathname.split(/[\\/]/).pop()),w$(await t8(J),Z,X)}let z=await t8($);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 w$(z,Z,X)}async function t8($){let Z=[];if(typeof $==="string"||ArrayBuffer.isView($)||$ instanceof ArrayBuffer)Z.push($);else if(J7($))Z.push($ instanceof Blob?$:await $.arrayBuffer());else if(o8($))for await(let X of $)Z.push(...await t8(X));else{let X=$?.constructor?.name;throw Error(`Unexpected data type: ${typeof $}${X?`; constructor: ${X}`:""}${vB($)}`)}return Z}function vB($){if(typeof $!=="object"||$===null)return"";return`; props: [${Object.getOwnPropertyNames($).map((X)=>`"${X}"`).join(", ")}]`}var J7=($)=>$!=null&&typeof $==="object"&&typeof $.size==="number"&&typeof $.type==="string"&&typeof $.text==="function"&&typeof $.slice==="function"&&typeof $.arrayBuffer==="function",gB=($)=>$!=null&&typeof $==="object"&&typeof $.name==="string"&&typeof $.lastModified==="number"&&J7($),hB=($)=>$!=null&&typeof $==="object"&&typeof $.url==="string"&&typeof $.blob==="function";var Q7=S(()=>{$1();$1()});var e8=S(()=>{Q7()});var Y7=()=>{};class f{constructor($){this._client=$}}function*mB($){if(!$)return;if(q7 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(h8($))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=h8(z[1])?z[1]:[z[1]],Y=!1;for(let q of Q){if(q===void 0)continue;if(Z&&!Y)Y=!0,yield[J,null];yield[J,q]}}}var q7,T=($)=>{let Z=new Headers,X=new Set;for(let z of $){let J=new Set;for(let[Q,Y]of mB(z)){let q=Q.toLowerCase();if(!J.has(q))Z.delete(Q),J.add(q);if(Y===null)Z.delete(Q),X.add(q);else Z.append(Q,Y),X.delete(q)}}return{[q7]:!0,values:Z,nulls:X}};var r=S(()=>{A$();q7=Symbol.for("brand.privateNullableHeaders")});function W7($){return $.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var G7,dB=($=W7)=>function(X,...z){if(X.length===1)return X[0];let J=!1,Q=[],Y=X.reduce((U,V,K)=>{if(/[?#]/.test(V))J=!0;let N=z[K],O=(J?encodeURIComponent:$)(""+N);if(K!==z.length&&(N==null||typeof N==="object"&&N.toString===Object.getPrototypeOf(Object.getPrototypeOf(N.hasOwnProperty??G7)??G7)?.toString))O=N+"",Q.push({start:U.length+V.length,length:O.length,error:`Value of type ${Object.prototype.toString.call(N).slice(8,-1)} is not a valid path parameter`});return U+V+(K===z.length?"":O)},""),q=Y.split(/[?#]/,1)[0],G=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,W;while((W=G.exec(q))!==null)Q.push({start:W.index,length:W[0].length,error:`Value "${W[0]}" can't be safely passed as a path parameter`});if(Q.sort((U,V)=>U.start-V.start),Q.length>0){let U=0,V=Q.reduce((K,N)=>{let O=" ".repeat(N.start-U),B="^".repeat(N.length);return U=N.start+N.length,K+O+B},"");throw new P(`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=w2($),z=v$(Z);return z.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let Z=w2($),z=v$(Z);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,Z){if(this.type!=="comment")return!1;if(this.indent<=Z)return!1;return $.every((z)=>z.type==="newline"||z.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()}}}aV.Parser=PZ});var SZ=A((QK)=>{var _Z=L8(),tV=x1(),v1=y1(),eV=R6(),$K=m(),ZK=R8(),EZ=P8();function CZ($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new ZK.LineCounter||null,prettyErrors:Z}}function zK($,Z={}){let{lineCounter:z,prettyErrors:X}=CZ(Z),J=new EZ.Parser(z?.addNewLine),Q=new _Z.Composer(Z),Y=Array.from(Q.compose(J.parse($)));if(X&&z)for(let q of Y)q.errors.forEach(v1.prettifyError($,z)),q.warnings.forEach(v1.prettifyError($,z));if(Y.length>0)return Y;return Object.assign([],{empty:!0},Q.streamInfo())}function jZ($,Z={}){let{lineCounter:z,prettyErrors:X}=CZ(Z),J=new EZ.Parser(z?.addNewLine),Q=new _Z.Composer(Z),Y=null;for(let q of Q.compose(J.parse($),!0,$.length))if(!Y)Y=q;else if(Y.options.logLevel!=="silent"){Y.errors.push(new v1.YAMLParseError(q.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(X&&z)Y.errors.forEach(v1.prettifyError($,z)),Y.warnings.forEach(v1.prettifyError($,z));return Y}function XK($,Z,z){let X=void 0;if(typeof Z==="function")X=Z;else if(z===void 0&&Z&&typeof Z==="object")z=Z;let J=jZ($,z);if(!J)return null;if(J.warnings.forEach((Q)=>eV.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:X},z))}function JK($,Z,z){let X=null;if(typeof Z==="function"||Array.isArray(Z))X=Z;else if(z===void 0&&Z)z=Z;if(typeof z==="string")z=z.length;if(typeof z==="number"){let J=Math.round(z);z=J<1?void 0:J>8?{indent:8}:{indent:J}}if($===void 0){let{keepUndefined:J}=z??Z??{};if(!J)return}if($K.isDocument($)&&!X)return $.toString(z);return new tV.Document($,X,z).toString(z)}QK.parse=XK;QK.parseAllDocuments=zK;QK.parseDocument=jZ;QK.stringify=JK});var fZ={};Y9(fZ,{orange:()=>E0,italic:()=>sK,fafCyanDeep:()=>R2,fafCyan:()=>w,dim:()=>N,bold:()=>k,FAF_HEX:()=>m1});var C8=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,k,N,sK,m1,w=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,R2=($)=>`\x1B[38;2;14;140;140m${$}\x1B[0m`,E0=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var p=S(()=>{k=C8("1"),N=C8("2"),sK=C8("3"),m1={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"}});var h8=A((FD,NB)=>{NB.exports={name:"faf-cli",version:"6.7.0",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 --outdir dist --target=node --minify --sourcemap=linked --external faf-scoring-kernel --external open && bun build src/index.ts --outdir dist --target=node --minify --sourcemap=linked --external faf-scoring-kernel --external open",compile:"bun build src/cli.ts --compile --bytecode --minify --outfile faf","compile:all":"bun build src/cli.ts --compile --bytecode --minify --target=bun-darwin-arm64 --outfile faf-darwin-arm64 && bun build src/cli.ts --compile --bytecode --minify --target=bun-darwin-x64 --outfile faf-darwin-x64 && bun build src/cli.ts --compile --bytecode --minify --target=bun-linux-x64 --outfile faf-linux-x64 && bun build src/cli.ts --compile --bytecode --minify --target=bun-windows-x64 --outfile faf-windows-x64.exe",test:"bun test --timeout=30000","test:watch":"bun test --watch --timeout=30000",lint:"eslint src/**/*.ts",format:"prettier --write 'src/**/*.ts'","check:no-hardcode":"! grep -rEln '/(Users|home/runner|private/var)/' dist/ || (echo '❌ Hardcoded build-machine path leaked into dist — see grep output above. Externalize the offending dep in the build script.'; exit 1)",prepublishOnly:"bun run build && bun run check:no-hardcode"},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:"^11.0.0",yaml:"^2.4.1"},optionalDependencies:{"@anthropic-ai/sdk":"^0.91.1"},devDependencies:{"@types/node":"^22.15.0","@typescript-eslint/eslint-plugin":"^8.41.0","@typescript-eslint/parser":"^8.41.0",eslint:"^9.39.2",prettier:"^3.2.5",typescript:"^5.3.3","typescript-eslint":"^8.59.1"},engines:{node:">=18.0.0"},publishConfig:{access:"public"}}});function I($,Z,z,X,J){if(X==="m")throw TypeError("Private method is not writable");if(X==="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 X==="a"?J.call($,z):J?J.value=z:Z.set($,z),z}function H($,Z,z,X){if(z==="a"&&!X)throw TypeError("Private accessor was defined without a getter");if(typeof Z==="function"?$!==Z||!X:!Z.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return z==="m"?X:z==="a"?X.call($):X?X.value:Z.get($)}var v0=()=>{};var m8=function(){let{crypto:$}=globalThis;if($?.randomUUID)return m8=$.randomUUID.bind($),$.randomUUID();let Z=new Uint8Array(1),z=$?()=>$.getRandomValues(Z)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(X)=>(+X^z()&15>>+X/4).toString(16))};function u0($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var n1=($)=>{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 P,z0,U0,z$,l$,i$,n$,r$,s$,a$,o$,t$,e$;var B0=S(()=>{P=class P extends Error{};z0=class z0 extends P{constructor($,Z,z,X,J){super(`${z0.makeMessage($,Z,z)}`);this.status=$,this.headers=X,this.requestID=X?.get("request-id"),this.error=Z,this.type=J??null}static makeMessage($,Z,z){let X=Z?.message?typeof Z.message==="string"?Z.message:JSON.stringify(Z.message):Z?JSON.stringify(Z):z;if($&&X)return`${$} ${X}`;if($)return`${$} status code (no body)`;if(X)return X;return"(no status code or body)"}static generate($,Z,z,X){if(!$||!X)return new z$({message:z,cause:n1(Z)});let J=Z,Q=J?.error?.type;if($===400)return new i$($,J,z,X,Q);if($===401)return new n$($,J,z,X,Q);if($===403)return new r$($,J,z,X,Q);if($===404)return new s$($,J,z,X,Q);if($===409)return new a$($,J,z,X,Q);if($===422)return new o$($,J,z,X,Q);if($===429)return new t$($,J,z,X,Q);if($>=500)return new e$($,J,z,X,Q);return new z0($,J,z,X,Q)}};U0=class U0 extends z0{constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}};z$=class z$ extends z0{constructor({message:$,cause:Z}){super(void 0,void 0,$||"Connection error.",void 0);if(Z)this.cause=Z}};l$=class l$ extends z${constructor({message:$}={}){super({message:$??"Request timed out."})}};i$=class i$ extends z0{};n$=class n$ extends z0{};r$=class r$ extends z0{};s$=class s$ extends z0{};a$=class a$ extends z0{};o$=class o$ extends z0{};t$=class t$ extends z0{};e$=class e$ extends z0{}});function y2($){if(typeof $!=="object")return{};return $??{}}function p8($){if(!$)return!0;for(let Z in $)return!1;return!0}function n7($,Z){return Object.prototype.hasOwnProperty.call($,Z)}var cB,i7=($)=>{return cB.test($)},d8=($)=>(d8=Array.isArray,d8($)),c8,r7=($,Z)=>{if(typeof Z!=="number"||!Number.isInteger(Z))throw new P(`${$} must be an integer`);if(Z<0)throw new P(`${$} must be a positive integer`);return Z},k2=($)=>{try{return JSON.parse($)}catch(Z){return}};var A$=S(()=>{B0();cB=/^[a-z][a-z0-9+.-]*:/i,c8=d8});var s7=($)=>new Promise((Z)=>setTimeout(Z,$));var X$="0.91.1";function pB(){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 iB(){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:z}of $){let X=z.exec(navigator.userAgent);if(X){let J=X[1]||0,Q=X[2]||0,Y=X[3]||0;return{browser:Z,version:`${J}.${Q}.${Y}`}}}return null}var e7=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"},lB=()=>{let $=pB();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":X$,"X-Stainless-OS":o7(Deno.build.os),"X-Stainless-Arch":a7(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":X$,"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":X$,"X-Stainless-OS":o7(globalThis.process.platform??"unknown"),"X-Stainless-Arch":a7(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let Z=iB();if(Z)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":X$,"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":X$,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},a7=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},o7=($)=>{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"},t7,$z=()=>{return t7??(t7=lB())};var l8=()=>{};function Zz(){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 i8(...$){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 i8({start(){},async pull(z){let{done:X,value:J}=await Z.next();if(X)z.close();else z.enqueue(J)},async cancel(){await Z.return?.()}})}function r1($){if($[Symbol.asyncIterator])return $;let Z=$.getReader();return{async next(){try{let z=await Z.read();if(z?.done)Z.releaseLock();return z}catch(z){throw Z.releaseLock(),z}},async return(){let z=Z.cancel();return Z.releaseLock(),await z,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function zz($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let Z=$.getReader(),z=Z.cancel();Z.releaseLock(),await z}var Xz=({headers:$,body:Z})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(Z)}};function Jz($){return Object.entries($).filter(([Z,z])=>typeof z<"u").map(([Z,z])=>{if(typeof z==="string"||typeof z==="number"||typeof z==="boolean")return`${encodeURIComponent(Z)}=${encodeURIComponent(z)}`;if(z===null)return`${encodeURIComponent(Z)}=`;throw new P(`Cannot stringify type ${typeof z}; 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("&")}var Qz=S(()=>{B0()});function Wz($){let Z=0;for(let J of $)Z+=J.length;let z=new Uint8Array(Z),X=0;for(let J of $)z.set(J,X),X+=J.length;return z}function s1($){let Z;return(Yz??(Z=new globalThis.TextEncoder,Yz=Z.encode.bind(Z)))($)}function n8($){let Z;return(qz??(Z=new globalThis.TextDecoder,qz=Z.decode.bind(Z)))($)}var Yz,qz;class J${constructor(){T0.set(this,void 0),M0.set(this,void 0),I(this,T0,new Uint8Array,"f"),I(this,M0,null,"f")}decode($){if($==null)return[];let Z=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?s1($):$;I(this,T0,Wz([H(this,T0,"f"),Z]),"f");let z=[],X;while((X=sB(H(this,T0,"f"),H(this,M0,"f")))!=null){if(X.carriage&&H(this,M0,"f")==null){I(this,M0,X.index,"f");continue}if(H(this,M0,"f")!=null&&(X.index!==H(this,M0,"f")+1||X.carriage)){z.push(n8(H(this,T0,"f").subarray(0,H(this,M0,"f")-1))),I(this,T0,H(this,T0,"f").subarray(H(this,M0,"f")),"f"),I(this,M0,null,"f");continue}let J=H(this,M0,"f")!==null?X.preceding-1:X.preceding,Q=n8(H(this,T0,"f").subarray(0,J));z.push(Q),I(this,T0,H(this,T0,"f").subarray(X.index),"f"),I(this,M0,null,"f")}return z}flush(){if(!H(this,T0,"f").length)return[];return this.decode(`
166
+ `)}}function sB($,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 Gz($){for(let X=0;X<$.length-1;X++){if($[X]===10&&$[X+1]===10)return X+2;if($[X]===13&&$[X+1]===13)return X+2;if($[X]===13&&$[X+1]===10&&X+3<$.length&&$[X+2]===13&&$[X+3]===10)return X+4}return-1}var T0,M0;var r8=S(()=>{v0();T0=new WeakMap,M0=new WeakMap;J$.NEWLINE_CHARS=new Set([`
167
+ `,"\r"]);J$.NEWLINE_REGEXP=/\r\n|[\n\r]/g});function a1(){}function g2($,Z,z){if(!Z||h2[$]>h2[z])return a1;else return Z[$].bind(Z)}function q0($){let Z=$.logger,z=$.logLevel??"off";if(!Z)return aB;let X=Uz.get(Z);if(X&&X[0]===z)return X[1];let J={error:g2("error",Z,z),warn:g2("warn",Z,z),info:g2("info",Z,z),debug:g2("debug",Z,z)};return Uz.set(Z,[z,J]),J}var h2,s8=($,Z,z)=>{if(!$)return;if(n7(h2,$))return $;q0(z).warn(`${Z} was set to ${JSON.stringify($)}, expected one of ${JSON.stringify(Object.keys(h2))}`);return},aB,Uz,m0=($)=>{if($.options)$.options={...$.options},delete $.options.headers;if($.headers)$.headers=Object.fromEntries(($.headers instanceof Headers?[...$.headers]:Object.entries($.headers)).map(([Z,z])=>[Z,Z.toLowerCase()==="x-api-key"||Z.toLowerCase()==="authorization"||Z.toLowerCase()==="cookie"||Z.toLowerCase()==="set-cookie"?"***":z]));if("retryOfRequestLogID"in $){if($.retryOfRequestLogID)$.retryOf=$.retryOfRequestLogID;delete $.retryOfRequestLogID}return $};var v2=S(()=>{A$();h2={off:0,error:200,warn:300,info:400,debug:500};aB={error:a1,warn:a1,info:a1,debug:a1},Uz=new WeakMap});async function*oB($,Z){if(!$.body){if(Z.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new P("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 P("Attempted to iterate over a response with no body")}let z=new Vz,X=new J$,J=r1($.body);for await(let Q of tB(J))for(let Y of X.decode(Q)){let q=z.decode(Y);if(q)yield q}for(let Q of X.flush()){let Y=z.decode(Q);if(Y)yield Y}}async function*tB($){let Z=new Uint8Array;for await(let z of $){if(z==null)continue;let X=z instanceof ArrayBuffer?new Uint8Array(z):typeof z==="string"?s1(z):z,J=new Uint8Array(Z.length+X.length);J.set(Z),J.set(X,Z.length),Z=J;let Q;while((Q=Gz(Z))!==-1)yield Z.slice(0,Q),Z=Z.slice(Q)}if(Z.length>0)yield Z}class Vz{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,z,X]=eB($,":");if(X.startsWith(" "))X=X.substring(1);if(Z==="event")this.event=X;else if(Z==="data")this.data.push(X);return null}}function eB($,Z){let z=$.indexOf(Z);if(z!==-1)return[$.substring(0,z),Z,$.substring(z+Z.length)];return[$,"",""]}var o1,O0;var a8=S(()=>{v0();B0();r8();A$();v2();B0();O0=class O0{constructor($,Z,z){this.iterator=$,o1.set(this,void 0),this.controller=Z,I(this,o1,z,"f")}static fromSSEResponse($,Z,z){let X=!1,J=z?q0(z):console;async function*Q(){if(X)throw new P("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");X=!0;let Y=!1;try{for await(let q of oB($,Z)){if(q.event==="completion")try{yield JSON.parse(q.data)}catch(W){throw J.error("Could not parse message into JSON:",q.data),J.error("From chunk:",q.raw),W}if(q.event==="message_start"||q.event==="message_delta"||q.event==="message_stop"||q.event==="content_block_start"||q.event==="content_block_delta"||q.event==="content_block_stop"||q.event==="message"||q.event==="user.message"||q.event==="user.interrupt"||q.event==="user.tool_confirmation"||q.event==="user.custom_tool_result"||q.event==="agent.message"||q.event==="agent.thinking"||q.event==="agent.tool_use"||q.event==="agent.tool_result"||q.event==="agent.mcp_tool_use"||q.event==="agent.mcp_tool_result"||q.event==="agent.custom_tool_use"||q.event==="agent.thread_context_compacted"||q.event==="session.status_running"||q.event==="session.status_idle"||q.event==="session.status_rescheduled"||q.event==="session.status_terminated"||q.event==="session.error"||q.event==="session.deleted"||q.event==="span.model_request_start"||q.event==="span.model_request_end")try{yield JSON.parse(q.data)}catch(W){throw J.error("Could not parse message into JSON:",q.data),J.error("From chunk:",q.raw),W}if(q.event==="ping")continue;if(q.event==="error"){let W=k2(q.data)??q.data,G=W?.error?.type;throw new z0(void 0,W,void 0,$.headers,G)}}Y=!0}catch(q){if(u0(q))return;throw q}finally{if(!Y)Z.abort()}}return new O0(Q,Z,z)}static fromReadableStream($,Z,z){let X=!1;async function*J(){let Y=new J$,q=r1($);for await(let W of q)for(let G of Y.decode(W))yield G;for(let W of Y.flush())yield W}async function*Q(){if(X)throw new P("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");X=!0;let Y=!1;try{for await(let q of J()){if(Y)continue;if(q)yield JSON.parse(q)}Y=!0}catch(q){if(u0(q))return;throw q}finally{if(!Y)Z.abort()}}return new O0(Q,Z,z)}[(o1=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let $=[],Z=[],z=this.iterator(),X=(J)=>{return{next:()=>{if(J.length===0){let Q=z.next();$.push(Q),Z.push(Q)}return J.shift()}}};return[new O0(()=>X($),this.controller,H(this,o1,"f")),new O0(()=>X(Z),this.controller,H(this,o1,"f"))]}toReadableStream(){let $=this,Z;return i8({async start(){Z=$[Symbol.asyncIterator]()},async pull(z){try{let{value:X,done:J}=await Z.next();if(J)return z.close();let Q=s1(JSON.stringify(X)+`
169
+ `);z.enqueue(Q)}catch(X){z.error(X)}},async cancel(){await Z.return?.()}})}}});async function u2($,Z){let{response:z,requestLogID:X,retryOfRequestLogID:J,startTime:Q}=Z,Y=await(async()=>{if(Z.options.stream){if(q0($).debug("response",z.status,z.url,z.headers,z.body),Z.options.__streamClass)return Z.options.__streamClass.fromSSEResponse(z,Z.controller);return O0.fromSSEResponse(z,Z.controller)}if(z.status===204)return null;if(Z.options.__binaryResponse)return z;let W=z.headers.get("content-type")?.split(";")[0]?.trim();if(W?.includes("application/json")||W?.endsWith("+json")){if(z.headers.get("content-length")==="0")return;let K=await z.json();return o8(K,z)}return await z.text()})();return q0($).debug(`[${X}] response parsed`,m0({retryOfRequestLogID:J,url:z.url,status:z.status,body:Y,durationMs:Date.now()-Q})),Y}function o8($,Z){if(!$||typeof $!=="object"||Array.isArray($))return $;return Object.defineProperty($,"_request_id",{value:Z.headers.get("request-id"),enumerable:!1})}var t8=S(()=>{a8();v2()});var t1,Q$;var m2=S(()=>{v0();t8();Q$=class Q$ extends Promise{constructor($,Z,z=u2){super((X)=>{X(null)});this.responsePromise=Z,this.parseResponse=z,t1.set(this,void 0),I(this,t1,$,"f")}_thenUnwrap($){return new Q$(H(this,t1,"f"),this.responsePromise,async(Z,z)=>o8($(await this.parseResponse(Z,z),z),z.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(H(this,t1,"f"),$));return this.parsedPromise}then($,Z){return this.parse().then($,Z)}catch($){return this.parse().catch($)}finally($){return this.parse().finally($)}};t1=new WeakMap});var d2,e8,e1,S0,l;var t=S(()=>{v0();B0();t8();m2();A$();e8=class e8{constructor($,Z,z,X){d2.set(this,void 0),I(this,d2,$,"f"),this.options=X,this.response=Z,this.body=z}hasNextPage(){if(!this.getPaginatedItems().length)return!1;return this.nextPageRequestOptions()!=null}async getNextPage(){let $=this.nextPageRequestOptions();if(!$)throw new P("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await H(this,d2,"f").requestAPIList(this.constructor,$)}async*iterPages(){let $=this;yield $;while($.hasNextPage())$=await $.getNextPage(),yield $}async*[(d2=new WeakMap,Symbol.asyncIterator)](){for await(let $ of this.iterPages())for(let Z of $.getPaginatedItems())yield Z}};e1=class e1 extends Q${constructor($,Z,z){super($,Z,async(X,J)=>new z(X,J.response,await u2(X,J),J.options))}async*[Symbol.asyncIterator](){let $=await this;for await(let Z of $)yield Z}};S0=class S0 extends e8{constructor($,Z,z,X){super($,Z,z,X);this.data=z.data||[],this.has_more=z.has_more||!1,this.first_id=z.first_id||null,this.last_id=z.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:{...y2(this.options.query),before_id:Z}}}let $=this.last_id;if(!$)return null;return{...this.options,query:{...y2(this.options.query),after_id:$}}}};l=class l extends e8{constructor($,Z,z,X){super($,Z,z,X);this.data=z.data||[],this.next_page=z.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let $=this.next_page;if(!$)return null;return{...this.options,query:{...y2(this.options.query),page:$}}}}});function I$($,Z,z){return Z3(),new File($,Z??"unknown_file",z)}function $4($,Z){let z=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?z.split(/[\\/]/).pop()||void 0:z}function ZL($){let Z=typeof $==="function"?$:$.fetch,z=Kz.get(Z);if(z)return z;let X=(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 Kz.set(Z,X),X}var Z3=()=>{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`.":""))}},z3=($)=>$!=null&&typeof $==="object"&&typeof $[Symbol.asyncIterator]==="function",$1=async($,Z,z=!0)=>{return{...$,body:await zL($.body,Z,z)}},Kz,zL=async($,Z,z=!0)=>{if(!await ZL(Z))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let X=new FormData;return await Promise.all(Object.entries($||{}).map(([J,Q])=>$3(X,J,Q,z))),X},XL=($)=>$ instanceof Blob&&("name"in $),$3=async($,Z,z,X)=>{if(z===void 0)return;if(z==null)throw TypeError(`Received null for "${Z}"; to pass null in FormData, you must use the string 'null'`);if(typeof z==="string"||typeof z==="number"||typeof z==="boolean")$.append(Z,String(z));else if(z instanceof Response){let J={},Q=z.headers.get("Content-Type");if(Q)J={type:Q};$.append(Z,I$([await z.blob()],$4(z,X),J))}else if(z3(z))$.append(Z,I$([await new Response(f2(z)).blob()],$4(z,X)));else if(XL(z))$.append(Z,I$([z],$4(z,X),{type:z.type}));else if(Array.isArray(z))await Promise.all(z.map((J)=>$3($,Z+"[]",J,X)));else if(typeof z==="object")await Promise.all(Object.entries(z).map(([J,Q])=>$3($,`${Z}[${J}]`,Q,X)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${z} instead`)};var Z1=S(()=>{Kz=new WeakMap});async function Z4($,Z,z){if(Z3(),$=await $,Z||(Z=$4($,!0)),JL($)){if($ instanceof File&&Z==null&&z==null)return $;return I$([await $.arrayBuffer()],Z??$.name,{type:$.type,lastModified:$.lastModified,...z})}if(QL($)){let J=await $.blob();return Z||(Z=new URL($.url).pathname.split(/[\\/]/).pop()),I$(await X3(J),Z,z)}let X=await X3($);if(!z?.type){let J=X.find((Q)=>typeof Q==="object"&&("type"in Q)&&Q.type);if(typeof J==="string")z={...z,type:J}}return I$(X,Z,z)}async function X3($){let Z=[];if(typeof $==="string"||ArrayBuffer.isView($)||$ instanceof ArrayBuffer)Z.push($);else if(Hz($))Z.push($ instanceof Blob?$:await $.arrayBuffer());else if(z3($))for await(let z of $)Z.push(...await X3(z));else{let z=$?.constructor?.name;throw Error(`Unexpected data type: ${typeof $}${z?`; constructor: ${z}`:""}${YL($)}`)}return Z}function YL($){if(typeof $!=="object"||$===null)return"";return`; props: [${Object.getOwnPropertyNames($).map((z)=>`"${z}"`).join(", ")}]`}var Hz=($)=>$!=null&&typeof $==="object"&&typeof $.size==="number"&&typeof $.type==="string"&&typeof $.text==="function"&&typeof $.slice==="function"&&typeof $.arrayBuffer==="function",JL=($)=>$!=null&&typeof $==="object"&&typeof $.name==="string"&&typeof $.lastModified==="number"&&Hz($),QL=($)=>$!=null&&typeof $==="object"&&typeof $.url==="string"&&typeof $.blob==="function";var Bz=S(()=>{Z1();Z1()});var J3=S(()=>{Bz()});var Lz=()=>{};class f{constructor($){this._client=$}}function*WL($){if(!$)return;if(Nz in $){let{values:X,nulls:J}=$;yield*X.entries();for(let Q of J)yield[Q,null];return}let Z=!1,z;if($ instanceof Headers)z=$.entries();else if(c8($))z=$;else Z=!0,z=Object.entries($??{});for(let X of z){let J=X[0];if(typeof J!=="string")throw TypeError("expected header name to be a string");let Q=c8(X[1])?X[1]:[X[1]],Y=!1;for(let q of Q){if(q===void 0)continue;if(Z&&!Y)Y=!0,yield[J,null];yield[J,q]}}}var Nz,T=($)=>{let Z=new Headers,z=new Set;for(let X of $){let J=new Set;for(let[Q,Y]of WL(X)){let q=Q.toLowerCase();if(!J.has(q))Z.delete(Q),J.add(q);if(Y===null)Z.delete(Q),z.add(q);else Z.append(Q,Y),z.delete(q)}}return{[Nz]:!0,values:Z,nulls:z}};var r=S(()=>{A$();Nz=Symbol.for("brand.privateNullableHeaders")});function Mz($){return $.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var Tz,GL=($=Mz)=>function(z,...X){if(z.length===1)return z[0];let J=!1,Q=[],Y=z.reduce((U,V,K)=>{if(/[?#]/.test(V))J=!0;let L=X[K],O=(J?encodeURIComponent:$)(""+L);if(K!==X.length&&(L==null||typeof L==="object"&&L.toString===Object.getPrototypeOf(Object.getPrototypeOf(L.hasOwnProperty??Tz)??Tz)?.toString))O=L+"",Q.push({start:U.length+V.length,length:O.length,error:`Value of type ${Object.prototype.toString.call(L).slice(8,-1)} is not a valid path parameter`});return U+V+(K===X.length?"":O)},""),q=Y.split(/[?#]/,1)[0],W=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,G;while((G=W.exec(q))!==null)Q.push({start:G.index,length:G[0].length,error:`Value "${G[0]}" can't be safely passed as a path parameter`});if(Q.sort((U,V)=>U.start-V.start),Q.length>0){let U=0,V=Q.reduce((K,L)=>{let O=" ".repeat(L.start-U),B="^".repeat(L.length);return U=L.start+L.length,K+O+B},"");throw new P(`Path parameters result in path with invalid segments:
170
170
  ${Q.map((K)=>K.error).join(`
171
171
  `)}
172
172
  ${Y}
173
- ${V}`)}return Y},D;var z0=S(()=>{B0();G7=Object.freeze(Object.create(null)),D=dB(W7)});var $2;var $3=S(()=>{t();r();z0();$2=class $2 extends f{create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/environments?beta=true",{body:z,...Z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(D`/v1/environments/${$}?beta=true`,{...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(D`/v1/environments/${$}?beta=true`,{body:J,...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/environments?beta=true",l,{query:z,...Z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(D`/v1/environments/${$}?beta=true`,{...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(D`/v1/environments/${$}/archive?beta=true`,{...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});function h4($){return typeof $==="object"&&$!==null&&Z2 in $}function Z3($,Z){let X=new Set;if($){for(let z of $)if(h4(z))X.add(z[Z2])}if(Z)for(let z of Z){if(h4(z))X.add(z[Z2]);if(Array.isArray(z.content)){for(let J of z.content)if(h4(J))X.add(J[Z2])}}return Array.from(X)}function v4($,Z){let X=Z3($,Z);if(X.length===0)return{};return{"x-stainless-helper":X.join(", ")}}function U7($){if(h4($))return{"x-stainless-helper":$[Z2]};return{}}var Z2;var X2=S(()=>{Z2=Symbol("anthropic.sdk.stainlessHelper")});var z2;var X3=S(()=>{t();r();X2();$1();z0();z2=class z2 extends f{list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/files?beta=true",j0,{query:z,...Z,headers:T([{"anthropic-beta":[...X??[],"files-api-2025-04-14"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(D`/v1/files/${$}?beta=true`,{...X,headers:T([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString()},X?.headers])})}download($,Z={},X){let{betas:z}=Z??{};return this._client.get(D`/v1/files/${$}/content?beta=true`,{...X,headers:T([{"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(D`/v1/files/${$}?beta=true`,{...X,headers:T([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString()},X?.headers])})}upload($,Z){let{betas:X,...z}=$;return this._client.post("/v1/files?beta=true",e$({body:z,...Z,headers:T([{"anthropic-beta":[...X??[],"files-api-2025-04-14"].toString()},U7(z.file),Z?.headers])},this._client))}}});var J2;var z3=S(()=>{t();r();z0();J2=class J2 extends f{retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(D`/v1/models/${$}?beta=true`,{...X,headers:T([{...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",j0,{query:z,...Z,headers:T([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers])})}}});var Q2;var J3=S(()=>{t();r();z0();Q2=class Q2 extends f{create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/user_profiles?beta=true",{body:z,...Z,headers:T([{"anthropic-beta":[...X??[],"user-profiles-2026-03-24"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(D`/v1/user_profiles/${$}?beta=true`,{...X,headers:T([{"anthropic-beta":[...z??[],"user-profiles-2026-03-24"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(D`/v1/user_profiles/${$}?beta=true`,{body:J,...X,headers:T([{"anthropic-beta":[...z??[],"user-profiles-2026-03-24"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/user_profiles?beta=true",l,{query:z,...Z,headers:T([{"anthropic-beta":[...X??[],"user-profiles-2026-03-24"].toString()},Z?.headers])})}createEnrollmentURL($,Z={},X){let{betas:z}=Z??{};return this._client.post(D`/v1/user_profiles/${$}/enrollment_url?beta=true`,{...X,headers:T([{"anthropic-beta":[...z??[],"user-profiles-2026-03-24"].toString()},X?.headers])})}}});var Y2;var Q3=S(()=>{t();r();z0();Y2=class Y2 extends f{list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(D`/v1/agents/${$}/versions?beta=true`,l,{query:J,...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var Z1;var Y3=S(()=>{Q3();Q3();t();r();z0();Z1=class Z1 extends f{constructor(){super(...arguments);this.versions=new Y2(this._client)}create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/agents?beta=true",{body:z,...Z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z,...J}=Z??{};return this._client.get(D`/v1/agents/${$}?beta=true`,{query:J,...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(D`/v1/agents/${$}?beta=true`,{body:J,...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/agents?beta=true",l,{query:z,...Z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(D`/v1/agents/${$}/archive?beta=true`,{...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};Z1.Versions=Y2});var q2;var q3=S(()=>{t();r();z0();q2=class q2 extends f{create($,Z,X){let{view:z,betas:J,...Q}=Z;return this._client.post(D`/v1/memory_stores/${$}/memories?beta=true`,{query:{view:z},body:Q,...X,headers:T([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}retrieve($,Z,X){let{memory_store_id:z,betas:J,...Q}=Z;return this._client.get(D`/v1/memory_stores/${z}/memories/${$}?beta=true`,{query:Q,...X,headers:T([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{memory_store_id:z,view:J,betas:Q,...Y}=Z;return this._client.post(D`/v1/memory_stores/${z}/memories/${$}?beta=true`,{query:{view:J},body:Y,...X,headers:T([{"anthropic-beta":[...Q??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(D`/v1/memory_stores/${$}/memories?beta=true`,l,{query:J,...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}delete($,Z,X){let{memory_store_id:z,expected_content_sha256:J,betas:Q}=Z;return this._client.delete(D`/v1/memory_stores/${z}/memories/${$}?beta=true`,{query:{expected_content_sha256:J},...X,headers:T([{"anthropic-beta":[...Q??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var G2;var G3=S(()=>{t();r();z0();G2=class G2 extends f{retrieve($,Z,X){let{memory_store_id:z,betas:J,...Q}=Z;return this._client.get(D`/v1/memory_stores/${z}/memory_versions/${$}?beta=true`,{query:Q,...X,headers:T([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(D`/v1/memory_stores/${$}/memory_versions?beta=true`,l,{query:J,...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}redact($,Z,X){let{memory_store_id:z,betas:J}=Z;return this._client.post(D`/v1/memory_stores/${z}/memory_versions/${$}/redact?beta=true`,{...X,headers:T([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var I$;var W3=S(()=>{q3();q3();G3();G3();t();r();z0();I$=class I$ extends f{constructor(){super(...arguments);this.memories=new q2(this._client),this.memoryVersions=new G2(this._client)}create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/memory_stores?beta=true",{body:z,...Z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(D`/v1/memory_stores/${$}?beta=true`,{...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(D`/v1/memory_stores/${$}?beta=true`,{body:J,...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/memory_stores?beta=true",l,{query:z,...Z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(D`/v1/memory_stores/${$}?beta=true`,{...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(D`/v1/memory_stores/${$}/archive?beta=true`,{...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};I$.Memories=q2;I$.MemoryVersions=G2});var X1=S(()=>{B0()});var u4;var U3=S(()=>{u4={"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 V7($){return $?.output_format??$?.output_config?.format}function V3($,Z,X){let z=V7(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 K3($,Z,X)}function K3($,Z,X){let z=null,J=$.content.map((Q)=>{if(Q.type==="text"){let Y=tB(Z,Q.text);if(z===null)z=Y;let q=Object.defineProperty({...Q},"parsed_output",{value:Y,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."),Y},enumerable:!1})}return Q});return{...$,content:J,parsed_output:z}}function tB($,Z){let X=V7($);if(X?.type!=="json_schema")return null;try{if("parse"in X)return X.parse(Z);return JSON.parse(Z)}catch(z){throw new P(`Failed to parse structured output: ${z}`)}}var H3=S(()=>{B0()});var eB=($)=>{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 q="",G=!1;z=$[++Z];while(z!=='"'){if(Z===$.length){G=!0;break}if(z==="\\"){if(Z++,Z===$.length){G=!0;break}q+=z+$[Z],z=$[++Z]}else q+=z,z=$[++Z]}if(z=$[++Z],!G)X.push({type:"string",value:q});continue}if(z&&/\s/.test(z)){Z++;continue}let Q=/[0-9]/;if(z&&Q.test(z)||z==="-"||z==="."){let q="";if(z==="-")q+=z,z=$[++Z];while(z&&Q.test(z)||z===".")q+=z,z=$[++Z];X.push({type:"number",value:q});continue}let Y=/[a-z]/i;if(z&&Y.test(z)){let q="";while(z&&Y.test(z)){if(Z===$.length)break;q+=z,z=$[++Z]}if(q=="true"||q=="false"||q==="null")X.push({type:"name",value:q});else{Z++;continue}continue}Z++}return X},z1=($)=>{if($.length===0)return $;let Z=$[$.length-1];switch(Z.type){case"separator":return $=$.slice(0,$.length-1),z1($);break;case"number":let X=Z.value[Z.value.length-1];if(X==="."||X==="-")return $=$.slice(0,$.length-1),z1($);case"string":let z=$[$.length-2];if(z?.type==="delimiter")return $=$.slice(0,$.length-1),z1($);else if(z?.type==="brace"&&z.value==="{")return $=$.slice(0,$.length-1),z1($);break;case"delimiter":return $=$.slice(0,$.length-1),z1($);break}return $},$N=($)=>{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 $},ZN=($)=>{let Z="";return $.map((X)=>{switch(X.type){case"string":Z+='"'+X.value+'"';break;default:Z+=X.value;break}}),Z},m4=($)=>JSON.parse(ZN($N(z1(eB($)))));var B3=()=>{};var N3=S(()=>{l8()});function N7($){return $.type==="tool_use"||$.type==="server_tool_use"||$.type==="mcp_tool_use"}function L7($){}var I0,Y$,J1,W2,d4,U2,V2,c4,K2,m0,H2,p4,l4,F$,i4,n4,B2,L3,K7,r4,T3,M3,O3,H7,B7="__json_buf",N2;var T7=S(()=>{h0();B3();X1();N3();H3();N2=class N2{constructor($,Z){I0.add(this),this.messages=[],this.receivedMessages=[],Y$.set(this,void 0),J1.set(this,null),this.controller=new AbortController,W2.set(this,void 0),d4.set(this,()=>{}),U2.set(this,()=>{}),V2.set(this,void 0),c4.set(this,()=>{}),K2.set(this,()=>{}),m0.set(this,{}),H2.set(this,!1),p4.set(this,!1),l4.set(this,!1),F$.set(this,!1),i4.set(this,void 0),n4.set(this,void 0),B2.set(this,void 0),r4.set(this,(X)=>{if(w(this,p4,!0,"f"),v0(X))X=new W0;if(X instanceof W0)return w(this,l4,!0,"f"),this._emit("abort",X);if(X instanceof P)return this._emit("error",X);if(X instanceof Error){let z=new P(X.message);return z.cause=X,this._emit("error",z)}return this._emit("error",new P(String(X)))}),w(this,W2,new Promise((X,z)=>{w(this,d4,X,"f"),w(this,U2,z,"f")}),"f"),w(this,V2,new Promise((X,z)=>{w(this,c4,X,"f"),w(this,K2,z,"f")}),"f"),H(this,W2,"f").catch(()=>{}),H(this,V2,"f").catch(()=>{}),w(this,J1,$,"f"),w(this,B2,Z?.logger??console,"f")}get response(){return H(this,i4,"f")}get request_id(){return H(this,n4,"f")}async withResponse(){w(this,F$,!0,"f");let $=await H(this,W2,"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 N2(null);return Z._run(()=>Z._fromReadableStream($)),Z}static createMessage($,Z,X,{logger:z}={}){let J=new N2(Z,{logger:z});for(let Q of Z.messages)J._addMessageParam(Q);return w(J,J1,{...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")},H(this,r4,"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{H(this,I0,"m",T3).call(this);let{response:Q,data:Y}=await $.create({...Z,stream:!0},{...X,signal:this.controller.signal}).withResponse();this._connected(Q);for await(let q of Y)H(this,I0,"m",M3).call(this,q);if(Y.controller.signal?.aborted)throw new W0;H(this,I0,"m",O3).call(this)}finally{if(z&&J)z.removeEventListener("abort",J)}}_connected($){if(this.ended)return;w(this,i4,$,"f"),w(this,n4,$?.headers.get("request-id"),"f"),H(this,d4,"f").call(this,$),this._emit("connect")}get ended(){return H(this,H2,"f")}get errored(){return H(this,p4,"f")}get aborted(){return H(this,l4,"f")}abort(){this.controller.abort()}on($,Z){return(H(this,m0,"f")[$]||(H(this,m0,"f")[$]=[])).push({listener:Z}),this}off($,Z){let X=H(this,m0,"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(H(this,m0,"f")[$]||(H(this,m0,"f")[$]=[])).push({listener:Z,once:!0}),this}emitted($){return new Promise((Z,X)=>{if(w(this,F$,!0,"f"),$!=="error")this.once("error",X);this.once($,Z)})}async done(){w(this,F$,!0,"f"),await H(this,V2,"f")}get currentMessage(){return H(this,Y$,"f")}async finalMessage(){return await this.done(),H(this,I0,"m",L3).call(this)}async finalText(){return await this.done(),H(this,I0,"m",K7).call(this)}_emit($,...Z){if(H(this,H2,"f"))return;if($==="end")w(this,H2,!0,"f"),H(this,c4,"f").call(this);let X=H(this,m0,"f")[$];if(X)H(this,m0,"f")[$]=X.filter((z)=>!z.once),X.forEach(({listener:z})=>z(...Z));if($==="abort"){let z=Z[0];if(!H(this,F$,"f")&&!X?.length)Promise.reject(z);H(this,U2,"f").call(this,z),H(this,K2,"f").call(this,z),this._emit("end");return}if($==="error"){let z=Z[0];if(!H(this,F$,"f")&&!X?.length)Promise.reject(z);H(this,U2,"f").call(this,z),H(this,K2,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",H(this,I0,"m",L3).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{H(this,I0,"m",T3).call(this),this._connected(null);let J=O0.fromReadableStream($,this.controller);for await(let Q of J)H(this,I0,"m",M3).call(this,Q);if(J.controller.signal?.aborted)throw new W0;H(this,I0,"m",O3).call(this)}finally{if(X&&z)X.removeEventListener("abort",z)}}[(Y$=new WeakMap,J1=new WeakMap,W2=new WeakMap,d4=new WeakMap,U2=new WeakMap,V2=new WeakMap,c4=new WeakMap,K2=new WeakMap,m0=new WeakMap,H2=new WeakMap,p4=new WeakMap,l4=new WeakMap,F$=new WeakMap,i4=new WeakMap,n4=new WeakMap,B2=new WeakMap,r4=new WeakMap,I0=new WeakSet,L3=function(){if(this.receivedMessages.length===0)throw new P("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},K7=function(){if(this.receivedMessages.length===0)throw new P("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 P("stream ended without producing a content block with type=text");return Z.join(" ")},T3=function(){if(this.ended)return;w(this,Y$,void 0,"f")},M3=function(Z){if(this.ended)return;let X=H(this,I0,"m",H7).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(N7(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:L7(Z.delta)}break}case"message_stop":{this._addMessageParam(X),this._addMessage(V3(X,H(this,J1,"f"),{logger:H(this,B2,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",X.content.at(-1));break}case"message_start":{w(this,Y$,X,"f");break}case"content_block_start":case"message_delta":break}},O3=function(){if(this.ended)throw new P("stream has ended, this shouldn't happen");let Z=H(this,Y$,"f");if(!Z)throw new P("request ended without sending any chunks");return w(this,Y$,void 0,"f"),V3(Z,H(this,J1,"f"),{logger:H(this,B2,"f")})},H7=function(Z){let X=H(this,Y$,"f");if(Z.type==="message_start"){if(X)throw new P(`Unexpected event order, got ${Z.type} before receiving "message_stop"`);return Z.message}if(!X)throw new P(`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&&N7(z)){let J=z[B7]||"";J+=Z.delta.partial_json;let Q={...z};if(Object.defineProperty(Q,B7,{value:J,enumerable:!1,writable:!0}),J)try{Q.input=m4(J)}catch(Y){let q=new P(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${Y}. JSON: ${J}`);H(this,r4,"f").call(this,q)}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:L7(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 O0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var Q1;var s4=S(()=>{Q1=class Q1 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 M7=1e5,O7=`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 Y},D;var X0=S(()=>{B0();Tz=Object.freeze(Object.create(null)),D=GL(Mz)});var z4;var Q3=S(()=>{t();r();X0();z4=class z4 extends f{create($,Z){let{betas:z,...X}=$;return this._client.post("/v1/environments?beta=true",{body:X,...Z,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},z){let{betas:X}=Z??{};return this._client.get(D`/v1/environments/${$}?beta=true`,{...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}update($,Z,z){let{betas:X,...J}=Z;return this._client.post(D`/v1/environments/${$}?beta=true`,{body:J,...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}list($={},Z){let{betas:z,...X}=$??{};return this._client.getAPIList("/v1/environments?beta=true",l,{query:X,...Z,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},z){let{betas:X}=Z??{};return this._client.delete(D`/v1/environments/${$}?beta=true`,{...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}archive($,Z={},z){let{betas:X}=Z??{};return this._client.post(D`/v1/environments/${$}/archive?beta=true`,{...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}}});function c2($){return typeof $==="object"&&$!==null&&X4 in $}function Y3($,Z){let z=new Set;if($){for(let X of $)if(c2(X))z.add(X[X4])}if(Z)for(let X of Z){if(c2(X))z.add(X[X4]);if(Array.isArray(X.content)){for(let J of X.content)if(c2(J))z.add(J[X4])}}return Array.from(z)}function p2($,Z){let z=Y3($,Z);if(z.length===0)return{};return{"x-stainless-helper":z.join(", ")}}function Oz($){if(c2($))return{"x-stainless-helper":$[X4]};return{}}var X4;var J4=S(()=>{X4=Symbol("anthropic.sdk.stainlessHelper")});var Q4;var q3=S(()=>{t();r();J4();Z1();X0();Q4=class Q4 extends f{list($={},Z){let{betas:z,...X}=$??{};return this._client.getAPIList("/v1/files?beta=true",S0,{query:X,...Z,headers:T([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString()},Z?.headers])})}delete($,Z={},z){let{betas:X}=Z??{};return this._client.delete(D`/v1/files/${$}?beta=true`,{...z,headers:T([{"anthropic-beta":[...X??[],"files-api-2025-04-14"].toString()},z?.headers])})}download($,Z={},z){let{betas:X}=Z??{};return this._client.get(D`/v1/files/${$}/content?beta=true`,{...z,headers:T([{"anthropic-beta":[...X??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},z?.headers]),__binaryResponse:!0})}retrieveMetadata($,Z={},z){let{betas:X}=Z??{};return this._client.get(D`/v1/files/${$}?beta=true`,{...z,headers:T([{"anthropic-beta":[...X??[],"files-api-2025-04-14"].toString()},z?.headers])})}upload($,Z){let{betas:z,...X}=$;return this._client.post("/v1/files?beta=true",$1({body:X,...Z,headers:T([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString()},Oz(X.file),Z?.headers])},this._client))}}});var Y4;var W3=S(()=>{t();r();X0();Y4=class Y4 extends f{retrieve($,Z={},z){let{betas:X}=Z??{};return this._client.get(D`/v1/models/${$}?beta=true`,{...z,headers:T([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},z?.headers])})}list($={},Z){let{betas:z,...X}=$??{};return this._client.getAPIList("/v1/models?beta=true",S0,{query:X,...Z,headers:T([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},Z?.headers])})}}});var q4;var G3=S(()=>{t();r();X0();q4=class q4 extends f{create($,Z){let{betas:z,...X}=$;return this._client.post("/v1/user_profiles?beta=true",{body:X,...Z,headers:T([{"anthropic-beta":[...z??[],"user-profiles-2026-03-24"].toString()},Z?.headers])})}retrieve($,Z={},z){let{betas:X}=Z??{};return this._client.get(D`/v1/user_profiles/${$}?beta=true`,{...z,headers:T([{"anthropic-beta":[...X??[],"user-profiles-2026-03-24"].toString()},z?.headers])})}update($,Z,z){let{betas:X,...J}=Z;return this._client.post(D`/v1/user_profiles/${$}?beta=true`,{body:J,...z,headers:T([{"anthropic-beta":[...X??[],"user-profiles-2026-03-24"].toString()},z?.headers])})}list($={},Z){let{betas:z,...X}=$??{};return this._client.getAPIList("/v1/user_profiles?beta=true",l,{query:X,...Z,headers:T([{"anthropic-beta":[...z??[],"user-profiles-2026-03-24"].toString()},Z?.headers])})}createEnrollmentURL($,Z={},z){let{betas:X}=Z??{};return this._client.post(D`/v1/user_profiles/${$}/enrollment_url?beta=true`,{...z,headers:T([{"anthropic-beta":[...X??[],"user-profiles-2026-03-24"].toString()},z?.headers])})}}});var W4;var U3=S(()=>{t();r();X0();W4=class W4 extends f{list($,Z={},z){let{betas:X,...J}=Z??{};return this._client.getAPIList(D`/v1/agents/${$}/versions?beta=true`,l,{query:J,...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}}});var z1;var V3=S(()=>{U3();U3();t();r();X0();z1=class z1 extends f{constructor(){super(...arguments);this.versions=new W4(this._client)}create($,Z){let{betas:z,...X}=$;return this._client.post("/v1/agents?beta=true",{body:X,...Z,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},z){let{betas:X,...J}=Z??{};return this._client.get(D`/v1/agents/${$}?beta=true`,{query:J,...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}update($,Z,z){let{betas:X,...J}=Z;return this._client.post(D`/v1/agents/${$}?beta=true`,{body:J,...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}list($={},Z){let{betas:z,...X}=$??{};return this._client.getAPIList("/v1/agents?beta=true",l,{query:X,...Z,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}archive($,Z={},z){let{betas:X}=Z??{};return this._client.post(D`/v1/agents/${$}/archive?beta=true`,{...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}};z1.Versions=W4});var G4;var K3=S(()=>{t();r();X0();G4=class G4 extends f{create($,Z,z){let{view:X,betas:J,...Q}=Z;return this._client.post(D`/v1/memory_stores/${$}/memories?beta=true`,{query:{view:X},body:Q,...z,headers:T([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}retrieve($,Z,z){let{memory_store_id:X,betas:J,...Q}=Z;return this._client.get(D`/v1/memory_stores/${X}/memories/${$}?beta=true`,{query:Q,...z,headers:T([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}update($,Z,z){let{memory_store_id:X,view:J,betas:Q,...Y}=Z;return this._client.post(D`/v1/memory_stores/${X}/memories/${$}?beta=true`,{query:{view:J},body:Y,...z,headers:T([{"anthropic-beta":[...Q??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}list($,Z={},z){let{betas:X,...J}=Z??{};return this._client.getAPIList(D`/v1/memory_stores/${$}/memories?beta=true`,l,{query:J,...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}delete($,Z,z){let{memory_store_id:X,expected_content_sha256:J,betas:Q}=Z;return this._client.delete(D`/v1/memory_stores/${X}/memories/${$}?beta=true`,{query:{expected_content_sha256:J},...z,headers:T([{"anthropic-beta":[...Q??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}}});var U4;var H3=S(()=>{t();r();X0();U4=class U4 extends f{retrieve($,Z,z){let{memory_store_id:X,betas:J,...Q}=Z;return this._client.get(D`/v1/memory_stores/${X}/memory_versions/${$}?beta=true`,{query:Q,...z,headers:T([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}list($,Z={},z){let{betas:X,...J}=Z??{};return this._client.getAPIList(D`/v1/memory_stores/${$}/memory_versions?beta=true`,l,{query:J,...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}redact($,Z,z){let{memory_store_id:X,betas:J}=Z;return this._client.post(D`/v1/memory_stores/${X}/memory_versions/${$}/redact?beta=true`,{...z,headers:T([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}}});var w$;var B3=S(()=>{K3();K3();H3();H3();t();r();X0();w$=class w$ extends f{constructor(){super(...arguments);this.memories=new G4(this._client),this.memoryVersions=new U4(this._client)}create($,Z){let{betas:z,...X}=$;return this._client.post("/v1/memory_stores?beta=true",{body:X,...Z,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},z){let{betas:X}=Z??{};return this._client.get(D`/v1/memory_stores/${$}?beta=true`,{...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}update($,Z,z){let{betas:X,...J}=Z;return this._client.post(D`/v1/memory_stores/${$}?beta=true`,{body:J,...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}list($={},Z){let{betas:z,...X}=$??{};return this._client.getAPIList("/v1/memory_stores?beta=true",l,{query:X,...Z,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},z){let{betas:X}=Z??{};return this._client.delete(D`/v1/memory_stores/${$}?beta=true`,{...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}archive($,Z={},z){let{betas:X}=Z??{};return this._client.post(D`/v1/memory_stores/${$}/archive?beta=true`,{...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}};w$.Memories=G4;w$.MemoryVersions=U4});var X1=S(()=>{B0()});var l2;var L3=S(()=>{l2={"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 Dz($){return $?.output_format??$?.output_config?.format}function N3($,Z,z){let X=Dz(Z);if(!Z||!("parse"in(X??{})))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 z.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return J}),parsed_output:null};return T3($,Z,z)}function T3($,Z,z){let X=null,J=$.content.map((Q)=>{if(Q.type==="text"){let Y=OL(Z,Q.text);if(X===null)X=Y;let q=Object.defineProperty({...Q},"parsed_output",{value:Y,enumerable:!1});return Object.defineProperty(q,"parsed",{get(){return z.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),Y},enumerable:!1})}return Q});return{...$,content:J,parsed_output:X}}function OL($,Z){let z=Dz($);if(z?.type!=="json_schema")return null;try{if("parse"in z)return z.parse(Z);return JSON.parse(Z)}catch(X){throw new P(`Failed to parse structured output: ${X}`)}}var M3=S(()=>{B0()});var DL=($)=>{let Z=0,z=[];while(Z<$.length){let X=$[Z];if(X==="\\"){Z++;continue}if(X==="{"){z.push({type:"brace",value:"{"}),Z++;continue}if(X==="}"){z.push({type:"brace",value:"}"}),Z++;continue}if(X==="["){z.push({type:"paren",value:"["}),Z++;continue}if(X==="]"){z.push({type:"paren",value:"]"}),Z++;continue}if(X===":"){z.push({type:"separator",value:":"}),Z++;continue}if(X===","){z.push({type:"delimiter",value:","}),Z++;continue}if(X==='"'){let q="",W=!1;X=$[++Z];while(X!=='"'){if(Z===$.length){W=!0;break}if(X==="\\"){if(Z++,Z===$.length){W=!0;break}q+=X+$[Z],X=$[++Z]}else q+=X,X=$[++Z]}if(X=$[++Z],!W)z.push({type:"string",value:q});continue}if(X&&/\s/.test(X)){Z++;continue}let Q=/[0-9]/;if(X&&Q.test(X)||X==="-"||X==="."){let q="";if(X==="-")q+=X,X=$[++Z];while(X&&Q.test(X)||X===".")q+=X,X=$[++Z];z.push({type:"number",value:q});continue}let Y=/[a-z]/i;if(X&&Y.test(X)){let q="";while(X&&Y.test(X)){if(Z===$.length)break;q+=X,X=$[++Z]}if(q=="true"||q=="false"||q==="null")z.push({type:"name",value:q});else{Z++;continue}continue}Z++}return z},J1=($)=>{if($.length===0)return $;let Z=$[$.length-1];switch(Z.type){case"separator":return $=$.slice(0,$.length-1),J1($);break;case"number":let z=Z.value[Z.value.length-1];if(z==="."||z==="-")return $=$.slice(0,$.length-1),J1($);case"string":let X=$[$.length-2];if(X?.type==="delimiter")return $=$.slice(0,$.length-1),J1($);else if(X?.type==="brace"&&X.value==="{")return $=$.slice(0,$.length-1),J1($);break;case"delimiter":return $=$.slice(0,$.length-1),J1($);break}return $},AL=($)=>{let Z=[];if($.map((z)=>{if(z.type==="brace")if(z.value==="{")Z.push("}");else Z.splice(Z.lastIndexOf("}"),1);if(z.type==="paren")if(z.value==="[")Z.push("]");else Z.splice(Z.lastIndexOf("]"),1)}),Z.length>0)Z.reverse().map((z)=>{if(z==="}")$.push({type:"brace",value:"}"});else if(z==="]")$.push({type:"paren",value:"]"})});return $},IL=($)=>{let Z="";return $.map((z)=>{switch(z.type){case"string":Z+='"'+z.value+'"';break;default:Z+=z.value;break}}),Z},i2=($)=>JSON.parse(IL(AL(J1(DL($)))));var O3=()=>{};var D3=S(()=>{a8()});function Fz($){return $.type==="tool_use"||$.type==="server_tool_use"||$.type==="mcp_tool_use"}function Rz($){}var F0,Y$,Q1,V4,n2,K4,H4,r2,B4,d0,L4,s2,a2,F$,o2,t2,N4,A3,Az,e2,I3,w3,F3,Iz,wz="__json_buf",T4;var Pz=S(()=>{v0();O3();X1();D3();M3();T4=class T4{constructor($,Z){F0.add(this),this.messages=[],this.receivedMessages=[],Y$.set(this,void 0),Q1.set(this,null),this.controller=new AbortController,V4.set(this,void 0),n2.set(this,()=>{}),K4.set(this,()=>{}),H4.set(this,void 0),r2.set(this,()=>{}),B4.set(this,()=>{}),d0.set(this,{}),L4.set(this,!1),s2.set(this,!1),a2.set(this,!1),F$.set(this,!1),o2.set(this,void 0),t2.set(this,void 0),N4.set(this,void 0),e2.set(this,(z)=>{if(I(this,s2,!0,"f"),u0(z))z=new U0;if(z instanceof U0)return I(this,a2,!0,"f"),this._emit("abort",z);if(z instanceof P)return this._emit("error",z);if(z instanceof Error){let X=new P(z.message);return X.cause=z,this._emit("error",X)}return this._emit("error",new P(String(z)))}),I(this,V4,new Promise((z,X)=>{I(this,n2,z,"f"),I(this,K4,X,"f")}),"f"),I(this,H4,new Promise((z,X)=>{I(this,r2,z,"f"),I(this,B4,X,"f")}),"f"),H(this,V4,"f").catch(()=>{}),H(this,H4,"f").catch(()=>{}),I(this,Q1,$,"f"),I(this,N4,Z?.logger??console,"f")}get response(){return H(this,o2,"f")}get request_id(){return H(this,t2,"f")}async withResponse(){I(this,F$,!0,"f");let $=await H(this,V4,"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 T4(null);return Z._run(()=>Z._fromReadableStream($)),Z}static createMessage($,Z,z,{logger:X}={}){let J=new T4(Z,{logger:X});for(let Q of Z.messages)J._addMessageParam(Q);return I(J,Q1,{...Z,stream:!0},"f"),J._run(()=>J._createMessage($,{...Z,stream:!0},{...z,headers:{...z?.headers,"X-Stainless-Helper-Method":"stream"}})),J}_run($){$().then(()=>{this._emitFinal(),this._emit("end")},H(this,e2,"f"))}_addMessageParam($){this.messages.push($)}_addMessage($,Z=!0){if(this.receivedMessages.push($),Z)this._emit("message",$)}async _createMessage($,Z,z){let X=z?.signal,J;if(X){if(X.aborted)this.controller.abort();J=this.controller.abort.bind(this.controller),X.addEventListener("abort",J)}try{H(this,F0,"m",I3).call(this);let{response:Q,data:Y}=await $.create({...Z,stream:!0},{...z,signal:this.controller.signal}).withResponse();this._connected(Q);for await(let q of Y)H(this,F0,"m",w3).call(this,q);if(Y.controller.signal?.aborted)throw new U0;H(this,F0,"m",F3).call(this)}finally{if(X&&J)X.removeEventListener("abort",J)}}_connected($){if(this.ended)return;I(this,o2,$,"f"),I(this,t2,$?.headers.get("request-id"),"f"),H(this,n2,"f").call(this,$),this._emit("connect")}get ended(){return H(this,L4,"f")}get errored(){return H(this,s2,"f")}get aborted(){return H(this,a2,"f")}abort(){this.controller.abort()}on($,Z){return(H(this,d0,"f")[$]||(H(this,d0,"f")[$]=[])).push({listener:Z}),this}off($,Z){let z=H(this,d0,"f")[$];if(!z)return this;let X=z.findIndex((J)=>J.listener===Z);if(X>=0)z.splice(X,1);return this}once($,Z){return(H(this,d0,"f")[$]||(H(this,d0,"f")[$]=[])).push({listener:Z,once:!0}),this}emitted($){return new Promise((Z,z)=>{if(I(this,F$,!0,"f"),$!=="error")this.once("error",z);this.once($,Z)})}async done(){I(this,F$,!0,"f"),await H(this,H4,"f")}get currentMessage(){return H(this,Y$,"f")}async finalMessage(){return await this.done(),H(this,F0,"m",A3).call(this)}async finalText(){return await this.done(),H(this,F0,"m",Az).call(this)}_emit($,...Z){if(H(this,L4,"f"))return;if($==="end")I(this,L4,!0,"f"),H(this,r2,"f").call(this);let z=H(this,d0,"f")[$];if(z)H(this,d0,"f")[$]=z.filter((X)=>!X.once),z.forEach(({listener:X})=>X(...Z));if($==="abort"){let X=Z[0];if(!H(this,F$,"f")&&!z?.length)Promise.reject(X);H(this,K4,"f").call(this,X),H(this,B4,"f").call(this,X),this._emit("end");return}if($==="error"){let X=Z[0];if(!H(this,F$,"f")&&!z?.length)Promise.reject(X);H(this,K4,"f").call(this,X),H(this,B4,"f").call(this,X),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",H(this,F0,"m",A3).call(this))}async _fromReadableStream($,Z){let z=Z?.signal,X;if(z){if(z.aborted)this.controller.abort();X=this.controller.abort.bind(this.controller),z.addEventListener("abort",X)}try{H(this,F0,"m",I3).call(this),this._connected(null);let J=O0.fromReadableStream($,this.controller);for await(let Q of J)H(this,F0,"m",w3).call(this,Q);if(J.controller.signal?.aborted)throw new U0;H(this,F0,"m",F3).call(this)}finally{if(z&&X)z.removeEventListener("abort",X)}}[(Y$=new WeakMap,Q1=new WeakMap,V4=new WeakMap,n2=new WeakMap,K4=new WeakMap,H4=new WeakMap,r2=new WeakMap,B4=new WeakMap,d0=new WeakMap,L4=new WeakMap,s2=new WeakMap,a2=new WeakMap,F$=new WeakMap,o2=new WeakMap,t2=new WeakMap,N4=new WeakMap,e2=new WeakMap,F0=new WeakSet,A3=function(){if(this.receivedMessages.length===0)throw new P("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},Az=function(){if(this.receivedMessages.length===0)throw new P("stream ended without producing a Message with role=assistant");let Z=this.receivedMessages.at(-1).content.filter((z)=>z.type==="text").map((z)=>z.text);if(Z.length===0)throw new P("stream ended without producing a content block with type=text");return Z.join(" ")},I3=function(){if(this.ended)return;I(this,Y$,void 0,"f")},w3=function(Z){if(this.ended)return;let z=H(this,F0,"m",Iz).call(this,Z);switch(this._emit("streamEvent",Z,z),Z.type){case"content_block_delta":{let X=z.content.at(-1);switch(Z.delta.type){case"text_delta":{if(X.type==="text")this._emit("text",Z.delta.text,X.text||"");break}case"citations_delta":{if(X.type==="text")this._emit("citation",Z.delta.citation,X.citations??[]);break}case"input_json_delta":{if(Fz(X)&&X.input)this._emit("inputJson",Z.delta.partial_json,X.input);break}case"thinking_delta":{if(X.type==="thinking")this._emit("thinking",Z.delta.thinking,X.thinking);break}case"signature_delta":{if(X.type==="thinking")this._emit("signature",X.signature);break}case"compaction_delta":{if(X.type==="compaction"&&X.content)this._emit("compaction",X.content);break}default:Rz(Z.delta)}break}case"message_stop":{this._addMessageParam(z),this._addMessage(N3(z,H(this,Q1,"f"),{logger:H(this,N4,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",z.content.at(-1));break}case"message_start":{I(this,Y$,z,"f");break}case"content_block_start":case"message_delta":break}},F3=function(){if(this.ended)throw new P("stream has ended, this shouldn't happen");let Z=H(this,Y$,"f");if(!Z)throw new P("request ended without sending any chunks");return I(this,Y$,void 0,"f"),N3(Z,H(this,Q1,"f"),{logger:H(this,N4,"f")})},Iz=function(Z){let z=H(this,Y$,"f");if(Z.type==="message_start"){if(z)throw new P(`Unexpected event order, got ${Z.type} before receiving "message_stop"`);return Z.message}if(!z)throw new P(`Unexpected event order, got ${Z.type} before "message_start"`);switch(Z.type){case"message_stop":return z;case"message_delta":if(z.container=Z.delta.container,z.stop_reason=Z.delta.stop_reason,z.stop_sequence=Z.delta.stop_sequence,z.usage.output_tokens=Z.usage.output_tokens,z.context_management=Z.context_management,Z.usage.input_tokens!=null)z.usage.input_tokens=Z.usage.input_tokens;if(Z.usage.cache_creation_input_tokens!=null)z.usage.cache_creation_input_tokens=Z.usage.cache_creation_input_tokens;if(Z.usage.cache_read_input_tokens!=null)z.usage.cache_read_input_tokens=Z.usage.cache_read_input_tokens;if(Z.usage.server_tool_use!=null)z.usage.server_tool_use=Z.usage.server_tool_use;if(Z.usage.iterations!=null)z.usage.iterations=Z.usage.iterations;return z;case"content_block_start":return z.content.push(Z.content_block),z;case"content_block_delta":{let X=z.content.at(Z.index);switch(Z.delta.type){case"text_delta":{if(X?.type==="text")z.content[Z.index]={...X,text:(X.text||"")+Z.delta.text};break}case"citations_delta":{if(X?.type==="text")z.content[Z.index]={...X,citations:[...X.citations??[],Z.delta.citation]};break}case"input_json_delta":{if(X&&Fz(X)){let J=X[wz]||"";J+=Z.delta.partial_json;let Q={...X};if(Object.defineProperty(Q,wz,{value:J,enumerable:!1,writable:!0}),J)try{Q.input=i2(J)}catch(Y){let q=new P(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${Y}. JSON: ${J}`);H(this,e2,"f").call(this,q)}z.content[Z.index]=Q}break}case"thinking_delta":{if(X?.type==="thinking")z.content[Z.index]={...X,thinking:X.thinking+Z.delta.thinking};break}case"signature_delta":{if(X?.type==="thinking")z.content[Z.index]={...X,signature:Z.delta.signature};break}case"compaction_delta":{if(X?.type==="compaction")z.content[Z.index]={...X,content:(X.content||"")+Z.delta.content};break}default:Rz(Z.delta)}return z}case"content_block_stop":return z}},Symbol.asyncIterator)](){let $=[],Z=[],z=!1;return this.on("streamEvent",(X)=>{let J=Z.shift();if(J)J.resolve(X);else $.push(X)}),this.on("end",()=>{z=!0;for(let X of Z)X.resolve(void 0);Z.length=0}),this.on("abort",(X)=>{z=!0;for(let J of Z)J.reject(X);Z.length=0}),this.on("error",(X)=>{z=!0;for(let J of Z)J.reject(X);Z.length=0}),{next:async()=>{if(!$.length){if(z)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 O0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var Y1;var $6=S(()=>{Y1=class Y1 extends Error{constructor($){let Z=typeof $==="string"?$:$.map((z)=>{if(z.type==="text")return z.text;return`[${z.type}]`}).join(" ");super(Z);this.name="ToolError",this.content=$}}});var _z=1e5,Ez=`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,74 +192,147 @@ 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 A7(){let $,Z;return{promise:new Promise((z,J)=>{$=z,Z=J}),resolve:$,reject:Z}}async function XN($,Z=$.messages.at(-1),X){if(!Z||Z.role!=="assistant"||!Z.content||typeof Z.content==="string")return null;let z=Z.content.filter((Q)=>Q.type==="tool_use");if(z.length===0)return null;return{role:"user",content:await Promise.all(z.map(async(Q)=>{let Y=$.tools.find((q)=>("name"in q?q.name:q.mcp_server_name)===Q.name);if(!Y||!("run"in Y))return{type:"tool_result",tool_use_id:Q.id,content:`Error: Tool '${Q.name}' not found`,is_error:!0};try{let q=Q.input;if("parse"in Y&&Y.parse)q=Y.parse(q);let G=await Y.run(q,{toolUseBlock:Q,signal:X?.signal});return{type:"tool_result",tool_use_id:Q.id,content:G}}catch(q){return{type:"tool_result",tool_use_id:Q.id,content:q instanceof Q1?q.content:`Error: ${q instanceof Error?q.message:String(q)}`,is_error:!0}}}))}}var L2,Y1,R$,Y0,N0,D0,d0,q$,T2,D7,D3,M2;var A3=S(()=>{h0();s4();B0();r();X2();M2=class M2{constructor($,Z,X){L2.add(this),this.client=$,Y1.set(this,!1),R$.set(this,!1),Y0.set(this,void 0),N0.set(this,void 0),D0.set(this,void 0),d0.set(this,void 0),q$.set(this,void 0),T2.set(this,0),w(this,Y0,{params:{...Z,messages:structuredClone(Z.messages)}},"f");let J=["BetaToolRunner",...Z3(Z.tools,Z.messages)].join(", ");if(w(this,N0,{...X,headers:T([{"x-stainless-helper":J},X?.headers])},"f"),w(this,q$,A7(),"f"),Z.compactionControl?.enabled)console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. See https://platform.claude.com/docs/en/build-with-claude/compaction')}async*[(Y1=new WeakMap,R$=new WeakMap,Y0=new WeakMap,N0=new WeakMap,D0=new WeakMap,d0=new WeakMap,q$=new WeakMap,T2=new WeakMap,L2=new WeakSet,D7=async function(){let Z=H(this,Y0,"f").params.compactionControl;if(!Z||!Z.enabled)return!1;let X=0;if(H(this,D0,"f")!==void 0)try{let G=await H(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??M7;if(X<z)return!1;let J=Z.model??H(this,Y0,"f").params.model,Q=Z.summaryPrompt??O7,Y=H(this,Y0,"f").params.messages;if(Y[Y.length-1].role==="assistant"){let G=Y[Y.length-1];if(Array.isArray(G.content)){let W=G.content.filter((U)=>U.type!=="tool_use");if(W.length===0)Y.pop();else G.content=W}}let q=await this.client.beta.messages.create({model:J,messages:[...Y,{role:"user",content:[{type:"text",text:Q}]}],max_tokens:H(this,Y0,"f").params.max_tokens},{signal:H(this,N0,"f").signal,headers:T([H(this,N0,"f").headers,{"x-stainless-helper":"compaction"}])});if(q.content[0]?.type!=="text")throw new P("Expected text response for compaction");return H(this,Y0,"f").params.messages=[{role:"user",content:q.content}],!0},Symbol.asyncIterator)](){var $;if(H(this,Y1,"f"))throw new P("Cannot iterate over a consumed stream");w(this,Y1,!0,"f"),w(this,R$,!0,"f"),w(this,d0,void 0,"f");try{while(!0){let Z;try{if(H(this,Y0,"f").params.max_iterations&&H(this,T2,"f")>=H(this,Y0,"f").params.max_iterations)break;w(this,R$,!1,"f"),w(this,d0,void 0,"f"),w(this,T2,($=H(this,T2,"f"),$++,$),"f"),w(this,D0,void 0,"f");let{max_iterations:X,compactionControl:z,...J}=H(this,Y0,"f").params;if(J.stream)Z=this.client.beta.messages.stream({...J},H(this,N0,"f")),w(this,D0,Z.finalMessage(),"f"),H(this,D0,"f").catch(()=>{}),yield Z;else w(this,D0,this.client.beta.messages.create({...J,stream:!1},H(this,N0,"f")),"f"),yield H(this,D0,"f");if(!await H(this,L2,"m",D7).call(this)){if(!H(this,R$,"f")){let{role:q,content:G}=await H(this,D0,"f");H(this,Y0,"f").params.messages.push({role:q,content:G})}let Y=await H(this,L2,"m",D3).call(this,H(this,Y0,"f").params.messages.at(-1));if(Y)H(this,Y0,"f").params.messages.push(Y);else if(!H(this,R$,"f"))break}}finally{if(Z)Z.abort()}}if(!H(this,D0,"f"))throw new P("ToolRunner concluded without a message from the server");H(this,q$,"f").resolve(await H(this,D0,"f"))}catch(Z){throw w(this,Y1,!1,"f"),H(this,q$,"f").promise.catch(()=>{}),H(this,q$,"f").reject(Z),w(this,q$,A7(),"f"),Z}}setMessagesParams($){if(typeof $==="function")H(this,Y0,"f").params=$(H(this,Y0,"f").params);else H(this,Y0,"f").params=$;w(this,R$,!0,"f"),w(this,d0,void 0,"f")}setRequestOptions($){if(typeof $==="function")w(this,N0,$(H(this,N0,"f")),"f");else w(this,N0,{...H(this,N0,"f"),...$},"f")}async generateToolResponse($=H(this,N0,"f").signal){let Z=await H(this,D0,"f")??this.params.messages.at(-1);if(!Z)return null;return H(this,L2,"m",D3).call(this,Z,$)}done(){return H(this,q$,"f").promise}async runUntilDone(){if(!H(this,Y1,"f"))for await(let $ of this);return this.done()}get params(){return H(this,Y0,"f").params}pushMessages(...$){this.setMessagesParams((Z)=>({...Z,messages:[...Z.messages,...$]}))}then($,Z){return this.runUntilDone().then($,Z)}};D3=async function(Z,X=H(this,N0,"f").signal){if(H(this,d0,"f")!==void 0)return H(this,d0,"f");return w(this,d0,XN(H(this,Y0,"f").params,Z,{...H(this,N0,"f"),signal:X}),"f"),H(this,d0,"f")}});var q1;var w3=S(()=>{B0();c8();q1=class q1{constructor($,Z){this.iterator=$,this.controller=Z}async*decoder(){let $=new J$;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 P("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 P("Attempted to iterate over a response with no body")}return new q1(i1($.body),Z)}}});var O2;var I3=S(()=>{t();r();w3();X1();z0();O2=class O2 extends f{create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/messages/batches?beta=true",{body:z,...Z,headers:T([{"anthropic-beta":[...X??[],"message-batches-2024-09-24"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(D`/v1/messages/batches/${$}?beta=true`,{...X,headers:T([{"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",j0,{query:z,...Z,headers:T([{"anthropic-beta":[...X??[],"message-batches-2024-09-24"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(D`/v1/messages/batches/${$}?beta=true`,{...X,headers:T([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},X?.headers])})}cancel($,Z={},X){let{betas:z}=Z??{};return this._client.post(D`/v1/messages/batches/${$}/cancel?beta=true`,{...X,headers:T([{"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 P(`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:T([{"anthropic-beta":[...J??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},X?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((Q,Y)=>q1.fromResponse(Y.response,Y.controller))}}});function I7($){if(!$.output_format)return $;if($.output_config?.format)throw new P("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 w7,JN,G$;var F3=S(()=>{X1();U3();r();X2();H3();T7();A3();s4();I3();I3();A3();s4();w7={"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"},JN=["claude-mythos-preview","claude-opus-4-6"];G$=class G$ extends f{constructor(){super(...arguments);this.batches=new O2(this._client)}create($,Z){let X=I7($),{betas:z,...J}=X;if(J.model in w7)console.warn(`The model '${J.model}' is deprecated and will reach end-of-life on ${w7[J.model]}
196
- Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(JN.includes(J.model)&&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 q=u4[J.model]??void 0;Q=this._client.calculateNonstreamingTimeout(J.max_tokens,q)}let Y=v4(J.tools,J.messages);return this._client.post("/v1/messages?beta=true",{body:J,timeout:Q??600000,...Z,headers:T([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},Y,Z?.headers]),stream:X.stream??!1})}parse($,Z){return Z={...Z,headers:T([{"anthropic-beta":[...$.betas??[],"structured-outputs-2025-12-15"].toString()},Z?.headers])},this.create($,Z).then((X)=>K3(X,$,{logger:this._client.logger??console}))}stream($,Z){return N2.createMessage(this,$,Z)}countTokens($,Z){let X=I7($),{betas:z,...J}=X;return this._client.post("/v1/messages/count_tokens?beta=true",{body:J,...Z,headers:T([{"anthropic-beta":[...z??[],"token-counting-2024-11-01"].toString()},Z?.headers])})}toolRunner($,Z){return new M2(this._client,$,Z)}};G$.Batches=O2;G$.BetaToolRunner=M2;G$.ToolError=Q1});var D2;var R3=S(()=>{t();r();z0();D2=class D2 extends f{list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(D`/v1/sessions/${$}/events?beta=true`,l,{query:J,...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}send($,Z,X){let{betas:z,...J}=Z;return this._client.post(D`/v1/sessions/${$}/events?beta=true`,{body:J,...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}stream($,Z={},X){let{betas:z}=Z??{};return this._client.get(D`/v1/sessions/${$}/events/stream?beta=true`,{...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers]),stream:!0})}}});var A2;var P3=S(()=>{t();r();z0();A2=class A2 extends f{retrieve($,Z,X){let{session_id:z,betas:J}=Z;return this._client.get(D`/v1/sessions/${z}/resources/${$}?beta=true`,{...X,headers:T([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{session_id:z,betas:J,...Q}=Z;return this._client.post(D`/v1/sessions/${z}/resources/${$}?beta=true`,{body:Q,...X,headers:T([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(D`/v1/sessions/${$}/resources?beta=true`,l,{query:J,...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}delete($,Z,X){let{session_id:z,betas:J}=Z;return this._client.delete(D`/v1/sessions/${z}/resources/${$}?beta=true`,{...X,headers:T([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}add($,Z,X){let{betas:z,...J}=Z;return this._client.post(D`/v1/sessions/${$}/resources?beta=true`,{body:J,...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var P$;var E3=S(()=>{R3();R3();P3();P3();t();r();z0();P$=class P$ extends f{constructor(){super(...arguments);this.events=new D2(this._client),this.resources=new A2(this._client)}create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/sessions?beta=true",{body:z,...Z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(D`/v1/sessions/${$}?beta=true`,{...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(D`/v1/sessions/${$}?beta=true`,{body:J,...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/sessions?beta=true",l,{query:z,...Z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(D`/v1/sessions/${$}?beta=true`,{...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(D`/v1/sessions/${$}/archive?beta=true`,{...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};P$.Events=D2;P$.Resources=A2});var w2;var _3=S(()=>{t();r();$1();z0();w2=class w2 extends f{create($,Z={},X){let{betas:z,...J}=Z??{};return this._client.post(D`/v1/skills/${$}/versions?beta=true`,e$({body:J,...X,headers:T([{"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(D`/v1/skills/${z}/versions/${$}?beta=true`,{...X,headers:T([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(D`/v1/skills/${$}/versions?beta=true`,l,{query:J,...X,headers:T([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}delete($,Z,X){let{skill_id:z,betas:J}=Z;return this._client.delete(D`/v1/skills/${z}/versions/${$}?beta=true`,{...X,headers:T([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])})}}});var G1;var C3=S(()=>{_3();_3();t();r();$1();z0();G1=class G1 extends f{constructor(){super(...arguments);this.versions=new w2(this._client)}create($={},Z){let{betas:X,...z}=$??{};return this._client.post("/v1/skills?beta=true",e$({body:z,...Z,headers:T([{"anthropic-beta":[...X??[],"skills-2025-10-02"].toString()},Z?.headers])},this._client,!1))}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(D`/v1/skills/${$}?beta=true`,{...X,headers:T([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/skills?beta=true",l,{query:z,...Z,headers:T([{"anthropic-beta":[...X??[],"skills-2025-10-02"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(D`/v1/skills/${$}?beta=true`,{...X,headers:T([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}};G1.Versions=w2});var I2;var j3=S(()=>{t();r();z0();I2=class I2 extends f{create($,Z,X){let{betas:z,...J}=Z;return this._client.post(D`/v1/vaults/${$}/credentials?beta=true`,{body:J,...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}retrieve($,Z,X){let{vault_id:z,betas:J}=Z;return this._client.get(D`/v1/vaults/${z}/credentials/${$}?beta=true`,{...X,headers:T([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{vault_id:z,betas:J,...Q}=Z;return this._client.post(D`/v1/vaults/${z}/credentials/${$}?beta=true`,{body:Q,...X,headers:T([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(D`/v1/vaults/${$}/credentials?beta=true`,l,{query:J,...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}delete($,Z,X){let{vault_id:z,betas:J}=Z;return this._client.delete(D`/v1/vaults/${z}/credentials/${$}?beta=true`,{...X,headers:T([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z,X){let{vault_id:z,betas:J}=Z;return this._client.post(D`/v1/vaults/${z}/credentials/${$}/archive?beta=true`,{...X,headers:T([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var W1;var S3=S(()=>{j3();j3();t();r();z0();W1=class W1 extends f{constructor(){super(...arguments);this.credentials=new I2(this._client)}create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/vaults?beta=true",{body:z,...Z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(D`/v1/vaults/${$}?beta=true`,{...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(D`/v1/vaults/${$}?beta=true`,{body:J,...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/vaults?beta=true",l,{query:z,...Z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(D`/v1/vaults/${$}?beta=true`,{...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(D`/v1/vaults/${$}/archive?beta=true`,{...X,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};W1.Credentials=I2});var V0;var b3=S(()=>{$3();$3();X3();X3();z3();z3();J3();J3();Y3();Y3();W3();W3();F3();F3();E3();E3();C3();C3();S3();S3();V0=class V0 extends f{constructor(){super(...arguments);this.models=new J2(this._client),this.messages=new G$(this._client),this.agents=new Z1(this._client),this.environments=new $2(this._client),this.sessions=new P$(this._client),this.vaults=new W1(this._client),this.memoryStores=new I$(this._client),this.files=new z2(this._client),this.skills=new G1(this._client),this.userProfiles=new Q2(this._client)}};V0.Models=J2;V0.Messages=G$;V0.Agents=Z1;V0.Environments=$2;V0.Sessions=P$;V0.Vaults=W1;V0.MemoryStores=I$;V0.Files=z2;V0.Skills=G1;V0.UserProfiles=Q2});var U1;var x3=S(()=>{r();U1=class U1 extends f{create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/complete",{body:z,timeout:this._client._options.timeout??600000,...Z,headers:T([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers]),stream:$.stream??!1})}}});function F7($){return $?.output_config?.format}function y3($,Z,X){let z=F7(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 k3($,Z,X)}function k3($,Z,X){let z=null,J=$.content.map((Q)=>{if(Q.type==="text"){let Y=HN(Z,Q.text);if(z===null)z=Y;return Object.defineProperty({...Q},"parsed_output",{value:Y,enumerable:!1})}return Q});return{...$,content:J,parsed_output:z}}function HN($,Z){let X=F7($);if(X?.type!=="json_schema")return null;try{if("parse"in X)return X.parse(Z);return JSON.parse(Z)}catch(z){throw new P(`Failed to parse structured output: ${z}`)}}var f3=S(()=>{B0()});function _7($){return $.type==="tool_use"||$.type==="server_tool_use"}function C7($){}var F0,W$,V1,F2,a4,R2,P2,o4,E2,c0,_2,t4,e4,E$,$6,Z6,C2,g3,R7,h3,v3,u3,m3,P7,E7="__json_buf",j2;var j7=S(()=>{h0();X1();N3();B3();f3();j2=class j2{constructor($,Z){F0.add(this),this.messages=[],this.receivedMessages=[],W$.set(this,void 0),V1.set(this,null),this.controller=new AbortController,F2.set(this,void 0),a4.set(this,()=>{}),R2.set(this,()=>{}),P2.set(this,void 0),o4.set(this,()=>{}),E2.set(this,()=>{}),c0.set(this,{}),_2.set(this,!1),t4.set(this,!1),e4.set(this,!1),E$.set(this,!1),$6.set(this,void 0),Z6.set(this,void 0),C2.set(this,void 0),h3.set(this,(X)=>{if(w(this,t4,!0,"f"),v0(X))X=new W0;if(X instanceof W0)return w(this,e4,!0,"f"),this._emit("abort",X);if(X instanceof P)return this._emit("error",X);if(X instanceof Error){let z=new P(X.message);return z.cause=X,this._emit("error",z)}return this._emit("error",new P(String(X)))}),w(this,F2,new Promise((X,z)=>{w(this,a4,X,"f"),w(this,R2,z,"f")}),"f"),w(this,P2,new Promise((X,z)=>{w(this,o4,X,"f"),w(this,E2,z,"f")}),"f"),H(this,F2,"f").catch(()=>{}),H(this,P2,"f").catch(()=>{}),w(this,V1,$,"f"),w(this,C2,Z?.logger??console,"f")}get response(){return H(this,$6,"f")}get request_id(){return H(this,Z6,"f")}async withResponse(){w(this,E$,!0,"f");let $=await H(this,F2,"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 j2(null);return Z._run(()=>Z._fromReadableStream($)),Z}static createMessage($,Z,X,{logger:z}={}){let J=new j2(Z,{logger:z});for(let Q of Z.messages)J._addMessageParam(Q);return w(J,V1,{...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")},H(this,h3,"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{H(this,F0,"m",v3).call(this);let{response:Q,data:Y}=await $.create({...Z,stream:!0},{...X,signal:this.controller.signal}).withResponse();this._connected(Q);for await(let q of Y)H(this,F0,"m",u3).call(this,q);if(Y.controller.signal?.aborted)throw new W0;H(this,F0,"m",m3).call(this)}finally{if(z&&J)z.removeEventListener("abort",J)}}_connected($){if(this.ended)return;w(this,$6,$,"f"),w(this,Z6,$?.headers.get("request-id"),"f"),H(this,a4,"f").call(this,$),this._emit("connect")}get ended(){return H(this,_2,"f")}get errored(){return H(this,t4,"f")}get aborted(){return H(this,e4,"f")}abort(){this.controller.abort()}on($,Z){return(H(this,c0,"f")[$]||(H(this,c0,"f")[$]=[])).push({listener:Z}),this}off($,Z){let X=H(this,c0,"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(H(this,c0,"f")[$]||(H(this,c0,"f")[$]=[])).push({listener:Z,once:!0}),this}emitted($){return new Promise((Z,X)=>{if(w(this,E$,!0,"f"),$!=="error")this.once("error",X);this.once($,Z)})}async done(){w(this,E$,!0,"f"),await H(this,P2,"f")}get currentMessage(){return H(this,W$,"f")}async finalMessage(){return await this.done(),H(this,F0,"m",g3).call(this)}async finalText(){return await this.done(),H(this,F0,"m",R7).call(this)}_emit($,...Z){if(H(this,_2,"f"))return;if($==="end")w(this,_2,!0,"f"),H(this,o4,"f").call(this);let X=H(this,c0,"f")[$];if(X)H(this,c0,"f")[$]=X.filter((z)=>!z.once),X.forEach(({listener:z})=>z(...Z));if($==="abort"){let z=Z[0];if(!H(this,E$,"f")&&!X?.length)Promise.reject(z);H(this,R2,"f").call(this,z),H(this,E2,"f").call(this,z),this._emit("end");return}if($==="error"){let z=Z[0];if(!H(this,E$,"f")&&!X?.length)Promise.reject(z);H(this,R2,"f").call(this,z),H(this,E2,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",H(this,F0,"m",g3).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{H(this,F0,"m",v3).call(this),this._connected(null);let J=O0.fromReadableStream($,this.controller);for await(let Q of J)H(this,F0,"m",u3).call(this,Q);if(J.controller.signal?.aborted)throw new W0;H(this,F0,"m",m3).call(this)}finally{if(X&&z)X.removeEventListener("abort",z)}}[(W$=new WeakMap,V1=new WeakMap,F2=new WeakMap,a4=new WeakMap,R2=new WeakMap,P2=new WeakMap,o4=new WeakMap,E2=new WeakMap,c0=new WeakMap,_2=new WeakMap,t4=new WeakMap,e4=new WeakMap,E$=new WeakMap,$6=new WeakMap,Z6=new WeakMap,C2=new WeakMap,h3=new WeakMap,F0=new WeakSet,g3=function(){if(this.receivedMessages.length===0)throw new P("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},R7=function(){if(this.receivedMessages.length===0)throw new P("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 P("stream ended without producing a content block with type=text");return Z.join(" ")},v3=function(){if(this.ended)return;w(this,W$,void 0,"f")},u3=function(Z){if(this.ended)return;let X=H(this,F0,"m",P7).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(_7(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:C7(Z.delta)}break}case"message_stop":{this._addMessageParam(X),this._addMessage(y3(X,H(this,V1,"f"),{logger:H(this,C2,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",X.content.at(-1));break}case"message_start":{w(this,W$,X,"f");break}case"content_block_start":case"message_delta":break}},m3=function(){if(this.ended)throw new P("stream has ended, this shouldn't happen");let Z=H(this,W$,"f");if(!Z)throw new P("request ended without sending any chunks");return w(this,W$,void 0,"f"),y3(Z,H(this,V1,"f"),{logger:H(this,C2,"f")})},P7=function(Z){let X=H(this,W$,"f");if(Z.type==="message_start"){if(X)throw new P(`Unexpected event order, got ${Z.type} before receiving "message_stop"`);return Z.message}if(!X)throw new P(`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&&_7(z)){let J=z[E7]||"";J+=Z.delta.partial_json;let Q={...z};if(Object.defineProperty(Q,E7,{value:J,enumerable:!1,writable:!0}),J)Q.input=m4(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:C7(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 O0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var S2;var d3=S(()=>{t();r();w3();X1();z0();S2=class S2 extends f{create($,Z){return this._client.post("/v1/messages/batches",{body:$,...Z})}retrieve($,Z){return this._client.get(D`/v1/messages/batches/${$}`,Z)}list($={},Z){return this._client.getAPIList("/v1/messages/batches",j0,{query:$,...Z})}delete($,Z){return this._client.delete(D`/v1/messages/batches/${$}`,Z)}cancel($,Z){return this._client.post(D`/v1/messages/batches/${$}/cancel`,Z)}async results($,Z){let X=await this.retrieve($);if(!X.results_url)throw new P(`No batch \`results_url\`; Has it finished processing? ${X.processing_status} - ${X.id}`);return this._client.get(X.results_url,{...Z,headers:T([{Accept:"application/binary"},Z?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((z,J)=>q1.fromResponse(J.response,J.controller))}}});var _$,S7,NN;var c3=S(()=>{r();X2();j7();f3();d3();d3();U3();_$=class _$ extends f{constructor(){super(...arguments);this.batches=new S2(this._client)}create($,Z){if($.model in S7)console.warn(`The model '${$.model}' is deprecated and will reach end-of-life on ${S7[$.model]}
197
- Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(NN.includes($.model)&&$.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=u4[$.model]??void 0;X=this._client.calculateNonstreamingTimeout($.max_tokens,J)}let z=v4($.tools,$.messages);return this._client.post("/v1/messages",{body:$,timeout:X??600000,...Z,headers:T([z,Z?.headers]),stream:$.stream??!1})}parse($,Z){return this.create($,Z).then((X)=>k3(X,$,{logger:this._client.logger??console}))}stream($,Z){return j2.createMessage(this,$,Z,{logger:this._client.logger??console})}countTokens($,Z){return this._client.post("/v1/messages/count_tokens",{body:$,...Z})}};S7={"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","claude-opus-4-0":"June 15th, 2026","claude-opus-4-20250514":"June 15th, 2026","claude-sonnet-4-0":"June 15th, 2026","claude-sonnet-4-20250514":"June 15th, 2026"},NN=["claude-mythos-preview","claude-opus-4-6"];_$.Batches=S2});var K1;var p3=S(()=>{t();r();z0();K1=class K1 extends f{retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(D`/v1/models/${$}`,{...X,headers:T([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/models",j0,{query:z,...Z,headers:T([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers])})}}});var b7=S(()=>{b3();x3();c3();p3();Y7()});var b2=($)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[$]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.($)?.trim()||void 0;return};class a{constructor({baseURL:$=b2("ANTHROPIC_BASE_URL"),apiKey:Z=b2("ANTHROPIC_API_KEY")??null,authToken:X=b2("ANTHROPIC_AUTH_TOKEN")??null,...z}={}){l3.add(this),X6.set(this,void 0);let J={apiKey:Z,authToken:X,...z,baseURL:$||"https://api.anthropic.com"};if(!J.dangerouslyAllowBrowser&&pX())throw new P(`It looks like you're running in a browser-like environment.
195
+ Wrap your summary in <summary></summary> tags.`;function jz(){let $,Z;return{promise:new Promise((X,J)=>{$=X,Z=J}),resolve:$,reject:Z}}async function wL($,Z=$.messages.at(-1),z){if(!Z||Z.role!=="assistant"||!Z.content||typeof Z.content==="string")return null;let X=Z.content.filter((Q)=>Q.type==="tool_use");if(X.length===0)return null;return{role:"user",content:await Promise.all(X.map(async(Q)=>{let Y=$.tools.find((q)=>("name"in q?q.name:q.mcp_server_name)===Q.name);if(!Y||!("run"in Y))return{type:"tool_result",tool_use_id:Q.id,content:`Error: Tool '${Q.name}' not found`,is_error:!0};try{let q=Q.input;if("parse"in Y&&Y.parse)q=Y.parse(q);let W=await Y.run(q,{toolUseBlock:Q,signal:z?.signal});return{type:"tool_result",tool_use_id:Q.id,content:W}}catch(q){return{type:"tool_result",tool_use_id:Q.id,content:q instanceof Y1?q.content:`Error: ${q instanceof Error?q.message:String(q)}`,is_error:!0}}}))}}var M4,q1,R$,Y0,L0,D0,c0,q$,O4,Cz,R3,D4;var P3=S(()=>{v0();$6();B0();r();J4();D4=class D4{constructor($,Z,z){M4.add(this),this.client=$,q1.set(this,!1),R$.set(this,!1),Y0.set(this,void 0),L0.set(this,void 0),D0.set(this,void 0),c0.set(this,void 0),q$.set(this,void 0),O4.set(this,0),I(this,Y0,{params:{...Z,messages:structuredClone(Z.messages)}},"f");let J=["BetaToolRunner",...Y3(Z.tools,Z.messages)].join(", ");if(I(this,L0,{...z,headers:T([{"x-stainless-helper":J},z?.headers])},"f"),I(this,q$,jz(),"f"),Z.compactionControl?.enabled)console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. See https://platform.claude.com/docs/en/build-with-claude/compaction')}async*[(q1=new WeakMap,R$=new WeakMap,Y0=new WeakMap,L0=new WeakMap,D0=new WeakMap,c0=new WeakMap,q$=new WeakMap,O4=new WeakMap,M4=new WeakSet,Cz=async function(){let Z=H(this,Y0,"f").params.compactionControl;if(!Z||!Z.enabled)return!1;let z=0;if(H(this,D0,"f")!==void 0)try{let W=await H(this,D0,"f");z=W.usage.input_tokens+(W.usage.cache_creation_input_tokens??0)+(W.usage.cache_read_input_tokens??0)+W.usage.output_tokens}catch{return!1}let X=Z.contextTokenThreshold??_z;if(z<X)return!1;let J=Z.model??H(this,Y0,"f").params.model,Q=Z.summaryPrompt??Ez,Y=H(this,Y0,"f").params.messages;if(Y[Y.length-1].role==="assistant"){let W=Y[Y.length-1];if(Array.isArray(W.content)){let G=W.content.filter((U)=>U.type!=="tool_use");if(G.length===0)Y.pop();else W.content=G}}let q=await this.client.beta.messages.create({model:J,messages:[...Y,{role:"user",content:[{type:"text",text:Q}]}],max_tokens:H(this,Y0,"f").params.max_tokens},{signal:H(this,L0,"f").signal,headers:T([H(this,L0,"f").headers,{"x-stainless-helper":"compaction"}])});if(q.content[0]?.type!=="text")throw new P("Expected text response for compaction");return H(this,Y0,"f").params.messages=[{role:"user",content:q.content}],!0},Symbol.asyncIterator)](){var $;if(H(this,q1,"f"))throw new P("Cannot iterate over a consumed stream");I(this,q1,!0,"f"),I(this,R$,!0,"f"),I(this,c0,void 0,"f");try{while(!0){let Z;try{if(H(this,Y0,"f").params.max_iterations&&H(this,O4,"f")>=H(this,Y0,"f").params.max_iterations)break;I(this,R$,!1,"f"),I(this,c0,void 0,"f"),I(this,O4,($=H(this,O4,"f"),$++,$),"f"),I(this,D0,void 0,"f");let{max_iterations:z,compactionControl:X,...J}=H(this,Y0,"f").params;if(J.stream)Z=this.client.beta.messages.stream({...J},H(this,L0,"f")),I(this,D0,Z.finalMessage(),"f"),H(this,D0,"f").catch(()=>{}),yield Z;else I(this,D0,this.client.beta.messages.create({...J,stream:!1},H(this,L0,"f")),"f"),yield H(this,D0,"f");if(!await H(this,M4,"m",Cz).call(this)){if(!H(this,R$,"f")){let{role:q,content:W}=await H(this,D0,"f");H(this,Y0,"f").params.messages.push({role:q,content:W})}let Y=await H(this,M4,"m",R3).call(this,H(this,Y0,"f").params.messages.at(-1));if(Y)H(this,Y0,"f").params.messages.push(Y);else if(!H(this,R$,"f"))break}}finally{if(Z)Z.abort()}}if(!H(this,D0,"f"))throw new P("ToolRunner concluded without a message from the server");H(this,q$,"f").resolve(await H(this,D0,"f"))}catch(Z){throw I(this,q1,!1,"f"),H(this,q$,"f").promise.catch(()=>{}),H(this,q$,"f").reject(Z),I(this,q$,jz(),"f"),Z}}setMessagesParams($){if(typeof $==="function")H(this,Y0,"f").params=$(H(this,Y0,"f").params);else H(this,Y0,"f").params=$;I(this,R$,!0,"f"),I(this,c0,void 0,"f")}setRequestOptions($){if(typeof $==="function")I(this,L0,$(H(this,L0,"f")),"f");else I(this,L0,{...H(this,L0,"f"),...$},"f")}async generateToolResponse($=H(this,L0,"f").signal){let Z=await H(this,D0,"f")??this.params.messages.at(-1);if(!Z)return null;return H(this,M4,"m",R3).call(this,Z,$)}done(){return H(this,q$,"f").promise}async runUntilDone(){if(!H(this,q1,"f"))for await(let $ of this);return this.done()}get params(){return H(this,Y0,"f").params}pushMessages(...$){this.setMessagesParams((Z)=>({...Z,messages:[...Z.messages,...$]}))}then($,Z){return this.runUntilDone().then($,Z)}};R3=async function(Z,z=H(this,L0,"f").signal){if(H(this,c0,"f")!==void 0)return H(this,c0,"f");return I(this,c0,wL(H(this,Y0,"f").params,Z,{...H(this,L0,"f"),signal:z}),"f"),H(this,c0,"f")}});var W1;var _3=S(()=>{B0();r8();W1=class W1{constructor($,Z){this.iterator=$,this.controller=Z}async*decoder(){let $=new J$;for await(let Z of this.iterator)for(let z of $.decode(Z))yield JSON.parse(z);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 P("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 P("Attempted to iterate over a response with no body")}return new W1(r1($.body),Z)}}});var A4;var E3=S(()=>{t();r();_3();X1();X0();A4=class A4 extends f{create($,Z){let{betas:z,...X}=$;return this._client.post("/v1/messages/batches?beta=true",{body:X,...Z,headers:T([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},Z?.headers])})}retrieve($,Z={},z){let{betas:X}=Z??{};return this._client.get(D`/v1/messages/batches/${$}?beta=true`,{...z,headers:T([{"anthropic-beta":[...X??[],"message-batches-2024-09-24"].toString()},z?.headers])})}list($={},Z){let{betas:z,...X}=$??{};return this._client.getAPIList("/v1/messages/batches?beta=true",S0,{query:X,...Z,headers:T([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},Z?.headers])})}delete($,Z={},z){let{betas:X}=Z??{};return this._client.delete(D`/v1/messages/batches/${$}?beta=true`,{...z,headers:T([{"anthropic-beta":[...X??[],"message-batches-2024-09-24"].toString()},z?.headers])})}cancel($,Z={},z){let{betas:X}=Z??{};return this._client.post(D`/v1/messages/batches/${$}/cancel?beta=true`,{...z,headers:T([{"anthropic-beta":[...X??[],"message-batches-2024-09-24"].toString()},z?.headers])})}async results($,Z={},z){let X=await this.retrieve($);if(!X.results_url)throw new P(`No batch \`results_url\`; Has it finished processing? ${X.processing_status} - ${X.id}`);let{betas:J}=Z??{};return this._client.get(X.results_url,{...z,headers:T([{"anthropic-beta":[...J??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},z?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((Q,Y)=>W1.fromResponse(Y.response,Y.controller))}}});function bz($){if(!$.output_format)return $;if($.output_config?.format)throw new P("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:Z,...z}=$;return{...z,output_config:{...$.output_config,format:Z}}}var Sz,RL,W$;var C3=S(()=>{X1();L3();r();J4();M3();Pz();P3();$6();E3();E3();P3();$6();Sz={"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"},RL=["claude-mythos-preview","claude-opus-4-6"];W$=class W$ extends f{constructor(){super(...arguments);this.batches=new A4(this._client)}create($,Z){let z=bz($),{betas:X,...J}=z;if(J.model in Sz)console.warn(`The model '${J.model}' is deprecated and will reach end-of-life on ${Sz[J.model]}
196
+ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(RL.includes(J.model)&&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 q=l2[J.model]??void 0;Q=this._client.calculateNonstreamingTimeout(J.max_tokens,q)}let Y=p2(J.tools,J.messages);return this._client.post("/v1/messages?beta=true",{body:J,timeout:Q??600000,...Z,headers:T([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Y,Z?.headers]),stream:z.stream??!1})}parse($,Z){return Z={...Z,headers:T([{"anthropic-beta":[...$.betas??[],"structured-outputs-2025-12-15"].toString()},Z?.headers])},this.create($,Z).then((z)=>T3(z,$,{logger:this._client.logger??console}))}stream($,Z){return T4.createMessage(this,$,Z)}countTokens($,Z){let z=bz($),{betas:X,...J}=z;return this._client.post("/v1/messages/count_tokens?beta=true",{body:J,...Z,headers:T([{"anthropic-beta":[...X??[],"token-counting-2024-11-01"].toString()},Z?.headers])})}toolRunner($,Z){return new D4(this._client,$,Z)}};W$.Batches=A4;W$.BetaToolRunner=D4;W$.ToolError=Y1});var I4;var j3=S(()=>{t();r();X0();I4=class I4 extends f{list($,Z={},z){let{betas:X,...J}=Z??{};return this._client.getAPIList(D`/v1/sessions/${$}/events?beta=true`,l,{query:J,...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}send($,Z,z){let{betas:X,...J}=Z;return this._client.post(D`/v1/sessions/${$}/events?beta=true`,{body:J,...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}stream($,Z={},z){let{betas:X}=Z??{};return this._client.get(D`/v1/sessions/${$}/events/stream?beta=true`,{...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers]),stream:!0})}}});var w4;var S3=S(()=>{t();r();X0();w4=class w4 extends f{retrieve($,Z,z){let{session_id:X,betas:J}=Z;return this._client.get(D`/v1/sessions/${X}/resources/${$}?beta=true`,{...z,headers:T([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}update($,Z,z){let{session_id:X,betas:J,...Q}=Z;return this._client.post(D`/v1/sessions/${X}/resources/${$}?beta=true`,{body:Q,...z,headers:T([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}list($,Z={},z){let{betas:X,...J}=Z??{};return this._client.getAPIList(D`/v1/sessions/${$}/resources?beta=true`,l,{query:J,...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}delete($,Z,z){let{session_id:X,betas:J}=Z;return this._client.delete(D`/v1/sessions/${X}/resources/${$}?beta=true`,{...z,headers:T([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}add($,Z,z){let{betas:X,...J}=Z;return this._client.post(D`/v1/sessions/${$}/resources?beta=true`,{body:J,...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}}});var P$;var b3=S(()=>{j3();j3();S3();S3();t();r();X0();P$=class P$ extends f{constructor(){super(...arguments);this.events=new I4(this._client),this.resources=new w4(this._client)}create($,Z){let{betas:z,...X}=$;return this._client.post("/v1/sessions?beta=true",{body:X,...Z,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},z){let{betas:X}=Z??{};return this._client.get(D`/v1/sessions/${$}?beta=true`,{...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}update($,Z,z){let{betas:X,...J}=Z;return this._client.post(D`/v1/sessions/${$}?beta=true`,{body:J,...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}list($={},Z){let{betas:z,...X}=$??{};return this._client.getAPIList("/v1/sessions?beta=true",l,{query:X,...Z,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},z){let{betas:X}=Z??{};return this._client.delete(D`/v1/sessions/${$}?beta=true`,{...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}archive($,Z={},z){let{betas:X}=Z??{};return this._client.post(D`/v1/sessions/${$}/archive?beta=true`,{...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}};P$.Events=I4;P$.Resources=w4});var F4;var x3=S(()=>{t();r();Z1();X0();F4=class F4 extends f{create($,Z={},z){let{betas:X,...J}=Z??{};return this._client.post(D`/v1/skills/${$}/versions?beta=true`,$1({body:J,...z,headers:T([{"anthropic-beta":[...X??[],"skills-2025-10-02"].toString()},z?.headers])},this._client))}retrieve($,Z,z){let{skill_id:X,betas:J}=Z;return this._client.get(D`/v1/skills/${X}/versions/${$}?beta=true`,{...z,headers:T([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},z?.headers])})}list($,Z={},z){let{betas:X,...J}=Z??{};return this._client.getAPIList(D`/v1/skills/${$}/versions?beta=true`,l,{query:J,...z,headers:T([{"anthropic-beta":[...X??[],"skills-2025-10-02"].toString()},z?.headers])})}delete($,Z,z){let{skill_id:X,betas:J}=Z;return this._client.delete(D`/v1/skills/${X}/versions/${$}?beta=true`,{...z,headers:T([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},z?.headers])})}}});var G1;var y3=S(()=>{x3();x3();t();r();Z1();X0();G1=class G1 extends f{constructor(){super(...arguments);this.versions=new F4(this._client)}create($={},Z){let{betas:z,...X}=$??{};return this._client.post("/v1/skills?beta=true",$1({body:X,...Z,headers:T([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},Z?.headers])},this._client,!1))}retrieve($,Z={},z){let{betas:X}=Z??{};return this._client.get(D`/v1/skills/${$}?beta=true`,{...z,headers:T([{"anthropic-beta":[...X??[],"skills-2025-10-02"].toString()},z?.headers])})}list($={},Z){let{betas:z,...X}=$??{};return this._client.getAPIList("/v1/skills?beta=true",l,{query:X,...Z,headers:T([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},Z?.headers])})}delete($,Z={},z){let{betas:X}=Z??{};return this._client.delete(D`/v1/skills/${$}?beta=true`,{...z,headers:T([{"anthropic-beta":[...X??[],"skills-2025-10-02"].toString()},z?.headers])})}};G1.Versions=F4});var R4;var k3=S(()=>{t();r();X0();R4=class R4 extends f{create($,Z,z){let{betas:X,...J}=Z;return this._client.post(D`/v1/vaults/${$}/credentials?beta=true`,{body:J,...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}retrieve($,Z,z){let{vault_id:X,betas:J}=Z;return this._client.get(D`/v1/vaults/${X}/credentials/${$}?beta=true`,{...z,headers:T([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}update($,Z,z){let{vault_id:X,betas:J,...Q}=Z;return this._client.post(D`/v1/vaults/${X}/credentials/${$}?beta=true`,{body:Q,...z,headers:T([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}list($,Z={},z){let{betas:X,...J}=Z??{};return this._client.getAPIList(D`/v1/vaults/${$}/credentials?beta=true`,l,{query:J,...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}delete($,Z,z){let{vault_id:X,betas:J}=Z;return this._client.delete(D`/v1/vaults/${X}/credentials/${$}?beta=true`,{...z,headers:T([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}archive($,Z,z){let{vault_id:X,betas:J}=Z;return this._client.post(D`/v1/vaults/${X}/credentials/${$}/archive?beta=true`,{...z,headers:T([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}}});var U1;var f3=S(()=>{k3();k3();t();r();X0();U1=class U1 extends f{constructor(){super(...arguments);this.credentials=new R4(this._client)}create($,Z){let{betas:z,...X}=$;return this._client.post("/v1/vaults?beta=true",{body:X,...Z,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},z){let{betas:X}=Z??{};return this._client.get(D`/v1/vaults/${$}?beta=true`,{...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}update($,Z,z){let{betas:X,...J}=Z;return this._client.post(D`/v1/vaults/${$}?beta=true`,{body:J,...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}list($={},Z){let{betas:z,...X}=$??{};return this._client.getAPIList("/v1/vaults?beta=true",l,{query:X,...Z,headers:T([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},z){let{betas:X}=Z??{};return this._client.delete(D`/v1/vaults/${$}?beta=true`,{...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}archive($,Z={},z){let{betas:X}=Z??{};return this._client.post(D`/v1/vaults/${$}/archive?beta=true`,{...z,headers:T([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},z?.headers])})}};U1.Credentials=R4});var K0;var g3=S(()=>{Q3();Q3();q3();q3();W3();W3();G3();G3();V3();V3();B3();B3();C3();C3();b3();b3();y3();y3();f3();f3();K0=class K0 extends f{constructor(){super(...arguments);this.models=new Y4(this._client),this.messages=new W$(this._client),this.agents=new z1(this._client),this.environments=new z4(this._client),this.sessions=new P$(this._client),this.vaults=new U1(this._client),this.memoryStores=new w$(this._client),this.files=new Q4(this._client),this.skills=new G1(this._client),this.userProfiles=new q4(this._client)}};K0.Models=Y4;K0.Messages=W$;K0.Agents=z1;K0.Environments=z4;K0.Sessions=P$;K0.Vaults=U1;K0.MemoryStores=w$;K0.Files=Q4;K0.Skills=G1;K0.UserProfiles=q4});var V1;var h3=S(()=>{r();V1=class V1 extends f{create($,Z){let{betas:z,...X}=$;return this._client.post("/v1/complete",{body:X,timeout:this._client._options.timeout??600000,...Z,headers:T([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},Z?.headers]),stream:$.stream??!1})}}});function xz($){return $?.output_config?.format}function v3($,Z,z){let X=xz(Z);if(!Z||!("parse"in(X??{})))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 u3($,Z,z)}function u3($,Z,z){let X=null,J=$.content.map((Q)=>{if(Q.type==="text"){let Y=yL(Z,Q.text);if(X===null)X=Y;return Object.defineProperty({...Q},"parsed_output",{value:Y,enumerable:!1})}return Q});return{...$,content:J,parsed_output:X}}function yL($,Z){let z=xz($);if(z?.type!=="json_schema")return null;try{if("parse"in z)return z.parse(Z);return JSON.parse(Z)}catch(X){throw new P(`Failed to parse structured output: ${X}`)}}var m3=S(()=>{B0()});function gz($){return $.type==="tool_use"||$.type==="server_tool_use"}function hz($){}var R0,G$,K1,P4,Z6,_4,E4,z6,C4,p0,j4,X6,J6,_$,Q6,Y6,S4,d3,yz,c3,p3,l3,i3,kz,fz="__json_buf",b4;var vz=S(()=>{v0();X1();D3();O3();m3();b4=class b4{constructor($,Z){R0.add(this),this.messages=[],this.receivedMessages=[],G$.set(this,void 0),K1.set(this,null),this.controller=new AbortController,P4.set(this,void 0),Z6.set(this,()=>{}),_4.set(this,()=>{}),E4.set(this,void 0),z6.set(this,()=>{}),C4.set(this,()=>{}),p0.set(this,{}),j4.set(this,!1),X6.set(this,!1),J6.set(this,!1),_$.set(this,!1),Q6.set(this,void 0),Y6.set(this,void 0),S4.set(this,void 0),c3.set(this,(z)=>{if(I(this,X6,!0,"f"),u0(z))z=new U0;if(z instanceof U0)return I(this,J6,!0,"f"),this._emit("abort",z);if(z instanceof P)return this._emit("error",z);if(z instanceof Error){let X=new P(z.message);return X.cause=z,this._emit("error",X)}return this._emit("error",new P(String(z)))}),I(this,P4,new Promise((z,X)=>{I(this,Z6,z,"f"),I(this,_4,X,"f")}),"f"),I(this,E4,new Promise((z,X)=>{I(this,z6,z,"f"),I(this,C4,X,"f")}),"f"),H(this,P4,"f").catch(()=>{}),H(this,E4,"f").catch(()=>{}),I(this,K1,$,"f"),I(this,S4,Z?.logger??console,"f")}get response(){return H(this,Q6,"f")}get request_id(){return H(this,Y6,"f")}async withResponse(){I(this,_$,!0,"f");let $=await H(this,P4,"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 b4(null);return Z._run(()=>Z._fromReadableStream($)),Z}static createMessage($,Z,z,{logger:X}={}){let J=new b4(Z,{logger:X});for(let Q of Z.messages)J._addMessageParam(Q);return I(J,K1,{...Z,stream:!0},"f"),J._run(()=>J._createMessage($,{...Z,stream:!0},{...z,headers:{...z?.headers,"X-Stainless-Helper-Method":"stream"}})),J}_run($){$().then(()=>{this._emitFinal(),this._emit("end")},H(this,c3,"f"))}_addMessageParam($){this.messages.push($)}_addMessage($,Z=!0){if(this.receivedMessages.push($),Z)this._emit("message",$)}async _createMessage($,Z,z){let X=z?.signal,J;if(X){if(X.aborted)this.controller.abort();J=this.controller.abort.bind(this.controller),X.addEventListener("abort",J)}try{H(this,R0,"m",p3).call(this);let{response:Q,data:Y}=await $.create({...Z,stream:!0},{...z,signal:this.controller.signal}).withResponse();this._connected(Q);for await(let q of Y)H(this,R0,"m",l3).call(this,q);if(Y.controller.signal?.aborted)throw new U0;H(this,R0,"m",i3).call(this)}finally{if(X&&J)X.removeEventListener("abort",J)}}_connected($){if(this.ended)return;I(this,Q6,$,"f"),I(this,Y6,$?.headers.get("request-id"),"f"),H(this,Z6,"f").call(this,$),this._emit("connect")}get ended(){return H(this,j4,"f")}get errored(){return H(this,X6,"f")}get aborted(){return H(this,J6,"f")}abort(){this.controller.abort()}on($,Z){return(H(this,p0,"f")[$]||(H(this,p0,"f")[$]=[])).push({listener:Z}),this}off($,Z){let z=H(this,p0,"f")[$];if(!z)return this;let X=z.findIndex((J)=>J.listener===Z);if(X>=0)z.splice(X,1);return this}once($,Z){return(H(this,p0,"f")[$]||(H(this,p0,"f")[$]=[])).push({listener:Z,once:!0}),this}emitted($){return new Promise((Z,z)=>{if(I(this,_$,!0,"f"),$!=="error")this.once("error",z);this.once($,Z)})}async done(){I(this,_$,!0,"f"),await H(this,E4,"f")}get currentMessage(){return H(this,G$,"f")}async finalMessage(){return await this.done(),H(this,R0,"m",d3).call(this)}async finalText(){return await this.done(),H(this,R0,"m",yz).call(this)}_emit($,...Z){if(H(this,j4,"f"))return;if($==="end")I(this,j4,!0,"f"),H(this,z6,"f").call(this);let z=H(this,p0,"f")[$];if(z)H(this,p0,"f")[$]=z.filter((X)=>!X.once),z.forEach(({listener:X})=>X(...Z));if($==="abort"){let X=Z[0];if(!H(this,_$,"f")&&!z?.length)Promise.reject(X);H(this,_4,"f").call(this,X),H(this,C4,"f").call(this,X),this._emit("end");return}if($==="error"){let X=Z[0];if(!H(this,_$,"f")&&!z?.length)Promise.reject(X);H(this,_4,"f").call(this,X),H(this,C4,"f").call(this,X),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",H(this,R0,"m",d3).call(this))}async _fromReadableStream($,Z){let z=Z?.signal,X;if(z){if(z.aborted)this.controller.abort();X=this.controller.abort.bind(this.controller),z.addEventListener("abort",X)}try{H(this,R0,"m",p3).call(this),this._connected(null);let J=O0.fromReadableStream($,this.controller);for await(let Q of J)H(this,R0,"m",l3).call(this,Q);if(J.controller.signal?.aborted)throw new U0;H(this,R0,"m",i3).call(this)}finally{if(z&&X)z.removeEventListener("abort",X)}}[(G$=new WeakMap,K1=new WeakMap,P4=new WeakMap,Z6=new WeakMap,_4=new WeakMap,E4=new WeakMap,z6=new WeakMap,C4=new WeakMap,p0=new WeakMap,j4=new WeakMap,X6=new WeakMap,J6=new WeakMap,_$=new WeakMap,Q6=new WeakMap,Y6=new WeakMap,S4=new WeakMap,c3=new WeakMap,R0=new WeakSet,d3=function(){if(this.receivedMessages.length===0)throw new P("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},yz=function(){if(this.receivedMessages.length===0)throw new P("stream ended without producing a Message with role=assistant");let Z=this.receivedMessages.at(-1).content.filter((z)=>z.type==="text").map((z)=>z.text);if(Z.length===0)throw new P("stream ended without producing a content block with type=text");return Z.join(" ")},p3=function(){if(this.ended)return;I(this,G$,void 0,"f")},l3=function(Z){if(this.ended)return;let z=H(this,R0,"m",kz).call(this,Z);switch(this._emit("streamEvent",Z,z),Z.type){case"content_block_delta":{let X=z.content.at(-1);switch(Z.delta.type){case"text_delta":{if(X.type==="text")this._emit("text",Z.delta.text,X.text||"");break}case"citations_delta":{if(X.type==="text")this._emit("citation",Z.delta.citation,X.citations??[]);break}case"input_json_delta":{if(gz(X)&&X.input)this._emit("inputJson",Z.delta.partial_json,X.input);break}case"thinking_delta":{if(X.type==="thinking")this._emit("thinking",Z.delta.thinking,X.thinking);break}case"signature_delta":{if(X.type==="thinking")this._emit("signature",X.signature);break}default:hz(Z.delta)}break}case"message_stop":{this._addMessageParam(z),this._addMessage(v3(z,H(this,K1,"f"),{logger:H(this,S4,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",z.content.at(-1));break}case"message_start":{I(this,G$,z,"f");break}case"content_block_start":case"message_delta":break}},i3=function(){if(this.ended)throw new P("stream has ended, this shouldn't happen");let Z=H(this,G$,"f");if(!Z)throw new P("request ended without sending any chunks");return I(this,G$,void 0,"f"),v3(Z,H(this,K1,"f"),{logger:H(this,S4,"f")})},kz=function(Z){let z=H(this,G$,"f");if(Z.type==="message_start"){if(z)throw new P(`Unexpected event order, got ${Z.type} before receiving "message_stop"`);return Z.message}if(!z)throw new P(`Unexpected event order, got ${Z.type} before "message_start"`);switch(Z.type){case"message_stop":return z;case"message_delta":if(z.stop_reason=Z.delta.stop_reason,z.stop_sequence=Z.delta.stop_sequence,z.usage.output_tokens=Z.usage.output_tokens,Z.usage.input_tokens!=null)z.usage.input_tokens=Z.usage.input_tokens;if(Z.usage.cache_creation_input_tokens!=null)z.usage.cache_creation_input_tokens=Z.usage.cache_creation_input_tokens;if(Z.usage.cache_read_input_tokens!=null)z.usage.cache_read_input_tokens=Z.usage.cache_read_input_tokens;if(Z.usage.server_tool_use!=null)z.usage.server_tool_use=Z.usage.server_tool_use;return z;case"content_block_start":return z.content.push({...Z.content_block}),z;case"content_block_delta":{let X=z.content.at(Z.index);switch(Z.delta.type){case"text_delta":{if(X?.type==="text")z.content[Z.index]={...X,text:(X.text||"")+Z.delta.text};break}case"citations_delta":{if(X?.type==="text")z.content[Z.index]={...X,citations:[...X.citations??[],Z.delta.citation]};break}case"input_json_delta":{if(X&&gz(X)){let J=X[fz]||"";J+=Z.delta.partial_json;let Q={...X};if(Object.defineProperty(Q,fz,{value:J,enumerable:!1,writable:!0}),J)Q.input=i2(J);z.content[Z.index]=Q}break}case"thinking_delta":{if(X?.type==="thinking")z.content[Z.index]={...X,thinking:X.thinking+Z.delta.thinking};break}case"signature_delta":{if(X?.type==="thinking")z.content[Z.index]={...X,signature:Z.delta.signature};break}default:hz(Z.delta)}return z}case"content_block_stop":return z}},Symbol.asyncIterator)](){let $=[],Z=[],z=!1;return this.on("streamEvent",(X)=>{let J=Z.shift();if(J)J.resolve(X);else $.push(X)}),this.on("end",()=>{z=!0;for(let X of Z)X.resolve(void 0);Z.length=0}),this.on("abort",(X)=>{z=!0;for(let J of Z)J.reject(X);Z.length=0}),this.on("error",(X)=>{z=!0;for(let J of Z)J.reject(X);Z.length=0}),{next:async()=>{if(!$.length){if(z)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 O0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var x4;var n3=S(()=>{t();r();_3();X1();X0();x4=class x4 extends f{create($,Z){return this._client.post("/v1/messages/batches",{body:$,...Z})}retrieve($,Z){return this._client.get(D`/v1/messages/batches/${$}`,Z)}list($={},Z){return this._client.getAPIList("/v1/messages/batches",S0,{query:$,...Z})}delete($,Z){return this._client.delete(D`/v1/messages/batches/${$}`,Z)}cancel($,Z){return this._client.post(D`/v1/messages/batches/${$}/cancel`,Z)}async results($,Z){let z=await this.retrieve($);if(!z.results_url)throw new P(`No batch \`results_url\`; Has it finished processing? ${z.processing_status} - ${z.id}`);return this._client.get(z.results_url,{...Z,headers:T([{Accept:"application/binary"},Z?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((X,J)=>W1.fromResponse(J.response,J.controller))}}});var E$,uz,fL;var r3=S(()=>{r();J4();vz();m3();n3();n3();L3();E$=class E$ extends f{constructor(){super(...arguments);this.batches=new x4(this._client)}create($,Z){if($.model in uz)console.warn(`The model '${$.model}' is deprecated and will reach end-of-life on ${uz[$.model]}
197
+ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(fL.includes($.model)&&$.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 z=this._client._options.timeout;if(!$.stream&&z==null){let J=l2[$.model]??void 0;z=this._client.calculateNonstreamingTimeout($.max_tokens,J)}let X=p2($.tools,$.messages);return this._client.post("/v1/messages",{body:$,timeout:z??600000,...Z,headers:T([X,Z?.headers]),stream:$.stream??!1})}parse($,Z){return this.create($,Z).then((z)=>u3(z,$,{logger:this._client.logger??console}))}stream($,Z){return b4.createMessage(this,$,Z,{logger:this._client.logger??console})}countTokens($,Z){return this._client.post("/v1/messages/count_tokens",{body:$,...Z})}};uz={"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","claude-opus-4-0":"June 15th, 2026","claude-opus-4-20250514":"June 15th, 2026","claude-sonnet-4-0":"June 15th, 2026","claude-sonnet-4-20250514":"June 15th, 2026"},fL=["claude-mythos-preview","claude-opus-4-6"];E$.Batches=x4});var H1;var s3=S(()=>{t();r();X0();H1=class H1 extends f{retrieve($,Z={},z){let{betas:X}=Z??{};return this._client.get(D`/v1/models/${$}`,{...z,headers:T([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},z?.headers])})}list($={},Z){let{betas:z,...X}=$??{};return this._client.getAPIList("/v1/models",S0,{query:X,...Z,headers:T([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},Z?.headers])})}}});var mz=S(()=>{g3();h3();r3();s3();Lz()});var y4=($)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[$]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.($)?.trim()||void 0;return};class a{constructor({baseURL:$=y4("ANTHROPIC_BASE_URL"),apiKey:Z=y4("ANTHROPIC_API_KEY")??null,authToken:z=y4("ANTHROPIC_AUTH_TOKEN")??null,...X}={}){a3.add(this),q6.set(this,void 0);let J={apiKey:Z,authToken:z,...X,baseURL:$||"https://api.anthropic.com"};if(!J.dangerouslyAllowBrowser&&e7())throw new P(`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??i3.DEFAULT_TIMEOUT,this.logger=J.logger??console;let Q="warn";this.logLevel=Q,this.logLevel=p8(J.logLevel,"ClientOptions.logLevel",this)??p8(b2("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??Q,this.fetchOptions=J.fetchOptions,this.maxRetries=J.maxRetries??2,this.fetch=J.fetch??iX(),w(this,X6,rX,"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 T([await this.apiKeyAuth($),await this.bearerAuth($)])}async apiKeyAuth($){if(this.apiKey==null)return;return T([{"X-Api-Key":this.apiKey}])}async bearerAuth($){if(this.authToken==null)return;return T([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery($){return sX($)}getUserAgent(){return`${this.constructor.name}/JS ${z$}`}defaultIdempotencyKey(){return`stainless-node-retry-${f8()}`}makeStatusError($,Z,X,z){return X0.generate($,Z,X,z)}buildURL($,Z,X){let z=!H(this,l3,"m",x7).call(this)&&X||this.baseURL,J=gX($)?new URL($):new URL(z+(z.endsWith("/")&&$.startsWith("/")?$.slice(1):$)),Q=this.defaultQuery(),Y=Object.fromEntries(J.searchParams);if(!v8(Q)||!v8(Y))Z={...Y,...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 P("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 Q$(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:Y,timeout:q}=await this.buildRequest(z,{retryCount:J-Z});await this.prepareRequest(Q,{url:Y,options:z});let G="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),W=X===void 0?"":`, retryOf: ${X}`,U=Date.now();if(q0(this).debug(`[${G}] sending request`,u0({retryOfRequestLogID:X,method:z.method,url:Y,options:z,headers:Q.headers})),z.signal?.aborted)throw new W0;let V=new AbortController,K=await this.fetchWithTimeout(Y,Q,q,V).catch(l1),N=Date.now();if(K instanceof globalThis.Error){let M=`retrying, ${Z} attempts remaining`;if(z.signal?.aborted)throw new W0;let F=v0(K)||/timed? ?out/i.test(String(K)+("cause"in K?String(K.cause):""));if(Z)return q0(this).info(`[${G}] connection ${F?"timed out":"failed"} - ${M}`),q0(this).debug(`[${G}] connection ${F?"timed out":"failed"} (${M})`,u0({retryOfRequestLogID:X,url:Y,durationMs:N-U,message:K.message})),this.retryRequest(z,Z,X??G);if(q0(this).info(`[${G}] connection ${F?"timed out":"failed"} - error; no more retries left`),q0(this).debug(`[${G}] connection ${F?"timed out":"failed"} (error; no more retries left)`,u0({retryOfRequestLogID:X,url:Y,durationMs:N-U,message:K.message})),F)throw new p$;throw new X$({cause:K})}let O=[...K.headers.entries()].filter(([M])=>M==="request-id").map(([M,F])=>", "+M+": "+JSON.stringify(F)).join(""),B=`[${G}${W}${O}] ${Q.method} ${Y} ${K.ok?"succeeded":"failed"} with status ${K.status} in ${N-U}ms`;if(!K.ok){let M=await this.shouldRetry(K);if(Z&&M){let R=`retrying, ${Z} attempts remaining`;return await nX(K.body),q0(this).info(`${B} - ${R}`),q0(this).debug(`[${G}] response error (${R})`,u0({retryOfRequestLogID:X,url:K.url,status:K.status,headers:K.headers,durationMs:N-U})),this.retryRequest(z,Z,X??G,K.headers)}let F=M?"error; no more retries left":"error; not retryable";q0(this).info(`${B} - ${F}`);let _=await K.text().catch((R)=>l1(R).message),b=j4(_),x=b?void 0:_;throw q0(this).debug(`[${G}] response error (${F})`,u0({retryOfRequestLogID:X,url:K.url,status:K.status,headers:K.headers,message:x,durationMs:Date.now()-U})),this.makeStatusError(K.status,b,x,K.headers)}return q0(this).info(B),q0(this).debug(`[${G}] response start`,u0({retryOfRequestLogID:X,url:K.url,status:K.status,headers:K.headers,durationMs:N-U})),{response:K,options:z,controller:V,requestLogID:G,retryOfRequestLogID:X,startTime:U}}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 o1(this,X,$)}async fetchWithTimeout($,Z,X,z){let{signal:J,method:Q,...Y}=Z||{},q=this._makeAbort(z);if(J)J.addEventListener("abort",q,{once:!0});let G=setTimeout(q,X),W=globalThis.ReadableStream&&Y.body instanceof globalThis.ReadableStream||typeof Y.body==="object"&&Y.body!==null&&Symbol.asyncIterator in Y.body,U={signal:z.signal,...W?{duplex:"half"}:{},method:"GET",...Y};if(Q)U.method=Q.toUpperCase();try{return await this.fetch.call(void 0,$,U)}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 q=parseFloat(Q);if(!Number.isNaN(q))J=q}let Y=z?.get("retry-after");if(Y&&!J){let q=parseFloat(Y);if(!Number.isNaN(q))J=q*1000;else J=Date.parse(Y)-Date.now()}if(J===void 0){let q=$.maxRetries??this.maxRetries;J=this.calculateDefaultRetryTimeoutMillis(Z,q)}return await uX(J),this.makeRequest($,Z-1,X)}calculateDefaultRetryTimeoutMillis($,Z){let J=Z-$,Q=Math.min(0.5*Math.pow(2,J),8),Y=1-Math.random()*0.25;return Q*Y*1000}calculateNonstreamingTimeout($,Z){if(3600000*$/128000>600000||Z!=null&&$>Z)throw new P("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:Y}=X,q=this.buildURL(J,Q,Y);if("timeout"in X)vX("timeout",X.timeout);X.timeout=X.timeout??this.timeout;let{bodyHeaders:G,body:W}=this.buildBody({options:X}),U=await this.buildHeaders({options:$,method:z,bodyHeaders:G,retryCount:Z});return{req:{method:z,headers:U,...X.signal&&{signal:X.signal},...globalThis.ReadableStream&&W instanceof globalThis.ReadableStream&&{duplex:"half"},...W&&{body:W},...this.fetchOptions??{},...X.fetchOptions??{}},url:q,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=T([J,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(z),...$.timeout?{"X-Stainless-Timeout":String(Math.trunc($.timeout/1000))}:{},...lX(),...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=T([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:S4($)};else if(typeof $==="object"&&X.values.get("content-type")==="application/x-www-form-urlencoded")return{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery($)};else return H(this,X6,"f").call(this,{body:$,headers:X})}}var l3,i3,X6,x7,n3="\\n\\nHuman:",r3="\\n\\nAssistant:",U$;var s3=S(()=>{h0();A$();u8();aX();B0();t();e8();b7();f4();x3();p3();b3();c3();u8();r();y4();A$();i3=a,X6=new WeakMap,l3=new WeakSet,x7=function(){return this.baseURL!=="https://api.anthropic.com"};a.Anthropic=i3;a.HUMAN_PROMPT=n3;a.AI_PROMPT=r3;a.DEFAULT_TIMEOUT=600000;a.AnthropicError=P;a.APIError=X0;a.APIConnectionError=X$;a.APIConnectionTimeoutError=p$;a.APIUserAbortError=W0;a.NotFoundError=r$;a.ConflictError=s$;a.RateLimitError=o$;a.BadRequestError=l$;a.AuthenticationError=i$;a.InternalServerError=t$;a.PermissionDeniedError=n$;a.UnprocessableEntityError=a$;a.toFile=e1;U$=class U$ extends a{constructor(){super(...arguments);this.completions=new U1(this),this.messages=new _$(this),this.models=new K1(this),this.beta=new V0(this)}};U$.Completions=U1;U$.Messages=_$;U$.Models=K1;U$.Beta=V0});var y7={};Z9(y7,{toFile:()=>e1,default:()=>U$,UnprocessableEntityError:()=>a$,RateLimitError:()=>o$,PermissionDeniedError:()=>n$,PagePromise:()=>o1,NotFoundError:()=>r$,InternalServerError:()=>t$,HUMAN_PROMPT:()=>n3,ConflictError:()=>s$,BaseAnthropic:()=>a,BadRequestError:()=>l$,AuthenticationError:()=>i$,AnthropicError:()=>P,Anthropic:()=>U$,APIUserAbortError:()=>W0,APIPromise:()=>Q$,APIError:()=>X0,APIConnectionTimeoutError:()=>p$,APIConnectionError:()=>X$,AI_PROMPT:()=>r3});var k7=S(()=>{s3();e8();f4();s3();t();B0()});var M9=a7(T9(),1),{program:rN,createCommand:sN,createArgument:aN,createOption:oN,CommanderError:tN,InvalidArgumentError:eN,InvalidOptionArgumentError:$L,Command:O9,Argument:ZL,Option:XL,Help:zL}=M9.default;import{readFileSync as jZ,writeFileSync as hK,existsSync as _Z}from"fs";import{join as CZ,dirname as vK}from"path";var ZK=U8(),XK=b1(),zK=r6(),w8=x1(),JK=T1(),t0=v(),QK=n0(),YK=$0(),qK=s0(),GK=a0(),wT=O4(),WK=O8(),UK=D8(),VK=A8(),w4=PZ(),EZ=N1();var KK=ZK.Composer,HK=XK.Document,BK=zK.Schema,NK=w8.YAMLError,LK=w8.YAMLParseError,TK=w8.YAMLWarning,MK=JK.Alias,OK=t0.isAlias,DK=t0.isCollection,AK=t0.isDocument,wK=t0.isMap,IK=t0.isNode,FK=t0.isPair,RK=t0.isScalar,PK=t0.isSeq,EK=QK.Pair,_K=YK.Scalar,CK=qK.YAMLMap,jK=GK.YAMLSeq;var SK=WK.Lexer,bK=UK.LineCounter,xK=VK.Parser,v1=w4.parse,yK=w4.parseAllDocuments,kK=w4.parseDocument,I8=w4.stringify,fK=EZ.visit,gK=EZ.visitAsync;function c($){let Z=jZ($,"utf-8");return v1(Z)}function s($,Z){let X=Z._meta,z={...Z};delete z._meta;let J=I8(z,{lineWidth:0});if(X?.found&&X.found.length>0){let Q=X.found.join(" + ");J=J.replace(/^(\s+type:\s+\S+)(\s*)$/m,(Y,q,G)=>{if(G.includes("#"))return Y;return`${q} # found: ${Q}`})}hK($,J,"utf-8")}function d($){return jZ($,"utf-8")}function u($=process.cwd()){let Z=["project.faf",".faf"];for(let z of Z){let J=CZ($,z);if(_Z(J))return J}let X=vK($);if(X!==$)for(let z of Z){let J=CZ(X,z);if(_Z(J))return J}return null}p();var u$=[{name:"TROPHY",indicator:`${E0("\uD83C\uDFC6")} ${E0("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${E0(k("★"))} ${E0("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${I("◆")} ${I("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${I("◇")} ${I("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${k("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${L("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${L("○")} RED`,threshold:1},{name:"WHITE",indicator:`${L("♡")}`,threshold:0}];function I4($){return $.indicator}function R8($){for(let Z of u$)if($>=Z.threshold)return Z;return u$[u$.length-1]}var P8=null;function u1(){if(!P8)try{P8=L0("faf-scoring-kernel")}catch{throw Error(`faf-scoring-kernel not installed.
204
+ `);this.baseURL=J.baseURL,this.timeout=J.timeout??o3.DEFAULT_TIMEOUT,this.logger=J.logger??console;let Q="warn";this.logLevel=Q,this.logLevel=s8(J.logLevel,"ClientOptions.logLevel",this)??s8(y4("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??Q,this.fetchOptions=J.fetchOptions,this.maxRetries=J.maxRetries??2,this.fetch=J.fetch??Zz(),I(this,q6,Xz,"f"),this._options=J,this.apiKey=typeof Z==="string"?Z:null,this.authToken=z}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 T([await this.apiKeyAuth($),await this.bearerAuth($)])}async apiKeyAuth($){if(this.apiKey==null)return;return T([{"X-Api-Key":this.apiKey}])}async bearerAuth($){if(this.authToken==null)return;return T([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery($){return Jz($)}getUserAgent(){return`${this.constructor.name}/JS ${X$}`}defaultIdempotencyKey(){return`stainless-node-retry-${m8()}`}makeStatusError($,Z,z,X){return z0.generate($,Z,z,X)}buildURL($,Z,z){let X=!H(this,a3,"m",dz).call(this)&&z||this.baseURL,J=i7($)?new URL($):new URL(X+(X.endsWith("/")&&$.startsWith("/")?$.slice(1):$)),Q=this.defaultQuery(),Y=Object.fromEntries(J.searchParams);if(!p8(Q)||!p8(Y))Z={...Y,...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 P("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:z}){}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,z){return this.request(Promise.resolve(z).then((X)=>{return{method:$,path:Z,...X}}))}request($,Z=null){return new Q$(this,this.makeRequest($,Z,void 0))}async makeRequest($,Z,z){let X=await $,J=X.maxRetries??this.maxRetries;if(Z==null)Z=J;await this.prepareOptions(X);let{req:Q,url:Y,timeout:q}=await this.buildRequest(X,{retryCount:J-Z});await this.prepareRequest(Q,{url:Y,options:X});let W="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),G=z===void 0?"":`, retryOf: ${z}`,U=Date.now();if(q0(this).debug(`[${W}] sending request`,m0({retryOfRequestLogID:z,method:X.method,url:Y,options:X,headers:Q.headers})),X.signal?.aborted)throw new U0;let V=new AbortController,K=await this.fetchWithTimeout(Y,Q,q,V).catch(n1),L=Date.now();if(K instanceof globalThis.Error){let M=`retrying, ${Z} attempts remaining`;if(X.signal?.aborted)throw new U0;let F=u0(K)||/timed? ?out/i.test(String(K)+("cause"in K?String(K.cause):""));if(Z)return q0(this).info(`[${W}] connection ${F?"timed out":"failed"} - ${M}`),q0(this).debug(`[${W}] connection ${F?"timed out":"failed"} (${M})`,m0({retryOfRequestLogID:z,url:Y,durationMs:L-U,message:K.message})),this.retryRequest(X,Z,z??W);if(q0(this).info(`[${W}] connection ${F?"timed out":"failed"} - error; no more retries left`),q0(this).debug(`[${W}] connection ${F?"timed out":"failed"} (error; no more retries left)`,m0({retryOfRequestLogID:z,url:Y,durationMs:L-U,message:K.message})),F)throw new l$;throw new z$({cause:K})}let O=[...K.headers.entries()].filter(([M])=>M==="request-id").map(([M,F])=>", "+M+": "+JSON.stringify(F)).join(""),B=`[${W}${G}${O}] ${Q.method} ${Y} ${K.ok?"succeeded":"failed"} with status ${K.status} in ${L-U}ms`;if(!K.ok){let M=await this.shouldRetry(K);if(Z&&M){let R=`retrying, ${Z} attempts remaining`;return await zz(K.body),q0(this).info(`${B} - ${R}`),q0(this).debug(`[${W}] response error (${R})`,m0({retryOfRequestLogID:z,url:K.url,status:K.status,headers:K.headers,durationMs:L-U})),this.retryRequest(X,Z,z??W,K.headers)}let F=M?"error; no more retries left":"error; not retryable";q0(this).info(`${B} - ${F}`);let E=await K.text().catch((R)=>n1(R).message),b=k2(E),x=b?void 0:E;throw q0(this).debug(`[${W}] response error (${F})`,m0({retryOfRequestLogID:z,url:K.url,status:K.status,headers:K.headers,message:x,durationMs:Date.now()-U})),this.makeStatusError(K.status,b,x,K.headers)}return q0(this).info(B),q0(this).debug(`[${W}] response start`,m0({retryOfRequestLogID:z,url:K.url,status:K.status,headers:K.headers,durationMs:L-U})),{response:K,options:X,controller:V,requestLogID:W,retryOfRequestLogID:z,startTime:U}}getAPIList($,Z,z){return this.requestAPIList(Z,z&&"then"in z?z.then((X)=>({method:"get",path:$,...X})):{method:"get",path:$,...z})}requestAPIList($,Z){let z=this.makeRequest(Z,null,void 0);return new e1(this,z,$)}async fetchWithTimeout($,Z,z,X){let{signal:J,method:Q,...Y}=Z||{},q=this._makeAbort(X);if(J)J.addEventListener("abort",q,{once:!0});let W=setTimeout(q,z),G=globalThis.ReadableStream&&Y.body instanceof globalThis.ReadableStream||typeof Y.body==="object"&&Y.body!==null&&Symbol.asyncIterator in Y.body,U={signal:X.signal,...G?{duplex:"half"}:{},method:"GET",...Y};if(Q)U.method=Q.toUpperCase();try{return await this.fetch.call(void 0,$,U)}finally{clearTimeout(W)}}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,z,X){let J,Q=X?.get("retry-after-ms");if(Q){let q=parseFloat(Q);if(!Number.isNaN(q))J=q}let Y=X?.get("retry-after");if(Y&&!J){let q=parseFloat(Y);if(!Number.isNaN(q))J=q*1000;else J=Date.parse(Y)-Date.now()}if(J===void 0){let q=$.maxRetries??this.maxRetries;J=this.calculateDefaultRetryTimeoutMillis(Z,q)}return await s7(J),this.makeRequest($,Z-1,z)}calculateDefaultRetryTimeoutMillis($,Z){let J=Z-$,Q=Math.min(0.5*Math.pow(2,J),8),Y=1-Math.random()*0.25;return Q*Y*1000}calculateNonstreamingTimeout($,Z){if(3600000*$/128000>600000||Z!=null&&$>Z)throw new P("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 z={...$},{method:X,path:J,query:Q,defaultBaseURL:Y}=z,q=this.buildURL(J,Q,Y);if("timeout"in z)r7("timeout",z.timeout);z.timeout=z.timeout??this.timeout;let{bodyHeaders:W,body:G}=this.buildBody({options:z}),U=await this.buildHeaders({options:$,method:X,bodyHeaders:W,retryCount:Z});return{req:{method:X,headers:U,...z.signal&&{signal:z.signal},...globalThis.ReadableStream&&G instanceof globalThis.ReadableStream&&{duplex:"half"},...G&&{body:G},...this.fetchOptions??{},...z.fetchOptions??{}},url:q,timeout:z.timeout}}async buildHeaders({options:$,method:Z,bodyHeaders:z,retryCount:X}){let J={};if(this.idempotencyHeader&&Z!=="get"){if(!$.idempotencyKey)$.idempotencyKey=this.defaultIdempotencyKey();J[this.idempotencyHeader]=$.idempotencyKey}let Q=T([J,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(X),...$.timeout?{"X-Stainless-Timeout":String(Math.trunc($.timeout/1000))}:{},...$z(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders($),this._options.defaultHeaders,z,$.headers]);return this.validateHeaders(Q),Q.values}_makeAbort($){return()=>$.abort()}buildBody({options:{body:$,headers:Z}}){if(!$)return{bodyHeaders:void 0,body:void 0};let z=T([Z]);if(ArrayBuffer.isView($)||$ instanceof ArrayBuffer||$ instanceof DataView||typeof $==="string"&&z.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 if(typeof $==="object"&&z.values.get("content-type")==="application/x-www-form-urlencoded")return{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery($)};else return H(this,q6,"f").call(this,{body:$,headers:z})}}var a3,o3,q6,dz,t3="\\n\\nHuman:",e3="\\n\\nAssistant:",U$;var $9=S(()=>{v0();A$();l8();Qz();B0();t();J3();mz();m2();h3();s3();g3();r3();l8();r();v2();A$();o3=a,q6=new WeakMap,a3=new WeakSet,dz=function(){return this.baseURL!=="https://api.anthropic.com"};a.Anthropic=o3;a.HUMAN_PROMPT=t3;a.AI_PROMPT=e3;a.DEFAULT_TIMEOUT=600000;a.AnthropicError=P;a.APIError=z0;a.APIConnectionError=z$;a.APIConnectionTimeoutError=l$;a.APIUserAbortError=U0;a.NotFoundError=s$;a.ConflictError=a$;a.RateLimitError=t$;a.BadRequestError=i$;a.AuthenticationError=n$;a.InternalServerError=e$;a.PermissionDeniedError=r$;a.UnprocessableEntityError=o$;a.toFile=Z4;U$=class U$ extends a{constructor(){super(...arguments);this.completions=new V1(this),this.messages=new E$(this),this.models=new H1(this),this.beta=new K0(this)}};U$.Completions=V1;U$.Messages=E$;U$.Models=H1;U$.Beta=K0});var cz={};Y9(cz,{toFile:()=>Z4,default:()=>U$,UnprocessableEntityError:()=>o$,RateLimitError:()=>t$,PermissionDeniedError:()=>r$,PagePromise:()=>e1,NotFoundError:()=>s$,InternalServerError:()=>e$,HUMAN_PROMPT:()=>t3,ConflictError:()=>a$,BaseAnthropic:()=>a,BadRequestError:()=>i$,AuthenticationError:()=>n$,AnthropicError:()=>P,Anthropic:()=>U$,APIUserAbortError:()=>U0,APIPromise:()=>Q$,APIError:()=>z0,APIConnectionTimeoutError:()=>l$,APIConnectionError:()=>z$,AI_PROMPT:()=>e3});var pz=S(()=>{$9();J3();m2();$9();t();B0()});var w9=QX(I9(),1),{program:LN,createCommand:NN,createArgument:TN,createOption:MN,CommanderError:ON,InvalidArgumentError:DN,InvalidOptionArgumentError:AN,Command:F9,Argument:IN,Option:wN,Help:FN}=w9.default;import{readFileSync as kZ,writeFileSync as nK,existsSync as xZ}from"fs";import{join as yZ,dirname as rK}from"path";var UK=L8(),VK=x1(),KK=e6(),_8=y1(),HK=M1(),e0=m(),BK=r0(),LK=$0(),NK=a0(),TK=o0(),cT=A2(),MK=F8(),OK=R8(),DK=P8(),F2=SZ(),bZ=N1();var AK=UK.Composer,IK=VK.Document,wK=KK.Schema,FK=_8.YAMLError,RK=_8.YAMLParseError,PK=_8.YAMLWarning,_K=HK.Alias,EK=e0.isAlias,CK=e0.isCollection,jK=e0.isDocument,SK=e0.isMap,bK=e0.isNode,xK=e0.isPair,yK=e0.isScalar,kK=e0.isSeq,fK=BK.Pair,gK=LK.Scalar,hK=NK.YAMLMap,vK=TK.YAMLSeq;var uK=MK.Lexer,mK=OK.LineCounter,dK=DK.Parser,u1=F2.parse,cK=F2.parseAllDocuments,pK=F2.parseDocument,E8=F2.stringify,lK=bZ.visit,iK=bZ.visitAsync;function c($){let Z=kZ($,"utf-8");return u1(Z)}function s($,Z){let z=Z._meta,X={...Z};delete X._meta;let J=E8(X,{lineWidth:0});if(z?.found&&z.found.length>0){let Q=z.found.join(" + ");J=J.replace(/^(\s+type:\s+\S+)(\s*)$/m,(Y,q,W)=>{if(W.includes("#"))return Y;return`${q} # found: ${Q}`})}nK($,J,"utf-8")}function u($){return kZ($,"utf-8")}function v($=process.cwd()){let Z=["project.faf",".faf"];for(let X of Z){let J=yZ($,X);if(xZ(J))return J}let z=rK($);if(z!==$)for(let X of Z){let J=yZ(z,X);if(xZ(J))return J}return null}p();var u$=[{name:"TROPHY",indicator:`${E0("\uD83C\uDFC6")} ${E0("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${E0(k("★"))} ${E0("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${w("◆")} ${w("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${R2("◇")} ${R2("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${k("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${N("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${N("○")} RED`,threshold:1},{name:"WHITE",indicator:`${N("♡")}`,threshold:0}];function P2($){return $.indicator}function j8($){for(let Z of u$)if($>=Z.threshold)return Z;return u$[u$.length-1]}var S8=null;function d1(){if(!S8)try{S8=N0("faf-scoring-kernel")}catch{throw Error(`faf-scoring-kernel not installed.
205
205
 
206
206
  Run: npm install faf-scoring-kernel
207
- `)}return P8}function G0($){return JSON.parse(u1().score_faf($))}function bZ($){return u1().validate_faf($)}function xZ($){return u1().compile_fafb($)}function yZ($){return JSON.parse(u1().decompile_fafb($))}function kZ(){return u1().sdk_version()}function U0($){return{score:$.score,tier:R8($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}function e0($){if(/^\s*app_type:\s*about\s*$/m.test($)){let X=$.match(/^\s+source_score:\s*(\d+)\s*$/m),z=X?parseInt(X[1],10):-1,J=z>=0&&z<=100?z:-1,Q=$.match(/^\s+represents:\s*(\S+)\s*$/m),Y=Q?Q[1]:void 0;return{score:J,tier:J>=0?R8(J):u$[u$.length-1],populated:0,empty:0,ignored:0,active:0,total:0,slots:{},inherited:!0,represents:Y}}return U0(G0($))}p();function Z0($,Z,X=!1){let z=I4($.tier),J=k(`${$.score}%`);if(console.log(`${z} ${J} ${L(`${$.populated}/${$.active} slots`)} ${L("—")} ${Z}`),$.tier.name==="TROPHY")console.log(L(" Trophy. AI never has to guess."));else if($.empty>0){let Q=Object.entries($.slots).filter(([,W])=>W==="empty").map(([W])=>W),Y=Q.slice(0,3).join(", "),q=Q.length>3?`, +${Q.length-3} more`:"",G=$.empty===1?"slot":"slots";console.log(L(` ${$.empty} ${G} from Trophy: ${Y}${q}`))}if(X)console.log(""),mK($)}function mK($){for(let[Z,X]of Object.entries($.slots)){let z=X==="populated"?I("●"):X==="slotignored"?L("—"):L("○");console.log(` ${z} ${X==="slotignored"?L(Z):Z}`)}}p();function F4($,Z={}){let X=$??u();if(!X)console.error(`Error: project.faf not found
208
-
209
- Run 'faf init' to create one.`),process.exit(2);let z=d(X),J=e0(z);if(Z.json){console.log(JSON.stringify(J,null,2));return}if(Z.status){console.log(`${I4(J.tier)} ${k(`${J.score}%`)}`);return}Z0(J,X,Z.verbose)}import{existsSync as zH}from"fs";import{join as sZ}from"path";var K0=[{index:1,path:"project.name",description:"Project name",category:"project"},{index:2,path:"project.goal",description:"Goal (use case)",category:"project"},{index:3,path:"project.main_language",description:"Primary language",category:"project"},{index:4,path:"human_context.who",description:"Who is this for?",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"}],dT=new Map(K0.map(($)=>[$.path,$]));var cT=K0.filter(($)=>$.index<=21);var dK=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","n/a","not applicable"]);function $$($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return dK.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var m$={about:[],documentation:["project","human"],cli:["project","human","universal"],library:["project","human","universal"],sdk:["project","human","universal"],wasm:["project","human","universal"],html:["project","human","universal"],frontend:["project","frontend","human","universal"],website:["project","frontend","human","universal"],mobile:["project","frontend","human","universal"],mcp:["project","backend","human","universal"],backend:["project","backend","universal","human"],"data-science":["project","backend","human","universal"],fullstack:["project","frontend","backend","universal","human"],svelte:["project","frontend","backend","universal","human"],framework:["project","frontend","backend","universal","human"],"monorepo-root":["project","human","enterprise_infra","enterprise_app","enterprise_ops"],mcpaas:["project","backend","universal","human","enterprise_app","enterprise_ops"],saas:["project","frontend","backend","universal","human","enterprise_app"],enterprise:["project","frontend","backend","universal","human","enterprise_infra","enterprise_app","enterprise_ops"]};import{existsSync as j,readFileSync as Z$,readdirSync as gZ}from"fs";import{join as E}from"path";var fZ=[{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"},{type:"devDependency",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 cK($){let Z=E($,"Cargo.toml");if(!j(Z))return null;try{let z=Z$(Z,"utf-8").match(/^\s*\[package\][\s\S]*?^\s*name\s*=\s*"([^"]+)"/m);return z?z[1]:null}catch{return null}}function pK($){let Z=E($,"Cargo.toml");if(!j(Z))return!1;try{let X=Z$(Z,"utf-8");return/^\s*\[\[bin\]\]/m.test(X)}catch{return!1}}function lK($,Z){if(Z?.keywords?.some((z)=>/^sdk(?:\s|-|$)|\-sdk$/i.test(z)))return'package.json keywords contains "sdk"';if(Z?.name&&/(?:^|[-_/])sdk(?:[-_/]|$)/i.test(Z.name))return`package.json name "${Z.name}" → sdk`;let X=cK($);if(X&&/(?:^|[-_])sdk(?:[-_]|$)/i.test(X))return`Cargo.toml name "${X}" → sdk`;return null}function iK($){let Z=/(numpy|pandas|jupyter|scikit-learn|sklearn|pytorch|tensorflow|matplotlib|scipy)/i,X=E($,"pyproject.toml");if(j(X))try{let Q=Z$(X,"utf-8").match(Z);if(Q)return`pyproject.toml depends on ${Q[1]}`}catch{}let z=E($,"requirements.txt");if(j(z))try{let Q=Z$(z,"utf-8").match(Z);if(Q)return`requirements.txt contains ${Q[1]}`}catch{}return null}function nK($,Z){let X=["react-native","expo","@capacitor/core","@ionic/core"];if(Z){for(let z of X)if(Z.dependencies?.[z]||Z.devDependencies?.[z])return`${z} dependency`}if(j(E($,"pubspec.yaml")))return"pubspec.yaml (Flutter)";if(j(E($,"ios"))&&j(E($,"android")))return"ios/ + android/ dirs";return null}function rK($,Z){let X=E($,"Cargo.toml");if(j(X))try{let J=Z$(X,"utf-8");if(/crate-type\s*=\s*\[[^\]]*"cdylib"/.test(J))return'Cargo.toml crate-type = ["cdylib"]';if(/wasm-bindgen|wasm-pack/i.test(J))return"Cargo.toml wasm-bindgen/wasm-pack"}catch{}let z=E($,"build.zig");if(j(z))try{let J=Z$(z,"utf-8");if(/\.wasm\b|wasm32|setOutputFormat\(\.wasm/i.test(J))return"build.zig wasm target"}catch{}if(Z?.keywords?.some((J)=>/^wasm(?:-|$)|webassembly/i.test(J)))return'package.json keywords contains "wasm"';return null}function sK($,Z){if(!j(E($,"index.html")))return null;if(Z?.dependencies||Z?.devDependencies){let X={...Z.dependencies??{},...Z.devDependencies??{}};if(["react","vue","svelte","@sveltejs/kit","next","nuxt","astro","gatsby","solid-js","qwik"].some((J)=>X[J]))return null}return"index.html (vanilla, no frontend framework)"}function aK($,Z){if(Z?.name&&/specification|^@.*\/spec/i.test(Z.name))return`package name "${Z.name}" → documentation`;if(Z?.keywords?.some((X)=>/^(specification|format-spec|standard)$/i.test(X)))return'package keywords contains "specification"';if(Z?.files&&Z.files.length>0){let X=/^(dist|src|lib|build|bin)\/|\.(js|ts|tsx|jsx|mjs|cjs|py|rs|go)$/,z=Z.files.some((Q)=>X.test(Q)),J=Z.files.some((Q)=>/\.(md|MD)|examples?\//.test(Q));if(!z&&J)return"package.json files = docs/examples only (no source)"}return null}function oK($,Z,X){let z=X.find((J)=>J.slug==="astro"||J.slug==="gatsby");if(z)return`${z.name} (static-site framework)`;if(Z?.keywords?.some((J)=>/^(website|marketing|landing|brochure|portfolio)$/i.test(J)))return'package keywords contains "website"/"marketing"/"landing"';return null}function tK($,Z){if(!Z)return null;let X={...Z.dependencies??{},...Z.devDependencies??{}},z=["@clerk/nextjs","@clerk/clerk-react","next-auth","@auth/core","auth0","@auth0/nextjs-auth0"],J=["stripe","@stripe/stripe-js","lemonsqueezy"],Q=z.some((q)=>X[q]),Y=J.some((q)=>X[q]);if(Q&&Y)return"auth + payment dependencies";return null}function eK($,Z,X){if(Z?.keywords?.some((Q)=>/mcpaas/i.test(Q)))return'package keywords contains "mcpaas"';if(Z?.name&&/mcpaas/i.test(Z.name))return`package name "${Z.name}" → mcpaas`;let z=X.some((Q)=>Q.slug==="mcp"),J=X.some((Q)=>Q.category==="database");if(z&&J&&Z?.dependencies&&Object.keys(Z.dependencies).length>10)return"MCP + database + complex deps (platform shape)";return null}function $H($,Z){if(!Z?.private)return null;if(!(!!Z.workspaces||j(E($,"pnpm-workspace.yaml"))))return null;return"private workspace + multi-package"}function M$($){let Z=E($,"package.json");if(!j(Z))return null;try{return JSON.parse(Z$(Z,"utf-8"))}catch{return null}}function ZH($,Z){if(!Z.includes("*"))return j(E($,Z));let X=Z.split("/");if(X.length===1){let q=Z.split("*")[0];try{return gZ($).some((G)=>G.startsWith(q))}catch{return!1}}let z=E($,...X.slice(0,-1)),J=X[X.length-1],Q=J.split("*")[0],Y=J.split("*")[1]||"";try{return gZ(z).some((q)=>q.startsWith(Q)&&q.endsWith(Y))}catch{return!1}}function XH($,Z,X){switch($.type){case"dependency":return!!Z?.dependencies?.[$.key];case"devDependency":return!!Z?.devDependencies?.[$.key];case"file":return ZH(X,$.pattern);default:return!1}}function E8($){let Z=M$($);return fZ.map((X)=>{let J=X.signals.filter((Q)=>XH(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 hZ($){let Z=M$($);if(Z?.devDependencies?.typescript||Z?.dependencies?.typescript)return"TypeScript";if(j(E($,"tsconfig.json")))return"TypeScript";if(j(E($,"Cargo.toml")))return"Rust";if(j(E($,"go.mod")))return"Go";if(j(E($,"pyproject.toml"))||j(E($,"setup.py")))return"Python";if(j(E($,"Gemfile")))return"Ruby";if(j(E($,"pom.xml"))||j(E($,"build.gradle")))return"Java";if(j(E($,"Package.swift")))return"Swift";if(j(E($,"build.zig")))return"Zig";if(Z)return"JavaScript";return"Unknown"}function vZ($){let Z=M$($),X=E8($),z=[],J=aK($,Z);if(J)return z.push(J),{type:"documentation",found:z};let Q=lK($,Z);if(Q)return z.push(Q),{type:"sdk",found:z};let Y=eK($,Z,X);if(Y)return z.push(Y),{type:"mcpaas",found:z};let q=tK($,Z);if(q)return z.push(q),{type:"saas",found:z};let G=rK($,Z);if(G)return z.push(G),{type:"wasm",found:z};let W=nK($,Z);if(W)return z.push(W),{type:"mobile",found:z};if(X.some((R)=>R.slug==="mcp"))return z.push("MCP SDK signal"),{type:"mcp",found:z};if(Z?.bin)return z.push("package.json bin"),{type:"cli",found:z};if(pK($))return z.push("Cargo.toml [[bin]]"),{type:"cli",found:z};if(j(E($,"build.zig"))){if(z.push("build.zig"),j(E($,"src/main.zig")))return z.push("src/main.zig"),{type:"cli",found:z};if(j(E($,"src/root.zig")))return z.push("src/root.zig"),{type:"library",found:z}}let V=X.some((R)=>R.slug==="svelte"||R.slug==="sveltekit");if(Z?.private===!0&&(j(E($,"pnpm-workspace.yaml"))||Z?.workspaces!==void 0)&&V)return z.push("private workspace","Svelte"),{type:"framework",found:z};if(V)return z.push("Svelte/SvelteKit"),{type:"svelte",found:z};let N=X.some((R)=>R.category==="frontend"),O=X.some((R)=>R.category==="backend");if(Z?.private&&(Z.workspaces||j(E($,"pnpm-workspace.yaml")))&&N&&O)return z.push("private workspace + frontend + backend frameworks"),{type:"enterprise",found:z};let B=$H($,Z);if(B)return z.push(B),{type:"monorepo-root",found:z};let M=oK($,Z,X);if(M)return z.push(M),{type:"website",found:z};if(X.some((R)=>R.slug==="nextjs"||R.slug==="nuxt"))return z.push(X.find((R)=>R.slug==="nextjs")?"Next.js":"Nuxt"),{type:"fullstack",found:z};let _=X.some((R)=>R.category==="frontend"),b=X.some((R)=>R.category==="backend");if(_&&b)return z.push("frontend framework","backend framework"),{type:"fullstack",found:z};if(_)return z.push("frontend framework"),{type:"frontend",found:z};if(b)return z.push("backend framework"),{type:"backend",found:z};let x=iK($);if(x)return z.push(x),{type:"data-science",found:z};let y=sK($,Z);if(y)return z.push(y),{type:"html",found:z};if(Z?.main&&!Z?.bin)return z.push("package.json main (no bin)"),{type:"library",found:z};return z.push("no classifying signals — fallback"),{type:"library",found:z}}function uZ($){if(j(E($,"bunfig.toml")))return"Bun";if(j(E($,"deno.json"))||j(E($,"deno.jsonc")))return"Deno";if(M$($))return"Node.js";if(j(E($,"Cargo.toml")))return"Rust";if(j(E($,"go.mod")))return"Go";return"Unknown"}function mZ($){if(j(E($,"bun.lockb"))||j(E($,"bun.lock")))return"bun";if(j(E($,"pnpm-lock.yaml")))return"pnpm";if(j(E($,"yarn.lock")))return"yarn";if(j(E($,"package-lock.json")))return"npm";return"npm"}function dZ($){if(j(E($,".github/workflows")))return"GitHub Actions";if(j(E($,".gitlab-ci.yml")))return"GitLab CI";if(j(E($,".circleci")))return"CircleCI";if(j(E($,"Jenkinsfile")))return"Jenkins";return null}function cZ($){if(j(E($,"vercel.json")))return"Vercel";if(j(E($,"netlify.toml")))return"Netlify";if(j(E($,"wrangler.toml")))return"Cloudflare";if(j(E($,"Dockerfile")))return"Docker";if(j(E($,"fly.toml")))return"Fly.io";if(j(E($,"render.yaml")))return"Render";return null}function pZ($){let Z=E($,"svelte.config.js");if(!j(Z))return null;try{let z=Z$(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 lZ($){let Z=M$($);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(j(E($,"tsconfig.json"))&&Z?.devDependencies?.typescript)return"TypeScript (tsc)";return null}function iZ($){return["package.json","Cargo.toml","pyproject.toml","go.mod","build.zig","build.zig.zon","src/index.ts","src/index.js","src/main.ts","src/cli.ts","src/main.rs","src/lib.rs","src/main.zig","src/root.zig","src/__init__.py","main.py","__main__.py","main.go","cmd/main.go","README.md","SPECIFICATION.md","BINARY-FORMAT.md","tsconfig.json","wrangler.toml","vercel.json"].filter((X)=>j(E($,X)))}function nZ($,Z){let X={};if(Z?.scripts){for(let z of["build","test","lint","dev","start"])if(Z.scripts[z]){let J=j(E($,"bun.lock"))||j(E($,"bun.lockb"))?"bun run":"npm run";X[z]=`${J} ${z}`}}if(j(E($,"Cargo.toml"))){if(!X.build)X.build="cargo build --release";if(!X.test)X.test="cargo test";if(!X.lint)X.lint="cargo clippy"}if(j(E($,"build.zig"))){if(!X.build)X.build="zig build";if(!X.test)X.test="zig build test"}if(j(E($,"go.mod"))){if(!X.build)X.build="go build ./...";if(!X.test)X.test="go test ./..."}if(j(E($,"pyproject.toml"))||j(E($,"pytest.ini"))){if(!X.test)X.test="pytest"}return X}function rZ($,Z,X,z){let J=[];if(z&&z!=="Unknown")J.push(z);let Q=new Set(["frontend","backend","database","build","css","state","monorepo"]);for(let Y of X)if(Q.has(Y.category))J.push(Y.name);if(j(E($,"bunfig.toml")))J.push("Bun");else if(j(E($,"deno.json"))||j(E($,"deno.jsonc")))J.push("Deno");if(J.length<3&&Z?.dependencies){let Y=Object.keys(Z.dependencies).slice(0,5);for(let q of Y)if(!J.some((G)=>G.toLowerCase().includes(q.toLowerCase())))J.push(q)}return J}function d$($){let Z=M$($),X=E8($),z=hZ($),J=vZ($),Q=J.type,Y=uZ($),q=mZ($),G=dZ($),W=cZ($),U=lZ($),V=X.find((n)=>n.category==="frontend"),K=X.find((n)=>n.category==="css"),N=X.find((n)=>n.category==="ui"),O=X.find((n)=>n.category==="state"),B=X.find((n)=>n.category==="backend"),M=X.find((n)=>n.category==="database"),F=m$[Q]||m$.library,_=Q==="framework",b=X.some((n)=>n.slug==="svelte"||n.slug==="sveltekit"),x=_&&b?"svelte":_?null:null,y=Q==="svelte"||x==="svelte",R=y?pZ($):null,i=y&&X.some((n)=>n.slug==="sveltekit"),C=new Set(["css_framework","ui_library","database","connection","hosting"]),g={},S0=K0.filter((n)=>n.path.startsWith("stack."));for(let n of S0){let o=n.path.replace("stack.","");if(!F.includes(n.category)){g[o]="slotignored";continue}if(_&&C.has(o)){g[o]="slotignored";continue}switch(o){case"frontend":g[o]=V?.name??(Q==="cli"?"CLI":"");break;case"css_framework":g[o]=K?.name??"";break;case"ui_library":g[o]=N?.name??"";break;case"state_management":g[o]=y?O?.name??"Runes":O?.name??"";break;case"backend":g[o]=y?i?"SvelteKit":B?.name??"":B?.name??"";break;case"api_type":g[o]=i?"Server Routes":"";break;case"runtime":g[o]=Y!=="Unknown"?Y:"";break;case"database":g[o]=M?.name??"";break;case"connection":g[o]=M?.name??"";break;case"hosting":if(y&&R)g[o]=R;else g[o]=W??"";break;case"build":g[o]=y?"Vite":U??"";break;case"cicd":g[o]=G??"";break;case"package_manager":g[o]=q;break;default:g[o]="";break}}let b0={},e=K0.filter((n)=>n.path.startsWith("monorepo."));for(let n of e){let o=n.path.replace("monorepo.","");if(!F.includes(n.category))b0[o]="slotignored";else b0[o]=""}let H1={name:Z?.name??$.split("/").pop()??"project",goal:Z?.description??"",main_language:z,type:Q};if(_&&x)H1.framework=x;let t3=rZ($,Z,X,z),e3=iZ($),$9=nZ($,Z),x2={faf_version:"2.5.0",project:H1,stack:g,human_context:{who:"",what:Z?.description??"",why:"",where:"",when:"",how:""},monorepo:b0,_meta:{found:J.found}};if(t3.length>0)x2.tech_stack=t3;if(e3.length>0)x2.key_files=e3;if(Object.keys($9).length>0)x2.commands=$9;return x2}p();function _8($={}){let Z=process.cwd(),X=$.output?$.output.endsWith(".faf")?$.output:sZ(Z,$.output):sZ(Z,"project.faf");if(zH(X)&&!$.force)console.error(`project.faf already exists. Use ${k("--force")} to overwrite.`),process.exit(1);let z=d$(Z);s(X,z);let J=d(X),Q=e0(J);if(console.log(`${I("created")} ${X}`),Z0(Q,X),Q.score<100)console.log(L(`
210
- run ${k("'faf go'")} to fill empty slots`))}import{existsSync as wH}from"fs";import{join as IH}from"path";import{existsSync as QH,readFileSync as YH}from"fs";import{join as qH}from"path";var aZ={MIN_LENGTH:8,MAX_LENGTH:280},JH=[/^(see|see\s+the?)\s+readme/i,/^(tbd|todo|fixme|coming\s+soon)\b/i,/^(software|application|app|project|tool|library|framework)\.?$/i,/^(for\s+users|for\s+developers)\.?$/i,/^(description|goal|name|title)\.?$/i,/^lorem\s+ipsum/i,/^example(\s+\w+)?\.?$/i];function C0($){let Z=$.trim();if(Z.length<aZ.MIN_LENGTH)return!1;if(Z.length>aZ.MAX_LENGTH)return!1;if(JH.some((X)=>X.test(Z)))return!1;if(/^[\s|\-*+]/.test(Z))return!1;if(Z.split(`
211
- `).length>4)return!1;return!0}function GH($){let Z=$.split(`
212
- `),X=0;while(X<Z.length&&/^(#\s|$)/.test(Z[X].trim()))X++;while(X<Z.length){let z=Z[X].trim();if(/^\[!\[/.test(z)){X++;continue}if(/^!\[/.test(z)){X++;continue}if(/^<img\s/i.test(z)){X++;continue}if(z===""){X++;continue}break}return Z.slice(X).join(`
213
- `)}function WH($){let X=GH($).split(`
214
- `),z=[];for(let J of X){let Q=J.trim();if(Q===""){if(z.length>0)break;continue}if(/^(#|>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(Q))break;if(/^\*\*[^*]+\*\*\s*$/.test(Q)&&z.length===0)continue;z.push(Q)}if(z.length===0)return null;return z.join(" ").trim()}function O$($,Z){let X=$.split(`
215
- `),z=0;while(z<X.length){let Q=X[z].trim().match(/^(#{1,6})\s+(.+)$/);if(Q&&Z.test(Q[2])){let Y=Q[1].length,q=[];z++;while(z<X.length){let G=X[z].trim(),W=G.match(/^(#{1,6})\s+/);if(W&&W[1].length<=Y)break;if(G===""){if(q.length>0)break;z++;continue}if(/^(>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(G))break;q.push(G),z++}if(q.length===0)return null;return q.join(" ").trim()}z++}return null}function UH($){let Z=O$($,/^(use\s+cases?|goal)\b/i);if(Z&&C0(Z))return Z;let X=WH($);if(X&&C0(X))return X;return}function VH($){let Z=O$($,/^(about|description|overview|what(\s+is\s+this)?)\b/i);if(Z&&C0(Z))return Z;return}function KH($){let Z=O$($,/^(audience|users?|for\s+whom|who(\s+is\s+this\s+for)?)\b/i);if(Z&&C0(Z))return Z;return}function HH($){let Z=O$($,/^(why|motivation|problem|rationale)\b/i);if(Z&&C0(Z))return Z;return}function BH($){let Z=O$($,/^(deployment|where(\s+it\s+runs)?|hosting)\b/i);if(Z&&C0(Z))return Z;return}function NH($){let Z=O$($,/^(status|history|timeline|since|launched)\b/i);if(Z&&C0(Z))return Z;return}function LH($){let Z=O$($,/^(architecture|how(\s+it\s+works)?|approach|design)\b/i);if(Z&&C0(Z))return Z;return}function C8($){let Z=["README.md","README.MD","Readme.md","readme.md"],X=null;for(let N of Z){let O=qH($,N);if(QH(O)){X=O;break}}if(!X)return{};let z;try{z=YH(X,"utf-8")}catch{return{}}let J={},Q=UH(z);if(Q)J.project={goal:Q};let Y={},q=VH(z);if(q)Y.what=q;let G=KH(z);if(G)Y.who=G;let W=HH(z);if(W)Y.why=W;let U=BH(z);if(U)Y.where=U;let V=NH(z);if(V)Y.when=V;let K=LH(z);if(K)Y.how=K;if(Object.keys(Y).length>0)J.human_context=Y;return J}import{existsSync as TH,readFileSync as MH}from"fs";import{join as OH}from"path";function DH($,Z){let X=$.split(`
216
- `),z=!1;for(let J of X){let Q=J.trim();if(/^\[/.test(Q)){z=Q==="[package]";continue}if(!z)continue;let Y=Q.match(new RegExp(`^${Z}\\s*=\\s*(.+)$`));if(Y){let q=Y[1].trim();q=q.replace(/\s*#.*$/,"").trim();let G=q.match(/^"((?:[^"\\]|\\.)*)"$/)||q.match(/^'((?:[^'\\]|\\.)*)'$/);if(G)return G[1];return q}}return null}function j8($){let Z=OH($,"Cargo.toml");if(!TH(Z))return{};let X;try{X=MH(Z,"utf-8")}catch{return{}}let z=DH(X,"description");if(z&&C0(z))return{project:{goal:z}};return{}}function AH($,Z){let X={project:{...Z.project??{},...$.project??{}},human_context:{...Z.human_context??{},...$.human_context??{}}};if(X.project&&Object.keys(X.project).length===0)delete X.project;if(X.human_context&&Object.keys(X.human_context).length===0)delete X.human_context;return X}function oZ($){return AH(C8($),j8($))}p();function tZ(){let $=process.cwd(),Z=IH($,"project.faf"),X=d$($),z=oZ($);if(wH(Z)){let Y=c(Z),q=R4(Y,z),G=R4(q,X);s(Z,G),console.log(`${I("updated")} ${Z}`)}else{let Y=R4(X,z),q=Y.project?.type??"library",G=m$[q]||m$.library;for(let W of K0)if(!G.includes(W.category)){let[U,V]=W.path.split(".");if(U==="stack"&&Y.stack)Y.stack[V]="slotignored";if(U==="monorepo"&&Y.monorepo)Y.monorepo[V]="slotignored"}s(Z,Y),console.log(`${I("created")} ${Z}`)}let J=d(Z),Q=U0(G0(J));if(Z0(Q,Z),Q.score<100)console.log(L(`
217
- run ${k("'faf go'")} to reach \uD83C\uDFC6 Trophy`))}function R4($,Z){let X={...$};for(let[z,J]of Object.entries(Z)){let Q=X[z];if($$(Q))X[z]=J;else if(typeof J==="object"&&J!==null&&!Array.isArray(J)&&typeof Q==="object"&&Q!==null&&!Array.isArray(Q))X[z]=R4(Q,J)}return X}import{existsSync as E4,statSync as YX}from"fs";import{join as qX,dirname as jH}from"path";import{readFileSync as FH,writeFileSync as RH,existsSync as PH,statSync as bM}from"fs";import{join as $X}from"path";var ZX="CLAUDE.md",EH="STATUS: BI-SYNC ACTIVE";function XX($){let Z=$X($,ZX);if(!PH(Z))return null;return FH(Z,"utf-8")}function zX($,Z){let X=$X($,ZX);RH(X,Z,"utf-8")}function D$($,Z={}){let X=String($.project?.name??"").trim(),z=String($.project?.main_language??"").trim(),J=String($.project?.type??"").trim(),Q=String($.project?.goal??"").trim(),Y=`<!-- faf: ${[X,z,J,Q].join(" | ")} -->`,q=[];if(Z.doc)q.push(`doc=${Z.doc}`);else q.push(`claim=${Z.claim??"project.faf"}`);if(typeof Z.score==="number")q.push(`score=${Z.score}`);if(q.push(`family=${Z.family??"FAF"}`),Z.siblings&&Z.siblings.length>0)q.push(`siblings=${Z.siblings.join(",")}`);let G=`<!-- faf: ${q.join(" | ")} -->`;return`${Y}
218
- ${G}`}function JX($){let Z=[],X=$.project?.name??"Project",z=$.project?.main_language??"",J=$.project?.goal??"";if(Z.push(D$($)),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??{},Y=[];if(z)Y.push(`**Language:** ${z}`);for(let[W,U]of Object.entries(Q))if(U&&U!=="slotignored"&&String(U).trim()){let V=W.replace(/_/g," ").replace(/\b\w/g,(K)=>K.toUpperCase());Y.push(`**${V}:** ${U}`)}if(Y.length>0){Z.push("## Stack"),Z.push("");for(let W of Y)Z.push(`- ${W}`);Z.push("")}let q=$.human_context??{},G=[["Who",q.who],["What",q.what],["Why",q.why],["Where",q.where],["When",q.when],["How",q.how]].filter(([W,U])=>U&&String(U).trim());if(G.length>0){Z.push("## Context"),Z.push("");for(let[W,U]of G)Z.push(`- **${W}:** ${U}`);Z.push("")}return Z.push("---"),Z.push(""),Z.push(`*${EH} — ${new Date().toISOString()}*`),Z.push(""),Z.join(`
219
- `)}function eZ($){return $.replace(/\s+v\d+(?:\.\d+)*\s*$/i,"").trim()}function P4($){let Z={project:{}},X=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(X)Z.project.name=eZ(X[1].trim());if(!Z.project.name){let Q=$.match(/\*\*Name:\*\*\s*(.+)/);if(Q)Z.project.name=eZ(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 fM,writeFileSync as _H,existsSync as gM}from"fs";import{join as CH}from"path";function QX($,Z){_H(CH($,"MEMORY.md"),Z,"utf-8")}p();function c$(){return process.env.FAF_PRO==="1"||process.env.FAF_PRO==="true"}function S8($={}){let Z=process.cwd(),X=u(Z);if(!X)console.error(`Error: project.faf not found
220
-
221
- Run 'faf init' to create one.`),process.exit(2);let z=qX(Z,"CLAUDE.md"),J=qX(Z,"MEMORY.md"),Q=$.direction??"auto";if(Q==="auto")GX(X,z,Z);else if(Q==="push")WX(X,Z);else if(Q==="pull")SH(X,z);if(c$())UX(X,J,Z);if($.watch)console.log(L("watching for changes... (Ctrl+C to stop)")),xH(X,z,J,Z)}function GX($,Z,X){WX($,X)}function WX($,Z){let X=c($),z=JX(X);zX(Z,z),console.log(`${I("◆")} sync .faf → CLAUDE.md ${L("← bi-sync")}`);let J=U0(G0(d($)));Z0(J,$)}function SH($,Z){let X=U0(G0(d($)));if(X.tier.name!=="TROPHY")console.error(`${k("×")} sync --pull blocked: requires \uD83C\uDFC6 Trophy (currently ${X.score}%)`),console.error(L(" MD → .faf backfill only runs at 100%. Reach Trophy with 'faf go', then retry.")),process.exit(1);let z=XX(jH(Z));if(!z){console.error("CLAUDE.md not found.");return}let J=P4(z),Q=c($);if(J.project?.name)Q.project={...Q.project,name:J.project.name};if(J.project?.goal)Q.project={...Q.project,goal:J.project.goal};if(J.project?.main_language)Q.project={...Q.project,main_language:J.project.main_language};s($,Q),console.log(`${I("◆")} sync CLAUDE.md → .faf ${L("← bi-sync (Trophy-gated)")}`);let Y=U0(G0(d($)));Z0(Y,$)}function UX($,Z,X){let z=c($),J=YX($).mtimeMs,Q=E4(Z)?YX(Z).mtimeMs:0;if(!E4(Z)||J>Q){let Y=bH(z);QX(X,Y),console.log(`${I("◆")} sync .faf → MEMORY.md ${L("← tri-sync")}`)}else console.log(`${I("◆")} sync MEMORY.md → .faf ${L("← tri-sync")}`)}function bH($){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(`
207
+ `)}return S8}function W0($){return JSON.parse(d1().score_faf($))}function gZ($){return d1().validate_faf($)}function hZ($){return d1().compile_fafb($)}function vZ($){return JSON.parse(d1().decompile_fafb($))}function uZ(){return d1().sdk_version()}function V0($){return{score:$.score,tier:j8($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}function w0($){if(/^\s*app_type:\s*about\s*$/m.test($)){let z=$.match(/^\s+source_score:\s*(\d+)\s*$/m),X=z?parseInt(z[1],10):-1,J=X>=0&&X<=100?X:-1,Q=$.match(/^\s+represents:\s*(\S+)\s*$/m),Y=Q?Q[1]:void 0;return{score:J,tier:J>=0?j8(J):u$[u$.length-1],populated:0,empty:0,ignored:0,active:0,total:0,slots:{},inherited:!0,represents:Y}}return V0(W0($))}p();function Z0($,Z,z=!1){let X=P2($.tier),J=k(`${$.score}%`);if(console.log(`${X} ${J} ${N(`${$.populated}/${$.active} slots`)} ${N("—")} ${Z}`),$.tier.name==="TROPHY")console.log(N(" Trophy. AI never has to guess."));else if($.empty>0){let Q=Object.entries($.slots).filter(([,G])=>G==="empty").map(([G])=>G),Y=Q.slice(0,3).join(", "),q=Q.length>3?`, +${Q.length-3} more`:"",W=$.empty===1?"slot":"slots";console.log(N(` ${$.empty} ${W} from Trophy: ${Y}${q}`))}if(z)console.log(""),aK($)}function aK($){for(let[Z,z]of Object.entries($.slots)){let X=z==="populated"?w("●"):z==="slotignored"?N("—"):N("○");console.log(` ${X} ${z==="slotignored"?N(Z):Z}`)}}p();function _2($,Z={}){let z=$??v();if(!z)console.error(`Error: project.faf not found
208
+
209
+ Run 'faf init' to create one.`),process.exit(2);let X=u(z),J=w0(X);if(Z.json){console.log(JSON.stringify(J,null,2));return}if(Z.status){console.log(`${P2(J.tier)} ${k(`${J.score}%`)}`);return}Z0(J,z,Z.verbose)}import{existsSync as KH}from"fs";import{join as $7}from"path";var G0=[{index:1,path:"project.name",description:"Project name",category:"project"},{index:2,path:"project.goal",description:"Goal (use case)",category:"project"},{index:3,path:"project.main_language",description:"Primary language",category:"project"},{index:4,path:"human_context.who",description:"Who is this for?",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",canonical:"stack.framework",description:"Framework (React, Svelte, etc.)",category:"frontend"},{index:11,path:"stack.css_framework",canonical:"stack.css",description:"CSS framework",category:"frontend"},{index:12,path:"stack.ui_library",description:"UI component library",category:"frontend"},{index:13,path:"stack.state_management",canonical:"stack.state",description:"State management",category:"frontend"},{index:14,path:"stack.backend",description:"Backend framework",category:"backend"},{index:15,path:"stack.api_type",canonical:"stack.api",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",canonical:"stack.db",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",canonical:"stack.pkg_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"}],GM=new Map(G0.flatMap(($)=>$.canonical?[[$.path,$],[$.canonical,$]]:[[$.path,$]])),UM=new Map(G0.filter(($)=>$.canonical).map(($)=>[$.canonical,$.path])),VM=new Map(G0.filter(($)=>$.canonical).map(($)=>[$.path,$.canonical]));var KM=G0.filter(($)=>$.index<=21);var oK=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","n/a","not applicable"]);function $$($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return oK.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var m$={about:[],documentation:["project","human"],encyclopedia:["project","human"],cli:["project","human","universal"],library:["project","human","universal"],sdk:["project","human","universal"],wasm:["project","human","universal"],html:["project","human","universal"],frontend:["project","frontend","human","universal"],website:["project","frontend","human","universal"],mobile:["project","frontend","human","universal"],mcp:["project","backend","human","universal"],backend:["project","backend","universal","human"],"data-science":["project","backend","human","universal"],fullstack:["project","frontend","backend","universal","human"],svelte:["project","frontend","backend","universal","human"],framework:["project","frontend","backend","universal","human"],"monorepo-root":["project","human","enterprise_infra","enterprise_app","enterprise_ops"],mcpaas:["project","backend","universal","human","enterprise_app","enterprise_ops"],saas:["project","frontend","backend","universal","human","enterprise_app"],enterprise:["project","frontend","backend","universal","human","enterprise_infra","enterprise_app","enterprise_ops"]};import{existsSync as j,readFileSync as Z$,readdirSync as dZ}from"fs";import{join as _}from"path";var mZ=[{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"},{type:"devDependency",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 tK($){let Z=_($,"Cargo.toml");if(!j(Z))return null;try{let X=Z$(Z,"utf-8").match(/^\s*\[package\][\s\S]*?^\s*name\s*=\s*"([^"]+)"/m);return X?X[1]:null}catch{return null}}function eK($){let Z=_($,"Cargo.toml");if(!j(Z))return!1;try{let z=Z$(Z,"utf-8");return/^\s*\[\[bin\]\]/m.test(z)}catch{return!1}}function $H($,Z){if(Z?.keywords?.some((X)=>/^sdk(?:\s|-|$)|\-sdk$/i.test(X)))return'package.json keywords contains "sdk"';if(Z?.name&&/(?:^|[-_/])sdk(?:[-_/]|$)/i.test(Z.name))return`package.json name "${Z.name}" → sdk`;let z=tK($);if(z&&/(?:^|[-_])sdk(?:[-_]|$)/i.test(z))return`Cargo.toml name "${z}" → sdk`;return null}function ZH($){let Z=/(numpy|pandas|jupyter|scikit-learn|sklearn|pytorch|tensorflow|matplotlib|scipy)/i,z=_($,"pyproject.toml");if(j(z))try{let Q=Z$(z,"utf-8").match(Z);if(Q)return`pyproject.toml depends on ${Q[1]}`}catch{}let X=_($,"requirements.txt");if(j(X))try{let Q=Z$(X,"utf-8").match(Z);if(Q)return`requirements.txt contains ${Q[1]}`}catch{}return null}function zH($,Z){let z=["react-native","expo","@capacitor/core","@ionic/core"];if(Z){for(let X of z)if(Z.dependencies?.[X]||Z.devDependencies?.[X])return`${X} dependency`}if(j(_($,"pubspec.yaml")))return"pubspec.yaml (Flutter)";if(j(_($,"ios"))&&j(_($,"android")))return"ios/ + android/ dirs";return null}function XH($,Z){let z=_($,"Cargo.toml");if(j(z))try{let J=Z$(z,"utf-8");if(/crate-type\s*=\s*\[[^\]]*"cdylib"/.test(J))return'Cargo.toml crate-type = ["cdylib"]';if(/wasm-bindgen|wasm-pack/i.test(J))return"Cargo.toml wasm-bindgen/wasm-pack"}catch{}let X=_($,"build.zig");if(j(X))try{let J=Z$(X,"utf-8");if(/\.wasm\b|wasm32|setOutputFormat\(\.wasm/i.test(J))return"build.zig wasm target"}catch{}if(Z?.keywords?.some((J)=>/^wasm(?:-|$)|webassembly/i.test(J)))return'package.json keywords contains "wasm"';return null}function JH($,Z){if(!j(_($,"index.html")))return null;if(Z?.dependencies||Z?.devDependencies){let z={...Z.dependencies??{},...Z.devDependencies??{}};if(["react","vue","svelte","@sveltejs/kit","next","nuxt","astro","gatsby","solid-js","qwik"].some((J)=>z[J]))return null}return"index.html (vanilla, no frontend framework)"}function QH($,Z){if(Z?.name&&/specification|^@.*\/spec/i.test(Z.name))return`package name "${Z.name}" → documentation`;if(Z?.keywords?.some((z)=>/^(specification|format-spec|standard)$/i.test(z)))return'package keywords contains "specification"';if(Z?.files&&Z.files.length>0){let z=/^(dist|src|lib|build|bin)\/|\.(js|ts|tsx|jsx|mjs|cjs|py|rs|go)$/,X=Z.files.some((Q)=>z.test(Q)),J=Z.files.some((Q)=>/\.(md|MD)|examples?\//.test(Q));if(!X&&J)return"package.json files = docs/examples only (no source)"}return null}function YH($,Z,z){let X=z.find((J)=>J.slug==="astro"||J.slug==="gatsby");if(X)return`${X.name} (static-site framework)`;if(Z?.keywords?.some((J)=>/^(website|marketing|landing|brochure|portfolio)$/i.test(J)))return'package keywords contains "website"/"marketing"/"landing"';return null}function qH($,Z){if(!Z)return null;let z={...Z.dependencies??{},...Z.devDependencies??{}},X=["@clerk/nextjs","@clerk/clerk-react","next-auth","@auth/core","auth0","@auth0/nextjs-auth0"],J=["stripe","@stripe/stripe-js","lemonsqueezy"],Q=X.some((q)=>z[q]),Y=J.some((q)=>z[q]);if(Q&&Y)return"auth + payment dependencies";return null}function WH($,Z,z){if(Z?.keywords?.some((Q)=>/mcpaas/i.test(Q)))return'package keywords contains "mcpaas"';if(Z?.name&&/mcpaas/i.test(Z.name))return`package name "${Z.name}" → mcpaas`;let X=z.some((Q)=>Q.slug==="mcp"),J=z.some((Q)=>Q.category==="database");if(X&&J&&Z?.dependencies&&Object.keys(Z.dependencies).length>10)return"MCP + database + complex deps (platform shape)";return null}function GH($,Z){if(!Z?.private)return null;if(!(!!Z.workspaces||j(_($,"pnpm-workspace.yaml"))))return null;return"private workspace + multi-package"}function M$($){let Z=_($,"package.json");if(!j(Z))return null;try{return JSON.parse(Z$(Z,"utf-8"))}catch{return null}}function UH($,Z){if(!Z.includes("*"))return j(_($,Z));let z=Z.split("/");if(z.length===1){let q=Z.split("*")[0];try{return dZ($).some((W)=>W.startsWith(q))}catch{return!1}}let X=_($,...z.slice(0,-1)),J=z[z.length-1],Q=J.split("*")[0],Y=J.split("*")[1]||"";try{return dZ(X).some((q)=>q.startsWith(Q)&&q.endsWith(Y))}catch{return!1}}function VH($,Z,z){switch($.type){case"dependency":return!!Z?.dependencies?.[$.key];case"devDependency":return!!Z?.devDependencies?.[$.key];case"file":return UH(z,$.pattern);default:return!1}}function b8($){let Z=M$($);return mZ.map((z)=>{let J=z.signals.filter((Q)=>VH(Q,Z,$)).length/z.signals.length;return{name:z.name,slug:z.slug,category:z.category,confidence:J}}).filter((z)=>z.confidence>0).sort((z,X)=>X.confidence-z.confidence)}function cZ($){let Z=M$($);if(Z?.devDependencies?.typescript||Z?.dependencies?.typescript)return"TypeScript";if(j(_($,"tsconfig.json")))return"TypeScript";if(j(_($,"Cargo.toml")))return"Rust";if(j(_($,"go.mod")))return"Go";if(j(_($,"pyproject.toml"))||j(_($,"setup.py")))return"Python";if(j(_($,"Gemfile")))return"Ruby";if(j(_($,"pom.xml"))||j(_($,"build.gradle")))return"Java";if(j(_($,"Package.swift")))return"Swift";if(j(_($,"build.zig")))return"Zig";if(Z)return"JavaScript";return"Unknown"}function pZ($){let Z=M$($),z=b8($),X=[],J=QH($,Z);if(J)return X.push(J),{type:"documentation",found:X};let Q=$H($,Z);if(Q)return X.push(Q),{type:"sdk",found:X};let Y=WH($,Z,z);if(Y)return X.push(Y),{type:"mcpaas",found:X};let q=qH($,Z);if(q)return X.push(q),{type:"saas",found:X};let W=XH($,Z);if(W)return X.push(W),{type:"wasm",found:X};let G=zH($,Z);if(G)return X.push(G),{type:"mobile",found:X};if(z.some((R)=>R.slug==="mcp"))return X.push("MCP SDK signal"),{type:"mcp",found:X};if(Z?.bin)return X.push("package.json bin"),{type:"cli",found:X};if(eK($))return X.push("Cargo.toml [[bin]]"),{type:"cli",found:X};if(j(_($,"build.zig"))){if(X.push("build.zig"),j(_($,"src/main.zig")))return X.push("src/main.zig"),{type:"cli",found:X};if(j(_($,"src/root.zig")))return X.push("src/root.zig"),{type:"library",found:X}}let V=z.some((R)=>R.slug==="svelte"||R.slug==="sveltekit");if(Z?.private===!0&&(j(_($,"pnpm-workspace.yaml"))||Z?.workspaces!==void 0)&&V)return X.push("private workspace","Svelte"),{type:"framework",found:X};if(V)return X.push("Svelte/SvelteKit"),{type:"svelte",found:X};let L=z.some((R)=>R.category==="frontend"),O=z.some((R)=>R.category==="backend");if(Z?.private&&(Z.workspaces||j(_($,"pnpm-workspace.yaml")))&&L&&O)return X.push("private workspace + frontend + backend frameworks"),{type:"enterprise",found:X};let B=GH($,Z);if(B)return X.push(B),{type:"monorepo-root",found:X};let M=YH($,Z,z);if(M)return X.push(M),{type:"website",found:X};if(z.some((R)=>R.slug==="nextjs"||R.slug==="nuxt"))return X.push(z.find((R)=>R.slug==="nextjs")?"Next.js":"Nuxt"),{type:"fullstack",found:X};let E=z.some((R)=>R.category==="frontend"),b=z.some((R)=>R.category==="backend");if(E&&b)return X.push("frontend framework","backend framework"),{type:"fullstack",found:X};if(E)return X.push("frontend framework"),{type:"frontend",found:X};if(b)return X.push("backend framework"),{type:"backend",found:X};let x=ZH($);if(x)return X.push(x),{type:"data-science",found:X};let y=JH($,Z);if(y)return X.push(y),{type:"html",found:X};if(Z?.main&&!Z?.bin)return X.push("package.json main (no bin)"),{type:"library",found:X};return X.push("no classifying signals — fallback"),{type:"library",found:X}}function lZ($){if(j(_($,"bunfig.toml")))return"Bun";if(j(_($,"deno.json"))||j(_($,"deno.jsonc")))return"Deno";if(M$($))return"Node.js";if(j(_($,"Cargo.toml")))return"Rust";if(j(_($,"go.mod")))return"Go";return"Unknown"}function iZ($){if(j(_($,"bun.lockb"))||j(_($,"bun.lock")))return"bun";if(j(_($,"pnpm-lock.yaml")))return"pnpm";if(j(_($,"yarn.lock")))return"yarn";if(j(_($,"package-lock.json")))return"npm";return"npm"}function nZ($){if(j(_($,".github/workflows")))return"GitHub Actions";if(j(_($,".gitlab-ci.yml")))return"GitLab CI";if(j(_($,".circleci")))return"CircleCI";if(j(_($,"Jenkinsfile")))return"Jenkins";return null}function rZ($){if(j(_($,"vercel.json")))return"Vercel";if(j(_($,"netlify.toml")))return"Netlify";if(j(_($,"wrangler.toml")))return"Cloudflare";if(j(_($,"Dockerfile")))return"Docker";if(j(_($,"fly.toml")))return"Fly.io";if(j(_($,"render.yaml")))return"Render";return null}function sZ($){let Z=_($,"svelte.config.js");if(!j(Z))return null;try{let X=Z$(Z,"utf-8").match(/@sveltejs\/adapter-(\w+)/);if(X){let J=X[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 aZ($){let Z=M$($);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(j(_($,"tsconfig.json"))&&Z?.devDependencies?.typescript)return"TypeScript (tsc)";return null}function oZ($){return["package.json","Cargo.toml","pyproject.toml","go.mod","build.zig","build.zig.zon","src/index.ts","src/index.js","src/main.ts","src/cli.ts","src/main.rs","src/lib.rs","src/main.zig","src/root.zig","src/__init__.py","main.py","__main__.py","main.go","cmd/main.go","README.md","SPECIFICATION.md","BINARY-FORMAT.md","tsconfig.json","wrangler.toml","vercel.json"].filter((z)=>j(_($,z)))}function tZ($,Z){let z={};if(Z?.scripts){for(let X of["build","test","lint","dev","start"])if(Z.scripts[X]){let J=j(_($,"bun.lock"))||j(_($,"bun.lockb"))?"bun run":"npm run";z[X]=`${J} ${X}`}}if(j(_($,"Cargo.toml"))){if(!z.build)z.build="cargo build --release";if(!z.test)z.test="cargo test";if(!z.lint)z.lint="cargo clippy"}if(j(_($,"build.zig"))){if(!z.build)z.build="zig build";if(!z.test)z.test="zig build test"}if(j(_($,"go.mod"))){if(!z.build)z.build="go build ./...";if(!z.test)z.test="go test ./..."}if(j(_($,"pyproject.toml"))||j(_($,"pytest.ini"))){if(!z.test)z.test="pytest"}return z}function eZ($,Z,z,X){let J=[];if(X&&X!=="Unknown")J.push(X);let Q=new Set(["frontend","backend","database","build","css","state","monorepo"]);for(let Y of z)if(Q.has(Y.category))J.push(Y.name);if(j(_($,"bunfig.toml")))J.push("Bun");else if(j(_($,"deno.json"))||j(_($,"deno.jsonc")))J.push("Deno");if(J.length<3&&Z?.dependencies){let Y=Object.keys(Z.dependencies).slice(0,5);for(let q of Y)if(!J.some((W)=>W.toLowerCase().includes(q.toLowerCase())))J.push(q)}return J}function d$($){let Z=M$($),z=b8($),X=cZ($),J=pZ($),Q=J.type,Y=lZ($),q=iZ($),W=nZ($),G=rZ($),U=aZ($),V=z.find((n)=>n.category==="frontend"),K=z.find((n)=>n.category==="css"),L=z.find((n)=>n.category==="ui"),O=z.find((n)=>n.category==="state"),B=z.find((n)=>n.category==="backend"),M=z.find((n)=>n.category==="database"),F=m$[Q]||m$.library,E=Q==="framework",b=z.some((n)=>n.slug==="svelte"||n.slug==="sveltekit"),x=E&&b?"svelte":E?null:null,y=Q==="svelte"||x==="svelte",R=y?sZ($):null,i=y&&z.some((n)=>n.slug==="sveltekit"),C=new Set(["css_framework","ui_library","database","connection","hosting"]),g={},b0=G0.filter((n)=>n.path.startsWith("stack."));for(let n of b0){let o=n.path.replace("stack.","");if(!F.includes(n.category)){g[o]="slotignored";continue}if(E&&C.has(o)){g[o]="slotignored";continue}switch(o){case"frontend":g[o]=V?.name??(Q==="cli"?"CLI":"");break;case"css_framework":g[o]=K?.name??"";break;case"ui_library":g[o]=L?.name??"";break;case"state_management":g[o]=y?O?.name??"Runes":O?.name??"";break;case"backend":g[o]=y?i?"SvelteKit":B?.name??"":B?.name??"";break;case"api_type":g[o]=i?"Server Routes":"";break;case"runtime":g[o]=Y!=="Unknown"?Y:"";break;case"database":g[o]=M?.name??"";break;case"connection":g[o]=M?.name??"";break;case"hosting":if(y&&R)g[o]=R;else g[o]=G??"";break;case"build":g[o]=y?"Vite":U??"";break;case"cicd":g[o]=W??"";break;case"package_manager":g[o]=q;break;default:g[o]="";break}}let x0={},e=G0.filter((n)=>n.path.startsWith("monorepo."));for(let n of e){let o=n.path.replace("monorepo.","");if(!F.includes(n.category))x0[o]="slotignored";else x0[o]=""}let B1={name:Z?.name??$.split("/").pop()??"project",goal:Z?.description??"",main_language:X,type:Q};if(E&&x)B1.framework=x;let X9=eZ($,Z,z,X),J9=oZ($),Q9=tZ($,Z),k4={faf_version:"2.5.0",project:B1,stack:g,human_context:{who:"",what:Z?.description??"",why:"",where:"",when:"",how:""},monorepo:x0,_meta:{found:J.found}};if(X9.length>0)k4.tech_stack=X9;if(J9.length>0)k4.key_files=J9;if(Object.keys(Q9).length>0)k4.commands=Q9;return k4}p();function x8($={}){let Z=process.cwd(),z=$.output?$.output.endsWith(".faf")?$.output:$7(Z,$.output):$7(Z,"project.faf");if(KH(z)&&!$.force)console.error(`project.faf already exists. Use ${k("--force")} to overwrite.`),process.exit(1);let X=d$(Z);s(z,X);let J=u(z),Q=w0(J);if(console.log(`${w("created")} ${z}`),Z0(Q,z),Q.score<100)console.log(N(`
210
+ run ${k("'faf go'")} to fill empty slots`))}import{existsSync as SH}from"fs";import{join as bH}from"path";import{existsSync as BH,readFileSync as LH}from"fs";import{join as NH}from"path";var Z7={MIN_LENGTH:8,MAX_LENGTH:280},HH=[/^(see|see\s+the?)\s+readme/i,/^(tbd|todo|fixme|coming\s+soon)\b/i,/^(software|application|app|project|tool|library|framework)\.?$/i,/^(for\s+users|for\s+developers)\.?$/i,/^(description|goal|name|title)\.?$/i,/^lorem\s+ipsum/i,/^example(\s+\w+)?\.?$/i];function j0($){let Z=$.trim();if(Z.length<Z7.MIN_LENGTH)return!1;if(Z.length>Z7.MAX_LENGTH)return!1;if(HH.some((z)=>z.test(Z)))return!1;if(/^[\s|\-*+]/.test(Z))return!1;if(Z.split(`
211
+ `).length>4)return!1;return!0}function TH($){let Z=$.split(`
212
+ `),z=0;while(z<Z.length&&/^(#\s|$)/.test(Z[z].trim()))z++;while(z<Z.length){let X=Z[z].trim();if(/^\[!\[/.test(X)){z++;continue}if(/^!\[/.test(X)){z++;continue}if(/^<img\s/i.test(X)){z++;continue}if(X===""){z++;continue}break}return Z.slice(z).join(`
213
+ `)}function MH($){let z=TH($).split(`
214
+ `),X=[];for(let J of z){let Q=J.trim();if(Q===""){if(X.length>0)break;continue}if(/^(#|>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(Q))break;if(/^\*\*[^*]+\*\*\s*$/.test(Q)&&X.length===0)continue;X.push(Q)}if(X.length===0)return null;return X.join(" ").trim()}function O$($,Z){let z=$.split(`
215
+ `),X=0;while(X<z.length){let Q=z[X].trim().match(/^(#{1,6})\s+(.+)$/);if(Q&&Z.test(Q[2])){let Y=Q[1].length,q=[];X++;while(X<z.length){let W=z[X].trim(),G=W.match(/^(#{1,6})\s+/);if(G&&G[1].length<=Y)break;if(W===""){if(q.length>0)break;X++;continue}if(/^(>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(W))break;q.push(W),X++}if(q.length===0)return null;return q.join(" ").trim()}X++}return null}function OH($){let Z=O$($,/^(use\s+cases?|goal)\b/i);if(Z&&j0(Z))return Z;let z=MH($);if(z&&j0(z))return z;return}function DH($){let Z=O$($,/^(about|description|overview|what(\s+is\s+this)?)\b/i);if(Z&&j0(Z))return Z;return}function AH($){let Z=O$($,/^(audience|users?|for\s+whom|who(\s+is\s+this\s+for)?)\b/i);if(Z&&j0(Z))return Z;return}function IH($){let Z=O$($,/^(why|motivation|problem|rationale)\b/i);if(Z&&j0(Z))return Z;return}function wH($){let Z=O$($,/^(deployment|where(\s+it\s+runs)?|hosting)\b/i);if(Z&&j0(Z))return Z;return}function FH($){let Z=O$($,/^(status|history|timeline|since|launched)\b/i);if(Z&&j0(Z))return Z;return}function RH($){let Z=O$($,/^(architecture|how(\s+it\s+works)?|approach|design)\b/i);if(Z&&j0(Z))return Z;return}function y8($){let Z=["README.md","README.MD","Readme.md","readme.md"],z=null;for(let L of Z){let O=NH($,L);if(BH(O)){z=O;break}}if(!z)return{};let X;try{X=LH(z,"utf-8")}catch{return{}}let J={},Q=OH(X);if(Q)J.project={goal:Q};let Y={},q=DH(X);if(q)Y.what=q;let W=AH(X);if(W)Y.who=W;let G=IH(X);if(G)Y.why=G;let U=wH(X);if(U)Y.where=U;let V=FH(X);if(V)Y.when=V;let K=RH(X);if(K)Y.how=K;if(Object.keys(Y).length>0)J.human_context=Y;return J}import{existsSync as PH,readFileSync as _H}from"fs";import{join as EH}from"path";function CH($,Z){let z=$.split(`
216
+ `),X=!1;for(let J of z){let Q=J.trim();if(/^\[/.test(Q)){X=Q==="[package]";continue}if(!X)continue;let Y=Q.match(new RegExp(`^${Z}\\s*=\\s*(.+)$`));if(Y){let q=Y[1].trim();q=q.replace(/\s*#.*$/,"").trim();let W=q.match(/^"((?:[^"\\]|\\.)*)"$/)||q.match(/^'((?:[^'\\]|\\.)*)'$/);if(W)return W[1];return q}}return null}function k8($){let Z=EH($,"Cargo.toml");if(!PH(Z))return{};let z;try{z=_H(Z,"utf-8")}catch{return{}}let X=CH(z,"description");if(X&&j0(X))return{project:{goal:X}};return{}}function jH($,Z){let z={project:{...Z.project??{},...$.project??{}},human_context:{...Z.human_context??{},...$.human_context??{}}};if(z.project&&Object.keys(z.project).length===0)delete z.project;if(z.human_context&&Object.keys(z.human_context).length===0)delete z.human_context;return z}function z7($){return jH(y8($),k8($))}p();function X7(){let $=process.cwd(),Z=bH($,"project.faf"),z=d$($),X=z7($);if(SH(Z)){let Y=c(Z),q=E2(Y,X),W=E2(q,z);s(Z,W),console.log(`${w("updated")} ${Z}`)}else{let Y=E2(z,X),q=Y.project?.type??"library",W=m$[q]||m$.library;for(let G of G0)if(!W.includes(G.category)){let[U,V]=G.path.split(".");if(U==="stack"&&Y.stack)Y.stack[V]="slotignored";if(U==="monorepo"&&Y.monorepo)Y.monorepo[V]="slotignored"}s(Z,Y),console.log(`${w("created")} ${Z}`)}let J=u(Z),Q=V0(W0(J));if(Z0(Q,Z),Q.score<100)console.log(N(`
217
+ run ${k("'faf go'")} to reach \uD83C\uDFC6 Trophy`))}function E2($,Z){let z={...$};for(let[X,J]of Object.entries(Z)){let Q=z[X];if($$(Q))z[X]=J;else if(typeof J==="object"&&J!==null&&!Array.isArray(J)&&typeof Q==="object"&&Q!==null&&!Array.isArray(Q))z[X]=E2(Q,J)}return z}import{existsSync as j2,statSync as V7}from"fs";import{join as K7,dirname as vH}from"path";import{readFileSync as xH,writeFileSync as yH,existsSync as kH,statSync as ZO}from"fs";import{join as Q7}from"path";var Y7="CLAUDE.md",fH="STATUS: BI-SYNC ACTIVE";function q7($){let Z=Q7($,Y7);if(!kH(Z))return null;return xH(Z,"utf-8")}function W7($,Z){let z=Q7($,Y7);yH(z,Z,"utf-8")}function D$($,Z={}){let z=String($.project?.name??"").trim(),X=String($.project?.main_language??"").trim(),J=String($.project?.type??"").trim(),Q=String($.project?.goal??"").trim(),Y=`<!-- faf: ${[z,X,J,Q].join(" | ")} -->`,q=[];if(Z.doc)q.push(`doc=${Z.doc}`);else q.push(`claim=${Z.claim??"project.faf"}`);if(typeof Z.score==="number")q.push(`score=${Z.score}`);if(q.push(`family=${Z.family??"FAF"}`),Z.siblings&&Z.siblings.length>0)q.push(`siblings=${Z.siblings.join(",")}`);let W=`<!-- faf: ${q.join(" | ")} -->`;return`${Y}
218
+ ${W}`}function G7($){let Z=[],z=$.project?.name??"Project",X=$.project?.main_language??"",J=$.project?.goal??"";if(Z.push(D$($)),Z.push(""),Z.push(`# CLAUDE.md — ${z}`),Z.push(""),J)Z.push("## What This Is"),Z.push(""),Z.push(J),Z.push("");let Q=$.stack??{},Y=[];if(X)Y.push(`**Language:** ${X}`);for(let[G,U]of Object.entries(Q))if(U&&U!=="slotignored"&&String(U).trim()){let V=G.replace(/_/g," ").replace(/\b\w/g,(K)=>K.toUpperCase());Y.push(`**${V}:** ${U}`)}if(Y.length>0){Z.push("## Stack"),Z.push("");for(let G of Y)Z.push(`- ${G}`);Z.push("")}let q=$.human_context??{},W=[["Who",q.who],["What",q.what],["Why",q.why],["Where",q.where],["When",q.when],["How",q.how]].filter(([G,U])=>U&&String(U).trim());if(W.length>0){Z.push("## Context"),Z.push("");for(let[G,U]of W)Z.push(`- **${G}:** ${U}`);Z.push("")}return Z.push("---"),Z.push(""),Z.push(`*${fH} — ${new Date().toISOString()}*`),Z.push(""),Z.join(`
219
+ `)}function J7($){return $.replace(/\s+v\d+(?:\.\d+)*\s*$/i,"").trim()}function C2($){let Z={project:{}},z=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(z)Z.project.name=J7(z[1].trim());if(!Z.project.name){let Q=$.match(/\*\*Name:\*\*\s*(.+)/);if(Q)Z.project.name=J7(Q[1].trim())}let X=$.match(/## What This Is\s*\n\s*\n(.+)/);if(X)Z.project.goal=X[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 QO,writeFileSync as gH,existsSync as YO}from"fs";import{join as hH}from"path";function U7($,Z){gH(hH($,"MEMORY.md"),Z,"utf-8")}p();function c$(){return process.env.FAF_PRO==="1"||process.env.FAF_PRO==="true"}function f8($={}){let Z=process.cwd(),z=v(Z);if(!z)console.error(`Error: project.faf not found
220
+
221
+ Run 'faf init' to create one.`),process.exit(2);let X=K7(Z,"CLAUDE.md"),J=K7(Z,"MEMORY.md"),Q=$.direction??"auto";if(Q==="auto")H7(z,X,Z);else if(Q==="push")B7(z,Z);else if(Q==="pull")uH(z,X);if(c$())L7(z,J,Z);if($.watch)console.log(N("watching for changes... (Ctrl+C to stop)")),dH(z,X,J,Z)}function H7($,Z,z){B7($,z)}function B7($,Z){let z=c($),X=G7(z);W7(Z,X),console.log(`${w("◆")} sync .faf → CLAUDE.md ${N("← bi-sync")}`);let J=V0(W0(u($)));Z0(J,$)}function uH($,Z){let z=V0(W0(u($)));if(z.tier.name!=="TROPHY")console.error(`${k("×")} sync --pull blocked: requires \uD83C\uDFC6 Trophy (currently ${z.score}%)`),console.error(N(" MD → .faf backfill only runs at 100%. Reach Trophy with 'faf go', then retry.")),process.exit(1);let X=q7(vH(Z));if(!X){console.error("CLAUDE.md not found.");return}let J=C2(X),Q=c($);if(J.project?.name)Q.project={...Q.project,name:J.project.name};if(J.project?.goal)Q.project={...Q.project,goal:J.project.goal};if(J.project?.main_language)Q.project={...Q.project,main_language:J.project.main_language};s($,Q),console.log(`${w("◆")} sync CLAUDE.md → .faf ${N("← bi-sync (Trophy-gated)")}`);let Y=V0(W0(u($)));Z0(Y,$)}function L7($,Z,z){let X=c($),J=V7($).mtimeMs,Q=j2(Z)?V7(Z).mtimeMs:0;if(!j2(Z)||J>Q){let Y=mH(X);U7(z,Y),console.log(`${w("◆")} sync .faf → MEMORY.md ${N("← tri-sync")}`)}else console.log(`${w("◆")} sync MEMORY.md → .faf ${N("← tri-sync")}`)}function mH($){let Z=$.project??{},z=[`# ${Z.name??"Project"} — Memory Topics`,"","> Generated by faf sync (tri-sync)",""];if(Z.name)z.push(`- **Project:** ${Z.name}`);if(Z.goal)z.push(`- **Goal:** ${Z.goal}`);if(Z.main_language)z.push(`- **Language:** ${Z.main_language}`);if(Z.type)z.push(`- **Type:** ${Z.type}`);return z.join(`
222
222
  `)+`
223
- `}function xH($,Z,X,z){let{watch:J}=L0("fs"),Q=null,Y=()=>{if(Q)clearTimeout(Q);Q=setTimeout(()=>{if(console.log(L("change detected...")),GX($,Z,z),c$())UX($,X,z)},200)};if(J($,Y),E4(Z))J(Z,Y);if(c$()&&E4(X))J(X,Y)}import{writeFileSync as yH}from"fs";p();function VX($,Z={}){let X=$??u();if(!X)console.error(`Error: project.faf not found
224
-
225
- Run 'faf init' to create one.`),process.exit(2);let z=d(X),J=xZ(z),Q=Z.output??X.replace(/\.faf$/,".fafb");yH(Q,J),console.log(`${I("compiled")} ${Q} ${L(`(${J.length} bytes)`)}`)}import{readFileSync as kH}from"fs";function KX($,Z={}){if(!$)console.error("Error: Please specify a .fafb file to decompile."),process.exit(1);let X=new Uint8Array(kH($));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=yZ(X);console.log(JSON.stringify(z,null,2))}function HX($){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");if(X.app_type==="about"){if(!X.about?.represents)Z.push("app_type 'about' requires about.represents (owner/repo of the source codebase)");else if(!/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(X.about.represents))Z.push(`about.represents must be "owner/repo" format (got: ${X.about.represents})`);if(X.about?.source_score!==void 0){let z=X.about.source_score;if(typeof z!=="number"||z<0||z>100)Z.push(`about.source_score must be a number 0-100 (got: ${z})`)}}return{valid:Z.length===0,errors:Z}}p();function b8($,Z={}){let X=$??u();if(!X)console.error(`Error: project.faf not found
226
-
227
- Run 'faf init' to create one.`),process.exit(2);let z=c(X),J=HX(z);if(!J.valid){console.log(`${k("invalid")} ${X}`);for(let q of J.errors)console.log(` ${L("x")} ${q}`);process.exit(3)}let Q=d(X);if(!bZ(Q))console.log(`${k("invalid yaml")} ${X}`),process.exit(3);console.log(`${I("valid")} ${X}`);let Y=e0(Q);if(Z0(Y,X),Z.strict&&Y.score<100)console.log(L(`
228
- --strict requires 100%`)),process.exit(1)}import{writeFileSync as fH}from"fs";import{join as gH}from"path";function hH($){let Z=[];if(Z.push(D$($)),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(`
229
- `)}function BX($,Z){fH(gH($,"AGENTS.md"),hH(Z),"utf-8")}import{writeFileSync as vH}from"fs";import{join as uH}from"path";function mH($){let Z=[];if(Z.push(D$($)),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(`
230
- `)}function NX($,Z){vH(uH($,".cursorrules"),mH(Z),"utf-8")}import{writeFileSync as dH}from"fs";import{join as cH}from"path";function pH($){let Z=[];if(Z.push(D$($)),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(`
231
- `)}function LX($,Z){dH(cH($,"GEMINI.md"),pH(Z),"utf-8")}p();function m1($={}){let Z=u();if(!Z)console.error(`Error: project.faf not found
232
-
233
- Run 'faf init' to create one.`),process.exit(2);let X=process.cwd(),z=c(Z),J=$.all||!$.agents&&!$.cursor&&!$.gemini&&!$.conductor;if(J||$.agents)BX(X,z),console.log(" AGENTS.md");if(J||$.cursor)NX(X,z),console.log(" .cursorrules");if(J||$.gemini)LX(X,z),console.log(" GEMINI.md");console.log(`${I("exported")} ${L(`from ${Z}`)}`)}import{mkdirSync as lH,rmSync as iH}from"fs";import{join as TX}from"path";import{execSync as nH}from"child_process";import{tmpdir as rH}from"os";p();function MX($){if(!$)console.error(`Error: Please provide a GitHub URL.
234
-
235
- Usage: faf git <url>`),process.exit(1);let Z=$.endsWith(".git")?$:`${$}.git`,X=TX(rH(),`faf-git-${Date.now()}`);lH(X,{recursive:!0});try{console.log(L(`cloning ${$}...`));try{nH(`git clone --depth 1 ${Z} ${X}`,{stdio:"pipe"})}catch(q){let W=(q?.stderr?.toString()??"").trim().split(`
223
+ `}function dH($,Z,z,X){let{watch:J}=N0("fs"),Q=null,Y=()=>{if(Q)clearTimeout(Q);Q=setTimeout(()=>{if(console.log(N("change detected...")),H7($,Z,X),c$())L7($,z,X)},200)};if(J($,Y),j2(Z))J(Z,Y);if(c$()&&j2(z))J(z,Y)}import{writeFileSync as cH}from"fs";p();function N7($,Z={}){let z=$??v();if(!z)console.error(`Error: project.faf not found
224
+
225
+ Run 'faf init' to create one.`),process.exit(2);let X=u(z),J=hZ(X),Q=Z.output??z.replace(/\.faf$/,".fafb");cH(Q,J),console.log(`${w("compiled")} ${Q} ${N(`(${J.length} bytes)`)}`)}import{readFileSync as pH}from"fs";function T7($,Z={}){if(!$)console.error("Error: Please specify a .fafb file to decompile."),process.exit(1);let z=new Uint8Array(pH($));if(String.fromCharCode(z[0],z[1],z[2],z[3])!=="FAFB")console.error("Error: Not a valid .fafb file (missing FAFB magic bytes)."),process.exit(3);let X=vZ(z);console.log(JSON.stringify(X,null,2))}function M7($){let Z=[];if(!$||typeof $!=="object")return Z.push("File is not a valid YAML mapping"),{valid:!1,errors:Z};let z=$;if(!z.faf_version)Z.push("Missing required field: faf_version");if(!z.project?.name)Z.push("Missing required field: project.name");if(z.app_type==="about"){if(!z.about?.represents)Z.push("app_type 'about' requires about.represents (owner/repo of the source codebase)");else if(!/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(z.about.represents))Z.push(`about.represents must be "owner/repo" format (got: ${z.about.represents})`);if(z.about?.source_score!==void 0){let X=z.about.source_score;if(typeof X!=="number"||X<0||X>100)Z.push(`about.source_score must be a number 0-100 (got: ${X})`)}}return{valid:Z.length===0,errors:Z}}p();function g8($,Z={}){let z=$??v();if(!z)console.error(`Error: project.faf not found
226
+
227
+ Run 'faf init' to create one.`),process.exit(2);let X=c(z),J=M7(X);if(!J.valid){console.log(`${k("invalid")} ${z}`);for(let q of J.errors)console.log(` ${N("x")} ${q}`);process.exit(3)}let Q=u(z);if(!gZ(Q))console.log(`${k("invalid yaml")} ${z}`),process.exit(3);console.log(`${w("valid")} ${z}`);let Y=w0(Q);if(Z0(Y,z),Z.strict&&Y.score<100)console.log(N(`
228
+ --strict requires 100%`)),process.exit(1)}import{writeFileSync as lH}from"fs";import{join as iH}from"path";function nH($){let Z=[];if(Z.push(D$($)),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[z,X]of Object.entries($.stack))if(X&&X!=="slotignored"&&X!=="")Z.push(`- **${z}:** ${X}`)}if($.human_context){Z.push(""),Z.push("## Human Context"),Z.push("");for(let[z,X]of Object.entries($.human_context))if(X&&X!=="")Z.push(`- **${z}:** ${X}`)}return Z.push(""),Z.join(`
229
+ `)}function O7($,Z){lH(iH($,"AGENTS.md"),nH(Z),"utf-8")}import{writeFileSync as rH}from"fs";import{join as sH}from"path";function aH($){let Z=[];if(Z.push(D$($)),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[z,X]of Object.entries($.stack))if(X&&X!=="slotignored"&&X!=="")Z.push(`# ${z}: ${X}`)}return Z.push(""),Z.join(`
230
+ `)}function D7($,Z){rH(sH($,".cursorrules"),aH(Z),"utf-8")}import{writeFileSync as oH}from"fs";import{join as tH}from"path";function eH($){let Z=[];if(Z.push(D$($)),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[z,X]of Object.entries($.stack))if(X&&X!=="slotignored"&&X!=="")Z.push(`- ${z}: ${X}`)}return Z.push(""),Z.join(`
231
+ `)}function A7($,Z){oH(tH($,"GEMINI.md"),eH(Z),"utf-8")}p();import{writeFileSync as $B}from"fs";import{join as ZB}from"path";var I7=m1.orange,zB=m1.cyan,XB=m1.cyanDeep,JB="#FF9500",QB="#FF3B30",YB="#E6EDF3",qB="#6E7681",w7={TROPHY:{glyph:"\uD83C\uDFC6",color:I7},GOLD:{glyph:"★",color:I7},SILVER:{glyph:"◆",color:zB},BRONZE:{glyph:"◇",color:XB},GREEN:{glyph:"●",color:YB},YELLOW:{glyph:"●",color:JB},RED:{glyph:"○",color:QB},WHITE:{glyph:"♡",color:qB}};function p$($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var F7=["who","what","why","where","when","how"];function S2($){return $.filter(([,Z])=>Z!==void 0&&Z!==null&&String(Z).trim()!=="").map(([Z,z])=>`<div class="row"><div class="k">${p$(Z)}</div><div class="v">${p$(z)}</div></div>`).join(`
232
+ `)}function WB($,Z,z="project.faf"){let X=p$($.project?.name??"Project"),J=Z.tier?.name??"WHITE",Q=w7[J]??w7.WHITE,Y=Z.inherited?Z.represents?`inherited from ${p$(Z.represents)}`:"inherited":`${Z.score}%`,q=J==="TROPHY"&&!Z.inherited,W=$.human_context??{},G=F7.map((B)=>[B,W[B]]),U=Object.entries(W).filter(([B])=>!F7.includes(B)),V=[["goal",$.project?.goal],["main_language",$.project?.main_language],["type",$.project?.type],["framework",$.project?.framework],["faf_version",$.faf_version]],K=Object.entries($.stack??{}),L=K.filter(([,B])=>B&&B!=="slotignored"&&String(B).trim()!==""),O=K.filter(([,B])=>B==="slotignored").length;return`<!DOCTYPE html>
233
+ <html lang="en">
234
+ <head>
235
+ <meta charset="UTF-8">
236
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
237
+ <title>${X} — project.faf</title>
238
+ <meta name="description" content="Visual render of project.faf. Generated by faf — humans like visuals, we gave them one.">
239
+ <meta name="robots" content="index,follow">
240
+ <style>
241
+ *{margin:0;padding:0;box-sizing:border-box}
242
+ body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;background:#0a0a0a;color:#e6edf3;line-height:1.55;padding:48px 20px}
243
+ .wrap{max-width:880px;margin:0 auto}
244
+ .bar{height:3px;border-radius:2px;background:linear-gradient(90deg,transparent,${Q.color},transparent);margin-bottom:40px}
245
+ header{display:flex;align-items:baseline;gap:16px;flex-wrap:wrap;margin-bottom:8px}
246
+ h1{font-size:2.2rem;font-weight:800;letter-spacing:-1px}
247
+ .badge{font-size:1.05rem;font-weight:800;color:${Q.color};white-space:nowrap}
248
+ .score{font-size:1.05rem;font-weight:700;color:#8b949e}
249
+ .eyebrow{font-size:11px;font-weight:700;letter-spacing:2px;text-transform:uppercase;color:#6e7681;margin-bottom:36px}
250
+ section{margin-bottom:34px}
251
+ h2{font-size:12px;font-weight:700;letter-spacing:2px;text-transform:uppercase;color:${Q.color};margin-bottom:14px;padding-bottom:6px;border-bottom:1px solid rgba(255,255,255,.07)}
252
+ .row{display:flex;gap:18px;padding:8px 0;border-bottom:1px solid rgba(255,255,255,.04)}
253
+ .k{flex:0 0 150px;color:#8b949e;font-size:.9rem;text-transform:capitalize}
254
+ .v{flex:1;color:#e6edf3;font-size:.95rem;word-break:break-word}
255
+ .meter{height:8px;border-radius:4px;background:rgba(255,255,255,.06);overflow:hidden;margin:6px 0 10px}
256
+ .meter span{display:block;height:100%;background:${Q.color};width:${Math.max(0,Math.min(100,Z.score))}%}
257
+ .award{font-size:.95rem}
258
+ .statline{margin-bottom:32px}
259
+ .awd-pre{color:#6E7681}
260
+ .awd-win{color:#FFFFFF;font-weight:700}
261
+ .muted{color:#6e7681;font-size:.85rem}
262
+ footer{margin-top:48px;padding-top:20px;border-top:1px solid rgba(255,255,255,.07);font-size:.82rem;color:#6e7681}
263
+ footer strong{color:#e6edf3}
264
+ @media(max-width:560px){.row{flex-direction:column;gap:2px}.k{flex:none}}
265
+ </style>
266
+ </head>
267
+ <body>
268
+ <div class="wrap">
269
+ <div class="bar"></div>
270
+ <div class="eyebrow">project.faf · visual render</div>
271
+ <header>
272
+ <h1>${X}</h1>
273
+ <span class="badge">${Q.glyph} ${p$(J)}</span>
274
+ <span class="score">${Y}</span>
275
+ </header>
276
+ <div class="meter"><span></span></div>
277
+ ${q?'<p class="award statline"><span class="awd-pre">✅ All Required slots filled.</span> <span class="awd-win">100% Trophy \uD83C\uDFC6 Awarded</span></p>':`<p class="muted statline">${Z.populated}/${Z.active} slots populated · ${Z.total} total${O?` · ${O} slotignored`:""}</p>`}
278
+
279
+ <section>
280
+ <h2>The 6 W's</h2>
281
+ ${S2(G)||'<p class="muted">No human_context yet.</p>'}
282
+ ${U.length?S2(U):""}
283
+ </section>
284
+
285
+ <section>
286
+ <h2>Project</h2>
287
+ ${S2(V)||'<p class="muted">—</p>'}
288
+ </section>
289
+
290
+ <section>
291
+ <h2>Stack</h2>
292
+ ${L.length?S2(L):'<p class="muted">No active stack slots.</p>'}
293
+ </section>
294
+
295
+ <footer>
296
+ Rendered on-demand from your current <strong>${p$(z)}</strong><br>
297
+ <strong>Humans like visuals. <span style="color:#00D4D4">We gave them one.</span></strong>
298
+ </footer>
299
+ </div>
300
+ </body>
301
+ </html>
302
+ `}function b2($,Z,z,X="project.faf"){$B(ZB($,"project.html"),WB(Z,z,X),"utf-8")}p();function c1($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
303
+
304
+ Run 'faf init' to create one.`),process.exit(2);let z=process.cwd(),X=c(Z),J=$.all||!$.agents&&!$.cursor&&!$.gemini&&!$.conductor&&!$.html;if(J||$.agents)O7(z,X),console.log(" AGENTS.md");if(J||$.cursor)D7(z,X),console.log(" .cursorrules");if(J||$.gemini)A7(z,X),console.log(" GEMINI.md");if(J||$.html){let Q=w0(u(Z));b2(z,X,Q,Z),console.log(" project.html")}console.log(`${w("exported")} ${N(`from ${Z}`)}`)}import{join as GB}from"path";import UB from"open";p();function VB($){if(process.env.CI)return!1;try{return UB($).catch(()=>{return}),!0}catch{return!1}}function R7(){let $=v();if(!$)console.error(`Error: project.faf not found
305
+
306
+ Run 'faf init' to create one.`),process.exit(2);let Z=process.cwd(),z=c($),X=w0(u($));b2(Z,z,X,$);let J=GB(Z,"project.html"),Q=VB(J);console.log(" project.html"),console.log(Q?`${w("opened")} ${N("in your browser")}`:`${w("rendered")} ${N(`file://${J}`)}`)}import{mkdirSync as KB,rmSync as HB}from"fs";import{join as P7}from"path";import{execSync as BB}from"child_process";import{tmpdir as LB}from"os";p();function _7($){if(!$)console.error(`Error: Please provide a GitHub URL.
307
+
308
+ Usage: faf git <url>`),process.exit(1);let Z=$.endsWith(".git")?$:`${$}.git`,z=P7(LB(),`faf-git-${Date.now()}`);KB(z,{recursive:!0});try{console.log(N(`cloning ${$}...`));try{BB(`git clone --depth 1 ${Z} ${z}`,{stdio:"pipe"})}catch(q){let G=(q?.stderr?.toString()??"").trim().split(`
236
309
  `).slice(-2).join(" ").trim()||"git clone failed";console.error(`Error: could not clone ${$}
237
310
 
238
- ${W}`),process.exit(1)}let z=d$(X),J=TX(process.cwd(),"project.faf");s(J,z),console.log(`${I("created")} ${J}`);let Q=d(J),Y=U0(G0(Q));Z0(Y,J)}finally{iH(X,{recursive:!0,force:!0})}}p();function OX($={}){if($.version||Object.keys($).length===0)aH()}function aH(){let $=x8();console.log(`${I(k("faf"))} v${$.version}`),console.log(L(`kernel ${kZ()} IANA application/vnd.faf+yaml`))}var d1=[{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"}];p();function DX(){console.log(`${I("formats")} ${L("— supported file types")}
239
- `);let $=new Map;for(let Z of d1){let X=$.get(Z.category)??[];X.push(Z),$.set(Z.category,X)}for(let[Z,X]of $){console.log(` ${k(Z)}`);for(let z of X)console.log(` ${z.name} ${L(z.extensions.join(", "))}`);console.log()}console.log(L(` ${d1.length} formats across ${$.size} categories`))}p();import{readdirSync as oH,rmSync as tH}from"fs";import{tmpdir as eH}from"os";import{join as $B}from"path";function AX(){let $=eH(),Z=0;try{let X=oH($);for(let z of X)if(z.startsWith("faf-git-"))tH($B($,z),{recursive:!0,force:!0}),Z++}catch{}if(Z>0)console.log(`${I("cleared")} ${Z} cached director${Z===1?"y":"ies"}`);else console.log(L("nothing to clear"))}function wX($={}){let Z=u();if(!Z)console.error(`Error: project.faf not found
311
+ ${G}`),process.exit(1)}let X=d$(z),J=P7(process.cwd(),"project.faf");s(J,X),console.log(`${w("created")} ${J}`);let Q=u(J),Y=V0(W0(Q));Z0(Y,J)}finally{HB(z,{recursive:!0,force:!0})}}p();function E7($={}){if($.version||Object.keys($).length===0)TB()}function TB(){let $=h8();console.log(`${w(k("faf"))} v${$.version}`),console.log(N(`kernel ${uZ()} IANA application/vnd.faf+yaml`))}var p1=[{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"}];p();function C7(){console.log(`${w("formats")} ${N("— supported file types")}
312
+ `);let $=new Map;for(let Z of p1){let z=$.get(Z.category)??[];z.push(Z),$.set(Z.category,z)}for(let[Z,z]of $){console.log(` ${k(Z)}`);for(let X of z)console.log(` ${X.name} ${N(X.extensions.join(", "))}`);console.log()}console.log(N(` ${p1.length} formats across ${$.size} categories`))}p();import{readdirSync as MB,rmSync as OB}from"fs";import{tmpdir as DB}from"os";import{join as AB}from"path";function j7(){let $=DB(),Z=0;try{let z=MB($);for(let X of z)if(X.startsWith("faf-git-"))OB(AB($,X),{recursive:!0,force:!0}),Z++}catch{}if(Z>0)console.log(`${w("cleared")} ${Z} cached director${Z===1?"y":"ies"}`);else console.log(N("nothing to clear"))}function S7($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
240
313
 
241
- Run 'faf init' to create one.`),process.exit(2);if($.json){let X=c(Z);console.log(JSON.stringify(X,null,2))}else{let X=d(Z);console.log(X)}}p();function IX(){let $=u();if(!$)console.error(`Error: project.faf not found
314
+ Run 'faf init' to create one.`),process.exit(2);if($.json){let z=c(Z);console.log(JSON.stringify(z,null,2))}else{let z=u(Z);console.log(z)}}p();function b7(){let $=v();if(!$)console.error(`Error: project.faf not found
242
315
 
243
- Run 'faf init' to create one.`),process.exit(2);let Z=c($),X=[];for(let z of K0){let[J,Q]=z.path.split("."),q=Z[J]?.[Q];if($$(q)||q==="slotignored")continue;X.push(`${z.path}: ${q}`)}if(X.length===0){console.log(L("no populated slots"));return}console.log(X.join(`
244
- `))}import{existsSync as ZB,statSync as FX}from"fs";import{join as XB}from"path";p();var zB=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"];function RX(){let $=u();if(!$)console.error(`Error: project.faf not found
316
+ Run 'faf init' to create one.`),process.exit(2);let Z=c($),z=[];for(let X of G0){let[J,Q]=X.path.split("."),q=Z[J]?.[Q];if($$(q)||q==="slotignored")continue;z.push(`${X.path}: ${q}`)}if(z.length===0){console.log(N("no populated slots"));return}console.log(z.join(`
317
+ `))}import{existsSync as IB,statSync as x7}from"fs";import{join as wB}from"path";p();var FB=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"];function y7(){let $=v();if(!$)console.error(`Error: project.faf not found
245
318
 
246
- Run 'faf init' to create one.`),process.exit(2);let Z=process.cwd(),X=FX($).mtimeMs;console.log(`${I("drift")} ${L("— context file sync status")}
247
- `),console.log(` ${k(".faf")} ${L(y8(X))}`);let z=0;for(let J of zB){let Q=XB(Z,J);if(!ZB(Q)){console.log(` ${L("○")} ${J} ${L("missing")}`);continue}let Y=FX(Q).mtimeMs,q=Y-X;if(Math.abs(q)<1000)console.log(` ${I("●")} ${J} ${L("in sync")}`);else if(q>0)console.log(` ${k("!")} ${J} ${k("newer")} ${L(y8(Y))}`),z++;else console.log(` ${L("○")} ${J} ${L("older")} ${L(y8(Y))}`),z++}if(z>0)console.log(L(`
248
- run ${k("'faf sync'")} to resolve drift`))}function y8($){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`}p();function PX($,Z){if(!$||Z===void 0)console.error(`Usage: faf edit <path> <value>
319
+ Run 'faf init' to create one.`),process.exit(2);let Z=process.cwd(),z=x7($).mtimeMs;console.log(`${w("drift")} ${N("— context file sync status")}
320
+ `),console.log(` ${k(".faf")} ${N(v8(z))}`);let X=0;for(let J of FB){let Q=wB(Z,J);if(!IB(Q)){console.log(` ${N("○")} ${J} ${N("missing")}`);continue}let Y=x7(Q).mtimeMs,q=Y-z;if(Math.abs(q)<1000)console.log(` ${w("●")} ${J} ${N("in sync")}`);else if(q>0)console.log(` ${k("!")} ${J} ${k("newer")} ${N(v8(Y))}`),X++;else console.log(` ${N("○")} ${J} ${N("older")} ${N(v8(Y))}`),X++}if(X>0)console.log(N(`
321
+ run ${k("'faf sync'")} to resolve drift`))}function v8($){let Z=Date.now()-$,z=Math.floor(Z/1000);if(z<60)return`${z}s ago`;let X=Math.floor(z/60);if(X<60)return`${X}m ago`;let J=Math.floor(X/60);if(J<24)return`${J}h ago`;return`${Math.floor(J/24)}d ago`}p();function k7($,Z){if(!$||Z===void 0)console.error(`Usage: faf edit <path> <value>
249
322
 
250
- Example: faf edit project.name "My Project"`),process.exit(1);let X=u();if(!X)console.error(`Error: project.faf not found
323
+ Example: faf edit project.name "My Project"`),process.exit(1);let z=v();if(!z)console.error(`Error: project.faf not found
251
324
 
252
- Run 'faf init' to create one.`),process.exit(2);let z=c(X),J=$.split(".");if(J.length!==2)console.error("Error: path must be section.field (e.g. project.name)"),process.exit(1);let[Q,Y]=J;if(!z[Q]||typeof z[Q]!=="object")z[Q]={};z[Q][Y]=Z,s(X,z),console.log(`${I("updated")} ${$} ${L("→")} ${Z}`)}import{existsSync as _4,readFileSync as k8}from"fs";import{join as c1}from"path";p();function EX(){let $=process.cwd(),Z=[],X={faf_version:"2.5.0",project:{}},z=c1($,"CLAUDE.md");if(_4(z)){let G=k8(z,"utf-8"),W=P4(G);if(W.project?.name)X.project.name=W.project.name;if(W.project?.goal)X.project.goal=W.project.goal;if(W.project?.main_language)X.project.main_language=W.project.main_language;Z.push("CLAUDE.md")}let J=c1($,"AGENTS.md");if(_4(J)){let G=k8(J,"utf-8");if(!X.project.name){let W=G.match(/^#\s+(.+)/m);if(W)X.project.name=W[1].trim()}Z.push("AGENTS.md")}let Q=c1($,"GEMINI.md");if(_4(Q)){let G=k8(Q,"utf-8");if(!X.project.name){let W=G.match(/^#\s+(.+)/m);if(W)X.project.name=W[1].trim()}Z.push("GEMINI.md")}let Y=c1($,".cursorrules");if(_4(Y))Z.push(".cursorrules");if(Z.length===0)console.error("No context files found (CLAUDE.md, AGENTS.md, GEMINI.md, .cursorrules)."),process.exit(2);let q=u($);if(q){let G=c(q);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;s(q,G),console.log(`${I("◆")} recover merged into ${q}`)}else{let G=c1($,"project.faf");s(G,X),console.log(`${I("◆")} recover created ${G}`)}console.log(L(` sources: ${Z.join(", ")}`))}p();var p1="2.5.0";function _X($={}){let Z=u();if(!Z)console.error(`Error: project.faf not found
325
+ Run 'faf init' to create one.`),process.exit(2);let X=c(z),J=$.split(".");if(J.length!==2)console.error("Error: path must be section.field (e.g. project.name)"),process.exit(1);let[Q,Y]=J;if(!X[Q]||typeof X[Q]!=="object")X[Q]={};X[Q][Y]=Z,s(z,X),console.log(`${w("updated")} ${$} ${N("→")} ${Z}`)}import{existsSync as x2,readFileSync as u8}from"fs";import{join as l1}from"path";p();function f7(){let $=process.cwd(),Z=[],z={faf_version:"2.5.0",project:{}},X=l1($,"CLAUDE.md");if(x2(X)){let W=u8(X,"utf-8"),G=C2(W);if(G.project?.name)z.project.name=G.project.name;if(G.project?.goal)z.project.goal=G.project.goal;if(G.project?.main_language)z.project.main_language=G.project.main_language;Z.push("CLAUDE.md")}let J=l1($,"AGENTS.md");if(x2(J)){let W=u8(J,"utf-8");if(!z.project.name){let G=W.match(/^#\s+(.+)/m);if(G)z.project.name=G[1].trim()}Z.push("AGENTS.md")}let Q=l1($,"GEMINI.md");if(x2(Q)){let W=u8(Q,"utf-8");if(!z.project.name){let G=W.match(/^#\s+(.+)/m);if(G)z.project.name=G[1].trim()}Z.push("GEMINI.md")}let Y=l1($,".cursorrules");if(x2(Y))Z.push(".cursorrules");if(Z.length===0)console.error("No context files found (CLAUDE.md, AGENTS.md, GEMINI.md, .cursorrules)."),process.exit(2);let q=v($);if(q){let W=c(q);if(!W.project)W.project={};if(z.project.name&&!W.project.name)W.project.name=z.project.name;if(z.project.goal&&!W.project.goal)W.project.goal=z.project.goal;if(z.project.main_language&&!W.project.main_language)W.project.main_language=z.project.main_language;s(q,W),console.log(`${w("◆")} recover merged into ${q}`)}else{let W=l1($,"project.faf");s(W,z),console.log(`${w("◆")} recover created ${W}`)}console.log(N(` sources: ${Z.join(", ")}`))}p();var i1="2.5.0";function g7($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
253
326
 
254
- Run 'faf init' to create one.`),process.exit(2);let X=c(Z),z=X.faf_version??"unknown";if(z===p1){console.log(`${I("◆")} migrate already at v${p1}`);return}if(X.faf_version=p1,!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(`${I("◆")} migrate ${L("(dry run)")} v${z} → v${p1}`),console.log(L(` would update ${Z}`));return}s(Z,X),console.log(`${I("◆")} migrate v${z} → v${p1}`),console.log(L(` updated ${Z}`))}p();function CX($){if($==="features")QB();else if($==="activate")YB();else JB()}function JB(){let $=c$();if(console.log(`${I("pro")} ${L("— FAF Pro status")}
255
- `),console.log(` Status: ${$?E0(k("PRO")):k("Free")}`),console.log(""),!$)console.log(L(" Upgrade: faf pro activate"))}function QB(){console.log(`${I("pro")} ${L("— Pro features")}
256
- `);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(` ${I("◆")} ${k(Z)} ${L("—")} ${X}`);console.log("")}function YB(){console.log(`${I("pro")} ${L("— activate")}
257
- `),console.log(" Set FAF_PRO=1 in your environment to enable Pro features."),console.log(""),console.log(L(" export FAF_PRO=1")),console.log(""),console.log(L(" Visit: https://faf.one/pro")),import("open").then(({default:$})=>$("https://faf.one/pro")).catch(()=>{})}import{gzipSync as qB}from"zlib";p();function jX($={}){let Z=u();if(!Z)console.error(`Error: project.faf not found
327
+ Run 'faf init' to create one.`),process.exit(2);let z=c(Z),X=z.faf_version??"unknown";if(X===i1){console.log(`${w("◆")} migrate already at v${i1}`);return}if(z.faf_version=i1,!z.project)z.project={};if(!z.stack)z.stack={};if(!z.human_context)z.human_context={};if(!z.monorepo)z.monorepo={};if($.dryRun){console.log(`${w("◆")} migrate ${N("(dry run)")} v${X} → v${i1}`),console.log(N(` would update ${Z}`));return}s(Z,z),console.log(`${w("◆")} migrate v${X} → v${i1}`),console.log(N(` updated ${Z}`))}p();function h7($){if($==="features")PB();else if($==="activate")_B();else RB()}function RB(){let $=c$();if(console.log(`${w("pro")} ${N("— FAF Pro status")}
328
+ `),console.log(` Status: ${$?E0(k("PRO")):k("Free")}`),console.log(""),!$)console.log(N(" Upgrade: faf pro activate"))}function PB(){console.log(`${w("pro")} ${N("— Pro features")}
329
+ `);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,z]of $)console.log(` ${w("◆")} ${k(Z)} ${N("—")} ${z}`);console.log("")}function _B(){console.log(`${w("pro")} ${N("— activate")}
330
+ `),console.log(" Set FAF_PRO=1 in your environment to enable Pro features."),console.log(""),console.log(N(" export FAF_PRO=1")),console.log(""),console.log(N(" Visit: https://faf.one/pro")),import("open").then(({default:$})=>$("https://faf.one/pro")).catch(()=>{})}import{gzipSync as EB}from"zlib";p();function v7($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
258
331
 
259
- Run 'faf init' to create one.`),process.exit(2);let X=d(Z),J=qB(Buffer.from(X)).toString("base64url");if($.raw){console.log(J);return}let Q=`https://faf.one/share?d=${J}`;if(console.log(`${I("◆")} share ${L(Z)}
260
- `),console.log(` ${Q}`),$.copy)try{let{execSync:Y}=L0("child_process"),q=process.platform;if(q==="darwin")Y("pbcopy",{input:Q});else if(q==="linux")Y("xclip -selection clipboard",{input:Q});console.log(L(`
261
- copied to clipboard`))}catch{console.log(L(`
262
- copy failed — install xclip or pbcopy`))}}import{mkdirSync as GB,writeFileSync as WB,rmSync as UB}from"fs";import{tmpdir as VB}from"os";import{join as SX}from"path";p();function bX(){let $=SX(VB(),`faf-demo-${Date.now()}`);GB($,{recursive:!0}),console.log(`${I("demo")} ${L("— FAF in action")}
332
+ Run 'faf init' to create one.`),process.exit(2);let z=u(Z),J=EB(Buffer.from(z)).toString("base64url");if($.raw){console.log(J);return}let Q=`https://faf.one/share?d=${J}`;if(console.log(`${w("◆")} share ${N(Z)}
333
+ `),console.log(` ${Q}`),$.copy)try{let{execSync:Y}=N0("child_process"),q=process.platform;if(q==="darwin")Y("pbcopy",{input:Q});else if(q==="linux")Y("xclip -selection clipboard",{input:Q});console.log(N(`
334
+ copied to clipboard`))}catch{console.log(N(`
335
+ copy failed — install xclip or pbcopy`))}}import{mkdirSync as CB,writeFileSync as jB,rmSync as SB}from"fs";import{tmpdir as bB}from"os";import{join as u7}from"path";p();function m7(){let $=u7(bB(),`faf-demo-${Date.now()}`);CB($,{recursive:!0}),console.log(`${w("demo")} ${N("— FAF in action")}
263
336
  `);let Z=`faf_version: 2.5.0
264
337
  project:
265
338
  name: acme-app
@@ -285,25 +358,25 @@ human_context:
285
358
  where: Cloud (Vercel + AWS)
286
359
  when: "2026"
287
360
  how: Agile sprints with CI/CD
288
- `,X=SX($,"project.faf");WB(X,Z),console.log(` ${k("1.")} Created sample project.faf`),console.log(L(` ${X}
289
- `)),console.log(` ${k("2.")} Scoring...`);let z=U0(G0(d(X)));console.log(""),Z0(z,"project.faf",!0),UB($,{recursive:!0,force:!0}),console.log(`
290
- ${L(' Demo complete. Run "faf init" in your project to get started.')}`)}p();function xX($,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=K0.filter((Y)=>Y.path.toLowerCase().includes(X)||Y.description.toLowerCase().includes(X)||Y.category.toLowerCase().includes(X));if(Q.length>0){console.log(`${I("slots")} ${L(`— ${Q.length} match${Q.length===1?"":"es"}`)}
291
- `);for(let Y of Q)console.log(` ${k(`#${Y.index}`)} ${Y.path} ${L("—")} ${Y.description} ${L(`[${Y.category}]`)}`);console.log(""),J+=Q.length}}if(z||Z.formats){let Q=d1.filter((Y)=>Y.name.toLowerCase().includes(X)||Y.extensions.some((q)=>q.toLowerCase().includes(X))||Y.category.toLowerCase().includes(X));if(Q.length>0){console.log(`${I("formats")} ${L(`— ${Q.length} match${Q.length===1?"":"es"}`)}
292
- `);for(let Y of Q)console.log(` ${k(Y.name)} ${L(Y.extensions.join(", "))} ${L(`[${Y.category}]`)}`);console.log(""),J+=Q.length}}if(J===0)console.log(L(` No results for "${$}"`))}import{writeFileSync as KB}from"fs";p();function yX($={}){let Z=u();if(!Z)console.error(`Error: project.faf not found
361
+ `,z=u7($,"project.faf");jB(z,Z),console.log(` ${k("1.")} Created sample project.faf`),console.log(N(` ${z}
362
+ `)),console.log(` ${k("2.")} Scoring...`);let X=V0(W0(u(z)));console.log(""),Z0(X,"project.faf",!0),SB($,{recursive:!0,force:!0}),console.log(`
363
+ ${N(' Demo complete. Run "faf init" in your project to get started.')}`)}p();function d7($,Z={}){if(!$)console.error("Usage: faf search <keyword>"),process.exit(2);let z=$.toLowerCase(),X=!Z.slots&&!Z.formats,J=0;if(X||Z.slots){let Q=G0.filter((Y)=>Y.path.toLowerCase().includes(z)||Y.description.toLowerCase().includes(z)||Y.category.toLowerCase().includes(z));if(Q.length>0){console.log(`${w("slots")} ${N(`— ${Q.length} match${Q.length===1?"":"es"}`)}
364
+ `);for(let Y of Q)console.log(` ${k(`#${Y.index}`)} ${Y.path} ${N("—")} ${Y.description} ${N(`[${Y.category}]`)}`);console.log(""),J+=Q.length}}if(X||Z.formats){let Q=p1.filter((Y)=>Y.name.toLowerCase().includes(z)||Y.extensions.some((q)=>q.toLowerCase().includes(z))||Y.category.toLowerCase().includes(z));if(Q.length>0){console.log(`${w("formats")} ${N(`— ${Q.length} match${Q.length===1?"":"es"}`)}
365
+ `);for(let Y of Q)console.log(` ${k(Y.name)} ${N(Y.extensions.join(", "))} ${N(`[${Y.category}]`)}`);console.log(""),J+=Q.length}}if(J===0)console.log(N(` No results for "${$}"`))}import{writeFileSync as xB}from"fs";p();function c7($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
293
366
 
294
- Run 'faf init' to create one.`),process.exit(2);let X=c(Z),z=d(Z),J=e0(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},Y=JSON.stringify(Q,null,2);if($.output)KB($.output,Y,"utf-8"),console.log(`${I("◆")} taf receipt written to ${$.output}`);else console.log(Y)}import{createInterface as HB}from"readline";import{existsSync as kX,readFileSync as BB,writeFileSync as NB,unlinkSync as LB}from"fs";import{join as TB}from"path";p();var MB=".faf-session.json";function OB($,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 fX($={}){let Z=u();if(!Z)console.error(`Error: project.faf not found
367
+ Run 'faf init' to create one.`),process.exit(2);let z=c(Z),X=u(Z),J=w0(X),Q={taf_version:"1.0.0",generated:new Date().toISOString(),source:Z,project:z.project?.name??"unknown",faf_version:z.faf_version??"unknown",score:J.score,tier:J.tier.name,populated:J.populated,active:J.active,total:J.total,slots:J.slots},Y=JSON.stringify(Q,null,2);if($.output)xB($.output,Y,"utf-8"),console.log(`${w("◆")} taf receipt written to ${$.output}`);else console.log(Y)}import{createInterface as yB}from"readline";import{existsSync as p7,readFileSync as kB,writeFileSync as fB,unlinkSync as gB}from"fs";import{join as hB}from"path";p();var vB=".faf-session.json";function uB($,Z){let z=Z.split("."),X=$;for(let J of z){if(X===null||X===void 0||typeof X!=="object")return;X=X[J]}return X}function mB($,Z,z){let X=Z.split("."),J=$;for(let Q=0;Q<X.length-1;Q++){if(!J[X[Q]]||typeof J[X[Q]]!=="object")J[X[Q]]={};J=J[X[Q]]}J[X[X.length-1]]=z}async function l7($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
295
368
 
296
- Run 'faf init' to create one.`),process.exit(2);let X=process.cwd(),z=TB(X,MB),J=0;if($.resume&&kX(z))try{J=JSON.parse(BB(z,"utf-8")).slotIndex,console.log(L(` resuming from slot #${J+1}`))}catch{}let Q=c(Z),Y=K0.filter((N)=>{let O=OB(Q,N.path);return $$(O)&&O!=="slotignored"});if(Y.length===0){console.log(`${I("◆")} go all slots populated — \uD83C\uDFC6 Trophy`);let N=U0(G0(d(Z)));Z0(N,Z);return}console.log(`${I("go")} ${L("— guided interview to \uD83C\uDFC6 Trophy")}`);let q=Y.length===1?"slot":"slots";console.log(L(` ${Y.length} ${q} from Trophy. Enter a value, "skip" to skip, or "quit" to stop.
297
- `));let G=HB({input:process.stdin,output:process.stdout}),W=(N)=>new Promise((O)=>G.question(N,O)),U=0,V=Y.slice(J);for(let N=0;N<V.length;N++){let O=V[N],B=await W(` ${k(`#${O.index}`)} ${O.description} ${L(`(${O.path})`)}: `);if(B.toLowerCase()==="quit"){let M={slotIndex:J+N,fafPath:Z};NB(z,JSON.stringify(M),"utf-8"),console.log(L(`
298
- session saved. Resume with: faf go --resume`));break}if(B.toLowerCase()==="skip"||B.trim()==="")continue;DB(Q,O.path,B.trim()),U++}if(G.close(),U>0)s(Z,Q),console.log(`
299
- ${I("◆")} go filled ${U} slot${U===1?"":"s"}`);let K=U0(G0(d(Z)));if(Z0(K,Z),kX(z))try{LB(z)}catch{}}p();var TN=[/^(tbd|see\s+readme|todo|fixme|coming\s+soon|n\/a|unknown|none|null|not\s+specified)\b/i,/^(software|application|app|project|tool|library|framework)\.?$/i,/^(for\s+(users|developers|teams|engineers))\.?$/i,/^(general\s+purpose|various|multiple|description|goal|name|title)\.?$/i];function MN($){if(typeof $!=="string")return!1;let Z=$.trim();if(Z.length<4||Z.length>280)return!1;return!TN.some((X)=>X.test(Z))}function ON($,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 DN($,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 f7($){if($==="analyze")await wN();else if($==="enhance")await AN();else console.log(`${I("ai")} ${L("— AI-powered features")}
300
- `),console.log(` ${k("faf ai enhance")} ${L("— fill empty slots via Claude")}`),console.log(` ${k("faf ai analyze")} ${L("— get improvement suggestions")}`),console.log(""),console.log(L(" Requires ANTHROPIC_API_KEY environment variable."))}async function g7(){let $=process.env.ANTHROPIC_API_KEY;if(!$)console.error(`Error: ANTHROPIC_API_KEY not set.
369
+ Run 'faf init' to create one.`),process.exit(2);let z=process.cwd(),X=hB(z,vB),J=0;if($.resume&&p7(X))try{J=JSON.parse(kB(X,"utf-8")).slotIndex,console.log(N(` resuming from slot #${J+1}`))}catch{}let Q=c(Z),Y=G0.filter((L)=>{let O=uB(Q,L.path);return $$(O)&&O!=="slotignored"});if(Y.length===0){console.log(`${w("◆")} go all slots populated — \uD83C\uDFC6 Trophy`);let L=V0(W0(u(Z)));Z0(L,Z);return}console.log(`${w("go")} ${N("— guided interview to \uD83C\uDFC6 Trophy")}`);let q=Y.length===1?"slot":"slots";console.log(N(` ${Y.length} ${q} from Trophy. Enter a value, "skip" to skip, or "quit" to stop.
370
+ `));let W=yB({input:process.stdin,output:process.stdout}),G=(L)=>new Promise((O)=>W.question(L,O)),U=0,V=Y.slice(J);for(let L=0;L<V.length;L++){let O=V[L],B=await G(` ${k(`#${O.index}`)} ${O.description} ${N(`(${O.path})`)}: `);if(B.toLowerCase()==="quit"){let M={slotIndex:J+L,fafPath:Z};fB(X,JSON.stringify(M),"utf-8"),console.log(N(`
371
+ session saved. Resume with: faf go --resume`));break}if(B.toLowerCase()==="skip"||B.trim()==="")continue;mB(Q,O.path,B.trim()),U++}if(W.close(),U>0)s(Z,Q),console.log(`
372
+ ${w("◆")} go filled ${U} slot${U===1?"":"s"}`);let K=V0(W0(u(Z)));if(Z0(K,Z),p7(X))try{gB(X)}catch{}}p();var hL=[/^(tbd|see\s+readme|todo|fixme|coming\s+soon|n\/a|unknown|none|null|not\s+specified)\b/i,/^(software|application|app|project|tool|library|framework)\.?$/i,/^(for\s+(users|developers|teams|engineers))\.?$/i,/^(general\s+purpose|various|multiple|description|goal|name|title)\.?$/i];function vL($){if(typeof $!=="string")return!1;let Z=$.trim();if(Z.length<4||Z.length>280)return!1;return!hL.some((z)=>z.test(Z))}function uL($,Z){let z=Z.split("."),X=$;for(let J of z){if(X===null||X===void 0||typeof X!=="object")return;X=X[J]}return X}function mL($,Z,z){let X=Z.split("."),J=$;for(let Q=0;Q<X.length-1;Q++){if(!J[X[Q]]||typeof J[X[Q]]!=="object")J[X[Q]]={};J=J[X[Q]]}J[X[X.length-1]]=z}async function lz($){if($==="analyze")await cL();else if($==="enhance")await dL();else console.log(`${w("ai")} ${N("— AI-powered features")}
373
+ `),console.log(` ${k("faf ai enhance")} ${N("— fill empty slots via Claude")}`),console.log(` ${k("faf ai analyze")} ${N("— get improvement suggestions")}`),console.log(""),console.log(N(" Requires ANTHROPIC_API_KEY environment variable."))}async function iz(){let $=process.env.ANTHROPIC_API_KEY;if(!$)console.error(`Error: ANTHROPIC_API_KEY not set.
301
374
 
302
- export ANTHROPIC_API_KEY=sk-...`),process.exit(2);try{let{default:Z}=await Promise.resolve().then(() => (k7(),y7));return new Z({apiKey:$})}catch{console.error(`Error: @anthropic-ai/sdk not installed.
375
+ export ANTHROPIC_API_KEY=sk-...`),process.exit(2);try{let{default:Z}=await Promise.resolve().then(() => (pz(),cz));return new Z({apiKey:$})}catch{console.error(`Error: @anthropic-ai/sdk not installed.
303
376
 
304
- npm install @anthropic-ai/sdk`),process.exit(2)}}async function AN(){let $=u();if(!$)console.error(`Error: project.faf not found
377
+ npm install @anthropic-ai/sdk`),process.exit(2)}}async function dL(){let $=v();if(!$)console.error(`Error: project.faf not found
305
378
 
306
- Run 'faf init' to create one.`),process.exit(2);let Z=c($),X=d($),z=K0.filter((G)=>{let W=ON(Z,G.path);return $$(W)&&W!=="slotignored"});if(z.length===0){console.log(`${I("◆")} ai enhance all slots populated`);return}console.log(`${I("ai")} enhance ${L(`extracting from ${z.length} empty slots...`)}`);let J=await g7(),Q=z.map((G)=>`- ${G.path}: ${G.description}`).join(`
379
+ Run 'faf init' to create one.`),process.exit(2);let Z=c($),z=u($),X=G0.filter((W)=>{let G=uL(Z,W.path);return $$(G)&&G!=="slotignored"});if(X.length===0){console.log(`${w("◆")} ai enhance all slots populated`);return}console.log(`${w("ai")} enhance ${N(`extracting from ${X.length} empty slots...`)}`);let J=await iz(),Q=X.map((W)=>`- ${W.path}: ${W.description}`).join(`
307
380
  `),Y=`You are extracting concrete content from a project's .faf file to fill empty slots. STRICT RULES:
308
381
 
309
382
  1. Return JSON mapping dot-paths to values OR null.
@@ -314,24 +387,24 @@ ${I("◆")} go filled ${U} slot${U===1?"":"s"}`);let K=U0(G0(d(Z)));if(Z0(K,Z),
314
387
 
315
388
  The .faf source:
316
389
 
317
- ${X}
390
+ ${z}
318
391
 
319
392
  Empty slots to fill (return null if no concrete evidence):
320
393
  ${Q}
321
394
 
322
- Respond with ONLY valid JSON, no markdown fences. Each value is either a short string (with concrete evidence) or null (leave empty).`,q=await J.messages.create({model:"claude-haiku-4-5-20251001",max_tokens:1024,messages:[{role:"user",content:Y}]});try{let G=q.content[0].text,W=JSON.parse(G),U=0,V=0;for(let K of z){let N=W[K.path];if(N===null||N===void 0)continue;if(MN(N))DN(Z,K.path,N),console.log(` ${I("●")} ${K.path} ${L("←")} ${N}`),U++;else console.log(` ${L("○")} ${K.path} ${L("— rejected as slop, left empty")}`),V++}if(U>0){s($,Z),console.log(`
323
- ${I("◆")} ai enhance filled ${U} slot${U===1?"":"s"}${V>0?` (${V} rejected)`:""}`);let K=U0(G0(d($)));Z0(K,$)}else if(V>0)console.log(`
324
- ${L("all extractions rejected as slop. Run")} ${k("'faf go'")} ${L("for interview-fill.")}`);else console.log(`
325
- ${L("no concrete evidence for empty slots. Run")} ${k("'faf go'")} ${L("for interview-fill.")}`)}catch{console.error("Error: Could not parse AI response.")}}async function wN(){let $=u();if(!$)console.error(`Error: project.faf not found
395
+ Respond with ONLY valid JSON, no markdown fences. Each value is either a short string (with concrete evidence) or null (leave empty).`,q=await J.messages.create({model:"claude-haiku-4-5-20251001",max_tokens:1024,messages:[{role:"user",content:Y}]});try{let W=q.content[0].text,G=JSON.parse(W),U=0,V=0;for(let K of X){let L=G[K.path];if(L===null||L===void 0)continue;if(vL(L))mL(Z,K.path,L),console.log(` ${w("●")} ${K.path} ${N("←")} ${L}`),U++;else console.log(` ${N("○")} ${K.path} ${N("— rejected as slop, left empty")}`),V++}if(U>0){s($,Z),console.log(`
396
+ ${w("◆")} ai enhance filled ${U} slot${U===1?"":"s"}${V>0?` (${V} rejected)`:""}`);let K=V0(W0(u($)));Z0(K,$)}else if(V>0)console.log(`
397
+ ${N("all extractions rejected as slop. Run")} ${k("'faf go'")} ${N("for interview-fill.")}`);else console.log(`
398
+ ${N("no concrete evidence for empty slots. Run")} ${k("'faf go'")} ${N("for interview-fill.")}`)}catch{console.error("Error: Could not parse AI response.")}}async function cL(){let $=v();if(!$)console.error(`Error: project.faf not found
326
399
 
327
- Run 'faf init' to create one.`),process.exit(2);let Z=d($);console.log(`${I("ai")} analyze ${L("getting suggestions...")}`);let z=await(await g7()).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.
400
+ Run 'faf init' to create one.`),process.exit(2);let Z=u($);console.log(`${w("ai")} analyze ${N("getting suggestions...")}`);let X=await(await iz()).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.
328
401
 
329
402
  ${Z}
330
403
 
331
- Be concise. One line per suggestion.`}]});console.log(""),console.log(z.content[0].text)}import{existsSync as a3,readFileSync as o3,readdirSync as IN}from"fs";import{join as h7}from"path";p();function v7($,Z){if($==="import")FN(Z);else if($==="export")RN();else console.log(`${I("conductor")} ${L("— conductor integration")}
332
- `),console.log(` ${k("faf conductor import <path>")} ${L("— import conductor config into .faf")}`),console.log(` ${k("faf conductor export")} ${L("— generate conductor config from .faf")}`)}function FN($){if(!$)console.error("Usage: faf conductor import <path>"),process.exit(2);if(!a3($))console.error(`Error: path not found: ${$}`),process.exit(2);let Z={faf_version:"2.5.0",project:{}};if(a3($)&&$.endsWith(".json")){let J=JSON.parse(o3($,"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(a3($)&&($.endsWith(".yml")||$.endsWith(".yaml"))){let J=v1(o3($,"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=IN($);for(let Q of J){let Y=h7($,Q);if(Q.endsWith(".json"))try{let q=JSON.parse(o3(Y,"utf-8"));if(q.name&&!Z.project.name)Z.project.name=q.name;if(q.description&&!Z.project.goal)Z.project.goal=q.description}catch{}}}catch{console.error(`Error: could not read directory: ${$}`),process.exit(2)}let X=process.cwd(),z=u(X);if(z){let J=c(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;s(z,J),console.log(`${I("◆")} conductor import merged into ${z}`)}else{let J=h7(X,"project.faf");s(J,Z),console.log(`${I("◆")} conductor import created ${J}`)}}function RN(){let $=u();if(!$)console.error(`Error: project.faf not found
404
+ Be concise. One line per suggestion.`}]});console.log(""),console.log(X.content[0].text)}import{existsSync as Z9,readFileSync as z9,readdirSync as pL}from"fs";import{join as nz}from"path";p();function rz($,Z){if($==="import")lL(Z);else if($==="export")iL();else console.log(`${w("conductor")} ${N("— conductor integration")}
405
+ `),console.log(` ${k("faf conductor import <path>")} ${N("— import conductor config into .faf")}`),console.log(` ${k("faf conductor export")} ${N("— generate conductor config from .faf")}`)}function lL($){if(!$)console.error("Usage: faf conductor import <path>"),process.exit(2);if(!Z9($))console.error(`Error: path not found: ${$}`),process.exit(2);let Z={faf_version:"2.5.0",project:{}};if(Z9($)&&$.endsWith(".json")){let J=JSON.parse(z9($,"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(Z9($)&&($.endsWith(".yml")||$.endsWith(".yaml"))){let J=u1(z9($,"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=pL($);for(let Q of J){let Y=nz($,Q);if(Q.endsWith(".json"))try{let q=JSON.parse(z9(Y,"utf-8"));if(q.name&&!Z.project.name)Z.project.name=q.name;if(q.description&&!Z.project.goal)Z.project.goal=q.description}catch{}}}catch{console.error(`Error: could not read directory: ${$}`),process.exit(2)}let z=process.cwd(),X=v(z);if(X){let J=c(X);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;s(X,J),console.log(`${w("◆")} conductor import merged into ${X}`)}else{let J=nz(z,"project.faf");s(J,Z),console.log(`${w("◆")} conductor import created ${J}`)}}function iL(){let $=v();if(!$)console.error(`Error: project.faf not found
333
406
 
334
- Run 'faf init' to create one.`),process.exit(2);let Z=c($),X={name:Z.project?.name??"",description:Z.project?.goal??"",language:Z.project?.main_language??"",stack:Z.stack??{}};console.log(JSON.stringify(X,null,2))}p();import{readdirSync as PN,readFileSync as EN,existsSync as _N}from"fs";import{join as CN}from"path";var jN=["BRAKE","ENGINE","AERO","PIT"],SN=/(?:^|[^A-Za-z])(BRAKE|ENGINE|AERO|PIT)(?:[^A-Za-z]|$)/i;function bN($){let Z=$.match(SN);if(!Z)return null;return Z[1].toUpperCase()}function xN($){let Z=$.toLowerCase();if(Z.endsWith(".test.ts")||Z.endsWith(".test.js")||Z.endsWith(".test.tsx")||Z.endsWith(".test.jsx")||Z.endsWith(".spec.ts")||Z.endsWith(".spec.js"))return{ok:!0,lang:"typescript"};if(Z.endsWith(".rs"))return{ok:!0,lang:"rust"};if(Z.endsWith("_test.go"))return{ok:!0,lang:"go"};if((Z.startsWith("test_")||Z.endsWith("_test.py"))&&Z.endsWith(".py"))return{ok:!0,lang:"python"};if(Z.endsWith(".zig"))return{ok:!0,lang:"zig"};return{ok:!1}}function yN($,Z){let X=[];switch(Z){case"typescript":{let z=/\b(describe|test|it)\s*\(\s*(['"`])((?:\\.|(?!\2).)*)\2/g,J=[],Q;while((Q=z.exec($))!==null)J.push({idx:Q.index,type:Q[1]==="describe"?"describe":"test",name:Q[3]});let Y=[],q=0,G=null,W=0;for(let U=0;U<$.length;U++){while(W<J.length&&J[W].idx===U){let K=J[W];if(K.type==="describe")G=K.name;else{let N=Y.map((B)=>B.name),O=N.length>0?`${N.join(" > ")} > ${K.name}`:K.name;X.push(O)}W++}let V=$[U];if(V==="{"){if(q++,G!==null)Y.push({name:G,openDepth:q}),G=null}else if(V==="}"){q--;while(Y.length>0&&q<Y[Y.length-1].openDepth)Y.pop()}}break}case"rust":{let z=/#\[test\]\s*(?:\r?\n)\s*(?:pub\s+)?fn\s+([a-zA-Z_][a-zA-Z_0-9]*)/g,J;while((J=z.exec($))!==null)X.push(J[1]);break}case"python":{let z=/^\s*def\s+(test_[a-zA-Z_0-9]+)\s*\(/gm,J;while((J=z.exec($))!==null)X.push(J[1]);break}case"zig":{let z=/\btest\s+"((?:\\.|[^"\\])+)"/g,J;while((J=z.exec($))!==null)X.push(J[1]);break}case"go":{let z=/\bfunc\s+(Test[A-Z][a-zA-Z_0-9]*)\s*\(/g,J;while((J=z.exec($))!==null)X.push(J[1]);break}}return X}var kN=new Set(["node_modules",".git","target","dist","build",".next",".nuxt","coverage"]);function u7($,Z=[]){let X;try{X=PN($,{withFileTypes:!0})}catch{return Z}for(let z of X){if(kN.has(z.name))continue;if(z.name.startsWith(".")&&z.name!==".")continue;let J=CN($,z.name);if(z.isDirectory())u7(J,Z);else if(z.isFile())Z.push(J)}return Z}function fN($){let Z=[];if(!_N($))return Z;let X=u7($);for(let z of X){let J=z.split("/").pop()??"",Q=xN(J);if(!Q.ok||!Q.lang)continue;let Y;try{Y=EN(z,"utf-8")}catch{continue}if(Q.lang==="rust"&&!/#\[test\]/.test(Y))continue;if(Q.lang==="zig"&&!/\btest\s+"/.test(Y))continue;let q=yN(Y,Q.lang),G=z.replace(`${$}/`,"");for(let W of q)Z.push({file:G,language:Q.lang,testName:W,tier:bN(W)})}return Z}function gN($){let Z={BRAKE:0,ENGINE:0,AERO:0,PIT:0},X={},z=0,J=[],Q=new Set;for(let Y of $)if(Q.add(Y.file),X[Y.language]=(X[Y.language]??0)+1,Y.tier)Z[Y.tier]++;else if(z++,J.length<5)J.push(`${Y.file}: ${Y.testName}`);return{totalTests:$.length,byTier:Z,untiered:z,untieredExamples:J,filesScanned:Q.size,byLanguage:X}}function hN($){if(console.log(`${I(k("faf wjttc"))} ${L("— vendor-neutral test audit")}`),console.log(""),console.log(` Files scanned: ${k(String($.filesScanned))}`),console.log(` Tests found: ${k(String($.totalTests))}`),console.log(""),$.totalTests===0){console.log(L(" no tests found"));return}console.log(L(" Tiers:"));for(let Z of jN){let X=$.byTier[Z],z=(X/$.totalTests*100).toFixed(0),J=Z==="BRAKE"?E0("●"):Z==="ENGINE"?I("●"):Z==="AERO"?L("●"):L("○");console.log(` ${J} ${Z.padEnd(7)} ${k(String(X).padStart(4))} ${L(`(${z}%)`)}`)}if($.untiered>0){let Z=($.untiered/$.totalTests*100).toFixed(0);console.log(` ${L("○")} ${"untiered".padEnd(7)} ${k(String($.untiered).padStart(4))} ${L(`(${Z}%)`)}`)}if($.untiered>0&&$.untieredExamples.length>0){console.log(""),console.log(L(` Untiered examples (first ${$.untieredExamples.length}):`));for(let Z of $.untieredExamples)console.log(` ${L("·")} ${Z}`)}if(Object.keys($.byLanguage).length>1){console.log(""),console.log(L(" Languages:"));for(let[Z,X]of Object.entries($.byLanguage))console.log(` ${L("·")} ${Z.padEnd(12)} ${k(String(X))}`)}if($.byTier.BRAKE===0&&$.totalTests>0)console.log(""),console.log(E0(" ⚠ no BRAKE-tier tests — no safety canaries"))}function m7($={}){let Z=$.path??"tests",X=fN(Z),z=gN(X);if($.json)console.log(JSON.stringify(z,null,2));else hN(z);if($.strict&&z.untiered>0)process.exit(1)}var{version:d7}=x8(),h=new O9;h.name("faf").description("Foundational AI-Context Format — project DNA for any AI").version(d7,"-v, --version");h.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(($)=>_8($));h.command("auto").description("Zero to 100% in one command").action(()=>tZ());h.command("go").description("Guided interview to gold code").option("--resume","Resume previous session").action(($)=>fX($));h.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)=>F4($,Z));h.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(($)=>S8($));h.command("compile [file]").description("Compile .faf to .fafb binary").option("--output <path>","Output path").action(($,Z)=>VX($,Z));h.command("decompile <file>").description("Decompile .fafb to JSON").option("--output <path>","Output path").action(($,Z)=>KX($,Z));h.command("git <url>").description("Instant .faf from any GitHub repo").action(($)=>MX($));h.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(($)=>m1($));h.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)=>b8($,Z));h.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(($)=>OX($));h.command("formats").description("Show supported formats").action(()=>DX());h.command("clear").description("Clear cached data").action(()=>AX());h.command("convert").description("Convert .faf to other formats").option("--json","Output as JSON").action(($)=>wX($));h.command("context").description("Generate context output").action(()=>IX());h.command("drift").description("Check context drift").action(()=>RX());h.command("edit <path> <value>").description("Edit .faf fields").action(($,Z)=>PX($,Z));h.command("recover").description("Recover .faf from context files").action(()=>EX());h.command("migrate").description("Migrate .faf to latest version").option("--dry-run","Preview changes without writing").action(($)=>_X($));h.command("pro [subcommand]").description("Pro features & licensing").action(($)=>CX($));h.command("share").description("Share .faf via URL").option("--copy","Copy to clipboard").option("--raw","Output encoded string only").action(($)=>jX($));h.command("demo").description("Demo walkthrough").action(()=>bX());h.command("search <query>").description("Search slots and formats").option("--slots","Search slots only").option("--formats","Search formats only").action(($,Z)=>xX($,Z));h.command("taf").description("Test Archive Format receipt").option("--output <path>","Write receipt to file").action(($)=>yX($));h.command("ai [subcommand]").description("AI-powered features (enhance|analyze)").action(($)=>f7($));h.command("conductor [subcommand] [path]").description("Conductor integration").action(($,Z)=>v7($,Z));h.command("wjttc").description("Audit test suite for WJTTC tier coverage (vendor-neutral)").option("--path <path>","Test directory (default: tests)").option("--strict","Exit non-zero if any tests are untiered").option("--json","Output as JSON for CI consumption").action(($)=>m7($));h.command("bi-sync",{hidden:!0}).action(()=>S8());h.command("status",{hidden:!0}).action(()=>F4(void 0,{status:!0}));h.command("agents",{hidden:!0}).action(()=>m1({agents:!0}));h.command("cursor",{hidden:!0}).action(()=>m1({cursor:!0}));h.command("gemini",{hidden:!0}).action(()=>m1({gemini:!0}));h.command("validate",{hidden:!0}).action(($)=>b8($));h.command("yolo",{hidden:!0}).action(()=>_8({yolo:!0}));if(process.argv.length<=2)(async()=>{let{bold:$,dim:Z,fafCyan:X}=await Promise.resolve().then(() => (p(),SZ)),z=process.cwd().replace(process.env.HOME??"","~"),J="\x1B[38;2;150;150;150m",Q="\x1B[48;2;150;150;150m",Y="\x1B[38;2;29;29;29m",q="\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[38;2;29;29;29m"}█${"\x1B[38;2;150;150;150m"}███████${"\x1B[0m"} ${X($("faf"))} ${Z(`v${d7}`)}`);let W="\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"} \x1B[48;2;150;150;150m${"\x1B[38;2;150;150;150m"}██${"\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[0m ${Z("Nelly Never Forgets")}`),console.log(`${W}▔▔▔▔▔▔▔▔▔▔▔▔${"\x1B[0m"}`),console.log(`${Z(" "+z)}`),console.log("");try{await F4(void 0,{status:!0})}catch{}console.log(""),console.log(` ${Z("Run")} ${X("faf --help")} ${Z("for commands")}`)})();else h.parse(process.argv);
407
+ Run 'faf init' to create one.`),process.exit(2);let Z=c($),z={name:Z.project?.name??"",description:Z.project?.goal??"",language:Z.project?.main_language??"",stack:Z.stack??{}};console.log(JSON.stringify(z,null,2))}p();import{readdirSync as nL,readFileSync as rL,existsSync as sL}from"fs";import{join as aL}from"path";var oL=["BRAKE","ENGINE","AERO","PIT"],tL=/(?:^|[^A-Za-z])(BRAKE|ENGINE|AERO|PIT)(?:[^A-Za-z]|$)/i;function eL($){let Z=$.match(tL);if(!Z)return null;return Z[1].toUpperCase()}function $N($){let Z=$.toLowerCase();if(Z.endsWith(".test.ts")||Z.endsWith(".test.js")||Z.endsWith(".test.tsx")||Z.endsWith(".test.jsx")||Z.endsWith(".spec.ts")||Z.endsWith(".spec.js"))return{ok:!0,lang:"typescript"};if(Z.endsWith(".rs"))return{ok:!0,lang:"rust"};if(Z.endsWith("_test.go"))return{ok:!0,lang:"go"};if((Z.startsWith("test_")||Z.endsWith("_test.py"))&&Z.endsWith(".py"))return{ok:!0,lang:"python"};if(Z.endsWith(".zig"))return{ok:!0,lang:"zig"};return{ok:!1}}function ZN($,Z){let z=[];switch(Z){case"typescript":{let X=/\b(describe|test|it)\s*\(\s*(['"`])((?:\\.|(?!\2).)*)\2/g,J=[],Q;while((Q=X.exec($))!==null)J.push({idx:Q.index,type:Q[1]==="describe"?"describe":"test",name:Q[3]});let Y=[],q=0,W=null,G=0;for(let U=0;U<$.length;U++){while(G<J.length&&J[G].idx===U){let K=J[G];if(K.type==="describe")W=K.name;else{let L=Y.map((B)=>B.name),O=L.length>0?`${L.join(" > ")} > ${K.name}`:K.name;z.push(O)}G++}let V=$[U];if(V==="{"){if(q++,W!==null)Y.push({name:W,openDepth:q}),W=null}else if(V==="}"){q--;while(Y.length>0&&q<Y[Y.length-1].openDepth)Y.pop()}}break}case"rust":{let X=/#\[test\]\s*(?:\r?\n)\s*(?:pub\s+)?fn\s+([a-zA-Z_][a-zA-Z_0-9]*)/g,J;while((J=X.exec($))!==null)z.push(J[1]);break}case"python":{let X=/^\s*def\s+(test_[a-zA-Z_0-9]+)\s*\(/gm,J;while((J=X.exec($))!==null)z.push(J[1]);break}case"zig":{let X=/\btest\s+"((?:\\.|[^"\\])+)"/g,J;while((J=X.exec($))!==null)z.push(J[1]);break}case"go":{let X=/\bfunc\s+(Test[A-Z][a-zA-Z_0-9]*)\s*\(/g,J;while((J=X.exec($))!==null)z.push(J[1]);break}}return z}var zN=new Set(["node_modules",".git","target","dist","build",".next",".nuxt","coverage"]);function sz($,Z=[]){let z;try{z=nL($,{withFileTypes:!0})}catch{return Z}for(let X of z){if(zN.has(X.name))continue;if(X.name.startsWith(".")&&X.name!==".")continue;let J=aL($,X.name);if(X.isDirectory())sz(J,Z);else if(X.isFile())Z.push(J)}return Z}function XN($){let Z=[];if(!sL($))return Z;let z=sz($);for(let X of z){let J=X.split("/").pop()??"",Q=$N(J);if(!Q.ok||!Q.lang)continue;let Y;try{Y=rL(X,"utf-8")}catch{continue}if(Q.lang==="rust"&&!/#\[test\]/.test(Y))continue;if(Q.lang==="zig"&&!/\btest\s+"/.test(Y))continue;let q=ZN(Y,Q.lang),W=X.replace(`${$}/`,"");for(let G of q)Z.push({file:W,language:Q.lang,testName:G,tier:eL(G)})}return Z}function JN($){let Z={BRAKE:0,ENGINE:0,AERO:0,PIT:0},z={},X=0,J=[],Q=new Set;for(let Y of $)if(Q.add(Y.file),z[Y.language]=(z[Y.language]??0)+1,Y.tier)Z[Y.tier]++;else if(X++,J.length<5)J.push(`${Y.file}: ${Y.testName}`);return{totalTests:$.length,byTier:Z,untiered:X,untieredExamples:J,filesScanned:Q.size,byLanguage:z}}function QN($){if(console.log(`${w(k("faf wjttc"))} ${N("— vendor-neutral test audit")}`),console.log(""),console.log(` Files scanned: ${k(String($.filesScanned))}`),console.log(` Tests found: ${k(String($.totalTests))}`),console.log(""),$.totalTests===0){console.log(N(" no tests found"));return}console.log(N(" Tiers:"));for(let Z of oL){let z=$.byTier[Z],X=(z/$.totalTests*100).toFixed(0),J=Z==="BRAKE"?E0("●"):Z==="ENGINE"?w("●"):Z==="AERO"?N("●"):N("○");console.log(` ${J} ${Z.padEnd(7)} ${k(String(z).padStart(4))} ${N(`(${X}%)`)}`)}if($.untiered>0){let Z=($.untiered/$.totalTests*100).toFixed(0);console.log(` ${N("○")} ${"untiered".padEnd(7)} ${k(String($.untiered).padStart(4))} ${N(`(${Z}%)`)}`)}if($.untiered>0&&$.untieredExamples.length>0){console.log(""),console.log(N(` Untiered examples (first ${$.untieredExamples.length}):`));for(let Z of $.untieredExamples)console.log(` ${N("·")} ${Z}`)}if(Object.keys($.byLanguage).length>1){console.log(""),console.log(N(" Languages:"));for(let[Z,z]of Object.entries($.byLanguage))console.log(` ${N("·")} ${Z.padEnd(12)} ${k(String(z))}`)}if($.byTier.BRAKE===0&&$.totalTests>0)console.log(""),console.log(E0(" ⚠ no BRAKE-tier tests — no safety canaries"))}function az($={}){let Z=$.path??"tests",z=XN(Z),X=JN(z);if($.json)console.log(JSON.stringify(X,null,2));else QN(X);if($.strict&&X.untiered>0)process.exit(1)}var{version:oz}=h8(),h=new F9;h.name("faf").description("Foundational AI-Context Format — project DNA for any AI").version(oz,"-v, --version");h.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(($)=>x8($));h.command("auto").description("Zero to 100% in one command").action(()=>X7());h.command("go").description("Guided interview to gold code").option("--resume","Resume previous session").action(($)=>l7($));h.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)=>_2($,Z));h.command("show").description("Render project.faf → project.html and open it").action(()=>R7());h.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(($)=>f8($));h.command("compile [file]").description("Compile .faf to .fafb binary").option("--output <path>","Output path").action(($,Z)=>N7($,Z));h.command("decompile <file>").description("Decompile .fafb to JSON").option("--output <path>","Output path").action(($,Z)=>T7($,Z));h.command("git <url>").description("Instant .faf from any GitHub repo").action(($)=>_7($));h.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("--html","Generate project.html (visual render of project.faf)").option("--all","Generate all formats").action(($)=>c1($));h.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)=>g8($,Z));h.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(($)=>E7($));h.command("formats").description("Show supported formats").action(()=>C7());h.command("clear").description("Clear cached data").action(()=>j7());h.command("convert").description("Convert .faf to other formats").option("--json","Output as JSON").action(($)=>S7($));h.command("context").description("Generate context output").action(()=>b7());h.command("drift").description("Check context drift").action(()=>y7());h.command("edit <path> <value>").description("Edit .faf fields").action(($,Z)=>k7($,Z));h.command("recover").description("Recover .faf from context files").action(()=>f7());h.command("migrate").description("Migrate .faf to latest version").option("--dry-run","Preview changes without writing").action(($)=>g7($));h.command("pro [subcommand]").description("Pro features & licensing").action(($)=>h7($));h.command("share").description("Share .faf via URL").option("--copy","Copy to clipboard").option("--raw","Output encoded string only").action(($)=>v7($));h.command("demo").description("Demo walkthrough").action(()=>m7());h.command("search <query>").description("Search slots and formats").option("--slots","Search slots only").option("--formats","Search formats only").action(($,Z)=>d7($,Z));h.command("taf").description("Test Archive Format receipt").option("--output <path>","Write receipt to file").action(($)=>c7($));h.command("ai [subcommand]").description("AI-powered features (enhance|analyze)").action(($)=>lz($));h.command("conductor [subcommand] [path]").description("Conductor integration").action(($,Z)=>rz($,Z));h.command("wjttc").description("Audit test suite for WJTTC tier coverage (vendor-neutral)").option("--path <path>","Test directory (default: tests)").option("--strict","Exit non-zero if any tests are untiered").option("--json","Output as JSON for CI consumption").action(($)=>az($));h.command("bi-sync",{hidden:!0}).action(()=>f8());h.command("status",{hidden:!0}).action(()=>_2(void 0,{status:!0}));h.command("agents",{hidden:!0}).action(()=>c1({agents:!0}));h.command("cursor",{hidden:!0}).action(()=>c1({cursor:!0}));h.command("gemini",{hidden:!0}).action(()=>c1({gemini:!0}));h.command("validate",{hidden:!0}).action(($)=>g8($));h.command("yolo",{hidden:!0}).action(()=>x8({yolo:!0}));if(process.argv.length<=2)(async()=>{let{bold:$,dim:Z,fafCyan:z}=await Promise.resolve().then(() => (p(),fZ)),X=process.cwd().replace(process.env.HOME??"","~"),J="\x1B[38;2;150;150;150m",Q="\x1B[48;2;150;150;150m",Y="\x1B[38;2;29;29;29m",q="\x1B[48;2;29;29;29m",W="\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[38;2;29;29;29m"}█${"\x1B[38;2;150;150;150m"}███████${"\x1B[0m"} ${z($("faf"))} ${Z(`v${oz}`)}`);let G="\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"} \x1B[48;2;150;150;150m${"\x1B[38;2;150;150;150m"}██${"\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[0m ${Z("Nelly Never Forgets")}`),console.log(`${G}▔▔▔▔▔▔▔▔▔▔▔▔${"\x1B[0m"}`),console.log(`${Z(" "+X)}`),console.log("");try{await _2(void 0,{status:!0})}catch{}console.log(""),console.log(` ${Z("Run")} ${z("faf --help")} ${Z("for commands")}`)})();else h.parse(process.argv);
335
408
 
336
- //# debugId=3C4B656B612869B264756E2164756E21
409
+ //# debugId=E4C450AFDB29F80764756E2164756E21
337
410
  //# sourceMappingURL=cli.js.map