faf-cli 6.14.0 → 6.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1,176 +1,176 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as YJ}from"node:module";var az=Object.create;var{getPrototypeOf:oz,defineProperty:E6,getOwnPropertyNames:tz}=Object;var ez=Object.prototype.hasOwnProperty;function $J($){return this[$]}var ZJ,XJ,zJ=($,Z,X)=>{var z=$!=null&&typeof $==="object";if(z){var J=Z?ZJ??=new WeakMap:XJ??=new WeakMap,Q=J.get($);if(Q)return Q}X=$!=null?az(oz($)):{};let Y=Z||!$||!$.__esModule?E6(X,"default",{value:$,enumerable:!0}):X;for(let U of tz($))if(!ez.call(Y,U))E6(Y,U,{get:$J.bind($,U),enumerable:!0});if(z)J.set($,Y);return Y};var R=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var JJ=($)=>$;function QJ($,Z){this[$]=JJ.bind(null,Z)}var yZ=($,Z)=>{for(var X in Z)E6($,X,{get:Z[X],enumerable:!0,configurable:!0,set:QJ.bind(Z,X)})};var b=($,Z)=>()=>($&&(Z=$($=0)),Z);var T0=YJ(import.meta.url);var P1=R((UJ)=>{class j6 extends Error{constructor($,Z,X){super(X);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=Z,this.exitCode=$,this.nestedError=void 0}}class fZ extends j6{constructor($){super(1,"commander.invalidArgument",$);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}UJ.CommanderError=j6;UJ.InvalidArgumentError=fZ});var n4=R((KJ)=>{var{InvalidArgumentError:qJ}=P1();class gZ{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 qJ(`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 VJ($){let Z=$.name()+($.variadic===!0?"...":"");return $.required?"<"+Z+">":"["+Z+"]"}KJ.Argument=gZ;KJ.humanReadableArgName=VJ});var S6=R((NJ)=>{var{humanReadableArgName:LJ}=n4();class hZ{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)=>LJ(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(q,V){return Z.formatItem(q,X,V,Z)}let Q=[`${Z.styleTitle("Usage:")} ${Z.styleUsage(Z.commandUsage($))}`,""],Y=Z.commandDescription($);if(Y.length>0)Q=Q.concat([Z.boxWrap(Z.styleCommandDescription(Y),z),""]);let U=Z.visibleArguments($).map((q)=>{return J(Z.styleArgumentTerm(Z.argumentTerm(q)),Z.styleArgumentDescription(Z.argumentDescription(q)))});if(Q=Q.concat(this.formatItemList("Arguments:",U,Z)),this.groupItems($.options,Z.visibleOptions($),(q)=>q.helpGroupHeading??"Options:").forEach((q,V)=>{let K=q.map((H)=>{return J(Z.styleOptionTerm(Z.optionTerm(H)),Z.styleOptionDescription(Z.optionDescription(H)))});Q=Q.concat(this.formatItemList(V,K,Z))}),Z.showGlobalOptions){let q=Z.visibleGlobalOptions($).map((V)=>{return J(Z.styleOptionTerm(Z.optionTerm(V)),Z.styleOptionDescription(Z.optionDescription(V)))});Q=Q.concat(this.formatItemList("Global Options:",q,Z))}return this.groupItems($.commands,Z.visibleCommands($),(q)=>q.helpGroup()||"Commands:").forEach((q,V)=>{let K=q.map((H)=>{return J(Z.styleSubcommandTerm(Z.subcommandTerm(H)),Z.styleSubcommandDescription(Z.subcommandDescription(H)))});Q=Q.concat(this.formatItemList(V,K,Z))}),Q.join(`
3
- `)}displayWidth($){return vZ($).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($)),U=2,W=(this.helpWidth??80)-Z-U-2,q;if(W<this.minWidthToWrap||z.preformatted(X))q=X;else q=z.boxWrap(X,W).replace(/\n/g,`
2
+ import{createRequire as BJ}from"node:module";var JJ=Object.create;var{getPrototypeOf:QJ,defineProperty:x6,getOwnPropertyNames:YJ}=Object;var UJ=Object.prototype.hasOwnProperty;function GJ($){return this[$]}var WJ,qJ,VJ=($,Z,X)=>{var z=$!=null&&typeof $==="object";if(z){var J=Z?WJ??=new WeakMap:qJ??=new WeakMap,Q=J.get($);if(Q)return Q}X=$!=null?JJ(QJ($)):{};let Y=Z||!$||!$.__esModule?x6(X,"default",{value:$,enumerable:!0}):X;for(let U of YJ($))if(!UJ.call(Y,U))x6(Y,U,{get:GJ.bind($,U),enumerable:!0});if(z)J.set($,Y);return Y};var F=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var KJ=($)=>$;function HJ($,Z){this[$]=KJ.bind(null,Z)}var hZ=($,Z)=>{for(var X in Z)x6($,X,{get:Z[X],enumerable:!0,configurable:!0,set:HJ.bind(Z,X)})};var b=($,Z)=>()=>($&&(Z=$($=0)),Z);var D0=BJ(import.meta.url);var S1=F((LJ)=>{class k6 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 uZ extends k6{constructor($){super(1,"commander.invalidArgument",$);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}LJ.CommanderError=k6;LJ.InvalidArgumentError=uZ});var t4=F((DJ)=>{var{InvalidArgumentError:OJ}=S1();class mZ{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 OJ(`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 TJ($){let Z=$.name()+($.variadic===!0?"...":"");return $.required?"<"+Z+">":"["+Z+"]"}DJ.Argument=mZ;DJ.humanReadableArgName=TJ});var y6=F((FJ)=>{var{humanReadableArgName:RJ}=t4();class cZ{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext($){this.helpWidth=this.helpWidth??$.helpWidth??80}visibleCommands($){let Z=$.commands.filter((z)=>!z._hidden),X=$._getHelpCommand();if(X&&!X._hidden)Z.push(X);if(this.sortSubcommands)Z.sort((z,J)=>{return z.name().localeCompare(J.name())});return Z}compareOptions($,Z){let X=(z)=>{return z.short?z.short.replace(/^-/,""):z.long.replace(/^--/,"")};return X($).localeCompare(X(Z))}visibleOptions($){let Z=$.options.filter((z)=>!z.hidden),X=$._getHelpOption();if(X&&!X.hidden){let z=X.short&&$._findOption(X.short),J=X.long&&$._findOption(X.long);if(!z&&!J)Z.push(X);else if(X.long&&!J)Z.push($.createOption(X.long,X.description));else if(X.short&&!z)Z.push($.createOption(X.short,X.description))}if(this.sortOptions)Z.sort(this.compareOptions);return Z}visibleGlobalOptions($){if(!this.showGlobalOptions)return[];let Z=[];for(let X=$.parent;X;X=X.parent){let z=X.options.filter((J)=>!J.hidden);Z.push(...z)}if(this.sortOptions)Z.sort(this.compareOptions);return Z}visibleArguments($){if($._argsDescription)$.registeredArguments.forEach((Z)=>{Z.description=Z.description||$._argsDescription[Z.name()]||""});if($.registeredArguments.find((Z)=>Z.description))return $.registeredArguments;return[]}subcommandTerm($){let Z=$.registeredArguments.map((X)=>RJ(X)).join(" ");return $._name+($._aliases[0]?"|"+$._aliases[0]:"")+($.options.length?" [options]":"")+(Z?" "+Z:"")}optionTerm($){return $.flags}argumentTerm($){return $.name()}longestSubcommandTermLength($,Z){return Z.visibleCommands($).reduce((X,z)=>{return Math.max(X,this.displayWidth(Z.styleSubcommandTerm(Z.subcommandTerm(z))))},0)}longestOptionTermLength($,Z){return Z.visibleOptions($).reduce((X,z)=>{return Math.max(X,this.displayWidth(Z.styleOptionTerm(Z.optionTerm(z))))},0)}longestGlobalOptionTermLength($,Z){return Z.visibleGlobalOptions($).reduce((X,z)=>{return Math.max(X,this.displayWidth(Z.styleOptionTerm(Z.optionTerm(z))))},0)}longestArgumentTermLength($,Z){return Z.visibleArguments($).reduce((X,z)=>{return Math.max(X,this.displayWidth(Z.styleArgumentTerm(Z.argumentTerm(z))))},0)}commandUsage($){let Z=$._name;if($._aliases[0])Z=Z+"|"+$._aliases[0];let X="";for(let z=$.parent;z;z=z.parent)X=z.name()+" "+X;return X+Z+" "+$.usage()}commandDescription($){return $.description()}subcommandDescription($){return $.summary()||$.description()}optionDescription($){let Z=[];if($.argChoices)Z.push(`choices: ${$.argChoices.map((X)=>JSON.stringify(X)).join(", ")}`);if($.defaultValue!==void 0){if($.required||$.optional||$.isBoolean()&&typeof $.defaultValue==="boolean")Z.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`)}if($.presetArg!==void 0&&$.optional)Z.push(`preset: ${JSON.stringify($.presetArg)}`);if($.envVar!==void 0)Z.push(`env: ${$.envVar}`);if(Z.length>0){let X=`(${Z.join(", ")})`;if($.description)return`${$.description} ${X}`;return X}return $.description}argumentDescription($){let Z=[];if($.argChoices)Z.push(`choices: ${$.argChoices.map((X)=>JSON.stringify(X)).join(", ")}`);if($.defaultValue!==void 0)Z.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`);if(Z.length>0){let X=`(${Z.join(", ")})`;if($.description)return`${$.description} ${X}`;return X}return $.description}formatItemList($,Z,X){if(Z.length===0)return[];return[X.styleTitle($),...Z,""]}groupItems($,Z,X){let z=new Map;return $.forEach((J)=>{let Q=X(J);if(!z.has(Q))z.set(Q,[])}),Z.forEach((J)=>{let Q=X(J);if(!z.has(Q))z.set(Q,[]);z.get(Q).push(J)}),z}formatHelp($,Z){let X=Z.padWidth($,Z),z=Z.helpWidth??80;function J(q,V){return Z.formatItem(q,X,V,Z)}let Q=[`${Z.styleTitle("Usage:")} ${Z.styleUsage(Z.commandUsage($))}`,""],Y=Z.commandDescription($);if(Y.length>0)Q=Q.concat([Z.boxWrap(Z.styleCommandDescription(Y),z),""]);let U=Z.visibleArguments($).map((q)=>{return J(Z.styleArgumentTerm(Z.argumentTerm(q)),Z.styleArgumentDescription(Z.argumentDescription(q)))});if(Q=Q.concat(this.formatItemList("Arguments:",U,Z)),this.groupItems($.options,Z.visibleOptions($),(q)=>q.helpGroupHeading??"Options:").forEach((q,V)=>{let K=q.map((B)=>{return J(Z.styleOptionTerm(Z.optionTerm(B)),Z.styleOptionDescription(Z.optionDescription(B)))});Q=Q.concat(this.formatItemList(V,K,Z))}),Z.showGlobalOptions){let q=Z.visibleGlobalOptions($).map((V)=>{return J(Z.styleOptionTerm(Z.optionTerm(V)),Z.styleOptionDescription(Z.optionDescription(V)))});Q=Q.concat(this.formatItemList("Global Options:",q,Z))}return this.groupItems($.commands,Z.visibleCommands($),(q)=>q.helpGroup()||"Commands:").forEach((q,V)=>{let K=q.map((B)=>{return J(Z.styleSubcommandTerm(Z.subcommandTerm(B)),Z.styleSubcommandDescription(Z.subcommandDescription(B)))});Q=Q.concat(this.formatItemList(V,K,Z))}),Q.join(`
3
+ `)}displayWidth($){return dZ($).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($)),U=2,W=(this.helpWidth??80)-Z-U-2,q;if(W<this.minWidthToWrap||z.preformatted(X))q=X;else q=z.boxWrap(X,W).replace(/\n/g,`
4
4
  `+" ".repeat(Z+U));return Q+Y+" ".repeat(U)+q.replace(/\n/g,`
5
5
  ${Q}`)}boxWrap($,Z){if(Z<this.minWidthToWrap)return $;let X=$.split(/\r\n|\n/),z=/[\s]*[^\s]+/g,J=[];return X.forEach((Q)=>{let Y=Q.match(z);if(Y===null){J.push("");return}let U=[Y.shift()],G=this.displayWidth(U[0]);Y.forEach((W)=>{let q=this.displayWidth(W);if(G+q<=Z){U.push(W),G+=q;return}J.push(U.join(""));let V=W.trimStart();U=[V],G=this.displayWidth(V)}),J.push(U.join(""))}),J.join(`
6
- `)}}function vZ($){let Z=/\x1b\[\d*(;\d*)*m/g;return $.replace(Z,"")}NJ.Help=hZ;NJ.stripColor=vZ});var b6=R((IJ)=>{var{InvalidArgumentError:TJ}=P1();class mZ{constructor($,Z){this.flags=$,this.description=Z||"",this.required=$.includes("<"),this.optional=$.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test($),this.mandatory=!1;let X=DJ($);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 TJ(`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 uZ(this.name().replace(/^no-/,""));return uZ(this.name())}helpGroup($){return this.helpGroupHeading=$,this}is($){return this.short===$||this.long===$}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class cZ{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 uZ($){return $.split("-").reduce((Z,X)=>{return Z+X[0].toUpperCase()+X.slice(1)})}function DJ($){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],U=`option creation failed due to '${Y}' in option flags '${$}'`;if(/^-[^-][^-]/.test(Y))throw Error(`${U}
6
+ `)}}function dZ($){let Z=/\x1b\[\d*(;\d*)*m/g;return $.replace(Z,"")}FJ.Help=cZ;FJ.stripColor=dZ});var f6=F((EJ)=>{var{InvalidArgumentError:_J}=S1();class lZ{constructor($,Z){this.flags=$,this.description=Z||"",this.required=$.includes("<"),this.optional=$.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test($),this.mandatory=!1;let X=CJ($);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 _J(`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 pZ(this.name().replace(/^no-/,""));return pZ(this.name())}helpGroup($){return this.helpGroupHeading=$,this}is($){return this.short===$||this.long===$}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class iZ{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 pZ($){return $.split("-").reduce((Z,X)=>{return Z+X[0].toUpperCase()+X.slice(1)})}function CJ($){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],U=`option creation failed due to '${Y}' in option flags '${$}'`;if(/^-[^-][^-]/.test(Y))throw Error(`${U}
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(`${U}
10
10
  - too many short flags`);if(J.test(Y))throw Error(`${U}
11
11
  - too many long flags`);throw Error(`${U}
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}}IJ.Option=mZ;IJ.DualOptions=cZ});var dZ=R((PJ)=>{function FJ($,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 wJ($,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 U=FJ($,Y),G=Math.max($.length,Y.length);if((G-U)/G>Q){if(U<J)J=U,z=[Y];else if(U===J)z.push(Y)}}),z.sort((Y,U)=>Y.localeCompare(U)),X)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}}EJ.Option=lZ;EJ.DualOptions=iZ});var nZ=F((kJ)=>{function bJ($,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 xJ($,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 U=bJ($,Y),G=Math.max($.length,Y.length);if((G-U)/G>Q){if(U<J)J=U,z=[Y];else if(U===J)z.push(Y)}}),z.sort((Y,U)=>Y.localeCompare(U)),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""}PJ.suggestSimilar=wJ});var nZ=R((kJ)=>{var CJ=T0("node:events").EventEmitter,x6=T0("node:child_process"),h0=T0("node:path"),r4=T0("node:fs"),l=T0("node:process"),{Argument:EJ,humanReadableArgName:jJ}=n4(),{CommanderError:k6}=P1(),{Help:SJ,stripColor:bJ}=S6(),{Option:pZ,DualOptions:xJ}=b6(),{suggestSimilar:lZ}=dZ();class f6 extends CJ{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)=>l.stdout.write(Z),writeErr:(Z)=>l.stderr.write(Z),outputError:(Z,X)=>X(Z),getOutHelpWidth:()=>l.stdout.isTTY?l.stdout.columns:void 0,getErrHelpWidth:()=>l.stderr.isTTY?l.stderr.columns:void 0,getOutHasColors:()=>y6()??(l.stdout.isTTY&&l.stdout.hasColors?.()),getErrHasColors:()=>y6()??(l.stderr.isTTY&&l.stderr.hasColors?.()),stripColor:(Z)=>bJ(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(/([^ ]+) *(.*)/),U=this.createCommand(Q);if(z)U.description(z),U._executableHandler=!0;if(J.isDefault)this._defaultCommandName=U._name;if(U._hidden=!!(J.noHelp||J.hidden),U._executableFile=J.executableFile||null,Y)U.arguments(Y);if(this._registerCommand(U),U.parent=this,U.copyInheritedSettings(this),z)return this;return U}createCommand($){return new f6($)}createHelp(){return Object.assign(new SJ,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 EJ($,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 k6($,Z,X));l.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 pZ($,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 U=this.getOptionValue(X);if(J!==null&&$.parseArg)J=this._callParseArg($,J,U,Q);else if(J!==null&&$.variadic)J=$._collectValue(J,U);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 pZ)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=(U,G)=>{let W=Y.exec(U);return W?W[0]:G},Q.default(J).argParser(z)}else Q.default(z);return this.addOption(Q)}option($,Z,X,z){return this._optionEx({},$,Z,X,z)}requiredOption($,Z,X,z){return this._optionEx({mandatory:!0},$,Z,X,z)}combineFlagAndOptionalValue($=!0){return this._combineFlagAndOptionalValue=!!$,this}allowUnknownOption($=!0){return this._allowUnknownOption=!!$,this}allowExcessArguments($=!0){return this._allowExcessArguments=!!$,this}enablePositionalOptions($=!0){return this._enablePositionalOptions=!!$,this}passThroughOptions($=!0){return this._passThroughOptions=!!$,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties($=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!$,this}getOptionValue($){if(this._storeOptionsAsProperties)return this[$];return this._optionValues[$]}setOptionValue($,Z){return this.setOptionValueWithSource($,Z,void 0)}setOptionValueWithSource($,Z,X){if(this._storeOptionsAsProperties)this[$]=Z;else this._optionValues[$]=Z;return this._optionValueSources[$]=X,this}getOptionValueSource($){return this._optionValueSources[$]}getOptionValueSourceWithGlobals($){let Z;return this._getCommandAndAncestors().forEach((X)=>{if(X.getOptionValueSource($)!==void 0)Z=X.getOptionValueSource($)}),Z}_prepareUserArgs($,Z){if($!==void 0&&!Array.isArray($))throw Error("first parameter to parse must be array or undefined");if(Z=Z||{},$===void 0&&Z.from===void 0){if(l.versions?.electron)Z.from="electron";let z=l.execArgv??[];if(z.includes("-e")||z.includes("--eval")||z.includes("-p")||z.includes("--print"))Z.from="eval"}if($===void 0)$=l.argv;this.rawArgs=$.slice();let X;switch(Z.from){case void 0:case"node":this._scriptPath=$[1],X=$.slice(2);break;case"electron":if(l.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(r4.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
14
+ (Did you mean ${z[0]}?)`;return""}kJ.suggestSimilar=xJ});var oZ=F((cJ)=>{var fJ=D0("node:events").EventEmitter,g6=D0("node:child_process"),m0=D0("node:path"),e4=D0("node:fs"),l=D0("node:process"),{Argument:gJ,humanReadableArgName:vJ}=t4(),{CommanderError:v6}=S1(),{Help:hJ,stripColor:uJ}=y6(),{Option:rZ,DualOptions:mJ}=f6(),{suggestSimilar:sZ}=nZ();class u6 extends fJ{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)=>l.stdout.write(Z),writeErr:(Z)=>l.stderr.write(Z),outputError:(Z,X)=>X(Z),getOutHelpWidth:()=>l.stdout.isTTY?l.stdout.columns:void 0,getErrHelpWidth:()=>l.stderr.isTTY?l.stderr.columns:void 0,getOutHasColors:()=>h6()??(l.stdout.isTTY&&l.stdout.hasColors?.()),getErrHasColors:()=>h6()??(l.stderr.isTTY&&l.stderr.hasColors?.()),stripColor:(Z)=>uJ(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(/([^ ]+) *(.*)/),U=this.createCommand(Q);if(z)U.description(z),U._executableHandler=!0;if(J.isDefault)this._defaultCommandName=U._name;if(U._hidden=!!(J.noHelp||J.hidden),U._executableFile=J.executableFile||null,Y)U.arguments(Y);if(this._registerCommand(U),U.parent=this,U.copyInheritedSettings(this),z)return this;return U}createCommand($){return new u6($)}createHelp(){return Object.assign(new hJ,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 gJ($,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 v6($,Z,X));l.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 rZ($,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 U=this.getOptionValue(X);if(J!==null&&$.parseArg)J=this._callParseArg($,J,U,Q);else if(J!==null&&$.variadic)J=$._collectValue(J,U);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 rZ)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=(U,G)=>{let W=Y.exec(U);return W?W[0]:G},Q.default(J).argParser(z)}else Q.default(z);return this.addOption(Q)}option($,Z,X,z){return this._optionEx({},$,Z,X,z)}requiredOption($,Z,X,z){return this._optionEx({mandatory:!0},$,Z,X,z)}combineFlagAndOptionalValue($=!0){return this._combineFlagAndOptionalValue=!!$,this}allowUnknownOption($=!0){return this._allowUnknownOption=!!$,this}allowExcessArguments($=!0){return this._allowExcessArguments=!!$,this}enablePositionalOptions($=!0){return this._enablePositionalOptions=!!$,this}passThroughOptions($=!0){return this._passThroughOptions=!!$,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties($=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!$,this}getOptionValue($){if(this._storeOptionsAsProperties)return this[$];return this._optionValues[$]}setOptionValue($,Z){return this.setOptionValueWithSource($,Z,void 0)}setOptionValueWithSource($,Z,X){if(this._storeOptionsAsProperties)this[$]=Z;else this._optionValues[$]=Z;return this._optionValueSources[$]=X,this}getOptionValueSource($){return this._optionValueSources[$]}getOptionValueSourceWithGlobals($){let Z;return this._getCommandAndAncestors().forEach((X)=>{if(X.getOptionValueSource($)!==void 0)Z=X.getOptionValueSource($)}),Z}_prepareUserArgs($,Z){if($!==void 0&&!Array.isArray($))throw Error("first parameter to parse must be array or undefined");if(Z=Z||{},$===void 0&&Z.from===void 0){if(l.versions?.electron)Z.from="electron";let z=l.execArgv??[];if(z.includes("-e")||z.includes("--eval")||z.includes("-p")||z.includes("--print"))Z.from="eval"}if($===void 0)$=l.argv;this.rawArgs=$.slice();let X;switch(Z.from){case void 0:case"node":this._scriptPath=$[1],X=$.slice(2);break;case"electron":if(l.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(e4.existsSync($))return;let z=Z?`searched for local subcommand relative to directory '${Z}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",J=`'${$}' does not exist
19
19
  - if '${X}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
20
20
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
21
- - ${z}`;throw Error(J)}_executeSubCommand($,Z){Z=Z.slice();let X=!1,z=[".js",".ts",".tsx",".mjs",".cjs"];function J(W,q){let V=h0.resolve(W,q);if(r4.existsSync(V))return V;if(z.includes(h0.extname(q)))return;let K=z.find((H)=>r4.existsSync(`${V}${H}`));if(K)return`${V}${K}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Q=$._executableFile||`${this._name}-${$._name}`,Y=this._executableDir||"";if(this._scriptPath){let W;try{W=r4.realpathSync(this._scriptPath)}catch{W=this._scriptPath}Y=h0.resolve(h0.dirname(W),Y)}if(Y){let W=J(Y,Q);if(!W&&!$._executableFile&&this._scriptPath){let q=h0.basename(this._scriptPath,h0.extname(this._scriptPath));if(q!==this._name)W=J(Y,`${q}-${$._name}`)}Q=W||Q}X=z.includes(h0.extname(Q));let U;if(l.platform!=="win32")if(X)Z.unshift(Q),Z=iZ(l.execArgv).concat(Z),U=x6.spawn(l.argv[0],Z,{stdio:"inherit"});else U=x6.spawn(Q,Z,{stdio:"inherit"});else this._checkForMissingExecutable(Q,Y,$._name),Z.unshift(Q),Z=iZ(l.execArgv).concat(Z),U=x6.spawn(l.execPath,Z,{stdio:"inherit"});if(!U.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((q)=>{l.on(q,()=>{if(U.killed===!1&&U.exitCode===null)U.kill(q)})});let G=this._exitCallback;U.on("close",(W)=>{if(W=W??1,!G)l.exit(W);else G(new k6(W,"commander.executeSubCommandAsync","(close)"))}),U.on("error",(W)=>{if(W.code==="ENOENT")this._checkForMissingExecutable(Q,Y,$._name);else if(W.code==="EACCES")throw Error(`'${Q}' not executable`);if(!G)l.exit(1);else{let q=new k6(1,"commander.executeSubCommandAsync","(error)");q.nestedError=W,G(q)}}),this.runningCommand=U}_dispatchSubcommand($,Z,X){let z=this._findCommand($);if(!z)this.help({error:!0});z._prepareForParse();let J;return J=this._chainOrCallSubCommandHook(J,z,"preSubcommand"),J=this._chainOrCall(J,()=>{if(z._executableHandler)this._executeSubCommand(z,Z.concat(X));else return z._parseCommand(Z,X)}),J}_dispatchHelpCommand($){if(!$)this.help();let Z=this._findCommand($);if(Z&&!Z._executableHandler)Z.help();return this._dispatchSubcommand($,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach(($,Z)=>{if($.required&&this.args[Z]==null)this.missingArgument($.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let $=(X,z,J)=>{let Q=z;if(z!==null&&X.parseArg){let Y=`error: command-argument value '${z}' is invalid for argument '${X.name()}'.`;Q=this._callParseArg(X,z,J,Y)}return Q};this._checkNumberOfArguments();let Z=[];this.registeredArguments.forEach((X,z)=>{let J=X.defaultValue;if(X.variadic){if(z<this.args.length){if(J=this.args.slice(z),X.parseArg)J=J.reduce((Q,Y)=>{return $(X,Y,Q)},X.defaultValue)}else if(J===void 0)J=[]}else if(z<this.args.length){if(J=this.args[z],X.parseArg)J=$(X,J,X.defaultValue)}Z[z]=J}),this.processedArgs=Z}_chainOrCall($,Z){if($?.then&&typeof $.then==="function")return $.then(()=>Z());return Z()}_chainOrCallHooks($,Z){let X=$,z=[];if(this._getCommandAndAncestors().reverse().filter((J)=>J._lifeCycleHooks[Z]!==void 0).forEach((J)=>{J._lifeCycleHooks[Z].forEach((Q)=>{z.push({hookedCommand:J,callback:Q})})}),Z==="postAction")z.reverse();return z.forEach((J)=>{X=this._chainOrCall(X,()=>{return J.callback(J.hookedCommand,this)})}),X}_chainOrCallSubCommandHook($,Z,X){let z=$;if(this._lifeCycleHooks[X]!==void 0)this._lifeCycleHooks[X].forEach((J)=>{z=this._chainOrCall(z,()=>{return J(this,Z)})});return z}_parseCommand($,Z){let X=this.parseOptions(Z);if(this._parseOptionsEnv(),this._parseOptionsImplied(),$=$.concat(X.operands),Z=X.unknown,this.args=$.concat(Z),$&&this._findCommand($[0]))return this._dispatchSubcommand($[0],$.slice(1),Z);if(this._getHelpCommand()&&$[0]===this._getHelpCommand().name())return this._dispatchHelpCommand($[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(Z),this._dispatchSubcommand(this._defaultCommandName,$,Z);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(X.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let z=()=>{if(X.unknown.length>0)this.unknownOption(X.unknown[0])},J=`command:${this.name()}`;if(this._actionHandler){z(),this._processArguments();let Q;if(Q=this._chainOrCallHooks(Q,"preAction"),Q=this._chainOrCall(Q,()=>this._actionHandler(this.processedArgs)),this.parent)Q=this._chainOrCall(Q,()=>{this.parent.emit(J,$,Z)});return Q=this._chainOrCallHooks(Q,"postAction"),Q}if(this.parent?.listenerCount(J))z(),this._processArguments(),this.parent.emit(J,$,Z);else if($.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",$,Z);if(this.listenerCount("command:*"))this.emit("command:*",$,Z);else if(this.commands.length)this.unknownCommand();else z(),this._processArguments()}else if(this.commands.length)z(),this.help({error:!0});else z(),this._processArguments()}_findCommand($){if(!$)return;return this.commands.find((Z)=>Z._name===$||Z._aliases.includes($))}_findOption($){return this.options.find((Z)=>Z.is($))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(($)=>{$.options.forEach((Z)=>{if(Z.mandatory&&$.getOptionValue(Z.attributeName())===void 0)$.missingMandatoryOptionValue(Z)})})}_checkForConflictingLocalOptions(){let $=this.options.filter((X)=>{let z=X.attributeName();if(this.getOptionValue(z)===void 0)return!1;return this.getOptionValueSource(z)!=="default"});$.filter((X)=>X.conflictsWith.length>0).forEach((X)=>{let z=$.find((J)=>X.conflictsWith.includes(J.attributeName()));if(z)this._conflictingOption(X,z)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(($)=>{$._checkForConflictingLocalOptions()})}parseOptions($){let Z=[],X=[],z=Z;function J(W){return W.length>1&&W[0]==="-"}let Q=(W)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(W))return!1;return!this._getCommandAndAncestors().some((q)=>q.options.map((V)=>V.short).some((V)=>/^-\d$/.test(V)))},Y=null,U=null,G=0;while(G<$.length||U){let W=U??$[G++];if(U=null,W==="--"){if(z===X)z.push(W);z.push(...$.slice(G));break}if(Y&&(!J(W)||Q(W))){this.emit(`option:${Y.name()}`,W);continue}if(Y=null,J(W)){let q=this._findOption(W);if(q){if(q.required){let V=$[G++];if(V===void 0)this.optionMissingArgument(q);this.emit(`option:${q.name()}`,V)}else if(q.optional){let V=null;if(G<$.length&&(!J($[G])||Q($[G])))V=$[G++];this.emit(`option:${q.name()}`,V)}else this.emit(`option:${q.name()}`);Y=q.variadic?q:null;continue}}if(W.length>2&&W[0]==="-"&&W[1]!=="-"){let q=this._findOption(`-${W[1]}`);if(q){if(q.required||q.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${q.name()}`,W.slice(2));else this.emit(`option:${q.name()}`),U=`-${W.slice(2)}`;continue}}if(/^--[^=]+=/.test(W)){let q=W.indexOf("="),V=this._findOption(W.slice(0,q));if(V&&(V.required||V.optional)){this.emit(`option:${V.name()}`,W.slice(q+1));continue}}if(z===Z&&J(W)&&!(this.commands.length===0&&Q(W)))z=X;if((this._enablePositionalOptions||this._passThroughOptions)&&Z.length===0&&X.length===0){if(this._findCommand(W)){Z.push(W),X.push(...$.slice(G));break}else if(this._getHelpCommand()&&W===this._getHelpCommand().name()){Z.push(W,...$.slice(G));break}else if(this._defaultCommandName){X.push(W,...$.slice(G));break}}if(this._passThroughOptions){z.push(W,...$.slice(G));break}z.push(W)}return{operands:Z,unknown:X}}opts(){if(this._storeOptionsAsProperties){let $={},Z=this.options.length;for(let X=0;X<Z;X++){let z=this.options[X].attributeName();$[z]=z===this._versionOptionName?this._version:this[z]}return $}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(($,Z)=>Object.assign($,Z.opts()),{})}error($,Z){if(this._outputConfiguration.outputError(`${$}
21
+ - ${z}`;throw Error(J)}_executeSubCommand($,Z){Z=Z.slice();let X=!1,z=[".js",".ts",".tsx",".mjs",".cjs"];function J(W,q){let V=m0.resolve(W,q);if(e4.existsSync(V))return V;if(z.includes(m0.extname(q)))return;let K=z.find((B)=>e4.existsSync(`${V}${B}`));if(K)return`${V}${K}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Q=$._executableFile||`${this._name}-${$._name}`,Y=this._executableDir||"";if(this._scriptPath){let W;try{W=e4.realpathSync(this._scriptPath)}catch{W=this._scriptPath}Y=m0.resolve(m0.dirname(W),Y)}if(Y){let W=J(Y,Q);if(!W&&!$._executableFile&&this._scriptPath){let q=m0.basename(this._scriptPath,m0.extname(this._scriptPath));if(q!==this._name)W=J(Y,`${q}-${$._name}`)}Q=W||Q}X=z.includes(m0.extname(Q));let U;if(l.platform!=="win32")if(X)Z.unshift(Q),Z=aZ(l.execArgv).concat(Z),U=g6.spawn(l.argv[0],Z,{stdio:"inherit"});else U=g6.spawn(Q,Z,{stdio:"inherit"});else this._checkForMissingExecutable(Q,Y,$._name),Z.unshift(Q),Z=aZ(l.execArgv).concat(Z),U=g6.spawn(l.execPath,Z,{stdio:"inherit"});if(!U.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((q)=>{l.on(q,()=>{if(U.killed===!1&&U.exitCode===null)U.kill(q)})});let G=this._exitCallback;U.on("close",(W)=>{if(W=W??1,!G)l.exit(W);else G(new v6(W,"commander.executeSubCommandAsync","(close)"))}),U.on("error",(W)=>{if(W.code==="ENOENT")this._checkForMissingExecutable(Q,Y,$._name);else if(W.code==="EACCES")throw Error(`'${Q}' not executable`);if(!G)l.exit(1);else{let q=new v6(1,"commander.executeSubCommandAsync","(error)");q.nestedError=W,G(q)}}),this.runningCommand=U}_dispatchSubcommand($,Z,X){let z=this._findCommand($);if(!z)this.help({error:!0});z._prepareForParse();let J;return J=this._chainOrCallSubCommandHook(J,z,"preSubcommand"),J=this._chainOrCall(J,()=>{if(z._executableHandler)this._executeSubCommand(z,Z.concat(X));else return z._parseCommand(Z,X)}),J}_dispatchHelpCommand($){if(!$)this.help();let Z=this._findCommand($);if(Z&&!Z._executableHandler)Z.help();return this._dispatchSubcommand($,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach(($,Z)=>{if($.required&&this.args[Z]==null)this.missingArgument($.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let $=(X,z,J)=>{let Q=z;if(z!==null&&X.parseArg){let Y=`error: command-argument value '${z}' is invalid for argument '${X.name()}'.`;Q=this._callParseArg(X,z,J,Y)}return Q};this._checkNumberOfArguments();let Z=[];this.registeredArguments.forEach((X,z)=>{let J=X.defaultValue;if(X.variadic){if(z<this.args.length){if(J=this.args.slice(z),X.parseArg)J=J.reduce((Q,Y)=>{return $(X,Y,Q)},X.defaultValue)}else if(J===void 0)J=[]}else if(z<this.args.length){if(J=this.args[z],X.parseArg)J=$(X,J,X.defaultValue)}Z[z]=J}),this.processedArgs=Z}_chainOrCall($,Z){if($?.then&&typeof $.then==="function")return $.then(()=>Z());return Z()}_chainOrCallHooks($,Z){let X=$,z=[];if(this._getCommandAndAncestors().reverse().filter((J)=>J._lifeCycleHooks[Z]!==void 0).forEach((J)=>{J._lifeCycleHooks[Z].forEach((Q)=>{z.push({hookedCommand:J,callback:Q})})}),Z==="postAction")z.reverse();return z.forEach((J)=>{X=this._chainOrCall(X,()=>{return J.callback(J.hookedCommand,this)})}),X}_chainOrCallSubCommandHook($,Z,X){let z=$;if(this._lifeCycleHooks[X]!==void 0)this._lifeCycleHooks[X].forEach((J)=>{z=this._chainOrCall(z,()=>{return J(this,Z)})});return z}_parseCommand($,Z){let X=this.parseOptions(Z);if(this._parseOptionsEnv(),this._parseOptionsImplied(),$=$.concat(X.operands),Z=X.unknown,this.args=$.concat(Z),$&&this._findCommand($[0]))return this._dispatchSubcommand($[0],$.slice(1),Z);if(this._getHelpCommand()&&$[0]===this._getHelpCommand().name())return this._dispatchHelpCommand($[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(Z),this._dispatchSubcommand(this._defaultCommandName,$,Z);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(X.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let z=()=>{if(X.unknown.length>0)this.unknownOption(X.unknown[0])},J=`command:${this.name()}`;if(this._actionHandler){z(),this._processArguments();let Q;if(Q=this._chainOrCallHooks(Q,"preAction"),Q=this._chainOrCall(Q,()=>this._actionHandler(this.processedArgs)),this.parent)Q=this._chainOrCall(Q,()=>{this.parent.emit(J,$,Z)});return Q=this._chainOrCallHooks(Q,"postAction"),Q}if(this.parent?.listenerCount(J))z(),this._processArguments(),this.parent.emit(J,$,Z);else if($.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",$,Z);if(this.listenerCount("command:*"))this.emit("command:*",$,Z);else if(this.commands.length)this.unknownCommand();else z(),this._processArguments()}else if(this.commands.length)z(),this.help({error:!0});else z(),this._processArguments()}_findCommand($){if(!$)return;return this.commands.find((Z)=>Z._name===$||Z._aliases.includes($))}_findOption($){return this.options.find((Z)=>Z.is($))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(($)=>{$.options.forEach((Z)=>{if(Z.mandatory&&$.getOptionValue(Z.attributeName())===void 0)$.missingMandatoryOptionValue(Z)})})}_checkForConflictingLocalOptions(){let $=this.options.filter((X)=>{let z=X.attributeName();if(this.getOptionValue(z)===void 0)return!1;return this.getOptionValueSource(z)!=="default"});$.filter((X)=>X.conflictsWith.length>0).forEach((X)=>{let z=$.find((J)=>X.conflictsWith.includes(J.attributeName()));if(z)this._conflictingOption(X,z)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(($)=>{$._checkForConflictingLocalOptions()})}parseOptions($){let Z=[],X=[],z=Z;function J(W){return W.length>1&&W[0]==="-"}let Q=(W)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(W))return!1;return!this._getCommandAndAncestors().some((q)=>q.options.map((V)=>V.short).some((V)=>/^-\d$/.test(V)))},Y=null,U=null,G=0;while(G<$.length||U){let W=U??$[G++];if(U=null,W==="--"){if(z===X)z.push(W);z.push(...$.slice(G));break}if(Y&&(!J(W)||Q(W))){this.emit(`option:${Y.name()}`,W);continue}if(Y=null,J(W)){let q=this._findOption(W);if(q){if(q.required){let V=$[G++];if(V===void 0)this.optionMissingArgument(q);this.emit(`option:${q.name()}`,V)}else if(q.optional){let V=null;if(G<$.length&&(!J($[G])||Q($[G])))V=$[G++];this.emit(`option:${q.name()}`,V)}else this.emit(`option:${q.name()}`);Y=q.variadic?q:null;continue}}if(W.length>2&&W[0]==="-"&&W[1]!=="-"){let q=this._findOption(`-${W[1]}`);if(q){if(q.required||q.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${q.name()}`,W.slice(2));else this.emit(`option:${q.name()}`),U=`-${W.slice(2)}`;continue}}if(/^--[^=]+=/.test(W)){let q=W.indexOf("="),V=this._findOption(W.slice(0,q));if(V&&(V.required||V.optional)){this.emit(`option:${V.name()}`,W.slice(q+1));continue}}if(z===Z&&J(W)&&!(this.commands.length===0&&Q(W)))z=X;if((this._enablePositionalOptions||this._passThroughOptions)&&Z.length===0&&X.length===0){if(this._findCommand(W)){Z.push(W),X.push(...$.slice(G));break}else if(this._getHelpCommand()&&W===this._getHelpCommand().name()){Z.push(W,...$.slice(G));break}else if(this._defaultCommandName){X.push(W,...$.slice(G));break}}if(this._passThroughOptions){z.push(W,...$.slice(G));break}z.push(W)}return{operands:Z,unknown:X}}opts(){if(this._storeOptionsAsProperties){let $={},Z=this.options.length;for(let X=0;X<Z;X++){let z=this.options[X].attributeName();$[z]=z===this._versionOptionName?this._version:this[z]}return $}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(($,Z)=>Object.assign($,Z.opts()),{})}error($,Z){if(this._outputConfiguration.outputError(`${$}
22
22
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
23
23
  `);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
24
- `),this.outputHelp({error:!0});let X=Z||{},z=X.exitCode||1,J=X.code||"commander.error";this._exit(z,J,$)}_parseOptionsEnv(){this.options.forEach(($)=>{if($.envVar&&$.envVar in l.env){let Z=$.attributeName();if(this.getOptionValue(Z)===void 0||["default","config","env"].includes(this.getOptionValueSource(Z)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,l.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new xJ(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(),U=this.getOptionValue(Y),G=this.options.find((q)=>q.negate&&Y===q.attributeName()),W=this.options.find((q)=>!q.negate&&Y===q.attributeName());if(G&&(G.presetArg===void 0&&U===!1||G.presetArg!==void 0&&U===G.presetArg))return G;return W||Q},z=(Q)=>{let Y=X(Q),U=Y.attributeName();if(this.getOptionValueSource(U)==="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=lZ($,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=lZ($,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 jJ(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=h0.basename($,h0.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(l.exitCode??0);if(Z===0&&$&&typeof $!=="function"&&$.error)Z=1;this._exit(Z,"commander.help","(outputHelp)")}addHelpText($,Z){let X=["beforeAll","before","after","afterAll"];if(!X.includes($))throw Error(`Unexpected value for position to addHelpText.
24
+ `),this.outputHelp({error:!0});let X=Z||{},z=X.exitCode||1,J=X.code||"commander.error";this._exit(z,J,$)}_parseOptionsEnv(){this.options.forEach(($)=>{if($.envVar&&$.envVar in l.env){let Z=$.attributeName();if(this.getOptionValue(Z)===void 0||["default","config","env"].includes(this.getOptionValueSource(Z)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,l.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new mJ(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(),U=this.getOptionValue(Y),G=this.options.find((q)=>q.negate&&Y===q.attributeName()),W=this.options.find((q)=>!q.negate&&Y===q.attributeName());if(G&&(G.presetArg===void 0&&U===!1||G.presetArg!==void 0&&U===G.presetArg))return G;return W||Q},z=(Q)=>{let Y=X(Q),U=Y.attributeName();if(this.getOptionValueSource(U)==="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=sZ($,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=sZ($,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 vJ(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=m0.basename($,m0.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(l.exitCode??0);if(Z===0&&$&&typeof $!=="function"&&$.error)Z=1;this._exit(Z,"commander.help","(outputHelp)")}addHelpText($,Z){let X=["beforeAll","before","after","afterAll"];if(!X.includes($))throw Error(`Unexpected value for position to addHelpText.
26
26
  Expecting one of '${X.join("', '")}'`);let z=`${$}Help`;return this.on(z,(J)=>{let Q;if(typeof Z==="function")Q=Z({error:J.error,command:J.command});else Q=Z;if(Q)J.write(`${Q}
27
- `)}),this}_outputHelpIfRequested($){let Z=this._getHelpOption();if(Z&&$.find((z)=>Z.is(z)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function iZ($){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 y6(){if(l.env.NO_COLOR||l.env.FORCE_COLOR==="0"||l.env.FORCE_COLOR==="false")return!1;if(l.env.FORCE_COLOR||l.env.CLICOLOR_FORCE!==void 0)return!0;return}kJ.Command=f6;kJ.useColor=y6});var oZ=R((vJ)=>{var{Argument:rZ}=n4(),{Command:g6}=nZ(),{CommanderError:gJ,InvalidArgumentError:sZ}=P1(),{Help:hJ}=S6(),{Option:aZ}=b6();vJ.program=new g6;vJ.createCommand=($)=>new g6($);vJ.createOption=($,Z)=>new aZ($,Z);vJ.createArgument=($,Z)=>new rZ($,Z);vJ.Command=g6;vJ.Option=aZ;vJ.Argument=rZ;vJ.Help=hJ;vJ.CommanderError=gJ;vJ.InvalidArgumentError=sZ;vJ.InvalidOptionArgumentError=sZ});var c=R((JQ)=>{var h6=Symbol.for("yaml.alias"),$5=Symbol.for("yaml.document"),s4=Symbol.for("yaml.map"),Z5=Symbol.for("yaml.pair"),v6=Symbol.for("yaml.scalar"),a4=Symbol.for("yaml.seq"),v0=Symbol.for("yaml.node.type"),oJ=($)=>!!$&&typeof $==="object"&&$[v0]===h6,tJ=($)=>!!$&&typeof $==="object"&&$[v0]===$5,eJ=($)=>!!$&&typeof $==="object"&&$[v0]===s4,$Q=($)=>!!$&&typeof $==="object"&&$[v0]===Z5,X5=($)=>!!$&&typeof $==="object"&&$[v0]===v6,ZQ=($)=>!!$&&typeof $==="object"&&$[v0]===a4;function z5($){if($&&typeof $==="object")switch($[v0]){case s4:case a4:return!0}return!1}function XQ($){if($&&typeof $==="object")switch($[v0]){case h6:case s4:case v6:case a4:return!0}return!1}var zQ=($)=>(X5($)||z5($))&&!!$.anchor;JQ.ALIAS=h6;JQ.DOC=$5;JQ.MAP=s4;JQ.NODE_TYPE=v0;JQ.PAIR=Z5;JQ.SCALAR=v6;JQ.SEQ=a4;JQ.hasAnchor=zQ;JQ.isAlias=oJ;JQ.isCollection=z5;JQ.isDocument=tJ;JQ.isMap=eJ;JQ.isNode=XQ;JQ.isPair=$Q;JQ.isScalar=X5;JQ.isSeq=ZQ});var _1=R((IQ)=>{var Q0=c(),N0=Symbol("break visit"),J5=Symbol("skip children"),f0=Symbol("remove node");function o4($,Z){let X=Q5(Z);if(Q0.isDocument($)){if(y$(null,$.contents,X,Object.freeze([$]))===f0)$.contents=null}else y$(null,$,X,Object.freeze([]))}o4.BREAK=N0;o4.SKIP=J5;o4.REMOVE=f0;function y$($,Z,X,z){let J=Y5($,Z,X,z);if(Q0.isNode(J)||Q0.isPair(J))return U5($,z,J),y$($,J,X,z);if(typeof J!=="symbol"){if(Q0.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let Q=0;Q<Z.items.length;++Q){let Y=y$(Q,Z.items[Q],X,z);if(typeof Y==="number")Q=Y-1;else if(Y===N0)return N0;else if(Y===f0)Z.items.splice(Q,1),Q-=1}}else if(Q0.isPair(Z)){z=Object.freeze(z.concat(Z));let Q=y$("key",Z.key,X,z);if(Q===N0)return N0;else if(Q===f0)Z.key=null;let Y=y$("value",Z.value,X,z);if(Y===N0)return N0;else if(Y===f0)Z.value=null}}return J}async function t4($,Z){let X=Q5(Z);if(Q0.isDocument($)){if(await f$(null,$.contents,X,Object.freeze([$]))===f0)$.contents=null}else await f$(null,$,X,Object.freeze([]))}t4.BREAK=N0;t4.SKIP=J5;t4.REMOVE=f0;async function f$($,Z,X,z){let J=await Y5($,Z,X,z);if(Q0.isNode(J)||Q0.isPair(J))return U5($,z,J),f$($,J,X,z);if(typeof J!=="symbol"){if(Q0.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let Q=0;Q<Z.items.length;++Q){let Y=await f$(Q,Z.items[Q],X,z);if(typeof Y==="number")Q=Y-1;else if(Y===N0)return N0;else if(Y===f0)Z.items.splice(Q,1),Q-=1}}else if(Q0.isPair(Z)){z=Object.freeze(z.concat(Z));let Q=await f$("key",Z.key,X,z);if(Q===N0)return N0;else if(Q===f0)Z.key=null;let Y=await f$("value",Z.value,X,z);if(Y===N0)return N0;else if(Y===f0)Z.value=null}}return J}function Q5($){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 Y5($,Z,X,z){if(typeof X==="function")return X($,Z,z);if(Q0.isMap(Z))return X.Map?.($,Z,z);if(Q0.isSeq(Z))return X.Seq?.($,Z,z);if(Q0.isPair(Z))return X.Pair?.($,Z,z);if(Q0.isScalar(Z))return X.Scalar?.($,Z,z);if(Q0.isAlias(Z))return X.Alias?.($,Z,z);return}function U5($,Z,X){let z=Z[Z.length-1];if(Q0.isCollection(z))z.items[$]=X;else if(Q0.isPair(z))if($==="key")z.key=X;else z.value=X;else if(Q0.isDocument(z))z.contents=X;else{let J=Q0.isAlias(z)?"alias":"scalar";throw Error(`Cannot replace node with ${J} parent`)}}IQ.visit=o4;IQ.visitAsync=t4});var u6=R((_Q)=>{var G5=c(),FQ=_1(),wQ={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},PQ=($)=>$.replace(/[!,[\]{}]/g,(Z)=>wQ[Z]);class w0{constructor($,Z){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},w0.defaultYaml,$),this.tags=Object.assign({},w0.defaultTags,Z)}clone(){let $=new w0(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new w0(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:w0.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},w0.defaultTags);break}return $}add($,Z){if(this.atNextDocument)this.yaml={explicit:w0.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},w0.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+PQ($.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&&G5.isNode($.contents)){let J={};FQ.visit($.contents,(Q,Y)=>{if(G5.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
- `)}}w0.defaultYaml={explicit:!1,version:"1.2"};w0.defaultTags={"!!":"tag:yaml.org,2002:"};_Q.Directives=w0});var e4=R((bQ)=>{var W5=c(),EQ=_1();function jQ($){if(/[\x00-\x19\s,[\]{}]/.test($)){let X=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(X)}return!0}function q5($){let Z=new Set;return EQ.visit($,{Value(X,z){if(z.anchor)Z.add(z.anchor)}}),Z}function V5($,Z){for(let X=1;;++X){let z=`${$}${X}`;if(!Z.has(z))return z}}function SQ($,Z){let X=[],z=new Map,J=null;return{onAnchor:(Q)=>{X.push(Q),J??(J=q5($));let Y=V5(Z,J);return J.add(Y),Y},setAnchors:()=>{for(let Q of X){let Y=z.get(Q);if(typeof Y==="object"&&Y.anchor&&(W5.isScalar(Y.node)||W5.isCollection(Y.node)))Y.node.anchor=Y.anchor;else{let U=Error("Failed to resolve repeated object (this should not happen)");throw U.source=Q,U}}},sourceObjects:z}}bQ.anchorIsValid=jQ;bQ.anchorNames=q5;bQ.createNodeAnchors=SQ;bQ.findNewAnchor=V5});var m6=R((gQ)=>{function C1($,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],U=C1($,z,String(J),Y);if(U===void 0)delete z[J];else if(U!==Y)z[J]=U}else if(z instanceof Map)for(let J of Array.from(z.keys())){let Q=z.get(J),Y=C1($,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=C1($,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=C1($,z,J,Q);if(Y===void 0)delete z[J];else if(Y!==Q)z[J]=Y}return $.call(Z,X,z)}gQ.applyReviver=C1});var a0=R((uQ)=>{var vQ=c();function K5($,Z,X){if(Array.isArray($))return $.map((z,J)=>K5(z,String(J),X));if($&&typeof $.toJSON==="function"){if(!X||!vQ.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 $}uQ.toJS=K5});var $2=R((pQ)=>{var cQ=m6(),H5=c(),dQ=a0();class B5{constructor($){Object.defineProperty(this,H5.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(!H5.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=dQ.toJS(this,"",Q);if(typeof z==="function")for(let{count:U,res:G}of Q.anchors.values())z(G,U);return typeof J==="function"?cQ.applyReviver(J,{"":Y},"",Y):Y}}pQ.NodeBase=B5});var E1=R((aQ)=>{var iQ=e4(),nQ=_1(),g$=c(),rQ=$2(),sQ=a0();class L5 extends rQ.NodeBase{constructor($){super(g$.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=[],nQ.visit($,{Node:(J,Q)=>{if(g$.isAlias(Q)||g$.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 U=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(U)}let Y=X.get(Q);if(!Y)sQ.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=Z2(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(iQ.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 Z2($,Z,X){if(g$.isAlias(Z)){let z=Z.resolve($),J=X&&z&&X.get(z);return J?J.count*J.aliasCount:0}else if(g$.isCollection(Z)){let z=0;for(let J of Z.items){let Q=Z2($,J,X);if(Q>z)z=Q}return z}else if(g$.isPair(Z)){let z=Z2($,Z.key,X),J=Z2($,Z.value,X);return Math.max(z,J)}return 1}aQ.Alias=L5});var Z0=R((XY)=>{var tQ=c(),eQ=$2(),$Y=a0(),ZY=($)=>!$||typeof $!=="function"&&typeof $!=="object";class N$ extends eQ.NodeBase{constructor($){super(tQ.SCALAR);this.value=$}toJSON($,Z){return Z?.keep?this.value:$Y.toJS(this.value,$,Z)}toString(){return String(this.value)}}N$.BLOCK_FOLDED="BLOCK_FOLDED";N$.BLOCK_LITERAL="BLOCK_LITERAL";N$.PLAIN="PLAIN";N$.QUOTE_DOUBLE="QUOTE_DOUBLE";N$.QUOTE_SINGLE="QUOTE_SINGLE";XY.Scalar=N$;XY.isScalarValue=ZY});var j1=R((WY)=>{var QY=E1(),M$=c(),N5=Z0(),YY="tag:yaml.org,2002:";function UY($,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 GY($,Z,X){if(M$.isDocument($))$=$.contents;if(M$.isNode($))return $;if(M$.isPair($)){let V=X.schema[M$.MAP].createNode?.(X.schema,null,X);return V.items.push($),V}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:z,onAnchor:J,onTagObj:Q,schema:Y,sourceObjects:U}=X,G=void 0;if(z&&$&&typeof $==="object")if(G=U.get($),G)return G.anchor??(G.anchor=J($)),new QY.Alias(G.anchor);else G={anchor:null,node:null},U.set($,G);if(Z?.startsWith("!!"))Z=YY+Z.slice(2);let W=UY($,Z,Y.tags);if(!W){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let V=new N5.Scalar($);if(G)G.node=V;return V}W=$ instanceof Map?Y[M$.MAP]:(Symbol.iterator in Object($))?Y[M$.SEQ]:Y[M$.MAP]}if(Q)Q(W),delete X.onTagObj;let q=W?.createNode?W.createNode(X.schema,$,X):typeof W?.nodeClass?.from==="function"?W.nodeClass.from(X.schema,$,X):new N5.Scalar($);if(Z)q.tag=Z;else if(!W.default)q.tag=W.tag;if(G)G.node=q;return q}WY.createNode=GY});var X2=R((HY)=>{var VY=j1(),g0=c(),KY=$2();function c6($,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 VY.createNode(z,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var M5=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class O5 extends KY.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)=>g0.isNode(X)||g0.isPair(X)?X.clone($):X),this.range)Z.range=this.range.slice();return Z}addIn($,Z){if(M5($))this.add(Z);else{let[X,...z]=$,J=this.get(X,!0);if(g0.isCollection(J))J.addIn(z,Z);else if(J===void 0&&this.schema)this.set(X,c6(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(g0.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&&g0.isScalar(J)?J.value:J;else return g0.isCollection(J)?J.getIn(z,Z):void 0}hasAllNullValues($){return this.items.every((Z)=>{if(!g0.isPair(Z))return!1;let X=Z.value;return X==null||$&&g0.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 g0.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(g0.isCollection(J))J.setIn(z,Z);else if(J===void 0&&this.schema)this.set(X,c6(this.schema,z,Z));else throw Error(`Expected YAML collection at ${X}. Remaining path: ${z}`)}}}HY.Collection=O5;HY.collectionFromPath=c6;HY.isEmptyPath=M5});var S1=R((TY)=>{var MY=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function d6($,Z){if(/^\n+$/.test($))return $.substring(1);return Z?$.replace(/^(?! *$)/gm,Z):$}var OY=($,Z,X)=>$.endsWith(`
29
- `)?d6(X,Z):X.includes(`
27
+ `)}),this}_outputHelpIfRequested($){let Z=this._getHelpOption();if(Z&&$.find((z)=>Z.is(z)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function aZ($){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 h6(){if(l.env.NO_COLOR||l.env.FORCE_COLOR==="0"||l.env.FORCE_COLOR==="false")return!1;if(l.env.FORCE_COLOR||l.env.CLICOLOR_FORCE!==void 0)return!0;return}cJ.Command=u6;cJ.useColor=h6});var Z5=F((nJ)=>{var{Argument:tZ}=t4(),{Command:m6}=oZ(),{CommanderError:lJ,InvalidArgumentError:eZ}=S1(),{Help:iJ}=y6(),{Option:$5}=f6();nJ.program=new m6;nJ.createCommand=($)=>new m6($);nJ.createOption=($,Z)=>new $5($,Z);nJ.createArgument=($,Z)=>new tZ($,Z);nJ.Command=m6;nJ.Option=$5;nJ.Argument=tZ;nJ.Help=iJ;nJ.CommanderError=lJ;nJ.InvalidArgumentError=eZ;nJ.InvalidOptionArgumentError=eZ});var d=F((KQ)=>{var c6=Symbol.for("yaml.alias"),J5=Symbol.for("yaml.document"),$2=Symbol.for("yaml.map"),Q5=Symbol.for("yaml.pair"),d6=Symbol.for("yaml.scalar"),Z2=Symbol.for("yaml.seq"),c0=Symbol.for("yaml.node.type"),QQ=($)=>!!$&&typeof $==="object"&&$[c0]===c6,YQ=($)=>!!$&&typeof $==="object"&&$[c0]===J5,UQ=($)=>!!$&&typeof $==="object"&&$[c0]===$2,GQ=($)=>!!$&&typeof $==="object"&&$[c0]===Q5,Y5=($)=>!!$&&typeof $==="object"&&$[c0]===d6,WQ=($)=>!!$&&typeof $==="object"&&$[c0]===Z2;function U5($){if($&&typeof $==="object")switch($[c0]){case $2:case Z2:return!0}return!1}function qQ($){if($&&typeof $==="object")switch($[c0]){case c6:case $2:case d6:case Z2:return!0}return!1}var VQ=($)=>(Y5($)||U5($))&&!!$.anchor;KQ.ALIAS=c6;KQ.DOC=J5;KQ.MAP=$2;KQ.NODE_TYPE=c0;KQ.PAIR=Q5;KQ.SCALAR=d6;KQ.SEQ=Z2;KQ.hasAnchor=VQ;KQ.isAlias=QQ;KQ.isCollection=U5;KQ.isDocument=YQ;KQ.isMap=UQ;KQ.isNode=qQ;KQ.isPair=GQ;KQ.isScalar=Y5;KQ.isSeq=WQ});var b1=F((EQ)=>{var Q0=d(),N0=Symbol("break visit"),G5=Symbol("skip children"),v0=Symbol("remove node");function X2($,Z){let X=W5(Z);if(Q0.isDocument($)){if(v$(null,$.contents,X,Object.freeze([$]))===v0)$.contents=null}else v$(null,$,X,Object.freeze([]))}X2.BREAK=N0;X2.SKIP=G5;X2.REMOVE=v0;function v$($,Z,X,z){let J=q5($,Z,X,z);if(Q0.isNode(J)||Q0.isPair(J))return V5($,z,J),v$($,J,X,z);if(typeof J!=="symbol"){if(Q0.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let Q=0;Q<Z.items.length;++Q){let Y=v$(Q,Z.items[Q],X,z);if(typeof Y==="number")Q=Y-1;else if(Y===N0)return N0;else if(Y===v0)Z.items.splice(Q,1),Q-=1}}else if(Q0.isPair(Z)){z=Object.freeze(z.concat(Z));let Q=v$("key",Z.key,X,z);if(Q===N0)return N0;else if(Q===v0)Z.key=null;let Y=v$("value",Z.value,X,z);if(Y===N0)return N0;else if(Y===v0)Z.value=null}}return J}async function z2($,Z){let X=W5(Z);if(Q0.isDocument($)){if(await h$(null,$.contents,X,Object.freeze([$]))===v0)$.contents=null}else await h$(null,$,X,Object.freeze([]))}z2.BREAK=N0;z2.SKIP=G5;z2.REMOVE=v0;async function h$($,Z,X,z){let J=await q5($,Z,X,z);if(Q0.isNode(J)||Q0.isPair(J))return V5($,z,J),h$($,J,X,z);if(typeof J!=="symbol"){if(Q0.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let Q=0;Q<Z.items.length;++Q){let Y=await h$(Q,Z.items[Q],X,z);if(typeof Y==="number")Q=Y-1;else if(Y===N0)return N0;else if(Y===v0)Z.items.splice(Q,1),Q-=1}}else if(Q0.isPair(Z)){z=Object.freeze(z.concat(Z));let Q=await h$("key",Z.key,X,z);if(Q===N0)return N0;else if(Q===v0)Z.key=null;let Y=await h$("value",Z.value,X,z);if(Y===N0)return N0;else if(Y===v0)Z.value=null}}return J}function W5($){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 q5($,Z,X,z){if(typeof X==="function")return X($,Z,z);if(Q0.isMap(Z))return X.Map?.($,Z,z);if(Q0.isSeq(Z))return X.Seq?.($,Z,z);if(Q0.isPair(Z))return X.Pair?.($,Z,z);if(Q0.isScalar(Z))return X.Scalar?.($,Z,z);if(Q0.isAlias(Z))return X.Alias?.($,Z,z);return}function V5($,Z,X){let z=Z[Z.length-1];if(Q0.isCollection(z))z.items[$]=X;else if(Q0.isPair(z))if($==="key")z.key=X;else z.value=X;else if(Q0.isDocument(z))z.contents=X;else{let J=Q0.isAlias(z)?"alias":"scalar";throw Error(`Cannot replace node with ${J} parent`)}}EQ.visit=X2;EQ.visitAsync=z2});var p6=F((yQ)=>{var K5=d(),bQ=b1(),xQ={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},kQ=($)=>$.replace(/[!,[\]{}]/g,(Z)=>xQ[Z]);class _0{constructor($,Z){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},_0.defaultYaml,$),this.tags=Object.assign({},_0.defaultTags,Z)}clone(){let $=new _0(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new _0(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:_0.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},_0.defaultTags);break}return $}add($,Z){if(this.atNextDocument)this.yaml={explicit:_0.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},_0.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+kQ($.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&&K5.isNode($.contents)){let J={};bQ.visit($.contents,(Q,Y)=>{if(K5.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
+ `)}}_0.defaultYaml={explicit:!1,version:"1.2"};_0.defaultTags={"!!":"tag:yaml.org,2002:"};yQ.Directives=_0});var J2=F((uQ)=>{var H5=d(),gQ=b1();function vQ($){if(/[\x00-\x19\s,[\]{}]/.test($)){let X=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(X)}return!0}function B5($){let Z=new Set;return gQ.visit($,{Value(X,z){if(z.anchor)Z.add(z.anchor)}}),Z}function L5($,Z){for(let X=1;;++X){let z=`${$}${X}`;if(!Z.has(z))return z}}function hQ($,Z){let X=[],z=new Map,J=null;return{onAnchor:(Q)=>{X.push(Q),J??(J=B5($));let Y=L5(Z,J);return J.add(Y),Y},setAnchors:()=>{for(let Q of X){let Y=z.get(Q);if(typeof Y==="object"&&Y.anchor&&(H5.isScalar(Y.node)||H5.isCollection(Y.node)))Y.node.anchor=Y.anchor;else{let U=Error("Failed to resolve repeated object (this should not happen)");throw U.source=Q,U}}},sourceObjects:z}}uQ.anchorIsValid=vQ;uQ.anchorNames=B5;uQ.createNodeAnchors=hQ;uQ.findNewAnchor=L5});var l6=F((lQ)=>{function x1($,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],U=x1($,z,String(J),Y);if(U===void 0)delete z[J];else if(U!==Y)z[J]=U}else if(z instanceof Map)for(let J of Array.from(z.keys())){let Q=z.get(J),Y=x1($,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=x1($,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=x1($,z,J,Q);if(Y===void 0)delete z[J];else if(Y!==Q)z[J]=Y}return $.call(Z,X,z)}lQ.applyReviver=x1});var $$=F((rQ)=>{var nQ=d();function N5($,Z,X){if(Array.isArray($))return $.map((z,J)=>N5(z,String(J),X));if($&&typeof $.toJSON==="function"){if(!X||!nQ.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 $}rQ.toJS=N5});var Q2=F((tQ)=>{var aQ=l6(),M5=d(),oQ=$$();class O5{constructor($){Object.defineProperty(this,M5.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(!M5.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=oQ.toJS(this,"",Q);if(typeof z==="function")for(let{count:U,res:G}of Q.anchors.values())z(G,U);return typeof J==="function"?aQ.applyReviver(J,{"":Y},"",Y):Y}}tQ.NodeBase=O5});var k1=F((JY)=>{var $Y=J2(),ZY=b1(),u$=d(),XY=Q2(),zY=$$();class T5 extends XY.NodeBase{constructor($){super(u$.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=[],ZY.visit($,{Node:(J,Q)=>{if(u$.isAlias(Q)||u$.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 U=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(U)}let Y=X.get(Q);if(!Y)zY.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($Y.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(u$.isAlias(Z)){let z=Z.resolve($),J=X&&z&&X.get(z);return J?J.count*J.aliasCount:0}else if(u$.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(u$.isPair(Z)){let z=Y2($,Z.key,X),J=Y2($,Z.value,X);return Math.max(z,J)}return 1}JY.Alias=T5});var Z0=F((qY)=>{var YY=d(),UY=Q2(),GY=$$(),WY=($)=>!$||typeof $!=="function"&&typeof $!=="object";class T$ extends UY.NodeBase{constructor($){super(YY.SCALAR);this.value=$}toJSON($,Z){return Z?.keep?this.value:GY.toJS(this.value,$,Z)}toString(){return String(this.value)}}T$.BLOCK_FOLDED="BLOCK_FOLDED";T$.BLOCK_LITERAL="BLOCK_LITERAL";T$.PLAIN="PLAIN";T$.QUOTE_DOUBLE="QUOTE_DOUBLE";T$.QUOTE_SINGLE="QUOTE_SINGLE";qY.Scalar=T$;qY.isScalarValue=WY});var y1=F((MY)=>{var HY=k1(),D$=d(),D5=Z0(),BY="tag:yaml.org,2002:";function LY($,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 NY($,Z,X){if(D$.isDocument($))$=$.contents;if(D$.isNode($))return $;if(D$.isPair($)){let V=X.schema[D$.MAP].createNode?.(X.schema,null,X);return V.items.push($),V}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:z,onAnchor:J,onTagObj:Q,schema:Y,sourceObjects:U}=X,G=void 0;if(z&&$&&typeof $==="object")if(G=U.get($),G)return G.anchor??(G.anchor=J($)),new HY.Alias(G.anchor);else G={anchor:null,node:null},U.set($,G);if(Z?.startsWith("!!"))Z=BY+Z.slice(2);let W=LY($,Z,Y.tags);if(!W){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let V=new D5.Scalar($);if(G)G.node=V;return V}W=$ instanceof Map?Y[D$.MAP]:(Symbol.iterator in Object($))?Y[D$.SEQ]:Y[D$.MAP]}if(Q)Q(W),delete X.onTagObj;let q=W?.createNode?W.createNode(X.schema,$,X):typeof W?.nodeClass?.from==="function"?W.nodeClass.from(X.schema,$,X):new D5.Scalar($);if(Z)q.tag=Z;else if(!W.default)q.tag=W.tag;if(G)G.node=q;return q}MY.createNode=NY});var U2=F((IY)=>{var TY=y1(),h0=d(),DY=Q2();function i6($,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 TY.createNode(z,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var I5=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class A5 extends DY.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)=>h0.isNode(X)||h0.isPair(X)?X.clone($):X),this.range)Z.range=this.range.slice();return Z}addIn($,Z){if(I5($))this.add(Z);else{let[X,...z]=$,J=this.get(X,!0);if(h0.isCollection(J))J.addIn(z,Z);else if(J===void 0&&this.schema)this.set(X,i6(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(h0.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&&h0.isScalar(J)?J.value:J;else return h0.isCollection(J)?J.getIn(z,Z):void 0}hasAllNullValues($){return this.items.every((Z)=>{if(!h0.isPair(Z))return!1;let X=Z.value;return X==null||$&&h0.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 h0.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(h0.isCollection(J))J.setIn(z,Z);else if(J===void 0&&this.schema)this.set(X,i6(this.schema,z,Z));else throw Error(`Expected YAML collection at ${X}. Remaining path: ${z}`)}}}IY.Collection=A5;IY.collectionFromPath=i6;IY.isEmptyPath=I5});var f1=F((_Y)=>{var wY=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function n6($,Z){if(/^\n+$/.test($))return $.substring(1);return Z?$.replace(/^(?! *$)/gm,Z):$}var PY=($,Z,X)=>$.endsWith(`
29
+ `)?n6(X,Z):X.includes(`
30
30
  `)?`
31
- `+d6(X,Z):($.endsWith(" ")?"":" ")+X;TY.indentComment=d6;TY.lineComment=OY;TY.stringifyComment=MY});var D5=R((FY)=>{function RY($,Z,X="flow",{indentAtStart:z,lineWidth:J=80,minContentWidth:Q=20,onFold:Y,onOverflow:U}={}){if(!J||J<0)return $;if(J<Q)Q=0;let G=Math.max(1+Q,1+J-Z.length);if($.length<=G)return $;let W=[],q={},V=J-Z.length;if(typeof z==="number")if(z>J-Math.max(2,Q))W.push(0);else V=J-z;let K=void 0,H=void 0,T=!1,N=-1,M=-1,P=-1;if(X==="block"){if(N=T5($,N,Z.length),N!==-1)V=N+G}for(let j;j=$[N+=1];){if(X==="quoted"&&j==="\\"){switch(M=N,$[N+1]){case"x":N+=3;break;case"u":N+=5;break;case"U":N+=9;break;default:N+=1}P=N}if(j===`
32
- `){if(X==="block")N=T5($,N,Z.length);V=N+Z.length+G,K=void 0}else{if(j===" "&&H&&H!==" "&&H!==`
33
- `&&H!=="\t"){let x=$[N+1];if(x&&x!==" "&&x!==`
34
- `&&x!=="\t")K=N}if(N>=V)if(K)W.push(K),V=K+G,K=void 0;else if(X==="quoted"){while(H===" "||H==="\t")H=j,j=$[N+=1],T=!0;let x=N>P+1?N-2:M-1;if(q[x])return $;W.push(x),q[x]=!0,V=x+G,K=void 0}else T=!0}H=j}if(T&&U)U();if(W.length===0)return $;if(Y)Y();let _=$.slice(0,W[0]);for(let j=0;j<W.length;++j){let x=W[j],k=W[j+1]||$.length;if(x===0)_=`
31
+ `+n6(X,Z):($.endsWith(" ")?"":" ")+X;_Y.indentComment=n6;_Y.lineComment=PY;_Y.stringifyComment=wY});var F5=F((bY)=>{function SY($,Z,X="flow",{indentAtStart:z,lineWidth:J=80,minContentWidth:Q=20,onFold:Y,onOverflow:U}={}){if(!J||J<0)return $;if(J<Q)Q=0;let G=Math.max(1+Q,1+J-Z.length);if($.length<=G)return $;let W=[],q={},V=J-Z.length;if(typeof z==="number")if(z>J-Math.max(2,Q))W.push(0);else V=J-z;let K=void 0,B=void 0,T=!1,N=-1,M=-1,P=-1;if(X==="block"){if(N=R5($,N,Z.length),N!==-1)V=N+G}for(let j;j=$[N+=1];){if(X==="quoted"&&j==="\\"){switch(M=N,$[N+1]){case"x":N+=3;break;case"u":N+=5;break;case"U":N+=9;break;default:N+=1}P=N}if(j===`
32
+ `){if(X==="block")N=R5($,N,Z.length);V=N+Z.length+G,K=void 0}else{if(j===" "&&B&&B!==" "&&B!==`
33
+ `&&B!=="\t"){let x=$[N+1];if(x&&x!==" "&&x!==`
34
+ `&&x!=="\t")K=N}if(N>=V)if(K)W.push(K),V=K+G,K=void 0;else if(X==="quoted"){while(B===" "||B==="\t")B=j,j=$[N+=1],T=!0;let x=N>P+1?N-2:M-1;if(q[x])return $;W.push(x),q[x]=!0,V=x+G,K=void 0}else T=!0}B=j}if(T&&U)U();if(W.length===0)return $;if(Y)Y();let _=$.slice(0,W[0]);for(let j=0;j<W.length;++j){let x=W[j],k=W[j+1]||$.length;if(x===0)_=`
35
35
  ${Z}${$.slice(0,k)}`;else{if(X==="quoted"&&q[x])_+=`${$[x]}\\`;_+=`
36
- ${Z}${$.slice(x+1,k)}`}}return _}function T5($,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}FY.FOLD_BLOCK="block";FY.FOLD_FLOW="flow";FY.FOLD_QUOTED="quoted";FY.foldFlowLines=RY});var x1=R((bY)=>{var E0=Z0(),o0=D5(),J2=($,Z)=>({indentAtStart:Z?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),Q2=($)=>/^(%|---|\.\.\.)/m.test($);function EY($,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 b1($,Z){let X=JSON.stringify($);if(Z.options.doubleQuotedAsJSON)return X;let{implicitKey:z}=Z,J=Z.options.doubleQuotedMinMultiLineLength,Q=Z.indent||(Q2($)?" ":""),Y="",U=0;for(let G=0,W=X[G];W;W=X[++G]){if(W===" "&&X[G+1]==="\\"&&X[G+2]==="n")Y+=X.slice(U,G)+"\\ ",G+=1,U=G,W="\\";if(W==="\\")switch(X[G+1]){case"u":{Y+=X.slice(U,G);let q=X.substr(G+2,4);switch(q){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(q.substr(0,2)==="00")Y+="\\x"+q.substr(2);else Y+=X.substr(G,6)}G+=5,U=G+1}break;case"n":if(z||X[G+2]==='"'||X.length<J)G+=1;else{Y+=X.slice(U,G)+`
36
+ ${Z}${$.slice(x+1,k)}`}}return _}function R5($,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}bY.FOLD_BLOCK="block";bY.FOLD_FLOW="flow";bY.FOLD_QUOTED="quoted";bY.foldFlowLines=SY});var v1=F((uY)=>{var S0=Z0(),Z$=F5(),W2=($,Z)=>({indentAtStart:Z?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),q2=($)=>/^(%|---|\.\.\.)/m.test($);function gY($,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 g1($,Z){let X=JSON.stringify($);if(Z.options.doubleQuotedAsJSON)return X;let{implicitKey:z}=Z,J=Z.options.doubleQuotedMinMultiLineLength,Q=Z.indent||(q2($)?" ":""),Y="",U=0;for(let G=0,W=X[G];W;W=X[++G]){if(W===" "&&X[G+1]==="\\"&&X[G+2]==="n")Y+=X.slice(U,G)+"\\ ",G+=1,U=G,W="\\";if(W==="\\")switch(X[G+1]){case"u":{Y+=X.slice(U,G);let q=X.substr(G+2,4);switch(q){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(q.substr(0,2)==="00")Y+="\\x"+q.substr(2);else Y+=X.substr(G,6)}G+=5,U=G+1}break;case"n":if(z||X[G+2]==='"'||X.length<J)G+=1;else{Y+=X.slice(U,G)+`
39
39
 
40
40
  `;while(X[G+2]==="\\"&&X[G+3]==="n"&&X[G+4]!=='"')Y+=`
41
- `,G+=2;if(Y+=Q,X[G+2]===" ")Y+="\\";G+=1,U=G+1}break;default:G+=1}}return Y=U?Y+X.slice(U):X,z?Y:o0.foldFlowLines(Y,Q,o0.FOLD_QUOTED,J2(Z,!1))}function p6($,Z){if(Z.options.singleQuote===!1||Z.implicitKey&&$.includes(`
42
- `)||/[ \t]\n|\n[ \t]/.test($))return b1($,Z);let X=Z.indent||(Q2($)?" ":""),z="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
43
- ${X}`)+"'";return Z.implicitKey?z:o0.foldFlowLines(z,X,o0.FOLD_FLOW,J2(Z,!1))}function h$($,Z){let{singleQuote:X}=Z.options,z;if(X===!1)z=b1;else{let J=$.includes('"'),Q=$.includes("'");if(J&&!Q)z=p6;else if(Q&&!J)z=b1;else z=X?p6:b1}return z($,Z)}var l6;try{l6=new RegExp(`(^|(?<!
41
+ `,G+=2;if(Y+=Q,X[G+2]===" ")Y+="\\";G+=1,U=G+1}break;default:G+=1}}return Y=U?Y+X.slice(U):X,z?Y:Z$.foldFlowLines(Y,Q,Z$.FOLD_QUOTED,W2(Z,!1))}function r6($,Z){if(Z.options.singleQuote===!1||Z.implicitKey&&$.includes(`
42
+ `)||/[ \t]\n|\n[ \t]/.test($))return g1($,Z);let X=Z.indent||(q2($)?" ":""),z="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
43
+ ${X}`)+"'";return Z.implicitKey?z:Z$.foldFlowLines(z,X,Z$.FOLD_FLOW,W2(Z,!1))}function m$($,Z){let{singleQuote:X}=Z.options,z;if(X===!1)z=g1;else{let J=$.includes('"'),Q=$.includes("'");if(J&&!Q)z=r6;else if(Q&&!J)z=g1;else z=X?r6:g1}return z($,Z)}var s6;try{s6=new RegExp(`(^|(?<!
44
44
  ))
45
45
  +(?!
46
- |$)`,"g")}catch{l6=/\n+(?!\n|$)/g}function z2({comment:$,type:Z,value:X},z,J,Q){let{blockQuote:Y,commentString:U,lineWidth:G}=z.options;if(!Y||/\n[\t ]+$/.test(X))return h$(X,z);let W=z.indent||(z.forceBlockIndent||Q2(X)?" ":""),q=Y==="literal"?!0:Y==="folded"||Z===E0.Scalar.BLOCK_FOLDED?!1:Z===E0.Scalar.BLOCK_LITERAL?!0:!EY(X,G,W.length);if(!X)return q?`|
46
+ |$)`,"g")}catch{s6=/\n+(?!\n|$)/g}function G2({comment:$,type:Z,value:X},z,J,Q){let{blockQuote:Y,commentString:U,lineWidth:G}=z.options;if(!Y||/\n[\t ]+$/.test(X))return m$(X,z);let W=z.indent||(z.forceBlockIndent||q2(X)?" ":""),q=Y==="literal"?!0:Y==="folded"||Z===S0.Scalar.BLOCK_FOLDED?!1:Z===S0.Scalar.BLOCK_LITERAL?!0:!gY(X,G,W.length);if(!X)return q?`|
47
47
  `:`>
48
48
  `;let V,K;for(K=X.length;K>0;--K){let k=X[K-1];if(k!==`
49
- `&&k!=="\t"&&k!==" ")break}let H=X.substring(K),T=H.indexOf(`
50
- `);if(T===-1)V="-";else if(X===H||T!==H.length-1){if(V="+",Q)Q()}else V="";if(H){if(X=X.slice(0,-H.length),H[H.length-1]===`
51
- `)H=H.slice(0,-1);H=H.replace(l6,`$&${W}`)}let N=!1,M,P=-1;for(M=0;M<X.length;++M){let k=X[M];if(k===" ")N=!0;else if(k===`
49
+ `&&k!=="\t"&&k!==" ")break}let B=X.substring(K),T=B.indexOf(`
50
+ `);if(T===-1)V="-";else if(X===B||T!==B.length-1){if(V="+",Q)Q()}else V="";if(B){if(X=X.slice(0,-B.length),B[B.length-1]===`
51
+ `)B=B.slice(0,-1);B=B.replace(s6,`$&${W}`)}let N=!1,M,P=-1;for(M=0;M<X.length;++M){let k=X[M];if(k===" ")N=!0;else if(k===`
52
52
  `)P=M;else break}let _=X.substring(0,P<M?P+1:M);if(_)X=X.substring(_.length),_=_.replace(/\n+/g,`$&${W}`);let x=(N?W?"2":"1":"")+V;if($){if(x+=" "+U($.replace(/ ?[\r\n]+/g," ")),J)J()}if(!q){let k=X.replace(/\n+/g,`
53
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${W}`),y=!1,p=J2(z,!0);if(Y!=="folded"&&Z!==E0.Scalar.BLOCK_FOLDED)p.onOverflow=()=>{y=!0};let A=o0.foldFlowLines(`${_}${k}${H}`,W,o0.FOLD_BLOCK,p);if(!y)return`>${x}
54
- ${W}${A}`}return X=X.replace(/\n+/g,`$&${W}`),`|${x}
55
- ${W}${_}${X}${H}`}function jY($,Z,X,z){let{type:J,value:Q}=$,{actualString:Y,implicitKey:U,indent:G,indentStep:W,inFlow:q}=Z;if(U&&Q.includes(`
56
- `)||q&&/[[\]{},]/.test(Q))return h$(Q,Z);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(Q))return U||q||!Q.includes(`
57
- `)?h$(Q,Z):z2($,Z,X,z);if(!U&&!q&&J!==E0.Scalar.PLAIN&&Q.includes(`
58
- `))return z2($,Z,X,z);if(Q2(Q)){if(G==="")return Z.forceBlockIndent=!0,z2($,Z,X,z);else if(U&&G===W)return h$(Q,Z)}let V=Q.replace(/\n+/g,`$&
59
- ${G}`);if(Y){let K=(N)=>N.default&&N.tag!=="tag:yaml.org,2002:str"&&N.test?.test(V),{compat:H,tags:T}=Z.doc.schema;if(T.some(K)||H?.some(K))return h$(Q,Z)}return U?V:o0.foldFlowLines(V,G,o0.FOLD_FLOW,J2(Z,!1))}function SY($,Z,X,z){let{implicitKey:J,inFlow:Q}=Z,Y=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:U}=$;if(U!==E0.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(Y.value))U=E0.Scalar.QUOTE_DOUBLE}let G=(q)=>{switch(q){case E0.Scalar.BLOCK_FOLDED:case E0.Scalar.BLOCK_LITERAL:return J||Q?h$(Y.value,Z):z2(Y,Z,X,z);case E0.Scalar.QUOTE_DOUBLE:return b1(Y.value,Z);case E0.Scalar.QUOTE_SINGLE:return p6(Y.value,Z);case E0.Scalar.PLAIN:return jY(Y,Z,X,z);default:return null}},W=G(U);if(W===null){let{defaultKeyType:q,defaultStringType:V}=Z.options,K=J&&q||V;if(W=G(K),W===null)throw Error(`Unsupported default string type ${K}`)}return W}bY.stringifyString=SY});var k1=R((mY)=>{var kY=e4(),t0=c(),yY=S1(),fY=x1();function gY($,Z){let X=Object.assign({blockQuote:!0,commentString:yY.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 hY($,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(t0.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 vY($,Z,{anchors:X,doc:z}){if(!z.directives)return"";let J=[],Q=(t0.isScalar($)||t0.isCollection($))&&$.anchor;if(Q&&kY.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 uY($,Z,X,z){if(t0.isPair($))return $.toString(Z,X,z);if(t0.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=t0.isNode($)?$:Z.doc.createNode($,{onTagObj:(G)=>J=G});J??(J=hY(Z.doc.schema.tags,Q));let Y=vY(Q,J,Z);if(Y.length>0)Z.indentAtStart=(Z.indentAtStart??0)+Y.length+1;let U=typeof J.stringify==="function"?J.stringify(Q,Z,X,z):t0.isScalar(Q)?fY.stringifyString(Q,Z,X,z):Q.toString(Z,X,z);if(!Y)return U;return t0.isScalar(Q)||U[0]==="{"||U[0]==="["?`${Y} ${U}`:`${Y}
60
- ${Z.indent}${U}`}mY.createStringifyContext=gY;mY.stringify=uY});var R5=R((lY)=>{var u0=c(),I5=Z0(),A5=k1(),y1=S1();function pY({key:$,value:Z},X,z,J){let{allNullValues:Q,doc:Y,indent:U,indentStep:G,options:{commentString:W,indentSeq:q,simpleKeys:V}}=X,K=u0.isNode($)&&$.comment||null;if(V){if(K)throw Error("With simple keys, key nodes cannot have comments");if(u0.isCollection($)||!u0.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let H=!V&&(!$||K&&Z==null&&!X.inFlow||u0.isCollection($)||(u0.isScalar($)?$.type===I5.Scalar.BLOCK_FOLDED||$.type===I5.Scalar.BLOCK_LITERAL:typeof $==="object"));X=Object.assign({},X,{allNullValues:!1,implicitKey:!H&&(V||!Q),indent:U+G});let T=!1,N=!1,M=A5.stringify($,X,()=>T=!0,()=>N=!0);if(!H&&!X.inFlow&&M.length>1024){if(V)throw Error("With simple keys, single line scalar must not span more than 1024 characters");H=!0}if(X.inFlow){if(Q||Z==null){if(T&&z)z();return M===""?"?":H?`? ${M}`:M}}else if(Q&&!V||Z==null&&H){if(M=`? ${M}`,K&&!T)M+=y1.lineComment(M,X.indent,W(K));else if(N&&J)J();return M}if(T)K=null;if(H){if(K)M+=y1.lineComment(M,X.indent,W(K));M=`? ${M}
61
- ${U}:`}else if(M=`${M}:`,K)M+=y1.lineComment(M,X.indent,W(K));let P,_,j;if(u0.isNode(Z))P=!!Z.spaceBefore,_=Z.commentBefore,j=Z.comment;else if(P=!1,_=null,j=null,Z&&typeof Z==="object")Z=Y.createNode(Z);if(X.implicitKey=!1,!H&&!K&&u0.isScalar(Z))X.indentAtStart=M.length+1;if(N=!1,!q&&G.length>=2&&!X.inFlow&&!H&&u0.isSeq(Z)&&!Z.flow&&!Z.tag&&!Z.anchor)X.indent=X.indent.substring(2);let x=!1,k=A5.stringify(Z,X,()=>x=!0,()=>N=!0),y=" ";if(K||P||_){if(y=P?`
53
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${W}`),y=!1,p=W2(z,!0);if(Y!=="folded"&&Z!==S0.Scalar.BLOCK_FOLDED)p.onOverflow=()=>{y=!0};let R=Z$.foldFlowLines(`${_}${k}${B}`,W,Z$.FOLD_BLOCK,p);if(!y)return`>${x}
54
+ ${W}${R}`}return X=X.replace(/\n+/g,`$&${W}`),`|${x}
55
+ ${W}${_}${X}${B}`}function vY($,Z,X,z){let{type:J,value:Q}=$,{actualString:Y,implicitKey:U,indent:G,indentStep:W,inFlow:q}=Z;if(U&&Q.includes(`
56
+ `)||q&&/[[\]{},]/.test(Q))return m$(Q,Z);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(Q))return U||q||!Q.includes(`
57
+ `)?m$(Q,Z):G2($,Z,X,z);if(!U&&!q&&J!==S0.Scalar.PLAIN&&Q.includes(`
58
+ `))return G2($,Z,X,z);if(q2(Q)){if(G==="")return Z.forceBlockIndent=!0,G2($,Z,X,z);else if(U&&G===W)return m$(Q,Z)}let V=Q.replace(/\n+/g,`$&
59
+ ${G}`);if(Y){let K=(N)=>N.default&&N.tag!=="tag:yaml.org,2002:str"&&N.test?.test(V),{compat:B,tags:T}=Z.doc.schema;if(T.some(K)||B?.some(K))return m$(Q,Z)}return U?V:Z$.foldFlowLines(V,G,Z$.FOLD_FLOW,W2(Z,!1))}function hY($,Z,X,z){let{implicitKey:J,inFlow:Q}=Z,Y=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:U}=$;if(U!==S0.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(Y.value))U=S0.Scalar.QUOTE_DOUBLE}let G=(q)=>{switch(q){case S0.Scalar.BLOCK_FOLDED:case S0.Scalar.BLOCK_LITERAL:return J||Q?m$(Y.value,Z):G2(Y,Z,X,z);case S0.Scalar.QUOTE_DOUBLE:return g1(Y.value,Z);case S0.Scalar.QUOTE_SINGLE:return r6(Y.value,Z);case S0.Scalar.PLAIN:return vY(Y,Z,X,z);default:return null}},W=G(U);if(W===null){let{defaultKeyType:q,defaultStringType:V}=Z.options,K=J&&q||V;if(W=G(K),W===null)throw Error(`Unsupported default string type ${K}`)}return W}uY.stringifyString=hY});var h1=F((sY)=>{var cY=J2(),X$=d(),dY=f1(),pY=v1();function lY($,Z){let X=Object.assign({blockQuote:!0,commentString:dY.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},$.schema.toStringOptions,Z),z;switch(X.collectionStyle){case"block":z=!1;break;case"flow":z=!0;break;default:z=null}return{anchors:new Set,doc:$,flowCollectionPadding:X.flowCollectionPadding?" ":"",indent:"",indentStep:typeof X.indent==="number"?" ".repeat(X.indent):" ",inFlow:z,options:X}}function iY($,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(X$.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 nY($,Z,{anchors:X,doc:z}){if(!z.directives)return"";let J=[],Q=(X$.isScalar($)||X$.isCollection($))&&$.anchor;if(Q&&cY.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 rY($,Z,X,z){if(X$.isPair($))return $.toString(Z,X,z);if(X$.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=X$.isNode($)?$:Z.doc.createNode($,{onTagObj:(G)=>J=G});J??(J=iY(Z.doc.schema.tags,Q));let Y=nY(Q,J,Z);if(Y.length>0)Z.indentAtStart=(Z.indentAtStart??0)+Y.length+1;let U=typeof J.stringify==="function"?J.stringify(Q,Z,X,z):X$.isScalar(Q)?pY.stringifyString(Q,Z,X,z):Q.toString(Z,X,z);if(!Y)return U;return X$.isScalar(Q)||U[0]==="{"||U[0]==="["?`${Y} ${U}`:`${Y}
60
+ ${Z.indent}${U}`}sY.createStringifyContext=lY;sY.stringify=rY});var _5=F((eY)=>{var d0=d(),w5=Z0(),P5=h1(),u1=f1();function tY({key:$,value:Z},X,z,J){let{allNullValues:Q,doc:Y,indent:U,indentStep:G,options:{commentString:W,indentSeq:q,simpleKeys:V}}=X,K=d0.isNode($)&&$.comment||null;if(V){if(K)throw Error("With simple keys, key nodes cannot have comments");if(d0.isCollection($)||!d0.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let B=!V&&(!$||K&&Z==null&&!X.inFlow||d0.isCollection($)||(d0.isScalar($)?$.type===w5.Scalar.BLOCK_FOLDED||$.type===w5.Scalar.BLOCK_LITERAL:typeof $==="object"));X=Object.assign({},X,{allNullValues:!1,implicitKey:!B&&(V||!Q),indent:U+G});let T=!1,N=!1,M=P5.stringify($,X,()=>T=!0,()=>N=!0);if(!B&&!X.inFlow&&M.length>1024){if(V)throw Error("With simple keys, single line scalar must not span more than 1024 characters");B=!0}if(X.inFlow){if(Q||Z==null){if(T&&z)z();return M===""?"?":B?`? ${M}`:M}}else if(Q&&!V||Z==null&&B){if(M=`? ${M}`,K&&!T)M+=u1.lineComment(M,X.indent,W(K));else if(N&&J)J();return M}if(T)K=null;if(B){if(K)M+=u1.lineComment(M,X.indent,W(K));M=`? ${M}
61
+ ${U}:`}else if(M=`${M}:`,K)M+=u1.lineComment(M,X.indent,W(K));let P,_,j;if(d0.isNode(Z))P=!!Z.spaceBefore,_=Z.commentBefore,j=Z.comment;else if(P=!1,_=null,j=null,Z&&typeof Z==="object")Z=Y.createNode(Z);if(X.implicitKey=!1,!B&&!K&&d0.isScalar(Z))X.indentAtStart=M.length+1;if(N=!1,!q&&G.length>=2&&!X.inFlow&&!B&&d0.isSeq(Z)&&!Z.flow&&!Z.tag&&!Z.anchor)X.indent=X.indent.substring(2);let x=!1,k=P5.stringify(Z,X,()=>x=!0,()=>N=!0),y=" ";if(K||P||_){if(y=P?`
62
62
  `:"",_){let p=W(_);y+=`
63
- ${y1.indentComment(p,X.indent)}`}if(k===""&&!X.inFlow){if(y===`
63
+ ${u1.indentComment(p,X.indent)}`}if(k===""&&!X.inFlow){if(y===`
64
64
  `&&j)y=`
65
65
 
66
66
  `}else y+=`
67
- ${X.indent}`}else if(!H&&u0.isCollection(Z)){let p=k[0],A=k.indexOf(`
68
- `),u=A!==-1,k0=X.inFlow??Z.flow??Z.items.length===0;if(u||!k0){let y0=!1;if(u&&(p==="&"||p==="!")){let e=k.indexOf(" ");if(p==="&"&&e!==-1&&e<A&&k[e+1]==="!")e=k.indexOf(" ",e+1);if(e===-1||A<e)y0=!0}if(!y0)y=`
67
+ ${X.indent}`}else if(!B&&d0.isCollection(Z)){let p=k[0],R=k.indexOf(`
68
+ `),u=R!==-1,f0=X.inFlow??Z.flow??Z.items.length===0;if(u||!f0){let g0=!1;if(u&&(p==="&"||p==="!")){let e=k.indexOf(" ");if(p==="&"&&e!==-1&&e<R&&k[e+1]==="!")e=k.indexOf(" ",e+1);if(e===-1||R<e)g0=!0}if(!g0)y=`
69
69
  ${X.indent}`}}else if(k===""||k[0]===`
70
- `)y="";if(M+=y+k,X.inFlow){if(x&&z)z()}else if(j&&!x)M+=y1.lineComment(M,X.indent,W(j));else if(N&&J)J();return M}lY.stringifyPair=pY});var i6=R((sY)=>{var F5=T0("process");function nY($,...Z){if($==="debug")console.log(...Z)}function rY($,Z){if($==="debug"||$==="warn")if(typeof F5.emitWarning==="function")F5.emitWarning(Z);else console.warn(Z)}sY.debug=nY;sY.warn=rY});var G2=R((eY)=>{var f1=c(),w5=Z0(),Y2="<<",U2={identify:($)=>$===Y2||typeof $==="symbol"&&$.description===Y2,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new w5.Scalar(Symbol(Y2)),{addToJSMap:P5}),stringify:()=>Y2},tY=($,Z)=>(U2.identify(Z)||f1.isScalar(Z)&&(!Z.type||Z.type===w5.Scalar.PLAIN)&&U2.identify(Z.value))&&$?.doc.schema.tags.some((X)=>X.tag===U2.tag&&X.default);function P5($,Z,X){if(X=$&&f1.isAlias(X)?X.resolve($.doc):X,f1.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=$&&f1.isAlias(X)?X.resolve($.doc):X;if(!f1.isMap(z))throw Error("Merge sources must be maps or map aliases");let J=z.toJSON(null,$,Map);for(let[Q,Y]of J)if(Z instanceof Map){if(!Z.has(Q))Z.set(Q,Y)}else if(Z instanceof Set)Z.add(Q);else if(!Object.prototype.hasOwnProperty.call(Z,Q))Object.defineProperty(Z,Q,{value:Y,writable:!0,enumerable:!0,configurable:!0});return Z}eY.addMergeToJSMap=P5;eY.isMergeKey=tY;eY.merge=U2});var s6=R((UU)=>{var zU=i6(),_5=G2(),JU=k1(),C5=c(),r6=a0();function QU($,Z,{key:X,value:z}){if(C5.isNode(X)&&X.addToJSMap)X.addToJSMap($,Z,z);else if(_5.isMergeKey($,X))_5.addMergeToJSMap($,Z,z);else{let J=r6.toJS(X,"",$);if(Z instanceof Map)Z.set(J,r6.toJS(z,J,$));else if(Z instanceof Set)Z.add(J);else{let Q=YU(X,J,$),Y=r6.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 YU($,Z,X){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(C5.isNode($)&&X?.doc){let z=JU.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)+'..."';zU.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)}UU.addPairToJSMap=QU});var e0=R((KU)=>{var E5=j1(),WU=R5(),qU=s6(),W2=c();function VU($,Z,X){let z=E5.createNode($,void 0,X),J=E5.createNode(Z,void 0,X);return new q2(z,J)}class q2{constructor($,Z=null){Object.defineProperty(this,W2.NODE_TYPE,{value:W2.PAIR}),this.key=$,this.value=Z}clone($){let{key:Z,value:X}=this;if(W2.isNode(Z))Z=Z.clone($);if(W2.isNode(X))X=X.clone($);return new q2(Z,X)}toJSON($,Z){let X=Z?.mapAsMap?new Map:{};return qU.addPairToJSMap(Z,X,this)}toString($,Z,X){return $?.doc?WU.stringifyPair(this,$,Z,X):JSON.stringify(this)}}KU.Pair=q2;KU.createPair=VU});var a6=R((OU)=>{var O$=c(),j5=k1(),V2=S1();function LU($,Z,X){return(Z.inFlow??$.flow?MU:NU)($,Z,X)}function NU({comment:$,items:Z},X,{blockItemPrefix:z,flowChars:J,itemIndent:Q,onChompKeep:Y,onComment:U}){let{indent:G,options:{commentString:W}}=X,q=Object.assign({},X,{indent:Q,type:null}),V=!1,K=[];for(let T=0;T<Z.length;++T){let N=Z[T],M=null;if(O$.isNode(N)){if(!V&&N.spaceBefore)K.push("");if(K2(X,K,N.commentBefore,V),N.comment)M=N.comment}else if(O$.isPair(N)){let _=O$.isNode(N.key)?N.key:null;if(_){if(!V&&_.spaceBefore)K.push("");K2(X,K,_.commentBefore,V)}}V=!1;let P=j5.stringify(N,q,()=>M=null,()=>V=!0);if(M)P+=V2.lineComment(P,Q,W(M));if(V&&M)V=!1;K.push(z+P)}let H;if(K.length===0)H=J.start+J.end;else{H=K[0];for(let T=1;T<K.length;++T){let N=K[T];H+=N?`
70
+ `)y="";if(M+=y+k,X.inFlow){if(x&&z)z()}else if(j&&!x)M+=u1.lineComment(M,X.indent,W(j));else if(N&&J)J();return M}eY.stringifyPair=tY});var a6=F((zU)=>{var C5=D0("process");function ZU($,...Z){if($==="debug")console.log(...Z)}function XU($,Z){if($==="debug"||$==="warn")if(typeof C5.emitWarning==="function")C5.emitWarning(Z);else console.warn(Z)}zU.debug=ZU;zU.warn=XU});var H2=F((UU)=>{var m1=d(),E5=Z0(),V2="<<",K2={identify:($)=>$===V2||typeof $==="symbol"&&$.description===V2,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new E5.Scalar(Symbol(V2)),{addToJSMap:j5}),stringify:()=>V2},YU=($,Z)=>(K2.identify(Z)||m1.isScalar(Z)&&(!Z.type||Z.type===E5.Scalar.PLAIN)&&K2.identify(Z.value))&&$?.doc.schema.tags.some((X)=>X.tag===K2.tag&&X.default);function j5($,Z,X){if(X=$&&m1.isAlias(X)?X.resolve($.doc):X,m1.isSeq(X))for(let z of X.items)o6($,Z,z);else if(Array.isArray(X))for(let z of X)o6($,Z,z);else o6($,Z,X)}function o6($,Z,X){let z=$&&m1.isAlias(X)?X.resolve($.doc):X;if(!m1.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}UU.addMergeToJSMap=j5;UU.isMergeKey=YU;UU.merge=K2});var e6=F((LU)=>{var VU=a6(),S5=H2(),KU=h1(),b5=d(),t6=$$();function HU($,Z,{key:X,value:z}){if(b5.isNode(X)&&X.addToJSMap)X.addToJSMap($,Z,z);else if(S5.isMergeKey($,X))S5.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=BU(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 BU($,Z,X){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(b5.isNode($)&&X?.doc){let z=KU.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)+'..."';VU.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)}LU.addPairToJSMap=HU});var z$=F((DU)=>{var x5=y1(),MU=_5(),OU=e6(),B2=d();function TU($,Z,X){let z=x5.createNode($,void 0,X),J=x5.createNode(Z,void 0,X);return new L2(z,J)}class L2{constructor($,Z=null){Object.defineProperty(this,B2.NODE_TYPE,{value:B2.PAIR}),this.key=$,this.value=Z}clone($){let{key:Z,value:X}=this;if(B2.isNode(Z))Z=Z.clone($);if(B2.isNode(X))X=X.clone($);return new L2(Z,X)}toJSON($,Z){let X=Z?.mapAsMap?new Map:{};return OU.addPairToJSMap(Z,X,this)}toString($,Z,X){return $?.doc?MU.stringifyPair(this,$,Z,X):JSON.stringify(this)}}DU.Pair=L2;DU.createPair=TU});var $8=F((PU)=>{var I$=d(),k5=h1(),N2=f1();function RU($,Z,X){return(Z.inFlow??$.flow?wU:FU)($,Z,X)}function FU({comment:$,items:Z},X,{blockItemPrefix:z,flowChars:J,itemIndent:Q,onChompKeep:Y,onComment:U}){let{indent:G,options:{commentString:W}}=X,q=Object.assign({},X,{indent:Q,type:null}),V=!1,K=[];for(let T=0;T<Z.length;++T){let N=Z[T],M=null;if(I$.isNode(N)){if(!V&&N.spaceBefore)K.push("");if(M2(X,K,N.commentBefore,V),N.comment)M=N.comment}else if(I$.isPair(N)){let _=I$.isNode(N.key)?N.key:null;if(_){if(!V&&_.spaceBefore)K.push("");M2(X,K,_.commentBefore,V)}}V=!1;let P=k5.stringify(N,q,()=>M=null,()=>V=!0);if(M)P+=N2.lineComment(P,Q,W(M));if(V&&M)V=!1;K.push(z+P)}let B;if(K.length===0)B=J.start+J.end;else{B=K[0];for(let T=1;T<K.length;++T){let N=K[T];B+=N?`
71
71
  ${G}${N}`:`
72
- `}}if($){if(H+=`
73
- `+V2.indentComment(W($),G),U)U()}else if(V&&Y)Y();return H}function MU({items:$},Z,{flowChars:X,itemIndent:z}){let{indent:J,indentStep:Q,flowCollectionPadding:Y,options:{commentString:U}}=Z;z+=Q;let G=Object.assign({},Z,{indent:z,inFlow:!0,type:null}),W=!1,q=0,V=[];for(let T=0;T<$.length;++T){let N=$[T],M=null;if(O$.isNode(N)){if(N.spaceBefore)V.push("");if(K2(Z,V,N.commentBefore,!1),N.comment)M=N.comment}else if(O$.isPair(N)){let _=O$.isNode(N.key)?N.key:null;if(_){if(_.spaceBefore)V.push("");if(K2(Z,V,_.commentBefore,!1),_.comment)W=!0}let j=O$.isNode(N.value)?N.value:null;if(j){if(j.comment)M=j.comment;if(j.commentBefore)W=!0}else if(N.value==null&&_?.comment)M=_.comment}if(M)W=!0;let P=j5.stringify(N,G,()=>M=null);if(T<$.length-1)P+=",";if(M)P+=V2.lineComment(P,z,U(M));if(!W&&(V.length>q||P.includes(`
74
- `)))W=!0;V.push(P),q=V.length}let{start:K,end:H}=X;if(V.length===0)return K+H;else{if(!W){let T=V.reduce((N,M)=>N+M.length+2,2);W=Z.options.lineWidth>0&&T>Z.options.lineWidth}if(W){let T=K;for(let N of V)T+=N?`
72
+ `}}if($){if(B+=`
73
+ `+N2.indentComment(W($),G),U)U()}else if(V&&Y)Y();return B}function wU({items:$},Z,{flowChars:X,itemIndent:z}){let{indent:J,indentStep:Q,flowCollectionPadding:Y,options:{commentString:U}}=Z;z+=Q;let G=Object.assign({},Z,{indent:z,inFlow:!0,type:null}),W=!1,q=0,V=[];for(let T=0;T<$.length;++T){let N=$[T],M=null;if(I$.isNode(N)){if(N.spaceBefore)V.push("");if(M2(Z,V,N.commentBefore,!1),N.comment)M=N.comment}else if(I$.isPair(N)){let _=I$.isNode(N.key)?N.key:null;if(_){if(_.spaceBefore)V.push("");if(M2(Z,V,_.commentBefore,!1),_.comment)W=!0}let j=I$.isNode(N.value)?N.value:null;if(j){if(j.comment)M=j.comment;if(j.commentBefore)W=!0}else if(N.value==null&&_?.comment)M=_.comment}if(M)W=!0;let P=k5.stringify(N,G,()=>M=null);if(T<$.length-1)P+=",";if(M)P+=N2.lineComment(P,z,U(M));if(!W&&(V.length>q||P.includes(`
74
+ `)))W=!0;V.push(P),q=V.length}let{start:K,end:B}=X;if(V.length===0)return K+B;else{if(!W){let T=V.reduce((N,M)=>N+M.length+2,2);W=Z.options.lineWidth>0&&T>Z.options.lineWidth}if(W){let T=K;for(let N of V)T+=N?`
75
75
  ${Q}${J}${N}`:`
76
76
  `;return`${T}
77
- ${J}${H}`}else return`${K}${Y}${V.join(" ")}${Y}${H}`}}function K2({indent:$,options:{commentString:Z}},X,z,J){if(z&&J)z=z.replace(/^\n+/,"");if(z){let Q=V2.indentComment(Z(z),$);X.push(Q.trimStart())}}OU.stringifyCollection=LU});var Z$=R((FU)=>{var DU=a6(),IU=s6(),AU=X2(),$$=c(),H2=e0(),RU=Z0();function g1($,Z){let X=$$.isScalar(Z)?Z.value:Z;for(let z of $)if($$.isPair(z)){if(z.key===Z||z.key===X)return z;if($$.isScalar(z.key)&&z.key.value===X)return z}return}class S5 extends AU.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super($$.MAP,$);this.items=[]}static from($,Z,X){let{keepUndefined:z,replacer:J}=X,Q=new this($),Y=(U,G)=>{if(typeof J==="function")G=J.call(Z,U,G);else if(Array.isArray(J)&&!J.includes(U))return;if(G!==void 0||z)Q.items.push(H2.createPair(U,G,X))};if(Z instanceof Map)for(let[U,G]of Z)Y(U,G);else if(Z&&typeof Z==="object")for(let U of Object.keys(Z))Y(U,Z[U]);if(typeof $.sortMapEntries==="function")Q.items.sort($.sortMapEntries);return Q}add($,Z){let X;if($$.isPair($))X=$;else if(!$||typeof $!=="object"||!("key"in $))X=new H2.Pair($,$?.value);else X=new H2.Pair($.key,$.value);let z=g1(this.items,X.key),J=this.schema?.sortMapEntries;if(z){if(!Z)throw Error(`Key ${X.key} already set`);if($$.isScalar(z.value)&&RU.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=g1(this.items,$);if(!Z)return!1;return this.items.splice(this.items.indexOf(Z),1).length>0}get($,Z){let z=g1(this.items,$)?.value;return(!Z&&$$.isScalar(z)?z.value:z)??void 0}has($){return!!g1(this.items,$)}set($,Z){this.add(new H2.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)IU.addPairToJSMap(Z,z,J);return z}toString($,Z,X){if(!$)return JSON.stringify(this);for(let z of this.items)if(!$$.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 DU.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:X,onComment:Z})}}FU.YAMLMap=S5;FU.findPair=g1});var v$=R((EU)=>{var _U=c(),b5=Z$(),CU={collection:"map",default:!0,nodeClass:b5.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,Z){if(!_U.isMap($))Z("Expected a mapping for this tag");return $},createNode:($,Z,X)=>b5.YAMLMap.from($,Z,X)};EU.map=CU});var X$=R((fU)=>{var SU=j1(),bU=a6(),xU=X2(),L2=c(),kU=Z0(),yU=a0();class x5 extends xU.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(L2.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let Z=B2($);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get($,Z){let X=B2($);if(typeof X!=="number")return;let z=this.items[X];return!Z&&L2.isScalar(z)?z.value:z}has($){let Z=B2($);return typeof Z==="number"&&Z<this.items.length}set($,Z){let X=B2($);if(typeof X!=="number")throw Error(`Expected a valid index, not ${$}.`);let z=this.items[X];if(L2.isScalar(z)&&kU.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(yU.toJS(J,String(z++),Z));return X}toString($,Z,X){if(!$)return JSON.stringify(this);return bU.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 U=Z instanceof Set?Y:String(Q++);Y=z.call(Z,U,Y)}J.items.push(SU.createNode(Y,void 0,X))}}return J}}function B2($){let Z=L2.isScalar($)?$.value:$;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}fU.YAMLSeq=x5});var u$=R((uU)=>{var hU=c(),k5=X$(),vU={collection:"seq",default:!0,nodeClass:k5.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,Z){if(!hU.isSeq($))Z("Expected a sequence for this tag");return $},createNode:($,Z,X)=>k5.YAMLSeq.from($,Z,X)};uU.seq=vU});var h1=R((pU)=>{var cU=x1(),dU={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,Z,X,z){return Z=Object.assign({actualString:!0},Z),cU.stringifyString($,Z,X,z)}};pU.string=dU});var N2=R((iU)=>{var y5=Z0(),f5={identify:($)=>$==null,createNode:()=>new y5.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new y5.Scalar(null),stringify:({source:$},Z)=>typeof $==="string"&&f5.test.test($)?$:Z.options.nullStr};iU.nullTag=f5});var o6=R((sU)=>{var rU=Z0(),g5={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new rU.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:Z},X){if($&&g5.test.test($)){let z=$[0]==="t"||$[0]==="T";if(Z===z)return $}return Z?X.options.trueStr:X.options.falseStr}};sU.boolTag=g5});var m$=R((tU)=>{function oU({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 U=Z-(Q.length-Y-1);while(U-- >0)Q+="0"}return Q}tU.stringifyNumber=oU});var e6=R((JG)=>{var $G=Z0(),t6=m$(),ZG={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:t6.stringifyNumber},XG={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():t6.stringifyNumber($)}},zG={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let Z=new $G.Scalar(parseFloat($)),X=$.indexOf(".");if(X!==-1&&$[$.length-1]==="0")Z.minFractionDigits=$.length-X-1;return Z},stringify:t6.stringifyNumber};JG.float=zG;JG.floatExp=XG;JG.floatNaN=ZG});var Z8=R((VG)=>{var h5=m$(),M2=($)=>typeof $==="bigint"||Number.isInteger($),$8=($,Z,X,{intAsBigInt:z})=>z?BigInt($):parseInt($.substring(Z),X);function v5($,Z,X){let{value:z}=$;if(M2(z)&&z>=0)return X+z.toString(Z);return h5.stringifyNumber($)}var GG={identify:($)=>M2($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,Z,X)=>$8($,2,8,X),stringify:($)=>v5($,8,"0o")},WG={identify:M2,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,Z,X)=>$8($,0,10,X),stringify:h5.stringifyNumber},qG={identify:($)=>M2($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,Z,X)=>$8($,2,16,X),stringify:($)=>v5($,16,"0x")};VG.int=WG;VG.intHex=qG;VG.intOct=GG});var u5=R((IG)=>{var LG=v$(),NG=N2(),MG=u$(),OG=h1(),TG=o6(),X8=e6(),z8=Z8(),DG=[LG.map,MG.seq,OG.string,NG.nullTag,TG.boolTag,z8.intOct,z8.int,z8.intHex,X8.floatNaN,X8.floatExp,X8.float];IG.schema=DG});var c5=R((EG)=>{var RG=Z0(),FG=v$(),wG=u$();function m5($){return typeof $==="bigint"||Number.isInteger($)}var O2=({value:$})=>JSON.stringify($),PG=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:O2},{identify:($)=>$==null,createNode:()=>new RG.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:O2},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:O2},{identify:m5,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,Z,{intAsBigInt:X})=>X?BigInt($):parseInt($,10),stringify:({value:$})=>m5($)?$.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:O2}],_G={default:!0,tag:"",test:/^/,resolve($,Z){return Z(`Unresolved plain scalar ${JSON.stringify($)}`),$}},CG=[FG.map,wG.seq].concat(PG,_G);EG.schema=CG});var Q8=R((xG)=>{var v1=T0("buffer"),J8=Z0(),SG=x1(),bG={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,Z){if(typeof v1.Buffer==="function")return v1.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,U;if(typeof v1.Buffer==="function")U=Y instanceof v1.Buffer?Y.toString("base64"):v1.Buffer.from(Y.buffer).toString("base64");else if(typeof btoa==="function"){let G="";for(let W=0;W<Y.length;++W)G+=String.fromCharCode(Y[W]);U=btoa(G)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(Z??(Z=J8.Scalar.BLOCK_LITERAL),Z!==J8.Scalar.QUOTE_DOUBLE){let G=Math.max(z.options.lineWidth-z.indent.length,z.options.minContentWidth),W=Math.ceil(U.length/G),q=Array(W);for(let V=0,K=0;V<W;++V,K+=G)q[V]=U.substr(K,G);U=q.join(Z===J8.Scalar.BLOCK_LITERAL?`
78
- `:" ")}return SG.stringifyString({comment:$,type:Z,value:U},z,J,Q)}};xG.binary=bG});var D2=R((hG)=>{var T2=c(),Y8=e0(),yG=Z0(),fG=X$();function d5($,Z){if(T2.isSeq($))for(let X=0;X<$.items.length;++X){let z=$.items[X];if(T2.isPair(z))continue;else if(T2.isMap(z)){if(z.items.length>1)Z("Each pair must have its own sequence indicator");let J=z.items[0]||new Y8.Pair(new yG.Scalar(null));if(z.commentBefore)J.key.commentBefore=J.key.commentBefore?`${z.commentBefore}
77
+ ${J}${B}`}else return`${K}${Y}${V.join(" ")}${Y}${B}`}}function M2({indent:$,options:{commentString:Z}},X,z,J){if(z&&J)z=z.replace(/^\n+/,"");if(z){let Q=N2.indentComment(Z(z),$);X.push(Q.trimStart())}}PU.stringifyCollection=RU});var Q$=F((bU)=>{var CU=$8(),EU=e6(),jU=U2(),J$=d(),O2=z$(),SU=Z0();function c1($,Z){let X=J$.isScalar(Z)?Z.value:Z;for(let z of $)if(J$.isPair(z)){if(z.key===Z||z.key===X)return z;if(J$.isScalar(z.key)&&z.key.value===X)return z}return}class y5 extends jU.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(J$.MAP,$);this.items=[]}static from($,Z,X){let{keepUndefined:z,replacer:J}=X,Q=new this($),Y=(U,G)=>{if(typeof J==="function")G=J.call(Z,U,G);else if(Array.isArray(J)&&!J.includes(U))return;if(G!==void 0||z)Q.items.push(O2.createPair(U,G,X))};if(Z instanceof Map)for(let[U,G]of Z)Y(U,G);else if(Z&&typeof Z==="object")for(let U of Object.keys(Z))Y(U,Z[U]);if(typeof $.sortMapEntries==="function")Q.items.sort($.sortMapEntries);return Q}add($,Z){let X;if(J$.isPair($))X=$;else if(!$||typeof $!=="object"||!("key"in $))X=new O2.Pair($,$?.value);else X=new O2.Pair($.key,$.value);let z=c1(this.items,X.key),J=this.schema?.sortMapEntries;if(z){if(!Z)throw Error(`Key ${X.key} already set`);if(J$.isScalar(z.value)&&SU.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=c1(this.items,$);if(!Z)return!1;return this.items.splice(this.items.indexOf(Z),1).length>0}get($,Z){let z=c1(this.items,$)?.value;return(!Z&&J$.isScalar(z)?z.value:z)??void 0}has($){return!!c1(this.items,$)}set($,Z){this.add(new O2.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)EU.addPairToJSMap(Z,z,J);return z}toString($,Z,X){if(!$)return JSON.stringify(this);for(let z of this.items)if(!J$.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 CU.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:X,onComment:Z})}}bU.YAMLMap=y5;bU.findPair=c1});var c$=F((gU)=>{var yU=d(),f5=Q$(),fU={collection:"map",default:!0,nodeClass:f5.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,Z){if(!yU.isMap($))Z("Expected a mapping for this tag");return $},createNode:($,Z,X)=>f5.YAMLMap.from($,Z,X)};gU.map=fU});var Y$=F((pU)=>{var hU=y1(),uU=$8(),mU=U2(),D2=d(),cU=Z0(),dU=$$();class g5 extends mU.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(D2.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let Z=T2($);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get($,Z){let X=T2($);if(typeof X!=="number")return;let z=this.items[X];return!Z&&D2.isScalar(z)?z.value:z}has($){let Z=T2($);return typeof Z==="number"&&Z<this.items.length}set($,Z){let X=T2($);if(typeof X!=="number")throw Error(`Expected a valid index, not ${$}.`);let z=this.items[X];if(D2.isScalar(z)&&cU.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(dU.toJS(J,String(z++),Z));return X}toString($,Z,X){if(!$)return JSON.stringify(this);return uU.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 U=Z instanceof Set?Y:String(Q++);Y=z.call(Z,U,Y)}J.items.push(hU.createNode(Y,void 0,X))}}return J}}function T2($){let Z=D2.isScalar($)?$.value:$;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}pU.YAMLSeq=g5});var d$=F((rU)=>{var iU=d(),v5=Y$(),nU={collection:"seq",default:!0,nodeClass:v5.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,Z){if(!iU.isSeq($))Z("Expected a sequence for this tag");return $},createNode:($,Z,X)=>v5.YAMLSeq.from($,Z,X)};rU.seq=nU});var d1=F((tU)=>{var aU=v1(),oU={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,Z,X,z){return Z=Object.assign({actualString:!0},Z),aU.stringifyString($,Z,X,z)}};tU.string=oU});var I2=F(($G)=>{var h5=Z0(),u5={identify:($)=>$==null,createNode:()=>new h5.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new h5.Scalar(null),stringify:({source:$},Z)=>typeof $==="string"&&u5.test.test($)?$:Z.options.nullStr};$G.nullTag=u5});var Z8=F((zG)=>{var XG=Z0(),m5={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new XG.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:Z},X){if($&&m5.test.test($)){let z=$[0]==="t"||$[0]==="T";if(Z===z)return $}return Z?X.options.trueStr:X.options.falseStr}};zG.boolTag=m5});var p$=F((YG)=>{function QG({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 U=Z-(Q.length-Y-1);while(U-- >0)Q+="0"}return Q}YG.stringifyNumber=QG});var z8=F((KG)=>{var GG=Z0(),X8=p$(),WG={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:X8.stringifyNumber},qG={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():X8.stringifyNumber($)}},VG={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let Z=new GG.Scalar(parseFloat($)),X=$.indexOf(".");if(X!==-1&&$[$.length-1]==="0")Z.minFractionDigits=$.length-X-1;return Z},stringify:X8.stringifyNumber};KG.float=VG;KG.floatExp=qG;KG.floatNaN=WG});var Q8=F((TG)=>{var c5=p$(),A2=($)=>typeof $==="bigint"||Number.isInteger($),J8=($,Z,X,{intAsBigInt:z})=>z?BigInt($):parseInt($.substring(Z),X);function d5($,Z,X){let{value:z}=$;if(A2(z)&&z>=0)return X+z.toString(Z);return c5.stringifyNumber($)}var NG={identify:($)=>A2($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,Z,X)=>J8($,2,8,X),stringify:($)=>d5($,8,"0o")},MG={identify:A2,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,Z,X)=>J8($,0,10,X),stringify:c5.stringifyNumber},OG={identify:($)=>A2($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,Z,X)=>J8($,2,16,X),stringify:($)=>d5($,16,"0x")};TG.int=MG;TG.intHex=OG;TG.intOct=NG});var p5=F((EG)=>{var RG=c$(),FG=I2(),wG=d$(),PG=d1(),_G=Z8(),Y8=z8(),U8=Q8(),CG=[RG.map,wG.seq,PG.string,FG.nullTag,_G.boolTag,U8.intOct,U8.int,U8.intHex,Y8.floatNaN,Y8.floatExp,Y8.float];EG.schema=CG});var i5=F((gG)=>{var SG=Z0(),bG=c$(),xG=d$();function l5($){return typeof $==="bigint"||Number.isInteger($)}var R2=({value:$})=>JSON.stringify($),kG=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:R2},{identify:($)=>$==null,createNode:()=>new SG.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:R2},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:R2},{identify:l5,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,Z,{intAsBigInt:X})=>X?BigInt($):parseInt($,10),stringify:({value:$})=>l5($)?$.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:R2}],yG={default:!0,tag:"",test:/^/,resolve($,Z){return Z(`Unresolved plain scalar ${JSON.stringify($)}`),$}},fG=[bG.map,xG.seq].concat(kG,yG);gG.schema=fG});var W8=F((mG)=>{var p1=D0("buffer"),G8=Z0(),hG=v1(),uG={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,Z){if(typeof p1.Buffer==="function")return p1.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,U;if(typeof p1.Buffer==="function")U=Y instanceof p1.Buffer?Y.toString("base64"):p1.Buffer.from(Y.buffer).toString("base64");else if(typeof btoa==="function"){let G="";for(let W=0;W<Y.length;++W)G+=String.fromCharCode(Y[W]);U=btoa(G)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(Z??(Z=G8.Scalar.BLOCK_LITERAL),Z!==G8.Scalar.QUOTE_DOUBLE){let G=Math.max(z.options.lineWidth-z.indent.length,z.options.minContentWidth),W=Math.ceil(U.length/G),q=Array(W);for(let V=0,K=0;V<W;++V,K+=G)q[V]=U.substr(K,G);U=q.join(Z===G8.Scalar.BLOCK_LITERAL?`
78
+ `:" ")}return hG.stringifyString({comment:$,type:Z,value:U},z,J,Q)}};mG.binary=uG});var w2=F((iG)=>{var F2=d(),q8=z$(),dG=Z0(),pG=Y$();function n5($,Z){if(F2.isSeq($))for(let X=0;X<$.items.length;++X){let z=$.items[X];if(F2.isPair(z))continue;else if(F2.isMap(z)){if(z.items.length>1)Z("Each pair must have its own sequence indicator");let J=z.items[0]||new q8.Pair(new dG.Scalar(null));if(z.commentBefore)J.key.commentBefore=J.key.commentBefore?`${z.commentBefore}
79
79
  ${J.key.commentBefore}`:z.commentBefore;if(z.comment){let Q=J.value??J.key;Q.comment=Q.comment?`${z.comment}
80
- ${Q.comment}`:z.comment}z=J}$.items[X]=T2.isPair(z)?z:new Y8.Pair(z)}else Z("Expected a sequence for this tag");return $}function p5($,Z,X){let{replacer:z}=X,J=new fG.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 U,G;if(Array.isArray(Y))if(Y.length===2)U=Y[0],G=Y[1];else throw TypeError(`Expected [key, value] tuple: ${Y}`);else if(Y&&Y instanceof Object){let W=Object.keys(Y);if(W.length===1)U=W[0],G=Y[U];else throw TypeError(`Expected tuple with one key, not ${W.length} keys`)}else U=Y;J.items.push(Y8.createPair(U,G,X))}return J}var gG={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:d5,createNode:p5};hG.createPairs=p5;hG.pairs=gG;hG.resolvePairs=d5});var G8=R((pG)=>{var l5=c(),U8=a0(),u1=Z$(),cG=X$(),i5=D2();class T$ extends cG.YAMLSeq{constructor(){super();this.add=u1.YAMLMap.prototype.add.bind(this),this.delete=u1.YAMLMap.prototype.delete.bind(this),this.get=u1.YAMLMap.prototype.get.bind(this),this.has=u1.YAMLMap.prototype.has.bind(this),this.set=u1.YAMLMap.prototype.set.bind(this),this.tag=T$.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(l5.isPair(z))J=U8.toJS(z.key,"",Z),Q=U8.toJS(z.value,J,Z);else J=U8.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=i5.createPairs($,Z,X),J=new this;return J.items=z.items,J}}T$.tag="tag:yaml.org,2002:omap";var dG={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:T$,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,Z){let X=i5.resolvePairs($,Z),z=[];for(let{key:J}of X.items)if(l5.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 T$,X)},createNode:($,Z,X)=>T$.from($,Z,X)};pG.YAMLOMap=T$;pG.omap=dG});var o5=R((nG)=>{var n5=Z0();function r5({value:$,source:Z},X){if(Z&&($?s5:a5).test.test(Z))return Z;return $?X.options.trueStr:X.options.falseStr}var s5={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new n5.Scalar(!0),stringify:r5},a5={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new n5.Scalar(!1),stringify:r5};nG.falseTag=a5;nG.trueTag=s5});var t5=R(($W)=>{var aG=Z0(),W8=m$(),oG={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:W8.stringifyNumber},tG={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():W8.stringifyNumber($)}},eG={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let Z=new aG.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:W8.stringifyNumber};$W.float=eG;$W.floatExp=tG;$W.floatNaN=oG});var $9=R((GW)=>{var e5=m$(),m1=($)=>typeof $==="bigint"||Number.isInteger($);function I2($,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 q8($,Z,X){let{value:z}=$;if(m1(z)){let J=z.toString(Z);return z<0?"-"+X+J.substr(1):X+J}return e5.stringifyNumber($)}var JW={identify:m1,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,Z,X)=>I2($,2,2,X),stringify:($)=>q8($,2,"0b")},QW={identify:m1,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,Z,X)=>I2($,1,8,X),stringify:($)=>q8($,8,"0")},YW={identify:m1,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,Z,X)=>I2($,0,10,X),stringify:e5.stringifyNumber},UW={identify:m1,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,Z,X)=>I2($,2,16,X),stringify:($)=>q8($,16,"0x")};GW.int=YW;GW.intBin=JW;GW.intHex=UW;GW.intOct=QW});var V8=R((BW)=>{var F2=c(),A2=e0(),R2=Z$();class D$ extends R2.YAMLMap{constructor($){super($);this.tag=D$.tag}add($){let Z;if(F2.isPair($))Z=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)Z=new A2.Pair($.key,null);else Z=new A2.Pair($,null);if(!R2.findPair(this.items,Z.key))this.items.push(Z)}get($,Z){let X=R2.findPair(this.items,$);return!Z&&F2.isPair(X)?F2.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=R2.findPair(this.items,$);if(X&&!Z)this.items.splice(this.items.indexOf(X),1);else if(!X&&Z)this.items.push(new A2.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(A2.createPair(Q,null,X))}return J}}D$.tag="tag:yaml.org,2002:set";var HW={collection:"map",identify:($)=>$ instanceof Set,nodeClass:D$,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,Z,X)=>D$.from($,Z,X),resolve($,Z){if(F2.isMap($))if($.hasAllNullValues(!0))return Object.assign(new D$,$);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return $}};BW.YAMLSet=D$;BW.set=HW});var H8=R((DW)=>{var MW=m$();function K8($,Z){let X=$[0],z=X==="-"||X==="+"?$.substring(1):$,J=(Y)=>Z?BigInt(Y):Number(Y),Q=z.replace(/_/g,"").split(":").reduce((Y,U)=>Y*J(60)+J(U),J(0));return X==="-"?J(-1)*Q:Q}function Z9($){let{value:Z}=$,X=(Y)=>Y;if(typeof Z==="bigint")X=(Y)=>BigInt(Y);else if(isNaN(Z)||!isFinite(Z))return MW.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 OW={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})=>K8($,X),stringify:Z9},TW={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:($)=>K8($,!1),stringify:Z9},X9={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(X9.test);if(!Z)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,X,z,J,Q,Y,U]=Z.map(Number),G=Z[7]?Number((Z[7]+"00").substr(1,3)):0,W=Date.UTC(X,z-1,J,Q||0,Y||0,U||0,G),q=Z[8];if(q&&q!=="Z"){let V=K8(q,!1);if(Math.abs(V)<30)V*=60;W-=60000*V}return new Date(W)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};DW.floatTime=TW;DW.intTime=OW;DW.timestamp=X9});var J9=R((kW)=>{var FW=v$(),wW=N2(),PW=u$(),_W=h1(),CW=Q8(),z9=o5(),B8=t5(),w2=$9(),EW=G2(),jW=G8(),SW=D2(),bW=V8(),L8=H8(),xW=[FW.map,PW.seq,_W.string,wW.nullTag,z9.trueTag,z9.falseTag,w2.intBin,w2.intOct,w2.int,w2.intHex,B8.floatNaN,B8.floatExp,B8.float,CW.binary,EW.merge,jW.omap,SW.pairs,bW.set,L8.intTime,L8.floatTime,L8.timestamp];kW.schema=xW});var B9=R((dW)=>{var G9=v$(),fW=N2(),W9=u$(),gW=h1(),hW=o6(),N8=e6(),M8=Z8(),vW=u5(),uW=c5(),q9=Q8(),c1=G2(),V9=G8(),K9=D2(),Q9=J9(),H9=V8(),P2=H8(),Y9=new Map([["core",vW.schema],["failsafe",[G9.map,W9.seq,gW.string]],["json",uW.schema],["yaml11",Q9.schema],["yaml-1.1",Q9.schema]]),U9={binary:q9.binary,bool:hW.boolTag,float:N8.float,floatExp:N8.floatExp,floatNaN:N8.floatNaN,floatTime:P2.floatTime,int:M8.int,intHex:M8.intHex,intOct:M8.intOct,intTime:P2.intTime,map:G9.map,merge:c1.merge,null:fW.nullTag,omap:V9.omap,pairs:K9.pairs,seq:W9.seq,set:H9.set,timestamp:P2.timestamp},mW={"tag:yaml.org,2002:binary":q9.binary,"tag:yaml.org,2002:merge":c1.merge,"tag:yaml.org,2002:omap":V9.omap,"tag:yaml.org,2002:pairs":K9.pairs,"tag:yaml.org,2002:set":H9.set,"tag:yaml.org,2002:timestamp":P2.timestamp};function cW($,Z,X){let z=Y9.get(Z);if(z&&!$)return X&&!z.includes(c1.merge)?z.concat(c1.merge):z.slice();let J=z;if(!J)if(Array.isArray($))J=[];else{let Q=Array.from(Y9.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(c1.merge);return J.reduce((Q,Y)=>{let U=typeof Y==="string"?U9[Y]:Y;if(!U){let G=JSON.stringify(Y),W=Object.keys(U9).map((q)=>JSON.stringify(q)).join(", ");throw Error(`Unknown custom tag ${G}; use one of ${W}`)}if(!Q.includes(U))Q.push(U);return Q},[])}dW.coreKnownTags=mW;dW.getTags=cW});var D8=R((aW)=>{var O8=c(),iW=v$(),nW=u$(),rW=h1(),_2=B9(),sW=($,Z)=>$.key<Z.key?-1:$.key>Z.key?1:0;class T8{constructor({compat:$,customTags:Z,merge:X,resolveKnownTags:z,schema:J,sortMapEntries:Q,toStringDefaults:Y}){this.compat=Array.isArray($)?_2.getTags($,"compat"):$?_2.getTags(null,$):null,this.name=typeof J==="string"&&J||"core",this.knownTags=z?_2.coreKnownTags:{},this.tags=_2.getTags(Z,this.name,X),this.toStringOptions=Y??null,Object.defineProperty(this,O8.MAP,{value:iW.map}),Object.defineProperty(this,O8.SCALAR,{value:rW.string}),Object.defineProperty(this,O8.SEQ,{value:nW.seq}),this.sortMapEntries=typeof Q==="function"?Q:Q===!0?sW:null}clone(){let $=Object.create(T8.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}aW.Schema=T8});var L9=R(($q)=>{var tW=c(),I8=k1(),d1=S1();function eW($,Z){let X=[],z=Z.directives===!0;if(Z.directives!==!1&&$.directives){let G=$.directives.toString($);if(G)X.push(G),z=!0;else if($.directives.docStart)z=!0}if(z)X.push("---");let J=I8.createStringifyContext($,Z),{commentString:Q}=J.options;if($.commentBefore){if(X.length!==1)X.unshift("");let G=Q($.commentBefore);X.unshift(d1.indentComment(G,""))}let Y=!1,U=null;if($.contents){if(tW.isNode($.contents)){if($.contents.spaceBefore&&z)X.push("");if($.contents.commentBefore){let q=Q($.contents.commentBefore);X.push(d1.indentComment(q,""))}J.forceBlockIndent=!!$.comment,U=$.contents.comment}let G=U?void 0:()=>Y=!0,W=I8.stringify($.contents,J,()=>U=null,G);if(U)W+=d1.lineComment(W,"",Q(U));if((W[0]==="|"||W[0]===">")&&X[X.length-1]==="---")X[X.length-1]=`--- ${W}`;else X.push(W)}else X.push(I8.stringify($.contents,J));if($.directives?.docEnd)if($.comment){let G=Q($.comment);if(G.includes(`
81
- `))X.push("..."),X.push(d1.indentComment(G,""));else X.push(`... ${G}`)}else X.push("...");else{let G=$.comment;if(G&&Y)G=G.replace(/^\n+/,"");if(G){if((!Y||U)&&X[X.length-1]!=="")X.push("");X.push(d1.indentComment(Q(G),""))}}return X.join(`
80
+ ${Q.comment}`:z.comment}z=J}$.items[X]=F2.isPair(z)?z:new q8.Pair(z)}else Z("Expected a sequence for this tag");return $}function r5($,Z,X){let{replacer:z}=X,J=new pG.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 U,G;if(Array.isArray(Y))if(Y.length===2)U=Y[0],G=Y[1];else throw TypeError(`Expected [key, value] tuple: ${Y}`);else if(Y&&Y instanceof Object){let W=Object.keys(Y);if(W.length===1)U=W[0],G=Y[U];else throw TypeError(`Expected tuple with one key, not ${W.length} keys`)}else U=Y;J.items.push(q8.createPair(U,G,X))}return J}var lG={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:n5,createNode:r5};iG.createPairs=r5;iG.pairs=lG;iG.resolvePairs=n5});var K8=F((tG)=>{var s5=d(),V8=$$(),l1=Q$(),aG=Y$(),a5=w2();class A$ extends aG.YAMLSeq{constructor(){super();this.add=l1.YAMLMap.prototype.add.bind(this),this.delete=l1.YAMLMap.prototype.delete.bind(this),this.get=l1.YAMLMap.prototype.get.bind(this),this.has=l1.YAMLMap.prototype.has.bind(this),this.set=l1.YAMLMap.prototype.set.bind(this),this.tag=A$.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(s5.isPair(z))J=V8.toJS(z.key,"",Z),Q=V8.toJS(z.value,J,Z);else J=V8.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=a5.createPairs($,Z,X),J=new this;return J.items=z.items,J}}A$.tag="tag:yaml.org,2002:omap";var oG={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:A$,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,Z){let X=a5.resolvePairs($,Z),z=[];for(let{key:J}of X.items)if(s5.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 A$,X)},createNode:($,Z,X)=>A$.from($,Z,X)};tG.YAMLOMap=A$;tG.omap=oG});var Z9=F((ZW)=>{var o5=Z0();function t5({value:$,source:Z},X){if(Z&&($?e5:$9).test.test(Z))return Z;return $?X.options.trueStr:X.options.falseStr}var e5={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new o5.Scalar(!0),stringify:t5},$9={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new o5.Scalar(!1),stringify:t5};ZW.falseTag=$9;ZW.trueTag=e5});var X9=F((GW)=>{var JW=Z0(),H8=p$(),QW={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:H8.stringifyNumber},YW={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():H8.stringifyNumber($)}},UW={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let Z=new JW.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:H8.stringifyNumber};GW.float=UW;GW.floatExp=YW;GW.floatNaN=QW});var J9=F((NW)=>{var z9=p$(),i1=($)=>typeof $==="bigint"||Number.isInteger($);function P2($,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 B8($,Z,X){let{value:z}=$;if(i1(z)){let J=z.toString(Z);return z<0?"-"+X+J.substr(1):X+J}return z9.stringifyNumber($)}var KW={identify:i1,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,Z,X)=>P2($,2,2,X),stringify:($)=>B8($,2,"0b")},HW={identify:i1,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,Z,X)=>P2($,1,8,X),stringify:($)=>B8($,8,"0")},BW={identify:i1,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,Z,X)=>P2($,0,10,X),stringify:z9.stringifyNumber},LW={identify:i1,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,Z,X)=>P2($,2,16,X),stringify:($)=>B8($,16,"0x")};NW.int=BW;NW.intBin=KW;NW.intHex=LW;NW.intOct=HW});var L8=F((AW)=>{var E2=d(),_2=z$(),C2=Q$();class R$ extends C2.YAMLMap{constructor($){super($);this.tag=R$.tag}add($){let Z;if(E2.isPair($))Z=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)Z=new _2.Pair($.key,null);else Z=new _2.Pair($,null);if(!C2.findPair(this.items,Z.key))this.items.push(Z)}get($,Z){let X=C2.findPair(this.items,$);return!Z&&E2.isPair(X)?E2.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=C2.findPair(this.items,$);if(X&&!Z)this.items.splice(this.items.indexOf(X),1);else if(!X&&Z)this.items.push(new _2.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(_2.createPair(Q,null,X))}return J}}R$.tag="tag:yaml.org,2002:set";var IW={collection:"map",identify:($)=>$ instanceof Set,nodeClass:R$,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,Z,X)=>R$.from($,Z,X),resolve($,Z){if(E2.isMap($))if($.hasAllNullValues(!0))return Object.assign(new R$,$);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return $}};AW.YAMLSet=R$;AW.set=IW});var M8=F((CW)=>{var wW=p$();function N8($,Z){let X=$[0],z=X==="-"||X==="+"?$.substring(1):$,J=(Y)=>Z?BigInt(Y):Number(Y),Q=z.replace(/_/g,"").split(":").reduce((Y,U)=>Y*J(60)+J(U),J(0));return X==="-"?J(-1)*Q:Q}function Q9($){let{value:Z}=$,X=(Y)=>Y;if(typeof Z==="bigint")X=(Y)=>BigInt(Y);else if(isNaN(Z)||!isFinite(Z))return wW.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 PW={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})=>N8($,X),stringify:Q9},_W={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:($)=>N8($,!1),stringify:Q9},Y9={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(Y9.test);if(!Z)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,X,z,J,Q,Y,U]=Z.map(Number),G=Z[7]?Number((Z[7]+"00").substr(1,3)):0,W=Date.UTC(X,z-1,J,Q||0,Y||0,U||0,G),q=Z[8];if(q&&q!=="Z"){let V=N8(q,!1);if(Math.abs(V)<30)V*=60;W-=60000*V}return new Date(W)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};CW.floatTime=_W;CW.intTime=PW;CW.timestamp=Y9});var G9=F((cW)=>{var bW=c$(),xW=I2(),kW=d$(),yW=d1(),fW=W8(),U9=Z9(),O8=X9(),j2=J9(),gW=H2(),vW=K8(),hW=w2(),uW=L8(),T8=M8(),mW=[bW.map,kW.seq,yW.string,xW.nullTag,U9.trueTag,U9.falseTag,j2.intBin,j2.intOct,j2.int,j2.intHex,O8.floatNaN,O8.floatExp,O8.float,fW.binary,gW.merge,vW.omap,hW.pairs,uW.set,T8.intTime,T8.floatTime,T8.timestamp];cW.schema=mW});var O9=F((oW)=>{var K9=c$(),pW=I2(),H9=d$(),lW=d1(),iW=Z8(),D8=z8(),I8=Q8(),nW=p5(),rW=i5(),B9=W8(),n1=H2(),L9=K8(),N9=w2(),W9=G9(),M9=L8(),S2=M8(),q9=new Map([["core",nW.schema],["failsafe",[K9.map,H9.seq,lW.string]],["json",rW.schema],["yaml11",W9.schema],["yaml-1.1",W9.schema]]),V9={binary:B9.binary,bool:iW.boolTag,float:D8.float,floatExp:D8.floatExp,floatNaN:D8.floatNaN,floatTime:S2.floatTime,int:I8.int,intHex:I8.intHex,intOct:I8.intOct,intTime:S2.intTime,map:K9.map,merge:n1.merge,null:pW.nullTag,omap:L9.omap,pairs:N9.pairs,seq:H9.seq,set:M9.set,timestamp:S2.timestamp},sW={"tag:yaml.org,2002:binary":B9.binary,"tag:yaml.org,2002:merge":n1.merge,"tag:yaml.org,2002:omap":L9.omap,"tag:yaml.org,2002:pairs":N9.pairs,"tag:yaml.org,2002:set":M9.set,"tag:yaml.org,2002:timestamp":S2.timestamp};function aW($,Z,X){let z=q9.get(Z);if(z&&!$)return X&&!z.includes(n1.merge)?z.concat(n1.merge):z.slice();let J=z;if(!J)if(Array.isArray($))J=[];else{let Q=Array.from(q9.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(n1.merge);return J.reduce((Q,Y)=>{let U=typeof Y==="string"?V9[Y]:Y;if(!U){let G=JSON.stringify(Y),W=Object.keys(V9).map((q)=>JSON.stringify(q)).join(", ");throw Error(`Unknown custom tag ${G}; use one of ${W}`)}if(!Q.includes(U))Q.push(U);return Q},[])}oW.coreKnownTags=sW;oW.getTags=aW});var F8=F((Jq)=>{var A8=d(),$q=c$(),Zq=d$(),Xq=d1(),b2=O9(),zq=($,Z)=>$.key<Z.key?-1:$.key>Z.key?1:0;class R8{constructor({compat:$,customTags:Z,merge:X,resolveKnownTags:z,schema:J,sortMapEntries:Q,toStringDefaults:Y}){this.compat=Array.isArray($)?b2.getTags($,"compat"):$?b2.getTags(null,$):null,this.name=typeof J==="string"&&J||"core",this.knownTags=z?b2.coreKnownTags:{},this.tags=b2.getTags(Z,this.name,X),this.toStringOptions=Y??null,Object.defineProperty(this,A8.MAP,{value:$q.map}),Object.defineProperty(this,A8.SCALAR,{value:Xq.string}),Object.defineProperty(this,A8.SEQ,{value:Zq.seq}),this.sortMapEntries=typeof Q==="function"?Q:Q===!0?zq:null}clone(){let $=Object.create(R8.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}Jq.Schema=R8});var T9=F((Gq)=>{var Yq=d(),w8=h1(),r1=f1();function Uq($,Z){let X=[],z=Z.directives===!0;if(Z.directives!==!1&&$.directives){let G=$.directives.toString($);if(G)X.push(G),z=!0;else if($.directives.docStart)z=!0}if(z)X.push("---");let J=w8.createStringifyContext($,Z),{commentString:Q}=J.options;if($.commentBefore){if(X.length!==1)X.unshift("");let G=Q($.commentBefore);X.unshift(r1.indentComment(G,""))}let Y=!1,U=null;if($.contents){if(Yq.isNode($.contents)){if($.contents.spaceBefore&&z)X.push("");if($.contents.commentBefore){let q=Q($.contents.commentBefore);X.push(r1.indentComment(q,""))}J.forceBlockIndent=!!$.comment,U=$.contents.comment}let G=U?void 0:()=>Y=!0,W=w8.stringify($.contents,J,()=>U=null,G);if(U)W+=r1.lineComment(W,"",Q(U));if((W[0]==="|"||W[0]===">")&&X[X.length-1]==="---")X[X.length-1]=`--- ${W}`;else X.push(W)}else X.push(w8.stringify($.contents,J));if($.directives?.docEnd)if($.comment){let G=Q($.comment);if(G.includes(`
81
+ `))X.push("..."),X.push(r1.indentComment(G,""));else X.push(`... ${G}`)}else X.push("...");else{let G=$.comment;if(G&&Y)G=G.replace(/^\n+/,"");if(G){if((!Y||U)&&X[X.length-1]!=="")X.push("");X.push(r1.indentComment(Q(G),""))}}return X.join(`
82
82
  `)+`
83
- `}$q.stringifyDocument=eW});var p1=R((Wq)=>{var Xq=E1(),c$=X2(),P0=c(),zq=e0(),Jq=a0(),Qq=D8(),Yq=L9(),A8=e4(),Uq=m6(),Gq=j1(),R8=u6();class F8{constructor($,Z,X){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,P0.NODE_TYPE,{value:P0.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 R8.Directives({version:Q});this.setSchema(Q,X),this.contents=$===void 0?null:this.createNode($,z,X)}clone(){let $=Object.create(F8.prototype,{[P0.NODE_TYPE]:{value:P0.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=P0.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(d$(this.contents))this.contents.add($)}addIn($,Z){if(d$(this.contents))this.contents.addIn($,Z)}createAlias($,Z){if(!$.anchor){let X=A8.anchorNames(this);$.anchor=!Z||X.has(Z)?A8.findNewAnchor(Z||"a",X):Z}return new Xq.Alias($.anchor)}createNode($,Z,X){let z=void 0;if(typeof Z==="function")$=Z.call({"":$},"",$),z=Z;else if(Array.isArray(Z)){let N=(P)=>typeof P==="number"||P instanceof String||P instanceof Number,M=Z.filter(N).map(String);if(M.length>0)Z=Z.concat(M);z=Z}else if(X===void 0&&Z)X=Z,Z=void 0;let{aliasDuplicateObjects:J,anchorPrefix:Q,flow:Y,keepUndefined:U,onTagObj:G,tag:W}=X??{},{onAnchor:q,setAnchors:V,sourceObjects:K}=A8.createNodeAnchors(this,Q||"a"),H={aliasDuplicateObjects:J??!0,keepUndefined:U??!1,onAnchor:q,onTagObj:G,replacer:z,schema:this.schema,sourceObjects:K},T=Gq.createNode($,W,H);if(Y&&P0.isCollection(T))T.flow=!0;return V(),T}createPair($,Z,X={}){let z=this.createNode($,null,X),J=this.createNode(Z,null,X);return new zq.Pair(z,J)}delete($){return d$(this.contents)?this.contents.delete($):!1}deleteIn($){if(c$.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return d$(this.contents)?this.contents.deleteIn($):!1}get($,Z){return P0.isCollection(this.contents)?this.contents.get($,Z):void 0}getIn($,Z){if(c$.isEmptyPath($))return!Z&&P0.isScalar(this.contents)?this.contents.value:this.contents;return P0.isCollection(this.contents)?this.contents.getIn($,Z):void 0}has($){return P0.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(c$.isEmptyPath($))return this.contents!==void 0;return P0.isCollection(this.contents)?this.contents.hasIn($):!1}set($,Z){if(this.contents==null)this.contents=c$.collectionFromPath(this.schema,[$],Z);else if(d$(this.contents))this.contents.set($,Z)}setIn($,Z){if(c$.isEmptyPath($))this.contents=Z;else if(this.contents==null)this.contents=c$.collectionFromPath(this.schema,Array.from($),Z);else if(d$(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 R8.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 R8.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 Qq.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},U=Jq.toJS(this.contents,Z??"",Y);if(typeof J==="function")for(let{count:G,res:W}of Y.anchors.values())J(W,G);return typeof Q==="function"?Uq.applyReviver(Q,{"":U},"",U):U}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 Yq.stringifyDocument(this,$)}}function d$($){if(P0.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}Wq.Document=F8});var l1=R((Kq)=>{class C2 extends Error{constructor($,Z,X,z){super();this.name=$,this.code=X,this.message=z,this.pos=Z}}class N9 extends C2{constructor($,Z,X){super("YAMLParseError",$,Z,X)}}class M9 extends C2{constructor($,Z,X){super("YAMLWarning",$,Z,X)}}var Vq=($,Z)=>(X)=>{if(X.pos[0]===-1)return;X.linePos=X.pos.map((U)=>Z.linePos(U));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 U=Math.min(Q-39,Y.length-79);Y="…"+Y.substring(U),Q-=U-1}if(Y.length>80)Y=Y.substring(0,79)+"…";if(z>1&&/^ *$/.test(Y.substring(0,Q))){let U=$.substring(Z.lineStarts[z-2],Z.lineStarts[z-1]);if(U.length>80)U=U.substring(0,79)+`…
83
+ `}Gq.stringifyDocument=Uq});var s1=F((Mq)=>{var qq=k1(),l$=U2(),C0=d(),Vq=z$(),Kq=$$(),Hq=F8(),Bq=T9(),P8=J2(),Lq=l6(),Nq=y1(),_8=p6();class C8{constructor($,Z,X){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,C0.NODE_TYPE,{value:C0.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 _8.Directives({version:Q});this.setSchema(Q,X),this.contents=$===void 0?null:this.createNode($,z,X)}clone(){let $=Object.create(C8.prototype,{[C0.NODE_TYPE]:{value:C0.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=C0.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(i$(this.contents))this.contents.add($)}addIn($,Z){if(i$(this.contents))this.contents.addIn($,Z)}createAlias($,Z){if(!$.anchor){let X=P8.anchorNames(this);$.anchor=!Z||X.has(Z)?P8.findNewAnchor(Z||"a",X):Z}return new qq.Alias($.anchor)}createNode($,Z,X){let z=void 0;if(typeof Z==="function")$=Z.call({"":$},"",$),z=Z;else if(Array.isArray(Z)){let N=(P)=>typeof P==="number"||P instanceof String||P instanceof Number,M=Z.filter(N).map(String);if(M.length>0)Z=Z.concat(M);z=Z}else if(X===void 0&&Z)X=Z,Z=void 0;let{aliasDuplicateObjects:J,anchorPrefix:Q,flow:Y,keepUndefined:U,onTagObj:G,tag:W}=X??{},{onAnchor:q,setAnchors:V,sourceObjects:K}=P8.createNodeAnchors(this,Q||"a"),B={aliasDuplicateObjects:J??!0,keepUndefined:U??!1,onAnchor:q,onTagObj:G,replacer:z,schema:this.schema,sourceObjects:K},T=Nq.createNode($,W,B);if(Y&&C0.isCollection(T))T.flow=!0;return V(),T}createPair($,Z,X={}){let z=this.createNode($,null,X),J=this.createNode(Z,null,X);return new Vq.Pair(z,J)}delete($){return i$(this.contents)?this.contents.delete($):!1}deleteIn($){if(l$.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return i$(this.contents)?this.contents.deleteIn($):!1}get($,Z){return C0.isCollection(this.contents)?this.contents.get($,Z):void 0}getIn($,Z){if(l$.isEmptyPath($))return!Z&&C0.isScalar(this.contents)?this.contents.value:this.contents;return C0.isCollection(this.contents)?this.contents.getIn($,Z):void 0}has($){return C0.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(l$.isEmptyPath($))return this.contents!==void 0;return C0.isCollection(this.contents)?this.contents.hasIn($):!1}set($,Z){if(this.contents==null)this.contents=l$.collectionFromPath(this.schema,[$],Z);else if(i$(this.contents))this.contents.set($,Z)}setIn($,Z){if(l$.isEmptyPath($))this.contents=Z;else if(this.contents==null)this.contents=l$.collectionFromPath(this.schema,Array.from($),Z);else if(i$(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 _8.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 _8.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 Hq.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},U=Kq.toJS(this.contents,Z??"",Y);if(typeof J==="function")for(let{count:G,res:W}of Y.anchors.values())J(W,G);return typeof Q==="function"?Lq.applyReviver(Q,{"":U},"",U):U}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 Bq.stringifyDocument(this,$)}}function i$($){if(C0.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}Mq.Document=C8});var a1=F((Dq)=>{class x2 extends Error{constructor($,Z,X,z){super();this.name=$,this.code=X,this.message=z,this.pos=Z}}class D9 extends x2{constructor($,Z,X){super("YAMLParseError",$,Z,X)}}class I9 extends x2{constructor($,Z,X){super("YAMLWarning",$,Z,X)}}var Tq=($,Z)=>(X)=>{if(X.pos[0]===-1)return;X.linePos=X.pos.map((U)=>Z.linePos(U));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 U=Math.min(Q-39,Y.length-79);Y="…"+Y.substring(U),Q-=U-1}if(Y.length>80)Y=Y.substring(0,79)+"…";if(z>1&&/^ *$/.test(Y.substring(0,Q))){let U=$.substring(Z.lineStarts[z-2],Z.lineStarts[z-1]);if(U.length>80)U=U.substring(0,79)+`…
84
84
  `;Y=U+Y}if(/[^ ]/.test(Y)){let U=1,G=X.linePos[1];if(G?.line===z&&G.col>J)U=Math.max(1,Math.min(G.col-J,80-Q));let W=" ".repeat(Q)+"^".repeat(U);X.message+=`:
85
85
 
86
86
  ${Y}
87
87
  ${W}
88
- `}};Kq.YAMLError=C2;Kq.YAMLParseError=N9;Kq.YAMLWarning=M9;Kq.prettifyError=Vq});var i1=R((Oq)=>{function Mq($,{flow:Z,indicator:X,next:z,offset:J,onError:Q,parentIndent:Y,startOnNewline:U}){let G=!1,W=U,q=U,V="",K="",H=!1,T=!1,N=null,M=null,P=null,_=null,j=null,x=null,k=null;for(let A of $){if(T){if(A.type!=="space"&&A.type!=="newline"&&A.type!=="comma")Q(A.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");T=!1}if(N){if(W&&A.type!=="comment"&&A.type!=="newline")Q(N,"TAB_AS_INDENT","Tabs are not allowed as indentation");N=null}switch(A.type){case"space":if(!Z&&(X!=="doc-start"||z?.type!=="flow-collection")&&A.source.includes("\t"))N=A;q=!0;break;case"comment":{if(!q)Q(A,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=A.source.substring(1)||" ";if(!V)V=u;else V+=K+u;K="",W=!1;break}case"newline":if(W){if(V)V+=A.source;else if(!x||X!=="seq-item-ind")G=!0}else K+=A.source;if(W=!0,H=!0,M||P)_=A;q=!0;break;case"anchor":if(M)Q(A,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(A.source.endsWith(":"))Q(A.offset+A.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);M=A,k??(k=A.offset),W=!1,q=!1,T=!0;break;case"tag":{if(P)Q(A,"MULTIPLE_TAGS","A node can have at most one tag");P=A,k??(k=A.offset),W=!1,q=!1,T=!0;break}case X:if(M||P)Q(A,"BAD_PROP_ORDER",`Anchors and tags must be after the ${A.source} indicator`);if(x)Q(A,"UNEXPECTED_TOKEN",`Unexpected ${A.source} in ${Z??"collection"}`);x=A,W=X==="seq-item-ind"||X==="explicit-key-ind",q=!1;break;case"comma":if(Z){if(j)Q(A,"UNEXPECTED_TOKEN",`Unexpected , in ${Z}`);j=A,W=!1,q=!1;break}default:Q(A,"UNEXPECTED_TOKEN",`Unexpected ${A.type} token`),W=!1,q=!1}}let y=$[$.length-1],p=y?y.offset+y.source.length:J;if(T&&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&&(W&&N.indent<=Y||z?.type==="block-map"||z?.type==="block-seq"))Q(N,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:j,found:x,spaceBefore:G,comment:V,hasNewline:H,anchor:M,tag:P,newlineAfterProp:_,end:p,start:k??p}}Oq.resolveProps=Mq});var E2=R((Dq)=>{function w8($){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(w8(Z.key)||w8(Z.value))return!0}return!1;default:return!0}}Dq.containsNewline=w8});var P8=R((Fq)=>{var Aq=E2();function Rq($,Z,X){if(Z?.type==="flow-collection"){let z=Z.end[0];if(z.indent===$&&(z.source==="]"||z.source==="}")&&Aq.containsNewline(Z))X(z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Fq.flowIndentCheck=Rq});var _8=R((_q)=>{var O9=c();function Pq($,Z,X){let{uniqueKeys:z}=$.options;if(z===!1)return!1;let J=typeof z==="function"?z:(Q,Y)=>Q===Y||O9.isScalar(Q)&&O9.isScalar(Y)&&Q.value===Y.value;return Z.some((Q)=>J(Q.key,X))}_q.mapIncludes=Pq});var R9=R((xq)=>{var T9=e0(),Eq=Z$(),D9=i1(),jq=E2(),I9=P8(),Sq=_8(),A9="All mapping items must start at the same column";function bq({composeNode:$,composeEmptyNode:Z},X,z,J,Q){let U=new(Q?.nodeClass??Eq.YAMLMap)(X.schema);if(X.atRoot)X.atRoot=!1;let G=z.offset,W=null;for(let q of z.items){let{start:V,key:K,sep:H,value:T}=q,N=D9.resolveProps(V,{indicator:"explicit-key-ind",next:K??H?.[0],offset:G,onError:J,parentIndent:z.indent,startOnNewline:!0}),M=!N.found;if(M){if(K){if(K.type==="block-seq")J(G,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in K&&K.indent!==z.indent)J(G,"BAD_INDENT",A9)}if(!N.anchor&&!N.tag&&!H){if(W=N.end,N.comment)if(U.comment)U.comment+=`
90
- `+N.comment;else U.comment=N.comment;continue}if(N.newlineAfterProp||jq.containsNewline(K))J(K??V[V.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(N.found?.indent!==z.indent)J(G,"BAD_INDENT",A9);X.atKey=!0;let P=N.end,_=K?$(X,K,N,J):Z(X,P,V,null,N,J);if(X.schema.compat)I9.flowIndentCheck(z.indent,K,J);if(X.atKey=!1,Sq.mapIncludes(X,U.items,_))J(P,"DUPLICATE_KEY","Map keys must be unique");let j=D9.resolveProps(H??[],{indicator:"map-value-ind",next:T,offset:_.range[2],onError:J,parentIndent:z.indent,startOnNewline:!K||K.type==="block-scalar"});if(G=j.end,j.found){if(M){if(T?.type==="block-map"&&!j.hasNewline)J(G,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(X.options.strict&&N.start<j.found.offset-1024)J(_.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let x=T?$(X,T,j,J):Z(X,G,H,null,j,J);if(X.schema.compat)I9.flowIndentCheck(z.indent,T,J);G=x.range[2];let k=new T9.Pair(_,x);if(X.options.keepSourceTokens)k.srcToken=q;U.items.push(k)}else{if(M)J(_.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(j.comment)if(_.comment)_.comment+=`
91
- `+j.comment;else _.comment=j.comment;let x=new T9.Pair(_);if(X.options.keepSourceTokens)x.srcToken=q;U.items.push(x)}}if(W&&W<G)J(W,"IMPOSSIBLE","Map comment with trailing content");return U.range=[z.offset,G,W??G],U}xq.resolveBlockMap=bq});var F9=R((vq)=>{var yq=X$(),fq=i1(),gq=P8();function hq({composeNode:$,composeEmptyNode:Z},X,z,J,Q){let U=new(Q?.nodeClass??yq.YAMLSeq)(X.schema);if(X.atRoot)X.atRoot=!1;if(X.atKey)X.atKey=!1;let G=z.offset,W=null;for(let{start:q,value:V}of z.items){let K=fq.resolveProps(q,{indicator:"seq-item-ind",next:V,offset:G,onError:J,parentIndent:z.indent,startOnNewline:!0});if(!K.found)if(K.anchor||K.tag||V)if(V?.type==="block-seq")J(K.end,"BAD_INDENT","All sequence items must start at the same column");else J(G,"MISSING_CHAR","Sequence item without - indicator");else{if(W=K.end,K.comment)U.comment=K.comment;continue}let H=V?$(X,V,K,J):Z(X,K.end,q,null,K,J);if(X.schema.compat)gq.flowIndentCheck(z.indent,V,J);G=H.range[2],U.items.push(H)}return U.range=[z.offset,G,W??G],U}vq.resolveBlockSeq=hq});var p$=R((cq)=>{function mq($,Z,X,z){let J="";if($){let Q=!1,Y="";for(let U of $){let{source:G,type:W}=U;switch(W){case"space":Q=!0;break;case"comment":{if(X&&!Q)z(U,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let q=G.substring(1)||" ";if(!J)J=q;else J+=Y+q;Y="";break}case"newline":if(J)Y+=G;Q=!0;break;default:z(U,"UNEXPECTED_TOKEN",`Unexpected ${W} at node end`)}Z+=G.length}}return{comment:J,offset:Z}}cq.resolveEnd=mq});var _9=R((oq)=>{var pq=c(),lq=e0(),w9=Z$(),iq=X$(),nq=p$(),P9=i1(),rq=E2(),sq=_8(),C8="Block collections are not allowed within flow collections",E8=($)=>$&&($.type==="block-map"||$.type==="block-seq");function aq({composeNode:$,composeEmptyNode:Z},X,z,J,Q){let Y=z.start.source==="{",U=Y?"flow map":"flow sequence",W=new(Q?.nodeClass??(Y?w9.YAMLMap:iq.YAMLSeq))(X.schema);W.flow=!0;let q=X.atRoot;if(q)X.atRoot=!1;if(X.atKey)X.atKey=!1;let V=z.offset+z.start.source.length;for(let M=0;M<z.items.length;++M){let P=z.items[M],{start:_,key:j,sep:x,value:k}=P,y=P9.resolveProps(_,{flow:U,indicator:"explicit-key-ind",next:j??x?.[0],offset:V,onError:J,parentIndent:z.indent,startOnNewline:!1});if(!y.found){if(!y.anchor&&!y.tag&&!x&&!k){if(M===0&&y.comma)J(y.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${U}`);else if(M<z.items.length-1)J(y.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${U}`);if(y.comment)if(W.comment)W.comment+=`
92
- `+y.comment;else W.comment=y.comment;V=y.end;continue}if(!Y&&X.options.strict&&rq.containsNewline(j))J(j,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(M===0){if(y.comma)J(y.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${U}`)}else{if(!y.comma)J(y.start,"MISSING_CHAR",`Missing , between ${U} items`);if(y.comment){let p="";$:for(let A of _)switch(A.type){case"comma":case"space":break;case"comment":p=A.source.substring(1);break $;default:break $}if(p){let A=W.items[W.items.length-1];if(pq.isPair(A))A=A.value??A.key;if(A.comment)A.comment+=`
93
- `+p;else A.comment=p;y.comment=y.comment.substring(p.length+1)}}}if(!Y&&!x&&!y.found){let p=k?$(X,k,y,J):Z(X,y.end,x,null,y,J);if(W.items.push(p),V=p.range[2],E8(k))J(p.range,"BLOCK_IN_FLOW",C8)}else{X.atKey=!0;let p=y.end,A=j?$(X,j,y,J):Z(X,p,_,null,y,J);if(E8(j))J(A.range,"BLOCK_IN_FLOW",C8);X.atKey=!1;let u=P9.resolveProps(x??[],{flow:U,indicator:"map-value-ind",next:k,offset:A.range[2],onError:J,parentIndent:z.indent,startOnNewline:!1});if(u.found){if(!Y&&!y.found&&X.options.strict){if(x)for(let e of x){if(e===u.found)break;if(e.type==="newline"){J(e,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(y.start<u.found.offset-1024)J(u.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(k)if("source"in k&&k.source?.[0]===":")J(k,"MISSING_CHAR",`Missing space after : in ${U}`);else J(u.start,"MISSING_CHAR",`Missing , or : between ${U} items`);let k0=k?$(X,k,u,J):u.found?Z(X,u.end,x,null,u,J):null;if(k0){if(E8(k))J(k0.range,"BLOCK_IN_FLOW",C8)}else if(u.comment)if(A.comment)A.comment+=`
94
- `+u.comment;else A.comment=u.comment;let y0=new lq.Pair(A,k0);if(X.options.keepSourceTokens)y0.srcToken=P;if(Y){let e=W;if(sq.mapIncludes(X,e.items,A))J(p,"DUPLICATE_KEY","Map keys must be unique");e.items.push(y0)}else{let e=new w9.YAMLMap(X.schema);e.flow=!0,e.items.push(y0);let w1=(k0??A).range;e.range=[A.range[0],w1[1],w1[2]],W.items.push(e)}V=k0?k0.range[2]:u.end}}let K=Y?"}":"]",[H,...T]=z.end,N=V;if(H?.source===K)N=H.offset+H.source.length;else{let M=U[0].toUpperCase()+U.substring(1),P=q?`${M} must end with a ${K}`:`${M} in block collection must be sufficiently indented and end with a ${K}`;if(J(V,q?"MISSING_CHAR":"BAD_INDENT",P),H&&H.source.length!==1)T.unshift(H)}if(T.length>0){let M=nq.resolveEnd(T,N,X.options.strict,J);if(M.comment)if(W.comment)W.comment+=`
95
- `+M.comment;else W.comment=M.comment;W.range=[z.offset,N,M.offset]}else W.range=[z.offset,N,N];return W}oq.resolveFlowCollection=aq});var C9=R((UV)=>{var eq=c(),$V=Z0(),ZV=Z$(),XV=X$(),zV=R9(),JV=F9(),QV=_9();function j8($,Z,X,z,J,Q){let Y=X.type==="block-map"?zV.resolveBlockMap($,Z,X,z,Q):X.type==="block-seq"?JV.resolveBlockSeq($,Z,X,z,Q):QV.resolveFlowCollection($,Z,X,z,Q),U=Y.constructor;if(J==="!"||J===U.tagName)return Y.tag=U.tagName,Y;if(J)Y.tag=J;return Y}function YV($,Z,X,z,J){let Q=z.tag,Y=!Q?null:Z.directives.tagName(Q.source,(K)=>J(Q,"TAG_RESOLVE_FAILED",K));if(X.type==="block-seq"){let{anchor:K,newlineAfterProp:H}=z,T=K&&Q?K.offset>Q.offset?K:Q:K??Q;if(T&&(!H||H.offset<T.offset))J(T,"MISSING_CHAR","Missing newline after block sequence props")}let U=X.type==="block-map"?"map":X.type==="block-seq"?"seq":X.start.source==="{"?"map":"seq";if(!Q||!Y||Y==="!"||Y===ZV.YAMLMap.tagName&&U==="map"||Y===XV.YAMLSeq.tagName&&U==="seq")return j8($,Z,X,J,Y);let G=Z.schema.tags.find((K)=>K.tag===Y&&K.collection===U);if(!G){let K=Z.schema.knownTags[Y];if(K?.collection===U)Z.schema.tags.push(Object.assign({},K,{default:!1})),G=K;else{if(K)J(Q,"BAD_COLLECTION_TYPE",`${K.tag} used for ${U} collection, but expects ${K.collection??"scalar"}`,!0);else J(Q,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Y}`,!0);return j8($,Z,X,J,Y)}}let W=j8($,Z,X,J,Y,G),q=G.resolve?.(W,(K)=>J(Q,"TAG_RESOLVE_FAILED",K),Z.options)??W,V=eq.isNode(q)?q:new $V.Scalar(q);if(V.range=W.range,V.tag=Y,G?.format)V.format=G.format;return V}UV.composeCollection=YV});var b8=R((KV)=>{var S8=Z0();function WV($,Z,X){let z=Z.offset,J=qV(Z,$.options.strict,X);if(!J)return{value:"",type:null,comment:"",range:[z,z,z]};let Q=J.mode===">"?S8.Scalar.BLOCK_FOLDED:S8.Scalar.BLOCK_LITERAL,Y=Z.source?VV(Z.source):[],U=Y.length;for(let N=Y.length-1;N>=0;--N){let M=Y[N][1];if(M===""||M==="\r")U=N;else break}if(U===0){let N=J.chomp==="+"&&Y.length>0?`
96
- `.repeat(Math.max(1,Y.length-1)):"",M=z+J.length;if(Z.source)M+=Z.source.length;return{value:N,type:Q,comment:J.comment,range:[z,M,M]}}let G=Z.indent+J.indent,W=Z.offset+J.length,q=0;for(let N=0;N<U;++N){let[M,P]=Y[N];if(P===""||P==="\r"){if(J.indent===0&&M.length>G)G=M.length}else{if(M.length<G)X(W+M.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(J.indent===0)G=M.length;if(q=N,G===0&&!$.atRoot)X(W,"BAD_INDENT","Block scalar values in collections must be indented");break}W+=M.length+P.length+1}for(let N=Y.length-1;N>=U;--N)if(Y[N][0].length>G)U=N+1;let V="",K="",H=!1;for(let N=0;N<q;++N)V+=Y[N][0].slice(G)+`
97
- `;for(let N=q;N<U;++N){let[M,P]=Y[N];W+=M.length+P.length+1;let _=P[P.length-1]==="\r";if(_)P=P.slice(0,-1);if(P&&M.length<G){let x=`Block scalar lines must not be less indented than their ${J.indent?"explicit indentation indicator":"first line"}`;X(W-P.length-(_?2:1),"BAD_INDENT",x),M=""}if(Q===S8.Scalar.BLOCK_LITERAL)V+=K+M.slice(G)+P,K=`
88
+ `}};Dq.YAMLError=x2;Dq.YAMLParseError=D9;Dq.YAMLWarning=I9;Dq.prettifyError=Tq});var o1=F((Pq)=>{function wq($,{flow:Z,indicator:X,next:z,offset:J,onError:Q,parentIndent:Y,startOnNewline:U}){let G=!1,W=U,q=U,V="",K="",B=!1,T=!1,N=null,M=null,P=null,_=null,j=null,x=null,k=null;for(let R of $){if(T){if(R.type!=="space"&&R.type!=="newline"&&R.type!=="comma")Q(R.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");T=!1}if(N){if(W&&R.type!=="comment"&&R.type!=="newline")Q(N,"TAB_AS_INDENT","Tabs are not allowed as indentation");N=null}switch(R.type){case"space":if(!Z&&(X!=="doc-start"||z?.type!=="flow-collection")&&R.source.includes("\t"))N=R;q=!0;break;case"comment":{if(!q)Q(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=R.source.substring(1)||" ";if(!V)V=u;else V+=K+u;K="",W=!1;break}case"newline":if(W){if(V)V+=R.source;else if(!x||X!=="seq-item-ind")G=!0}else K+=R.source;if(W=!0,B=!0,M||P)_=R;q=!0;break;case"anchor":if(M)Q(R,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(R.source.endsWith(":"))Q(R.offset+R.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);M=R,k??(k=R.offset),W=!1,q=!1,T=!0;break;case"tag":{if(P)Q(R,"MULTIPLE_TAGS","A node can have at most one tag");P=R,k??(k=R.offset),W=!1,q=!1,T=!0;break}case X:if(M||P)Q(R,"BAD_PROP_ORDER",`Anchors and tags must be after the ${R.source} indicator`);if(x)Q(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${Z??"collection"}`);x=R,W=X==="seq-item-ind"||X==="explicit-key-ind",q=!1;break;case"comma":if(Z){if(j)Q(R,"UNEXPECTED_TOKEN",`Unexpected , in ${Z}`);j=R,W=!1,q=!1;break}default:Q(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),W=!1,q=!1}}let y=$[$.length-1],p=y?y.offset+y.source.length:J;if(T&&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&&(W&&N.indent<=Y||z?.type==="block-map"||z?.type==="block-seq"))Q(N,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:j,found:x,spaceBefore:G,comment:V,hasNewline:B,anchor:M,tag:P,newlineAfterProp:_,end:p,start:k??p}}Pq.resolveProps=wq});var k2=F((Cq)=>{function E8($){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(E8(Z.key)||E8(Z.value))return!0}return!1;default:return!0}}Cq.containsNewline=E8});var j8=F((bq)=>{var jq=k2();function Sq($,Z,X){if(Z?.type==="flow-collection"){let z=Z.end[0];if(z.indent===$&&(z.source==="]"||z.source==="}")&&jq.containsNewline(Z))X(z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}bq.flowIndentCheck=Sq});var S8=F((yq)=>{var A9=d();function kq($,Z,X){let{uniqueKeys:z}=$.options;if(z===!1)return!1;let J=typeof z==="function"?z:(Q,Y)=>Q===Y||A9.isScalar(Q)&&A9.isScalar(Y)&&Q.value===Y.value;return Z.some((Q)=>J(Q.key,X))}yq.mapIncludes=kq});var _9=F((mq)=>{var R9=z$(),gq=Q$(),F9=o1(),vq=k2(),w9=j8(),hq=S8(),P9="All mapping items must start at the same column";function uq({composeNode:$,composeEmptyNode:Z},X,z,J,Q){let U=new(Q?.nodeClass??gq.YAMLMap)(X.schema);if(X.atRoot)X.atRoot=!1;let G=z.offset,W=null;for(let q of z.items){let{start:V,key:K,sep:B,value:T}=q,N=F9.resolveProps(V,{indicator:"explicit-key-ind",next:K??B?.[0],offset:G,onError:J,parentIndent:z.indent,startOnNewline:!0}),M=!N.found;if(M){if(K){if(K.type==="block-seq")J(G,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in K&&K.indent!==z.indent)J(G,"BAD_INDENT",P9)}if(!N.anchor&&!N.tag&&!B){if(W=N.end,N.comment)if(U.comment)U.comment+=`
90
+ `+N.comment;else U.comment=N.comment;continue}if(N.newlineAfterProp||vq.containsNewline(K))J(K??V[V.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(N.found?.indent!==z.indent)J(G,"BAD_INDENT",P9);X.atKey=!0;let P=N.end,_=K?$(X,K,N,J):Z(X,P,V,null,N,J);if(X.schema.compat)w9.flowIndentCheck(z.indent,K,J);if(X.atKey=!1,hq.mapIncludes(X,U.items,_))J(P,"DUPLICATE_KEY","Map keys must be unique");let j=F9.resolveProps(B??[],{indicator:"map-value-ind",next:T,offset:_.range[2],onError:J,parentIndent:z.indent,startOnNewline:!K||K.type==="block-scalar"});if(G=j.end,j.found){if(M){if(T?.type==="block-map"&&!j.hasNewline)J(G,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(X.options.strict&&N.start<j.found.offset-1024)J(_.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let x=T?$(X,T,j,J):Z(X,G,B,null,j,J);if(X.schema.compat)w9.flowIndentCheck(z.indent,T,J);G=x.range[2];let k=new R9.Pair(_,x);if(X.options.keepSourceTokens)k.srcToken=q;U.items.push(k)}else{if(M)J(_.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(j.comment)if(_.comment)_.comment+=`
91
+ `+j.comment;else _.comment=j.comment;let x=new R9.Pair(_);if(X.options.keepSourceTokens)x.srcToken=q;U.items.push(x)}}if(W&&W<G)J(W,"IMPOSSIBLE","Map comment with trailing content");return U.range=[z.offset,G,W??G],U}mq.resolveBlockMap=uq});var C9=F((nq)=>{var dq=Y$(),pq=o1(),lq=j8();function iq({composeNode:$,composeEmptyNode:Z},X,z,J,Q){let U=new(Q?.nodeClass??dq.YAMLSeq)(X.schema);if(X.atRoot)X.atRoot=!1;if(X.atKey)X.atKey=!1;let G=z.offset,W=null;for(let{start:q,value:V}of z.items){let K=pq.resolveProps(q,{indicator:"seq-item-ind",next:V,offset:G,onError:J,parentIndent:z.indent,startOnNewline:!0});if(!K.found)if(K.anchor||K.tag||V)if(V?.type==="block-seq")J(K.end,"BAD_INDENT","All sequence items must start at the same column");else J(G,"MISSING_CHAR","Sequence item without - indicator");else{if(W=K.end,K.comment)U.comment=K.comment;continue}let B=V?$(X,V,K,J):Z(X,K.end,q,null,K,J);if(X.schema.compat)lq.flowIndentCheck(z.indent,V,J);G=B.range[2],U.items.push(B)}return U.range=[z.offset,G,W??G],U}nq.resolveBlockSeq=iq});var n$=F((aq)=>{function sq($,Z,X,z){let J="";if($){let Q=!1,Y="";for(let U of $){let{source:G,type:W}=U;switch(W){case"space":Q=!0;break;case"comment":{if(X&&!Q)z(U,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let q=G.substring(1)||" ";if(!J)J=q;else J+=Y+q;Y="";break}case"newline":if(J)Y+=G;Q=!0;break;default:z(U,"UNEXPECTED_TOKEN",`Unexpected ${W} at node end`)}Z+=G.length}}return{comment:J,offset:Z}}aq.resolveEnd=sq});var S9=F((QV)=>{var tq=d(),eq=z$(),E9=Q$(),$V=Y$(),ZV=n$(),j9=o1(),XV=k2(),zV=S8(),b8="Block collections are not allowed within flow collections",x8=($)=>$&&($.type==="block-map"||$.type==="block-seq");function JV({composeNode:$,composeEmptyNode:Z},X,z,J,Q){let Y=z.start.source==="{",U=Y?"flow map":"flow sequence",W=new(Q?.nodeClass??(Y?E9.YAMLMap:$V.YAMLSeq))(X.schema);W.flow=!0;let q=X.atRoot;if(q)X.atRoot=!1;if(X.atKey)X.atKey=!1;let V=z.offset+z.start.source.length;for(let M=0;M<z.items.length;++M){let P=z.items[M],{start:_,key:j,sep:x,value:k}=P,y=j9.resolveProps(_,{flow:U,indicator:"explicit-key-ind",next:j??x?.[0],offset:V,onError:J,parentIndent:z.indent,startOnNewline:!1});if(!y.found){if(!y.anchor&&!y.tag&&!x&&!k){if(M===0&&y.comma)J(y.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${U}`);else if(M<z.items.length-1)J(y.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${U}`);if(y.comment)if(W.comment)W.comment+=`
92
+ `+y.comment;else W.comment=y.comment;V=y.end;continue}if(!Y&&X.options.strict&&XV.containsNewline(j))J(j,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(M===0){if(y.comma)J(y.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${U}`)}else{if(!y.comma)J(y.start,"MISSING_CHAR",`Missing , between ${U} items`);if(y.comment){let p="";$:for(let R of _)switch(R.type){case"comma":case"space":break;case"comment":p=R.source.substring(1);break $;default:break $}if(p){let R=W.items[W.items.length-1];if(tq.isPair(R))R=R.value??R.key;if(R.comment)R.comment+=`
93
+ `+p;else R.comment=p;y.comment=y.comment.substring(p.length+1)}}}if(!Y&&!x&&!y.found){let p=k?$(X,k,y,J):Z(X,y.end,x,null,y,J);if(W.items.push(p),V=p.range[2],x8(k))J(p.range,"BLOCK_IN_FLOW",b8)}else{X.atKey=!0;let p=y.end,R=j?$(X,j,y,J):Z(X,p,_,null,y,J);if(x8(j))J(R.range,"BLOCK_IN_FLOW",b8);X.atKey=!1;let u=j9.resolveProps(x??[],{flow:U,indicator:"map-value-ind",next:k,offset:R.range[2],onError:J,parentIndent:z.indent,startOnNewline:!1});if(u.found){if(!Y&&!y.found&&X.options.strict){if(x)for(let e of x){if(e===u.found)break;if(e.type==="newline"){J(e,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(y.start<u.found.offset-1024)J(u.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(k)if("source"in k&&k.source?.[0]===":")J(k,"MISSING_CHAR",`Missing space after : in ${U}`);else J(u.start,"MISSING_CHAR",`Missing , or : between ${U} items`);let f0=k?$(X,k,u,J):u.found?Z(X,u.end,x,null,u,J):null;if(f0){if(x8(k))J(f0.range,"BLOCK_IN_FLOW",b8)}else if(u.comment)if(R.comment)R.comment+=`
94
+ `+u.comment;else R.comment=u.comment;let g0=new eq.Pair(R,f0);if(X.options.keepSourceTokens)g0.srcToken=P;if(Y){let e=W;if(zV.mapIncludes(X,e.items,R))J(p,"DUPLICATE_KEY","Map keys must be unique");e.items.push(g0)}else{let e=new E9.YAMLMap(X.schema);e.flow=!0,e.items.push(g0);let j1=(f0??R).range;e.range=[R.range[0],j1[1],j1[2]],W.items.push(e)}V=f0?f0.range[2]:u.end}}let K=Y?"}":"]",[B,...T]=z.end,N=V;if(B?.source===K)N=B.offset+B.source.length;else{let M=U[0].toUpperCase()+U.substring(1),P=q?`${M} must end with a ${K}`:`${M} in block collection must be sufficiently indented and end with a ${K}`;if(J(V,q?"MISSING_CHAR":"BAD_INDENT",P),B&&B.source.length!==1)T.unshift(B)}if(T.length>0){let M=ZV.resolveEnd(T,N,X.options.strict,J);if(M.comment)if(W.comment)W.comment+=`
95
+ `+M.comment;else W.comment=M.comment;W.range=[z.offset,N,M.offset]}else W.range=[z.offset,N,N];return W}QV.resolveFlowCollection=JV});var b9=F((LV)=>{var UV=d(),GV=Z0(),WV=Q$(),qV=Y$(),VV=_9(),KV=C9(),HV=S9();function k8($,Z,X,z,J,Q){let Y=X.type==="block-map"?VV.resolveBlockMap($,Z,X,z,Q):X.type==="block-seq"?KV.resolveBlockSeq($,Z,X,z,Q):HV.resolveFlowCollection($,Z,X,z,Q),U=Y.constructor;if(J==="!"||J===U.tagName)return Y.tag=U.tagName,Y;if(J)Y.tag=J;return Y}function BV($,Z,X,z,J){let Q=z.tag,Y=!Q?null:Z.directives.tagName(Q.source,(K)=>J(Q,"TAG_RESOLVE_FAILED",K));if(X.type==="block-seq"){let{anchor:K,newlineAfterProp:B}=z,T=K&&Q?K.offset>Q.offset?K:Q:K??Q;if(T&&(!B||B.offset<T.offset))J(T,"MISSING_CHAR","Missing newline after block sequence props")}let U=X.type==="block-map"?"map":X.type==="block-seq"?"seq":X.start.source==="{"?"map":"seq";if(!Q||!Y||Y==="!"||Y===WV.YAMLMap.tagName&&U==="map"||Y===qV.YAMLSeq.tagName&&U==="seq")return k8($,Z,X,J,Y);let G=Z.schema.tags.find((K)=>K.tag===Y&&K.collection===U);if(!G){let K=Z.schema.knownTags[Y];if(K?.collection===U)Z.schema.tags.push(Object.assign({},K,{default:!1})),G=K;else{if(K)J(Q,"BAD_COLLECTION_TYPE",`${K.tag} used for ${U} collection, but expects ${K.collection??"scalar"}`,!0);else J(Q,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Y}`,!0);return k8($,Z,X,J,Y)}}let W=k8($,Z,X,J,Y,G),q=G.resolve?.(W,(K)=>J(Q,"TAG_RESOLVE_FAILED",K),Z.options)??W,V=UV.isNode(q)?q:new GV.Scalar(q);if(V.range=W.range,V.tag=Y,G?.format)V.format=G.format;return V}LV.composeCollection=BV});var f8=F((DV)=>{var y8=Z0();function MV($,Z,X){let z=Z.offset,J=OV(Z,$.options.strict,X);if(!J)return{value:"",type:null,comment:"",range:[z,z,z]};let Q=J.mode===">"?y8.Scalar.BLOCK_FOLDED:y8.Scalar.BLOCK_LITERAL,Y=Z.source?TV(Z.source):[],U=Y.length;for(let N=Y.length-1;N>=0;--N){let M=Y[N][1];if(M===""||M==="\r")U=N;else break}if(U===0){let N=J.chomp==="+"&&Y.length>0?`
96
+ `.repeat(Math.max(1,Y.length-1)):"",M=z+J.length;if(Z.source)M+=Z.source.length;return{value:N,type:Q,comment:J.comment,range:[z,M,M]}}let G=Z.indent+J.indent,W=Z.offset+J.length,q=0;for(let N=0;N<U;++N){let[M,P]=Y[N];if(P===""||P==="\r"){if(J.indent===0&&M.length>G)G=M.length}else{if(M.length<G)X(W+M.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(J.indent===0)G=M.length;if(q=N,G===0&&!$.atRoot)X(W,"BAD_INDENT","Block scalar values in collections must be indented");break}W+=M.length+P.length+1}for(let N=Y.length-1;N>=U;--N)if(Y[N][0].length>G)U=N+1;let V="",K="",B=!1;for(let N=0;N<q;++N)V+=Y[N][0].slice(G)+`
97
+ `;for(let N=q;N<U;++N){let[M,P]=Y[N];W+=M.length+P.length+1;let _=P[P.length-1]==="\r";if(_)P=P.slice(0,-1);if(P&&M.length<G){let x=`Block scalar lines must not be less indented than their ${J.indent?"explicit indentation indicator":"first line"}`;X(W-P.length-(_?2:1),"BAD_INDENT",x),M=""}if(Q===y8.Scalar.BLOCK_LITERAL)V+=K+M.slice(G)+P,K=`
98
98
  `;else if(M.length>G||P[0]==="\t"){if(K===" ")K=`
99
- `;else if(!H&&K===`
99
+ `;else if(!B&&K===`
100
100
  `)K=`
101
101
 
102
102
  `;V+=K+M.slice(G)+P,K=`
103
- `,H=!0}else if(P==="")if(K===`
103
+ `,B=!0}else if(P==="")if(K===`
104
104
  `)V+=`
105
105
  `;else K=`
106
- `;else V+=K+P,K=" ",H=!1}switch(J.chomp){case"-":break;case"+":for(let N=U;N<Y.length;++N)V+=`
106
+ `;else V+=K+P,K=" ",B=!1}switch(J.chomp){case"-":break;case"+":for(let N=U;N<Y.length;++N)V+=`
107
107
  `+Y[N][0].slice(G);if(V[V.length-1]!==`
108
108
  `)V+=`
109
109
  `;break;default:V+=`
110
- `}let T=z+J.length+Z.source.length;return{value:V,type:Q,comment:J.comment,range:[z,T,T]}}function qV({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,U="",G=-1;for(let K=1;K<J.length;++K){let H=J[K];if(!U&&(H==="-"||H==="+"))U=H;else{let T=Number(H);if(!Y&&T)Y=T;else if(G===-1)G=$+K}}if(G!==-1)z(G,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${J}`);let W=!1,q="",V=J.length;for(let K=1;K<Z.length;++K){let H=Z[K];switch(H.type){case"space":W=!0;case"newline":V+=H.source.length;break;case"comment":if(X&&!W)z(H,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");V+=H.source.length,q=H.source.substring(1);break;case"error":z(H,"UNEXPECTED_TOKEN",H.message),V+=H.source.length;break;default:{let T=`Unexpected token in block scalar header: ${H.type}`;z(H,"UNEXPECTED_TOKEN",T);let N=H.source;if(N&&typeof N==="string")V+=N.length}}}return{mode:Q,indent:Y,chomp:U,comment:q,length:V}}function VV($){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}KV.resolveBlockScalar=WV});var k8=R((AV)=>{var x8=Z0(),BV=p$();function LV($,Z,X){let{offset:z,type:J,source:Q,end:Y}=$,U,G,W=(K,H,T)=>X(z+K,H,T);switch(J){case"scalar":U=x8.Scalar.PLAIN,G=NV(Q,W);break;case"single-quoted-scalar":U=x8.Scalar.QUOTE_SINGLE,G=MV(Q,W);break;case"double-quoted-scalar":U=x8.Scalar.QUOTE_DOUBLE,G=OV(Q,W);break;default:return X($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${J}`),{value:"",type:null,comment:"",range:[z,z+Q.length,z+Q.length]}}let q=z+Q.length,V=BV.resolveEnd(Y,q,Z,X);return{value:G,type:U,comment:V.comment,range:[z,q,V.offset]}}function NV($,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 E9($)}function MV($,Z){if($[$.length-1]!=="'"||$.length===1)Z($.length,"MISSING_CHAR","Missing closing 'quote");return E9($.slice(1,-1)).replace(/''/g,"'")}function E9($){let Z,X;try{Z=new RegExp(`(.*?)(?<![ ])[ ]*\r?
110
+ `}let T=z+J.length+Z.source.length;return{value:V,type:Q,comment:J.comment,range:[z,T,T]}}function OV({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,U="",G=-1;for(let K=1;K<J.length;++K){let B=J[K];if(!U&&(B==="-"||B==="+"))U=B;else{let T=Number(B);if(!Y&&T)Y=T;else if(G===-1)G=$+K}}if(G!==-1)z(G,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${J}`);let W=!1,q="",V=J.length;for(let K=1;K<Z.length;++K){let B=Z[K];switch(B.type){case"space":W=!0;case"newline":V+=B.source.length;break;case"comment":if(X&&!W)z(B,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");V+=B.source.length,q=B.source.substring(1);break;case"error":z(B,"UNEXPECTED_TOKEN",B.message),V+=B.source.length;break;default:{let T=`Unexpected token in block scalar header: ${B.type}`;z(B,"UNEXPECTED_TOKEN",T);let N=B.source;if(N&&typeof N==="string")V+=N.length}}}return{mode:Q,indent:Y,chomp:U,comment:q,length:V}}function TV($){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}DV.resolveBlockScalar=MV});var v8=F((jV)=>{var g8=Z0(),AV=n$();function RV($,Z,X){let{offset:z,type:J,source:Q,end:Y}=$,U,G,W=(K,B,T)=>X(z+K,B,T);switch(J){case"scalar":U=g8.Scalar.PLAIN,G=FV(Q,W);break;case"single-quoted-scalar":U=g8.Scalar.QUOTE_SINGLE,G=wV(Q,W);break;case"double-quoted-scalar":U=g8.Scalar.QUOTE_DOUBLE,G=PV(Q,W);break;default:return X($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${J}`),{value:"",type:null,comment:"",range:[z,z+Q.length,z+Q.length]}}let q=z+Q.length,V=AV.resolveEnd(Y,q,Z,X);return{value:G,type:U,comment:V.comment,range:[z,q,V.offset]}}function FV($,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 x9($)}function wV($,Z){if($[$.length-1]!=="'"||$.length===1)Z($.length,"MISSING_CHAR","Missing closing 'quote");return x9($.slice(1,-1)).replace(/''/g,"'")}function x9($){let Z,X;try{Z=new RegExp(`(.*?)(?<![ ])[ ]*\r?
111
111
  `,"sy"),X=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
112
112
  `,"sy")}catch{Z=/(.*?)[ \t]*\r?\n/sy,X=/[ \t]*(.*?)[ \t]*\r?\n/sy}let z=Z.exec($);if(!z)return $;let J=z[1],Q=" ",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=X.lastIndex}let U=/[ \t]*(.*)/sy;return U.lastIndex=Y,z=U.exec($),J+Q+(z?.[1]??"")}function OV($,Z){let X="";for(let z=1;z<$.length-1;++z){let J=$[z];if(J==="\r"&&$[z+1]===`
114
+ `;else J+=Q+z[1],Q=" ";Y=X.lastIndex}let U=/[ \t]*(.*)/sy;return U.lastIndex=Y,z=U.exec($),J+Q+(z?.[1]??"")}function PV($,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}=TV($,z);X+=Q,z=Y}else if(J==="\\"){let Q=$[++z],Y=DV[Q];if(Y)X+=Y;else if(Q===`
116
+ `){let{fold:Q,offset:Y}=_V($,z);X+=Q,z=Y}else if(J==="\\"){let Q=$[++z],Y=CV[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 U={x:2,u:4,U:8}[Q];X+=IV($,z+1,U,Z),z+=U}else{let U=$.substr(z-1,2);Z(z-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${U}`),X+=U}}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 U={x:2,u:4,U:8}[Q];X+=EV($,z+1,U,Z),z+=U}else{let U=$.substr(z-1,2);Z(z-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${U}`),X+=U}}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
- `))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 TV($,Z){let X="",z=$[Z+1];while(z===" "||z==="\t"||z===`
120
+ `))X+=z>Q?$.slice(Q,z+1):J}else X+=J}if($[$.length-1]!=='"'||$.length===1)Z($.length,"MISSING_CHAR",'Missing closing "quote');return X}function _V($,Z){let X="",z=$[Z+1];while(z===" "||z==="\t"||z===`
121
121
  `||z==="\r"){if(z==="\r"&&$[Z+2]!==`
122
122
  `)break;if(z===`
123
123
  `)X+=`
124
- `;Z+=1,z=$[Z+1]}if(!X)X=" ";return{fold:X,offset:Z}}var DV={"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 IV($,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 U=$.substr(Z-2,X+2);return z(Z-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${U}`),U}return String.fromCodePoint(Y)}AV.resolveFlowScalar=LV});var S9=R((EV)=>{var I$=c(),j9=Z0(),FV=b8(),wV=k8();function PV($,Z,X,z){let{value:J,type:Q,comment:Y,range:U}=Z.type==="block-scalar"?FV.resolveBlockScalar($,Z,z):wV.resolveFlowScalar(Z,$.options.strict,z),G=X?$.directives.tagName(X.source,(V)=>z(X,"TAG_RESOLVE_FAILED",V)):null,W;if($.options.stringKeys&&$.atKey)W=$.schema[I$.SCALAR];else if(G)W=_V($.schema,J,G,X,z);else if(Z.type==="scalar")W=CV($,J,Z,z);else W=$.schema[I$.SCALAR];let q;try{let V=W.resolve(J,(K)=>z(X??Z,"TAG_RESOLVE_FAILED",K),$.options);q=I$.isScalar(V)?V:new j9.Scalar(V)}catch(V){let K=V instanceof Error?V.message:String(V);z(X??Z,"TAG_RESOLVE_FAILED",K),q=new j9.Scalar(J)}if(q.range=U,q.source=J,Q)q.type=Q;if(G)q.tag=G;if(W.format)q.format=W.format;if(Y)q.comment=Y;return q}function _V($,Z,X,z,J){if(X==="!")return $[I$.SCALAR];let Q=[];for(let U of $.tags)if(!U.collection&&U.tag===X)if(U.default&&U.test)Q.push(U);else return U;for(let U of Q)if(U.test?.test(Z))return U;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"),$[I$.SCALAR]}function CV({atKey:$,directives:Z,schema:X},z,J,Q){let Y=X.tags.find((U)=>(U.default===!0||$&&U.default==="key")&&U.test?.test(z))||X[I$.SCALAR];if(X.compat){let U=X.compat.find((G)=>G.default&&G.test?.test(z))??X[I$.SCALAR];if(Y.tag!==U.tag){let G=Z.tagString(Y.tag),W=Z.tagString(U.tag),q=`Value may be parsed as either ${G} or ${W}`;Q(J,"TAG_RESOLVE_FAILED",q,!0)}}return Y}EV.composeScalar=PV});var b9=R((bV)=>{function SV($,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 $}bV.emptyScalarPosition=SV});var y9=R((mV)=>{var kV=E1(),yV=c(),fV=C9(),x9=S9(),gV=p$(),hV=b9(),vV={composeNode:k9,composeEmptyNode:y8};function k9($,Z,X,z){let J=$.atKey,{spaceBefore:Q,comment:Y,anchor:U,tag:G}=X,W,q=!0;switch(Z.type){case"alias":if(W=uV($,Z,z),U||G)z(Z,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(W=x9.composeScalar($,Z,G,z),U)W.anchor=U.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(W=fV.composeCollection(vV,$,Z,X,z),U)W.anchor=U.source.substring(1);break;default:{let V=Z.type==="error"?Z.message:`Unsupported token (type: ${Z.type})`;z(Z,"UNEXPECTED_TOKEN",V),W=y8($,Z.offset,void 0,null,X,z),q=!1}}if(U&&W.anchor==="")z(U,"BAD_ALIAS","Anchor cannot be an empty string");if(J&&$.options.stringKeys&&(!yV.isScalar(W)||typeof W.value!=="string"||W.tag&&W.tag!=="tag:yaml.org,2002:str"))z(G??Z,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(Q)W.spaceBefore=!0;if(Y)if(Z.type==="scalar"&&Z.source==="")W.comment=Y;else W.commentBefore=Y;if($.options.keepSourceTokens&&q)W.srcToken=Z;return W}function y8($,Z,X,z,{spaceBefore:J,comment:Q,anchor:Y,tag:U,end:G},W){let q={type:"scalar",offset:hV.emptyScalarPosition(Z,X,z),indent:-1,source:""},V=x9.composeScalar($,q,U,W);if(Y){if(V.anchor=Y.source.substring(1),V.anchor==="")W(Y,"BAD_ALIAS","Anchor cannot be an empty string")}if(J)V.spaceBefore=!0;if(Q)V.comment=Q,V.range[2]=G;return V}function uV({options:$},{offset:Z,source:X,end:z},J){let Q=new kV.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,U=gV.resolveEnd(z,Y,$.strict,J);if(Q.range=[Z,Y,U.offset],U.comment)Q.comment=U.comment;return Q}mV.composeEmptyNode=y8;mV.composeNode=k9});var g9=R((rV)=>{var pV=p1(),f9=y9(),lV=p$(),iV=i1();function nV($,Z,{offset:X,start:z,value:J,end:Q},Y){let U=Object.assign({_directives:Z},$),G=new pV.Document(void 0,U),W={atKey:!1,atRoot:!0,directives:G.directives,options:G.options,schema:G.schema},q=iV.resolveProps(z,{indicator:"doc-start",next:J??Q?.[0],offset:X,onError:Y,parentIndent:0,startOnNewline:!0});if(q.found){if(G.directives.docStart=!0,J&&(J.type==="block-map"||J.type==="block-seq")&&!q.hasNewline)Y(q.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}G.contents=J?f9.composeNode(W,J,q,Y):f9.composeEmptyNode(W,q.end,z,null,q,Y);let V=G.contents.range[2],K=lV.resolveEnd(Q,V,!1,Y);if(K.comment)G.comment=K.comment;return G.range=[X,V,K.offset],G}rV.composeDoc=nV});var f8=R((ZK)=>{var aV=T0("process"),oV=u6(),tV=p1(),n1=l1(),h9=c(),eV=g9(),$K=p$();function r1($){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 v9($){let Z="",X=!1,z=!1;for(let J=0;J<$.length;++J){let Q=$[J];switch(Q[0]){case"#":Z+=(Z===""?"":z?`
124
+ `;Z+=1,z=$[Z+1]}if(!X)X=" ";return{fold:X,offset:Z}}var CV={"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 EV($,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 U=$.substr(Z-2,X+2);return z(Z-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${U}`),U}return String.fromCodePoint(Y)}jV.resolveFlowScalar=RV});var y9=F((gV)=>{var F$=d(),k9=Z0(),bV=f8(),xV=v8();function kV($,Z,X,z){let{value:J,type:Q,comment:Y,range:U}=Z.type==="block-scalar"?bV.resolveBlockScalar($,Z,z):xV.resolveFlowScalar(Z,$.options.strict,z),G=X?$.directives.tagName(X.source,(V)=>z(X,"TAG_RESOLVE_FAILED",V)):null,W;if($.options.stringKeys&&$.atKey)W=$.schema[F$.SCALAR];else if(G)W=yV($.schema,J,G,X,z);else if(Z.type==="scalar")W=fV($,J,Z,z);else W=$.schema[F$.SCALAR];let q;try{let V=W.resolve(J,(K)=>z(X??Z,"TAG_RESOLVE_FAILED",K),$.options);q=F$.isScalar(V)?V:new k9.Scalar(V)}catch(V){let K=V instanceof Error?V.message:String(V);z(X??Z,"TAG_RESOLVE_FAILED",K),q=new k9.Scalar(J)}if(q.range=U,q.source=J,Q)q.type=Q;if(G)q.tag=G;if(W.format)q.format=W.format;if(Y)q.comment=Y;return q}function yV($,Z,X,z,J){if(X==="!")return $[F$.SCALAR];let Q=[];for(let U of $.tags)if(!U.collection&&U.tag===X)if(U.default&&U.test)Q.push(U);else return U;for(let U of Q)if(U.test?.test(Z))return U;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"),$[F$.SCALAR]}function fV({atKey:$,directives:Z,schema:X},z,J,Q){let Y=X.tags.find((U)=>(U.default===!0||$&&U.default==="key")&&U.test?.test(z))||X[F$.SCALAR];if(X.compat){let U=X.compat.find((G)=>G.default&&G.test?.test(z))??X[F$.SCALAR];if(Y.tag!==U.tag){let G=Z.tagString(Y.tag),W=Z.tagString(U.tag),q=`Value may be parsed as either ${G} or ${W}`;Q(J,"TAG_RESOLVE_FAILED",q,!0)}}return Y}gV.composeScalar=kV});var f9=F((uV)=>{function hV($,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 $}uV.emptyScalarPosition=hV});var h9=F((sV)=>{var cV=k1(),dV=d(),pV=b9(),g9=y9(),lV=n$(),iV=f9(),nV={composeNode:v9,composeEmptyNode:h8};function v9($,Z,X,z){let J=$.atKey,{spaceBefore:Q,comment:Y,anchor:U,tag:G}=X,W,q=!0;switch(Z.type){case"alias":if(W=rV($,Z,z),U||G)z(Z,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(W=g9.composeScalar($,Z,G,z),U)W.anchor=U.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(W=pV.composeCollection(nV,$,Z,X,z),U)W.anchor=U.source.substring(1);break;default:{let V=Z.type==="error"?Z.message:`Unsupported token (type: ${Z.type})`;z(Z,"UNEXPECTED_TOKEN",V),W=h8($,Z.offset,void 0,null,X,z),q=!1}}if(U&&W.anchor==="")z(U,"BAD_ALIAS","Anchor cannot be an empty string");if(J&&$.options.stringKeys&&(!dV.isScalar(W)||typeof W.value!=="string"||W.tag&&W.tag!=="tag:yaml.org,2002:str"))z(G??Z,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(Q)W.spaceBefore=!0;if(Y)if(Z.type==="scalar"&&Z.source==="")W.comment=Y;else W.commentBefore=Y;if($.options.keepSourceTokens&&q)W.srcToken=Z;return W}function h8($,Z,X,z,{spaceBefore:J,comment:Q,anchor:Y,tag:U,end:G},W){let q={type:"scalar",offset:iV.emptyScalarPosition(Z,X,z),indent:-1,source:""},V=g9.composeScalar($,q,U,W);if(Y){if(V.anchor=Y.source.substring(1),V.anchor==="")W(Y,"BAD_ALIAS","Anchor cannot be an empty string")}if(J)V.spaceBefore=!0;if(Q)V.comment=Q,V.range[2]=G;return V}function rV({options:$},{offset:Z,source:X,end:z},J){let Q=new cV.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,U=lV.resolveEnd(z,Y,$.strict,J);if(Q.range=[Z,Y,U.offset],U.comment)Q.comment=U.comment;return Q}sV.composeEmptyNode=h8;sV.composeNode=v9});var m9=F((XK)=>{var tV=s1(),u9=h9(),eV=n$(),$K=o1();function ZK($,Z,{offset:X,start:z,value:J,end:Q},Y){let U=Object.assign({_directives:Z},$),G=new tV.Document(void 0,U),W={atKey:!1,atRoot:!0,directives:G.directives,options:G.options,schema:G.schema},q=$K.resolveProps(z,{indicator:"doc-start",next:J??Q?.[0],offset:X,onError:Y,parentIndent:0,startOnNewline:!0});if(q.found){if(G.directives.docStart=!0,J&&(J.type==="block-map"||J.type==="block-seq")&&!q.hasNewline)Y(q.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}G.contents=J?u9.composeNode(W,J,q,Y):u9.composeEmptyNode(W,q.end,z,null,q,Y);let V=G.contents.range[2],K=eV.resolveEnd(Q,V,!1,Y);if(K.comment)G.comment=K.comment;return G.range=[X,V,K.offset],G}XK.composeDoc=ZK});var u8=F((WK)=>{var JK=D0("process"),QK=p6(),YK=s1(),t1=a1(),c9=d(),UK=m9(),GK=n$();function e1($){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 d9($){let Z="",X=!1,z=!1;for(let J=0;J<$.length;++J){let Q=$[J];switch(Q[0]){case"#":Z+=(Z===""?"":z?`
126
126
 
127
127
  `:`
128
- `)+(Q.substring(1)||" "),X=!0,z=!1;break;case"%":if($[J+1]?.[0]!=="#")J+=1;X=!1;break;default:if(!X)z=!0;X=!1}}return{comment:Z,afterEmptyLine:z}}class u9{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Z,X,z,J)=>{let Q=r1(Z);if(J)this.warnings.push(new n1.YAMLWarning(Q,X,z));else this.errors.push(new n1.YAMLParseError(Q,X,z))},this.directives=new oV.Directives({version:$.version||"1.2"}),this.options=$}decorate($,Z){let{comment:X,afterEmptyLine:z}=v9(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(h9.isCollection(J)&&!J.flow&&J.items.length>0){let Q=J.items[0];if(h9.isPair(Q))Q=Q.key;let Y=Q.commentBefore;Q.commentBefore=Y?`${X}
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 p9{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Z,X,z,J)=>{let Q=e1(Z);if(J)this.warnings.push(new t1.YAMLWarning(Q,X,z));else this.errors.push(new t1.YAMLParseError(Q,X,z))},this.directives=new QK.Directives({version:$.version||"1.2"}),this.options=$}decorate($,Z){let{comment:X,afterEmptyLine:z}=d9(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(c9.isCollection(J)&&!J.flow&&J.items.length>0){let Q=J.items[0];if(c9.isPair(Q))Q=Q.key;let Y=Q.commentBefore;Q.commentBefore=Y?`${X}
130
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:v9(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(aV.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(Z,X,z)=>{let J=r1($);J[0]+=Z,this.onError(J,"BAD_DIRECTIVE",X,z)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let Z=eV.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 n1.YAMLParseError(r1($),"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 n1.YAMLParseError(r1($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Z=$K.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 n1.YAMLParseError(r1($),"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 tV.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}}}ZK.Composer=u9});var d9=R((qK)=>{var zK=b8(),JK=k8(),QK=l1(),m9=x1();function YK($,Z=!0,X){if($){let z=(J,Q,Y)=>{let U=typeof J==="number"?J:Array.isArray(J)?J[0]:J.offset;if(X)X(U,Q,Y);else throw new QK.YAMLParseError([U,U+1],Q,Y)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return JK.resolveFlowScalar($,Z,z);case"block-scalar":return zK.resolveBlockScalar({options:{strict:Z}},$,z)}}return null}function UK($,Z){let{implicitKey:X=!1,indent:z,inFlow:J=!1,offset:Q=-1,type:Y="PLAIN"}=Z,U=m9.stringifyString({type:Y,value:$},{implicitKey:X,indent:z>0?" ".repeat(z):"",inFlow:J,options:{blockQuote:!0,lineWidth:-1}}),G=Z.end??[{type:"newline",offset:-1,indent:z,source:`
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:d9(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(JK.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(Z,X,z)=>{let J=e1($);J[0]+=Z,this.onError(J,"BAD_DIRECTIVE",X,z)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let Z=UK.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 t1.YAMLParseError(e1($),"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 t1.YAMLParseError(e1($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Z=GK.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 t1.YAMLParseError(e1($),"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 YK.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}}}WK.Composer=p9});var n9=F((OK)=>{var VK=f8(),KK=v8(),HK=a1(),l9=v1();function BK($,Z=!0,X){if($){let z=(J,Q,Y)=>{let U=typeof J==="number"?J:Array.isArray(J)?J[0]:J.offset;if(X)X(U,Q,Y);else throw new HK.YAMLParseError([U,U+1],Q,Y)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return KK.resolveFlowScalar($,Z,z);case"block-scalar":return VK.resolveBlockScalar({options:{strict:Z}},$,z)}}return null}function LK($,Z){let{implicitKey:X=!1,indent:z,inFlow:J=!1,offset:Q=-1,type:Y="PLAIN"}=Z,U=l9.stringifyString({type:Y,value:$},{implicitKey:X,indent:z>0?" ".repeat(z):"",inFlow:J,options:{blockQuote:!0,lineWidth:-1}}),G=Z.end??[{type:"newline",offset:-1,indent:z,source:`
133
133
  `}];switch(U[0]){case"|":case">":{let W=U.indexOf(`
134
134
  `),q=U.substring(0,W),V=U.substring(W+1)+`
135
- `,K=[{type:"block-scalar-header",offset:Q,indent:z,source:q}];if(!c9(K,G))K.push({type:"newline",offset:-1,indent:z,source:`
136
- `});return{type:"block-scalar",offset:Q,indent:z,props:K,source:V}}case'"':return{type:"double-quoted-scalar",offset:Q,indent:z,source:U,end:G};case"'":return{type:"single-quoted-scalar",offset:Q,indent:z,source:U,end:G};default:return{type:"scalar",offset:Q,indent:z,source:U,end:G}}}function GK($,Z,X={}){let{afterKey:z=!1,implicitKey:J=!1,inFlow:Q=!1,type:Y}=X,U="indent"in $?$.indent:null;if(z&&typeof U==="number")U+=2;if(!Y)switch($.type){case"single-quoted-scalar":Y="QUOTE_SINGLE";break;case"double-quoted-scalar":Y="QUOTE_DOUBLE";break;case"block-scalar":{let W=$.props[0];if(W.type!=="block-scalar-header")throw Error("Invalid block scalar header");Y=W.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:Y="PLAIN"}let G=m9.stringifyString({type:Y,value:Z},{implicitKey:J||U===null,indent:U!==null&&U>0?" ".repeat(U):"",inFlow:Q,options:{blockQuote:!0,lineWidth:-1}});switch(G[0]){case"|":case">":WK($,G);break;case'"':g8($,G,"double-quoted-scalar");break;case"'":g8($,G,"single-quoted-scalar");break;default:g8($,G,"scalar")}}function WK($,Z){let X=Z.indexOf(`
135
+ `,K=[{type:"block-scalar-header",offset:Q,indent:z,source:q}];if(!i9(K,G))K.push({type:"newline",offset:-1,indent:z,source:`
136
+ `});return{type:"block-scalar",offset:Q,indent:z,props:K,source:V}}case'"':return{type:"double-quoted-scalar",offset:Q,indent:z,source:U,end:G};case"'":return{type:"single-quoted-scalar",offset:Q,indent:z,source:U,end:G};default:return{type:"scalar",offset:Q,indent:z,source:U,end:G}}}function NK($,Z,X={}){let{afterKey:z=!1,implicitKey:J=!1,inFlow:Q=!1,type:Y}=X,U="indent"in $?$.indent:null;if(z&&typeof U==="number")U+=2;if(!Y)switch($.type){case"single-quoted-scalar":Y="QUOTE_SINGLE";break;case"double-quoted-scalar":Y="QUOTE_DOUBLE";break;case"block-scalar":{let W=$.props[0];if(W.type!=="block-scalar-header")throw Error("Invalid block scalar header");Y=W.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:Y="PLAIN"}let G=l9.stringifyString({type:Y,value:Z},{implicitKey:J||U===null,indent:U!==null&&U>0?" ".repeat(U):"",inFlow:Q,options:{blockQuote:!0,lineWidth:-1}});switch(G[0]){case"|":case">":MK($,G);break;case'"':m8($,G,"double-quoted-scalar");break;case"'":m8($,G,"single-quoted-scalar");break;default:m8($,G,"scalar")}}function MK($,Z){let X=Z.indexOf(`
137
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,U=[{type:"block-scalar-header",offset:Q,indent:Y,source:z}];if(!c9(U,"end"in $?$.end:void 0))U.push({type:"newline",offset:-1,indent:Y,source:`
139
- `});for(let G of Object.keys($))if(G!=="type"&&G!=="offset")delete $[G];Object.assign($,{type:"block-scalar",indent:Y,props:U,source:J})}}function c9($,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 g8($,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})}}}qK.createScalarToken=UK;qK.resolveAsScalar=YK;qK.setScalarValue=GK});var p9=R((LK)=>{var BK=($)=>("type"in $)?S2($):j2($);function S2($){switch($.type){case"block-scalar":{let Z="";for(let X of $.props)Z+=S2(X);return Z+$.source}case"block-map":case"block-seq":{let Z="";for(let X of $.items)Z+=j2(X);return Z}case"flow-collection":{let Z=$.start.source;for(let X of $.items)Z+=j2(X);for(let X of $.end)Z+=X.source;return Z}case"document":{let Z=j2($);if($.end)for(let X of $.end)Z+=X.source;return Z}default:{let Z=$.source;if("end"in $&&$.end)for(let X of $.end)Z+=X.source;return Z}}}function j2({start:$,key:Z,sep:X,value:z}){let J="";for(let Q of $)J+=Q.source;if(Z)J+=S2(Z);if(X)for(let Q of X)J+=Q.source;if(z)J+=S2(z);return J}LK.stringify=BK});var n9=R((OK)=>{var h8=Symbol("break visit"),MK=Symbol("skip children"),l9=Symbol("remove item");function A$($,Z){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};i9(Object.freeze([]),$,Z)}A$.BREAK=h8;A$.SKIP=MK;A$.REMOVE=l9;A$.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};A$.parentCollection=($,Z)=>{let X=A$.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 i9($,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 U=i9(Object.freeze($.concat([[J,Y]])),Q.items[Y],X);if(typeof U==="number")Y=U-1;else if(U===h8)return h8;else if(U===l9)Q.items.splice(Y,1),Y-=1}if(typeof z==="function"&&J==="key")z=z(Z,$)}}return typeof z==="function"?z(Z,$):z}OK.visit=A$});var b2=R((PK)=>{var v8=d9(),DK=p9(),IK=n9(),u8="\uFEFF",m8="\x02",c8="\x18",d8="\x1F",AK=($)=>!!$&&("items"in $),RK=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function FK($){switch($){case u8:return"<BOM>";case m8:return"<DOC>";case c8:return"<FLOW_END>";case d8:return"<SCALAR>";default:return JSON.stringify($)}}function wK($){switch($){case u8:return"byte-order-mark";case m8:return"doc-mode";case c8:return"flow-error-end";case d8:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
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,U=[{type:"block-scalar-header",offset:Q,indent:Y,source:z}];if(!i9(U,"end"in $?$.end:void 0))U.push({type:"newline",offset:-1,indent:Y,source:`
139
+ `});for(let G of Object.keys($))if(G!=="type"&&G!=="offset")delete $[G];Object.assign($,{type:"block-scalar",indent:Y,props:U,source:J})}}function i9($,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 m8($,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})}}}OK.createScalarToken=LK;OK.resolveAsScalar=BK;OK.setScalarValue=NK});var r9=F((RK)=>{var AK=($)=>("type"in $)?f2($):y2($);function f2($){switch($.type){case"block-scalar":{let Z="";for(let X of $.props)Z+=f2(X);return Z+$.source}case"block-map":case"block-seq":{let Z="";for(let X of $.items)Z+=y2(X);return Z}case"flow-collection":{let Z=$.start.source;for(let X of $.items)Z+=y2(X);for(let X of $.end)Z+=X.source;return Z}case"document":{let Z=y2($);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 y2({start:$,key:Z,sep:X,value:z}){let J="";for(let Q of $)J+=Q.source;if(Z)J+=f2(Z);if(X)for(let Q of X)J+=Q.source;if(z)J+=f2(z);return J}RK.stringify=AK});var o9=F((PK)=>{var c8=Symbol("break visit"),wK=Symbol("skip children"),s9=Symbol("remove item");function w$($,Z){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};a9(Object.freeze([]),$,Z)}w$.BREAK=c8;w$.SKIP=wK;w$.REMOVE=s9;w$.itemAtPath=($,Z)=>{let X=$;for(let[z,J]of Z){let Q=X?.[z];if(Q&&"items"in Q)X=Q.items[J];else return}return X};w$.parentCollection=($,Z)=>{let X=w$.itemAtPath($,Z.slice(0,-1)),z=Z[Z.length-1][0],J=X?.[z];if(J&&"items"in J)return J;throw Error("Parent collection not found")};function a9($,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 U=a9(Object.freeze($.concat([[J,Y]])),Q.items[Y],X);if(typeof U==="number")Y=U-1;else if(U===c8)return c8;else if(U===s9)Q.items.splice(Y,1),Y-=1}if(typeof z==="function"&&J==="key")z=z(Z,$)}}return typeof z==="function"?z(Z,$):z}PK.visit=w$});var g2=F((kK)=>{var d8=n9(),CK=r9(),EK=o9(),p8="\uFEFF",l8="\x02",i8="\x18",n8="\x1F",jK=($)=>!!$&&("items"in $),SK=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function bK($){switch($){case p8:return"<BOM>";case l8:return"<DOC>";case i8:return"<FLOW_END>";case n8:return"<SCALAR>";default:return JSON.stringify($)}}function xK($){switch($){case p8:return"byte-order-mark";case l8:return"doc-mode";case i8:return"flow-error-end";case n8: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}PK.createScalarToken=v8.createScalarToken;PK.resolveAsScalar=v8.resolveAsScalar;PK.setScalarValue=v8.setScalarValue;PK.stringify=DK.stringify;PK.visit=IK.visit;PK.BOM=u8;PK.DOCUMENT=m8;PK.FLOW_END=c8;PK.SCALAR=d8;PK.isCollection=AK;PK.isScalar=RK;PK.prettyToken=FK;PK.tokenType=wK});var l8=R((cK)=>{var s1=b2();function j0($){switch($){case void 0:case" ":case`
143
- `:case"\r":case"\t":return!0;default:return!1}}var r9=new Set("0123456789ABCDEFabcdef"),uK=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),x2=new Set(",[]{}"),mK=new Set(` ,[]{}
144
- \r `),p8=($)=>!$||mK.has($);class s9{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex($,Z=!1){if($){if(typeof $!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+$:$,this.lineEndPos=null}this.atEnd=!Z;let X=this.next??"stream";while(X&&(Z||this.hasChars(1)))X=yield*this.parseNext(X)}atLineEnd(){let $=this.pos,Z=this.buffer[$];while(Z===" "||Z==="\t")Z=this.buffer[++$];if(!Z||Z==="#"||Z===`
142
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch($[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}kK.createScalarToken=d8.createScalarToken;kK.resolveAsScalar=d8.resolveAsScalar;kK.setScalarValue=d8.setScalarValue;kK.stringify=CK.stringify;kK.visit=EK.visit;kK.BOM=p8;kK.DOCUMENT=l8;kK.FLOW_END=i8;kK.SCALAR=n8;kK.isCollection=jK;kK.isScalar=SK;kK.prettyToken=bK;kK.tokenType=xK});var s8=F((aK)=>{var $4=g2();function b0($){switch($){case void 0:case" ":case`
143
+ `:case"\r":case"\t":return!0;default:return!1}}var t9=new Set("0123456789ABCDEFabcdef"),rK=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),v2=new Set(",[]{}"),sK=new Set(` ,[]{}
144
+ \r `),r8=($)=>!$||sK.has($);class e9{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex($,Z=!1){if($){if(typeof $!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+$:$,this.lineEndPos=null}this.atEnd=!Z;let X=this.next??"stream";while(X&&(Z||this.hasChars(1)))X=yield*this.parseNext(X)}atLineEnd(){let $=this.pos,Z=this.buffer[$];while(Z===" "||Z==="\t")Z=this.buffer[++$];if(!Z||Z==="#"||Z===`
145
145
  `)return!0;if(Z==="\r")return this.buffer[$+1]===`
146
146
  `;return!1}charAt($){return this.buffer[this.pos+$]}continueScalar($){let Z=this.buffer[$];if(this.indentNext>0){let X=0;while(Z===" ")Z=this.buffer[++X+$];if(Z==="\r"){let z=this.buffer[X+$+1];if(z===`
147
147
  `||!z&&!this.atEnd)return $+X+1}return Z===`
148
- `||X>=this.indentNext||!Z&&!this.atEnd?$+X:-1}if(Z==="-"||Z==="."){let X=this.buffer.substr($,3);if((X==="---"||X==="...")&&j0(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]===s1.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 s1.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==="...")&&j0(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&&!j0(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(($==="-"||$==="?"||$===":")&&j0(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(p8),"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("..."))&&j0(z[3])){if(!(X===this.indentNext-1&&this.flowLevel===1&&(z[0]==="]"||z[0]==="}")))return this.flowLevel=0,yield s1.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(p8),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let Q=this.charAt(1);if(this.flowKey||j0(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(`
148
+ `||X>=this.indentNext||!Z&&!this.atEnd?$+X:-1}if(Z==="-"||Z==="."){let X=this.buffer.substr($,3);if((X==="---"||X==="...")&&b0(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]===$4.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 $4.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==="...")&&b0(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&&!b0(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(($==="-"||$==="?"||$===":")&&b0(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(r8),"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("..."))&&b0(z[3])){if(!(X===this.indentNext-1&&this.flowLevel===1&&(z[0]==="]"||z[0]==="}")))return this.flowLevel=0,yield $4.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(r8),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let Q=this.charAt(1);if(this.flowKey||b0(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
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)=>j0(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`
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)=>b0(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
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
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
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
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 s1.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(j0(J)||$&&x2.has(J))break;Z=X}else if(j0(z)){let J=this.buffer[X+1];if(z==="\r")if(J===`
156
+ `&&J>=this.pos&&J+1+Z>Y)$=J;else break}while(!0);return yield $4.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(b0(J)||$&&v2.has(J))break;Z=X}else if(b0(z)){let J=this.buffer[X+1];if(z==="\r")if(J===`
157
157
  `)X+=1,z=`
158
- `,J=this.buffer[X+1];else Z=X;if(J==="#"||$&&x2.has(J))break;if(z===`
159
- `){let Q=this.continueScalar(X+1);if(Q===-1)break;X=Math.max(X,Q-2)}}else{if($&&x2.has(z))break;Z=X}if(!z&&!this.atEnd)return this.setNext("plain-scalar");return yield s1.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(p8))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let $=this.flowLevel>0,Z=this.charAt(1);if(j0(Z)||$&&x2.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(!j0(Z)&&Z!==">")Z=this.buffer[++$];return yield*this.pushToIndex(Z===">"?$+1:$,!1)}else{let $=this.pos+1,Z=this.buffer[$];while(Z)if(uK.has(Z))Z=this.buffer[++$];else if(Z==="%"&&r9.has(this.buffer[$+1])&&r9.has(this.buffer[$+2]))Z=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
158
+ `,J=this.buffer[X+1];else Z=X;if(J==="#"||$&&v2.has(J))break;if(z===`
159
+ `){let Q=this.continueScalar(X+1);if(Q===-1)break;X=Math.max(X,Q-2)}}else{if($&&v2.has(z))break;Z=X}if(!z&&!this.atEnd)return this.setNext("plain-scalar");return yield $4.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(r8))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let $=this.flowLevel>0,Z=this.charAt(1);if(b0(Z)||$&&v2.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(!b0(Z)&&Z!==">")Z=this.buffer[++$];return yield*this.pushToIndex(Z===">"?$+1:$,!1)}else{let $=this.pos+1,Z=this.buffer[$];while(Z)if(rK.has(Z))Z=this.buffer[++$];else if(Z==="%"&&t9.has(this.buffer[$+1])&&t9.has(this.buffer[$+2]))Z=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
160
160
  `)return yield*this.pushCount(1);else if($==="\r"&&this.charAt(1)===`
161
- `)return yield*this.pushCount(2);else return 0}*pushSpaces($){let Z=this.pos-1,X;do X=this.buffer[++Z];while(X===" "||$&&X==="\t");let z=Z-this.pos;if(z>0)yield this.buffer.substr(this.pos,z),this.pos=Z;return z}*pushUntil($){let Z=this.pos,X=this.buffer[Z];while(!$(X))X=this.buffer[++Z];return yield*this.pushToIndex(Z,!1)}}cK.Lexer=s9});var i8=R((pK)=>{class a9{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}}}}pK.LineCounter=a9});var n8=R((rK)=>{var iK=T0("process"),o9=b2(),nK=l8();function z$($,Z){for(let X=0;X<$.length;++X)if($[X].type===Z)return!0;return!1}function t9($){for(let Z=0;Z<$.length;++Z)switch($[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function $7($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function k2($){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 l$($){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 e9($){if($.start.type==="flow-seq-start"){for(let Z of $.items)if(Z.sep&&!Z.value&&!z$(Z.start,"explicit-key-ind")&&!z$(Z.sep,"map-value-ind")){if(Z.key)Z.value=Z.key;if(delete Z.key,$7(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 Z7{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 nK.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=$,iK.env.LOG_TOKENS)console.log("|",o9.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let Z=o9.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")e9(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&&t9(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(t9($.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=k2(this.peek(2)),X=l$(Z),z;if($.end)z=$.end,z.push(this.sourceToken),delete $.end;else z=[this.sourceToken];let J={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:X,key:$,sep:z}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=J}else yield*this.lineEnd($)}*blockScalar($){switch(this.type){case"space":case"comment":case"newline":$.props.push(this.sourceToken);return;case"scalar":if($.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let Z=this.source.indexOf(`
161
+ `)return yield*this.pushCount(2);else return 0}*pushSpaces($){let Z=this.pos-1,X;do X=this.buffer[++Z];while(X===" "||$&&X==="\t");let z=Z-this.pos;if(z>0)yield this.buffer.substr(this.pos,z),this.pos=Z;return z}*pushUntil($){let Z=this.pos,X=this.buffer[Z];while(!$(X))X=this.buffer[++Z];return yield*this.pushToIndex(Z,!1)}}aK.Lexer=e9});var a8=F((tK)=>{class $7{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}}}}tK.LineCounter=$7});var o8=F((XH)=>{var $H=D0("process"),Z7=g2(),ZH=s8();function U$($,Z){for(let X=0;X<$.length;++X)if($[X].type===Z)return!0;return!1}function X7($){for(let Z=0;Z<$.length;++Z)switch($[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function J7($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function h2($){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 r$($){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 z7($){if($.start.type==="flow-seq-start"){for(let Z of $.items)if(Z.sep&&!Z.value&&!U$(Z.start,"explicit-key-ind")&&!U$(Z.sep,"map-value-ind")){if(Z.key)Z.value=Z.key;if(delete Z.key,J7(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 Q7{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 ZH.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=$,$H.env.LOG_TOKENS)console.log("|",Z7.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let Z=Z7.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")z7(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&&X7(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(X7($.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=h2(this.peek(2)),X=r$(Z),z;if($.end)z=$.end,z.push(this.sourceToken),delete $.end;else z=[this.sourceToken];let J={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:X,key:$,sep:z}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=J}else yield*this.lineEnd($)}*blockScalar($){switch(this.type){case"space":case"comment":case"newline":$.props.push(this.sourceToken);return;case"scalar":if($.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let Z=this.source.indexOf(`
162
162
  `)+1;while(Z!==0)this.onNewLine(this.offset+Z),Z=this.source.indexOf(`
163
- `,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 U=Z.sep[Y];switch(U.type){case"newline":Q.push(Y);break;case"space":break;case"comment":if(U.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(z$(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let Q=l$(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(z$(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($7(Z.key)&&!z$(Z.sep,"newline")){let Q=l$(Z.start),Y=Z.key,U=Z.sep;U.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:U}]})}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(z$(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&&!z$(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||z$(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=k2(X),J=l$(z);e9($);let Q=$.end.splice(1,$.end.length);Q.push(this.sourceToken);let Y={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:J,key:$,sep:Q}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=Y}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let Z=this.source.indexOf(`
163
+ `,Z)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap($){let Z=$.items[$.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,Z.value){let 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 U=Z.sep[Y];switch(U.type){case"newline":Q.push(Y);break;case"space":break;case"comment":if(U.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(U$(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let Q=r$(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(U$(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(J7(Z.key)&&!U$(Z.sep,"newline")){let Q=r$(Z.start),Y=Z.key,U=Z.sep;U.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:U}]})}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(U$(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&&!U$(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||U$(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=h2(X),J=r$(z);z7($);let Q=$.end.splice(1,$.end.length);Q.push(this.sourceToken);let Y={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:J,key:$,sep:Q}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=Y}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let Z=this.source.indexOf(`
164
164
  `)+1;while(Z!==0)this.onNewLine(this.offset+Z),Z=this.source.indexOf(`
165
- `,Z)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let Z=k2($),X=l$(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=k2($),X=l$(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()}}}rK.Parser=Z7});var Y7=R((zH)=>{var X7=f8(),aK=p1(),a1=l1(),oK=i6(),tK=c(),eK=i8(),z7=n8();function J7($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new eK.LineCounter||null,prettyErrors:Z}}function $H($,Z={}){let{lineCounter:X,prettyErrors:z}=J7(Z),J=new z7.Parser(X?.addNewLine),Q=new X7.Composer(Z),Y=Array.from(Q.compose(J.parse($)));if(z&&X)for(let U of Y)U.errors.forEach(a1.prettifyError($,X)),U.warnings.forEach(a1.prettifyError($,X));if(Y.length>0)return Y;return Object.assign([],{empty:!0},Q.streamInfo())}function Q7($,Z={}){let{lineCounter:X,prettyErrors:z}=J7(Z),J=new z7.Parser(X?.addNewLine),Q=new X7.Composer(Z),Y=null;for(let U of Q.compose(J.parse($),!0,$.length))if(!Y)Y=U;else if(Y.options.logLevel!=="silent"){Y.errors.push(new a1.YAMLParseError(U.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&X)Y.errors.forEach(a1.prettifyError($,X)),Y.warnings.forEach(a1.prettifyError($,X));return Y}function ZH($,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=Q7($,X);if(!J)return null;if(J.warnings.forEach((Q)=>oK.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 XH($,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(tK.isDocument($)&&!z)return $.toString(X);return new aK.Document($,z,X).toString(X)}zH.parse=ZH;zH.parseAllDocuments=$H;zH.parseDocument=Q7;zH.stringify=XH});var V7={};yZ(V7,{orange:()=>K0,italic:()=>nH,fafCyanDeep:()=>f2,fafCyan:()=>D,dim:()=>B,bold:()=>F,FAF_HEX:()=>o1});var a8=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,F,B,nH,o1,D=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,f2=($)=>`\x1B[38;2;14;140;140m${$}\x1B[0m`,K0=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var m=b(()=>{F=a8("1"),B=a8("2"),nH=a8("3"),o1={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"}});var V3=R((nR,AN)=>{AN.exports={name:"faf-cli",version:"6.14.0",description:"Persistent AI Context Standard — project DNA for AI. IANA-registered. Anthropic-merged.",type:"module",icon:"https://faf.one/orange-smiley.svg",logo:"https://faf.one/orange-smiley.svg",main:"dist/index.js",types:"./dist/index.d.ts",bin:{faf:"dist/cli.js","faf-cli":"dist/cli.js"},exports:{".":{types:"./dist/index.d.ts",default:"./dist/index.js"}},files:["dist/**/*","README.md","LICENSE","project.faf"],scripts:{dev:"bun src/cli.ts",clean:"rm -rf dist",build:"bun run clean && 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 && tsc -p tsconfig.build.json",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=120000","test:watch":"bun test --watch --timeout=120000",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:{"@faf/specification":"github:Wolfe-Jam/faf",ajv:"^8.17.1","@types/node":"^22.15.0","@typescript-eslint/eslint-plugin":"^8.41.0","@typescript-eslint/parser":"^8.41.0",eslint:"^9.39.2",prettier:"^3.2.5",typescript:"^5.3.3","typescript-eslint":"^8.59.1"},engines:{node:">=18.0.0"},publishConfig:{access:"public"}}});function w($,Z,X,z,J){if(z==="m")throw TypeError("Private method is not writable");if(z==="a"&&!J)throw TypeError("Private accessor was defined without a setter");if(typeof Z==="function"?$!==Z||!J:!Z.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return z==="a"?J.call($,X):J?J.value=X:Z.set($,X),X}function L($,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 p0=()=>{};var B3=function(){let{crypto:$}=globalThis;if($?.randomUUID)return B3=$.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 l0($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var z4=($)=>{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 S,z0,V0,U$,X1,z1,J1,Q1,Y1,U1,G1,W1,q1;var M0=b(()=>{S=class S extends Error{};z0=class z0 extends S{constructor($,Z,X,z,J){super(`${z0.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 U$({message:X,cause:z4(Z)});let J=Z,Q=J?.error?.type;if($===400)return new z1($,J,X,z,Q);if($===401)return new J1($,J,X,z,Q);if($===403)return new Q1($,J,X,z,Q);if($===404)return new Y1($,J,X,z,Q);if($===409)return new U1($,J,X,z,Q);if($===422)return new G1($,J,X,z,Q);if($===429)return new W1($,J,X,z,Q);if($>=500)return new q1($,J,X,z,Q);return new z0($,J,X,z,Q)}};V0=class V0 extends z0{constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}};U$=class U$ extends z0{constructor({message:$,cause:Z}){super(void 0,void 0,$||"Connection error.",void 0);if(Z)this.cause=Z}};X1=class X1 extends U${constructor({message:$}={}){super({message:$??"Request timed out."})}};z1=class z1 extends z0{};J1=class J1 extends z0{};Q1=class Q1 extends z0{};Y1=class Y1 extends z0{};U1=class U1 extends z0{};G1=class G1 extends z0{};W1=class W1 extends z0{};q1=class q1 extends z0{}});function $6($){if(typeof $!=="object")return{};return $??{}}function M3($){if(!$)return!0;for(let Z in $)return!1;return!0}function fX($,Z){return Object.prototype.hasOwnProperty.call($,Z)}var sN,yX=($)=>{return sN.test($)},L3=($)=>(L3=Array.isArray,L3($)),N3,gX=($,Z)=>{if(typeof Z!=="number"||!Number.isInteger(Z))throw new S(`${$} must be an integer`);if(Z<0)throw new S(`${$} must be a positive integer`);return Z},Z6=($)=>{try{return JSON.parse($)}catch(Z){return}};var _$=b(()=>{M0();sN=/^[a-z][a-z0-9+.-]*:/i,N3=L3});var hX=($)=>new Promise((Z)=>setTimeout(Z,$));var G$="0.91.1";function aN(){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 tN(){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 cX=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"},oN=()=>{let $=aN();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":G$,"X-Stainless-OS":uX(Deno.build.os),"X-Stainless-Arch":vX(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":G$,"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":G$,"X-Stainless-OS":uX(globalThis.process.platform??"unknown"),"X-Stainless-Arch":vX(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let Z=tN();if(Z)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":G$,"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":G$,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},vX=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},uX=($)=>{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"},mX,dX=()=>{return mX??(mX=oN())};var O3=()=>{};function pX(){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 T3(...$){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 X6($){let Z=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return T3({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 J4($){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 lX($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let Z=$.getReader(),X=Z.cancel();Z.releaseLock(),await X}var iX=({headers:$,body:Z})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(Z)}};function nX($){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 S(`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 rX=b(()=>{M0()});function oX($){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 Q4($){let Z;return(sX??(Z=new globalThis.TextEncoder,sX=Z.encode.bind(Z)))($)}function D3($){let Z;return(aX??(Z=new globalThis.TextDecoder,aX=Z.decode.bind(Z)))($)}var sX,aX;class W${constructor(){I0.set(this,void 0),A0.set(this,void 0),w(this,I0,new Uint8Array,"f"),w(this,A0,null,"f")}decode($){if($==null)return[];let Z=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?Q4($):$;w(this,I0,oX([L(this,I0,"f"),Z]),"f");let X=[],z;while((z=ZM(L(this,I0,"f"),L(this,A0,"f")))!=null){if(z.carriage&&L(this,A0,"f")==null){w(this,A0,z.index,"f");continue}if(L(this,A0,"f")!=null&&(z.index!==L(this,A0,"f")+1||z.carriage)){X.push(D3(L(this,I0,"f").subarray(0,L(this,A0,"f")-1))),w(this,I0,L(this,I0,"f").subarray(L(this,A0,"f")),"f"),w(this,A0,null,"f");continue}let J=L(this,A0,"f")!==null?z.preceding-1:z.preceding,Q=D3(L(this,I0,"f").subarray(0,J));X.push(Q),w(this,I0,L(this,I0,"f").subarray(z.index),"f"),w(this,A0,null,"f")}return X}flush(){if(!L(this,I0,"f").length)return[];return this.decode(`
166
- `)}}function ZM($,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 tX($){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 I0,A0;var I3=b(()=>{p0();I0=new WeakMap,A0=new WeakMap;W$.NEWLINE_CHARS=new Set([`
167
- `,"\r"]);W$.NEWLINE_REGEXP=/\r\n|[\n\r]/g});function Y4(){}function z6($,Z,X){if(!Z||J6[$]>J6[X])return Y4;else return Z[$].bind(Z)}function q0($){let Z=$.logger,X=$.logLevel??"off";if(!Z)return XM;let z=eX.get(Z);if(z&&z[0]===X)return z[1];let J={error:z6("error",Z,X),warn:z6("warn",Z,X),info:z6("info",Z,X),debug:z6("debug",Z,X)};return eX.set(Z,[X,J]),J}var J6,A3=($,Z,X)=>{if(!$)return;if(fX(J6,$))return $;q0(X).warn(`${Z} was set to ${JSON.stringify($)}, expected one of ${JSON.stringify(Object.keys(J6))}`);return},XM,eX,i0=($)=>{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 Q6=b(()=>{_$();J6={off:0,error:200,warn:300,info:400,debug:500};XM={error:Y4,warn:Y4,info:Y4,debug:Y4},eX=new WeakMap});async function*zM($,Z){if(!$.body){if(Z.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new S("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 S("Attempted to iterate over a response with no body")}let X=new $z,z=new W$,J=J4($.body);for await(let Q of JM(J))for(let Y of z.decode(Q)){let U=X.decode(Y);if(U)yield U}for(let Q of z.flush()){let Y=X.decode(Q);if(Y)yield Y}}async function*JM($){let Z=new Uint8Array;for await(let X of $){if(X==null)continue;let z=X instanceof ArrayBuffer?new Uint8Array(X):typeof X==="string"?Q4(X):X,J=new Uint8Array(Z.length+z.length);J.set(Z),J.set(z,Z.length),Z=J;let Q;while((Q=tX(Z))!==-1)yield Z.slice(0,Q),Z=Z.slice(Q)}if(Z.length>0)yield Z}class $z{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]=QM($,":");if(z.startsWith(" "))z=z.substring(1);if(Z==="event")this.event=z;else if(Z==="data")this.data.push(z);return null}}function QM($,Z){let X=$.indexOf(Z);if(X!==-1)return[$.substring(0,X),Z,$.substring(X+Z.length)];return[$,"",""]}var U4,R0;var R3=b(()=>{p0();M0();I3();_$();Q6();M0();R0=class R0{constructor($,Z,X){this.iterator=$,U4.set(this,void 0),this.controller=Z,w(this,U4,X,"f")}static fromSSEResponse($,Z,X){let z=!1,J=X?q0(X):console;async function*Q(){if(z)throw new S("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");z=!0;let Y=!1;try{for await(let U of zM($,Z)){if(U.event==="completion")try{yield JSON.parse(U.data)}catch(G){throw J.error("Could not parse message into JSON:",U.data),J.error("From chunk:",U.raw),G}if(U.event==="message_start"||U.event==="message_delta"||U.event==="message_stop"||U.event==="content_block_start"||U.event==="content_block_delta"||U.event==="content_block_stop"||U.event==="message"||U.event==="user.message"||U.event==="user.interrupt"||U.event==="user.tool_confirmation"||U.event==="user.custom_tool_result"||U.event==="agent.message"||U.event==="agent.thinking"||U.event==="agent.tool_use"||U.event==="agent.tool_result"||U.event==="agent.mcp_tool_use"||U.event==="agent.mcp_tool_result"||U.event==="agent.custom_tool_use"||U.event==="agent.thread_context_compacted"||U.event==="session.status_running"||U.event==="session.status_idle"||U.event==="session.status_rescheduled"||U.event==="session.status_terminated"||U.event==="session.error"||U.event==="session.deleted"||U.event==="span.model_request_start"||U.event==="span.model_request_end")try{yield JSON.parse(U.data)}catch(G){throw J.error("Could not parse message into JSON:",U.data),J.error("From chunk:",U.raw),G}if(U.event==="ping")continue;if(U.event==="error"){let G=Z6(U.data)??U.data,W=G?.error?.type;throw new z0(void 0,G,void 0,$.headers,W)}}Y=!0}catch(U){if(l0(U))return;throw U}finally{if(!Y)Z.abort()}}return new R0(Q,Z,X)}static fromReadableStream($,Z,X){let z=!1;async function*J(){let Y=new W$,U=J4($);for await(let G of U)for(let W of Y.decode(G))yield W;for(let G of Y.flush())yield G}async function*Q(){if(z)throw new S("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");z=!0;let Y=!1;try{for await(let U of J()){if(Y)continue;if(U)yield JSON.parse(U)}Y=!0}catch(U){if(l0(U))return;throw U}finally{if(!Y)Z.abort()}}return new R0(Q,Z,X)}[(U4=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 R0(()=>z($),this.controller,L(this,U4,"f")),new R0(()=>z(Z),this.controller,L(this,U4,"f"))]}toReadableStream(){let $=this,Z;return T3({async start(){Z=$[Symbol.asyncIterator]()},async pull(X){try{let{value:z,done:J}=await Z.next();if(J)return X.close();let Q=Q4(JSON.stringify(z)+`
169
- `);X.enqueue(Q)}catch(z){X.error(z)}},async cancel(){await Z.return?.()}})}}});async function Y6($,Z){let{response:X,requestLogID:z,retryOfRequestLogID:J,startTime:Q}=Z,Y=await(async()=>{if(Z.options.stream){if(q0($).debug("response",X.status,X.url,X.headers,X.body),Z.options.__streamClass)return Z.options.__streamClass.fromSSEResponse(X,Z.controller);return R0.fromSSEResponse(X,Z.controller)}if(X.status===204)return null;if(Z.options.__binaryResponse)return X;let G=X.headers.get("content-type")?.split(";")[0]?.trim();if(G?.includes("application/json")||G?.endsWith("+json")){if(X.headers.get("content-length")==="0")return;let K=await X.json();return F3(K,X)}return await X.text()})();return q0($).debug(`[${z}] response parsed`,i0({retryOfRequestLogID:J,url:X.url,status:X.status,body:Y,durationMs:Date.now()-Q})),Y}function F3($,Z){if(!$||typeof $!=="object"||Array.isArray($))return $;return Object.defineProperty($,"_request_id",{value:Z.headers.get("request-id"),enumerable:!1})}var w3=b(()=>{R3();Q6()});var G4,q$;var U6=b(()=>{p0();w3();q$=class q$ extends Promise{constructor($,Z,X=Y6){super((z)=>{z(null)});this.responsePromise=Z,this.parseResponse=X,G4.set(this,void 0),w(this,G4,$,"f")}_thenUnwrap($){return new q$(L(this,G4,"f"),this.responsePromise,async(Z,X)=>F3($(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(L(this,G4,"f"),$));return this.parsedPromise}then($,Z){return this.parse().then($,Z)}catch($){return this.parse().catch($)}finally($){return this.parse().finally($)}};G4=new WeakMap});var G6,P3,W4,x0,i;var t=b(()=>{p0();M0();w3();U6();_$();P3=class P3{constructor($,Z,X,z){G6.set(this,void 0),w(this,G6,$,"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 S("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await L(this,G6,"f").requestAPIList(this.constructor,$)}async*iterPages(){let $=this;yield $;while($.hasNextPage())$=await $.getNextPage(),yield $}async*[(G6=new WeakMap,Symbol.asyncIterator)](){for await(let $ of this.iterPages())for(let Z of $.getPaginatedItems())yield Z}};W4=class W4 extends q${constructor($,Z,X){super($,Z,async(z,J)=>new X(z,J.response,await Y6(z,J),J.options))}async*[Symbol.asyncIterator](){let $=await this;for await(let Z of $)yield Z}};x0=class x0 extends P3{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:{...$6(this.options.query),before_id:Z}}}let $=this.last_id;if(!$)return null;return{...this.options,query:{...$6(this.options.query),after_id:$}}}};i=class i extends P3{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:{...$6(this.options.query),page:$}}}}});function C$($,Z,X){return C3(),new File($,Z??"unknown_file",X)}function q4($,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 UM($){let Z=typeof $==="function"?$:$.fetch,X=Zz.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 Zz.set(Z,z),z}var C3=()=>{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`.":""))}},E3=($)=>$!=null&&typeof $==="object"&&typeof $[Symbol.asyncIterator]==="function",V1=async($,Z,X=!0)=>{return{...$,body:await GM($.body,Z,X)}},Zz,GM=async($,Z,X=!0)=>{if(!await UM(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])=>_3(z,J,Q,X))),z},WM=($)=>$ instanceof Blob&&("name"in $),_3=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,C$([await X.blob()],q4(X,z),J))}else if(E3(X))$.append(Z,C$([await new Response(X6(X)).blob()],q4(X,z)));else if(WM(X))$.append(Z,C$([X],q4(X,z),{type:X.type}));else if(Array.isArray(X))await Promise.all(X.map((J)=>_3($,Z+"[]",J,z)));else if(typeof X==="object")await Promise.all(Object.entries(X).map(([J,Q])=>_3($,`${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 K1=b(()=>{Zz=new WeakMap});async function V4($,Z,X){if(C3(),$=await $,Z||(Z=q4($,!0)),qM($)){if($ instanceof File&&Z==null&&X==null)return $;return C$([await $.arrayBuffer()],Z??$.name,{type:$.type,lastModified:$.lastModified,...X})}if(VM($)){let J=await $.blob();return Z||(Z=new URL($.url).pathname.split(/[\\/]/).pop()),C$(await j3(J),Z,X)}let z=await j3($);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 C$(z,Z,X)}async function j3($){let Z=[];if(typeof $==="string"||ArrayBuffer.isView($)||$ instanceof ArrayBuffer)Z.push($);else if(Xz($))Z.push($ instanceof Blob?$:await $.arrayBuffer());else if(E3($))for await(let X of $)Z.push(...await j3(X));else{let X=$?.constructor?.name;throw Error(`Unexpected data type: ${typeof $}${X?`; constructor: ${X}`:""}${KM($)}`)}return Z}function KM($){if(typeof $!=="object"||$===null)return"";return`; props: [${Object.getOwnPropertyNames($).map((X)=>`"${X}"`).join(", ")}]`}var Xz=($)=>$!=null&&typeof $==="object"&&typeof $.size==="number"&&typeof $.type==="string"&&typeof $.text==="function"&&typeof $.slice==="function"&&typeof $.arrayBuffer==="function",qM=($)=>$!=null&&typeof $==="object"&&typeof $.name==="string"&&typeof $.lastModified==="number"&&Xz($),VM=($)=>$!=null&&typeof $==="object"&&typeof $.url==="string"&&typeof $.blob==="function";var zz=b(()=>{K1();K1()});var S3=b(()=>{zz()});var Jz=()=>{};class f{constructor($){this._client=$}}function*BM($){if(!$)return;if(Qz 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(N3($))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=N3(z[1])?z[1]:[z[1]],Y=!1;for(let U of Q){if(U===void 0)continue;if(Z&&!Y)Y=!0,yield[J,null];yield[J,U]}}}var Qz,O=($)=>{let Z=new Headers,X=new Set;for(let z of $){let J=new Set;for(let[Q,Y]of BM(z)){let U=Q.toLowerCase();if(!J.has(U))Z.delete(Q),J.add(U);if(Y===null)Z.delete(Q),X.add(U);else Z.append(Q,Y),X.delete(U)}}return{[Qz]:!0,values:Z,nulls:X}};var r=b(()=>{_$();Qz=Symbol.for("brand.privateNullableHeaders")});function Uz($){return $.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var Yz,LM=($=Uz)=>function(X,...z){if(X.length===1)return X[0];let J=!1,Q=[],Y=X.reduce((q,V,K)=>{if(/[?#]/.test(V))J=!0;let H=z[K],T=(J?encodeURIComponent:$)(""+H);if(K!==z.length&&(H==null||typeof H==="object"&&H.toString===Object.getPrototypeOf(Object.getPrototypeOf(H.hasOwnProperty??Yz)??Yz)?.toString))T=H+"",Q.push({start:q.length+V.length,length:T.length,error:`Value of type ${Object.prototype.toString.call(H).slice(8,-1)} is not a valid path parameter`});return q+V+(K===z.length?"":T)},""),U=Y.split(/[?#]/,1)[0],G=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,W;while((W=G.exec(U))!==null)Q.push({start:W.index,length:W[0].length,error:`Value "${W[0]}" can't be safely passed as a path parameter`});if(Q.sort((q,V)=>q.start-V.start),Q.length>0){let q=0,V=Q.reduce((K,H)=>{let T=" ".repeat(H.start-q),N="^".repeat(H.length);return q=H.start+H.length,K+T+N},"");throw new S(`Path parameters result in path with invalid segments:
165
+ `,Z)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let Z=h2($),X=r$(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=h2($),X=r$(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()}}}XH.Parser=Q7});var q7=F((VH)=>{var Y7=u8(),JH=s1(),Z4=a1(),QH=a6(),YH=d(),UH=a8(),U7=o8();function G7($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new UH.LineCounter||null,prettyErrors:Z}}function GH($,Z={}){let{lineCounter:X,prettyErrors:z}=G7(Z),J=new U7.Parser(X?.addNewLine),Q=new Y7.Composer(Z),Y=Array.from(Q.compose(J.parse($)));if(z&&X)for(let U of Y)U.errors.forEach(Z4.prettifyError($,X)),U.warnings.forEach(Z4.prettifyError($,X));if(Y.length>0)return Y;return Object.assign([],{empty:!0},Q.streamInfo())}function W7($,Z={}){let{lineCounter:X,prettyErrors:z}=G7(Z),J=new U7.Parser(X?.addNewLine),Q=new Y7.Composer(Z),Y=null;for(let U of Q.compose(J.parse($),!0,$.length))if(!Y)Y=U;else if(Y.options.logLevel!=="silent"){Y.errors.push(new Z4.YAMLParseError(U.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&X)Y.errors.forEach(Z4.prettifyError($,X)),Y.warnings.forEach(Z4.prettifyError($,X));return Y}function WH($,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=W7($,X);if(!J)return null;if(J.warnings.forEach((Q)=>QH.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 qH($,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(YH.isDocument($)&&!z)return $.toString(X);return new JH.Document($,z,X).toString(X)}VH.parse=WH;VH.parseAllDocuments=GH;VH.parseDocument=W7;VH.stringify=qH});var L7={};hZ(L7,{orange:()=>K0,italic:()=>ZB,fafCyanDeep:()=>m2,fafCyan:()=>D,dim:()=>H,bold:()=>I,FAF_HEX:()=>X4});var $3=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,I,H,ZB,X4,D=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,m2=($)=>`\x1B[38;2;14;140;140m${$}\x1B[0m`,K0=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var c=b(()=>{I=$3("1"),H=$3("2"),ZB=$3("3"),X4={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"}});var L3=F((PF,fN)=>{fN.exports={name:"faf-cli",version:"6.16.0",description:"Persistent AI Context Standard — project DNA for AI. IANA-registered. Anthropic-merged.",type:"module",icon:"https://faf.one/orange-smiley.svg",logo:"https://faf.one/orange-smiley.svg",main:"dist/index.js",types:"./dist/index.d.ts",bin:{faf:"dist/cli.js","faf-cli":"dist/cli.js"},exports:{".":{types:"./dist/index.d.ts",default:"./dist/index.js"}},files:["dist/**/*","README.md","LICENSE","project.faf"],scripts:{dev:"bun src/cli.ts",clean:"rm -rf dist",build:"bun run clean && 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 && tsc -p tsconfig.build.json",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=120000","test:watch":"bun test --watch --timeout=120000",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:{"@faf/specification":"github:Wolfe-Jam/faf",ajv:"^8.17.1","@types/node":"^22.15.0","@typescript-eslint/eslint-plugin":"^8.41.0","@typescript-eslint/parser":"^8.41.0",eslint:"^9.39.2",prettier:"^3.2.5",typescript:"^5.3.3","typescript-eslint":"^8.59.1"},engines:{node:">=18.0.0"},publishConfig:{access:"public"}}});function w($,Z,X,z,J){if(z==="m")throw TypeError("Private method is not writable");if(z==="a"&&!J)throw TypeError("Private accessor was defined without a setter");if(typeof Z==="function"?$!==Z||!J:!Z.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return z==="a"?J.call($,X):J?J.value=X:Z.set($,X),X}function L($,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 r0=()=>{};var O3=function(){let{crypto:$}=globalThis;if($?.randomUUID)return O3=$.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 s0($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var G4=($)=>{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 S,z0,V0,q$,U1,G1,W1,q1,V1,K1,H1,B1,L1;var O0=b(()=>{S=class S extends Error{};z0=class z0 extends S{constructor($,Z,X,z,J){super(`${z0.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 q$({message:X,cause:G4(Z)});let J=Z,Q=J?.error?.type;if($===400)return new G1($,J,X,z,Q);if($===401)return new W1($,J,X,z,Q);if($===403)return new q1($,J,X,z,Q);if($===404)return new V1($,J,X,z,Q);if($===409)return new K1($,J,X,z,Q);if($===422)return new H1($,J,X,z,Q);if($===429)return new B1($,J,X,z,Q);if($>=500)return new L1($,J,X,z,Q);return new z0($,J,X,z,Q)}};V0=class V0 extends z0{constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}};q$=class q$ extends z0{constructor({message:$,cause:Z}){super(void 0,void 0,$||"Connection error.",void 0);if(Z)this.cause=Z}};U1=class U1 extends q${constructor({message:$}={}){super({message:$??"Request timed out."})}};G1=class G1 extends z0{};W1=class W1 extends z0{};q1=class q1 extends z0{};V1=class V1 extends z0{};K1=class K1 extends z0{};H1=class H1 extends z0{};B1=class B1 extends z0{};L1=class L1 extends z0{}});function J6($){if(typeof $!=="object")return{};return $??{}}function I3($){if(!$)return!0;for(let Z in $)return!1;return!0}function pX($,Z){return Object.prototype.hasOwnProperty.call($,Z)}var LM,dX=($)=>{return LM.test($)},T3=($)=>(T3=Array.isArray,T3($)),D3,lX=($,Z)=>{if(typeof Z!=="number"||!Number.isInteger(Z))throw new S(`${$} must be an integer`);if(Z<0)throw new S(`${$} must be a positive integer`);return Z},Q6=($)=>{try{return JSON.parse($)}catch(Z){return}};var j$=b(()=>{O0();LM=/^[a-z][a-z0-9+.-]*:/i,D3=T3});var iX=($)=>new Promise((Z)=>setTimeout(Z,$));var V$="0.91.1";function NM(){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 OM(){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 aX=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"},MM=()=>{let $=NM();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":V$,"X-Stainless-OS":rX(Deno.build.os),"X-Stainless-Arch":nX(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":V$,"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":V$,"X-Stainless-OS":rX(globalThis.process.platform??"unknown"),"X-Stainless-Arch":nX(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let Z=OM();if(Z)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":V$,"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":V$,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},nX=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},rX=($)=>{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"},sX,oX=()=>{return sX??(sX=MM())};var A3=()=>{};function tX(){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 R3(...$){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 Y6($){let Z=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return R3({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 W4($){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 eX($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let Z=$.getReader(),X=Z.cancel();Z.releaseLock(),await X}var $z=({headers:$,body:Z})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(Z)}};function Zz($){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 S(`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 Xz=b(()=>{O0()});function Qz($){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 q4($){let Z;return(zz??(Z=new globalThis.TextEncoder,zz=Z.encode.bind(Z)))($)}function F3($){let Z;return(Jz??(Z=new globalThis.TextDecoder,Jz=Z.decode.bind(Z)))($)}var zz,Jz;class K${constructor(){R0.set(this,void 0),F0.set(this,void 0),w(this,R0,new Uint8Array,"f"),w(this,F0,null,"f")}decode($){if($==null)return[];let Z=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?q4($):$;w(this,R0,Qz([L(this,R0,"f"),Z]),"f");let X=[],z;while((z=IM(L(this,R0,"f"),L(this,F0,"f")))!=null){if(z.carriage&&L(this,F0,"f")==null){w(this,F0,z.index,"f");continue}if(L(this,F0,"f")!=null&&(z.index!==L(this,F0,"f")+1||z.carriage)){X.push(F3(L(this,R0,"f").subarray(0,L(this,F0,"f")-1))),w(this,R0,L(this,R0,"f").subarray(L(this,F0,"f")),"f"),w(this,F0,null,"f");continue}let J=L(this,F0,"f")!==null?z.preceding-1:z.preceding,Q=F3(L(this,R0,"f").subarray(0,J));X.push(Q),w(this,R0,L(this,R0,"f").subarray(z.index),"f"),w(this,F0,null,"f")}return X}flush(){if(!L(this,R0,"f").length)return[];return this.decode(`
166
+ `)}}function IM($,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 Yz($){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 R0,F0;var w3=b(()=>{r0();R0=new WeakMap,F0=new WeakMap;K$.NEWLINE_CHARS=new Set([`
167
+ `,"\r"]);K$.NEWLINE_REGEXP=/\r\n|[\n\r]/g});function V4(){}function U6($,Z,X){if(!Z||G6[$]>G6[X])return V4;else return Z[$].bind(Z)}function q0($){let Z=$.logger,X=$.logLevel??"off";if(!Z)return AM;let z=Uz.get(Z);if(z&&z[0]===X)return z[1];let J={error:U6("error",Z,X),warn:U6("warn",Z,X),info:U6("info",Z,X),debug:U6("debug",Z,X)};return Uz.set(Z,[X,J]),J}var G6,P3=($,Z,X)=>{if(!$)return;if(pX(G6,$))return $;q0(X).warn(`${Z} was set to ${JSON.stringify($)}, expected one of ${JSON.stringify(Object.keys(G6))}`);return},AM,Uz,a0=($)=>{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 W6=b(()=>{j$();G6={off:0,error:200,warn:300,info:400,debug:500};AM={error:V4,warn:V4,info:V4,debug:V4},Uz=new WeakMap});async function*RM($,Z){if(!$.body){if(Z.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new S("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 S("Attempted to iterate over a response with no body")}let X=new Gz,z=new K$,J=W4($.body);for await(let Q of FM(J))for(let Y of z.decode(Q)){let U=X.decode(Y);if(U)yield U}for(let Q of z.flush()){let Y=X.decode(Q);if(Y)yield Y}}async function*FM($){let Z=new Uint8Array;for await(let X of $){if(X==null)continue;let z=X instanceof ArrayBuffer?new Uint8Array(X):typeof X==="string"?q4(X):X,J=new Uint8Array(Z.length+z.length);J.set(Z),J.set(z,Z.length),Z=J;let Q;while((Q=Yz(Z))!==-1)yield Z.slice(0,Q),Z=Z.slice(Q)}if(Z.length>0)yield Z}class Gz{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]=wM($,":");if(z.startsWith(" "))z=z.substring(1);if(Z==="event")this.event=z;else if(Z==="data")this.data.push(z);return null}}function wM($,Z){let X=$.indexOf(Z);if(X!==-1)return[$.substring(0,X),Z,$.substring(X+Z.length)];return[$,"",""]}var K4,w0;var _3=b(()=>{r0();O0();w3();j$();W6();O0();w0=class w0{constructor($,Z,X){this.iterator=$,K4.set(this,void 0),this.controller=Z,w(this,K4,X,"f")}static fromSSEResponse($,Z,X){let z=!1,J=X?q0(X):console;async function*Q(){if(z)throw new S("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");z=!0;let Y=!1;try{for await(let U of RM($,Z)){if(U.event==="completion")try{yield JSON.parse(U.data)}catch(G){throw J.error("Could not parse message into JSON:",U.data),J.error("From chunk:",U.raw),G}if(U.event==="message_start"||U.event==="message_delta"||U.event==="message_stop"||U.event==="content_block_start"||U.event==="content_block_delta"||U.event==="content_block_stop"||U.event==="message"||U.event==="user.message"||U.event==="user.interrupt"||U.event==="user.tool_confirmation"||U.event==="user.custom_tool_result"||U.event==="agent.message"||U.event==="agent.thinking"||U.event==="agent.tool_use"||U.event==="agent.tool_result"||U.event==="agent.mcp_tool_use"||U.event==="agent.mcp_tool_result"||U.event==="agent.custom_tool_use"||U.event==="agent.thread_context_compacted"||U.event==="session.status_running"||U.event==="session.status_idle"||U.event==="session.status_rescheduled"||U.event==="session.status_terminated"||U.event==="session.error"||U.event==="session.deleted"||U.event==="span.model_request_start"||U.event==="span.model_request_end")try{yield JSON.parse(U.data)}catch(G){throw J.error("Could not parse message into JSON:",U.data),J.error("From chunk:",U.raw),G}if(U.event==="ping")continue;if(U.event==="error"){let G=Q6(U.data)??U.data,W=G?.error?.type;throw new z0(void 0,G,void 0,$.headers,W)}}Y=!0}catch(U){if(s0(U))return;throw U}finally{if(!Y)Z.abort()}}return new w0(Q,Z,X)}static fromReadableStream($,Z,X){let z=!1;async function*J(){let Y=new K$,U=W4($);for await(let G of U)for(let W of Y.decode(G))yield W;for(let G of Y.flush())yield G}async function*Q(){if(z)throw new S("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");z=!0;let Y=!1;try{for await(let U of J()){if(Y)continue;if(U)yield JSON.parse(U)}Y=!0}catch(U){if(s0(U))return;throw U}finally{if(!Y)Z.abort()}}return new w0(Q,Z,X)}[(K4=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,L(this,K4,"f")),new w0(()=>z(Z),this.controller,L(this,K4,"f"))]}toReadableStream(){let $=this,Z;return R3({async start(){Z=$[Symbol.asyncIterator]()},async pull(X){try{let{value:z,done:J}=await Z.next();if(J)return X.close();let Q=q4(JSON.stringify(z)+`
169
+ `);X.enqueue(Q)}catch(z){X.error(z)}},async cancel(){await Z.return?.()}})}}});async function q6($,Z){let{response:X,requestLogID:z,retryOfRequestLogID:J,startTime:Q}=Z,Y=await(async()=>{if(Z.options.stream){if(q0($).debug("response",X.status,X.url,X.headers,X.body),Z.options.__streamClass)return Z.options.__streamClass.fromSSEResponse(X,Z.controller);return w0.fromSSEResponse(X,Z.controller)}if(X.status===204)return null;if(Z.options.__binaryResponse)return X;let G=X.headers.get("content-type")?.split(";")[0]?.trim();if(G?.includes("application/json")||G?.endsWith("+json")){if(X.headers.get("content-length")==="0")return;let K=await X.json();return C3(K,X)}return await X.text()})();return q0($).debug(`[${z}] response parsed`,a0({retryOfRequestLogID:J,url:X.url,status:X.status,body:Y,durationMs:Date.now()-Q})),Y}function C3($,Z){if(!$||typeof $!=="object"||Array.isArray($))return $;return Object.defineProperty($,"_request_id",{value:Z.headers.get("request-id"),enumerable:!1})}var E3=b(()=>{_3();W6()});var H4,H$;var V6=b(()=>{r0();E3();H$=class H$ extends Promise{constructor($,Z,X=q6){super((z)=>{z(null)});this.responsePromise=Z,this.parseResponse=X,H4.set(this,void 0),w(this,H4,$,"f")}_thenUnwrap($){return new H$(L(this,H4,"f"),this.responsePromise,async(Z,X)=>C3($(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(L(this,H4,"f"),$));return this.parsedPromise}then($,Z){return this.parse().then($,Z)}catch($){return this.parse().catch($)}finally($){return this.parse().finally($)}};H4=new WeakMap});var K6,j3,B4,y0,i;var t=b(()=>{r0();O0();E3();V6();j$();j3=class j3{constructor($,Z,X,z){K6.set(this,void 0),w(this,K6,$,"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 S("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await L(this,K6,"f").requestAPIList(this.constructor,$)}async*iterPages(){let $=this;yield $;while($.hasNextPage())$=await $.getNextPage(),yield $}async*[(K6=new WeakMap,Symbol.asyncIterator)](){for await(let $ of this.iterPages())for(let Z of $.getPaginatedItems())yield Z}};B4=class B4 extends H${constructor($,Z,X){super($,Z,async(z,J)=>new X(z,J.response,await q6(z,J),J.options))}async*[Symbol.asyncIterator](){let $=await this;for await(let Z of $)yield Z}};y0=class y0 extends j3{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:{...J6(this.options.query),before_id:Z}}}let $=this.last_id;if(!$)return null;return{...this.options,query:{...J6(this.options.query),after_id:$}}}};i=class i extends j3{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:{...J6(this.options.query),page:$}}}}});function S$($,Z,X){return b3(),new File($,Z??"unknown_file",X)}function L4($,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 _M($){let Z=typeof $==="function"?$:$.fetch,X=Wz.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 Wz.set(Z,z),z}var b3=()=>{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`.":""))}},x3=($)=>$!=null&&typeof $==="object"&&typeof $[Symbol.asyncIterator]==="function",N1=async($,Z,X=!0)=>{return{...$,body:await CM($.body,Z,X)}},Wz,CM=async($,Z,X=!0)=>{if(!await _M(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])=>S3(z,J,Q,X))),z},EM=($)=>$ instanceof Blob&&("name"in $),S3=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,S$([await X.blob()],L4(X,z),J))}else if(x3(X))$.append(Z,S$([await new Response(Y6(X)).blob()],L4(X,z)));else if(EM(X))$.append(Z,S$([X],L4(X,z),{type:X.type}));else if(Array.isArray(X))await Promise.all(X.map((J)=>S3($,Z+"[]",J,z)));else if(typeof X==="object")await Promise.all(Object.entries(X).map(([J,Q])=>S3($,`${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 M1=b(()=>{Wz=new WeakMap});async function N4($,Z,X){if(b3(),$=await $,Z||(Z=L4($,!0)),jM($)){if($ instanceof File&&Z==null&&X==null)return $;return S$([await $.arrayBuffer()],Z??$.name,{type:$.type,lastModified:$.lastModified,...X})}if(SM($)){let J=await $.blob();return Z||(Z=new URL($.url).pathname.split(/[\\/]/).pop()),S$(await k3(J),Z,X)}let z=await k3($);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 S$(z,Z,X)}async function k3($){let Z=[];if(typeof $==="string"||ArrayBuffer.isView($)||$ instanceof ArrayBuffer)Z.push($);else if(qz($))Z.push($ instanceof Blob?$:await $.arrayBuffer());else if(x3($))for await(let X of $)Z.push(...await k3(X));else{let X=$?.constructor?.name;throw Error(`Unexpected data type: ${typeof $}${X?`; constructor: ${X}`:""}${bM($)}`)}return Z}function bM($){if(typeof $!=="object"||$===null)return"";return`; props: [${Object.getOwnPropertyNames($).map((X)=>`"${X}"`).join(", ")}]`}var qz=($)=>$!=null&&typeof $==="object"&&typeof $.size==="number"&&typeof $.type==="string"&&typeof $.text==="function"&&typeof $.slice==="function"&&typeof $.arrayBuffer==="function",jM=($)=>$!=null&&typeof $==="object"&&typeof $.name==="string"&&typeof $.lastModified==="number"&&qz($),SM=($)=>$!=null&&typeof $==="object"&&typeof $.url==="string"&&typeof $.blob==="function";var Vz=b(()=>{M1();M1()});var y3=b(()=>{Vz()});var Kz=()=>{};class f{constructor($){this._client=$}}function*kM($){if(!$)return;if(Hz 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(D3($))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=D3(z[1])?z[1]:[z[1]],Y=!1;for(let U of Q){if(U===void 0)continue;if(Z&&!Y)Y=!0,yield[J,null];yield[J,U]}}}var Hz,O=($)=>{let Z=new Headers,X=new Set;for(let z of $){let J=new Set;for(let[Q,Y]of kM(z)){let U=Q.toLowerCase();if(!J.has(U))Z.delete(Q),J.add(U);if(Y===null)Z.delete(Q),X.add(U);else Z.append(Q,Y),X.delete(U)}}return{[Hz]:!0,values:Z,nulls:X}};var r=b(()=>{j$();Hz=Symbol.for("brand.privateNullableHeaders")});function Lz($){return $.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var Bz,yM=($=Lz)=>function(X,...z){if(X.length===1)return X[0];let J=!1,Q=[],Y=X.reduce((q,V,K)=>{if(/[?#]/.test(V))J=!0;let B=z[K],T=(J?encodeURIComponent:$)(""+B);if(K!==z.length&&(B==null||typeof B==="object"&&B.toString===Object.getPrototypeOf(Object.getPrototypeOf(B.hasOwnProperty??Bz)??Bz)?.toString))T=B+"",Q.push({start:q.length+V.length,length:T.length,error:`Value of type ${Object.prototype.toString.call(B).slice(8,-1)} is not a valid path parameter`});return q+V+(K===z.length?"":T)},""),U=Y.split(/[?#]/,1)[0],G=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,W;while((W=G.exec(U))!==null)Q.push({start:W.index,length:W[0].length,error:`Value "${W[0]}" can't be safely passed as a path parameter`});if(Q.sort((q,V)=>q.start-V.start),Q.length>0){let q=0,V=Q.reduce((K,B)=>{let T=" ".repeat(B.start-q),N="^".repeat(B.length);return q=B.start+B.length,K+T+N},"");throw new S(`Path parameters result in path with invalid segments:
170
170
  ${Q.map((K)=>K.error).join(`
171
171
  `)}
172
172
  ${Y}
173
- ${V}`)}return Y},I;var J0=b(()=>{M0();Yz=Object.freeze(Object.create(null)),I=LM(Uz)});var K4;var b3=b(()=>{t();r();J0();K4=class K4 extends f{create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/environments?beta=true",{body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(I`/v1/environments/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(I`/v1/environments/${$}?beta=true`,{body:J,...X,headers:O([{"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",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(I`/v1/environments/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(I`/v1/environments/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});function W6($){return typeof $==="object"&&$!==null&&H4 in $}function x3($,Z){let X=new Set;if($){for(let z of $)if(W6(z))X.add(z[H4])}if(Z)for(let z of Z){if(W6(z))X.add(z[H4]);if(Array.isArray(z.content)){for(let J of z.content)if(W6(J))X.add(J[H4])}}return Array.from(X)}function q6($,Z){let X=x3($,Z);if(X.length===0)return{};return{"x-stainless-helper":X.join(", ")}}function Gz($){if(W6($))return{"x-stainless-helper":$[H4]};return{}}var H4;var B4=b(()=>{H4=Symbol("anthropic.sdk.stainlessHelper")});var L4;var k3=b(()=>{t();r();B4();K1();J0();L4=class L4 extends f{list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/files?beta=true",x0,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"files-api-2025-04-14"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(I`/v1/files/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString()},X?.headers])})}download($,Z={},X){let{betas:z}=Z??{};return this._client.get(I`/v1/files/${$}/content?beta=true`,{...X,headers:O([{"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(I`/v1/files/${$}?beta=true`,{...X,headers:O([{"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",V1({body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"files-api-2025-04-14"].toString()},Gz(z.file),Z?.headers])},this._client))}}});var N4;var y3=b(()=>{t();r();J0();N4=class N4 extends f{retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(I`/v1/models/${$}?beta=true`,{...X,headers:O([{...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",x0,{query:z,...Z,headers:O([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers])})}}});var M4;var f3=b(()=>{t();r();J0();M4=class M4 extends f{create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/user_profiles?beta=true",{body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"user-profiles-2026-03-24"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(I`/v1/user_profiles/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"user-profiles-2026-03-24"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(I`/v1/user_profiles/${$}?beta=true`,{body:J,...X,headers:O([{"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",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"user-profiles-2026-03-24"].toString()},Z?.headers])})}createEnrollmentURL($,Z={},X){let{betas:z}=Z??{};return this._client.post(I`/v1/user_profiles/${$}/enrollment_url?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"user-profiles-2026-03-24"].toString()},X?.headers])})}}});var O4;var g3=b(()=>{t();r();J0();O4=class O4 extends f{list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(I`/v1/agents/${$}/versions?beta=true`,i,{query:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var H1;var h3=b(()=>{g3();g3();t();r();J0();H1=class H1 extends f{constructor(){super(...arguments);this.versions=new O4(this._client)}create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/agents?beta=true",{body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z,...J}=Z??{};return this._client.get(I`/v1/agents/${$}?beta=true`,{query:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(I`/v1/agents/${$}?beta=true`,{body:J,...X,headers:O([{"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",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(I`/v1/agents/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};H1.Versions=O4});var T4;var v3=b(()=>{t();r();J0();T4=class T4 extends f{create($,Z,X){let{view:z,betas:J,...Q}=Z;return this._client.post(I`/v1/memory_stores/${$}/memories?beta=true`,{query:{view:z},body:Q,...X,headers:O([{"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(I`/v1/memory_stores/${z}/memories/${$}?beta=true`,{query:Q,...X,headers:O([{"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(I`/v1/memory_stores/${z}/memories/${$}?beta=true`,{query:{view:J},body:Y,...X,headers:O([{"anthropic-beta":[...Q??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(I`/v1/memory_stores/${$}/memories?beta=true`,i,{query:J,...X,headers:O([{"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(I`/v1/memory_stores/${z}/memories/${$}?beta=true`,{query:{expected_content_sha256:J},...X,headers:O([{"anthropic-beta":[...Q??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var D4;var u3=b(()=>{t();r();J0();D4=class D4 extends f{retrieve($,Z,X){let{memory_store_id:z,betas:J,...Q}=Z;return this._client.get(I`/v1/memory_stores/${z}/memory_versions/${$}?beta=true`,{query:Q,...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(I`/v1/memory_stores/${$}/memory_versions?beta=true`,i,{query:J,...X,headers:O([{"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(I`/v1/memory_stores/${z}/memory_versions/${$}/redact?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var E$;var m3=b(()=>{v3();v3();u3();u3();t();r();J0();E$=class E$ extends f{constructor(){super(...arguments);this.memories=new T4(this._client),this.memoryVersions=new D4(this._client)}create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/memory_stores?beta=true",{body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(I`/v1/memory_stores/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(I`/v1/memory_stores/${$}?beta=true`,{body:J,...X,headers:O([{"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",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(I`/v1/memory_stores/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(I`/v1/memory_stores/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};E$.Memories=T4;E$.MemoryVersions=D4});var B1=b(()=>{M0()});var V6;var c3=b(()=>{V6={"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 Wz($){return $?.output_format??$?.output_config?.format}function d3($,Z,X){let z=Wz(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 p3($,Z,X)}function p3($,Z,X){let z=null,J=$.content.map((Q)=>{if(Q.type==="text"){let Y=wM(Z,Q.text);if(z===null)z=Y;let U=Object.defineProperty({...Q},"parsed_output",{value:Y,enumerable:!1});return Object.defineProperty(U,"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 wM($,Z){let X=Wz($);if(X?.type!=="json_schema")return null;try{if("parse"in X)return X.parse(Z);return JSON.parse(Z)}catch(z){throw new S(`Failed to parse structured output: ${z}`)}}var l3=b(()=>{M0()});var PM=($)=>{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 U="",G=!1;z=$[++Z];while(z!=='"'){if(Z===$.length){G=!0;break}if(z==="\\"){if(Z++,Z===$.length){G=!0;break}U+=z+$[Z],z=$[++Z]}else U+=z,z=$[++Z]}if(z=$[++Z],!G)X.push({type:"string",value:U});continue}if(z&&/\s/.test(z)){Z++;continue}let Q=/[0-9]/;if(z&&Q.test(z)||z==="-"||z==="."){let U="";if(z==="-")U+=z,z=$[++Z];while(z&&Q.test(z)||z===".")U+=z,z=$[++Z];X.push({type:"number",value:U});continue}let Y=/[a-z]/i;if(z&&Y.test(z)){let U="";while(z&&Y.test(z)){if(Z===$.length)break;U+=z,z=$[++Z]}if(U=="true"||U=="false"||U==="null")X.push({type:"name",value:U});else{Z++;continue}continue}Z++}return X},L1=($)=>{if($.length===0)return $;let Z=$[$.length-1];switch(Z.type){case"separator":return $=$.slice(0,$.length-1),L1($);break;case"number":let X=Z.value[Z.value.length-1];if(X==="."||X==="-")return $=$.slice(0,$.length-1),L1($);case"string":let z=$[$.length-2];if(z?.type==="delimiter")return $=$.slice(0,$.length-1),L1($);else if(z?.type==="brace"&&z.value==="{")return $=$.slice(0,$.length-1),L1($);break;case"delimiter":return $=$.slice(0,$.length-1),L1($);break}return $},_M=($)=>{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 $},CM=($)=>{let Z="";return $.map((X)=>{switch(X.type){case"string":Z+='"'+X.value+'"';break;default:Z+=X.value;break}}),Z},K6=($)=>JSON.parse(CM(_M(L1(PM($)))));var i3=()=>{};var n3=b(()=>{R3()});function Hz($){return $.type==="tool_use"||$.type==="server_tool_use"||$.type==="mcp_tool_use"}function Bz($){}var _0,V$,N1,I4,H6,A4,R4,B6,F4,n0,w4,L6,N6,j$,M6,O6,P4,r3,qz,T6,s3,a3,o3,Vz,Kz="__json_buf",_4;var Lz=b(()=>{p0();i3();B1();n3();l3();_4=class _4{constructor($,Z){_0.add(this),this.messages=[],this.receivedMessages=[],V$.set(this,void 0),N1.set(this,null),this.controller=new AbortController,I4.set(this,void 0),H6.set(this,()=>{}),A4.set(this,()=>{}),R4.set(this,void 0),B6.set(this,()=>{}),F4.set(this,()=>{}),n0.set(this,{}),w4.set(this,!1),L6.set(this,!1),N6.set(this,!1),j$.set(this,!1),M6.set(this,void 0),O6.set(this,void 0),P4.set(this,void 0),T6.set(this,(X)=>{if(w(this,L6,!0,"f"),l0(X))X=new V0;if(X instanceof V0)return w(this,N6,!0,"f"),this._emit("abort",X);if(X instanceof S)return this._emit("error",X);if(X instanceof Error){let z=new S(X.message);return z.cause=X,this._emit("error",z)}return this._emit("error",new S(String(X)))}),w(this,I4,new Promise((X,z)=>{w(this,H6,X,"f"),w(this,A4,z,"f")}),"f"),w(this,R4,new Promise((X,z)=>{w(this,B6,X,"f"),w(this,F4,z,"f")}),"f"),L(this,I4,"f").catch(()=>{}),L(this,R4,"f").catch(()=>{}),w(this,N1,$,"f"),w(this,P4,Z?.logger??console,"f")}get response(){return L(this,M6,"f")}get request_id(){return L(this,O6,"f")}async withResponse(){w(this,j$,!0,"f");let $=await L(this,I4,"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 _4(null);return Z._run(()=>Z._fromReadableStream($)),Z}static createMessage($,Z,X,{logger:z}={}){let J=new _4(Z,{logger:z});for(let Q of Z.messages)J._addMessageParam(Q);return w(J,N1,{...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")},L(this,T6,"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{L(this,_0,"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 U of Y)L(this,_0,"m",a3).call(this,U);if(Y.controller.signal?.aborted)throw new V0;L(this,_0,"m",o3).call(this)}finally{if(z&&J)z.removeEventListener("abort",J)}}_connected($){if(this.ended)return;w(this,M6,$,"f"),w(this,O6,$?.headers.get("request-id"),"f"),L(this,H6,"f").call(this,$),this._emit("connect")}get ended(){return L(this,w4,"f")}get errored(){return L(this,L6,"f")}get aborted(){return L(this,N6,"f")}abort(){this.controller.abort()}on($,Z){return(L(this,n0,"f")[$]||(L(this,n0,"f")[$]=[])).push({listener:Z}),this}off($,Z){let X=L(this,n0,"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(L(this,n0,"f")[$]||(L(this,n0,"f")[$]=[])).push({listener:Z,once:!0}),this}emitted($){return new Promise((Z,X)=>{if(w(this,j$,!0,"f"),$!=="error")this.once("error",X);this.once($,Z)})}async done(){w(this,j$,!0,"f"),await L(this,R4,"f")}get currentMessage(){return L(this,V$,"f")}async finalMessage(){return await this.done(),L(this,_0,"m",r3).call(this)}async finalText(){return await this.done(),L(this,_0,"m",qz).call(this)}_emit($,...Z){if(L(this,w4,"f"))return;if($==="end")w(this,w4,!0,"f"),L(this,B6,"f").call(this);let X=L(this,n0,"f")[$];if(X)L(this,n0,"f")[$]=X.filter((z)=>!z.once),X.forEach(({listener:z})=>z(...Z));if($==="abort"){let z=Z[0];if(!L(this,j$,"f")&&!X?.length)Promise.reject(z);L(this,A4,"f").call(this,z),L(this,F4,"f").call(this,z),this._emit("end");return}if($==="error"){let z=Z[0];if(!L(this,j$,"f")&&!X?.length)Promise.reject(z);L(this,A4,"f").call(this,z),L(this,F4,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",L(this,_0,"m",r3).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{L(this,_0,"m",s3).call(this),this._connected(null);let J=R0.fromReadableStream($,this.controller);for await(let Q of J)L(this,_0,"m",a3).call(this,Q);if(J.controller.signal?.aborted)throw new V0;L(this,_0,"m",o3).call(this)}finally{if(X&&z)X.removeEventListener("abort",z)}}[(V$=new WeakMap,N1=new WeakMap,I4=new WeakMap,H6=new WeakMap,A4=new WeakMap,R4=new WeakMap,B6=new WeakMap,F4=new WeakMap,n0=new WeakMap,w4=new WeakMap,L6=new WeakMap,N6=new WeakMap,j$=new WeakMap,M6=new WeakMap,O6=new WeakMap,P4=new WeakMap,T6=new WeakMap,_0=new WeakSet,r3=function(){if(this.receivedMessages.length===0)throw new S("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},qz=function(){if(this.receivedMessages.length===0)throw new S("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 S("stream ended without producing a content block with type=text");return Z.join(" ")},s3=function(){if(this.ended)return;w(this,V$,void 0,"f")},a3=function(Z){if(this.ended)return;let X=L(this,_0,"m",Vz).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(Hz(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:Bz(Z.delta)}break}case"message_stop":{this._addMessageParam(X),this._addMessage(d3(X,L(this,N1,"f"),{logger:L(this,P4,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",X.content.at(-1));break}case"message_start":{w(this,V$,X,"f");break}case"content_block_start":case"message_delta":break}},o3=function(){if(this.ended)throw new S("stream has ended, this shouldn't happen");let Z=L(this,V$,"f");if(!Z)throw new S("request ended without sending any chunks");return w(this,V$,void 0,"f"),d3(Z,L(this,N1,"f"),{logger:L(this,P4,"f")})},Vz=function(Z){let X=L(this,V$,"f");if(Z.type==="message_start"){if(X)throw new S(`Unexpected event order, got ${Z.type} before receiving "message_stop"`);return Z.message}if(!X)throw new S(`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&&Hz(z)){let J=z[Kz]||"";J+=Z.delta.partial_json;let Q={...z};if(Object.defineProperty(Q,Kz,{value:J,enumerable:!1,writable:!0}),J)try{Q.input=K6(J)}catch(Y){let U=new S(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${Y}. JSON: ${J}`);L(this,T6,"f").call(this,U)}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:Bz(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 R0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var M1;var D6=b(()=>{M1=class M1 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 Nz=1e5,Mz=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:
173
+ ${V}`)}return Y},A;var J0=b(()=>{O0();Bz=Object.freeze(Object.create(null)),A=yM(Lz)});var M4;var f3=b(()=>{t();r();J0();M4=class M4 extends f{create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/environments?beta=true",{body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/environments/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/environments/${$}?beta=true`,{body:J,...X,headers:O([{"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",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(A`/v1/environments/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(A`/v1/environments/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});function H6($){return typeof $==="object"&&$!==null&&O4 in $}function g3($,Z){let X=new Set;if($){for(let z of $)if(H6(z))X.add(z[O4])}if(Z)for(let z of Z){if(H6(z))X.add(z[O4]);if(Array.isArray(z.content)){for(let J of z.content)if(H6(J))X.add(J[O4])}}return Array.from(X)}function B6($,Z){let X=g3($,Z);if(X.length===0)return{};return{"x-stainless-helper":X.join(", ")}}function Nz($){if(H6($))return{"x-stainless-helper":$[O4]};return{}}var O4;var T4=b(()=>{O4=Symbol("anthropic.sdk.stainlessHelper")});var D4;var v3=b(()=>{t();r();T4();M1();J0();D4=class D4 extends f{list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/files?beta=true",y0,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"files-api-2025-04-14"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(A`/v1/files/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString()},X?.headers])})}download($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/files/${$}/content?beta=true`,{...X,headers:O([{"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(A`/v1/files/${$}?beta=true`,{...X,headers:O([{"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",N1({body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"files-api-2025-04-14"].toString()},Nz(z.file),Z?.headers])},this._client))}}});var I4;var h3=b(()=>{t();r();J0();I4=class I4 extends f{retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/models/${$}?beta=true`,{...X,headers:O([{...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",y0,{query:z,...Z,headers:O([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers])})}}});var A4;var u3=b(()=>{t();r();J0();A4=class A4 extends f{create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/user_profiles?beta=true",{body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"user-profiles-2026-03-24"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/user_profiles/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"user-profiles-2026-03-24"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/user_profiles/${$}?beta=true`,{body:J,...X,headers:O([{"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",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"user-profiles-2026-03-24"].toString()},Z?.headers])})}createEnrollmentURL($,Z={},X){let{betas:z}=Z??{};return this._client.post(A`/v1/user_profiles/${$}/enrollment_url?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"user-profiles-2026-03-24"].toString()},X?.headers])})}}});var R4;var m3=b(()=>{t();r();J0();R4=class R4 extends f{list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(A`/v1/agents/${$}/versions?beta=true`,i,{query:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var O1;var c3=b(()=>{m3();m3();t();r();J0();O1=class O1 extends f{constructor(){super(...arguments);this.versions=new R4(this._client)}create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/agents?beta=true",{body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z,...J}=Z??{};return this._client.get(A`/v1/agents/${$}?beta=true`,{query:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/agents/${$}?beta=true`,{body:J,...X,headers:O([{"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",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(A`/v1/agents/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};O1.Versions=R4});var F4;var d3=b(()=>{t();r();J0();F4=class F4 extends f{create($,Z,X){let{view:z,betas:J,...Q}=Z;return this._client.post(A`/v1/memory_stores/${$}/memories?beta=true`,{query:{view:z},body:Q,...X,headers:O([{"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(A`/v1/memory_stores/${z}/memories/${$}?beta=true`,{query:Q,...X,headers:O([{"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(A`/v1/memory_stores/${z}/memories/${$}?beta=true`,{query:{view:J},body:Y,...X,headers:O([{"anthropic-beta":[...Q??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(A`/v1/memory_stores/${$}/memories?beta=true`,i,{query:J,...X,headers:O([{"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(A`/v1/memory_stores/${z}/memories/${$}?beta=true`,{query:{expected_content_sha256:J},...X,headers:O([{"anthropic-beta":[...Q??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var w4;var p3=b(()=>{t();r();J0();w4=class w4 extends f{retrieve($,Z,X){let{memory_store_id:z,betas:J,...Q}=Z;return this._client.get(A`/v1/memory_stores/${z}/memory_versions/${$}?beta=true`,{query:Q,...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(A`/v1/memory_stores/${$}/memory_versions?beta=true`,i,{query:J,...X,headers:O([{"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(A`/v1/memory_stores/${z}/memory_versions/${$}/redact?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var b$;var l3=b(()=>{d3();d3();p3();p3();t();r();J0();b$=class b$ extends f{constructor(){super(...arguments);this.memories=new F4(this._client),this.memoryVersions=new w4(this._client)}create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/memory_stores?beta=true",{body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/memory_stores/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/memory_stores/${$}?beta=true`,{body:J,...X,headers:O([{"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",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(A`/v1/memory_stores/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(A`/v1/memory_stores/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};b$.Memories=F4;b$.MemoryVersions=w4});var T1=b(()=>{O0()});var L6;var i3=b(()=>{L6={"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 Mz($){return $?.output_format??$?.output_config?.format}function n3($,Z,X){let z=Mz(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 r3($,Z,X)}function r3($,Z,X){let z=null,J=$.content.map((Q)=>{if(Q.type==="text"){let Y=lM(Z,Q.text);if(z===null)z=Y;let U=Object.defineProperty({...Q},"parsed_output",{value:Y,enumerable:!1});return Object.defineProperty(U,"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 lM($,Z){let X=Mz($);if(X?.type!=="json_schema")return null;try{if("parse"in X)return X.parse(Z);return JSON.parse(Z)}catch(z){throw new S(`Failed to parse structured output: ${z}`)}}var s3=b(()=>{O0()});var iM=($)=>{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 U="",G=!1;z=$[++Z];while(z!=='"'){if(Z===$.length){G=!0;break}if(z==="\\"){if(Z++,Z===$.length){G=!0;break}U+=z+$[Z],z=$[++Z]}else U+=z,z=$[++Z]}if(z=$[++Z],!G)X.push({type:"string",value:U});continue}if(z&&/\s/.test(z)){Z++;continue}let Q=/[0-9]/;if(z&&Q.test(z)||z==="-"||z==="."){let U="";if(z==="-")U+=z,z=$[++Z];while(z&&Q.test(z)||z===".")U+=z,z=$[++Z];X.push({type:"number",value:U});continue}let Y=/[a-z]/i;if(z&&Y.test(z)){let U="";while(z&&Y.test(z)){if(Z===$.length)break;U+=z,z=$[++Z]}if(U=="true"||U=="false"||U==="null")X.push({type:"name",value:U});else{Z++;continue}continue}Z++}return X},D1=($)=>{if($.length===0)return $;let Z=$[$.length-1];switch(Z.type){case"separator":return $=$.slice(0,$.length-1),D1($);break;case"number":let X=Z.value[Z.value.length-1];if(X==="."||X==="-")return $=$.slice(0,$.length-1),D1($);case"string":let z=$[$.length-2];if(z?.type==="delimiter")return $=$.slice(0,$.length-1),D1($);else if(z?.type==="brace"&&z.value==="{")return $=$.slice(0,$.length-1),D1($);break;case"delimiter":return $=$.slice(0,$.length-1),D1($);break}return $},nM=($)=>{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 $},rM=($)=>{let Z="";return $.map((X)=>{switch(X.type){case"string":Z+='"'+X.value+'"';break;default:Z+=X.value;break}}),Z},N6=($)=>JSON.parse(rM(nM(D1(iM($)))));var a3=()=>{};var o3=b(()=>{_3()});function Iz($){return $.type==="tool_use"||$.type==="server_tool_use"||$.type==="mcp_tool_use"}function Az($){}var E0,B$,I1,P4,M6,_4,C4,O6,E4,o0,j4,T6,D6,x$,I6,A6,S4,t3,Oz,R6,e3,$Z,ZZ,Tz,Dz="__json_buf",b4;var Rz=b(()=>{r0();a3();T1();o3();s3();b4=class b4{constructor($,Z){E0.add(this),this.messages=[],this.receivedMessages=[],B$.set(this,void 0),I1.set(this,null),this.controller=new AbortController,P4.set(this,void 0),M6.set(this,()=>{}),_4.set(this,()=>{}),C4.set(this,void 0),O6.set(this,()=>{}),E4.set(this,()=>{}),o0.set(this,{}),j4.set(this,!1),T6.set(this,!1),D6.set(this,!1),x$.set(this,!1),I6.set(this,void 0),A6.set(this,void 0),S4.set(this,void 0),R6.set(this,(X)=>{if(w(this,T6,!0,"f"),s0(X))X=new V0;if(X instanceof V0)return w(this,D6,!0,"f"),this._emit("abort",X);if(X instanceof S)return this._emit("error",X);if(X instanceof Error){let z=new S(X.message);return z.cause=X,this._emit("error",z)}return this._emit("error",new S(String(X)))}),w(this,P4,new Promise((X,z)=>{w(this,M6,X,"f"),w(this,_4,z,"f")}),"f"),w(this,C4,new Promise((X,z)=>{w(this,O6,X,"f"),w(this,E4,z,"f")}),"f"),L(this,P4,"f").catch(()=>{}),L(this,C4,"f").catch(()=>{}),w(this,I1,$,"f"),w(this,S4,Z?.logger??console,"f")}get response(){return L(this,I6,"f")}get request_id(){return L(this,A6,"f")}async withResponse(){w(this,x$,!0,"f");let $=await L(this,P4,"f");if(!$)throw Error("Could not resolve a `Response` object");return{data:this,response:$,request_id:$.headers.get("request-id")}}static fromReadableStream($){let Z=new b4(null);return Z._run(()=>Z._fromReadableStream($)),Z}static createMessage($,Z,X,{logger:z}={}){let J=new b4(Z,{logger:z});for(let Q of Z.messages)J._addMessageParam(Q);return w(J,I1,{...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")},L(this,R6,"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{L(this,E0,"m",e3).call(this);let{response:Q,data:Y}=await $.create({...Z,stream:!0},{...X,signal:this.controller.signal}).withResponse();this._connected(Q);for await(let U of Y)L(this,E0,"m",$Z).call(this,U);if(Y.controller.signal?.aborted)throw new V0;L(this,E0,"m",ZZ).call(this)}finally{if(z&&J)z.removeEventListener("abort",J)}}_connected($){if(this.ended)return;w(this,I6,$,"f"),w(this,A6,$?.headers.get("request-id"),"f"),L(this,M6,"f").call(this,$),this._emit("connect")}get ended(){return L(this,j4,"f")}get errored(){return L(this,T6,"f")}get aborted(){return L(this,D6,"f")}abort(){this.controller.abort()}on($,Z){return(L(this,o0,"f")[$]||(L(this,o0,"f")[$]=[])).push({listener:Z}),this}off($,Z){let X=L(this,o0,"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(L(this,o0,"f")[$]||(L(this,o0,"f")[$]=[])).push({listener:Z,once:!0}),this}emitted($){return new Promise((Z,X)=>{if(w(this,x$,!0,"f"),$!=="error")this.once("error",X);this.once($,Z)})}async done(){w(this,x$,!0,"f"),await L(this,C4,"f")}get currentMessage(){return L(this,B$,"f")}async finalMessage(){return await this.done(),L(this,E0,"m",t3).call(this)}async finalText(){return await this.done(),L(this,E0,"m",Oz).call(this)}_emit($,...Z){if(L(this,j4,"f"))return;if($==="end")w(this,j4,!0,"f"),L(this,O6,"f").call(this);let X=L(this,o0,"f")[$];if(X)L(this,o0,"f")[$]=X.filter((z)=>!z.once),X.forEach(({listener:z})=>z(...Z));if($==="abort"){let z=Z[0];if(!L(this,x$,"f")&&!X?.length)Promise.reject(z);L(this,_4,"f").call(this,z),L(this,E4,"f").call(this,z),this._emit("end");return}if($==="error"){let z=Z[0];if(!L(this,x$,"f")&&!X?.length)Promise.reject(z);L(this,_4,"f").call(this,z),L(this,E4,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",L(this,E0,"m",t3).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{L(this,E0,"m",e3).call(this),this._connected(null);let J=w0.fromReadableStream($,this.controller);for await(let Q of J)L(this,E0,"m",$Z).call(this,Q);if(J.controller.signal?.aborted)throw new V0;L(this,E0,"m",ZZ).call(this)}finally{if(X&&z)X.removeEventListener("abort",z)}}[(B$=new WeakMap,I1=new WeakMap,P4=new WeakMap,M6=new WeakMap,_4=new WeakMap,C4=new WeakMap,O6=new WeakMap,E4=new WeakMap,o0=new WeakMap,j4=new WeakMap,T6=new WeakMap,D6=new WeakMap,x$=new WeakMap,I6=new WeakMap,A6=new WeakMap,S4=new WeakMap,R6=new WeakMap,E0=new WeakSet,t3=function(){if(this.receivedMessages.length===0)throw new S("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},Oz=function(){if(this.receivedMessages.length===0)throw new S("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 S("stream ended without producing a content block with type=text");return Z.join(" ")},e3=function(){if(this.ended)return;w(this,B$,void 0,"f")},$Z=function(Z){if(this.ended)return;let X=L(this,E0,"m",Tz).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(Iz(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:Az(Z.delta)}break}case"message_stop":{this._addMessageParam(X),this._addMessage(n3(X,L(this,I1,"f"),{logger:L(this,S4,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",X.content.at(-1));break}case"message_start":{w(this,B$,X,"f");break}case"content_block_start":case"message_delta":break}},ZZ=function(){if(this.ended)throw new S("stream has ended, this shouldn't happen");let Z=L(this,B$,"f");if(!Z)throw new S("request ended without sending any chunks");return w(this,B$,void 0,"f"),n3(Z,L(this,I1,"f"),{logger:L(this,S4,"f")})},Tz=function(Z){let X=L(this,B$,"f");if(Z.type==="message_start"){if(X)throw new S(`Unexpected event order, got ${Z.type} before receiving "message_stop"`);return Z.message}if(!X)throw new S(`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&&Iz(z)){let J=z[Dz]||"";J+=Z.delta.partial_json;let Q={...z};if(Object.defineProperty(Q,Dz,{value:J,enumerable:!1,writable:!0}),J)try{Q.input=N6(J)}catch(Y){let U=new S(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${Y}. JSON: ${J}`);L(this,R6,"f").call(this,U)}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:Az(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 A1;var F6=b(()=>{A1=class A1 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 Fz=1e5,wz=`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,65 +192,66 @@ 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 Tz(){let $,Z;return{promise:new Promise((z,J)=>{$=z,Z=J}),resolve:$,reject:Z}}async function EM($,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((U)=>("name"in U?U.name:U.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 U=Q.input;if("parse"in Y&&Y.parse)U=Y.parse(U);let G=await Y.run(U,{toolUseBlock:Q,signal:X?.signal});return{type:"tool_result",tool_use_id:Q.id,content:G}}catch(U){return{type:"tool_result",tool_use_id:Q.id,content:U instanceof M1?U.content:`Error: ${U instanceof Error?U.message:String(U)}`,is_error:!0}}}))}}var C4,O1,S$,G0,O0,F0,r0,K$,E4,Oz,t3,j4;var e3=b(()=>{p0();D6();M0();r();B4();j4=class j4{constructor($,Z,X){C4.add(this),this.client=$,O1.set(this,!1),S$.set(this,!1),G0.set(this,void 0),O0.set(this,void 0),F0.set(this,void 0),r0.set(this,void 0),K$.set(this,void 0),E4.set(this,0),w(this,G0,{params:{...Z,messages:structuredClone(Z.messages)}},"f");let J=["BetaToolRunner",...x3(Z.tools,Z.messages)].join(", ");if(w(this,O0,{...X,headers:O([{"x-stainless-helper":J},X?.headers])},"f"),w(this,K$,Tz(),"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*[(O1=new WeakMap,S$=new WeakMap,G0=new WeakMap,O0=new WeakMap,F0=new WeakMap,r0=new WeakMap,K$=new WeakMap,E4=new WeakMap,C4=new WeakSet,Oz=async function(){let Z=L(this,G0,"f").params.compactionControl;if(!Z||!Z.enabled)return!1;let X=0;if(L(this,F0,"f")!==void 0)try{let G=await L(this,F0,"f");X=G.usage.input_tokens+(G.usage.cache_creation_input_tokens??0)+(G.usage.cache_read_input_tokens??0)+G.usage.output_tokens}catch{return!1}let z=Z.contextTokenThreshold??Nz;if(X<z)return!1;let J=Z.model??L(this,G0,"f").params.model,Q=Z.summaryPrompt??Mz,Y=L(this,G0,"f").params.messages;if(Y[Y.length-1].role==="assistant"){let G=Y[Y.length-1];if(Array.isArray(G.content)){let W=G.content.filter((q)=>q.type!=="tool_use");if(W.length===0)Y.pop();else G.content=W}}let U=await this.client.beta.messages.create({model:J,messages:[...Y,{role:"user",content:[{type:"text",text:Q}]}],max_tokens:L(this,G0,"f").params.max_tokens},{signal:L(this,O0,"f").signal,headers:O([L(this,O0,"f").headers,{"x-stainless-helper":"compaction"}])});if(U.content[0]?.type!=="text")throw new S("Expected text response for compaction");return L(this,G0,"f").params.messages=[{role:"user",content:U.content}],!0},Symbol.asyncIterator)](){var $;if(L(this,O1,"f"))throw new S("Cannot iterate over a consumed stream");w(this,O1,!0,"f"),w(this,S$,!0,"f"),w(this,r0,void 0,"f");try{while(!0){let Z;try{if(L(this,G0,"f").params.max_iterations&&L(this,E4,"f")>=L(this,G0,"f").params.max_iterations)break;w(this,S$,!1,"f"),w(this,r0,void 0,"f"),w(this,E4,($=L(this,E4,"f"),$++,$),"f"),w(this,F0,void 0,"f");let{max_iterations:X,compactionControl:z,...J}=L(this,G0,"f").params;if(J.stream)Z=this.client.beta.messages.stream({...J},L(this,O0,"f")),w(this,F0,Z.finalMessage(),"f"),L(this,F0,"f").catch(()=>{}),yield Z;else w(this,F0,this.client.beta.messages.create({...J,stream:!1},L(this,O0,"f")),"f"),yield L(this,F0,"f");if(!await L(this,C4,"m",Oz).call(this)){if(!L(this,S$,"f")){let{role:U,content:G}=await L(this,F0,"f");L(this,G0,"f").params.messages.push({role:U,content:G})}let Y=await L(this,C4,"m",t3).call(this,L(this,G0,"f").params.messages.at(-1));if(Y)L(this,G0,"f").params.messages.push(Y);else if(!L(this,S$,"f"))break}}finally{if(Z)Z.abort()}}if(!L(this,F0,"f"))throw new S("ToolRunner concluded without a message from the server");L(this,K$,"f").resolve(await L(this,F0,"f"))}catch(Z){throw w(this,O1,!1,"f"),L(this,K$,"f").promise.catch(()=>{}),L(this,K$,"f").reject(Z),w(this,K$,Tz(),"f"),Z}}setMessagesParams($){if(typeof $==="function")L(this,G0,"f").params=$(L(this,G0,"f").params);else L(this,G0,"f").params=$;w(this,S$,!0,"f"),w(this,r0,void 0,"f")}setRequestOptions($){if(typeof $==="function")w(this,O0,$(L(this,O0,"f")),"f");else w(this,O0,{...L(this,O0,"f"),...$},"f")}async generateToolResponse($=L(this,O0,"f").signal){let Z=await L(this,F0,"f")??this.params.messages.at(-1);if(!Z)return null;return L(this,C4,"m",t3).call(this,Z,$)}done(){return L(this,K$,"f").promise}async runUntilDone(){if(!L(this,O1,"f"))for await(let $ of this);return this.done()}get params(){return L(this,G0,"f").params}pushMessages(...$){this.setMessagesParams((Z)=>({...Z,messages:[...Z.messages,...$]}))}then($,Z){return this.runUntilDone().then($,Z)}};t3=async function(Z,X=L(this,O0,"f").signal){if(L(this,r0,"f")!==void 0)return L(this,r0,"f");return w(this,r0,EM(L(this,G0,"f").params,Z,{...L(this,O0,"f"),signal:X}),"f"),L(this,r0,"f")}});var T1;var $Z=b(()=>{M0();I3();T1=class T1{constructor($,Z){this.iterator=$,this.controller=Z}async*decoder(){let $=new W$;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 S("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 S("Attempted to iterate over a response with no body")}return new T1(J4($.body),Z)}}});var S4;var ZZ=b(()=>{t();r();$Z();B1();J0();S4=class S4 extends f{create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/messages/batches?beta=true",{body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"message-batches-2024-09-24"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(I`/v1/messages/batches/${$}?beta=true`,{...X,headers:O([{"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",x0,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"message-batches-2024-09-24"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(I`/v1/messages/batches/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},X?.headers])})}cancel($,Z={},X){let{betas:z}=Z??{};return this._client.post(I`/v1/messages/batches/${$}/cancel?beta=true`,{...X,headers:O([{"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 S(`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:O([{"anthropic-beta":[...J??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},X?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((Q,Y)=>T1.fromResponse(Y.response,Y.controller))}}});function Iz($){if(!$.output_format)return $;if($.output_config?.format)throw new S("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 Dz,SM,H$;var XZ=b(()=>{B1();c3();r();B4();l3();Lz();e3();D6();ZZ();ZZ();e3();D6();Dz={"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"},SM=["claude-mythos-preview","claude-opus-4-6"];H$=class H$ extends f{constructor(){super(...arguments);this.batches=new S4(this._client)}create($,Z){let X=Iz($),{betas:z,...J}=X;if(J.model in Dz)console.warn(`The model '${J.model}' is deprecated and will reach end-of-life on ${Dz[J.model]}
196
- Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(SM.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 U=V6[J.model]??void 0;Q=this._client.calculateNonstreamingTimeout(J.max_tokens,U)}let Y=q6(J.tools,J.messages);return this._client.post("/v1/messages?beta=true",{body:J,timeout:Q??600000,...Z,headers:O([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},Y,Z?.headers]),stream:X.stream??!1})}parse($,Z){return Z={...Z,headers:O([{"anthropic-beta":[...$.betas??[],"structured-outputs-2025-12-15"].toString()},Z?.headers])},this.create($,Z).then((X)=>p3(X,$,{logger:this._client.logger??console}))}stream($,Z){return _4.createMessage(this,$,Z)}countTokens($,Z){let X=Iz($),{betas:z,...J}=X;return this._client.post("/v1/messages/count_tokens?beta=true",{body:J,...Z,headers:O([{"anthropic-beta":[...z??[],"token-counting-2024-11-01"].toString()},Z?.headers])})}toolRunner($,Z){return new j4(this._client,$,Z)}};H$.Batches=S4;H$.BetaToolRunner=j4;H$.ToolError=M1});var b4;var zZ=b(()=>{t();r();J0();b4=class b4 extends f{list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(I`/v1/sessions/${$}/events?beta=true`,i,{query:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}send($,Z,X){let{betas:z,...J}=Z;return this._client.post(I`/v1/sessions/${$}/events?beta=true`,{body:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}stream($,Z={},X){let{betas:z}=Z??{};return this._client.get(I`/v1/sessions/${$}/events/stream?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers]),stream:!0})}}});var x4;var JZ=b(()=>{t();r();J0();x4=class x4 extends f{retrieve($,Z,X){let{session_id:z,betas:J}=Z;return this._client.get(I`/v1/sessions/${z}/resources/${$}?beta=true`,{...X,headers:O([{"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(I`/v1/sessions/${z}/resources/${$}?beta=true`,{body:Q,...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(I`/v1/sessions/${$}/resources?beta=true`,i,{query:J,...X,headers:O([{"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(I`/v1/sessions/${z}/resources/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}add($,Z,X){let{betas:z,...J}=Z;return this._client.post(I`/v1/sessions/${$}/resources?beta=true`,{body:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var b$;var QZ=b(()=>{zZ();zZ();JZ();JZ();t();r();J0();b$=class b$ extends f{constructor(){super(...arguments);this.events=new b4(this._client),this.resources=new x4(this._client)}create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/sessions?beta=true",{body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(I`/v1/sessions/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(I`/v1/sessions/${$}?beta=true`,{body:J,...X,headers:O([{"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",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(I`/v1/sessions/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(I`/v1/sessions/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};b$.Events=b4;b$.Resources=x4});var k4;var YZ=b(()=>{t();r();K1();J0();k4=class k4 extends f{create($,Z={},X){let{betas:z,...J}=Z??{};return this._client.post(I`/v1/skills/${$}/versions?beta=true`,V1({body:J,...X,headers:O([{"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(I`/v1/skills/${z}/versions/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(I`/v1/skills/${$}/versions?beta=true`,i,{query:J,...X,headers:O([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}delete($,Z,X){let{skill_id:z,betas:J}=Z;return this._client.delete(I`/v1/skills/${z}/versions/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])})}}});var D1;var UZ=b(()=>{YZ();YZ();t();r();K1();J0();D1=class D1 extends f{constructor(){super(...arguments);this.versions=new k4(this._client)}create($={},Z){let{betas:X,...z}=$??{};return this._client.post("/v1/skills?beta=true",V1({body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"skills-2025-10-02"].toString()},Z?.headers])},this._client,!1))}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(I`/v1/skills/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/skills?beta=true",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"skills-2025-10-02"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(I`/v1/skills/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}};D1.Versions=k4});var y4;var GZ=b(()=>{t();r();J0();y4=class y4 extends f{create($,Z,X){let{betas:z,...J}=Z;return this._client.post(I`/v1/vaults/${$}/credentials?beta=true`,{body:J,...X,headers:O([{"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(I`/v1/vaults/${z}/credentials/${$}?beta=true`,{...X,headers:O([{"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(I`/v1/vaults/${z}/credentials/${$}?beta=true`,{body:Q,...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(I`/v1/vaults/${$}/credentials?beta=true`,i,{query:J,...X,headers:O([{"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(I`/v1/vaults/${z}/credentials/${$}?beta=true`,{...X,headers:O([{"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(I`/v1/vaults/${z}/credentials/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var I1;var WZ=b(()=>{GZ();GZ();t();r();J0();I1=class I1 extends f{constructor(){super(...arguments);this.credentials=new y4(this._client)}create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/vaults?beta=true",{body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(I`/v1/vaults/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(I`/v1/vaults/${$}?beta=true`,{body:J,...X,headers:O([{"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",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(I`/v1/vaults/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(I`/v1/vaults/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};I1.Credentials=y4});var L0;var qZ=b(()=>{b3();b3();k3();k3();y3();y3();f3();f3();h3();h3();m3();m3();XZ();XZ();QZ();QZ();UZ();UZ();WZ();WZ();L0=class L0 extends f{constructor(){super(...arguments);this.models=new N4(this._client),this.messages=new H$(this._client),this.agents=new H1(this._client),this.environments=new K4(this._client),this.sessions=new b$(this._client),this.vaults=new I1(this._client),this.memoryStores=new E$(this._client),this.files=new L4(this._client),this.skills=new D1(this._client),this.userProfiles=new M4(this._client)}};L0.Models=N4;L0.Messages=H$;L0.Agents=H1;L0.Environments=K4;L0.Sessions=b$;L0.Vaults=I1;L0.MemoryStores=E$;L0.Files=L4;L0.Skills=D1;L0.UserProfiles=M4});var A1;var VZ=b(()=>{r();A1=class A1 extends f{create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/complete",{body:z,timeout:this._client._options.timeout??600000,...Z,headers:O([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers]),stream:$.stream??!1})}}});function Az($){return $?.output_config?.format}function KZ($,Z,X){let z=Az(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 HZ($,Z,X)}function HZ($,Z,X){let z=null,J=$.content.map((Q)=>{if(Q.type==="text"){let Y=uM(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 uM($,Z){let X=Az($);if(X?.type!=="json_schema")return null;try{if("parse"in X)return X.parse(Z);return JSON.parse(Z)}catch(z){throw new S(`Failed to parse structured output: ${z}`)}}var BZ=b(()=>{M0()});function Pz($){return $.type==="tool_use"||$.type==="server_tool_use"}function _z($){}var C0,B$,R1,f4,I6,g4,h4,A6,v4,s0,u4,R6,F6,x$,w6,P6,m4,LZ,Rz,NZ,MZ,OZ,TZ,Fz,wz="__json_buf",c4;var Cz=b(()=>{p0();B1();n3();i3();BZ();c4=class c4{constructor($,Z){C0.add(this),this.messages=[],this.receivedMessages=[],B$.set(this,void 0),R1.set(this,null),this.controller=new AbortController,f4.set(this,void 0),I6.set(this,()=>{}),g4.set(this,()=>{}),h4.set(this,void 0),A6.set(this,()=>{}),v4.set(this,()=>{}),s0.set(this,{}),u4.set(this,!1),R6.set(this,!1),F6.set(this,!1),x$.set(this,!1),w6.set(this,void 0),P6.set(this,void 0),m4.set(this,void 0),NZ.set(this,(X)=>{if(w(this,R6,!0,"f"),l0(X))X=new V0;if(X instanceof V0)return w(this,F6,!0,"f"),this._emit("abort",X);if(X instanceof S)return this._emit("error",X);if(X instanceof Error){let z=new S(X.message);return z.cause=X,this._emit("error",z)}return this._emit("error",new S(String(X)))}),w(this,f4,new Promise((X,z)=>{w(this,I6,X,"f"),w(this,g4,z,"f")}),"f"),w(this,h4,new Promise((X,z)=>{w(this,A6,X,"f"),w(this,v4,z,"f")}),"f"),L(this,f4,"f").catch(()=>{}),L(this,h4,"f").catch(()=>{}),w(this,R1,$,"f"),w(this,m4,Z?.logger??console,"f")}get response(){return L(this,w6,"f")}get request_id(){return L(this,P6,"f")}async withResponse(){w(this,x$,!0,"f");let $=await L(this,f4,"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 c4(null);return Z._run(()=>Z._fromReadableStream($)),Z}static createMessage($,Z,X,{logger:z}={}){let J=new c4(Z,{logger:z});for(let Q of Z.messages)J._addMessageParam(Q);return w(J,R1,{...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")},L(this,NZ,"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{L(this,C0,"m",MZ).call(this);let{response:Q,data:Y}=await $.create({...Z,stream:!0},{...X,signal:this.controller.signal}).withResponse();this._connected(Q);for await(let U of Y)L(this,C0,"m",OZ).call(this,U);if(Y.controller.signal?.aborted)throw new V0;L(this,C0,"m",TZ).call(this)}finally{if(z&&J)z.removeEventListener("abort",J)}}_connected($){if(this.ended)return;w(this,w6,$,"f"),w(this,P6,$?.headers.get("request-id"),"f"),L(this,I6,"f").call(this,$),this._emit("connect")}get ended(){return L(this,u4,"f")}get errored(){return L(this,R6,"f")}get aborted(){return L(this,F6,"f")}abort(){this.controller.abort()}on($,Z){return(L(this,s0,"f")[$]||(L(this,s0,"f")[$]=[])).push({listener:Z}),this}off($,Z){let X=L(this,s0,"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(L(this,s0,"f")[$]||(L(this,s0,"f")[$]=[])).push({listener:Z,once:!0}),this}emitted($){return new Promise((Z,X)=>{if(w(this,x$,!0,"f"),$!=="error")this.once("error",X);this.once($,Z)})}async done(){w(this,x$,!0,"f"),await L(this,h4,"f")}get currentMessage(){return L(this,B$,"f")}async finalMessage(){return await this.done(),L(this,C0,"m",LZ).call(this)}async finalText(){return await this.done(),L(this,C0,"m",Rz).call(this)}_emit($,...Z){if(L(this,u4,"f"))return;if($==="end")w(this,u4,!0,"f"),L(this,A6,"f").call(this);let X=L(this,s0,"f")[$];if(X)L(this,s0,"f")[$]=X.filter((z)=>!z.once),X.forEach(({listener:z})=>z(...Z));if($==="abort"){let z=Z[0];if(!L(this,x$,"f")&&!X?.length)Promise.reject(z);L(this,g4,"f").call(this,z),L(this,v4,"f").call(this,z),this._emit("end");return}if($==="error"){let z=Z[0];if(!L(this,x$,"f")&&!X?.length)Promise.reject(z);L(this,g4,"f").call(this,z),L(this,v4,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",L(this,C0,"m",LZ).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{L(this,C0,"m",MZ).call(this),this._connected(null);let J=R0.fromReadableStream($,this.controller);for await(let Q of J)L(this,C0,"m",OZ).call(this,Q);if(J.controller.signal?.aborted)throw new V0;L(this,C0,"m",TZ).call(this)}finally{if(X&&z)X.removeEventListener("abort",z)}}[(B$=new WeakMap,R1=new WeakMap,f4=new WeakMap,I6=new WeakMap,g4=new WeakMap,h4=new WeakMap,A6=new WeakMap,v4=new WeakMap,s0=new WeakMap,u4=new WeakMap,R6=new WeakMap,F6=new WeakMap,x$=new WeakMap,w6=new WeakMap,P6=new WeakMap,m4=new WeakMap,NZ=new WeakMap,C0=new WeakSet,LZ=function(){if(this.receivedMessages.length===0)throw new S("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},Rz=function(){if(this.receivedMessages.length===0)throw new S("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 S("stream ended without producing a content block with type=text");return Z.join(" ")},MZ=function(){if(this.ended)return;w(this,B$,void 0,"f")},OZ=function(Z){if(this.ended)return;let X=L(this,C0,"m",Fz).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(Pz(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:_z(Z.delta)}break}case"message_stop":{this._addMessageParam(X),this._addMessage(KZ(X,L(this,R1,"f"),{logger:L(this,m4,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",X.content.at(-1));break}case"message_start":{w(this,B$,X,"f");break}case"content_block_start":case"message_delta":break}},TZ=function(){if(this.ended)throw new S("stream has ended, this shouldn't happen");let Z=L(this,B$,"f");if(!Z)throw new S("request ended without sending any chunks");return w(this,B$,void 0,"f"),KZ(Z,L(this,R1,"f"),{logger:L(this,m4,"f")})},Fz=function(Z){let X=L(this,B$,"f");if(Z.type==="message_start"){if(X)throw new S(`Unexpected event order, got ${Z.type} before receiving "message_stop"`);return Z.message}if(!X)throw new S(`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&&Pz(z)){let J=z[wz]||"";J+=Z.delta.partial_json;let Q={...z};if(Object.defineProperty(Q,wz,{value:J,enumerable:!1,writable:!0}),J)Q.input=K6(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:_z(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 R0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var d4;var DZ=b(()=>{t();r();$Z();B1();J0();d4=class d4 extends f{create($,Z){return this._client.post("/v1/messages/batches",{body:$,...Z})}retrieve($,Z){return this._client.get(I`/v1/messages/batches/${$}`,Z)}list($={},Z){return this._client.getAPIList("/v1/messages/batches",x0,{query:$,...Z})}delete($,Z){return this._client.delete(I`/v1/messages/batches/${$}`,Z)}cancel($,Z){return this._client.post(I`/v1/messages/batches/${$}/cancel`,Z)}async results($,Z){let X=await this.retrieve($);if(!X.results_url)throw new S(`No batch \`results_url\`; Has it finished processing? ${X.processing_status} - ${X.id}`);return this._client.get(X.results_url,{...Z,headers:O([{Accept:"application/binary"},Z?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((z,J)=>T1.fromResponse(J.response,J.controller))}}});var k$,Ez,cM;var IZ=b(()=>{r();B4();Cz();BZ();DZ();DZ();c3();k$=class k$ extends f{constructor(){super(...arguments);this.batches=new d4(this._client)}create($,Z){if($.model in Ez)console.warn(`The model '${$.model}' is deprecated and will reach end-of-life on ${Ez[$.model]}
197
- Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(cM.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=V6[$.model]??void 0;X=this._client.calculateNonstreamingTimeout($.max_tokens,J)}let z=q6($.tools,$.messages);return this._client.post("/v1/messages",{body:$,timeout:X??600000,...Z,headers:O([z,Z?.headers]),stream:$.stream??!1})}parse($,Z){return this.create($,Z).then((X)=>HZ(X,$,{logger:this._client.logger??console}))}stream($,Z){return c4.createMessage(this,$,Z,{logger:this._client.logger??console})}countTokens($,Z){return this._client.post("/v1/messages/count_tokens",{body:$,...Z})}};Ez={"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"},cM=["claude-mythos-preview","claude-opus-4-6"];k$.Batches=d4});var F1;var AZ=b(()=>{t();r();J0();F1=class F1 extends f{retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(I`/v1/models/${$}`,{...X,headers:O([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/models",x0,{query:z,...Z,headers:O([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers])})}}});var jz=b(()=>{qZ();VZ();IZ();AZ();Jz()});var p4=($)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[$]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.($)?.trim()||void 0;return};class a{constructor({baseURL:$=p4("ANTHROPIC_BASE_URL"),apiKey:Z=p4("ANTHROPIC_API_KEY")??null,authToken:X=p4("ANTHROPIC_AUTH_TOKEN")??null,...z}={}){RZ.add(this),_6.set(this,void 0);let J={apiKey:Z,authToken:X,...z,baseURL:$||"https://api.anthropic.com"};if(!J.dangerouslyAllowBrowser&&cX())throw new S(`It looks like you're running in a browser-like environment.
195
+ Wrap your summary in <summary></summary> tags.`;function _z(){let $,Z;return{promise:new Promise((z,J)=>{$=z,Z=J}),resolve:$,reject:Z}}async function sM($,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((U)=>("name"in U?U.name:U.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 U=Q.input;if("parse"in Y&&Y.parse)U=Y.parse(U);let G=await Y.run(U,{toolUseBlock:Q,signal:X?.signal});return{type:"tool_result",tool_use_id:Q.id,content:G}}catch(U){return{type:"tool_result",tool_use_id:Q.id,content:U instanceof A1?U.content:`Error: ${U instanceof Error?U.message:String(U)}`,is_error:!0}}}))}}var x4,R1,k$,G0,T0,P0,t0,L$,k4,Pz,XZ,y4;var zZ=b(()=>{r0();F6();O0();r();T4();y4=class y4{constructor($,Z,X){x4.add(this),this.client=$,R1.set(this,!1),k$.set(this,!1),G0.set(this,void 0),T0.set(this,void 0),P0.set(this,void 0),t0.set(this,void 0),L$.set(this,void 0),k4.set(this,0),w(this,G0,{params:{...Z,messages:structuredClone(Z.messages)}},"f");let J=["BetaToolRunner",...g3(Z.tools,Z.messages)].join(", ");if(w(this,T0,{...X,headers:O([{"x-stainless-helper":J},X?.headers])},"f"),w(this,L$,_z(),"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*[(R1=new WeakMap,k$=new WeakMap,G0=new WeakMap,T0=new WeakMap,P0=new WeakMap,t0=new WeakMap,L$=new WeakMap,k4=new WeakMap,x4=new WeakSet,Pz=async function(){let Z=L(this,G0,"f").params.compactionControl;if(!Z||!Z.enabled)return!1;let X=0;if(L(this,P0,"f")!==void 0)try{let G=await L(this,P0,"f");X=G.usage.input_tokens+(G.usage.cache_creation_input_tokens??0)+(G.usage.cache_read_input_tokens??0)+G.usage.output_tokens}catch{return!1}let z=Z.contextTokenThreshold??Fz;if(X<z)return!1;let J=Z.model??L(this,G0,"f").params.model,Q=Z.summaryPrompt??wz,Y=L(this,G0,"f").params.messages;if(Y[Y.length-1].role==="assistant"){let G=Y[Y.length-1];if(Array.isArray(G.content)){let W=G.content.filter((q)=>q.type!=="tool_use");if(W.length===0)Y.pop();else G.content=W}}let U=await this.client.beta.messages.create({model:J,messages:[...Y,{role:"user",content:[{type:"text",text:Q}]}],max_tokens:L(this,G0,"f").params.max_tokens},{signal:L(this,T0,"f").signal,headers:O([L(this,T0,"f").headers,{"x-stainless-helper":"compaction"}])});if(U.content[0]?.type!=="text")throw new S("Expected text response for compaction");return L(this,G0,"f").params.messages=[{role:"user",content:U.content}],!0},Symbol.asyncIterator)](){var $;if(L(this,R1,"f"))throw new S("Cannot iterate over a consumed stream");w(this,R1,!0,"f"),w(this,k$,!0,"f"),w(this,t0,void 0,"f");try{while(!0){let Z;try{if(L(this,G0,"f").params.max_iterations&&L(this,k4,"f")>=L(this,G0,"f").params.max_iterations)break;w(this,k$,!1,"f"),w(this,t0,void 0,"f"),w(this,k4,($=L(this,k4,"f"),$++,$),"f"),w(this,P0,void 0,"f");let{max_iterations:X,compactionControl:z,...J}=L(this,G0,"f").params;if(J.stream)Z=this.client.beta.messages.stream({...J},L(this,T0,"f")),w(this,P0,Z.finalMessage(),"f"),L(this,P0,"f").catch(()=>{}),yield Z;else w(this,P0,this.client.beta.messages.create({...J,stream:!1},L(this,T0,"f")),"f"),yield L(this,P0,"f");if(!await L(this,x4,"m",Pz).call(this)){if(!L(this,k$,"f")){let{role:U,content:G}=await L(this,P0,"f");L(this,G0,"f").params.messages.push({role:U,content:G})}let Y=await L(this,x4,"m",XZ).call(this,L(this,G0,"f").params.messages.at(-1));if(Y)L(this,G0,"f").params.messages.push(Y);else if(!L(this,k$,"f"))break}}finally{if(Z)Z.abort()}}if(!L(this,P0,"f"))throw new S("ToolRunner concluded without a message from the server");L(this,L$,"f").resolve(await L(this,P0,"f"))}catch(Z){throw w(this,R1,!1,"f"),L(this,L$,"f").promise.catch(()=>{}),L(this,L$,"f").reject(Z),w(this,L$,_z(),"f"),Z}}setMessagesParams($){if(typeof $==="function")L(this,G0,"f").params=$(L(this,G0,"f").params);else L(this,G0,"f").params=$;w(this,k$,!0,"f"),w(this,t0,void 0,"f")}setRequestOptions($){if(typeof $==="function")w(this,T0,$(L(this,T0,"f")),"f");else w(this,T0,{...L(this,T0,"f"),...$},"f")}async generateToolResponse($=L(this,T0,"f").signal){let Z=await L(this,P0,"f")??this.params.messages.at(-1);if(!Z)return null;return L(this,x4,"m",XZ).call(this,Z,$)}done(){return L(this,L$,"f").promise}async runUntilDone(){if(!L(this,R1,"f"))for await(let $ of this);return this.done()}get params(){return L(this,G0,"f").params}pushMessages(...$){this.setMessagesParams((Z)=>({...Z,messages:[...Z.messages,...$]}))}then($,Z){return this.runUntilDone().then($,Z)}};XZ=async function(Z,X=L(this,T0,"f").signal){if(L(this,t0,"f")!==void 0)return L(this,t0,"f");return w(this,t0,sM(L(this,G0,"f").params,Z,{...L(this,T0,"f"),signal:X}),"f"),L(this,t0,"f")}});var F1;var JZ=b(()=>{O0();w3();F1=class F1{constructor($,Z){this.iterator=$,this.controller=Z}async*decoder(){let $=new K$;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 S("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 S("Attempted to iterate over a response with no body")}return new F1(W4($.body),Z)}}});var f4;var QZ=b(()=>{t();r();JZ();T1();J0();f4=class f4 extends f{create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/messages/batches?beta=true",{body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"message-batches-2024-09-24"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/messages/batches/${$}?beta=true`,{...X,headers:O([{"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",y0,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"message-batches-2024-09-24"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(A`/v1/messages/batches/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},X?.headers])})}cancel($,Z={},X){let{betas:z}=Z??{};return this._client.post(A`/v1/messages/batches/${$}/cancel?beta=true`,{...X,headers:O([{"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 S(`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:O([{"anthropic-beta":[...J??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},X?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((Q,Y)=>F1.fromResponse(Y.response,Y.controller))}}});function Ez($){if(!$.output_format)return $;if($.output_config?.format)throw new S("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 Cz,oM,N$;var YZ=b(()=>{T1();i3();r();T4();s3();Rz();zZ();F6();QZ();QZ();zZ();F6();Cz={"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"},oM=["claude-mythos-preview","claude-opus-4-6"];N$=class N$ extends f{constructor(){super(...arguments);this.batches=new f4(this._client)}create($,Z){let X=Ez($),{betas:z,...J}=X;if(J.model in Cz)console.warn(`The model '${J.model}' is deprecated and will reach end-of-life on ${Cz[J.model]}
196
+ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(oM.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 U=L6[J.model]??void 0;Q=this._client.calculateNonstreamingTimeout(J.max_tokens,U)}let Y=B6(J.tools,J.messages);return this._client.post("/v1/messages?beta=true",{body:J,timeout:Q??600000,...Z,headers:O([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},Y,Z?.headers]),stream:X.stream??!1})}parse($,Z){return Z={...Z,headers:O([{"anthropic-beta":[...$.betas??[],"structured-outputs-2025-12-15"].toString()},Z?.headers])},this.create($,Z).then((X)=>r3(X,$,{logger:this._client.logger??console}))}stream($,Z){return b4.createMessage(this,$,Z)}countTokens($,Z){let X=Ez($),{betas:z,...J}=X;return this._client.post("/v1/messages/count_tokens?beta=true",{body:J,...Z,headers:O([{"anthropic-beta":[...z??[],"token-counting-2024-11-01"].toString()},Z?.headers])})}toolRunner($,Z){return new y4(this._client,$,Z)}};N$.Batches=f4;N$.BetaToolRunner=y4;N$.ToolError=A1});var g4;var UZ=b(()=>{t();r();J0();g4=class g4 extends f{list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(A`/v1/sessions/${$}/events?beta=true`,i,{query:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}send($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/sessions/${$}/events?beta=true`,{body:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}stream($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/sessions/${$}/events/stream?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers]),stream:!0})}}});var v4;var GZ=b(()=>{t();r();J0();v4=class v4 extends f{retrieve($,Z,X){let{session_id:z,betas:J}=Z;return this._client.get(A`/v1/sessions/${z}/resources/${$}?beta=true`,{...X,headers:O([{"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(A`/v1/sessions/${z}/resources/${$}?beta=true`,{body:Q,...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(A`/v1/sessions/${$}/resources?beta=true`,i,{query:J,...X,headers:O([{"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(A`/v1/sessions/${z}/resources/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}add($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/sessions/${$}/resources?beta=true`,{body:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var y$;var WZ=b(()=>{UZ();UZ();GZ();GZ();t();r();J0();y$=class y$ extends f{constructor(){super(...arguments);this.events=new g4(this._client),this.resources=new v4(this._client)}create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/sessions?beta=true",{body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/sessions/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/sessions/${$}?beta=true`,{body:J,...X,headers:O([{"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",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(A`/v1/sessions/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(A`/v1/sessions/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};y$.Events=g4;y$.Resources=v4});var h4;var qZ=b(()=>{t();r();M1();J0();h4=class h4 extends f{create($,Z={},X){let{betas:z,...J}=Z??{};return this._client.post(A`/v1/skills/${$}/versions?beta=true`,N1({body:J,...X,headers:O([{"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(A`/v1/skills/${z}/versions/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(A`/v1/skills/${$}/versions?beta=true`,i,{query:J,...X,headers:O([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}delete($,Z,X){let{skill_id:z,betas:J}=Z;return this._client.delete(A`/v1/skills/${z}/versions/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])})}}});var w1;var VZ=b(()=>{qZ();qZ();t();r();M1();J0();w1=class w1 extends f{constructor(){super(...arguments);this.versions=new h4(this._client)}create($={},Z){let{betas:X,...z}=$??{};return this._client.post("/v1/skills?beta=true",N1({body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"skills-2025-10-02"].toString()},Z?.headers])},this._client,!1))}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/skills/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/skills?beta=true",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"skills-2025-10-02"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(A`/v1/skills/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}};w1.Versions=h4});var u4;var KZ=b(()=>{t();r();J0();u4=class u4 extends f{create($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/vaults/${$}/credentials?beta=true`,{body:J,...X,headers:O([{"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(A`/v1/vaults/${z}/credentials/${$}?beta=true`,{...X,headers:O([{"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(A`/v1/vaults/${z}/credentials/${$}?beta=true`,{body:Q,...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(A`/v1/vaults/${$}/credentials?beta=true`,i,{query:J,...X,headers:O([{"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(A`/v1/vaults/${z}/credentials/${$}?beta=true`,{...X,headers:O([{"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(A`/v1/vaults/${z}/credentials/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var P1;var HZ=b(()=>{KZ();KZ();t();r();J0();P1=class P1 extends f{constructor(){super(...arguments);this.credentials=new u4(this._client)}create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/vaults?beta=true",{body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/vaults/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/vaults/${$}?beta=true`,{body:J,...X,headers:O([{"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",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(A`/v1/vaults/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(A`/v1/vaults/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};P1.Credentials=u4});var L0;var BZ=b(()=>{f3();f3();v3();v3();h3();h3();u3();u3();c3();c3();l3();l3();YZ();YZ();WZ();WZ();VZ();VZ();HZ();HZ();L0=class L0 extends f{constructor(){super(...arguments);this.models=new I4(this._client),this.messages=new N$(this._client),this.agents=new O1(this._client),this.environments=new M4(this._client),this.sessions=new y$(this._client),this.vaults=new P1(this._client),this.memoryStores=new b$(this._client),this.files=new D4(this._client),this.skills=new w1(this._client),this.userProfiles=new A4(this._client)}};L0.Models=I4;L0.Messages=N$;L0.Agents=O1;L0.Environments=M4;L0.Sessions=y$;L0.Vaults=P1;L0.MemoryStores=b$;L0.Files=D4;L0.Skills=w1;L0.UserProfiles=A4});var _1;var LZ=b(()=>{r();_1=class _1 extends f{create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/complete",{body:z,timeout:this._client._options.timeout??600000,...Z,headers:O([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers]),stream:$.stream??!1})}}});function jz($){return $?.output_config?.format}function NZ($,Z,X){let z=jz(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 MZ($,Z,X)}function MZ($,Z,X){let z=null,J=$.content.map((Q)=>{if(Q.type==="text"){let Y=YO(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 YO($,Z){let X=jz($);if(X?.type!=="json_schema")return null;try{if("parse"in X)return X.parse(Z);return JSON.parse(Z)}catch(z){throw new S(`Failed to parse structured output: ${z}`)}}var OZ=b(()=>{O0()});function kz($){return $.type==="tool_use"||$.type==="server_tool_use"}function yz($){}var j0,M$,C1,m4,w6,c4,d4,P6,p4,e0,l4,_6,C6,f$,E6,j6,i4,TZ,Sz,DZ,IZ,AZ,RZ,bz,xz="__json_buf",n4;var fz=b(()=>{r0();T1();o3();a3();OZ();n4=class n4{constructor($,Z){j0.add(this),this.messages=[],this.receivedMessages=[],M$.set(this,void 0),C1.set(this,null),this.controller=new AbortController,m4.set(this,void 0),w6.set(this,()=>{}),c4.set(this,()=>{}),d4.set(this,void 0),P6.set(this,()=>{}),p4.set(this,()=>{}),e0.set(this,{}),l4.set(this,!1),_6.set(this,!1),C6.set(this,!1),f$.set(this,!1),E6.set(this,void 0),j6.set(this,void 0),i4.set(this,void 0),DZ.set(this,(X)=>{if(w(this,_6,!0,"f"),s0(X))X=new V0;if(X instanceof V0)return w(this,C6,!0,"f"),this._emit("abort",X);if(X instanceof S)return this._emit("error",X);if(X instanceof Error){let z=new S(X.message);return z.cause=X,this._emit("error",z)}return this._emit("error",new S(String(X)))}),w(this,m4,new Promise((X,z)=>{w(this,w6,X,"f"),w(this,c4,z,"f")}),"f"),w(this,d4,new Promise((X,z)=>{w(this,P6,X,"f"),w(this,p4,z,"f")}),"f"),L(this,m4,"f").catch(()=>{}),L(this,d4,"f").catch(()=>{}),w(this,C1,$,"f"),w(this,i4,Z?.logger??console,"f")}get response(){return L(this,E6,"f")}get request_id(){return L(this,j6,"f")}async withResponse(){w(this,f$,!0,"f");let $=await L(this,m4,"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 n4(null);return Z._run(()=>Z._fromReadableStream($)),Z}static createMessage($,Z,X,{logger:z}={}){let J=new n4(Z,{logger:z});for(let Q of Z.messages)J._addMessageParam(Q);return w(J,C1,{...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")},L(this,DZ,"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{L(this,j0,"m",IZ).call(this);let{response:Q,data:Y}=await $.create({...Z,stream:!0},{...X,signal:this.controller.signal}).withResponse();this._connected(Q);for await(let U of Y)L(this,j0,"m",AZ).call(this,U);if(Y.controller.signal?.aborted)throw new V0;L(this,j0,"m",RZ).call(this)}finally{if(z&&J)z.removeEventListener("abort",J)}}_connected($){if(this.ended)return;w(this,E6,$,"f"),w(this,j6,$?.headers.get("request-id"),"f"),L(this,w6,"f").call(this,$),this._emit("connect")}get ended(){return L(this,l4,"f")}get errored(){return L(this,_6,"f")}get aborted(){return L(this,C6,"f")}abort(){this.controller.abort()}on($,Z){return(L(this,e0,"f")[$]||(L(this,e0,"f")[$]=[])).push({listener:Z}),this}off($,Z){let X=L(this,e0,"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(L(this,e0,"f")[$]||(L(this,e0,"f")[$]=[])).push({listener:Z,once:!0}),this}emitted($){return new Promise((Z,X)=>{if(w(this,f$,!0,"f"),$!=="error")this.once("error",X);this.once($,Z)})}async done(){w(this,f$,!0,"f"),await L(this,d4,"f")}get currentMessage(){return L(this,M$,"f")}async finalMessage(){return await this.done(),L(this,j0,"m",TZ).call(this)}async finalText(){return await this.done(),L(this,j0,"m",Sz).call(this)}_emit($,...Z){if(L(this,l4,"f"))return;if($==="end")w(this,l4,!0,"f"),L(this,P6,"f").call(this);let X=L(this,e0,"f")[$];if(X)L(this,e0,"f")[$]=X.filter((z)=>!z.once),X.forEach(({listener:z})=>z(...Z));if($==="abort"){let z=Z[0];if(!L(this,f$,"f")&&!X?.length)Promise.reject(z);L(this,c4,"f").call(this,z),L(this,p4,"f").call(this,z),this._emit("end");return}if($==="error"){let z=Z[0];if(!L(this,f$,"f")&&!X?.length)Promise.reject(z);L(this,c4,"f").call(this,z),L(this,p4,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",L(this,j0,"m",TZ).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{L(this,j0,"m",IZ).call(this),this._connected(null);let J=w0.fromReadableStream($,this.controller);for await(let Q of J)L(this,j0,"m",AZ).call(this,Q);if(J.controller.signal?.aborted)throw new V0;L(this,j0,"m",RZ).call(this)}finally{if(X&&z)X.removeEventListener("abort",z)}}[(M$=new WeakMap,C1=new WeakMap,m4=new WeakMap,w6=new WeakMap,c4=new WeakMap,d4=new WeakMap,P6=new WeakMap,p4=new WeakMap,e0=new WeakMap,l4=new WeakMap,_6=new WeakMap,C6=new WeakMap,f$=new WeakMap,E6=new WeakMap,j6=new WeakMap,i4=new WeakMap,DZ=new WeakMap,j0=new WeakSet,TZ=function(){if(this.receivedMessages.length===0)throw new S("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},Sz=function(){if(this.receivedMessages.length===0)throw new S("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 S("stream ended without producing a content block with type=text");return Z.join(" ")},IZ=function(){if(this.ended)return;w(this,M$,void 0,"f")},AZ=function(Z){if(this.ended)return;let X=L(this,j0,"m",bz).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(kz(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:yz(Z.delta)}break}case"message_stop":{this._addMessageParam(X),this._addMessage(NZ(X,L(this,C1,"f"),{logger:L(this,i4,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",X.content.at(-1));break}case"message_start":{w(this,M$,X,"f");break}case"content_block_start":case"message_delta":break}},RZ=function(){if(this.ended)throw new S("stream has ended, this shouldn't happen");let Z=L(this,M$,"f");if(!Z)throw new S("request ended without sending any chunks");return w(this,M$,void 0,"f"),NZ(Z,L(this,C1,"f"),{logger:L(this,i4,"f")})},bz=function(Z){let X=L(this,M$,"f");if(Z.type==="message_start"){if(X)throw new S(`Unexpected event order, got ${Z.type} before receiving "message_stop"`);return Z.message}if(!X)throw new S(`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&&kz(z)){let J=z[xz]||"";J+=Z.delta.partial_json;let Q={...z};if(Object.defineProperty(Q,xz,{value:J,enumerable:!1,writable:!0}),J)Q.input=N6(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:yz(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 r4;var FZ=b(()=>{t();r();JZ();T1();J0();r4=class r4 extends f{create($,Z){return this._client.post("/v1/messages/batches",{body:$,...Z})}retrieve($,Z){return this._client.get(A`/v1/messages/batches/${$}`,Z)}list($={},Z){return this._client.getAPIList("/v1/messages/batches",y0,{query:$,...Z})}delete($,Z){return this._client.delete(A`/v1/messages/batches/${$}`,Z)}cancel($,Z){return this._client.post(A`/v1/messages/batches/${$}/cancel`,Z)}async results($,Z){let X=await this.retrieve($);if(!X.results_url)throw new S(`No batch \`results_url\`; Has it finished processing? ${X.processing_status} - ${X.id}`);return this._client.get(X.results_url,{...Z,headers:O([{Accept:"application/binary"},Z?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((z,J)=>F1.fromResponse(J.response,J.controller))}}});var g$,gz,GO;var wZ=b(()=>{r();T4();fz();OZ();FZ();FZ();i3();g$=class g$ extends f{constructor(){super(...arguments);this.batches=new r4(this._client)}create($,Z){if($.model in gz)console.warn(`The model '${$.model}' is deprecated and will reach end-of-life on ${gz[$.model]}
197
+ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(GO.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=L6[$.model]??void 0;X=this._client.calculateNonstreamingTimeout($.max_tokens,J)}let z=B6($.tools,$.messages);return this._client.post("/v1/messages",{body:$,timeout:X??600000,...Z,headers:O([z,Z?.headers]),stream:$.stream??!1})}parse($,Z){return this.create($,Z).then((X)=>MZ(X,$,{logger:this._client.logger??console}))}stream($,Z){return n4.createMessage(this,$,Z,{logger:this._client.logger??console})}countTokens($,Z){return this._client.post("/v1/messages/count_tokens",{body:$,...Z})}};gz={"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"},GO=["claude-mythos-preview","claude-opus-4-6"];g$.Batches=r4});var E1;var PZ=b(()=>{t();r();J0();E1=class E1 extends f{retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/models/${$}`,{...X,headers:O([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/models",y0,{query:z,...Z,headers:O([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers])})}}});var vz=b(()=>{BZ();LZ();wZ();PZ();Kz()});var s4=($)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[$]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.($)?.trim()||void 0;return};class a{constructor({baseURL:$=s4("ANTHROPIC_BASE_URL"),apiKey:Z=s4("ANTHROPIC_API_KEY")??null,authToken:X=s4("ANTHROPIC_AUTH_TOKEN")??null,...z}={}){_Z.add(this),S6.set(this,void 0);let J={apiKey:Z,authToken:X,...z,baseURL:$||"https://api.anthropic.com"};if(!J.dangerouslyAllowBrowser&&aX())throw new S(`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??FZ.DEFAULT_TIMEOUT,this.logger=J.logger??console;let Q="warn";this.logLevel=Q,this.logLevel=A3(J.logLevel,"ClientOptions.logLevel",this)??A3(p4("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??Q,this.fetchOptions=J.fetchOptions,this.maxRetries=J.maxRetries??2,this.fetch=J.fetch??pX(),w(this,_6,iX,"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 O([await this.apiKeyAuth($),await this.bearerAuth($)])}async apiKeyAuth($){if(this.apiKey==null)return;return O([{"X-Api-Key":this.apiKey}])}async bearerAuth($){if(this.authToken==null)return;return O([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery($){return nX($)}getUserAgent(){return`${this.constructor.name}/JS ${G$}`}defaultIdempotencyKey(){return`stainless-node-retry-${B3()}`}makeStatusError($,Z,X,z){return z0.generate($,Z,X,z)}buildURL($,Z,X){let z=!L(this,RZ,"m",Sz).call(this)&&X||this.baseURL,J=yX($)?new URL($):new URL(z+(z.endsWith("/")&&$.startsWith("/")?$.slice(1):$)),Q=this.defaultQuery(),Y=Object.fromEntries(J.searchParams);if(!M3(Q)||!M3(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 S("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600000}async prepareOptions($){}async prepareRequest($,{url:Z,options:X}){}get($,Z){return this.methodRequest("get",$,Z)}post($,Z){return this.methodRequest("post",$,Z)}patch($,Z){return this.methodRequest("patch",$,Z)}put($,Z){return this.methodRequest("put",$,Z)}delete($,Z){return this.methodRequest("delete",$,Z)}methodRequest($,Z,X){return this.request(Promise.resolve(X).then((z)=>{return{method:$,path:Z,...z}}))}request($,Z=null){return new q$(this,this.makeRequest($,Z,void 0))}async makeRequest($,Z,X){let z=await $,J=z.maxRetries??this.maxRetries;if(Z==null)Z=J;await this.prepareOptions(z);let{req:Q,url:Y,timeout:U}=await this.buildRequest(z,{retryCount:J-Z});await this.prepareRequest(Q,{url:Y,options:z});let G="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),W=X===void 0?"":`, retryOf: ${X}`,q=Date.now();if(q0(this).debug(`[${G}] sending request`,i0({retryOfRequestLogID:X,method:z.method,url:Y,options:z,headers:Q.headers})),z.signal?.aborted)throw new V0;let V=new AbortController,K=await this.fetchWithTimeout(Y,Q,U,V).catch(z4),H=Date.now();if(K instanceof globalThis.Error){let M=`retrying, ${Z} attempts remaining`;if(z.signal?.aborted)throw new V0;let P=l0(K)||/timed? ?out/i.test(String(K)+("cause"in K?String(K.cause):""));if(Z)return q0(this).info(`[${G}] connection ${P?"timed out":"failed"} - ${M}`),q0(this).debug(`[${G}] connection ${P?"timed out":"failed"} (${M})`,i0({retryOfRequestLogID:X,url:Y,durationMs:H-q,message:K.message})),this.retryRequest(z,Z,X??G);if(q0(this).info(`[${G}] connection ${P?"timed out":"failed"} - error; no more retries left`),q0(this).debug(`[${G}] connection ${P?"timed out":"failed"} (error; no more retries left)`,i0({retryOfRequestLogID:X,url:Y,durationMs:H-q,message:K.message})),P)throw new X1;throw new U$({cause:K})}let T=[...K.headers.entries()].filter(([M])=>M==="request-id").map(([M,P])=>", "+M+": "+JSON.stringify(P)).join(""),N=`[${G}${W}${T}] ${Q.method} ${Y} ${K.ok?"succeeded":"failed"} with status ${K.status} in ${H-q}ms`;if(!K.ok){let M=await this.shouldRetry(K);if(Z&&M){let y=`retrying, ${Z} attempts remaining`;return await lX(K.body),q0(this).info(`${N} - ${y}`),q0(this).debug(`[${G}] response error (${y})`,i0({retryOfRequestLogID:X,url:K.url,status:K.status,headers:K.headers,durationMs:H-q})),this.retryRequest(z,Z,X??G,K.headers)}let P=M?"error; no more retries left":"error; not retryable";q0(this).info(`${N} - ${P}`);let _=await K.text().catch((y)=>z4(y).message),j=Z6(_),x=j?void 0:_;throw q0(this).debug(`[${G}] response error (${P})`,i0({retryOfRequestLogID:X,url:K.url,status:K.status,headers:K.headers,message:x,durationMs:Date.now()-q})),this.makeStatusError(K.status,j,x,K.headers)}return q0(this).info(N),q0(this).debug(`[${G}] response start`,i0({retryOfRequestLogID:X,url:K.url,status:K.status,headers:K.headers,durationMs:H-q})),{response:K,options:z,controller:V,requestLogID:G,retryOfRequestLogID:X,startTime:q}}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 W4(this,X,$)}async fetchWithTimeout($,Z,X,z){let{signal:J,method:Q,...Y}=Z||{},U=this._makeAbort(z);if(J)J.addEventListener("abort",U,{once:!0});let G=setTimeout(U,X),W=globalThis.ReadableStream&&Y.body instanceof globalThis.ReadableStream||typeof Y.body==="object"&&Y.body!==null&&Symbol.asyncIterator in Y.body,q={signal:z.signal,...W?{duplex:"half"}:{},method:"GET",...Y};if(Q)q.method=Q.toUpperCase();try{return await this.fetch.call(void 0,$,q)}finally{clearTimeout(G)}}async shouldRetry($){let Z=$.headers.get("x-should-retry");if(Z==="true")return!0;if(Z==="false")return!1;if($.status===408)return!0;if($.status===409)return!0;if($.status===429)return!0;if($.status>=500)return!0;return!1}async retryRequest($,Z,X,z){let J,Q=z?.get("retry-after-ms");if(Q){let U=parseFloat(Q);if(!Number.isNaN(U))J=U}let Y=z?.get("retry-after");if(Y&&!J){let U=parseFloat(Y);if(!Number.isNaN(U))J=U*1000;else J=Date.parse(Y)-Date.now()}if(J===void 0){let U=$.maxRetries??this.maxRetries;J=this.calculateDefaultRetryTimeoutMillis(Z,U)}return await hX(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 S("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,U=this.buildURL(J,Q,Y);if("timeout"in X)gX("timeout",X.timeout);X.timeout=X.timeout??this.timeout;let{bodyHeaders:G,body:W}=this.buildBody({options:X}),q=await this.buildHeaders({options:$,method:z,bodyHeaders:G,retryCount:Z});return{req:{method:z,headers:q,...X.signal&&{signal:X.signal},...globalThis.ReadableStream&&W instanceof globalThis.ReadableStream&&{duplex:"half"},...W&&{body:W},...this.fetchOptions??{},...X.fetchOptions??{}},url:U,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=O([J,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(z),...$.timeout?{"X-Stainless-Timeout":String(Math.trunc($.timeout/1000))}:{},...dX(),...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=O([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:X6($)};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 L(this,_6,"f").call(this,{body:$,headers:X})}}var RZ,FZ,_6,Sz,wZ="\\n\\nHuman:",PZ="\\n\\nAssistant:",L$;var _Z=b(()=>{p0();_$();O3();rX();M0();t();S3();jz();U6();VZ();AZ();qZ();IZ();O3();r();Q6();_$();FZ=a,_6=new WeakMap,RZ=new WeakSet,Sz=function(){return this.baseURL!=="https://api.anthropic.com"};a.Anthropic=FZ;a.HUMAN_PROMPT=wZ;a.AI_PROMPT=PZ;a.DEFAULT_TIMEOUT=600000;a.AnthropicError=S;a.APIError=z0;a.APIConnectionError=U$;a.APIConnectionTimeoutError=X1;a.APIUserAbortError=V0;a.NotFoundError=Y1;a.ConflictError=U1;a.RateLimitError=W1;a.BadRequestError=z1;a.AuthenticationError=J1;a.InternalServerError=q1;a.PermissionDeniedError=Q1;a.UnprocessableEntityError=G1;a.toFile=V4;L$=class L$ extends a{constructor(){super(...arguments);this.completions=new A1(this),this.messages=new k$(this),this.models=new F1(this),this.beta=new L0(this)}};L$.Completions=A1;L$.Messages=k$;L$.Models=F1;L$.Beta=L0});var bz={};yZ(bz,{toFile:()=>V4,default:()=>L$,UnprocessableEntityError:()=>G1,RateLimitError:()=>W1,PermissionDeniedError:()=>Q1,PagePromise:()=>W4,NotFoundError:()=>Y1,InternalServerError:()=>q1,HUMAN_PROMPT:()=>wZ,ConflictError:()=>U1,BaseAnthropic:()=>a,BadRequestError:()=>z1,AuthenticationError:()=>J1,AnthropicError:()=>S,Anthropic:()=>L$,APIUserAbortError:()=>V0,APIPromise:()=>q$,APIError:()=>z0,APIConnectionTimeoutError:()=>X1,APIConnectionError:()=>U$,AI_PROMPT:()=>PZ});var xz=b(()=>{_Z();S3();U6();_Z();t();M0()});var tZ=zJ(oZ(),1),{program:hO,createCommand:vO,createArgument:uO,createOption:mO,CommanderError:cO,InvalidArgumentError:dO,InvalidOptionArgumentError:pO,Command:eZ,Argument:lO,Option:iO,Help:nO}=tZ.default;import{readFileSync as q7,writeFileSync as lH,existsSync as G7}from"fs";import{join as W7,dirname as iH}from"path";var GH=f8(),WH=p1(),qH=D8(),r8=l1(),VH=E1(),J$=c(),KH=e0(),HH=Z0(),BH=Z$(),LH=X$(),KD=b2(),NH=l8(),MH=i8(),OH=n8(),y2=Y7(),U7=_1();var TH=GH.Composer,DH=WH.Document,IH=qH.Schema,AH=r8.YAMLError,RH=r8.YAMLParseError,FH=r8.YAMLWarning,wH=VH.Alias,PH=J$.isAlias,_H=J$.isCollection,CH=J$.isDocument,EH=J$.isMap,jH=J$.isNode,SH=J$.isPair,bH=J$.isScalar,xH=J$.isSeq,kH=KH.Pair,yH=HH.Scalar,fH=BH.YAMLMap,gH=LH.YAMLSeq;var hH=NH.Lexer,vH=MH.LineCounter,uH=OH.Parser,Q$=y2.parse,mH=y2.parseAllDocuments,cH=y2.parseDocument,s8=y2.stringify,dH=U7.visit,pH=U7.visitAsync;function d($){let Z=q7($,"utf-8");return Q$(Z)}function s($,Z){let X=Z._meta,z={...Z};delete z._meta;let J=s8(z,{lineWidth:0});if(X?.found&&X.found.length>0){let Q=X.found.join(" + ");J=J.replace(/^(\s+type:\s+\S+)(\s*)$/m,(Y,U,G)=>{if(G.includes("#"))return Y;return`${U} # found: ${Q}`})}lH($,J,"utf-8")}function h($){return q7($,"utf-8")}function v($=process.cwd()){let Z=["project.faf",".faf"];for(let z of Z){let J=W7($,z);if(G7(J))return J}let X=iH($);if(X!==$)for(let z of Z){let J=W7(X,z);if(G7(J))return J}return null}m();var i$=[{name:"TROPHY",indicator:`${K0("\uD83C\uDFC6")} ${K0("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${K0(F("★"))} ${K0("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${D("◆")} ${D("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${f2("◇")} ${f2("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${F("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${B("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${B("○")} RED`,threshold:1},{name:"WHITE",indicator:`${B("♡")}`,threshold:0}];function n$($){return $.indicator}function o8($){for(let Z of i$)if($>=Z.threshold)return Z;return i$[i$.length-1]}var t8=null;function t1(){if(t8)return t8;try{let $=T0("faf-scoring-kernel");return t8=$,$}catch{throw Error(`faf-scoring-kernel not installed.
204
+ `);this.baseURL=J.baseURL,this.timeout=J.timeout??CZ.DEFAULT_TIMEOUT,this.logger=J.logger??console;let Q="warn";this.logLevel=Q,this.logLevel=P3(J.logLevel,"ClientOptions.logLevel",this)??P3(s4("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??Q,this.fetchOptions=J.fetchOptions,this.maxRetries=J.maxRetries??2,this.fetch=J.fetch??tX(),w(this,S6,$z,"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 O([await this.apiKeyAuth($),await this.bearerAuth($)])}async apiKeyAuth($){if(this.apiKey==null)return;return O([{"X-Api-Key":this.apiKey}])}async bearerAuth($){if(this.authToken==null)return;return O([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery($){return Zz($)}getUserAgent(){return`${this.constructor.name}/JS ${V$}`}defaultIdempotencyKey(){return`stainless-node-retry-${O3()}`}makeStatusError($,Z,X,z){return z0.generate($,Z,X,z)}buildURL($,Z,X){let z=!L(this,_Z,"m",hz).call(this)&&X||this.baseURL,J=dX($)?new URL($):new URL(z+(z.endsWith("/")&&$.startsWith("/")?$.slice(1):$)),Q=this.defaultQuery(),Y=Object.fromEntries(J.searchParams);if(!I3(Q)||!I3(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 S("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 H$(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:U}=await this.buildRequest(z,{retryCount:J-Z});await this.prepareRequest(Q,{url:Y,options:z});let G="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),W=X===void 0?"":`, retryOf: ${X}`,q=Date.now();if(q0(this).debug(`[${G}] sending request`,a0({retryOfRequestLogID:X,method:z.method,url:Y,options:z,headers:Q.headers})),z.signal?.aborted)throw new V0;let V=new AbortController,K=await this.fetchWithTimeout(Y,Q,U,V).catch(G4),B=Date.now();if(K instanceof globalThis.Error){let M=`retrying, ${Z} attempts remaining`;if(z.signal?.aborted)throw new V0;let P=s0(K)||/timed? ?out/i.test(String(K)+("cause"in K?String(K.cause):""));if(Z)return q0(this).info(`[${G}] connection ${P?"timed out":"failed"} - ${M}`),q0(this).debug(`[${G}] connection ${P?"timed out":"failed"} (${M})`,a0({retryOfRequestLogID:X,url:Y,durationMs:B-q,message:K.message})),this.retryRequest(z,Z,X??G);if(q0(this).info(`[${G}] connection ${P?"timed out":"failed"} - error; no more retries left`),q0(this).debug(`[${G}] connection ${P?"timed out":"failed"} (error; no more retries left)`,a0({retryOfRequestLogID:X,url:Y,durationMs:B-q,message:K.message})),P)throw new U1;throw new q$({cause:K})}let T=[...K.headers.entries()].filter(([M])=>M==="request-id").map(([M,P])=>", "+M+": "+JSON.stringify(P)).join(""),N=`[${G}${W}${T}] ${Q.method} ${Y} ${K.ok?"succeeded":"failed"} with status ${K.status} in ${B-q}ms`;if(!K.ok){let M=await this.shouldRetry(K);if(Z&&M){let y=`retrying, ${Z} attempts remaining`;return await eX(K.body),q0(this).info(`${N} - ${y}`),q0(this).debug(`[${G}] response error (${y})`,a0({retryOfRequestLogID:X,url:K.url,status:K.status,headers:K.headers,durationMs:B-q})),this.retryRequest(z,Z,X??G,K.headers)}let P=M?"error; no more retries left":"error; not retryable";q0(this).info(`${N} - ${P}`);let _=await K.text().catch((y)=>G4(y).message),j=Q6(_),x=j?void 0:_;throw q0(this).debug(`[${G}] response error (${P})`,a0({retryOfRequestLogID:X,url:K.url,status:K.status,headers:K.headers,message:x,durationMs:Date.now()-q})),this.makeStatusError(K.status,j,x,K.headers)}return q0(this).info(N),q0(this).debug(`[${G}] response start`,a0({retryOfRequestLogID:X,url:K.url,status:K.status,headers:K.headers,durationMs:B-q})),{response:K,options:z,controller:V,requestLogID:G,retryOfRequestLogID:X,startTime:q}}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 B4(this,X,$)}async fetchWithTimeout($,Z,X,z){let{signal:J,method:Q,...Y}=Z||{},U=this._makeAbort(z);if(J)J.addEventListener("abort",U,{once:!0});let G=setTimeout(U,X),W=globalThis.ReadableStream&&Y.body instanceof globalThis.ReadableStream||typeof Y.body==="object"&&Y.body!==null&&Symbol.asyncIterator in Y.body,q={signal:z.signal,...W?{duplex:"half"}:{},method:"GET",...Y};if(Q)q.method=Q.toUpperCase();try{return await this.fetch.call(void 0,$,q)}finally{clearTimeout(G)}}async shouldRetry($){let Z=$.headers.get("x-should-retry");if(Z==="true")return!0;if(Z==="false")return!1;if($.status===408)return!0;if($.status===409)return!0;if($.status===429)return!0;if($.status>=500)return!0;return!1}async retryRequest($,Z,X,z){let J,Q=z?.get("retry-after-ms");if(Q){let U=parseFloat(Q);if(!Number.isNaN(U))J=U}let Y=z?.get("retry-after");if(Y&&!J){let U=parseFloat(Y);if(!Number.isNaN(U))J=U*1000;else J=Date.parse(Y)-Date.now()}if(J===void 0){let U=$.maxRetries??this.maxRetries;J=this.calculateDefaultRetryTimeoutMillis(Z,U)}return await iX(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 S("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,U=this.buildURL(J,Q,Y);if("timeout"in X)lX("timeout",X.timeout);X.timeout=X.timeout??this.timeout;let{bodyHeaders:G,body:W}=this.buildBody({options:X}),q=await this.buildHeaders({options:$,method:z,bodyHeaders:G,retryCount:Z});return{req:{method:z,headers:q,...X.signal&&{signal:X.signal},...globalThis.ReadableStream&&W instanceof globalThis.ReadableStream&&{duplex:"half"},...W&&{body:W},...this.fetchOptions??{},...X.fetchOptions??{}},url:U,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=O([J,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(z),...$.timeout?{"X-Stainless-Timeout":String(Math.trunc($.timeout/1000))}:{},...oX(),...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=O([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:Y6($)};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 L(this,S6,"f").call(this,{body:$,headers:X})}}var _Z,CZ,S6,hz,EZ="\\n\\nHuman:",jZ="\\n\\nAssistant:",O$;var SZ=b(()=>{r0();j$();A3();Xz();O0();t();y3();vz();V6();LZ();PZ();BZ();wZ();A3();r();W6();j$();CZ=a,S6=new WeakMap,_Z=new WeakSet,hz=function(){return this.baseURL!=="https://api.anthropic.com"};a.Anthropic=CZ;a.HUMAN_PROMPT=EZ;a.AI_PROMPT=jZ;a.DEFAULT_TIMEOUT=600000;a.AnthropicError=S;a.APIError=z0;a.APIConnectionError=q$;a.APIConnectionTimeoutError=U1;a.APIUserAbortError=V0;a.NotFoundError=V1;a.ConflictError=K1;a.RateLimitError=B1;a.BadRequestError=G1;a.AuthenticationError=W1;a.InternalServerError=L1;a.PermissionDeniedError=q1;a.UnprocessableEntityError=H1;a.toFile=N4;O$=class O$ extends a{constructor(){super(...arguments);this.completions=new _1(this),this.messages=new g$(this),this.models=new E1(this),this.beta=new L0(this)}};O$.Completions=_1;O$.Messages=g$;O$.Models=E1;O$.Beta=L0});var uz={};hZ(uz,{toFile:()=>N4,default:()=>O$,UnprocessableEntityError:()=>H1,RateLimitError:()=>B1,PermissionDeniedError:()=>q1,PagePromise:()=>B4,NotFoundError:()=>V1,InternalServerError:()=>L1,HUMAN_PROMPT:()=>EZ,ConflictError:()=>K1,BaseAnthropic:()=>a,BadRequestError:()=>G1,AuthenticationError:()=>W1,AnthropicError:()=>S,Anthropic:()=>O$,APIUserAbortError:()=>V0,APIPromise:()=>H$,APIError:()=>z0,APIConnectionTimeoutError:()=>U1,APIConnectionError:()=>q$,AI_PROMPT:()=>jZ});var mz=b(()=>{SZ();y3();V6();SZ();t();O0()});var X5=VJ(Z5(),1),{program:JT,createCommand:QT,createArgument:YT,createOption:UT,CommanderError:GT,InvalidArgumentError:WT,InvalidOptionArgumentError:qT,Command:z5,Argument:VT,Option:KT,Help:HT}=X5.default;import{readFileSync as B7,writeFileSync as eH,existsSync as K7}from"fs";import{join as H7,dirname as $B}from"path";var NH=u8(),MH=s1(),OH=F8(),t8=a1(),TH=k1(),G$=d(),DH=z$(),IH=Z0(),AH=Q$(),RH=Y$(),bD=g2(),FH=s8(),wH=a8(),PH=o8(),u2=q7(),V7=b1();var _H=NH.Composer,CH=MH.Document,EH=OH.Schema,jH=t8.YAMLError,SH=t8.YAMLParseError,bH=t8.YAMLWarning,xH=TH.Alias,kH=G$.isAlias,yH=G$.isCollection,fH=G$.isDocument,gH=G$.isMap,vH=G$.isNode,hH=G$.isPair,uH=G$.isScalar,mH=G$.isSeq,cH=DH.Pair,dH=IH.Scalar,pH=AH.YAMLMap,lH=RH.YAMLSeq;var iH=FH.Lexer,nH=wH.LineCounter,rH=PH.Parser,W$=u2.parse,sH=u2.parseAllDocuments,aH=u2.parseDocument,e8=u2.stringify,oH=V7.visit,tH=V7.visitAsync;function m($){let Z=B7($,"utf-8");return W$(Z)}function s($,Z){let X=Z._meta,z={...Z};delete z._meta;let J=e8(z,{lineWidth:0});if(X?.found&&X.found.length>0){let Q=X.found.join(" + ");J=J.replace(/^(\s+type:\s+\S+)(\s*)$/m,(Y,U,G)=>{if(G.includes("#"))return Y;return`${U} # found: ${Q}`})}eH($,J,"utf-8")}function v($){return B7($,"utf-8")}function h($=process.cwd()){let Z=["project.faf",".faf"];for(let z of Z){let J=H7($,z);if(K7(J))return J}let X=$B($);if(X!==$)for(let z of Z){let J=H7(X,z);if(K7(J))return J}return null}c();var s$=[{name:"TROPHY",indicator:`${K0("\uD83C\uDFC6")} ${K0("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${K0(I("★"))} ${K0("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${D("◆")} ${D("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${m2("◇")} ${m2("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${I("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${H("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${H("○")} RED`,threshold:1},{name:"WHITE",indicator:`${H("♡")}`,threshold:0}];function a$($){return $.indicator}function Z3($){for(let Z of s$)if($>=Z.threshold)return Z;return s$[s$.length-1]}var X3=null;function z4(){if(X3)return X3;try{let $=D0("faf-scoring-kernel");return X3=$,$}catch{throw Error(`faf-scoring-kernel not installed.
205
205
 
206
206
  Run: npm install faf-scoring-kernel
207
- `)}}function Y0($){return JSON.parse(t1().score_faf($))}function K7($){return t1().validate_faf($)}function g2($){return t1().compile_fafb($)}function H7($){return JSON.parse(t1().decompile_fafb($))}function B7(){return t1().sdk_version()}function W0($){return{score:$.score,tier:o8($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}function H0($){if(/^\s*app_type:\s*about\s*$/m.test($)){let X=$.match(/^\s+source_score:\s*(\d+)\s*$/m),z=X?parseInt(X[1],10):-1,J=z>=0&&z<=100?z:-1,Q=$.match(/^\s+represents:\s*(\S+)\s*$/m),Y=Q?Q[1]:void 0;return{score:J,tier:J>=0?o8(J):i$[i$.length-1],populated:0,empty:0,ignored:0,active:0,total:0,slots:{},inherited:!0,represents:Y}}return W0(Y0($))}m();function X0($,Z,X=!1){let z=n$($.tier),J=F(`${$.score}%`);if(console.log(`${z} ${J} ${B(`${$.populated}/${$.active} slots`)} ${B("—")} ${Z}`),$.tier.name==="TROPHY")console.log(B(" Trophy. AI never has to guess."));else if($.empty>0){let Q=Object.entries($.slots).filter(([,W])=>W==="empty").map(([W])=>W),Y=Q.slice(0,3).join(", "),U=Q.length>3?`, +${Q.length-3} more`:"",G=$.empty===1?"slot":"slots";console.log(B(` ${$.empty} ${G} from Trophy: ${Y}${U}`))}if(X)console.log(""),rH($)}function rH($){for(let[Z,X]of Object.entries($.slots)){let z=X==="populated"?D("●"):X==="slotignored"?B("—"):B("○");console.log(` ${z} ${X==="slotignored"?B(Z):Z}`)}}m();function h2($,Z={}){let X=$??v();if(!X)console.error(`Error: project.faf not found
207
+ `)}}function Y0($){return JSON.parse(z4().score_faf($))}function N7($){return z4().validate_faf($)}function c2($){return z4().compile_fafb($)}function M7($){return JSON.parse(z4().decompile_fafb($))}function O7(){return z4().sdk_version()}function W0($){return{score:$.score,tier:Z3($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}function H0($){if(/^\s*app_type:\s*about\s*$/m.test($)){let X=$.match(/^\s+source_score:\s*(\d+)\s*$/m),z=X?parseInt(X[1],10):-1,J=z>=0&&z<=100?z:-1,Q=$.match(/^\s+represents:\s*(\S+)\s*$/m),Y=Q?Q[1]:void 0;return{score:J,tier:J>=0?Z3(J):s$[s$.length-1],populated:0,empty:0,ignored:0,active:0,total:0,slots:{},inherited:!0,represents:Y}}return W0(Y0($))}c();function X0($,Z,X=!1){let z=a$($.tier),J=I(`${$.score}%`);if(console.log(`${z} ${J} ${H(`${$.populated}/${$.active} slots`)} ${H("—")} ${Z}`),$.tier.name==="TROPHY")console.log(H(" Trophy. AI never has to guess."));else if($.empty>0){let Q=Object.entries($.slots).filter(([,W])=>W==="empty").map(([W])=>W),Y=Q.slice(0,3).join(", "),U=Q.length>3?`, +${Q.length-3} more`:"",G=$.empty===1?"slot":"slots";console.log(H(` ${$.empty} ${G} from Trophy: ${Y}${U}`))}if(X)console.log(""),XB($)}function XB($){for(let[Z,X]of Object.entries($.slots)){let z=X==="populated"?D("●"):X==="slotignored"?H("—"):H("○");console.log(` ${z} ${X==="slotignored"?H(Z):Z}`)}}c();function d2($,Z={}){let X=$??h();if(!X)console.error(`Error: project.faf not found
208
208
 
209
- Run 'faf init' to create one.`),process.exit(2);let z=h(X),J=H0(z);if(Z.json){console.log(JSON.stringify(J,null,2));return}if(Z.status){console.log(`${n$(J.tier)} ${F(`${J.score}%`)}`);return}X0(J,X,Z.verbose)}import{existsSync as KL}from"fs";import{join as g7}from"path";var $0=[{index:1,path:"project.name",description:"Project name",category:"project"},{index:2,path:"project.goal",description:"Goal (use case)",category:"project"},{index:3,path:"project.main_language",description:"Primary language",category:"project"},{index:4,path:"human_context.who",description:"Who is this for?",category:"human"},{index:5,path:"human_context.what",description:"What are they building",category:"human"},{index:6,path:"human_context.why",description:"Why does it exist",category:"human"},{index:7,path:"human_context.where",description:"Where does it run",category:"human"},{index:8,path:"human_context.when",description:"When was it started / timeline",category:"human"},{index:9,path:"human_context.how",description:"How is it built",category:"human"},{index:10,path:"stack.frontend",canonical:"stack.framework",description:"Framework (React, Svelte, etc.)",category:"frontend"},{index:11,path:"stack.css_framework",canonical:"stack.css",description:"CSS framework",category:"frontend"},{index:12,path:"stack.ui_library",description:"UI component library",category:"frontend"},{index:13,path:"stack.state_management",canonical:"stack.state",description:"State management",category:"frontend"},{index:14,path:"stack.backend",description:"Backend framework",category:"backend"},{index:15,path:"stack.api_type",canonical:"stack.api",description:"API style (REST, GraphQL, etc.)",category:"backend"},{index:16,path:"stack.runtime",description:"Runtime (Node, Bun, Python, etc.)",category:"backend"},{index:17,path:"stack.database",canonical:"stack.db",description:"Database",category:"backend"},{index:18,path:"stack.connection",description:"Connection method (Prisma, etc.)",category:"backend"},{index:19,path:"stack.hosting",description:"Hosting platform",category:"universal"},{index:20,path:"stack.build",description:"Build tool",category:"universal"},{index:21,path:"stack.cicd",description:"CI/CD",category:"universal"},{index:22,path:"stack.monorepo_tool",description:"Monorepo tool",category:"enterprise_infra"},{index:23,path:"stack.package_manager",canonical:"stack.pkg_manager",description:"Package manager",category:"enterprise_infra"},{index:24,path:"stack.workspaces",description:"Workspace configuration",category:"enterprise_infra"},{index:25,path:"monorepo.packages_count",description:"Number of packages",category:"enterprise_infra"},{index:26,path:"monorepo.build_orchestrator",description:"Build orchestration tool",category:"enterprise_infra"},{index:27,path:"stack.admin",description:"Admin panel",category:"enterprise_app"},{index:28,path:"stack.cache",description:"Caching layer",category:"enterprise_app"},{index:29,path:"stack.search",description:"Search engine",category:"enterprise_app"},{index:30,path:"stack.storage",description:"Object storage",category:"enterprise_app"},{index:31,path:"monorepo.versioning_strategy",description:"Version strategy",category:"enterprise_ops"},{index:32,path:"monorepo.shared_configs",description:"Shared configs",category:"enterprise_ops"},{index:33,path:"monorepo.remote_cache",description:"Remote build cache",category:"enterprise_ops"}],v2=new Map($0.flatMap(($)=>$.canonical?[[$.path,$],[$.canonical,$]]:[[$.path,$]])),bD=new Map($0.filter(($)=>$.canonical).map(($)=>[$.canonical,$.path])),xD=new Map($0.filter(($)=>$.canonical).map(($)=>[$.path,$.canonical]));function L7($,Z){let X=(J)=>{let Q=J.split("."),Y=$;for(let U of Q)if(Y&&typeof Y==="object"&&U in Y)Y=Y[U];else return;return Y},z=X(Z.path);if(z!==void 0)return z;if(Z.canonical)return X(Z.canonical);return}var kD=$0.filter(($)=>$.index<=21);var e8=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","n/a","not applicable"]);function S0($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return e8.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var r$={about:[],documentation:["project","human"],intent:["project","human"],encyclopedia:["project","human"],cli:["project","human","universal"],library:["project","human","universal"],sdk:["project","human","universal"],wasm:["project","human","universal"],html:["project","human","universal"],"server-card":["project","human","universal"],frontend:["project","frontend","human","universal"],website:["project","frontend","human","universal"],mobile:["project","frontend","human","universal"],extension:["project","frontend","human","universal"],mcp:["project","backend","human","universal"],backend:["project","backend","universal","human"],"data-science":["project","backend","human","universal"],fullstack:["project","frontend","backend","universal","human"],svelte:["project","frontend","backend","universal","human"],framework:["project","frontend","backend","universal","human"],"monorepo-root":["project","human","enterprise_infra","enterprise_app","enterprise_ops"],mcpaas:["project","backend","universal","human","enterprise_app","enterprise_ops"],saas:["project","frontend","backend","universal","human","enterprise_app"],enterprise:["project","frontend","backend","universal","human","enterprise_infra","enterprise_app","enterprise_ops"]};import{existsSync as E,readFileSync as m0,readdirSync as O7}from"fs";import{join as C}from"path";var N7=[{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"}]}];import{existsSync as M7,readFileSync as aH,readdirSync as oH}from"fs";import{join as $3}from"path";var s$={version:1,_doc:"SINGLE SOURCE of Dart/Flutter detection KNOWLEDGE (A+B hybrid, the Truth-is-faf-cli spec). faf-cli imports this directly; faf-python-sdk vendors a synced copy (phase 2); MCPs consume the SDK (phase 3). To bolster Dart/Flutter support — a new state library, server framework, MCP dep — edit THIS file and every engine inherits it. The thin per-language LOGIC (pubspec parse, app-vs-package heuristic, priority branching) lives in code, not here.",flutterDeps:["flutter"],mcpDeps:["dart_mcp","mcp_server","mcp_dart","dart_mcp_server","mcp"],serverFrameworks:[["serverpod","Serverpod"],["dart_frog","Dart Frog"],["conduit","Conduit"],["angel3_framework","Angel3"],["alfred","Alfred"],["shelf","Shelf"]],stateManagement:[["flutter_riverpod","Riverpod"],["hooks_riverpod","Riverpod"],["riverpod","Riverpod"],["flutter_bloc","Bloc"],["bloc","Bloc"],["provider","Provider"],["get","GetX"],["flutter_mobx","MobX"],["mobx","MobX"],["signals","Signals"]],routing:[["go_router","go_router"],["auto_route","auto_route"]]};var tH=s$.flutterDeps,eH=s$.mcpDeps,$B=s$.serverFrameworks,ZB=s$.stateManagement,XB=s$.routing;function zB($){let Z=new Set,X=!1;for(let z of $.split(`
210
- `)){if(/^(dependencies|dev_dependencies|dependency_overrides):\s*$/.test(z)){X=!0;continue}if(/^\S/.test(z))X=!1;if(X){let J=z.match(/^\s{2}([a-zA-Z0-9_]+):/);if(J)Z.add(J[1].toLowerCase())}}return Z}function u2($){let Z=$3($,"pubspec.yaml");if(!M7(Z))return null;let X;try{X=aH(Z,"utf-8")}catch{return null}let z=zB(X),J=(j)=>z.has(j.toLowerCase()),Q=tH.some(J)||/^flutter:\s*$/m.test(X)||/\bsdk:\s*flutter\b/.test(X),Y=eH.find(J),U=$B.find(([j])=>J(j)),G=ZB.find(([j])=>J(j)),W=G?G[1]:"",q=XB.find(([j])=>J(j)),V=q?q[1]:"",K=J("flutter_test")?"flutter_test":J("test")?"test":"",H=/^executables:\s*$/m.test(X),T=!1;try{T=oH($3($,"bin")).some((j)=>j.endsWith(".dart"))}catch{}let N=H||T,M,P="",_;if(Q)if(P="Flutter",M7($3($,"lib","main.dart"))||/^publish_to:\s*['"]?none\b/m.test(X))M="mobile",_="pubspec.yaml (Flutter app)";else M="library",_="pubspec.yaml (Flutter package)";else if(Y)M="mcp",_=`pubspec.yaml + ${Y} (Dart MCP server)`;else if(U)M="backend",P=U[1],_=`pubspec.yaml + ${U[0]} (Dart backend)`;else if(N)M="cli",_=H?"pubspec.yaml executables: (Dart CLI)":"pubspec.yaml + bin/*.dart (Dart CLI)";else M="library",_="pubspec.yaml (Dart package)";return{appType:M,isFlutter:Q,framework:P,stateManagement:W,routing:V,testing:K,found:_}}function JB($){let Z=C($,"Cargo.toml");if(!E(Z))return null;try{let z=m0(Z,"utf-8").match(/^\s*\[package\][\s\S]*?^\s*name\s*=\s*"([^"]+)"/m);return z?z[1]:null}catch{return null}}function QB($){let Z=C($,"Cargo.toml");if(!E(Z))return!1;try{let X=m0(Z,"utf-8");return/^\s*\[\[bin\]\]/m.test(X)}catch{return!1}}function YB($,Z){if(Z?.keywords?.some((z)=>/^sdk(?:\s|-|$)|\-sdk$/i.test(z)))return'package.json keywords contains "sdk"';if(Z?.name&&/(?:^|[-_/])sdk(?:[-_/]|$)/i.test(Z.name))return`package.json name "${Z.name}" → sdk`;let X=JB($);if(X&&/(?:^|[-_])sdk(?:[-_]|$)/i.test(X))return`Cargo.toml name "${X}" → sdk`;return null}function UB($){let Z=["manifest.json","public/manifest.json","src/manifest.json","app/manifest.json","extension/manifest.json","dist/manifest.json"];for(let X of Z){let z=C($,X);if(!E(z))continue;try{let J=JSON.parse(m0(z,"utf-8"));if(typeof J.manifest_version==="number")return`${X} manifest_version ${J.manifest_version} (browser extension)`}catch{}}return null}function GB($){let Z=/(numpy|pandas|jupyter|scikit-learn|sklearn|pytorch|tensorflow|matplotlib|scipy)/i,X=C($,"pyproject.toml");if(E(X))try{let Q=m0(X,"utf-8").match(Z);if(Q)return`pyproject.toml depends on ${Q[1]}`}catch{}let z=C($,"requirements.txt");if(E(z))try{let Q=m0(z,"utf-8").match(Z);if(Q)return`requirements.txt contains ${Q[1]}`}catch{}return null}function WB($,Z){let X=["react-native","expo","@capacitor/core","@ionic/core"];if(Z){for(let z of X)if(Z.dependencies?.[z]||Z.devDependencies?.[z])return`${z} dependency`}if(E(C($,"ios"))&&E(C($,"android")))return"ios/ + android/ dirs";return null}function qB($,Z){let X=C($,"Cargo.toml");if(E(X))try{let J=m0(X,"utf-8");if(/crate-type\s*=\s*\[[^\]]*"cdylib"/.test(J))return'Cargo.toml crate-type = ["cdylib"]';if(/wasm-bindgen|wasm-pack/i.test(J))return"Cargo.toml wasm-bindgen/wasm-pack"}catch{}let z=C($,"build.zig");if(E(z))try{let J=m0(z,"utf-8");if(/\.wasm\b|wasm32|setOutputFormat\(\.wasm/i.test(J))return"build.zig wasm target"}catch{}if(Z?.keywords?.some((J)=>/^wasm(?:-|$)|webassembly/i.test(J)))return'package.json keywords contains "wasm"';return null}function VB($,Z){if(!E(C($,"index.html")))return null;if(Z?.dependencies||Z?.devDependencies){let X={...Z.dependencies??{},...Z.devDependencies??{}};if(["react","vue","svelte","@sveltejs/kit","next","nuxt","astro","gatsby","solid-js","qwik"].some((J)=>X[J]))return null}return"index.html (vanilla, no frontend framework)"}function KB($,Z){if(Z?.name&&/specification|^@.*\/spec/i.test(Z.name))return`package name "${Z.name}" → documentation`;if(Z?.keywords?.some((X)=>/^(specification|format-spec|standard)$/i.test(X)))return'package keywords contains "specification"';if(Z?.files&&Z.files.length>0){let X=/^(dist|src|lib|build|bin)\/|\.(js|ts|tsx|jsx|mjs|cjs|py|rs|go)$/,z=Z.files.some((Q)=>X.test(Q)),J=Z.files.some((Q)=>/\.(md|MD)|examples?\//.test(Q));if(!z&&J)return"package.json files = docs/examples only (no source)"}return null}function HB($,Z,X){let z=X.find((J)=>J.slug==="astro"||J.slug==="gatsby");if(z)return`${z.name} (static-site framework)`;if(Z?.keywords?.some((J)=>/^(website|marketing|landing|brochure|portfolio)$/i.test(J)))return'package keywords contains "website"/"marketing"/"landing"';return null}function BB($,Z){if(!Z)return null;let X={...Z.dependencies??{},...Z.devDependencies??{}},z=["@clerk/nextjs","@clerk/clerk-react","next-auth","@auth/core","auth0","@auth0/nextjs-auth0"],J=["stripe","@stripe/stripe-js","lemonsqueezy"],Q=z.some((U)=>X[U]),Y=J.some((U)=>X[U]);if(Q&&Y)return"auth + payment dependencies";return null}function LB($,Z,X){if(Z?.keywords?.some((Q)=>/mcpaas/i.test(Q)))return'package keywords contains "mcpaas"';if(Z?.name&&/mcpaas/i.test(Z.name))return`package name "${Z.name}" → mcpaas`;let z=X.some((Q)=>Q.slug==="mcp"),J=X.some((Q)=>Q.category==="database");if(z&&J&&Z?.dependencies&&Object.keys(Z.dependencies).length>10)return"MCP + database + complex deps (platform shape)";return null}function NB($,Z){if(!Z?.private)return null;if(!(!!Z.workspaces||E(C($,"pnpm-workspace.yaml"))))return null;return"private workspace + multi-package"}function R$($){let Z=C($,"package.json");if(!E(Z))return null;try{return JSON.parse(m0(Z,"utf-8"))}catch{return null}}function MB($,Z){if(!Z.includes("*"))return E(C($,Z));let X=Z.split("/");if(X.length===1){let U=Z.split("*")[0];try{return O7($).some((G)=>G.startsWith(U))}catch{return!1}}let z=C($,...X.slice(0,-1)),J=X[X.length-1],Q=J.split("*")[0],Y=J.split("*")[1]||"";try{return O7(z).some((U)=>U.startsWith(Q)&&U.endsWith(Y))}catch{return!1}}function OB($,Z,X){switch($.type){case"dependency":return!!Z?.dependencies?.[$.key];case"devDependency":return!!Z?.devDependencies?.[$.key];case"file":return MB(X,$.pattern);default:return!1}}function Z3($){let Z=R$($);return N7.map((X)=>{let J=X.signals.filter((Q)=>OB(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 T7($){let Z=R$($);if(Z?.devDependencies?.typescript||Z?.dependencies?.typescript)return"TypeScript";if(E(C($,"tsconfig.json")))return"TypeScript";if(E(C($,"Cargo.toml")))return"Rust";if(E(C($,"go.mod")))return"Go";if(E(C($,"pyproject.toml"))||E(C($,"setup.py")))return"Python";if(E(C($,"Gemfile")))return"Ruby";if(E(C($,"pom.xml"))||E(C($,"build.gradle")))return"Java";if(E(C($,"Package.swift")))return"Swift";if(E(C($,"build.zig")))return"Zig";if(E(C($,"pubspec.yaml")))return"Dart";if(Z)return"JavaScript";return"Unknown"}function D7($){let Z=R$($),X=Z3($),z=[],J=KB($,Z);if(J)return z.push(J),{type:"documentation",found:z};let Q=YB($,Z);if(Q)return z.push(Q),{type:"sdk",found:z};let Y=UB($);if(Y)return z.push(Y),{type:"extension",found:z};let U=LB($,Z,X);if(U)return z.push(U),{type:"mcpaas",found:z};let G=BB($,Z);if(G)return z.push(G),{type:"saas",found:z};let W=qB($,Z);if(W)return z.push(W),{type:"wasm",found:z};let q=u2($);if(q)return z.push(q.found),{type:q.appType,found:z};let V=WB($,Z);if(V)return z.push(V),{type:"mobile",found:z};if(X.some((A)=>A.slug==="mcp"))return z.push("MCP SDK signal"),{type:"mcp",found:z};if(Z?.bin)return z.push("package.json bin"),{type:"cli",found:z};if(QB($))return z.push("Cargo.toml [[bin]]"),{type:"cli",found:z};if(E(C($,"build.zig"))){if(z.push("build.zig"),E(C($,"src/main.zig")))return z.push("src/main.zig"),{type:"cli",found:z};if(E(C($,"src/root.zig")))return z.push("src/root.zig"),{type:"library",found:z}}let H=X.some((A)=>A.slug==="svelte"||A.slug==="sveltekit");if(Z?.private===!0&&(E(C($,"pnpm-workspace.yaml"))||Z?.workspaces!==void 0)&&H)return z.push("private workspace","Svelte"),{type:"framework",found:z};if(H)return z.push("Svelte/SvelteKit"),{type:"svelte",found:z};let N=X.some((A)=>A.category==="frontend"),M=X.some((A)=>A.category==="backend");if(Z?.private&&(Z.workspaces||E(C($,"pnpm-workspace.yaml")))&&N&&M)return z.push("private workspace + frontend + backend frameworks"),{type:"enterprise",found:z};let P=NB($,Z);if(P)return z.push(P),{type:"monorepo-root",found:z};let _=HB($,Z,X);if(_)return z.push(_),{type:"website",found:z};if(X.some((A)=>A.slug==="nextjs"||A.slug==="nuxt"))return z.push(X.find((A)=>A.slug==="nextjs")?"Next.js":"Nuxt"),{type:"fullstack",found:z};let x=X.some((A)=>A.category==="frontend"),k=X.some((A)=>A.category==="backend");if(x&&k)return z.push("frontend framework","backend framework"),{type:"fullstack",found:z};if(x)return z.push("frontend framework"),{type:"frontend",found:z};if(k)return z.push("backend framework"),{type:"backend",found:z};let y=GB($);if(y)return z.push(y),{type:"data-science",found:z};let p=VB($,Z);if(p)return z.push(p),{type:"html",found:z};if(Z?.main&&!Z?.bin)return z.push("package.json main (no bin)"),{type:"library",found:z};return z.push("no classifying signals — fallback"),{type:"library",found:z}}function I7($){if(E(C($,"bunfig.toml")))return"Bun";if(E(C($,"deno.json"))||E(C($,"deno.jsonc")))return"Deno";if(R$($))return"Node.js";if(E(C($,"Cargo.toml")))return"Rust";if(E(C($,"go.mod")))return"Go";if(E(C($,"pubspec.yaml")))return"Dart";return"Unknown"}function A7($){if(E(C($,"pubspec.yaml")))return"pub";if(E(C($,"bun.lockb"))||E(C($,"bun.lock")))return"bun";if(E(C($,"pnpm-lock.yaml")))return"pnpm";if(E(C($,"yarn.lock")))return"yarn";if(E(C($,"package-lock.json")))return"npm";return"npm"}function R7($){if(E(C($,".github/workflows")))return"GitHub Actions";if(E(C($,".gitlab-ci.yml")))return"GitLab CI";if(E(C($,".circleci")))return"CircleCI";if(E(C($,"Jenkinsfile")))return"Jenkins";return null}function F7($){if(E(C($,"vercel.json")))return"Vercel";if(E(C($,"netlify.toml")))return"Netlify";if(E(C($,"wrangler.toml")))return"Cloudflare";if(E(C($,"Dockerfile")))return"Docker";if(E(C($,"fly.toml")))return"Fly.io";if(E(C($,"render.yaml")))return"Render";return null}function w7($){let Z=C($,"svelte.config.js");if(!E(Z))return null;try{let z=m0(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 P7($){let Z=R$($);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(E(C($,"tsconfig.json"))&&Z?.devDependencies?.typescript)return"TypeScript (tsc)";return null}function _7($){return["package.json","Cargo.toml","pyproject.toml","go.mod","build.zig","build.zig.zon","src/index.ts","src/index.js","src/main.ts","src/cli.ts","src/main.rs","src/lib.rs","src/main.zig","src/root.zig","src/__init__.py","main.py","__main__.py","main.go","cmd/main.go","README.md","SPECIFICATION.md","BINARY-FORMAT.md","tsconfig.json","wrangler.toml","vercel.json"].filter((X)=>E(C($,X)))}function C7($,Z){let X={};if(Z?.scripts){for(let z of["build","test","lint","dev","start"])if(Z.scripts[z]){let J=E(C($,"bun.lock"))||E(C($,"bun.lockb"))?"bun run":"npm run";X[z]=`${J} ${z}`}}if(E(C($,"Cargo.toml"))){if(!X.build)X.build="cargo build --release";if(!X.test)X.test="cargo test";if(!X.lint)X.lint="cargo clippy"}if(E(C($,"build.zig"))){if(!X.build)X.build="zig build";if(!X.test)X.test="zig build test"}if(E(C($,"go.mod"))){if(!X.build)X.build="go build ./...";if(!X.test)X.test="go test ./..."}if(E(C($,"pyproject.toml"))||E(C($,"pytest.ini"))){if(!X.test)X.test="pytest"}return X}function E7($,Z,X,z){let J=[];if(z&&z!=="Unknown")J.push(z);let Q=new Set(["frontend","backend","database","build","css","state","monorepo"]);for(let Y of X)if(Q.has(Y.category))J.push(Y.name);if(E(C($,"bunfig.toml")))J.push("Bun");else if(E(C($,"deno.json"))||E(C($,"deno.jsonc")))J.push("Deno");if(J.length<3&&Z?.dependencies){let Y=Object.keys(Z.dependencies).slice(0,5);for(let U of Y)if(!J.some((G)=>G.toLowerCase().includes(U.toLowerCase())))J.push(U)}return J}function m2($){let Z=R$($),X=Z3($),z=T7($),J=D7($),Q=J.type,Y=I7($),U=A7($),G=R7($),W=F7($),q=P7($),V=X.find((n)=>n.category==="frontend"),K=X.find((n)=>n.category==="css"),H=X.find((n)=>n.category==="ui"),T=X.find((n)=>n.category==="state"),N=X.find((n)=>n.category==="backend"),M=X.find((n)=>n.category==="database"),P=r$[Q]||r$.library,_=Q==="framework",j=X.some((n)=>n.slug==="svelte"||n.slug==="sveltekit"),x=_&&j?"svelte":_?null:null,k=Q==="svelte"||x==="svelte",y=k?w7($):null,p=k&&X.some((n)=>n.slug==="sveltekit"),A=new Set(["css_framework","ui_library","database","connection","hosting"]),u={},k0=$0.filter((n)=>n.path.startsWith("stack."));for(let n of k0){let o=n.path.replace("stack.","");if(!P.includes(n.category)){u[o]="slotignored";continue}if(_&&A.has(o)){u[o]="slotignored";continue}switch(o){case"frontend":u[o]=V?.name??(Q==="cli"?"CLI":"");break;case"css_framework":u[o]=K?.name??"";break;case"ui_library":u[o]=H?.name??"";break;case"state_management":u[o]=k?T?.name??"Runes":T?.name??"";break;case"backend":u[o]=k?p?"SvelteKit":N?.name??"":N?.name??"";break;case"api_type":u[o]=p?"Server Routes":"";break;case"runtime":u[o]=Y!=="Unknown"?Y:"";break;case"database":u[o]=M?.name??"";break;case"connection":u[o]=M?.name??"";break;case"hosting":if(k&&y)u[o]=y;else u[o]=W??"";break;case"build":u[o]=k?"Vite":q??"";break;case"cicd":u[o]=G??"";break;case"package_manager":u[o]=U;break;default:u[o]="";break}}let y0={},e=$0.filter((n)=>n.path.startsWith("monorepo."));for(let n of e){let o=n.path.replace("monorepo.","");if(!P.includes(n.category))y0[o]="slotignored";else y0[o]=""}let w1={name:Z?.name??$.split("/").pop()??"project",goal:Z?.description??"",main_language:z,type:Q};if(_&&x)w1.framework=x;let bZ=E7($,Z,X,z),xZ=_7($),kZ=C7($,Z),i4={faf_version:"2.5.0",project:w1,stack:u,human_context:{who:"",what:Z?.description??"",why:"",where:"",when:"",how:""},monorepo:y0,_meta:{found:J.found}};if(bZ.length>0)i4.tech_stack=bZ;if(xZ.length>0)i4.key_files=xZ;if(Object.keys(kZ).length>0)i4.commands=kZ;return i4}import{existsSync as DB,readFileSync as IB}from"fs";import{join as AB}from"path";var j7={MIN_LENGTH:8,MAX_LENGTH:280},TB=[/^(see|see\s+the?)\s+readme/i,/^(tbd|todo|fixme|coming\s+soon)\b/i,/^(software|application|app|project|tool|library|framework)\.?$/i,/^(for\s+users|for\s+developers)\.?$/i,/^(description|goal|name|title)\.?$/i,/^lorem\s+ipsum/i,/^example(\s+\w+)?\.?$/i];function b0($){let Z=$.trim();if(Z.length<j7.MIN_LENGTH)return!1;if(Z.length>j7.MAX_LENGTH)return!1;if(TB.some((X)=>X.test(Z)))return!1;if(/^[\s|\-*+]/.test(Z))return!1;if(Z.split(`
211
- `).length>4)return!1;return!0}function RB($){let Z=$.split(`
209
+ Run 'faf init' to create one.`),process.exit(2);let z=v(X),J=H0(z);if(Z.json){let Q=m(X),Y={faf_version:Q.faf_version??"unknown",project:Q.project?.name??"unknown",source:X,...J};console.log(JSON.stringify(Y,null,2));return}if(Z.status){console.log(`${a$(J.tier)} ${I(`${J.score}%`)}`);return}X0(J,X,Z.verbose)}import{existsSync as DL}from"fs";import{join as m7}from"path";var $0=[{index:1,path:"project.name",label:"Name",description:"Project name",category:"project"},{index:2,path:"project.goal",label:"Goal",description:"Goal (use case)",category:"project"},{index:3,path:"project.main_language",label:"Language",description:"Primary language",category:"project"},{index:4,path:"human_context.who",label:"Who",description:"Who is this for?",category:"human"},{index:5,path:"human_context.what",label:"What",description:"What are they building",category:"human"},{index:6,path:"human_context.why",label:"Why",description:"Why does it exist",category:"human"},{index:7,path:"human_context.where",label:"Where",description:"Where does it run",category:"human"},{index:8,path:"human_context.when",label:"When",description:"When was it started / timeline",category:"human"},{index:9,path:"human_context.how",label:"How",description:"How is it built",category:"human"},{index:10,path:"stack.frontend",canonical:"stack.framework",label:"Framework",description:"Framework (React, Svelte, etc.)",category:"frontend"},{index:11,path:"stack.css_framework",canonical:"stack.css",label:"CSS",description:"CSS framework",category:"frontend"},{index:12,path:"stack.ui_library",label:"UI Library",description:"UI component library",category:"frontend"},{index:13,path:"stack.state_management",canonical:"stack.state",label:"State",description:"State management",category:"frontend"},{index:14,path:"stack.backend",label:"Backend",description:"Backend framework",category:"backend"},{index:15,path:"stack.api_type",canonical:"stack.api",label:"API",description:"API style (REST, GraphQL, etc.)",category:"backend"},{index:16,path:"stack.runtime",label:"Runtime",description:"Runtime (Node, Bun, Python, etc.)",category:"backend"},{index:17,path:"stack.database",canonical:"stack.db",label:"Database",description:"Database",category:"backend"},{index:18,path:"stack.connection",label:"Connection",description:"Connection method (Prisma, etc.)",category:"backend"},{index:19,path:"stack.hosting",label:"Hosting",description:"Hosting platform",category:"universal"},{index:20,path:"stack.build",label:"Build",description:"Build tool",category:"universal"},{index:21,path:"stack.cicd",label:"CI/CD",description:"CI/CD",category:"universal"},{index:22,path:"stack.monorepo_tool",label:"Monorepo",description:"Monorepo tool",category:"enterprise_infra"},{index:23,path:"stack.package_manager",canonical:"stack.pkg_manager",label:"Package Manager",description:"Package manager",category:"enterprise_infra"},{index:24,path:"stack.workspaces",label:"Workspaces",description:"Workspace configuration",category:"enterprise_infra"},{index:25,path:"monorepo.packages_count",label:"Packages",description:"Number of packages",category:"enterprise_infra"},{index:26,path:"monorepo.build_orchestrator",label:"Build Orchestrator",description:"Build orchestration tool",category:"enterprise_infra"},{index:27,path:"stack.admin",label:"Admin",description:"Admin panel",category:"enterprise_app"},{index:28,path:"stack.cache",label:"Cache",description:"Caching layer",category:"enterprise_app"},{index:29,path:"stack.search",label:"Search",description:"Search engine",category:"enterprise_app"},{index:30,path:"stack.storage",label:"Storage",description:"Object storage",category:"enterprise_app"},{index:31,path:"monorepo.versioning_strategy",label:"Versioning",description:"Version strategy",category:"enterprise_ops"},{index:32,path:"monorepo.shared_configs",label:"Shared Configs",description:"Shared configs",category:"enterprise_ops"},{index:33,path:"monorepo.remote_cache",label:"Remote Cache",description:"Remote build cache",category:"enterprise_ops"}],o$=new Map($0.flatMap(($)=>$.canonical?[[$.path,$],[$.canonical,$]]:[[$.path,$]])),tD=new Map($0.filter(($)=>$.canonical).map(($)=>[$.canonical,$.path])),eD=new Map($0.filter(($)=>$.canonical).map(($)=>[$.path,$.canonical]));function T7($,Z){let X=(J)=>{let Q=J.split("."),Y=$;for(let U of Q)if(Y&&typeof Y==="object"&&U in Y)Y=Y[U];else return;return Y},z=X(Z.path);if(z!==void 0)return z;if(Z.canonical)return X(Z.canonical);return}var $I=$0.filter(($)=>$.index<=21);var z3=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","n/a","not applicable"]);function x0($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return z3.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var t$={about:[],documentation:["project","human"],intent:["project","human"],encyclopedia:["project","human"],cli:["project","human","universal"],library:["project","human","universal"],sdk:["project","human","universal"],wasm:["project","human","universal"],html:["project","human","universal"],"server-card":["project","human","universal"],frontend:["project","frontend","human","universal"],website:["project","frontend","human","universal"],mobile:["project","frontend","human","universal"],extension:["project","frontend","human","universal"],mcp:["project","backend","human","universal"],backend:["project","backend","universal","human"],"data-science":["project","backend","human","universal"],fullstack:["project","frontend","backend","universal","human"],svelte:["project","frontend","backend","universal","human"],framework:["project","frontend","backend","universal","human"],"monorepo-root":["project","human","enterprise_infra","enterprise_app","enterprise_ops"],mcpaas:["project","backend","universal","human","enterprise_app","enterprise_ops"],saas:["project","frontend","backend","universal","human","enterprise_app"],enterprise:["project","frontend","backend","universal","human","enterprise_infra","enterprise_app","enterprise_ops"]};import{existsSync as E,readFileSync as p0,readdirSync as A7}from"fs";import{join as C}from"path";var D7=[{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"}]}];import{existsSync as I7,readFileSync as JB,readdirSync as QB}from"fs";import{join as J3}from"path";var e$={version:1,_doc:"SINGLE SOURCE of Dart/Flutter detection KNOWLEDGE (A+B hybrid, the Truth-is-faf-cli spec). faf-cli imports this directly; faf-python-sdk vendors a synced copy (phase 2); MCPs consume the SDK (phase 3). To bolster Dart/Flutter support — a new state library, server framework, MCP dep — edit THIS file and every engine inherits it. The thin per-language LOGIC (pubspec parse, app-vs-package heuristic, priority branching) lives in code, not here.",flutterDeps:["flutter"],mcpDeps:["dart_mcp","mcp_server","mcp_dart","dart_mcp_server","mcp"],serverFrameworks:[["serverpod","Serverpod"],["dart_frog","Dart Frog"],["conduit","Conduit"],["angel3_framework","Angel3"],["alfred","Alfred"],["shelf","Shelf"]],stateManagement:[["flutter_riverpod","Riverpod"],["hooks_riverpod","Riverpod"],["riverpod","Riverpod"],["flutter_bloc","Bloc"],["bloc","Bloc"],["provider","Provider"],["get","GetX"],["flutter_mobx","MobX"],["mobx","MobX"],["signals","Signals"]],routing:[["go_router","go_router"],["auto_route","auto_route"]]};var YB=e$.flutterDeps,UB=e$.mcpDeps,GB=e$.serverFrameworks,WB=e$.stateManagement,qB=e$.routing;function VB($){let Z=new Set,X=!1;for(let z of $.split(`
210
+ `)){if(/^(dependencies|dev_dependencies|dependency_overrides):\s*$/.test(z)){X=!0;continue}if(/^\S/.test(z))X=!1;if(X){let J=z.match(/^\s{2}([a-zA-Z0-9_]+):/);if(J)Z.add(J[1].toLowerCase())}}return Z}function p2($){let Z=J3($,"pubspec.yaml");if(!I7(Z))return null;let X;try{X=JB(Z,"utf-8")}catch{return null}let z=VB(X),J=(j)=>z.has(j.toLowerCase()),Q=YB.some(J)||/^flutter:\s*$/m.test(X)||/\bsdk:\s*flutter\b/.test(X),Y=UB.find(J),U=GB.find(([j])=>J(j)),G=WB.find(([j])=>J(j)),W=G?G[1]:"",q=qB.find(([j])=>J(j)),V=q?q[1]:"",K=J("flutter_test")?"flutter_test":J("test")?"test":"",B=/^executables:\s*$/m.test(X),T=!1;try{T=QB(J3($,"bin")).some((j)=>j.endsWith(".dart"))}catch{}let N=B||T,M,P="",_;if(Q)if(P="Flutter",I7(J3($,"lib","main.dart"))||/^publish_to:\s*['"]?none\b/m.test(X))M="mobile",_="pubspec.yaml (Flutter app)";else M="library",_="pubspec.yaml (Flutter package)";else if(Y)M="mcp",_=`pubspec.yaml + ${Y} (Dart MCP server)`;else if(U)M="backend",P=U[1],_=`pubspec.yaml + ${U[0]} (Dart backend)`;else if(N)M="cli",_=B?"pubspec.yaml executables: (Dart CLI)":"pubspec.yaml + bin/*.dart (Dart CLI)";else M="library",_="pubspec.yaml (Dart package)";return{appType:M,isFlutter:Q,framework:P,stateManagement:W,routing:V,testing:K,found:_}}function KB($){let Z=C($,"Cargo.toml");if(!E(Z))return null;try{let z=p0(Z,"utf-8").match(/^\s*\[package\][\s\S]*?^\s*name\s*=\s*"([^"]+)"/m);return z?z[1]:null}catch{return null}}function HB($){let Z=C($,"Cargo.toml");if(!E(Z))return!1;try{let X=p0(Z,"utf-8");return/^\s*\[\[bin\]\]/m.test(X)}catch{return!1}}function BB($,Z){if(Z?.keywords?.some((z)=>/^sdk(?:\s|-|$)|\-sdk$/i.test(z)))return'package.json keywords contains "sdk"';if(Z?.name&&/(?:^|[-_/])sdk(?:[-_/]|$)/i.test(Z.name))return`package.json name "${Z.name}" → sdk`;let X=KB($);if(X&&/(?:^|[-_])sdk(?:[-_]|$)/i.test(X))return`Cargo.toml name "${X}" → sdk`;return null}function LB($){let Z=["manifest.json","public/manifest.json","src/manifest.json","app/manifest.json","extension/manifest.json","dist/manifest.json"];for(let X of Z){let z=C($,X);if(!E(z))continue;try{let J=JSON.parse(p0(z,"utf-8"));if(typeof J.manifest_version==="number")return`${X} manifest_version ${J.manifest_version} (browser extension)`}catch{}}return null}function NB($){let Z=/(numpy|pandas|jupyter|scikit-learn|sklearn|pytorch|tensorflow|matplotlib|scipy)/i,X=C($,"pyproject.toml");if(E(X))try{let Q=p0(X,"utf-8").match(Z);if(Q)return`pyproject.toml depends on ${Q[1]}`}catch{}let z=C($,"requirements.txt");if(E(z))try{let Q=p0(z,"utf-8").match(Z);if(Q)return`requirements.txt contains ${Q[1]}`}catch{}return null}function MB($,Z){let X=["react-native","expo","@capacitor/core","@ionic/core"];if(Z){for(let z of X)if(Z.dependencies?.[z]||Z.devDependencies?.[z])return`${z} dependency`}if(E(C($,"ios"))&&E(C($,"android")))return"ios/ + android/ dirs";return null}function OB($,Z){let X=C($,"Cargo.toml");if(E(X))try{let J=p0(X,"utf-8");if(/crate-type\s*=\s*\[[^\]]*"cdylib"/.test(J))return'Cargo.toml crate-type = ["cdylib"]';if(/wasm-bindgen|wasm-pack/i.test(J))return"Cargo.toml wasm-bindgen/wasm-pack"}catch{}let z=C($,"build.zig");if(E(z))try{let J=p0(z,"utf-8");if(/\.wasm\b|wasm32|setOutputFormat\(\.wasm/i.test(J))return"build.zig wasm target"}catch{}if(Z?.keywords?.some((J)=>/^wasm(?:-|$)|webassembly/i.test(J)))return'package.json keywords contains "wasm"';return null}function TB($,Z){if(!E(C($,"index.html")))return null;if(Z?.dependencies||Z?.devDependencies){let X={...Z.dependencies??{},...Z.devDependencies??{}};if(["react","vue","svelte","@sveltejs/kit","next","nuxt","astro","gatsby","solid-js","qwik"].some((J)=>X[J]))return null}return"index.html (vanilla, no frontend framework)"}function DB($,Z){if(Z?.name&&/specification|^@.*\/spec/i.test(Z.name))return`package name "${Z.name}" → documentation`;if(Z?.keywords?.some((X)=>/^(specification|format-spec|standard)$/i.test(X)))return'package keywords contains "specification"';if(Z?.files&&Z.files.length>0){let X=/^(dist|src|lib|build|bin)\/|\.(js|ts|tsx|jsx|mjs|cjs|py|rs|go)$/,z=Z.files.some((Q)=>X.test(Q)),J=Z.files.some((Q)=>/\.(md|MD)|examples?\//.test(Q));if(!z&&J)return"package.json files = docs/examples only (no source)"}return null}function IB($,Z,X){let z=X.find((J)=>J.slug==="astro"||J.slug==="gatsby");if(z)return`${z.name} (static-site framework)`;if(Z?.keywords?.some((J)=>/^(website|marketing|landing|brochure|portfolio)$/i.test(J)))return'package keywords contains "website"/"marketing"/"landing"';return null}function AB($,Z){if(!Z)return null;let X={...Z.dependencies??{},...Z.devDependencies??{}},z=["@clerk/nextjs","@clerk/clerk-react","next-auth","@auth/core","auth0","@auth0/nextjs-auth0"],J=["stripe","@stripe/stripe-js","lemonsqueezy"],Q=z.some((U)=>X[U]),Y=J.some((U)=>X[U]);if(Q&&Y)return"auth + payment dependencies";return null}function RB($,Z,X){if(Z?.keywords?.some((Q)=>/mcpaas/i.test(Q)))return'package keywords contains "mcpaas"';if(Z?.name&&/mcpaas/i.test(Z.name))return`package name "${Z.name}" → mcpaas`;let z=X.some((Q)=>Q.slug==="mcp"),J=X.some((Q)=>Q.category==="database");if(z&&J&&Z?.dependencies&&Object.keys(Z.dependencies).length>10)return"MCP + database + complex deps (platform shape)";return null}function FB($,Z){if(!Z?.private)return null;if(!(!!Z.workspaces||E(C($,"pnpm-workspace.yaml"))))return null;return"private workspace + multi-package"}function P$($){let Z=C($,"package.json");if(!E(Z))return null;try{return JSON.parse(p0(Z,"utf-8"))}catch{return null}}function wB($,Z){if(!Z.includes("*"))return E(C($,Z));let X=Z.split("/");if(X.length===1){let U=Z.split("*")[0];try{return A7($).some((G)=>G.startsWith(U))}catch{return!1}}let z=C($,...X.slice(0,-1)),J=X[X.length-1],Q=J.split("*")[0],Y=J.split("*")[1]||"";try{return A7(z).some((U)=>U.startsWith(Q)&&U.endsWith(Y))}catch{return!1}}function PB($,Z,X){switch($.type){case"dependency":return!!Z?.dependencies?.[$.key];case"devDependency":return!!Z?.devDependencies?.[$.key];case"file":return wB(X,$.pattern);default:return!1}}function Q3($){let Z=P$($);return D7.map((X)=>{let J=X.signals.filter((Q)=>PB(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 R7($){let Z=P$($);if(Z?.devDependencies?.typescript||Z?.dependencies?.typescript)return"TypeScript";if(E(C($,"tsconfig.json")))return"TypeScript";if(E(C($,"Cargo.toml")))return"Rust";if(E(C($,"go.mod")))return"Go";if(E(C($,"pyproject.toml"))||E(C($,"setup.py")))return"Python";if(E(C($,"Gemfile")))return"Ruby";if(E(C($,"pom.xml"))||E(C($,"build.gradle")))return"Java";if(E(C($,"Package.swift")))return"Swift";if(E(C($,"build.zig")))return"Zig";if(E(C($,"pubspec.yaml")))return"Dart";if(Z)return"JavaScript";return"Unknown"}function F7($){let Z=P$($),X=Q3($),z=[],J=DB($,Z);if(J)return z.push(J),{type:"documentation",found:z};let Q=BB($,Z);if(Q)return z.push(Q),{type:"sdk",found:z};let Y=LB($);if(Y)return z.push(Y),{type:"extension",found:z};let U=RB($,Z,X);if(U)return z.push(U),{type:"mcpaas",found:z};let G=AB($,Z);if(G)return z.push(G),{type:"saas",found:z};let W=OB($,Z);if(W)return z.push(W),{type:"wasm",found:z};let q=p2($);if(q)return z.push(q.found),{type:q.appType,found:z};let V=MB($,Z);if(V)return z.push(V),{type:"mobile",found:z};if(X.some((R)=>R.slug==="mcp"))return z.push("MCP SDK signal"),{type:"mcp",found:z};if(Z?.bin)return z.push("package.json bin"),{type:"cli",found:z};if(HB($))return z.push("Cargo.toml [[bin]]"),{type:"cli",found:z};if(E(C($,"build.zig"))){if(z.push("build.zig"),E(C($,"src/main.zig")))return z.push("src/main.zig"),{type:"cli",found:z};if(E(C($,"src/root.zig")))return z.push("src/root.zig"),{type:"library",found:z}}let B=X.some((R)=>R.slug==="svelte"||R.slug==="sveltekit");if(Z?.private===!0&&(E(C($,"pnpm-workspace.yaml"))||Z?.workspaces!==void 0)&&B)return z.push("private workspace","Svelte"),{type:"framework",found:z};if(B)return z.push("Svelte/SvelteKit"),{type:"svelte",found:z};let N=X.some((R)=>R.category==="frontend"),M=X.some((R)=>R.category==="backend");if(Z?.private&&(Z.workspaces||E(C($,"pnpm-workspace.yaml")))&&N&&M)return z.push("private workspace + frontend + backend frameworks"),{type:"enterprise",found:z};let P=FB($,Z);if(P)return z.push(P),{type:"monorepo-root",found:z};let _=IB($,Z,X);if(_)return z.push(_),{type:"website",found:z};if(X.some((R)=>R.slug==="nextjs"||R.slug==="nuxt"))return z.push(X.find((R)=>R.slug==="nextjs")?"Next.js":"Nuxt"),{type:"fullstack",found:z};let x=X.some((R)=>R.category==="frontend"),k=X.some((R)=>R.category==="backend");if(x&&k)return z.push("frontend framework","backend framework"),{type:"fullstack",found:z};if(x)return z.push("frontend framework"),{type:"frontend",found:z};if(k)return z.push("backend framework"),{type:"backend",found:z};let y=NB($);if(y)return z.push(y),{type:"data-science",found:z};let p=TB($,Z);if(p)return z.push(p),{type:"html",found:z};if(Z?.main&&!Z?.bin)return z.push("package.json main (no bin)"),{type:"library",found:z};return z.push("no classifying signals — fallback"),{type:"library",found:z}}function w7($){if(E(C($,"bunfig.toml")))return"Bun";if(E(C($,"deno.json"))||E(C($,"deno.jsonc")))return"Deno";if(P$($))return"Node.js";if(E(C($,"Cargo.toml")))return"Rust";if(E(C($,"go.mod")))return"Go";if(E(C($,"pubspec.yaml")))return"Dart";return"Unknown"}function P7($){if(E(C($,"pubspec.yaml")))return"pub";if(E(C($,"bun.lockb"))||E(C($,"bun.lock")))return"bun";if(E(C($,"pnpm-lock.yaml")))return"pnpm";if(E(C($,"yarn.lock")))return"yarn";if(E(C($,"package-lock.json")))return"npm";return"npm"}function _7($){if(E(C($,".github/workflows")))return"GitHub Actions";if(E(C($,".gitlab-ci.yml")))return"GitLab CI";if(E(C($,".circleci")))return"CircleCI";if(E(C($,"Jenkinsfile")))return"Jenkins";return null}function C7($){if(E(C($,"vercel.json")))return"Vercel";if(E(C($,"netlify.toml")))return"Netlify";if(E(C($,"wrangler.toml")))return"Cloudflare";if(E(C($,"Dockerfile")))return"Docker";if(E(C($,"fly.toml")))return"Fly.io";if(E(C($,"render.yaml")))return"Render";return null}function E7($){let Z=C($,"svelte.config.js");if(!E(Z))return null;try{let z=p0(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 j7($){let Z=P$($);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(E(C($,"tsconfig.json"))&&Z?.devDependencies?.typescript)return"TypeScript (tsc)";return null}function S7($){return["package.json","Cargo.toml","pyproject.toml","go.mod","build.zig","build.zig.zon","src/index.ts","src/index.js","src/main.ts","src/cli.ts","src/main.rs","src/lib.rs","src/main.zig","src/root.zig","src/__init__.py","main.py","__main__.py","main.go","cmd/main.go","README.md","SPECIFICATION.md","BINARY-FORMAT.md","tsconfig.json","wrangler.toml","vercel.json"].filter((X)=>E(C($,X)))}function b7($,Z){let X={};if(Z?.scripts){for(let z of["build","test","lint","dev","start"])if(Z.scripts[z]){let J=E(C($,"bun.lock"))||E(C($,"bun.lockb"))?"bun run":"npm run";X[z]=`${J} ${z}`}}if(E(C($,"Cargo.toml"))){if(!X.build)X.build="cargo build --release";if(!X.test)X.test="cargo test";if(!X.lint)X.lint="cargo clippy"}if(E(C($,"build.zig"))){if(!X.build)X.build="zig build";if(!X.test)X.test="zig build test"}if(E(C($,"go.mod"))){if(!X.build)X.build="go build ./...";if(!X.test)X.test="go test ./..."}if(E(C($,"pyproject.toml"))||E(C($,"pytest.ini"))){if(!X.test)X.test="pytest"}return X}function x7($,Z,X,z){let J=[];if(z&&z!=="Unknown")J.push(z);let Q=new Set(["frontend","backend","database","build","css","state","monorepo"]);for(let Y of X)if(Q.has(Y.category))J.push(Y.name);if(E(C($,"bunfig.toml")))J.push("Bun");else if(E(C($,"deno.json"))||E(C($,"deno.jsonc")))J.push("Deno");if(J.length<3&&Z?.dependencies){let Y=Object.keys(Z.dependencies).slice(0,5);for(let U of Y)if(!J.some((G)=>G.toLowerCase().includes(U.toLowerCase())))J.push(U)}return J}function l2($){let Z=P$($),X=Q3($),z=R7($),J=F7($),Q=J.type,Y=w7($),U=P7($),G=_7($),W=C7($),q=j7($),V=X.find((n)=>n.category==="frontend"),K=X.find((n)=>n.category==="css"),B=X.find((n)=>n.category==="ui"),T=X.find((n)=>n.category==="state"),N=X.find((n)=>n.category==="backend"),M=X.find((n)=>n.category==="database"),P=t$[Q]||t$.library,_=Q==="framework",j=X.some((n)=>n.slug==="svelte"||n.slug==="sveltekit"),x=_&&j?"svelte":_?null:null,k=Q==="svelte"||x==="svelte",y=k?E7($):null,p=k&&X.some((n)=>n.slug==="sveltekit"),R=new Set(["css_framework","ui_library","database","connection","hosting"]),u={},f0=$0.filter((n)=>n.path.startsWith("stack."));for(let n of f0){let o=n.path.replace("stack.","");if(!P.includes(n.category)){u[o]="slotignored";continue}if(_&&R.has(o)){u[o]="slotignored";continue}switch(o){case"frontend":u[o]=V?.name??(Q==="cli"?"CLI":"");break;case"css_framework":u[o]=K?.name??"";break;case"ui_library":u[o]=B?.name??"";break;case"state_management":u[o]=k?T?.name??"Runes":T?.name??"";break;case"backend":u[o]=k?p?"SvelteKit":N?.name??"":N?.name??"";break;case"api_type":u[o]=p?"Server Routes":"";break;case"runtime":u[o]=Y!=="Unknown"?Y:"";break;case"database":u[o]=M?.name??"";break;case"connection":u[o]=M?.name??"";break;case"hosting":if(k&&y)u[o]=y;else u[o]=W??"";break;case"build":u[o]=k?"Vite":q??"";break;case"cicd":u[o]=G??"";break;case"package_manager":u[o]=U;break;default:u[o]="";break}}let g0={},e=$0.filter((n)=>n.path.startsWith("monorepo."));for(let n of e){let o=n.path.replace("monorepo.","");if(!P.includes(n.category))g0[o]="slotignored";else g0[o]=""}let j1={name:Z?.name??$.split("/").pop()??"project",goal:Z?.description??"",main_language:z,type:Q};if(_&&x)j1.framework=x;let fZ=x7($,Z,X,z),gZ=S7($),vZ=b7($,Z),o4={faf_version:"2.5.0",project:j1,stack:u,human_context:{who:"",what:Z?.description??"",why:"",where:"",when:"",how:""},monorepo:g0,_meta:{found:J.found}};if(fZ.length>0)o4.tech_stack=fZ;if(gZ.length>0)o4.key_files=gZ;if(Object.keys(vZ).length>0)o4.commands=vZ;return o4}import{existsSync as CB,readFileSync as EB}from"fs";import{join as jB}from"path";var k7={MIN_LENGTH:8,MAX_LENGTH:280},_B=[/^(see|see\s+the?)\s+readme/i,/^(tbd|todo|fixme|coming\s+soon)\b/i,/^(software|application|app|project|tool|library|framework)\.?$/i,/^(for\s+users|for\s+developers)\.?$/i,/^(description|goal|name|title)\.?$/i,/^lorem\s+ipsum/i,/^example(\s+\w+)?\.?$/i];function k0($){let Z=$.trim();if(Z.length<k7.MIN_LENGTH)return!1;if(Z.length>k7.MAX_LENGTH)return!1;if(_B.some((X)=>X.test(Z)))return!1;if(/^[\s|\-*+]/.test(Z))return!1;if(Z.split(`
211
+ `).length>4)return!1;return!0}function SB($){let Z=$.split(`
212
212
  `),X=0;while(X<Z.length&&/^(#\s|$)/.test(Z[X].trim()))X++;while(X<Z.length){let z=Z[X].trim();if(/^\[!\[/.test(z)){X++;continue}if(/^!\[/.test(z)){X++;continue}if(/^<img\s/i.test(z)){X++;continue}if(z===""){X++;continue}break}return Z.slice(X).join(`
213
- `)}function FB($){let X=RB($).split(`
214
- `),z=[];for(let J of X){let Q=J.trim();if(Q===""){if(z.length>0)break;continue}if(/^(#|>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(Q))break;if(/^\*\*[^*]+\*\*\s*$/.test(Q)&&z.length===0)continue;z.push(Q)}if(z.length===0)return null;return z.join(" ").trim()}function F$($,Z){let X=$.split(`
215
- `),z=0;while(z<X.length){let Q=X[z].trim().match(/^(#{1,6})\s+(.+)$/);if(Q&&Z.test(Q[2])){let Y=Q[1].length,U=[];z++;while(z<X.length){let G=X[z].trim(),W=G.match(/^(#{1,6})\s+/);if(W&&W[1].length<=Y)break;if(G===""){if(U.length>0)break;z++;continue}if(/^(>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(G))break;U.push(G),z++}if(U.length===0)return null;return U.join(" ").trim()}z++}return null}function wB($){let Z=F$($,/^(use\s+cases?|goal)\b/i);if(Z&&b0(Z))return Z;let X=FB($);if(X&&b0(X))return X;return}function PB($){let Z=F$($,/^(about|description|overview|what(\s+is\s+this)?)\b/i);if(Z&&b0(Z))return Z;return}function _B($){let Z=F$($,/^(audience|users?|for\s+whom|who(\s+is\s+this\s+for)?)\b/i);if(Z&&b0(Z))return Z;return}function CB($){let Z=F$($,/^(why|motivation|problem|rationale)\b/i);if(Z&&b0(Z))return Z;return}function EB($){let Z=F$($,/^(deployment|where(\s+it\s+runs)?|hosting)\b/i);if(Z&&b0(Z))return Z;return}function jB($){let Z=F$($,/^(status|history|timeline|since|launched)\b/i);if(Z&&b0(Z))return Z;return}function SB($){let Z=F$($,/^(architecture|how(\s+it\s+works)?|approach|design)\b/i);if(Z&&b0(Z))return Z;return}function X3($){let Z=["README.md","README.MD","Readme.md","readme.md"],X=null;for(let H of Z){let T=AB($,H);if(DB(T)){X=T;break}}if(!X)return{};let z;try{z=IB(X,"utf-8")}catch{return{}}let J={},Q=wB(z);if(Q)J.project={goal:Q};let Y={},U=PB(z);if(U)Y.what=U;let G=_B(z);if(G)Y.who=G;let W=CB(z);if(W)Y.why=W;let q=EB(z);if(q)Y.where=q;let V=jB(z);if(V)Y.when=V;let K=SB(z);if(K)Y.how=K;if(Object.keys(Y).length>0)J.human_context=Y;return J}import{existsSync as bB,readFileSync as xB}from"fs";import{join as kB}from"path";function yB($,Z){let X=$.split(`
216
- `),z=!1;for(let J of X){let Q=J.trim();if(/^\[/.test(Q)){z=Q==="[package]";continue}if(!z)continue;let Y=Q.match(new RegExp(`^${Z}\\s*=\\s*(.+)$`));if(Y){let U=Y[1].trim();U=U.replace(/\s*#.*$/,"").trim();let G=U.match(/^"((?:[^"\\]|\\.)*)"$/)||U.match(/^'((?:[^'\\]|\\.)*)'$/);if(G)return G[1];return U}}return null}function z3($){let Z=kB($,"Cargo.toml");if(!bB(Z))return{};let X;try{X=xB(Z,"utf-8")}catch{return{}}let z=yB(X,"description");if(z&&b0(z))return{project:{goal:z}};return{}}function fB($,Z){let X={project:{...Z.project??{},...$.project??{}},human_context:{...Z.human_context??{},...$.human_context??{}}};if(X.project&&Object.keys(X.project).length===0)delete X.project;if(X.human_context&&Object.keys(X.human_context).length===0)delete X.human_context;return X}function c2($){return fB(X3($),z3($))}import{existsSync as gB,readdirSync as S7,readFileSync as hB}from"fs";import{join as Q3,dirname as vB,extname as uB,resolve as mB}from"path";var J3={"package.json":{frameworks:["Node.js","JavaScript","TypeScript"],slots:{packageManager:"npm/yarn/pnpm",mainLanguage:"JavaScript/TypeScript"},priority:35,intelligence:"ultra-high"},"README.md":{frameworks:[],slots:{targetUser:"developers",coreProblem:"understanding project",missionPurpose:"project documentation"},priority:25,intelligence:"high"},"requirements.txt":{frameworks:["Python"],slots:{packageManager:"pip",mainLanguage:"Python"},priority:35,intelligence:"ultra-high"},Pipfile:{frameworks:["Python"],slots:{packageManager:"pipenv",mainLanguage:"Python"},priority:35,intelligence:"ultra-high"},"pyproject.toml":{frameworks:["Python"],slots:{mainLanguage:"Python",runtime:"Python",backend:"Python"},priority:36,intelligence:"ultra-high"},Gemfile:{frameworks:["Ruby","Rails"],slots:{packageManager:"bundler",mainLanguage:"Ruby"},priority:35,intelligence:"ultra-high"},"composer.json":{frameworks:["PHP","Laravel","Symfony"],slots:{packageManager:"composer",mainLanguage:"PHP"},priority:35,intelligence:"ultra-high"},"Cargo.toml":{frameworks:["Rust"],slots:{packageManager:"cargo",mainLanguage:"Rust",buildTool:"cargo"},priority:36,intelligence:"ultra-high"},"go.mod":{frameworks:["Go"],slots:{packageManager:"go modules",mainLanguage:"Go",buildTool:"go build"},priority:36,intelligence:"ultra-high"},"pubspec.yaml":{frameworks:["Dart"],slots:{packageManager:"pub",mainLanguage:"Dart"},priority:35,intelligence:"ultra-high"},"pom.xml":{frameworks:["Java","Spring","Maven"],slots:{packageManager:"maven",mainLanguage:"Java",buildTool:"maven"},priority:35,intelligence:"ultra-high"},"build.gradle":{frameworks:["Java","Kotlin","Spring","Gradle"],slots:{packageManager:"gradle",mainLanguage:"Java/Kotlin",buildTool:"gradle"},priority:35,intelligence:"ultra-high"},"next.config.js":{frameworks:["Next.js"],slots:{framework:"Next.js",runtime:"Node.js",buildTool:"Next.js",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"next.config.mjs":{frameworks:["Next.js"],slots:{framework:"Next.js",runtime:"Node.js",buildTool:"Next.js",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"next.config.ts":{frameworks:["Next.js 13+"],slots:{framework:"Next.js 13+",runtime:"Node.js",buildTool:"Next.js",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"nuxt.config.js":{frameworks:["Nuxt 2"],slots:{framework:"Nuxt 2",runtime:"Node.js",buildTool:"Nuxt",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"nuxt.config.ts":{frameworks:["Nuxt 3"],slots:{framework:"Nuxt 3",runtime:"Node.js",buildTool:"Nuxt",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"svelte.config.js":{frameworks:["SvelteKit"],slots:{framework:"SvelteKit",buildTool:"Vite",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"angular.json":{frameworks:["Angular"],slots:{framework:"Angular",buildTool:"Angular CLI",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"manifest.json":{frameworks:["Chrome Extension","Browser Extension"],slots:{framework:"Chrome Extension",runtime:"Chrome/Browser",mainLanguage:"JavaScript",hosting:"Chrome Web Store",apiType:"Chrome APIs"},priority:35,intelligence:"ultra-high",confirmWith:["popup.html","background.js","content.js"]},"vue.config.js":{frameworks:["Vue"],slots:{framework:"Vue",buildTool:"Vue CLI",mainLanguage:"JavaScript"},priority:30,intelligence:"high"},"remix.config.js":{frameworks:["Remix"],slots:{framework:"Remix",runtime:"Node.js",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"gatsby-config.js":{frameworks:["Gatsby"],slots:{framework:"Gatsby",buildTool:"Gatsby",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"gatsby-config.ts":{frameworks:["Gatsby"],slots:{framework:"Gatsby",buildTool:"Gatsby",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"astro.config.mjs":{frameworks:["Astro"],slots:{framework:"Astro",buildTool:"Vite",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"redwood.toml":{frameworks:["RedwoodJS"],slots:{framework:"RedwoodJS",buildTool:"Webpack",mainLanguage:"JavaScript/TypeScript",server:"Node.js",database:"Prisma"},priority:30,intelligence:"high"},"blitz.config.ts":{frameworks:["Blitz.js"],slots:{framework:"Blitz.js",buildTool:"Next.js",mainLanguage:"TypeScript",server:"Node.js",database:"Prisma"},priority:30,intelligence:"high"},"qwik.config.ts":{frameworks:["Qwik"],slots:{framework:"Qwik",buildTool:"Vite",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"manage.py":{frameworks:["Django"],slots:{framework:"Django",backend:"Django",mainLanguage:"Python",server:"Django",apiType:"Django Views"},priority:30,intelligence:"high"},artisan:{frameworks:["Laravel"],slots:{framework:"Laravel",backend:"Laravel",mainLanguage:"PHP",server:"PHP",apiType:"Laravel Routes"},priority:30,intelligence:"high"},"mix.exs":{frameworks:["Phoenix","Elixir"],slots:{framework:"Phoenix",backend:"Phoenix",mainLanguage:"Elixir",server:"BEAM"},priority:30,intelligence:"high"},"nest-cli.json":{frameworks:["NestJS"],slots:{framework:"NestJS",backend:"NestJS",mainLanguage:"TypeScript",server:"Node.js",apiType:"REST API"},priority:30,intelligence:"high"},"strapi.config.js":{frameworks:["Strapi"],slots:{backend:"Strapi",apiType:"REST API",database:"Required",server:"Node.js"},priority:30,intelligence:"high"},Dockerfile:{frameworks:["Docker"],slots:{hosting:"Docker",connection:"Containerized"},priority:30,intelligence:"high"},"docker-compose.yml":{frameworks:["Docker Compose"],slots:{hosting:"Docker",connection:"Multi-container"},priority:30,intelligence:"high"},"docker-compose.yaml":{frameworks:["Docker Compose"],slots:{hosting:"Docker",connection:"Multi-container"},priority:30,intelligence:"high"},"kubernetes.yml":{frameworks:["Kubernetes"],slots:{hosting:"Kubernetes",connection:"Orchestrated"},priority:30,intelligence:"high"},"k8s.yaml":{frameworks:["Kubernetes"],slots:{hosting:"Kubernetes",connection:"Orchestrated"},priority:30,intelligence:"high"},"vercel.json":{frameworks:["Vercel"],slots:{hosting:"Vercel",cicd:"Vercel"},priority:30,intelligence:"high"},"netlify.toml":{frameworks:["Netlify"],slots:{hosting:"Netlify",cicd:"Netlify"},priority:30,intelligence:"high"},"render.yaml":{frameworks:["Render"],slots:{hosting:"Render",cicd:"Render"},priority:30,intelligence:"high"},"fly.toml":{frameworks:["Fly.io"],slots:{hosting:"Fly.io",cicd:"Fly.io"},priority:30,intelligence:"high"},"railway.json":{frameworks:["Railway"],slots:{hosting:"Railway",cicd:"Railway"},priority:30,intelligence:"high"},"railway.toml":{frameworks:["Railway"],slots:{hosting:"Railway",cicd:"Railway"},priority:30,intelligence:"high"},"app.yaml":{frameworks:["Google App Engine"],slots:{hosting:"Google Cloud",cicd:"Google Cloud"},priority:30,intelligence:"high"},Procfile:{frameworks:["Heroku"],slots:{hosting:"Heroku",cicd:"Heroku"},priority:30,intelligence:"high"},"vite.config.js":{frameworks:["Vite"],slots:{buildTool:"Vite"},priority:25,intelligence:"medium"},"vite.config.ts":{frameworks:["Vite"],slots:{buildTool:"Vite",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"webpack.config.js":{frameworks:["Webpack"],slots:{buildTool:"Webpack"},priority:25,intelligence:"medium"},"rollup.config.js":{frameworks:["Rollup"],slots:{buildTool:"Rollup"},priority:25,intelligence:"medium"},"esbuild.config.js":{frameworks:["esbuild"],slots:{buildTool:"esbuild"},priority:25,intelligence:"medium"},"parcel.config.js":{frameworks:["Parcel"],slots:{buildTool:"Parcel"},priority:25,intelligence:"medium"},"snowpack.config.js":{frameworks:["Snowpack"],slots:{buildTool:"Snowpack"},priority:25,intelligence:"medium"},"tsconfig.json":{frameworks:["TypeScript"],slots:{mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"jsconfig.json":{frameworks:["JavaScript"],slots:{mainLanguage:"JavaScript"},priority:20,intelligence:"medium"},"babel.config.js":{frameworks:["Babel"],slots:{buildTool:"Babel"},priority:20,intelligence:"medium"},".babelrc":{frameworks:["Babel"],slots:{buildTool:"Babel"},priority:20,intelligence:"medium"},"jest.config.js":{frameworks:["Jest"],slots:{cicd:"Jest"},priority:25,intelligence:"medium"},"jest.config.ts":{frameworks:["Jest"],slots:{cicd:"Jest",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"vitest.config.ts":{frameworks:["Vitest"],slots:{cicd:"Vitest",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"cypress.config.js":{frameworks:["Cypress"],slots:{cicd:"Cypress"},priority:25,intelligence:"medium"},"playwright.config.ts":{frameworks:["Playwright"],slots:{cicd:"Playwright",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"karma.conf.js":{frameworks:["Karma"],slots:{cicd:"Karma"},priority:20,intelligence:"medium"},"mocha.opts":{frameworks:["Mocha"],slots:{cicd:"Mocha"},priority:20,intelligence:"medium"},".rspec":{frameworks:["RSpec"],slots:{cicd:"RSpec",mainLanguage:"Ruby"},priority:25,intelligence:"medium"},"pytest.ini":{frameworks:["Pytest"],slots:{cicd:"Pytest",mainLanguage:"Python"},priority:25,intelligence:"medium"},"phpunit.xml":{frameworks:["PHPUnit"],slots:{cicd:"PHPUnit",mainLanguage:"PHP"},priority:25,intelligence:"medium"},"schema.prisma":{frameworks:["Prisma"],slots:{database:"Prisma ORM",connection:"Prisma"},priority:25,intelligence:"medium"},"drizzle.config.ts":{frameworks:["Drizzle"],slots:{database:"Drizzle ORM",connection:"Drizzle",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"ormconfig.js":{frameworks:["TypeORM"],slots:{database:"TypeORM",connection:"TypeORM"},priority:25,intelligence:"medium"},"knexfile.js":{frameworks:["Knex.js"],slots:{database:"Knex.js",connection:"Knex.js"},priority:25,intelligence:"medium"},"sequelize.config.js":{frameworks:["Sequelize"],slots:{database:"Sequelize",connection:"Sequelize"},priority:25,intelligence:"medium"},"alembic.ini":{frameworks:["Alembic"],slots:{database:"Alembic",mainLanguage:"Python"},priority:25,intelligence:"medium"},".github/workflows":{frameworks:["GitHub Actions"],slots:{cicd:"GitHub Actions"},priority:25,intelligence:"medium"},".gitlab-ci.yml":{frameworks:["GitLab CI"],slots:{cicd:"GitLab CI"},priority:25,intelligence:"medium"},Jenkinsfile:{frameworks:["Jenkins"],slots:{cicd:"Jenkins"},priority:25,intelligence:"medium"},".circleci/config.yml":{frameworks:["CircleCI"],slots:{cicd:"CircleCI"},priority:25,intelligence:"medium"},".travis.yml":{frameworks:["Travis CI"],slots:{cicd:"Travis CI"},priority:25,intelligence:"medium"},"azure-pipelines.yml":{frameworks:["Azure DevOps"],slots:{cicd:"Azure DevOps"},priority:25,intelligence:"medium"},"bitbucket-pipelines.yml":{frameworks:["Bitbucket Pipelines"],slots:{cicd:"Bitbucket Pipelines"},priority:25,intelligence:"medium"},"tailwind.config.js":{frameworks:["Tailwind CSS"],slots:{cssFramework:"Tailwind CSS"},priority:20,intelligence:"medium"},"tailwind.config.ts":{frameworks:["Tailwind CSS"],slots:{cssFramework:"Tailwind CSS",mainLanguage:"TypeScript"},priority:20,intelligence:"medium"},"postcss.config.js":{frameworks:["PostCSS"],slots:{cssFramework:"PostCSS"},priority:20,intelligence:"medium"},"uno.config.ts":{frameworks:["UnoCSS"],slots:{cssFramework:"UnoCSS",mainLanguage:"TypeScript"},priority:20,intelligence:"medium"},"styled-components.config.js":{frameworks:["styled-components"],slots:{cssFramework:"styled-components",uiLibrary:"styled-components"},priority:20,intelligence:"medium"},"emotion.config.js":{frameworks:["Emotion"],slots:{cssFramework:"Emotion",uiLibrary:"Emotion"},priority:20,intelligence:"medium"},"metro.config.js":{frameworks:["React Native"],slots:{framework:"React Native",mainLanguage:"JavaScript"},priority:25,intelligence:"medium"},"expo.config.js":{frameworks:["Expo"],slots:{framework:"React Native",buildTool:"Expo"},priority:25,intelligence:"medium"},"app.json":{frameworks:["React Native","Expo"],slots:{framework:"React Native"},priority:20,intelligence:"medium",confirmWith:["expo"]},"capacitor.config.ts":{frameworks:["Capacitor"],slots:{framework:"Capacitor",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"ionic.config.json":{frameworks:["Ionic"],slots:{framework:"Ionic",uiLibrary:"Ionic"},priority:25,intelligence:"medium"},"nx.json":{frameworks:["Nx"],slots:{buildTool:"Nx"},priority:25,intelligence:"medium"},"turbo.json":{frameworks:["Turborepo"],slots:{buildTool:"Turborepo"},priority:25,intelligence:"medium"},"lerna.json":{frameworks:["Lerna"],slots:{buildTool:"Lerna"},priority:25,intelligence:"medium"},"rush.json":{frameworks:["Rush"],slots:{buildTool:"Rush"},priority:25,intelligence:"medium"},"pnpm-workspace.yaml":{frameworks:["pnpm workspaces"],slots:{packageManager:"pnpm",buildTool:"pnpm workspaces"},priority:25,intelligence:"medium"},"*.svelte":{frameworks:["Svelte","SvelteKit"],slots:{framework:"Svelte"},priority:15,intelligence:"low"},"*.vue":{frameworks:["Vue"],slots:{framework:"Vue"},priority:15,intelligence:"low"},"*.jsx":{frameworks:["React"],slots:{framework:"React",mainLanguage:"JavaScript"},priority:15,intelligence:"low"},"*.ts":{frameworks:["TypeScript"],slots:{mainLanguage:"TypeScript"},priority:15,intelligence:"low"},"*.tsx":{frameworks:["React","TypeScript"],slots:{framework:"React",mainLanguage:"TypeScript"},priority:15,intelligence:"low"},"*.py":{frameworks:["Python"],slots:{mainLanguage:"Python"},priority:15,intelligence:"low"},"*.rb":{frameworks:["Ruby"],slots:{mainLanguage:"Ruby"},priority:15,intelligence:"low"},"*.php":{frameworks:["PHP"],slots:{mainLanguage:"PHP"},priority:15,intelligence:"low"},"*.java":{frameworks:["Java"],slots:{mainLanguage:"Java"},priority:15,intelligence:"low"},"*.kt":{frameworks:["Kotlin"],slots:{mainLanguage:"Kotlin"},priority:15,intelligence:"low"},"*.swift":{frameworks:["Swift"],slots:{mainLanguage:"Swift"},priority:15,intelligence:"low"},"*.go":{frameworks:["Go"],slots:{mainLanguage:"Go"},priority:15,intelligence:"low"},"*.rs":{frameworks:["Rust"],slots:{mainLanguage:"Rust"},priority:15,intelligence:"low"},"*.dart":{frameworks:["Flutter","Dart"],slots:{mainLanguage:"Dart"},priority:15,intelligence:"low"},"*.ex":{frameworks:["Elixir"],slots:{mainLanguage:"Elixir"},priority:15,intelligence:"low"},"*.exs":{frameworks:["Elixir"],slots:{mainLanguage:"Elixir"},priority:15,intelligence:"low"},"*.scala":{frameworks:["Scala"],slots:{mainLanguage:"Scala"},priority:15,intelligence:"low"},"*.clj":{frameworks:["Clojure"],slots:{mainLanguage:"Clojure"},priority:15,intelligence:"low"},"*.lua":{frameworks:["Lua"],slots:{mainLanguage:"Lua"},priority:15,intelligence:"low"},"*.r":{frameworks:["R"],slots:{mainLanguage:"R"},priority:15,intelligence:"low"},"*.R":{frameworks:["R"],slots:{mainLanguage:"R"},priority:15,intelligence:"low"},"*.jl":{frameworks:["Julia"],slots:{mainLanguage:"Julia"},priority:15,intelligence:"low"},"*.nim":{frameworks:["Nim"],slots:{mainLanguage:"Nim"},priority:15,intelligence:"low"},"*.zig":{frameworks:["Zig"],slots:{mainLanguage:"Zig"},priority:15,intelligence:"low"},"build.zig":{frameworks:["Zig"],slots:{packageManager:"Zig Package Manager",mainLanguage:"Zig",buildTool:"zig build",framework:"Zig",build:"zig build"},priority:35,intelligence:"ultra-high"},"openapi.json":{frameworks:["OpenAPI"],slots:{apiType:"REST API",backend:"API Server"},priority:30,intelligence:"high"},"openapi.yaml":{frameworks:["OpenAPI"],slots:{apiType:"REST API",backend:"API Server"},priority:30,intelligence:"high"},"swagger.json":{frameworks:["Swagger"],slots:{apiType:"REST API",backend:"API Server"},priority:30,intelligence:"high"},"graphql.schema":{frameworks:["GraphQL"],slots:{apiType:"GraphQL",backend:"GraphQL Server"},priority:30,intelligence:"high"},"schema.graphql":{frameworks:["GraphQL"],slots:{apiType:"GraphQL",backend:"GraphQL Server"},priority:30,intelligence:"high"},".graphqlconfig":{frameworks:["GraphQL"],slots:{apiType:"GraphQL"},priority:25,intelligence:"medium"},"redux.config.js":{frameworks:["Redux"],slots:{stateManagement:"Redux"},priority:20,intelligence:"medium"},"mobx.config.js":{frameworks:["MobX"],slots:{stateManagement:"MobX"},priority:20,intelligence:"medium"},"vuex.config.js":{frameworks:["Vuex"],slots:{stateManagement:"Vuex",framework:"Vue"},priority:20,intelligence:"medium"},"pinia.config.js":{frameworks:["Pinia"],slots:{stateManagement:"Pinia",framework:"Vue"},priority:20,intelligence:"medium"},"zustand.config.js":{frameworks:["Zustand"],slots:{stateManagement:"Zustand"},priority:20,intelligence:"medium"},".eslintrc.js":{frameworks:["ESLint"],slots:{},priority:15,intelligence:"low"},".eslintrc.json":{frameworks:["ESLint"],slots:{},priority:15,intelligence:"low"},".prettierrc":{frameworks:["Prettier"],slots:{},priority:15,intelligence:"low"},".prettierrc.json":{frameworks:["Prettier"],slots:{},priority:15,intelligence:"low"},"biome.json":{frameworks:["Biome"],slots:{},priority:15,intelligence:"low"},".editorconfig":{frameworks:["EditorConfig"],slots:{},priority:10,intelligence:"low"},"serverless.yml":{frameworks:["Serverless Framework"],slots:{hosting:"AWS Lambda/Azure/GCP",backend:"Serverless",apiType:"API Gateway"},priority:30,intelligence:"high"},"serverless.yaml":{frameworks:["Serverless Framework"],slots:{hosting:"AWS Lambda/Azure/GCP",backend:"Serverless",apiType:"API Gateway"},priority:30,intelligence:"high"},"sam.yaml":{frameworks:["AWS SAM"],slots:{hosting:"AWS Lambda",backend:"AWS SAM",cicd:"AWS SAM CLI"},priority:30,intelligence:"high"},"template.yaml":{frameworks:["AWS SAM","CloudFormation"],slots:{hosting:"AWS",backend:"AWS SAM/CloudFormation",cicd:"AWS"},priority:25,intelligence:"medium",confirmWith:["samconfig.toml"]},"amplify.yml":{frameworks:["AWS Amplify"],slots:{hosting:"AWS Amplify",backend:"AWS Amplify",cicd:"AWS Amplify"},priority:30,intelligence:"high"},Podfile:{frameworks:["CocoaPods","iOS"],slots:{packageManager:"CocoaPods",mainLanguage:"Swift/Objective-C",framework:"iOS Native"},priority:30,intelligence:"high"},"build.gradle.kts":{frameworks:["Gradle Kotlin DSL","Android","Kotlin"],slots:{packageManager:"Gradle",mainLanguage:"Kotlin",buildTool:"Gradle Kotlin DSL",framework:"Android"},priority:30,intelligence:"high"},"*.ipynb":{frameworks:["Jupyter","Python"],slots:{mainLanguage:"Python",framework:"Jupyter Notebook"},priority:30,intelligence:"high"},MLproject:{frameworks:["MLflow"],slots:{mainLanguage:"Python",framework:"MLflow",backend:"MLflow",cicd:"MLflow"},priority:30,intelligence:"high"},"dvc.yaml":{frameworks:["DVC","Data Version Control"],slots:{mainLanguage:"Python",framework:"DVC",cicd:"DVC Pipelines"},priority:30,intelligence:"high"},"dvc.lock":{frameworks:["DVC"],slots:{framework:"DVC"},priority:20,intelligence:"medium"},"wrangler.toml":{frameworks:["Cloudflare Workers","Cloudflare"],slots:{hosting:"Cloudflare Workers",backend:"Cloudflare Workers",runtime:"V8 Isolates"},priority:30,intelligence:"high"},"deno.json":{frameworks:["Deno"],slots:{runtime:"Deno",mainLanguage:"TypeScript",packageManager:"Deno"},priority:30,intelligence:"high"},"bun.lockb":{frameworks:["Bun"],slots:{runtime:"Bun",packageManager:"Bun",mainLanguage:"TypeScript/JavaScript"},priority:30,intelligence:"high"},"codecov.yml":{frameworks:["Codecov"],slots:{cicd:"Codecov"},priority:25,intelligence:"high"},"dependabot.yml":{frameworks:["Dependabot","GitHub"],slots:{cicd:"Dependabot"},priority:25,intelligence:"high"},"renovate.json":{frameworks:["Renovate"],slots:{cicd:"Renovate"},priority:25,intelligence:"high"},Makefile:{frameworks:["Make","GNU Make"],slots:{buildTool:"Make"},priority:30,intelligence:"high"},"CMakeLists.txt":{frameworks:["CMake","C","C++"],slots:{buildTool:"CMake",mainLanguage:"C/C++"},priority:30,intelligence:"high"},"meson.build":{frameworks:["Meson","C","C++"],slots:{buildTool:"Meson",mainLanguage:"C/C++"},priority:30,intelligence:"high"},"*.c":{frameworks:["C"],slots:{mainLanguage:"C"},priority:30,intelligence:"high"},"*.cpp":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:30,intelligence:"high"},"*.cc":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:30,intelligence:"high"},"*.cxx":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:25,intelligence:"high"},"*.h":{frameworks:["C","C++"],slots:{mainLanguage:"C/C++"},priority:25,intelligence:"high"},"*.hpp":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:25,intelligence:"high"},"*.hxx":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:20,intelligence:"medium"},".env":{frameworks:[],slots:{},priority:20,intelligence:"medium"},".env.example":{frameworks:[],slots:{},priority:25,intelligence:"high"},".env.local":{frameworks:[],slots:{},priority:20,intelligence:"medium"},".env.development":{frameworks:[],slots:{},priority:20,intelligence:"medium"},".env.production":{frameworks:[],slots:{},priority:20,intelligence:"medium"},"skaffold.yaml":{frameworks:["Skaffold","Kubernetes"],slots:{hosting:"Kubernetes",cicd:"Skaffold"},priority:30,intelligence:"high"},"Chart.yaml":{frameworks:["Helm","Kubernetes"],slots:{hosting:"Kubernetes",backend:"Helm"},priority:30,intelligence:"high"},"values.yaml":{frameworks:["Helm","Kubernetes"],slots:{hosting:"Kubernetes"},priority:25,intelligence:"high",confirmWith:["Chart.yaml"]},"pulumi.yaml":{frameworks:["Pulumi"],slots:{hosting:"Cloud",cicd:"Pulumi"},priority:30,intelligence:"high"},"Pulumi.yaml":{frameworks:["Pulumi"],slots:{hosting:"Cloud",cicd:"Pulumi"},priority:30,intelligence:"high"},"terragrunt.hcl":{frameworks:["Terragrunt","Terraform"],slots:{hosting:"Cloud",cicd:"Terragrunt"},priority:30,intelligence:"high"},"ansible.yml":{frameworks:["Ansible"],slots:{cicd:"Ansible"},priority:30,intelligence:"high"},"playbook.yml":{frameworks:["Ansible"],slots:{cicd:"Ansible"},priority:25,intelligence:"high"},"*.cs":{frameworks:["C#",".NET","Unity"],slots:{mainLanguage:"C#"},priority:30,intelligence:"high"},"*.m":{frameworks:["Objective-C","iOS"],slots:{mainLanguage:"Objective-C"},priority:25,intelligence:"high"},".nvmrc":{frameworks:["Node.js","nvm"],slots:{runtime:"Node.js"},priority:25,intelligence:"high"},".tool-versions":{frameworks:["asdf"],slots:{},priority:25,intelligence:"high"},".ruby-version":{frameworks:["Ruby","rbenv"],slots:{mainLanguage:"Ruby",runtime:"Ruby"},priority:25,intelligence:"high"},".python-version":{frameworks:["Python","pyenv"],slots:{mainLanguage:"Python",runtime:"Python"},priority:25,intelligence:"high"},".dockerignore":{frameworks:["Docker"],slots:{},priority:20,intelligence:"medium"},".gitattributes":{frameworks:["Git"],slots:{},priority:15,intelligence:"low"},".npmrc":{frameworks:["npm","Node.js"],slots:{packageManager:"npm"},priority:20,intelligence:"medium"},"sonar-project.properties":{frameworks:["SonarQube","SonarCloud"],slots:{cicd:"SonarQube"},priority:25,intelligence:"high"},"*.fs":{frameworks:["F#",".NET"],slots:{mainLanguage:"F#"},priority:25,intelligence:"high"},"*.mm":{frameworks:["Objective-C++","iOS","macOS"],slots:{mainLanguage:"Objective-C++"},priority:25,intelligence:"high"},"build.zig.zon":{frameworks:["Zig"],slots:{mainLanguage:"Zig",packageManager:"Zig Package Manager",buildTool:"zig build"},priority:35,intelligence:"ultra-high"},"gleam.toml":{frameworks:["Gleam","BEAM","Erlang"],slots:{mainLanguage:"Gleam",runtime:"BEAM",packageManager:"Gleam"},priority:30,intelligence:"high"},"bunfig.toml":{frameworks:["Bun"],slots:{runtime:"Bun",packageManager:"Bun",buildTool:"Bun"},priority:30,intelligence:"high"},"mise.toml":{frameworks:["mise"],slots:{},priority:25,intelligence:"high"},".mise.toml":{frameworks:["mise"],slots:{},priority:25,intelligence:"high"},"manifest.toml":{frameworks:["Flox","Nix"],slots:{},priority:25,intelligence:"high",confirmWith:[".flox"]},justfile:{frameworks:["Just"],slots:{buildTool:"Just"},priority:25,intelligence:"high"},".pre-commit-config.yaml":{frameworks:["pre-commit"],slots:{cicd:"pre-commit"},priority:25,intelligence:"high"},"CLAUDE.md":{frameworks:["Claude Code"],slots:{},priority:30,intelligence:"high",confirmWith:[".claude"]}};var cB=new Set(["node_modules",".git","dist","build","venv",".venv","__pycache__","target","coverage",".next",".svelte-kit","vendor"]),dB=new Set([".py",".ts",".tsx",".js",".jsx",".svelte",".vue",".rb",".go",".rs",".php",".java",".kt",".swift"]),pB={mainLanguage:["project","main_language"],main_language:["project","main_language"],framework:["stack","frontend"],cssFramework:["stack","css_framework"],css:["stack","css_framework"],uiLibrary:["stack","ui_library"],ui_library:["stack","ui_library"],stateManagement:["stack","state_management"],state:["stack","state_management"],backend:["stack","backend"],apiType:["stack","api_type"],api:["stack","api_type"],runtime:["stack","runtime"],database:["stack","database"],db:["stack","database"],connection:["stack","connection"],hosting:["stack","hosting"],buildTool:["stack","build"],build_tool:["stack","build"],build:["stack","build"],packageManager:["stack","package_manager"],pkg_manager:["stack","package_manager"],cicd:["stack","cicd"]},lB=[["packageManager","package-manager"],["pkg_manager","package-manager"],["mainLanguage","language"],["main_language","language"],["framework","framework"],["backend","backend"],["database","database"],["db","database"],["cicd","ci-cd"],["hosting","hosting"],["buildTool","build"],["build_tool","build"],["build","build"],["runtime","runtime"],["cssFramework","css"],["css","css"],["uiLibrary","ui-library"],["stateManagement","state-management"],["apiType","api"],["api","api"]];function iB($,Z){for(let[X,z]of lB)if(X in $)return z;return Z.length>0?"framework":"config"}function nB($){try{let Z=JSON.parse(hB($,"utf-8")),X=["background","content_scripts","action","browser_action","permissions"].some((z)=>(z in Z));if(typeof Z.manifest_version==="number"&&X)return"chrome";return"other"}catch{return"other"}}function rB($){let Z=[],X=mB($),z=gB(Q3($,".git"));for(let J=0;J<10;J++){let Q;try{Q=S7(X)}catch{break}for(let U of Q){let G=J3[U];if(!G)continue;if(U==="manifest.json"&&nB(Q3(X,U))!=="chrome")continue;if(U==="pubspec.yaml"){let W=u2(X);if(W){let q={mainLanguage:"Dart",packageManager:"pub"};if(W.isFlutter){if(q.framework="Flutter",W.stateManagement)q.stateManagement=W.stateManagement}else if(W.appType==="backend"&&W.framework)q.backend=W.framework;else if(W.appType==="mcp")q.apiType="MCP";Z.push({slots:q,priority:G.priority,frameworks:W.isFlutter?["Flutter","Dart"]:["Dart"],fileName:U});continue}}Z.push({slots:G.slots||{},priority:G.priority,frameworks:G.frameworks,fileName:U})}if(z&&J===0)break;let Y=vB(X);if(Y===X)break;X=Y}return Z}function sB($){let Z=[];for(let X of b7($,2,{count:0})){let z=J3[`*${X}`],J=z?.slots?.mainLanguage;if(J)Z.push({slots:{mainLanguage:J},priority:z.priority,frameworks:z.frameworks})}return Z}function aB($){let Z=[...rB($),...sB($)],X={},z={},J=new Set;for(let W of Z){W.frameworks.forEach((q)=>J.add(q));for(let[q,V]of Object.entries(W.slots))if(V&&!V.includes("/")&&(!(q in X)||W.priority>z[q]))X[q]=V,z[q]=W.priority}let Q=new Map;for(let W of Z){if(!W.fileName)continue;if(!Q.has(W.fileName))Q.set(W.fileName,{fileName:W.fileName,category:iB(W.slots,W.frameworks),priority:W.priority})}let Y=[...Q.values()].sort((W,q)=>q.priority-W.priority||W.fileName.localeCompare(q.fileName)),U=[];if(X.mainLanguage)U.push(X.mainLanguage.toLowerCase());if(X.framework)U.push(X.framework.toLowerCase());let G=U.length>0?U.join("-"):"unknown-stack";return{slotFills:X,frameworks:[...J],confirmedCount:Z.length,discoveredFormats:Y,stackSignature:G}}function d2($){let{slotFills:Z}=aB($),X={};for(let[z,J]of Object.entries(Z)){let Q=pB[z];if(!Q||!J)continue;let[Y,U]=Q;if(Y==="project")(X.project??={})[U]=J;else(X.stack??={})[U]=J}return X}function b7($,Z,X){let z=new Set;if(Z<0||X.count>400)return z;let J;try{J=S7($,{withFileTypes:!0})}catch{return z}for(let Q of J){if(X.count++>400)break;if(!Q.isDirectory()){let Y=uB(Q.name);if(dB.has(Y))z.add(Y);continue}if(cB.has(Q.name)||Q.name.startsWith("."))continue;for(let Y of b7(Q3($,Q.name),Z-1,X))z.add(Y)}return z}import{existsSync as x7,readFileSync as k7}from"fs";import{join as y7}from"path";var B0=($,Z,X)=>({value:$,source:Z,confidence:X});function oB($){let Z=tB($),X=eB($),z={},J=(Q,Y)=>{if(Y)z[Q]=Y};return J("what",$L(Z,X)),J("who",ZL(X)),J("why",XL(X)),J("where",zL(Z,X)),J("when",JL(X)),J("how",QL(Z,X)),z}function p2($){let Z=oB($),X={};return Object.keys(Z).forEach((z)=>{let J=Z[z];if(J)X[z]=J.value}),X}function tB($){let Z=y7($,"package.json");if(!x7(Z))return null;try{return JSON.parse(k7(Z,"utf-8"))}catch{return null}}function eB($){let Z=y7($,"README.md");if(!x7(Z))return"";let X;try{X=k7(Z,"utf-8")}catch{return""}return X.split(`
213
+ `)}function bB($){let X=SB($).split(`
214
+ `),z=[];for(let J of X){let Q=J.trim();if(Q===""){if(z.length>0)break;continue}if(/^(#|>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(Q))break;if(/^\*\*[^*]+\*\*\s*$/.test(Q)&&z.length===0)continue;z.push(Q)}if(z.length===0)return null;return z.join(" ").trim()}function _$($,Z){let X=$.split(`
215
+ `),z=0;while(z<X.length){let Q=X[z].trim().match(/^(#{1,6})\s+(.+)$/);if(Q&&Z.test(Q[2])){let Y=Q[1].length,U=[];z++;while(z<X.length){let G=X[z].trim(),W=G.match(/^(#{1,6})\s+/);if(W&&W[1].length<=Y)break;if(G===""){if(U.length>0)break;z++;continue}if(/^(>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(G))break;U.push(G),z++}if(U.length===0)return null;return U.join(" ").trim()}z++}return null}function xB($){let Z=_$($,/^(use\s+cases?|goal)\b/i);if(Z&&k0(Z))return Z;let X=bB($);if(X&&k0(X))return X;return}function kB($){let Z=_$($,/^(about|description|overview|what(\s+is\s+this)?)\b/i);if(Z&&k0(Z))return Z;return}function yB($){let Z=_$($,/^(audience|users?|for\s+whom|who(\s+is\s+this\s+for)?)\b/i);if(Z&&k0(Z))return Z;return}function fB($){let Z=_$($,/^(why|motivation|problem|rationale)\b/i);if(Z&&k0(Z))return Z;return}function gB($){let Z=_$($,/^(deployment|where(\s+it\s+runs)?|hosting)\b/i);if(Z&&k0(Z))return Z;return}function vB($){let Z=_$($,/^(status|history|timeline|since|launched)\b/i);if(Z&&k0(Z))return Z;return}function hB($){let Z=_$($,/^(architecture|how(\s+it\s+works)?|approach|design)\b/i);if(Z&&k0(Z))return Z;return}function Y3($){let Z=["README.md","README.MD","Readme.md","readme.md"],X=null;for(let B of Z){let T=jB($,B);if(CB(T)){X=T;break}}if(!X)return{};let z;try{z=EB(X,"utf-8")}catch{return{}}let J={},Q=xB(z);if(Q)J.project={goal:Q};let Y={},U=kB(z);if(U)Y.what=U;let G=yB(z);if(G)Y.who=G;let W=fB(z);if(W)Y.why=W;let q=gB(z);if(q)Y.where=q;let V=vB(z);if(V)Y.when=V;let K=hB(z);if(K)Y.how=K;if(Object.keys(Y).length>0)J.human_context=Y;return J}import{existsSync as uB,readFileSync as mB}from"fs";import{join as cB}from"path";function dB($,Z){let X=$.split(`
216
+ `),z=!1;for(let J of X){let Q=J.trim();if(/^\[/.test(Q)){z=Q==="[package]";continue}if(!z)continue;let Y=Q.match(new RegExp(`^${Z}\\s*=\\s*(.+)$`));if(Y){let U=Y[1].trim();U=U.replace(/\s*#.*$/,"").trim();let G=U.match(/^"((?:[^"\\]|\\.)*)"$/)||U.match(/^'((?:[^'\\]|\\.)*)'$/);if(G)return G[1];return U}}return null}function U3($){let Z=cB($,"Cargo.toml");if(!uB(Z))return{};let X;try{X=mB(Z,"utf-8")}catch{return{}}let z=dB(X,"description");if(z&&k0(z))return{project:{goal:z}};return{}}function pB($,Z){let X={project:{...Z.project??{},...$.project??{}},human_context:{...Z.human_context??{},...$.human_context??{}}};if(X.project&&Object.keys(X.project).length===0)delete X.project;if(X.human_context&&Object.keys(X.human_context).length===0)delete X.human_context;return X}function i2($){return pB(Y3($),U3($))}import{existsSync as lB,readdirSync as y7,readFileSync as iB}from"fs";import{join as W3,dirname as nB,extname as rB,resolve as sB}from"path";var G3={"package.json":{frameworks:["Node.js","JavaScript","TypeScript"],slots:{packageManager:"npm/yarn/pnpm",mainLanguage:"JavaScript/TypeScript"},priority:35,intelligence:"ultra-high"},"README.md":{frameworks:[],slots:{targetUser:"developers",coreProblem:"understanding project",missionPurpose:"project documentation"},priority:25,intelligence:"high"},"requirements.txt":{frameworks:["Python"],slots:{packageManager:"pip",mainLanguage:"Python"},priority:35,intelligence:"ultra-high"},Pipfile:{frameworks:["Python"],slots:{packageManager:"pipenv",mainLanguage:"Python"},priority:35,intelligence:"ultra-high"},"pyproject.toml":{frameworks:["Python"],slots:{mainLanguage:"Python",runtime:"Python",backend:"Python"},priority:36,intelligence:"ultra-high"},Gemfile:{frameworks:["Ruby","Rails"],slots:{packageManager:"bundler",mainLanguage:"Ruby"},priority:35,intelligence:"ultra-high"},"composer.json":{frameworks:["PHP","Laravel","Symfony"],slots:{packageManager:"composer",mainLanguage:"PHP"},priority:35,intelligence:"ultra-high"},"Cargo.toml":{frameworks:["Rust"],slots:{packageManager:"cargo",mainLanguage:"Rust",buildTool:"cargo"},priority:36,intelligence:"ultra-high"},"go.mod":{frameworks:["Go"],slots:{packageManager:"go modules",mainLanguage:"Go",buildTool:"go build"},priority:36,intelligence:"ultra-high"},"pubspec.yaml":{frameworks:["Dart"],slots:{packageManager:"pub",mainLanguage:"Dart"},priority:35,intelligence:"ultra-high"},"pom.xml":{frameworks:["Java","Spring","Maven"],slots:{packageManager:"maven",mainLanguage:"Java",buildTool:"maven"},priority:35,intelligence:"ultra-high"},"build.gradle":{frameworks:["Java","Kotlin","Spring","Gradle"],slots:{packageManager:"gradle",mainLanguage:"Java/Kotlin",buildTool:"gradle"},priority:35,intelligence:"ultra-high"},"next.config.js":{frameworks:["Next.js"],slots:{framework:"Next.js",runtime:"Node.js",buildTool:"Next.js",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"next.config.mjs":{frameworks:["Next.js"],slots:{framework:"Next.js",runtime:"Node.js",buildTool:"Next.js",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"next.config.ts":{frameworks:["Next.js 13+"],slots:{framework:"Next.js 13+",runtime:"Node.js",buildTool:"Next.js",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"nuxt.config.js":{frameworks:["Nuxt 2"],slots:{framework:"Nuxt 2",runtime:"Node.js",buildTool:"Nuxt",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"nuxt.config.ts":{frameworks:["Nuxt 3"],slots:{framework:"Nuxt 3",runtime:"Node.js",buildTool:"Nuxt",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"svelte.config.js":{frameworks:["SvelteKit"],slots:{framework:"SvelteKit",buildTool:"Vite",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"angular.json":{frameworks:["Angular"],slots:{framework:"Angular",buildTool:"Angular CLI",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"manifest.json":{frameworks:["Chrome Extension","Browser Extension"],slots:{framework:"Chrome Extension",runtime:"Chrome/Browser",mainLanguage:"JavaScript",hosting:"Chrome Web Store",apiType:"Chrome APIs"},priority:35,intelligence:"ultra-high",confirmWith:["popup.html","background.js","content.js"]},"vue.config.js":{frameworks:["Vue"],slots:{framework:"Vue",buildTool:"Vue CLI",mainLanguage:"JavaScript"},priority:30,intelligence:"high"},"remix.config.js":{frameworks:["Remix"],slots:{framework:"Remix",runtime:"Node.js",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"gatsby-config.js":{frameworks:["Gatsby"],slots:{framework:"Gatsby",buildTool:"Gatsby",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"gatsby-config.ts":{frameworks:["Gatsby"],slots:{framework:"Gatsby",buildTool:"Gatsby",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"astro.config.mjs":{frameworks:["Astro"],slots:{framework:"Astro",buildTool:"Vite",mainLanguage:"JavaScript",server:"Node.js"},priority:30,intelligence:"high"},"redwood.toml":{frameworks:["RedwoodJS"],slots:{framework:"RedwoodJS",buildTool:"Webpack",mainLanguage:"JavaScript/TypeScript",server:"Node.js",database:"Prisma"},priority:30,intelligence:"high"},"blitz.config.ts":{frameworks:["Blitz.js"],slots:{framework:"Blitz.js",buildTool:"Next.js",mainLanguage:"TypeScript",server:"Node.js",database:"Prisma"},priority:30,intelligence:"high"},"qwik.config.ts":{frameworks:["Qwik"],slots:{framework:"Qwik",buildTool:"Vite",mainLanguage:"TypeScript",server:"Node.js"},priority:30,intelligence:"high"},"manage.py":{frameworks:["Django"],slots:{framework:"Django",backend:"Django",mainLanguage:"Python",server:"Django",apiType:"Django Views"},priority:30,intelligence:"high"},artisan:{frameworks:["Laravel"],slots:{framework:"Laravel",backend:"Laravel",mainLanguage:"PHP",server:"PHP",apiType:"Laravel Routes"},priority:30,intelligence:"high"},"mix.exs":{frameworks:["Phoenix","Elixir"],slots:{framework:"Phoenix",backend:"Phoenix",mainLanguage:"Elixir",server:"BEAM"},priority:30,intelligence:"high"},"nest-cli.json":{frameworks:["NestJS"],slots:{framework:"NestJS",backend:"NestJS",mainLanguage:"TypeScript",server:"Node.js",apiType:"REST API"},priority:30,intelligence:"high"},"strapi.config.js":{frameworks:["Strapi"],slots:{backend:"Strapi",apiType:"REST API",database:"Required",server:"Node.js"},priority:30,intelligence:"high"},Dockerfile:{frameworks:["Docker"],slots:{hosting:"Docker",connection:"Containerized"},priority:30,intelligence:"high"},"docker-compose.yml":{frameworks:["Docker Compose"],slots:{hosting:"Docker",connection:"Multi-container"},priority:30,intelligence:"high"},"docker-compose.yaml":{frameworks:["Docker Compose"],slots:{hosting:"Docker",connection:"Multi-container"},priority:30,intelligence:"high"},"kubernetes.yml":{frameworks:["Kubernetes"],slots:{hosting:"Kubernetes",connection:"Orchestrated"},priority:30,intelligence:"high"},"k8s.yaml":{frameworks:["Kubernetes"],slots:{hosting:"Kubernetes",connection:"Orchestrated"},priority:30,intelligence:"high"},"vercel.json":{frameworks:["Vercel"],slots:{hosting:"Vercel",cicd:"Vercel"},priority:30,intelligence:"high"},"netlify.toml":{frameworks:["Netlify"],slots:{hosting:"Netlify",cicd:"Netlify"},priority:30,intelligence:"high"},"render.yaml":{frameworks:["Render"],slots:{hosting:"Render",cicd:"Render"},priority:30,intelligence:"high"},"fly.toml":{frameworks:["Fly.io"],slots:{hosting:"Fly.io",cicd:"Fly.io"},priority:30,intelligence:"high"},"railway.json":{frameworks:["Railway"],slots:{hosting:"Railway",cicd:"Railway"},priority:30,intelligence:"high"},"railway.toml":{frameworks:["Railway"],slots:{hosting:"Railway",cicd:"Railway"},priority:30,intelligence:"high"},"app.yaml":{frameworks:["Google App Engine"],slots:{hosting:"Google Cloud",cicd:"Google Cloud"},priority:30,intelligence:"high"},Procfile:{frameworks:["Heroku"],slots:{hosting:"Heroku",cicd:"Heroku"},priority:30,intelligence:"high"},"vite.config.js":{frameworks:["Vite"],slots:{buildTool:"Vite"},priority:25,intelligence:"medium"},"vite.config.ts":{frameworks:["Vite"],slots:{buildTool:"Vite",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"webpack.config.js":{frameworks:["Webpack"],slots:{buildTool:"Webpack"},priority:25,intelligence:"medium"},"rollup.config.js":{frameworks:["Rollup"],slots:{buildTool:"Rollup"},priority:25,intelligence:"medium"},"esbuild.config.js":{frameworks:["esbuild"],slots:{buildTool:"esbuild"},priority:25,intelligence:"medium"},"parcel.config.js":{frameworks:["Parcel"],slots:{buildTool:"Parcel"},priority:25,intelligence:"medium"},"snowpack.config.js":{frameworks:["Snowpack"],slots:{buildTool:"Snowpack"},priority:25,intelligence:"medium"},"tsconfig.json":{frameworks:["TypeScript"],slots:{mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"jsconfig.json":{frameworks:["JavaScript"],slots:{mainLanguage:"JavaScript"},priority:20,intelligence:"medium"},"babel.config.js":{frameworks:["Babel"],slots:{buildTool:"Babel"},priority:20,intelligence:"medium"},".babelrc":{frameworks:["Babel"],slots:{buildTool:"Babel"},priority:20,intelligence:"medium"},"jest.config.js":{frameworks:["Jest"],slots:{cicd:"Jest"},priority:25,intelligence:"medium"},"jest.config.ts":{frameworks:["Jest"],slots:{cicd:"Jest",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"vitest.config.ts":{frameworks:["Vitest"],slots:{cicd:"Vitest",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"cypress.config.js":{frameworks:["Cypress"],slots:{cicd:"Cypress"},priority:25,intelligence:"medium"},"playwright.config.ts":{frameworks:["Playwright"],slots:{cicd:"Playwright",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"karma.conf.js":{frameworks:["Karma"],slots:{cicd:"Karma"},priority:20,intelligence:"medium"},"mocha.opts":{frameworks:["Mocha"],slots:{cicd:"Mocha"},priority:20,intelligence:"medium"},".rspec":{frameworks:["RSpec"],slots:{cicd:"RSpec",mainLanguage:"Ruby"},priority:25,intelligence:"medium"},"pytest.ini":{frameworks:["Pytest"],slots:{cicd:"Pytest",mainLanguage:"Python"},priority:25,intelligence:"medium"},"phpunit.xml":{frameworks:["PHPUnit"],slots:{cicd:"PHPUnit",mainLanguage:"PHP"},priority:25,intelligence:"medium"},"schema.prisma":{frameworks:["Prisma"],slots:{database:"Prisma ORM",connection:"Prisma"},priority:25,intelligence:"medium"},"drizzle.config.ts":{frameworks:["Drizzle"],slots:{database:"Drizzle ORM",connection:"Drizzle",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"ormconfig.js":{frameworks:["TypeORM"],slots:{database:"TypeORM",connection:"TypeORM"},priority:25,intelligence:"medium"},"knexfile.js":{frameworks:["Knex.js"],slots:{database:"Knex.js",connection:"Knex.js"},priority:25,intelligence:"medium"},"sequelize.config.js":{frameworks:["Sequelize"],slots:{database:"Sequelize",connection:"Sequelize"},priority:25,intelligence:"medium"},"alembic.ini":{frameworks:["Alembic"],slots:{database:"Alembic",mainLanguage:"Python"},priority:25,intelligence:"medium"},".github/workflows":{frameworks:["GitHub Actions"],slots:{cicd:"GitHub Actions"},priority:25,intelligence:"medium"},".gitlab-ci.yml":{frameworks:["GitLab CI"],slots:{cicd:"GitLab CI"},priority:25,intelligence:"medium"},Jenkinsfile:{frameworks:["Jenkins"],slots:{cicd:"Jenkins"},priority:25,intelligence:"medium"},".circleci/config.yml":{frameworks:["CircleCI"],slots:{cicd:"CircleCI"},priority:25,intelligence:"medium"},".travis.yml":{frameworks:["Travis CI"],slots:{cicd:"Travis CI"},priority:25,intelligence:"medium"},"azure-pipelines.yml":{frameworks:["Azure DevOps"],slots:{cicd:"Azure DevOps"},priority:25,intelligence:"medium"},"bitbucket-pipelines.yml":{frameworks:["Bitbucket Pipelines"],slots:{cicd:"Bitbucket Pipelines"},priority:25,intelligence:"medium"},"tailwind.config.js":{frameworks:["Tailwind CSS"],slots:{cssFramework:"Tailwind CSS"},priority:20,intelligence:"medium"},"tailwind.config.ts":{frameworks:["Tailwind CSS"],slots:{cssFramework:"Tailwind CSS",mainLanguage:"TypeScript"},priority:20,intelligence:"medium"},"postcss.config.js":{frameworks:["PostCSS"],slots:{cssFramework:"PostCSS"},priority:20,intelligence:"medium"},"uno.config.ts":{frameworks:["UnoCSS"],slots:{cssFramework:"UnoCSS",mainLanguage:"TypeScript"},priority:20,intelligence:"medium"},"styled-components.config.js":{frameworks:["styled-components"],slots:{cssFramework:"styled-components",uiLibrary:"styled-components"},priority:20,intelligence:"medium"},"emotion.config.js":{frameworks:["Emotion"],slots:{cssFramework:"Emotion",uiLibrary:"Emotion"},priority:20,intelligence:"medium"},"metro.config.js":{frameworks:["React Native"],slots:{framework:"React Native",mainLanguage:"JavaScript"},priority:25,intelligence:"medium"},"expo.config.js":{frameworks:["Expo"],slots:{framework:"React Native",buildTool:"Expo"},priority:25,intelligence:"medium"},"app.json":{frameworks:["React Native","Expo"],slots:{framework:"React Native"},priority:20,intelligence:"medium",confirmWith:["expo"]},"capacitor.config.ts":{frameworks:["Capacitor"],slots:{framework:"Capacitor",mainLanguage:"TypeScript"},priority:25,intelligence:"medium"},"ionic.config.json":{frameworks:["Ionic"],slots:{framework:"Ionic",uiLibrary:"Ionic"},priority:25,intelligence:"medium"},"nx.json":{frameworks:["Nx"],slots:{buildTool:"Nx"},priority:25,intelligence:"medium"},"turbo.json":{frameworks:["Turborepo"],slots:{buildTool:"Turborepo"},priority:25,intelligence:"medium"},"lerna.json":{frameworks:["Lerna"],slots:{buildTool:"Lerna"},priority:25,intelligence:"medium"},"rush.json":{frameworks:["Rush"],slots:{buildTool:"Rush"},priority:25,intelligence:"medium"},"pnpm-workspace.yaml":{frameworks:["pnpm workspaces"],slots:{packageManager:"pnpm",buildTool:"pnpm workspaces"},priority:25,intelligence:"medium"},"*.svelte":{frameworks:["Svelte","SvelteKit"],slots:{framework:"Svelte"},priority:15,intelligence:"low"},"*.vue":{frameworks:["Vue"],slots:{framework:"Vue"},priority:15,intelligence:"low"},"*.jsx":{frameworks:["React"],slots:{framework:"React",mainLanguage:"JavaScript"},priority:15,intelligence:"low"},"*.ts":{frameworks:["TypeScript"],slots:{mainLanguage:"TypeScript"},priority:15,intelligence:"low"},"*.tsx":{frameworks:["React","TypeScript"],slots:{framework:"React",mainLanguage:"TypeScript"},priority:15,intelligence:"low"},"*.py":{frameworks:["Python"],slots:{mainLanguage:"Python"},priority:15,intelligence:"low"},"*.rb":{frameworks:["Ruby"],slots:{mainLanguage:"Ruby"},priority:15,intelligence:"low"},"*.php":{frameworks:["PHP"],slots:{mainLanguage:"PHP"},priority:15,intelligence:"low"},"*.java":{frameworks:["Java"],slots:{mainLanguage:"Java"},priority:15,intelligence:"low"},"*.kt":{frameworks:["Kotlin"],slots:{mainLanguage:"Kotlin"},priority:15,intelligence:"low"},"*.swift":{frameworks:["Swift"],slots:{mainLanguage:"Swift"},priority:15,intelligence:"low"},"*.go":{frameworks:["Go"],slots:{mainLanguage:"Go"},priority:15,intelligence:"low"},"*.rs":{frameworks:["Rust"],slots:{mainLanguage:"Rust"},priority:15,intelligence:"low"},"*.dart":{frameworks:["Flutter","Dart"],slots:{mainLanguage:"Dart"},priority:15,intelligence:"low"},"*.ex":{frameworks:["Elixir"],slots:{mainLanguage:"Elixir"},priority:15,intelligence:"low"},"*.exs":{frameworks:["Elixir"],slots:{mainLanguage:"Elixir"},priority:15,intelligence:"low"},"*.scala":{frameworks:["Scala"],slots:{mainLanguage:"Scala"},priority:15,intelligence:"low"},"*.clj":{frameworks:["Clojure"],slots:{mainLanguage:"Clojure"},priority:15,intelligence:"low"},"*.lua":{frameworks:["Lua"],slots:{mainLanguage:"Lua"},priority:15,intelligence:"low"},"*.r":{frameworks:["R"],slots:{mainLanguage:"R"},priority:15,intelligence:"low"},"*.R":{frameworks:["R"],slots:{mainLanguage:"R"},priority:15,intelligence:"low"},"*.jl":{frameworks:["Julia"],slots:{mainLanguage:"Julia"},priority:15,intelligence:"low"},"*.nim":{frameworks:["Nim"],slots:{mainLanguage:"Nim"},priority:15,intelligence:"low"},"*.zig":{frameworks:["Zig"],slots:{mainLanguage:"Zig"},priority:15,intelligence:"low"},"build.zig":{frameworks:["Zig"],slots:{packageManager:"Zig Package Manager",mainLanguage:"Zig",buildTool:"zig build",framework:"Zig",build:"zig build"},priority:35,intelligence:"ultra-high"},"openapi.json":{frameworks:["OpenAPI"],slots:{apiType:"REST API",backend:"API Server"},priority:30,intelligence:"high"},"openapi.yaml":{frameworks:["OpenAPI"],slots:{apiType:"REST API",backend:"API Server"},priority:30,intelligence:"high"},"swagger.json":{frameworks:["Swagger"],slots:{apiType:"REST API",backend:"API Server"},priority:30,intelligence:"high"},"graphql.schema":{frameworks:["GraphQL"],slots:{apiType:"GraphQL",backend:"GraphQL Server"},priority:30,intelligence:"high"},"schema.graphql":{frameworks:["GraphQL"],slots:{apiType:"GraphQL",backend:"GraphQL Server"},priority:30,intelligence:"high"},".graphqlconfig":{frameworks:["GraphQL"],slots:{apiType:"GraphQL"},priority:25,intelligence:"medium"},"redux.config.js":{frameworks:["Redux"],slots:{stateManagement:"Redux"},priority:20,intelligence:"medium"},"mobx.config.js":{frameworks:["MobX"],slots:{stateManagement:"MobX"},priority:20,intelligence:"medium"},"vuex.config.js":{frameworks:["Vuex"],slots:{stateManagement:"Vuex",framework:"Vue"},priority:20,intelligence:"medium"},"pinia.config.js":{frameworks:["Pinia"],slots:{stateManagement:"Pinia",framework:"Vue"},priority:20,intelligence:"medium"},"zustand.config.js":{frameworks:["Zustand"],slots:{stateManagement:"Zustand"},priority:20,intelligence:"medium"},".eslintrc.js":{frameworks:["ESLint"],slots:{},priority:15,intelligence:"low"},".eslintrc.json":{frameworks:["ESLint"],slots:{},priority:15,intelligence:"low"},".prettierrc":{frameworks:["Prettier"],slots:{},priority:15,intelligence:"low"},".prettierrc.json":{frameworks:["Prettier"],slots:{},priority:15,intelligence:"low"},"biome.json":{frameworks:["Biome"],slots:{},priority:15,intelligence:"low"},".editorconfig":{frameworks:["EditorConfig"],slots:{},priority:10,intelligence:"low"},"serverless.yml":{frameworks:["Serverless Framework"],slots:{hosting:"AWS Lambda/Azure/GCP",backend:"Serverless",apiType:"API Gateway"},priority:30,intelligence:"high"},"serverless.yaml":{frameworks:["Serverless Framework"],slots:{hosting:"AWS Lambda/Azure/GCP",backend:"Serverless",apiType:"API Gateway"},priority:30,intelligence:"high"},"sam.yaml":{frameworks:["AWS SAM"],slots:{hosting:"AWS Lambda",backend:"AWS SAM",cicd:"AWS SAM CLI"},priority:30,intelligence:"high"},"template.yaml":{frameworks:["AWS SAM","CloudFormation"],slots:{hosting:"AWS",backend:"AWS SAM/CloudFormation",cicd:"AWS"},priority:25,intelligence:"medium",confirmWith:["samconfig.toml"]},"amplify.yml":{frameworks:["AWS Amplify"],slots:{hosting:"AWS Amplify",backend:"AWS Amplify",cicd:"AWS Amplify"},priority:30,intelligence:"high"},Podfile:{frameworks:["CocoaPods","iOS"],slots:{packageManager:"CocoaPods",mainLanguage:"Swift/Objective-C",framework:"iOS Native"},priority:30,intelligence:"high"},"build.gradle.kts":{frameworks:["Gradle Kotlin DSL","Android","Kotlin"],slots:{packageManager:"Gradle",mainLanguage:"Kotlin",buildTool:"Gradle Kotlin DSL",framework:"Android"},priority:30,intelligence:"high"},"*.ipynb":{frameworks:["Jupyter","Python"],slots:{mainLanguage:"Python",framework:"Jupyter Notebook"},priority:30,intelligence:"high"},MLproject:{frameworks:["MLflow"],slots:{mainLanguage:"Python",framework:"MLflow",backend:"MLflow",cicd:"MLflow"},priority:30,intelligence:"high"},"dvc.yaml":{frameworks:["DVC","Data Version Control"],slots:{mainLanguage:"Python",framework:"DVC",cicd:"DVC Pipelines"},priority:30,intelligence:"high"},"dvc.lock":{frameworks:["DVC"],slots:{framework:"DVC"},priority:20,intelligence:"medium"},"wrangler.toml":{frameworks:["Cloudflare Workers","Cloudflare"],slots:{hosting:"Cloudflare Workers",backend:"Cloudflare Workers",runtime:"V8 Isolates"},priority:30,intelligence:"high"},"deno.json":{frameworks:["Deno"],slots:{runtime:"Deno",mainLanguage:"TypeScript",packageManager:"Deno"},priority:30,intelligence:"high"},"bun.lockb":{frameworks:["Bun"],slots:{runtime:"Bun",packageManager:"Bun",mainLanguage:"TypeScript/JavaScript"},priority:30,intelligence:"high"},"codecov.yml":{frameworks:["Codecov"],slots:{cicd:"Codecov"},priority:25,intelligence:"high"},"dependabot.yml":{frameworks:["Dependabot","GitHub"],slots:{cicd:"Dependabot"},priority:25,intelligence:"high"},"renovate.json":{frameworks:["Renovate"],slots:{cicd:"Renovate"},priority:25,intelligence:"high"},Makefile:{frameworks:["Make","GNU Make"],slots:{buildTool:"Make"},priority:30,intelligence:"high"},"CMakeLists.txt":{frameworks:["CMake","C","C++"],slots:{buildTool:"CMake",mainLanguage:"C/C++"},priority:30,intelligence:"high"},"meson.build":{frameworks:["Meson","C","C++"],slots:{buildTool:"Meson",mainLanguage:"C/C++"},priority:30,intelligence:"high"},"*.c":{frameworks:["C"],slots:{mainLanguage:"C"},priority:30,intelligence:"high"},"*.cpp":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:30,intelligence:"high"},"*.cc":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:30,intelligence:"high"},"*.cxx":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:25,intelligence:"high"},"*.h":{frameworks:["C","C++"],slots:{mainLanguage:"C/C++"},priority:25,intelligence:"high"},"*.hpp":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:25,intelligence:"high"},"*.hxx":{frameworks:["C++"],slots:{mainLanguage:"C++"},priority:20,intelligence:"medium"},".env":{frameworks:[],slots:{},priority:20,intelligence:"medium"},".env.example":{frameworks:[],slots:{},priority:25,intelligence:"high"},".env.local":{frameworks:[],slots:{},priority:20,intelligence:"medium"},".env.development":{frameworks:[],slots:{},priority:20,intelligence:"medium"},".env.production":{frameworks:[],slots:{},priority:20,intelligence:"medium"},"skaffold.yaml":{frameworks:["Skaffold","Kubernetes"],slots:{hosting:"Kubernetes",cicd:"Skaffold"},priority:30,intelligence:"high"},"Chart.yaml":{frameworks:["Helm","Kubernetes"],slots:{hosting:"Kubernetes",backend:"Helm"},priority:30,intelligence:"high"},"values.yaml":{frameworks:["Helm","Kubernetes"],slots:{hosting:"Kubernetes"},priority:25,intelligence:"high",confirmWith:["Chart.yaml"]},"pulumi.yaml":{frameworks:["Pulumi"],slots:{hosting:"Cloud",cicd:"Pulumi"},priority:30,intelligence:"high"},"Pulumi.yaml":{frameworks:["Pulumi"],slots:{hosting:"Cloud",cicd:"Pulumi"},priority:30,intelligence:"high"},"terragrunt.hcl":{frameworks:["Terragrunt","Terraform"],slots:{hosting:"Cloud",cicd:"Terragrunt"},priority:30,intelligence:"high"},"ansible.yml":{frameworks:["Ansible"],slots:{cicd:"Ansible"},priority:30,intelligence:"high"},"playbook.yml":{frameworks:["Ansible"],slots:{cicd:"Ansible"},priority:25,intelligence:"high"},"*.cs":{frameworks:["C#",".NET","Unity"],slots:{mainLanguage:"C#"},priority:30,intelligence:"high"},"*.m":{frameworks:["Objective-C","iOS"],slots:{mainLanguage:"Objective-C"},priority:25,intelligence:"high"},".nvmrc":{frameworks:["Node.js","nvm"],slots:{runtime:"Node.js"},priority:25,intelligence:"high"},".tool-versions":{frameworks:["asdf"],slots:{},priority:25,intelligence:"high"},".ruby-version":{frameworks:["Ruby","rbenv"],slots:{mainLanguage:"Ruby",runtime:"Ruby"},priority:25,intelligence:"high"},".python-version":{frameworks:["Python","pyenv"],slots:{mainLanguage:"Python",runtime:"Python"},priority:25,intelligence:"high"},".dockerignore":{frameworks:["Docker"],slots:{},priority:20,intelligence:"medium"},".gitattributes":{frameworks:["Git"],slots:{},priority:15,intelligence:"low"},".npmrc":{frameworks:["npm","Node.js"],slots:{packageManager:"npm"},priority:20,intelligence:"medium"},"sonar-project.properties":{frameworks:["SonarQube","SonarCloud"],slots:{cicd:"SonarQube"},priority:25,intelligence:"high"},"*.fs":{frameworks:["F#",".NET"],slots:{mainLanguage:"F#"},priority:25,intelligence:"high"},"*.mm":{frameworks:["Objective-C++","iOS","macOS"],slots:{mainLanguage:"Objective-C++"},priority:25,intelligence:"high"},"build.zig.zon":{frameworks:["Zig"],slots:{mainLanguage:"Zig",packageManager:"Zig Package Manager",buildTool:"zig build"},priority:35,intelligence:"ultra-high"},"gleam.toml":{frameworks:["Gleam","BEAM","Erlang"],slots:{mainLanguage:"Gleam",runtime:"BEAM",packageManager:"Gleam"},priority:30,intelligence:"high"},"bunfig.toml":{frameworks:["Bun"],slots:{runtime:"Bun",packageManager:"Bun",buildTool:"Bun"},priority:30,intelligence:"high"},"mise.toml":{frameworks:["mise"],slots:{},priority:25,intelligence:"high"},".mise.toml":{frameworks:["mise"],slots:{},priority:25,intelligence:"high"},"manifest.toml":{frameworks:["Flox","Nix"],slots:{},priority:25,intelligence:"high",confirmWith:[".flox"]},justfile:{frameworks:["Just"],slots:{buildTool:"Just"},priority:25,intelligence:"high"},".pre-commit-config.yaml":{frameworks:["pre-commit"],slots:{cicd:"pre-commit"},priority:25,intelligence:"high"},"CLAUDE.md":{frameworks:["Claude Code"],slots:{},priority:30,intelligence:"high",confirmWith:[".claude"]}};var aB=new Set(["node_modules",".git","dist","build","venv",".venv","__pycache__","target","coverage",".next",".svelte-kit","vendor"]),oB=new Set([".py",".ts",".tsx",".js",".jsx",".svelte",".vue",".rb",".go",".rs",".php",".java",".kt",".swift"]),tB={mainLanguage:["project","main_language"],main_language:["project","main_language"],framework:["stack","frontend"],cssFramework:["stack","css_framework"],css:["stack","css_framework"],uiLibrary:["stack","ui_library"],ui_library:["stack","ui_library"],stateManagement:["stack","state_management"],state:["stack","state_management"],backend:["stack","backend"],apiType:["stack","api_type"],api:["stack","api_type"],runtime:["stack","runtime"],database:["stack","database"],db:["stack","database"],connection:["stack","connection"],hosting:["stack","hosting"],buildTool:["stack","build"],build_tool:["stack","build"],build:["stack","build"],packageManager:["stack","package_manager"],pkg_manager:["stack","package_manager"],cicd:["stack","cicd"]},eB=[["packageManager","package-manager"],["pkg_manager","package-manager"],["mainLanguage","language"],["main_language","language"],["framework","framework"],["backend","backend"],["database","database"],["db","database"],["cicd","ci-cd"],["hosting","hosting"],["buildTool","build"],["build_tool","build"],["build","build"],["runtime","runtime"],["cssFramework","css"],["css","css"],["uiLibrary","ui-library"],["stateManagement","state-management"],["apiType","api"],["api","api"]];function $L($,Z){for(let[X,z]of eB)if(X in $)return z;return Z.length>0?"framework":"config"}function ZL($){try{let Z=JSON.parse(iB($,"utf-8")),X=["background","content_scripts","action","browser_action","permissions"].some((z)=>(z in Z));if(typeof Z.manifest_version==="number"&&X)return"chrome";return"other"}catch{return"other"}}function XL($){let Z=[],X=sB($),z=lB(W3($,".git"));for(let J=0;J<10;J++){let Q;try{Q=y7(X)}catch{break}for(let U of Q){let G=G3[U];if(!G)continue;if(U==="manifest.json"&&ZL(W3(X,U))!=="chrome")continue;if(U==="pubspec.yaml"){let W=p2(X);if(W){let q={mainLanguage:"Dart",packageManager:"pub"};if(W.isFlutter){if(q.framework="Flutter",W.stateManagement)q.stateManagement=W.stateManagement}else if(W.appType==="backend"&&W.framework)q.backend=W.framework;else if(W.appType==="mcp")q.apiType="MCP";Z.push({slots:q,priority:G.priority,frameworks:W.isFlutter?["Flutter","Dart"]:["Dart"],fileName:U});continue}}Z.push({slots:G.slots||{},priority:G.priority,frameworks:G.frameworks,fileName:U})}if(z&&J===0)break;let Y=nB(X);if(Y===X)break;X=Y}return Z}function zL($){let Z=[];for(let X of f7($,2,{count:0})){let z=G3[`*${X}`],J=z?.slots?.mainLanguage;if(J)Z.push({slots:{mainLanguage:J},priority:z.priority,frameworks:z.frameworks})}return Z}function JL($){let Z=[...XL($),...zL($)],X={},z={},J=new Set;for(let W of Z){W.frameworks.forEach((q)=>J.add(q));for(let[q,V]of Object.entries(W.slots))if(V&&!V.includes("/")&&(!(q in X)||W.priority>z[q]))X[q]=V,z[q]=W.priority}let Q=new Map;for(let W of Z){if(!W.fileName)continue;if(!Q.has(W.fileName))Q.set(W.fileName,{fileName:W.fileName,category:$L(W.slots,W.frameworks),priority:W.priority})}let Y=[...Q.values()].sort((W,q)=>q.priority-W.priority||W.fileName.localeCompare(q.fileName)),U=[];if(X.mainLanguage)U.push(X.mainLanguage.toLowerCase());if(X.framework)U.push(X.framework.toLowerCase());let G=U.length>0?U.join("-"):"unknown-stack";return{slotFills:X,frameworks:[...J],confirmedCount:Z.length,discoveredFormats:Y,stackSignature:G}}function n2($){let{slotFills:Z}=JL($),X={};for(let[z,J]of Object.entries(Z)){let Q=tB[z];if(!Q||!J)continue;let[Y,U]=Q;if(Y==="project")(X.project??={})[U]=J;else(X.stack??={})[U]=J}return X}function f7($,Z,X){let z=new Set;if(Z<0||X.count>400)return z;let J;try{J=y7($,{withFileTypes:!0})}catch{return z}for(let Q of J){if(X.count++>400)break;if(!Q.isDirectory()){let Y=rB(Q.name);if(oB.has(Y))z.add(Y);continue}if(aB.has(Q.name)||Q.name.startsWith("."))continue;for(let Y of f7(W3($,Q.name),Z-1,X))z.add(Y)}return z}import{existsSync as g7,readFileSync as v7}from"fs";import{join as h7}from"path";var B0=($,Z,X)=>({value:$,source:Z,confidence:X});function QL($){let Z=YL($),X=UL($),z={},J=(Q,Y)=>{if(Y)z[Q]=Y};return J("what",GL(Z,X)),J("who",WL(X)),J("why",qL(X)),J("where",VL(Z,X)),J("when",KL(X)),J("how",HL(Z,X)),z}function r2($){let Z=QL($),X={};return Object.keys(Z).forEach((z)=>{let J=Z[z];if(J)X[z]=J.value}),X}function YL($){let Z=h7($,"package.json");if(!g7(Z))return null;try{return JSON.parse(v7(Z,"utf-8"))}catch{return null}}function UL($){let Z=h7($,"README.md");if(!g7(Z))return"";let X;try{X=v7(Z,"utf-8")}catch{return""}return X.split(`
217
217
  `).filter((z)=>!/^\s*\[!\[/.test(z)&&!/^\s*!\[/.test(z)).join(`
218
- `).replace(/<[^>]+>/g,"").replace(/!\[[^\]]*\]\([^)]*\)/g,"").trim()}function w$($){return $.replace(/\s+/g," ").replace(/[#*`>]/g,"").trim().slice(0,280)}function a$($,Z){let X=new RegExp(`##?\\s+(${Z})\\s*\\n+([\\s\\S]+?)(?:\\n\\n|\\n##?|$)`,"i"),z=$.match(X);return z&&z[2]&&z[2].trim().length>20?{body:w$(z[2]),heading:z[1].trim()}:null}function e1($,Z,X=30){for(let z of Z){let J=$.match(z);if(J&&J[1]&&J[1].trim().length>=X)return w$(J[1])}return null}function $L($,Z){if($?.description&&$.description.length>20)return B0(w$($.description),"package.json:description",0.95);let X=a$(Z,"Purpose|What|About|Overview|Description");if(X)return B0(X.body,`README:## ${X.heading}`,0.8);let z=Z.split(/\n\s*\n/).map((Q)=>Q.trim()).find((Q)=>Q.length>30&&!Q.startsWith("#"));if(z)return B0(w$(z),"README:first-paragraph",0.5);let J=e1(Z,[/(?:core|main|primary)\s+(?:problem|challenge)(?:\s+is)?\s*:?\s*([^.\n]{30,})/i,/solves?\s+(?:the\s+)?(?:problem\s+of\s+)?([^.\n]{30,})/i]);return J?B0(J,"README:problem-heuristic",0.6):null}function ZL($){let Z=a$($,"Audience|Who|Who is this for|Who it.s for");if(Z)return B0(Z.body,`README:## ${Z.heading}`,0.8);let X=e1($,[/\b(?:designed|built|made)\s+for\s+((?:[a-z][a-z-]*\s+)?(?:developers?|teams?|engineers?|builders?|founders?)[^.\n]{0,80})/i,/\bfor\s+((?:[a-z][a-z-]*\s+)?(?:developers?|teams?|engineers?|builders?|founders?)[^.\n]{0,80})/i],8);return X?B0(X,"README:audience-heuristic",0.6):null}function XL($){let Z=a$($,"Why|Mission|Motivation|Rationale|Vision");if(Z)return B0(Z.body,`README:## ${Z.heading}`,0.8);let X=e1($,[/(?:our\s+|the\s+)?(?:mission|purpose|goal)\s+is\s+([^.\n]{30,})/i,/\b(?:mission|purpose|goal)\s*:\s*([^.\n]{30,})/i,/(?:built|created|designed)\s+(?:because|to)\s+([^.\n]{30,})/i]);return X?B0(X,"README:mission-heuristic",0.6):null}function zL($,Z){let X=typeof $?.repository==="string"?$.repository:$?.repository?.url;if(X)return B0(w$(X.replace(/^git\+/,"").replace(/\.git$/,"")),"package.json:repository",0.95);if($?.homepage)return B0(w$($.homepage),"package.json:homepage",0.9);let z=e1(Z,[/\b(?:deployed|hosted|available|published)\s+(?:on|at|via)\s+([^.\n]{3,80})/i],3);return z?B0(z,"README:deploy-heuristic",0.6):null}function JL($){let Z=a$($,"Timeline|Status|Release|Roadmap");if(Z)return B0(Z.body,`README:## ${Z.heading}`,0.8);let X=e1($,[/\b(production\s+since\s+[^.\n]{4,60})/i,/\b((?:in\s+)?(?:production|beta|alpha|development)\s+since\s+[^.\n]{4,60})/i,/\bsince\s+((?:[A-Z][a-z]+\s+)?\d{4}[^.\n]{0,40})/],4);return X?B0(X,"README:since-heuristic",0.6):null}function QL($,Z){let X=$?.scripts?Object.keys($.scripts):[],z=["start","dev","build"].filter((Y)=>X.includes(Y));if(z.length)return B0(w$(z.map((Y)=>`npm run ${Y}`).join(", ")),"package.json:scripts",0.9);let J=a$(Z,"Usage|Getting Started|Install|Installation|Quick Start");if(J)return B0(J.body,`README:## ${J.heading}`,0.8);let Q=a$(Z,"Architecture|Approach|How it works|Methodology|How");return Q?B0(Q.body,`README:## ${Q.heading}`,0.7):null}function o$($){let Z=m2($),X=c2($),z=c0(Z,X);YL(z);let J=c0(z,d2($));return c0(J,{human_context:p2($)})}function YL($){let Z=$.project?.type??"library",X=r$[Z]||r$.library;for(let z of $0){if(X.includes(z.category))continue;let[J,Q]=z.path.split(".");if(J==="stack"&&$.stack)$.stack[Q]="slotignored";if(J==="monorepo"&&$.monorepo)$.monorepo[Q]="slotignored"}}function c0($,Z){let X={...$};for(let[z,J]of Object.entries(Z)){let Q=X[z];if(S0(Q))X[z]=J;else if(typeof J==="object"&&J!==null&&!Array.isArray(J)&&typeof Q==="object"&&Q!==null&&!Array.isArray(Q))X[z]=c0(Q,J)}return X}import{existsSync as f7,readFileSync as UL,writeFileSync as GL}from"fs";import{join as WL,basename as qL}from"path";import{createHash as VL}from"crypto";class d0{projectPath;dnaPath;dna=null;constructor($){this.projectPath=$,this.dnaPath=WL($,".faf-dna")}exists(){return f7(this.dnaPath)}birth($){let Z=new Date().toISOString();return this.dna={birthCertificate:{born:Z,birthDNA:$,birthDNASource:"init",projectDNA:this.generateProjectDNA(),certificate:this.generateCertificate()},versions:[{version:"v1.0.0",timestamp:Z,score:$,changes:["Birth — initial context"],growth:0}],current:{version:"v1.0.0",score:$,lastSync:Z},growth:{totalGrowth:0,daysActive:0,milestones:[{type:"birth",score:$,date:Z,version:"v1.0.0",label:"Birth",emoji:"\uD83D\uDC23"}]},lastModified:Z,format:"faf-dna-v1"},this.save(),this.dna}recordGrowth($,Z){if(!this.dna&&!this.load())return null;let X=this.dna;if($===X.current.score)return X;let z=new Date().toISOString(),J=X.birthCertificate.birthDNA,Q=$-J,Y=this.incrementVersion(X.versions[X.versions.length-1].version);return X.versions.push({version:Y,timestamp:z,score:$,changes:Z,growth:Q}),X.current={version:Y,score:$,lastSync:z},X.growth.totalGrowth=Q,X.growth.daysActive=this.daysSince(X.birthCertificate.born),this.updateMilestones($,Y,z),this.save(),X}getJourney(){if(!this.dna&&!this.load())return"";let $=this.dna,Z=$.birthCertificate.birthDNA,X=$.growth.milestones.find((Q)=>Q.type==="peak"),z=$.current.score,J=`${Z}%`;if(X&&X.score!==Z){if(J+=` → ${X.score}%`,z<X.score)J+=` ← ${z}%`}else if(z!==Z)J+=` → ${z}%`;return J}getBirthDNADisplay(){if(!this.dna&&!this.load())return null;let $=this.dna;return{current:$.current.score,birthDNA:$.birthCertificate.birthDNA,growth:$.current.score-$.birthCertificate.birthDNA,born:$.birthCertificate.born}}getLog(){if(!this.dna&&!this.load())return[];return this.dna.versions.map(($)=>{let Z=$.growth>50?"\uD83D\uDE80":$.growth>20?"\uD83D\uDCC8":"\uD83D\uDCCA";return`${$.version} — ${$.score}% ${Z} (${$.timestamp.split("T")[0]}) ${$.changes.join(", ")}`})}load(){if(this.dna)return this.dna;if(!f7(this.dnaPath))return null;try{return this.dna=JSON.parse(UL(this.dnaPath,"utf-8")),this.dna}catch{return null}}save(){if(!this.dna)return;this.dna.lastModified=new Date().toISOString(),GL(this.dnaPath,JSON.stringify(this.dna,null,2)+`
219
- `,"utf-8")}generateProjectDNA(){return VL("sha256").update([this.projectPath,Date.now().toString(),Math.random().toString(36)].join(":")).digest("hex").substring(0,16)}generateCertificate(){let $=new Date().getFullYear(),Z=Math.random().toString(36).substring(2,6).toUpperCase(),X=qL(this.projectPath).replace(/[^A-Z0-9]/gi,"").toUpperCase().substring(0,8).padEnd(4,"X");return`FAF-${$}-${X}-${Z}`}incrementVersion($){let[Z,X,z]=$.replace("v","").split(".").map(Number);return`v${Z}.${X}.${z+1}`}daysSince($){return Math.floor((Date.now()-new Date($).getTime())/86400000)}updateMilestones($,Z,X){if(!this.dna)return;let z=this.dna.growth.milestones,J=(G)=>z.some((W)=>W.type===G),Q=(G,W,q)=>z.push({type:G,score:$,date:X,version:Z,label:W,emoji:q});if($>=this.dna.birthCertificate.birthDNA*2&&$>0&&!J("doubled"))Q("doubled","Doubled","2️⃣");if($>=70&&!J("championship"))Q("championship","Championship","\uD83C\uDFC6");if($>=85&&!J("elite"))Q("elite","Elite","◆");if($>=100&&!J("perfect"))Q("perfect","Perfect","\uD83C\uDFC6");let Y=z.find((G)=>G.type==="peak");if(!Y||$>Y.score){if(Y)z.splice(z.indexOf(Y),1);Q("peak","Peak","\uD83C\uDFD4️")}let U=z.findIndex((G)=>G.type==="current");if(U>=0)z.splice(U,1);Q("current","Current","\uD83D\uDCCD")}}m();function Y3($={}){let Z=process.cwd(),X=$.output?$.output.endsWith(".faf")?$.output:g7(Z,$.output):g7(Z,"project.faf");if(KL(X)&&!$.force)console.error(`project.faf already exists. Use ${F("--force")} to overwrite.`),process.exit(1);let z=o$(Z);s(X,z);let J=h(X),Q=H0(J),Y=new d0(Z);if(!Y.exists()||$.force)Y.birth(Q.score);if(console.log(`${D("created")} ${X}`),X0(Q,X),console.log(B(` \uD83E\uDDEC Birth DNA ${Q.score}% — your journey starts here (faf dna)`)),Q.score<100)console.log(B(`
220
- run ${F("'faf go'")} to fill empty slots`))}m();function h7(){let $=new d0(process.cwd());if(!$.load())console.error(`${F("×")} No FAF DNA found. Run ${F("'faf init'")} to start your journey.`),process.exit(1);let Z=$.getJourney(),X=$.getBirthDNADisplay(),z=X.born.split("T")[0];console.log(),console.log(K0(F("\uD83E\uDDEC YOUR FAF DNA"))),console.log(),console.log(` ${D(F(Z))}`),console.log(),console.log(B(` Birth DNA ${X.birthDNA}% (born ${z}) · current ${X.current}% · growth ${X.growth>=0?"+":""}${X.growth}%`));let J=$.getLog();if(J.length>1){console.log(),console.log(B(" history:"));for(let Q of J)console.log(B(` ${Q}`))}console.log()}import{existsSync as HL}from"fs";import{join as BL}from"path";m();function l2(){let $=process.cwd(),Z=BL($,"project.faf");if(HL(Z)){let Q=d(Z),Y=c0(Q,c2($)),U=c0(Y,m2($)),G=c0(U,d2($)),W=c0(G,{human_context:p2($)});s(Z,W),console.log(`${D("updated")} ${Z}`)}else s(Z,o$($)),console.log(`${D("created")} ${Z}`);let X=h(Z),z=W0(Y0(X)),J=new d0($);if(J.exists())J.recordGrowth(z.score,["faf auto"]);if(X0(z,Z),z.score<100)console.log(B(`
221
- run ${F("'faf go'")} to reach \uD83C\uDFC6 Trophy`))}import{existsSync as AL}from"fs";import{join as RL}from"path";var t$="(terse — 3-4 words)",LL=[{path:"project.name",question:"What is the name of this project?",header:"Name",type:"text",required:!0},{path:"project.goal",question:"What does this project do? (one sentence)",header:"Goal",type:"text",required:!0},{path:"human_context.who",question:`Who is this for? ${t$}`,header:"Who",type:"text",required:!0},{path:"human_context.what",question:`What are they building? ${t$}`,header:"What",type:"text",required:!0},{path:"human_context.why",question:`Why does it exist? ${t$}`,header:"Why",type:"text",required:!0},{path:"human_context.where",question:`Where does it run or ship? ${t$}`,header:"Where",type:"text",required:!0},{path:"human_context.when",question:`When — timeline or stage? ${t$}`,header:"When",type:"text",required:!0},{path:"human_context.how",question:`How is it built or used? ${t$}`,header:"How",type:"text",required:!0}],NL=[{path:"project.main_language",question:"What is the primary programming language?",header:"Language",type:"select",required:!0,options:[{label:"TypeScript",value:"TypeScript",description:"JavaScript with types"},{label:"JavaScript",value:"JavaScript",description:"Vanilla JS or Node.js"},{label:"Python",value:"Python",description:"Python 3.x"},{label:"Rust",value:"Rust",description:"Systems programming"},{label:"Go",value:"Go",description:"Golang"},{label:"Other",value:"Other",description:"Specify manually"}]},{path:"stack.frontend",question:"What frontend framework does it use?",header:"Frontend",type:"select",required:!1,options:[{label:"React",value:"React",description:"React.js"},{label:"Vue",value:"Vue",description:"Vue.js"},{label:"Svelte",value:"Svelte",description:"Svelte/SvelteKit"},{label:"Next.js",value:"Next.js",description:"React framework"},{label:"None",value:"None",description:"No frontend"},{label:"Other",value:"Other",description:"Specify manually"}]},{path:"stack.backend",question:"What backend framework does it use?",header:"Backend",type:"select",required:!1,options:[{label:"Express",value:"Express",description:"Node.js Express"},{label:"Fastify",value:"Fastify",description:"Node.js Fastify"},{label:"Django",value:"Django",description:"Python Django"},{label:"FastAPI",value:"FastAPI",description:"Python FastAPI"},{label:"None",value:"None",description:"No backend"},{label:"Other",value:"Other",description:"Specify manually"}]},{path:"stack.database",question:"What database does it use?",header:"Database",type:"select",required:!1,options:[{label:"PostgreSQL",value:"PostgreSQL",description:"Postgres"},{label:"MySQL",value:"MySQL",description:"MySQL/MariaDB"},{label:"SQLite",value:"SQLite",description:"Embedded SQL"},{label:"MongoDB",value:"MongoDB",description:"Document store"},{label:"None",value:"None",description:"No database"},{label:"Other",value:"Other",description:"Specify manually"}]},{path:"stack.runtime",question:"What runtime does it run on?",header:"Runtime",type:"text",required:!1},{path:"stack.hosting",question:"Where is it hosted or distributed?",header:"Hosting",type:"text",required:!1},{path:"stack.build",question:"What is the build tool?",header:"Build",type:"text",required:!1},{path:"stack.cicd",question:"What CI/CD does it use?",header:"CI/CD",type:"text",required:!1}],i2=[...LL,...NL],ML=new Map(i2.map(($)=>[$.path,$])),ZA=Object.fromEntries(i2.map(($)=>[$.path,$]));function n2($){let Z=ML.get($);if(Z)return Z.question;let X=v2.get($)??$0.find((z)=>z.canonical===$);return X?`${X.description}?`.replace(/\?\?$/,"?"):`${$}?`}function G3($){if($===null||$===void 0)return!0;if(typeof $==="string"){let Z=$.trim();return Z===""||S0(Z)}return!1}function OL($,Z){let X=$;for(let z of Z.split("."))if(X&&typeof X==="object"&&z in X)X=X[z];else return;return X}function TL($){if($==="project.goal")return!0;return v2.get($)?.category==="human"}function DL($,Z=G3){let X=[],z=[];for(let J of i2){let Q=OL($,J.path);if(Q==="slotignored")continue;if(!Z(Q))continue;(TL(J.path)?X:z).push(J.path)}return{human:X,sourceable:z}}function IL($,Z,X=G3){let z=DL(Z,X),J;if($>=100||z.human.length===0&&z.sourceable.length===0)J="done";else if(z.sourceable.length>0)J="can-source";else J="needs-human";let Q=J==="needs-human"?U3(z):[];return{status:J,score:$,gaps:z,ask:Q}}function U3($){return $.human.map((Z)=>({path:Z,question:n2(Z)}))}function v7($,Z={}){let X=Math.max(1,Z.maxRounds??5),z=Z.isEmpty??G3,J=[],Q=0;for(let U=0;U<=X;U++){let G=$.read();if(!G)return{status:"no-faf",score:0,rounds:Q,history:J,ask:[]};let W=$.score(G.yaml);J.push(W);let q=IL(W,G.data,z);if(q.status==="done")return{status:"done",score:W,rounds:Q,history:J,ask:[]};if(q.status==="needs-human")return{status:"needs-human",score:W,rounds:Q,history:J,ask:q.ask};if(J.length>=2&&W<=J[J.length-2])return q.gaps.human.length?{status:"needs-human",score:W,rounds:Q,history:J,ask:U3(q.gaps)}:{status:"stuck",score:W,rounds:Q,history:J,ask:[]};if(Q>=X)return{status:"capped",score:W,rounds:Q,history:J,ask:U3(q.gaps)};$.runAuto(),Q++}return{status:"capped",score:J[J.length-1]??0,rounds:Q,history:J,ask:[]}}m();function u7($={}){let Z=process.cwd(),X=RL(Z,"project.faf"),z=$.rounds?Math.max(1,parseInt($.rounds,10)||5):5;FL(v7({read:()=>AL(X)?{data:d(X),yaml:h(X)}:{data:{},yaml:""},score:(Q)=>Q?W0(Y0(Q)).score:0,runAuto:()=>l2()},{maxRounds:z}))}function FL($){if($.history.length>1)console.log(B(`
222
- climb: ${$.history.join("% → ")}%`));switch(console.log(""),$.status){case"done":console.log(`${D("done")} — \uD83C\uDFC6 100% AI-readiness. The .faf is complete.`);break;case"needs-human":{let Z=$.ask.length;console.log(`${F("Sourced everything detection can.")} ${Z} question${Z===1?"":"s"} only you can answer:`);for(let X of $.ask)console.log(` ${B("•")} ${X.question}`);console.log(B(`
223
- Answer with ${F("'faf go'")}, or fill them in project.faf directly.`));break}case"stuck":console.log(`${F(`Stopped at ${$.score}%.`)} The remaining gaps need evidence detection couldn't find, and there's nothing only you can answer. Add the missing manifests/README, then re-run.`);break;case"capped":console.log(`${F(`Stopped at ${$.score}% after ${$.rounds} rounds (the cap).`)} Re-run ${F("'faf loop'")} to continue, or raise ${B("--rounds")}.`);break;case"no-faf":console.log(`No project.faf, and none could be created here. Run ${F("'faf init'")} first.`);break}}import{existsSync as a2,statSync as r7}from"fs";import{join as s7,dirname as yL}from"path";import{readFileSync as jL,existsSync as SL,statSync as MA}from"fs";import{join as c7}from"path";import{readFileSync as wL,writeFileSync as r2,existsSync as PL}from"fs";var _L="<!-- faf:start -->",CL="<!-- faf:end -->",EL="<!-- faf:";function Y$($,Z,X=_L,z=CL){let J=`${X}
218
+ `).replace(/<[^>]+>/g,"").replace(/!\[[^\]]*\]\([^)]*\)/g,"").trim()}function C$($){return $.replace(/\s+/g," ").replace(/[#*`>]/g,"").trim().slice(0,280)}function $1($,Z){let X=new RegExp(`##?\\s+(${Z})\\s*\\n+([\\s\\S]+?)(?:\\n\\n|\\n##?|$)`,"i"),z=$.match(X);return z&&z[2]&&z[2].trim().length>20?{body:C$(z[2]),heading:z[1].trim()}:null}function J4($,Z,X=30){for(let z of Z){let J=$.match(z);if(J&&J[1]&&J[1].trim().length>=X)return C$(J[1])}return null}function GL($,Z){if($?.description&&$.description.length>20)return B0(C$($.description),"package.json:description",0.95);let X=$1(Z,"Purpose|What|About|Overview|Description");if(X)return B0(X.body,`README:## ${X.heading}`,0.8);let z=Z.split(/\n\s*\n/).map((Q)=>Q.trim()).find((Q)=>Q.length>30&&!Q.startsWith("#"));if(z)return B0(C$(z),"README:first-paragraph",0.5);let J=J4(Z,[/(?:core|main|primary)\s+(?:problem|challenge)(?:\s+is)?\s*:?\s*([^.\n]{30,})/i,/solves?\s+(?:the\s+)?(?:problem\s+of\s+)?([^.\n]{30,})/i]);return J?B0(J,"README:problem-heuristic",0.6):null}function WL($){let Z=$1($,"Audience|Who|Who is this for|Who it.s for");if(Z)return B0(Z.body,`README:## ${Z.heading}`,0.8);let X=J4($,[/\b(?:designed|built|made)\s+for\s+((?:[a-z][a-z-]*\s+)?(?:developers?|teams?|engineers?|builders?|founders?)[^.\n]{0,80})/i,/\bfor\s+((?:[a-z][a-z-]*\s+)?(?:developers?|teams?|engineers?|builders?|founders?)[^.\n]{0,80})/i],8);return X?B0(X,"README:audience-heuristic",0.6):null}function qL($){let Z=$1($,"Why|Mission|Motivation|Rationale|Vision");if(Z)return B0(Z.body,`README:## ${Z.heading}`,0.8);let X=J4($,[/(?:our\s+|the\s+)?(?:mission|purpose|goal)\s+is\s+([^.\n]{30,})/i,/\b(?:mission|purpose|goal)\s*:\s*([^.\n]{30,})/i,/(?:built|created|designed)\s+(?:because|to)\s+([^.\n]{30,})/i]);return X?B0(X,"README:mission-heuristic",0.6):null}function VL($,Z){let X=typeof $?.repository==="string"?$.repository:$?.repository?.url;if(X)return B0(C$(X.replace(/^git\+/,"").replace(/\.git$/,"")),"package.json:repository",0.95);if($?.homepage)return B0(C$($.homepage),"package.json:homepage",0.9);let z=J4(Z,[/\b(?:deployed|hosted|available|published)\s+(?:on|at|via)\s+([^.\n]{3,80})/i],3);return z?B0(z,"README:deploy-heuristic",0.6):null}function KL($){let Z=$1($,"Timeline|Status|Release|Roadmap");if(Z)return B0(Z.body,`README:## ${Z.heading}`,0.8);let X=J4($,[/\b(production\s+since\s+[^.\n]{4,60})/i,/\b((?:in\s+)?(?:production|beta|alpha|development)\s+since\s+[^.\n]{4,60})/i,/\bsince\s+((?:[A-Z][a-z]+\s+)?\d{4}[^.\n]{0,40})/],4);return X?B0(X,"README:since-heuristic",0.6):null}function HL($,Z){let X=$?.scripts?Object.keys($.scripts):[],z=["start","dev","build"].filter((Y)=>X.includes(Y));if(z.length)return B0(C$(z.map((Y)=>`npm run ${Y}`).join(", ")),"package.json:scripts",0.9);let J=$1(Z,"Usage|Getting Started|Install|Installation|Quick Start");if(J)return B0(J.body,`README:## ${J.heading}`,0.8);let Q=$1(Z,"Architecture|Approach|How it works|Methodology|How");return Q?B0(Q.body,`README:## ${Q.heading}`,0.7):null}function Z1($){let Z=l2($),X=i2($),z=l0(Z,X);BL(z);let J=l0(z,n2($));return l0(J,{human_context:r2($)})}function BL($){let Z=$.project?.type??"library",X=t$[Z]||t$.library;for(let z of $0){if(X.includes(z.category))continue;let[J,Q]=z.path.split(".");if(J==="stack"&&$.stack)$.stack[Q]="slotignored";if(J==="monorepo"&&$.monorepo)$.monorepo[Q]="slotignored"}}function l0($,Z){let X={...$};for(let[z,J]of Object.entries(Z)){let Q=X[z];if(x0(Q))X[z]=J;else if(typeof J==="object"&&J!==null&&!Array.isArray(J)&&typeof Q==="object"&&Q!==null&&!Array.isArray(Q))X[z]=l0(Q,J)}return X}import{existsSync as u7,readFileSync as LL,writeFileSync as NL}from"fs";import{join as ML,basename as OL}from"path";import{createHash as TL}from"crypto";class i0{projectPath;dnaPath;dna=null;constructor($){this.projectPath=$,this.dnaPath=ML($,".faf-dna")}exists(){return u7(this.dnaPath)}birth($){let Z=new Date().toISOString();return this.dna={birthCertificate:{born:Z,birthDNA:$,birthDNASource:"init",projectDNA:this.generateProjectDNA(),certificate:this.generateCertificate()},versions:[{version:"v1.0.0",timestamp:Z,score:$,changes:["Birth — initial context"],growth:0}],current:{version:"v1.0.0",score:$,lastSync:Z},growth:{totalGrowth:0,daysActive:0,milestones:[{type:"birth",score:$,date:Z,version:"v1.0.0",label:"Birth",emoji:"\uD83D\uDC23"}]},lastModified:Z,format:"faf-dna-v1"},this.save(),this.dna}recordGrowth($,Z){if(!this.dna&&!this.load())return null;let X=this.dna;if($===X.current.score)return X;let z=new Date().toISOString(),J=X.birthCertificate.birthDNA,Q=$-J,Y=this.incrementVersion(X.versions[X.versions.length-1].version);return X.versions.push({version:Y,timestamp:z,score:$,changes:Z,growth:Q}),X.current={version:Y,score:$,lastSync:z},X.growth.totalGrowth=Q,X.growth.daysActive=this.daysSince(X.birthCertificate.born),this.updateMilestones($,Y,z),this.save(),X}getJourney(){if(!this.dna&&!this.load())return"";let $=this.dna,Z=$.birthCertificate.birthDNA,X=$.growth.milestones.find((Q)=>Q.type==="peak"),z=$.current.score,J=`${Z}%`;if(X&&X.score!==Z){if(J+=` → ${X.score}%`,z<X.score)J+=` ← ${z}%`}else if(z!==Z)J+=` → ${z}%`;return J}getBirthDNADisplay(){if(!this.dna&&!this.load())return null;let $=this.dna;return{current:$.current.score,birthDNA:$.birthCertificate.birthDNA,growth:$.current.score-$.birthCertificate.birthDNA,born:$.birthCertificate.born}}getLog(){if(!this.dna&&!this.load())return[];return this.dna.versions.map(($)=>{let Z=$.growth>50?"\uD83D\uDE80":$.growth>20?"\uD83D\uDCC8":"\uD83D\uDCCA";return`${$.version} — ${$.score}% ${Z} (${$.timestamp.split("T")[0]}) ${$.changes.join(", ")}`})}load(){if(this.dna)return this.dna;if(!u7(this.dnaPath))return null;try{return this.dna=JSON.parse(LL(this.dnaPath,"utf-8")),this.dna}catch{return null}}save(){if(!this.dna)return;this.dna.lastModified=new Date().toISOString(),NL(this.dnaPath,JSON.stringify(this.dna,null,2)+`
219
+ `,"utf-8")}generateProjectDNA(){return TL("sha256").update([this.projectPath,Date.now().toString(),Math.random().toString(36)].join(":")).digest("hex").substring(0,16)}generateCertificate(){let $=new Date().getFullYear(),Z=Math.random().toString(36).substring(2,6).toUpperCase(),X=OL(this.projectPath).replace(/[^A-Z0-9]/gi,"").toUpperCase().substring(0,8).padEnd(4,"X");return`FAF-${$}-${X}-${Z}`}incrementVersion($){let[Z,X,z]=$.replace("v","").split(".").map(Number);return`v${Z}.${X}.${z+1}`}daysSince($){return Math.floor((Date.now()-new Date($).getTime())/86400000)}updateMilestones($,Z,X){if(!this.dna)return;let z=this.dna.growth.milestones,J=(G)=>z.some((W)=>W.type===G),Q=(G,W,q)=>z.push({type:G,score:$,date:X,version:Z,label:W,emoji:q});if($>=this.dna.birthCertificate.birthDNA*2&&$>0&&!J("doubled"))Q("doubled","Doubled","2️⃣");if($>=70&&!J("championship"))Q("championship","Championship","\uD83C\uDFC6");if($>=85&&!J("elite"))Q("elite","Elite","◆");if($>=100&&!J("perfect"))Q("perfect","Perfect","\uD83C\uDFC6");let Y=z.find((G)=>G.type==="peak");if(!Y||$>Y.score){if(Y)z.splice(z.indexOf(Y),1);Q("peak","Peak","\uD83C\uDFD4️")}let U=z.findIndex((G)=>G.type==="current");if(U>=0)z.splice(U,1);Q("current","Current","\uD83D\uDCCD")}}c();function q3($={}){let Z=process.cwd(),X=$.output?$.output.endsWith(".faf")?$.output:m7(Z,$.output):m7(Z,"project.faf");if(DL(X)&&!$.force)console.error(`project.faf already exists. Use ${I("--force")} to overwrite.`),process.exit(1);let z=Z1(Z);s(X,z);let J=v(X),Q=H0(J),Y=new i0(Z);if(!Y.exists()||$.force)Y.birth(Q.score);if(console.log(`${D("created")} ${X}`),X0(Q,X),console.log(H(` \uD83E\uDDEC Birth DNA ${Q.score}% — your journey starts here (faf dna)`)),Q.score<100)console.log(H(`
220
+ run ${I("'faf go'")} to fill empty slots`))}c();function c7(){let $=new i0(process.cwd());if(!$.load())console.error(`${I("×")} No FAF DNA found. Run ${I("'faf init'")} to start your journey.`),process.exit(1);let Z=$.getJourney(),X=$.getBirthDNADisplay(),z=X.born.split("T")[0];console.log(),console.log(K0(I("\uD83E\uDDEC YOUR FAF DNA"))),console.log(),console.log(` ${D(I(Z))}`),console.log(),console.log(H(` Birth DNA ${X.birthDNA}% (born ${z}) · current ${X.current}% · growth ${X.growth>=0?"+":""}${X.growth}%`));let J=$.getLog();if(J.length>1){console.log(),console.log(H(" history:"));for(let Q of J)console.log(H(` ${Q}`))}console.log()}import{existsSync as IL}from"fs";import{join as AL}from"path";c();function s2(){let $=process.cwd(),Z=AL($,"project.faf");if(IL(Z)){let Q=m(Z),Y=l0(Q,i2($)),U=l0(Y,l2($)),G=l0(U,n2($)),W=l0(G,{human_context:r2($)});s(Z,W),console.log(`${D("updated")} ${Z}`)}else s(Z,Z1($)),console.log(`${D("created")} ${Z}`);let X=v(Z),z=W0(Y0(X)),J=new i0($);if(J.exists())J.recordGrowth(z.score,["faf auto"]);if(X0(z,Z),z.score<100)console.log(H(`
221
+ run ${I("'faf go'")} to reach \uD83C\uDFC6 Trophy`))}import{existsSync as jL}from"fs";import{join as SL}from"path";var X1="(terse — 3-4 words)",RL=[{path:"project.name",question:"What is the name of this project?",header:"Name",type:"text",required:!0},{path:"project.goal",question:"What does this project do? (one sentence)",header:"Goal",type:"text",required:!0},{path:"human_context.who",question:`Who is this for? ${X1}`,header:"Who",type:"text",required:!0},{path:"human_context.what",question:`What are they building? ${X1}`,header:"What",type:"text",required:!0},{path:"human_context.why",question:`Why does it exist? ${X1}`,header:"Why",type:"text",required:!0},{path:"human_context.where",question:`Where does it run or ship? ${X1}`,header:"Where",type:"text",required:!0},{path:"human_context.when",question:`When — timeline or stage? ${X1}`,header:"When",type:"text",required:!0},{path:"human_context.how",question:`How is it built or used? ${X1}`,header:"How",type:"text",required:!0}],FL=[{path:"project.main_language",question:"What is the primary programming language?",header:"Language",type:"select",required:!0,options:[{label:"TypeScript",value:"TypeScript",description:"JavaScript with types"},{label:"JavaScript",value:"JavaScript",description:"Vanilla JS or Node.js"},{label:"Python",value:"Python",description:"Python 3.x"},{label:"Rust",value:"Rust",description:"Systems programming"},{label:"Go",value:"Go",description:"Golang"},{label:"Other",value:"Other",description:"Specify manually"}]},{path:"stack.frontend",question:"What frontend framework does it use?",header:"Frontend",type:"select",required:!1,options:[{label:"React",value:"React",description:"React.js"},{label:"Vue",value:"Vue",description:"Vue.js"},{label:"Svelte",value:"Svelte",description:"Svelte/SvelteKit"},{label:"Next.js",value:"Next.js",description:"React framework"},{label:"None",value:"None",description:"No frontend"},{label:"Other",value:"Other",description:"Specify manually"}]},{path:"stack.backend",question:"What backend framework does it use?",header:"Backend",type:"select",required:!1,options:[{label:"Express",value:"Express",description:"Node.js Express"},{label:"Fastify",value:"Fastify",description:"Node.js Fastify"},{label:"Django",value:"Django",description:"Python Django"},{label:"FastAPI",value:"FastAPI",description:"Python FastAPI"},{label:"None",value:"None",description:"No backend"},{label:"Other",value:"Other",description:"Specify manually"}]},{path:"stack.database",question:"What database does it use?",header:"Database",type:"select",required:!1,options:[{label:"PostgreSQL",value:"PostgreSQL",description:"Postgres"},{label:"MySQL",value:"MySQL",description:"MySQL/MariaDB"},{label:"SQLite",value:"SQLite",description:"Embedded SQL"},{label:"MongoDB",value:"MongoDB",description:"Document store"},{label:"None",value:"None",description:"No database"},{label:"Other",value:"Other",description:"Specify manually"}]},{path:"stack.runtime",question:"What runtime does it run on?",header:"Runtime",type:"text",required:!1},{path:"stack.hosting",question:"Where is it hosted or distributed?",header:"Hosting",type:"text",required:!1},{path:"stack.build",question:"What is the build tool?",header:"Build",type:"text",required:!1},{path:"stack.cicd",question:"What CI/CD does it use?",header:"CI/CD",type:"text",required:!1}],a2=[...RL,...FL],wL=new Map(a2.map(($)=>[$.path,$])),IA=Object.fromEntries(a2.map(($)=>[$.path,$]));function o2($){let Z=wL.get($);if(Z)return Z.question;let X=o$.get($)??$0.find((z)=>z.canonical===$);return X?`${X.description}?`.replace(/\?\?$/,"?"):`${$}?`}function K3($){if($===null||$===void 0)return!0;if(typeof $==="string"){let Z=$.trim();return Z===""||x0(Z)}return!1}function PL($,Z){let X=$;for(let z of Z.split("."))if(X&&typeof X==="object"&&z in X)X=X[z];else return;return X}function _L($){if($==="project.goal")return!0;return o$.get($)?.category==="human"}function CL($,Z=K3){let X=[],z=[];for(let J of a2){let Q=PL($,J.path);if(Q==="slotignored")continue;if(!Z(Q))continue;(_L(J.path)?X:z).push(J.path)}return{human:X,sourceable:z}}function EL($,Z,X=K3){let z=CL(Z,X),J;if($>=100||z.human.length===0&&z.sourceable.length===0)J="done";else if(z.sourceable.length>0)J="can-source";else J="needs-human";let Q=J==="needs-human"?V3(z):[];return{status:J,score:$,gaps:z,ask:Q}}function V3($){return $.human.map((Z)=>({path:Z,question:o2(Z)}))}function d7($,Z={}){let X=Math.max(1,Z.maxRounds??5),z=Z.isEmpty??K3,J=[],Q=0;for(let U=0;U<=X;U++){let G=$.read();if(!G)return{status:"no-faf",score:0,rounds:Q,history:J,ask:[]};let W=$.score(G.yaml);J.push(W);let q=EL(W,G.data,z);if(q.status==="done")return{status:"done",score:W,rounds:Q,history:J,ask:[]};if(q.status==="needs-human")return{status:"needs-human",score:W,rounds:Q,history:J,ask:q.ask};if(J.length>=2&&W<=J[J.length-2])return q.gaps.human.length?{status:"needs-human",score:W,rounds:Q,history:J,ask:V3(q.gaps)}:{status:"stuck",score:W,rounds:Q,history:J,ask:[]};if(Q>=X)return{status:"capped",score:W,rounds:Q,history:J,ask:V3(q.gaps)};$.runAuto(),Q++}return{status:"capped",score:J[J.length-1]??0,rounds:Q,history:J,ask:[]}}c();function p7($={}){let Z=process.cwd(),X=SL(Z,"project.faf"),z=$.rounds?Math.max(1,parseInt($.rounds,10)||5):5;bL(d7({read:()=>jL(X)?{data:m(X),yaml:v(X)}:{data:{},yaml:""},score:(Q)=>Q?W0(Y0(Q)).score:0,runAuto:()=>s2()},{maxRounds:z}))}function bL($){if($.history.length>1)console.log(H(`
222
+ climb: ${$.history.join("% → ")}%`));switch(console.log(""),$.status){case"done":console.log(`${D("done")} — \uD83C\uDFC6 100% AI-readiness. The .faf is complete.`);break;case"needs-human":{let Z=$.ask.length;console.log(`${I("Sourced everything detection can.")} ${Z} question${Z===1?"":"s"} only you can answer:`);for(let X of $.ask)console.log(` ${H("•")} ${X.question}`);console.log(H(`
223
+ Answer with ${I("'faf go'")}, or fill them in project.faf directly.`));break}case"stuck":console.log(`${I(`Stopped at ${$.score}%.`)} The remaining gaps need evidence detection couldn't find, and there's nothing only you can answer. Add the missing manifests/README, then re-run.`);break;case"capped":console.log(`${I(`Stopped at ${$.score}% after ${$.rounds} rounds (the cap).`)} Re-run ${I("'faf loop'")} to continue, or raise ${H("--rounds")}.`);break;case"no-faf":console.log(`No project.faf, and none could be created here. Run ${I("'faf init'")} first.`);break}}import{existsSync as $6,statSync as t7}from"fs";import{join as e7,dirname as lL}from"path";import{readFileSync as uL,existsSync as mL,statSync as hA}from"fs";import{join as i7}from"path";import{readFileSync as xL,writeFileSync as t2,existsSync as kL}from"fs";var yL="<!-- faf:start -->",fL="<!-- faf:end -->",gL="<!-- faf:";function u0($,Z,X=yL,z=fL){let J=`${X}
224
224
  ${Z.trim()}
225
- ${z}`;if(!PL($)){r2($,`${J}
226
- `,"utf-8");return}let Q=wL($,"utf-8"),Y=Q.indexOf(X),U=Q.indexOf(z);if(Y!==-1&&U!==-1&&U>Y){let G=Q.slice(0,Y),W=Q.slice(U+z.length);r2($,`${G}${J}${W}`,"utf-8");return}if(Q.trimStart().startsWith(EL)){r2($,`${J}
227
- `,"utf-8");return}r2($,`${J}
225
+ ${z}`;if(!kL($)){t2($,`${J}
226
+ `,"utf-8");return}let Q=xL($,"utf-8"),Y=Q.indexOf(X),U=Q.indexOf(z);if(Y!==-1&&U!==-1&&U>Y){let G=Q.slice(0,Y),W=Q.slice(U+z.length);t2($,`${G}${J}${W}`,"utf-8");return}if(Q.trimStart().startsWith(gL)){t2($,`${J}
227
+ `,"utf-8");return}t2($,`${J}
228
228
 
229
- ${Q}`,"utf-8")}var d7="CLAUDE.md",bL="STATUS: BI-SYNC ACTIVE";function p7($){let Z=c7($,d7);if(!SL(Z))return null;return jL(Z,"utf-8")}function l7($,Z){Y$(c7($,d7),Z)}function P$($,Z={}){let X=String($.project?.name??"").trim(),z=String($.project?.main_language??"").trim(),J=String($.project?.type??"").trim(),Q=String($.project?.goal??"").trim(),Y=`<!-- faf: ${[X,z,J,Q].join(" | ")} -->`,U=[];if(Z.doc)U.push(`doc=${Z.doc}`);else U.push(`claim=${Z.claim??"project.faf"}`);if(typeof Z.score==="number")U.push(`score=${Z.score}`);if(U.push(`family=${Z.family??"FAF"}`),Z.siblings&&Z.siblings.length>0)U.push(`siblings=${Z.siblings.join(",")}`);let G=`<!-- faf: ${U.join(" | ")} -->`;return`${Y}
230
- ${G}`}function i7($){let Z=[],X=$.project?.name??"Project",z=$.project?.main_language??"",J=$.project?.goal??"";if(Z.push(P$($)),Z.push(""),Z.push(`# CLAUDE.md — ${X}`),Z.push(""),J)Z.push("## What This Is"),Z.push(""),Z.push(J),Z.push("");let Q=$.stack??{},Y=[];if(z)Y.push(`**Language:** ${z}`);for(let[W,q]of Object.entries(Q))if(q&&q!=="slotignored"&&String(q).trim()){let V=W.replace(/_/g," ").replace(/\b\w/g,(K)=>K.toUpperCase());Y.push(`**${V}:** ${q}`)}if(Y.length>0){Z.push("## Stack"),Z.push("");for(let W of Y)Z.push(`- ${W}`);Z.push("")}let U=$.human_context??{},G=[["Who",U.who],["What",U.what],["Why",U.why],["Where",U.where],["When",U.when],["How",U.how]].filter(([W,q])=>q&&String(q).trim());if(G.length>0){Z.push("## Context"),Z.push("");for(let[W,q]of G)Z.push(`- **${W}:** ${q}`);Z.push("")}return Z.push("---"),Z.push(""),Z.push(`*${bL} — ${new Date().toISOString()}*`),Z.push(""),Z.join(`
231
- `)}function m7($){return $.replace(/\s+v\d+(?:\.\d+)*\s*$/i,"").trim()}function s2($){let Z={project:{}},X=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(X)Z.project.name=m7(X[1].trim());if(!Z.project.name){let Q=$.match(/\*\*Name:\*\*\s*(.+)/);if(Q)Z.project.name=m7(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 AA,writeFileSync as xL,existsSync as RA}from"fs";import{join as kL}from"path";function n7($,Z){xL(kL($,"MEMORY.md"),Z,"utf-8")}m();function e$(){return process.env.FAF_PRO==="1"||process.env.FAF_PRO==="true"}function W3($={}){let Z=process.cwd(),X=v(Z);if(!X)console.error(`Error: project.faf not found
229
+ ${Q}`,"utf-8")}var vL=new Set(["API","CI","CD","MCP","CLI","SDK","UI","UX","AI","ML","DB","ORM","OS","HTTP","HTTPS","REST","RPC","JSON","YAML","XML","SQL","CSS","HTML","AWS","GCP","CDN","DNS","JWT","ID","IP","URL","URI","TS","JS"]);function hL($){return $.split("_").map((Z)=>{if(!Z)return Z;let X=Z.toUpperCase();return vL.has(X)?X:Z.charAt(0).toUpperCase()+Z.slice(1)}).join(" ")}function M0($){return typeof $==="string"&&$.trim()!==""&&$.trim()!=="slotignored"}function A0($){let Z=o$.get($);if(Z?.label)return Z.label;let X=$.includes(".")?$.slice($.lastIndexOf(".")+1):$;return hL(X)}var n7="CLAUDE.md",cL="STATUS: BI-SYNC ACTIVE";function r7($){let Z=i7($,n7);if(!mL(Z))return null;return uL(Z,"utf-8")}function s7($,Z){u0(i7($,n7),Z)}function n0($,Z={}){let X=String($.project?.name??"").trim(),z=String($.project?.main_language??"").trim(),J=String($.project?.type??"").trim(),Q=String($.project?.goal??"").trim(),Y=`<!-- faf: ${[X,z,J,Q].join(" | ")} -->`,U=[];if(Z.doc)U.push(`doc=${Z.doc}`);else U.push(`claim=${Z.claim??"project.faf"}`);if(typeof Z.score==="number")U.push(`score=${Z.score}`);if(U.push(`family=${Z.family??"FAF"}`),Z.siblings&&Z.siblings.length>0)U.push(`siblings=${Z.siblings.join(",")}`);let G=`<!-- faf: ${U.join(" | ")} -->`;return`${Y}
230
+ ${G}`}function a7($){let Z=[],X=$.project?.name??"Project",z=$.project?.main_language??"",J=$.project?.goal??"";if(Z.push(n0($)),Z.push(""),Z.push(`# CLAUDE.md — ${X}`),Z.push(""),J)Z.push("## What This Is"),Z.push(""),Z.push(J),Z.push("");let Q=$.stack??{},Y=[];if(z)Y.push(`**Language:** ${z}`);for(let[W,q]of Object.entries(Q))if(q&&q!=="slotignored"&&String(q).trim())Y.push(`**${A0(`stack.${W}`)}:** ${q}`);if(Y.length>0){Z.push("## Stack"),Z.push("");for(let W of Y)Z.push(`- ${W}`);Z.push("")}let U=$.human_context??{},G=[["who",U.who],["what",U.what],["why",U.why],["where",U.where],["when",U.when],["how",U.how]].filter(([,W])=>W&&String(W).trim()).map(([W,q])=>`- **${A0(`human_context.${W}`)}:** ${q}`);if(G.length>0)Z.push("## Context"),Z.push(""),Z.push(...G),Z.push("");return Z.push("---"),Z.push(""),Z.push(`*${cL} — ${new Date().toISOString()}*`),Z.push(""),Z.join(`
231
+ `)}function l7($){return $.replace(/\s+v\d+(?:\.\d+)*\s*$/i,"").trim()}function e2($){let Z={project:{}},X=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(X)Z.project.name=l7(X[1].trim());if(!Z.project.name){let Q=$.match(/\*\*Name:\*\*\s*(.+)/);if(Q)Z.project.name=l7(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 lA,writeFileSync as dL,existsSync as iA}from"fs";import{join as pL}from"path";function o7($,Z){dL(pL($,"MEMORY.md"),Z,"utf-8")}c();function z1(){return process.env.FAF_PRO==="1"||process.env.FAF_PRO==="true"}function H3($={}){let Z=process.cwd(),X=h(Z);if(!X)console.error(`Error: project.faf not found
232
232
 
233
- Run 'faf init' to create one.`),process.exit(2);let z=s7(Z,"CLAUDE.md"),J=s7(Z,"MEMORY.md"),Q=$.direction??"auto";if(Q==="auto")a7(X,z,Z);else if(Q==="push")o7(X,Z);else if(Q==="pull")fL(X,z);if(e$())t7(X,J,Z);if($.watch)console.log(B("watching for changes... (Ctrl+C to stop)")),hL(X,z,J,Z)}function a7($,Z,X){o7($,X)}function o7($,Z){let X=d($),z=i7(X);l7(Z,z),console.log(`${D("◆")} sync .faf → CLAUDE.md ${B("← bi-sync")}`);let J=W0(Y0(h($)));X0(J,$)}function fL($,Z){let X=W0(Y0(h($)));if(X.tier.name!=="TROPHY")console.error(`${F("×")} sync --pull blocked: requires \uD83C\uDFC6 Trophy (currently ${X.score}%)`),console.error(B(" MD → .faf backfill only runs at 100%. Reach Trophy with 'faf go', then retry.")),process.exit(1);let z=p7(yL(Z));if(!z){console.error("CLAUDE.md not found.");return}let J=s2(z),Q=d($);if(J.project?.name)Q.project={...Q.project,name:J.project.name};if(J.project?.goal)Q.project={...Q.project,goal:J.project.goal};if(J.project?.main_language)Q.project={...Q.project,main_language:J.project.main_language};s($,Q),console.log(`${D("◆")} sync CLAUDE.md → .faf ${B("← bi-sync (Trophy-gated)")}`);let Y=W0(Y0(h($)));X0(Y,$)}function t7($,Z,X){let z=d($),J=r7($).mtimeMs,Q=a2(Z)?r7(Z).mtimeMs:0;if(!a2(Z)||J>Q){let Y=gL(z);n7(X,Y),console.log(`${D("◆")} sync .faf → MEMORY.md ${B("← tri-sync")}`)}else console.log(`${D("◆")} sync MEMORY.md → .faf ${B("← tri-sync")}`)}function gL($){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(`
233
+ Run 'faf init' to create one.`),process.exit(2);let z=e7(Z,"CLAUDE.md"),J=e7(Z,"MEMORY.md"),Q=$.direction??"auto";if(Q==="auto")$X(X,z,Z);else if(Q==="push")ZX(X,Z);else if(Q==="pull")iL(X,z);if(z1())XX(X,J,Z);if($.watch)console.log(H("watching for changes... (Ctrl+C to stop)")),rL(X,z,J,Z)}function $X($,Z,X){ZX($,X)}function ZX($,Z){let X=m($),z=a7(X);s7(Z,z),console.log(`${D("◆")} sync .faf → CLAUDE.md ${H("← bi-sync")}`);let J=W0(Y0(v($)));X0(J,$)}function iL($,Z){let X=W0(Y0(v($)));if(X.tier.name!=="TROPHY")console.error(`${I("×")} sync --pull blocked: requires \uD83C\uDFC6 Trophy (currently ${X.score}%)`),console.error(H(" MD → .faf backfill only runs at 100%. Reach Trophy with 'faf go', then retry.")),process.exit(1);let z=r7(lL(Z));if(!z){console.error("CLAUDE.md not found.");return}let J=e2(z),Q=m($);if(J.project?.name)Q.project={...Q.project,name:J.project.name};if(J.project?.goal)Q.project={...Q.project,goal:J.project.goal};if(J.project?.main_language)Q.project={...Q.project,main_language:J.project.main_language};s($,Q),console.log(`${D("◆")} sync CLAUDE.md → .faf ${H("← bi-sync (Trophy-gated)")}`);let Y=W0(Y0(v($)));X0(Y,$)}function XX($,Z,X){let z=m($),J=t7($).mtimeMs,Q=$6(Z)?t7(Z).mtimeMs:0;if(!$6(Z)||J>Q){let Y=nL(z);o7(X,Y),console.log(`${D("◆")} sync .faf → MEMORY.md ${H("← tri-sync")}`)}else console.log(`${D("◆")} sync MEMORY.md → .faf ${H("← tri-sync")}`)}function nL($){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(`
234
234
  `)+`
235
- `}function hL($,Z,X,z){let{watch:J}=T0("fs"),Q=null,Y=()=>{if(Q)clearTimeout(Q);Q=setTimeout(()=>{if(console.log(B("change detected...")),a7($,Z,z),e$())t7($,X,z)},200)};if(J($,Y),a2(Z))J(Z,Y);if(e$()&&a2(X))J(X,Y)}import{writeFileSync as vL}from"fs";m();function e7($,Z={}){let X=$??v();if(!X)console.error(`Error: project.faf not found
235
+ `}function rL($,Z,X,z){let{watch:J}=D0("fs"),Q=null,Y=()=>{if(Q)clearTimeout(Q);Q=setTimeout(()=>{if(console.log(H("change detected...")),$X($,Z,z),z1())XX($,X,z)},200)};if(J($,Y),$6(Z))J(Z,Y);if(z1()&&$6(X))J(X,Y)}import{writeFileSync as sL}from"fs";c();function zX($,Z={}){let X=$??h();if(!X)console.error(`Error: project.faf not found
236
236
 
237
- Run 'faf init' to create one.`),process.exit(2);let z=h(X),J=g2(z),Q=Z.output??X.replace(/\.faf$/,".fafb");vL(Q,J),console.log(`${D("compiled")} ${Q} ${B(`(${J.length} bytes)`)}`)}import{readFileSync as uL}from"fs";function $X($,Z={}){if(!$)console.error("Error: Please specify a .fafb file to decompile."),process.exit(1);let X=new Uint8Array(uL($));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=H7(X);console.log(JSON.stringify(z,null,2))}function ZX($){let Z=[];if(!$||typeof $!=="object")return Z.push("File is not a valid YAML mapping"),{valid:!1,errors:Z};let X=$;if(!X.faf_version)Z.push("Missing required field: faf_version");if(!X.project?.name)Z.push("Missing required field: project.name");if(X.app_type==="about"){if(!X.about?.represents)Z.push("app_type 'about' requires about.represents (owner/repo of the source codebase)");else if(!/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(X.about.represents))Z.push(`about.represents must be "owner/repo" format (got: ${X.about.represents})`);if(X.about?.source_score!==void 0){let z=X.about.source_score;if(typeof z!=="number"||z<0||z>100)Z.push(`about.source_score must be a number 0-100 (got: ${z})`)}}return{valid:Z.length===0,errors:Z}}m();function q3($,Z={}){let X=$??v();if(!X)console.error(`Error: project.faf not found
237
+ Run 'faf init' to create one.`),process.exit(2);let z=v(X),J=c2(z),Q=Z.output??X.replace(/\.faf$/,".fafb");sL(Q,J),console.log(`${D("compiled")} ${Q} ${H(`(${J.length} bytes)`)}`)}import{readFileSync as aL}from"fs";function JX($,Z={}){if(!$)console.error("Error: Please specify a .fafb file to decompile."),process.exit(1);let X=new Uint8Array(aL($));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=M7(X);console.log(JSON.stringify(z,null,2))}function QX($){let Z=[];if(!$||typeof $!=="object")return Z.push("File is not a valid YAML mapping"),{valid:!1,errors:Z};let X=$;if(!X.faf_version)Z.push("Missing required field: faf_version");if(!X.project?.name)Z.push("Missing required field: project.name");if(X.app_type==="about"){if(!X.about?.represents)Z.push("app_type 'about' requires about.represents (owner/repo of the source codebase)");else if(!/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(X.about.represents))Z.push(`about.represents must be "owner/repo" format (got: ${X.about.represents})`);if(X.about?.source_score!==void 0){let z=X.about.source_score;if(typeof z!=="number"||z<0||z>100)Z.push(`about.source_score must be a number 0-100 (got: ${z})`)}}return{valid:Z.length===0,errors:Z}}c();function B3($,Z={}){let X=$??h();if(!X)console.error(`Error: project.faf not found
238
238
 
239
- Run 'faf init' to create one.`),process.exit(2);let z=d(X),J=ZX(z);if(!J.valid){console.log(`${F("invalid")} ${X}`);for(let U of J.errors)console.log(` ${B("x")} ${U}`);process.exit(3)}let Q=h(X);if(!K7(Q))console.log(`${F("invalid yaml")} ${X}`),process.exit(3);console.log(`${D("valid")} ${X}`);let Y=H0(Q);if(X0(Y,X),Z.strict&&Y.score<100)console.log(B(`
240
- --strict requires 100%`)),process.exit(1)}import{join as mL}from"path";function cL($){let Z=[];if(Z.push(P$($)),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(`
241
- `)}function XX($,Z){Y$(mL($,"AGENTS.md"),cL(Z))}import{join as dL}from"path";function pL($){let Z=[];if(Z.push(P$($)),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(`
242
- `)}function zX($,Z){Y$(dL($,".cursorrules"),pL(Z),"# faf:start","# faf:end")}import{join as lL}from"path";function iL($){let Z=[];if(Z.push(P$($)),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(`
243
- `)}function JX($,Z){Y$(lL($,"GEMINI.md"),iL(Z))}import{existsSync as nL,mkdirSync as rL,readFileSync as sL,writeFileSync as QX}from"fs";import{join as YX}from"path";var aL="https://mcpaas.live/grok/mcp/v1",UX="mcp_servers.grok-faf-mcp";function oL($){return[`[${UX}]`,`url = "${aL}"`,""].join(`
244
- `)}function GX($,Z){let X=YX($,".grok"),z=YX(X,"config.toml"),J=oL(Z);if(!nL(z))return rL(X,{recursive:!0}),QX(z,`# grok-faf-mcp — wired by FAF from project.faf
239
+ Run 'faf init' to create one.`),process.exit(2);let z=m(X),J=QX(z);if(!J.valid){console.log(`${I("invalid")} ${X}`);for(let U of J.errors)console.log(` ${H("x")} ${U}`);process.exit(3)}let Q=v(X);if(!N7(Q))console.log(`${I("invalid yaml")} ${X}`),process.exit(3);console.log(`${D("valid")} ${X}`);let Y=H0(Q);if(X0(Y,X),Z.strict&&Y.score<100)console.log(H(`
240
+ --strict requires 100%`)),process.exit(1)}import{join as oL}from"path";function tL($){let Z=[];if(Z.push(n0($)),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(M0(z))Z.push(`- **${A0(`stack.${X}`)}:** ${z.trim()}`)}if($.human_context){Z.push(""),Z.push("## Human Context"),Z.push("");for(let[X,z]of Object.entries($.human_context))if(M0(z))Z.push(`- **${A0(`human_context.${X}`)}:** ${z.trim()}`)}return Z.push(""),Z.join(`
241
+ `)}function YX($,Z){u0(oL($,"AGENTS.md"),tL(Z))}import{join as eL}from"path";function $N($){let Z=[];if(Z.push(n0($)),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(M0(z))Z.push(`# ${A0(`stack.${X}`)}: ${z.trim()}`)}return Z.push(""),Z.join(`
242
+ `)}function UX($,Z){u0(eL($,".cursorrules"),$N(Z),"# faf:start","# faf:end")}import{join as ZN}from"path";function XN($){let Z=[];if(Z.push(n0($)),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(M0(z))Z.push(`- ${A0(`stack.${X}`)}: ${z.trim()}`)}return Z.push(""),Z.join(`
243
+ `)}function GX($,Z){u0(ZN($,"GEMINI.md"),XN(Z))}import{join as WX}from"path";import{mkdirSync as zN}from"fs";var qX=[["install","Install with"],["build","Build with"],["test","Test with"],["lint","Lint with"],["run","Run with"],["start","Start with"],["dev","Run the dev server with"]],JN=new Set([...qX.map(([$])=>$),"cicd"]);function QN($){let Z=[],X=$.project?.name??"Project";if(Z.push(n0($)),Z.push(""),Z.push(`# GitHub Copilot Instructions — ${X}`),Z.push(""),Z.push("> Generated from project.faf by FAF. Copilot reads these instructions on every request in this repository — keep them short and broadly applicable."),Z.push(""),M0($.project?.goal))Z.push($.project.goal.trim()),Z.push("");let z=$.stack??{},J=[];if(M0($.project?.main_language))J.push(`- **Language:** ${$.project.main_language.trim()}`);for(let[W,q]of Object.entries(z)){if(JN.has(W))continue;if(M0(q))J.push(`- **${A0(`stack.${W}`)}:** ${q.trim()}`)}if(J.length>0)Z.push("## Tech stack","",...J,"");let Q=[];for(let[W,q]of qX){let V=z[W];if(M0(V))Q.push(`- ${q} \`${V.trim()}\`.`)}if(M0(z.cicd))Q.push(`- CI runs on ${z.cicd.trim()}.`);if(Q.length>0)Z.push("## Build & run","",...Q,"");let Y=$.human_context??{},G=[["who",Y.who],["what",Y.what],["why",Y.why],["where",Y.where],["when",Y.when],["how",Y.how]].filter(([,W])=>M0(W)).map(([W,q])=>`- **${A0(`human_context.${W}`)}:** ${q.trim()}`);if(G.length>0)Z.push("## Project context","",...G,"");return Z.join(`
244
+ `)}function VX($,Z){zN(WX($,".github"),{recursive:!0}),u0(WX($,".github","copilot-instructions.md"),QN(Z))}import{existsSync as YN,mkdirSync as UN,readFileSync as GN,writeFileSync as KX}from"fs";import{join as HX}from"path";var WN="https://mcpaas.live/grok/mcp/v1",BX="mcp_servers.grok-faf-mcp";function qN($){return[`[${BX}]`,`url = "${WN}"`,""].join(`
245
+ `)}function LX($,Z){let X=HX($,".grok"),z=HX(X,"config.toml"),J=qN(Z);if(!YN(z))return UN(X,{recursive:!0}),KX(z,`# grok-faf-mcp — wired by FAF from project.faf
245
246
 
246
- `+J,"utf-8"),"created";let Q=sL(z,"utf-8");if(Q.includes(`[${UX}]`))return"unchanged";let Y=Q.endsWith(`
247
+ `+J,"utf-8"),"created";let Q=GN(z,"utf-8");if(Q.includes(`[${BX}]`))return"unchanged";let Y=Q.endsWith(`
247
248
 
248
249
  `)?"":Q.endsWith(`
249
250
  `)?`
250
251
  `:`
251
252
 
252
- `;return QX(z,Q+Y+J,"utf-8"),"merged"}m();import{writeFileSync as tL}from"fs";import{join as eL}from"path";var WX=o1.orange,$N=o1.cyan,ZN=o1.cyanDeep,XN="#FF9500",zN="#FF3B30",JN="#E6EDF3",QN="#6E7681",qX={TROPHY:{glyph:"\uD83C\uDFC6",color:WX},GOLD:{glyph:"★",color:WX},SILVER:{glyph:"◆",color:$N},BRONZE:{glyph:"◇",color:ZN},GREEN:{glyph:"●",color:JN},YELLOW:{glyph:"●",color:XN},RED:{glyph:"○",color:zN},WHITE:{glyph:"♡",color:QN}};function $1($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var VX=["who","what","why","where","when","how"];function o2($){return $.filter(([,Z])=>Z!==void 0&&Z!==null&&String(Z).trim()!=="").map(([Z,X])=>`<div class="row"><div class="k">${$1(Z)}</div><div class="v">${$1(X)}</div></div>`).join(`
253
- `)}function YN($,Z,X="project.faf"){let z=$1($.project?.name??"Project"),J=Z.tier?.name??"WHITE",Q=qX[J]??qX.WHITE,Y=Z.inherited?Z.represents?`inherited from ${$1(Z.represents)}`:"inherited":`${Z.score}%`,U=J==="TROPHY"&&!Z.inherited,G=$.human_context??{},W=VX.map((N)=>[N,G[N]]),q=Object.entries(G).filter(([N])=>!VX.includes(N)),V=[["goal",$.project?.goal],["main_language",$.project?.main_language],["type",$.project?.type],["framework",$.project?.framework],["faf_version",$.faf_version]],K=Object.entries($.stack??{}),H=K.filter(([,N])=>N&&N!=="slotignored"&&String(N).trim()!==""),T=K.filter(([,N])=>N==="slotignored").length;return`<!DOCTYPE html>
253
+ `;return KX(z,Q+Y+J,"utf-8"),"merged"}c();import{writeFileSync as VN}from"fs";import{join as KN}from"path";var NX=X4.orange,HN=X4.cyan,BN=X4.cyanDeep,LN="#FF9500",NN="#FF3B30",MN="#E6EDF3",ON="#6E7681",MX={TROPHY:{glyph:"\uD83C\uDFC6",color:NX},GOLD:{glyph:"★",color:NX},SILVER:{glyph:"◆",color:HN},BRONZE:{glyph:"◇",color:BN},GREEN:{glyph:"●",color:MN},YELLOW:{glyph:"●",color:LN},RED:{glyph:"○",color:NN},WHITE:{glyph:"♡",color:ON}};function J1($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var OX=["who","what","why","where","when","how"];function Z6($){return $.filter(([,Z])=>Z!==void 0&&Z!==null&&String(Z).trim()!=="").map(([Z,X])=>`<div class="row"><div class="k">${J1(Z)}</div><div class="v">${J1(X)}</div></div>`).join(`
254
+ `)}function TN($,Z,X="project.faf"){let z=J1($.project?.name??"Project"),J=Z.tier?.name??"WHITE",Q=MX[J]??MX.WHITE,Y=Z.inherited?Z.represents?`inherited from ${J1(Z.represents)}`:"inherited":`${Z.score}%`,U=J==="TROPHY"&&!Z.inherited,G=$.human_context??{},W=OX.map((N)=>[N,G[N]]),q=Object.entries(G).filter(([N])=>!OX.includes(N)),V=[["goal",$.project?.goal],["main_language",$.project?.main_language],["type",$.project?.type],["framework",$.project?.framework],["faf_version",$.faf_version]],K=Object.entries($.stack??{}),B=K.filter(([,N])=>N&&N!=="slotignored"&&String(N).trim()!==""),T=K.filter(([,N])=>N==="slotignored").length;return`<!DOCTYPE html>
254
255
  <html lang="en">
255
256
  <head>
256
257
  <meta charset="UTF-8">
@@ -291,7 +292,7 @@ footer strong{color:#e6edf3}
291
292
  <div class="eyebrow">project.faf · visual render</div>
292
293
  <header>
293
294
  <h1>${z}</h1>
294
- <span class="badge">${Q.glyph} ${$1(J)}</span>
295
+ <span class="badge">${Q.glyph} ${J1(J)}</span>
295
296
  <span class="score">${Y}</span>
296
297
  </header>
297
298
  <div class="meter"><span></span></div>
@@ -299,62 +300,62 @@ ${U?'<p class="award statline"><span class="awd-pre">✅ All Required slots fill
299
300
 
300
301
  <section>
301
302
  <h2>The 6 W's</h2>
302
- ${o2(W)||'<p class="muted">No human_context yet.</p>'}
303
- ${q.length?o2(q):""}
303
+ ${Z6(W)||'<p class="muted">No human_context yet.</p>'}
304
+ ${q.length?Z6(q):""}
304
305
  </section>
305
306
 
306
307
  <section>
307
308
  <h2>Project</h2>
308
- ${o2(V)||'<p class="muted">—</p>'}
309
+ ${Z6(V)||'<p class="muted">—</p>'}
309
310
  </section>
310
311
 
311
312
  <section>
312
313
  <h2>Stack</h2>
313
- ${H.length?o2(H):'<p class="muted">No active stack slots.</p>'}
314
+ ${B.length?Z6(B):'<p class="muted">No active stack slots.</p>'}
314
315
  </section>
315
316
 
316
317
  <footer>
317
- Rendered on-demand from your current <strong>${$1(X)}</strong><br>
318
+ Rendered on-demand from your current <strong>${J1(X)}</strong><br>
318
319
  <strong>Humans like visuals. <span style="color:#00D4D4">We gave them one.</span></strong>
319
320
  </footer>
320
321
  </div>
321
322
  </body>
322
323
  </html>
323
- `}function t2($,Z,X,z="project.faf"){tL(eL($,"project.html"),YN(Z,X,z),"utf-8")}import{writeFileSync as UN}from"fs";import{join as GN}from"path";var KX="application/vnd.faf+yaml",WN="https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json",qN=/^[a-zA-Z0-9.-]+\/[a-zA-Z0-9._-]+$/;function VN($){let Z=String($.project?.name??"project").trim();if(Z.includes("/")&&qN.test(Z))return Z;let X=$.project?.homepage??$.project?.website??$.project?.url,z="local";if(X)try{z=new URL(X).hostname.replace(/^www\./,"").split(".").reverse().join(".")}catch{}let J=Z.replace(/[^a-zA-Z0-9._-]/g,"-").replace(/^-+|-+$/g,"")||"project";return`${z}/${J}`}function KN($){let Z=String($.project?.goal??$.context??$.project?.name??"MCP server").replace(/\s+/g," ").trim();if(!Z)return"MCP server";return Z.length<=100?Z:Z.slice(0,97).trimEnd()+"..."}function HN($,Z={}){return{faf:Z.fafPointer??"./project.faf",mediaType:KX,iana:`https://www.iana.org/assignments/media-types/${KX}`,deterministic:!0,...Z.scoreEndpoint?{scoreEndpoint:Z.scoreEndpoint}:{},generated:$.generated??Z.now??new Date().toISOString()}}function BN($,Z={}){let X={$schema:WN,name:VN($),version:String($.project?.version??"0.1.0"),description:KN($)},z=$.project?.name;if(z&&z.length<=100)X.title=z;let J=$.project?.homepage??$.project?.website??$.project?.url;if(J)X.websiteUrl=J;if(Z.remoteUrl)X.remotes=[{type:"streamable-http",url:Z.remoteUrl}];return X._meta={"one.faf/context":HN($,Z)},X}function HX($,Z,X={}){let z=BN(Z,X),J=GN($,"server-card");return UN(J,JSON.stringify(z,null,2)+`
324
- `,"utf-8"),J}m();function Z1($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
324
+ `}function X6($,Z,X,z="project.faf"){VN(KN($,"project.html"),TN(Z,X,z),"utf-8")}import{writeFileSync as DN}from"fs";import{join as IN}from"path";var TX="application/vnd.faf+yaml",AN="https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json",RN=/^[a-zA-Z0-9.-]+\/[a-zA-Z0-9._-]+$/;function FN($){let Z=String($.project?.name??"project").trim();if(Z.includes("/")&&RN.test(Z))return Z;let X=$.project?.homepage??$.project?.website??$.project?.url,z="local";if(X)try{z=new URL(X).hostname.replace(/^www\./,"").split(".").reverse().join(".")}catch{}let J=Z.replace(/[^a-zA-Z0-9._-]/g,"-").replace(/^-+|-+$/g,"")||"project";return`${z}/${J}`}function wN($){let Z=String($.project?.goal??$.context??$.project?.name??"MCP server").replace(/\s+/g," ").trim();if(!Z)return"MCP server";return Z.length<=100?Z:Z.slice(0,97).trimEnd()+"..."}function PN($,Z={}){return{faf:Z.fafPointer??"./project.faf",mediaType:TX,iana:`https://www.iana.org/assignments/media-types/${TX}`,deterministic:!0,...Z.scoreEndpoint?{scoreEndpoint:Z.scoreEndpoint}:{},generated:$.generated??Z.now??new Date().toISOString()}}function _N($,Z={}){let X={$schema:AN,name:FN($),version:String($.project?.version??"0.1.0"),description:wN($)},z=$.project?.name;if(z&&z.length<=100)X.title=z;let J=$.project?.homepage??$.project?.website??$.project?.url;if(J)X.websiteUrl=J;if(Z.remoteUrl)X.remotes=[{type:"streamable-http",url:Z.remoteUrl}];return X._meta={"one.faf/context":PN($,Z)},X}function DX($,Z,X={}){let z=_N(Z,X),J=IN($,"server-card");return DN(J,JSON.stringify(z,null,2)+`
325
+ `,"utf-8"),J}c();function Q1($={}){let Z=h();if(!Z)console.error(`Error: project.faf not found
325
326
 
326
- Run 'faf init' to create one.`),process.exit(2);let X=process.cwd(),z=d(Z),J=$.all||!$.agents&&!$.cursor&&!$.gemini&&!$.grok&&!$.conductor&&!$.html&&!$.card;if(J||$.agents)XX(X,z),console.log(" AGENTS.md");if(J||$.cursor)zX(X,z),console.log(" .cursorrules");if(J||$.gemini)JX(X,z),console.log(" GEMINI.md");if($.grok){let Y=GX(X,z);console.log(` .grok/config.toml (${Y})`)}if(J||$.html){let Y=H0(h(Z));t2(X,z,Y,Z),console.log(" project.html")}let Q=z.app_type==="server-card"||z.project?.type==="server-card";if($.card||J&&Q){let Y=HX(X,z);console.log(` ${Y.replace(`${X}/`,"")}`)}console.log(`${D("exported")} ${B(`from ${Z}`)}`)}import{join as LN}from"path";import NN from"open";m();function MN($){if(process.env.CI)return!1;try{return NN($).catch(()=>{return}),!0}catch{return!1}}function BX(){let $=v();if(!$)console.error(`Error: project.faf not found
327
+ Run 'faf init' to create one.`),process.exit(2);let X=process.cwd(),z=m(Z),J=$.all||!$.agents&&!$.cursor&&!$.gemini&&!$.copilot&&!$.grok&&!$.conductor&&!$.html&&!$.card;if(J||$.agents)YX(X,z),console.log(" AGENTS.md");if(J||$.cursor)UX(X,z),console.log(" .cursorrules");if(J||$.gemini)GX(X,z),console.log(" GEMINI.md");if(J||$.copilot)VX(X,z),console.log(" .github/copilot-instructions.md");if($.grok){let Y=LX(X,z);console.log(` .grok/config.toml (${Y})`)}if(J||$.html){let Y=H0(v(Z));X6(X,z,Y,Z),console.log(" project.html")}let Q=z.app_type==="server-card"||z.project?.type==="server-card";if($.card||J&&Q){let Y=DX(X,z);console.log(` ${Y.replace(`${X}/`,"")}`)}console.log(`${D("exported")} ${H(`from ${Z}`)}`)}import{join as CN}from"path";import EN from"open";c();function jN($){if(process.env.CI)return!1;try{return EN($).catch(()=>{return}),!0}catch{return!1}}function IX(){let $=h();if(!$)console.error(`Error: project.faf not found
327
328
 
328
- Run 'faf init' to create one.`),process.exit(2);let Z=process.cwd(),X=d($),z=H0(h($));t2(Z,X,z,$);let J=LN(Z,"project.html"),Q=MN(J);console.log(" project.html"),console.log(Q?`${D("opened")} ${B("in your browser")}`:`${D("rendered")} ${B(`file://${J}`)}`)}import{mkdirSync as ON,rmSync as TN}from"fs";import{join as LX}from"path";import{execSync as DN}from"child_process";import{tmpdir as IN}from"os";m();function NX($){if(!$)console.error(`Error: Please provide a GitHub URL.
329
+ Run 'faf init' to create one.`),process.exit(2);let Z=process.cwd(),X=m($),z=H0(v($));X6(Z,X,z,$);let J=CN(Z,"project.html"),Q=jN(J);console.log(" project.html"),console.log(Q?`${D("opened")} ${H("in your browser")}`:`${D("rendered")} ${H(`file://${J}`)}`)}import{mkdirSync as SN,rmSync as bN}from"fs";import{join as AX}from"path";import{execFileSync as xN}from"child_process";import{tmpdir as kN}from"os";c();function yN($){let Z=($??"").trim();if(!Z)throw Error("Please provide a GitHub URL.");if(/[\s;&|`$(){}<>\\^'"!*?[\]]/.test(Z))throw Error(`Refusing unsafe URL: ${JSON.stringify($)}`);let X=Z.replace(/\/+$/,"").replace(/\.git$/i,""),z=X.match(/^(?:github\.com\/)?([A-Za-z0-9][A-Za-z0-9._-]*)\/([A-Za-z0-9][A-Za-z0-9._-]*)$/);if(z)return`https://github.com/${z[1]}/${z[2]}.git`;if(/^https?:\/\/[A-Za-z0-9._\-/:@~%]+$/.test(X))return`${X}.git`;throw Error(`Not a recognized GitHub repo URL: ${JSON.stringify($)}`)}function RX($){let Z;try{Z=yN($)}catch(z){console.error(`Error: ${z.message}
329
330
 
330
- Usage: faf git <url>`),process.exit(1);let Z=$.endsWith(".git")?$:`${$}.git`,X=LX(IN(),`faf-git-${Date.now()}`);ON(X,{recursive:!0});try{console.log(B(`cloning ${$}...`));try{DN(`git clone --depth 1 ${Z} ${X}`,{stdio:"pipe"})}catch(U){let W=(U?.stderr?.toString()??"").trim().split(`
331
+ Usage: faf git <url>`),process.exit(1)}let X=AX(kN(),`faf-git-${Date.now()}`);SN(X,{recursive:!0});try{console.log(H(`cloning ${$}...`));try{xN("git",["clone","--depth","1","--",Z,X],{stdio:"pipe"})}catch(U){let W=(U?.stderr?.toString()??"").trim().split(`
331
332
  `).slice(-2).join(" ").trim()||"git clone failed";console.error(`Error: could not clone ${$}
332
333
 
333
- ${W}`),process.exit(1)}let z=o$(X),J=LX(process.cwd(),"project.faf");s(J,z),console.log(`${D("created")} ${J}`);let Q=h(J),Y=W0(Y0(Q));X0(Y,J)}finally{TN(X,{recursive:!0,force:!0})}}m();function MX($={}){if($.version||Object.keys($).length===0)RN()}function RN(){let $=V3();console.log(`${D(F("faf"))} v${$.version}`),console.log(B(`kernel ${B7()} IANA application/vnd.faf+yaml`))}var $4=[{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"}];m();function OX(){console.log(`${D("formats")} ${B("— supported file types")}
334
- `);let $=new Map;for(let Z of $4){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} ${B(z.extensions.join(", "))}`);console.log()}console.log(B(` ${$4.length} formats across ${$.size} categories`))}m();import{readdirSync as FN,rmSync as wN}from"fs";import{tmpdir as PN}from"os";import{join as _N}from"path";function TX(){let $=PN(),Z=0;try{let X=FN($);for(let z of X)if(z.startsWith("faf-git-"))wN(_N($,z),{recursive:!0,force:!0}),Z++}catch{}if(Z>0)console.log(`${D("cleared")} ${Z} cached director${Z===1?"y":"ies"}`);else console.log(B("nothing to clear"))}function DX($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
334
+ ${W}`),process.exit(1)}let z=Z1(X),J=AX(process.cwd(),"project.faf");s(J,z),console.log(`${D("created")} ${J}`);let Q=v(J),Y=W0(Y0(Q));X0(Y,J)}finally{bN(X,{recursive:!0,force:!0})}}c();function FX($={}){if($.version||Object.keys($).length===0)gN()}function gN(){let $=L3();console.log(`${D(I("faf"))} v${$.version}`),console.log(H(`kernel ${O7()} IANA application/vnd.faf+yaml`))}var Q4=[{name:"HTML",extensions:[".html",".htm"],category:"web"},{name:"CSS",extensions:[".css"],category:"web"},{name:"JavaScript",extensions:[".js",".mjs",".cjs"],category:"web"},{name:"TypeScript",extensions:[".ts",".tsx",".mts",".cts"],category:"web"},{name:"JSX",extensions:[".jsx"],category:"web"},{name:"Vue",extensions:[".vue"],category:"web"},{name:"Svelte",extensions:[".svelte"],category:"web"},{name:"Astro",extensions:[".astro"],category:"web"},{name:"JSON",extensions:[".json"],category:"data"},{name:"YAML",extensions:[".yml",".yaml"],category:"data"},{name:"TOML",extensions:[".toml"],category:"data"},{name:"XML",extensions:[".xml"],category:"data"},{name:"CSV",extensions:[".csv"],category:"data"},{name:"INI",extensions:[".ini",".cfg"],category:"config"},{name:"Env",extensions:[".env"],category:"config"},{name:"Dockerfile",extensions:["Dockerfile"],category:"config"},{name:"Rust",extensions:[".rs"],category:"systems"},{name:"Go",extensions:[".go"],category:"systems"},{name:"C",extensions:[".c",".h"],category:"systems"},{name:"C++",extensions:[".cpp",".cc",".hpp"],category:"systems"},{name:"Zig",extensions:[".zig"],category:"systems"},{name:"Python",extensions:[".py"],category:"scripting"},{name:"Ruby",extensions:[".rb"],category:"scripting"},{name:"Shell",extensions:[".sh",".bash",".zsh"],category:"scripting"},{name:"Lua",extensions:[".lua"],category:"scripting"},{name:"Java",extensions:[".java"],category:"jvm"},{name:"Kotlin",extensions:[".kt",".kts"],category:"jvm"},{name:"Scala",extensions:[".scala"],category:"jvm"},{name:"C#",extensions:[".cs"],category:"dotnet"},{name:"F#",extensions:[".fs"],category:"dotnet"},{name:"Swift",extensions:[".swift"],category:"mobile"},{name:"Dart",extensions:[".dart"],category:"mobile"},{name:"Markdown",extensions:[".md",".mdx"],category:"docs"},{name:"LaTeX",extensions:[".tex"],category:"docs"},{name:"reStructuredText",extensions:[".rst"],category:"docs"},{name:"FAF",extensions:[".faf"],category:"faf"},{name:"FAFb",extensions:[".fafb"],category:"faf"}];c();function wX(){console.log(`${D("formats")} ${H("— supported file types")}
335
+ `);let $=new Map;for(let Z of Q4){let X=$.get(Z.category)??[];X.push(Z),$.set(Z.category,X)}for(let[Z,X]of $){console.log(` ${I(Z)}`);for(let z of X)console.log(` ${z.name} ${H(z.extensions.join(", "))}`);console.log()}console.log(H(` ${Q4.length} formats across ${$.size} categories`))}c();import{readdirSync as vN,rmSync as hN}from"fs";import{tmpdir as uN}from"os";import{join as mN}from"path";function PX(){let $=uN(),Z=0;try{let X=vN($);for(let z of X)if(z.startsWith("faf-git-"))hN(mN($,z),{recursive:!0,force:!0}),Z++}catch{}if(Z>0)console.log(`${D("cleared")} ${Z} cached director${Z===1?"y":"ies"}`);else console.log(H("nothing to clear"))}function _X($={}){let Z=h();if(!Z)console.error(`Error: project.faf not found
335
336
 
336
- Run 'faf init' to create one.`),process.exit(2);if($.json){let X=d(Z);console.log(JSON.stringify(X,null,2))}else{let X=h(Z);console.log(X)}}m();function IX(){let $=v();if(!$)console.error(`Error: project.faf not found
337
+ Run 'faf init' to create one.`),process.exit(2);if($.json){let X=m(Z);console.log(JSON.stringify(X,null,2))}else{let X=v(Z);console.log(X)}}c();function CX(){let $=h();if(!$)console.error(`Error: project.faf not found
337
338
 
338
- Run 'faf init' to create one.`),process.exit(2);let Z=d($),X=[];for(let z of $0){let[J,Q]=z.path.split("."),U=Z[J]?.[Q];if(S0(U)||U==="slotignored")continue;X.push(`${z.path}: ${U}`)}if(X.length===0){console.log(B("no populated slots"));return}console.log(X.join(`
339
- `))}import{existsSync as CN,statSync as AX}from"fs";import{join as EN}from"path";m();var jN=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"];function RX(){let $=v();if(!$)console.error(`Error: project.faf not found
339
+ Run 'faf init' to create one.`),process.exit(2);let Z=m($),X=[];for(let z of $0){let[J,Q]=z.path.split("."),U=Z[J]?.[Q];if(x0(U)||U==="slotignored")continue;X.push(`${z.path}: ${U}`)}if(X.length===0){console.log(H("no populated slots"));return}console.log(X.join(`
340
+ `))}import{existsSync as cN,statSync as EX}from"fs";import{join as dN}from"path";c();var pN=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"];function jX(){let $=h();if(!$)console.error(`Error: project.faf not found
340
341
 
341
- Run 'faf init' to create one.`),process.exit(2);let Z=process.cwd(),X=AX($).mtimeMs;console.log(`${D("drift")} ${B("— context file sync status")}
342
- `),console.log(` ${F(".faf")} ${B(K3(X))}`);let z=0;for(let J of jN){let Q=EN(Z,J);if(!CN(Q)){console.log(` ${B("○")} ${J} ${B("missing")}`);continue}let Y=AX(Q).mtimeMs,U=Y-X;if(Math.abs(U)<1000)console.log(` ${D("●")} ${J} ${B("in sync")}`);else if(U>0)console.log(` ${F("!")} ${J} ${F("newer")} ${B(K3(Y))}`),z++;else console.log(` ${B("○")} ${J} ${B("older")} ${B(K3(Y))}`),z++}if(z>0)console.log(B(`
343
- run ${F("'faf sync'")} to resolve drift`))}function K3($){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`}m();function FX($,Z){if(!$||Z===void 0)console.error(`Usage: faf edit <path> <value>
342
+ Run 'faf init' to create one.`),process.exit(2);let Z=process.cwd(),X=EX($).mtimeMs;console.log(`${D("drift")} ${H("— context file sync status")}
343
+ `),console.log(` ${I(".faf")} ${H(N3(X))}`);let z=0;for(let J of pN){let Q=dN(Z,J);if(!cN(Q)){console.log(` ${H("○")} ${J} ${H("missing")}`);continue}let Y=EX(Q).mtimeMs,U=Y-X;if(Math.abs(U)<1000)console.log(` ${D("●")} ${J} ${H("in sync")}`);else if(U>0)console.log(` ${I("!")} ${J} ${I("newer")} ${H(N3(Y))}`),z++;else console.log(` ${H("○")} ${J} ${H("older")} ${H(N3(Y))}`),z++}if(z>0)console.log(H(`
344
+ run ${I("'faf sync'")} to resolve drift`))}function N3($){let Z=Date.now()-$,X=Math.floor(Z/1000);if(X<60)return`${X}s ago`;let z=Math.floor(X/60);if(z<60)return`${z}m ago`;let J=Math.floor(z/60);if(J<24)return`${J}h ago`;return`${Math.floor(J/24)}d ago`}c();function SX($,Z){if(!$||Z===void 0)console.error(`Usage: faf edit <path> <value>
344
345
 
345
- Example: faf edit project.name "My Project"`),process.exit(1);let X=v();if(!X)console.error(`Error: project.faf not found
346
+ Example: faf edit project.name "My Project"`),process.exit(1);let X=h();if(!X)console.error(`Error: project.faf not found
346
347
 
347
- Run 'faf init' to create one.`),process.exit(2);let z=d(X),J=$.split(".");if(J.length!==2)console.error("Error: path must be section.field (e.g. project.name)"),process.exit(1);let[Q,Y]=J;if(!z[Q]||typeof z[Q]!=="object")z[Q]={};z[Q][Y]=Z,s(X,z),console.log(`${D("updated")} ${$} ${B("→")} ${Z}`)}import{existsSync as e2,readFileSync as H3}from"fs";import{join as Z4}from"path";m();function wX(){let $=process.cwd(),Z=[],X={faf_version:"2.5.0",project:{}},z=Z4($,"CLAUDE.md");if(e2(z)){let G=H3(z,"utf-8"),W=s2(G);if(W.project?.name)X.project.name=W.project.name;if(W.project?.goal)X.project.goal=W.project.goal;if(W.project?.main_language)X.project.main_language=W.project.main_language;Z.push("CLAUDE.md")}let J=Z4($,"AGENTS.md");if(e2(J)){let G=H3(J,"utf-8");if(!X.project.name){let W=G.match(/^#\s+(.+)/m);if(W)X.project.name=W[1].trim()}Z.push("AGENTS.md")}let Q=Z4($,"GEMINI.md");if(e2(Q)){let G=H3(Q,"utf-8");if(!X.project.name){let W=G.match(/^#\s+(.+)/m);if(W)X.project.name=W[1].trim()}Z.push("GEMINI.md")}let Y=Z4($,".cursorrules");if(e2(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 U=v($);if(U){let G=d(U);if(!G.project)G.project={};if(X.project.name&&!G.project.name)G.project.name=X.project.name;if(X.project.goal&&!G.project.goal)G.project.goal=X.project.goal;if(X.project.main_language&&!G.project.main_language)G.project.main_language=X.project.main_language;s(U,G),console.log(`${D("◆")} recover merged into ${U}`)}else{let G=Z4($,"project.faf");s(G,X),console.log(`${D("◆")} recover created ${G}`)}console.log(B(` sources: ${Z.join(", ")}`))}m();var X4="2.5.0";function PX($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
348
+ Run 'faf init' to create one.`),process.exit(2);let z=m(X),J=$.split(".");if(J.length!==2)console.error("Error: path must be section.field (e.g. project.name)"),process.exit(1);let[Q,Y]=J;if(!z[Q]||typeof z[Q]!=="object")z[Q]={};z[Q][Y]=Z,s(X,z),console.log(`${D("updated")} ${$} ${H("→")} ${Z}`)}import{existsSync as z6,readFileSync as M3}from"fs";import{join as Y4}from"path";c();function bX(){let $=process.cwd(),Z=[],X={faf_version:"2.5.0",project:{}},z=Y4($,"CLAUDE.md");if(z6(z)){let G=M3(z,"utf-8"),W=e2(G);if(W.project?.name)X.project.name=W.project.name;if(W.project?.goal)X.project.goal=W.project.goal;if(W.project?.main_language)X.project.main_language=W.project.main_language;Z.push("CLAUDE.md")}let J=Y4($,"AGENTS.md");if(z6(J)){let G=M3(J,"utf-8");if(!X.project.name){let W=G.match(/^#\s+(.+)/m);if(W)X.project.name=W[1].trim()}Z.push("AGENTS.md")}let Q=Y4($,"GEMINI.md");if(z6(Q)){let G=M3(Q,"utf-8");if(!X.project.name){let W=G.match(/^#\s+(.+)/m);if(W)X.project.name=W[1].trim()}Z.push("GEMINI.md")}let Y=Y4($,".cursorrules");if(z6(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 U=h($);if(U){let G=m(U);if(!G.project)G.project={};if(X.project.name&&!G.project.name)G.project.name=X.project.name;if(X.project.goal&&!G.project.goal)G.project.goal=X.project.goal;if(X.project.main_language&&!G.project.main_language)G.project.main_language=X.project.main_language;s(U,G),console.log(`${D("◆")} recover merged into ${U}`)}else{let G=Y4($,"project.faf");s(G,X),console.log(`${D("◆")} recover created ${G}`)}console.log(H(` sources: ${Z.join(", ")}`))}c();var U4="2.5.0";function xX($={}){let Z=h();if(!Z)console.error(`Error: project.faf not found
348
349
 
349
- Run 'faf init' to create one.`),process.exit(2);let X=d(Z),z=X.faf_version??"unknown";if(z===X4){console.log(`${D("◆")} migrate already at v${X4}`);return}if(X.faf_version=X4,!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(`${D("◆")} migrate ${B("(dry run)")} v${z} → v${X4}`),console.log(B(` would update ${Z}`));return}s(Z,X),console.log(`${D("◆")} migrate v${z} → v${X4}`),console.log(B(` updated ${Z}`))}m();function _X($){if($==="features")bN();else if($==="activate")xN();else SN()}function SN(){let $=e$();if(console.log(`${D("pro")} ${B("— FAF Pro status")}
350
- `),console.log(` Status: ${$?K0(F("PRO")):F("Free")}`),console.log(""),!$)console.log(B(" Upgrade: faf pro activate"))}function bN(){console.log(`${D("pro")} ${B("— Pro features")}
351
- `);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(` ${D("◆")} ${F(Z)} ${B("—")} ${X}`);console.log("")}function xN(){console.log(`${D("pro")} ${B("— activate")}
352
- `),console.log(" Set FAF_PRO=1 in your environment to enable Pro features."),console.log(""),console.log(B(" export FAF_PRO=1")),console.log(""),console.log(B(" Visit: https://faf.one/pro")),import("open").then(({default:$})=>$("https://faf.one/pro")).catch(()=>{})}import{gzipSync as kN}from"zlib";m();function CX($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
350
+ Run 'faf init' to create one.`),process.exit(2);let X=m(Z),z=X.faf_version??"unknown";if(z===U4){console.log(`${D("◆")} migrate already at v${U4}`);return}if(X.faf_version=U4,!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(`${D("◆")} migrate ${H("(dry run)")} v${z} → v${U4}`),console.log(H(` would update ${Z}`));return}s(Z,X),console.log(`${D("◆")} migrate v${z} → v${U4}`),console.log(H(` updated ${Z}`))}c();function kX($){if($==="features")iN();else if($==="activate")nN();else lN()}function lN(){let $=z1();if(console.log(`${D("pro")} ${H("— FAF Pro status")}
351
+ `),console.log(` Status: ${$?K0(I("PRO")):I("Free")}`),console.log(""),!$)console.log(H(" Upgrade: faf pro activate"))}function iN(){console.log(`${D("pro")} ${H("— Pro features")}
352
+ `);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(` ${D("◆")} ${I(Z)} ${H("—")} ${X}`);console.log("")}function nN(){console.log(`${D("pro")} ${H("— activate")}
353
+ `),console.log(" Set FAF_PRO=1 in your environment to enable Pro features."),console.log(""),console.log(H(" export FAF_PRO=1")),console.log(""),console.log(H(" Visit: https://faf.one/pro")),import("open").then(({default:$})=>$("https://faf.one/pro")).catch(()=>{})}import{gzipSync as rN}from"zlib";c();function yX($={}){let Z=h();if(!Z)console.error(`Error: project.faf not found
353
354
 
354
- Run 'faf init' to create one.`),process.exit(2);let X=h(Z),J=kN(Buffer.from(X)).toString("base64url");if($.raw){console.log(J);return}let Q=`https://faf.one/share?d=${J}`;if(console.log(`${D("◆")} share ${B(Z)}
355
- `),console.log(` ${Q}`),$.copy)try{let{execSync:Y}=T0("child_process"),U=process.platform;if(U==="darwin")Y("pbcopy",{input:Q});else if(U==="linux")Y("xclip -selection clipboard",{input:Q});console.log(B(`
356
- copied to clipboard`))}catch{console.log(B(`
357
- copy failed — install xclip or pbcopy`))}}import{mkdirSync as yN,writeFileSync as fN,rmSync as gN}from"fs";import{tmpdir as hN}from"os";import{join as EX}from"path";m();function jX(){let $=EX(hN(),`faf-demo-${Date.now()}`);yN($,{recursive:!0}),console.log(`${D("demo")} ${B("— FAF in action")}
355
+ Run 'faf init' to create one.`),process.exit(2);let X=v(Z),J=rN(Buffer.from(X)).toString("base64url");if($.raw){console.log(J);return}let Q=`https://faf.one/share?d=${J}`;if(console.log(`${D("◆")} share ${H(Z)}
356
+ `),console.log(` ${Q}`),$.copy)try{let{execSync:Y}=D0("child_process"),U=process.platform;if(U==="darwin")Y("pbcopy",{input:Q});else if(U==="linux")Y("xclip -selection clipboard",{input:Q});console.log(H(`
357
+ copied to clipboard`))}catch{console.log(H(`
358
+ copy failed — install xclip or pbcopy`))}}import{mkdirSync as sN,writeFileSync as aN,rmSync as oN}from"fs";import{tmpdir as tN}from"os";import{join as fX}from"path";c();function gX(){let $=fX(tN(),`faf-demo-${Date.now()}`);sN($,{recursive:!0}),console.log(`${D("demo")} ${H("— FAF in action")}
358
359
  `);let Z=`faf_version: 2.5.0
359
360
  project:
360
361
  name: acme-app
@@ -380,25 +381,62 @@ human_context:
380
381
  where: Cloud (Vercel + AWS)
381
382
  when: "2026"
382
383
  how: Agile sprints with CI/CD
383
- `,X=EX($,"project.faf");fN(X,Z),console.log(` ${F("1.")} Created sample project.faf`),console.log(B(` ${X}
384
- `)),console.log(` ${F("2.")} Scoring...`);let z=W0(Y0(h(X)));console.log(""),X0(z,"project.faf",!0),gN($,{recursive:!0,force:!0}),console.log(`
385
- ${B(' Demo complete. Run "faf init" in your project to get started.')}`)}m();function SX($,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=$0.filter((Y)=>Y.path.toLowerCase().includes(X)||Y.description.toLowerCase().includes(X)||Y.category.toLowerCase().includes(X));if(Q.length>0){console.log(`${D("slots")} ${B(`— ${Q.length} match${Q.length===1?"":"es"}`)}
386
- `);for(let Y of Q)console.log(` ${F(`#${Y.index}`)} ${Y.path} ${B("—")} ${Y.description} ${B(`[${Y.category}]`)}`);console.log(""),J+=Q.length}}if(z||Z.formats){let Q=$4.filter((Y)=>Y.name.toLowerCase().includes(X)||Y.extensions.some((U)=>U.toLowerCase().includes(X))||Y.category.toLowerCase().includes(X));if(Q.length>0){console.log(`${D("formats")} ${B(`— ${Q.length} match${Q.length===1?"":"es"}`)}
387
- `);for(let Y of Q)console.log(` ${F(Y.name)} ${B(Y.extensions.join(", "))} ${B(`[${Y.category}]`)}`);console.log(""),J+=Q.length}}if(J===0)console.log(B(` No results for "${$}"`))}import{writeFileSync as vN}from"fs";m();function bX($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
388
-
389
- Run 'faf init' to create one.`),process.exit(2);let X=d(Z),z=h(Z),J=H0(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)vN($.output,Y,"utf-8"),console.log(`${D("◆")} taf receipt written to ${$.output}`);else console.log(Y)}import{createInterface as uN}from"readline";import{existsSync as xX,readFileSync as mN,writeFileSync as cN,unlinkSync as dN}from"fs";import{join as pN}from"path";m();var lN=".faf-session.json";function iN($,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 nN($,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 kX($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
390
-
391
- Run 'faf init' to create one.`),process.exit(2);let X=process.cwd(),z=pN(X,lN),J=0;if($.resume&&xX(z))try{J=JSON.parse(mN(z,"utf-8")).slotIndex,console.log(B(` resuming from slot #${J+1}`))}catch{}let Q=d(Z),Y=$0.filter((H)=>{let T=iN(Q,H.path);return S0(T)&&T!=="slotignored"});if(Y.length===0){console.log(`${D("◆")} go all slots populated — \uD83C\uDFC6 Trophy`);let H=W0(Y0(h(Z)));X0(H,Z);return}console.log(`${D("go")} ${B("— guided interview to \uD83C\uDFC6 Trophy")}`);let U=Y.length===1?"slot":"slots";console.log(B(` ${Y.length} ${U} from Trophy. Enter a value, "skip" to skip, or "quit" to stop.
392
- `));let G=uN({input:process.stdin,output:process.stdout}),W=(H)=>new Promise((T)=>G.question(H,T)),q=0,V=Y.slice(J);for(let H=0;H<V.length;H++){let T=V[H],N=await W(` ${F(`#${T.index}`)} ${n2(T.path)} ${B(`(${T.path})`)}: `);if(N.toLowerCase()==="quit"){let M={slotIndex:J+H,fafPath:Z};cN(z,JSON.stringify(M),"utf-8"),console.log(B(`
393
- session saved. Resume with: faf go --resume`));break}if(N.toLowerCase()==="skip"||N.trim()==="")continue;nN(Q,T.path,N.trim()),q++}if(G.close(),q>0)s(Z,Q),console.log(`
394
- ${D("◆")} go filled ${q} slot${q===1?"":"s"}`);let K=W0(Y0(h(Z)));if(X0(K,Z),xX(z))try{dN(z)}catch{}}m();var pM=[/^(tbd|see\s+readme|todo|fixme|coming\s+soon|n\/a|unknown|none|null|not\s+specified)\b/i,/^(software|application|app|project|tool|library|framework)\.?$/i,/^(for\s+(users|developers|teams|engineers))\.?$/i,/^(general\s+purpose|various|multiple|description|goal|name|title)\.?$/i];function lM($){if(typeof $!=="string")return!1;let Z=$.trim();if(Z.length<4||Z.length>280)return!1;return!pM.some((X)=>X.test(Z))}function iM($,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 nM($,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 kz($){if($==="analyze")await sM();else if($==="enhance")await rM();else console.log(`${D("ai")} ${B("— AI-powered features")}
395
- `),console.log(` ${F("faf ai enhance")} ${B("— fill empty slots via Claude")}`),console.log(` ${F("faf ai analyze")} ${B("— get improvement suggestions")}`),console.log(""),console.log(B(" Requires ANTHROPIC_API_KEY environment variable."))}async function yz(){let $=process.env.ANTHROPIC_API_KEY;if(!$)console.error(`Error: ANTHROPIC_API_KEY not set.
396
-
397
- export ANTHROPIC_API_KEY=sk-...`),process.exit(2);try{let{default:Z}=await Promise.resolve().then(() => (xz(),bz));return new Z({apiKey:$})}catch{console.error(`Error: @anthropic-ai/sdk not installed.
398
-
399
- npm install @anthropic-ai/sdk`),process.exit(2)}}async function rM(){let $=v();if(!$)console.error(`Error: project.faf not found
400
-
401
- Run 'faf init' to create one.`),process.exit(2);let Z=d($),X=h($),z=$0.filter((G)=>{let W=iM(Z,G.path);return S0(W)&&W!=="slotignored"});if(z.length===0){console.log(`${D("◆")} ai enhance all slots populated`);return}console.log(`${D("ai")} enhance ${B(`extracting from ${z.length} empty slots...`)}`);let J=await yz(),Q=z.map((G)=>`- ${G.path}: ${G.description}`).join(`
384
+ `,X=fX($,"project.faf");aN(X,Z),console.log(` ${I("1.")} Created sample project.faf`),console.log(H(` ${X}
385
+ `)),console.log(` ${I("2.")} Scoring...`);let z=W0(Y0(v(X)));console.log(""),X0(z,"project.faf",!0),oN($,{recursive:!0,force:!0}),console.log(`
386
+ ${H(' Demo complete. Run "faf init" in your project to get started.')}`)}c();function vX($,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=$0.filter((Y)=>Y.path.toLowerCase().includes(X)||Y.description.toLowerCase().includes(X)||Y.category.toLowerCase().includes(X));if(Q.length>0){console.log(`${D("slots")} ${H(`— ${Q.length} match${Q.length===1?"":"es"}`)}
387
+ `);for(let Y of Q)console.log(` ${I(`#${Y.index}`)} ${Y.path} ${H("—")} ${Y.description} ${H(`[${Y.category}]`)}`);console.log(""),J+=Q.length}}if(z||Z.formats){let Q=Q4.filter((Y)=>Y.name.toLowerCase().includes(X)||Y.extensions.some((U)=>U.toLowerCase().includes(X))||Y.category.toLowerCase().includes(X));if(Q.length>0){console.log(`${D("formats")} ${H(`— ${Q.length} match${Q.length===1?"":"es"}`)}
388
+ `);for(let Y of Q)console.log(` ${I(Y.name)} ${H(Y.extensions.join(", "))} ${H(`[${Y.category}]`)}`);console.log(""),J+=Q.length}}if(J===0)console.log(H(` No results for "${$}"`))}import{writeFileSync as hX,existsSync as Y1,mkdirSync as eN}from"fs";import{join as E$}from"path";c();var $M="Wolfe-Jam/faf-taf-git@v2.2.0";function uX($,Z={}){if($&&typeof $==="object")Z=$,$=void 0;if($==="setup"){JM(Z);return}QM(Z)}function ZM($){if(Y1(E$($,"bun.lockb"))||Y1(E$($,"bun.lock")))return"bun";if(Y1(E$($,"pnpm-lock.yaml")))return"pnpm";if(Y1(E$($,"yarn.lock")))return"yarn";return"npm"}var XM={bun:{setup:" - uses: oven-sh/setup-bun@v2",install:"bun install --frozen-lockfile",test:"bun run test"},pnpm:{setup:` - uses: pnpm/action-setup@v4
389
+ - uses: actions/setup-node@v4
390
+ with:
391
+ node-version: 20`,install:"pnpm install --frozen-lockfile",test:"pnpm test"},yarn:{setup:` - uses: actions/setup-node@v4
392
+ with:
393
+ node-version: 20`,install:"yarn install --frozen-lockfile",test:"yarn test"},npm:{setup:` - uses: actions/setup-node@v4
394
+ with:
395
+ node-version: 20`,install:"npm ci",test:"npm test"}};function zM($){let Z=`name: TAF Receipts
396
+ `+`# Prints a Test Receipt (.taf) on every push — proof over time, cannot be gamed.
397
+ `+`# Generated by \`faf taf setup\`. Docs: https://github.com/Wolfe-Jam/faf-taf-git
398
+ on:
399
+ push:
400
+ pull_request:
401
+
402
+ jobs:
403
+ taf:
404
+ runs-on: ubuntu-latest
405
+ steps:
406
+ - uses: actions/checkout@v4
407
+ `,X;if(Y1(E$($,"package.json"))){let J=XM[ZM($)];X=`${J.setup}
408
+ - run: ${J.install}
409
+ - name: Run tests
410
+ run: ${J.test} 2>&1 | tee test-output.txt
411
+ `}else X=` # TODO: set up your toolchain, then run your tests writing output to test-output.txt
412
+ - name: Run tests
413
+ run: |
414
+ # e.g. pytest -q 2>&1 | tee test-output.txt (or your test command)
415
+ echo "TODO: your test command" 2>&1 | tee test-output.txt
416
+ `;let z=` - name: Print TAF receipt
417
+ if: github.event_name == 'push'
418
+ uses: ${$M}
419
+ with:
420
+ test-output-file: test-output.txt
421
+ auto-commit: 'true'
422
+ commit-message: 'chore(taf): update .taf receipt [skip ci]'
423
+ target-branch: taf-receipts
424
+ `;return Z+X+z}function JM($){let Z=process.cwd(),X=zM(Z),z=E$(Z,".github","workflows","taf.yml");if($.write){if(Y1(z)){console.error(`${I("×")} .github/workflows/taf.yml already exists — not overwriting.`),console.error(H(" Add the faf-taf-git step to your existing workflow, or remove taf.yml and re-run."));return}eN(E$(Z,".github","workflows"),{recursive:!0}),hX(z,X,"utf-8"),console.log(`${D("◆")} taf wrote .github/workflows/taf.yml`),console.log(H(" commit + push → your first Test Receipt prints to the taf-receipts branch."));return}console.log(`${D("TAF setup")} ${H("— Test Receipt Printer: proof over time, cannot be gamed")}
425
+ `),console.log(H("Run `faf taf setup --write` to create this, or paste it into a workflow:\n")),console.log(X),console.log(H("Then commit + push. One receipt appends to .taf (taf-receipts branch) per CI run."))}function QM($){console.error(H("note: `faf taf` (score snapshot) is deprecated — use `faf score --json`. (`faf taf setup` wires the Receipt Printer.)"));let Z=h();if(!Z)console.error(`Error: project.faf not found
426
+
427
+ Run 'faf init' to create one.`),process.exit(2);let X=m(Z),z=v(Z),J=H0(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)hX($.output,Y,"utf-8"),console.log(`${D("◆")} taf receipt written to ${$.output}`);else console.log(Y)}import{createInterface as YM}from"readline";import{existsSync as mX,readFileSync as UM,writeFileSync as GM,unlinkSync as WM}from"fs";import{join as qM}from"path";c();var VM=".faf-session.json";function KM($,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 HM($,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 cX($={}){let Z=h();if(!Z)console.error(`Error: project.faf not found
428
+
429
+ Run 'faf init' to create one.`),process.exit(2);let X=process.cwd(),z=qM(X,VM),J=0;if($.resume&&mX(z))try{J=JSON.parse(UM(z,"utf-8")).slotIndex,console.log(H(` resuming from slot #${J+1}`))}catch{}let Q=m(Z),Y=$0.filter((B)=>{let T=KM(Q,B.path);return x0(T)&&T!=="slotignored"});if(Y.length===0){console.log(`${D("◆")} go all slots populated — \uD83C\uDFC6 Trophy`);let B=W0(Y0(v(Z)));X0(B,Z);return}console.log(`${D("go")} ${H("— guided interview to \uD83C\uDFC6 Trophy")}`);let U=Y.length===1?"slot":"slots";console.log(H(` ${Y.length} ${U} from Trophy. Enter a value, "skip" to skip, or "quit" to stop.
430
+ `));let G=YM({input:process.stdin,output:process.stdout}),W=(B)=>new Promise((T)=>G.question(B,T)),q=0,V=Y.slice(J);for(let B=0;B<V.length;B++){let T=V[B],N=await W(` ${I(`#${T.index}`)} ${o2(T.path)} ${H(`(${T.path})`)}: `);if(N.toLowerCase()==="quit"){let M={slotIndex:J+B,fafPath:Z};GM(z,JSON.stringify(M),"utf-8"),console.log(H(`
431
+ session saved. Resume with: faf go --resume`));break}if(N.toLowerCase()==="skip"||N.trim()==="")continue;HM(Q,T.path,N.trim()),q++}if(G.close(),q>0)s(Z,Q),console.log(`
432
+ ${D("◆")} go filled ${q} slot${q===1?"":"s"}`);let K=W0(Y0(v(Z)));if(X0(K,Z),mX(z))try{WM(z)}catch{}}c();var qO=[/^(tbd|see\s+readme|todo|fixme|coming\s+soon|n\/a|unknown|none|null|not\s+specified)\b/i,/^(software|application|app|project|tool|library|framework)\.?$/i,/^(for\s+(users|developers|teams|engineers))\.?$/i,/^(general\s+purpose|various|multiple|description|goal|name|title)\.?$/i];function VO($){if(typeof $!=="string")return!1;let Z=$.trim();if(Z.length<4||Z.length>280)return!1;return!qO.some((X)=>X.test(Z))}function KO($,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 HO($,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 cz($){if($==="analyze")await LO();else if($==="enhance")await BO();else console.log(`${D("ai")} ${H("— AI-powered features")}
433
+ `),console.log(` ${I("faf ai enhance")} ${H("— fill empty slots via Claude")}`),console.log(` ${I("faf ai analyze")} ${H("— get improvement suggestions")}`),console.log(""),console.log(H(" Requires ANTHROPIC_API_KEY environment variable."))}async function dz(){let $=process.env.ANTHROPIC_API_KEY;if(!$)console.error(`Error: ANTHROPIC_API_KEY not set.
434
+
435
+ export ANTHROPIC_API_KEY=sk-...`),process.exit(2);try{let{default:Z}=await Promise.resolve().then(() => (mz(),uz));return new Z({apiKey:$})}catch{console.error(`Error: @anthropic-ai/sdk not installed.
436
+
437
+ npm install @anthropic-ai/sdk`),process.exit(2)}}async function BO(){let $=h();if(!$)console.error(`Error: project.faf not found
438
+
439
+ Run 'faf init' to create one.`),process.exit(2);let Z=m($),X=v($),z=$0.filter((G)=>{let W=KO(Z,G.path);return x0(W)&&W!=="slotignored"});if(z.length===0){console.log(`${D("◆")} ai enhance all slots populated`);return}console.log(`${D("ai")} enhance ${H(`extracting from ${z.length} empty slots...`)}`);let J=await dz(),Q=z.map((G)=>`- ${G.path}: ${G.description}`).join(`
402
440
  `),Y=`You are extracting concrete content from a project's .faf file to fill empty slots. STRICT RULES:
403
441
 
404
442
  1. Return JSON mapping dot-paths to values OR null.
@@ -414,41 +452,41 @@ ${X}
414
452
  Empty slots to fill (return null if no concrete evidence):
415
453
  ${Q}
416
454
 
417
- Respond with ONLY valid JSON, no markdown fences. Each value is either a short string (with concrete evidence) or null (leave empty).`,U=await J.messages.create({model:"claude-haiku-4-5-20251001",max_tokens:1024,messages:[{role:"user",content:Y}]});try{let G=U.content[0].text,W=JSON.parse(G),q=0,V=0;for(let K of z){let H=W[K.path];if(H===null||H===void 0)continue;if(lM(H))nM(Z,K.path,H),console.log(` ${D("●")} ${K.path} ${B("←")} ${H}`),q++;else console.log(` ${B("○")} ${K.path} ${B("— rejected as slop, left empty")}`),V++}if(q>0){s($,Z),console.log(`
418
- ${D("◆")} ai enhance filled ${q} slot${q===1?"":"s"}${V>0?` (${V} rejected)`:""}`);let K=W0(Y0(h($)));X0(K,$)}else if(V>0)console.log(`
419
- ${B("all extractions rejected as slop. Run")} ${F("'faf go'")} ${B("for interview-fill.")}`);else console.log(`
420
- ${B("no concrete evidence for empty slots. Run")} ${F("'faf go'")} ${B("for interview-fill.")}`)}catch{console.error("Error: Could not parse AI response.")}}async function sM(){let $=v();if(!$)console.error(`Error: project.faf not found
455
+ Respond with ONLY valid JSON, no markdown fences. Each value is either a short string (with concrete evidence) or null (leave empty).`,U=await J.messages.create({model:"claude-haiku-4-5-20251001",max_tokens:1024,messages:[{role:"user",content:Y}]});try{let G=U.content[0].text,W=JSON.parse(G),q=0,V=0;for(let K of z){let B=W[K.path];if(B===null||B===void 0)continue;if(VO(B))HO(Z,K.path,B),console.log(` ${D("●")} ${K.path} ${H("←")} ${B}`),q++;else console.log(` ${H("○")} ${K.path} ${H("— rejected as slop, left empty")}`),V++}if(q>0){s($,Z),console.log(`
456
+ ${D("◆")} ai enhance filled ${q} slot${q===1?"":"s"}${V>0?` (${V} rejected)`:""}`);let K=W0(Y0(v($)));X0(K,$)}else if(V>0)console.log(`
457
+ ${H("all extractions rejected as slop. Run")} ${I("'faf go'")} ${H("for interview-fill.")}`);else console.log(`
458
+ ${H("no concrete evidence for empty slots. Run")} ${I("'faf go'")} ${H("for interview-fill.")}`)}catch{console.error("Error: Could not parse AI response.")}}async function LO(){let $=h();if(!$)console.error(`Error: project.faf not found
421
459
 
422
- Run 'faf init' to create one.`),process.exit(2);let Z=h($);console.log(`${D("ai")} analyze ${B("getting suggestions...")}`);let z=await(await yz()).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.
460
+ Run 'faf init' to create one.`),process.exit(2);let Z=v($);console.log(`${D("ai")} analyze ${H("getting suggestions...")}`);let z=await(await dz()).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.
423
461
 
424
462
  ${Z}
425
463
 
426
- Be concise. One line per suggestion.`}]});console.log(""),console.log(z.content[0].text)}import{existsSync as CZ,readFileSync as EZ,readdirSync as aM}from"fs";import{join as fz}from"path";m();function gz($,Z){if($==="import")oM(Z);else if($==="export")tM();else console.log(`${D("conductor")} ${B("— conductor integration")}
427
- `),console.log(` ${F("faf conductor import <path>")} ${B("— import conductor config into .faf")}`),console.log(` ${F("faf conductor export")} ${B("— generate conductor config from .faf")}`)}function oM($){if(!$)console.error("Usage: faf conductor import <path>"),process.exit(2);if(!CZ($))console.error(`Error: path not found: ${$}`),process.exit(2);let Z={faf_version:"2.5.0",project:{}};if(CZ($)&&$.endsWith(".json")){let J=JSON.parse(EZ($,"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(CZ($)&&($.endsWith(".yml")||$.endsWith(".yaml"))){let J=Q$(EZ($,"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=aM($);for(let Q of J){let Y=fz($,Q);if(Q.endsWith(".json"))try{let U=JSON.parse(EZ(Y,"utf-8"));if(U.name&&!Z.project.name)Z.project.name=U.name;if(U.description&&!Z.project.goal)Z.project.goal=U.description}catch{}}}catch{console.error(`Error: could not read directory: ${$}`),process.exit(2)}let X=process.cwd(),z=v(X);if(z){let J=d(z);if(!J.project)J.project={};if(Z.project.name&&!J.project.name)J.project.name=Z.project.name;if(Z.project.goal&&!J.project.goal)J.project.goal=Z.project.goal;if(Z.project.main_language&&!J.project.main_language)J.project.main_language=Z.project.main_language;s(z,J),console.log(`${D("◆")} conductor import merged into ${z}`)}else{let J=fz(X,"project.faf");s(J,Z),console.log(`${D("◆")} conductor import created ${J}`)}}function tM(){let $=v();if(!$)console.error(`Error: project.faf not found
428
-
429
- Run 'faf init' to create one.`),process.exit(2);let Z=d($),X={name:Z.project?.name??"",description:Z.project?.goal??"",language:Z.project?.main_language??"",stack:Z.stack??{}};console.log(JSON.stringify(X,null,2))}m();import{readdirSync as eM,readFileSync as $O,existsSync as ZO}from"fs";import{join as XO}from"path";var zO=["BRAKE","ENGINE","AERO","PIT"],JO=/(?:^|[^A-Za-z])(BRAKE|ENGINE|AERO|PIT)(?:[^A-Za-z]|$)/i;function QO($){let Z=$.match(JO);if(!Z)return null;return Z[1].toUpperCase()}function YO($){let Z=$.toLowerCase();if(Z.endsWith(".test.ts")||Z.endsWith(".test.js")||Z.endsWith(".test.tsx")||Z.endsWith(".test.jsx")||Z.endsWith(".spec.ts")||Z.endsWith(".spec.js"))return{ok:!0,lang:"typescript"};if(Z.endsWith(".rs"))return{ok:!0,lang:"rust"};if(Z.endsWith("_test.go"))return{ok:!0,lang:"go"};if((Z.startsWith("test_")||Z.endsWith("_test.py"))&&Z.endsWith(".py"))return{ok:!0,lang:"python"};if(Z.endsWith(".zig"))return{ok:!0,lang:"zig"};return{ok:!1}}function UO($,Z){let X=[];switch(Z){case"typescript":{let z=/\b(describe|test|it)\s*\(\s*(['"`])((?:\\.|(?!\2).)*)\2/g,J=[],Q;while((Q=z.exec($))!==null)J.push({idx:Q.index,type:Q[1]==="describe"?"describe":"test",name:Q[3]});let Y=[],U=0,G=null,W=0;for(let q=0;q<$.length;q++){while(W<J.length&&J[W].idx===q){let K=J[W];if(K.type==="describe")G=K.name;else{let H=Y.map((N)=>N.name),T=H.length>0?`${H.join(" > ")} > ${K.name}`:K.name;X.push(T)}W++}let V=$[q];if(V==="{"){if(U++,G!==null)Y.push({name:G,openDepth:U}),G=null}else if(V==="}"){U--;while(Y.length>0&&U<Y[Y.length-1].openDepth)Y.pop()}}break}case"rust":{let z=/#\[test\]\s*(?:\r?\n)\s*(?:pub\s+)?fn\s+([a-zA-Z_][a-zA-Z_0-9]*)/g,J;while((J=z.exec($))!==null)X.push(J[1]);break}case"python":{let z=/^\s*def\s+(test_[a-zA-Z_0-9]+)\s*\(/gm,J;while((J=z.exec($))!==null)X.push(J[1]);break}case"zig":{let z=/\btest\s+"((?:\\.|[^"\\])+)"/g,J;while((J=z.exec($))!==null)X.push(J[1]);break}case"go":{let z=/\bfunc\s+(Test[A-Z][a-zA-Z_0-9]*)\s*\(/g,J;while((J=z.exec($))!==null)X.push(J[1]);break}}return X}var GO=new Set(["node_modules",".git","target","dist","build",".next",".nuxt","coverage"]);function hz($,Z=[]){let X;try{X=eM($,{withFileTypes:!0})}catch{return Z}for(let z of X){if(GO.has(z.name))continue;if(z.name.startsWith(".")&&z.name!==".")continue;let J=XO($,z.name);if(z.isDirectory())hz(J,Z);else if(z.isFile())Z.push(J)}return Z}function WO($){let Z=[];if(!ZO($))return Z;let X=hz($);for(let z of X){let J=z.split("/").pop()??"",Q=YO(J);if(!Q.ok||!Q.lang)continue;let Y;try{Y=$O(z,"utf-8")}catch{continue}if(Q.lang==="rust"&&!/#\[test\]/.test(Y))continue;if(Q.lang==="zig"&&!/\btest\s+"/.test(Y))continue;let U=UO(Y,Q.lang),G=z.replace(`${$}/`,"");for(let W of U)Z.push({file:G,language:Q.lang,testName:W,tier:QO(W)})}return Z}function qO($){let Z={BRAKE:0,ENGINE:0,AERO:0,PIT:0},X={},z=0,J=[],Q=new Set;for(let Y of $)if(Q.add(Y.file),X[Y.language]=(X[Y.language]??0)+1,Y.tier)Z[Y.tier]++;else if(z++,J.length<5)J.push(`${Y.file}: ${Y.testName}`);return{totalTests:$.length,byTier:Z,untiered:z,untieredExamples:J,filesScanned:Q.size,byLanguage:X}}function VO($){if(console.log(`${D(F("faf wjttc"))} ${B("— vendor-neutral test audit")}`),console.log(""),console.log(` Files scanned: ${F(String($.filesScanned))}`),console.log(` Tests found: ${F(String($.totalTests))}`),console.log(""),$.totalTests===0){console.log(B(" no tests found"));return}console.log(B(" Tiers:"));for(let Z of zO){let X=$.byTier[Z],z=(X/$.totalTests*100).toFixed(0),J=Z==="BRAKE"?K0("●"):Z==="ENGINE"?D("●"):Z==="AERO"?B("●"):B("○");console.log(` ${J} ${Z.padEnd(7)} ${F(String(X).padStart(4))} ${B(`(${z}%)`)}`)}if($.untiered>0){let Z=($.untiered/$.totalTests*100).toFixed(0);console.log(` ${B("○")} ${"untiered".padEnd(7)} ${F(String($.untiered).padStart(4))} ${B(`(${Z}%)`)}`)}if($.untiered>0&&$.untieredExamples.length>0){console.log(""),console.log(B(` Untiered examples (first ${$.untieredExamples.length}):`));for(let Z of $.untieredExamples)console.log(` ${B("·")} ${Z}`)}if(Object.keys($.byLanguage).length>1){console.log(""),console.log(B(" Languages:"));for(let[Z,X]of Object.entries($.byLanguage))console.log(` ${B("·")} ${Z.padEnd(12)} ${F(String(X))}`)}if($.byTier.BRAKE===0&&$.totalTests>0)console.log(""),console.log(K0(" ⚠ no BRAKE-tier tests — no safety canaries"))}function vz($={}){let Z=$.path??"tests",X=WO(Z),z=qO(X);if($.json)console.log(JSON.stringify(z,null,2));else VO(z);if($.strict&&z.untiered>0)process.exit(1)}import{createHash as cz}from"crypto";import{readFileSync as dz,writeFileSync as KO,existsSync as pz}from"fs";import{join as lz,dirname as HO}from"path";m();var uz="faf-bench/1",BO={"project.name":"What is the project's name?","project.goal":"What is the project's goal — what is it for?","project.main_language":"What is the primary programming language?","human_context.who":"Who is this project for?","human_context.what":"What are they building?","human_context.why":"Why does this project exist?","human_context.where":"Where does it run or get distributed?","human_context.when":"When — what is the project's timeline or stage?","human_context.how":"How is it built or used?"};function LO($,Z){return BO[$]??`What is the project's ${Z.replace(/\s*\(.*\)$/,"").toLowerCase()}?`}var NO=[["typescript","ts"],["javascript","js"],["python","py","python3"],["node","nodejs","node js","node.js"],["github actions","gh actions","actions"],["postgresql","postgres","pg"],["kubernetes","k8s"],["npm","npm registry"],["cloudflare workers","cf workers","workers"],["google cloud run","cloud run","gcp cloud run"]],l4=new Map;NO.forEach(($,Z)=>$.forEach((X)=>l4.set(X,Z)));var MO=new Set(["a","an","the","and","or","of","for","to","in","on","with","is","it","its","their","your","via","by","using","use","used"]);function jZ($){return $.toLowerCase().replace(/[^a-z0-9\s.+#-]/g," ").replace(/\.(?=\s|$)/g," ").replace(/\s+/g," ").trim()}function mz($){return jZ($).split(" ").filter((Z)=>Z&&!MO.has(Z))}function OO($,Z){let X=jZ($),z=jZ(Z);if(!X||!z)return!1;if(X===z)return!0;let J=l4.get(X);if(J!==void 0&&l4.get(z)===J)return!0;let Q=mz($);if(Q.length===0)return!1;let Y=new Set(mz(Z));return Q.every((U)=>{if(Y.has(U))return!0;let G=l4.get(U);return G!==void 0&&[...Y].some((W)=>l4.get(W)===G)})}function TO($){let Z=H0($),X=Q$($),z=[],J={},Q=0;for(let G of $0){if(Z.slots[G.path]!=="populated")continue;let W=L7(X,G);if(typeof W!=="string")continue;let q=W.trim();if(!q||e8.has(q.toLowerCase()))continue;Q+=1,z.push({n:Q,path:G.path,question:LO(G.path,G.description)}),J[Q]=q}let Y=JSON.stringify({v:uz,q:z.map((G)=>[G.path,G.question])}),U=cz("sha256").update(Y).digest("hex").slice(0,12);return{version:uz,qsetHash:U,questions:z,answers:J}}function DO($,Z){let X=$.questions.map((J)=>{let Q=Z[String(J.n)]??Z[J.path]??"";return{n:J.n,path:J.path,ok:typeof Q==="string"&&Q.trim()!==""&&OO($.answers[J.n],Q)}}),z=$.questions.filter((J)=>!X[J.n-1].ok);return{correct:X.filter((J)=>J.ok).length,total:$.questions.length,misses:z,perQuestion:X}}var iz=".faf-bench.json";function IO($){let Z=lz($,iz);if(!pz(Z))return null;try{return JSON.parse(dz(Z,"utf-8"))}catch{return null}}function AO($,Z){KO(lz($,iz),JSON.stringify(Z,null,2)+`
430
- `,"utf-8")}function SZ($,Z){let X=JSON.stringify({v:$.version,repo:Z??null,qset:$.qsetHash,protocol:$.protocol,cold:$.cold??null,faf:$.faf??null});return{projection:X,hash:cz("sha256").update(X).digest("hex")}}var C6=($)=>$===void 0?"—":`~${$.toLocaleString()}`;function RO($,Z){let{cold:X,faf:z}=$;console.log(`
431
- ${F(`faf bench — ${Z}`)}
432
- `),console.log(` ${B("without context")} ${D("with .faf")}`),console.log(`answers ${X.score}/${X.total} ${F(`${z.score}/${z.total}`)}`),console.log(`tokens ${C6(X.tokens)} ${C6(z.tokens)}`);let J=X.total-X.score;if(J>0)console.log(`
433
- ${B(`The ${J} missing answer${J===1?"":"s"} were already in your repo — unstructured.`)}`),console.log(B("Structured context closes the gap."));let Q=SZ($,Z);console.log(`
434
- ${K0("✪ BENCH RECEIPT")}`),console.log(B(` qset: ${$.qsetHash} protocol: ${$.protocol} model: ${z.model??X.model??"unreported"}`)),console.log(B(` cold ${X.score}/${X.total} · faf ${z.score}/${z.total} · sha256: ${Q.hash.slice(0,16)}…`))}function FO($,Z){let X=$.cold,z=X.total-X.score;if(console.log(`
435
- ${F(`faf bench — ${Z}`)} ${K0("Trouble ahead, expensive trouble.")}
436
- `),console.log(` ${B("without context")}`),console.log(`answers ${X.score}/${X.total} ${B("— the AI is guessing at what you are building")}`),X.tokens!==void 0)console.log(`tokens ${C6(X.tokens)} ${B("— re-derivation burn, paid again EVERY session")}`);if(z>0)console.log(`
464
+ Be concise. One line per suggestion.`}]});console.log(""),console.log(z.content[0].text)}import{existsSync as bZ,readFileSync as xZ,readdirSync as NO}from"fs";import{join as pz}from"path";c();function lz($,Z){if($==="import")MO(Z);else if($==="export")OO();else console.log(`${D("conductor")} ${H("— conductor integration")}
465
+ `),console.log(` ${I("faf conductor import <path>")} ${H("— import conductor config into .faf")}`),console.log(` ${I("faf conductor export")} ${H("— generate conductor config from .faf")}`)}function MO($){if(!$)console.error("Usage: faf conductor import <path>"),process.exit(2);if(!bZ($))console.error(`Error: path not found: ${$}`),process.exit(2);let Z={faf_version:"2.5.0",project:{}};if(bZ($)&&$.endsWith(".json")){let J=JSON.parse(xZ($,"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(bZ($)&&($.endsWith(".yml")||$.endsWith(".yaml"))){let J=W$(xZ($,"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=NO($);for(let Q of J){let Y=pz($,Q);if(Q.endsWith(".json"))try{let U=JSON.parse(xZ(Y,"utf-8"));if(U.name&&!Z.project.name)Z.project.name=U.name;if(U.description&&!Z.project.goal)Z.project.goal=U.description}catch{}}}catch{console.error(`Error: could not read directory: ${$}`),process.exit(2)}let X=process.cwd(),z=h(X);if(z){let J=m(z);if(!J.project)J.project={};if(Z.project.name&&!J.project.name)J.project.name=Z.project.name;if(Z.project.goal&&!J.project.goal)J.project.goal=Z.project.goal;if(Z.project.main_language&&!J.project.main_language)J.project.main_language=Z.project.main_language;s(z,J),console.log(`${D("◆")} conductor import merged into ${z}`)}else{let J=pz(X,"project.faf");s(J,Z),console.log(`${D("◆")} conductor import created ${J}`)}}function OO(){let $=h();if(!$)console.error(`Error: project.faf not found
466
+
467
+ Run 'faf init' to create one.`),process.exit(2);let Z=m($),X={name:Z.project?.name??"",description:Z.project?.goal??"",language:Z.project?.main_language??"",stack:Z.stack??{}};console.log(JSON.stringify(X,null,2))}c();import{readdirSync as TO,readFileSync as DO,existsSync as IO}from"fs";import{join as AO}from"path";var RO=["BRAKE","ENGINE","AERO","TYRE","PIT"],FO=/(?:^|[^A-Za-z])(BRAKE|ENGINE|AERO|TYRE|PIT)(?:[^A-Za-z]|$)/i;function wO($){let Z=$.match(FO);if(!Z)return null;return Z[1].toUpperCase()}function PO($){let Z=$.toLowerCase();if(Z.endsWith(".test.ts")||Z.endsWith(".test.js")||Z.endsWith(".test.tsx")||Z.endsWith(".test.jsx")||Z.endsWith(".spec.ts")||Z.endsWith(".spec.js"))return{ok:!0,lang:"typescript"};if(Z.endsWith(".rs"))return{ok:!0,lang:"rust"};if(Z.endsWith("_test.go"))return{ok:!0,lang:"go"};if((Z.startsWith("test_")||Z.endsWith("_test.py"))&&Z.endsWith(".py"))return{ok:!0,lang:"python"};if(Z.endsWith(".zig"))return{ok:!0,lang:"zig"};return{ok:!1}}function _O($,Z){let X=[];switch(Z){case"typescript":{let z=/\b(describe|test|it)\s*\(\s*(['"`])((?:\\.|(?!\2).)*)\2/g,J=[],Q;while((Q=z.exec($))!==null)J.push({idx:Q.index,type:Q[1]==="describe"?"describe":"test",name:Q[3]});let Y=[],U=0,G=null,W=0;for(let q=0;q<$.length;q++){while(W<J.length&&J[W].idx===q){let K=J[W];if(K.type==="describe")G=K.name;else{let B=Y.map((N)=>N.name),T=B.length>0?`${B.join(" > ")} > ${K.name}`:K.name;X.push(T)}W++}let V=$[q];if(V==="{"){if(U++,G!==null)Y.push({name:G,openDepth:U}),G=null}else if(V==="}"){U--;while(Y.length>0&&U<Y[Y.length-1].openDepth)Y.pop()}}break}case"rust":{let z=/#\[test\]\s*(?:\r?\n)\s*(?:pub\s+)?fn\s+([a-zA-Z_][a-zA-Z_0-9]*)/g,J;while((J=z.exec($))!==null)X.push(J[1]);break}case"python":{let z=/^\s*def\s+(test_[a-zA-Z_0-9]+)\s*\(/gm,J;while((J=z.exec($))!==null)X.push(J[1]);break}case"zig":{let z=/\btest\s+"((?:\\.|[^"\\])+)"/g,J;while((J=z.exec($))!==null)X.push(J[1]);break}case"go":{let z=/\bfunc\s+(Test[A-Z][a-zA-Z_0-9]*)\s*\(/g,J;while((J=z.exec($))!==null)X.push(J[1]);break}}return X}var CO=new Set(["node_modules",".git","target","dist","build",".next",".nuxt","coverage"]);function iz($,Z=[]){let X;try{X=TO($,{withFileTypes:!0})}catch{return Z}for(let z of X){if(CO.has(z.name))continue;if(z.name.startsWith(".")&&z.name!==".")continue;let J=AO($,z.name);if(z.isDirectory())iz(J,Z);else if(z.isFile())Z.push(J)}return Z}function EO($){let Z=[];if(!IO($))return Z;let X=iz($);for(let z of X){let J=z.split("/").pop()??"",Q=PO(J);if(!Q.ok||!Q.lang)continue;let Y;try{Y=DO(z,"utf-8")}catch{continue}if(Q.lang==="rust"&&!/#\[test\]/.test(Y))continue;if(Q.lang==="zig"&&!/\btest\s+"/.test(Y))continue;let U=_O(Y,Q.lang),G=z.replace(`${$}/`,"");for(let W of U)Z.push({file:G,language:Q.lang,testName:W,tier:wO(W)})}return Z}function jO($){let Z={BRAKE:0,ENGINE:0,AERO:0,TYRE:0,PIT:0},X={},z=0,J=[],Q=new Set;for(let Y of $)if(Q.add(Y.file),X[Y.language]=(X[Y.language]??0)+1,Y.tier)Z[Y.tier]++;else if(z++,J.length<5)J.push(`${Y.file}: ${Y.testName}`);return{totalTests:$.length,byTier:Z,untiered:z,untieredExamples:J,filesScanned:Q.size,byLanguage:X}}function SO($){if(console.log(`${D(I("faf wjttc"))} ${H("— vendor-neutral test audit")}`),console.log(""),console.log(` Files scanned: ${I(String($.filesScanned))}`),console.log(` Tests found: ${I(String($.totalTests))}`),console.log(""),$.totalTests===0){console.log(H(" no tests found"));return}console.log(H(" Tiers:"));for(let Z of RO){let X=$.byTier[Z],z=(X/$.totalTests*100).toFixed(0),J=Z==="BRAKE"?K0("●"):Z==="ENGINE"?D("●"):Z==="AERO"?H("●"):Z==="TYRE"?D("◐"):H("○");console.log(` ${J} ${Z.padEnd(7)} ${I(String(X).padStart(4))} ${H(`(${z}%)`)}`)}if($.untiered>0){let Z=($.untiered/$.totalTests*100).toFixed(0);console.log(` ${H("○")} ${"untiered".padEnd(7)} ${I(String($.untiered).padStart(4))} ${H(`(${Z}%)`)}`)}if($.untiered>0&&$.untieredExamples.length>0){console.log(""),console.log(H(` Untiered examples (first ${$.untieredExamples.length}):`));for(let Z of $.untieredExamples)console.log(` ${H("·")} ${Z}`)}if(Object.keys($.byLanguage).length>1){console.log(""),console.log(H(" Languages:"));for(let[Z,X]of Object.entries($.byLanguage))console.log(` ${H("·")} ${Z.padEnd(12)} ${I(String(X))}`)}if($.byTier.BRAKE===0&&$.totalTests>0)console.log(""),console.log(K0(" ⚠ no BRAKE-tier tests — no safety canaries"))}function nz($={}){let Z=$.path??"tests",X=EO(Z),z=jO(X);if($.json)console.log(JSON.stringify(z,null,2));else SO(z);if($.strict&&z.untiered>0)process.exit(1)}import{createHash as az}from"crypto";import{readFileSync as oz,writeFileSync as bO,existsSync as tz}from"fs";import{join as ez,dirname as xO}from"path";c();var rz="faf-bench/1",kO={"project.name":"What is the project's name?","project.goal":"What is the project's goal — what is it for?","project.main_language":"What is the primary programming language?","human_context.who":"Who is this project for?","human_context.what":"What are they building?","human_context.why":"Why does this project exist?","human_context.where":"Where does it run or get distributed?","human_context.when":"When — what is the project's timeline or stage?","human_context.how":"How is it built or used?"};function yO($,Z){return kO[$]??`What is the project's ${Z.replace(/\s*\(.*\)$/,"").toLowerCase()}?`}var fO=[["typescript","ts"],["javascript","js"],["python","py","python3"],["node","nodejs","node js","node.js"],["github actions","gh actions","actions"],["postgresql","postgres","pg"],["kubernetes","k8s"],["npm","npm registry"],["cloudflare workers","cf workers","workers"],["google cloud run","cloud run","gcp cloud run"]],a4=new Map;fO.forEach(($,Z)=>$.forEach((X)=>a4.set(X,Z)));var gO=new Set(["a","an","the","and","or","of","for","to","in","on","with","is","it","its","their","your","via","by","using","use","used"]);function kZ($){return $.toLowerCase().replace(/[^a-z0-9\s.+#-]/g," ").replace(/\.(?=\s|$)/g," ").replace(/\s+/g," ").trim()}function sz($){return kZ($).split(" ").filter((Z)=>Z&&!gO.has(Z))}function vO($,Z){let X=kZ($),z=kZ(Z);if(!X||!z)return!1;if(X===z)return!0;let J=a4.get(X);if(J!==void 0&&a4.get(z)===J)return!0;let Q=sz($);if(Q.length===0)return!1;let Y=new Set(sz(Z));return Q.every((U)=>{if(Y.has(U))return!0;let G=a4.get(U);return G!==void 0&&[...Y].some((W)=>a4.get(W)===G)})}function hO($){let Z=H0($),X=W$($),z=[],J={},Q=0;for(let G of $0){if(Z.slots[G.path]!=="populated")continue;let W=T7(X,G);if(typeof W!=="string")continue;let q=W.trim();if(!q||z3.has(q.toLowerCase()))continue;Q+=1,z.push({n:Q,path:G.path,question:yO(G.path,G.description)}),J[Q]=q}let Y=JSON.stringify({v:rz,q:z.map((G)=>[G.path,G.question])}),U=az("sha256").update(Y).digest("hex").slice(0,12);return{version:rz,qsetHash:U,questions:z,answers:J}}function uO($,Z){let X=$.questions.map((J)=>{let Q=Z[String(J.n)]??Z[J.path]??"";return{n:J.n,path:J.path,ok:typeof Q==="string"&&Q.trim()!==""&&vO($.answers[J.n],Q)}}),z=$.questions.filter((J)=>!X[J.n-1].ok);return{correct:X.filter((J)=>J.ok).length,total:$.questions.length,misses:z,perQuestion:X}}var $J=".faf-bench.json";function mO($){let Z=ez($,$J);if(!tz(Z))return null;try{return JSON.parse(oz(Z,"utf-8"))}catch{return null}}function cO($,Z){bO(ez($,$J),JSON.stringify(Z,null,2)+`
468
+ `,"utf-8")}function yZ($,Z){let X=JSON.stringify({v:$.version,repo:Z??null,qset:$.qsetHash,protocol:$.protocol,cold:$.cold??null,faf:$.faf??null});return{projection:X,hash:az("sha256").update(X).digest("hex")}}var b6=($)=>$===void 0?"—":`~${$.toLocaleString()}`;function dO($,Z){let{cold:X,faf:z}=$;console.log(`
469
+ ${I(`faf bench — ${Z}`)}
470
+ `),console.log(` ${H("without context")} ${D("with .faf")}`),console.log(`answers ${X.score}/${X.total} ${I(`${z.score}/${z.total}`)}`),console.log(`tokens ${b6(X.tokens)} ${b6(z.tokens)}`);let J=X.total-X.score;if(J>0)console.log(`
471
+ ${H(`The ${J} missing answer${J===1?"":"s"} were already in your repo — unstructured.`)}`),console.log(H("Structured context closes the gap."));let Q=yZ($,Z);console.log(`
472
+ ${K0("✪ BENCH RECEIPT")}`),console.log(H(` qset: ${$.qsetHash} protocol: ${$.protocol} model: ${z.model??X.model??"unreported"}`)),console.log(H(` cold ${X.score}/${X.total} · faf ${z.score}/${z.total} · sha256: ${Q.hash.slice(0,16)}…`))}function pO($,Z){let X=$.cold,z=X.total-X.score;if(console.log(`
473
+ ${I(`faf bench — ${Z}`)} ${K0("Trouble ahead, expensive trouble.")}
474
+ `),console.log(` ${H("without context")}`),console.log(`answers ${X.score}/${X.total} ${H("— the AI is guessing at what you are building")}`),X.tokens!==void 0)console.log(`tokens ${b6(X.tokens)} ${H("— re-derivation burn, paid again EVERY session")}`);if(z>0)console.log(`
437
475
  ${z} answer${z===1?"":"s"} missing: the stack it can dig out (you pay for the dig);`),console.log("what you are trying to DO, it cannot derive at any price."),console.log("Both are already in your repo — unstructured.");console.log(`
438
- ${D("→ faf init && faf bench")} ${B("(close the gap, get the receipt)")}`)}var wO="https://mcpaas.live/bench/submit";async function PO($,Z){try{let X=await fetch(Z,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)});console.log(B(X.ok?` ✪ submitted to ${Z}`:` submit failed (${X.status})`))}catch{console.log(B(" submit skipped (endpoint unreachable)"))}}function nz($,Z,X={}){let z=X.file??v();if(!z)console.error(`Error: project.faf not found
476
+ ${D("→ faf init && faf bench")} ${H("(close the gap, get the receipt)")}`)}var lO="https://mcpaas.live/bench/submit";async function iO($,Z){try{let X=await fetch(Z,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)});console.log(H(X.ok?` ✪ submitted to ${Z}`:` submit failed (${X.status})`))}catch{console.log(H(" submit skipped (endpoint unreachable)"))}}function ZJ($,Z,X={}){let z=X.file??h();if(!z)console.error(`Error: project.faf not found
439
477
 
440
- Run 'faf init' to create one — bench needs the answer key.`),process.exit(2);let J=h(z),Q=TO(J),Y=HO(z),U=Q$(J)?.project?.name??Y.split("/").pop();if(Q.questions.length===0)console.error("Error: no populated slots to derive questions from.\n\n Run `faf go` to fill the .faf first."),process.exit(2);if($==="questions"){if(X.json){console.log(JSON.stringify({version:Q.version,qsetHash:Q.qsetHash,questions:Q.questions.map(({n:G,question:W})=>({n:G,question:W}))},null,2));return}console.log(`
441
- ${F(`faf bench — ${Q.questions.length} questions`)} ${B(`qset ${Q.qsetHash}`)}
478
+ Run 'faf init' to create one — bench needs the answer key.`),process.exit(2);let J=v(z),Q=hO(J),Y=xO(z),U=W$(J)?.project?.name??Y.split("/").pop();if(Q.questions.length===0)console.error("Error: no populated slots to derive questions from.\n\n Run `faf go` to fill the .faf first."),process.exit(2);if($==="questions"){if(X.json){console.log(JSON.stringify({version:Q.version,qsetHash:Q.qsetHash,questions:Q.questions.map(({n:G,question:W})=>({n:G,question:W}))},null,2));return}console.log(`
479
+ ${I(`faf bench — ${Q.questions.length} questions`)} ${H(`qset ${Q.qsetHash}`)}
442
480
  `);for(let G of Q.questions)console.log(` ${String(G.n).padStart(2)}. ${G.question}`);console.log(`
443
- ${B('Answer terse — the value, not a sentence. Save as JSON: {"1": "...", "2": "..."}')}`);return}if($==="grade"){if(!Z||!pz(Z))console.error("Error: faf bench grade <answers.json> — file not found."),process.exit(2);let G=JSON.parse(dz(Z,"utf-8")),W=G.answers??G,q=DO(Q,W),V={score:q.correct,total:q.total,...X.tokens?{tokens:parseInt(X.tokens,10)}:{},...X.model?{model:X.model}:{}},K=IO(Y),H=K&&K.qsetHash===Q.qsetHash?K:{version:Q.version,qsetHash:Q.qsetHash,protocol:"in-session"};if(X.cold)H.cold=V;else if(X.faf)H.faf=V;else console.error("Error: specify the run mode — --cold (no context) or --faf (after reading project.faf)."),process.exit(2);if(AO(Y,H),X.json){let T=SZ(H,U);console.log(JSON.stringify({...H,receipt:T.hash,perQuestion:q.perQuestion},null,2));return}if(H.cold&&H.faf)RO(H,U);if(X.submit&&H.cold&&H.faf){let{cold:T,faf:N}=H,M=SZ(H,U);PO({date:new Date().toISOString().slice(0,10),model:N.model??T.model??X.model??"unreported",repo:U,qset:H.qsetHash,cold:`${T.score}/${T.total}`,faf:`${N.score}/${N.total}`,sha256:M.hash.slice(0,16)},X.endpoint??wO)}else if(H.cold)FO(H,U);else console.log(`
444
- ${F(`faf bench — ${U}`)} ${D("with .faf")}: ${F(`${V.score}/${V.total}`)} ${B(`tokens ${C6(V.tokens)}`)}`),console.log(B("Run the cold phase too for the full pair: faf bench (protocol)."));return}console.log(`
445
- ${F("faf bench — agent-native protocol")} ${B(`qset ${Q.qsetHash} · ${Q.questions.length} questions`)}
446
- `),console.log(`${F("COLD phase")} ${B("(fresh AI session, repo access)")}`),console.log(' 1. Instruct: "Answer these questions from the repository.'),console.log(' Do NOT read project.faf, CLAUDE.md, AGENTS.md, or any *.faf file."'),console.log(` 2. ${D("faf bench questions")} — hand them over; answers terse, saved as cold.json`),console.log(` 3. ${D("faf bench grade cold.json --cold --tokens <used> --model <name>")}
447
- `),console.log(`${F("FAF phase")} ${B("(same questions, context first)")}`),console.log(' 4. Instruct: "Read project.faf, then answer the same questions." → faf.json'),console.log(` 5. ${D("faf bench grade faf.json --faf --tokens <used> --model <name>")}
448
- `),console.log(B("Grading is mechanical against your own project.faf — the .faf IS the answer key.")),console.log(B(`Receipts carry protocol: in-session (honor-system cold). qset ${Q.qsetHash}.`))}import{existsSync as _O,writeFileSync as CO}from"fs";m();function rz($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
481
+ ${H('Answer terse — the value, not a sentence. Save as JSON: {"1": "...", "2": "..."}')}`);return}if($==="grade"){if(!Z||!tz(Z))console.error("Error: faf bench grade <answers.json> — file not found."),process.exit(2);let G=JSON.parse(oz(Z,"utf-8")),W=G.answers??G,q=uO(Q,W),V={score:q.correct,total:q.total,...X.tokens?{tokens:parseInt(X.tokens,10)}:{},...X.model?{model:X.model}:{}},K=mO(Y),B=K&&K.qsetHash===Q.qsetHash?K:{version:Q.version,qsetHash:Q.qsetHash,protocol:"in-session"};if(X.cold)B.cold=V;else if(X.faf)B.faf=V;else console.error("Error: specify the run mode — --cold (no context) or --faf (after reading project.faf)."),process.exit(2);if(cO(Y,B),X.json){let T=yZ(B,U);console.log(JSON.stringify({...B,receipt:T.hash,perQuestion:q.perQuestion},null,2));return}if(B.cold&&B.faf)dO(B,U);if(X.submit&&B.cold&&B.faf){let{cold:T,faf:N}=B,M=yZ(B,U);iO({date:new Date().toISOString().slice(0,10),model:N.model??T.model??X.model??"unreported",repo:U,qset:B.qsetHash,cold:`${T.score}/${T.total}`,faf:`${N.score}/${N.total}`,sha256:M.hash.slice(0,16)},X.endpoint??lO)}else if(B.cold)pO(B,U);else console.log(`
482
+ ${I(`faf bench — ${U}`)} ${D("with .faf")}: ${I(`${V.score}/${V.total}`)} ${H(`tokens ${b6(V.tokens)}`)}`),console.log(H("Run the cold phase too for the full pair: faf bench (protocol)."));return}console.log(`
483
+ ${I("faf bench — agent-native protocol")} ${H(`qset ${Q.qsetHash} · ${Q.questions.length} questions`)}
484
+ `),console.log(`${I("COLD phase")} ${H("(fresh AI session, repo access)")}`),console.log(' 1. Instruct: "Answer these questions from the repository.'),console.log(' Do NOT read project.faf, CLAUDE.md, AGENTS.md, or any *.faf file."'),console.log(` 2. ${D("faf bench questions")} — hand them over; answers terse, saved as cold.json`),console.log(` 3. ${D("faf bench grade cold.json --cold --tokens <used> --model <name>")}
485
+ `),console.log(`${I("FAF phase")} ${H("(same questions, context first)")}`),console.log(' 4. Instruct: "Read project.faf, then answer the same questions." → faf.json'),console.log(` 5. ${D("faf bench grade faf.json --faf --tokens <used> --model <name>")}
486
+ `),console.log(H("Grading is mechanical against your own project.faf — the .faf IS the answer key.")),console.log(H(`Receipts carry protocol: in-session (honor-system cold). qset ${Q.qsetHash}.`))}import{existsSync as nO,writeFileSync as rO}from"fs";c();function XJ($={}){let Z=h();if(!Z)console.error(`Error: project.faf not found
449
487
 
450
- Run 'faf init' to create one.`),process.exit(2);let X=h(Z),z=H0(X),J=new d0(process.cwd()),Q=J.load()?J.getBirthDNADisplay():null,Y=Q?Q.current:null,U=Y!=null?z.score-Y:0,G=Y!=null&&U!==0,W=Z.replace(/\.faf$/,".fafb"),q=null;if(_O(W)){let V=g2(X);CO(W,V),q=V.length}if($.json)console.log(JSON.stringify({reGrounded:!0,score:z.score,tier:z.tier,baseline:Y,delta:U,drifted:G,fafb:q!=null?{reCompiled:!0,bytes:q}:{reCompiled:!1},journey:J.getJourney()||null},null,2));else{if(console.log(`${D("refresh")} ${B("— re-grounding on the live .faf")}
451
- `),G){let V=U>0?"↑":"↓";console.log(` drift: ${B(`${Y}%`)} ${V} ${F(`${z.score}%`)} ${B(`(${U>0?"+":""}${U})`)}`)}else if(Y!=null)console.log(` no drift ${B(`— steady at ${z.score}%`)}`);else console.log(` baseline set ${B(`— ${z.score}%`)}`);if(q!=null)console.log(` .fafb re-compiled ${B(`(${q} bytes — fast tier current)`)}`);console.log(` re-grounded: ${n$(z.tier)} ${F(`${z.score}%`)}`)}if(J.exists())J.recordGrowth(z.score,["refresh — re-grounded"]);else J.birth(z.score)}var{version:sz}=V3(),g=new eZ;g.name("faf").description("Foundational AI-Context Format — project DNA for any AI").version(sz,"-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(($)=>Y3($));g.command("dna").description("\uD83E\uDDEC Show your FAF DNA journey (birth → growth)").action(()=>h7());g.command("auto").description("Zero to 100% in one command").action(()=>l2());g.command("loop").description("Drive to 100% — source what we can, then ask only the human").option("-r, --rounds <n>","max auto rounds before stopping","5").action(($)=>u7($));g.command("go").description("Guided interview to gold code").option("--resume","Resume previous session").action(($)=>kX($));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)=>h2($,Z));g.command("bench [action] [answersFile]").description("AI-grounding benchmark — cold vs with-faf (the .faf is the answer key)").option("--json","Output as JSON").option("--cold","Grade as the without-context run").option("--faf","Grade as the with-context run").option("--tokens <n>","Tokens used in the run (reported by the agent)").option("--model <name>","Model that answered (reported)").option("--file <path>","Path to project.faf (default: discovered)").option("--submit","Submit the full-pair receipt to the public bench ledger").option("--endpoint <url>","Override the submit endpoint").action(($,Z,X)=>nz($,Z,X));g.command("show").description("Render project.faf → project.html and open it").action(()=>BX());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(($)=>W3($));g.command("compile [file]").description("Compile .faf to .fafb binary").option("--output <path>","Output path").action(($,Z)=>e7($,Z));g.command("decompile <file>").description("Decompile .fafb to JSON").option("--output <path>","Output path").action(($,Z)=>$X($,Z));g.command("git <url>").description("Instant .faf from any GitHub repo").action(($)=>NX($));g.command("export").description("Export context files from .faf").option("--agents","Generate AGENTS.md").option("--cursor","Generate .cursorrules").option("--gemini","Generate GEMINI.md").option("--grok","Wire grok-faf-mcp into .grok/config.toml").option("--conductor","Generate conductor config").option("--html","Generate project.html (visual render of project.faf)").option("--card","Generate MCP Server Card (.well-known/mcp/server-card) with the FAF context-block").option("--all","Generate all formats").action(($)=>Z1($));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)=>q3($,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(($)=>MX($));g.command("formats").description("Show supported formats").action(()=>OX());g.command("clear").description("Clear cached data").action(()=>TX());g.command("convert").description("Convert .faf to other formats").option("--json","Output as JSON").action(($)=>DX($));g.command("context").description("Generate context output").action(()=>IX());g.command("refresh").description("Re-ground on the live .faf — re-score, measure drift vs the DNA baseline, keep .fafb current").option("--json","Output as JSON").action(($)=>rz($));g.command("drift").description("Check context drift").action(()=>RX());g.command("edit <path> <value>").description("Edit .faf fields").action(($,Z)=>FX($,Z));g.command("recover").description("Recover .faf from context files").action(()=>wX());g.command("migrate").description("Migrate .faf to latest version").option("--dry-run","Preview changes without writing").action(($)=>PX($));g.command("pro [subcommand]").description("Pro features & licensing").action(($)=>_X($));g.command("share").description("Share .faf via URL").option("--copy","Copy to clipboard").option("--raw","Output encoded string only").action(($)=>CX($));g.command("demo").description("Demo walkthrough").action(()=>jX());g.command("search <query>").description("Search slots and formats").option("--slots","Search slots only").option("--formats","Search formats only").action(($,Z)=>SX($,Z));g.command("taf").description("Test Archive Format receipt").option("--output <path>","Write receipt to file").action(($)=>bX($));g.command("ai [subcommand]").description("AI-powered features (enhance|analyze)").action(($)=>kz($));g.command("conductor [subcommand] [path]").description("Conductor integration").action(($,Z)=>gz($,Z));g.command("wjttc").description("Audit test suite for WJTTC tier coverage (vendor-neutral)").option("--path <path>","Test directory (default: tests)").option("--strict","Exit non-zero if any tests are untiered").option("--json","Output as JSON for CI consumption").action(($)=>vz($));g.command("bi-sync",{hidden:!0}).action(()=>W3());g.command("status",{hidden:!0}).action(()=>h2(void 0,{status:!0}));g.command("agents",{hidden:!0}).action(()=>Z1({agents:!0}));g.command("cursor",{hidden:!0}).action(()=>Z1({cursor:!0}));g.command("gemini",{hidden:!0}).action(()=>Z1({gemini:!0}));g.command("grok",{hidden:!0}).action(()=>Z1({grok:!0}));g.command("validate",{hidden:!0}).action(($)=>q3($));g.command("yolo",{hidden:!0}).action(()=>Y3({yolo:!0}));if(process.argv.length<=2)(async()=>{let{bold:$,dim:Z,fafCyan:X}=await Promise.resolve().then(() => (m(),V7)),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",U="\x1B[48;2;29;29;29m",G="\x1B[0m";console.log(""),console.log(`\x1B[48;2;29;29;29m ${"\x1B[38;2;150;150;150m"}▄${"\x1B[48;2;150;150;150m"}███████${"\x1B[48;2;29;29;29m"}${"\x1B[38;2;150;150;150m"}▄${"\x1B[0m"}`),console.log(`\x1B[48;2;29;29;29m \x1B[48;2;150;150;150m${"\x1B[38;2;150;150;150m"}█${"\x1B[38;2;29;29;29m"}█${"\x1B[38;2;150;150;150m"}███████${"\x1B[0m"} ${X($("faf"))} ${Z(`v${sz}`)}`);let W="\x1B[38;2;39;174;96m";console.log(`\x1B[48;2;29;29;29m${"\x1B[38;2;150;150;150m"}▀${"\x1B[48;2;150;150;150m"}${"\x1B[38;2;29;29;29m"}▀${"\x1B[48;2;29;29;29m"} \x1B[48;2;150;150;150m${"\x1B[38;2;150;150;150m"}██${"\x1B[48;2;29;29;29m"} \x1B[48;2;150;150;150m${"\x1B[38;2;150;150;150m"}██${"\x1B[48;2;29;29;29m"} \x1B[0m ${Z("Nelly Never Forgets")}`),console.log(`${W}▔▔▔▔▔▔▔▔▔▔▔▔${"\x1B[0m"}`),console.log(`${Z(" "+z)}`),console.log("");try{await h2(void 0,{status:!0})}catch{}console.log(""),console.log(` ${Z("Run")} ${X("faf --help")} ${Z("for commands")}`)})();else g.parse(process.argv);
488
+ Run 'faf init' to create one.`),process.exit(2);let X=v(Z),z=H0(X),J=new i0(process.cwd()),Q=J.load()?J.getBirthDNADisplay():null,Y=Q?Q.current:null,U=Y!=null?z.score-Y:0,G=Y!=null&&U!==0,W=Z.replace(/\.faf$/,".fafb"),q=null;if(nO(W)){let V=c2(X);rO(W,V),q=V.length}if($.json)console.log(JSON.stringify({reGrounded:!0,score:z.score,tier:z.tier,baseline:Y,delta:U,drifted:G,fafb:q!=null?{reCompiled:!0,bytes:q}:{reCompiled:!1},journey:J.getJourney()||null},null,2));else{if(console.log(`${D("refresh")} ${H("— re-grounding on the live .faf")}
489
+ `),G){let V=U>0?"↑":"↓";console.log(` drift: ${H(`${Y}%`)} ${V} ${I(`${z.score}%`)} ${H(`(${U>0?"+":""}${U})`)}`)}else if(Y!=null)console.log(` no drift ${H(`— steady at ${z.score}%`)}`);else console.log(` baseline set ${H(`— ${z.score}%`)}`);if(q!=null)console.log(` .fafb re-compiled ${H(`(${q} bytes — fast tier current)`)}`);console.log(` re-grounded: ${a$(z.tier)} ${I(`${z.score}%`)}`)}if(J.exists())J.recordGrowth(z.score,["refresh — re-grounded"]);else J.birth(z.score)}var{version:zJ}=L3(),g=new z5;g.name("faf").description("Foundational AI-Context Format — project DNA for any AI").version(zJ,"-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(($)=>q3($));g.command("dna").description("\uD83E\uDDEC Show your FAF DNA journey (birth → growth)").action(()=>c7());g.command("auto").description("Zero to 100% in one command").action(()=>s2());g.command("loop").description("Drive to 100% — source what we can, then ask only the human").option("-r, --rounds <n>","max auto rounds before stopping","5").action(($)=>p7($));g.command("go").description("Guided interview to gold code").option("--resume","Resume previous session").action(($)=>cX($));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)=>d2($,Z));g.command("bench [action] [answersFile]").description("AI-grounding benchmark — cold vs with-faf (the .faf is the answer key)").option("--json","Output as JSON").option("--cold","Grade as the without-context run").option("--faf","Grade as the with-context run").option("--tokens <n>","Tokens used in the run (reported by the agent)").option("--model <name>","Model that answered (reported)").option("--file <path>","Path to project.faf (default: discovered)").option("--submit","Submit the full-pair receipt to the public bench ledger").option("--endpoint <url>","Override the submit endpoint").action(($,Z,X)=>ZJ($,Z,X));g.command("show").description("Render project.faf → project.html and open it").action(()=>IX());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(($)=>H3($));g.command("compile [file]").description("Compile .faf to .fafb binary").option("--output <path>","Output path").action(($,Z)=>zX($,Z));g.command("decompile <file>").description("Decompile .fafb to JSON").option("--output <path>","Output path").action(($,Z)=>JX($,Z));g.command("git <url>").description("Instant .faf from any GitHub repo").action(($)=>RX($));g.command("export").description("Export context files from .faf").option("--agents","Generate AGENTS.md").option("--cursor","Generate .cursorrules").option("--gemini","Generate GEMINI.md").option("--copilot","Generate .github/copilot-instructions.md (GitHub Copilot)").option("--grok","Wire grok-faf-mcp into .grok/config.toml").option("--conductor","Generate conductor config").option("--html","Generate project.html (visual render of project.faf)").option("--card","Generate MCP Server Card (.well-known/mcp/server-card) with the FAF context-block").option("--all","Generate all formats").action(($)=>Q1($));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)=>B3($,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(($)=>FX($));g.command("formats").description("Show supported formats").action(()=>wX());g.command("clear").description("Clear cached data").action(()=>PX());g.command("convert").description("Convert .faf to other formats").option("--json","Output as JSON").action(($)=>_X($));g.command("context").description("Generate context output").action(()=>CX());g.command("refresh").description("Re-ground on the live .faf — re-score, measure drift vs the DNA baseline, keep .fafb current").option("--json","Output as JSON").action(($)=>XJ($));g.command("drift").description("Check context drift").action(()=>jX());g.command("edit <path> <value>").description("Edit .faf fields").action(($,Z)=>SX($,Z));g.command("recover").description("Recover .faf from context files").action(()=>bX());g.command("migrate").description("Migrate .faf to latest version").option("--dry-run","Preview changes without writing").action(($)=>xX($));g.command("pro [subcommand]").description("Pro features & licensing").action(($)=>kX($));g.command("share").description("Share .faf via URL").option("--copy","Copy to clipboard").option("--raw","Output encoded string only").action(($)=>yX($));g.command("demo").description("Demo walkthrough").action(()=>gX());g.command("search <query>").description("Search slots and formats").option("--slots","Search slots only").option("--formats","Search formats only").action(($,Z)=>vX($,Z));g.command("taf [subcommand]").description("TAF Receipts — `faf taf setup` wires the CI receipt printer; bare snapshot deprecated → faf score --json").option("--output <path>","Write score snapshot to file").option("--write","taf setup: create .github/workflows/taf.yml").action(($,Z)=>uX($,Z));g.command("ai [subcommand]").description("AI-powered features (enhance|analyze)").action(($)=>cz($));g.command("conductor [subcommand] [path]").description("Conductor integration").action(($,Z)=>lz($,Z));g.command("wjttc").description("Audit test suite for WJTTC tier coverage (vendor-neutral)").option("--path <path>","Test directory (default: tests)").option("--strict","Exit non-zero if any tests are untiered").option("--json","Output as JSON for CI consumption").action(($)=>nz($));g.command("bi-sync",{hidden:!0}).action(()=>H3());g.command("status",{hidden:!0}).action(()=>d2(void 0,{status:!0}));g.command("agents",{hidden:!0}).action(()=>Q1({agents:!0}));g.command("cursor",{hidden:!0}).action(()=>Q1({cursor:!0}));g.command("gemini",{hidden:!0}).action(()=>Q1({gemini:!0}));g.command("grok",{hidden:!0}).action(()=>Q1({grok:!0}));g.command("validate",{hidden:!0}).action(($)=>B3($));g.command("yolo",{hidden:!0}).action(()=>q3({yolo:!0}));if(process.argv.length<=2)(async()=>{let{bold:$,dim:Z,fafCyan:X}=await Promise.resolve().then(() => (c(),L7)),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",U="\x1B[48;2;29;29;29m",G="\x1B[0m";console.log(""),console.log(`\x1B[48;2;29;29;29m ${"\x1B[38;2;150;150;150m"}▄${"\x1B[48;2;150;150;150m"}███████${"\x1B[48;2;29;29;29m"}${"\x1B[38;2;150;150;150m"}▄${"\x1B[0m"}`),console.log(`\x1B[48;2;29;29;29m \x1B[48;2;150;150;150m${"\x1B[38;2;150;150;150m"}█${"\x1B[38;2;29;29;29m"}█${"\x1B[38;2;150;150;150m"}███████${"\x1B[0m"} ${X($("faf"))} ${Z(`v${zJ}`)}`);let W="\x1B[38;2;39;174;96m";console.log(`\x1B[48;2;29;29;29m${"\x1B[38;2;150;150;150m"}▀${"\x1B[48;2;150;150;150m"}${"\x1B[38;2;29;29;29m"}▀${"\x1B[48;2;29;29;29m"} \x1B[48;2;150;150;150m${"\x1B[38;2;150;150;150m"}██${"\x1B[48;2;29;29;29m"} \x1B[48;2;150;150;150m${"\x1B[38;2;150;150;150m"}██${"\x1B[48;2;29;29;29m"} \x1B[0m ${Z("Nelly Never Forgets")}`),console.log(`${W}▔▔▔▔▔▔▔▔▔▔▔▔${"\x1B[0m"}`),console.log(`${Z(" "+z)}`),console.log("");try{await d2(void 0,{status:!0})}catch{}console.log(""),console.log(` ${Z("Run")} ${X("faf --help")} ${Z("for commands")}`)})();else g.parse(process.argv);
452
490
 
453
- //# debugId=6CF076D2AD087F3D64756E2164756E21
491
+ //# debugId=F4E81C9431AD3E1664756E2164756E21
454
492
  //# sourceMappingURL=cli.js.map