faf-cli 7.0.0 → 7.0.2

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 sJ}from"node:module";var hJ=Object.create;var{getPrototypeOf:uJ,defineProperty:l6,getOwnPropertyNames:mJ}=Object;var cJ=Object.prototype.hasOwnProperty;function dJ($){return this[$]}var pJ,lJ,iJ=($,Z,X)=>{var z=$!=null&&typeof $==="object";if(z){var J=Z?pJ??=new WeakMap:lJ??=new WeakMap,Q=J.get($);if(Q)return Q}X=$!=null?hJ(uJ($)):{};let Y=Z||!$||!$.__esModule?l6(X,"default",{value:$,enumerable:!0}):X;for(let U of mJ($))if(!cJ.call(Y,U))l6(Y,U,{get:dJ.bind($,U),enumerable:!0});if(z)J.set($,Y);return Y};var F=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var nJ=($)=>$;function rJ($,Z){this[$]=nJ.bind(null,Z)}var X5=($,Z)=>{for(var X in Z)l6($,X,{get:Z[X],enumerable:!0,configurable:!0,set:rJ.bind(Z,X)})};var x=($,Z)=>()=>($&&(Z=$($=0)),Z);var D0=sJ(import.meta.url);var y1=F((aJ)=>{class i6 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 z5 extends i6{constructor($){super(1,"commander.invalidArgument",$);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}aJ.CommanderError=i6;aJ.InvalidArgumentError=z5});var Q2=F((ZQ)=>{var{InvalidArgumentError:eJ}=y1();class J5{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 eJ(`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 $Q($){let Z=$.name()+($.variadic===!0?"...":"");return $.required?"<"+Z+">":"["+Z+"]"}ZQ.Argument=J5;ZQ.humanReadableArgName=$Q});var n6=F((QQ)=>{var{humanReadableArgName:JQ}=Q2();class Q5{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)=>JQ(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 Y5($).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
- `+" ".repeat(Z+U));return Q+Y+" ".repeat(U)+q.replace(/\n/g,`
5
- ${Q}`)}boxWrap($,Z){if(Z<this.minWidthToWrap)return $;let X=$.split(/\r\n|\n/),z=/[\s]*[^\s]+/g,J=[];return X.forEach((Q)=>{let Y=Q.match(z);if(Y===null){J.push("");return}let 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 Y5($){let Z=/\x1b\[\d*(;\d*)*m/g;return $.replace(Z,"")}QQ.Help=Q5;QQ.stripColor=Y5});var r6=F((qQ)=>{var{InvalidArgumentError:WQ}=y1();class W5{constructor($,Z){this.flags=$,this.description=Z||"",this.required=$.includes("<"),this.optional=$.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test($),this.mandatory=!1;let X=GQ($);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 WQ(`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 U5(this.name().replace(/^no-/,""));return U5(this.name())}helpGroup($){return this.helpGroupHeading=$,this}is($){return this.short===$||this.long===$}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class G5{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 U5($){return $.split("-").reduce((Z,X)=>{return Z+X[0].toUpperCase()+X.slice(1)})}function GQ($){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}
2
+ import{createRequire as WQ}from"node:module";var oJ=Object.create;var{getPrototypeOf:tJ,defineProperty:i6,getOwnPropertyNames:eJ}=Object;var $Q=Object.prototype.hasOwnProperty;function ZQ($){return this[$]}var XQ,zQ,JQ=($,Z,X)=>{var z=$!=null&&typeof $==="object";if(z){var J=Z?XQ??=new WeakMap:zQ??=new WeakMap,Q=J.get($);if(Q)return Q}X=$!=null?oJ(tJ($)):{};let Y=Z||!$||!$.__esModule?i6(X,"default",{value:$,enumerable:!0}):X;for(let W of eJ($))if(!$Q.call(Y,W))i6(Y,W,{get:ZQ.bind($,W),enumerable:!0});if(z)J.set($,Y);return Y};var F=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var QQ=($)=>$;function YQ($,Z){this[$]=QQ.bind(null,Z)}var Y5=($,Z)=>{for(var X in Z)i6($,X,{get:Z[X],enumerable:!0,configurable:!0,set:YQ.bind(Z,X)})};var x=($,Z)=>()=>($&&(Z=$($=0)),Z);var D0=WQ(import.meta.url);var f1=F((UQ)=>{class n6 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 W5 extends n6{constructor($){super(1,"commander.invalidArgument",$);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}UQ.CommanderError=n6;UQ.InvalidArgumentError=W5});var Y2=F((HQ)=>{var{InvalidArgumentError:VQ}=f1();class U5{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 VQ(`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 KQ($){let Z=$.name()+($.variadic===!0?"...":"");return $.required?"<"+Z+">":"["+Z+"]"}HQ.Argument=U5;HQ.humanReadableArgName=KQ});var r6=F((NQ)=>{var{humanReadableArgName:MQ}=Y2();class G5{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)=>MQ(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 W=Z.visibleArguments($).map((q)=>{return J(Z.styleArgumentTerm(Z.argumentTerm(q)),Z.styleArgumentDescription(Z.argumentDescription(q)))});if(Q=Q.concat(this.formatItemList("Arguments:",W,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 q5($).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($)),W=2,G=(this.helpWidth??80)-Z-W-2,q;if(G<this.minWidthToWrap||z.preformatted(X))q=X;else q=z.boxWrap(X,G).replace(/\n/g,`
4
+ `+" ".repeat(Z+W));return Q+Y+" ".repeat(W)+q.replace(/\n/g,`
5
+ ${Q}`)}boxWrap($,Z){if(Z<this.minWidthToWrap)return $;let X=$.split(/\r\n|\n/),z=/[\s]*[^\s]+/g,J=[];return X.forEach((Q)=>{let Y=Q.match(z);if(Y===null){J.push("");return}let W=[Y.shift()],U=this.displayWidth(W[0]);Y.forEach((G)=>{let q=this.displayWidth(G);if(U+q<=Z){W.push(G),U+=q;return}J.push(W.join(""));let V=G.trimStart();W=[V],U=this.displayWidth(V)}),J.push(W.join(""))}),J.join(`
6
+ `)}}function q5($){let Z=/\x1b\[\d*(;\d*)*m/g;return $.replace(Z,"")}NQ.Help=G5;NQ.stripColor=q5});var s6=F((AQ)=>{var{InvalidArgumentError:DQ}=f1();class K5{constructor($,Z){this.flags=$,this.description=Z||"",this.required=$.includes("<"),this.optional=$.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test($),this.mandatory=!1;let X=IQ($);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 DQ(`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 V5(this.name().replace(/^no-/,""));return V5(this.name())}helpGroup($){return this.helpGroupHeading=$,this}is($){return this.short===$||this.long===$}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class H5{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 V5($){return $.split("-").reduce((Z,X)=>{return Z+X[0].toUpperCase()+X.slice(1)})}function IQ($){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],W=`option creation failed due to '${Y}' in option flags '${$}'`;if(/^-[^-][^-]/.test(Y))throw Error(`${W}
7
7
  - a short flag is a single dash and a single character
8
8
  - either use a single dash and a single character (for a short flag)
9
- - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(z.test(Y))throw Error(`${U}
10
- - too many short flags`);if(J.test(Y))throw Error(`${U}
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}}qQ.Option=W5;qQ.DualOptions=G5});var q5=F((LQ)=>{function HQ($,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 BQ($,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=HQ($,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`
9
+ - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(z.test(Y))throw Error(`${W}
10
+ - too many short flags`);if(J.test(Y))throw Error(`${W}
11
+ - too many long flags`);throw Error(`${W}
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}}AQ.Option=K5;AQ.DualOptions=H5});var B5=F((CQ)=>{function _Q($,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 PQ($,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 W=_Q($,Y),U=Math.max($.length,Y.length);if((U-W)/U>Q){if(W<J)J=W,z=[Y];else if(W===J)z.push(Y)}}),z.sort((Y,W)=>Y.localeCompare(W)),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""}LQ.suggestSimilar=BQ});var B5=F((RQ)=>{var NQ=D0("node:events").EventEmitter,s6=D0("node:child_process"),c0=D0("node:path"),Y2=D0("node:fs"),l=D0("node:process"),{Argument:OQ,humanReadableArgName:TQ}=Q2(),{CommanderError:a6}=y1(),{Help:DQ,stripColor:IQ}=n6(),{Option:V5,DualOptions:AQ}=r6(),{suggestSimilar:K5}=q5();class t6 extends NQ{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:()=>o6()??(l.stdout.isTTY&&l.stdout.hasColors?.()),getErrHasColors:()=>o6()??(l.stderr.isTTY&&l.stderr.hasColors?.()),stripColor:(Z)=>IQ(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 t6($)}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 OQ($,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 a6($,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 V5($,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 V5)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(Y2.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""}CQ.suggestSimilar=PQ});var O5=F((yQ)=>{var EQ=D0("node:events").EventEmitter,a6=D0("node:child_process"),c0=D0("node:path"),W2=D0("node:fs"),l=D0("node:process"),{Argument:jQ,humanReadableArgName:SQ}=Y2(),{CommanderError:o6}=f1(),{Help:xQ,stripColor:bQ}=r6(),{Option:L5,DualOptions:kQ}=s6(),{suggestSimilar:M5}=B5();class e6 extends EQ{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:()=>t6()??(l.stdout.isTTY&&l.stdout.hasColors?.()),getErrHasColors:()=>t6()??(l.stderr.isTTY&&l.stderr.hasColors?.()),stripColor:(Z)=>bQ(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(/([^ ]+) *(.*)/),W=this.createCommand(Q);if(z)W.description(z),W._executableHandler=!0;if(J.isDefault)this._defaultCommandName=W._name;if(W._hidden=!!(J.noHelp||J.hidden),W._executableFile=J.executableFile||null,Y)W.arguments(Y);if(this._registerCommand(W),W.parent=this,W.copyInheritedSettings(this),z)return this;return W}createCommand($){return new e6($)}createHelp(){return Object.assign(new xQ,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 jQ($,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 o6($,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 L5($,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 W=this.getOptionValue(X);if(J!==null&&$.parseArg)J=this._callParseArg($,J,W,Q);else if(J!==null&&$.variadic)J=$._collectValue(J,W);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 L5)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=(W,U)=>{let G=Y.exec(W);return G?G[0]:U},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(W2.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=c0.resolve(G,q);if(Y2.existsSync(V))return V;if(z.includes(c0.extname(q)))return;let K=z.find((H)=>Y2.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=Y2.realpathSync(this._scriptPath)}catch{G=this._scriptPath}Y=c0.resolve(c0.dirname(G),Y)}if(Y){let G=J(Y,Q);if(!G&&!$._executableFile&&this._scriptPath){let q=c0.basename(this._scriptPath,c0.extname(this._scriptPath));if(q!==this._name)G=J(Y,`${q}-${$._name}`)}Q=G||Q}X=z.includes(c0.extname(Q));let U;if(l.platform!=="win32")if(X)Z.unshift(Q),Z=H5(l.execArgv).concat(Z),U=s6.spawn(l.argv[0],Z,{stdio:"inherit"});else U=s6.spawn(Q,Z,{stdio:"inherit"});else this._checkForMissingExecutable(Q,Y,$._name),Z.unshift(Q),Z=H5(l.execArgv).concat(Z),U=s6.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 a6(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 a6(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=c0.resolve(G,q);if(W2.existsSync(V))return V;if(z.includes(c0.extname(q)))return;let K=z.find((H)=>W2.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=W2.realpathSync(this._scriptPath)}catch{G=this._scriptPath}Y=c0.resolve(c0.dirname(G),Y)}if(Y){let G=J(Y,Q);if(!G&&!$._executableFile&&this._scriptPath){let q=c0.basename(this._scriptPath,c0.extname(this._scriptPath));if(q!==this._name)G=J(Y,`${q}-${$._name}`)}Q=G||Q}X=z.includes(c0.extname(Q));let W;if(l.platform!=="win32")if(X)Z.unshift(Q),Z=N5(l.execArgv).concat(Z),W=a6.spawn(l.argv[0],Z,{stdio:"inherit"});else W=a6.spawn(Q,Z,{stdio:"inherit"});else this._checkForMissingExecutable(Q,Y,$._name),Z.unshift(Q),Z=N5(l.execArgv).concat(Z),W=a6.spawn(l.execPath,Z,{stdio:"inherit"});if(!W.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((q)=>{l.on(q,()=>{if(W.killed===!1&&W.exitCode===null)W.kill(q)})});let U=this._exitCallback;W.on("close",(G)=>{if(G=G??1,!U)l.exit(G);else U(new o6(G,"commander.executeSubCommandAsync","(close)"))}),W.on("error",(G)=>{if(G.code==="ENOENT")this._checkForMissingExecutable(Q,Y,$._name);else if(G.code==="EACCES")throw Error(`'${Q}' not executable`);if(!U)l.exit(1);else{let q=new o6(1,"commander.executeSubCommandAsync","(error)");q.nestedError=G,U(q)}}),this.runningCommand=W}_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,W=null,U=0;while(U<$.length||W){let G=W??$[U++];if(W=null,G==="--"){if(z===X)z.push(G);z.push(...$.slice(U));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=$[U++];if(V===void 0)this.optionMissingArgument(q);this.emit(`option:${q.name()}`,V)}else if(q.optional){let V=null;if(U<$.length&&(!J($[U])||Q($[U])))V=$[U++];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()}`),W=`-${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(U));break}else if(this._getHelpCommand()&&G===this._getHelpCommand().name()){Z.push(G,...$.slice(U));break}else if(this._defaultCommandName){X.push(G,...$.slice(U));break}}if(this._passThroughOptions){z.push(G,...$.slice(U));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 AQ(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=K5($,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=K5($,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 TQ(X)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?Z:[]).join(" ")}return this._usage=$,this}name($){if($===void 0)return this._name;return this._name=$,this}helpGroup($){if($===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=$,this}commandsGroup($){if($===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=$,this}optionsGroup($){if($===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=$,this}_initOptionGroup($){if(this._defaultOptionGroup&&!$.helpGroupHeading)$.helpGroup(this._defaultOptionGroup)}_initCommandGroup($){if(this._defaultCommandGroup&&!$.helpGroup())$.helpGroup(this._defaultCommandGroup)}nameFromFilename($){return this._name=c0.basename($,c0.extname($)),this}executableDir($){if($===void 0)return this._executableDir;return this._executableDir=$,this}helpInformation($){let Z=this.createHelp(),X=this._getOutputContext($);Z.prepareContext({error:X.error,helpWidth:X.helpWidth,outputHasColors:X.hasColors});let z=Z.formatHelp(this,Z);if(X.hasColors)return z;return this._outputConfiguration.stripColor(z)}_getOutputContext($){$=$||{};let Z=!!$.error,X,z,J;if(Z)X=(Y)=>this._outputConfiguration.writeErr(Y),z=this._outputConfiguration.getErrHasColors(),J=this._outputConfiguration.getErrHelpWidth();else X=(Y)=>this._outputConfiguration.writeOut(Y),z=this._outputConfiguration.getOutHasColors(),J=this._outputConfiguration.getOutHelpWidth();return{error:Z,write:(Y)=>{if(!z)Y=this._outputConfiguration.stripColor(Y);return X(Y)},hasColors:z,helpWidth:J}}outputHelp($){let Z;if(typeof $==="function")Z=$,$=void 0;let X=this._getOutputContext($),z={error:X.error,write:X.write,command:this};this._getCommandAndAncestors().reverse().forEach((Q)=>Q.emit("beforeAllHelp",z)),this.emit("beforeHelp",z);let J=this.helpInformation({error:X.error});if(Z){if(J=Z(J),typeof J!=="string"&&!Buffer.isBuffer(J))throw Error("outputHelp callback must return a string or a Buffer")}if(X.write(J),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",z),this._getCommandAndAncestors().forEach((Q)=>Q.emit("afterAllHelp",z))}helpOption($,Z){if(typeof $==="boolean"){if($){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption($??"-h, --help",Z??"display help for command"),$||Z)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption($){return this._helpOption=$,this._initOptionGroup($),this}help($){this.outputHelp($);let Z=Number(l.exitCode??0);if(Z===0&&$&&typeof $!=="function"&&$.error)Z=1;this._exit(Z,"commander.help","(outputHelp)")}addHelpText($,Z){let X=["beforeAll","before","after","afterAll"];if(!X.includes($))throw Error(`Unexpected value for position to addHelpText.
24
+ `),this.outputHelp({error:!0});let X=Z||{},z=X.exitCode||1,J=X.code||"commander.error";this._exit(z,J,$)}_parseOptionsEnv(){this.options.forEach(($)=>{if($.envVar&&$.envVar in l.env){let Z=$.attributeName();if(this.getOptionValue(Z)===void 0||["default","config","env"].includes(this.getOptionValueSource(Z)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,l.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new kQ(this.options),Z=(X)=>{return this.getOptionValue(X)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(X))};this.options.filter((X)=>X.implied!==void 0&&Z(X.attributeName())&&$.valueFromOption(this.getOptionValue(X.attributeName()),X)).forEach((X)=>{Object.keys(X.implied).filter((z)=>!Z(z)).forEach((z)=>{this.setOptionValueWithSource(z,X.implied[z],"implied")})})}missingArgument($){let Z=`error: missing required argument '${$}'`;this.error(Z,{code:"commander.missingArgument"})}optionMissingArgument($){let Z=`error: option '${$.flags}' argument missing`;this.error(Z,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue($){let Z=`error: required option '${$.flags}' not specified`;this.error(Z,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption($,Z){let X=(Q)=>{let Y=Q.attributeName(),W=this.getOptionValue(Y),U=this.options.find((q)=>q.negate&&Y===q.attributeName()),G=this.options.find((q)=>!q.negate&&Y===q.attributeName());if(U&&(U.presetArg===void 0&&W===!1||U.presetArg!==void 0&&W===U.presetArg))return U;return G||Q},z=(Q)=>{let Y=X(Q),W=Y.attributeName();if(this.getOptionValueSource(W)==="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=M5($,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=M5($,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 SQ(X)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?Z:[]).join(" ")}return this._usage=$,this}name($){if($===void 0)return this._name;return this._name=$,this}helpGroup($){if($===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=$,this}commandsGroup($){if($===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=$,this}optionsGroup($){if($===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=$,this}_initOptionGroup($){if(this._defaultOptionGroup&&!$.helpGroupHeading)$.helpGroup(this._defaultOptionGroup)}_initCommandGroup($){if(this._defaultCommandGroup&&!$.helpGroup())$.helpGroup(this._defaultCommandGroup)}nameFromFilename($){return this._name=c0.basename($,c0.extname($)),this}executableDir($){if($===void 0)return this._executableDir;return this._executableDir=$,this}helpInformation($){let Z=this.createHelp(),X=this._getOutputContext($);Z.prepareContext({error:X.error,helpWidth:X.helpWidth,outputHasColors:X.hasColors});let z=Z.formatHelp(this,Z);if(X.hasColors)return z;return this._outputConfiguration.stripColor(z)}_getOutputContext($){$=$||{};let Z=!!$.error,X,z,J;if(Z)X=(Y)=>this._outputConfiguration.writeErr(Y),z=this._outputConfiguration.getErrHasColors(),J=this._outputConfiguration.getErrHelpWidth();else X=(Y)=>this._outputConfiguration.writeOut(Y),z=this._outputConfiguration.getOutHasColors(),J=this._outputConfiguration.getOutHelpWidth();return{error:Z,write:(Y)=>{if(!z)Y=this._outputConfiguration.stripColor(Y);return X(Y)},hasColors:z,helpWidth:J}}outputHelp($){let Z;if(typeof $==="function")Z=$,$=void 0;let X=this._getOutputContext($),z={error:X.error,write:X.write,command:this};this._getCommandAndAncestors().reverse().forEach((Q)=>Q.emit("beforeAllHelp",z)),this.emit("beforeHelp",z);let J=this.helpInformation({error:X.error});if(Z){if(J=Z(J),typeof J!=="string"&&!Buffer.isBuffer(J))throw Error("outputHelp callback must return a string or a Buffer")}if(X.write(J),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",z),this._getCommandAndAncestors().forEach((Q)=>Q.emit("afterAllHelp",z))}helpOption($,Z){if(typeof $==="boolean"){if($){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption($??"-h, --help",Z??"display help for command"),$||Z)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption($){return this._helpOption=$,this._initOptionGroup($),this}help($){this.outputHelp($);let Z=Number(l.exitCode??0);if(Z===0&&$&&typeof $!=="function"&&$.error)Z=1;this._exit(Z,"commander.help","(outputHelp)")}addHelpText($,Z){let X=["beforeAll","before","after","afterAll"];if(!X.includes($))throw Error(`Unexpected value for position to addHelpText.
26
26
  Expecting one of '${X.join("', '")}'`);let z=`${$}Help`;return this.on(z,(J)=>{let Q;if(typeof Z==="function")Q=Z({error:J.error,command:J.command});else Q=Z;if(Q)J.write(`${Q}
27
- `)}),this}_outputHelpIfRequested($){let Z=this._getHelpOption();if(Z&&$.find((z)=>Z.is(z)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function H5($){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 o6(){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}RQ.Command=t6;RQ.useColor=o6});var O5=F((wQ)=>{var{Argument:L5}=Q2(),{Command:e6}=B5(),{CommanderError:PQ,InvalidArgumentError:M5}=y1(),{Help:CQ}=n6(),{Option:N5}=r6();wQ.program=new e6;wQ.createCommand=($)=>new e6($);wQ.createOption=($,Z)=>new N5($,Z);wQ.createArgument=($,Z)=>new L5($,Z);wQ.Command=e6;wQ.Option=N5;wQ.Argument=L5;wQ.Help=CQ;wQ.CommanderError=PQ;wQ.InvalidArgumentError=M5;wQ.InvalidOptionArgumentError=M5});var d=F((nQ)=>{var $8=Symbol.for("yaml.alias"),I5=Symbol.for("yaml.document"),U2=Symbol.for("yaml.map"),A5=Symbol.for("yaml.pair"),Z8=Symbol.for("yaml.scalar"),W2=Symbol.for("yaml.seq"),d0=Symbol.for("yaml.node.type"),uQ=($)=>!!$&&typeof $==="object"&&$[d0]===$8,mQ=($)=>!!$&&typeof $==="object"&&$[d0]===I5,cQ=($)=>!!$&&typeof $==="object"&&$[d0]===U2,dQ=($)=>!!$&&typeof $==="object"&&$[d0]===A5,R5=($)=>!!$&&typeof $==="object"&&$[d0]===Z8,pQ=($)=>!!$&&typeof $==="object"&&$[d0]===W2;function F5($){if($&&typeof $==="object")switch($[d0]){case U2:case W2:return!0}return!1}function lQ($){if($&&typeof $==="object")switch($[d0]){case $8:case U2:case Z8:case W2:return!0}return!1}var iQ=($)=>(R5($)||F5($))&&!!$.anchor;nQ.ALIAS=$8;nQ.DOC=I5;nQ.MAP=U2;nQ.NODE_TYPE=d0;nQ.PAIR=A5;nQ.SCALAR=Z8;nQ.SEQ=W2;nQ.hasAnchor=iQ;nQ.isAlias=uQ;nQ.isCollection=F5;nQ.isDocument=mQ;nQ.isMap=cQ;nQ.isNode=lQ;nQ.isPair=dQ;nQ.isScalar=R5;nQ.isSeq=pQ});var f1=F((qY)=>{var Y0=d(),M0=Symbol("break visit"),_5=Symbol("skip children"),h0=Symbol("remove node");function G2($,Z){let X=P5(Z);if(Y0.isDocument($)){if(m$(null,$.contents,X,Object.freeze([$]))===h0)$.contents=null}else m$(null,$,X,Object.freeze([]))}G2.BREAK=M0;G2.SKIP=_5;G2.REMOVE=h0;function m$($,Z,X,z){let J=C5($,Z,X,z);if(Y0.isNode(J)||Y0.isPair(J))return w5($,z,J),m$($,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=m$(Q,Z.items[Q],X,z);if(typeof Y==="number")Q=Y-1;else if(Y===M0)return M0;else if(Y===h0)Z.items.splice(Q,1),Q-=1}}else if(Y0.isPair(Z)){z=Object.freeze(z.concat(Z));let Q=m$("key",Z.key,X,z);if(Q===M0)return M0;else if(Q===h0)Z.key=null;let Y=m$("value",Z.value,X,z);if(Y===M0)return M0;else if(Y===h0)Z.value=null}}return J}async function q2($,Z){let X=P5(Z);if(Y0.isDocument($)){if(await c$(null,$.contents,X,Object.freeze([$]))===h0)$.contents=null}else await c$(null,$,X,Object.freeze([]))}q2.BREAK=M0;q2.SKIP=_5;q2.REMOVE=h0;async function c$($,Z,X,z){let J=await C5($,Z,X,z);if(Y0.isNode(J)||Y0.isPair(J))return w5($,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=await c$(Q,Z.items[Q],X,z);if(typeof Y==="number")Q=Y-1;else if(Y===M0)return M0;else if(Y===h0)Z.items.splice(Q,1),Q-=1}}else if(Y0.isPair(Z)){z=Object.freeze(z.concat(Z));let Q=await c$("key",Z.key,X,z);if(Q===M0)return M0;else if(Q===h0)Z.key=null;let Y=await c$("value",Z.value,X,z);if(Y===M0)return M0;else if(Y===h0)Z.value=null}}return J}function P5($){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 C5($,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 w5($,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`)}}qY.visit=G2;qY.visitAsync=q2});var X8=F((MY)=>{var E5=d(),HY=f1(),BY={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},LY=($)=>$.replace(/[!,[\]{}]/g,(Z)=>BY[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+LY($.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&&E5.isNode($.contents)){let J={};HY.visit($.contents,(Q,Y)=>{if(E5.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:"};MY.Directives=w0});var V2=F((IY)=>{var j5=d(),OY=f1();function TY($){if(/[\x00-\x19\s,[\]{}]/.test($)){let X=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(X)}return!0}function S5($){let Z=new Set;return OY.visit($,{Value(X,z){if(z.anchor)Z.add(z.anchor)}}),Z}function x5($,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=S5($));let Y=x5(Z,J);return J.add(Y),Y},setAnchors:()=>{for(let Q of X){let Y=z.get(Q);if(typeof Y==="object"&&Y.anchor&&(j5.isScalar(Y.node)||j5.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}}IY.anchorIsValid=TY;IY.anchorNames=S5;IY.createNodeAnchors=DY;IY.findNewAnchor=x5});var z8=F((PY)=>{function g1($,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=g1($,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=g1($,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=g1($,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=g1($,z,J,Q);if(Y===void 0)delete z[J];else if(Y!==Q)z[J]=Y}return $.call(Z,X,z)}PY.applyReviver=g1});var X$=F((EY)=>{var wY=d();function b5($,Z,X){if(Array.isArray($))return $.map((z,J)=>b5(z,String(J),X));if($&&typeof $.toJSON==="function"){if(!X||!wY.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=b5});var K2=F((bY)=>{var SY=z8(),k5=d(),xY=X$();class y5{constructor($){Object.defineProperty(this,k5.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(!k5.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=xY.toJS(this,"",Q);if(typeof z==="function")for(let{count:U,res:W}of Q.anchors.values())z(W,U);return typeof J==="function"?SY.applyReviver(J,{"":Y},"",Y):Y}}bY.NodeBase=y5});var v1=F((hY)=>{var yY=V2(),fY=f1(),d$=d(),gY=K2(),vY=X$();class f5 extends gY.NodeBase{constructor($){super(d$.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=[],fY.visit($,{Node:(J,Q)=>{if(d$.isAlias(Q)||d$.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)vY.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=H2(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(yY.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 H2($,Z,X){if(d$.isAlias(Z)){let z=Z.resolve($),J=X&&z&&X.get(z);return J?J.count*J.aliasCount:0}else if(d$.isCollection(Z)){let z=0;for(let J of Z.items){let Q=H2($,J,X);if(Q>z)z=Q}return z}else if(d$.isPair(Z)){let z=H2($,Z.key,X),J=H2($,Z.value,X);return Math.max(z,J)}return 1}hY.Alias=f5});var Z0=F((lY)=>{var mY=d(),cY=K2(),dY=X$(),pY=($)=>!$||typeof $!=="function"&&typeof $!=="object";class A$ extends cY.NodeBase{constructor($){super(mY.SCALAR);this.value=$}toJSON($,Z){return Z?.keep?this.value:dY.toJS(this.value,$,Z)}toString(){return String(this.value)}}A$.BLOCK_FOLDED="BLOCK_FOLDED";A$.BLOCK_LITERAL="BLOCK_LITERAL";A$.PLAIN="PLAIN";A$.QUOTE_DOUBLE="QUOTE_DOUBLE";A$.QUOTE_SINGLE="QUOTE_SINGLE";lY.Scalar=A$;lY.isScalarValue=pY});var h1=F((tY)=>{var rY=v1(),R$=d(),g5=Z0(),sY="tag:yaml.org,2002:";function aY($,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 oY($,Z,X){if(R$.isDocument($))$=$.contents;if(R$.isNode($))return $;if(R$.isPair($)){let V=X.schema[R$.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 rY.Alias(W.anchor);else W={anchor:null,node:null},U.set($,W);if(Z?.startsWith("!!"))Z=sY+Z.slice(2);let G=aY($,Z,Y.tags);if(!G){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let V=new g5.Scalar($);if(W)W.node=V;return V}G=$ instanceof Map?Y[R$.MAP]:(Symbol.iterator in Object($))?Y[R$.SEQ]:Y[R$.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 g5.Scalar($);if(Z)q.tag=Z;else if(!G.default)q.tag=G.tag;if(W)W.node=q;return q}tY.createNode=oY});var B2=F((XU)=>{var $U=h1(),u0=d(),ZU=K2();function J8($,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 $U.createNode(z,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var v5=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class h5 extends ZU.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)=>u0.isNode(X)||u0.isPair(X)?X.clone($):X),this.range)Z.range=this.range.slice();return Z}addIn($,Z){if(v5($))this.add(Z);else{let[X,...z]=$,J=this.get(X,!0);if(u0.isCollection(J))J.addIn(z,Z);else if(J===void 0&&this.schema)this.set(X,J8(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(u0.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&&u0.isScalar(J)?J.value:J;else return u0.isCollection(J)?J.getIn(z,Z):void 0}hasAllNullValues($){return this.items.every((Z)=>{if(!u0.isPair(Z))return!1;let X=Z.value;return X==null||$&&u0.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 u0.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(u0.isCollection(J))J.setIn(z,Z);else if(J===void 0&&this.schema)this.set(X,J8(this.schema,z,Z));else throw Error(`Expected YAML collection at ${X}. Remaining path: ${z}`)}}}XU.Collection=h5;XU.collectionFromPath=J8;XU.isEmptyPath=v5});var u1=F((WU)=>{var YU=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function Q8($,Z){if(/^\n+$/.test($))return $.substring(1);return Z?$.replace(/^(?! *$)/gm,Z):$}var UU=($,Z,X)=>$.endsWith(`
29
- `)?Q8(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 N5($){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 t6(){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}yQ.Command=e6;yQ.useColor=t6});var A5=F((uQ)=>{var{Argument:T5}=Y2(),{Command:$8}=O5(),{CommanderError:vQ,InvalidArgumentError:D5}=f1(),{Help:hQ}=r6(),{Option:I5}=s6();uQ.program=new $8;uQ.createCommand=($)=>new $8($);uQ.createOption=($,Z)=>new I5($,Z);uQ.createArgument=($,Z)=>new T5($,Z);uQ.Command=$8;uQ.Option=I5;uQ.Argument=T5;uQ.Help=hQ;uQ.CommanderError=vQ;uQ.InvalidArgumentError=D5;uQ.InvalidOptionArgumentError=D5});var d=F((QY)=>{var Z8=Symbol.for("yaml.alias"),_5=Symbol.for("yaml.document"),U2=Symbol.for("yaml.map"),P5=Symbol.for("yaml.pair"),X8=Symbol.for("yaml.scalar"),G2=Symbol.for("yaml.seq"),d0=Symbol.for("yaml.node.type"),tQ=($)=>!!$&&typeof $==="object"&&$[d0]===Z8,eQ=($)=>!!$&&typeof $==="object"&&$[d0]===_5,$Y=($)=>!!$&&typeof $==="object"&&$[d0]===U2,ZY=($)=>!!$&&typeof $==="object"&&$[d0]===P5,C5=($)=>!!$&&typeof $==="object"&&$[d0]===X8,XY=($)=>!!$&&typeof $==="object"&&$[d0]===G2;function w5($){if($&&typeof $==="object")switch($[d0]){case U2:case G2:return!0}return!1}function zY($){if($&&typeof $==="object")switch($[d0]){case Z8:case U2:case X8:case G2:return!0}return!1}var JY=($)=>(C5($)||w5($))&&!!$.anchor;QY.ALIAS=Z8;QY.DOC=_5;QY.MAP=U2;QY.NODE_TYPE=d0;QY.PAIR=P5;QY.SCALAR=X8;QY.SEQ=G2;QY.hasAnchor=JY;QY.isAlias=tQ;QY.isCollection=w5;QY.isDocument=eQ;QY.isMap=$Y;QY.isNode=zY;QY.isPair=ZY;QY.isScalar=C5;QY.isSeq=XY});var g1=F((AY)=>{var Y0=d(),M0=Symbol("break visit"),E5=Symbol("skip children"),h0=Symbol("remove node");function q2($,Z){let X=j5(Z);if(Y0.isDocument($)){if(m$(null,$.contents,X,Object.freeze([$]))===h0)$.contents=null}else m$(null,$,X,Object.freeze([]))}q2.BREAK=M0;q2.SKIP=E5;q2.REMOVE=h0;function m$($,Z,X,z){let J=S5($,Z,X,z);if(Y0.isNode(J)||Y0.isPair(J))return x5($,z,J),m$($,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=m$(Q,Z.items[Q],X,z);if(typeof Y==="number")Q=Y-1;else if(Y===M0)return M0;else if(Y===h0)Z.items.splice(Q,1),Q-=1}}else if(Y0.isPair(Z)){z=Object.freeze(z.concat(Z));let Q=m$("key",Z.key,X,z);if(Q===M0)return M0;else if(Q===h0)Z.key=null;let Y=m$("value",Z.value,X,z);if(Y===M0)return M0;else if(Y===h0)Z.value=null}}return J}async function V2($,Z){let X=j5(Z);if(Y0.isDocument($)){if(await c$(null,$.contents,X,Object.freeze([$]))===h0)$.contents=null}else await c$(null,$,X,Object.freeze([]))}V2.BREAK=M0;V2.SKIP=E5;V2.REMOVE=h0;async function c$($,Z,X,z){let J=await S5($,Z,X,z);if(Y0.isNode(J)||Y0.isPair(J))return x5($,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=await c$(Q,Z.items[Q],X,z);if(typeof Y==="number")Q=Y-1;else if(Y===M0)return M0;else if(Y===h0)Z.items.splice(Q,1),Q-=1}}else if(Y0.isPair(Z)){z=Object.freeze(z.concat(Z));let Q=await c$("key",Z.key,X,z);if(Q===M0)return M0;else if(Q===h0)Z.key=null;let Y=await c$("value",Z.value,X,z);if(Y===M0)return M0;else if(Y===h0)Z.value=null}}return J}function j5($){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 S5($,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 x5($,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`)}}AY.visit=q2;AY.visitAsync=V2});var z8=F((wY)=>{var b5=d(),_Y=g1(),PY={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},CY=($)=>$.replace(/[!,[\]{}]/g,(Z)=>PY[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+CY($.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&&b5.isNode($.contents)){let J={};_Y.visit($.contents,(Q,Y)=>{if(b5.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:"};wY.Directives=w0});var K2=F((bY)=>{var k5=d(),jY=g1();function SY($){if(/[\x00-\x19\s,[\]{}]/.test($)){let X=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(X)}return!0}function y5($){let Z=new Set;return jY.visit($,{Value(X,z){if(z.anchor)Z.add(z.anchor)}}),Z}function f5($,Z){for(let X=1;;++X){let z=`${$}${X}`;if(!Z.has(z))return z}}function xY($,Z){let X=[],z=new Map,J=null;return{onAnchor:(Q)=>{X.push(Q),J??(J=y5($));let Y=f5(Z,J);return J.add(Y),Y},setAnchors:()=>{for(let Q of X){let Y=z.get(Q);if(typeof Y==="object"&&Y.anchor&&(k5.isScalar(Y.node)||k5.isCollection(Y.node)))Y.node.anchor=Y.anchor;else{let W=Error("Failed to resolve repeated object (this should not happen)");throw W.source=Q,W}}},sourceObjects:z}}bY.anchorIsValid=SY;bY.anchorNames=y5;bY.createNodeAnchors=xY;bY.findNewAnchor=f5});var J8=F((vY)=>{function v1($,Z,X,z){if(z&&typeof z==="object")if(Array.isArray(z))for(let J=0,Q=z.length;J<Q;++J){let Y=z[J],W=v1($,z,String(J),Y);if(W===void 0)delete z[J];else if(W!==Y)z[J]=W}else if(z instanceof Map)for(let J of Array.from(z.keys())){let Q=z.get(J),Y=v1($,z,J,Q);if(Y===void 0)z.delete(J);else if(Y!==Q)z.set(J,Y)}else if(z instanceof Set)for(let J of Array.from(z)){let Q=v1($,z,J,J);if(Q===void 0)z.delete(J);else if(Q!==J)z.delete(J),z.add(Q)}else for(let[J,Q]of Object.entries(z)){let Y=v1($,z,J,Q);if(Y===void 0)delete z[J];else if(Y!==Q)z[J]=Y}return $.call(Z,X,z)}vY.applyReviver=v1});var X$=F((mY)=>{var uY=d();function g5($,Z,X){if(Array.isArray($))return $.map((z,J)=>g5(z,String(J),X));if($&&typeof $.toJSON==="function"){if(!X||!uY.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 $}mY.toJS=g5});var H2=F((lY)=>{var dY=J8(),v5=d(),pY=X$();class h5{constructor($){Object.defineProperty(this,v5.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(!v5.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=pY.toJS(this,"",Q);if(typeof z==="function")for(let{count:W,res:U}of Q.anchors.values())z(U,W);return typeof J==="function"?dY.applyReviver(J,{"":Y},"",Y):Y}}lY.NodeBase=h5});var h1=F((oY)=>{var nY=K2(),rY=g1(),d$=d(),sY=H2(),aY=X$();class u5 extends sY.NodeBase{constructor($){super(d$.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=[],rY.visit($,{Node:(J,Q)=>{if(d$.isAlias(Q)||d$.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 W=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(W)}let Y=X.get(Q);if(!Y)aY.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=B2(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(nY.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 B2($,Z,X){if(d$.isAlias(Z)){let z=Z.resolve($),J=X&&z&&X.get(z);return J?J.count*J.aliasCount:0}else if(d$.isCollection(Z)){let z=0;for(let J of Z.items){let Q=B2($,J,X);if(Q>z)z=Q}return z}else if(d$.isPair(Z)){let z=B2($,Z.key,X),J=B2($,Z.value,X);return Math.max(z,J)}return 1}oY.Alias=u5});var Z0=F((zW)=>{var eY=d(),$W=H2(),ZW=X$(),XW=($)=>!$||typeof $!=="function"&&typeof $!=="object";class A$ extends $W.NodeBase{constructor($){super(eY.SCALAR);this.value=$}toJSON($,Z){return Z?.keep?this.value:ZW.toJS(this.value,$,Z)}toString(){return String(this.value)}}A$.BLOCK_FOLDED="BLOCK_FOLDED";A$.BLOCK_LITERAL="BLOCK_LITERAL";A$.PLAIN="PLAIN";A$.QUOTE_DOUBLE="QUOTE_DOUBLE";A$.QUOTE_SINGLE="QUOTE_SINGLE";zW.Scalar=A$;zW.isScalarValue=XW});var u1=F((qW)=>{var YW=h1(),R$=d(),m5=Z0(),WW="tag:yaml.org,2002:";function UW($,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 GW($,Z,X){if(R$.isDocument($))$=$.contents;if(R$.isNode($))return $;if(R$.isPair($)){let V=X.schema[R$.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:W}=X,U=void 0;if(z&&$&&typeof $==="object")if(U=W.get($),U)return U.anchor??(U.anchor=J($)),new YW.Alias(U.anchor);else U={anchor:null,node:null},W.set($,U);if(Z?.startsWith("!!"))Z=WW+Z.slice(2);let G=UW($,Z,Y.tags);if(!G){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let V=new m5.Scalar($);if(U)U.node=V;return V}G=$ instanceof Map?Y[R$.MAP]:(Symbol.iterator in Object($))?Y[R$.SEQ]:Y[R$.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 m5.Scalar($);if(Z)q.tag=Z;else if(!G.default)q.tag=G.tag;if(U)U.node=q;return q}qW.createNode=GW});var L2=F((BW)=>{var KW=u1(),u0=d(),HW=H2();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 KW.createNode(z,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var c5=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class d5 extends HW.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)=>u0.isNode(X)||u0.isPair(X)?X.clone($):X),this.range)Z.range=this.range.slice();return Z}addIn($,Z){if(c5($))this.add(Z);else{let[X,...z]=$,J=this.get(X,!0);if(u0.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(u0.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&&u0.isScalar(J)?J.value:J;else return u0.isCollection(J)?J.getIn(z,Z):void 0}hasAllNullValues($){return this.items.every((Z)=>{if(!u0.isPair(Z))return!1;let X=Z.value;return X==null||$&&u0.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 u0.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(u0.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}`)}}}BW.Collection=d5;BW.collectionFromPath=Q8;BW.isEmptyPath=c5});var m1=F((DW)=>{var OW=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function Y8($,Z){if(/^\n+$/.test($))return $.substring(1);return Z?$.replace(/^(?! *$)/gm,Z):$}var TW=($,Z,X)=>$.endsWith(`
29
+ `)?Y8(X,Z):X.includes(`
30
30
  `)?`
31
- `+Q8(X,Z):($.endsWith(" ")?"":" ")+X;WU.indentComment=Q8;WU.lineComment=UU;WU.stringifyComment=YU});var m5=F((HU)=>{function KU($,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,L=-1,N=-1,P=-1;if(X==="block"){if(L=u5($,L,Z.length),L!==-1)V=L+W}for(let j;j=$[L+=1];){if(X==="quoted"&&j==="\\"){switch(N=L,$[L+1]){case"x":L+=3;break;case"u":L+=5;break;case"U":L+=9;break;default:L+=1}P=L}if(j===`
32
- `){if(X==="block")L=u5($,L,Z.length);V=L+Z.length+W,K=void 0}else{if(j===" "&&H&&H!==" "&&H!==`
33
- `&&H!=="\t"){let b=$[L+1];if(b&&b!==" "&&b!==`
34
- `&&b!=="\t")K=L}if(L>=V)if(K)G.push(K),V=K+W,K=void 0;else if(X==="quoted"){while(H===" "||H==="\t")H=j,j=$[L+=1],T=!0;let b=L>P+1?L-2:N-1;if(q[b])return $;G.push(b),q[b]=!0,V=b+W,K=void 0}else T=!0}H=j}if(T&&U)U();if(G.length===0)return $;if(Y)Y();let C=$.slice(0,G[0]);for(let j=0;j<G.length;++j){let b=G[j],k=G[j+1]||$.length;if(b===0)C=`
31
+ `+Y8(X,Z):($.endsWith(" ")?"":" ")+X;DW.indentComment=Y8;DW.lineComment=TW;DW.stringifyComment=OW});var l5=F((_W)=>{function FW($,Z,X="flow",{indentAtStart:z,lineWidth:J=80,minContentWidth:Q=20,onFold:Y,onOverflow:W}={}){if(!J||J<0)return $;if(J<Q)Q=0;let U=Math.max(1+Q,1+J-Z.length);if($.length<=U)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,P=-1;if(X==="block"){if(B=p5($,B,Z.length),B!==-1)V=B+U}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}P=B}if(j===`
32
+ `){if(X==="block")B=p5($,B,Z.length);V=B+Z.length+U,K=void 0}else{if(j===" "&&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+U,K=void 0;else if(X==="quoted"){while(H===" "||H==="\t")H=j,j=$[B+=1],T=!0;let b=B>P+1?B-2:N-1;if(q[b])return $;G.push(b),q[b]=!0,V=b+U,K=void 0}else T=!0}H=j}if(T&&W)W();if(G.length===0)return $;if(Y)Y();let C=$.slice(0,G[0]);for(let j=0;j<G.length;++j){let b=G[j],k=G[j+1]||$.length;if(b===0)C=`
35
35
  ${Z}${$.slice(0,k)}`;else{if(X==="quoted"&&q[b])C+=`${$[b]}\\`;C+=`
36
- ${Z}${$.slice(b+1,k)}`}}return C}function u5($,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}HU.FOLD_BLOCK="block";HU.FOLD_FLOW="flow";HU.FOLD_QUOTED="quoted";HU.foldFlowLines=KU});var c1=F((IU)=>{var x0=Z0(),z$=m5(),M2=($,Z)=>({indentAtStart:Z?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),N2=($)=>/^(%|---|\.\.\.)/m.test($);function OU($,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 m1($,Z){let X=JSON.stringify($);if(Z.options.doubleQuotedAsJSON)return X;let{implicitKey:z}=Z,J=Z.options.doubleQuotedMinMultiLineLength,Q=Z.indent||(N2($)?" ":""),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
-
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:z$.foldFlowLines(Y,Q,z$.FOLD_QUOTED,M2(Z,!1))}function Y8($,Z){if(Z.options.singleQuote===!1||Z.implicitKey&&$.includes(`
42
- `)||/[ \t]\n|\n[ \t]/.test($))return m1($,Z);let X=Z.indent||(N2($)?" ":""),z="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
43
- ${X}`)+"'";return Z.implicitKey?z:z$.foldFlowLines(z,X,z$.FOLD_FLOW,M2(Z,!1))}function p$($,Z){let{singleQuote:X}=Z.options,z;if(X===!1)z=m1;else{let J=$.includes('"'),Q=$.includes("'");if(J&&!Q)z=Y8;else if(Q&&!J)z=m1;else z=X?Y8:m1}return z($,Z)}var U8;try{U8=new RegExp(`(^|(?<!
36
+ ${Z}${$.slice(b+1,k)}`}}return C}function p5($,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}_W.FOLD_BLOCK="block";_W.FOLD_FLOW="flow";_W.FOLD_QUOTED="quoted";_W.foldFlowLines=FW});var d1=F((bW)=>{var x0=Z0(),z$=l5(),N2=($,Z)=>({indentAtStart:Z?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),O2=($)=>/^(%|---|\.\.\.)/m.test($);function jW($,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 c1($,Z){let X=JSON.stringify($);if(Z.options.doubleQuotedAsJSON)return X;let{implicitKey:z}=Z,J=Z.options.doubleQuotedMinMultiLineLength,Q=Z.indent||(O2($)?" ":""),Y="",W=0;for(let U=0,G=X[U];G;G=X[++U]){if(G===" "&&X[U+1]==="\\"&&X[U+2]==="n")Y+=X.slice(W,U)+"\\ ",U+=1,W=U,G="\\";if(G==="\\")switch(X[U+1]){case"u":{Y+=X.slice(W,U);let q=X.substr(U+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(U,6)}U+=5,W=U+1}break;case"n":if(z||X[U+2]==='"'||X.length<J)U+=1;else{Y+=X.slice(W,U)+`
39
+
40
+ `;while(X[U+2]==="\\"&&X[U+3]==="n"&&X[U+4]!=='"')Y+=`
41
+ `,U+=2;if(Y+=Q,X[U+2]===" ")Y+="\\";U+=1,W=U+1}break;default:U+=1}}return Y=W?Y+X.slice(W):X,z?Y:z$.foldFlowLines(Y,Q,z$.FOLD_QUOTED,N2(Z,!1))}function W8($,Z){if(Z.options.singleQuote===!1||Z.implicitKey&&$.includes(`
42
+ `)||/[ \t]\n|\n[ \t]/.test($))return c1($,Z);let X=Z.indent||(O2($)?" ":""),z="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
43
+ ${X}`)+"'";return Z.implicitKey?z:z$.foldFlowLines(z,X,z$.FOLD_FLOW,N2(Z,!1))}function p$($,Z){let{singleQuote:X}=Z.options,z;if(X===!1)z=c1;else{let J=$.includes('"'),Q=$.includes("'");if(J&&!Q)z=W8;else if(Q&&!J)z=c1;else z=X?W8:c1}return z($,Z)}var U8;try{U8=new RegExp(`(^|(?<!
44
44
  ))
45
45
  +(?!
46
- |$)`,"g")}catch{U8=/\n+(?!\n|$)/g}function L2({comment:$,type:Z,value:X},z,J,Q){let{blockQuote:Y,commentString:U,lineWidth:W}=z.options;if(!Y||/\n[\t ]+$/.test(X))return p$(X,z);let G=z.indent||(z.forceBlockIndent||N2(X)?" ":""),q=Y==="literal"?!0:Y==="folded"||Z===x0.Scalar.BLOCK_FOLDED?!1:Z===x0.Scalar.BLOCK_LITERAL?!0:!OU(X,W,G.length);if(!X)return q?`|
46
+ |$)`,"g")}catch{U8=/\n+(?!\n|$)/g}function M2({comment:$,type:Z,value:X},z,J,Q){let{blockQuote:Y,commentString:W,lineWidth:U}=z.options;if(!Y||/\n[\t ]+$/.test(X))return p$(X,z);let G=z.indent||(z.forceBlockIndent||O2(X)?" ":""),q=Y==="literal"?!0:Y==="folded"||Z===x0.Scalar.BLOCK_FOLDED?!1:Z===x0.Scalar.BLOCK_LITERAL?!0:!jW(X,U,G.length);if(!X)return q?`|
47
47
  `:`>
48
48
  `;let V,K;for(K=X.length;K>0;--K){let k=X[K-1];if(k!==`
49
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(U8,`$&${G}`)}let L=!1,N,P=-1;for(N=0;N<X.length;++N){let k=X[N];if(k===" ")L=!0;else if(k===`
52
- `)P=N;else break}let C=X.substring(0,P<N?P+1:N);if(C)X=X.substring(C.length),C=C.replace(/\n+/g,`$&${G}`);let b=(L?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,p=M2(z,!0);if(Y!=="folded"&&Z!==x0.Scalar.BLOCK_FOLDED)p.onOverflow=()=>{y=!0};let R=z$.foldFlowLines(`${C}${k}${H}`,G,z$.FOLD_BLOCK,p);if(!y)return`>${b}
51
+ `)H=H.slice(0,-1);H=H.replace(U8,`$&${G}`)}let B=!1,N,P=-1;for(N=0;N<X.length;++N){let k=X[N];if(k===" ")B=!0;else if(k===`
52
+ `)P=N;else break}let C=X.substring(0,P<N?P+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+=" "+W($.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,p=N2(z,!0);if(Y!=="folded"&&Z!==x0.Scalar.BLOCK_FOLDED)p.onOverflow=()=>{y=!0};let R=z$.foldFlowLines(`${C}${k}${H}`,G,z$.FOLD_BLOCK,p);if(!y)return`>${b}
54
54
  ${G}${R}`}return X=X.replace(/\n+/g,`$&${G}`),`|${b}
55
- ${G}${C}${X}${H}`}function TU($,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 p$(Q,Z);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(Q))return U||q||!Q.includes(`
57
- `)?p$(Q,Z):L2($,Z,X,z);if(!U&&!q&&J!==x0.Scalar.PLAIN&&Q.includes(`
58
- `))return L2($,Z,X,z);if(N2(Q)){if(W==="")return Z.forceBlockIndent=!0,L2($,Z,X,z);else if(U&&W===G)return p$(Q,Z)}let V=Q.replace(/\n+/g,`$&
59
- ${W}`);if(Y){let K=(L)=>L.default&&L.tag!=="tag:yaml.org,2002:str"&&L.test?.test(V),{compat:H,tags:T}=Z.doc.schema;if(T.some(K)||H?.some(K))return p$(Q,Z)}return U?V:z$.foldFlowLines(V,W,z$.FOLD_FLOW,M2(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!==x0.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(Y.value))U=x0.Scalar.QUOTE_DOUBLE}let W=(q)=>{switch(q){case x0.Scalar.BLOCK_FOLDED:case x0.Scalar.BLOCK_LITERAL:return J||Q?p$(Y.value,Z):L2(Y,Z,X,z);case x0.Scalar.QUOTE_DOUBLE:return m1(Y.value,Z);case x0.Scalar.QUOTE_SINGLE:return Y8(Y.value,Z);case x0.Scalar.PLAIN:return TU(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}IU.stringifyString=DU});var d1=F((jU)=>{var RU=V2(),J$=d(),FU=u1(),_U=c1();function PU($,Z){let X=Object.assign({blockQuote:!0,commentString:FU.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 CU($,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(J$.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 wU($,Z,{anchors:X,doc:z}){if(!z.directives)return"";let J=[],Q=(J$.isScalar($)||J$.isCollection($))&&$.anchor;if(Q&&RU.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(J$.isPair($))return $.toString(Z,X,z);if(J$.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=J$.isNode($)?$:Z.doc.createNode($,{onTagObj:(W)=>J=W});J??(J=CU(Z.doc.schema.tags,Q));let Y=wU(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):J$.isScalar(Q)?_U.stringifyString(Q,Z,X,z):Q.toString(Z,X,z);if(!Y)return U;return J$.isScalar(Q)||U[0]==="{"||U[0]==="["?`${Y} ${U}`:`${Y}
60
- ${Z.indent}${U}`}jU.createStringifyContext=PU;jU.stringify=EU});var p5=F((kU)=>{var p0=d(),c5=Z0(),d5=d1(),p1=u1();function bU({key:$,value:Z},X,z,J){let{allNullValues:Q,doc:Y,indent:U,indentStep:W,options:{commentString:G,indentSeq:q,simpleKeys:V}}=X,K=p0.isNode($)&&$.comment||null;if(V){if(K)throw Error("With simple keys, key nodes cannot have comments");if(p0.isCollection($)||!p0.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let H=!V&&(!$||K&&Z==null&&!X.inFlow||p0.isCollection($)||(p0.isScalar($)?$.type===c5.Scalar.BLOCK_FOLDED||$.type===c5.Scalar.BLOCK_LITERAL:typeof $==="object"));X=Object.assign({},X,{allNullValues:!1,implicitKey:!H&&(V||!Q),indent:U+W});let T=!1,L=!1,N=d5.stringify($,X,()=>T=!0,()=>L=!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+=p1.lineComment(N,X.indent,G(K));else if(L&&J)J();return N}if(T)K=null;if(H){if(K)N+=p1.lineComment(N,X.indent,G(K));N=`? ${N}
61
- ${U}:`}else if(N=`${N}:`,K)N+=p1.lineComment(N,X.indent,G(K));let P,C,j;if(p0.isNode(Z))P=!!Z.spaceBefore,C=Z.commentBefore,j=Z.comment;else if(P=!1,C=null,j=null,Z&&typeof Z==="object")Z=Y.createNode(Z);if(X.implicitKey=!1,!H&&!K&&p0.isScalar(Z))X.indentAtStart=N.length+1;if(L=!1,!q&&W.length>=2&&!X.inFlow&&!H&&p0.isSeq(Z)&&!Z.flow&&!Z.tag&&!Z.anchor)X.indent=X.indent.substring(2);let b=!1,k=d5.stringify(Z,X,()=>b=!0,()=>L=!0),y=" ";if(K||P||C){if(y=P?`
55
+ ${G}${C}${X}${H}`}function SW($,Z,X,z){let{type:J,value:Q}=$,{actualString:Y,implicitKey:W,indent:U,indentStep:G,inFlow:q}=Z;if(W&&Q.includes(`
56
+ `)||q&&/[[\]{},]/.test(Q))return p$(Q,Z);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(Q))return W||q||!Q.includes(`
57
+ `)?p$(Q,Z):M2($,Z,X,z);if(!W&&!q&&J!==x0.Scalar.PLAIN&&Q.includes(`
58
+ `))return M2($,Z,X,z);if(O2(Q)){if(U==="")return Z.forceBlockIndent=!0,M2($,Z,X,z);else if(W&&U===G)return p$(Q,Z)}let V=Q.replace(/\n+/g,`$&
59
+ ${U}`);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 p$(Q,Z)}return W?V:z$.foldFlowLines(V,U,z$.FOLD_FLOW,N2(Z,!1))}function xW($,Z,X,z){let{implicitKey:J,inFlow:Q}=Z,Y=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:W}=$;if(W!==x0.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(Y.value))W=x0.Scalar.QUOTE_DOUBLE}let U=(q)=>{switch(q){case x0.Scalar.BLOCK_FOLDED:case x0.Scalar.BLOCK_LITERAL:return J||Q?p$(Y.value,Z):M2(Y,Z,X,z);case x0.Scalar.QUOTE_DOUBLE:return c1(Y.value,Z);case x0.Scalar.QUOTE_SINGLE:return W8(Y.value,Z);case x0.Scalar.PLAIN:return SW(Y,Z,X,z);default:return null}},G=U(W);if(G===null){let{defaultKeyType:q,defaultStringType:V}=Z.options,K=J&&q||V;if(G=U(K),G===null)throw Error(`Unsupported default string type ${K}`)}return G}bW.stringifyString=xW});var p1=F((cW)=>{var yW=K2(),J$=d(),fW=m1(),gW=d1();function vW($,Z){let X=Object.assign({blockQuote:!0,commentString:fW.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 hW($,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(J$.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 uW($,Z,{anchors:X,doc:z}){if(!z.directives)return"";let J=[],Q=(J$.isScalar($)||J$.isCollection($))&&$.anchor;if(Q&&yW.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 mW($,Z,X,z){if(J$.isPair($))return $.toString(Z,X,z);if(J$.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=J$.isNode($)?$:Z.doc.createNode($,{onTagObj:(U)=>J=U});J??(J=hW(Z.doc.schema.tags,Q));let Y=uW(Q,J,Z);if(Y.length>0)Z.indentAtStart=(Z.indentAtStart??0)+Y.length+1;let W=typeof J.stringify==="function"?J.stringify(Q,Z,X,z):J$.isScalar(Q)?gW.stringifyString(Q,Z,X,z):Q.toString(Z,X,z);if(!Y)return W;return J$.isScalar(Q)||W[0]==="{"||W[0]==="["?`${Y} ${W}`:`${Y}
60
+ ${Z.indent}${W}`}cW.createStringifyContext=vW;cW.stringify=mW});var r5=F((iW)=>{var p0=d(),i5=Z0(),n5=p1(),l1=m1();function lW({key:$,value:Z},X,z,J){let{allNullValues:Q,doc:Y,indent:W,indentStep:U,options:{commentString:G,indentSeq:q,simpleKeys:V}}=X,K=p0.isNode($)&&$.comment||null;if(V){if(K)throw Error("With simple keys, key nodes cannot have comments");if(p0.isCollection($)||!p0.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let H=!V&&(!$||K&&Z==null&&!X.inFlow||p0.isCollection($)||(p0.isScalar($)?$.type===i5.Scalar.BLOCK_FOLDED||$.type===i5.Scalar.BLOCK_LITERAL:typeof $==="object"));X=Object.assign({},X,{allNullValues:!1,implicitKey:!H&&(V||!Q),indent:W+U});let T=!1,B=!1,N=n5.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+=l1.lineComment(N,X.indent,G(K));else if(B&&J)J();return N}if(T)K=null;if(H){if(K)N+=l1.lineComment(N,X.indent,G(K));N=`? ${N}
61
+ ${W}:`}else if(N=`${N}:`,K)N+=l1.lineComment(N,X.indent,G(K));let P,C,j;if(p0.isNode(Z))P=!!Z.spaceBefore,C=Z.commentBefore,j=Z.comment;else if(P=!1,C=null,j=null,Z&&typeof Z==="object")Z=Y.createNode(Z);if(X.implicitKey=!1,!H&&!K&&p0.isScalar(Z))X.indentAtStart=N.length+1;if(B=!1,!q&&U.length>=2&&!X.inFlow&&!H&&p0.isSeq(Z)&&!Z.flow&&!Z.tag&&!Z.anchor)X.indent=X.indent.substring(2);let b=!1,k=n5.stringify(Z,X,()=>b=!0,()=>B=!0),y=" ";if(K||P||C){if(y=P?`
62
62
  `:"",C){let p=G(C);y+=`
63
- ${p1.indentComment(p,X.indent)}`}if(k===""&&!X.inFlow){if(y===`
63
+ ${l1.indentComment(p,X.indent)}`}if(k===""&&!X.inFlow){if(y===`
64
64
  `&&j)y=`
65
65
 
66
66
  `}else y+=`
67
67
  ${X.indent}`}else if(!H&&p0.isCollection(Z)){let p=k[0],R=k.indexOf(`
68
68
  `),u=R!==-1,g0=X.inFlow??Z.flow??Z.items.length===0;if(u||!g0){let v0=!1;if(u&&(p==="&"||p==="!")){let $0=k.indexOf(" ");if(p==="&"&&$0!==-1&&$0<R&&k[$0+1]==="!")$0=k.indexOf(" ",$0+1);if($0===-1||R<$0)v0=!0}if(!v0)y=`
69
69
  ${X.indent}`}}else if(k===""||k[0]===`
70
- `)y="";if(N+=y+k,X.inFlow){if(b&&z)z()}else if(j&&!b)N+=p1.lineComment(N,X.indent,G(j));else if(L&&J)J();return N}kU.stringifyPair=bU});var W8=F((vU)=>{var l5=D0("process");function fU($,...Z){if($==="debug")console.log(...Z)}function gU($,Z){if($==="debug"||$==="warn")if(typeof l5.emitWarning==="function")l5.emitWarning(Z);else console.warn(Z)}vU.debug=fU;vU.warn=gU});var D2=F((cU)=>{var l1=d(),i5=Z0(),O2="<<",T2={identify:($)=>$===O2||typeof $==="symbol"&&$.description===O2,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new i5.Scalar(Symbol(O2)),{addToJSMap:n5}),stringify:()=>O2},mU=($,Z)=>(T2.identify(Z)||l1.isScalar(Z)&&(!Z.type||Z.type===i5.Scalar.PLAIN)&&T2.identify(Z.value))&&$?.doc.schema.tags.some((X)=>X.tag===T2.tag&&X.default);function n5($,Z,X){if(X=$&&l1.isAlias(X)?X.resolve($.doc):X,l1.isSeq(X))for(let z of X.items)G8($,Z,z);else if(Array.isArray(X))for(let z of X)G8($,Z,z);else G8($,Z,X)}function G8($,Z,X){let z=$&&l1.isAlias(X)?X.resolve($.doc):X;if(!l1.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}cU.addMergeToJSMap=n5;cU.isMergeKey=mU;cU.merge=T2});var V8=F((aU)=>{var iU=W8(),r5=D2(),nU=d1(),s5=d(),q8=X$();function rU($,Z,{key:X,value:z}){if(s5.isNode(X)&&X.addToJSMap)X.addToJSMap($,Z,z);else if(r5.isMergeKey($,X))r5.addMergeToJSMap($,Z,z);else{let J=q8.toJS(X,"",$);if(Z instanceof Map)Z.set(J,q8.toJS(z,J,$));else if(Z instanceof Set)Z.add(J);else{let Q=sU(X,J,$),Y=q8.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 sU($,Z,X){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(s5.isNode($)&&X?.doc){let z=nU.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)+'..."';iU.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)}aU.addPairToJSMap=rU});var Q$=F((ZW)=>{var a5=h1(),tU=p5(),eU=V8(),I2=d();function $W($,Z,X){let z=a5.createNode($,void 0,X),J=a5.createNode(Z,void 0,X);return new A2(z,J)}class A2{constructor($,Z=null){Object.defineProperty(this,I2.NODE_TYPE,{value:I2.PAIR}),this.key=$,this.value=Z}clone($){let{key:Z,value:X}=this;if(I2.isNode(Z))Z=Z.clone($);if(I2.isNode(X))X=X.clone($);return new A2(Z,X)}toJSON($,Z){let X=Z?.mapAsMap?new Map:{};return eU.addPairToJSMap(Z,X,this)}toString($,Z,X){return $?.doc?tU.stringifyPair(this,$,Z,X):JSON.stringify(this)}}ZW.Pair=A2;ZW.createPair=$W});var K8=F((UW)=>{var F$=d(),o5=d1(),R2=u1();function JW($,Z,X){return(Z.inFlow??$.flow?YW:QW)($,Z,X)}function QW({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 L=Z[T],N=null;if(F$.isNode(L)){if(!V&&L.spaceBefore)K.push("");if(F2(X,K,L.commentBefore,V),L.comment)N=L.comment}else if(F$.isPair(L)){let C=F$.isNode(L.key)?L.key:null;if(C){if(!V&&C.spaceBefore)K.push("");F2(X,K,C.commentBefore,V)}}V=!1;let P=o5.stringify(L,q,()=>N=null,()=>V=!0);if(N)P+=R2.lineComment(P,Q,G(N));if(V&&N)V=!1;K.push(z+P)}let H;if(K.length===0)H=J.start+J.end;else{H=K[0];for(let T=1;T<K.length;++T){let L=K[T];H+=L?`
71
- ${W}${L}`:`
70
+ `)y="";if(N+=y+k,X.inFlow){if(b&&z)z()}else if(j&&!b)N+=l1.lineComment(N,X.indent,G(j));else if(B&&J)J();return N}iW.stringifyPair=lW});var G8=F((aW)=>{var s5=D0("process");function rW($,...Z){if($==="debug")console.log(...Z)}function sW($,Z){if($==="debug"||$==="warn")if(typeof s5.emitWarning==="function")s5.emitWarning(Z);else console.warn(Z)}aW.debug=rW;aW.warn=sW});var I2=F(($U)=>{var i1=d(),a5=Z0(),T2="<<",D2={identify:($)=>$===T2||typeof $==="symbol"&&$.description===T2,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new a5.Scalar(Symbol(T2)),{addToJSMap:o5}),stringify:()=>T2},eW=($,Z)=>(D2.identify(Z)||i1.isScalar(Z)&&(!Z.type||Z.type===a5.Scalar.PLAIN)&&D2.identify(Z.value))&&$?.doc.schema.tags.some((X)=>X.tag===D2.tag&&X.default);function o5($,Z,X){if(X=$&&i1.isAlias(X)?X.resolve($.doc):X,i1.isSeq(X))for(let z of X.items)q8($,Z,z);else if(Array.isArray(X))for(let z of X)q8($,Z,z);else q8($,Z,X)}function q8($,Z,X){let z=$&&i1.isAlias(X)?X.resolve($.doc):X;if(!i1.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}$U.addMergeToJSMap=o5;$U.isMergeKey=eW;$U.merge=D2});var K8=F((UU)=>{var JU=G8(),t5=I2(),QU=p1(),e5=d(),V8=X$();function YU($,Z,{key:X,value:z}){if(e5.isNode(X)&&X.addToJSMap)X.addToJSMap($,Z,z);else if(t5.isMergeKey($,X))t5.addMergeToJSMap($,Z,z);else{let J=V8.toJS(X,"",$);if(Z instanceof Map)Z.set(J,V8.toJS(z,J,$));else if(Z instanceof Set)Z.add(J);else{let Q=WU(X,J,$),Y=V8.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 WU($,Z,X){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(e5.isNode($)&&X?.doc){let z=QU.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)+'..."';JU.warn(X.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${Q}. Set mapAsMap: true to use object keys.`),X.mapKeyWarned=!0}return J}return JSON.stringify(Z)}UU.addPairToJSMap=YU});var Q$=F((HU)=>{var $7=u1(),qU=r5(),VU=K8(),A2=d();function KU($,Z,X){let z=$7.createNode($,void 0,X),J=$7.createNode(Z,void 0,X);return new R2(z,J)}class R2{constructor($,Z=null){Object.defineProperty(this,A2.NODE_TYPE,{value:A2.PAIR}),this.key=$,this.value=Z}clone($){let{key:Z,value:X}=this;if(A2.isNode(Z))Z=Z.clone($);if(A2.isNode(X))X=X.clone($);return new R2(Z,X)}toJSON($,Z){let X=Z?.mapAsMap?new Map:{};return VU.addPairToJSMap(Z,X,this)}toString($,Z,X){return $?.doc?qU.stringifyPair(this,$,Z,X):JSON.stringify(this)}}HU.Pair=R2;HU.createPair=KU});var H8=F((TU)=>{var F$=d(),Z7=p1(),F2=m1();function MU($,Z,X){return(Z.inFlow??$.flow?OU:NU)($,Z,X)}function NU({comment:$,items:Z},X,{blockItemPrefix:z,flowChars:J,itemIndent:Q,onChompKeep:Y,onComment:W}){let{indent:U,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(F$.isNode(B)){if(!V&&B.spaceBefore)K.push("");if(_2(X,K,B.commentBefore,V),B.comment)N=B.comment}else if(F$.isPair(B)){let C=F$.isNode(B.key)?B.key:null;if(C){if(!V&&C.spaceBefore)K.push("");_2(X,K,C.commentBefore,V)}}V=!1;let P=Z7.stringify(B,q,()=>N=null,()=>V=!0);if(N)P+=F2.lineComment(P,Q,G(N));if(V&&N)V=!1;K.push(z+P)}let H;if(K.length===0)H=J.start+J.end;else{H=K[0];for(let T=1;T<K.length;++T){let B=K[T];H+=B?`
71
+ ${U}${B}`:`
72
72
  `}}if($){if(H+=`
73
- `+R2.indentComment(G($),W),U)U()}else if(V&&Y)Y();return H}function YW({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 L=$[T],N=null;if(F$.isNode(L)){if(L.spaceBefore)V.push("");if(F2(Z,V,L.commentBefore,!1),L.comment)N=L.comment}else if(F$.isPair(L)){let C=F$.isNode(L.key)?L.key:null;if(C){if(C.spaceBefore)V.push("");if(F2(Z,V,C.commentBefore,!1),C.comment)G=!0}let j=F$.isNode(L.value)?L.value:null;if(j){if(j.comment)N=j.comment;if(j.commentBefore)G=!0}else if(L.value==null&&C?.comment)N=C.comment}if(N)G=!0;let P=o5.stringify(L,W,()=>N=null);if(T<$.length-1)P+=",";if(N)P+=R2.lineComment(P,z,U(N));if(!G&&(V.length>q||P.includes(`
74
- `)))G=!0;V.push(P),q=V.length}let{start:K,end:H}=X;if(V.length===0)return K+H;else{if(!G){let T=V.reduce((L,N)=>L+N.length+2,2);G=Z.options.lineWidth>0&&T>Z.options.lineWidth}if(G){let T=K;for(let L of V)T+=L?`
75
- ${Q}${J}${L}`:`
73
+ `+F2.indentComment(G($),U),W)W()}else if(V&&Y)Y();return H}function OU({items:$},Z,{flowChars:X,itemIndent:z}){let{indent:J,indentStep:Q,flowCollectionPadding:Y,options:{commentString:W}}=Z;z+=Q;let U=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(F$.isNode(B)){if(B.spaceBefore)V.push("");if(_2(Z,V,B.commentBefore,!1),B.comment)N=B.comment}else if(F$.isPair(B)){let C=F$.isNode(B.key)?B.key:null;if(C){if(C.spaceBefore)V.push("");if(_2(Z,V,C.commentBefore,!1),C.comment)G=!0}let j=F$.isNode(B.value)?B.value:null;if(j){if(j.comment)N=j.comment;if(j.commentBefore)G=!0}else if(B.value==null&&C?.comment)N=C.comment}if(N)G=!0;let P=Z7.stringify(B,U,()=>N=null);if(T<$.length-1)P+=",";if(N)P+=F2.lineComment(P,z,W(N));if(!G&&(V.length>q||P.includes(`
74
+ `)))G=!0;V.push(P),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
+ ${Q}${J}${B}`:`
76
76
  `;return`${T}
77
- ${J}${H}`}else return`${K}${Y}${V.join(" ")}${Y}${H}`}}function F2({indent:$,options:{commentString:Z}},X,z,J){if(z&&J)z=z.replace(/^\n+/,"");if(z){let Q=R2.indentComment(Z(z),$);X.push(Q.trimStart())}}UW.stringifyCollection=JW});var U$=F((HW)=>{var GW=K8(),qW=V8(),VW=B2(),Y$=d(),_2=Q$(),KW=Z0();function i1($,Z){let X=Y$.isScalar(Z)?Z.value:Z;for(let z of $)if(Y$.isPair(z)){if(z.key===Z||z.key===X)return z;if(Y$.isScalar(z.key)&&z.key.value===X)return z}return}class t5 extends VW.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(Y$.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(_2.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(Y$.isPair($))X=$;else if(!$||typeof $!=="object"||!("key"in $))X=new _2.Pair($,$?.value);else X=new _2.Pair($.key,$.value);let z=i1(this.items,X.key),J=this.schema?.sortMapEntries;if(z){if(!Z)throw Error(`Key ${X.key} already set`);if(Y$.isScalar(z.value)&&KW.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=i1(this.items,$);if(!Z)return!1;return this.items.splice(this.items.indexOf(Z),1).length>0}get($,Z){let z=i1(this.items,$)?.value;return(!Z&&Y$.isScalar(z)?z.value:z)??void 0}has($){return!!i1(this.items,$)}set($,Z){this.add(new _2.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)qW.addPairToJSMap(Z,z,J);return z}toString($,Z,X){if(!$)return JSON.stringify(this);for(let z of this.items)if(!Y$.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 GW.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:X,onComment:Z})}}HW.YAMLMap=t5;HW.findPair=i1});var l$=F((OW)=>{var MW=d(),e5=U$(),NW={collection:"map",default:!0,nodeClass:e5.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,Z){if(!MW.isMap($))Z("Expected a mapping for this tag");return $},createNode:($,Z,X)=>e5.YAMLMap.from($,Z,X)};OW.map=NW});var W$=F((_W)=>{var DW=h1(),IW=K8(),AW=B2(),C2=d(),RW=Z0(),FW=X$();class $7 extends AW.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(C2.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let Z=P2($);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get($,Z){let X=P2($);if(typeof X!=="number")return;let z=this.items[X];return!Z&&C2.isScalar(z)?z.value:z}has($){let Z=P2($);return typeof Z==="number"&&Z<this.items.length}set($,Z){let X=P2($);if(typeof X!=="number")throw Error(`Expected a valid index, not ${$}.`);let z=this.items[X];if(C2.isScalar(z)&&RW.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(FW.toJS(J,String(z++),Z));return X}toString($,Z,X){if(!$)return JSON.stringify(this);return IW.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 P2($){let Z=C2.isScalar($)?$.value:$;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}_W.YAMLSeq=$7});var i$=F((EW)=>{var CW=d(),Z7=W$(),wW={collection:"seq",default:!0,nodeClass:Z7.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,Z){if(!CW.isSeq($))Z("Expected a sequence for this tag");return $},createNode:($,Z,X)=>Z7.YAMLSeq.from($,Z,X)};EW.seq=wW});var n1=F((bW)=>{var SW=c1(),xW={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,Z,X,z){return Z=Object.assign({actualString:!0},Z),SW.stringifyString($,Z,X,z)}};bW.string=xW});var w2=F((yW)=>{var X7=Z0(),z7={identify:($)=>$==null,createNode:()=>new X7.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new X7.Scalar(null),stringify:({source:$},Z)=>typeof $==="string"&&z7.test.test($)?$:Z.options.nullStr};yW.nullTag=z7});var H8=F((vW)=>{var gW=Z0(),J7={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new gW.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:Z},X){if($&&J7.test.test($)){let z=$[0]==="t"||$[0]==="T";if(Z===z)return $}return Z?X.options.trueStr:X.options.falseStr}};vW.boolTag=J7});var n$=F((mW)=>{function uW({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}mW.stringifyNumber=uW});var L8=F((nW)=>{var dW=Z0(),B8=n$(),pW={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:B8.stringifyNumber},lW={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():B8.stringifyNumber($)}},iW={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let Z=new dW.Scalar(parseFloat($)),X=$.indexOf(".");if(X!==-1&&$[$.length-1]==="0")Z.minFractionDigits=$.length-X-1;return Z},stringify:B8.stringifyNumber};nW.float=iW;nW.floatExp=lW;nW.floatNaN=pW});var N8=F(($G)=>{var Q7=n$(),E2=($)=>typeof $==="bigint"||Number.isInteger($),M8=($,Z,X,{intAsBigInt:z})=>z?BigInt($):parseInt($.substring(Z),X);function Y7($,Z,X){let{value:z}=$;if(E2(z)&&z>=0)return X+z.toString(Z);return Q7.stringifyNumber($)}var oW={identify:($)=>E2($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,Z,X)=>M8($,2,8,X),stringify:($)=>Y7($,8,"0o")},tW={identify:E2,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,Z,X)=>M8($,0,10,X),stringify:Q7.stringifyNumber},eW={identify:($)=>E2($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,Z,X)=>M8($,2,16,X),stringify:($)=>Y7($,16,"0x")};$G.int=tW;$G.intHex=eW;$G.intOct=oW});var U7=F((qG)=>{var JG=l$(),QG=w2(),YG=i$(),UG=n1(),WG=H8(),O8=L8(),T8=N8(),GG=[JG.map,YG.seq,UG.string,QG.nullTag,WG.boolTag,T8.intOct,T8.int,T8.intHex,O8.floatNaN,O8.floatExp,O8.float];qG.schema=GG});var G7=F((OG)=>{var KG=Z0(),HG=l$(),BG=i$();function W7($){return typeof $==="bigint"||Number.isInteger($)}var j2=({value:$})=>JSON.stringify($),LG=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:j2},{identify:($)=>$==null,createNode:()=>new KG.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:j2},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:j2},{identify:W7,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,Z,{intAsBigInt:X})=>X?BigInt($):parseInt($,10),stringify:({value:$})=>W7($)?$.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:j2}],MG={default:!0,tag:"",test:/^/,resolve($,Z){return Z(`Unresolved plain scalar ${JSON.stringify($)}`),$}},NG=[HG.map,BG.seq].concat(LG,MG);OG.schema=NG});var I8=F((AG)=>{var r1=D0("buffer"),D8=Z0(),DG=c1(),IG={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,Z){if(typeof r1.Buffer==="function")return r1.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 r1.Buffer==="function")U=Y instanceof r1.Buffer?Y.toString("base64"):r1.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=D8.Scalar.BLOCK_LITERAL),Z!==D8.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===D8.Scalar.BLOCK_LITERAL?`
78
- `:" ")}return DG.stringifyString({comment:$,type:Z,value:U},z,J,Q)}};AG.binary=IG});var x2=F((CG)=>{var S2=d(),A8=Q$(),FG=Z0(),_G=W$();function q7($,Z){if(S2.isSeq($))for(let X=0;X<$.items.length;++X){let z=$.items[X];if(S2.isPair(z))continue;else if(S2.isMap(z)){if(z.items.length>1)Z("Each pair must have its own sequence indicator");let J=z.items[0]||new A8.Pair(new FG.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 _2({indent:$,options:{commentString:Z}},X,z,J){if(z&&J)z=z.replace(/^\n+/,"");if(z){let Q=F2.indentComment(Z(z),$);X.push(Q.trimStart())}}TU.stringifyCollection=MU});var W$=F((_U)=>{var IU=H8(),AU=K8(),RU=L2(),Y$=d(),P2=Q$(),FU=Z0();function n1($,Z){let X=Y$.isScalar(Z)?Z.value:Z;for(let z of $)if(Y$.isPair(z)){if(z.key===Z||z.key===X)return z;if(Y$.isScalar(z.key)&&z.key.value===X)return z}return}class X7 extends RU.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(Y$.MAP,$);this.items=[]}static from($,Z,X){let{keepUndefined:z,replacer:J}=X,Q=new this($),Y=(W,U)=>{if(typeof J==="function")U=J.call(Z,W,U);else if(Array.isArray(J)&&!J.includes(W))return;if(U!==void 0||z)Q.items.push(P2.createPair(W,U,X))};if(Z instanceof Map)for(let[W,U]of Z)Y(W,U);else if(Z&&typeof Z==="object")for(let W of Object.keys(Z))Y(W,Z[W]);if(typeof $.sortMapEntries==="function")Q.items.sort($.sortMapEntries);return Q}add($,Z){let X;if(Y$.isPair($))X=$;else if(!$||typeof $!=="object"||!("key"in $))X=new P2.Pair($,$?.value);else X=new P2.Pair($.key,$.value);let z=n1(this.items,X.key),J=this.schema?.sortMapEntries;if(z){if(!Z)throw Error(`Key ${X.key} already set`);if(Y$.isScalar(z.value)&&FU.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=n1(this.items,$);if(!Z)return!1;return this.items.splice(this.items.indexOf(Z),1).length>0}get($,Z){let z=n1(this.items,$)?.value;return(!Z&&Y$.isScalar(z)?z.value:z)??void 0}has($){return!!n1(this.items,$)}set($,Z){this.add(new P2.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)AU.addPairToJSMap(Z,z,J);return z}toString($,Z,X){if(!$)return JSON.stringify(this);for(let z of this.items)if(!Y$.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 IU.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:X,onComment:Z})}}_U.YAMLMap=X7;_U.findPair=n1});var l$=F((jU)=>{var wU=d(),z7=W$(),EU={collection:"map",default:!0,nodeClass:z7.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,Z){if(!wU.isMap($))Z("Expected a mapping for this tag");return $},createNode:($,Z,X)=>z7.YAMLMap.from($,Z,X)};jU.map=EU});var U$=F((gU)=>{var xU=u1(),bU=H8(),kU=L2(),w2=d(),yU=Z0(),fU=X$();class J7 extends kU.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(w2.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let Z=C2($);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get($,Z){let X=C2($);if(typeof X!=="number")return;let z=this.items[X];return!Z&&w2.isScalar(z)?z.value:z}has($){let Z=C2($);return typeof Z==="number"&&Z<this.items.length}set($,Z){let X=C2($);if(typeof X!=="number")throw Error(`Expected a valid index, not ${$}.`);let z=this.items[X];if(w2.isScalar(z)&&yU.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(fU.toJS(J,String(z++),Z));return X}toString($,Z,X){if(!$)return JSON.stringify(this);return bU.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:X,onComment:Z})}static from($,Z,X){let{replacer:z}=X,J=new this($);if(Z&&Symbol.iterator in Object(Z)){let Q=0;for(let Y of Z){if(typeof z==="function"){let W=Z instanceof Set?Y:String(Q++);Y=z.call(Z,W,Y)}J.items.push(xU.createNode(Y,void 0,X))}}return J}}function C2($){let Z=w2.isScalar($)?$.value:$;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}gU.YAMLSeq=J7});var i$=F((mU)=>{var hU=d(),Q7=U$(),uU={collection:"seq",default:!0,nodeClass:Q7.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,Z){if(!hU.isSeq($))Z("Expected a sequence for this tag");return $},createNode:($,Z,X)=>Q7.YAMLSeq.from($,Z,X)};mU.seq=uU});var r1=F((lU)=>{var dU=d1(),pU={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,Z,X,z){return Z=Object.assign({actualString:!0},Z),dU.stringifyString($,Z,X,z)}};lU.string=pU});var E2=F((nU)=>{var Y7=Z0(),W7={identify:($)=>$==null,createNode:()=>new Y7.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Y7.Scalar(null),stringify:({source:$},Z)=>typeof $==="string"&&W7.test.test($)?$:Z.options.nullStr};nU.nullTag=W7});var B8=F((aU)=>{var sU=Z0(),U7={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new sU.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:Z},X){if($&&U7.test.test($)){let z=$[0]==="t"||$[0]==="T";if(Z===z)return $}return Z?X.options.trueStr:X.options.falseStr}};aU.boolTag=U7});var n$=F((eU)=>{function tU({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 W=Z-(Q.length-Y-1);while(W-- >0)Q+="0"}return Q}eU.stringifyNumber=tU});var M8=F((QG)=>{var ZG=Z0(),L8=n$(),XG={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:L8.stringifyNumber},zG={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():L8.stringifyNumber($)}},JG={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let Z=new ZG.Scalar(parseFloat($)),X=$.indexOf(".");if(X!==-1&&$[$.length-1]==="0")Z.minFractionDigits=$.length-X-1;return Z},stringify:L8.stringifyNumber};QG.float=JG;QG.floatExp=zG;QG.floatNaN=XG});var O8=F((KG)=>{var G7=n$(),j2=($)=>typeof $==="bigint"||Number.isInteger($),N8=($,Z,X,{intAsBigInt:z})=>z?BigInt($):parseInt($.substring(Z),X);function q7($,Z,X){let{value:z}=$;if(j2(z)&&z>=0)return X+z.toString(Z);return G7.stringifyNumber($)}var GG={identify:($)=>j2($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,Z,X)=>N8($,2,8,X),stringify:($)=>q7($,8,"0o")},qG={identify:j2,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,Z,X)=>N8($,0,10,X),stringify:G7.stringifyNumber},VG={identify:($)=>j2($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,Z,X)=>N8($,2,16,X),stringify:($)=>q7($,16,"0x")};KG.int=qG;KG.intHex=VG;KG.intOct=GG});var V7=F((AG)=>{var MG=l$(),NG=E2(),OG=i$(),TG=r1(),DG=B8(),T8=M8(),D8=O8(),IG=[MG.map,OG.seq,TG.string,NG.nullTag,DG.boolTag,D8.intOct,D8.int,D8.intHex,T8.floatNaN,T8.floatExp,T8.float];AG.schema=IG});var H7=F((jG)=>{var FG=Z0(),_G=l$(),PG=i$();function K7($){return typeof $==="bigint"||Number.isInteger($)}var S2=({value:$})=>JSON.stringify($),CG=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:S2},{identify:($)=>$==null,createNode:()=>new FG.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:S2},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:S2},{identify:K7,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,Z,{intAsBigInt:X})=>X?BigInt($):parseInt($,10),stringify:({value:$})=>K7($)?$.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:S2}],wG={default:!0,tag:"",test:/^/,resolve($,Z){return Z(`Unresolved plain scalar ${JSON.stringify($)}`),$}},EG=[_G.map,PG.seq].concat(CG,wG);jG.schema=EG});var A8=F((kG)=>{var s1=D0("buffer"),I8=Z0(),xG=d1(),bG={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,Z){if(typeof s1.Buffer==="function")return s1.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,W;if(typeof s1.Buffer==="function")W=Y instanceof s1.Buffer?Y.toString("base64"):s1.Buffer.from(Y.buffer).toString("base64");else if(typeof btoa==="function"){let U="";for(let G=0;G<Y.length;++G)U+=String.fromCharCode(Y[G]);W=btoa(U)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(Z??(Z=I8.Scalar.BLOCK_LITERAL),Z!==I8.Scalar.QUOTE_DOUBLE){let U=Math.max(z.options.lineWidth-z.indent.length,z.options.minContentWidth),G=Math.ceil(W.length/U),q=Array(G);for(let V=0,K=0;V<G;++V,K+=U)q[V]=W.substr(K,U);W=q.join(Z===I8.Scalar.BLOCK_LITERAL?`
78
+ `:" ")}return xG.stringifyString({comment:$,type:Z,value:W},z,J,Q)}};kG.binary=bG});var b2=F((hG)=>{var x2=d(),R8=Q$(),fG=Z0(),gG=U$();function B7($,Z){if(x2.isSeq($))for(let X=0;X<$.items.length;++X){let z=$.items[X];if(x2.isPair(z))continue;else if(x2.isMap(z)){if(z.items.length>1)Z("Each pair must have its own sequence indicator");let J=z.items[0]||new R8.Pair(new fG.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]=S2.isPair(z)?z:new A8.Pair(z)}else Z("Expected a sequence for this tag");return $}function V7($,Z,X){let{replacer:z}=X,J=new _G.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(A8.createPair(U,W,X))}return J}var PG={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:q7,createNode:V7};CG.createPairs=V7;CG.pairs=PG;CG.resolvePairs=q7});var F8=F((bG)=>{var K7=d(),R8=X$(),s1=U$(),SG=W$(),H7=x2();class _$ extends SG.YAMLSeq{constructor(){super();this.add=s1.YAMLMap.prototype.add.bind(this),this.delete=s1.YAMLMap.prototype.delete.bind(this),this.get=s1.YAMLMap.prototype.get.bind(this),this.has=s1.YAMLMap.prototype.has.bind(this),this.set=s1.YAMLMap.prototype.set.bind(this),this.tag=_$.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(K7.isPair(z))J=R8.toJS(z.key,"",Z),Q=R8.toJS(z.value,J,Z);else J=R8.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=H7.createPairs($,Z,X),J=new this;return J.items=z.items,J}}_$.tag="tag:yaml.org,2002:omap";var xG={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:_$,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,Z){let X=H7.resolvePairs($,Z),z=[];for(let{key:J}of X.items)if(K7.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 _$,X)},createNode:($,Z,X)=>_$.from($,Z,X)};bG.YAMLOMap=_$;bG.omap=xG});var O7=F((fG)=>{var B7=Z0();function L7({value:$,source:Z},X){if(Z&&($?M7:N7).test.test(Z))return Z;return $?X.options.trueStr:X.options.falseStr}var M7={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new B7.Scalar(!0),stringify:L7},N7={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new B7.Scalar(!1),stringify:L7};fG.falseTag=N7;fG.trueTag=M7});var T7=F((dG)=>{var hG=Z0(),_8=n$(),uG={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:_8.stringifyNumber},mG={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():_8.stringifyNumber($)}},cG={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($.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:_8.stringifyNumber};dG.float=cG;dG.floatExp=mG;dG.floatNaN=uG});var I7=F((oG)=>{var D7=n$(),a1=($)=>typeof $==="bigint"||Number.isInteger($);function b2($,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 P8($,Z,X){let{value:z}=$;if(a1(z)){let J=z.toString(Z);return z<0?"-"+X+J.substr(1):X+J}return D7.stringifyNumber($)}var nG={identify:a1,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,Z,X)=>b2($,2,2,X),stringify:($)=>P8($,2,"0b")},rG={identify:a1,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,Z,X)=>b2($,1,8,X),stringify:($)=>P8($,8,"0")},sG={identify:a1,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,Z,X)=>b2($,0,10,X),stringify:D7.stringifyNumber},aG={identify:a1,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,Z,X)=>b2($,2,16,X),stringify:($)=>P8($,16,"0x")};oG.int=sG;oG.intBin=nG;oG.intHex=aG;oG.intOct=rG});var C8=F((zq)=>{var f2=d(),k2=Q$(),y2=U$();class P$ extends y2.YAMLMap{constructor($){super($);this.tag=P$.tag}add($){let Z;if(f2.isPair($))Z=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)Z=new k2.Pair($.key,null);else Z=new k2.Pair($,null);if(!y2.findPair(this.items,Z.key))this.items.push(Z)}get($,Z){let X=y2.findPair(this.items,$);return!Z&&f2.isPair(X)?f2.isScalar(X.key)?X.key.value:X.key:X}set($,Z){if(typeof Z!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof Z}`);let X=y2.findPair(this.items,$);if(X&&!Z)this.items.splice(this.items.indexOf(X),1);else if(!X&&Z)this.items.push(new k2.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(k2.createPair(Q,null,X))}return J}}P$.tag="tag:yaml.org,2002:set";var Xq={collection:"map",identify:($)=>$ instanceof Set,nodeClass:P$,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,Z,X)=>P$.from($,Z,X),resolve($,Z){if(f2.isMap($))if($.hasAllNullValues(!0))return Object.assign(new P$,$);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return $}};zq.YAMLSet=P$;zq.set=Xq});var E8=F((Gq)=>{var Yq=n$();function w8($,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 A7($){let{value:Z}=$,X=(Y)=>Y;if(typeof Z==="bigint")X=(Y)=>BigInt(Y);else if(isNaN(Z)||!isFinite(Z))return Yq.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 Uq={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})=>w8($,X),stringify:A7},Wq={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:($)=>w8($,!1),stringify:A7},R7={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(R7.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=w8(q,!1);if(Math.abs(V)<30)V*=60;G-=60000*V}return new Date(G)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Gq.floatTime=Wq;Gq.intTime=Uq;Gq.timestamp=R7});var _7=F((Rq)=>{var Hq=l$(),Bq=w2(),Lq=i$(),Mq=n1(),Nq=I8(),F7=O7(),j8=T7(),g2=I7(),Oq=D2(),Tq=F8(),Dq=x2(),Iq=C8(),S8=E8(),Aq=[Hq.map,Lq.seq,Mq.string,Bq.nullTag,F7.trueTag,F7.falseTag,g2.intBin,g2.intOct,g2.int,g2.intHex,j8.floatNaN,j8.floatExp,j8.float,Nq.binary,Oq.merge,Tq.omap,Dq.pairs,Iq.set,S8.intTime,S8.floatTime,S8.timestamp];Rq.schema=Aq});var y7=F((xq)=>{var E7=l$(),_q=w2(),j7=i$(),Pq=n1(),Cq=H8(),x8=L8(),b8=N8(),wq=U7(),Eq=G7(),S7=I8(),o1=D2(),x7=F8(),b7=x2(),P7=_7(),k7=C8(),v2=E8(),C7=new Map([["core",wq.schema],["failsafe",[E7.map,j7.seq,Pq.string]],["json",Eq.schema],["yaml11",P7.schema],["yaml-1.1",P7.schema]]),w7={binary:S7.binary,bool:Cq.boolTag,float:x8.float,floatExp:x8.floatExp,floatNaN:x8.floatNaN,floatTime:v2.floatTime,int:b8.int,intHex:b8.intHex,intOct:b8.intOct,intTime:v2.intTime,map:E7.map,merge:o1.merge,null:_q.nullTag,omap:x7.omap,pairs:b7.pairs,seq:j7.seq,set:k7.set,timestamp:v2.timestamp},jq={"tag:yaml.org,2002:binary":S7.binary,"tag:yaml.org,2002:merge":o1.merge,"tag:yaml.org,2002:omap":x7.omap,"tag:yaml.org,2002:pairs":b7.pairs,"tag:yaml.org,2002:set":k7.set,"tag:yaml.org,2002:timestamp":v2.timestamp};function Sq($,Z,X){let z=C7.get(Z);if(z&&!$)return X&&!z.includes(o1.merge)?z.concat(o1.merge):z.slice();let J=z;if(!J)if(Array.isArray($))J=[];else{let Q=Array.from(C7.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(o1.merge);return J.reduce((Q,Y)=>{let U=typeof Y==="string"?w7[Y]:Y;if(!U){let W=JSON.stringify(Y),G=Object.keys(w7).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},[])}xq.coreKnownTags=jq;xq.getTags=Sq});var f8=F((hq)=>{var k8=d(),yq=l$(),fq=i$(),gq=n1(),h2=y7(),vq=($,Z)=>$.key<Z.key?-1:$.key>Z.key?1:0;class y8{constructor({compat:$,customTags:Z,merge:X,resolveKnownTags:z,schema:J,sortMapEntries:Q,toStringDefaults:Y}){this.compat=Array.isArray($)?h2.getTags($,"compat"):$?h2.getTags(null,$):null,this.name=typeof J==="string"&&J||"core",this.knownTags=z?h2.coreKnownTags:{},this.tags=h2.getTags(Z,this.name,X),this.toStringOptions=Y??null,Object.defineProperty(this,k8.MAP,{value:yq.map}),Object.defineProperty(this,k8.SCALAR,{value:gq.string}),Object.defineProperty(this,k8.SEQ,{value:fq.seq}),this.sortMapEntries=typeof Q==="function"?Q:Q===!0?vq:null}clone(){let $=Object.create(y8.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}hq.Schema=y8});var f7=F((dq)=>{var mq=d(),g8=d1(),t1=u1();function cq($,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=g8.createStringifyContext($,Z),{commentString:Q}=J.options;if($.commentBefore){if(X.length!==1)X.unshift("");let W=Q($.commentBefore);X.unshift(t1.indentComment(W,""))}let Y=!1,U=null;if($.contents){if(mq.isNode($.contents)){if($.contents.spaceBefore&&z)X.push("");if($.contents.commentBefore){let q=Q($.contents.commentBefore);X.push(t1.indentComment(q,""))}J.forceBlockIndent=!!$.comment,U=$.contents.comment}let W=U?void 0:()=>Y=!0,G=g8.stringify($.contents,J,()=>U=null,W);if(U)G+=t1.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(g8.stringify($.contents,J));if($.directives?.docEnd)if($.comment){let W=Q($.comment);if(W.includes(`
81
- `))X.push("..."),X.push(t1.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(t1.indentComment(Q(W),""))}}return X.join(`
80
+ ${Q.comment}`:z.comment}z=J}$.items[X]=x2.isPair(z)?z:new R8.Pair(z)}else Z("Expected a sequence for this tag");return $}function L7($,Z,X){let{replacer:z}=X,J=new gG.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 W,U;if(Array.isArray(Y))if(Y.length===2)W=Y[0],U=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)W=G[0],U=Y[W];else throw TypeError(`Expected tuple with one key, not ${G.length} keys`)}else W=Y;J.items.push(R8.createPair(W,U,X))}return J}var vG={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:B7,createNode:L7};hG.createPairs=L7;hG.pairs=vG;hG.resolvePairs=B7});var _8=F((lG)=>{var M7=d(),F8=X$(),a1=W$(),dG=U$(),N7=b2();class _$ extends dG.YAMLSeq{constructor(){super();this.add=a1.YAMLMap.prototype.add.bind(this),this.delete=a1.YAMLMap.prototype.delete.bind(this),this.get=a1.YAMLMap.prototype.get.bind(this),this.has=a1.YAMLMap.prototype.has.bind(this),this.set=a1.YAMLMap.prototype.set.bind(this),this.tag=_$.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(M7.isPair(z))J=F8.toJS(z.key,"",Z),Q=F8.toJS(z.value,J,Z);else J=F8.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=N7.createPairs($,Z,X),J=new this;return J.items=z.items,J}}_$.tag="tag:yaml.org,2002:omap";var pG={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:_$,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,Z){let X=N7.resolvePairs($,Z),z=[];for(let{key:J}of X.items)if(M7.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 _$,X)},createNode:($,Z,X)=>_$.from($,Z,X)};lG.YAMLOMap=_$;lG.omap=pG});var A7=F((rG)=>{var O7=Z0();function T7({value:$,source:Z},X){if(Z&&($?D7:I7).test.test(Z))return Z;return $?X.options.trueStr:X.options.falseStr}var D7={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new O7.Scalar(!0),stringify:T7},I7={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new O7.Scalar(!1),stringify:T7};rG.falseTag=I7;rG.trueTag=D7});var R7=F((Zq)=>{var oG=Z0(),P8=n$(),tG={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:P8.stringifyNumber},eG={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():P8.stringifyNumber($)}},$q={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let Z=new oG.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:P8.stringifyNumber};Zq.float=$q;Zq.floatExp=eG;Zq.floatNaN=tG});var _7=F((Gq)=>{var F7=n$(),o1=($)=>typeof $==="bigint"||Number.isInteger($);function k2($,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 C8($,Z,X){let{value:z}=$;if(o1(z)){let J=z.toString(Z);return z<0?"-"+X+J.substr(1):X+J}return F7.stringifyNumber($)}var Qq={identify:o1,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,Z,X)=>k2($,2,2,X),stringify:($)=>C8($,2,"0b")},Yq={identify:o1,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,Z,X)=>k2($,1,8,X),stringify:($)=>C8($,8,"0")},Wq={identify:o1,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,Z,X)=>k2($,0,10,X),stringify:F7.stringifyNumber},Uq={identify:o1,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,Z,X)=>k2($,2,16,X),stringify:($)=>C8($,16,"0x")};Gq.int=Wq;Gq.intBin=Qq;Gq.intHex=Uq;Gq.intOct=Yq});var w8=F((Lq)=>{var g2=d(),y2=Q$(),f2=W$();class P$ extends f2.YAMLMap{constructor($){super($);this.tag=P$.tag}add($){let Z;if(g2.isPair($))Z=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)Z=new y2.Pair($.key,null);else Z=new y2.Pair($,null);if(!f2.findPair(this.items,Z.key))this.items.push(Z)}get($,Z){let X=f2.findPair(this.items,$);return!Z&&g2.isPair(X)?g2.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=f2.findPair(this.items,$);if(X&&!Z)this.items.splice(this.items.indexOf(X),1);else if(!X&&Z)this.items.push(new y2.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(y2.createPair(Q,null,X))}return J}}P$.tag="tag:yaml.org,2002:set";var Bq={collection:"map",identify:($)=>$ instanceof Set,nodeClass:P$,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,Z,X)=>P$.from($,Z,X),resolve($,Z){if(g2.isMap($))if($.hasAllNullValues(!0))return Object.assign(new P$,$);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return $}};Lq.YAMLSet=P$;Lq.set=Bq});var j8=F((Iq)=>{var Oq=n$();function E8($,Z){let X=$[0],z=X==="-"||X==="+"?$.substring(1):$,J=(Y)=>Z?BigInt(Y):Number(Y),Q=z.replace(/_/g,"").split(":").reduce((Y,W)=>Y*J(60)+J(W),J(0));return X==="-"?J(-1)*Q:Q}function P7($){let{value:Z}=$,X=(Y)=>Y;if(typeof Z==="bigint")X=(Y)=>BigInt(Y);else if(isNaN(Z)||!isFinite(Z))return Oq.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 Tq={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})=>E8($,X),stringify:P7},Dq={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:($)=>E8($,!1),stringify:P7},C7={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(C7.test);if(!Z)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,X,z,J,Q,Y,W]=Z.map(Number),U=Z[7]?Number((Z[7]+"00").substr(1,3)):0,G=Date.UTC(X,z-1,J,Q||0,Y||0,W||0,U),q=Z[8];if(q&&q!=="Z"){let V=E8(q,!1);if(Math.abs(V)<30)V*=60;G-=60000*V}return new Date(G)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Iq.floatTime=Dq;Iq.intTime=Tq;Iq.timestamp=C7});var E7=F((yq)=>{var _q=l$(),Pq=E2(),Cq=i$(),wq=r1(),Eq=A8(),w7=A7(),S8=R7(),v2=_7(),jq=I2(),Sq=_8(),xq=b2(),bq=w8(),x8=j8(),kq=[_q.map,Cq.seq,wq.string,Pq.nullTag,w7.trueTag,w7.falseTag,v2.intBin,v2.intOct,v2.int,v2.intHex,S8.floatNaN,S8.floatExp,S8.float,Eq.binary,jq.merge,Sq.omap,xq.pairs,bq.set,x8.intTime,x8.floatTime,x8.timestamp];yq.schema=kq});var h7=F((pq)=>{var b7=l$(),gq=E2(),k7=i$(),vq=r1(),hq=B8(),b8=M8(),k8=O8(),uq=V7(),mq=H7(),y7=A8(),t1=I2(),f7=_8(),g7=b2(),j7=E7(),v7=w8(),h2=j8(),S7=new Map([["core",uq.schema],["failsafe",[b7.map,k7.seq,vq.string]],["json",mq.schema],["yaml11",j7.schema],["yaml-1.1",j7.schema]]),x7={binary:y7.binary,bool:hq.boolTag,float:b8.float,floatExp:b8.floatExp,floatNaN:b8.floatNaN,floatTime:h2.floatTime,int:k8.int,intHex:k8.intHex,intOct:k8.intOct,intTime:h2.intTime,map:b7.map,merge:t1.merge,null:gq.nullTag,omap:f7.omap,pairs:g7.pairs,seq:k7.seq,set:v7.set,timestamp:h2.timestamp},cq={"tag:yaml.org,2002:binary":y7.binary,"tag:yaml.org,2002:merge":t1.merge,"tag:yaml.org,2002:omap":f7.omap,"tag:yaml.org,2002:pairs":g7.pairs,"tag:yaml.org,2002:set":v7.set,"tag:yaml.org,2002:timestamp":h2.timestamp};function dq($,Z,X){let z=S7.get(Z);if(z&&!$)return X&&!z.includes(t1.merge)?z.concat(t1.merge):z.slice();let J=z;if(!J)if(Array.isArray($))J=[];else{let Q=Array.from(S7.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(t1.merge);return J.reduce((Q,Y)=>{let W=typeof Y==="string"?x7[Y]:Y;if(!W){let U=JSON.stringify(Y),G=Object.keys(x7).map((q)=>JSON.stringify(q)).join(", ");throw Error(`Unknown custom tag ${U}; use one of ${G}`)}if(!Q.includes(W))Q.push(W);return Q},[])}pq.coreKnownTags=cq;pq.getTags=dq});var g8=F((oq)=>{var y8=d(),nq=l$(),rq=i$(),sq=r1(),u2=h7(),aq=($,Z)=>$.key<Z.key?-1:$.key>Z.key?1:0;class f8{constructor({compat:$,customTags:Z,merge:X,resolveKnownTags:z,schema:J,sortMapEntries:Q,toStringDefaults:Y}){this.compat=Array.isArray($)?u2.getTags($,"compat"):$?u2.getTags(null,$):null,this.name=typeof J==="string"&&J||"core",this.knownTags=z?u2.coreKnownTags:{},this.tags=u2.getTags(Z,this.name,X),this.toStringOptions=Y??null,Object.defineProperty(this,y8.MAP,{value:nq.map}),Object.defineProperty(this,y8.SCALAR,{value:sq.string}),Object.defineProperty(this,y8.SEQ,{value:rq.seq}),this.sortMapEntries=typeof Q==="function"?Q:Q===!0?aq:null}clone(){let $=Object.create(f8.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}oq.Schema=f8});var u7=F((ZV)=>{var eq=d(),v8=p1(),e1=m1();function $V($,Z){let X=[],z=Z.directives===!0;if(Z.directives!==!1&&$.directives){let U=$.directives.toString($);if(U)X.push(U),z=!0;else if($.directives.docStart)z=!0}if(z)X.push("---");let J=v8.createStringifyContext($,Z),{commentString:Q}=J.options;if($.commentBefore){if(X.length!==1)X.unshift("");let U=Q($.commentBefore);X.unshift(e1.indentComment(U,""))}let Y=!1,W=null;if($.contents){if(eq.isNode($.contents)){if($.contents.spaceBefore&&z)X.push("");if($.contents.commentBefore){let q=Q($.contents.commentBefore);X.push(e1.indentComment(q,""))}J.forceBlockIndent=!!$.comment,W=$.contents.comment}let U=W?void 0:()=>Y=!0,G=v8.stringify($.contents,J,()=>W=null,U);if(W)G+=e1.lineComment(G,"",Q(W));if((G[0]==="|"||G[0]===">")&&X[X.length-1]==="---")X[X.length-1]=`--- ${G}`;else X.push(G)}else X.push(v8.stringify($.contents,J));if($.directives?.docEnd)if($.comment){let U=Q($.comment);if(U.includes(`
81
+ `))X.push("..."),X.push(e1.indentComment(U,""));else X.push(`... ${U}`)}else X.push("...");else{let U=$.comment;if(U&&Y)U=U.replace(/^\n+/,"");if(U){if((!Y||W)&&X[X.length-1]!=="")X.push("");X.push(e1.indentComment(Q(U),""))}}return X.join(`
82
82
  `)+`
83
- `}dq.stringifyDocument=cq});var e1=F((tq)=>{var lq=v1(),r$=B2(),E0=d(),iq=Q$(),nq=X$(),rq=f8(),sq=f7(),v8=V2(),aq=z8(),oq=h1(),h8=X8();class u8{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 h8.Directives({version:Q});this.setSchema(Q,X),this.contents=$===void 0?null:this.createNode($,z,X)}clone(){let $=Object.create(u8.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(s$(this.contents))this.contents.add($)}addIn($,Z){if(s$(this.contents))this.contents.addIn($,Z)}createAlias($,Z){if(!$.anchor){let X=v8.anchorNames(this);$.anchor=!Z||X.has(Z)?v8.findNewAnchor(Z||"a",X):Z}return new lq.Alias($.anchor)}createNode($,Z,X){let z=void 0;if(typeof Z==="function")$=Z.call({"":$},"",$),z=Z;else if(Array.isArray(Z)){let L=(P)=>typeof P==="number"||P instanceof String||P instanceof Number,N=Z.filter(L).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}=v8.createNodeAnchors(this,Q||"a"),H={aliasDuplicateObjects:J??!0,keepUndefined:U??!1,onAnchor:q,onTagObj:W,replacer:z,schema:this.schema,sourceObjects:K},T=oq.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 iq.Pair(z,J)}delete($){return s$(this.contents)?this.contents.delete($):!1}deleteIn($){if(r$.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return s$(this.contents)?this.contents.deleteIn($):!1}get($,Z){return E0.isCollection(this.contents)?this.contents.get($,Z):void 0}getIn($,Z){if(r$.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(r$.isEmptyPath($))return this.contents!==void 0;return E0.isCollection(this.contents)?this.contents.hasIn($):!1}set($,Z){if(this.contents==null)this.contents=r$.collectionFromPath(this.schema,[$],Z);else if(s$(this.contents))this.contents.set($,Z)}setIn($,Z){if(r$.isEmptyPath($))this.contents=Z;else if(this.contents==null)this.contents=r$.collectionFromPath(this.schema,Array.from($),Z);else if(s$(this.contents))this.contents.setIn($,Z)}setSchema($,Z={}){if(typeof $==="number")$=String($);let X;switch($){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new h8.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 h8.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 rq.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=nq.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"?aq.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 sq.stringifyDocument(this,$)}}function s$($){if(E0.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}tq.Document=u8});var $4=F((ZV)=>{class u2 extends Error{constructor($,Z,X,z){super();this.name=$,this.code=X,this.message=z,this.pos=Z}}class g7 extends u2{constructor($,Z,X){super("YAMLParseError",$,Z,X)}}class v7 extends u2{constructor($,Z,X){super("YAMLWarning",$,Z,X)}}var $V=($,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
- `;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+=`:
83
+ `}ZV.stringifyDocument=$V});var $4=F((qV)=>{var zV=h1(),r$=L2(),E0=d(),JV=Q$(),QV=X$(),YV=g8(),WV=u7(),h8=K2(),UV=J8(),GV=u1(),u8=z8();class m8{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 u8.Directives({version:Q});this.setSchema(Q,X),this.contents=$===void 0?null:this.createNode($,z,X)}clone(){let $=Object.create(m8.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(s$(this.contents))this.contents.add($)}addIn($,Z){if(s$(this.contents))this.contents.addIn($,Z)}createAlias($,Z){if(!$.anchor){let X=h8.anchorNames(this);$.anchor=!Z||X.has(Z)?h8.findNewAnchor(Z||"a",X):Z}return new zV.Alias($.anchor)}createNode($,Z,X){let z=void 0;if(typeof Z==="function")$=Z.call({"":$},"",$),z=Z;else if(Array.isArray(Z)){let B=(P)=>typeof P==="number"||P instanceof String||P 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:W,onTagObj:U,tag:G}=X??{},{onAnchor:q,setAnchors:V,sourceObjects:K}=h8.createNodeAnchors(this,Q||"a"),H={aliasDuplicateObjects:J??!0,keepUndefined:W??!1,onAnchor:q,onTagObj:U,replacer:z,schema:this.schema,sourceObjects:K},T=GV.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 JV.Pair(z,J)}delete($){return s$(this.contents)?this.contents.delete($):!1}deleteIn($){if(r$.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return s$(this.contents)?this.contents.deleteIn($):!1}get($,Z){return E0.isCollection(this.contents)?this.contents.get($,Z):void 0}getIn($,Z){if(r$.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(r$.isEmptyPath($))return this.contents!==void 0;return E0.isCollection(this.contents)?this.contents.hasIn($):!1}set($,Z){if(this.contents==null)this.contents=r$.collectionFromPath(this.schema,[$],Z);else if(s$(this.contents))this.contents.set($,Z)}setIn($,Z){if(r$.isEmptyPath($))this.contents=Z;else if(this.contents==null)this.contents=r$.collectionFromPath(this.schema,Array.from($),Z);else if(s$(this.contents))this.contents.setIn($,Z)}setSchema($,Z={}){if(typeof $==="number")$=String($);let X;switch($){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new u8.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 u8.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 YV.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},W=QV.toJS(this.contents,Z??"",Y);if(typeof J==="function")for(let{count:U,res:G}of Y.anchors.values())J(G,U);return typeof Q==="function"?UV.applyReviver(Q,{"":W},"",W):W}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 WV.stringifyDocument(this,$)}}function s$($){if(E0.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}qV.Document=m8});var Z4=F((HV)=>{class m2 extends Error{constructor($,Z,X,z){super();this.name=$,this.code=X,this.message=z,this.pos=Z}}class m7 extends m2{constructor($,Z,X){super("YAMLParseError",$,Z,X)}}class c7 extends m2{constructor($,Z,X){super("YAMLWarning",$,Z,X)}}var KV=($,Z)=>(X)=>{if(X.pos[0]===-1)return;X.linePos=X.pos.map((W)=>Z.linePos(W));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 W=Math.min(Q-39,Y.length-79);Y="…"+Y.substring(W),Q-=W-1}if(Y.length>80)Y=Y.substring(0,79)+"…";if(z>1&&/^ *$/.test(Y.substring(0,Q))){let W=$.substring(Z.lineStarts[z-2],Z.lineStarts[z-1]);if(W.length>80)W=W.substring(0,79)+`…
84
+ `;Y=W+Y}if(/[^ ]/.test(Y)){let W=1,U=X.linePos[1];if(U?.line===z&&U.col>J)W=Math.max(1,Math.min(U.col-J,80-Q));let G=" ".repeat(Q)+"^".repeat(W);X.message+=`:
85
85
 
86
86
  ${Y}
87
87
  ${G}
88
- `}};ZV.YAMLError=u2;ZV.YAMLParseError=g7;ZV.YAMLWarning=v7;ZV.prettifyError=$V});var Z4=F((UV)=>{function YV($,{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,L=null,N=null,P=null,C=null,j=null,b=null,k=null;for(let R of $){if(T){if(R.type!=="space"&&R.type!=="newline"&&R.type!=="comma")Q(R.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");T=!1}if(L){if(G&&R.type!=="comment"&&R.type!=="newline")Q(L,"TAB_AS_INDENT","Tabs are not allowed as indentation");L=null}switch(R.type){case"space":if(!Z&&(X!=="doc-start"||z?.type!=="flow-collection")&&R.source.includes("\t"))L=R;q=!0;break;case"comment":{if(!q)Q(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=R.source.substring(1)||" ";if(!V)V=u;else V+=K+u;K="",G=!1;break}case"newline":if(G){if(V)V+=R.source;else if(!b||X!=="seq-item-ind")W=!0}else K+=R.source;if(G=!0,H=!0,N||P)C=R;q=!0;break;case"anchor":if(N)Q(R,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(R.source.endsWith(":"))Q(R.offset+R.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);N=R,k??(k=R.offset),G=!1,q=!1,T=!0;break;case"tag":{if(P)Q(R,"MULTIPLE_TAGS","A node can have at most one tag");P=R,k??(k=R.offset),G=!1,q=!1,T=!0;break}case X:if(N||P)Q(R,"BAD_PROP_ORDER",`Anchors and tags must be after the ${R.source} indicator`);if(b)Q(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${Z??"collection"}`);b=R,G=X==="seq-item-ind"||X==="explicit-key-ind",q=!1;break;case"comma":if(Z){if(j)Q(R,"UNEXPECTED_TOKEN",`Unexpected , in ${Z}`);j=R,G=!1,q=!1;break}default:Q(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),G=!1,q=!1}}let y=$[$.length-1],p=y?y.offset+y.source.length:J;if(T&&z&&z.type!=="space"&&z.type!=="newline"&&z.type!=="comma"&&(z.type!=="scalar"||z.source!==""))Q(z.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(L&&(G&&L.indent<=Y||z?.type==="block-map"||z?.type==="block-seq"))Q(L,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:j,found:b,spaceBefore:W,comment:V,hasNewline:H,anchor:N,tag:P,newlineAfterProp:C,end:p,start:k??p}}UV.resolveProps=YV});var m2=F((GV)=>{function m8($){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(m8(Z.key)||m8(Z.value))return!0}return!1;default:return!0}}GV.containsNewline=m8});var c8=F((HV)=>{var VV=m2();function KV($,Z,X){if(Z?.type==="flow-collection"){let z=Z.end[0];if(z.indent===$&&(z.source==="]"||z.source==="}")&&VV.containsNewline(Z))X(z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}HV.flowIndentCheck=KV});var d8=F((MV)=>{var h7=d();function LV($,Z,X){let{uniqueKeys:z}=$.options;if(z===!1)return!1;let J=typeof z==="function"?z:(Q,Y)=>Q===Y||h7.isScalar(Q)&&h7.isScalar(Y)&&Q.value===Y.value;return Z.some((Q)=>J(Q.key,X))}MV.mapIncludes=LV});var p7=F((AV)=>{var u7=Q$(),OV=U$(),m7=Z4(),TV=m2(),c7=c8(),DV=d8(),d7="All mapping items must start at the same column";function IV({composeNode:$,composeEmptyNode:Z},X,z,J,Q){let U=new(Q?.nodeClass??OV.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,L=m7.resolveProps(V,{indicator:"explicit-key-ind",next:K??H?.[0],offset:W,onError:J,parentIndent:z.indent,startOnNewline:!0}),N=!L.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",d7)}if(!L.anchor&&!L.tag&&!H){if(G=L.end,L.comment)if(U.comment)U.comment+=`
90
- `+L.comment;else U.comment=L.comment;continue}if(L.newlineAfterProp||TV.containsNewline(K))J(K??V[V.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(L.found?.indent!==z.indent)J(W,"BAD_INDENT",d7);X.atKey=!0;let P=L.end,C=K?$(X,K,L,J):Z(X,P,V,null,L,J);if(X.schema.compat)c7.flowIndentCheck(z.indent,K,J);if(X.atKey=!1,DV.mapIncludes(X,U.items,C))J(P,"DUPLICATE_KEY","Map keys must be unique");let j=m7.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=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&&L.start<j.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,j,J):Z(X,W,H,null,j,J);if(X.schema.compat)c7.flowIndentCheck(z.indent,T,J);W=b.range[2];let k=new u7.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(j.comment)if(C.comment)C.comment+=`
91
- `+j.comment;else C.comment=j.comment;let b=new u7.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}AV.resolveBlockMap=IV});var l7=F((wV)=>{var FV=W$(),_V=Z4(),PV=c8();function CV({composeNode:$,composeEmptyNode:Z},X,z,J,Q){let U=new(Q?.nodeClass??FV.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=_V.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)PV.flowIndentCheck(z.indent,V,J);W=H.range[2],U.items.push(H)}return U.range=[z.offset,W,G??W],U}wV.resolveBlockSeq=CV});var a$=F((SV)=>{function jV($,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}}SV.resolveEnd=jV});var r7=F((uV)=>{var bV=d(),kV=Q$(),i7=U$(),yV=W$(),fV=a$(),n7=Z4(),gV=m2(),vV=d8(),p8="Block collections are not allowed within flow collections",l8=($)=>$&&($.type==="block-map"||$.type==="block-seq");function hV({composeNode:$,composeEmptyNode:Z},X,z,J,Q){let Y=z.start.source==="{",U=Y?"flow map":"flow sequence",G=new(Q?.nodeClass??(Y?i7.YAMLMap:yV.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 P=z.items[N],{start:C,key:j,sep:b,value:k}=P,y=n7.resolveProps(C,{flow:U,indicator:"explicit-key-ind",next:j??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&&gV.containsNewline(j))J(j,"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 p="";$:for(let R of C)switch(R.type){case"comma":case"space":break;case"comment":p=R.source.substring(1);break $;default:break $}if(p){let R=G.items[G.items.length-1];if(bV.isPair(R))R=R.value??R.key;if(R.comment)R.comment+=`
93
- `+p;else R.comment=p;y.comment=y.comment.substring(p.length+1)}}}if(!Y&&!b&&!y.found){let p=k?$(X,k,y,J):Z(X,y.end,b,null,y,J);if(G.items.push(p),V=p.range[2],l8(k))J(p.range,"BLOCK_IN_FLOW",p8)}else{X.atKey=!0;let p=y.end,R=j?$(X,j,y,J):Z(X,p,C,null,y,J);if(l8(j))J(R.range,"BLOCK_IN_FLOW",p8);X.atKey=!1;let u=n7.resolveProps(b??[],{flow:U,indicator:"map-value-ind",next:k,offset:R.range[2],onError:J,parentIndent:z.indent,startOnNewline:!1});if(u.found){if(!Y&&!y.found&&X.options.strict){if(b)for(let $0 of b){if($0===u.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(y.start<u.found.offset-1024)J(u.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(k)if("source"in k&&k.source?.[0]===":")J(k,"MISSING_CHAR",`Missing space after : in ${U}`);else J(u.start,"MISSING_CHAR",`Missing , or : between ${U} items`);let g0=k?$(X,k,u,J):u.found?Z(X,u.end,b,null,u,J):null;if(g0){if(l8(k))J(g0.range,"BLOCK_IN_FLOW",p8)}else if(u.comment)if(R.comment)R.comment+=`
94
- `+u.comment;else R.comment=u.comment;let v0=new kV.Pair(R,g0);if(X.options.keepSourceTokens)v0.srcToken=P;if(Y){let $0=G;if(vV.mapIncludes(X,$0.items,R))J(p,"DUPLICATE_KEY","Map keys must be unique");$0.items.push(v0)}else{let $0=new i7.YAMLMap(X.schema);$0.flow=!0,$0.items.push(v0);let k1=(g0??R).range;$0.range=[R.range[0],k1[1],k1[2]],G.items.push($0)}V=g0?g0.range[2]:u.end}}let K=Y?"}":"]",[H,...T]=z.end,L=V;if(H?.source===K)L=H.offset+H.source.length;else{let N=U[0].toUpperCase()+U.substring(1),P=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",P),H&&H.source.length!==1)T.unshift(H)}if(T.length>0){let N=fV.resolveEnd(T,L,X.options.strict,J);if(N.comment)if(G.comment)G.comment+=`
95
- `+N.comment;else G.comment=N.comment;G.range=[z.offset,L,N.offset]}else G.range=[z.offset,L,L];return G}uV.resolveFlowCollection=hV});var s7=F((aV)=>{var cV=d(),dV=Z0(),pV=U$(),lV=W$(),iV=p7(),nV=l7(),rV=r7();function i8($,Z,X,z,J,Q){let Y=X.type==="block-map"?iV.resolveBlockMap($,Z,X,z,Q):X.type==="block-seq"?nV.resolveBlockSeq($,Z,X,z,Q):rV.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 sV($,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===pV.YAMLMap.tagName&&U==="map"||Y===lV.YAMLSeq.tagName&&U==="seq")return i8($,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 i8($,Z,X,J,Y)}}let G=i8($,Z,X,J,Y,W),q=W.resolve?.(G,(K)=>J(Q,"TAG_RESOLVE_FAILED",K),Z.options)??G,V=cV.isNode(q)?q:new dV.Scalar(q);if(V.range=G.range,V.tag=Y,W?.format)V.format=W.format;return V}aV.composeCollection=sV});var r8=F((ZK)=>{var n8=Z0();function tV($,Z,X){let z=Z.offset,J=eV(Z,$.options.strict,X);if(!J)return{value:"",type:null,comment:"",range:[z,z,z]};let Q=J.mode===">"?n8.Scalar.BLOCK_FOLDED:n8.Scalar.BLOCK_LITERAL,Y=Z.source?$K(Z.source):[],U=Y.length;for(let L=Y.length-1;L>=0;--L){let N=Y[L][1];if(N===""||N==="\r")U=L;else break}if(U===0){let L=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:L,type:Q,comment:J.comment,range:[z,N,N]}}let W=Z.indent+J.indent,G=Z.offset+J.length,q=0;for(let L=0;L<U;++L){let[N,P]=Y[L];if(P===""||P==="\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=L,W===0&&!$.atRoot)X(G,"BAD_INDENT","Block scalar values in collections must be indented");break}G+=N.length+P.length+1}for(let L=Y.length-1;L>=U;--L)if(Y[L][0].length>W)U=L+1;let V="",K="",H=!1;for(let L=0;L<q;++L)V+=Y[L][0].slice(W)+`
97
- `;for(let L=q;L<U;++L){let[N,P]=Y[L];G+=N.length+P.length+1;let C=P[P.length-1]==="\r";if(C)P=P.slice(0,-1);if(P&&N.length<W){let b=`Block scalar lines must not be less indented than their ${J.indent?"explicit indentation indicator":"first line"}`;X(G-P.length-(C?2:1),"BAD_INDENT",b),N=""}if(Q===n8.Scalar.BLOCK_LITERAL)V+=K+N.slice(W)+P,K=`
98
- `;else if(N.length>W||P[0]==="\t"){if(K===" ")K=`
88
+ `}};HV.YAMLError=m2;HV.YAMLParseError=m7;HV.YAMLWarning=c7;HV.prettifyError=KV});var X4=F((TV)=>{function OV($,{flow:Z,indicator:X,next:z,offset:J,onError:Q,parentIndent:Y,startOnNewline:W}){let U=!1,G=W,q=W,V="",K="",H=!1,T=!1,B=null,N=null,P=null,C=null,j=null,b=null,k=null;for(let R of $){if(T){if(R.type!=="space"&&R.type!=="newline"&&R.type!=="comma")Q(R.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");T=!1}if(B){if(G&&R.type!=="comment"&&R.type!=="newline")Q(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");B=null}switch(R.type){case"space":if(!Z&&(X!=="doc-start"||z?.type!=="flow-collection")&&R.source.includes("\t"))B=R;q=!0;break;case"comment":{if(!q)Q(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=R.source.substring(1)||" ";if(!V)V=u;else V+=K+u;K="",G=!1;break}case"newline":if(G){if(V)V+=R.source;else if(!b||X!=="seq-item-ind")U=!0}else K+=R.source;if(G=!0,H=!0,N||P)C=R;q=!0;break;case"anchor":if(N)Q(R,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(R.source.endsWith(":"))Q(R.offset+R.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);N=R,k??(k=R.offset),G=!1,q=!1,T=!0;break;case"tag":{if(P)Q(R,"MULTIPLE_TAGS","A node can have at most one tag");P=R,k??(k=R.offset),G=!1,q=!1,T=!0;break}case X:if(N||P)Q(R,"BAD_PROP_ORDER",`Anchors and tags must be after the ${R.source} indicator`);if(b)Q(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${Z??"collection"}`);b=R,G=X==="seq-item-ind"||X==="explicit-key-ind",q=!1;break;case"comma":if(Z){if(j)Q(R,"UNEXPECTED_TOKEN",`Unexpected , in ${Z}`);j=R,G=!1,q=!1;break}default:Q(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),G=!1,q=!1}}let y=$[$.length-1],p=y?y.offset+y.source.length:J;if(T&&z&&z.type!=="space"&&z.type!=="newline"&&z.type!=="comma"&&(z.type!=="scalar"||z.source!==""))Q(z.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(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:b,spaceBefore:U,comment:V,hasNewline:H,anchor:N,tag:P,newlineAfterProp:C,end:p,start:k??p}}TV.resolveProps=OV});var c2=F((IV)=>{function c8($){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(c8(Z.key)||c8(Z.value))return!0}return!1;default:return!0}}IV.containsNewline=c8});var d8=F((_V)=>{var RV=c2();function FV($,Z,X){if(Z?.type==="flow-collection"){let z=Z.end[0];if(z.indent===$&&(z.source==="]"||z.source==="}")&&RV.containsNewline(Z))X(z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}_V.flowIndentCheck=FV});var p8=F((wV)=>{var d7=d();function CV($,Z,X){let{uniqueKeys:z}=$.options;if(z===!1)return!1;let J=typeof z==="function"?z:(Q,Y)=>Q===Y||d7.isScalar(Q)&&d7.isScalar(Y)&&Q.value===Y.value;return Z.some((Q)=>J(Q.key,X))}wV.mapIncludes=CV});var r7=F((kV)=>{var p7=Q$(),jV=W$(),l7=X4(),SV=c2(),i7=d8(),xV=p8(),n7="All mapping items must start at the same column";function bV({composeNode:$,composeEmptyNode:Z},X,z,J,Q){let W=new(Q?.nodeClass??jV.YAMLMap)(X.schema);if(X.atRoot)X.atRoot=!1;let U=z.offset,G=null;for(let q of z.items){let{start:V,key:K,sep:H,value:T}=q,B=l7.resolveProps(V,{indicator:"explicit-key-ind",next:K??H?.[0],offset:U,onError:J,parentIndent:z.indent,startOnNewline:!0}),N=!B.found;if(N){if(K){if(K.type==="block-seq")J(U,"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(U,"BAD_INDENT",n7)}if(!B.anchor&&!B.tag&&!H){if(G=B.end,B.comment)if(W.comment)W.comment+=`
90
+ `+B.comment;else W.comment=B.comment;continue}if(B.newlineAfterProp||SV.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(U,"BAD_INDENT",n7);X.atKey=!0;let P=B.end,C=K?$(X,K,B,J):Z(X,P,V,null,B,J);if(X.schema.compat)i7.flowIndentCheck(z.indent,K,J);if(X.atKey=!1,xV.mapIncludes(X,W.items,C))J(P,"DUPLICATE_KEY","Map keys must be unique");let j=l7.resolveProps(H??[],{indicator:"map-value-ind",next:T,offset:C.range[2],onError:J,parentIndent:z.indent,startOnNewline:!K||K.type==="block-scalar"});if(U=j.end,j.found){if(N){if(T?.type==="block-map"&&!j.hasNewline)J(U,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(X.options.strict&&B.start<j.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,j,J):Z(X,U,H,null,j,J);if(X.schema.compat)i7.flowIndentCheck(z.indent,T,J);U=b.range[2];let k=new p7.Pair(C,b);if(X.options.keepSourceTokens)k.srcToken=q;W.items.push(k)}else{if(N)J(C.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(j.comment)if(C.comment)C.comment+=`
91
+ `+j.comment;else C.comment=j.comment;let b=new p7.Pair(C);if(X.options.keepSourceTokens)b.srcToken=q;W.items.push(b)}}if(G&&G<U)J(G,"IMPOSSIBLE","Map comment with trailing content");return W.range=[z.offset,U,G??U],W}kV.resolveBlockMap=bV});var s7=F((uV)=>{var fV=U$(),gV=X4(),vV=d8();function hV({composeNode:$,composeEmptyNode:Z},X,z,J,Q){let W=new(Q?.nodeClass??fV.YAMLSeq)(X.schema);if(X.atRoot)X.atRoot=!1;if(X.atKey)X.atKey=!1;let U=z.offset,G=null;for(let{start:q,value:V}of z.items){let K=gV.resolveProps(q,{indicator:"seq-item-ind",next:V,offset:U,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(U,"MISSING_CHAR","Sequence item without - indicator");else{if(G=K.end,K.comment)W.comment=K.comment;continue}let H=V?$(X,V,K,J):Z(X,K.end,q,null,K,J);if(X.schema.compat)vV.flowIndentCheck(z.indent,V,J);U=H.range[2],W.items.push(H)}return W.range=[z.offset,U,G??U],W}uV.resolveBlockSeq=hV});var a$=F((dV)=>{function cV($,Z,X,z){let J="";if($){let Q=!1,Y="";for(let W of $){let{source:U,type:G}=W;switch(G){case"space":Q=!0;break;case"comment":{if(X&&!Q)z(W,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let q=U.substring(1)||" ";if(!J)J=q;else J+=Y+q;Y="";break}case"newline":if(J)Y+=U;Q=!0;break;default:z(W,"UNEXPECTED_TOKEN",`Unexpected ${G} at node end`)}Z+=U.length}}return{comment:J,offset:Z}}dV.resolveEnd=cV});var t7=F((tV)=>{var lV=d(),iV=Q$(),a7=W$(),nV=U$(),rV=a$(),o7=X4(),sV=c2(),aV=p8(),l8="Block collections are not allowed within flow collections",i8=($)=>$&&($.type==="block-map"||$.type==="block-seq");function oV({composeNode:$,composeEmptyNode:Z},X,z,J,Q){let Y=z.start.source==="{",W=Y?"flow map":"flow sequence",G=new(Q?.nodeClass??(Y?a7.YAMLMap:nV.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 P=z.items[N],{start:C,key:j,sep:b,value:k}=P,y=o7.resolveProps(C,{flow:W,indicator:"explicit-key-ind",next:j??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 ${W}`);else if(N<z.items.length-1)J(y.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${W}`);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&&sV.containsNewline(j))J(j,"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 ${W}`)}else{if(!y.comma)J(y.start,"MISSING_CHAR",`Missing , between ${W} items`);if(y.comment){let p="";$:for(let R of C)switch(R.type){case"comma":case"space":break;case"comment":p=R.source.substring(1);break $;default:break $}if(p){let R=G.items[G.items.length-1];if(lV.isPair(R))R=R.value??R.key;if(R.comment)R.comment+=`
93
+ `+p;else R.comment=p;y.comment=y.comment.substring(p.length+1)}}}if(!Y&&!b&&!y.found){let p=k?$(X,k,y,J):Z(X,y.end,b,null,y,J);if(G.items.push(p),V=p.range[2],i8(k))J(p.range,"BLOCK_IN_FLOW",l8)}else{X.atKey=!0;let p=y.end,R=j?$(X,j,y,J):Z(X,p,C,null,y,J);if(i8(j))J(R.range,"BLOCK_IN_FLOW",l8);X.atKey=!1;let u=o7.resolveProps(b??[],{flow:W,indicator:"map-value-ind",next:k,offset:R.range[2],onError:J,parentIndent:z.indent,startOnNewline:!1});if(u.found){if(!Y&&!y.found&&X.options.strict){if(b)for(let $0 of b){if($0===u.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(y.start<u.found.offset-1024)J(u.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(k)if("source"in k&&k.source?.[0]===":")J(k,"MISSING_CHAR",`Missing space after : in ${W}`);else J(u.start,"MISSING_CHAR",`Missing , or : between ${W} items`);let g0=k?$(X,k,u,J):u.found?Z(X,u.end,b,null,u,J):null;if(g0){if(i8(k))J(g0.range,"BLOCK_IN_FLOW",l8)}else if(u.comment)if(R.comment)R.comment+=`
94
+ `+u.comment;else R.comment=u.comment;let v0=new iV.Pair(R,g0);if(X.options.keepSourceTokens)v0.srcToken=P;if(Y){let $0=G;if(aV.mapIncludes(X,$0.items,R))J(p,"DUPLICATE_KEY","Map keys must be unique");$0.items.push(v0)}else{let $0=new a7.YAMLMap(X.schema);$0.flow=!0,$0.items.push(v0);let y1=(g0??R).range;$0.range=[R.range[0],y1[1],y1[2]],G.items.push($0)}V=g0?g0.range[2]:u.end}}let K=Y?"}":"]",[H,...T]=z.end,B=V;if(H?.source===K)B=H.offset+H.source.length;else{let N=W[0].toUpperCase()+W.substring(1),P=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",P),H&&H.source.length!==1)T.unshift(H)}if(T.length>0){let N=rV.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}tV.resolveFlowCollection=oV});var e7=F((UK)=>{var $K=d(),ZK=Z0(),XK=W$(),zK=U$(),JK=r7(),QK=s7(),YK=t7();function n8($,Z,X,z,J,Q){let Y=X.type==="block-map"?JK.resolveBlockMap($,Z,X,z,Q):X.type==="block-seq"?QK.resolveBlockSeq($,Z,X,z,Q):YK.resolveFlowCollection($,Z,X,z,Q),W=Y.constructor;if(J==="!"||J===W.tagName)return Y.tag=W.tagName,Y;if(J)Y.tag=J;return Y}function WK($,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 W=X.type==="block-map"?"map":X.type==="block-seq"?"seq":X.start.source==="{"?"map":"seq";if(!Q||!Y||Y==="!"||Y===XK.YAMLMap.tagName&&W==="map"||Y===zK.YAMLSeq.tagName&&W==="seq")return n8($,Z,X,J,Y);let U=Z.schema.tags.find((K)=>K.tag===Y&&K.collection===W);if(!U){let K=Z.schema.knownTags[Y];if(K?.collection===W)Z.schema.tags.push(Object.assign({},K,{default:!1})),U=K;else{if(K)J(Q,"BAD_COLLECTION_TYPE",`${K.tag} used for ${W} collection, but expects ${K.collection??"scalar"}`,!0);else J(Q,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Y}`,!0);return n8($,Z,X,J,Y)}}let G=n8($,Z,X,J,Y,U),q=U.resolve?.(G,(K)=>J(Q,"TAG_RESOLVE_FAILED",K),Z.options)??G,V=$K.isNode(q)?q:new ZK.Scalar(q);if(V.range=G.range,V.tag=Y,U?.format)V.format=U.format;return V}UK.composeCollection=WK});var s8=F((HK)=>{var r8=Z0();function qK($,Z,X){let z=Z.offset,J=VK(Z,$.options.strict,X);if(!J)return{value:"",type:null,comment:"",range:[z,z,z]};let Q=J.mode===">"?r8.Scalar.BLOCK_FOLDED:r8.Scalar.BLOCK_LITERAL,Y=Z.source?KK(Z.source):[],W=Y.length;for(let B=Y.length-1;B>=0;--B){let N=Y[B][1];if(N===""||N==="\r")W=B;else break}if(W===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 U=Z.indent+J.indent,G=Z.offset+J.length,q=0;for(let B=0;B<W;++B){let[N,P]=Y[B];if(P===""||P==="\r"){if(J.indent===0&&N.length>U)U=N.length}else{if(N.length<U)X(G+N.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(J.indent===0)U=N.length;if(q=B,U===0&&!$.atRoot)X(G,"BAD_INDENT","Block scalar values in collections must be indented");break}G+=N.length+P.length+1}for(let B=Y.length-1;B>=W;--B)if(Y[B][0].length>U)W=B+1;let V="",K="",H=!1;for(let B=0;B<q;++B)V+=Y[B][0].slice(U)+`
97
+ `;for(let B=q;B<W;++B){let[N,P]=Y[B];G+=N.length+P.length+1;let C=P[P.length-1]==="\r";if(C)P=P.slice(0,-1);if(P&&N.length<U){let b=`Block scalar lines must not be less indented than their ${J.indent?"explicit indentation indicator":"first line"}`;X(G-P.length-(C?2:1),"BAD_INDENT",b),N=""}if(Q===r8.Scalar.BLOCK_LITERAL)V+=K+N.slice(U)+P,K=`
98
+ `;else if(N.length>U||P[0]==="\t"){if(K===" ")K=`
99
99
  `;else if(!H&&K===`
100
100
  `)K=`
101
101
 
102
- `;V+=K+N.slice(W)+P,K=`
102
+ `;V+=K+N.slice(U)+P,K=`
103
103
  `,H=!0}else if(P==="")if(K===`
104
104
  `)V+=`
105
105
  `;else K=`
106
- `;else V+=K+P,K=" ",H=!1}switch(J.chomp){case"-":break;case"+":for(let L=U;L<Y.length;++L)V+=`
107
- `+Y[L][0].slice(W);if(V[V.length-1]!==`
106
+ `;else V+=K+P,K=" ",H=!1}switch(J.chomp){case"-":break;case"+":for(let B=W;B<Y.length;++B)V+=`
107
+ `+Y[B][0].slice(U);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 eV({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 L=H.source;if(L&&typeof L==="string")V+=L.length}}}return{mode:Q,indent:Y,chomp:U,comment:q,length:V}}function $K($){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}ZK.resolveBlockScalar=tV});var a8=F((VK)=>{var s8=Z0(),zK=a$();function JK($,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=s8.Scalar.PLAIN,W=QK(Q,G);break;case"single-quoted-scalar":U=s8.Scalar.QUOTE_SINGLE,W=YK(Q,G);break;case"double-quoted-scalar":U=s8.Scalar.QUOTE_DOUBLE,W=UK(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=zK.resolveEnd(Y,q,Z,X);return{value:W,type:U,comment:V.comment,range:[z,q,V.offset]}}function QK($,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 a7($)}function YK($,Z){if($[$.length-1]!=="'"||$.length===1)Z($.length,"MISSING_CHAR","Missing closing 'quote");return a7($.slice(1,-1)).replace(/''/g,"'")}function a7($){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 VK({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,W="",U=-1;for(let K=1;K<J.length;++K){let H=J[K];if(!W&&(H==="-"||H==="+"))W=H;else{let T=Number(H);if(!Y&&T)Y=T;else if(U===-1)U=$+K}}if(U!==-1)z(U,"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:W,comment:q,length:V}}function KK($){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}HK.resolveBlockScalar=qK});var o8=F((RK)=>{var a8=Z0(),LK=a$();function MK($,Z,X){let{offset:z,type:J,source:Q,end:Y}=$,W,U,G=(K,H,T)=>X(z+K,H,T);switch(J){case"scalar":W=a8.Scalar.PLAIN,U=NK(Q,G);break;case"single-quoted-scalar":W=a8.Scalar.QUOTE_SINGLE,U=OK(Q,G);break;case"double-quoted-scalar":W=a8.Scalar.QUOTE_DOUBLE,U=TK(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=LK.resolveEnd(Y,q,Z,X);return{value:U,type:W,comment:V.comment,range:[z,q,V.offset]}}function NK($,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 $9($)}function OK($,Z){if($[$.length-1]!=="'"||$.length===1)Z($.length,"MISSING_CHAR","Missing closing 'quote");return $9($.slice(1,-1)).replace(/''/g,"'")}function $9($){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 UK($,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 W=/[ \t]*(.*)/sy;return W.lastIndex=Y,z=W.exec($),J+Q+(z?.[1]??"")}function TK($,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}=WK($,z);X+=Q,z=Y}else if(J==="\\"){let Q=$[++z],Y=GK[Q];if(Y)X+=Y;else if(Q===`
116
+ `){let{fold:Q,offset:Y}=DK($,z);X+=Q,z=Y}else if(J==="\\"){let Q=$[++z],Y=IK[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+=qK($,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 W={x:2,u:4,U:8}[Q];X+=AK($,z+1,W,Z),z+=W}else{let W=$.substr(z-1,2);Z(z-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${W}`),X+=W}}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 WK($,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 DK($,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 GK={"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 qK($,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)}VK.resolveFlowScalar=JK});var t7=F((OK)=>{var C$=d(),o7=Z0(),HK=r8(),BK=a8();function LK($,Z,X,z){let{value:J,type:Q,comment:Y,range:U}=Z.type==="block-scalar"?HK.resolveBlockScalar($,Z,z):BK.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[C$.SCALAR];else if(W)G=MK($.schema,J,W,X,z);else if(Z.type==="scalar")G=NK($,J,Z,z);else G=$.schema[C$.SCALAR];let q;try{let V=G.resolve(J,(K)=>z(X??Z,"TAG_RESOLVE_FAILED",K),$.options);q=C$.isScalar(V)?V:new o7.Scalar(V)}catch(V){let K=V instanceof Error?V.message:String(V);z(X??Z,"TAG_RESOLVE_FAILED",K),q=new o7.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 MK($,Z,X,z,J){if(X==="!")return $[C$.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"),$[C$.SCALAR]}function NK({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[C$.SCALAR];if(X.compat){let U=X.compat.find((W)=>W.default&&W.test?.test(z))??X[C$.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}OK.composeScalar=LK});var e7=F((IK)=>{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 $}IK.emptyScalarPosition=DK});var X9=F((jK)=>{var RK=v1(),FK=d(),_K=s7(),$9=t7(),PK=a$(),CK=e7(),wK={composeNode:Z9,composeEmptyNode:o8};function Z9($,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=$9.composeScalar($,Z,W,z),U)G.anchor=U.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(G=_K.composeCollection(wK,$,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=o8($,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&&(!FK.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 o8($,Z,X,z,{spaceBefore:J,comment:Q,anchor:Y,tag:U,end:W},G){let q={type:"scalar",offset:CK.emptyScalarPosition(Z,X,z),indent:-1,source:""},V=$9.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 RK.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=PK.resolveEnd(z,Y,$.strict,J);if(Q.range=[Z,Y,U.offset],U.comment)Q.comment=U.comment;return Q}jK.composeEmptyNode=o8;jK.composeNode=Z9});var J9=F((gK)=>{var bK=e1(),z9=X9(),kK=a$(),yK=Z4();function fK($,Z,{offset:X,start:z,value:J,end:Q},Y){let U=Object.assign({_directives:Z},$),W=new bK.Document(void 0,U),G={atKey:!1,atRoot:!0,directives:W.directives,options:W.options,schema:W.schema},q=yK.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?z9.composeNode(G,J,q,Y):z9.composeEmptyNode(G,q.end,z,null,q,Y);let V=W.contents.range[2],K=kK.resolveEnd(Q,V,!1,Y);if(K.comment)W.comment=K.comment;return W.range=[X,V,K.offset],W}gK.composeDoc=fK});var t8=F((pK)=>{var hK=D0("process"),uK=X8(),mK=e1(),X4=$4(),Q9=d(),cK=J9(),dK=a$();function z4($){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 Y9($){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 IK={"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 AK($,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 W=$.substr(Z-2,X+2);return z(Z-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${W}`),W}return String.fromCodePoint(Y)}RK.resolveFlowScalar=MK});var X9=F((jK)=>{var C$=d(),Z9=Z0(),_K=s8(),PK=o8();function CK($,Z,X,z){let{value:J,type:Q,comment:Y,range:W}=Z.type==="block-scalar"?_K.resolveBlockScalar($,Z,z):PK.resolveFlowScalar(Z,$.options.strict,z),U=X?$.directives.tagName(X.source,(V)=>z(X,"TAG_RESOLVE_FAILED",V)):null,G;if($.options.stringKeys&&$.atKey)G=$.schema[C$.SCALAR];else if(U)G=wK($.schema,J,U,X,z);else if(Z.type==="scalar")G=EK($,J,Z,z);else G=$.schema[C$.SCALAR];let q;try{let V=G.resolve(J,(K)=>z(X??Z,"TAG_RESOLVE_FAILED",K),$.options);q=C$.isScalar(V)?V:new Z9.Scalar(V)}catch(V){let K=V instanceof Error?V.message:String(V);z(X??Z,"TAG_RESOLVE_FAILED",K),q=new Z9.Scalar(J)}if(q.range=W,q.source=J,Q)q.type=Q;if(U)q.tag=U;if(G.format)q.format=G.format;if(Y)q.comment=Y;return q}function wK($,Z,X,z,J){if(X==="!")return $[C$.SCALAR];let Q=[];for(let W of $.tags)if(!W.collection&&W.tag===X)if(W.default&&W.test)Q.push(W);else return W;for(let W of Q)if(W.test?.test(Z))return W;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"),$[C$.SCALAR]}function EK({atKey:$,directives:Z,schema:X},z,J,Q){let Y=X.tags.find((W)=>(W.default===!0||$&&W.default==="key")&&W.test?.test(z))||X[C$.SCALAR];if(X.compat){let W=X.compat.find((U)=>U.default&&U.test?.test(z))??X[C$.SCALAR];if(Y.tag!==W.tag){let U=Z.tagString(Y.tag),G=Z.tagString(W.tag),q=`Value may be parsed as either ${U} or ${G}`;Q(J,"TAG_RESOLVE_FAILED",q,!0)}}return Y}jK.composeScalar=CK});var z9=F((bK)=>{function xK($,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 $}bK.emptyScalarPosition=xK});var Y9=F((cK)=>{var yK=h1(),fK=d(),gK=e7(),J9=X9(),vK=a$(),hK=z9(),uK={composeNode:Q9,composeEmptyNode:t8};function Q9($,Z,X,z){let J=$.atKey,{spaceBefore:Q,comment:Y,anchor:W,tag:U}=X,G,q=!0;switch(Z.type){case"alias":if(G=mK($,Z,z),W||U)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=J9.composeScalar($,Z,U,z),W)G.anchor=W.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(G=gK.composeCollection(uK,$,Z,X,z),W)G.anchor=W.source.substring(1);break;default:{let V=Z.type==="error"?Z.message:`Unsupported token (type: ${Z.type})`;z(Z,"UNEXPECTED_TOKEN",V),G=t8($,Z.offset,void 0,null,X,z),q=!1}}if(W&&G.anchor==="")z(W,"BAD_ALIAS","Anchor cannot be an empty string");if(J&&$.options.stringKeys&&(!fK.isScalar(G)||typeof G.value!=="string"||G.tag&&G.tag!=="tag:yaml.org,2002:str"))z(U??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 t8($,Z,X,z,{spaceBefore:J,comment:Q,anchor:Y,tag:W,end:U},G){let q={type:"scalar",offset:hK.emptyScalarPosition(Z,X,z),indent:-1,source:""},V=J9.composeScalar($,q,W,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]=U;return V}function mK({options:$},{offset:Z,source:X,end:z},J){let Q=new yK.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,W=vK.resolveEnd(z,Y,$.strict,J);if(Q.range=[Z,Y,W.offset],W.comment)Q.comment=W.comment;return Q}cK.composeEmptyNode=t8;cK.composeNode=Q9});var U9=F((sK)=>{var lK=$4(),W9=Y9(),iK=a$(),nK=X4();function rK($,Z,{offset:X,start:z,value:J,end:Q},Y){let W=Object.assign({_directives:Z},$),U=new lK.Document(void 0,W),G={atKey:!1,atRoot:!0,directives:U.directives,options:U.options,schema:U.schema},q=nK.resolveProps(z,{indicator:"doc-start",next:J??Q?.[0],offset:X,onError:Y,parentIndent:0,startOnNewline:!0});if(q.found){if(U.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")}U.contents=J?W9.composeNode(G,J,q,Y):W9.composeEmptyNode(G,q.end,z,null,q,Y);let V=U.contents.range[2],K=iK.resolveEnd(Q,V,!1,Y);if(K.comment)U.comment=K.comment;return U.range=[X,V,K.offset],U}sK.composeDoc=rK});var e8=F((XH)=>{var oK=D0("process"),tK=z8(),eK=$4(),z4=Z4(),G9=d(),$H=U9(),ZH=a$();function J4($){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 q9($){let Z="",X=!1,z=!1;for(let J=0;J<$.length;++J){let Q=$[J];switch(Q[0]){case"#":Z+=(Z===""?"":z?`
126
126
 
127
127
  `:`
128
- `)+(Q.substring(1)||" "),X=!0,z=!1;break;case"%":if($[J+1]?.[0]!=="#")J+=1;X=!1;break;default:if(!X)z=!0;X=!1}}return{comment:Z,afterEmptyLine:z}}class U9{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Z,X,z,J)=>{let Q=z4(Z);if(J)this.warnings.push(new X4.YAMLWarning(Q,X,z));else this.errors.push(new X4.YAMLParseError(Q,X,z))},this.directives=new uK.Directives({version:$.version||"1.2"}),this.options=$}decorate($,Z){let{comment:X,afterEmptyLine:z}=Y9(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(Q9.isCollection(J)&&!J.flow&&J.items.length>0){let Q=J.items[0];if(Q9.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 V9{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Z,X,z,J)=>{let Q=J4(Z);if(J)this.warnings.push(new z4.YAMLWarning(Q,X,z));else this.errors.push(new z4.YAMLParseError(Q,X,z))},this.directives=new tK.Directives({version:$.version||"1.2"}),this.options=$}decorate($,Z){let{comment:X,afterEmptyLine:z}=q9(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(G9.isCollection(J)&&!J.flow&&J.items.length>0){let Q=J.items[0];if(G9.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:Y9(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(hK.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(Z,X,z)=>{let J=z4($);J[0]+=Z,this.onError(J,"BAD_DIRECTIVE",X,z)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let Z=cK.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 X4.YAMLParseError(z4($),"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 X4.YAMLParseError(z4($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Z=dK.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 X4.YAMLParseError(z4($),"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 mK.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}}}pK.Composer=U9});var q9=F((eK)=>{var iK=r8(),nK=a8(),rK=$4(),W9=c1();function sK($,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 rK.YAMLParseError([U,U+1],Q,Y)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return nK.resolveFlowScalar($,Z,z);case"block-scalar":return iK.resolveBlockScalar({options:{strict:Z}},$,z)}}return null}function aK($,Z){let{implicitKey:X=!1,indent:z,inFlow:J=!1,offset:Q=-1,type:Y="PLAIN"}=Z,U=W9.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
- `}];switch(U[0]){case"|":case">":{let G=U.indexOf(`
134
- `),q=U.substring(0,G),V=U.substring(G+1)+`
135
- `,K=[{type:"block-scalar-header",offset:Q,indent:z,source:q}];if(!G9(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 oK($,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=W9.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">":tK($,W);break;case'"':e8($,W,"double-quoted-scalar");break;case"'":e8($,W,"single-quoted-scalar");break;default:e8($,W,"scalar")}}function tK($,Z){let X=Z.indexOf(`
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:q9(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(oK.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(Z,X,z)=>{let J=J4($);J[0]+=Z,this.onError(J,"BAD_DIRECTIVE",X,z)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let Z=$H.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 z4.YAMLParseError(J4($),"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 z4.YAMLParseError(J4($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Z=ZH.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 z4.YAMLParseError(J4($),"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 eK.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}}}XH.Composer=V9});var B9=F((VH)=>{var JH=s8(),QH=o8(),YH=Z4(),K9=d1();function WH($,Z=!0,X){if($){let z=(J,Q,Y)=>{let W=typeof J==="number"?J:Array.isArray(J)?J[0]:J.offset;if(X)X(W,Q,Y);else throw new YH.YAMLParseError([W,W+1],Q,Y)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return QH.resolveFlowScalar($,Z,z);case"block-scalar":return JH.resolveBlockScalar({options:{strict:Z}},$,z)}}return null}function UH($,Z){let{implicitKey:X=!1,indent:z,inFlow:J=!1,offset:Q=-1,type:Y="PLAIN"}=Z,W=K9.stringifyString({type:Y,value:$},{implicitKey:X,indent:z>0?" ".repeat(z):"",inFlow:J,options:{blockQuote:!0,lineWidth:-1}}),U=Z.end??[{type:"newline",offset:-1,indent:z,source:`
133
+ `}];switch(W[0]){case"|":case">":{let G=W.indexOf(`
134
+ `),q=W.substring(0,G),V=W.substring(G+1)+`
135
+ `,K=[{type:"block-scalar-header",offset:Q,indent:z,source:q}];if(!H9(K,U))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:W,end:U};case"'":return{type:"single-quoted-scalar",offset:Q,indent:z,source:W,end:U};default:return{type:"scalar",offset:Q,indent:z,source:W,end:U}}}function GH($,Z,X={}){let{afterKey:z=!1,implicitKey:J=!1,inFlow:Q=!1,type:Y}=X,W="indent"in $?$.indent:null;if(z&&typeof W==="number")W+=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 U=K9.stringifyString({type:Y,value:Z},{implicitKey:J||W===null,indent:W!==null&&W>0?" ".repeat(W):"",inFlow:Q,options:{blockQuote:!0,lineWidth:-1}});switch(U[0]){case"|":case">":qH($,U);break;case'"':$3($,U,"double-quoted-scalar");break;case"'":$3($,U,"single-quoted-scalar");break;default:$3($,U,"scalar")}}function qH($,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(!G9(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 G9($,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 e8($,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})}}}eK.createScalarToken=aK;eK.resolveAsScalar=sK;eK.setScalarValue=oK});var V9=F((JH)=>{var zH=($)=>("type"in $)?d2($):c2($);function d2($){switch($.type){case"block-scalar":{let Z="";for(let X of $.props)Z+=d2(X);return Z+$.source}case"block-map":case"block-seq":{let Z="";for(let X of $.items)Z+=c2(X);return Z}case"flow-collection":{let Z=$.start.source;for(let X of $.items)Z+=c2(X);for(let X of $.end)Z+=X.source;return Z}case"document":{let Z=c2($);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 c2({start:$,key:Z,sep:X,value:z}){let J="";for(let Q of $)J+=Q.source;if(Z)J+=d2(Z);if(X)for(let Q of X)J+=Q.source;if(z)J+=d2(z);return J}JH.stringify=zH});var B9=F((UH)=>{var $3=Symbol("break visit"),YH=Symbol("skip children"),K9=Symbol("remove item");function w$($,Z){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};H9(Object.freeze([]),$,Z)}w$.BREAK=$3;w$.SKIP=YH;w$.REMOVE=K9;w$.itemAtPath=($,Z)=>{let X=$;for(let[z,J]of Z){let Q=X?.[z];if(Q&&"items"in Q)X=Q.items[J];else return}return X};w$.parentCollection=($,Z)=>{let X=w$.itemAtPath($,Z.slice(0,-1)),z=Z[Z.length-1][0],J=X?.[z];if(J&&"items"in J)return J;throw Error("Parent collection not found")};function H9($,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=H9(Object.freeze($.concat([[J,Y]])),Q.items[Y],X);if(typeof U==="number")Y=U-1;else if(U===$3)return $3;else if(U===K9)Q.items.splice(Y,1),Y-=1}if(typeof z==="function"&&J==="key")z=z(Z,$)}}return typeof z==="function"?z(Z,$):z}UH.visit=w$});var p2=F((LH)=>{var Z3=q9(),GH=V9(),qH=B9(),X3="\uFEFF",z3="\x02",J3="\x18",Q3="\x1F",VH=($)=>!!$&&("items"in $),KH=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function HH($){switch($){case X3:return"<BOM>";case z3:return"<DOC>";case J3:return"<FLOW_END>";case Q3:return"<SCALAR>";default:return JSON.stringify($)}}function BH($){switch($){case X3:return"byte-order-mark";case z3:return"doc-mode";case J3:return"flow-error-end";case Q3: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,W=[{type:"block-scalar-header",offset:Q,indent:Y,source:z}];if(!H9(W,"end"in $?$.end:void 0))W.push({type:"newline",offset:-1,indent:Y,source:`
139
+ `});for(let U of Object.keys($))if(U!=="type"&&U!=="offset")delete $[U];Object.assign($,{type:"block-scalar",indent:Y,props:W,source:J})}}function H9($,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 $3($,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})}}}VH.createScalarToken=UH;VH.resolveAsScalar=WH;VH.setScalarValue=GH});var L9=F((MH)=>{var LH=($)=>("type"in $)?p2($):d2($);function p2($){switch($.type){case"block-scalar":{let Z="";for(let X of $.props)Z+=p2(X);return Z+$.source}case"block-map":case"block-seq":{let Z="";for(let X of $.items)Z+=d2(X);return Z}case"flow-collection":{let Z=$.start.source;for(let X of $.items)Z+=d2(X);for(let X of $.end)Z+=X.source;return Z}case"document":{let Z=d2($);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 d2({start:$,key:Z,sep:X,value:z}){let J="";for(let Q of $)J+=Q.source;if(Z)J+=p2(Z);if(X)for(let Q of X)J+=Q.source;if(z)J+=p2(z);return J}MH.stringify=LH});var O9=F((TH)=>{var Z3=Symbol("break visit"),OH=Symbol("skip children"),M9=Symbol("remove item");function w$($,Z){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};N9(Object.freeze([]),$,Z)}w$.BREAK=Z3;w$.SKIP=OH;w$.REMOVE=M9;w$.itemAtPath=($,Z)=>{let X=$;for(let[z,J]of Z){let Q=X?.[z];if(Q&&"items"in Q)X=Q.items[J];else return}return X};w$.parentCollection=($,Z)=>{let X=w$.itemAtPath($,Z.slice(0,-1)),z=Z[Z.length-1][0],J=X?.[z];if(J&&"items"in J)return J;throw Error("Parent collection not found")};function N9($,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 W=N9(Object.freeze($.concat([[J,Y]])),Q.items[Y],X);if(typeof W==="number")Y=W-1;else if(W===Z3)return Z3;else if(W===M9)Q.items.splice(Y,1),Y-=1}if(typeof z==="function"&&J==="key")z=z(Z,$)}}return typeof z==="function"?z(Z,$):z}TH.visit=w$});var l2=F((CH)=>{var X3=B9(),IH=L9(),AH=O9(),z3="\uFEFF",J3="\x02",Q3="\x18",Y3="\x1F",RH=($)=>!!$&&("items"in $),FH=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function _H($){switch($){case z3:return"<BOM>";case J3:return"<DOC>";case Q3:return"<FLOW_END>";case Y3:return"<SCALAR>";default:return JSON.stringify($)}}function PH($){switch($){case z3:return"byte-order-mark";case J3:return"doc-mode";case Q3:return"flow-error-end";case Y3: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}LH.createScalarToken=Z3.createScalarToken;LH.resolveAsScalar=Z3.resolveAsScalar;LH.setScalarValue=Z3.setScalarValue;LH.stringify=GH.stringify;LH.visit=qH.visit;LH.BOM=X3;LH.DOCUMENT=z3;LH.FLOW_END=J3;LH.SCALAR=Q3;LH.isCollection=VH;LH.isScalar=KH;LH.prettyToken=HH;LH.tokenType=BH});var U3=F((SH)=>{var J4=p2();function b0($){switch($){case void 0:case" ":case`
143
- `:case"\r":case"\t":return!0;default:return!1}}var L9=new Set("0123456789ABCDEFabcdef"),EH=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),l2=new Set(",[]{}"),jH=new Set(` ,[]{}
144
- \r `),Y3=($)=>!$||jH.has($);class M9{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}CH.createScalarToken=X3.createScalarToken;CH.resolveAsScalar=X3.resolveAsScalar;CH.setScalarValue=X3.setScalarValue;CH.stringify=IH.stringify;CH.visit=AH.visit;CH.BOM=z3;CH.DOCUMENT=J3;CH.FLOW_END=Q3;CH.SCALAR=Y3;CH.isCollection=RH;CH.isScalar=FH;CH.prettyToken=_H;CH.tokenType=PH});var U3=F((dH)=>{var Q4=l2();function b0($){switch($){case void 0:case" ":case`
143
+ `:case"\r":case"\t":return!0;default:return!1}}var T9=new Set("0123456789ABCDEFabcdef"),mH=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),i2=new Set(",[]{}"),cH=new Set(` ,[]{}
144
+ \r `),W3=($)=>!$||cH.has($);class D9{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
148
  `||X>=this.indentNext||!Z&&!this.atEnd?$+X:-1}if(Z==="-"||Z==="."){let X=this.buffer.substr($,3);if((X==="---"||X==="...")&&b0(this.buffer[$+3]))return-1}return $}getLine(){let $=this.lineEndPos;if(typeof $!=="number"||$!==-1&&$<this.pos)$=this.buffer.indexOf(`
149
- `,this.pos),this.lineEndPos=$;if($===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[$-1]==="\r")$-=1;return this.buffer.substring(this.pos,$)}hasChars($){return this.pos+$<=this.buffer.length}setNext($){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=$,null}peek($){return this.buffer.substr(this.pos,$)}*parseNext($){switch($){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let $=this.getLine();if($===null)return this.setNext("stream");if($[0]===J4.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 J4.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let $=this.charAt(0);if(!$&&!this.atEnd)return this.setNext("line-start");if($==="-"||$==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let Z=this.peek(3);if((Z==="---"||Z==="...")&&b0(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,Z==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!b0(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[$,Z]=this.peek(2);if(!Z&&!this.atEnd)return this.setNext("block-start");if(($==="-"||$==="?"||$===":")&&b0(Z)){let X=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=X,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let $=this.getLine();if($===null)return this.setNext("doc");let Z=yield*this.pushIndicators();switch($[Z]){case"#":yield*this.pushCount($.length-Z);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Y3),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return Z+=yield*this.parseBlockScalarHeader(),Z+=yield*this.pushSpaces(!0),yield*this.pushCount($.length-Z),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let $,Z,X=-1;do{if($=yield*this.pushNewline(),$>0)Z=yield*this.pushSpaces(!1),this.indentValue=X=Z;else Z=0;Z+=yield*this.pushSpaces(!0)}while($+Z>0);let z=this.getLine();if(z===null)return this.setNext("flow");if(X!==-1&&X<this.indentNext&&z[0]!=="#"||X===0&&(z.startsWith("---")||z.startsWith("..."))&&b0(z[3])){if(!(X===this.indentNext-1&&this.flowLevel===1&&(z[0]==="]"||z[0]==="}")))return this.flowLevel=0,yield J4.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(Y3),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let Q=this.charAt(1);if(this.flowKey||b0(Q)||Q===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let $=this.charAt(0),Z=this.buffer.indexOf($,this.pos+1);if($==="'")while(Z!==-1&&this.buffer[Z+1]==="'")Z=this.buffer.indexOf("'",Z+2);else while(Z!==-1){let J=0;while(this.buffer[Z-1-J]==="\\")J+=1;if(J%2===0)break;Z=this.buffer.indexOf('"',Z+1)}let X=this.buffer.substring(0,Z),z=X.indexOf(`
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]===Q4.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 Q4.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let $=this.charAt(0);if(!$&&!this.atEnd)return this.setNext("line-start");if($==="-"||$==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let Z=this.peek(3);if((Z==="---"||Z==="...")&&b0(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,Z==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!b0(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[$,Z]=this.peek(2);if(!Z&&!this.atEnd)return this.setNext("block-start");if(($==="-"||$==="?"||$===":")&&b0(Z)){let X=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=X,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let $=this.getLine();if($===null)return this.setNext("doc");let Z=yield*this.pushIndicators();switch($[Z]){case"#":yield*this.pushCount($.length-Z);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(W3),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return Z+=yield*this.parseBlockScalarHeader(),Z+=yield*this.pushSpaces(!0),yield*this.pushCount($.length-Z),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let $,Z,X=-1;do{if($=yield*this.pushNewline(),$>0)Z=yield*this.pushSpaces(!1),this.indentValue=X=Z;else Z=0;Z+=yield*this.pushSpaces(!0)}while($+Z>0);let z=this.getLine();if(z===null)return this.setNext("flow");if(X!==-1&&X<this.indentNext&&z[0]!=="#"||X===0&&(z.startsWith("---")||z.startsWith("..."))&&b0(z[3])){if(!(X===this.indentNext-1&&this.flowLevel===1&&(z[0]==="]"||z[0]==="}")))return this.flowLevel=0,yield Q4.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(W3),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let Q=this.charAt(1);if(this.flowKey||b0(Q)||Q===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let $=this.charAt(0),Z=this.buffer.indexOf($,this.pos+1);if($==="'")while(Z!==-1&&this.buffer[Z+1]==="'")Z=this.buffer.indexOf("'",Z+2);else while(Z!==-1){let J=0;while(this.buffer[Z-1-J]==="\\")J+=1;if(J%2===0)break;Z=this.buffer.indexOf('"',Z+1)}let X=this.buffer.substring(0,Z),z=X.indexOf(`
150
150
  `,this.pos);if(z!==-1){while(z!==-1){let J=this.continueScalar(z+1);if(J===-1)break;z=X.indexOf(`
151
151
  `,J)}if(z!==-1)Z=z-(X[z-1]==="\r"?2:1)}if(Z===-1){if(!this.atEnd)return this.setNext("quoted-scalar");Z=this.buffer.length}return yield*this.pushToIndex(Z+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let $=this.pos;while(!0){let Z=this.buffer[++$];if(Z==="+")this.blockScalarKeep=!0;else if(Z>"0"&&Z<="9")this.blockScalarIndent=Number(Z)-1;else if(Z!=="-")break}return yield*this.pushUntil((Z)=>b0(Z)||Z==="#")}*parseBlockScalar(){let $=this.pos-1,Z=0,X;$:for(let J=this.pos;X=this.buffer[J];++J)switch(X){case" ":Z+=1;break;case`
152
152
  `:$=J,Z=0;break;case"\r":{let Q=this.buffer[J+1];if(!Q&&!this.atEnd)return this.setNext("block-scalar");if(Q===`
153
153
  `)break}default:break $}if(!X&&!this.atEnd)return this.setNext("block-scalar");if(Z>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=Z;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let J=this.continueScalar($+1);if(J===-1)break;$=this.buffer.indexOf(`
154
154
  `,J)}while($!==-1);if($===-1){if(!this.atEnd)return this.setNext("block-scalar");$=this.buffer.length}}let z=$+1;X=this.buffer[z];while(X===" ")X=this.buffer[++z];if(X==="\t"){while(X==="\t"||X===" "||X==="\r"||X===`
155
155
  `)X=this.buffer[++z];$=z-1}else if(!this.blockScalarKeep)do{let J=$-1,Q=this.buffer[J];if(Q==="\r")Q=this.buffer[--J];let Y=J;while(Q===" ")Q=this.buffer[--J];if(Q===`
156
- `&&J>=this.pos&&J+1+Z>Y)$=J;else break}while(!0);return yield J4.SCALAR,yield*this.pushToIndex($+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let $=this.flowLevel>0,Z=this.pos-1,X=this.pos-1,z;while(z=this.buffer[++X])if(z===":"){let J=this.buffer[X+1];if(b0(J)||$&&l2.has(J))break;Z=X}else if(b0(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 Q4.SCALAR,yield*this.pushToIndex($+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let $=this.flowLevel>0,Z=this.pos-1,X=this.pos-1,z;while(z=this.buffer[++X])if(z===":"){let J=this.buffer[X+1];if(b0(J)||$&&i2.has(J))break;Z=X}else if(b0(z)){let J=this.buffer[X+1];if(z==="\r")if(J===`
157
157
  `)X+=1,z=`
158
- `,J=this.buffer[X+1];else Z=X;if(J==="#"||$&&l2.has(J))break;if(z===`
159
- `){let Q=this.continueScalar(X+1);if(Q===-1)break;X=Math.max(X,Q-2)}}else{if($&&l2.has(z))break;Z=X}if(!z&&!this.atEnd)return this.setNext("plain-scalar");return yield J4.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(Y3))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let $=this.flowLevel>0,Z=this.charAt(1);if(b0(Z)||$&&l2.has(Z)){if(!$)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let $=this.pos+2,Z=this.buffer[$];while(!b0(Z)&&Z!==">")Z=this.buffer[++$];return yield*this.pushToIndex(Z===">"?$+1:$,!1)}else{let $=this.pos+1,Z=this.buffer[$];while(Z)if(EH.has(Z))Z=this.buffer[++$];else if(Z==="%"&&L9.has(this.buffer[$+1])&&L9.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==="#"||$&&i2.has(J))break;if(z===`
159
+ `){let Q=this.continueScalar(X+1);if(Q===-1)break;X=Math.max(X,Q-2)}}else{if($&&i2.has(z))break;Z=X}if(!z&&!this.atEnd)return this.setNext("plain-scalar");return yield Q4.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(W3))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let $=this.flowLevel>0,Z=this.charAt(1);if(b0(Z)||$&&i2.has(Z)){if(!$)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let $=this.pos+2,Z=this.buffer[$];while(!b0(Z)&&Z!==">")Z=this.buffer[++$];return yield*this.pushToIndex(Z===">"?$+1:$,!1)}else{let $=this.pos+1,Z=this.buffer[$];while(Z)if(mH.has(Z))Z=this.buffer[++$];else if(Z==="%"&&T9.has(this.buffer[$+1])&&T9.has(this.buffer[$+2]))Z=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
160
160
  `)return yield*this.pushCount(1);else if($==="\r"&&this.charAt(1)===`
161
- `)return yield*this.pushCount(2);else return 0}*pushSpaces($){let Z=this.pos-1,X;do X=this.buffer[++Z];while(X===" "||$&&X==="\t");let z=Z-this.pos;if(z>0)yield this.buffer.substr(this.pos,z),this.pos=Z;return z}*pushUntil($){let Z=this.pos,X=this.buffer[Z];while(!$(X))X=this.buffer[++Z];return yield*this.pushToIndex(Z,!1)}}SH.Lexer=M9});var W3=F((bH)=>{class N9{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}}}}bH.LineCounter=N9});var G3=F((gH)=>{var yH=D0("process"),O9=p2(),fH=U3();function G$($,Z){for(let X=0;X<$.length;++X)if($[X].type===Z)return!0;return!1}function T9($){for(let Z=0;Z<$.length;++Z)switch($[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function I9($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function i2($){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 o$($){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 D9($){if($.start.type==="flow-seq-start"){for(let Z of $.items)if(Z.sep&&!Z.value&&!G$(Z.start,"explicit-key-ind")&&!G$(Z.sep,"map-value-ind")){if(Z.key)Z.value=Z.key;if(delete Z.key,I9(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 A9{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 fH.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=$,yH.env.LOG_TOKENS)console.log("|",O9.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let Z=O9.tokenType($);if(!Z){let X=`Not a YAML token: ${$}`;yield*this.pop({type:"error",offset:this.offset,message:X,source:$}),this.offset+=$.length}else if(Z==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=Z,yield*this.step(),Z){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+$.length);break;case"space":if(this.atNewLine&&$[0]===" ")this.indent+=$.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=$.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=$.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let $=this.peek(1);if(this.type==="doc-end"&&$?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!$)return yield*this.stream();switch($.type){case"document":return yield*this.document($);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar($);case"block-scalar":return yield*this.blockScalar($);case"block-map":return yield*this.blockMap($);case"block-seq":return yield*this.blockSequence($);case"flow-collection":return yield*this.flowCollection($);case"doc-end":return yield*this.documentEnd($)}yield*this.pop()}peek($){return this.stack[this.stack.length-$]}*pop($){let Z=$??this.stack.pop();if(!Z)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield Z;else{let X=this.peek(1);if(Z.type==="block-scalar")Z.indent="indent"in X?X.indent:0;else if(Z.type==="flow-collection"&&X.type==="document")Z.indent=0;if(Z.type==="flow-collection")D9(Z);switch(X.type){case"document":X.value=Z;break;case"block-scalar":X.props.push(Z);break;case"block-map":{let z=X.items[X.items.length-1];if(z.value){X.items.push({start:[],key:Z,sep:[]}),this.onKeyLine=!0;return}else if(z.sep)z.value=Z;else{Object.assign(z,{key:Z,sep:[]}),this.onKeyLine=!z.explicitKey;return}break}case"block-seq":{let z=X.items[X.items.length-1];if(z.value)X.items.push({start:[],value:Z});else z.value=Z;break}case"flow-collection":{let z=X.items[X.items.length-1];if(!z||z.value)X.items.push({start:[],key:Z,sep:[]});else if(z.sep)z.value=Z;else Object.assign(z,{key:Z,sep:[]});return}default:yield*this.pop(),yield*this.pop(Z)}if((X.type==="document"||X.type==="block-map"||X.type==="block-seq")&&(Z.type==="block-map"||Z.type==="block-seq")){let z=Z.items[Z.items.length-1];if(z&&!z.sep&&!z.value&&z.start.length>0&&T9(z.start)===-1&&(Z.indent===0||z.start.every((J)=>J.type!=="comment"||J.indent<Z.indent))){if(X.type==="document")X.end=z.start;else X.items.push({start:z.start});Z.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let $={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")$.start.push(this.sourceToken);this.stack.push($);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document($){if($.value)return yield*this.lineEnd($);switch(this.type){case"doc-start":{if(T9($.start)!==-1)yield*this.pop(),yield*this.step();else $.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":$.start.push(this.sourceToken);return}let Z=this.startBlockValue($);if(Z)this.stack.push(Z);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar($){if(this.type==="map-value-ind"){let Z=i2(this.peek(2)),X=o$(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)}}dH.Lexer=D9});var G3=F((lH)=>{class I9{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}}}}lH.LineCounter=I9});var q3=F((sH)=>{var nH=D0("process"),A9=l2(),rH=U3();function G$($,Z){for(let X=0;X<$.length;++X)if($[X].type===Z)return!0;return!1}function R9($){for(let Z=0;Z<$.length;++Z)switch($[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function _9($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function n2($){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 o$($){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 F9($){if($.start.type==="flow-seq-start"){for(let Z of $.items)if(Z.sep&&!Z.value&&!G$(Z.start,"explicit-key-ind")&&!G$(Z.sep,"map-value-ind")){if(Z.key)Z.value=Z.key;if(delete Z.key,_9(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 P9{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 rH.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=$,nH.env.LOG_TOKENS)console.log("|",A9.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let Z=A9.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")F9(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&&R9(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(R9($.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=n2(this.peek(2)),X=o$(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(G$(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let Q=o$(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(G$(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(I9(Z.key)&&!G$(Z.sep,"newline")){let Q=o$(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(G$(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&&!G$(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||G$(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=i2(X),J=o$(z);D9($);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 W=Z.sep[Y];switch(W.type){case"newline":Q.push(Y);break;case"space":break;case"comment":if(W.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(G$(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let Q=o$(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(G$(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(_9(Z.key)&&!G$(Z.sep,"newline")){let Q=o$(Z.start),Y=Z.key,W=Z.sep;W.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:W}]})}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(G$(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&&!G$(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||G$(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=n2(X),J=o$(z);F9($);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=i2($),X=o$(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=i2($),X=o$(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()}}}gH.Parser=A9});var C9=F((iH)=>{var R9=t8(),hH=e1(),Q4=$4(),uH=W8(),mH=d(),cH=W3(),F9=G3();function _9($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new cH.LineCounter||null,prettyErrors:Z}}function dH($,Z={}){let{lineCounter:X,prettyErrors:z}=_9(Z),J=new F9.Parser(X?.addNewLine),Q=new R9.Composer(Z),Y=Array.from(Q.compose(J.parse($)));if(z&&X)for(let U of Y)U.errors.forEach(Q4.prettifyError($,X)),U.warnings.forEach(Q4.prettifyError($,X));if(Y.length>0)return Y;return Object.assign([],{empty:!0},Q.streamInfo())}function P9($,Z={}){let{lineCounter:X,prettyErrors:z}=_9(Z),J=new F9.Parser(X?.addNewLine),Q=new R9.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 Q4.YAMLParseError(U.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&X)Y.errors.forEach(Q4.prettifyError($,X)),Y.warnings.forEach(Q4.prettifyError($,X));return Y}function pH($,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=P9($,X);if(!J)return null;if(J.warnings.forEach((Q)=>uH.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 lH($,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(mH.isDocument($)&&!z)return $.toString(X);return new hH.Document($,z,X).toString(X)}iH.parse=pH;iH.parseAllDocuments=dH;iH.parseDocument=P9;iH.stringify=lH});var b9={};X5(b9,{orange:()=>H0,italic:()=>fB,fafCyanDeep:()=>r2,fafCyan:()=>D,dim:()=>B,bold:()=>I,FAF_HEX:()=>Y4});var H3=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,I,B,fB,Y4,D=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,r2=($)=>`\x1B[38;2;14;140;140m${$}\x1B[0m`,H0=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var c=x(()=>{I=H3("1"),B=H3("2"),fB=H3("3"),Y4={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"}});var x3=F((zP,nN)=>{nN.exports={name:"faf-cli",version:"7.0.0",description:"Persistent AI Context Standard — project DNA for AI. IANA-registered. Anthropic-merged.",type:"module",icon:"https://faf.one/orange-smiley.svg",logo:"https://faf.one/orange-smiley.svg",main:"dist/index.js",types:"./dist/index.d.ts",bin:{faf:"dist/cli.js","faf-cli":"dist/cli.js"},exports:{".":{types:"./dist/index.d.ts",default:"./dist/index.js"}},files:["dist/**/*","README.md","LICENSE","project.faf"],scripts:{dev:"bun src/cli.ts",clean:"rm -rf dist",build:"bun run clean && bun build src/cli.ts --outdir dist --target=node --minify --sourcemap=linked --external faf-scoring-kernel --external open && bun build src/index.ts --outdir dist --target=node --minify --sourcemap=linked --external faf-scoring-kernel --external open && tsc -p tsconfig.build.json",compile:"bun build src/cli.ts --compile --bytecode --minify --outfile faf","compile:all":"bun build src/cli.ts --compile --bytecode --minify --target=bun-darwin-arm64 --outfile faf-darwin-arm64 && bun build src/cli.ts --compile --bytecode --minify --target=bun-darwin-x64 --outfile faf-darwin-x64 && bun build src/cli.ts --compile --bytecode --minify --target=bun-linux-x64 --outfile faf-linux-x64 && bun build src/cli.ts --compile --bytecode --minify --target=bun-windows-x64 --outfile faf-windows-x64.exe",test:"bun test --timeout=120000","test:watch":"bun test --watch --timeout=120000",lint:"eslint src/**/*.ts",format:"prettier --write 'src/**/*.ts'","check:no-hardcode":"! grep -rEln '/(Users|home/runner|private/var)/' dist/ || (echo '❌ Hardcoded build-machine path leaked into dist — see grep output above. Externalize the offending dep in the build script.'; exit 1)",prepublishOnly:"bun run build && bun run check:no-hardcode"},keywords:["faf","ai-context","project-dna","bi-sync","cli","claude","gemini","cursor","mcp","model-context-protocol","persistent-context","ai-readiness","foundational"],author:"wolfejam <wolfejam@faf.one>",license:"MIT",repository:{type:"git",url:"https://github.com/Wolfe-Jam/faf-cli.git"},homepage:"https://faf.one",bugs:{url:"https://github.com/Wolfe-Jam/faf-cli/issues"},dependencies:{commander:"^14.0.1","faf-scoring-kernel":"^2.0.3",open:"^11.0.0",yaml:"^2.4.1"},optionalDependencies:{"@anthropic-ai/sdk":"^0.91.1"},devDependencies:{"@faf/specification":"github:Wolfe-Jam/faf",ajv:"^8.17.1","@types/node":"^22.15.0","@typescript-eslint/eslint-plugin":"^8.41.0","@typescript-eslint/parser":"^8.41.0",eslint:"^9.39.2",prettier:"^3.2.5",typescript:"^5.3.3","typescript-eslint":"^8.59.1"},engines:{node:">=18.0.0"},publishConfig:{access:"public"}}});function _($,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 a0=()=>{};var y3=function(){let{crypto:$}=globalThis;if($?.randomUUID)return y3=$.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 o0($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var L4=($)=>{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,J0,K0,H$,V1,K1,H1,B1,L1,M1,N1,O1,T1;var O0=x(()=>{S=class S extends Error{};J0=class J0 extends S{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 H$({message:X,cause:L4(Z)});let J=Z,Q=J?.error?.type;if($===400)return new K1($,J,X,z,Q);if($===401)return new H1($,J,X,z,Q);if($===403)return new B1($,J,X,z,Q);if($===404)return new L1($,J,X,z,Q);if($===409)return new M1($,J,X,z,Q);if($===422)return new N1($,J,X,z,Q);if($===429)return new O1($,J,X,z,Q);if($>=500)return new T1($,J,X,z,Q);return new J0($,J,X,z,Q)}};K0=class K0 extends J0{constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}};H$=class H$ extends J0{constructor({message:$,cause:Z}){super(void 0,void 0,$||"Connection error.",void 0);if(Z)this.cause=Z}};V1=class V1 extends H${constructor({message:$}={}){super({message:$??"Request timed out."})}};K1=class K1 extends J0{};H1=class H1 extends J0{};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{}});function M6($){if(typeof $!=="object")return{};return $??{}}function v3($){if(!$)return!0;for(let Z in $)return!1;return!0}function _z($,Z){return Object.prototype.hasOwnProperty.call($,Z)}var PO,Fz=($)=>{return PO.test($)},f3=($)=>(f3=Array.isArray,f3($)),g3,Pz=($,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},N6=($)=>{try{return JSON.parse($)}catch(Z){return}};var b$=x(()=>{O0();PO=/^[a-z][a-z0-9+.-]*:/i,g3=f3});var Cz=($)=>new Promise((Z)=>setTimeout(Z,$));var B$="0.91.1";function CO(){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 EO(){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 Sz=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"},wO=()=>{let $=CO();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B$,"X-Stainless-OS":Ez(Deno.build.os),"X-Stainless-Arch":wz(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":B$,"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":B$,"X-Stainless-OS":Ez(globalThis.process.platform??"unknown"),"X-Stainless-Arch":wz(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let Z=EO();if(Z)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B$,"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":B$,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},wz=($)=>{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"},jz,xz=()=>{return jz??(jz=wO())};var h3=()=>{};function bz(){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 u3(...$){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 O6($){let Z=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return u3({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 M4($){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 kz($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let Z=$.getReader(),X=Z.cancel();Z.releaseLock(),await X}var yz=({headers:$,body:Z})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(Z)}};function fz($){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 gz=x(()=>{O0()});function uz($){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 N4($){let Z;return(vz??(Z=new globalThis.TextEncoder,vz=Z.encode.bind(Z)))($)}function m3($){let Z;return(hz??(Z=new globalThis.TextDecoder,hz=Z.decode.bind(Z)))($)}var vz,hz;class L${constructor(){F0.set(this,void 0),_0.set(this,void 0),_(this,F0,new Uint8Array,"f"),_(this,_0,null,"f")}decode($){if($==null)return[];let Z=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?N4($):$;_(this,F0,uz([M(this,F0,"f"),Z]),"f");let X=[],z;while((z=xO(M(this,F0,"f"),M(this,_0,"f")))!=null){if(z.carriage&&M(this,_0,"f")==null){_(this,_0,z.index,"f");continue}if(M(this,_0,"f")!=null&&(z.index!==M(this,_0,"f")+1||z.carriage)){X.push(m3(M(this,F0,"f").subarray(0,M(this,_0,"f")-1))),_(this,F0,M(this,F0,"f").subarray(M(this,_0,"f")),"f"),_(this,_0,null,"f");continue}let J=M(this,_0,"f")!==null?z.preceding-1:z.preceding,Q=m3(M(this,F0,"f").subarray(0,J));X.push(Q),_(this,F0,M(this,F0,"f").subarray(z.index),"f"),_(this,_0,null,"f")}return X}flush(){if(!M(this,F0,"f").length)return[];return this.decode(`
166
- `)}}function xO($,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 mz($){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 c3=x(()=>{a0();F0=new WeakMap,_0=new WeakMap;L$.NEWLINE_CHARS=new Set([`
167
- `,"\r"]);L$.NEWLINE_REGEXP=/\r\n|[\n\r]/g});function O4(){}function T6($,Z,X){if(!Z||D6[$]>D6[X])return O4;else return Z[$].bind(Z)}function V0($){let Z=$.logger,X=$.logLevel??"off";if(!Z)return bO;let z=cz.get(Z);if(z&&z[0]===X)return z[1];let J={error:T6("error",Z,X),warn:T6("warn",Z,X),info:T6("info",Z,X),debug:T6("debug",Z,X)};return cz.set(Z,[X,J]),J}var D6,d3=($,Z,X)=>{if(!$)return;if(_z(D6,$))return $;V0(X).warn(`${Z} was set to ${JSON.stringify($)}, expected one of ${JSON.stringify(Object.keys(D6))}`);return},bO,cz,t0=($)=>{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 I6=x(()=>{b$();D6={off:0,error:200,warn:300,info:400,debug:500};bO={error:O4,warn:O4,info:O4,debug:O4},cz=new WeakMap});async function*kO($,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 dz,z=new L$,J=M4($.body);for await(let Q of yO(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*yO($){let Z=new Uint8Array;for await(let X of $){if(X==null)continue;let z=X instanceof ArrayBuffer?new Uint8Array(X):typeof X==="string"?N4(X):X,J=new Uint8Array(Z.length+z.length);J.set(Z),J.set(z,Z.length),Z=J;let Q;while((Q=mz(Z))!==-1)yield Z.slice(0,Q),Z=Z.slice(Q)}if(Z.length>0)yield Z}class dz{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]=fO($,":");if(z.startsWith(" "))z=z.substring(1);if(Z==="event")this.event=z;else if(Z==="data")this.data.push(z);return null}}function fO($,Z){let X=$.indexOf(Z);if(X!==-1)return[$.substring(0,X),Z,$.substring(X+Z.length)];return[$,"",""]}var T4,P0;var p3=x(()=>{a0();O0();c3();b$();I6();O0();P0=class P0{constructor($,Z,X){this.iterator=$,T4.set(this,void 0),this.controller=Z,_(this,T4,X,"f")}static fromSSEResponse($,Z,X){let z=!1,J=X?V0(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 kO($,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=N6(U.data)??U.data,G=W?.error?.type;throw new J0(void 0,W,void 0,$.headers,G)}}Y=!0}catch(U){if(o0(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 L$,U=M4($);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(o0(U))return;throw U}finally{if(!Y)Z.abort()}}return new P0(Q,Z,X)}[(T4=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,T4,"f")),new P0(()=>z(Z),this.controller,M(this,T4,"f"))]}toReadableStream(){let $=this,Z;return u3({async start(){Z=$[Symbol.asyncIterator]()},async pull(X){try{let{value:z,done:J}=await Z.next();if(J)return X.close();let Q=N4(JSON.stringify(z)+`
169
- `);X.enqueue(Q)}catch(z){X.error(z)}},async cancel(){await Z.return?.()}})}}});async function A6($,Z){let{response:X,requestLogID:z,retryOfRequestLogID:J,startTime:Q}=Z,Y=await(async()=>{if(Z.options.stream){if(V0($).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 l3(K,X)}return await X.text()})();return V0($).debug(`[${z}] response parsed`,t0({retryOfRequestLogID:J,url:X.url,status:X.status,body:Y,durationMs:Date.now()-Q})),Y}function l3($,Z){if(!$||typeof $!=="object"||Array.isArray($))return $;return Object.defineProperty($,"_request_id",{value:Z.headers.get("request-id"),enumerable:!1})}var i3=x(()=>{p3();I6()});var D4,M$;var R6=x(()=>{a0();i3();M$=class M$ extends Promise{constructor($,Z,X=A6){super((z)=>{z(null)});this.responsePromise=Z,this.parseResponse=X,D4.set(this,void 0),_(this,D4,$,"f")}_thenUnwrap($){return new M$(M(this,D4,"f"),this.responsePromise,async(Z,X)=>l3($(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,D4,"f"),$));return this.parsedPromise}then($,Z){return this.parse().then($,Z)}catch($){return this.parse().catch($)}finally($){return this.parse().finally($)}};D4=new WeakMap});var F6,n3,I4,f0,i;var e=x(()=>{a0();O0();i3();R6();b$();n3=class n3{constructor($,Z,X,z){F6.set(this,void 0),_(this,F6,$,"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,F6,"f").requestAPIList(this.constructor,$)}async*iterPages(){let $=this;yield $;while($.hasNextPage())$=await $.getNextPage(),yield $}async*[(F6=new WeakMap,Symbol.asyncIterator)](){for await(let $ of this.iterPages())for(let Z of $.getPaginatedItems())yield Z}};I4=class I4 extends M${constructor($,Z,X){super($,Z,async(z,J)=>new X(z,J.response,await A6(z,J),J.options))}async*[Symbol.asyncIterator](){let $=await this;for await(let Z of $)yield Z}};f0=class f0 extends n3{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:{...M6(this.options.query),before_id:Z}}}let $=this.last_id;if(!$)return null;return{...this.options,query:{...M6(this.options.query),after_id:$}}}};i=class i extends n3{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:{...M6(this.options.query),page:$}}}}});function k$($,Z,X){return s3(),new File($,Z??"unknown_file",X)}function A4($,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 vO($){let Z=typeof $==="function"?$:$.fetch,X=pz.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 pz.set(Z,z),z}var s3=()=>{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`.":""))}},a3=($)=>$!=null&&typeof $==="object"&&typeof $[Symbol.asyncIterator]==="function",D1=async($,Z,X=!0)=>{return{...$,body:await hO($.body,Z,X)}},pz,hO=async($,Z,X=!0)=>{if(!await vO(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])=>r3(z,J,Q,X))),z},uO=($)=>$ instanceof Blob&&("name"in $),r3=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,k$([await X.blob()],A4(X,z),J))}else if(a3(X))$.append(Z,k$([await new Response(O6(X)).blob()],A4(X,z)));else if(uO(X))$.append(Z,k$([X],A4(X,z),{type:X.type}));else if(Array.isArray(X))await Promise.all(X.map((J)=>r3($,Z+"[]",J,z)));else if(typeof X==="object")await Promise.all(Object.entries(X).map(([J,Q])=>r3($,`${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 I1=x(()=>{pz=new WeakMap});async function R4($,Z,X){if(s3(),$=await $,Z||(Z=A4($,!0)),mO($)){if($ instanceof File&&Z==null&&X==null)return $;return k$([await $.arrayBuffer()],Z??$.name,{type:$.type,lastModified:$.lastModified,...X})}if(cO($)){let J=await $.blob();return Z||(Z=new URL($.url).pathname.split(/[\\/]/).pop()),k$(await o3(J),Z,X)}let z=await o3($);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 k$(z,Z,X)}async function o3($){let Z=[];if(typeof $==="string"||ArrayBuffer.isView($)||$ instanceof ArrayBuffer)Z.push($);else if(lz($))Z.push($ instanceof Blob?$:await $.arrayBuffer());else if(a3($))for await(let X of $)Z.push(...await o3(X));else{let X=$?.constructor?.name;throw Error(`Unexpected data type: ${typeof $}${X?`; constructor: ${X}`:""}${dO($)}`)}return Z}function dO($){if(typeof $!=="object"||$===null)return"";return`; props: [${Object.getOwnPropertyNames($).map((X)=>`"${X}"`).join(", ")}]`}var lz=($)=>$!=null&&typeof $==="object"&&typeof $.size==="number"&&typeof $.type==="string"&&typeof $.text==="function"&&typeof $.slice==="function"&&typeof $.arrayBuffer==="function",mO=($)=>$!=null&&typeof $==="object"&&typeof $.name==="string"&&typeof $.lastModified==="number"&&lz($),cO=($)=>$!=null&&typeof $==="object"&&typeof $.url==="string"&&typeof $.blob==="function";var iz=x(()=>{I1();I1()});var t3=x(()=>{iz()});var nz=()=>{};class g{constructor($){this._client=$}}function*lO($){if(!$)return;if(rz 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(g3($))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=g3(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 rz,O=($)=>{let Z=new Headers,X=new Set;for(let z of $){let J=new Set;for(let[Q,Y]of lO(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{[rz]:!0,values:Z,nulls:X}};var r=x(()=>{b$();rz=Symbol.for("brand.privateNullableHeaders")});function az($){return $.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var sz,iO=($=az)=>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??sz)??sz)?.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),L="^".repeat(H.length);return q=H.start+H.length,K+T+L},"");throw new S(`Path parameters result in path with invalid segments:
165
+ `,Z)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let Z=n2($),X=o$(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=n2($),X=o$(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()}}}sH.Parser=P9});var S9=F((JB)=>{var C9=e8(),oH=$4(),Y4=Z4(),tH=G8(),eH=d(),$B=G3(),w9=q3();function E9($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new $B.LineCounter||null,prettyErrors:Z}}function ZB($,Z={}){let{lineCounter:X,prettyErrors:z}=E9(Z),J=new w9.Parser(X?.addNewLine),Q=new C9.Composer(Z),Y=Array.from(Q.compose(J.parse($)));if(z&&X)for(let W of Y)W.errors.forEach(Y4.prettifyError($,X)),W.warnings.forEach(Y4.prettifyError($,X));if(Y.length>0)return Y;return Object.assign([],{empty:!0},Q.streamInfo())}function j9($,Z={}){let{lineCounter:X,prettyErrors:z}=E9(Z),J=new w9.Parser(X?.addNewLine),Q=new C9.Composer(Z),Y=null;for(let W of Q.compose(J.parse($),!0,$.length))if(!Y)Y=W;else if(Y.options.logLevel!=="silent"){Y.errors.push(new Y4.YAMLParseError(W.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&X)Y.errors.forEach(Y4.prettifyError($,X)),Y.warnings.forEach(Y4.prettifyError($,X));return Y}function XB($,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=j9($,X);if(!J)return null;if(J.warnings.forEach((Q)=>tH.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 zB($,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(eH.isDocument($)&&!z)return $.toString(X);return new oH.Document($,z,X).toString(X)}JB.parse=XB;JB.parseAllDocuments=ZB;JB.parseDocument=j9;JB.stringify=zB});var v9={};Y5(v9,{orange:()=>H0,italic:()=>sB,fafCyanDeep:()=>s2,fafCyan:()=>D,dim:()=>L,bold:()=>I,FAF_HEX:()=>W4});var B3=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,I,L,sB,W4,D=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,s2=($)=>`\x1B[38;2;14;140;140m${$}\x1B[0m`,H0=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var c=x(()=>{I=B3("1"),L=B3("2"),sB=B3("3"),W4={cyan:"#00D4D4",cyanDeep:"#0E8C8C",orange:"#FF6B35"}});var f3=F((DP,JO)=>{JO.exports={name:"faf-cli",version:"7.0.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"],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 _($,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 a0=()=>{};var h3=function(){let{crypto:$}=globalThis;if($?.randomUUID)return h3=$.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 o0($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var M4=($)=>{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,J0,K0,H$,K1,H1,B1,L1,M1,N1,O1,T1,D1;var O0=x(()=>{S=class S extends Error{};J0=class J0 extends S{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 H$({message:X,cause:M4(Z)});let J=Z,Q=J?.error?.type;if($===400)return new H1($,J,X,z,Q);if($===401)return new B1($,J,X,z,Q);if($===403)return new L1($,J,X,z,Q);if($===404)return new M1($,J,X,z,Q);if($===409)return new N1($,J,X,z,Q);if($===422)return new O1($,J,X,z,Q);if($===429)return new T1($,J,X,z,Q);if($>=500)return new D1($,J,X,z,Q);return new J0($,J,X,z,Q)}};K0=class K0 extends J0{constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}};H$=class H$ extends J0{constructor({message:$,cause:Z}){super(void 0,void 0,$||"Connection error.",void 0);if(Z)this.cause=Z}};K1=class K1 extends H${constructor({message:$}={}){super({message:$??"Request timed out."})}};H1=class H1 extends J0{};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{}});function N6($){if(typeof $!=="object")return{};return $??{}}function c3($){if(!$)return!0;for(let Z in $)return!1;return!0}function gz($,Z){return Object.prototype.hasOwnProperty.call($,Z)}var gO,fz=($)=>{return gO.test($)},u3=($)=>(u3=Array.isArray,u3($)),m3,vz=($,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},O6=($)=>{try{return JSON.parse($)}catch(Z){return}};var b$=x(()=>{O0();gO=/^[a-z][a-z0-9+.-]*:/i,m3=u3});var hz=($)=>new Promise((Z)=>setTimeout(Z,$));var B$="0.91.1";function vO(){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 uO(){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 dz=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"},hO=()=>{let $=vO();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B$,"X-Stainless-OS":mz(Deno.build.os),"X-Stainless-Arch":uz(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":B$,"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":B$,"X-Stainless-OS":mz(globalThis.process.platform??"unknown"),"X-Stainless-Arch":uz(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let Z=uO();if(Z)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B$,"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":B$,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},uz=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},mz=($)=>{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"},cz,pz=()=>{return cz??(cz=hO())};var d3=()=>{};function lz(){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 p3(...$){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 T6($){let Z=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return p3({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 N4($){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 iz($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let Z=$.getReader(),X=Z.cancel();Z.releaseLock(),await X}var nz=({headers:$,body:Z})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(Z)}};function rz($){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 sz=x(()=>{O0()});function tz($){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 O4($){let Z;return(az??(Z=new globalThis.TextEncoder,az=Z.encode.bind(Z)))($)}function l3($){let Z;return(oz??(Z=new globalThis.TextDecoder,oz=Z.decode.bind(Z)))($)}var az,oz;class L${constructor(){F0.set(this,void 0),_0.set(this,void 0),_(this,F0,new Uint8Array,"f"),_(this,_0,null,"f")}decode($){if($==null)return[];let Z=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?O4($):$;_(this,F0,tz([M(this,F0,"f"),Z]),"f");let X=[],z;while((z=dO(M(this,F0,"f"),M(this,_0,"f")))!=null){if(z.carriage&&M(this,_0,"f")==null){_(this,_0,z.index,"f");continue}if(M(this,_0,"f")!=null&&(z.index!==M(this,_0,"f")+1||z.carriage)){X.push(l3(M(this,F0,"f").subarray(0,M(this,_0,"f")-1))),_(this,F0,M(this,F0,"f").subarray(M(this,_0,"f")),"f"),_(this,_0,null,"f");continue}let J=M(this,_0,"f")!==null?z.preceding-1:z.preceding,Q=l3(M(this,F0,"f").subarray(0,J));X.push(Q),_(this,F0,M(this,F0,"f").subarray(z.index),"f"),_(this,_0,null,"f")}return X}flush(){if(!M(this,F0,"f").length)return[];return this.decode(`
166
+ `)}}function dO($,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 ez($){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 i3=x(()=>{a0();F0=new WeakMap,_0=new WeakMap;L$.NEWLINE_CHARS=new Set([`
167
+ `,"\r"]);L$.NEWLINE_REGEXP=/\r\n|[\n\r]/g});function T4(){}function D6($,Z,X){if(!Z||I6[$]>I6[X])return T4;else return Z[$].bind(Z)}function V0($){let Z=$.logger,X=$.logLevel??"off";if(!Z)return pO;let z=$J.get(Z);if(z&&z[0]===X)return z[1];let J={error:D6("error",Z,X),warn:D6("warn",Z,X),info:D6("info",Z,X),debug:D6("debug",Z,X)};return $J.set(Z,[X,J]),J}var I6,n3=($,Z,X)=>{if(!$)return;if(gz(I6,$))return $;V0(X).warn(`${Z} was set to ${JSON.stringify($)}, expected one of ${JSON.stringify(Object.keys(I6))}`);return},pO,$J,t0=($)=>{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 A6=x(()=>{b$();I6={off:0,error:200,warn:300,info:400,debug:500};pO={error:T4,warn:T4,info:T4,debug:T4},$J=new WeakMap});async function*lO($,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 ZJ,z=new L$,J=N4($.body);for await(let Q of iO(J))for(let Y of z.decode(Q)){let W=X.decode(Y);if(W)yield W}for(let Q of z.flush()){let Y=X.decode(Q);if(Y)yield Y}}async function*iO($){let Z=new Uint8Array;for await(let X of $){if(X==null)continue;let z=X instanceof ArrayBuffer?new Uint8Array(X):typeof X==="string"?O4(X):X,J=new Uint8Array(Z.length+z.length);J.set(Z),J.set(z,Z.length),Z=J;let Q;while((Q=ez(Z))!==-1)yield Z.slice(0,Q),Z=Z.slice(Q)}if(Z.length>0)yield Z}class ZJ{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]=nO($,":");if(z.startsWith(" "))z=z.substring(1);if(Z==="event")this.event=z;else if(Z==="data")this.data.push(z);return null}}function nO($,Z){let X=$.indexOf(Z);if(X!==-1)return[$.substring(0,X),Z,$.substring(X+Z.length)];return[$,"",""]}var D4,P0;var r3=x(()=>{a0();O0();i3();b$();A6();O0();P0=class P0{constructor($,Z,X){this.iterator=$,D4.set(this,void 0),this.controller=Z,_(this,D4,X,"f")}static fromSSEResponse($,Z,X){let z=!1,J=X?V0(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 W of lO($,Z)){if(W.event==="completion")try{yield JSON.parse(W.data)}catch(U){throw J.error("Could not parse message into JSON:",W.data),J.error("From chunk:",W.raw),U}if(W.event==="message_start"||W.event==="message_delta"||W.event==="message_stop"||W.event==="content_block_start"||W.event==="content_block_delta"||W.event==="content_block_stop"||W.event==="message"||W.event==="user.message"||W.event==="user.interrupt"||W.event==="user.tool_confirmation"||W.event==="user.custom_tool_result"||W.event==="agent.message"||W.event==="agent.thinking"||W.event==="agent.tool_use"||W.event==="agent.tool_result"||W.event==="agent.mcp_tool_use"||W.event==="agent.mcp_tool_result"||W.event==="agent.custom_tool_use"||W.event==="agent.thread_context_compacted"||W.event==="session.status_running"||W.event==="session.status_idle"||W.event==="session.status_rescheduled"||W.event==="session.status_terminated"||W.event==="session.error"||W.event==="session.deleted"||W.event==="span.model_request_start"||W.event==="span.model_request_end")try{yield JSON.parse(W.data)}catch(U){throw J.error("Could not parse message into JSON:",W.data),J.error("From chunk:",W.raw),U}if(W.event==="ping")continue;if(W.event==="error"){let U=O6(W.data)??W.data,G=U?.error?.type;throw new J0(void 0,U,void 0,$.headers,G)}}Y=!0}catch(W){if(o0(W))return;throw W}finally{if(!Y)Z.abort()}}return new P0(Q,Z,X)}static fromReadableStream($,Z,X){let z=!1;async function*J(){let Y=new L$,W=N4($);for await(let U of W)for(let G of Y.decode(U))yield G;for(let U of Y.flush())yield U}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 W of J()){if(Y)continue;if(W)yield JSON.parse(W)}Y=!0}catch(W){if(o0(W))return;throw W}finally{if(!Y)Z.abort()}}return new P0(Q,Z,X)}[(D4=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,D4,"f")),new P0(()=>z(Z),this.controller,M(this,D4,"f"))]}toReadableStream(){let $=this,Z;return p3({async start(){Z=$[Symbol.asyncIterator]()},async pull(X){try{let{value:z,done:J}=await Z.next();if(J)return X.close();let Q=O4(JSON.stringify(z)+`
169
+ `);X.enqueue(Q)}catch(z){X.error(z)}},async cancel(){await Z.return?.()}})}}});async function R6($,Z){let{response:X,requestLogID:z,retryOfRequestLogID:J,startTime:Q}=Z,Y=await(async()=>{if(Z.options.stream){if(V0($).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 U=X.headers.get("content-type")?.split(";")[0]?.trim();if(U?.includes("application/json")||U?.endsWith("+json")){if(X.headers.get("content-length")==="0")return;let K=await X.json();return s3(K,X)}return await X.text()})();return V0($).debug(`[${z}] response parsed`,t0({retryOfRequestLogID:J,url:X.url,status:X.status,body:Y,durationMs:Date.now()-Q})),Y}function s3($,Z){if(!$||typeof $!=="object"||Array.isArray($))return $;return Object.defineProperty($,"_request_id",{value:Z.headers.get("request-id"),enumerable:!1})}var a3=x(()=>{r3();A6()});var I4,M$;var F6=x(()=>{a0();a3();M$=class M$ extends Promise{constructor($,Z,X=R6){super((z)=>{z(null)});this.responsePromise=Z,this.parseResponse=X,I4.set(this,void 0),_(this,I4,$,"f")}_thenUnwrap($){return new M$(M(this,I4,"f"),this.responsePromise,async(Z,X)=>s3($(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,I4,"f"),$));return this.parsedPromise}then($,Z){return this.parse().then($,Z)}catch($){return this.parse().catch($)}finally($){return this.parse().finally($)}};I4=new WeakMap});var _6,o3,A4,f0,i;var e=x(()=>{a0();O0();a3();F6();b$();o3=class o3{constructor($,Z,X,z){_6.set(this,void 0),_(this,_6,$,"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,_6,"f").requestAPIList(this.constructor,$)}async*iterPages(){let $=this;yield $;while($.hasNextPage())$=await $.getNextPage(),yield $}async*[(_6=new WeakMap,Symbol.asyncIterator)](){for await(let $ of this.iterPages())for(let Z of $.getPaginatedItems())yield Z}};A4=class A4 extends M${constructor($,Z,X){super($,Z,async(z,J)=>new X(z,J.response,await R6(z,J),J.options))}async*[Symbol.asyncIterator](){let $=await this;for await(let Z of $)yield Z}};f0=class f0 extends o3{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:{...N6(this.options.query),before_id:Z}}}let $=this.last_id;if(!$)return null;return{...this.options,query:{...N6(this.options.query),after_id:$}}}};i=class i extends o3{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:{...N6(this.options.query),page:$}}}}});function k$($,Z,X){return e3(),new File($,Z??"unknown_file",X)}function R4($,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 sO($){let Z=typeof $==="function"?$:$.fetch,X=XJ.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 XJ.set(Z,z),z}var e3=()=>{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`.":""))}},$Z=($)=>$!=null&&typeof $==="object"&&typeof $[Symbol.asyncIterator]==="function",I1=async($,Z,X=!0)=>{return{...$,body:await aO($.body,Z,X)}},XJ,aO=async($,Z,X=!0)=>{if(!await sO(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])=>t3(z,J,Q,X))),z},oO=($)=>$ instanceof Blob&&("name"in $),t3=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,k$([await X.blob()],R4(X,z),J))}else if($Z(X))$.append(Z,k$([await new Response(T6(X)).blob()],R4(X,z)));else if(oO(X))$.append(Z,k$([X],R4(X,z),{type:X.type}));else if(Array.isArray(X))await Promise.all(X.map((J)=>t3($,Z+"[]",J,z)));else if(typeof X==="object")await Promise.all(Object.entries(X).map(([J,Q])=>t3($,`${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 A1=x(()=>{XJ=new WeakMap});async function F4($,Z,X){if(e3(),$=await $,Z||(Z=R4($,!0)),tO($)){if($ instanceof File&&Z==null&&X==null)return $;return k$([await $.arrayBuffer()],Z??$.name,{type:$.type,lastModified:$.lastModified,...X})}if(eO($)){let J=await $.blob();return Z||(Z=new URL($.url).pathname.split(/[\\/]/).pop()),k$(await ZZ(J),Z,X)}let z=await ZZ($);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 k$(z,Z,X)}async function ZZ($){let Z=[];if(typeof $==="string"||ArrayBuffer.isView($)||$ instanceof ArrayBuffer)Z.push($);else if(zJ($))Z.push($ instanceof Blob?$:await $.arrayBuffer());else if($Z($))for await(let X of $)Z.push(...await ZZ(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 zJ=($)=>$!=null&&typeof $==="object"&&typeof $.size==="number"&&typeof $.type==="string"&&typeof $.text==="function"&&typeof $.slice==="function"&&typeof $.arrayBuffer==="function",tO=($)=>$!=null&&typeof $==="object"&&typeof $.name==="string"&&typeof $.lastModified==="number"&&zJ($),eO=($)=>$!=null&&typeof $==="object"&&typeof $.url==="string"&&typeof $.blob==="function";var JJ=x(()=>{A1();A1()});var XZ=x(()=>{JJ()});var QJ=()=>{};class v{constructor($){this._client=$}}function*XT($){if(!$)return;if(YJ 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(m3($))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=m3(z[1])?z[1]:[z[1]],Y=!1;for(let W of Q){if(W===void 0)continue;if(Z&&!Y)Y=!0,yield[J,null];yield[J,W]}}}var YJ,O=($)=>{let Z=new Headers,X=new Set;for(let z of $){let J=new Set;for(let[Q,Y]of XT(z)){let W=Q.toLowerCase();if(!J.has(W))Z.delete(Q),J.add(W);if(Y===null)Z.delete(Q),X.add(W);else Z.append(Q,Y),X.delete(W)}}return{[YJ]:!0,values:Z,nulls:X}};var r=x(()=>{b$();YJ=Symbol.for("brand.privateNullableHeaders")});function UJ($){return $.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var WJ,zT=($=UJ)=>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??WJ)??WJ)?.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)},""),W=Y.split(/[?#]/,1)[0],U=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,G;while((G=U.exec(W))!==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},A;var Q0=x(()=>{O0();sz=Object.freeze(Object.create(null)),A=iO(az)});var F4;var e3=x(()=>{e();r();Q0();F4=class F4 extends g{create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/environments?beta=true",{body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/environments/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/environments/${$}?beta=true`,{body:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/environments?beta=true",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(A`/v1/environments/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(A`/v1/environments/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});function _6($){return typeof $==="object"&&$!==null&&_4 in $}function $Z($,Z){let X=new Set;if($){for(let z of $)if(_6(z))X.add(z[_4])}if(Z)for(let z of Z){if(_6(z))X.add(z[_4]);if(Array.isArray(z.content)){for(let J of z.content)if(_6(J))X.add(J[_4])}}return Array.from(X)}function P6($,Z){let X=$Z($,Z);if(X.length===0)return{};return{"x-stainless-helper":X.join(", ")}}function oz($){if(_6($))return{"x-stainless-helper":$[_4]};return{}}var _4;var P4=x(()=>{_4=Symbol("anthropic.sdk.stainlessHelper")});var C4;var ZZ=x(()=>{e();r();P4();I1();Q0();C4=class C4 extends g{list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/files?beta=true",f0,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"files-api-2025-04-14"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(A`/v1/files/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString()},X?.headers])})}download($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/files/${$}/content?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},X?.headers]),__binaryResponse:!0})}retrieveMetadata($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/files/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString()},X?.headers])})}upload($,Z){let{betas:X,...z}=$;return this._client.post("/v1/files?beta=true",D1({body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"files-api-2025-04-14"].toString()},oz(z.file),Z?.headers])},this._client))}}});var w4;var XZ=x(()=>{e();r();Q0();w4=class w4 extends g{retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/models/${$}?beta=true`,{...X,headers:O([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/models?beta=true",f0,{query:z,...Z,headers:O([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers])})}}});var E4;var zZ=x(()=>{e();r();Q0();E4=class E4 extends g{create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/user_profiles?beta=true",{body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"user-profiles-2026-03-24"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/user_profiles/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"user-profiles-2026-03-24"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/user_profiles/${$}?beta=true`,{body:J,...X,headers:O([{"anthropic-beta":[...z??[],"user-profiles-2026-03-24"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/user_profiles?beta=true",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"user-profiles-2026-03-24"].toString()},Z?.headers])})}createEnrollmentURL($,Z={},X){let{betas:z}=Z??{};return this._client.post(A`/v1/user_profiles/${$}/enrollment_url?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"user-profiles-2026-03-24"].toString()},X?.headers])})}}});var j4;var JZ=x(()=>{e();r();Q0();j4=class j4 extends g{list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(A`/v1/agents/${$}/versions?beta=true`,i,{query:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var A1;var QZ=x(()=>{JZ();JZ();e();r();Q0();A1=class A1 extends g{constructor(){super(...arguments);this.versions=new j4(this._client)}create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/agents?beta=true",{body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z,...J}=Z??{};return this._client.get(A`/v1/agents/${$}?beta=true`,{query:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/agents/${$}?beta=true`,{body:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/agents?beta=true",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(A`/v1/agents/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};A1.Versions=j4});var S4;var YZ=x(()=>{e();r();Q0();S4=class S4 extends g{create($,Z,X){let{view:z,betas:J,...Q}=Z;return this._client.post(A`/v1/memory_stores/${$}/memories?beta=true`,{query:{view:z},body:Q,...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}retrieve($,Z,X){let{memory_store_id:z,betas:J,...Q}=Z;return this._client.get(A`/v1/memory_stores/${z}/memories/${$}?beta=true`,{query:Q,...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{memory_store_id:z,view:J,betas:Q,...Y}=Z;return this._client.post(A`/v1/memory_stores/${z}/memories/${$}?beta=true`,{query:{view:J},body:Y,...X,headers:O([{"anthropic-beta":[...Q??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(A`/v1/memory_stores/${$}/memories?beta=true`,i,{query:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}delete($,Z,X){let{memory_store_id:z,expected_content_sha256:J,betas:Q}=Z;return this._client.delete(A`/v1/memory_stores/${z}/memories/${$}?beta=true`,{query:{expected_content_sha256:J},...X,headers:O([{"anthropic-beta":[...Q??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var x4;var UZ=x(()=>{e();r();Q0();x4=class x4 extends g{retrieve($,Z,X){let{memory_store_id:z,betas:J,...Q}=Z;return this._client.get(A`/v1/memory_stores/${z}/memory_versions/${$}?beta=true`,{query:Q,...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(A`/v1/memory_stores/${$}/memory_versions?beta=true`,i,{query:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}redact($,Z,X){let{memory_store_id:z,betas:J}=Z;return this._client.post(A`/v1/memory_stores/${z}/memory_versions/${$}/redact?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var y$;var WZ=x(()=>{YZ();YZ();UZ();UZ();e();r();Q0();y$=class y$ extends g{constructor(){super(...arguments);this.memories=new S4(this._client),this.memoryVersions=new x4(this._client)}create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/memory_stores?beta=true",{body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/memory_stores/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/memory_stores/${$}?beta=true`,{body:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/memory_stores?beta=true",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(A`/v1/memory_stores/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(A`/v1/memory_stores/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};y$.Memories=S4;y$.MemoryVersions=x4});var R1=x(()=>{O0()});var C6;var GZ=x(()=>{C6={"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 tz($){return $?.output_format??$?.output_config?.format}function qZ($,Z,X){let z=tz(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 VZ($,Z,X)}function VZ($,Z,X){let z=null,J=$.content.map((Q)=>{if(Q.type==="text"){let Y=XT(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 XT($,Z){let X=tz($);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 KZ=x(()=>{O0()});var zT=($)=>{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},F1=($)=>{if($.length===0)return $;let Z=$[$.length-1];switch(Z.type){case"separator":return $=$.slice(0,$.length-1),F1($);break;case"number":let X=Z.value[Z.value.length-1];if(X==="."||X==="-")return $=$.slice(0,$.length-1),F1($);case"string":let z=$[$.length-2];if(z?.type==="delimiter")return $=$.slice(0,$.length-1),F1($);else if(z?.type==="brace"&&z.value==="{")return $=$.slice(0,$.length-1),F1($);break;case"delimiter":return $=$.slice(0,$.length-1),F1($);break}return $},JT=($)=>{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 $},QT=($)=>{let Z="";return $.map((X)=>{switch(X.type){case"string":Z+='"'+X.value+'"';break;default:Z+=X.value;break}}),Z},w6=($)=>JSON.parse(QT(JT(F1(zT($)))));var HZ=()=>{};var BZ=x(()=>{p3()});function XJ($){return $.type==="tool_use"||$.type==="server_tool_use"||$.type==="mcp_tool_use"}function zJ($){}var j0,N$,_1,b4,E6,k4,y4,j6,f4,e0,g4,S6,x6,f$,b6,k6,v4,LZ,ez,y6,MZ,NZ,OZ,$J,ZJ="__json_buf",h4;var JJ=x(()=>{a0();HZ();R1();BZ();KZ();h4=class h4{constructor($,Z){j0.add(this),this.messages=[],this.receivedMessages=[],N$.set(this,void 0),_1.set(this,null),this.controller=new AbortController,b4.set(this,void 0),E6.set(this,()=>{}),k4.set(this,()=>{}),y4.set(this,void 0),j6.set(this,()=>{}),f4.set(this,()=>{}),e0.set(this,{}),g4.set(this,!1),S6.set(this,!1),x6.set(this,!1),f$.set(this,!1),b6.set(this,void 0),k6.set(this,void 0),v4.set(this,void 0),y6.set(this,(X)=>{if(_(this,S6,!0,"f"),o0(X))X=new K0;if(X instanceof K0)return _(this,x6,!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)))}),_(this,b4,new Promise((X,z)=>{_(this,E6,X,"f"),_(this,k4,z,"f")}),"f"),_(this,y4,new Promise((X,z)=>{_(this,j6,X,"f"),_(this,f4,z,"f")}),"f"),M(this,b4,"f").catch(()=>{}),M(this,y4,"f").catch(()=>{}),_(this,_1,$,"f"),_(this,v4,Z?.logger??console,"f")}get response(){return M(this,b6,"f")}get request_id(){return M(this,k6,"f")}async withResponse(){_(this,f$,!0,"f");let $=await M(this,b4,"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 h4(null);return Z._run(()=>Z._fromReadableStream($)),Z}static createMessage($,Z,X,{logger:z}={}){let J=new h4(Z,{logger:z});for(let Q of Z.messages)J._addMessageParam(Q);return _(J,_1,{...Z,stream:!0},"f"),J._run(()=>J._createMessage($,{...Z,stream:!0},{...X,headers:{...X?.headers,"X-Stainless-Helper-Method":"stream"}})),J}_run($){$().then(()=>{this._emitFinal(),this._emit("end")},M(this,y6,"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,j0,"m",MZ).call(this);let{response:Q,data:Y}=await $.create({...Z,stream:!0},{...X,signal:this.controller.signal}).withResponse();this._connected(Q);for await(let U of Y)M(this,j0,"m",NZ).call(this,U);if(Y.controller.signal?.aborted)throw new K0;M(this,j0,"m",OZ).call(this)}finally{if(z&&J)z.removeEventListener("abort",J)}}_connected($){if(this.ended)return;_(this,b6,$,"f"),_(this,k6,$?.headers.get("request-id"),"f"),M(this,E6,"f").call(this,$),this._emit("connect")}get ended(){return M(this,g4,"f")}get errored(){return M(this,S6,"f")}get aborted(){return M(this,x6,"f")}abort(){this.controller.abort()}on($,Z){return(M(this,e0,"f")[$]||(M(this,e0,"f")[$]=[])).push({listener:Z}),this}off($,Z){let X=M(this,e0,"f")[$];if(!X)return this;let z=X.findIndex((J)=>J.listener===Z);if(z>=0)X.splice(z,1);return this}once($,Z){return(M(this,e0,"f")[$]||(M(this,e0,"f")[$]=[])).push({listener:Z,once:!0}),this}emitted($){return new Promise((Z,X)=>{if(_(this,f$,!0,"f"),$!=="error")this.once("error",X);this.once($,Z)})}async done(){_(this,f$,!0,"f"),await M(this,y4,"f")}get currentMessage(){return M(this,N$,"f")}async finalMessage(){return await this.done(),M(this,j0,"m",LZ).call(this)}async finalText(){return await this.done(),M(this,j0,"m",ez).call(this)}_emit($,...Z){if(M(this,g4,"f"))return;if($==="end")_(this,g4,!0,"f"),M(this,j6,"f").call(this);let X=M(this,e0,"f")[$];if(X)M(this,e0,"f")[$]=X.filter((z)=>!z.once),X.forEach(({listener:z})=>z(...Z));if($==="abort"){let z=Z[0];if(!M(this,f$,"f")&&!X?.length)Promise.reject(z);M(this,k4,"f").call(this,z),M(this,f4,"f").call(this,z),this._emit("end");return}if($==="error"){let z=Z[0];if(!M(this,f$,"f")&&!X?.length)Promise.reject(z);M(this,k4,"f").call(this,z),M(this,f4,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",M(this,j0,"m",LZ).call(this))}async _fromReadableStream($,Z){let X=Z?.signal,z;if(X){if(X.aborted)this.controller.abort();z=this.controller.abort.bind(this.controller),X.addEventListener("abort",z)}try{M(this,j0,"m",MZ).call(this),this._connected(null);let J=P0.fromReadableStream($,this.controller);for await(let Q of J)M(this,j0,"m",NZ).call(this,Q);if(J.controller.signal?.aborted)throw new K0;M(this,j0,"m",OZ).call(this)}finally{if(X&&z)X.removeEventListener("abort",z)}}[(N$=new WeakMap,_1=new WeakMap,b4=new WeakMap,E6=new WeakMap,k4=new WeakMap,y4=new WeakMap,j6=new WeakMap,f4=new WeakMap,e0=new WeakMap,g4=new WeakMap,S6=new WeakMap,x6=new WeakMap,f$=new WeakMap,b6=new WeakMap,k6=new WeakMap,v4=new WeakMap,y6=new WeakMap,j0=new WeakSet,LZ=function(){if(this.receivedMessages.length===0)throw new S("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},ez=function(){if(this.receivedMessages.length===0)throw new S("stream ended without producing a Message with role=assistant");let Z=this.receivedMessages.at(-1).content.filter((X)=>X.type==="text").map((X)=>X.text);if(Z.length===0)throw new S("stream ended without producing a content block with type=text");return Z.join(" ")},MZ=function(){if(this.ended)return;_(this,N$,void 0,"f")},NZ=function(Z){if(this.ended)return;let X=M(this,j0,"m",$J).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(XJ(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:zJ(Z.delta)}break}case"message_stop":{this._addMessageParam(X),this._addMessage(qZ(X,M(this,_1,"f"),{logger:M(this,v4,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",X.content.at(-1));break}case"message_start":{_(this,N$,X,"f");break}case"content_block_start":case"message_delta":break}},OZ=function(){if(this.ended)throw new S("stream has ended, this shouldn't happen");let Z=M(this,N$,"f");if(!Z)throw new S("request ended without sending any chunks");return _(this,N$,void 0,"f"),qZ(Z,M(this,_1,"f"),{logger:M(this,v4,"f")})},$J=function(Z){let X=M(this,N$,"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&&XJ(z)){let J=z[ZJ]||"";J+=Z.delta.partial_json;let Q={...z};if(Object.defineProperty(Q,ZJ,{value:J,enumerable:!1,writable:!0}),J)try{Q.input=w6(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,y6,"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:zJ(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 P1;var f6=x(()=>{P1=class P1 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 QJ=1e5,YJ=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:
173
+ ${V}`)}return Y},A;var Q0=x(()=>{O0();WJ=Object.freeze(Object.create(null)),A=zT(UJ)});var _4;var zZ=x(()=>{e();r();Q0();_4=class _4 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(A`/v1/environments/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/environments/${$}?beta=true`,{body:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/environments?beta=true",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(A`/v1/environments/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(A`/v1/environments/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});function P6($){return typeof $==="object"&&$!==null&&P4 in $}function JZ($,Z){let X=new Set;if($){for(let z of $)if(P6(z))X.add(z[P4])}if(Z)for(let z of Z){if(P6(z))X.add(z[P4]);if(Array.isArray(z.content)){for(let J of z.content)if(P6(J))X.add(J[P4])}}return Array.from(X)}function C6($,Z){let X=JZ($,Z);if(X.length===0)return{};return{"x-stainless-helper":X.join(", ")}}function GJ($){if(P6($))return{"x-stainless-helper":$[P4]};return{}}var P4;var C4=x(()=>{P4=Symbol("anthropic.sdk.stainlessHelper")});var w4;var QZ=x(()=>{e();r();C4();A1();Q0();w4=class w4 extends v{list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/files?beta=true",f0,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"files-api-2025-04-14"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(A`/v1/files/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString()},X?.headers])})}download($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/files/${$}/content?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},X?.headers]),__binaryResponse:!0})}retrieveMetadata($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/files/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString()},X?.headers])})}upload($,Z){let{betas:X,...z}=$;return this._client.post("/v1/files?beta=true",I1({body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"files-api-2025-04-14"].toString()},GJ(z.file),Z?.headers])},this._client))}}});var E4;var YZ=x(()=>{e();r();Q0();E4=class E4 extends v{retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/models/${$}?beta=true`,{...X,headers:O([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/models?beta=true",f0,{query:z,...Z,headers:O([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers])})}}});var j4;var WZ=x(()=>{e();r();Q0();j4=class j4 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(A`/v1/user_profiles/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"user-profiles-2026-03-24"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/user_profiles/${$}?beta=true`,{body:J,...X,headers:O([{"anthropic-beta":[...z??[],"user-profiles-2026-03-24"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/user_profiles?beta=true",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"user-profiles-2026-03-24"].toString()},Z?.headers])})}createEnrollmentURL($,Z={},X){let{betas:z}=Z??{};return this._client.post(A`/v1/user_profiles/${$}/enrollment_url?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"user-profiles-2026-03-24"].toString()},X?.headers])})}}});var S4;var UZ=x(()=>{e();r();Q0();S4=class S4 extends v{list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(A`/v1/agents/${$}/versions?beta=true`,i,{query:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var R1;var GZ=x(()=>{UZ();UZ();e();r();Q0();R1=class R1 extends v{constructor(){super(...arguments);this.versions=new S4(this._client)}create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/agents?beta=true",{body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z,...J}=Z??{};return this._client.get(A`/v1/agents/${$}?beta=true`,{query:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/agents/${$}?beta=true`,{body:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/agents?beta=true",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(A`/v1/agents/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};R1.Versions=S4});var x4;var qZ=x(()=>{e();r();Q0();x4=class x4 extends v{create($,Z,X){let{view:z,betas:J,...Q}=Z;return this._client.post(A`/v1/memory_stores/${$}/memories?beta=true`,{query:{view:z},body:Q,...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}retrieve($,Z,X){let{memory_store_id:z,betas:J,...Q}=Z;return this._client.get(A`/v1/memory_stores/${z}/memories/${$}?beta=true`,{query:Q,...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{memory_store_id:z,view:J,betas:Q,...Y}=Z;return this._client.post(A`/v1/memory_stores/${z}/memories/${$}?beta=true`,{query:{view:J},body:Y,...X,headers:O([{"anthropic-beta":[...Q??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(A`/v1/memory_stores/${$}/memories?beta=true`,i,{query:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}delete($,Z,X){let{memory_store_id:z,expected_content_sha256:J,betas:Q}=Z;return this._client.delete(A`/v1/memory_stores/${z}/memories/${$}?beta=true`,{query:{expected_content_sha256:J},...X,headers:O([{"anthropic-beta":[...Q??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var b4;var VZ=x(()=>{e();r();Q0();b4=class b4 extends v{retrieve($,Z,X){let{memory_store_id:z,betas:J,...Q}=Z;return this._client.get(A`/v1/memory_stores/${z}/memory_versions/${$}?beta=true`,{query:Q,...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(A`/v1/memory_stores/${$}/memory_versions?beta=true`,i,{query:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}redact($,Z,X){let{memory_store_id:z,betas:J}=Z;return this._client.post(A`/v1/memory_stores/${z}/memory_versions/${$}/redact?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var y$;var KZ=x(()=>{qZ();qZ();VZ();VZ();e();r();Q0();y$=class y$ extends v{constructor(){super(...arguments);this.memories=new x4(this._client),this.memoryVersions=new b4(this._client)}create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/memory_stores?beta=true",{body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/memory_stores/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/memory_stores/${$}?beta=true`,{body:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/memory_stores?beta=true",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(A`/v1/memory_stores/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(A`/v1/memory_stores/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};y$.Memories=x4;y$.MemoryVersions=b4});var F1=x(()=>{O0()});var w6;var HZ=x(()=>{w6={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});function qJ($){return $?.output_format??$?.output_config?.format}function BZ($,Z,X){let z=qJ(Z);if(!Z||!("parse"in(z??{})))return{...$,content:$.content.map((J)=>{if(J.type==="text"){let Q=Object.defineProperty({...J},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(Q,"parsed",{get(){return X.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return J}),parsed_output:null};return LZ($,Z,X)}function LZ($,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 W=Object.defineProperty({...Q},"parsed_output",{value:Y,enumerable:!1});return Object.defineProperty(W,"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=qJ($);if(X?.type!=="json_schema")return null;try{if("parse"in X)return X.parse(Z);return JSON.parse(Z)}catch(z){throw new S(`Failed to parse structured output: ${z}`)}}var MZ=x(()=>{O0()});var BT=($)=>{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 W="",U=!1;z=$[++Z];while(z!=='"'){if(Z===$.length){U=!0;break}if(z==="\\"){if(Z++,Z===$.length){U=!0;break}W+=z+$[Z],z=$[++Z]}else W+=z,z=$[++Z]}if(z=$[++Z],!U)X.push({type:"string",value:W});continue}if(z&&/\s/.test(z)){Z++;continue}let Q=/[0-9]/;if(z&&Q.test(z)||z==="-"||z==="."){let W="";if(z==="-")W+=z,z=$[++Z];while(z&&Q.test(z)||z===".")W+=z,z=$[++Z];X.push({type:"number",value:W});continue}let Y=/[a-z]/i;if(z&&Y.test(z)){let W="";while(z&&Y.test(z)){if(Z===$.length)break;W+=z,z=$[++Z]}if(W=="true"||W=="false"||W==="null")X.push({type:"name",value:W});else{Z++;continue}continue}Z++}return X},_1=($)=>{if($.length===0)return $;let Z=$[$.length-1];switch(Z.type){case"separator":return $=$.slice(0,$.length-1),_1($);break;case"number":let X=Z.value[Z.value.length-1];if(X==="."||X==="-")return $=$.slice(0,$.length-1),_1($);case"string":let z=$[$.length-2];if(z?.type==="delimiter")return $=$.slice(0,$.length-1),_1($);else if(z?.type==="brace"&&z.value==="{")return $=$.slice(0,$.length-1),_1($);break;case"delimiter":return $=$.slice(0,$.length-1),_1($);break}return $},LT=($)=>{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},E6=($)=>JSON.parse(MT(LT(_1(BT($)))));var NZ=()=>{};var OZ=x(()=>{r3()});function BJ($){return $.type==="tool_use"||$.type==="server_tool_use"||$.type==="mcp_tool_use"}function LJ($){}var j0,N$,P1,k4,j6,y4,f4,S6,g4,e0,v4,x6,b6,f$,k6,y6,h4,TZ,VJ,f6,DZ,IZ,AZ,KJ,HJ="__json_buf",u4;var MJ=x(()=>{a0();NZ();F1();OZ();MZ();u4=class u4{constructor($,Z){j0.add(this),this.messages=[],this.receivedMessages=[],N$.set(this,void 0),P1.set(this,null),this.controller=new AbortController,k4.set(this,void 0),j6.set(this,()=>{}),y4.set(this,()=>{}),f4.set(this,void 0),S6.set(this,()=>{}),g4.set(this,()=>{}),e0.set(this,{}),v4.set(this,!1),x6.set(this,!1),b6.set(this,!1),f$.set(this,!1),k6.set(this,void 0),y6.set(this,void 0),h4.set(this,void 0),f6.set(this,(X)=>{if(_(this,x6,!0,"f"),o0(X))X=new K0;if(X instanceof K0)return _(this,b6,!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)))}),_(this,k4,new Promise((X,z)=>{_(this,j6,X,"f"),_(this,y4,z,"f")}),"f"),_(this,f4,new Promise((X,z)=>{_(this,S6,X,"f"),_(this,g4,z,"f")}),"f"),M(this,k4,"f").catch(()=>{}),M(this,f4,"f").catch(()=>{}),_(this,P1,$,"f"),_(this,h4,Z?.logger??console,"f")}get response(){return M(this,k6,"f")}get request_id(){return M(this,y6,"f")}async withResponse(){_(this,f$,!0,"f");let $=await M(this,k4,"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 u4(null);return Z._run(()=>Z._fromReadableStream($)),Z}static createMessage($,Z,X,{logger:z}={}){let J=new u4(Z,{logger:z});for(let Q of Z.messages)J._addMessageParam(Q);return _(J,P1,{...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,f6,"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,j0,"m",DZ).call(this);let{response:Q,data:Y}=await $.create({...Z,stream:!0},{...X,signal:this.controller.signal}).withResponse();this._connected(Q);for await(let W of Y)M(this,j0,"m",IZ).call(this,W);if(Y.controller.signal?.aborted)throw new K0;M(this,j0,"m",AZ).call(this)}finally{if(z&&J)z.removeEventListener("abort",J)}}_connected($){if(this.ended)return;_(this,k6,$,"f"),_(this,y6,$?.headers.get("request-id"),"f"),M(this,j6,"f").call(this,$),this._emit("connect")}get ended(){return M(this,v4,"f")}get errored(){return M(this,x6,"f")}get aborted(){return M(this,b6,"f")}abort(){this.controller.abort()}on($,Z){return(M(this,e0,"f")[$]||(M(this,e0,"f")[$]=[])).push({listener:Z}),this}off($,Z){let X=M(this,e0,"f")[$];if(!X)return this;let z=X.findIndex((J)=>J.listener===Z);if(z>=0)X.splice(z,1);return this}once($,Z){return(M(this,e0,"f")[$]||(M(this,e0,"f")[$]=[])).push({listener:Z,once:!0}),this}emitted($){return new Promise((Z,X)=>{if(_(this,f$,!0,"f"),$!=="error")this.once("error",X);this.once($,Z)})}async done(){_(this,f$,!0,"f"),await M(this,f4,"f")}get currentMessage(){return M(this,N$,"f")}async finalMessage(){return await this.done(),M(this,j0,"m",TZ).call(this)}async finalText(){return await this.done(),M(this,j0,"m",VJ).call(this)}_emit($,...Z){if(M(this,v4,"f"))return;if($==="end")_(this,v4,!0,"f"),M(this,S6,"f").call(this);let X=M(this,e0,"f")[$];if(X)M(this,e0,"f")[$]=X.filter((z)=>!z.once),X.forEach(({listener:z})=>z(...Z));if($==="abort"){let z=Z[0];if(!M(this,f$,"f")&&!X?.length)Promise.reject(z);M(this,y4,"f").call(this,z),M(this,g4,"f").call(this,z),this._emit("end");return}if($==="error"){let z=Z[0];if(!M(this,f$,"f")&&!X?.length)Promise.reject(z);M(this,y4,"f").call(this,z),M(this,g4,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",M(this,j0,"m",TZ).call(this))}async _fromReadableStream($,Z){let X=Z?.signal,z;if(X){if(X.aborted)this.controller.abort();z=this.controller.abort.bind(this.controller),X.addEventListener("abort",z)}try{M(this,j0,"m",DZ).call(this),this._connected(null);let J=P0.fromReadableStream($,this.controller);for await(let Q of J)M(this,j0,"m",IZ).call(this,Q);if(J.controller.signal?.aborted)throw new K0;M(this,j0,"m",AZ).call(this)}finally{if(X&&z)X.removeEventListener("abort",z)}}[(N$=new WeakMap,P1=new WeakMap,k4=new WeakMap,j6=new WeakMap,y4=new WeakMap,f4=new WeakMap,S6=new WeakMap,g4=new WeakMap,e0=new WeakMap,v4=new WeakMap,x6=new WeakMap,b6=new WeakMap,f$=new WeakMap,k6=new WeakMap,y6=new WeakMap,h4=new WeakMap,f6=new WeakMap,j0=new WeakSet,TZ=function(){if(this.receivedMessages.length===0)throw new S("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},VJ=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(" ")},DZ=function(){if(this.ended)return;_(this,N$,void 0,"f")},IZ=function(Z){if(this.ended)return;let X=M(this,j0,"m",KJ).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(BJ(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:LJ(Z.delta)}break}case"message_stop":{this._addMessageParam(X),this._addMessage(BZ(X,M(this,P1,"f"),{logger:M(this,h4,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",X.content.at(-1));break}case"message_start":{_(this,N$,X,"f");break}case"content_block_start":case"message_delta":break}},AZ=function(){if(this.ended)throw new S("stream has ended, this shouldn't happen");let Z=M(this,N$,"f");if(!Z)throw new S("request ended without sending any chunks");return _(this,N$,void 0,"f"),BZ(Z,M(this,P1,"f"),{logger:M(this,h4,"f")})},KJ=function(Z){let X=M(this,N$,"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&&BJ(z)){let J=z[HJ]||"";J+=Z.delta.partial_json;let Q={...z};if(Object.defineProperty(Q,HJ,{value:J,enumerable:!1,writable:!0}),J)try{Q.input=E6(J)}catch(Y){let W=new S(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${Y}. JSON: ${J}`);M(this,f6,"f").call(this,W)}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:LJ(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 C1;var g6=x(()=>{C1=class C1 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 NJ=1e5,OJ=`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 WJ(){let $,Z;return{promise:new Promise((z,J)=>{$=z,Z=J}),resolve:$,reject:Z}}async function YT($,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 P1?U.content:`Error: ${U instanceof Error?U.message:String(U)}`,is_error:!0}}}))}}var u4,C1,g$,G0,T0,C0,$$,O$,m4,UJ,TZ,c4;var DZ=x(()=>{a0();f6();O0();r();P4();c4=class c4{constructor($,Z,X){u4.add(this),this.client=$,C1.set(this,!1),g$.set(this,!1),G0.set(this,void 0),T0.set(this,void 0),C0.set(this,void 0),$$.set(this,void 0),O$.set(this,void 0),m4.set(this,0),_(this,G0,{params:{...Z,messages:structuredClone(Z.messages)}},"f");let J=["BetaToolRunner",...$Z(Z.tools,Z.messages)].join(", ");if(_(this,T0,{...X,headers:O([{"x-stainless-helper":J},X?.headers])},"f"),_(this,O$,WJ(),"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*[(C1=new WeakMap,g$=new WeakMap,G0=new WeakMap,T0=new WeakMap,C0=new WeakMap,$$=new WeakMap,O$=new WeakMap,m4=new WeakMap,u4=new WeakSet,UJ=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??QJ;if(X<z)return!1;let J=Z.model??M(this,G0,"f").params.model,Q=Z.summaryPrompt??YJ,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 S("Expected text response for compaction");return M(this,G0,"f").params.messages=[{role:"user",content:U.content}],!0},Symbol.asyncIterator)](){var $;if(M(this,C1,"f"))throw new S("Cannot iterate over a consumed stream");_(this,C1,!0,"f"),_(this,g$,!0,"f"),_(this,$$,void 0,"f");try{while(!0){let Z;try{if(M(this,G0,"f").params.max_iterations&&M(this,m4,"f")>=M(this,G0,"f").params.max_iterations)break;_(this,g$,!1,"f"),_(this,$$,void 0,"f"),_(this,m4,($=M(this,m4,"f"),$++,$),"f"),_(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")),_(this,C0,Z.finalMessage(),"f"),M(this,C0,"f").catch(()=>{}),yield Z;else _(this,C0,this.client.beta.messages.create({...J,stream:!1},M(this,T0,"f")),"f"),yield M(this,C0,"f");if(!await M(this,u4,"m",UJ).call(this)){if(!M(this,g$,"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,u4,"m",TZ).call(this,M(this,G0,"f").params.messages.at(-1));if(Y)M(this,G0,"f").params.messages.push(Y);else if(!M(this,g$,"f"))break}}finally{if(Z)Z.abort()}}if(!M(this,C0,"f"))throw new S("ToolRunner concluded without a message from the server");M(this,O$,"f").resolve(await M(this,C0,"f"))}catch(Z){throw _(this,C1,!1,"f"),M(this,O$,"f").promise.catch(()=>{}),M(this,O$,"f").reject(Z),_(this,O$,WJ(),"f"),Z}}setMessagesParams($){if(typeof $==="function")M(this,G0,"f").params=$(M(this,G0,"f").params);else M(this,G0,"f").params=$;_(this,g$,!0,"f"),_(this,$$,void 0,"f")}setRequestOptions($){if(typeof $==="function")_(this,T0,$(M(this,T0,"f")),"f");else _(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,u4,"m",TZ).call(this,Z,$)}done(){return M(this,O$,"f").promise}async runUntilDone(){if(!M(this,C1,"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)}};TZ=async function(Z,X=M(this,T0,"f").signal){if(M(this,$$,"f")!==void 0)return M(this,$$,"f");return _(this,$$,YT(M(this,G0,"f").params,Z,{...M(this,T0,"f"),signal:X}),"f"),M(this,$$,"f")}});var w1;var IZ=x(()=>{O0();c3();w1=class w1{constructor($,Z){this.iterator=$,this.controller=Z}async*decoder(){let $=new L$;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 w1(M4($.body),Z)}}});var d4;var AZ=x(()=>{e();r();IZ();R1();Q0();d4=class d4 extends g{create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/messages/batches?beta=true",{body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"message-batches-2024-09-24"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/messages/batches/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/messages/batches?beta=true",f0,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"message-batches-2024-09-24"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(A`/v1/messages/batches/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},X?.headers])})}cancel($,Z={},X){let{betas:z}=Z??{};return this._client.post(A`/v1/messages/batches/${$}/cancel?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},X?.headers])})}async results($,Z={},X){let z=await this.retrieve($);if(!z.results_url)throw new S(`No batch \`results_url\`; Has it finished processing? ${z.processing_status} - ${z.id}`);let{betas:J}=Z??{};return this._client.get(z.results_url,{...X,headers:O([{"anthropic-beta":[...J??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},X?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((Q,Y)=>w1.fromResponse(Y.response,Y.controller))}}});function qJ($){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 GJ,WT,T$;var RZ=x(()=>{R1();GZ();r();P4();KZ();JJ();DZ();f6();AZ();AZ();DZ();f6();GJ={"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"},WT=["claude-mythos-preview","claude-opus-4-6"];T$=class T$ extends g{constructor(){super(...arguments);this.batches=new d4(this._client)}create($,Z){let X=qJ($),{betas:z,...J}=X;if(J.model in GJ)console.warn(`The model '${J.model}' is deprecated and will reach end-of-life on ${GJ[J.model]}
196
- Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(WT.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=C6[J.model]??void 0;Q=this._client.calculateNonstreamingTimeout(J.max_tokens,U)}let Y=P6(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)=>VZ(X,$,{logger:this._client.logger??console}))}stream($,Z){return h4.createMessage(this,$,Z)}countTokens($,Z){let X=qJ($),{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 c4(this._client,$,Z)}};T$.Batches=d4;T$.BetaToolRunner=c4;T$.ToolError=P1});var p4;var FZ=x(()=>{e();r();Q0();p4=class p4 extends g{list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(A`/v1/sessions/${$}/events?beta=true`,i,{query:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}send($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/sessions/${$}/events?beta=true`,{body:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}stream($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/sessions/${$}/events/stream?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers]),stream:!0})}}});var l4;var _Z=x(()=>{e();r();Q0();l4=class l4 extends g{retrieve($,Z,X){let{session_id:z,betas:J}=Z;return this._client.get(A`/v1/sessions/${z}/resources/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{session_id:z,betas:J,...Q}=Z;return this._client.post(A`/v1/sessions/${z}/resources/${$}?beta=true`,{body:Q,...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(A`/v1/sessions/${$}/resources?beta=true`,i,{query:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}delete($,Z,X){let{session_id:z,betas:J}=Z;return this._client.delete(A`/v1/sessions/${z}/resources/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}add($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/sessions/${$}/resources?beta=true`,{body:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var v$;var PZ=x(()=>{FZ();FZ();_Z();_Z();e();r();Q0();v$=class v$ extends g{constructor(){super(...arguments);this.events=new p4(this._client),this.resources=new l4(this._client)}create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/sessions?beta=true",{body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/sessions/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/sessions/${$}?beta=true`,{body:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/sessions?beta=true",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(A`/v1/sessions/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(A`/v1/sessions/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};v$.Events=p4;v$.Resources=l4});var i4;var CZ=x(()=>{e();r();I1();Q0();i4=class i4 extends g{create($,Z={},X){let{betas:z,...J}=Z??{};return this._client.post(A`/v1/skills/${$}/versions?beta=true`,D1({body:J,...X,headers:O([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])},this._client))}retrieve($,Z,X){let{skill_id:z,betas:J}=Z;return this._client.get(A`/v1/skills/${z}/versions/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(A`/v1/skills/${$}/versions?beta=true`,i,{query:J,...X,headers:O([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}delete($,Z,X){let{skill_id:z,betas:J}=Z;return this._client.delete(A`/v1/skills/${z}/versions/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])})}}});var E1;var wZ=x(()=>{CZ();CZ();e();r();I1();Q0();E1=class E1 extends g{constructor(){super(...arguments);this.versions=new i4(this._client)}create($={},Z){let{betas:X,...z}=$??{};return this._client.post("/v1/skills?beta=true",D1({body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"skills-2025-10-02"].toString()},Z?.headers])},this._client,!1))}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/skills/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/skills?beta=true",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"skills-2025-10-02"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(A`/v1/skills/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}};E1.Versions=i4});var n4;var EZ=x(()=>{e();r();Q0();n4=class n4 extends g{create($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/vaults/${$}/credentials?beta=true`,{body:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}retrieve($,Z,X){let{vault_id:z,betas:J}=Z;return this._client.get(A`/v1/vaults/${z}/credentials/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{vault_id:z,betas:J,...Q}=Z;return this._client.post(A`/v1/vaults/${z}/credentials/${$}?beta=true`,{body:Q,...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(A`/v1/vaults/${$}/credentials?beta=true`,i,{query:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}delete($,Z,X){let{vault_id:z,betas:J}=Z;return this._client.delete(A`/v1/vaults/${z}/credentials/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z,X){let{vault_id:z,betas:J}=Z;return this._client.post(A`/v1/vaults/${z}/credentials/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var j1;var jZ=x(()=>{EZ();EZ();e();r();Q0();j1=class j1 extends g{constructor(){super(...arguments);this.credentials=new n4(this._client)}create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/vaults?beta=true",{body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/vaults/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/vaults/${$}?beta=true`,{body:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/vaults?beta=true",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(A`/v1/vaults/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(A`/v1/vaults/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};j1.Credentials=n4});var L0;var SZ=x(()=>{e3();e3();ZZ();ZZ();XZ();XZ();zZ();zZ();QZ();QZ();WZ();WZ();RZ();RZ();PZ();PZ();wZ();wZ();jZ();jZ();L0=class L0 extends g{constructor(){super(...arguments);this.models=new w4(this._client),this.messages=new T$(this._client),this.agents=new A1(this._client),this.environments=new F4(this._client),this.sessions=new v$(this._client),this.vaults=new j1(this._client),this.memoryStores=new y$(this._client),this.files=new C4(this._client),this.skills=new E1(this._client),this.userProfiles=new E4(this._client)}};L0.Models=w4;L0.Messages=T$;L0.Agents=A1;L0.Environments=F4;L0.Sessions=v$;L0.Vaults=j1;L0.MemoryStores=y$;L0.Files=C4;L0.Skills=E1;L0.UserProfiles=E4});var S1;var xZ=x(()=>{r();S1=class S1 extends g{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 VJ($){return $?.output_config?.format}function bZ($,Z,X){let z=VJ(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 kZ($,Z,X)}function kZ($,Z,X){let z=null,J=$.content.map((Q)=>{if(Q.type==="text"){let Y=NT(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 NT($,Z){let X=VJ($);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 yZ=x(()=>{O0()});function LJ($){return $.type==="tool_use"||$.type==="server_tool_use"}function MJ($){}var S0,D$,x1,r4,g6,s4,a4,v6,o4,Z$,t4,h6,u6,h$,m6,c6,e4,fZ,KJ,gZ,vZ,hZ,uZ,HJ,BJ="__json_buf",$2;var NJ=x(()=>{a0();R1();BZ();HZ();yZ();$2=class $2{constructor($,Z){S0.add(this),this.messages=[],this.receivedMessages=[],D$.set(this,void 0),x1.set(this,null),this.controller=new AbortController,r4.set(this,void 0),g6.set(this,()=>{}),s4.set(this,()=>{}),a4.set(this,void 0),v6.set(this,()=>{}),o4.set(this,()=>{}),Z$.set(this,{}),t4.set(this,!1),h6.set(this,!1),u6.set(this,!1),h$.set(this,!1),m6.set(this,void 0),c6.set(this,void 0),e4.set(this,void 0),gZ.set(this,(X)=>{if(_(this,h6,!0,"f"),o0(X))X=new K0;if(X instanceof K0)return _(this,u6,!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)))}),_(this,r4,new Promise((X,z)=>{_(this,g6,X,"f"),_(this,s4,z,"f")}),"f"),_(this,a4,new Promise((X,z)=>{_(this,v6,X,"f"),_(this,o4,z,"f")}),"f"),M(this,r4,"f").catch(()=>{}),M(this,a4,"f").catch(()=>{}),_(this,x1,$,"f"),_(this,e4,Z?.logger??console,"f")}get response(){return M(this,m6,"f")}get request_id(){return M(this,c6,"f")}async withResponse(){_(this,h$,!0,"f");let $=await M(this,r4,"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 $2(null);return Z._run(()=>Z._fromReadableStream($)),Z}static createMessage($,Z,X,{logger:z}={}){let J=new $2(Z,{logger:z});for(let Q of Z.messages)J._addMessageParam(Q);return _(J,x1,{...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,gZ,"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",vZ).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",hZ).call(this,U);if(Y.controller.signal?.aborted)throw new K0;M(this,S0,"m",uZ).call(this)}finally{if(z&&J)z.removeEventListener("abort",J)}}_connected($){if(this.ended)return;_(this,m6,$,"f"),_(this,c6,$?.headers.get("request-id"),"f"),M(this,g6,"f").call(this,$),this._emit("connect")}get ended(){return M(this,t4,"f")}get errored(){return M(this,h6,"f")}get aborted(){return M(this,u6,"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(_(this,h$,!0,"f"),$!=="error")this.once("error",X);this.once($,Z)})}async done(){_(this,h$,!0,"f"),await M(this,a4,"f")}get currentMessage(){return M(this,D$,"f")}async finalMessage(){return await this.done(),M(this,S0,"m",fZ).call(this)}async finalText(){return await this.done(),M(this,S0,"m",KJ).call(this)}_emit($,...Z){if(M(this,t4,"f"))return;if($==="end")_(this,t4,!0,"f"),M(this,v6,"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,s4,"f").call(this,z),M(this,o4,"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,s4,"f").call(this,z),M(this,o4,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",M(this,S0,"m",fZ).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",vZ).call(this),this._connected(null);let J=P0.fromReadableStream($,this.controller);for await(let Q of J)M(this,S0,"m",hZ).call(this,Q);if(J.controller.signal?.aborted)throw new K0;M(this,S0,"m",uZ).call(this)}finally{if(X&&z)X.removeEventListener("abort",z)}}[(D$=new WeakMap,x1=new WeakMap,r4=new WeakMap,g6=new WeakMap,s4=new WeakMap,a4=new WeakMap,v6=new WeakMap,o4=new WeakMap,Z$=new WeakMap,t4=new WeakMap,h6=new WeakMap,u6=new WeakMap,h$=new WeakMap,m6=new WeakMap,c6=new WeakMap,e4=new WeakMap,gZ=new WeakMap,S0=new WeakSet,fZ=function(){if(this.receivedMessages.length===0)throw new S("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},KJ=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(" ")},vZ=function(){if(this.ended)return;_(this,D$,void 0,"f")},hZ=function(Z){if(this.ended)return;let X=M(this,S0,"m",HJ).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(LJ(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:MJ(Z.delta)}break}case"message_stop":{this._addMessageParam(X),this._addMessage(bZ(X,M(this,x1,"f"),{logger:M(this,e4,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",X.content.at(-1));break}case"message_start":{_(this,D$,X,"f");break}case"content_block_start":case"message_delta":break}},uZ=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 _(this,D$,void 0,"f"),bZ(Z,M(this,x1,"f"),{logger:M(this,e4,"f")})},HJ=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.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&&LJ(z)){let J=z[BJ]||"";J+=Z.delta.partial_json;let Q={...z};if(Object.defineProperty(Q,BJ,{value:J,enumerable:!1,writable:!0}),J)Q.input=w6(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:MJ(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 Z2;var mZ=x(()=>{e();r();IZ();R1();Q0();Z2=class Z2 extends g{create($,Z){return this._client.post("/v1/messages/batches",{body:$,...Z})}retrieve($,Z){return this._client.get(A`/v1/messages/batches/${$}`,Z)}list($={},Z){return this._client.getAPIList("/v1/messages/batches",f0,{query:$,...Z})}delete($,Z){return this._client.delete(A`/v1/messages/batches/${$}`,Z)}cancel($,Z){return this._client.post(A`/v1/messages/batches/${$}/cancel`,Z)}async results($,Z){let X=await this.retrieve($);if(!X.results_url)throw new S(`No batch \`results_url\`; Has it finished processing? ${X.processing_status} - ${X.id}`);return this._client.get(X.results_url,{...Z,headers:O([{Accept:"application/binary"},Z?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((z,J)=>w1.fromResponse(J.response,J.controller))}}});var u$,OJ,TT;var cZ=x(()=>{r();P4();NJ();yZ();mZ();mZ();GZ();u$=class u$ extends g{constructor(){super(...arguments);this.batches=new Z2(this._client)}create($,Z){if($.model in OJ)console.warn(`The model '${$.model}' is deprecated and will reach end-of-life on ${OJ[$.model]}
197
- Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(TT.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=C6[$.model]??void 0;X=this._client.calculateNonstreamingTimeout($.max_tokens,J)}let z=P6($.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)=>kZ(X,$,{logger:this._client.logger??console}))}stream($,Z){return $2.createMessage(this,$,Z,{logger:this._client.logger??console})}countTokens($,Z){return this._client.post("/v1/messages/count_tokens",{body:$,...Z})}};OJ={"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"},TT=["claude-mythos-preview","claude-opus-4-6"];u$.Batches=Z2});var b1;var dZ=x(()=>{e();r();Q0();b1=class b1 extends g{retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/models/${$}`,{...X,headers:O([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/models",f0,{query:z,...Z,headers:O([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers])})}}});var TJ=x(()=>{SZ();xZ();cZ();dZ();nz()});var X2=($)=>{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:$=X2("ANTHROPIC_BASE_URL"),apiKey:Z=X2("ANTHROPIC_API_KEY")??null,authToken:X=X2("ANTHROPIC_AUTH_TOKEN")??null,...z}={}){pZ.add(this),d6.set(this,void 0);let J={apiKey:Z,authToken:X,...z,baseURL:$||"https://api.anthropic.com"};if(!J.dangerouslyAllowBrowser&&Sz())throw new S(`It looks like you're running in a browser-like environment.
195
+ Wrap your summary in <summary></summary> tags.`;function DJ(){let $,Z;return{promise:new Promise((z,J)=>{$=z,Z=J}),resolve:$,reject:Z}}async function NT($,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((W)=>("name"in W?W.name:W.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 W=Q.input;if("parse"in Y&&Y.parse)W=Y.parse(W);let U=await Y.run(W,{toolUseBlock:Q,signal:X?.signal});return{type:"tool_result",tool_use_id:Q.id,content:U}}catch(W){return{type:"tool_result",tool_use_id:Q.id,content:W instanceof C1?W.content:`Error: ${W instanceof Error?W.message:String(W)}`,is_error:!0}}}))}}var m4,w1,g$,G0,T0,C0,$$,O$,c4,TJ,RZ,d4;var FZ=x(()=>{a0();g6();O0();r();C4();d4=class d4{constructor($,Z,X){m4.add(this),this.client=$,w1.set(this,!1),g$.set(this,!1),G0.set(this,void 0),T0.set(this,void 0),C0.set(this,void 0),$$.set(this,void 0),O$.set(this,void 0),c4.set(this,0),_(this,G0,{params:{...Z,messages:structuredClone(Z.messages)}},"f");let J=["BetaToolRunner",...JZ(Z.tools,Z.messages)].join(", ");if(_(this,T0,{...X,headers:O([{"x-stainless-helper":J},X?.headers])},"f"),_(this,O$,DJ(),"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*[(w1=new WeakMap,g$=new WeakMap,G0=new WeakMap,T0=new WeakMap,C0=new WeakMap,$$=new WeakMap,O$=new WeakMap,c4=new WeakMap,m4=new WeakSet,TJ=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 U=await M(this,C0,"f");X=U.usage.input_tokens+(U.usage.cache_creation_input_tokens??0)+(U.usage.cache_read_input_tokens??0)+U.usage.output_tokens}catch{return!1}let z=Z.contextTokenThreshold??NJ;if(X<z)return!1;let J=Z.model??M(this,G0,"f").params.model,Q=Z.summaryPrompt??OJ,Y=M(this,G0,"f").params.messages;if(Y[Y.length-1].role==="assistant"){let U=Y[Y.length-1];if(Array.isArray(U.content)){let G=U.content.filter((q)=>q.type!=="tool_use");if(G.length===0)Y.pop();else U.content=G}}let W=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(W.content[0]?.type!=="text")throw new S("Expected text response for compaction");return M(this,G0,"f").params.messages=[{role:"user",content:W.content}],!0},Symbol.asyncIterator)](){var $;if(M(this,w1,"f"))throw new S("Cannot iterate over a consumed stream");_(this,w1,!0,"f"),_(this,g$,!0,"f"),_(this,$$,void 0,"f");try{while(!0){let Z;try{if(M(this,G0,"f").params.max_iterations&&M(this,c4,"f")>=M(this,G0,"f").params.max_iterations)break;_(this,g$,!1,"f"),_(this,$$,void 0,"f"),_(this,c4,($=M(this,c4,"f"),$++,$),"f"),_(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")),_(this,C0,Z.finalMessage(),"f"),M(this,C0,"f").catch(()=>{}),yield Z;else _(this,C0,this.client.beta.messages.create({...J,stream:!1},M(this,T0,"f")),"f"),yield M(this,C0,"f");if(!await M(this,m4,"m",TJ).call(this)){if(!M(this,g$,"f")){let{role:W,content:U}=await M(this,C0,"f");M(this,G0,"f").params.messages.push({role:W,content:U})}let Y=await M(this,m4,"m",RZ).call(this,M(this,G0,"f").params.messages.at(-1));if(Y)M(this,G0,"f").params.messages.push(Y);else if(!M(this,g$,"f"))break}}finally{if(Z)Z.abort()}}if(!M(this,C0,"f"))throw new S("ToolRunner concluded without a message from the server");M(this,O$,"f").resolve(await M(this,C0,"f"))}catch(Z){throw _(this,w1,!1,"f"),M(this,O$,"f").promise.catch(()=>{}),M(this,O$,"f").reject(Z),_(this,O$,DJ(),"f"),Z}}setMessagesParams($){if(typeof $==="function")M(this,G0,"f").params=$(M(this,G0,"f").params);else M(this,G0,"f").params=$;_(this,g$,!0,"f"),_(this,$$,void 0,"f")}setRequestOptions($){if(typeof $==="function")_(this,T0,$(M(this,T0,"f")),"f");else _(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,m4,"m",RZ).call(this,Z,$)}done(){return M(this,O$,"f").promise}async runUntilDone(){if(!M(this,w1,"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)}};RZ=async function(Z,X=M(this,T0,"f").signal){if(M(this,$$,"f")!==void 0)return M(this,$$,"f");return _(this,$$,NT(M(this,G0,"f").params,Z,{...M(this,T0,"f"),signal:X}),"f"),M(this,$$,"f")}});var E1;var _Z=x(()=>{O0();i3();E1=class E1{constructor($,Z){this.iterator=$,this.controller=Z}async*decoder(){let $=new L$;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 E1(N4($.body),Z)}}});var p4;var PZ=x(()=>{e();r();_Z();F1();Q0();p4=class p4 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(A`/v1/messages/batches/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/messages/batches?beta=true",f0,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"message-batches-2024-09-24"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(A`/v1/messages/batches/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},X?.headers])})}cancel($,Z={},X){let{betas:z}=Z??{};return this._client.post(A`/v1/messages/batches/${$}/cancel?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},X?.headers])})}async results($,Z={},X){let z=await this.retrieve($);if(!z.results_url)throw new S(`No batch \`results_url\`; Has it finished processing? ${z.processing_status} - ${z.id}`);let{betas:J}=Z??{};return this._client.get(z.results_url,{...X,headers:O([{"anthropic-beta":[...J??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},X?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((Q,Y)=>E1.fromResponse(Y.response,Y.controller))}}});function AJ($){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 IJ,TT,T$;var CZ=x(()=>{F1();HZ();r();C4();MZ();MJ();FZ();g6();PZ();PZ();FZ();g6();IJ={"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"},TT=["claude-mythos-preview","claude-opus-4-6"];T$=class T$ extends v{constructor(){super(...arguments);this.batches=new p4(this._client)}create($,Z){let X=AJ($),{betas:z,...J}=X;if(J.model in IJ)console.warn(`The model '${J.model}' is deprecated and will reach end-of-life on ${IJ[J.model]}
196
+ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(TT.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 W=w6[J.model]??void 0;Q=this._client.calculateNonstreamingTimeout(J.max_tokens,W)}let Y=C6(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)=>LZ(X,$,{logger:this._client.logger??console}))}stream($,Z){return u4.createMessage(this,$,Z)}countTokens($,Z){let X=AJ($),{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 d4(this._client,$,Z)}};T$.Batches=p4;T$.BetaToolRunner=d4;T$.ToolError=C1});var l4;var wZ=x(()=>{e();r();Q0();l4=class l4 extends v{list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(A`/v1/sessions/${$}/events?beta=true`,i,{query:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}send($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/sessions/${$}/events?beta=true`,{body:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}stream($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/sessions/${$}/events/stream?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers]),stream:!0})}}});var i4;var EZ=x(()=>{e();r();Q0();i4=class i4 extends v{retrieve($,Z,X){let{session_id:z,betas:J}=Z;return this._client.get(A`/v1/sessions/${z}/resources/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{session_id:z,betas:J,...Q}=Z;return this._client.post(A`/v1/sessions/${z}/resources/${$}?beta=true`,{body:Q,...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(A`/v1/sessions/${$}/resources?beta=true`,i,{query:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}delete($,Z,X){let{session_id:z,betas:J}=Z;return this._client.delete(A`/v1/sessions/${z}/resources/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}add($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/sessions/${$}/resources?beta=true`,{body:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var v$;var jZ=x(()=>{wZ();wZ();EZ();EZ();e();r();Q0();v$=class v$ extends v{constructor(){super(...arguments);this.events=new l4(this._client),this.resources=new i4(this._client)}create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/sessions?beta=true",{body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/sessions/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/sessions/${$}?beta=true`,{body:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/sessions?beta=true",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(A`/v1/sessions/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(A`/v1/sessions/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};v$.Events=l4;v$.Resources=i4});var n4;var SZ=x(()=>{e();r();A1();Q0();n4=class n4 extends v{create($,Z={},X){let{betas:z,...J}=Z??{};return this._client.post(A`/v1/skills/${$}/versions?beta=true`,I1({body:J,...X,headers:O([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])},this._client))}retrieve($,Z,X){let{skill_id:z,betas:J}=Z;return this._client.get(A`/v1/skills/${z}/versions/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(A`/v1/skills/${$}/versions?beta=true`,i,{query:J,...X,headers:O([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}delete($,Z,X){let{skill_id:z,betas:J}=Z;return this._client.delete(A`/v1/skills/${z}/versions/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])})}}});var j1;var xZ=x(()=>{SZ();SZ();e();r();A1();Q0();j1=class j1 extends v{constructor(){super(...arguments);this.versions=new n4(this._client)}create($={},Z){let{betas:X,...z}=$??{};return this._client.post("/v1/skills?beta=true",I1({body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"skills-2025-10-02"].toString()},Z?.headers])},this._client,!1))}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/skills/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/skills?beta=true",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"skills-2025-10-02"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(A`/v1/skills/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}};j1.Versions=n4});var r4;var bZ=x(()=>{e();r();Q0();r4=class r4 extends v{create($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/vaults/${$}/credentials?beta=true`,{body:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}retrieve($,Z,X){let{vault_id:z,betas:J}=Z;return this._client.get(A`/v1/vaults/${z}/credentials/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{vault_id:z,betas:J,...Q}=Z;return this._client.post(A`/v1/vaults/${z}/credentials/${$}?beta=true`,{body:Q,...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(A`/v1/vaults/${$}/credentials?beta=true`,i,{query:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}delete($,Z,X){let{vault_id:z,betas:J}=Z;return this._client.delete(A`/v1/vaults/${z}/credentials/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z,X){let{vault_id:z,betas:J}=Z;return this._client.post(A`/v1/vaults/${z}/credentials/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var S1;var kZ=x(()=>{bZ();bZ();e();r();Q0();S1=class S1 extends v{constructor(){super(...arguments);this.credentials=new r4(this._client)}create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/vaults?beta=true",{body:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/vaults/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update($,Z,X){let{betas:z,...J}=Z;return this._client.post(A`/v1/vaults/${$}?beta=true`,{body:J,...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/vaults?beta=true",i,{query:z,...Z,headers:O([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(A`/v1/vaults/${$}?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive($,Z={},X){let{betas:z}=Z??{};return this._client.post(A`/v1/vaults/${$}/archive?beta=true`,{...X,headers:O([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};S1.Credentials=r4});var L0;var yZ=x(()=>{zZ();zZ();QZ();QZ();YZ();YZ();WZ();WZ();GZ();GZ();KZ();KZ();CZ();CZ();jZ();jZ();xZ();xZ();kZ();kZ();L0=class L0 extends v{constructor(){super(...arguments);this.models=new E4(this._client),this.messages=new T$(this._client),this.agents=new R1(this._client),this.environments=new _4(this._client),this.sessions=new v$(this._client),this.vaults=new S1(this._client),this.memoryStores=new y$(this._client),this.files=new w4(this._client),this.skills=new j1(this._client),this.userProfiles=new j4(this._client)}};L0.Models=E4;L0.Messages=T$;L0.Agents=R1;L0.Environments=_4;L0.Sessions=v$;L0.Vaults=S1;L0.MemoryStores=y$;L0.Files=w4;L0.Skills=j1;L0.UserProfiles=j4});var x1;var fZ=x(()=>{r();x1=class x1 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 RJ($){return $?.output_config?.format}function gZ($,Z,X){let z=RJ(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 vZ($,Z,X)}function vZ($,Z,X){let z=null,J=$.content.map((Q)=>{if(Q.type==="text"){let Y=wT(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 wT($,Z){let X=RJ($);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 hZ=x(()=>{O0()});function CJ($){return $.type==="tool_use"||$.type==="server_tool_use"}function wJ($){}var S0,D$,b1,s4,v6,a4,o4,h6,t4,Z$,e4,u6,m6,h$,c6,d6,$2,uZ,FJ,mZ,cZ,dZ,pZ,_J,PJ="__json_buf",Z2;var EJ=x(()=>{a0();F1();OZ();NZ();hZ();Z2=class Z2{constructor($,Z){S0.add(this),this.messages=[],this.receivedMessages=[],D$.set(this,void 0),b1.set(this,null),this.controller=new AbortController,s4.set(this,void 0),v6.set(this,()=>{}),a4.set(this,()=>{}),o4.set(this,void 0),h6.set(this,()=>{}),t4.set(this,()=>{}),Z$.set(this,{}),e4.set(this,!1),u6.set(this,!1),m6.set(this,!1),h$.set(this,!1),c6.set(this,void 0),d6.set(this,void 0),$2.set(this,void 0),mZ.set(this,(X)=>{if(_(this,u6,!0,"f"),o0(X))X=new K0;if(X instanceof K0)return _(this,m6,!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)))}),_(this,s4,new Promise((X,z)=>{_(this,v6,X,"f"),_(this,a4,z,"f")}),"f"),_(this,o4,new Promise((X,z)=>{_(this,h6,X,"f"),_(this,t4,z,"f")}),"f"),M(this,s4,"f").catch(()=>{}),M(this,o4,"f").catch(()=>{}),_(this,b1,$,"f"),_(this,$2,Z?.logger??console,"f")}get response(){return M(this,c6,"f")}get request_id(){return M(this,d6,"f")}async withResponse(){_(this,h$,!0,"f");let $=await M(this,s4,"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 _(J,b1,{...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,mZ,"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 W of Y)M(this,S0,"m",dZ).call(this,W);if(Y.controller.signal?.aborted)throw new K0;M(this,S0,"m",pZ).call(this)}finally{if(z&&J)z.removeEventListener("abort",J)}}_connected($){if(this.ended)return;_(this,c6,$,"f"),_(this,d6,$?.headers.get("request-id"),"f"),M(this,v6,"f").call(this,$),this._emit("connect")}get ended(){return M(this,e4,"f")}get errored(){return M(this,u6,"f")}get aborted(){return M(this,m6,"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(_(this,h$,!0,"f"),$!=="error")this.once("error",X);this.once($,Z)})}async done(){_(this,h$,!0,"f"),await M(this,o4,"f")}get currentMessage(){return M(this,D$,"f")}async finalMessage(){return await this.done(),M(this,S0,"m",uZ).call(this)}async finalText(){return await this.done(),M(this,S0,"m",FJ).call(this)}_emit($,...Z){if(M(this,e4,"f"))return;if($==="end")_(this,e4,!0,"f"),M(this,h6,"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,a4,"f").call(this,z),M(this,t4,"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,a4,"f").call(this,z),M(this,t4,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",M(this,S0,"m",uZ).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",dZ).call(this,Q);if(J.controller.signal?.aborted)throw new K0;M(this,S0,"m",pZ).call(this)}finally{if(X&&z)X.removeEventListener("abort",z)}}[(D$=new WeakMap,b1=new WeakMap,s4=new WeakMap,v6=new WeakMap,a4=new WeakMap,o4=new WeakMap,h6=new WeakMap,t4=new WeakMap,Z$=new WeakMap,e4=new WeakMap,u6=new WeakMap,m6=new WeakMap,h$=new WeakMap,c6=new WeakMap,d6=new WeakMap,$2=new WeakMap,mZ=new WeakMap,S0=new WeakSet,uZ=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(" ")},cZ=function(){if(this.ended)return;_(this,D$,void 0,"f")},dZ=function(Z){if(this.ended)return;let X=M(this,S0,"m",_J).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(CJ(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:wJ(Z.delta)}break}case"message_stop":{this._addMessageParam(X),this._addMessage(gZ(X,M(this,b1,"f"),{logger:M(this,$2,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",X.content.at(-1));break}case"message_start":{_(this,D$,X,"f");break}case"content_block_start":case"message_delta":break}},pZ=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 _(this,D$,void 0,"f"),gZ(Z,M(this,b1,"f"),{logger:M(this,$2,"f")})},_J=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.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&&CJ(z)){let J=z[PJ]||"";J+=Z.delta.partial_json;let Q={...z};if(Object.defineProperty(Q,PJ,{value:J,enumerable:!1,writable:!0}),J)Q.input=E6(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:wJ(Z.delta)}return X}case"content_block_stop":return X}},Symbol.asyncIterator)](){let $=[],Z=[],X=!1;return this.on("streamEvent",(z)=>{let J=Z.shift();if(J)J.resolve(z);else $.push(z)}),this.on("end",()=>{X=!0;for(let z of Z)z.resolve(void 0);Z.length=0}),this.on("abort",(z)=>{X=!0;for(let J of Z)J.reject(z);Z.length=0}),this.on("error",(z)=>{X=!0;for(let J of Z)J.reject(z);Z.length=0}),{next:async()=>{if(!$.length){if(X)return{value:void 0,done:!0};return new Promise((J,Q)=>Z.push({resolve:J,reject:Q})).then((J)=>J?{value:J,done:!1}:{value:void 0,done:!0})}return{value:$.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}toReadableStream(){return new P0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var X2;var lZ=x(()=>{e();r();_Z();F1();Q0();X2=class X2 extends v{create($,Z){return this._client.post("/v1/messages/batches",{body:$,...Z})}retrieve($,Z){return this._client.get(A`/v1/messages/batches/${$}`,Z)}list($={},Z){return this._client.getAPIList("/v1/messages/batches",f0,{query:$,...Z})}delete($,Z){return this._client.delete(A`/v1/messages/batches/${$}`,Z)}cancel($,Z){return this._client.post(A`/v1/messages/batches/${$}/cancel`,Z)}async results($,Z){let X=await this.retrieve($);if(!X.results_url)throw new S(`No batch \`results_url\`; Has it finished processing? ${X.processing_status} - ${X.id}`);return this._client.get(X.results_url,{...Z,headers:O([{Accept:"application/binary"},Z?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((z,J)=>E1.fromResponse(J.response,J.controller))}}});var u$,jJ,jT;var iZ=x(()=>{r();C4();EJ();hZ();lZ();lZ();HZ();u$=class u$ extends v{constructor(){super(...arguments);this.batches=new X2(this._client)}create($,Z){if($.model in jJ)console.warn(`The model '${$.model}' is deprecated and will reach end-of-life on ${jJ[$.model]}
197
+ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(jT.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=w6[$.model]??void 0;X=this._client.calculateNonstreamingTimeout($.max_tokens,J)}let z=C6($.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)=>vZ(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})}};jJ={"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"},jT=["claude-mythos-preview","claude-opus-4-6"];u$.Batches=X2});var k1;var nZ=x(()=>{e();r();Q0();k1=class k1 extends v{retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(A`/v1/models/${$}`,{...X,headers:O([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/models",f0,{query:z,...Z,headers:O([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers])})}}});var SJ=x(()=>{yZ();fZ();iZ();nZ();QJ()});var z2=($)=>{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:$=z2("ANTHROPIC_BASE_URL"),apiKey:Z=z2("ANTHROPIC_API_KEY")??null,authToken:X=z2("ANTHROPIC_AUTH_TOKEN")??null,...z}={}){rZ.add(this),p6.set(this,void 0);let J={apiKey:Z,authToken:X,...z,baseURL:$||"https://api.anthropic.com"};if(!J.dangerouslyAllowBrowser&&dz())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??lZ.DEFAULT_TIMEOUT,this.logger=J.logger??console;let Q="warn";this.logLevel=Q,this.logLevel=d3(J.logLevel,"ClientOptions.logLevel",this)??d3(X2("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??Q,this.fetchOptions=J.fetchOptions,this.maxRetries=J.maxRetries??2,this.fetch=J.fetch??bz(),_(this,d6,yz,"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 fz($)}getUserAgent(){return`${this.constructor.name}/JS ${B$}`}defaultIdempotencyKey(){return`stainless-node-retry-${y3()}`}makeStatusError($,Z,X,z){return J0.generate($,Z,X,z)}buildURL($,Z,X){let z=!M(this,pZ,"m",DJ).call(this)&&X||this.baseURL,J=Fz($)?new URL($):new URL(z+(z.endsWith("/")&&$.startsWith("/")?$.slice(1):$)),Q=this.defaultQuery(),Y=Object.fromEntries(J.searchParams);if(!v3(Q)||!v3(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 M$(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(V0(this).debug(`[${W}] sending request`,t0({retryOfRequestLogID:X,method:z.method,url:Y,options:z,headers:Q.headers})),z.signal?.aborted)throw new K0;let V=new AbortController,K=await this.fetchWithTimeout(Y,Q,U,V).catch(L4),H=Date.now();if(K instanceof globalThis.Error){let N=`retrying, ${Z} attempts remaining`;if(z.signal?.aborted)throw new K0;let P=o0(K)||/timed? ?out/i.test(String(K)+("cause"in K?String(K.cause):""));if(Z)return V0(this).info(`[${W}] connection ${P?"timed out":"failed"} - ${N}`),V0(this).debug(`[${W}] connection ${P?"timed out":"failed"} (${N})`,t0({retryOfRequestLogID:X,url:Y,durationMs:H-q,message:K.message})),this.retryRequest(z,Z,X??W);if(V0(this).info(`[${W}] connection ${P?"timed out":"failed"} - error; no more retries left`),V0(this).debug(`[${W}] connection ${P?"timed out":"failed"} (error; no more retries left)`,t0({retryOfRequestLogID:X,url:Y,durationMs:H-q,message:K.message})),P)throw new V1;throw new H$({cause:K})}let T=[...K.headers.entries()].filter(([N])=>N==="request-id").map(([N,P])=>", "+N+": "+JSON.stringify(P)).join(""),L=`[${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 kz(K.body),V0(this).info(`${L} - ${y}`),V0(this).debug(`[${W}] response error (${y})`,t0({retryOfRequestLogID:X,url:K.url,status:K.status,headers:K.headers,durationMs:H-q})),this.retryRequest(z,Z,X??W,K.headers)}let P=N?"error; no more retries left":"error; not retryable";V0(this).info(`${L} - ${P}`);let C=await K.text().catch((y)=>L4(y).message),j=N6(C),b=j?void 0:C;throw V0(this).debug(`[${W}] response error (${P})`,t0({retryOfRequestLogID:X,url:K.url,status:K.status,headers:K.headers,message:b,durationMs:Date.now()-q})),this.makeStatusError(K.status,j,b,K.headers)}return V0(this).info(L),V0(this).debug(`[${W}] response start`,t0({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 I4(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 Cz(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)Pz("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))}:{},...xz(),...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:O6($)};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,d6,"f").call(this,{body:$,headers:X})}}var pZ,lZ,d6,DJ,iZ="\\n\\nHuman:",nZ="\\n\\nAssistant:",I$;var rZ=x(()=>{a0();b$();h3();gz();O0();e();t3();TJ();R6();xZ();dZ();SZ();cZ();h3();r();I6();b$();lZ=o,d6=new WeakMap,pZ=new WeakSet,DJ=function(){return this.baseURL!=="https://api.anthropic.com"};o.Anthropic=lZ;o.HUMAN_PROMPT=iZ;o.AI_PROMPT=nZ;o.DEFAULT_TIMEOUT=600000;o.AnthropicError=S;o.APIError=J0;o.APIConnectionError=H$;o.APIConnectionTimeoutError=V1;o.APIUserAbortError=K0;o.NotFoundError=L1;o.ConflictError=M1;o.RateLimitError=O1;o.BadRequestError=K1;o.AuthenticationError=H1;o.InternalServerError=T1;o.PermissionDeniedError=B1;o.UnprocessableEntityError=N1;o.toFile=R4;I$=class I$ extends o{constructor(){super(...arguments);this.completions=new S1(this),this.messages=new u$(this),this.models=new b1(this),this.beta=new L0(this)}};I$.Completions=S1;I$.Messages=u$;I$.Models=b1;I$.Beta=L0});var IJ={};X5(IJ,{toFile:()=>R4,default:()=>I$,UnprocessableEntityError:()=>N1,RateLimitError:()=>O1,PermissionDeniedError:()=>B1,PagePromise:()=>I4,NotFoundError:()=>L1,InternalServerError:()=>T1,HUMAN_PROMPT:()=>iZ,ConflictError:()=>M1,BaseAnthropic:()=>o,BadRequestError:()=>K1,AuthenticationError:()=>H1,AnthropicError:()=>S,Anthropic:()=>I$,APIUserAbortError:()=>K0,APIPromise:()=>M$,APIError:()=>J0,APIConnectionTimeoutError:()=>V1,APIConnectionError:()=>H$,AI_PROMPT:()=>nZ});var AJ=x(()=>{rZ();t3();R6();rZ();e();O0()});var T5=iJ(O5(),1),{program:LD,createCommand:MD,createArgument:ND,createOption:OD,CommanderError:TD,InvalidArgumentError:DD,InvalidOptionArgumentError:ID,Command:D5,Argument:AD,Option:RD,Help:FD}=T5.default;import{readFileSync as S9,writeFileSync as kB,existsSync as E9}from"fs";import{join as j9,dirname as yB}from"path";var oH=t8(),tH=e1(),eH=f8(),q3=$4(),$B=v1(),q$=d(),ZB=Q$(),XB=Z0(),zB=U$(),JB=W$(),dI=p2(),QB=U3(),YB=W3(),UB=G3(),n2=C9(),w9=f1();var WB=oH.Composer,GB=tH.Document,qB=eH.Schema,VB=q3.YAMLError,KB=q3.YAMLParseError,HB=q3.YAMLWarning,BB=$B.Alias,LB=q$.isAlias,MB=q$.isCollection,NB=q$.isDocument,OB=q$.isMap,TB=q$.isNode,DB=q$.isPair,IB=q$.isScalar,AB=q$.isSeq,RB=ZB.Pair,FB=XB.Scalar,_B=zB.YAMLMap,PB=JB.YAMLSeq;var CB=QB.Lexer,wB=YB.LineCounter,EB=UB.Parser,l0=n2.parse,jB=n2.parseAllDocuments,SB=n2.parseDocument,V3=n2.stringify,xB=w9.visit,bB=w9.visitAsync;function m($){let Z=S9($,"utf-8");return l0(Z)}function K3($){let Z=$._meta,X={...$};delete X._meta;let z=V3(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){kB($,K3(Z),"utf-8")}function h($){return S9($,"utf-8")}function x9($){return l0($)}function v($=process.cwd()){let Z=["project.faf",".faf"];for(let z of Z){let J=j9($,z);if(E9(J))return J}let X=yB($);if(X!==$)for(let z of Z){let J=j9(X,z);if(E9(J))return J}return null}c();var t$=[{name:"TROPHY",indicator:`${H0("\uD83C\uDFC6")} ${H0("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${H0(I("★"))} ${H0("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${D("◆")} ${D("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${r2("◇")} ${r2("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${I("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${B("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${B("○")} RED`,threshold:1},{name:"WHITE",indicator:`${B("♡")}`,threshold:0}];function k0($){return $.indicator}function V$($){for(let Z of t$)if($>=Z.threshold)return Z;return t$[t$.length-1]}var B3=null;function U4(){if(B3)return B3;try{let $=D0("faf-scoring-kernel");return B3=$,$}catch{throw Error(`faf-scoring-kernel not installed.
204
+ `);this.baseURL=J.baseURL,this.timeout=J.timeout??sZ.DEFAULT_TIMEOUT,this.logger=J.logger??console;let Q="warn";this.logLevel=Q,this.logLevel=n3(J.logLevel,"ClientOptions.logLevel",this)??n3(z2("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??Q,this.fetchOptions=J.fetchOptions,this.maxRetries=J.maxRetries??2,this.fetch=J.fetch??lz(),_(this,p6,nz,"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 rz($)}getUserAgent(){return`${this.constructor.name}/JS ${B$}`}defaultIdempotencyKey(){return`stainless-node-retry-${h3()}`}makeStatusError($,Z,X,z){return J0.generate($,Z,X,z)}buildURL($,Z,X){let z=!M(this,rZ,"m",xJ).call(this)&&X||this.baseURL,J=fz($)?new URL($):new URL(z+(z.endsWith("/")&&$.startsWith("/")?$.slice(1):$)),Q=this.defaultQuery(),Y=Object.fromEntries(J.searchParams);if(!c3(Q)||!c3(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 M$(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:W}=await this.buildRequest(z,{retryCount:J-Z});await this.prepareRequest(Q,{url:Y,options:z});let U="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),G=X===void 0?"":`, retryOf: ${X}`,q=Date.now();if(V0(this).debug(`[${U}] sending request`,t0({retryOfRequestLogID:X,method:z.method,url:Y,options:z,headers:Q.headers})),z.signal?.aborted)throw new K0;let V=new AbortController,K=await this.fetchWithTimeout(Y,Q,W,V).catch(M4),H=Date.now();if(K instanceof globalThis.Error){let N=`retrying, ${Z} attempts remaining`;if(z.signal?.aborted)throw new K0;let P=o0(K)||/timed? ?out/i.test(String(K)+("cause"in K?String(K.cause):""));if(Z)return V0(this).info(`[${U}] connection ${P?"timed out":"failed"} - ${N}`),V0(this).debug(`[${U}] connection ${P?"timed out":"failed"} (${N})`,t0({retryOfRequestLogID:X,url:Y,durationMs:H-q,message:K.message})),this.retryRequest(z,Z,X??U);if(V0(this).info(`[${U}] connection ${P?"timed out":"failed"} - error; no more retries left`),V0(this).debug(`[${U}] connection ${P?"timed out":"failed"} (error; no more retries left)`,t0({retryOfRequestLogID:X,url:Y,durationMs:H-q,message:K.message})),P)throw new K1;throw new H$({cause:K})}let T=[...K.headers.entries()].filter(([N])=>N==="request-id").map(([N,P])=>", "+N+": "+JSON.stringify(P)).join(""),B=`[${U}${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 iz(K.body),V0(this).info(`${B} - ${y}`),V0(this).debug(`[${U}] response error (${y})`,t0({retryOfRequestLogID:X,url:K.url,status:K.status,headers:K.headers,durationMs:H-q})),this.retryRequest(z,Z,X??U,K.headers)}let P=N?"error; no more retries left":"error; not retryable";V0(this).info(`${B} - ${P}`);let C=await K.text().catch((y)=>M4(y).message),j=O6(C),b=j?void 0:C;throw V0(this).debug(`[${U}] response error (${P})`,t0({retryOfRequestLogID:X,url:K.url,status:K.status,headers:K.headers,message:b,durationMs:Date.now()-q})),this.makeStatusError(K.status,j,b,K.headers)}return V0(this).info(B),V0(this).debug(`[${U}] response start`,t0({retryOfRequestLogID:X,url:K.url,status:K.status,headers:K.headers,durationMs:H-q})),{response:K,options:z,controller:V,requestLogID:U,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 A4(this,X,$)}async fetchWithTimeout($,Z,X,z){let{signal:J,method:Q,...Y}=Z||{},W=this._makeAbort(z);if(J)J.addEventListener("abort",W,{once:!0});let U=setTimeout(W,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(U)}}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 W=parseFloat(Q);if(!Number.isNaN(W))J=W}let Y=z?.get("retry-after");if(Y&&!J){let W=parseFloat(Y);if(!Number.isNaN(W))J=W*1000;else J=Date.parse(Y)-Date.now()}if(J===void 0){let W=$.maxRetries??this.maxRetries;J=this.calculateDefaultRetryTimeoutMillis(Z,W)}return await hz(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,W=this.buildURL(J,Q,Y);if("timeout"in X)vz("timeout",X.timeout);X.timeout=X.timeout??this.timeout;let{bodyHeaders:U,body:G}=this.buildBody({options:X}),q=await this.buildHeaders({options:$,method:z,bodyHeaders:U,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:W,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))}:{},...pz(),...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:T6($)};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,p6,"f").call(this,{body:$,headers:X})}}var rZ,sZ,p6,xJ,aZ="\\n\\nHuman:",oZ="\\n\\nAssistant:",I$;var tZ=x(()=>{a0();b$();d3();sz();O0();e();XZ();SJ();F6();fZ();nZ();yZ();iZ();d3();r();A6();b$();sZ=o,p6=new WeakMap,rZ=new WeakSet,xJ=function(){return this.baseURL!=="https://api.anthropic.com"};o.Anthropic=sZ;o.HUMAN_PROMPT=aZ;o.AI_PROMPT=oZ;o.DEFAULT_TIMEOUT=600000;o.AnthropicError=S;o.APIError=J0;o.APIConnectionError=H$;o.APIConnectionTimeoutError=K1;o.APIUserAbortError=K0;o.NotFoundError=M1;o.ConflictError=N1;o.RateLimitError=T1;o.BadRequestError=H1;o.AuthenticationError=B1;o.InternalServerError=D1;o.PermissionDeniedError=L1;o.UnprocessableEntityError=O1;o.toFile=F4;I$=class I$ extends o{constructor(){super(...arguments);this.completions=new x1(this),this.messages=new u$(this),this.models=new k1(this),this.beta=new L0(this)}};I$.Completions=x1;I$.Messages=u$;I$.Models=k1;I$.Beta=L0});var bJ={};Y5(bJ,{toFile:()=>F4,default:()=>I$,UnprocessableEntityError:()=>O1,RateLimitError:()=>T1,PermissionDeniedError:()=>L1,PagePromise:()=>A4,NotFoundError:()=>M1,InternalServerError:()=>D1,HUMAN_PROMPT:()=>aZ,ConflictError:()=>N1,BaseAnthropic:()=>o,BadRequestError:()=>H1,AuthenticationError:()=>B1,AnthropicError:()=>S,Anthropic:()=>I$,APIUserAbortError:()=>K0,APIPromise:()=>M$,APIError:()=>J0,APIConnectionTimeoutError:()=>K1,APIConnectionError:()=>H$,AI_PROMPT:()=>oZ});var kJ=x(()=>{tZ();XZ();F6();tZ();e();O0()});var R5=JQ(A5(),1),{program:PD,createCommand:CD,createArgument:wD,createOption:ED,CommanderError:jD,InvalidArgumentError:SD,InvalidOptionArgumentError:xD,Command:F5,Argument:bD,Option:kD,Help:yD}=R5.default;import{readFileSync as y9,writeFileSync as iB,existsSync as b9}from"fs";import{join as k9,dirname as f9,basename as nB}from"path";import{execFileSync as rB}from"child_process";var GB=e8(),qB=$4(),VB=g8(),V3=Z4(),KB=h1(),q$=d(),HB=Q$(),BB=Z0(),LB=W$(),MB=U$(),$A=l2(),NB=U3(),OB=G3(),TB=q3(),r2=S9(),x9=g1();var DB=GB.Composer,IB=qB.Document,AB=VB.Schema,RB=V3.YAMLError,FB=V3.YAMLParseError,_B=V3.YAMLWarning,PB=KB.Alias,CB=q$.isAlias,wB=q$.isCollection,EB=q$.isDocument,jB=q$.isMap,SB=q$.isNode,xB=q$.isPair,bB=q$.isScalar,kB=q$.isSeq,yB=HB.Pair,fB=BB.Scalar,gB=LB.YAMLMap,vB=MB.YAMLSeq;var hB=NB.Lexer,uB=OB.LineCounter,mB=TB.Parser,l0=r2.parse,cB=r2.parseAllDocuments,dB=r2.parseDocument,K3=r2.stringify,pB=x9.visit,lB=x9.visitAsync;function m($){let Z=y9($,"utf-8");return l0(Z)}function H3($){let Z=$._meta,X={...$};delete X._meta;let z=K3(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,W)=>{if(W.includes("#"))return Q;return`${Y} # found: ${J}`})}return z}function s($,Z){iB($,H3(Z),"utf-8")}function h($){return y9($,"utf-8")}function g9($){return l0($)}function g($=process.cwd()){let Z=["project.faf",".faf"];for(let z of Z){let J=k9($,z);if(b9(J))return J}let X=f9($);if(X!==$)for(let z of Z){let J=k9(X,z);if(b9(J))return J}return null}function t$($,Z=process.cwd()){return rB("git",["-C",f9($),"rev-parse","--show-prefix"],{cwd:Z,encoding:"utf-8"}).trim()+nB($)}c();var e$=[{name:"TROPHY",indicator:`${H0("\uD83C\uDFC6")} ${H0("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${H0(I("★"))} ${H0("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${D("◆")} ${D("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${s2("◇")} ${s2("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${I("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${L("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${L("○")} RED`,threshold:1},{name:"WHITE",indicator:`${L("♡")}`,threshold:0}];function k0($){return $.indicator}function V$($){for(let Z of e$)if($>=Z.threshold)return Z;return e$[e$.length-1]}var L3=null;function U4(){if(L3)return L3;try{let $=D0("faf-scoring-kernel");return L3=$,$}catch{throw Error(`faf-scoring-kernel not installed.
205
205
 
206
206
  Run: npm install faf-scoring-kernel
207
- `)}}function U0($){return JSON.parse(U4().score_faf($))}function k9($){return U4().validate_faf($)}function s2($){return U4().compile_fafb($)}function y9($){return JSON.parse(U4().decompile_fafb($))}function f9(){return U4().sdk_version()}function q0($){return{score:$.score,tier:V$($.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?V$(J):t$[t$.length-1],populated:0,empty:0,ignored:0,active:0,total:0,slots:{},inherited:!0,represents:Y}}return q0(U0($))}c();function z0($,Z,X=!1){let z=k0($.tier),J=I(`${$.score}%`);if(console.log(`${z} ${J} ${B(`${$.populated}/${$.active} slots`)} ${B("—")} ${Z}`),$.tier.name==="TROPHY")console.log(B(" Trophy. AI never has to guess."));else if($.empty>0){let Q=Object.entries($.slots).filter(([,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(B(` ${$.empty} ${W} from Trophy: ${Y}${U}`))}if(X)console.log(""),gB($)}function gB($){for(let[Z,X]of Object.entries($.slots)){let z=X==="populated"?D("●"):X==="slotignored"?B("—"):B("○");console.log(` ${z} ${X==="slotignored"?B(Z):Z}`)}}c();function a2($,Z={}){let X=$??v();if(!X)console.error(`Error: project.faf not found
207
+ `)}}function W0($){return JSON.parse(U4().score_faf($))}function h9($){return U4().validate_faf($)}function a2($){return U4().compile_fafb($)}function u9($){return JSON.parse(U4().decompile_fafb($))}function m9(){return U4().sdk_version()}function q0($){return{score:$.score,tier:V$($.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?V$(J):e$[e$.length-1],populated:0,empty:0,ignored:0,active:0,total:0,slots:{},inherited:!0,represents:Y}}return q0(W0($))}c();function z0($,Z,X=!1){let z=k0($.tier),J=I(`${$.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(", "),W=Q.length>3?`, +${Q.length-3} more`:"",U=$.empty===1?"slot":"slots";console.log(L(` ${$.empty} ${U} from Trophy: ${Y}${W}`))}if(X)console.log(""),aB($)}function aB($){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}`)}}c();function o2($,Z={}){let X=$??g();if(!X)console.error(`Error: project.faf not found
208
208
 
209
- Run 'faf init' to create one.`),process.exit(2);let z=h(X),J=X0(z);if(Z.json){let Q=m(X),Y={faf_version:Q.faf_version??"unknown",project:Q.project?.name??"unknown",source:X,...J};console.log(JSON.stringify(Y,null,2));return}if(Z.status){console.log(`${k0(J.tier)} ${I(`${J.score}%`)}`);return}z0(J,X,Z.verbose)}import{existsSync as ZM}from"fs";import{join as JX}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"}],e$=new Map(a.flatMap(($)=>$.canonical?[[$.path,$],[$.canonical,$]]:[[$.path,$]])),GA=new Map(a.filter(($)=>$.canonical).map(($)=>[$.canonical,$.path])),qA=new Map(a.filter(($)=>$.canonical).map(($)=>[$.path,$.canonical]));function W4($,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 VA=a.filter(($)=>$.index<=21);var L3=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 L3.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var $1={about:[],documentation:["project","human"],intent:["project","human"],encyclopedia:["project","human"],cli:["project","human","universal"],library:["project","human","universal"],sdk:["project","human","universal"],wasm:["project","human","universal"],html:["project","human","universal"],"server-card":["project","human","universal"],frontend:["project","frontend","human","universal"],website:["project","frontend","human","universal"],mobile:["project","frontend","human","universal"],extension:["project","frontend","human","universal"],mcp:["project","backend","human","universal"],backend:["project","backend","universal","human"],"data-science":["project","backend","human","universal"],fullstack:["project","frontend","backend","universal","human"],svelte:["project","frontend","backend","universal","human"],framework:["project","frontend","backend","universal","human"],"monorepo-root":["project","human","enterprise_infra","enterprise_app","enterprise_ops"],mcpaas:["project","backend","universal","human","enterprise_app","enterprise_ops"],saas:["project","frontend","backend","universal","human","enterprise_app"],enterprise:["project","frontend","backend","universal","human","enterprise_infra","enterprise_app","enterprise_ops"]};import{existsSync as E,readFileSync as i0,readdirSync as h9}from"fs";import{join as w}from"path";var g9=[{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 v9,readFileSync as hB,readdirSync as uB}from"fs";import{join as M3}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 mB=Z1.flutterDeps,cB=Z1.mcpDeps,dB=Z1.serverFrameworks,pB=Z1.stateManagement,lB=Z1.routing;function iB($){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 o2($){let Z=M3($,"pubspec.yaml");if(!v9(Z))return null;let X;try{X=hB(Z,"utf-8")}catch{return null}let z=iB(X),J=(j)=>z.has(j.toLowerCase()),Q=mB.some(J)||/^flutter:\s*$/m.test(X)||/\bsdk:\s*flutter\b/.test(X),Y=cB.find(J),U=dB.find(([j])=>J(j)),W=pB.find(([j])=>J(j)),G=W?W[1]:"",q=lB.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=uB(M3($,"bin")).some((j)=>j.endsWith(".dart"))}catch{}let L=H||T,N,P="",C;if(Q)if(P="Flutter",v9(M3($,"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",P=U[1],C=`pubspec.yaml + ${U[0]} (Dart backend)`;else if(L)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:P,stateManagement:G,routing:V,testing:K,found:C}}function nB($){let Z=w($,"Cargo.toml");if(!E(Z))return null;try{let z=i0(Z,"utf-8").match(/^\s*\[package\][\s\S]*?^\s*name\s*=\s*"([^"]+)"/m);return z?z[1]:null}catch{return null}}function rB($){let Z=w($,"Cargo.toml");if(!E(Z))return!1;try{let X=i0(Z,"utf-8");return/^\s*\[\[bin\]\]/m.test(X)}catch{return!1}}function sB($,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=nB($);if(X&&/(?:^|[-_])sdk(?:[-_]|$)/i.test(X))return`Cargo.toml name "${X}" → sdk`;return null}function aB($){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=w($,X);if(!E(z))continue;try{let J=JSON.parse(i0(z,"utf-8"));if(typeof J.manifest_version==="number")return`${X} manifest_version ${J.manifest_version} (browser extension)`}catch{}}return null}function oB($){let Z=/(numpy|pandas|jupyter|scikit-learn|sklearn|pytorch|tensorflow|matplotlib|scipy)/i,X=w($,"pyproject.toml");if(E(X))try{let Q=i0(X,"utf-8").match(Z);if(Q)return`pyproject.toml depends on ${Q[1]}`}catch{}let z=w($,"requirements.txt");if(E(z))try{let Q=i0(z,"utf-8").match(Z);if(Q)return`requirements.txt contains ${Q[1]}`}catch{}return null}function tB($,Z){let X=["react-native","expo","@capacitor/core","@ionic/core"];if(Z){for(let z of X)if(Z.dependencies?.[z]||Z.devDependencies?.[z])return`${z} dependency`}if(E(w($,"ios"))&&E(w($,"android")))return"ios/ + android/ dirs";return null}function eB($,Z){let X=w($,"Cargo.toml");if(E(X))try{let J=i0(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=w($,"build.zig");if(E(z))try{let J=i0(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 $L($,Z){if(!E(w($,"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 ZL($,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 XL($,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 zL($,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 JL($,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 QL($,Z){if(!Z?.private)return null;if(!(!!Z.workspaces||E(w($,"pnpm-workspace.yaml"))))return null;return"private workspace + multi-package"}function E$($){let Z=w($,"package.json");if(!E(Z))return null;try{return JSON.parse(i0(Z,"utf-8"))}catch{return null}}function YL($,Z){if(!Z.includes("*"))return E(w($,Z));let X=Z.split("/");if(X.length===1){let U=Z.split("*")[0];try{return h9($).some((W)=>W.startsWith(U))}catch{return!1}}let z=w($,...X.slice(0,-1)),J=X[X.length-1],Q=J.split("*")[0],Y=J.split("*")[1]||"";try{return h9(z).some((U)=>U.startsWith(Q)&&U.endsWith(Y))}catch{return!1}}function UL($,Z,X){switch($.type){case"dependency":return!!Z?.dependencies?.[$.key];case"devDependency":return!!Z?.devDependencies?.[$.key];case"file":return YL(X,$.pattern);default:return!1}}function N3($){let Z=E$($);return g9.map((X)=>{let J=X.signals.filter((Q)=>UL(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 u9($){let Z=E$($);if(Z?.devDependencies?.typescript||Z?.dependencies?.typescript)return"TypeScript";if(E(w($,"tsconfig.json")))return"TypeScript";if(E(w($,"Cargo.toml")))return"Rust";if(E(w($,"go.mod")))return"Go";if(E(w($,"pyproject.toml"))||E(w($,"setup.py")))return"Python";if(E(w($,"Gemfile")))return"Ruby";if(E(w($,"pom.xml"))||E(w($,"build.gradle")))return"Java";if(E(w($,"Package.swift")))return"Swift";if(E(w($,"build.zig")))return"Zig";if(E(w($,"pubspec.yaml")))return"Dart";if(Z)return"JavaScript";return"Unknown"}function m9($){let Z=E$($),X=N3($),z=[],J=ZL($,Z);if(J)return z.push(J),{type:"documentation",found:z};let Q=sB($,Z);if(Q)return z.push(Q),{type:"sdk",found:z};let Y=aB($);if(Y)return z.push(Y),{type:"extension",found:z};let U=JL($,Z,X);if(U)return z.push(U),{type:"mcpaas",found:z};let W=zL($,Z);if(W)return z.push(W),{type:"saas",found:z};let G=eB($,Z);if(G)return z.push(G),{type:"wasm",found:z};let q=o2($);if(q)return z.push(q.found),{type:q.appType,found:z};let V=tB($,Z);if(V)return z.push(V),{type:"mobile",found:z};if(X.some((R)=>R.slug==="mcp"))return z.push("MCP SDK signal"),{type:"mcp",found:z};if(Z?.bin)return z.push("package.json bin"),{type:"cli",found:z};if(rB($))return z.push("Cargo.toml [[bin]]"),{type:"cli",found:z};if(E(w($,"build.zig"))){if(z.push("build.zig"),E(w($,"src/main.zig")))return z.push("src/main.zig"),{type:"cli",found:z};if(E(w($,"src/root.zig")))return z.push("src/root.zig"),{type:"library",found:z}}let H=X.some((R)=>R.slug==="svelte"||R.slug==="sveltekit");if(Z?.private===!0&&(E(w($,"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 L=X.some((R)=>R.category==="frontend"),N=X.some((R)=>R.category==="backend");if(Z?.private&&(Z.workspaces||E(w($,"pnpm-workspace.yaml")))&&L&&N)return z.push("private workspace + frontend + backend frameworks"),{type:"enterprise",found:z};let P=QL($,Z);if(P)return z.push(P),{type:"monorepo-root",found:z};let C=XL($,Z,X);if(C)return z.push(C),{type:"website",found:z};if(X.some((R)=>R.slug==="nextjs"||R.slug==="nuxt"))return z.push(X.find((R)=>R.slug==="nextjs")?"Next.js":"Nuxt"),{type:"fullstack",found:z};let b=X.some((R)=>R.category==="frontend"),k=X.some((R)=>R.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=oB($);if(y)return z.push(y),{type:"data-science",found:z};let p=$L($,Z);if(p)return z.push(p),{type:"html",found:z};if(Z?.main&&!Z?.bin)return z.push("package.json main (no bin)"),{type:"library",found:z};return z.push("no classifying signals — fallback"),{type:"library",found:z}}function c9($){if(E(w($,"bunfig.toml")))return"Bun";if(E(w($,"deno.json"))||E(w($,"deno.jsonc")))return"Deno";if(E$($))return"Node.js";if(E(w($,"Cargo.toml")))return"Rust";if(E(w($,"go.mod")))return"Go";if(E(w($,"pubspec.yaml")))return"Dart";return"Unknown"}function d9($){if(E(w($,"pubspec.yaml")))return"pub";if(E(w($,"bun.lockb"))||E(w($,"bun.lock")))return"bun";if(E(w($,"pnpm-lock.yaml")))return"pnpm";if(E(w($,"yarn.lock")))return"yarn";if(E(w($,"package-lock.json")))return"npm";return"npm"}function p9($){if(E(w($,".github/workflows")))return"GitHub Actions";if(E(w($,".gitlab-ci.yml")))return"GitLab CI";if(E(w($,".circleci")))return"CircleCI";if(E(w($,"Jenkinsfile")))return"Jenkins";return null}function l9($){if(E(w($,"vercel.json")))return"Vercel";if(E(w($,"netlify.toml")))return"Netlify";if(E(w($,"wrangler.toml")))return"Cloudflare";if(E(w($,"Dockerfile")))return"Docker";if(E(w($,"fly.toml")))return"Fly.io";if(E(w($,"render.yaml")))return"Render";return null}function i9($){let Z=w($,"svelte.config.js");if(!E(Z))return null;try{let z=i0(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 n9($){let Z=E$($);if(Z?.devDependencies?.vite||Z?.dependencies?.vite)return"Vite";if(Z?.devDependencies?.webpack||Z?.dependencies?.webpack)return"webpack";if(Z?.devDependencies?.esbuild||Z?.dependencies?.esbuild)return"esbuild";if(E(w($,"tsconfig.json"))&&Z?.devDependencies?.typescript)return"TypeScript (tsc)";return null}function r9($){return["package.json","Cargo.toml","pyproject.toml","go.mod","build.zig","build.zig.zon","src/index.ts","src/index.js","src/main.ts","src/cli.ts","src/main.rs","src/lib.rs","src/main.zig","src/root.zig","src/__init__.py","main.py","__main__.py","main.go","cmd/main.go","README.md","SPECIFICATION.md","BINARY-FORMAT.md","tsconfig.json","wrangler.toml","vercel.json"].filter((X)=>E(w($,X)))}function s9($,Z){let X={};if(Z?.scripts){for(let z of["build","test","lint","dev","start"])if(Z.scripts[z]){let J=E(w($,"bun.lock"))||E(w($,"bun.lockb"))?"bun run":"npm run";X[z]=`${J} ${z}`}}if(E(w($,"Cargo.toml"))){if(!X.build)X.build="cargo build --release";if(!X.test)X.test="cargo test";if(!X.lint)X.lint="cargo clippy"}if(E(w($,"build.zig"))){if(!X.build)X.build="zig build";if(!X.test)X.test="zig build test"}if(E(w($,"go.mod"))){if(!X.build)X.build="go build ./...";if(!X.test)X.test="go test ./..."}if(E(w($,"pyproject.toml"))||E(w($,"pytest.ini"))){if(!X.test)X.test="pytest"}return X}function a9($,Z,X,z){let J=[];if(z&&z!=="Unknown")J.push(z);let Q=new Set(["frontend","backend","database","build","css","state","monorepo"]);for(let Y of X)if(Q.has(Y.category))J.push(Y.name);if(E(w($,"bunfig.toml")))J.push("Bun");else if(E(w($,"deno.json"))||E(w($,"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 t2($){let Z=E$($),X=N3($),z=u9($),J=m9($),Q=J.type,Y=c9($),U=d9($),W=p9($),G=l9($),q=n9($),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"),L=X.find((n)=>n.category==="backend"),N=X.find((n)=>n.category==="database"),P=$1[Q]||$1.library,C=Q==="framework",j=X.some((n)=>n.slug==="svelte"||n.slug==="sveltekit"),b=C&&j?"svelte":C?null:null,k=Q==="svelte"||b==="svelte",y=k?i9($):null,p=k&&X.some((n)=>n.slug==="sveltekit"),R=new Set(["css_framework","ui_library","database","connection","hosting"]),u={},g0=a.filter((n)=>n.path.startsWith("stack."));for(let n of g0){let t=n.path.replace("stack.","");if(!P.includes(n.category)){u[t]="slotignored";continue}if(C&&R.has(t)){u[t]="slotignored";continue}switch(t){case"frontend":u[t]=V?.name??(Q==="cli"?"CLI":"");break;case"css_framework":u[t]=K?.name??"";break;case"ui_library":u[t]=H?.name??"";break;case"state_management":u[t]=k?T?.name??"Runes":T?.name??"";break;case"backend":u[t]=k?p?"SvelteKit":L?.name??"":L?.name??"";break;case"api_type":u[t]=p?"Server Routes":"";break;case"runtime":u[t]=Y!=="Unknown"?Y:"";break;case"database":u[t]=N?.name??"";break;case"connection":u[t]=N?.name??"";break;case"hosting":if(k&&y)u[t]=y;else u[t]=G??"";break;case"build":u[t]=k?"Vite":q??"";break;case"cicd":u[t]=W??"";break;case"package_manager":u[t]=U;break;default:u[t]="";break}}let v0={},$0=a.filter((n)=>n.path.startsWith("monorepo."));for(let n of $0){let t=n.path.replace("monorepo.","");if(!P.includes(n.category))v0[t]="slotignored";else v0[t]=""}let k1={name:Z?.name??$.split("/").pop()??"project",goal:Z?.description??"",main_language:z,type:Q};if(C&&b)k1.framework=b;let eZ=a9($,Z,X,z),$5=r9($),Z5=s9($,Z),J2={faf_version:"2.5.0",project:k1,stack:u,human_context:{who:"",what:Z?.description??"",why:"",where:"",when:"",how:""},monorepo:v0,_meta:{found:J.found}};if(eZ.length>0)J2.tech_stack=eZ;if($5.length>0)J2.key_files=$5;if(Object.keys(Z5).length>0)J2.commands=Z5;return J2}import{existsSync as GL,readFileSync as qL}from"fs";import{join as VL}from"path";var o9={MIN_LENGTH:8,MAX_LENGTH:280},WL=[/^(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 y0($){let Z=$.trim();if(Z.length<o9.MIN_LENGTH)return!1;if(Z.length>o9.MAX_LENGTH)return!1;if(WL.some((X)=>X.test(Z)))return!1;if(/^[\s|\-*+]/.test(Z))return!1;if(Z.split(`
211
- `).length>4)return!1;return!0}function KL($){let Z=$.split(`
209
+ Run 'faf init' to create one.`),process.exit(2);let z=h(X),J=X0(z);if(Z.json){let Q=m(X),Y={faf_version:Q.faf_version??"unknown",project:Q.project?.name??"unknown",source:X,...J};console.log(JSON.stringify(Y,null,2));return}if(Z.status){console.log(`${k0(J.tier)} ${I(`${J.score}%`)}`);return}z0(J,X,Z.verbose)}import{existsSync as BM}from"fs";import{join as GX}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"}],$1=new Map(a.flatMap(($)=>$.canonical?[[$.path,$],[$.canonical,$]]:[[$.path,$]])),IA=new Map(a.filter(($)=>$.canonical).map(($)=>[$.canonical,$.path])),AA=new Map(a.filter(($)=>$.canonical).map(($)=>[$.path,$.canonical]));function G4($,Z){let X=(J)=>{let Q=J.split("."),Y=$;for(let W of Q)if(Y&&typeof Y==="object"&&W in Y)Y=Y[W];else return;return Y},z=X(Z.path);if(z!==void 0)return z;if(Z.canonical)return X(Z.canonical);return}var RA=a.filter(($)=>$.index<=21);var M3=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 M3.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var Z1={about:[],documentation:["project","human"],intent:["project","human"],encyclopedia:["project","human"],cli:["project","human","universal"],library:["project","human","universal"],sdk:["project","human","universal"],wasm:["project","human","universal"],html:["project","human","universal"],"server-card":["project","human","universal"],frontend:["project","frontend","human","universal"],website:["project","frontend","human","universal"],mobile:["project","frontend","human","universal"],extension:["project","frontend","human","universal"],mcp:["project","backend","human","universal"],backend:["project","backend","universal","human"],"data-science":["project","backend","human","universal"],fullstack:["project","frontend","backend","universal","human"],svelte:["project","frontend","backend","universal","human"],framework:["project","frontend","backend","universal","human"],"monorepo-root":["project","human","enterprise_infra","enterprise_app","enterprise_ops"],mcpaas:["project","backend","universal","human","enterprise_app","enterprise_ops"],saas:["project","frontend","backend","universal","human","enterprise_app"],enterprise:["project","frontend","backend","universal","human","enterprise_infra","enterprise_app","enterprise_ops"]};import{existsSync as E,readFileSync as i0,readdirSync as p9}from"fs";import{join as w}from"path";var c9=[{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 d9,readFileSync as tB,readdirSync as eB}from"fs";import{join as N3}from"path";var X1={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 $L=X1.flutterDeps,ZL=X1.mcpDeps,XL=X1.serverFrameworks,zL=X1.stateManagement,JL=X1.routing;function QL($){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 t2($){let Z=N3($,"pubspec.yaml");if(!d9(Z))return null;let X;try{X=tB(Z,"utf-8")}catch{return null}let z=QL(X),J=(j)=>z.has(j.toLowerCase()),Q=$L.some(J)||/^flutter:\s*$/m.test(X)||/\bsdk:\s*flutter\b/.test(X),Y=ZL.find(J),W=XL.find(([j])=>J(j)),U=zL.find(([j])=>J(j)),G=U?U[1]:"",q=JL.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=eB(N3($,"bin")).some((j)=>j.endsWith(".dart"))}catch{}let B=H||T,N,P="",C;if(Q)if(P="Flutter",d9(N3($,"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(W)N="backend",P=W[1],C=`pubspec.yaml + ${W[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:P,stateManagement:G,routing:V,testing:K,found:C}}function YL($){let Z=w($,"Cargo.toml");if(!E(Z))return null;try{let z=i0(Z,"utf-8").match(/^\s*\[package\][\s\S]*?^\s*name\s*=\s*"([^"]+)"/m);return z?z[1]:null}catch{return null}}function WL($){let Z=w($,"Cargo.toml");if(!E(Z))return!1;try{let X=i0(Z,"utf-8");return/^\s*\[\[bin\]\]/m.test(X)}catch{return!1}}function UL($,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=YL($);if(X&&/(?:^|[-_])sdk(?:[-_]|$)/i.test(X))return`Cargo.toml name "${X}" → sdk`;return null}function GL($){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=w($,X);if(!E(z))continue;try{let J=JSON.parse(i0(z,"utf-8"));if(typeof J.manifest_version==="number")return`${X} manifest_version ${J.manifest_version} (browser extension)`}catch{}}return null}function qL($){let Z=/(numpy|pandas|jupyter|scikit-learn|sklearn|pytorch|tensorflow|matplotlib|scipy)/i,X=w($,"pyproject.toml");if(E(X))try{let Q=i0(X,"utf-8").match(Z);if(Q)return`pyproject.toml depends on ${Q[1]}`}catch{}let z=w($,"requirements.txt");if(E(z))try{let Q=i0(z,"utf-8").match(Z);if(Q)return`requirements.txt contains ${Q[1]}`}catch{}return null}function VL($,Z){let X=["react-native","expo","@capacitor/core","@ionic/core"];if(Z){for(let z of X)if(Z.dependencies?.[z]||Z.devDependencies?.[z])return`${z} dependency`}if(E(w($,"ios"))&&E(w($,"android")))return"ios/ + android/ dirs";return null}function KL($,Z){let X=w($,"Cargo.toml");if(E(X))try{let J=i0(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=w($,"build.zig");if(E(z))try{let J=i0(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 HL($,Z){if(!E(w($,"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 BL($,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 LL($,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 ML($,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((W)=>X[W]),Y=J.some((W)=>X[W]);if(Q&&Y)return"auth + payment dependencies";return null}function NL($,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 OL($,Z){if(!Z?.private)return null;if(!(!!Z.workspaces||E(w($,"pnpm-workspace.yaml"))))return null;return"private workspace + multi-package"}function E$($){let Z=w($,"package.json");if(!E(Z))return null;try{return JSON.parse(i0(Z,"utf-8"))}catch{return null}}function TL($,Z){if(!Z.includes("*"))return E(w($,Z));let X=Z.split("/");if(X.length===1){let W=Z.split("*")[0];try{return p9($).some((U)=>U.startsWith(W))}catch{return!1}}let z=w($,...X.slice(0,-1)),J=X[X.length-1],Q=J.split("*")[0],Y=J.split("*")[1]||"";try{return p9(z).some((W)=>W.startsWith(Q)&&W.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 TL(X,$.pattern);default:return!1}}function O3($){let Z=E$($);return c9.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 l9($){let Z=E$($);if(Z?.devDependencies?.typescript||Z?.dependencies?.typescript)return"TypeScript";if(E(w($,"tsconfig.json")))return"TypeScript";if(E(w($,"Cargo.toml")))return"Rust";if(E(w($,"go.mod")))return"Go";if(E(w($,"pyproject.toml"))||E(w($,"setup.py")))return"Python";if(E(w($,"Gemfile")))return"Ruby";if(E(w($,"pom.xml"))||E(w($,"build.gradle")))return"Java";if(E(w($,"Package.swift")))return"Swift";if(E(w($,"build.zig")))return"Zig";if(E(w($,"pubspec.yaml")))return"Dart";if(Z)return"JavaScript";return"Unknown"}function i9($){let Z=E$($),X=O3($),z=[],J=BL($,Z);if(J)return z.push(J),{type:"documentation",found:z};let Q=UL($,Z);if(Q)return z.push(Q),{type:"sdk",found:z};let Y=GL($);if(Y)return z.push(Y),{type:"extension",found:z};let W=NL($,Z,X);if(W)return z.push(W),{type:"mcpaas",found:z};let U=ML($,Z);if(U)return z.push(U),{type:"saas",found:z};let G=KL($,Z);if(G)return z.push(G),{type:"wasm",found:z};let q=t2($);if(q)return z.push(q.found),{type:q.appType,found:z};let V=VL($,Z);if(V)return z.push(V),{type:"mobile",found:z};if(X.some((R)=>R.slug==="mcp"))return z.push("MCP SDK signal"),{type:"mcp",found:z};if(Z?.bin)return z.push("package.json bin"),{type:"cli",found:z};if(WL($))return z.push("Cargo.toml [[bin]]"),{type:"cli",found:z};if(E(w($,"build.zig"))){if(z.push("build.zig"),E(w($,"src/main.zig")))return z.push("src/main.zig"),{type:"cli",found:z};if(E(w($,"src/root.zig")))return z.push("src/root.zig"),{type:"library",found:z}}let H=X.some((R)=>R.slug==="svelte"||R.slug==="sveltekit");if(Z?.private===!0&&(E(w($,"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((R)=>R.category==="frontend"),N=X.some((R)=>R.category==="backend");if(Z?.private&&(Z.workspaces||E(w($,"pnpm-workspace.yaml")))&&B&&N)return z.push("private workspace + frontend + backend frameworks"),{type:"enterprise",found:z};let P=OL($,Z);if(P)return z.push(P),{type:"monorepo-root",found:z};let C=LL($,Z,X);if(C)return z.push(C),{type:"website",found:z};if(X.some((R)=>R.slug==="nextjs"||R.slug==="nuxt"))return z.push(X.find((R)=>R.slug==="nextjs")?"Next.js":"Nuxt"),{type:"fullstack",found:z};let b=X.some((R)=>R.category==="frontend"),k=X.some((R)=>R.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=qL($);if(y)return z.push(y),{type:"data-science",found:z};let p=HL($,Z);if(p)return z.push(p),{type:"html",found:z};if(Z?.main&&!Z?.bin)return z.push("package.json main (no bin)"),{type:"library",found:z};return z.push("no classifying signals — fallback"),{type:"library",found:z}}function n9($){if(E(w($,"bunfig.toml")))return"Bun";if(E(w($,"deno.json"))||E(w($,"deno.jsonc")))return"Deno";if(E$($))return"Node.js";if(E(w($,"Cargo.toml")))return"Rust";if(E(w($,"go.mod")))return"Go";if(E(w($,"pubspec.yaml")))return"Dart";return"Unknown"}function r9($){if(E(w($,"pubspec.yaml")))return"pub";if(E(w($,"bun.lockb"))||E(w($,"bun.lock")))return"bun";if(E(w($,"pnpm-lock.yaml")))return"pnpm";if(E(w($,"yarn.lock")))return"yarn";if(E(w($,"package-lock.json")))return"npm";return"npm"}function s9($){if(E(w($,".github/workflows")))return"GitHub Actions";if(E(w($,".gitlab-ci.yml")))return"GitLab CI";if(E(w($,".circleci")))return"CircleCI";if(E(w($,"Jenkinsfile")))return"Jenkins";return null}function a9($){if(E(w($,"vercel.json")))return"Vercel";if(E(w($,"netlify.toml")))return"Netlify";if(E(w($,"wrangler.toml")))return"Cloudflare";if(E(w($,"Dockerfile")))return"Docker";if(E(w($,"fly.toml")))return"Fly.io";if(E(w($,"render.yaml")))return"Render";return null}function o9($){let Z=w($,"svelte.config.js");if(!E(Z))return null;try{let z=i0(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 t9($){let Z=E$($);if(Z?.devDependencies?.vite||Z?.dependencies?.vite)return"Vite";if(Z?.devDependencies?.webpack||Z?.dependencies?.webpack)return"webpack";if(Z?.devDependencies?.esbuild||Z?.dependencies?.esbuild)return"esbuild";if(E(w($,"tsconfig.json"))&&Z?.devDependencies?.typescript)return"TypeScript (tsc)";return null}function e9($){return["package.json","Cargo.toml","pyproject.toml","go.mod","build.zig","build.zig.zon","src/index.ts","src/index.js","src/main.ts","src/cli.ts","src/main.rs","src/lib.rs","src/main.zig","src/root.zig","src/__init__.py","main.py","__main__.py","main.go","cmd/main.go","README.md","SPECIFICATION.md","BINARY-FORMAT.md","tsconfig.json","wrangler.toml","vercel.json"].filter((X)=>E(w($,X)))}function $X($,Z){let X={};if(Z?.scripts){for(let z of["build","test","lint","dev","start"])if(Z.scripts[z]){let J=E(w($,"bun.lock"))||E(w($,"bun.lockb"))?"bun run":"npm run";X[z]=`${J} ${z}`}}if(E(w($,"Cargo.toml"))){if(!X.build)X.build="cargo build --release";if(!X.test)X.test="cargo test";if(!X.lint)X.lint="cargo clippy"}if(E(w($,"build.zig"))){if(!X.build)X.build="zig build";if(!X.test)X.test="zig build test"}if(E(w($,"go.mod"))){if(!X.build)X.build="go build ./...";if(!X.test)X.test="go test ./..."}if(E(w($,"pyproject.toml"))||E(w($,"pytest.ini"))){if(!X.test)X.test="pytest"}return X}function ZX($,Z,X,z){let J=[];if(z&&z!=="Unknown")J.push(z);let Q=new Set(["frontend","backend","database","build","css","state","monorepo"]);for(let Y of X)if(Q.has(Y.category))J.push(Y.name);if(E(w($,"bunfig.toml")))J.push("Bun");else if(E(w($,"deno.json"))||E(w($,"deno.jsonc")))J.push("Deno");if(J.length<3&&Z?.dependencies){let Y=Object.keys(Z.dependencies).slice(0,5);for(let W of Y)if(!J.some((U)=>U.toLowerCase().includes(W.toLowerCase())))J.push(W)}return J}function e2($){let Z=E$($),X=O3($),z=l9($),J=i9($),Q=J.type,Y=n9($),W=r9($),U=s9($),G=a9($),q=t9($),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"),P=Z1[Q]||Z1.library,C=Q==="framework",j=X.some((n)=>n.slug==="svelte"||n.slug==="sveltekit"),b=C&&j?"svelte":C?null:null,k=Q==="svelte"||b==="svelte",y=k?o9($):null,p=k&&X.some((n)=>n.slug==="sveltekit"),R=new Set(["css_framework","ui_library","database","connection","hosting"]),u={},g0=a.filter((n)=>n.path.startsWith("stack."));for(let n of g0){let t=n.path.replace("stack.","");if(!P.includes(n.category)){u[t]="slotignored";continue}if(C&&R.has(t)){u[t]="slotignored";continue}switch(t){case"frontend":u[t]=V?.name??(Q==="cli"?"CLI":"");break;case"css_framework":u[t]=K?.name??"";break;case"ui_library":u[t]=H?.name??"";break;case"state_management":u[t]=k?T?.name??"Runes":T?.name??"";break;case"backend":u[t]=k?p?"SvelteKit":B?.name??"":B?.name??"";break;case"api_type":u[t]=p?"Server Routes":"";break;case"runtime":u[t]=Y!=="Unknown"?Y:"";break;case"database":u[t]=N?.name??"";break;case"connection":u[t]=N?.name??"";break;case"hosting":if(k&&y)u[t]=y;else u[t]=G??"";break;case"build":u[t]=k?"Vite":q??"";break;case"cicd":u[t]=U??"";break;case"package_manager":u[t]=W;break;default:u[t]="";break}}let v0={},$0=a.filter((n)=>n.path.startsWith("monorepo."));for(let n of $0){let t=n.path.replace("monorepo.","");if(!P.includes(n.category))v0[t]="slotignored";else v0[t]=""}let y1={name:Z?.name??$.split("/").pop()??"project",goal:Z?.description??"",main_language:z,type:Q};if(C&&b)y1.framework=b;let z5=ZX($,Z,X,z),J5=e9($),Q5=$X($,Z),Q2={faf_version:"2.5.0",project:y1,stack:u,human_context:{who:"",what:Z?.description??"",why:"",where:"",when:"",how:""},monorepo:v0,_meta:{found:J.found}};if(z5.length>0)Q2.tech_stack=z5;if(J5.length>0)Q2.key_files=J5;if(Object.keys(Q5).length>0)Q2.commands=Q5;return Q2}import{existsSync as AL,readFileSync as RL}from"fs";import{join as FL}from"path";var XX={MIN_LENGTH:8,MAX_LENGTH:280},IL=[/^(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 y0($){let Z=$.trim();if(Z.length<XX.MIN_LENGTH)return!1;if(Z.length>XX.MAX_LENGTH)return!1;if(IL.some((X)=>X.test(Z)))return!1;if(/^[\s|\-*+]/.test(Z))return!1;if(Z.split(`
211
+ `).length>4)return!1;return!0}function _L($){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 HL($){let X=KL($).split(`
213
+ `)}function PL($){let X=_L($).split(`
214
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 j$($,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 BL($){let Z=j$($,/^(use\s+cases?|goal)\b/i);if(Z&&y0(Z))return Z;let X=HL($);if(X&&y0(X))return X;return}function LL($){let Z=j$($,/^(about|description|overview|what(\s+is\s+this)?)\b/i);if(Z&&y0(Z))return Z;return}function ML($){let Z=j$($,/^(audience|users?|for\s+whom|who(\s+is\s+this\s+for)?)\b/i);if(Z&&y0(Z))return Z;return}function NL($){let Z=j$($,/^(why|motivation|problem|rationale)\b/i);if(Z&&y0(Z))return Z;return}function OL($){let Z=j$($,/^(deployment|where(\s+it\s+runs)?|hosting)\b/i);if(Z&&y0(Z))return Z;return}function TL($){let Z=j$($,/^(status|history|timeline|since|launched)\b/i);if(Z&&y0(Z))return Z;return}function DL($){let Z=j$($,/^(architecture|how(\s+it\s+works)?|approach|design)\b/i);if(Z&&y0(Z))return Z;return}function O3($){let Z=["README.md","README.MD","Readme.md","readme.md"],X=null;for(let H of Z){let T=VL($,H);if(GL(T)){X=T;break}}if(!X)return{};let z;try{z=qL(X,"utf-8")}catch{return{}}let J={},Q=BL(z);if(Q)J.project={goal:Q};let Y={},U=LL(z);if(U)Y.what=U;let W=ML(z);if(W)Y.who=W;let G=NL(z);if(G)Y.why=G;let q=OL(z);if(q)Y.where=q;let V=TL(z);if(V)Y.when=V;let K=DL(z);if(K)Y.how=K;if(Object.keys(Y).length>0)J.human_context=Y;return J}import{existsSync as IL,readFileSync as AL}from"fs";import{join as RL}from"path";function FL($,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 T3($){let Z=RL($,"Cargo.toml");if(!IL(Z))return{};let X;try{X=AL(Z,"utf-8")}catch{return{}}let z=FL(X,"description");if(z&&y0(z))return{project:{goal:z}};return{}}function _L($,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 e2($){return _L(O3($),T3($))}import{existsSync as PL,readdirSync as t9,readFileSync as CL}from"fs";import{join as I3,dirname as wL,extname as EL,resolve as jL}from"path";var D3={"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 SL=new Set(["node_modules",".git","dist","build","venv",".venv","__pycache__","target","coverage",".next",".svelte-kit","vendor"]),xL=new Set([".py",".ts",".tsx",".js",".jsx",".svelte",".vue",".rb",".go",".rs",".php",".java",".kt",".swift"]),bL={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"]},kL=[["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 yL($,Z){for(let[X,z]of kL)if(X in $)return z;return Z.length>0?"framework":"config"}function fL($){try{let Z=JSON.parse(CL($,"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 gL($){let Z=[],X=jL($),z=PL(I3($,".git"));for(let J=0;J<10;J++){let Q;try{Q=t9(X)}catch{break}for(let U of Q){let W=D3[U];if(!W)continue;if(U==="manifest.json"&&fL(I3(X,U))!=="chrome")continue;if(U==="pubspec.yaml"){let G=o2(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=wL(X);if(Y===X)break;X=Y}return Z}function vL($){let Z=[];for(let X of e9($,2,{count:0})){let z=D3[`*${X}`],J=z?.slots?.mainLanguage;if(J)Z.push({slots:{mainLanguage:J},priority:z.priority,frameworks:z.frameworks})}return Z}function hL($){let Z=[...gL($),...vL($)],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:yL(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 $6($){let{slotFills:Z}=hL($),X={};for(let[z,J]of Object.entries(Z)){let Q=bL[z];if(!Q||!J)continue;let[Y,U]=Q;if(Y==="project")(X.project??={})[U]=J;else(X.stack??={})[U]=J}return X}function e9($,Z,X){let z=new Set;if(Z<0||X.count>400)return z;let J;try{J=t9($,{withFileTypes:!0})}catch{return z}for(let Q of J){if(X.count++>400)break;if(!Q.isDirectory()){let Y=EL(Q.name);if(xL.has(Y))z.add(Y);continue}if(SL.has(Q.name)||Q.name.startsWith("."))continue;for(let Y of e9(I3($,Q.name),Z-1,X))z.add(Y)}return z}import{existsSync as $X,readFileSync as ZX}from"fs";import{join as XX}from"path";var B0=($,Z,X)=>({value:$,source:Z,confidence:X});function uL($){let Z=mL($),X=cL($),z={},J=(Q,Y)=>{if(Y)z[Q]=Y};return J("what",dL(Z,X)),J("who",pL(X)),J("why",lL(X)),J("where",iL(Z,X)),J("when",nL(X)),J("how",rL(Z,X)),z}function Z6($){let Z=uL($),X={};return Object.keys(Z).forEach((z)=>{let J=Z[z];if(J)X[z]=J.value}),X}function mL($){let Z=XX($,"package.json");if(!$X(Z))return null;try{return JSON.parse(ZX(Z,"utf-8"))}catch{return null}}function cL($){let Z=XX($,"README.md");if(!$X(Z))return"";let X;try{X=ZX(Z,"utf-8")}catch{return""}return 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,W=[];z++;while(z<X.length){let U=X[z].trim(),G=U.match(/^(#{1,6})\s+/);if(G&&G[1].length<=Y)break;if(U===""){if(W.length>0)break;z++;continue}if(/^(>|```|---|\||\s*[-*+]\s|\d+\.\s)/.test(U))break;W.push(U),z++}if(W.length===0)return null;return W.join(" ").trim()}z++}return null}function CL($){let Z=j$($,/^(use\s+cases?|goal)\b/i);if(Z&&y0(Z))return Z;let X=PL($);if(X&&y0(X))return X;return}function wL($){let Z=j$($,/^(about|description|overview|what(\s+is\s+this)?)\b/i);if(Z&&y0(Z))return Z;return}function EL($){let Z=j$($,/^(audience|users?|for\s+whom|who(\s+is\s+this\s+for)?)\b/i);if(Z&&y0(Z))return Z;return}function jL($){let Z=j$($,/^(why|motivation|problem|rationale)\b/i);if(Z&&y0(Z))return Z;return}function SL($){let Z=j$($,/^(deployment|where(\s+it\s+runs)?|hosting)\b/i);if(Z&&y0(Z))return Z;return}function xL($){let Z=j$($,/^(status|history|timeline|since|launched)\b/i);if(Z&&y0(Z))return Z;return}function bL($){let Z=j$($,/^(architecture|how(\s+it\s+works)?|approach|design)\b/i);if(Z&&y0(Z))return Z;return}function T3($){let Z=["README.md","README.MD","Readme.md","readme.md"],X=null;for(let H of Z){let T=FL($,H);if(AL(T)){X=T;break}}if(!X)return{};let z;try{z=RL(X,"utf-8")}catch{return{}}let J={},Q=CL(z);if(Q)J.project={goal:Q};let Y={},W=wL(z);if(W)Y.what=W;let U=EL(z);if(U)Y.who=U;let G=jL(z);if(G)Y.why=G;let q=SL(z);if(q)Y.where=q;let V=xL(z);if(V)Y.when=V;let K=bL(z);if(K)Y.how=K;if(Object.keys(Y).length>0)J.human_context=Y;return J}import{existsSync as kL,readFileSync as yL}from"fs";import{join as fL}from"path";function gL($,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 W=Y[1].trim();W=W.replace(/\s*#.*$/,"").trim();let U=W.match(/^"((?:[^"\\]|\\.)*)"$/)||W.match(/^'((?:[^'\\]|\\.)*)'$/);if(U)return U[1];return W}}return null}function D3($){let Z=fL($,"Cargo.toml");if(!kL(Z))return{};let X;try{X=yL(Z,"utf-8")}catch{return{}}let z=gL(X,"description");if(z&&y0(z))return{project:{goal:z}};return{}}function vL($,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 $6($){return vL(T3($),D3($))}import{existsSync as hL,readdirSync as zX,readFileSync as uL}from"fs";import{join as A3,dirname as mL,extname as cL,resolve as dL}from"path";var I3={"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 pL=new Set(["node_modules",".git","dist","build","venv",".venv","__pycache__","target","coverage",".next",".svelte-kit","vendor"]),lL=new Set([".py",".ts",".tsx",".js",".jsx",".svelte",".vue",".rb",".go",".rs",".php",".java",".kt",".swift"]),iL={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"]},nL=[["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 rL($,Z){for(let[X,z]of nL)if(X in $)return z;return Z.length>0?"framework":"config"}function sL($){try{let Z=JSON.parse(uL($,"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 aL($){let Z=[],X=dL($),z=hL(A3($,".git"));for(let J=0;J<10;J++){let Q;try{Q=zX(X)}catch{break}for(let W of Q){let U=I3[W];if(!U)continue;if(W==="manifest.json"&&sL(A3(X,W))!=="chrome")continue;if(W==="pubspec.yaml"){let G=t2(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:U.priority,frameworks:G.isFlutter?["Flutter","Dart"]:["Dart"],fileName:W});continue}}Z.push({slots:U.slots||{},priority:U.priority,frameworks:U.frameworks,fileName:W})}if(z&&J===0)break;let Y=mL(X);if(Y===X)break;X=Y}return Z}function oL($){let Z=[];for(let X of JX($,2,{count:0})){let z=I3[`*${X}`],J=z?.slots?.mainLanguage;if(J)Z.push({slots:{mainLanguage:J},priority:z.priority,frameworks:z.frameworks})}return Z}function tL($){let Z=[...aL($),...oL($)],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:rL(G.slots,G.frameworks),priority:G.priority})}let Y=[...Q.values()].sort((G,q)=>q.priority-G.priority||G.fileName.localeCompare(q.fileName)),W=[];if(X.mainLanguage)W.push(X.mainLanguage.toLowerCase());if(X.framework)W.push(X.framework.toLowerCase());let U=W.length>0?W.join("-"):"unknown-stack";return{slotFills:X,frameworks:[...J],confirmedCount:Z.length,discoveredFormats:Y,stackSignature:U}}function Z6($){let{slotFills:Z}=tL($),X={};for(let[z,J]of Object.entries(Z)){let Q=iL[z];if(!Q||!J)continue;let[Y,W]=Q;if(Y==="project")(X.project??={})[W]=J;else(X.stack??={})[W]=J}return X}function JX($,Z,X){let z=new Set;if(Z<0||X.count>400)return z;let J;try{J=zX($,{withFileTypes:!0})}catch{return z}for(let Q of J){if(X.count++>400)break;if(!Q.isDirectory()){let Y=cL(Q.name);if(lL.has(Y))z.add(Y);continue}if(pL.has(Q.name)||Q.name.startsWith("."))continue;for(let Y of JX(A3($,Q.name),Z-1,X))z.add(Y)}return z}import{existsSync as QX,readFileSync as YX}from"fs";import{join as WX}from"path";var B0=($,Z,X)=>({value:$,source:Z,confidence:X});function eL($){let Z=$M($),X=ZM($),z={},J=(Q,Y)=>{if(Y)z[Q]=Y};return J("what",XM(Z,X)),J("who",zM(X)),J("why",JM(X)),J("where",QM(Z,X)),J("when",YM(X)),J("how",WM(Z,X)),z}function X6($){let Z=eL($),X={};return Object.keys(Z).forEach((z)=>{let J=Z[z];if(J)X[z]=J.value}),X}function $M($){let Z=WX($,"package.json");if(!QX(Z))return null;try{return JSON.parse(YX(Z,"utf-8"))}catch{return null}}function ZM($){let Z=WX($,"README.md");if(!QX(Z))return"";let X;try{X=YX(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 S$($){return $.replace(/\s+/g," ").replace(/[#*`>]/g,"").trim().slice(0,280)}function X1($,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:S$(z[2]),heading:z[1].trim()}:null}function G4($,Z,X=30){for(let z of Z){let J=$.match(z);if(J&&J[1]&&J[1].trim().length>=X)return S$(J[1])}return null}function dL($,Z){if($?.description&&$.description.length>20)return B0(S$($.description),"package.json:description",0.95);let X=X1(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(S$(z),"README:first-paragraph",0.5);let J=G4(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 pL($){let Z=X1($,"Audience|Who|Who is this for|Who it.s for");if(Z)return B0(Z.body,`README:## ${Z.heading}`,0.8);let X=G4($,[/\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 lL($){let Z=X1($,"Why|Mission|Motivation|Rationale|Vision");if(Z)return B0(Z.body,`README:## ${Z.heading}`,0.8);let X=G4($,[/(?: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 iL($,Z){let X=typeof $?.repository==="string"?$.repository:$?.repository?.url;if(X)return B0(S$(X.replace(/^git\+/,"").replace(/\.git$/,"")),"package.json:repository",0.95);if($?.homepage)return B0(S$($.homepage),"package.json:homepage",0.9);let z=G4(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 nL($){let Z=X1($,"Timeline|Status|Release|Roadmap");if(Z)return B0(Z.body,`README:## ${Z.heading}`,0.8);let X=G4($,[/\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 rL($,Z){let X=$?.scripts?Object.keys($.scripts):[],z=["start","dev","build"].filter((Y)=>X.includes(Y));if(z.length)return B0(S$(z.map((Y)=>`npm run ${Y}`).join(", ")),"package.json:scripts",0.9);let J=X1(Z,"Usage|Getting Started|Install|Installation|Quick Start");if(J)return B0(J.body,`README:## ${J.heading}`,0.8);let Q=X1(Z,"Architecture|Approach|How it works|Methodology|How");return Q?B0(Q.body,`README:## ${Q.heading}`,0.7):null}function z1($){let Z=t2($),X=e2($),z=n0(Z,X);sL(z);let J=n0(z,$6($));return n0(J,{human_context:Z6($)})}function sL($){let Z=$.project?.type??"library",X=$1[Z]||$1.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 n0($,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]=n0(Q,J)}return X}import{existsSync as zX,readFileSync as aL,writeFileSync as oL}from"fs";import{join as tL,basename as eL}from"path";import{createHash as $M}from"crypto";class r0{projectPath;dnaPath;dna=null;constructor($){this.projectPath=$,this.dnaPath=tL($,".faf-dna")}exists(){return zX(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(!zX(this.dnaPath))return null;try{return this.dna=JSON.parse(aL(this.dnaPath,"utf-8")),this.dna}catch{return null}}save(){if(!this.dna)return;this.dna.lastModified=new Date().toISOString(),oL(this.dnaPath,JSON.stringify(this.dna,null,2)+`
219
- `,"utf-8")}generateProjectDNA(){return $M("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=eL(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")}}c();function A3($={}){let Z=process.cwd(),X=$.output?$.output.endsWith(".faf")?$.output:JX(Z,$.output):JX(Z,"project.faf");if(ZM(X)&&!$.force)console.error(`project.faf already exists. Use ${I("--force")} to overwrite.`),process.exit(1);let z=z1(Z);s(X,z);let J=h(X),Q=X0(J),Y=new r0(Z);if(!Y.exists()||$.force)Y.birth(Q.score);if(console.log(`${D("created")} ${X}`),z0(Q,X),console.log(B(` \uD83E\uDDEC Birth DNA ${Q.score}% — your journey starts here (faf dna)`)),Q.score<100)console.log(B(`
220
- run ${I("'faf go'")} to fill empty slots`))}c();function QX(){let $=new r0(process.cwd());if(!$.load())console.error(`${I("×")} No FAF DNA found. Run ${I("'faf init'")} to start your journey.`),process.exit(1);let Z=$.getJourney(),X=$.getBirthDNADisplay(),z=X.born.split("T")[0];console.log(),console.log(H0(I("\uD83E\uDDEC YOUR FAF DNA"))),console.log(),console.log(` ${D(I(Z))}`),console.log(),console.log(B(` Birth DNA ${X.birthDNA}% (born ${z}) · current ${X.current}% · growth ${X.growth>=0?"+":""}${X.growth}%`));let J=$.getLog();if(J.length>1){console.log(),console.log(B(" history:"));for(let Q of J)console.log(B(` ${Q}`))}console.log()}import{existsSync as XM}from"fs";import{join as zM}from"path";c();function X6(){let $=process.cwd(),Z=zM($,"project.faf");if(XM(Z)){let Q=m(Z),Y=n0(Q,e2($)),U=n0(Y,t2($)),W=n0(U,$6($)),G=n0(W,{human_context:Z6($)});s(Z,G),console.log(`${D("updated")} ${Z}`)}else s(Z,z1($)),console.log(`${D("created")} ${Z}`);let X=h(Z),z=q0(U0(X)),J=new r0($);if(J.exists())J.recordGrowth(z.score,["faf auto"]);if(z0(z,Z),z.score<100)console.log(B(`
221
- run ${I("'faf go'")} to reach \uD83C\uDFC6 Trophy`))}import{existsSync as VM}from"fs";import{join as KM}from"path";var J1="(terse — 3-4 words)",JM=[{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? ${J1}`,header:"Who",type:"text",required:!0},{path:"human_context.what",question:`What are they building? ${J1}`,header:"What",type:"text",required:!0},{path:"human_context.why",question:`Why does it exist? ${J1}`,header:"Why",type:"text",required:!0},{path:"human_context.where",question:`Where does it run or ship? ${J1}`,header:"Where",type:"text",required:!0},{path:"human_context.when",question:`When — timeline or stage? ${J1}`,header:"When",type:"text",required:!0},{path:"human_context.how",question:`How is it built or used? ${J1}`,header:"How",type:"text",required:!0}],QM=[{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}],z6=[...JM,...QM],YM=new Map(z6.map(($)=>[$.path,$])),xR=Object.fromEntries(z6.map(($)=>[$.path,$]));function J6($){let Z=YM.get($);if(Z)return Z.question;let X=e$.get($)??a.find((z)=>z.canonical===$);return X?`${X.description}?`.replace(/\?\?$/,"?"):`${$}?`}function F3($){if($===null||$===void 0)return!0;if(typeof $==="string"){let Z=$.trim();return Z===""||A0(Z)}return!1}function UM($,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 WM($){if($==="project.goal")return!0;return e$.get($)?.category==="human"}function GM($,Z=F3){let X=[],z=[];for(let J of z6){let Q=UM($,J.path);if(Q==="slotignored")continue;if(!Z(Q))continue;(WM(J.path)?X:z).push(J.path)}return{human:X,sourceable:z}}function qM($,Z,X=F3){let z=GM(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"?R3(z):[];return{status:J,score:$,gaps:z,ask:Q}}function R3($){return $.human.map((Z)=>({path:Z,question:J6(Z)}))}function YX($,Z={}){let X=Math.max(1,Z.maxRounds??5),z=Z.isEmpty??F3,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=qM(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:R3(q.gaps)}:{status:"stuck",score:G,rounds:Q,history:J,ask:[]};if(Q>=X)return{status:"capped",score:G,rounds:Q,history:J,ask:R3(q.gaps)};$.runAuto(),Q++}return{status:"capped",score:J[J.length-1]??0,rounds:Q,history:J,ask:[]}}c();function UX($={}){let Z=process.cwd(),X=KM(Z,"project.faf"),z=$.rounds?Math.max(1,parseInt($.rounds,10)||5):5;HM(YX({read:()=>VM(X)?{data:m(X),yaml:h(X)}:{data:{},yaml:""},score:(Q)=>Q?q0(U0(Q)).score:0,runAuto:()=>X6()},{maxRounds:z}))}function HM($){if($.history.length>1)console.log(B(`
222
- climb: ${$.history.join("% → ")}%`));switch(console.log(""),$.status){case"done":console.log(`${D("done")} — \uD83C\uDFC6 100% AI-readiness. The .faf is complete.`);break;case"needs-human":{let Z=$.ask.length;console.log(`${I("Sourced everything detection can.")} ${Z} question${Z===1?"":"s"} only you can answer:`);for(let X of $.ask)console.log(` ${B("•")} ${X.question}`);console.log(B(`
223
- Answer with ${I("'faf go'")}, or fill them in project.faf directly.`));break}case"stuck":console.log(`${I(`Stopped at ${$.score}%.`)} The remaining gaps need evidence detection couldn't find, and there's nothing only you can answer. Add the missing manifests/README, then re-run.`);break;case"capped":console.log(`${I(`Stopped at ${$.score}% after ${$.rounds} rounds (the cap).`)} Re-run ${I("'faf loop'")} to continue, or raise ${B("--rounds")}.`);break;case"no-faf":console.log(`No project.faf, and none could be created here. Run ${I("'faf init'")} first.`);break}}import{existsSync as U6,statSync as LX}from"fs";import{join as MX,dirname as PM}from"path";import{readFileSync as IM,existsSync as AM,statSync as aR}from"fs";import{join as GX}from"path";import{readFileSync as BM,writeFileSync as Q6,existsSync as LM}from"fs";var MM="<!-- faf:start -->",NM="<!-- faf:end -->",OM="<!-- faf:";function m0($,Z,X=MM,z=NM){let J=`${X}
218
+ `).replace(/<[^>]+>/g,"").replace(/!\[[^\]]*\]\([^)]*\)/g,"").trim()}function S$($){return $.replace(/\s+/g," ").replace(/[#*`>]/g,"").trim().slice(0,280)}function z1($,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:S$(z[2]),heading:z[1].trim()}:null}function q4($,Z,X=30){for(let z of Z){let J=$.match(z);if(J&&J[1]&&J[1].trim().length>=X)return S$(J[1])}return null}function XM($,Z){if($?.description&&$.description.length>20)return B0(S$($.description),"package.json:description",0.95);let X=z1(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(S$(z),"README:first-paragraph",0.5);let J=q4(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 zM($){let Z=z1($,"Audience|Who|Who is this for|Who it.s for");if(Z)return B0(Z.body,`README:## ${Z.heading}`,0.8);let X=q4($,[/\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 JM($){let Z=z1($,"Why|Mission|Motivation|Rationale|Vision");if(Z)return B0(Z.body,`README:## ${Z.heading}`,0.8);let X=q4($,[/(?: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 QM($,Z){let X=typeof $?.repository==="string"?$.repository:$?.repository?.url;if(X)return B0(S$(X.replace(/^git\+/,"").replace(/\.git$/,"")),"package.json:repository",0.95);if($?.homepage)return B0(S$($.homepage),"package.json:homepage",0.9);let z=q4(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 YM($){let Z=z1($,"Timeline|Status|Release|Roadmap");if(Z)return B0(Z.body,`README:## ${Z.heading}`,0.8);let X=q4($,[/\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 WM($,Z){let X=$?.scripts?Object.keys($.scripts):[],z=["start","dev","build"].filter((Y)=>X.includes(Y));if(z.length)return B0(S$(z.map((Y)=>`npm run ${Y}`).join(", ")),"package.json:scripts",0.9);let J=z1(Z,"Usage|Getting Started|Install|Installation|Quick Start");if(J)return B0(J.body,`README:## ${J.heading}`,0.8);let Q=z1(Z,"Architecture|Approach|How it works|Methodology|How");return Q?B0(Q.body,`README:## ${Q.heading}`,0.7):null}function J1($){let Z=e2($),X=$6($),z=n0(Z,X);UM(z);let J=n0(z,Z6($));return n0(J,{human_context:X6($)})}function UM($){let Z=$.project?.type??"library",X=Z1[Z]||Z1.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 n0($,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]=n0(Q,J)}return X}import{existsSync as UX,readFileSync as GM,writeFileSync as qM}from"fs";import{join as VM,basename as KM}from"path";import{createHash as HM}from"crypto";class r0{projectPath;dnaPath;dna=null;constructor($){this.projectPath=$,this.dnaPath=VM($,".faf-dna")}exists(){return UX(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(!UX(this.dnaPath))return null;try{return this.dna=JSON.parse(GM(this.dnaPath,"utf-8")),this.dna}catch{return null}}save(){if(!this.dna)return;this.dna.lastModified=new Date().toISOString(),qM(this.dnaPath,JSON.stringify(this.dna,null,2)+`
219
+ `,"utf-8")}generateProjectDNA(){return HM("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=KM(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=(U)=>z.some((G)=>G.type===U),Q=(U,G,q)=>z.push({type:U,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((U)=>U.type==="peak");if(!Y||$>Y.score){if(Y)z.splice(z.indexOf(Y),1);Q("peak","Peak","\uD83C\uDFD4️")}let W=z.findIndex((U)=>U.type==="current");if(W>=0)z.splice(W,1);Q("current","Current","\uD83D\uDCCD")}}c();function R3($={}){let Z=process.cwd(),X=$.output?$.output.endsWith(".faf")?$.output:GX(Z,$.output):GX(Z,"project.faf");if(BM(X)&&!$.force)console.error(`project.faf already exists. Use ${I("--force")} to overwrite.`),process.exit(1);let z=J1(Z);s(X,z);let J=h(X),Q=X0(J),Y=new r0(Z);if(!Y.exists()||$.force)Y.birth(Q.score);if(console.log(`${D("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 ${I("'faf go'")} to fill empty slots`))}c();function qX(){let $=new r0(process.cwd());if(!$.load())console.error(`${I("×")} No FAF DNA found. Run ${I("'faf init'")} to start your journey.`),process.exit(1);let Z=$.getJourney(),X=$.getBirthDNADisplay(),z=X.born.split("T")[0];console.log(),console.log(H0(I("\uD83E\uDDEC YOUR FAF DNA"))),console.log(),console.log(` ${D(I(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 LM}from"fs";import{join as MM}from"path";c();function z6(){let $=process.cwd(),Z=MM($,"project.faf");if(LM(Z)){let Q=m(Z),Y=n0(Q,$6($)),W=n0(Y,e2($)),U=n0(W,Z6($)),G=n0(U,{human_context:X6($)});s(Z,G),console.log(`${D("updated")} ${Z}`)}else s(Z,J1($)),console.log(`${D("created")} ${Z}`);let X=h(Z),z=q0(W0(X)),J=new r0($);if(J.exists())J.recordGrowth(z.score,["faf auto"]);if(z0(z,Z),z.score<100)console.log(L(`
221
+ run ${I("'faf go'")} to reach \uD83C\uDFC6 Trophy`))}import{existsSync as FM}from"fs";import{join as _M}from"path";var Q1="(terse — 3-4 words)",NM=[{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? ${Q1}`,header:"Who",type:"text",required:!0},{path:"human_context.what",question:`What are they building? ${Q1}`,header:"What",type:"text",required:!0},{path:"human_context.why",question:`Why does it exist? ${Q1}`,header:"Why",type:"text",required:!0},{path:"human_context.where",question:`Where does it run or ship? ${Q1}`,header:"Where",type:"text",required:!0},{path:"human_context.when",question:`When — timeline or stage? ${Q1}`,header:"When",type:"text",required:!0},{path:"human_context.how",question:`How is it built or used? ${Q1}`,header:"How",type:"text",required:!0}],OM=[{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}],J6=[...NM,...OM],TM=new Map(J6.map(($)=>[$.path,$])),pR=Object.fromEntries(J6.map(($)=>[$.path,$]));function Q6($){let Z=TM.get($);if(Z)return Z.question;let X=$1.get($)??a.find((z)=>z.canonical===$);return X?`${X.description}?`.replace(/\?\?$/,"?"):`${$}?`}function _3($){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 IM($){if($==="project.goal")return!0;return $1.get($)?.category==="human"}function AM($,Z=_3){let X=[],z=[];for(let J of J6){let Q=DM($,J.path);if(Q==="slotignored")continue;if(!Z(Q))continue;(IM(J.path)?X:z).push(J.path)}return{human:X,sourceable:z}}function RM($,Z,X=_3){let z=AM(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"?F3(z):[];return{status:J,score:$,gaps:z,ask:Q}}function F3($){return $.human.map((Z)=>({path:Z,question:Q6(Z)}))}function VX($,Z={}){let X=Math.max(1,Z.maxRounds??5),z=Z.isEmpty??_3,J=[],Q=0;for(let W=0;W<=X;W++){let U=$.read();if(!U)return{status:"no-faf",score:0,rounds:Q,history:J,ask:[]};let G=$.score(U.yaml);J.push(G);let q=RM(G,U.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:F3(q.gaps)}:{status:"stuck",score:G,rounds:Q,history:J,ask:[]};if(Q>=X)return{status:"capped",score:G,rounds:Q,history:J,ask:F3(q.gaps)};$.runAuto(),Q++}return{status:"capped",score:J[J.length-1]??0,rounds:Q,history:J,ask:[]}}c();function KX($={}){let Z=process.cwd(),X=_M(Z,"project.faf"),z=$.rounds?Math.max(1,parseInt($.rounds,10)||5):5;PM(VX({read:()=>FM(X)?{data:m(X),yaml:h(X)}:{data:{},yaml:""},score:(Q)=>Q?q0(W0(Q)).score:0,runAuto:()=>z6()},{maxRounds:z}))}function PM($){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(`${I("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 ${I("'faf go'")}, or fill them in project.faf directly.`));break}case"stuck":console.log(`${I(`Stopped at ${$.score}%.`)} The remaining gaps need evidence detection couldn't find, and there's nothing only you can answer. Add the missing manifests/README, then re-run.`);break;case"capped":console.log(`${I(`Stopped at ${$.score}% after ${$.rounds} rounds (the cap).`)} Re-run ${I("'faf loop'")} to continue, or raise ${L("--rounds")}.`);break;case"no-faf":console.log(`No project.faf, and none could be created here. Run ${I("'faf init'")} first.`);break}}import{existsSync as U6,statSync as DX}from"fs";import{join as IX,dirname as hM}from"path";import{readFileSync as kM,existsSync as yM,statSync as UF}from"fs";import{join as BX}from"path";import{readFileSync as CM,writeFileSync as Y6,existsSync as wM}from"fs";var EM="<!-- faf:start -->",jM="<!-- faf:end -->",SM="<!-- faf:";function m0($,Z,X=EM,z=jM){let J=`${X}
224
224
  ${Z.trim()}
225
- ${z}`;if(!LM($)){Q6($,`${J}
226
- `,"utf-8");return}let Q=BM($,"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(OM)){Q6($,`${J}
227
- `,"utf-8");return}Q6($,`${J}
225
+ ${z}`;if(!wM($)){Y6($,`${J}
226
+ `,"utf-8");return}let Q=CM($,"utf-8"),Y=Q.indexOf(X),W=Q.indexOf(z);if(Y!==-1&&W!==-1&&W>Y){let U=Q.slice(0,Y),G=Q.slice(W+z.length);Y6($,`${U}${J}${G}`,"utf-8");return}if(Q.trimStart().startsWith(SM)){Y6($,`${J}
227
+ `,"utf-8");return}Y6($,`${J}
228
228
 
229
- ${Q}`,"utf-8")}var TM=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 DM($){return $.split("_").map((Z)=>{if(!Z)return Z;let X=Z.toUpperCase();return TM.has(X)?X:Z.charAt(0).toUpperCase()+Z.slice(1)}).join(" ")}function N0($){return typeof $==="string"&&$.trim()!==""&&$.trim()!=="slotignored"}function R0($){let Z=e$.get($);if(Z?.label)return Z.label;let X=$.includes(".")?$.slice($.lastIndexOf(".")+1):$;return DM(X)}var qX="CLAUDE.md",RM="STATUS: BI-SYNC ACTIVE";function VX($){let Z=GX($,qX);if(!AM(Z))return null;return IM(Z,"utf-8")}function KX($,Z){m0(GX($,qX),Z)}function s0($,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 HX($){let Z=[],X=$.project?.name??"Project",z=$.project?.main_language??"",J=$.project?.goal??"";if(Z.push(s0($)),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(`*${RM} — ${new Date().toISOString()}*`),Z.push(""),Z.join(`
231
- `)}function WX($){return $.replace(/\s+v\d+(?:\.\d+)*\s*$/i,"").trim()}function Y6($){let Z={project:{}},X=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(X)Z.project.name=WX(X[1].trim());if(!Z.project.name){let Q=$.match(/\*\*Name:\*\*\s*(.+)/);if(Q)Z.project.name=WX(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 XF,writeFileSync as FM,existsSync as zF}from"fs";import{join as _M}from"path";function BX($,Z){FM(_M($,"MEMORY.md"),Z,"utf-8")}c();function Q1(){return process.env.FAF_PRO==="1"||process.env.FAF_PRO==="true"}function _3($={}){let Z=process.cwd(),X=v(Z);if(!X)console.error(`Error: project.faf not found
229
+ ${Q}`,"utf-8")}var xM=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 bM($){return $.split("_").map((Z)=>{if(!Z)return Z;let X=Z.toUpperCase();return xM.has(X)?X:Z.charAt(0).toUpperCase()+Z.slice(1)}).join(" ")}function N0($){return typeof $==="string"&&$.trim()!==""&&$.trim()!=="slotignored"}function R0($){let Z=$1.get($);if(Z?.label)return Z.label;let X=$.includes(".")?$.slice($.lastIndexOf(".")+1):$;return bM(X)}var LX="CLAUDE.md",fM="STATUS: BI-SYNC ACTIVE";function MX($){let Z=BX($,LX);if(!yM(Z))return null;return kM(Z,"utf-8")}function NX($,Z){m0(BX($,LX),Z)}function s0($,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(" | ")} -->`,W=[];if(Z.doc)W.push(`doc=${Z.doc}`);else W.push(`claim=${Z.claim??"project.faf"}`);if(typeof Z.score==="number")W.push(`score=${Z.score}`);if(W.push(`family=${Z.family??"FAF"}`),Z.siblings&&Z.siblings.length>0)W.push(`siblings=${Z.siblings.join(",")}`);let U=`<!-- faf: ${W.join(" | ")} -->`;return`${Y}
230
+ ${U}`}function OX($){let Z=[],X=$.project?.name??"Project",z=$.project?.main_language??"",J=$.project?.goal??"";if(Z.push(s0($)),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 W=$.human_context??{},U=[["who",W.who],["what",W.what],["why",W.why],["where",W.where],["when",W.when],["how",W.how]].filter(([,G])=>G&&String(G).trim()).map(([G,q])=>`- **${R0(`human_context.${G}`)}:** ${q}`);if(U.length>0)Z.push("## Context"),Z.push(""),Z.push(...U),Z.push("");return Z.push("---"),Z.push(""),Z.push(`*${fM} — ${new Date().toISOString()}*`),Z.push(""),Z.join(`
231
+ `)}function HX($){return $.replace(/\s+v\d+(?:\.\d+)*\s*$/i,"").trim()}function W6($){let Z={project:{}},X=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(X)Z.project.name=HX(X[1].trim());if(!Z.project.name){let Q=$.match(/\*\*Name:\*\*\s*(.+)/);if(Q)Z.project.name=HX(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 BF,writeFileSync as gM,existsSync as LF}from"fs";import{join as vM}from"path";function TX($,Z){gM(vM($,"MEMORY.md"),Z,"utf-8")}c();function Y1(){return process.env.FAF_PRO==="1"||process.env.FAF_PRO==="true"}function P3($={}){let Z=process.cwd(),X=g(Z);if(!X)console.error(`Error: project.faf not found
232
232
 
233
- Run 'faf init' to create one.`),process.exit(2);let z=MX(Z,"CLAUDE.md"),J=MX(Z,"MEMORY.md"),Q=$.direction??"auto";if(Q==="auto")NX(X,z,Z);else if(Q==="push")OX(X,Z);else if(Q==="pull")CM(X,z);if(Q1())TX(X,J,Z);if($.watch)console.log(B("watching for changes... (Ctrl+C to stop)")),EM(X,z,J,Z)}function NX($,Z,X){OX($,X)}function OX($,Z){let X=m($),z=HX(X);KX(Z,z),console.log(`${D("◆")} sync .faf → CLAUDE.md ${B("← bi-sync")}`);let J=q0(U0(h($)));z0(J,$)}function CM($,Z){let X=q0(U0(h($)));if(X.tier.name!=="TROPHY")console.error(`${I("×")} sync --pull blocked: requires \uD83C\uDFC6 Trophy (currently ${X.score}%)`),console.error(B(" MD → .faf backfill only runs at 100%. Reach Trophy with 'faf go', then retry.")),process.exit(1);let z=VX(PM(Z));if(!z){console.error("CLAUDE.md not found.");return}let J=Y6(z),Q=m($);if(J.project?.name)Q.project={...Q.project,name:J.project.name};if(J.project?.goal)Q.project={...Q.project,goal:J.project.goal};if(J.project?.main_language)Q.project={...Q.project,main_language:J.project.main_language};s($,Q),console.log(`${D("◆")} sync CLAUDE.md → .faf ${B("← bi-sync (Trophy-gated)")}`);let Y=q0(U0(h($)));z0(Y,$)}function TX($,Z,X){let z=m($),J=LX($).mtimeMs,Q=U6(Z)?LX(Z).mtimeMs:0;if(!U6(Z)||J>Q){let Y=wM(z);BX(X,Y),console.log(`${D("◆")} sync .faf → MEMORY.md ${B("← tri-sync")}`)}else console.log(`${D("◆")} sync MEMORY.md → .faf ${B("← tri-sync")}`)}function wM($){let Z=$.project??{},X=[`# ${Z.name??"Project"} — Memory Topics`,"","> Generated by faf sync (tri-sync)",""];if(Z.name)X.push(`- **Project:** ${Z.name}`);if(Z.goal)X.push(`- **Goal:** ${Z.goal}`);if(Z.main_language)X.push(`- **Language:** ${Z.main_language}`);if(Z.type)X.push(`- **Type:** ${Z.type}`);return X.join(`
233
+ Run 'faf init' to create one.`),process.exit(2);let z=IX(Z,"CLAUDE.md"),J=IX(Z,"MEMORY.md"),Q=$.direction??"auto";if(Q==="auto")AX(X,z,Z);else if(Q==="push")RX(X,Z);else if(Q==="pull")uM(X,z);if(Y1())FX(X,J,Z);if($.watch)console.log(L("watching for changes... (Ctrl+C to stop)")),cM(X,z,J,Z)}function AX($,Z,X){RX($,X)}function RX($,Z){let X=m($),z=OX(X);NX(Z,z),console.log(`${D("◆")} sync .faf → CLAUDE.md ${L("← bi-sync")}`);let J=q0(W0(h($)));z0(J,$)}function uM($,Z){let X=q0(W0(h($)));if(X.tier.name!=="TROPHY")console.error(`${I("×")} 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=MX(hM(Z));if(!z){console.error("CLAUDE.md not found.");return}let J=W6(z),Q=m($);if(J.project?.name)Q.project={...Q.project,name:J.project.name};if(J.project?.goal)Q.project={...Q.project,goal:J.project.goal};if(J.project?.main_language)Q.project={...Q.project,main_language:J.project.main_language};s($,Q),console.log(`${D("◆")} sync CLAUDE.md → .faf ${L("← bi-sync (Trophy-gated)")}`);let Y=q0(W0(h($)));z0(Y,$)}function FX($,Z,X){let z=m($),J=DX($).mtimeMs,Q=U6(Z)?DX(Z).mtimeMs:0;if(!U6(Z)||J>Q){let Y=mM(z);TX(X,Y),console.log(`${D("◆")} sync .faf → MEMORY.md ${L("← tri-sync")}`)}else console.log(`${D("◆")} sync MEMORY.md → .faf ${L("← tri-sync")}`)}function mM($){let Z=$.project??{},X=[`# ${Z.name??"Project"} — Memory Topics`,"","> Generated by faf sync (tri-sync)",""];if(Z.name)X.push(`- **Project:** ${Z.name}`);if(Z.goal)X.push(`- **Goal:** ${Z.goal}`);if(Z.main_language)X.push(`- **Language:** ${Z.main_language}`);if(Z.type)X.push(`- **Type:** ${Z.type}`);return X.join(`
234
234
  `)+`
235
- `}function EM($,Z,X,z){let{watch:J}=D0("fs"),Q=null,Y=()=>{if(Q)clearTimeout(Q);Q=setTimeout(()=>{if(console.log(B("change detected...")),NX($,Z,z),Q1())TX($,X,z)},200)};if(J($,Y),U6(Z))J(Z,Y);if(Q1()&&U6(X))J(X,Y)}import{writeFileSync as jM}from"fs";c();function DX($,Z={}){let X=$??v();if(!X)console.error(`Error: project.faf not found
235
+ `}function cM($,Z,X,z){let{watch:J}=D0("fs"),Q=null,Y=()=>{if(Q)clearTimeout(Q);Q=setTimeout(()=>{if(console.log(L("change detected...")),AX($,Z,z),Y1())FX($,X,z)},200)};if(J($,Y),U6(Z))J(Z,Y);if(Y1()&&U6(X))J(X,Y)}import{writeFileSync as dM}from"fs";c();function _X($,Z={}){let X=$??g();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=s2(z),Q=Z.output??X.replace(/\.faf$/,".fafb");jM(Q,J),console.log(`${D("compiled")} ${Q} ${B(`(${J.length} bytes)`)}`)}import{readFileSync as SM}from"fs";function IX($,Z={}){if(!$)console.error("Error: Please specify a .fafb file to decompile."),process.exit(1);let X=new Uint8Array(SM($));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=y9(X);console.log(JSON.stringify(z,null,2))}function AX($){let Z=[];if(!$||typeof $!=="object")return Z.push("File is not a valid YAML mapping"),{valid:!1,errors:Z};let X=$;if(!X.faf_version)Z.push("Missing required field: faf_version");if(!X.project?.name)Z.push("Missing required field: project.name");if(X.app_type==="about"){if(!X.about?.represents)Z.push("app_type 'about' requires about.represents (owner/repo of the source codebase)");else if(!/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(X.about.represents))Z.push(`about.represents must be "owner/repo" format (got: ${X.about.represents})`);if(X.about?.source_score!==void 0){let z=X.about.source_score;if(typeof z!=="number"||z<0||z>100)Z.push(`about.source_score must be a number 0-100 (got: ${z})`)}}return{valid:Z.length===0,errors:Z}}c();function P3($,Z={}){let X=$??v();if(!X)console.error(`Error: project.faf not found
237
+ Run 'faf init' to create one.`),process.exit(2);let z=h(X),J=a2(z),Q=Z.output??X.replace(/\.faf$/,".fafb");dM(Q,J),console.log(`${D("compiled")} ${Q} ${L(`(${J.length} bytes)`)}`)}import{readFileSync as pM}from"fs";function PX($,Z={}){if(!$)console.error("Error: Please specify a .fafb file to decompile."),process.exit(1);let X=new Uint8Array(pM($));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=u9(X);console.log(JSON.stringify(z,null,2))}function CX($){let Z=[];if(!$||typeof $!=="object")return Z.push("File is not a valid YAML mapping"),{valid:!1,errors:Z};let X=$;if(!X.faf_version)Z.push("Missing required field: faf_version");if(!X.project?.name)Z.push("Missing required field: project.name");if(X.app_type==="about"){if(!X.about?.represents)Z.push("app_type 'about' requires about.represents (owner/repo of the source codebase)");else if(!/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(X.about.represents))Z.push(`about.represents must be "owner/repo" format (got: ${X.about.represents})`);if(X.about?.source_score!==void 0){let z=X.about.source_score;if(typeof z!=="number"||z<0||z>100)Z.push(`about.source_score must be a number 0-100 (got: ${z})`)}}return{valid:Z.length===0,errors:Z}}c();function C3($,Z={}){let X=$??g();if(!X)console.error(`Error: project.faf not found
238
238
 
239
- Run 'faf init' to create one.`),process.exit(2);let z=m(X),J=AX(z);if(!J.valid){console.log(`${I("invalid")} ${X}`);for(let U of J.errors)console.log(` ${B("x")} ${U}`);process.exit(3)}let Q=h(X);if(!k9(Q))console.log(`${I("invalid yaml")} ${X}`),process.exit(3);console.log(`${D("valid")} ${X}`);let Y=X0(Q);if(z0(Y,X),Z.strict&&Y.score<100)console.log(B(`
240
- --strict requires 100%`)),process.exit(1)}import{join as xM}from"path";function bM($){let Z=[];if(Z.push(s0($)),Z.push(""),Z.push(`# AGENTS.md — ${$.project?.name??"Project"}`),Z.push(""),Z.push("> Auto-generated from project.faf — do not edit directly"),Z.push(""),Z.push("## Project Context"),Z.push(""),$.project?.name)Z.push(`- **Name:** ${$.project.name}`);if($.project?.goal)Z.push(`- **Goal:** ${$.project.goal}`);if($.project?.main_language)Z.push(`- **Language:** ${$.project.main_language}`);if(Z.push(""),Z.push("## Stack"),Z.push(""),$.stack){for(let[X,z]of Object.entries($.stack))if(N0(z))Z.push(`- **${R0(`stack.${X}`)}:** ${z.trim()}`)}if($.human_context){Z.push(""),Z.push("## Human Context"),Z.push("");for(let[X,z]of Object.entries($.human_context))if(N0(z))Z.push(`- **${R0(`human_context.${X}`)}:** ${z.trim()}`)}return Z.push(""),Z.join(`
241
- `)}function RX($,Z){m0(xM($,"AGENTS.md"),bM(Z))}import{join as kM}from"path";function yM($){let Z=[];if(Z.push(s0($)),Z.push(""),Z.push("# .cursorrules"),Z.push(`# Auto-generated from project.faf — ${$.project?.name??"Project"}`),Z.push(""),$.project?.main_language)Z.push(`language: ${$.project.main_language}`);if($.stack){Z.push(""),Z.push("# Stack");for(let[X,z]of Object.entries($.stack))if(N0(z))Z.push(`# ${R0(`stack.${X}`)}: ${z.trim()}`)}return Z.push(""),Z.join(`
242
- `)}function FX($,Z){m0(kM($,".cursorrules"),yM(Z),"# faf:start","# faf:end")}import{join as fM}from"path";function gM($){let Z=[];if(Z.push(s0($)),Z.push(""),Z.push(`# GEMINI.md — ${$.project?.name??"Project"}`),Z.push(""),Z.push("> Auto-generated from project.faf"),Z.push(""),$.project?.name)Z.push(`Project: ${$.project.name}`);if($.project?.goal)Z.push(`Goal: ${$.project.goal}`);if($.project?.main_language)Z.push(`Language: ${$.project.main_language}`);if($.stack){Z.push(""),Z.push("## Stack");for(let[X,z]of Object.entries($.stack))if(N0(z))Z.push(`- ${R0(`stack.${X}`)}: ${z.trim()}`)}return Z.push(""),Z.join(`
243
- `)}function _X($,Z){m0(fM($,"GEMINI.md"),gM(Z))}import{join as PX}from"path";import{mkdirSync as vM}from"fs";var CX=[["install","Install with"],["build","Build with"],["test","Test with"],["lint","Lint with"],["run","Run with"],["start","Start with"],["dev","Run the dev server with"]],hM=new Set([...CX.map(([$])=>$),"cicd"]);function uM($){let Z=[],X=$.project?.name??"Project";if(Z.push(s0($)),Z.push(""),Z.push(`# GitHub Copilot Instructions — ${X}`),Z.push(""),Z.push("> Generated from project.faf by FAF. Copilot reads these instructions on every request in this repository — keep them short and broadly applicable."),Z.push(""),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(hM.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 CX){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 wX($,Z){vM(PX($,".github"),{recursive:!0}),m0(PX($,".github","copilot-instructions.md"),uM(Z))}import{existsSync as mM,mkdirSync as cM,readFileSync as dM,writeFileSync as EX}from"fs";import{join as jX}from"path";var pM="https://mcpaas.live/grok/mcp/v1",SX="mcp_servers.grok-faf-mcp";function lM($){return[`[${SX}]`,`url = "${pM}"`,""].join(`
245
- `)}function xX($,Z){let X=jX($,".grok"),z=jX(X,"config.toml"),J=lM(Z);if(!mM(z))return cM(X,{recursive:!0}),EX(z,`# grok-faf-mcp — wired by FAF from project.faf
239
+ Run 'faf init' to create one.`),process.exit(2);let z=m(X),J=CX(z);if(!J.valid){console.log(`${I("invalid")} ${X}`);for(let W of J.errors)console.log(` ${L("x")} ${W}`);process.exit(3)}let Q=h(X);if(!h9(Q))console.log(`${I("invalid yaml")} ${X}`),process.exit(3);console.log(`${D("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 lM}from"path";function iM($){let Z=[];if(Z.push(s0($)),Z.push(""),Z.push(`# AGENTS.md — ${$.project?.name??"Project"}`),Z.push(""),Z.push("> Auto-generated from project.faf — do not edit directly"),Z.push(""),Z.push("## Project Context"),Z.push(""),$.project?.name)Z.push(`- **Name:** ${$.project.name}`);if($.project?.goal)Z.push(`- **Goal:** ${$.project.goal}`);if($.project?.main_language)Z.push(`- **Language:** ${$.project.main_language}`);if(Z.push(""),Z.push("## Stack"),Z.push(""),$.stack){for(let[X,z]of Object.entries($.stack))if(N0(z))Z.push(`- **${R0(`stack.${X}`)}:** ${z.trim()}`)}if($.human_context){Z.push(""),Z.push("## Human Context"),Z.push("");for(let[X,z]of Object.entries($.human_context))if(N0(z))Z.push(`- **${R0(`human_context.${X}`)}:** ${z.trim()}`)}return Z.push(""),Z.join(`
241
+ `)}function wX($,Z){m0(lM($,"AGENTS.md"),iM(Z))}import{join as nM}from"path";function rM($){let Z=[];if(Z.push(s0($)),Z.push(""),Z.push("# .cursorrules"),Z.push(`# Auto-generated from project.faf — ${$.project?.name??"Project"}`),Z.push(""),$.project?.main_language)Z.push(`language: ${$.project.main_language}`);if($.stack){Z.push(""),Z.push("# Stack");for(let[X,z]of Object.entries($.stack))if(N0(z))Z.push(`# ${R0(`stack.${X}`)}: ${z.trim()}`)}return Z.push(""),Z.join(`
242
+ `)}function EX($,Z){m0(nM($,".cursorrules"),rM(Z),"# faf:start","# faf:end")}import{join as sM}from"path";function aM($){let Z=[];if(Z.push(s0($)),Z.push(""),Z.push(`# GEMINI.md — ${$.project?.name??"Project"}`),Z.push(""),Z.push("> Auto-generated from project.faf"),Z.push(""),$.project?.name)Z.push(`Project: ${$.project.name}`);if($.project?.goal)Z.push(`Goal: ${$.project.goal}`);if($.project?.main_language)Z.push(`Language: ${$.project.main_language}`);if($.stack){Z.push(""),Z.push("## Stack");for(let[X,z]of Object.entries($.stack))if(N0(z))Z.push(`- ${R0(`stack.${X}`)}: ${z.trim()}`)}return Z.push(""),Z.join(`
243
+ `)}function jX($,Z){m0(sM($,"GEMINI.md"),aM(Z))}import{join as SX}from"path";import{mkdirSync as oM}from"fs";var xX=[["install","Install with"],["build","Build with"],["test","Test with"],["lint","Lint with"],["run","Run with"],["start","Start with"],["dev","Run the dev server with"]],tM=new Set([...xX.map(([$])=>$),"cicd"]);function eM($){let Z=[],X=$.project?.name??"Project";if(Z.push(s0($)),Z.push(""),Z.push(`# GitHub Copilot Instructions — ${X}`),Z.push(""),Z.push("> Generated from project.faf by FAF. Copilot reads these instructions on every request in this repository — keep them short and broadly applicable."),Z.push(""),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(tM.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 xX){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??{},U=[["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(U.length>0)Z.push("## Project context","",...U,"");return Z.join(`
244
+ `)}function bX($,Z){oM(SX($,".github"),{recursive:!0}),m0(SX($,".github","copilot-instructions.md"),eM(Z))}import{existsSync as $N,mkdirSync as ZN,readFileSync as XN,writeFileSync as kX}from"fs";import{join as yX}from"path";var zN="https://mcpaas.live/grok/mcp/v1",fX="mcp_servers.grok-faf-mcp";function JN($){return[`[${fX}]`,`url = "${zN}"`,""].join(`
245
+ `)}function gX($,Z){let X=yX($,".grok"),z=yX(X,"config.toml"),J=JN(Z);if(!$N(z))return ZN(X,{recursive:!0}),kX(z,`# grok-faf-mcp — wired by FAF from project.faf
246
246
 
247
- `+J,"utf-8"),"created";let Q=dM(z,"utf-8");if(Q.includes(`[${SX}]`))return"unchanged";let Y=Q.endsWith(`
247
+ `+J,"utf-8"),"created";let Q=XN(z,"utf-8");if(Q.includes(`[${fX}]`))return"unchanged";let Y=Q.endsWith(`
248
248
 
249
249
  `)?"":Q.endsWith(`
250
250
  `)?`
251
251
  `:`
252
252
 
253
- `;return EX(z,Q+Y+J,"utf-8"),"merged"}c();import{writeFileSync as iM}from"fs";import{join as nM}from"path";var bX=Y4.orange,rM=Y4.cyan,sM=Y4.cyanDeep,aM="#FF9500",oM="#FF3B30",tM="#E6EDF3",eM="#6E7681",kX={TROPHY:{glyph:"\uD83C\uDFC6",color:bX},GOLD:{glyph:"★",color:bX},SILVER:{glyph:"◆",color:rM},BRONZE:{glyph:"◇",color:sM},GREEN:{glyph:"●",color:tM},YELLOW:{glyph:"●",color:aM},RED:{glyph:"○",color:oM},WHITE:{glyph:"♡",color:eM}};function Y1($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var yX=["who","what","why","where","when","how"];function W6($){return $.filter(([,Z])=>Z!==void 0&&Z!==null&&String(Z).trim()!=="").map(([Z,X])=>`<div class="row"><div class="k">${Y1(Z)}</div><div class="v">${Y1(X)}</div></div>`).join(`
254
- `)}function $N($,Z,X="project.faf"){let z=Y1($.project?.name??"Project"),J=Z.tier?.name??"WHITE",Q=kX[J]??kX.WHITE,Y=Z.inherited?Z.represents?`inherited from ${Y1(Z.represents)}`:"inherited":`${Z.score}%`,U=J==="TROPHY"&&!Z.inherited,W=$.human_context??{},G=yX.map((L)=>[L,W[L]]),q=Object.entries(W).filter(([L])=>!yX.includes(L)),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(([,L])=>L&&L!=="slotignored"&&String(L).trim()!==""),T=K.filter(([,L])=>L==="slotignored").length;return`<!DOCTYPE html>
253
+ `;return kX(z,Q+Y+J,"utf-8"),"merged"}c();import{writeFileSync as QN}from"fs";import{join as YN}from"path";var vX=W4.orange,WN=W4.cyan,UN=W4.cyanDeep,GN="#FF9500",qN="#FF3B30",VN="#E6EDF3",KN="#6E7681",hX={TROPHY:{glyph:"\uD83C\uDFC6",color:vX},GOLD:{glyph:"★",color:vX},SILVER:{glyph:"◆",color:WN},BRONZE:{glyph:"◇",color:UN},GREEN:{glyph:"●",color:VN},YELLOW:{glyph:"●",color:GN},RED:{glyph:"○",color:qN},WHITE:{glyph:"♡",color:KN}};function W1($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var uX=["who","what","why","where","when","how"];function G6($){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 HN($,Z,X="project.faf"){let z=W1($.project?.name??"Project"),J=Z.tier?.name??"WHITE",Q=hX[J]??hX.WHITE,Y=Z.inherited?Z.represents?`inherited from ${W1(Z.represents)}`:"inherited":`${Z.score}%`,W=J==="TROPHY"&&!Z.inherited,U=$.human_context??{},G=uX.map((B)=>[B,U[B]]),q=Object.entries(U).filter(([B])=>!uX.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,93 +292,99 @@ 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} ${Y1(J)}</span>
295
+ <span class="badge">${Q.glyph} ${W1(J)}</span>
296
296
  <span class="score">${Y}</span>
297
297
  </header>
298
298
  <div class="meter"><span></span></div>
299
- ${U?'<p class="award statline"><span class="awd-pre">✅ All Required slots filled.</span> <span class="awd-win">100% Trophy \uD83C\uDFC6 Awarded</span></p>':`<p class="muted statline">${Z.populated}/${Z.active} slots populated · ${Z.total} total${T?` · ${T} slotignored`:""}</p>`}
299
+ ${W?'<p class="award statline"><span class="awd-pre">✅ All Required slots filled.</span> <span class="awd-win">100% Trophy \uD83C\uDFC6 Awarded</span></p>':`<p class="muted statline">${Z.populated}/${Z.active} slots populated · ${Z.total} total${T?` · ${T} N/A`:""}</p>`}
300
300
 
301
301
  <section>
302
302
  <h2>The 6 W's</h2>
303
- ${W6(G)||'<p class="muted">No human_context yet.</p>'}
304
- ${q.length?W6(q):""}
303
+ ${G6(G)||'<p class="muted">No human_context yet.</p>'}
304
+ ${q.length?G6(q):""}
305
305
  </section>
306
306
 
307
307
  <section>
308
308
  <h2>Project</h2>
309
- ${W6(V)||'<p class="muted">—</p>'}
309
+ ${G6(V)||'<p class="muted">—</p>'}
310
310
  </section>
311
311
 
312
312
  <section>
313
313
  <h2>Stack</h2>
314
- ${H.length?W6(H):'<p class="muted">No active stack slots.</p>'}
314
+ ${H.length?G6(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>${Y1(X)}</strong><br>
318
+ Rendered on-demand from your current <strong>${W1(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 G6($,Z,X,z="project.faf"){iM(nM($,"project.html"),$N(Z,X,z),"utf-8")}import{writeFileSync as ZN}from"fs";import{join as XN}from"path";var fX="application/vnd.faf+yaml",zN="https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json",JN=/^[a-zA-Z0-9.-]+\/[a-zA-Z0-9._-]+$/;function QN($){let Z=String($.project?.name??"project").trim();if(Z.includes("/")&&JN.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 YN($){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 UN($,Z={}){return{faf:Z.fafPointer??"./project.faf",mediaType:fX,iana:`https://www.iana.org/assignments/media-types/${fX}`,deterministic:!0,...Z.scoreEndpoint?{scoreEndpoint:Z.scoreEndpoint}:{},generated:$.generated??Z.now??new Date().toISOString()}}function WN($,Z={}){let X={$schema:zN,name:QN($),version:String($.project?.version??"0.1.0"),description:YN($)},z=$.project?.name;if(z&&z.length<=100)X.title=z;let J=$.project?.homepage??$.project?.website??$.project?.url;if(J)X.websiteUrl=J;if(Z.remoteUrl)X.remotes=[{type:"streamable-http",url:Z.remoteUrl}];return X._meta={"one.faf/context":UN($,Z)},X}function gX($,Z,X={}){let z=WN(Z,X),J=XN($,"server-card");return ZN(J,JSON.stringify(z,null,2)+`
325
- `,"utf-8"),J}c();function U1($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
324
+ `}function q6($,Z,X,z="project.faf"){QN(YN($,"project.html"),HN(Z,X,z),"utf-8")}import{writeFileSync as BN}from"fs";import{join as LN}from"path";var mX="application/vnd.faf+yaml",MN="https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json",NN=/^[a-zA-Z0-9.-]+\/[a-zA-Z0-9._-]+$/;function dX($){let Z=String($.project?.name??"project").trim();if(Z.includes("/")&&NN.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 ON($){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 pX($,Z={}){return{faf:Z.fafPointer??"./project.faf",mediaType:mX,iana:`https://www.iana.org/assignments/media-types/${mX}`,deterministic:!0,...Z.scoreEndpoint?{scoreEndpoint:Z.scoreEndpoint}:{},generated:$.generated??Z.now??new Date().toISOString()}}function TN($,Z={}){let X={$schema:MN,name:dX($),version:String($.project?.version??"0.1.0"),description:ON($)},z=E3($)??$.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":pX($,Z)},X}var w3="io.modelcontextprotocol.registry/publisher-provided",cX=4096;function lX($,Z={}){let X={"one.faf/context":pX($,Z)},z=new TextEncoder().encode(JSON.stringify(X)).length;if(z>cX)throw Error(`publisher-provided _meta is ${z}B — exceeds the registry ${cX}B cap`);return{[w3]:X}}function iX($){return dX($)}function E3($){let Z=$.project?.title;if(typeof Z==="string"){let X=Z.trim();if(X&&X.length<=100)return X}return}function nX($,Z,X={}){let z=TN(Z,X),J=LN($,"server-card");return BN(J,JSON.stringify(z,null,2)+`
325
+ `,"utf-8"),J}c();function U1($={}){let Z=g();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=m(Z),J=$.all||!$.agents&&!$.cursor&&!$.gemini&&!$.copilot&&!$.grok&&!$.conductor&&!$.html&&!$.card;if(J||$.agents)RX(X,z),console.log(" AGENTS.md");if(J||$.cursor)FX(X,z),console.log(" .cursorrules");if(J||$.gemini)_X(X,z),console.log(" GEMINI.md");if(J||$.copilot)wX(X,z),console.log(" .github/copilot-instructions.md");if($.grok){let Y=xX(X,z);console.log(` .grok/config.toml (${Y})`)}if(J||$.html){let Y=X0(h(Z));G6(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=gX(X,z);console.log(` ${Y.replace(`${X}/`,"")}`)}console.log(`${D("exported")} ${B(`from ${Z}`)}`)}import{join as GN}from"path";import qN from"open";c();function VN($){if(process.env.CI)return!1;try{return qN($).catch(()=>{return}),!0}catch{return!1}}function vX(){let $=v();if(!$)console.error(`Error: project.faf not found
327
+ Run 'faf init' to create one.`),process.exit(2);let X=process.cwd(),z=m(Z),J=$.all||!$.agents&&!$.cursor&&!$.gemini&&!$.copilot&&!$.grok&&!$.conductor&&!$.html&&!$.card;if(J||$.agents)wX(X,z),console.log(" AGENTS.md");if(J||$.cursor)EX(X,z),console.log(" .cursorrules");if(J||$.gemini)jX(X,z),console.log(" GEMINI.md");if(J||$.copilot)bX(X,z),console.log(" .github/copilot-instructions.md");if($.grok){let Y=gX(X,z);console.log(` .grok/config.toml (${Y})`)}if(J||$.html){let Y=X0(h(Z));q6(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=nX(X,z);console.log(` ${Y.replace(`${X}/`,"")}`)}console.log(`${D("exported")} ${L(`from ${Z}`)}`)}import{existsSync as rX,readFileSync as DN,writeFileSync as IN}from"fs";import{resolve as j3}from"path";c();var AN=["$schema","name","title","description","icons","version","repository","websiteUrl","packages","remotes","_meta"];function sX($={}){let Z=$.faf?j3($.faf):g();if(!Z||!rX(Z))console.error(`Error: project.faf not found
328
328
 
329
- Run 'faf init' to create one.`),process.exit(2);let Z=process.cwd(),X=m($),z=X0(h($));G6(Z,X,z,$);let J=GN(Z,"project.html"),Q=VN(J);console.log(" project.html"),console.log(Q?`${D("opened")} ${B("in your browser")}`:`${D("rendered")} ${B(`file://${J}`)}`)}import{mkdirSync as KN,rmSync as HN,existsSync as BN}from"fs";import{join as hX,resolve as LN}from"path";import{execFileSync as MN}from"child_process";import{tmpdir as NN}from"os";c();function ON($){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 TN($){return $.replace(/\.git$/i,"").replace(/\/+$/,"").split("/").pop()||"project"}function DN($,Z,X){return["clone","--depth","1",...X?["--branch",X]:[],"--",$,Z]}function IN($,Z=process.cwd()){if($.stdout)return{outputPath:null};let X=$.output?LN(Z,$.output):hX(Z,"project.faf");if(BN(X)&&!$.force)throw Error(`${X} already exists — refusing to overwrite your context.
330
- `+" Use --force to replace it, --output <path> to write elsewhere, or --stdout to just view it.");return{outputPath:X}}function uX($,Z={},X=process.cwd()){let z;try{z=ON($)}catch(Y){console.error(`Error: ${Y.message}
329
+ Run 'faf init' to create one.`),process.exit(2);let X=m(Z),z=j3($.in??"./server.json");if(!rX(z))console.error(`Error: ${z} not found.
331
330
 
332
- Usage: faf git <url> [--ref <branch|tag>] [--output <path>] [--force] [--stdout]`),process.exit(1)}let J;try{J=IN(Z,X)}catch(Y){console.error(`Error: ${Y.message}`),process.exit(1);return}let Q=hX(NN(),`faf-git-${Date.now()}`);KN(Q,{recursive:!0});try{console.log(B(`cloning ${$}${Z.ref?` @ ${Z.ref}`:""}...`));try{MN("git",DN(z,Q,Z.ref),{stdio:"pipe"})}catch(G){let V=(G?.stderr?.toString()??"").trim().split(`
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(DN(z,"utf-8")),Y=J._meta?.[w3]?.["one.faf/context"]?.generated,W=$.generated??Y,U=iX(X),G=E3(X),q=lX(X,{fafPointer:"./project.faf",now:W}),V={...J,name:U,...$.setVersion?{version:$.setVersion}:{},_meta:{...J._meta??{},...q}};if(G)V.title=G;else delete V.title;let K={};for(let B of AN)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=j3($.out??z);IN(T,H),console.error(`${D("✓")} ${T} — name=${U} title=${G??"(none)"} ${L("(identity emitted from faf-cli)")}`)}import{join as RN}from"path";import FN from"open";c();function _N($){if(process.env.CI)return!1;try{return FN($).catch(()=>{return}),!0}catch{return!1}}function aX(){let $=g();if(!$)console.error(`Error: project.faf not found
334
+
335
+ Run 'faf init' to create one.`),process.exit(2);let Z=process.cwd(),X=m($),z=X0(h($));q6(Z,X,z,$);let J=RN(Z,"project.html"),Q=_N(J);console.log(" project.html"),console.log(Q?`${D("opened")} ${L("in your browser")}`:`${D("rendered")} ${L(`file://${J}`)}`)}import{mkdirSync as PN,rmSync as CN,existsSync as wN}from"fs";import{join as oX,resolve as EN}from"path";import{execFileSync as jN}from"child_process";import{tmpdir as SN}from"os";c();function xN($){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 bN($){return $.replace(/\.git$/i,"").replace(/\/+$/,"").split("/").pop()||"project"}function kN($,Z,X){return["clone","--depth","1",...X?["--branch",X]:[],"--",$,Z]}function yN($,Z=process.cwd()){if($.stdout)return{outputPath:null};let X=$.output?EN(Z,$.output):oX(Z,"project.faf");if(wN(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 tX($,Z={},X=process.cwd()){let z;try{z=xN($)}catch(Y){console.error(`Error: ${Y.message}
337
+
338
+ Usage: faf git <url> [--ref <branch|tag>] [--output <path>] [--force] [--stdout]`),process.exit(1)}let J;try{J=yN(Z,X)}catch(Y){console.error(`Error: ${Y.message}`),process.exit(1);return}let Q=oX(SN(),`faf-git-${Date.now()}`);PN(Q,{recursive:!0});try{console.log(L(`cloning ${$}${Z.ref?` @ ${Z.ref}`:""}...`));try{jN("git",kN(z,Q,Z.ref),{stdio:"pipe"})}catch(G){let V=(G?.stderr?.toString()??"").trim().split(`
333
339
  `).slice(-2).join(" ").trim()||"git clone failed",K=Z.ref?`
334
340
 
335
341
  (does the branch/tag '${Z.ref}' exist?)`:"";console.error(`Error: could not clone ${$}
336
342
 
337
- ${V}${K}`),process.exit(1)}let Y=z1(Q);if(Y.project&&/^faf-git-\d+$/.test(String(Y.project.name??"")))Y.project.name=TN(z);if(J.outputPath===null){process.stdout.write(K3(Y));return}s(J.outputPath,Y),console.log(`${D("created")} ${J.outputPath}`);let U=h(J.outputPath),W=q0(U0(U));z0(W,J.outputPath)}finally{HN(Q,{recursive:!0,force:!0})}}import{execFileSync as K$}from"child_process";import{readFileSync as lX,existsSync as iX,appendFileSync as AN}from"fs";import{relative as RN,join as FN}from"path";var W1=($)=>String($).trim(),_N="slotignored",mX=($)=>A0($)||typeof $==="string"&&$.trim().toLowerCase()===_N;function PN($,Z){let X=[],z=0,J=0;for(let Q of a){let Y=W4($,Q),U=W4(Z,Q),W=!mX(Y),G=!mX(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:W1(U)});else if(W&&!G)X.push({...V,kind:"removed",from:W1(Y)});else if(W&&G&&W1(Y)!==W1(U))X.push({...V,kind:"changed",from:W1(Y),to:W1(U)})}return{changes:X,filledBase:z,filledTarget:J}}function cX($){if(!$.trim())return 0;try{return X0($).score??0}catch{return 0}}function dX($){if(!$.trim())return{};try{return x9($)??{}}catch{return{}}}function K6($,Z){let{changes:X,filledBase:z,filledTarget:J}=PN(dX($),dX(Z)),Q=cX($),Y=cX(Z);return{changes:X,scoreBase:Q,scoreTarget:Y,scoreDelta:Y-Q,filledBase:z,filledTarget:J}}var CN={added:"+",removed:"-",changed:"~"},pX=($)=>$>0?`+${$}`:`${$}`,q6=($,Z=64)=>$.length>Z?`${$.slice(0,Z-1)}…`:$;function nX($,Z,X){let z=[],J=k0(V$($.scoreBase)),Q=k0(V$($.scoreTarget));if(z.push(`project.faf ${Z} → ${X}`),z.push(`Score: ${$.scoreBase}% ${J} → ${$.scoreTarget}% ${Q} (${pX($.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=CN[U.kind],G=U.label.padEnd(16);if(U.kind==="changed")z.push(` ${W} ${G} ${q6(U.from)} → ${q6(U.to)}`);else if(U.kind==="added")z.push(` ${W} ${G} ${q6(U.to)} (added)`);else z.push(` ${W} ${G} ${q6(U.from)} (removed)`)}}return z.push(""),z.push(`Slots filled: ${$.filledBase} → ${$.filledTarget} (${pX($.filledTarget-$.filledBase)})`),z.join(`
338
- `)}function wN($,Z){try{return K$("git",["rev-parse","--verify","--quiet",`${$}^{commit}`],{cwd:Z,stdio:["pipe","pipe","pipe"]}),!0}catch{return!1}}function q4($,Z){if(!wN($,Z))console.error(`Error: unknown git ref '${$}' — use a branch, tag, or commit that exists.`),process.exit(2)}function G1($,Z,X){try{return K$("git",["show",`${$}:${Z}`],{cwd:X,encoding:"utf-8",stdio:["pipe","pipe","pipe"]})}catch{return""}}function rX($){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"&&iX(Q)?lX(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=K6(X($[1]),X($[4]));console.log(nX(J,z($[1],$[2]),z($[4],$[5])))}catch(X){console.log(`${Z} — faf diff unavailable (${X instanceof Error?X.message:"error"})`)}}var V6="*.faf diff=faf";function C3($){let[Z,...X]=$.trim().split(/\s+/);try{return K$(Z,X,{stdio:["pipe","pipe","pipe"]}),!0}catch{return!1}}function sX($){try{return K$("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 EN($){let Z=sX($),X=FN(Z,".gitattributes"),z=iX(X)?lX(X,"utf-8"):"";if(!z.split(`
339
- `).some((J)=>J.trim()===V6))AN(X,`${z&&!z.endsWith(`
343
+ ${V}${K}`),process.exit(1)}let Y=J1(Q);if(Y.project&&/^faf-git-\d+$/.test(String(Y.project.name??"")))Y.project.name=bN(z);if(J.outputPath===null){process.stdout.write(H3(Y));return}s(J.outputPath,Y),console.log(`${D("created")} ${J.outputPath}`);let W=h(J.outputPath),U=q0(W0(W));z0(U,J.outputPath)}finally{CN(Q,{recursive:!0,force:!0})}}import{execFileSync as K$}from"child_process";import{readFileSync as zz,existsSync as Jz,appendFileSync as fN}from"fs";import{join as gN}from"path";var G1=($)=>String($).trim(),vN="slotignored",eX=($)=>A0($)||typeof $==="string"&&$.trim().toLowerCase()===vN;function hN($,Z){let X=[],z=0,J=0;for(let Q of a){let Y=G4($,Q),W=G4(Z,Q),U=!eX(Y),G=!eX(W);if(U)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(!U&&G)X.push({...V,kind:"added",to:G1(W)});else if(U&&!G)X.push({...V,kind:"removed",from:G1(Y)});else if(U&&G&&G1(Y)!==G1(W))X.push({...V,kind:"changed",from:G1(Y),to:G1(W)})}return{changes:X,filledBase:z,filledTarget:J}}function $z($){if(!$.trim())return 0;try{return X0($).score??0}catch{return 0}}function Zz($){if(!$.trim())return{};try{return g9($)??{}}catch{return{}}}function H6($,Z){let{changes:X,filledBase:z,filledTarget:J}=hN(Zz($),Zz(Z)),Q=$z($),Y=$z(Z);return{changes:X,scoreBase:Q,scoreTarget:Y,scoreDelta:Y-Q,filledBase:z,filledTarget:J}}var uN={added:"+",removed:"-",changed:"~"},Xz=($)=>$>0?`+${$}`:`${$}`,V6=($,Z=64)=>$.length>Z?`${$.slice(0,Z-1)}…`:$;function Qz($,Z,X){let z=[],J=k0(V$($.scoreBase)),Q=k0(V$($.scoreTarget));if(z.push(`project.faf ${Z} → ${X}`),z.push(`Score: ${$.scoreBase}% ${J} → ${$.scoreTarget}% ${Q} (${Xz($.scoreDelta)})`),z.push(""),$.changes.length===0)z.push(" (no slot changes)");else{let Y="";for(let W of $.changes){if(W.category!==Y)z.push(` ${W.category}`),Y=W.category;let U=uN[W.kind],G=W.label.padEnd(16);if(W.kind==="changed")z.push(` ${U} ${G} ${V6(W.from)} → ${V6(W.to)}`);else if(W.kind==="added")z.push(` ${U} ${G} ${V6(W.to)} (added)`);else z.push(` ${U} ${G} ${V6(W.from)} (removed)`)}}return z.push(""),z.push(`Slots filled: ${$.filledBase} → ${$.filledTarget} (${Xz($.filledTarget-$.filledBase)})`),z.join(`
344
+ `)}function mN($,Z){try{return K$("git",["rev-parse","--verify","--quiet",`${$}^{commit}`],{cwd:Z,stdio:["pipe","pipe","pipe"]}),!0}catch{return!1}}function V4($,Z){if(!mN($,Z))console.error(`Error: unknown git ref '${$}' — use a branch, tag, or commit that exists.`),process.exit(2)}function q1($,Z,X){try{return K$("git",["show",`${$}:${Z}`],{cwd:X,encoding:"utf-8",stdio:["pipe","pipe","pipe"]})}catch{return""}}function Yz($){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"&&Jz(Q)?zz(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=H6(X($[1]),X($[4]));console.log(Qz(J,z($[1],$[2]),z($[4],$[5])))}catch(X){console.log(`${Z} — faf diff unavailable (${X instanceof Error?X.message:"error"})`)}}var K6="*.faf diff=faf";function S3($){let[Z,...X]=$.trim().split(/\s+/);try{return K$(Z,X,{stdio:["pipe","pipe","pipe"]}),!0}catch{return!1}}function Wz($){try{return K$("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 cN($){let Z=Wz($),X=gN(Z,".gitattributes"),z=Jz(X)?zz(X,"utf-8"):"";if(!z.split(`
345
+ `).some((J)=>J.trim()===K6))fN(X,`${z&&!z.endsWith(`
340
346
  `)?`
341
- `:""}${V6}
342
- `),console.log(`✅ .gitattributes ${V6}`);else console.log(`• .gitattributes already opts in (${V6})`);if(K$("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."),!C3("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 jN($){sX($);try{K$("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 aX($,Z={},X=process.cwd()){if(Z.installDriver)return EN(X);if(Z.uninstallDriver)return jN(X);let z=v(X);if(!z)console.error(`Error: project.faf not found
347
+ `:""}${K6}
348
+ `),console.log(`✅ .gitattributes ${K6}`);else console.log(`• .gitattributes already opts in (${K6})`);if(K$("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."),!S3("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 dN($){Wz($);try{K$("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 Uz($,Z={},X=process.cwd()){if(Z.installDriver)return cN(X);if(Z.uninstallDriver)return dN(X);let z=g(X);if(!z)console.error(`Error: project.faf not found
343
349
 
344
- Run 'faf init' to create one.`),process.exit(2);let J;try{J=K$("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=RN(J,z).split("\\").join("/"),Y,U,W,G;if(!$)Y="HEAD",U="(working tree)",W=G1("HEAD",Q,X),G=h(z);else if($.includes("...")){let[V,K]=$.split("...");q4(V,X),q4(K,X);let H;try{H=K$("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=G1(H,Q,X),G=G1(K,Q,X)}else if($.includes("..")){let[V,K]=$.split("..");q4(V,X),q4(K,X),Y=V,U=K,W=G1(V,Q,X),G=G1(K,Q,X)}else q4($,X),Y=$,U="(working tree)",W=G1($,Q,X),G=h(z);let q=K6(W,G);if(Z.json)console.log(JSON.stringify({base:Y,target:U,...q},null,2));else console.log(nX(q,Y,U))}import{execFileSync as w3}from"child_process";import{relative as SN}from"path";function xN($){if(!$.trim())return 0;try{return X0($).score??0}catch{return 0}}var bN=($)=>$>0?`+${$}`:`${$}`;function kN($){let Z=$.map((X)=>({...X,score:xN(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 yN($,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?" ·":bN(z.delta).padStart(4);X.push(` ${J} ${Q} ${z.date} ${z.hex} ${k0(V$(z.score))} ${z.subject}`)}return X.join(`
345
- `)}function fN($,Z,X){try{return w3("git",["show",`${$}:${Z}`],{cwd:X,encoding:"utf-8",stdio:["pipe","pipe","pipe"]})}catch{return""}}function oX($={},Z=process.cwd()){let X=v(Z);if(!X)console.error(`Error: project.faf not found
350
+ Run 'faf init' to create one.`),process.exit(2);let J;try{J=K$("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=t$(z,X),Y,W,U,G;if(!$)Y="HEAD",W="(working tree)",U=q1("HEAD",Q,X),G=h(z);else if($.includes("...")){let[V,K]=$.split("...");V4(V,X),V4(K,X);let H;try{H=K$("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),W=K,U=q1(H,Q,X),G=q1(K,Q,X)}else if($.includes("..")){let[V,K]=$.split("..");V4(V,X),V4(K,X),Y=V,W=K,U=q1(V,Q,X),G=q1(K,Q,X)}else V4($,X),Y=$,W="(working tree)",U=q1($,Q,X),G=h(z);let q=H6(U,G);if(Z.json)console.log(JSON.stringify({base:Y,target:W,...q},null,2));else console.log(Qz(q,Y,W))}import{execFileSync as x3}from"child_process";function pN($){if(!$.trim())return 0;try{return X0($).score??0}catch{return 0}}var lN=($)=>$>0?`+${$}`:`${$}`;function iN($){let Z=$.map((X)=>({...X,score:pN(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 nN($,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?" ·":lN(z.delta).padStart(4);X.push(` ${J} ${Q} ${z.date} ${z.hex} ${k0(V$(z.score))} ${z.subject}`)}return X.join(`
351
+ `)}function rN($,Z,X){try{return x3("git",["show",`${$}:${Z}`],{cwd:X,encoding:"utf-8",stdio:["pipe","pipe","pipe"]})}catch{return""}}function Gz($={},Z=process.cwd()){let X=g(Z);if(!X)console.error(`Error: project.faf not found
346
352
 
347
- Run 'faf init' to create one.`),process.exit(2);let z;try{z=w3("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=SN(z,X).split("\\").join("/"),Q=$.all?0:Math.max(0,parseInt($.limit??"20",10)||20),Y="";try{Y=w3("git",["log","--follow","--format=%h%x1f%ad%x1f%s","--date=short","--",J],{cwd:Z,encoding:"utf-8"})}catch{Y=""}let U=Y.split(`
348
- `).filter(Boolean).map((H)=>{let[T,L,N]=H.split("\x1F");return{hex:T,date:L,subject:N??""}}),W=Q>0?Math.min(U.length,Q+1):U.length,G=U.slice(0,W).map((H)=>({...H,raw:fN(H.hex,J,Z)})),q=kN(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=yN(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=x3("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=t$(X,Z),Q=$.all?0:Math.max(0,parseInt($.limit??"20",10)||20),Y="";try{Y=x3("git",["log","--follow","--format=%h%x1f%ad%x1f%s","--date=short","--",J],{cwd:Z,encoding:"utf-8"})}catch{Y=""}let W=Y.split(`
354
+ `).filter(Boolean).map((H)=>{let[T,B,N]=H.split("\x1F");return{hex:T,date:B,subject:N??""}}),U=Q>0?Math.min(W.length,Q+1):W.length,G=W.slice(0,U).map((H)=>({...H,raw:rN(H.hex,J,Z)})),q=iN(G),V=Q>0?q.slice(0,Q):q;if($.reverse)V=[...V].reverse();let K=W.length;if($.json)console.log(JSON.stringify({file:J,total:K,count:V.length,entries:V},null,2));else{let H=nN(V,J.split("/").pop()??"project.faf");if(Q>0&&K>V.length)H+=`
349
355
 
350
- … showing ${V.length} of ${K} commits — \`faf log --all\` for the full timeline.`;console.log(H)}}import{execFileSync as H6}from"child_process";import{existsSync as E3,readFileSync as j3,writeFileSync as $z,chmodSync as gN,mkdirSync as vN}from"fs";import{relative as hN,resolve as uN,dirname as mN}from"path";var B6="# >>> faf >>>",V4="# <<< faf <<<",tX="faf hooks-run",cN=($)=>$>0?`+${$}`:`${$}`;function Zz($){return H6("git",["rev-parse","--show-toplevel"],{cwd:$,encoding:"utf-8"}).trim()}function eX($,Z){try{return H6("git",["show",$],{cwd:Z,encoding:"utf-8",stdio:["pipe","pipe","pipe"]})}catch{return null}}function Xz($,Z){try{return H6("git",["config","--get",$],{cwd:Z,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim()||null}catch{return null}}function S3($){let Z=H6("git",["rev-parse","--git-path","hooks/pre-commit"],{cwd:$,encoding:"utf-8"}).trim();return uN($,Z)}function zz($={},Z=process.cwd()){try{let X;try{X=Zz(Z)}catch{return}let z=v(Z);if(!z)return;let J=hN(X,z).split("\\").join("/"),Q=eX(`:${J}`,Z);if(Q===null)return;let Y=eX(`HEAD:${J}`,Z)??"",U=K6(Y,Q),W=`${U.scoreBase}% → ${U.scoreTarget}% (${cN(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 dN($,Z){let X=$.trim().split(/\s+/)[0],z=Z?`${$} --strict || exit 1`:`${$} || true`;return[B6,`if command -v ${X} >/dev/null 2>&1 && git diff --cached --name-only 2>/dev/null | grep -qE '\\.faf$'; then`,` ${z}`,"fi",V4,""].join(`
351
- `)}function pN($,Z={}){let X;try{X=Zz($)}catch{return console.error("Error: not a git repository — run `git init` first."),!1}let z=Xz("core.hooksPath",$);if(z){let q=Z.runnerCmd??tX;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=S3($),Q=Z.runnerCmd??tX;if(!C3(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=dN(Q,!!Z.strict),U=E3(J)?j3(J,"utf-8"):"",W=U.indexOf(B6),G=U.indexOf(V4);if(W!==-1&&G!==-1){let q=U.slice(G+V4.length).replace(/^\n/,"");U=U.slice(0,W)+Y+q}else if(U.trim())U=U.endsWith(`
352
- `)?`${U}
353
- ${Y}`:`${U}
356
+ … showing ${V.length} of ${K} commits — \`faf log --all\` for the full timeline.`;console.log(H)}}import{execFileSync as B6}from"child_process";import{existsSync as b3,readFileSync as k3,writeFileSync as Kz,chmodSync as sN,mkdirSync as aN}from"fs";import{resolve as oN,dirname as tN}from"path";var L6="# >>> faf >>>",K4="# <<< faf <<<",qz="faf hooks-run",eN=($)=>$>0?`+${$}`:`${$}`;function Hz($){return B6("git",["rev-parse","--show-toplevel"],{cwd:$,encoding:"utf-8"}).trim()}function Vz($,Z){try{return B6("git",["show",$],{cwd:Z,encoding:"utf-8",stdio:["pipe","pipe","pipe"]})}catch{return null}}function Bz($,Z){try{return B6("git",["config","--get",$],{cwd:Z,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim()||null}catch{return null}}function y3($){let Z=B6("git",["rev-parse","--git-path","hooks/pre-commit"],{cwd:$,encoding:"utf-8"}).trim();return oN($,Z)}function Lz($={},Z=process.cwd()){try{let X;try{X=Hz(Z)}catch{return}let z=g(Z);if(!z)return;let J=t$(z,Z),Q=Vz(`:${J}`,Z);if(Q===null)return;let Y=Vz(`HEAD:${J}`,Z)??"",W=H6(Y,Q),U=`${W.scoreBase}% → ${W.scoreTarget}% (${eN(W.scoreDelta)})`;if(W.scoreDelta<0){if(console.error(`⚠ faf: context regressed ${U} — ${W.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 ${U}`)}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[L6,`if command -v ${X} >/dev/null 2>&1 && git diff --cached --name-only 2>/dev/null | grep -qE '\\.faf$'; then`,` ${z}`,"fi",K4,""].join(`
357
+ `)}function ZO($,Z={}){let X;try{X=Hz($)}catch{return console.error("Error: not a git repository — run `git init` first."),!1}let z=Bz("core.hooksPath",$);if(z){let q=Z.runnerCmd??qz;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=y3($),Q=Z.runnerCmd??qz;if(!S3(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),W=b3(J)?k3(J,"utf-8"):"",U=W.indexOf(L6),G=W.indexOf(K4);if(U!==-1&&G!==-1){let q=W.slice(G+K4.length).replace(/^\n/,"");W=W.slice(0,U)+Y+q}else if(W.trim())W=W.endsWith(`
358
+ `)?`${W}
359
+ ${Y}`:`${W}
354
360
 
355
- ${Y}`;else U=`#!/bin/sh
356
- ${Y}`;return vN(mN(J),{recursive:!0}),$z(J,U),gN(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 lN($){let Z;try{Z=S3($)}catch{return console.error("Error: not a git repository."),!1}if(!E3(Z))return console.log("• no pre-commit hook to clean."),!0;let X=j3(Z,"utf-8"),z=X.indexOf(B6),J=X.indexOf(V4);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+V4.length).replace(/^\n/,"")).replace(/^#!\/bin\/sh\s*$/,`#!/bin/sh
357
- `);return $z(Z,Q),console.log("✅ faf pre-commit block removed (other hook content preserved)."),!0}function iN($){let Z;try{Z=S3($)}catch{console.error("Error: not a git repository.");return}let X=Xz("core.hooksPath",$),z=E3(Z)?j3(Z,"utf-8"):"",J=z.includes(B6),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 Jz($={}){let Z=process.cwd();if($.install){if(!pN(Z,{strict:$.strict}))process.exit(2);return}if($.uninstall){if(!lN(Z))process.exit(2);return}iN(Z)}c();function Qz($={}){if($.version||Object.keys($).length===0)rN()}function rN(){let $=x3();console.log(`${D(I("faf"))} v${$.version}`),console.log(B(`kernel ${f9()} IANA application/vnd.faf+yaml`))}var K4=[{name:"HTML",extensions:[".html",".htm"],category:"web"},{name:"CSS",extensions:[".css"],category:"web"},{name:"JavaScript",extensions:[".js",".mjs",".cjs"],category:"web"},{name:"TypeScript",extensions:[".ts",".tsx",".mts",".cts"],category:"web"},{name:"JSX",extensions:[".jsx"],category:"web"},{name:"Vue",extensions:[".vue"],category:"web"},{name:"Svelte",extensions:[".svelte"],category:"web"},{name:"Astro",extensions:[".astro"],category:"web"},{name:"JSON",extensions:[".json"],category:"data"},{name:"YAML",extensions:[".yml",".yaml"],category:"data"},{name:"TOML",extensions:[".toml"],category:"data"},{name:"XML",extensions:[".xml"],category:"data"},{name:"CSV",extensions:[".csv"],category:"data"},{name:"INI",extensions:[".ini",".cfg"],category:"config"},{name:"Env",extensions:[".env"],category:"config"},{name:"Dockerfile",extensions:["Dockerfile"],category:"config"},{name:"Rust",extensions:[".rs"],category:"systems"},{name:"Go",extensions:[".go"],category:"systems"},{name:"C",extensions:[".c",".h"],category:"systems"},{name:"C++",extensions:[".cpp",".cc",".hpp"],category:"systems"},{name:"Zig",extensions:[".zig"],category:"systems"},{name:"Python",extensions:[".py"],category:"scripting"},{name:"Ruby",extensions:[".rb"],category:"scripting"},{name:"Shell",extensions:[".sh",".bash",".zsh"],category:"scripting"},{name:"Lua",extensions:[".lua"],category:"scripting"},{name:"Java",extensions:[".java"],category:"jvm"},{name:"Kotlin",extensions:[".kt",".kts"],category:"jvm"},{name:"Scala",extensions:[".scala"],category:"jvm"},{name:"C#",extensions:[".cs"],category:"dotnet"},{name:"F#",extensions:[".fs"],category:"dotnet"},{name:"Swift",extensions:[".swift"],category:"mobile"},{name:"Dart",extensions:[".dart"],category:"mobile"},{name:"Markdown",extensions:[".md",".mdx"],category:"docs"},{name:"LaTeX",extensions:[".tex"],category:"docs"},{name:"reStructuredText",extensions:[".rst"],category:"docs"},{name:"FAF",extensions:[".faf"],category:"faf"},{name:"FAFb",extensions:[".fafb"],category:"faf"}];c();function Yz(){console.log(`${D("formats")} ${B("— supported file types")}
358
- `);let $=new Map;for(let Z of K4){let X=$.get(Z.category)??[];X.push(Z),$.set(Z.category,X)}for(let[Z,X]of $){console.log(` ${I(Z)}`);for(let z of X)console.log(` ${z.name} ${B(z.extensions.join(", "))}`);console.log()}console.log(B(` ${K4.length} formats across ${$.size} categories`))}c();import{readdirSync as sN,rmSync as aN}from"fs";import{tmpdir as oN}from"os";import{join as tN}from"path";function Uz(){let $=oN(),Z=0;try{let X=sN($);for(let z of X)if(z.startsWith("faf-git-"))aN(tN($,z),{recursive:!0,force:!0}),Z++}catch{}if(Z>0)console.log(`${D("cleared")} ${Z} cached director${Z===1?"y":"ies"}`);else console.log(B("nothing to clear"))}function Wz($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
361
+ ${Y}`;else W=`#!/bin/sh
362
+ ${Y}`;return aN(tN(J),{recursive:!0}),Kz(J,W),sN(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 XO($){let Z;try{Z=y3($)}catch{return console.error("Error: not a git repository."),!1}if(!b3(Z))return console.log("• no pre-commit hook to clean."),!0;let X=k3(Z,"utf-8"),z=X.indexOf(L6),J=X.indexOf(K4);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+K4.length).replace(/^\n/,"")).replace(/^#!\/bin\/sh\s*$/,`#!/bin/sh
363
+ `);return Kz(Z,Q),console.log("✅ faf pre-commit block removed (other hook content preserved)."),!0}function zO($){let Z;try{Z=y3($)}catch{console.error("Error: not a git repository.");return}let X=Bz("core.hooksPath",$),z=b3(Z)?k3(Z,"utf-8"):"",J=z.includes(L6),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 Mz($={}){let Z=process.cwd();if($.install){if(!ZO(Z,{strict:$.strict}))process.exit(2);return}if($.uninstall){if(!XO(Z))process.exit(2);return}zO(Z)}c();function Nz($={}){if($.version||Object.keys($).length===0)QO()}function QO(){let $=f3();console.log(`${D(I("faf"))} v${$.version}`),console.log(L(`kernel ${m9()} IANA application/vnd.faf+yaml`))}var H4=[{name:"HTML",extensions:[".html",".htm"],category:"web"},{name:"CSS",extensions:[".css"],category:"web"},{name:"JavaScript",extensions:[".js",".mjs",".cjs"],category:"web"},{name:"TypeScript",extensions:[".ts",".tsx",".mts",".cts"],category:"web"},{name:"JSX",extensions:[".jsx"],category:"web"},{name:"Vue",extensions:[".vue"],category:"web"},{name:"Svelte",extensions:[".svelte"],category:"web"},{name:"Astro",extensions:[".astro"],category:"web"},{name:"JSON",extensions:[".json"],category:"data"},{name:"YAML",extensions:[".yml",".yaml"],category:"data"},{name:"TOML",extensions:[".toml"],category:"data"},{name:"XML",extensions:[".xml"],category:"data"},{name:"CSV",extensions:[".csv"],category:"data"},{name:"INI",extensions:[".ini",".cfg"],category:"config"},{name:"Env",extensions:[".env"],category:"config"},{name:"Dockerfile",extensions:["Dockerfile"],category:"config"},{name:"Rust",extensions:[".rs"],category:"systems"},{name:"Go",extensions:[".go"],category:"systems"},{name:"C",extensions:[".c",".h"],category:"systems"},{name:"C++",extensions:[".cpp",".cc",".hpp"],category:"systems"},{name:"Zig",extensions:[".zig"],category:"systems"},{name:"Python",extensions:[".py"],category:"scripting"},{name:"Ruby",extensions:[".rb"],category:"scripting"},{name:"Shell",extensions:[".sh",".bash",".zsh"],category:"scripting"},{name:"Lua",extensions:[".lua"],category:"scripting"},{name:"Java",extensions:[".java"],category:"jvm"},{name:"Kotlin",extensions:[".kt",".kts"],category:"jvm"},{name:"Scala",extensions:[".scala"],category:"jvm"},{name:"C#",extensions:[".cs"],category:"dotnet"},{name:"F#",extensions:[".fs"],category:"dotnet"},{name:"Swift",extensions:[".swift"],category:"mobile"},{name:"Dart",extensions:[".dart"],category:"mobile"},{name:"Markdown",extensions:[".md",".mdx"],category:"docs"},{name:"LaTeX",extensions:[".tex"],category:"docs"},{name:"reStructuredText",extensions:[".rst"],category:"docs"},{name:"FAF",extensions:[".faf"],category:"faf"},{name:"FAFb",extensions:[".fafb"],category:"faf"}];c();function Oz(){console.log(`${D("formats")} ${L("— supported file types")}
364
+ `);let $=new Map;for(let Z of H4){let X=$.get(Z.category)??[];X.push(Z),$.set(Z.category,X)}for(let[Z,X]of $){console.log(` ${I(Z)}`);for(let z of X)console.log(` ${z.name} ${L(z.extensions.join(", "))}`);console.log()}console.log(L(` ${H4.length} formats across ${$.size} categories`))}c();import{readdirSync as YO,rmSync as WO}from"fs";import{tmpdir as UO}from"os";import{join as GO}from"path";function Tz(){let $=UO(),Z=0;try{let X=YO($);for(let z of X)if(z.startsWith("faf-git-"))WO(GO($,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 Dz($={}){let Z=g();if(!Z)console.error(`Error: project.faf not found
359
365
 
360
- Run 'faf init' to create one.`),process.exit(2);if($.json){let X=m(Z);console.log(JSON.stringify(X,null,2))}else{let X=h(Z);console.log(X)}}c();function Gz(){let $=v();if(!$)console.error(`Error: project.faf not found
366
+ Run 'faf init' to create one.`),process.exit(2);if($.json){let X=m(Z);console.log(JSON.stringify(X,null,2))}else{let X=h(Z);console.log(X)}}c();function Iz(){let $=g();if(!$)console.error(`Error: project.faf not found
361
367
 
362
- Run 'faf init' to create one.`),process.exit(2);let Z=m($),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(B("no populated slots"));return}console.log(X.join(`
363
- `))}import{existsSync as eN,statSync as qz}from"fs";import{join as $O}from"path";c();var ZO=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"];function Vz(){let $=v();if(!$)console.error(`Error: project.faf not found
368
+ Run 'faf init' to create one.`),process.exit(2);let Z=m($),X=[];for(let z of a){let[J,Q]=z.path.split("."),W=Z[J]?.[Q];if(A0(W)||W==="slotignored")continue;X.push(`${z.path}: ${W}`)}if(X.length===0){console.log(L("no populated slots"));return}console.log(X.join(`
369
+ `))}import{existsSync as qO,statSync as Az}from"fs";import{join as VO}from"path";c();var KO=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"];function Rz(){let $=g();if(!$)console.error(`Error: project.faf not found
364
370
 
365
- Run 'faf init' to create one.`),process.exit(2);let Z=process.cwd(),X=qz($).mtimeMs;console.log(`${D("drift")} ${B("— context file sync status")}
366
- `),console.log(` ${I(".faf")} ${B(b3(X))}`);let z=0;for(let J of ZO){let Q=$O(Z,J);if(!eN(Q)){console.log(` ${B("○")} ${J} ${B("missing")}`);continue}let Y=qz(Q).mtimeMs,U=Y-X;if(Math.abs(U)<1000)console.log(` ${D("●")} ${J} ${B("in sync")}`);else if(U>0)console.log(` ${I("!")} ${J} ${I("newer")} ${B(b3(Y))}`),z++;else console.log(` ${B("○")} ${J} ${B("older")} ${B(b3(Y))}`),z++}if(z>0)console.log(B(`
367
- run ${I("'faf sync'")} to resolve drift`))}function b3($){let Z=Date.now()-$,X=Math.floor(Z/1000);if(X<60)return`${X}s ago`;let z=Math.floor(X/60);if(z<60)return`${z}m ago`;let J=Math.floor(z/60);if(J<24)return`${J}h ago`;return`${Math.floor(J/24)}d ago`}c();function Kz($,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=Az($).mtimeMs;console.log(`${D("drift")} ${L("— context file sync status")}
372
+ `),console.log(` ${I(".faf")} ${L(g3(X))}`);let z=0;for(let J of KO){let Q=VO(Z,J);if(!qO(Q)){console.log(` ${L("○")} ${J} ${L("missing")}`);continue}let Y=Az(Q).mtimeMs,W=Y-X;if(Math.abs(W)<1000)console.log(` ${D("●")} ${J} ${L("in sync")}`);else if(W>0)console.log(` ${I("!")} ${J} ${I("newer")} ${L(g3(Y))}`),z++;else console.log(` ${L("○")} ${J} ${L("older")} ${L(g3(Y))}`),z++}if(z>0)console.log(L(`
373
+ run ${I("'faf sync'")} to resolve drift`))}function g3($){let Z=Date.now()-$,X=Math.floor(Z/1000);if(X<60)return`${X}s ago`;let z=Math.floor(X/60);if(z<60)return`${z}m ago`;let J=Math.floor(z/60);if(J<24)return`${J}h ago`;return`${Math.floor(J/24)}d ago`}c();function Fz($,Z){if(!$||Z===void 0)console.error(`Usage: faf edit <path> <value>
368
374
 
369
- Example: faf edit project.name "My Project"`),process.exit(1);let X=v();if(!X)console.error(`Error: project.faf not found
375
+ Example: faf edit project.name "My Project"`),process.exit(1);let X=g();if(!X)console.error(`Error: project.faf not found
370
376
 
371
- Run 'faf init' to create one.`),process.exit(2);let z=m(X),J=$.split(".");if(J.length!==2)console.error("Error: path must be section.field (e.g. project.name)"),process.exit(1);let[Q,Y]=J;if(!z[Q]||typeof z[Q]!=="object")z[Q]={};z[Q][Y]=Z,s(X,z),console.log(`${D("updated")} ${$} ${B("→")} ${Z}`)}import{existsSync as L6,readFileSync as k3}from"fs";import{join as H4}from"path";c();function Hz(){let $=process.cwd(),Z=[],X={faf_version:"2.5.0",project:{}},z=H4($,"CLAUDE.md");if(L6(z)){let W=k3(z,"utf-8"),G=Y6(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=H4($,"AGENTS.md");if(L6(J)){let W=k3(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=H4($,"GEMINI.md");if(L6(Q)){let W=k3(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=H4($,".cursorrules");if(L6(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=m(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(`${D("◆")} recover merged into ${U}`)}else{let W=H4($,"project.faf");s(W,X),console.log(`${D("◆")} recover created ${W}`)}console.log(B(` sources: ${Z.join(", ")}`))}c();var B4="2.5.0";function Bz($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
377
+ Run 'faf init' to create one.`),process.exit(2);let z=m(X),J=$.split(".");if(J.length!==2)console.error("Error: path must be section.field (e.g. project.name)"),process.exit(1);let[Q,Y]=J;if(!z[Q]||typeof z[Q]!=="object")z[Q]={};z[Q][Y]=Z,s(X,z),console.log(`${D("updated")} ${$} ${L("→")} ${Z}`)}import{existsSync as M6,readFileSync as v3}from"fs";import{join as B4}from"path";c();function _z(){let $=process.cwd(),Z=[],X={faf_version:"2.5.0",project:{}},z=B4($,"CLAUDE.md");if(M6(z)){let U=v3(z,"utf-8"),G=W6(U);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=B4($,"AGENTS.md");if(M6(J)){let U=v3(J,"utf-8");if(!X.project.name){let G=U.match(/^#\s+(.+)/m);if(G)X.project.name=G[1].trim()}Z.push("AGENTS.md")}let Q=B4($,"GEMINI.md");if(M6(Q)){let U=v3(Q,"utf-8");if(!X.project.name){let G=U.match(/^#\s+(.+)/m);if(G)X.project.name=G[1].trim()}Z.push("GEMINI.md")}let Y=B4($,".cursorrules");if(M6(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 W=g($);if(W){let U=m(W);if(!U.project)U.project={};if(X.project.name&&!U.project.name)U.project.name=X.project.name;if(X.project.goal&&!U.project.goal)U.project.goal=X.project.goal;if(X.project.main_language&&!U.project.main_language)U.project.main_language=X.project.main_language;s(W,U),console.log(`${D("◆")} recover merged into ${W}`)}else{let U=B4($,"project.faf");s(U,X),console.log(`${D("◆")} recover created ${U}`)}console.log(L(` sources: ${Z.join(", ")}`))}c();var L4="2.5.0";function Pz($={}){let Z=g();if(!Z)console.error(`Error: project.faf not found
372
378
 
373
- Run 'faf init' to create one.`),process.exit(2);let X=m(Z),z=X.faf_version??"unknown";if(z===B4){console.log(`${D("◆")} migrate already at v${B4}`);return}if(X.faf_version=B4,!X.project)X.project={};if(!X.stack)X.stack={};if(!X.human_context)X.human_context={};if(!X.monorepo)X.monorepo={};if($.dryRun){console.log(`${D("◆")} migrate ${B("(dry run)")} v${z} → v${B4}`),console.log(B(` would update ${Z}`));return}s(Z,X),console.log(`${D("◆")} migrate v${z} → v${B4}`),console.log(B(` updated ${Z}`))}c();function Lz($){if($==="features")zO();else if($==="activate")JO();else XO()}function XO(){let $=Q1();if(console.log(`${D("pro")} ${B("— FAF Pro status")}
374
- `),console.log(` Status: ${$?H0(I("PRO")):I("Free")}`),console.log(""),!$)console.log(B(" Upgrade: faf pro activate"))}function zO(){console.log(`${D("pro")} ${B("— Pro features")}
375
- `);let $=[["tri-sync",".faf ↔ CLAUDE.md ↔ MEMORY.md"],["enterprise slots","33-slot scoring (slots 22-33)"],["advanced analytics","Drift tracking & team metrics"]];for(let[Z,X]of $)console.log(` ${D("◆")} ${I(Z)} ${B("—")} ${X}`);console.log("")}function JO(){console.log(`${D("pro")} ${B("— activate")}
376
- `),console.log(" Set FAF_PRO=1 in your environment to enable Pro features."),console.log(""),console.log(B(" export FAF_PRO=1")),console.log(""),console.log(B(" Visit: https://faf.one/pro")),import("open").then(({default:$})=>$("https://faf.one/pro")).catch(()=>{})}import{gzipSync as QO}from"zlib";c();function Mz($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
379
+ Run 'faf init' to create one.`),process.exit(2);let X=m(Z),z=X.faf_version??"unknown";if(z===L4){console.log(`${D("◆")} migrate already at v${L4}`);return}if(X.faf_version=L4,!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${L4}`),console.log(L(` would update ${Z}`));return}s(Z,X),console.log(`${D("◆")} migrate v${z} → v${L4}`),console.log(L(` updated ${Z}`))}c();function Cz($){if($==="features")BO();else if($==="activate")LO();else HO()}function HO(){let $=Y1();if(console.log(`${D("pro")} ${L("— FAF Pro status")}
380
+ `),console.log(` Status: ${$?H0(I("PRO")):I("Free")}`),console.log(""),!$)console.log(L(" Upgrade: faf pro activate"))}function BO(){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("◆")} ${I(Z)} ${L("—")} ${X}`);console.log("")}function LO(){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 MO}from"zlib";c();function wz($={}){let Z=g();if(!Z)console.error(`Error: project.faf not found
377
383
 
378
- Run 'faf init' to create one.`),process.exit(2);let X=h(Z),J=QO(Buffer.from(X)).toString("base64url");if($.raw){console.log(J);return}let Q=`https://faf.one/share?d=${J}`;if(console.log(`${D("◆")} share ${B(Z)}
379
- `),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(B(`
380
- copied to clipboard`))}catch{console.log(B(`
381
- copy failed — install xclip or pbcopy`))}}import{mkdirSync as YO,writeFileSync as UO,rmSync as WO}from"fs";import{tmpdir as GO}from"os";import{join as Nz}from"path";c();function Oz(){let $=Nz(GO(),`faf-demo-${Date.now()}`);YO($,{recursive:!0}),console.log(`${D("demo")} ${B("— FAF in action")}
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(`${D("◆")} share ${L(Z)}
385
+ `),console.log(` ${Q}`),$.copy)try{let{execSync:Y}=D0("child_process"),W=process.platform;if(W==="darwin")Y("pbcopy",{input:Q});else if(W==="linux")Y("xclip -selection clipboard",{input:Q});console.log(L(`
386
+ copied to clipboard`))}catch{console.log(L(`
387
+ copy failed — install xclip or pbcopy`))}}import{mkdirSync as NO,writeFileSync as OO,rmSync as TO}from"fs";import{tmpdir as DO}from"os";import{join as Ez}from"path";c();function jz(){let $=Ez(DO(),`faf-demo-${Date.now()}`);NO($,{recursive:!0}),console.log(`${D("demo")} ${L("— FAF in action")}
382
388
  `);let Z=`faf_version: 2.5.0
383
389
  project:
384
390
  name: acme-app
@@ -404,18 +410,18 @@ human_context:
404
410
  where: Cloud (Vercel + AWS)
405
411
  when: "2026"
406
412
  how: Agile sprints with CI/CD
407
- `,X=Nz($,"project.faf");UO(X,Z),console.log(` ${I("1.")} Created sample project.faf`),console.log(B(` ${X}
408
- `)),console.log(` ${I("2.")} Scoring...`);let z=q0(U0(h(X)));console.log(""),z0(z,"project.faf",!0),WO($,{recursive:!0,force:!0}),console.log(`
409
- ${B(' Demo complete. Run "faf init" in your project to get started.')}`)}c();function Tz($,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(`${D("slots")} ${B(`— ${Q.length} match${Q.length===1?"":"es"}`)}
410
- `);for(let Y of Q)console.log(` ${I(`#${Y.index}`)} ${Y.path} ${B("—")} ${Y.description} ${B(`[${Y.category}]`)}`);console.log(""),J+=Q.length}}if(z||Z.formats){let Q=K4.filter((Y)=>Y.name.toLowerCase().includes(X)||Y.extensions.some((U)=>U.toLowerCase().includes(X))||Y.category.toLowerCase().includes(X));if(Q.length>0){console.log(`${D("formats")} ${B(`— ${Q.length} match${Q.length===1?"":"es"}`)}
411
- `);for(let Y of Q)console.log(` ${I(Y.name)} ${B(Y.extensions.join(", "))} ${B(`[${Y.category}]`)}`);console.log(""),J+=Q.length}}if(J===0)console.log(B(` No results for "${$}"`))}import{writeFileSync as Dz,existsSync as q1,mkdirSync as qO}from"fs";import{join as x$}from"path";c();var VO="Wolfe-Jam/faf-taf-git@v2.2.0";function Iz($,Z={}){if($&&typeof $==="object")Z=$,$=void 0;if($==="setup"){LO(Z);return}MO(Z)}function KO($){if(q1(x$($,"bun.lockb"))||q1(x$($,"bun.lock")))return"bun";if(q1(x$($,"pnpm-lock.yaml")))return"pnpm";if(q1(x$($,"yarn.lock")))return"yarn";return"npm"}var HO={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=Ez($,"project.faf");OO(X,Z),console.log(` ${I("1.")} Created sample project.faf`),console.log(L(` ${X}
414
+ `)),console.log(` ${I("2.")} Scoring...`);let z=q0(W0(h(X)));console.log(""),z0(z,"project.faf",!0),TO($,{recursive:!0,force:!0}),console.log(`
415
+ ${L(' Demo complete. Run "faf init" in your project to get started.')}`)}c();function Sz($,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(`${D("slots")} ${L(`— ${Q.length} match${Q.length===1?"":"es"}`)}
416
+ `);for(let Y of Q)console.log(` ${I(`#${Y.index}`)} ${Y.path} ${L("—")} ${Y.description} ${L(`[${Y.category}]`)}`);console.log(""),J+=Q.length}}if(z||Z.formats){let Q=H4.filter((Y)=>Y.name.toLowerCase().includes(X)||Y.extensions.some((W)=>W.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(` ${I(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 xz,existsSync as V1,mkdirSync as IO}from"fs";import{join as x$}from"path";c();var AO="Wolfe-Jam/faf-taf-git@v2.2.0";function bz($,Z={}){if($&&typeof $==="object")Z=$,$=void 0;if($==="setup"){PO(Z);return}CO(Z)}function RO($){if(V1(x$($,"bun.lockb"))||V1(x$($,"bun.lock")))return"bun";if(V1(x$($,"pnpm-lock.yaml")))return"pnpm";if(V1(x$($,"yarn.lock")))return"yarn";return"npm"}var FO={bun:{setup:" - uses: oven-sh/setup-bun@v2",install:"bun install --frozen-lockfile",test:"bun run test"},pnpm:{setup:` - uses: pnpm/action-setup@v4
412
418
  - uses: actions/setup-node@v4
413
419
  with:
414
420
  node-version: 20`,install:"pnpm install --frozen-lockfile",test:"pnpm test"},yarn:{setup:` - uses: actions/setup-node@v4
415
421
  with:
416
422
  node-version: 20`,install:"yarn install --frozen-lockfile",test:"yarn test"},npm:{setup:` - uses: actions/setup-node@v4
417
423
  with:
418
- node-version: 20`,install:"npm ci",test:"npm test"}};function BO($){let Z=`name: TAF Receipts
424
+ node-version: 20`,install:"npm ci",test:"npm test"}};function _O($){let Z=`name: TAF Receipts
419
425
  `+`# Prints a Test Receipt (.taf) on every push — proof over time, cannot be gamed.
420
426
  `+`# Generated by \`faf taf setup\`. Docs: https://github.com/Wolfe-Jam/faf-taf-git
421
427
  on:
@@ -427,7 +433,7 @@ jobs:
427
433
  runs-on: ubuntu-latest
428
434
  steps:
429
435
  - uses: actions/checkout@v4
430
- `,X;if(q1(x$($,"package.json"))){let J=HO[KO($)];X=`${J.setup}
436
+ `,X;if(V1(x$($,"package.json"))){let J=FO[RO($)];X=`${J.setup}
431
437
  - run: ${J.install}
432
438
  - name: Run tests
433
439
  run: ${J.test} 2>&1 | tee test-output.txt
@@ -438,28 +444,28 @@ jobs:
438
444
  echo "TODO: your test command" 2>&1 | tee test-output.txt
439
445
  `;let z=` - name: Print TAF receipt
440
446
  if: github.event_name == 'push'
441
- uses: ${VO}
447
+ uses: ${AO}
442
448
  with:
443
449
  test-output-file: test-output.txt
444
450
  auto-commit: 'true'
445
451
  commit-message: 'chore(taf): update .taf receipt [skip ci]'
446
452
  target-branch: taf-receipts
447
- `;return Z+X+z}function LO($){let Z=process.cwd(),X=BO(Z),z=x$(Z,".github","workflows","taf.yml");if($.write){if(q1(z)){console.error(`${I("×")} .github/workflows/taf.yml already exists — not overwriting.`),console.error(B(" Add the faf-taf-git step to your existing workflow, or remove taf.yml and re-run."));return}qO(x$(Z,".github","workflows"),{recursive:!0}),Dz(z,X,"utf-8"),console.log(`${D("◆")} taf wrote .github/workflows/taf.yml`),console.log(B(" commit + push → your first Test Receipt prints to the taf-receipts branch."));return}console.log(`${D("TAF setup")} ${B("— Test Receipt Printer: proof over time, cannot be gamed")}
448
- `),console.log(B("Run `faf taf setup --write` to create this, or paste it into a workflow:\n")),console.log(X),console.log(B("Then commit + push. One receipt appends to .taf (taf-receipts branch) per CI run."))}function MO($){console.error(B("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
453
+ `;return Z+X+z}function PO($){let Z=process.cwd(),X=_O(Z),z=x$(Z,".github","workflows","taf.yml");if($.write){if(V1(z)){console.error(`${I("×")} .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(x$(Z,".github","workflows"),{recursive:!0}),xz(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 CO($){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
449
455
 
450
- Run 'faf init' to create one.`),process.exit(2);let X=m(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(`${D("◆")} taf receipt written to ${$.output}`);else console.log(Y)}import{createInterface as NO}from"readline";import{existsSync as Az,readFileSync as OO,writeFileSync as TO,unlinkSync as DO}from"fs";import{join as IO}from"path";c();var AO=".faf-session.json";function RO($,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 FO($,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 Rz($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
456
+ Run 'faf init' to create one.`),process.exit(2);let X=m(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)xz($.output,Y,"utf-8"),console.log(`${D("◆")} taf receipt written to ${$.output}`);else console.log(Y)}import{createInterface as wO}from"readline";import{existsSync as kz,readFileSync as EO,writeFileSync as jO,unlinkSync as SO}from"fs";import{join as xO}from"path";c();var bO=".faf-session.json";function kO($,Z){let X=Z.split("."),z=$;for(let J of X){if(z===null||z===void 0||typeof z!=="object")return;z=z[J]}return z}function yO($,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 yz($={}){let Z=g();if(!Z)console.error(`Error: project.faf not found
451
457
 
452
- Run 'faf init' to create one.`),process.exit(2);let X=process.cwd(),z=IO(X,AO),J=0;if($.resume&&Az(z))try{J=JSON.parse(OO(z,"utf-8")).slotIndex,console.log(B(` resuming from slot #${J+1}`))}catch{}let Q=m(Z),Y=a.filter((H)=>{let T=RO(Q,H.path);return A0(T)&&T!=="slotignored"});if(Y.length===0){console.log(`${D("◆")} go all slots populated — \uD83C\uDFC6 Trophy`);let H=q0(U0(h(Z)));z0(H,Z);return}console.log(`${D("go")} ${B("— guided interview to \uD83C\uDFC6 Trophy")}`);let U=Y.length===1?"slot":"slots";console.log(B(` ${Y.length} ${U} from Trophy. Enter a value, "skip" to skip, or "quit" to stop.
453
- `));let W=NO({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],L=await G(` ${I(`#${T.index}`)} ${J6(T.path)} ${B(`(${T.path})`)}: `);if(L.toLowerCase()==="quit"){let N={slotIndex:J+H,fafPath:Z};TO(z,JSON.stringify(N),"utf-8"),console.log(B(`
454
- session saved. Resume with: faf go --resume`));break}if(L.toLowerCase()==="skip"||L.trim()==="")continue;FO(Q,T.path,L.trim()),q++}if(W.close(),q>0)s(Z,Q),console.log(`
455
- ${D("◆")} go filled ${q} slot${q===1?"":"s"}`);let K=q0(U0(h(Z)));if(z0(K,Z),Az(z))try{DO(z)}catch{}}c();var IT=[/^(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 AT($){if(typeof $!=="string")return!1;let Z=$.trim();if(Z.length<4||Z.length>280)return!1;return!IT.some((X)=>X.test(Z))}function RT($,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 FT($,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 RJ($){if($==="analyze")await PT();else if($==="enhance")await _T();else console.log(`${D("ai")} ${B("— AI-powered features")}
456
- `),console.log(` ${I("faf ai enhance")} ${B("— fill empty slots via Claude")}`),console.log(` ${I("faf ai analyze")} ${B("— get improvement suggestions")}`),console.log(""),console.log(B(" Requires ANTHROPIC_API_KEY environment variable."))}async function FJ(){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=xO(X,bO),J=0;if($.resume&&kz(z))try{J=JSON.parse(EO(z,"utf-8")).slotIndex,console.log(L(` resuming from slot #${J+1}`))}catch{}let Q=m(Z),Y=a.filter((H)=>{let T=kO(Q,H.path);return A0(T)&&T!=="slotignored"});if(Y.length===0){console.log(`${D("◆")} go all slots populated — \uD83C\uDFC6 Trophy`);let H=q0(W0(h(Z)));z0(H,Z);return}console.log(`${D("go")} ${L("— guided interview to \uD83C\uDFC6 Trophy")}`);let W=Y.length===1?"slot":"slots";console.log(L(` ${Y.length} ${W} from Trophy. Enter a value, "skip" to skip, or "quit" to stop.
459
+ `));let U=wO({input:process.stdin,output:process.stdout}),G=(H)=>new Promise((T)=>U.question(H,T)),q=0,V=Y.slice(J);for(let H=0;H<V.length;H++){let T=V[H],B=await G(` ${I(`#${T.index}`)} ${Q6(T.path)} ${L(`(${T.path})`)}: `);if(B.toLowerCase()==="quit"){let N={slotIndex:J+H,fafPath:Z};jO(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;yO(Q,T.path,B.trim()),q++}if(U.close(),q>0)s(Z,Q),console.log(`
461
+ ${D("◆")} go filled ${q} slot${q===1?"":"s"}`);let K=q0(W0(h(Z)));if(z0(K,Z),kz(z))try{SO(z)}catch{}}c();var xT=[/^(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 bT($){if(typeof $!=="string")return!1;let Z=$.trim();if(Z.length<4||Z.length>280)return!1;return!xT.some((X)=>X.test(Z))}function kT($,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 yJ($){if($==="analyze")await gT();else if($==="enhance")await fT();else console.log(`${D("ai")} ${L("— AI-powered features")}
462
+ `),console.log(` ${I("faf ai enhance")} ${L("— fill empty slots via Claude")}`),console.log(` ${I("faf ai analyze")} ${L("— get improvement suggestions")}`),console.log(""),console.log(L(" Requires ANTHROPIC_API_KEY environment variable."))}async function fJ(){let $=process.env.ANTHROPIC_API_KEY;if(!$)console.error(`Error: ANTHROPIC_API_KEY not set.
457
463
 
458
- export ANTHROPIC_API_KEY=sk-...`),process.exit(2);try{let{default:Z}=await Promise.resolve().then(() => (AJ(),IJ));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(() => (kJ(),bJ));return new Z({apiKey:$})}catch{console.error(`Error: @anthropic-ai/sdk not installed.
459
465
 
460
- npm install @anthropic-ai/sdk`),process.exit(2)}}async function _T(){let $=v();if(!$)console.error(`Error: project.faf not found
466
+ npm install @anthropic-ai/sdk`),process.exit(2)}}async function fT(){let $=g();if(!$)console.error(`Error: project.faf not found
461
467
 
462
- Run 'faf init' to create one.`),process.exit(2);let Z=m($),X=h($),z=a.filter((W)=>{let G=RT(Z,W.path);return A0(G)&&G!=="slotignored"});if(z.length===0){console.log(`${D("◆")} ai enhance all slots populated`);return}console.log(`${D("ai")} enhance ${B(`extracting from ${z.length} empty slots...`)}`);let J=await FJ(),Q=z.map((W)=>`- ${W.path}: ${W.description}`).join(`
468
+ Run 'faf init' to create one.`),process.exit(2);let Z=m($),X=h($),z=a.filter((U)=>{let G=kT(Z,U.path);return A0(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 fJ(),Q=z.map((U)=>`- ${U.path}: ${U.description}`).join(`
463
469
  `),Y=`You are extracting concrete content from a project's .faf file to fill empty slots. STRICT RULES:
464
470
 
465
471
  1. Return JSON mapping dot-paths to values OR null.
@@ -475,42 +481,42 @@ ${X}
475
481
  Empty slots to fill (return null if no concrete evidence):
476
482
  ${Q}
477
483
 
478
- 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(AT(H))FT(Z,K.path,H),console.log(` ${D("●")} ${K.path} ${B("←")} ${H}`),q++;else console.log(` ${B("○")} ${K.path} ${B("— rejected as slop, left empty")}`),V++}if(q>0){s($,Z),console.log(`
479
- ${D("◆")} ai enhance filled ${q} slot${q===1?"":"s"}${V>0?` (${V} rejected)`:""}`);let K=q0(U0(h($)));z0(K,$)}else if(V>0)console.log(`
480
- ${B("all extractions rejected as slop. Run")} ${I("'faf go'")} ${B("for interview-fill.")}`);else console.log(`
481
- ${B("no concrete evidence for empty slots. Run")} ${I("'faf go'")} ${B("for interview-fill.")}`)}catch{console.error("Error: Could not parse AI response.")}}async function PT(){let $=v();if(!$)console.error(`Error: project.faf not found
484
+ Respond with ONLY valid JSON, no markdown fences. Each value is either a short string (with concrete evidence) or null (leave empty).`,W=await J.messages.create({model:"claude-haiku-4-5-20251001",max_tokens:1024,messages:[{role:"user",content:Y}]});try{let U=W.content[0].text,G=JSON.parse(U),q=0,V=0;for(let K of z){let H=G[K.path];if(H===null||H===void 0)continue;if(bT(H))yT(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){s($,Z),console.log(`
485
+ ${D("◆")} ai enhance filled ${q} slot${q===1?"":"s"}${V>0?` (${V} rejected)`:""}`);let K=q0(W0(h($)));z0(K,$)}else if(V>0)console.log(`
486
+ ${L("all extractions rejected as slop. Run")} ${I("'faf go'")} ${L("for interview-fill.")}`);else console.log(`
487
+ ${L("no concrete evidence for empty slots. Run")} ${I("'faf go'")} ${L("for interview-fill.")}`)}catch{console.error("Error: Could not parse AI response.")}}async function gT(){let $=g();if(!$)console.error(`Error: project.faf not found
482
488
 
483
- Run 'faf init' to create one.`),process.exit(2);let Z=h($);console.log(`${D("ai")} analyze ${B("getting suggestions...")}`);let z=await(await FJ()).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=h($);console.log(`${D("ai")} analyze ${L("getting suggestions...")}`);let z=await(await fJ()).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.
484
490
 
485
491
  ${Z}
486
492
 
487
- Be concise. One line per suggestion.`}]});console.log(""),console.log(z.content[0].text)}import{existsSync as sZ,readFileSync as aZ,readdirSync as CT}from"fs";import{join as _J}from"path";c();function PJ($,Z){if($==="import")wT(Z);else if($==="export")ET();else console.log(`${D("conductor")} ${B("— conductor integration")}
488
- `),console.log(` ${I("faf conductor import <path>")} ${B("— import conductor config into .faf")}`),console.log(` ${I("faf conductor export")} ${B("— generate conductor config from .faf")}`)}function wT($){if(!$)console.error("Usage: faf conductor import <path>"),process.exit(2);if(!sZ($))console.error(`Error: path not found: ${$}`),process.exit(2);let Z={faf_version:"2.5.0",project:{}};if(sZ($)&&$.endsWith(".json")){let J=JSON.parse(aZ($,"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(sZ($)&&($.endsWith(".yml")||$.endsWith(".yaml"))){let J=l0(aZ($,"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=CT($);for(let Q of J){let Y=_J($,Q);if(Q.endsWith(".json"))try{let U=JSON.parse(aZ(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=m(z);if(!J.project)J.project={};if(Z.project.name&&!J.project.name)J.project.name=Z.project.name;if(Z.project.goal&&!J.project.goal)J.project.goal=Z.project.goal;if(Z.project.main_language&&!J.project.main_language)J.project.main_language=Z.project.main_language;s(z,J),console.log(`${D("◆")} conductor import merged into ${z}`)}else{let J=_J(X,"project.faf");s(J,Z),console.log(`${D("◆")} conductor import created ${J}`)}}function ET(){let $=v();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 eZ,readFileSync as $5,readdirSync as vT}from"fs";import{join as gJ}from"path";c();function vJ($,Z){if($==="import")hT(Z);else if($==="export")uT();else console.log(`${D("conductor")} ${L("— conductor integration")}
494
+ `),console.log(` ${I("faf conductor import <path>")} ${L("— import conductor config into .faf")}`),console.log(` ${I("faf conductor export")} ${L("— generate conductor config from .faf")}`)}function hT($){if(!$)console.error("Usage: faf conductor import <path>"),process.exit(2);if(!eZ($))console.error(`Error: path not found: ${$}`),process.exit(2);let Z={faf_version:"2.5.0",project:{}};if(eZ($)&&$.endsWith(".json")){let J=JSON.parse($5($,"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(eZ($)&&($.endsWith(".yml")||$.endsWith(".yaml"))){let J=l0($5($,"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=vT($);for(let Q of J){let Y=gJ($,Q);if(Q.endsWith(".json"))try{let W=JSON.parse($5(Y,"utf-8"));if(W.name&&!Z.project.name)Z.project.name=W.name;if(W.description&&!Z.project.goal)Z.project.goal=W.description}catch{}}}catch{console.error(`Error: could not read directory: ${$}`),process.exit(2)}let X=process.cwd(),z=g(X);if(z){let J=m(z);if(!J.project)J.project={};if(Z.project.name&&!J.project.name)J.project.name=Z.project.name;if(Z.project.goal&&!J.project.goal)J.project.goal=Z.project.goal;if(Z.project.main_language&&!J.project.main_language)J.project.main_language=Z.project.main_language;s(z,J),console.log(`${D("◆")} conductor import merged into ${z}`)}else{let J=gJ(X,"project.faf");s(J,Z),console.log(`${D("◆")} conductor import created ${J}`)}}function uT(){let $=g();if(!$)console.error(`Error: project.faf not found
489
495
 
490
- Run 'faf init' to create one.`),process.exit(2);let Z=m($),X={name:Z.project?.name??"",description:Z.project?.goal??"",language:Z.project?.main_language??"",stack:Z.stack??{}};console.log(JSON.stringify(X,null,2))}c();import{readdirSync as jT,readFileSync as ST,existsSync as xT}from"fs";import{join as bT}from"path";var kT=["BRAKE","ENGINE","AERO","TYRE","PIT"],yT=/(?:^|[^A-Za-z])(BRAKE|ENGINE|AERO|TYRE|PIT)(?:[^A-Za-z]|$)/i;function fT($){let Z=$.match(yT);if(!Z)return null;return Z[1].toUpperCase()}function gT($){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 vT($,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((L)=>L.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 hT=new Set(["node_modules",".git","target","dist","build",".next",".nuxt","coverage"]);function CJ($,Z=[]){let X;try{X=jT($,{withFileTypes:!0})}catch{return Z}for(let z of X){if(hT.has(z.name))continue;if(z.name.startsWith(".")&&z.name!==".")continue;let J=bT($,z.name);if(z.isDirectory())CJ(J,Z);else if(z.isFile())Z.push(J)}return Z}function uT($){let Z=[];if(!xT($))return Z;let X=CJ($);for(let z of X){let J=z.split("/").pop()??"",Q=gT(J);if(!Q.ok||!Q.lang)continue;let Y;try{Y=ST(z,"utf-8")}catch{continue}if(Q.lang==="rust"&&!/#\[test\]/.test(Y))continue;if(Q.lang==="zig"&&!/\btest\s+"/.test(Y))continue;let U=vT(Y,Q.lang),W=z.replace(`${$}/`,"");for(let G of U)Z.push({file:W,language:Q.lang,testName:G,tier:fT(G)})}return Z}function mT($){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 cT($){if(console.log(`${D(I("faf wjttc"))} ${B("— vendor-neutral test audit")}`),console.log(""),console.log(` Files scanned: ${I(String($.filesScanned))}`),console.log(` Tests found: ${I(String($.totalTests))}`),console.log(""),$.totalTests===0){console.log(B(" no tests found"));return}console.log(B(" Tiers:"));for(let Z of kT){let X=$.byTier[Z],z=(X/$.totalTests*100).toFixed(0),J=Z==="BRAKE"?H0("●"):Z==="ENGINE"?D("●"):Z==="AERO"?B("●"):Z==="TYRE"?D("◐"):B("○");console.log(` ${J} ${Z.padEnd(7)} ${I(String(X).padStart(4))} ${B(`(${z}%)`)}`)}if($.untiered>0){let Z=($.untiered/$.totalTests*100).toFixed(0);console.log(` ${B("○")} ${"untiered".padEnd(7)} ${I(String($.untiered).padStart(4))} ${B(`(${Z}%)`)}`)}if($.untiered>0&&$.untieredExamples.length>0){console.log(""),console.log(B(` Untiered examples (first ${$.untieredExamples.length}):`));for(let Z of $.untieredExamples)console.log(` ${B("·")} ${Z}`)}if(Object.keys($.byLanguage).length>1){console.log(""),console.log(B(" Languages:"));for(let[Z,X]of Object.entries($.byLanguage))console.log(` ${B("·")} ${Z.padEnd(12)} ${I(String(X))}`)}if($.byTier.BRAKE===0&&$.totalTests>0)console.log(""),console.log(H0(" ⚠ no BRAKE-tier tests — no safety canaries"))}function wJ($={}){let Z=$.path??"tests",X=uT(Z),z=mT(X);if($.json)console.log(JSON.stringify(z,null,2));else cT(z);if($.strict&&z.untiered>0)process.exit(1)}import{createHash as SJ}from"crypto";import{readFileSync as xJ,writeFileSync as dT,existsSync as bJ}from"fs";import{join as kJ,dirname as pT}from"path";c();var EJ="faf-bench/1",lT={"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 iT($,Z){return lT[$]??`What is the project's ${Z.replace(/\s*\(.*\)$/,"").toLowerCase()}?`}var nT=[["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"]],z2=new Map;nT.forEach(($,Z)=>$.forEach((X)=>z2.set(X,Z)));var rT=new Set(["a","an","the","and","or","of","for","to","in","on","with","is","it","its","their","your","via","by","using","use","used"]);function oZ($){return $.toLowerCase().replace(/[^a-z0-9\s.+#-]/g," ").replace(/\.(?=\s|$)/g," ").replace(/\s+/g," ").trim()}function jJ($){return oZ($).split(" ").filter((Z)=>Z&&!rT.has(Z))}function sT($,Z){let X=oZ($),z=oZ(Z);if(!X||!z)return!1;if(X===z)return!0;let J=z2.get(X);if(J!==void 0&&z2.get(z)===J)return!0;let Q=jJ($);if(Q.length===0)return!1;let Y=new Set(jJ(Z));return Q.every((U)=>{if(Y.has(U))return!0;let W=z2.get(U);return W!==void 0&&[...Y].some((G)=>z2.get(G)===W)})}function aT($){let Z=X0($),X=l0($),z=[],J={},Q=0;for(let W of a){if(Z.slots[W.path]!=="populated")continue;let G=W4(X,W);if(typeof G!=="string")continue;let q=G.trim();if(!q||L3.has(q.toLowerCase()))continue;Q+=1,z.push({n:Q,path:W.path,question:iT(W.path,W.description)}),J[Q]=q}let Y=JSON.stringify({v:EJ,q:z.map((W)=>[W.path,W.question])}),U=SJ("sha256").update(Y).digest("hex").slice(0,12);return{version:EJ,qsetHash:U,questions:z,answers:J}}function oT($,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()!==""&&sT($.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 yJ=".faf-bench.json";function tT($){let Z=kJ($,yJ);if(!bJ(Z))return null;try{return JSON.parse(xJ(Z,"utf-8"))}catch{return null}}function eT($,Z){dT(kJ($,yJ),JSON.stringify(Z,null,2)+`
491
- `,"utf-8")}function tZ($,Z){let X=JSON.stringify({v:$.version,repo:Z??null,qset:$.qsetHash,protocol:$.protocol,cold:$.cold??null,faf:$.faf??null});return{projection:X,hash:SJ("sha256").update(X).digest("hex")}}var p6=($)=>$===void 0?"—":`~${$.toLocaleString()}`;function $D($,Z){let{cold:X,faf:z}=$;console.log(`
496
+ Run 'faf init' to create one.`),process.exit(2);let Z=m($),X={name:Z.project?.name??"",description:Z.project?.goal??"",language:Z.project?.main_language??"",stack:Z.stack??{}};console.log(JSON.stringify(X,null,2))}c();import{readdirSync as mT,readFileSync as cT,existsSync as dT}from"fs";import{join as pT}from"path";var lT=["BRAKE","ENGINE","AERO","TYRE","PIT"],iT=/(?:^|[^A-Za-z])(BRAKE|ENGINE|AERO|TYRE|PIT)(?:[^A-Za-z]|$)/i;function nT($){let Z=$.match(iT);if(!Z)return null;return Z[1].toUpperCase()}function rT($){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 sT($,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=[],W=0,U=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")U=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(W++,U!==null)Y.push({name:U,openDepth:W}),U=null}else if(V==="}"){W--;while(Y.length>0&&W<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 aT=new Set(["node_modules",".git","target","dist","build",".next",".nuxt","coverage"]);function hJ($,Z=[]){let X;try{X=mT($,{withFileTypes:!0})}catch{return Z}for(let z of X){if(aT.has(z.name))continue;if(z.name.startsWith(".")&&z.name!==".")continue;let J=pT($,z.name);if(z.isDirectory())hJ(J,Z);else if(z.isFile())Z.push(J)}return Z}function oT($){let Z=[];if(!dT($))return Z;let X=hJ($);for(let z of X){let J=z.split("/").pop()??"",Q=rT(J);if(!Q.ok||!Q.lang)continue;let Y;try{Y=cT(z,"utf-8")}catch{continue}if(Q.lang==="rust"&&!/#\[test\]/.test(Y))continue;if(Q.lang==="zig"&&!/\btest\s+"/.test(Y))continue;let W=sT(Y,Q.lang),U=z.replace(`${$}/`,"");for(let G of W)Z.push({file:U,language:Q.lang,testName:G,tier:nT(G)})}return Z}function tT($){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 eT($){if(console.log(`${D(I("faf wjttc"))} ${L("— vendor-neutral test audit")}`),console.log(""),console.log(` Files scanned: ${I(String($.filesScanned))}`),console.log(` Tests found: ${I(String($.totalTests))}`),console.log(""),$.totalTests===0){console.log(L(" no tests found"));return}console.log(L(" Tiers:"));for(let Z of lT){let X=$.byTier[Z],z=(X/$.totalTests*100).toFixed(0),J=Z==="BRAKE"?H0("●"):Z==="ENGINE"?D("●"):Z==="AERO"?L("●"):Z==="TYRE"?D("◐"):L("○");console.log(` ${J} ${Z.padEnd(7)} ${I(String(X).padStart(4))} ${L(`(${z}%)`)}`)}if($.untiered>0){let Z=($.untiered/$.totalTests*100).toFixed(0);console.log(` ${L("○")} ${"untiered".padEnd(7)} ${I(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)} ${I(String(X))}`)}if($.byTier.BRAKE===0&&$.totalTests>0)console.log(""),console.log(H0(" ⚠ no BRAKE-tier tests — no safety canaries"))}function uJ($={}){let Z=$.path??"tests",X=oT(Z),z=tT(X);if($.json)console.log(JSON.stringify(z,null,2));else eT(z);if($.strict&&z.untiered>0)process.exit(1)}import{createHash as dJ}from"crypto";import{readFileSync as pJ,writeFileSync as $D,existsSync as lJ}from"fs";import{join as iJ,dirname as ZD}from"path";c();var mJ="faf-bench/1",XD={"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 zD($,Z){return XD[$]??`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"]],J2=new Map;JD.forEach(($,Z)=>$.forEach((X)=>J2.set(X,Z)));var QD=new Set(["a","an","the","and","or","of","for","to","in","on","with","is","it","its","their","your","via","by","using","use","used"]);function Z5($){return $.toLowerCase().replace(/[^a-z0-9\s.+#-]/g," ").replace(/\.(?=\s|$)/g," ").replace(/\s+/g," ").trim()}function cJ($){return Z5($).split(" ").filter((Z)=>Z&&!QD.has(Z))}function YD($,Z){let X=Z5($),z=Z5(Z);if(!X||!z)return!1;if(X===z)return!0;let J=J2.get(X);if(J!==void 0&&J2.get(z)===J)return!0;let Q=cJ($);if(Q.length===0)return!1;let Y=new Set(cJ(Z));return Q.every((W)=>{if(Y.has(W))return!0;let U=J2.get(W);return U!==void 0&&[...Y].some((G)=>J2.get(G)===U)})}function WD($){let Z=X0($),X=l0($),z=[],J={},Q=0;for(let U of a){if(Z.slots[U.path]!=="populated")continue;let G=G4(X,U);if(typeof G!=="string")continue;let q=G.trim();if(!q||M3.has(q.toLowerCase()))continue;Q+=1,z.push({n:Q,path:U.path,question:zD(U.path,U.description)}),J[Q]=q}let Y=JSON.stringify({v:mJ,q:z.map((U)=>[U.path,U.question])}),W=dJ("sha256").update(Y).digest("hex").slice(0,12);return{version:mJ,qsetHash:W,questions:z,answers:J}}function UD($,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()!==""&&YD($.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 nJ=".faf-bench.json";function GD($){let Z=iJ($,nJ);if(!lJ(Z))return null;try{return JSON.parse(pJ(Z,"utf-8"))}catch{return null}}function qD($,Z){$D(iJ($,nJ),JSON.stringify(Z,null,2)+`
497
+ `,"utf-8")}function X5($,Z){let X=JSON.stringify({v:$.version,repo:Z??null,qset:$.qsetHash,protocol:$.protocol,cold:$.cold??null,faf:$.faf??null});return{projection:X,hash:dJ("sha256").update(X).digest("hex")}}var l6=($)=>$===void 0?"—":`~${$.toLocaleString()}`;function VD($,Z){let{cold:X,faf:z}=$;console.log(`
492
498
  ${I(`faf bench — ${Z}`)}
493
- `),console.log(` ${B("without context")} ${D("with .faf")}`),console.log(`answers ${X.score}/${X.total} ${I(`${z.score}/${z.total}`)}`),console.log(`tokens ${p6(X.tokens)} ${p6(z.tokens)}`);let J=X.total-X.score;if(J>0)console.log(`
494
- ${B(`The ${J} missing answer${J===1?"":"s"} were already in your repo — unstructured.`)}`),console.log(B("Structured context closes the gap."));let Q=tZ($,Z);console.log(`
495
- ${H0("✪ BENCH RECEIPT")}`),console.log(B(` qset: ${$.qsetHash} protocol: ${$.protocol} model: ${z.model??X.model??"unreported"}`)),console.log(B(` cold ${X.score}/${X.total} · faf ${z.score}/${z.total} · sha256: ${Q.hash.slice(0,16)}…`))}function ZD($,Z){let X=$.cold,z=X.total-X.score;if(console.log(`
499
+ `),console.log(` ${L("without context")} ${D("with .faf")}`),console.log(`answers ${X.score}/${X.total} ${I(`${z.score}/${z.total}`)}`),console.log(`tokens ${l6(X.tokens)} ${l6(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=X5($,Z);console.log(`
501
+ ${H0("✪ 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 KD($,Z){let X=$.cold,z=X.total-X.score;if(console.log(`
496
502
  ${I(`faf bench — ${Z}`)} ${H0("Trouble ahead, expensive trouble.")}
497
- `),console.log(` ${B("without context")}`),console.log(`answers ${X.score}/${X.total} ${B("— the AI is guessing at what you are building")}`),X.tokens!==void 0)console.log(`tokens ${p6(X.tokens)} ${B("— re-derivation burn, paid again EVERY session")}`);if(z>0)console.log(`
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 ${l6(X.tokens)} ${L("— re-derivation burn, paid again EVERY session")}`);if(z>0)console.log(`
498
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(`
499
- ${D("→ faf init && faf bench")} ${B("(close the gap, get the receipt)")}`)}var XD="https://mcpaas.live/bench/submit";async function zD($,Z){try{let X=await fetch(Z,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)});console.log(B(X.ok?` ✪ submitted to ${Z}`:` submit failed (${X.status})`))}catch{console.log(B(" submit skipped (endpoint unreachable)"))}}function fJ($,Z,X={}){let z=X.file??v();if(!z)console.error(`Error: project.faf not found
500
-
501
- Run 'faf init' to create one — bench needs the answer key.`),process.exit(2);let J=h(z),Q=aT(J),Y=pT(z),U=l0(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(`
502
- ${I(`faf bench — ${Q.questions.length} questions`)} ${B(`qset ${Q.qsetHash}`)}
503
- `);for(let W of Q.questions)console.log(` ${String(W.n).padStart(2)}. ${W.question}`);console.log(`
504
- ${B('Answer terse — the value, not a sentence. Save as JSON: {"1": "...", "2": "..."}')}`);return}if($==="grade"){if(!Z||!bJ(Z))console.error("Error: faf bench grade <answers.json> — file not found."),process.exit(2);let W=JSON.parse(xJ(Z,"utf-8")),G=W.answers??W,q=oT(Q,G),V={score:q.correct,total:q.total,...X.tokens?{tokens:parseInt(X.tokens,10)}:{},...X.model?{model:X.model}:{}},K=tT(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(eT(Y,H),X.json){let T=tZ(H,U);console.log(JSON.stringify({...H,receipt:T.hash,perQuestion:q.perQuestion},null,2));return}if(H.cold&&H.faf)$D(H,U);if(X.submit&&H.cold&&H.faf){let{cold:T,faf:L}=H,N=tZ(H,U);zD({date:new Date().toISOString().slice(0,10),model:L.model??T.model??X.model??"unreported",repo:U,qset:H.qsetHash,cold:`${T.score}/${T.total}`,faf:`${L.score}/${L.total}`,sha256:N.hash.slice(0,16)},X.endpoint??XD)}else if(H.cold)ZD(H,U);else console.log(`
505
- ${I(`faf bench — ${U}`)} ${D("with .faf")}: ${I(`${V.score}/${V.total}`)} ${B(`tokens ${p6(V.tokens)}`)}`),console.log(B("Run the cold phase too for the full pair: faf bench (protocol)."));return}console.log(`
506
- ${I("faf bench — agent-native protocol")} ${B(`qset ${Q.qsetHash} · ${Q.questions.length} questions`)}
507
- `),console.log(`${I("COLD phase")} ${B("(fresh AI session, repo access)")}`),console.log(' 1. Instruct: "Answer these questions from the repository.'),console.log(' Do NOT read project.faf, CLAUDE.md, AGENTS.md, or any *.faf file."'),console.log(` 2. ${D("faf bench questions")} — hand them over; answers terse, saved as cold.json`),console.log(` 3. ${D("faf bench grade cold.json --cold --tokens <used> --model <name>")}
508
- `),console.log(`${I("FAF phase")} ${B("(same questions, context first)")}`),console.log(' 4. Instruct: "Read project.faf, then answer the same questions." → faf.json'),console.log(` 5. ${D("faf bench grade faf.json --faf --tokens <used> --model <name>")}
509
- `),console.log(B("Grading is mechanical against your own project.faf — the .faf IS the answer key.")),console.log(B(`Receipts carry protocol: in-session (honor-system cold). qset ${Q.qsetHash}.`))}import{existsSync as JD,writeFileSync as QD}from"fs";c();function gJ($={}){let Z=v();if(!Z)console.error(`Error: project.faf not found
510
-
511
- Run 'faf init' to create one.`),process.exit(2);let X=h(Z),z=X0(X),J=new r0(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(JD(G)){let V=s2(X);QD(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")} ${B("— re-grounding on the live .faf")}
512
- `),W){let V=U>0?"↑":"↓";console.log(` drift: ${B(`${Y}%`)} ${V} ${I(`${z.score}%`)} ${B(`(${U>0?"+":""}${U})`)}`)}else if(Y!=null)console.log(` no drift ${B(`— steady at ${z.score}%`)}`);else console.log(` baseline set ${B(`— ${z.score}%`)}`);if(q!=null)console.log(` .fafb re-compiled ${B(`(${q} bytes — fast tier current)`)}`);console.log(` re-grounded: ${k0(z.tier)} ${I(`${z.score}%`)}`)}if(J.exists())J.recordGrowth(z.score,["refresh — re-grounded"]);else J.birth(z.score)}var{version:vJ}=x3(),f=new D5;f.name("faf").description("Foundational AI-Context Format — project DNA for any AI").version(vJ,"-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(($)=>A3($));f.command("dna").description("\uD83E\uDDEC Show your FAF DNA journey (birth → growth)").action(()=>QX());f.command("auto").description("Zero to 100% in one command").action(()=>X6());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(($)=>UX($));f.command("go").description("Guided interview to gold code").option("--resume","Resume previous session").action(($)=>Rz($));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)=>a2($,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)=>fJ($,Z,X));f.command("show").description("Render project.faf → project.html and open it").action(()=>vX());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(($)=>_3($));f.command("compile [file]").description("Compile .faf to .fafb binary").option("--output <path>","Output path").action(($,Z)=>DX($,Z));f.command("decompile <file>").description("Decompile .fafb to JSON").option("--output <path>","Output path").action(($,Z)=>IX($,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)=>uX($,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)=>aX($,Z));f.command("diff-driver [args...]",{hidden:!0}).description("Internal: GIT_EXTERNAL_DIFF handler invoked by git for diff=faf files").action(($)=>rX($??[]));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(($)=>oX($));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(($)=>Jz($));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(($)=>zz($));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(($)=>U1($));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)=>P3($,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(($)=>Qz($));f.command("formats").description("Show supported formats").action(()=>Yz());f.command("clear").description("Clear cached data").action(()=>Uz());f.command("convert").description("Convert .faf to other formats").option("--json","Output as JSON").action(($)=>Wz($));f.command("context").description("Generate context output").action(()=>Gz());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(($)=>gJ($));f.command("drift").description("Check context drift").action(()=>Vz());f.command("edit <path> <value>").description("Edit .faf fields").action(($,Z)=>Kz($,Z));f.command("recover").description("Recover .faf from context files").action(()=>Hz());f.command("migrate").description("Migrate .faf to latest version").option("--dry-run","Preview changes without writing").action(($)=>Bz($));f.command("pro [subcommand]").description("Pro features & licensing").action(($)=>Lz($));f.command("share").description("Share .faf via URL").option("--copy","Copy to clipboard").option("--raw","Output encoded string only").action(($)=>Mz($));f.command("demo").description("Demo walkthrough").action(()=>Oz());f.command("search <query>").description("Search slots and formats").option("--slots","Search slots only").option("--formats","Search formats only").action(($,Z)=>Tz($,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)=>Iz($,Z));f.command("ai [subcommand]").description("AI-powered features (enhance|analyze)").action(($)=>RJ($));f.command("conductor [subcommand] [path]").description("Conductor integration").action(($,Z)=>PJ($,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(($)=>wJ($));f.command("bi-sync",{hidden:!0}).action(()=>_3());f.command("status",{hidden:!0}).action(()=>a2(void 0,{status:!0}));f.command("agents",{hidden:!0}).action(()=>U1({agents:!0}));f.command("cursor",{hidden:!0}).action(()=>U1({cursor:!0}));f.command("gemini",{hidden:!0}).action(()=>U1({gemini:!0}));f.command("grok",{hidden:!0}).action(()=>U1({grok:!0}));f.command("validate",{hidden:!0}).action(($)=>P3($));f.command("yolo",{hidden:!0}).action(()=>A3({yolo:!0}));if(process.argv.length<=2)(async()=>{let{bold:$,dim:Z,fafCyan:X}=await Promise.resolve().then(() => (c(),b9)),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${vJ}`)}`);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 a2(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(`
505
+ ${D("→ faf init && faf bench")} ${L("(close the gap, get the receipt)")}`)}var HD="https://mcpaas.live/bench/submit";async function BD($,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 rJ($,Z,X={}){let z=X.file??g();if(!z)console.error(`Error: project.faf not found
506
+
507
+ Run 'faf init' to create one — bench needs the answer key.`),process.exit(2);let J=h(z),Q=WD(J),Y=ZD(z),W=l0(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:U,question:G})=>({n:U,question:G}))},null,2));return}console.log(`
508
+ ${I(`faf bench — ${Q.questions.length} questions`)} ${L(`qset ${Q.qsetHash}`)}
509
+ `);for(let U of Q.questions)console.log(` ${String(U.n).padStart(2)}. ${U.question}`);console.log(`
510
+ ${L('Answer terse — the value, not a sentence. Save as JSON: {"1": "...", "2": "..."}')}`);return}if($==="grade"){if(!Z||!lJ(Z))console.error("Error: faf bench grade <answers.json> — file not found."),process.exit(2);let U=JSON.parse(pJ(Z,"utf-8")),G=U.answers??U,q=UD(Q,G),V={score:q.correct,total:q.total,...X.tokens?{tokens:parseInt(X.tokens,10)}:{},...X.model?{model:X.model}:{}},K=GD(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(qD(Y,H),X.json){let T=X5(H,W);console.log(JSON.stringify({...H,receipt:T.hash,perQuestion:q.perQuestion},null,2));return}if(H.cold&&H.faf)VD(H,W);if(X.submit&&H.cold&&H.faf){let{cold:T,faf:B}=H,N=X5(H,W);BD({date:new Date().toISOString().slice(0,10),model:B.model??T.model??X.model??"unreported",repo:W,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)KD(H,W);else console.log(`
511
+ ${I(`faf bench — ${W}`)} ${D("with .faf")}: ${I(`${V.score}/${V.total}`)} ${L(`tokens ${l6(V.tokens)}`)}`),console.log(L("Run the cold phase too for the full pair: faf bench (protocol)."));return}console.log(`
512
+ ${I("faf bench — agent-native protocol")} ${L(`qset ${Q.qsetHash} · ${Q.questions.length} questions`)}
513
+ `),console.log(`${I("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(`${I("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 LD,writeFileSync as MD}from"fs";c();function sJ($={}){let Z=g();if(!Z)console.error(`Error: project.faf not found
516
+
517
+ Run 'faf init' to create one.`),process.exit(2);let X=h(Z),z=X0(X),J=new r0(process.cwd()),Q=J.load()?J.getBirthDNADisplay():null,Y=Q?Q.current:null,W=Y!=null?z.score-Y:0,U=Y!=null&&W!==0,G=Z.replace(/\.faf$/,".fafb"),q=null;if(LD(G)){let V=a2(X);MD(G,V),q=V.length}if($.json)console.log(JSON.stringify({reGrounded:!0,score:z.score,tier:z.tier,baseline:Y,delta:W,drifted:U,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
+ `),U){let V=W>0?"↑":"↓";console.log(` drift: ${L(`${Y}%`)} ${V} ${I(`${z.score}%`)} ${L(`(${W>0?"+":""}${W})`)}`)}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: ${k0(z.tier)} ${I(`${z.score}%`)}`)}if(J.exists())J.recordGrowth(z.score,["refresh — re-grounded"]);else J.birth(z.score)}var{version:aJ}=f3(),f=new F5;f.name("faf").description("Foundational AI-Context Format — project DNA for any AI").version(aJ,"-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(($)=>R3($));f.command("dna").description("\uD83E\uDDEC Show your FAF DNA journey (birth → growth)").action(()=>qX());f.command("auto").description("Zero to 100% in one command").action(()=>z6());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(($)=>KX($));f.command("go").description("Guided interview to gold code").option("--resume","Resume previous session").action(($)=>yz($));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)=>o2($,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)=>rJ($,Z,X));f.command("show").description("Render project.faf → project.html and open it").action(()=>aX());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(($)=>P3($));f.command("compile [file]").description("Compile .faf to .fafb binary").option("--output <path>","Output path").action(($,Z)=>_X($,Z));f.command("decompile <file>").description("Decompile .fafb to JSON").option("--output <path>","Output path").action(($,Z)=>PX($,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)=>tX($,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)=>Uz($,Z));f.command("diff-driver [args...]",{hidden:!0}).description("Internal: GIT_EXTERNAL_DIFF handler invoked by git for diff=faf files").action(($)=>Yz($??[]));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(($)=>Gz($));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(($)=>Mz($));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(($)=>Lz($));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(($)=>U1($));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(($)=>sX($));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)=>C3($,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(($)=>Nz($));f.command("formats").description("Show supported formats").action(()=>Oz());f.command("clear").description("Clear cached data").action(()=>Tz());f.command("convert").description("Convert .faf to other formats").option("--json","Output as JSON").action(($)=>Dz($));f.command("context").description("Generate context output").action(()=>Iz());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(($)=>sJ($));f.command("drift").description("Check context drift").action(()=>Rz());f.command("edit <path> <value>").description("Edit .faf fields").action(($,Z)=>Fz($,Z));f.command("recover").description("Recover .faf from context files").action(()=>_z());f.command("migrate").description("Migrate .faf to latest version").option("--dry-run","Preview changes without writing").action(($)=>Pz($));f.command("pro [subcommand]").description("Pro features & licensing").action(($)=>Cz($));f.command("share").description("Share .faf via URL").option("--copy","Copy to clipboard").option("--raw","Output encoded string only").action(($)=>wz($));f.command("demo").description("Demo walkthrough").action(()=>jz());f.command("search <query>").description("Search slots and formats").option("--slots","Search slots only").option("--formats","Search formats only").action(($,Z)=>Sz($,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)=>bz($,Z));f.command("ai [subcommand]").description("AI-powered features (enhance|analyze)").action(($)=>yJ($));f.command("conductor [subcommand] [path]").description("Conductor integration").action(($,Z)=>vJ($,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(($)=>uJ($));f.command("bi-sync",{hidden:!0}).action(()=>P3());f.command("status",{hidden:!0}).action(()=>o2(void 0,{status:!0}));f.command("agents",{hidden:!0}).action(()=>U1({agents:!0}));f.command("cursor",{hidden:!0}).action(()=>U1({cursor:!0}));f.command("gemini",{hidden:!0}).action(()=>U1({gemini:!0}));f.command("grok",{hidden:!0}).action(()=>U1({grok:!0}));f.command("validate",{hidden:!0}).action(($)=>C3($));f.command("yolo",{hidden:!0}).action(()=>R3({yolo:!0}));if(process.argv.length<=2)(async()=>{let{bold:$,dim:Z,fafCyan:X}=await Promise.resolve().then(() => (c(),v9)),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",W="\x1B[48;2;29;29;29m",U="\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${aJ}`)}`);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 o2(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(`
513
519
  `)),f.parse(process.argv);
514
520
 
515
- //# debugId=5A1BAC3D3BAE511D64756E2164756E21
521
+ //# debugId=46C1B5B4E266B6CF64756E2164756E21
516
522
  //# sourceMappingURL=cli.js.map