faf-cli 6.3.3 → 6.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1,176 +1,176 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as k7}from"node:module";var R7=Object.create;var{getPrototypeOf:P7,defineProperty:a4,getOwnPropertyNames:E7}=Object;var C7=Object.prototype.hasOwnProperty;function _7($){return this[$]}var S7,j7,b7=($,X,Z)=>{var z=$!=null&&typeof $==="object";if(z){var J=X?S7??=new WeakMap:j7??=new WeakMap,Q=J.get($);if(Q)return Q}Z=$!=null?R7(P7($)):{};let Y=X||!$||!$.__esModule?a4(Z,"default",{value:$,enumerable:!0}):Z;for(let q of E7($))if(!C7.call(Y,q))a4(Y,q,{get:_7.bind($,q),enumerable:!0});if(z)J.set($,Y);return Y};var D=($,X)=>()=>(X||$((X={exports:{}}).exports,X),X.exports);var x7=($)=>$;function f7($,X){this[$]=x7.bind(null,X)}var c3=($,X)=>{for(var Z in X)a4($,Z,{get:X[Z],enumerable:!0,configurable:!0,set:f7.bind(X,Z)})};var C=($,X)=>()=>($&&(X=$($=0)),X);var B0=k7(import.meta.url);var G1=D((y7)=>{class o4 extends Error{constructor($,X,Z){super(Z);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=X,this.exitCode=$,this.nestedError=void 0}}class p3 extends o4{constructor($){super(1,"commander.invalidArgument",$);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}y7.CommanderError=o4;y7.InvalidArgumentError=p3});var C2=D((m7)=>{var{InvalidArgumentError:v7}=G1();class l3{constructor($,X){switch(this.description=X||"",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($,X){if(X===this.defaultValue||!Array.isArray(X))return[$];return X.push($),X}default($,X){return this.defaultValue=$,this.defaultValueDescription=X,this}argParser($){return this.parseArg=$,this}choices($){return this.argChoices=$.slice(),this.parseArg=(X,Z)=>{if(!this.argChoices.includes(X))throw new v7(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(X,Z);return X},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function u7($){let X=$.name()+($.variadic===!0?"...":"");return $.required?"<"+X+">":"["+X+"]"}m7.Argument=l3;m7.humanReadableArgName=u7});var t4=D((l7)=>{var{humanReadableArgName:p7}=C2();class i3{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 X=$.commands.filter((z)=>!z._hidden),Z=$._getHelpCommand();if(Z&&!Z._hidden)X.push(Z);if(this.sortSubcommands)X.sort((z,J)=>{return z.name().localeCompare(J.name())});return X}compareOptions($,X){let Z=(z)=>{return z.short?z.short.replace(/^-/,""):z.long.replace(/^--/,"")};return Z($).localeCompare(Z(X))}visibleOptions($){let X=$.options.filter((z)=>!z.hidden),Z=$._getHelpOption();if(Z&&!Z.hidden){let z=Z.short&&$._findOption(Z.short),J=Z.long&&$._findOption(Z.long);if(!z&&!J)X.push(Z);else if(Z.long&&!J)X.push($.createOption(Z.long,Z.description));else if(Z.short&&!z)X.push($.createOption(Z.short,Z.description))}if(this.sortOptions)X.sort(this.compareOptions);return X}visibleGlobalOptions($){if(!this.showGlobalOptions)return[];let X=[];for(let Z=$.parent;Z;Z=Z.parent){let z=Z.options.filter((J)=>!J.hidden);X.push(...z)}if(this.sortOptions)X.sort(this.compareOptions);return X}visibleArguments($){if($._argsDescription)$.registeredArguments.forEach((X)=>{X.description=X.description||$._argsDescription[X.name()]||""});if($.registeredArguments.find((X)=>X.description))return $.registeredArguments;return[]}subcommandTerm($){let X=$.registeredArguments.map((Z)=>p7(Z)).join(" ");return $._name+($._aliases[0]?"|"+$._aliases[0]:"")+($.options.length?" [options]":"")+(X?" "+X:"")}optionTerm($){return $.flags}argumentTerm($){return $.name()}longestSubcommandTermLength($,X){return X.visibleCommands($).reduce((Z,z)=>{return Math.max(Z,this.displayWidth(X.styleSubcommandTerm(X.subcommandTerm(z))))},0)}longestOptionTermLength($,X){return X.visibleOptions($).reduce((Z,z)=>{return Math.max(Z,this.displayWidth(X.styleOptionTerm(X.optionTerm(z))))},0)}longestGlobalOptionTermLength($,X){return X.visibleGlobalOptions($).reduce((Z,z)=>{return Math.max(Z,this.displayWidth(X.styleOptionTerm(X.optionTerm(z))))},0)}longestArgumentTermLength($,X){return X.visibleArguments($).reduce((Z,z)=>{return Math.max(Z,this.displayWidth(X.styleArgumentTerm(X.argumentTerm(z))))},0)}commandUsage($){let X=$._name;if($._aliases[0])X=X+"|"+$._aliases[0];let Z="";for(let z=$.parent;z;z=z.parent)Z=z.name()+" "+Z;return Z+X+" "+$.usage()}commandDescription($){return $.description()}subcommandDescription($){return $.summary()||$.description()}optionDescription($){let X=[];if($.argChoices)X.push(`choices: ${$.argChoices.map((Z)=>JSON.stringify(Z)).join(", ")}`);if($.defaultValue!==void 0){if($.required||$.optional||$.isBoolean()&&typeof $.defaultValue==="boolean")X.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`)}if($.presetArg!==void 0&&$.optional)X.push(`preset: ${JSON.stringify($.presetArg)}`);if($.envVar!==void 0)X.push(`env: ${$.envVar}`);if(X.length>0){let Z=`(${X.join(", ")})`;if($.description)return`${$.description} ${Z}`;return Z}return $.description}argumentDescription($){let X=[];if($.argChoices)X.push(`choices: ${$.argChoices.map((Z)=>JSON.stringify(Z)).join(", ")}`);if($.defaultValue!==void 0)X.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`);if(X.length>0){let Z=`(${X.join(", ")})`;if($.description)return`${$.description} ${Z}`;return Z}return $.description}formatItemList($,X,Z){if(X.length===0)return[];return[Z.styleTitle($),...X,""]}groupItems($,X,Z){let z=new Map;return $.forEach((J)=>{let Q=Z(J);if(!z.has(Q))z.set(Q,[])}),X.forEach((J)=>{let Q=Z(J);if(!z.has(Q))z.set(Q,[]);z.get(Q).push(J)}),z}formatHelp($,X){let Z=X.padWidth($,X),z=X.helpWidth??80;function J(U,K){return X.formatItem(U,Z,K,X)}let Q=[`${X.styleTitle("Usage:")} ${X.styleUsage(X.commandUsage($))}`,""],Y=X.commandDescription($);if(Y.length>0)Q=Q.concat([X.boxWrap(X.styleCommandDescription(Y),z),""]);let q=X.visibleArguments($).map((U)=>{return J(X.styleArgumentTerm(X.argumentTerm(U)),X.styleArgumentDescription(X.argumentDescription(U)))});if(Q=Q.concat(this.formatItemList("Arguments:",q,X)),this.groupItems($.options,X.visibleOptions($),(U)=>U.helpGroupHeading??"Options:").forEach((U,K)=>{let V=U.map((T)=>{return J(X.styleOptionTerm(X.optionTerm(T)),X.styleOptionDescription(X.optionDescription(T)))});Q=Q.concat(this.formatItemList(K,V,X))}),X.showGlobalOptions){let U=X.visibleGlobalOptions($).map((K)=>{return J(X.styleOptionTerm(X.optionTerm(K)),X.styleOptionDescription(X.optionDescription(K)))});Q=Q.concat(this.formatItemList("Global Options:",U,X))}return this.groupItems($.commands,X.visibleCommands($),(U)=>U.helpGroup()||"Commands:").forEach((U,K)=>{let V=U.map((T)=>{return J(X.styleSubcommandTerm(X.subcommandTerm(T)),X.styleSubcommandDescription(X.subcommandDescription(T)))});Q=Q.concat(this.formatItemList(K,V,X))}),Q.join(`
3
- `)}displayWidth($){return n3($).length}styleTitle($){return $}styleUsage($){return $.split(" ").map((X)=>{if(X==="[options]")return this.styleOptionText(X);if(X==="[command]")return this.styleSubcommandText(X);if(X[0]==="["||X[0]==="<")return this.styleArgumentText(X);return this.styleCommandText(X)}).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((X)=>{if(X==="[options]")return this.styleOptionText(X);if(X[0]==="["||X[0]==="<")return this.styleArgumentText(X);return this.styleSubcommandText(X)}).join(" ")}styleArgumentTerm($){return this.styleArgumentText($)}styleOptionText($){return $}styleArgumentText($){return $}styleSubcommandText($){return $}styleCommandText($){return $}padWidth($,X){return Math.max(X.longestOptionTermLength($,X),X.longestGlobalOptionTermLength($,X),X.longestSubcommandTermLength($,X),X.longestArgumentTermLength($,X))}preformatted($){return/\n[^\S\r\n]/.test($)}formatItem($,X,Z,z){let Q=" ".repeat(2);if(!Z)return Q+$;let Y=$.padEnd(X+$.length-z.displayWidth($)),q=2,G=(this.helpWidth??80)-X-q-2,U;if(G<this.minWidthToWrap||z.preformatted(Z))U=Z;else U=z.boxWrap(Z,G).replace(/\n/g,`
4
- `+" ".repeat(X+q));return Q+Y+" ".repeat(q)+U.replace(/\n/g,`
5
- ${Q}`)}boxWrap($,X){if(X<this.minWidthToWrap)return $;let Z=$.split(/\r\n|\n/),z=/[\s]*[^\s]+/g,J=[];return Z.forEach((Q)=>{let Y=Q.match(z);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<=X){q.push(G),W+=U;return}J.push(q.join(""));let K=G.trimStart();q=[K],W=this.displayWidth(K)}),J.push(q.join(""))}),J.join(`
6
- `)}}function n3($){let X=/\x1b\[\d*(;\d*)*m/g;return $.replace(X,"")}l7.Help=i3;l7.stripColor=n3});var e4=D((a7)=>{var{InvalidArgumentError:r7}=G1();class s3{constructor($,X){this.flags=$,this.description=X||"",this.required=$.includes("<"),this.optional=$.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test($),this.mandatory=!1;let Z=s7($);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($,X){return this.defaultValue=$,this.defaultValueDescription=X,this}preset($){return this.presetArg=$,this}conflicts($){return this.conflictsWith=this.conflictsWith.concat($),this}implies($){let X=$;if(typeof $==="string")X={[$]:!0};return this.implied=Object.assign(this.implied||{},X),this}env($){return this.envVar=$,this}argParser($){return this.parseArg=$,this}makeOptionMandatory($=!0){return this.mandatory=!!$,this}hideHelp($=!0){return this.hidden=!!$,this}_collectValue($,X){if(X===this.defaultValue||!Array.isArray(X))return[$];return X.push($),X}choices($){return this.argChoices=$.slice(),this.parseArg=(X,Z)=>{if(!this.argChoices.includes(X))throw new r7(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(X,Z);return X},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return r3(this.name().replace(/^no-/,""));return r3(this.name())}helpGroup($){return this.helpGroupHeading=$,this}is($){return this.short===$||this.long===$}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class a3{constructor($){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,$.forEach((X)=>{if(X.negate)this.negativeOptions.set(X.attributeName(),X);else this.positiveOptions.set(X.attributeName(),X)}),this.negativeOptions.forEach((X,Z)=>{if(this.positiveOptions.has(Z))this.dualOptions.add(Z)})}valueFromOption($,X){let Z=X.attributeName();if(!this.dualOptions.has(Z))return!0;let z=this.negativeOptions.get(Z).presetArg,J=z!==void 0?z:!1;return X.negate===(J===$)}}function r3($){return $.split("-").reduce((X,Z)=>{return X+Z[0].toUpperCase()+Z.slice(1)})}function s7($){let X,Z,z=/^-[^-]$/,J=/^--[^-]/,Q=$.split(/[ |,]+/).concat("guard");if(z.test(Q[0]))X=Q.shift();if(J.test(Q[0]))Z=Q.shift();if(!X&&z.test(Q[0]))X=Q.shift();if(!X&&J.test(Q[0]))X=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}
2
+ import{createRequire as y7}from"node:module";var P7=Object.create;var{getPrototypeOf:E7,defineProperty:a4,getOwnPropertyNames:C7}=Object;var _7=Object.prototype.hasOwnProperty;function S7($){return this[$]}var j7,b7,x7=($,Z,X)=>{var z=$!=null&&typeof $==="object";if(z){var J=Z?j7??=new WeakMap:b7??=new WeakMap,Q=J.get($);if(Q)return Q}X=$!=null?P7(E7($)):{};let Y=Z||!$||!$.__esModule?a4(X,"default",{value:$,enumerable:!0}):X;for(let q of C7($))if(!_7.call(Y,q))a4(Y,q,{get:S7.bind($,q),enumerable:!0});if(z)J.set($,Y);return Y};var D=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var f7=($)=>$;function k7($,Z){this[$]=f7.bind(null,Z)}var c3=($,Z)=>{for(var X in Z)a4($,X,{get:Z[X],enumerable:!0,configurable:!0,set:k7.bind(Z,X)})};var E=($,Z)=>()=>($&&(Z=$($=0)),Z);var B0=y7(import.meta.url);var G1=D((g7)=>{class o4 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 p3 extends o4{constructor($){super(1,"commander.invalidArgument",$);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}g7.CommanderError=o4;g7.InvalidArgumentError=p3});var C2=D((d7)=>{var{InvalidArgumentError:u7}=G1();class l3{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 u7(`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 m7($){let Z=$.name()+($.variadic===!0?"...":"");return $.required?"<"+Z+">":"["+Z+"]"}d7.Argument=l3;d7.humanReadableArgName=m7});var t4=D((i7)=>{var{humanReadableArgName:l7}=C2();class i3{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)=>l7(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,K){return Z.formatItem(U,X,K,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,K)=>{let V=U.map((T)=>{return J(Z.styleOptionTerm(Z.optionTerm(T)),Z.styleOptionDescription(Z.optionDescription(T)))});Q=Q.concat(this.formatItemList(K,V,Z))}),Z.showGlobalOptions){let U=Z.visibleGlobalOptions($).map((K)=>{return J(Z.styleOptionTerm(Z.optionTerm(K)),Z.styleOptionDescription(Z.optionDescription(K)))});Q=Q.concat(this.formatItemList("Global Options:",U,Z))}return this.groupItems($.commands,Z.visibleCommands($),(U)=>U.helpGroup()||"Commands:").forEach((U,K)=>{let V=U.map((T)=>{return J(Z.styleSubcommandTerm(Z.subcommandTerm(T)),Z.styleSubcommandDescription(Z.subcommandDescription(T)))});Q=Q.concat(this.formatItemList(K,V,Z))}),Q.join(`
3
+ `)}displayWidth($){return n3($).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,G=(this.helpWidth??80)-Z-q-2,U;if(G<this.minWidthToWrap||z.preformatted(X))U=X;else U=z.boxWrap(X,G).replace(/\n/g,`
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()],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 K=G.trimStart();q=[K],W=this.displayWidth(K)}),J.push(q.join(""))}),J.join(`
6
+ `)}}function n3($){let Z=/\x1b\[\d*(;\d*)*m/g;return $.replace(Z,"")}i7.Help=i3;i7.stripColor=n3});var e4=D((o7)=>{var{InvalidArgumentError:s7}=G1();class s3{constructor($,Z){this.flags=$,this.description=Z||"",this.required=$.includes("<"),this.optional=$.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test($),this.mandatory=!1;let X=a7($);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 s7(`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 r3(this.name().replace(/^no-/,""));return r3(this.name())}helpGroup($){return this.helpGroupHeading=$,this}is($){return this.short===$||this.long===$}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class a3{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 r3($){return $.split("-").reduce((Z,X)=>{return Z+X[0].toUpperCase()+X.slice(1)})}function a7($){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}
7
7
  - a short flag is a single dash and a single character
8
8
  - either use a single dash and a single character (for a short flag)
9
9
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(z.test(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(X===void 0&&Z===void 0)throw Error(`option creation failed due to no flags found in '${$}'.`);return{shortFlag:X,longFlag:Z}}a7.Option=s3;a7.DualOptions=a3});var o3=D((Xz)=>{function e7($,X){if(Math.abs($.length-X.length)>3)return Math.max($.length,X.length);let Z=[];for(let z=0;z<=$.length;z++)Z[z]=[z];for(let z=0;z<=X.length;z++)Z[0][z]=z;for(let z=1;z<=X.length;z++)for(let J=1;J<=$.length;J++){let Q=1;if($[J-1]===X[z-1])Q=0;else Q=1;if(Z[J][z]=Math.min(Z[J-1][z]+1,Z[J][z-1]+1,Z[J-1][z-1]+Q),J>1&&z>1&&$[J-1]===X[z-2]&&$[J-2]===X[z-1])Z[J][z]=Math.min(Z[J][z],Z[J-2][z-2]+1)}return Z[$.length][X.length]}function $z($,X){if(!X||X.length===0)return"";X=Array.from(new Set(X));let Z=$.startsWith("--");if(Z)$=$.slice(2),X=X.map((Y)=>Y.slice(2));let z=[],J=3,Q=0.4;if(X.forEach((Y)=>{if(Y.length<=1)return;let q=e7($,Y),W=Math.max($.length,Y.length);if((W-q)/W>Q){if(q<J)J=q,z=[Y];else if(q===J)z.push(Y)}}),z.sort((Y,q)=>Y.localeCompare(q)),Z)z=z.map((Y)=>`--${Y}`);if(z.length>1)return`
12
+ - unrecognised flag format`)}if(Z===void 0&&X===void 0)throw Error(`option creation failed due to no flags found in '${$}'.`);return{shortFlag:Z,longFlag:X}}o7.Option=s3;o7.DualOptions=a3});var o3=D((Xz)=>{function $z($,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 Zz($,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=$z($,Y),W=Math.max($.length,Y.length);if((W-q)/W>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
13
  (Did you mean one of ${z.join(", ")}?)`;if(z.length===1)return`
14
- (Did you mean ${z[0]}?)`;return""}Xz.suggestSimilar=$z});var X9=D((Gz)=>{var zz=B0("node:events").EventEmitter,$6=B0("node:child_process"),b0=B0("node:path"),_2=B0("node:fs"),u=B0("node:process"),{Argument:Jz,humanReadableArgName:Qz}=C2(),{CommanderError:X6}=G1(),{Help:Yz,stripColor:qz}=t4(),{Option:t3,DualOptions:Wz}=e4(),{suggestSimilar:e3}=o3();class z6 extends zz{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:(X)=>u.stdout.write(X),writeErr:(X)=>u.stderr.write(X),outputError:(X,Z)=>Z(X),getOutHelpWidth:()=>u.stdout.isTTY?u.stdout.columns:void 0,getErrHelpWidth:()=>u.stderr.isTTY?u.stderr.columns:void 0,getOutHasColors:()=>Z6()??(u.stdout.isTTY&&u.stdout.hasColors?.()),getErrHasColors:()=>Z6()??(u.stderr.isTTY&&u.stderr.hasColors?.()),stripColor:(X)=>qz(X)},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 X=this;X;X=X.parent)$.push(X);return $}command($,X,Z){let z=X,J=Z;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 z6($)}createHelp(){return Object.assign(new Yz,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($,X){if(!$._name)throw Error(`Command passed to .addCommand() must have a name
15
- - specify the name in Command constructor or using .name()`);if(X=X||{},X.isDefault)this._defaultCommandName=$._name;if(X.noHelp||X.hidden)$._hidden=!0;return this._registerCommand($),$.parent=this,$._checkForBrokenPassThrough(),this}createArgument($,X){return new Jz($,X)}argument($,X,Z,z){let J=this.createArgument($,X);if(typeof Z==="function")J.default(z).argParser(Z);else J.default(Z);return this.addArgument(J),this}arguments($){return $.trim().split(/ +/).forEach((X)=>{this.argument(X)}),this}addArgument($){let X=this.registeredArguments.slice(-1)[0];if(X?.variadic)throw Error(`only the last argument can be variadic '${X.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($,X){if(typeof $==="boolean"){if(this._addImplicitHelpCommand=$,$&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let Z=$??"help [command]",[,z,J]=Z.match(/([^ ]+) *(.*)/),Q=X??"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,$||X)this._initCommandGroup(Y);return this}addHelpCommand($,X){if(typeof $!=="object")return this.helpCommand($,X),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($,X){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(X);else this._lifeCycleHooks[$]=[X];return this}exitOverride($){if($)this._exitCallback=$;else this._exitCallback=(X)=>{if(X.code!=="commander.executeSubCommandAsync")throw X};return this}_exit($,X,Z){if(this._exitCallback)this._exitCallback(new X6($,X,Z));u.exit($)}action($){let X=(Z)=>{let z=this.registeredArguments.length,J=Z.slice(0,z);if(this._storeOptionsAsProperties)J[z]=this;else J[z]=this.opts();return J.push(this),$.apply(this,J)};return this._actionHandler=X,this}createOption($,X){return new t3($,X)}_callParseArg($,X,Z,z){try{return $.parseArg(X,Z)}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 X=$.short&&this._findOption($.short)||$.long&&this._findOption($.long);if(X){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 '${X.flags}'`)}this._initOptionGroup($),this.options.push($)}_registerCommand($){let X=(z)=>{return[z.name()].concat(z.aliases())},Z=X($).find((z)=>this._findCommand(z));if(Z){let z=X(this._findCommand(Z)).join("|"),J=X($).join("|");throw Error(`cannot add command '${J}' as already have command '${z}'`)}this._initCommandGroup($),this.commands.push($)}addOption($){this._registerOption($);let X=$.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 z=(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:"+X,(J)=>{let Q=`error: option '${$.flags}' argument '${J}' is invalid.`;z(J,Q,"cli")}),$.envVar)this.on("optionEnv:"+X,(J)=>{let Q=`error: option '${$.flags}' value '${J}' from env '${$.envVar}' is invalid.`;z(J,Q,"env")});return this}_optionEx($,X,Z,z,J){if(typeof X==="object"&&X instanceof t3)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let Q=this.createOption(X,Z);if(Q.makeOptionMandatory(!!$.mandatory),typeof z==="function")Q.default(J).argParser(z);else if(z instanceof RegExp){let Y=z;z=(q,W)=>{let G=Y.exec(q);return G?G[0]:W},Q.default(J).argParser(z)}else Q.default(z);return this.addOption(Q)}option($,X,Z,z){return this._optionEx({},$,X,Z,z)}requiredOption($,X,Z,z){return this._optionEx({mandatory:!0},$,X,Z,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($,X){return this.setOptionValueWithSource($,X,void 0)}setOptionValueWithSource($,X,Z){if(this._storeOptionsAsProperties)this[$]=X;else this._optionValues[$]=X;return this._optionValueSources[$]=Z,this}getOptionValueSource($){return this._optionValueSources[$]}getOptionValueSourceWithGlobals($){let X;return this._getCommandAndAncestors().forEach((Z)=>{if(Z.getOptionValueSource($)!==void 0)X=Z.getOptionValueSource($)}),X}_prepareUserArgs($,X){if($!==void 0&&!Array.isArray($))throw Error("first parameter to parse must be array or undefined");if(X=X||{},$===void 0&&X.from===void 0){if(u.versions?.electron)X.from="electron";let z=u.execArgv??[];if(z.includes("-e")||z.includes("--eval")||z.includes("-p")||z.includes("--print"))X.from="eval"}if($===void 0)$=u.argv;this.rawArgs=$.slice();let Z;switch(X.from){case void 0:case"node":this._scriptPath=$[1],Z=$.slice(2);break;case"electron":if(u.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: '${X.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",Z}parse($,X){this._prepareForParse();let Z=this._prepareUserArgs($,X);return this._parseCommand([],Z),this}async parseAsync($,X){this._prepareForParse();let Z=this._prepareUserArgs($,X);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($,X,Z){if(_2.existsSync($))return;let z=X?`searched for local subcommand relative to directory '${X}'`:"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
14
+ (Did you mean ${z[0]}?)`;return""}Xz.suggestSimilar=Zz});var Z9=D((Uz)=>{var Jz=B0("node:events").EventEmitter,$6=B0("node:child_process"),b0=B0("node:path"),_2=B0("node:fs"),u=B0("node:process"),{Argument:Qz,humanReadableArgName:Yz}=C2(),{CommanderError:Z6}=G1(),{Help:qz,stripColor:Wz}=t4(),{Option:t3,DualOptions:Gz}=e4(),{suggestSimilar:e3}=o3();class z6 extends Jz{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)=>u.stdout.write(Z),writeErr:(Z)=>u.stderr.write(Z),outputError:(Z,X)=>X(Z),getOutHelpWidth:()=>u.stdout.isTTY?u.stdout.columns:void 0,getErrHelpWidth:()=>u.stderr.isTTY?u.stderr.columns:void 0,getOutHasColors:()=>X6()??(u.stdout.isTTY&&u.stdout.hasColors?.()),getErrHasColors:()=>X6()??(u.stderr.isTTY&&u.stderr.hasColors?.()),stripColor:(Z)=>Wz(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 z6($)}createHelp(){return Object.assign(new qz,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 Qz($,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 Z6($,Z,X));u.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 t3($,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 t3)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,W)=>{let G=Y.exec(q);return G?G[0]:W},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(u.versions?.electron)Z.from="electron";let z=u.execArgv??[];if(z.includes("-e")||z.includes("--eval")||z.includes("-p")||z.includes("--print"))Z.from="eval"}if($===void 0)$=u.argv;this.rawArgs=$.slice();let X;switch(Z.from){case void 0:case"node":this._scriptPath=$[1],X=$.slice(2);break;case"electron":if(u.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(_2.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
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($,X){X=X.slice();let Z=!1,z=[".js",".ts",".tsx",".mjs",".cjs"];function J(G,U){let K=b0.resolve(G,U);if(_2.existsSync(K))return K;if(z.includes(b0.extname(U)))return;let V=z.find((T)=>_2.existsSync(`${K}${T}`));if(V)return`${K}${V}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Q=$._executableFile||`${this._name}-${$._name}`,Y=this._executableDir||"";if(this._scriptPath){let G;try{G=_2.realpathSync(this._scriptPath)}catch{G=this._scriptPath}Y=b0.resolve(b0.dirname(G),Y)}if(Y){let G=J(Y,Q);if(!G&&!$._executableFile&&this._scriptPath){let U=b0.basename(this._scriptPath,b0.extname(this._scriptPath));if(U!==this._name)G=J(Y,`${U}-${$._name}`)}Q=G||Q}Z=z.includes(b0.extname(Q));let q;if(u.platform!=="win32")if(Z)X.unshift(Q),X=$9(u.execArgv).concat(X),q=$6.spawn(u.argv[0],X,{stdio:"inherit"});else q=$6.spawn(Q,X,{stdio:"inherit"});else this._checkForMissingExecutable(Q,Y,$._name),X.unshift(Q),X=$9(u.execArgv).concat(X),q=$6.spawn(u.execPath,X,{stdio:"inherit"});if(!q.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((U)=>{u.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)u.exit(G);else W(new X6(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)u.exit(1);else{let U=new X6(1,"commander.executeSubCommandAsync","(error)");U.nestedError=G,W(U)}}),this.runningCommand=q}_dispatchSubcommand($,X,Z){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,X.concat(Z));else return z._parseCommand(X,Z)}),J}_dispatchHelpCommand($){if(!$)this.help();let X=this._findCommand($);if(X&&!X._executableHandler)X.help();return this._dispatchSubcommand($,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach(($,X)=>{if($.required&&this.args[X]==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,z,J)=>{let Q=z;if(z!==null&&Z.parseArg){let Y=`error: command-argument value '${z}' is invalid for argument '${Z.name()}'.`;Q=this._callParseArg(Z,z,J,Y)}return Q};this._checkNumberOfArguments();let X=[];this.registeredArguments.forEach((Z,z)=>{let J=Z.defaultValue;if(Z.variadic){if(z<this.args.length){if(J=this.args.slice(z),Z.parseArg)J=J.reduce((Q,Y)=>{return $(Z,Y,Q)},Z.defaultValue)}else if(J===void 0)J=[]}else if(z<this.args.length){if(J=this.args[z],Z.parseArg)J=$(Z,J,Z.defaultValue)}X[z]=J}),this.processedArgs=X}_chainOrCall($,X){if($?.then&&typeof $.then==="function")return $.then(()=>X());return X()}_chainOrCallHooks($,X){let Z=$,z=[];if(this._getCommandAndAncestors().reverse().filter((J)=>J._lifeCycleHooks[X]!==void 0).forEach((J)=>{J._lifeCycleHooks[X].forEach((Q)=>{z.push({hookedCommand:J,callback:Q})})}),X==="postAction")z.reverse();return z.forEach((J)=>{Z=this._chainOrCall(Z,()=>{return J.callback(J.hookedCommand,this)})}),Z}_chainOrCallSubCommandHook($,X,Z){let z=$;if(this._lifeCycleHooks[Z]!==void 0)this._lifeCycleHooks[Z].forEach((J)=>{z=this._chainOrCall(z,()=>{return J(this,X)})});return z}_parseCommand($,X){let Z=this.parseOptions(X);if(this._parseOptionsEnv(),this._parseOptionsImplied(),$=$.concat(Z.operands),X=Z.unknown,this.args=$.concat(X),$&&this._findCommand($[0]))return this._dispatchSubcommand($[0],$.slice(1),X);if(this._getHelpCommand()&&$[0]===this._getHelpCommand().name())return this._dispatchHelpCommand($[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(X),this._dispatchSubcommand(this._defaultCommandName,$,X);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 z=()=>{if(Z.unknown.length>0)this.unknownOption(Z.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,$,X)});return Q=this._chainOrCallHooks(Q,"postAction"),Q}if(this.parent?.listenerCount(J))z(),this._processArguments(),this.parent.emit(J,$,X);else if($.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",$,X);if(this.listenerCount("command:*"))this.emit("command:*",$,X);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((X)=>X._name===$||X._aliases.includes($))}_findOption($){return this.options.find((X)=>X.is($))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(($)=>{$.options.forEach((X)=>{if(X.mandatory&&$.getOptionValue(X.attributeName())===void 0)$.missingMandatoryOptionValue(X)})})}_checkForConflictingLocalOptions(){let $=this.options.filter((Z)=>{let z=Z.attributeName();if(this.getOptionValue(z)===void 0)return!1;return this.getOptionValueSource(z)!=="default"});$.filter((Z)=>Z.conflictsWith.length>0).forEach((Z)=>{let z=$.find((J)=>Z.conflictsWith.includes(J.attributeName()));if(z)this._conflictingOption(Z,z)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(($)=>{$._checkForConflictingLocalOptions()})}parseOptions($){let X=[],Z=[],z=X;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((K)=>K.short).some((K)=>/^-\d$/.test(K)))},Y=null,q=null,W=0;while(W<$.length||q){let G=q??$[W++];if(q=null,G==="--"){if(z===Z)z.push(G);z.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 K=$[W++];if(K===void 0)this.optionMissingArgument(U);this.emit(`option:${U.name()}`,K)}else if(U.optional){let K=null;if(W<$.length&&(!J($[W])||Q($[W])))K=$[W++];this.emit(`option:${U.name()}`,K)}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("="),K=this._findOption(G.slice(0,U));if(K&&(K.required||K.optional)){this.emit(`option:${K.name()}`,G.slice(U+1));continue}}if(z===X&&J(G)&&!(this.commands.length===0&&Q(G)))z=Z;if((this._enablePositionalOptions||this._passThroughOptions)&&X.length===0&&Z.length===0){if(this._findCommand(G)){X.push(G),Z.push(...$.slice(W));break}else if(this._getHelpCommand()&&G===this._getHelpCommand().name()){X.push(G,...$.slice(W));break}else if(this._defaultCommandName){Z.push(G,...$.slice(W));break}}if(this._passThroughOptions){z.push(G,...$.slice(W));break}z.push(G)}return{operands:X,unknown:Z}}opts(){if(this._storeOptionsAsProperties){let $={},X=this.options.length;for(let Z=0;Z<X;Z++){let z=this.options[Z].attributeName();$[z]=z===this._versionOptionName?this._version:this[z]}return $}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(($,X)=>Object.assign($,X.opts()),{})}error($,X){if(this._outputConfiguration.outputError(`${$}
21
+ - ${z}`;throw Error(J)}_executeSubCommand($,Z){Z=Z.slice();let X=!1,z=[".js",".ts",".tsx",".mjs",".cjs"];function J(G,U){let K=b0.resolve(G,U);if(_2.existsSync(K))return K;if(z.includes(b0.extname(U)))return;let V=z.find((T)=>_2.existsSync(`${K}${T}`));if(V)return`${K}${V}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Q=$._executableFile||`${this._name}-${$._name}`,Y=this._executableDir||"";if(this._scriptPath){let G;try{G=_2.realpathSync(this._scriptPath)}catch{G=this._scriptPath}Y=b0.resolve(b0.dirname(G),Y)}if(Y){let G=J(Y,Q);if(!G&&!$._executableFile&&this._scriptPath){let U=b0.basename(this._scriptPath,b0.extname(this._scriptPath));if(U!==this._name)G=J(Y,`${U}-${$._name}`)}Q=G||Q}X=z.includes(b0.extname(Q));let q;if(u.platform!=="win32")if(X)Z.unshift(Q),Z=$9(u.execArgv).concat(Z),q=$6.spawn(u.argv[0],Z,{stdio:"inherit"});else q=$6.spawn(Q,Z,{stdio:"inherit"});else this._checkForMissingExecutable(Q,Y,$._name),Z.unshift(Q),Z=$9(u.execArgv).concat(Z),q=$6.spawn(u.execPath,Z,{stdio:"inherit"});if(!q.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((U)=>{u.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)u.exit(G);else W(new Z6(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)u.exit(1);else{let U=new Z6(1,"commander.executeSubCommandAsync","(error)");U.nestedError=G,W(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(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((K)=>K.short).some((K)=>/^-\d$/.test(K)))},Y=null,q=null,W=0;while(W<$.length||q){let G=q??$[W++];if(q=null,G==="--"){if(z===X)z.push(G);z.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 K=$[W++];if(K===void 0)this.optionMissingArgument(U);this.emit(`option:${U.name()}`,K)}else if(U.optional){let K=null;if(W<$.length&&(!J($[W])||Q($[W])))K=$[W++];this.emit(`option:${U.name()}`,K)}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("="),K=this._findOption(G.slice(0,U));if(K&&(K.required||K.optional)){this.emit(`option:${K.name()}`,G.slice(U+1));continue}}if(z===Z&&J(G)&&!(this.commands.length===0&&Q(G)))z=X;if((this._enablePositionalOptions||this._passThroughOptions)&&Z.length===0&&X.length===0){if(this._findCommand(G)){Z.push(G),X.push(...$.slice(W));break}else if(this._getHelpCommand()&&G===this._getHelpCommand().name()){Z.push(G,...$.slice(W));break}else if(this._defaultCommandName){X.push(G,...$.slice(W));break}}if(this._passThroughOptions){z.push(G,...$.slice(W));break}z.push(G)}return{operands:Z,unknown:X}}opts(){if(this._storeOptionsAsProperties){let $={},Z=this.options.length;for(let X=0;X<Z;X++){let z=this.options[X].attributeName();$[z]=z===this._versionOptionName?this._version:this[z]}return $}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(($,Z)=>Object.assign($,Z.opts()),{})}error($,Z){if(this._outputConfiguration.outputError(`${$}
22
22
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
23
23
  `);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
24
- `),this.outputHelp({error:!0});let Z=X||{},z=Z.exitCode||1,J=Z.code||"commander.error";this._exit(z,J,$)}_parseOptionsEnv(){this.options.forEach(($)=>{if($.envVar&&$.envVar in u.env){let X=$.attributeName();if(this.getOptionValue(X)===void 0||["default","config","env"].includes(this.getOptionValueSource(X)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,u.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new Wz(this.options),X=(Z)=>{return this.getOptionValue(Z)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(Z))};this.options.filter((Z)=>Z.implied!==void 0&&X(Z.attributeName())&&$.valueFromOption(this.getOptionValue(Z.attributeName()),Z)).forEach((Z)=>{Object.keys(Z.implied).filter((z)=>!X(z)).forEach((z)=>{this.setOptionValueWithSource(z,Z.implied[z],"implied")})})}missingArgument($){let X=`error: missing required argument '${$}'`;this.error(X,{code:"commander.missingArgument"})}optionMissingArgument($){let X=`error: option '${$.flags}' argument missing`;this.error(X,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue($){let X=`error: required option '${$.flags}' not specified`;this.error(X,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption($,X){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},z=(Q)=>{let Y=Z(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(X)}`;this.error(J,{code:"commander.conflictingOption"})}unknownOption($){if(this._allowUnknownOption)return;let X="";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);X=e3($,z)}let Z=`error: unknown option '${$}'${X}`;this.error(Z,{code:"commander.unknownOption"})}_excessArguments($){if(this._allowExcessArguments)return;let X=this.registeredArguments.length,Z=X===1?"":"s",J=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${X} argument${Z} but got ${$.length}.`;this.error(J,{code:"commander.excessArguments"})}unknownCommand(){let $=this.args[0],X="";if(this._showSuggestionAfterError){let z=[];this.createHelp().visibleCommands(this).forEach((J)=>{if(z.push(J.name()),J.alias())z.push(J.alias())}),X=e3($,z)}let Z=`error: unknown command '${$}'${X}`;this.error(Z,{code:"commander.unknownCommand"})}version($,X,Z){if($===void 0)return this._version;this._version=$,X=X||"-V, --version",Z=Z||"output the version number";let z=this.createOption(X,Z);return this._versionOptionName=z.attributeName(),this._registerOption(z),this.on("option:"+z.name(),()=>{this._outputConfiguration.writeOut(`${$}
25
- `),this._exit(0,"commander.version",$)}),this}description($,X){if($===void 0&&X===void 0)return this._description;if(this._description=$,X)this._argsDescription=X;return this}summary($){if($===void 0)return this._summary;return this._summary=$,this}alias($){if($===void 0)return this._aliases[0];let X=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)X=this.commands[this.commands.length-1];if($===X._name)throw Error("Command alias can't be the same as its name");let Z=this.parent?._findCommand($);if(Z){let z=[Z.name()].concat(Z.aliases()).join("|");throw Error(`cannot add alias '${$}' to command '${this.name()}' as already have command '${z}'`)}return X._aliases.push($),this}aliases($){if($===void 0)return this._aliases;return $.forEach((X)=>this.alias(X)),this}usage($){if($===void 0){if(this._usage)return this._usage;let X=this.registeredArguments.map((Z)=>{return Qz(Z)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?X:[]).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=b0.basename($,b0.extname($)),this}executableDir($){if($===void 0)return this._executableDir;return this._executableDir=$,this}helpInformation($){let X=this.createHelp(),Z=this._getOutputContext($);X.prepareContext({error:Z.error,helpWidth:Z.helpWidth,outputHasColors:Z.hasColors});let z=X.formatHelp(this,X);if(Z.hasColors)return z;return this._outputConfiguration.stripColor(z)}_getOutputContext($){$=$||{};let X=!!$.error,Z,z,J;if(X)Z=(Y)=>this._outputConfiguration.writeErr(Y),z=this._outputConfiguration.getErrHasColors(),J=this._outputConfiguration.getErrHelpWidth();else Z=(Y)=>this._outputConfiguration.writeOut(Y),z=this._outputConfiguration.getOutHasColors(),J=this._outputConfiguration.getOutHelpWidth();return{error:X,write:(Y)=>{if(!z)Y=this._outputConfiguration.stripColor(Y);return Z(Y)},hasColors:z,helpWidth:J}}outputHelp($){let X;if(typeof $==="function")X=$,$=void 0;let Z=this._getOutputContext($),z={error:Z.error,write:Z.write,command:this};this._getCommandAndAncestors().reverse().forEach((Q)=>Q.emit("beforeAllHelp",z)),this.emit("beforeHelp",z);let J=this.helpInformation({error:Z.error});if(X){if(J=X(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",z),this._getCommandAndAncestors().forEach((Q)=>Q.emit("afterAllHelp",z))}helpOption($,X){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",X??"display help for command"),$||X)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 X=Number(u.exitCode??0);if(X===0&&$&&typeof $!=="function"&&$.error)X=1;this._exit(X,"commander.help","(outputHelp)")}addHelpText($,X){let Z=["beforeAll","before","after","afterAll"];if(!Z.includes($))throw Error(`Unexpected value for position to addHelpText.
26
- Expecting one of '${Z.join("', '")}'`);let z=`${$}Help`;return this.on(z,(J)=>{let Q;if(typeof X==="function")Q=X({error:J.error,command:J.command});else Q=X;if(Q)J.write(`${Q}
27
- `)}),this}_outputHelpIfRequested($){let X=this._getHelpOption();if(X&&$.find((z)=>X.is(z)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function $9($){return $.map((X)=>{if(!X.startsWith("--inspect"))return X;let Z,z="127.0.0.1",J="9229",Q;if((Q=X.match(/^(--inspect(-brk)?)$/))!==null)Z=Q[1];else if((Q=X.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(Z=Q[1],/^\d+$/.test(Q[3]))J=Q[3];else z=Q[3];else if((Q=X.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)Z=Q[1],z=Q[3],J=Q[4];if(Z&&J!=="0")return`${Z}=${z}:${parseInt(J)+1}`;return X})}function Z6(){if(u.env.NO_COLOR||u.env.FORCE_COLOR==="0"||u.env.FORCE_COLOR==="false")return!1;if(u.env.FORCE_COLOR||u.env.CLICOLOR_FORCE!==void 0)return!0;return}Gz.Command=z6;Gz.useColor=Z6});var Q9=D((Nz)=>{var{Argument:Z9}=C2(),{Command:J6}=X9(),{CommanderError:Kz,InvalidArgumentError:z9}=G1(),{Help:Hz}=t4(),{Option:J9}=e4();Nz.program=new J6;Nz.createCommand=($)=>new J6($);Nz.createOption=($,X)=>new J9($,X);Nz.createArgument=($,X)=>new Z9($,X);Nz.Command=J6;Nz.Option=J9;Nz.Argument=Z9;Nz.Help=Hz;Nz.CommanderError=Kz;Nz.InvalidArgumentError=z9;Nz.InvalidOptionArgumentError=z9});var h=D((xz)=>{var Q6=Symbol.for("yaml.alias"),W9=Symbol.for("yaml.document"),S2=Symbol.for("yaml.map"),G9=Symbol.for("yaml.pair"),Y6=Symbol.for("yaml.scalar"),j2=Symbol.for("yaml.seq"),x0=Symbol.for("yaml.node.type"),Pz=($)=>!!$&&typeof $==="object"&&$[x0]===Q6,Ez=($)=>!!$&&typeof $==="object"&&$[x0]===W9,Cz=($)=>!!$&&typeof $==="object"&&$[x0]===S2,_z=($)=>!!$&&typeof $==="object"&&$[x0]===G9,U9=($)=>!!$&&typeof $==="object"&&$[x0]===Y6,Sz=($)=>!!$&&typeof $==="object"&&$[x0]===j2;function V9($){if($&&typeof $==="object")switch($[x0]){case S2:case j2:return!0}return!1}function jz($){if($&&typeof $==="object")switch($[x0]){case Q6:case S2:case Y6:case j2:return!0}return!1}var bz=($)=>(U9($)||V9($))&&!!$.anchor;xz.ALIAS=Q6;xz.DOC=W9;xz.MAP=S2;xz.NODE_TYPE=x0;xz.PAIR=G9;xz.SCALAR=Y6;xz.SEQ=j2;xz.hasAnchor=bz;xz.isAlias=Pz;xz.isCollection=V9;xz.isDocument=Ez;xz.isMap=Cz;xz.isNode=jz;xz.isPair=_z;xz.isScalar=U9;xz.isSeq=Sz});var U1=D((az)=>{var Y0=h(),H0=Symbol("break visit"),K9=Symbol("skip children"),S0=Symbol("remove node");function b2($,X){let Z=H9(X);if(Y0.isDocument($)){if(I$(null,$.contents,Z,Object.freeze([$]))===S0)$.contents=null}else I$(null,$,Z,Object.freeze([]))}b2.BREAK=H0;b2.SKIP=K9;b2.REMOVE=S0;function I$($,X,Z,z){let J=N9($,X,Z,z);if(Y0.isNode(J)||Y0.isPair(J))return T9($,z,J),I$($,J,Z,z);if(typeof J!=="symbol"){if(Y0.isCollection(X)){z=Object.freeze(z.concat(X));for(let Q=0;Q<X.items.length;++Q){let Y=I$(Q,X.items[Q],Z,z);if(typeof Y==="number")Q=Y-1;else if(Y===H0)return H0;else if(Y===S0)X.items.splice(Q,1),Q-=1}}else if(Y0.isPair(X)){z=Object.freeze(z.concat(X));let Q=I$("key",X.key,Z,z);if(Q===H0)return H0;else if(Q===S0)X.key=null;let Y=I$("value",X.value,Z,z);if(Y===H0)return H0;else if(Y===S0)X.value=null}}return J}async function x2($,X){let Z=H9(X);if(Y0.isDocument($)){if(await R$(null,$.contents,Z,Object.freeze([$]))===S0)$.contents=null}else await R$(null,$,Z,Object.freeze([]))}x2.BREAK=H0;x2.SKIP=K9;x2.REMOVE=S0;async function R$($,X,Z,z){let J=await N9($,X,Z,z);if(Y0.isNode(J)||Y0.isPair(J))return T9($,z,J),R$($,J,Z,z);if(typeof J!=="symbol"){if(Y0.isCollection(X)){z=Object.freeze(z.concat(X));for(let Q=0;Q<X.items.length;++Q){let Y=await R$(Q,X.items[Q],Z,z);if(typeof Y==="number")Q=Y-1;else if(Y===H0)return H0;else if(Y===S0)X.items.splice(Q,1),Q-=1}}else if(Y0.isPair(X)){z=Object.freeze(z.concat(X));let Q=await R$("key",X.key,Z,z);if(Q===H0)return H0;else if(Q===S0)X.key=null;let Y=await R$("value",X.value,Z,z);if(Y===H0)return H0;else if(Y===S0)X.value=null}}return J}function H9($){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 N9($,X,Z,z){if(typeof Z==="function")return Z($,X,z);if(Y0.isMap(X))return Z.Map?.($,X,z);if(Y0.isSeq(X))return Z.Seq?.($,X,z);if(Y0.isPair(X))return Z.Pair?.($,X,z);if(Y0.isScalar(X))return Z.Scalar?.($,X,z);if(Y0.isAlias(X))return Z.Alias?.($,X,z);return}function T9($,X,Z){let z=X[X.length-1];if(Y0.isCollection(z))z.items[$]=Z;else if(Y0.isPair(z))if($==="key")z.key=Z;else z.value=Z;else if(Y0.isDocument(z))z.contents=Z;else{let J=Y0.isAlias(z)?"alias":"scalar";throw Error(`Cannot replace node with ${J} parent`)}}az.visit=b2;az.visitAsync=x2});var q6=D((ZJ)=>{var B9=h(),ez=U1(),$J={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},XJ=($)=>$.replace(/[!,[\]{}]/g,(X)=>$J[X]);class F0{constructor($,X){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},F0.defaultYaml,$),this.tags=Object.assign({},F0.defaultTags,X)}clone(){let $=new F0(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new F0(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:F0.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},F0.defaultTags);break}return $}add($,X){if(this.atNextDocument)this.yaml={explicit:F0.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},F0.defaultTags),this.atNextDocument=!1;let Z=$.trim().split(/[ \t]+/),z=Z.shift();switch(z){case"%TAG":{if(Z.length!==2){if(X(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 X(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 X(6,`Unsupported YAML version ${J}`,Q),!1}}default:return X(0,`Unknown directive ${z}`,!0),!1}}tagName($,X){if($==="!")return"!";if($[0]!=="!")return X(`Not a valid tag: ${$}`),null;if($[1]==="<"){let Q=$.slice(2,-1);if(Q==="!"||Q==="!!")return X(`Verbatim tags aren't resolved, so ${$} is invalid.`),null;if($[$.length-1]!==">")X("Verbatim tags must end with a >");return Q}let[,Z,z]=$.match(/^(.*!)([^!]*)$/s);if(!z)X(`The ${$} tag has no suffix`);let J=this.tags[Z];if(J)try{return J+decodeURIComponent(z)}catch(Q){return X(String(Q)),null}if(Z==="!")return $;return X(`Could not resolve tag: ${$}`),null}tagString($){for(let[X,Z]of Object.entries(this.tags))if($.startsWith(Z))return X+XJ($.substring(Z.length));return $[0]==="!"?$:`!<${$}>`}toString($){let X=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],Z=Object.entries(this.tags),z;if($&&Z.length>0&&B9.isNode($.contents)){let J={};ez.visit($.contents,(Q,Y)=>{if(B9.isNode(Y)&&Y.tag)J[Y.tag]=!0}),z=Object.keys(J)}else z=[];for(let[J,Q]of Z){if(J==="!!"&&Q==="tag:yaml.org,2002:")continue;if(!$||z.some((Y)=>Y.startsWith(Q)))X.push(`%TAG ${J} ${Q}`)}return X.join(`
28
- `)}}F0.defaultYaml={explicit:!1,version:"1.2"};F0.defaultTags={"!!":"tag:yaml.org,2002:"};ZJ.Directives=F0});var f2=D((qJ)=>{var L9=h(),JJ=U1();function QJ($){if(/[\x00-\x19\s,[\]{}]/.test($)){let Z=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(Z)}return!0}function M9($){let X=new Set;return JJ.visit($,{Value(Z,z){if(z.anchor)X.add(z.anchor)}}),X}function O9($,X){for(let Z=1;;++Z){let z=`${$}${Z}`;if(!X.has(z))return z}}function YJ($,X){let Z=[],z=new Map,J=null;return{onAnchor:(Q)=>{Z.push(Q),J??(J=M9($));let Y=O9(X,J);return J.add(Y),Y},setAnchors:()=>{for(let Q of Z){let Y=z.get(Q);if(typeof Y==="object"&&Y.anchor&&(L9.isScalar(Y.node)||L9.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}}qJ.anchorIsValid=QJ;qJ.anchorNames=M9;qJ.createNodeAnchors=YJ;qJ.findNewAnchor=O9});var W6=D((KJ)=>{function V1($,X,Z,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=V1($,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=V1($,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=V1($,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=V1($,z,J,Q);if(Y===void 0)delete z[J];else if(Y!==Q)z[J]=Y}return $.call(X,Z,z)}KJ.applyReviver=V1});var d0=D((TJ)=>{var NJ=h();function w9($,X,Z){if(Array.isArray($))return $.map((z,J)=>w9(z,String(J),Z));if($&&typeof $.toJSON==="function"){if(!Z||!NJ.hasAnchor($))return $.toJSON(X,Z);let z={aliasCount:0,count:1,res:void 0};Z.anchors.set($,z),Z.onCreate=(Q)=>{z.res=Q,delete Z.onCreate};let J=$.toJSON(X,Z);if(Z.onCreate)Z.onCreate(J);return J}if(typeof $==="bigint"&&!Z?.keep)return Number($);return $}TJ.toJS=w9});var k2=D((OJ)=>{var LJ=W6(),D9=h(),MJ=d0();class A9{constructor($){Object.defineProperty(this,D9.NODE_TYPE,{value:$})}clone(){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)$.range=this.range.slice();return $}toJS($,{mapAsMap:X,maxAliasCount:Z,onAnchor:z,reviver:J}={}){if(!D9.isDocument($))throw TypeError("A document argument is required");let Q={anchors:new Map,doc:$,keep:!0,mapAsMap:X===!0,mapKeyWarned:!1,maxAliasCount:typeof Z==="number"?Z:100},Y=MJ.toJS(this,"",Q);if(typeof z==="function")for(let{count:q,res:W}of Q.anchors.values())z(W,q);return typeof J==="function"?LJ.applyReviver(J,{"":Y},"",Y):Y}}OJ.NodeBase=A9});var K1=D((RJ)=>{var DJ=f2(),AJ=U1(),P$=h(),FJ=k2(),IJ=d0();class F9 extends FJ.NodeBase{constructor($){super(P$.ALIAS);this.source=$,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve($,X){let Z;if(X?.aliasResolveCache)Z=X.aliasResolveCache;else if(Z=[],AJ.visit($,{Node:(J,Q)=>{if(P$.isAlias(Q)||P$.hasAnchor(Q))Z.push(Q)}}),X)X.aliasResolveCache=Z;let z=void 0;for(let J of Z){if(J===this)break;if(J.anchor===this.source)z=J}return z}toJSON($,X){if(!X)return{source:this.source};let{anchors:Z,doc:z,maxAliasCount:J}=X,Q=this.resolve(z,X);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)IJ.toJS(Q,null,X),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=y2(z,Q,Z);if(Y.count*Y.aliasCount>J)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return Y.res}toString($,X,Z){let z=`*${this.source}`;if($){if(DJ.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 y2($,X,Z){if(P$.isAlias(X)){let z=X.resolve($),J=Z&&z&&Z.get(z);return J?J.count*J.aliasCount:0}else if(P$.isCollection(X)){let z=0;for(let J of X.items){let Q=y2($,J,Z);if(Q>z)z=Q}return z}else if(P$.isPair(X)){let z=y2($,X.key,Z),J=y2($,X.value,Z);return Math.max(z,J)}return 1}RJ.Alias=F9});var Z0=D((jJ)=>{var EJ=h(),CJ=k2(),_J=d0(),SJ=($)=>!$||typeof $!=="function"&&typeof $!=="object";class q$ extends CJ.NodeBase{constructor($){super(EJ.SCALAR);this.value=$}toJSON($,X){return X?.keep?this.value:_J.toJS(this.value,$,X)}toString(){return String(this.value)}}q$.BLOCK_FOLDED="BLOCK_FOLDED";q$.BLOCK_LITERAL="BLOCK_LITERAL";q$.PLAIN="PLAIN";q$.QUOTE_DOUBLE="QUOTE_DOUBLE";q$.QUOTE_SINGLE="QUOTE_SINGLE";jJ.Scalar=q$;jJ.isScalarValue=SJ});var H1=D((hJ)=>{var fJ=K1(),W$=h(),I9=Z0(),kJ="tag:yaml.org,2002:";function yJ($,X,Z){if(X){let z=Z.filter((Q)=>Q.tag===X),J=z.find((Q)=>!Q.format)??z[0];if(!J)throw Error(`Tag ${X} not found`);return J}return Z.find((z)=>z.identify?.($)&&!z.format)}function gJ($,X,Z){if(W$.isDocument($))$=$.contents;if(W$.isNode($))return $;if(W$.isPair($)){let K=Z.schema[W$.MAP].createNode?.(Z.schema,null,Z);return K.items.push($),K}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:z,onAnchor:J,onTagObj:Q,schema:Y,sourceObjects:q}=Z,W=void 0;if(z&&$&&typeof $==="object")if(W=q.get($),W)return W.anchor??(W.anchor=J($)),new fJ.Alias(W.anchor);else W={anchor:null,node:null},q.set($,W);if(X?.startsWith("!!"))X=kJ+X.slice(2);let G=yJ($,X,Y.tags);if(!G){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let K=new I9.Scalar($);if(W)W.node=K;return K}G=$ instanceof Map?Y[W$.MAP]:(Symbol.iterator in Object($))?Y[W$.SEQ]:Y[W$.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 I9.Scalar($);if(X)U.tag=X;else if(!G.default)U.tag=G.tag;if(W)W.node=U;return U}hJ.createNode=gJ});var g2=D((dJ)=>{var uJ=H1(),j0=h(),mJ=k2();function G6($,X,Z){let z=Z;for(let J=X.length-1;J>=0;--J){let Q=X[J];if(typeof Q==="number"&&Number.isInteger(Q)&&Q>=0){let Y=[];Y[Q]=z,z=Y}else z=new Map([[Q,z]])}return uJ.createNode(z,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var R9=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class P9 extends mJ.NodeBase{constructor($,X){super($);Object.defineProperty(this,"schema",{value:X,configurable:!0,enumerable:!1,writable:!0})}clone($){let X=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if($)X.schema=$;if(X.items=X.items.map((Z)=>j0.isNode(Z)||j0.isPair(Z)?Z.clone($):Z),this.range)X.range=this.range.slice();return X}addIn($,X){if(R9($))this.add(X);else{let[Z,...z]=$,J=this.get(Z,!0);if(j0.isCollection(J))J.addIn(z,X);else if(J===void 0&&this.schema)this.set(Z,G6(this.schema,z,X));else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${z}`)}}deleteIn($){let[X,...Z]=$;if(Z.length===0)return this.delete(X);let z=this.get(X,!0);if(j0.isCollection(z))return z.deleteIn(Z);else throw Error(`Expected YAML collection at ${X}. Remaining path: ${Z}`)}getIn($,X){let[Z,...z]=$,J=this.get(Z,!0);if(z.length===0)return!X&&j0.isScalar(J)?J.value:J;else return j0.isCollection(J)?J.getIn(z,X):void 0}hasAllNullValues($){return this.items.every((X)=>{if(!j0.isPair(X))return!1;let Z=X.value;return Z==null||$&&j0.isScalar(Z)&&Z.value==null&&!Z.commentBefore&&!Z.comment&&!Z.tag})}hasIn($){let[X,...Z]=$;if(Z.length===0)return this.has(X);let z=this.get(X,!0);return j0.isCollection(z)?z.hasIn(Z):!1}setIn($,X){let[Z,...z]=$;if(z.length===0)this.set(Z,X);else{let J=this.get(Z,!0);if(j0.isCollection(J))J.setIn(z,X);else if(J===void 0&&this.schema)this.set(Z,G6(this.schema,z,X));else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${z}`)}}}dJ.Collection=P9;dJ.collectionFromPath=G6;dJ.isEmptyPath=R9});var N1=D((rJ)=>{var iJ=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function U6($,X){if(/^\n+$/.test($))return $.substring(1);return X?$.replace(/^(?! *$)/gm,X):$}var nJ=($,X,Z)=>$.endsWith(`
29
- `)?U6(Z,X):Z.includes(`
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 u.env){let Z=$.attributeName();if(this.getOptionValue(Z)===void 0||["default","config","env"].includes(this.getOptionValueSource(Z)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,u.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new Gz(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),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},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=e3($,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=e3($,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 Yz(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=b0.basename($,b0.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(u.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 $9($){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 X6(){if(u.env.NO_COLOR||u.env.FORCE_COLOR==="0"||u.env.FORCE_COLOR==="false")return!1;if(u.env.FORCE_COLOR||u.env.CLICOLOR_FORCE!==void 0)return!0;return}Uz.Command=z6;Uz.useColor=X6});var Q9=D((Tz)=>{var{Argument:X9}=C2(),{Command:J6}=Z9(),{CommanderError:Hz,InvalidArgumentError:z9}=G1(),{Help:Nz}=t4(),{Option:J9}=e4();Tz.program=new J6;Tz.createCommand=($)=>new J6($);Tz.createOption=($,Z)=>new J9($,Z);Tz.createArgument=($,Z)=>new X9($,Z);Tz.Command=J6;Tz.Option=J9;Tz.Argument=X9;Tz.Help=Nz;Tz.CommanderError=Hz;Tz.InvalidArgumentError=z9;Tz.InvalidOptionArgumentError=z9});var h=D((fz)=>{var Q6=Symbol.for("yaml.alias"),W9=Symbol.for("yaml.document"),S2=Symbol.for("yaml.map"),G9=Symbol.for("yaml.pair"),Y6=Symbol.for("yaml.scalar"),j2=Symbol.for("yaml.seq"),x0=Symbol.for("yaml.node.type"),Ez=($)=>!!$&&typeof $==="object"&&$[x0]===Q6,Cz=($)=>!!$&&typeof $==="object"&&$[x0]===W9,_z=($)=>!!$&&typeof $==="object"&&$[x0]===S2,Sz=($)=>!!$&&typeof $==="object"&&$[x0]===G9,U9=($)=>!!$&&typeof $==="object"&&$[x0]===Y6,jz=($)=>!!$&&typeof $==="object"&&$[x0]===j2;function V9($){if($&&typeof $==="object")switch($[x0]){case S2:case j2:return!0}return!1}function bz($){if($&&typeof $==="object")switch($[x0]){case Q6:case S2:case Y6:case j2:return!0}return!1}var xz=($)=>(U9($)||V9($))&&!!$.anchor;fz.ALIAS=Q6;fz.DOC=W9;fz.MAP=S2;fz.NODE_TYPE=x0;fz.PAIR=G9;fz.SCALAR=Y6;fz.SEQ=j2;fz.hasAnchor=xz;fz.isAlias=Ez;fz.isCollection=V9;fz.isDocument=Cz;fz.isMap=_z;fz.isNode=bz;fz.isPair=Sz;fz.isScalar=U9;fz.isSeq=jz});var U1=D((oz)=>{var Y0=h(),H0=Symbol("break visit"),K9=Symbol("skip children"),S0=Symbol("remove node");function b2($,Z){let X=H9(Z);if(Y0.isDocument($)){if(I$(null,$.contents,X,Object.freeze([$]))===S0)$.contents=null}else I$(null,$,X,Object.freeze([]))}b2.BREAK=H0;b2.SKIP=K9;b2.REMOVE=S0;function I$($,Z,X,z){let J=N9($,Z,X,z);if(Y0.isNode(J)||Y0.isPair(J))return T9($,z,J),I$($,J,X,z);if(typeof J!=="symbol"){if(Y0.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let Q=0;Q<Z.items.length;++Q){let Y=I$(Q,Z.items[Q],X,z);if(typeof Y==="number")Q=Y-1;else if(Y===H0)return H0;else if(Y===S0)Z.items.splice(Q,1),Q-=1}}else if(Y0.isPair(Z)){z=Object.freeze(z.concat(Z));let Q=I$("key",Z.key,X,z);if(Q===H0)return H0;else if(Q===S0)Z.key=null;let Y=I$("value",Z.value,X,z);if(Y===H0)return H0;else if(Y===S0)Z.value=null}}return J}async function x2($,Z){let X=H9(Z);if(Y0.isDocument($)){if(await R$(null,$.contents,X,Object.freeze([$]))===S0)$.contents=null}else await R$(null,$,X,Object.freeze([]))}x2.BREAK=H0;x2.SKIP=K9;x2.REMOVE=S0;async function R$($,Z,X,z){let J=await N9($,Z,X,z);if(Y0.isNode(J)||Y0.isPair(J))return T9($,z,J),R$($,J,X,z);if(typeof J!=="symbol"){if(Y0.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let Q=0;Q<Z.items.length;++Q){let Y=await R$(Q,Z.items[Q],X,z);if(typeof Y==="number")Q=Y-1;else if(Y===H0)return H0;else if(Y===S0)Z.items.splice(Q,1),Q-=1}}else if(Y0.isPair(Z)){z=Object.freeze(z.concat(Z));let Q=await R$("key",Z.key,X,z);if(Q===H0)return H0;else if(Q===S0)Z.key=null;let Y=await R$("value",Z.value,X,z);if(Y===H0)return H0;else if(Y===S0)Z.value=null}}return J}function H9($){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 N9($,Z,X,z){if(typeof X==="function")return X($,Z,z);if(Y0.isMap(Z))return X.Map?.($,Z,z);if(Y0.isSeq(Z))return X.Seq?.($,Z,z);if(Y0.isPair(Z))return X.Pair?.($,Z,z);if(Y0.isScalar(Z))return X.Scalar?.($,Z,z);if(Y0.isAlias(Z))return X.Alias?.($,Z,z);return}function T9($,Z,X){let z=Z[Z.length-1];if(Y0.isCollection(z))z.items[$]=X;else if(Y0.isPair(z))if($==="key")z.key=X;else z.value=X;else if(Y0.isDocument(z))z.contents=X;else{let J=Y0.isAlias(z)?"alias":"scalar";throw Error(`Cannot replace node with ${J} parent`)}}oz.visit=b2;oz.visitAsync=x2});var q6=D((zJ)=>{var B9=h(),$J=U1(),ZJ={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},XJ=($)=>$.replace(/[!,[\]{}]/g,(Z)=>ZJ[Z]);class F0{constructor($,Z){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},F0.defaultYaml,$),this.tags=Object.assign({},F0.defaultTags,Z)}clone(){let $=new F0(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new F0(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:F0.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},F0.defaultTags);break}return $}add($,Z){if(this.atNextDocument)this.yaml={explicit:F0.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},F0.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+XJ($.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&&B9.isNode($.contents)){let J={};$J.visit($.contents,(Q,Y)=>{if(B9.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
+ `)}}F0.defaultYaml={explicit:!1,version:"1.2"};F0.defaultTags={"!!":"tag:yaml.org,2002:"};zJ.Directives=F0});var f2=D((WJ)=>{var L9=h(),QJ=U1();function YJ($){if(/[\x00-\x19\s,[\]{}]/.test($)){let X=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(X)}return!0}function M9($){let Z=new Set;return QJ.visit($,{Value(X,z){if(z.anchor)Z.add(z.anchor)}}),Z}function O9($,Z){for(let X=1;;++X){let z=`${$}${X}`;if(!Z.has(z))return z}}function qJ($,Z){let X=[],z=new Map,J=null;return{onAnchor:(Q)=>{X.push(Q),J??(J=M9($));let Y=O9(Z,J);return J.add(Y),Y},setAnchors:()=>{for(let Q of X){let Y=z.get(Q);if(typeof Y==="object"&&Y.anchor&&(L9.isScalar(Y.node)||L9.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}}WJ.anchorIsValid=YJ;WJ.anchorNames=M9;WJ.createNodeAnchors=qJ;WJ.findNewAnchor=O9});var W6=D((HJ)=>{function V1($,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=V1($,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=V1($,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=V1($,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=V1($,z,J,Q);if(Y===void 0)delete z[J];else if(Y!==Q)z[J]=Y}return $.call(Z,X,z)}HJ.applyReviver=V1});var d0=D((BJ)=>{var TJ=h();function w9($,Z,X){if(Array.isArray($))return $.map((z,J)=>w9(z,String(J),X));if($&&typeof $.toJSON==="function"){if(!X||!TJ.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 $}BJ.toJS=w9});var k2=D((wJ)=>{var MJ=W6(),D9=h(),OJ=d0();class A9{constructor($){Object.defineProperty(this,D9.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(!D9.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=OJ.toJS(this,"",Q);if(typeof z==="function")for(let{count:q,res:W}of Q.anchors.values())z(W,q);return typeof J==="function"?MJ.applyReviver(J,{"":Y},"",Y):Y}}wJ.NodeBase=A9});var K1=D((PJ)=>{var AJ=f2(),FJ=U1(),P$=h(),IJ=k2(),RJ=d0();class F9 extends IJ.NodeBase{constructor($){super(P$.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=[],FJ.visit($,{Node:(J,Q)=>{if(P$.isAlias(Q)||P$.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)RJ.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=y2(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(AJ.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 y2($,Z,X){if(P$.isAlias(Z)){let z=Z.resolve($),J=X&&z&&X.get(z);return J?J.count*J.aliasCount:0}else if(P$.isCollection(Z)){let z=0;for(let J of Z.items){let Q=y2($,J,X);if(Q>z)z=Q}return z}else if(P$.isPair(Z)){let z=y2($,Z.key,X),J=y2($,Z.value,X);return Math.max(z,J)}return 1}PJ.Alias=F9});var X0=D((bJ)=>{var CJ=h(),_J=k2(),SJ=d0(),jJ=($)=>!$||typeof $!=="function"&&typeof $!=="object";class q$ extends _J.NodeBase{constructor($){super(CJ.SCALAR);this.value=$}toJSON($,Z){return Z?.keep?this.value:SJ.toJS(this.value,$,Z)}toString(){return String(this.value)}}q$.BLOCK_FOLDED="BLOCK_FOLDED";q$.BLOCK_LITERAL="BLOCK_LITERAL";q$.PLAIN="PLAIN";q$.QUOTE_DOUBLE="QUOTE_DOUBLE";q$.QUOTE_SINGLE="QUOTE_SINGLE";bJ.Scalar=q$;bJ.isScalarValue=jJ});var H1=D((vJ)=>{var kJ=K1(),W$=h(),I9=X0(),yJ="tag:yaml.org,2002:";function gJ($,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 hJ($,Z,X){if(W$.isDocument($))$=$.contents;if(W$.isNode($))return $;if(W$.isPair($)){let K=X.schema[W$.MAP].createNode?.(X.schema,null,X);return K.items.push($),K}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,W=void 0;if(z&&$&&typeof $==="object")if(W=q.get($),W)return W.anchor??(W.anchor=J($)),new kJ.Alias(W.anchor);else W={anchor:null,node:null},q.set($,W);if(Z?.startsWith("!!"))Z=yJ+Z.slice(2);let G=gJ($,Z,Y.tags);if(!G){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let K=new I9.Scalar($);if(W)W.node=K;return K}G=$ instanceof Map?Y[W$.MAP]:(Symbol.iterator in Object($))?Y[W$.SEQ]:Y[W$.MAP]}if(Q)Q(G),delete X.onTagObj;let U=G?.createNode?G.createNode(X.schema,$,X):typeof G?.nodeClass?.from==="function"?G.nodeClass.from(X.schema,$,X):new I9.Scalar($);if(Z)U.tag=Z;else if(!G.default)U.tag=G.tag;if(W)W.node=U;return U}vJ.createNode=hJ});var g2=D((cJ)=>{var mJ=H1(),j0=h(),dJ=k2();function G6($,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 mJ.createNode(z,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var R9=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class P9 extends dJ.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)=>j0.isNode(X)||j0.isPair(X)?X.clone($):X),this.range)Z.range=this.range.slice();return Z}addIn($,Z){if(R9($))this.add(Z);else{let[X,...z]=$,J=this.get(X,!0);if(j0.isCollection(J))J.addIn(z,Z);else if(J===void 0&&this.schema)this.set(X,G6(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(j0.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&&j0.isScalar(J)?J.value:J;else return j0.isCollection(J)?J.getIn(z,Z):void 0}hasAllNullValues($){return this.items.every((Z)=>{if(!j0.isPair(Z))return!1;let X=Z.value;return X==null||$&&j0.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 j0.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(j0.isCollection(J))J.setIn(z,Z);else if(J===void 0&&this.schema)this.set(X,G6(this.schema,z,Z));else throw Error(`Expected YAML collection at ${X}. Remaining path: ${z}`)}}}cJ.Collection=P9;cJ.collectionFromPath=G6;cJ.isEmptyPath=R9});var N1=D((sJ)=>{var nJ=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function U6($,Z){if(/^\n+$/.test($))return $.substring(1);return Z?$.replace(/^(?! *$)/gm,Z):$}var rJ=($,Z,X)=>$.endsWith(`
29
+ `)?U6(X,Z):X.includes(`
30
30
  `)?`
31
- `+U6(Z,X):($.endsWith(" ")?"":" ")+Z;rJ.indentComment=U6;rJ.lineComment=nJ;rJ.stringifyComment=iJ});var C9=D((eJ)=>{function tJ($,X,Z="flow",{indentAtStart:z,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-X.length);if($.length<=W)return $;let G=[],U={},K=J-X.length;if(typeof z==="number")if(z>J-Math.max(2,Q))G.push(0);else K=J-z;let V=void 0,T=void 0,O=!1,N=-1,L=-1,I=-1;if(Z==="block"){if(N=E9($,N,X.length),N!==-1)K=N+W}for(let _;_=$[N+=1];){if(Z==="quoted"&&_==="\\"){switch(L=N,$[N+1]){case"x":N+=3;break;case"u":N+=5;break;case"U":N+=9;break;default:N+=1}I=N}if(_===`
32
- `){if(Z==="block")N=E9($,N,X.length);K=N+X.length+W,V=void 0}else{if(_===" "&&T&&T!==" "&&T!==`
33
- `&&T!=="\t"){let S=$[N+1];if(S&&S!==" "&&S!==`
34
- `&&S!=="\t")V=N}if(N>=K)if(V)G.push(V),K=V+W,V=void 0;else if(Z==="quoted"){while(T===" "||T==="\t")T=_,_=$[N+=1],O=!0;let S=N>I+1?N-2:L-1;if(U[S])return $;G.push(S),U[S]=!0,K=S+W,V=void 0}else O=!0}T=_}if(O&&q)q();if(G.length===0)return $;if(Y)Y();let E=$.slice(0,G[0]);for(let _=0;_<G.length;++_){let S=G[_],b=G[_+1]||$.length;if(S===0)E=`
35
- ${X}${$.slice(0,b)}`;else{if(Z==="quoted"&&U[S])E+=`${$[S]}\\`;E+=`
36
- ${X}${$.slice(S+1,b)}`}}return E}function E9($,X,Z){let z=X,J=X+1,Q=$[J];while(Q===" "||Q==="\t")if(X<J+Z)Q=$[++X];else{do Q=$[++X];while(Q&&Q!==`
37
- `);z=X,J=X+1,Q=$[J]}return z}eJ.FOLD_BLOCK="block";eJ.FOLD_FLOW="flow";eJ.FOLD_QUOTED="quoted";eJ.foldFlowLines=tJ});var B1=D((qQ)=>{var E0=Z0(),c0=C9(),v2=($,X)=>({indentAtStart:X?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),u2=($)=>/^(%|---|\.\.\.)/m.test($);function JQ($,X,Z){if(!X||X<0)return!1;let z=X-Z,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 T1($,X){let Z=JSON.stringify($);if(X.options.doubleQuotedAsJSON)return Z;let{implicitKey:z}=X,J=X.options.doubleQuotedMinMultiLineLength,Q=X.indent||(u2($)?" ":""),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(z||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,z?Y:c0.foldFlowLines(Y,Q,c0.FOLD_QUOTED,v2(X,!1))}function V6($,X){if(X.options.singleQuote===!1||X.implicitKey&&$.includes(`
42
- `)||/[ \t]\n|\n[ \t]/.test($))return T1($,X);let Z=X.indent||(u2($)?" ":""),z="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
43
- ${Z}`)+"'";return X.implicitKey?z:c0.foldFlowLines(z,Z,c0.FOLD_FLOW,v2(X,!1))}function E$($,X){let{singleQuote:Z}=X.options,z;if(Z===!1)z=T1;else{let J=$.includes('"'),Q=$.includes("'");if(J&&!Q)z=V6;else if(Q&&!J)z=T1;else z=Z?V6:T1}return z($,X)}var K6;try{K6=new RegExp(`(^|(?<!
31
+ `+U6(X,Z):($.endsWith(" ")?"":" ")+X;sJ.indentComment=U6;sJ.lineComment=rJ;sJ.stringifyComment=nJ});var C9=D(($Q)=>{function eJ($,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 W=Math.max(1+Q,1+J-Z.length);if($.length<=W)return $;let G=[],U={},K=J-Z.length;if(typeof z==="number")if(z>J-Math.max(2,Q))G.push(0);else K=J-z;let V=void 0,T=void 0,O=!1,N=-1,L=-1,R=-1;if(X==="block"){if(N=E9($,N,Z.length),N!==-1)K=N+W}for(let S;S=$[N+=1];){if(X==="quoted"&&S==="\\"){switch(L=N,$[N+1]){case"x":N+=3;break;case"u":N+=5;break;case"U":N+=9;break;default:N+=1}R=N}if(S===`
32
+ `){if(X==="block")N=E9($,N,Z.length);K=N+Z.length+W,V=void 0}else{if(S===" "&&T&&T!==" "&&T!==`
33
+ `&&T!=="\t"){let _=$[N+1];if(_&&_!==" "&&_!==`
34
+ `&&_!=="\t")V=N}if(N>=K)if(V)G.push(V),K=V+W,V=void 0;else if(X==="quoted"){while(T===" "||T==="\t")T=S,S=$[N+=1],O=!0;let _=N>R+1?N-2:L-1;if(U[_])return $;G.push(_),U[_]=!0,K=_+W,V=void 0}else O=!0}T=S}if(O&&q)q();if(G.length===0)return $;if(Y)Y();let C=$.slice(0,G[0]);for(let S=0;S<G.length;++S){let _=G[S],b=G[S+1]||$.length;if(_===0)C=`
35
+ ${Z}${$.slice(0,b)}`;else{if(X==="quoted"&&U[_])C+=`${$[_]}\\`;C+=`
36
+ ${Z}${$.slice(_+1,b)}`}}return C}function E9($,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}$Q.FOLD_BLOCK="block";$Q.FOLD_FLOW="flow";$Q.FOLD_QUOTED="quoted";$Q.foldFlowLines=eJ});var B1=D((WQ)=>{var E0=X0(),c0=C9(),v2=($,Z)=>({indentAtStart:Z?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),u2=($)=>/^(%|---|\.\.\.)/m.test($);function QQ($,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 T1($,Z){let X=JSON.stringify($);if(Z.options.doubleQuotedAsJSON)return X;let{implicitKey:z}=Z,J=Z.options.doubleQuotedMinMultiLineLength,Q=Z.indent||(u2($)?" ":""),Y="",q=0;for(let W=0,G=X[W];G;G=X[++W]){if(G===" "&&X[W+1]==="\\"&&X[W+2]==="n")Y+=X.slice(q,W)+"\\ ",W+=1,q=W,G="\\";if(G==="\\")switch(X[W+1]){case"u":{Y+=X.slice(q,W);let U=X.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+=X.substr(W,6)}W+=5,q=W+1}break;case"n":if(z||X[W+2]==='"'||X.length<J)W+=1;else{Y+=X.slice(q,W)+`
39
+
40
+ `;while(X[W+2]==="\\"&&X[W+3]==="n"&&X[W+4]!=='"')Y+=`
41
+ `,W+=2;if(Y+=Q,X[W+2]===" ")Y+="\\";W+=1,q=W+1}break;default:W+=1}}return Y=q?Y+X.slice(q):X,z?Y:c0.foldFlowLines(Y,Q,c0.FOLD_QUOTED,v2(Z,!1))}function V6($,Z){if(Z.options.singleQuote===!1||Z.implicitKey&&$.includes(`
42
+ `)||/[ \t]\n|\n[ \t]/.test($))return T1($,Z);let X=Z.indent||(u2($)?" ":""),z="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
43
+ ${X}`)+"'";return Z.implicitKey?z:c0.foldFlowLines(z,X,c0.FOLD_FLOW,v2(Z,!1))}function E$($,Z){let{singleQuote:X}=Z.options,z;if(X===!1)z=T1;else{let J=$.includes('"'),Q=$.includes("'");if(J&&!Q)z=V6;else if(Q&&!J)z=T1;else z=X?V6:T1}return z($,Z)}var K6;try{K6=new RegExp(`(^|(?<!
44
44
  ))
45
45
  +(?!
46
- |$)`,"g")}catch{K6=/\n+(?!\n|$)/g}function h2({comment:$,type:X,value:Z},z,J,Q){let{blockQuote:Y,commentString:q,lineWidth:W}=z.options;if(!Y||/\n[\t ]+$/.test(Z))return E$(Z,z);let G=z.indent||(z.forceBlockIndent||u2(Z)?" ":""),U=Y==="literal"?!0:Y==="folded"||X===E0.Scalar.BLOCK_FOLDED?!1:X===E0.Scalar.BLOCK_LITERAL?!0:!JQ(Z,W,G.length);if(!Z)return U?`|
46
+ |$)`,"g")}catch{K6=/\n+(?!\n|$)/g}function h2({comment:$,type:Z,value:X},z,J,Q){let{blockQuote:Y,commentString:q,lineWidth:W}=z.options;if(!Y||/\n[\t ]+$/.test(X))return E$(X,z);let G=z.indent||(z.forceBlockIndent||u2(X)?" ":""),U=Y==="literal"?!0:Y==="folded"||Z===E0.Scalar.BLOCK_FOLDED?!1:Z===E0.Scalar.BLOCK_LITERAL?!0:!QQ(X,W,G.length);if(!X)return U?`|
47
47
  `:`>
48
- `;let K,V;for(V=Z.length;V>0;--V){let b=Z[V-1];if(b!==`
49
- `&&b!=="\t"&&b!==" ")break}let T=Z.substring(V),O=T.indexOf(`
50
- `);if(O===-1)K="-";else if(Z===T||O!==T.length-1){if(K="+",Q)Q()}else K="";if(T){if(Z=Z.slice(0,-T.length),T[T.length-1]===`
51
- `)T=T.slice(0,-1);T=T.replace(K6,`$&${G}`)}let N=!1,L,I=-1;for(L=0;L<Z.length;++L){let b=Z[L];if(b===" ")N=!0;else if(b===`
52
- `)I=L;else break}let E=Z.substring(0,I<L?I+1:L);if(E)Z=Z.substring(E.length),E=E.replace(/\n+/g,`$&${G}`);let S=(N?G?"2":"1":"")+K;if($){if(S+=" "+q($.replace(/ ?[\r\n]+/g," ")),J)J()}if(!U){let b=Z.replace(/\n+/g,`
53
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${G}`),j=!1,i=v2(z,!0);if(Y!=="folded"&&X!==E0.Scalar.BLOCK_FOLDED)i.onOverflow=()=>{j=!0};let F=c0.foldFlowLines(`${E}${b}${T}`,G,c0.FOLD_BLOCK,i);if(!j)return`>${S}
54
- ${G}${F}`}return Z=Z.replace(/\n+/g,`$&${G}`),`|${S}
55
- ${G}${E}${Z}${T}`}function QQ($,X,Z,z){let{type:J,value:Q}=$,{actualString:Y,implicitKey:q,indent:W,indentStep:G,inFlow:U}=X;if(q&&Q.includes(`
56
- `)||U&&/[[\]{},]/.test(Q))return E$(Q,X);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(Q))return q||U||!Q.includes(`
57
- `)?E$(Q,X):h2($,X,Z,z);if(!q&&!U&&J!==E0.Scalar.PLAIN&&Q.includes(`
58
- `))return h2($,X,Z,z);if(u2(Q)){if(W==="")return X.forceBlockIndent=!0,h2($,X,Z,z);else if(q&&W===G)return E$(Q,X)}let K=Q.replace(/\n+/g,`$&
59
- ${W}`);if(Y){let V=(N)=>N.default&&N.tag!=="tag:yaml.org,2002:str"&&N.test?.test(K),{compat:T,tags:O}=X.doc.schema;if(O.some(V)||T?.some(V))return E$(Q,X)}return q?K:c0.foldFlowLines(K,W,c0.FOLD_FLOW,v2(X,!1))}function YQ($,X,Z,z){let{implicitKey:J,inFlow:Q}=X,Y=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:q}=$;if(q!==E0.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(Y.value))q=E0.Scalar.QUOTE_DOUBLE}let W=(U)=>{switch(U){case E0.Scalar.BLOCK_FOLDED:case E0.Scalar.BLOCK_LITERAL:return J||Q?E$(Y.value,X):h2(Y,X,Z,z);case E0.Scalar.QUOTE_DOUBLE:return T1(Y.value,X);case E0.Scalar.QUOTE_SINGLE:return V6(Y.value,X);case E0.Scalar.PLAIN:return QQ(Y,X,Z,z);default:return null}},G=W(q);if(G===null){let{defaultKeyType:U,defaultStringType:K}=X.options,V=J&&U||K;if(G=W(V),G===null)throw Error(`Unsupported default string type ${V}`)}return G}qQ.stringifyString=YQ});var L1=D((BQ)=>{var GQ=f2(),p0=h(),UQ=N1(),VQ=B1();function KQ($,X){let Z=Object.assign({blockQuote:!0,commentString:UQ.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,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},$.schema.toStringOptions,X),z;switch(Z.collectionStyle){case"block":z=!1;break;case"flow":z=!0;break;default:z=null}return{anchors:new Set,doc:$,flowCollectionPadding:Z.flowCollectionPadding?" ":"",indent:"",indentStep:typeof Z.indent==="number"?" ".repeat(Z.indent):" ",inFlow:z,options:Z}}function HQ($,X){if(X.tag){let J=$.filter((Q)=>Q.tag===X.tag);if(J.length>0)return J.find((Q)=>Q.format===X.format)??J[0]}let Z=void 0,z;if(p0.isScalar(X)){z=X.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}Z=J.find((Q)=>Q.format===X.format)??J.find((Q)=>!Q.format)}else z=X,Z=$.find((J)=>J.nodeClass&&z instanceof J.nodeClass);if(!Z){let J=z?.constructor?.name??(z===null?"null":typeof z);throw Error(`Tag not resolved for ${J} value`)}return Z}function NQ($,X,{anchors:Z,doc:z}){if(!z.directives)return"";let J=[],Q=(p0.isScalar($)||p0.isCollection($))&&$.anchor;if(Q&&GQ.anchorIsValid(Q))Z.add(Q),J.push(`&${Q}`);let Y=$.tag??(X.default?null:X.tag);if(Y)J.push(z.directives.tagString(Y));return J.join(" ")}function TQ($,X,Z,z){if(p0.isPair($))return $.toString(X,Z,z);if(p0.isAlias($)){if(X.doc.directives)return $.toString(X);if(X.resolvedAliases?.has($))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(X.resolvedAliases)X.resolvedAliases.add($);else X.resolvedAliases=new Set([$]);$=$.resolve(X.doc)}}let J=void 0,Q=p0.isNode($)?$:X.doc.createNode($,{onTagObj:(W)=>J=W});J??(J=HQ(X.doc.schema.tags,Q));let Y=NQ(Q,J,X);if(Y.length>0)X.indentAtStart=(X.indentAtStart??0)+Y.length+1;let q=typeof J.stringify==="function"?J.stringify(Q,X,Z,z):p0.isScalar(Q)?VQ.stringifyString(Q,X,Z,z):Q.toString(X,Z,z);if(!Y)return q;return p0.isScalar(Q)||q[0]==="{"||q[0]==="["?`${Y} ${q}`:`${Y}
60
- ${X.indent}${q}`}BQ.createStringifyContext=KQ;BQ.stringify=TQ});var j9=D((wQ)=>{var f0=h(),_9=Z0(),S9=L1(),M1=N1();function OQ({key:$,value:X},Z,z,J){let{allNullValues:Q,doc:Y,indent:q,indentStep:W,options:{commentString:G,indentSeq:U,simpleKeys:K}}=Z,V=f0.isNode($)&&$.comment||null;if(K){if(V)throw Error("With simple keys, key nodes cannot have comments");if(f0.isCollection($)||!f0.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let T=!K&&(!$||V&&X==null&&!Z.inFlow||f0.isCollection($)||(f0.isScalar($)?$.type===_9.Scalar.BLOCK_FOLDED||$.type===_9.Scalar.BLOCK_LITERAL:typeof $==="object"));Z=Object.assign({},Z,{allNullValues:!1,implicitKey:!T&&(K||!Q),indent:q+W});let O=!1,N=!1,L=S9.stringify($,Z,()=>O=!0,()=>N=!0);if(!T&&!Z.inFlow&&L.length>1024){if(K)throw Error("With simple keys, single line scalar must not span more than 1024 characters");T=!0}if(Z.inFlow){if(Q||X==null){if(O&&z)z();return L===""?"?":T?`? ${L}`:L}}else if(Q&&!K||X==null&&T){if(L=`? ${L}`,V&&!O)L+=M1.lineComment(L,Z.indent,G(V));else if(N&&J)J();return L}if(O)V=null;if(T){if(V)L+=M1.lineComment(L,Z.indent,G(V));L=`? ${L}
61
- ${q}:`}else if(L=`${L}:`,V)L+=M1.lineComment(L,Z.indent,G(V));let I,E,_;if(f0.isNode(X))I=!!X.spaceBefore,E=X.commentBefore,_=X.comment;else if(I=!1,E=null,_=null,X&&typeof X==="object")X=Y.createNode(X);if(Z.implicitKey=!1,!T&&!V&&f0.isScalar(X))Z.indentAtStart=L.length+1;if(N=!1,!U&&W.length>=2&&!Z.inFlow&&!T&&f0.isSeq(X)&&!X.flow&&!X.tag&&!X.anchor)Z.indent=Z.indent.substring(2);let S=!1,b=S9.stringify(X,Z,()=>S=!0,()=>N=!0),j=" ";if(V||I||E){if(j=I?`
62
- `:"",E){let i=G(E);j+=`
63
- ${M1.indentComment(i,Z.indent)}`}if(b===""&&!Z.inFlow){if(j===`
64
- `&&_)j=`
48
+ `;let K,V;for(V=X.length;V>0;--V){let b=X[V-1];if(b!==`
49
+ `&&b!=="\t"&&b!==" ")break}let T=X.substring(V),O=T.indexOf(`
50
+ `);if(O===-1)K="-";else if(X===T||O!==T.length-1){if(K="+",Q)Q()}else K="";if(T){if(X=X.slice(0,-T.length),T[T.length-1]===`
51
+ `)T=T.slice(0,-1);T=T.replace(K6,`$&${G}`)}let N=!1,L,R=-1;for(L=0;L<X.length;++L){let b=X[L];if(b===" ")N=!0;else if(b===`
52
+ `)R=L;else break}let C=X.substring(0,R<L?R+1:L);if(C)X=X.substring(C.length),C=C.replace(/\n+/g,`$&${G}`);let _=(N?G?"2":"1":"")+K;if($){if(_+=" "+q($.replace(/ ?[\r\n]+/g," ")),J)J()}if(!U){let b=X.replace(/\n+/g,`
53
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${G}`),j=!1,i=v2(z,!0);if(Y!=="folded"&&Z!==E0.Scalar.BLOCK_FOLDED)i.onOverflow=()=>{j=!0};let F=c0.foldFlowLines(`${C}${b}${T}`,G,c0.FOLD_BLOCK,i);if(!j)return`>${_}
54
+ ${G}${F}`}return X=X.replace(/\n+/g,`$&${G}`),`|${_}
55
+ ${G}${C}${X}${T}`}function YQ($,Z,X,z){let{type:J,value:Q}=$,{actualString:Y,implicitKey:q,indent:W,indentStep:G,inFlow:U}=Z;if(q&&Q.includes(`
56
+ `)||U&&/[[\]{},]/.test(Q))return E$(Q,Z);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(Q))return q||U||!Q.includes(`
57
+ `)?E$(Q,Z):h2($,Z,X,z);if(!q&&!U&&J!==E0.Scalar.PLAIN&&Q.includes(`
58
+ `))return h2($,Z,X,z);if(u2(Q)){if(W==="")return Z.forceBlockIndent=!0,h2($,Z,X,z);else if(q&&W===G)return E$(Q,Z)}let K=Q.replace(/\n+/g,`$&
59
+ ${W}`);if(Y){let V=(N)=>N.default&&N.tag!=="tag:yaml.org,2002:str"&&N.test?.test(K),{compat:T,tags:O}=Z.doc.schema;if(O.some(V)||T?.some(V))return E$(Q,Z)}return q?K:c0.foldFlowLines(K,W,c0.FOLD_FLOW,v2(Z,!1))}function qQ($,Z,X,z){let{implicitKey:J,inFlow:Q}=Z,Y=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:q}=$;if(q!==E0.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(Y.value))q=E0.Scalar.QUOTE_DOUBLE}let W=(U)=>{switch(U){case E0.Scalar.BLOCK_FOLDED:case E0.Scalar.BLOCK_LITERAL:return J||Q?E$(Y.value,Z):h2(Y,Z,X,z);case E0.Scalar.QUOTE_DOUBLE:return T1(Y.value,Z);case E0.Scalar.QUOTE_SINGLE:return V6(Y.value,Z);case E0.Scalar.PLAIN:return YQ(Y,Z,X,z);default:return null}},G=W(q);if(G===null){let{defaultKeyType:U,defaultStringType:K}=Z.options,V=J&&U||K;if(G=W(V),G===null)throw Error(`Unsupported default string type ${V}`)}return G}WQ.stringifyString=qQ});var L1=D((LQ)=>{var UQ=f2(),p0=h(),VQ=N1(),KQ=B1();function HQ($,Z){let X=Object.assign({blockQuote:!0,commentString:VQ.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 NQ($,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(p0.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 TQ($,Z,{anchors:X,doc:z}){if(!z.directives)return"";let J=[],Q=(p0.isScalar($)||p0.isCollection($))&&$.anchor;if(Q&&UQ.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 BQ($,Z,X,z){if(p0.isPair($))return $.toString(Z,X,z);if(p0.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=p0.isNode($)?$:Z.doc.createNode($,{onTagObj:(W)=>J=W});J??(J=NQ(Z.doc.schema.tags,Q));let Y=TQ(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):p0.isScalar(Q)?KQ.stringifyString(Q,Z,X,z):Q.toString(Z,X,z);if(!Y)return q;return p0.isScalar(Q)||q[0]==="{"||q[0]==="["?`${Y} ${q}`:`${Y}
60
+ ${Z.indent}${q}`}LQ.createStringifyContext=HQ;LQ.stringify=BQ});var j9=D((DQ)=>{var f0=h(),_9=X0(),S9=L1(),M1=N1();function wQ({key:$,value:Z},X,z,J){let{allNullValues:Q,doc:Y,indent:q,indentStep:W,options:{commentString:G,indentSeq:U,simpleKeys:K}}=X,V=f0.isNode($)&&$.comment||null;if(K){if(V)throw Error("With simple keys, key nodes cannot have comments");if(f0.isCollection($)||!f0.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let T=!K&&(!$||V&&Z==null&&!X.inFlow||f0.isCollection($)||(f0.isScalar($)?$.type===_9.Scalar.BLOCK_FOLDED||$.type===_9.Scalar.BLOCK_LITERAL:typeof $==="object"));X=Object.assign({},X,{allNullValues:!1,implicitKey:!T&&(K||!Q),indent:q+W});let O=!1,N=!1,L=S9.stringify($,X,()=>O=!0,()=>N=!0);if(!T&&!X.inFlow&&L.length>1024){if(K)throw Error("With simple keys, single line scalar must not span more than 1024 characters");T=!0}if(X.inFlow){if(Q||Z==null){if(O&&z)z();return L===""?"?":T?`? ${L}`:L}}else if(Q&&!K||Z==null&&T){if(L=`? ${L}`,V&&!O)L+=M1.lineComment(L,X.indent,G(V));else if(N&&J)J();return L}if(O)V=null;if(T){if(V)L+=M1.lineComment(L,X.indent,G(V));L=`? ${L}
61
+ ${q}:`}else if(L=`${L}:`,V)L+=M1.lineComment(L,X.indent,G(V));let R,C,S;if(f0.isNode(Z))R=!!Z.spaceBefore,C=Z.commentBefore,S=Z.comment;else if(R=!1,C=null,S=null,Z&&typeof Z==="object")Z=Y.createNode(Z);if(X.implicitKey=!1,!T&&!V&&f0.isScalar(Z))X.indentAtStart=L.length+1;if(N=!1,!U&&W.length>=2&&!X.inFlow&&!T&&f0.isSeq(Z)&&!Z.flow&&!Z.tag&&!Z.anchor)X.indent=X.indent.substring(2);let _=!1,b=S9.stringify(Z,X,()=>_=!0,()=>N=!0),j=" ";if(V||R||C){if(j=R?`
62
+ `:"",C){let i=G(C);j+=`
63
+ ${M1.indentComment(i,X.indent)}`}if(b===""&&!X.inFlow){if(j===`
64
+ `&&S)j=`
65
65
 
66
66
  `}else j+=`
67
- ${Z.indent}`}else if(!T&&f0.isCollection(X)){let i=b[0],F=b.indexOf(`
68
- `),X0=F!==-1,A0=Z.inFlow??X.flow??X.items.length===0;if(X0||!A0){let m0=!1;if(X0&&(i==="&"||i==="!")){let a=b.indexOf(" ");if(i==="&"&&a!==-1&&a<F&&b[a+1]==="!")a=b.indexOf(" ",a+1);if(a===-1||F<a)m0=!0}if(!m0)j=`
69
- ${Z.indent}`}}else if(b===""||b[0]===`
70
- `)j="";if(L+=j+b,Z.inFlow){if(S&&z)z()}else if(_&&!S)L+=M1.lineComment(L,Z.indent,G(_));else if(N&&J)J();return L}wQ.stringifyPair=OQ});var H6=D((IQ)=>{var b9=B0("process");function AQ($,...X){if($==="debug")console.log(...X)}function FQ($,X){if($==="debug"||$==="warn")if(typeof b9.emitWarning==="function")b9.emitWarning(X);else console.warn(X)}IQ.debug=AQ;IQ.warn=FQ});var c2=D((CQ)=>{var O1=h(),x9=Z0(),m2="<<",d2={identify:($)=>$===m2||typeof $==="symbol"&&$.description===m2,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new x9.Scalar(Symbol(m2)),{addToJSMap:f9}),stringify:()=>m2},EQ=($,X)=>(d2.identify(X)||O1.isScalar(X)&&(!X.type||X.type===x9.Scalar.PLAIN)&&d2.identify(X.value))&&$?.doc.schema.tags.some((Z)=>Z.tag===d2.tag&&Z.default);function f9($,X,Z){if(Z=$&&O1.isAlias(Z)?Z.resolve($.doc):Z,O1.isSeq(Z))for(let z of Z.items)N6($,X,z);else if(Array.isArray(Z))for(let z of Z)N6($,X,z);else N6($,X,Z)}function N6($,X,Z){let z=$&&O1.isAlias(Z)?Z.resolve($.doc):Z;if(!O1.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(X instanceof Map){if(!X.has(Q))X.set(Q,Y)}else if(X instanceof Set)X.add(Q);else if(!Object.prototype.hasOwnProperty.call(X,Q))Object.defineProperty(X,Q,{value:Y,writable:!0,enumerable:!0,configurable:!0});return X}CQ.addMergeToJSMap=f9;CQ.isMergeKey=EQ;CQ.merge=d2});var B6=D((yQ)=>{var bQ=H6(),k9=c2(),xQ=L1(),y9=h(),T6=d0();function fQ($,X,{key:Z,value:z}){if(y9.isNode(Z)&&Z.addToJSMap)Z.addToJSMap($,X,z);else if(k9.isMergeKey($,Z))k9.addMergeToJSMap($,X,z);else{let J=T6.toJS(Z,"",$);if(X instanceof Map)X.set(J,T6.toJS(z,J,$));else if(X instanceof Set)X.add(J);else{let Q=kQ(Z,J,$),Y=T6.toJS(z,Q,$);if(Q in X)Object.defineProperty(X,Q,{value:Y,writable:!0,enumerable:!0,configurable:!0});else X[Q]=Y}}return X}function kQ($,X,Z){if(X===null)return"";if(typeof X!=="object")return String(X);if(y9.isNode($)&&Z?.doc){let z=xQ.createStringifyContext(Z.doc,{});z.anchors=new Set;for(let Q of Z.anchors.keys())z.anchors.add(Q.anchor);z.inFlow=!0,z.inStringifyKey=!0;let J=$.toString(z);if(!Z.mapKeyWarned){let Q=JSON.stringify(J);if(Q.length>40)Q=Q.substring(0,36)+'..."';bQ.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(X)}yQ.addPairToJSMap=fQ});var l0=D((mQ)=>{var g9=H1(),hQ=j9(),vQ=B6(),p2=h();function uQ($,X,Z){let z=g9.createNode($,void 0,Z),J=g9.createNode(X,void 0,Z);return new l2(z,J)}class l2{constructor($,X=null){Object.defineProperty(this,p2.NODE_TYPE,{value:p2.PAIR}),this.key=$,this.value=X}clone($){let{key:X,value:Z}=this;if(p2.isNode(X))X=X.clone($);if(p2.isNode(Z))Z=Z.clone($);return new l2(X,Z)}toJSON($,X){let Z=X?.mapAsMap?new Map:{};return vQ.addPairToJSMap(X,Z,this)}toString($,X,Z){return $?.doc?hQ.stringifyPair(this,$,X,Z):JSON.stringify(this)}}mQ.Pair=l2;mQ.createPair=uQ});var L6=D((nQ)=>{var G$=h(),h9=L1(),i2=N1();function pQ($,X,Z){return(X.inFlow??$.flow?iQ:lQ)($,X,Z)}function lQ({comment:$,items:X},Z,{blockItemPrefix:z,flowChars:J,itemIndent:Q,onChompKeep:Y,onComment:q}){let{indent:W,options:{commentString:G}}=Z,U=Object.assign({},Z,{indent:Q,type:null}),K=!1,V=[];for(let O=0;O<X.length;++O){let N=X[O],L=null;if(G$.isNode(N)){if(!K&&N.spaceBefore)V.push("");if(n2(Z,V,N.commentBefore,K),N.comment)L=N.comment}else if(G$.isPair(N)){let E=G$.isNode(N.key)?N.key:null;if(E){if(!K&&E.spaceBefore)V.push("");n2(Z,V,E.commentBefore,K)}}K=!1;let I=h9.stringify(N,U,()=>L=null,()=>K=!0);if(L)I+=i2.lineComment(I,Q,G(L));if(K&&L)K=!1;V.push(z+I)}let T;if(V.length===0)T=J.start+J.end;else{T=V[0];for(let O=1;O<V.length;++O){let N=V[O];T+=N?`
67
+ ${X.indent}`}else if(!T&&f0.isCollection(Z)){let i=b[0],F=b.indexOf(`
68
+ `),Z0=F!==-1,A0=X.inFlow??Z.flow??Z.items.length===0;if(Z0||!A0){let m0=!1;if(Z0&&(i==="&"||i==="!")){let a=b.indexOf(" ");if(i==="&"&&a!==-1&&a<F&&b[a+1]==="!")a=b.indexOf(" ",a+1);if(a===-1||F<a)m0=!0}if(!m0)j=`
69
+ ${X.indent}`}}else if(b===""||b[0]===`
70
+ `)j="";if(L+=j+b,X.inFlow){if(_&&z)z()}else if(S&&!_)L+=M1.lineComment(L,X.indent,G(S));else if(N&&J)J();return L}DQ.stringifyPair=wQ});var H6=D((RQ)=>{var b9=B0("process");function FQ($,...Z){if($==="debug")console.log(...Z)}function IQ($,Z){if($==="debug"||$==="warn")if(typeof b9.emitWarning==="function")b9.emitWarning(Z);else console.warn(Z)}RQ.debug=FQ;RQ.warn=IQ});var c2=D((_Q)=>{var O1=h(),x9=X0(),m2="<<",d2={identify:($)=>$===m2||typeof $==="symbol"&&$.description===m2,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new x9.Scalar(Symbol(m2)),{addToJSMap:f9}),stringify:()=>m2},CQ=($,Z)=>(d2.identify(Z)||O1.isScalar(Z)&&(!Z.type||Z.type===x9.Scalar.PLAIN)&&d2.identify(Z.value))&&$?.doc.schema.tags.some((X)=>X.tag===d2.tag&&X.default);function f9($,Z,X){if(X=$&&O1.isAlias(X)?X.resolve($.doc):X,O1.isSeq(X))for(let z of X.items)N6($,Z,z);else if(Array.isArray(X))for(let z of X)N6($,Z,z);else N6($,Z,X)}function N6($,Z,X){let z=$&&O1.isAlias(X)?X.resolve($.doc):X;if(!O1.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}_Q.addMergeToJSMap=f9;_Q.isMergeKey=CQ;_Q.merge=d2});var B6=D((gQ)=>{var xQ=H6(),k9=c2(),fQ=L1(),y9=h(),T6=d0();function kQ($,Z,{key:X,value:z}){if(y9.isNode(X)&&X.addToJSMap)X.addToJSMap($,Z,z);else if(k9.isMergeKey($,X))k9.addMergeToJSMap($,Z,z);else{let J=T6.toJS(X,"",$);if(Z instanceof Map)Z.set(J,T6.toJS(z,J,$));else if(Z instanceof Set)Z.add(J);else{let Q=yQ(X,J,$),Y=T6.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 yQ($,Z,X){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(y9.isNode($)&&X?.doc){let z=fQ.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)+'..."';xQ.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)}gQ.addPairToJSMap=kQ});var l0=D((dQ)=>{var g9=H1(),vQ=j9(),uQ=B6(),p2=h();function mQ($,Z,X){let z=g9.createNode($,void 0,X),J=g9.createNode(Z,void 0,X);return new l2(z,J)}class l2{constructor($,Z=null){Object.defineProperty(this,p2.NODE_TYPE,{value:p2.PAIR}),this.key=$,this.value=Z}clone($){let{key:Z,value:X}=this;if(p2.isNode(Z))Z=Z.clone($);if(p2.isNode(X))X=X.clone($);return new l2(Z,X)}toJSON($,Z){let X=Z?.mapAsMap?new Map:{};return uQ.addPairToJSMap(Z,X,this)}toString($,Z,X){return $?.doc?vQ.stringifyPair(this,$,Z,X):JSON.stringify(this)}}dQ.Pair=l2;dQ.createPair=mQ});var L6=D((rQ)=>{var G$=h(),h9=L1(),i2=N1();function lQ($,Z,X){return(Z.inFlow??$.flow?nQ:iQ)($,Z,X)}function iQ({comment:$,items:Z},X,{blockItemPrefix:z,flowChars:J,itemIndent:Q,onChompKeep:Y,onComment:q}){let{indent:W,options:{commentString:G}}=X,U=Object.assign({},X,{indent:Q,type:null}),K=!1,V=[];for(let O=0;O<Z.length;++O){let N=Z[O],L=null;if(G$.isNode(N)){if(!K&&N.spaceBefore)V.push("");if(n2(X,V,N.commentBefore,K),N.comment)L=N.comment}else if(G$.isPair(N)){let C=G$.isNode(N.key)?N.key:null;if(C){if(!K&&C.spaceBefore)V.push("");n2(X,V,C.commentBefore,K)}}K=!1;let R=h9.stringify(N,U,()=>L=null,()=>K=!0);if(L)R+=i2.lineComment(R,Q,G(L));if(K&&L)K=!1;V.push(z+R)}let T;if(V.length===0)T=J.start+J.end;else{T=V[0];for(let O=1;O<V.length;++O){let N=V[O];T+=N?`
71
71
  ${W}${N}`:`
72
72
  `}}if($){if(T+=`
73
- `+i2.indentComment(G($),W),q)q()}else if(K&&Y)Y();return T}function iQ({items:$},X,{flowChars:Z,itemIndent:z}){let{indent:J,indentStep:Q,flowCollectionPadding:Y,options:{commentString:q}}=X;z+=Q;let W=Object.assign({},X,{indent:z,inFlow:!0,type:null}),G=!1,U=0,K=[];for(let O=0;O<$.length;++O){let N=$[O],L=null;if(G$.isNode(N)){if(N.spaceBefore)K.push("");if(n2(X,K,N.commentBefore,!1),N.comment)L=N.comment}else if(G$.isPair(N)){let E=G$.isNode(N.key)?N.key:null;if(E){if(E.spaceBefore)K.push("");if(n2(X,K,E.commentBefore,!1),E.comment)G=!0}let _=G$.isNode(N.value)?N.value:null;if(_){if(_.comment)L=_.comment;if(_.commentBefore)G=!0}else if(N.value==null&&E?.comment)L=E.comment}if(L)G=!0;let I=h9.stringify(N,W,()=>L=null);if(G||(G=K.length>U||I.includes(`
74
- `)),O<$.length-1)I+=",";else if(X.options.trailingComma){if(X.options.lineWidth>0)G||(G=K.reduce((E,_)=>E+_.length+2,2)+(I.length+2)>X.options.lineWidth);if(G)I+=","}if(L)I+=i2.lineComment(I,z,q(L));K.push(I),U=K.length}let{start:V,end:T}=Z;if(K.length===0)return V+T;else{if(!G){let O=K.reduce((N,L)=>N+L.length+2,2);G=X.options.lineWidth>0&&O>X.options.lineWidth}if(G){let O=V;for(let N of K)O+=N?`
73
+ `+i2.indentComment(G($),W),q)q()}else if(K&&Y)Y();return T}function nQ({items:$},Z,{flowChars:X,itemIndent:z}){let{indent:J,indentStep:Q,flowCollectionPadding:Y,options:{commentString:q}}=Z;z+=Q;let W=Object.assign({},Z,{indent:z,inFlow:!0,type:null}),G=!1,U=0,K=[];for(let O=0;O<$.length;++O){let N=$[O],L=null;if(G$.isNode(N)){if(N.spaceBefore)K.push("");if(n2(Z,K,N.commentBefore,!1),N.comment)L=N.comment}else if(G$.isPair(N)){let C=G$.isNode(N.key)?N.key:null;if(C){if(C.spaceBefore)K.push("");if(n2(Z,K,C.commentBefore,!1),C.comment)G=!0}let S=G$.isNode(N.value)?N.value:null;if(S){if(S.comment)L=S.comment;if(S.commentBefore)G=!0}else if(N.value==null&&C?.comment)L=C.comment}if(L)G=!0;let R=h9.stringify(N,W,()=>L=null);if(O<$.length-1)R+=",";if(L)R+=i2.lineComment(R,z,q(L));if(!G&&(K.length>U||R.includes(`
74
+ `)))G=!0;K.push(R),U=K.length}let{start:V,end:T}=X;if(K.length===0)return V+T;else{if(!G){let O=K.reduce((N,L)=>N+L.length+2,2);G=Z.options.lineWidth>0&&O>Z.options.lineWidth}if(G){let O=V;for(let N of K)O+=N?`
75
75
  ${Q}${J}${N}`:`
76
76
  `;return`${O}
77
- ${J}${T}`}else return`${V}${Y}${K.join(" ")}${Y}${T}`}}function n2({indent:$,options:{commentString:X}},Z,z,J){if(z&&J)z=z.replace(/^\n+/,"");if(z){let Q=i2.indentComment(X(z),$);Z.push(Q.trimStart())}}nQ.stringifyCollection=pQ});var n0=D((eQ)=>{var sQ=L6(),aQ=B6(),oQ=g2(),i0=h(),r2=l0(),tQ=Z0();function w1($,X){let Z=i0.isScalar(X)?X.value:X;for(let z of $)if(i0.isPair(z)){if(z.key===X||z.key===Z)return z;if(i0.isScalar(z.key)&&z.key.value===Z)return z}return}class v9 extends oQ.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(i0.MAP,$);this.items=[]}static from($,X,Z){let{keepUndefined:z,replacer:J}=Z,Q=new this($),Y=(q,W)=>{if(typeof J==="function")W=J.call(X,q,W);else if(Array.isArray(J)&&!J.includes(q))return;if(W!==void 0||z)Q.items.push(r2.createPair(q,W,Z))};if(X instanceof Map)for(let[q,W]of X)Y(q,W);else if(X&&typeof X==="object")for(let q of Object.keys(X))Y(q,X[q]);if(typeof $.sortMapEntries==="function")Q.items.sort($.sortMapEntries);return Q}add($,X){let Z;if(i0.isPair($))Z=$;else if(!$||typeof $!=="object"||!("key"in $))Z=new r2.Pair($,$?.value);else Z=new r2.Pair($.key,$.value);let z=w1(this.items,Z.key),J=this.schema?.sortMapEntries;if(z){if(!X)throw Error(`Key ${Z.key} already set`);if(i0.isScalar(z.value)&&tQ.isScalarValue(Z.value))z.value.value=Z.value;else z.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 X=w1(this.items,$);if(!X)return!1;return this.items.splice(this.items.indexOf(X),1).length>0}get($,X){let z=w1(this.items,$)?.value;return(!X&&i0.isScalar(z)?z.value:z)??void 0}has($){return!!w1(this.items,$)}set($,X){this.add(new r2.Pair($,X),!0)}toJSON($,X,Z){let z=Z?new Z:X?.mapAsMap?new Map:{};if(X?.onCreate)X.onCreate(z);for(let J of this.items)aQ.addPairToJSMap(X,z,J);return z}toString($,X,Z){if(!$)return JSON.stringify(this);for(let z of this.items)if(!i0.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 sQ.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:Z,onComment:X})}}eQ.YAMLMap=v9;eQ.findPair=w1});var C$=D((JY)=>{var ZY=h(),u9=n0(),zY={collection:"map",default:!0,nodeClass:u9.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,X){if(!ZY.isMap($))X("Expected a mapping for this tag");return $},createNode:($,X,Z)=>u9.YAMLMap.from($,X,Z)};JY.map=zY});var r0=D((VY)=>{var YY=H1(),qY=L6(),WY=g2(),a2=h(),GY=Z0(),UY=d0();class m9 extends WY.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(a2.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let X=s2($);if(typeof X!=="number")return!1;return this.items.splice(X,1).length>0}get($,X){let Z=s2($);if(typeof Z!=="number")return;let z=this.items[Z];return!X&&a2.isScalar(z)?z.value:z}has($){let X=s2($);return typeof X==="number"&&X<this.items.length}set($,X){let Z=s2($);if(typeof Z!=="number")throw Error(`Expected a valid index, not ${$}.`);let z=this.items[Z];if(a2.isScalar(z)&&GY.isScalarValue(X))z.value=X;else this.items[Z]=X}toJSON($,X){let Z=[];if(X?.onCreate)X.onCreate(Z);let z=0;for(let J of this.items)Z.push(UY.toJS(J,String(z++),X));return Z}toString($,X,Z){if(!$)return JSON.stringify(this);return qY.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:Z,onComment:X})}static from($,X,Z){let{replacer:z}=Z,J=new this($);if(X&&Symbol.iterator in Object(X)){let Q=0;for(let Y of X){if(typeof z==="function"){let q=X instanceof Set?Y:String(Q++);Y=z.call(X,q,Y)}J.items.push(YY.createNode(Y,void 0,Z))}}return J}}function s2($){let X=a2.isScalar($)?$.value:$;if(X&&typeof X==="string")X=Number(X);return typeof X==="number"&&Number.isInteger(X)&&X>=0?X:null}VY.YAMLSeq=m9});var _$=D((TY)=>{var HY=h(),d9=r0(),NY={collection:"seq",default:!0,nodeClass:d9.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,X){if(!HY.isSeq($))X("Expected a sequence for this tag");return $},createNode:($,X,Z)=>d9.YAMLSeq.from($,X,Z)};TY.seq=NY});var D1=D((OY)=>{var LY=B1(),MY={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,X,Z,z){return X=Object.assign({actualString:!0},X),LY.stringifyString($,X,Z,z)}};OY.string=MY});var o2=D((DY)=>{var c9=Z0(),p9={identify:($)=>$==null,createNode:()=>new c9.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new c9.Scalar(null),stringify:({source:$},X)=>typeof $==="string"&&p9.test.test($)?$:X.options.nullStr};DY.nullTag=p9});var M6=D((IY)=>{var FY=Z0(),l9={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new FY.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:X},Z){if($&&l9.test.test($)){let z=$[0]==="t"||$[0]==="T";if(X===z)return $}return X?Z.options.trueStr:Z.options.falseStr}};IY.boolTag=l9});var S$=D((EY)=>{function PY({format:$,minFractionDigits:X,tag:Z,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(!$&&X&&(!Z||Z==="tag:yaml.org,2002:float")&&/^\d/.test(Q)){let Y=Q.indexOf(".");if(Y<0)Y=Q.length,Q+=".";let q=X-(Q.length-Y-1);while(q-- >0)Q+="0"}return Q}EY.stringifyNumber=PY});var w6=D((xY)=>{var _Y=Z0(),O6=S$(),SY={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:O6.stringifyNumber},jY={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 X=Number($.value);return isFinite(X)?X.toExponential():O6.stringifyNumber($)}},bY={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let X=new _Y.Scalar(parseFloat($)),Z=$.indexOf(".");if(Z!==-1&&$[$.length-1]==="0")X.minFractionDigits=$.length-Z-1;return X},stringify:O6.stringifyNumber};xY.float=bY;xY.floatExp=jY;xY.floatNaN=SY});var A6=D((uY)=>{var i9=S$(),t2=($)=>typeof $==="bigint"||Number.isInteger($),D6=($,X,Z,{intAsBigInt:z})=>z?BigInt($):parseInt($.substring(X),Z);function n9($,X,Z){let{value:z}=$;if(t2(z)&&z>=0)return Z+z.toString(X);return i9.stringifyNumber($)}var gY={identify:($)=>t2($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,X,Z)=>D6($,2,8,Z),stringify:($)=>n9($,8,"0o")},hY={identify:t2,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,X,Z)=>D6($,0,10,Z),stringify:i9.stringifyNumber},vY={identify:($)=>t2($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,X,Z)=>D6($,2,16,Z),stringify:($)=>n9($,16,"0x")};uY.int=hY;uY.intHex=vY;uY.intOct=gY});var r9=D((aY)=>{var pY=C$(),lY=o2(),iY=_$(),nY=D1(),rY=M6(),F6=w6(),I6=A6(),sY=[pY.map,iY.seq,nY.string,lY.nullTag,rY.boolTag,I6.intOct,I6.int,I6.intHex,F6.floatNaN,F6.floatExp,F6.float];aY.schema=sY});var a9=D((Jq)=>{var tY=Z0(),eY=C$(),$q=_$();function s9($){return typeof $==="bigint"||Number.isInteger($)}var e2=({value:$})=>JSON.stringify($),Xq=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:e2},{identify:($)=>$==null,createNode:()=>new tY.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:e2},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:e2},{identify:s9,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,X,{intAsBigInt:Z})=>Z?BigInt($):parseInt($,10),stringify:({value:$})=>s9($)?$.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:e2}],Zq={default:!0,tag:"",test:/^/,resolve($,X){return X(`Unresolved plain scalar ${JSON.stringify($)}`),$}},zq=[eY.map,$q.seq].concat(Xq,Zq);Jq.schema=zq});var P6=D((Wq)=>{var A1=B0("buffer"),R6=Z0(),Yq=B1(),qq={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,X){if(typeof A1.Buffer==="function")return A1.Buffer.from($,"base64");else if(typeof atob==="function"){let Z=atob($.replace(/[\n\r]/g,"")),z=new Uint8Array(Z.length);for(let J=0;J<Z.length;++J)z[J]=Z.charCodeAt(J);return z}else return X("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:X,value:Z},z,J,Q){if(!Z)return"";let Y=Z,q;if(typeof A1.Buffer==="function")q=Y instanceof A1.Buffer?Y.toString("base64"):A1.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(X??(X=R6.Scalar.BLOCK_LITERAL),X!==R6.Scalar.QUOTE_DOUBLE){let W=Math.max(z.options.lineWidth-z.indent.length,z.options.minContentWidth),G=Math.ceil(q.length/W),U=Array(G);for(let K=0,V=0;K<G;++K,V+=W)U[K]=q.substr(V,W);q=U.join(X===R6.Scalar.BLOCK_LITERAL?`
78
- `:" ")}return Yq.stringifyString({comment:$,type:X,value:q},z,J,Q)}};Wq.binary=qq});var X4=D((Hq)=>{var $4=h(),E6=l0(),Uq=Z0(),Vq=r0();function o9($,X){if($4.isSeq($))for(let Z=0;Z<$.items.length;++Z){let z=$.items[Z];if($4.isPair(z))continue;else if($4.isMap(z)){if(z.items.length>1)X("Each pair must have its own sequence indicator");let J=z.items[0]||new E6.Pair(new Uq.Scalar(null));if(z.commentBefore)J.key.commentBefore=J.key.commentBefore?`${z.commentBefore}
77
+ ${J}${T}`}else return`${V}${Y}${K.join(" ")}${Y}${T}`}}function n2({indent:$,options:{commentString:Z}},X,z,J){if(z&&J)z=z.replace(/^\n+/,"");if(z){let Q=i2.indentComment(Z(z),$);X.push(Q.trimStart())}}rQ.stringifyCollection=lQ});var n0=D(($Y)=>{var aQ=L6(),oQ=B6(),tQ=g2(),i0=h(),r2=l0(),eQ=X0();function w1($,Z){let X=i0.isScalar(Z)?Z.value:Z;for(let z of $)if(i0.isPair(z)){if(z.key===Z||z.key===X)return z;if(i0.isScalar(z.key)&&z.key.value===X)return z}return}class v9 extends tQ.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(i0.MAP,$);this.items=[]}static from($,Z,X){let{keepUndefined:z,replacer:J}=X,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||z)Q.items.push(r2.createPair(q,W,X))};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 X;if(i0.isPair($))X=$;else if(!$||typeof $!=="object"||!("key"in $))X=new r2.Pair($,$?.value);else X=new r2.Pair($.key,$.value);let z=w1(this.items,X.key),J=this.schema?.sortMapEntries;if(z){if(!Z)throw Error(`Key ${X.key} already set`);if(i0.isScalar(z.value)&&eQ.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=w1(this.items,$);if(!Z)return!1;return this.items.splice(this.items.indexOf(Z),1).length>0}get($,Z){let z=w1(this.items,$)?.value;return(!Z&&i0.isScalar(z)?z.value:z)??void 0}has($){return!!w1(this.items,$)}set($,Z){this.add(new r2.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)oQ.addPairToJSMap(Z,z,J);return z}toString($,Z,X){if(!$)return JSON.stringify(this);for(let z of this.items)if(!i0.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 aQ.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:X,onComment:Z})}}$Y.YAMLMap=v9;$Y.findPair=w1});var C$=D((QY)=>{var zY=h(),u9=n0(),JY={collection:"map",default:!0,nodeClass:u9.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,Z){if(!zY.isMap($))Z("Expected a mapping for this tag");return $},createNode:($,Z,X)=>u9.YAMLMap.from($,Z,X)};QY.map=JY});var r0=D((KY)=>{var qY=H1(),WY=L6(),GY=g2(),a2=h(),UY=X0(),VY=d0();class m9 extends GY.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(a2.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let Z=s2($);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get($,Z){let X=s2($);if(typeof X!=="number")return;let z=this.items[X];return!Z&&a2.isScalar(z)?z.value:z}has($){let Z=s2($);return typeof Z==="number"&&Z<this.items.length}set($,Z){let X=s2($);if(typeof X!=="number")throw Error(`Expected a valid index, not ${$}.`);let z=this.items[X];if(a2.isScalar(z)&&UY.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(VY.toJS(J,String(z++),Z));return X}toString($,Z,X){if(!$)return JSON.stringify(this);return WY.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(qY.createNode(Y,void 0,X))}}return J}}function s2($){let Z=a2.isScalar($)?$.value:$;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}KY.YAMLSeq=m9});var _$=D((BY)=>{var NY=h(),d9=r0(),TY={collection:"seq",default:!0,nodeClass:d9.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,Z){if(!NY.isSeq($))Z("Expected a sequence for this tag");return $},createNode:($,Z,X)=>d9.YAMLSeq.from($,Z,X)};BY.seq=TY});var D1=D((wY)=>{var MY=B1(),OY={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,Z,X,z){return Z=Object.assign({actualString:!0},Z),MY.stringifyString($,Z,X,z)}};wY.string=OY});var o2=D((AY)=>{var c9=X0(),p9={identify:($)=>$==null,createNode:()=>new c9.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new c9.Scalar(null),stringify:({source:$},Z)=>typeof $==="string"&&p9.test.test($)?$:Z.options.nullStr};AY.nullTag=p9});var M6=D((RY)=>{var IY=X0(),l9={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new IY.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:Z},X){if($&&l9.test.test($)){let z=$[0]==="t"||$[0]==="T";if(Z===z)return $}return Z?X.options.trueStr:X.options.falseStr}};RY.boolTag=l9});var S$=D((CY)=>{function EY({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}CY.stringifyNumber=EY});var w6=D((fY)=>{var SY=X0(),O6=S$(),jY={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:O6.stringifyNumber},bY={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():O6.stringifyNumber($)}},xY={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let Z=new SY.Scalar(parseFloat($)),X=$.indexOf(".");if(X!==-1&&$[$.length-1]==="0")Z.minFractionDigits=$.length-X-1;return Z},stringify:O6.stringifyNumber};fY.float=xY;fY.floatExp=bY;fY.floatNaN=jY});var A6=D((mY)=>{var i9=S$(),t2=($)=>typeof $==="bigint"||Number.isInteger($),D6=($,Z,X,{intAsBigInt:z})=>z?BigInt($):parseInt($.substring(Z),X);function n9($,Z,X){let{value:z}=$;if(t2(z)&&z>=0)return X+z.toString(Z);return i9.stringifyNumber($)}var hY={identify:($)=>t2($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,Z,X)=>D6($,2,8,X),stringify:($)=>n9($,8,"0o")},vY={identify:t2,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,Z,X)=>D6($,0,10,X),stringify:i9.stringifyNumber},uY={identify:($)=>t2($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,Z,X)=>D6($,2,16,X),stringify:($)=>n9($,16,"0x")};mY.int=vY;mY.intHex=uY;mY.intOct=hY});var r9=D((oY)=>{var lY=C$(),iY=o2(),nY=_$(),rY=D1(),sY=M6(),F6=w6(),I6=A6(),aY=[lY.map,nY.seq,rY.string,iY.nullTag,sY.boolTag,I6.intOct,I6.int,I6.intHex,F6.floatNaN,F6.floatExp,F6.float];oY.schema=aY});var a9=D((Qq)=>{var eY=X0(),$q=C$(),Zq=_$();function s9($){return typeof $==="bigint"||Number.isInteger($)}var e2=({value:$})=>JSON.stringify($),Xq=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:e2},{identify:($)=>$==null,createNode:()=>new eY.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:e2},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:e2},{identify:s9,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,Z,{intAsBigInt:X})=>X?BigInt($):parseInt($,10),stringify:({value:$})=>s9($)?$.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:e2}],zq={default:!0,tag:"",test:/^/,resolve($,Z){return Z(`Unresolved plain scalar ${JSON.stringify($)}`),$}},Jq=[$q.map,Zq.seq].concat(Xq,zq);Qq.schema=Jq});var P6=D((Gq)=>{var A1=B0("buffer"),R6=X0(),qq=B1(),Wq={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,Z){if(typeof A1.Buffer==="function")return A1.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 A1.Buffer==="function")q=Y instanceof A1.Buffer?Y.toString("base64"):A1.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=R6.Scalar.BLOCK_LITERAL),Z!==R6.Scalar.QUOTE_DOUBLE){let W=Math.max(z.options.lineWidth-z.indent.length,z.options.minContentWidth),G=Math.ceil(q.length/W),U=Array(G);for(let K=0,V=0;K<G;++K,V+=W)U[K]=q.substr(V,W);q=U.join(Z===R6.Scalar.BLOCK_LITERAL?`
78
+ `:" ")}return qq.stringifyString({comment:$,type:Z,value:q},z,J,Q)}};Gq.binary=Wq});var Z4=D((Nq)=>{var $4=h(),E6=l0(),Vq=X0(),Kq=r0();function o9($,Z){if($4.isSeq($))for(let X=0;X<$.items.length;++X){let z=$.items[X];if($4.isPair(z))continue;else if($4.isMap(z)){if(z.items.length>1)Z("Each pair must have its own sequence indicator");let J=z.items[0]||new E6.Pair(new Vq.Scalar(null));if(z.commentBefore)J.key.commentBefore=J.key.commentBefore?`${z.commentBefore}
79
79
  ${J.key.commentBefore}`:z.commentBefore;if(z.comment){let Q=J.value??J.key;Q.comment=Q.comment?`${z.comment}
80
- ${Q.comment}`:z.comment}z=J}$.items[Z]=$4.isPair(z)?z:new E6.Pair(z)}else X("Expected a sequence for this tag");return $}function t9($,X,Z){let{replacer:z}=Z,J=new Vq.YAMLSeq($);J.tag="tag:yaml.org,2002:pairs";let Q=0;if(X&&Symbol.iterator in Object(X))for(let Y of X){if(typeof z==="function")Y=z.call(X,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(E6.createPair(q,W,Z))}return J}var Kq={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:o9,createNode:t9};Hq.createPairs=t9;Hq.pairs=Kq;Hq.resolvePairs=o9});var _6=D((Oq)=>{var e9=h(),C6=d0(),F1=n0(),Lq=r0(),$X=X4();class U$ extends Lq.YAMLSeq{constructor(){super();this.add=F1.YAMLMap.prototype.add.bind(this),this.delete=F1.YAMLMap.prototype.delete.bind(this),this.get=F1.YAMLMap.prototype.get.bind(this),this.has=F1.YAMLMap.prototype.has.bind(this),this.set=F1.YAMLMap.prototype.set.bind(this),this.tag=U$.tag}toJSON($,X){if(!X)return super.toJSON($);let Z=new Map;if(X?.onCreate)X.onCreate(Z);for(let z of this.items){let J,Q;if(e9.isPair(z))J=C6.toJS(z.key,"",X),Q=C6.toJS(z.value,J,X);else J=C6.toJS(z,"",X);if(Z.has(J))throw Error("Ordered maps must not include duplicate keys");Z.set(J,Q)}return Z}static from($,X,Z){let z=$X.createPairs($,X,Z),J=new this;return J.items=z.items,J}}U$.tag="tag:yaml.org,2002:omap";var Mq={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:U$,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,X){let Z=$X.resolvePairs($,X),z=[];for(let{key:J}of Z.items)if(e9.isScalar(J))if(z.includes(J.value))X(`Ordered maps must not include duplicate keys: ${J.value}`);else z.push(J.value);return Object.assign(new U$,Z)},createNode:($,X,Z)=>U$.from($,X,Z)};Oq.YAMLOMap=U$;Oq.omap=Mq});var QX=D((Aq)=>{var XX=Z0();function ZX({value:$,source:X},Z){if(X&&($?zX:JX).test.test(X))return X;return $?Z.options.trueStr:Z.options.falseStr}var zX={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new XX.Scalar(!0),stringify:ZX},JX={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new XX.Scalar(!1),stringify:ZX};Aq.falseTag=JX;Aq.trueTag=zX});var YX=D((_q)=>{var Rq=Z0(),S6=S$(),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:S6.stringifyNumber},Eq={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 X=Number($.value);return isFinite(X)?X.toExponential():S6.stringifyNumber($)}},Cq={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let X=new Rq.Scalar(parseFloat($.replace(/_/g,""))),Z=$.indexOf(".");if(Z!==-1){let z=$.substring(Z+1).replace(/_/g,"");if(z[z.length-1]==="0")X.minFractionDigits=z.length}return X},stringify:S6.stringifyNumber};_q.float=Cq;_q.floatExp=Eq;_q.floatNaN=Pq});var WX=D((gq)=>{var qX=S$(),I1=($)=>typeof $==="bigint"||Number.isInteger($);function Z4($,X,Z,{intAsBigInt:z}){let J=$[0];if(J==="-"||J==="+")X+=1;if($=$.substring(X).replace(/_/g,""),z){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 j6($,X,Z){let{value:z}=$;if(I1(z)){let J=z.toString(X);return z<0?"-"+Z+J.substr(1):Z+J}return qX.stringifyNumber($)}var xq={identify:I1,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,X,Z)=>Z4($,2,2,Z),stringify:($)=>j6($,2,"0b")},fq={identify:I1,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,X,Z)=>Z4($,1,8,Z),stringify:($)=>j6($,8,"0")},kq={identify:I1,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,X,Z)=>Z4($,0,10,Z),stringify:qX.stringifyNumber},yq={identify:I1,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,X,Z)=>Z4($,2,16,Z),stringify:($)=>j6($,16,"0x")};gq.int=kq;gq.intBin=xq;gq.intHex=yq;gq.intOct=fq});var b6=D((cq)=>{var Q4=h(),z4=l0(),J4=n0();class V$ extends J4.YAMLMap{constructor($){super($);this.tag=V$.tag}add($){let X;if(Q4.isPair($))X=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)X=new z4.Pair($.key,null);else X=new z4.Pair($,null);if(!J4.findPair(this.items,X.key))this.items.push(X)}get($,X){let Z=J4.findPair(this.items,$);return!X&&Q4.isPair(Z)?Q4.isScalar(Z.key)?Z.key.value:Z.key:Z}set($,X){if(typeof X!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof X}`);let Z=J4.findPair(this.items,$);if(Z&&!X)this.items.splice(this.items.indexOf(Z),1);else if(!Z&&X)this.items.push(new z4.Pair($))}toJSON($,X){return super.toJSON($,X,Set)}toString($,X,Z){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),X,Z);else throw Error("Set items must all have null values")}static from($,X,Z){let{replacer:z}=Z,J=new this($);if(X&&Symbol.iterator in Object(X))for(let Q of X){if(typeof z==="function")Q=z.call(X,Q,Q);J.items.push(z4.createPair(Q,null,Z))}return J}}V$.tag="tag:yaml.org,2002:set";var dq={collection:"map",identify:($)=>$ instanceof Set,nodeClass:V$,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,X,Z)=>V$.from($,X,Z),resolve($,X){if(Q4.isMap($))if($.hasAllNullValues(!0))return Object.assign(new V$,$);else X("Set items must all have null values");else X("Expected a mapping for this tag");return $}};cq.YAMLSet=V$;cq.set=dq});var f6=D((sq)=>{var iq=S$();function x6($,X){let Z=$[0],z=Z==="-"||Z==="+"?$.substring(1):$,J=(Y)=>X?BigInt(Y):Number(Y),Q=z.replace(/_/g,"").split(":").reduce((Y,q)=>Y*J(60)+J(q),J(0));return Z==="-"?J(-1)*Q:Q}function GX($){let{value:X}=$,Z=(Y)=>Y;if(typeof X==="bigint")Z=(Y)=>BigInt(Y);else if(isNaN(X)||!isFinite(X))return iq.stringifyNumber($);let z="";if(X<0)z="-",X*=Z(-1);let J=Z(60),Q=[X%J];if(X<60)Q.unshift(0);else if(X=(X-Q[0])/J,Q.unshift(X%J),X>=60)X=(X-Q[0])/J,Q.unshift(X);return z+Q.map((Y)=>String(Y).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var nq={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:($,X,{intAsBigInt:Z})=>x6($,Z),stringify:GX},rq={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:($)=>x6($,!1),stringify:GX},UX={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 X=$.match(UX.test);if(!X)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,Z,z,J,Q,Y,q]=X.map(Number),W=X[7]?Number((X[7]+"00").substr(1,3)):0,G=Date.UTC(Z,z-1,J,Q||0,Y||0,q||0,W),U=X[8];if(U&&U!=="Z"){let K=x6(U,!1);if(Math.abs(K)<30)K*=60;G-=60000*K}return new Date(G)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};sq.floatTime=rq;sq.intTime=nq;sq.timestamp=UX});var KX=D((GW)=>{var eq=C$(),$W=o2(),XW=_$(),ZW=D1(),zW=P6(),VX=QX(),k6=YX(),Y4=WX(),JW=c2(),QW=_6(),YW=X4(),qW=b6(),y6=f6(),WW=[eq.map,XW.seq,ZW.string,$W.nullTag,VX.trueTag,VX.falseTag,Y4.intBin,Y4.intOct,Y4.int,Y4.intHex,k6.floatNaN,k6.floatExp,k6.float,zW.binary,JW.merge,QW.omap,YW.pairs,qW.set,y6.intTime,y6.floatTime,y6.timestamp];GW.schema=WW});var AX=D((MW)=>{var BX=C$(),VW=o2(),LX=_$(),KW=D1(),HW=M6(),g6=w6(),h6=A6(),NW=r9(),TW=a9(),MX=P6(),R1=c2(),OX=_6(),wX=X4(),HX=KX(),DX=b6(),q4=f6(),NX=new Map([["core",NW.schema],["failsafe",[BX.map,LX.seq,KW.string]],["json",TW.schema],["yaml11",HX.schema],["yaml-1.1",HX.schema]]),TX={binary:MX.binary,bool:HW.boolTag,float:g6.float,floatExp:g6.floatExp,floatNaN:g6.floatNaN,floatTime:q4.floatTime,int:h6.int,intHex:h6.intHex,intOct:h6.intOct,intTime:q4.intTime,map:BX.map,merge:R1.merge,null:VW.nullTag,omap:OX.omap,pairs:wX.pairs,seq:LX.seq,set:DX.set,timestamp:q4.timestamp},BW={"tag:yaml.org,2002:binary":MX.binary,"tag:yaml.org,2002:merge":R1.merge,"tag:yaml.org,2002:omap":OX.omap,"tag:yaml.org,2002:pairs":wX.pairs,"tag:yaml.org,2002:set":DX.set,"tag:yaml.org,2002:timestamp":q4.timestamp};function LW($,X,Z){let z=NX.get(X);if(z&&!$)return Z&&!z.includes(R1.merge)?z.concat(R1.merge):z.slice();let J=z;if(!J)if(Array.isArray($))J=[];else{let Q=Array.from(NX.keys()).filter((Y)=>Y!=="yaml11").map((Y)=>JSON.stringify(Y)).join(", ");throw Error(`Unknown schema "${X}"; 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(R1.merge);return J.reduce((Q,Y)=>{let q=typeof Y==="string"?TX[Y]:Y;if(!q){let W=JSON.stringify(Y),G=Object.keys(TX).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},[])}MW.coreKnownTags=BW;MW.getTags=LW});var m6=D((RW)=>{var v6=h(),DW=C$(),AW=_$(),FW=D1(),W4=AX(),IW=($,X)=>$.key<X.key?-1:$.key>X.key?1:0;class u6{constructor({compat:$,customTags:X,merge:Z,resolveKnownTags:z,schema:J,sortMapEntries:Q,toStringDefaults:Y}){this.compat=Array.isArray($)?W4.getTags($,"compat"):$?W4.getTags(null,$):null,this.name=typeof J==="string"&&J||"core",this.knownTags=z?W4.coreKnownTags:{},this.tags=W4.getTags(X,this.name,Z),this.toStringOptions=Y??null,Object.defineProperty(this,v6.MAP,{value:DW.map}),Object.defineProperty(this,v6.SCALAR,{value:FW.string}),Object.defineProperty(this,v6.SEQ,{value:AW.seq}),this.sortMapEntries=typeof Q==="function"?Q:Q===!0?IW:null}clone(){let $=Object.create(u6.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}RW.Schema=u6});var FX=D((_W)=>{var EW=h(),d6=L1(),P1=N1();function CW($,X){let Z=[],z=X.directives===!0;if(X.directives!==!1&&$.directives){let W=$.directives.toString($);if(W)Z.push(W),z=!0;else if($.directives.docStart)z=!0}if(z)Z.push("---");let J=d6.createStringifyContext($,X),{commentString:Q}=J.options;if($.commentBefore){if(Z.length!==1)Z.unshift("");let W=Q($.commentBefore);Z.unshift(P1.indentComment(W,""))}let Y=!1,q=null;if($.contents){if(EW.isNode($.contents)){if($.contents.spaceBefore&&z)Z.push("");if($.contents.commentBefore){let U=Q($.contents.commentBefore);Z.push(P1.indentComment(U,""))}J.forceBlockIndent=!!$.comment,q=$.contents.comment}let W=q?void 0:()=>Y=!0,G=d6.stringify($.contents,J,()=>q=null,W);if(q)G+=P1.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(d6.stringify($.contents,J));if($.directives?.docEnd)if($.comment){let W=Q($.comment);if(W.includes(`
81
- `))Z.push("..."),Z.push(P1.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(P1.indentComment(Q(W),""))}}return Z.join(`
80
+ ${Q.comment}`:z.comment}z=J}$.items[X]=$4.isPair(z)?z:new E6.Pair(z)}else Z("Expected a sequence for this tag");return $}function t9($,Z,X){let{replacer:z}=X,J=new Kq.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,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(E6.createPair(q,W,X))}return J}var Hq={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:o9,createNode:t9};Nq.createPairs=t9;Nq.pairs=Hq;Nq.resolvePairs=o9});var _6=D((wq)=>{var e9=h(),C6=d0(),F1=n0(),Mq=r0(),$Z=Z4();class U$ extends Mq.YAMLSeq{constructor(){super();this.add=F1.YAMLMap.prototype.add.bind(this),this.delete=F1.YAMLMap.prototype.delete.bind(this),this.get=F1.YAMLMap.prototype.get.bind(this),this.has=F1.YAMLMap.prototype.has.bind(this),this.set=F1.YAMLMap.prototype.set.bind(this),this.tag=U$.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(e9.isPair(z))J=C6.toJS(z.key,"",Z),Q=C6.toJS(z.value,J,Z);else J=C6.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=$Z.createPairs($,Z,X),J=new this;return J.items=z.items,J}}U$.tag="tag:yaml.org,2002:omap";var Oq={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:U$,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,Z){let X=$Z.resolvePairs($,Z),z=[];for(let{key:J}of X.items)if(e9.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 U$,X)},createNode:($,Z,X)=>U$.from($,Z,X)};wq.YAMLOMap=U$;wq.omap=Oq});var QZ=D((Fq)=>{var ZZ=X0();function XZ({value:$,source:Z},X){if(Z&&($?zZ:JZ).test.test(Z))return Z;return $?X.options.trueStr:X.options.falseStr}var zZ={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ZZ.Scalar(!0),stringify:XZ},JZ={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ZZ.Scalar(!1),stringify:XZ};Fq.falseTag=JZ;Fq.trueTag=zZ});var YZ=D((Sq)=>{var Pq=X0(),S6=S$(),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:S6.stringifyNumber},Cq={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():S6.stringifyNumber($)}},_q={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let Z=new Pq.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:S6.stringifyNumber};Sq.float=_q;Sq.floatExp=Cq;Sq.floatNaN=Eq});var WZ=D((hq)=>{var qZ=S$(),I1=($)=>typeof $==="bigint"||Number.isInteger($);function X4($,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 j6($,Z,X){let{value:z}=$;if(I1(z)){let J=z.toString(Z);return z<0?"-"+X+J.substr(1):X+J}return qZ.stringifyNumber($)}var fq={identify:I1,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,Z,X)=>X4($,2,2,X),stringify:($)=>j6($,2,"0b")},kq={identify:I1,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,Z,X)=>X4($,1,8,X),stringify:($)=>j6($,8,"0")},yq={identify:I1,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,Z,X)=>X4($,0,10,X),stringify:qZ.stringifyNumber},gq={identify:I1,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,Z,X)=>X4($,2,16,X),stringify:($)=>j6($,16,"0x")};hq.int=yq;hq.intBin=fq;hq.intHex=gq;hq.intOct=kq});var b6=D((pq)=>{var Q4=h(),z4=l0(),J4=n0();class V$ extends J4.YAMLMap{constructor($){super($);this.tag=V$.tag}add($){let Z;if(Q4.isPair($))Z=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)Z=new z4.Pair($.key,null);else Z=new z4.Pair($,null);if(!J4.findPair(this.items,Z.key))this.items.push(Z)}get($,Z){let X=J4.findPair(this.items,$);return!Z&&Q4.isPair(X)?Q4.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=J4.findPair(this.items,$);if(X&&!Z)this.items.splice(this.items.indexOf(X),1);else if(!X&&Z)this.items.push(new z4.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(z4.createPair(Q,null,X))}return J}}V$.tag="tag:yaml.org,2002:set";var cq={collection:"map",identify:($)=>$ instanceof Set,nodeClass:V$,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,Z,X)=>V$.from($,Z,X),resolve($,Z){if(Q4.isMap($))if($.hasAllNullValues(!0))return Object.assign(new V$,$);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return $}};pq.YAMLSet=V$;pq.set=cq});var f6=D((aq)=>{var nq=S$();function x6($,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 GZ($){let{value:Z}=$,X=(Y)=>Y;if(typeof Z==="bigint")X=(Y)=>BigInt(Y);else if(isNaN(Z)||!isFinite(Z))return nq.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 rq={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})=>x6($,X),stringify:GZ},sq={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:($)=>x6($,!1),stringify:GZ},UZ={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(UZ.test);if(!Z)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,X,z,J,Q,Y,q]=Z.map(Number),W=Z[7]?Number((Z[7]+"00").substr(1,3)):0,G=Date.UTC(X,z-1,J,Q||0,Y||0,q||0,W),U=Z[8];if(U&&U!=="Z"){let K=x6(U,!1);if(Math.abs(K)<30)K*=60;G-=60000*K}return new Date(G)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};aq.floatTime=sq;aq.intTime=rq;aq.timestamp=UZ});var KZ=D((UW)=>{var $W=C$(),ZW=o2(),XW=_$(),zW=D1(),JW=P6(),VZ=QZ(),k6=YZ(),Y4=WZ(),QW=c2(),YW=_6(),qW=Z4(),WW=b6(),y6=f6(),GW=[$W.map,XW.seq,zW.string,ZW.nullTag,VZ.trueTag,VZ.falseTag,Y4.intBin,Y4.intOct,Y4.int,Y4.intHex,k6.floatNaN,k6.floatExp,k6.float,JW.binary,QW.merge,YW.omap,qW.pairs,WW.set,y6.intTime,y6.floatTime,y6.timestamp];UW.schema=GW});var AZ=D((OW)=>{var BZ=C$(),KW=o2(),LZ=_$(),HW=D1(),NW=M6(),g6=w6(),h6=A6(),TW=r9(),BW=a9(),MZ=P6(),R1=c2(),OZ=_6(),wZ=Z4(),HZ=KZ(),DZ=b6(),q4=f6(),NZ=new Map([["core",TW.schema],["failsafe",[BZ.map,LZ.seq,HW.string]],["json",BW.schema],["yaml11",HZ.schema],["yaml-1.1",HZ.schema]]),TZ={binary:MZ.binary,bool:NW.boolTag,float:g6.float,floatExp:g6.floatExp,floatNaN:g6.floatNaN,floatTime:q4.floatTime,int:h6.int,intHex:h6.intHex,intOct:h6.intOct,intTime:q4.intTime,map:BZ.map,merge:R1.merge,null:KW.nullTag,omap:OZ.omap,pairs:wZ.pairs,seq:LZ.seq,set:DZ.set,timestamp:q4.timestamp},LW={"tag:yaml.org,2002:binary":MZ.binary,"tag:yaml.org,2002:merge":R1.merge,"tag:yaml.org,2002:omap":OZ.omap,"tag:yaml.org,2002:pairs":wZ.pairs,"tag:yaml.org,2002:set":DZ.set,"tag:yaml.org,2002:timestamp":q4.timestamp};function MW($,Z,X){let z=NZ.get(Z);if(z&&!$)return X&&!z.includes(R1.merge)?z.concat(R1.merge):z.slice();let J=z;if(!J)if(Array.isArray($))J=[];else{let Q=Array.from(NZ.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(R1.merge);return J.reduce((Q,Y)=>{let q=typeof Y==="string"?TZ[Y]:Y;if(!q){let W=JSON.stringify(Y),G=Object.keys(TZ).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},[])}OW.coreKnownTags=LW;OW.getTags=MW});var m6=D((PW)=>{var v6=h(),AW=C$(),FW=_$(),IW=D1(),W4=AZ(),RW=($,Z)=>$.key<Z.key?-1:$.key>Z.key?1:0;class u6{constructor({compat:$,customTags:Z,merge:X,resolveKnownTags:z,schema:J,sortMapEntries:Q,toStringDefaults:Y}){this.compat=Array.isArray($)?W4.getTags($,"compat"):$?W4.getTags(null,$):null,this.name=typeof J==="string"&&J||"core",this.knownTags=z?W4.coreKnownTags:{},this.tags=W4.getTags(Z,this.name,X),this.toStringOptions=Y??null,Object.defineProperty(this,v6.MAP,{value:AW.map}),Object.defineProperty(this,v6.SCALAR,{value:IW.string}),Object.defineProperty(this,v6.SEQ,{value:FW.seq}),this.sortMapEntries=typeof Q==="function"?Q:Q===!0?RW:null}clone(){let $=Object.create(u6.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}PW.Schema=u6});var FZ=D((SW)=>{var CW=h(),d6=L1(),P1=N1();function _W($,Z){let X=[],z=Z.directives===!0;if(Z.directives!==!1&&$.directives){let W=$.directives.toString($);if(W)X.push(W),z=!0;else if($.directives.docStart)z=!0}if(z)X.push("---");let J=d6.createStringifyContext($,Z),{commentString:Q}=J.options;if($.commentBefore){if(X.length!==1)X.unshift("");let W=Q($.commentBefore);X.unshift(P1.indentComment(W,""))}let Y=!1,q=null;if($.contents){if(CW.isNode($.contents)){if($.contents.spaceBefore&&z)X.push("");if($.contents.commentBefore){let U=Q($.contents.commentBefore);X.push(P1.indentComment(U,""))}J.forceBlockIndent=!!$.comment,q=$.contents.comment}let W=q?void 0:()=>Y=!0,G=d6.stringify($.contents,J,()=>q=null,W);if(q)G+=P1.lineComment(G,"",Q(q));if((G[0]==="|"||G[0]===">")&&X[X.length-1]==="---")X[X.length-1]=`--- ${G}`;else X.push(G)}else X.push(d6.stringify($.contents,J));if($.directives?.docEnd)if($.comment){let W=Q($.comment);if(W.includes(`
81
+ `))X.push("..."),X.push(P1.indentComment(W,""));else X.push(`... ${W}`)}else X.push("...");else{let W=$.comment;if(W&&Y)W=W.replace(/^\n+/,"");if(W){if((!Y||q)&&X[X.length-1]!=="")X.push("");X.push(P1.indentComment(Q(W),""))}}return X.join(`
82
82
  `)+`
83
- `}_W.stringifyDocument=CW});var E1=D((hW)=>{var jW=K1(),j$=g2(),I0=h(),bW=l0(),xW=d0(),fW=m6(),kW=FX(),c6=f2(),yW=W6(),gW=H1(),p6=q6();class l6{constructor($,X,Z){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,I0.NODE_TYPE,{value:I0.DOC});let z=null;if(typeof X==="function"||Array.isArray(X))z=X;else if(Z===void 0&&X)Z=X,X=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 p6.Directives({version:Q});this.setSchema(Q,Z),this.contents=$===void 0?null:this.createNode($,z,Z)}clone(){let $=Object.create(l6.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(b$(this.contents))this.contents.add($)}addIn($,X){if(b$(this.contents))this.contents.addIn($,X)}createAlias($,X){if(!$.anchor){let Z=c6.anchorNames(this);$.anchor=!X||Z.has(X)?c6.findNewAnchor(X||"a",Z):X}return new jW.Alias($.anchor)}createNode($,X,Z){let z=void 0;if(typeof X==="function")$=X.call({"":$},"",$),z=X;else if(Array.isArray(X)){let N=(I)=>typeof I==="number"||I instanceof String||I instanceof Number,L=X.filter(N).map(String);if(L.length>0)X=X.concat(L);z=X}else if(Z===void 0&&X)Z=X,X=void 0;let{aliasDuplicateObjects:J,anchorPrefix:Q,flow:Y,keepUndefined:q,onTagObj:W,tag:G}=Z??{},{onAnchor:U,setAnchors:K,sourceObjects:V}=c6.createNodeAnchors(this,Q||"a"),T={aliasDuplicateObjects:J??!0,keepUndefined:q??!1,onAnchor:U,onTagObj:W,replacer:z,schema:this.schema,sourceObjects:V},O=gW.createNode($,G,T);if(Y&&I0.isCollection(O))O.flow=!0;return K(),O}createPair($,X,Z={}){let z=this.createNode($,null,Z),J=this.createNode(X,null,Z);return new bW.Pair(z,J)}delete($){return b$(this.contents)?this.contents.delete($):!1}deleteIn($){if(j$.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return b$(this.contents)?this.contents.deleteIn($):!1}get($,X){return I0.isCollection(this.contents)?this.contents.get($,X):void 0}getIn($,X){if(j$.isEmptyPath($))return!X&&I0.isScalar(this.contents)?this.contents.value:this.contents;return I0.isCollection(this.contents)?this.contents.getIn($,X):void 0}has($){return I0.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(j$.isEmptyPath($))return this.contents!==void 0;return I0.isCollection(this.contents)?this.contents.hasIn($):!1}set($,X){if(this.contents==null)this.contents=j$.collectionFromPath(this.schema,[$],X);else if(b$(this.contents))this.contents.set($,X)}setIn($,X){if(j$.isEmptyPath($))this.contents=X;else if(this.contents==null)this.contents=j$.collectionFromPath(this.schema,Array.from($),X);else if(b$(this.contents))this.contents.setIn($,X)}setSchema($,X={}){if(typeof $==="number")$=String($);let Z;switch($){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new p6.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 p6.Directives({version:$});Z={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;Z=null;break;default:{let z=JSON.stringify($);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${z}`)}}if(X.schema instanceof Object)this.schema=X.schema;else if(Z)this.schema=new fW.Schema(Object.assign(Z,X));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:$,jsonArg:X,mapAsMap:Z,maxAliasCount:z,onAnchor:J,reviver:Q}={}){let Y={anchors:new Map,doc:this,keep:!$,mapAsMap:Z===!0,mapKeyWarned:!1,maxAliasCount:typeof z==="number"?z:100},q=xW.toJS(this.contents,X??"",Y);if(typeof J==="function")for(let{count:W,res:G}of Y.anchors.values())J(G,W);return typeof Q==="function"?yW.applyReviver(Q,{"":q},"",q):q}toJSON($,X){return this.toJS({json:!0,jsonArg:$,mapAsMap:!1,onAnchor:X})}toString($={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in $&&(!Number.isInteger($.indent)||Number($.indent)<=0)){let X=JSON.stringify($.indent);throw Error(`"indent" option must be a positive integer, not ${X}`)}return kW.stringifyDocument(this,$)}}function b$($){if(I0.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}hW.Document=l6});var C1=D((mW)=>{class G4 extends Error{constructor($,X,Z,z){super();this.name=$,this.code=Z,this.message=z,this.pos=X}}class IX extends G4{constructor($,X,Z){super("YAMLParseError",$,X,Z)}}class RX extends G4{constructor($,X,Z){super("YAMLWarning",$,X,Z)}}var uW=($,X)=>(Z)=>{if(Z.pos[0]===-1)return;Z.linePos=Z.pos.map((q)=>X.linePos(q));let{line:z,col:J}=Z.linePos[0];Z.message+=` at line ${z}, column ${J}`;let Q=J-1,Y=$.substring(X.lineStarts[z-1],X.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(X.lineStarts[z-2],X.lineStarts[z-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===z&&W.col>J)q=Math.max(1,Math.min(W.col-J,80-Q));let G=" ".repeat(Q)+"^".repeat(q);Z.message+=`:
83
+ `}SW.stringifyDocument=_W});var E1=D((vW)=>{var bW=K1(),j$=g2(),I0=h(),xW=l0(),fW=d0(),kW=m6(),yW=FZ(),c6=f2(),gW=W6(),hW=H1(),p6=q6();class l6{constructor($,Z,X){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,I0.NODE_TYPE,{value:I0.DOC});let z=null;if(typeof Z==="function"||Array.isArray(Z))z=Z;else if(X===void 0&&Z)X=Z,Z=void 0;let J=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},X);this.options=J;let{version:Q}=J;if(X?._directives){if(this.directives=X._directives.atDocument(),this.directives.yaml.explicit)Q=this.directives.yaml.version}else this.directives=new p6.Directives({version:Q});this.setSchema(Q,X),this.contents=$===void 0?null:this.createNode($,z,X)}clone(){let $=Object.create(l6.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(b$(this.contents))this.contents.add($)}addIn($,Z){if(b$(this.contents))this.contents.addIn($,Z)}createAlias($,Z){if(!$.anchor){let X=c6.anchorNames(this);$.anchor=!Z||X.has(Z)?c6.findNewAnchor(Z||"a",X):Z}return new bW.Alias($.anchor)}createNode($,Z,X){let z=void 0;if(typeof Z==="function")$=Z.call({"":$},"",$),z=Z;else if(Array.isArray(Z)){let N=(R)=>typeof R==="number"||R instanceof String||R instanceof Number,L=Z.filter(N).map(String);if(L.length>0)Z=Z.concat(L);z=Z}else if(X===void 0&&Z)X=Z,Z=void 0;let{aliasDuplicateObjects:J,anchorPrefix:Q,flow:Y,keepUndefined:q,onTagObj:W,tag:G}=X??{},{onAnchor:U,setAnchors:K,sourceObjects:V}=c6.createNodeAnchors(this,Q||"a"),T={aliasDuplicateObjects:J??!0,keepUndefined:q??!1,onAnchor:U,onTagObj:W,replacer:z,schema:this.schema,sourceObjects:V},O=hW.createNode($,G,T);if(Y&&I0.isCollection(O))O.flow=!0;return K(),O}createPair($,Z,X={}){let z=this.createNode($,null,X),J=this.createNode(Z,null,X);return new xW.Pair(z,J)}delete($){return b$(this.contents)?this.contents.delete($):!1}deleteIn($){if(j$.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return b$(this.contents)?this.contents.deleteIn($):!1}get($,Z){return I0.isCollection(this.contents)?this.contents.get($,Z):void 0}getIn($,Z){if(j$.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(j$.isEmptyPath($))return this.contents!==void 0;return I0.isCollection(this.contents)?this.contents.hasIn($):!1}set($,Z){if(this.contents==null)this.contents=j$.collectionFromPath(this.schema,[$],Z);else if(b$(this.contents))this.contents.set($,Z)}setIn($,Z){if(j$.isEmptyPath($))this.contents=Z;else if(this.contents==null)this.contents=j$.collectionFromPath(this.schema,Array.from($),Z);else if(b$(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 p6.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 p6.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 kW.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=fW.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"?gW.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 yW.stringifyDocument(this,$)}}function b$($){if(I0.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}vW.Document=l6});var C1=D((dW)=>{class G4 extends Error{constructor($,Z,X,z){super();this.name=$,this.code=X,this.message=z,this.pos=Z}}class IZ extends G4{constructor($,Z,X){super("YAMLParseError",$,Z,X)}}class RZ extends G4{constructor($,Z,X){super("YAMLWarning",$,Z,X)}}var mW=($,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,W=X.linePos[1];if(W?.line===z&&W.col>J)q=Math.max(1,Math.min(W.col-J,80-Q));let G=" ".repeat(Q)+"^".repeat(q);X.message+=`:
85
85
 
86
86
  ${Y}
87
87
  ${G}
88
- `}};mW.YAMLError=G4;mW.YAMLParseError=IX;mW.YAMLWarning=RX;mW.prettifyError=uW});var _1=D((nW)=>{function iW($,{flow:X,indicator:Z,next:z,offset:J,onError:Q,parentIndent:Y,startOnNewline:q}){let W=!1,G=q,U=q,K="",V="",T=!1,O=!1,N=null,L=null,I=null,E=null,_=null,S=null,b=null;for(let F of $){if(O){if(F.type!=="space"&&F.type!=="newline"&&F.type!=="comma")Q(F.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");O=!1}if(N){if(G&&F.type!=="comment"&&F.type!=="newline")Q(N,"TAB_AS_INDENT","Tabs are not allowed as indentation");N=null}switch(F.type){case"space":if(!X&&(Z!=="doc-start"||z?.type!=="flow-collection")&&F.source.includes("\t"))N=F;U=!0;break;case"comment":{if(!U)Q(F,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let X0=F.source.substring(1)||" ";if(!K)K=X0;else K+=V+X0;V="",G=!1;break}case"newline":if(G){if(K)K+=F.source;else if(!S||Z!=="seq-item-ind")W=!0}else V+=F.source;if(G=!0,T=!0,L||I)E=F;U=!0;break;case"anchor":if(L)Q(F,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(F.source.endsWith(":"))Q(F.offset+F.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);L=F,b??(b=F.offset),G=!1,U=!1,O=!0;break;case"tag":{if(I)Q(F,"MULTIPLE_TAGS","A node can have at most one tag");I=F,b??(b=F.offset),G=!1,U=!1,O=!0;break}case Z:if(L||I)Q(F,"BAD_PROP_ORDER",`Anchors and tags must be after the ${F.source} indicator`);if(S)Q(F,"UNEXPECTED_TOKEN",`Unexpected ${F.source} in ${X??"collection"}`);S=F,G=Z==="seq-item-ind"||Z==="explicit-key-ind",U=!1;break;case"comma":if(X){if(_)Q(F,"UNEXPECTED_TOKEN",`Unexpected , in ${X}`);_=F,G=!1,U=!1;break}default:Q(F,"UNEXPECTED_TOKEN",`Unexpected ${F.type} token`),G=!1,U=!1}}let j=$[$.length-1],i=j?j.offset+j.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(N&&(G&&N.indent<=Y||z?.type==="block-map"||z?.type==="block-seq"))Q(N,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:_,found:S,spaceBefore:W,comment:K,hasNewline:T,anchor:L,tag:I,newlineAfterProp:E,end:i,start:b??i}}nW.resolveProps=iW});var U4=D((sW)=>{function i6($){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 X of $.end)if(X.type==="newline")return!0}return!1;case"flow-collection":for(let X of $.items){for(let Z of X.start)if(Z.type==="newline")return!0;if(X.sep){for(let Z of X.sep)if(Z.type==="newline")return!0}if(i6(X.key)||i6(X.value))return!0}return!1;default:return!0}}sW.containsNewline=i6});var n6=D((eW)=>{var oW=U4();function tW($,X,Z){if(X?.type==="flow-collection"){let z=X.end[0];if(z.indent===$&&(z.source==="]"||z.source==="}")&&oW.containsNewline(X))Z(z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}eW.flowIndentCheck=tW});var r6=D((ZG)=>{var PX=h();function XG($,X,Z){let{uniqueKeys:z}=$.options;if(z===!1)return!1;let J=typeof z==="function"?z:(Q,Y)=>Q===Y||PX.isScalar(Q)&&PX.isScalar(Y)&&Q.value===Y.value;return X.some((Q)=>J(Q.key,Z))}ZG.mapIncludes=XG});var jX=D((WG)=>{var EX=l0(),JG=n0(),CX=_1(),QG=U4(),_X=n6(),YG=r6(),SX="All mapping items must start at the same column";function qG({composeNode:$,composeEmptyNode:X},Z,z,J,Q){let q=new(Q?.nodeClass??JG.YAMLMap)(Z.schema);if(Z.atRoot)Z.atRoot=!1;let W=z.offset,G=null;for(let U of z.items){let{start:K,key:V,sep:T,value:O}=U,N=CX.resolveProps(K,{indicator:"explicit-key-ind",next:V??T?.[0],offset:W,onError:J,parentIndent:z.indent,startOnNewline:!0}),L=!N.found;if(L){if(V){if(V.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 V&&V.indent!==z.indent)J(W,"BAD_INDENT",SX)}if(!N.anchor&&!N.tag&&!T){if(G=N.end,N.comment)if(q.comment)q.comment+=`
90
- `+N.comment;else q.comment=N.comment;continue}if(N.newlineAfterProp||QG.containsNewline(V))J(V??K[K.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(N.found?.indent!==z.indent)J(W,"BAD_INDENT",SX);Z.atKey=!0;let I=N.end,E=V?$(Z,V,N,J):X(Z,I,K,null,N,J);if(Z.schema.compat)_X.flowIndentCheck(z.indent,V,J);if(Z.atKey=!1,YG.mapIncludes(Z,q.items,E))J(I,"DUPLICATE_KEY","Map keys must be unique");let _=CX.resolveProps(T??[],{indicator:"map-value-ind",next:O,offset:E.range[2],onError:J,parentIndent:z.indent,startOnNewline:!V||V.type==="block-scalar"});if(W=_.end,_.found){if(L){if(O?.type==="block-map"&&!_.hasNewline)J(W,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(Z.options.strict&&N.start<_.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 S=O?$(Z,O,_,J):X(Z,W,T,null,_,J);if(Z.schema.compat)_X.flowIndentCheck(z.indent,O,J);W=S.range[2];let b=new EX.Pair(E,S);if(Z.options.keepSourceTokens)b.srcToken=U;q.items.push(b)}else{if(L)J(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(_.comment)if(E.comment)E.comment+=`
91
- `+_.comment;else E.comment=_.comment;let S=new EX.Pair(E);if(Z.options.keepSourceTokens)S.srcToken=U;q.items.push(S)}}if(G&&G<W)J(G,"IMPOSSIBLE","Map comment with trailing content");return q.range=[z.offset,W,G??W],q}WG.resolveBlockMap=qG});var bX=D((NG)=>{var UG=r0(),VG=_1(),KG=n6();function HG({composeNode:$,composeEmptyNode:X},Z,z,J,Q){let q=new(Q?.nodeClass??UG.YAMLSeq)(Z.schema);if(Z.atRoot)Z.atRoot=!1;if(Z.atKey)Z.atKey=!1;let W=z.offset,G=null;for(let{start:U,value:K}of z.items){let V=VG.resolveProps(U,{indicator:"seq-item-ind",next:K,offset:W,onError:J,parentIndent:z.indent,startOnNewline:!0});if(!V.found)if(V.anchor||V.tag||K)if(K?.type==="block-seq")J(V.end,"BAD_INDENT","All sequence items must start at the same column");else J(W,"MISSING_CHAR","Sequence item without - indicator");else{if(G=V.end,V.comment)q.comment=V.comment;continue}let T=K?$(Z,K,V,J):X(Z,V.end,U,null,V,J);if(Z.schema.compat)KG.flowIndentCheck(z.indent,K,J);W=T.range[2],q.items.push(T)}return q.range=[z.offset,W,G??W],q}NG.resolveBlockSeq=HG});var x$=D((LG)=>{function BG($,X,Z,z){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)z(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:z(q,"UNEXPECTED_TOKEN",`Unexpected ${G} at node end`)}X+=W.length}}return{comment:J,offset:X}}LG.resolveEnd=BG});var kX=D((PG)=>{var OG=h(),wG=l0(),xX=n0(),DG=r0(),AG=x$(),fX=_1(),FG=U4(),IG=r6(),s6="Block collections are not allowed within flow collections",a6=($)=>$&&($.type==="block-map"||$.type==="block-seq");function RG({composeNode:$,composeEmptyNode:X},Z,z,J,Q){let Y=z.start.source==="{",q=Y?"flow map":"flow sequence",G=new(Q?.nodeClass??(Y?xX.YAMLMap:DG.YAMLSeq))(Z.schema);G.flow=!0;let U=Z.atRoot;if(U)Z.atRoot=!1;if(Z.atKey)Z.atKey=!1;let K=z.offset+z.start.source.length;for(let L=0;L<z.items.length;++L){let I=z.items[L],{start:E,key:_,sep:S,value:b}=I,j=fX.resolveProps(E,{flow:q,indicator:"explicit-key-ind",next:_??S?.[0],offset:K,onError:J,parentIndent:z.indent,startOnNewline:!1});if(!j.found){if(!j.anchor&&!j.tag&&!S&&!b){if(L===0&&j.comma)J(j.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${q}`);else if(L<z.items.length-1)J(j.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${q}`);if(j.comment)if(G.comment)G.comment+=`
92
- `+j.comment;else G.comment=j.comment;K=j.end;continue}if(!Y&&Z.options.strict&&FG.containsNewline(_))J(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(L===0){if(j.comma)J(j.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${q}`)}else{if(!j.comma)J(j.start,"MISSING_CHAR",`Missing , between ${q} items`);if(j.comment){let i="";$:for(let F of E)switch(F.type){case"comma":case"space":break;case"comment":i=F.source.substring(1);break $;default:break $}if(i){let F=G.items[G.items.length-1];if(OG.isPair(F))F=F.value??F.key;if(F.comment)F.comment+=`
93
- `+i;else F.comment=i;j.comment=j.comment.substring(i.length+1)}}}if(!Y&&!S&&!j.found){let i=b?$(Z,b,j,J):X(Z,j.end,S,null,j,J);if(G.items.push(i),K=i.range[2],a6(b))J(i.range,"BLOCK_IN_FLOW",s6)}else{Z.atKey=!0;let i=j.end,F=_?$(Z,_,j,J):X(Z,i,E,null,j,J);if(a6(_))J(F.range,"BLOCK_IN_FLOW",s6);Z.atKey=!1;let X0=fX.resolveProps(S??[],{flow:q,indicator:"map-value-ind",next:b,offset:F.range[2],onError:J,parentIndent:z.indent,startOnNewline:!1});if(X0.found){if(!Y&&!j.found&&Z.options.strict){if(S)for(let a of S){if(a===X0.found)break;if(a.type==="newline"){J(a,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(j.start<X0.found.offset-1024)J(X0.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(b)if("source"in b&&b.source?.[0]===":")J(b,"MISSING_CHAR",`Missing space after : in ${q}`);else J(X0.start,"MISSING_CHAR",`Missing , or : between ${q} items`);let A0=b?$(Z,b,X0,J):X0.found?X(Z,X0.end,S,null,X0,J):null;if(A0){if(a6(b))J(A0.range,"BLOCK_IN_FLOW",s6)}else if(X0.comment)if(F.comment)F.comment+=`
94
- `+X0.comment;else F.comment=X0.comment;let m0=new wG.Pair(F,A0);if(Z.options.keepSourceTokens)m0.srcToken=I;if(Y){let a=G;if(IG.mapIncludes(Z,a.items,F))J(i,"DUPLICATE_KEY","Map keys must be unique");a.items.push(m0)}else{let a=new xX.YAMLMap(Z.schema);a.flow=!0,a.items.push(m0);let d=(A0??F).range;a.range=[F.range[0],d[1],d[2]],G.items.push(a)}K=A0?A0.range[2]:X0.end}}let V=Y?"}":"]",[T,...O]=z.end,N=K;if(T?.source===V)N=T.offset+T.source.length;else{let L=q[0].toUpperCase()+q.substring(1),I=U?`${L} must end with a ${V}`:`${L} in block collection must be sufficiently indented and end with a ${V}`;if(J(K,U?"MISSING_CHAR":"BAD_INDENT",I),T&&T.source.length!==1)O.unshift(T)}if(O.length>0){let L=AG.resolveEnd(O,N,Z.options.strict,J);if(L.comment)if(G.comment)G.comment+=`
95
- `+L.comment;else G.comment=L.comment;G.range=[z.offset,N,L.offset]}else G.range=[z.offset,N,N];return G}PG.resolveFlowCollection=RG});var yX=D((yG)=>{var CG=h(),_G=Z0(),SG=n0(),jG=r0(),bG=jX(),xG=bX(),fG=kX();function o6($,X,Z,z,J,Q){let Y=Z.type==="block-map"?bG.resolveBlockMap($,X,Z,z,Q):Z.type==="block-seq"?xG.resolveBlockSeq($,X,Z,z,Q):fG.resolveFlowCollection($,X,Z,z,Q),q=Y.constructor;if(J==="!"||J===q.tagName)return Y.tag=q.tagName,Y;if(J)Y.tag=J;return Y}function kG($,X,Z,z,J){let Q=z.tag,Y=!Q?null:X.directives.tagName(Q.source,(V)=>J(Q,"TAG_RESOLVE_FAILED",V));if(Z.type==="block-seq"){let{anchor:V,newlineAfterProp:T}=z,O=V&&Q?V.offset>Q.offset?V:Q:V??Q;if(O&&(!T||T.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===SG.YAMLMap.tagName&&q==="map"||Y===jG.YAMLSeq.tagName&&q==="seq")return o6($,X,Z,J,Y);let W=X.schema.tags.find((V)=>V.tag===Y&&V.collection===q);if(!W){let V=X.schema.knownTags[Y];if(V?.collection===q)X.schema.tags.push(Object.assign({},V,{default:!1})),W=V;else{if(V)J(Q,"BAD_COLLECTION_TYPE",`${V.tag} used for ${q} collection, but expects ${V.collection??"scalar"}`,!0);else J(Q,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Y}`,!0);return o6($,X,Z,J,Y)}}let G=o6($,X,Z,J,Y,W),U=W.resolve?.(G,(V)=>J(Q,"TAG_RESOLVE_FAILED",V),X.options)??G,K=CG.isNode(U)?U:new _G.Scalar(U);if(K.range=G.range,K.tag=Y,W?.format)K.format=W.format;return K}yG.composeCollection=kG});var e6=D((mG)=>{var t6=Z0();function hG($,X,Z){let z=X.offset,J=vG(X,$.options.strict,Z);if(!J)return{value:"",type:null,comment:"",range:[z,z,z]};let Q=J.mode===">"?t6.Scalar.BLOCK_FOLDED:t6.Scalar.BLOCK_LITERAL,Y=X.source?uG(X.source):[],q=Y.length;for(let N=Y.length-1;N>=0;--N){let L=Y[N][1];if(L===""||L==="\r")q=N;else break}if(q===0){let N=J.chomp==="+"&&Y.length>0?`
96
- `.repeat(Math.max(1,Y.length-1)):"",L=z+J.length;if(X.source)L+=X.source.length;return{value:N,type:Q,comment:J.comment,range:[z,L,L]}}let W=X.indent+J.indent,G=X.offset+J.length,U=0;for(let N=0;N<q;++N){let[L,I]=Y[N];if(I===""||I==="\r"){if(J.indent===0&&L.length>W)W=L.length}else{if(L.length<W)Z(G+L.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(J.indent===0)W=L.length;if(U=N,W===0&&!$.atRoot)Z(G,"BAD_INDENT","Block scalar values in collections must be indented");break}G+=L.length+I.length+1}for(let N=Y.length-1;N>=q;--N)if(Y[N][0].length>W)q=N+1;let K="",V="",T=!1;for(let N=0;N<U;++N)K+=Y[N][0].slice(W)+`
97
- `;for(let N=U;N<q;++N){let[L,I]=Y[N];G+=L.length+I.length+1;let E=I[I.length-1]==="\r";if(E)I=I.slice(0,-1);if(I&&L.length<W){let S=`Block scalar lines must not be less indented than their ${J.indent?"explicit indentation indicator":"first line"}`;Z(G-I.length-(E?2:1),"BAD_INDENT",S),L=""}if(Q===t6.Scalar.BLOCK_LITERAL)K+=V+L.slice(W)+I,V=`
98
- `;else if(L.length>W||I[0]==="\t"){if(V===" ")V=`
88
+ `}};dW.YAMLError=G4;dW.YAMLParseError=IZ;dW.YAMLWarning=RZ;dW.prettifyError=mW});var _1=D((rW)=>{function nW($,{flow:Z,indicator:X,next:z,offset:J,onError:Q,parentIndent:Y,startOnNewline:q}){let W=!1,G=q,U=q,K="",V="",T=!1,O=!1,N=null,L=null,R=null,C=null,S=null,_=null,b=null;for(let F of $){if(O){if(F.type!=="space"&&F.type!=="newline"&&F.type!=="comma")Q(F.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");O=!1}if(N){if(G&&F.type!=="comment"&&F.type!=="newline")Q(N,"TAB_AS_INDENT","Tabs are not allowed as indentation");N=null}switch(F.type){case"space":if(!Z&&(X!=="doc-start"||z?.type!=="flow-collection")&&F.source.includes("\t"))N=F;U=!0;break;case"comment":{if(!U)Q(F,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let Z0=F.source.substring(1)||" ";if(!K)K=Z0;else K+=V+Z0;V="",G=!1;break}case"newline":if(G){if(K)K+=F.source;else if(!_||X!=="seq-item-ind")W=!0}else V+=F.source;if(G=!0,T=!0,L||R)C=F;U=!0;break;case"anchor":if(L)Q(F,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(F.source.endsWith(":"))Q(F.offset+F.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);L=F,b??(b=F.offset),G=!1,U=!1,O=!0;break;case"tag":{if(R)Q(F,"MULTIPLE_TAGS","A node can have at most one tag");R=F,b??(b=F.offset),G=!1,U=!1,O=!0;break}case X:if(L||R)Q(F,"BAD_PROP_ORDER",`Anchors and tags must be after the ${F.source} indicator`);if(_)Q(F,"UNEXPECTED_TOKEN",`Unexpected ${F.source} in ${Z??"collection"}`);_=F,G=X==="seq-item-ind"||X==="explicit-key-ind",U=!1;break;case"comma":if(Z){if(S)Q(F,"UNEXPECTED_TOKEN",`Unexpected , in ${Z}`);S=F,G=!1,U=!1;break}default:Q(F,"UNEXPECTED_TOKEN",`Unexpected ${F.type} token`),G=!1,U=!1}}let j=$[$.length-1],i=j?j.offset+j.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(N&&(G&&N.indent<=Y||z?.type==="block-map"||z?.type==="block-seq"))Q(N,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:S,found:_,spaceBefore:W,comment:K,hasNewline:T,anchor:L,tag:R,newlineAfterProp:C,end:i,start:b??i}}rW.resolveProps=nW});var U4=D((aW)=>{function i6($){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(i6(Z.key)||i6(Z.value))return!0}return!1;default:return!0}}aW.containsNewline=i6});var n6=D(($G)=>{var tW=U4();function eW($,Z,X){if(Z?.type==="flow-collection"){let z=Z.end[0];if(z.indent===$&&(z.source==="]"||z.source==="}")&&tW.containsNewline(Z))X(z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}$G.flowIndentCheck=eW});var r6=D((zG)=>{var PZ=h();function XG($,Z,X){let{uniqueKeys:z}=$.options;if(z===!1)return!1;let J=typeof z==="function"?z:(Q,Y)=>Q===Y||PZ.isScalar(Q)&&PZ.isScalar(Y)&&Q.value===Y.value;return Z.some((Q)=>J(Q.key,X))}zG.mapIncludes=XG});var jZ=D((GG)=>{var EZ=l0(),QG=n0(),CZ=_1(),YG=U4(),_Z=n6(),qG=r6(),SZ="All mapping items must start at the same column";function WG({composeNode:$,composeEmptyNode:Z},X,z,J,Q){let q=new(Q?.nodeClass??QG.YAMLMap)(X.schema);if(X.atRoot)X.atRoot=!1;let W=z.offset,G=null;for(let U of z.items){let{start:K,key:V,sep:T,value:O}=U,N=CZ.resolveProps(K,{indicator:"explicit-key-ind",next:V??T?.[0],offset:W,onError:J,parentIndent:z.indent,startOnNewline:!0}),L=!N.found;if(L){if(V){if(V.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 V&&V.indent!==z.indent)J(W,"BAD_INDENT",SZ)}if(!N.anchor&&!N.tag&&!T){if(G=N.end,N.comment)if(q.comment)q.comment+=`
90
+ `+N.comment;else q.comment=N.comment;continue}if(N.newlineAfterProp||YG.containsNewline(V))J(V??K[K.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(N.found?.indent!==z.indent)J(W,"BAD_INDENT",SZ);X.atKey=!0;let R=N.end,C=V?$(X,V,N,J):Z(X,R,K,null,N,J);if(X.schema.compat)_Z.flowIndentCheck(z.indent,V,J);if(X.atKey=!1,qG.mapIncludes(X,q.items,C))J(R,"DUPLICATE_KEY","Map keys must be unique");let S=CZ.resolveProps(T??[],{indicator:"map-value-ind",next:O,offset:C.range[2],onError:J,parentIndent:z.indent,startOnNewline:!V||V.type==="block-scalar"});if(W=S.end,S.found){if(L){if(O?.type==="block-map"&&!S.hasNewline)J(W,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(X.options.strict&&N.start<S.found.offset-1024)J(C.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let _=O?$(X,O,S,J):Z(X,W,T,null,S,J);if(X.schema.compat)_Z.flowIndentCheck(z.indent,O,J);W=_.range[2];let b=new EZ.Pair(C,_);if(X.options.keepSourceTokens)b.srcToken=U;q.items.push(b)}else{if(L)J(C.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(S.comment)if(C.comment)C.comment+=`
91
+ `+S.comment;else C.comment=S.comment;let _=new EZ.Pair(C);if(X.options.keepSourceTokens)_.srcToken=U;q.items.push(_)}}if(G&&G<W)J(G,"IMPOSSIBLE","Map comment with trailing content");return q.range=[z.offset,W,G??W],q}GG.resolveBlockMap=WG});var bZ=D((TG)=>{var VG=r0(),KG=_1(),HG=n6();function NG({composeNode:$,composeEmptyNode:Z},X,z,J,Q){let q=new(Q?.nodeClass??VG.YAMLSeq)(X.schema);if(X.atRoot)X.atRoot=!1;if(X.atKey)X.atKey=!1;let W=z.offset,G=null;for(let{start:U,value:K}of z.items){let V=KG.resolveProps(U,{indicator:"seq-item-ind",next:K,offset:W,onError:J,parentIndent:z.indent,startOnNewline:!0});if(!V.found)if(V.anchor||V.tag||K)if(K?.type==="block-seq")J(V.end,"BAD_INDENT","All sequence items must start at the same column");else J(W,"MISSING_CHAR","Sequence item without - indicator");else{if(G=V.end,V.comment)q.comment=V.comment;continue}let T=K?$(X,K,V,J):Z(X,V.end,U,null,V,J);if(X.schema.compat)HG.flowIndentCheck(z.indent,K,J);W=T.range[2],q.items.push(T)}return q.range=[z.offset,W,G??W],q}TG.resolveBlockSeq=NG});var x$=D((MG)=>{function LG($,Z,X,z){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(X&&!Q)z(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:z(q,"UNEXPECTED_TOKEN",`Unexpected ${G} at node end`)}Z+=W.length}}return{comment:J,offset:Z}}MG.resolveEnd=LG});var kZ=D((EG)=>{var wG=h(),DG=l0(),xZ=n0(),AG=r0(),FG=x$(),fZ=_1(),IG=U4(),RG=r6(),s6="Block collections are not allowed within flow collections",a6=($)=>$&&($.type==="block-map"||$.type==="block-seq");function PG({composeNode:$,composeEmptyNode:Z},X,z,J,Q){let Y=z.start.source==="{",q=Y?"flow map":"flow sequence",G=new(Q?.nodeClass??(Y?xZ.YAMLMap:AG.YAMLSeq))(X.schema);G.flow=!0;let U=X.atRoot;if(U)X.atRoot=!1;if(X.atKey)X.atKey=!1;let K=z.offset+z.start.source.length;for(let L=0;L<z.items.length;++L){let R=z.items[L],{start:C,key:S,sep:_,value:b}=R,j=fZ.resolveProps(C,{flow:q,indicator:"explicit-key-ind",next:S??_?.[0],offset:K,onError:J,parentIndent:z.indent,startOnNewline:!1});if(!j.found){if(!j.anchor&&!j.tag&&!_&&!b){if(L===0&&j.comma)J(j.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${q}`);else if(L<z.items.length-1)J(j.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${q}`);if(j.comment)if(G.comment)G.comment+=`
92
+ `+j.comment;else G.comment=j.comment;K=j.end;continue}if(!Y&&X.options.strict&&IG.containsNewline(S))J(S,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(L===0){if(j.comma)J(j.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${q}`)}else{if(!j.comma)J(j.start,"MISSING_CHAR",`Missing , between ${q} items`);if(j.comment){let i="";$:for(let F of C)switch(F.type){case"comma":case"space":break;case"comment":i=F.source.substring(1);break $;default:break $}if(i){let F=G.items[G.items.length-1];if(wG.isPair(F))F=F.value??F.key;if(F.comment)F.comment+=`
93
+ `+i;else F.comment=i;j.comment=j.comment.substring(i.length+1)}}}if(!Y&&!_&&!j.found){let i=b?$(X,b,j,J):Z(X,j.end,_,null,j,J);if(G.items.push(i),K=i.range[2],a6(b))J(i.range,"BLOCK_IN_FLOW",s6)}else{X.atKey=!0;let i=j.end,F=S?$(X,S,j,J):Z(X,i,C,null,j,J);if(a6(S))J(F.range,"BLOCK_IN_FLOW",s6);X.atKey=!1;let Z0=fZ.resolveProps(_??[],{flow:q,indicator:"map-value-ind",next:b,offset:F.range[2],onError:J,parentIndent:z.indent,startOnNewline:!1});if(Z0.found){if(!Y&&!j.found&&X.options.strict){if(_)for(let a of _){if(a===Z0.found)break;if(a.type==="newline"){J(a,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(j.start<Z0.found.offset-1024)J(Z0.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(b)if("source"in b&&b.source?.[0]===":")J(b,"MISSING_CHAR",`Missing space after : in ${q}`);else J(Z0.start,"MISSING_CHAR",`Missing , or : between ${q} items`);let A0=b?$(X,b,Z0,J):Z0.found?Z(X,Z0.end,_,null,Z0,J):null;if(A0){if(a6(b))J(A0.range,"BLOCK_IN_FLOW",s6)}else if(Z0.comment)if(F.comment)F.comment+=`
94
+ `+Z0.comment;else F.comment=Z0.comment;let m0=new DG.Pair(F,A0);if(X.options.keepSourceTokens)m0.srcToken=R;if(Y){let a=G;if(RG.mapIncludes(X,a.items,F))J(i,"DUPLICATE_KEY","Map keys must be unique");a.items.push(m0)}else{let a=new xZ.YAMLMap(X.schema);a.flow=!0,a.items.push(m0);let d=(A0??F).range;a.range=[F.range[0],d[1],d[2]],G.items.push(a)}K=A0?A0.range[2]:Z0.end}}let V=Y?"}":"]",[T,...O]=z.end,N=K;if(T?.source===V)N=T.offset+T.source.length;else{let L=q[0].toUpperCase()+q.substring(1),R=U?`${L} must end with a ${V}`:`${L} in block collection must be sufficiently indented and end with a ${V}`;if(J(K,U?"MISSING_CHAR":"BAD_INDENT",R),T&&T.source.length!==1)O.unshift(T)}if(O.length>0){let L=FG.resolveEnd(O,N,X.options.strict,J);if(L.comment)if(G.comment)G.comment+=`
95
+ `+L.comment;else G.comment=L.comment;G.range=[z.offset,N,L.offset]}else G.range=[z.offset,N,N];return G}EG.resolveFlowCollection=PG});var yZ=D((gG)=>{var _G=h(),SG=X0(),jG=n0(),bG=r0(),xG=jZ(),fG=bZ(),kG=kZ();function o6($,Z,X,z,J,Q){let Y=X.type==="block-map"?xG.resolveBlockMap($,Z,X,z,Q):X.type==="block-seq"?fG.resolveBlockSeq($,Z,X,z,Q):kG.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 yG($,Z,X,z,J){let Q=z.tag,Y=!Q?null:Z.directives.tagName(Q.source,(V)=>J(Q,"TAG_RESOLVE_FAILED",V));if(X.type==="block-seq"){let{anchor:V,newlineAfterProp:T}=z,O=V&&Q?V.offset>Q.offset?V:Q:V??Q;if(O&&(!T||T.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===jG.YAMLMap.tagName&&q==="map"||Y===bG.YAMLSeq.tagName&&q==="seq")return o6($,Z,X,J,Y);let W=Z.schema.tags.find((V)=>V.tag===Y&&V.collection===q);if(!W){let V=Z.schema.knownTags[Y];if(V?.collection===q)Z.schema.tags.push(Object.assign({},V,{default:!1})),W=V;else{if(V)J(Q,"BAD_COLLECTION_TYPE",`${V.tag} used for ${q} collection, but expects ${V.collection??"scalar"}`,!0);else J(Q,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Y}`,!0);return o6($,Z,X,J,Y)}}let G=o6($,Z,X,J,Y,W),U=W.resolve?.(G,(V)=>J(Q,"TAG_RESOLVE_FAILED",V),Z.options)??G,K=_G.isNode(U)?U:new SG.Scalar(U);if(K.range=G.range,K.tag=Y,W?.format)K.format=W.format;return K}gG.composeCollection=yG});var e6=D((dG)=>{var t6=X0();function vG($,Z,X){let z=Z.offset,J=uG(Z,$.options.strict,X);if(!J)return{value:"",type:null,comment:"",range:[z,z,z]};let Q=J.mode===">"?t6.Scalar.BLOCK_FOLDED:t6.Scalar.BLOCK_LITERAL,Y=Z.source?mG(Z.source):[],q=Y.length;for(let N=Y.length-1;N>=0;--N){let L=Y[N][1];if(L===""||L==="\r")q=N;else break}if(q===0){let N=J.chomp==="+"&&Y.length>0?`
96
+ `.repeat(Math.max(1,Y.length-1)):"",L=z+J.length;if(Z.source)L+=Z.source.length;return{value:N,type:Q,comment:J.comment,range:[z,L,L]}}let W=Z.indent+J.indent,G=Z.offset+J.length,U=0;for(let N=0;N<q;++N){let[L,R]=Y[N];if(R===""||R==="\r"){if(J.indent===0&&L.length>W)W=L.length}else{if(L.length<W)X(G+L.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(J.indent===0)W=L.length;if(U=N,W===0&&!$.atRoot)X(G,"BAD_INDENT","Block scalar values in collections must be indented");break}G+=L.length+R.length+1}for(let N=Y.length-1;N>=q;--N)if(Y[N][0].length>W)q=N+1;let K="",V="",T=!1;for(let N=0;N<U;++N)K+=Y[N][0].slice(W)+`
97
+ `;for(let N=U;N<q;++N){let[L,R]=Y[N];G+=L.length+R.length+1;let C=R[R.length-1]==="\r";if(C)R=R.slice(0,-1);if(R&&L.length<W){let _=`Block scalar lines must not be less indented than their ${J.indent?"explicit indentation indicator":"first line"}`;X(G-R.length-(C?2:1),"BAD_INDENT",_),L=""}if(Q===t6.Scalar.BLOCK_LITERAL)K+=V+L.slice(W)+R,V=`
98
+ `;else if(L.length>W||R[0]==="\t"){if(V===" ")V=`
99
99
  `;else if(!T&&V===`
100
100
  `)V=`
101
101
 
102
- `;K+=V+L.slice(W)+I,V=`
103
- `,T=!0}else if(I==="")if(V===`
102
+ `;K+=V+L.slice(W)+R,V=`
103
+ `,T=!0}else if(R==="")if(V===`
104
104
  `)K+=`
105
105
  `;else V=`
106
- `;else K+=V+I,V=" ",T=!1}switch(J.chomp){case"-":break;case"+":for(let N=q;N<Y.length;++N)K+=`
106
+ `;else K+=V+R,V=" ",T=!1}switch(J.chomp){case"-":break;case"+":for(let N=q;N<Y.length;++N)K+=`
107
107
  `+Y[N][0].slice(W);if(K[K.length-1]!==`
108
108
  `)K+=`
109
109
  `;break;default:K+=`
110
- `}let O=z+J.length+X.source.length;return{value:K,type:Q,comment:J.comment,range:[z,O,O]}}function vG({offset:$,props:X},Z,z){if(X[0].type!=="block-scalar-header")return z(X[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:J}=X[0],Q=J[0],Y=0,q="",W=-1;for(let V=1;V<J.length;++V){let T=J[V];if(!q&&(T==="-"||T==="+"))q=T;else{let O=Number(T);if(!Y&&O)Y=O;else if(W===-1)W=$+V}}if(W!==-1)z(W,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${J}`);let G=!1,U="",K=J.length;for(let V=1;V<X.length;++V){let T=X[V];switch(T.type){case"space":G=!0;case"newline":K+=T.source.length;break;case"comment":if(Z&&!G)z(T,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");K+=T.source.length,U=T.source.substring(1);break;case"error":z(T,"UNEXPECTED_TOKEN",T.message),K+=T.source.length;break;default:{let O=`Unexpected token in block scalar header: ${T.type}`;z(T,"UNEXPECTED_TOKEN",O);let N=T.source;if(N&&typeof N==="string")K+=N.length}}}return{mode:Q,indent:Y,chomp:q,comment:U,length:K}}function uG($){let X=$.split(/\n( *)/),Z=X[0],z=Z.match(/^( *)/),Q=[z?.[1]?[z[1],Z.slice(z[1].length)]:["",Z]];for(let Y=1;Y<X.length;Y+=2)Q.push([X[Y],X[Y+1]]);return Q}mG.resolveBlockScalar=hG});var X8=D((oG)=>{var $8=Z0(),cG=x$();function pG($,X,Z){let{offset:z,type:J,source:Q,end:Y}=$,q,W,G=(V,T,O)=>Z(z+V,T,O);switch(J){case"scalar":q=$8.Scalar.PLAIN,W=lG(Q,G);break;case"single-quoted-scalar":q=$8.Scalar.QUOTE_SINGLE,W=iG(Q,G);break;case"double-quoted-scalar":q=$8.Scalar.QUOTE_DOUBLE,W=nG(Q,G);break;default:return Z($,"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,K=cG.resolveEnd(Y,U,X,Z);return{value:W,type:q,comment:K.comment,range:[z,U,K.offset]}}function lG($,X){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)X(0,"BAD_SCALAR_START",`Plain value cannot start with ${Z}`);return gX($)}function iG($,X){if($[$.length-1]!=="'"||$.length===1)X($.length,"MISSING_CHAR","Missing closing 'quote");return gX($.slice(1,-1)).replace(/''/g,"'")}function gX($){let X,Z;try{X=new RegExp(`(.*?)(?<![ ])[ ]*\r?
111
- `,"sy"),Z=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
112
- `,"sy")}catch{X=/(.*?)[ \t]*\r?\n/sy,Z=/[ \t]*(.*?)[ \t]*\r?\n/sy}let z=X.exec($);if(!z)return $;let J=z[1],Q=" ",Y=X.lastIndex;Z.lastIndex=Y;while(z=Z.exec($)){if(z[1]==="")if(Q===`
110
+ `}let O=z+J.length+Z.source.length;return{value:K,type:Q,comment:J.comment,range:[z,O,O]}}function uG({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="",W=-1;for(let V=1;V<J.length;++V){let T=J[V];if(!q&&(T==="-"||T==="+"))q=T;else{let O=Number(T);if(!Y&&O)Y=O;else if(W===-1)W=$+V}}if(W!==-1)z(W,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${J}`);let G=!1,U="",K=J.length;for(let V=1;V<Z.length;++V){let T=Z[V];switch(T.type){case"space":G=!0;case"newline":K+=T.source.length;break;case"comment":if(X&&!G)z(T,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");K+=T.source.length,U=T.source.substring(1);break;case"error":z(T,"UNEXPECTED_TOKEN",T.message),K+=T.source.length;break;default:{let O=`Unexpected token in block scalar header: ${T.type}`;z(T,"UNEXPECTED_TOKEN",O);let N=T.source;if(N&&typeof N==="string")K+=N.length}}}return{mode:Q,indent:Y,chomp:q,comment:U,length:K}}function mG($){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}dG.resolveBlockScalar=vG});var Z8=D((tG)=>{var $8=X0(),pG=x$();function lG($,Z,X){let{offset:z,type:J,source:Q,end:Y}=$,q,W,G=(V,T,O)=>X(z+V,T,O);switch(J){case"scalar":q=$8.Scalar.PLAIN,W=iG(Q,G);break;case"single-quoted-scalar":q=$8.Scalar.QUOTE_SINGLE,W=nG(Q,G);break;case"double-quoted-scalar":q=$8.Scalar.QUOTE_DOUBLE,W=rG(Q,G);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,K=pG.resolveEnd(Y,U,Z,X);return{value:W,type:q,comment:K.comment,range:[z,U,K.offset]}}function iG($,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 gZ($)}function nG($,Z){if($[$.length-1]!=="'"||$.length===1)Z($.length,"MISSING_CHAR","Missing closing 'quote");return gZ($.slice(1,-1)).replace(/''/g,"'")}function gZ($){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===`
113
113
  `)J+=Q;else Q=`
114
- `;else J+=Q+z[1],Q=" ";Y=Z.lastIndex}let q=/[ \t]*(.*)/sy;return q.lastIndex=Y,z=q.exec($),J+Q+(z?.[1]??"")}function nG($,X){let Z="";for(let z=1;z<$.length-1;++z){let J=$[z];if(J==="\r"&&$[z+1]===`
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 rG($,Z){let X="";for(let z=1;z<$.length-1;++z){let J=$[z];if(J==="\r"&&$[z+1]===`
115
115
  `)continue;if(J===`
116
- `){let{fold:Q,offset:Y}=rG($,z);Z+=Q,z=Y}else if(J==="\\"){let Q=$[++z],Y=sG[Q];if(Y)Z+=Y;else if(Q===`
116
+ `){let{fold:Q,offset:Y}=sG($,z);X+=Q,z=Y}else if(J==="\\"){let Q=$[++z],Y=aG[Q];if(Y)X+=Y;else if(Q===`
117
117
  `){Q=$[z+1];while(Q===" "||Q==="\t")Q=$[++z+1]}else if(Q==="\r"&&$[z+1]===`
118
- `){Q=$[++z+1];while(Q===" "||Q==="\t")Q=$[++z+1]}else if(Q==="x"||Q==="u"||Q==="U"){let q={x:2,u:4,U:8}[Q];Z+=aG($,z+1,q,X),z+=q}else{let q=$.substr(z-1,2);X(z-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${q}`),Z+=q}}else if(J===" "||J==="\t"){let Q=z,Y=$[z+1];while(Y===" "||Y==="\t")Y=$[++z+1];if(Y!==`
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+=oG($,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
119
  `&&!(Y==="\r"&&$[z+2]===`
120
- `))Z+=z>Q?$.slice(Q,z+1):J}else Z+=J}if($[$.length-1]!=='"'||$.length===1)X($.length,"MISSING_CHAR",'Missing closing "quote');return Z}function rG($,X){let Z="",z=$[X+1];while(z===" "||z==="\t"||z===`
121
- `||z==="\r"){if(z==="\r"&&$[X+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 sG($,Z){let X="",z=$[Z+1];while(z===" "||z==="\t"||z===`
121
+ `||z==="\r"){if(z==="\r"&&$[Z+2]!==`
122
122
  `)break;if(z===`
123
- `)Z+=`
124
- `;X+=1,z=$[X+1]}if(!Z)Z=" ";return{fold:Z,offset:X}}var sG={"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 aG($,X,Z,z){let J=$.substr(X,Z),Y=J.length===Z&&/^[0-9a-fA-F]+$/.test(J)?parseInt(J,16):NaN;if(isNaN(Y)){let q=$.substr(X-2,Z+2);return z(X-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${q}`),q}return String.fromCodePoint(Y)}oG.resolveFlowScalar=pG});var vX=D((JU)=>{var K$=h(),hX=Z0(),eG=e6(),$U=X8();function XU($,X,Z,z){let{value:J,type:Q,comment:Y,range:q}=X.type==="block-scalar"?eG.resolveBlockScalar($,X,z):$U.resolveFlowScalar(X,$.options.strict,z),W=Z?$.directives.tagName(Z.source,(K)=>z(Z,"TAG_RESOLVE_FAILED",K)):null,G;if($.options.stringKeys&&$.atKey)G=$.schema[K$.SCALAR];else if(W)G=ZU($.schema,J,W,Z,z);else if(X.type==="scalar")G=zU($,J,X,z);else G=$.schema[K$.SCALAR];let U;try{let K=G.resolve(J,(V)=>z(Z??X,"TAG_RESOLVE_FAILED",V),$.options);U=K$.isScalar(K)?K:new hX.Scalar(K)}catch(K){let V=K instanceof Error?K.message:String(K);z(Z??X,"TAG_RESOLVE_FAILED",V),U=new hX.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 ZU($,X,Z,z,J){if(Z==="!")return $[K$.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(X))return q;let Y=$.knownTags[Z];if(Y&&!Y.collection)return $.tags.push(Object.assign({},Y,{default:!1,test:void 0})),Y;return J(z,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Z}`,Z!=="tag:yaml.org,2002:str"),$[K$.SCALAR]}function zU({atKey:$,directives:X,schema:Z},z,J,Q){let Y=Z.tags.find((q)=>(q.default===!0||$&&q.default==="key")&&q.test?.test(z))||Z[K$.SCALAR];if(Z.compat){let q=Z.compat.find((W)=>W.default&&W.test?.test(z))??Z[K$.SCALAR];if(Y.tag!==q.tag){let W=X.tagString(Y.tag),G=X.tagString(q.tag),U=`Value may be parsed as either ${W} or ${G}`;Q(J,"TAG_RESOLVE_FAILED",U,!0)}}return Y}JU.composeScalar=XU});var uX=D((qU)=>{function YU($,X,Z){if(X){Z??(Z=X.length);for(let z=Z-1;z>=0;--z){let J=X[z];switch(J.type){case"space":case"comment":case"newline":$-=J.source.length;continue}J=X[++z];while(J?.type==="space")$+=J.source.length,J=X[++z];break}}return $}qU.emptyScalarPosition=YU});var cX=D((BU)=>{var GU=K1(),UU=h(),VU=yX(),mX=vX(),KU=x$(),HU=uX(),NU={composeNode:dX,composeEmptyNode:Z8};function dX($,X,Z,z){let J=$.atKey,{spaceBefore:Q,comment:Y,anchor:q,tag:W}=Z,G,U=!0;switch(X.type){case"alias":if(G=TU($,X,z),q||W)z(X,"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=mX.composeScalar($,X,W,z),q)G.anchor=q.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(G=VU.composeCollection(NU,$,X,Z,z),q)G.anchor=q.source.substring(1)}catch(K){let V=K instanceof Error?K.message:String(K);z(X,"RESOURCE_EXHAUSTION",V)}break;default:{let K=X.type==="error"?X.message:`Unsupported token (type: ${X.type})`;z(X,"UNEXPECTED_TOKEN",K),U=!1}}if(G??(G=Z8($,X.offset,void 0,null,Z,z)),q&&G.anchor==="")z(q,"BAD_ALIAS","Anchor cannot be an empty string");if(J&&$.options.stringKeys&&(!UU.isScalar(G)||typeof G.value!=="string"||G.tag&&G.tag!=="tag:yaml.org,2002:str"))z(W??X,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(Q)G.spaceBefore=!0;if(Y)if(X.type==="scalar"&&X.source==="")G.comment=Y;else G.commentBefore=Y;if($.options.keepSourceTokens&&U)G.srcToken=X;return G}function Z8($,X,Z,z,{spaceBefore:J,comment:Q,anchor:Y,tag:q,end:W},G){let U={type:"scalar",offset:HU.emptyScalarPosition(X,Z,z),indent:-1,source:""},K=mX.composeScalar($,U,q,G);if(Y){if(K.anchor=Y.source.substring(1),K.anchor==="")G(Y,"BAD_ALIAS","Anchor cannot be an empty string")}if(J)K.spaceBefore=!0;if(Q)K.comment=Q,K.range[2]=W;return K}function TU({options:$},{offset:X,source:Z,end:z},J){let Q=new GU.Alias(Z.substring(1));if(Q.source==="")J(X,"BAD_ALIAS","Alias cannot be an empty string");if(Q.source.endsWith(":"))J(X+Z.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let Y=X+Z.length,q=KU.resolveEnd(z,Y,$.strict,J);if(Q.range=[X,Y,q.offset],q.comment)Q.comment=q.comment;return Q}BU.composeEmptyNode=Z8;BU.composeNode=dX});var lX=D((FU)=>{var OU=E1(),pX=cX(),wU=x$(),DU=_1();function AU($,X,{offset:Z,start:z,value:J,end:Q},Y){let q=Object.assign({_directives:X},$),W=new OU.Document(void 0,q),G={atKey:!1,atRoot:!0,directives:W.directives,options:W.options,schema:W.schema},U=DU.resolveProps(z,{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?pX.composeNode(G,J,U,Y):pX.composeEmptyNode(G,U.end,z,null,U,Y);let K=W.contents.range[2],V=wU.resolveEnd(Q,K,!1,Y);if(V.comment)W.comment=V.comment;return W.range=[Z,K,V.offset],W}FU.composeDoc=AU});var z8=D((SU)=>{var RU=B0("process"),PU=q6(),EU=E1(),S1=C1(),iX=h(),CU=lX(),_U=x$();function j1($){if(typeof $==="number")return[$,$+1];if(Array.isArray($))return $.length===2?$:[$[0],$[1]];let{offset:X,source:Z}=$;return[X,X+(typeof Z==="string"?Z.length:1)]}function nX($){let X="",Z=!1,z=!1;for(let J=0;J<$.length;++J){let Q=$[J];switch(Q[0]){case"#":X+=(X===""?"":z?`
123
+ `)X+=`
124
+ `;Z+=1,z=$[Z+1]}if(!X)X=" ";return{fold:X,offset:Z}}var aG={"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 oG($,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)}tG.resolveFlowScalar=lG});var vZ=D((QU)=>{var K$=h(),hZ=X0(),$U=e6(),ZU=Z8();function XU($,Z,X,z){let{value:J,type:Q,comment:Y,range:q}=Z.type==="block-scalar"?$U.resolveBlockScalar($,Z,z):ZU.resolveFlowScalar(Z,$.options.strict,z),W=X?$.directives.tagName(X.source,(K)=>z(X,"TAG_RESOLVE_FAILED",K)):null,G;if($.options.stringKeys&&$.atKey)G=$.schema[K$.SCALAR];else if(W)G=zU($.schema,J,W,X,z);else if(Z.type==="scalar")G=JU($,J,Z,z);else G=$.schema[K$.SCALAR];let U;try{let K=G.resolve(J,(V)=>z(X??Z,"TAG_RESOLVE_FAILED",V),$.options);U=K$.isScalar(K)?K:new hZ.Scalar(K)}catch(K){let V=K instanceof Error?K.message:String(K);z(X??Z,"TAG_RESOLVE_FAILED",V),U=new hZ.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 zU($,Z,X,z,J){if(X==="!")return $[K$.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"),$[K$.SCALAR]}function JU({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[K$.SCALAR];if(X.compat){let q=X.compat.find((W)=>W.default&&W.test?.test(z))??X[K$.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}QU.composeScalar=XU});var uZ=D((WU)=>{function qU($,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 $}WU.emptyScalarPosition=qU});var cZ=D((LU)=>{var UU=K1(),VU=h(),KU=yZ(),mZ=vZ(),HU=x$(),NU=uZ(),TU={composeNode:dZ,composeEmptyNode:X8};function dZ($,Z,X,z){let J=$.atKey,{spaceBefore:Q,comment:Y,anchor:q,tag:W}=X,G,U=!0;switch(Z.type){case"alias":if(G=BU($,Z,z),q||W)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(G=mZ.composeScalar($,Z,W,z),q)G.anchor=q.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(G=KU.composeCollection(TU,$,Z,X,z),q)G.anchor=q.source.substring(1);break;default:{let K=Z.type==="error"?Z.message:`Unsupported token (type: ${Z.type})`;z(Z,"UNEXPECTED_TOKEN",K),G=X8($,Z.offset,void 0,null,X,z),U=!1}}if(q&&G.anchor==="")z(q,"BAD_ALIAS","Anchor cannot be an empty string");if(J&&$.options.stringKeys&&(!VU.isScalar(G)||typeof G.value!=="string"||G.tag&&G.tag!=="tag:yaml.org,2002:str"))z(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 X8($,Z,X,z,{spaceBefore:J,comment:Q,anchor:Y,tag:q,end:W},G){let U={type:"scalar",offset:NU.emptyScalarPosition(Z,X,z),indent:-1,source:""},K=mZ.composeScalar($,U,q,G);if(Y){if(K.anchor=Y.source.substring(1),K.anchor==="")G(Y,"BAD_ALIAS","Anchor cannot be an empty string")}if(J)K.spaceBefore=!0;if(Q)K.comment=Q,K.range[2]=W;return K}function BU({options:$},{offset:Z,source:X,end:z},J){let Q=new UU.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=HU.resolveEnd(z,Y,$.strict,J);if(Q.range=[Z,Y,q.offset],q.comment)Q.comment=q.comment;return Q}LU.composeEmptyNode=X8;LU.composeNode=dZ});var lZ=D((IU)=>{var wU=E1(),pZ=cZ(),DU=x$(),AU=_1();function FU($,Z,{offset:X,start:z,value:J,end:Q},Y){let q=Object.assign({_directives:Z},$),W=new wU.Document(void 0,q),G={atKey:!1,atRoot:!0,directives:W.directives,options:W.options,schema:W.schema},U=AU.resolveProps(z,{indicator:"doc-start",next:J??Q?.[0],offset:X,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?pZ.composeNode(G,J,U,Y):pZ.composeEmptyNode(G,U.end,z,null,U,Y);let K=W.contents.range[2],V=DU.resolveEnd(Q,K,!1,Y);if(V.comment)W.comment=V.comment;return W.range=[X,K,V.offset],W}IU.composeDoc=FU});var z8=D((jU)=>{var PU=B0("process"),EU=q6(),CU=E1(),S1=C1(),iZ=h(),_U=lZ(),SU=x$();function j1($){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 nZ($){let Z="",X=!1,z=!1;for(let J=0;J<$.length;++J){let Q=$[J];switch(Q[0]){case"#":Z+=(Z===""?"":z?`
126
126
 
127
127
  `:`
128
- `)+(Q.substring(1)||" "),Z=!0,z=!1;break;case"%":if($[J+1]?.[0]!=="#")J+=1;Z=!1;break;default:if(!Z)z=!0;Z=!1}}return{comment:X,afterEmptyLine:z}}class rX{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(X,Z,z,J)=>{let Q=j1(X);if(J)this.warnings.push(new S1.YAMLWarning(Q,Z,z));else this.errors.push(new S1.YAMLParseError(Q,Z,z))},this.directives=new PU.Directives({version:$.version||"1.2"}),this.options=$}decorate($,X){let{comment:Z,afterEmptyLine:z}=nX(this.prelude);if(Z){let J=$.contents;if(X)$.comment=$.comment?`${$.comment}
129
- ${Z}`:Z;else if(z||$.directives.docStart||!J)$.commentBefore=Z;else if(iX.isCollection(J)&&!J.flow&&J.items.length>0){let Q=J.items[0];if(iX.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(X)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:nX(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose($,X=!1,Z=-1){for(let z of $)yield*this.next(z);yield*this.end(X,Z)}*next($){if(RU.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(X,Z,z)=>{let J=j1($);J[0]+=X,this.onError(J,"BAD_DIRECTIVE",Z,z)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let X=CU.composeDoc(this.options,this.directives,$,this.onError);if(this.atDirectives&&!X.directives.docStart)this.onError($,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(X,!1),this.doc)yield this.doc;this.doc=X,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push($.source);break;case"error":{let X=$.source?`${$.message}: ${JSON.stringify($.source)}`:$.message,Z=new S1.YAMLParseError(j1($),"UNEXPECTED_TOKEN",X);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 S1.YAMLParseError(j1($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let X=_U.resolveEnd($.end,$.offset+$.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),X.comment){let Z=this.doc.comment;this.doc.comment=Z?`${Z}
132
- ${X.comment}`:X.comment}this.doc.range[2]=X.offset;break}default:this.errors.push(new S1.YAMLParseError(j1($),"UNEXPECTED_TOKEN",`Unsupported token ${$.type}`))}}*end($=!1,X=-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),z=new EU.Document(void 0,Z);if(this.atDirectives)this.onError(X,"MISSING_CHAR","Missing directives-end indicator line");z.range=[0,X,X],this.decorate(z,!1),yield z}}}SU.Composer=rX});var oX=D((vU)=>{var bU=e6(),xU=X8(),fU=C1(),sX=B1();function kU($,X=!0,Z){if($){let z=(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 fU.YAMLParseError([q,q+1],Q,Y)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return xU.resolveFlowScalar($,X,z);case"block-scalar":return bU.resolveBlockScalar({options:{strict:X}},$,z)}}return null}function yU($,X){let{implicitKey:Z=!1,indent:z,inFlow:J=!1,offset:Q=-1,type:Y="PLAIN"}=X,q=sX.stringifyString({type:Y,value:$},{implicitKey:Z,indent:z>0?" ".repeat(z):"",inFlow:J,options:{blockQuote:!0,lineWidth:-1}}),W=X.end??[{type:"newline",offset:-1,indent:z,source:`
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 rZ{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Z,X,z,J)=>{let Q=j1(Z);if(J)this.warnings.push(new S1.YAMLWarning(Q,X,z));else this.errors.push(new S1.YAMLParseError(Q,X,z))},this.directives=new EU.Directives({version:$.version||"1.2"}),this.options=$}decorate($,Z){let{comment:X,afterEmptyLine:z}=nZ(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(iZ.isCollection(J)&&!J.flow&&J.items.length>0){let Q=J.items[0];if(iZ.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:nZ(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(PU.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(Z,X,z)=>{let J=j1($);J[0]+=Z,this.onError(J,"BAD_DIRECTIVE",X,z)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let Z=_U.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 S1.YAMLParseError(j1($),"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 S1.YAMLParseError(j1($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Z=SU.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 S1.YAMLParseError(j1($),"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 CU.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}}}jU.Composer=rZ});var oZ=D((uU)=>{var xU=e6(),fU=Z8(),kU=C1(),sZ=B1();function yU($,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 kU.YAMLParseError([q,q+1],Q,Y)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return fU.resolveFlowScalar($,Z,z);case"block-scalar":return xU.resolveBlockScalar({options:{strict:Z}},$,z)}}return null}function gU($,Z){let{implicitKey:X=!1,indent:z,inFlow:J=!1,offset:Q=-1,type:Y="PLAIN"}=Z,q=sZ.stringifyString({type:Y,value:$},{implicitKey:X,indent:z>0?" ".repeat(z):"",inFlow:J,options:{blockQuote:!0,lineWidth:-1}}),W=Z.end??[{type:"newline",offset:-1,indent:z,source:`
133
133
  `}];switch(q[0]){case"|":case">":{let G=q.indexOf(`
134
134
  `),U=q.substring(0,G),K=q.substring(G+1)+`
135
- `,V=[{type:"block-scalar-header",offset:Q,indent:z,source:U}];if(!aX(V,W))V.push({type:"newline",offset:-1,indent:z,source:`
136
- `});return{type:"block-scalar",offset:Q,indent:z,props:V,source:K}}case'"':return{type:"double-quoted-scalar",offset:Q,indent:z,source:q,end:W};case"'":return{type:"single-quoted-scalar",offset:Q,indent:z,source:q,end:W};default:return{type:"scalar",offset:Q,indent:z,source:q,end:W}}}function gU($,X,Z={}){let{afterKey:z=!1,implicitKey:J=!1,inFlow:Q=!1,type:Y}=Z,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 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=sX.stringifyString({type:Y,value:X},{implicitKey:J||q===null,indent:q!==null&&q>0?" ".repeat(q):"",inFlow:Q,options:{blockQuote:!0,lineWidth:-1}});switch(W[0]){case"|":case">":hU($,W);break;case'"':J8($,W,"double-quoted-scalar");break;case"'":J8($,W,"single-quoted-scalar");break;default:J8($,W,"scalar")}}function hU($,X){let Z=X.indexOf(`
137
- `),z=X.substring(0,Z),J=X.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=z,$.source=J}else{let{offset:Q}=$,Y="indent"in $?$.indent:-1,q=[{type:"block-scalar-header",offset:Q,indent:Y,source:z}];if(!aX(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 aX($,X){if(X)for(let Z of X)switch(Z.type){case"space":case"comment":$.push(Z);break;case"newline":return $.push(Z),!0}return!1}function J8($,X,Z){switch($.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":$.type=Z,$.source=X;break;case"block-scalar":{let z=$.props.slice(1),J=X.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:Z,source:X,end:z});break}case"block-map":case"block-seq":{let J={type:"newline",offset:$.offset+X.length,indent:$.indent,source:`
140
- `};delete $.items,Object.assign($,{type:Z,source:X,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:Z,indent:z,source:X,end:J})}}}vU.createScalarToken=yU;vU.resolveAsScalar=kU;vU.setScalarValue=gU});var tX=D((pU)=>{var cU=($)=>("type"in $)?K4($):V4($);function K4($){switch($.type){case"block-scalar":{let X="";for(let Z of $.props)X+=K4(Z);return X+$.source}case"block-map":case"block-seq":{let X="";for(let Z of $.items)X+=V4(Z);return X}case"flow-collection":{let X=$.start.source;for(let Z of $.items)X+=V4(Z);for(let Z of $.end)X+=Z.source;return X}case"document":{let X=V4($);if($.end)for(let Z of $.end)X+=Z.source;return X}default:{let X=$.source;if("end"in $&&$.end)for(let Z of $.end)X+=Z.source;return X}}}function V4({start:$,key:X,sep:Z,value:z}){let J="";for(let Q of $)J+=Q.source;if(X)J+=K4(X);if(Z)for(let Q of Z)J+=Q.source;if(z)J+=K4(z);return J}pU.stringify=cU});var XZ=D((nU)=>{var Q8=Symbol("break visit"),iU=Symbol("skip children"),eX=Symbol("remove item");function H$($,X){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};$Z(Object.freeze([]),$,X)}H$.BREAK=Q8;H$.SKIP=iU;H$.REMOVE=eX;H$.itemAtPath=($,X)=>{let Z=$;for(let[z,J]of X){let Q=Z?.[z];if(Q&&"items"in Q)Z=Q.items[J];else return}return Z};H$.parentCollection=($,X)=>{let Z=H$.itemAtPath($,X.slice(0,-1)),z=X[X.length-1][0],J=Z?.[z];if(J&&"items"in J)return J;throw Error("Parent collection not found")};function $Z($,X,Z){let z=Z(X,$);if(typeof z==="symbol")return z;for(let J of["key","value"]){let Q=X[J];if(Q&&"items"in Q){for(let Y=0;Y<Q.items.length;++Y){let q=$Z(Object.freeze($.concat([[J,Y]])),Q.items[Y],Z);if(typeof q==="number")Y=q-1;else if(q===Q8)return Q8;else if(q===eX)Q.items.splice(Y,1),Y-=1}if(typeof z==="function"&&J==="key")z=z(X,$)}}return typeof z==="function"?z(X,$):z}nU.visit=H$});var H4=D((XV)=>{var Y8=oX(),sU=tX(),aU=XZ(),q8="\uFEFF",W8="\x02",G8="\x18",U8="\x1F",oU=($)=>!!$&&("items"in $),tU=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function eU($){switch($){case q8:return"<BOM>";case W8:return"<DOC>";case G8:return"<FLOW_END>";case U8:return"<SCALAR>";default:return JSON.stringify($)}}function $V($){switch($){case q8:return"byte-order-mark";case W8:return"doc-mode";case G8:return"flow-error-end";case U8:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
135
+ `,V=[{type:"block-scalar-header",offset:Q,indent:z,source:U}];if(!aZ(V,W))V.push({type:"newline",offset:-1,indent:z,source:`
136
+ `});return{type:"block-scalar",offset:Q,indent:z,props:V,source:K}}case'"':return{type:"double-quoted-scalar",offset:Q,indent:z,source:q,end:W};case"'":return{type:"single-quoted-scalar",offset:Q,indent:z,source:q,end:W};default:return{type:"scalar",offset:Q,indent:z,source:q,end:W}}}function hU($,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 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=sZ.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">":vU($,W);break;case'"':J8($,W,"double-quoted-scalar");break;case"'":J8($,W,"single-quoted-scalar");break;default:J8($,W,"scalar")}}function vU($,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(!aZ(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 aZ($,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 J8($,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})}}}uU.createScalarToken=gU;uU.resolveAsScalar=yU;uU.setScalarValue=hU});var tZ=D((lU)=>{var pU=($)=>("type"in $)?K4($):V4($);function K4($){switch($.type){case"block-scalar":{let Z="";for(let X of $.props)Z+=K4(X);return Z+$.source}case"block-map":case"block-seq":{let Z="";for(let X of $.items)Z+=V4(X);return Z}case"flow-collection":{let Z=$.start.source;for(let X of $.items)Z+=V4(X);for(let X of $.end)Z+=X.source;return Z}case"document":{let Z=V4($);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 V4({start:$,key:Z,sep:X,value:z}){let J="";for(let Q of $)J+=Q.source;if(Z)J+=K4(Z);if(X)for(let Q of X)J+=Q.source;if(z)J+=K4(z);return J}lU.stringify=pU});var Z5=D((rU)=>{var Q8=Symbol("break visit"),nU=Symbol("skip children"),eZ=Symbol("remove item");function H$($,Z){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};$5(Object.freeze([]),$,Z)}H$.BREAK=Q8;H$.SKIP=nU;H$.REMOVE=eZ;H$.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};H$.parentCollection=($,Z)=>{let X=H$.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 $5($,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=$5(Object.freeze($.concat([[J,Y]])),Q.items[Y],X);if(typeof q==="number")Y=q-1;else if(q===Q8)return Q8;else if(q===eZ)Q.items.splice(Y,1),Y-=1}if(typeof z==="function"&&J==="key")z=z(Z,$)}}return typeof z==="function"?z(Z,$):z}rU.visit=H$});var H4=D((XV)=>{var Y8=oZ(),aU=tZ(),oU=Z5(),q8="\uFEFF",W8="\x02",G8="\x18",U8="\x1F",tU=($)=>!!$&&("items"in $),eU=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function $V($){switch($){case q8:return"<BOM>";case W8:return"<DOC>";case G8:return"<FLOW_END>";case U8:return"<SCALAR>";default:return JSON.stringify($)}}function ZV($){switch($){case q8:return"byte-order-mark";case W8:return"doc-mode";case G8:return"flow-error-end";case U8: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}XV.createScalarToken=Y8.createScalarToken;XV.resolveAsScalar=Y8.resolveAsScalar;XV.setScalarValue=Y8.setScalarValue;XV.stringify=sU.stringify;XV.visit=aU.visit;XV.BOM=q8;XV.DOCUMENT=W8;XV.FLOW_END=G8;XV.SCALAR=U8;XV.isCollection=oU;XV.isScalar=tU;XV.prettyToken=eU;XV.tokenType=$V});var K8=D((LV)=>{var b1=H4();function C0($){switch($){case void 0:case" ":case`
143
- `:case"\r":case"\t":return!0;default:return!1}}var ZZ=new Set("0123456789ABCDEFabcdef"),TV=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),N4=new Set(",[]{}"),BV=new Set(` ,[]{}
144
- \r `),V8=($)=>!$||BV.has($);class zZ{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($,X=!1){if($){if(typeof $!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+$:$,this.lineEndPos=null}this.atEnd=!X;let Z=this.next??"stream";while(Z&&(X||this.hasChars(1)))Z=yield*this.parseNext(Z)}atLineEnd(){let $=this.pos,X=this.buffer[$];while(X===" "||X==="\t")X=this.buffer[++$];if(!X||X==="#"||X===`
145
- `)return!0;if(X==="\r")return this.buffer[$+1]===`
146
- `;return!1}charAt($){return this.buffer[this.pos+$]}continueScalar($){let X=this.buffer[$];if(this.indentNext>0){let Z=0;while(X===" ")X=this.buffer[++Z+$];if(X==="\r"){let z=this.buffer[Z+$+1];if(z===`
147
- `||!z&&!this.atEnd)return $+Z+1}return X===`
148
- `||Z>=this.indentNext||!X&&!this.atEnd?$+Z:-1}if(X==="-"||X==="."){let Z=this.buffer.substr($,3);if((Z==="---"||Z==="...")&&C0(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]===b1.BOM)yield*this.pushCount(1),$=$.substring(1);if($[0]==="%"){let X=$.length,Z=$.indexOf("#");while(Z!==-1){let J=$[Z-1];if(J===" "||J==="\t"){X=Z-1;break}else Z=$.indexOf("#",Z+1)}while(!0){let J=$[X-1];if(J===" "||J==="\t")X-=1;else break}let z=(yield*this.pushCount(X))+(yield*this.pushSpaces(!0));return yield*this.pushCount($.length-z),this.pushNewline(),"stream"}if(this.atLineEnd()){let X=yield*this.pushSpaces(!0);return yield*this.pushCount($.length-X),yield*this.pushNewline(),"stream"}return yield b1.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 X=this.peek(3);if((X==="---"||X==="...")&&C0(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,X==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!C0(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[$,X]=this.peek(2);if(!X&&!this.atEnd)return this.setNext("block-start");if(($==="-"||$==="?"||$===":")&&C0(X)){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 X=yield*this.pushIndicators();switch($[X]){case"#":yield*this.pushCount($.length-X);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(V8),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return X+=yield*this.parseBlockScalarHeader(),X+=yield*this.pushSpaces(!0),yield*this.pushCount($.length-X),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let $,X,Z=-1;do{if($=yield*this.pushNewline(),$>0)X=yield*this.pushSpaces(!1),this.indentValue=Z=X;else X=0;X+=yield*this.pushSpaces(!0)}while($+X>0);let z=this.getLine();if(z===null)return this.setNext("flow");if(Z!==-1&&Z<this.indentNext&&z[0]!=="#"||Z===0&&(z.startsWith("---")||z.startsWith("..."))&&C0(z[3])){if(!(Z===this.indentNext-1&&this.flowLevel===1&&(z[0]==="]"||z[0]==="}")))return this.flowLevel=0,yield b1.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(V8),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let Q=this.charAt(1);if(this.flowKey||C0(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),X=this.buffer.indexOf($,this.pos+1);if($==="'")while(X!==-1&&this.buffer[X+1]==="'")X=this.buffer.indexOf("'",X+2);else while(X!==-1){let J=0;while(this.buffer[X-1-J]==="\\")J+=1;if(J%2===0)break;X=this.buffer.indexOf('"',X+1)}let Z=this.buffer.substring(0,X),z=Z.indexOf(`
150
- `,this.pos);if(z!==-1){while(z!==-1){let J=this.continueScalar(z+1);if(J===-1)break;z=Z.indexOf(`
151
- `,J)}if(z!==-1)X=z-(Z[z-1]==="\r"?2:1)}if(X===-1){if(!this.atEnd)return this.setNext("quoted-scalar");X=this.buffer.length}return yield*this.pushToIndex(X+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let $=this.pos;while(!0){let X=this.buffer[++$];if(X==="+")this.blockScalarKeep=!0;else if(X>"0"&&X<="9")this.blockScalarIndent=Number(X)-1;else if(X!=="-")break}return yield*this.pushUntil((X)=>C0(X)||X==="#")}*parseBlockScalar(){let $=this.pos-1,X=0,Z;$:for(let J=this.pos;Z=this.buffer[J];++J)switch(Z){case" ":X+=1;break;case`
152
- `:$=J,X=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(!Z&&!this.atEnd)return this.setNext("block-scalar");if(X>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=X;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;Z=this.buffer[z];while(Z===" ")Z=this.buffer[++z];if(Z==="\t"){while(Z==="\t"||Z===" "||Z==="\r"||Z===`
155
- `)Z=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+X>Y)$=J;else break}while(!0);return yield b1.SCALAR,yield*this.pushToIndex($+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let $=this.flowLevel>0,X=this.pos-1,Z=this.pos-1,z;while(z=this.buffer[++Z])if(z===":"){let J=this.buffer[Z+1];if(C0(J)||$&&N4.has(J))break;X=Z}else if(C0(z)){let J=this.buffer[Z+1];if(z==="\r")if(J===`
157
- `)Z+=1,z=`
158
- `,J=this.buffer[Z+1];else X=Z;if(J==="#"||$&&N4.has(J))break;if(z===`
159
- `){let Q=this.continueScalar(Z+1);if(Q===-1)break;Z=Math.max(Z,Q-2)}}else{if($&&N4.has(z))break;X=Z}if(!z&&!this.atEnd)return this.setNext("plain-scalar");return yield b1.SCALAR,yield*this.pushToIndex(X+1,!0),$?"flow":"doc"}*pushCount($){if($>0)return yield this.buffer.substr(this.pos,$),this.pos+=$,$;return 0}*pushToIndex($,X){let Z=this.buffer.slice(this.pos,$);if(Z)return yield Z,this.pos+=Z.length,Z.length;else if(X)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(V8))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let $=this.flowLevel>0,X=this.charAt(1);if(C0(X)||$&&N4.has(X)){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,X=this.buffer[$];while(!C0(X)&&X!==">")X=this.buffer[++$];return yield*this.pushToIndex(X===">"?$+1:$,!1)}else{let $=this.pos+1,X=this.buffer[$];while(X)if(TV.has(X))X=this.buffer[++$];else if(X==="%"&&ZZ.has(this.buffer[$+1])&&ZZ.has(this.buffer[$+2]))X=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
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}XV.createScalarToken=Y8.createScalarToken;XV.resolveAsScalar=Y8.resolveAsScalar;XV.setScalarValue=Y8.setScalarValue;XV.stringify=aU.stringify;XV.visit=oU.visit;XV.BOM=q8;XV.DOCUMENT=W8;XV.FLOW_END=G8;XV.SCALAR=U8;XV.isCollection=tU;XV.isScalar=eU;XV.prettyToken=$V;XV.tokenType=ZV});var K8=D((MV)=>{var b1=H4();function C0($){switch($){case void 0:case" ":case`
143
+ `:case"\r":case"\t":return!0;default:return!1}}var X5=new Set("0123456789ABCDEFabcdef"),BV=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),N4=new Set(",[]{}"),LV=new Set(` ,[]{}
144
+ \r `),V8=($)=>!$||LV.has($);class z5{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex($,Z=!1){if($){if(typeof $!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+$:$,this.lineEndPos=null}this.atEnd=!Z;let X=this.next??"stream";while(X&&(Z||this.hasChars(1)))X=yield*this.parseNext(X)}atLineEnd(){let $=this.pos,Z=this.buffer[$];while(Z===" "||Z==="\t")Z=this.buffer[++$];if(!Z||Z==="#"||Z===`
145
+ `)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==="...")&&C0(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]===b1.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 b1.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==="...")&&C0(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&&!C0(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(($==="-"||$==="?"||$===":")&&C0(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(V8),"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("..."))&&C0(z[3])){if(!(X===this.indentNext-1&&this.flowLevel===1&&(z[0]==="]"||z[0]==="}")))return this.flowLevel=0,yield b1.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(V8),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let Q=this.charAt(1);if(this.flowKey||C0(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)=>C0(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`
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 b1.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(C0(J)||$&&N4.has(J))break;Z=X}else if(C0(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==="#"||$&&N4.has(J))break;if(z===`
159
+ `){let Q=this.continueScalar(X+1);if(Q===-1)break;X=Math.max(X,Q-2)}}else{if($&&N4.has(z))break;Z=X}if(!z&&!this.atEnd)return this.setNext("plain-scalar");return yield b1.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(V8))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let $=this.flowLevel>0,Z=this.charAt(1);if(C0(Z)||$&&N4.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(!C0(Z)&&Z!==">")Z=this.buffer[++$];return yield*this.pushToIndex(Z===">"?$+1:$,!1)}else{let $=this.pos+1,Z=this.buffer[$];while(Z)if(BV.has(Z))Z=this.buffer[++$];else if(Z==="%"&&X5.has(this.buffer[$+1])&&X5.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 X=this.pos-1,Z;do Z=this.buffer[++X];while(Z===" "||$&&Z==="\t");let z=X-this.pos;if(z>0)yield this.buffer.substr(this.pos,z),this.pos=X;return z}*pushUntil($){let X=this.pos,Z=this.buffer[X];while(!$(Z))Z=this.buffer[++X];return yield*this.pushToIndex(X,!1)}}LV.Lexer=zZ});var H8=D((OV)=>{class JZ{constructor(){this.lineStarts=[],this.addNewLine=($)=>this.lineStarts.push($),this.linePos=($)=>{let X=0,Z=this.lineStarts.length;while(X<Z){let J=X+Z>>1;if(this.lineStarts[J]<$)X=J+1;else Z=J}if(this.lineStarts[X]===$)return{line:X+1,col:1};if(X===0)return{line:0,col:$};let z=this.lineStarts[X-1];return{line:X,col:$-z+1}}}}OV.LineCounter=JZ});var N8=D((FV)=>{var DV=B0("process"),QZ=H4(),AV=K8();function s0($,X){for(let Z=0;Z<$.length;++Z)if($[Z].type===X)return!0;return!1}function YZ($){for(let X=0;X<$.length;++X)switch($[X].type){case"space":case"comment":case"newline":break;default:return X}return-1}function WZ($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function T4($){switch($.type){case"document":return $.start;case"block-map":{let X=$.items[$.items.length-1];return X.sep??X.start}case"block-seq":return $.items[$.items.length-1].start;default:return[]}}function f$($){if($.length===0)return[];let X=$.length;$:while(--X>=0)switch($[X].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break $}while($[++X]?.type==="space");return $.splice(X,$.length)}function qZ($){if($.start.type==="flow-seq-start"){for(let X of $.items)if(X.sep&&!X.value&&!s0(X.start,"explicit-key-ind")&&!s0(X.sep,"map-value-ind")){if(X.key)X.value=X.key;if(delete X.key,WZ(X.value))if(X.value.end)Array.prototype.push.apply(X.value.end,X.sep);else X.value.end=X.sep;else Array.prototype.push.apply(X.start,X.sep);delete X.sep}}}class GZ{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 AV.Lexer,this.onNewLine=$}*parse($,X=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let Z of this.lexer.lex($,X))yield*this.next(Z);if(!X)yield*this.end()}*next($){if(this.source=$,DV.env.LOG_TOKENS)console.log("|",QZ.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let X=QZ.tokenType($);if(!X){let Z=`Not a YAML token: ${$}`;yield*this.pop({type:"error",offset:this.offset,message:Z,source:$}),this.offset+=$.length}else if(X==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=X,yield*this.step(),X){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 X=$??this.stack.pop();if(!X)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield X;else{let Z=this.peek(1);if(X.type==="block-scalar")X.indent="indent"in Z?Z.indent:0;else if(X.type==="flow-collection"&&Z.type==="document")X.indent=0;if(X.type==="flow-collection")qZ(X);switch(Z.type){case"document":Z.value=X;break;case"block-scalar":Z.props.push(X);break;case"block-map":{let z=Z.items[Z.items.length-1];if(z.value){Z.items.push({start:[],key:X,sep:[]}),this.onKeyLine=!0;return}else if(z.sep)z.value=X;else{Object.assign(z,{key:X,sep:[]}),this.onKeyLine=!z.explicitKey;return}break}case"block-seq":{let z=Z.items[Z.items.length-1];if(z.value)Z.items.push({start:[],value:X});else z.value=X;break}case"flow-collection":{let z=Z.items[Z.items.length-1];if(!z||z.value)Z.items.push({start:[],key:X,sep:[]});else if(z.sep)z.value=X;else Object.assign(z,{key:X,sep:[]});return}default:yield*this.pop(),yield*this.pop(X)}if((Z.type==="document"||Z.type==="block-map"||Z.type==="block-seq")&&(X.type==="block-map"||X.type==="block-seq")){let z=X.items[X.items.length-1];if(z&&!z.sep&&!z.value&&z.start.length>0&&YZ(z.start)===-1&&(X.indent===0||z.start.every((J)=>J.type!=="comment"||J.indent<X.indent))){if(Z.type==="document")Z.end=z.start;else Z.items.push({start:z.start});X.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(YZ($.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 X=this.startBlockValue($);if(X)this.stack.push(X);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 X=T4(this.peek(2)),Z=f$(X),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:Z,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 X=this.source.indexOf(`
162
- `)+1;while(X!==0)this.onNewLine(this.offset+X),X=this.source.indexOf(`
163
- `,X)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap($){let X=$.items[$.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,X.value){let Z="end"in X.value?X.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(X.sep)X.sep.push(this.sourceToken);else X.start.push(this.sourceToken);return;case"space":case"comment":if(X.value)$.items.push({start:[this.sourceToken]});else if(X.sep)X.sep.push(this.sourceToken);else{if(this.atIndentedComment(X.start,$.indent)){let z=$.items[$.items.length-2]?.value?.end;if(Array.isArray(z)){Array.prototype.push.apply(z,X.start),z.push(this.sourceToken),$.items.pop();return}}X.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let Z=!this.onKeyLine&&this.indent===$.indent,z=Z&&(X.sep||X.explicitKey)&&this.type!=="seq-item-ind",J=[];if(z&&X.sep&&!X.value){let Q=[];for(let Y=0;Y<X.sep.length;++Y){let q=X.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=X.sep.splice(Q[1])}switch(this.type){case"anchor":case"tag":if(z||X.value)J.push(this.sourceToken),$.items.push({start:J}),this.onKeyLine=!0;else if(X.sep)X.sep.push(this.sourceToken);else X.start.push(this.sourceToken);return;case"explicit-key-ind":if(!X.sep&&!X.explicitKey)X.start.push(this.sourceToken),X.explicitKey=!0;else if(z||X.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(X.explicitKey)if(!X.sep)if(s0(X.start,"newline"))Object.assign(X,{key:null,sep:[this.sourceToken]});else{let Q=f$(X.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Q,key:null,sep:[this.sourceToken]}]})}else if(X.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(s0(X.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(WZ(X.key)&&!s0(X.sep,"newline")){let Q=f$(X.start),Y=X.key,q=X.sep;q.push(this.sourceToken),delete X.key,delete X.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)X.sep=X.sep.concat(J,this.sourceToken);else X.sep.push(this.sourceToken);else if(!X.sep)Object.assign(X,{key:null,sep:[this.sourceToken]});else if(X.value||z)$.items.push({start:J,key:null,sep:[this.sourceToken]});else if(s0(X.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else X.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||X.value)$.items.push({start:J,key:Q,sep:[]}),this.onKeyLine=!0;else if(X.sep)this.stack.push(Q);else Object.assign(X,{key:Q,sep:[]}),this.onKeyLine=!0;return}default:{let Q=this.startBlockValue($);if(Q){if(Q.type==="block-seq"){if(!X.explicitKey&&X.sep&&!s0(X.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 X=$.items[$.items.length-1];switch(this.type){case"newline":if(X.value){let Z="end"in X.value?X.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 X.start.push(this.sourceToken);return;case"space":case"comment":if(X.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(X.start,$.indent)){let z=$.items[$.items.length-2]?.value?.end;if(Array.isArray(z)){Array.prototype.push.apply(z,X.start),z.push(this.sourceToken),$.items.pop();return}}X.start.push(this.sourceToken)}return;case"anchor":case"tag":if(X.value||this.indent<=$.indent)break;X.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==$.indent)break;if(X.value||s0(X.start,"seq-item-ind"))$.items.push({start:[this.sourceToken]});else X.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 X=$.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(!X||X.sep)$.items.push({start:[this.sourceToken]});else X.start.push(this.sourceToken);return;case"map-value-ind":if(!X||X.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(X.sep)X.sep.push(this.sourceToken);else Object.assign(X,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!X||X.value)$.items.push({start:[this.sourceToken]});else if(X.sep)X.sep.push(this.sourceToken);else X.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let z=this.flowScalar(this.type);if(!X||X.value)$.items.push({start:[],key:z,sep:[]});else if(X.sep)this.stack.push(z);else Object.assign(X,{key:z,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 z=T4(Z),J=f$(z);qZ($);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 X=this.source.indexOf(`
164
- `)+1;while(X!==0)this.onNewLine(this.offset+X),X=this.source.indexOf(`
165
- `,X)+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 X=T4($),Z=f$(X);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 X=T4($),Z=f$(X);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Z,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,X){if(this.type!=="comment")return!1;if(this.indent<=X)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()}}}FV.Parser=GZ});var NZ=D((bV)=>{var UZ=z8(),RV=E1(),x1=C1(),PV=H6(),EV=h(),CV=H8(),VZ=N8();function KZ($){let X=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||X&&new CV.LineCounter||null,prettyErrors:X}}function _V($,X={}){let{lineCounter:Z,prettyErrors:z}=KZ(X),J=new VZ.Parser(Z?.addNewLine),Q=new UZ.Composer(X),Y=Array.from(Q.compose(J.parse($)));if(z&&Z)for(let q of Y)q.errors.forEach(x1.prettifyError($,Z)),q.warnings.forEach(x1.prettifyError($,Z));if(Y.length>0)return Y;return Object.assign([],{empty:!0},Q.streamInfo())}function HZ($,X={}){let{lineCounter:Z,prettyErrors:z}=KZ(X),J=new VZ.Parser(Z?.addNewLine),Q=new UZ.Composer(X),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 x1.YAMLParseError(q.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&Z)Y.errors.forEach(x1.prettifyError($,Z)),Y.warnings.forEach(x1.prettifyError($,Z));return Y}function SV($,X,Z){let z=void 0;if(typeof X==="function")z=X;else if(Z===void 0&&X&&typeof X==="object")Z=X;let J=HZ($,Z);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},Z))}function jV($,X,Z){let z=null;if(typeof X==="function"||Array.isArray(X))z=X;else if(Z===void 0&&X)Z=X;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??X??{};if(!J)return}if(EV.isDocument($)&&!z)return $.toString(Z);return new RV.Document($,z,Z).toString(Z)}bV.parse=SV;bV.parseAllDocuments=_V;bV.parseDocument=HZ;bV.stringify=jV});var AZ={};c3(AZ,{orange:()=>o0,italic:()=>DK,fafCyan:()=>R,dim:()=>M,bold:()=>f});var M8=($)=>(X)=>`\x1B[${$}m${X}\x1B[0m`,f,M,DK,R=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,o0=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var l=C(()=>{f=M8("1"),M=M8("2"),DK=M8("3")});var I8=D((TM,tK)=>{tK.exports={name:"faf-cli",version:"6.3.3",description:"Persistent AI Context Standard — project DNA for AI. IANA-registered. Anthropic-approved.",type:"module",icon:"https://faf.one/orange-smiley.svg",logo:"https://faf.one/orange-smiley.svg",main:"dist/index.js",bin:{faf:"dist/cli.js","faf-cli":"dist/cli.js"},exports:{".":{bun:"./src/index.ts",default:"./dist/index.js"}},files:["dist/**/*","README.md","LICENSE","project.faf"],scripts:{dev:"bun src/cli.ts",build:"bun build src/cli.ts --outfile dist/cli.js --target=node --minify --external faf-scoring-kernel --external open && bun build src/index.ts --outfile dist/index.js --target=node --minify --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","test:watch":"bun test --watch",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 A($,X,Z,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 X==="function"?$!==X||!J:!X.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return z==="a"?J.call($,Z):J?J.value=Z:X.set($,Z),Z}function H($,X,Z,z){if(Z==="a"&&!z)throw TypeError("Private accessor was defined without a getter");if(typeof X==="function"?$!==X||!z:!X.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return Z==="m"?z:Z==="a"?z.call($):z?z.value:X.get($)}var k0=()=>{};var E8=function(){let{crypto:$}=globalThis;if($?.randomUUID)return E8=$.randomUUID.bind($),$.randomUUID();let X=new Uint8Array(1),Z=$?()=>$.getRandomValues(X)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(z)=>(+z^Z()&15>>+z/4).toString(16))};function y0($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var u1=($)=>{if($ instanceof Error)return $;if(typeof $==="object"&&$!==null){try{if(Object.prototype.toString.call($)==="[object Error]"){let X=Error($.message,$.cause?{cause:$.cause}:{});if($.stack)X.stack=$.stack;if($.cause&&!X.cause)X.cause=$.cause;if($.name)X.name=$.name;return X}}catch{}try{return Error(JSON.stringify($))}catch{}}return Error($)};var P,J0,U0,t0,u$,m$,d$,c$,p$,l$,i$,n$,r$;var N0=C(()=>{P=class P extends Error{};J0=class J0 extends P{constructor($,X,Z,z,J){super(`${J0.makeMessage($,X,Z)}`);this.status=$,this.headers=z,this.requestID=z?.get("request-id"),this.error=X,this.type=J??null}static makeMessage($,X,Z){let z=X?.message?typeof X.message==="string"?X.message:JSON.stringify(X.message):X?JSON.stringify(X):Z;if($&&z)return`${$} ${z}`;if($)return`${$} status code (no body)`;if(z)return z;return"(no status code or body)"}static generate($,X,Z,z){if(!$||!z)return new t0({message:Z,cause:u1(X)});let J=X,Q=J?.error?.type;if($===400)return new m$($,J,Z,z,Q);if($===401)return new d$($,J,Z,z,Q);if($===403)return new c$($,J,Z,z,Q);if($===404)return new p$($,J,Z,z,Q);if($===409)return new l$($,J,Z,z,Q);if($===422)return new i$($,J,Z,z,Q);if($===429)return new n$($,J,Z,z,Q);if($>=500)return new r$($,J,Z,z,Q);return new J0($,J,Z,z,Q)}};U0=class U0 extends J0{constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}};t0=class t0 extends J0{constructor({message:$,cause:X}){super(void 0,void 0,$||"Connection error.",void 0);if(X)this.cause=X}};u$=class u$ extends t0{constructor({message:$}={}){super({message:$??"Request timed out."})}};m$=class m$ extends J0{};d$=class d$ extends J0{};c$=class c$ extends J0{};p$=class p$ extends J0{};l$=class l$ extends J0{};i$=class i$ extends J0{};n$=class n$ extends J0{};r$=class r$ extends J0{}});function A4($){if(typeof $!=="object")return{};return $??{}}function S8($){if(!$)return!0;for(let X in $)return!1;return!0}function A5($,X){return Object.prototype.hasOwnProperty.call($,X)}var RH,D5=($)=>{return RH.test($)},C8=($)=>(C8=Array.isArray,C8($)),_8,F5=($,X)=>{if(typeof X!=="number"||!Number.isInteger(X))throw new P(`${$} must be an integer`);if(X<0)throw new P(`${$} must be a positive integer`);return X},F4=($)=>{try{return JSON.parse($)}catch(X){return}};var B$=C(()=>{N0();RH=/^[a-z][a-z0-9+.-]*:/i,_8=C8});var I5=($)=>new Promise((X)=>setTimeout(X,$));var e0="0.91.1";function PH(){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 CH(){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:X,pattern:Z}of $){let z=Z.exec(navigator.userAgent);if(z){let J=z[1]||0,Q=z[2]||0,Y=z[3]||0;return{browser:X,version:`${J}.${Q}.${Y}`}}}return null}var C5=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"},EH=()=>{let $=PH();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":e0,"X-Stainless-OS":P5(Deno.build.os),"X-Stainless-Arch":R5(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":e0,"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":e0,"X-Stainless-OS":P5(globalThis.process.platform??"unknown"),"X-Stainless-Arch":R5(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let X=CH();if(X)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":e0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${X.browser}`,"X-Stainless-Runtime-Version":X.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":e0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},R5=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},P5=($)=>{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"},E5,_5=()=>{return E5??(E5=EH())};var j8=()=>{};function S5(){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 b8(...$){let X=globalThis.ReadableStream;if(typeof X>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new X(...$)}function I4($){let X=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return b8({start(){},async pull(Z){let{done:z,value:J}=await X.next();if(z)Z.close();else Z.enqueue(J)},async cancel(){await X.return?.()}})}function m1($){if($[Symbol.asyncIterator])return $;let X=$.getReader();return{async next(){try{let Z=await X.read();if(Z?.done)X.releaseLock();return Z}catch(Z){throw X.releaseLock(),Z}},async return(){let Z=X.cancel();return X.releaseLock(),await Z,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function j5($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let X=$.getReader(),Z=X.cancel();X.releaseLock(),await Z}var b5=({headers:$,body:X})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(X)}};function x5($){return Object.entries($).filter(([X,Z])=>typeof Z<"u").map(([X,Z])=>{if(typeof Z==="string"||typeof Z==="number"||typeof Z==="boolean")return`${encodeURIComponent(X)}=${encodeURIComponent(Z)}`;if(Z===null)return`${encodeURIComponent(X)}=`;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 f5=C(()=>{N0()});function g5($){let X=0;for(let J of $)X+=J.length;let Z=new Uint8Array(X),z=0;for(let J of $)Z.set(J,z),z+=J.length;return Z}function d1($){let X;return(k5??(X=new globalThis.TextEncoder,k5=X.encode.bind(X)))($)}function x8($){let X;return(y5??(X=new globalThis.TextDecoder,y5=X.decode.bind(X)))($)}var k5,y5;class $${constructor(){M0.set(this,void 0),O0.set(this,void 0),A(this,M0,new Uint8Array,"f"),A(this,O0,null,"f")}decode($){if($==null)return[];let X=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?d1($):$;A(this,M0,g5([H(this,M0,"f"),X]),"f");let Z=[],z;while((z=jH(H(this,M0,"f"),H(this,O0,"f")))!=null){if(z.carriage&&H(this,O0,"f")==null){A(this,O0,z.index,"f");continue}if(H(this,O0,"f")!=null&&(z.index!==H(this,O0,"f")+1||z.carriage)){Z.push(x8(H(this,M0,"f").subarray(0,H(this,O0,"f")-1))),A(this,M0,H(this,M0,"f").subarray(H(this,O0,"f")),"f"),A(this,O0,null,"f");continue}let J=H(this,O0,"f")!==null?z.preceding-1:z.preceding,Q=x8(H(this,M0,"f").subarray(0,J));Z.push(Q),A(this,M0,H(this,M0,"f").subarray(z.index),"f"),A(this,O0,null,"f")}return Z}flush(){if(!H(this,M0,"f").length)return[];return this.decode(`
166
- `)}}function jH($,X){for(let J=X??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 h5($){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 M0,O0;var f8=C(()=>{k0();M0=new WeakMap,O0=new WeakMap;$$.NEWLINE_CHARS=new Set([`
167
- `,"\r"]);$$.NEWLINE_REGEXP=/\r\n|[\n\r]/g});function c1(){}function R4($,X,Z){if(!X||P4[$]>P4[Z])return c1;else return X[$].bind(X)}function G0($){let X=$.logger,Z=$.logLevel??"off";if(!X)return bH;let z=v5.get(X);if(z&&z[0]===Z)return z[1];let J={error:R4("error",X,Z),warn:R4("warn",X,Z),info:R4("info",X,Z),debug:R4("debug",X,Z)};return v5.set(X,[Z,J]),J}var P4,k8=($,X,Z)=>{if(!$)return;if(A5(P4,$))return $;G0(Z).warn(`${X} was set to ${JSON.stringify($)}, expected one of ${JSON.stringify(Object.keys(P4))}`);return},bH,v5,g0=($)=>{if($.options)$.options={...$.options},delete $.options.headers;if($.headers)$.headers=Object.fromEntries(($.headers instanceof Headers?[...$.headers]:Object.entries($.headers)).map(([X,Z])=>[X,X.toLowerCase()==="x-api-key"||X.toLowerCase()==="authorization"||X.toLowerCase()==="cookie"||X.toLowerCase()==="set-cookie"?"***":Z]));if("retryOfRequestLogID"in $){if($.retryOfRequestLogID)$.retryOf=$.retryOfRequestLogID;delete $.retryOfRequestLogID}return $};var E4=C(()=>{B$();P4={off:0,error:200,warn:300,info:400,debug:500};bH={error:c1,warn:c1,info:c1,debug:c1},v5=new WeakMap});async function*xH($,X){if(!$.body){if(X.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 u5,z=new $$,J=m1($.body);for await(let Q of fH(J))for(let Y of z.decode(Q)){let q=Z.decode(Y);if(q)yield q}for(let Q of z.flush()){let Y=Z.decode(Q);if(Y)yield Y}}async function*fH($){let X=new Uint8Array;for await(let Z of $){if(Z==null)continue;let z=Z instanceof ArrayBuffer?new Uint8Array(Z):typeof Z==="string"?d1(Z):Z,J=new Uint8Array(X.length+z.length);J.set(X),J.set(z,X.length),X=J;let Q;while((Q=h5(X))!==-1)yield X.slice(0,Q),X=X.slice(Q)}if(X.length>0)yield X}class u5{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[X,Z,z]=kH($,":");if(z.startsWith(" "))z=z.substring(1);if(X==="event")this.event=z;else if(X==="data")this.data.push(z);return null}}function kH($,X){let Z=$.indexOf(X);if(Z!==-1)return[$.substring(0,Z),X,$.substring(Z+X.length)];return[$,"",""]}var p1,w0;var y8=C(()=>{k0();N0();f8();B$();E4();N0();w0=class w0{constructor($,X,Z){this.iterator=$,p1.set(this,void 0),this.controller=X,A(this,p1,Z,"f")}static fromSSEResponse($,X,Z){let z=!1,J=Z?G0(Z):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 xH($,X)){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=F4(q.data)??q.data,G=W?.error?.type;throw new J0(void 0,W,void 0,$.headers,G)}}Y=!0}catch(q){if(y0(q))return;throw q}finally{if(!Y)X.abort()}}return new w0(Q,X,Z)}static fromReadableStream($,X,Z){let z=!1;async function*J(){let Y=new $$,q=m1($);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(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(y0(q))return;throw q}finally{if(!Y)X.abort()}}return new w0(Q,X,Z)}[(p1=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let $=[],X=[],Z=this.iterator(),z=(J)=>{return{next:()=>{if(J.length===0){let Q=Z.next();$.push(Q),X.push(Q)}return J.shift()}}};return[new w0(()=>z($),this.controller,H(this,p1,"f")),new w0(()=>z(X),this.controller,H(this,p1,"f"))]}toReadableStream(){let $=this,X;return b8({async start(){X=$[Symbol.asyncIterator]()},async pull(Z){try{let{value:z,done:J}=await X.next();if(J)return Z.close();let Q=d1(JSON.stringify(z)+`
169
- `);Z.enqueue(Q)}catch(z){Z.error(z)}},async cancel(){await X.return?.()}})}}});async function C4($,X){let{response:Z,requestLogID:z,retryOfRequestLogID:J,startTime:Q}=X,Y=await(async()=>{if(X.options.stream){if(G0($).debug("response",Z.status,Z.url,Z.headers,Z.body),X.options.__streamClass)return X.options.__streamClass.fromSSEResponse(Z,X.controller);return w0.fromSSEResponse(Z,X.controller)}if(Z.status===204)return null;if(X.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 V=await Z.json();return g8(V,Z)}return await Z.text()})();return G0($).debug(`[${z}] response parsed`,g0({retryOfRequestLogID:J,url:Z.url,status:Z.status,body:Y,durationMs:Date.now()-Q})),Y}function g8($,X){if(!$||typeof $!=="object"||Array.isArray($))return $;return Object.defineProperty($,"_request_id",{value:X.headers.get("request-id"),enumerable:!1})}var h8=C(()=>{y8();E4()});var l1,X$;var _4=C(()=>{k0();h8();X$=class X$ extends Promise{constructor($,X,Z=C4){super((z)=>{z(null)});this.responsePromise=X,this.parseResponse=Z,l1.set(this,void 0),A(this,l1,$,"f")}_thenUnwrap($){return new X$(H(this,l1,"f"),this.responsePromise,async(X,Z)=>g8($(await this.parseResponse(X,Z),Z),Z.response))}asResponse(){return this.responsePromise.then(($)=>$.response)}async withResponse(){let[$,X]=await Promise.all([this.parse(),this.asResponse()]);return{data:$,response:X,request_id:X.headers.get("request-id")}}parse(){if(!this.parsedPromise)this.parsedPromise=this.responsePromise.then(($)=>this.parseResponse(H(this,l1,"f"),$));return this.parsedPromise}then($,X){return this.parse().then($,X)}catch($){return this.parse().catch($)}finally($){return this.parse().finally($)}};l1=new WeakMap});var S4,v8,i1,_0,p;var $0=C(()=>{k0();N0();h8();_4();B$();v8=class v8{constructor($,X,Z,z){S4.set(this,void 0),A(this,S4,$,"f"),this.options=z,this.response=X,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,S4,"f").requestAPIList(this.constructor,$)}async*iterPages(){let $=this;yield $;while($.hasNextPage())$=await $.getNextPage(),yield $}async*[(S4=new WeakMap,Symbol.asyncIterator)](){for await(let $ of this.iterPages())for(let X of $.getPaginatedItems())yield X}};i1=class i1 extends X${constructor($,X,Z){super($,X,async(z,J)=>new Z(z,J.response,await C4(z,J),J.options))}async*[Symbol.asyncIterator](){let $=await this;for await(let X of $)yield X}};_0=class _0 extends v8{constructor($,X,Z,z){super($,X,Z,z);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 X=this.first_id;if(!X)return null;return{...this.options,query:{...A4(this.options.query),before_id:X}}}let $=this.last_id;if(!$)return null;return{...this.options,query:{...A4(this.options.query),after_id:$}}}};p=class p extends v8{constructor($,X,Z,z){super($,X,Z,z);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:{...A4(this.options.query),page:$}}}}});function L$($,X,Z){return m8(),new File($,X??"unknown_file",Z)}function n1($,X){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 X?Z.split(/[\\/]/).pop()||void 0:Z}function gH($){let X=typeof $==="function"?$:$.fetch,Z=m5.get(X);if(Z)return Z;let z=(async()=>{try{let J="Response"in X?X.Response:(await X("data:,")).constructor,Q=new FormData;if(Q.toString()===await new J(Q).text())return!1;return!0}catch{return!0}})();return m5.set(X,z),z}var m8=()=>{if(typeof File>"u"){let{process:$}=globalThis,X=typeof $?.versions?.node==="string"&&parseInt($.versions.node.split("."))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(X?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}},d8=($)=>$!=null&&typeof $==="object"&&typeof $[Symbol.asyncIterator]==="function",s$=async($,X,Z=!0)=>{return{...$,body:await hH($.body,X,Z)}},m5,hH=async($,X,Z=!0)=>{if(!await gH(X))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])=>u8(z,J,Q,Z))),z},vH=($)=>$ instanceof Blob&&("name"in $),u8=async($,X,Z,z)=>{if(Z===void 0)return;if(Z==null)throw TypeError(`Received null for "${X}"; to pass null in FormData, you must use the string 'null'`);if(typeof Z==="string"||typeof Z==="number"||typeof Z==="boolean")$.append(X,String(Z));else if(Z instanceof Response){let J={},Q=Z.headers.get("Content-Type");if(Q)J={type:Q};$.append(X,L$([await Z.blob()],n1(Z,z),J))}else if(d8(Z))$.append(X,L$([await new Response(I4(Z)).blob()],n1(Z,z)));else if(vH(Z))$.append(X,L$([Z],n1(Z,z),{type:Z.type}));else if(Array.isArray(Z))await Promise.all(Z.map((J)=>u8($,X+"[]",J,z)));else if(typeof Z==="object")await Promise.all(Object.entries(Z).map(([J,Q])=>u8($,`${X}[${J}]`,Q,z)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${Z} instead`)};var a$=C(()=>{m5=new WeakMap});async function r1($,X,Z){if(m8(),$=await $,X||(X=n1($,!0)),uH($)){if($ instanceof File&&X==null&&Z==null)return $;return L$([await $.arrayBuffer()],X??$.name,{type:$.type,lastModified:$.lastModified,...Z})}if(mH($)){let J=await $.blob();return X||(X=new URL($.url).pathname.split(/[\\/]/).pop()),L$(await c8(J),X,Z)}let z=await c8($);if(!Z?.type){let J=z.find((Q)=>typeof Q==="object"&&("type"in Q)&&Q.type);if(typeof J==="string")Z={...Z,type:J}}return L$(z,X,Z)}async function c8($){let X=[];if(typeof $==="string"||ArrayBuffer.isView($)||$ instanceof ArrayBuffer)X.push($);else if(d5($))X.push($ instanceof Blob?$:await $.arrayBuffer());else if(d8($))for await(let Z of $)X.push(...await c8(Z));else{let Z=$?.constructor?.name;throw Error(`Unexpected data type: ${typeof $}${Z?`; constructor: ${Z}`:""}${dH($)}`)}return X}function dH($){if(typeof $!=="object"||$===null)return"";return`; props: [${Object.getOwnPropertyNames($).map((Z)=>`"${Z}"`).join(", ")}]`}var d5=($)=>$!=null&&typeof $==="object"&&typeof $.size==="number"&&typeof $.type==="string"&&typeof $.text==="function"&&typeof $.slice==="function"&&typeof $.arrayBuffer==="function",uH=($)=>$!=null&&typeof $==="object"&&typeof $.name==="string"&&typeof $.lastModified==="number"&&d5($),mH=($)=>$!=null&&typeof $==="object"&&typeof $.url==="string"&&typeof $.blob==="function";var c5=C(()=>{a$();a$()});var p8=C(()=>{c5()});var p5=()=>{};class x{constructor($){this._client=$}}function*pH($){if(!$)return;if(l5 in $){let{values:z,nulls:J}=$;yield*z.entries();for(let Q of J)yield[Q,null];return}let X=!1,Z;if($ instanceof Headers)Z=$.entries();else if(_8($))Z=$;else X=!0,Z=Object.entries($??{});for(let z of Z){let J=z[0];if(typeof J!=="string")throw TypeError("expected header name to be a string");let Q=_8(z[1])?z[1]:[z[1]],Y=!1;for(let q of Q){if(q===void 0)continue;if(X&&!Y)Y=!0,yield[J,null];yield[J,q]}}}var l5,B=($)=>{let X=new Headers,Z=new Set;for(let z of $){let J=new Set;for(let[Q,Y]of pH(z)){let q=Q.toLowerCase();if(!J.has(q))X.delete(Q),J.add(q);if(Y===null)X.delete(Q),Z.add(q);else X.append(Q,Y),Z.delete(q)}}return{[l5]:!0,values:X,nulls:Z}};var n=C(()=>{B$();l5=Symbol.for("brand.privateNullableHeaders")});function n5($){return $.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var i5,lH=($=n5)=>function(Z,...z){if(Z.length===1)return Z[0];let J=!1,Q=[],Y=Z.reduce((U,K,V)=>{if(/[?#]/.test(K))J=!0;let T=z[V],O=(J?encodeURIComponent:$)(""+T);if(V!==z.length&&(T==null||typeof T==="object"&&T.toString===Object.getPrototypeOf(Object.getPrototypeOf(T.hasOwnProperty??i5)??i5)?.toString))O=T+"",Q.push({start:U.length+K.length,length:O.length,error:`Value of type ${Object.prototype.toString.call(T).slice(8,-1)} is not a valid path parameter`});return U+K+(V===z.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,K)=>U.start-K.start),Q.length>0){let U=0,K=Q.reduce((V,T)=>{let O=" ".repeat(T.start-U),N="^".repeat(T.length);return U=T.start+T.length,V+O+N},"");throw new P(`Path parameters result in path with invalid segments:
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)}}MV.Lexer=z5});var H8=D((wV)=>{class J5{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}}}}wV.LineCounter=J5});var N8=D((IV)=>{var AV=B0("process"),Q5=H4(),FV=K8();function s0($,Z){for(let X=0;X<$.length;++X)if($[X].type===Z)return!0;return!1}function Y5($){for(let Z=0;Z<$.length;++Z)switch($[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function W5($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function T4($){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 f$($){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 q5($){if($.start.type==="flow-seq-start"){for(let Z of $.items)if(Z.sep&&!Z.value&&!s0(Z.start,"explicit-key-ind")&&!s0(Z.sep,"map-value-ind")){if(Z.key)Z.value=Z.key;if(delete Z.key,W5(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 G5{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 FV.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=$,AV.env.LOG_TOKENS)console.log("|",Q5.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let Z=Q5.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")q5(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&&Y5(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(Y5($.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=T4(this.peek(2)),X=f$(Z),z;if($.end)z=$.end,z.push(this.sourceToken),delete $.end;else z=[this.sourceToken];let J={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:X,key:$,sep:z}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=J}else yield*this.lineEnd($)}*blockScalar($){switch(this.type){case"space":case"comment":case"newline":$.props.push(this.sourceToken);return;case"scalar":if($.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let Z=this.source.indexOf(`
162
+ `)+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(s0(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let Q=f$(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(s0(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(W5(Z.key)&&!s0(Z.sep,"newline")){let Q=f$(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(s0(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&&!s0(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||s0(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=T4(X),J=f$(z);q5($);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
+ `)+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=T4($),X=f$(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=T4($),X=f$(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()}}}IV.Parser=G5});var N5=D((xV)=>{var U5=z8(),PV=E1(),x1=C1(),EV=H6(),CV=h(),_V=H8(),V5=N8();function K5($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new _V.LineCounter||null,prettyErrors:Z}}function SV($,Z={}){let{lineCounter:X,prettyErrors:z}=K5(Z),J=new V5.Parser(X?.addNewLine),Q=new U5.Composer(Z),Y=Array.from(Q.compose(J.parse($)));if(z&&X)for(let q of Y)q.errors.forEach(x1.prettifyError($,X)),q.warnings.forEach(x1.prettifyError($,X));if(Y.length>0)return Y;return Object.assign([],{empty:!0},Q.streamInfo())}function H5($,Z={}){let{lineCounter:X,prettyErrors:z}=K5(Z),J=new V5.Parser(X?.addNewLine),Q=new U5.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 x1.YAMLParseError(q.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&X)Y.errors.forEach(x1.prettifyError($,X)),Y.warnings.forEach(x1.prettifyError($,X));return Y}function jV($,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=H5($,X);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:z},X))}function bV($,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(CV.isDocument($)&&!z)return $.toString(X);return new PV.Document($,z,X).toString(X)}xV.parse=jV;xV.parseAllDocuments=SV;xV.parseDocument=H5;xV.stringify=bV});var F5={};c3(F5,{orange:()=>o0,italic:()=>FK,fafCyan:()=>I,dim:()=>M,bold:()=>f});var M8=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,f,M,FK,I=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,o0=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var l=E(()=>{f=M8("1"),M=M8("2"),FK=M8("3")});var I8=D((OM,ZH)=>{ZH.exports={name:"faf-cli",version:"6.4.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 A($,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 k0=()=>{};var E8=function(){let{crypto:$}=globalThis;if($?.randomUUID)return E8=$.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 y0($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var u1=($)=>{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,J0,U0,t0,u$,m$,d$,c$,p$,l$,i$,n$,r$;var N0=E(()=>{P=class P extends Error{};J0=class J0 extends P{constructor($,Z,X,z,J){super(`${J0.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 t0({message:X,cause:u1(Z)});let J=Z,Q=J?.error?.type;if($===400)return new m$($,J,X,z,Q);if($===401)return new d$($,J,X,z,Q);if($===403)return new c$($,J,X,z,Q);if($===404)return new p$($,J,X,z,Q);if($===409)return new l$($,J,X,z,Q);if($===422)return new i$($,J,X,z,Q);if($===429)return new n$($,J,X,z,Q);if($>=500)return new r$($,J,X,z,Q);return new J0($,J,X,z,Q)}};U0=class U0 extends J0{constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}};t0=class t0 extends J0{constructor({message:$,cause:Z}){super(void 0,void 0,$||"Connection error.",void 0);if(Z)this.cause=Z}};u$=class u$ extends t0{constructor({message:$}={}){super({message:$??"Request timed out."})}};m$=class m$ extends J0{};d$=class d$ extends J0{};c$=class c$ extends J0{};p$=class p$ extends J0{};l$=class l$ extends J0{};i$=class i$ extends J0{};n$=class n$ extends J0{};r$=class r$ extends J0{}});function A4($){if(typeof $!=="object")return{};return $??{}}function S8($){if(!$)return!0;for(let Z in $)return!1;return!0}function FX($,Z){return Object.prototype.hasOwnProperty.call($,Z)}var CH,AX=($)=>{return CH.test($)},C8=($)=>(C8=Array.isArray,C8($)),_8,IX=($,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},F4=($)=>{try{return JSON.parse($)}catch(Z){return}};var B$=E(()=>{N0();CH=/^[a-z][a-z0-9+.-]*:/i,_8=C8});var RX=($)=>new Promise((Z)=>setTimeout(Z,$));var e0="0.91.1";function _H(){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 jH(){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 _X=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"},SH=()=>{let $=_H();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":e0,"X-Stainless-OS":EX(Deno.build.os),"X-Stainless-Arch":PX(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":e0,"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":e0,"X-Stainless-OS":EX(globalThis.process.platform??"unknown"),"X-Stainless-Arch":PX(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let Z=jH();if(Z)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":e0,"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":e0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},PX=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},EX=($)=>{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,SX=()=>{return CX??(CX=SH())};var j8=()=>{};function jX(){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 b8(...$){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 I4($){let Z=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return b8({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 m1($){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 bX($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let Z=$.getReader(),X=Z.cancel();Z.releaseLock(),await X}var xX=({headers:$,body:Z})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(Z)}};function fX($){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 kX=E(()=>{N0()});function hX($){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 d1($){let Z;return(yX??(Z=new globalThis.TextEncoder,yX=Z.encode.bind(Z)))($)}function x8($){let Z;return(gX??(Z=new globalThis.TextDecoder,gX=Z.decode.bind(Z)))($)}var yX,gX;class $${constructor(){M0.set(this,void 0),O0.set(this,void 0),A(this,M0,new Uint8Array,"f"),A(this,O0,null,"f")}decode($){if($==null)return[];let Z=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?d1($):$;A(this,M0,hX([H(this,M0,"f"),Z]),"f");let X=[],z;while((z=fH(H(this,M0,"f"),H(this,O0,"f")))!=null){if(z.carriage&&H(this,O0,"f")==null){A(this,O0,z.index,"f");continue}if(H(this,O0,"f")!=null&&(z.index!==H(this,O0,"f")+1||z.carriage)){X.push(x8(H(this,M0,"f").subarray(0,H(this,O0,"f")-1))),A(this,M0,H(this,M0,"f").subarray(H(this,O0,"f")),"f"),A(this,O0,null,"f");continue}let J=H(this,O0,"f")!==null?z.preceding-1:z.preceding,Q=x8(H(this,M0,"f").subarray(0,J));X.push(Q),A(this,M0,H(this,M0,"f").subarray(z.index),"f"),A(this,O0,null,"f")}return X}flush(){if(!H(this,M0,"f").length)return[];return this.decode(`
166
+ `)}}function fH($,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 vX($){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 M0,O0;var f8=E(()=>{k0();M0=new WeakMap,O0=new WeakMap;$$.NEWLINE_CHARS=new Set([`
167
+ `,"\r"]);$$.NEWLINE_REGEXP=/\r\n|[\n\r]/g});function c1(){}function R4($,Z,X){if(!Z||P4[$]>P4[X])return c1;else return Z[$].bind(Z)}function G0($){let Z=$.logger,X=$.logLevel??"off";if(!Z)return kH;let z=uX.get(Z);if(z&&z[0]===X)return z[1];let J={error:R4("error",Z,X),warn:R4("warn",Z,X),info:R4("info",Z,X),debug:R4("debug",Z,X)};return uX.set(Z,[X,J]),J}var P4,k8=($,Z,X)=>{if(!$)return;if(FX(P4,$))return $;G0(X).warn(`${Z} was set to ${JSON.stringify($)}, expected one of ${JSON.stringify(Object.keys(P4))}`);return},kH,uX,g0=($)=>{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 E4=E(()=>{B$();P4={off:0,error:200,warn:300,info:400,debug:500};kH={error:c1,warn:c1,info:c1,debug:c1},uX=new WeakMap});async function*yH($,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 mX,z=new $$,J=m1($.body);for await(let Q of gH(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*gH($){let Z=new Uint8Array;for await(let X of $){if(X==null)continue;let z=X instanceof ArrayBuffer?new Uint8Array(X):typeof X==="string"?d1(X):X,J=new Uint8Array(Z.length+z.length);J.set(Z),J.set(z,Z.length),Z=J;let Q;while((Q=vX(Z))!==-1)yield Z.slice(0,Q),Z=Z.slice(Q)}if(Z.length>0)yield Z}class mX{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]=hH($,":");if(z.startsWith(" "))z=z.substring(1);if(Z==="event")this.event=z;else if(Z==="data")this.data.push(z);return null}}function hH($,Z){let X=$.indexOf(Z);if(X!==-1)return[$.substring(0,X),Z,$.substring(X+Z.length)];return[$,"",""]}var p1,w0;var y8=E(()=>{k0();N0();f8();B$();E4();N0();w0=class w0{constructor($,Z,X){this.iterator=$,p1.set(this,void 0),this.controller=Z,A(this,p1,X,"f")}static fromSSEResponse($,Z,X){let z=!1,J=X?G0(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 yH($,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=F4(q.data)??q.data,G=W?.error?.type;throw new J0(void 0,W,void 0,$.headers,G)}}Y=!0}catch(q){if(y0(q))return;throw q}finally{if(!Y)Z.abort()}}return new w0(Q,Z,X)}static fromReadableStream($,Z,X){let z=!1;async function*J(){let Y=new $$,q=m1($);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(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(y0(q))return;throw q}finally{if(!Y)Z.abort()}}return new w0(Q,Z,X)}[(p1=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 w0(()=>z($),this.controller,H(this,p1,"f")),new w0(()=>z(Z),this.controller,H(this,p1,"f"))]}toReadableStream(){let $=this,Z;return b8({async start(){Z=$[Symbol.asyncIterator]()},async pull(X){try{let{value:z,done:J}=await Z.next();if(J)return X.close();let Q=d1(JSON.stringify(z)+`
169
+ `);X.enqueue(Q)}catch(z){X.error(z)}},async cancel(){await Z.return?.()}})}}});async function C4($,Z){let{response:X,requestLogID:z,retryOfRequestLogID:J,startTime:Q}=Z,Y=await(async()=>{if(Z.options.stream){if(G0($).debug("response",X.status,X.url,X.headers,X.body),Z.options.__streamClass)return Z.options.__streamClass.fromSSEResponse(X,Z.controller);return w0.fromSSEResponse(X,Z.controller)}if(X.status===204)return null;if(Z.options.__binaryResponse)return X;let W=X.headers.get("content-type")?.split(";")[0]?.trim();if(W?.includes("application/json")||W?.endsWith("+json")){if(X.headers.get("content-length")==="0")return;let V=await X.json();return g8(V,X)}return await X.text()})();return G0($).debug(`[${z}] response parsed`,g0({retryOfRequestLogID:J,url:X.url,status:X.status,body:Y,durationMs:Date.now()-Q})),Y}function g8($,Z){if(!$||typeof $!=="object"||Array.isArray($))return $;return Object.defineProperty($,"_request_id",{value:Z.headers.get("request-id"),enumerable:!1})}var h8=E(()=>{y8();E4()});var l1,Z$;var _4=E(()=>{k0();h8();Z$=class Z$ extends Promise{constructor($,Z,X=C4){super((z)=>{z(null)});this.responsePromise=Z,this.parseResponse=X,l1.set(this,void 0),A(this,l1,$,"f")}_thenUnwrap($){return new Z$(H(this,l1,"f"),this.responsePromise,async(Z,X)=>g8($(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,l1,"f"),$));return this.parsedPromise}then($,Z){return this.parse().then($,Z)}catch($){return this.parse().catch($)}finally($){return this.parse().finally($)}};l1=new WeakMap});var S4,v8,i1,_0,p;var $0=E(()=>{k0();N0();h8();_4();B$();v8=class v8{constructor($,Z,X,z){S4.set(this,void 0),A(this,S4,$,"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,S4,"f").requestAPIList(this.constructor,$)}async*iterPages(){let $=this;yield $;while($.hasNextPage())$=await $.getNextPage(),yield $}async*[(S4=new WeakMap,Symbol.asyncIterator)](){for await(let $ of this.iterPages())for(let Z of $.getPaginatedItems())yield Z}};i1=class i1 extends Z${constructor($,Z,X){super($,Z,async(z,J)=>new X(z,J.response,await C4(z,J),J.options))}async*[Symbol.asyncIterator](){let $=await this;for await(let Z of $)yield Z}};_0=class _0 extends v8{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:{...A4(this.options.query),before_id:Z}}}let $=this.last_id;if(!$)return null;return{...this.options,query:{...A4(this.options.query),after_id:$}}}};p=class p extends v8{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:{...A4(this.options.query),page:$}}}}});function L$($,Z,X){return m8(),new File($,Z??"unknown_file",X)}function n1($,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 uH($){let Z=typeof $==="function"?$:$.fetch,X=dX.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 dX.set(Z,z),z}var m8=()=>{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`.":""))}},d8=($)=>$!=null&&typeof $==="object"&&typeof $[Symbol.asyncIterator]==="function",s$=async($,Z,X=!0)=>{return{...$,body:await mH($.body,Z,X)}},dX,mH=async($,Z,X=!0)=>{if(!await uH(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])=>u8(z,J,Q,X))),z},dH=($)=>$ instanceof Blob&&("name"in $),u8=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,L$([await X.blob()],n1(X,z),J))}else if(d8(X))$.append(Z,L$([await new Response(I4(X)).blob()],n1(X,z)));else if(dH(X))$.append(Z,L$([X],n1(X,z),{type:X.type}));else if(Array.isArray(X))await Promise.all(X.map((J)=>u8($,Z+"[]",J,z)));else if(typeof X==="object")await Promise.all(Object.entries(X).map(([J,Q])=>u8($,`${Z}[${J}]`,Q,z)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${X} instead`)};var a$=E(()=>{dX=new WeakMap});async function r1($,Z,X){if(m8(),$=await $,Z||(Z=n1($,!0)),cH($)){if($ instanceof File&&Z==null&&X==null)return $;return L$([await $.arrayBuffer()],Z??$.name,{type:$.type,lastModified:$.lastModified,...X})}if(pH($)){let J=await $.blob();return Z||(Z=new URL($.url).pathname.split(/[\\/]/).pop()),L$(await c8(J),Z,X)}let z=await c8($);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 L$(z,Z,X)}async function c8($){let Z=[];if(typeof $==="string"||ArrayBuffer.isView($)||$ instanceof ArrayBuffer)Z.push($);else if(cX($))Z.push($ instanceof Blob?$:await $.arrayBuffer());else if(d8($))for await(let X of $)Z.push(...await c8(X));else{let X=$?.constructor?.name;throw Error(`Unexpected data type: ${typeof $}${X?`; constructor: ${X}`:""}${lH($)}`)}return Z}function lH($){if(typeof $!=="object"||$===null)return"";return`; props: [${Object.getOwnPropertyNames($).map((X)=>`"${X}"`).join(", ")}]`}var cX=($)=>$!=null&&typeof $==="object"&&typeof $.size==="number"&&typeof $.type==="string"&&typeof $.text==="function"&&typeof $.slice==="function"&&typeof $.arrayBuffer==="function",cH=($)=>$!=null&&typeof $==="object"&&typeof $.name==="string"&&typeof $.lastModified==="number"&&cX($),pH=($)=>$!=null&&typeof $==="object"&&typeof $.url==="string"&&typeof $.blob==="function";var pX=E(()=>{a$();a$()});var p8=E(()=>{pX()});var lX=()=>{};class x{constructor($){this._client=$}}function*nH($){if(!$)return;if(iX 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(_8($))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=_8(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 iX,B=($)=>{let Z=new Headers,X=new Set;for(let z of $){let J=new Set;for(let[Q,Y]of nH(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{[iX]:!0,values:Z,nulls:X}};var n=E(()=>{B$();iX=Symbol.for("brand.privateNullableHeaders")});function rX($){return $.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var nX,rH=($=rX)=>function(X,...z){if(X.length===1)return X[0];let J=!1,Q=[],Y=X.reduce((U,K,V)=>{if(/[?#]/.test(K))J=!0;let T=z[V],O=(J?encodeURIComponent:$)(""+T);if(V!==z.length&&(T==null||typeof T==="object"&&T.toString===Object.getPrototypeOf(Object.getPrototypeOf(T.hasOwnProperty??nX)??nX)?.toString))O=T+"",Q.push({start:U.length+K.length,length:O.length,error:`Value of type ${Object.prototype.toString.call(T).slice(8,-1)} is not a valid path parameter`});return U+K+(V===z.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,K)=>U.start-K.start),Q.length>0){let U=0,K=Q.reduce((V,T)=>{let O=" ".repeat(T.start-U),N="^".repeat(T.length);return U=T.start+T.length,V+O+N},"");throw new P(`Path parameters result in path with invalid segments:
170
170
  ${Q.map((V)=>V.error).join(`
171
171
  `)}
172
172
  ${Y}
173
- ${K}`)}return Y},w;var Q0=C(()=>{N0();i5=Object.freeze(Object.create(null)),w=lH(n5)});var s1;var l8=C(()=>{$0();n();Q0();s1=class s1 extends x{create($,X){let{betas:Z,...z}=$;return this._client.post("/v1/environments?beta=true",{body:z,...X,headers:B([{"anthropic-beta":[...Z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}retrieve($,X={},Z){let{betas:z}=X??{};return this._client.get(w`/v1/environments/${$}?beta=true`,{...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}update($,X,Z){let{betas:z,...J}=X;return this._client.post(w`/v1/environments/${$}?beta=true`,{body:J,...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}list($={},X){let{betas:Z,...z}=$??{};return this._client.getAPIList("/v1/environments?beta=true",p,{query:z,...X,headers:B([{"anthropic-beta":[...Z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}delete($,X={},Z){let{betas:z}=X??{};return this._client.delete(w`/v1/environments/${$}?beta=true`,{...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}archive($,X={},Z){let{betas:z}=X??{};return this._client.post(w`/v1/environments/${$}/archive?beta=true`,{...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}}});function j4($){return typeof $==="object"&&$!==null&&a1 in $}function i8($,X){let Z=new Set;if($){for(let z of $)if(j4(z))Z.add(z[a1])}if(X)for(let z of X){if(j4(z))Z.add(z[a1]);if(Array.isArray(z.content)){for(let J of z.content)if(j4(J))Z.add(J[a1])}}return Array.from(Z)}function b4($,X){let Z=i8($,X);if(Z.length===0)return{};return{"x-stainless-helper":Z.join(", ")}}function r5($){if(j4($))return{"x-stainless-helper":$[a1]};return{}}var a1;var o1=C(()=>{a1=Symbol("anthropic.sdk.stainlessHelper")});var t1;var n8=C(()=>{$0();n();o1();a$();Q0();t1=class t1 extends x{list($={},X){let{betas:Z,...z}=$??{};return this._client.getAPIList("/v1/files?beta=true",_0,{query:z,...X,headers:B([{"anthropic-beta":[...Z??[],"files-api-2025-04-14"].toString()},X?.headers])})}delete($,X={},Z){let{betas:z}=X??{};return this._client.delete(w`/v1/files/${$}?beta=true`,{...Z,headers:B([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString()},Z?.headers])})}download($,X={},Z){let{betas:z}=X??{};return this._client.get(w`/v1/files/${$}/content?beta=true`,{...Z,headers:B([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},Z?.headers]),__binaryResponse:!0})}retrieveMetadata($,X={},Z){let{betas:z}=X??{};return this._client.get(w`/v1/files/${$}?beta=true`,{...Z,headers:B([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString()},Z?.headers])})}upload($,X){let{betas:Z,...z}=$;return this._client.post("/v1/files?beta=true",s$({body:z,...X,headers:B([{"anthropic-beta":[...Z??[],"files-api-2025-04-14"].toString()},r5(z.file),X?.headers])},this._client))}}});var e1;var r8=C(()=>{$0();n();Q0();e1=class e1 extends x{retrieve($,X={},Z){let{betas:z}=X??{};return this._client.get(w`/v1/models/${$}?beta=true`,{...Z,headers:B([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},Z?.headers])})}list($={},X){let{betas:Z,...z}=$??{};return this._client.getAPIList("/v1/models?beta=true",_0,{query:z,...X,headers:B([{...Z?.toString()!=null?{"anthropic-beta":Z?.toString()}:void 0},X?.headers])})}}});var $2;var s8=C(()=>{$0();n();Q0();$2=class $2 extends x{create($,X){let{betas:Z,...z}=$;return this._client.post("/v1/user_profiles?beta=true",{body:z,...X,headers:B([{"anthropic-beta":[...Z??[],"user-profiles-2026-03-24"].toString()},X?.headers])})}retrieve($,X={},Z){let{betas:z}=X??{};return this._client.get(w`/v1/user_profiles/${$}?beta=true`,{...Z,headers:B([{"anthropic-beta":[...z??[],"user-profiles-2026-03-24"].toString()},Z?.headers])})}update($,X,Z){let{betas:z,...J}=X;return this._client.post(w`/v1/user_profiles/${$}?beta=true`,{body:J,...Z,headers:B([{"anthropic-beta":[...z??[],"user-profiles-2026-03-24"].toString()},Z?.headers])})}list($={},X){let{betas:Z,...z}=$??{};return this._client.getAPIList("/v1/user_profiles?beta=true",p,{query:z,...X,headers:B([{"anthropic-beta":[...Z??[],"user-profiles-2026-03-24"].toString()},X?.headers])})}createEnrollmentURL($,X={},Z){let{betas:z}=X??{};return this._client.post(w`/v1/user_profiles/${$}/enrollment_url?beta=true`,{...Z,headers:B([{"anthropic-beta":[...z??[],"user-profiles-2026-03-24"].toString()},Z?.headers])})}}});var X2;var a8=C(()=>{$0();n();Q0();X2=class X2 extends x{list($,X={},Z){let{betas:z,...J}=X??{};return this._client.getAPIList(w`/v1/agents/${$}/versions?beta=true`,p,{query:J,...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}}});var o$;var o8=C(()=>{a8();a8();$0();n();Q0();o$=class o$ extends x{constructor(){super(...arguments);this.versions=new X2(this._client)}create($,X){let{betas:Z,...z}=$;return this._client.post("/v1/agents?beta=true",{body:z,...X,headers:B([{"anthropic-beta":[...Z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}retrieve($,X={},Z){let{betas:z,...J}=X??{};return this._client.get(w`/v1/agents/${$}?beta=true`,{query:J,...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}update($,X,Z){let{betas:z,...J}=X;return this._client.post(w`/v1/agents/${$}?beta=true`,{body:J,...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}list($={},X){let{betas:Z,...z}=$??{};return this._client.getAPIList("/v1/agents?beta=true",p,{query:z,...X,headers:B([{"anthropic-beta":[...Z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,X={},Z){let{betas:z}=X??{};return this._client.post(w`/v1/agents/${$}/archive?beta=true`,{...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}};o$.Versions=X2});var Z2;var t8=C(()=>{$0();n();Q0();Z2=class Z2 extends x{create($,X,Z){let{view:z,betas:J,...Q}=X;return this._client.post(w`/v1/memory_stores/${$}/memories?beta=true`,{query:{view:z},body:Q,...Z,headers:B([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,X,Z){let{memory_store_id:z,betas:J,...Q}=X;return this._client.get(w`/v1/memory_stores/${z}/memories/${$}?beta=true`,{query:Q,...Z,headers:B([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}update($,X,Z){let{memory_store_id:z,view:J,betas:Q,...Y}=X;return this._client.post(w`/v1/memory_stores/${z}/memories/${$}?beta=true`,{query:{view:J},body:Y,...Z,headers:B([{"anthropic-beta":[...Q??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}list($,X={},Z){let{betas:z,...J}=X??{};return this._client.getAPIList(w`/v1/memory_stores/${$}/memories?beta=true`,p,{query:J,...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,X,Z){let{memory_store_id:z,expected_content_sha256:J,betas:Q}=X;return this._client.delete(w`/v1/memory_stores/${z}/memories/${$}?beta=true`,{query:{expected_content_sha256:J},...Z,headers:B([{"anthropic-beta":[...Q??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}}});var z2;var e8=C(()=>{$0();n();Q0();z2=class z2 extends x{retrieve($,X,Z){let{memory_store_id:z,betas:J,...Q}=X;return this._client.get(w`/v1/memory_stores/${z}/memory_versions/${$}?beta=true`,{query:Q,...Z,headers:B([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}list($,X={},Z){let{betas:z,...J}=X??{};return this._client.getAPIList(w`/v1/memory_stores/${$}/memory_versions?beta=true`,p,{query:J,...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}redact($,X,Z){let{memory_store_id:z,betas:J}=X;return this._client.post(w`/v1/memory_stores/${z}/memory_versions/${$}/redact?beta=true`,{...Z,headers:B([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}}});var M$;var $3=C(()=>{t8();t8();e8();e8();$0();n();Q0();M$=class M$ extends x{constructor(){super(...arguments);this.memories=new Z2(this._client),this.memoryVersions=new z2(this._client)}create($,X){let{betas:Z,...z}=$;return this._client.post("/v1/memory_stores?beta=true",{body:z,...X,headers:B([{"anthropic-beta":[...Z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}retrieve($,X={},Z){let{betas:z}=X??{};return this._client.get(w`/v1/memory_stores/${$}?beta=true`,{...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}update($,X,Z){let{betas:z,...J}=X;return this._client.post(w`/v1/memory_stores/${$}?beta=true`,{body:J,...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}list($={},X){let{betas:Z,...z}=$??{};return this._client.getAPIList("/v1/memory_stores?beta=true",p,{query:z,...X,headers:B([{"anthropic-beta":[...Z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}delete($,X={},Z){let{betas:z}=X??{};return this._client.delete(w`/v1/memory_stores/${$}?beta=true`,{...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}archive($,X={},Z){let{betas:z}=X??{};return this._client.post(w`/v1/memory_stores/${$}/archive?beta=true`,{...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}};M$.Memories=Z2;M$.MemoryVersions=z2});var t$=C(()=>{N0()});var x4;var X3=C(()=>{x4={"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 s5($){return $?.output_format??$?.output_config?.format}function Z3($,X,Z){let z=s5(X);if(!X||!("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 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 z3($,X,Z)}function z3($,X,Z){let z=null,J=$.content.map((Q)=>{if(Q.type==="text"){let Y=XN(X,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 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:z}}function XN($,X){let Z=s5($);if(Z?.type!=="json_schema")return null;try{if("parse"in Z)return Z.parse(X);return JSON.parse(X)}catch(z){throw new P(`Failed to parse structured output: ${z}`)}}var J3=C(()=>{N0()});var ZN=($)=>{let X=0,Z=[];while(X<$.length){let z=$[X];if(z==="\\"){X++;continue}if(z==="{"){Z.push({type:"brace",value:"{"}),X++;continue}if(z==="}"){Z.push({type:"brace",value:"}"}),X++;continue}if(z==="["){Z.push({type:"paren",value:"["}),X++;continue}if(z==="]"){Z.push({type:"paren",value:"]"}),X++;continue}if(z===":"){Z.push({type:"separator",value:":"}),X++;continue}if(z===","){Z.push({type:"delimiter",value:","}),X++;continue}if(z==='"'){let q="",W=!1;z=$[++X];while(z!=='"'){if(X===$.length){W=!0;break}if(z==="\\"){if(X++,X===$.length){W=!0;break}q+=z+$[X],z=$[++X]}else q+=z,z=$[++X]}if(z=$[++X],!W)Z.push({type:"string",value:q});continue}if(z&&/\s/.test(z)){X++;continue}let Q=/[0-9]/;if(z&&Q.test(z)||z==="-"||z==="."){let q="";if(z==="-")q+=z,z=$[++X];while(z&&Q.test(z)||z===".")q+=z,z=$[++X];Z.push({type:"number",value:q});continue}let Y=/[a-z]/i;if(z&&Y.test(z)){let q="";while(z&&Y.test(z)){if(X===$.length)break;q+=z,z=$[++X]}if(q=="true"||q=="false"||q==="null")Z.push({type:"name",value:q});else{X++;continue}continue}X++}return Z},e$=($)=>{if($.length===0)return $;let X=$[$.length-1];switch(X.type){case"separator":return $=$.slice(0,$.length-1),e$($);break;case"number":let Z=X.value[X.value.length-1];if(Z==="."||Z==="-")return $=$.slice(0,$.length-1),e$($);case"string":let z=$[$.length-2];if(z?.type==="delimiter")return $=$.slice(0,$.length-1),e$($);else if(z?.type==="brace"&&z.value==="{")return $=$.slice(0,$.length-1),e$($);break;case"delimiter":return $=$.slice(0,$.length-1),e$($);break}return $},zN=($)=>{let X=[];if($.map((Z)=>{if(Z.type==="brace")if(Z.value==="{")X.push("}");else X.splice(X.lastIndexOf("}"),1);if(Z.type==="paren")if(Z.value==="[")X.push("]");else X.splice(X.lastIndexOf("]"),1)}),X.length>0)X.reverse().map((Z)=>{if(Z==="}")$.push({type:"brace",value:"}"});else if(Z==="]")$.push({type:"paren",value:"]"})});return $},JN=($)=>{let X="";return $.map((Z)=>{switch(Z.type){case"string":X+='"'+Z.value+'"';break;default:X+=Z.value;break}}),X},f4=($)=>JSON.parse(JN(zN(e$(ZN($)))));var Q3=()=>{};var Y3=C(()=>{y8()});function e5($){return $.type==="tool_use"||$.type==="server_tool_use"||$.type==="mcp_tool_use"}function $7($){}var R0,Z$,$1,J2,k4,Q2,Y2,y4,q2,h0,W2,g4,h4,O$,v4,u4,G2,q3,a5,m4,W3,G3,U3,o5,t5="__json_buf",U2;var X7=C(()=>{k0();Q3();t$();Y3();J3();U2=class U2{constructor($,X){R0.add(this),this.messages=[],this.receivedMessages=[],Z$.set(this,void 0),$1.set(this,null),this.controller=new AbortController,J2.set(this,void 0),k4.set(this,()=>{}),Q2.set(this,()=>{}),Y2.set(this,void 0),y4.set(this,()=>{}),q2.set(this,()=>{}),h0.set(this,{}),W2.set(this,!1),g4.set(this,!1),h4.set(this,!1),O$.set(this,!1),v4.set(this,void 0),u4.set(this,void 0),G2.set(this,void 0),m4.set(this,(Z)=>{if(A(this,g4,!0,"f"),y0(Z))Z=new U0;if(Z instanceof U0)return A(this,h4,!0,"f"),this._emit("abort",Z);if(Z instanceof P)return this._emit("error",Z);if(Z instanceof Error){let z=new P(Z.message);return z.cause=Z,this._emit("error",z)}return this._emit("error",new P(String(Z)))}),A(this,J2,new Promise((Z,z)=>{A(this,k4,Z,"f"),A(this,Q2,z,"f")}),"f"),A(this,Y2,new Promise((Z,z)=>{A(this,y4,Z,"f"),A(this,q2,z,"f")}),"f"),H(this,J2,"f").catch(()=>{}),H(this,Y2,"f").catch(()=>{}),A(this,$1,$,"f"),A(this,G2,X?.logger??console,"f")}get response(){return H(this,v4,"f")}get request_id(){return H(this,u4,"f")}async withResponse(){A(this,O$,!0,"f");let $=await H(this,J2,"f");if(!$)throw Error("Could not resolve a `Response` object");return{data:this,response:$,request_id:$.headers.get("request-id")}}static fromReadableStream($){let X=new U2(null);return X._run(()=>X._fromReadableStream($)),X}static createMessage($,X,Z,{logger:z}={}){let J=new U2(X,{logger:z});for(let Q of X.messages)J._addMessageParam(Q);return A(J,$1,{...X,stream:!0},"f"),J._run(()=>J._createMessage($,{...X,stream:!0},{...Z,headers:{...Z?.headers,"X-Stainless-Helper-Method":"stream"}})),J}_run($){$().then(()=>{this._emitFinal(),this._emit("end")},H(this,m4,"f"))}_addMessageParam($){this.messages.push($)}_addMessage($,X=!0){if(this.receivedMessages.push($),X)this._emit("message",$)}async _createMessage($,X,Z){let z=Z?.signal,J;if(z){if(z.aborted)this.controller.abort();J=this.controller.abort.bind(this.controller),z.addEventListener("abort",J)}try{H(this,R0,"m",W3).call(this);let{response:Q,data:Y}=await $.create({...X,stream:!0},{...Z,signal:this.controller.signal}).withResponse();this._connected(Q);for await(let q of Y)H(this,R0,"m",G3).call(this,q);if(Y.controller.signal?.aborted)throw new U0;H(this,R0,"m",U3).call(this)}finally{if(z&&J)z.removeEventListener("abort",J)}}_connected($){if(this.ended)return;A(this,v4,$,"f"),A(this,u4,$?.headers.get("request-id"),"f"),H(this,k4,"f").call(this,$),this._emit("connect")}get ended(){return H(this,W2,"f")}get errored(){return H(this,g4,"f")}get aborted(){return H(this,h4,"f")}abort(){this.controller.abort()}on($,X){return(H(this,h0,"f")[$]||(H(this,h0,"f")[$]=[])).push({listener:X}),this}off($,X){let Z=H(this,h0,"f")[$];if(!Z)return this;let z=Z.findIndex((J)=>J.listener===X);if(z>=0)Z.splice(z,1);return this}once($,X){return(H(this,h0,"f")[$]||(H(this,h0,"f")[$]=[])).push({listener:X,once:!0}),this}emitted($){return new Promise((X,Z)=>{if(A(this,O$,!0,"f"),$!=="error")this.once("error",Z);this.once($,X)})}async done(){A(this,O$,!0,"f"),await H(this,Y2,"f")}get currentMessage(){return H(this,Z$,"f")}async finalMessage(){return await this.done(),H(this,R0,"m",q3).call(this)}async finalText(){return await this.done(),H(this,R0,"m",a5).call(this)}_emit($,...X){if(H(this,W2,"f"))return;if($==="end")A(this,W2,!0,"f"),H(this,y4,"f").call(this);let Z=H(this,h0,"f")[$];if(Z)H(this,h0,"f")[$]=Z.filter((z)=>!z.once),Z.forEach(({listener:z})=>z(...X));if($==="abort"){let z=X[0];if(!H(this,O$,"f")&&!Z?.length)Promise.reject(z);H(this,Q2,"f").call(this,z),H(this,q2,"f").call(this,z),this._emit("end");return}if($==="error"){let z=X[0];if(!H(this,O$,"f")&&!Z?.length)Promise.reject(z);H(this,Q2,"f").call(this,z),H(this,q2,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",H(this,R0,"m",q3).call(this))}async _fromReadableStream($,X){let Z=X?.signal,z;if(Z){if(Z.aborted)this.controller.abort();z=this.controller.abort.bind(this.controller),Z.addEventListener("abort",z)}try{H(this,R0,"m",W3).call(this),this._connected(null);let J=w0.fromReadableStream($,this.controller);for await(let Q of J)H(this,R0,"m",G3).call(this,Q);if(J.controller.signal?.aborted)throw new U0;H(this,R0,"m",U3).call(this)}finally{if(Z&&z)Z.removeEventListener("abort",z)}}[(Z$=new WeakMap,$1=new WeakMap,J2=new WeakMap,k4=new WeakMap,Q2=new WeakMap,Y2=new WeakMap,y4=new WeakMap,q2=new WeakMap,h0=new WeakMap,W2=new WeakMap,g4=new WeakMap,h4=new WeakMap,O$=new WeakMap,v4=new WeakMap,u4=new WeakMap,G2=new WeakMap,m4=new WeakMap,R0=new WeakSet,q3=function(){if(this.receivedMessages.length===0)throw new P("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},a5=function(){if(this.receivedMessages.length===0)throw new P("stream ended without producing a Message with role=assistant");let X=this.receivedMessages.at(-1).content.filter((Z)=>Z.type==="text").map((Z)=>Z.text);if(X.length===0)throw new P("stream ended without producing a content block with type=text");return X.join(" ")},W3=function(){if(this.ended)return;A(this,Z$,void 0,"f")},G3=function(X){if(this.ended)return;let Z=H(this,R0,"m",o5).call(this,X);switch(this._emit("streamEvent",X,Z),X.type){case"content_block_delta":{let z=Z.content.at(-1);switch(X.delta.type){case"text_delta":{if(z.type==="text")this._emit("text",X.delta.text,z.text||"");break}case"citations_delta":{if(z.type==="text")this._emit("citation",X.delta.citation,z.citations??[]);break}case"input_json_delta":{if(e5(z)&&z.input)this._emit("inputJson",X.delta.partial_json,z.input);break}case"thinking_delta":{if(z.type==="thinking")this._emit("thinking",X.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:$7(X.delta)}break}case"message_stop":{this._addMessageParam(Z),this._addMessage(Z3(Z,H(this,$1,"f"),{logger:H(this,G2,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",Z.content.at(-1));break}case"message_start":{A(this,Z$,Z,"f");break}case"content_block_start":case"message_delta":break}},U3=function(){if(this.ended)throw new P("stream has ended, this shouldn't happen");let X=H(this,Z$,"f");if(!X)throw new P("request ended without sending any chunks");return A(this,Z$,void 0,"f"),Z3(X,H(this,$1,"f"),{logger:H(this,G2,"f")})},o5=function(X){let Z=H(this,Z$,"f");if(X.type==="message_start"){if(Z)throw new P(`Unexpected event order, got ${X.type} before receiving "message_stop"`);return X.message}if(!Z)throw new P(`Unexpected event order, got ${X.type} before "message_start"`);switch(X.type){case"message_stop":return Z;case"message_delta":if(Z.container=X.delta.container,Z.stop_reason=X.delta.stop_reason,Z.stop_sequence=X.delta.stop_sequence,Z.usage.output_tokens=X.usage.output_tokens,Z.context_management=X.context_management,X.usage.input_tokens!=null)Z.usage.input_tokens=X.usage.input_tokens;if(X.usage.cache_creation_input_tokens!=null)Z.usage.cache_creation_input_tokens=X.usage.cache_creation_input_tokens;if(X.usage.cache_read_input_tokens!=null)Z.usage.cache_read_input_tokens=X.usage.cache_read_input_tokens;if(X.usage.server_tool_use!=null)Z.usage.server_tool_use=X.usage.server_tool_use;if(X.usage.iterations!=null)Z.usage.iterations=X.usage.iterations;return Z;case"content_block_start":return Z.content.push(X.content_block),Z;case"content_block_delta":{let z=Z.content.at(X.index);switch(X.delta.type){case"text_delta":{if(z?.type==="text")Z.content[X.index]={...z,text:(z.text||"")+X.delta.text};break}case"citations_delta":{if(z?.type==="text")Z.content[X.index]={...z,citations:[...z.citations??[],X.delta.citation]};break}case"input_json_delta":{if(z&&e5(z)){let J=z[t5]||"";J+=X.delta.partial_json;let Q={...z};if(Object.defineProperty(Q,t5,{value:J,enumerable:!1,writable:!0}),J)try{Q.input=f4(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,m4,"f").call(this,q)}Z.content[X.index]=Q}break}case"thinking_delta":{if(z?.type==="thinking")Z.content[X.index]={...z,thinking:z.thinking+X.delta.thinking};break}case"signature_delta":{if(z?.type==="thinking")Z.content[X.index]={...z,signature:X.delta.signature};break}case"compaction_delta":{if(z?.type==="compaction")Z.content[X.index]={...z,content:(z.content||"")+X.delta.content};break}default:$7(X.delta)}return Z}case"content_block_stop":return Z}},Symbol.asyncIterator)](){let $=[],X=[],Z=!1;return this.on("streamEvent",(z)=>{let J=X.shift();if(J)J.resolve(z);else $.push(z)}),this.on("end",()=>{Z=!0;for(let z of X)z.resolve(void 0);X.length=0}),this.on("abort",(z)=>{Z=!0;for(let J of X)J.reject(z);X.length=0}),this.on("error",(z)=>{Z=!0;for(let J of X)J.reject(z);X.length=0}),{next:async()=>{if(!$.length){if(Z)return{value:void 0,done:!0};return new Promise((J,Q)=>X.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 w0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var X1;var d4=C(()=>{X1=class X1 extends Error{constructor($){let X=typeof $==="string"?$:$.map((Z)=>{if(Z.type==="text")return Z.text;return`[${Z.type}]`}).join(" ");super(X);this.name="ToolError",this.content=$}}});var Z7=1e5,z7=`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
+ ${K}`)}return Y},w;var Q0=E(()=>{N0();nX=Object.freeze(Object.create(null)),w=rH(rX)});var s1;var l8=E(()=>{$0();n();Q0();s1=class s1 extends x{create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/environments?beta=true",{body:z,...Z,headers:B([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(w`/v1/environments/${$}?beta=true`,{...X,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(w`/v1/environments/${$}?beta=true`,{body:J,...X,headers:B([{"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",p,{query:z,...Z,headers:B([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(w`/v1/environments/${$}?beta=true`,{...X,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(w`/v1/environments/${$}/archive?beta=true`,{...X,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});function j4($){return typeof $==="object"&&$!==null&&a1 in $}function i8($,Z){let X=new Set;if($){for(let z of $)if(j4(z))X.add(z[a1])}if(Z)for(let z of Z){if(j4(z))X.add(z[a1]);if(Array.isArray(z.content)){for(let J of z.content)if(j4(J))X.add(J[a1])}}return Array.from(X)}function b4($,Z){let X=i8($,Z);if(X.length===0)return{};return{"x-stainless-helper":X.join(", ")}}function sX($){if(j4($))return{"x-stainless-helper":$[a1]};return{}}var a1;var o1=E(()=>{a1=Symbol("anthropic.sdk.stainlessHelper")});var t1;var n8=E(()=>{$0();n();o1();a$();Q0();t1=class t1 extends x{list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/files?beta=true",_0,{query:z,...Z,headers:B([{"anthropic-beta":[...X??[],"files-api-2025-04-14"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(w`/v1/files/${$}?beta=true`,{...X,headers:B([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString()},X?.headers])})}download($,Z={},X){let{betas:z}=Z??{};return this._client.get(w`/v1/files/${$}/content?beta=true`,{...X,headers:B([{"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(w`/v1/files/${$}?beta=true`,{...X,headers:B([{"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",s$({body:z,...Z,headers:B([{"anthropic-beta":[...X??[],"files-api-2025-04-14"].toString()},sX(z.file),Z?.headers])},this._client))}}});var e1;var r8=E(()=>{$0();n();Q0();e1=class e1 extends x{retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(w`/v1/models/${$}?beta=true`,{...X,headers:B([{...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",_0,{query:z,...Z,headers:B([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers])})}}});var $2;var s8=E(()=>{$0();n();Q0();$2=class $2 extends x{create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/user_profiles?beta=true",{body:z,...Z,headers:B([{"anthropic-beta":[...X??[],"user-profiles-2026-03-24"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(w`/v1/user_profiles/${$}?beta=true`,{...X,headers:B([{"anthropic-beta":[...z??[],"user-profiles-2026-03-24"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(w`/v1/user_profiles/${$}?beta=true`,{body:J,...X,headers:B([{"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",p,{query:z,...Z,headers:B([{"anthropic-beta":[...X??[],"user-profiles-2026-03-24"].toString()},Z?.headers])})}createEnrollmentURL($,Z={},X){let{betas:z}=Z??{};return this._client.post(w`/v1/user_profiles/${$}/enrollment_url?beta=true`,{...X,headers:B([{"anthropic-beta":[...z??[],"user-profiles-2026-03-24"].toString()},X?.headers])})}}});var Z2;var a8=E(()=>{$0();n();Q0();Z2=class Z2 extends x{list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(w`/v1/agents/${$}/versions?beta=true`,p,{query:J,...X,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var o$;var o8=E(()=>{a8();a8();$0();n();Q0();o$=class o$ extends x{constructor(){super(...arguments);this.versions=new Z2(this._client)}create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/agents?beta=true",{body:z,...Z,headers:B([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z,...J}=Z??{};return this._client.get(w`/v1/agents/${$}?beta=true`,{query:J,...X,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(w`/v1/agents/${$}?beta=true`,{body:J,...X,headers:B([{"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",p,{query:z,...Z,headers:B([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(w`/v1/agents/${$}/archive?beta=true`,{...X,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};o$.Versions=Z2});var X2;var t8=E(()=>{$0();n();Q0();X2=class X2 extends x{create($,Z,X){let{view:z,betas:J,...Q}=Z;return this._client.post(w`/v1/memory_stores/${$}/memories?beta=true`,{query:{view:z},body:Q,...X,headers:B([{"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(w`/v1/memory_stores/${z}/memories/${$}?beta=true`,{query:Q,...X,headers:B([{"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(w`/v1/memory_stores/${z}/memories/${$}?beta=true`,{query:{view:J},body:Y,...X,headers:B([{"anthropic-beta":[...Q??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(w`/v1/memory_stores/${$}/memories?beta=true`,p,{query:J,...X,headers:B([{"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(w`/v1/memory_stores/${z}/memories/${$}?beta=true`,{query:{expected_content_sha256:J},...X,headers:B([{"anthropic-beta":[...Q??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var z2;var e8=E(()=>{$0();n();Q0();z2=class z2 extends x{retrieve($,Z,X){let{memory_store_id:z,betas:J,...Q}=Z;return this._client.get(w`/v1/memory_stores/${z}/memory_versions/${$}?beta=true`,{query:Q,...X,headers:B([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(w`/v1/memory_stores/${$}/memory_versions?beta=true`,p,{query:J,...X,headers:B([{"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(w`/v1/memory_stores/${z}/memory_versions/${$}/redact?beta=true`,{...X,headers:B([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var M$;var $3=E(()=>{t8();t8();e8();e8();$0();n();Q0();M$=class M$ extends x{constructor(){super(...arguments);this.memories=new X2(this._client),this.memoryVersions=new z2(this._client)}create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/memory_stores?beta=true",{body:z,...Z,headers:B([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(w`/v1/memory_stores/${$}?beta=true`,{...X,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(w`/v1/memory_stores/${$}?beta=true`,{body:J,...X,headers:B([{"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",p,{query:z,...Z,headers:B([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(w`/v1/memory_stores/${$}?beta=true`,{...X,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(w`/v1/memory_stores/${$}/archive?beta=true`,{...X,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};M$.Memories=X2;M$.MemoryVersions=z2});var t$=E(()=>{N0()});var x4;var Z3=E(()=>{x4={"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 aX($){return $?.output_format??$?.output_config?.format}function X3($,Z,X){let z=aX(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 z3($,Z,X)}function z3($,Z,X){let z=null,J=$.content.map((Q)=>{if(Q.type==="text"){let Y=JN(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 JN($,Z){let X=aX($);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 J3=E(()=>{N0()});var QN=($)=>{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="",W=!1;z=$[++Z];while(z!=='"'){if(Z===$.length){W=!0;break}if(z==="\\"){if(Z++,Z===$.length){W=!0;break}q+=z+$[Z],z=$[++Z]}else q+=z,z=$[++Z]}if(z=$[++Z],!W)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},e$=($)=>{if($.length===0)return $;let Z=$[$.length-1];switch(Z.type){case"separator":return $=$.slice(0,$.length-1),e$($);break;case"number":let X=Z.value[Z.value.length-1];if(X==="."||X==="-")return $=$.slice(0,$.length-1),e$($);case"string":let z=$[$.length-2];if(z?.type==="delimiter")return $=$.slice(0,$.length-1),e$($);else if(z?.type==="brace"&&z.value==="{")return $=$.slice(0,$.length-1),e$($);break;case"delimiter":return $=$.slice(0,$.length-1),e$($);break}return $},YN=($)=>{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 $},qN=($)=>{let Z="";return $.map((X)=>{switch(X.type){case"string":Z+='"'+X.value+'"';break;default:Z+=X.value;break}}),Z},f4=($)=>JSON.parse(qN(YN(e$(QN($)))));var Q3=()=>{};var Y3=E(()=>{y8()});function $7($){return $.type==="tool_use"||$.type==="server_tool_use"||$.type==="mcp_tool_use"}function Z7($){}var R0,X$,$1,J2,k4,Q2,Y2,y4,q2,h0,W2,g4,h4,O$,v4,u4,G2,q3,oX,m4,W3,G3,U3,tX,eX="__json_buf",U2;var X7=E(()=>{k0();Q3();t$();Y3();J3();U2=class U2{constructor($,Z){R0.add(this),this.messages=[],this.receivedMessages=[],X$.set(this,void 0),$1.set(this,null),this.controller=new AbortController,J2.set(this,void 0),k4.set(this,()=>{}),Q2.set(this,()=>{}),Y2.set(this,void 0),y4.set(this,()=>{}),q2.set(this,()=>{}),h0.set(this,{}),W2.set(this,!1),g4.set(this,!1),h4.set(this,!1),O$.set(this,!1),v4.set(this,void 0),u4.set(this,void 0),G2.set(this,void 0),m4.set(this,(X)=>{if(A(this,g4,!0,"f"),y0(X))X=new U0;if(X instanceof U0)return A(this,h4,!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)))}),A(this,J2,new Promise((X,z)=>{A(this,k4,X,"f"),A(this,Q2,z,"f")}),"f"),A(this,Y2,new Promise((X,z)=>{A(this,y4,X,"f"),A(this,q2,z,"f")}),"f"),H(this,J2,"f").catch(()=>{}),H(this,Y2,"f").catch(()=>{}),A(this,$1,$,"f"),A(this,G2,Z?.logger??console,"f")}get response(){return H(this,v4,"f")}get request_id(){return H(this,u4,"f")}async withResponse(){A(this,O$,!0,"f");let $=await H(this,J2,"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 U2(null);return Z._run(()=>Z._fromReadableStream($)),Z}static createMessage($,Z,X,{logger:z}={}){let J=new U2(Z,{logger:z});for(let Q of Z.messages)J._addMessageParam(Q);return A(J,$1,{...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,m4,"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,R0,"m",W3).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,R0,"m",G3).call(this,q);if(Y.controller.signal?.aborted)throw new U0;H(this,R0,"m",U3).call(this)}finally{if(z&&J)z.removeEventListener("abort",J)}}_connected($){if(this.ended)return;A(this,v4,$,"f"),A(this,u4,$?.headers.get("request-id"),"f"),H(this,k4,"f").call(this,$),this._emit("connect")}get ended(){return H(this,W2,"f")}get errored(){return H(this,g4,"f")}get aborted(){return H(this,h4,"f")}abort(){this.controller.abort()}on($,Z){return(H(this,h0,"f")[$]||(H(this,h0,"f")[$]=[])).push({listener:Z}),this}off($,Z){let X=H(this,h0,"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,h0,"f")[$]||(H(this,h0,"f")[$]=[])).push({listener:Z,once:!0}),this}emitted($){return new Promise((Z,X)=>{if(A(this,O$,!0,"f"),$!=="error")this.once("error",X);this.once($,Z)})}async done(){A(this,O$,!0,"f"),await H(this,Y2,"f")}get currentMessage(){return H(this,X$,"f")}async finalMessage(){return await this.done(),H(this,R0,"m",q3).call(this)}async finalText(){return await this.done(),H(this,R0,"m",oX).call(this)}_emit($,...Z){if(H(this,W2,"f"))return;if($==="end")A(this,W2,!0,"f"),H(this,y4,"f").call(this);let X=H(this,h0,"f")[$];if(X)H(this,h0,"f")[$]=X.filter((z)=>!z.once),X.forEach(({listener:z})=>z(...Z));if($==="abort"){let z=Z[0];if(!H(this,O$,"f")&&!X?.length)Promise.reject(z);H(this,Q2,"f").call(this,z),H(this,q2,"f").call(this,z),this._emit("end");return}if($==="error"){let z=Z[0];if(!H(this,O$,"f")&&!X?.length)Promise.reject(z);H(this,Q2,"f").call(this,z),H(this,q2,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",H(this,R0,"m",q3).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,R0,"m",W3).call(this),this._connected(null);let J=w0.fromReadableStream($,this.controller);for await(let Q of J)H(this,R0,"m",G3).call(this,Q);if(J.controller.signal?.aborted)throw new U0;H(this,R0,"m",U3).call(this)}finally{if(X&&z)X.removeEventListener("abort",z)}}[(X$=new WeakMap,$1=new WeakMap,J2=new WeakMap,k4=new WeakMap,Q2=new WeakMap,Y2=new WeakMap,y4=new WeakMap,q2=new WeakMap,h0=new WeakMap,W2=new WeakMap,g4=new WeakMap,h4=new WeakMap,O$=new WeakMap,v4=new WeakMap,u4=new WeakMap,G2=new WeakMap,m4=new WeakMap,R0=new WeakSet,q3=function(){if(this.receivedMessages.length===0)throw new P("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},oX=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(" ")},W3=function(){if(this.ended)return;A(this,X$,void 0,"f")},G3=function(Z){if(this.ended)return;let X=H(this,R0,"m",tX).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}case"compaction_delta":{if(z.type==="compaction"&&z.content)this._emit("compaction",z.content);break}default:Z7(Z.delta)}break}case"message_stop":{this._addMessageParam(X),this._addMessage(X3(X,H(this,$1,"f"),{logger:H(this,G2,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",X.content.at(-1));break}case"message_start":{A(this,X$,X,"f");break}case"content_block_start":case"message_delta":break}},U3=function(){if(this.ended)throw new P("stream has ended, this shouldn't happen");let Z=H(this,X$,"f");if(!Z)throw new P("request ended without sending any chunks");return A(this,X$,void 0,"f"),X3(Z,H(this,$1,"f"),{logger:H(this,G2,"f")})},tX=function(Z){let X=H(this,X$,"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&&$7(z)){let J=z[eX]||"";J+=Z.delta.partial_json;let Q={...z};if(Object.defineProperty(Q,eX,{value:J,enumerable:!1,writable:!0}),J)try{Q.input=f4(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,m4,"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:Z7(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 w0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var Z1;var d4=E(()=>{Z1=class Z1 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 z7=1e5,J7=`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,68 +192,68 @@ 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 Q7(){let $,X;return{promise:new Promise((z,J)=>{$=z,X=J}),resolve:$,reject:X}}async function QN($,X=$.messages.at(-1),Z){if(!X||X.role!=="assistant"||!X.content||typeof X.content==="string")return null;let z=X.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 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 X1?q.content:`Error: ${q instanceof Error?q.message:String(q)}`,is_error:!0}}}))}}var V2,Z1,w$,W0,T0,D0,v0,z$,K2,J7,V3,H2;var K3=C(()=>{k0();d4();N0();n();o1();H2=class H2{constructor($,X,Z){V2.add(this),this.client=$,Z1.set(this,!1),w$.set(this,!1),W0.set(this,void 0),T0.set(this,void 0),D0.set(this,void 0),v0.set(this,void 0),z$.set(this,void 0),K2.set(this,0),A(this,W0,{params:{...X,messages:structuredClone(X.messages)}},"f");let J=["BetaToolRunner",...i8(X.tools,X.messages)].join(", ");if(A(this,T0,{...Z,headers:B([{"x-stainless-helper":J},Z?.headers])},"f"),A(this,z$,Q7(),"f"),X.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*[(Z1=new WeakMap,w$=new WeakMap,W0=new WeakMap,T0=new WeakMap,D0=new WeakMap,v0=new WeakMap,z$=new WeakMap,K2=new WeakMap,V2=new WeakSet,J7=async function(){let X=H(this,W0,"f").params.compactionControl;if(!X||!X.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 z=X.contextTokenThreshold??Z7;if(Z<z)return!1;let J=X.model??H(this,W0,"f").params.model,Q=X.summaryPrompt??z7,Y=H(this,W0,"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,W0,"f").params.max_tokens},{signal:H(this,T0,"f").signal,headers:B([H(this,T0,"f").headers,{"x-stainless-helper":"compaction"}])});if(q.content[0]?.type!=="text")throw new P("Expected text response for compaction");return H(this,W0,"f").params.messages=[{role:"user",content:q.content}],!0},Symbol.asyncIterator)](){var $;if(H(this,Z1,"f"))throw new P("Cannot iterate over a consumed stream");A(this,Z1,!0,"f"),A(this,w$,!0,"f"),A(this,v0,void 0,"f");try{while(!0){let X;try{if(H(this,W0,"f").params.max_iterations&&H(this,K2,"f")>=H(this,W0,"f").params.max_iterations)break;A(this,w$,!1,"f"),A(this,v0,void 0,"f"),A(this,K2,($=H(this,K2,"f"),$++,$),"f"),A(this,D0,void 0,"f");let{max_iterations:Z,compactionControl:z,...J}=H(this,W0,"f").params;if(J.stream)X=this.client.beta.messages.stream({...J},H(this,T0,"f")),A(this,D0,X.finalMessage(),"f"),H(this,D0,"f").catch(()=>{}),yield X;else A(this,D0,this.client.beta.messages.create({...J,stream:!1},H(this,T0,"f")),"f"),yield H(this,D0,"f");if(!await H(this,V2,"m",J7).call(this)){if(!H(this,w$,"f")){let{role:q,content:W}=await H(this,D0,"f");H(this,W0,"f").params.messages.push({role:q,content:W})}let Y=await H(this,V2,"m",V3).call(this,H(this,W0,"f").params.messages.at(-1));if(Y)H(this,W0,"f").params.messages.push(Y);else if(!H(this,w$,"f"))break}}finally{if(X)X.abort()}}if(!H(this,D0,"f"))throw new P("ToolRunner concluded without a message from the server");H(this,z$,"f").resolve(await H(this,D0,"f"))}catch(X){throw A(this,Z1,!1,"f"),H(this,z$,"f").promise.catch(()=>{}),H(this,z$,"f").reject(X),A(this,z$,Q7(),"f"),X}}setMessagesParams($){if(typeof $==="function")H(this,W0,"f").params=$(H(this,W0,"f").params);else H(this,W0,"f").params=$;A(this,w$,!0,"f"),A(this,v0,void 0,"f")}setRequestOptions($){if(typeof $==="function")A(this,T0,$(H(this,T0,"f")),"f");else A(this,T0,{...H(this,T0,"f"),...$},"f")}async generateToolResponse($=H(this,T0,"f").signal){let X=await H(this,D0,"f")??this.params.messages.at(-1);if(!X)return null;return H(this,V2,"m",V3).call(this,X,$)}done(){return H(this,z$,"f").promise}async runUntilDone(){if(!H(this,Z1,"f"))for await(let $ of this);return this.done()}get params(){return H(this,W0,"f").params}pushMessages(...$){this.setMessagesParams((X)=>({...X,messages:[...X.messages,...$]}))}then($,X){return this.runUntilDone().then($,X)}};V3=async function(X,Z=H(this,T0,"f").signal){if(H(this,v0,"f")!==void 0)return H(this,v0,"f");return A(this,v0,QN(H(this,W0,"f").params,X,{...H(this,T0,"f"),signal:Z}),"f"),H(this,v0,"f")}});var z1;var H3=C(()=>{N0();f8();z1=class z1{constructor($,X){this.iterator=$,this.controller=X}async*decoder(){let $=new $$;for await(let X of this.iterator)for(let Z of $.decode(X))yield JSON.parse(Z);for(let X of $.flush())yield JSON.parse(X)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse($,X){if(!$.body){if(X.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 z1(m1($.body),X)}}});var N2;var N3=C(()=>{$0();n();H3();t$();Q0();N2=class N2 extends x{create($,X){let{betas:Z,...z}=$;return this._client.post("/v1/messages/batches?beta=true",{body:z,...X,headers:B([{"anthropic-beta":[...Z??[],"message-batches-2024-09-24"].toString()},X?.headers])})}retrieve($,X={},Z){let{betas:z}=X??{};return this._client.get(w`/v1/messages/batches/${$}?beta=true`,{...Z,headers:B([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},Z?.headers])})}list($={},X){let{betas:Z,...z}=$??{};return this._client.getAPIList("/v1/messages/batches?beta=true",_0,{query:z,...X,headers:B([{"anthropic-beta":[...Z??[],"message-batches-2024-09-24"].toString()},X?.headers])})}delete($,X={},Z){let{betas:z}=X??{};return this._client.delete(w`/v1/messages/batches/${$}?beta=true`,{...Z,headers:B([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},Z?.headers])})}cancel($,X={},Z){let{betas:z}=X??{};return this._client.post(w`/v1/messages/batches/${$}/cancel?beta=true`,{...Z,headers:B([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},Z?.headers])})}async results($,X={},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}`);let{betas:J}=X??{};return this._client.get(z.results_url,{...Z,headers:B([{"anthropic-beta":[...J??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},Z?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((Q,Y)=>z1.fromResponse(Y.response,Y.controller))}}});function q7($){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:X,...Z}=$;return{...Z,output_config:{...$.output_config,format:X}}}var Y7,qN,J$;var T3=C(()=>{t$();X3();n();o1();J3();X7();K3();d4();N3();N3();K3();d4();Y7={"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"},qN=["claude-mythos-preview","claude-opus-4-6"];J$=class J$ extends x{constructor(){super(...arguments);this.batches=new N2(this._client)}create($,X){let Z=q7($),{betas:z,...J}=Z;if(J.model in Y7)console.warn(`The model '${J.model}' is deprecated and will reach end-of-life on ${Y7[J.model]}
196
- Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(qN.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=x4[J.model]??void 0;Q=this._client.calculateNonstreamingTimeout(J.max_tokens,q)}let Y=b4(J.tools,J.messages);return this._client.post("/v1/messages?beta=true",{body:J,timeout:Q??600000,...X,headers:B([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},Y,X?.headers]),stream:Z.stream??!1})}parse($,X){return X={...X,headers:B([{"anthropic-beta":[...$.betas??[],"structured-outputs-2025-12-15"].toString()},X?.headers])},this.create($,X).then((Z)=>z3(Z,$,{logger:this._client.logger??console}))}stream($,X){return U2.createMessage(this,$,X)}countTokens($,X){let Z=q7($),{betas:z,...J}=Z;return this._client.post("/v1/messages/count_tokens?beta=true",{body:J,...X,headers:B([{"anthropic-beta":[...z??[],"token-counting-2024-11-01"].toString()},X?.headers])})}toolRunner($,X){return new H2(this._client,$,X)}};J$.Batches=N2;J$.BetaToolRunner=H2;J$.ToolError=X1});var T2;var B3=C(()=>{$0();n();Q0();T2=class T2 extends x{list($,X={},Z){let{betas:z,...J}=X??{};return this._client.getAPIList(w`/v1/sessions/${$}/events?beta=true`,p,{query:J,...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}send($,X,Z){let{betas:z,...J}=X;return this._client.post(w`/v1/sessions/${$}/events?beta=true`,{body:J,...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}stream($,X={},Z){let{betas:z}=X??{};return this._client.get(w`/v1/sessions/${$}/events/stream?beta=true`,{...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers]),stream:!0})}}});var B2;var L3=C(()=>{$0();n();Q0();B2=class B2 extends x{retrieve($,X,Z){let{session_id:z,betas:J}=X;return this._client.get(w`/v1/sessions/${z}/resources/${$}?beta=true`,{...Z,headers:B([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}update($,X,Z){let{session_id:z,betas:J,...Q}=X;return this._client.post(w`/v1/sessions/${z}/resources/${$}?beta=true`,{body:Q,...Z,headers:B([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}list($,X={},Z){let{betas:z,...J}=X??{};return this._client.getAPIList(w`/v1/sessions/${$}/resources?beta=true`,p,{query:J,...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,X,Z){let{session_id:z,betas:J}=X;return this._client.delete(w`/v1/sessions/${z}/resources/${$}?beta=true`,{...Z,headers:B([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}add($,X,Z){let{betas:z,...J}=X;return this._client.post(w`/v1/sessions/${$}/resources?beta=true`,{body:J,...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}}});var D$;var M3=C(()=>{B3();B3();L3();L3();$0();n();Q0();D$=class D$ extends x{constructor(){super(...arguments);this.events=new T2(this._client),this.resources=new B2(this._client)}create($,X){let{betas:Z,...z}=$;return this._client.post("/v1/sessions?beta=true",{body:z,...X,headers:B([{"anthropic-beta":[...Z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}retrieve($,X={},Z){let{betas:z}=X??{};return this._client.get(w`/v1/sessions/${$}?beta=true`,{...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}update($,X,Z){let{betas:z,...J}=X;return this._client.post(w`/v1/sessions/${$}?beta=true`,{body:J,...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}list($={},X){let{betas:Z,...z}=$??{};return this._client.getAPIList("/v1/sessions?beta=true",p,{query:z,...X,headers:B([{"anthropic-beta":[...Z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}delete($,X={},Z){let{betas:z}=X??{};return this._client.delete(w`/v1/sessions/${$}?beta=true`,{...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}archive($,X={},Z){let{betas:z}=X??{};return this._client.post(w`/v1/sessions/${$}/archive?beta=true`,{...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}};D$.Events=T2;D$.Resources=B2});var L2;var O3=C(()=>{$0();n();a$();Q0();L2=class L2 extends x{create($,X={},Z){let{betas:z,...J}=X??{};return this._client.post(w`/v1/skills/${$}/versions?beta=true`,s$({body:J,...Z,headers:B([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},Z?.headers])},this._client))}retrieve($,X,Z){let{skill_id:z,betas:J}=X;return this._client.get(w`/v1/skills/${z}/versions/${$}?beta=true`,{...Z,headers:B([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},Z?.headers])})}list($,X={},Z){let{betas:z,...J}=X??{};return this._client.getAPIList(w`/v1/skills/${$}/versions?beta=true`,p,{query:J,...Z,headers:B([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},Z?.headers])})}delete($,X,Z){let{skill_id:z,betas:J}=X;return this._client.delete(w`/v1/skills/${z}/versions/${$}?beta=true`,{...Z,headers:B([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},Z?.headers])})}}});var J1;var w3=C(()=>{O3();O3();$0();n();a$();Q0();J1=class J1 extends x{constructor(){super(...arguments);this.versions=new L2(this._client)}create($={},X){let{betas:Z,...z}=$??{};return this._client.post("/v1/skills?beta=true",s$({body:z,...X,headers:B([{"anthropic-beta":[...Z??[],"skills-2025-10-02"].toString()},X?.headers])},this._client,!1))}retrieve($,X={},Z){let{betas:z}=X??{};return this._client.get(w`/v1/skills/${$}?beta=true`,{...Z,headers:B([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},Z?.headers])})}list($={},X){let{betas:Z,...z}=$??{};return this._client.getAPIList("/v1/skills?beta=true",p,{query:z,...X,headers:B([{"anthropic-beta":[...Z??[],"skills-2025-10-02"].toString()},X?.headers])})}delete($,X={},Z){let{betas:z}=X??{};return this._client.delete(w`/v1/skills/${$}?beta=true`,{...Z,headers:B([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},Z?.headers])})}};J1.Versions=L2});var M2;var D3=C(()=>{$0();n();Q0();M2=class M2 extends x{create($,X,Z){let{betas:z,...J}=X;return this._client.post(w`/v1/vaults/${$}/credentials?beta=true`,{body:J,...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,X,Z){let{vault_id:z,betas:J}=X;return this._client.get(w`/v1/vaults/${z}/credentials/${$}?beta=true`,{...Z,headers:B([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}update($,X,Z){let{vault_id:z,betas:J,...Q}=X;return this._client.post(w`/v1/vaults/${z}/credentials/${$}?beta=true`,{body:Q,...Z,headers:B([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}list($,X={},Z){let{betas:z,...J}=X??{};return this._client.getAPIList(w`/v1/vaults/${$}/credentials?beta=true`,p,{query:J,...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,X,Z){let{vault_id:z,betas:J}=X;return this._client.delete(w`/v1/vaults/${z}/credentials/${$}?beta=true`,{...Z,headers:B([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}archive($,X,Z){let{vault_id:z,betas:J}=X;return this._client.post(w`/v1/vaults/${z}/credentials/${$}/archive?beta=true`,{...Z,headers:B([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}}});var Q1;var A3=C(()=>{D3();D3();$0();n();Q0();Q1=class Q1 extends x{constructor(){super(...arguments);this.credentials=new M2(this._client)}create($,X){let{betas:Z,...z}=$;return this._client.post("/v1/vaults?beta=true",{body:z,...X,headers:B([{"anthropic-beta":[...Z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}retrieve($,X={},Z){let{betas:z}=X??{};return this._client.get(w`/v1/vaults/${$}?beta=true`,{...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}update($,X,Z){let{betas:z,...J}=X;return this._client.post(w`/v1/vaults/${$}?beta=true`,{body:J,...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}list($={},X){let{betas:Z,...z}=$??{};return this._client.getAPIList("/v1/vaults?beta=true",p,{query:z,...X,headers:B([{"anthropic-beta":[...Z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}delete($,X={},Z){let{betas:z}=X??{};return this._client.delete(w`/v1/vaults/${$}?beta=true`,{...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}archive($,X={},Z){let{betas:z}=X??{};return this._client.post(w`/v1/vaults/${$}/archive?beta=true`,{...Z,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}};Q1.Credentials=M2});var V0;var F3=C(()=>{l8();l8();n8();n8();r8();r8();s8();s8();o8();o8();$3();$3();T3();T3();M3();M3();w3();w3();A3();A3();V0=class V0 extends x{constructor(){super(...arguments);this.models=new e1(this._client),this.messages=new J$(this._client),this.agents=new o$(this._client),this.environments=new s1(this._client),this.sessions=new D$(this._client),this.vaults=new Q1(this._client),this.memoryStores=new M$(this._client),this.files=new t1(this._client),this.skills=new J1(this._client),this.userProfiles=new $2(this._client)}};V0.Models=e1;V0.Messages=J$;V0.Agents=o$;V0.Environments=s1;V0.Sessions=D$;V0.Vaults=Q1;V0.MemoryStores=M$;V0.Files=t1;V0.Skills=J1;V0.UserProfiles=$2});var Y1;var I3=C(()=>{n();Y1=class Y1 extends x{create($,X){let{betas:Z,...z}=$;return this._client.post("/v1/complete",{body:z,timeout:this._client._options.timeout??600000,...X,headers:B([{...Z?.toString()!=null?{"anthropic-beta":Z?.toString()}:void 0},X?.headers]),stream:$.stream??!1})}}});function W7($){return $?.output_config?.format}function R3($,X,Z){let z=W7(X);if(!X||!("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 P3($,X,Z)}function P3($,X,Z){let z=null,J=$.content.map((Q)=>{if(Q.type==="text"){let Y=BN(X,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 BN($,X){let Z=W7($);if(Z?.type!=="json_schema")return null;try{if("parse"in Z)return Z.parse(X);return JSON.parse(X)}catch(z){throw new P(`Failed to parse structured output: ${z}`)}}var E3=C(()=>{N0()});function K7($){return $.type==="tool_use"||$.type==="server_tool_use"}function H7($){}var P0,Q$,q1,O2,c4,w2,D2,p4,A2,u0,F2,l4,i4,A$,n4,r4,I2,C3,G7,_3,S3,j3,b3,U7,V7="__json_buf",R2;var N7=C(()=>{k0();t$();Y3();Q3();E3();R2=class R2{constructor($,X){P0.add(this),this.messages=[],this.receivedMessages=[],Q$.set(this,void 0),q1.set(this,null),this.controller=new AbortController,O2.set(this,void 0),c4.set(this,()=>{}),w2.set(this,()=>{}),D2.set(this,void 0),p4.set(this,()=>{}),A2.set(this,()=>{}),u0.set(this,{}),F2.set(this,!1),l4.set(this,!1),i4.set(this,!1),A$.set(this,!1),n4.set(this,void 0),r4.set(this,void 0),I2.set(this,void 0),_3.set(this,(Z)=>{if(A(this,l4,!0,"f"),y0(Z))Z=new U0;if(Z instanceof U0)return A(this,i4,!0,"f"),this._emit("abort",Z);if(Z instanceof P)return this._emit("error",Z);if(Z instanceof Error){let z=new P(Z.message);return z.cause=Z,this._emit("error",z)}return this._emit("error",new P(String(Z)))}),A(this,O2,new Promise((Z,z)=>{A(this,c4,Z,"f"),A(this,w2,z,"f")}),"f"),A(this,D2,new Promise((Z,z)=>{A(this,p4,Z,"f"),A(this,A2,z,"f")}),"f"),H(this,O2,"f").catch(()=>{}),H(this,D2,"f").catch(()=>{}),A(this,q1,$,"f"),A(this,I2,X?.logger??console,"f")}get response(){return H(this,n4,"f")}get request_id(){return H(this,r4,"f")}async withResponse(){A(this,A$,!0,"f");let $=await H(this,O2,"f");if(!$)throw Error("Could not resolve a `Response` object");return{data:this,response:$,request_id:$.headers.get("request-id")}}static fromReadableStream($){let X=new R2(null);return X._run(()=>X._fromReadableStream($)),X}static createMessage($,X,Z,{logger:z}={}){let J=new R2(X,{logger:z});for(let Q of X.messages)J._addMessageParam(Q);return A(J,q1,{...X,stream:!0},"f"),J._run(()=>J._createMessage($,{...X,stream:!0},{...Z,headers:{...Z?.headers,"X-Stainless-Helper-Method":"stream"}})),J}_run($){$().then(()=>{this._emitFinal(),this._emit("end")},H(this,_3,"f"))}_addMessageParam($){this.messages.push($)}_addMessage($,X=!0){if(this.receivedMessages.push($),X)this._emit("message",$)}async _createMessage($,X,Z){let z=Z?.signal,J;if(z){if(z.aborted)this.controller.abort();J=this.controller.abort.bind(this.controller),z.addEventListener("abort",J)}try{H(this,P0,"m",S3).call(this);let{response:Q,data:Y}=await $.create({...X,stream:!0},{...Z,signal:this.controller.signal}).withResponse();this._connected(Q);for await(let q of Y)H(this,P0,"m",j3).call(this,q);if(Y.controller.signal?.aborted)throw new U0;H(this,P0,"m",b3).call(this)}finally{if(z&&J)z.removeEventListener("abort",J)}}_connected($){if(this.ended)return;A(this,n4,$,"f"),A(this,r4,$?.headers.get("request-id"),"f"),H(this,c4,"f").call(this,$),this._emit("connect")}get ended(){return H(this,F2,"f")}get errored(){return H(this,l4,"f")}get aborted(){return H(this,i4,"f")}abort(){this.controller.abort()}on($,X){return(H(this,u0,"f")[$]||(H(this,u0,"f")[$]=[])).push({listener:X}),this}off($,X){let Z=H(this,u0,"f")[$];if(!Z)return this;let z=Z.findIndex((J)=>J.listener===X);if(z>=0)Z.splice(z,1);return this}once($,X){return(H(this,u0,"f")[$]||(H(this,u0,"f")[$]=[])).push({listener:X,once:!0}),this}emitted($){return new Promise((X,Z)=>{if(A(this,A$,!0,"f"),$!=="error")this.once("error",Z);this.once($,X)})}async done(){A(this,A$,!0,"f"),await H(this,D2,"f")}get currentMessage(){return H(this,Q$,"f")}async finalMessage(){return await this.done(),H(this,P0,"m",C3).call(this)}async finalText(){return await this.done(),H(this,P0,"m",G7).call(this)}_emit($,...X){if(H(this,F2,"f"))return;if($==="end")A(this,F2,!0,"f"),H(this,p4,"f").call(this);let Z=H(this,u0,"f")[$];if(Z)H(this,u0,"f")[$]=Z.filter((z)=>!z.once),Z.forEach(({listener:z})=>z(...X));if($==="abort"){let z=X[0];if(!H(this,A$,"f")&&!Z?.length)Promise.reject(z);H(this,w2,"f").call(this,z),H(this,A2,"f").call(this,z),this._emit("end");return}if($==="error"){let z=X[0];if(!H(this,A$,"f")&&!Z?.length)Promise.reject(z);H(this,w2,"f").call(this,z),H(this,A2,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",H(this,P0,"m",C3).call(this))}async _fromReadableStream($,X){let Z=X?.signal,z;if(Z){if(Z.aborted)this.controller.abort();z=this.controller.abort.bind(this.controller),Z.addEventListener("abort",z)}try{H(this,P0,"m",S3).call(this),this._connected(null);let J=w0.fromReadableStream($,this.controller);for await(let Q of J)H(this,P0,"m",j3).call(this,Q);if(J.controller.signal?.aborted)throw new U0;H(this,P0,"m",b3).call(this)}finally{if(Z&&z)Z.removeEventListener("abort",z)}}[(Q$=new WeakMap,q1=new WeakMap,O2=new WeakMap,c4=new WeakMap,w2=new WeakMap,D2=new WeakMap,p4=new WeakMap,A2=new WeakMap,u0=new WeakMap,F2=new WeakMap,l4=new WeakMap,i4=new WeakMap,A$=new WeakMap,n4=new WeakMap,r4=new WeakMap,I2=new WeakMap,_3=new WeakMap,P0=new WeakSet,C3=function(){if(this.receivedMessages.length===0)throw new P("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},G7=function(){if(this.receivedMessages.length===0)throw new P("stream ended without producing a Message with role=assistant");let X=this.receivedMessages.at(-1).content.filter((Z)=>Z.type==="text").map((Z)=>Z.text);if(X.length===0)throw new P("stream ended without producing a content block with type=text");return X.join(" ")},S3=function(){if(this.ended)return;A(this,Q$,void 0,"f")},j3=function(X){if(this.ended)return;let Z=H(this,P0,"m",U7).call(this,X);switch(this._emit("streamEvent",X,Z),X.type){case"content_block_delta":{let z=Z.content.at(-1);switch(X.delta.type){case"text_delta":{if(z.type==="text")this._emit("text",X.delta.text,z.text||"");break}case"citations_delta":{if(z.type==="text")this._emit("citation",X.delta.citation,z.citations??[]);break}case"input_json_delta":{if(K7(z)&&z.input)this._emit("inputJson",X.delta.partial_json,z.input);break}case"thinking_delta":{if(z.type==="thinking")this._emit("thinking",X.delta.thinking,z.thinking);break}case"signature_delta":{if(z.type==="thinking")this._emit("signature",z.signature);break}default:H7(X.delta)}break}case"message_stop":{this._addMessageParam(Z),this._addMessage(R3(Z,H(this,q1,"f"),{logger:H(this,I2,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",Z.content.at(-1));break}case"message_start":{A(this,Q$,Z,"f");break}case"content_block_start":case"message_delta":break}},b3=function(){if(this.ended)throw new P("stream has ended, this shouldn't happen");let X=H(this,Q$,"f");if(!X)throw new P("request ended without sending any chunks");return A(this,Q$,void 0,"f"),R3(X,H(this,q1,"f"),{logger:H(this,I2,"f")})},U7=function(X){let Z=H(this,Q$,"f");if(X.type==="message_start"){if(Z)throw new P(`Unexpected event order, got ${X.type} before receiving "message_stop"`);return X.message}if(!Z)throw new P(`Unexpected event order, got ${X.type} before "message_start"`);switch(X.type){case"message_stop":return Z;case"message_delta":if(Z.stop_reason=X.delta.stop_reason,Z.stop_sequence=X.delta.stop_sequence,Z.usage.output_tokens=X.usage.output_tokens,X.usage.input_tokens!=null)Z.usage.input_tokens=X.usage.input_tokens;if(X.usage.cache_creation_input_tokens!=null)Z.usage.cache_creation_input_tokens=X.usage.cache_creation_input_tokens;if(X.usage.cache_read_input_tokens!=null)Z.usage.cache_read_input_tokens=X.usage.cache_read_input_tokens;if(X.usage.server_tool_use!=null)Z.usage.server_tool_use=X.usage.server_tool_use;return Z;case"content_block_start":return Z.content.push({...X.content_block}),Z;case"content_block_delta":{let z=Z.content.at(X.index);switch(X.delta.type){case"text_delta":{if(z?.type==="text")Z.content[X.index]={...z,text:(z.text||"")+X.delta.text};break}case"citations_delta":{if(z?.type==="text")Z.content[X.index]={...z,citations:[...z.citations??[],X.delta.citation]};break}case"input_json_delta":{if(z&&K7(z)){let J=z[V7]||"";J+=X.delta.partial_json;let Q={...z};if(Object.defineProperty(Q,V7,{value:J,enumerable:!1,writable:!0}),J)Q.input=f4(J);Z.content[X.index]=Q}break}case"thinking_delta":{if(z?.type==="thinking")Z.content[X.index]={...z,thinking:z.thinking+X.delta.thinking};break}case"signature_delta":{if(z?.type==="thinking")Z.content[X.index]={...z,signature:X.delta.signature};break}default:H7(X.delta)}return Z}case"content_block_stop":return Z}},Symbol.asyncIterator)](){let $=[],X=[],Z=!1;return this.on("streamEvent",(z)=>{let J=X.shift();if(J)J.resolve(z);else $.push(z)}),this.on("end",()=>{Z=!0;for(let z of X)z.resolve(void 0);X.length=0}),this.on("abort",(z)=>{Z=!0;for(let J of X)J.reject(z);X.length=0}),this.on("error",(z)=>{Z=!0;for(let J of X)J.reject(z);X.length=0}),{next:async()=>{if(!$.length){if(Z)return{value:void 0,done:!0};return new Promise((J,Q)=>X.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 w0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var P2;var x3=C(()=>{$0();n();H3();t$();Q0();P2=class P2 extends x{create($,X){return this._client.post("/v1/messages/batches",{body:$,...X})}retrieve($,X){return this._client.get(w`/v1/messages/batches/${$}`,X)}list($={},X){return this._client.getAPIList("/v1/messages/batches",_0,{query:$,...X})}delete($,X){return this._client.delete(w`/v1/messages/batches/${$}`,X)}cancel($,X){return this._client.post(w`/v1/messages/batches/${$}/cancel`,X)}async results($,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}`);return this._client.get(Z.results_url,{...X,headers:B([{Accept:"application/binary"},X?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((z,J)=>z1.fromResponse(J.response,J.controller))}}});var F$,T7,MN;var f3=C(()=>{n();o1();N7();E3();x3();x3();X3();F$=class F$ extends x{constructor(){super(...arguments);this.batches=new P2(this._client)}create($,X){if($.model in T7)console.warn(`The model '${$.model}' is deprecated and will reach end-of-life on ${T7[$.model]}
197
- Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(MN.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=x4[$.model]??void 0;Z=this._client.calculateNonstreamingTimeout($.max_tokens,J)}let z=b4($.tools,$.messages);return this._client.post("/v1/messages",{body:$,timeout:Z??600000,...X,headers:B([z,X?.headers]),stream:$.stream??!1})}parse($,X){return this.create($,X).then((Z)=>P3(Z,$,{logger:this._client.logger??console}))}stream($,X){return R2.createMessage(this,$,X,{logger:this._client.logger??console})}countTokens($,X){return this._client.post("/v1/messages/count_tokens",{body:$,...X})}};T7={"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"},MN=["claude-mythos-preview","claude-opus-4-6"];F$.Batches=P2});var W1;var k3=C(()=>{$0();n();Q0();W1=class W1 extends x{retrieve($,X={},Z){let{betas:z}=X??{};return this._client.get(w`/v1/models/${$}`,{...Z,headers:B([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},Z?.headers])})}list($={},X){let{betas:Z,...z}=$??{};return this._client.getAPIList("/v1/models",_0,{query:z,...X,headers:B([{...Z?.toString()!=null?{"anthropic-beta":Z?.toString()}:void 0},X?.headers])})}}});var B7=C(()=>{F3();I3();f3();k3();p5()});var E2=($)=>{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 s{constructor({baseURL:$=E2("ANTHROPIC_BASE_URL"),apiKey:X=E2("ANTHROPIC_API_KEY")??null,authToken:Z=E2("ANTHROPIC_AUTH_TOKEN")??null,...z}={}){y3.add(this),s4.set(this,void 0);let J={apiKey:X,authToken:Z,...z,baseURL:$||"https://api.anthropic.com"};if(!J.dangerouslyAllowBrowser&&C5())throw new P(`It looks like you're running in a browser-like environment.
195
+ Wrap your summary in <summary></summary> tags.`;function Y7(){let $,Z;return{promise:new Promise((z,J)=>{$=z,Z=J}),resolve:$,reject:Z}}async function WN($,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 W=await Y.run(q,{toolUseBlock:Q,signal:X?.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 Z1?q.content:`Error: ${q instanceof Error?q.message:String(q)}`,is_error:!0}}}))}}var V2,X1,w$,W0,T0,D0,v0,z$,K2,Q7,V3,H2;var K3=E(()=>{k0();d4();N0();n();o1();H2=class H2{constructor($,Z,X){V2.add(this),this.client=$,X1.set(this,!1),w$.set(this,!1),W0.set(this,void 0),T0.set(this,void 0),D0.set(this,void 0),v0.set(this,void 0),z$.set(this,void 0),K2.set(this,0),A(this,W0,{params:{...Z,messages:structuredClone(Z.messages)}},"f");let J=["BetaToolRunner",...i8(Z.tools,Z.messages)].join(", ");if(A(this,T0,{...X,headers:B([{"x-stainless-helper":J},X?.headers])},"f"),A(this,z$,Y7(),"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*[(X1=new WeakMap,w$=new WeakMap,W0=new WeakMap,T0=new WeakMap,D0=new WeakMap,v0=new WeakMap,z$=new WeakMap,K2=new WeakMap,V2=new WeakSet,Q7=async function(){let Z=H(this,W0,"f").params.compactionControl;if(!Z||!Z.enabled)return!1;let X=0;if(H(this,D0,"f")!==void 0)try{let W=await H(this,D0,"f");X=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 z=Z.contextTokenThreshold??z7;if(X<z)return!1;let J=Z.model??H(this,W0,"f").params.model,Q=Z.summaryPrompt??J7,Y=H(this,W0,"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,W0,"f").params.max_tokens},{signal:H(this,T0,"f").signal,headers:B([H(this,T0,"f").headers,{"x-stainless-helper":"compaction"}])});if(q.content[0]?.type!=="text")throw new P("Expected text response for compaction");return H(this,W0,"f").params.messages=[{role:"user",content:q.content}],!0},Symbol.asyncIterator)](){var $;if(H(this,X1,"f"))throw new P("Cannot iterate over a consumed stream");A(this,X1,!0,"f"),A(this,w$,!0,"f"),A(this,v0,void 0,"f");try{while(!0){let Z;try{if(H(this,W0,"f").params.max_iterations&&H(this,K2,"f")>=H(this,W0,"f").params.max_iterations)break;A(this,w$,!1,"f"),A(this,v0,void 0,"f"),A(this,K2,($=H(this,K2,"f"),$++,$),"f"),A(this,D0,void 0,"f");let{max_iterations:X,compactionControl:z,...J}=H(this,W0,"f").params;if(J.stream)Z=this.client.beta.messages.stream({...J},H(this,T0,"f")),A(this,D0,Z.finalMessage(),"f"),H(this,D0,"f").catch(()=>{}),yield Z;else A(this,D0,this.client.beta.messages.create({...J,stream:!1},H(this,T0,"f")),"f"),yield H(this,D0,"f");if(!await H(this,V2,"m",Q7).call(this)){if(!H(this,w$,"f")){let{role:q,content:W}=await H(this,D0,"f");H(this,W0,"f").params.messages.push({role:q,content:W})}let Y=await H(this,V2,"m",V3).call(this,H(this,W0,"f").params.messages.at(-1));if(Y)H(this,W0,"f").params.messages.push(Y);else if(!H(this,w$,"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,z$,"f").resolve(await H(this,D0,"f"))}catch(Z){throw A(this,X1,!1,"f"),H(this,z$,"f").promise.catch(()=>{}),H(this,z$,"f").reject(Z),A(this,z$,Y7(),"f"),Z}}setMessagesParams($){if(typeof $==="function")H(this,W0,"f").params=$(H(this,W0,"f").params);else H(this,W0,"f").params=$;A(this,w$,!0,"f"),A(this,v0,void 0,"f")}setRequestOptions($){if(typeof $==="function")A(this,T0,$(H(this,T0,"f")),"f");else A(this,T0,{...H(this,T0,"f"),...$},"f")}async generateToolResponse($=H(this,T0,"f").signal){let Z=await H(this,D0,"f")??this.params.messages.at(-1);if(!Z)return null;return H(this,V2,"m",V3).call(this,Z,$)}done(){return H(this,z$,"f").promise}async runUntilDone(){if(!H(this,X1,"f"))for await(let $ of this);return this.done()}get params(){return H(this,W0,"f").params}pushMessages(...$){this.setMessagesParams((Z)=>({...Z,messages:[...Z.messages,...$]}))}then($,Z){return this.runUntilDone().then($,Z)}};V3=async function(Z,X=H(this,T0,"f").signal){if(H(this,v0,"f")!==void 0)return H(this,v0,"f");return A(this,v0,WN(H(this,W0,"f").params,Z,{...H(this,T0,"f"),signal:X}),"f"),H(this,v0,"f")}});var z1;var H3=E(()=>{N0();f8();z1=class z1{constructor($,Z){this.iterator=$,this.controller=Z}async*decoder(){let $=new $$;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 z1(m1($.body),Z)}}});var N2;var N3=E(()=>{$0();n();H3();t$();Q0();N2=class N2 extends x{create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/messages/batches?beta=true",{body:z,...Z,headers:B([{"anthropic-beta":[...X??[],"message-batches-2024-09-24"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(w`/v1/messages/batches/${$}?beta=true`,{...X,headers:B([{"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",_0,{query:z,...Z,headers:B([{"anthropic-beta":[...X??[],"message-batches-2024-09-24"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(w`/v1/messages/batches/${$}?beta=true`,{...X,headers:B([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},X?.headers])})}cancel($,Z={},X){let{betas:z}=Z??{};return this._client.post(w`/v1/messages/batches/${$}/cancel?beta=true`,{...X,headers:B([{"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:B([{"anthropic-beta":[...J??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},X?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((Q,Y)=>z1.fromResponse(Y.response,Y.controller))}}});function W7($){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 q7,UN,J$;var T3=E(()=>{t$();Z3();n();o1();J3();X7();K3();d4();N3();N3();K3();d4();q7={"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"},UN=["claude-mythos-preview","claude-opus-4-6"];J$=class J$ extends x{constructor(){super(...arguments);this.batches=new N2(this._client)}create($,Z){let X=W7($),{betas:z,...J}=X;if(J.model in q7)console.warn(`The model '${J.model}' is deprecated and will reach end-of-life on ${q7[J.model]}
196
+ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(UN.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=x4[J.model]??void 0;Q=this._client.calculateNonstreamingTimeout(J.max_tokens,q)}let Y=b4(J.tools,J.messages);return this._client.post("/v1/messages?beta=true",{body:J,timeout:Q??600000,...Z,headers:B([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},Y,Z?.headers]),stream:X.stream??!1})}parse($,Z){return Z={...Z,headers:B([{"anthropic-beta":[...$.betas??[],"structured-outputs-2025-12-15"].toString()},Z?.headers])},this.create($,Z).then((X)=>z3(X,$,{logger:this._client.logger??console}))}stream($,Z){return U2.createMessage(this,$,Z)}countTokens($,Z){let X=W7($),{betas:z,...J}=X;return this._client.post("/v1/messages/count_tokens?beta=true",{body:J,...Z,headers:B([{"anthropic-beta":[...z??[],"token-counting-2024-11-01"].toString()},Z?.headers])})}toolRunner($,Z){return new H2(this._client,$,Z)}};J$.Batches=N2;J$.BetaToolRunner=H2;J$.ToolError=Z1});var T2;var B3=E(()=>{$0();n();Q0();T2=class T2 extends x{list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(w`/v1/sessions/${$}/events?beta=true`,p,{query:J,...X,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}send($,Z,X){let{betas:z,...J}=Z;return this._client.post(w`/v1/sessions/${$}/events?beta=true`,{body:J,...X,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}stream($,Z={},X){let{betas:z}=Z??{};return this._client.get(w`/v1/sessions/${$}/events/stream?beta=true`,{...X,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers]),stream:!0})}}});var B2;var L3=E(()=>{$0();n();Q0();B2=class B2 extends x{retrieve($,Z,X){let{session_id:z,betas:J}=Z;return this._client.get(w`/v1/sessions/${z}/resources/${$}?beta=true`,{...X,headers:B([{"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(w`/v1/sessions/${z}/resources/${$}?beta=true`,{body:Q,...X,headers:B([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(w`/v1/sessions/${$}/resources?beta=true`,p,{query:J,...X,headers:B([{"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(w`/v1/sessions/${z}/resources/${$}?beta=true`,{...X,headers:B([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}add($,Z,X){let{betas:z,...J}=Z;return this._client.post(w`/v1/sessions/${$}/resources?beta=true`,{body:J,...X,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var D$;var M3=E(()=>{B3();B3();L3();L3();$0();n();Q0();D$=class D$ extends x{constructor(){super(...arguments);this.events=new T2(this._client),this.resources=new B2(this._client)}create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/sessions?beta=true",{body:z,...Z,headers:B([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(w`/v1/sessions/${$}?beta=true`,{...X,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(w`/v1/sessions/${$}?beta=true`,{body:J,...X,headers:B([{"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",p,{query:z,...Z,headers:B([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(w`/v1/sessions/${$}?beta=true`,{...X,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(w`/v1/sessions/${$}/archive?beta=true`,{...X,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};D$.Events=T2;D$.Resources=B2});var L2;var O3=E(()=>{$0();n();a$();Q0();L2=class L2 extends x{create($,Z={},X){let{betas:z,...J}=Z??{};return this._client.post(w`/v1/skills/${$}/versions?beta=true`,s$({body:J,...X,headers:B([{"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(w`/v1/skills/${z}/versions/${$}?beta=true`,{...X,headers:B([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(w`/v1/skills/${$}/versions?beta=true`,p,{query:J,...X,headers:B([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}delete($,Z,X){let{skill_id:z,betas:J}=Z;return this._client.delete(w`/v1/skills/${z}/versions/${$}?beta=true`,{...X,headers:B([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])})}}});var J1;var w3=E(()=>{O3();O3();$0();n();a$();Q0();J1=class J1 extends x{constructor(){super(...arguments);this.versions=new L2(this._client)}create($={},Z){let{betas:X,...z}=$??{};return this._client.post("/v1/skills?beta=true",s$({body:z,...Z,headers:B([{"anthropic-beta":[...X??[],"skills-2025-10-02"].toString()},Z?.headers])},this._client,!1))}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(w`/v1/skills/${$}?beta=true`,{...X,headers:B([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/skills?beta=true",p,{query:z,...Z,headers:B([{"anthropic-beta":[...X??[],"skills-2025-10-02"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(w`/v1/skills/${$}?beta=true`,{...X,headers:B([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}};J1.Versions=L2});var M2;var D3=E(()=>{$0();n();Q0();M2=class M2 extends x{create($,Z,X){let{betas:z,...J}=Z;return this._client.post(w`/v1/vaults/${$}/credentials?beta=true`,{body:J,...X,headers:B([{"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(w`/v1/vaults/${z}/credentials/${$}?beta=true`,{...X,headers:B([{"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(w`/v1/vaults/${z}/credentials/${$}?beta=true`,{body:Q,...X,headers:B([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(w`/v1/vaults/${$}/credentials?beta=true`,p,{query:J,...X,headers:B([{"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(w`/v1/vaults/${z}/credentials/${$}?beta=true`,{...X,headers:B([{"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(w`/v1/vaults/${z}/credentials/${$}/archive?beta=true`,{...X,headers:B([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var Q1;var A3=E(()=>{D3();D3();$0();n();Q0();Q1=class Q1 extends x{constructor(){super(...arguments);this.credentials=new M2(this._client)}create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/vaults?beta=true",{body:z,...Z,headers:B([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(w`/v1/vaults/${$}?beta=true`,{...X,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(w`/v1/vaults/${$}?beta=true`,{body:J,...X,headers:B([{"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",p,{query:z,...Z,headers:B([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(w`/v1/vaults/${$}?beta=true`,{...X,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(w`/v1/vaults/${$}/archive?beta=true`,{...X,headers:B([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};Q1.Credentials=M2});var V0;var F3=E(()=>{l8();l8();n8();n8();r8();r8();s8();s8();o8();o8();$3();$3();T3();T3();M3();M3();w3();w3();A3();A3();V0=class V0 extends x{constructor(){super(...arguments);this.models=new e1(this._client),this.messages=new J$(this._client),this.agents=new o$(this._client),this.environments=new s1(this._client),this.sessions=new D$(this._client),this.vaults=new Q1(this._client),this.memoryStores=new M$(this._client),this.files=new t1(this._client),this.skills=new J1(this._client),this.userProfiles=new $2(this._client)}};V0.Models=e1;V0.Messages=J$;V0.Agents=o$;V0.Environments=s1;V0.Sessions=D$;V0.Vaults=Q1;V0.MemoryStores=M$;V0.Files=t1;V0.Skills=J1;V0.UserProfiles=$2});var Y1;var I3=E(()=>{n();Y1=class Y1 extends x{create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/complete",{body:z,timeout:this._client._options.timeout??600000,...Z,headers:B([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers]),stream:$.stream??!1})}}});function G7($){return $?.output_config?.format}function R3($,Z,X){let z=G7(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 P3($,Z,X)}function P3($,Z,X){let z=null,J=$.content.map((Q)=>{if(Q.type==="text"){let Y=ON(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 ON($,Z){let X=G7($);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 E3=E(()=>{N0()});function H7($){return $.type==="tool_use"||$.type==="server_tool_use"}function N7($){}var P0,Q$,q1,O2,c4,w2,D2,p4,A2,u0,F2,l4,i4,A$,n4,r4,I2,C3,U7,_3,S3,j3,b3,V7,K7="__json_buf",R2;var T7=E(()=>{k0();t$();Y3();Q3();E3();R2=class R2{constructor($,Z){P0.add(this),this.messages=[],this.receivedMessages=[],Q$.set(this,void 0),q1.set(this,null),this.controller=new AbortController,O2.set(this,void 0),c4.set(this,()=>{}),w2.set(this,()=>{}),D2.set(this,void 0),p4.set(this,()=>{}),A2.set(this,()=>{}),u0.set(this,{}),F2.set(this,!1),l4.set(this,!1),i4.set(this,!1),A$.set(this,!1),n4.set(this,void 0),r4.set(this,void 0),I2.set(this,void 0),_3.set(this,(X)=>{if(A(this,l4,!0,"f"),y0(X))X=new U0;if(X instanceof U0)return A(this,i4,!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)))}),A(this,O2,new Promise((X,z)=>{A(this,c4,X,"f"),A(this,w2,z,"f")}),"f"),A(this,D2,new Promise((X,z)=>{A(this,p4,X,"f"),A(this,A2,z,"f")}),"f"),H(this,O2,"f").catch(()=>{}),H(this,D2,"f").catch(()=>{}),A(this,q1,$,"f"),A(this,I2,Z?.logger??console,"f")}get response(){return H(this,n4,"f")}get request_id(){return H(this,r4,"f")}async withResponse(){A(this,A$,!0,"f");let $=await H(this,O2,"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 R2(null);return Z._run(()=>Z._fromReadableStream($)),Z}static createMessage($,Z,X,{logger:z}={}){let J=new R2(Z,{logger:z});for(let Q of Z.messages)J._addMessageParam(Q);return A(J,q1,{...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,_3,"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,P0,"m",S3).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,P0,"m",j3).call(this,q);if(Y.controller.signal?.aborted)throw new U0;H(this,P0,"m",b3).call(this)}finally{if(z&&J)z.removeEventListener("abort",J)}}_connected($){if(this.ended)return;A(this,n4,$,"f"),A(this,r4,$?.headers.get("request-id"),"f"),H(this,c4,"f").call(this,$),this._emit("connect")}get ended(){return H(this,F2,"f")}get errored(){return H(this,l4,"f")}get aborted(){return H(this,i4,"f")}abort(){this.controller.abort()}on($,Z){return(H(this,u0,"f")[$]||(H(this,u0,"f")[$]=[])).push({listener:Z}),this}off($,Z){let X=H(this,u0,"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,u0,"f")[$]||(H(this,u0,"f")[$]=[])).push({listener:Z,once:!0}),this}emitted($){return new Promise((Z,X)=>{if(A(this,A$,!0,"f"),$!=="error")this.once("error",X);this.once($,Z)})}async done(){A(this,A$,!0,"f"),await H(this,D2,"f")}get currentMessage(){return H(this,Q$,"f")}async finalMessage(){return await this.done(),H(this,P0,"m",C3).call(this)}async finalText(){return await this.done(),H(this,P0,"m",U7).call(this)}_emit($,...Z){if(H(this,F2,"f"))return;if($==="end")A(this,F2,!0,"f"),H(this,p4,"f").call(this);let X=H(this,u0,"f")[$];if(X)H(this,u0,"f")[$]=X.filter((z)=>!z.once),X.forEach(({listener:z})=>z(...Z));if($==="abort"){let z=Z[0];if(!H(this,A$,"f")&&!X?.length)Promise.reject(z);H(this,w2,"f").call(this,z),H(this,A2,"f").call(this,z),this._emit("end");return}if($==="error"){let z=Z[0];if(!H(this,A$,"f")&&!X?.length)Promise.reject(z);H(this,w2,"f").call(this,z),H(this,A2,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",H(this,P0,"m",C3).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,P0,"m",S3).call(this),this._connected(null);let J=w0.fromReadableStream($,this.controller);for await(let Q of J)H(this,P0,"m",j3).call(this,Q);if(J.controller.signal?.aborted)throw new U0;H(this,P0,"m",b3).call(this)}finally{if(X&&z)X.removeEventListener("abort",z)}}[(Q$=new WeakMap,q1=new WeakMap,O2=new WeakMap,c4=new WeakMap,w2=new WeakMap,D2=new WeakMap,p4=new WeakMap,A2=new WeakMap,u0=new WeakMap,F2=new WeakMap,l4=new WeakMap,i4=new WeakMap,A$=new WeakMap,n4=new WeakMap,r4=new WeakMap,I2=new WeakMap,_3=new WeakMap,P0=new WeakSet,C3=function(){if(this.receivedMessages.length===0)throw new P("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},U7=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(" ")},S3=function(){if(this.ended)return;A(this,Q$,void 0,"f")},j3=function(Z){if(this.ended)return;let X=H(this,P0,"m",V7).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(H7(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:N7(Z.delta)}break}case"message_stop":{this._addMessageParam(X),this._addMessage(R3(X,H(this,q1,"f"),{logger:H(this,I2,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",X.content.at(-1));break}case"message_start":{A(this,Q$,X,"f");break}case"content_block_start":case"message_delta":break}},b3=function(){if(this.ended)throw new P("stream has ended, this shouldn't happen");let Z=H(this,Q$,"f");if(!Z)throw new P("request ended without sending any chunks");return A(this,Q$,void 0,"f"),R3(Z,H(this,q1,"f"),{logger:H(this,I2,"f")})},V7=function(Z){let X=H(this,Q$,"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&&H7(z)){let J=z[K7]||"";J+=Z.delta.partial_json;let Q={...z};if(Object.defineProperty(Q,K7,{value:J,enumerable:!1,writable:!0}),J)Q.input=f4(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:N7(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 w0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var P2;var x3=E(()=>{$0();n();H3();t$();Q0();P2=class P2 extends x{create($,Z){return this._client.post("/v1/messages/batches",{body:$,...Z})}retrieve($,Z){return this._client.get(w`/v1/messages/batches/${$}`,Z)}list($={},Z){return this._client.getAPIList("/v1/messages/batches",_0,{query:$,...Z})}delete($,Z){return this._client.delete(w`/v1/messages/batches/${$}`,Z)}cancel($,Z){return this._client.post(w`/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:B([{Accept:"application/binary"},Z?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((z,J)=>z1.fromResponse(J.response,J.controller))}}});var F$,B7,DN;var f3=E(()=>{n();o1();T7();E3();x3();x3();Z3();F$=class F$ extends x{constructor(){super(...arguments);this.batches=new P2(this._client)}create($,Z){if($.model in B7)console.warn(`The model '${$.model}' is deprecated and will reach end-of-life on ${B7[$.model]}
197
+ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(DN.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=x4[$.model]??void 0;X=this._client.calculateNonstreamingTimeout($.max_tokens,J)}let z=b4($.tools,$.messages);return this._client.post("/v1/messages",{body:$,timeout:X??600000,...Z,headers:B([z,Z?.headers]),stream:$.stream??!1})}parse($,Z){return this.create($,Z).then((X)=>P3(X,$,{logger:this._client.logger??console}))}stream($,Z){return R2.createMessage(this,$,Z,{logger:this._client.logger??console})}countTokens($,Z){return this._client.post("/v1/messages/count_tokens",{body:$,...Z})}};B7={"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"},DN=["claude-mythos-preview","claude-opus-4-6"];F$.Batches=P2});var W1;var k3=E(()=>{$0();n();Q0();W1=class W1 extends x{retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(w`/v1/models/${$}`,{...X,headers:B([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/models",_0,{query:z,...Z,headers:B([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers])})}}});var L7=E(()=>{F3();I3();f3();k3();lX()});var E2=($)=>{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 s{constructor({baseURL:$=E2("ANTHROPIC_BASE_URL"),apiKey:Z=E2("ANTHROPIC_API_KEY")??null,authToken:X=E2("ANTHROPIC_AUTH_TOKEN")??null,...z}={}){y3.add(this),s4.set(this,void 0);let J={apiKey:Z,authToken:X,...z,baseURL:$||"https://api.anthropic.com"};if(!J.dangerouslyAllowBrowser&&_X())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??g3.DEFAULT_TIMEOUT,this.logger=J.logger??console;let Q="warn";this.logLevel=Q,this.logLevel=k8(J.logLevel,"ClientOptions.logLevel",this)??k8(E2("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??Q,this.fetchOptions=J.fetchOptions,this.maxRetries=J.maxRetries??2,this.fetch=J.fetch??S5(),A(this,s4,b5,"f"),this._options=J,this.apiKey=typeof X==="string"?X: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:X}){if($.get("x-api-key")||$.get("authorization"))return;if(this.apiKey&&$.get("x-api-key"))return;if(X.has("x-api-key"))return;if(this.authToken&&$.get("authorization"))return;if(X.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 B([await this.apiKeyAuth($),await this.bearerAuth($)])}async apiKeyAuth($){if(this.apiKey==null)return;return B([{"X-Api-Key":this.apiKey}])}async bearerAuth($){if(this.authToken==null)return;return B([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery($){return x5($)}getUserAgent(){return`${this.constructor.name}/JS ${e0}`}defaultIdempotencyKey(){return`stainless-node-retry-${E8()}`}makeStatusError($,X,Z,z){return J0.generate($,X,Z,z)}buildURL($,X,Z){let z=!H(this,y3,"m",L7).call(this)&&Z||this.baseURL,J=D5($)?new URL($):new URL(z+(z.endsWith("/")&&$.startsWith("/")?$.slice(1):$)),Q=this.defaultQuery(),Y=Object.fromEntries(J.searchParams);if(!S8(Q)||!S8(Y))X={...Y,...Q,...X};if(typeof X==="object"&&X&&!Array.isArray(X))J.search=this.stringifyQuery(X);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:X,options:Z}){}get($,X){return this.methodRequest("get",$,X)}post($,X){return this.methodRequest("post",$,X)}patch($,X){return this.methodRequest("patch",$,X)}put($,X){return this.methodRequest("put",$,X)}delete($,X){return this.methodRequest("delete",$,X)}methodRequest($,X,Z){return this.request(Promise.resolve(Z).then((z)=>{return{method:$,path:X,...z}}))}request($,X=null){return new X$(this,this.makeRequest($,X,void 0))}async makeRequest($,X,Z){let z=await $,J=z.maxRetries??this.maxRetries;if(X==null)X=J;await this.prepareOptions(z);let{req:Q,url:Y,timeout:q}=await this.buildRequest(z,{retryCount:J-X});await this.prepareRequest(Q,{url:Y,options:z});let W="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),G=Z===void 0?"":`, retryOf: ${Z}`,U=Date.now();if(G0(this).debug(`[${W}] sending request`,g0({retryOfRequestLogID:Z,method:z.method,url:Y,options:z,headers:Q.headers})),z.signal?.aborted)throw new U0;let K=new AbortController,V=await this.fetchWithTimeout(Y,Q,q,K).catch(u1),T=Date.now();if(V instanceof globalThis.Error){let L=`retrying, ${X} attempts remaining`;if(z.signal?.aborted)throw new U0;let I=y0(V)||/timed? ?out/i.test(String(V)+("cause"in V?String(V.cause):""));if(X)return G0(this).info(`[${W}] connection ${I?"timed out":"failed"} - ${L}`),G0(this).debug(`[${W}] connection ${I?"timed out":"failed"} (${L})`,g0({retryOfRequestLogID:Z,url:Y,durationMs:T-U,message:V.message})),this.retryRequest(z,X,Z??W);if(G0(this).info(`[${W}] connection ${I?"timed out":"failed"} - error; no more retries left`),G0(this).debug(`[${W}] connection ${I?"timed out":"failed"} (error; no more retries left)`,g0({retryOfRequestLogID:Z,url:Y,durationMs:T-U,message:V.message})),I)throw new u$;throw new t0({cause:V})}let O=[...V.headers.entries()].filter(([L])=>L==="request-id").map(([L,I])=>", "+L+": "+JSON.stringify(I)).join(""),N=`[${W}${G}${O}] ${Q.method} ${Y} ${V.ok?"succeeded":"failed"} with status ${V.status} in ${T-U}ms`;if(!V.ok){let L=await this.shouldRetry(V);if(X&&L){let j=`retrying, ${X} attempts remaining`;return await j5(V.body),G0(this).info(`${N} - ${j}`),G0(this).debug(`[${W}] response error (${j})`,g0({retryOfRequestLogID:Z,url:V.url,status:V.status,headers:V.headers,durationMs:T-U})),this.retryRequest(z,X,Z??W,V.headers)}let I=L?"error; no more retries left":"error; not retryable";G0(this).info(`${N} - ${I}`);let E=await V.text().catch((j)=>u1(j).message),_=F4(E),S=_?void 0:E;throw G0(this).debug(`[${W}] response error (${I})`,g0({retryOfRequestLogID:Z,url:V.url,status:V.status,headers:V.headers,message:S,durationMs:Date.now()-U})),this.makeStatusError(V.status,_,S,V.headers)}return G0(this).info(N),G0(this).debug(`[${W}] response start`,g0({retryOfRequestLogID:Z,url:V.url,status:V.status,headers:V.headers,durationMs:T-U})),{response:V,options:z,controller:K,requestLogID:W,retryOfRequestLogID:Z,startTime:U}}getAPIList($,X,Z){return this.requestAPIList(X,Z&&"then"in Z?Z.then((z)=>({method:"get",path:$,...z})):{method:"get",path:$,...Z})}requestAPIList($,X){let Z=this.makeRequest(X,null,void 0);return new i1(this,Z,$)}async fetchWithTimeout($,X,Z,z){let{signal:J,method:Q,...Y}=X||{},q=this._makeAbort(z);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:z.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 X=$.headers.get("x-should-retry");if(X==="true")return!0;if(X==="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($,X,Z,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(X,q)}return await I5(J),this.makeRequest($,X-1,Z)}calculateDefaultRetryTimeoutMillis($,X){let J=X-$,Q=Math.min(0.5*Math.pow(2,J),8),Y=1-Math.random()*0.25;return Q*Y*1000}calculateNonstreamingTimeout($,X){if(3600000*$/128000>600000||X!=null&&$>X)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:X=0}={}){let Z={...$},{method:z,path:J,query:Q,defaultBaseURL:Y}=Z,q=this.buildURL(J,Q,Y);if("timeout"in Z)F5("timeout",Z.timeout);Z.timeout=Z.timeout??this.timeout;let{bodyHeaders:W,body:G}=this.buildBody({options:Z}),U=await this.buildHeaders({options:$,method:z,bodyHeaders:W,retryCount:X});return{req:{method:z,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:X,bodyHeaders:Z,retryCount:z}){let J={};if(this.idempotencyHeader&&X!=="get"){if(!$.idempotencyKey)$.idempotencyKey=this.defaultIdempotencyKey();J[this.idempotencyHeader]=$.idempotencyKey}let Q=B([J,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(z),...$.timeout?{"X-Stainless-Timeout":String(Math.trunc($.timeout/1000))}:{},..._5(),...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:X}}){if(!$)return{bodyHeaders:void 0,body:void 0};let Z=B([X]);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:I4($)};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,s4,"f").call(this,{body:$,headers:Z})}}var y3,g3,s4,L7,h3="\\n\\nHuman:",v3="\\n\\nAssistant:",Y$;var u3=C(()=>{k0();B$();j8();f5();N0();$0();p8();B7();_4();I3();k3();F3();f3();j8();n();E4();B$();g3=s,s4=new WeakMap,y3=new WeakSet,L7=function(){return this.baseURL!=="https://api.anthropic.com"};s.Anthropic=g3;s.HUMAN_PROMPT=h3;s.AI_PROMPT=v3;s.DEFAULT_TIMEOUT=600000;s.AnthropicError=P;s.APIError=J0;s.APIConnectionError=t0;s.APIConnectionTimeoutError=u$;s.APIUserAbortError=U0;s.NotFoundError=p$;s.ConflictError=l$;s.RateLimitError=n$;s.BadRequestError=m$;s.AuthenticationError=d$;s.InternalServerError=r$;s.PermissionDeniedError=c$;s.UnprocessableEntityError=i$;s.toFile=r1;Y$=class Y$ extends s{constructor(){super(...arguments);this.completions=new Y1(this),this.messages=new F$(this),this.models=new W1(this),this.beta=new V0(this)}};Y$.Completions=Y1;Y$.Messages=F$;Y$.Models=W1;Y$.Beta=V0});var M7={};c3(M7,{toFile:()=>r1,default:()=>Y$,UnprocessableEntityError:()=>i$,RateLimitError:()=>n$,PermissionDeniedError:()=>c$,PagePromise:()=>i1,NotFoundError:()=>p$,InternalServerError:()=>r$,HUMAN_PROMPT:()=>h3,ConflictError:()=>l$,BaseAnthropic:()=>s,BadRequestError:()=>m$,AuthenticationError:()=>d$,AnthropicError:()=>P,Anthropic:()=>Y$,APIUserAbortError:()=>U0,APIPromise:()=>X$,APIError:()=>J0,APIConnectionTimeoutError:()=>u$,APIConnectionError:()=>t0,AI_PROMPT:()=>v3});var O7=C(()=>{u3();p8();_4();u3();$0();N0()});var Y9=b7(Q9(),1),{program:yN,createCommand:gN,createArgument:hN,createOption:vN,CommanderError:uN,InvalidArgumentError:mN,InvalidOptionArgumentError:dN,Command:q9,Argument:cN,Option:pN,Help:lN}=Y9.default;import{readFileSync as LZ,writeFileSync as wK,existsSync as BZ}from"fs";var gV=z8(),hV=E1(),vV=m6(),T8=C1(),uV=K1(),a0=h(),mV=l0(),dV=Z0(),cV=n0(),pV=r0(),UB=H4(),lV=K8(),iV=H8(),nV=N8(),B4=NZ(),TZ=U1();var rV=gV.Composer,sV=hV.Document,aV=vV.Schema,oV=T8.YAMLError,tV=T8.YAMLParseError,eV=T8.YAMLWarning,$K=uV.Alias,XK=a0.isAlias,ZK=a0.isCollection,zK=a0.isDocument,JK=a0.isMap,QK=a0.isNode,YK=a0.isPair,qK=a0.isScalar,WK=a0.isSeq,GK=mV.Pair,UK=dV.Scalar,VK=cV.YAMLMap,KK=pV.YAMLSeq;var HK=lV.Lexer,NK=iV.LineCounter,TK=nV.Parser,f1=B4.parse,BK=B4.parseAllDocuments,LK=B4.parseDocument,B8=B4.stringify,MK=TZ.visit,OK=TZ.visitAsync;function c($){let X=LZ($,"utf-8");return f1(X)}function r($,X){let Z=B8(X,{lineWidth:0});wK($,Z,"utf-8")}function m($){return LZ($,"utf-8")}function v($=process.cwd()){let X=["project.faf",".faf"];for(let z of X){let J=`${$}/${z}`;if(BZ(J))return J}let Z=$.replace(/\/[^/]+$/,"");if(Z!==$)for(let z of X){let J=`${Z}/${z}`;if(BZ(J))return J}return null}var L8=null;function k1(){if(!L8)try{L8=B0("faf-scoring-kernel")}catch{throw Error(`faf-scoring-kernel not installed.
204
+ `);this.baseURL=J.baseURL,this.timeout=J.timeout??g3.DEFAULT_TIMEOUT,this.logger=J.logger??console;let Q="warn";this.logLevel=Q,this.logLevel=k8(J.logLevel,"ClientOptions.logLevel",this)??k8(E2("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??Q,this.fetchOptions=J.fetchOptions,this.maxRetries=J.maxRetries??2,this.fetch=J.fetch??jX(),A(this,s4,xX,"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 B([await this.apiKeyAuth($),await this.bearerAuth($)])}async apiKeyAuth($){if(this.apiKey==null)return;return B([{"X-Api-Key":this.apiKey}])}async bearerAuth($){if(this.authToken==null)return;return B([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery($){return fX($)}getUserAgent(){return`${this.constructor.name}/JS ${e0}`}defaultIdempotencyKey(){return`stainless-node-retry-${E8()}`}makeStatusError($,Z,X,z){return J0.generate($,Z,X,z)}buildURL($,Z,X){let z=!H(this,y3,"m",M7).call(this)&&X||this.baseURL,J=AX($)?new URL($):new URL(z+(z.endsWith("/")&&$.startsWith("/")?$.slice(1):$)),Q=this.defaultQuery(),Y=Object.fromEntries(J.searchParams);if(!S8(Q)||!S8(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 Z$(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 W="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),G=X===void 0?"":`, retryOf: ${X}`,U=Date.now();if(G0(this).debug(`[${W}] sending request`,g0({retryOfRequestLogID:X,method:z.method,url:Y,options:z,headers:Q.headers})),z.signal?.aborted)throw new U0;let K=new AbortController,V=await this.fetchWithTimeout(Y,Q,q,K).catch(u1),T=Date.now();if(V instanceof globalThis.Error){let L=`retrying, ${Z} attempts remaining`;if(z.signal?.aborted)throw new U0;let R=y0(V)||/timed? ?out/i.test(String(V)+("cause"in V?String(V.cause):""));if(Z)return G0(this).info(`[${W}] connection ${R?"timed out":"failed"} - ${L}`),G0(this).debug(`[${W}] connection ${R?"timed out":"failed"} (${L})`,g0({retryOfRequestLogID:X,url:Y,durationMs:T-U,message:V.message})),this.retryRequest(z,Z,X??W);if(G0(this).info(`[${W}] connection ${R?"timed out":"failed"} - error; no more retries left`),G0(this).debug(`[${W}] connection ${R?"timed out":"failed"} (error; no more retries left)`,g0({retryOfRequestLogID:X,url:Y,durationMs:T-U,message:V.message})),R)throw new u$;throw new t0({cause:V})}let O=[...V.headers.entries()].filter(([L])=>L==="request-id").map(([L,R])=>", "+L+": "+JSON.stringify(R)).join(""),N=`[${W}${G}${O}] ${Q.method} ${Y} ${V.ok?"succeeded":"failed"} with status ${V.status} in ${T-U}ms`;if(!V.ok){let L=await this.shouldRetry(V);if(Z&&L){let j=`retrying, ${Z} attempts remaining`;return await bX(V.body),G0(this).info(`${N} - ${j}`),G0(this).debug(`[${W}] response error (${j})`,g0({retryOfRequestLogID:X,url:V.url,status:V.status,headers:V.headers,durationMs:T-U})),this.retryRequest(z,Z,X??W,V.headers)}let R=L?"error; no more retries left":"error; not retryable";G0(this).info(`${N} - ${R}`);let C=await V.text().catch((j)=>u1(j).message),S=F4(C),_=S?void 0:C;throw G0(this).debug(`[${W}] response error (${R})`,g0({retryOfRequestLogID:X,url:V.url,status:V.status,headers:V.headers,message:_,durationMs:Date.now()-U})),this.makeStatusError(V.status,S,_,V.headers)}return G0(this).info(N),G0(this).debug(`[${W}] response start`,g0({retryOfRequestLogID:X,url:V.url,status:V.status,headers:V.headers,durationMs:T-U})),{response:V,options:z,controller:K,requestLogID:W,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 i1(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 W=setTimeout(q,X),G=globalThis.ReadableStream&&Y.body instanceof globalThis.ReadableStream||typeof Y.body==="object"&&Y.body!==null&&Symbol.asyncIterator in Y.body,U={signal:z.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,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 RX(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)IX("timeout",X.timeout);X.timeout=X.timeout??this.timeout;let{bodyHeaders:W,body:G}=this.buildBody({options:X}),U=await this.buildHeaders({options:$,method:z,bodyHeaders:W,retryCount:Z});return{req:{method:z,headers:U,...X.signal&&{signal:X.signal},...globalThis.ReadableStream&&G instanceof globalThis.ReadableStream&&{duplex:"half"},...G&&{body:G},...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=B([J,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(z),...$.timeout?{"X-Stainless-Timeout":String(Math.trunc($.timeout/1000))}:{},...SX(),...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=B([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:I4($)};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,s4,"f").call(this,{body:$,headers:X})}}var y3,g3,s4,M7,h3="\\n\\nHuman:",v3="\\n\\nAssistant:",Y$;var u3=E(()=>{k0();B$();j8();kX();N0();$0();p8();L7();_4();I3();k3();F3();f3();j8();n();E4();B$();g3=s,s4=new WeakMap,y3=new WeakSet,M7=function(){return this.baseURL!=="https://api.anthropic.com"};s.Anthropic=g3;s.HUMAN_PROMPT=h3;s.AI_PROMPT=v3;s.DEFAULT_TIMEOUT=600000;s.AnthropicError=P;s.APIError=J0;s.APIConnectionError=t0;s.APIConnectionTimeoutError=u$;s.APIUserAbortError=U0;s.NotFoundError=p$;s.ConflictError=l$;s.RateLimitError=n$;s.BadRequestError=m$;s.AuthenticationError=d$;s.InternalServerError=r$;s.PermissionDeniedError=c$;s.UnprocessableEntityError=i$;s.toFile=r1;Y$=class Y$ extends s{constructor(){super(...arguments);this.completions=new Y1(this),this.messages=new F$(this),this.models=new W1(this),this.beta=new V0(this)}};Y$.Completions=Y1;Y$.Messages=F$;Y$.Models=W1;Y$.Beta=V0});var O7={};c3(O7,{toFile:()=>r1,default:()=>Y$,UnprocessableEntityError:()=>i$,RateLimitError:()=>n$,PermissionDeniedError:()=>c$,PagePromise:()=>i1,NotFoundError:()=>p$,InternalServerError:()=>r$,HUMAN_PROMPT:()=>h3,ConflictError:()=>l$,BaseAnthropic:()=>s,BadRequestError:()=>m$,AuthenticationError:()=>d$,AnthropicError:()=>P,Anthropic:()=>Y$,APIUserAbortError:()=>U0,APIPromise:()=>Z$,APIError:()=>J0,APIConnectionTimeoutError:()=>u$,APIConnectionError:()=>t0,AI_PROMPT:()=>v3});var w7=E(()=>{u3();p8();_4();u3();$0();N0()});var Y9=x7(Q9(),1),{program:vN,createCommand:uN,createArgument:mN,createOption:dN,CommanderError:cN,InvalidArgumentError:pN,InvalidOptionArgumentError:lN,Command:q9,Argument:iN,Option:nN,Help:rN}=Y9.default;import{readFileSync as M5,writeFileSync as DK,existsSync as B5}from"fs";import{join as L5,dirname as AK}from"path";var hV=z8(),vV=E1(),uV=m6(),T8=C1(),mV=K1(),a0=h(),dV=l0(),cV=X0(),pV=n0(),lV=r0(),HB=H4(),iV=K8(),nV=H8(),rV=N8(),B4=N5(),T5=U1();var sV=hV.Composer,aV=vV.Document,oV=uV.Schema,tV=T8.YAMLError,eV=T8.YAMLParseError,$K=T8.YAMLWarning,ZK=mV.Alias,XK=a0.isAlias,zK=a0.isCollection,JK=a0.isDocument,QK=a0.isMap,YK=a0.isNode,qK=a0.isPair,WK=a0.isScalar,GK=a0.isSeq,UK=dV.Pair,VK=cV.Scalar,KK=pV.YAMLMap,HK=lV.YAMLSeq;var NK=iV.Lexer,TK=nV.LineCounter,BK=rV.Parser,f1=B4.parse,LK=B4.parseAllDocuments,MK=B4.parseDocument,B8=B4.stringify,OK=T5.visit,wK=T5.visitAsync;function c($){let Z=M5($,"utf-8");return f1(Z)}function r($,Z){let X=B8(Z,{lineWidth:0});DK($,X,"utf-8")}function m($){return M5($,"utf-8")}function v($=process.cwd()){let Z=["project.faf",".faf"];for(let z of Z){let J=L5($,z);if(B5(J))return J}let X=AK($);if(X!==$)for(let z of Z){let J=L5(X,z);if(B5(J))return J}return null}var L8=null;function k1(){if(!L8)try{L8=B0("faf-scoring-kernel")}catch{throw Error(`faf-scoring-kernel not installed.
205
205
 
206
206
  Run: npm install faf-scoring-kernel
207
- `)}return L8}function t($){return JSON.parse(k1().score_faf($))}function MZ($){return k1().validate_faf($)}function OZ($){return k1().compile_fafb($)}function wZ($){return JSON.parse(k1().decompile_fafb($))}function DZ(){return k1().sdk_version()}l();var O8=[{name:"TROPHY",indicator:`${o0("\uD83C\uDFC6")} ${o0("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${o0(f("★"))} ${o0("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${R("◆")} ${R("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${R("◇")} ${R("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${f("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${M("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${M("○")} RED`,threshold:1},{name:"WHITE",indicator:`${M("♡")}`,threshold:0}];function L4($){return $.indicator}function FZ($){for(let X of O8)if($>=X.threshold)return X;return O8[O8.length-1]}function e($){return{score:$.score,tier:FZ($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}l();function z0($,X,Z=!1){let z=L4($.tier),J=f(`${$.score}%`);if(console.log(`${z} ${J} ${M(`${$.populated}/${$.active} slots`)} ${M("—")} ${X}`),$.tier.name!=="TROPHY"&&$.empty>0)console.log(M(` ${$.empty} empty`));if(Z)console.log(""),AK($)}function AK($){for(let[X,Z]of Object.entries($.slots)){let z=Z==="populated"?R("●"):Z==="slotignored"?M("—"):M("○");console.log(` ${z} ${Z==="slotignored"?M(X):X}`)}}l();function M4($,X={}){let Z=$??v();if(!Z)console.error(`Error: project.faf not found
207
+ `)}return L8}function t($){return JSON.parse(k1().score_faf($))}function O5($){return k1().validate_faf($)}function w5($){return k1().compile_fafb($)}function D5($){return JSON.parse(k1().decompile_fafb($))}function A5(){return k1().sdk_version()}l();var O8=[{name:"TROPHY",indicator:`${o0("\uD83C\uDFC6")} ${o0("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${o0(f("★"))} ${o0("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${I("◆")} ${I("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${I("◇")} ${I("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${f("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${M("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${M("○")} RED`,threshold:1},{name:"WHITE",indicator:`${M("♡")}`,threshold:0}];function L4($){return $.indicator}function I5($){for(let Z of O8)if($>=Z.threshold)return Z;return O8[O8.length-1]}function e($){return{score:$.score,tier:I5($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}l();function z0($,Z,X=!1){let z=L4($.tier),J=f(`${$.score}%`);if(console.log(`${z} ${J} ${M(`${$.populated}/${$.active} slots`)} ${M("—")} ${Z}`),$.tier.name!=="TROPHY"&&$.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`:"";console.log(M(` ${$.empty} empty: ${Y}${q}`))}if(X)console.log(""),IK($)}function IK($){for(let[Z,X]of Object.entries($.slots)){let z=X==="populated"?I("●"):X==="slotignored"?M("—"):M("○");console.log(` ${z} ${X==="slotignored"?M(Z):Z}`)}}l();function M4($,Z={}){let X=$??v();if(!X)console.error(`Error: project.faf not found
208
208
 
209
- Run 'faf init' to create one.`),process.exit(2);let z=m(Z),J=t(z),Q=e(J);if(X.json){console.log(JSON.stringify(Q,null,2));return}if(X.status){console.log(`${L4(Q.tier)} ${f(`${Q.score}%`)}`);return}z0(Q,Z,X.verbose)}import{existsSync as PK}from"fs";import{join as kZ}from"path";var K0=[{index:1,path:"project.name",description:"Project name",category:"project"},{index:2,path:"project.goal",description:"What the project does",category:"project"},{index:3,path:"project.main_language",description:"Primary language",category:"project"},{index:4,path:"human_context.who",description:"Who is building this",category:"human"},{index:5,path:"human_context.what",description:"What are they building",category:"human"},{index:6,path:"human_context.why",description:"Why does it exist",category:"human"},{index:7,path:"human_context.where",description:"Where does it run",category:"human"},{index:8,path:"human_context.when",description:"When was it started / timeline",category:"human"},{index:9,path:"human_context.how",description:"How is it built",category:"human"},{index:10,path:"stack.frontend",description:"Framework (React, Svelte, etc.)",category:"frontend"},{index:11,path:"stack.css_framework",description:"CSS framework",category:"frontend"},{index:12,path:"stack.ui_library",description:"UI component library",category:"frontend"},{index:13,path:"stack.state_management",description:"State management",category:"frontend"},{index:14,path:"stack.backend",description:"Backend framework",category:"backend"},{index:15,path:"stack.api_type",description:"API style (REST, GraphQL, etc.)",category:"backend"},{index:16,path:"stack.runtime",description:"Runtime (Node, Bun, Python, etc.)",category:"backend"},{index:17,path:"stack.database",description:"Database",category:"backend"},{index:18,path:"stack.connection",description:"Connection method (Prisma, etc.)",category:"backend"},{index:19,path:"stack.hosting",description:"Hosting platform",category:"universal"},{index:20,path:"stack.build",description:"Build tool",category:"universal"},{index:21,path:"stack.cicd",description:"CI/CD",category:"universal"},{index:22,path:"stack.monorepo_tool",description:"Monorepo tool",category:"enterprise_infra"},{index:23,path:"stack.package_manager",description:"Package manager",category:"enterprise_infra"},{index:24,path:"stack.workspaces",description:"Workspace configuration",category:"enterprise_infra"},{index:25,path:"monorepo.packages_count",description:"Number of packages",category:"enterprise_infra"},{index:26,path:"monorepo.build_orchestrator",description:"Build orchestration tool",category:"enterprise_infra"},{index:27,path:"stack.admin",description:"Admin panel",category:"enterprise_app"},{index:28,path:"stack.cache",description:"Caching layer",category:"enterprise_app"},{index:29,path:"stack.search",description:"Search engine",category:"enterprise_app"},{index:30,path:"stack.storage",description:"Object storage",category:"enterprise_app"},{index:31,path:"monorepo.versioning_strategy",description:"Version strategy",category:"enterprise_ops"},{index:32,path:"monorepo.shared_configs",description:"Shared configs",category:"enterprise_ops"},{index:33,path:"monorepo.remote_cache",description:"Remote build cache",category:"enterprise_ops"}],_B=new Map(K0.map(($)=>[$.path,$]));var SB=K0.filter(($)=>$.index<=21);var FK=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","n/a","not applicable"]);function k$($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return FK.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var y$={cli:["project","human"],library:["project","human"],mcp:["project","backend","human"],backend:["project","backend","universal","human"],"data-science":["project","backend","human"],frontend:["project","frontend","human"],fullstack:["project","frontend","backend","universal","human"],svelte:["project","frontend","backend","universal","human"],framework:["project","frontend","backend","universal","human"],enterprise:["project","frontend","backend","universal","human","enterprise_infra","enterprise_app","enterprise_ops"]};import{existsSync as y,readFileSync as PZ,readdirSync as RZ}from"fs";import{join as k}from"path";var IZ=[{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 N$($){let X=k($,"package.json");if(!y(X))return null;try{return JSON.parse(PZ(X,"utf-8"))}catch{return null}}function IK($,X){if(!X.includes("*"))return y(k($,X));let Z=X.split("/");if(Z.length===1){let q=X.split("*")[0];try{return RZ($).some((W)=>W.startsWith(q))}catch{return!1}}let z=k($,...Z.slice(0,-1)),J=Z[Z.length-1],Q=J.split("*")[0],Y=J.split("*")[1]||"";try{return RZ(z).some((q)=>q.startsWith(Q)&&q.endsWith(Y))}catch{return!1}}function RK($,X,Z){switch($.type){case"dependency":return!!X?.dependencies?.[$.key];case"devDependency":return!!X?.devDependencies?.[$.key];case"file":return IK(Z,$.pattern);default:return!1}}function w8($){let X=N$($);return IZ.map((Z)=>{let J=Z.signals.filter((Q)=>RK(Q,X,$)).length/Z.signals.length;return{name:Z.name,slug:Z.slug,category:Z.category,confidence:J}}).filter((Z)=>Z.confidence>0).sort((Z,z)=>z.confidence-Z.confidence)}function EZ($){let X=N$($);if(X?.devDependencies?.typescript||X?.dependencies?.typescript)return"TypeScript";if(y(k($,"tsconfig.json")))return"TypeScript";if(y(k($,"Cargo.toml")))return"Rust";if(y(k($,"go.mod")))return"Go";if(y(k($,"pyproject.toml"))||y(k($,"setup.py")))return"Python";if(y(k($,"Gemfile")))return"Ruby";if(y(k($,"pom.xml"))||y(k($,"build.gradle")))return"Java";if(y(k($,"Package.swift")))return"Swift";if(y(k($,"build.zig")))return"Zig";if(X)return"JavaScript";return"Unknown"}function CZ($){let X=N$($),Z=w8($);if(X?.bin)return"cli";if(Z.some((G)=>G.slug==="mcp"))return"mcp";let J=Z.some((G)=>G.slug==="svelte"||G.slug==="sveltekit");if(X?.private===!0&&(y(k($,"pnpm-workspace.yaml"))||X?.workspaces!==void 0)&&J)return"framework";if(J)return"svelte";if(Z.some((G)=>G.slug==="nextjs"||G.slug==="nuxt"))return"fullstack";let q=Z.some((G)=>G.category==="frontend"),W=Z.some((G)=>G.category==="backend");if(q&&W)return"fullstack";if(q)return"frontend";if(W)return"backend";if(X?.main&&!X?.bin)return"library";return"library"}function _Z($){if(y(k($,"bunfig.toml")))return"Bun";if(y(k($,"deno.json"))||y(k($,"deno.jsonc")))return"Deno";if(N$($))return"Node.js";if(y(k($,"Cargo.toml")))return"Rust";if(y(k($,"go.mod")))return"Go";return"Unknown"}function SZ($){if(y(k($,"bun.lockb"))||y(k($,"bun.lock")))return"bun";if(y(k($,"pnpm-lock.yaml")))return"pnpm";if(y(k($,"yarn.lock")))return"yarn";if(y(k($,"package-lock.json")))return"npm";return"npm"}function jZ($){if(y(k($,".github/workflows")))return"GitHub Actions";if(y(k($,".gitlab-ci.yml")))return"GitLab CI";if(y(k($,".circleci")))return"CircleCI";if(y(k($,"Jenkinsfile")))return"Jenkins";return null}function bZ($){if(y(k($,"vercel.json")))return"Vercel";if(y(k($,"netlify.toml")))return"Netlify";if(y(k($,"wrangler.toml")))return"Cloudflare";if(y(k($,"Dockerfile")))return"Docker";if(y(k($,"fly.toml")))return"Fly.io";if(y(k($,"render.yaml")))return"Render";return null}function xZ($){let X=k($,"svelte.config.js");if(!y(X))return null;try{let z=PZ(X,"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 fZ($){let X=N$($);if(X?.devDependencies?.vite||X?.dependencies?.vite)return"Vite";if(X?.devDependencies?.webpack||X?.dependencies?.webpack)return"webpack";if(X?.devDependencies?.esbuild||X?.dependencies?.esbuild)return"esbuild";if(y(k($,"tsconfig.json"))&&X?.devDependencies?.typescript)return"TypeScript (tsc)";return null}function g$($){let X=N$($),Z=w8($),z=EZ($),J=CZ($),Q=_Z($),Y=SZ($),q=jZ($),W=bZ($),G=fZ($),U=Z.find((d)=>d.category==="frontend"),K=Z.find((d)=>d.category==="css"),V=Z.find((d)=>d.category==="ui"),T=Z.find((d)=>d.category==="state"),O=Z.find((d)=>d.category==="backend"),N=Z.find((d)=>d.category==="database"),L=y$[J]||y$.library,I=J==="framework",E=Z.some((d)=>d.slug==="svelte"||d.slug==="sveltekit"),_=I&&E?"svelte":I?null:null,S=J==="svelte"||_==="svelte",b=S?xZ($):null,j=S&&Z.some((d)=>d.slug==="sveltekit"),i=new Set(["css_framework","ui_library","database","connection","hosting"]),F={},X0=K0.filter((d)=>d.path.startsWith("stack."));for(let d of X0){let o=d.path.replace("stack.","");if(!L.includes(d.category)){F[o]="slotignored";continue}if(I&&i.has(o)){F[o]="slotignored";continue}switch(o){case"frontend":F[o]=U?.name??(J==="cli"?"CLI":"");break;case"css_framework":F[o]=K?.name??"";break;case"ui_library":F[o]=V?.name??"";break;case"state_management":F[o]=S?T?.name??"Runes":T?.name??"";break;case"backend":F[o]=S?j?"SvelteKit":O?.name??"":O?.name??"";break;case"api_type":F[o]=j?"Server Routes":"";break;case"runtime":F[o]=Q!=="Unknown"?Q:"";break;case"database":F[o]=N?.name??"";break;case"connection":F[o]=N?.name??"";break;case"hosting":if(S&&b)F[o]=b;else F[o]=W??"";break;case"build":F[o]=S?"Vite":G??"";break;case"cicd":F[o]=q??"";break;case"package_manager":F[o]=Y;break;default:F[o]="";break}}let A0={},m0=K0.filter((d)=>d.path.startsWith("monorepo."));for(let d of m0){let o=d.path.replace("monorepo.","");if(!L.includes(d.category))A0[o]="slotignored";else A0[o]=""}let a={name:X?.name??$.split("/").pop()??"project",goal:X?.description??"",main_language:z,type:J};if(I&&_)a.framework=_;return{faf_version:"2.5.0",project:a,stack:F,human_context:{who:"",what:X?.description??"",why:"",where:"",when:"",how:""},monorepo:A0}}l();function D8($={}){let X=process.cwd(),Z=$.output?$.output.endsWith(".faf")?$.output:kZ(X,$.output):kZ(X,"project.faf");if(PK(Z)&&!$.force)console.error(`project.faf already exists. Use ${f("--force")} to overwrite.`),process.exit(1);let z=g$(X);r(Z,z);let J=m(Z),Q=e(t(J));if(console.log(`${R("created")} ${Z}`),z0(Q,Z),Q.score<100)console.log(M(`
210
- run ${f("'faf go'")} to fill empty slots`))}import{existsSync as EK}from"fs";import{join as CK}from"path";l();function yZ(){let $=process.cwd(),X=CK($,"project.faf"),Z=g$($);if(EK(X)){let Q=c(X),Y=gZ(Q,Z);r(X,Y),console.log(`${R("updated")} ${X}`)}else{let Q=Z.project?.type??"library",Y=y$[Q]||y$.library;for(let q of K0)if(!Y.includes(q.category)){let[W,G]=q.path.split(".");if(W==="stack"&&Z.stack)Z.stack[G]="slotignored";if(W==="monorepo"&&Z.monorepo)Z.monorepo[G]="slotignored"}r(X,Z),console.log(`${R("created")} ${X}`)}let z=m(X),J=e(t(z));if(z0(J,X),J.score<100)console.log(M(`
211
- run ${f("'faf go'")} to reach 100%`))}function gZ($,X){let Z={...$};for(let[z,J]of Object.entries(X))if(!(z in Z)||Z[z]===null||Z[z]===void 0)Z[z]=J;else if(typeof J==="object"&&J!==null&&!Array.isArray(J))Z[z]=gZ(Z[z]??{},J);return Z}import{existsSync as v$,statSync as w4}from"fs";import{join as pZ}from"path";import{readFileSync as _K,writeFileSync as SK,existsSync as jK,statSync as JL}from"fs";import{join as hZ}from"path";var vZ="CLAUDE.md",bK="STATUS: BI-SYNC ACTIVE";function uZ($){let X=hZ($,vZ);if(!jK(X))return null;return _K(X,"utf-8")}function mZ($,X){let Z=hZ($,vZ);SK(Z,X,"utf-8")}function T$($){return`<!-- faf: ${[$.project?.name,$.project?.main_language,$.project?.goal].filter(Boolean).map((Z)=>String(Z).trim()).join(" | ")} -->`}function dZ($){let X=[],Z=$.project?.name??"Project",z=$.project?.main_language??"",J=$.project?.goal??"";if(X.push(T$($)),X.push(""),X.push(`# CLAUDE.md — ${Z}`),X.push(""),J)X.push("## What This Is"),X.push(""),X.push(J),X.push("");let Q=$.stack??{},Y=[];if(z)Y.push(`**Language:** ${z}`);for(let[G,U]of Object.entries(Q))if(U&&U!=="slotignored"&&String(U).trim()){let K=G.replace(/_/g," ").replace(/\b\w/g,(V)=>V.toUpperCase());Y.push(`**${K}:** ${U}`)}if(Y.length>0){X.push("## Stack"),X.push("");for(let G of Y)X.push(`- ${G}`);X.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){X.push("## Context"),X.push("");for(let[G,U]of W)X.push(`- **${G}:** ${U}`);X.push("")}return X.push("---"),X.push(""),X.push(`*${bK} — ${new Date().toISOString()}*`),X.push(""),X.join(`
212
- `)}function O4($){let X={project:{}},Z=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(Z)X.project.name=Z[1].trim();if(!X.project.name){let Q=$.match(/\*\*Name:\*\*\s*(.+)/);if(Q)X.project.name=Q[1].trim()}let z=$.match(/## What This Is\s*\n\s*\n(.+)/);if(z)X.project.goal=z[1].trim();if(!X.project.goal){let Q=$.match(/\*\*What Building:\*\*\s*(.+)/);if(Q)X.project.goal=Q[1].trim()}let J=$.match(/\*\*Language:\*\*\s*(.+)/);if(J)X.project.main_language=J[1].trim();if(!X.project.main_language){let Q=$.match(/\*\*Main Language:\*\*\s*(.+)/);if(Q)X.project.main_language=Q[1].trim()}return X}import{readFileSync as WL,writeFileSync as xK,existsSync as GL}from"fs";import{join as fK}from"path";function cZ($,X){xK(fK($,"MEMORY.md"),X,"utf-8")}l();function h$(){return process.env.FAF_PRO==="1"||process.env.FAF_PRO==="true"}function A8($={}){let X=process.cwd(),Z=v(X);if(!Z)console.error(`Error: project.faf not found
209
+ Run 'faf init' to create one.`),process.exit(2);let z=m(X),J=t(z),Q=e(J);if(Z.json){console.log(JSON.stringify(Q,null,2));return}if(Z.status){console.log(`${L4(Q.tier)} ${f(`${Q.score}%`)}`);return}z0(Q,X,Z.verbose)}import{existsSync as CK}from"fs";import{join as y5}from"path";var K0=[{index:1,path:"project.name",description:"Project name",category:"project"},{index:2,path:"project.goal",description:"What the project does",category:"project"},{index:3,path:"project.main_language",description:"Primary language",category:"project"},{index:4,path:"human_context.who",description:"Who is building this",category:"human"},{index:5,path:"human_context.what",description:"What are they building",category:"human"},{index:6,path:"human_context.why",description:"Why does it exist",category:"human"},{index:7,path:"human_context.where",description:"Where does it run",category:"human"},{index:8,path:"human_context.when",description:"When was it started / timeline",category:"human"},{index:9,path:"human_context.how",description:"How is it built",category:"human"},{index:10,path:"stack.frontend",description:"Framework (React, Svelte, etc.)",category:"frontend"},{index:11,path:"stack.css_framework",description:"CSS framework",category:"frontend"},{index:12,path:"stack.ui_library",description:"UI component library",category:"frontend"},{index:13,path:"stack.state_management",description:"State management",category:"frontend"},{index:14,path:"stack.backend",description:"Backend framework",category:"backend"},{index:15,path:"stack.api_type",description:"API style (REST, GraphQL, etc.)",category:"backend"},{index:16,path:"stack.runtime",description:"Runtime (Node, Bun, Python, etc.)",category:"backend"},{index:17,path:"stack.database",description:"Database",category:"backend"},{index:18,path:"stack.connection",description:"Connection method (Prisma, etc.)",category:"backend"},{index:19,path:"stack.hosting",description:"Hosting platform",category:"universal"},{index:20,path:"stack.build",description:"Build tool",category:"universal"},{index:21,path:"stack.cicd",description:"CI/CD",category:"universal"},{index:22,path:"stack.monorepo_tool",description:"Monorepo tool",category:"enterprise_infra"},{index:23,path:"stack.package_manager",description:"Package manager",category:"enterprise_infra"},{index:24,path:"stack.workspaces",description:"Workspace configuration",category:"enterprise_infra"},{index:25,path:"monorepo.packages_count",description:"Number of packages",category:"enterprise_infra"},{index:26,path:"monorepo.build_orchestrator",description:"Build orchestration tool",category:"enterprise_infra"},{index:27,path:"stack.admin",description:"Admin panel",category:"enterprise_app"},{index:28,path:"stack.cache",description:"Caching layer",category:"enterprise_app"},{index:29,path:"stack.search",description:"Search engine",category:"enterprise_app"},{index:30,path:"stack.storage",description:"Object storage",category:"enterprise_app"},{index:31,path:"monorepo.versioning_strategy",description:"Version strategy",category:"enterprise_ops"},{index:32,path:"monorepo.shared_configs",description:"Shared configs",category:"enterprise_ops"},{index:33,path:"monorepo.remote_cache",description:"Remote build cache",category:"enterprise_ops"}],xB=new Map(K0.map(($)=>[$.path,$]));var fB=K0.filter(($)=>$.index<=21);var RK=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","n/a","not applicable"]);function k$($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return RK.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var y$={cli:["project","human"],library:["project","human"],mcp:["project","backend","human"],backend:["project","backend","universal","human"],"data-science":["project","backend","human"],frontend:["project","frontend","human"],fullstack:["project","frontend","backend","universal","human"],svelte:["project","frontend","backend","universal","human"],framework:["project","frontend","backend","universal","human"],enterprise:["project","frontend","backend","universal","human","enterprise_infra","enterprise_app","enterprise_ops"]};import{existsSync as y,readFileSync as E5,readdirSync as P5}from"fs";import{join as k}from"path";var R5=[{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 N$($){let Z=k($,"package.json");if(!y(Z))return null;try{return JSON.parse(E5(Z,"utf-8"))}catch{return null}}function PK($,Z){if(!Z.includes("*"))return y(k($,Z));let X=Z.split("/");if(X.length===1){let q=Z.split("*")[0];try{return P5($).some((W)=>W.startsWith(q))}catch{return!1}}let z=k($,...X.slice(0,-1)),J=X[X.length-1],Q=J.split("*")[0],Y=J.split("*")[1]||"";try{return P5(z).some((q)=>q.startsWith(Q)&&q.endsWith(Y))}catch{return!1}}function EK($,Z,X){switch($.type){case"dependency":return!!Z?.dependencies?.[$.key];case"devDependency":return!!Z?.devDependencies?.[$.key];case"file":return PK(X,$.pattern);default:return!1}}function w8($){let Z=N$($);return R5.map((X)=>{let J=X.signals.filter((Q)=>EK(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 C5($){let Z=N$($);if(Z?.devDependencies?.typescript||Z?.dependencies?.typescript)return"TypeScript";if(y(k($,"tsconfig.json")))return"TypeScript";if(y(k($,"Cargo.toml")))return"Rust";if(y(k($,"go.mod")))return"Go";if(y(k($,"pyproject.toml"))||y(k($,"setup.py")))return"Python";if(y(k($,"Gemfile")))return"Ruby";if(y(k($,"pom.xml"))||y(k($,"build.gradle")))return"Java";if(y(k($,"Package.swift")))return"Swift";if(y(k($,"build.zig")))return"Zig";if(Z)return"JavaScript";return"Unknown"}function _5($){let Z=N$($),X=w8($);if(Z?.bin)return"cli";if(X.some((G)=>G.slug==="mcp"))return"mcp";if(y(k($,"build.zig"))){if(y(k($,"src/main.zig")))return"cli";if(y(k($,"src/root.zig")))return"library"}let J=X.some((G)=>G.slug==="svelte"||G.slug==="sveltekit");if(Z?.private===!0&&(y(k($,"pnpm-workspace.yaml"))||Z?.workspaces!==void 0)&&J)return"framework";if(J)return"svelte";if(X.some((G)=>G.slug==="nextjs"||G.slug==="nuxt"))return"fullstack";let q=X.some((G)=>G.category==="frontend"),W=X.some((G)=>G.category==="backend");if(q&&W)return"fullstack";if(q)return"frontend";if(W)return"backend";if(Z?.main&&!Z?.bin)return"library";return"library"}function S5($){if(y(k($,"bunfig.toml")))return"Bun";if(y(k($,"deno.json"))||y(k($,"deno.jsonc")))return"Deno";if(N$($))return"Node.js";if(y(k($,"Cargo.toml")))return"Rust";if(y(k($,"go.mod")))return"Go";return"Unknown"}function j5($){if(y(k($,"bun.lockb"))||y(k($,"bun.lock")))return"bun";if(y(k($,"pnpm-lock.yaml")))return"pnpm";if(y(k($,"yarn.lock")))return"yarn";if(y(k($,"package-lock.json")))return"npm";return"npm"}function b5($){if(y(k($,".github/workflows")))return"GitHub Actions";if(y(k($,".gitlab-ci.yml")))return"GitLab CI";if(y(k($,".circleci")))return"CircleCI";if(y(k($,"Jenkinsfile")))return"Jenkins";return null}function x5($){if(y(k($,"vercel.json")))return"Vercel";if(y(k($,"netlify.toml")))return"Netlify";if(y(k($,"wrangler.toml")))return"Cloudflare";if(y(k($,"Dockerfile")))return"Docker";if(y(k($,"fly.toml")))return"Fly.io";if(y(k($,"render.yaml")))return"Render";return null}function f5($){let Z=k($,"svelte.config.js");if(!y(Z))return null;try{let z=E5(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 k5($){let Z=N$($);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(y(k($,"tsconfig.json"))&&Z?.devDependencies?.typescript)return"TypeScript (tsc)";return null}function g$($){let Z=N$($),X=w8($),z=C5($),J=_5($),Q=S5($),Y=j5($),q=b5($),W=x5($),G=k5($),U=X.find((d)=>d.category==="frontend"),K=X.find((d)=>d.category==="css"),V=X.find((d)=>d.category==="ui"),T=X.find((d)=>d.category==="state"),O=X.find((d)=>d.category==="backend"),N=X.find((d)=>d.category==="database"),L=y$[J]||y$.library,R=J==="framework",C=X.some((d)=>d.slug==="svelte"||d.slug==="sveltekit"),S=R&&C?"svelte":R?null:null,_=J==="svelte"||S==="svelte",b=_?f5($):null,j=_&&X.some((d)=>d.slug==="sveltekit"),i=new Set(["css_framework","ui_library","database","connection","hosting"]),F={},Z0=K0.filter((d)=>d.path.startsWith("stack."));for(let d of Z0){let o=d.path.replace("stack.","");if(!L.includes(d.category)){F[o]="slotignored";continue}if(R&&i.has(o)){F[o]="slotignored";continue}switch(o){case"frontend":F[o]=U?.name??(J==="cli"?"CLI":"");break;case"css_framework":F[o]=K?.name??"";break;case"ui_library":F[o]=V?.name??"";break;case"state_management":F[o]=_?T?.name??"Runes":T?.name??"";break;case"backend":F[o]=_?j?"SvelteKit":O?.name??"":O?.name??"";break;case"api_type":F[o]=j?"Server Routes":"";break;case"runtime":F[o]=Q!=="Unknown"?Q:"";break;case"database":F[o]=N?.name??"";break;case"connection":F[o]=N?.name??"";break;case"hosting":if(_&&b)F[o]=b;else F[o]=W??"";break;case"build":F[o]=_?"Vite":G??"";break;case"cicd":F[o]=q??"";break;case"package_manager":F[o]=Y;break;default:F[o]="";break}}let A0={},m0=K0.filter((d)=>d.path.startsWith("monorepo."));for(let d of m0){let o=d.path.replace("monorepo.","");if(!L.includes(d.category))A0[o]="slotignored";else A0[o]=""}let a={name:Z?.name??$.split("/").pop()??"project",goal:Z?.description??"",main_language:z,type:J};if(R&&S)a.framework=S;return{faf_version:"2.5.0",project:a,stack:F,human_context:{who:"",what:Z?.description??"",why:"",where:"",when:"",how:""},monorepo:A0}}l();function D8($={}){let Z=process.cwd(),X=$.output?$.output.endsWith(".faf")?$.output:y5(Z,$.output):y5(Z,"project.faf");if(CK(X)&&!$.force)console.error(`project.faf already exists. Use ${f("--force")} to overwrite.`),process.exit(1);let z=g$(Z);r(X,z);let J=m(X),Q=e(t(J));if(console.log(`${I("created")} ${X}`),z0(Q,X),Q.score<100)console.log(M(`
210
+ run ${f("'faf go'")} to fill empty slots`))}import{existsSync as _K}from"fs";import{join as SK}from"path";l();function g5(){let $=process.cwd(),Z=SK($,"project.faf"),X=g$($);if(_K(Z)){let Q=c(Z),Y=h5(Q,X);r(Z,Y),console.log(`${I("updated")} ${Z}`)}else{let Q=X.project?.type??"library",Y=y$[Q]||y$.library;for(let q of K0)if(!Y.includes(q.category)){let[W,G]=q.path.split(".");if(W==="stack"&&X.stack)X.stack[G]="slotignored";if(W==="monorepo"&&X.monorepo)X.monorepo[G]="slotignored"}r(Z,X),console.log(`${I("created")} ${Z}`)}let z=m(Z),J=e(t(z));if(z0(J,Z),J.score<100)console.log(M(`
211
+ run ${f("'faf go'")} to reach 100%`))}function h5($,Z){let X={...$};for(let[z,J]of Object.entries(Z))if(!(z in X)||X[z]===null||X[z]===void 0)X[z]=J;else if(typeof J==="object"&&J!==null&&!Array.isArray(J))X[z]=h5(X[z]??{},J);return X}import{existsSync as v$,statSync as w4}from"fs";import{join as l5,dirname as gK}from"path";import{readFileSync as jK,writeFileSync as bK,existsSync as xK,statSync as WL}from"fs";import{join as v5}from"path";var u5="CLAUDE.md",fK="STATUS: BI-SYNC ACTIVE";function m5($){let Z=v5($,u5);if(!xK(Z))return null;return jK(Z,"utf-8")}function d5($,Z){let X=v5($,u5);bK(X,Z,"utf-8")}function T$($){return`<!-- faf: ${[$.project?.name,$.project?.main_language,$.project?.goal].filter(Boolean).map((X)=>String(X).trim()).join(" | ")} -->`}function c5($){let Z=[],X=$.project?.name??"Project",z=$.project?.main_language??"",J=$.project?.goal??"";if(Z.push(T$($)),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[G,U]of Object.entries(Q))if(U&&U!=="slotignored"&&String(U).trim()){let K=G.replace(/_/g," ").replace(/\b\w/g,(V)=>V.toUpperCase());Y.push(`**${K}:** ${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(`*${fK} — ${new Date().toISOString()}*`),Z.push(""),Z.join(`
212
+ `)}function O4($){let Z={project:{}},X=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(X)Z.project.name=X[1].trim();if(!Z.project.name){let Q=$.match(/\*\*Name:\*\*\s*(.+)/);if(Q)Z.project.name=Q[1].trim()}let z=$.match(/## What This Is\s*\n\s*\n(.+)/);if(z)Z.project.goal=z[1].trim();if(!Z.project.goal){let Q=$.match(/\*\*What Building:\*\*\s*(.+)/);if(Q)Z.project.goal=Q[1].trim()}let J=$.match(/\*\*Language:\*\*\s*(.+)/);if(J)Z.project.main_language=J[1].trim();if(!Z.project.main_language){let Q=$.match(/\*\*Main Language:\*\*\s*(.+)/);if(Q)Z.project.main_language=Q[1].trim()}return Z}import{readFileSync as KL,writeFileSync as kK,existsSync as HL}from"fs";import{join as yK}from"path";function p5($,Z){kK(yK($,"MEMORY.md"),Z,"utf-8")}l();function h$(){return process.env.FAF_PRO==="1"||process.env.FAF_PRO==="true"}function A8($={}){let Z=process.cwd(),X=v(Z);if(!X)console.error(`Error: project.faf not found
213
213
 
214
- Run 'faf init' to create one.`),process.exit(2);let z=pZ(X,"CLAUDE.md"),J=pZ(X,"MEMORY.md"),Q=$.direction??"auto";if(Q==="auto")lZ(Z,z,X);else if(Q==="push")iZ(Z,X);else if(Q==="pull")nZ(Z,z);if(h$())rZ(Z,J,X);if($.watch)console.log(M("watching for changes... (Ctrl+C to stop)")),yK(Z,z,J,X)}function lZ($,X,Z){let z=w4($).mtimeMs,J=v$(X)?w4(X).mtimeMs:0;if(!v$(X)||z>J)iZ($,Z);else nZ($,X)}function iZ($,X){let Z=c($),z=dZ(Z);mZ(X,z),console.log(`${R("◆")} sync .faf → CLAUDE.md ${M("← bi-sync")}`);let J=e(t(m($)));z0(J,$)}function nZ($,X){let Z=uZ(X.replace("/CLAUDE.md",""));if(!Z){console.error("CLAUDE.md not found.");return}let z=O4(Z),J=c($);if(z.project?.name)J.project={...J.project,name:z.project.name};if(z.project?.goal)J.project={...J.project,goal:z.project.goal};if(z.project?.main_language)J.project={...J.project,main_language:z.project.main_language};r($,J),console.log(`${R("◆")} sync CLAUDE.md → .faf ${M("← bi-sync")}`);let Q=e(t(m($)));z0(Q,$)}function rZ($,X,Z){let z=c($),J=w4($).mtimeMs,Q=v$(X)?w4(X).mtimeMs:0;if(!v$(X)||J>Q){let Y=kK(z);cZ(Z,Y),console.log(`${R("◆")} sync .faf → MEMORY.md ${M("← tri-sync")}`)}else console.log(`${R("◆")} sync MEMORY.md → .faf ${M("← tri-sync")}`)}function kK($){let X=$.project??{},Z=[`# ${X.name??"Project"} — Memory Topics`,"","> Generated by faf sync (tri-sync)",""];if(X.name)Z.push(`- **Project:** ${X.name}`);if(X.goal)Z.push(`- **Goal:** ${X.goal}`);if(X.main_language)Z.push(`- **Language:** ${X.main_language}`);if(X.type)Z.push(`- **Type:** ${X.type}`);return Z.join(`
214
+ Run 'faf init' to create one.`),process.exit(2);let z=l5(Z,"CLAUDE.md"),J=l5(Z,"MEMORY.md"),Q=$.direction??"auto";if(Q==="auto")i5(X,z,Z);else if(Q==="push")n5(X,Z);else if(Q==="pull")r5(X,z);if(h$())s5(X,J,Z);if($.watch)console.log(M("watching for changes... (Ctrl+C to stop)")),vK(X,z,J,Z)}function i5($,Z,X){let z=w4($).mtimeMs,J=v$(Z)?w4(Z).mtimeMs:0;if(!v$(Z)||z>J)n5($,X);else r5($,Z)}function n5($,Z){let X=c($),z=c5(X);d5(Z,z),console.log(`${I("◆")} sync .faf → CLAUDE.md ${M("← bi-sync")}`);let J=e(t(m($)));z0(J,$)}function r5($,Z){let X=m5(gK(Z));if(!X){console.error("CLAUDE.md not found.");return}let z=O4(X),J=c($);if(z.project?.name)J.project={...J.project,name:z.project.name};if(z.project?.goal)J.project={...J.project,goal:z.project.goal};if(z.project?.main_language)J.project={...J.project,main_language:z.project.main_language};r($,J),console.log(`${I("◆")} sync CLAUDE.md → .faf ${M("← bi-sync")}`);let Q=e(t(m($)));z0(Q,$)}function s5($,Z,X){let z=c($),J=w4($).mtimeMs,Q=v$(Z)?w4(Z).mtimeMs:0;if(!v$(Z)||J>Q){let Y=hK(z);p5(X,Y),console.log(`${I("◆")} sync .faf → MEMORY.md ${M("← tri-sync")}`)}else console.log(`${I("◆")} sync MEMORY.md → .faf ${M("← tri-sync")}`)}function hK($){let Z=$.project??{},X=[`# ${Z.name??"Project"} — Memory Topics`,"","> Generated by faf sync (tri-sync)",""];if(Z.name)X.push(`- **Project:** ${Z.name}`);if(Z.goal)X.push(`- **Goal:** ${Z.goal}`);if(Z.main_language)X.push(`- **Language:** ${Z.main_language}`);if(Z.type)X.push(`- **Type:** ${Z.type}`);return X.join(`
215
215
  `)+`
216
- `}function yK($,X,Z,z){let{watch:J}=B0("fs"),Q=null,Y=()=>{if(Q)clearTimeout(Q);Q=setTimeout(()=>{if(console.log(M("change detected...")),lZ($,X,z),h$())rZ($,Z,z)},200)};if(J($,Y),v$(X))J(X,Y);if(h$()&&v$(Z))J(Z,Y)}import{writeFileSync as gK}from"fs";l();function sZ($,X={}){let Z=$??v();if(!Z)console.error(`Error: project.faf not found
216
+ `}function vK($,Z,X,z){let{watch:J}=B0("fs"),Q=null,Y=()=>{if(Q)clearTimeout(Q);Q=setTimeout(()=>{if(console.log(M("change detected...")),i5($,Z,z),h$())s5($,X,z)},200)};if(J($,Y),v$(Z))J(Z,Y);if(h$()&&v$(X))J(X,Y)}import{writeFileSync as uK}from"fs";l();function a5($,Z={}){let X=$??v();if(!X)console.error(`Error: project.faf not found
217
217
 
218
- Run 'faf init' to create one.`),process.exit(2);let z=m(Z),J=OZ(z),Q=X.output??Z.replace(/\.faf$/,".fafb");gK(Q,J),console.log(`${R("compiled")} ${Q} ${M(`(${J.length} bytes)`)}`)}import{readFileSync as hK}from"fs";function aZ($,X={}){if(!$)console.error("Error: Please specify a .fafb file to decompile."),process.exit(1);let Z=new Uint8Array(hK($));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 z=wZ(Z);console.log(JSON.stringify(z,null,2))}function oZ($){let X=[];if(!$||typeof $!=="object")return X.push("File is not a valid YAML mapping"),{valid:!1,errors:X};let Z=$;if(!Z.faf_version)X.push("Missing required field: faf_version");if(!Z.project?.name)X.push("Missing required field: project.name");return{valid:X.length===0,errors:X}}l();function F8($,X={}){let Z=$??v();if(!Z)console.error(`Error: project.faf not found
218
+ Run 'faf init' to create one.`),process.exit(2);let z=m(X),J=w5(z),Q=Z.output??X.replace(/\.faf$/,".fafb");uK(Q,J),console.log(`${I("compiled")} ${Q} ${M(`(${J.length} bytes)`)}`)}import{readFileSync as mK}from"fs";function o5($,Z={}){if(!$)console.error("Error: Please specify a .fafb file to decompile."),process.exit(1);let X=new Uint8Array(mK($));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=D5(X);console.log(JSON.stringify(z,null,2))}function t5($){let Z=[];if(!$||typeof $!=="object")return Z.push("File is not a valid YAML mapping"),{valid:!1,errors:Z};let X=$;if(!X.faf_version)Z.push("Missing required field: faf_version");if(!X.project?.name)Z.push("Missing required field: project.name");return{valid:Z.length===0,errors:Z}}l();function F8($,Z={}){let X=$??v();if(!X)console.error(`Error: project.faf not found
219
219
 
220
- Run 'faf init' to create one.`),process.exit(2);let z=c(Z),J=oZ(z);if(!J.valid){console.log(`${f("invalid")} ${Z}`);for(let q of J.errors)console.log(` ${M("x")} ${q}`);process.exit(3)}let Q=m(Z);if(!MZ(Q))console.log(`${f("invalid yaml")} ${Z}`),process.exit(3);console.log(`${R("valid")} ${Z}`);let Y=e(t(Q));if(z0(Y,Z),X.strict&&Y.score<100)console.log(M(`
221
- --strict requires 100%`)),process.exit(1)}import{writeFileSync as vK}from"fs";import{join as uK}from"path";function mK($){let X=[];if(X.push(T$($)),X.push(""),X.push(`# AGENTS.md — ${$.project?.name??"Project"}`),X.push(""),X.push("> Auto-generated from project.faf — do not edit directly"),X.push(""),X.push("## Project Context"),X.push(""),$.project?.name)X.push(`- **Name:** ${$.project.name}`);if($.project?.goal)X.push(`- **Goal:** ${$.project.goal}`);if($.project?.main_language)X.push(`- **Language:** ${$.project.main_language}`);if(X.push(""),X.push("## Stack"),X.push(""),$.stack){for(let[Z,z]of Object.entries($.stack))if(z&&z!=="slotignored"&&z!=="")X.push(`- **${Z}:** ${z}`)}if($.human_context){X.push(""),X.push("## Human Context"),X.push("");for(let[Z,z]of Object.entries($.human_context))if(z&&z!=="")X.push(`- **${Z}:** ${z}`)}return X.push(""),X.join(`
222
- `)}function tZ($,X){vK(uK($,"AGENTS.md"),mK(X),"utf-8")}import{writeFileSync as dK}from"fs";import{join as cK}from"path";function pK($){let X=[];if(X.push(T$($)),X.push(""),X.push("# .cursorrules"),X.push(`# Auto-generated from project.faf — ${$.project?.name??"Project"}`),X.push(""),$.project?.main_language)X.push(`language: ${$.project.main_language}`);if($.stack){X.push(""),X.push("# Stack");for(let[Z,z]of Object.entries($.stack))if(z&&z!=="slotignored"&&z!=="")X.push(`# ${Z}: ${z}`)}return X.push(""),X.join(`
223
- `)}function eZ($,X){dK(cK($,".cursorrules"),pK(X),"utf-8")}import{writeFileSync as lK}from"fs";import{join as iK}from"path";function nK($){let X=[];if(X.push(T$($)),X.push(""),X.push(`# GEMINI.md — ${$.project?.name??"Project"}`),X.push(""),X.push("> Auto-generated from project.faf"),X.push(""),$.project?.name)X.push(`Project: ${$.project.name}`);if($.project?.goal)X.push(`Goal: ${$.project.goal}`);if($.project?.main_language)X.push(`Language: ${$.project.main_language}`);if($.stack){X.push(""),X.push("## Stack");for(let[Z,z]of Object.entries($.stack))if(z&&z!=="slotignored"&&z!=="")X.push(`- ${Z}: ${z}`)}return X.push(""),X.join(`
224
- `)}function $5($,X){lK(iK($,"GEMINI.md"),nK(X),"utf-8")}l();function y1($={}){let X=v();if(!X)console.error(`Error: project.faf not found
220
+ Run 'faf init' to create one.`),process.exit(2);let z=c(X),J=t5(z);if(!J.valid){console.log(`${f("invalid")} ${X}`);for(let q of J.errors)console.log(` ${M("x")} ${q}`);process.exit(3)}let Q=m(X);if(!O5(Q))console.log(`${f("invalid yaml")} ${X}`),process.exit(3);console.log(`${I("valid")} ${X}`);let Y=e(t(Q));if(z0(Y,X),Z.strict&&Y.score<100)console.log(M(`
221
+ --strict requires 100%`)),process.exit(1)}import{writeFileSync as dK}from"fs";import{join as cK}from"path";function pK($){let Z=[];if(Z.push(T$($)),Z.push(""),Z.push(`# AGENTS.md — ${$.project?.name??"Project"}`),Z.push(""),Z.push("> Auto-generated from project.faf — do not edit directly"),Z.push(""),Z.push("## Project Context"),Z.push(""),$.project?.name)Z.push(`- **Name:** ${$.project.name}`);if($.project?.goal)Z.push(`- **Goal:** ${$.project.goal}`);if($.project?.main_language)Z.push(`- **Language:** ${$.project.main_language}`);if(Z.push(""),Z.push("## Stack"),Z.push(""),$.stack){for(let[X,z]of Object.entries($.stack))if(z&&z!=="slotignored"&&z!=="")Z.push(`- **${X}:** ${z}`)}if($.human_context){Z.push(""),Z.push("## Human Context"),Z.push("");for(let[X,z]of Object.entries($.human_context))if(z&&z!=="")Z.push(`- **${X}:** ${z}`)}return Z.push(""),Z.join(`
222
+ `)}function e5($,Z){dK(cK($,"AGENTS.md"),pK(Z),"utf-8")}import{writeFileSync as lK}from"fs";import{join as iK}from"path";function nK($){let Z=[];if(Z.push(T$($)),Z.push(""),Z.push("# .cursorrules"),Z.push(`# Auto-generated from project.faf — ${$.project?.name??"Project"}`),Z.push(""),$.project?.main_language)Z.push(`language: ${$.project.main_language}`);if($.stack){Z.push(""),Z.push("# Stack");for(let[X,z]of Object.entries($.stack))if(z&&z!=="slotignored"&&z!=="")Z.push(`# ${X}: ${z}`)}return Z.push(""),Z.join(`
223
+ `)}function $X($,Z){lK(iK($,".cursorrules"),nK(Z),"utf-8")}import{writeFileSync as rK}from"fs";import{join as sK}from"path";function aK($){let Z=[];if(Z.push(T$($)),Z.push(""),Z.push(`# GEMINI.md — ${$.project?.name??"Project"}`),Z.push(""),Z.push("> Auto-generated from project.faf"),Z.push(""),$.project?.name)Z.push(`Project: ${$.project.name}`);if($.project?.goal)Z.push(`Goal: ${$.project.goal}`);if($.project?.main_language)Z.push(`Language: ${$.project.main_language}`);if($.stack){Z.push(""),Z.push("## Stack");for(let[X,z]of Object.entries($.stack))if(z&&z!=="slotignored"&&z!=="")Z.push(`- ${X}: ${z}`)}return Z.push(""),Z.join(`
224
+ `)}function ZX($,Z){rK(sK($,"GEMINI.md"),aK(Z),"utf-8")}l();function y1($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
225
225
 
226
- Run 'faf init' to create one.`),process.exit(2);let Z=process.cwd(),z=c(X),J=$.all||!$.agents&&!$.cursor&&!$.gemini&&!$.conductor;if(J||$.agents)tZ(Z,z),console.log(" AGENTS.md");if(J||$.cursor)eZ(Z,z),console.log(" .cursorrules");if(J||$.gemini)$5(Z,z),console.log(" GEMINI.md");console.log(`${R("exported")} ${M(`from ${X}`)}`)}import{mkdirSync as rK,rmSync as sK}from"fs";import{join as X5}from"path";import{execSync as aK}from"child_process";import{tmpdir as oK}from"os";l();function Z5($){if(!$)console.error(`Error: Please provide a GitHub URL.
226
+ 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)e5(X,z),console.log(" AGENTS.md");if(J||$.cursor)$X(X,z),console.log(" .cursorrules");if(J||$.gemini)ZX(X,z),console.log(" GEMINI.md");console.log(`${I("exported")} ${M(`from ${Z}`)}`)}import{mkdirSync as oK,rmSync as tK}from"fs";import{join as XX}from"path";import{execSync as eK}from"child_process";import{tmpdir as $H}from"os";l();function zX($){if(!$)console.error(`Error: Please provide a GitHub URL.
227
227
 
228
- Usage: faf git <url>`),process.exit(1);let X=$.endsWith(".git")?$:`${$}.git`,Z=X5(oK(),`faf-git-${Date.now()}`);rK(Z,{recursive:!0});try{console.log(M(`cloning ${$}...`));try{aK(`git clone --depth 1 ${X} ${Z}`,{stdio:"pipe"})}catch(q){let G=(q?.stderr?.toString()??"").trim().split(`
228
+ Usage: faf git <url>`),process.exit(1);let Z=$.endsWith(".git")?$:`${$}.git`,X=XX($H(),`faf-git-${Date.now()}`);oK(X,{recursive:!0});try{console.log(M(`cloning ${$}...`));try{eK(`git clone --depth 1 ${Z} ${X}`,{stdio:"pipe"})}catch(q){let G=(q?.stderr?.toString()??"").trim().split(`
229
229
  `).slice(-2).join(" ").trim()||"git clone failed";console.error(`Error: could not clone ${$}
230
230
 
231
- ${G}`),process.exit(1)}let z=g$(Z),J=X5(process.cwd(),"project.faf");r(J,z),console.log(`${R("created")} ${J}`);let Q=m(J),Y=e(t(Q));z0(Y,J)}finally{sK(Z,{recursive:!0,force:!0})}}l();function z5($={}){if($.version||Object.keys($).length===0)eK()}function eK(){let $=I8();console.log(`${R(f("faf"))} v${$.version}`),console.log(M(`kernel ${DZ()} IANA application/vnd.faf+yaml`))}var g1=[{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"}];l();function J5(){console.log(`${R("formats")} ${M("— supported file types")}
232
- `);let $=new Map;for(let X of g1){let Z=$.get(X.category)??[];Z.push(X),$.set(X.category,Z)}for(let[X,Z]of $){console.log(` ${f(X)}`);for(let z of Z)console.log(` ${z.name} ${M(z.extensions.join(", "))}`);console.log()}console.log(M(` ${g1.length} formats across ${$.size} categories`))}l();import{readdirSync as $H,rmSync as XH}from"fs";import{tmpdir as ZH}from"os";import{join as zH}from"path";function Q5(){let $=ZH(),X=0;try{let Z=$H($);for(let z of Z)if(z.startsWith("faf-git-"))XH(zH($,z),{recursive:!0,force:!0}),X++}catch{}if(X>0)console.log(`${R("cleared")} ${X} cached director${X===1?"y":"ies"}`);else console.log(M("nothing to clear"))}function Y5($={}){let X=v();if(!X)console.error(`Error: project.faf not found
231
+ ${G}`),process.exit(1)}let z=g$(X),J=XX(process.cwd(),"project.faf");r(J,z),console.log(`${I("created")} ${J}`);let Q=m(J),Y=e(t(Q));z0(Y,J)}finally{tK(X,{recursive:!0,force:!0})}}l();function JX($={}){if($.version||Object.keys($).length===0)XH()}function XH(){let $=I8();console.log(`${I(f("faf"))} v${$.version}`),console.log(M(`kernel ${A5()} IANA application/vnd.faf+yaml`))}var g1=[{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"}];l();function QX(){console.log(`${I("formats")} ${M("— supported file types")}
232
+ `);let $=new Map;for(let Z of g1){let X=$.get(Z.category)??[];X.push(Z),$.set(Z.category,X)}for(let[Z,X]of $){console.log(` ${f(Z)}`);for(let z of X)console.log(` ${z.name} ${M(z.extensions.join(", "))}`);console.log()}console.log(M(` ${g1.length} formats across ${$.size} categories`))}l();import{readdirSync as zH,rmSync as JH}from"fs";import{tmpdir as QH}from"os";import{join as YH}from"path";function YX(){let $=QH(),Z=0;try{let X=zH($);for(let z of X)if(z.startsWith("faf-git-"))JH(YH($,z),{recursive:!0,force:!0}),Z++}catch{}if(Z>0)console.log(`${I("cleared")} ${Z} cached director${Z===1?"y":"ies"}`);else console.log(M("nothing to clear"))}function qX($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
233
233
 
234
- Run 'faf init' to create one.`),process.exit(2);if($.json){let Z=c(X);console.log(JSON.stringify(Z,null,2))}else{let Z=m(X);console.log(Z)}}l();function q5(){let $=v();if(!$)console.error(`Error: project.faf not found
234
+ 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=m(Z);console.log(X)}}l();function WX(){let $=v();if(!$)console.error(`Error: project.faf not found
235
235
 
236
- Run 'faf init' to create one.`),process.exit(2);let X=c($),Z=[];for(let z of K0){let[J,Q]=z.path.split("."),q=X[J]?.[Q];if(k$(q)||q==="slotignored")continue;Z.push(`${z.path}: ${q}`)}if(Z.length===0){console.log(M("no populated slots"));return}console.log(Z.join(`
237
- `))}import{existsSync as JH,statSync as W5}from"fs";import{join as QH}from"path";l();var YH=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"];function G5(){let $=v();if(!$)console.error(`Error: project.faf not found
236
+ 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(k$(q)||q==="slotignored")continue;X.push(`${z.path}: ${q}`)}if(X.length===0){console.log(M("no populated slots"));return}console.log(X.join(`
237
+ `))}import{existsSync as qH,statSync as GX}from"fs";import{join as WH}from"path";l();var GH=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"];function UX(){let $=v();if(!$)console.error(`Error: project.faf not found
238
238
 
239
- Run 'faf init' to create one.`),process.exit(2);let X=process.cwd(),Z=W5($).mtimeMs;console.log(`${R("drift")} ${M("— context file sync status")}
240
- `),console.log(` ${f(".faf")} ${M(R8(Z))}`);let z=0;for(let J of YH){let Q=QH(X,J);if(!JH(Q)){console.log(` ${M("○")} ${J} ${M("missing")}`);continue}let Y=W5(Q).mtimeMs,q=Y-Z;if(Math.abs(q)<1000)console.log(` ${R("●")} ${J} ${M("in sync")}`);else if(q>0)console.log(` ${f("!")} ${J} ${f("newer")} ${M(R8(Y))}`),z++;else console.log(` ${M("○")} ${J} ${M("older")} ${M(R8(Y))}`),z++}if(z>0)console.log(M(`
241
- run ${f("'faf sync'")} to resolve drift`))}function R8($){let X=Date.now()-$,Z=Math.floor(X/1000);if(Z<60)return`${Z}s ago`;let z=Math.floor(Z/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`}l();function U5($,X){if(!$||X===void 0)console.error(`Usage: faf edit <path> <value>
239
+ Run 'faf init' to create one.`),process.exit(2);let Z=process.cwd(),X=GX($).mtimeMs;console.log(`${I("drift")} ${M("— context file sync status")}
240
+ `),console.log(` ${f(".faf")} ${M(R8(X))}`);let z=0;for(let J of GH){let Q=WH(Z,J);if(!qH(Q)){console.log(` ${M("○")} ${J} ${M("missing")}`);continue}let Y=GX(Q).mtimeMs,q=Y-X;if(Math.abs(q)<1000)console.log(` ${I("●")} ${J} ${M("in sync")}`);else if(q>0)console.log(` ${f("!")} ${J} ${f("newer")} ${M(R8(Y))}`),z++;else console.log(` ${M("○")} ${J} ${M("older")} ${M(R8(Y))}`),z++}if(z>0)console.log(M(`
241
+ run ${f("'faf sync'")} to resolve drift`))}function R8($){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`}l();function VX($,Z){if(!$||Z===void 0)console.error(`Usage: faf edit <path> <value>
242
242
 
243
- Example: faf edit project.name "My Project"`),process.exit(1);let Z=v();if(!Z)console.error(`Error: project.faf not found
243
+ Example: faf edit project.name "My Project"`),process.exit(1);let X=v();if(!X)console.error(`Error: project.faf not found
244
244
 
245
- Run 'faf init' to create one.`),process.exit(2);let z=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(!z[Q]||typeof z[Q]!=="object")z[Q]={};z[Q][Y]=X,r(Z,z),console.log(`${R("updated")} ${$} ${M("→")} ${X}`)}import{existsSync as D4,readFileSync as P8}from"fs";import{join as h1}from"path";l();function V5(){let $=process.cwd(),X=[],Z={faf_version:"2.5.0",project:{}},z=h1($,"CLAUDE.md");if(D4(z)){let W=P8(z,"utf-8"),G=O4(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;X.push("CLAUDE.md")}let J=h1($,"AGENTS.md");if(D4(J)){let W=P8(J,"utf-8");if(!Z.project.name){let G=W.match(/^#\s+(.+)/m);if(G)Z.project.name=G[1].trim()}X.push("AGENTS.md")}let Q=h1($,"GEMINI.md");if(D4(Q)){let W=P8(Q,"utf-8");if(!Z.project.name){let G=W.match(/^#\s+(.+)/m);if(G)Z.project.name=G[1].trim()}X.push("GEMINI.md")}let Y=h1($,".cursorrules");if(D4(Y))X.push(".cursorrules");if(X.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;r(q,W),console.log(`${R("◆")} recover merged into ${q}`)}else{let W=h1($,"project.faf");r(W,Z),console.log(`${R("◆")} recover created ${W}`)}console.log(M(` sources: ${X.join(", ")}`))}l();var v1="2.5.0";function K5($={}){let X=v();if(!X)console.error(`Error: project.faf not found
245
+ 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,r(X,z),console.log(`${I("updated")} ${$} ${M("→")} ${Z}`)}import{existsSync as D4,readFileSync as P8}from"fs";import{join as h1}from"path";l();function KX(){let $=process.cwd(),Z=[],X={faf_version:"2.5.0",project:{}},z=h1($,"CLAUDE.md");if(D4(z)){let W=P8(z,"utf-8"),G=O4(W);if(G.project?.name)X.project.name=G.project.name;if(G.project?.goal)X.project.goal=G.project.goal;if(G.project?.main_language)X.project.main_language=G.project.main_language;Z.push("CLAUDE.md")}let J=h1($,"AGENTS.md");if(D4(J)){let W=P8(J,"utf-8");if(!X.project.name){let G=W.match(/^#\s+(.+)/m);if(G)X.project.name=G[1].trim()}Z.push("AGENTS.md")}let Q=h1($,"GEMINI.md");if(D4(Q)){let W=P8(Q,"utf-8");if(!X.project.name){let G=W.match(/^#\s+(.+)/m);if(G)X.project.name=G[1].trim()}Z.push("GEMINI.md")}let Y=h1($,".cursorrules");if(D4(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(X.project.name&&!W.project.name)W.project.name=X.project.name;if(X.project.goal&&!W.project.goal)W.project.goal=X.project.goal;if(X.project.main_language&&!W.project.main_language)W.project.main_language=X.project.main_language;r(q,W),console.log(`${I("◆")} recover merged into ${q}`)}else{let W=h1($,"project.faf");r(W,X),console.log(`${I("◆")} recover created ${W}`)}console.log(M(` sources: ${Z.join(", ")}`))}l();var v1="2.5.0";function HX($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
246
246
 
247
- Run 'faf init' to create one.`),process.exit(2);let Z=c(X),z=Z.faf_version??"unknown";if(z===v1){console.log(`${R("◆")} migrate already at v${v1}`);return}if(Z.faf_version=v1,!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(`${R("◆")} migrate ${M("(dry run)")} v${z} → v${v1}`),console.log(M(` would update ${X}`));return}r(X,Z),console.log(`${R("◆")} migrate v${z} → v${v1}`),console.log(M(` updated ${X}`))}l();function H5($){if($==="features")WH();else if($==="activate")GH();else qH()}function qH(){let $=h$();if(console.log(`${R("pro")} ${M("— FAF Pro status")}
248
- `),console.log(` Status: ${$?o0(f("PRO")):f("Free")}`),console.log(""),!$)console.log(M(" Upgrade: faf pro activate"))}function WH(){console.log(`${R("pro")} ${M("— Pro features")}
249
- `);let $=[["tri-sync",".faf ↔ CLAUDE.md ↔ MEMORY.md"],["enterprise slots","33-slot scoring (slots 22-33)"],["advanced analytics","Drift tracking & team metrics"]];for(let[X,Z]of $)console.log(` ${R("◆")} ${f(X)} ${M("—")} ${Z}`);console.log("")}function GH(){console.log(`${R("pro")} ${M("— activate")}
250
- `),console.log(" Set FAF_PRO=1 in your environment to enable Pro features."),console.log(""),console.log(M(" export FAF_PRO=1")),console.log(""),console.log(M(" Visit: https://faf.one/pro")),import("open").then(({default:$})=>$("https://faf.one/pro")).catch(()=>{})}import{gzipSync as UH}from"zlib";l();function N5($={}){let X=v();if(!X)console.error(`Error: project.faf not found
247
+ Run 'faf init' to create one.`),process.exit(2);let X=c(Z),z=X.faf_version??"unknown";if(z===v1){console.log(`${I("◆")} migrate already at v${v1}`);return}if(X.faf_version=v1,!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 ${M("(dry run)")} v${z} → v${v1}`),console.log(M(` would update ${Z}`));return}r(Z,X),console.log(`${I("◆")} migrate v${z} → v${v1}`),console.log(M(` updated ${Z}`))}l();function NX($){if($==="features")VH();else if($==="activate")KH();else UH()}function UH(){let $=h$();if(console.log(`${I("pro")} ${M("— FAF Pro status")}
248
+ `),console.log(` Status: ${$?o0(f("PRO")):f("Free")}`),console.log(""),!$)console.log(M(" Upgrade: faf pro activate"))}function VH(){console.log(`${I("pro")} ${M("— Pro features")}
249
+ `);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("◆")} ${f(Z)} ${M("—")} ${X}`);console.log("")}function KH(){console.log(`${I("pro")} ${M("— activate")}
250
+ `),console.log(" Set FAF_PRO=1 in your environment to enable Pro features."),console.log(""),console.log(M(" export FAF_PRO=1")),console.log(""),console.log(M(" Visit: https://faf.one/pro")),import("open").then(({default:$})=>$("https://faf.one/pro")).catch(()=>{})}import{gzipSync as HH}from"zlib";l();function TX($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
251
251
 
252
- Run 'faf init' to create one.`),process.exit(2);let Z=m(X),J=UH(Buffer.from(Z)).toString("base64url");if($.raw){console.log(J);return}let Q=`https://faf.one/share?d=${J}`;if(console.log(`${R("◆")} share ${M(X)}
252
+ Run 'faf init' to create one.`),process.exit(2);let X=m(Z),J=HH(Buffer.from(X)).toString("base64url");if($.raw){console.log(J);return}let Q=`https://faf.one/share?d=${J}`;if(console.log(`${I("◆")} share ${M(Z)}
253
253
  `),console.log(` ${Q}`),$.copy)try{let{execSync:Y}=B0("child_process"),q=process.platform;if(q==="darwin")Y("pbcopy",{input:Q});else if(q==="linux")Y("xclip -selection clipboard",{input:Q});console.log(M(`
254
254
  copied to clipboard`))}catch{console.log(M(`
255
- copy failed — install xclip or pbcopy`))}}import{mkdirSync as VH,writeFileSync as KH,rmSync as HH}from"fs";import{tmpdir as NH}from"os";import{join as T5}from"path";l();function B5(){let $=T5(NH(),`faf-demo-${Date.now()}`);VH($,{recursive:!0}),console.log(`${R("demo")} ${M("— FAF in action")}
256
- `);let X=`faf_version: 2.5.0
255
+ copy failed — install xclip or pbcopy`))}}import{mkdirSync as NH,writeFileSync as TH,rmSync as BH}from"fs";import{tmpdir as LH}from"os";import{join as BX}from"path";l();function LX(){let $=BX(LH(),`faf-demo-${Date.now()}`);NH($,{recursive:!0}),console.log(`${I("demo")} ${M("— FAF in action")}
256
+ `);let Z=`faf_version: 2.5.0
257
257
  project:
258
258
  name: acme-app
259
259
  goal: Full-stack web application for team collaboration
@@ -278,42 +278,45 @@ human_context:
278
278
  where: Cloud (Vercel + AWS)
279
279
  when: "2026"
280
280
  how: Agile sprints with CI/CD
281
- `,Z=T5($,"project.faf");KH(Z,X),console.log(` ${f("1.")} Created sample project.faf`),console.log(M(` ${Z}
282
- `)),console.log(` ${f("2.")} Scoring...`);let z=e(t(m(Z)));console.log(""),z0(z,"project.faf",!0),HH($,{recursive:!0,force:!0}),console.log(`
283
- ${M(' Demo complete. Run "faf init" in your project to get started.')}`)}l();function L5($,X={}){if(!$)console.error("Usage: faf search <keyword>"),process.exit(2);let Z=$.toLowerCase(),z=!X.slots&&!X.formats,J=0;if(z||X.slots){let Q=K0.filter((Y)=>Y.path.toLowerCase().includes(Z)||Y.description.toLowerCase().includes(Z)||Y.category.toLowerCase().includes(Z));if(Q.length>0){console.log(`${R("slots")} ${M(`— ${Q.length} match${Q.length===1?"":"es"}`)}
284
- `);for(let Y of Q)console.log(` ${f(`#${Y.index}`)} ${Y.path} ${M("—")} ${Y.description} ${M(`[${Y.category}]`)}`);console.log(""),J+=Q.length}}if(z||X.formats){let Q=g1.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(`${R("formats")} ${M(`— ${Q.length} match${Q.length===1?"":"es"}`)}
285
- `);for(let Y of Q)console.log(` ${f(Y.name)} ${M(Y.extensions.join(", "))} ${M(`[${Y.category}]`)}`);console.log(""),J+=Q.length}}if(J===0)console.log(M(` No results for "${$}"`))}import{writeFileSync as TH}from"fs";l();function M5($={}){let X=v();if(!X)console.error(`Error: project.faf not found
281
+ `,X=BX($,"project.faf");TH(X,Z),console.log(` ${f("1.")} Created sample project.faf`),console.log(M(` ${X}
282
+ `)),console.log(` ${f("2.")} Scoring...`);let z=e(t(m(X)));console.log(""),z0(z,"project.faf",!0),BH($,{recursive:!0,force:!0}),console.log(`
283
+ ${M(' Demo complete. Run "faf init" in your project to get started.')}`)}l();function MX($,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")} ${M(`— ${Q.length} match${Q.length===1?"":"es"}`)}
284
+ `);for(let Y of Q)console.log(` ${f(`#${Y.index}`)} ${Y.path} ${M("—")} ${Y.description} ${M(`[${Y.category}]`)}`);console.log(""),J+=Q.length}}if(z||Z.formats){let Q=g1.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")} ${M(`— ${Q.length} match${Q.length===1?"":"es"}`)}
285
+ `);for(let Y of Q)console.log(` ${f(Y.name)} ${M(Y.extensions.join(", "))} ${M(`[${Y.category}]`)}`);console.log(""),J+=Q.length}}if(J===0)console.log(M(` No results for "${$}"`))}import{writeFileSync as MH}from"fs";l();function OX($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
286
286
 
287
- Run 'faf init' to create one.`),process.exit(2);let Z=c(X),z=m(X),J=e(t(z)),Q={taf_version:"1.0.0",generated:new Date().toISOString(),source:X,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)TH($.output,Y,"utf-8"),console.log(`${R("◆")} taf receipt written to ${$.output}`);else console.log(Y)}import{createInterface as BH}from"readline";import{existsSync as O5,readFileSync as LH,writeFileSync as MH,unlinkSync as OH}from"fs";import{join as wH}from"path";l();var DH=".faf-session.json";function AH($,X){let Z=X.split("."),z=$;for(let J of Z){if(z===null||z===void 0||typeof z!=="object")return;z=z[J]}return z}function FH($,X,Z){let z=X.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]]=Z}async function w5($={}){let X=v();if(!X)console.error(`Error: project.faf not found
287
+ Run 'faf init' to create one.`),process.exit(2);let X=c(Z),z=m(Z),J=e(t(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)MH($.output,Y,"utf-8"),console.log(`${I("◆")} taf receipt written to ${$.output}`);else console.log(Y)}import{createInterface as OH}from"readline";import{existsSync as wX,readFileSync as wH,writeFileSync as DH,unlinkSync as AH}from"fs";import{join as FH}from"path";l();var IH=".faf-session.json";function RH($,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 PH($,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 DX($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
288
288
 
289
- Run 'faf init' to create one.`),process.exit(2);let Z=process.cwd(),z=wH(Z,DH),J=0;if($.resume&&O5(z))try{J=JSON.parse(LH(z,"utf-8")).slotIndex,console.log(M(` resuming from slot #${J+1}`))}catch{}let Q=c(X),Y=K0.filter((V)=>{let T=AH(Q,V.path);return k$(T)&&T!=="slotignored"});if(Y.length===0){console.log(`${R("◆")} go all slots populated`);let V=e(t(m(X)));z0(V,X);return}console.log(`${R("go")} ${M("— guided interview")}`),console.log(M(` ${Y.length} empty slots. Enter a value, "skip" to skip, or "quit" to stop.
290
- `));let q=BH({input:process.stdin,output:process.stdout}),W=(V)=>new Promise((T)=>q.question(V,T)),G=0,U=Y.slice(J);for(let V=0;V<U.length;V++){let T=U[V],O=await W(` ${f(`#${T.index}`)} ${T.description} ${M(`(${T.path})`)}: `);if(O.toLowerCase()==="quit"){let N={slotIndex:J+V,fafPath:X};MH(z,JSON.stringify(N),"utf-8"),console.log(M(`
291
- session saved. Resume with: faf go --resume`));break}if(O.toLowerCase()==="skip"||O.trim()==="")continue;FH(Q,T.path,O.trim()),G++}if(q.close(),G>0)r(X,Q),console.log(`
292
- ${R("◆")} go filled ${G} slot${G===1?"":"s"}`);let K=e(t(m(X)));if(z0(K,X),O5(z))try{OH(z)}catch{}}l();function wN($,X){let Z=X.split("."),z=$;for(let J of Z){if(z===null||z===void 0||typeof z!=="object")return;z=z[J]}return z}function DN($,X,Z){let z=X.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]]=Z}async function w7($){if($==="analyze")await FN();else if($==="enhance")await AN();else console.log(`${R("ai")} ${M("— AI-powered features")}
293
- `),console.log(` ${f("faf ai enhance")} ${M("— fill empty slots via Claude")}`),console.log(` ${f("faf ai analyze")} ${M("— get improvement suggestions")}`),console.log(""),console.log(M(" Requires ANTHROPIC_API_KEY environment variable."))}async function D7(){let $=process.env.ANTHROPIC_API_KEY;if(!$)console.error(`Error: ANTHROPIC_API_KEY not set.
289
+ Run 'faf init' to create one.`),process.exit(2);let X=process.cwd(),z=FH(X,IH),J=0;if($.resume&&wX(z))try{J=JSON.parse(wH(z,"utf-8")).slotIndex,console.log(M(` resuming from slot #${J+1}`))}catch{}let Q=c(Z),Y=K0.filter((V)=>{let T=RH(Q,V.path);return k$(T)&&T!=="slotignored"});if(Y.length===0){console.log(`${I("◆")} go all slots populated`);let V=e(t(m(Z)));z0(V,Z);return}console.log(`${I("go")} ${M("— guided interview")}`),console.log(M(` ${Y.length} empty slots. Enter a value, "skip" to skip, or "quit" to stop.
290
+ `));let q=OH({input:process.stdin,output:process.stdout}),W=(V)=>new Promise((T)=>q.question(V,T)),G=0,U=Y.slice(J);for(let V=0;V<U.length;V++){let T=U[V],O=await W(` ${f(`#${T.index}`)} ${T.description} ${M(`(${T.path})`)}: `);if(O.toLowerCase()==="quit"){let N={slotIndex:J+V,fafPath:Z};DH(z,JSON.stringify(N),"utf-8"),console.log(M(`
291
+ session saved. Resume with: faf go --resume`));break}if(O.toLowerCase()==="skip"||O.trim()==="")continue;PH(Q,T.path,O.trim()),G++}if(q.close(),G>0)r(Z,Q),console.log(`
292
+ ${I("◆")} go filled ${G} slot${G===1?"":"s"}`);let K=e(t(m(Z)));if(z0(K,Z),wX(z))try{AH(z)}catch{}}l();function FN($,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 IN($,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 D7($){if($==="analyze")await PN();else if($==="enhance")await RN();else console.log(`${I("ai")} ${M("— AI-powered features")}
293
+ `),console.log(` ${f("faf ai enhance")} ${M("— fill empty slots via Claude")}`),console.log(` ${f("faf ai analyze")} ${M("— get improvement suggestions")}`),console.log(""),console.log(M(" Requires ANTHROPIC_API_KEY environment variable."))}async function A7(){let $=process.env.ANTHROPIC_API_KEY;if(!$)console.error(`Error: ANTHROPIC_API_KEY not set.
294
294
 
295
- export ANTHROPIC_API_KEY=sk-...`),process.exit(2);try{let{default:X}=await Promise.resolve().then(() => (O7(),M7));return new X({apiKey:$})}catch{console.error(`Error: @anthropic-ai/sdk not installed.
295
+ export ANTHROPIC_API_KEY=sk-...`),process.exit(2);try{let{default:Z}=await Promise.resolve().then(() => (w7(),O7));return new Z({apiKey:$})}catch{console.error(`Error: @anthropic-ai/sdk not installed.
296
296
 
297
- npm install @anthropic-ai/sdk`),process.exit(2)}}async function AN(){let $=v();if(!$)console.error(`Error: project.faf not found
297
+ npm install @anthropic-ai/sdk`),process.exit(2)}}async function RN(){let $=v();if(!$)console.error(`Error: project.faf not found
298
298
 
299
- Run 'faf init' to create one.`),process.exit(2);let X=c($),Z=m($),z=K0.filter((W)=>{let G=wN(X,W.path);return k$(G)&&G!=="slotignored"});if(z.length===0){console.log(`${R("◆")} ai enhance all slots populated`);return}console.log(`${R("ai")} enhance ${M(`filling ${z.length} empty slots...`)}`);let J=await D7(),Q=z.map((W)=>`- ${W.path}: ${W.description}`).join(`
299
+ Run 'faf init' to create one.`),process.exit(2);let Z=c($),X=m($),z=K0.filter((W)=>{let G=FN(Z,W.path);return k$(G)&&G!=="slotignored"});if(z.length===0){console.log(`${I("◆")} ai enhance all slots populated`);return}console.log(`${I("ai")} enhance ${M(`filling ${z.length} empty slots...`)}`);let J=await A7(),Q=z.map((W)=>`- ${W.path}: ${W.description}`).join(`
300
300
  `),Y=`Given this project .faf file:
301
301
 
302
- ${Z}
302
+ ${X}
303
303
 
304
304
  Fill in these empty slots with reasonable values based on the project context. Return ONLY a JSON object mapping dot-paths to values.
305
305
 
306
306
  Empty slots:
307
307
  ${Q}
308
308
 
309
- Respond with ONLY valid JSON, no markdown fences.`,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;for(let K of z){let V=G[K.path];if(V&&typeof V==="string")DN(X,K.path,V),console.log(` ${R("●")} ${K.path} ${M("←")} ${V}`),U++}if(U>0){r($,X),console.log(`
310
- ${R("◆")} ai enhance filled ${U} slot${U===1?"":"s"}`);let K=e(t(m($)));z0(K,$)}}catch{console.error("Error: Could not parse AI response.")}}async function FN(){let $=v();if(!$)console.error(`Error: project.faf not found
309
+ Respond with ONLY valid JSON, no markdown fences.`,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;for(let K of z){let V=G[K.path];if(V&&typeof V==="string")IN(Z,K.path,V),console.log(` ${I("●")} ${K.path} ${M("←")} ${V}`),U++}if(U>0){r($,Z),console.log(`
310
+ ${I("◆")} ai enhance filled ${U} slot${U===1?"":"s"}`);let K=e(t(m($)));z0(K,$)}}catch{console.error("Error: Could not parse AI response.")}}async function PN(){let $=v();if(!$)console.error(`Error: project.faf not found
311
311
 
312
- Run 'faf init' to create one.`),process.exit(2);let X=m($);console.log(`${R("ai")} analyze ${M("getting suggestions...")}`);let z=await(await D7()).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.
312
+ Run 'faf init' to create one.`),process.exit(2);let Z=m($);console.log(`${I("ai")} analyze ${M("getting suggestions...")}`);let z=await(await A7()).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.
313
313
 
314
- ${X}
314
+ ${Z}
315
+
316
+ Be concise. One line per suggestion.`}]});console.log(""),console.log(z.content[0].text)}import{existsSync as m3,readFileSync as d3,readdirSync as EN}from"fs";import{join as F7}from"path";l();function I7($,Z){if($==="import")CN(Z);else if($==="export")_N();else console.log(`${I("conductor")} ${M("— conductor integration")}
317
+ `),console.log(` ${f("faf conductor import <path>")} ${M("— import conductor config into .faf")}`),console.log(` ${f("faf conductor export")} ${M("— generate conductor config from .faf")}`)}function CN($){if(!$)console.error("Usage: faf conductor import <path>"),process.exit(2);if(!m3($))console.error(`Error: path not found: ${$}`),process.exit(2);let Z={faf_version:"2.5.0",project:{}};if(m3($)&&$.endsWith(".json")){let J=JSON.parse(d3($,"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(m3($)&&($.endsWith(".yml")||$.endsWith(".yaml"))){let J=f1(d3($,"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=EN($);for(let Q of J){let Y=F7($,Q);if(Q.endsWith(".json"))try{let q=JSON.parse(d3(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=v(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;r(z,J),console.log(`${I("◆")} conductor import merged into ${z}`)}else{let J=F7(X,"project.faf");r(J,Z),console.log(`${I("◆")} conductor import created ${J}`)}}function _N(){let $=v();if(!$)console.error(`Error: project.faf not found
315
318
 
316
- Be concise. One line per suggestion.`}]});console.log(""),console.log(z.content[0].text)}import{existsSync as m3,readFileSync as d3,readdirSync as IN}from"fs";import{join as A7}from"path";l();function F7($,X){if($==="import")RN(X);else if($==="export")PN();else console.log(`${R("conductor")} ${M(" conductor integration")}
317
- `),console.log(` ${f("faf conductor import <path>")} ${M("— import conductor config into .faf")}`),console.log(` ${f("faf conductor export")} ${M("— generate conductor config from .faf")}`)}function RN($){if(!$)console.error("Usage: faf conductor import <path>"),process.exit(2);if(!m3($))console.error(`Error: path not found: ${$}`),process.exit(2);let X={faf_version:"2.5.0",project:{}};if(m3($)&&$.endsWith(".json")){let J=JSON.parse(d3($,"utf-8"));if(J.name)X.project.name=J.name;if(J.description)X.project.goal=J.description;if(J.language)X.project.main_language=J.language}else if(m3($)&&($.endsWith(".yml")||$.endsWith(".yaml"))){let J=f1(d3($,"utf-8"));if(J.name)X.project.name=J.name;if(J.description)X.project.goal=J.description;if(J.language)X.project.main_language=J.language}else try{let J=IN($);for(let Q of J){let Y=A7($,Q);if(Q.endsWith(".json"))try{let q=JSON.parse(d3(Y,"utf-8"));if(q.name&&!X.project.name)X.project.name=q.name;if(q.description&&!X.project.goal)X.project.goal=q.description}catch{}}}catch{console.error(`Error: could not read directory: ${$}`),process.exit(2)}let Z=process.cwd(),z=v(Z);if(z){let J=c(z);if(!J.project)J.project={};if(X.project.name&&!J.project.name)J.project.name=X.project.name;if(X.project.goal&&!J.project.goal)J.project.goal=X.project.goal;if(X.project.main_language&&!J.project.main_language)J.project.main_language=X.project.main_language;r(z,J),console.log(`${R("◆")} conductor import merged into ${z}`)}else{let J=A7(Z,"project.faf");r(J,X),console.log(`${R("◆")} conductor import created ${J}`)}}function PN(){let $=v();if(!$)console.error(`Error: project.faf not found
319
+ 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))}var{version:R7}=I8(),g=new q9;g.name("faf").description("Foundational AI-Context Format — project DNA for any AI").version(R7,"-v, --version");g.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(($)=>D8($));g.command("auto").description("Zero to 100% in one command").action(()=>g5());g.command("go").description("Guided interview to gold code").option("--resume","Resume previous session").action(($)=>DX($));g.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)=>M4($,Z));g.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(($)=>A8($));g.command("compile [file]").description("Compile .faf to .fafb binary").option("--output <path>","Output path").action(($,Z)=>a5($,Z));g.command("decompile <file>").description("Decompile .fafb to JSON").option("--output <path>","Output path").action(($,Z)=>o5($,Z));g.command("git <url>").description("Instant .faf from any GitHub repo").action(($)=>zX($));g.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(($)=>y1($));g.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)=>F8($,Z));g.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(($)=>JX($));g.command("formats").description("Show supported formats").action(()=>QX());g.command("clear").description("Clear cached data").action(()=>YX());g.command("convert").description("Convert .faf to other formats").option("--json","Output as JSON").action(($)=>qX($));g.command("context").description("Generate context output").action(()=>WX());g.command("drift").description("Check context drift").action(()=>UX());g.command("edit <path> <value>").description("Edit .faf fields").action(($,Z)=>VX($,Z));g.command("recover").description("Recover .faf from context files").action(()=>KX());g.command("migrate").description("Migrate .faf to latest version").option("--dry-run","Preview changes without writing").action(($)=>HX($));g.command("pro [subcommand]").description("Pro features & licensing").action(($)=>NX($));g.command("share").description("Share .faf via URL").option("--copy","Copy to clipboard").option("--raw","Output encoded string only").action(($)=>TX($));g.command("demo").description("Demo walkthrough").action(()=>LX());g.command("search <query>").description("Search slots and formats").option("--slots","Search slots only").option("--formats","Search formats only").action(($,Z)=>MX($,Z));g.command("taf").description("Test Archive Format receipt").option("--output <path>","Write receipt to file").action(($)=>OX($));g.command("ai [subcommand]").description("AI-powered features (enhance|analyze)").action(($)=>D7($));g.command("conductor [subcommand] [path]").description("Conductor integration").action(($,Z)=>I7($,Z));g.command("bi-sync",{hidden:!0}).action(()=>A8());g.command("status",{hidden:!0}).action(()=>M4(void 0,{status:!0}));g.command("agents",{hidden:!0}).action(()=>y1({agents:!0}));g.command("cursor",{hidden:!0}).action(()=>y1({cursor:!0}));g.command("gemini",{hidden:!0}).action(()=>y1({gemini:!0}));g.command("validate",{hidden:!0}).action(($)=>F8($));g.command("yolo",{hidden:!0}).action(()=>D8({yolo:!0}));if(process.argv.length<=2)(async()=>{let{bold:$,dim:Z,fafCyan:X}=await Promise.resolve().then(() => (l(),F5)),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",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[48;2;29;29;29m"}${"\x1B[38;2;150;150;150m"}▀${"\x1B[48;2;150;150;150m"}███████${"\x1B[0m"} ${X($("faf"))} ${Z(`v${R7}`)}`);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"}${G}░${"\x1B[48;2;150;150;150m"}${"\x1B[38;2;150;150;150m"}██${"\x1B[48;2;29;29;29m"}${G}░░${"\x1B[48;2;150;150;150m"}${"\x1B[38;2;150;150;150m"}██${"\x1B[48;2;29;29;29m"}${G}░${"\x1B[0m"} ${Z("Nelly Never Forgets")}`),console.log(`${G}▔▔▔▔▔▔▔▔▔▔▔▔${"\x1B[0m"}`),console.log(`${Z(" "+z)}`),console.log("");try{await M4(void 0,{status:!0})}catch{}console.log(""),console.log(` ${Z("Run")} ${X("faf --help")} ${Z("for commands")}`)})();else g.parse(process.argv);
318
320
 
319
- Run 'faf init' to create one.`),process.exit(2);let X=c($),Z={name:X.project?.name??"",description:X.project?.goal??"",language:X.project?.main_language??"",stack:X.stack??{}};console.log(JSON.stringify(Z,null,2))}var{version:I7}=I8(),g=new q9;g.name("faf").description("Foundational AI-Context Format — project DNA for any AI").version(I7,"-v, --version");g.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(($)=>D8($));g.command("auto").description("Zero to 100% in one command").action(()=>yZ());g.command("go").description("Guided interview to gold code").option("--resume","Resume previous session").action(($)=>w5($));g.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(($,X)=>M4($,X));g.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(($)=>A8($));g.command("compile [file]").description("Compile .faf to .fafb binary").option("--output <path>","Output path").action(($,X)=>sZ($,X));g.command("decompile <file>").description("Decompile .fafb to JSON").option("--output <path>","Output path").action(($,X)=>aZ($,X));g.command("git <url>").description("Instant .faf from any GitHub repo").action(($)=>Z5($));g.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(($)=>y1($));g.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(($,X)=>F8($,X));g.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(($)=>z5($));g.command("formats").description("Show supported formats").action(()=>J5());g.command("clear").description("Clear cached data").action(()=>Q5());g.command("convert").description("Convert .faf to other formats").option("--json","Output as JSON").action(($)=>Y5($));g.command("context").description("Generate context output").action(()=>q5());g.command("drift").description("Check context drift").action(()=>G5());g.command("edit <path> <value>").description("Edit .faf fields").action(($,X)=>U5($,X));g.command("recover").description("Recover .faf from context files").action(()=>V5());g.command("migrate").description("Migrate .faf to latest version").option("--dry-run","Preview changes without writing").action(($)=>K5($));g.command("pro [subcommand]").description("Pro features & licensing").action(($)=>H5($));g.command("share").description("Share .faf via URL").option("--copy","Copy to clipboard").option("--raw","Output encoded string only").action(($)=>N5($));g.command("demo").description("Demo walkthrough").action(()=>B5());g.command("search <query>").description("Search slots and formats").option("--slots","Search slots only").option("--formats","Search formats only").action(($,X)=>L5($,X));g.command("taf").description("Test Archive Format receipt").option("--output <path>","Write receipt to file").action(($)=>M5($));g.command("ai [subcommand]").description("AI-powered features (enhance|analyze)").action(($)=>w7($));g.command("conductor [subcommand] [path]").description("Conductor integration").action(($,X)=>F7($,X));g.command("bi-sync",{hidden:!0}).action(()=>A8());g.command("status",{hidden:!0}).action(()=>M4(void 0,{status:!0}));g.command("agents",{hidden:!0}).action(()=>y1({agents:!0}));g.command("cursor",{hidden:!0}).action(()=>y1({cursor:!0}));g.command("gemini",{hidden:!0}).action(()=>y1({gemini:!0}));g.command("validate",{hidden:!0}).action(($)=>F8($));g.command("yolo",{hidden:!0}).action(()=>D8({yolo:!0}));if(process.argv.length<=2)(async()=>{let{bold:$,dim:X,fafCyan:Z}=await Promise.resolve().then(() => (l(),AZ)),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",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[48;2;29;29;29m"}${"\x1B[38;2;150;150;150m"}▀${"\x1B[48;2;150;150;150m"}███████${"\x1B[0m"} ${Z($("faf"))} ${X(`v${I7}`)}`);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"}${G}░${"\x1B[48;2;150;150;150m"}${"\x1B[38;2;150;150;150m"}██${"\x1B[48;2;29;29;29m"}${G}░░${"\x1B[48;2;150;150;150m"}${"\x1B[38;2;150;150;150m"}██${"\x1B[48;2;29;29;29m"}${G}░${"\x1B[0m"} ${X("Nelly Never Forgets")}`),console.log(`${G}▔▔▔▔▔▔▔▔▔▔▔▔${"\x1B[0m"}`),console.log(`${X(" "+z)}`),console.log("");try{await M4(void 0,{status:!0})}catch{}console.log(""),console.log(` ${X("Run")} ${Z("faf --help")} ${X("for commands")}`)})();else g.parse(process.argv);
321
+ //# debugId=1104C040CD19FECA64756E2164756E21
322
+ //# sourceMappingURL=cli.js.map