faf-cli 7.1.2 → 7.1.4

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 OQ}from"node:module";var WQ=Object.create;var{getPrototypeOf:GQ,defineProperty:o6,getOwnPropertyNames:qQ}=Object;var VQ=Object.prototype.hasOwnProperty;function KQ($){return this[$]}var HQ,BQ,LQ=($,Z,X)=>{var z=$!=null&&typeof $==="object";if(z){var J=Z?HQ??=new WeakMap:BQ??=new WeakMap,Q=J.get($);if(Q)return Q}X=$!=null?WQ(GQ($)):{};let Y=Z||!$||!$.__esModule?o6(X,"default",{value:$,enumerable:!0}):X;for(let U of qQ($))if(!VQ.call(Y,U))o6(Y,U,{get:KQ.bind($,U),enumerable:!0});if(z)J.set($,Y);return Y};var P=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var MQ=($)=>$;function NQ($,Z){this[$]=MQ.bind(null,Z)}var H5=($,Z)=>{for(var X in Z)o6($,X,{get:Z[X],enumerable:!0,configurable:!0,set:NQ.bind(Z,X)})};var y=($,Z)=>()=>($&&(Z=$($=0)),Z);var D0=OQ(import.meta.url);var g1=P((TQ)=>{class t6 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 B5 extends t6{constructor($){super(1,"commander.invalidArgument",$);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}TQ.CommanderError=t6;TQ.InvalidArgumentError=B5});var W2=P((FQ)=>{var{InvalidArgumentError:AQ}=g1();class L5{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 AQ(`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 RQ($){let Z=$.name()+($.variadic===!0?"...":"");return $.required?"<"+Z+">":"["+Z+"]"}FQ.Argument=L5;FQ.humanReadableArgName=RQ});var e6=P((wQ)=>{var{humanReadableArgName:CQ}=W2();class M5{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)=>CQ(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 N5($).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,G=(this.helpWidth??80)-Z-U-2,q;if(G<this.minWidthToWrap||z.preformatted(X))q=X;else q=z.boxWrap(X,G).replace(/\n/g,`
2
+ import{createRequire as TQ}from"node:module";var GQ=Object.create;var{getPrototypeOf:qQ,defineProperty:e3,getOwnPropertyNames:VQ}=Object;var KQ=Object.prototype.hasOwnProperty;function HQ($){return this[$]}var BQ,LQ,MQ=($,Z,X)=>{var z=$!=null&&typeof $==="object";if(z){var J=Z?BQ??=new WeakMap:LQ??=new WeakMap,Q=J.get($);if(Q)return Q}X=$!=null?GQ(qQ($)):{};let Y=Z||!$||!$.__esModule?e3(X,"default",{value:$,enumerable:!0}):X;for(let U of VQ($))if(!KQ.call(Y,U))e3(Y,U,{get:HQ.bind($,U),enumerable:!0});if(z)J.set($,Y);return Y};var _=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var NQ=($)=>$;function OQ($,Z){this[$]=NQ.bind(null,Z)}var BZ=($,Z)=>{for(var X in Z)e3($,X,{get:Z[X],enumerable:!0,configurable:!0,set:OQ.bind(Z,X)})};var f=($,Z)=>()=>($&&(Z=$($=0)),Z);var I0=TQ(import.meta.url);var h1=_((DQ)=>{class $6 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 LZ extends $6{constructor($){super(1,"commander.invalidArgument",$);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}DQ.CommanderError=$6;DQ.InvalidArgumentError=LZ});var q2=_((_Q)=>{var{InvalidArgumentError:RQ}=h1();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 RQ(`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 FQ($){let Z=$.name()+($.variadic===!0?"...":"");return $.required?"<"+Z+">":"["+Z+"]"}_Q.Argument=MZ;_Q.humanReadableArgName=FQ});var Z6=_((EQ)=>{var{humanReadableArgName:wQ}=q2();class NZ{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)=>wQ(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 OZ($).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,G=(this.helpWidth??80)-Z-U-2,q;if(G<this.minWidthToWrap||z.preformatted(X))q=X;else q=z.boxWrap(X,G).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()],W=this.displayWidth(U[0]);Y.forEach((G)=>{let q=this.displayWidth(G);if(W+q<=Z){U.push(G),W+=q;return}J.push(U.join(""));let V=G.trimStart();U=[V],W=this.displayWidth(V)}),J.push(U.join(""))}),J.join(`
6
- `)}}function N5($){let Z=/\x1b\[\d*(;\d*)*m/g;return $.replace(Z,"")}wQ.Help=M5;wQ.stripColor=N5});var $8=P((bQ)=>{var{InvalidArgumentError:SQ}=g1();class T5{constructor($,Z){this.flags=$,this.description=Z||"",this.required=$.includes("<"),this.optional=$.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test($),this.mandatory=!1;let X=xQ($);if(this.short=X.shortFlag,this.long=X.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default($,Z){return this.defaultValue=$,this.defaultValueDescription=Z,this}preset($){return this.presetArg=$,this}conflicts($){return this.conflictsWith=this.conflictsWith.concat($),this}implies($){let Z=$;if(typeof $==="string")Z={[$]:!0};return this.implied=Object.assign(this.implied||{},Z),this}env($){return this.envVar=$,this}argParser($){return this.parseArg=$,this}makeOptionMandatory($=!0){return this.mandatory=!!$,this}hideHelp($=!0){return this.hidden=!!$,this}_collectValue($,Z){if(Z===this.defaultValue||!Array.isArray(Z))return[$];return Z.push($),Z}choices($){return this.argChoices=$.slice(),this.parseArg=(Z,X)=>{if(!this.argChoices.includes(Z))throw new SQ(`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 O5(this.name().replace(/^no-/,""));return O5(this.name())}helpGroup($){return this.helpGroupHeading=$,this}is($){return this.short===$||this.long===$}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class D5{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 O5($){return $.split("-").reduce((Z,X)=>{return Z+X[0].toUpperCase()+X.slice(1)})}function xQ($){let Z,X,z=/^-[^-]$/,J=/^--[^-]/,Q=$.split(/[ |,]+/).concat("guard");if(z.test(Q[0]))Z=Q.shift();if(J.test(Q[0]))X=Q.shift();if(!Z&&z.test(Q[0]))Z=Q.shift();if(!Z&&J.test(Q[0]))Z=X,X=Q.shift();if(Q[0].startsWith("-")){let Y=Q[0],U=`option creation failed due to '${Y}' in option flags '${$}'`;if(/^-[^-][^-]/.test(Y))throw Error(`${U}
6
+ `)}}function OZ($){let Z=/\x1b\[\d*(;\d*)*m/g;return $.replace(Z,"")}EQ.Help=NZ;EQ.stripColor=OZ});var X6=_((kQ)=>{var{InvalidArgumentError:xQ}=h1();class DZ{constructor($,Z){this.flags=$,this.description=Z||"",this.required=$.includes("<"),this.optional=$.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test($),this.mandatory=!1;let X=bQ($);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 xQ(`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 TZ(this.name().replace(/^no-/,""));return TZ(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 TZ($){return $.split("-").reduce((Z,X)=>{return Z+X[0].toUpperCase()+X.slice(1)})}function bQ($){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}}bQ.Option=T5;bQ.DualOptions=D5});var I5=P((vQ)=>{function fQ($,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 gQ($,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=fQ($,Y),W=Math.max($.length,Y.length);if((W-U)/W>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}}kQ.Option=DZ;kQ.DualOptions=IZ});var AZ=_((hQ)=>{function gQ($,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 vQ($,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=gQ($,Y),W=Math.max($.length,Y.length);if((W-U)/W>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""}vQ.suggestSimilar=gQ});var _5=P((iQ)=>{var uQ=D0("node:events").EventEmitter,Z8=D0("node:child_process"),d0=D0("node:path"),G2=D0("node:fs"),l=D0("node:process"),{Argument:mQ,humanReadableArgName:cQ}=W2(),{CommanderError:X8}=g1(),{Help:dQ,stripColor:pQ}=e6(),{Option:A5,DualOptions:lQ}=$8(),{suggestSimilar:R5}=I5();class J8 extends uQ{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:()=>z8()??(l.stdout.isTTY&&l.stdout.hasColors?.()),getErrHasColors:()=>z8()??(l.stderr.isTTY&&l.stderr.hasColors?.()),stripColor:(Z)=>pQ(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 J8($)}createHelp(){return Object.assign(new dQ,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 mQ($,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 X8($,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 A5($,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 A5)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,W)=>{let G=Y.exec(U);return G?G[0]:W},Q.default(J).argParser(z)}else Q.default(z);return this.addOption(Q)}option($,Z,X,z){return this._optionEx({},$,Z,X,z)}requiredOption($,Z,X,z){return this._optionEx({mandatory:!0},$,Z,X,z)}combineFlagAndOptionalValue($=!0){return this._combineFlagAndOptionalValue=!!$,this}allowUnknownOption($=!0){return this._allowUnknownOption=!!$,this}allowExcessArguments($=!0){return this._allowExcessArguments=!!$,this}enablePositionalOptions($=!0){return this._enablePositionalOptions=!!$,this}passThroughOptions($=!0){return this._passThroughOptions=!!$,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties($=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!$,this}getOptionValue($){if(this._storeOptionsAsProperties)return this[$];return this._optionValues[$]}setOptionValue($,Z){return this.setOptionValueWithSource($,Z,void 0)}setOptionValueWithSource($,Z,X){if(this._storeOptionsAsProperties)this[$]=Z;else this._optionValues[$]=Z;return this._optionValueSources[$]=X,this}getOptionValueSource($){return this._optionValueSources[$]}getOptionValueSourceWithGlobals($){let Z;return this._getCommandAndAncestors().forEach((X)=>{if(X.getOptionValueSource($)!==void 0)Z=X.getOptionValueSource($)}),Z}_prepareUserArgs($,Z){if($!==void 0&&!Array.isArray($))throw Error("first parameter to parse must be array or undefined");if(Z=Z||{},$===void 0&&Z.from===void 0){if(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(G2.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""}hQ.suggestSimilar=vQ});var PZ=_((nQ)=>{var mQ=I0("node:events").EventEmitter,z6=I0("node:child_process"),p0=I0("node:path"),V2=I0("node:fs"),n=I0("node:process"),{Argument:cQ,humanReadableArgName:dQ}=q2(),{CommanderError:J6}=h1(),{Help:pQ,stripColor:lQ}=Z6(),{Option:RZ,DualOptions:iQ}=X6(),{suggestSimilar:FZ}=AZ();class Y6 extends mQ{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)=>n.stdout.write(Z),writeErr:(Z)=>n.stderr.write(Z),outputError:(Z,X)=>X(Z),getOutHelpWidth:()=>n.stdout.isTTY?n.stdout.columns:void 0,getErrHelpWidth:()=>n.stderr.isTTY?n.stderr.columns:void 0,getOutHasColors:()=>Q6()??(n.stdout.isTTY&&n.stdout.hasColors?.()),getErrHasColors:()=>Q6()??(n.stderr.isTTY&&n.stderr.hasColors?.()),stripColor:(Z)=>lQ(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 Y6($)}createHelp(){return Object.assign(new pQ,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 cQ($,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 J6($,Z,X));n.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,W)=>{let G=Y.exec(U);return G?G[0]:W},Q.default(J).argParser(z)}else Q.default(z);return this.addOption(Q)}option($,Z,X,z){return this._optionEx({},$,Z,X,z)}requiredOption($,Z,X,z){return this._optionEx({mandatory:!0},$,Z,X,z)}combineFlagAndOptionalValue($=!0){return this._combineFlagAndOptionalValue=!!$,this}allowUnknownOption($=!0){return this._allowUnknownOption=!!$,this}allowExcessArguments($=!0){return this._allowExcessArguments=!!$,this}enablePositionalOptions($=!0){return this._enablePositionalOptions=!!$,this}passThroughOptions($=!0){return this._passThroughOptions=!!$,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties($=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!$,this}getOptionValue($){if(this._storeOptionsAsProperties)return this[$];return this._optionValues[$]}setOptionValue($,Z){return this.setOptionValueWithSource($,Z,void 0)}setOptionValueWithSource($,Z,X){if(this._storeOptionsAsProperties)this[$]=Z;else this._optionValues[$]=Z;return this._optionValueSources[$]=X,this}getOptionValueSource($){return this._optionValueSources[$]}getOptionValueSourceWithGlobals($){let Z;return this._getCommandAndAncestors().forEach((X)=>{if(X.getOptionValueSource($)!==void 0)Z=X.getOptionValueSource($)}),Z}_prepareUserArgs($,Z){if($!==void 0&&!Array.isArray($))throw Error("first parameter to parse must be array or undefined");if(Z=Z||{},$===void 0&&Z.from===void 0){if(n.versions?.electron)Z.from="electron";let z=n.execArgv??[];if(z.includes("-e")||z.includes("--eval")||z.includes("-p")||z.includes("--print"))Z.from="eval"}if($===void 0)$=n.argv;this.rawArgs=$.slice();let X;switch(Z.from){case void 0:case"node":this._scriptPath=$[1],X=$.slice(2);break;case"electron":if(n.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(V2.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(G,q){let V=d0.resolve(G,q);if(G2.existsSync(V))return V;if(z.includes(d0.extname(q)))return;let K=z.find((H)=>G2.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 G;try{G=G2.realpathSync(this._scriptPath)}catch{G=this._scriptPath}Y=d0.resolve(d0.dirname(G),Y)}if(Y){let G=J(Y,Q);if(!G&&!$._executableFile&&this._scriptPath){let q=d0.basename(this._scriptPath,d0.extname(this._scriptPath));if(q!==this._name)G=J(Y,`${q}-${$._name}`)}Q=G||Q}X=z.includes(d0.extname(Q));let U;if(l.platform!=="win32")if(X)Z.unshift(Q),Z=F5(l.execArgv).concat(Z),U=Z8.spawn(l.argv[0],Z,{stdio:"inherit"});else U=Z8.spawn(Q,Z,{stdio:"inherit"});else this._checkForMissingExecutable(Q,Y,$._name),Z.unshift(Q),Z=F5(l.execArgv).concat(Z),U=Z8.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 W=this._exitCallback;U.on("close",(G)=>{if(G=G??1,!W)l.exit(G);else W(new X8(G,"commander.executeSubCommandAsync","(close)"))}),U.on("error",(G)=>{if(G.code==="ENOENT")this._checkForMissingExecutable(Q,Y,$._name);else if(G.code==="EACCES")throw Error(`'${Q}' not executable`);if(!W)l.exit(1);else{let q=new X8(1,"commander.executeSubCommandAsync","(error)");q.nestedError=G,W(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(G){return G.length>1&&G[0]==="-"}let Q=(G)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(G))return!1;return!this._getCommandAndAncestors().some((q)=>q.options.map((V)=>V.short).some((V)=>/^-\d$/.test(V)))},Y=null,U=null,W=0;while(W<$.length||U){let G=U??$[W++];if(U=null,G==="--"){if(z===X)z.push(G);z.push(...$.slice(W));break}if(Y&&(!J(G)||Q(G))){this.emit(`option:${Y.name()}`,G);continue}if(Y=null,J(G)){let q=this._findOption(G);if(q){if(q.required){let V=$[W++];if(V===void 0)this.optionMissingArgument(q);this.emit(`option:${q.name()}`,V)}else if(q.optional){let V=null;if(W<$.length&&(!J($[W])||Q($[W])))V=$[W++];this.emit(`option:${q.name()}`,V)}else this.emit(`option:${q.name()}`);Y=q.variadic?q:null;continue}}if(G.length>2&&G[0]==="-"&&G[1]!=="-"){let q=this._findOption(`-${G[1]}`);if(q){if(q.required||q.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${q.name()}`,G.slice(2));else this.emit(`option:${q.name()}`),U=`-${G.slice(2)}`;continue}}if(/^--[^=]+=/.test(G)){let q=G.indexOf("="),V=this._findOption(G.slice(0,q));if(V&&(V.required||V.optional)){this.emit(`option:${V.name()}`,G.slice(q+1));continue}}if(z===Z&&J(G)&&!(this.commands.length===0&&Q(G)))z=X;if((this._enablePositionalOptions||this._passThroughOptions)&&Z.length===0&&X.length===0){if(this._findCommand(G)){Z.push(G),X.push(...$.slice(W));break}else if(this._getHelpCommand()&&G===this._getHelpCommand().name()){Z.push(G,...$.slice(W));break}else if(this._defaultCommandName){X.push(G,...$.slice(W));break}}if(this._passThroughOptions){z.push(G,...$.slice(W));break}z.push(G)}return{operands:Z,unknown:X}}opts(){if(this._storeOptionsAsProperties){let $={},Z=this.options.length;for(let X=0;X<Z;X++){let z=this.options[X].attributeName();$[z]=z===this._versionOptionName?this._version:this[z]}return $}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(($,Z)=>Object.assign($,Z.opts()),{})}error($,Z){if(this._outputConfiguration.outputError(`${$}
21
+ - ${z}`;throw Error(J)}_executeSubCommand($,Z){Z=Z.slice();let X=!1,z=[".js",".ts",".tsx",".mjs",".cjs"];function J(G,q){let V=p0.resolve(G,q);if(V2.existsSync(V))return V;if(z.includes(p0.extname(q)))return;let K=z.find((H)=>V2.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 G;try{G=V2.realpathSync(this._scriptPath)}catch{G=this._scriptPath}Y=p0.resolve(p0.dirname(G),Y)}if(Y){let G=J(Y,Q);if(!G&&!$._executableFile&&this._scriptPath){let q=p0.basename(this._scriptPath,p0.extname(this._scriptPath));if(q!==this._name)G=J(Y,`${q}-${$._name}`)}Q=G||Q}X=z.includes(p0.extname(Q));let U;if(n.platform!=="win32")if(X)Z.unshift(Q),Z=_Z(n.execArgv).concat(Z),U=z6.spawn(n.argv[0],Z,{stdio:"inherit"});else U=z6.spawn(Q,Z,{stdio:"inherit"});else this._checkForMissingExecutable(Q,Y,$._name),Z.unshift(Q),Z=_Z(n.execArgv).concat(Z),U=z6.spawn(n.execPath,Z,{stdio:"inherit"});if(!U.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((q)=>{n.on(q,()=>{if(U.killed===!1&&U.exitCode===null)U.kill(q)})});let W=this._exitCallback;U.on("close",(G)=>{if(G=G??1,!W)n.exit(G);else W(new J6(G,"commander.executeSubCommandAsync","(close)"))}),U.on("error",(G)=>{if(G.code==="ENOENT")this._checkForMissingExecutable(Q,Y,$._name);else if(G.code==="EACCES")throw Error(`'${Q}' not executable`);if(!W)n.exit(1);else{let q=new J6(1,"commander.executeSubCommandAsync","(error)");q.nestedError=G,W(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(G){return G.length>1&&G[0]==="-"}let Q=(G)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(G))return!1;return!this._getCommandAndAncestors().some((q)=>q.options.map((V)=>V.short).some((V)=>/^-\d$/.test(V)))},Y=null,U=null,W=0;while(W<$.length||U){let G=U??$[W++];if(U=null,G==="--"){if(z===X)z.push(G);z.push(...$.slice(W));break}if(Y&&(!J(G)||Q(G))){this.emit(`option:${Y.name()}`,G);continue}if(Y=null,J(G)){let q=this._findOption(G);if(q){if(q.required){let V=$[W++];if(V===void 0)this.optionMissingArgument(q);this.emit(`option:${q.name()}`,V)}else if(q.optional){let V=null;if(W<$.length&&(!J($[W])||Q($[W])))V=$[W++];this.emit(`option:${q.name()}`,V)}else this.emit(`option:${q.name()}`);Y=q.variadic?q:null;continue}}if(G.length>2&&G[0]==="-"&&G[1]!=="-"){let q=this._findOption(`-${G[1]}`);if(q){if(q.required||q.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${q.name()}`,G.slice(2));else this.emit(`option:${q.name()}`),U=`-${G.slice(2)}`;continue}}if(/^--[^=]+=/.test(G)){let q=G.indexOf("="),V=this._findOption(G.slice(0,q));if(V&&(V.required||V.optional)){this.emit(`option:${V.name()}`,G.slice(q+1));continue}}if(z===Z&&J(G)&&!(this.commands.length===0&&Q(G)))z=X;if((this._enablePositionalOptions||this._passThroughOptions)&&Z.length===0&&X.length===0){if(this._findCommand(G)){Z.push(G),X.push(...$.slice(W));break}else if(this._getHelpCommand()&&G===this._getHelpCommand().name()){Z.push(G,...$.slice(W));break}else if(this._defaultCommandName){X.push(G,...$.slice(W));break}}if(this._passThroughOptions){z.push(G,...$.slice(W));break}z.push(G)}return{operands:Z,unknown:X}}opts(){if(this._storeOptionsAsProperties){let $={},Z=this.options.length;for(let X=0;X<Z;X++){let z=this.options[X].attributeName();$[z]=z===this._versionOptionName?this._version:this[z]}return $}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(($,Z)=>Object.assign($,Z.opts()),{})}error($,Z){if(this._outputConfiguration.outputError(`${$}
22
22
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
23
23
  `);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
24
- `),this.outputHelp({error:!0});let 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 lQ(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),W=this.options.find((q)=>q.negate&&Y===q.attributeName()),G=this.options.find((q)=>!q.negate&&Y===q.attributeName());if(W&&(W.presetArg===void 0&&U===!1||W.presetArg!==void 0&&U===W.presetArg))return W;return G||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=R5($,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=R5($,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 cQ(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=d0.basename($,d0.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 n.env){let Z=$.attributeName();if(this.getOptionValue(Z)===void 0||["default","config","env"].includes(this.getOptionValueSource(Z)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,n.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new iQ(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),W=this.options.find((q)=>q.negate&&Y===q.attributeName()),G=this.options.find((q)=>!q.negate&&Y===q.attributeName());if(W&&(W.presetArg===void 0&&U===!1||W.presetArg!==void 0&&U===W.presetArg))return W;return G||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=FZ($,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=FZ($,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 dQ(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=p0.basename($,p0.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(n.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 F5($){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 z8(){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}iQ.Command=J8;iQ.useColor=z8});var E5=P((oQ)=>{var{Argument:P5}=W2(),{Command:Q8}=_5(),{CommanderError:sQ,InvalidArgumentError:C5}=g1(),{Help:aQ}=e6(),{Option:w5}=$8();oQ.program=new Q8;oQ.createCommand=($)=>new Q8($);oQ.createOption=($,Z)=>new w5($,Z);oQ.createArgument=($,Z)=>new P5($,Z);oQ.Command=Q8;oQ.Option=w5;oQ.Argument=P5;oQ.Help=aQ;oQ.CommanderError=sQ;oQ.InvalidArgumentError=C5;oQ.InvalidOptionArgumentError=C5});var p=P((MY)=>{var Y8=Symbol.for("yaml.alias"),x5=Symbol.for("yaml.document"),q2=Symbol.for("yaml.map"),b5=Symbol.for("yaml.pair"),U8=Symbol.for("yaml.scalar"),V2=Symbol.for("yaml.seq"),p0=Symbol.for("yaml.node.type"),GY=($)=>!!$&&typeof $==="object"&&$[p0]===Y8,qY=($)=>!!$&&typeof $==="object"&&$[p0]===x5,VY=($)=>!!$&&typeof $==="object"&&$[p0]===q2,KY=($)=>!!$&&typeof $==="object"&&$[p0]===b5,k5=($)=>!!$&&typeof $==="object"&&$[p0]===U8,HY=($)=>!!$&&typeof $==="object"&&$[p0]===V2;function y5($){if($&&typeof $==="object")switch($[p0]){case q2:case V2:return!0}return!1}function BY($){if($&&typeof $==="object")switch($[p0]){case Y8:case q2:case U8:case V2:return!0}return!1}var LY=($)=>(k5($)||y5($))&&!!$.anchor;MY.ALIAS=Y8;MY.DOC=x5;MY.MAP=q2;MY.NODE_TYPE=p0;MY.PAIR=b5;MY.SCALAR=U8;MY.SEQ=V2;MY.hasAnchor=LY;MY.isAlias=GY;MY.isCollection=y5;MY.isDocument=qY;MY.isMap=VY;MY.isNode=BY;MY.isPair=KY;MY.isScalar=k5;MY.isSeq=HY});var v1=P((bY)=>{var Y0=p(),M0=Symbol("break visit"),f5=Symbol("skip children"),u0=Symbol("remove node");function K2($,Z){let X=g5(Z);if(Y0.isDocument($)){if(c$(null,$.contents,X,Object.freeze([$]))===u0)$.contents=null}else c$(null,$,X,Object.freeze([]))}K2.BREAK=M0;K2.SKIP=f5;K2.REMOVE=u0;function c$($,Z,X,z){let J=v5($,Z,X,z);if(Y0.isNode(J)||Y0.isPair(J))return h5($,z,J),c$($,J,X,z);if(typeof J!=="symbol"){if(Y0.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let Q=0;Q<Z.items.length;++Q){let Y=c$(Q,Z.items[Q],X,z);if(typeof Y==="number")Q=Y-1;else if(Y===M0)return M0;else if(Y===u0)Z.items.splice(Q,1),Q-=1}}else if(Y0.isPair(Z)){z=Object.freeze(z.concat(Z));let Q=c$("key",Z.key,X,z);if(Q===M0)return M0;else if(Q===u0)Z.key=null;let Y=c$("value",Z.value,X,z);if(Y===M0)return M0;else if(Y===u0)Z.value=null}}return J}async function H2($,Z){let X=g5(Z);if(Y0.isDocument($)){if(await d$(null,$.contents,X,Object.freeze([$]))===u0)$.contents=null}else await d$(null,$,X,Object.freeze([]))}H2.BREAK=M0;H2.SKIP=f5;H2.REMOVE=u0;async function d$($,Z,X,z){let J=await v5($,Z,X,z);if(Y0.isNode(J)||Y0.isPair(J))return h5($,z,J),d$($,J,X,z);if(typeof J!=="symbol"){if(Y0.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let Q=0;Q<Z.items.length;++Q){let Y=await d$(Q,Z.items[Q],X,z);if(typeof Y==="number")Q=Y-1;else if(Y===M0)return M0;else if(Y===u0)Z.items.splice(Q,1),Q-=1}}else if(Y0.isPair(Z)){z=Object.freeze(z.concat(Z));let Q=await d$("key",Z.key,X,z);if(Q===M0)return M0;else if(Q===u0)Z.key=null;let Y=await d$("value",Z.value,X,z);if(Y===M0)return M0;else if(Y===u0)Z.value=null}}return J}function g5($){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 v5($,Z,X,z){if(typeof X==="function")return X($,Z,z);if(Y0.isMap(Z))return X.Map?.($,Z,z);if(Y0.isSeq(Z))return X.Seq?.($,Z,z);if(Y0.isPair(Z))return X.Pair?.($,Z,z);if(Y0.isScalar(Z))return X.Scalar?.($,Z,z);if(Y0.isAlias(Z))return X.Alias?.($,Z,z);return}function h5($,Z,X){let z=Z[Z.length-1];if(Y0.isCollection(z))z.items[$]=X;else if(Y0.isPair(z))if($==="key")z.key=X;else z.value=X;else if(Y0.isDocument(z))z.contents=X;else{let J=Y0.isAlias(z)?"alias":"scalar";throw Error(`Cannot replace node with ${J} parent`)}}bY.visit=K2;bY.visitAsync=H2});var W8=P((hY)=>{var u5=p(),fY=v1(),gY={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},vY=($)=>$.replace(/[!,[\]{}]/g,(Z)=>gY[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+vY($.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&&u5.isNode($.contents)){let J={};fY.visit($.contents,(Q,Y)=>{if(u5.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:"};hY.Directives=w0});var B2=P((pY)=>{var m5=p(),mY=v1();function cY($){if(/[\x00-\x19\s,[\]{}]/.test($)){let X=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(X)}return!0}function c5($){let Z=new Set;return mY.visit($,{Value(X,z){if(z.anchor)Z.add(z.anchor)}}),Z}function d5($,Z){for(let X=1;;++X){let z=`${$}${X}`;if(!Z.has(z))return z}}function dY($,Z){let X=[],z=new Map,J=null;return{onAnchor:(Q)=>{X.push(Q),J??(J=c5($));let Y=d5(Z,J);return J.add(Y),Y},setAnchors:()=>{for(let Q of X){let Y=z.get(Q);if(typeof Y==="object"&&Y.anchor&&(m5.isScalar(Y.node)||m5.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}}pY.anchorIsValid=cY;pY.anchorNames=c5;pY.createNodeAnchors=dY;pY.findNewAnchor=d5});var G8=P((sY)=>{function h1($,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=h1($,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=h1($,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=h1($,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=h1($,z,J,Q);if(Y===void 0)delete z[J];else if(Y!==Q)z[J]=Y}return $.call(Z,X,z)}sY.applyReviver=h1});var z$=P((tY)=>{var oY=p();function p5($,Z,X){if(Array.isArray($))return $.map((z,J)=>p5(z,String(J),X));if($&&typeof $.toJSON==="function"){if(!X||!oY.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 $}tY.toJS=p5});var L2=P((XU)=>{var $U=G8(),l5=p(),ZU=z$();class i5{constructor($){Object.defineProperty(this,l5.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(!l5.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=ZU.toJS(this,"",Q);if(typeof z==="function")for(let{count:U,res:W}of Q.anchors.values())z(W,U);return typeof J==="function"?$U.applyReviver(J,{"":Y},"",Y):Y}}XU.NodeBase=i5});var u1=P((WU)=>{var JU=B2(),QU=v1(),p$=p(),YU=L2(),UU=z$();class n5 extends YU.NodeBase{constructor($){super(p$.ALIAS);this.source=$,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve($,Z){let X;if(Z?.aliasResolveCache)X=Z.aliasResolveCache;else if(X=[],QU.visit($,{Node:(J,Q)=>{if(p$.isAlias(Q)||p$.hasAnchor(Q))X.push(Q)}}),Z)Z.aliasResolveCache=X;let z=void 0;for(let J of X){if(J===this)break;if(J.anchor===this.source)z=J}return z}toJSON($,Z){if(!Z)return{source:this.source};let{anchors:X,doc:z,maxAliasCount:J}=Z,Q=this.resolve(z,Z);if(!Q){let U=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(U)}let Y=X.get(Q);if(!Y)UU.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=M2(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(JU.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 M2($,Z,X){if(p$.isAlias(Z)){let z=Z.resolve($),J=X&&z&&X.get(z);return J?J.count*J.aliasCount:0}else if(p$.isCollection(Z)){let z=0;for(let J of Z.items){let Q=M2($,J,X);if(Q>z)z=Q}return z}else if(p$.isPair(Z)){let z=M2($,Z.key,X),J=M2($,Z.value,X);return Math.max(z,J)}return 1}WU.Alias=n5});var Z0=P((BU)=>{var qU=p(),VU=L2(),KU=z$(),HU=($)=>!$||typeof $!=="function"&&typeof $!=="object";class R$ extends VU.NodeBase{constructor($){super(qU.SCALAR);this.value=$}toJSON($,Z){return Z?.keep?this.value:KU.toJS(this.value,$,Z)}toString(){return String(this.value)}}R$.BLOCK_FOLDED="BLOCK_FOLDED";R$.BLOCK_LITERAL="BLOCK_LITERAL";R$.PLAIN="PLAIN";R$.QUOTE_DOUBLE="QUOTE_DOUBLE";R$.QUOTE_SINGLE="QUOTE_SINGLE";BU.Scalar=R$;BU.isScalarValue=HU});var m1=P((IU)=>{var NU=u1(),F$=p(),r5=Z0(),OU="tag:yaml.org,2002:";function TU($,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 DU($,Z,X){if(F$.isDocument($))$=$.contents;if(F$.isNode($))return $;if(F$.isPair($)){let V=X.schema[F$.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,W=void 0;if(z&&$&&typeof $==="object")if(W=U.get($),W)return W.anchor??(W.anchor=J($)),new NU.Alias(W.anchor);else W={anchor:null,node:null},U.set($,W);if(Z?.startsWith("!!"))Z=OU+Z.slice(2);let G=TU($,Z,Y.tags);if(!G){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let V=new r5.Scalar($);if(W)W.node=V;return V}G=$ instanceof Map?Y[F$.MAP]:(Symbol.iterator in Object($))?Y[F$.SEQ]:Y[F$.MAP]}if(Q)Q(G),delete X.onTagObj;let q=G?.createNode?G.createNode(X.schema,$,X):typeof G?.nodeClass?.from==="function"?G.nodeClass.from(X.schema,$,X):new r5.Scalar($);if(Z)q.tag=Z;else if(!G.default)q.tag=G.tag;if(W)W.node=q;return q}IU.createNode=DU});var N2=P((_U)=>{var RU=m1(),m0=p(),FU=L2();function q8($,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 RU.createNode(z,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var s5=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class a5 extends FU.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)=>m0.isNode(X)||m0.isPair(X)?X.clone($):X),this.range)Z.range=this.range.slice();return Z}addIn($,Z){if(s5($))this.add(Z);else{let[X,...z]=$,J=this.get(X,!0);if(m0.isCollection(J))J.addIn(z,Z);else if(J===void 0&&this.schema)this.set(X,q8(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(m0.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&&m0.isScalar(J)?J.value:J;else return m0.isCollection(J)?J.getIn(z,Z):void 0}hasAllNullValues($){return this.items.every((Z)=>{if(!m0.isPair(Z))return!1;let X=Z.value;return X==null||$&&m0.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 m0.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(m0.isCollection(J))J.setIn(z,Z);else if(J===void 0&&this.schema)this.set(X,q8(this.schema,z,Z));else throw Error(`Expected YAML collection at ${X}. Remaining path: ${z}`)}}}_U.Collection=a5;_U.collectionFromPath=q8;_U.isEmptyPath=s5});var c1=P((SU)=>{var EU=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function V8($,Z){if(/^\n+$/.test($))return $.substring(1);return Z?$.replace(/^(?! *$)/gm,Z):$}var jU=($,Z,X)=>$.endsWith(`
29
- `)?V8(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 _Z($){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 Q6(){if(n.env.NO_COLOR||n.env.FORCE_COLOR==="0"||n.env.FORCE_COLOR==="false")return!1;if(n.env.FORCE_COLOR||n.env.CLICOLOR_FORCE!==void 0)return!0;return}nQ.Command=Y6;nQ.useColor=Q6});var jZ=_((tQ)=>{var{Argument:CZ}=q2(),{Command:U6}=PZ(),{CommanderError:aQ,InvalidArgumentError:wZ}=h1(),{Help:oQ}=Z6(),{Option:EZ}=X6();tQ.program=new U6;tQ.createCommand=($)=>new U6($);tQ.createOption=($,Z)=>new EZ($,Z);tQ.createArgument=($,Z)=>new CZ($,Z);tQ.Command=U6;tQ.Option=EZ;tQ.Argument=CZ;tQ.Help=oQ;tQ.CommanderError=aQ;tQ.InvalidArgumentError=wZ;tQ.InvalidOptionArgumentError=wZ});var l=_((NY)=>{var W6=Symbol.for("yaml.alias"),bZ=Symbol.for("yaml.document"),K2=Symbol.for("yaml.map"),kZ=Symbol.for("yaml.pair"),G6=Symbol.for("yaml.scalar"),H2=Symbol.for("yaml.seq"),l0=Symbol.for("yaml.node.type"),qY=($)=>!!$&&typeof $==="object"&&$[l0]===W6,VY=($)=>!!$&&typeof $==="object"&&$[l0]===bZ,KY=($)=>!!$&&typeof $==="object"&&$[l0]===K2,HY=($)=>!!$&&typeof $==="object"&&$[l0]===kZ,yZ=($)=>!!$&&typeof $==="object"&&$[l0]===G6,BY=($)=>!!$&&typeof $==="object"&&$[l0]===H2;function fZ($){if($&&typeof $==="object")switch($[l0]){case K2:case H2:return!0}return!1}function LY($){if($&&typeof $==="object")switch($[l0]){case W6:case K2:case G6:case H2:return!0}return!1}var MY=($)=>(yZ($)||fZ($))&&!!$.anchor;NY.ALIAS=W6;NY.DOC=bZ;NY.MAP=K2;NY.NODE_TYPE=l0;NY.PAIR=kZ;NY.SCALAR=G6;NY.SEQ=H2;NY.hasAnchor=MY;NY.isAlias=qY;NY.isCollection=fZ;NY.isDocument=VY;NY.isMap=KY;NY.isNode=LY;NY.isPair=HY;NY.isScalar=yZ;NY.isSeq=BY});var u1=_((kY)=>{var U0=l(),N0=Symbol("break visit"),gZ=Symbol("skip children"),m0=Symbol("remove node");function B2($,Z){let X=vZ(Z);if(U0.isDocument($)){if(p$(null,$.contents,X,Object.freeze([$]))===m0)$.contents=null}else p$(null,$,X,Object.freeze([]))}B2.BREAK=N0;B2.SKIP=gZ;B2.REMOVE=m0;function p$($,Z,X,z){let J=hZ($,Z,X,z);if(U0.isNode(J)||U0.isPair(J))return uZ($,z,J),p$($,J,X,z);if(typeof J!=="symbol"){if(U0.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let Q=0;Q<Z.items.length;++Q){let Y=p$(Q,Z.items[Q],X,z);if(typeof Y==="number")Q=Y-1;else if(Y===N0)return N0;else if(Y===m0)Z.items.splice(Q,1),Q-=1}}else if(U0.isPair(Z)){z=Object.freeze(z.concat(Z));let Q=p$("key",Z.key,X,z);if(Q===N0)return N0;else if(Q===m0)Z.key=null;let Y=p$("value",Z.value,X,z);if(Y===N0)return N0;else if(Y===m0)Z.value=null}}return J}async function L2($,Z){let X=vZ(Z);if(U0.isDocument($)){if(await l$(null,$.contents,X,Object.freeze([$]))===m0)$.contents=null}else await l$(null,$,X,Object.freeze([]))}L2.BREAK=N0;L2.SKIP=gZ;L2.REMOVE=m0;async function l$($,Z,X,z){let J=await hZ($,Z,X,z);if(U0.isNode(J)||U0.isPair(J))return uZ($,z,J),l$($,J,X,z);if(typeof J!=="symbol"){if(U0.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let Q=0;Q<Z.items.length;++Q){let Y=await l$(Q,Z.items[Q],X,z);if(typeof Y==="number")Q=Y-1;else if(Y===N0)return N0;else if(Y===m0)Z.items.splice(Q,1),Q-=1}}else if(U0.isPair(Z)){z=Object.freeze(z.concat(Z));let Q=await l$("key",Z.key,X,z);if(Q===N0)return N0;else if(Q===m0)Z.key=null;let Y=await l$("value",Z.value,X,z);if(Y===N0)return N0;else if(Y===m0)Z.value=null}}return J}function vZ($){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 hZ($,Z,X,z){if(typeof X==="function")return X($,Z,z);if(U0.isMap(Z))return X.Map?.($,Z,z);if(U0.isSeq(Z))return X.Seq?.($,Z,z);if(U0.isPair(Z))return X.Pair?.($,Z,z);if(U0.isScalar(Z))return X.Scalar?.($,Z,z);if(U0.isAlias(Z))return X.Alias?.($,Z,z);return}function uZ($,Z,X){let z=Z[Z.length-1];if(U0.isCollection(z))z.items[$]=X;else if(U0.isPair(z))if($==="key")z.key=X;else z.value=X;else if(U0.isDocument(z))z.contents=X;else{let J=U0.isAlias(z)?"alias":"scalar";throw Error(`Cannot replace node with ${J} parent`)}}kY.visit=B2;kY.visitAsync=L2});var q6=_((uY)=>{var mZ=l(),gY=u1(),vY={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},hY=($)=>$.replace(/[!,[\]{}]/g,(Z)=>vY[Z]);class E0{constructor($,Z){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},E0.defaultYaml,$),this.tags=Object.assign({},E0.defaultTags,Z)}clone(){let $=new E0(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new E0(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:E0.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},E0.defaultTags);break}return $}add($,Z){if(this.atNextDocument)this.yaml={explicit:E0.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},E0.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+hY($.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&&mZ.isNode($.contents)){let J={};gY.visit($.contents,(Q,Y)=>{if(mZ.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
+ `)}}E0.defaultYaml={explicit:!1,version:"1.2"};E0.defaultTags={"!!":"tag:yaml.org,2002:"};uY.Directives=E0});var M2=_((lY)=>{var cZ=l(),cY=u1();function dY($){if(/[\x00-\x19\s,[\]{}]/.test($)){let X=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(X)}return!0}function dZ($){let Z=new Set;return cY.visit($,{Value(X,z){if(z.anchor)Z.add(z.anchor)}}),Z}function pZ($,Z){for(let X=1;;++X){let z=`${$}${X}`;if(!Z.has(z))return z}}function pY($,Z){let X=[],z=new Map,J=null;return{onAnchor:(Q)=>{X.push(Q),J??(J=dZ($));let Y=pZ(Z,J);return J.add(Y),Y},setAnchors:()=>{for(let Q of X){let Y=z.get(Q);if(typeof Y==="object"&&Y.anchor&&(cZ.isScalar(Y.node)||cZ.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}}lY.anchorIsValid=dY;lY.anchorNames=dZ;lY.createNodeAnchors=pY;lY.findNewAnchor=pZ});var V6=_((aY)=>{function m1($,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=m1($,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=m1($,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=m1($,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=m1($,z,J,Q);if(Y===void 0)delete z[J];else if(Y!==Q)z[J]=Y}return $.call(Z,X,z)}aY.applyReviver=m1});var J$=_((eY)=>{var tY=l();function lZ($,Z,X){if(Array.isArray($))return $.map((z,J)=>lZ(z,String(J),X));if($&&typeof $.toJSON==="function"){if(!X||!tY.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 $}eY.toJS=lZ});var N2=_((zU)=>{var ZU=V6(),iZ=l(),XU=J$();class nZ{constructor($){Object.defineProperty(this,iZ.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(!iZ.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=XU.toJS(this,"",Q);if(typeof z==="function")for(let{count:U,res:W}of Q.anchors.values())z(W,U);return typeof J==="function"?ZU.applyReviver(J,{"":Y},"",Y):Y}}zU.NodeBase=nZ});var c1=_((GU)=>{var QU=M2(),YU=u1(),i$=l(),UU=N2(),WU=J$();class rZ extends UU.NodeBase{constructor($){super(i$.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=[],YU.visit($,{Node:(J,Q)=>{if(i$.isAlias(Q)||i$.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)WU.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=O2(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(QU.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 O2($,Z,X){if(i$.isAlias(Z)){let z=Z.resolve($),J=X&&z&&X.get(z);return J?J.count*J.aliasCount:0}else if(i$.isCollection(Z)){let z=0;for(let J of Z.items){let Q=O2($,J,X);if(Q>z)z=Q}return z}else if(i$.isPair(Z)){let z=O2($,Z.key,X),J=O2($,Z.value,X);return Math.max(z,J)}return 1}GU.Alias=rZ});var X0=_((LU)=>{var VU=l(),KU=N2(),HU=J$(),BU=($)=>!$||typeof $!=="function"&&typeof $!=="object";class _$ extends KU.NodeBase{constructor($){super(VU.SCALAR);this.value=$}toJSON($,Z){return Z?.keep?this.value:HU.toJS(this.value,$,Z)}toString(){return String(this.value)}}_$.BLOCK_FOLDED="BLOCK_FOLDED";_$.BLOCK_LITERAL="BLOCK_LITERAL";_$.PLAIN="PLAIN";_$.QUOTE_DOUBLE="QUOTE_DOUBLE";_$.QUOTE_SINGLE="QUOTE_SINGLE";LU.Scalar=_$;LU.isScalarValue=BU});var d1=_((AU)=>{var OU=c1(),P$=l(),sZ=X0(),TU="tag:yaml.org,2002:";function DU($,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 IU($,Z,X){if(P$.isDocument($))$=$.contents;if(P$.isNode($))return $;if(P$.isPair($)){let V=X.schema[P$.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,W=void 0;if(z&&$&&typeof $==="object")if(W=U.get($),W)return W.anchor??(W.anchor=J($)),new OU.Alias(W.anchor);else W={anchor:null,node:null},U.set($,W);if(Z?.startsWith("!!"))Z=TU+Z.slice(2);let G=DU($,Z,Y.tags);if(!G){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let V=new sZ.Scalar($);if(W)W.node=V;return V}G=$ instanceof Map?Y[P$.MAP]:(Symbol.iterator in Object($))?Y[P$.SEQ]:Y[P$.MAP]}if(Q)Q(G),delete X.onTagObj;let q=G?.createNode?G.createNode(X.schema,$,X):typeof G?.nodeClass?.from==="function"?G.nodeClass.from(X.schema,$,X):new sZ.Scalar($);if(Z)q.tag=Z;else if(!G.default)q.tag=G.tag;if(W)W.node=q;return q}AU.createNode=IU});var T2=_((PU)=>{var FU=d1(),c0=l(),_U=N2();function K6($,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 FU.createNode(z,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var aZ=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class oZ extends _U.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)=>c0.isNode(X)||c0.isPair(X)?X.clone($):X),this.range)Z.range=this.range.slice();return Z}addIn($,Z){if(aZ($))this.add(Z);else{let[X,...z]=$,J=this.get(X,!0);if(c0.isCollection(J))J.addIn(z,Z);else if(J===void 0&&this.schema)this.set(X,K6(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(c0.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&&c0.isScalar(J)?J.value:J;else return c0.isCollection(J)?J.getIn(z,Z):void 0}hasAllNullValues($){return this.items.every((Z)=>{if(!c0.isPair(Z))return!1;let X=Z.value;return X==null||$&&c0.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 c0.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(c0.isCollection(J))J.setIn(z,Z);else if(J===void 0&&this.schema)this.set(X,K6(this.schema,z,Z));else throw Error(`Expected YAML collection at ${X}. Remaining path: ${z}`)}}}PU.Collection=oZ;PU.collectionFromPath=K6;PU.isEmptyPath=aZ});var p1=_((xU)=>{var jU=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function H6($,Z){if(/^\n+$/.test($))return $.substring(1);return Z?$.replace(/^(?! *$)/gm,Z):$}var SU=($,Z,X)=>$.endsWith(`
29
+ `)?H6(X,Z):X.includes(`
30
30
  `)?`
31
- `+V8(X,Z):($.endsWith(" ")?"":" ")+X;SU.indentComment=V8;SU.lineComment=jU;SU.stringifyComment=EU});var t5=P((fU)=>{function yU($,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 W=Math.max(1+Q,1+J-Z.length);if($.length<=W)return $;let G=[],q={},V=J-Z.length;if(typeof z==="number")if(z>J-Math.max(2,Q))G.push(0);else V=J-z;let K=void 0,H=void 0,T=!1,B=-1,N=-1,_=-1;if(X==="block"){if(B=o5($,B,Z.length),B!==-1)V=B+W}for(let j;j=$[B+=1];){if(X==="quoted"&&j==="\\"){switch(N=B,$[B+1]){case"x":B+=3;break;case"u":B+=5;break;case"U":B+=9;break;default:B+=1}_=B}if(j===`
32
- `){if(X==="block")B=o5($,B,Z.length);V=B+Z.length+W,K=void 0}else{if(j===" "&&H&&H!==" "&&H!==`
33
- `&&H!=="\t"){let k=$[B+1];if(k&&k!==" "&&k!==`
34
- `&&k!=="\t")K=B}if(B>=V)if(K)G.push(K),V=K+W,K=void 0;else if(X==="quoted"){while(H===" "||H==="\t")H=j,j=$[B+=1],T=!0;let k=B>_+1?B-2:N-1;if(q[k])return $;G.push(k),q[k]=!0,V=k+W,K=void 0}else T=!0}H=j}if(T&&U)U();if(G.length===0)return $;if(Y)Y();let w=$.slice(0,G[0]);for(let j=0;j<G.length;++j){let k=G[j],D=G[j+1]||$.length;if(k===0)w=`
35
- ${Z}${$.slice(0,D)}`;else{if(X==="quoted"&&q[k])w+=`${$[k]}\\`;w+=`
36
- ${Z}${$.slice(k+1,D)}`}}return w}function o5($,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}fU.FOLD_BLOCK="block";fU.FOLD_FLOW="flow";fU.FOLD_QUOTED="quoted";fU.foldFlowLines=yU});var p1=P((pU)=>{var b0=Z0(),J$=t5(),T2=($,Z)=>({indentAtStart:Z?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),D2=($)=>/^(%|---|\.\.\.)/m.test($);function mU($,Z,X){if(!Z||Z<0)return!1;let z=Z-X,J=$.length;if(J<=z)return!1;for(let Q=0,Y=0;Q<J;++Q)if($[Q]===`
38
- `){if(Q-Y>z)return!0;if(Y=Q+1,J-Y<=z)return!1}return!0}function d1($,Z){let X=JSON.stringify($);if(Z.options.doubleQuotedAsJSON)return X;let{implicitKey:z}=Z,J=Z.options.doubleQuotedMinMultiLineLength,Q=Z.indent||(D2($)?" ":""),Y="",U=0;for(let W=0,G=X[W];G;G=X[++W]){if(G===" "&&X[W+1]==="\\"&&X[W+2]==="n")Y+=X.slice(U,W)+"\\ ",W+=1,U=W,G="\\";if(G==="\\")switch(X[W+1]){case"u":{Y+=X.slice(U,W);let q=X.substr(W+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(W,6)}W+=5,U=W+1}break;case"n":if(z||X[W+2]==='"'||X.length<J)W+=1;else{Y+=X.slice(U,W)+`
31
+ `+H6(X,Z):($.endsWith(" ")?"":" ")+X;xU.indentComment=H6;xU.lineComment=SU;xU.stringifyComment=jU});var eZ=_((gU)=>{function fU($,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 W=Math.max(1+Q,1+J-Z.length);if($.length<=W)return $;let G=[],q={},V=J-Z.length;if(typeof z==="number")if(z>J-Math.max(2,Q))G.push(0);else V=J-z;let K=void 0,H=void 0,T=!1,B=-1,N=-1,A=-1;if(X==="block"){if(B=tZ($,B,Z.length),B!==-1)V=B+W}for(let w;w=$[B+=1];){if(X==="quoted"&&w==="\\"){switch(N=B,$[B+1]){case"x":B+=3;break;case"u":B+=5;break;case"U":B+=9;break;default:B+=1}A=B}if(w===`
32
+ `){if(X==="block")B=tZ($,B,Z.length);V=B+Z.length+W,K=void 0}else{if(w===" "&&H&&H!==" "&&H!==`
33
+ `&&H!=="\t"){let b=$[B+1];if(b&&b!==" "&&b!==`
34
+ `&&b!=="\t")K=B}if(B>=V)if(K)G.push(K),V=K+W,K=void 0;else if(X==="quoted"){while(H===" "||H==="\t")H=w,w=$[B+=1],T=!0;let b=B>A+1?B-2:N-1;if(q[b])return $;G.push(b),q[b]=!0,V=b+W,K=void 0}else T=!0}H=w}if(T&&U)U();if(G.length===0)return $;if(Y)Y();let C=$.slice(0,G[0]);for(let w=0;w<G.length;++w){let b=G[w],k=G[w+1]||$.length;if(b===0)C=`
35
+ ${Z}${$.slice(0,k)}`;else{if(X==="quoted"&&q[b])C+=`${$[b]}\\`;C+=`
36
+ ${Z}${$.slice(b+1,k)}`}}return C}function tZ($,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}gU.FOLD_BLOCK="block";gU.FOLD_FLOW="flow";gU.FOLD_QUOTED="quoted";gU.foldFlowLines=fU});var i1=_((lU)=>{var f0=X0(),Q$=eZ(),I2=($,Z)=>({indentAtStart:Z?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),A2=($)=>/^(%|---|\.\.\.)/m.test($);function cU($,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 l1($,Z){let X=JSON.stringify($);if(Z.options.doubleQuotedAsJSON)return X;let{implicitKey:z}=Z,J=Z.options.doubleQuotedMinMultiLineLength,Q=Z.indent||(A2($)?" ":""),Y="",U=0;for(let W=0,G=X[W];G;G=X[++W]){if(G===" "&&X[W+1]==="\\"&&X[W+2]==="n")Y+=X.slice(U,W)+"\\ ",W+=1,U=W,G="\\";if(G==="\\")switch(X[W+1]){case"u":{Y+=X.slice(U,W);let q=X.substr(W+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(W,6)}W+=5,U=W+1}break;case"n":if(z||X[W+2]==='"'||X.length<J)W+=1;else{Y+=X.slice(U,W)+`
39
39
 
40
40
  `;while(X[W+2]==="\\"&&X[W+3]==="n"&&X[W+4]!=='"')Y+=`
41
- `,W+=2;if(Y+=Q,X[W+2]===" ")Y+="\\";W+=1,U=W+1}break;default:W+=1}}return Y=U?Y+X.slice(U):X,z?Y:J$.foldFlowLines(Y,Q,J$.FOLD_QUOTED,T2(Z,!1))}function K8($,Z){if(Z.options.singleQuote===!1||Z.implicitKey&&$.includes(`
42
- `)||/[ \t]\n|\n[ \t]/.test($))return d1($,Z);let X=Z.indent||(D2($)?" ":""),z="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
43
- ${X}`)+"'";return Z.implicitKey?z:J$.foldFlowLines(z,X,J$.FOLD_FLOW,T2(Z,!1))}function l$($,Z){let{singleQuote:X}=Z.options,z;if(X===!1)z=d1;else{let J=$.includes('"'),Q=$.includes("'");if(J&&!Q)z=K8;else if(Q&&!J)z=d1;else z=X?K8:d1}return z($,Z)}var H8;try{H8=new RegExp(`(^|(?<!
41
+ `,W+=2;if(Y+=Q,X[W+2]===" ")Y+="\\";W+=1,U=W+1}break;default:W+=1}}return Y=U?Y+X.slice(U):X,z?Y:Q$.foldFlowLines(Y,Q,Q$.FOLD_QUOTED,I2(Z,!1))}function B6($,Z){if(Z.options.singleQuote===!1||Z.implicitKey&&$.includes(`
42
+ `)||/[ \t]\n|\n[ \t]/.test($))return l1($,Z);let X=Z.indent||(A2($)?" ":""),z="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
43
+ ${X}`)+"'";return Z.implicitKey?z:Q$.foldFlowLines(z,X,Q$.FOLD_FLOW,I2(Z,!1))}function n$($,Z){let{singleQuote:X}=Z.options,z;if(X===!1)z=l1;else{let J=$.includes('"'),Q=$.includes("'");if(J&&!Q)z=B6;else if(Q&&!J)z=l1;else z=X?B6:l1}return z($,Z)}var L6;try{L6=new RegExp(`(^|(?<!
44
44
  ))
45
45
  +(?!
46
- |$)`,"g")}catch{H8=/\n+(?!\n|$)/g}function O2({comment:$,type:Z,value:X},z,J,Q){let{blockQuote:Y,commentString:U,lineWidth:W}=z.options;if(!Y||/\n[\t ]+$/.test(X))return l$(X,z);let G=z.indent||(z.forceBlockIndent||D2(X)?" ":""),q=Y==="literal"?!0:Y==="folded"||Z===b0.Scalar.BLOCK_FOLDED?!1:Z===b0.Scalar.BLOCK_LITERAL?!0:!mU(X,W,G.length);if(!X)return q?`|
46
+ |$)`,"g")}catch{L6=/\n+(?!\n|$)/g}function D2({comment:$,type:Z,value:X},z,J,Q){let{blockQuote:Y,commentString:U,lineWidth:W}=z.options;if(!Y||/\n[\t ]+$/.test(X))return n$(X,z);let G=z.indent||(z.forceBlockIndent||A2(X)?" ":""),q=Y==="literal"?!0:Y==="folded"||Z===f0.Scalar.BLOCK_FOLDED?!1:Z===f0.Scalar.BLOCK_LITERAL?!0:!cU(X,W,G.length);if(!X)return q?`|
47
47
  `:`>
48
- `;let V,K;for(K=X.length;K>0;--K){let D=X[K-1];if(D!==`
49
- `&&D!=="\t"&&D!==" ")break}let H=X.substring(K),T=H.indexOf(`
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
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(H8,`$&${G}`)}let B=!1,N,_=-1;for(N=0;N<X.length;++N){let D=X[N];if(D===" ")B=!0;else if(D===`
52
- `)_=N;else break}let w=X.substring(0,_<N?_+1:N);if(w)X=X.substring(w.length),w=w.replace(/\n+/g,`$&${G}`);let k=(B?G?"2":"1":"")+V;if($){if(k+=" "+U($.replace(/ ?[\r\n]+/g," ")),J)J()}if(!q){let D=X.replace(/\n+/g,`
53
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${G}`),E=!1,u=T2(z,!0);if(Y!=="folded"&&Z!==b0.Scalar.BLOCK_FOLDED)u.onOverflow=()=>{E=!0};let A=J$.foldFlowLines(`${w}${D}${H}`,G,J$.FOLD_BLOCK,u);if(!E)return`>${k}
54
- ${G}${A}`}return X=X.replace(/\n+/g,`$&${G}`),`|${k}
55
- ${G}${w}${X}${H}`}function cU($,Z,X,z){let{type:J,value:Q}=$,{actualString:Y,implicitKey:U,indent:W,indentStep:G,inFlow:q}=Z;if(U&&Q.includes(`
56
- `)||q&&/[[\]{},]/.test(Q))return l$(Q,Z);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(Q))return U||q||!Q.includes(`
57
- `)?l$(Q,Z):O2($,Z,X,z);if(!U&&!q&&J!==b0.Scalar.PLAIN&&Q.includes(`
58
- `))return O2($,Z,X,z);if(D2(Q)){if(W==="")return Z.forceBlockIndent=!0,O2($,Z,X,z);else if(U&&W===G)return l$(Q,Z)}let V=Q.replace(/\n+/g,`$&
59
- ${W}`);if(Y){let K=(B)=>B.default&&B.tag!=="tag:yaml.org,2002:str"&&B.test?.test(V),{compat:H,tags:T}=Z.doc.schema;if(T.some(K)||H?.some(K))return l$(Q,Z)}return U?V:J$.foldFlowLines(V,W,J$.FOLD_FLOW,T2(Z,!1))}function dU($,Z,X,z){let{implicitKey:J,inFlow:Q}=Z,Y=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:U}=$;if(U!==b0.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(Y.value))U=b0.Scalar.QUOTE_DOUBLE}let W=(q)=>{switch(q){case b0.Scalar.BLOCK_FOLDED:case b0.Scalar.BLOCK_LITERAL:return J||Q?l$(Y.value,Z):O2(Y,Z,X,z);case b0.Scalar.QUOTE_DOUBLE:return d1(Y.value,Z);case b0.Scalar.QUOTE_SINGLE:return K8(Y.value,Z);case b0.Scalar.PLAIN:return cU(Y,Z,X,z);default:return null}},G=W(U);if(G===null){let{defaultKeyType:q,defaultStringType:V}=Z.options,K=J&&q||V;if(G=W(K),G===null)throw Error(`Unsupported default string type ${K}`)}return G}pU.stringifyString=dU});var l1=P((eU)=>{var iU=B2(),Q$=p(),nU=c1(),rU=p1();function sU($,Z){let X=Object.assign({blockQuote:!0,commentString:nU.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 aU($,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(Q$.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 oU($,Z,{anchors:X,doc:z}){if(!z.directives)return"";let J=[],Q=(Q$.isScalar($)||Q$.isCollection($))&&$.anchor;if(Q&&iU.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 tU($,Z,X,z){if(Q$.isPair($))return $.toString(Z,X,z);if(Q$.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=Q$.isNode($)?$:Z.doc.createNode($,{onTagObj:(W)=>J=W});J??(J=aU(Z.doc.schema.tags,Q));let Y=oU(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):Q$.isScalar(Q)?rU.stringifyString(Q,Z,X,z):Q.toString(Z,X,z);if(!Y)return U;return Q$.isScalar(Q)||U[0]==="{"||U[0]==="["?`${Y} ${U}`:`${Y}
60
- ${Z.indent}${U}`}eU.createStringifyContext=sU;eU.stringify=tU});var Z7=P((zW)=>{var l0=p(),e5=Z0(),$7=l1(),i1=c1();function XW({key:$,value:Z},X,z,J){let{allNullValues:Q,doc:Y,indent:U,indentStep:W,options:{commentString:G,indentSeq:q,simpleKeys:V}}=X,K=l0.isNode($)&&$.comment||null;if(V){if(K)throw Error("With simple keys, key nodes cannot have comments");if(l0.isCollection($)||!l0.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let H=!V&&(!$||K&&Z==null&&!X.inFlow||l0.isCollection($)||(l0.isScalar($)?$.type===e5.Scalar.BLOCK_FOLDED||$.type===e5.Scalar.BLOCK_LITERAL:typeof $==="object"));X=Object.assign({},X,{allNullValues:!1,implicitKey:!H&&(V||!Q),indent:U+W});let T=!1,B=!1,N=$7.stringify($,X,()=>T=!0,()=>B=!0);if(!H&&!X.inFlow&&N.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 N===""?"?":H?`? ${N}`:N}}else if(Q&&!V||Z==null&&H){if(N=`? ${N}`,K&&!T)N+=i1.lineComment(N,X.indent,G(K));else if(B&&J)J();return N}if(T)K=null;if(H){if(K)N+=i1.lineComment(N,X.indent,G(K));N=`? ${N}
61
- ${U}:`}else if(N=`${N}:`,K)N+=i1.lineComment(N,X.indent,G(K));let _,w,j;if(l0.isNode(Z))_=!!Z.spaceBefore,w=Z.commentBefore,j=Z.comment;else if(_=!1,w=null,j=null,Z&&typeof Z==="object")Z=Y.createNode(Z);if(X.implicitKey=!1,!H&&!K&&l0.isScalar(Z))X.indentAtStart=N.length+1;if(B=!1,!q&&W.length>=2&&!X.inFlow&&!H&&l0.isSeq(Z)&&!Z.flow&&!Z.tag&&!Z.anchor)X.indent=X.indent.substring(2);let k=!1,D=$7.stringify(Z,X,()=>k=!0,()=>B=!0),E=" ";if(K||_||w){if(E=_?`
62
- `:"",w){let u=G(w);E+=`
63
- ${i1.indentComment(u,X.indent)}`}if(D===""&&!X.inFlow){if(E===`
64
- `&&j)E=`
65
-
66
- `}else E+=`
67
- ${X.indent}`}else if(!H&&l0.isCollection(Z)){let u=D[0],A=D.indexOf(`
68
- `),m=A!==-1,v0=X.inFlow??Z.flow??Z.items.length===0;if(m||!v0){let h0=!1;if(m&&(u==="&"||u==="!")){let $0=D.indexOf(" ");if(u==="&"&&$0!==-1&&$0<A&&D[$0+1]==="!")$0=D.indexOf(" ",$0+1);if($0===-1||A<$0)h0=!0}if(!h0)E=`
69
- ${X.indent}`}}else if(D===""||D[0]===`
70
- `)E="";if(N+=E+D,X.inFlow){if(k&&z)z()}else if(j&&!k)N+=i1.lineComment(N,X.indent,G(j));else if(B&&J)J();return N}zW.stringifyPair=XW});var B8=P((UW)=>{var X7=D0("process");function QW($,...Z){if($==="debug")console.log(...Z)}function YW($,Z){if($==="debug"||$==="warn")if(typeof X7.emitWarning==="function")X7.emitWarning(Z);else console.warn(Z)}UW.debug=QW;UW.warn=YW});var R2=P((VW)=>{var n1=p(),z7=Z0(),I2="<<",A2={identify:($)=>$===I2||typeof $==="symbol"&&$.description===I2,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new z7.Scalar(Symbol(I2)),{addToJSMap:J7}),stringify:()=>I2},qW=($,Z)=>(A2.identify(Z)||n1.isScalar(Z)&&(!Z.type||Z.type===z7.Scalar.PLAIN)&&A2.identify(Z.value))&&$?.doc.schema.tags.some((X)=>X.tag===A2.tag&&X.default);function J7($,Z,X){if(X=$&&n1.isAlias(X)?X.resolve($.doc):X,n1.isSeq(X))for(let z of X.items)L8($,Z,z);else if(Array.isArray(X))for(let z of X)L8($,Z,z);else L8($,Z,X)}function L8($,Z,X){let z=$&&n1.isAlias(X)?X.resolve($.doc):X;if(!n1.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}VW.addMergeToJSMap=J7;VW.isMergeKey=qW;VW.merge=A2});var N8=P((TW)=>{var LW=B8(),Q7=R2(),MW=l1(),Y7=p(),M8=z$();function NW($,Z,{key:X,value:z}){if(Y7.isNode(X)&&X.addToJSMap)X.addToJSMap($,Z,z);else if(Q7.isMergeKey($,X))Q7.addMergeToJSMap($,Z,z);else{let J=M8.toJS(X,"",$);if(Z instanceof Map)Z.set(J,M8.toJS(z,J,$));else if(Z instanceof Set)Z.add(J);else{let Q=OW(X,J,$),Y=M8.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 OW($,Z,X){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(Y7.isNode($)&&X?.doc){let z=MW.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)+'..."';LW.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)}TW.addPairToJSMap=NW});var Y$=P((FW)=>{var U7=m1(),IW=Z7(),AW=N8(),F2=p();function RW($,Z,X){let z=U7.createNode($,void 0,X),J=U7.createNode(Z,void 0,X);return new _2(z,J)}class _2{constructor($,Z=null){Object.defineProperty(this,F2.NODE_TYPE,{value:F2.PAIR}),this.key=$,this.value=Z}clone($){let{key:Z,value:X}=this;if(F2.isNode(Z))Z=Z.clone($);if(F2.isNode(X))X=X.clone($);return new _2(Z,X)}toJSON($,Z){let X=Z?.mapAsMap?new Map:{};return AW.addPairToJSMap(Z,X,this)}toString($,Z,X){return $?.doc?IW.stringifyPair(this,$,Z,X):JSON.stringify(this)}}FW.Pair=_2;FW.createPair=RW});var O8=P((jW)=>{var _$=p(),W7=l1(),P2=c1();function CW($,Z,X){return(Z.inFlow??$.flow?EW:wW)($,Z,X)}function wW({comment:$,items:Z},X,{blockItemPrefix:z,flowChars:J,itemIndent:Q,onChompKeep:Y,onComment:U}){let{indent:W,options:{commentString:G}}=X,q=Object.assign({},X,{indent:Q,type:null}),V=!1,K=[];for(let T=0;T<Z.length;++T){let B=Z[T],N=null;if(_$.isNode(B)){if(!V&&B.spaceBefore)K.push("");if(C2(X,K,B.commentBefore,V),B.comment)N=B.comment}else if(_$.isPair(B)){let w=_$.isNode(B.key)?B.key:null;if(w){if(!V&&w.spaceBefore)K.push("");C2(X,K,w.commentBefore,V)}}V=!1;let _=W7.stringify(B,q,()=>N=null,()=>V=!0);if(N)_+=P2.lineComment(_,Q,G(N));if(V&&N)V=!1;K.push(z+_)}let H;if(K.length===0)H=J.start+J.end;else{H=K[0];for(let T=1;T<K.length;++T){let B=K[T];H+=B?`
51
+ `)H=H.slice(0,-1);H=H.replace(L6,`$&${G}`)}let B=!1,N,A=-1;for(N=0;N<X.length;++N){let k=X[N];if(k===" ")B=!0;else if(k===`
52
+ `)A=N;else break}let C=X.substring(0,A<N?A+1:N);if(C)X=X.substring(C.length),C=C.replace(/\n+/g,`$&${G}`);let b=(B?G?"2":"1":"")+V;if($){if(b+=" "+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,`$&${G}`),y=!1,i=I2(z,!0);if(Y!=="folded"&&Z!==f0.Scalar.BLOCK_FOLDED)i.onOverflow=()=>{y=!0};let I=Q$.foldFlowLines(`${C}${k}${H}`,G,Q$.FOLD_BLOCK,i);if(!y)return`>${b}
54
+ ${G}${I}`}return X=X.replace(/\n+/g,`$&${G}`),`|${b}
55
+ ${G}${C}${X}${H}`}function dU($,Z,X,z){let{type:J,value:Q}=$,{actualString:Y,implicitKey:U,indent:W,indentStep:G,inFlow:q}=Z;if(U&&Q.includes(`
56
+ `)||q&&/[[\]{},]/.test(Q))return n$(Q,Z);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(Q))return U||q||!Q.includes(`
57
+ `)?n$(Q,Z):D2($,Z,X,z);if(!U&&!q&&J!==f0.Scalar.PLAIN&&Q.includes(`
58
+ `))return D2($,Z,X,z);if(A2(Q)){if(W==="")return Z.forceBlockIndent=!0,D2($,Z,X,z);else if(U&&W===G)return n$(Q,Z)}let V=Q.replace(/\n+/g,`$&
59
+ ${W}`);if(Y){let K=(B)=>B.default&&B.tag!=="tag:yaml.org,2002:str"&&B.test?.test(V),{compat:H,tags:T}=Z.doc.schema;if(T.some(K)||H?.some(K))return n$(Q,Z)}return U?V:Q$.foldFlowLines(V,W,Q$.FOLD_FLOW,I2(Z,!1))}function pU($,Z,X,z){let{implicitKey:J,inFlow:Q}=Z,Y=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:U}=$;if(U!==f0.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(Y.value))U=f0.Scalar.QUOTE_DOUBLE}let W=(q)=>{switch(q){case f0.Scalar.BLOCK_FOLDED:case f0.Scalar.BLOCK_LITERAL:return J||Q?n$(Y.value,Z):D2(Y,Z,X,z);case f0.Scalar.QUOTE_DOUBLE:return l1(Y.value,Z);case f0.Scalar.QUOTE_SINGLE:return B6(Y.value,Z);case f0.Scalar.PLAIN:return dU(Y,Z,X,z);default:return null}},G=W(U);if(G===null){let{defaultKeyType:q,defaultStringType:V}=Z.options,K=J&&q||V;if(G=W(K),G===null)throw Error(`Unsupported default string type ${K}`)}return G}lU.stringifyString=pU});var n1=_(($W)=>{var nU=M2(),Y$=l(),rU=p1(),sU=i1();function aU($,Z){let X=Object.assign({blockQuote:!0,commentString:rU.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},$.schema.toStringOptions,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 oU($,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(Y$.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 tU($,Z,{anchors:X,doc:z}){if(!z.directives)return"";let J=[],Q=(Y$.isScalar($)||Y$.isCollection($))&&$.anchor;if(Q&&nU.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 eU($,Z,X,z){if(Y$.isPair($))return $.toString(Z,X,z);if(Y$.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=Y$.isNode($)?$:Z.doc.createNode($,{onTagObj:(W)=>J=W});J??(J=oU(Z.doc.schema.tags,Q));let Y=tU(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):Y$.isScalar(Q)?sU.stringifyString(Q,Z,X,z):Q.toString(Z,X,z);if(!Y)return U;return Y$.isScalar(Q)||U[0]==="{"||U[0]==="["?`${Y} ${U}`:`${Y}
60
+ ${Z.indent}${U}`}$W.createStringifyContext=aU;$W.stringify=eU});var X7=_((JW)=>{var i0=l(),$7=X0(),Z7=n1(),r1=p1();function zW({key:$,value:Z},X,z,J){let{allNullValues:Q,doc:Y,indent:U,indentStep:W,options:{commentString:G,indentSeq:q,simpleKeys:V}}=X,K=i0.isNode($)&&$.comment||null;if(V){if(K)throw Error("With simple keys, key nodes cannot have comments");if(i0.isCollection($)||!i0.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let H=!V&&(!$||K&&Z==null&&!X.inFlow||i0.isCollection($)||(i0.isScalar($)?$.type===$7.Scalar.BLOCK_FOLDED||$.type===$7.Scalar.BLOCK_LITERAL:typeof $==="object"));X=Object.assign({},X,{allNullValues:!1,implicitKey:!H&&(V||!Q),indent:U+W});let T=!1,B=!1,N=Z7.stringify($,X,()=>T=!0,()=>B=!0);if(!H&&!X.inFlow&&N.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 N===""?"?":H?`? ${N}`:N}}else if(Q&&!V||Z==null&&H){if(N=`? ${N}`,K&&!T)N+=r1.lineComment(N,X.indent,G(K));else if(B&&J)J();return N}if(T)K=null;if(H){if(K)N+=r1.lineComment(N,X.indent,G(K));N=`? ${N}
61
+ ${U}:`}else if(N=`${N}:`,K)N+=r1.lineComment(N,X.indent,G(K));let A,C,w;if(i0.isNode(Z))A=!!Z.spaceBefore,C=Z.commentBefore,w=Z.comment;else if(A=!1,C=null,w=null,Z&&typeof Z==="object")Z=Y.createNode(Z);if(X.implicitKey=!1,!H&&!K&&i0.isScalar(Z))X.indentAtStart=N.length+1;if(B=!1,!q&&W.length>=2&&!X.inFlow&&!H&&i0.isSeq(Z)&&!Z.flow&&!Z.tag&&!Z.anchor)X.indent=X.indent.substring(2);let b=!1,k=Z7.stringify(Z,X,()=>b=!0,()=>B=!0),y=" ";if(K||A||C){if(y=A?`
62
+ `:"",C){let i=G(C);y+=`
63
+ ${r1.indentComment(i,X.indent)}`}if(k===""&&!X.inFlow){if(y===`
64
+ `&&w)y=`
65
+
66
+ `}else y+=`
67
+ ${X.indent}`}else if(!H&&i0.isCollection(Z)){let i=k[0],I=k.indexOf(`
68
+ `),m=I!==-1,D0=X.inFlow??Z.flow??Z.items.length===0;if(m||!D0){let x=!1;if(m&&(i==="&"||i==="!")){let c=k.indexOf(" ");if(i==="&"&&c!==-1&&c<I&&k[c+1]==="!")c=k.indexOf(" ",c+1);if(c===-1||I<c)x=!0}if(!x)y=`
69
+ ${X.indent}`}}else if(k===""||k[0]===`
70
+ `)y="";if(N+=y+k,X.inFlow){if(b&&z)z()}else if(w&&!b)N+=r1.lineComment(N,X.indent,G(w));else if(B&&J)J();return N}JW.stringifyPair=zW});var M6=_((WW)=>{var z7=I0("process");function YW($,...Z){if($==="debug")console.log(...Z)}function UW($,Z){if($==="debug"||$==="warn")if(typeof z7.emitWarning==="function")z7.emitWarning(Z);else console.warn(Z)}WW.debug=YW;WW.warn=UW});var _2=_((KW)=>{var s1=l(),J7=X0(),R2="<<",F2={identify:($)=>$===R2||typeof $==="symbol"&&$.description===R2,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new J7.Scalar(Symbol(R2)),{addToJSMap:Q7}),stringify:()=>R2},VW=($,Z)=>(F2.identify(Z)||s1.isScalar(Z)&&(!Z.type||Z.type===J7.Scalar.PLAIN)&&F2.identify(Z.value))&&$?.doc.schema.tags.some((X)=>X.tag===F2.tag&&X.default);function Q7($,Z,X){if(X=$&&s1.isAlias(X)?X.resolve($.doc):X,s1.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=$&&s1.isAlias(X)?X.resolve($.doc):X;if(!s1.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}KW.addMergeToJSMap=Q7;KW.isMergeKey=VW;KW.merge=F2});var T6=_((DW)=>{var MW=M6(),Y7=_2(),NW=n1(),U7=l(),O6=J$();function OW($,Z,{key:X,value:z}){if(U7.isNode(X)&&X.addToJSMap)X.addToJSMap($,Z,z);else if(Y7.isMergeKey($,X))Y7.addMergeToJSMap($,Z,z);else{let J=O6.toJS(X,"",$);if(Z instanceof Map)Z.set(J,O6.toJS(z,J,$));else if(Z instanceof Set)Z.add(J);else{let Q=TW(X,J,$),Y=O6.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 TW($,Z,X){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(U7.isNode($)&&X?.doc){let z=NW.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)+'..."';MW.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)}DW.addPairToJSMap=OW});var U$=_((_W)=>{var W7=d1(),AW=X7(),RW=T6(),P2=l();function FW($,Z,X){let z=W7.createNode($,void 0,X),J=W7.createNode(Z,void 0,X);return new C2(z,J)}class C2{constructor($,Z=null){Object.defineProperty(this,P2.NODE_TYPE,{value:P2.PAIR}),this.key=$,this.value=Z}clone($){let{key:Z,value:X}=this;if(P2.isNode(Z))Z=Z.clone($);if(P2.isNode(X))X=X.clone($);return new C2(Z,X)}toJSON($,Z){let X=Z?.mapAsMap?new Map:{};return RW.addPairToJSMap(Z,X,this)}toString($,Z,X){return $?.doc?AW.stringifyPair(this,$,Z,X):JSON.stringify(this)}}_W.Pair=C2;_W.createPair=FW});var D6=_((SW)=>{var C$=l(),G7=n1(),w2=p1();function wW($,Z,X){return(Z.inFlow??$.flow?jW:EW)($,Z,X)}function EW({comment:$,items:Z},X,{blockItemPrefix:z,flowChars:J,itemIndent:Q,onChompKeep:Y,onComment:U}){let{indent:W,options:{commentString:G}}=X,q=Object.assign({},X,{indent:Q,type:null}),V=!1,K=[];for(let T=0;T<Z.length;++T){let B=Z[T],N=null;if(C$.isNode(B)){if(!V&&B.spaceBefore)K.push("");if(E2(X,K,B.commentBefore,V),B.comment)N=B.comment}else if(C$.isPair(B)){let C=C$.isNode(B.key)?B.key:null;if(C){if(!V&&C.spaceBefore)K.push("");E2(X,K,C.commentBefore,V)}}V=!1;let A=G7.stringify(B,q,()=>N=null,()=>V=!0);if(N)A+=w2.lineComment(A,Q,G(N));if(V&&N)V=!1;K.push(z+A)}let H;if(K.length===0)H=J.start+J.end;else{H=K[0];for(let T=1;T<K.length;++T){let B=K[T];H+=B?`
71
71
  ${W}${B}`:`
72
72
  `}}if($){if(H+=`
73
- `+P2.indentComment(G($),W),U)U()}else if(V&&Y)Y();return H}function EW({items:$},Z,{flowChars:X,itemIndent:z}){let{indent:J,indentStep:Q,flowCollectionPadding:Y,options:{commentString:U}}=Z;z+=Q;let W=Object.assign({},Z,{indent:z,inFlow:!0,type:null}),G=!1,q=0,V=[];for(let T=0;T<$.length;++T){let B=$[T],N=null;if(_$.isNode(B)){if(B.spaceBefore)V.push("");if(C2(Z,V,B.commentBefore,!1),B.comment)N=B.comment}else if(_$.isPair(B)){let w=_$.isNode(B.key)?B.key:null;if(w){if(w.spaceBefore)V.push("");if(C2(Z,V,w.commentBefore,!1),w.comment)G=!0}let j=_$.isNode(B.value)?B.value:null;if(j){if(j.comment)N=j.comment;if(j.commentBefore)G=!0}else if(B.value==null&&w?.comment)N=w.comment}if(N)G=!0;let _=W7.stringify(B,W,()=>N=null);if(T<$.length-1)_+=",";if(N)_+=P2.lineComment(_,z,U(N));if(!G&&(V.length>q||_.includes(`
74
- `)))G=!0;V.push(_),q=V.length}let{start:K,end:H}=X;if(V.length===0)return K+H;else{if(!G){let T=V.reduce((B,N)=>B+N.length+2,2);G=Z.options.lineWidth>0&&T>Z.options.lineWidth}if(G){let T=K;for(let B of V)T+=B?`
73
+ `+w2.indentComment(G($),W),U)U()}else if(V&&Y)Y();return H}function jW({items:$},Z,{flowChars:X,itemIndent:z}){let{indent:J,indentStep:Q,flowCollectionPadding:Y,options:{commentString:U}}=Z;z+=Q;let W=Object.assign({},Z,{indent:z,inFlow:!0,type:null}),G=!1,q=0,V=[];for(let T=0;T<$.length;++T){let B=$[T],N=null;if(C$.isNode(B)){if(B.spaceBefore)V.push("");if(E2(Z,V,B.commentBefore,!1),B.comment)N=B.comment}else if(C$.isPair(B)){let C=C$.isNode(B.key)?B.key:null;if(C){if(C.spaceBefore)V.push("");if(E2(Z,V,C.commentBefore,!1),C.comment)G=!0}let w=C$.isNode(B.value)?B.value:null;if(w){if(w.comment)N=w.comment;if(w.commentBefore)G=!0}else if(B.value==null&&C?.comment)N=C.comment}if(N)G=!0;let A=G7.stringify(B,W,()=>N=null);if(G||(G=V.length>q||A.includes(`
74
+ `)),T<$.length-1)A+=",";else if(Z.options.trailingComma){if(Z.options.lineWidth>0)G||(G=V.reduce((C,w)=>C+w.length+2,2)+(A.length+2)>Z.options.lineWidth);if(G)A+=","}if(N)A+=w2.lineComment(A,z,U(N));V.push(A),q=V.length}let{start:K,end:H}=X;if(V.length===0)return K+H;else{if(!G){let T=V.reduce((B,N)=>B+N.length+2,2);G=Z.options.lineWidth>0&&T>Z.options.lineWidth}if(G){let T=K;for(let B of V)T+=B?`
75
75
  ${Q}${J}${B}`:`
76
76
  `;return`${T}
77
- ${J}${H}`}else return`${K}${Y}${V.join(" ")}${Y}${H}`}}function C2({indent:$,options:{commentString:Z}},X,z,J){if(z&&J)z=z.replace(/^\n+/,"");if(z){let Q=P2.indentComment(Z(z),$);X.push(Q.trimStart())}}jW.stringifyCollection=CW});var W$=P((fW)=>{var xW=O8(),bW=N8(),kW=N2(),U$=p(),w2=Y$(),yW=Z0();function r1($,Z){let X=U$.isScalar(Z)?Z.value:Z;for(let z of $)if(U$.isPair(z)){if(z.key===Z||z.key===X)return z;if(U$.isScalar(z.key)&&z.key.value===X)return z}return}class G7 extends kW.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(U$.MAP,$);this.items=[]}static from($,Z,X){let{keepUndefined:z,replacer:J}=X,Q=new this($),Y=(U,W)=>{if(typeof J==="function")W=J.call(Z,U,W);else if(Array.isArray(J)&&!J.includes(U))return;if(W!==void 0||z)Q.items.push(w2.createPair(U,W,X))};if(Z instanceof Map)for(let[U,W]of Z)Y(U,W);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(U$.isPair($))X=$;else if(!$||typeof $!=="object"||!("key"in $))X=new w2.Pair($,$?.value);else X=new w2.Pair($.key,$.value);let z=r1(this.items,X.key),J=this.schema?.sortMapEntries;if(z){if(!Z)throw Error(`Key ${X.key} already set`);if(U$.isScalar(z.value)&&yW.isScalarValue(X.value))z.value.value=X.value;else z.value=X.value}else if(J){let Q=this.items.findIndex((Y)=>J(X,Y)<0);if(Q===-1)this.items.push(X);else this.items.splice(Q,0,X)}else this.items.push(X)}delete($){let Z=r1(this.items,$);if(!Z)return!1;return this.items.splice(this.items.indexOf(Z),1).length>0}get($,Z){let z=r1(this.items,$)?.value;return(!Z&&U$.isScalar(z)?z.value:z)??void 0}has($){return!!r1(this.items,$)}set($,Z){this.add(new w2.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)bW.addPairToJSMap(Z,z,J);return z}toString($,Z,X){if(!$)return JSON.stringify(this);for(let z of this.items)if(!U$.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 xW.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:X,onComment:Z})}}fW.YAMLMap=G7;fW.findPair=r1});var i$=P((mW)=>{var hW=p(),q7=W$(),uW={collection:"map",default:!0,nodeClass:q7.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,Z){if(!hW.isMap($))Z("Expected a mapping for this tag");return $},createNode:($,Z,X)=>q7.YAMLMap.from($,Z,X)};mW.map=uW});var G$=P((rW)=>{var dW=m1(),pW=O8(),lW=N2(),j2=p(),iW=Z0(),nW=z$();class V7 extends lW.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(j2.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let Z=E2($);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get($,Z){let X=E2($);if(typeof X!=="number")return;let z=this.items[X];return!Z&&j2.isScalar(z)?z.value:z}has($){let Z=E2($);return typeof Z==="number"&&Z<this.items.length}set($,Z){let X=E2($);if(typeof X!=="number")throw Error(`Expected a valid index, not ${$}.`);let z=this.items[X];if(j2.isScalar(z)&&iW.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(nW.toJS(J,String(z++),Z));return X}toString($,Z,X){if(!$)return JSON.stringify(this);return pW.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(dW.createNode(Y,void 0,X))}}return J}}function E2($){let Z=j2.isScalar($)?$.value:$;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}rW.YAMLSeq=V7});var n$=P((tW)=>{var aW=p(),K7=G$(),oW={collection:"seq",default:!0,nodeClass:K7.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,Z){if(!aW.isSeq($))Z("Expected a sequence for this tag");return $},createNode:($,Z,X)=>K7.YAMLSeq.from($,Z,X)};tW.seq=oW});var s1=P((XG)=>{var $G=p1(),ZG={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,Z,X,z){return Z=Object.assign({actualString:!0},Z),$G.stringifyString($,Z,X,z)}};XG.string=ZG});var S2=P((JG)=>{var H7=Z0(),B7={identify:($)=>$==null,createNode:()=>new H7.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new H7.Scalar(null),stringify:({source:$},Z)=>typeof $==="string"&&B7.test.test($)?$:Z.options.nullStr};JG.nullTag=B7});var T8=P((UG)=>{var YG=Z0(),L7={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new YG.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:Z},X){if($&&L7.test.test($)){let z=$[0]==="t"||$[0]==="T";if(Z===z)return $}return Z?X.options.trueStr:X.options.falseStr}};UG.boolTag=L7});var r$=P((qG)=>{function GG({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}qG.stringifyNumber=GG});var I8=P((MG)=>{var KG=Z0(),D8=r$(),HG={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:D8.stringifyNumber},BG={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():D8.stringifyNumber($)}},LG={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let Z=new KG.Scalar(parseFloat($)),X=$.indexOf(".");if(X!==-1&&$[$.length-1]==="0")Z.minFractionDigits=$.length-X-1;return Z},stringify:D8.stringifyNumber};MG.float=LG;MG.floatExp=BG;MG.floatNaN=HG});var R8=P((RG)=>{var M7=r$(),x2=($)=>typeof $==="bigint"||Number.isInteger($),A8=($,Z,X,{intAsBigInt:z})=>z?BigInt($):parseInt($.substring(Z),X);function N7($,Z,X){let{value:z}=$;if(x2(z)&&z>=0)return X+z.toString(Z);return M7.stringifyNumber($)}var DG={identify:($)=>x2($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,Z,X)=>A8($,2,8,X),stringify:($)=>N7($,8,"0o")},IG={identify:x2,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,Z,X)=>A8($,0,10,X),stringify:M7.stringifyNumber},AG={identify:($)=>x2($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,Z,X)=>A8($,2,16,X),stringify:($)=>N7($,16,"0x")};RG.int=IG;RG.intHex=AG;RG.intOct=DG});var O7=P((bG)=>{var CG=i$(),wG=S2(),EG=n$(),jG=s1(),SG=T8(),F8=I8(),_8=R8(),xG=[CG.map,EG.seq,jG.string,wG.nullTag,SG.boolTag,_8.intOct,_8.int,_8.intHex,F8.floatNaN,F8.floatExp,F8.float];bG.schema=xG});var D7=P((mG)=>{var yG=Z0(),fG=i$(),gG=n$();function T7($){return typeof $==="bigint"||Number.isInteger($)}var b2=({value:$})=>JSON.stringify($),vG=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:b2},{identify:($)=>$==null,createNode:()=>new yG.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:b2},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:b2},{identify:T7,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,Z,{intAsBigInt:X})=>X?BigInt($):parseInt($,10),stringify:({value:$})=>T7($)?$.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:b2}],hG={default:!0,tag:"",test:/^/,resolve($,Z){return Z(`Unresolved plain scalar ${JSON.stringify($)}`),$}},uG=[fG.map,gG.seq].concat(vG,hG);mG.schema=uG});var C8=P((lG)=>{var a1=D0("buffer"),P8=Z0(),dG=p1(),pG={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,Z){if(typeof a1.Buffer==="function")return a1.Buffer.from($,"base64");else if(typeof atob==="function"){let X=atob($.replace(/[\n\r]/g,"")),z=new Uint8Array(X.length);for(let J=0;J<X.length;++J)z[J]=X.charCodeAt(J);return z}else return Z("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:Z,value:X},z,J,Q){if(!X)return"";let Y=X,U;if(typeof a1.Buffer==="function")U=Y instanceof a1.Buffer?Y.toString("base64"):a1.Buffer.from(Y.buffer).toString("base64");else if(typeof btoa==="function"){let W="";for(let G=0;G<Y.length;++G)W+=String.fromCharCode(Y[G]);U=btoa(W)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(Z??(Z=P8.Scalar.BLOCK_LITERAL),Z!==P8.Scalar.QUOTE_DOUBLE){let W=Math.max(z.options.lineWidth-z.indent.length,z.options.minContentWidth),G=Math.ceil(U.length/W),q=Array(G);for(let V=0,K=0;V<G;++V,K+=W)q[V]=U.substr(K,W);U=q.join(Z===P8.Scalar.BLOCK_LITERAL?`
78
- `:" ")}return dG.stringifyString({comment:$,type:Z,value:U},z,J,Q)}};lG.binary=pG});var y2=P((aG)=>{var k2=p(),w8=Y$(),nG=Z0(),rG=G$();function I7($,Z){if(k2.isSeq($))for(let X=0;X<$.items.length;++X){let z=$.items[X];if(k2.isPair(z))continue;else if(k2.isMap(z)){if(z.items.length>1)Z("Each pair must have its own sequence indicator");let J=z.items[0]||new w8.Pair(new nG.Scalar(null));if(z.commentBefore)J.key.commentBefore=J.key.commentBefore?`${z.commentBefore}
77
+ ${J}${H}`}else return`${K}${Y}${V.join(" ")}${Y}${H}`}}function E2({indent:$,options:{commentString:Z}},X,z,J){if(z&&J)z=z.replace(/^\n+/,"");if(z){let Q=w2.indentComment(Z(z),$);X.push(Q.trimStart())}}SW.stringifyCollection=wW});var G$=_((gW)=>{var bW=D6(),kW=T6(),yW=T2(),W$=l(),j2=U$(),fW=X0();function a1($,Z){let X=W$.isScalar(Z)?Z.value:Z;for(let z of $)if(W$.isPair(z)){if(z.key===Z||z.key===X)return z;if(W$.isScalar(z.key)&&z.key.value===X)return z}return}class q7 extends yW.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(W$.MAP,$);this.items=[]}static from($,Z,X){let{keepUndefined:z,replacer:J}=X,Q=new this($),Y=(U,W)=>{if(typeof J==="function")W=J.call(Z,U,W);else if(Array.isArray(J)&&!J.includes(U))return;if(W!==void 0||z)Q.items.push(j2.createPair(U,W,X))};if(Z instanceof Map)for(let[U,W]of Z)Y(U,W);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(W$.isPair($))X=$;else if(!$||typeof $!=="object"||!("key"in $))X=new j2.Pair($,$?.value);else X=new j2.Pair($.key,$.value);let z=a1(this.items,X.key),J=this.schema?.sortMapEntries;if(z){if(!Z)throw Error(`Key ${X.key} already set`);if(W$.isScalar(z.value)&&fW.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=a1(this.items,$);if(!Z)return!1;return this.items.splice(this.items.indexOf(Z),1).length>0}get($,Z){let z=a1(this.items,$)?.value;return(!Z&&W$.isScalar(z)?z.value:z)??void 0}has($){return!!a1(this.items,$)}set($,Z){this.add(new j2.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)kW.addPairToJSMap(Z,z,J);return z}toString($,Z,X){if(!$)return JSON.stringify(this);for(let z of this.items)if(!W$.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 bW.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:X,onComment:Z})}}gW.YAMLMap=q7;gW.findPair=a1});var r$=_((cW)=>{var uW=l(),V7=G$(),mW={collection:"map",default:!0,nodeClass:V7.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,Z){if(!uW.isMap($))Z("Expected a mapping for this tag");return $},createNode:($,Z,X)=>V7.YAMLMap.from($,Z,X)};cW.map=mW});var q$=_((sW)=>{var pW=d1(),lW=D6(),iW=T2(),x2=l(),nW=X0(),rW=J$();class K7 extends iW.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(x2.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let Z=S2($);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get($,Z){let X=S2($);if(typeof X!=="number")return;let z=this.items[X];return!Z&&x2.isScalar(z)?z.value:z}has($){let Z=S2($);return typeof Z==="number"&&Z<this.items.length}set($,Z){let X=S2($);if(typeof X!=="number")throw Error(`Expected a valid index, not ${$}.`);let z=this.items[X];if(x2.isScalar(z)&&nW.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(rW.toJS(J,String(z++),Z));return X}toString($,Z,X){if(!$)return JSON.stringify(this);return lW.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(pW.createNode(Y,void 0,X))}}return J}}function S2($){let Z=x2.isScalar($)?$.value:$;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}sW.YAMLSeq=K7});var s$=_((eW)=>{var oW=l(),H7=q$(),tW={collection:"seq",default:!0,nodeClass:H7.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,Z){if(!oW.isSeq($))Z("Expected a sequence for this tag");return $},createNode:($,Z,X)=>H7.YAMLSeq.from($,Z,X)};eW.seq=tW});var o1=_((zG)=>{var ZG=i1(),XG={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,Z,X,z){return Z=Object.assign({actualString:!0},Z),ZG.stringifyString($,Z,X,z)}};zG.string=XG});var b2=_((QG)=>{var B7=X0(),L7={identify:($)=>$==null,createNode:()=>new B7.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new B7.Scalar(null),stringify:({source:$},Z)=>typeof $==="string"&&L7.test.test($)?$:Z.options.nullStr};QG.nullTag=L7});var I6=_((WG)=>{var UG=X0(),M7={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new UG.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:Z},X){if($&&M7.test.test($)){let z=$[0]==="t"||$[0]==="T";if(Z===z)return $}return Z?X.options.trueStr:X.options.falseStr}};WG.boolTag=M7});var a$=_((VG)=>{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}VG.stringifyNumber=qG});var R6=_((NG)=>{var HG=X0(),A6=a$(),BG={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:A6.stringifyNumber},LG={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():A6.stringifyNumber($)}},MG={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let Z=new HG.Scalar(parseFloat($)),X=$.indexOf(".");if(X!==-1&&$[$.length-1]==="0")Z.minFractionDigits=$.length-X-1;return Z},stringify:A6.stringifyNumber};NG.float=MG;NG.floatExp=LG;NG.floatNaN=BG});var _6=_((FG)=>{var N7=a$(),k2=($)=>typeof $==="bigint"||Number.isInteger($),F6=($,Z,X,{intAsBigInt:z})=>z?BigInt($):parseInt($.substring(Z),X);function O7($,Z,X){let{value:z}=$;if(k2(z)&&z>=0)return X+z.toString(Z);return N7.stringifyNumber($)}var IG={identify:($)=>k2($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,Z,X)=>F6($,2,8,X),stringify:($)=>O7($,8,"0o")},AG={identify:k2,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,Z,X)=>F6($,0,10,X),stringify:N7.stringifyNumber},RG={identify:($)=>k2($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,Z,X)=>F6($,2,16,X),stringify:($)=>O7($,16,"0x")};FG.int=AG;FG.intHex=RG;FG.intOct=IG});var T7=_((kG)=>{var wG=r$(),EG=b2(),jG=s$(),SG=o1(),xG=I6(),P6=R6(),C6=_6(),bG=[wG.map,jG.seq,SG.string,EG.nullTag,xG.boolTag,C6.intOct,C6.int,C6.intHex,P6.floatNaN,P6.floatExp,P6.float];kG.schema=bG});var I7=_((cG)=>{var fG=X0(),gG=r$(),vG=s$();function D7($){return typeof $==="bigint"||Number.isInteger($)}var y2=({value:$})=>JSON.stringify($),hG=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:y2},{identify:($)=>$==null,createNode:()=>new fG.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:y2},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:y2},{identify:D7,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,Z,{intAsBigInt:X})=>X?BigInt($):parseInt($,10),stringify:({value:$})=>D7($)?$.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:y2}],uG={default:!0,tag:"",test:/^/,resolve($,Z){return Z(`Unresolved plain scalar ${JSON.stringify($)}`),$}},mG=[gG.map,vG.seq].concat(hG,uG);cG.schema=mG});var E6=_((iG)=>{var t1=I0("buffer"),w6=X0(),pG=i1(),lG={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,Z){if(typeof t1.Buffer==="function")return t1.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 t1.Buffer==="function")U=Y instanceof t1.Buffer?Y.toString("base64"):t1.Buffer.from(Y.buffer).toString("base64");else if(typeof btoa==="function"){let W="";for(let G=0;G<Y.length;++G)W+=String.fromCharCode(Y[G]);U=btoa(W)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(Z??(Z=w6.Scalar.BLOCK_LITERAL),Z!==w6.Scalar.QUOTE_DOUBLE){let W=Math.max(z.options.lineWidth-z.indent.length,z.options.minContentWidth),G=Math.ceil(U.length/W),q=Array(G);for(let V=0,K=0;V<G;++V,K+=W)q[V]=U.substr(K,W);U=q.join(Z===w6.Scalar.BLOCK_LITERAL?`
78
+ `:" ")}return pG.stringifyString({comment:$,type:Z,value:U},z,J,Q)}};iG.binary=lG});var g2=_((oG)=>{var f2=l(),j6=U$(),rG=X0(),sG=q$();function A7($,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 j6.Pair(new rG.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]=k2.isPair(z)?z:new w8.Pair(z)}else Z("Expected a sequence for this tag");return $}function A7($,Z,X){let{replacer:z}=X,J=new rG.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,W;if(Array.isArray(Y))if(Y.length===2)U=Y[0],W=Y[1];else throw TypeError(`Expected [key, value] tuple: ${Y}`);else if(Y&&Y instanceof Object){let G=Object.keys(Y);if(G.length===1)U=G[0],W=Y[U];else throw TypeError(`Expected tuple with one key, not ${G.length} keys`)}else U=Y;J.items.push(w8.createPair(U,W,X))}return J}var sG={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:I7,createNode:A7};aG.createPairs=A7;aG.pairs=sG;aG.resolvePairs=I7});var j8=P((Xq)=>{var R7=p(),E8=z$(),o1=W$(),$q=G$(),F7=y2();class P$ extends $q.YAMLSeq{constructor(){super();this.add=o1.YAMLMap.prototype.add.bind(this),this.delete=o1.YAMLMap.prototype.delete.bind(this),this.get=o1.YAMLMap.prototype.get.bind(this),this.has=o1.YAMLMap.prototype.has.bind(this),this.set=o1.YAMLMap.prototype.set.bind(this),this.tag=P$.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(R7.isPair(z))J=E8.toJS(z.key,"",Z),Q=E8.toJS(z.value,J,Z);else J=E8.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=F7.createPairs($,Z,X),J=new this;return J.items=z.items,J}}P$.tag="tag:yaml.org,2002:omap";var Zq={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:P$,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,Z){let X=F7.resolvePairs($,Z),z=[];for(let{key:J}of X.items)if(R7.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 P$,X)},createNode:($,Z,X)=>P$.from($,Z,X)};Xq.YAMLOMap=P$;Xq.omap=Zq});var E7=P((Qq)=>{var _7=Z0();function P7({value:$,source:Z},X){if(Z&&($?C7:w7).test.test(Z))return Z;return $?X.options.trueStr:X.options.falseStr}var C7={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new _7.Scalar(!0),stringify:P7},w7={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new _7.Scalar(!1),stringify:P7};Qq.falseTag=w7;Qq.trueTag=C7});var j7=P((Kq)=>{var Wq=Z0(),S8=r$(),Gq={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:S8.stringifyNumber},qq={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():S8.stringifyNumber($)}},Vq={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let Z=new Wq.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:S8.stringifyNumber};Kq.float=Vq;Kq.floatExp=qq;Kq.floatNaN=Gq});var x7=P((Dq)=>{var S7=r$(),t1=($)=>typeof $==="bigint"||Number.isInteger($);function f2($,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 x8($,Z,X){let{value:z}=$;if(t1(z)){let J=z.toString(Z);return z<0?"-"+X+J.substr(1):X+J}return S7.stringifyNumber($)}var Mq={identify:t1,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,Z,X)=>f2($,2,2,X),stringify:($)=>x8($,2,"0b")},Nq={identify:t1,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,Z,X)=>f2($,1,8,X),stringify:($)=>x8($,8,"0")},Oq={identify:t1,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,Z,X)=>f2($,0,10,X),stringify:S7.stringifyNumber},Tq={identify:t1,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,Z,X)=>f2($,2,16,X),stringify:($)=>x8($,16,"0x")};Dq.int=Oq;Dq.intBin=Mq;Dq.intHex=Tq;Dq.intOct=Nq});var b8=P((Pq)=>{var h2=p(),g2=Y$(),v2=W$();class C$ extends v2.YAMLMap{constructor($){super($);this.tag=C$.tag}add($){let Z;if(h2.isPair($))Z=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)Z=new g2.Pair($.key,null);else Z=new g2.Pair($,null);if(!v2.findPair(this.items,Z.key))this.items.push(Z)}get($,Z){let X=v2.findPair(this.items,$);return!Z&&h2.isPair(X)?h2.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=v2.findPair(this.items,$);if(X&&!Z)this.items.splice(this.items.indexOf(X),1);else if(!X&&Z)this.items.push(new g2.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(g2.createPair(Q,null,X))}return J}}C$.tag="tag:yaml.org,2002:set";var _q={collection:"map",identify:($)=>$ instanceof Set,nodeClass:C$,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,Z,X)=>C$.from($,Z,X),resolve($,Z){if(h2.isMap($))if($.hasAllNullValues(!0))return Object.assign(new C$,$);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return $}};Pq.YAMLSet=C$;Pq.set=_q});var y8=P((xq)=>{var Eq=r$();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 b7($){let{value:Z}=$,X=(Y)=>Y;if(typeof Z==="bigint")X=(Y)=>BigInt(Y);else if(isNaN(Z)||!isFinite(Z))return Eq.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 jq={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:b7},Sq={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:($)=>k8($,!1),stringify:b7},k7={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(k7.test);if(!Z)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,X,z,J,Q,Y,U]=Z.map(Number),W=Z[7]?Number((Z[7]+"00").substr(1,3)):0,G=Date.UTC(X,z-1,J,Q||0,Y||0,U||0,W),q=Z[8];if(q&&q!=="Z"){let V=k8(q,!1);if(Math.abs(V)<30)V*=60;G-=60000*V}return new Date(G)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};xq.floatTime=Sq;xq.intTime=jq;xq.timestamp=k7});var f7=P((iq)=>{var fq=i$(),gq=S2(),vq=n$(),hq=s1(),uq=C8(),y7=E7(),f8=j7(),u2=x7(),mq=R2(),cq=j8(),dq=y2(),pq=b8(),g8=y8(),lq=[fq.map,vq.seq,hq.string,gq.nullTag,y7.trueTag,y7.falseTag,u2.intBin,u2.intOct,u2.int,u2.intHex,f8.floatNaN,f8.floatExp,f8.float,uq.binary,mq.merge,cq.omap,dq.pairs,pq.set,g8.intTime,g8.floatTime,g8.timestamp];iq.schema=lq});var i7=P((ZV)=>{var u7=i$(),rq=S2(),m7=n$(),sq=s1(),aq=T8(),v8=I8(),h8=R8(),oq=O7(),tq=D7(),c7=C8(),e1=R2(),d7=j8(),p7=y2(),g7=f7(),l7=b8(),m2=y8(),v7=new Map([["core",oq.schema],["failsafe",[u7.map,m7.seq,sq.string]],["json",tq.schema],["yaml11",g7.schema],["yaml-1.1",g7.schema]]),h7={binary:c7.binary,bool:aq.boolTag,float:v8.float,floatExp:v8.floatExp,floatNaN:v8.floatNaN,floatTime:m2.floatTime,int:h8.int,intHex:h8.intHex,intOct:h8.intOct,intTime:m2.intTime,map:u7.map,merge:e1.merge,null:rq.nullTag,omap:d7.omap,pairs:p7.pairs,seq:m7.seq,set:l7.set,timestamp:m2.timestamp},eq={"tag:yaml.org,2002:binary":c7.binary,"tag:yaml.org,2002:merge":e1.merge,"tag:yaml.org,2002:omap":d7.omap,"tag:yaml.org,2002:pairs":p7.pairs,"tag:yaml.org,2002:set":l7.set,"tag:yaml.org,2002:timestamp":m2.timestamp};function $V($,Z,X){let z=v7.get(Z);if(z&&!$)return X&&!z.includes(e1.merge)?z.concat(e1.merge):z.slice();let J=z;if(!J)if(Array.isArray($))J=[];else{let Q=Array.from(v7.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(e1.merge);return J.reduce((Q,Y)=>{let U=typeof Y==="string"?h7[Y]:Y;if(!U){let W=JSON.stringify(Y),G=Object.keys(h7).map((q)=>JSON.stringify(q)).join(", ");throw Error(`Unknown custom tag ${W}; use one of ${G}`)}if(!Q.includes(U))Q.push(U);return Q},[])}ZV.coreKnownTags=eq;ZV.getTags=$V});var c8=P((WV)=>{var u8=p(),JV=i$(),QV=n$(),YV=s1(),c2=i7(),UV=($,Z)=>$.key<Z.key?-1:$.key>Z.key?1:0;class m8{constructor({compat:$,customTags:Z,merge:X,resolveKnownTags:z,schema:J,sortMapEntries:Q,toStringDefaults:Y}){this.compat=Array.isArray($)?c2.getTags($,"compat"):$?c2.getTags(null,$):null,this.name=typeof J==="string"&&J||"core",this.knownTags=z?c2.coreKnownTags:{},this.tags=c2.getTags(Z,this.name,X),this.toStringOptions=Y??null,Object.defineProperty(this,u8.MAP,{value:JV.map}),Object.defineProperty(this,u8.SCALAR,{value:YV.string}),Object.defineProperty(this,u8.SEQ,{value:QV.seq}),this.sortMapEntries=typeof Q==="function"?Q:Q===!0?UV:null}clone(){let $=Object.create(m8.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}WV.Schema=m8});var n7=P((KV)=>{var qV=p(),d8=l1(),$4=c1();function VV($,Z){let X=[],z=Z.directives===!0;if(Z.directives!==!1&&$.directives){let W=$.directives.toString($);if(W)X.push(W),z=!0;else if($.directives.docStart)z=!0}if(z)X.push("---");let J=d8.createStringifyContext($,Z),{commentString:Q}=J.options;if($.commentBefore){if(X.length!==1)X.unshift("");let W=Q($.commentBefore);X.unshift($4.indentComment(W,""))}let Y=!1,U=null;if($.contents){if(qV.isNode($.contents)){if($.contents.spaceBefore&&z)X.push("");if($.contents.commentBefore){let q=Q($.contents.commentBefore);X.push($4.indentComment(q,""))}J.forceBlockIndent=!!$.comment,U=$.contents.comment}let W=U?void 0:()=>Y=!0,G=d8.stringify($.contents,J,()=>U=null,W);if(U)G+=$4.lineComment(G,"",Q(U));if((G[0]==="|"||G[0]===">")&&X[X.length-1]==="---")X[X.length-1]=`--- ${G}`;else X.push(G)}else X.push(d8.stringify($.contents,J));if($.directives?.docEnd)if($.comment){let W=Q($.comment);if(W.includes(`
81
- `))X.push("..."),X.push($4.indentComment(W,""));else X.push(`... ${W}`)}else X.push("...");else{let W=$.comment;if(W&&Y)W=W.replace(/^\n+/,"");if(W){if((!Y||U)&&X[X.length-1]!=="")X.push("");X.push($4.indentComment(Q(W),""))}}return X.join(`
80
+ ${Q.comment}`:z.comment}z=J}$.items[X]=f2.isPair(z)?z:new j6.Pair(z)}else Z("Expected a sequence for this tag");return $}function R7($,Z,X){let{replacer:z}=X,J=new sG.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,W;if(Array.isArray(Y))if(Y.length===2)U=Y[0],W=Y[1];else throw TypeError(`Expected [key, value] tuple: ${Y}`);else if(Y&&Y instanceof Object){let G=Object.keys(Y);if(G.length===1)U=G[0],W=Y[U];else throw TypeError(`Expected tuple with one key, not ${G.length} keys`)}else U=Y;J.items.push(j6.createPair(U,W,X))}return J}var aG={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:A7,createNode:R7};oG.createPairs=R7;oG.pairs=aG;oG.resolvePairs=A7});var x6=_((zq)=>{var F7=l(),S6=J$(),e1=G$(),Zq=q$(),_7=g2();class w$ extends Zq.YAMLSeq{constructor(){super();this.add=e1.YAMLMap.prototype.add.bind(this),this.delete=e1.YAMLMap.prototype.delete.bind(this),this.get=e1.YAMLMap.prototype.get.bind(this),this.has=e1.YAMLMap.prototype.has.bind(this),this.set=e1.YAMLMap.prototype.set.bind(this),this.tag=w$.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(F7.isPair(z))J=S6.toJS(z.key,"",Z),Q=S6.toJS(z.value,J,Z);else J=S6.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=_7.createPairs($,Z,X),J=new this;return J.items=z.items,J}}w$.tag="tag:yaml.org,2002:omap";var Xq={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:w$,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,Z){let X=_7.resolvePairs($,Z),z=[];for(let{key:J}of X.items)if(F7.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 w$,X)},createNode:($,Z,X)=>w$.from($,Z,X)};zq.YAMLOMap=w$;zq.omap=Xq});var j7=_((Yq)=>{var P7=X0();function C7({value:$,source:Z},X){if(Z&&($?w7:E7).test.test(Z))return Z;return $?X.options.trueStr:X.options.falseStr}var w7={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new P7.Scalar(!0),stringify:C7},E7={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new P7.Scalar(!1),stringify:C7};Yq.falseTag=E7;Yq.trueTag=w7});var S7=_((Hq)=>{var Gq=X0(),b6=a$(),qq={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:b6.stringifyNumber},Vq={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():b6.stringifyNumber($)}},Kq={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let Z=new Gq.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:b6.stringifyNumber};Hq.float=Kq;Hq.floatExp=Vq;Hq.floatNaN=qq});var b7=_((Iq)=>{var x7=a$(),$4=($)=>typeof $==="bigint"||Number.isInteger($);function v2($,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 k6($,Z,X){let{value:z}=$;if($4(z)){let J=z.toString(Z);return z<0?"-"+X+J.substr(1):X+J}return x7.stringifyNumber($)}var Nq={identify:$4,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,Z,X)=>v2($,2,2,X),stringify:($)=>k6($,2,"0b")},Oq={identify:$4,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,Z,X)=>v2($,1,8,X),stringify:($)=>k6($,8,"0")},Tq={identify:$4,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,Z,X)=>v2($,0,10,X),stringify:x7.stringifyNumber},Dq={identify:$4,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,Z,X)=>v2($,2,16,X),stringify:($)=>k6($,16,"0x")};Iq.int=Tq;Iq.intBin=Nq;Iq.intHex=Dq;Iq.intOct=Oq});var y6=_((Cq)=>{var m2=l(),h2=U$(),u2=G$();class E$ extends u2.YAMLMap{constructor($){super($);this.tag=E$.tag}add($){let Z;if(m2.isPair($))Z=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)Z=new h2.Pair($.key,null);else Z=new h2.Pair($,null);if(!u2.findPair(this.items,Z.key))this.items.push(Z)}get($,Z){let X=u2.findPair(this.items,$);return!Z&&m2.isPair(X)?m2.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=u2.findPair(this.items,$);if(X&&!Z)this.items.splice(this.items.indexOf(X),1);else if(!X&&Z)this.items.push(new h2.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(h2.createPair(Q,null,X))}return J}}E$.tag="tag:yaml.org,2002:set";var Pq={collection:"map",identify:($)=>$ instanceof Set,nodeClass:E$,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,Z,X)=>E$.from($,Z,X),resolve($,Z){if(m2.isMap($))if($.hasAllNullValues(!0))return Object.assign(new E$,$);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return $}};Cq.YAMLSet=E$;Cq.set=Pq});var g6=_((bq)=>{var jq=a$();function f6($,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 k7($){let{value:Z}=$,X=(Y)=>Y;if(typeof Z==="bigint")X=(Y)=>BigInt(Y);else if(isNaN(Z)||!isFinite(Z))return jq.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 Sq={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})=>f6($,X),stringify:k7},xq={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:($)=>f6($,!1),stringify:k7},y7={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(y7.test);if(!Z)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,X,z,J,Q,Y,U]=Z.map(Number),W=Z[7]?Number((Z[7]+"00").substr(1,3)):0,G=Date.UTC(X,z-1,J,Q||0,Y||0,U||0,W),q=Z[8];if(q&&q!=="Z"){let V=f6(q,!1);if(Math.abs(V)<30)V*=60;G-=60000*V}return new Date(G)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};bq.floatTime=xq;bq.intTime=Sq;bq.timestamp=y7});var g7=_((nq)=>{var gq=r$(),vq=b2(),hq=s$(),uq=o1(),mq=E6(),f7=j7(),v6=S7(),c2=b7(),cq=_2(),dq=x6(),pq=g2(),lq=y6(),h6=g6(),iq=[gq.map,hq.seq,uq.string,vq.nullTag,f7.trueTag,f7.falseTag,c2.intBin,c2.intOct,c2.int,c2.intHex,v6.floatNaN,v6.floatExp,v6.float,mq.binary,cq.merge,dq.omap,pq.pairs,lq.set,h6.intTime,h6.floatTime,h6.timestamp];nq.schema=iq});var n7=_((XV)=>{var m7=r$(),sq=b2(),c7=s$(),aq=o1(),oq=I6(),u6=R6(),m6=_6(),tq=T7(),eq=I7(),d7=E6(),Z4=_2(),p7=x6(),l7=g2(),v7=g7(),i7=y6(),d2=g6(),h7=new Map([["core",tq.schema],["failsafe",[m7.map,c7.seq,aq.string]],["json",eq.schema],["yaml11",v7.schema],["yaml-1.1",v7.schema]]),u7={binary:d7.binary,bool:oq.boolTag,float:u6.float,floatExp:u6.floatExp,floatNaN:u6.floatNaN,floatTime:d2.floatTime,int:m6.int,intHex:m6.intHex,intOct:m6.intOct,intTime:d2.intTime,map:m7.map,merge:Z4.merge,null:sq.nullTag,omap:p7.omap,pairs:l7.pairs,seq:c7.seq,set:i7.set,timestamp:d2.timestamp},$V={"tag:yaml.org,2002:binary":d7.binary,"tag:yaml.org,2002:merge":Z4.merge,"tag:yaml.org,2002:omap":p7.omap,"tag:yaml.org,2002:pairs":l7.pairs,"tag:yaml.org,2002:set":i7.set,"tag:yaml.org,2002:timestamp":d2.timestamp};function ZV($,Z,X){let z=h7.get(Z);if(z&&!$)return X&&!z.includes(Z4.merge)?z.concat(Z4.merge):z.slice();let J=z;if(!J)if(Array.isArray($))J=[];else{let Q=Array.from(h7.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(Z4.merge);return J.reduce((Q,Y)=>{let U=typeof Y==="string"?u7[Y]:Y;if(!U){let W=JSON.stringify(Y),G=Object.keys(u7).map((q)=>JSON.stringify(q)).join(", ");throw Error(`Unknown custom tag ${W}; use one of ${G}`)}if(!Q.includes(U))Q.push(U);return Q},[])}XV.coreKnownTags=$V;XV.getTags=ZV});var p6=_((GV)=>{var c6=l(),QV=r$(),YV=s$(),UV=o1(),p2=n7(),WV=($,Z)=>$.key<Z.key?-1:$.key>Z.key?1:0;class d6{constructor({compat:$,customTags:Z,merge:X,resolveKnownTags:z,schema:J,sortMapEntries:Q,toStringDefaults:Y}){this.compat=Array.isArray($)?p2.getTags($,"compat"):$?p2.getTags(null,$):null,this.name=typeof J==="string"&&J||"core",this.knownTags=z?p2.coreKnownTags:{},this.tags=p2.getTags(Z,this.name,X),this.toStringOptions=Y??null,Object.defineProperty(this,c6.MAP,{value:QV.map}),Object.defineProperty(this,c6.SCALAR,{value:UV.string}),Object.defineProperty(this,c6.SEQ,{value:YV.seq}),this.sortMapEntries=typeof Q==="function"?Q:Q===!0?WV:null}clone(){let $=Object.create(d6.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}GV.Schema=d6});var r7=_((HV)=>{var VV=l(),l6=n1(),X4=p1();function KV($,Z){let X=[],z=Z.directives===!0;if(Z.directives!==!1&&$.directives){let W=$.directives.toString($);if(W)X.push(W),z=!0;else if($.directives.docStart)z=!0}if(z)X.push("---");let J=l6.createStringifyContext($,Z),{commentString:Q}=J.options;if($.commentBefore){if(X.length!==1)X.unshift("");let W=Q($.commentBefore);X.unshift(X4.indentComment(W,""))}let Y=!1,U=null;if($.contents){if(VV.isNode($.contents)){if($.contents.spaceBefore&&z)X.push("");if($.contents.commentBefore){let q=Q($.contents.commentBefore);X.push(X4.indentComment(q,""))}J.forceBlockIndent=!!$.comment,U=$.contents.comment}let W=U?void 0:()=>Y=!0,G=l6.stringify($.contents,J,()=>U=null,W);if(U)G+=X4.lineComment(G,"",Q(U));if((G[0]==="|"||G[0]===">")&&X[X.length-1]==="---")X[X.length-1]=`--- ${G}`;else X.push(G)}else X.push(l6.stringify($.contents,J));if($.directives?.docEnd)if($.comment){let W=Q($.comment);if(W.includes(`
81
+ `))X.push("..."),X.push(X4.indentComment(W,""));else X.push(`... ${W}`)}else X.push("...");else{let W=$.comment;if(W&&Y)W=W.replace(/^\n+/,"");if(W){if((!Y||U)&&X[X.length-1]!=="")X.push("");X.push(X4.indentComment(Q(W),""))}}return X.join(`
82
82
  `)+`
83
- `}KV.stringifyDocument=VV});var Z4=P((IV)=>{var BV=u1(),s$=N2(),E0=p(),LV=Y$(),MV=z$(),NV=c8(),OV=n7(),p8=B2(),TV=G8(),DV=m1(),l8=W8();class i8{constructor($,Z,X){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,E0.NODE_TYPE,{value:E0.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 l8.Directives({version:Q});this.setSchema(Q,X),this.contents=$===void 0?null:this.createNode($,z,X)}clone(){let $=Object.create(i8.prototype,{[E0.NODE_TYPE]:{value:E0.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=E0.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(a$(this.contents))this.contents.add($)}addIn($,Z){if(a$(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 BV.Alias($.anchor)}createNode($,Z,X){let z=void 0;if(typeof Z==="function")$=Z.call({"":$},"",$),z=Z;else if(Array.isArray(Z)){let B=(_)=>typeof _==="number"||_ instanceof String||_ instanceof Number,N=Z.filter(B).map(String);if(N.length>0)Z=Z.concat(N);z=Z}else if(X===void 0&&Z)X=Z,Z=void 0;let{aliasDuplicateObjects:J,anchorPrefix:Q,flow:Y,keepUndefined:U,onTagObj:W,tag:G}=X??{},{onAnchor:q,setAnchors:V,sourceObjects:K}=p8.createNodeAnchors(this,Q||"a"),H={aliasDuplicateObjects:J??!0,keepUndefined:U??!1,onAnchor:q,onTagObj:W,replacer:z,schema:this.schema,sourceObjects:K},T=DV.createNode($,G,H);if(Y&&E0.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 LV.Pair(z,J)}delete($){return a$(this.contents)?this.contents.delete($):!1}deleteIn($){if(s$.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return a$(this.contents)?this.contents.deleteIn($):!1}get($,Z){return E0.isCollection(this.contents)?this.contents.get($,Z):void 0}getIn($,Z){if(s$.isEmptyPath($))return!Z&&E0.isScalar(this.contents)?this.contents.value:this.contents;return E0.isCollection(this.contents)?this.contents.getIn($,Z):void 0}has($){return E0.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(s$.isEmptyPath($))return this.contents!==void 0;return E0.isCollection(this.contents)?this.contents.hasIn($):!1}set($,Z){if(this.contents==null)this.contents=s$.collectionFromPath(this.schema,[$],Z);else if(a$(this.contents))this.contents.set($,Z)}setIn($,Z){if(s$.isEmptyPath($))this.contents=Z;else if(this.contents==null)this.contents=s$.collectionFromPath(this.schema,Array.from($),Z);else if(a$(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 l8.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 l8.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 NV.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=MV.toJS(this.contents,Z??"",Y);if(typeof J==="function")for(let{count:W,res:G}of Y.anchors.values())J(G,W);return typeof Q==="function"?TV.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 OV.stringifyDocument(this,$)}}function a$($){if(E0.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}IV.Document=i8});var X4=P((FV)=>{class d2 extends Error{constructor($,Z,X,z){super();this.name=$,this.code=X,this.message=z,this.pos=Z}}class r7 extends d2{constructor($,Z,X){super("YAMLParseError",$,Z,X)}}class s7 extends d2{constructor($,Z,X){super("YAMLWarning",$,Z,X)}}var RV=($,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
+ `}HV.stringifyDocument=KV});var z4=_((AV)=>{var LV=c1(),o$=T2(),j0=l(),MV=U$(),NV=J$(),OV=p6(),TV=r7(),i6=M2(),DV=V6(),IV=d1(),n6=q6();class r6{constructor($,Z,X){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,j0.NODE_TYPE,{value:j0.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 n6.Directives({version:Q});this.setSchema(Q,X),this.contents=$===void 0?null:this.createNode($,z,X)}clone(){let $=Object.create(r6.prototype,{[j0.NODE_TYPE]:{value:j0.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=j0.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(t$(this.contents))this.contents.add($)}addIn($,Z){if(t$(this.contents))this.contents.addIn($,Z)}createAlias($,Z){if(!$.anchor){let X=i6.anchorNames(this);$.anchor=!Z||X.has(Z)?i6.findNewAnchor(Z||"a",X):Z}return new LV.Alias($.anchor)}createNode($,Z,X){let z=void 0;if(typeof Z==="function")$=Z.call({"":$},"",$),z=Z;else if(Array.isArray(Z)){let B=(A)=>typeof A==="number"||A instanceof String||A instanceof Number,N=Z.filter(B).map(String);if(N.length>0)Z=Z.concat(N);z=Z}else if(X===void 0&&Z)X=Z,Z=void 0;let{aliasDuplicateObjects:J,anchorPrefix:Q,flow:Y,keepUndefined:U,onTagObj:W,tag:G}=X??{},{onAnchor:q,setAnchors:V,sourceObjects:K}=i6.createNodeAnchors(this,Q||"a"),H={aliasDuplicateObjects:J??!0,keepUndefined:U??!1,onAnchor:q,onTagObj:W,replacer:z,schema:this.schema,sourceObjects:K},T=IV.createNode($,G,H);if(Y&&j0.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 MV.Pair(z,J)}delete($){return t$(this.contents)?this.contents.delete($):!1}deleteIn($){if(o$.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return t$(this.contents)?this.contents.deleteIn($):!1}get($,Z){return j0.isCollection(this.contents)?this.contents.get($,Z):void 0}getIn($,Z){if(o$.isEmptyPath($))return!Z&&j0.isScalar(this.contents)?this.contents.value:this.contents;return j0.isCollection(this.contents)?this.contents.getIn($,Z):void 0}has($){return j0.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(o$.isEmptyPath($))return this.contents!==void 0;return j0.isCollection(this.contents)?this.contents.hasIn($):!1}set($,Z){if(this.contents==null)this.contents=o$.collectionFromPath(this.schema,[$],Z);else if(t$(this.contents))this.contents.set($,Z)}setIn($,Z){if(o$.isEmptyPath($))this.contents=Z;else if(this.contents==null)this.contents=o$.collectionFromPath(this.schema,Array.from($),Z);else if(t$(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 n6.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 n6.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 OV.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=NV.toJS(this.contents,Z??"",Y);if(typeof J==="function")for(let{count:W,res:G}of Y.anchors.values())J(G,W);return typeof Q==="function"?DV.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 TV.stringifyDocument(this,$)}}function t$($){if(j0.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}AV.Document=r6});var J4=_((_V)=>{class l2 extends Error{constructor($,Z,X,z){super();this.name=$,this.code=X,this.message=z,this.pos=Z}}class s7 extends l2{constructor($,Z,X){super("YAMLParseError",$,Z,X)}}class a7 extends l2{constructor($,Z,X){super("YAMLWarning",$,Z,X)}}var FV=($,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,W=X.linePos[1];if(W?.line===z&&W.col>J)U=Math.max(1,Math.min(W.col-J,80-Q));let G=" ".repeat(Q)+"^".repeat(U);X.message+=`:
85
85
 
86
86
  ${Y}
87
87
  ${G}
88
- `}};FV.YAMLError=d2;FV.YAMLParseError=r7;FV.YAMLWarning=s7;FV.prettifyError=RV});var z4=P((jV)=>{function EV($,{flow:Z,indicator:X,next:z,offset:J,onError:Q,parentIndent:Y,startOnNewline:U}){let W=!1,G=U,q=U,V="",K="",H=!1,T=!1,B=null,N=null,_=null,w=null,j=null,k=null,D=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(B){if(G&&A.type!=="comment"&&A.type!=="newline")Q(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");B=null}switch(A.type){case"space":if(!Z&&(X!=="doc-start"||z?.type!=="flow-collection")&&A.source.includes("\t"))B=A;q=!0;break;case"comment":{if(!q)Q(A,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let m=A.source.substring(1)||" ";if(!V)V=m;else V+=K+m;K="",G=!1;break}case"newline":if(G){if(V)V+=A.source;else if(!k||X!=="seq-item-ind")W=!0}else K+=A.source;if(G=!0,H=!0,N||_)w=A;q=!0;break;case"anchor":if(N)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);N=A,D??(D=A.offset),G=!1,q=!1,T=!0;break;case"tag":{if(_)Q(A,"MULTIPLE_TAGS","A node can have at most one tag");_=A,D??(D=A.offset),G=!1,q=!1,T=!0;break}case X:if(N||_)Q(A,"BAD_PROP_ORDER",`Anchors and tags must be after the ${A.source} indicator`);if(k)Q(A,"UNEXPECTED_TOKEN",`Unexpected ${A.source} in ${Z??"collection"}`);k=A,G=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,G=!1,q=!1;break}default:Q(A,"UNEXPECTED_TOKEN",`Unexpected ${A.type} token`),G=!1,q=!1}}let E=$[$.length-1],u=E?E.offset+E.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(B&&(G&&B.indent<=Y||z?.type==="block-map"||z?.type==="block-seq"))Q(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:j,found:k,spaceBefore:W,comment:V,hasNewline:H,anchor:N,tag:_,newlineAfterProp:w,end:u,start:D??u}}jV.resolveProps=EV});var p2=P((xV)=>{function n8($){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(n8(Z.key)||n8(Z.value))return!0}return!1;default:return!0}}xV.containsNewline=n8});var r8=P((fV)=>{var kV=p2();function yV($,Z,X){if(Z?.type==="flow-collection"){let z=Z.end[0];if(z.indent===$&&(z.source==="]"||z.source==="}")&&kV.containsNewline(Z))X(z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}fV.flowIndentCheck=yV});var s8=P((hV)=>{var a7=p();function vV($,Z,X){let{uniqueKeys:z}=$.options;if(z===!1)return!1;let J=typeof z==="function"?z:(Q,Y)=>Q===Y||a7.isScalar(Q)&&a7.isScalar(Y)&&Q.value===Y.value;return Z.some((Q)=>J(Q.key,X))}hV.mapIncludes=vV});var Z9=P((lV)=>{var o7=Y$(),mV=W$(),t7=z4(),cV=p2(),e7=r8(),dV=s8(),$9="All mapping items must start at the same column";function pV({composeNode:$,composeEmptyNode:Z},X,z,J,Q){let U=new(Q?.nodeClass??mV.YAMLMap)(X.schema);if(X.atRoot)X.atRoot=!1;let W=z.offset,G=null;for(let q of z.items){let{start:V,key:K,sep:H,value:T}=q,B=t7.resolveProps(V,{indicator:"explicit-key-ind",next:K??H?.[0],offset:W,onError:J,parentIndent:z.indent,startOnNewline:!0}),N=!B.found;if(N){if(K){if(K.type==="block-seq")J(W,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in K&&K.indent!==z.indent)J(W,"BAD_INDENT",$9)}if(!B.anchor&&!B.tag&&!H){if(G=B.end,B.comment)if(U.comment)U.comment+=`
90
- `+B.comment;else U.comment=B.comment;continue}if(B.newlineAfterProp||cV.containsNewline(K))J(K??V[V.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(B.found?.indent!==z.indent)J(W,"BAD_INDENT",$9);X.atKey=!0;let _=B.end,w=K?$(X,K,B,J):Z(X,_,V,null,B,J);if(X.schema.compat)e7.flowIndentCheck(z.indent,K,J);if(X.atKey=!1,dV.mapIncludes(X,U.items,w))J(_,"DUPLICATE_KEY","Map keys must be unique");let j=t7.resolveProps(H??[],{indicator:"map-value-ind",next:T,offset:w.range[2],onError:J,parentIndent:z.indent,startOnNewline:!K||K.type==="block-scalar"});if(W=j.end,j.found){if(N){if(T?.type==="block-map"&&!j.hasNewline)J(W,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(X.options.strict&&B.start<j.found.offset-1024)J(w.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let k=T?$(X,T,j,J):Z(X,W,H,null,j,J);if(X.schema.compat)e7.flowIndentCheck(z.indent,T,J);W=k.range[2];let D=new o7.Pair(w,k);if(X.options.keepSourceTokens)D.srcToken=q;U.items.push(D)}else{if(N)J(w.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(j.comment)if(w.comment)w.comment+=`
91
- `+j.comment;else w.comment=j.comment;let k=new o7.Pair(w);if(X.options.keepSourceTokens)k.srcToken=q;U.items.push(k)}}if(G&&G<W)J(G,"IMPOSSIBLE","Map comment with trailing content");return U.range=[z.offset,W,G??W],U}lV.resolveBlockMap=pV});var X9=P((oV)=>{var nV=G$(),rV=z4(),sV=r8();function aV({composeNode:$,composeEmptyNode:Z},X,z,J,Q){let U=new(Q?.nodeClass??nV.YAMLSeq)(X.schema);if(X.atRoot)X.atRoot=!1;if(X.atKey)X.atKey=!1;let W=z.offset,G=null;for(let{start:q,value:V}of z.items){let K=rV.resolveProps(q,{indicator:"seq-item-ind",next:V,offset:W,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(W,"MISSING_CHAR","Sequence item without - indicator");else{if(G=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)sV.flowIndentCheck(z.indent,V,J);W=H.range[2],U.items.push(H)}return U.range=[z.offset,W,G??W],U}oV.resolveBlockSeq=aV});var o$=P(($K)=>{function eV($,Z,X,z){let J="";if($){let Q=!1,Y="";for(let U of $){let{source:W,type:G}=U;switch(G){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=W.substring(1)||" ";if(!J)J=q;else J+=Y+q;Y="";break}case"newline":if(J)Y+=W;Q=!0;break;default:z(U,"UNEXPECTED_TOKEN",`Unexpected ${G} at node end`)}Z+=W.length}}return{comment:J,offset:Z}}$K.resolveEnd=eV});var Q9=P((GK)=>{var XK=p(),zK=Y$(),z9=W$(),JK=G$(),QK=o$(),J9=z4(),YK=p2(),UK=s8(),a8="Block collections are not allowed within flow collections",o8=($)=>$&&($.type==="block-map"||$.type==="block-seq");function WK({composeNode:$,composeEmptyNode:Z},X,z,J,Q){let Y=z.start.source==="{",U=Y?"flow map":"flow sequence",G=new(Q?.nodeClass??(Y?z9.YAMLMap:JK.YAMLSeq))(X.schema);G.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 N=0;N<z.items.length;++N){let _=z.items[N],{start:w,key:j,sep:k,value:D}=_,E=J9.resolveProps(w,{flow:U,indicator:"explicit-key-ind",next:j??k?.[0],offset:V,onError:J,parentIndent:z.indent,startOnNewline:!1});if(!E.found){if(!E.anchor&&!E.tag&&!k&&!D){if(N===0&&E.comma)J(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${U}`);else if(N<z.items.length-1)J(E.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${U}`);if(E.comment)if(G.comment)G.comment+=`
92
- `+E.comment;else G.comment=E.comment;V=E.end;continue}if(!Y&&X.options.strict&&YK.containsNewline(j))J(j,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(N===0){if(E.comma)J(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${U}`)}else{if(!E.comma)J(E.start,"MISSING_CHAR",`Missing , between ${U} items`);if(E.comment){let u="";$:for(let A of w)switch(A.type){case"comma":case"space":break;case"comment":u=A.source.substring(1);break $;default:break $}if(u){let A=G.items[G.items.length-1];if(XK.isPair(A))A=A.value??A.key;if(A.comment)A.comment+=`
93
- `+u;else A.comment=u;E.comment=E.comment.substring(u.length+1)}}}if(!Y&&!k&&!E.found){let u=D?$(X,D,E,J):Z(X,E.end,k,null,E,J);if(G.items.push(u),V=u.range[2],o8(D))J(u.range,"BLOCK_IN_FLOW",a8)}else{X.atKey=!0;let u=E.end,A=j?$(X,j,E,J):Z(X,u,w,null,E,J);if(o8(j))J(A.range,"BLOCK_IN_FLOW",a8);X.atKey=!1;let m=J9.resolveProps(k??[],{flow:U,indicator:"map-value-ind",next:D,offset:A.range[2],onError:J,parentIndent:z.indent,startOnNewline:!1});if(m.found){if(!Y&&!E.found&&X.options.strict){if(k)for(let $0 of k){if($0===m.found)break;if($0.type==="newline"){J($0,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(E.start<m.found.offset-1024)J(m.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(D)if("source"in D&&D.source?.[0]===":")J(D,"MISSING_CHAR",`Missing space after : in ${U}`);else J(m.start,"MISSING_CHAR",`Missing , or : between ${U} items`);let v0=D?$(X,D,m,J):m.found?Z(X,m.end,k,null,m,J):null;if(v0){if(o8(D))J(v0.range,"BLOCK_IN_FLOW",a8)}else if(m.comment)if(A.comment)A.comment+=`
94
- `+m.comment;else A.comment=m.comment;let h0=new zK.Pair(A,v0);if(X.options.keepSourceTokens)h0.srcToken=_;if(Y){let $0=G;if(UK.mapIncludes(X,$0.items,A))J(u,"DUPLICATE_KEY","Map keys must be unique");$0.items.push(h0)}else{let $0=new z9.YAMLMap(X.schema);$0.flow=!0,$0.items.push(h0);let f1=(v0??A).range;$0.range=[A.range[0],f1[1],f1[2]],G.items.push($0)}V=v0?v0.range[2]:m.end}}let K=Y?"}":"]",[H,...T]=z.end,B=V;if(H?.source===K)B=H.offset+H.source.length;else{let N=U[0].toUpperCase()+U.substring(1),_=q?`${N} must end with a ${K}`:`${N} in block collection must be sufficiently indented and end with a ${K}`;if(J(V,q?"MISSING_CHAR":"BAD_INDENT",_),H&&H.source.length!==1)T.unshift(H)}if(T.length>0){let N=QK.resolveEnd(T,B,X.options.strict,J);if(N.comment)if(G.comment)G.comment+=`
95
- `+N.comment;else G.comment=N.comment;G.range=[z.offset,B,N.offset]}else G.range=[z.offset,B,B];return G}GK.resolveFlowCollection=WK});var Y9=P((TK)=>{var VK=p(),KK=Z0(),HK=W$(),BK=G$(),LK=Z9(),MK=X9(),NK=Q9();function t8($,Z,X,z,J,Q){let Y=X.type==="block-map"?LK.resolveBlockMap($,Z,X,z,Q):X.type==="block-seq"?MK.resolveBlockSeq($,Z,X,z,Q):NK.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 OK($,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===HK.YAMLMap.tagName&&U==="map"||Y===BK.YAMLSeq.tagName&&U==="seq")return t8($,Z,X,J,Y);let W=Z.schema.tags.find((K)=>K.tag===Y&&K.collection===U);if(!W){let K=Z.schema.knownTags[Y];if(K?.collection===U)Z.schema.tags.push(Object.assign({},K,{default:!1})),W=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 t8($,Z,X,J,Y)}}let G=t8($,Z,X,J,Y,W),q=W.resolve?.(G,(K)=>J(Q,"TAG_RESOLVE_FAILED",K),Z.options)??G,V=VK.isNode(q)?q:new KK.Scalar(q);if(V.range=G.range,V.tag=Y,W?.format)V.format=W.format;return V}TK.composeCollection=OK});var $3=P((FK)=>{var e8=Z0();function IK($,Z,X){let z=Z.offset,J=AK(Z,$.options.strict,X);if(!J)return{value:"",type:null,comment:"",range:[z,z,z]};let Q=J.mode===">"?e8.Scalar.BLOCK_FOLDED:e8.Scalar.BLOCK_LITERAL,Y=Z.source?RK(Z.source):[],U=Y.length;for(let B=Y.length-1;B>=0;--B){let N=Y[B][1];if(N===""||N==="\r")U=B;else break}if(U===0){let B=J.chomp==="+"&&Y.length>0?`
96
- `.repeat(Math.max(1,Y.length-1)):"",N=z+J.length;if(Z.source)N+=Z.source.length;return{value:B,type:Q,comment:J.comment,range:[z,N,N]}}let W=Z.indent+J.indent,G=Z.offset+J.length,q=0;for(let B=0;B<U;++B){let[N,_]=Y[B];if(_===""||_==="\r"){if(J.indent===0&&N.length>W)W=N.length}else{if(N.length<W)X(G+N.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(J.indent===0)W=N.length;if(q=B,W===0&&!$.atRoot)X(G,"BAD_INDENT","Block scalar values in collections must be indented");break}G+=N.length+_.length+1}for(let B=Y.length-1;B>=U;--B)if(Y[B][0].length>W)U=B+1;let V="",K="",H=!1;for(let B=0;B<q;++B)V+=Y[B][0].slice(W)+`
97
- `;for(let B=q;B<U;++B){let[N,_]=Y[B];G+=N.length+_.length+1;let w=_[_.length-1]==="\r";if(w)_=_.slice(0,-1);if(_&&N.length<W){let k=`Block scalar lines must not be less indented than their ${J.indent?"explicit indentation indicator":"first line"}`;X(G-_.length-(w?2:1),"BAD_INDENT",k),N=""}if(Q===e8.Scalar.BLOCK_LITERAL)V+=K+N.slice(W)+_,K=`
98
- `;else if(N.length>W||_[0]==="\t"){if(K===" ")K=`
88
+ `}};_V.YAMLError=l2;_V.YAMLParseError=s7;_V.YAMLWarning=a7;_V.prettifyError=FV});var Q4=_((SV)=>{function jV($,{flow:Z,indicator:X,next:z,offset:J,onError:Q,parentIndent:Y,startOnNewline:U}){let W=!1,G=U,q=U,V="",K="",H=!1,T=!1,B=null,N=null,A=null,C=null,w=null,b=null,k=null;for(let I of $){if(T){if(I.type!=="space"&&I.type!=="newline"&&I.type!=="comma")Q(I.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");T=!1}if(B){if(G&&I.type!=="comment"&&I.type!=="newline")Q(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");B=null}switch(I.type){case"space":if(!Z&&(X!=="doc-start"||z?.type!=="flow-collection")&&I.source.includes("\t"))B=I;q=!0;break;case"comment":{if(!q)Q(I,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let m=I.source.substring(1)||" ";if(!V)V=m;else V+=K+m;K="",G=!1;break}case"newline":if(G){if(V)V+=I.source;else if(!b||X!=="seq-item-ind")W=!0}else K+=I.source;if(G=!0,H=!0,N||A)C=I;q=!0;break;case"anchor":if(N)Q(I,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(I.source.endsWith(":"))Q(I.offset+I.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);N=I,k??(k=I.offset),G=!1,q=!1,T=!0;break;case"tag":{if(A)Q(I,"MULTIPLE_TAGS","A node can have at most one tag");A=I,k??(k=I.offset),G=!1,q=!1,T=!0;break}case X:if(N||A)Q(I,"BAD_PROP_ORDER",`Anchors and tags must be after the ${I.source} indicator`);if(b)Q(I,"UNEXPECTED_TOKEN",`Unexpected ${I.source} in ${Z??"collection"}`);b=I,G=X==="seq-item-ind"||X==="explicit-key-ind",q=!1;break;case"comma":if(Z){if(w)Q(I,"UNEXPECTED_TOKEN",`Unexpected , in ${Z}`);w=I,G=!1,q=!1;break}default:Q(I,"UNEXPECTED_TOKEN",`Unexpected ${I.type} token`),G=!1,q=!1}}let y=$[$.length-1],i=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(B&&(G&&B.indent<=Y||z?.type==="block-map"||z?.type==="block-seq"))Q(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:w,found:b,spaceBefore:W,comment:V,hasNewline:H,anchor:N,tag:A,newlineAfterProp:C,end:i,start:k??i}}SV.resolveProps=jV});var i2=_((bV)=>{function s6($){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(s6(Z.key)||s6(Z.value))return!0}return!1;default:return!0}}bV.containsNewline=s6});var a6=_((gV)=>{var yV=i2();function fV($,Z,X){if(Z?.type==="flow-collection"){let z=Z.end[0];if(z.indent===$&&(z.source==="]"||z.source==="}")&&yV.containsNewline(Z))X(z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}gV.flowIndentCheck=fV});var o6=_((uV)=>{var o7=l();function hV($,Z,X){let{uniqueKeys:z}=$.options;if(z===!1)return!1;let J=typeof z==="function"?z:(Q,Y)=>Q===Y||o7.isScalar(Q)&&o7.isScalar(Y)&&Q.value===Y.value;return Z.some((Q)=>J(Q.key,X))}uV.mapIncludes=hV});var X9=_((iV)=>{var t7=U$(),cV=G$(),e7=Q4(),dV=i2(),$9=a6(),pV=o6(),Z9="All mapping items must start at the same column";function lV({composeNode:$,composeEmptyNode:Z},X,z,J,Q){let U=new(Q?.nodeClass??cV.YAMLMap)(X.schema);if(X.atRoot)X.atRoot=!1;let W=z.offset,G=null;for(let q of z.items){let{start:V,key:K,sep:H,value:T}=q,B=e7.resolveProps(V,{indicator:"explicit-key-ind",next:K??H?.[0],offset:W,onError:J,parentIndent:z.indent,startOnNewline:!0}),N=!B.found;if(N){if(K){if(K.type==="block-seq")J(W,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in K&&K.indent!==z.indent)J(W,"BAD_INDENT",Z9)}if(!B.anchor&&!B.tag&&!H){if(G=B.end,B.comment)if(U.comment)U.comment+=`
90
+ `+B.comment;else U.comment=B.comment;continue}if(B.newlineAfterProp||dV.containsNewline(K))J(K??V[V.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(B.found?.indent!==z.indent)J(W,"BAD_INDENT",Z9);X.atKey=!0;let A=B.end,C=K?$(X,K,B,J):Z(X,A,V,null,B,J);if(X.schema.compat)$9.flowIndentCheck(z.indent,K,J);if(X.atKey=!1,pV.mapIncludes(X,U.items,C))J(A,"DUPLICATE_KEY","Map keys must be unique");let w=e7.resolveProps(H??[],{indicator:"map-value-ind",next:T,offset:C.range[2],onError:J,parentIndent:z.indent,startOnNewline:!K||K.type==="block-scalar"});if(W=w.end,w.found){if(N){if(T?.type==="block-map"&&!w.hasNewline)J(W,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(X.options.strict&&B.start<w.found.offset-1024)J(C.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let b=T?$(X,T,w,J):Z(X,W,H,null,w,J);if(X.schema.compat)$9.flowIndentCheck(z.indent,T,J);W=b.range[2];let k=new t7.Pair(C,b);if(X.options.keepSourceTokens)k.srcToken=q;U.items.push(k)}else{if(N)J(C.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(w.comment)if(C.comment)C.comment+=`
91
+ `+w.comment;else C.comment=w.comment;let b=new t7.Pair(C);if(X.options.keepSourceTokens)b.srcToken=q;U.items.push(b)}}if(G&&G<W)J(G,"IMPOSSIBLE","Map comment with trailing content");return U.range=[z.offset,W,G??W],U}iV.resolveBlockMap=lV});var z9=_((tV)=>{var rV=q$(),sV=Q4(),aV=a6();function oV({composeNode:$,composeEmptyNode:Z},X,z,J,Q){let U=new(Q?.nodeClass??rV.YAMLSeq)(X.schema);if(X.atRoot)X.atRoot=!1;if(X.atKey)X.atKey=!1;let W=z.offset,G=null;for(let{start:q,value:V}of z.items){let K=sV.resolveProps(q,{indicator:"seq-item-ind",next:V,offset:W,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(W,"MISSING_CHAR","Sequence item without - indicator");else{if(G=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)aV.flowIndentCheck(z.indent,V,J);W=H.range[2],U.items.push(H)}return U.range=[z.offset,W,G??W],U}tV.resolveBlockSeq=oV});var e$=_((ZK)=>{function $K($,Z,X,z){let J="";if($){let Q=!1,Y="";for(let U of $){let{source:W,type:G}=U;switch(G){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=W.substring(1)||" ";if(!J)J=q;else J+=Y+q;Y="";break}case"newline":if(J)Y+=W;Q=!0;break;default:z(U,"UNEXPECTED_TOKEN",`Unexpected ${G} at node end`)}Z+=W.length}}return{comment:J,offset:Z}}ZK.resolveEnd=$K});var Y9=_((qK)=>{var zK=l(),JK=U$(),J9=G$(),QK=q$(),YK=e$(),Q9=Q4(),UK=i2(),WK=o6(),t6="Block collections are not allowed within flow collections",e6=($)=>$&&($.type==="block-map"||$.type==="block-seq");function GK({composeNode:$,composeEmptyNode:Z},X,z,J,Q){let Y=z.start.source==="{",U=Y?"flow map":"flow sequence",G=new(Q?.nodeClass??(Y?J9.YAMLMap:QK.YAMLSeq))(X.schema);G.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 N=0;N<z.items.length;++N){let A=z.items[N],{start:C,key:w,sep:b,value:k}=A,y=Q9.resolveProps(C,{flow:U,indicator:"explicit-key-ind",next:w??b?.[0],offset:V,onError:J,parentIndent:z.indent,startOnNewline:!1});if(!y.found){if(!y.anchor&&!y.tag&&!b&&!k){if(N===0&&y.comma)J(y.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${U}`);else if(N<z.items.length-1)J(y.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${U}`);if(y.comment)if(G.comment)G.comment+=`
92
+ `+y.comment;else G.comment=y.comment;V=y.end;continue}if(!Y&&X.options.strict&&UK.containsNewline(w))J(w,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(N===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 i="";$:for(let I of C)switch(I.type){case"comma":case"space":break;case"comment":i=I.source.substring(1);break $;default:break $}if(i){let I=G.items[G.items.length-1];if(zK.isPair(I))I=I.value??I.key;if(I.comment)I.comment+=`
93
+ `+i;else I.comment=i;y.comment=y.comment.substring(i.length+1)}}}if(!Y&&!b&&!y.found){let i=k?$(X,k,y,J):Z(X,y.end,b,null,y,J);if(G.items.push(i),V=i.range[2],e6(k))J(i.range,"BLOCK_IN_FLOW",t6)}else{X.atKey=!0;let i=y.end,I=w?$(X,w,y,J):Z(X,i,C,null,y,J);if(e6(w))J(I.range,"BLOCK_IN_FLOW",t6);X.atKey=!1;let m=Q9.resolveProps(b??[],{flow:U,indicator:"map-value-ind",next:k,offset:I.range[2],onError:J,parentIndent:z.indent,startOnNewline:!1});if(m.found){if(!Y&&!y.found&&X.options.strict){if(b)for(let c of b){if(c===m.found)break;if(c.type==="newline"){J(c,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(y.start<m.found.offset-1024)J(m.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(m.start,"MISSING_CHAR",`Missing , or : between ${U} items`);let D0=k?$(X,k,m,J):m.found?Z(X,m.end,b,null,m,J):null;if(D0){if(e6(k))J(D0.range,"BLOCK_IN_FLOW",t6)}else if(m.comment)if(I.comment)I.comment+=`
94
+ `+m.comment;else I.comment=m.comment;let x=new JK.Pair(I,D0);if(X.options.keepSourceTokens)x.srcToken=A;if(Y){let c=G;if(WK.mapIncludes(X,c.items,I))J(i,"DUPLICATE_KEY","Map keys must be unique");c.items.push(x)}else{let c=new J9.YAMLMap(X.schema);c.flow=!0,c.items.push(x);let y0=(D0??I).range;c.range=[I.range[0],y0[1],y0[2]],G.items.push(c)}V=D0?D0.range[2]:m.end}}let K=Y?"}":"]",[H,...T]=z.end,B=V;if(H?.source===K)B=H.offset+H.source.length;else{let N=U[0].toUpperCase()+U.substring(1),A=q?`${N} must end with a ${K}`:`${N} in block collection must be sufficiently indented and end with a ${K}`;if(J(V,q?"MISSING_CHAR":"BAD_INDENT",A),H&&H.source.length!==1)T.unshift(H)}if(T.length>0){let N=YK.resolveEnd(T,B,X.options.strict,J);if(N.comment)if(G.comment)G.comment+=`
95
+ `+N.comment;else G.comment=N.comment;G.range=[z.offset,B,N.offset]}else G.range=[z.offset,B,B];return G}qK.resolveFlowCollection=GK});var U9=_((DK)=>{var KK=l(),HK=X0(),BK=G$(),LK=q$(),MK=X9(),NK=z9(),OK=Y9();function $8($,Z,X,z,J,Q){let Y=X.type==="block-map"?MK.resolveBlockMap($,Z,X,z,Q):X.type==="block-seq"?NK.resolveBlockSeq($,Z,X,z,Q):OK.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 TK($,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===BK.YAMLMap.tagName&&U==="map"||Y===LK.YAMLSeq.tagName&&U==="seq")return $8($,Z,X,J,Y);let W=Z.schema.tags.find((K)=>K.tag===Y&&K.collection===U);if(!W){let K=Z.schema.knownTags[Y];if(K?.collection===U)Z.schema.tags.push(Object.assign({},K,{default:!1})),W=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 $8($,Z,X,J,Y)}}let G=$8($,Z,X,J,Y,W),q=W.resolve?.(G,(K)=>J(Q,"TAG_RESOLVE_FAILED",K),Z.options)??G,V=KK.isNode(q)?q:new HK.Scalar(q);if(V.range=G.range,V.tag=Y,W?.format)V.format=W.format;return V}DK.composeCollection=TK});var X8=_((_K)=>{var Z8=X0();function AK($,Z,X){let z=Z.offset,J=RK(Z,$.options.strict,X);if(!J)return{value:"",type:null,comment:"",range:[z,z,z]};let Q=J.mode===">"?Z8.Scalar.BLOCK_FOLDED:Z8.Scalar.BLOCK_LITERAL,Y=Z.source?FK(Z.source):[],U=Y.length;for(let B=Y.length-1;B>=0;--B){let N=Y[B][1];if(N===""||N==="\r")U=B;else break}if(U===0){let B=J.chomp==="+"&&Y.length>0?`
96
+ `.repeat(Math.max(1,Y.length-1)):"",N=z+J.length;if(Z.source)N+=Z.source.length;return{value:B,type:Q,comment:J.comment,range:[z,N,N]}}let W=Z.indent+J.indent,G=Z.offset+J.length,q=0;for(let B=0;B<U;++B){let[N,A]=Y[B];if(A===""||A==="\r"){if(J.indent===0&&N.length>W)W=N.length}else{if(N.length<W)X(G+N.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(J.indent===0)W=N.length;if(q=B,W===0&&!$.atRoot)X(G,"BAD_INDENT","Block scalar values in collections must be indented");break}G+=N.length+A.length+1}for(let B=Y.length-1;B>=U;--B)if(Y[B][0].length>W)U=B+1;let V="",K="",H=!1;for(let B=0;B<q;++B)V+=Y[B][0].slice(W)+`
97
+ `;for(let B=q;B<U;++B){let[N,A]=Y[B];G+=N.length+A.length+1;let C=A[A.length-1]==="\r";if(C)A=A.slice(0,-1);if(A&&N.length<W){let b=`Block scalar lines must not be less indented than their ${J.indent?"explicit indentation indicator":"first line"}`;X(G-A.length-(C?2:1),"BAD_INDENT",b),N=""}if(Q===Z8.Scalar.BLOCK_LITERAL)V+=K+N.slice(W)+A,K=`
98
+ `;else if(N.length>W||A[0]==="\t"){if(K===" ")K=`
99
99
  `;else if(!H&&K===`
100
100
  `)K=`
101
101
 
102
- `;V+=K+N.slice(W)+_,K=`
103
- `,H=!0}else if(_==="")if(K===`
102
+ `;V+=K+N.slice(W)+A,K=`
103
+ `,H=!0}else if(A==="")if(K===`
104
104
  `)V+=`
105
105
  `;else K=`
106
- `;else V+=K+_,K=" ",H=!1}switch(J.chomp){case"-":break;case"+":for(let B=U;B<Y.length;++B)V+=`
106
+ `;else V+=K+A,K=" ",H=!1}switch(J.chomp){case"-":break;case"+":for(let B=U;B<Y.length;++B)V+=`
107
107
  `+Y[B][0].slice(W);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 AK({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="",W=-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(W===-1)W=$+K}}if(W!==-1)z(W,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${J}`);let G=!1,q="",V=J.length;for(let K=1;K<Z.length;++K){let H=Z[K];switch(H.type){case"space":G=!0;case"newline":V+=H.source.length;break;case"comment":if(X&&!G)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 B=H.source;if(B&&typeof B==="string")V+=B.length}}}return{mode:Q,indent:Y,chomp:U,comment:q,length:V}}function RK($){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}FK.resolveBlockScalar=IK});var X3=P((kK)=>{var Z3=Z0(),PK=o$();function CK($,Z,X){let{offset:z,type:J,source:Q,end:Y}=$,U,W,G=(K,H,T)=>X(z+K,H,T);switch(J){case"scalar":U=Z3.Scalar.PLAIN,W=wK(Q,G);break;case"single-quoted-scalar":U=Z3.Scalar.QUOTE_SINGLE,W=EK(Q,G);break;case"double-quoted-scalar":U=Z3.Scalar.QUOTE_DOUBLE,W=jK(Q,G);break;default:return X($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${J}`),{value:"",type:null,comment:"",range:[z,z+Q.length,z+Q.length]}}let q=z+Q.length,V=PK.resolveEnd(Y,q,Z,X);return{value:W,type:U,comment:V.comment,range:[z,q,V.offset]}}function wK($,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 U9($)}function EK($,Z){if($[$.length-1]!=="'"||$.length===1)Z($.length,"MISSING_CHAR","Missing closing 'quote");return U9($.slice(1,-1)).replace(/''/g,"'")}function U9($){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 RK({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="",W=-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(W===-1)W=$+K}}if(W!==-1)z(W,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${J}`);let G=!1,q="",V=J.length;for(let K=1;K<Z.length;++K){let H=Z[K];switch(H.type){case"space":G=!0;case"newline":V+=H.source.length;break;case"comment":if(X&&!G)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 B=H.source;if(B&&typeof B==="string")V+=B.length}}}return{mode:Q,indent:Y,chomp:U,comment:q,length:V}}function FK($){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}_K.resolveBlockScalar=AK});var J8=_((yK)=>{var z8=X0(),CK=e$();function wK($,Z,X){let{offset:z,type:J,source:Q,end:Y}=$,U,W,G=(K,H,T)=>X(z+K,H,T);switch(J){case"scalar":U=z8.Scalar.PLAIN,W=EK(Q,G);break;case"single-quoted-scalar":U=z8.Scalar.QUOTE_SINGLE,W=jK(Q,G);break;case"double-quoted-scalar":U=z8.Scalar.QUOTE_DOUBLE,W=SK(Q,G);break;default:return X($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${J}`),{value:"",type:null,comment:"",range:[z,z+Q.length,z+Q.length]}}let q=z+Q.length,V=CK.resolveEnd(Y,q,Z,X);return{value:W,type:U,comment:V.comment,range:[z,q,V.offset]}}function EK($,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 W9($)}function jK($,Z){if($[$.length-1]!=="'"||$.length===1)Z($.length,"MISSING_CHAR","Missing closing 'quote");return W9($.slice(1,-1)).replace(/''/g,"'")}function W9($){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 jK($,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 SK($,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}=SK($,z);X+=Q,z=Y}else if(J==="\\"){let Q=$[++z],Y=xK[Q];if(Y)X+=Y;else if(Q===`
116
+ `){let{fold:Q,offset:Y}=xK($,z);X+=Q,z=Y}else if(J==="\\"){let Q=$[++z],Y=bK[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+=bK($,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+=kK($,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 SK($,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 xK($,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 xK={"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 bK($,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)}kK.resolveFlowScalar=CK});var G9=P((mK)=>{var w$=p(),W9=Z0(),fK=$3(),gK=X3();function vK($,Z,X,z){let{value:J,type:Q,comment:Y,range:U}=Z.type==="block-scalar"?fK.resolveBlockScalar($,Z,z):gK.resolveFlowScalar(Z,$.options.strict,z),W=X?$.directives.tagName(X.source,(V)=>z(X,"TAG_RESOLVE_FAILED",V)):null,G;if($.options.stringKeys&&$.atKey)G=$.schema[w$.SCALAR];else if(W)G=hK($.schema,J,W,X,z);else if(Z.type==="scalar")G=uK($,J,Z,z);else G=$.schema[w$.SCALAR];let q;try{let V=G.resolve(J,(K)=>z(X??Z,"TAG_RESOLVE_FAILED",K),$.options);q=w$.isScalar(V)?V:new W9.Scalar(V)}catch(V){let K=V instanceof Error?V.message:String(V);z(X??Z,"TAG_RESOLVE_FAILED",K),q=new W9.Scalar(J)}if(q.range=U,q.source=J,Q)q.type=Q;if(W)q.tag=W;if(G.format)q.format=G.format;if(Y)q.comment=Y;return q}function hK($,Z,X,z,J){if(X==="!")return $[w$.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"),$[w$.SCALAR]}function uK({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[w$.SCALAR];if(X.compat){let U=X.compat.find((W)=>W.default&&W.test?.test(z))??X[w$.SCALAR];if(Y.tag!==U.tag){let W=Z.tagString(Y.tag),G=Z.tagString(U.tag),q=`Value may be parsed as either ${W} or ${G}`;Q(J,"TAG_RESOLVE_FAILED",q,!0)}}return Y}mK.composeScalar=vK});var q9=P((pK)=>{function dK($,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 $}pK.emptyScalarPosition=dK});var H9=P((eK)=>{var iK=u1(),nK=p(),rK=Y9(),V9=G9(),sK=o$(),aK=q9(),oK={composeNode:K9,composeEmptyNode:z3};function K9($,Z,X,z){let J=$.atKey,{spaceBefore:Q,comment:Y,anchor:U,tag:W}=X,G,q=!0;switch(Z.type){case"alias":if(G=tK($,Z,z),U||W)z(Z,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(G=V9.composeScalar($,Z,W,z),U)G.anchor=U.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(G=rK.composeCollection(oK,$,Z,X,z),U)G.anchor=U.source.substring(1);break;default:{let V=Z.type==="error"?Z.message:`Unsupported token (type: ${Z.type})`;z(Z,"UNEXPECTED_TOKEN",V),G=z3($,Z.offset,void 0,null,X,z),q=!1}}if(U&&G.anchor==="")z(U,"BAD_ALIAS","Anchor cannot be an empty string");if(J&&$.options.stringKeys&&(!nK.isScalar(G)||typeof G.value!=="string"||G.tag&&G.tag!=="tag:yaml.org,2002:str"))z(W??Z,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(Q)G.spaceBefore=!0;if(Y)if(Z.type==="scalar"&&Z.source==="")G.comment=Y;else G.commentBefore=Y;if($.options.keepSourceTokens&&q)G.srcToken=Z;return G}function z3($,Z,X,z,{spaceBefore:J,comment:Q,anchor:Y,tag:U,end:W},G){let q={type:"scalar",offset:aK.emptyScalarPosition(Z,X,z),indent:-1,source:""},V=V9.composeScalar($,q,U,G);if(Y){if(V.anchor=Y.source.substring(1),V.anchor==="")G(Y,"BAD_ALIAS","Anchor cannot be an empty string")}if(J)V.spaceBefore=!0;if(Q)V.comment=Q,V.range[2]=W;return V}function tK({options:$},{offset:Z,source:X,end:z},J){let Q=new iK.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=sK.resolveEnd(z,Y,$.strict,J);if(Q.range=[Z,Y,U.offset],U.comment)Q.comment=U.comment;return Q}eK.composeEmptyNode=z3;eK.composeNode=K9});var L9=P((YH)=>{var XH=Z4(),B9=H9(),zH=o$(),JH=z4();function QH($,Z,{offset:X,start:z,value:J,end:Q},Y){let U=Object.assign({_directives:Z},$),W=new XH.Document(void 0,U),G={atKey:!1,atRoot:!0,directives:W.directives,options:W.options,schema:W.schema},q=JH.resolveProps(z,{indicator:"doc-start",next:J??Q?.[0],offset:X,onError:Y,parentIndent:0,startOnNewline:!0});if(q.found){if(W.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")}W.contents=J?B9.composeNode(G,J,q,Y):B9.composeEmptyNode(G,q.end,z,null,q,Y);let V=W.contents.range[2],K=zH.resolveEnd(Q,V,!1,Y);if(K.comment)W.comment=K.comment;return W.range=[X,V,K.offset],W}YH.composeDoc=QH});var J3=P((HH)=>{var WH=D0("process"),GH=W8(),qH=Z4(),J4=X4(),M9=p(),VH=L9(),KH=o$();function Q4($){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 N9($){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 bK={"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 kK($,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)}yK.resolveFlowScalar=wK});var q9=_((cK)=>{var j$=l(),G9=X0(),gK=X8(),vK=J8();function hK($,Z,X,z){let{value:J,type:Q,comment:Y,range:U}=Z.type==="block-scalar"?gK.resolveBlockScalar($,Z,z):vK.resolveFlowScalar(Z,$.options.strict,z),W=X?$.directives.tagName(X.source,(V)=>z(X,"TAG_RESOLVE_FAILED",V)):null,G;if($.options.stringKeys&&$.atKey)G=$.schema[j$.SCALAR];else if(W)G=uK($.schema,J,W,X,z);else if(Z.type==="scalar")G=mK($,J,Z,z);else G=$.schema[j$.SCALAR];let q;try{let V=G.resolve(J,(K)=>z(X??Z,"TAG_RESOLVE_FAILED",K),$.options);q=j$.isScalar(V)?V:new G9.Scalar(V)}catch(V){let K=V instanceof Error?V.message:String(V);z(X??Z,"TAG_RESOLVE_FAILED",K),q=new G9.Scalar(J)}if(q.range=U,q.source=J,Q)q.type=Q;if(W)q.tag=W;if(G.format)q.format=G.format;if(Y)q.comment=Y;return q}function uK($,Z,X,z,J){if(X==="!")return $[j$.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"),$[j$.SCALAR]}function mK({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[j$.SCALAR];if(X.compat){let U=X.compat.find((W)=>W.default&&W.test?.test(z))??X[j$.SCALAR];if(Y.tag!==U.tag){let W=Z.tagString(Y.tag),G=Z.tagString(U.tag),q=`Value may be parsed as either ${W} or ${G}`;Q(J,"TAG_RESOLVE_FAILED",q,!0)}}return Y}cK.composeScalar=hK});var V9=_((lK)=>{function pK($,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 $}lK.emptyScalarPosition=pK});var B9=_(($H)=>{var nK=c1(),rK=l(),sK=U9(),K9=q9(),aK=e$(),oK=V9(),tK={composeNode:H9,composeEmptyNode:Q8};function H9($,Z,X,z){let J=$.atKey,{spaceBefore:Q,comment:Y,anchor:U,tag:W}=X,G,q=!0;switch(Z.type){case"alias":if(G=eK($,Z,z),U||W)z(Z,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(G=K9.composeScalar($,Z,W,z),U)G.anchor=U.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(G=sK.composeCollection(tK,$,Z,X,z),U)G.anchor=U.source.substring(1)}catch(V){let K=V instanceof Error?V.message:String(V);z(Z,"RESOURCE_EXHAUSTION",K)}break;default:{let V=Z.type==="error"?Z.message:`Unsupported token (type: ${Z.type})`;z(Z,"UNEXPECTED_TOKEN",V),q=!1}}if(G??(G=Q8($,Z.offset,void 0,null,X,z)),U&&G.anchor==="")z(U,"BAD_ALIAS","Anchor cannot be an empty string");if(J&&$.options.stringKeys&&(!rK.isScalar(G)||typeof G.value!=="string"||G.tag&&G.tag!=="tag:yaml.org,2002:str"))z(W??Z,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(Q)G.spaceBefore=!0;if(Y)if(Z.type==="scalar"&&Z.source==="")G.comment=Y;else G.commentBefore=Y;if($.options.keepSourceTokens&&q)G.srcToken=Z;return G}function Q8($,Z,X,z,{spaceBefore:J,comment:Q,anchor:Y,tag:U,end:W},G){let q={type:"scalar",offset:oK.emptyScalarPosition(Z,X,z),indent:-1,source:""},V=K9.composeScalar($,q,U,G);if(Y){if(V.anchor=Y.source.substring(1),V.anchor==="")G(Y,"BAD_ALIAS","Anchor cannot be an empty string")}if(J)V.spaceBefore=!0;if(Q)V.comment=Q,V.range[2]=W;return V}function eK({options:$},{offset:Z,source:X,end:z},J){let Q=new nK.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=aK.resolveEnd(z,Y,$.strict,J);if(Q.range=[Z,Y,U.offset],U.comment)Q.comment=U.comment;return Q}$H.composeEmptyNode=Q8;$H.composeNode=H9});var M9=_((UH)=>{var zH=z4(),L9=B9(),JH=e$(),QH=Q4();function YH($,Z,{offset:X,start:z,value:J,end:Q},Y){let U=Object.assign({_directives:Z},$),W=new zH.Document(void 0,U),G={atKey:!1,atRoot:!0,directives:W.directives,options:W.options,schema:W.schema},q=QH.resolveProps(z,{indicator:"doc-start",next:J??Q?.[0],offset:X,onError:Y,parentIndent:0,startOnNewline:!0});if(q.found){if(W.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")}W.contents=J?L9.composeNode(G,J,q,Y):L9.composeEmptyNode(G,q.end,z,null,q,Y);let V=W.contents.range[2],K=JH.resolveEnd(Q,V,!1,Y);if(K.comment)W.comment=K.comment;return W.range=[X,V,K.offset],W}UH.composeDoc=YH});var Y8=_((BH)=>{var GH=I0("process"),qH=q6(),VH=z4(),Y4=J4(),N9=l(),KH=M9(),HH=e$();function U4($){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 O9($){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 O9{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Z,X,z,J)=>{let Q=Q4(Z);if(J)this.warnings.push(new J4.YAMLWarning(Q,X,z));else this.errors.push(new J4.YAMLParseError(Q,X,z))},this.directives=new GH.Directives({version:$.version||"1.2"}),this.options=$}decorate($,Z){let{comment:X,afterEmptyLine:z}=N9(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(M9.isCollection(J)&&!J.flow&&J.items.length>0){let Q=J.items[0];if(M9.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 T9{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Z,X,z,J)=>{let Q=U4(Z);if(J)this.warnings.push(new Y4.YAMLWarning(Q,X,z));else this.errors.push(new Y4.YAMLParseError(Q,X,z))},this.directives=new qH.Directives({version:$.version||"1.2"}),this.options=$}decorate($,Z){let{comment:X,afterEmptyLine:z}=O9(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(N9.isCollection(J)&&!J.flow&&J.items.length>0){let Q=J.items[0];if(N9.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:N9(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(WH.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(Z,X,z)=>{let J=Q4($);J[0]+=Z,this.onError(J,"BAD_DIRECTIVE",X,z)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let Z=VH.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 J4.YAMLParseError(Q4($),"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 J4.YAMLParseError(Q4($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Z=KH.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 J4.YAMLParseError(Q4($),"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 qH.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}}}HH.Composer=O9});var I9=P((AH)=>{var LH=$3(),MH=X3(),NH=X4(),T9=p1();function OH($,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 NH.YAMLParseError([U,U+1],Q,Y)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return MH.resolveFlowScalar($,Z,z);case"block-scalar":return LH.resolveBlockScalar({options:{strict:Z}},$,z)}}return null}function TH($,Z){let{implicitKey:X=!1,indent:z,inFlow:J=!1,offset:Q=-1,type:Y="PLAIN"}=Z,U=T9.stringifyString({type:Y,value:$},{implicitKey:X,indent:z>0?" ".repeat(z):"",inFlow:J,options:{blockQuote:!0,lineWidth:-1}}),W=Z.end??[{type:"newline",offset:-1,indent:z,source:`
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:O9(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(GH.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(Z,X,z)=>{let J=U4($);J[0]+=Z,this.onError(J,"BAD_DIRECTIVE",X,z)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let Z=KH.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 Y4.YAMLParseError(U4($),"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 Y4.YAMLParseError(U4($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Z=HH.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 Y4.YAMLParseError(U4($),"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 VH.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}}}BH.Composer=T9});var A9=_((RH)=>{var MH=X8(),NH=J8(),OH=J4(),D9=i1();function TH($,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 OH.YAMLParseError([U,U+1],Q,Y)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return NH.resolveFlowScalar($,Z,z);case"block-scalar":return MH.resolveBlockScalar({options:{strict:Z}},$,z)}}return null}function DH($,Z){let{implicitKey:X=!1,indent:z,inFlow:J=!1,offset:Q=-1,type:Y="PLAIN"}=Z,U=D9.stringifyString({type:Y,value:$},{implicitKey:X,indent:z>0?" ".repeat(z):"",inFlow:J,options:{blockQuote:!0,lineWidth:-1}}),W=Z.end??[{type:"newline",offset:-1,indent:z,source:`
133
133
  `}];switch(U[0]){case"|":case">":{let G=U.indexOf(`
134
134
  `),q=U.substring(0,G),V=U.substring(G+1)+`
135
- `,K=[{type:"block-scalar-header",offset:Q,indent:z,source:q}];if(!D9(K,W))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:W};case"'":return{type:"single-quoted-scalar",offset:Q,indent:z,source:U,end:W};default:return{type:"scalar",offset:Q,indent:z,source:U,end:W}}}function DH($,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 G=$.props[0];if(G.type!=="block-scalar-header")throw Error("Invalid block scalar header");Y=G.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:Y="PLAIN"}let W=T9.stringifyString({type:Y,value:Z},{implicitKey:J||U===null,indent:U!==null&&U>0?" ".repeat(U):"",inFlow:Q,options:{blockQuote:!0,lineWidth:-1}});switch(W[0]){case"|":case">":IH($,W);break;case'"':Q3($,W,"double-quoted-scalar");break;case"'":Q3($,W,"single-quoted-scalar");break;default:Q3($,W,"scalar")}}function IH($,Z){let X=Z.indexOf(`
135
+ `,K=[{type:"block-scalar-header",offset:Q,indent:z,source:q}];if(!I9(K,W))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:W};case"'":return{type:"single-quoted-scalar",offset:Q,indent:z,source:U,end:W};default:return{type:"scalar",offset:Q,indent:z,source:U,end:W}}}function IH($,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 G=$.props[0];if(G.type!=="block-scalar-header")throw Error("Invalid block scalar header");Y=G.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:Y="PLAIN"}let W=D9.stringifyString({type:Y,value:Z},{implicitKey:J||U===null,indent:U!==null&&U>0?" ".repeat(U):"",inFlow:Q,options:{blockQuote:!0,lineWidth:-1}});switch(W[0]){case"|":case">":AH($,W);break;case'"':U8($,W,"double-quoted-scalar");break;case"'":U8($,W,"single-quoted-scalar");break;default:U8($,W,"scalar")}}function AH($,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(!D9(U,"end"in $?$.end:void 0))U.push({type:"newline",offset:-1,indent:Y,source:`
139
- `});for(let W of Object.keys($))if(W!=="type"&&W!=="offset")delete $[W];Object.assign($,{type:"block-scalar",indent:Y,props:U,source:J})}}function D9($,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 Q3($,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})}}}AH.createScalarToken=TH;AH.resolveAsScalar=OH;AH.setScalarValue=DH});var A9=P((CH)=>{var PH=($)=>("type"in $)?i2($):l2($);function i2($){switch($.type){case"block-scalar":{let Z="";for(let X of $.props)Z+=i2(X);return Z+$.source}case"block-map":case"block-seq":{let Z="";for(let X of $.items)Z+=l2(X);return Z}case"flow-collection":{let Z=$.start.source;for(let X of $.items)Z+=l2(X);for(let X of $.end)Z+=X.source;return Z}case"document":{let Z=l2($);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 l2({start:$,key:Z,sep:X,value:z}){let J="";for(let Q of $)J+=Q.source;if(Z)J+=i2(Z);if(X)for(let Q of X)J+=Q.source;if(z)J+=i2(z);return J}CH.stringify=PH});var _9=P((jH)=>{var Y3=Symbol("break visit"),EH=Symbol("skip children"),R9=Symbol("remove item");function E$($,Z){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};F9(Object.freeze([]),$,Z)}E$.BREAK=Y3;E$.SKIP=EH;E$.REMOVE=R9;E$.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};E$.parentCollection=($,Z)=>{let X=E$.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 F9($,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=F9(Object.freeze($.concat([[J,Y]])),Q.items[Y],X);if(typeof U==="number")Y=U-1;else if(U===Y3)return Y3;else if(U===R9)Q.items.splice(Y,1),Y-=1}if(typeof z==="function"&&J==="key")z=z(Z,$)}}return typeof z==="function"?z(Z,$):z}jH.visit=E$});var n2=P((vH)=>{var U3=I9(),xH=A9(),bH=_9(),W3="\uFEFF",G3="\x02",q3="\x18",V3="\x1F",kH=($)=>!!$&&("items"in $),yH=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function fH($){switch($){case W3:return"<BOM>";case G3:return"<DOC>";case q3:return"<FLOW_END>";case V3:return"<SCALAR>";default:return JSON.stringify($)}}function gH($){switch($){case W3:return"byte-order-mark";case G3:return"doc-mode";case q3:return"flow-error-end";case V3: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 W of Object.keys($))if(W!=="type"&&W!=="offset")delete $[W];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 U8($,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})}}}RH.createScalarToken=DH;RH.resolveAsScalar=TH;RH.setScalarValue=IH});var R9=_((wH)=>{var CH=($)=>("type"in $)?r2($):n2($);function r2($){switch($.type){case"block-scalar":{let Z="";for(let X of $.props)Z+=r2(X);return Z+$.source}case"block-map":case"block-seq":{let Z="";for(let X of $.items)Z+=n2(X);return Z}case"flow-collection":{let Z=$.start.source;for(let X of $.items)Z+=n2(X);for(let X of $.end)Z+=X.source;return Z}case"document":{let Z=n2($);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 n2({start:$,key:Z,sep:X,value:z}){let J="";for(let Q of $)J+=Q.source;if(Z)J+=r2(Z);if(X)for(let Q of X)J+=Q.source;if(z)J+=r2(z);return J}wH.stringify=CH});var P9=_((SH)=>{var W8=Symbol("break visit"),jH=Symbol("skip children"),F9=Symbol("remove item");function S$($,Z){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};_9(Object.freeze([]),$,Z)}S$.BREAK=W8;S$.SKIP=jH;S$.REMOVE=F9;S$.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};S$.parentCollection=($,Z)=>{let X=S$.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 _9($,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=_9(Object.freeze($.concat([[J,Y]])),Q.items[Y],X);if(typeof U==="number")Y=U-1;else if(U===W8)return W8;else if(U===F9)Q.items.splice(Y,1),Y-=1}if(typeof z==="function"&&J==="key")z=z(Z,$)}}return typeof z==="function"?z(Z,$):z}SH.visit=S$});var s2=_((hH)=>{var G8=A9(),bH=R9(),kH=P9(),q8="\uFEFF",V8="\x02",K8="\x18",H8="\x1F",yH=($)=>!!$&&("items"in $),fH=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function gH($){switch($){case q8:return"<BOM>";case V8:return"<DOC>";case K8:return"<FLOW_END>";case H8:return"<SCALAR>";default:return JSON.stringify($)}}function vH($){switch($){case q8:return"byte-order-mark";case V8:return"doc-mode";case K8:return"flow-error-end";case H8: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}vH.createScalarToken=U3.createScalarToken;vH.resolveAsScalar=U3.resolveAsScalar;vH.setScalarValue=U3.setScalarValue;vH.stringify=xH.stringify;vH.visit=bH.visit;vH.BOM=W3;vH.DOCUMENT=G3;vH.FLOW_END=q3;vH.SCALAR=V3;vH.isCollection=kH;vH.isScalar=yH;vH.prettyToken=fH;vH.tokenType=gH});var H3=P(($B)=>{var Y4=n2();function k0($){switch($){case void 0:case" ":case`
143
- `:case"\r":case"\t":return!0;default:return!1}}var P9=new Set("0123456789ABCDEFabcdef"),tH=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),r2=new Set(",[]{}"),eH=new Set(` ,[]{}
144
- \r `),K3=($)=>!$||eH.has($);class C9{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}hH.createScalarToken=G8.createScalarToken;hH.resolveAsScalar=G8.resolveAsScalar;hH.setScalarValue=G8.setScalarValue;hH.stringify=bH.stringify;hH.visit=kH.visit;hH.BOM=q8;hH.DOCUMENT=V8;hH.FLOW_END=K8;hH.SCALAR=H8;hH.isCollection=yH;hH.isScalar=fH;hH.prettyToken=gH;hH.tokenType=vH});var L8=_((ZB)=>{var W4=s2();function g0($){switch($){case void 0:case" ":case`
143
+ `:case"\r":case"\t":return!0;default:return!1}}var C9=new Set("0123456789ABCDEFabcdef"),eH=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),a2=new Set(",[]{}"),$B=new Set(` ,[]{}
144
+ \r `),B8=($)=>!$||$B.has($);class w9{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==="...")&&k0(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]===Y4.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 Y4.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==="...")&&k0(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&&!k0(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(($==="-"||$==="?"||$===":")&&k0(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(K3),"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("..."))&&k0(z[3])){if(!(X===this.indentNext-1&&this.flowLevel===1&&(z[0]==="]"||z[0]==="}")))return this.flowLevel=0,yield Y4.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(K3),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let Q=this.charAt(1);if(this.flowKey||k0(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==="...")&&g0(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]===W4.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 W4.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==="...")&&g0(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&&!g0(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(($==="-"||$==="?"||$===":")&&g0(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(B8),"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("..."))&&g0(z[3])){if(!(X===this.indentNext-1&&this.flowLevel===1&&(z[0]==="]"||z[0]==="}")))return this.flowLevel=0,yield W4.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(B8),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let Q=this.charAt(1);if(this.flowKey||g0(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)=>k0(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)=>g0(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 Y4.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(k0(J)||$&&r2.has(J))break;Z=X}else if(k0(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 W4.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(g0(J)||$&&a2.has(J))break;Z=X}else if(g0(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==="#"||$&&r2.has(J))break;if(z===`
159
- `){let Q=this.continueScalar(X+1);if(Q===-1)break;X=Math.max(X,Q-2)}}else{if($&&r2.has(z))break;Z=X}if(!z&&!this.atEnd)return this.setNext("plain-scalar");return yield Y4.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(K3))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let $=this.flowLevel>0,Z=this.charAt(1);if(k0(Z)||$&&r2.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(!k0(Z)&&Z!==">")Z=this.buffer[++$];return yield*this.pushToIndex(Z===">"?$+1:$,!1)}else{let $=this.pos+1,Z=this.buffer[$];while(Z)if(tH.has(Z))Z=this.buffer[++$];else if(Z==="%"&&P9.has(this.buffer[$+1])&&P9.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==="#"||$&&a2.has(J))break;if(z===`
159
+ `){let Q=this.continueScalar(X+1);if(Q===-1)break;X=Math.max(X,Q-2)}}else{if($&&a2.has(z))break;Z=X}if(!z&&!this.atEnd)return this.setNext("plain-scalar");return yield W4.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(B8))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let $=this.flowLevel>0,Z=this.charAt(1);if(g0(Z)||$&&a2.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(!g0(Z)&&Z!==">")Z=this.buffer[++$];return yield*this.pushToIndex(Z===">"?$+1:$,!1)}else{let $=this.pos+1,Z=this.buffer[$];while(Z)if(eH.has(Z))Z=this.buffer[++$];else if(Z==="%"&&C9.has(this.buffer[$+1])&&C9.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)}}$B.Lexer=C9});var B3=P((XB)=>{class w9{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}}}}XB.LineCounter=w9});var L3=P((YB)=>{var JB=D0("process"),E9=n2(),QB=H3();function q$($,Z){for(let X=0;X<$.length;++X)if($[X].type===Z)return!0;return!1}function j9($){for(let Z=0;Z<$.length;++Z)switch($[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function x9($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function s2($){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 t$($){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 S9($){if($.start.type==="flow-seq-start"){for(let Z of $.items)if(Z.sep&&!Z.value&&!q$(Z.start,"explicit-key-ind")&&!q$(Z.sep,"map-value-ind")){if(Z.key)Z.value=Z.key;if(delete Z.key,x9(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 b9{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 QB.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=$,JB.env.LOG_TOKENS)console.log("|",E9.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let Z=E9.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")S9(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&&j9(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(j9($.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=s2(this.peek(2)),X=t$(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)}}ZB.Lexer=w9});var M8=_((zB)=>{class E9{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}}}}zB.LineCounter=E9});var N8=_((UB)=>{var QB=I0("process"),j9=s2(),YB=L8();function V$($,Z){for(let X=0;X<$.length;++X)if($[X].type===Z)return!0;return!1}function S9($){for(let Z=0;Z<$.length;++Z)switch($[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function b9($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function o2($){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 $1($){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 x9($){if($.start.type==="flow-seq-start"){for(let Z of $.items)if(Z.sep&&!Z.value&&!V$(Z.start,"explicit-key-ind")&&!V$(Z.sep,"map-value-ind")){if(Z.key)Z.value=Z.key;if(delete Z.key,b9(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 k9{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 YB.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=$,QB.env.LOG_TOKENS)console.log("|",j9.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let Z=j9.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")x9(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&&S9(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(S9($.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=o2(this.peek(2)),X=$1(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(q$(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let Q=t$(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(q$(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(x9(Z.key)&&!q$(Z.sep,"newline")){let Q=t$(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(q$(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&&!q$(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||q$(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=s2(X),J=t$(z);S9($);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(V$(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let Q=$1(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(V$(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(b9(Z.key)&&!V$(Z.sep,"newline")){let Q=$1(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(V$(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&&!V$(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||V$(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=o2(X),J=$1(z);x9($);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=s2($),X=t$(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=s2($),X=t$(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()}}}YB.Parser=b9});var v9=P((LB)=>{var k9=J3(),WB=Z4(),U4=X4(),GB=B8(),qB=p(),VB=B3(),y9=L3();function f9($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new VB.LineCounter||null,prettyErrors:Z}}function KB($,Z={}){let{lineCounter:X,prettyErrors:z}=f9(Z),J=new y9.Parser(X?.addNewLine),Q=new k9.Composer(Z),Y=Array.from(Q.compose(J.parse($)));if(z&&X)for(let U of Y)U.errors.forEach(U4.prettifyError($,X)),U.warnings.forEach(U4.prettifyError($,X));if(Y.length>0)return Y;return Object.assign([],{empty:!0},Q.streamInfo())}function g9($,Z={}){let{lineCounter:X,prettyErrors:z}=f9(Z),J=new y9.Parser(X?.addNewLine),Q=new k9.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 U4.YAMLParseError(U.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&X)Y.errors.forEach(U4.prettifyError($,X)),Y.warnings.forEach(U4.prettifyError($,X));return Y}function HB($,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=g9($,X);if(!J)return null;if(J.warnings.forEach((Q)=>GB.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 BB($,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(qB.isDocument($)&&!z)return $.toString(X);return new WB.Document($,z,X).toString(X)}LB.parse=HB;LB.parseAllDocuments=KB;LB.parseDocument=g9;LB.stringify=BB});var l9={};H5(l9,{orange:()=>q0,italic:()=>YL,fafCyanDeep:()=>o2,fafCyan:()=>I,dim:()=>L,bold:()=>R,FAF_HEX:()=>W4});var T3=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,R,L,YL,W4,I=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,o2=($)=>`\x1B[38;2;14;140;140m${$}\x1B[0m`,q0=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var d=y(()=>{R=T3("1"),L=T3("2"),YL=T3("3"),W4={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"}});var d3=P((XC,EO)=>{EO.exports={name:"faf-cli",version:"7.1.2",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","agents-md","context-engineering","codex","windsurf"],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 C($,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 M($,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 o0=()=>{};var i3=function(){let{crypto:$}=globalThis;if($?.randomUUID)return i3=$.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 t0($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var O4=($)=>{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 b,J0,H0,B$,H1,B1,L1,M1,N1,O1,T1,D1,I1;var O0=y(()=>{b=class b extends Error{};J0=class J0 extends b{constructor($,Z,X,z,J){super(`${J0.makeMessage($,Z,X)}`);this.status=$,this.headers=z,this.requestID=z?.get("request-id"),this.error=Z,this.type=J??null}static makeMessage($,Z,X){let z=Z?.message?typeof Z.message==="string"?Z.message:JSON.stringify(Z.message):Z?JSON.stringify(Z):X;if($&&z)return`${$} ${z}`;if($)return`${$} status code (no body)`;if(z)return z;return"(no status code or body)"}static generate($,Z,X,z){if(!$||!z)return new B$({message:X,cause:O4(Z)});let J=Z,Q=J?.error?.type;if($===400)return new B1($,J,X,z,Q);if($===401)return new L1($,J,X,z,Q);if($===403)return new M1($,J,X,z,Q);if($===404)return new N1($,J,X,z,Q);if($===409)return new O1($,J,X,z,Q);if($===422)return new T1($,J,X,z,Q);if($===429)return new D1($,J,X,z,Q);if($>=500)return new I1($,J,X,z,Q);return new J0($,J,X,z,Q)}};H0=class H0 extends J0{constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}};B$=class B$ extends J0{constructor({message:$,cause:Z}){super(void 0,void 0,$||"Connection error.",void 0);if(Z)this.cause=Z}};H1=class H1 extends B${constructor({message:$}={}){super({message:$??"Request timed out."})}};B1=class B1 extends J0{};L1=class L1 extends J0{};M1=class M1 extends J0{};N1=class N1 extends J0{};O1=class O1 extends J0{};T1=class T1 extends J0{};D1=class D1 extends J0{};I1=class I1 extends J0{}});function A6($){if(typeof $!=="object")return{};return $??{}}function s3($){if(!$)return!0;for(let Z in $)return!1;return!0}function rz($,Z){return Object.prototype.hasOwnProperty.call($,Z)}var WT,nz=($)=>{return WT.test($)},n3=($)=>(n3=Array.isArray,n3($)),r3,sz=($,Z)=>{if(typeof Z!=="number"||!Number.isInteger(Z))throw new b(`${$} must be an integer`);if(Z<0)throw new b(`${$} must be a positive integer`);return Z},R6=($)=>{try{return JSON.parse($)}catch(Z){return}};var k$=y(()=>{O0();WT=/^[a-z][a-z0-9+.-]*:/i,r3=n3});var az=($)=>new Promise((Z)=>setTimeout(Z,$));var L$="0.91.1";function GT(){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 VT(){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 $J=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"},qT=()=>{let $=GT();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":L$,"X-Stainless-OS":tz(Deno.build.os),"X-Stainless-Arch":oz(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":L$,"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":L$,"X-Stainless-OS":tz(globalThis.process.platform??"unknown"),"X-Stainless-Arch":oz(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let Z=VT();if(Z)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":L$,"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":L$,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},oz=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},tz=($)=>{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"},ez,ZJ=()=>{return ez??(ez=qT())};var a3=()=>{};function XJ(){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 o3(...$){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 F6($){let Z=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return o3({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 T4($){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 zJ($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let Z=$.getReader(),X=Z.cancel();Z.releaseLock(),await X}var JJ=({headers:$,body:Z})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(Z)}};function QJ($){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 b(`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 YJ=y(()=>{O0()});function GJ($){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 D4($){let Z;return(UJ??(Z=new globalThis.TextEncoder,UJ=Z.encode.bind(Z)))($)}function t3($){let Z;return(WJ??(Z=new globalThis.TextDecoder,WJ=Z.decode.bind(Z)))($)}var UJ,WJ;class M${constructor(){F0.set(this,void 0),_0.set(this,void 0),C(this,F0,new Uint8Array,"f"),C(this,_0,null,"f")}decode($){if($==null)return[];let Z=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?D4($):$;C(this,F0,GJ([M(this,F0,"f"),Z]),"f");let X=[],z;while((z=BT(M(this,F0,"f"),M(this,_0,"f")))!=null){if(z.carriage&&M(this,_0,"f")==null){C(this,_0,z.index,"f");continue}if(M(this,_0,"f")!=null&&(z.index!==M(this,_0,"f")+1||z.carriage)){X.push(t3(M(this,F0,"f").subarray(0,M(this,_0,"f")-1))),C(this,F0,M(this,F0,"f").subarray(M(this,_0,"f")),"f"),C(this,_0,null,"f");continue}let J=M(this,_0,"f")!==null?z.preceding-1:z.preceding,Q=t3(M(this,F0,"f").subarray(0,J));X.push(Q),C(this,F0,M(this,F0,"f").subarray(z.index),"f"),C(this,_0,null,"f")}return X}flush(){if(!M(this,F0,"f").length)return[];return this.decode(`
166
- `)}}function BT($,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 qJ($){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 F0,_0;var e3=y(()=>{o0();F0=new WeakMap,_0=new WeakMap;M$.NEWLINE_CHARS=new Set([`
167
- `,"\r"]);M$.NEWLINE_REGEXP=/\r\n|[\n\r]/g});function I4(){}function _6($,Z,X){if(!Z||P6[$]>P6[X])return I4;else return Z[$].bind(Z)}function K0($){let Z=$.logger,X=$.logLevel??"off";if(!Z)return LT;let z=VJ.get(Z);if(z&&z[0]===X)return z[1];let J={error:_6("error",Z,X),warn:_6("warn",Z,X),info:_6("info",Z,X),debug:_6("debug",Z,X)};return VJ.set(Z,[X,J]),J}var P6,$Z=($,Z,X)=>{if(!$)return;if(rz(P6,$))return $;K0(X).warn(`${Z} was set to ${JSON.stringify($)}, expected one of ${JSON.stringify(Object.keys(P6))}`);return},LT,VJ,e0=($)=>{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 C6=y(()=>{k$();P6={off:0,error:200,warn:300,info:400,debug:500};LT={error:I4,warn:I4,info:I4,debug:I4},VJ=new WeakMap});async function*MT($,Z){if(!$.body){if(Z.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new b("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 b("Attempted to iterate over a response with no body")}let X=new KJ,z=new M$,J=T4($.body);for await(let Q of NT(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*NT($){let Z=new Uint8Array;for await(let X of $){if(X==null)continue;let z=X instanceof ArrayBuffer?new Uint8Array(X):typeof X==="string"?D4(X):X,J=new Uint8Array(Z.length+z.length);J.set(Z),J.set(z,Z.length),Z=J;let Q;while((Q=qJ(Z))!==-1)yield Z.slice(0,Q),Z=Z.slice(Q)}if(Z.length>0)yield Z}class KJ{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]=OT($,":");if(z.startsWith(" "))z=z.substring(1);if(Z==="event")this.event=z;else if(Z==="data")this.data.push(z);return null}}function OT($,Z){let X=$.indexOf(Z);if(X!==-1)return[$.substring(0,X),Z,$.substring(X+Z.length)];return[$,"",""]}var A4,P0;var ZZ=y(()=>{o0();O0();e3();k$();C6();O0();P0=class P0{constructor($,Z,X){this.iterator=$,A4.set(this,void 0),this.controller=Z,C(this,A4,X,"f")}static fromSSEResponse($,Z,X){let z=!1,J=X?K0(X):console;async function*Q(){if(z)throw new b("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");z=!0;let Y=!1;try{for await(let U of MT($,Z)){if(U.event==="completion")try{yield JSON.parse(U.data)}catch(W){throw J.error("Could not parse message into JSON:",U.data),J.error("From chunk:",U.raw),W}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(W){throw J.error("Could not parse message into JSON:",U.data),J.error("From chunk:",U.raw),W}if(U.event==="ping")continue;if(U.event==="error"){let W=R6(U.data)??U.data,G=W?.error?.type;throw new J0(void 0,W,void 0,$.headers,G)}}Y=!0}catch(U){if(t0(U))return;throw U}finally{if(!Y)Z.abort()}}return new P0(Q,Z,X)}static fromReadableStream($,Z,X){let z=!1;async function*J(){let Y=new M$,U=T4($);for await(let W of U)for(let G of Y.decode(W))yield G;for(let W of Y.flush())yield W}async function*Q(){if(z)throw new b("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(t0(U))return;throw U}finally{if(!Y)Z.abort()}}return new P0(Q,Z,X)}[(A4=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 P0(()=>z($),this.controller,M(this,A4,"f")),new P0(()=>z(Z),this.controller,M(this,A4,"f"))]}toReadableStream(){let $=this,Z;return o3({async start(){Z=$[Symbol.asyncIterator]()},async pull(X){try{let{value:z,done:J}=await Z.next();if(J)return X.close();let Q=D4(JSON.stringify(z)+`
169
- `);X.enqueue(Q)}catch(z){X.error(z)}},async cancel(){await Z.return?.()}})}}});async function w6($,Z){let{response:X,requestLogID:z,retryOfRequestLogID:J,startTime:Q}=Z,Y=await(async()=>{if(Z.options.stream){if(K0($).debug("response",X.status,X.url,X.headers,X.body),Z.options.__streamClass)return Z.options.__streamClass.fromSSEResponse(X,Z.controller);return P0.fromSSEResponse(X,Z.controller)}if(X.status===204)return null;if(Z.options.__binaryResponse)return X;let W=X.headers.get("content-type")?.split(";")[0]?.trim();if(W?.includes("application/json")||W?.endsWith("+json")){if(X.headers.get("content-length")==="0")return;let K=await X.json();return XZ(K,X)}return await X.text()})();return K0($).debug(`[${z}] response parsed`,e0({retryOfRequestLogID:J,url:X.url,status:X.status,body:Y,durationMs:Date.now()-Q})),Y}function XZ($,Z){if(!$||typeof $!=="object"||Array.isArray($))return $;return Object.defineProperty($,"_request_id",{value:Z.headers.get("request-id"),enumerable:!1})}var zZ=y(()=>{ZZ();C6()});var R4,N$;var E6=y(()=>{o0();zZ();N$=class N$ extends Promise{constructor($,Z,X=w6){super((z)=>{z(null)});this.responsePromise=Z,this.parseResponse=X,R4.set(this,void 0),C(this,R4,$,"f")}_thenUnwrap($){return new N$(M(this,R4,"f"),this.responsePromise,async(Z,X)=>XZ($(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(M(this,R4,"f"),$));return this.parsedPromise}then($,Z){return this.parse().then($,Z)}catch($){return this.parse().catch($)}finally($){return this.parse().finally($)}};R4=new WeakMap});var j6,JZ,F4,g0,i;var e=y(()=>{o0();O0();zZ();E6();k$();JZ=class JZ{constructor($,Z,X,z){j6.set(this,void 0),C(this,j6,$,"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 b("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await M(this,j6,"f").requestAPIList(this.constructor,$)}async*iterPages(){let $=this;yield $;while($.hasNextPage())$=await $.getNextPage(),yield $}async*[(j6=new WeakMap,Symbol.asyncIterator)](){for await(let $ of this.iterPages())for(let Z of $.getPaginatedItems())yield Z}};F4=class F4 extends N${constructor($,Z,X){super($,Z,async(z,J)=>new X(z,J.response,await w6(z,J),J.options))}async*[Symbol.asyncIterator](){let $=await this;for await(let Z of $)yield Z}};g0=class g0 extends JZ{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:{...A6(this.options.query),before_id:Z}}}let $=this.last_id;if(!$)return null;return{...this.options,query:{...A6(this.options.query),after_id:$}}}};i=class i extends JZ{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:{...A6(this.options.query),page:$}}}}});function y$($,Z,X){return YZ(),new File($,Z??"unknown_file",X)}function _4($,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 DT($){let Z=typeof $==="function"?$:$.fetch,X=HJ.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 HJ.set(Z,z),z}var YZ=()=>{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`.":""))}},UZ=($)=>$!=null&&typeof $==="object"&&typeof $[Symbol.asyncIterator]==="function",A1=async($,Z,X=!0)=>{return{...$,body:await IT($.body,Z,X)}},HJ,IT=async($,Z,X=!0)=>{if(!await DT(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])=>QZ(z,J,Q,X))),z},AT=($)=>$ instanceof Blob&&("name"in $),QZ=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,y$([await X.blob()],_4(X,z),J))}else if(UZ(X))$.append(Z,y$([await new Response(F6(X)).blob()],_4(X,z)));else if(AT(X))$.append(Z,y$([X],_4(X,z),{type:X.type}));else if(Array.isArray(X))await Promise.all(X.map((J)=>QZ($,Z+"[]",J,z)));else if(typeof X==="object")await Promise.all(Object.entries(X).map(([J,Q])=>QZ($,`${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 R1=y(()=>{HJ=new WeakMap});async function P4($,Z,X){if(YZ(),$=await $,Z||(Z=_4($,!0)),RT($)){if($ instanceof File&&Z==null&&X==null)return $;return y$([await $.arrayBuffer()],Z??$.name,{type:$.type,lastModified:$.lastModified,...X})}if(FT($)){let J=await $.blob();return Z||(Z=new URL($.url).pathname.split(/[\\/]/).pop()),y$(await WZ(J),Z,X)}let z=await WZ($);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 y$(z,Z,X)}async function WZ($){let Z=[];if(typeof $==="string"||ArrayBuffer.isView($)||$ instanceof ArrayBuffer)Z.push($);else if(BJ($))Z.push($ instanceof Blob?$:await $.arrayBuffer());else if(UZ($))for await(let X of $)Z.push(...await WZ(X));else{let X=$?.constructor?.name;throw Error(`Unexpected data type: ${typeof $}${X?`; constructor: ${X}`:""}${_T($)}`)}return Z}function _T($){if(typeof $!=="object"||$===null)return"";return`; props: [${Object.getOwnPropertyNames($).map((X)=>`"${X}"`).join(", ")}]`}var BJ=($)=>$!=null&&typeof $==="object"&&typeof $.size==="number"&&typeof $.type==="string"&&typeof $.text==="function"&&typeof $.slice==="function"&&typeof $.arrayBuffer==="function",RT=($)=>$!=null&&typeof $==="object"&&typeof $.name==="string"&&typeof $.lastModified==="number"&&BJ($),FT=($)=>$!=null&&typeof $==="object"&&typeof $.url==="string"&&typeof $.blob==="function";var LJ=y(()=>{R1();R1()});var GZ=y(()=>{LJ()});var MJ=()=>{};class v{constructor($){this._client=$}}function*CT($){if(!$)return;if(NJ 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(r3($))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=r3(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 NJ,O=($)=>{let Z=new Headers,X=new Set;for(let z of $){let J=new Set;for(let[Q,Y]of CT(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{[NJ]:!0,values:Z,nulls:X}};var r=y(()=>{k$();NJ=Symbol.for("brand.privateNullableHeaders")});function TJ($){return $.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var OJ,wT=($=TJ)=>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??OJ)??OJ)?.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],W=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,G;while((G=W.exec(U))!==null)Q.push({start:G.index,length:G[0].length,error:`Value "${G[0]}" can't be safely passed as a path parameter`});if(Q.sort((q,V)=>q.start-V.start),Q.length>0){let q=0,V=Q.reduce((K,H)=>{let T=" ".repeat(H.start-q),B="^".repeat(H.length);return q=H.start+H.length,K+T+B},"");throw new b(`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=o2($),X=$1(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=o2($),X=$1(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()}}}UB.Parser=k9});var h9=_((MB)=>{var y9=Y8(),GB=z4(),G4=J4(),qB=M6(),VB=l(),KB=M8(),f9=N8();function g9($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new KB.LineCounter||null,prettyErrors:Z}}function HB($,Z={}){let{lineCounter:X,prettyErrors:z}=g9(Z),J=new f9.Parser(X?.addNewLine),Q=new y9.Composer(Z),Y=Array.from(Q.compose(J.parse($)));if(z&&X)for(let U of Y)U.errors.forEach(G4.prettifyError($,X)),U.warnings.forEach(G4.prettifyError($,X));if(Y.length>0)return Y;return Object.assign([],{empty:!0},Q.streamInfo())}function v9($,Z={}){let{lineCounter:X,prettyErrors:z}=g9(Z),J=new f9.Parser(X?.addNewLine),Q=new y9.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 G4.YAMLParseError(U.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&X)Y.errors.forEach(G4.prettifyError($,X)),Y.warnings.forEach(G4.prettifyError($,X));return Y}function BB($,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=v9($,X);if(!J)return null;if(J.warnings.forEach((Q)=>qB.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 LB($,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(VB.isDocument($)&&!z)return $.toString(X);return new GB.Document($,z,X).toString(X)}MB.parse=BB;MB.parseAllDocuments=HB;MB.parseDocument=v9;MB.stringify=LB});var i9={};BZ(i9,{orange:()=>V0,italic:()=>UL,fafCyanDeep:()=>e2,fafCyan:()=>D,dim:()=>L,bold:()=>R,FAF_HEX:()=>q4});var I8=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,R,L,UL,q4,D=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,e2=($)=>`\x1B[38;2;14;140;140m${$}\x1B[0m`,V0=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var p=f(()=>{R=I8("1"),L=I8("2"),UL=I8("3"),q4={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"}});var l8=_((QC,jO)=>{jO.exports={name:"faf-cli",version:"7.1.4",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","agents-md","context-engineering","codex","windsurf"],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","@types/bun":"^1.3.14","@types/node":"^22.15.0","@typescript-eslint/eslint-plugin":"^8.41.0","@typescript-eslint/parser":"^8.41.0",ajv:"^8.17.1",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 P($,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 M($,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 t0=()=>{};var r8=function(){let{crypto:$}=globalThis;if($?.randomUUID)return r8=$.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 e0($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var D4=($)=>{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,Q0,B0,M$,L1,M1,N1,O1,T1,D1,I1,A1,R1;var O0=f(()=>{S=class S extends Error{};Q0=class Q0 extends S{constructor($,Z,X,z,J){super(`${Q0.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 M$({message:X,cause:D4(Z)});let J=Z,Q=J?.error?.type;if($===400)return new M1($,J,X,z,Q);if($===401)return new N1($,J,X,z,Q);if($===403)return new O1($,J,X,z,Q);if($===404)return new T1($,J,X,z,Q);if($===409)return new D1($,J,X,z,Q);if($===422)return new I1($,J,X,z,Q);if($===429)return new A1($,J,X,z,Q);if($>=500)return new R1($,J,X,z,Q);return new Q0($,J,X,z,Q)}};B0=class B0 extends Q0{constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}};M$=class M$ extends Q0{constructor({message:$,cause:Z}){super(void 0,void 0,$||"Connection error.",void 0);if(Z)this.cause=Z}};L1=class L1 extends M${constructor({message:$}={}){super({message:$??"Request timed out."})}};M1=class M1 extends Q0{};N1=class N1 extends Q0{};O1=class O1 extends Q0{};T1=class T1 extends Q0{};D1=class D1 extends Q0{};I1=class I1 extends Q0{};A1=class A1 extends Q0{};R1=class R1 extends Q0{}});function F3($){if(typeof $!=="object")return{};return $??{}}function o8($){if(!$)return!0;for(let Z in $)return!1;return!0}function sz($,Z){return Object.prototype.hasOwnProperty.call($,Z)}var GT,rz=($)=>{return GT.test($)},s8=($)=>(s8=Array.isArray,s8($)),a8,az=($,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},_3=($)=>{try{return JSON.parse($)}catch(Z){return}};var f$=f(()=>{O0();GT=/^[a-z][a-z0-9+.-]*:/i,a8=s8});var oz=($)=>new Promise((Z)=>setTimeout(Z,$));var N$="0.91.1";function qT(){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 KT(){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 ZJ=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"},VT=()=>{let $=qT();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":N$,"X-Stainless-OS":ez(Deno.build.os),"X-Stainless-Arch":tz(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":N$,"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":N$,"X-Stainless-OS":ez(globalThis.process.platform??"unknown"),"X-Stainless-Arch":tz(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let Z=KT();if(Z)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":N$,"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":N$,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},tz=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},ez=($)=>{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"},$J,XJ=()=>{return $J??($J=VT())};var t8=()=>{};function zJ(){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 e8(...$){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 P3($){let Z=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return e8({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 I4($){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 JJ($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let Z=$.getReader(),X=Z.cancel();Z.releaseLock(),await X}var QJ=({headers:$,body:Z})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(Z)}};function YJ($){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 UJ=f(()=>{O0()});function qJ($){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 A4($){let Z;return(WJ??(Z=new globalThis.TextEncoder,WJ=Z.encode.bind(Z)))($)}function $5($){let Z;return(GJ??(Z=new globalThis.TextDecoder,GJ=Z.decode.bind(Z)))($)}var WJ,GJ;class O${constructor(){_0.set(this,void 0),P0.set(this,void 0),P(this,_0,new Uint8Array,"f"),P(this,P0,null,"f")}decode($){if($==null)return[];let Z=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?A4($):$;P(this,_0,qJ([M(this,_0,"f"),Z]),"f");let X=[],z;while((z=LT(M(this,_0,"f"),M(this,P0,"f")))!=null){if(z.carriage&&M(this,P0,"f")==null){P(this,P0,z.index,"f");continue}if(M(this,P0,"f")!=null&&(z.index!==M(this,P0,"f")+1||z.carriage)){X.push($5(M(this,_0,"f").subarray(0,M(this,P0,"f")-1))),P(this,_0,M(this,_0,"f").subarray(M(this,P0,"f")),"f"),P(this,P0,null,"f");continue}let J=M(this,P0,"f")!==null?z.preceding-1:z.preceding,Q=$5(M(this,_0,"f").subarray(0,J));X.push(Q),P(this,_0,M(this,_0,"f").subarray(z.index),"f"),P(this,P0,null,"f")}return X}flush(){if(!M(this,_0,"f").length)return[];return this.decode(`
166
+ `)}}function LT($,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 VJ($){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 _0,P0;var Z5=f(()=>{t0();_0=new WeakMap,P0=new WeakMap;O$.NEWLINE_CHARS=new Set([`
167
+ `,"\r"]);O$.NEWLINE_REGEXP=/\r\n|[\n\r]/g});function R4(){}function C3($,Z,X){if(!Z||w3[$]>w3[X])return R4;else return Z[$].bind(Z)}function H0($){let Z=$.logger,X=$.logLevel??"off";if(!Z)return MT;let z=KJ.get(Z);if(z&&z[0]===X)return z[1];let J={error:C3("error",Z,X),warn:C3("warn",Z,X),info:C3("info",Z,X),debug:C3("debug",Z,X)};return KJ.set(Z,[X,J]),J}var w3,X5=($,Z,X)=>{if(!$)return;if(sz(w3,$))return $;H0(X).warn(`${Z} was set to ${JSON.stringify($)}, expected one of ${JSON.stringify(Object.keys(w3))}`);return},MT,KJ,$$=($)=>{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 E3=f(()=>{f$();w3={off:0,error:200,warn:300,info:400,debug:500};MT={error:R4,warn:R4,info:R4,debug:R4},KJ=new WeakMap});async function*NT($,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 HJ,z=new O$,J=I4($.body);for await(let Q of OT(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*OT($){let Z=new Uint8Array;for await(let X of $){if(X==null)continue;let z=X instanceof ArrayBuffer?new Uint8Array(X):typeof X==="string"?A4(X):X,J=new Uint8Array(Z.length+z.length);J.set(Z),J.set(z,Z.length),Z=J;let Q;while((Q=VJ(Z))!==-1)yield Z.slice(0,Q),Z=Z.slice(Q)}if(Z.length>0)yield Z}class HJ{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]=TT($,":");if(z.startsWith(" "))z=z.substring(1);if(Z==="event")this.event=z;else if(Z==="data")this.data.push(z);return null}}function TT($,Z){let X=$.indexOf(Z);if(X!==-1)return[$.substring(0,X),Z,$.substring(X+Z.length)];return[$,"",""]}var F4,C0;var z5=f(()=>{t0();O0();Z5();f$();E3();O0();C0=class C0{constructor($,Z,X){this.iterator=$,F4.set(this,void 0),this.controller=Z,P(this,F4,X,"f")}static fromSSEResponse($,Z,X){let z=!1,J=X?H0(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 NT($,Z)){if(U.event==="completion")try{yield JSON.parse(U.data)}catch(W){throw J.error("Could not parse message into JSON:",U.data),J.error("From chunk:",U.raw),W}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(W){throw J.error("Could not parse message into JSON:",U.data),J.error("From chunk:",U.raw),W}if(U.event==="ping")continue;if(U.event==="error"){let W=_3(U.data)??U.data,G=W?.error?.type;throw new Q0(void 0,W,void 0,$.headers,G)}}Y=!0}catch(U){if(e0(U))return;throw U}finally{if(!Y)Z.abort()}}return new C0(Q,Z,X)}static fromReadableStream($,Z,X){let z=!1;async function*J(){let Y=new O$,U=I4($);for await(let W of U)for(let G of Y.decode(W))yield G;for(let W of Y.flush())yield W}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(e0(U))return;throw U}finally{if(!Y)Z.abort()}}return new C0(Q,Z,X)}[(F4=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 C0(()=>z($),this.controller,M(this,F4,"f")),new C0(()=>z(Z),this.controller,M(this,F4,"f"))]}toReadableStream(){let $=this,Z;return e8({async start(){Z=$[Symbol.asyncIterator]()},async pull(X){try{let{value:z,done:J}=await Z.next();if(J)return X.close();let Q=A4(JSON.stringify(z)+`
169
+ `);X.enqueue(Q)}catch(z){X.error(z)}},async cancel(){await Z.return?.()}})}}});async function j3($,Z){let{response:X,requestLogID:z,retryOfRequestLogID:J,startTime:Q}=Z,Y=await(async()=>{if(Z.options.stream){if(H0($).debug("response",X.status,X.url,X.headers,X.body),Z.options.__streamClass)return Z.options.__streamClass.fromSSEResponse(X,Z.controller);return C0.fromSSEResponse(X,Z.controller)}if(X.status===204)return null;if(Z.options.__binaryResponse)return X;let W=X.headers.get("content-type")?.split(";")[0]?.trim();if(W?.includes("application/json")||W?.endsWith("+json")){if(X.headers.get("content-length")==="0")return;let K=await X.json();return J5(K,X)}return await X.text()})();return H0($).debug(`[${z}] response parsed`,$$({retryOfRequestLogID:J,url:X.url,status:X.status,body:Y,durationMs:Date.now()-Q})),Y}function J5($,Z){if(!$||typeof $!=="object"||Array.isArray($))return $;return Object.defineProperty($,"_request_id",{value:Z.headers.get("request-id"),enumerable:!1})}var Q5=f(()=>{z5();E3()});var _4,T$;var S3=f(()=>{t0();Q5();T$=class T$ extends Promise{constructor($,Z,X=j3){super((z)=>{z(null)});this.responsePromise=Z,this.parseResponse=X,_4.set(this,void 0),P(this,_4,$,"f")}_thenUnwrap($){return new T$(M(this,_4,"f"),this.responsePromise,async(Z,X)=>J5($(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(M(this,_4,"f"),$));return this.parsedPromise}then($,Z){return this.parse().then($,Z)}catch($){return this.parse().catch($)}finally($){return this.parse().finally($)}};_4=new WeakMap});var x3,Y5,P4,u0,r;var Z0=f(()=>{t0();O0();Q5();S3();f$();Y5=class Y5{constructor($,Z,X,z){x3.set(this,void 0),P(this,x3,$,"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 M(this,x3,"f").requestAPIList(this.constructor,$)}async*iterPages(){let $=this;yield $;while($.hasNextPage())$=await $.getNextPage(),yield $}async*[(x3=new WeakMap,Symbol.asyncIterator)](){for await(let $ of this.iterPages())for(let Z of $.getPaginatedItems())yield Z}};P4=class P4 extends T${constructor($,Z,X){super($,Z,async(z,J)=>new X(z,J.response,await j3(z,J),J.options))}async*[Symbol.asyncIterator](){let $=await this;for await(let Z of $)yield Z}};u0=class u0 extends Y5{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:{...F3(this.options.query),before_id:Z}}}let $=this.last_id;if(!$)return null;return{...this.options,query:{...F3(this.options.query),after_id:$}}}};r=class r extends Y5{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:{...F3(this.options.query),page:$}}}}});function g$($,Z,X){return W5(),new File($,Z??"unknown_file",X)}function C4($,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 IT($){let Z=typeof $==="function"?$:$.fetch,X=BJ.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 BJ.set(Z,z),z}var W5=()=>{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`.":""))}},G5=($)=>$!=null&&typeof $==="object"&&typeof $[Symbol.asyncIterator]==="function",F1=async($,Z,X=!0)=>{return{...$,body:await AT($.body,Z,X)}},BJ,AT=async($,Z,X=!0)=>{if(!await IT(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])=>U5(z,J,Q,X))),z},RT=($)=>$ instanceof Blob&&("name"in $),U5=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,g$([await X.blob()],C4(X,z),J))}else if(G5(X))$.append(Z,g$([await new Response(P3(X)).blob()],C4(X,z)));else if(RT(X))$.append(Z,g$([X],C4(X,z),{type:X.type}));else if(Array.isArray(X))await Promise.all(X.map((J)=>U5($,Z+"[]",J,z)));else if(typeof X==="object")await Promise.all(Object.entries(X).map(([J,Q])=>U5($,`${Z}[${J}]`,Q,z)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${X} instead`)};var _1=f(()=>{BJ=new WeakMap});async function w4($,Z,X){if(W5(),$=await $,Z||(Z=C4($,!0)),FT($)){if($ instanceof File&&Z==null&&X==null)return $;return g$([await $.arrayBuffer()],Z??$.name,{type:$.type,lastModified:$.lastModified,...X})}if(_T($)){let J=await $.blob();return Z||(Z=new URL($.url).pathname.split(/[\\/]/).pop()),g$(await q5(J),Z,X)}let z=await q5($);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 g$(z,Z,X)}async function q5($){let Z=[];if(typeof $==="string"||ArrayBuffer.isView($)||$ instanceof ArrayBuffer)Z.push($);else if(LJ($))Z.push($ instanceof Blob?$:await $.arrayBuffer());else if(G5($))for await(let X of $)Z.push(...await q5(X));else{let X=$?.constructor?.name;throw Error(`Unexpected data type: ${typeof $}${X?`; constructor: ${X}`:""}${PT($)}`)}return Z}function PT($){if(typeof $!=="object"||$===null)return"";return`; props: [${Object.getOwnPropertyNames($).map((X)=>`"${X}"`).join(", ")}]`}var LJ=($)=>$!=null&&typeof $==="object"&&typeof $.size==="number"&&typeof $.type==="string"&&typeof $.text==="function"&&typeof $.slice==="function"&&typeof $.arrayBuffer==="function",FT=($)=>$!=null&&typeof $==="object"&&typeof $.name==="string"&&typeof $.lastModified==="number"&&LJ($),_T=($)=>$!=null&&typeof $==="object"&&typeof $.url==="string"&&typeof $.blob==="function";var MJ=f(()=>{_1();_1()});var V5=f(()=>{MJ()});var NJ=()=>{};class h{constructor($){this._client=$}}function*wT($){if(!$)return;if(OJ 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(a8($))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=a8(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 OJ,O=($)=>{let Z=new Headers,X=new Set;for(let z of $){let J=new Set;for(let[Q,Y]of wT(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{[OJ]:!0,values:Z,nulls:X}};var a=f(()=>{f$();OJ=Symbol.for("brand.privateNullableHeaders")});function DJ($){return $.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var TJ,ET=($=DJ)=>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??TJ)??TJ)?.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],W=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,G;while((G=W.exec(U))!==null)Q.push({start:G.index,length:G[0].length,error:`Value "${G[0]}" can't be safely passed as a path parameter`});if(Q.sort((q,V)=>q.start-V.start),Q.length>0){let q=0,V=Q.reduce((K,H)=>{let T=" ".repeat(H.start-q),B="^".repeat(H.length);return q=H.start+H.length,K+T+B},"");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},F;var Q0=y(()=>{O0();OJ=Object.freeze(Object.create(null)),F=wT(TJ)});var C4;var qZ=y(()=>{e();r();Q0();C4=class C4 extends v{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(F`/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(F`/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(F`/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(F`/v1/environments/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});function S6($){return typeof $==="object"&&$!==null&&w4 in $}function VZ($,Z){let X=new Set;if($){for(let z of $)if(S6(z))X.add(z[w4])}if(Z)for(let z of Z){if(S6(z))X.add(z[w4]);if(Array.isArray(z.content)){for(let J of z.content)if(S6(J))X.add(J[w4])}}return Array.from(X)}function x6($,Z){let X=VZ($,Z);if(X.length===0)return{};return{"x-stainless-helper":X.join(", ")}}function DJ($){if(S6($))return{"x-stainless-helper":$[w4]};return{}}var w4;var E4=y(()=>{w4=Symbol("anthropic.sdk.stainlessHelper")});var j4;var KZ=y(()=>{e();r();E4();R1();Q0();j4=class j4 extends v{list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/files?beta=true",g0,{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(F`/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(F`/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(F`/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",A1({body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"files-api-2025-04-14"].toString()},DJ(z.file),Z?.headers])},this._client))}}});var S4;var HZ=y(()=>{e();r();Q0();S4=class S4 extends v{retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(F`/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",g0,{query:z,...Z,headers:O([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers])})}}});var x4;var BZ=y(()=>{e();r();Q0();x4=class x4 extends v{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(F`/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(F`/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(F`/v1/user_profiles/${$}/enrollment_url?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"user-profiles-2026-03-24"].toString()},X?.headers])})}}});var b4;var LZ=y(()=>{e();r();Q0();b4=class b4 extends v{list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(F`/v1/agents/${$}/versions?beta=true`,i,{query:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var F1;var MZ=y(()=>{LZ();LZ();e();r();Q0();F1=class F1 extends v{constructor(){super(...arguments);this.versions=new b4(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(F`/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(F`/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(F`/v1/agents/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};F1.Versions=b4});var k4;var NZ=y(()=>{e();r();Q0();k4=class k4 extends v{create($,Z,X){let{view:z,betas:J,...Q}=Z;return this._client.post(F`/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(F`/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(F`/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(F`/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(F`/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 y4;var OZ=y(()=>{e();r();Q0();y4=class y4 extends v{retrieve($,Z,X){let{memory_store_id:z,betas:J,...Q}=Z;return this._client.get(F`/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(F`/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(F`/v1/memory_stores/${z}/memory_versions/${$}/redact?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var f$;var TZ=y(()=>{NZ();NZ();OZ();OZ();e();r();Q0();f$=class f$ extends v{constructor(){super(...arguments);this.memories=new k4(this._client),this.memoryVersions=new y4(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(F`/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(F`/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(F`/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(F`/v1/memory_stores/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};f$.Memories=k4;f$.MemoryVersions=y4});var _1=y(()=>{O0()});var b6;var DZ=y(()=>{b6={"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 IJ($){return $?.output_format??$?.output_config?.format}function IZ($,Z,X){let z=IJ(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 AZ($,Z,X)}function AZ($,Z,X){let z=null,J=$.content.map((Q)=>{if(Q.type==="text"){let Y=vT(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 vT($,Z){let X=IJ($);if(X?.type!=="json_schema")return null;try{if("parse"in X)return X.parse(Z);return JSON.parse(Z)}catch(z){throw new b(`Failed to parse structured output: ${z}`)}}var RZ=y(()=>{O0()});var hT=($)=>{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="",W=!1;z=$[++Z];while(z!=='"'){if(Z===$.length){W=!0;break}if(z==="\\"){if(Z++,Z===$.length){W=!0;break}U+=z+$[Z],z=$[++Z]}else U+=z,z=$[++Z]}if(z=$[++Z],!W)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},P1=($)=>{if($.length===0)return $;let Z=$[$.length-1];switch(Z.type){case"separator":return $=$.slice(0,$.length-1),P1($);break;case"number":let X=Z.value[Z.value.length-1];if(X==="."||X==="-")return $=$.slice(0,$.length-1),P1($);case"string":let z=$[$.length-2];if(z?.type==="delimiter")return $=$.slice(0,$.length-1),P1($);else if(z?.type==="brace"&&z.value==="{")return $=$.slice(0,$.length-1),P1($);break;case"delimiter":return $=$.slice(0,$.length-1),P1($);break}return $},uT=($)=>{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 $},mT=($)=>{let Z="";return $.map((X)=>{switch(X.type){case"string":Z+='"'+X.value+'"';break;default:Z+=X.value;break}}),Z},k6=($)=>JSON.parse(mT(uT(P1(hT($)))));var FZ=()=>{};var _Z=y(()=>{ZZ()});function _J($){return $.type==="tool_use"||$.type==="server_tool_use"||$.type==="mcp_tool_use"}function PJ($){}var S0,O$,C1,f4,y6,g4,v4,f6,h4,$$,u4,g6,v6,g$,h6,u6,m4,PZ,AJ,m6,CZ,wZ,EZ,RJ,FJ="__json_buf",c4;var CJ=y(()=>{o0();FZ();_1();_Z();RZ();c4=class c4{constructor($,Z){S0.add(this),this.messages=[],this.receivedMessages=[],O$.set(this,void 0),C1.set(this,null),this.controller=new AbortController,f4.set(this,void 0),y6.set(this,()=>{}),g4.set(this,()=>{}),v4.set(this,void 0),f6.set(this,()=>{}),h4.set(this,()=>{}),$$.set(this,{}),u4.set(this,!1),g6.set(this,!1),v6.set(this,!1),g$.set(this,!1),h6.set(this,void 0),u6.set(this,void 0),m4.set(this,void 0),m6.set(this,(X)=>{if(C(this,g6,!0,"f"),t0(X))X=new H0;if(X instanceof H0)return C(this,v6,!0,"f"),this._emit("abort",X);if(X instanceof b)return this._emit("error",X);if(X instanceof Error){let z=new b(X.message);return z.cause=X,this._emit("error",z)}return this._emit("error",new b(String(X)))}),C(this,f4,new Promise((X,z)=>{C(this,y6,X,"f"),C(this,g4,z,"f")}),"f"),C(this,v4,new Promise((X,z)=>{C(this,f6,X,"f"),C(this,h4,z,"f")}),"f"),M(this,f4,"f").catch(()=>{}),M(this,v4,"f").catch(()=>{}),C(this,C1,$,"f"),C(this,m4,Z?.logger??console,"f")}get response(){return M(this,h6,"f")}get request_id(){return M(this,u6,"f")}async withResponse(){C(this,g$,!0,"f");let $=await M(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 C(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")},M(this,m6,"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{M(this,S0,"m",CZ).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)M(this,S0,"m",wZ).call(this,U);if(Y.controller.signal?.aborted)throw new H0;M(this,S0,"m",EZ).call(this)}finally{if(z&&J)z.removeEventListener("abort",J)}}_connected($){if(this.ended)return;C(this,h6,$,"f"),C(this,u6,$?.headers.get("request-id"),"f"),M(this,y6,"f").call(this,$),this._emit("connect")}get ended(){return M(this,u4,"f")}get errored(){return M(this,g6,"f")}get aborted(){return M(this,v6,"f")}abort(){this.controller.abort()}on($,Z){return(M(this,$$,"f")[$]||(M(this,$$,"f")[$]=[])).push({listener:Z}),this}off($,Z){let X=M(this,$$,"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(M(this,$$,"f")[$]||(M(this,$$,"f")[$]=[])).push({listener:Z,once:!0}),this}emitted($){return new Promise((Z,X)=>{if(C(this,g$,!0,"f"),$!=="error")this.once("error",X);this.once($,Z)})}async done(){C(this,g$,!0,"f"),await M(this,v4,"f")}get currentMessage(){return M(this,O$,"f")}async finalMessage(){return await this.done(),M(this,S0,"m",PZ).call(this)}async finalText(){return await this.done(),M(this,S0,"m",AJ).call(this)}_emit($,...Z){if(M(this,u4,"f"))return;if($==="end")C(this,u4,!0,"f"),M(this,f6,"f").call(this);let X=M(this,$$,"f")[$];if(X)M(this,$$,"f")[$]=X.filter((z)=>!z.once),X.forEach(({listener:z})=>z(...Z));if($==="abort"){let z=Z[0];if(!M(this,g$,"f")&&!X?.length)Promise.reject(z);M(this,g4,"f").call(this,z),M(this,h4,"f").call(this,z),this._emit("end");return}if($==="error"){let z=Z[0];if(!M(this,g$,"f")&&!X?.length)Promise.reject(z);M(this,g4,"f").call(this,z),M(this,h4,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",M(this,S0,"m",PZ).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{M(this,S0,"m",CZ).call(this),this._connected(null);let J=P0.fromReadableStream($,this.controller);for await(let Q of J)M(this,S0,"m",wZ).call(this,Q);if(J.controller.signal?.aborted)throw new H0;M(this,S0,"m",EZ).call(this)}finally{if(X&&z)X.removeEventListener("abort",z)}}[(O$=new WeakMap,C1=new WeakMap,f4=new WeakMap,y6=new WeakMap,g4=new WeakMap,v4=new WeakMap,f6=new WeakMap,h4=new WeakMap,$$=new WeakMap,u4=new WeakMap,g6=new WeakMap,v6=new WeakMap,g$=new WeakMap,h6=new WeakMap,u6=new WeakMap,m4=new WeakMap,m6=new WeakMap,S0=new WeakSet,PZ=function(){if(this.receivedMessages.length===0)throw new b("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},AJ=function(){if(this.receivedMessages.length===0)throw new b("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 b("stream ended without producing a content block with type=text");return Z.join(" ")},CZ=function(){if(this.ended)return;C(this,O$,void 0,"f")},wZ=function(Z){if(this.ended)return;let X=M(this,S0,"m",RJ).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(_J(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:PJ(Z.delta)}break}case"message_stop":{this._addMessageParam(X),this._addMessage(IZ(X,M(this,C1,"f"),{logger:M(this,m4,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",X.content.at(-1));break}case"message_start":{C(this,O$,X,"f");break}case"content_block_start":case"message_delta":break}},EZ=function(){if(this.ended)throw new b("stream has ended, this shouldn't happen");let Z=M(this,O$,"f");if(!Z)throw new b("request ended without sending any chunks");return C(this,O$,void 0,"f"),IZ(Z,M(this,C1,"f"),{logger:M(this,m4,"f")})},RJ=function(Z){let X=M(this,O$,"f");if(Z.type==="message_start"){if(X)throw new b(`Unexpected event order, got ${Z.type} before receiving "message_stop"`);return Z.message}if(!X)throw new b(`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&&_J(z)){let J=z[FJ]||"";J+=Z.delta.partial_json;let Q={...z};if(Object.defineProperty(Q,FJ,{value:J,enumerable:!1,writable:!0}),J)try{Q.input=k6(J)}catch(Y){let U=new b(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${Y}. JSON: ${J}`);M(this,m6,"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:PJ(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 P0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var w1;var c6=y(()=>{w1=class w1 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 wJ=1e5,EJ=`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},F;var Y0=f(()=>{O0();TJ=Object.freeze(Object.create(null)),F=ET(DJ)});var E4;var K5=f(()=>{Z0();a();Y0();E4=class E4 extends h{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(F`/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(F`/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",r,{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(F`/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(F`/v1/environments/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});function b3($){return typeof $==="object"&&$!==null&&j4 in $}function H5($,Z){let X=new Set;if($){for(let z of $)if(b3(z))X.add(z[j4])}if(Z)for(let z of Z){if(b3(z))X.add(z[j4]);if(Array.isArray(z.content)){for(let J of z.content)if(b3(J))X.add(J[j4])}}return Array.from(X)}function k3($,Z){let X=H5($,Z);if(X.length===0)return{};return{"x-stainless-helper":X.join(", ")}}function IJ($){if(b3($))return{"x-stainless-helper":$[j4]};return{}}var j4;var S4=f(()=>{j4=Symbol("anthropic.sdk.stainlessHelper")});var x4;var B5=f(()=>{Z0();a();S4();_1();Y0();x4=class x4 extends h{list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/files?beta=true",u0,{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(F`/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(F`/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(F`/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",F1({body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"files-api-2025-04-14"].toString()},IJ(z.file),Z?.headers])},this._client))}}});var b4;var L5=f(()=>{Z0();a();Y0();b4=class b4 extends h{retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(F`/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",u0,{query:z,...Z,headers:O([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers])})}}});var k4;var M5=f(()=>{Z0();a();Y0();k4=class k4 extends h{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(F`/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(F`/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",r,{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(F`/v1/user_profiles/${$}/enrollment_url?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"user-profiles-2026-03-24"].toString()},X?.headers])})}}});var y4;var N5=f(()=>{Z0();a();Y0();y4=class y4 extends h{list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(F`/v1/agents/${$}/versions?beta=true`,r,{query:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var P1;var O5=f(()=>{N5();N5();Z0();a();Y0();P1=class P1 extends h{constructor(){super(...arguments);this.versions=new y4(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(F`/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(F`/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",r,{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(F`/v1/agents/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};P1.Versions=y4});var f4;var T5=f(()=>{Z0();a();Y0();f4=class f4 extends h{create($,Z,X){let{view:z,betas:J,...Q}=Z;return this._client.post(F`/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(F`/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(F`/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(F`/v1/memory_stores/${$}/memories?beta=true`,r,{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(F`/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 g4;var D5=f(()=>{Z0();a();Y0();g4=class g4 extends h{retrieve($,Z,X){let{memory_store_id:z,betas:J,...Q}=Z;return this._client.get(F`/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(F`/v1/memory_stores/${$}/memory_versions?beta=true`,r,{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(F`/v1/memory_stores/${z}/memory_versions/${$}/redact?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var v$;var I5=f(()=>{T5();T5();D5();D5();Z0();a();Y0();v$=class v$ extends h{constructor(){super(...arguments);this.memories=new f4(this._client),this.memoryVersions=new g4(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(F`/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(F`/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",r,{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(F`/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(F`/v1/memory_stores/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};v$.Memories=f4;v$.MemoryVersions=g4});var C1=f(()=>{O0()});var y3;var A5=f(()=>{y3={"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 AJ($){return $?.output_format??$?.output_config?.format}function R5($,Z,X){let z=AJ(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 F5($,Z,X)}function F5($,Z,X){let z=null,J=$.content.map((Q)=>{if(Q.type==="text"){let Y=hT(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 hT($,Z){let X=AJ($);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 _5=f(()=>{O0()});var uT=($)=>{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="",W=!1;z=$[++Z];while(z!=='"'){if(Z===$.length){W=!0;break}if(z==="\\"){if(Z++,Z===$.length){W=!0;break}U+=z+$[Z],z=$[++Z]}else U+=z,z=$[++Z]}if(z=$[++Z],!W)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},w1=($)=>{if($.length===0)return $;let Z=$[$.length-1];switch(Z.type){case"separator":return $=$.slice(0,$.length-1),w1($);break;case"number":let X=Z.value[Z.value.length-1];if(X==="."||X==="-")return $=$.slice(0,$.length-1),w1($);case"string":let z=$[$.length-2];if(z?.type==="delimiter")return $=$.slice(0,$.length-1),w1($);else if(z?.type==="brace"&&z.value==="{")return $=$.slice(0,$.length-1),w1($);break;case"delimiter":return $=$.slice(0,$.length-1),w1($);break}return $},mT=($)=>{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 $},cT=($)=>{let Z="";return $.map((X)=>{switch(X.type){case"string":Z+='"'+X.value+'"';break;default:Z+=X.value;break}}),Z},f3=($)=>JSON.parse(cT(mT(w1(uT($)))));var P5=()=>{};var C5=f(()=>{z5()});function PJ($){return $.type==="tool_use"||$.type==="server_tool_use"||$.type==="mcp_tool_use"}function CJ($){}var b0,D$,E1,v4,g3,h4,u4,v3,m4,Z$,c4,h3,u3,h$,m3,c3,d4,w5,RJ,d3,E5,j5,S5,FJ,_J="__json_buf",p4;var wJ=f(()=>{t0();P5();C1();C5();_5();p4=class p4{constructor($,Z){b0.add(this),this.messages=[],this.receivedMessages=[],D$.set(this,void 0),E1.set(this,null),this.controller=new AbortController,v4.set(this,void 0),g3.set(this,()=>{}),h4.set(this,()=>{}),u4.set(this,void 0),v3.set(this,()=>{}),m4.set(this,()=>{}),Z$.set(this,{}),c4.set(this,!1),h3.set(this,!1),u3.set(this,!1),h$.set(this,!1),m3.set(this,void 0),c3.set(this,void 0),d4.set(this,void 0),d3.set(this,(X)=>{if(P(this,h3,!0,"f"),e0(X))X=new B0;if(X instanceof B0)return P(this,u3,!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)))}),P(this,v4,new Promise((X,z)=>{P(this,g3,X,"f"),P(this,h4,z,"f")}),"f"),P(this,u4,new Promise((X,z)=>{P(this,v3,X,"f"),P(this,m4,z,"f")}),"f"),M(this,v4,"f").catch(()=>{}),M(this,u4,"f").catch(()=>{}),P(this,E1,$,"f"),P(this,d4,Z?.logger??console,"f")}get response(){return M(this,m3,"f")}get request_id(){return M(this,c3,"f")}async withResponse(){P(this,h$,!0,"f");let $=await M(this,v4,"f");if(!$)throw Error("Could not resolve a `Response` object");return{data:this,response:$,request_id:$.headers.get("request-id")}}static fromReadableStream($){let Z=new p4(null);return Z._run(()=>Z._fromReadableStream($)),Z}static createMessage($,Z,X,{logger:z}={}){let J=new p4(Z,{logger:z});for(let Q of Z.messages)J._addMessageParam(Q);return P(J,E1,{...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")},M(this,d3,"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{M(this,b0,"m",E5).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)M(this,b0,"m",j5).call(this,U);if(Y.controller.signal?.aborted)throw new B0;M(this,b0,"m",S5).call(this)}finally{if(z&&J)z.removeEventListener("abort",J)}}_connected($){if(this.ended)return;P(this,m3,$,"f"),P(this,c3,$?.headers.get("request-id"),"f"),M(this,g3,"f").call(this,$),this._emit("connect")}get ended(){return M(this,c4,"f")}get errored(){return M(this,h3,"f")}get aborted(){return M(this,u3,"f")}abort(){this.controller.abort()}on($,Z){return(M(this,Z$,"f")[$]||(M(this,Z$,"f")[$]=[])).push({listener:Z}),this}off($,Z){let X=M(this,Z$,"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(M(this,Z$,"f")[$]||(M(this,Z$,"f")[$]=[])).push({listener:Z,once:!0}),this}emitted($){return new Promise((Z,X)=>{if(P(this,h$,!0,"f"),$!=="error")this.once("error",X);this.once($,Z)})}async done(){P(this,h$,!0,"f"),await M(this,u4,"f")}get currentMessage(){return M(this,D$,"f")}async finalMessage(){return await this.done(),M(this,b0,"m",w5).call(this)}async finalText(){return await this.done(),M(this,b0,"m",RJ).call(this)}_emit($,...Z){if(M(this,c4,"f"))return;if($==="end")P(this,c4,!0,"f"),M(this,v3,"f").call(this);let X=M(this,Z$,"f")[$];if(X)M(this,Z$,"f")[$]=X.filter((z)=>!z.once),X.forEach(({listener:z})=>z(...Z));if($==="abort"){let z=Z[0];if(!M(this,h$,"f")&&!X?.length)Promise.reject(z);M(this,h4,"f").call(this,z),M(this,m4,"f").call(this,z),this._emit("end");return}if($==="error"){let z=Z[0];if(!M(this,h$,"f")&&!X?.length)Promise.reject(z);M(this,h4,"f").call(this,z),M(this,m4,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",M(this,b0,"m",w5).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{M(this,b0,"m",E5).call(this),this._connected(null);let J=C0.fromReadableStream($,this.controller);for await(let Q of J)M(this,b0,"m",j5).call(this,Q);if(J.controller.signal?.aborted)throw new B0;M(this,b0,"m",S5).call(this)}finally{if(X&&z)X.removeEventListener("abort",z)}}[(D$=new WeakMap,E1=new WeakMap,v4=new WeakMap,g3=new WeakMap,h4=new WeakMap,u4=new WeakMap,v3=new WeakMap,m4=new WeakMap,Z$=new WeakMap,c4=new WeakMap,h3=new WeakMap,u3=new WeakMap,h$=new WeakMap,m3=new WeakMap,c3=new WeakMap,d4=new WeakMap,d3=new WeakMap,b0=new WeakSet,w5=function(){if(this.receivedMessages.length===0)throw new S("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},RJ=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(" ")},E5=function(){if(this.ended)return;P(this,D$,void 0,"f")},j5=function(Z){if(this.ended)return;let X=M(this,b0,"m",FJ).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(PJ(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:CJ(Z.delta)}break}case"message_stop":{this._addMessageParam(X),this._addMessage(R5(X,M(this,E1,"f"),{logger:M(this,d4,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",X.content.at(-1));break}case"message_start":{P(this,D$,X,"f");break}case"content_block_start":case"message_delta":break}},S5=function(){if(this.ended)throw new S("stream has ended, this shouldn't happen");let Z=M(this,D$,"f");if(!Z)throw new S("request ended without sending any chunks");return P(this,D$,void 0,"f"),R5(Z,M(this,E1,"f"),{logger:M(this,d4,"f")})},FJ=function(Z){let X=M(this,D$,"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&&PJ(z)){let J=z[_J]||"";J+=Z.delta.partial_json;let Q={...z};if(Object.defineProperty(Q,_J,{value:J,enumerable:!1,writable:!0}),J)try{Q.input=f3(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}`);M(this,d3,"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:CJ(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 C0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var j1;var p3=f(()=>{j1=class j1 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 EJ=1e5,jJ=`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,66 +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 SJ(){let $,Z;return{promise:new Promise((z,J)=>{$=z,Z=J}),resolve:$,reject:Z}}async function cT($,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 W=await Y.run(U,{toolUseBlock:Q,signal:X?.signal});return{type:"tool_result",tool_use_id:Q.id,content:W}}catch(U){return{type:"tool_result",tool_use_id:Q.id,content:U instanceof w1?U.content:`Error: ${U instanceof Error?U.message:String(U)}`,is_error:!0}}}))}}var d4,E1,v$,G0,T0,C0,Z$,T$,p4,jJ,jZ,l4;var SZ=y(()=>{o0();c6();O0();r();E4();l4=class l4{constructor($,Z,X){d4.add(this),this.client=$,E1.set(this,!1),v$.set(this,!1),G0.set(this,void 0),T0.set(this,void 0),C0.set(this,void 0),Z$.set(this,void 0),T$.set(this,void 0),p4.set(this,0),C(this,G0,{params:{...Z,messages:structuredClone(Z.messages)}},"f");let J=["BetaToolRunner",...VZ(Z.tools,Z.messages)].join(", ");if(C(this,T0,{...X,headers:O([{"x-stainless-helper":J},X?.headers])},"f"),C(this,T$,SJ(),"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*[(E1=new WeakMap,v$=new WeakMap,G0=new WeakMap,T0=new WeakMap,C0=new WeakMap,Z$=new WeakMap,T$=new WeakMap,p4=new WeakMap,d4=new WeakSet,jJ=async function(){let Z=M(this,G0,"f").params.compactionControl;if(!Z||!Z.enabled)return!1;let X=0;if(M(this,C0,"f")!==void 0)try{let W=await M(this,C0,"f");X=W.usage.input_tokens+(W.usage.cache_creation_input_tokens??0)+(W.usage.cache_read_input_tokens??0)+W.usage.output_tokens}catch{return!1}let z=Z.contextTokenThreshold??wJ;if(X<z)return!1;let J=Z.model??M(this,G0,"f").params.model,Q=Z.summaryPrompt??EJ,Y=M(this,G0,"f").params.messages;if(Y[Y.length-1].role==="assistant"){let W=Y[Y.length-1];if(Array.isArray(W.content)){let G=W.content.filter((q)=>q.type!=="tool_use");if(G.length===0)Y.pop();else W.content=G}}let U=await this.client.beta.messages.create({model:J,messages:[...Y,{role:"user",content:[{type:"text",text:Q}]}],max_tokens:M(this,G0,"f").params.max_tokens},{signal:M(this,T0,"f").signal,headers:O([M(this,T0,"f").headers,{"x-stainless-helper":"compaction"}])});if(U.content[0]?.type!=="text")throw new b("Expected text response for compaction");return M(this,G0,"f").params.messages=[{role:"user",content:U.content}],!0},Symbol.asyncIterator)](){var $;if(M(this,E1,"f"))throw new b("Cannot iterate over a consumed stream");C(this,E1,!0,"f"),C(this,v$,!0,"f"),C(this,Z$,void 0,"f");try{while(!0){let Z;try{if(M(this,G0,"f").params.max_iterations&&M(this,p4,"f")>=M(this,G0,"f").params.max_iterations)break;C(this,v$,!1,"f"),C(this,Z$,void 0,"f"),C(this,p4,($=M(this,p4,"f"),$++,$),"f"),C(this,C0,void 0,"f");let{max_iterations:X,compactionControl:z,...J}=M(this,G0,"f").params;if(J.stream)Z=this.client.beta.messages.stream({...J},M(this,T0,"f")),C(this,C0,Z.finalMessage(),"f"),M(this,C0,"f").catch(()=>{}),yield Z;else C(this,C0,this.client.beta.messages.create({...J,stream:!1},M(this,T0,"f")),"f"),yield M(this,C0,"f");if(!await M(this,d4,"m",jJ).call(this)){if(!M(this,v$,"f")){let{role:U,content:W}=await M(this,C0,"f");M(this,G0,"f").params.messages.push({role:U,content:W})}let Y=await M(this,d4,"m",jZ).call(this,M(this,G0,"f").params.messages.at(-1));if(Y)M(this,G0,"f").params.messages.push(Y);else if(!M(this,v$,"f"))break}}finally{if(Z)Z.abort()}}if(!M(this,C0,"f"))throw new b("ToolRunner concluded without a message from the server");M(this,T$,"f").resolve(await M(this,C0,"f"))}catch(Z){throw C(this,E1,!1,"f"),M(this,T$,"f").promise.catch(()=>{}),M(this,T$,"f").reject(Z),C(this,T$,SJ(),"f"),Z}}setMessagesParams($){if(typeof $==="function")M(this,G0,"f").params=$(M(this,G0,"f").params);else M(this,G0,"f").params=$;C(this,v$,!0,"f"),C(this,Z$,void 0,"f")}setRequestOptions($){if(typeof $==="function")C(this,T0,$(M(this,T0,"f")),"f");else C(this,T0,{...M(this,T0,"f"),...$},"f")}async generateToolResponse($=M(this,T0,"f").signal){let Z=await M(this,C0,"f")??this.params.messages.at(-1);if(!Z)return null;return M(this,d4,"m",jZ).call(this,Z,$)}done(){return M(this,T$,"f").promise}async runUntilDone(){if(!M(this,E1,"f"))for await(let $ of this);return this.done()}get params(){return M(this,G0,"f").params}pushMessages(...$){this.setMessagesParams((Z)=>({...Z,messages:[...Z.messages,...$]}))}then($,Z){return this.runUntilDone().then($,Z)}};jZ=async function(Z,X=M(this,T0,"f").signal){if(M(this,Z$,"f")!==void 0)return M(this,Z$,"f");return C(this,Z$,cT(M(this,G0,"f").params,Z,{...M(this,T0,"f"),signal:X}),"f"),M(this,Z$,"f")}});var j1;var xZ=y(()=>{O0();e3();j1=class j1{constructor($,Z){this.iterator=$,this.controller=Z}async*decoder(){let $=new M$;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 b("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 b("Attempted to iterate over a response with no body")}return new j1(T4($.body),Z)}}});var i4;var bZ=y(()=>{e();r();xZ();_1();Q0();i4=class i4 extends v{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(F`/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",g0,{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(F`/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(F`/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 b(`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)=>j1.fromResponse(Y.response,Y.controller))}}});function bJ($){if(!$.output_format)return $;if($.output_config?.format)throw new b("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 xJ,pT,D$;var kZ=y(()=>{_1();DZ();r();E4();RZ();CJ();SZ();c6();bZ();bZ();SZ();c6();xJ={"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"},pT=["claude-mythos-preview","claude-opus-4-6"];D$=class D$ extends v{constructor(){super(...arguments);this.batches=new i4(this._client)}create($,Z){let X=bJ($),{betas:z,...J}=X;if(J.model in xJ)console.warn(`The model '${J.model}' is deprecated and will reach end-of-life on ${xJ[J.model]}
196
- Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(pT.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=b6[J.model]??void 0;Q=this._client.calculateNonstreamingTimeout(J.max_tokens,U)}let Y=x6(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)=>AZ(X,$,{logger:this._client.logger??console}))}stream($,Z){return c4.createMessage(this,$,Z)}countTokens($,Z){let X=bJ($),{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 l4(this._client,$,Z)}};D$.Batches=i4;D$.BetaToolRunner=l4;D$.ToolError=w1});var n4;var yZ=y(()=>{e();r();Q0();n4=class n4 extends v{list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(F`/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(F`/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(F`/v1/sessions/${$}/events/stream?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers]),stream:!0})}}});var r4;var fZ=y(()=>{e();r();Q0();r4=class r4 extends v{retrieve($,Z,X){let{session_id:z,betas:J}=Z;return this._client.get(F`/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(F`/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(F`/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(F`/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(F`/v1/sessions/${$}/resources?beta=true`,{body:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var h$;var gZ=y(()=>{yZ();yZ();fZ();fZ();e();r();Q0();h$=class h$ extends v{constructor(){super(...arguments);this.events=new n4(this._client),this.resources=new r4(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(F`/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(F`/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(F`/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(F`/v1/sessions/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};h$.Events=n4;h$.Resources=r4});var s4;var vZ=y(()=>{e();r();R1();Q0();s4=class s4 extends v{create($,Z={},X){let{betas:z,...J}=Z??{};return this._client.post(F`/v1/skills/${$}/versions?beta=true`,A1({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(F`/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(F`/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(F`/v1/skills/${z}/versions/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])})}}});var S1;var hZ=y(()=>{vZ();vZ();e();r();R1();Q0();S1=class S1 extends v{constructor(){super(...arguments);this.versions=new s4(this._client)}create($={},Z){let{betas:X,...z}=$??{};return this._client.post("/v1/skills?beta=true",A1({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(F`/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(F`/v1/skills/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}};S1.Versions=s4});var a4;var uZ=y(()=>{e();r();Q0();a4=class a4 extends v{create($,Z,X){let{betas:z,...J}=Z;return this._client.post(F`/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(F`/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(F`/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(F`/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(F`/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(F`/v1/vaults/${z}/credentials/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var x1;var mZ=y(()=>{uZ();uZ();e();r();Q0();x1=class x1 extends v{constructor(){super(...arguments);this.credentials=new a4(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(F`/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(F`/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(F`/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(F`/v1/vaults/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};x1.Credentials=a4});var L0;var cZ=y(()=>{qZ();qZ();KZ();KZ();HZ();HZ();BZ();BZ();MZ();MZ();TZ();TZ();kZ();kZ();gZ();gZ();hZ();hZ();mZ();mZ();L0=class L0 extends v{constructor(){super(...arguments);this.models=new S4(this._client),this.messages=new D$(this._client),this.agents=new F1(this._client),this.environments=new C4(this._client),this.sessions=new h$(this._client),this.vaults=new x1(this._client),this.memoryStores=new f$(this._client),this.files=new j4(this._client),this.skills=new S1(this._client),this.userProfiles=new x4(this._client)}};L0.Models=S4;L0.Messages=D$;L0.Agents=F1;L0.Environments=C4;L0.Sessions=h$;L0.Vaults=x1;L0.MemoryStores=f$;L0.Files=j4;L0.Skills=S1;L0.UserProfiles=x4});var b1;var dZ=y(()=>{r();b1=class b1 extends v{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 kJ($){return $?.output_config?.format}function pZ($,Z,X){let z=kJ(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 lZ($,Z,X)}function lZ($,Z,X){let z=null,J=$.content.map((Q)=>{if(Q.type==="text"){let Y=eT(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 eT($,Z){let X=kJ($);if(X?.type!=="json_schema")return null;try{if("parse"in X)return X.parse(Z);return JSON.parse(Z)}catch(z){throw new b(`Failed to parse structured output: ${z}`)}}var iZ=y(()=>{O0()});function vJ($){return $.type==="tool_use"||$.type==="server_tool_use"}function hJ($){}var x0,I$,k1,o4,d6,t4,e4,p6,$2,X$,Z2,l6,i6,u$,n6,r6,X2,nZ,yJ,rZ,sZ,aZ,oZ,fJ,gJ="__json_buf",z2;var uJ=y(()=>{o0();_1();_Z();FZ();iZ();z2=class z2{constructor($,Z){x0.add(this),this.messages=[],this.receivedMessages=[],I$.set(this,void 0),k1.set(this,null),this.controller=new AbortController,o4.set(this,void 0),d6.set(this,()=>{}),t4.set(this,()=>{}),e4.set(this,void 0),p6.set(this,()=>{}),$2.set(this,()=>{}),X$.set(this,{}),Z2.set(this,!1),l6.set(this,!1),i6.set(this,!1),u$.set(this,!1),n6.set(this,void 0),r6.set(this,void 0),X2.set(this,void 0),rZ.set(this,(X)=>{if(C(this,l6,!0,"f"),t0(X))X=new H0;if(X instanceof H0)return C(this,i6,!0,"f"),this._emit("abort",X);if(X instanceof b)return this._emit("error",X);if(X instanceof Error){let z=new b(X.message);return z.cause=X,this._emit("error",z)}return this._emit("error",new b(String(X)))}),C(this,o4,new Promise((X,z)=>{C(this,d6,X,"f"),C(this,t4,z,"f")}),"f"),C(this,e4,new Promise((X,z)=>{C(this,p6,X,"f"),C(this,$2,z,"f")}),"f"),M(this,o4,"f").catch(()=>{}),M(this,e4,"f").catch(()=>{}),C(this,k1,$,"f"),C(this,X2,Z?.logger??console,"f")}get response(){return M(this,n6,"f")}get request_id(){return M(this,r6,"f")}async withResponse(){C(this,u$,!0,"f");let $=await M(this,o4,"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 z2(null);return Z._run(()=>Z._fromReadableStream($)),Z}static createMessage($,Z,X,{logger:z}={}){let J=new z2(Z,{logger:z});for(let Q of Z.messages)J._addMessageParam(Q);return C(J,k1,{...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")},M(this,rZ,"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{M(this,x0,"m",sZ).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)M(this,x0,"m",aZ).call(this,U);if(Y.controller.signal?.aborted)throw new H0;M(this,x0,"m",oZ).call(this)}finally{if(z&&J)z.removeEventListener("abort",J)}}_connected($){if(this.ended)return;C(this,n6,$,"f"),C(this,r6,$?.headers.get("request-id"),"f"),M(this,d6,"f").call(this,$),this._emit("connect")}get ended(){return M(this,Z2,"f")}get errored(){return M(this,l6,"f")}get aborted(){return M(this,i6,"f")}abort(){this.controller.abort()}on($,Z){return(M(this,X$,"f")[$]||(M(this,X$,"f")[$]=[])).push({listener:Z}),this}off($,Z){let X=M(this,X$,"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(M(this,X$,"f")[$]||(M(this,X$,"f")[$]=[])).push({listener:Z,once:!0}),this}emitted($){return new Promise((Z,X)=>{if(C(this,u$,!0,"f"),$!=="error")this.once("error",X);this.once($,Z)})}async done(){C(this,u$,!0,"f"),await M(this,e4,"f")}get currentMessage(){return M(this,I$,"f")}async finalMessage(){return await this.done(),M(this,x0,"m",nZ).call(this)}async finalText(){return await this.done(),M(this,x0,"m",yJ).call(this)}_emit($,...Z){if(M(this,Z2,"f"))return;if($==="end")C(this,Z2,!0,"f"),M(this,p6,"f").call(this);let X=M(this,X$,"f")[$];if(X)M(this,X$,"f")[$]=X.filter((z)=>!z.once),X.forEach(({listener:z})=>z(...Z));if($==="abort"){let z=Z[0];if(!M(this,u$,"f")&&!X?.length)Promise.reject(z);M(this,t4,"f").call(this,z),M(this,$2,"f").call(this,z),this._emit("end");return}if($==="error"){let z=Z[0];if(!M(this,u$,"f")&&!X?.length)Promise.reject(z);M(this,t4,"f").call(this,z),M(this,$2,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",M(this,x0,"m",nZ).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{M(this,x0,"m",sZ).call(this),this._connected(null);let J=P0.fromReadableStream($,this.controller);for await(let Q of J)M(this,x0,"m",aZ).call(this,Q);if(J.controller.signal?.aborted)throw new H0;M(this,x0,"m",oZ).call(this)}finally{if(X&&z)X.removeEventListener("abort",z)}}[(I$=new WeakMap,k1=new WeakMap,o4=new WeakMap,d6=new WeakMap,t4=new WeakMap,e4=new WeakMap,p6=new WeakMap,$2=new WeakMap,X$=new WeakMap,Z2=new WeakMap,l6=new WeakMap,i6=new WeakMap,u$=new WeakMap,n6=new WeakMap,r6=new WeakMap,X2=new WeakMap,rZ=new WeakMap,x0=new WeakSet,nZ=function(){if(this.receivedMessages.length===0)throw new b("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},yJ=function(){if(this.receivedMessages.length===0)throw new b("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 b("stream ended without producing a content block with type=text");return Z.join(" ")},sZ=function(){if(this.ended)return;C(this,I$,void 0,"f")},aZ=function(Z){if(this.ended)return;let X=M(this,x0,"m",fJ).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(vJ(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:hJ(Z.delta)}break}case"message_stop":{this._addMessageParam(X),this._addMessage(pZ(X,M(this,k1,"f"),{logger:M(this,X2,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",X.content.at(-1));break}case"message_start":{C(this,I$,X,"f");break}case"content_block_start":case"message_delta":break}},oZ=function(){if(this.ended)throw new b("stream has ended, this shouldn't happen");let Z=M(this,I$,"f");if(!Z)throw new b("request ended without sending any chunks");return C(this,I$,void 0,"f"),pZ(Z,M(this,k1,"f"),{logger:M(this,X2,"f")})},fJ=function(Z){let X=M(this,I$,"f");if(Z.type==="message_start"){if(X)throw new b(`Unexpected event order, got ${Z.type} before receiving "message_stop"`);return Z.message}if(!X)throw new b(`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&&vJ(z)){let J=z[gJ]||"";J+=Z.delta.partial_json;let Q={...z};if(Object.defineProperty(Q,gJ,{value:J,enumerable:!1,writable:!0}),J)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:hJ(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 P0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var J2;var tZ=y(()=>{e();r();xZ();_1();Q0();J2=class J2 extends v{create($,Z){return this._client.post("/v1/messages/batches",{body:$,...Z})}retrieve($,Z){return this._client.get(F`/v1/messages/batches/${$}`,Z)}list($={},Z){return this._client.getAPIList("/v1/messages/batches",g0,{query:$,...Z})}delete($,Z){return this._client.delete(F`/v1/messages/batches/${$}`,Z)}cancel($,Z){return this._client.post(F`/v1/messages/batches/${$}/cancel`,Z)}async results($,Z){let X=await this.retrieve($);if(!X.results_url)throw new b(`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)=>j1.fromResponse(J.response,J.controller))}}});var m$,mJ,ZD;var eZ=y(()=>{r();E4();uJ();iZ();tZ();tZ();DZ();m$=class m$ extends v{constructor(){super(...arguments);this.batches=new J2(this._client)}create($,Z){if($.model in mJ)console.warn(`The model '${$.model}' is deprecated and will reach end-of-life on ${mJ[$.model]}
197
- Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(ZD.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=b6[$.model]??void 0;X=this._client.calculateNonstreamingTimeout($.max_tokens,J)}let z=x6($.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)=>lZ(X,$,{logger:this._client.logger??console}))}stream($,Z){return z2.createMessage(this,$,Z,{logger:this._client.logger??console})}countTokens($,Z){return this._client.post("/v1/messages/count_tokens",{body:$,...Z})}};mJ={"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"},ZD=["claude-mythos-preview","claude-opus-4-6"];m$.Batches=J2});var y1;var $5=y(()=>{e();r();Q0();y1=class y1 extends v{retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(F`/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",g0,{query:z,...Z,headers:O([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers])})}}});var cJ=y(()=>{cZ();dZ();eZ();$5();MJ()});var Q2=($)=>{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 o{constructor({baseURL:$=Q2("ANTHROPIC_BASE_URL"),apiKey:Z=Q2("ANTHROPIC_API_KEY")??null,authToken:X=Q2("ANTHROPIC_AUTH_TOKEN")??null,...z}={}){Z5.add(this),s6.set(this,void 0);let J={apiKey:Z,authToken:X,...z,baseURL:$||"https://api.anthropic.com"};if(!J.dangerouslyAllowBrowser&&$J())throw new b(`It looks like you're running in a browser-like environment.
195
+ Wrap your summary in <summary></summary> tags.`;function xJ(){let $,Z;return{promise:new Promise((z,J)=>{$=z,Z=J}),resolve:$,reject:Z}}async function dT($,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 W=await Y.run(U,{toolUseBlock:Q,signal:X?.signal});return{type:"tool_result",tool_use_id:Q.id,content:W}}catch(U){return{type:"tool_result",tool_use_id:Q.id,content:U instanceof j1?U.content:`Error: ${U instanceof Error?U.message:String(U)}`,is_error:!0}}}))}}var l4,S1,u$,q0,T0,w0,X$,I$,i4,SJ,x5,n4;var b5=f(()=>{t0();p3();O0();a();S4();n4=class n4{constructor($,Z,X){l4.add(this),this.client=$,S1.set(this,!1),u$.set(this,!1),q0.set(this,void 0),T0.set(this,void 0),w0.set(this,void 0),X$.set(this,void 0),I$.set(this,void 0),i4.set(this,0),P(this,q0,{params:{...Z,messages:structuredClone(Z.messages)}},"f");let J=["BetaToolRunner",...H5(Z.tools,Z.messages)].join(", ");if(P(this,T0,{...X,headers:O([{"x-stainless-helper":J},X?.headers])},"f"),P(this,I$,xJ(),"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*[(S1=new WeakMap,u$=new WeakMap,q0=new WeakMap,T0=new WeakMap,w0=new WeakMap,X$=new WeakMap,I$=new WeakMap,i4=new WeakMap,l4=new WeakSet,SJ=async function(){let Z=M(this,q0,"f").params.compactionControl;if(!Z||!Z.enabled)return!1;let X=0;if(M(this,w0,"f")!==void 0)try{let W=await M(this,w0,"f");X=W.usage.input_tokens+(W.usage.cache_creation_input_tokens??0)+(W.usage.cache_read_input_tokens??0)+W.usage.output_tokens}catch{return!1}let z=Z.contextTokenThreshold??EJ;if(X<z)return!1;let J=Z.model??M(this,q0,"f").params.model,Q=Z.summaryPrompt??jJ,Y=M(this,q0,"f").params.messages;if(Y[Y.length-1].role==="assistant"){let W=Y[Y.length-1];if(Array.isArray(W.content)){let G=W.content.filter((q)=>q.type!=="tool_use");if(G.length===0)Y.pop();else W.content=G}}let U=await this.client.beta.messages.create({model:J,messages:[...Y,{role:"user",content:[{type:"text",text:Q}]}],max_tokens:M(this,q0,"f").params.max_tokens},{signal:M(this,T0,"f").signal,headers:O([M(this,T0,"f").headers,{"x-stainless-helper":"compaction"}])});if(U.content[0]?.type!=="text")throw new S("Expected text response for compaction");return M(this,q0,"f").params.messages=[{role:"user",content:U.content}],!0},Symbol.asyncIterator)](){var $;if(M(this,S1,"f"))throw new S("Cannot iterate over a consumed stream");P(this,S1,!0,"f"),P(this,u$,!0,"f"),P(this,X$,void 0,"f");try{while(!0){let Z;try{if(M(this,q0,"f").params.max_iterations&&M(this,i4,"f")>=M(this,q0,"f").params.max_iterations)break;P(this,u$,!1,"f"),P(this,X$,void 0,"f"),P(this,i4,($=M(this,i4,"f"),$++,$),"f"),P(this,w0,void 0,"f");let{max_iterations:X,compactionControl:z,...J}=M(this,q0,"f").params;if(J.stream)Z=this.client.beta.messages.stream({...J},M(this,T0,"f")),P(this,w0,Z.finalMessage(),"f"),M(this,w0,"f").catch(()=>{}),yield Z;else P(this,w0,this.client.beta.messages.create({...J,stream:!1},M(this,T0,"f")),"f"),yield M(this,w0,"f");if(!await M(this,l4,"m",SJ).call(this)){if(!M(this,u$,"f")){let{role:U,content:W}=await M(this,w0,"f");M(this,q0,"f").params.messages.push({role:U,content:W})}let Y=await M(this,l4,"m",x5).call(this,M(this,q0,"f").params.messages.at(-1));if(Y)M(this,q0,"f").params.messages.push(Y);else if(!M(this,u$,"f"))break}}finally{if(Z)Z.abort()}}if(!M(this,w0,"f"))throw new S("ToolRunner concluded without a message from the server");M(this,I$,"f").resolve(await M(this,w0,"f"))}catch(Z){throw P(this,S1,!1,"f"),M(this,I$,"f").promise.catch(()=>{}),M(this,I$,"f").reject(Z),P(this,I$,xJ(),"f"),Z}}setMessagesParams($){if(typeof $==="function")M(this,q0,"f").params=$(M(this,q0,"f").params);else M(this,q0,"f").params=$;P(this,u$,!0,"f"),P(this,X$,void 0,"f")}setRequestOptions($){if(typeof $==="function")P(this,T0,$(M(this,T0,"f")),"f");else P(this,T0,{...M(this,T0,"f"),...$},"f")}async generateToolResponse($=M(this,T0,"f").signal){let Z=await M(this,w0,"f")??this.params.messages.at(-1);if(!Z)return null;return M(this,l4,"m",x5).call(this,Z,$)}done(){return M(this,I$,"f").promise}async runUntilDone(){if(!M(this,S1,"f"))for await(let $ of this);return this.done()}get params(){return M(this,q0,"f").params}pushMessages(...$){this.setMessagesParams((Z)=>({...Z,messages:[...Z.messages,...$]}))}then($,Z){return this.runUntilDone().then($,Z)}};x5=async function(Z,X=M(this,T0,"f").signal){if(M(this,X$,"f")!==void 0)return M(this,X$,"f");return P(this,X$,dT(M(this,q0,"f").params,Z,{...M(this,T0,"f"),signal:X}),"f"),M(this,X$,"f")}});var x1;var k5=f(()=>{O0();Z5();x1=class x1{constructor($,Z){this.iterator=$,this.controller=Z}async*decoder(){let $=new O$;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 x1(I4($.body),Z)}}});var r4;var y5=f(()=>{Z0();a();k5();C1();Y0();r4=class r4 extends h{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(F`/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",u0,{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(F`/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(F`/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)=>x1.fromResponse(Y.response,Y.controller))}}});function kJ($){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 bJ,lT,A$;var f5=f(()=>{C1();A5();a();S4();_5();wJ();b5();p3();y5();y5();b5();p3();bJ={"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"},lT=["claude-mythos-preview","claude-opus-4-6"];A$=class A$ extends h{constructor(){super(...arguments);this.batches=new r4(this._client)}create($,Z){let X=kJ($),{betas:z,...J}=X;if(J.model in bJ)console.warn(`The model '${J.model}' is deprecated and will reach end-of-life on ${bJ[J.model]}
196
+ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(lT.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=y3[J.model]??void 0;Q=this._client.calculateNonstreamingTimeout(J.max_tokens,U)}let Y=k3(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)=>F5(X,$,{logger:this._client.logger??console}))}stream($,Z){return p4.createMessage(this,$,Z)}countTokens($,Z){let X=kJ($),{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 n4(this._client,$,Z)}};A$.Batches=r4;A$.BetaToolRunner=n4;A$.ToolError=j1});var s4;var g5=f(()=>{Z0();a();Y0();s4=class s4 extends h{list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(F`/v1/sessions/${$}/events?beta=true`,r,{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(F`/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(F`/v1/sessions/${$}/events/stream?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers]),stream:!0})}}});var a4;var v5=f(()=>{Z0();a();Y0();a4=class a4 extends h{retrieve($,Z,X){let{session_id:z,betas:J}=Z;return this._client.get(F`/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(F`/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(F`/v1/sessions/${$}/resources?beta=true`,r,{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(F`/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(F`/v1/sessions/${$}/resources?beta=true`,{body:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var m$;var h5=f(()=>{g5();g5();v5();v5();Z0();a();Y0();m$=class m$ extends h{constructor(){super(...arguments);this.events=new s4(this._client),this.resources=new a4(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(F`/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(F`/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",r,{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(F`/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(F`/v1/sessions/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};m$.Events=s4;m$.Resources=a4});var o4;var u5=f(()=>{Z0();a();_1();Y0();o4=class o4 extends h{create($,Z={},X){let{betas:z,...J}=Z??{};return this._client.post(F`/v1/skills/${$}/versions?beta=true`,F1({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(F`/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(F`/v1/skills/${$}/versions?beta=true`,r,{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(F`/v1/skills/${z}/versions/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])})}}});var b1;var m5=f(()=>{u5();u5();Z0();a();_1();Y0();b1=class b1 extends h{constructor(){super(...arguments);this.versions=new o4(this._client)}create($={},Z){let{betas:X,...z}=$??{};return this._client.post("/v1/skills?beta=true",F1({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(F`/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",r,{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(F`/v1/skills/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}};b1.Versions=o4});var t4;var c5=f(()=>{Z0();a();Y0();t4=class t4 extends h{create($,Z,X){let{betas:z,...J}=Z;return this._client.post(F`/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(F`/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(F`/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(F`/v1/vaults/${$}/credentials?beta=true`,r,{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(F`/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(F`/v1/vaults/${z}/credentials/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var k1;var d5=f(()=>{c5();c5();Z0();a();Y0();k1=class k1 extends h{constructor(){super(...arguments);this.credentials=new t4(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(F`/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(F`/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",r,{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(F`/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(F`/v1/vaults/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};k1.Credentials=t4});var M0;var p5=f(()=>{K5();K5();B5();B5();L5();L5();M5();M5();O5();O5();I5();I5();f5();f5();h5();h5();m5();m5();d5();d5();M0=class M0 extends h{constructor(){super(...arguments);this.models=new b4(this._client),this.messages=new A$(this._client),this.agents=new P1(this._client),this.environments=new E4(this._client),this.sessions=new m$(this._client),this.vaults=new k1(this._client),this.memoryStores=new v$(this._client),this.files=new x4(this._client),this.skills=new b1(this._client),this.userProfiles=new k4(this._client)}};M0.Models=b4;M0.Messages=A$;M0.Agents=P1;M0.Environments=E4;M0.Sessions=m$;M0.Vaults=k1;M0.MemoryStores=v$;M0.Files=x4;M0.Skills=b1;M0.UserProfiles=k4});var y1;var l5=f(()=>{a();y1=class y1 extends h{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 yJ($){return $?.output_config?.format}function i5($,Z,X){let z=yJ(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 n5($,Z,X)}function n5($,Z,X){let z=null,J=$.content.map((Q)=>{if(Q.type==="text"){let Y=$D(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 $D($,Z){let X=yJ($);if(X?.type!=="json_schema")return null;try{if("parse"in X)return X.parse(Z);return JSON.parse(Z)}catch(z){throw new S(`Failed to parse structured output: ${z}`)}}var r5=f(()=>{O0()});function hJ($){return $.type==="tool_use"||$.type==="server_tool_use"}function uJ($){}var k0,R$,f1,e4,l3,$2,Z2,i3,X2,z$,z2,n3,r3,c$,s3,a3,J2,s5,fJ,a5,o5,t5,e5,gJ,vJ="__json_buf",Q2;var mJ=f(()=>{t0();C1();C5();P5();r5();Q2=class Q2{constructor($,Z){k0.add(this),this.messages=[],this.receivedMessages=[],R$.set(this,void 0),f1.set(this,null),this.controller=new AbortController,e4.set(this,void 0),l3.set(this,()=>{}),$2.set(this,()=>{}),Z2.set(this,void 0),i3.set(this,()=>{}),X2.set(this,()=>{}),z$.set(this,{}),z2.set(this,!1),n3.set(this,!1),r3.set(this,!1),c$.set(this,!1),s3.set(this,void 0),a3.set(this,void 0),J2.set(this,void 0),a5.set(this,(X)=>{if(P(this,n3,!0,"f"),e0(X))X=new B0;if(X instanceof B0)return P(this,r3,!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)))}),P(this,e4,new Promise((X,z)=>{P(this,l3,X,"f"),P(this,$2,z,"f")}),"f"),P(this,Z2,new Promise((X,z)=>{P(this,i3,X,"f"),P(this,X2,z,"f")}),"f"),M(this,e4,"f").catch(()=>{}),M(this,Z2,"f").catch(()=>{}),P(this,f1,$,"f"),P(this,J2,Z?.logger??console,"f")}get response(){return M(this,s3,"f")}get request_id(){return M(this,a3,"f")}async withResponse(){P(this,c$,!0,"f");let $=await M(this,e4,"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 Q2(null);return Z._run(()=>Z._fromReadableStream($)),Z}static createMessage($,Z,X,{logger:z}={}){let J=new Q2(Z,{logger:z});for(let Q of Z.messages)J._addMessageParam(Q);return P(J,f1,{...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")},M(this,a5,"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{M(this,k0,"m",o5).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)M(this,k0,"m",t5).call(this,U);if(Y.controller.signal?.aborted)throw new B0;M(this,k0,"m",e5).call(this)}finally{if(z&&J)z.removeEventListener("abort",J)}}_connected($){if(this.ended)return;P(this,s3,$,"f"),P(this,a3,$?.headers.get("request-id"),"f"),M(this,l3,"f").call(this,$),this._emit("connect")}get ended(){return M(this,z2,"f")}get errored(){return M(this,n3,"f")}get aborted(){return M(this,r3,"f")}abort(){this.controller.abort()}on($,Z){return(M(this,z$,"f")[$]||(M(this,z$,"f")[$]=[])).push({listener:Z}),this}off($,Z){let X=M(this,z$,"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(M(this,z$,"f")[$]||(M(this,z$,"f")[$]=[])).push({listener:Z,once:!0}),this}emitted($){return new Promise((Z,X)=>{if(P(this,c$,!0,"f"),$!=="error")this.once("error",X);this.once($,Z)})}async done(){P(this,c$,!0,"f"),await M(this,Z2,"f")}get currentMessage(){return M(this,R$,"f")}async finalMessage(){return await this.done(),M(this,k0,"m",s5).call(this)}async finalText(){return await this.done(),M(this,k0,"m",fJ).call(this)}_emit($,...Z){if(M(this,z2,"f"))return;if($==="end")P(this,z2,!0,"f"),M(this,i3,"f").call(this);let X=M(this,z$,"f")[$];if(X)M(this,z$,"f")[$]=X.filter((z)=>!z.once),X.forEach(({listener:z})=>z(...Z));if($==="abort"){let z=Z[0];if(!M(this,c$,"f")&&!X?.length)Promise.reject(z);M(this,$2,"f").call(this,z),M(this,X2,"f").call(this,z),this._emit("end");return}if($==="error"){let z=Z[0];if(!M(this,c$,"f")&&!X?.length)Promise.reject(z);M(this,$2,"f").call(this,z),M(this,X2,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",M(this,k0,"m",s5).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{M(this,k0,"m",o5).call(this),this._connected(null);let J=C0.fromReadableStream($,this.controller);for await(let Q of J)M(this,k0,"m",t5).call(this,Q);if(J.controller.signal?.aborted)throw new B0;M(this,k0,"m",e5).call(this)}finally{if(X&&z)X.removeEventListener("abort",z)}}[(R$=new WeakMap,f1=new WeakMap,e4=new WeakMap,l3=new WeakMap,$2=new WeakMap,Z2=new WeakMap,i3=new WeakMap,X2=new WeakMap,z$=new WeakMap,z2=new WeakMap,n3=new WeakMap,r3=new WeakMap,c$=new WeakMap,s3=new WeakMap,a3=new WeakMap,J2=new WeakMap,a5=new WeakMap,k0=new WeakSet,s5=function(){if(this.receivedMessages.length===0)throw new S("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},fJ=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(" ")},o5=function(){if(this.ended)return;P(this,R$,void 0,"f")},t5=function(Z){if(this.ended)return;let X=M(this,k0,"m",gJ).call(this,Z);switch(this._emit("streamEvent",Z,X),Z.type){case"content_block_delta":{let z=X.content.at(-1);switch(Z.delta.type){case"text_delta":{if(z.type==="text")this._emit("text",Z.delta.text,z.text||"");break}case"citations_delta":{if(z.type==="text")this._emit("citation",Z.delta.citation,z.citations??[]);break}case"input_json_delta":{if(hJ(z)&&z.input)this._emit("inputJson",Z.delta.partial_json,z.input);break}case"thinking_delta":{if(z.type==="thinking")this._emit("thinking",Z.delta.thinking,z.thinking);break}case"signature_delta":{if(z.type==="thinking")this._emit("signature",z.signature);break}default:uJ(Z.delta)}break}case"message_stop":{this._addMessageParam(X),this._addMessage(i5(X,M(this,f1,"f"),{logger:M(this,J2,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",X.content.at(-1));break}case"message_start":{P(this,R$,X,"f");break}case"content_block_start":case"message_delta":break}},e5=function(){if(this.ended)throw new S("stream has ended, this shouldn't happen");let Z=M(this,R$,"f");if(!Z)throw new S("request ended without sending any chunks");return P(this,R$,void 0,"f"),i5(Z,M(this,f1,"f"),{logger:M(this,J2,"f")})},gJ=function(Z){let X=M(this,R$,"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&&hJ(z)){let J=z[vJ]||"";J+=Z.delta.partial_json;let Q={...z};if(Object.defineProperty(Q,vJ,{value:J,enumerable:!1,writable:!0}),J)Q.input=f3(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:uJ(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 C0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var Y2;var $Z=f(()=>{Z0();a();k5();C1();Y0();Y2=class Y2 extends h{create($,Z){return this._client.post("/v1/messages/batches",{body:$,...Z})}retrieve($,Z){return this._client.get(F`/v1/messages/batches/${$}`,Z)}list($={},Z){return this._client.getAPIList("/v1/messages/batches",u0,{query:$,...Z})}delete($,Z){return this._client.delete(F`/v1/messages/batches/${$}`,Z)}cancel($,Z){return this._client.post(F`/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)=>x1.fromResponse(J.response,J.controller))}}});var d$,cJ,XD;var ZZ=f(()=>{a();S4();mJ();r5();$Z();$Z();A5();d$=class d$ extends h{constructor(){super(...arguments);this.batches=new Y2(this._client)}create($,Z){if($.model in cJ)console.warn(`The model '${$.model}' is deprecated and will reach end-of-life on ${cJ[$.model]}
197
+ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(XD.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=y3[$.model]??void 0;X=this._client.calculateNonstreamingTimeout($.max_tokens,J)}let z=k3($.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)=>n5(X,$,{logger:this._client.logger??console}))}stream($,Z){return Q2.createMessage(this,$,Z,{logger:this._client.logger??console})}countTokens($,Z){return this._client.post("/v1/messages/count_tokens",{body:$,...Z})}};cJ={"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"},XD=["claude-mythos-preview","claude-opus-4-6"];d$.Batches=Y2});var g1;var XZ=f(()=>{Z0();a();Y0();g1=class g1 extends h{retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(F`/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",u0,{query:z,...Z,headers:O([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers])})}}});var dJ=f(()=>{p5();l5();ZZ();XZ();NJ()});var U2=($)=>{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 e{constructor({baseURL:$=U2("ANTHROPIC_BASE_URL"),apiKey:Z=U2("ANTHROPIC_API_KEY")??null,authToken:X=U2("ANTHROPIC_AUTH_TOKEN")??null,...z}={}){zZ.add(this),o3.set(this,void 0);let J={apiKey:Z,authToken:X,...z,baseURL:$||"https://api.anthropic.com"};if(!J.dangerouslyAllowBrowser&&ZJ())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??X5.DEFAULT_TIMEOUT,this.logger=J.logger??console;let Q="warn";this.logLevel=Q,this.logLevel=$Z(J.logLevel,"ClientOptions.logLevel",this)??$Z(Q2("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??Q,this.fetchOptions=J.fetchOptions,this.maxRetries=J.maxRetries??2,this.fetch=J.fetch??XJ(),C(this,s6,JJ,"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 QJ($)}getUserAgent(){return`${this.constructor.name}/JS ${L$}`}defaultIdempotencyKey(){return`stainless-node-retry-${i3()}`}makeStatusError($,Z,X,z){return J0.generate($,Z,X,z)}buildURL($,Z,X){let z=!M(this,Z5,"m",dJ).call(this)&&X||this.baseURL,J=nz($)?new URL($):new URL(z+(z.endsWith("/")&&$.startsWith("/")?$.slice(1):$)),Q=this.defaultQuery(),Y=Object.fromEntries(J.searchParams);if(!s3(Q)||!s3(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 b("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 N$(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 W="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),G=X===void 0?"":`, retryOf: ${X}`,q=Date.now();if(K0(this).debug(`[${W}] sending request`,e0({retryOfRequestLogID:X,method:z.method,url:Y,options:z,headers:Q.headers})),z.signal?.aborted)throw new H0;let V=new AbortController,K=await this.fetchWithTimeout(Y,Q,U,V).catch(O4),H=Date.now();if(K instanceof globalThis.Error){let N=`retrying, ${Z} attempts remaining`;if(z.signal?.aborted)throw new H0;let _=t0(K)||/timed? ?out/i.test(String(K)+("cause"in K?String(K.cause):""));if(Z)return K0(this).info(`[${W}] connection ${_?"timed out":"failed"} - ${N}`),K0(this).debug(`[${W}] connection ${_?"timed out":"failed"} (${N})`,e0({retryOfRequestLogID:X,url:Y,durationMs:H-q,message:K.message})),this.retryRequest(z,Z,X??W);if(K0(this).info(`[${W}] connection ${_?"timed out":"failed"} - error; no more retries left`),K0(this).debug(`[${W}] connection ${_?"timed out":"failed"} (error; no more retries left)`,e0({retryOfRequestLogID:X,url:Y,durationMs:H-q,message:K.message})),_)throw new H1;throw new B$({cause:K})}let T=[...K.headers.entries()].filter(([N])=>N==="request-id").map(([N,_])=>", "+N+": "+JSON.stringify(_)).join(""),B=`[${W}${G}${T}] ${Q.method} ${Y} ${K.ok?"succeeded":"failed"} with status ${K.status} in ${H-q}ms`;if(!K.ok){let N=await this.shouldRetry(K);if(Z&&N){let E=`retrying, ${Z} attempts remaining`;return await zJ(K.body),K0(this).info(`${B} - ${E}`),K0(this).debug(`[${W}] response error (${E})`,e0({retryOfRequestLogID:X,url:K.url,status:K.status,headers:K.headers,durationMs:H-q})),this.retryRequest(z,Z,X??W,K.headers)}let _=N?"error; no more retries left":"error; not retryable";K0(this).info(`${B} - ${_}`);let w=await K.text().catch((E)=>O4(E).message),j=R6(w),k=j?void 0:w;throw K0(this).debug(`[${W}] response error (${_})`,e0({retryOfRequestLogID:X,url:K.url,status:K.status,headers:K.headers,message:k,durationMs:Date.now()-q})),this.makeStatusError(K.status,j,k,K.headers)}return K0(this).info(B),K0(this).debug(`[${W}] response start`,e0({retryOfRequestLogID:X,url:K.url,status:K.status,headers:K.headers,durationMs:H-q})),{response:K,options:z,controller:V,requestLogID:W,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 F4(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 W=setTimeout(U,X),G=globalThis.ReadableStream&&Y.body instanceof globalThis.ReadableStream||typeof Y.body==="object"&&Y.body!==null&&Symbol.asyncIterator in Y.body,q={signal:z.signal,...G?{duplex:"half"}:{},method:"GET",...Y};if(Q)q.method=Q.toUpperCase();try{return await this.fetch.call(void 0,$,q)}finally{clearTimeout(W)}}async shouldRetry($){let Z=$.headers.get("x-should-retry");if(Z==="true")return!0;if(Z==="false")return!1;if($.status===408)return!0;if($.status===409)return!0;if($.status===429)return!0;if($.status>=500)return!0;return!1}async retryRequest($,Z,X,z){let J,Q=z?.get("retry-after-ms");if(Q){let 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 az(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 b("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)sz("timeout",X.timeout);X.timeout=X.timeout??this.timeout;let{bodyHeaders:W,body:G}=this.buildBody({options:X}),q=await this.buildHeaders({options:$,method:z,bodyHeaders:W,retryCount:Z});return{req:{method:z,headers:q,...X.signal&&{signal:X.signal},...globalThis.ReadableStream&&G instanceof globalThis.ReadableStream&&{duplex:"half"},...G&&{body:G},...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))}:{},...ZJ(),...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:F6($)};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 M(this,s6,"f").call(this,{body:$,headers:X})}}var Z5,X5,s6,dJ,z5="\\n\\nHuman:",J5="\\n\\nAssistant:",A$;var Q5=y(()=>{o0();k$();a3();YJ();O0();e();GZ();cJ();E6();dZ();$5();cZ();eZ();a3();r();C6();k$();X5=o,s6=new WeakMap,Z5=new WeakSet,dJ=function(){return this.baseURL!=="https://api.anthropic.com"};o.Anthropic=X5;o.HUMAN_PROMPT=z5;o.AI_PROMPT=J5;o.DEFAULT_TIMEOUT=600000;o.AnthropicError=b;o.APIError=J0;o.APIConnectionError=B$;o.APIConnectionTimeoutError=H1;o.APIUserAbortError=H0;o.NotFoundError=N1;o.ConflictError=O1;o.RateLimitError=D1;o.BadRequestError=B1;o.AuthenticationError=L1;o.InternalServerError=I1;o.PermissionDeniedError=M1;o.UnprocessableEntityError=T1;o.toFile=P4;A$=class A$ extends o{constructor(){super(...arguments);this.completions=new b1(this),this.messages=new m$(this),this.models=new y1(this),this.beta=new L0(this)}};A$.Completions=b1;A$.Messages=m$;A$.Models=y1;A$.Beta=L0});var pJ={};H5(pJ,{toFile:()=>P4,default:()=>A$,UnprocessableEntityError:()=>T1,RateLimitError:()=>D1,PermissionDeniedError:()=>M1,PagePromise:()=>F4,NotFoundError:()=>N1,InternalServerError:()=>I1,HUMAN_PROMPT:()=>z5,ConflictError:()=>O1,BaseAnthropic:()=>o,BadRequestError:()=>B1,AuthenticationError:()=>L1,AnthropicError:()=>b,Anthropic:()=>A$,APIUserAbortError:()=>H0,APIPromise:()=>N$,APIError:()=>J0,APIConnectionTimeoutError:()=>H1,APIConnectionError:()=>B$,AI_PROMPT:()=>J5});var lJ=y(()=>{Q5();GZ();E6();Q5();e();O0()});var j5=LQ(E5(),1),{program:oD,createCommand:tD,createArgument:eD,createOption:$I,CommanderError:ZI,InvalidArgumentError:XI,InvalidOptionArgumentError:zI,Command:S5,Argument:JI,Option:QI,Help:YI}=j5.default;import{readFileSync as c9,writeFileSync as zL,existsSync as u9}from"fs";import{join as m9,dirname as d9,basename as JL}from"path";import{execFileSync as QL}from"child_process";var DB=J3(),IB=Z4(),AB=c8(),M3=X4(),RB=u1(),V$=p(),FB=Y$(),_B=Z0(),PB=W$(),CB=G$(),_A=n2(),wB=H3(),EB=B3(),jB=L3(),a2=v9(),h9=v1();var SB=DB.Composer,xB=IB.Document,bB=AB.Schema,kB=M3.YAMLError,yB=M3.YAMLParseError,fB=M3.YAMLWarning,gB=RB.Alias,vB=V$.isAlias,hB=V$.isCollection,uB=V$.isDocument,mB=V$.isMap,cB=V$.isNode,dB=V$.isPair,pB=V$.isScalar,lB=V$.isSeq,iB=FB.Pair,nB=_B.Scalar,rB=PB.YAMLMap,sB=CB.YAMLSeq;var aB=wB.Lexer,oB=EB.LineCounter,tB=jB.Parser,i0=a2.parse,eB=a2.parseAllDocuments,$L=a2.parseDocument,N3=a2.stringify,ZL=h9.visit,XL=h9.visitAsync;function c($){let Z=c9($,"utf-8");return i0(Z)}function O3($){let Z=$._meta,X={...$};delete X._meta;let z=N3(X,{lineWidth:0});if(Z?.found&&Z.found.length>0){let J=Z.found.join(" + ");z=z.replace(/^(\s+type:\s+\S+)(\s*)$/m,(Q,Y,U)=>{if(U.includes("#"))return Q;return`${Y} # found: ${J}`})}return z}function s($,Z){zL($,O3(Z),"utf-8")}function h($){return c9($,"utf-8")}function p9($){return i0($)}function g($=process.cwd()){let Z=["project.faf",".faf"];for(let z of Z){let J=m9($,z);if(u9(J))return J}let X=d9($);if(X!==$)for(let z of Z){let J=m9(X,z);if(u9(J))return J}return null}function e$($,Z=process.cwd()){return QL("git",["-C",d9($),"rev-parse","--show-prefix"],{cwd:Z,encoding:"utf-8"}).trim()+JL($)}d();var $1=[{name:"TROPHY",indicator:`${q0("\uD83C\uDFC6")} ${q0("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${q0(R("★"))} ${q0("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${I("◆")} ${I("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${o2("◇")} ${o2("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${R("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${L("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${L("○")} RED`,threshold:1},{name:"WHITE",indicator:`${L("♡")}`,threshold:0}];function y0($){return $.indicator}function K$($){for(let Z of $1)if($>=Z.threshold)return Z;return $1[$1.length-1]}var D3=null;function G4(){if(D3)return D3;try{let $=D0("faf-scoring-kernel");return D3=$,$}catch{throw Error(`faf-scoring-kernel not installed.
204
+ `);this.baseURL=J.baseURL,this.timeout=J.timeout??JZ.DEFAULT_TIMEOUT,this.logger=J.logger??console;let Q="warn";this.logLevel=Q,this.logLevel=X5(J.logLevel,"ClientOptions.logLevel",this)??X5(U2("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??Q,this.fetchOptions=J.fetchOptions,this.maxRetries=J.maxRetries??2,this.fetch=J.fetch??zJ(),P(this,o3,QJ,"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 YJ($)}getUserAgent(){return`${this.constructor.name}/JS ${N$}`}defaultIdempotencyKey(){return`stainless-node-retry-${r8()}`}makeStatusError($,Z,X,z){return Q0.generate($,Z,X,z)}buildURL($,Z,X){let z=!M(this,zZ,"m",pJ).call(this)&&X||this.baseURL,J=rz($)?new URL($):new URL(z+(z.endsWith("/")&&$.startsWith("/")?$.slice(1):$)),Q=this.defaultQuery(),Y=Object.fromEntries(J.searchParams);if(!o8(Q)||!o8(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 T$(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 W="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),G=X===void 0?"":`, retryOf: ${X}`,q=Date.now();if(H0(this).debug(`[${W}] sending request`,$$({retryOfRequestLogID:X,method:z.method,url:Y,options:z,headers:Q.headers})),z.signal?.aborted)throw new B0;let V=new AbortController,K=await this.fetchWithTimeout(Y,Q,U,V).catch(D4),H=Date.now();if(K instanceof globalThis.Error){let N=`retrying, ${Z} attempts remaining`;if(z.signal?.aborted)throw new B0;let A=e0(K)||/timed? ?out/i.test(String(K)+("cause"in K?String(K.cause):""));if(Z)return H0(this).info(`[${W}] connection ${A?"timed out":"failed"} - ${N}`),H0(this).debug(`[${W}] connection ${A?"timed out":"failed"} (${N})`,$$({retryOfRequestLogID:X,url:Y,durationMs:H-q,message:K.message})),this.retryRequest(z,Z,X??W);if(H0(this).info(`[${W}] connection ${A?"timed out":"failed"} - error; no more retries left`),H0(this).debug(`[${W}] connection ${A?"timed out":"failed"} (error; no more retries left)`,$$({retryOfRequestLogID:X,url:Y,durationMs:H-q,message:K.message})),A)throw new L1;throw new M$({cause:K})}let T=[...K.headers.entries()].filter(([N])=>N==="request-id").map(([N,A])=>", "+N+": "+JSON.stringify(A)).join(""),B=`[${W}${G}${T}] ${Q.method} ${Y} ${K.ok?"succeeded":"failed"} with status ${K.status} in ${H-q}ms`;if(!K.ok){let N=await this.shouldRetry(K);if(Z&&N){let y=`retrying, ${Z} attempts remaining`;return await JJ(K.body),H0(this).info(`${B} - ${y}`),H0(this).debug(`[${W}] response error (${y})`,$$({retryOfRequestLogID:X,url:K.url,status:K.status,headers:K.headers,durationMs:H-q})),this.retryRequest(z,Z,X??W,K.headers)}let A=N?"error; no more retries left":"error; not retryable";H0(this).info(`${B} - ${A}`);let C=await K.text().catch((y)=>D4(y).message),w=_3(C),b=w?void 0:C;throw H0(this).debug(`[${W}] response error (${A})`,$$({retryOfRequestLogID:X,url:K.url,status:K.status,headers:K.headers,message:b,durationMs:Date.now()-q})),this.makeStatusError(K.status,w,b,K.headers)}return H0(this).info(B),H0(this).debug(`[${W}] response start`,$$({retryOfRequestLogID:X,url:K.url,status:K.status,headers:K.headers,durationMs:H-q})),{response:K,options:z,controller:V,requestLogID:W,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 P4(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 W=setTimeout(U,X),G=globalThis.ReadableStream&&Y.body instanceof globalThis.ReadableStream||typeof Y.body==="object"&&Y.body!==null&&Symbol.asyncIterator in Y.body,q={signal:z.signal,...G?{duplex:"half"}:{},method:"GET",...Y};if(Q)q.method=Q.toUpperCase();try{return await this.fetch.call(void 0,$,q)}finally{clearTimeout(W)}}async shouldRetry($){let Z=$.headers.get("x-should-retry");if(Z==="true")return!0;if(Z==="false")return!1;if($.status===408)return!0;if($.status===409)return!0;if($.status===429)return!0;if($.status>=500)return!0;return!1}async retryRequest($,Z,X,z){let J,Q=z?.get("retry-after-ms");if(Q){let 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 oz(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)az("timeout",X.timeout);X.timeout=X.timeout??this.timeout;let{bodyHeaders:W,body:G}=this.buildBody({options:X}),q=await this.buildHeaders({options:$,method:z,bodyHeaders:W,retryCount:Z});return{req:{method:z,headers:q,...X.signal&&{signal:X.signal},...globalThis.ReadableStream&&G instanceof globalThis.ReadableStream&&{duplex:"half"},...G&&{body:G},...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))}:{},...XJ(),...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:P3($)};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 M(this,o3,"f").call(this,{body:$,headers:X})}}var zZ,JZ,o3,pJ,QZ="\\n\\nHuman:",YZ="\\n\\nAssistant:",F$;var UZ=f(()=>{t0();f$();t8();UJ();O0();Z0();V5();dJ();S3();l5();XZ();p5();ZZ();t8();a();E3();f$();JZ=e,o3=new WeakMap,zZ=new WeakSet,pJ=function(){return this.baseURL!=="https://api.anthropic.com"};e.Anthropic=JZ;e.HUMAN_PROMPT=QZ;e.AI_PROMPT=YZ;e.DEFAULT_TIMEOUT=600000;e.AnthropicError=S;e.APIError=Q0;e.APIConnectionError=M$;e.APIConnectionTimeoutError=L1;e.APIUserAbortError=B0;e.NotFoundError=T1;e.ConflictError=D1;e.RateLimitError=A1;e.BadRequestError=M1;e.AuthenticationError=N1;e.InternalServerError=R1;e.PermissionDeniedError=O1;e.UnprocessableEntityError=I1;e.toFile=w4;F$=class F$ extends e{constructor(){super(...arguments);this.completions=new y1(this),this.messages=new d$(this),this.models=new g1(this),this.beta=new M0(this)}};F$.Completions=y1;F$.Messages=d$;F$.Models=g1;F$.Beta=M0});var lJ={};BZ(lJ,{toFile:()=>w4,default:()=>F$,UnprocessableEntityError:()=>I1,RateLimitError:()=>A1,PermissionDeniedError:()=>O1,PagePromise:()=>P4,NotFoundError:()=>T1,InternalServerError:()=>R1,HUMAN_PROMPT:()=>QZ,ConflictError:()=>D1,BaseAnthropic:()=>e,BadRequestError:()=>M1,AuthenticationError:()=>N1,AnthropicError:()=>S,Anthropic:()=>F$,APIUserAbortError:()=>B0,APIPromise:()=>T$,APIError:()=>Q0,APIConnectionTimeoutError:()=>L1,APIConnectionError:()=>M$,AI_PROMPT:()=>YZ});var iJ=f(()=>{UZ();V5();S3();UZ();Z0();O0()});var SZ=MQ(jZ(),1),{program:tD,createCommand:eD,createArgument:$I,createOption:ZI,CommanderError:XI,InvalidArgumentError:zI,InvalidOptionArgumentError:JI,Command:xZ,Argument:QI,Option:YI,Help:UI}=SZ.default;import{readFileSync as d9,writeFileSync as JL,existsSync as m9}from"fs";import{join as c9,dirname as p9,basename as QL}from"path";import{execFileSync as YL}from"child_process";var IB=Y8(),AB=z4(),RB=p6(),O8=J4(),FB=c1(),K$=l(),_B=U$(),PB=X0(),CB=G$(),wB=q$(),PA=s2(),EB=L8(),jB=M8(),SB=N8(),t2=h9(),u9=u1();var xB=IB.Composer,bB=AB.Document,kB=RB.Schema,yB=O8.YAMLError,fB=O8.YAMLParseError,gB=O8.YAMLWarning,vB=FB.Alias,hB=K$.isAlias,uB=K$.isCollection,mB=K$.isDocument,cB=K$.isMap,dB=K$.isNode,pB=K$.isPair,lB=K$.isScalar,iB=K$.isSeq,nB=_B.Pair,rB=PB.Scalar,sB=CB.YAMLMap,aB=wB.YAMLSeq;var oB=EB.Lexer,tB=jB.LineCounter,eB=SB.Parser,n0=t2.parse,$L=t2.parseAllDocuments,ZL=t2.parseDocument,T8=t2.stringify,XL=u9.visit,zL=u9.visitAsync;function d($){let Z=d9($,"utf-8");return n0(Z)}function D8($){let Z=$._meta,X={...$};delete X._meta;let z=T8(X,{lineWidth:0});if(Z?.found&&Z.found.length>0){let J=Z.found.join(" + ");z=z.replace(/^(\s+type:\s+\S+)(\s*)$/m,(Q,Y,U)=>{if(U.includes("#"))return Q;return`${Y} # found: ${J}`})}return z}function o($,Z){JL($,D8(Z),"utf-8")}function u($){return d9($,"utf-8")}function l9($){return n0($)}function v($=process.cwd()){let Z=["project.faf",".faf"];for(let z of Z){let J=c9($,z);if(m9(J))return J}let X=p9($);if(X!==$)for(let z of Z){let J=c9(X,z);if(m9(J))return J}return null}function Z1($,Z=process.cwd()){return YL("git",["-C",p9($),"rev-parse","--show-prefix"],{cwd:Z,encoding:"utf-8"}).trim()+QL($)}p();var X1=[{name:"TROPHY",indicator:`${V0("\uD83C\uDFC6")} ${V0("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${V0(R("★"))} ${V0("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${D("◆")} ${D("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${e2("◇")} ${e2("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${R("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${L("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${L("○")} RED`,threshold:1},{name:"WHITE",indicator:`${L("♡")}`,threshold:0}];function v0($){return $.indicator}function H$($){for(let Z of X1)if($>=Z.threshold)return Z;return X1[X1.length-1]}var A8=null;function V4(){if(A8)return A8;try{let $=I0("faf-scoring-kernel");return A8=$,$}catch{throw Error(`faf-scoring-kernel not installed.
205
205
 
206
206
  Run: npm install faf-scoring-kernel
207
- `)}}function U0($){return JSON.parse(G4().score_faf($))}function i9($){return G4().validate_faf($)}function t2($){return G4().compile_fafb($)}function n9($){return JSON.parse(G4().decompile_fafb($))}function r9(){return G4().sdk_version()}function V0($){return{score:$.score,tier:K$($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}function X0($){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?K$(J):$1[$1.length-1],populated:0,empty:0,ignored:0,active:0,total:0,slots:{},inherited:!0,represents:Y}}return V0(U0($))}d();d();import{existsSync as UL,readFileSync as WL,writeFileSync as GL,mkdirSync as qL}from"fs";import{join as s9}from"path";import{homedir as VL}from"os";var KL=95,HL=30,BL=3,a9=s9(VL(),".config","faf"),I3=s9(a9,"star-nudge"),LL="github.com/Wolfe-Jam/faf-cli";function ML($){if($.score<KL)return!1;if(!$.isTTY)return!1;if($.isCI||$.optedOut)return!1;if($.shownCount>=($.maxShows??BL))return!1;if($.lastShownMs!=null){let Z=($.throttleDays??HL)*86400000;if($.nowMs-$.lastShownMs<Z)return!1}return!0}function NL(){try{if(!UL(I3))return{shown:0,lastShownMs:null};let $=WL(I3,"utf-8").trim();if($.startsWith("{")){let X=JSON.parse($),z=X.last?Date.parse(X.last):NaN;return{shown:Number.isFinite(X.shown)?Number(X.shown):0,lastShownMs:Number.isFinite(z)?z:null}}let Z=Date.parse($);return{shown:1,lastShownMs:Number.isFinite(Z)?Z:null}}catch{return{shown:0,lastShownMs:null}}}function OL($,Z){try{qL(a9,{recursive:!0}),GL(I3,JSON.stringify({shown:$+1,last:new Date(Z).toISOString()}))}catch{}}function o9($){let Z=Date.now(),X=NL();if(!ML({score:$,isTTY:Boolean(process.stdout.isTTY),isCI:Boolean(process.env.CI),optedOut:Boolean(process.env.FAF_NO_NUDGE),shownCount:X.shown,lastShownMs:X.lastShownMs,nowMs:Z}))return;console.log(""),console.log(` ${q0("★")} ${L("Enjoying faf-cli? A star helps others find it:")} ${LL}`),OL(X.shown,Z)}function z0($,Z,X=!1){let z=y0($.tier),J=R(`${$.score}%`);if(console.log(`${z} ${J} ${L(`${$.populated}/${$.active} slots`)} ${L("—")} ${Z}`),$.tier.name==="TROPHY")console.log(L(" Trophy. AI never has to guess."));else if($.empty>0){let Q=Object.entries($.slots).filter(([,G])=>G==="empty").map(([G])=>G),Y=Q.slice(0,3).join(", "),U=Q.length>3?`, +${Q.length-3} more`:"",W=$.empty===1?"slot":"slots";console.log(L(` ${$.empty} ${W} from Trophy: ${Y}${U}`))}if(X)console.log(""),TL($);o9($.score)}function TL($){for(let[Z,X]of Object.entries($.slots)){let z=X==="populated"?I("●"):X==="slotignored"?L("—"):L("○");console.log(` ${z} ${X==="slotignored"?L(`${Z}: N/A`):Z}`)}}d();function e2($,Z={}){let X=$??g();if(!X)console.error(`Error: project.faf not found
207
+ `)}}function W0($){return JSON.parse(V4().score_faf($))}function n9($){return V4().validate_faf($)}function $3($){return V4().compile_fafb($)}function r9($){return JSON.parse(V4().decompile_fafb($))}function s9(){return V4().sdk_version()}function K0($){return{score:$.score,tier:H$($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}function z0($){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?H$(J):X1[X1.length-1],populated:0,empty:0,ignored:0,active:0,total:0,slots:{},inherited:!0,represents:Y}}return K0(W0($))}p();p();import{existsSync as WL,readFileSync as GL,writeFileSync as qL,mkdirSync as VL}from"fs";import{join as a9}from"path";import{homedir as KL}from"os";var HL=95,BL=30,LL=3,o9=a9(KL(),".config","faf"),R8=a9(o9,"star-nudge"),ML="github.com/Wolfe-Jam/faf-cli";function NL($){if($.score<HL)return!1;if(!$.isTTY)return!1;if($.isCI||$.optedOut)return!1;if($.shownCount>=($.maxShows??LL))return!1;if($.lastShownMs!=null){let Z=($.throttleDays??BL)*86400000;if($.nowMs-$.lastShownMs<Z)return!1}return!0}function OL(){try{if(!WL(R8))return{shown:0,lastShownMs:null};let $=GL(R8,"utf-8").trim();if($.startsWith("{")){let X=JSON.parse($),z=X.last?Date.parse(X.last):NaN;return{shown:Number.isFinite(X.shown)?Number(X.shown):0,lastShownMs:Number.isFinite(z)?z:null}}let Z=Date.parse($);return{shown:1,lastShownMs:Number.isFinite(Z)?Z:null}}catch{return{shown:0,lastShownMs:null}}}function TL($,Z){try{VL(o9,{recursive:!0}),qL(R8,JSON.stringify({shown:$+1,last:new Date(Z).toISOString()}))}catch{}}function t9($){let Z=Date.now(),X=OL();if(!NL({score:$,isTTY:Boolean(process.stdout.isTTY),isCI:Boolean(process.env.CI),optedOut:Boolean(process.env.FAF_NO_NUDGE),shownCount:X.shown,lastShownMs:X.lastShownMs,nowMs:Z}))return;console.log(""),console.log(` ${V0("★")} ${L("Enjoying faf-cli? A star helps others find it:")} ${ML}`),TL(X.shown,Z)}function J0($,Z,X=!1){let z=v0($.tier),J=R(`${$.score}%`);if(console.log(`${z} ${J} ${L(`${$.populated}/${$.active} slots`)} ${L("—")} ${Z}`),$.tier.name==="TROPHY")console.log(L(" Trophy. AI never has to guess."));else if($.empty>0){let Q=Object.entries($.slots).filter(([,G])=>G==="empty").map(([G])=>G),Y=Q.slice(0,3).join(", "),U=Q.length>3?`, +${Q.length-3} more`:"",W=$.empty===1?"slot":"slots";console.log(L(` ${$.empty} ${W} from Trophy: ${Y}${U}`))}if(X)console.log(""),DL($);t9($.score)}function DL($){for(let[Z,X]of Object.entries($.slots)){let z=X==="populated"?D("●"):X==="slotignored"?L("—"):L("○");console.log(` ${z} ${X==="slotignored"?L(`${Z}: N/A`):Z}`)}}p();function Z3($,Z={}){let X=$??v();if(!X)console.error(`Error: project.faf not found
208
208
 
209
- Run 'faf init' to create one.`),process.exit(2);let z=h(X),J=X0(z);if(Z.json){let Q=c(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(`${y0(J.tier)} ${R(`${J.score}%`)}`);return}z0(J,X,Z.verbose)}import{existsSync as gM}from"fs";import{join as NX}from"path";var a=[{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"}],Z1=new Map(a.flatMap(($)=>$.canonical?[[$.path,$],[$.canonical,$]]:[[$.path,$]])),tA=new Map(a.filter(($)=>$.canonical).map(($)=>[$.canonical,$.path])),eA=new Map(a.filter(($)=>$.canonical).map(($)=>[$.path,$.canonical]));function q4($,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 $R=a.filter(($)=>$.index<=21);var A3=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","n/a","not applicable"]);function A0($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return A3.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var X1={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 x,readFileSync as n0,readdirSync as $X}from"fs";import{join as S}from"path";var t9=[{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 e9,readFileSync as IL,readdirSync as AL}from"fs";import{join as R3}from"path";var z1={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 RL=z1.flutterDeps,FL=z1.mcpDeps,_L=z1.serverFrameworks,PL=z1.stateManagement,CL=z1.routing;function wL($){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 $6($){let Z=R3($,"pubspec.yaml");if(!e9(Z))return null;let X;try{X=IL(Z,"utf-8")}catch{return null}let z=wL(X),J=(j)=>z.has(j.toLowerCase()),Q=RL.some(J)||/^flutter:\s*$/m.test(X)||/\bsdk:\s*flutter\b/.test(X),Y=FL.find(J),U=_L.find(([j])=>J(j)),W=PL.find(([j])=>J(j)),G=W?W[1]:"",q=CL.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=AL(R3($,"bin")).some((j)=>j.endsWith(".dart"))}catch{}let B=H||T,N,_="",w;if(Q)if(_="Flutter",e9(R3($,"lib","main.dart"))||/^publish_to:\s*['"]?none\b/m.test(X))N="mobile",w="pubspec.yaml (Flutter app)";else N="library",w="pubspec.yaml (Flutter package)";else if(Y)N="mcp",w=`pubspec.yaml + ${Y} (Dart MCP server)`;else if(U)N="backend",_=U[1],w=`pubspec.yaml + ${U[0]} (Dart backend)`;else if(B)N="cli",w=H?"pubspec.yaml executables: (Dart CLI)":"pubspec.yaml + bin/*.dart (Dart CLI)";else N="library",w="pubspec.yaml (Dart package)";return{appType:N,isFlutter:Q,framework:_,stateManagement:G,routing:V,testing:K,found:w}}function EL($){let Z=S($,"Cargo.toml");if(!x(Z))return null;try{let z=n0(Z,"utf-8").match(/^\s*\[package\][\s\S]*?^\s*name\s*=\s*"([^"]+)"/m);return z?z[1]:null}catch{return null}}function jL($){let Z=S($,"Cargo.toml");if(!x(Z))return!1;try{let X=n0(Z,"utf-8");return/^\s*\[\[bin\]\]/m.test(X)}catch{return!1}}function SL($,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=EL($);if(X&&/(?:^|[-_])sdk(?:[-_]|$)/i.test(X))return`Cargo.toml name "${X}" → sdk`;return null}function xL($){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=S($,X);if(!x(z))continue;try{let J=JSON.parse(n0(z,"utf-8"));if(typeof J.manifest_version==="number")return`${X} manifest_version ${J.manifest_version} (browser extension)`}catch{}}return null}function bL($){let Z=/(numpy|pandas|jupyter|scikit-learn|sklearn|pytorch|tensorflow|matplotlib|scipy)/i,X=S($,"pyproject.toml");if(x(X))try{let Q=n0(X,"utf-8").match(Z);if(Q)return`pyproject.toml depends on ${Q[1]}`}catch{}let z=S($,"requirements.txt");if(x(z))try{let Q=n0(z,"utf-8").match(Z);if(Q)return`requirements.txt contains ${Q[1]}`}catch{}return null}function kL($,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(x(S($,"ios"))&&x(S($,"android")))return"ios/ + android/ dirs";return null}function yL($,Z){let X=S($,"Cargo.toml");if(x(X))try{let J=n0(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=S($,"build.zig");if(x(z))try{let J=n0(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 fL($,Z){if(!x(S($,"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 gL($,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 vL($,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 hL($,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 uL($,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 mL($,Z){if(!Z?.private)return null;if(!(!!Z.workspaces||x(S($,"pnpm-workspace.yaml"))))return null;return"private workspace + multi-package"}function j$($){let Z=S($,"package.json");if(!x(Z))return null;try{return JSON.parse(n0(Z,"utf-8"))}catch{return null}}function cL($,Z){if(!Z.includes("*"))return x(S($,Z));let X=Z.split("/");if(X.length===1){let U=Z.split("*")[0];try{return $X($).some((W)=>W.startsWith(U))}catch{return!1}}let z=S($,...X.slice(0,-1)),J=X[X.length-1],Q=J.split("*")[0],Y=J.split("*")[1]||"";try{return $X(z).some((U)=>U.startsWith(Q)&&U.endsWith(Y))}catch{return!1}}function dL($,Z,X){switch($.type){case"dependency":return!!Z?.dependencies?.[$.key];case"devDependency":return!!Z?.devDependencies?.[$.key];case"file":return cL(X,$.pattern);default:return!1}}function F3($){let Z=j$($);return t9.map((X)=>{let J=X.signals.filter((Q)=>dL(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 ZX($){let Z=j$($);if(Z?.devDependencies?.typescript||Z?.dependencies?.typescript)return"TypeScript";if(x(S($,"tsconfig.json")))return"TypeScript";if(x(S($,"Cargo.toml")))return"Rust";if(x(S($,"go.mod")))return"Go";if(x(S($,"pyproject.toml"))||x(S($,"setup.py")))return"Python";if(x(S($,"Gemfile")))return"Ruby";if(x(S($,"pom.xml"))||x(S($,"build.gradle")))return"Java";if(x(S($,"Package.swift")))return"Swift";if(x(S($,"build.zig")))return"Zig";if(x(S($,"pubspec.yaml")))return"Dart";if(Z)return"JavaScript";return"Unknown"}function XX($){let Z=j$($),X=F3($),z=[],J=gL($,Z);if(J)return z.push(J),{type:"documentation",found:z};let Q=SL($,Z);if(Q)return z.push(Q),{type:"sdk",found:z};let Y=xL($);if(Y)return z.push(Y),{type:"extension",found:z};let U=uL($,Z,X);if(U)return z.push(U),{type:"mcpaas",found:z};let W=hL($,Z);if(W)return z.push(W),{type:"saas",found:z};let G=yL($,Z);if(G)return z.push(G),{type:"wasm",found:z};let q=$6($);if(q)return z.push(q.found),{type:q.appType,found:z};let V=kL($,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(jL($))return z.push("Cargo.toml [[bin]]"),{type:"cli",found:z};if(x(S($,"build.zig"))){if(z.push("build.zig"),x(S($,"src/main.zig")))return z.push("src/main.zig"),{type:"cli",found:z};if(x(S($,"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&&(x(S($,"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 B=X.some((A)=>A.category==="frontend"),N=X.some((A)=>A.category==="backend");if(Z?.private&&(Z.workspaces||x(S($,"pnpm-workspace.yaml")))&&B&&N)return z.push("private workspace + frontend + backend frameworks"),{type:"enterprise",found:z};let _=mL($,Z);if(_)return z.push(_),{type:"monorepo-root",found:z};let w=vL($,Z,X);if(w)return z.push(w),{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 k=X.some((A)=>A.category==="frontend"),D=X.some((A)=>A.category==="backend");if(k&&D)return z.push("frontend framework","backend framework"),{type:"fullstack",found:z};if(k)return z.push("frontend framework"),{type:"frontend",found:z};if(D)return z.push("backend framework"),{type:"backend",found:z};let E=bL($);if(E)return z.push(E),{type:"data-science",found:z};let u=fL($,Z);if(u)return z.push(u),{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 zX($){if(x(S($,"bunfig.toml")))return"Bun";if(x(S($,"deno.json"))||x(S($,"deno.jsonc")))return"Deno";if(j$($))return"Node.js";if(x(S($,"Cargo.toml")))return"Rust";if(x(S($,"go.mod")))return"Go";if(x(S($,"pubspec.yaml")))return"Dart";return"Unknown"}function JX($){if(x(S($,"pubspec.yaml")))return"pub";if(x(S($,"bun.lockb"))||x(S($,"bun.lock")))return"bun";if(x(S($,"pnpm-lock.yaml")))return"pnpm";if(x(S($,"yarn.lock")))return"yarn";if(x(S($,"package-lock.json")))return"npm";return"npm"}function QX($){if(x(S($,".github/workflows")))return"GitHub Actions";if(x(S($,".gitlab-ci.yml")))return"GitLab CI";if(x(S($,".circleci")))return"CircleCI";if(x(S($,"Jenkinsfile")))return"Jenkins";return null}function YX($){if(x(S($,"vercel.json")))return"Vercel";if(x(S($,"netlify.toml")))return"Netlify";if(x(S($,"wrangler.toml")))return"Cloudflare";if(x(S($,"Dockerfile")))return"Docker";if(x(S($,"fly.toml")))return"Fly.io";if(x(S($,"render.yaml")))return"Render";return null}function UX($){let Z=S($,"svelte.config.js");if(!x(Z))return null;try{let z=n0(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 WX($){let Z=j$($);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(x(S($,"tsconfig.json"))&&Z?.devDependencies?.typescript)return"TypeScript (tsc)";return null}function Z6($){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)=>x(S($,X)))}function X6($,Z){let X={};if(Z?.scripts){for(let z of["build","test","lint","dev","start"])if(Z.scripts[z]){let J=x(S($,"bun.lock"))||x(S($,"bun.lockb"))?"bun run":"npm run";X[z]=`${J} ${z}`}}if(x(S($,"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(x(S($,"build.zig"))){if(!X.build)X.build="zig build";if(!X.test)X.test="zig build test"}if(x(S($,"go.mod"))){if(!X.build)X.build="go build ./...";if(!X.test)X.test="go test ./..."}if(x(S($,"pyproject.toml"))||x(S($,"pytest.ini"))){if(!X.test)X.test="pytest"}return X}function GX($,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(x(S($,"bunfig.toml")))J.push("Bun");else if(x(S($,"deno.json"))||x(S($,"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((W)=>W.toLowerCase().includes(U.toLowerCase())))J.push(U)}return J}function z6($){let Z=j$($),X=F3($),z=ZX($),J=XX($),Q=J.type,Y=zX($),U=JX($),W=QX($),G=YX($),q=WX($),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"),B=X.find((n)=>n.category==="backend"),N=X.find((n)=>n.category==="database"),_=X1[Q]||X1.library,w=Q==="framework",j=X.some((n)=>n.slug==="svelte"||n.slug==="sveltekit"),k=w&&j?"svelte":w?null:null,D=Q==="svelte"||k==="svelte",E=D?UX($):null,u=D&&X.some((n)=>n.slug==="sveltekit"),A=new Set(["css_framework","ui_library","database","connection","hosting"]),m={},v0=a.filter((n)=>n.path.startsWith("stack."));for(let n of v0){let t=n.path.replace("stack.","");if(!_.includes(n.category)){m[t]="slotignored";continue}if(w&&A.has(t)){m[t]="slotignored";continue}switch(t){case"frontend":m[t]=V?.name??(Q==="cli"?"CLI":"");break;case"css_framework":m[t]=K?.name??"";break;case"ui_library":m[t]=H?.name??"";break;case"state_management":m[t]=D?T?.name??"Runes":T?.name??"";break;case"backend":m[t]=D?u?"SvelteKit":B?.name??"":B?.name??"";break;case"api_type":m[t]=u?"Server Routes":"";break;case"runtime":m[t]=Y!=="Unknown"?Y:"";break;case"database":m[t]=N?.name??"";break;case"connection":m[t]=N?.name??"";break;case"hosting":if(D&&E)m[t]=E;else m[t]=G??"";break;case"build":m[t]=D?"Vite":q??"";break;case"cicd":m[t]=W??"";break;case"package_manager":m[t]=U;break;default:m[t]="";break}}let h0={},$0=a.filter((n)=>n.path.startsWith("monorepo."));for(let n of $0){let t=n.path.replace("monorepo.","");if(!_.includes(n.category))h0[t]="slotignored";else h0[t]=""}let f1={name:Z?.name??$.split("/").pop()??"project",goal:Z?.description??"",main_language:z,type:Q};if(w&&k)f1.framework=k;let q5=GX($,Z,X,z),V5=Z6($),K5=X6($,Z),U2={faf_version:"2.5.0",project:f1,stack:m,human_context:{who:"",what:Z?.description??"",why:"",where:"",when:"",how:""},monorepo:h0,_meta:{found:J.found}};if(q5.length>0)U2.tech_stack=q5;if(V5.length>0)U2.key_files=V5;if(Object.keys(K5).length>0)U2.commands=K5;return U2}import{existsSync as lL,readFileSync as iL}from"fs";import{join as nL}from"path";var qX={MIN_LENGTH:8,MAX_LENGTH:280},pL=[/^(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 f0($){let Z=$.trim();if(Z.length<qX.MIN_LENGTH)return!1;if(Z.length>qX.MAX_LENGTH)return!1;if(pL.some((X)=>X.test(Z)))return!1;if(/^[\s|\-*+]/.test(Z))return!1;if(Z.split(`
211
- `).length>4)return!1;return!0}function rL($){let Z=$.split(`
209
+ Run 'faf init' to create one.`),process.exit(2);let z=u(X),J=z0(z);if(Z.json){let Q=d(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(`${v0(J.tier)} ${R(`${J.score}%`)}`);return}J0(J,X,Z.verbose)}import{existsSync as vM}from"fs";import{join as OX}from"path";var t=[{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"}],z1=new Map(t.flatMap(($)=>$.canonical?[[$.path,$],[$.canonical,$]]:[[$.path,$]])),eA=new Map(t.filter(($)=>$.canonical).map(($)=>[$.canonical,$.path])),$R=new Map(t.filter(($)=>$.canonical).map(($)=>[$.path,$.canonical]));function K4($,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 ZR=t.filter(($)=>$.index<=21);var F8=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","n/a","not applicable"]);function R0($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return F8.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var J1={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"]};var B$="3.0";import{existsSync as j,readFileSync as r0,readdirSync as ZX}from"fs";import{join as E}from"path";var e9=[{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 $X,readFileSync as AL,readdirSync as RL}from"fs";import{join as _8}from"path";var Q1={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 FL=Q1.flutterDeps,_L=Q1.mcpDeps,PL=Q1.serverFrameworks,CL=Q1.stateManagement,wL=Q1.routing;function EL($){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 X3($){let Z=_8($,"pubspec.yaml");if(!$X(Z))return null;let X;try{X=AL(Z,"utf-8")}catch{return null}let z=EL(X),J=(w)=>z.has(w.toLowerCase()),Q=FL.some(J)||/^flutter:\s*$/m.test(X)||/\bsdk:\s*flutter\b/.test(X),Y=_L.find(J),U=PL.find(([w])=>J(w)),W=CL.find(([w])=>J(w)),G=W?W[1]:"",q=wL.find(([w])=>J(w)),V=q?q[1]:"",K=J("flutter_test")?"flutter_test":J("test")?"test":"",H=/^executables:\s*$/m.test(X),T=!1;try{T=RL(_8($,"bin")).some((w)=>w.endsWith(".dart"))}catch{}let B=H||T,N,A="",C;if(Q)if(A="Flutter",$X(_8($,"lib","main.dart"))||/^publish_to:\s*['"]?none\b/m.test(X))N="mobile",C="pubspec.yaml (Flutter app)";else N="library",C="pubspec.yaml (Flutter package)";else if(Y)N="mcp",C=`pubspec.yaml + ${Y} (Dart MCP server)`;else if(U)N="backend",A=U[1],C=`pubspec.yaml + ${U[0]} (Dart backend)`;else if(B)N="cli",C=H?"pubspec.yaml executables: (Dart CLI)":"pubspec.yaml + bin/*.dart (Dart CLI)";else N="library",C="pubspec.yaml (Dart package)";return{appType:N,isFlutter:Q,framework:A,stateManagement:G,routing:V,testing:K,found:C}}function jL($){let Z=E($,"Cargo.toml");if(!j(Z))return null;try{let z=r0(Z,"utf-8").match(/^\s*\[package\][\s\S]*?^\s*name\s*=\s*"([^"]+)"/m);return z?z[1]:null}catch{return null}}function SL($){let Z=E($,"Cargo.toml");if(!j(Z))return!1;try{let X=r0(Z,"utf-8");return/^\s*\[\[bin\]\]/m.test(X)}catch{return!1}}function xL($,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=jL($);if(X&&/(?:^|[-_])sdk(?:[-_]|$)/i.test(X))return`Cargo.toml name "${X}" → sdk`;return null}function bL($){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=E($,X);if(!j(z))continue;try{let J=JSON.parse(r0(z,"utf-8"));if(typeof J.manifest_version==="number")return`${X} manifest_version ${J.manifest_version} (browser extension)`}catch{}}return null}function kL($){let Z=/(numpy|pandas|jupyter|scikit-learn|sklearn|pytorch|tensorflow|matplotlib|scipy)/i,X=E($,"pyproject.toml");if(j(X))try{let Q=r0(X,"utf-8").match(Z);if(Q)return`pyproject.toml depends on ${Q[1]}`}catch{}let z=E($,"requirements.txt");if(j(z))try{let Q=r0(z,"utf-8").match(Z);if(Q)return`requirements.txt contains ${Q[1]}`}catch{}return null}function yL($,Z){let X=["react-native","expo","@capacitor/core","@ionic/core"];if(Z){for(let z of X)if(Z.dependencies?.[z]||Z.devDependencies?.[z])return`${z} dependency`}if(j(E($,"ios"))&&j(E($,"android")))return"ios/ + android/ dirs";return null}function fL($,Z){let X=E($,"Cargo.toml");if(j(X))try{let J=r0(X,"utf-8");if(/crate-type\s*=\s*\[[^\]]*"cdylib"/.test(J))return'Cargo.toml crate-type = ["cdylib"]';if(/wasm-bindgen|wasm-pack/i.test(J))return"Cargo.toml wasm-bindgen/wasm-pack"}catch{}let z=E($,"build.zig");if(j(z))try{let J=r0(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 gL($,Z){if(!j(E($,"index.html")))return null;if(Z?.dependencies||Z?.devDependencies){let X={...Z.dependencies??{},...Z.devDependencies??{}};if(["react","vue","svelte","@sveltejs/kit","next","nuxt","astro","gatsby","solid-js","qwik"].some((J)=>X[J]))return null}return"index.html (vanilla, no frontend framework)"}function vL($,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 hL($,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 uL($,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 mL($,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 cL($,Z){if(!Z?.private)return null;if(!(!!Z.workspaces||j(E($,"pnpm-workspace.yaml"))))return null;return"private workspace + multi-package"}function x$($){let Z=E($,"package.json");if(!j(Z))return null;try{return JSON.parse(r0(Z,"utf-8"))}catch{return null}}function dL($,Z){if(!Z.includes("*"))return j(E($,Z));let X=Z.split("/");if(X.length===1){let U=Z.split("*")[0];try{return ZX($).some((W)=>W.startsWith(U))}catch{return!1}}let z=E($,...X.slice(0,-1)),J=X[X.length-1],Q=J.split("*")[0],Y=J.split("*")[1]||"";try{return ZX(z).some((U)=>U.startsWith(Q)&&U.endsWith(Y))}catch{return!1}}function pL($,Z,X){switch($.type){case"dependency":return!!Z?.dependencies?.[$.key];case"devDependency":return!!Z?.devDependencies?.[$.key];case"file":return dL(X,$.pattern);default:return!1}}function P8($){let Z=x$($);return e9.map((X)=>{let J=X.signals.filter((Q)=>pL(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 XX($){let Z=x$($);if(Z?.devDependencies?.typescript||Z?.dependencies?.typescript)return"TypeScript";if(j(E($,"tsconfig.json")))return"TypeScript";if(j(E($,"Cargo.toml")))return"Rust";if(j(E($,"go.mod")))return"Go";if(j(E($,"pyproject.toml"))||j(E($,"setup.py")))return"Python";if(j(E($,"Gemfile")))return"Ruby";if(j(E($,"pom.xml"))||j(E($,"build.gradle")))return"Java";if(j(E($,"Package.swift")))return"Swift";if(j(E($,"build.zig")))return"Zig";if(j(E($,"pubspec.yaml")))return"Dart";if(Z)return"JavaScript";return"Unknown"}function zX($){let Z=x$($),X=P8($),z=[],J=vL($,Z);if(J)return z.push(J),{type:"documentation",found:z};let Q=xL($,Z);if(Q)return z.push(Q),{type:"sdk",found:z};let Y=bL($);if(Y)return z.push(Y),{type:"extension",found:z};let U=mL($,Z,X);if(U)return z.push(U),{type:"mcpaas",found:z};let W=uL($,Z);if(W)return z.push(W),{type:"saas",found:z};let G=fL($,Z);if(G)return z.push(G),{type:"wasm",found:z};let q=X3($);if(q)return z.push(q.found),{type:q.appType,found:z};let V=yL($,Z);if(V)return z.push(V),{type:"mobile",found:z};if(X.some((I)=>I.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(SL($))return z.push("Cargo.toml [[bin]]"),{type:"cli",found:z};if(j(E($,"build.zig"))){if(z.push("build.zig"),j(E($,"src/main.zig")))return z.push("src/main.zig"),{type:"cli",found:z};if(j(E($,"src/root.zig")))return z.push("src/root.zig"),{type:"library",found:z}}let H=X.some((I)=>I.slug==="svelte"||I.slug==="sveltekit");if(Z?.private===!0&&(j(E($,"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 B=X.some((I)=>I.category==="frontend"),N=X.some((I)=>I.category==="backend");if(Z?.private&&(Z.workspaces||j(E($,"pnpm-workspace.yaml")))&&B&&N)return z.push("private workspace + frontend + backend frameworks"),{type:"enterprise",found:z};let A=cL($,Z);if(A)return z.push(A),{type:"monorepo-root",found:z};let C=hL($,Z,X);if(C)return z.push(C),{type:"website",found:z};if(X.some((I)=>I.slug==="nextjs"||I.slug==="nuxt"))return z.push(X.find((I)=>I.slug==="nextjs")?"Next.js":"Nuxt"),{type:"fullstack",found:z};let b=X.some((I)=>I.category==="frontend"),k=X.some((I)=>I.category==="backend");if(b&&k)return z.push("frontend framework","backend framework"),{type:"fullstack",found:z};if(b)return z.push("frontend framework"),{type:"frontend",found:z};if(k)return z.push("backend framework"),{type:"backend",found:z};let y=kL($);if(y)return z.push(y),{type:"data-science",found:z};let i=gL($,Z);if(i)return z.push(i),{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 JX($){if(j(E($,"bunfig.toml")))return"Bun";if(j(E($,"deno.json"))||j(E($,"deno.jsonc")))return"Deno";if(x$($))return"Node.js";if(j(E($,"Cargo.toml")))return"Rust";if(j(E($,"go.mod")))return"Go";if(j(E($,"pubspec.yaml")))return"Dart";return"Unknown"}function QX($){if(j(E($,"pubspec.yaml")))return"pub";if(j(E($,"bun.lockb"))||j(E($,"bun.lock")))return"bun";if(j(E($,"pnpm-lock.yaml")))return"pnpm";if(j(E($,"yarn.lock")))return"yarn";if(j(E($,"package-lock.json")))return"npm";return"npm"}function YX($){if(j(E($,".github/workflows")))return"GitHub Actions";if(j(E($,".gitlab-ci.yml")))return"GitLab CI";if(j(E($,".circleci")))return"CircleCI";if(j(E($,"Jenkinsfile")))return"Jenkins";return null}function UX($){if(j(E($,"vercel.json")))return"Vercel";if(j(E($,"netlify.toml")))return"Netlify";if(j(E($,"wrangler.toml")))return"Cloudflare";if(j(E($,"Dockerfile")))return"Docker";if(j(E($,"fly.toml")))return"Fly.io";if(j(E($,"render.yaml")))return"Render";return null}function WX($){let Z=E($,"svelte.config.js");if(!j(Z))return null;try{let z=r0(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 GX($){let Z=x$($);if(Z?.devDependencies?.vite||Z?.dependencies?.vite)return"Vite";if(Z?.devDependencies?.webpack||Z?.dependencies?.webpack)return"webpack";if(Z?.devDependencies?.esbuild||Z?.dependencies?.esbuild)return"esbuild";if(j(E($,"tsconfig.json"))&&Z?.devDependencies?.typescript)return"TypeScript (tsc)";return null}function z3($){return["package.json","Cargo.toml","pyproject.toml","go.mod","build.zig","build.zig.zon","src/index.ts","src/index.js","src/main.ts","src/cli.ts","src/main.rs","src/lib.rs","src/main.zig","src/root.zig","src/__init__.py","main.py","__main__.py","main.go","cmd/main.go","README.md","SPECIFICATION.md","BINARY-FORMAT.md","tsconfig.json","wrangler.toml","vercel.json"].filter((X)=>j(E($,X)))}function J3($,Z){let X={};if(Z?.scripts){for(let z of["build","test","lint","dev","start"])if(Z.scripts[z]){let J=j(E($,"bun.lock"))||j(E($,"bun.lockb"))?"bun run":"npm run";X[z]=`${J} ${z}`}}if(j(E($,"Cargo.toml"))){if(!X.build)X.build="cargo build --release";if(!X.test)X.test="cargo test";if(!X.lint)X.lint="cargo clippy"}if(j(E($,"build.zig"))){if(!X.build)X.build="zig build";if(!X.test)X.test="zig build test"}if(j(E($,"go.mod"))){if(!X.build)X.build="go build ./...";if(!X.test)X.test="go test ./..."}if(j(E($,"pyproject.toml"))||j(E($,"pytest.ini"))){if(!X.test)X.test="pytest"}return X}function qX($,Z,X,z){let J=[];if(z&&z!=="Unknown")J.push(z);let Q=new Set(["frontend","backend","database","build","css","state","monorepo"]);for(let Y of X)if(Q.has(Y.category))J.push(Y.name);if(j(E($,"bunfig.toml")))J.push("Bun");else if(j(E($,"deno.json"))||j(E($,"deno.jsonc")))J.push("Deno");if(J.length<3&&Z?.dependencies){let Y=Object.keys(Z.dependencies).slice(0,5);for(let U of Y)if(!J.some((W)=>W.toLowerCase().includes(U.toLowerCase())))J.push(U)}return J}function Q3($){let Z=x$($),X=P8($),z=XX($),J=zX($),Q=J.type,Y=JX($),U=QX($),W=YX($),G=UX($),q=GX($),V=X.find((s)=>s.category==="frontend"),K=X.find((s)=>s.category==="css"),H=X.find((s)=>s.category==="ui"),T=X.find((s)=>s.category==="state"),B=X.find((s)=>s.category==="backend"),N=X.find((s)=>s.category==="database"),A=J1[Q]||J1.library,C=Q==="framework",w=X.some((s)=>s.slug==="svelte"||s.slug==="sveltekit"),b=C&&w?"svelte":C?null:null,k=Q==="svelte"||b==="svelte",y=k?WX($):null,i=k&&X.some((s)=>s.slug==="sveltekit"),I=new Set(["css_framework","ui_library","database","connection","hosting"]),m={},D0=t.filter((s)=>s.path.startsWith("stack."));for(let s of D0){let $0=s.path.replace("stack.","");if(!A.includes(s.category)){m[$0]="slotignored";continue}if(C&&I.has($0)){m[$0]="slotignored";continue}switch($0){case"frontend":m[$0]=V?.name??(Q==="cli"?"CLI":"");break;case"css_framework":m[$0]=K?.name??"";break;case"ui_library":m[$0]=H?.name??"";break;case"state_management":m[$0]=k?T?.name??"Runes":T?.name??"";break;case"backend":m[$0]=k?i?"SvelteKit":B?.name??"":B?.name??"";break;case"api_type":m[$0]=i?"Server Routes":"";break;case"runtime":m[$0]=Y!=="Unknown"?Y:"";break;case"database":m[$0]=N?.name??"";break;case"connection":m[$0]=N?.name??"";break;case"hosting":if(k&&y)m[$0]=y;else m[$0]=G??"";break;case"build":m[$0]=k?"Vite":q??"";break;case"cicd":m[$0]=W??"";break;case"package_manager":m[$0]=U;break;default:m[$0]="";break}}let x={},c=t.filter((s)=>s.path.startsWith("monorepo."));for(let s of c){let $0=s.path.replace("monorepo.","");if(!A.includes(s.category))x[$0]="slotignored";else x[$0]=""}let y0={name:Z?.name??$.split("/").pop()??"project",goal:Z?.description??"",main_language:z,type:Q};if(C&&b)y0.framework=b;let v1=qX($,Z,X,z),KZ=z3($),HZ=J3($,Z),G2={faf_version:B$,project:y0,stack:m,human_context:{who:"",what:Z?.description??"",why:"",where:"",when:"",how:""},monorepo:x,_meta:{found:J.found}};if(v1.length>0)G2.tech_stack=v1;if(KZ.length>0)G2.key_files=KZ;if(Object.keys(HZ).length>0)G2.commands=HZ;return G2}import{existsSync as iL,readFileSync as nL}from"fs";import{join as rL}from"path";var VX={MIN_LENGTH:8,MAX_LENGTH:280},lL=[/^(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 h0($){let Z=$.trim();if(Z.length<VX.MIN_LENGTH)return!1;if(Z.length>VX.MAX_LENGTH)return!1;if(lL.some((X)=>X.test(Z)))return!1;if(/^[\s|\-*+]/.test(Z))return!1;if(Z.split(`
211
+ `).length>4)return!1;return!0}function sL($){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 sL($){let X=rL($).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 S$($,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 W=X[z].trim(),G=W.match(/^(#{1,6})\s+/);if(G&&G[1].length<=Y)break;if(W===""){if(U.length>0)break;z++;continue}if(/^(>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(W))break;U.push(W),z++}if(U.length===0)return null;return U.join(" ").trim()}z++}return null}function aL($){let Z=S$($,/^(use\s+cases?|goal)\b/i);if(Z&&f0(Z))return Z;let X=sL($);if(X&&f0(X))return X;return}function oL($){let Z=S$($,/^(about|description|overview|what(\s+is\s+this)?)\b/i);if(Z&&f0(Z))return Z;return}function tL($){let Z=S$($,/^(audience|users?|for\s+whom|who(\s+is\s+this\s+for)?)\b/i);if(Z&&f0(Z))return Z;return}function eL($){let Z=S$($,/^(why|motivation|problem|rationale)\b/i);if(Z&&f0(Z))return Z;return}function $M($){let Z=S$($,/^(deployment|where(\s+it\s+runs)?|hosting)\b/i);if(Z&&f0(Z))return Z;return}function ZM($){let Z=S$($,/^(status|history|timeline|since|launched)\b/i);if(Z&&f0(Z))return Z;return}function XM($){let Z=S$($,/^(architecture|how(\s+it\s+works)?|approach|design)\b/i);if(Z&&f0(Z))return Z;return}function _3($){let Z=["README.md","README.MD","Readme.md","readme.md"],X=null;for(let H of Z){let T=nL($,H);if(lL(T)){X=T;break}}if(!X)return{};let z;try{z=iL(X,"utf-8")}catch{return{}}let J={},Q=aL(z);if(Q)J.project={goal:Q};let Y={},U=oL(z);if(U)Y.what=U;let W=tL(z);if(W)Y.who=W;let G=eL(z);if(G)Y.why=G;let q=$M(z);if(q)Y.where=q;let V=ZM(z);if(V)Y.when=V;let K=XM(z);if(K)Y.how=K;if(Object.keys(Y).length>0)J.human_context=Y;return J}import{existsSync as zM,readFileSync as JM}from"fs";import{join as QM}from"path";function YM($,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 W=U.match(/^"((?:[^"\\]|\\.)*)"$/)||U.match(/^'((?:[^'\\]|\\.)*)'$/);if(W)return W[1];return U}}return null}function P3($){let Z=QM($,"Cargo.toml");if(!zM(Z))return{};let X;try{X=JM(Z,"utf-8")}catch{return{}}let z=YM(X,"description");if(z&&f0(z))return{project:{goal:z}};return{}}function UM($,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 J6($){return UM(_3($),P3($))}import{existsSync as WM,readdirSync as VX,readFileSync as GM}from"fs";import{join as w3,dirname as qM,extname as VM,resolve as KM}from"path";var C3={"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 HM=new Set(["node_modules",".git","dist","build","venv",".venv","__pycache__","target","coverage",".next",".svelte-kit","vendor"]),BM=new Set([".py",".ts",".tsx",".js",".jsx",".svelte",".vue",".rb",".go",".rs",".php",".java",".kt",".swift"]),LM={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"]},MM=[["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 NM($,Z){for(let[X,z]of MM)if(X in $)return z;return Z.length>0?"framework":"config"}function OM($){try{let Z=JSON.parse(GM($,"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 TM($){let Z=[],X=KM($),z=WM(w3($,".git"));for(let J=0;J<10;J++){let Q;try{Q=VX(X)}catch{break}for(let U of Q){let W=C3[U];if(!W)continue;if(U==="manifest.json"&&OM(w3(X,U))!=="chrome")continue;if(U==="pubspec.yaml"){let G=$6(X);if(G){let q={mainLanguage:"Dart",packageManager:"pub"};if(G.isFlutter){if(q.framework="Flutter",G.stateManagement)q.stateManagement=G.stateManagement}else if(G.appType==="backend"&&G.framework)q.backend=G.framework;else if(G.appType==="mcp")q.apiType="MCP";Z.push({slots:q,priority:W.priority,frameworks:G.isFlutter?["Flutter","Dart"]:["Dart"],fileName:U});continue}}Z.push({slots:W.slots||{},priority:W.priority,frameworks:W.frameworks,fileName:U})}if(z&&J===0)break;let Y=qM(X);if(Y===X)break;X=Y}return Z}function DM($){let Z=[];for(let X of KX($,2,{count:0})){let z=C3[`*${X}`],J=z?.slots?.mainLanguage;if(J)Z.push({slots:{mainLanguage:J},priority:z.priority,frameworks:z.frameworks})}return Z}function IM($){let Z=[...TM($),...DM($)],X={},z={},J=new Set;for(let G of Z){G.frameworks.forEach((q)=>J.add(q));for(let[q,V]of Object.entries(G.slots))if(V&&!V.includes("/")&&(!(q in X)||G.priority>z[q]))X[q]=V,z[q]=G.priority}let Q=new Map;for(let G of Z){if(!G.fileName)continue;if(!Q.has(G.fileName))Q.set(G.fileName,{fileName:G.fileName,category:NM(G.slots,G.frameworks),priority:G.priority})}let Y=[...Q.values()].sort((G,q)=>q.priority-G.priority||G.fileName.localeCompare(q.fileName)),U=[];if(X.mainLanguage)U.push(X.mainLanguage.toLowerCase());if(X.framework)U.push(X.framework.toLowerCase());let W=U.length>0?U.join("-"):"unknown-stack";return{slotFills:X,frameworks:[...J],confirmedCount:Z.length,discoveredFormats:Y,stackSignature:W}}function Q6($){let{slotFills:Z}=IM($),X={};for(let[z,J]of Object.entries(Z)){let Q=LM[z];if(!Q||!J)continue;let[Y,U]=Q;if(Y==="project")(X.project??={})[U]=J;else(X.stack??={})[U]=J}return X}function KX($,Z,X){let z=new Set;if(Z<0||X.count>400)return z;let J;try{J=VX($,{withFileTypes:!0})}catch{return z}for(let Q of J){if(X.count++>400)break;if(!Q.isDirectory()){let Y=VM(Q.name);if(BM.has(Y))z.add(Y);continue}if(HM.has(Q.name)||Q.name.startsWith("."))continue;for(let Y of KX(w3($,Q.name),Z-1,X))z.add(Y)}return z}import{existsSync as HX,readFileSync as BX}from"fs";import{join as LX}from"path";var B0=($,Z,X)=>({value:$,source:Z,confidence:X});function AM($){let Z=RM($),X=FM($),z={},J=(Q,Y)=>{if(Y)z[Q]=Y};return J("what",_M(Z,X)),J("who",PM(X)),J("why",CM(X)),J("where",wM(Z,X)),J("when",EM(X)),J("how",jM(Z,X)),z}function Y6($){let Z=AM($),X={};return Object.keys(Z).forEach((z)=>{let J=Z[z];if(J)X[z]=J.value}),X}function RM($){let Z=LX($,"package.json");if(!HX(Z))return null;try{return JSON.parse(BX(Z,"utf-8"))}catch{return null}}function FM($){let Z=LX($,"README.md");if(!HX(Z))return"";let X;try{X=BX(Z,"utf-8")}catch{return""}return X.split(`
213
+ `)}function aL($){let X=sL($).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 b$($,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 W=X[z].trim(),G=W.match(/^(#{1,6})\s+/);if(G&&G[1].length<=Y)break;if(W===""){if(U.length>0)break;z++;continue}if(/^(>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(W))break;U.push(W),z++}if(U.length===0)return null;return U.join(" ").trim()}z++}return null}function oL($){let Z=b$($,/^(use\s+cases?|goal)\b/i);if(Z&&h0(Z))return Z;let X=aL($);if(X&&h0(X))return X;return}function tL($){let Z=b$($,/^(about|description|overview|what(\s+is\s+this)?)\b/i);if(Z&&h0(Z))return Z;return}function eL($){let Z=b$($,/^(audience|users?|for\s+whom|who(\s+is\s+this\s+for)?)\b/i);if(Z&&h0(Z))return Z;return}function $M($){let Z=b$($,/^(why|motivation|problem|rationale)\b/i);if(Z&&h0(Z))return Z;return}function ZM($){let Z=b$($,/^(deployment|where(\s+it\s+runs)?|hosting)\b/i);if(Z&&h0(Z))return Z;return}function XM($){let Z=b$($,/^(status|history|timeline|since|launched)\b/i);if(Z&&h0(Z))return Z;return}function zM($){let Z=b$($,/^(architecture|how(\s+it\s+works)?|approach|design)\b/i);if(Z&&h0(Z))return Z;return}function C8($){let Z=["README.md","README.MD","Readme.md","readme.md"],X=null;for(let H of Z){let T=rL($,H);if(iL(T)){X=T;break}}if(!X)return{};let z;try{z=nL(X,"utf-8")}catch{return{}}let J={},Q=oL(z);if(Q)J.project={goal:Q};let Y={},U=tL(z);if(U)Y.what=U;let W=eL(z);if(W)Y.who=W;let G=$M(z);if(G)Y.why=G;let q=ZM(z);if(q)Y.where=q;let V=XM(z);if(V)Y.when=V;let K=zM(z);if(K)Y.how=K;if(Object.keys(Y).length>0)J.human_context=Y;return J}import{existsSync as JM,readFileSync as QM}from"fs";import{join as YM}from"path";function UM($,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 W=U.match(/^"((?:[^"\\]|\\.)*)"$/)||U.match(/^'((?:[^'\\]|\\.)*)'$/);if(W)return W[1];return U}}return null}function w8($){let Z=YM($,"Cargo.toml");if(!JM(Z))return{};let X;try{X=QM(Z,"utf-8")}catch{return{}}let z=UM(X,"description");if(z&&h0(z))return{project:{goal:z}};return{}}function WM($,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 Y3($){return WM(C8($),w8($))}import{existsSync as GM,readdirSync as KX,readFileSync as qM}from"fs";import{join as j8,dirname as VM,extname as KM,resolve as HM}from"path";var E8={"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 BM=new Set(["node_modules",".git","dist","build","venv",".venv","__pycache__","target","coverage",".next",".svelte-kit","vendor"]),LM=new Set([".py",".ts",".tsx",".js",".jsx",".svelte",".vue",".rb",".go",".rs",".php",".java",".kt",".swift"]),MM={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"]},NM=[["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 OM($,Z){for(let[X,z]of NM)if(X in $)return z;return Z.length>0?"framework":"config"}function TM($){try{let Z=JSON.parse(qM($,"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 DM($){let Z=[],X=HM($),z=GM(j8($,".git"));for(let J=0;J<10;J++){let Q;try{Q=KX(X)}catch{break}for(let U of Q){let W=E8[U];if(!W)continue;if(U==="manifest.json"&&TM(j8(X,U))!=="chrome")continue;if(U==="pubspec.yaml"){let G=X3(X);if(G){let q={mainLanguage:"Dart",packageManager:"pub"};if(G.isFlutter){if(q.framework="Flutter",G.stateManagement)q.stateManagement=G.stateManagement}else if(G.appType==="backend"&&G.framework)q.backend=G.framework;else if(G.appType==="mcp")q.apiType="MCP";Z.push({slots:q,priority:W.priority,frameworks:G.isFlutter?["Flutter","Dart"]:["Dart"],fileName:U});continue}}Z.push({slots:W.slots||{},priority:W.priority,frameworks:W.frameworks,fileName:U})}if(z&&J===0)break;let Y=VM(X);if(Y===X)break;X=Y}return Z}function IM($){let Z=[];for(let X of HX($,2,{count:0})){let z=E8[`*${X}`],J=z?.slots?.mainLanguage;if(J)Z.push({slots:{mainLanguage:J},priority:z.priority,frameworks:z.frameworks})}return Z}function AM($){let Z=[...DM($),...IM($)],X={},z={},J=new Set;for(let G of Z){G.frameworks.forEach((q)=>J.add(q));for(let[q,V]of Object.entries(G.slots))if(V&&!V.includes("/")&&(!(q in X)||G.priority>z[q]))X[q]=V,z[q]=G.priority}let Q=new Map;for(let G of Z){if(!G.fileName)continue;if(!Q.has(G.fileName))Q.set(G.fileName,{fileName:G.fileName,category:OM(G.slots,G.frameworks),priority:G.priority})}let Y=[...Q.values()].sort((G,q)=>q.priority-G.priority||G.fileName.localeCompare(q.fileName)),U=[];if(X.mainLanguage)U.push(X.mainLanguage.toLowerCase());if(X.framework)U.push(X.framework.toLowerCase());let W=U.length>0?U.join("-"):"unknown-stack";return{slotFills:X,frameworks:[...J],confirmedCount:Z.length,discoveredFormats:Y,stackSignature:W}}function U3($){let{slotFills:Z}=AM($),X={};for(let[z,J]of Object.entries(Z)){let Q=MM[z];if(!Q||!J)continue;let[Y,U]=Q;if(Y==="project")(X.project??={})[U]=J;else(X.stack??={})[U]=J}return X}function HX($,Z,X){let z=new Set;if(Z<0||X.count>400)return z;let J;try{J=KX($,{withFileTypes:!0})}catch{return z}for(let Q of J){if(X.count++>400)break;if(!Q.isDirectory()){let Y=KM(Q.name);if(LM.has(Y))z.add(Y);continue}if(BM.has(Q.name)||Q.name.startsWith("."))continue;for(let Y of HX(j8($,Q.name),Z-1,X))z.add(Y)}return z}import{existsSync as BX,readFileSync as LX}from"fs";import{join as MX}from"path";var L0=($,Z,X)=>({value:$,source:Z,confidence:X});function RM($){let Z=FM($),X=_M($),z={},J=(Q,Y)=>{if(Y)z[Q]=Y};return J("what",PM(Z,X)),J("who",CM(X)),J("why",wM(X)),J("where",EM(Z,X)),J("when",jM(X)),J("how",SM(Z,X)),z}function W3($){let Z=RM($),X={};return Object.keys(Z).forEach((z)=>{let J=Z[z];if(J)X[z]=J.value}),X}function FM($){let Z=MX($,"package.json");if(!BX(Z))return null;try{return JSON.parse(LX(Z,"utf-8"))}catch{return null}}function _M($){let Z=MX($,"README.md");if(!BX(Z))return"";let X;try{X=LX(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 x$($){return $.replace(/\s+/g," ").replace(/[#*`>]/g,"").trim().slice(0,280)}function J1($,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:x$(z[2]),heading:z[1].trim()}:null}function V4($,Z,X=30){for(let z of Z){let J=$.match(z);if(J&&J[1]&&J[1].trim().length>=X)return x$(J[1])}return null}function _M($,Z){if($?.description&&$.description.length>20)return B0(x$($.description),"package.json:description",0.95);let X=J1(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(x$(z),"README:first-paragraph",0.5);let J=V4(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 PM($){let Z=J1($,"Audience|Who|Who is this for|Who it.s for");if(Z)return B0(Z.body,`README:## ${Z.heading}`,0.8);let X=V4($,[/\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 CM($){let Z=J1($,"Why|Mission|Motivation|Rationale|Vision");if(Z)return B0(Z.body,`README:## ${Z.heading}`,0.8);let X=V4($,[/(?: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 wM($,Z){let X=typeof $?.repository==="string"?$.repository:$?.repository?.url;if(X)return B0(x$(X.replace(/^git\+/,"").replace(/\.git$/,"")),"package.json:repository",0.95);if($?.homepage)return B0(x$($.homepage),"package.json:homepage",0.9);let z=V4(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 EM($){let Z=J1($,"Timeline|Status|Release|Roadmap");if(Z)return B0(Z.body,`README:## ${Z.heading}`,0.8);let X=V4($,[/\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 jM($,Z){let X=$?.scripts?Object.keys($.scripts):[],z=["start","dev","build"].filter((Y)=>X.includes(Y));if(z.length)return B0(x$(z.map((Y)=>`npm run ${Y}`).join(", ")),"package.json:scripts",0.9);let J=J1(Z,"Usage|Getting Started|Install|Installation|Quick Start");if(J)return B0(J.body,`README:## ${J.heading}`,0.8);let Q=J1(Z,"Architecture|Approach|How it works|Methodology|How");return Q?B0(Q.body,`README:## ${Q.heading}`,0.7):null}function Q1($){let Z=z6($),X=J6($),z=r0(Z,X);SM(z);let J=r0(z,Q6($));return r0(J,{human_context:Y6($)})}function SM($){let Z=$.project?.type??"library",X=X1[Z]||X1.library;for(let z of a){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 r0($,Z){let X={...$};for(let[z,J]of Object.entries(Z)){let Q=X[z];if(A0(Q))X[z]=J;else if(typeof J==="object"&&J!==null&&!Array.isArray(J)&&typeof Q==="object"&&Q!==null&&!Array.isArray(Q))X[z]=r0(Q,J)}return X}import{existsSync as MX,readFileSync as xM,writeFileSync as bM}from"fs";import{join as kM,basename as yM}from"path";import{createHash as fM}from"crypto";class s0{projectPath;dnaPath;dna=null;constructor($){this.projectPath=$,this.dnaPath=kM($,".faf-dna")}exists(){return MX(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(!MX(this.dnaPath))return null;try{return this.dna=JSON.parse(xM(this.dnaPath,"utf-8")),this.dna}catch{return null}}save(){if(!this.dna)return;this.dna.lastModified=new Date().toISOString(),bM(this.dnaPath,JSON.stringify(this.dna,null,2)+`
219
- `,"utf-8")}generateProjectDNA(){return fM("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=yM(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=(W)=>z.some((G)=>G.type===W),Q=(W,G,q)=>z.push({type:W,score:$,date:X,version:Z,label:G,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((W)=>W.type==="peak");if(!Y||$>Y.score){if(Y)z.splice(z.indexOf(Y),1);Q("peak","Peak","\uD83C\uDFD4️")}let U=z.findIndex((W)=>W.type==="current");if(U>=0)z.splice(U,1);Q("current","Current","\uD83D\uDCCD")}}d();function E3($={}){let Z=process.cwd(),X=$.output?$.output.endsWith(".faf")?$.output:NX(Z,$.output):NX(Z,"project.faf");if(gM(X)&&!$.force)console.error(`project.faf already exists. Use ${R("--force")} to overwrite.`),process.exit(1);let z=Q1(Z);s(X,z);let J=h(X),Q=X0(J),Y=new s0(Z);if(!Y.exists()||$.force)Y.birth(Q.score);if(console.log(`${I("created")} ${X}`),z0(Q,X),console.log(L(` \uD83E\uDDEC Birth DNA ${Q.score}% — your journey starts here (faf dna)`)),Q.score<100)console.log(L(`
220
- run ${R("'faf go'")} to fill empty slots`))}d();function OX(){let $=new s0(process.cwd());if(!$.load())console.error(`${R("×")} No FAF DNA found. Run ${R("'faf init'")} to start your journey.`),process.exit(1);let Z=$.getJourney(),X=$.getBirthDNADisplay(),z=X.born.split("T")[0];console.log(),console.log(q0(R("\uD83E\uDDEC YOUR FAF DNA"))),console.log(),console.log(` ${I(R(Z))}`),console.log(),console.log(L(` 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(L(" history:"));for(let Q of J)console.log(L(` ${Q}`))}console.log()}import{existsSync as vM}from"fs";import{join as hM}from"path";d();function U6(){let $=process.cwd(),Z=hM($,"project.faf");if(vM(Z)){let Q=c(Z),Y=r0(Q,J6($)),U=r0(Y,z6($)),W=r0(U,Q6($)),G=r0(W,{human_context:Y6($)});s(Z,G),console.log(`${I("updated")} ${Z}`)}else s(Z,Q1($)),console.log(`${I("created")} ${Z}`);let X=h(Z),z=V0(U0(X)),J=new s0($);if(J.exists())J.recordGrowth(z.score,["faf auto"]);if(z0(z,Z),z.score<100)console.log(L(`
221
- run ${R("'faf go'")} to reach \uD83C\uDFC6 Trophy`))}import{existsSync as nM}from"fs";import{join as rM}from"path";var Y1="(terse — 3-4 words)",uM=[{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? ${Y1}`,header:"Who",type:"text",required:!0},{path:"human_context.what",question:`What are they building? ${Y1}`,header:"What",type:"text",required:!0},{path:"human_context.why",question:`Why does it exist? ${Y1}`,header:"Why",type:"text",required:!0},{path:"human_context.where",question:`Where does it run or ship? ${Y1}`,header:"Where",type:"text",required:!0},{path:"human_context.when",question:`When — timeline or stage? ${Y1}`,header:"When",type:"text",required:!0},{path:"human_context.how",question:`How is it built or used? ${Y1}`,header:"How",type:"text",required:!0}],mM=[{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}],W6=[...uM,...mM],cM=new Map(W6.map(($)=>[$.path,$])),IF=Object.fromEntries(W6.map(($)=>[$.path,$]));function G6($){let Z=cM.get($);if(Z)return Z.question;let X=Z1.get($)??a.find((z)=>z.canonical===$);return X?`${X.description}?`.replace(/\?\?$/,"?"):`${$}?`}function S3($){if($===null||$===void 0)return!0;if(typeof $==="string"){let Z=$.trim();return Z===""||A0(Z)}return!1}function dM($,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 pM($){if($==="project.goal")return!0;return Z1.get($)?.category==="human"}function lM($,Z=S3){let X=[],z=[];for(let J of W6){let Q=dM($,J.path);if(Q==="slotignored")continue;if(!Z(Q))continue;(pM(J.path)?X:z).push(J.path)}return{human:X,sourceable:z}}function iM($,Z,X=S3){let z=lM(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"?j3(z):[];return{status:J,score:$,gaps:z,ask:Q}}function j3($){return $.human.map((Z)=>({path:Z,question:G6(Z)}))}function TX($,Z={}){let X=Math.max(1,Z.maxRounds??5),z=Z.isEmpty??S3,J=[],Q=0;for(let U=0;U<=X;U++){let W=$.read();if(!W)return{status:"no-faf",score:0,rounds:Q,history:J,ask:[]};let G=$.score(W.yaml);J.push(G);let q=iM(G,W.data,z);if(q.status==="done")return{status:"done",score:G,rounds:Q,history:J,ask:[]};if(q.status==="needs-human")return{status:"needs-human",score:G,rounds:Q,history:J,ask:q.ask};if(J.length>=2&&G<=J[J.length-2])return q.gaps.human.length?{status:"needs-human",score:G,rounds:Q,history:J,ask:j3(q.gaps)}:{status:"stuck",score:G,rounds:Q,history:J,ask:[]};if(Q>=X)return{status:"capped",score:G,rounds:Q,history:J,ask:j3(q.gaps)};$.runAuto(),Q++}return{status:"capped",score:J[J.length-1]??0,rounds:Q,history:J,ask:[]}}d();function DX($={}){let Z=process.cwd(),X=rM(Z,"project.faf"),z=$.rounds?Math.max(1,parseInt($.rounds,10)||5):5;sM(TX({read:()=>nM(X)?{data:c(X),yaml:h(X)}:{data:{},yaml:""},score:(Q)=>Q?V0(U0(Q)).score:0,runAuto:()=>U6()},{maxRounds:z}))}function sM($){if($.history.length>1)console.log(L(`
222
- climb: ${$.history.join("% → ")}%`));switch(console.log(""),$.status){case"done":console.log(`${I("done")} — \uD83C\uDFC6 100% AI-readiness. The .faf is complete.`);break;case"needs-human":{let Z=$.ask.length;console.log(`${R("Sourced everything detection can.")} ${Z} question${Z===1?"":"s"} only you can answer:`);for(let X of $.ask)console.log(` ${L("•")} ${X.question}`);console.log(L(`
223
- Answer with ${R("'faf go'")}, or fill them in project.faf directly.`));break}case"stuck":console.log(`${R(`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(`${R(`Stopped at ${$.score}% after ${$.rounds} rounds (the cap).`)} Re-run ${R("'faf loop'")} to continue, or raise ${L("--rounds")}.`);break;case"no-faf":console.log(`No project.faf, and none could be created here. Run ${R("'faf init'")} first.`);break}}import{existsSync as K6,statSync as wX}from"fs";import{join as EX,dirname as UN}from"path";import{readFileSync as XN,existsSync as zN,statSync as hF}from"fs";import{join as AX}from"path";import{readFileSync as aM,writeFileSync as q6,existsSync as oM}from"fs";var tM="<!-- faf:start -->",eM="<!-- faf:end -->",$N="<!-- faf:";function c0($,Z,X=tM,z=eM){let J=`${X}
218
+ `).replace(/<[^>]+>/g,"").replace(/!\[[^\]]*\]\([^)]*\)/g,"").trim()}function k$($){return $.replace(/\s+/g," ").replace(/[#*`>]/g,"").trim().slice(0,280)}function Y1($,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:k$(z[2]),heading:z[1].trim()}:null}function H4($,Z,X=30){for(let z of Z){let J=$.match(z);if(J&&J[1]&&J[1].trim().length>=X)return k$(J[1])}return null}function PM($,Z){if($?.description&&$.description.length>20)return L0(k$($.description),"package.json:description",0.95);let X=Y1(Z,"Purpose|What|About|Overview|Description");if(X)return L0(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 L0(k$(z),"README:first-paragraph",0.5);let J=H4(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?L0(J,"README:problem-heuristic",0.6):null}function CM($){let Z=Y1($,"Audience|Who|Who is this for|Who it.s for");if(Z)return L0(Z.body,`README:## ${Z.heading}`,0.8);let X=H4($,[/\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?L0(X,"README:audience-heuristic",0.6):null}function wM($){let Z=Y1($,"Why|Mission|Motivation|Rationale|Vision");if(Z)return L0(Z.body,`README:## ${Z.heading}`,0.8);let X=H4($,[/(?: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?L0(X,"README:mission-heuristic",0.6):null}function EM($,Z){let X=typeof $?.repository==="string"?$.repository:$?.repository?.url;if(X)return L0(k$(X.replace(/^git\+/,"").replace(/\.git$/,"")),"package.json:repository",0.95);if($?.homepage)return L0(k$($.homepage),"package.json:homepage",0.9);let z=H4(Z,[/\b(?:deployed|hosted|available|published)\s+(?:on|at|via)\s+([^.\n]{3,80})/i],3);return z?L0(z,"README:deploy-heuristic",0.6):null}function jM($){let Z=Y1($,"Timeline|Status|Release|Roadmap");if(Z)return L0(Z.body,`README:## ${Z.heading}`,0.8);let X=H4($,[/\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?L0(X,"README:since-heuristic",0.6):null}function SM($,Z){let X=$?.scripts?Object.keys($.scripts):[],z=["start","dev","build"].filter((Y)=>X.includes(Y));if(z.length)return L0(k$(z.map((Y)=>`npm run ${Y}`).join(", ")),"package.json:scripts",0.9);let J=Y1(Z,"Usage|Getting Started|Install|Installation|Quick Start");if(J)return L0(J.body,`README:## ${J.heading}`,0.8);let Q=Y1(Z,"Architecture|Approach|How it works|Methodology|How");return Q?L0(Q.body,`README:## ${Q.heading}`,0.7):null}function U1($){let Z=Q3($),X=Y3($),z=s0(Z,X);xM(z);let J=s0(z,U3($));return s0(J,{human_context:W3($)})}function xM($){let Z=$.project?.type??"library",X=J1[Z]||J1.library;for(let z of t){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 s0($,Z){let X={...$};for(let[z,J]of Object.entries(Z)){let Q=X[z];if(R0(Q))X[z]=J;else if(typeof J==="object"&&J!==null&&!Array.isArray(J)&&typeof Q==="object"&&Q!==null&&!Array.isArray(Q))X[z]=s0(Q,J)}return X}import{existsSync as NX,readFileSync as bM,writeFileSync as kM}from"fs";import{join as yM,basename as fM}from"path";import{createHash as gM}from"crypto";class a0{projectPath;dnaPath;dna=null;constructor($){this.projectPath=$,this.dnaPath=yM($,".faf-dna")}exists(){return NX(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(!NX(this.dnaPath))return null;try{return this.dna=JSON.parse(bM(this.dnaPath,"utf-8")),this.dna}catch{return null}}save(){if(!this.dna)return;this.dna.lastModified=new Date().toISOString(),kM(this.dnaPath,JSON.stringify(this.dna,null,2)+`
219
+ `,"utf-8")}generateProjectDNA(){return gM("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=fM(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=(W)=>z.some((G)=>G.type===W),Q=(W,G,q)=>z.push({type:W,score:$,date:X,version:Z,label:G,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((W)=>W.type==="peak");if(!Y||$>Y.score){if(Y)z.splice(z.indexOf(Y),1);Q("peak","Peak","\uD83C\uDFD4️")}let U=z.findIndex((W)=>W.type==="current");if(U>=0)z.splice(U,1);Q("current","Current","\uD83D\uDCCD")}}p();function S8($={}){let Z=process.cwd(),X=$.output?$.output.endsWith(".faf")?$.output:OX(Z,$.output):OX(Z,"project.faf");if(vM(X)&&!$.force)console.error(`project.faf already exists. Use ${R("--force")} to overwrite.`),process.exit(1);let z=U1(Z);o(X,z);let J=u(X),Q=z0(J),Y=new a0(Z);if(!Y.exists()||$.force)Y.birth(Q.score);if(console.log(`${D("created")} ${X}`),J0(Q,X),console.log(L(` \uD83E\uDDEC Birth DNA ${Q.score}% — your journey starts here (faf dna)`)),Q.score<100)console.log(L(`
220
+ run ${R("'faf go'")} to fill empty slots`))}p();function TX(){let $=new a0(process.cwd());if(!$.load())console.error(`${R("×")} No FAF DNA found. Run ${R("'faf init'")} to start your journey.`),process.exit(1);let Z=$.getJourney(),X=$.getBirthDNADisplay(),z=X.born.split("T")[0];console.log(),console.log(V0(R("\uD83E\uDDEC YOUR FAF DNA"))),console.log(),console.log(` ${D(R(Z))}`),console.log(),console.log(L(` 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(L(" history:"));for(let Q of J)console.log(L(` ${Q}`))}console.log()}import{existsSync as hM}from"fs";import{join as uM}from"path";p();function G3(){let $=process.cwd(),Z=uM($,"project.faf");if(hM(Z)){let Q=d(Z),Y=s0(Q,Y3($)),U=s0(Y,Q3($)),W=s0(U,U3($)),G=s0(W,{human_context:W3($)});o(Z,G),console.log(`${D("updated")} ${Z}`)}else o(Z,U1($)),console.log(`${D("created")} ${Z}`);let X=u(Z),z=K0(W0(X)),J=new a0($);if(J.exists())J.recordGrowth(z.score,["faf auto"]);if(J0(z,Z),z.score<100)console.log(L(`
221
+ run ${R("'faf go'")} to reach \uD83C\uDFC6 Trophy`))}import{existsSync as rM}from"fs";import{join as sM}from"path";var W1="(terse — 3-4 words)",mM=[{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? ${W1}`,header:"Who",type:"text",required:!0},{path:"human_context.what",question:`What are they building? ${W1}`,header:"What",type:"text",required:!0},{path:"human_context.why",question:`Why does it exist? ${W1}`,header:"Why",type:"text",required:!0},{path:"human_context.where",question:`Where does it run or ship? ${W1}`,header:"Where",type:"text",required:!0},{path:"human_context.when",question:`When — timeline or stage? ${W1}`,header:"When",type:"text",required:!0},{path:"human_context.how",question:`How is it built or used? ${W1}`,header:"How",type:"text",required:!0}],cM=[{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}],q3=[...mM,...cM],dM=new Map(q3.map(($)=>[$.path,$])),FF=Object.fromEntries(q3.map(($)=>[$.path,$]));function V3($){let Z=dM.get($);if(Z)return Z.question;let X=z1.get($)??t.find((z)=>z.canonical===$);return X?`${X.description}?`.replace(/\?\?$/,"?"):`${$}?`}function b8($){if($===null||$===void 0)return!0;if(typeof $==="string"){let Z=$.trim();return Z===""||R0(Z)}return!1}function pM($,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 lM($){if($==="project.goal")return!0;return z1.get($)?.category==="human"}function iM($,Z=b8){let X=[],z=[];for(let J of q3){let Q=pM($,J.path);if(Q==="slotignored")continue;if(!Z(Q))continue;(lM(J.path)?X:z).push(J.path)}return{human:X,sourceable:z}}function nM($,Z,X=b8){let z=iM(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"?x8(z):[];return{status:J,score:$,gaps:z,ask:Q}}function x8($){return $.human.map((Z)=>({path:Z,question:V3(Z)}))}function DX($,Z={}){let X=Math.max(1,Z.maxRounds??5),z=Z.isEmpty??b8,J=[],Q=0;for(let U=0;U<=X;U++){let W=$.read();if(!W)return{status:"no-faf",score:0,rounds:Q,history:J,ask:[]};let G=$.score(W.yaml);J.push(G);let q=nM(G,W.data,z);if(q.status==="done")return{status:"done",score:G,rounds:Q,history:J,ask:[]};if(q.status==="needs-human")return{status:"needs-human",score:G,rounds:Q,history:J,ask:q.ask};if(J.length>=2&&G<=J[J.length-2])return q.gaps.human.length?{status:"needs-human",score:G,rounds:Q,history:J,ask:x8(q.gaps)}:{status:"stuck",score:G,rounds:Q,history:J,ask:[]};if(Q>=X)return{status:"capped",score:G,rounds:Q,history:J,ask:x8(q.gaps)};$.runAuto(),Q++}return{status:"capped",score:J[J.length-1]??0,rounds:Q,history:J,ask:[]}}p();function IX($={}){let Z=process.cwd(),X=sM(Z,"project.faf"),z=$.rounds?Math.max(1,parseInt($.rounds,10)||5):5;aM(DX({read:()=>rM(X)?{data:d(X),yaml:u(X)}:{data:{},yaml:""},score:(Q)=>Q?K0(W0(Q)).score:0,runAuto:()=>G3()},{maxRounds:z}))}function aM($){if($.history.length>1)console.log(L(`
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(`${R("Sourced everything detection can.")} ${Z} question${Z===1?"":"s"} only you can answer:`);for(let X of $.ask)console.log(` ${L("•")} ${X.question}`);console.log(L(`
223
+ Answer with ${R("'faf go'")}, or fill them in project.faf directly.`));break}case"stuck":console.log(`${R(`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(`${R(`Stopped at ${$.score}% after ${$.rounds} rounds (the cap).`)} Re-run ${R("'faf loop'")} to continue, or raise ${L("--rounds")}.`);break;case"no-faf":console.log(`No project.faf, and none could be created here. Run ${R("'faf init'")} first.`);break}}import{existsSync as B3,statSync as EX}from"fs";import{join as jX,dirname as WN}from"path";import{readFileSync as zN,existsSync as JN,statSync as cF}from"fs";import{join as RX}from"path";import{readFileSync as oM,writeFileSync as K3,existsSync as tM}from"fs";var eM="<!-- faf:start -->",$N="<!-- faf:end -->",ZN="<!-- faf:";function d0($,Z,X=eM,z=$N){let J=`${X}
224
224
  ${Z.trim()}
225
- ${z}`;if(!oM($)){q6($,`${J}
226
- `,"utf-8");return}let Q=aM($,"utf-8"),Y=Q.indexOf(X),U=Q.indexOf(z);if(Y!==-1&&U!==-1&&U>Y){let W=Q.slice(0,Y),G=Q.slice(U+z.length);q6($,`${W}${J}${G}`,"utf-8");return}if(Q.trimStart().startsWith($N)){q6($,`${J}
227
- `,"utf-8");return}q6($,`${J}
225
+ ${z}`;if(!tM($)){K3($,`${J}
226
+ `,"utf-8");return}let Q=oM($,"utf-8"),Y=Q.indexOf(X),U=Q.indexOf(z);if(Y!==-1&&U!==-1&&U>Y){let W=Q.slice(0,Y),G=Q.slice(U+z.length);K3($,`${W}${J}${G}`,"utf-8");return}if(Q.trimStart().startsWith(ZN)){K3($,`${J}
227
+ `,"utf-8");return}K3($,`${J}
228
228
 
229
- ${Q}`,"utf-8")}var ZN=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 x3($){return $.split("_").map((Z)=>{if(!Z)return Z;let X=Z.toUpperCase();return ZN.has(X)?X:Z.charAt(0).toUpperCase()+Z.slice(1)}).join(" ")}function N0($){return typeof $==="string"&&$.trim()!==""&&$.trim()!=="slotignored"}function R0($){let Z=Z1.get($);if(Z?.label)return Z.label;let X=$.includes(".")?$.slice($.lastIndexOf(".")+1):$;return x3(X)}var RX="CLAUDE.md",JN="STATUS: BI-SYNC ACTIVE";function FX($){let Z=AX($,RX);if(!zN(Z))return null;return XN(Z,"utf-8")}function _X($,Z){c0(AX($,RX),Z)}function a0($,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 W=`<!-- faf: ${U.join(" | ")} -->`;return`${Y}
230
- ${W}`}function PX($){let Z=[],X=$.project?.name??"Project",z=$.project?.main_language??"",J=$.project?.goal??"";if(Z.push(a0($)),Z.push(""),Z.push(`# CLAUDE.md — ${X}`),Z.push(""),J)Z.push("## What This Is"),Z.push(""),Z.push(J),Z.push("");let Q=$.stack??{},Y=[];if(z)Y.push(`**Language:** ${z}`);for(let[G,q]of Object.entries(Q))if(q&&q!=="slotignored"&&String(q).trim())Y.push(`**${R0(`stack.${G}`)}:** ${q}`);if(Y.length>0){Z.push("## Stack"),Z.push("");for(let G of Y)Z.push(`- ${G}`);Z.push("")}let U=$.human_context??{},W=[["who",U.who],["what",U.what],["why",U.why],["where",U.where],["when",U.when],["how",U.how]].filter(([,G])=>G&&String(G).trim()).map(([G,q])=>`- **${R0(`human_context.${G}`)}:** ${q}`);if(W.length>0)Z.push("## Context"),Z.push(""),Z.push(...W),Z.push("");return Z.push("---"),Z.push(""),Z.push(`*${JN} — ${new Date().toISOString()}*`),Z.push(""),Z.join(`
231
- `)}function IX($){return $.replace(/\s+v\d+(?:\.\d+)*\s*$/i,"").trim()}function V6($){let Z={project:{}},X=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(X)Z.project.name=IX(X[1].trim());if(!Z.project.name){let Q=$.match(/\*\*Name:\*\*\s*(.+)/);if(Q)Z.project.name=IX(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 lF,writeFileSync as QN,existsSync as iF}from"fs";import{join as YN}from"path";function CX($,Z){QN(YN($,"MEMORY.md"),Z,"utf-8")}d();function U1(){return process.env.FAF_PRO==="1"||process.env.FAF_PRO==="true"}function b3($={}){let Z=process.cwd(),X=g(Z);if(!X)console.error(`Error: project.faf not found
229
+ ${Q}`,"utf-8")}var XN=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 k8($){return $.split("_").map((Z)=>{if(!Z)return Z;let X=Z.toUpperCase();return XN.has(X)?X:Z.charAt(0).toUpperCase()+Z.slice(1)}).join(" ")}function F0($){return typeof $==="string"&&$.trim()!==""&&$.trim()!=="slotignored"}function S0($){let Z=z1.get($);if(Z?.label)return Z.label;let X=$.includes(".")?$.slice($.lastIndexOf(".")+1):$;return k8(X)}var FX="CLAUDE.md",QN="STATUS: BI-SYNC ACTIVE";function _X($){let Z=RX($,FX);if(!JN(Z))return null;return zN(Z,"utf-8")}function PX($,Z){d0(RX($,FX),Z)}function o0($,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 W=`<!-- faf: ${U.join(" | ")} -->`;return`${Y}
230
+ ${W}`}function CX($){let Z=[],X=$.project?.name??"Project",z=$.project?.main_language??"",J=$.project?.goal??"";if(Z.push(o0($)),Z.push(""),Z.push(`# CLAUDE.md — ${X}`),Z.push(""),J)Z.push("## What This Is"),Z.push(""),Z.push(J),Z.push("");let Q=$.stack??{},Y=[];if(z)Y.push(`**Language:** ${z}`);for(let[G,q]of Object.entries(Q))if(q&&q!=="slotignored"&&String(q).trim())Y.push(`**${S0(`stack.${G}`)}:** ${q}`);if(Y.length>0){Z.push("## Stack"),Z.push("");for(let G of Y)Z.push(`- ${G}`);Z.push("")}let U=$.human_context??{},W=[["who",U.who],["what",U.what],["why",U.why],["where",U.where],["when",U.when],["how",U.how]].filter(([,G])=>G&&String(G).trim()).map(([G,q])=>`- **${S0(`human_context.${G}`)}:** ${q}`);if(W.length>0)Z.push("## Context"),Z.push(""),Z.push(...W),Z.push("");return Z.push("---"),Z.push(""),Z.push(`*${QN} — ${new Date().toISOString()}*`),Z.push(""),Z.join(`
231
+ `)}function AX($){return $.replace(/\s+v\d+(?:\.\d+)*\s*$/i,"").trim()}function H3($){let Z={project:{}},X=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(X)Z.project.name=AX(X[1].trim());if(!Z.project.name){let Q=$.match(/\*\*Name:\*\*\s*(.+)/);if(Q)Z.project.name=AX(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 rF,writeFileSync as YN,existsSync as sF}from"fs";import{join as UN}from"path";function wX($,Z){YN(UN($,"MEMORY.md"),Z,"utf-8")}p();function G1(){return process.env.FAF_PRO==="1"||process.env.FAF_PRO==="true"}function y8($={}){let Z=process.cwd(),X=v(Z);if(!X)console.error(`Error: project.faf not found
232
232
 
233
- Run 'faf init' to create one.`),process.exit(2);let z=EX(Z,"CLAUDE.md"),J=EX(Z,"MEMORY.md"),Q=$.direction??"auto";if(Q==="auto")jX(X,z,Z);else if(Q==="push")SX(X,Z);else if(Q==="pull")WN(X,z);if(U1())xX(X,J,Z);if($.watch)console.log(L("watching for changes... (Ctrl+C to stop)")),qN(X,z,J,Z)}function jX($,Z,X){SX($,X)}function SX($,Z){let X=c($),z=PX(X);_X(Z,z),console.log(`${I("◆")} sync .faf → CLAUDE.md ${L("← bi-sync")}`);let J=V0(U0(h($)));z0(J,$)}function WN($,Z){let X=V0(U0(h($)));if(X.tier.name!=="TROPHY")console.error(`${R("×")} sync --pull blocked: requires \uD83C\uDFC6 Trophy (currently ${X.score}%)`),console.error(L(" MD → .faf backfill only runs at 100%. Reach Trophy with 'faf go', then retry.")),process.exit(1);let z=FX(UN(Z));if(!z){console.error("CLAUDE.md not found.");return}let J=V6(z),Q=c($);if(J.project?.name)Q.project={...Q.project,name:J.project.name};if(J.project?.goal)Q.project={...Q.project,goal:J.project.goal};if(J.project?.main_language)Q.project={...Q.project,main_language:J.project.main_language};s($,Q),console.log(`${I("◆")} sync CLAUDE.md → .faf ${L("← bi-sync (Trophy-gated)")}`);let Y=V0(U0(h($)));z0(Y,$)}function xX($,Z,X){let z=c($),J=wX($).mtimeMs,Q=K6(Z)?wX(Z).mtimeMs:0;if(!K6(Z)||J>Q){let Y=GN(z);CX(X,Y),console.log(`${I("◆")} sync .faf → MEMORY.md ${L("← tri-sync")}`)}else console.log(`${I("◆")} sync MEMORY.md → .faf ${L("← tri-sync")}`)}function GN($){let Z=$.project??{},X=[`# ${Z.name??"Project"} — Memory Topics`,"","> Authored 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=jX(Z,"CLAUDE.md"),J=jX(Z,"MEMORY.md"),Q=$.direction??"auto";if(Q==="auto")SX(X,z,Z);else if(Q==="push")xX(X,Z);else if(Q==="pull")GN(X,z);if(G1())bX(X,J,Z);if($.watch)console.log(L("watching for changes... (Ctrl+C to stop)")),VN(X,z,J,Z)}function SX($,Z,X){xX($,X)}function xX($,Z){let X=d($),z=CX(X);PX(Z,z),console.log(`${D("◆")} sync .faf → CLAUDE.md ${L("← bi-sync")}`);let J=K0(W0(u($)));J0(J,$)}function GN($,Z){let X=K0(W0(u($)));if(X.tier.name!=="TROPHY")console.error(`${R("×")} sync --pull blocked: requires \uD83C\uDFC6 Trophy (currently ${X.score}%)`),console.error(L(" MD → .faf backfill only runs at 100%. Reach Trophy with 'faf go', then retry.")),process.exit(1);let z=_X(WN(Z));if(!z){console.error("CLAUDE.md not found.");return}let J=H3(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};o($,Q),console.log(`${D("◆")} sync CLAUDE.md → .faf ${L("← bi-sync (Trophy-gated)")}`);let Y=K0(W0(u($)));J0(Y,$)}function bX($,Z,X){let z=d($),J=EX($).mtimeMs,Q=B3(Z)?EX(Z).mtimeMs:0;if(!B3(Z)||J>Q){let Y=qN(z);wX(X,Y),console.log(`${D("◆")} sync .faf → MEMORY.md ${L("← tri-sync")}`)}else console.log(`${D("◆")} sync MEMORY.md → .faf ${L("← tri-sync")}`)}function qN($){let Z=$.project??{},X=[`# ${Z.name??"Project"} — Memory Topics`,"","> Authored 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 qN($,Z,X,z){let{watch:J}=D0("fs"),Q=null,Y=()=>{if(Q)clearTimeout(Q);Q=setTimeout(()=>{if(console.log(L("change detected...")),jX($,Z,z),U1())xX($,X,z)},200)};if(J($,Y),K6(Z))J(Z,Y);if(U1()&&K6(X))J(X,Y)}import{writeFileSync as VN}from"fs";d();function bX($,Z={}){let X=$??g();if(!X)console.error(`Error: project.faf not found
235
+ `}function VN($,Z,X,z){let{watch:J}=I0("fs"),Q=null,Y=()=>{if(Q)clearTimeout(Q);Q=setTimeout(()=>{if(console.log(L("change detected...")),SX($,Z,z),G1())bX($,X,z)},200)};if(J($,Y),B3(Z))J(Z,Y);if(G1()&&B3(X))J(X,Y)}import{writeFileSync as KN}from"fs";p();function kX($,Z={}){let X=$??v();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=t2(z),Q=Z.output??X.replace(/\.faf$/,".fafb");VN(Q,J),console.log(`${I("compiled")} ${Q} ${L(`(${J.length} bytes)`)}`)}import{readFileSync as KN}from"fs";function kX($,Z={}){if(!$)console.error("Error: Please specify a .fafb file to decompile."),process.exit(1);let X=new Uint8Array(KN($));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=n9(X);console.log(JSON.stringify(z,null,2))}function yX($){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}}d();function k3($,Z={}){let X=$??g();if(!X)console.error(`Error: project.faf not found
237
+ Run 'faf init' to create one.`),process.exit(2);let z=u(X),J=$3(z),Q=Z.output??X.replace(/\.faf$/,".fafb");KN(Q,J),console.log(`${D("compiled")} ${Q} ${L(`(${J.length} bytes)`)}`)}import{readFileSync as HN}from"fs";function yX($,Z={}){if(!$)console.error("Error: Please specify a .fafb file to decompile."),process.exit(1);let X=new Uint8Array(HN($));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=r9(X);console.log(JSON.stringify(z,null,2))}function fX($){let Z=[];if(!$||typeof $!=="object")return Z.push("File is not a valid YAML mapping"),{valid:!1,errors:Z};let X=$;if(!X.faf_version)Z.push("Missing required field: faf_version");if(!X.project?.name)Z.push("Missing required field: project.name");if(X.app_type==="about"){if(!X.about?.represents)Z.push("app_type 'about' requires about.represents (owner/repo of the source codebase)");else if(!/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(X.about.represents))Z.push(`about.represents must be "owner/repo" format (got: ${X.about.represents})`);if(X.about?.source_score!==void 0){let z=X.about.source_score;if(typeof z!=="number"||z<0||z>100)Z.push(`about.source_score must be a number 0-100 (got: ${z})`)}}return{valid:Z.length===0,errors:Z}}p();function f8($,Z={}){let X=$??v();if(!X)console.error(`Error: project.faf not found
238
238
 
239
- Run 'faf init' to create one.`),process.exit(2);let z=c(X),J=yX(z);if(!J.valid){console.log(`${R("invalid")} ${X}`);for(let U of J.errors)console.log(` ${L("x")} ${U}`);process.exit(3)}let Q=h(X);if(!i9(Q))console.log(`${R("invalid yaml")} ${X}`),process.exit(3);console.log(`${I("valid")} ${X}`);let Y=X0(Q);if(z0(Y,X),Z.strict&&Y.score<100)console.log(L(`
240
- --strict requires 100%`)),process.exit(1)}import{join as HN}from"path";var j0=($)=>$!=null&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),fX=($)=>Array.isArray($)?$.join(", "):String($),BN=new Set(["commit_style","communication","response_style","explanation_level","explanations","documentation","code_first"]),LN=new Set(["target_user","core_problem","mission_purpose"]);function MN($){let Z=[],X=(D="")=>Z.push(D),z=$.ai_instructions,J=$.preferences,Q=$.instant_context,Y=$.security,U=$.commands,W=$.key_files??Q?.key_files,G=U?Object.entries(U).filter(([,D])=>j0(D)):[],q=G.filter(([D])=>/test/i.test(D)),V=G.filter(([D])=>/lint|check/i.test(D)&&!/test/i.test(D)),K=G.filter(([D])=>!/test|lint|check/i.test(D));X(a0($)),X(),X(`# AGENTS.md — ${$.project?.name??"Project"}`),X();let H=[];if($.project?.main_language)H.push(String($.project.main_language));if(j0($.project?.type))H.push(`type: ${String($.project?.type)}`);if(j0($.project?.version))H.push(`v${String($.project?.version)}`);let T=$.project?.goal?String($.project.goal):"";if(H.length)T+=(T?" — ":"")+H.join(" · ");if(T)X(T),X();if(X("> Authored by faf — do not edit directly; refresh with `faf export --agents`."),X(),K.length){X("## Setup & build"),X(),X("```bash");for(let[D,E]of K)X(`${E} # ${D}`);X("```"),X()}if(q.length){X("## Run the tests"),X(),X("```bash");for(let[,D]of q)X(D);X("```"),X()}if(W&&W.length){X("## Where things live"),X();for(let D of W)X(`- \`${D}\``);X()}let B=new Map,N=(D)=>{if(!D)return;for(let[E,u]of Object.entries(D)){if(BN.has(E)||!j0(u))continue;let A=x3(E);if(!B.has(A))B.set(A,fX(u))}};N(z?.working_style),N(J);let _=$.conventions??[];if(B.size||_.length){X("## Conventions"),X();for(let[D,E]of B)X(`- **${D}:** ${E}`);for(let D of _)if(j0(D))X(`- ${D}`);X()}let w=(z?.warnings??[]).filter((D)=>j0(D));X("## Guardrails"),X();for(let D of w)X(`- ${D}`);X("- **Ask first:** dependency installs, deletions, migrations, schema changes."),X("- **Never:** force-push, push to `main`, commit secrets."),X();let j=[];for(let[,D]of V)j.push(`\`${D}\` exits 0`);for(let[,D]of q)j.push(`\`${D}\` passes`);if(j.push("changes committed with a conventional message"),X("## Definition of Done"),X(),X(`Done when: ${[...new Set(j)].join(" · ")}.`),X(),Y&&(j0(Y.secrets)||(Y.never??[]).length)){if(X("## Security & secrets"),X(),j0(Y.secrets)){let D=j0(Y.example)?` (see \`${Y.example}\`)`:"";X(`- Secrets live in \`${Y.secrets}\`${D}. Never read or commit them.`)}for(let D of Y.never??[])if(j0(D))X(`- Never read or commit \`${D}\`.`);X()}if(J&&j0(J.commit_style))X("## Commit & PR"),X(),X(`- Commit style: ${fX(J.commit_style)}`),X("- Branch off `main`; never commit to `main` directly."),X();if($.stack){let D=[];for(let[E,u]of Object.entries($.stack)){if(LN.has(E))continue;if(N0(u))D.push(`- **${R0(`stack.${E}`)}:** ${u.trim()}`)}if(D.length){X("## Stack"),X();for(let E of D)X(E);X()}}if($.human_context){let D=[];for(let[E,u]of Object.entries($.human_context))if(N0(u))D.push(`- **${R0(`human_context.${E}`)}:** ${u.trim()}`);if(D.length){X("## Human Context"),X();for(let E of D)X(E);X()}}let k=$.generated;if(j0(k))X(`*Context authored: ${String(k)}*`);return Z.join(`
241
- `)}function gX($,Z){c0(HN($,"AGENTS.md"),MN(Z))}import{existsSync as H6,readFileSync as vX}from"fs";import{join as K4}from"path";function NN($,Z){let X=[],z=(W)=>H6(K4($,W)),J=(W)=>{try{return vX(K4($,W),"utf-8")}catch{return""}};if(z("tsconfig.json")&&/"strict"\s*:\s*true/.test(J("tsconfig.json")))X.push("TypeScript strict mode (tsconfig.json)");if(Z?.type==="module")X.push("ESM modules (`type: module`)");let Q=[],Y=Z?.devDependencies??{};if(z(".eslintrc")||z(".eslintrc.json")||z(".eslintrc.cjs")||z("eslint.config.js")||z("eslint.config.mjs")||"eslint"in Y)Q.push("ESLint");if(z(".prettierrc")||z(".prettierrc.json")||z("prettier.config.js")||"prettier"in Y)Q.push("Prettier");let U=z("pyproject.toml")?J("pyproject.toml"):"";if(/\[tool\.black\]/.test(U))Q.push("black");if(/\[tool\.ruff\]/.test(U))Q.push("ruff");if(/\[tool\.mypy\]/.test(U))Q.push("mypy");if(z("rustfmt.toml")||z(".rustfmt.toml"))Q.push("rustfmt");if(Q.length)X.push(`Style enforced by ${Q.join(" · ")} — obey the configs`);return X}function hX($,Z){let X={...Z},z=null,J=K4($,"package.json");if(H6(J))try{z=JSON.parse(vX(J,"utf-8"))}catch{z=null}let Q=X6($,z);if(Object.keys(Q).length)X.commands={...Q,...Z.commands??{}};let Y=Z.key_files??Z.instant_context?.key_files;if(!Y||Y.length===0){let U=Z6($);if(U.length)X.key_files=U}if(!Z.security){let W=[".env",".env.local",".env.development"].find((G)=>H6(K4($,G)));if(W){let G=[".env.example",".env.sample",".env.template"].find((q)=>H6(K4($,q)));X.security={secrets:W,...G?{example:G}:{}}}}if(!Z.conventions){let U=NN($,z);if(U.length)X.conventions=U}return X}import{join as ON}from"path";function TN($){let Z=[];if(Z.push(a0($)),Z.push(""),Z.push("# .cursorrules"),Z.push(`# Authored 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(N0(z))Z.push(`# ${R0(`stack.${X}`)}: ${z.trim()}`)}return Z.push(""),Z.join(`
242
- `)}function uX($,Z){c0(ON($,".cursorrules"),TN(Z),"# faf:start","# faf:end")}import{join as DN}from"path";function IN($){let Z=[];if(Z.push(a0($)),Z.push(""),Z.push(`# GEMINI.md — ${$.project?.name??"Project"}`),Z.push(""),Z.push("> Authored 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(N0(z))Z.push(`- ${R0(`stack.${X}`)}: ${z.trim()}`)}return Z.push(""),Z.join(`
243
- `)}function mX($,Z){c0(DN($,"GEMINI.md"),IN(Z))}import{join as cX}from"path";import{mkdirSync as AN}from"fs";var dX=[["install","Install with"],["build","Build with"],["test","Test with"],["lint","Lint with"],["run","Run with"],["start","Start with"],["dev","Run the dev server with"]],RN=new Set([...dX.map(([$])=>$),"cicd"]);function FN($){let Z=[],X=$.project?.name??"Project";if(Z.push(a0($)),Z.push(""),Z.push(`# GitHub Copilot Instructions — ${X}`),Z.push(""),Z.push("> Authored from project.faf by FAF. Copilot reads these instructions on every request in this repository — keep them short and broadly applicable."),Z.push(""),N0($.project?.goal))Z.push($.project.goal.trim()),Z.push("");let z=$.stack??{},J=[];if(N0($.project?.main_language))J.push(`- **Language:** ${$.project.main_language.trim()}`);for(let[G,q]of Object.entries(z)){if(RN.has(G))continue;if(N0(q))J.push(`- **${R0(`stack.${G}`)}:** ${q.trim()}`)}if(J.length>0)Z.push("## Tech stack","",...J,"");let Q=[];for(let[G,q]of dX){let V=z[G];if(N0(V))Q.push(`- ${q} \`${V.trim()}\`.`)}if(N0(z.cicd))Q.push(`- CI runs on ${z.cicd.trim()}.`);if(Q.length>0)Z.push("## Build & run","",...Q,"");let Y=$.human_context??{},W=[["who",Y.who],["what",Y.what],["why",Y.why],["where",Y.where],["when",Y.when],["how",Y.how]].filter(([,G])=>N0(G)).map(([G,q])=>`- **${R0(`human_context.${G}`)}:** ${q.trim()}`);if(W.length>0)Z.push("## Project context","",...W,"");return Z.join(`
244
- `)}function pX($,Z){AN(cX($,".github"),{recursive:!0}),c0(cX($,".github","copilot-instructions.md"),FN(Z))}import{existsSync as _N,mkdirSync as PN,readFileSync as CN,writeFileSync as lX}from"fs";import{join as iX}from"path";var wN="https://mcpaas.live/grok/mcp/v1",nX="mcp_servers.grok-faf-mcp";function EN($){return[`[${nX}]`,`url = "${wN}"`,""].join(`
245
- `)}function rX($,Z){let X=iX($,".grok"),z=iX(X,"config.toml"),J=EN(Z);if(!_N(z))return PN(X,{recursive:!0}),lX(z,`# grok-faf-mcp — wired by FAF from project.faf
239
+ Run 'faf init' to create one.`),process.exit(2);let z=d(X),J=fX(z);if(!J.valid){console.log(`${R("invalid")} ${X}`);for(let U of J.errors)console.log(` ${L("x")} ${U}`);process.exit(3)}let Q=u(X);if(!n9(Q))console.log(`${R("invalid yaml")} ${X}`),process.exit(3);console.log(`${D("valid")} ${X}`);let Y=z0(Q);if(J0(Y,X),Z.strict&&Y.score<100)console.log(L(`
240
+ --strict requires 100%`)),process.exit(1)}import{join as BN}from"path";var x0=($)=>$!=null&&$!==""&&$!=="slotignored"&&!(Array.isArray($)&&$.length===0),gX=($)=>Array.isArray($)?$.join(", "):String($),LN=new Set(["commit_style","communication","response_style","explanation_level","explanations","documentation","code_first"]),MN=new Set(["target_user","core_problem","mission_purpose"]);function NN($){let Z=[],X=(x="")=>Z.push(x),z=$.ai_instructions,J=$.preferences,Q=$.instant_context,Y=$.security,U=$.commands,W=$.key_files??Q?.key_files,G=U?Object.entries(U).filter(([,x])=>x0(x)):[],q=G.filter(([x])=>/test/i.test(x)),V=G.filter(([x])=>/lint|check/i.test(x)&&!/test/i.test(x)),K=G.filter(([x])=>!/test|lint|check/i.test(x)),H=(x)=>{let c=x.toLowerCase();if(/install|deps/.test(c))return 0;if(/^build$|build/.test(c)&&!/rebuild/.test(c))return 1;if(/^dev$|develop/.test(c))return 2;if(/^start$|run/.test(c))return 3;return 4},T=[...K].sort((x,c)=>H(x[0])-H(c[0])||x[0].localeCompare(c[0])),B=[...q,...V],N=q[0]?.[1],A=T.find(([x])=>/build/i.test(x))?.[1];X(o0($)),X(),X(`# AGENTS.md — ${$.project?.name??"Project"}`),X();let C=[];if($.project?.main_language)C.push(String($.project.main_language));if(x0($.project?.type))C.push(`type: ${String($.project?.type)}`);if(x0($.project?.version))C.push(`v${String($.project?.version)}`);let w=$.project?.goal?String($.project.goal):"";if(C.length)w+=(w?" — ":"")+C.join(" · ");if(w)X(w),X();if(X("> Authored by faf — do not edit the managed block; refresh with `faf export --agents`. Hand content outside `<!-- faf:start -->` … `<!-- faf:end -->` is preserved."),X(),T.length){X("## Setup & build"),X(),X("```bash");for(let[x,c]of T)X(`${c} # ${x}`);X("```"),X()}if(B.length){X("## Run the tests"),X(),X("```bash");for(let[,x]of B)X(x);X("```"),X()}if(W&&W.length){X("## Where things live"),X();for(let x of W)X(`- \`${x}\``);X()}let b=new Map,k=(x)=>{if(!x)return;for(let[c,y0]of Object.entries(x)){if(LN.has(c)||!x0(y0))continue;let v1=k8(c);if(!b.has(v1))b.set(v1,gX(y0))}};k(z?.working_style),k(J);let y=$.conventions??[];if(b.size||y.length){X("## Conventions"),X();for(let[x,c]of b)X(`- **${x}:** ${c}`);for(let x of y)if(x0(x))X(`- ${x}`);X()}let i=(z?.warnings??[]).filter((x)=>x0(x)),I=["read the tree"];if(N)I.push(`run the tests (\`${N}\`)`);if(A)I.push("build the project");for(let[,x]of V.slice(0,1))I.push(`\`${x}\``);X("## Guardrails"),X();for(let x of i)X(`- ${x}`);X(`- **Always OK:** ${[...new Set(I)].join(" · ")}.`),X("- **Ask first:** dependency installs, deletions, migrations, schema changes, publish/release."),X("- **Never:** force-push · push straight to `main` (branch and open a PR) · commit secrets."),X();let m=[];for(let[,x]of V)m.push(`\`${x}\` exits 0`);for(let[,x]of q)m.push(`\`${x}\` passes`);if(m.push("changes committed with a conventional message"),X("## Definition of Done"),X(),X(`Done when: ${[...new Set(m)].join(" · ")}.`),X(),X("## When stuck"),X(),X("Ask a clarifying question, propose a short plan, or open a draft PR with notes — do not push large speculative changes to `main`."),X(),Y&&(x0(Y.secrets)||(Y.never??[]).length)){if(X("## Security & secrets"),X(),x0(Y.secrets)){let x=x0(Y.example)?` (see \`${Y.example}\`)`:"";X(`- Secrets live in \`${Y.secrets}\`${x}. Never read or commit them.`)}for(let x of Y.never??[])if(x0(x))X(`- Never read or commit \`${x}\`.`);X()}if(X("## Commit & PR"),X(),J&&x0(J.commit_style))X(`- Commit style: ${gX(J.commit_style)}`);else X("- Conventional Commits preferred (`feat:`, `fix:`, `chore:`, …).");if(X("- Branch off `main` and open a PR — never commit to `main` directly."),X("- If build/test scripts or layout change, refresh this file in the **same PR** (`faf export --agents`)."),X(),$.stack){let x=[];for(let[c,y0]of Object.entries($.stack)){if(MN.has(c))continue;if(F0(y0))x.push(`- **${S0(`stack.${c}`)}:** ${y0.trim()}`)}if(x.length){X("## Stack"),X();for(let c of x)X(c);X()}}let D0=$.generated;if(x0(D0))X(`*Context authored: ${String(D0)}*`);return Z.join(`
241
+ `)}function vX($,Z){d0(BN($,"AGENTS.md"),NN(Z))}import{existsSync as L3,readFileSync as hX}from"fs";import{join as B4}from"path";function ON($,Z){let X=[],z=(W)=>L3(B4($,W)),J=(W)=>{try{return hX(B4($,W),"utf-8")}catch{return""}};if(z("tsconfig.json")&&/"strict"\s*:\s*true/.test(J("tsconfig.json")))X.push("TypeScript strict mode (tsconfig.json)");if(Z?.type==="module")X.push("ESM modules (`type: module`)");let Q=[],Y=Z?.devDependencies??{};if(z(".eslintrc")||z(".eslintrc.json")||z(".eslintrc.cjs")||z("eslint.config.js")||z("eslint.config.mjs")||"eslint"in Y)Q.push("ESLint");if(z(".prettierrc")||z(".prettierrc.json")||z("prettier.config.js")||"prettier"in Y)Q.push("Prettier");let U=z("pyproject.toml")?J("pyproject.toml"):"";if(/\[tool\.black\]/.test(U))Q.push("black");if(/\[tool\.ruff\]/.test(U))Q.push("ruff");if(/\[tool\.mypy\]/.test(U))Q.push("mypy");if(z("rustfmt.toml")||z(".rustfmt.toml"))Q.push("rustfmt");if(Q.length)X.push(`Style enforced by ${Q.join(" · ")} — obey the configs`);return X}function uX($,Z){let X={...Z},z=null,J=B4($,"package.json");if(L3(J))try{z=JSON.parse(hX(J,"utf-8"))}catch{z=null}let Q=J3($,z);if(Object.keys(Q).length)X.commands={...Q,...Z.commands??{}};let Y=Z.key_files??Z.instant_context?.key_files;if(!Y||Y.length===0){let U=z3($);if(U.length)X.key_files=U}if(!Z.security){let W=[".env",".env.local",".env.development"].find((G)=>L3(B4($,G)));if(W){let G=[".env.example",".env.sample",".env.template"].find((q)=>L3(B4($,q)));X.security={secrets:W,...G?{example:G}:{}}}}if(!Z.conventions){let U=ON($,z);if(U.length)X.conventions=U}return X}import{join as TN}from"path";function DN($){let Z=[];if(Z.push(o0($)),Z.push(""),Z.push("# .cursorrules"),Z.push(`# Authored 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(F0(z))Z.push(`# ${S0(`stack.${X}`)}: ${z.trim()}`)}return Z.push(""),Z.join(`
242
+ `)}function mX($,Z){d0(TN($,".cursorrules"),DN(Z),"# faf:start","# faf:end")}import{join as IN}from"path";function AN($){let Z=[];if(Z.push(o0($)),Z.push(""),Z.push(`# GEMINI.md — ${$.project?.name??"Project"}`),Z.push(""),Z.push("> Authored 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(F0(z))Z.push(`- ${S0(`stack.${X}`)}: ${z.trim()}`)}return Z.push(""),Z.join(`
243
+ `)}function cX($,Z){d0(IN($,"GEMINI.md"),AN(Z))}import{join as dX}from"path";import{mkdirSync as RN}from"fs";var pX=[["install","Install with"],["build","Build with"],["test","Test with"],["lint","Lint with"],["run","Run with"],["start","Start with"],["dev","Run the dev server with"]],FN=new Set([...pX.map(([$])=>$),"cicd"]);function _N($){let Z=[],X=$.project?.name??"Project";if(Z.push(o0($)),Z.push(""),Z.push(`# GitHub Copilot Instructions — ${X}`),Z.push(""),Z.push("> Authored from project.faf by FAF. Copilot reads these instructions on every request in this repository — keep them short and broadly applicable."),Z.push(""),F0($.project?.goal))Z.push($.project.goal.trim()),Z.push("");let z=$.stack??{},J=[];if(F0($.project?.main_language))J.push(`- **Language:** ${$.project.main_language.trim()}`);for(let[G,q]of Object.entries(z)){if(FN.has(G))continue;if(F0(q))J.push(`- **${S0(`stack.${G}`)}:** ${q.trim()}`)}if(J.length>0)Z.push("## Tech stack","",...J,"");let Q=[];for(let[G,q]of pX){let V=z[G];if(F0(V))Q.push(`- ${q} \`${V.trim()}\`.`)}if(F0(z.cicd))Q.push(`- CI runs on ${z.cicd.trim()}.`);if(Q.length>0)Z.push("## Build & run","",...Q,"");let Y=$.human_context??{},W=[["who",Y.who],["what",Y.what],["why",Y.why],["where",Y.where],["when",Y.when],["how",Y.how]].filter(([,G])=>F0(G)).map(([G,q])=>`- **${S0(`human_context.${G}`)}:** ${q.trim()}`);if(W.length>0)Z.push("## Project context","",...W,"");return Z.join(`
244
+ `)}function lX($,Z){RN(dX($,".github"),{recursive:!0}),d0(dX($,".github","copilot-instructions.md"),_N(Z))}import{existsSync as PN,mkdirSync as CN,readFileSync as wN,writeFileSync as iX}from"fs";import{join as nX}from"path";var EN="https://mcpaas.live/grok/mcp/v1",rX="mcp_servers.grok-faf-mcp";function jN($){return[`[${rX}]`,`url = "${EN}"`,""].join(`
245
+ `)}function sX($,Z){let X=nX($,".grok"),z=nX(X,"config.toml"),J=jN(Z);if(!PN(z))return CN(X,{recursive:!0}),iX(z,`# grok-faf-mcp — wired by FAF from project.faf
246
246
 
247
- `+J,"utf-8"),"created";let Q=CN(z,"utf-8");if(Q.includes(`[${nX}]`))return"unchanged";let Y=Q.endsWith(`
247
+ `+J,"utf-8"),"created";let Q=wN(z,"utf-8");if(Q.includes(`[${rX}]`))return"unchanged";let Y=Q.endsWith(`
248
248
 
249
249
  `)?"":Q.endsWith(`
250
250
  `)?`
251
251
  `:`
252
252
 
253
- `;return lX(z,Q+Y+J,"utf-8"),"merged"}d();import{writeFileSync as jN}from"fs";import{join as SN}from"path";var sX=W4.orange,xN=W4.cyan,bN=W4.cyanDeep,kN="#FF9500",yN="#FF3B30",fN="#E6EDF3",gN="#6E7681",aX={TROPHY:{glyph:"\uD83C\uDFC6",color:sX},GOLD:{glyph:"★",color:sX},SILVER:{glyph:"◆",color:xN},BRONZE:{glyph:"◇",color:bN},GREEN:{glyph:"●",color:fN},YELLOW:{glyph:"●",color:kN},RED:{glyph:"○",color:yN},WHITE:{glyph:"♡",color:gN}};function W1($){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 B6($){return $.filter(([,Z])=>Z!==void 0&&Z!==null&&String(Z).trim()!=="").map(([Z,X])=>`<div class="row"><div class="k">${W1(Z)}</div><div class="v">${W1(X)}</div></div>`).join(`
254
- `)}function vN($,Z,X="project.faf"){let z=W1($.project?.name??"Project"),J=Z.tier?.name??"WHITE",Q=aX[J]??aX.WHITE,Y=Z.inherited?Z.represents?`inherited from ${W1(Z.represents)}`:"inherited":`${Z.score}%`,U=J==="TROPHY"&&!Z.inherited,W=$.human_context??{},G=oX.map((B)=>[B,W[B]]),q=Object.entries(W).filter(([B])=>!oX.includes(B)),V=[["goal",$.project?.goal],["main_language",$.project?.main_language],["type",$.project?.type],["framework",$.project?.framework],["faf_version",$.faf_version]],K=Object.entries($.stack??{}),H=K.filter(([,B])=>B&&B!=="slotignored"&&String(B).trim()!==""),T=K.filter(([,B])=>B==="slotignored").length;return`<!DOCTYPE html>
253
+ `;return iX(z,Q+Y+J,"utf-8"),"merged"}p();import{writeFileSync as SN}from"fs";import{join as xN}from"path";var aX=q4.orange,bN=q4.cyan,kN=q4.cyanDeep,yN="#FF9500",fN="#FF3B30",gN="#E6EDF3",vN="#6E7681",oX={TROPHY:{glyph:"\uD83C\uDFC6",color:aX},GOLD:{glyph:"★",color:aX},SILVER:{glyph:"◆",color:bN},BRONZE:{glyph:"◇",color:kN},GREEN:{glyph:"●",color:gN},YELLOW:{glyph:"●",color:yN},RED:{glyph:"○",color:fN},WHITE:{glyph:"♡",color:vN}};function q1($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var tX=["who","what","why","where","when","how"];function M3($){return $.filter(([,Z])=>Z!==void 0&&Z!==null&&String(Z).trim()!=="").map(([Z,X])=>`<div class="row"><div class="k">${q1(Z)}</div><div class="v">${q1(X)}</div></div>`).join(`
254
+ `)}function hN($,Z,X="project.faf"){let z=q1($.project?.name??"Project"),J=Z.tier?.name??"WHITE",Q=oX[J]??oX.WHITE,Y=Z.inherited?Z.represents?`inherited from ${q1(Z.represents)}`:"inherited":`${Z.score}%`,U=J==="TROPHY"&&!Z.inherited,W=$.human_context??{},G=tX.map((B)=>[B,W[B]]),q=Object.entries(W).filter(([B])=>!tX.includes(B)),V=[["goal",$.project?.goal],["main_language",$.project?.main_language],["type",$.project?.type],["framework",$.project?.framework],["faf_version",$.faf_version]],K=Object.entries($.stack??{}),H=K.filter(([,B])=>B&&B!=="slotignored"&&String(B).trim()!==""),T=K.filter(([,B])=>B==="slotignored").length;return`<!DOCTYPE html>
255
255
  <html lang="en">
256
256
  <head>
257
257
  <meta charset="UTF-8">
@@ -292,7 +292,7 @@ footer strong{color:#e6edf3}
292
292
  <div class="eyebrow">project.faf · visual render</div>
293
293
  <header>
294
294
  <h1>${z}</h1>
295
- <span class="badge">${Q.glyph} ${W1(J)}</span>
295
+ <span class="badge">${Q.glyph} ${q1(J)}</span>
296
296
  <span class="score">${Y}</span>
297
297
  </header>
298
298
  <div class="meter"><span></span></div>
@@ -300,91 +300,91 @@ ${U?'<p class="award statline"><span class="awd-pre">✅ All Required slots fill
300
300
 
301
301
  <section>
302
302
  <h2>The 6 W's</h2>
303
- ${B6(G)||'<p class="muted">No human_context yet.</p>'}
304
- ${q.length?B6(q):""}
303
+ ${M3(G)||'<p class="muted">No human_context yet.</p>'}
304
+ ${q.length?M3(q):""}
305
305
  </section>
306
306
 
307
307
  <section>
308
308
  <h2>Project</h2>
309
- ${B6(V)||'<p class="muted">—</p>'}
309
+ ${M3(V)||'<p class="muted">—</p>'}
310
310
  </section>
311
311
 
312
312
  <section>
313
313
  <h2>Stack</h2>
314
- ${H.length?B6(H):'<p class="muted">No active stack slots.</p>'}
314
+ ${H.length?M3(H):'<p class="muted">No active stack slots.</p>'}
315
315
  </section>
316
316
 
317
317
  <footer>
318
- Rendered on-demand from your current <strong>${W1(X)}</strong><br>
318
+ Rendered on-demand from your current <strong>${q1(X)}</strong><br>
319
319
  <strong>Humans like visuals. <span style="color:#00D4D4">We gave them one.</span></strong>
320
320
  </footer>
321
321
  </div>
322
322
  </body>
323
323
  </html>
324
- `}function L6($,Z,X,z="project.faf"){jN(SN($,"project.html"),vN(Z,X,z),"utf-8")}import{writeFileSync as hN}from"fs";import{join as uN}from"path";var tX="application/vnd.faf+yaml",mN="https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json",cN=/^[a-zA-Z0-9.-]+\/[a-zA-Z0-9._-]+$/;function $z($){let Z=String($.project?.name??"project").trim();if(Z.includes("/")&&cN.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 dN($){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 Zz($,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 pN($,Z={}){let X={$schema:mN,name:$z($),version:String($.project?.version??"0.1.0"),description:dN($)},z=f3($)??$.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":Zz($,Z)},X}var y3="io.modelcontextprotocol.registry/publisher-provided",eX=4096;function Xz($,Z={}){let X={"one.faf/context":Zz($,Z)},z=new TextEncoder().encode(JSON.stringify(X)).length;if(z>eX)throw Error(`publisher-provided _meta is ${z}B — exceeds the registry ${eX}B cap`);return{[y3]:X}}function zz($){return $z($)}function f3($){let Z=$.project?.title;if(typeof Z==="string"){let X=Z.trim();if(X&&X.length<=100)return X}return}function Jz($,Z,X={}){let z=pN(Z,X),J=uN($,"server-card");return hN(J,JSON.stringify(z,null,2)+`
325
- `,"utf-8"),J}d();function G1($={}){let Z=g();if(!Z)console.error(`Error: project.faf not found
324
+ `}function N3($,Z,X,z="project.faf"){SN(xN($,"project.html"),hN(Z,X,z),"utf-8")}import{writeFileSync as uN}from"fs";import{join as mN}from"path";var eX="application/vnd.faf+yaml",cN="https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json",dN=/^[a-zA-Z0-9.-]+\/[a-zA-Z0-9._-]+$/;function Zz($){let Z=String($.project?.name??"project").trim();if(Z.includes("/")&&dN.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 pN($){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 Xz($,Z={}){return{faf:Z.fafPointer??"./project.faf",mediaType:eX,iana:`https://www.iana.org/assignments/media-types/${eX}`,deterministic:!0,...Z.scoreEndpoint?{scoreEndpoint:Z.scoreEndpoint}:{},generated:$.generated??Z.now??new Date().toISOString()}}function lN($,Z={}){let X={$schema:cN,name:Zz($),version:String($.project?.version??"0.1.0"),description:pN($)},z=v8($)??$.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":Xz($,Z)},X}var g8="io.modelcontextprotocol.registry/publisher-provided",$z=4096;function zz($,Z={}){let X={"one.faf/context":Xz($,Z)},z=new TextEncoder().encode(JSON.stringify(X)).length;if(z>$z)throw Error(`publisher-provided _meta is ${z}B — exceeds the registry ${$z}B cap`);return{[g8]:X}}function Jz($){return Zz($)}function v8($){let Z=$.project?.title;if(typeof Z==="string"){let X=Z.trim();if(X&&X.length<=100)return X}return}function Qz($,Z,X={}){let z=lN(Z,X),J=mN($,"server-card");return uN(J,JSON.stringify(z,null,2)+`
325
+ `,"utf-8"),J}p();function V1($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
326
326
 
327
- Run 'faf init' to create one.`),process.exit(2);let X=process.cwd(),z=c(Z),J=$.all||!$.agents&&!$.cursor&&!$.gemini&&!$.copilot&&!$.grok&&!$.conductor&&!$.html&&!$.card;if(J||$.agents)gX(X,hX(X,z)),console.log(" AGENTS.md");if(J||$.cursor)uX(X,z),console.log(" .cursorrules");if(J||$.gemini)mX(X,z),console.log(" GEMINI.md");if(J||$.copilot)pX(X,z),console.log(" .github/copilot-instructions.md");if($.grok){let Y=rX(X,z);console.log(` .grok/config.toml (${Y})`)}if(J||$.html){let Y=X0(h(Z));L6(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=Jz(X,z);console.log(` ${Y.replace(`${X}/`,"")}`)}console.log(`${I("exported")} ${L(`from ${Z}`)}`)}import{existsSync as Qz,readFileSync as lN,writeFileSync as iN}from"fs";import{resolve as g3}from"path";d();var nN=["$schema","name","title","description","icons","version","repository","websiteUrl","packages","remotes","_meta"];function Yz($={}){let Z=$.faf?g3($.faf):g();if(!Z||!Qz(Z))console.error(`Error: project.faf not found
327
+ Run 'faf init' to create one.`),process.exit(2);let X=process.cwd(),z=d(Z),J=$.all||!$.agents&&!$.cursor&&!$.gemini&&!$.copilot&&!$.grok&&!$.conductor&&!$.html&&!$.card;if(J||$.agents)vX(X,uX(X,z)),console.log(" AGENTS.md");if(J||$.cursor)mX(X,z),console.log(" .cursorrules");if(J||$.gemini)cX(X,z),console.log(" GEMINI.md");if(J||$.copilot)lX(X,z),console.log(" .github/copilot-instructions.md");if($.grok){let Y=sX(X,z);console.log(` .grok/config.toml (${Y})`)}if(J||$.html){let Y=z0(u(Z));N3(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=Qz(X,z);console.log(` ${Y.replace(`${X}/`,"")}`)}console.log(`${D("exported")} ${L(`from ${Z}`)}`)}import{existsSync as Yz,readFileSync as iN,writeFileSync as nN}from"fs";import{resolve as h8}from"path";p();var rN=["$schema","name","title","description","icons","version","repository","websiteUrl","packages","remotes","_meta"];function Uz($={}){let Z=$.faf?h8($.faf):v();if(!Z||!Yz(Z))console.error(`Error: project.faf not found
328
328
 
329
- Run 'faf init' to create one.`),process.exit(2);let X=c(Z),z=g3($.in??"./server.json");if(!Qz(z))console.error(`Error: ${z} not found.
329
+ Run 'faf init' to create one.`),process.exit(2);let X=d(Z),z=h8($.in??"./server.json");if(!Yz(z))console.error(`Error: ${z} not found.
330
330
 
331
331
  'faf server-card' patches the identity into an existing registry server.json;
332
- it does not create packages/icons. Seed a server.json first, then run this.`),process.exit(2);let J=JSON.parse(lN(z,"utf-8")),Y=J._meta?.[y3]?.["one.faf/context"]?.generated,U=$.generated??Y,W=zz(X),G=f3(X),q=Xz(X,{fafPointer:"./project.faf",now:U}),V={...J,name:W,...$.setVersion?{version:$.setVersion}:{},_meta:{...J._meta??{},...q}};if(G)V.title=G;else delete V.title;let K={};for(let B of nN)if(B in V&&V[B]!==void 0)K[B]=V[B];for(let B of Object.keys(V))if(!(B in K)&&V[B]!==void 0)K[B]=V[B];let H=JSON.stringify(K,null,2)+`
333
- `;if($.check){process.stdout.write(H);return}let T=g3($.out??z);iN(T,H),console.error(`${I("✓")} ${T} — name=${W} title=${G??"(none)"} ${L("(identity emitted from faf-cli)")}`)}import{join as rN}from"path";import sN from"open";d();function aN($){if(process.env.CI)return!1;try{return sN($).catch(()=>{return}),!0}catch{return!1}}function Uz(){let $=g();if(!$)console.error(`Error: project.faf not found
332
+ it does not create packages/icons. Seed a server.json first, then run this.`),process.exit(2);let J=JSON.parse(iN(z,"utf-8")),Y=J._meta?.[g8]?.["one.faf/context"]?.generated,U=$.generated??Y,W=Jz(X),G=v8(X),q=zz(X,{fafPointer:"./project.faf",now:U}),V={...J,name:W,...$.setVersion?{version:$.setVersion}:{},_meta:{...J._meta??{},...q}};if(G)V.title=G;else delete V.title;let K={};for(let B of rN)if(B in V&&V[B]!==void 0)K[B]=V[B];for(let B of Object.keys(V))if(!(B in K)&&V[B]!==void 0)K[B]=V[B];let H=JSON.stringify(K,null,2)+`
333
+ `;if($.check){process.stdout.write(H);return}let T=h8($.out??z);nN(T,H),console.error(`${D("✓")} ${T} — name=${W} title=${G??"(none)"} ${L("(identity emitted from faf-cli)")}`)}import{join as sN}from"path";import aN from"open";p();function oN($){if(process.env.CI)return!1;try{return aN($).catch(()=>{return}),!0}catch{return!1}}function Wz(){let $=v();if(!$)console.error(`Error: project.faf not found
334
334
 
335
- Run 'faf init' to create one.`),process.exit(2);let Z=process.cwd(),X=c($),z=X0(h($));L6(Z,X,z,$);let J=rN(Z,"project.html"),Q=aN(J);console.log(" project.html"),console.log(Q?`${I("opened")} ${L("in your browser")}`:`${I("rendered")} ${L(`file://${J}`)}`)}import{mkdirSync as oN,rmSync as tN,existsSync as eN}from"fs";import{join as Wz,resolve as $O}from"path";import{execFileSync as ZO}from"child_process";import{tmpdir as XO}from"os";d();function zO($){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 JO($){return $.replace(/\.git$/i,"").replace(/\/+$/,"").split("/").pop()||"project"}function QO($,Z,X){return["clone","--depth","1",...X?["--branch",X]:[],"--",$,Z]}function YO($,Z=process.cwd()){if($.stdout)return{outputPath:null};let X=$.output?$O(Z,$.output):Wz(Z,"project.faf");if(eN(X)&&!$.force)throw Error(`${X} already exists — refusing to overwrite your context.
336
- `+" Use --force to replace it, --output <path> to write elsewhere, or --stdout to just view it.");return{outputPath:X}}function Gz($,Z={},X=process.cwd()){let z;try{z=zO($)}catch(Y){console.error(`Error: ${Y.message}
335
+ Run 'faf init' to create one.`),process.exit(2);let Z=process.cwd(),X=d($),z=z0(u($));N3(Z,X,z,$);let J=sN(Z,"project.html"),Q=oN(J);console.log(" project.html"),console.log(Q?`${D("opened")} ${L("in your browser")}`:`${D("rendered")} ${L(`file://${J}`)}`)}import{mkdirSync as tN,rmSync as eN,existsSync as $O}from"fs";import{join as Gz,resolve as ZO}from"path";import{execFileSync as XO}from"child_process";import{tmpdir as zO}from"os";p();function JO($){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 QO($){return $.replace(/\.git$/i,"").replace(/\/+$/,"").split("/").pop()||"project"}function YO($,Z,X){return["clone","--depth","1",...X?["--branch",X]:[],"--",$,Z]}function UO($,Z=process.cwd()){if($.stdout)return{outputPath:null};let X=$.output?ZO(Z,$.output):Gz(Z,"project.faf");if($O(X)&&!$.force)throw Error(`${X} already exists — refusing to overwrite your context.
336
+ `+" Use --force to replace it, --output <path> to write elsewhere, or --stdout to just view it.");return{outputPath:X}}function qz($,Z={},X=process.cwd()){let z;try{z=JO($)}catch(Y){console.error(`Error: ${Y.message}
337
337
 
338
- Usage: faf git <url> [--ref <branch|tag>] [--output <path>] [--force] [--stdout]`),process.exit(1)}let J;try{J=YO(Z,X)}catch(Y){console.error(`Error: ${Y.message}`),process.exit(1);return}let Q=Wz(XO(),`faf-git-${Date.now()}`);oN(Q,{recursive:!0});try{console.error(L(`cloning ${$}${Z.ref?` @ ${Z.ref}`:""}...`));try{ZO("git",QO(z,Q,Z.ref),{stdio:"pipe"})}catch(G){let V=(G?.stderr?.toString()??"").trim().split(`
338
+ Usage: faf git <url> [--ref <branch|tag>] [--output <path>] [--force] [--stdout]`),process.exit(1)}let J;try{J=UO(Z,X)}catch(Y){console.error(`Error: ${Y.message}`),process.exit(1);return}let Q=Gz(zO(),`faf-git-${Date.now()}`);tN(Q,{recursive:!0});try{console.error(L(`cloning ${$}${Z.ref?` @ ${Z.ref}`:""}...`));try{XO("git",YO(z,Q,Z.ref),{stdio:"pipe"})}catch(G){let V=(G?.stderr?.toString()??"").trim().split(`
339
339
  `).slice(-2).join(" ").trim()||"git clone failed",K=Z.ref?`
340
340
 
341
341
  (does the branch/tag '${Z.ref}' exist?)`:"";console.error(`Error: could not clone ${$}
342
342
 
343
- ${V}${K}`),process.exit(1)}let Y=Q1(Q);if(Y.project&&/^faf-git-\d+$/.test(String(Y.project.name??"")))Y.project.name=JO(z);if(J.outputPath===null){process.stdout.write(O3(Y));return}s(J.outputPath,Y),console.log(`${I("created")} ${J.outputPath}`);let U=h(J.outputPath),W=V0(U0(U));z0(W,J.outputPath)}finally{tN(Q,{recursive:!0,force:!0})}}import{execFileSync as H$}from"child_process";import{readFileSync as Bz,existsSync as Lz,appendFileSync as UO}from"fs";import{join as WO}from"path";var q1=($)=>String($).trim(),GO="slotignored",qz=($)=>A0($)||typeof $==="string"&&$.trim().toLowerCase()===GO;function qO($,Z){let X=[],z=0,J=0;for(let Q of a){let Y=q4($,Q),U=q4(Z,Q),W=!qz(Y),G=!qz(U);if(W)z++;if(G)J++;let q=Q.label??Q.path.split(".").pop()??Q.path,V={path:Q.path,label:q,category:String(Q.category)};if(!W&&G)X.push({...V,kind:"added",to:q1(U)});else if(W&&!G)X.push({...V,kind:"removed",from:q1(Y)});else if(W&&G&&q1(Y)!==q1(U))X.push({...V,kind:"changed",from:q1(Y),to:q1(U)})}return{changes:X,filledBase:z,filledTarget:J}}function Vz($){if(!$.trim())return 0;try{return X0($).score??0}catch{return 0}}function Kz($){if(!$.trim())return{};try{return p9($)??{}}catch{return{}}}function O6($,Z){let{changes:X,filledBase:z,filledTarget:J}=qO(Kz($),Kz(Z)),Q=Vz($),Y=Vz(Z);return{changes:X,scoreBase:Q,scoreTarget:Y,scoreDelta:Y-Q,filledBase:z,filledTarget:J}}var VO={added:"+",removed:"-",changed:"~"},Hz=($)=>$>0?`+${$}`:`${$}`,M6=($,Z=64)=>$.length>Z?`${$.slice(0,Z-1)}…`:$;function Mz($,Z,X){let z=[],J=y0(K$($.scoreBase)),Q=y0(K$($.scoreTarget));if(z.push(`project.faf ${Z} → ${X}`),z.push(`Score: ${$.scoreBase}% ${J} → ${$.scoreTarget}% ${Q} (${Hz($.scoreDelta)})`),z.push(""),$.changes.length===0)z.push(" (no slot changes)");else{let Y="";for(let U of $.changes){if(U.category!==Y)z.push(` ${U.category}`),Y=U.category;let W=VO[U.kind],G=U.label.padEnd(16);if(U.kind==="changed")z.push(` ${W} ${G} ${M6(U.from)} → ${M6(U.to)}`);else if(U.kind==="added")z.push(` ${W} ${G} ${M6(U.to)} (added)`);else z.push(` ${W} ${G} ${M6(U.from)} (removed)`)}}return z.push(""),z.push(`Slots filled: ${$.filledBase} → ${$.filledTarget} (${Hz($.filledTarget-$.filledBase)})`),z.join(`
344
- `)}function KO($,Z){try{return H$("git",["rev-parse","--verify","--quiet",`${$}^{commit}`],{cwd:Z,stdio:["pipe","pipe","pipe"]}),!0}catch{return!1}}function H4($,Z){if(!KO($,Z))console.error(`Error: unknown git ref '${$}' — use a branch, tag, or commit that exists.`),process.exit(2)}function V1($,Z,X){try{return H$("git",["show",`${$}:${Z}`],{cwd:X,encoding:"utf-8",stdio:["pipe","pipe","pipe"]})}catch{return""}}function Nz($){let Z=$[0]??"project.faf";try{if($.length<5){console.log(`${Z} — unmerged (resolve the conflict, then \`faf diff\`)`);return}let X=(Q)=>Q&&Q!=="/dev/null"&&Lz(Q)?Bz(Q,"utf-8"):"",z=(Q,Y)=>{if(!Q||Q==="/dev/null")return"(absent)";if(!Y||/^0+$/.test(Y))return"(working tree)";return Y.slice(0,7)},J=O6(X($[1]),X($[4]));console.log(Mz(J,z($[1],$[2]),z($[4],$[5])))}catch(X){console.log(`${Z} — faf diff unavailable (${X instanceof Error?X.message:"error"})`)}}var N6="*.faf diff=faf";function v3($){let[Z,...X]=$.trim().split(/\s+/);try{return H$(Z,X,{stdio:["pipe","pipe","pipe"]}),!0}catch{return!1}}function Oz($){try{return H$("git",["rev-parse","--show-toplevel"],{cwd:$,encoding:"utf-8"}).trim()}catch{throw console.error("Error: not a git repository."),process.exit(2),Error("unreachable")}}function HO($){let Z=Oz($),X=WO(Z,".gitattributes"),z=Lz(X)?Bz(X,"utf-8"):"";if(!z.split(`
345
- `).some((J)=>J.trim()===N6))UO(X,`${z&&!z.endsWith(`
343
+ ${V}${K}`),process.exit(1)}let Y=U1(Q);if(Y.project&&/^faf-git-\d+$/.test(String(Y.project.name??"")))Y.project.name=QO(z);if(J.outputPath===null){process.stdout.write(D8(Y));return}o(J.outputPath,Y),console.log(`${D("created")} ${J.outputPath}`);let U=u(J.outputPath),W=K0(W0(U));J0(W,J.outputPath)}finally{eN(Q,{recursive:!0,force:!0})}}import{execFileSync as L$}from"child_process";import{readFileSync as Lz,existsSync as Mz,appendFileSync as WO}from"fs";import{join as GO}from"path";var K1=($)=>String($).trim(),qO="slotignored",Vz=($)=>R0($)||typeof $==="string"&&$.trim().toLowerCase()===qO;function VO($,Z){let X=[],z=0,J=0;for(let Q of t){let Y=K4($,Q),U=K4(Z,Q),W=!Vz(Y),G=!Vz(U);if(W)z++;if(G)J++;let q=Q.label??Q.path.split(".").pop()??Q.path,V={path:Q.path,label:q,category:String(Q.category)};if(!W&&G)X.push({...V,kind:"added",to:K1(U)});else if(W&&!G)X.push({...V,kind:"removed",from:K1(Y)});else if(W&&G&&K1(Y)!==K1(U))X.push({...V,kind:"changed",from:K1(Y),to:K1(U)})}return{changes:X,filledBase:z,filledTarget:J}}function Kz($){if(!$.trim())return 0;try{return z0($).score??0}catch{return 0}}function Hz($){if(!$.trim())return{};try{return l9($)??{}}catch{return{}}}function D3($,Z){let{changes:X,filledBase:z,filledTarget:J}=VO(Hz($),Hz(Z)),Q=Kz($),Y=Kz(Z);return{changes:X,scoreBase:Q,scoreTarget:Y,scoreDelta:Y-Q,filledBase:z,filledTarget:J}}var KO={added:"+",removed:"-",changed:"~"},Bz=($)=>$>0?`+${$}`:`${$}`,O3=($,Z=64)=>$.length>Z?`${$.slice(0,Z-1)}…`:$;function Nz($,Z,X){let z=[],J=v0(H$($.scoreBase)),Q=v0(H$($.scoreTarget));if(z.push(`project.faf ${Z} → ${X}`),z.push(`Score: ${$.scoreBase}% ${J} → ${$.scoreTarget}% ${Q} (${Bz($.scoreDelta)})`),z.push(""),$.changes.length===0)z.push(" (no slot changes)");else{let Y="";for(let U of $.changes){if(U.category!==Y)z.push(` ${U.category}`),Y=U.category;let W=KO[U.kind],G=U.label.padEnd(16);if(U.kind==="changed")z.push(` ${W} ${G} ${O3(U.from)} → ${O3(U.to)}`);else if(U.kind==="added")z.push(` ${W} ${G} ${O3(U.to)} (added)`);else z.push(` ${W} ${G} ${O3(U.from)} (removed)`)}}return z.push(""),z.push(`Slots filled: ${$.filledBase} → ${$.filledTarget} (${Bz($.filledTarget-$.filledBase)})`),z.join(`
344
+ `)}function HO($,Z){try{return L$("git",["rev-parse","--verify","--quiet",`${$}^{commit}`],{cwd:Z,stdio:["pipe","pipe","pipe"]}),!0}catch{return!1}}function L4($,Z){if(!HO($,Z))console.error(`Error: unknown git ref '${$}' — use a branch, tag, or commit that exists.`),process.exit(2)}function H1($,Z,X){try{return L$("git",["show",`${$}:${Z}`],{cwd:X,encoding:"utf-8",stdio:["pipe","pipe","pipe"]})}catch{return""}}function Oz($){let Z=$[0]??"project.faf";try{if($.length<5){console.log(`${Z} — unmerged (resolve the conflict, then \`faf diff\`)`);return}let X=(Q)=>Q&&Q!=="/dev/null"&&Mz(Q)?Lz(Q,"utf-8"):"",z=(Q,Y)=>{if(!Q||Q==="/dev/null")return"(absent)";if(!Y||/^0+$/.test(Y))return"(working tree)";return Y.slice(0,7)},J=D3(X($[1]),X($[4]));console.log(Nz(J,z($[1],$[2]),z($[4],$[5])))}catch(X){console.log(`${Z} — faf diff unavailable (${X instanceof Error?X.message:"error"})`)}}var T3="*.faf diff=faf";function u8($){let[Z,...X]=$.trim().split(/\s+/);try{return L$(Z,X,{stdio:["pipe","pipe","pipe"]}),!0}catch{return!1}}function Tz($){try{return L$("git",["rev-parse","--show-toplevel"],{cwd:$,encoding:"utf-8"}).trim()}catch{throw console.error("Error: not a git repository."),process.exit(2),Error("unreachable")}}function BO($){let Z=Tz($),X=GO(Z,".gitattributes"),z=Mz(X)?Lz(X,"utf-8"):"";if(!z.split(`
345
+ `).some((J)=>J.trim()===T3))WO(X,`${z&&!z.endsWith(`
346
346
  `)?`
347
- `:""}${N6}
348
- `),console.log(`✅ .gitattributes ${N6}`);else console.log(`• .gitattributes already opts in (${N6})`);if(H$("git",["config","diff.faf.command","faf diff-driver"],{cwd:$}),console.log("✅ git config diff.faf.command = faf diff-driver"),console.log("\n→ `git diff`, `git log -p`, `git show` now render the .faf score + slot delta."),!v3("faf diff-driver"))console.log("\n⚠ the `faf` on your PATH does not support `diff-driver` yet (needs faf ≥ 7.0)."),console.log(" `git diff` on .faf files falls back to the raw text diff until you upgrade.")}function BO($){Oz($);try{H$("git",["config","--unset","diff.faf.command"],{cwd:$,stdio:"pipe"})}catch{}console.log("✅ removed diff.faf.command (the .gitattributes line is left for you to keep or delete).")}function Tz($,Z={},X=process.cwd()){if(Z.installDriver)return HO(X);if(Z.uninstallDriver)return BO(X);let z=g(X);if(!z)console.error(`Error: project.faf not found
347
+ `:""}${T3}
348
+ `),console.log(`✅ .gitattributes ${T3}`);else console.log(`• .gitattributes already opts in (${T3})`);if(L$("git",["config","diff.faf.command","faf diff-driver"],{cwd:$}),console.log("✅ git config diff.faf.command = faf diff-driver"),console.log("\n→ `git diff`, `git log -p`, `git show` now render the .faf score + slot delta."),!u8("faf diff-driver"))console.log("\n⚠ the `faf` on your PATH does not support `diff-driver` yet (needs faf ≥ 7.0)."),console.log(" `git diff` on .faf files falls back to the raw text diff until you upgrade.")}function LO($){Tz($);try{L$("git",["config","--unset","diff.faf.command"],{cwd:$,stdio:"pipe"})}catch{}console.log("✅ removed diff.faf.command (the .gitattributes line is left for you to keep or delete).")}function Dz($,Z={},X=process.cwd()){if(Z.installDriver)return BO(X);if(Z.uninstallDriver)return LO(X);let z=v(X);if(!z)console.error(`Error: project.faf not found
349
349
 
350
- Run 'faf init' to create one.`),process.exit(2);let J;try{J=H$("git",["rev-parse","--show-toplevel"],{cwd:X,encoding:"utf-8"}).trim()}catch{console.error("Error: not a git repository — faf diff compares .faf versions across git history."),process.exit(2);return}let Q=e$(z,X),Y,U,W,G;if(!$)Y="HEAD",U="(working tree)",W=V1("HEAD",Q,X),G=h(z);else if($.includes("...")){let[V,K]=$.split("...");H4(V,X),H4(K,X);let H;try{H=H$("git",["merge-base",V,K],{cwd:X,encoding:"utf-8"}).trim()}catch{console.error(`Error: '${V}' and '${K}' have no common ancestor — can't compute a merge-base diff.`),process.exit(2);return}Y=H.slice(0,7),U=K,W=V1(H,Q,X),G=V1(K,Q,X)}else if($.includes("..")){let[V,K]=$.split("..");H4(V,X),H4(K,X),Y=V,U=K,W=V1(V,Q,X),G=V1(K,Q,X)}else H4($,X),Y=$,U="(working tree)",W=V1($,Q,X),G=h(z);let q=O6(W,G);if(Z.json)console.log(JSON.stringify({base:Y,target:U,...q},null,2));else console.log(Mz(q,Y,U))}import{execFileSync as h3}from"child_process";function LO($){if(!$.trim())return 0;try{return X0($).score??0}catch{return 0}}var MO=($)=>$>0?`+${$}`:`${$}`;function NO($){let Z=$.map((X)=>({...X,score:LO(X.raw)}));return Z.map((X,z)=>{let J=Z[z+1];return{hex:X.hex,date:X.date,subject:X.subject,score:X.score,delta:J?X.score-J.score:null,first:!J}})}function OO($,Z="project.faf"){if($.length===0)return`${Z} — no history (no commits touch it yet)`;let X=[];X.push(`${Z} — score timeline (${$.length} commit${$.length===1?"":"s"})`),X.push("");for(let z of $){let J=`${String(z.score).padStart(3)}%`,Q=z.first?" new ":z.delta===0?" ·":MO(z.delta).padStart(4);X.push(` ${J} ${Q} ${z.date} ${z.hex} ${y0(K$(z.score))} ${z.subject}`)}return X.join(`
351
- `)}function TO($,Z,X){try{return h3("git",["show",`${$}:${Z}`],{cwd:X,encoding:"utf-8",stdio:["pipe","pipe","pipe"]})}catch{return""}}function Dz($={},Z=process.cwd()){let X=g(Z);if(!X)console.error(`Error: project.faf not found
350
+ Run 'faf init' to create one.`),process.exit(2);let J;try{J=L$("git",["rev-parse","--show-toplevel"],{cwd:X,encoding:"utf-8"}).trim()}catch{console.error("Error: not a git repository — faf diff compares .faf versions across git history."),process.exit(2);return}let Q=Z1(z,X),Y,U,W,G;if(!$)Y="HEAD",U="(working tree)",W=H1("HEAD",Q,X),G=u(z);else if($.includes("...")){let[V,K]=$.split("...");L4(V,X),L4(K,X);let H;try{H=L$("git",["merge-base",V,K],{cwd:X,encoding:"utf-8"}).trim()}catch{console.error(`Error: '${V}' and '${K}' have no common ancestor — can't compute a merge-base diff.`),process.exit(2);return}Y=H.slice(0,7),U=K,W=H1(H,Q,X),G=H1(K,Q,X)}else if($.includes("..")){let[V,K]=$.split("..");L4(V,X),L4(K,X),Y=V,U=K,W=H1(V,Q,X),G=H1(K,Q,X)}else L4($,X),Y=$,U="(working tree)",W=H1($,Q,X),G=u(z);let q=D3(W,G);if(Z.json)console.log(JSON.stringify({base:Y,target:U,...q},null,2));else console.log(Nz(q,Y,U))}import{execFileSync as m8}from"child_process";function MO($){if(!$.trim())return 0;try{return z0($).score??0}catch{return 0}}var NO=($)=>$>0?`+${$}`:`${$}`;function OO($){let Z=$.map((X)=>({...X,score:MO(X.raw)}));return Z.map((X,z)=>{let J=Z[z+1];return{hex:X.hex,date:X.date,subject:X.subject,score:X.score,delta:J?X.score-J.score:null,first:!J}})}function TO($,Z="project.faf"){if($.length===0)return`${Z} — no history (no commits touch it yet)`;let X=[];X.push(`${Z} — score timeline (${$.length} commit${$.length===1?"":"s"})`),X.push("");for(let z of $){let J=`${String(z.score).padStart(3)}%`,Q=z.first?" new ":z.delta===0?" ·":NO(z.delta).padStart(4);X.push(` ${J} ${Q} ${z.date} ${z.hex} ${v0(H$(z.score))} ${z.subject}`)}return X.join(`
351
+ `)}function DO($,Z,X){try{return m8("git",["show",`${$}:${Z}`],{cwd:X,encoding:"utf-8",stdio:["pipe","pipe","pipe"]})}catch{return""}}function Iz($={},Z=process.cwd()){let X=v(Z);if(!X)console.error(`Error: project.faf not found
352
352
 
353
- Run 'faf init' to create one.`),process.exit(2);let z;try{z=h3("git",["rev-parse","--show-toplevel"],{cwd:Z,encoding:"utf-8"}).trim()}catch{console.error("Error: not a git repository — faf log reads the .faf score across git history."),process.exit(2);return}let J=e$(X,Z),Q=$.all?0:Math.max(0,parseInt($.limit??"20",10)||20),Y="";try{Y=h3("git",["log","--follow","--format=%h%x1f%ad%x1f%s","--date=short","--",J],{cwd:Z,encoding:"utf-8"})}catch{Y=""}let U=Y.split(`
354
- `).filter(Boolean).map((H)=>{let[T,B,N]=H.split("\x1F");return{hex:T,date:B,subject:N??""}}),W=Q>0?Math.min(U.length,Q+1):U.length,G=U.slice(0,W).map((H)=>({...H,raw:TO(H.hex,J,Z)})),q=NO(G),V=Q>0?q.slice(0,Q):q;if($.reverse)V=[...V].reverse();let K=U.length;if($.json)console.log(JSON.stringify({file:J,total:K,count:V.length,entries:V},null,2));else{let H=OO(V,J.split("/").pop()??"project.faf");if(Q>0&&K>V.length)H+=`
353
+ Run 'faf init' to create one.`),process.exit(2);let z;try{z=m8("git",["rev-parse","--show-toplevel"],{cwd:Z,encoding:"utf-8"}).trim()}catch{console.error("Error: not a git repository — faf log reads the .faf score across git history."),process.exit(2);return}let J=Z1(X,Z),Q=$.all?0:Math.max(0,parseInt($.limit??"20",10)||20),Y="";try{Y=m8("git",["log","--follow","--format=%h%x1f%ad%x1f%s","--date=short","--",J],{cwd:Z,encoding:"utf-8"})}catch{Y=""}let U=Y.split(`
354
+ `).filter(Boolean).map((H)=>{let[T,B,N]=H.split("\x1F");return{hex:T,date:B,subject:N??""}}),W=Q>0?Math.min(U.length,Q+1):U.length,G=U.slice(0,W).map((H)=>({...H,raw:DO(H.hex,J,Z)})),q=OO(G),V=Q>0?q.slice(0,Q):q;if($.reverse)V=[...V].reverse();let K=U.length;if($.json)console.log(JSON.stringify({file:J,total:K,count:V.length,entries:V},null,2));else{let H=TO(V,J.split("/").pop()??"project.faf");if(Q>0&&K>V.length)H+=`
355
355
 
356
- … showing ${V.length} of ${K} commits — \`faf log --all\` for the full timeline.`;console.log(H)}}import{execFileSync as T6}from"child_process";import{existsSync as u3,readFileSync as m3,writeFileSync as Rz,chmodSync as DO,mkdirSync as IO}from"fs";import{resolve as AO,dirname as RO}from"path";var D6="# >>> faf >>>",B4="# <<< faf <<<",Iz="faf hooks-run",FO=($)=>$>0?`+${$}`:`${$}`;function Fz($){return T6("git",["rev-parse","--show-toplevel"],{cwd:$,encoding:"utf-8"}).trim()}function Az($,Z){try{return T6("git",["show",$],{cwd:Z,encoding:"utf-8",stdio:["pipe","pipe","pipe"]})}catch{return null}}function _z($,Z){try{return T6("git",["config","--get",$],{cwd:Z,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim()||null}catch{return null}}function c3($){let Z=T6("git",["rev-parse","--git-path","hooks/pre-commit"],{cwd:$,encoding:"utf-8"}).trim();return AO($,Z)}function Pz($={},Z=process.cwd()){try{let X;try{X=Fz(Z)}catch{return}let z=g(Z);if(!z)return;let J=e$(z,Z),Q=Az(`:${J}`,Z);if(Q===null)return;let Y=Az(`HEAD:${J}`,Z)??"",U=O6(Y,Q),W=`${U.scoreBase}% → ${U.scoreTarget}% (${FO(U.scoreDelta)})`;if(U.scoreDelta<0){if(console.error(`⚠ faf: context regressed ${W} — ${U.changes.length} slot change(s)`),$.strict)console.error(" commit blocked (--strict). Fix with `faf score` / `faf sync`, or `git commit --no-verify` to override."),process.exit(1)}else console.log(`✓ faf: context ${W}`)}catch(X){console.error(`faf hooks: skipped (${X instanceof Error?X.message:"error"})`)}}function _O($,Z){let X=$.trim().split(/\s+/)[0],z=Z?`${$} --strict || exit 1`:`${$} || true`;return[D6,`if command -v ${X} >/dev/null 2>&1 && git diff --cached --name-only 2>/dev/null | grep -qE '\\.faf$'; then`,` ${z}`,"fi",B4,""].join(`
357
- `)}function PO($,Z={}){let X;try{X=Fz($)}catch{return console.error("Error: not a git repository — run `git init` first."),!1}let z=_z("core.hooksPath",$);if(z){let q=Z.runnerCmd??Iz;return console.error(`Error: core.hooksPath is set (${z}) — a hook manager (husky/lefthook/pre-commit) owns hooks here.`),console.error(" faf won't touch a managed hooks directory. Add this to your pre-commit yourself:"),console.error(` ${q}${Z.strict?" --strict":""}`),!1}let J=c3($),Q=Z.runnerCmd??Iz;if(!v3(Q)){let q=Q.trim().split(/\s+/)[0];if(Z.strict)return console.error(`Error: \`${q}\` on PATH doesn't support \`hooks-run\` yet (needs faf ≥ 7.0).`),console.error(" A --strict hook against an older faf would BLOCK your commits. Upgrade faf, then re-install."),!1;console.log(`⚠ \`${q}\` on PATH doesn't support \`hooks-run\` yet (needs faf ≥ 7.0) — the hook no-ops until you upgrade.`)}let Y=_O(Q,!!Z.strict),U=u3(J)?m3(J,"utf-8"):"",W=U.indexOf(D6),G=U.indexOf(B4);if(W!==-1&&G!==-1){let q=U.slice(G+B4.length).replace(/^\n/,"");U=U.slice(0,W)+Y+q}else if(U.trim())U=U.endsWith(`
356
+ … showing ${V.length} of ${K} commits — \`faf log --all\` for the full timeline.`;console.log(H)}}import{execFileSync as I3}from"child_process";import{existsSync as c8,readFileSync as d8,writeFileSync as Fz,chmodSync as IO,mkdirSync as AO}from"fs";import{resolve as RO,dirname as FO}from"path";var A3="# >>> faf >>>",M4="# <<< faf <<<",Az="faf hooks-run",_O=($)=>$>0?`+${$}`:`${$}`;function _z($){return I3("git",["rev-parse","--show-toplevel"],{cwd:$,encoding:"utf-8"}).trim()}function Rz($,Z){try{return I3("git",["show",$],{cwd:Z,encoding:"utf-8",stdio:["pipe","pipe","pipe"]})}catch{return null}}function Pz($,Z){try{return I3("git",["config","--get",$],{cwd:Z,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim()||null}catch{return null}}function p8($){let Z=I3("git",["rev-parse","--git-path","hooks/pre-commit"],{cwd:$,encoding:"utf-8"}).trim();return RO($,Z)}function Cz($={},Z=process.cwd()){try{let X;try{X=_z(Z)}catch{return}let z=v(Z);if(!z)return;let J=Z1(z,Z),Q=Rz(`:${J}`,Z);if(Q===null)return;let Y=Rz(`HEAD:${J}`,Z)??"",U=D3(Y,Q),W=`${U.scoreBase}% → ${U.scoreTarget}% (${_O(U.scoreDelta)})`;if(U.scoreDelta<0){if(console.error(`⚠ faf: context regressed ${W} — ${U.changes.length} slot change(s)`),$.strict)console.error(" commit blocked (--strict). Fix with `faf score` / `faf sync`, or `git commit --no-verify` to override."),process.exit(1)}else console.log(`✓ faf: context ${W}`)}catch(X){console.error(`faf hooks: skipped (${X instanceof Error?X.message:"error"})`)}}function PO($,Z){let X=$.trim().split(/\s+/)[0],z=Z?`${$} --strict || exit 1`:`${$} || true`;return[A3,`if command -v ${X} >/dev/null 2>&1 && git diff --cached --name-only 2>/dev/null | grep -qE '\\.faf$'; then`,` ${z}`,"fi",M4,""].join(`
357
+ `)}function CO($,Z={}){let X;try{X=_z($)}catch{return console.error("Error: not a git repository — run `git init` first."),!1}let z=Pz("core.hooksPath",$);if(z){let q=Z.runnerCmd??Az;return console.error(`Error: core.hooksPath is set (${z}) — a hook manager (husky/lefthook/pre-commit) owns hooks here.`),console.error(" faf won't touch a managed hooks directory. Add this to your pre-commit yourself:"),console.error(` ${q}${Z.strict?" --strict":""}`),!1}let J=p8($),Q=Z.runnerCmd??Az;if(!u8(Q)){let q=Q.trim().split(/\s+/)[0];if(Z.strict)return console.error(`Error: \`${q}\` on PATH doesn't support \`hooks-run\` yet (needs faf ≥ 7.0).`),console.error(" A --strict hook against an older faf would BLOCK your commits. Upgrade faf, then re-install."),!1;console.log(`⚠ \`${q}\` on PATH doesn't support \`hooks-run\` yet (needs faf ≥ 7.0) — the hook no-ops until you upgrade.`)}let Y=PO(Q,!!Z.strict),U=c8(J)?d8(J,"utf-8"):"",W=U.indexOf(A3),G=U.indexOf(M4);if(W!==-1&&G!==-1){let q=U.slice(G+M4.length).replace(/^\n/,"");U=U.slice(0,W)+Y+q}else if(U.trim())U=U.endsWith(`
358
358
  `)?`${U}
359
359
  ${Y}`:`${U}
360
360
 
361
361
  ${Y}`;else U=`#!/bin/sh
362
- ${Y}`;return IO(RO(J),{recursive:!0}),Rz(J,U),DO(J,493),console.log(`✅ pre-commit context guard installed — ${Z.strict?"STRICT (blocks on score regression)":"warn (informs only)"}`),console.log(" Skips when no .faf is staged · respects `git commit --no-verify` · fails open."),!0}function CO($){let Z;try{Z=c3($)}catch{return console.error("Error: not a git repository."),!1}if(!u3(Z))return console.log("• no pre-commit hook to clean."),!0;let X=m3(Z,"utf-8"),z=X.indexOf(D6),J=X.indexOf(B4);if(z===-1||J===-1)return console.log("• faf block not found in pre-commit — nothing to remove."),!0;let Q=(X.slice(0,z)+X.slice(J+B4.length).replace(/^\n/,"")).replace(/^#!\/bin\/sh\s*$/,`#!/bin/sh
363
- `);return Rz(Z,Q),console.log("✅ faf pre-commit block removed (other hook content preserved)."),!0}function wO($){let Z;try{Z=c3($)}catch{console.error("Error: not a git repository.");return}let X=_z("core.hooksPath",$),z=u3(Z)?m3(Z,"utf-8"):"",J=z.includes(D6),Q=/hooks-run --strict/.test(z);if(console.log("faf pre-commit context guard"),console.log(` installed: ${J?`yes (${Q?"strict":"warn"})`:"no"}`),X)console.log(` ⚠ core.hooksPath = ${X} (a hook manager owns hooks — faf won't install here)`);if(!J&&!X)console.log(" → `faf hooks --install` (add --strict to block on regression)")}function Cz($={}){let Z=process.cwd();if($.install){if(!PO(Z,{strict:$.strict}))process.exit(2);return}if($.uninstall){if(!CO(Z))process.exit(2);return}wO(Z)}d();function wz($={}){if($.version||Object.keys($).length===0)jO()}function jO(){let $=d3();console.log(`${I(R("faf"))} v${$.version}`),console.log(L(`kernel ${r9()} IANA application/vnd.faf+yaml`))}var L4=[{name:"HTML",extensions:[".html",".htm"],category:"web"},{name:"CSS",extensions:[".css"],category:"web"},{name:"JavaScript",extensions:[".js",".mjs",".cjs"],category:"web"},{name:"TypeScript",extensions:[".ts",".tsx",".mts",".cts"],category:"web"},{name:"JSX",extensions:[".jsx"],category:"web"},{name:"Vue",extensions:[".vue"],category:"web"},{name:"Svelte",extensions:[".svelte"],category:"web"},{name:"Astro",extensions:[".astro"],category:"web"},{name:"JSON",extensions:[".json"],category:"data"},{name:"YAML",extensions:[".yml",".yaml"],category:"data"},{name:"TOML",extensions:[".toml"],category:"data"},{name:"XML",extensions:[".xml"],category:"data"},{name:"CSV",extensions:[".csv"],category:"data"},{name:"INI",extensions:[".ini",".cfg"],category:"config"},{name:"Env",extensions:[".env"],category:"config"},{name:"Dockerfile",extensions:["Dockerfile"],category:"config"},{name:"Rust",extensions:[".rs"],category:"systems"},{name:"Go",extensions:[".go"],category:"systems"},{name:"C",extensions:[".c",".h"],category:"systems"},{name:"C++",extensions:[".cpp",".cc",".hpp"],category:"systems"},{name:"Zig",extensions:[".zig"],category:"systems"},{name:"Python",extensions:[".py"],category:"scripting"},{name:"Ruby",extensions:[".rb"],category:"scripting"},{name:"Shell",extensions:[".sh",".bash",".zsh"],category:"scripting"},{name:"Lua",extensions:[".lua"],category:"scripting"},{name:"Java",extensions:[".java"],category:"jvm"},{name:"Kotlin",extensions:[".kt",".kts"],category:"jvm"},{name:"Scala",extensions:[".scala"],category:"jvm"},{name:"C#",extensions:[".cs"],category:"dotnet"},{name:"F#",extensions:[".fs"],category:"dotnet"},{name:"Swift",extensions:[".swift"],category:"mobile"},{name:"Dart",extensions:[".dart"],category:"mobile"},{name:"Markdown",extensions:[".md",".mdx"],category:"docs"},{name:"LaTeX",extensions:[".tex"],category:"docs"},{name:"reStructuredText",extensions:[".rst"],category:"docs"},{name:"FAF",extensions:[".faf"],category:"faf"},{name:"FAFb",extensions:[".fafb"],category:"faf"}];d();function Ez(){console.log(`${I("formats")} ${L("— supported file types")}
364
- `);let $=new Map;for(let Z of L4){let X=$.get(Z.category)??[];X.push(Z),$.set(Z.category,X)}for(let[Z,X]of $){console.log(` ${R(Z)}`);for(let z of X)console.log(` ${z.name} ${L(z.extensions.join(", "))}`);console.log()}console.log(L(` ${L4.length} formats across ${$.size} categories`))}d();import{readdirSync as SO,rmSync as xO}from"fs";import{tmpdir as bO}from"os";import{join as kO}from"path";function jz(){let $=bO(),Z=0;try{let X=SO($);for(let z of X)if(z.startsWith("faf-git-"))xO(kO($,z),{recursive:!0,force:!0}),Z++}catch{}if(Z>0)console.log(`${I("cleared")} ${Z} cached director${Z===1?"y":"ies"}`);else console.log(L("nothing to clear"))}function Sz($={}){let Z=g();if(!Z)console.error(`Error: project.faf not found
362
+ ${Y}`;return AO(FO(J),{recursive:!0}),Fz(J,U),IO(J,493),console.log(`✅ pre-commit context guard installed — ${Z.strict?"STRICT (blocks on score regression)":"warn (informs only)"}`),console.log(" Skips when no .faf is staged · respects `git commit --no-verify` · fails open."),!0}function wO($){let Z;try{Z=p8($)}catch{return console.error("Error: not a git repository."),!1}if(!c8(Z))return console.log("• no pre-commit hook to clean."),!0;let X=d8(Z,"utf-8"),z=X.indexOf(A3),J=X.indexOf(M4);if(z===-1||J===-1)return console.log("• faf block not found in pre-commit — nothing to remove."),!0;let Q=(X.slice(0,z)+X.slice(J+M4.length).replace(/^\n/,"")).replace(/^#!\/bin\/sh\s*$/,`#!/bin/sh
363
+ `);return Fz(Z,Q),console.log("✅ faf pre-commit block removed (other hook content preserved)."),!0}function EO($){let Z;try{Z=p8($)}catch{console.error("Error: not a git repository.");return}let X=Pz("core.hooksPath",$),z=c8(Z)?d8(Z,"utf-8"):"",J=z.includes(A3),Q=/hooks-run --strict/.test(z);if(console.log("faf pre-commit context guard"),console.log(` installed: ${J?`yes (${Q?"strict":"warn"})`:"no"}`),X)console.log(` ⚠ core.hooksPath = ${X} (a hook manager owns hooks — faf won't install here)`);if(!J&&!X)console.log(" → `faf hooks --install` (add --strict to block on regression)")}function wz($={}){let Z=process.cwd();if($.install){if(!CO(Z,{strict:$.strict}))process.exit(2);return}if($.uninstall){if(!wO(Z))process.exit(2);return}EO(Z)}p();function Ez($={}){if($.version||Object.keys($).length===0)SO()}function SO(){let $=l8();console.log(`${D(R("faf"))} v${$.version}`),console.log(L(`kernel ${s9()} IANA application/vnd.faf+yaml`))}var N4=[{name:"HTML",extensions:[".html",".htm"],category:"web"},{name:"CSS",extensions:[".css"],category:"web"},{name:"JavaScript",extensions:[".js",".mjs",".cjs"],category:"web"},{name:"TypeScript",extensions:[".ts",".tsx",".mts",".cts"],category:"web"},{name:"JSX",extensions:[".jsx"],category:"web"},{name:"Vue",extensions:[".vue"],category:"web"},{name:"Svelte",extensions:[".svelte"],category:"web"},{name:"Astro",extensions:[".astro"],category:"web"},{name:"JSON",extensions:[".json"],category:"data"},{name:"YAML",extensions:[".yml",".yaml"],category:"data"},{name:"TOML",extensions:[".toml"],category:"data"},{name:"XML",extensions:[".xml"],category:"data"},{name:"CSV",extensions:[".csv"],category:"data"},{name:"INI",extensions:[".ini",".cfg"],category:"config"},{name:"Env",extensions:[".env"],category:"config"},{name:"Dockerfile",extensions:["Dockerfile"],category:"config"},{name:"Rust",extensions:[".rs"],category:"systems"},{name:"Go",extensions:[".go"],category:"systems"},{name:"C",extensions:[".c",".h"],category:"systems"},{name:"C++",extensions:[".cpp",".cc",".hpp"],category:"systems"},{name:"Zig",extensions:[".zig"],category:"systems"},{name:"Python",extensions:[".py"],category:"scripting"},{name:"Ruby",extensions:[".rb"],category:"scripting"},{name:"Shell",extensions:[".sh",".bash",".zsh"],category:"scripting"},{name:"Lua",extensions:[".lua"],category:"scripting"},{name:"Java",extensions:[".java"],category:"jvm"},{name:"Kotlin",extensions:[".kt",".kts"],category:"jvm"},{name:"Scala",extensions:[".scala"],category:"jvm"},{name:"C#",extensions:[".cs"],category:"dotnet"},{name:"F#",extensions:[".fs"],category:"dotnet"},{name:"Swift",extensions:[".swift"],category:"mobile"},{name:"Dart",extensions:[".dart"],category:"mobile"},{name:"Markdown",extensions:[".md",".mdx"],category:"docs"},{name:"LaTeX",extensions:[".tex"],category:"docs"},{name:"reStructuredText",extensions:[".rst"],category:"docs"},{name:"FAF",extensions:[".faf"],category:"faf"},{name:"FAFb",extensions:[".fafb"],category:"faf"}];p();function jz(){console.log(`${D("formats")} ${L("— supported file types")}
364
+ `);let $=new Map;for(let Z of N4){let X=$.get(Z.category)??[];X.push(Z),$.set(Z.category,X)}for(let[Z,X]of $){console.log(` ${R(Z)}`);for(let z of X)console.log(` ${z.name} ${L(z.extensions.join(", "))}`);console.log()}console.log(L(` ${N4.length} formats across ${$.size} categories`))}p();import{readdirSync as xO,rmSync as bO}from"fs";import{tmpdir as kO}from"os";import{join as yO}from"path";function Sz(){let $=kO(),Z=0;try{let X=xO($);for(let z of X)if(z.startsWith("faf-git-"))bO(yO($,z),{recursive:!0,force:!0}),Z++}catch{}if(Z>0)console.log(`${D("cleared")} ${Z} cached director${Z===1?"y":"ies"}`);else console.log(L("nothing to clear"))}function xz($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
365
365
 
366
- Run 'faf init' to create one.`),process.exit(2);if($.json){let X=c(Z);console.log(JSON.stringify(X,null,2))}else{let X=h(Z);console.log(X)}}d();function xz(){let $=g();if(!$)console.error(`Error: project.faf not found
366
+ 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=u(Z);console.log(X)}}p();function bz(){let $=v();if(!$)console.error(`Error: project.faf not found
367
367
 
368
- Run 'faf init' to create one.`),process.exit(2);let Z=c($),X=[];for(let z of a){let[J,Q]=z.path.split("."),U=Z[J]?.[Q];if(A0(U)||U==="slotignored")continue;X.push(`${z.path}: ${U}`)}if(X.length===0){console.log(L("no populated slots"));return}console.log(X.join(`
369
- `))}import{existsSync as yO,statSync as bz}from"fs";import{join as fO}from"path";d();var gO=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"];function kz(){let $=g();if(!$)console.error(`Error: project.faf not found
368
+ Run 'faf init' to create one.`),process.exit(2);let Z=d($),X=[];for(let z of t){let[J,Q]=z.path.split("."),U=Z[J]?.[Q];if(R0(U)||U==="slotignored")continue;X.push(`${z.path}: ${U}`)}if(X.length===0){console.log(L("no populated slots"));return}console.log(X.join(`
369
+ `))}import{existsSync as fO,statSync as kz}from"fs";import{join as gO}from"path";p();var vO=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"];function yz(){let $=v();if(!$)console.error(`Error: project.faf not found
370
370
 
371
- Run 'faf init' to create one.`),process.exit(2);let Z=process.cwd(),X=bz($).mtimeMs;console.log(`${I("drift")} ${L("— context file sync status")}
372
- `),console.log(` ${R(".faf")} ${L(p3(X))}`);let z=0;for(let J of gO){let Q=fO(Z,J);if(!yO(Q)){console.log(` ${L("○")} ${J} ${L("missing")}`);continue}let Y=bz(Q).mtimeMs,U=Y-X;if(Math.abs(U)<1000)console.log(` ${I("●")} ${J} ${L("in sync")}`);else if(U>0)console.log(` ${R("!")} ${J} ${R("newer")} ${L(p3(Y))}`),z++;else console.log(` ${L("○")} ${J} ${L("older")} ${L(p3(Y))}`),z++}if(z>0)console.log(L(`
373
- run ${R("'faf sync'")} to resolve drift`))}function p3($){let Z=Date.now()-$,X=Math.floor(Z/1000);if(X<60)return`${X}s ago`;let z=Math.floor(X/60);if(z<60)return`${z}m ago`;let J=Math.floor(z/60);if(J<24)return`${J}h ago`;return`${Math.floor(J/24)}d ago`}d();function yz($,Z){if(!$||Z===void 0)console.error(`Usage: faf edit <path> <value>
371
+ Run 'faf init' to create one.`),process.exit(2);let Z=process.cwd(),X=kz($).mtimeMs;console.log(`${D("drift")} ${L("— context file sync status")}
372
+ `),console.log(` ${R(".faf")} ${L(i8(X))}`);let z=0;for(let J of vO){let Q=gO(Z,J);if(!fO(Q)){console.log(` ${L("○")} ${J} ${L("missing")}`);continue}let Y=kz(Q).mtimeMs,U=Y-X;if(Math.abs(U)<1000)console.log(` ${D("●")} ${J} ${L("in sync")}`);else if(U>0)console.log(` ${R("!")} ${J} ${R("newer")} ${L(i8(Y))}`),z++;else console.log(` ${L("○")} ${J} ${L("older")} ${L(i8(Y))}`),z++}if(z>0)console.log(L(`
373
+ run ${R("'faf sync'")} to resolve drift`))}function i8($){let Z=Date.now()-$,X=Math.floor(Z/1000);if(X<60)return`${X}s ago`;let z=Math.floor(X/60);if(z<60)return`${z}m ago`;let J=Math.floor(z/60);if(J<24)return`${J}h ago`;return`${Math.floor(J/24)}d ago`}p();function fz($,Z){if(!$||Z===void 0)console.error(`Usage: faf edit <path> <value>
374
374
 
375
- Example: faf edit project.name "My Project"`),process.exit(1);let X=g();if(!X)console.error(`Error: project.faf not found
375
+ Example: faf edit project.name "My Project"`),process.exit(1);let X=v();if(!X)console.error(`Error: project.faf not found
376
376
 
377
- Run 'faf init' to create one.`),process.exit(2);let z=c(X),J=$.split(".");if(J.length!==2)console.error("Error: path must be section.field (e.g. project.name)"),process.exit(1);let[Q,Y]=J;if(!z[Q]||typeof z[Q]!=="object")z[Q]={};z[Q][Y]=Z,s(X,z),console.log(`${I("updated")} ${$} ${L("→")} ${Z}`)}import{existsSync as I6,readFileSync as l3}from"fs";import{join as M4}from"path";d();function fz(){let $=process.cwd(),Z=[],X={faf_version:"2.5.0",project:{}},z=M4($,"CLAUDE.md");if(I6(z)){let W=l3(z,"utf-8"),G=V6(W);if(G.project?.name)X.project.name=G.project.name;if(G.project?.goal)X.project.goal=G.project.goal;if(G.project?.main_language)X.project.main_language=G.project.main_language;Z.push("CLAUDE.md")}let J=M4($,"AGENTS.md");if(I6(J)){let W=l3(J,"utf-8");if(!X.project.name){let G=W.match(/^#\s+(.+)/m);if(G)X.project.name=G[1].trim()}Z.push("AGENTS.md")}let Q=M4($,"GEMINI.md");if(I6(Q)){let W=l3(Q,"utf-8");if(!X.project.name){let G=W.match(/^#\s+(.+)/m);if(G)X.project.name=G[1].trim()}Z.push("GEMINI.md")}let Y=M4($,".cursorrules");if(I6(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=g($);if(U){let W=c(U);if(!W.project)W.project={};if(X.project.name&&!W.project.name)W.project.name=X.project.name;if(X.project.goal&&!W.project.goal)W.project.goal=X.project.goal;if(X.project.main_language&&!W.project.main_language)W.project.main_language=X.project.main_language;s(U,W),console.log(`${I("◆")} recover merged into ${U}`)}else{let W=M4($,"project.faf");s(W,X),console.log(`${I("◆")} recover created ${W}`)}console.log(L(` sources: ${Z.join(", ")}`))}d();var N4="2.5.0";function gz($={}){let Z=g();if(!Z)console.error(`Error: project.faf not found
377
+ 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,o(X,z),console.log(`${D("updated")} ${$} ${L("→")} ${Z}`)}import{existsSync as R3,readFileSync as n8}from"fs";import{join as O4}from"path";p();function gz(){let $=process.cwd(),Z=[],X={faf_version:B$,project:{}},z=O4($,"CLAUDE.md");if(R3(z)){let W=n8(z,"utf-8"),G=H3(W);if(G.project?.name)X.project.name=G.project.name;if(G.project?.goal)X.project.goal=G.project.goal;if(G.project?.main_language)X.project.main_language=G.project.main_language;Z.push("CLAUDE.md")}let J=O4($,"AGENTS.md");if(R3(J)){let W=n8(J,"utf-8");if(!X.project.name){let G=W.match(/^#\s+(.+)/m);if(G)X.project.name=G[1].trim()}Z.push("AGENTS.md")}let Q=O4($,"GEMINI.md");if(R3(Q)){let W=n8(Q,"utf-8");if(!X.project.name){let G=W.match(/^#\s+(.+)/m);if(G)X.project.name=G[1].trim()}Z.push("GEMINI.md")}let Y=O4($,".cursorrules");if(R3(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 W=d(U);if(!W.project)W.project={};if(X.project.name&&!W.project.name)W.project.name=X.project.name;if(X.project.goal&&!W.project.goal)W.project.goal=X.project.goal;if(X.project.main_language&&!W.project.main_language)W.project.main_language=X.project.main_language;o(U,W),console.log(`${D("◆")} recover merged into ${U}`)}else{let W=O4($,"project.faf");o(W,X),console.log(`${D("◆")} recover created ${W}`)}console.log(L(` sources: ${Z.join(", ")}`))}p();var T4=B$;function vz($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
378
378
 
379
- Run 'faf init' to create one.`),process.exit(2);let X=c(Z),z=X.faf_version??"unknown";if(z===N4){console.log(`${I("◆")} migrate already at v${N4}`);return}if(X.faf_version=N4,!X.project)X.project={};if(!X.stack)X.stack={};if(!X.human_context)X.human_context={};if(!X.monorepo)X.monorepo={};if($.dryRun){console.log(`${I("◆")} migrate ${L("(dry run)")} v${z} → v${N4}`),console.log(L(` would update ${Z}`));return}s(Z,X),console.log(`${I("◆")} migrate v${z} → v${N4}`),console.log(L(` updated ${Z}`))}d();function vz($){if($==="features")hO();else if($==="activate")uO();else vO()}function vO(){let $=U1();if(console.log(`${I("pro")} ${L("— FAF Pro status")}
380
- `),console.log(` Status: ${$?q0(R("PRO")):R("Free")}`),console.log(""),!$)console.log(L(" Upgrade: faf pro activate"))}function hO(){console.log(`${I("pro")} ${L("— Pro features")}
381
- `);let $=[["tri-sync",".faf ↔ CLAUDE.md ↔ MEMORY.md"],["enterprise slots","33-slot scoring (slots 22-33)"],["advanced analytics","Drift tracking & team metrics"]];for(let[Z,X]of $)console.log(` ${I("◆")} ${R(Z)} ${L("—")} ${X}`);console.log("")}function uO(){console.log(`${I("pro")} ${L("— activate")}
382
- `),console.log(" Set FAF_PRO=1 in your environment to enable Pro features."),console.log(""),console.log(L(" export FAF_PRO=1")),console.log(""),console.log(L(" Visit: https://faf.one/pro")),import("open").then(({default:$})=>$("https://faf.one/pro")).catch(()=>{})}import{gzipSync as mO}from"zlib";d();function hz($={}){let Z=g();if(!Z)console.error(`Error: project.faf not found
379
+ Run 'faf init' to create one.`),process.exit(2);let X=d(Z),z=X.faf_version??"unknown";if(z===T4){console.log(`${D("◆")} migrate already at v${T4}`);return}if(X.faf_version=T4,!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 ${L("(dry run)")} v${z} → v${T4}`),console.log(L(` would update ${Z}`));return}o(Z,X),console.log(`${D("◆")} migrate v${z} → v${T4}`),console.log(L(` updated ${Z}`))}p();function hz($){if($==="features")uO();else if($==="activate")mO();else hO()}function hO(){let $=G1();if(console.log(`${D("pro")} ${L("— FAF Pro status")}
380
+ `),console.log(` Status: ${$?V0(R("PRO")):R("Free")}`),console.log(""),!$)console.log(L(" Upgrade: faf pro activate"))}function uO(){console.log(`${D("pro")} ${L("— Pro features")}
381
+ `);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("◆")} ${R(Z)} ${L("—")} ${X}`);console.log("")}function mO(){console.log(`${D("pro")} ${L("— activate")}
382
+ `),console.log(" Set FAF_PRO=1 in your environment to enable Pro features."),console.log(""),console.log(L(" export FAF_PRO=1")),console.log(""),console.log(L(" Visit: https://faf.one/pro")),import("open").then(({default:$})=>$("https://faf.one/pro")).catch(()=>{})}import{gzipSync as cO}from"zlib";p();function uz($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
383
383
 
384
- Run 'faf init' to create one.`),process.exit(2);let X=h(Z),J=mO(Buffer.from(X)).toString("base64url");if($.raw){console.log(J);return}let Q=`https://faf.one/share?d=${J}`;if(console.log(`${I("◆")} share ${L(Z)}
385
- `),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(L(`
384
+ Run 'faf init' to create one.`),process.exit(2);let X=u(Z),J=cO(Buffer.from(X)).toString("base64url");if($.raw){console.log(J);return}let Q=`https://faf.one/share?d=${J}`;if(console.log(`${D("◆")} share ${L(Z)}
385
+ `),console.log(` ${Q}`),$.copy)try{let{execSync:Y}=I0("child_process"),U=process.platform;if(U==="darwin")Y("pbcopy",{input:Q});else if(U==="linux")Y("xclip -selection clipboard",{input:Q});console.log(L(`
386
386
  copied to clipboard`))}catch{console.log(L(`
387
- copy failed — install xclip or pbcopy`))}}import{mkdirSync as cO,writeFileSync as dO,rmSync as pO}from"fs";import{tmpdir as lO}from"os";import{join as uz}from"path";d();function mz(){let $=uz(lO(),`faf-demo-${Date.now()}`);cO($,{recursive:!0}),console.log(`${I("demo")} ${L("— FAF in action")}
387
+ copy failed — install xclip or pbcopy`))}}import{mkdirSync as dO,writeFileSync as pO,rmSync as lO}from"fs";import{tmpdir as iO}from"os";import{join as mz}from"path";p();function cz(){let $=mz(iO(),`faf-demo-${Date.now()}`);dO($,{recursive:!0}),console.log(`${D("demo")} ${L("— FAF in action")}
388
388
  `);let Z=`faf_version: 2.5.0
389
389
  project:
390
390
  name: acme-app
@@ -410,18 +410,18 @@ human_context:
410
410
  where: Cloud (Vercel + AWS)
411
411
  when: "2026"
412
412
  how: Agile sprints with CI/CD
413
- `,X=uz($,"project.faf");dO(X,Z),console.log(` ${R("1.")} Created sample project.faf`),console.log(L(` ${X}
414
- `)),console.log(` ${R("2.")} Scoring...`);let z=V0(U0(h(X)));console.log(""),z0(z,"project.faf",!0),pO($,{recursive:!0,force:!0}),console.log(`
415
- ${L(' Demo complete. Run "faf init" in your project to get started.')}`)}d();function cz($,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=a.filter((Y)=>Y.path.toLowerCase().includes(X)||Y.description.toLowerCase().includes(X)||Y.category.toLowerCase().includes(X));if(Q.length>0){console.log(`${I("slots")} ${L(`— ${Q.length} match${Q.length===1?"":"es"}`)}
416
- `);for(let Y of Q)console.log(` ${R(`#${Y.index}`)} ${Y.path} ${L("—")} ${Y.description} ${L(`[${Y.category}]`)}`);console.log(""),J+=Q.length}}if(z||Z.formats){let Q=L4.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(`${I("formats")} ${L(`— ${Q.length} match${Q.length===1?"":"es"}`)}
417
- `);for(let Y of Q)console.log(` ${R(Y.name)} ${L(Y.extensions.join(", "))} ${L(`[${Y.category}]`)}`);console.log(""),J+=Q.length}}if(J===0)console.log(L(` No results for "${$}"`))}import{writeFileSync as dz,existsSync as K1,mkdirSync as iO}from"fs";import{join as b$}from"path";d();var nO="Wolfe-Jam/faf-taf-git@v2.2.0";function pz($,Z={}){if($&&typeof $==="object")Z=$,$=void 0;if($==="setup"){oO(Z);return}tO(Z)}function rO($){if(K1(b$($,"bun.lockb"))||K1(b$($,"bun.lock")))return"bun";if(K1(b$($,"pnpm-lock.yaml")))return"pnpm";if(K1(b$($,"yarn.lock")))return"yarn";return"npm"}var sO={bun:{setup:" - uses: oven-sh/setup-bun@v2",install:"bun install --frozen-lockfile",test:"bun run test"},pnpm:{setup:` - uses: pnpm/action-setup@v4
413
+ `,X=mz($,"project.faf");pO(X,Z),console.log(` ${R("1.")} Created sample project.faf`),console.log(L(` ${X}
414
+ `)),console.log(` ${R("2.")} Scoring...`);let z=K0(W0(u(X)));console.log(""),J0(z,"project.faf",!0),lO($,{recursive:!0,force:!0}),console.log(`
415
+ ${L(' Demo complete. Run "faf init" in your project to get started.')}`)}p();function dz($,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=t.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")} ${L(`— ${Q.length} match${Q.length===1?"":"es"}`)}
416
+ `);for(let Y of Q)console.log(` ${R(`#${Y.index}`)} ${Y.path} ${L("—")} ${Y.description} ${L(`[${Y.category}]`)}`);console.log(""),J+=Q.length}}if(z||Z.formats){let Q=N4.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")} ${L(`— ${Q.length} match${Q.length===1?"":"es"}`)}
417
+ `);for(let Y of Q)console.log(` ${R(Y.name)} ${L(Y.extensions.join(", "))} ${L(`[${Y.category}]`)}`);console.log(""),J+=Q.length}}if(J===0)console.log(L(` No results for "${$}"`))}import{writeFileSync as pz,existsSync as B1,mkdirSync as nO}from"fs";import{join as y$}from"path";p();var rO="Wolfe-Jam/faf-taf-git@v2.2.0";function lz($,Z={}){if($&&typeof $==="object")Z=$,$=void 0;if($==="setup"){tO(Z);return}eO(Z)}function sO($){if(B1(y$($,"bun.lockb"))||B1(y$($,"bun.lock")))return"bun";if(B1(y$($,"pnpm-lock.yaml")))return"pnpm";if(B1(y$($,"yarn.lock")))return"yarn";return"npm"}var aO={bun:{setup:" - uses: oven-sh/setup-bun@v2",install:"bun install --frozen-lockfile",test:"bun run test"},pnpm:{setup:` - uses: pnpm/action-setup@v4
418
418
  - uses: actions/setup-node@v4
419
419
  with:
420
420
  node-version: 20`,install:"pnpm install --frozen-lockfile",test:"pnpm test"},yarn:{setup:` - uses: actions/setup-node@v4
421
421
  with:
422
422
  node-version: 20`,install:"yarn install --frozen-lockfile",test:"yarn test"},npm:{setup:` - uses: actions/setup-node@v4
423
423
  with:
424
- node-version: 20`,install:"npm ci",test:"npm test"}};function aO($){let Z=`name: TAF Receipts
424
+ node-version: 20`,install:"npm ci",test:"npm test"}};function oO($){let Z=`name: TAF Receipts
425
425
  `+`# Prints a Test Receipt (.taf) on every push — proof over time, cannot be gamed.
426
426
  `+`# Generated by \`faf taf setup\`. Docs: https://github.com/Wolfe-Jam/faf-taf-git
427
427
  on:
@@ -433,7 +433,7 @@ jobs:
433
433
  runs-on: ubuntu-latest
434
434
  steps:
435
435
  - uses: actions/checkout@v4
436
- `,X;if(K1(b$($,"package.json"))){let J=sO[rO($)];X=`${J.setup}
436
+ `,X;if(B1(y$($,"package.json"))){let J=aO[sO($)];X=`${J.setup}
437
437
  - run: ${J.install}
438
438
  - name: Run tests
439
439
  run: ${J.test} 2>&1 | tee test-output.txt
@@ -444,28 +444,28 @@ jobs:
444
444
  echo "TODO: your test command" 2>&1 | tee test-output.txt
445
445
  `;let z=` - name: Print TAF receipt
446
446
  if: github.event_name == 'push'
447
- uses: ${nO}
447
+ uses: ${rO}
448
448
  with:
449
449
  test-output-file: test-output.txt
450
450
  auto-commit: 'true'
451
451
  commit-message: 'chore(taf): update .taf receipt [skip ci]'
452
452
  target-branch: taf-receipts
453
- `;return Z+X+z}function oO($){let Z=process.cwd(),X=aO(Z),z=b$(Z,".github","workflows","taf.yml");if($.write){if(K1(z)){console.error(`${R("×")} .github/workflows/taf.yml already exists — not overwriting.`),console.error(L(" Add the faf-taf-git step to your existing workflow, or remove taf.yml and re-run."));return}iO(b$(Z,".github","workflows"),{recursive:!0}),dz(z,X,"utf-8"),console.log(`${I("◆")} taf wrote .github/workflows/taf.yml`),console.log(L(" commit + push → your first Test Receipt prints to the taf-receipts branch."));return}console.log(`${I("TAF setup")} ${L("— Test Receipt Printer: proof over time, cannot be gamed")}
454
- `),console.log(L("Run `faf taf setup --write` to create this, or paste it into a workflow:\n")),console.log(X),console.log(L("Then commit + push. One receipt appends to .taf (taf-receipts branch) per CI run."))}function tO($){console.error(L("note: `faf taf` (score snapshot) is deprecated — use `faf score --json`. (`faf taf setup` wires the Receipt Printer.)"));let Z=g();if(!Z)console.error(`Error: project.faf not found
453
+ `;return Z+X+z}function tO($){let Z=process.cwd(),X=oO(Z),z=y$(Z,".github","workflows","taf.yml");if($.write){if(B1(z)){console.error(`${R("×")} .github/workflows/taf.yml already exists — not overwriting.`),console.error(L(" Add the faf-taf-git step to your existing workflow, or remove taf.yml and re-run."));return}nO(y$(Z,".github","workflows"),{recursive:!0}),pz(z,X,"utf-8"),console.log(`${D("◆")} taf wrote .github/workflows/taf.yml`),console.log(L(" commit + push → your first Test Receipt prints to the taf-receipts branch."));return}console.log(`${D("TAF setup")} ${L("— Test Receipt Printer: proof over time, cannot be gamed")}
454
+ `),console.log(L("Run `faf taf setup --write` to create this, or paste it into a workflow:\n")),console.log(X),console.log(L("Then commit + push. One receipt appends to .taf (taf-receipts branch) per CI run."))}function eO($){console.error(L("note: `faf taf` (score snapshot) is deprecated — use `faf score --json`. (`faf taf setup` wires the Receipt Printer.)"));let Z=v();if(!Z)console.error(`Error: project.faf not found
455
455
 
456
- Run 'faf init' to create one.`),process.exit(2);let X=c(Z),z=h(Z),J=X0(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)dz($.output,Y,"utf-8"),console.log(`${I("◆")} taf receipt written to ${$.output}`);else console.log(Y)}import{createInterface as eO}from"readline";import{existsSync as lz,readFileSync as $T,writeFileSync as ZT,unlinkSync as XT}from"fs";import{join as zT}from"path";d();var JT=".faf-session.json";function QT($,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 YT($,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 iz($={}){let Z=g();if(!Z)console.error(`Error: project.faf not found
456
+ Run 'faf init' to create one.`),process.exit(2);let X=d(Z),z=u(Z),J=z0(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)pz($.output,Y,"utf-8"),console.log(`${D("◆")} taf receipt written to ${$.output}`);else console.log(Y)}import{createInterface as $T}from"readline";import{existsSync as iz,readFileSync as ZT,writeFileSync as XT,unlinkSync as zT}from"fs";import{join as JT}from"path";p();var QT=".faf-session.json";function YT($,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 UT($,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 nz($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
457
457
 
458
- Run 'faf init' to create one.`),process.exit(2);let X=process.cwd(),z=zT(X,JT),J=0;if($.resume&&lz(z))try{J=JSON.parse($T(z,"utf-8")).slotIndex,console.log(L(` resuming from slot #${J+1}`))}catch{}let Q=c(Z),Y=a.filter((H)=>{let T=QT(Q,H.path);return A0(T)&&T!=="slotignored"});if(Y.length===0){console.log(`${I("◆")} go all slots populated — \uD83C\uDFC6 Trophy`);let H=V0(U0(h(Z)));z0(H,Z);return}console.log(`${I("go")} ${L("— guided interview to \uD83C\uDFC6 Trophy")}`);let U=Y.length===1?"slot":"slots";console.log(L(` ${Y.length} ${U} from Trophy. Enter a value, "skip" to skip, or "quit" to stop.
459
- `));let W=eO({input:process.stdin,output:process.stdout}),G=(H)=>new Promise((T)=>W.question(H,T)),q=0,V=Y.slice(J);for(let H=0;H<V.length;H++){let T=V[H],B=await G(` ${R(`#${T.index}`)} ${G6(T.path)} ${L(`(${T.path})`)}: `);if(B.toLowerCase()==="quit"){let N={slotIndex:J+H,fafPath:Z};ZT(z,JSON.stringify(N),"utf-8"),console.log(L(`
460
- session saved. Resume with: faf go --resume`));break}if(B.toLowerCase()==="skip"||B.trim()==="")continue;YT(Q,T.path,B.trim()),q++}if(W.close(),q>0)s(Z,Q),console.log(`
461
- ${I("◆")} go filled ${q} slot${q===1?"":"s"}`);let K=V0(U0(h(Z)));if(z0(K,Z),lz(z))try{XT(z)}catch{}}d();var zD=[/^(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 JD($){if(typeof $!=="string")return!1;let Z=$.trim();if(Z.length<4||Z.length>280)return!1;return!zD.some((X)=>X.test(Z))}function QD($,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 YD($,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 iJ($){if($==="analyze")await WD();else if($==="enhance")await UD();else console.log(`${I("ai")} ${L("— AI-powered features")}
462
- `),console.log(` ${R("faf ai enhance")} ${L("— fill empty slots via Claude")}`),console.log(` ${R("faf ai analyze")} ${L("— get improvement suggestions")}`),console.log(""),console.log(L(" Requires ANTHROPIC_API_KEY environment variable."))}async function nJ(){let $=process.env.ANTHROPIC_API_KEY;if(!$)console.error(`Error: ANTHROPIC_API_KEY not set.
458
+ Run 'faf init' to create one.`),process.exit(2);let X=process.cwd(),z=JT(X,QT),J=0;if($.resume&&iz(z))try{J=JSON.parse(ZT(z,"utf-8")).slotIndex,console.log(L(` resuming from slot #${J+1}`))}catch{}let Q=d(Z),Y=t.filter((H)=>{let T=YT(Q,H.path);return R0(T)&&T!=="slotignored"});if(Y.length===0){console.log(`${D("◆")} go all slots populated — \uD83C\uDFC6 Trophy`);let H=K0(W0(u(Z)));J0(H,Z);return}console.log(`${D("go")} ${L("— guided interview to \uD83C\uDFC6 Trophy")}`);let U=Y.length===1?"slot":"slots";console.log(L(` ${Y.length} ${U} from Trophy. Enter a value, "skip" to skip, or "quit" to stop.
459
+ `));let W=$T({input:process.stdin,output:process.stdout}),G=(H)=>new Promise((T)=>W.question(H,T)),q=0,V=Y.slice(J);for(let H=0;H<V.length;H++){let T=V[H],B=await G(` ${R(`#${T.index}`)} ${V3(T.path)} ${L(`(${T.path})`)}: `);if(B.toLowerCase()==="quit"){let N={slotIndex:J+H,fafPath:Z};XT(z,JSON.stringify(N),"utf-8"),console.log(L(`
460
+ session saved. Resume with: faf go --resume`));break}if(B.toLowerCase()==="skip"||B.trim()==="")continue;UT(Q,T.path,B.trim()),q++}if(W.close(),q>0)o(Z,Q),console.log(`
461
+ ${D("◆")} go filled ${q} slot${q===1?"":"s"}`);let K=K0(W0(u(Z)));if(J0(K,Z),iz(z))try{zT(z)}catch{}}p();var JD=[/^(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 QD($){if(typeof $!=="string")return!1;let Z=$.trim();if(Z.length<4||Z.length>280)return!1;return!JD.some((X)=>X.test(Z))}function YD($,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 UD($,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 nJ($){if($==="analyze")await GD();else if($==="enhance")await WD();else console.log(`${D("ai")} ${L("— AI-powered features")}
462
+ `),console.log(` ${R("faf ai enhance")} ${L("— fill empty slots via Claude")}`),console.log(` ${R("faf ai analyze")} ${L("— get improvement suggestions")}`),console.log(""),console.log(L(" Requires ANTHROPIC_API_KEY environment variable."))}async function rJ(){let $=process.env.ANTHROPIC_API_KEY;if(!$)console.error(`Error: ANTHROPIC_API_KEY not set.
463
463
 
464
- export ANTHROPIC_API_KEY=sk-...`),process.exit(2);try{let{default:Z}=await Promise.resolve().then(() => (lJ(),pJ));return new Z({apiKey:$})}catch{console.error(`Error: @anthropic-ai/sdk not installed.
464
+ export ANTHROPIC_API_KEY=sk-...`),process.exit(2);try{let{default:Z}=await Promise.resolve().then(() => (iJ(),lJ));return new Z({apiKey:$})}catch{console.error(`Error: @anthropic-ai/sdk not installed.
465
465
 
466
- npm install @anthropic-ai/sdk`),process.exit(2)}}async function UD(){let $=g();if(!$)console.error(`Error: project.faf not found
466
+ npm install @anthropic-ai/sdk`),process.exit(2)}}async function WD(){let $=v();if(!$)console.error(`Error: project.faf not found
467
467
 
468
- Run 'faf init' to create one.`),process.exit(2);let Z=c($),X=h($),z=a.filter((W)=>{let G=QD(Z,W.path);return A0(G)&&G!=="slotignored"});if(z.length===0){console.log(`${I("◆")} ai enhance all slots populated`);return}console.log(`${I("ai")} enhance ${L(`extracting from ${z.length} empty slots...`)}`);let J=await nJ(),Q=z.map((W)=>`- ${W.path}: ${W.description}`).join(`
468
+ Run 'faf init' to create one.`),process.exit(2);let Z=d($),X=u($),z=t.filter((W)=>{let G=YD(Z,W.path);return R0(G)&&G!=="slotignored"});if(z.length===0){console.log(`${D("◆")} ai enhance all slots populated`);return}console.log(`${D("ai")} enhance ${L(`extracting from ${z.length} empty slots...`)}`);let J=await rJ(),Q=z.map((W)=>`- ${W.path}: ${W.description}`).join(`
469
469
  `),Y=`You are extracting concrete content from a project's .faf file to fill empty slots. STRICT RULES:
470
470
 
471
471
  1. Return JSON mapping dot-paths to values OR null.
@@ -481,42 +481,42 @@ ${X}
481
481
  Empty slots to fill (return null if no concrete evidence):
482
482
  ${Q}
483
483
 
484
- 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 W=U.content[0].text,G=JSON.parse(W),q=0,V=0;for(let K of z){let H=G[K.path];if(H===null||H===void 0)continue;if(JD(H))YD(Z,K.path,H),console.log(` ${I("●")} ${K.path} ${L("←")} ${H}`),q++;else console.log(` ${L("○")} ${K.path} ${L("— rejected as slop, left empty")}`),V++}if(q>0){s($,Z),console.log(`
485
- ${I("◆")} ai enhance filled ${q} slot${q===1?"":"s"}${V>0?` (${V} rejected)`:""}`);let K=V0(U0(h($)));z0(K,$)}else if(V>0)console.log(`
484
+ 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 W=U.content[0].text,G=JSON.parse(W),q=0,V=0;for(let K of z){let H=G[K.path];if(H===null||H===void 0)continue;if(QD(H))UD(Z,K.path,H),console.log(` ${D("●")} ${K.path} ${L("←")} ${H}`),q++;else console.log(` ${L("○")} ${K.path} ${L("— rejected as slop, left empty")}`),V++}if(q>0){o($,Z),console.log(`
485
+ ${D("◆")} ai enhance filled ${q} slot${q===1?"":"s"}${V>0?` (${V} rejected)`:""}`);let K=K0(W0(u($)));J0(K,$)}else if(V>0)console.log(`
486
486
  ${L("all extractions rejected as slop. Run")} ${R("'faf go'")} ${L("for interview-fill.")}`);else console.log(`
487
- ${L("no concrete evidence for empty slots. Run")} ${R("'faf go'")} ${L("for interview-fill.")}`)}catch{console.error("Error: Could not parse AI response.")}}async function WD(){let $=g();if(!$)console.error(`Error: project.faf not found
487
+ ${L("no concrete evidence for empty slots. Run")} ${R("'faf go'")} ${L("for interview-fill.")}`)}catch{console.error("Error: Could not parse AI response.")}}async function GD(){let $=v();if(!$)console.error(`Error: project.faf not found
488
488
 
489
- Run 'faf init' to create one.`),process.exit(2);let Z=h($);console.log(`${I("ai")} analyze ${L("getting suggestions...")}`);let z=await(await nJ()).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.
489
+ Run 'faf init' to create one.`),process.exit(2);let Z=u($);console.log(`${D("ai")} analyze ${L("getting suggestions...")}`);let z=await(await rJ()).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.
490
490
 
491
491
  ${Z}
492
492
 
493
- Be concise. One line per suggestion.`}]});console.log(""),console.log(z.content[0].text)}import{existsSync as Y5,readFileSync as U5,readdirSync as GD}from"fs";import{join as rJ}from"path";d();function sJ($,Z){if($==="import")qD(Z);else if($==="export")VD();else console.log(`${I("conductor")} ${L("— conductor integration")}
494
- `),console.log(` ${R("faf conductor import <path>")} ${L("— import conductor config into .faf")}`),console.log(` ${R("faf conductor export")} ${L("— generate conductor config from .faf")}`)}function qD($){if(!$)console.error("Usage: faf conductor import <path>"),process.exit(2);if(!Y5($))console.error(`Error: path not found: ${$}`),process.exit(2);let Z={faf_version:"2.5.0",project:{}};if(Y5($)&&$.endsWith(".json")){let J=JSON.parse(U5($,"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(Y5($)&&($.endsWith(".yml")||$.endsWith(".yaml"))){let J=i0(U5($,"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=GD($);for(let Q of J){let Y=rJ($,Q);if(Q.endsWith(".json"))try{let U=JSON.parse(U5(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=g(X);if(z){let J=c(z);if(!J.project)J.project={};if(Z.project.name&&!J.project.name)J.project.name=Z.project.name;if(Z.project.goal&&!J.project.goal)J.project.goal=Z.project.goal;if(Z.project.main_language&&!J.project.main_language)J.project.main_language=Z.project.main_language;s(z,J),console.log(`${I("◆")} conductor import merged into ${z}`)}else{let J=rJ(X,"project.faf");s(J,Z),console.log(`${I("◆")} conductor import created ${J}`)}}function VD(){let $=g();if(!$)console.error(`Error: project.faf not found
493
+ Be concise. One line per suggestion.`}]});console.log(""),console.log(z.content[0].text)}import{existsSync as WZ,readFileSync as GZ,readdirSync as qD}from"fs";import{join as sJ}from"path";p();function aJ($,Z){if($==="import")VD(Z);else if($==="export")KD();else console.log(`${D("conductor")} ${L("— conductor integration")}
494
+ `),console.log(` ${R("faf conductor import <path>")} ${L("— import conductor config into .faf")}`),console.log(` ${R("faf conductor export")} ${L("— author conductor config from .faf")}`)}function VD($){if(!$)console.error("Usage: faf conductor import <path>"),process.exit(2);if(!WZ($))console.error(`Error: path not found: ${$}`),process.exit(2);let Z={faf_version:B$,project:{}};if(WZ($)&&$.endsWith(".json")){let J=JSON.parse(GZ($,"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(WZ($)&&($.endsWith(".yml")||$.endsWith(".yaml"))){let J=n0(GZ($,"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=qD($);for(let Q of J){let Y=sJ($,Q);if(Q.endsWith(".json"))try{let U=JSON.parse(GZ(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;o(z,J),console.log(`${D("◆")} conductor import merged into ${z}`)}else{let J=sJ(X,"project.faf");o(J,Z),console.log(`${D("◆")} conductor import created ${J}`)}}function KD(){let $=v();if(!$)console.error(`Error: project.faf not found
495
495
 
496
- Run 'faf init' to create one.`),process.exit(2);let Z=c($),X={name:Z.project?.name??"",description:Z.project?.goal??"",language:Z.project?.main_language??"",stack:Z.stack??{}};console.log(JSON.stringify(X,null,2))}d();import{readdirSync as KD,readFileSync as HD,existsSync as BD}from"fs";import{join as LD}from"path";var MD=["BRAKE","ENGINE","AERO","TYRE","PIT"],ND=/(?:^|[^A-Za-z])(BRAKE|ENGINE|AERO|TYRE|PIT)(?:[^A-Za-z]|$)/i;function OD($){let Z=$.match(ND);if(!Z)return null;return Z[1].toUpperCase()}function TD($){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 DD($,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,W=null,G=0;for(let q=0;q<$.length;q++){while(G<J.length&&J[G].idx===q){let K=J[G];if(K.type==="describe")W=K.name;else{let H=Y.map((B)=>B.name),T=H.length>0?`${H.join(" > ")} > ${K.name}`:K.name;X.push(T)}G++}let V=$[q];if(V==="{"){if(U++,W!==null)Y.push({name:W,openDepth:U}),W=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 ID=new Set(["node_modules",".git","target","dist","build",".next",".nuxt","coverage"]);function aJ($,Z=[]){let X;try{X=KD($,{withFileTypes:!0})}catch{return Z}for(let z of X){if(ID.has(z.name))continue;if(z.name.startsWith(".")&&z.name!==".")continue;let J=LD($,z.name);if(z.isDirectory())aJ(J,Z);else if(z.isFile())Z.push(J)}return Z}function AD($){let Z=[];if(!BD($))return Z;let X=aJ($);for(let z of X){let J=z.split("/").pop()??"",Q=TD(J);if(!Q.ok||!Q.lang)continue;let Y;try{Y=HD(z,"utf-8")}catch{continue}if(Q.lang==="rust"&&!/#\[test\]/.test(Y))continue;if(Q.lang==="zig"&&!/\btest\s+"/.test(Y))continue;let U=DD(Y,Q.lang),W=z.replace(`${$}/`,"");for(let G of U)Z.push({file:W,language:Q.lang,testName:G,tier:OD(G)})}return Z}function RD($){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 FD($){if(console.log(`${I(R("faf wjttc"))} ${L("— vendor-neutral test audit")}`),console.log(""),console.log(` Files scanned: ${R(String($.filesScanned))}`),console.log(` Tests found: ${R(String($.totalTests))}`),console.log(""),$.totalTests===0){console.log(L(" no tests found"));return}console.log(L(" Tiers:"));for(let Z of MD){let X=$.byTier[Z],z=(X/$.totalTests*100).toFixed(0),J=Z==="BRAKE"?q0("●"):Z==="ENGINE"?I("●"):Z==="AERO"?L("●"):Z==="TYRE"?I("◐"):L("○");console.log(` ${J} ${Z.padEnd(7)} ${R(String(X).padStart(4))} ${L(`(${z}%)`)}`)}if($.untiered>0){let Z=($.untiered/$.totalTests*100).toFixed(0);console.log(` ${L("○")} ${"untiered".padEnd(7)} ${R(String($.untiered).padStart(4))} ${L(`(${Z}%)`)}`)}if($.untiered>0&&$.untieredExamples.length>0){console.log(""),console.log(L(` Untiered examples (first ${$.untieredExamples.length}):`));for(let Z of $.untieredExamples)console.log(` ${L("·")} ${Z}`)}if(Object.keys($.byLanguage).length>1){console.log(""),console.log(L(" Languages:"));for(let[Z,X]of Object.entries($.byLanguage))console.log(` ${L("·")} ${Z.padEnd(12)} ${R(String(X))}`)}if($.byTier.BRAKE===0&&$.totalTests>0)console.log(""),console.log(q0(" ⚠ no BRAKE-tier tests — no safety canaries"))}function oJ($={}){let Z=$.path??"tests",X=AD(Z),z=RD(X);if($.json)console.log(JSON.stringify(z,null,2));else FD(z);if($.strict&&z.untiered>0)process.exit(1)}import{createHash as $Q}from"crypto";import{readFileSync as ZQ,writeFileSync as _D,existsSync as XQ}from"fs";import{join as zQ,dirname as PD}from"path";d();var tJ="faf-bench/1",CD={"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 wD($,Z){return CD[$]??`What is the project's ${Z.replace(/\s*\(.*\)$/,"").toLowerCase()}?`}var ED=[["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"]],Y2=new Map;ED.forEach(($,Z)=>$.forEach((X)=>Y2.set(X,Z)));var jD=new Set(["a","an","the","and","or","of","for","to","in","on","with","is","it","its","their","your","via","by","using","use","used"]);function W5($){return $.toLowerCase().replace(/[^a-z0-9\s.+#-]/g," ").replace(/\.(?=\s|$)/g," ").replace(/\s+/g," ").trim()}function eJ($){return W5($).split(" ").filter((Z)=>Z&&!jD.has(Z))}function SD($,Z){let X=W5($),z=W5(Z);if(!X||!z)return!1;if(X===z)return!0;let J=Y2.get(X);if(J!==void 0&&Y2.get(z)===J)return!0;let Q=eJ($);if(Q.length===0)return!1;let Y=new Set(eJ(Z));return Q.every((U)=>{if(Y.has(U))return!0;let W=Y2.get(U);return W!==void 0&&[...Y].some((G)=>Y2.get(G)===W)})}function xD($){let Z=X0($),X=i0($),z=[],J={},Q=0;for(let W of a){if(Z.slots[W.path]!=="populated")continue;let G=q4(X,W);if(typeof G!=="string")continue;let q=G.trim();if(!q||A3.has(q.toLowerCase()))continue;Q+=1,z.push({n:Q,path:W.path,question:wD(W.path,W.description)}),J[Q]=q}let Y=JSON.stringify({v:tJ,q:z.map((W)=>[W.path,W.question])}),U=$Q("sha256").update(Y).digest("hex").slice(0,12);return{version:tJ,qsetHash:U,questions:z,answers:J}}function bD($,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()!==""&&SD($.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 JQ=".faf-bench.json";function kD($){let Z=zQ($,JQ);if(!XQ(Z))return null;try{return JSON.parse(ZQ(Z,"utf-8"))}catch{return null}}function yD($,Z){_D(zQ($,JQ),JSON.stringify(Z,null,2)+`
497
- `,"utf-8")}function G5($,Z){let X=JSON.stringify({v:$.version,repo:Z??null,qset:$.qsetHash,protocol:$.protocol,cold:$.cold??null,faf:$.faf??null});return{projection:X,hash:$Q("sha256").update(X).digest("hex")}}var a6=($)=>$===void 0?"—":`~${$.toLocaleString()}`;function fD($,Z){let{cold:X,faf:z}=$;console.log(`
496
+ 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))}p();import{readdirSync as HD,readFileSync as BD,existsSync as LD}from"fs";import{join as MD}from"path";var ND=["BRAKE","ENGINE","AERO","TYRE","PIT"],OD=/(?:^|[^A-Za-z])(BRAKE|ENGINE|AERO|TYRE|PIT)(?:[^A-Za-z]|$)/i;function TD($){let Z=$.match(OD);if(!Z)return null;return Z[1].toUpperCase()}function DD($){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 ID($,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,W=null,G=0;for(let q=0;q<$.length;q++){while(G<J.length&&J[G].idx===q){let K=J[G];if(K.type==="describe")W=K.name;else{let H=Y.map((B)=>B.name),T=H.length>0?`${H.join(" > ")} > ${K.name}`:K.name;X.push(T)}G++}let V=$[q];if(V==="{"){if(U++,W!==null)Y.push({name:W,openDepth:U}),W=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 AD=new Set(["node_modules",".git","target","dist","build",".next",".nuxt","coverage"]);function oJ($,Z=[]){let X;try{X=HD($,{withFileTypes:!0})}catch{return Z}for(let z of X){if(AD.has(z.name))continue;if(z.name.startsWith(".")&&z.name!==".")continue;let J=MD($,z.name);if(z.isDirectory())oJ(J,Z);else if(z.isFile())Z.push(J)}return Z}function RD($){let Z=[];if(!LD($))return Z;let X=oJ($);for(let z of X){let J=z.split("/").pop()??"",Q=DD(J);if(!Q.ok||!Q.lang)continue;let Y;try{Y=BD(z,"utf-8")}catch{continue}if(Q.lang==="rust"&&!/#\[test\]/.test(Y))continue;if(Q.lang==="zig"&&!/\btest\s+"/.test(Y))continue;let U=ID(Y,Q.lang),W=z.replace(`${$}/`,"");for(let G of U)Z.push({file:W,language:Q.lang,testName:G,tier:TD(G)})}return Z}function FD($){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 _D($){if(console.log(`${D(R("faf wjttc"))} ${L("— vendor-neutral test audit")}`),console.log(""),console.log(` Files scanned: ${R(String($.filesScanned))}`),console.log(` Tests found: ${R(String($.totalTests))}`),console.log(""),$.totalTests===0){console.log(L(" no tests found"));return}console.log(L(" Tiers:"));for(let Z of ND){let X=$.byTier[Z],z=(X/$.totalTests*100).toFixed(0),J=Z==="BRAKE"?V0("●"):Z==="ENGINE"?D("●"):Z==="AERO"?L("●"):Z==="TYRE"?D("◐"):L("○");console.log(` ${J} ${Z.padEnd(7)} ${R(String(X).padStart(4))} ${L(`(${z}%)`)}`)}if($.untiered>0){let Z=($.untiered/$.totalTests*100).toFixed(0);console.log(` ${L("○")} ${"untiered".padEnd(7)} ${R(String($.untiered).padStart(4))} ${L(`(${Z}%)`)}`)}if($.untiered>0&&$.untieredExamples.length>0){console.log(""),console.log(L(` Untiered examples (first ${$.untieredExamples.length}):`));for(let Z of $.untieredExamples)console.log(` ${L("·")} ${Z}`)}if(Object.keys($.byLanguage).length>1){console.log(""),console.log(L(" Languages:"));for(let[Z,X]of Object.entries($.byLanguage))console.log(` ${L("·")} ${Z.padEnd(12)} ${R(String(X))}`)}if($.byTier.BRAKE===0&&$.totalTests>0)console.log(""),console.log(V0(" ⚠ no BRAKE-tier tests — no safety canaries"))}function tJ($={}){let Z=$.path??"tests",X=RD(Z),z=FD(X);if($.json)console.log(JSON.stringify(z,null,2));else _D(z);if($.strict&&z.untiered>0)process.exit(1)}import{createHash as ZQ}from"crypto";import{readFileSync as XQ,writeFileSync as PD,existsSync as zQ}from"fs";import{join as JQ,dirname as CD}from"path";p();var eJ="faf-bench/1",wD={"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 ED($,Z){return wD[$]??`What is the project's ${Z.replace(/\s*\(.*\)$/,"").toLowerCase()}?`}var jD=[["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"]],W2=new Map;jD.forEach(($,Z)=>$.forEach((X)=>W2.set(X,Z)));var SD=new Set(["a","an","the","and","or","of","for","to","in","on","with","is","it","its","their","your","via","by","using","use","used"]);function qZ($){return $.toLowerCase().replace(/[^a-z0-9\s.+#-]/g," ").replace(/\.(?=\s|$)/g," ").replace(/\s+/g," ").trim()}function $Q($){return qZ($).split(" ").filter((Z)=>Z&&!SD.has(Z))}function xD($,Z){let X=qZ($),z=qZ(Z);if(!X||!z)return!1;if(X===z)return!0;let J=W2.get(X);if(J!==void 0&&W2.get(z)===J)return!0;let Q=$Q($);if(Q.length===0)return!1;let Y=new Set($Q(Z));return Q.every((U)=>{if(Y.has(U))return!0;let W=W2.get(U);return W!==void 0&&[...Y].some((G)=>W2.get(G)===W)})}function bD($){let Z=z0($),X=n0($),z=[],J={},Q=0;for(let W of t){if(Z.slots[W.path]!=="populated")continue;let G=K4(X,W);if(typeof G!=="string")continue;let q=G.trim();if(!q||F8.has(q.toLowerCase()))continue;Q+=1,z.push({n:Q,path:W.path,question:ED(W.path,W.description)}),J[Q]=q}let Y=JSON.stringify({v:eJ,q:z.map((W)=>[W.path,W.question])}),U=ZQ("sha256").update(Y).digest("hex").slice(0,12);return{version:eJ,qsetHash:U,questions:z,answers:J}}function kD($,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()!==""&&xD($.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 QQ=".faf-bench.json";function yD($){let Z=JQ($,QQ);if(!zQ(Z))return null;try{return JSON.parse(XQ(Z,"utf-8"))}catch{return null}}function fD($,Z){PD(JQ($,QQ),JSON.stringify(Z,null,2)+`
497
+ `,"utf-8")}function VZ($,Z){let X=JSON.stringify({v:$.version,repo:Z??null,qset:$.qsetHash,protocol:$.protocol,cold:$.cold??null,faf:$.faf??null});return{projection:X,hash:ZQ("sha256").update(X).digest("hex")}}var t3=($)=>$===void 0?"—":`~${$.toLocaleString()}`;function gD($,Z){let{cold:X,faf:z}=$;console.log(`
498
498
  ${R(`faf bench — ${Z}`)}
499
- `),console.log(` ${L("without context")} ${I("with .faf")}`),console.log(`answers ${X.score}/${X.total} ${R(`${z.score}/${z.total}`)}`),console.log(`tokens ${a6(X.tokens)} ${a6(z.tokens)}`);let J=X.total-X.score;if(J>0)console.log(`
500
- ${L(`The ${J} missing answer${J===1?"":"s"} were already in your repo — unstructured.`)}`),console.log(L("Structured context closes the gap."));let Q=G5($,Z);console.log(`
501
- ${q0("✪ BENCH RECEIPT")}`),console.log(L(` qset: ${$.qsetHash} protocol: ${$.protocol} model: ${z.model??X.model??"unreported"}`)),console.log(L(` cold ${X.score}/${X.total} · faf ${z.score}/${z.total} · sha256: ${Q.hash.slice(0,16)}…`))}function gD($,Z){let X=$.cold,z=X.total-X.score;if(console.log(`
502
- ${R(`faf bench — ${Z}`)} ${q0("Trouble ahead, expensive trouble.")}
503
- `),console.log(` ${L("without context")}`),console.log(`answers ${X.score}/${X.total} ${L("— the AI is guessing at what you are building")}`),X.tokens!==void 0)console.log(`tokens ${a6(X.tokens)} ${L("— re-derivation burn, paid again EVERY session")}`);if(z>0)console.log(`
499
+ `),console.log(` ${L("without context")} ${D("with .faf")}`),console.log(`answers ${X.score}/${X.total} ${R(`${z.score}/${z.total}`)}`),console.log(`tokens ${t3(X.tokens)} ${t3(z.tokens)}`);let J=X.total-X.score;if(J>0)console.log(`
500
+ ${L(`The ${J} missing answer${J===1?"":"s"} were already in your repo — unstructured.`)}`),console.log(L("Structured context closes the gap."));let Q=VZ($,Z);console.log(`
501
+ ${V0("✪ BENCH RECEIPT")}`),console.log(L(` qset: ${$.qsetHash} protocol: ${$.protocol} model: ${z.model??X.model??"unreported"}`)),console.log(L(` cold ${X.score}/${X.total} · faf ${z.score}/${z.total} · sha256: ${Q.hash.slice(0,16)}…`))}function vD($,Z){let X=$.cold,z=X.total-X.score;if(console.log(`
502
+ ${R(`faf bench — ${Z}`)} ${V0("Trouble ahead, expensive trouble.")}
503
+ `),console.log(` ${L("without context")}`),console.log(`answers ${X.score}/${X.total} ${L("— the AI is guessing at what you are building")}`),X.tokens!==void 0)console.log(`tokens ${t3(X.tokens)} ${L("— re-derivation burn, paid again EVERY session")}`);if(z>0)console.log(`
504
504
  ${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(`
505
- ${I("→ faf init && faf bench")} ${L("(close the gap, get the receipt)")}`)}var vD="https://mcpaas.live/bench/submit";async function hD($,Z){try{let X=await fetch(Z,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)});console.log(L(X.ok?` ✪ submitted to ${Z}`:` submit failed (${X.status})`))}catch{console.log(L(" submit skipped (endpoint unreachable)"))}}function QQ($,Z,X={}){let z=X.file??g();if(!z)console.error(`Error: project.faf not found
505
+ ${D("→ faf init && faf bench")} ${L("(close the gap, get the receipt)")}`)}var hD="https://mcpaas.live/bench/submit";async function uD($,Z){try{let X=await fetch(Z,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)});console.log(L(X.ok?` ✪ submitted to ${Z}`:` submit failed (${X.status})`))}catch{console.log(L(" submit skipped (endpoint unreachable)"))}}function YQ($,Z,X={}){let z=X.file??v();if(!z)console.error(`Error: project.faf not found
506
506
 
507
- Run 'faf init' to create one — bench needs the answer key.`),process.exit(2);let J=h(z),Q=xD(J),Y=PD(z),U=i0(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:W,question:G})=>({n:W,question:G}))},null,2));return}console.log(`
507
+ Run 'faf init' to create one — bench needs the answer key.`),process.exit(2);let J=u(z),Q=bD(J),Y=CD(z),U=n0(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:W,question:G})=>({n:W,question:G}))},null,2));return}console.log(`
508
508
  ${R(`faf bench — ${Q.questions.length} questions`)} ${L(`qset ${Q.qsetHash}`)}
509
509
  `);for(let W of Q.questions)console.log(` ${String(W.n).padStart(2)}. ${W.question}`);console.log(`
510
- ${L('Answer terse — the value, not a sentence. Save as JSON: {"1": "...", "2": "..."}')}`);return}if($==="grade"){if(!Z||!XQ(Z))console.error("Error: faf bench grade <answers.json> — file not found."),process.exit(2);let W=JSON.parse(ZQ(Z,"utf-8")),G=W.answers??W,q=bD(Q,G),V={score:q.correct,total:q.total,...X.tokens?{tokens:parseInt(X.tokens,10)}:{},...X.model?{model:X.model}:{}},K=kD(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(yD(Y,H),X.json){let T=G5(H,U);console.log(JSON.stringify({...H,receipt:T.hash,perQuestion:q.perQuestion},null,2));return}if(H.cold&&H.faf)fD(H,U);if(X.submit&&H.cold&&H.faf){let{cold:T,faf:B}=H,N=G5(H,U);hD({date:new Date().toISOString().slice(0,10),model:B.model??T.model??X.model??"unreported",repo:U,qset:H.qsetHash,cold:`${T.score}/${T.total}`,faf:`${B.score}/${B.total}`,sha256:N.hash.slice(0,16)},X.endpoint??vD)}else if(H.cold)gD(H,U);else console.log(`
511
- ${R(`faf bench — ${U}`)} ${I("with .faf")}: ${R(`${V.score}/${V.total}`)} ${L(`tokens ${a6(V.tokens)}`)}`),console.log(L("Run the cold phase too for the full pair: faf bench (protocol)."));return}console.log(`
510
+ ${L('Answer terse — the value, not a sentence. Save as JSON: {"1": "...", "2": "..."}')}`);return}if($==="grade"){if(!Z||!zQ(Z))console.error("Error: faf bench grade <answers.json> — file not found."),process.exit(2);let W=JSON.parse(XQ(Z,"utf-8")),G=W.answers??W,q=kD(Q,G),V={score:q.correct,total:q.total,...X.tokens?{tokens:parseInt(X.tokens,10)}:{},...X.model?{model:X.model}:{}},K=yD(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(fD(Y,H),X.json){let T=VZ(H,U);console.log(JSON.stringify({...H,receipt:T.hash,perQuestion:q.perQuestion},null,2));return}if(H.cold&&H.faf)gD(H,U);if(X.submit&&H.cold&&H.faf){let{cold:T,faf:B}=H,N=VZ(H,U);uD({date:new Date().toISOString().slice(0,10),model:B.model??T.model??X.model??"unreported",repo:U,qset:H.qsetHash,cold:`${T.score}/${T.total}`,faf:`${B.score}/${B.total}`,sha256:N.hash.slice(0,16)},X.endpoint??hD)}else if(H.cold)vD(H,U);else console.log(`
511
+ ${R(`faf bench — ${U}`)} ${D("with .faf")}: ${R(`${V.score}/${V.total}`)} ${L(`tokens ${t3(V.tokens)}`)}`),console.log(L("Run the cold phase too for the full pair: faf bench (protocol)."));return}console.log(`
512
512
  ${R("faf bench — agent-native protocol")} ${L(`qset ${Q.qsetHash} · ${Q.questions.length} questions`)}
513
- `),console.log(`${R("COLD phase")} ${L("(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. ${I("faf bench questions")} — hand them over; answers terse, saved as cold.json`),console.log(` 3. ${I("faf bench grade cold.json --cold --tokens <used> --model <name>")}
514
- `),console.log(`${R("FAF phase")} ${L("(same questions, context first)")}`),console.log(' 4. Instruct: "Read project.faf, then answer the same questions." → faf.json'),console.log(` 5. ${I("faf bench grade faf.json --faf --tokens <used> --model <name>")}
515
- `),console.log(L("Grading is mechanical against your own project.faf — the .faf IS the answer key.")),console.log(L(`Receipts carry protocol: in-session (honor-system cold). qset ${Q.qsetHash}.`))}import{existsSync as uD,writeFileSync as mD}from"fs";d();function YQ($={}){let Z=g();if(!Z)console.error(`Error: project.faf not found
513
+ `),console.log(`${R("COLD phase")} ${L("(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>")}
514
+ `),console.log(`${R("FAF phase")} ${L("(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>")}
515
+ `),console.log(L("Grading is mechanical against your own project.faf — the .faf IS the answer key.")),console.log(L(`Receipts carry protocol: in-session (honor-system cold). qset ${Q.qsetHash}.`))}import{existsSync as mD,writeFileSync as cD}from"fs";p();function UQ($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
516
516
 
517
- Run 'faf init' to create one.`),process.exit(2);let X=h(Z),z=X0(X),J=new s0(process.cwd()),Q=J.load()?J.getBirthDNADisplay():null,Y=Q?Q.current:null,U=Y!=null?z.score-Y:0,W=Y!=null&&U!==0,G=Z.replace(/\.faf$/,".fafb"),q=null;if(uD(G)){let V=t2(X);mD(G,V),q=V.length}if($.json)console.log(JSON.stringify({reGrounded:!0,score:z.score,tier:z.tier,baseline:Y,delta:U,drifted:W,fafb:q!=null?{reCompiled:!0,bytes:q}:{reCompiled:!1},journey:J.getJourney()||null},null,2));else{if(console.log(`${I("refresh")} ${L("— re-grounding on the live .faf")}
518
- `),W){let V=U>0?"↑":"↓";console.log(` drift: ${L(`${Y}%`)} ${V} ${R(`${z.score}%`)} ${L(`(${U>0?"+":""}${U})`)}`)}else if(Y!=null)console.log(` no drift ${L(`— steady at ${z.score}%`)}`);else console.log(` baseline set ${L(`— ${z.score}%`)}`);if(q!=null)console.log(` .fafb re-compiled ${L(`(${q} bytes — fast tier current)`)}`);console.log(` re-grounded: ${y0(z.tier)} ${R(`${z.score}%`)}`)}if(J.exists())J.recordGrowth(z.score,["refresh — re-grounded"]);else J.birth(z.score)}var{version:UQ}=d3(),f=new S5;f.name("faf").description("Foundational AI-Context Format — project DNA for any AI").version(UQ,"-v, --version");f.command("init").description("Create .faf from your project").option("--yolo","Quick init with sensible defaults").option("--quick","Alias for --yolo").option("--force","Overwrite existing project.faf").option("--output <path>","Output path").action(($)=>E3($));f.command("dna").description("\uD83E\uDDEC Show your FAF DNA journey (birth → growth)").action(()=>OX());f.command("auto").description("Zero to 100% in one command").action(()=>U6());f.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(($)=>DX($));f.command("go").description("Guided interview to gold code").option("--resume","Resume previous session").action(($)=>iz($));f.command("score [file]").description("Score a .faf file").option("--verbose","Show slot breakdown").option("--status","Compact one-liner output").option("--json","Output as JSON").action(($,Z)=>e2($,Z));f.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)=>QQ($,Z,X));f.command("show").description("Render project.faf → project.html and open it").action(()=>Uz());f.command("sync").description(".faf ↔ CLAUDE.md (bi-sync, mtime auto-direction)").option("--watch","Watch for changes").option("--direction <dir>","Force direction: auto|push|pull","auto").action(($)=>b3($));f.command("compile [file]").description("Compile .faf to .fafb binary").option("--output <path>","Output path").action(($,Z)=>bX($,Z));f.command("decompile <file>").description("Decompile .fafb to JSON").option("--output <path>","Output path").action(($,Z)=>kX($,Z));f.command("git <url>").description("Instant scored context from any GitHub repo (any branch/tag with --ref)").option("--ref <ref>","Clone at a specific branch or tag (versioned context)").option("--output <path>","Write to a custom path (default: ./project.faf)").option("--force","Overwrite an existing project.faf").option("--stdout","Print the .faf to stdout instead of writing a file").action(($,Z)=>Gz($,Z));f.command("diff [range]").description("Semantic context diff between two .faf versions (slot deltas + score). git ranges: <ref>, A..B, A...B").option("--json","Emit the delta as structured JSON").option("--install-driver","Wire faf diff into native git — `git diff` renders .faf score+slot deltas").option("--uninstall-driver","Remove the native-git diff driver").action(($,Z)=>Tz($,Z));f.command("diff-driver [args...]",{hidden:!0}).description("Internal: GIT_EXTERNAL_DIFF handler invoked by git for diff=faf files").action(($)=>Nz($??[]));f.command("log").description("Score timeline across git history — the .faf score at every commit that touched it").option("-n, --limit <n>","Max commits to show (default 20)").option("--all","Show every commit, no cap").option("--reverse","Oldest-first instead of newest-first").option("--json","Emit the timeline as structured JSON").action(($)=>Dz($));f.command("hooks").description("Pre-commit context guard — scores staged .faf vs HEAD, warns (or --strict blocks) on regression").option("--install","Install the pre-commit hook").option("--uninstall","Remove the faf hook block (preserves other hooks)").option("--strict","With --install: block the commit on a score regression (default: warn only)").action(($)=>Cz($));f.command("hooks-run",{hidden:!0}).description("Internal: the pre-commit context guard the git hook invokes").option("--strict","Exit non-zero on a score regression").action(($)=>Pz($));f.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(($)=>G1($));f.command("server-card").description("Emit the registry server.json identity (name + title + _meta) from project.faf — the cross-language server-card emitter; patches an existing file").option("--in <path>","Existing server.json to patch (default: ./server.json)").option("--out <path>","Output path (default: same as --in)").option("--faf <path>","project.faf path (default: auto-discover)").option("--set-version <version>","Set the version field (default: preserve existing). NOTE: not --version, which is the global CLI-version flag").option("--generated <iso>","Override the _meta generated stamp (default: preserve existing)").option("--check","Print to stdout, do not write (diff/verify — the idempotency-test hook)").action(($)=>Yz($));f.command("check [file]").description("Validate .faf file").option("--strict","Require 100% score").option("--fix","Auto-fix issues").option("--doctor","Full diagnostic").option("--trust","Verify trust chain").action(($,Z)=>k3($,Z));f.command("info").description("Show version and system info").option("--version","Show version").option("--faq","Show FAQ").option("--index","Show command index").option("--stacks","Show supported stacks").action(($)=>wz($));f.command("formats").description("Show supported formats").action(()=>Ez());f.command("clear").description("Clear cached data").action(()=>jz());f.command("convert").description("Convert .faf to other formats").option("--json","Output as JSON").action(($)=>Sz($));f.command("context").description("Generate context output").action(()=>xz());f.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(($)=>YQ($));f.command("drift").description("Check context drift").action(()=>kz());f.command("edit <path> <value>").description("Edit .faf fields").action(($,Z)=>yz($,Z));f.command("recover").description("Recover .faf from context files").action(()=>fz());f.command("migrate").description("Migrate .faf to latest version").option("--dry-run","Preview changes without writing").action(($)=>gz($));f.command("pro [subcommand]").description("Pro features & licensing").action(($)=>vz($));f.command("share").description("Share .faf via URL").option("--copy","Copy to clipboard").option("--raw","Output encoded string only").action(($)=>hz($));f.command("demo").description("Demo walkthrough").action(()=>mz());f.command("search <query>").description("Search slots and formats").option("--slots","Search slots only").option("--formats","Search formats only").action(($,Z)=>cz($,Z));f.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)=>pz($,Z));f.command("ai [subcommand]").description("AI-powered features (enhance|analyze)").action(($)=>iJ($));f.command("conductor [subcommand] [path]").description("Conductor integration").action(($,Z)=>sJ($,Z));f.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(($)=>oJ($));f.command("bi-sync",{hidden:!0}).action(()=>b3());f.command("status",{hidden:!0}).action(()=>e2(void 0,{status:!0}));f.command("agents",{hidden:!0}).action(()=>G1({agents:!0}));f.command("cursor",{hidden:!0}).action(()=>G1({cursor:!0}));f.command("gemini",{hidden:!0}).action(()=>G1({gemini:!0}));f.command("grok",{hidden:!0}).action(()=>G1({grok:!0}));f.command("validate",{hidden:!0}).action(($)=>k3($));f.command("yolo",{hidden:!0}).action(()=>E3({yolo:!0}));if(process.argv.length<=2)(async()=>{let{bold:$,dim:Z,fafCyan:X}=await Promise.resolve().then(() => (d(),l9)),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",W="\x1B[0m";console.log(""),console.log(`\x1B[48;2;29;29;29m ${"\x1B[38;2;150;150;150m"}▄${"\x1B[48;2;150;150;150m"}███████${"\x1B[48;2;29;29;29m"}${"\x1B[38;2;150;150;150m"}▄${"\x1B[0m"}`),console.log(`\x1B[48;2;29;29;29m \x1B[48;2;150;150;150m${"\x1B[38;2;150;150;150m"}█${"\x1B[38;2;29;29;29m"}█${"\x1B[38;2;150;150;150m"}███████${"\x1B[0m"} ${X($("faf"))} ${Z(`v${UQ}`)}`);let G="\x1B[38;2;39;174;96m";console.log(`\x1B[48;2;29;29;29m${"\x1B[38;2;150;150;150m"}▀${"\x1B[48;2;150;150;150m"}${"\x1B[38;2;29;29;29m"}▀${"\x1B[48;2;29;29;29m"} \x1B[48;2;150;150;150m${"\x1B[38;2;150;150;150m"}██${"\x1B[48;2;29;29;29m"} \x1B[48;2;150;150;150m${"\x1B[38;2;150;150;150m"}██${"\x1B[48;2;29;29;29m"} \x1B[0m ${Z("Nelly Never Forgets")}`),console.log(`${G}▔▔▔▔▔▔▔▔▔▔▔▔${"\x1B[0m"}`),console.log(`${Z(" "+z)}`),console.log("");try{await e2(void 0,{status:!0})}catch{}console.log(""),console.log(` ${Z("Run")} ${X("faf --help")} ${Z("for commands")}`)})();else f.addHelpText("after",["","Git-native (The GIT Version):"," faf diff [range] semantic context diff + score delta (A..B, A...B)"," faf diff --install-driver make native `git diff` render .faf deltas"," faf log score timeline across history (Proof-Over-Time)"," faf hooks --install pre-commit guard against context regression"," faf git <url> [--ref] instant scored context from any repo, any branch/tag","",' "FAF is to Context what Git is to Versions."',""].join(`
519
- `)),f.parse(process.argv);
517
+ Run 'faf init' to create one.`),process.exit(2);let X=u(Z),z=z0(X),J=new a0(process.cwd()),Q=J.load()?J.getBirthDNADisplay():null,Y=Q?Q.current:null,U=Y!=null?z.score-Y:0,W=Y!=null&&U!==0,G=Z.replace(/\.faf$/,".fafb"),q=null;if(mD(G)){let V=$3(X);cD(G,V),q=V.length}if($.json)console.log(JSON.stringify({reGrounded:!0,score:z.score,tier:z.tier,baseline:Y,delta:U,drifted:W,fafb:q!=null?{reCompiled:!0,bytes:q}:{reCompiled:!1},journey:J.getJourney()||null},null,2));else{if(console.log(`${D("refresh")} ${L("— re-grounding on the live .faf")}
518
+ `),W){let V=U>0?"↑":"↓";console.log(` drift: ${L(`${Y}%`)} ${V} ${R(`${z.score}%`)} ${L(`(${U>0?"+":""}${U})`)}`)}else if(Y!=null)console.log(` no drift ${L(`— steady at ${z.score}%`)}`);else console.log(` baseline set ${L(`— ${z.score}%`)}`);if(q!=null)console.log(` .fafb re-compiled ${L(`(${q} bytes — fast tier current)`)}`);console.log(` re-grounded: ${v0(z.tier)} ${R(`${z.score}%`)}`)}if(J.exists())J.recordGrowth(z.score,["refresh — re-grounded"]);else J.birth(z.score)}var{version:WQ}=l8(),g=new xZ;g.name("faf").description("Foundational AI-Context Format — project DNA for any AI").version(WQ,"-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(($)=>S8($));g.command("dna").description("\uD83E\uDDEC Show your FAF DNA journey (birth → growth)").action(()=>TX());g.command("auto").description("Zero to 100% in one command").action(()=>G3());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(($)=>IX($));g.command("go").description("Guided interview to gold code").option("--resume","Resume previous session").action(($)=>nz($));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)=>Z3($,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)=>YQ($,Z,X));g.command("show").description("Render project.faf → project.html and open it").action(()=>Wz());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(($)=>y8($));g.command("compile [file]").description("Compile .faf to .fafb binary").option("--output <path>","Output path").action(($,Z)=>kX($,Z));g.command("decompile <file>").description("Decompile .fafb to JSON").option("--output <path>","Output path").action(($,Z)=>yX($,Z));g.command("git <url>").description("Instant scored context from any GitHub repo (any branch/tag with --ref)").option("--ref <ref>","Clone at a specific branch or tag (versioned context)").option("--output <path>","Write to a custom path (default: ./project.faf)").option("--force","Overwrite an existing project.faf").option("--stdout","Print the .faf to stdout instead of writing a file").action(($,Z)=>qz($,Z));g.command("diff [range]").description("Semantic context diff between two .faf versions (slot deltas + score). git ranges: <ref>, A..B, A...B").option("--json","Emit the delta as structured JSON").option("--install-driver","Wire faf diff into native git — `git diff` renders .faf score+slot deltas").option("--uninstall-driver","Remove the native-git diff driver").action(($,Z)=>Dz($,Z));g.command("diff-driver [args...]",{hidden:!0}).description("Internal: GIT_EXTERNAL_DIFF handler invoked by git for diff=faf files").action(($)=>Oz($??[]));g.command("log").description("Score timeline across git history — the .faf score at every commit that touched it").option("-n, --limit <n>","Max commits to show (default 20)").option("--all","Show every commit, no cap").option("--reverse","Oldest-first instead of newest-first").option("--json","Emit the timeline as structured JSON").action(($)=>Iz($));g.command("hooks").description("Pre-commit context guard — scores staged .faf vs HEAD, warns (or --strict blocks) on regression").option("--install","Install the pre-commit hook").option("--uninstall","Remove the faf hook block (preserves other hooks)").option("--strict","With --install: block the commit on a score regression (default: warn only)").action(($)=>wz($));g.command("hooks-run",{hidden:!0}).description("Internal: the pre-commit context guard the git hook invokes").option("--strict","Exit non-zero on a score regression").action(($)=>Cz($));g.command("export").description("Export context files from .faf").option("--agents","Author AGENTS.md").option("--cursor","Author .cursorrules").option("--gemini","Author GEMINI.md").option("--copilot","Author .github/copilot-instructions.md (GitHub Copilot)").option("--grok","Wire grok-faf-mcp into .grok/config.toml").option("--conductor","Author conductor config").option("--html","Author project.html (visual render of project.faf)").option("--card","Author MCP Server Card (.well-known/mcp/server-card) with the FAF context-block").option("--all","Author all formats").action(($)=>V1($));g.command("server-card").description("Emit the registry server.json identity (name + title + _meta) from project.faf — the cross-language server-card emitter; patches an existing file").option("--in <path>","Existing server.json to patch (default: ./server.json)").option("--out <path>","Output path (default: same as --in)").option("--faf <path>","project.faf path (default: auto-discover)").option("--set-version <version>","Set the version field (default: preserve existing). NOTE: not --version, which is the global CLI-version flag").option("--generated <iso>","Override the _meta generated stamp (default: preserve existing)").option("--check","Print to stdout, do not write (diff/verify — the idempotency-test hook)").action(($)=>Uz($));g.command("check [file]").description("Validate .faf file").option("--strict","Require 100% score").option("--fix","Auto-fix issues").option("--doctor","Full diagnostic").option("--trust","Verify trust chain").action(($,Z)=>f8($,Z));g.command("info").description("Show version and system info").option("--version","Show version").option("--faq","Show FAQ").option("--index","Show command index").option("--stacks","Show supported stacks").action(($)=>Ez($));g.command("formats").description("Show supported formats").action(()=>jz());g.command("clear").description("Clear cached data").action(()=>Sz());g.command("convert").description("Convert .faf to other formats").option("--json","Output as JSON").action(($)=>xz($));g.command("context").description("Author context output").action(()=>bz());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(($)=>UQ($));g.command("drift").description("Check context drift").action(()=>yz());g.command("edit <path> <value>").description("Edit .faf fields").action(($,Z)=>fz($,Z));g.command("recover").description("Recover .faf from context files").action(()=>gz());g.command("migrate").description("Migrate .faf to latest version").option("--dry-run","Preview changes without writing").action(($)=>vz($));g.command("pro [subcommand]").description("Pro features & licensing").action(($)=>hz($));g.command("share").description("Share .faf via URL").option("--copy","Copy to clipboard").option("--raw","Output encoded string only").action(($)=>uz($));g.command("demo").description("Demo walkthrough").action(()=>cz());g.command("search <query>").description("Search slots and formats").option("--slots","Search slots only").option("--formats","Search formats only").action(($,Z)=>dz($,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)=>lz($,Z));g.command("ai [subcommand]").description("AI-powered features (enhance|analyze)").action(($)=>nJ($));g.command("conductor [subcommand] [path]").description("Conductor integration").action(($,Z)=>aJ($,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(($)=>tJ($));g.command("bi-sync",{hidden:!0}).action(()=>y8());g.command("status",{hidden:!0}).action(()=>Z3(void 0,{status:!0}));g.command("agents",{hidden:!0}).action(()=>V1({agents:!0}));g.command("cursor",{hidden:!0}).action(()=>V1({cursor:!0}));g.command("gemini",{hidden:!0}).action(()=>V1({gemini:!0}));g.command("grok",{hidden:!0}).action(()=>V1({grok:!0}));g.command("validate",{hidden:!0}).action(($)=>f8($));g.command("yolo",{hidden:!0}).action(()=>S8({yolo:!0}));if(process.argv.length<=2)(async()=>{let{bold:$,dim:Z,fafCyan:X}=await Promise.resolve().then(() => (p(),i9)),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",W="\x1B[0m";console.log(""),console.log(`\x1B[48;2;29;29;29m ${"\x1B[38;2;150;150;150m"}▄${"\x1B[48;2;150;150;150m"}███████${"\x1B[48;2;29;29;29m"}${"\x1B[38;2;150;150;150m"}▄${"\x1B[0m"}`),console.log(`\x1B[48;2;29;29;29m \x1B[48;2;150;150;150m${"\x1B[38;2;150;150;150m"}█${"\x1B[38;2;29;29;29m"}█${"\x1B[38;2;150;150;150m"}███████${"\x1B[0m"} ${X($("faf"))} ${Z(`v${WQ}`)}`);let G="\x1B[38;2;39;174;96m";console.log(`\x1B[48;2;29;29;29m${"\x1B[38;2;150;150;150m"}▀${"\x1B[48;2;150;150;150m"}${"\x1B[38;2;29;29;29m"}▀${"\x1B[48;2;29;29;29m"} \x1B[48;2;150;150;150m${"\x1B[38;2;150;150;150m"}██${"\x1B[48;2;29;29;29m"} \x1B[48;2;150;150;150m${"\x1B[38;2;150;150;150m"}██${"\x1B[48;2;29;29;29m"} \x1B[0m ${Z("Nelly Never Forgets")}`),console.log(`${G}▔▔▔▔▔▔▔▔▔▔▔▔${"\x1B[0m"}`),console.log(`${Z(" "+z)}`),console.log("");try{await Z3(void 0,{status:!0})}catch{}console.log(""),console.log(` ${Z("Run")} ${X("faf --help")} ${Z("for commands")}`)})();else g.addHelpText("after",["","Git-native (The GIT Version):"," faf diff [range] semantic context diff + score delta (A..B, A...B)"," faf diff --install-driver make native `git diff` render .faf deltas"," faf log score timeline across history (Proof-Over-Time)"," faf hooks --install pre-commit guard against context regression"," faf git <url> [--ref] instant scored context from any repo, any branch/tag","",' "FAF is to Context what Git is to Versions."',""].join(`
519
+ `)),g.parse(process.argv);
520
520
 
521
- //# debugId=EA78F1189E59537364756E2164756E21
521
+ //# debugId=64FCB55A6120BC0164756E2164756E21
522
522
  //# sourceMappingURL=cli.js.map