agentdeps 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/dist/index.js +213 -210
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,250 +1,253 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as
|
|
3
|
-
`)}displayWidth(q){return
|
|
4
|
-
`+" ".repeat(
|
|
5
|
-
${Q}`)}boxWrap(q
|
|
6
|
-
`)}}function
|
|
2
|
+
import{createRequire as s5}from"node:module";var h5=Object.create;var{getPrototypeOf:u5,defineProperty:d4,getOwnPropertyNames:m5}=Object;var l5=Object.prototype.hasOwnProperty;function d5(q){return this[q]}var p5,c5,l1=(q,$,Z)=>{var X=q!=null&&typeof q==="object";if(X){var J=$?p5??=new WeakMap:c5??=new WeakMap,Q=J.get(q);if(Q)return Q}Z=q!=null?h5(u5(q)):{};let U=$||!q||!q.__esModule?d4(Z,"default",{value:q,enumerable:!0}):Z;for(let H of m5(q))if(!l5.call(U,H))d4(U,H,{get:d5.bind(q,H),enumerable:!0});if(X)J.set(q,U);return U};var K=(q,$)=>()=>($||q(($={exports:{}}).exports,$),$.exports);var n=s5(import.meta.url);var d1=K((a5)=>{class dq extends Error{constructor(q,$,Z){super(Z);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=$,this.exitCode=q,this.nestedError=void 0}}class p4 extends dq{constructor(q){super(1,"commander.invalidArgument",q);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}a5.CommanderError=dq;a5.InvalidArgumentError=p4});var N0=K((t5)=>{var{InvalidArgumentError:r5}=d1();class c4{constructor(q,$){switch(this.description=$||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,q[0]){case"<":this.required=!0,this._name=q.slice(1,-1);break;case"[":this.required=!1,this._name=q.slice(1,-1);break;default:this.required=!0,this._name=q;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(q,$){if($===this.defaultValue||!Array.isArray($))return[q];return $.push(q),$}default(q,$){return this.defaultValue=q,this.defaultValueDescription=$,this}argParser(q){return this.parseArg=q,this}choices(q){return this.argChoices=q.slice(),this.parseArg=($,Z)=>{if(!this.argChoices.includes($))throw new r5(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue($,Z);return $},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function o5(q){let $=q.name()+(q.variadic===!0?"...":"");return q.required?"<"+$+">":"["+$+"]"}t5.Argument=c4;t5.humanReadableArgName=o5});var pq=K((Z6)=>{var{humanReadableArgName:$6}=N0();class s4{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(q){this.helpWidth=this.helpWidth??q.helpWidth??80}visibleCommands(q){let $=q.commands.filter((X)=>!X._hidden),Z=q._getHelpCommand();if(Z&&!Z._hidden)$.push(Z);if(this.sortSubcommands)$.sort((X,J)=>{return X.name().localeCompare(J.name())});return $}compareOptions(q,$){let Z=(X)=>{return X.short?X.short.replace(/^-/,""):X.long.replace(/^--/,"")};return Z(q).localeCompare(Z($))}visibleOptions(q){let $=q.options.filter((X)=>!X.hidden),Z=q._getHelpOption();if(Z&&!Z.hidden){let X=Z.short&&q._findOption(Z.short),J=Z.long&&q._findOption(Z.long);if(!X&&!J)$.push(Z);else if(Z.long&&!J)$.push(q.createOption(Z.long,Z.description));else if(Z.short&&!X)$.push(q.createOption(Z.short,Z.description))}if(this.sortOptions)$.sort(this.compareOptions);return $}visibleGlobalOptions(q){if(!this.showGlobalOptions)return[];let $=[];for(let Z=q.parent;Z;Z=Z.parent){let X=Z.options.filter((J)=>!J.hidden);$.push(...X)}if(this.sortOptions)$.sort(this.compareOptions);return $}visibleArguments(q){if(q._argsDescription)q.registeredArguments.forEach(($)=>{$.description=$.description||q._argsDescription[$.name()]||""});if(q.registeredArguments.find(($)=>$.description))return q.registeredArguments;return[]}subcommandTerm(q){let $=q.registeredArguments.map((Z)=>$6(Z)).join(" ");return q._name+(q._aliases[0]?"|"+q._aliases[0]:"")+(q.options.length?" [options]":"")+($?" "+$:"")}optionTerm(q){return q.flags}argumentTerm(q){return q.name()}longestSubcommandTermLength(q,$){return $.visibleCommands(q).reduce((Z,X)=>{return Math.max(Z,this.displayWidth($.styleSubcommandTerm($.subcommandTerm(X))))},0)}longestOptionTermLength(q,$){return $.visibleOptions(q).reduce((Z,X)=>{return Math.max(Z,this.displayWidth($.styleOptionTerm($.optionTerm(X))))},0)}longestGlobalOptionTermLength(q,$){return $.visibleGlobalOptions(q).reduce((Z,X)=>{return Math.max(Z,this.displayWidth($.styleOptionTerm($.optionTerm(X))))},0)}longestArgumentTermLength(q,$){return $.visibleArguments(q).reduce((Z,X)=>{return Math.max(Z,this.displayWidth($.styleArgumentTerm($.argumentTerm(X))))},0)}commandUsage(q){let $=q._name;if(q._aliases[0])$=$+"|"+q._aliases[0];let Z="";for(let X=q.parent;X;X=X.parent)Z=X.name()+" "+Z;return Z+$+" "+q.usage()}commandDescription(q){return q.description()}subcommandDescription(q){return q.summary()||q.description()}optionDescription(q){let $=[];if(q.argChoices)$.push(`choices: ${q.argChoices.map((Z)=>JSON.stringify(Z)).join(", ")}`);if(q.defaultValue!==void 0){if(q.required||q.optional||q.isBoolean()&&typeof q.defaultValue==="boolean")$.push(`default: ${q.defaultValueDescription||JSON.stringify(q.defaultValue)}`)}if(q.presetArg!==void 0&&q.optional)$.push(`preset: ${JSON.stringify(q.presetArg)}`);if(q.envVar!==void 0)$.push(`env: ${q.envVar}`);if($.length>0){let Z=`(${$.join(", ")})`;if(q.description)return`${q.description} ${Z}`;return Z}return q.description}argumentDescription(q){let $=[];if(q.argChoices)$.push(`choices: ${q.argChoices.map((Z)=>JSON.stringify(Z)).join(", ")}`);if(q.defaultValue!==void 0)$.push(`default: ${q.defaultValueDescription||JSON.stringify(q.defaultValue)}`);if($.length>0){let Z=`(${$.join(", ")})`;if(q.description)return`${q.description} ${Z}`;return Z}return q.description}formatItemList(q,$,Z){if($.length===0)return[];return[Z.styleTitle(q),...$,""]}groupItems(q,$,Z){let X=new Map;return q.forEach((J)=>{let Q=Z(J);if(!X.has(Q))X.set(Q,[])}),$.forEach((J)=>{let Q=Z(J);if(!X.has(Q))X.set(Q,[]);X.get(Q).push(J)}),X}formatHelp(q,$){let Z=$.padWidth(q,$),X=$.helpWidth??80;function J(B,Y){return $.formatItem(B,Z,Y,$)}let Q=[`${$.styleTitle("Usage:")} ${$.styleUsage($.commandUsage(q))}`,""],U=$.commandDescription(q);if(U.length>0)Q=Q.concat([$.boxWrap($.styleCommandDescription(U),X),""]);let H=$.visibleArguments(q).map((B)=>{return J($.styleArgumentTerm($.argumentTerm(B)),$.styleArgumentDescription($.argumentDescription(B)))});if(Q=Q.concat(this.formatItemList("Arguments:",H,$)),this.groupItems(q.options,$.visibleOptions(q),(B)=>B.helpGroupHeading??"Options:").forEach((B,Y)=>{let L=B.map((R)=>{return J($.styleOptionTerm($.optionTerm(R)),$.styleOptionDescription($.optionDescription(R)))});Q=Q.concat(this.formatItemList(Y,L,$))}),$.showGlobalOptions){let B=$.visibleGlobalOptions(q).map((Y)=>{return J($.styleOptionTerm($.optionTerm(Y)),$.styleOptionDescription($.optionDescription(Y)))});Q=Q.concat(this.formatItemList("Global Options:",B,$))}return this.groupItems(q.commands,$.visibleCommands(q),(B)=>B.helpGroup()||"Commands:").forEach((B,Y)=>{let L=B.map((R)=>{return J($.styleSubcommandTerm($.subcommandTerm(R)),$.styleSubcommandDescription($.subcommandDescription(R)))});Q=Q.concat(this.formatItemList(Y,L,$))}),Q.join(`
|
|
3
|
+
`)}displayWidth(q){return a4(q).length}styleTitle(q){return q}styleUsage(q){return q.split(" ").map(($)=>{if($==="[options]")return this.styleOptionText($);if($==="[command]")return this.styleSubcommandText($);if($[0]==="["||$[0]==="<")return this.styleArgumentText($);return this.styleCommandText($)}).join(" ")}styleCommandDescription(q){return this.styleDescriptionText(q)}styleOptionDescription(q){return this.styleDescriptionText(q)}styleSubcommandDescription(q){return this.styleDescriptionText(q)}styleArgumentDescription(q){return this.styleDescriptionText(q)}styleDescriptionText(q){return q}styleOptionTerm(q){return this.styleOptionText(q)}styleSubcommandTerm(q){return q.split(" ").map(($)=>{if($==="[options]")return this.styleOptionText($);if($[0]==="["||$[0]==="<")return this.styleArgumentText($);return this.styleSubcommandText($)}).join(" ")}styleArgumentTerm(q){return this.styleArgumentText(q)}styleOptionText(q){return q}styleArgumentText(q){return q}styleSubcommandText(q){return q}styleCommandText(q){return q}padWidth(q,$){return Math.max($.longestOptionTermLength(q,$),$.longestGlobalOptionTermLength(q,$),$.longestSubcommandTermLength(q,$),$.longestArgumentTermLength(q,$))}preformatted(q){return/\n[^\S\r\n]/.test(q)}formatItem(q,$,Z,X){let Q=" ".repeat(2);if(!Z)return Q+q;let U=q.padEnd($+q.length-X.displayWidth(q)),H=2,G=(this.helpWidth??80)-$-H-2,B;if(G<this.minWidthToWrap||X.preformatted(Z))B=Z;else B=X.boxWrap(Z,G).replace(/\n/g,`
|
|
4
|
+
`+" ".repeat($+H));return Q+U+" ".repeat(H)+B.replace(/\n/g,`
|
|
5
|
+
${Q}`)}boxWrap(q,$){if($<this.minWidthToWrap)return q;let Z=q.split(/\r\n|\n/),X=/[\s]*[^\s]+/g,J=[];return Z.forEach((Q)=>{let U=Q.match(X);if(U===null){J.push("");return}let H=[U.shift()],z=this.displayWidth(H[0]);U.forEach((G)=>{let B=this.displayWidth(G);if(z+B<=$){H.push(G),z+=B;return}J.push(H.join(""));let Y=G.trimStart();H=[Y],z=this.displayWidth(Y)}),J.push(H.join(""))}),J.join(`
|
|
6
|
+
`)}}function a4(q){let $=/\x1b\[\d*(;\d*)*m/g;return q.replace($,"")}Z6.Help=s4;Z6.stripColor=a4});var cq=K((H6)=>{var{InvalidArgumentError:Q6}=d1();class n4{constructor(q,$){this.flags=q,this.description=$||"",this.required=q.includes("<"),this.optional=q.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(q),this.mandatory=!1;let Z=U6(q);if(this.short=Z.shortFlag,this.long=Z.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(q,$){return this.defaultValue=q,this.defaultValueDescription=$,this}preset(q){return this.presetArg=q,this}conflicts(q){return this.conflictsWith=this.conflictsWith.concat(q),this}implies(q){let $=q;if(typeof q==="string")$={[q]:!0};return this.implied=Object.assign(this.implied||{},$),this}env(q){return this.envVar=q,this}argParser(q){return this.parseArg=q,this}makeOptionMandatory(q=!0){return this.mandatory=!!q,this}hideHelp(q=!0){return this.hidden=!!q,this}_collectValue(q,$){if($===this.defaultValue||!Array.isArray($))return[q];return $.push(q),$}choices(q){return this.argChoices=q.slice(),this.parseArg=($,Z)=>{if(!this.argChoices.includes($))throw new Q6(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue($,Z);return $},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return i4(this.name().replace(/^no-/,""));return i4(this.name())}helpGroup(q){return this.helpGroupHeading=q,this}is(q){return this.short===q||this.long===q}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class r4{constructor(q){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,q.forEach(($)=>{if($.negate)this.negativeOptions.set($.attributeName(),$);else this.positiveOptions.set($.attributeName(),$)}),this.negativeOptions.forEach(($,Z)=>{if(this.positiveOptions.has(Z))this.dualOptions.add(Z)})}valueFromOption(q,$){let Z=$.attributeName();if(!this.dualOptions.has(Z))return!0;let X=this.negativeOptions.get(Z).presetArg,J=X!==void 0?X:!1;return $.negate===(J===q)}}function i4(q){return q.split("-").reduce(($,Z)=>{return $+Z[0].toUpperCase()+Z.slice(1)})}function U6(q){let $,Z,X=/^-[^-]$/,J=/^--[^-]/,Q=q.split(/[ |,]+/).concat("guard");if(X.test(Q[0]))$=Q.shift();if(J.test(Q[0]))Z=Q.shift();if(!$&&X.test(Q[0]))$=Q.shift();if(!$&&J.test(Q[0]))$=Z,Z=Q.shift();if(Q[0].startsWith("-")){let U=Q[0],H=`option creation failed due to '${U}' in option flags '${q}'`;if(/^-[^-][^-]/.test(U))throw Error(`${H}
|
|
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(
|
|
10
|
-
- too many short flags`);if(
|
|
11
|
-
- too many long flags`);throw Error(`${
|
|
12
|
-
- unrecognised flag format`)}if(
|
|
13
|
-
(Did you mean one of ${
|
|
14
|
-
(Did you mean ${
|
|
15
|
-
- specify the name in Command constructor or using .name()`);if(
|
|
16
|
-
Expecting one of '${
|
|
17
|
-
- already used by option '${
|
|
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(q
|
|
19
|
-
- if '${
|
|
9
|
+
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(X.test(U))throw Error(`${H}
|
|
10
|
+
- too many short flags`);if(J.test(U))throw Error(`${H}
|
|
11
|
+
- too many long flags`);throw Error(`${H}
|
|
12
|
+
- unrecognised flag format`)}if($===void 0&&Z===void 0)throw Error(`option creation failed due to no flags found in '${q}'.`);return{shortFlag:$,longFlag:Z}}H6.Option=n4;H6.DualOptions=r4});var o4=K((T6)=>{function Y6(q,$){if(Math.abs(q.length-$.length)>3)return Math.max(q.length,$.length);let Z=[];for(let X=0;X<=q.length;X++)Z[X]=[X];for(let X=0;X<=$.length;X++)Z[0][X]=X;for(let X=1;X<=$.length;X++)for(let J=1;J<=q.length;J++){let Q=1;if(q[J-1]===$[X-1])Q=0;else Q=1;if(Z[J][X]=Math.min(Z[J-1][X]+1,Z[J][X-1]+1,Z[J-1][X-1]+Q),J>1&&X>1&&q[J-1]===$[X-2]&&q[J-2]===$[X-1])Z[J][X]=Math.min(Z[J][X],Z[J-2][X-2]+1)}return Z[q.length][$.length]}function B6(q,$){if(!$||$.length===0)return"";$=Array.from(new Set($));let Z=q.startsWith("--");if(Z)q=q.slice(2),$=$.map((U)=>U.slice(2));let X=[],J=3,Q=0.4;if($.forEach((U)=>{if(U.length<=1)return;let H=Y6(q,U),z=Math.max(q.length,U.length);if((z-H)/z>Q){if(H<J)J=H,X=[U];else if(H===J)X.push(U)}}),X.sort((U,H)=>U.localeCompare(H)),Z)X=X.map((U)=>`--${U}`);if(X.length>1)return`
|
|
13
|
+
(Did you mean one of ${X.join(", ")}?)`;if(X.length===1)return`
|
|
14
|
+
(Did you mean ${X[0]}?)`;return""}T6.suggestSimilar=B6});var $2=K((M6)=>{var _6=n("node:events").EventEmitter,sq=n("node:child_process"),r=n("node:path"),S0=n("node:fs"),b=n("node:process"),{Argument:W6,humanReadableArgName:R6}=N0(),{CommanderError:aq}=d1(),{Help:I6,stripColor:V6}=pq(),{Option:t4,DualOptions:D6}=cq(),{suggestSimilar:e4}=o4();class nq extends _6{constructor(q){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=q||"",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:($)=>b.stdout.write($),writeErr:($)=>b.stderr.write($),outputError:($,Z)=>Z($),getOutHelpWidth:()=>b.stdout.isTTY?b.stdout.columns:void 0,getErrHelpWidth:()=>b.stderr.isTTY?b.stderr.columns:void 0,getOutHasColors:()=>iq()??(b.stdout.isTTY&&b.stdout.hasColors?.()),getErrHasColors:()=>iq()??(b.stderr.isTTY&&b.stderr.hasColors?.()),stripColor:($)=>V6($)},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(q){return this._outputConfiguration=q._outputConfiguration,this._helpOption=q._helpOption,this._helpCommand=q._helpCommand,this._helpConfiguration=q._helpConfiguration,this._exitCallback=q._exitCallback,this._storeOptionsAsProperties=q._storeOptionsAsProperties,this._combineFlagAndOptionalValue=q._combineFlagAndOptionalValue,this._allowExcessArguments=q._allowExcessArguments,this._enablePositionalOptions=q._enablePositionalOptions,this._showHelpAfterError=q._showHelpAfterError,this._showSuggestionAfterError=q._showSuggestionAfterError,this}_getCommandAndAncestors(){let q=[];for(let $=this;$;$=$.parent)q.push($);return q}command(q,$,Z){let X=$,J=Z;if(typeof X==="object"&&X!==null)J=X,X=null;J=J||{};let[,Q,U]=q.match(/([^ ]+) *(.*)/),H=this.createCommand(Q);if(X)H.description(X),H._executableHandler=!0;if(J.isDefault)this._defaultCommandName=H._name;if(H._hidden=!!(J.noHelp||J.hidden),H._executableFile=J.executableFile||null,U)H.arguments(U);if(this._registerCommand(H),H.parent=this,H.copyInheritedSettings(this),X)return this;return H}createCommand(q){return new nq(q)}createHelp(){return Object.assign(new I6,this.configureHelp())}configureHelp(q){if(q===void 0)return this._helpConfiguration;return this._helpConfiguration=q,this}configureOutput(q){if(q===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...q},this}showHelpAfterError(q=!0){if(typeof q!=="string")q=!!q;return this._showHelpAfterError=q,this}showSuggestionAfterError(q=!0){return this._showSuggestionAfterError=!!q,this}addCommand(q,$){if(!q._name)throw Error(`Command passed to .addCommand() must have a name
|
|
15
|
+
- specify the name in Command constructor or using .name()`);if($=$||{},$.isDefault)this._defaultCommandName=q._name;if($.noHelp||$.hidden)q._hidden=!0;return this._registerCommand(q),q.parent=this,q._checkForBrokenPassThrough(),this}createArgument(q,$){return new W6(q,$)}argument(q,$,Z,X){let J=this.createArgument(q,$);if(typeof Z==="function")J.default(X).argParser(Z);else J.default(Z);return this.addArgument(J),this}arguments(q){return q.trim().split(/ +/).forEach(($)=>{this.argument($)}),this}addArgument(q){let $=this.registeredArguments.slice(-1)[0];if($?.variadic)throw Error(`only the last argument can be variadic '${$.name()}'`);if(q.required&&q.defaultValue!==void 0&&q.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${q.name()}'`);return this.registeredArguments.push(q),this}helpCommand(q,$){if(typeof q==="boolean"){if(this._addImplicitHelpCommand=q,q&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let Z=q??"help [command]",[,X,J]=Z.match(/([^ ]+) *(.*)/),Q=$??"display help for command",U=this.createCommand(X);if(U.helpOption(!1),J)U.arguments(J);if(Q)U.description(Q);if(this._addImplicitHelpCommand=!0,this._helpCommand=U,q||$)this._initCommandGroup(U);return this}addHelpCommand(q,$){if(typeof q!=="object")return this.helpCommand(q,$),this;return this._addImplicitHelpCommand=!0,this._helpCommand=q,this._initCommandGroup(q),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(q,$){let Z=["preSubcommand","preAction","postAction"];if(!Z.includes(q))throw Error(`Unexpected value for event passed to hook : '${q}'.
|
|
16
|
+
Expecting one of '${Z.join("', '")}'`);if(this._lifeCycleHooks[q])this._lifeCycleHooks[q].push($);else this._lifeCycleHooks[q]=[$];return this}exitOverride(q){if(q)this._exitCallback=q;else this._exitCallback=($)=>{if($.code!=="commander.executeSubCommandAsync")throw $};return this}_exit(q,$,Z){if(this._exitCallback)this._exitCallback(new aq(q,$,Z));b.exit(q)}action(q){let $=(Z)=>{let X=this.registeredArguments.length,J=Z.slice(0,X);if(this._storeOptionsAsProperties)J[X]=this;else J[X]=this.opts();return J.push(this),q.apply(this,J)};return this._actionHandler=$,this}createOption(q,$){return new t4(q,$)}_callParseArg(q,$,Z,X){try{return q.parseArg($,Z)}catch(J){if(J.code==="commander.invalidArgument"){let Q=`${X} ${J.message}`;this.error(Q,{exitCode:J.exitCode,code:J.code})}throw J}}_registerOption(q){let $=q.short&&this._findOption(q.short)||q.long&&this._findOption(q.long);if($){let Z=q.long&&this._findOption(q.long)?q.long:q.short;throw Error(`Cannot add option '${q.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${Z}'
|
|
17
|
+
- already used by option '${$.flags}'`)}this._initOptionGroup(q),this.options.push(q)}_registerCommand(q){let $=(X)=>{return[X.name()].concat(X.aliases())},Z=$(q).find((X)=>this._findCommand(X));if(Z){let X=$(this._findCommand(Z)).join("|"),J=$(q).join("|");throw Error(`cannot add command '${J}' as already have command '${X}'`)}this._initCommandGroup(q),this.commands.push(q)}addOption(q){this._registerOption(q);let $=q.name(),Z=q.attributeName();if(q.negate){let J=q.long.replace(/^--no-/,"--");if(!this._findOption(J))this.setOptionValueWithSource(Z,q.defaultValue===void 0?!0:q.defaultValue,"default")}else if(q.defaultValue!==void 0)this.setOptionValueWithSource(Z,q.defaultValue,"default");let X=(J,Q,U)=>{if(J==null&&q.presetArg!==void 0)J=q.presetArg;let H=this.getOptionValue(Z);if(J!==null&&q.parseArg)J=this._callParseArg(q,J,H,Q);else if(J!==null&&q.variadic)J=q._collectValue(J,H);if(J==null)if(q.negate)J=!1;else if(q.isBoolean()||q.optional)J=!0;else J="";this.setOptionValueWithSource(Z,J,U)};if(this.on("option:"+$,(J)=>{let Q=`error: option '${q.flags}' argument '${J}' is invalid.`;X(J,Q,"cli")}),q.envVar)this.on("optionEnv:"+$,(J)=>{let Q=`error: option '${q.flags}' value '${J}' from env '${q.envVar}' is invalid.`;X(J,Q,"env")});return this}_optionEx(q,$,Z,X,J){if(typeof $==="object"&&$ instanceof t4)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let Q=this.createOption($,Z);if(Q.makeOptionMandatory(!!q.mandatory),typeof X==="function")Q.default(J).argParser(X);else if(X instanceof RegExp){let U=X;X=(H,z)=>{let G=U.exec(H);return G?G[0]:z},Q.default(J).argParser(X)}else Q.default(X);return this.addOption(Q)}option(q,$,Z,X){return this._optionEx({},q,$,Z,X)}requiredOption(q,$,Z,X){return this._optionEx({mandatory:!0},q,$,Z,X)}combineFlagAndOptionalValue(q=!0){return this._combineFlagAndOptionalValue=!!q,this}allowUnknownOption(q=!0){return this._allowUnknownOption=!!q,this}allowExcessArguments(q=!0){return this._allowExcessArguments=!!q,this}enablePositionalOptions(q=!0){return this._enablePositionalOptions=!!q,this}passThroughOptions(q=!0){return this._passThroughOptions=!!q,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(q=!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=!!q,this}getOptionValue(q){if(this._storeOptionsAsProperties)return this[q];return this._optionValues[q]}setOptionValue(q,$){return this.setOptionValueWithSource(q,$,void 0)}setOptionValueWithSource(q,$,Z){if(this._storeOptionsAsProperties)this[q]=$;else this._optionValues[q]=$;return this._optionValueSources[q]=Z,this}getOptionValueSource(q){return this._optionValueSources[q]}getOptionValueSourceWithGlobals(q){let $;return this._getCommandAndAncestors().forEach((Z)=>{if(Z.getOptionValueSource(q)!==void 0)$=Z.getOptionValueSource(q)}),$}_prepareUserArgs(q,$){if(q!==void 0&&!Array.isArray(q))throw Error("first parameter to parse must be array or undefined");if($=$||{},q===void 0&&$.from===void 0){if(b.versions?.electron)$.from="electron";let X=b.execArgv??[];if(X.includes("-e")||X.includes("--eval")||X.includes("-p")||X.includes("--print"))$.from="eval"}if(q===void 0)q=b.argv;this.rawArgs=q.slice();let Z;switch($.from){case void 0:case"node":this._scriptPath=q[1],Z=q.slice(2);break;case"electron":if(b.defaultApp)this._scriptPath=q[1],Z=q.slice(2);else Z=q.slice(1);break;case"user":Z=q.slice(0);break;case"eval":Z=q.slice(1);break;default:throw Error(`unexpected parse option { from: '${$.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",Z}parse(q,$){this._prepareForParse();let Z=this._prepareUserArgs(q,$);return this._parseCommand([],Z),this}async parseAsync(q,$){this._prepareForParse();let Z=this._prepareUserArgs(q,$);return await this._parseCommand([],Z),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
18
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(q,$,Z){if(S0.existsSync(q))return;let X=$?`searched for local subcommand relative to directory '${$}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",J=`'${q}' does not exist
|
|
19
|
+
- if '${Z}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
20
20
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
21
|
-
- ${
|
|
21
|
+
- ${X}`;throw Error(J)}_executeSubCommand(q,$){$=$.slice();let Z=!1,X=[".js",".ts",".tsx",".mjs",".cjs"];function J(G,B){let Y=r.resolve(G,B);if(S0.existsSync(Y))return Y;if(X.includes(r.extname(B)))return;let L=X.find((R)=>S0.existsSync(`${Y}${R}`));if(L)return`${Y}${L}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Q=q._executableFile||`${this._name}-${q._name}`,U=this._executableDir||"";if(this._scriptPath){let G;try{G=S0.realpathSync(this._scriptPath)}catch{G=this._scriptPath}U=r.resolve(r.dirname(G),U)}if(U){let G=J(U,Q);if(!G&&!q._executableFile&&this._scriptPath){let B=r.basename(this._scriptPath,r.extname(this._scriptPath));if(B!==this._name)G=J(U,`${B}-${q._name}`)}Q=G||Q}Z=X.includes(r.extname(Q));let H;if(b.platform!=="win32")if(Z)$.unshift(Q),$=q2(b.execArgv).concat($),H=sq.spawn(b.argv[0],$,{stdio:"inherit"});else H=sq.spawn(Q,$,{stdio:"inherit"});else this._checkForMissingExecutable(Q,U,q._name),$.unshift(Q),$=q2(b.execArgv).concat($),H=sq.spawn(b.execPath,$,{stdio:"inherit"});if(!H.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((B)=>{b.on(B,()=>{if(H.killed===!1&&H.exitCode===null)H.kill(B)})});let z=this._exitCallback;H.on("close",(G)=>{if(G=G??1,!z)b.exit(G);else z(new aq(G,"commander.executeSubCommandAsync","(close)"))}),H.on("error",(G)=>{if(G.code==="ENOENT")this._checkForMissingExecutable(Q,U,q._name);else if(G.code==="EACCES")throw Error(`'${Q}' not executable`);if(!z)b.exit(1);else{let B=new aq(1,"commander.executeSubCommandAsync","(error)");B.nestedError=G,z(B)}}),this.runningCommand=H}_dispatchSubcommand(q,$,Z){let X=this._findCommand(q);if(!X)this.help({error:!0});X._prepareForParse();let J;return J=this._chainOrCallSubCommandHook(J,X,"preSubcommand"),J=this._chainOrCall(J,()=>{if(X._executableHandler)this._executeSubCommand(X,$.concat(Z));else return X._parseCommand($,Z)}),J}_dispatchHelpCommand(q){if(!q)this.help();let $=this._findCommand(q);if($&&!$._executableHandler)$.help();return this._dispatchSubcommand(q,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((q,$)=>{if(q.required&&this.args[$]==null)this.missingArgument(q.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 q=(Z,X,J)=>{let Q=X;if(X!==null&&Z.parseArg){let U=`error: command-argument value '${X}' is invalid for argument '${Z.name()}'.`;Q=this._callParseArg(Z,X,J,U)}return Q};this._checkNumberOfArguments();let $=[];this.registeredArguments.forEach((Z,X)=>{let J=Z.defaultValue;if(Z.variadic){if(X<this.args.length){if(J=this.args.slice(X),Z.parseArg)J=J.reduce((Q,U)=>{return q(Z,U,Q)},Z.defaultValue)}else if(J===void 0)J=[]}else if(X<this.args.length){if(J=this.args[X],Z.parseArg)J=q(Z,J,Z.defaultValue)}$[X]=J}),this.processedArgs=$}_chainOrCall(q,$){if(q?.then&&typeof q.then==="function")return q.then(()=>$());return $()}_chainOrCallHooks(q,$){let Z=q,X=[];if(this._getCommandAndAncestors().reverse().filter((J)=>J._lifeCycleHooks[$]!==void 0).forEach((J)=>{J._lifeCycleHooks[$].forEach((Q)=>{X.push({hookedCommand:J,callback:Q})})}),$==="postAction")X.reverse();return X.forEach((J)=>{Z=this._chainOrCall(Z,()=>{return J.callback(J.hookedCommand,this)})}),Z}_chainOrCallSubCommandHook(q,$,Z){let X=q;if(this._lifeCycleHooks[Z]!==void 0)this._lifeCycleHooks[Z].forEach((J)=>{X=this._chainOrCall(X,()=>{return J(this,$)})});return X}_parseCommand(q,$){let Z=this.parseOptions($);if(this._parseOptionsEnv(),this._parseOptionsImplied(),q=q.concat(Z.operands),$=Z.unknown,this.args=q.concat($),q&&this._findCommand(q[0]))return this._dispatchSubcommand(q[0],q.slice(1),$);if(this._getHelpCommand()&&q[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(q[1]);if(this._defaultCommandName)return this._outputHelpIfRequested($),this._dispatchSubcommand(this._defaultCommandName,q,$);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(Z.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let X=()=>{if(Z.unknown.length>0)this.unknownOption(Z.unknown[0])},J=`command:${this.name()}`;if(this._actionHandler){X(),this._processArguments();let Q;if(Q=this._chainOrCallHooks(Q,"preAction"),Q=this._chainOrCall(Q,()=>this._actionHandler(this.processedArgs)),this.parent)Q=this._chainOrCall(Q,()=>{this.parent.emit(J,q,$)});return Q=this._chainOrCallHooks(Q,"postAction"),Q}if(this.parent?.listenerCount(J))X(),this._processArguments(),this.parent.emit(J,q,$);else if(q.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",q,$);if(this.listenerCount("command:*"))this.emit("command:*",q,$);else if(this.commands.length)this.unknownCommand();else X(),this._processArguments()}else if(this.commands.length)X(),this.help({error:!0});else X(),this._processArguments()}_findCommand(q){if(!q)return;return this.commands.find(($)=>$._name===q||$._aliases.includes(q))}_findOption(q){return this.options.find(($)=>$.is(q))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((q)=>{q.options.forEach(($)=>{if($.mandatory&&q.getOptionValue($.attributeName())===void 0)q.missingMandatoryOptionValue($)})})}_checkForConflictingLocalOptions(){let q=this.options.filter((Z)=>{let X=Z.attributeName();if(this.getOptionValue(X)===void 0)return!1;return this.getOptionValueSource(X)!=="default"});q.filter((Z)=>Z.conflictsWith.length>0).forEach((Z)=>{let X=q.find((J)=>Z.conflictsWith.includes(J.attributeName()));if(X)this._conflictingOption(Z,X)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((q)=>{q._checkForConflictingLocalOptions()})}parseOptions(q){let $=[],Z=[],X=$;function J(G){return G.length>1&&G[0]==="-"}let Q=(G)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(G))return!1;return!this._getCommandAndAncestors().some((B)=>B.options.map((Y)=>Y.short).some((Y)=>/^-\d$/.test(Y)))},U=null,H=null,z=0;while(z<q.length||H){let G=H??q[z++];if(H=null,G==="--"){if(X===Z)X.push(G);X.push(...q.slice(z));break}if(U&&(!J(G)||Q(G))){this.emit(`option:${U.name()}`,G);continue}if(U=null,J(G)){let B=this._findOption(G);if(B){if(B.required){let Y=q[z++];if(Y===void 0)this.optionMissingArgument(B);this.emit(`option:${B.name()}`,Y)}else if(B.optional){let Y=null;if(z<q.length&&(!J(q[z])||Q(q[z])))Y=q[z++];this.emit(`option:${B.name()}`,Y)}else this.emit(`option:${B.name()}`);U=B.variadic?B:null;continue}}if(G.length>2&&G[0]==="-"&&G[1]!=="-"){let B=this._findOption(`-${G[1]}`);if(B){if(B.required||B.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${B.name()}`,G.slice(2));else this.emit(`option:${B.name()}`),H=`-${G.slice(2)}`;continue}}if(/^--[^=]+=/.test(G)){let B=G.indexOf("="),Y=this._findOption(G.slice(0,B));if(Y&&(Y.required||Y.optional)){this.emit(`option:${Y.name()}`,G.slice(B+1));continue}}if(X===$&&J(G)&&!(this.commands.length===0&&Q(G)))X=Z;if((this._enablePositionalOptions||this._passThroughOptions)&&$.length===0&&Z.length===0){if(this._findCommand(G)){$.push(G),Z.push(...q.slice(z));break}else if(this._getHelpCommand()&&G===this._getHelpCommand().name()){$.push(G,...q.slice(z));break}else if(this._defaultCommandName){Z.push(G,...q.slice(z));break}}if(this._passThroughOptions){X.push(G,...q.slice(z));break}X.push(G)}return{operands:$,unknown:Z}}opts(){if(this._storeOptionsAsProperties){let q={},$=this.options.length;for(let Z=0;Z<$;Z++){let X=this.options[Z].attributeName();q[X]=X===this._versionOptionName?this._version:this[X]}return q}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((q,$)=>Object.assign(q,$.opts()),{})}error(q,$){if(this._outputConfiguration.outputError(`${q}
|
|
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
|
|
25
|
-
`),this._exit(0,"commander.version",q)}),this}description(q
|
|
26
|
-
Expecting one of '${
|
|
27
|
-
`)}),this}_outputHelpIfRequested(q){let
|
|
28
|
-
`)}}
|
|
29
|
-
`)?
|
|
24
|
+
`),this.outputHelp({error:!0});let Z=$||{},X=Z.exitCode||1,J=Z.code||"commander.error";this._exit(X,J,q)}_parseOptionsEnv(){this.options.forEach((q)=>{if(q.envVar&&q.envVar in b.env){let $=q.attributeName();if(this.getOptionValue($)===void 0||["default","config","env"].includes(this.getOptionValueSource($)))if(q.required||q.optional)this.emit(`optionEnv:${q.name()}`,b.env[q.envVar]);else this.emit(`optionEnv:${q.name()}`)}})}_parseOptionsImplied(){let q=new D6(this.options),$=(Z)=>{return this.getOptionValue(Z)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(Z))};this.options.filter((Z)=>Z.implied!==void 0&&$(Z.attributeName())&&q.valueFromOption(this.getOptionValue(Z.attributeName()),Z)).forEach((Z)=>{Object.keys(Z.implied).filter((X)=>!$(X)).forEach((X)=>{this.setOptionValueWithSource(X,Z.implied[X],"implied")})})}missingArgument(q){let $=`error: missing required argument '${q}'`;this.error($,{code:"commander.missingArgument"})}optionMissingArgument(q){let $=`error: option '${q.flags}' argument missing`;this.error($,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(q){let $=`error: required option '${q.flags}' not specified`;this.error($,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(q,$){let Z=(Q)=>{let U=Q.attributeName(),H=this.getOptionValue(U),z=this.options.find((B)=>B.negate&&U===B.attributeName()),G=this.options.find((B)=>!B.negate&&U===B.attributeName());if(z&&(z.presetArg===void 0&&H===!1||z.presetArg!==void 0&&H===z.presetArg))return z;return G||Q},X=(Q)=>{let U=Z(Q),H=U.attributeName();if(this.getOptionValueSource(H)==="env")return`environment variable '${U.envVar}'`;return`option '${U.flags}'`},J=`error: ${X(q)} cannot be used with ${X($)}`;this.error(J,{code:"commander.conflictingOption"})}unknownOption(q){if(this._allowUnknownOption)return;let $="";if(q.startsWith("--")&&this._showSuggestionAfterError){let X=[],J=this;do{let Q=J.createHelp().visibleOptions(J).filter((U)=>U.long).map((U)=>U.long);X=X.concat(Q),J=J.parent}while(J&&!J._enablePositionalOptions);$=e4(q,X)}let Z=`error: unknown option '${q}'${$}`;this.error(Z,{code:"commander.unknownOption"})}_excessArguments(q){if(this._allowExcessArguments)return;let $=this.registeredArguments.length,Z=$===1?"":"s",J=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${$} argument${Z} but got ${q.length}.`;this.error(J,{code:"commander.excessArguments"})}unknownCommand(){let q=this.args[0],$="";if(this._showSuggestionAfterError){let X=[];this.createHelp().visibleCommands(this).forEach((J)=>{if(X.push(J.name()),J.alias())X.push(J.alias())}),$=e4(q,X)}let Z=`error: unknown command '${q}'${$}`;this.error(Z,{code:"commander.unknownCommand"})}version(q,$,Z){if(q===void 0)return this._version;this._version=q,$=$||"-V, --version",Z=Z||"output the version number";let X=this.createOption($,Z);return this._versionOptionName=X.attributeName(),this._registerOption(X),this.on("option:"+X.name(),()=>{this._outputConfiguration.writeOut(`${q}
|
|
25
|
+
`),this._exit(0,"commander.version",q)}),this}description(q,$){if(q===void 0&&$===void 0)return this._description;if(this._description=q,$)this._argsDescription=$;return this}summary(q){if(q===void 0)return this._summary;return this._summary=q,this}alias(q){if(q===void 0)return this._aliases[0];let $=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)$=this.commands[this.commands.length-1];if(q===$._name)throw Error("Command alias can't be the same as its name");let Z=this.parent?._findCommand(q);if(Z){let X=[Z.name()].concat(Z.aliases()).join("|");throw Error(`cannot add alias '${q}' to command '${this.name()}' as already have command '${X}'`)}return $._aliases.push(q),this}aliases(q){if(q===void 0)return this._aliases;return q.forEach(($)=>this.alias($)),this}usage(q){if(q===void 0){if(this._usage)return this._usage;let $=this.registeredArguments.map((Z)=>{return R6(Z)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?$:[]).join(" ")}return this._usage=q,this}name(q){if(q===void 0)return this._name;return this._name=q,this}helpGroup(q){if(q===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=q,this}commandsGroup(q){if(q===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=q,this}optionsGroup(q){if(q===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=q,this}_initOptionGroup(q){if(this._defaultOptionGroup&&!q.helpGroupHeading)q.helpGroup(this._defaultOptionGroup)}_initCommandGroup(q){if(this._defaultCommandGroup&&!q.helpGroup())q.helpGroup(this._defaultCommandGroup)}nameFromFilename(q){return this._name=r.basename(q,r.extname(q)),this}executableDir(q){if(q===void 0)return this._executableDir;return this._executableDir=q,this}helpInformation(q){let $=this.createHelp(),Z=this._getOutputContext(q);$.prepareContext({error:Z.error,helpWidth:Z.helpWidth,outputHasColors:Z.hasColors});let X=$.formatHelp(this,$);if(Z.hasColors)return X;return this._outputConfiguration.stripColor(X)}_getOutputContext(q){q=q||{};let $=!!q.error,Z,X,J;if($)Z=(U)=>this._outputConfiguration.writeErr(U),X=this._outputConfiguration.getErrHasColors(),J=this._outputConfiguration.getErrHelpWidth();else Z=(U)=>this._outputConfiguration.writeOut(U),X=this._outputConfiguration.getOutHasColors(),J=this._outputConfiguration.getOutHelpWidth();return{error:$,write:(U)=>{if(!X)U=this._outputConfiguration.stripColor(U);return Z(U)},hasColors:X,helpWidth:J}}outputHelp(q){let $;if(typeof q==="function")$=q,q=void 0;let Z=this._getOutputContext(q),X={error:Z.error,write:Z.write,command:this};this._getCommandAndAncestors().reverse().forEach((Q)=>Q.emit("beforeAllHelp",X)),this.emit("beforeHelp",X);let J=this.helpInformation({error:Z.error});if($){if(J=$(J),typeof J!=="string"&&!Buffer.isBuffer(J))throw Error("outputHelp callback must return a string or a Buffer")}if(Z.write(J),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",X),this._getCommandAndAncestors().forEach((Q)=>Q.emit("afterAllHelp",X))}helpOption(q,$){if(typeof q==="boolean"){if(q){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(q??"-h, --help",$??"display help for command"),q||$)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(q){return this._helpOption=q,this._initOptionGroup(q),this}help(q){this.outputHelp(q);let $=Number(b.exitCode??0);if($===0&&q&&typeof q!=="function"&&q.error)$=1;this._exit($,"commander.help","(outputHelp)")}addHelpText(q,$){let Z=["beforeAll","before","after","afterAll"];if(!Z.includes(q))throw Error(`Unexpected value for position to addHelpText.
|
|
26
|
+
Expecting one of '${Z.join("', '")}'`);let X=`${q}Help`;return this.on(X,(J)=>{let Q;if(typeof $==="function")Q=$({error:J.error,command:J.command});else Q=$;if(Q)J.write(`${Q}
|
|
27
|
+
`)}),this}_outputHelpIfRequested(q){let $=this._getHelpOption();if($&&q.find((X)=>$.is(X)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function q2(q){return q.map(($)=>{if(!$.startsWith("--inspect"))return $;let Z,X="127.0.0.1",J="9229",Q;if((Q=$.match(/^(--inspect(-brk)?)$/))!==null)Z=Q[1];else if((Q=$.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(Z=Q[1],/^\d+$/.test(Q[3]))J=Q[3];else X=Q[3];else if((Q=$.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)Z=Q[1],X=Q[3],J=Q[4];if(Z&&J!=="0")return`${Z}=${X}:${parseInt(J)+1}`;return $})}function iq(){if(b.env.NO_COLOR||b.env.FORCE_COLOR==="0"||b.env.FORCE_COLOR==="false")return!1;if(b.env.FORCE_COLOR||b.env.CLICOLOR_FORCE!==void 0)return!0;return}M6.Command=nq;M6.useColor=iq});var Q2=K((N6)=>{var{Argument:Z2}=N0(),{Command:rq}=$2(),{CommanderError:F6,InvalidArgumentError:X2}=d1(),{Help:O6}=pq(),{Option:J2}=cq();N6.program=new rq;N6.createCommand=(q)=>new rq(q);N6.createOption=(q,$)=>new J2(q,$);N6.createArgument=(q,$)=>new Z2(q,$);N6.Command=rq;N6.Option=J2;N6.Argument=Z2;N6.Help=O6;N6.CommanderError=F6;N6.InvalidArgumentError=X2;N6.InvalidOptionArgumentError=X2});var A=K((U7)=>{var eq=Symbol.for("yaml.alias"),I2=Symbol.for("yaml.document"),j0=Symbol.for("yaml.map"),V2=Symbol.for("yaml.pair"),q9=Symbol.for("yaml.scalar"),C0=Symbol.for("yaml.seq"),e=Symbol.for("yaml.node.type"),e6=(q)=>!!q&&typeof q==="object"&&q[e]===eq,q7=(q)=>!!q&&typeof q==="object"&&q[e]===I2,$7=(q)=>!!q&&typeof q==="object"&&q[e]===j0,Z7=(q)=>!!q&&typeof q==="object"&&q[e]===V2,D2=(q)=>!!q&&typeof q==="object"&&q[e]===q9,X7=(q)=>!!q&&typeof q==="object"&&q[e]===C0;function M2(q){if(q&&typeof q==="object")switch(q[e]){case j0:case C0:return!0}return!1}function J7(q){if(q&&typeof q==="object")switch(q[e]){case eq:case j0:case q9:case C0:return!0}return!1}var Q7=(q)=>(D2(q)||M2(q))&&!!q.anchor;U7.ALIAS=eq;U7.DOC=I2;U7.MAP=j0;U7.NODE_TYPE=e;U7.PAIR=V2;U7.SCALAR=q9;U7.SEQ=C0;U7.hasAnchor=Q7;U7.isAlias=e6;U7.isCollection=M2;U7.isDocument=q7;U7.isMap=$7;U7.isNode=J7;U7.isPair=Z7;U7.isScalar=D2;U7.isSeq=X7});var p1=K((F7)=>{var k=A(),g=Symbol("break visit"),P2=Symbol("skip children"),a=Symbol("remove node");function E0(q,$){let Z=K2($);if(k.isDocument(q)){if(S1(null,q.contents,Z,Object.freeze([q]))===a)q.contents=null}else S1(null,q,Z,Object.freeze([]))}E0.BREAK=g;E0.SKIP=P2;E0.REMOVE=a;function S1(q,$,Z,X){let J=F2(q,$,Z,X);if(k.isNode(J)||k.isPair(J))return O2(q,X,J),S1(q,J,Z,X);if(typeof J!=="symbol"){if(k.isCollection($)){X=Object.freeze(X.concat($));for(let Q=0;Q<$.items.length;++Q){let U=S1(Q,$.items[Q],Z,X);if(typeof U==="number")Q=U-1;else if(U===g)return g;else if(U===a)$.items.splice(Q,1),Q-=1}}else if(k.isPair($)){X=Object.freeze(X.concat($));let Q=S1("key",$.key,Z,X);if(Q===g)return g;else if(Q===a)$.key=null;let U=S1("value",$.value,Z,X);if(U===g)return g;else if(U===a)$.value=null}}return J}async function f0(q,$){let Z=K2($);if(k.isDocument(q)){if(await A1(null,q.contents,Z,Object.freeze([q]))===a)q.contents=null}else await A1(null,q,Z,Object.freeze([]))}f0.BREAK=g;f0.SKIP=P2;f0.REMOVE=a;async function A1(q,$,Z,X){let J=await F2(q,$,Z,X);if(k.isNode(J)||k.isPair(J))return O2(q,X,J),A1(q,J,Z,X);if(typeof J!=="symbol"){if(k.isCollection($)){X=Object.freeze(X.concat($));for(let Q=0;Q<$.items.length;++Q){let U=await A1(Q,$.items[Q],Z,X);if(typeof U==="number")Q=U-1;else if(U===g)return g;else if(U===a)$.items.splice(Q,1),Q-=1}}else if(k.isPair($)){X=Object.freeze(X.concat($));let Q=await A1("key",$.key,Z,X);if(Q===g)return g;else if(Q===a)$.key=null;let U=await A1("value",$.value,Z,X);if(U===g)return g;else if(U===a)$.value=null}}return J}function K2(q){if(typeof q==="object"&&(q.Collection||q.Node||q.Value))return Object.assign({Alias:q.Node,Map:q.Node,Scalar:q.Node,Seq:q.Node},q.Value&&{Map:q.Value,Scalar:q.Value,Seq:q.Value},q.Collection&&{Map:q.Collection,Seq:q.Collection},q);return q}function F2(q,$,Z,X){if(typeof Z==="function")return Z(q,$,X);if(k.isMap($))return Z.Map?.(q,$,X);if(k.isSeq($))return Z.Seq?.(q,$,X);if(k.isPair($))return Z.Pair?.(q,$,X);if(k.isScalar($))return Z.Scalar?.(q,$,X);if(k.isAlias($))return Z.Alias?.(q,$,X);return}function O2(q,$,Z){let X=$[$.length-1];if(k.isCollection(X))X.items[q]=Z;else if(k.isPair(X))if(q==="key")X.key=Z;else X.value=Z;else if(k.isDocument(X))X.contents=Z;else{let J=k.isAlias(X)?"alias":"scalar";throw Error(`Cannot replace node with ${J} parent`)}}F7.visit=E0;F7.visitAsync=f0});var $9=K((b7)=>{var N2=A(),S7=p1(),A7={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},w7=(q)=>q.replace(/[!,[\]{}]/g,($)=>A7[$]);class h{constructor(q,$){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},h.defaultYaml,q),this.tags=Object.assign({},h.defaultTags,$)}clone(){let q=new h(this.yaml,this.tags);return q.docStart=this.docStart,q}atDocument(){let q=new h(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:h.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},h.defaultTags);break}return q}add(q,$){if(this.atNextDocument)this.yaml={explicit:h.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},h.defaultTags),this.atNextDocument=!1;let Z=q.trim().split(/[ \t]+/),X=Z.shift();switch(X){case"%TAG":{if(Z.length!==2){if($(0,"%TAG directive should contain exactly two parts"),Z.length<2)return!1}let[J,Q]=Z;return this.tags[J]=Q,!0}case"%YAML":{if(this.yaml.explicit=!0,Z.length!==1)return $(0,"%YAML directive should contain exactly one part"),!1;let[J]=Z;if(J==="1.1"||J==="1.2")return this.yaml.version=J,!0;else{let Q=/^\d+\.\d+$/.test(J);return $(6,`Unsupported YAML version ${J}`,Q),!1}}default:return $(0,`Unknown directive ${X}`,!0),!1}}tagName(q,$){if(q==="!")return"!";if(q[0]!=="!")return $(`Not a valid tag: ${q}`),null;if(q[1]==="<"){let Q=q.slice(2,-1);if(Q==="!"||Q==="!!")return $(`Verbatim tags aren't resolved, so ${q} is invalid.`),null;if(q[q.length-1]!==">")$("Verbatim tags must end with a >");return Q}let[,Z,X]=q.match(/^(.*!)([^!]*)$/s);if(!X)$(`The ${q} tag has no suffix`);let J=this.tags[Z];if(J)try{return J+decodeURIComponent(X)}catch(Q){return $(String(Q)),null}if(Z==="!")return q;return $(`Could not resolve tag: ${q}`),null}tagString(q){for(let[$,Z]of Object.entries(this.tags))if(q.startsWith(Z))return $+w7(q.substring(Z.length));return q[0]==="!"?q:`!<${q}>`}toString(q){let $=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],Z=Object.entries(this.tags),X;if(q&&Z.length>0&&N2.isNode(q.contents)){let J={};S7.visit(q.contents,(Q,U)=>{if(N2.isNode(U)&&U.tag)J[U.tag]=!0}),X=Object.keys(J)}else X=[];for(let[J,Q]of Z){if(J==="!!"&&Q==="tag:yaml.org,2002:")continue;if(!q||X.some((U)=>U.startsWith(Q)))$.push(`%TAG ${J} ${Q}`)}return $.join(`
|
|
28
|
+
`)}}h.defaultYaml={explicit:!1,version:"1.2"};h.defaultTags={"!!":"tag:yaml.org,2002:"};b7.Directives=h});var y0=K((y7)=>{var S2=A(),C7=p1();function E7(q){if(/[\x00-\x19\s,[\]{}]/.test(q)){let Z=`Anchor must not contain whitespace or control characters: ${JSON.stringify(q)}`;throw Error(Z)}return!0}function A2(q){let $=new Set;return C7.visit(q,{Value(Z,X){if(X.anchor)$.add(X.anchor)}}),$}function w2(q,$){for(let Z=1;;++Z){let X=`${q}${Z}`;if(!$.has(X))return X}}function f7(q,$){let Z=[],X=new Map,J=null;return{onAnchor:(Q)=>{Z.push(Q),J??(J=A2(q));let U=w2($,J);return J.add(U),U},setAnchors:()=>{for(let Q of Z){let U=X.get(Q);if(typeof U==="object"&&U.anchor&&(S2.isScalar(U.node)||S2.isCollection(U.node)))U.node.anchor=U.anchor;else{let H=Error("Failed to resolve repeated object (this should not happen)");throw H.source=Q,H}}},sourceObjects:X}}y7.anchorIsValid=E7;y7.anchorNames=A2;y7.createNodeAnchors=f7;y7.findNewAnchor=w2});var Z9=K((h7)=>{function c1(q,$,Z,X){if(X&&typeof X==="object")if(Array.isArray(X))for(let J=0,Q=X.length;J<Q;++J){let U=X[J],H=c1(q,X,String(J),U);if(H===void 0)delete X[J];else if(H!==U)X[J]=H}else if(X instanceof Map)for(let J of Array.from(X.keys())){let Q=X.get(J),U=c1(q,X,J,Q);if(U===void 0)X.delete(J);else if(U!==Q)X.set(J,U)}else if(X instanceof Set)for(let J of Array.from(X)){let Q=c1(q,X,J,J);if(Q===void 0)X.delete(J);else if(Q!==J)X.delete(J),X.add(Q)}else for(let[J,Q]of Object.entries(X)){let U=c1(q,X,J,Q);if(U===void 0)delete X[J];else if(U!==Q)X[J]=U}return q.call($,Z,X)}h7.applyReviver=c1});var Z1=K((l7)=>{var m7=A();function b2(q,$,Z){if(Array.isArray(q))return q.map((X,J)=>b2(X,String(J),Z));if(q&&typeof q.toJSON==="function"){if(!Z||!m7.hasAnchor(q))return q.toJSON($,Z);let X={aliasCount:0,count:1,res:void 0};Z.anchors.set(q,X),Z.onCreate=(Q)=>{X.res=Q,delete Z.onCreate};let J=q.toJSON($,Z);if(Z.onCreate)Z.onCreate(J);return J}if(typeof q==="bigint"&&!Z?.keep)return Number(q);return q}l7.toJS=b2});var x0=K((s7)=>{var p7=Z9(),j2=A(),c7=Z1();class C2{constructor(q){Object.defineProperty(this,j2.NODE_TYPE,{value:q})}clone(){let q=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)q.range=this.range.slice();return q}toJS(q,{mapAsMap:$,maxAliasCount:Z,onAnchor:X,reviver:J}={}){if(!j2.isDocument(q))throw TypeError("A document argument is required");let Q={anchors:new Map,doc:q,keep:!0,mapAsMap:$===!0,mapKeyWarned:!1,maxAliasCount:typeof Z==="number"?Z:100},U=c7.toJS(this,"",Q);if(typeof X==="function")for(let{count:H,res:z}of Q.anchors.values())X(z,H);return typeof J==="function"?p7.applyReviver(J,{"":U},"",U):U}}s7.NodeBase=C2});var s1=K((t7)=>{var i7=y0(),n7=p1(),w1=A(),r7=x0(),o7=Z1();class E2 extends r7.NodeBase{constructor(q){super(w1.ALIAS);this.source=q,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(q,$){let Z;if($?.aliasResolveCache)Z=$.aliasResolveCache;else if(Z=[],n7.visit(q,{Node:(J,Q)=>{if(w1.isAlias(Q)||w1.hasAnchor(Q))Z.push(Q)}}),$)$.aliasResolveCache=Z;let X=void 0;for(let J of Z){if(J===this)break;if(J.anchor===this.source)X=J}return X}toJSON(q,$){if(!$)return{source:this.source};let{anchors:Z,doc:X,maxAliasCount:J}=$,Q=this.resolve(X,$);if(!Q){let H=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(H)}let U=Z.get(Q);if(!U)o7.toJS(Q,null,$),U=Z.get(Q);if(U?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(J>=0){if(U.count+=1,U.aliasCount===0)U.aliasCount=k0(X,Q,Z);if(U.count*U.aliasCount>J)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return U.res}toString(q,$,Z){let X=`*${this.source}`;if(q){if(i7.anchorIsValid(this.source),q.options.verifyAliasOrder&&!q.anchors.has(this.source)){let J=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(J)}if(q.implicitKey)return`${X} `}return X}}function k0(q,$,Z){if(w1.isAlias($)){let X=$.resolve(q),J=Z&&X&&Z.get(X);return J?J.count*J.aliasCount:0}else if(w1.isCollection($)){let X=0;for(let J of $.items){let Q=k0(q,J,Z);if(Q>X)X=Q}return X}else if(w1.isPair($)){let X=k0(q,$.key,Z),J=k0(q,$.value,Z);return Math.max(X,J)}return 1}t7.Alias=E2});var E=K((J8)=>{var q8=A(),$8=x0(),Z8=Z1(),X8=(q)=>!q||typeof q!=="function"&&typeof q!=="object";class R1 extends $8.NodeBase{constructor(q){super(q8.SCALAR);this.value=q}toJSON(q,$){return $?.keep?this.value:Z8.toJS(this.value,q,$)}toString(){return String(this.value)}}R1.BLOCK_FOLDED="BLOCK_FOLDED";R1.BLOCK_LITERAL="BLOCK_LITERAL";R1.PLAIN="PLAIN";R1.QUOTE_DOUBLE="QUOTE_DOUBLE";R1.QUOTE_SINGLE="QUOTE_SINGLE";J8.Scalar=R1;J8.isScalarValue=X8});var a1=K((B8)=>{var H8=s1(),I1=A(),f2=E(),z8="tag:yaml.org,2002:";function G8(q,$,Z){if($){let X=Z.filter((Q)=>Q.tag===$),J=X.find((Q)=>!Q.format)??X[0];if(!J)throw Error(`Tag ${$} not found`);return J}return Z.find((X)=>X.identify?.(q)&&!X.format)}function Y8(q,$,Z){if(I1.isDocument(q))q=q.contents;if(I1.isNode(q))return q;if(I1.isPair(q)){let Y=Z.schema[I1.MAP].createNode?.(Z.schema,null,Z);return Y.items.push(q),Y}if(q instanceof String||q instanceof Number||q instanceof Boolean||typeof BigInt<"u"&&q instanceof BigInt)q=q.valueOf();let{aliasDuplicateObjects:X,onAnchor:J,onTagObj:Q,schema:U,sourceObjects:H}=Z,z=void 0;if(X&&q&&typeof q==="object")if(z=H.get(q),z)return z.anchor??(z.anchor=J(q)),new H8.Alias(z.anchor);else z={anchor:null,node:null},H.set(q,z);if($?.startsWith("!!"))$=z8+$.slice(2);let G=G8(q,$,U.tags);if(!G){if(q&&typeof q.toJSON==="function")q=q.toJSON();if(!q||typeof q!=="object"){let Y=new f2.Scalar(q);if(z)z.node=Y;return Y}G=q instanceof Map?U[I1.MAP]:(Symbol.iterator in Object(q))?U[I1.SEQ]:U[I1.MAP]}if(Q)Q(G),delete Z.onTagObj;let B=G?.createNode?G.createNode(Z.schema,q,Z):typeof G?.nodeClass?.from==="function"?G.nodeClass.from(Z.schema,q,Z):new f2.Scalar(q);if($)B.tag=$;else if(!G.default)B.tag=G.tag;if(z)z.node=B;return B}B8.createNode=Y8});var g0=K((W8)=>{var L8=a1(),i=A(),_8=x0();function X9(q,$,Z){let X=Z;for(let J=$.length-1;J>=0;--J){let Q=$[J];if(typeof Q==="number"&&Number.isInteger(Q)&&Q>=0){let U=[];U[Q]=X,X=U}else X=new Map([[Q,X]])}return L8.createNode(X,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:q,sourceObjects:new Map})}var y2=(q)=>q==null||typeof q==="object"&&!!q[Symbol.iterator]().next().done;class x2 extends _8.NodeBase{constructor(q,$){super(q);Object.defineProperty(this,"schema",{value:$,configurable:!0,enumerable:!1,writable:!0})}clone(q){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(q)$.schema=q;if($.items=$.items.map((Z)=>i.isNode(Z)||i.isPair(Z)?Z.clone(q):Z),this.range)$.range=this.range.slice();return $}addIn(q,$){if(y2(q))this.add($);else{let[Z,...X]=q,J=this.get(Z,!0);if(i.isCollection(J))J.addIn(X,$);else if(J===void 0&&this.schema)this.set(Z,X9(this.schema,X,$));else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${X}`)}}deleteIn(q){let[$,...Z]=q;if(Z.length===0)return this.delete($);let X=this.get($,!0);if(i.isCollection(X))return X.deleteIn(Z);else throw Error(`Expected YAML collection at ${$}. Remaining path: ${Z}`)}getIn(q,$){let[Z,...X]=q,J=this.get(Z,!0);if(X.length===0)return!$&&i.isScalar(J)?J.value:J;else return i.isCollection(J)?J.getIn(X,$):void 0}hasAllNullValues(q){return this.items.every(($)=>{if(!i.isPair($))return!1;let Z=$.value;return Z==null||q&&i.isScalar(Z)&&Z.value==null&&!Z.commentBefore&&!Z.comment&&!Z.tag})}hasIn(q){let[$,...Z]=q;if(Z.length===0)return this.has($);let X=this.get($,!0);return i.isCollection(X)?X.hasIn(Z):!1}setIn(q,$){let[Z,...X]=q;if(X.length===0)this.set(Z,$);else{let J=this.get(Z,!0);if(i.isCollection(J))J.setIn(X,$);else if(J===void 0&&this.schema)this.set(Z,X9(this.schema,X,$));else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${X}`)}}}W8.Collection=x2;W8.collectionFromPath=X9;W8.isEmptyPath=y2});var i1=K((P8)=>{var D8=(q)=>q.replace(/^(?!$)(?: $)?/gm,"#");function J9(q,$){if(/^\n+$/.test(q))return q.substring(1);return $?q.replace(/^(?! *$)/gm,$):q}var M8=(q,$,Z)=>q.endsWith(`
|
|
29
|
+
`)?J9(Z,$):Z.includes(`
|
|
30
30
|
`)?`
|
|
31
|
-
`+
|
|
32
|
-
`){if(
|
|
33
|
-
`&&
|
|
34
|
-
`&&O!=="\t")
|
|
35
|
-
${
|
|
36
|
-
${
|
|
37
|
-
`);J
|
|
38
|
-
`){if(Q-
|
|
31
|
+
`+J9(Z,$):(q.endsWith(" ")?"":" ")+Z;P8.indentComment=J9;P8.lineComment=M8;P8.stringifyComment=D8});var g2=K((S8)=>{function N8(q,$,Z="flow",{indentAtStart:X,lineWidth:J=80,minContentWidth:Q=20,onFold:U,onOverflow:H}={}){if(!J||J<0)return q;if(J<Q)Q=0;let z=Math.max(1+Q,1+J-$.length);if(q.length<=z)return q;let G=[],B={},Y=J-$.length;if(typeof X==="number")if(X>J-Math.max(2,Q))G.push(0);else Y=J-X;let L=void 0,R=void 0,W=!1,T=-1,_=-1,V=-1;if(Z==="block"){if(T=k2(q,T,$.length),T!==-1)Y=T+z}for(let P;P=q[T+=1];){if(Z==="quoted"&&P==="\\"){switch(_=T,q[T+1]){case"x":T+=3;break;case"u":T+=5;break;case"U":T+=9;break;default:T+=1}V=T}if(P===`
|
|
32
|
+
`){if(Z==="block")T=k2(q,T,$.length);Y=T+$.length+z,L=void 0}else{if(P===" "&&R&&R!==" "&&R!==`
|
|
33
|
+
`&&R!=="\t"){let O=q[T+1];if(O&&O!==" "&&O!==`
|
|
34
|
+
`&&O!=="\t")L=T}if(T>=Y)if(L)G.push(L),Y=L+z,L=void 0;else if(Z==="quoted"){while(R===" "||R==="\t")R=P,P=q[T+=1],W=!0;let O=T>V+1?T-2:_-1;if(B[O])return q;G.push(O),B[O]=!0,Y=O+z,L=void 0}else W=!0}R=P}if(W&&H)H();if(G.length===0)return q;if(U)U();let D=q.slice(0,G[0]);for(let P=0;P<G.length;++P){let O=G[P],N=G[P+1]||q.length;if(O===0)D=`
|
|
35
|
+
${$}${q.slice(0,N)}`;else{if(Z==="quoted"&&B[O])D+=`${q[O]}\\`;D+=`
|
|
36
|
+
${$}${q.slice(O+1,N)}`}}return D}function k2(q,$,Z){let X=$,J=$+1,Q=q[J];while(Q===" "||Q==="\t")if($<J+Z)Q=q[++$];else{do Q=q[++$];while(Q&&Q!==`
|
|
37
|
+
`);X=$,J=$+1,Q=q[J]}return X}S8.FOLD_BLOCK="block";S8.FOLD_FLOW="flow";S8.FOLD_QUOTED="quoted";S8.foldFlowLines=N8});var r1=K((y8)=>{var l=E(),X1=g2(),h0=(q,$)=>({indentAtStart:$?q.indent.length:q.indentAtStart,lineWidth:q.options.lineWidth,minContentWidth:q.options.minContentWidth}),u0=(q)=>/^(%|---|\.\.\.)/m.test(q);function C8(q,$,Z){if(!$||$<0)return!1;let X=$-Z,J=q.length;if(J<=X)return!1;for(let Q=0,U=0;Q<J;++Q)if(q[Q]===`
|
|
38
|
+
`){if(Q-U>X)return!0;if(U=Q+1,J-U<=X)return!1}return!0}function n1(q,$){let Z=JSON.stringify(q);if($.options.doubleQuotedAsJSON)return Z;let{implicitKey:X}=$,J=$.options.doubleQuotedMinMultiLineLength,Q=$.indent||(u0(q)?" ":""),U="",H=0;for(let z=0,G=Z[z];G;G=Z[++z]){if(G===" "&&Z[z+1]==="\\"&&Z[z+2]==="n")U+=Z.slice(H,z)+"\\ ",z+=1,H=z,G="\\";if(G==="\\")switch(Z[z+1]){case"u":{U+=Z.slice(H,z);let B=Z.substr(z+2,4);switch(B){case"0000":U+="\\0";break;case"0007":U+="\\a";break;case"000b":U+="\\v";break;case"001b":U+="\\e";break;case"0085":U+="\\N";break;case"00a0":U+="\\_";break;case"2028":U+="\\L";break;case"2029":U+="\\P";break;default:if(B.substr(0,2)==="00")U+="\\x"+B.substr(2);else U+=Z.substr(z,6)}z+=5,H=z+1}break;case"n":if(X||Z[z+2]==='"'||Z.length<J)z+=1;else{U+=Z.slice(H,z)+`
|
|
39
39
|
|
|
40
|
-
`;while(
|
|
41
|
-
`,
|
|
42
|
-
`)||/[ \t]\n|\n[ \t]/.test(q))return
|
|
43
|
-
${
|
|
40
|
+
`;while(Z[z+2]==="\\"&&Z[z+3]==="n"&&Z[z+4]!=='"')U+=`
|
|
41
|
+
`,z+=2;if(U+=Q,Z[z+2]===" ")U+="\\";z+=1,H=z+1}break;default:z+=1}}return U=H?U+Z.slice(H):Z,X?U:X1.foldFlowLines(U,Q,X1.FOLD_QUOTED,h0($,!1))}function Q9(q,$){if($.options.singleQuote===!1||$.implicitKey&&q.includes(`
|
|
42
|
+
`)||/[ \t]\n|\n[ \t]/.test(q))return n1(q,$);let Z=$.indent||(u0(q)?" ":""),X="'"+q.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
43
|
+
${Z}`)+"'";return $.implicitKey?X:X1.foldFlowLines(X,Z,X1.FOLD_FLOW,h0($,!1))}function b1(q,$){let{singleQuote:Z}=$.options,X;if(Z===!1)X=n1;else{let J=q.includes('"'),Q=q.includes("'");if(J&&!Q)X=Q9;else if(Q&&!J)X=n1;else X=Z?Q9:n1}return X(q,$)}var U9;try{U9=new RegExp(`(^|(?<!
|
|
44
44
|
))
|
|
45
45
|
+(?!
|
|
46
|
-
|$)`,"g")}catch{
|
|
46
|
+
|$)`,"g")}catch{U9=/\n+(?!\n|$)/g}function v0({comment:q,type:$,value:Z},X,J,Q){let{blockQuote:U,commentString:H,lineWidth:z}=X.options;if(!U||/\n[\t ]+$/.test(Z))return b1(Z,X);let G=X.indent||(X.forceBlockIndent||u0(Z)?" ":""),B=U==="literal"?!0:U==="folded"||$===l.Scalar.BLOCK_FOLDED?!1:$===l.Scalar.BLOCK_LITERAL?!0:!C8(Z,z,G.length);if(!Z)return B?`|
|
|
47
47
|
`:`>
|
|
48
|
-
`;let Y,
|
|
49
|
-
`&&N!=="\t"&&N!==" ")break}let
|
|
50
|
-
`);if(
|
|
51
|
-
`)
|
|
52
|
-
`)
|
|
53
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${G}`),S=!1,
|
|
54
|
-
${G}${
|
|
55
|
-
${G}${
|
|
56
|
-
`)||
|
|
57
|
-
`)?b1(Q
|
|
58
|
-
`))return v0(q
|
|
59
|
-
${
|
|
60
|
-
${
|
|
61
|
-
${
|
|
62
|
-
`:"",
|
|
63
|
-
${
|
|
64
|
-
`&&
|
|
48
|
+
`;let Y,L;for(L=Z.length;L>0;--L){let N=Z[L-1];if(N!==`
|
|
49
|
+
`&&N!=="\t"&&N!==" ")break}let R=Z.substring(L),W=R.indexOf(`
|
|
50
|
+
`);if(W===-1)Y="-";else if(Z===R||W!==R.length-1){if(Y="+",Q)Q()}else Y="";if(R){if(Z=Z.slice(0,-R.length),R[R.length-1]===`
|
|
51
|
+
`)R=R.slice(0,-1);R=R.replace(U9,`$&${G}`)}let T=!1,_,V=-1;for(_=0;_<Z.length;++_){let N=Z[_];if(N===" ")T=!0;else if(N===`
|
|
52
|
+
`)V=_;else break}let D=Z.substring(0,V<_?V+1:_);if(D)Z=Z.substring(D.length),D=D.replace(/\n+/g,`$&${G}`);let O=(T?G?"2":"1":"")+Y;if(q){if(O+=" "+H(q.replace(/ ?[\r\n]+/g," ")),J)J()}if(!B){let N=Z.replace(/\n+/g,`
|
|
53
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${G}`),S=!1,M=h0(X,!0);if(U!=="folded"&&$!==l.Scalar.BLOCK_FOLDED)M.onOverflow=()=>{S=!0};let I=X1.foldFlowLines(`${D}${N}${R}`,G,X1.FOLD_BLOCK,M);if(!S)return`>${O}
|
|
54
|
+
${G}${I}`}return Z=Z.replace(/\n+/g,`$&${G}`),`|${O}
|
|
55
|
+
${G}${D}${Z}${R}`}function E8(q,$,Z,X){let{type:J,value:Q}=q,{actualString:U,implicitKey:H,indent:z,indentStep:G,inFlow:B}=$;if(H&&Q.includes(`
|
|
56
|
+
`)||B&&/[[\]{},]/.test(Q))return b1(Q,$);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(Q))return H||B||!Q.includes(`
|
|
57
|
+
`)?b1(Q,$):v0(q,$,Z,X);if(!H&&!B&&J!==l.Scalar.PLAIN&&Q.includes(`
|
|
58
|
+
`))return v0(q,$,Z,X);if(u0(Q)){if(z==="")return $.forceBlockIndent=!0,v0(q,$,Z,X);else if(H&&z===G)return b1(Q,$)}let Y=Q.replace(/\n+/g,`$&
|
|
59
|
+
${z}`);if(U){let L=(T)=>T.default&&T.tag!=="tag:yaml.org,2002:str"&&T.test?.test(Y),{compat:R,tags:W}=$.doc.schema;if(W.some(L)||R?.some(L))return b1(Q,$)}return H?Y:X1.foldFlowLines(Y,z,X1.FOLD_FLOW,h0($,!1))}function f8(q,$,Z,X){let{implicitKey:J,inFlow:Q}=$,U=typeof q.value==="string"?q:Object.assign({},q,{value:String(q.value)}),{type:H}=q;if(H!==l.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(U.value))H=l.Scalar.QUOTE_DOUBLE}let z=(B)=>{switch(B){case l.Scalar.BLOCK_FOLDED:case l.Scalar.BLOCK_LITERAL:return J||Q?b1(U.value,$):v0(U,$,Z,X);case l.Scalar.QUOTE_DOUBLE:return n1(U.value,$);case l.Scalar.QUOTE_SINGLE:return Q9(U.value,$);case l.Scalar.PLAIN:return E8(U,$,Z,X);default:return null}},G=z(H);if(G===null){let{defaultKeyType:B,defaultStringType:Y}=$.options,L=J&&B||Y;if(G=z(L),G===null)throw Error(`Unsupported default string type ${L}`)}return G}y8.stringifyString=f8});var o1=K((d8)=>{var k8=y0(),J1=A(),g8=i1(),v8=r1();function h8(q,$){let Z=Object.assign({blockQuote:!0,commentString:g8.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},q.schema.toStringOptions,$),X;switch(Z.collectionStyle){case"block":X=!1;break;case"flow":X=!0;break;default:X=null}return{anchors:new Set,doc:q,flowCollectionPadding:Z.flowCollectionPadding?" ":"",indent:"",indentStep:typeof Z.indent==="number"?" ".repeat(Z.indent):" ",inFlow:X,options:Z}}function u8(q,$){if($.tag){let J=q.filter((Q)=>Q.tag===$.tag);if(J.length>0)return J.find((Q)=>Q.format===$.format)??J[0]}let Z=void 0,X;if(J1.isScalar($)){X=$.value;let J=q.filter((Q)=>Q.identify?.(X));if(J.length>1){let Q=J.filter((U)=>U.test);if(Q.length>0)J=Q}Z=J.find((Q)=>Q.format===$.format)??J.find((Q)=>!Q.format)}else X=$,Z=q.find((J)=>J.nodeClass&&X instanceof J.nodeClass);if(!Z){let J=X?.constructor?.name??(X===null?"null":typeof X);throw Error(`Tag not resolved for ${J} value`)}return Z}function m8(q,$,{anchors:Z,doc:X}){if(!X.directives)return"";let J=[],Q=(J1.isScalar(q)||J1.isCollection(q))&&q.anchor;if(Q&&k8.anchorIsValid(Q))Z.add(Q),J.push(`&${Q}`);let U=q.tag??($.default?null:$.tag);if(U)J.push(X.directives.tagString(U));return J.join(" ")}function l8(q,$,Z,X){if(J1.isPair(q))return q.toString($,Z,X);if(J1.isAlias(q)){if($.doc.directives)return q.toString($);if($.resolvedAliases?.has(q))throw TypeError("Cannot stringify circular structure without alias nodes");else{if($.resolvedAliases)$.resolvedAliases.add(q);else $.resolvedAliases=new Set([q]);q=q.resolve($.doc)}}let J=void 0,Q=J1.isNode(q)?q:$.doc.createNode(q,{onTagObj:(z)=>J=z});J??(J=u8($.doc.schema.tags,Q));let U=m8(Q,J,$);if(U.length>0)$.indentAtStart=($.indentAtStart??0)+U.length+1;let H=typeof J.stringify==="function"?J.stringify(Q,$,Z,X):J1.isScalar(Q)?v8.stringifyString(Q,$,Z,X):Q.toString($,Z,X);if(!U)return H;return J1.isScalar(Q)||H[0]==="{"||H[0]==="["?`${U} ${H}`:`${U}
|
|
60
|
+
${$.indent}${H}`}d8.createStringifyContext=h8;d8.stringify=l8});var u2=K((a8)=>{var q1=A(),v2=E(),h2=o1(),t1=i1();function s8({key:q,value:$},Z,X,J){let{allNullValues:Q,doc:U,indent:H,indentStep:z,options:{commentString:G,indentSeq:B,simpleKeys:Y}}=Z,L=q1.isNode(q)&&q.comment||null;if(Y){if(L)throw Error("With simple keys, key nodes cannot have comments");if(q1.isCollection(q)||!q1.isNode(q)&&typeof q==="object")throw Error("With simple keys, collection cannot be used as a key value")}let R=!Y&&(!q||L&&$==null&&!Z.inFlow||q1.isCollection(q)||(q1.isScalar(q)?q.type===v2.Scalar.BLOCK_FOLDED||q.type===v2.Scalar.BLOCK_LITERAL:typeof q==="object"));Z=Object.assign({},Z,{allNullValues:!1,implicitKey:!R&&(Y||!Q),indent:H+z});let W=!1,T=!1,_=h2.stringify(q,Z,()=>W=!0,()=>T=!0);if(!R&&!Z.inFlow&&_.length>1024){if(Y)throw Error("With simple keys, single line scalar must not span more than 1024 characters");R=!0}if(Z.inFlow){if(Q||$==null){if(W&&X)X();return _===""?"?":R?`? ${_}`:_}}else if(Q&&!Y||$==null&&R){if(_=`? ${_}`,L&&!W)_+=t1.lineComment(_,Z.indent,G(L));else if(T&&J)J();return _}if(W)L=null;if(R){if(L)_+=t1.lineComment(_,Z.indent,G(L));_=`? ${_}
|
|
61
|
+
${H}:`}else if(_=`${_}:`,L)_+=t1.lineComment(_,Z.indent,G(L));let V,D,P;if(q1.isNode($))V=!!$.spaceBefore,D=$.commentBefore,P=$.comment;else if(V=!1,D=null,P=null,$&&typeof $==="object")$=U.createNode($);if(Z.implicitKey=!1,!R&&!L&&q1.isScalar($))Z.indentAtStart=_.length+1;if(T=!1,!B&&z.length>=2&&!Z.inFlow&&!R&&q1.isSeq($)&&!$.flow&&!$.tag&&!$.anchor)Z.indent=Z.indent.substring(2);let O=!1,N=h2.stringify($,Z,()=>O=!0,()=>T=!0),S=" ";if(L||V||D){if(S=V?`
|
|
62
|
+
`:"",D){let M=G(D);S+=`
|
|
63
|
+
${t1.indentComment(M,Z.indent)}`}if(N===""&&!Z.inFlow){if(S===`
|
|
64
|
+
`&&P)S=`
|
|
65
65
|
|
|
66
66
|
`}else S+=`
|
|
67
|
-
${
|
|
68
|
-
`),w=
|
|
69
|
-
${
|
|
70
|
-
`)S="";if(
|
|
71
|
-
${
|
|
72
|
-
`}}if(q){if(
|
|
73
|
-
`+
|
|
74
|
-
`)))G=!0;Y.push(
|
|
75
|
-
${Q}${
|
|
76
|
-
`;return`${
|
|
77
|
-
${
|
|
78
|
-
`:" ")}return
|
|
79
|
-
${
|
|
80
|
-
${Q.comment}`:J.comment}J=$}q.items[X]=e0.isPair(J)?J:new I9.Pair(J)}else Z("Expected a sequence for this tag");return q}function J3(q,Z,X){let{replacer:J}=X,$=new OJ.YAMLSeq(q);$.tag="tag:yaml.org,2002:pairs";let Q=0;if(Z&&Symbol.iterator in Object(Z))for(let H of Z){if(typeof J==="function")H=J.call(Z,String(Q++),H);let z,U;if(Array.isArray(H))if(H.length===2)z=H[0],U=H[1];else throw TypeError(`Expected [key, value] tuple: ${H}`);else if(H&&H instanceof Object){let G=Object.keys(H);if(G.length===1)z=G[0],U=H[z];else throw TypeError(`Expected tuple with one key, not ${G.length} keys`)}else z=H;$.items.push(I9.createPair(z,U,X))}return $}var NJ={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:X3,createNode:J3};SJ.createPairs=J3;SJ.pairs=NJ;SJ.resolvePairs=X3});var K9=P((CJ)=>{var $3=A(),M9=Z1(),X0=H1(),jJ=z1(),Q3=qq();class M1 extends jJ.YAMLSeq{constructor(){super();this.add=X0.YAMLMap.prototype.add.bind(this),this.delete=X0.YAMLMap.prototype.delete.bind(this),this.get=X0.YAMLMap.prototype.get.bind(this),this.has=X0.YAMLMap.prototype.has.bind(this),this.set=X0.YAMLMap.prototype.set.bind(this),this.tag=M1.tag}toJSON(q,Z){if(!Z)return super.toJSON(q);let X=new Map;if(Z?.onCreate)Z.onCreate(X);for(let J of this.items){let $,Q;if($3.isPair(J))$=M9.toJS(J.key,"",Z),Q=M9.toJS(J.value,$,Z);else $=M9.toJS(J,"",Z);if(X.has($))throw Error("Ordered maps must not include duplicate keys");X.set($,Q)}return X}static from(q,Z,X){let J=Q3.createPairs(q,Z,X),$=new this;return $.items=J.items,$}}M1.tag="tag:yaml.org,2002:omap";var EJ={collection:"seq",identify:(q)=>q instanceof Map,nodeClass:M1,default:!1,tag:"tag:yaml.org,2002:omap",resolve(q,Z){let X=Q3.resolvePairs(q,Z),J=[];for(let{key:$}of X.items)if($3.isScalar($))if(J.includes($.value))Z(`Ordered maps must not include duplicate keys: ${$.value}`);else J.push($.value);return Object.assign(new M1,X)},createNode:(q,Z,X)=>M1.from(q,Z,X)};CJ.YAMLOMap=M1;CJ.omap=EJ});var Y3=P((xJ)=>{var H3=C();function z3({value:q,source:Z},X){if(Z&&(q?U3:G3).test.test(Z))return Z;return q?X.options.trueStr:X.options.falseStr}var U3={identify:(q)=>q===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new H3.Scalar(!0),stringify:z3},G3={identify:(q)=>q===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new H3.Scalar(!1),stringify:z3};xJ.falseTag=G3;xJ.trueTag=U3});var B3=P((dJ)=>{var hJ=C(),D9=C1(),gJ={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:D9.stringifyNumber},uJ={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q.replace(/_/g,"")),stringify(q){let Z=Number(q.value);return isFinite(Z)?Z.toExponential():D9.stringifyNumber(q)}},mJ={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(q){let Z=new hJ.Scalar(parseFloat(q.replace(/_/g,""))),X=q.indexOf(".");if(X!==-1){let J=q.substring(X+1).replace(/_/g,"");if(J[J.length-1]==="0")Z.minFractionDigits=J.length}return Z},stringify:D9.stringifyNumber};dJ.float=mJ;dJ.floatExp=uJ;dJ.floatNaN=gJ});var _3=P((nJ)=>{var T3=C1(),J0=(q)=>typeof q==="bigint"||Number.isInteger(q);function Zq(q,Z,X,{intAsBigInt:J}){let $=q[0];if($==="-"||$==="+")Z+=1;if(q=q.substring(Z).replace(/_/g,""),J){switch(X){case 2:q=`0b${q}`;break;case 8:q=`0o${q}`;break;case 16:q=`0x${q}`;break}let H=BigInt(q);return $==="-"?BigInt(-1)*H:H}let Q=parseInt(q,X);return $==="-"?-1*Q:Q}function P9(q,Z,X){let{value:J}=q;if(J0(J)){let $=J.toString(Z);return J<0?"-"+X+$.substr(1):X+$}return T3.stringifyNumber(q)}var iJ={identify:J0,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(q,Z,X)=>Zq(q,2,2,X),stringify:(q)=>P9(q,2,"0b")},aJ={identify:J0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(q,Z,X)=>Zq(q,1,8,X),stringify:(q)=>P9(q,8,"0")},sJ={identify:J0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(q,Z,X)=>Zq(q,0,10,X),stringify:T3.stringifyNumber},rJ={identify:J0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(q,Z,X)=>Zq(q,2,16,X),stringify:(q)=>P9(q,16,"0x")};nJ.int=sJ;nJ.intBin=iJ;nJ.intHex=rJ;nJ.intOct=aJ});var F9=P((X$)=>{var $q=A(),Xq=$1(),Jq=H1();class K1 extends Jq.YAMLMap{constructor(q){super(q);this.tag=K1.tag}add(q){let Z;if($q.isPair(q))Z=q;else if(q&&typeof q==="object"&&"key"in q&&"value"in q&&q.value===null)Z=new Xq.Pair(q.key,null);else Z=new Xq.Pair(q,null);if(!Jq.findPair(this.items,Z.key))this.items.push(Z)}get(q,Z){let X=Jq.findPair(this.items,q);return!Z&&$q.isPair(X)?$q.isScalar(X.key)?X.key.value:X.key:X}set(q,Z){if(typeof Z!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof Z}`);let X=Jq.findPair(this.items,q);if(X&&!Z)this.items.splice(this.items.indexOf(X),1);else if(!X&&Z)this.items.push(new Xq.Pair(q))}toJSON(q,Z){return super.toJSON(q,Z,Set)}toString(q,Z,X){if(!q)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},q,{allNullValues:!0}),Z,X);else throw Error("Set items must all have null values")}static from(q,Z,X){let{replacer:J}=X,$=new this(q);if(Z&&Symbol.iterator in Object(Z))for(let Q of Z){if(typeof J==="function")Q=J.call(Z,Q,Q);$.items.push(Xq.createPair(Q,null,X))}return $}}K1.tag="tag:yaml.org,2002:set";var Z$={collection:"map",identify:(q)=>q instanceof Set,nodeClass:K1,default:!1,tag:"tag:yaml.org,2002:set",createNode:(q,Z,X)=>K1.from(q,Z,X),resolve(q,Z){if($q.isMap(q))if(q.hasAllNullValues(!0))return Object.assign(new K1,q);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return q}};X$.YAMLSet=K1;X$.set=Z$});var N9=P((U$)=>{var Q$=C1();function O9(q,Z){let X=q[0],J=X==="-"||X==="+"?q.substring(1):q,$=(H)=>Z?BigInt(H):Number(H),Q=J.replace(/_/g,"").split(":").reduce((H,z)=>H*$(60)+$(z),$(0));return X==="-"?$(-1)*Q:Q}function W3(q){let{value:Z}=q,X=(H)=>H;if(typeof Z==="bigint")X=(H)=>BigInt(H);else if(isNaN(Z)||!isFinite(Z))return Q$.stringifyNumber(q);let J="";if(Z<0)J="-",Z*=X(-1);let $=X(60),Q=[Z%$];if(Z<60)Q.unshift(0);else if(Z=(Z-Q[0])/$,Q.unshift(Z%$),Z>=60)Z=(Z-Q[0])/$,Q.unshift(Z);return J+Q.map((H)=>String(H).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var H$={identify:(q)=>typeof q==="bigint"||Number.isInteger(q),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(q,Z,{intAsBigInt:X})=>O9(q,X),stringify:W3},z$={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(q)=>O9(q,!1),stringify:W3},L3={identify:(q)=>q 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(q){let Z=q.match(L3.test);if(!Z)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,X,J,$,Q,H,z]=Z.map(Number),U=Z[7]?Number((Z[7]+"00").substr(1,3)):0,G=Date.UTC(X,J-1,$,Q||0,H||0,z||0,U),T=Z[8];if(T&&T!=="Z"){let Y=O9(T,!1);if(Math.abs(Y)<30)Y*=60;G-=60000*Y}return new Date(G)},stringify:({value:q})=>q?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};U$.floatTime=z$;U$.intTime=H$;U$.timestamp=L3});var R3=P((P$)=>{var T$=j1(),_$=n0(),W$=E1(),L$=q0(),V$=R9(),V3=Y3(),S9=B3(),Qq=_3(),R$=d0(),I$=K9(),M$=qq(),K$=F9(),A9=N9(),D$=[T$.map,W$.seq,L$.string,_$.nullTag,V3.trueTag,V3.falseTag,Qq.intBin,Qq.intOct,Qq.int,Qq.intHex,S9.floatNaN,S9.floatExp,S9.float,V$.binary,R$.merge,I$.omap,M$.pairs,K$.set,A9.intTime,A9.floatTime,A9.timestamp];P$.schema=D$});var A3=P((E$)=>{var D3=j1(),O$=n0(),P3=E1(),N$=q0(),S$=G9(),w9=B9(),b9=_9(),A$=e2(),w$=Z3(),F3=R9(),$0=d0(),O3=K9(),N3=qq(),I3=R3(),S3=F9(),Hq=N9(),M3=new Map([["core",A$.schema],["failsafe",[D3.map,P3.seq,N$.string]],["json",w$.schema],["yaml11",I3.schema],["yaml-1.1",I3.schema]]),K3={binary:F3.binary,bool:S$.boolTag,float:w9.float,floatExp:w9.floatExp,floatNaN:w9.floatNaN,floatTime:Hq.floatTime,int:b9.int,intHex:b9.intHex,intOct:b9.intOct,intTime:Hq.intTime,map:D3.map,merge:$0.merge,null:O$.nullTag,omap:O3.omap,pairs:N3.pairs,seq:P3.seq,set:S3.set,timestamp:Hq.timestamp},b$={"tag:yaml.org,2002:binary":F3.binary,"tag:yaml.org,2002:merge":$0.merge,"tag:yaml.org,2002:omap":O3.omap,"tag:yaml.org,2002:pairs":N3.pairs,"tag:yaml.org,2002:set":S3.set,"tag:yaml.org,2002:timestamp":Hq.timestamp};function j$(q,Z,X){let J=M3.get(Z);if(J&&!q)return X&&!J.includes($0.merge)?J.concat($0.merge):J.slice();let $=J;if(!$)if(Array.isArray(q))$=[];else{let Q=Array.from(M3.keys()).filter((H)=>H!=="yaml11").map((H)=>JSON.stringify(H)).join(", ");throw Error(`Unknown schema "${Z}"; use one of ${Q} or define customTags array`)}if(Array.isArray(q))for(let Q of q)$=$.concat(Q);else if(typeof q==="function")$=q($.slice());if(X)$=$.concat($0.merge);return $.reduce((Q,H)=>{let z=typeof H==="string"?K3[H]:H;if(!z){let U=JSON.stringify(H),G=Object.keys(K3).map((T)=>JSON.stringify(T)).join(", ");throw Error(`Unknown custom tag ${U}; use one of ${G}`)}if(!Q.includes(z))Q.push(z);return Q},[])}E$.coreKnownTags=b$;E$.getTags=j$});var C9=P((h$)=>{var j9=A(),y$=j1(),x$=E1(),k$=q0(),zq=A3(),v$=(q,Z)=>q.key<Z.key?-1:q.key>Z.key?1:0;class E9{constructor({compat:q,customTags:Z,merge:X,resolveKnownTags:J,schema:$,sortMapEntries:Q,toStringDefaults:H}){this.compat=Array.isArray(q)?zq.getTags(q,"compat"):q?zq.getTags(null,q):null,this.name=typeof $==="string"&&$||"core",this.knownTags=J?zq.coreKnownTags:{},this.tags=zq.getTags(Z,this.name,X),this.toStringOptions=H??null,Object.defineProperty(this,j9.MAP,{value:y$.map}),Object.defineProperty(this,j9.SCALAR,{value:k$.string}),Object.defineProperty(this,j9.SEQ,{value:x$.seq}),this.sortMapEntries=typeof Q==="function"?Q:Q===!0?v$:null}clone(){let q=Object.create(E9.prototype,Object.getOwnPropertyDescriptors(this));return q.tags=this.tags.slice(),q}}h$.Schema=E9});var w3=P((d$)=>{var u$=A(),f9=n1(),Q0=a1();function m$(q,Z){let X=[],J=Z.directives===!0;if(Z.directives!==!1&&q.directives){let U=q.directives.toString(q);if(U)X.push(U),J=!0;else if(q.directives.docStart)J=!0}if(J)X.push("---");let $=f9.createStringifyContext(q,Z),{commentString:Q}=$.options;if(q.commentBefore){if(X.length!==1)X.unshift("");let U=Q(q.commentBefore);X.unshift(Q0.indentComment(U,""))}let H=!1,z=null;if(q.contents){if(u$.isNode(q.contents)){if(q.contents.spaceBefore&&J)X.push("");if(q.contents.commentBefore){let T=Q(q.contents.commentBefore);X.push(Q0.indentComment(T,""))}$.forceBlockIndent=!!q.comment,z=q.contents.comment}let U=z?void 0:()=>H=!0,G=f9.stringify(q.contents,$,()=>z=null,U);if(z)G+=Q0.lineComment(G,"",Q(z));if((G[0]==="|"||G[0]===">")&&X[X.length-1]==="---")X[X.length-1]=`--- ${G}`;else X.push(G)}else X.push(f9.stringify(q.contents,$));if(q.directives?.docEnd)if(q.comment){let U=Q(q.comment);if(U.includes(`
|
|
81
|
-
`))
|
|
67
|
+
${Z.indent}`}else if(!R&&q1.isCollection($)){let M=N[0],I=N.indexOf(`
|
|
68
|
+
`),w=I!==-1,y=Z.inFlow??$.flow??$.items.length===0;if(w||!y){let x=!1;if(w&&(M==="&"||M==="!")){let C=N.indexOf(" ");if(M==="&"&&C!==-1&&C<I&&N[C+1]==="!")C=N.indexOf(" ",C+1);if(C===-1||I<C)x=!0}if(!x)S=`
|
|
69
|
+
${Z.indent}`}}else if(N===""||N[0]===`
|
|
70
|
+
`)S="";if(_+=S+N,Z.inFlow){if(O&&X)X()}else if(P&&!O)_+=t1.lineComment(_,Z.indent,G(P));else if(T&&J)J();return _}a8.stringifyPair=s8});var H9=K((o8)=>{var m2=n("process");function n8(q,...$){if(q==="debug")console.log(...$)}function r8(q,$){if(q==="debug"||q==="warn")if(typeof m2.emitWarning==="function")m2.emitWarning($);else console.warn($)}o8.debug=n8;o8.warn=r8});var d0=K(($Z)=>{var e1=A(),l2=E(),m0="<<",l0={identify:(q)=>q===m0||typeof q==="symbol"&&q.description===m0,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new l2.Scalar(Symbol(m0)),{addToJSMap:d2}),stringify:()=>m0},qZ=(q,$)=>(l0.identify($)||e1.isScalar($)&&(!$.type||$.type===l2.Scalar.PLAIN)&&l0.identify($.value))&&q?.doc.schema.tags.some((Z)=>Z.tag===l0.tag&&Z.default);function d2(q,$,Z){if(Z=q&&e1.isAlias(Z)?Z.resolve(q.doc):Z,e1.isSeq(Z))for(let X of Z.items)z9(q,$,X);else if(Array.isArray(Z))for(let X of Z)z9(q,$,X);else z9(q,$,Z)}function z9(q,$,Z){let X=q&&e1.isAlias(Z)?Z.resolve(q.doc):Z;if(!e1.isMap(X))throw Error("Merge sources must be maps or map aliases");let J=X.toJSON(null,q,Map);for(let[Q,U]of J)if($ instanceof Map){if(!$.has(Q))$.set(Q,U)}else if($ instanceof Set)$.add(Q);else if(!Object.prototype.hasOwnProperty.call($,Q))Object.defineProperty($,Q,{value:U,writable:!0,enumerable:!0,configurable:!0});return $}$Z.addMergeToJSMap=d2;$Z.isMergeKey=qZ;$Z.merge=l0});var Y9=K((GZ)=>{var QZ=H9(),p2=d0(),UZ=o1(),c2=A(),G9=Z1();function HZ(q,$,{key:Z,value:X}){if(c2.isNode(Z)&&Z.addToJSMap)Z.addToJSMap(q,$,X);else if(p2.isMergeKey(q,Z))p2.addMergeToJSMap(q,$,X);else{let J=G9.toJS(Z,"",q);if($ instanceof Map)$.set(J,G9.toJS(X,J,q));else if($ instanceof Set)$.add(J);else{let Q=zZ(Z,J,q),U=G9.toJS(X,Q,q);if(Q in $)Object.defineProperty($,Q,{value:U,writable:!0,enumerable:!0,configurable:!0});else $[Q]=U}}return $}function zZ(q,$,Z){if($===null)return"";if(typeof $!=="object")return String($);if(c2.isNode(q)&&Z?.doc){let X=UZ.createStringifyContext(Z.doc,{});X.anchors=new Set;for(let Q of Z.anchors.keys())X.anchors.add(Q.anchor);X.inFlow=!0,X.inStringifyKey=!0;let J=q.toString(X);if(!Z.mapKeyWarned){let Q=JSON.stringify(J);if(Q.length>40)Q=Q.substring(0,36)+'..."';QZ.warn(Z.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${Q}. Set mapAsMap: true to use object keys.`),Z.mapKeyWarned=!0}return J}return JSON.stringify($)}GZ.addPairToJSMap=HZ});var Q1=K((_Z)=>{var s2=a1(),BZ=u2(),TZ=Y9(),p0=A();function LZ(q,$,Z){let X=s2.createNode(q,void 0,Z),J=s2.createNode($,void 0,Z);return new c0(X,J)}class c0{constructor(q,$=null){Object.defineProperty(this,p0.NODE_TYPE,{value:p0.PAIR}),this.key=q,this.value=$}clone(q){let{key:$,value:Z}=this;if(p0.isNode($))$=$.clone(q);if(p0.isNode(Z))Z=Z.clone(q);return new c0($,Z)}toJSON(q,$){let Z=$?.mapAsMap?new Map:{};return TZ.addPairToJSMap($,Z,this)}toString(q,$,Z){return q?.doc?BZ.stringifyPair(this,q,$,Z):JSON.stringify(this)}}_Z.Pair=c0;_Z.createPair=LZ});var B9=K((MZ)=>{var V1=A(),a2=o1(),s0=i1();function IZ(q,$,Z){return($.inFlow??q.flow?DZ:VZ)(q,$,Z)}function VZ({comment:q,items:$},Z,{blockItemPrefix:X,flowChars:J,itemIndent:Q,onChompKeep:U,onComment:H}){let{indent:z,options:{commentString:G}}=Z,B=Object.assign({},Z,{indent:Q,type:null}),Y=!1,L=[];for(let W=0;W<$.length;++W){let T=$[W],_=null;if(V1.isNode(T)){if(!Y&&T.spaceBefore)L.push("");if(a0(Z,L,T.commentBefore,Y),T.comment)_=T.comment}else if(V1.isPair(T)){let D=V1.isNode(T.key)?T.key:null;if(D){if(!Y&&D.spaceBefore)L.push("");a0(Z,L,D.commentBefore,Y)}}Y=!1;let V=a2.stringify(T,B,()=>_=null,()=>Y=!0);if(_)V+=s0.lineComment(V,Q,G(_));if(Y&&_)Y=!1;L.push(X+V)}let R;if(L.length===0)R=J.start+J.end;else{R=L[0];for(let W=1;W<L.length;++W){let T=L[W];R+=T?`
|
|
71
|
+
${z}${T}`:`
|
|
72
|
+
`}}if(q){if(R+=`
|
|
73
|
+
`+s0.indentComment(G(q),z),H)H()}else if(Y&&U)U();return R}function DZ({items:q},$,{flowChars:Z,itemIndent:X}){let{indent:J,indentStep:Q,flowCollectionPadding:U,options:{commentString:H}}=$;X+=Q;let z=Object.assign({},$,{indent:X,inFlow:!0,type:null}),G=!1,B=0,Y=[];for(let W=0;W<q.length;++W){let T=q[W],_=null;if(V1.isNode(T)){if(T.spaceBefore)Y.push("");if(a0($,Y,T.commentBefore,!1),T.comment)_=T.comment}else if(V1.isPair(T)){let D=V1.isNode(T.key)?T.key:null;if(D){if(D.spaceBefore)Y.push("");if(a0($,Y,D.commentBefore,!1),D.comment)G=!0}let P=V1.isNode(T.value)?T.value:null;if(P){if(P.comment)_=P.comment;if(P.commentBefore)G=!0}else if(T.value==null&&D?.comment)_=D.comment}if(_)G=!0;let V=a2.stringify(T,z,()=>_=null);if(W<q.length-1)V+=",";if(_)V+=s0.lineComment(V,X,H(_));if(!G&&(Y.length>B||V.includes(`
|
|
74
|
+
`)))G=!0;Y.push(V),B=Y.length}let{start:L,end:R}=Z;if(Y.length===0)return L+R;else{if(!G){let W=Y.reduce((T,_)=>T+_.length+2,2);G=$.options.lineWidth>0&&W>$.options.lineWidth}if(G){let W=L;for(let T of Y)W+=T?`
|
|
75
|
+
${Q}${J}${T}`:`
|
|
76
|
+
`;return`${W}
|
|
77
|
+
${J}${R}`}else return`${L}${U}${Y.join(" ")}${U}${R}`}}function a0({indent:q,options:{commentString:$}},Z,X,J){if(X&&J)X=X.replace(/^\n+/,"");if(X){let Q=s0.indentComment($(X),q);Z.push(Q.trimStart())}}MZ.stringifyCollection=IZ});var H1=K((SZ)=>{var KZ=B9(),FZ=Y9(),OZ=g0(),U1=A(),i0=Q1(),NZ=E();function q0(q,$){let Z=U1.isScalar($)?$.value:$;for(let X of q)if(U1.isPair(X)){if(X.key===$||X.key===Z)return X;if(U1.isScalar(X.key)&&X.key.value===Z)return X}return}class i2 extends OZ.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(q){super(U1.MAP,q);this.items=[]}static from(q,$,Z){let{keepUndefined:X,replacer:J}=Z,Q=new this(q),U=(H,z)=>{if(typeof J==="function")z=J.call($,H,z);else if(Array.isArray(J)&&!J.includes(H))return;if(z!==void 0||X)Q.items.push(i0.createPair(H,z,Z))};if($ instanceof Map)for(let[H,z]of $)U(H,z);else if($&&typeof $==="object")for(let H of Object.keys($))U(H,$[H]);if(typeof q.sortMapEntries==="function")Q.items.sort(q.sortMapEntries);return Q}add(q,$){let Z;if(U1.isPair(q))Z=q;else if(!q||typeof q!=="object"||!("key"in q))Z=new i0.Pair(q,q?.value);else Z=new i0.Pair(q.key,q.value);let X=q0(this.items,Z.key),J=this.schema?.sortMapEntries;if(X){if(!$)throw Error(`Key ${Z.key} already set`);if(U1.isScalar(X.value)&&NZ.isScalarValue(Z.value))X.value.value=Z.value;else X.value=Z.value}else if(J){let Q=this.items.findIndex((U)=>J(Z,U)<0);if(Q===-1)this.items.push(Z);else this.items.splice(Q,0,Z)}else this.items.push(Z)}delete(q){let $=q0(this.items,q);if(!$)return!1;return this.items.splice(this.items.indexOf($),1).length>0}get(q,$){let X=q0(this.items,q)?.value;return(!$&&U1.isScalar(X)?X.value:X)??void 0}has(q){return!!q0(this.items,q)}set(q,$){this.add(new i0.Pair(q,$),!0)}toJSON(q,$,Z){let X=Z?new Z:$?.mapAsMap?new Map:{};if($?.onCreate)$.onCreate(X);for(let J of this.items)FZ.addPairToJSMap($,X,J);return X}toString(q,$,Z){if(!q)return JSON.stringify(this);for(let X of this.items)if(!U1.isPair(X))throw Error(`Map items must all be pairs; found ${JSON.stringify(X)} instead`);if(!q.allNullValues&&this.hasAllNullValues(!1))q=Object.assign({},q,{allNullValues:!0});return KZ.stringifyCollection(this,q,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:q.indent||"",onChompKeep:Z,onComment:$})}}SZ.YAMLMap=i2;SZ.findPair=q0});var j1=K((CZ)=>{var bZ=A(),n2=H1(),jZ={collection:"map",default:!0,nodeClass:n2.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(q,$){if(!bZ.isMap(q))$("Expected a mapping for this tag");return q},createNode:(q,$,Z)=>n2.YAMLMap.from(q,$,Z)};CZ.map=jZ});var z1=K((vZ)=>{var fZ=a1(),yZ=B9(),xZ=g0(),r0=A(),kZ=E(),gZ=Z1();class r2 extends xZ.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(q){super(r0.SEQ,q);this.items=[]}add(q){this.items.push(q)}delete(q){let $=n0(q);if(typeof $!=="number")return!1;return this.items.splice($,1).length>0}get(q,$){let Z=n0(q);if(typeof Z!=="number")return;let X=this.items[Z];return!$&&r0.isScalar(X)?X.value:X}has(q){let $=n0(q);return typeof $==="number"&&$<this.items.length}set(q,$){let Z=n0(q);if(typeof Z!=="number")throw Error(`Expected a valid index, not ${q}.`);let X=this.items[Z];if(r0.isScalar(X)&&kZ.isScalarValue($))X.value=$;else this.items[Z]=$}toJSON(q,$){let Z=[];if($?.onCreate)$.onCreate(Z);let X=0;for(let J of this.items)Z.push(gZ.toJS(J,String(X++),$));return Z}toString(q,$,Z){if(!q)return JSON.stringify(this);return yZ.stringifyCollection(this,q,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(q.indent||"")+" ",onChompKeep:Z,onComment:$})}static from(q,$,Z){let{replacer:X}=Z,J=new this(q);if($&&Symbol.iterator in Object($)){let Q=0;for(let U of $){if(typeof X==="function"){let H=$ instanceof Set?U:String(Q++);U=X.call($,H,U)}J.items.push(fZ.createNode(U,void 0,Z))}}return J}}function n0(q){let $=r0.isScalar(q)?q.value:q;if($&&typeof $==="string")$=Number($);return typeof $==="number"&&Number.isInteger($)&&$>=0?$:null}vZ.YAMLSeq=r2});var C1=K((lZ)=>{var uZ=A(),o2=z1(),mZ={collection:"seq",default:!0,nodeClass:o2.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(q,$){if(!uZ.isSeq(q))$("Expected a sequence for this tag");return q},createNode:(q,$,Z)=>o2.YAMLSeq.from(q,$,Z)};lZ.seq=mZ});var $0=K((sZ)=>{var pZ=r1(),cZ={identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify(q,$,Z,X){return $=Object.assign({actualString:!0},$),pZ.stringifyString(q,$,Z,X)}};sZ.string=cZ});var o0=K((iZ)=>{var t2=E(),e2={identify:(q)=>q==null,createNode:()=>new t2.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new t2.Scalar(null),stringify:({source:q},$)=>typeof q==="string"&&e2.test.test(q)?q:$.options.nullStr};iZ.nullTag=e2});var T9=K((oZ)=>{var rZ=E(),q3={identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(q)=>new rZ.Scalar(q[0]==="t"||q[0]==="T"),stringify({source:q,value:$},Z){if(q&&q3.test.test(q)){let X=q[0]==="t"||q[0]==="T";if($===X)return q}return $?Z.options.trueStr:Z.options.falseStr}};oZ.boolTag=q3});var E1=K((qX)=>{function eZ({format:q,minFractionDigits:$,tag:Z,value:X}){if(typeof X==="bigint")return String(X);let J=typeof X==="number"?X:Number(X);if(!isFinite(J))return isNaN(J)?".nan":J<0?"-.inf":".inf";let Q=Object.is(X,-0)?"-0":JSON.stringify(X);if(!q&&$&&(!Z||Z==="tag:yaml.org,2002:float")&&/^\d/.test(Q)){let U=Q.indexOf(".");if(U<0)U=Q.length,Q+=".";let H=$-(Q.length-U-1);while(H-- >0)Q+="0"}return Q}qX.stringifyNumber=eZ});var _9=K((UX)=>{var ZX=E(),L9=E1(),XX={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:L9.stringifyNumber},JX={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q),stringify(q){let $=Number(q.value);return isFinite($)?$.toExponential():L9.stringifyNumber(q)}},QX={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(q){let $=new ZX.Scalar(parseFloat(q)),Z=q.indexOf(".");if(Z!==-1&&q[q.length-1]==="0")$.minFractionDigits=q.length-Z-1;return $},stringify:L9.stringifyNumber};UX.float=QX;UX.floatExp=JX;UX.floatNaN=XX});var R9=K((LX)=>{var $3=E1(),t0=(q)=>typeof q==="bigint"||Number.isInteger(q),W9=(q,$,Z,{intAsBigInt:X})=>X?BigInt(q):parseInt(q.substring($),Z);function Z3(q,$,Z){let{value:X}=q;if(t0(X)&&X>=0)return Z+X.toString($);return $3.stringifyNumber(q)}var YX={identify:(q)=>t0(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(q,$,Z)=>W9(q,2,8,Z),stringify:(q)=>Z3(q,8,"0o")},BX={identify:t0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(q,$,Z)=>W9(q,0,10,Z),stringify:$3.stringifyNumber},TX={identify:(q)=>t0(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(q,$,Z)=>W9(q,2,16,Z),stringify:(q)=>Z3(q,16,"0x")};LX.int=BX;LX.intHex=TX;LX.intOct=YX});var X3=K((FX)=>{var IX=j1(),VX=o0(),DX=C1(),MX=$0(),PX=T9(),I9=_9(),V9=R9(),KX=[IX.map,DX.seq,MX.string,VX.nullTag,PX.boolTag,V9.intOct,V9.int,V9.intHex,I9.floatNaN,I9.floatExp,I9.float];FX.schema=KX});var Q3=K((CX)=>{var NX=E(),SX=j1(),AX=C1();function J3(q){return typeof q==="bigint"||Number.isInteger(q)}var e0=({value:q})=>JSON.stringify(q),wX=[{identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify:e0},{identify:(q)=>q==null,createNode:()=>new NX.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:e0},{identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(q)=>q==="true",stringify:e0},{identify:J3,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(q,$,{intAsBigInt:Z})=>Z?BigInt(q):parseInt(q,10),stringify:({value:q})=>J3(q)?q.toString():JSON.stringify(q)},{identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(q)=>parseFloat(q),stringify:e0}],bX={default:!0,tag:"",test:/^/,resolve(q,$){return $(`Unresolved plain scalar ${JSON.stringify(q)}`),q}},jX=[SX.map,AX.seq].concat(wX,bX);CX.schema=jX});var M9=K((xX)=>{var Z0=n("buffer"),D9=E(),fX=r1(),yX={identify:(q)=>q instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(q,$){if(typeof Z0.Buffer==="function")return Z0.Buffer.from(q,"base64");else if(typeof atob==="function"){let Z=atob(q.replace(/[\n\r]/g,"")),X=new Uint8Array(Z.length);for(let J=0;J<Z.length;++J)X[J]=Z.charCodeAt(J);return X}else return $("This environment does not support reading binary tags; either Buffer or atob is required"),q},stringify({comment:q,type:$,value:Z},X,J,Q){if(!Z)return"";let U=Z,H;if(typeof Z0.Buffer==="function")H=U instanceof Z0.Buffer?U.toString("base64"):Z0.Buffer.from(U.buffer).toString("base64");else if(typeof btoa==="function"){let z="";for(let G=0;G<U.length;++G)z+=String.fromCharCode(U[G]);H=btoa(z)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if($??($=D9.Scalar.BLOCK_LITERAL),$!==D9.Scalar.QUOTE_DOUBLE){let z=Math.max(X.options.lineWidth-X.indent.length,X.options.minContentWidth),G=Math.ceil(H.length/z),B=Array(G);for(let Y=0,L=0;Y<G;++Y,L+=z)B[Y]=H.substr(L,z);H=B.join($===D9.Scalar.BLOCK_LITERAL?`
|
|
78
|
+
`:" ")}return fX.stringifyString({comment:q,type:$,value:H},X,J,Q)}};xX.binary=yX});var $q=K((uX)=>{var qq=A(),P9=Q1(),gX=E(),vX=z1();function U3(q,$){if(qq.isSeq(q))for(let Z=0;Z<q.items.length;++Z){let X=q.items[Z];if(qq.isPair(X))continue;else if(qq.isMap(X)){if(X.items.length>1)$("Each pair must have its own sequence indicator");let J=X.items[0]||new P9.Pair(new gX.Scalar(null));if(X.commentBefore)J.key.commentBefore=J.key.commentBefore?`${X.commentBefore}
|
|
79
|
+
${J.key.commentBefore}`:X.commentBefore;if(X.comment){let Q=J.value??J.key;Q.comment=Q.comment?`${X.comment}
|
|
80
|
+
${Q.comment}`:X.comment}X=J}q.items[Z]=qq.isPair(X)?X:new P9.Pair(X)}else $("Expected a sequence for this tag");return q}function H3(q,$,Z){let{replacer:X}=Z,J=new vX.YAMLSeq(q);J.tag="tag:yaml.org,2002:pairs";let Q=0;if($&&Symbol.iterator in Object($))for(let U of $){if(typeof X==="function")U=X.call($,String(Q++),U);let H,z;if(Array.isArray(U))if(U.length===2)H=U[0],z=U[1];else throw TypeError(`Expected [key, value] tuple: ${U}`);else if(U&&U instanceof Object){let G=Object.keys(U);if(G.length===1)H=G[0],z=U[H];else throw TypeError(`Expected tuple with one key, not ${G.length} keys`)}else H=U;J.items.push(P9.createPair(H,z,Z))}return J}var hX={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:U3,createNode:H3};uX.createPairs=H3;uX.pairs=hX;uX.resolvePairs=U3});var F9=K((sX)=>{var z3=A(),K9=Z1(),X0=H1(),pX=z1(),G3=$q();class D1 extends pX.YAMLSeq{constructor(){super();this.add=X0.YAMLMap.prototype.add.bind(this),this.delete=X0.YAMLMap.prototype.delete.bind(this),this.get=X0.YAMLMap.prototype.get.bind(this),this.has=X0.YAMLMap.prototype.has.bind(this),this.set=X0.YAMLMap.prototype.set.bind(this),this.tag=D1.tag}toJSON(q,$){if(!$)return super.toJSON(q);let Z=new Map;if($?.onCreate)$.onCreate(Z);for(let X of this.items){let J,Q;if(z3.isPair(X))J=K9.toJS(X.key,"",$),Q=K9.toJS(X.value,J,$);else J=K9.toJS(X,"",$);if(Z.has(J))throw Error("Ordered maps must not include duplicate keys");Z.set(J,Q)}return Z}static from(q,$,Z){let X=G3.createPairs(q,$,Z),J=new this;return J.items=X.items,J}}D1.tag="tag:yaml.org,2002:omap";var cX={collection:"seq",identify:(q)=>q instanceof Map,nodeClass:D1,default:!1,tag:"tag:yaml.org,2002:omap",resolve(q,$){let Z=G3.resolvePairs(q,$),X=[];for(let{key:J}of Z.items)if(z3.isScalar(J))if(X.includes(J.value))$(`Ordered maps must not include duplicate keys: ${J.value}`);else X.push(J.value);return Object.assign(new D1,Z)},createNode:(q,$,Z)=>D1.from(q,$,Z)};sX.YAMLOMap=D1;sX.omap=cX});var _3=K((nX)=>{var Y3=E();function B3({value:q,source:$},Z){if($&&(q?T3:L3).test.test($))return $;return q?Z.options.trueStr:Z.options.falseStr}var T3={identify:(q)=>q===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Y3.Scalar(!0),stringify:B3},L3={identify:(q)=>q===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Y3.Scalar(!1),stringify:B3};nX.falseTag=L3;nX.trueTag=T3});var W3=K((ZJ)=>{var tX=E(),O9=E1(),eX={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:O9.stringifyNumber},qJ={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q.replace(/_/g,"")),stringify(q){let $=Number(q.value);return isFinite($)?$.toExponential():O9.stringifyNumber(q)}},$J={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(q){let $=new tX.Scalar(parseFloat(q.replace(/_/g,""))),Z=q.indexOf(".");if(Z!==-1){let X=q.substring(Z+1).replace(/_/g,"");if(X[X.length-1]==="0")$.minFractionDigits=X.length}return $},stringify:O9.stringifyNumber};ZJ.float=$J;ZJ.floatExp=qJ;ZJ.floatNaN=eX});var I3=K((YJ)=>{var R3=E1(),J0=(q)=>typeof q==="bigint"||Number.isInteger(q);function Zq(q,$,Z,{intAsBigInt:X}){let J=q[0];if(J==="-"||J==="+")$+=1;if(q=q.substring($).replace(/_/g,""),X){switch(Z){case 2:q=`0b${q}`;break;case 8:q=`0o${q}`;break;case 16:q=`0x${q}`;break}let U=BigInt(q);return J==="-"?BigInt(-1)*U:U}let Q=parseInt(q,Z);return J==="-"?-1*Q:Q}function N9(q,$,Z){let{value:X}=q;if(J0(X)){let J=X.toString($);return X<0?"-"+Z+J.substr(1):Z+J}return R3.stringifyNumber(q)}var UJ={identify:J0,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(q,$,Z)=>Zq(q,2,2,Z),stringify:(q)=>N9(q,2,"0b")},HJ={identify:J0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(q,$,Z)=>Zq(q,1,8,Z),stringify:(q)=>N9(q,8,"0")},zJ={identify:J0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(q,$,Z)=>Zq(q,0,10,Z),stringify:R3.stringifyNumber},GJ={identify:J0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(q,$,Z)=>Zq(q,2,16,Z),stringify:(q)=>N9(q,16,"0x")};YJ.int=zJ;YJ.intBin=UJ;YJ.intHex=GJ;YJ.intOct=HJ});var S9=K((RJ)=>{var Qq=A(),Xq=Q1(),Jq=H1();class M1 extends Jq.YAMLMap{constructor(q){super(q);this.tag=M1.tag}add(q){let $;if(Qq.isPair(q))$=q;else if(q&&typeof q==="object"&&"key"in q&&"value"in q&&q.value===null)$=new Xq.Pair(q.key,null);else $=new Xq.Pair(q,null);if(!Jq.findPair(this.items,$.key))this.items.push($)}get(q,$){let Z=Jq.findPair(this.items,q);return!$&&Qq.isPair(Z)?Qq.isScalar(Z.key)?Z.key.value:Z.key:Z}set(q,$){if(typeof $!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof $}`);let Z=Jq.findPair(this.items,q);if(Z&&!$)this.items.splice(this.items.indexOf(Z),1);else if(!Z&&$)this.items.push(new Xq.Pair(q))}toJSON(q,$){return super.toJSON(q,$,Set)}toString(q,$,Z){if(!q)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},q,{allNullValues:!0}),$,Z);else throw Error("Set items must all have null values")}static from(q,$,Z){let{replacer:X}=Z,J=new this(q);if($&&Symbol.iterator in Object($))for(let Q of $){if(typeof X==="function")Q=X.call($,Q,Q);J.items.push(Xq.createPair(Q,null,Z))}return J}}M1.tag="tag:yaml.org,2002:set";var WJ={collection:"map",identify:(q)=>q instanceof Set,nodeClass:M1,default:!1,tag:"tag:yaml.org,2002:set",createNode:(q,$,Z)=>M1.from(q,$,Z),resolve(q,$){if(Qq.isMap(q))if(q.hasAllNullValues(!0))return Object.assign(new M1,q);else $("Set items must all have null values");else $("Expected a mapping for this tag");return q}};RJ.YAMLSet=M1;RJ.set=WJ});var w9=K((KJ)=>{var DJ=E1();function A9(q,$){let Z=q[0],X=Z==="-"||Z==="+"?q.substring(1):q,J=(U)=>$?BigInt(U):Number(U),Q=X.replace(/_/g,"").split(":").reduce((U,H)=>U*J(60)+J(H),J(0));return Z==="-"?J(-1)*Q:Q}function V3(q){let{value:$}=q,Z=(U)=>U;if(typeof $==="bigint")Z=(U)=>BigInt(U);else if(isNaN($)||!isFinite($))return DJ.stringifyNumber(q);let X="";if($<0)X="-",$*=Z(-1);let J=Z(60),Q=[$%J];if($<60)Q.unshift(0);else if($=($-Q[0])/J,Q.unshift($%J),$>=60)$=($-Q[0])/J,Q.unshift($);return X+Q.map((U)=>String(U).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var MJ={identify:(q)=>typeof q==="bigint"||Number.isInteger(q),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(q,$,{intAsBigInt:Z})=>A9(q,Z),stringify:V3},PJ={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(q)=>A9(q,!1),stringify:V3},D3={identify:(q)=>q 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(q){let $=q.match(D3.test);if(!$)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,Z,X,J,Q,U,H]=$.map(Number),z=$[7]?Number(($[7]+"00").substr(1,3)):0,G=Date.UTC(Z,X-1,J,Q||0,U||0,H||0,z),B=$[8];if(B&&B!=="Z"){let Y=A9(B,!1);if(Math.abs(Y)<30)Y*=60;G-=60000*Y}return new Date(G)},stringify:({value:q})=>q?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};KJ.floatTime=PJ;KJ.intTime=MJ;KJ.timestamp=D3});var P3=K((kJ)=>{var SJ=j1(),AJ=o0(),wJ=C1(),bJ=$0(),jJ=M9(),M3=_3(),b9=W3(),Uq=I3(),CJ=d0(),EJ=F9(),fJ=$q(),yJ=S9(),j9=w9(),xJ=[SJ.map,wJ.seq,bJ.string,AJ.nullTag,M3.trueTag,M3.falseTag,Uq.intBin,Uq.intOct,Uq.int,Uq.intHex,b9.floatNaN,b9.floatExp,b9.float,jJ.binary,CJ.merge,EJ.omap,fJ.pairs,yJ.set,j9.intTime,j9.floatTime,j9.timestamp];kJ.schema=xJ});var C3=K((cJ)=>{var N3=j1(),vJ=o0(),S3=C1(),hJ=$0(),uJ=T9(),C9=_9(),E9=R9(),mJ=X3(),lJ=Q3(),A3=M9(),Q0=d0(),w3=F9(),b3=$q(),K3=P3(),j3=S9(),Hq=w9(),F3=new Map([["core",mJ.schema],["failsafe",[N3.map,S3.seq,hJ.string]],["json",lJ.schema],["yaml11",K3.schema],["yaml-1.1",K3.schema]]),O3={binary:A3.binary,bool:uJ.boolTag,float:C9.float,floatExp:C9.floatExp,floatNaN:C9.floatNaN,floatTime:Hq.floatTime,int:E9.int,intHex:E9.intHex,intOct:E9.intOct,intTime:Hq.intTime,map:N3.map,merge:Q0.merge,null:vJ.nullTag,omap:w3.omap,pairs:b3.pairs,seq:S3.seq,set:j3.set,timestamp:Hq.timestamp},dJ={"tag:yaml.org,2002:binary":A3.binary,"tag:yaml.org,2002:merge":Q0.merge,"tag:yaml.org,2002:omap":w3.omap,"tag:yaml.org,2002:pairs":b3.pairs,"tag:yaml.org,2002:set":j3.set,"tag:yaml.org,2002:timestamp":Hq.timestamp};function pJ(q,$,Z){let X=F3.get($);if(X&&!q)return Z&&!X.includes(Q0.merge)?X.concat(Q0.merge):X.slice();let J=X;if(!J)if(Array.isArray(q))J=[];else{let Q=Array.from(F3.keys()).filter((U)=>U!=="yaml11").map((U)=>JSON.stringify(U)).join(", ");throw Error(`Unknown schema "${$}"; use one of ${Q} or define customTags array`)}if(Array.isArray(q))for(let Q of q)J=J.concat(Q);else if(typeof q==="function")J=q(J.slice());if(Z)J=J.concat(Q0.merge);return J.reduce((Q,U)=>{let H=typeof U==="string"?O3[U]:U;if(!H){let z=JSON.stringify(U),G=Object.keys(O3).map((B)=>JSON.stringify(B)).join(", ");throw Error(`Unknown custom tag ${z}; use one of ${G}`)}if(!Q.includes(H))Q.push(H);return Q},[])}cJ.coreKnownTags=dJ;cJ.getTags=pJ});var x9=K((tJ)=>{var f9=A(),iJ=j1(),nJ=C1(),rJ=$0(),zq=C3(),oJ=(q,$)=>q.key<$.key?-1:q.key>$.key?1:0;class y9{constructor({compat:q,customTags:$,merge:Z,resolveKnownTags:X,schema:J,sortMapEntries:Q,toStringDefaults:U}){this.compat=Array.isArray(q)?zq.getTags(q,"compat"):q?zq.getTags(null,q):null,this.name=typeof J==="string"&&J||"core",this.knownTags=X?zq.coreKnownTags:{},this.tags=zq.getTags($,this.name,Z),this.toStringOptions=U??null,Object.defineProperty(this,f9.MAP,{value:iJ.map}),Object.defineProperty(this,f9.SCALAR,{value:rJ.string}),Object.defineProperty(this,f9.SEQ,{value:nJ.seq}),this.sortMapEntries=typeof Q==="function"?Q:Q===!0?oJ:null}clone(){let q=Object.create(y9.prototype,Object.getOwnPropertyDescriptors(this));return q.tags=this.tags.slice(),q}}tJ.Schema=y9});var E3=K((ZQ)=>{var qQ=A(),k9=o1(),U0=i1();function $Q(q,$){let Z=[],X=$.directives===!0;if($.directives!==!1&&q.directives){let z=q.directives.toString(q);if(z)Z.push(z),X=!0;else if(q.directives.docStart)X=!0}if(X)Z.push("---");let J=k9.createStringifyContext(q,$),{commentString:Q}=J.options;if(q.commentBefore){if(Z.length!==1)Z.unshift("");let z=Q(q.commentBefore);Z.unshift(U0.indentComment(z,""))}let U=!1,H=null;if(q.contents){if(qQ.isNode(q.contents)){if(q.contents.spaceBefore&&X)Z.push("");if(q.contents.commentBefore){let B=Q(q.contents.commentBefore);Z.push(U0.indentComment(B,""))}J.forceBlockIndent=!!q.comment,H=q.contents.comment}let z=H?void 0:()=>U=!0,G=k9.stringify(q.contents,J,()=>H=null,z);if(H)G+=U0.lineComment(G,"",Q(H));if((G[0]==="|"||G[0]===">")&&Z[Z.length-1]==="---")Z[Z.length-1]=`--- ${G}`;else Z.push(G)}else Z.push(k9.stringify(q.contents,J));if(q.directives?.docEnd)if(q.comment){let z=Q(q.comment);if(z.includes(`
|
|
81
|
+
`))Z.push("..."),Z.push(U0.indentComment(z,""));else Z.push(`... ${z}`)}else Z.push("...");else{let z=q.comment;if(z&&U)z=z.replace(/^\n+/,"");if(z){if((!U||H)&&Z[Z.length-1]!=="")Z.push("");Z.push(U0.indentComment(Q(z),""))}}return Z.join(`
|
|
82
82
|
`)+`
|
|
83
|
-
`}
|
|
84
|
-
`;H
|
|
83
|
+
`}ZQ.stringifyDocument=$Q});var H0=K((BQ)=>{var JQ=s1(),f1=g0(),u=A(),QQ=Q1(),UQ=Z1(),HQ=x9(),zQ=E3(),g9=y0(),GQ=Z9(),YQ=a1(),v9=$9();class h9{constructor(q,$,Z){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,u.NODE_TYPE,{value:u.DOC});let X=null;if(typeof $==="function"||Array.isArray($))X=$;else if(Z===void 0&&$)Z=$,$=void 0;let J=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},Z);this.options=J;let{version:Q}=J;if(Z?._directives){if(this.directives=Z._directives.atDocument(),this.directives.yaml.explicit)Q=this.directives.yaml.version}else this.directives=new v9.Directives({version:Q});this.setSchema(Q,Z),this.contents=q===void 0?null:this.createNode(q,X,Z)}clone(){let q=Object.create(h9.prototype,{[u.NODE_TYPE]:{value:u.DOC}});if(q.commentBefore=this.commentBefore,q.comment=this.comment,q.errors=this.errors.slice(),q.warnings=this.warnings.slice(),q.options=Object.assign({},this.options),this.directives)q.directives=this.directives.clone();if(q.schema=this.schema.clone(),q.contents=u.isNode(this.contents)?this.contents.clone(q.schema):this.contents,this.range)q.range=this.range.slice();return q}add(q){if(y1(this.contents))this.contents.add(q)}addIn(q,$){if(y1(this.contents))this.contents.addIn(q,$)}createAlias(q,$){if(!q.anchor){let Z=g9.anchorNames(this);q.anchor=!$||Z.has($)?g9.findNewAnchor($||"a",Z):$}return new JQ.Alias(q.anchor)}createNode(q,$,Z){let X=void 0;if(typeof $==="function")q=$.call({"":q},"",q),X=$;else if(Array.isArray($)){let T=(V)=>typeof V==="number"||V instanceof String||V instanceof Number,_=$.filter(T).map(String);if(_.length>0)$=$.concat(_);X=$}else if(Z===void 0&&$)Z=$,$=void 0;let{aliasDuplicateObjects:J,anchorPrefix:Q,flow:U,keepUndefined:H,onTagObj:z,tag:G}=Z??{},{onAnchor:B,setAnchors:Y,sourceObjects:L}=g9.createNodeAnchors(this,Q||"a"),R={aliasDuplicateObjects:J??!0,keepUndefined:H??!1,onAnchor:B,onTagObj:z,replacer:X,schema:this.schema,sourceObjects:L},W=YQ.createNode(q,G,R);if(U&&u.isCollection(W))W.flow=!0;return Y(),W}createPair(q,$,Z={}){let X=this.createNode(q,null,Z),J=this.createNode($,null,Z);return new QQ.Pair(X,J)}delete(q){return y1(this.contents)?this.contents.delete(q):!1}deleteIn(q){if(f1.isEmptyPath(q)){if(this.contents==null)return!1;return this.contents=null,!0}return y1(this.contents)?this.contents.deleteIn(q):!1}get(q,$){return u.isCollection(this.contents)?this.contents.get(q,$):void 0}getIn(q,$){if(f1.isEmptyPath(q))return!$&&u.isScalar(this.contents)?this.contents.value:this.contents;return u.isCollection(this.contents)?this.contents.getIn(q,$):void 0}has(q){return u.isCollection(this.contents)?this.contents.has(q):!1}hasIn(q){if(f1.isEmptyPath(q))return this.contents!==void 0;return u.isCollection(this.contents)?this.contents.hasIn(q):!1}set(q,$){if(this.contents==null)this.contents=f1.collectionFromPath(this.schema,[q],$);else if(y1(this.contents))this.contents.set(q,$)}setIn(q,$){if(f1.isEmptyPath(q))this.contents=$;else if(this.contents==null)this.contents=f1.collectionFromPath(this.schema,Array.from(q),$);else if(y1(this.contents))this.contents.setIn(q,$)}setSchema(q,$={}){if(typeof q==="number")q=String(q);let Z;switch(q){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new v9.Directives({version:"1.1"});Z={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=q;else this.directives=new v9.Directives({version:q});Z={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;Z=null;break;default:{let X=JSON.stringify(q);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${X}`)}}if($.schema instanceof Object)this.schema=$.schema;else if(Z)this.schema=new HQ.Schema(Object.assign(Z,$));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:q,jsonArg:$,mapAsMap:Z,maxAliasCount:X,onAnchor:J,reviver:Q}={}){let U={anchors:new Map,doc:this,keep:!q,mapAsMap:Z===!0,mapKeyWarned:!1,maxAliasCount:typeof X==="number"?X:100},H=UQ.toJS(this.contents,$??"",U);if(typeof J==="function")for(let{count:z,res:G}of U.anchors.values())J(G,z);return typeof Q==="function"?GQ.applyReviver(Q,{"":H},"",H):H}toJSON(q,$){return this.toJS({json:!0,jsonArg:q,mapAsMap:!1,onAnchor:$})}toString(q={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in q&&(!Number.isInteger(q.indent)||Number(q.indent)<=0)){let $=JSON.stringify(q.indent);throw Error(`"indent" option must be a positive integer, not ${$}`)}return zQ.stringifyDocument(this,q)}}function y1(q){if(u.isCollection(q))return!0;throw Error("Expected a YAML collection as document contents")}BQ.Document=h9});var z0=K((_Q)=>{class Gq extends Error{constructor(q,$,Z,X){super();this.name=q,this.code=Z,this.message=X,this.pos=$}}class f3 extends Gq{constructor(q,$,Z){super("YAMLParseError",q,$,Z)}}class y3 extends Gq{constructor(q,$,Z){super("YAMLWarning",q,$,Z)}}var LQ=(q,$)=>(Z)=>{if(Z.pos[0]===-1)return;Z.linePos=Z.pos.map((H)=>$.linePos(H));let{line:X,col:J}=Z.linePos[0];Z.message+=` at line ${X}, column ${J}`;let Q=J-1,U=q.substring($.lineStarts[X-1],$.lineStarts[X]).replace(/[\n\r]+$/,"");if(Q>=60&&U.length>80){let H=Math.min(Q-39,U.length-79);U="…"+U.substring(H),Q-=H-1}if(U.length>80)U=U.substring(0,79)+"…";if(X>1&&/^ *$/.test(U.substring(0,Q))){let H=q.substring($.lineStarts[X-2],$.lineStarts[X-1]);if(H.length>80)H=H.substring(0,79)+`…
|
|
84
|
+
`;U=H+U}if(/[^ ]/.test(U)){let H=1,z=Z.linePos[1];if(z?.line===X&&z.col>J)H=Math.max(1,Math.min(z.col-J,80-Q));let G=" ".repeat(Q)+"^".repeat(H);Z.message+=`:
|
|
85
85
|
|
|
86
|
-
${
|
|
86
|
+
${U}
|
|
87
87
|
${G}
|
|
88
|
-
`}};
|
|
89
|
-
`))return!0;if(q.end){for(let
|
|
90
|
-
`+
|
|
91
|
-
`+
|
|
92
|
-
`+S.comment;else G.comment=S.comment;Y=S.end;continue}if(!
|
|
93
|
-
`+
|
|
94
|
-
`+w.comment;else
|
|
95
|
-
`+
|
|
96
|
-
`.repeat(Math.max(1,
|
|
97
|
-
`;for(let B
|
|
98
|
-
`;else if(
|
|
99
|
-
`;else if(!
|
|
100
|
-
`)
|
|
88
|
+
`}};_Q.YAMLError=Gq;_Q.YAMLParseError=f3;_Q.YAMLWarning=y3;_Q.prettifyError=LQ});var G0=K((MQ)=>{function DQ(q,{flow:$,indicator:Z,next:X,offset:J,onError:Q,parentIndent:U,startOnNewline:H}){let z=!1,G=H,B=H,Y="",L="",R=!1,W=!1,T=null,_=null,V=null,D=null,P=null,O=null,N=null;for(let I of q){if(W){if(I.type!=="space"&&I.type!=="newline"&&I.type!=="comma")Q(I.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");W=!1}if(T){if(G&&I.type!=="comment"&&I.type!=="newline")Q(T,"TAB_AS_INDENT","Tabs are not allowed as indentation");T=null}switch(I.type){case"space":if(!$&&(Z!=="doc-start"||X?.type!=="flow-collection")&&I.source.includes("\t"))T=I;B=!0;break;case"comment":{if(!B)Q(I,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let w=I.source.substring(1)||" ";if(!Y)Y=w;else Y+=L+w;L="",G=!1;break}case"newline":if(G){if(Y)Y+=I.source;else if(!O||Z!=="seq-item-ind")z=!0}else L+=I.source;if(G=!0,R=!0,_||V)D=I;B=!0;break;case"anchor":if(_)Q(I,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(I.source.endsWith(":"))Q(I.offset+I.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);_=I,N??(N=I.offset),G=!1,B=!1,W=!0;break;case"tag":{if(V)Q(I,"MULTIPLE_TAGS","A node can have at most one tag");V=I,N??(N=I.offset),G=!1,B=!1,W=!0;break}case Z:if(_||V)Q(I,"BAD_PROP_ORDER",`Anchors and tags must be after the ${I.source} indicator`);if(O)Q(I,"UNEXPECTED_TOKEN",`Unexpected ${I.source} in ${$??"collection"}`);O=I,G=Z==="seq-item-ind"||Z==="explicit-key-ind",B=!1;break;case"comma":if($){if(P)Q(I,"UNEXPECTED_TOKEN",`Unexpected , in ${$}`);P=I,G=!1,B=!1;break}default:Q(I,"UNEXPECTED_TOKEN",`Unexpected ${I.type} token`),G=!1,B=!1}}let S=q[q.length-1],M=S?S.offset+S.source.length:J;if(W&&X&&X.type!=="space"&&X.type!=="newline"&&X.type!=="comma"&&(X.type!=="scalar"||X.source!==""))Q(X.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(T&&(G&&T.indent<=U||X?.type==="block-map"||X?.type==="block-seq"))Q(T,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:P,found:O,spaceBefore:z,comment:Y,hasNewline:R,anchor:_,tag:V,newlineAfterProp:D,end:M,start:N??M}}MQ.resolveProps=DQ});var Yq=K((KQ)=>{function u9(q){if(!q)return null;switch(q.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(q.source.includes(`
|
|
89
|
+
`))return!0;if(q.end){for(let $ of q.end)if($.type==="newline")return!0}return!1;case"flow-collection":for(let $ of q.items){for(let Z of $.start)if(Z.type==="newline")return!0;if($.sep){for(let Z of $.sep)if(Z.type==="newline")return!0}if(u9($.key)||u9($.value))return!0}return!1;default:return!0}}KQ.containsNewline=u9});var m9=K((SQ)=>{var OQ=Yq();function NQ(q,$,Z){if($?.type==="flow-collection"){let X=$.end[0];if(X.indent===q&&(X.source==="]"||X.source==="}")&&OQ.containsNewline($))Z(X,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}SQ.flowIndentCheck=NQ});var l9=K((bQ)=>{var x3=A();function wQ(q,$,Z){let{uniqueKeys:X}=q.options;if(X===!1)return!1;let J=typeof X==="function"?X:(Q,U)=>Q===U||x3.isScalar(Q)&&x3.isScalar(U)&&Q.value===U.value;return $.some((Q)=>J(Q.key,Z))}bQ.mapIncludes=wQ});var u3=K((xQ)=>{var k3=Q1(),CQ=H1(),g3=G0(),EQ=Yq(),v3=m9(),fQ=l9(),h3="All mapping items must start at the same column";function yQ({composeNode:q,composeEmptyNode:$},Z,X,J,Q){let H=new(Q?.nodeClass??CQ.YAMLMap)(Z.schema);if(Z.atRoot)Z.atRoot=!1;let z=X.offset,G=null;for(let B of X.items){let{start:Y,key:L,sep:R,value:W}=B,T=g3.resolveProps(Y,{indicator:"explicit-key-ind",next:L??R?.[0],offset:z,onError:J,parentIndent:X.indent,startOnNewline:!0}),_=!T.found;if(_){if(L){if(L.type==="block-seq")J(z,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in L&&L.indent!==X.indent)J(z,"BAD_INDENT",h3)}if(!T.anchor&&!T.tag&&!R){if(G=T.end,T.comment)if(H.comment)H.comment+=`
|
|
90
|
+
`+T.comment;else H.comment=T.comment;continue}if(T.newlineAfterProp||EQ.containsNewline(L))J(L??Y[Y.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(T.found?.indent!==X.indent)J(z,"BAD_INDENT",h3);Z.atKey=!0;let V=T.end,D=L?q(Z,L,T,J):$(Z,V,Y,null,T,J);if(Z.schema.compat)v3.flowIndentCheck(X.indent,L,J);if(Z.atKey=!1,fQ.mapIncludes(Z,H.items,D))J(V,"DUPLICATE_KEY","Map keys must be unique");let P=g3.resolveProps(R??[],{indicator:"map-value-ind",next:W,offset:D.range[2],onError:J,parentIndent:X.indent,startOnNewline:!L||L.type==="block-scalar"});if(z=P.end,P.found){if(_){if(W?.type==="block-map"&&!P.hasNewline)J(z,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(Z.options.strict&&T.start<P.found.offset-1024)J(D.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let O=W?q(Z,W,P,J):$(Z,z,R,null,P,J);if(Z.schema.compat)v3.flowIndentCheck(X.indent,W,J);z=O.range[2];let N=new k3.Pair(D,O);if(Z.options.keepSourceTokens)N.srcToken=B;H.items.push(N)}else{if(_)J(D.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(P.comment)if(D.comment)D.comment+=`
|
|
91
|
+
`+P.comment;else D.comment=P.comment;let O=new k3.Pair(D);if(Z.options.keepSourceTokens)O.srcToken=B;H.items.push(O)}}if(G&&G<z)J(G,"IMPOSSIBLE","Map comment with trailing content");return H.range=[X.offset,z,G??z],H}xQ.resolveBlockMap=yQ});var m3=K((mQ)=>{var gQ=z1(),vQ=G0(),hQ=m9();function uQ({composeNode:q,composeEmptyNode:$},Z,X,J,Q){let H=new(Q?.nodeClass??gQ.YAMLSeq)(Z.schema);if(Z.atRoot)Z.atRoot=!1;if(Z.atKey)Z.atKey=!1;let z=X.offset,G=null;for(let{start:B,value:Y}of X.items){let L=vQ.resolveProps(B,{indicator:"seq-item-ind",next:Y,offset:z,onError:J,parentIndent:X.indent,startOnNewline:!0});if(!L.found)if(L.anchor||L.tag||Y)if(Y?.type==="block-seq")J(L.end,"BAD_INDENT","All sequence items must start at the same column");else J(z,"MISSING_CHAR","Sequence item without - indicator");else{if(G=L.end,L.comment)H.comment=L.comment;continue}let R=Y?q(Z,Y,L,J):$(Z,L.end,B,null,L,J);if(Z.schema.compat)hQ.flowIndentCheck(X.indent,Y,J);z=R.range[2],H.items.push(R)}return H.range=[X.offset,z,G??z],H}mQ.resolveBlockSeq=uQ});var x1=K((pQ)=>{function dQ(q,$,Z,X){let J="";if(q){let Q=!1,U="";for(let H of q){let{source:z,type:G}=H;switch(G){case"space":Q=!0;break;case"comment":{if(Z&&!Q)X(H,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let B=z.substring(1)||" ";if(!J)J=B;else J+=U+B;U="";break}case"newline":if(J)U+=z;Q=!0;break;default:X(H,"UNEXPECTED_TOKEN",`Unexpected ${G} at node end`)}$+=z.length}}return{comment:J,offset:$}}pQ.resolveEnd=dQ});var p3=K((eQ)=>{var sQ=A(),aQ=Q1(),l3=H1(),iQ=z1(),nQ=x1(),d3=G0(),rQ=Yq(),oQ=l9(),d9="Block collections are not allowed within flow collections",p9=(q)=>q&&(q.type==="block-map"||q.type==="block-seq");function tQ({composeNode:q,composeEmptyNode:$},Z,X,J,Q){let U=X.start.source==="{",H=U?"flow map":"flow sequence",G=new(Q?.nodeClass??(U?l3.YAMLMap:iQ.YAMLSeq))(Z.schema);G.flow=!0;let B=Z.atRoot;if(B)Z.atRoot=!1;if(Z.atKey)Z.atKey=!1;let Y=X.offset+X.start.source.length;for(let _=0;_<X.items.length;++_){let V=X.items[_],{start:D,key:P,sep:O,value:N}=V,S=d3.resolveProps(D,{flow:H,indicator:"explicit-key-ind",next:P??O?.[0],offset:Y,onError:J,parentIndent:X.indent,startOnNewline:!1});if(!S.found){if(!S.anchor&&!S.tag&&!O&&!N){if(_===0&&S.comma)J(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${H}`);else if(_<X.items.length-1)J(S.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${H}`);if(S.comment)if(G.comment)G.comment+=`
|
|
92
|
+
`+S.comment;else G.comment=S.comment;Y=S.end;continue}if(!U&&Z.options.strict&&rQ.containsNewline(P))J(P,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(_===0){if(S.comma)J(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${H}`)}else{if(!S.comma)J(S.start,"MISSING_CHAR",`Missing , between ${H} items`);if(S.comment){let M="";q:for(let I of D)switch(I.type){case"comma":case"space":break;case"comment":M=I.source.substring(1);break q;default:break q}if(M){let I=G.items[G.items.length-1];if(sQ.isPair(I))I=I.value??I.key;if(I.comment)I.comment+=`
|
|
93
|
+
`+M;else I.comment=M;S.comment=S.comment.substring(M.length+1)}}}if(!U&&!O&&!S.found){let M=N?q(Z,N,S,J):$(Z,S.end,O,null,S,J);if(G.items.push(M),Y=M.range[2],p9(N))J(M.range,"BLOCK_IN_FLOW",d9)}else{Z.atKey=!0;let M=S.end,I=P?q(Z,P,S,J):$(Z,M,D,null,S,J);if(p9(P))J(I.range,"BLOCK_IN_FLOW",d9);Z.atKey=!1;let w=d3.resolveProps(O??[],{flow:H,indicator:"map-value-ind",next:N,offset:I.range[2],onError:J,parentIndent:X.indent,startOnNewline:!1});if(w.found){if(!U&&!S.found&&Z.options.strict){if(O)for(let C of O){if(C===w.found)break;if(C.type==="newline"){J(C,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(S.start<w.found.offset-1024)J(w.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(N)if("source"in N&&N.source?.[0]===":")J(N,"MISSING_CHAR",`Missing space after : in ${H}`);else J(w.start,"MISSING_CHAR",`Missing , or : between ${H} items`);let y=N?q(Z,N,w,J):w.found?$(Z,w.end,O,null,w,J):null;if(y){if(p9(N))J(y.range,"BLOCK_IN_FLOW",d9)}else if(w.comment)if(I.comment)I.comment+=`
|
|
94
|
+
`+w.comment;else I.comment=w.comment;let x=new aQ.Pair(I,y);if(Z.options.keepSourceTokens)x.srcToken=V;if(U){let C=G;if(oQ.mapIncludes(Z,C.items,I))J(M,"DUPLICATE_KEY","Map keys must be unique");C.items.push(x)}else{let C=new l3.YAMLMap(Z.schema);C.flow=!0,C.items.push(x);let O0=(y??I).range;C.range=[I.range[0],O0[1],O0[2]],G.items.push(C)}Y=y?y.range[2]:w.end}}let L=U?"}":"]",[R,...W]=X.end,T=Y;if(R?.source===L)T=R.offset+R.source.length;else{let _=H[0].toUpperCase()+H.substring(1),V=B?`${_} must end with a ${L}`:`${_} in block collection must be sufficiently indented and end with a ${L}`;if(J(Y,B?"MISSING_CHAR":"BAD_INDENT",V),R&&R.source.length!==1)W.unshift(R)}if(W.length>0){let _=nQ.resolveEnd(W,T,Z.options.strict,J);if(_.comment)if(G.comment)G.comment+=`
|
|
95
|
+
`+_.comment;else G.comment=_.comment;G.range=[X.offset,T,_.offset]}else G.range=[X.offset,T,T];return G}eQ.resolveFlowCollection=tQ});var c3=K((GU)=>{var $U=A(),ZU=E(),XU=H1(),JU=z1(),QU=u3(),UU=m3(),HU=p3();function c9(q,$,Z,X,J,Q){let U=Z.type==="block-map"?QU.resolveBlockMap(q,$,Z,X,Q):Z.type==="block-seq"?UU.resolveBlockSeq(q,$,Z,X,Q):HU.resolveFlowCollection(q,$,Z,X,Q),H=U.constructor;if(J==="!"||J===H.tagName)return U.tag=H.tagName,U;if(J)U.tag=J;return U}function zU(q,$,Z,X,J){let Q=X.tag,U=!Q?null:$.directives.tagName(Q.source,(L)=>J(Q,"TAG_RESOLVE_FAILED",L));if(Z.type==="block-seq"){let{anchor:L,newlineAfterProp:R}=X,W=L&&Q?L.offset>Q.offset?L:Q:L??Q;if(W&&(!R||R.offset<W.offset))J(W,"MISSING_CHAR","Missing newline after block sequence props")}let H=Z.type==="block-map"?"map":Z.type==="block-seq"?"seq":Z.start.source==="{"?"map":"seq";if(!Q||!U||U==="!"||U===XU.YAMLMap.tagName&&H==="map"||U===JU.YAMLSeq.tagName&&H==="seq")return c9(q,$,Z,J,U);let z=$.schema.tags.find((L)=>L.tag===U&&L.collection===H);if(!z){let L=$.schema.knownTags[U];if(L?.collection===H)$.schema.tags.push(Object.assign({},L,{default:!1})),z=L;else{if(L)J(Q,"BAD_COLLECTION_TYPE",`${L.tag} used for ${H} collection, but expects ${L.collection??"scalar"}`,!0);else J(Q,"TAG_RESOLVE_FAILED",`Unresolved tag: ${U}`,!0);return c9(q,$,Z,J,U)}}let G=c9(q,$,Z,J,U,z),B=z.resolve?.(G,(L)=>J(Q,"TAG_RESOLVE_FAILED",L),$.options)??G,Y=$U.isNode(B)?B:new ZU.Scalar(B);if(Y.range=G.range,Y.tag=U,z?.format)Y.format=z.format;return Y}GU.composeCollection=zU});var a9=K((_U)=>{var s9=E();function BU(q,$,Z){let X=$.offset,J=TU($,q.options.strict,Z);if(!J)return{value:"",type:null,comment:"",range:[X,X,X]};let Q=J.mode===">"?s9.Scalar.BLOCK_FOLDED:s9.Scalar.BLOCK_LITERAL,U=$.source?LU($.source):[],H=U.length;for(let T=U.length-1;T>=0;--T){let _=U[T][1];if(_===""||_==="\r")H=T;else break}if(H===0){let T=J.chomp==="+"&&U.length>0?`
|
|
96
|
+
`.repeat(Math.max(1,U.length-1)):"",_=X+J.length;if($.source)_+=$.source.length;return{value:T,type:Q,comment:J.comment,range:[X,_,_]}}let z=$.indent+J.indent,G=$.offset+J.length,B=0;for(let T=0;T<H;++T){let[_,V]=U[T];if(V===""||V==="\r"){if(J.indent===0&&_.length>z)z=_.length}else{if(_.length<z)Z(G+_.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(J.indent===0)z=_.length;if(B=T,z===0&&!q.atRoot)Z(G,"BAD_INDENT","Block scalar values in collections must be indented");break}G+=_.length+V.length+1}for(let T=U.length-1;T>=H;--T)if(U[T][0].length>z)H=T+1;let Y="",L="",R=!1;for(let T=0;T<B;++T)Y+=U[T][0].slice(z)+`
|
|
97
|
+
`;for(let T=B;T<H;++T){let[_,V]=U[T];G+=_.length+V.length+1;let D=V[V.length-1]==="\r";if(D)V=V.slice(0,-1);if(V&&_.length<z){let O=`Block scalar lines must not be less indented than their ${J.indent?"explicit indentation indicator":"first line"}`;Z(G-V.length-(D?2:1),"BAD_INDENT",O),_=""}if(Q===s9.Scalar.BLOCK_LITERAL)Y+=L+_.slice(z)+V,L=`
|
|
98
|
+
`;else if(_.length>z||V[0]==="\t"){if(L===" ")L=`
|
|
99
|
+
`;else if(!R&&L===`
|
|
100
|
+
`)L=`
|
|
101
101
|
|
|
102
|
-
`;Y+=_
|
|
103
|
-
`,
|
|
102
|
+
`;Y+=L+_.slice(z)+V,L=`
|
|
103
|
+
`,R=!0}else if(V==="")if(L===`
|
|
104
104
|
`)Y+=`
|
|
105
|
-
`;else
|
|
106
|
-
`;else Y+=
|
|
107
|
-
`+
|
|
105
|
+
`;else L=`
|
|
106
|
+
`;else Y+=L+V,L=" ",R=!1}switch(J.chomp){case"-":break;case"+":for(let T=H;T<U.length;++T)Y+=`
|
|
107
|
+
`+U[T][0].slice(z);if(Y[Y.length-1]!==`
|
|
108
108
|
`)Y+=`
|
|
109
109
|
`;break;default:Y+=`
|
|
110
|
-
`}let
|
|
111
|
-
`,"sy"),
|
|
112
|
-
`,"sy")}catch{
|
|
113
|
-
`)
|
|
114
|
-
`;else
|
|
115
|
-
`)continue;if(
|
|
116
|
-
`){let{fold:Q,offset:
|
|
117
|
-
`){Q=q[
|
|
118
|
-
`){Q=q[++
|
|
119
|
-
`&&!(
|
|
120
|
-
`))X
|
|
121
|
-
`||
|
|
122
|
-
`)break;if(
|
|
123
|
-
`)
|
|
124
|
-
|
|
125
|
-
`,r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function
|
|
110
|
+
`}let W=X+J.length+$.source.length;return{value:Y,type:Q,comment:J.comment,range:[X,W,W]}}function TU({offset:q,props:$},Z,X){if($[0].type!=="block-scalar-header")return X($[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:J}=$[0],Q=J[0],U=0,H="",z=-1;for(let L=1;L<J.length;++L){let R=J[L];if(!H&&(R==="-"||R==="+"))H=R;else{let W=Number(R);if(!U&&W)U=W;else if(z===-1)z=q+L}}if(z!==-1)X(z,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${J}`);let G=!1,B="",Y=J.length;for(let L=1;L<$.length;++L){let R=$[L];switch(R.type){case"space":G=!0;case"newline":Y+=R.source.length;break;case"comment":if(Z&&!G)X(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");Y+=R.source.length,B=R.source.substring(1);break;case"error":X(R,"UNEXPECTED_TOKEN",R.message),Y+=R.source.length;break;default:{let W=`Unexpected token in block scalar header: ${R.type}`;X(R,"UNEXPECTED_TOKEN",W);let T=R.source;if(T&&typeof T==="string")Y+=T.length}}}return{mode:Q,indent:U,chomp:H,comment:B,length:Y}}function LU(q){let $=q.split(/\n( *)/),Z=$[0],X=Z.match(/^( *)/),Q=[X?.[1]?[X[1],Z.slice(X[1].length)]:["",Z]];for(let U=1;U<$.length;U+=2)Q.push([$[U],$[U+1]]);return Q}_U.resolveBlockScalar=BU});var n9=K((OU)=>{var i9=E(),RU=x1();function IU(q,$,Z){let{offset:X,type:J,source:Q,end:U}=q,H,z,G=(L,R,W)=>Z(X+L,R,W);switch(J){case"scalar":H=i9.Scalar.PLAIN,z=VU(Q,G);break;case"single-quoted-scalar":H=i9.Scalar.QUOTE_SINGLE,z=DU(Q,G);break;case"double-quoted-scalar":H=i9.Scalar.QUOTE_DOUBLE,z=MU(Q,G);break;default:return Z(q,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${J}`),{value:"",type:null,comment:"",range:[X,X+Q.length,X+Q.length]}}let B=X+Q.length,Y=RU.resolveEnd(U,B,$,Z);return{value:z,type:H,comment:Y.comment,range:[X,B,Y.offset]}}function VU(q,$){let Z="";switch(q[0]){case"\t":Z="a tab character";break;case",":Z="flow indicator character ,";break;case"%":Z="directive indicator character %";break;case"|":case">":{Z=`block scalar indicator ${q[0]}`;break}case"@":case"`":{Z=`reserved character ${q[0]}`;break}}if(Z)$(0,"BAD_SCALAR_START",`Plain value cannot start with ${Z}`);return s3(q)}function DU(q,$){if(q[q.length-1]!=="'"||q.length===1)$(q.length,"MISSING_CHAR","Missing closing 'quote");return s3(q.slice(1,-1)).replace(/''/g,"'")}function s3(q){let $,Z;try{$=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
111
|
+
`,"sy"),Z=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
112
|
+
`,"sy")}catch{$=/(.*?)[ \t]*\r?\n/sy,Z=/[ \t]*(.*?)[ \t]*\r?\n/sy}let X=$.exec(q);if(!X)return q;let J=X[1],Q=" ",U=$.lastIndex;Z.lastIndex=U;while(X=Z.exec(q)){if(X[1]==="")if(Q===`
|
|
113
|
+
`)J+=Q;else Q=`
|
|
114
|
+
`;else J+=Q+X[1],Q=" ";U=Z.lastIndex}let H=/[ \t]*(.*)/sy;return H.lastIndex=U,X=H.exec(q),J+Q+(X?.[1]??"")}function MU(q,$){let Z="";for(let X=1;X<q.length-1;++X){let J=q[X];if(J==="\r"&&q[X+1]===`
|
|
115
|
+
`)continue;if(J===`
|
|
116
|
+
`){let{fold:Q,offset:U}=PU(q,X);Z+=Q,X=U}else if(J==="\\"){let Q=q[++X],U=KU[Q];if(U)Z+=U;else if(Q===`
|
|
117
|
+
`){Q=q[X+1];while(Q===" "||Q==="\t")Q=q[++X+1]}else if(Q==="\r"&&q[X+1]===`
|
|
118
|
+
`){Q=q[++X+1];while(Q===" "||Q==="\t")Q=q[++X+1]}else if(Q==="x"||Q==="u"||Q==="U"){let H={x:2,u:4,U:8}[Q];Z+=FU(q,X+1,H,$),X+=H}else{let H=q.substr(X-1,2);$(X-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${H}`),Z+=H}}else if(J===" "||J==="\t"){let Q=X,U=q[X+1];while(U===" "||U==="\t")U=q[++X+1];if(U!==`
|
|
119
|
+
`&&!(U==="\r"&&q[X+2]===`
|
|
120
|
+
`))Z+=X>Q?q.slice(Q,X+1):J}else Z+=J}if(q[q.length-1]!=='"'||q.length===1)$(q.length,"MISSING_CHAR",'Missing closing "quote');return Z}function PU(q,$){let Z="",X=q[$+1];while(X===" "||X==="\t"||X===`
|
|
121
|
+
`||X==="\r"){if(X==="\r"&&q[$+2]!==`
|
|
122
|
+
`)break;if(X===`
|
|
123
|
+
`)Z+=`
|
|
124
|
+
`;$+=1,X=q[$+1]}if(!Z)Z=" ";return{fold:Z,offset:$}}var KU={"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 FU(q,$,Z,X){let J=q.substr($,Z),U=J.length===Z&&/^[0-9a-fA-F]+$/.test(J)?parseInt(J,16):NaN;if(isNaN(U)){let H=q.substr($-2,Z+2);return X($-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${H}`),H}return String.fromCodePoint(U)}OU.resolveFlowScalar=IU});var i3=K((CU)=>{var P1=A(),a3=E(),SU=a9(),AU=n9();function wU(q,$,Z,X){let{value:J,type:Q,comment:U,range:H}=$.type==="block-scalar"?SU.resolveBlockScalar(q,$,X):AU.resolveFlowScalar($,q.options.strict,X),z=Z?q.directives.tagName(Z.source,(Y)=>X(Z,"TAG_RESOLVE_FAILED",Y)):null,G;if(q.options.stringKeys&&q.atKey)G=q.schema[P1.SCALAR];else if(z)G=bU(q.schema,J,z,Z,X);else if($.type==="scalar")G=jU(q,J,$,X);else G=q.schema[P1.SCALAR];let B;try{let Y=G.resolve(J,(L)=>X(Z??$,"TAG_RESOLVE_FAILED",L),q.options);B=P1.isScalar(Y)?Y:new a3.Scalar(Y)}catch(Y){let L=Y instanceof Error?Y.message:String(Y);X(Z??$,"TAG_RESOLVE_FAILED",L),B=new a3.Scalar(J)}if(B.range=H,B.source=J,Q)B.type=Q;if(z)B.tag=z;if(G.format)B.format=G.format;if(U)B.comment=U;return B}function bU(q,$,Z,X,J){if(Z==="!")return q[P1.SCALAR];let Q=[];for(let H of q.tags)if(!H.collection&&H.tag===Z)if(H.default&&H.test)Q.push(H);else return H;for(let H of Q)if(H.test?.test($))return H;let U=q.knownTags[Z];if(U&&!U.collection)return q.tags.push(Object.assign({},U,{default:!1,test:void 0})),U;return J(X,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Z}`,Z!=="tag:yaml.org,2002:str"),q[P1.SCALAR]}function jU({atKey:q,directives:$,schema:Z},X,J,Q){let U=Z.tags.find((H)=>(H.default===!0||q&&H.default==="key")&&H.test?.test(X))||Z[P1.SCALAR];if(Z.compat){let H=Z.compat.find((z)=>z.default&&z.test?.test(X))??Z[P1.SCALAR];if(U.tag!==H.tag){let z=$.tagString(U.tag),G=$.tagString(H.tag),B=`Value may be parsed as either ${z} or ${G}`;Q(J,"TAG_RESOLVE_FAILED",B,!0)}}return U}CU.composeScalar=wU});var n3=K((yU)=>{function fU(q,$,Z){if($){Z??(Z=$.length);for(let X=Z-1;X>=0;--X){let J=$[X];switch(J.type){case"space":case"comment":case"newline":q-=J.source.length;continue}J=$[++X];while(J?.type==="space")q+=J.source.length,J=$[++X];break}}return q}yU.emptyScalarPosition=fU});var t3=K((dU)=>{var kU=s1(),gU=A(),vU=c3(),r3=i3(),hU=x1(),uU=n3(),mU={composeNode:o3,composeEmptyNode:r9};function o3(q,$,Z,X){let J=q.atKey,{spaceBefore:Q,comment:U,anchor:H,tag:z}=Z,G,B=!0;switch($.type){case"alias":if(G=lU(q,$,X),H||z)X($,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(G=r3.composeScalar(q,$,z,X),H)G.anchor=H.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(G=vU.composeCollection(mU,q,$,Z,X),H)G.anchor=H.source.substring(1);break;default:{let Y=$.type==="error"?$.message:`Unsupported token (type: ${$.type})`;X($,"UNEXPECTED_TOKEN",Y),G=r9(q,$.offset,void 0,null,Z,X),B=!1}}if(H&&G.anchor==="")X(H,"BAD_ALIAS","Anchor cannot be an empty string");if(J&&q.options.stringKeys&&(!gU.isScalar(G)||typeof G.value!=="string"||G.tag&&G.tag!=="tag:yaml.org,2002:str"))X(z??$,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(Q)G.spaceBefore=!0;if(U)if($.type==="scalar"&&$.source==="")G.comment=U;else G.commentBefore=U;if(q.options.keepSourceTokens&&B)G.srcToken=$;return G}function r9(q,$,Z,X,{spaceBefore:J,comment:Q,anchor:U,tag:H,end:z},G){let B={type:"scalar",offset:uU.emptyScalarPosition($,Z,X),indent:-1,source:""},Y=r3.composeScalar(q,B,H,G);if(U){if(Y.anchor=U.source.substring(1),Y.anchor==="")G(U,"BAD_ALIAS","Anchor cannot be an empty string")}if(J)Y.spaceBefore=!0;if(Q)Y.comment=Q,Y.range[2]=z;return Y}function lU({options:q},{offset:$,source:Z,end:X},J){let Q=new kU.Alias(Z.substring(1));if(Q.source==="")J($,"BAD_ALIAS","Alias cannot be an empty string");if(Q.source.endsWith(":"))J($+Z.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let U=$+Z.length,H=hU.resolveEnd(X,U,q.strict,J);if(Q.range=[$,U,H.offset],H.comment)Q.comment=H.comment;return Q}dU.composeEmptyNode=r9;dU.composeNode=o3});var q$=K((rU)=>{var sU=H0(),e3=t3(),aU=x1(),iU=G0();function nU(q,$,{offset:Z,start:X,value:J,end:Q},U){let H=Object.assign({_directives:$},q),z=new sU.Document(void 0,H),G={atKey:!1,atRoot:!0,directives:z.directives,options:z.options,schema:z.schema},B=iU.resolveProps(X,{indicator:"doc-start",next:J??Q?.[0],offset:Z,onError:U,parentIndent:0,startOnNewline:!0});if(B.found){if(z.directives.docStart=!0,J&&(J.type==="block-map"||J.type==="block-seq")&&!B.hasNewline)U(B.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}z.contents=J?e3.composeNode(G,J,B,U):e3.composeEmptyNode(G,B.end,X,null,B,U);let Y=z.contents.range[2],L=aU.resolveEnd(Q,Y,!1,U);if(L.comment)z.comment=L.comment;return z.range=[Z,Y,L.offset],z}rU.composeDoc=nU});var o9=K((XH)=>{var tU=n("process"),eU=$9(),qH=H0(),Y0=z0(),$$=A(),$H=q$(),ZH=x1();function B0(q){if(typeof q==="number")return[q,q+1];if(Array.isArray(q))return q.length===2?q:[q[0],q[1]];let{offset:$,source:Z}=q;return[$,$+(typeof Z==="string"?Z.length:1)]}function Z$(q){let $="",Z=!1,X=!1;for(let J=0;J<q.length;++J){let Q=q[J];switch(Q[0]){case"#":$+=($===""?"":X?`
|
|
126
126
|
|
|
127
127
|
`:`
|
|
128
|
-
`)+(Q.substring(1)||" "),
|
|
129
|
-
${
|
|
130
|
-
${
|
|
131
|
-
${Q}`:
|
|
132
|
-
${
|
|
133
|
-
`}];switch(
|
|
134
|
-
`),
|
|
135
|
-
`,
|
|
136
|
-
`});return{type:"block-scalar",offset:Q,indent:
|
|
137
|
-
`),
|
|
138
|
-
`;if(q.type==="block-scalar"){let Q=q.props[0];if(Q.type!=="block-scalar-header")throw Error("Invalid block scalar header");Q.source=
|
|
139
|
-
`});for(let
|
|
140
|
-
`};delete q.items,Object.assign(q,{type:
|
|
128
|
+
`)+(Q.substring(1)||" "),Z=!0,X=!1;break;case"%":if(q[J+1]?.[0]!=="#")J+=1;Z=!1;break;default:if(!Z)X=!0;Z=!1}}return{comment:$,afterEmptyLine:X}}class X${constructor(q={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=($,Z,X,J)=>{let Q=B0($);if(J)this.warnings.push(new Y0.YAMLWarning(Q,Z,X));else this.errors.push(new Y0.YAMLParseError(Q,Z,X))},this.directives=new eU.Directives({version:q.version||"1.2"}),this.options=q}decorate(q,$){let{comment:Z,afterEmptyLine:X}=Z$(this.prelude);if(Z){let J=q.contents;if($)q.comment=q.comment?`${q.comment}
|
|
129
|
+
${Z}`:Z;else if(X||q.directives.docStart||!J)q.commentBefore=Z;else if($$.isCollection(J)&&!J.flow&&J.items.length>0){let Q=J.items[0];if($$.isPair(Q))Q=Q.key;let U=Q.commentBefore;Q.commentBefore=U?`${Z}
|
|
130
|
+
${U}`:Z}else{let Q=J.commentBefore;J.commentBefore=Q?`${Z}
|
|
131
|
+
${Q}`:Z}}if($)Array.prototype.push.apply(q.errors,this.errors),Array.prototype.push.apply(q.warnings,this.warnings);else q.errors=this.errors,q.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Z$(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(q,$=!1,Z=-1){for(let X of q)yield*this.next(X);yield*this.end($,Z)}*next(q){if(tU.env.LOG_STREAM)console.dir(q,{depth:null});switch(q.type){case"directive":this.directives.add(q.source,($,Z,X)=>{let J=B0(q);J[0]+=$,this.onError(J,"BAD_DIRECTIVE",Z,X)}),this.prelude.push(q.source),this.atDirectives=!0;break;case"document":{let $=$H.composeDoc(this.options,this.directives,q,this.onError);if(this.atDirectives&&!$.directives.docStart)this.onError(q,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate($,!1),this.doc)yield this.doc;this.doc=$,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(q.source);break;case"error":{let $=q.source?`${q.message}: ${JSON.stringify(q.source)}`:q.message,Z=new Y0.YAMLParseError(B0(q),"UNEXPECTED_TOKEN",$);if(this.atDirectives||!this.doc)this.errors.push(Z);else this.doc.errors.push(Z);break}case"doc-end":{if(!this.doc){this.errors.push(new Y0.YAMLParseError(B0(q),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let $=ZH.resolveEnd(q.end,q.offset+q.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),$.comment){let Z=this.doc.comment;this.doc.comment=Z?`${Z}
|
|
132
|
+
${$.comment}`:$.comment}this.doc.range[2]=$.offset;break}default:this.errors.push(new Y0.YAMLParseError(B0(q),"UNEXPECTED_TOKEN",`Unsupported token ${q.type}`))}}*end(q=!1,$=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(q){let Z=Object.assign({_directives:this.directives},this.options),X=new qH.Document(void 0,Z);if(this.atDirectives)this.onError($,"MISSING_CHAR","Missing directives-end indicator line");X.range=[0,$,$],this.decorate(X,!1),yield X}}}XH.Composer=X$});var U$=K((TH)=>{var QH=a9(),UH=n9(),HH=z0(),J$=r1();function zH(q,$=!0,Z){if(q){let X=(J,Q,U)=>{let H=typeof J==="number"?J:Array.isArray(J)?J[0]:J.offset;if(Z)Z(H,Q,U);else throw new HH.YAMLParseError([H,H+1],Q,U)};switch(q.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return UH.resolveFlowScalar(q,$,X);case"block-scalar":return QH.resolveBlockScalar({options:{strict:$}},q,X)}}return null}function GH(q,$){let{implicitKey:Z=!1,indent:X,inFlow:J=!1,offset:Q=-1,type:U="PLAIN"}=$,H=J$.stringifyString({type:U,value:q},{implicitKey:Z,indent:X>0?" ".repeat(X):"",inFlow:J,options:{blockQuote:!0,lineWidth:-1}}),z=$.end??[{type:"newline",offset:-1,indent:X,source:`
|
|
133
|
+
`}];switch(H[0]){case"|":case">":{let G=H.indexOf(`
|
|
134
|
+
`),B=H.substring(0,G),Y=H.substring(G+1)+`
|
|
135
|
+
`,L=[{type:"block-scalar-header",offset:Q,indent:X,source:B}];if(!Q$(L,z))L.push({type:"newline",offset:-1,indent:X,source:`
|
|
136
|
+
`});return{type:"block-scalar",offset:Q,indent:X,props:L,source:Y}}case'"':return{type:"double-quoted-scalar",offset:Q,indent:X,source:H,end:z};case"'":return{type:"single-quoted-scalar",offset:Q,indent:X,source:H,end:z};default:return{type:"scalar",offset:Q,indent:X,source:H,end:z}}}function YH(q,$,Z={}){let{afterKey:X=!1,implicitKey:J=!1,inFlow:Q=!1,type:U}=Z,H="indent"in q?q.indent:null;if(X&&typeof H==="number")H+=2;if(!U)switch(q.type){case"single-quoted-scalar":U="QUOTE_SINGLE";break;case"double-quoted-scalar":U="QUOTE_DOUBLE";break;case"block-scalar":{let G=q.props[0];if(G.type!=="block-scalar-header")throw Error("Invalid block scalar header");U=G.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:U="PLAIN"}let z=J$.stringifyString({type:U,value:$},{implicitKey:J||H===null,indent:H!==null&&H>0?" ".repeat(H):"",inFlow:Q,options:{blockQuote:!0,lineWidth:-1}});switch(z[0]){case"|":case">":BH(q,z);break;case'"':t9(q,z,"double-quoted-scalar");break;case"'":t9(q,z,"single-quoted-scalar");break;default:t9(q,z,"scalar")}}function BH(q,$){let Z=$.indexOf(`
|
|
137
|
+
`),X=$.substring(0,Z),J=$.substring(Z+1)+`
|
|
138
|
+
`;if(q.type==="block-scalar"){let Q=q.props[0];if(Q.type!=="block-scalar-header")throw Error("Invalid block scalar header");Q.source=X,q.source=J}else{let{offset:Q}=q,U="indent"in q?q.indent:-1,H=[{type:"block-scalar-header",offset:Q,indent:U,source:X}];if(!Q$(H,"end"in q?q.end:void 0))H.push({type:"newline",offset:-1,indent:U,source:`
|
|
139
|
+
`});for(let z of Object.keys(q))if(z!=="type"&&z!=="offset")delete q[z];Object.assign(q,{type:"block-scalar",indent:U,props:H,source:J})}}function Q$(q,$){if($)for(let Z of $)switch(Z.type){case"space":case"comment":q.push(Z);break;case"newline":return q.push(Z),!0}return!1}function t9(q,$,Z){switch(q.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":q.type=Z,q.source=$;break;case"block-scalar":{let X=q.props.slice(1),J=$.length;if(q.props[0].type==="block-scalar-header")J-=q.props[0].source.length;for(let Q of X)Q.offset+=J;delete q.props,Object.assign(q,{type:Z,source:$,end:X});break}case"block-map":case"block-seq":{let J={type:"newline",offset:q.offset+$.length,indent:q.indent,source:`
|
|
140
|
+
`};delete q.items,Object.assign(q,{type:Z,source:$,end:[J]});break}default:{let X="indent"in q?q.indent:-1,J="end"in q&&Array.isArray(q.end)?q.end.filter((Q)=>Q.type==="space"||Q.type==="comment"||Q.type==="newline"):[];for(let Q of Object.keys(q))if(Q!=="type"&&Q!=="offset")delete q[Q];Object.assign(q,{type:Z,indent:X,source:$,end:J})}}}TH.createScalarToken=GH;TH.resolveAsScalar=zH;TH.setScalarValue=YH});var H$=K((IH)=>{var RH=(q)=>("type"in q)?Tq(q):Bq(q);function Tq(q){switch(q.type){case"block-scalar":{let $="";for(let Z of q.props)$+=Tq(Z);return $+q.source}case"block-map":case"block-seq":{let $="";for(let Z of q.items)$+=Bq(Z);return $}case"flow-collection":{let $=q.start.source;for(let Z of q.items)$+=Bq(Z);for(let Z of q.end)$+=Z.source;return $}case"document":{let $=Bq(q);if(q.end)for(let Z of q.end)$+=Z.source;return $}default:{let $=q.source;if("end"in q&&q.end)for(let Z of q.end)$+=Z.source;return $}}}function Bq({start:q,key:$,sep:Z,value:X}){let J="";for(let Q of q)J+=Q.source;if($)J+=Tq($);if(Z)for(let Q of Z)J+=Q.source;if(X)J+=Tq(X);return J}IH.stringify=RH});var Y$=K((MH)=>{var e9=Symbol("break visit"),DH=Symbol("skip children"),z$=Symbol("remove item");function K1(q,$){if("type"in q&&q.type==="document")q={start:q.start,value:q.value};G$(Object.freeze([]),q,$)}K1.BREAK=e9;K1.SKIP=DH;K1.REMOVE=z$;K1.itemAtPath=(q,$)=>{let Z=q;for(let[X,J]of $){let Q=Z?.[X];if(Q&&"items"in Q)Z=Q.items[J];else return}return Z};K1.parentCollection=(q,$)=>{let Z=K1.itemAtPath(q,$.slice(0,-1)),X=$[$.length-1][0],J=Z?.[X];if(J&&"items"in J)return J;throw Error("Parent collection not found")};function G$(q,$,Z){let X=Z($,q);if(typeof X==="symbol")return X;for(let J of["key","value"]){let Q=$[J];if(Q&&"items"in Q){for(let U=0;U<Q.items.length;++U){let H=G$(Object.freeze(q.concat([[J,U]])),Q.items[U],Z);if(typeof H==="number")U=H-1;else if(H===e9)return e9;else if(H===z$)Q.items.splice(U,1),U-=1}if(typeof X==="function"&&J==="key")X=X($,q)}}return typeof X==="function"?X($,q):X}MH.visit=K1});var Lq=K((wH)=>{var q4=U$(),KH=H$(),FH=Y$(),$4="\uFEFF",Z4="\x02",X4="\x18",J4="\x1F",OH=(q)=>!!q&&("items"in q),NH=(q)=>!!q&&(q.type==="scalar"||q.type==="single-quoted-scalar"||q.type==="double-quoted-scalar"||q.type==="block-scalar");function SH(q){switch(q){case $4:return"<BOM>";case Z4:return"<DOC>";case X4:return"<FLOW_END>";case J4:return"<SCALAR>";default:return JSON.stringify(q)}}function AH(q){switch(q){case $4:return"byte-order-mark";case Z4:return"doc-mode";case X4:return"flow-error-end";case J4: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(q[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}
|
|
143
|
-
`:case"\r":case"\t":return!0;default:return!1}}var
|
|
144
|
-
\r `),
|
|
145
|
-
`)return!0;if(
|
|
146
|
-
`;return!1}charAt(q){return this.buffer[this.pos+q]}continueScalar(q){let
|
|
147
|
-
`||!
|
|
148
|
-
`||
|
|
149
|
-
`,this.pos),this.lineEndPos=q;if(q===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[q-1]==="\r")q-=1;return this.buffer.substring(this.pos,q)}hasChars(q){return this.pos+q<=this.buffer.length}setNext(q){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=q,null}peek(q){return this.buffer.substr(this.pos,q)}*parseNext(q){switch(q){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 q=this.getLine();if(q===null)return this.setNext("stream");if(q[0]===
|
|
150
|
-
`,this.pos);if(
|
|
151
|
-
|
|
152
|
-
`:q
|
|
153
|
-
`)break}default:break q}if(!
|
|
154
|
-
|
|
155
|
-
`)
|
|
156
|
-
|
|
157
|
-
`)
|
|
158
|
-
|
|
159
|
-
`){let Q=this.continueScalar(
|
|
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(q[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}wH.createScalarToken=q4.createScalarToken;wH.resolveAsScalar=q4.resolveAsScalar;wH.setScalarValue=q4.setScalarValue;wH.stringify=KH.stringify;wH.visit=FH.visit;wH.BOM=$4;wH.DOCUMENT=Z4;wH.FLOW_END=X4;wH.SCALAR=J4;wH.isCollection=OH;wH.isScalar=NH;wH.prettyToken=SH;wH.tokenType=AH});var U4=K((pH)=>{var T0=Lq();function d(q){switch(q){case void 0:case" ":case`
|
|
143
|
+
`:case"\r":case"\t":return!0;default:return!1}}var B$=new Set("0123456789ABCDEFabcdef"),lH=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),_q=new Set(",[]{}"),dH=new Set(` ,[]{}
|
|
144
|
+
\r `),Q4=(q)=>!q||dH.has(q);class T${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(q,$=!1){if(q){if(typeof q!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+q:q,this.lineEndPos=null}this.atEnd=!$;let Z=this.next??"stream";while(Z&&($||this.hasChars(1)))Z=yield*this.parseNext(Z)}atLineEnd(){let q=this.pos,$=this.buffer[q];while($===" "||$==="\t")$=this.buffer[++q];if(!$||$==="#"||$===`
|
|
145
|
+
`)return!0;if($==="\r")return this.buffer[q+1]===`
|
|
146
|
+
`;return!1}charAt(q){return this.buffer[this.pos+q]}continueScalar(q){let $=this.buffer[q];if(this.indentNext>0){let Z=0;while($===" ")$=this.buffer[++Z+q];if($==="\r"){let X=this.buffer[Z+q+1];if(X===`
|
|
147
|
+
`||!X&&!this.atEnd)return q+Z+1}return $===`
|
|
148
|
+
`||Z>=this.indentNext||!$&&!this.atEnd?q+Z:-1}if($==="-"||$==="."){let Z=this.buffer.substr(q,3);if((Z==="---"||Z==="...")&&d(this.buffer[q+3]))return-1}return q}getLine(){let q=this.lineEndPos;if(typeof q!=="number"||q!==-1&&q<this.pos)q=this.buffer.indexOf(`
|
|
149
|
+
`,this.pos),this.lineEndPos=q;if(q===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[q-1]==="\r")q-=1;return this.buffer.substring(this.pos,q)}hasChars(q){return this.pos+q<=this.buffer.length}setNext(q){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=q,null}peek(q){return this.buffer.substr(this.pos,q)}*parseNext(q){switch(q){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 q=this.getLine();if(q===null)return this.setNext("stream");if(q[0]===T0.BOM)yield*this.pushCount(1),q=q.substring(1);if(q[0]==="%"){let $=q.length,Z=q.indexOf("#");while(Z!==-1){let J=q[Z-1];if(J===" "||J==="\t"){$=Z-1;break}else Z=q.indexOf("#",Z+1)}while(!0){let J=q[$-1];if(J===" "||J==="\t")$-=1;else break}let X=(yield*this.pushCount($))+(yield*this.pushSpaces(!0));return yield*this.pushCount(q.length-X),this.pushNewline(),"stream"}if(this.atLineEnd()){let $=yield*this.pushSpaces(!0);return yield*this.pushCount(q.length-$),yield*this.pushNewline(),"stream"}return yield T0.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let q=this.charAt(0);if(!q&&!this.atEnd)return this.setNext("line-start");if(q==="-"||q==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let $=this.peek(3);if(($==="---"||$==="...")&&d(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,$==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!d(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[q,$]=this.peek(2);if(!$&&!this.atEnd)return this.setNext("block-start");if((q==="-"||q==="?"||q===":")&&d($)){let Z=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=Z,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let q=this.getLine();if(q===null)return this.setNext("doc");let $=yield*this.pushIndicators();switch(q[$]){case"#":yield*this.pushCount(q.length-$);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(Q4),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return $+=yield*this.parseBlockScalarHeader(),$+=yield*this.pushSpaces(!0),yield*this.pushCount(q.length-$),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let q,$,Z=-1;do{if(q=yield*this.pushNewline(),q>0)$=yield*this.pushSpaces(!1),this.indentValue=Z=$;else $=0;$+=yield*this.pushSpaces(!0)}while(q+$>0);let X=this.getLine();if(X===null)return this.setNext("flow");if(Z!==-1&&Z<this.indentNext&&X[0]!=="#"||Z===0&&(X.startsWith("---")||X.startsWith("..."))&&d(X[3])){if(!(Z===this.indentNext-1&&this.flowLevel===1&&(X[0]==="]"||X[0]==="}")))return this.flowLevel=0,yield T0.FLOW_END,yield*this.parseLineStart()}let J=0;while(X[J]===",")J+=yield*this.pushCount(1),J+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(J+=yield*this.pushIndicators(),X[J]){case void 0:return"flow";case"#":return yield*this.pushCount(X.length-J),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Q4),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let Q=this.charAt(1);if(this.flowKey||d(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 q=this.charAt(0),$=this.buffer.indexOf(q,this.pos+1);if(q==="'")while($!==-1&&this.buffer[$+1]==="'")$=this.buffer.indexOf("'",$+2);else while($!==-1){let J=0;while(this.buffer[$-1-J]==="\\")J+=1;if(J%2===0)break;$=this.buffer.indexOf('"',$+1)}let Z=this.buffer.substring(0,$),X=Z.indexOf(`
|
|
150
|
+
`,this.pos);if(X!==-1){while(X!==-1){let J=this.continueScalar(X+1);if(J===-1)break;X=Z.indexOf(`
|
|
151
|
+
`,J)}if(X!==-1)$=X-(Z[X-1]==="\r"?2:1)}if($===-1){if(!this.atEnd)return this.setNext("quoted-scalar");$=this.buffer.length}return yield*this.pushToIndex($+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let q=this.pos;while(!0){let $=this.buffer[++q];if($==="+")this.blockScalarKeep=!0;else if($>"0"&&$<="9")this.blockScalarIndent=Number($)-1;else if($!=="-")break}return yield*this.pushUntil(($)=>d($)||$==="#")}*parseBlockScalar(){let q=this.pos-1,$=0,Z;q:for(let J=this.pos;Z=this.buffer[J];++J)switch(Z){case" ":$+=1;break;case`
|
|
152
|
+
`:q=J,$=0;break;case"\r":{let Q=this.buffer[J+1];if(!Q&&!this.atEnd)return this.setNext("block-scalar");if(Q===`
|
|
153
|
+
`)break}default:break q}if(!Z&&!this.atEnd)return this.setNext("block-scalar");if($>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=$;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let J=this.continueScalar(q+1);if(J===-1)break;q=this.buffer.indexOf(`
|
|
154
|
+
`,J)}while(q!==-1);if(q===-1){if(!this.atEnd)return this.setNext("block-scalar");q=this.buffer.length}}let X=q+1;Z=this.buffer[X];while(Z===" ")Z=this.buffer[++X];if(Z==="\t"){while(Z==="\t"||Z===" "||Z==="\r"||Z===`
|
|
155
|
+
`)Z=this.buffer[++X];q=X-1}else if(!this.blockScalarKeep)do{let J=q-1,Q=this.buffer[J];if(Q==="\r")Q=this.buffer[--J];let U=J;while(Q===" ")Q=this.buffer[--J];if(Q===`
|
|
156
|
+
`&&J>=this.pos&&J+1+$>U)q=J;else break}while(!0);return yield T0.SCALAR,yield*this.pushToIndex(q+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let q=this.flowLevel>0,$=this.pos-1,Z=this.pos-1,X;while(X=this.buffer[++Z])if(X===":"){let J=this.buffer[Z+1];if(d(J)||q&&_q.has(J))break;$=Z}else if(d(X)){let J=this.buffer[Z+1];if(X==="\r")if(J===`
|
|
157
|
+
`)Z+=1,X=`
|
|
158
|
+
`,J=this.buffer[Z+1];else $=Z;if(J==="#"||q&&_q.has(J))break;if(X===`
|
|
159
|
+
`){let Q=this.continueScalar(Z+1);if(Q===-1)break;Z=Math.max(Z,Q-2)}}else{if(q&&_q.has(X))break;$=Z}if(!X&&!this.atEnd)return this.setNext("plain-scalar");return yield T0.SCALAR,yield*this.pushToIndex($+1,!0),q?"flow":"doc"}*pushCount(q){if(q>0)return yield this.buffer.substr(this.pos,q),this.pos+=q,q;return 0}*pushToIndex(q,$){let Z=this.buffer.slice(this.pos,q);if(Z)return yield Z,this.pos+=Z.length,Z.length;else if($)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(Q4))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let q=this.flowLevel>0,$=this.charAt(1);if(d($)||q&&_q.has($)){if(!q)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 q=this.pos+2,$=this.buffer[q];while(!d($)&&$!==">")$=this.buffer[++q];return yield*this.pushToIndex($===">"?q+1:q,!1)}else{let q=this.pos+1,$=this.buffer[q];while($)if(lH.has($))$=this.buffer[++q];else if($==="%"&&B$.has(this.buffer[q+1])&&B$.has(this.buffer[q+2]))$=this.buffer[q+=3];else break;return yield*this.pushToIndex(q,!1)}}*pushNewline(){let q=this.buffer[this.pos];if(q===`
|
|
160
160
|
`)return yield*this.pushCount(1);else if(q==="\r"&&this.charAt(1)===`
|
|
161
|
-
`)return yield*this.pushCount(2);else return 0}*pushSpaces(q){let
|
|
162
|
-
`)+1;while(
|
|
163
|
-
|
|
164
|
-
`)+1;while(
|
|
165
|
-
|
|
166
|
-
${
|
|
161
|
+
`)return yield*this.pushCount(2);else return 0}*pushSpaces(q){let $=this.pos-1,Z;do Z=this.buffer[++$];while(Z===" "||q&&Z==="\t");let X=$-this.pos;if(X>0)yield this.buffer.substr(this.pos,X),this.pos=$;return X}*pushUntil(q){let $=this.pos,Z=this.buffer[$];while(!q(Z))Z=this.buffer[++$];return yield*this.pushToIndex($,!1)}}pH.Lexer=T$});var H4=K((sH)=>{class L${constructor(){this.lineStarts=[],this.addNewLine=(q)=>this.lineStarts.push(q),this.linePos=(q)=>{let $=0,Z=this.lineStarts.length;while($<Z){let J=$+Z>>1;if(this.lineStarts[J]<q)$=J+1;else Z=J}if(this.lineStarts[$]===q)return{line:$+1,col:1};if($===0)return{line:0,col:q};let X=this.lineStarts[$-1];return{line:$,col:q-X+1}}}}sH.LineCounter=L$});var z4=K((rH)=>{var iH=n("process"),_$=Lq(),nH=U4();function G1(q,$){for(let Z=0;Z<q.length;++Z)if(q[Z].type===$)return!0;return!1}function W$(q){for(let $=0;$<q.length;++$)switch(q[$].type){case"space":case"comment":case"newline":break;default:return $}return-1}function I$(q){switch(q?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Wq(q){switch(q.type){case"document":return q.start;case"block-map":{let $=q.items[q.items.length-1];return $.sep??$.start}case"block-seq":return q.items[q.items.length-1].start;default:return[]}}function k1(q){if(q.length===0)return[];let $=q.length;q:while(--$>=0)switch(q[$].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break q}while(q[++$]?.type==="space");return q.splice($,q.length)}function R$(q){if(q.start.type==="flow-seq-start"){for(let $ of q.items)if($.sep&&!$.value&&!G1($.start,"explicit-key-ind")&&!G1($.sep,"map-value-ind")){if($.key)$.value=$.key;if(delete $.key,I$($.value))if($.value.end)Array.prototype.push.apply($.value.end,$.sep);else $.value.end=$.sep;else Array.prototype.push.apply($.start,$.sep);delete $.sep}}}class V${constructor(q){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new nH.Lexer,this.onNewLine=q}*parse(q,$=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let Z of this.lexer.lex(q,$))yield*this.next(Z);if(!$)yield*this.end()}*next(q){if(this.source=q,iH.env.LOG_TOKENS)console.log("|",_$.prettyToken(q));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=q.length;return}let $=_$.tokenType(q);if(!$){let Z=`Not a YAML token: ${q}`;yield*this.pop({type:"error",offset:this.offset,message:Z,source:q}),this.offset+=q.length}else if($==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=$,yield*this.step(),$){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+q.length);break;case"space":if(this.atNewLine&&q[0]===" ")this.indent+=q.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=q.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=q.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 q=this.peek(1);if(this.type==="doc-end"&&q?.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(!q)return yield*this.stream();switch(q.type){case"document":return yield*this.document(q);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(q);case"block-scalar":return yield*this.blockScalar(q);case"block-map":return yield*this.blockMap(q);case"block-seq":return yield*this.blockSequence(q);case"flow-collection":return yield*this.flowCollection(q);case"doc-end":return yield*this.documentEnd(q)}yield*this.pop()}peek(q){return this.stack[this.stack.length-q]}*pop(q){let $=q??this.stack.pop();if(!$)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield $;else{let Z=this.peek(1);if($.type==="block-scalar")$.indent="indent"in Z?Z.indent:0;else if($.type==="flow-collection"&&Z.type==="document")$.indent=0;if($.type==="flow-collection")R$($);switch(Z.type){case"document":Z.value=$;break;case"block-scalar":Z.props.push($);break;case"block-map":{let X=Z.items[Z.items.length-1];if(X.value){Z.items.push({start:[],key:$,sep:[]}),this.onKeyLine=!0;return}else if(X.sep)X.value=$;else{Object.assign(X,{key:$,sep:[]}),this.onKeyLine=!X.explicitKey;return}break}case"block-seq":{let X=Z.items[Z.items.length-1];if(X.value)Z.items.push({start:[],value:$});else X.value=$;break}case"flow-collection":{let X=Z.items[Z.items.length-1];if(!X||X.value)Z.items.push({start:[],key:$,sep:[]});else if(X.sep)X.value=$;else Object.assign(X,{key:$,sep:[]});return}default:yield*this.pop(),yield*this.pop($)}if((Z.type==="document"||Z.type==="block-map"||Z.type==="block-seq")&&($.type==="block-map"||$.type==="block-seq")){let X=$.items[$.items.length-1];if(X&&!X.sep&&!X.value&&X.start.length>0&&W$(X.start)===-1&&($.indent===0||X.start.every((J)=>J.type!=="comment"||J.indent<$.indent))){if(Z.type==="document")Z.end=X.start;else Z.items.push({start:X.start});$.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 q={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")q.start.push(this.sourceToken);this.stack.push(q);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(q){if(q.value)return yield*this.lineEnd(q);switch(this.type){case"doc-start":{if(W$(q.start)!==-1)yield*this.pop(),yield*this.step();else q.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":q.start.push(this.sourceToken);return}let $=this.startBlockValue(q);if($)this.stack.push($);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(q){if(this.type==="map-value-ind"){let $=Wq(this.peek(2)),Z=k1($),X;if(q.end)X=q.end,X.push(this.sourceToken),delete q.end;else X=[this.sourceToken];let J={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:Z,key:q,sep:X}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=J}else yield*this.lineEnd(q)}*blockScalar(q){switch(this.type){case"space":case"comment":case"newline":q.props.push(this.sourceToken);return;case"scalar":if(q.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let $=this.source.indexOf(`
|
|
162
|
+
`)+1;while($!==0)this.onNewLine(this.offset+$),$=this.source.indexOf(`
|
|
163
|
+
`,$)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(q){let $=q.items[q.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,$.value){let Z="end"in $.value?$.value.end:void 0;if((Array.isArray(Z)?Z[Z.length-1]:void 0)?.type==="comment")Z?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)q.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else{if(this.atIndentedComment($.start,q.indent)){let X=q.items[q.items.length-2]?.value?.end;if(Array.isArray(X)){Array.prototype.push.apply(X,$.start),X.push(this.sourceToken),q.items.pop();return}}$.start.push(this.sourceToken)}return}if(this.indent>=q.indent){let Z=!this.onKeyLine&&this.indent===q.indent,X=Z&&($.sep||$.explicitKey)&&this.type!=="seq-item-ind",J=[];if(X&&$.sep&&!$.value){let Q=[];for(let U=0;U<$.sep.length;++U){let H=$.sep[U];switch(H.type){case"newline":Q.push(U);break;case"space":break;case"comment":if(H.indent>q.indent)Q.length=0;break;default:Q.length=0}}if(Q.length>=2)J=$.sep.splice(Q[1])}switch(this.type){case"anchor":case"tag":if(X||$.value)J.push(this.sourceToken),q.items.push({start:J}),this.onKeyLine=!0;else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"explicit-key-ind":if(!$.sep&&!$.explicitKey)$.start.push(this.sourceToken),$.explicitKey=!0;else if(X||$.value)J.push(this.sourceToken),q.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($.explicitKey)if(!$.sep)if(G1($.start,"newline"))Object.assign($,{key:null,sep:[this.sourceToken]});else{let Q=k1($.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Q,key:null,sep:[this.sourceToken]}]})}else if($.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if(G1($.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(I$($.key)&&!G1($.sep,"newline")){let Q=k1($.start),U=$.key,H=$.sep;H.push(this.sourceToken),delete $.key,delete $.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Q,key:U,sep:H}]})}else if(J.length>0)$.sep=$.sep.concat(J,this.sourceToken);else $.sep.push(this.sourceToken);else if(!$.sep)Object.assign($,{key:null,sep:[this.sourceToken]});else if($.value||X)q.items.push({start:J,key:null,sep:[this.sourceToken]});else if(G1($.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else $.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let Q=this.flowScalar(this.type);if(X||$.value)q.items.push({start:J,key:Q,sep:[]}),this.onKeyLine=!0;else if($.sep)this.stack.push(Q);else Object.assign($,{key:Q,sep:[]}),this.onKeyLine=!0;return}default:{let Q=this.startBlockValue(q);if(Q){if(Q.type==="block-seq"){if(!$.explicitKey&&$.sep&&!G1($.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(Z)q.items.push({start:J});this.stack.push(Q);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(q){let $=q.items[q.items.length-1];switch(this.type){case"newline":if($.value){let Z="end"in $.value?$.value.end:void 0;if((Array.isArray(Z)?Z[Z.length-1]:void 0)?.type==="comment")Z?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)q.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment($.start,q.indent)){let X=q.items[q.items.length-2]?.value?.end;if(Array.isArray(X)){Array.prototype.push.apply(X,$.start),X.push(this.sourceToken),q.items.pop();return}}$.start.push(this.sourceToken)}return;case"anchor":case"tag":if($.value||this.indent<=q.indent)break;$.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==q.indent)break;if($.value||G1($.start,"seq-item-ind"))q.items.push({start:[this.sourceToken]});else $.start.push(this.sourceToken);return}if(this.indent>q.indent){let Z=this.startBlockValue(q);if(Z){this.stack.push(Z);return}}yield*this.pop(),yield*this.step()}*flowCollection(q){let $=q.items[q.items.length-1];if(this.type==="flow-error-end"){let Z;do yield*this.pop(),Z=this.peek(1);while(Z?.type==="flow-collection")}else if(q.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!$||$.sep)q.items.push({start:[this.sourceToken]});else $.start.push(this.sourceToken);return;case"map-value-ind":if(!$||$.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else Object.assign($,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!$||$.value)q.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let X=this.flowScalar(this.type);if(!$||$.value)q.items.push({start:[],key:X,sep:[]});else if($.sep)this.stack.push(X);else Object.assign($,{key:X,sep:[]});return}case"flow-map-end":case"flow-seq-end":q.end.push(this.sourceToken);return}let Z=this.startBlockValue(q);if(Z)this.stack.push(Z);else yield*this.pop(),yield*this.step()}else{let Z=this.peek(2);if(Z.type==="block-map"&&(this.type==="map-value-ind"&&Z.indent===q.indent||this.type==="newline"&&!Z.items[Z.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&Z.type!=="flow-collection"){let X=Wq(Z),J=k1(X);R$(q);let Q=q.end.splice(1,q.end.length);Q.push(this.sourceToken);let U={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:J,key:q,sep:Q}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=U}else yield*this.lineEnd(q)}}flowScalar(q){if(this.onNewLine){let $=this.source.indexOf(`
|
|
164
|
+
`)+1;while($!==0)this.onNewLine(this.offset+$),$=this.source.indexOf(`
|
|
165
|
+
`,$)+1}return{type:q,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(q){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 $=Wq(q),Z=k1($);return Z.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Z,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let $=Wq(q),Z=k1($);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Z,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(q,$){if(this.type!=="comment")return!1;if(this.indent<=$)return!1;return q.every((Z)=>Z.type==="newline"||Z.type==="space")}*documentEnd(q){if(this.type!=="doc-mode"){if(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(q){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(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}rH.Parser=V$});var F$=K((Qz)=>{var D$=o9(),tH=H0(),L0=z0(),eH=H9(),qz=A(),$z=H4(),M$=z4();function P$(q){let $=q.prettyErrors!==!1;return{lineCounter:q.lineCounter||$&&new $z.LineCounter||null,prettyErrors:$}}function Zz(q,$={}){let{lineCounter:Z,prettyErrors:X}=P$($),J=new M$.Parser(Z?.addNewLine),Q=new D$.Composer($),U=Array.from(Q.compose(J.parse(q)));if(X&&Z)for(let H of U)H.errors.forEach(L0.prettifyError(q,Z)),H.warnings.forEach(L0.prettifyError(q,Z));if(U.length>0)return U;return Object.assign([],{empty:!0},Q.streamInfo())}function K$(q,$={}){let{lineCounter:Z,prettyErrors:X}=P$($),J=new M$.Parser(Z?.addNewLine),Q=new D$.Composer($),U=null;for(let H of Q.compose(J.parse(q),!0,q.length))if(!U)U=H;else if(U.options.logLevel!=="silent"){U.errors.push(new L0.YAMLParseError(H.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(X&&Z)U.errors.forEach(L0.prettifyError(q,Z)),U.warnings.forEach(L0.prettifyError(q,Z));return U}function Xz(q,$,Z){let X=void 0;if(typeof $==="function")X=$;else if(Z===void 0&&$&&typeof $==="object")Z=$;let J=K$(q,Z);if(!J)return null;if(J.warnings.forEach((Q)=>eH.warn(J.options.logLevel,Q)),J.errors.length>0)if(J.options.logLevel!=="silent")throw J.errors[0];else J.errors=[];return J.toJS(Object.assign({reviver:X},Z))}function Jz(q,$,Z){let X=null;if(typeof $==="function"||Array.isArray($))X=$;else if(Z===void 0&&$)Z=$;if(typeof Z==="string")Z=Z.length;if(typeof Z==="number"){let J=Math.round(Z);Z=J<1?void 0:J>8?{indent:8}:{indent:J}}if(q===void 0){let{keepUndefined:J}=Z??$??{};if(!J)return}if(qz.isDocument(q)&&!X)return q.toString(Z);return new tH.Document(q,X,Z).toString(Z)}Qz.parse=Xz;Qz.parseAllDocuments=Zz;Qz.parseDocument=K$;Qz.stringify=Jz});var L4=K((ST,T4)=>{var Mq=process||{},A$=Mq.argv||[],Dq=Mq.env||{},tz=!(!!Dq.NO_COLOR||A$.includes("--no-color"))&&(!!Dq.FORCE_COLOR||A$.includes("--color")||Mq.platform==="win32"||(Mq.stdout||{}).isTTY&&Dq.TERM!=="dumb"||!!Dq.CI),ez=(q,$,Z=q)=>(X)=>{let J=""+X,Q=J.indexOf($,q.length);return~Q?q+qG(J,$,Z,Q)+$:q+J+$},qG=(q,$,Z,X)=>{let J="",Q=0;do J+=q.substring(Q,X)+Z,Q=X+$.length,X=q.indexOf($,Q);while(~X);return J+q.substring(Q)},w$=(q=tz)=>{let $=q?ez:()=>String;return{isColorSupported:q,reset:$("\x1B[0m","\x1B[0m"),bold:$("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:$("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:$("\x1B[3m","\x1B[23m"),underline:$("\x1B[4m","\x1B[24m"),inverse:$("\x1B[7m","\x1B[27m"),hidden:$("\x1B[8m","\x1B[28m"),strikethrough:$("\x1B[9m","\x1B[29m"),black:$("\x1B[30m","\x1B[39m"),red:$("\x1B[31m","\x1B[39m"),green:$("\x1B[32m","\x1B[39m"),yellow:$("\x1B[33m","\x1B[39m"),blue:$("\x1B[34m","\x1B[39m"),magenta:$("\x1B[35m","\x1B[39m"),cyan:$("\x1B[36m","\x1B[39m"),white:$("\x1B[37m","\x1B[39m"),gray:$("\x1B[90m","\x1B[39m"),bgBlack:$("\x1B[40m","\x1B[49m"),bgRed:$("\x1B[41m","\x1B[49m"),bgGreen:$("\x1B[42m","\x1B[49m"),bgYellow:$("\x1B[43m","\x1B[49m"),bgBlue:$("\x1B[44m","\x1B[49m"),bgMagenta:$("\x1B[45m","\x1B[49m"),bgCyan:$("\x1B[46m","\x1B[49m"),bgWhite:$("\x1B[47m","\x1B[49m"),blackBright:$("\x1B[90m","\x1B[39m"),redBright:$("\x1B[91m","\x1B[39m"),greenBright:$("\x1B[92m","\x1B[39m"),yellowBright:$("\x1B[93m","\x1B[39m"),blueBright:$("\x1B[94m","\x1B[39m"),magentaBright:$("\x1B[95m","\x1B[39m"),cyanBright:$("\x1B[96m","\x1B[39m"),whiteBright:$("\x1B[97m","\x1B[39m"),bgBlackBright:$("\x1B[100m","\x1B[49m"),bgRedBright:$("\x1B[101m","\x1B[49m"),bgGreenBright:$("\x1B[102m","\x1B[49m"),bgYellowBright:$("\x1B[103m","\x1B[49m"),bgBlueBright:$("\x1B[104m","\x1B[49m"),bgMagentaBright:$("\x1B[105m","\x1B[49m"),bgCyanBright:$("\x1B[106m","\x1B[49m"),bgWhiteBright:$("\x1B[107m","\x1B[49m")}};T4.exports=w$();T4.exports.createColors=w$});var W4=K((AT,b$)=>{var _4={to(q,$){if(!$)return`\x1B[${q+1}G`;return`\x1B[${$+1};${q+1}H`},move(q,$){let Z="";if(q<0)Z+=`\x1B[${-q}D`;else if(q>0)Z+=`\x1B[${q}C`;if($<0)Z+=`\x1B[${-$}A`;else if($>0)Z+=`\x1B[${$}B`;return Z},up:(q=1)=>`\x1B[${q}A`,down:(q=1)=>`\x1B[${q}B`,forward:(q=1)=>`\x1B[${q}C`,backward:(q=1)=>`\x1B[${q}D`,nextLine:(q=1)=>"\x1B[E".repeat(q),prevLine:(q=1)=>"\x1B[F".repeat(q),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},$G={up:(q=1)=>"\x1B[S".repeat(q),down:(q=1)=>"\x1B[T".repeat(q)},ZG={screen:"\x1B[2J",up:(q=1)=>"\x1B[1J".repeat(q),down:(q=1)=>"\x1B[J".repeat(q),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(q){let $="";for(let Z=0;Z<q;Z++)$+=this.line+(Z<q-1?_4.up():"");if(q)$+=_4.left;return $}};b$.exports={cursor:_4,scroll:$G,erase:ZG,beep:"\x07"}});var U2=l1(Q2(),1),{program:yY,createCommand:xY,createArgument:kY,createOption:gY,CommanderError:vY,InvalidArgumentError:hY,InvalidOptionArgumentError:uY,Command:v,Argument:mY,Option:lY,Help:dY}=U2.default;import{join as W1}from"node:path";import{homedir as _2,platform as l6}from"node:os";import{mkdir as d6,rm as T2,stat as p6}from"node:fs/promises";import{spawn as c6}from"node:child_process";import{join as _1}from"node:path";import{homedir as g6,platform as v6}from"node:os";import{appendFileSync as z2,mkdirSync as h6}from"node:fs";function G2(){let q=g6(),$=v6();if($==="darwin")return _1(q,"Library","Logs","agentdeps");if($==="win32"){let J=process.env.LOCALAPPDATA??_1(q,"AppData","Local");return _1(J,"agentdeps","logs")}let Z=process.env.XDG_STATE_HOME;if(Z)return _1(Z,"agentdeps","logs");let X=process.env.XDG_CACHE_HOME;return _1(X??_1(q,".cache"),"agentdeps","logs")}function oq(){return _1(G2(),"agentdeps.log")}var A0=0,u6=0,H2=!1;function Y2(){if(H2)return!0;try{return h6(G2(),{recursive:!0}),H2=!0,!0}catch{return!1}}function m6(q){if(q instanceof Error)return q.stack??`${q.name}: ${q.message}`;if(typeof q==="object"&&q!==null)return JSON.stringify(q,null,2);return String(q)}function B2(){return new Date().toISOString()}function o(q,$){if(!Y2())return;let Z=`[${B2()}] ERROR [${q}]
|
|
166
|
+
${m6($)}
|
|
167
167
|
|
|
168
|
-
`;try{
|
|
169
|
-
`;try{
|
|
170
|
-
⚠ ${
|
|
171
|
-
${sq()}`)}function B2(){let q=E7(),Z=C7();if(Z==="darwin")return W1(q,"Library","Caches","agentdeps","repos");if(Z==="win32"){let J=process.env.LOCALAPPDATA??W1(q,"AppData","Local");return W1(J,"agentdeps","repos")}let X=process.env.XDG_CACHE_HOME;return W1(X??W1(q,".cache"),"agentdeps","repos")}async function L1(q,Z){return new Promise((X)=>{let J=x7("git",q,{cwd:Z,stdio:["ignore","pipe","pipe"]}),$=[],Q=[];J.stdout.on("data",(H)=>$.push(H)),J.stderr.on("data",(H)=>Q.push(H)),J.on("close",(H)=>{X({success:H===0,stdout:Buffer.concat($).toString().trim(),stderr:Buffer.concat(Q).toString().trim()})}),J.on("error",()=>{X({success:!1,stdout:"",stderr:"Failed to spawn git process"})})})}async function T2(){try{return(await L1(["--version"])).success}catch{return!1}}async function k7(q){try{return(await y7(q)).isDirectory()}catch{return!1}}async function v7(q,Z,X){let J=B2();await f7(J,{recursive:!0});let $=W1(J,X),Q=await L1(["clone","--branch",Z,"--single-branch",q,$]);if(!Q.success){if(await Y2($,{recursive:!0,force:!0}),(await L1(["clone",q,$])).success){let z=await L1(["checkout",Z],$);if(!z.success)return await Y2($,{recursive:!0,force:!0}),{success:!1,path:$,error:`ref '${Z}' not found: ${z.stderr}`};return{success:!0,path:$}}return{success:!1,path:$,error:Q.stderr}}return{success:!0,path:$}}async function h7(q,Z){let X=await L1(["fetch","origin"],q);if(!X.success)return{success:!1,error:X.stderr};if((await L1(["reset","--hard",`origin/${Z}`],q)).success)return{success:!0};let $=await L1(["checkout",Z],q);if(!$.success)return{success:!1,error:$.stderr};return{success:!0}}async function w0(q,Z,X){let J=B2(),$=W1(J,X);if(await k7($)){let H=await h7($,Z);if(!H.success)return o("cache.update",Error(`Failed to update ${X}: ${H.error}`)),{success:!1,path:$,error:`Failed to update ${X}: ${H.error}`};return{success:!0,path:$}}let Q=await v7(q,Z,X);if(!Q.success)o("cache.clone",Error(`Failed to clone ${q}: ${Q.error}`)),console.warn(`⚠ Failed to clone ${q}`);return Q}var nz=s9(),oz=H0(),tz=C9(),H4=z0(),ez=c1(),G1=A(),qU=$1(),ZU=C(),XU=H1(),JU=z1(),JT=Tq(),$U=J4(),QU=$4(),HU=Q4(),Lq=M5(),K5=l1();var zU=nz.Composer,UU=oz.Document,GU=tz.Schema,YU=H4.YAMLError,BU=H4.YAMLParseError,TU=H4.YAMLWarning,_U=ez.Alias,WU=G1.isAlias,LU=G1.isCollection,VU=G1.isDocument,RU=G1.isMap,IU=G1.isNode,MU=G1.isPair,KU=G1.isScalar,DU=G1.isSeq,PU=qU.Pair,FU=ZU.Scalar,OU=XU.YAMLMap,NU=JU.YAMLSeq;var SU=$U.Lexer,AU=QU.LineCounter,wU=HU.Parser,_0=Lq.parse,bU=Lq.parseAllDocuments,jU=Lq.parseDocument,W0=Lq.stringify,EU=K5.visit,CU=K5.visitAsync;import{mkdir as fU,readFile as yU,writeFile as xU,access as D5}from"node:fs/promises";import{join as v1}from"node:path";import{homedir as kU,platform as vU}from"node:os";function z4(){let q=kU();if(vU()==="win32"){let J=process.env.APPDATA??v1(q,"AppData","Roaming");return v1(J,"agentdeps")}let X=process.env.XDG_CONFIG_HOME;return v1(X??v1(q,".config"),"agentdeps")}function Vq(){return v1(z4(),"config.yaml")}function h1(){return v1(z4(),"agents.yaml")}async function P5(){try{return await D5(Vq()),!0}catch{return!1}}async function U4(){let q=Vq();try{await D5(q)}catch{return}let Z=await yU(q,"utf-8"),X=_0(Z),J=X.clone_method??"ssh";if(J!=="ssh"&&J!=="https")throw Error(`Invalid clone_method: "${J}". Must be "ssh" or "https".`);let $=X.install_method??"link";if($!=="link"&&$!=="copy")throw Error(`Invalid install_method: "${$}". Must be "link" or "copy".`);let Q=X.agents??[];if(!Array.isArray(Q))throw Error(`Invalid agents: expected an array, got ${typeof Q}.`);return{clone_method:J,agents:Q,install_method:$,custom_agents:X.custom_agents}}async function Y1(){try{let q=await U4();if(!q)console.error("✗ No global config found. Run `agentdeps config` first."),process.exit(1);return q}catch(q){o("config",q);let Z=q instanceof Error?q.message:String(q);console.error(`✗ Invalid config at ${Vq()}: ${Z}`),console.error(" Run `agentdeps config` to fix it."),A0(),process.exit(1)}}async function Rq(q){let Z=z4();await fU(Z,{recursive:!0});let X=W0(q,{lineWidth:0});await xU(Vq(),X,"utf-8")}var Oq=m1(Y4(),1);import{stdout as b5,stdin as lU}from"node:process";var m=m1(T4(),1);import pU from"node:readline";var cU=(q)=>q===161||q===164||q===167||q===168||q===170||q===173||q===174||q>=176&&q<=180||q>=182&&q<=186||q>=188&&q<=191||q===198||q===208||q===215||q===216||q>=222&&q<=225||q===230||q>=232&&q<=234||q===236||q===237||q===240||q===242||q===243||q>=247&&q<=250||q===252||q===254||q===257||q===273||q===275||q===283||q===294||q===295||q===299||q>=305&&q<=307||q===312||q>=319&&q<=322||q===324||q>=328&&q<=331||q===333||q===338||q===339||q===358||q===359||q===363||q===462||q===464||q===466||q===468||q===470||q===472||q===474||q===476||q===593||q===609||q===708||q===711||q>=713&&q<=715||q===717||q===720||q>=728&&q<=731||q===733||q===735||q>=768&&q<=879||q>=913&&q<=929||q>=931&&q<=937||q>=945&&q<=961||q>=963&&q<=969||q===1025||q>=1040&&q<=1103||q===1105||q===8208||q>=8211&&q<=8214||q===8216||q===8217||q===8220||q===8221||q>=8224&&q<=8226||q>=8228&&q<=8231||q===8240||q===8242||q===8243||q===8245||q===8251||q===8254||q===8308||q===8319||q>=8321&&q<=8324||q===8364||q===8451||q===8453||q===8457||q===8467||q===8470||q===8481||q===8482||q===8486||q===8491||q===8531||q===8532||q>=8539&&q<=8542||q>=8544&&q<=8555||q>=8560&&q<=8569||q===8585||q>=8592&&q<=8601||q===8632||q===8633||q===8658||q===8660||q===8679||q===8704||q===8706||q===8707||q===8711||q===8712||q===8715||q===8719||q===8721||q===8725||q===8730||q>=8733&&q<=8736||q===8739||q===8741||q>=8743&&q<=8748||q===8750||q>=8756&&q<=8759||q===8764||q===8765||q===8776||q===8780||q===8786||q===8800||q===8801||q>=8804&&q<=8807||q===8810||q===8811||q===8814||q===8815||q===8834||q===8835||q===8838||q===8839||q===8853||q===8857||q===8869||q===8895||q===8978||q>=9312&&q<=9449||q>=9451&&q<=9547||q>=9552&&q<=9587||q>=9600&&q<=9615||q>=9618&&q<=9621||q===9632||q===9633||q>=9635&&q<=9641||q===9650||q===9651||q===9654||q===9655||q===9660||q===9661||q===9664||q===9665||q>=9670&&q<=9672||q===9675||q>=9678&&q<=9681||q>=9698&&q<=9701||q===9711||q===9733||q===9734||q===9737||q===9742||q===9743||q===9756||q===9758||q===9792||q===9794||q===9824||q===9825||q>=9827&&q<=9829||q>=9831&&q<=9834||q===9836||q===9837||q===9839||q===9886||q===9887||q===9919||q>=9926&&q<=9933||q>=9935&&q<=9939||q>=9941&&q<=9953||q===9955||q===9960||q===9961||q>=9963&&q<=9969||q===9972||q>=9974&&q<=9977||q===9979||q===9980||q===9982||q===9983||q===10045||q>=10102&&q<=10111||q>=11094&&q<=11097||q>=12872&&q<=12879||q>=57344&&q<=63743||q>=65024&&q<=65039||q===65533||q>=127232&&q<=127242||q>=127248&&q<=127277||q>=127280&&q<=127337||q>=127344&&q<=127373||q===127375||q===127376||q>=127387&&q<=127404||q>=917760&&q<=917999||q>=983040&&q<=1048573||q>=1048576&&q<=1114109,iU=(q)=>q===12288||q>=65281&&q<=65376||q>=65504&&q<=65510,aU=(q)=>q>=4352&&q<=4447||q===8986||q===8987||q===9001||q===9002||q>=9193&&q<=9196||q===9200||q===9203||q===9725||q===9726||q===9748||q===9749||q>=9800&&q<=9811||q===9855||q===9875||q===9889||q===9898||q===9899||q===9917||q===9918||q===9924||q===9925||q===9934||q===9940||q===9962||q===9970||q===9971||q===9973||q===9978||q===9981||q===9989||q===9994||q===9995||q===10024||q===10060||q===10062||q>=10067&&q<=10069||q===10071||q>=10133&&q<=10135||q===10160||q===10175||q===11035||q===11036||q===11088||q===11093||q>=11904&&q<=11929||q>=11931&&q<=12019||q>=12032&&q<=12245||q>=12272&&q<=12287||q>=12289&&q<=12350||q>=12353&&q<=12438||q>=12441&&q<=12543||q>=12549&&q<=12591||q>=12593&&q<=12686||q>=12688&&q<=12771||q>=12783&&q<=12830||q>=12832&&q<=12871||q>=12880&&q<=19903||q>=19968&&q<=42124||q>=42128&&q<=42182||q>=43360&&q<=43388||q>=44032&&q<=55203||q>=63744&&q<=64255||q>=65040&&q<=65049||q>=65072&&q<=65106||q>=65108&&q<=65126||q>=65128&&q<=65131||q>=94176&&q<=94180||q===94192||q===94193||q>=94208&&q<=100343||q>=100352&&q<=101589||q>=101632&&q<=101640||q>=110576&&q<=110579||q>=110581&&q<=110587||q===110589||q===110590||q>=110592&&q<=110882||q===110898||q>=110928&&q<=110930||q===110933||q>=110948&&q<=110951||q>=110960&&q<=111355||q===126980||q===127183||q===127374||q>=127377&&q<=127386||q>=127488&&q<=127490||q>=127504&&q<=127547||q>=127552&&q<=127560||q===127568||q===127569||q>=127584&&q<=127589||q>=127744&&q<=127776||q>=127789&&q<=127797||q>=127799&&q<=127868||q>=127870&&q<=127891||q>=127904&&q<=127946||q>=127951&&q<=127955||q>=127968&&q<=127984||q===127988||q>=127992&&q<=128062||q===128064||q>=128066&&q<=128252||q>=128255&&q<=128317||q>=128331&&q<=128334||q>=128336&&q<=128359||q===128378||q===128405||q===128406||q===128420||q>=128507&&q<=128591||q>=128640&&q<=128709||q===128716||q>=128720&&q<=128722||q>=128725&&q<=128727||q>=128732&&q<=128735||q===128747||q===128748||q>=128756&&q<=128764||q>=128992&&q<=129003||q===129008||q>=129292&&q<=129338||q>=129340&&q<=129349||q>=129351&&q<=129535||q>=129648&&q<=129660||q>=129664&&q<=129672||q>=129680&&q<=129725||q>=129727&&q<=129733||q>=129742&&q<=129755||q>=129760&&q<=129768||q>=129776&&q<=129784||q>=131072&&q<=196605||q>=196608&&q<=262141,_4=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,Kq=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Dq=/\t{1,1000}/y,W4=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,Pq=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,sU=/\p{M}+/gu,rU={limit:1/0,ellipsis:""},j5=(q,Z={},X={})=>{let J=Z.limit??1/0,$=Z.ellipsis??"",Q=Z?.ellipsisWidth??($?j5($,rU,X).width:0),H=X.ansiWidth??0,z=X.controlWidth??0,U=X.tabWidth??8,G=X.ambiguousWidth??1,T=X.emojiWidth??2,Y=X.fullWidthWidth??2,_=X.regularWidth??1,V=X.wideWidth??2,L=0,B=0,W=q.length,I=0,M=!1,D=W,O=Math.max(0,J-Q),N=0,S=0,K=0,R=0;q:for(;;){if(S>N||B>=W&&B>L){let w=q.slice(N,S)||q.slice(L,B);I=0;for(let y of w.replaceAll(sU,"")){let x=y.codePointAt(0)||0;if(iU(x)?R=Y:aU(x)?R=V:G!==_&&cU(x)?R=G:R=_,K+R>O&&(D=Math.min(D,Math.max(N,L)+I)),K+R>J){M=!0;break q}I+=y.length,K+=R}N=S=0}if(B>=W)break;if(Pq.lastIndex=B,Pq.test(q)){if(I=Pq.lastIndex-B,R=I*_,K+R>O&&(D=Math.min(D,B+Math.floor((O-K)/_))),K+R>J){M=!0;break}K+=R,N=L,S=B,B=L=Pq.lastIndex;continue}if(_4.lastIndex=B,_4.test(q)){if(K+H>O&&(D=Math.min(D,B)),K+H>J){M=!0;break}K+=H,N=L,S=B,B=L=_4.lastIndex;continue}if(Kq.lastIndex=B,Kq.test(q)){if(I=Kq.lastIndex-B,R=I*z,K+R>O&&(D=Math.min(D,B+Math.floor((O-K)/z))),K+R>J){M=!0;break}K+=R,N=L,S=B,B=L=Kq.lastIndex;continue}if(Dq.lastIndex=B,Dq.test(q)){if(I=Dq.lastIndex-B,R=I*U,K+R>O&&(D=Math.min(D,B+Math.floor((O-K)/U))),K+R>J){M=!0;break}K+=R,N=L,S=B,B=L=Dq.lastIndex;continue}if(W4.lastIndex=B,W4.test(q)){if(K+T>O&&(D=Math.min(D,B)),K+T>J){M=!0;break}K+=T,N=L,S=B,B=L=W4.lastIndex;continue}B+=1}return{width:M?O:K,index:M?D:W,truncated:M,ellipsed:M&&J>=Q}},nU={limit:1/0,ellipsis:"",ellipsisWidth:0},L0=(q,Z={})=>j5(q,nU,Z).width,Nq="\x1B",E5="",oU=39,I4="\x07",C5="[",tU="]",f5="m",M4=`${tU}8;;`,S5=new RegExp(`(?:\\${C5}(?<code>\\d+)m|\\${M4}(?<uri>.*)${I4})`,"y"),eU=(q)=>{if(q>=30&&q<=37||q>=90&&q<=97)return 39;if(q>=40&&q<=47||q>=100&&q<=107)return 49;if(q===1||q===2)return 22;if(q===3)return 23;if(q===4)return 24;if(q===7)return 27;if(q===8)return 28;if(q===9)return 29;if(q===0)return 0},A5=(q)=>`${Nq}${C5}${q}${f5}`,w5=(q)=>`${Nq}${M4}${q}${I4}`,qG=(q)=>q.map((Z)=>L0(Z)),L4=(q,Z,X)=>{let J=Z[Symbol.iterator](),$=!1,Q=!1,H=q.at(-1),z=H===void 0?0:L0(H),U=J.next(),G=J.next(),T=0;for(;!U.done;){let Y=U.value,_=L0(Y);z+_<=X?q[q.length-1]+=Y:(q.push(Y),z=0),(Y===Nq||Y===E5)&&($=!0,Q=Z.startsWith(M4,T+1)),$?Q?Y===I4&&($=!1,Q=!1):Y===f5&&($=!1):(z+=_,z===X&&!G.done&&(q.push(""),z=0)),U=G,G=J.next(),T+=Y.length}H=q.at(-1),!z&&H!==void 0&&H.length>0&&q.length>1&&(q[q.length-2]+=q.pop())},ZG=(q)=>{let Z=q.split(" "),X=Z.length;for(;X>0&&!(L0(Z[X-1])>0);)X--;return X===Z.length?q:Z.slice(0,X).join(" ")+Z.slice(X).join("")},XG=(q,Z,X={})=>{if(X.trim!==!1&&q.trim()==="")return"";let J="",$,Q,H=q.split(" "),z=qG(H),U=[""];for(let[L,B]of H.entries()){X.trim!==!1&&(U[U.length-1]=(U.at(-1)??"").trimStart());let W=L0(U.at(-1)??"");if(L!==0&&(W>=Z&&(X.wordWrap===!1||X.trim===!1)&&(U.push(""),W=0),(W>0||X.trim===!1)&&(U[U.length-1]+=" ",W++)),X.hard&&z[L]>Z){let I=Z-W,M=1+Math.floor((z[L]-I-1)/Z);Math.floor((z[L]-1)/Z)<M&&U.push(""),L4(U,B,Z);continue}if(W+z[L]>Z&&W>0&&z[L]>0){if(X.wordWrap===!1&&W<Z){L4(U,B,Z);continue}U.push("")}if(W+z[L]>Z&&X.wordWrap===!1){L4(U,B,Z);continue}U[U.length-1]+=B}X.trim!==!1&&(U=U.map((L)=>ZG(L)));let G=U.join(`
|
|
172
|
-
`),T=G[Symbol.iterator](),Y=T.next(),_=T.next(),V=0;for(;!Y.done;){let L=Y.value,B=_.value;if(J+=L,L===Nq||L===E5){S5.lastIndex=V+1;let I=S5.exec(G)?.groups;if(I?.code!==void 0){let M=Number.parseFloat(I.code);$=M===oU?void 0:M}else I?.uri!==void 0&&(Q=I.uri.length===0?void 0:I.uri)}let W=$?eU($):void 0;B===`
|
|
173
|
-
|
|
174
|
-
|
|
168
|
+
`;try{z2(oq(),Z)}catch{}A0++}function tq(q,$){if(!Y2())return;let Z=`[${B2()}] WARN [${q}] ${$}
|
|
169
|
+
`;try{z2(oq(),Z)}catch{}u6++}function w0(){if(A0===0)return;console.error(`
|
|
170
|
+
⚠ ${A0} error${A0===1?"":"s"} occurred. See log for details:
|
|
171
|
+
${oq()}`)}function W2(){let q=_2(),$=l6();if($==="darwin")return W1(q,"Library","Caches","agentdeps","repos");if($==="win32"){let X=process.env.LOCALAPPDATA??W1(q,"AppData","Local");return W1(X,"agentdeps","repos")}let Z=process.env.XDG_CACHE_HOME;return W1(Z??W1(q,".cache"),"agentdeps","repos")}function s6(){try{return process.cwd()}catch{return _2()}}var a6=["GIT_DIR","GIT_WORK_TREE","GIT_INDEX_FILE","GIT_OBJECT_DIRECTORY","GIT_ALTERNATE_OBJECT_DIRECTORIES","GIT_COMMON_DIR","GIT_NAMESPACE","GIT_PREFIX","GIT_SUPER_PREFIX"];function i6(){let q={...process.env};for(let $ of a6)delete q[$];return q}async function t(q,$){return new Promise((Z)=>{let X=c6("git",q,{cwd:$??s6(),env:i6(),stdio:["ignore","pipe","pipe"]}),J=[],Q=[];X.stdout.on("data",(U)=>J.push(U)),X.stderr.on("data",(U)=>Q.push(U)),X.on("close",(U)=>{Z({success:U===0,stdout:Buffer.concat(J).toString().trim(),stderr:Buffer.concat(Q).toString().trim()})}),X.on("error",()=>{Z({success:!1,stdout:"",stderr:"Failed to spawn git process"})})})}async function L2(q){let $=await t(["rev-parse","HEAD"],q);if(!$.success||$.stdout.length===0)return;return $.stdout}async function n6(q,$,Z){if($===Z)return[];let X=await t(["diff","--name-only",$,Z,"--","skills","agents"],q);if(!X.success||X.stdout.length===0)return[];return X.stdout.split(`
|
|
172
|
+
`).map((J)=>J.trim()).filter((J)=>J.length>0)}async function R2(){try{return(await t(["--version"])).success}catch{return!1}}async function r6(q){try{return(await p6(q)).isDirectory()}catch{return!1}}async function o6(q,$,Z){let X=W2();await d6(X,{recursive:!0});let J=W1(X,Z),Q=await t(["clone","--branch",$,"--single-branch",q,J]);if(!Q.success){if(await T2(J,{recursive:!0,force:!0}),(await t(["clone",q,J])).success){let H=await t(["checkout",$],J);if(!H.success)return await T2(J,{recursive:!0,force:!0}),{success:!1,path:J,error:`ref '${$}' not found: ${H.stderr}`,changedPaths:[]};return{success:!0,path:J,changedPaths:[]}}return{success:!1,path:J,error:Q.stderr,changedPaths:[]}}return{success:!0,path:J,changedPaths:[]}}async function t6(q,$){let Z=await L2(q),X=await t(["fetch","origin"],q);if(!X.success)return{success:!1,error:X.stderr,changedPaths:[]};if(!(await t(["reset","--hard",`origin/${$}`],q)).success){let U=await t(["checkout",$],q);if(!U.success)return{success:!1,error:U.stderr,changedPaths:[]}}let Q=await L2(q);if(!Z||!Q)return{success:!0,changedPaths:[]};return{success:!0,changedPaths:await n6(q,Z,Q)}}async function b0(q,$,Z){let X=W2(),J=W1(X,Z);if(await r6(J)){let U=await t6(J,$);if(!U.success)return o("cache.update",Error(`Failed to update ${Z}: ${U.error}`)),{success:!1,path:J,error:`Failed to update ${Z}: ${U.error}`,changedPaths:[]};return{success:!0,path:J,changedPaths:U.changedPaths}}let Q=await o6(q,$,Z);if(!Q.success)o("cache.clone",Error(`Failed to clone ${q}: ${Q.error}`)),console.warn(`⚠ Failed to clone ${q}`);return Q}var Yz=o9(),Bz=H0(),Tz=x9(),G4=z0(),Lz=s1(),Y1=A(),_z=Q1(),Wz=E(),Rz=H1(),Iz=z1(),VT=Lq(),Vz=U4(),Dz=H4(),Mz=z4(),Rq=F$(),O$=p1();var Pz=Yz.Composer,Kz=Bz.Document,Fz=Tz.Schema,Oz=G4.YAMLError,Nz=G4.YAMLParseError,Sz=G4.YAMLWarning,Az=Lz.Alias,wz=Y1.isAlias,bz=Y1.isCollection,jz=Y1.isDocument,Cz=Y1.isMap,Ez=Y1.isNode,fz=Y1.isPair,yz=Y1.isScalar,xz=Y1.isSeq,kz=_z.Pair,gz=Wz.Scalar,vz=Rz.YAMLMap,hz=Iz.YAMLSeq;var uz=Vz.Lexer,mz=Dz.LineCounter,lz=Mz.Parser,_0=Rq.parse,dz=Rq.parseAllDocuments,pz=Rq.parseDocument,W0=Rq.stringify,cz=O$.visit,sz=O$.visitAsync;import{mkdir as az,readFile as iz,writeFile as nz,access as N$}from"node:fs/promises";import{join as g1}from"node:path";import{homedir as rz,platform as oz}from"node:os";function Y4(){let q=rz();if(oz()==="win32"){let X=process.env.APPDATA??g1(q,"AppData","Roaming");return g1(X,"agentdeps")}let Z=process.env.XDG_CONFIG_HOME;return g1(Z??g1(q,".config"),"agentdeps")}function Iq(){return g1(Y4(),"config.yaml")}function v1(){return g1(Y4(),"agents.yaml")}async function S$(){try{return await N$(Iq()),!0}catch{return!1}}async function B4(){let q=Iq();try{await N$(q)}catch{return}let $=await iz(q,"utf-8"),Z=_0($),X=Z.clone_method??"ssh";if(X!=="ssh"&&X!=="https")throw Error(`Invalid clone_method: "${X}". Must be "ssh" or "https".`);let J=Z.install_method??"link";if(J!=="link"&&J!=="copy")throw Error(`Invalid install_method: "${J}". Must be "link" or "copy".`);let Q=Z.agents??[];if(!Array.isArray(Q))throw Error(`Invalid agents: expected an array, got ${typeof Q}.`);return{clone_method:X,agents:Q,install_method:J,custom_agents:Z.custom_agents}}async function B1(){try{let q=await B4();if(!q)console.error("✗ No global config found. Run `agentdeps config` first."),process.exit(1);return q}catch(q){o("config",q);let $=q instanceof Error?q.message:String(q);console.error(`✗ Invalid config at ${Iq()}: ${$}`),console.error(" Run `agentdeps config` to fix it."),w0(),process.exit(1)}}async function Vq(q){let $=Y4();await az($,{recursive:!0});let Z=W0(q,{lineWidth:0});await nz(Iq(),Z,"utf-8")}var Nq=l1(L4(),1);import{stdout as f$,stdin as XG}from"node:process";var m=l1(W4(),1);import JG from"node:readline";var QG=(q)=>q===161||q===164||q===167||q===168||q===170||q===173||q===174||q>=176&&q<=180||q>=182&&q<=186||q>=188&&q<=191||q===198||q===208||q===215||q===216||q>=222&&q<=225||q===230||q>=232&&q<=234||q===236||q===237||q===240||q===242||q===243||q>=247&&q<=250||q===252||q===254||q===257||q===273||q===275||q===283||q===294||q===295||q===299||q>=305&&q<=307||q===312||q>=319&&q<=322||q===324||q>=328&&q<=331||q===333||q===338||q===339||q===358||q===359||q===363||q===462||q===464||q===466||q===468||q===470||q===472||q===474||q===476||q===593||q===609||q===708||q===711||q>=713&&q<=715||q===717||q===720||q>=728&&q<=731||q===733||q===735||q>=768&&q<=879||q>=913&&q<=929||q>=931&&q<=937||q>=945&&q<=961||q>=963&&q<=969||q===1025||q>=1040&&q<=1103||q===1105||q===8208||q>=8211&&q<=8214||q===8216||q===8217||q===8220||q===8221||q>=8224&&q<=8226||q>=8228&&q<=8231||q===8240||q===8242||q===8243||q===8245||q===8251||q===8254||q===8308||q===8319||q>=8321&&q<=8324||q===8364||q===8451||q===8453||q===8457||q===8467||q===8470||q===8481||q===8482||q===8486||q===8491||q===8531||q===8532||q>=8539&&q<=8542||q>=8544&&q<=8555||q>=8560&&q<=8569||q===8585||q>=8592&&q<=8601||q===8632||q===8633||q===8658||q===8660||q===8679||q===8704||q===8706||q===8707||q===8711||q===8712||q===8715||q===8719||q===8721||q===8725||q===8730||q>=8733&&q<=8736||q===8739||q===8741||q>=8743&&q<=8748||q===8750||q>=8756&&q<=8759||q===8764||q===8765||q===8776||q===8780||q===8786||q===8800||q===8801||q>=8804&&q<=8807||q===8810||q===8811||q===8814||q===8815||q===8834||q===8835||q===8838||q===8839||q===8853||q===8857||q===8869||q===8895||q===8978||q>=9312&&q<=9449||q>=9451&&q<=9547||q>=9552&&q<=9587||q>=9600&&q<=9615||q>=9618&&q<=9621||q===9632||q===9633||q>=9635&&q<=9641||q===9650||q===9651||q===9654||q===9655||q===9660||q===9661||q===9664||q===9665||q>=9670&&q<=9672||q===9675||q>=9678&&q<=9681||q>=9698&&q<=9701||q===9711||q===9733||q===9734||q===9737||q===9742||q===9743||q===9756||q===9758||q===9792||q===9794||q===9824||q===9825||q>=9827&&q<=9829||q>=9831&&q<=9834||q===9836||q===9837||q===9839||q===9886||q===9887||q===9919||q>=9926&&q<=9933||q>=9935&&q<=9939||q>=9941&&q<=9953||q===9955||q===9960||q===9961||q>=9963&&q<=9969||q===9972||q>=9974&&q<=9977||q===9979||q===9980||q===9982||q===9983||q===10045||q>=10102&&q<=10111||q>=11094&&q<=11097||q>=12872&&q<=12879||q>=57344&&q<=63743||q>=65024&&q<=65039||q===65533||q>=127232&&q<=127242||q>=127248&&q<=127277||q>=127280&&q<=127337||q>=127344&&q<=127373||q===127375||q===127376||q>=127387&&q<=127404||q>=917760&&q<=917999||q>=983040&&q<=1048573||q>=1048576&&q<=1114109,UG=(q)=>q===12288||q>=65281&&q<=65376||q>=65504&&q<=65510,HG=(q)=>q>=4352&&q<=4447||q===8986||q===8987||q===9001||q===9002||q>=9193&&q<=9196||q===9200||q===9203||q===9725||q===9726||q===9748||q===9749||q>=9800&&q<=9811||q===9855||q===9875||q===9889||q===9898||q===9899||q===9917||q===9918||q===9924||q===9925||q===9934||q===9940||q===9962||q===9970||q===9971||q===9973||q===9978||q===9981||q===9989||q===9994||q===9995||q===10024||q===10060||q===10062||q>=10067&&q<=10069||q===10071||q>=10133&&q<=10135||q===10160||q===10175||q===11035||q===11036||q===11088||q===11093||q>=11904&&q<=11929||q>=11931&&q<=12019||q>=12032&&q<=12245||q>=12272&&q<=12287||q>=12289&&q<=12350||q>=12353&&q<=12438||q>=12441&&q<=12543||q>=12549&&q<=12591||q>=12593&&q<=12686||q>=12688&&q<=12771||q>=12783&&q<=12830||q>=12832&&q<=12871||q>=12880&&q<=19903||q>=19968&&q<=42124||q>=42128&&q<=42182||q>=43360&&q<=43388||q>=44032&&q<=55203||q>=63744&&q<=64255||q>=65040&&q<=65049||q>=65072&&q<=65106||q>=65108&&q<=65126||q>=65128&&q<=65131||q>=94176&&q<=94180||q===94192||q===94193||q>=94208&&q<=100343||q>=100352&&q<=101589||q>=101632&&q<=101640||q>=110576&&q<=110579||q>=110581&&q<=110587||q===110589||q===110590||q>=110592&&q<=110882||q===110898||q>=110928&&q<=110930||q===110933||q>=110948&&q<=110951||q>=110960&&q<=111355||q===126980||q===127183||q===127374||q>=127377&&q<=127386||q>=127488&&q<=127490||q>=127504&&q<=127547||q>=127552&&q<=127560||q===127568||q===127569||q>=127584&&q<=127589||q>=127744&&q<=127776||q>=127789&&q<=127797||q>=127799&&q<=127868||q>=127870&&q<=127891||q>=127904&&q<=127946||q>=127951&&q<=127955||q>=127968&&q<=127984||q===127988||q>=127992&&q<=128062||q===128064||q>=128066&&q<=128252||q>=128255&&q<=128317||q>=128331&&q<=128334||q>=128336&&q<=128359||q===128378||q===128405||q===128406||q===128420||q>=128507&&q<=128591||q>=128640&&q<=128709||q===128716||q>=128720&&q<=128722||q>=128725&&q<=128727||q>=128732&&q<=128735||q===128747||q===128748||q>=128756&&q<=128764||q>=128992&&q<=129003||q===129008||q>=129292&&q<=129338||q>=129340&&q<=129349||q>=129351&&q<=129535||q>=129648&&q<=129660||q>=129664&&q<=129672||q>=129680&&q<=129725||q>=129727&&q<=129733||q>=129742&&q<=129755||q>=129760&&q<=129768||q>=129776&&q<=129784||q>=131072&&q<=196605||q>=196608&&q<=262141,R4=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,Pq=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Kq=/\t{1,1000}/y,I4=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,Fq=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,zG=/\p{M}+/gu,GG={limit:1/0,ellipsis:""},y$=(q,$={},Z={})=>{let X=$.limit??1/0,J=$.ellipsis??"",Q=$?.ellipsisWidth??(J?y$(J,GG,Z).width:0),U=Z.ansiWidth??0,H=Z.controlWidth??0,z=Z.tabWidth??8,G=Z.ambiguousWidth??1,B=Z.emojiWidth??2,Y=Z.fullWidthWidth??2,L=Z.regularWidth??1,R=Z.wideWidth??2,W=0,T=0,_=q.length,V=0,D=!1,P=_,O=Math.max(0,X-Q),N=0,S=0,M=0,I=0;q:for(;;){if(S>N||T>=_&&T>W){let w=q.slice(N,S)||q.slice(W,T);V=0;for(let y of w.replaceAll(zG,"")){let x=y.codePointAt(0)||0;if(UG(x)?I=Y:HG(x)?I=R:G!==L&&QG(x)?I=G:I=L,M+I>O&&(P=Math.min(P,Math.max(N,W)+V)),M+I>X){D=!0;break q}V+=y.length,M+=I}N=S=0}if(T>=_)break;if(Fq.lastIndex=T,Fq.test(q)){if(V=Fq.lastIndex-T,I=V*L,M+I>O&&(P=Math.min(P,T+Math.floor((O-M)/L))),M+I>X){D=!0;break}M+=I,N=W,S=T,T=W=Fq.lastIndex;continue}if(R4.lastIndex=T,R4.test(q)){if(M+U>O&&(P=Math.min(P,T)),M+U>X){D=!0;break}M+=U,N=W,S=T,T=W=R4.lastIndex;continue}if(Pq.lastIndex=T,Pq.test(q)){if(V=Pq.lastIndex-T,I=V*H,M+I>O&&(P=Math.min(P,T+Math.floor((O-M)/H))),M+I>X){D=!0;break}M+=I,N=W,S=T,T=W=Pq.lastIndex;continue}if(Kq.lastIndex=T,Kq.test(q)){if(V=Kq.lastIndex-T,I=V*z,M+I>O&&(P=Math.min(P,T+Math.floor((O-M)/z))),M+I>X){D=!0;break}M+=I,N=W,S=T,T=W=Kq.lastIndex;continue}if(I4.lastIndex=T,I4.test(q)){if(M+B>O&&(P=Math.min(P,T)),M+B>X){D=!0;break}M+=B,N=W,S=T,T=W=I4.lastIndex;continue}T+=1}return{width:D?O:M,index:D?P:_,truncated:D,ellipsed:D&&X>=Q}},YG={limit:1/0,ellipsis:"",ellipsisWidth:0},R0=(q,$={})=>y$(q,YG,$).width,Sq="\x1B",x$="",BG=39,P4="\x07",k$="[",TG="]",g$="m",K4=`${TG}8;;`,j$=new RegExp(`(?:\\${k$}(?<code>\\d+)m|\\${K4}(?<uri>.*)${P4})`,"y"),LG=(q)=>{if(q>=30&&q<=37||q>=90&&q<=97)return 39;if(q>=40&&q<=47||q>=100&&q<=107)return 49;if(q===1||q===2)return 22;if(q===3)return 23;if(q===4)return 24;if(q===7)return 27;if(q===8)return 28;if(q===9)return 29;if(q===0)return 0},C$=(q)=>`${Sq}${k$}${q}${g$}`,E$=(q)=>`${Sq}${K4}${q}${P4}`,_G=(q)=>q.map(($)=>R0($)),V4=(q,$,Z)=>{let X=$[Symbol.iterator](),J=!1,Q=!1,U=q.at(-1),H=U===void 0?0:R0(U),z=X.next(),G=X.next(),B=0;for(;!z.done;){let Y=z.value,L=R0(Y);H+L<=Z?q[q.length-1]+=Y:(q.push(Y),H=0),(Y===Sq||Y===x$)&&(J=!0,Q=$.startsWith(K4,B+1)),J?Q?Y===P4&&(J=!1,Q=!1):Y===g$&&(J=!1):(H+=L,H===Z&&!G.done&&(q.push(""),H=0)),z=G,G=X.next(),B+=Y.length}U=q.at(-1),!H&&U!==void 0&&U.length>0&&q.length>1&&(q[q.length-2]+=q.pop())},WG=(q)=>{let $=q.split(" "),Z=$.length;for(;Z>0&&!(R0($[Z-1])>0);)Z--;return Z===$.length?q:$.slice(0,Z).join(" ")+$.slice(Z).join("")},RG=(q,$,Z={})=>{if(Z.trim!==!1&&q.trim()==="")return"";let X="",J,Q,U=q.split(" "),H=_G(U),z=[""];for(let[W,T]of U.entries()){Z.trim!==!1&&(z[z.length-1]=(z.at(-1)??"").trimStart());let _=R0(z.at(-1)??"");if(W!==0&&(_>=$&&(Z.wordWrap===!1||Z.trim===!1)&&(z.push(""),_=0),(_>0||Z.trim===!1)&&(z[z.length-1]+=" ",_++)),Z.hard&&H[W]>$){let V=$-_,D=1+Math.floor((H[W]-V-1)/$);Math.floor((H[W]-1)/$)<D&&z.push(""),V4(z,T,$);continue}if(_+H[W]>$&&_>0&&H[W]>0){if(Z.wordWrap===!1&&_<$){V4(z,T,$);continue}z.push("")}if(_+H[W]>$&&Z.wordWrap===!1){V4(z,T,$);continue}z[z.length-1]+=T}Z.trim!==!1&&(z=z.map((W)=>WG(W)));let G=z.join(`
|
|
173
|
+
`),B=G[Symbol.iterator](),Y=B.next(),L=B.next(),R=0;for(;!Y.done;){let W=Y.value,T=L.value;if(X+=W,W===Sq||W===x$){j$.lastIndex=R+1;let V=j$.exec(G)?.groups;if(V?.code!==void 0){let D=Number.parseFloat(V.code);J=D===BG?void 0:D}else V?.uri!==void 0&&(Q=V.uri.length===0?void 0:V.uri)}let _=J?LG(J):void 0;T===`
|
|
174
|
+
`?(Q&&(X+=E$("")),J&&_&&(X+=C$(_))):W===`
|
|
175
|
+
`&&(J&&_&&(X+=C$(J)),Q&&(X+=E$(Q))),R+=W.length,Y=L,L=B.next()}return X};function D4(q,$,Z){return String(q).normalize().replaceAll(`\r
|
|
175
176
|
`,`
|
|
176
177
|
`).split(`
|
|
177
|
-
`).map((
|
|
178
|
-
`)}var
|
|
179
|
-
`),
|
|
180
|
-
`)
|
|
181
|
-
`).map((Q,
|
|
182
|
-
`)}class
|
|
183
|
-
`),
|
|
184
|
-
`).length-1;this.output.write(m.cursor.move(-999,q*-1))}render(){let q=
|
|
185
|
-
`);this.output.write(
|
|
186
|
-
`).slice(Q);this.output.write(
|
|
187
|
-
`)),this._prevFrame=q;return}}this.output.write(m.erase.down())}this.output.write(q),this.state==="initial"&&(this.state="active"),this._prevFrame=q}}}function QG(q,Z){if(q===void 0||Z.length===0)return 0;let X=Z.findIndex((J)=>J.value===q);return X!==-1?X:0}function HG(q,Z){return(Z.label??String(Z.value)).toLowerCase().includes(q.toLowerCase())}function zG(q,Z){if(Z)return q?Z:Z[0]}class x5 extends V0{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#q=0;#X="";#J;#Z;get cursor(){return this.#q}get userInputWithCursor(){if(!this.userInput)return Oq.default.inverse(Oq.default.hidden("_"));if(this._cursor>=this.userInput.length)return`${this.userInput}█`;let q=this.userInput.slice(0,this._cursor),[Z,...X]=this.userInput.slice(this._cursor);return`${q}${Oq.default.inverse(Z)}${X.join("")}`}get options(){return typeof this.#Z=="function"?this.#Z():this.#Z}constructor(q){super(q),this.#Z=q.options;let Z=this.options;this.filteredOptions=[...Z],this.multiple=q.multiple===!0,this.#J=q.filter??HG;let X;if(q.initialValue&&Array.isArray(q.initialValue)?this.multiple?X=q.initialValue:X=q.initialValue.slice(0,1):!this.multiple&&this.options.length>0&&(X=[this.options[0].value]),X)for(let J of X){let $=Z.findIndex((Q)=>Q.value===J);$!==-1&&(this.toggleSelected(J),this.#q=$)}this.focusedValue=this.options[this.#q]?.value,this.on("key",(J,$)=>this.#$(J,$)),this.on("userInput",(J)=>this.#Q(J))}_isActionKey(q,Z){return q==="\t"||this.multiple&&this.isNavigating&&Z.name==="space"&&q!==void 0&&q!==""}#$(q,Z){let X=Z.name==="up",J=Z.name==="down",$=Z.name==="return";X||J?(this.#q=Math.max(0,Math.min(this.#q+(X?-1:1),this.filteredOptions.length-1)),this.focusedValue=this.filteredOptions[this.#q]?.value,this.multiple||(this.selectedValues=[this.focusedValue]),this.isNavigating=!0):$?this.value=zG(this.multiple,this.selectedValues):this.multiple?this.focusedValue!==void 0&&(Z.name==="tab"||this.isNavigating&&Z.name==="space")?this.toggleSelected(this.focusedValue):this.isNavigating=!1:(this.focusedValue&&(this.selectedValues=[this.focusedValue]),this.isNavigating=!1)}deselectAll(){this.selectedValues=[]}toggleSelected(q){this.filteredOptions.length!==0&&(this.multiple?this.selectedValues.includes(q)?this.selectedValues=this.selectedValues.filter((Z)=>Z!==q):this.selectedValues=[...this.selectedValues,q]:this.selectedValues=[q])}#Q(q){if(q!==this.#X){this.#X=q;let Z=this.options;q?this.filteredOptions=Z.filter((X)=>this.#J(q,X)):this.filteredOptions=[...Z],this.#q=QG(this.focusedValue,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#q]?.value,this.multiple||(this.focusedValue!==void 0?this.toggleSelected(this.focusedValue):this.deselectAll())}}}class k5 extends V0{options;cursor=0;#q;getGroupItems(q){return this.options.filter((Z)=>Z.group===q)}isGroupSelected(q){let Z=this.getGroupItems(q),X=this.value;return X===void 0?!1:Z.every((J)=>X.includes(J.value))}toggleValue(){let q=this.options[this.cursor];if(this.value===void 0&&(this.value=[]),q.group===!0){let Z=q.value,X=this.getGroupItems(Z);this.isGroupSelected(Z)?this.value=this.value.filter((J)=>X.findIndex(($)=>$.value===J)===-1):this.value=[...this.value,...X.map((J)=>J.value)],this.value=Array.from(new Set(this.value))}else{let Z=this.value.includes(q.value);this.value=Z?this.value.filter((X)=>X!==q.value):[...this.value,q.value]}}constructor(q){super(q,!1);let{options:Z}=q;this.#q=q.selectableGroups!==!1,this.options=Object.entries(Z).flatMap(([X,J])=>[{value:X,group:!0,label:X},...J.map(($)=>({...$,group:X}))]),this.value=[...q.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:X})=>X===q.cursorAt),this.#q?0:1),this.on("cursor",(X)=>{switch(X){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;let J=this.options[this.cursor]?.group===!0;!this.#q&&J&&(this.cursor=this.cursor===0?this.options.length-1:this.cursor-1);break}case"down":case"right":{this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;let J=this.options[this.cursor]?.group===!0;!this.#q&&J&&(this.cursor=this.cursor===this.options.length-1?0:this.cursor+1);break}case"space":this.toggleValue();break}})}}function O1(q,Z,X){let J=q+Z,$=Math.max(X.length-1,0),Q=J<0?$:J>$?0:J;return X[Q].disabled?O1(Q,Z<0?-1:1,X):Q}class P4 extends V0{options;cursor=0;get _value(){return this.options[this.cursor].value}get _enabledOptions(){return this.options.filter((q)=>q.disabled!==!0)}toggleAll(){let q=this._enabledOptions,Z=this.value!==void 0&&this.value.length===q.length;this.value=Z?[]:q.map((X)=>X.value)}toggleInvert(){let q=this.value;if(!q)return;let Z=this._enabledOptions.filter((X)=>!q.includes(X.value));this.value=Z.map((X)=>X.value)}toggleValue(){this.value===void 0&&(this.value=[]);let q=this.value.includes(this._value);this.value=q?this.value.filter((Z)=>Z!==this._value):[...this.value,this._value]}constructor(q){super(q,!1),this.options=q.options,this.value=[...q.initialValues??[]];let Z=Math.max(this.options.findIndex(({value:X})=>X===q.cursorAt),0);this.cursor=this.options[Z].disabled?O1(Z,1,this.options):Z,this.on("key",(X)=>{X==="a"&&this.toggleAll(),X==="i"&&this.toggleInvert()}),this.on("cursor",(X)=>{switch(X){case"left":case"up":this.cursor=O1(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=O1(this.cursor,1,this.options);break;case"space":this.toggleValue();break}})}}class F4 extends V0{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(q){super(q,!1),this.options=q.options;let Z=this.options.findIndex(({value:J})=>J===q.initialValue),X=Z===-1?0:Z;this.cursor=this.options[X].disabled?O1(X,1,this.options):X,this.changeValue(),this.on("cursor",(J)=>{switch(J){case"left":case"up":this.cursor=O1(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=O1(this.cursor,1,this.options);break}this.changeValue()})}}var F=m1(Y4(),1);import p from"node:process";var l5=m1(T4(),1);function UG(){return p.platform!=="win32"?p.env.TERM!=="linux":!!p.env.CI||!!p.env.WT_SESSION||!!p.env.TERMINUS_SUBLIME||p.env.ConEmuTask==="{cmd::Cmder}"||p.env.TERM_PROGRAM==="Terminus-Sublime"||p.env.TERM_PROGRAM==="vscode"||p.env.TERM==="xterm-256color"||p.env.TERM==="alacritty"||p.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var GG=UG();var j=(q,Z)=>GG?q:Z,YG=j("◆","*"),BG=j("■","x"),TG=j("▲","x"),p5=j("◇","o"),_G=j("┌","T"),f=j("│","|"),I0=j("└","—"),NT=j("┐","T"),ST=j("┘","—"),WG=j("●",">"),v5=j("○"," "),LG=j("◻","[•]"),h5=j("◼","[+]"),g5=j("◻","[ ]"),AT=j("▪","•"),wT=j("─","-"),bT=j("╮","+"),jT=j("├","+"),ET=j("╯","+"),CT=j("╰","+"),fT=j("╭","+"),VG=j("●","•"),RG=j("◆","*"),IG=j("▲","!"),MG=j("■","x"),c5=(q)=>{switch(q){case"initial":case"active":return F.default.cyan(YG);case"cancel":return F.default.red(BG);case"error":return F.default.yellow(TG);case"submit":return F.default.green(p5)}},i5=(q)=>{switch(q){case"initial":case"active":return F.default.cyan(f);case"cancel":return F.default.red(f);case"error":return F.default.yellow(f);case"submit":return F.default.green(f)}},KG=(q)=>q===161||q===164||q===167||q===168||q===170||q===173||q===174||q>=176&&q<=180||q>=182&&q<=186||q>=188&&q<=191||q===198||q===208||q===215||q===216||q>=222&&q<=225||q===230||q>=232&&q<=234||q===236||q===237||q===240||q===242||q===243||q>=247&&q<=250||q===252||q===254||q===257||q===273||q===275||q===283||q===294||q===295||q===299||q>=305&&q<=307||q===312||q>=319&&q<=322||q===324||q>=328&&q<=331||q===333||q===338||q===339||q===358||q===359||q===363||q===462||q===464||q===466||q===468||q===470||q===472||q===474||q===476||q===593||q===609||q===708||q===711||q>=713&&q<=715||q===717||q===720||q>=728&&q<=731||q===733||q===735||q>=768&&q<=879||q>=913&&q<=929||q>=931&&q<=937||q>=945&&q<=961||q>=963&&q<=969||q===1025||q>=1040&&q<=1103||q===1105||q===8208||q>=8211&&q<=8214||q===8216||q===8217||q===8220||q===8221||q>=8224&&q<=8226||q>=8228&&q<=8231||q===8240||q===8242||q===8243||q===8245||q===8251||q===8254||q===8308||q===8319||q>=8321&&q<=8324||q===8364||q===8451||q===8453||q===8457||q===8467||q===8470||q===8481||q===8482||q===8486||q===8491||q===8531||q===8532||q>=8539&&q<=8542||q>=8544&&q<=8555||q>=8560&&q<=8569||q===8585||q>=8592&&q<=8601||q===8632||q===8633||q===8658||q===8660||q===8679||q===8704||q===8706||q===8707||q===8711||q===8712||q===8715||q===8719||q===8721||q===8725||q===8730||q>=8733&&q<=8736||q===8739||q===8741||q>=8743&&q<=8748||q===8750||q>=8756&&q<=8759||q===8764||q===8765||q===8776||q===8780||q===8786||q===8800||q===8801||q>=8804&&q<=8807||q===8810||q===8811||q===8814||q===8815||q===8834||q===8835||q===8838||q===8839||q===8853||q===8857||q===8869||q===8895||q===8978||q>=9312&&q<=9449||q>=9451&&q<=9547||q>=9552&&q<=9587||q>=9600&&q<=9615||q>=9618&&q<=9621||q===9632||q===9633||q>=9635&&q<=9641||q===9650||q===9651||q===9654||q===9655||q===9660||q===9661||q===9664||q===9665||q>=9670&&q<=9672||q===9675||q>=9678&&q<=9681||q>=9698&&q<=9701||q===9711||q===9733||q===9734||q===9737||q===9742||q===9743||q===9756||q===9758||q===9792||q===9794||q===9824||q===9825||q>=9827&&q<=9829||q>=9831&&q<=9834||q===9836||q===9837||q===9839||q===9886||q===9887||q===9919||q>=9926&&q<=9933||q>=9935&&q<=9939||q>=9941&&q<=9953||q===9955||q===9960||q===9961||q>=9963&&q<=9969||q===9972||q>=9974&&q<=9977||q===9979||q===9980||q===9982||q===9983||q===10045||q>=10102&&q<=10111||q>=11094&&q<=11097||q>=12872&&q<=12879||q>=57344&&q<=63743||q>=65024&&q<=65039||q===65533||q>=127232&&q<=127242||q>=127248&&q<=127277||q>=127280&&q<=127337||q>=127344&&q<=127373||q===127375||q===127376||q>=127387&&q<=127404||q>=917760&&q<=917999||q>=983040&&q<=1048573||q>=1048576&&q<=1114109,DG=(q)=>q===12288||q>=65281&&q<=65376||q>=65504&&q<=65510,PG=(q)=>q>=4352&&q<=4447||q===8986||q===8987||q===9001||q===9002||q>=9193&&q<=9196||q===9200||q===9203||q===9725||q===9726||q===9748||q===9749||q>=9800&&q<=9811||q===9855||q===9875||q===9889||q===9898||q===9899||q===9917||q===9918||q===9924||q===9925||q===9934||q===9940||q===9962||q===9970||q===9971||q===9973||q===9978||q===9981||q===9989||q===9994||q===9995||q===10024||q===10060||q===10062||q>=10067&&q<=10069||q===10071||q>=10133&&q<=10135||q===10160||q===10175||q===11035||q===11036||q===11088||q===11093||q>=11904&&q<=11929||q>=11931&&q<=12019||q>=12032&&q<=12245||q>=12272&&q<=12287||q>=12289&&q<=12350||q>=12353&&q<=12438||q>=12441&&q<=12543||q>=12549&&q<=12591||q>=12593&&q<=12686||q>=12688&&q<=12771||q>=12783&&q<=12830||q>=12832&&q<=12871||q>=12880&&q<=19903||q>=19968&&q<=42124||q>=42128&&q<=42182||q>=43360&&q<=43388||q>=44032&&q<=55203||q>=63744&&q<=64255||q>=65040&&q<=65049||q>=65072&&q<=65106||q>=65108&&q<=65126||q>=65128&&q<=65131||q>=94176&&q<=94180||q===94192||q===94193||q>=94208&&q<=100343||q>=100352&&q<=101589||q>=101632&&q<=101640||q>=110576&&q<=110579||q>=110581&&q<=110587||q===110589||q===110590||q>=110592&&q<=110882||q===110898||q>=110928&&q<=110930||q===110933||q>=110948&&q<=110951||q>=110960&&q<=111355||q===126980||q===127183||q===127374||q>=127377&&q<=127386||q>=127488&&q<=127490||q>=127504&&q<=127547||q>=127552&&q<=127560||q===127568||q===127569||q>=127584&&q<=127589||q>=127744&&q<=127776||q>=127789&&q<=127797||q>=127799&&q<=127868||q>=127870&&q<=127891||q>=127904&&q<=127946||q>=127951&&q<=127955||q>=127968&&q<=127984||q===127988||q>=127992&&q<=128062||q===128064||q>=128066&&q<=128252||q>=128255&&q<=128317||q>=128331&&q<=128334||q>=128336&&q<=128359||q===128378||q===128405||q===128406||q===128420||q>=128507&&q<=128591||q>=128640&&q<=128709||q===128716||q>=128720&&q<=128722||q>=128725&&q<=128727||q>=128732&&q<=128735||q===128747||q===128748||q>=128756&&q<=128764||q>=128992&&q<=129003||q===129008||q>=129292&&q<=129338||q>=129340&&q<=129349||q>=129351&&q<=129535||q>=129648&&q<=129660||q>=129664&&q<=129672||q>=129680&&q<=129725||q>=129727&&q<=129733||q>=129742&&q<=129755||q>=129760&&q<=129768||q>=129776&&q<=129784||q>=131072&&q<=196605||q>=196608&&q<=262141,O4=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,Sq=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Aq=/\t{1,1000}/y,N4=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,wq=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,FG=/\p{M}+/gu,OG={limit:1/0,ellipsis:""},a5=(q,Z={},X={})=>{let J=Z.limit??1/0,$=Z.ellipsis??"",Q=Z?.ellipsisWidth??($?a5($,OG,X).width:0),H=X.ansiWidth??0,z=X.controlWidth??0,U=X.tabWidth??8,G=X.ambiguousWidth??1,T=X.emojiWidth??2,Y=X.fullWidthWidth??2,_=X.regularWidth??1,V=X.wideWidth??2,L=0,B=0,W=q.length,I=0,M=!1,D=W,O=Math.max(0,J-Q),N=0,S=0,K=0,R=0;q:for(;;){if(S>N||B>=W&&B>L){let w=q.slice(N,S)||q.slice(L,B);I=0;for(let y of w.replaceAll(FG,"")){let x=y.codePointAt(0)||0;if(DG(x)?R=Y:PG(x)?R=V:G!==_&&KG(x)?R=G:R=_,K+R>O&&(D=Math.min(D,Math.max(N,L)+I)),K+R>J){M=!0;break q}I+=y.length,K+=R}N=S=0}if(B>=W)break;if(wq.lastIndex=B,wq.test(q)){if(I=wq.lastIndex-B,R=I*_,K+R>O&&(D=Math.min(D,B+Math.floor((O-K)/_))),K+R>J){M=!0;break}K+=R,N=L,S=B,B=L=wq.lastIndex;continue}if(O4.lastIndex=B,O4.test(q)){if(K+H>O&&(D=Math.min(D,B)),K+H>J){M=!0;break}K+=H,N=L,S=B,B=L=O4.lastIndex;continue}if(Sq.lastIndex=B,Sq.test(q)){if(I=Sq.lastIndex-B,R=I*z,K+R>O&&(D=Math.min(D,B+Math.floor((O-K)/z))),K+R>J){M=!0;break}K+=R,N=L,S=B,B=L=Sq.lastIndex;continue}if(Aq.lastIndex=B,Aq.test(q)){if(I=Aq.lastIndex-B,R=I*U,K+R>O&&(D=Math.min(D,B+Math.floor((O-K)/U))),K+R>J){M=!0;break}K+=R,N=L,S=B,B=L=Aq.lastIndex;continue}if(N4.lastIndex=B,N4.test(q)){if(K+T>O&&(D=Math.min(D,B)),K+T>J){M=!0;break}K+=T,N=L,S=B,B=L=N4.lastIndex;continue}B+=1}return{width:M?O:K,index:M?D:W,truncated:M,ellipsed:M&&J>=Q}},NG={limit:1/0,ellipsis:"",ellipsisWidth:0},M0=(q,Z={})=>a5(q,NG,Z).width,jq="\x1B",s5="",SG=39,w4="\x07",r5="[",AG="]",n5="m",b4=`${AG}8;;`,u5=new RegExp(`(?:\\${r5}(?<code>\\d+)m|\\${b4}(?<uri>.*)${w4})`,"y"),wG=(q)=>{if(q>=30&&q<=37||q>=90&&q<=97)return 39;if(q>=40&&q<=47||q>=100&&q<=107)return 49;if(q===1||q===2)return 22;if(q===3)return 23;if(q===4)return 24;if(q===7)return 27;if(q===8)return 28;if(q===9)return 29;if(q===0)return 0},m5=(q)=>`${jq}${r5}${q}${n5}`,d5=(q)=>`${jq}${b4}${q}${w4}`,bG=(q)=>q.map((Z)=>M0(Z)),S4=(q,Z,X)=>{let J=Z[Symbol.iterator](),$=!1,Q=!1,H=q.at(-1),z=H===void 0?0:M0(H),U=J.next(),G=J.next(),T=0;for(;!U.done;){let Y=U.value,_=M0(Y);z+_<=X?q[q.length-1]+=Y:(q.push(Y),z=0),(Y===jq||Y===s5)&&($=!0,Q=Z.startsWith(b4,T+1)),$?Q?Y===w4&&($=!1,Q=!1):Y===n5&&($=!1):(z+=_,z===X&&!G.done&&(q.push(""),z=0)),U=G,G=J.next(),T+=Y.length}H=q.at(-1),!z&&H!==void 0&&H.length>0&&q.length>1&&(q[q.length-2]+=q.pop())},jG=(q)=>{let Z=q.split(" "),X=Z.length;for(;X>0&&!(M0(Z[X-1])>0);)X--;return X===Z.length?q:Z.slice(0,X).join(" ")+Z.slice(X).join("")},EG=(q,Z,X={})=>{if(X.trim!==!1&&q.trim()==="")return"";let J="",$,Q,H=q.split(" "),z=bG(H),U=[""];for(let[L,B]of H.entries()){X.trim!==!1&&(U[U.length-1]=(U.at(-1)??"").trimStart());let W=M0(U.at(-1)??"");if(L!==0&&(W>=Z&&(X.wordWrap===!1||X.trim===!1)&&(U.push(""),W=0),(W>0||X.trim===!1)&&(U[U.length-1]+=" ",W++)),X.hard&&z[L]>Z){let I=Z-W,M=1+Math.floor((z[L]-I-1)/Z);Math.floor((z[L]-1)/Z)<M&&U.push(""),S4(U,B,Z);continue}if(W+z[L]>Z&&W>0&&z[L]>0){if(X.wordWrap===!1&&W<Z){S4(U,B,Z);continue}U.push("")}if(W+z[L]>Z&&X.wordWrap===!1){S4(U,B,Z);continue}U[U.length-1]+=B}X.trim!==!1&&(U=U.map((L)=>jG(L)));let G=U.join(`
|
|
188
|
-
`),
|
|
189
|
-
`?(Q&&(
|
|
190
|
-
`&&(
|
|
178
|
+
`).map((X)=>RG(X,$,Z)).join(`
|
|
179
|
+
`)}var IG=["up","down","left","right","space","enter","cancel"],F1={actions:new Set(IG),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0};function v$(q,$){if(typeof q=="string")return F1.aliases.get(q)===$;for(let Z of q)if(Z!==void 0&&v$(Z,$))return!0;return!1}function VG(q,$){if(q===$)return;let Z=q.split(`
|
|
180
|
+
`),X=$.split(`
|
|
181
|
+
`),J=Math.max(Z.length,X.length),Q=[];for(let U=0;U<J;U++)Z[U]!==X[U]&&Q.push(U);return{lines:Q,numLinesBefore:Z.length,numLinesAfter:X.length,numLines:J}}var jT=globalThis.process.platform.startsWith("win"),M4=Symbol("clack:cancel");function $1(q){return q===M4}function Oq(q,$){let Z=q;Z.isTTY&&Z.setRawMode($)}var F4=(q)=>("columns"in q)&&typeof q.columns=="number"?q.columns:80,O4=(q)=>("rows"in q)&&typeof q.rows=="number"?q.rows:20;function N1(q,$,Z,X=Z){let J=F4(q??f$);return D4($,J-Z.length,{hard:!0,trim:!1}).split(`
|
|
182
|
+
`).map((Q,U)=>`${U===0?X:Z}${Q}`).join(`
|
|
183
|
+
`)}class I0{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(q,$=!0){let{input:Z=XG,output:X=f$,render:J,signal:Q,...U}=q;this.opts=U,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=J.bind(this),this._track=$,this._abortSignal=Q,this.input=Z,this.output=X}unsubscribe(){this._subscribers.clear()}setSubscriber(q,$){let Z=this._subscribers.get(q)??[];Z.push($),this._subscribers.set(q,Z)}on(q,$){this.setSubscriber(q,{cb:$})}once(q,$){this.setSubscriber(q,{cb:$,once:!0})}emit(q,...$){let Z=this._subscribers.get(q)??[],X=[];for(let J of Z)J.cb(...$),J.once&&X.push(()=>Z.splice(Z.indexOf(J),1));for(let J of X)J()}prompt(){return new Promise((q)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),q(M4);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=JG.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),Oq(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(m.cursor.show),this.output.off("resize",this.render),Oq(this.input,!1),q(this.value)}),this.once("cancel",()=>{this.output.write(m.cursor.show),this.output.off("resize",this.render),Oq(this.input,!1),q(M4)})})}_isActionKey(q,$){return q==="\t"}_setValue(q){this.value=q,this.emit("value",this.value)}_setUserInput(q,$){this.userInput=q??"",this.emit("userInput",this.userInput),$&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(q,$){if(this._track&&$.name!=="return"&&($.name&&this._isActionKey(q,$)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),$?.name&&(!this._track&&F1.aliases.has($.name)&&this.emit("cursor",F1.aliases.get($.name)),F1.actions.has($.name)&&this.emit("cursor",$.name)),q&&(q.toLowerCase()==="y"||q.toLowerCase()==="n")&&this.emit("confirm",q.toLowerCase()==="y"),this.emit("key",q?.toLowerCase(),$),$?.name==="return"){if(this.opts.validate){let Z=this.opts.validate(this.value);Z&&(this.error=Z instanceof Error?Z.message:Z,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}v$([q,$?.name,$?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
184
|
+
`),Oq(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let q=D4(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
|
|
185
|
+
`).length-1;this.output.write(m.cursor.move(-999,q*-1))}render(){let q=D4(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(q!==this._prevFrame){if(this.state==="initial")this.output.write(m.cursor.hide);else{let $=VG(this._prevFrame,q),Z=O4(this.output);if(this.restoreCursor(),$){let X=Math.max(0,$.numLinesAfter-Z),J=Math.max(0,$.numLinesBefore-Z),Q=$.lines.find((U)=>U>=X);if(Q===void 0){this._prevFrame=q;return}if($.lines.length===1){this.output.write(m.cursor.move(0,Q-J)),this.output.write(m.erase.lines(1));let U=q.split(`
|
|
186
|
+
`);this.output.write(U[Q]),this._prevFrame=q,this.output.write(m.cursor.move(0,U.length-Q-1));return}else if($.lines.length>1){if(X<J)Q=X;else{let H=Q-J;H>0&&this.output.write(m.cursor.move(0,H))}this.output.write(m.erase.down());let U=q.split(`
|
|
187
|
+
`).slice(Q);this.output.write(U.join(`
|
|
188
|
+
`)),this._prevFrame=q;return}}this.output.write(m.erase.down())}this.output.write(q),this.state==="initial"&&(this.state="active"),this._prevFrame=q}}}function DG(q,$){if(q===void 0||$.length===0)return 0;let Z=$.findIndex((X)=>X.value===q);return Z!==-1?Z:0}function MG(q,$){return($.label??String($.value)).toLowerCase().includes(q.toLowerCase())}function PG(q,$){if($)return q?$:$[0]}class h$ extends I0{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#q=0;#Z="";#X;#$;get cursor(){return this.#q}get userInputWithCursor(){if(!this.userInput)return Nq.default.inverse(Nq.default.hidden("_"));if(this._cursor>=this.userInput.length)return`${this.userInput}█`;let q=this.userInput.slice(0,this._cursor),[$,...Z]=this.userInput.slice(this._cursor);return`${q}${Nq.default.inverse($)}${Z.join("")}`}get options(){return typeof this.#$=="function"?this.#$():this.#$}constructor(q){super(q),this.#$=q.options;let $=this.options;this.filteredOptions=[...$],this.multiple=q.multiple===!0,this.#X=q.filter??MG;let Z;if(q.initialValue&&Array.isArray(q.initialValue)?this.multiple?Z=q.initialValue:Z=q.initialValue.slice(0,1):!this.multiple&&this.options.length>0&&(Z=[this.options[0].value]),Z)for(let X of Z){let J=$.findIndex((Q)=>Q.value===X);J!==-1&&(this.toggleSelected(X),this.#q=J)}this.focusedValue=this.options[this.#q]?.value,this.on("key",(X,J)=>this.#J(X,J)),this.on("userInput",(X)=>this.#Q(X))}_isActionKey(q,$){return q==="\t"||this.multiple&&this.isNavigating&&$.name==="space"&&q!==void 0&&q!==""}#J(q,$){let Z=$.name==="up",X=$.name==="down",J=$.name==="return";Z||X?(this.#q=Math.max(0,Math.min(this.#q+(Z?-1:1),this.filteredOptions.length-1)),this.focusedValue=this.filteredOptions[this.#q]?.value,this.multiple||(this.selectedValues=[this.focusedValue]),this.isNavigating=!0):J?this.value=PG(this.multiple,this.selectedValues):this.multiple?this.focusedValue!==void 0&&($.name==="tab"||this.isNavigating&&$.name==="space")?this.toggleSelected(this.focusedValue):this.isNavigating=!1:(this.focusedValue&&(this.selectedValues=[this.focusedValue]),this.isNavigating=!1)}deselectAll(){this.selectedValues=[]}toggleSelected(q){this.filteredOptions.length!==0&&(this.multiple?this.selectedValues.includes(q)?this.selectedValues=this.selectedValues.filter(($)=>$!==q):this.selectedValues=[...this.selectedValues,q]:this.selectedValues=[q])}#Q(q){if(q!==this.#Z){this.#Z=q;let $=this.options;q?this.filteredOptions=$.filter((Z)=>this.#X(q,Z)):this.filteredOptions=[...$],this.#q=DG(this.focusedValue,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#q]?.value,this.multiple||(this.focusedValue!==void 0?this.toggleSelected(this.focusedValue):this.deselectAll())}}}class u$ extends I0{options;cursor=0;#q;getGroupItems(q){return this.options.filter(($)=>$.group===q)}isGroupSelected(q){let $=this.getGroupItems(q),Z=this.value;return Z===void 0?!1:$.every((X)=>Z.includes(X.value))}toggleValue(){let q=this.options[this.cursor];if(this.value===void 0&&(this.value=[]),q.group===!0){let $=q.value,Z=this.getGroupItems($);this.isGroupSelected($)?this.value=this.value.filter((X)=>Z.findIndex((J)=>J.value===X)===-1):this.value=[...this.value,...Z.map((X)=>X.value)],this.value=Array.from(new Set(this.value))}else{let $=this.value.includes(q.value);this.value=$?this.value.filter((Z)=>Z!==q.value):[...this.value,q.value]}}constructor(q){super(q,!1);let{options:$}=q;this.#q=q.selectableGroups!==!1,this.options=Object.entries($).flatMap(([Z,X])=>[{value:Z,group:!0,label:Z},...X.map((J)=>({...J,group:Z}))]),this.value=[...q.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:Z})=>Z===q.cursorAt),this.#q?0:1),this.on("cursor",(Z)=>{switch(Z){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;let X=this.options[this.cursor]?.group===!0;!this.#q&&X&&(this.cursor=this.cursor===0?this.options.length-1:this.cursor-1);break}case"down":case"right":{this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;let X=this.options[this.cursor]?.group===!0;!this.#q&&X&&(this.cursor=this.cursor===this.options.length-1?0:this.cursor+1);break}case"space":this.toggleValue();break}})}}function O1(q,$,Z){let X=q+$,J=Math.max(Z.length-1,0),Q=X<0?J:X>J?0:X;return Z[Q].disabled?O1(Q,$<0?-1:1,Z):Q}class N4 extends I0{options;cursor=0;get _value(){return this.options[this.cursor].value}get _enabledOptions(){return this.options.filter((q)=>q.disabled!==!0)}toggleAll(){let q=this._enabledOptions,$=this.value!==void 0&&this.value.length===q.length;this.value=$?[]:q.map((Z)=>Z.value)}toggleInvert(){let q=this.value;if(!q)return;let $=this._enabledOptions.filter((Z)=>!q.includes(Z.value));this.value=$.map((Z)=>Z.value)}toggleValue(){this.value===void 0&&(this.value=[]);let q=this.value.includes(this._value);this.value=q?this.value.filter(($)=>$!==this._value):[...this.value,this._value]}constructor(q){super(q,!1),this.options=q.options,this.value=[...q.initialValues??[]];let $=Math.max(this.options.findIndex(({value:Z})=>Z===q.cursorAt),0);this.cursor=this.options[$].disabled?O1($,1,this.options):$,this.on("key",(Z)=>{Z==="a"&&this.toggleAll(),Z==="i"&&this.toggleInvert()}),this.on("cursor",(Z)=>{switch(Z){case"left":case"up":this.cursor=O1(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=O1(this.cursor,1,this.options);break;case"space":this.toggleValue();break}})}}class S4 extends I0{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(q){super(q,!1),this.options=q.options;let $=this.options.findIndex(({value:X})=>X===q.initialValue),Z=$===-1?0:$;this.cursor=this.options[Z].disabled?O1(Z,1,this.options):Z,this.changeValue(),this.on("cursor",(X)=>{switch(X){case"left":case"up":this.cursor=O1(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=O1(this.cursor,1,this.options);break}this.changeValue()})}}var F=l1(L4(),1);import p from"node:process";var a$=l1(W4(),1);function KG(){return p.platform!=="win32"?p.env.TERM!=="linux":!!p.env.CI||!!p.env.WT_SESSION||!!p.env.TERMINUS_SUBLIME||p.env.ConEmuTask==="{cmd::Cmder}"||p.env.TERM_PROGRAM==="Terminus-Sublime"||p.env.TERM_PROGRAM==="vscode"||p.env.TERM==="xterm-256color"||p.env.TERM==="alacritty"||p.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var FG=KG();var j=(q,$)=>FG?q:$,OG=j("◆","*"),NG=j("■","x"),SG=j("▲","x"),i$=j("◇","o"),AG=j("┌","T"),f=j("│","|"),D0=j("└","—"),uT=j("┐","T"),mT=j("┘","—"),wG=j("●",">"),m$=j("○"," "),bG=j("◻","[•]"),l$=j("◼","[+]"),d$=j("◻","[ ]"),lT=j("▪","•"),dT=j("─","-"),pT=j("╮","+"),cT=j("├","+"),sT=j("╯","+"),aT=j("╰","+"),iT=j("╭","+"),jG=j("●","•"),CG=j("◆","*"),EG=j("▲","!"),fG=j("■","x"),n$=(q)=>{switch(q){case"initial":case"active":return F.default.cyan(OG);case"cancel":return F.default.red(NG);case"error":return F.default.yellow(SG);case"submit":return F.default.green(i$)}},r$=(q)=>{switch(q){case"initial":case"active":return F.default.cyan(f);case"cancel":return F.default.red(f);case"error":return F.default.yellow(f);case"submit":return F.default.green(f)}},yG=(q)=>q===161||q===164||q===167||q===168||q===170||q===173||q===174||q>=176&&q<=180||q>=182&&q<=186||q>=188&&q<=191||q===198||q===208||q===215||q===216||q>=222&&q<=225||q===230||q>=232&&q<=234||q===236||q===237||q===240||q===242||q===243||q>=247&&q<=250||q===252||q===254||q===257||q===273||q===275||q===283||q===294||q===295||q===299||q>=305&&q<=307||q===312||q>=319&&q<=322||q===324||q>=328&&q<=331||q===333||q===338||q===339||q===358||q===359||q===363||q===462||q===464||q===466||q===468||q===470||q===472||q===474||q===476||q===593||q===609||q===708||q===711||q>=713&&q<=715||q===717||q===720||q>=728&&q<=731||q===733||q===735||q>=768&&q<=879||q>=913&&q<=929||q>=931&&q<=937||q>=945&&q<=961||q>=963&&q<=969||q===1025||q>=1040&&q<=1103||q===1105||q===8208||q>=8211&&q<=8214||q===8216||q===8217||q===8220||q===8221||q>=8224&&q<=8226||q>=8228&&q<=8231||q===8240||q===8242||q===8243||q===8245||q===8251||q===8254||q===8308||q===8319||q>=8321&&q<=8324||q===8364||q===8451||q===8453||q===8457||q===8467||q===8470||q===8481||q===8482||q===8486||q===8491||q===8531||q===8532||q>=8539&&q<=8542||q>=8544&&q<=8555||q>=8560&&q<=8569||q===8585||q>=8592&&q<=8601||q===8632||q===8633||q===8658||q===8660||q===8679||q===8704||q===8706||q===8707||q===8711||q===8712||q===8715||q===8719||q===8721||q===8725||q===8730||q>=8733&&q<=8736||q===8739||q===8741||q>=8743&&q<=8748||q===8750||q>=8756&&q<=8759||q===8764||q===8765||q===8776||q===8780||q===8786||q===8800||q===8801||q>=8804&&q<=8807||q===8810||q===8811||q===8814||q===8815||q===8834||q===8835||q===8838||q===8839||q===8853||q===8857||q===8869||q===8895||q===8978||q>=9312&&q<=9449||q>=9451&&q<=9547||q>=9552&&q<=9587||q>=9600&&q<=9615||q>=9618&&q<=9621||q===9632||q===9633||q>=9635&&q<=9641||q===9650||q===9651||q===9654||q===9655||q===9660||q===9661||q===9664||q===9665||q>=9670&&q<=9672||q===9675||q>=9678&&q<=9681||q>=9698&&q<=9701||q===9711||q===9733||q===9734||q===9737||q===9742||q===9743||q===9756||q===9758||q===9792||q===9794||q===9824||q===9825||q>=9827&&q<=9829||q>=9831&&q<=9834||q===9836||q===9837||q===9839||q===9886||q===9887||q===9919||q>=9926&&q<=9933||q>=9935&&q<=9939||q>=9941&&q<=9953||q===9955||q===9960||q===9961||q>=9963&&q<=9969||q===9972||q>=9974&&q<=9977||q===9979||q===9980||q===9982||q===9983||q===10045||q>=10102&&q<=10111||q>=11094&&q<=11097||q>=12872&&q<=12879||q>=57344&&q<=63743||q>=65024&&q<=65039||q===65533||q>=127232&&q<=127242||q>=127248&&q<=127277||q>=127280&&q<=127337||q>=127344&&q<=127373||q===127375||q===127376||q>=127387&&q<=127404||q>=917760&&q<=917999||q>=983040&&q<=1048573||q>=1048576&&q<=1114109,xG=(q)=>q===12288||q>=65281&&q<=65376||q>=65504&&q<=65510,kG=(q)=>q>=4352&&q<=4447||q===8986||q===8987||q===9001||q===9002||q>=9193&&q<=9196||q===9200||q===9203||q===9725||q===9726||q===9748||q===9749||q>=9800&&q<=9811||q===9855||q===9875||q===9889||q===9898||q===9899||q===9917||q===9918||q===9924||q===9925||q===9934||q===9940||q===9962||q===9970||q===9971||q===9973||q===9978||q===9981||q===9989||q===9994||q===9995||q===10024||q===10060||q===10062||q>=10067&&q<=10069||q===10071||q>=10133&&q<=10135||q===10160||q===10175||q===11035||q===11036||q===11088||q===11093||q>=11904&&q<=11929||q>=11931&&q<=12019||q>=12032&&q<=12245||q>=12272&&q<=12287||q>=12289&&q<=12350||q>=12353&&q<=12438||q>=12441&&q<=12543||q>=12549&&q<=12591||q>=12593&&q<=12686||q>=12688&&q<=12771||q>=12783&&q<=12830||q>=12832&&q<=12871||q>=12880&&q<=19903||q>=19968&&q<=42124||q>=42128&&q<=42182||q>=43360&&q<=43388||q>=44032&&q<=55203||q>=63744&&q<=64255||q>=65040&&q<=65049||q>=65072&&q<=65106||q>=65108&&q<=65126||q>=65128&&q<=65131||q>=94176&&q<=94180||q===94192||q===94193||q>=94208&&q<=100343||q>=100352&&q<=101589||q>=101632&&q<=101640||q>=110576&&q<=110579||q>=110581&&q<=110587||q===110589||q===110590||q>=110592&&q<=110882||q===110898||q>=110928&&q<=110930||q===110933||q>=110948&&q<=110951||q>=110960&&q<=111355||q===126980||q===127183||q===127374||q>=127377&&q<=127386||q>=127488&&q<=127490||q>=127504&&q<=127547||q>=127552&&q<=127560||q===127568||q===127569||q>=127584&&q<=127589||q>=127744&&q<=127776||q>=127789&&q<=127797||q>=127799&&q<=127868||q>=127870&&q<=127891||q>=127904&&q<=127946||q>=127951&&q<=127955||q>=127968&&q<=127984||q===127988||q>=127992&&q<=128062||q===128064||q>=128066&&q<=128252||q>=128255&&q<=128317||q>=128331&&q<=128334||q>=128336&&q<=128359||q===128378||q===128405||q===128406||q===128420||q>=128507&&q<=128591||q>=128640&&q<=128709||q===128716||q>=128720&&q<=128722||q>=128725&&q<=128727||q>=128732&&q<=128735||q===128747||q===128748||q>=128756&&q<=128764||q>=128992&&q<=129003||q===129008||q>=129292&&q<=129338||q>=129340&&q<=129349||q>=129351&&q<=129535||q>=129648&&q<=129660||q>=129664&&q<=129672||q>=129680&&q<=129725||q>=129727&&q<=129733||q>=129742&&q<=129755||q>=129760&&q<=129768||q>=129776&&q<=129784||q>=131072&&q<=196605||q>=196608&&q<=262141,A4=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,Aq=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,wq=/\t{1,1000}/y,w4=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,bq=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,gG=/\p{M}+/gu,vG={limit:1/0,ellipsis:""},o$=(q,$={},Z={})=>{let X=$.limit??1/0,J=$.ellipsis??"",Q=$?.ellipsisWidth??(J?o$(J,vG,Z).width:0),U=Z.ansiWidth??0,H=Z.controlWidth??0,z=Z.tabWidth??8,G=Z.ambiguousWidth??1,B=Z.emojiWidth??2,Y=Z.fullWidthWidth??2,L=Z.regularWidth??1,R=Z.wideWidth??2,W=0,T=0,_=q.length,V=0,D=!1,P=_,O=Math.max(0,X-Q),N=0,S=0,M=0,I=0;q:for(;;){if(S>N||T>=_&&T>W){let w=q.slice(N,S)||q.slice(W,T);V=0;for(let y of w.replaceAll(gG,"")){let x=y.codePointAt(0)||0;if(xG(x)?I=Y:kG(x)?I=R:G!==L&&yG(x)?I=G:I=L,M+I>O&&(P=Math.min(P,Math.max(N,W)+V)),M+I>X){D=!0;break q}V+=y.length,M+=I}N=S=0}if(T>=_)break;if(bq.lastIndex=T,bq.test(q)){if(V=bq.lastIndex-T,I=V*L,M+I>O&&(P=Math.min(P,T+Math.floor((O-M)/L))),M+I>X){D=!0;break}M+=I,N=W,S=T,T=W=bq.lastIndex;continue}if(A4.lastIndex=T,A4.test(q)){if(M+U>O&&(P=Math.min(P,T)),M+U>X){D=!0;break}M+=U,N=W,S=T,T=W=A4.lastIndex;continue}if(Aq.lastIndex=T,Aq.test(q)){if(V=Aq.lastIndex-T,I=V*H,M+I>O&&(P=Math.min(P,T+Math.floor((O-M)/H))),M+I>X){D=!0;break}M+=I,N=W,S=T,T=W=Aq.lastIndex;continue}if(wq.lastIndex=T,wq.test(q)){if(V=wq.lastIndex-T,I=V*z,M+I>O&&(P=Math.min(P,T+Math.floor((O-M)/z))),M+I>X){D=!0;break}M+=I,N=W,S=T,T=W=wq.lastIndex;continue}if(w4.lastIndex=T,w4.test(q)){if(M+B>O&&(P=Math.min(P,T)),M+B>X){D=!0;break}M+=B,N=W,S=T,T=W=w4.lastIndex;continue}T+=1}return{width:D?O:M,index:D?P:_,truncated:D,ellipsed:D&&X>=Q}},hG={limit:1/0,ellipsis:"",ellipsisWidth:0},M0=(q,$={})=>o$(q,hG,$).width,Cq="\x1B",t$="",uG=39,C4="\x07",e$="[",mG="]",q5="m",E4=`${mG}8;;`,p$=new RegExp(`(?:\\${e$}(?<code>\\d+)m|\\${E4}(?<uri>.*)${C4})`,"y"),lG=(q)=>{if(q>=30&&q<=37||q>=90&&q<=97)return 39;if(q>=40&&q<=47||q>=100&&q<=107)return 49;if(q===1||q===2)return 22;if(q===3)return 23;if(q===4)return 24;if(q===7)return 27;if(q===8)return 28;if(q===9)return 29;if(q===0)return 0},c$=(q)=>`${Cq}${e$}${q}${q5}`,s$=(q)=>`${Cq}${E4}${q}${C4}`,dG=(q)=>q.map(($)=>M0($)),b4=(q,$,Z)=>{let X=$[Symbol.iterator](),J=!1,Q=!1,U=q.at(-1),H=U===void 0?0:M0(U),z=X.next(),G=X.next(),B=0;for(;!z.done;){let Y=z.value,L=M0(Y);H+L<=Z?q[q.length-1]+=Y:(q.push(Y),H=0),(Y===Cq||Y===t$)&&(J=!0,Q=$.startsWith(E4,B+1)),J?Q?Y===C4&&(J=!1,Q=!1):Y===q5&&(J=!1):(H+=L,H===Z&&!G.done&&(q.push(""),H=0)),z=G,G=X.next(),B+=Y.length}U=q.at(-1),!H&&U!==void 0&&U.length>0&&q.length>1&&(q[q.length-2]+=q.pop())},pG=(q)=>{let $=q.split(" "),Z=$.length;for(;Z>0&&!(M0($[Z-1])>0);)Z--;return Z===$.length?q:$.slice(0,Z).join(" ")+$.slice(Z).join("")},cG=(q,$,Z={})=>{if(Z.trim!==!1&&q.trim()==="")return"";let X="",J,Q,U=q.split(" "),H=dG(U),z=[""];for(let[W,T]of U.entries()){Z.trim!==!1&&(z[z.length-1]=(z.at(-1)??"").trimStart());let _=M0(z.at(-1)??"");if(W!==0&&(_>=$&&(Z.wordWrap===!1||Z.trim===!1)&&(z.push(""),_=0),(_>0||Z.trim===!1)&&(z[z.length-1]+=" ",_++)),Z.hard&&H[W]>$){let V=$-_,D=1+Math.floor((H[W]-V-1)/$);Math.floor((H[W]-1)/$)<D&&z.push(""),b4(z,T,$);continue}if(_+H[W]>$&&_>0&&H[W]>0){if(Z.wordWrap===!1&&_<$){b4(z,T,$);continue}z.push("")}if(_+H[W]>$&&Z.wordWrap===!1){b4(z,T,$);continue}z[z.length-1]+=T}Z.trim!==!1&&(z=z.map((W)=>pG(W)));let G=z.join(`
|
|
189
|
+
`),B=G[Symbol.iterator](),Y=B.next(),L=B.next(),R=0;for(;!Y.done;){let W=Y.value,T=L.value;if(X+=W,W===Cq||W===t$){p$.lastIndex=R+1;let V=p$.exec(G)?.groups;if(V?.code!==void 0){let D=Number.parseFloat(V.code);J=D===uG?void 0:D}else V?.uri!==void 0&&(Q=V.uri.length===0?void 0:V.uri)}let _=J?lG(J):void 0;T===`
|
|
190
|
+
`?(Q&&(X+=s$("")),J&&_&&(X+=c$(_))):W===`
|
|
191
|
+
`&&(J&&_&&(X+=c$(J)),Q&&(X+=s$(Q))),R+=W.length,Y=L,L=B.next()}return X};function sG(q,$,Z){return String(q).normalize().replaceAll(`\r
|
|
191
192
|
`,`
|
|
192
193
|
`).split(`
|
|
193
|
-
`).map((
|
|
194
|
-
`)}var
|
|
195
|
-
`);
|
|
196
|
-
`);if(Y.length>0){let[
|
|
194
|
+
`).map((X)=>cG(X,$,Z)).join(`
|
|
195
|
+
`)}var aG=(q,$,Z,X,J)=>{let Q=$,U=0;for(let H=Z;H<X;H++){let z=q[H];if(Q=Q-z.length,U++,Q<=J)break}return{lineCount:Q,removals:U}},j4=(q)=>{let{cursor:$,options:Z,style:X}=q,J=q.output??process.stdout,Q=F4(J),U=q.columnPadding??0,H=q.rowPadding??4,z=Q-U,G=O4(J),B=F.default.dim("..."),Y=q.maxItems??Number.POSITIVE_INFINITY,L=Math.max(G-H,0),R=Math.max(Math.min(Y,L),5),W=0;$>=R-3&&(W=Math.max(Math.min($-R+3,Z.length-R),0));let T=R<Z.length&&W>0,_=R<Z.length&&W+R<Z.length,V=Math.min(W+R,Z.length),D=[],P=0;T&&P++,_&&P++;let O=W+(T?1:0),N=V-(_?1:0);for(let M=O;M<N;M++){let I=sG(X(Z[M],M===$),z,{hard:!0,trim:!1}).split(`
|
|
196
|
+
`);D.push(I),P+=I.length}if(P>L){let M=0,I=0,w=P,y=$-O,x=(C,O0)=>aG(D,w,C,O0,L);T?({lineCount:w,removals:M}=x(0,y),w>L&&({lineCount:w,removals:I}=x(y+1,D.length))):({lineCount:w,removals:I}=x(y+1,D.length),w>L&&({lineCount:w,removals:M}=x(0,y))),M>0&&(T=!0,D.splice(0,M)),I>0&&(_=!0,D.splice(D.length-I,I))}let S=[];T&&S.push(B);for(let M of D)for(let I of M)S.push(I);return _&&S.push(B),S};var T1={message:(q=[],{symbol:$=F.default.gray(f),secondarySymbol:Z=F.default.gray(f),output:X=process.stdout,spacing:J=1,withGuide:Q}={})=>{let U=[],H=(Q??F1.withGuide)!==!1,z=H?Z:"",G=H?`${$} `:"",B=H?`${Z} `:"";for(let L=0;L<J;L++)U.push(z);let Y=Array.isArray(q)?q:q.split(`
|
|
197
|
+
`);if(Y.length>0){let[L,...R]=Y;L.length>0?U.push(`${G}${L}`):U.push(H?$:"");for(let W of R)W.length>0?U.push(`${B}${W}`):U.push(H?Z:"")}X.write(`${U.join(`
|
|
197
198
|
`)}
|
|
198
|
-
`)},info:(q
|
|
199
|
+
`)},info:(q,$)=>{T1.message(q,{...$,symbol:F.default.blue(jG)})},success:(q,$)=>{T1.message(q,{...$,symbol:F.default.green(CG)})},step:(q,$)=>{T1.message(q,{...$,symbol:F.default.green(i$)})},warn:(q,$)=>{T1.message(q,{...$,symbol:F.default.yellow(EG)})},warning:(q,$)=>{T1.warn(q,$)},error:(q,$)=>{T1.message(q,{...$,symbol:F.default.red(fG)})}},Eq=(q="",$)=>{($?.output??process.stdout).write(`${F.default.gray(D0)} ${F.default.red(q)}
|
|
199
200
|
|
|
200
|
-
`)}
|
|
201
|
-
`)},
|
|
202
|
-
${F.default.gray(
|
|
201
|
+
`)},$5=(q="",$)=>{($?.output??process.stdout).write(`${F.default.gray(AG)} ${q}
|
|
202
|
+
`)},Z5=(q="",$)=>{($?.output??process.stdout).write(`${F.default.gray(f)}
|
|
203
|
+
${F.default.gray(D0)} ${q}
|
|
203
204
|
|
|
204
|
-
`)},
|
|
205
|
-
`).map((
|
|
206
|
-
`),
|
|
207
|
-
${F.default.reset(F.default.dim(`Press ${F.default.gray(F.default.bgWhite(F.default.inverse(" space ")))} to select, ${F.default.gray(F.default.bgWhite(F.default.inverse(" enter ")))} to submit`))}`},render(){let
|
|
208
|
-
${
|
|
209
|
-
`,Q=this.value??[],
|
|
210
|
-
${F.default.gray(f)}`}case"error":{let
|
|
211
|
-
`).map((Y,
|
|
212
|
-
`),G
|
|
213
|
-
`).length,
|
|
214
|
-
`).length+1;return`${
|
|
215
|
-
${z}`)}
|
|
216
|
-
${U}
|
|
217
|
-
`}default:{let z=`${F.default.cyan(f)} `,U=$.split(`
|
|
218
|
-
`).length;return`${$}${z}${A4({output:q.output,options:this.options,cursor:this.cursor,maxItems:q.maxItems,columnPadding:z.length,rowPadding:U+2,style:H}).join(`
|
|
219
|
-
${z}`)}
|
|
220
|
-
${F.default.cyan(I0)}
|
|
221
|
-
`}}}}).prompt()};var yT=F.default.magenta;var xT={light:j("─","-"),heavy:j("━","="),block:j("█","#")};var bq=(q,Z)=>q.includes(`
|
|
222
|
-
`)?q.split(`
|
|
223
|
-
`).map((X)=>Z(X)).join(`
|
|
224
|
-
`):Z(q),j4=(q)=>{let Z=(X,J)=>{let $=X.label??String(X.value);switch(J){case"disabled":return`${F.default.gray(v5)} ${bq($,F.default.gray)}${X.hint?` ${F.default.dim(`(${X.hint??"disabled"})`)}`:""}`;case"selected":return`${bq($,F.default.dim)}`;case"active":return`${F.default.green(WG)} ${$}${X.hint?` ${F.default.dim(`(${X.hint})`)}`:""}`;case"cancelled":return`${bq($,(Q)=>F.default.strikethrough(F.default.dim(Q)))}`;default:return`${F.default.dim(v5)} ${bq($,F.default.dim)}`}};return new F4({options:q.options,signal:q.signal,input:q.input,output:q.output,initialValue:q.initialValue,render(){let X=`${c5(this.state)} `,J=`${i5(this.state)} `,$=N1(q.output,q.message,J,X),Q=`${F.default.gray(f)}
|
|
225
|
-
${$}
|
|
226
|
-
`;switch(this.state){case"submit":{let H=`${F.default.gray(f)} `,z=N1(q.output,Z(this.options[this.cursor],"selected"),H);return`${Q}${z}`}case"cancel":{let H=`${F.default.gray(f)} `,z=N1(q.output,Z(this.options[this.cursor],"cancelled"),H);return`${Q}${z}
|
|
227
|
-
${F.default.gray(f)}`}default:{let H=`${F.default.cyan(f)} `,z=Q.split(`
|
|
228
|
-
`).length;return`${Q}${H}${A4({output:q.output,cursor:this.cursor,options:this.options,maxItems:q.maxItems,columnPadding:H.length,rowPadding:z+2,style:(U,G)=>Z(U,U.disabled?"disabled":G?"active":"inactive")}).join(`
|
|
205
|
+
`)},V0=(q,$)=>q.split(`
|
|
206
|
+
`).map((Z)=>$(Z)).join(`
|
|
207
|
+
`),P0=(q)=>{let $=(X,J)=>{let Q=X.label??String(X.value);return J==="disabled"?`${F.default.gray(d$)} ${V0(Q,(U)=>F.default.strikethrough(F.default.gray(U)))}${X.hint?` ${F.default.dim(`(${X.hint??"disabled"})`)}`:""}`:J==="active"?`${F.default.cyan(bG)} ${Q}${X.hint?` ${F.default.dim(`(${X.hint})`)}`:""}`:J==="selected"?`${F.default.green(l$)} ${V0(Q,F.default.dim)}${X.hint?` ${F.default.dim(`(${X.hint})`)}`:""}`:J==="cancelled"?`${V0(Q,(U)=>F.default.strikethrough(F.default.dim(U)))}`:J==="active-selected"?`${F.default.green(l$)} ${Q}${X.hint?` ${F.default.dim(`(${X.hint})`)}`:""}`:J==="submitted"?`${V0(Q,F.default.dim)}`:`${F.default.dim(d$)} ${V0(Q,F.default.dim)}`},Z=q.required??!0;return new N4({options:q.options,signal:q.signal,input:q.input,output:q.output,initialValues:q.initialValues,required:Z,cursorAt:q.cursorAt,validate(X){if(Z&&(X===void 0||X.length===0))return`Please select at least one option.
|
|
208
|
+
${F.default.reset(F.default.dim(`Press ${F.default.gray(F.default.bgWhite(F.default.inverse(" space ")))} to select, ${F.default.gray(F.default.bgWhite(F.default.inverse(" enter ")))} to submit`))}`},render(){let X=N1(q.output,q.message,`${r$(this.state)} `,`${n$(this.state)} `),J=`${F.default.gray(f)}
|
|
209
|
+
${X}
|
|
210
|
+
`,Q=this.value??[],U=(H,z)=>{if(H.disabled)return $(H,"disabled");let G=Q.includes(H.value);return z&&G?$(H,"active-selected"):G?$(H,"selected"):$(H,z?"active":"inactive")};switch(this.state){case"submit":{let H=this.options.filter(({value:G})=>Q.includes(G)).map((G)=>$(G,"submitted")).join(F.default.dim(", "))||F.default.dim("none"),z=N1(q.output,H,`${F.default.gray(f)} `);return`${J}${z}`}case"cancel":{let H=this.options.filter(({value:G})=>Q.includes(G)).map((G)=>$(G,"cancelled")).join(F.default.dim(", "));if(H.trim()==="")return`${J}${F.default.gray(f)}`;let z=N1(q.output,H,`${F.default.gray(f)} `);return`${J}${z}
|
|
211
|
+
${F.default.gray(f)}`}case"error":{let H=`${F.default.yellow(f)} `,z=this.error.split(`
|
|
212
|
+
`).map((Y,L)=>L===0?`${F.default.yellow(D0)} ${F.default.yellow(Y)}`:` ${Y}`).join(`
|
|
213
|
+
`),G=J.split(`
|
|
214
|
+
`).length,B=z.split(`
|
|
215
|
+
`).length+1;return`${J}${H}${j4({output:q.output,options:this.options,cursor:this.cursor,maxItems:q.maxItems,columnPadding:H.length,rowPadding:G+B,style:U}).join(`
|
|
229
216
|
${H}`)}
|
|
230
|
-
${
|
|
231
|
-
`}}}}).prompt()};var kT=`${F.default.gray(f)} `;var yG=[{name:"pi",displayName:"Pi",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.pi/agent/skills",globalAgents:"~/.pi/agent/agents",isUniversal:!0,legacyProjectPaths:{skills:".pi/skills",agents:".pi/agents"}},{name:"claude-code",displayName:"Claude Code",projectSkills:".claude/skills",projectAgents:".claude/agents",globalSkills:"~/.claude/skills",globalAgents:"~/.claude/agents",isUniversal:!1},{name:"cursor",displayName:"Cursor",projectSkills:".cursor/skills",projectAgents:".cursor/agents",globalSkills:"~/.cursor/skills",globalAgents:"~/.cursor/agents",isUniversal:!1},{name:"roo",displayName:"Roo",projectSkills:".roo/skills",projectAgents:".roo/agents",globalSkills:"~/.roo/skills",globalAgents:"~/.roo/agents",isUniversal:!1},{name:"cline",displayName:"Cline",projectSkills:".cline/skills",projectAgents:".cline/agents",globalSkills:"~/.cline/skills",globalAgents:"~/.cline/agents",isUniversal:!1},{name:"windsurf",displayName:"Windsurf",projectSkills:".windsurf/skills",projectAgents:".windsurf/agents",globalSkills:"~/.windsurf/skills",globalAgents:"~/.windsurf/agents",isUniversal:!1},{name:"opencode",displayName:"OpenCode",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/opencode/skills",globalAgents:"~/.config/opencode/agents",isUniversal:!0,legacyProjectPaths:{skills:".opencode/skills",agents:".opencode/agents"}},{name:"codex",displayName:"Codex",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/codex/skills",globalAgents:"~/.config/codex/agents",isUniversal:!0},{name:"amp",displayName:"Amp",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/amp/skills",globalAgents:"~/.config/amp/agents",isUniversal:!0},{name:"gemini-cli",displayName:"Gemini CLI",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/gemini-cli/skills",globalAgents:"~/.config/gemini-cli/agents",isUniversal:!0},{name:"github-copilot",displayName:"GitHub Copilot",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/github-copilot/skills",globalAgents:"~/.config/github-copilot/agents",isUniversal:!0},{name:"kimi-cli",displayName:"Kimi CLI",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/kimi-cli/skills",globalAgents:"~/.config/kimi-cli/agents",isUniversal:!0}],g1=[...yG];function E4(q){return g1.find((Z)=>Z.name===q)}function q6(){return g1.filter((q)=>q.isUniversal)}function Z6(){return g1.filter((q)=>!q.isUniversal)}function X6(q){let Z=new Set,X=[];for(let J of q){let $=E4(J);if(!$?.legacyProjectPaths)continue;let Q=`${$.legacyProjectPaths.skills}|${$.legacyProjectPaths.agents}`;if(Z.has(Q))continue;Z.add(Q),X.push($.legacyProjectPaths)}return X}function J6(q){return q.filter((Z)=>!E4(Z))}function $6(q){let Z=new Map;for(let X of q){let J=E4(X);if(!J)continue;let $=`${J.projectSkills}|${J.projectAgents}|${J.globalSkills}|${J.globalAgents}`,Q=Z.get($);if(Q)Q.displayNames.push(J.displayName);else Z.set($,{projectSkills:J.projectSkills,projectAgents:J.projectAgents,globalSkills:J.globalSkills,globalAgents:J.globalAgents,displayNames:[J.displayName]})}return Array.from(Z.values())}function Cq(q){let Z=new Set(Object.keys(q));g1=g1.filter((X)=>!Z.has(X.name));for(let[X,J]of Object.entries(q))g1.push({name:X,displayName:X,projectSkills:J.project_skills,projectAgents:J.project_agents,globalSkills:J.global_skills,globalAgents:J.global_agents,isUniversal:!1})}function Q6(){return process.stdin.isTTY===!0}async function D0(q={}){let{defaults:Z}=q;o5("⚙️ agentdeps setup");let X=await j4({message:"How do you clone git repositories?",options:[{value:"ssh",label:"SSH (git@github.com:...)"},{value:"https",label:"HTTPS (https://github.com/...)"}],initialValue:Z?.clone_method??"ssh"});if(q1(X)){Eq("Setup cancelled.");return}let J=q6(),$=Z6(),Q=[];for(let U of $)Q.push({value:U.name,label:`${U.displayName}`,hint:`${U.projectSkills}, ${U.projectAgents}`});for(let U of J)Q.push({value:U.name,label:`${U.displayName}`,hint:".agents/skills, .agents/agents (Universal)"});let H=await K0({message:"Which coding agents do you use? (space to select, enter to confirm)",options:Q,initialValues:Z?.agents??[],required:!0});if(q1(H)){Eq("Setup cancelled.");return}if(H.length===0)return B1.error("At least one agent must be selected."),D0(q);let z=await j4({message:"How should dependencies be installed?",options:[{value:"link",label:"Link (symlinks)",hint:"Fast, no duplication — default"},{value:"copy",label:"Copy (smart sync)",hint:"Portable, self-contained"}],initialValue:Z?.install_method??"link"});if(q1(z)){Eq("Setup cancelled.");return}return t5("✅ Configuration saved!"),{clone_method:X,agents:H,install_method:z,custom_agents:Z?.custom_agents}}import{join as u4}from"node:path";import{mkdir as xG,readFile as kG,writeFile as vG,access as hG}from"node:fs/promises";import{dirname as gG}from"node:path";function uG(q,Z){if(!q.repo)throw Error(`Dependency at index ${Z} is missing required 'repo' field`);let X;if(q.skills===void 0||q.skills==="*"||q.skills===!0)X="*";else if(q.skills===!1)X=!1;else if(Array.isArray(q.skills))X=q.skills;else rq("config.normalize",`Dependency "${q.repo}" has unexpected skills value (${JSON.stringify(q.skills)}), defaulting to "*"`),X="*";let J;if(q.agents===void 0||q.agents==="*"||q.agents===!0)J="*";else if(q.agents===!1)J=!1;else if(Array.isArray(q.agents))J=q.agents;else rq("config.normalize",`Dependency "${q.repo}" has unexpected agents value (${JSON.stringify(q.agents)}), defaulting to "*"`),J="*";return{repo:q.repo,ref:q.ref??"main",skills:X,agents:J}}async function c(q){try{return await hG(q),!0}catch{return!1}}async function i(q){let Z=await kG(q,"utf-8"),X=_0(Z);if(!X||!X.dependencies){if(X&&!X.dependencies)console.warn("⚠ agents.yaml has no 'dependencies' field");return{dependencies:[]}}let J=X.dependencies;if(!Array.isArray(J))throw Error("'dependencies' must be an array in agents.yaml");if(J.length===0)return console.warn("⚠ agents.yaml has an empty dependencies list"),{dependencies:[]};return{dependencies:J.map((Q,H)=>uG(Q,H))}}async function fq(q,Z){let X=gG(q);await xG(X,{recursive:!0});let J={dependencies:Z.dependencies.map((Q)=>{let H={repo:Q.repo};if(Q.ref!=="main")H.ref=Q.ref;if(Q.skills!=="*")H.skills=Q.skills;if(Q.agents!=="*")H.agents=Q.agents;return H})},$=W0(J,{lineWidth:0});await vG(q,$,"utf-8")}function mG(q){if(q.includes("://"))return!1;if(q.startsWith("git@"))return!1;return q.split("/").length-1===1}function dG(q,Z){if(Z==="ssh")return`git@github.com:${q}.git`;return`https://github.com/${q}.git`}function yq(q,Z){if(mG(q))return dG(q,Z);return q}function xq(q,Z){let X;if(q.startsWith("git@")){let $=q.indexOf(":");X=q.slice($+1)}else if(q.includes("://"))try{X=new URL(q).pathname.slice(1)}catch{X=q}else X=q;if(X.endsWith(".git"))X=X.slice(0,-4);return`${X.replace(/\//g,"-")}-${Z}`}import{readdir as H6,access as lG}from"node:fs/promises";import{join as u1}from"node:path";async function kq(q){let Z=u1(q,"skills");try{let J=(await H6(Z,{withFileTypes:!0})).filter((Q)=>Q.isDirectory());return(await Promise.all(J.map(async(Q)=>{let H;try{await lG(u1(Z,Q.name,"SKILL.md")),H=!0}catch{H=!1}return H?{name:Q.name,sourcePath:u1(Z,Q.name)}:null}))).filter((Q)=>Q!==null).sort((Q,H)=>Q.name.localeCompare(H.name))}catch{return[]}}async function vq(q){let Z=u1(q,"agents");try{let X=await H6(Z,{withFileTypes:!0}),J=[];for(let $ of X)if($.isDirectory())J.push({name:$.name,sourcePath:u1(Z,$.name)});else if($.isFile()&&$.name.endsWith(".md")){let Q=$.name.replace(/\.md$/,"");J.push({name:Q,sourcePath:u1(Z,$.name)})}return J.sort(($,Q)=>$.name.localeCompare(Q.name))}catch{return[]}}function C4(q,Z){if(Z===!1)return{selected:[],missing:[]};if(Z==="*")return{selected:[...q],missing:[]};let X=new Map(q.map((Q)=>[Q.name,Q])),J=[],$=[];for(let Q of Z){let H=X.get(Q);if(H)J.push(H);else $.push(Q)}return{selected:J,missing:$}}function f4(q,Z,X,J,$){if(J===!1)return;if(X.length===0)console.warn(`⚠ No ${Z} found in ${q}${Z==="skills"?" (no skills/ directory or no SKILL.md files)":" (no agents/ directory)"}`);if($.length>0)console.warn(`⚠ ${Z} not found in ${q}: ${$.join(", ")}`)}import{readdir as T6,mkdir as qY,rm as _6,lstat as ZY,stat as XY}from"node:fs/promises";import{join as v4}from"node:path";import{homedir as JY}from"node:os";import{symlink as pG,readlink as cG,unlink as iG,lstat as z6,rm as aG}from"node:fs/promises";import{platform as sG}from"node:os";import{execFile as rG}from"node:child_process";import{promisify as nG}from"node:util";var oG=nG(rG);async function y4(q,Z){let X=!1;try{X=(await z6(q)).isFile()}catch{}try{await pG(q,Z,X?"file":"dir")}catch(J){if(sG()==="win32"&&!X)try{await oG("cmd",["/c","mklink","/J",Z,q])}catch($){let Q=$ instanceof Error?$.message:String($);throw Error(`Failed to create symlink or junction at ${Z}. Consider switching to install_method: copy, or enable Developer Mode on Windows. Error: ${Q.trim()}`)}else throw J}}async function U6(q,Z){try{if((await z6(Z)).isSymbolicLink()){if(await cG(Z)===q)return"unchanged";return await iG(Z),await y4(q,Z),"replaced"}return await aG(Z,{recursive:!0,force:!0}),await y4(q,Z),"replaced"}catch(X){if(X.code==="ENOENT")return await y4(q,Z),"created";throw X}}import{readdir as G6,mkdir as tG,rm as eG,stat as k4,copyFile as Y6}from"node:fs/promises";import{join as x4}from"node:path";async function hq(q,Z){if((await k4(q)).isFile()){if(await B6(q,Z))await Y6(q,Z);return}await tG(Z,{recursive:!0});let J=await G6(q,{withFileTypes:!0}),$=new Set(J.map((H)=>H.name)),Q=[];try{Q=await G6(Z,{withFileTypes:!0})}catch{}for(let H of Q)if(!$.has(H.name))await eG(x4(Z,H.name),{recursive:!0,force:!0});for(let H of J){let z=x4(q,H.name),U=x4(Z,H.name);if(H.isDirectory())await hq(z,U);else if(H.isFile()){if(await B6(z,U))await Y6(z,U)}}}async function B6(q,Z){try{let[X,J]=await Promise.all([k4(q),k4(Z)]);if(X.size!==J.size)return!0;if(X.mtimeMs>J.mtimeMs)return!0;return!1}catch{return!0}}function h4(q){if(q.startsWith("~/")||q==="~")return v4(JY(),q.slice(1));return q}async function $Y(q,Z){try{if((await XY(Z)).isFile()){let J=Z.match(/(\.[^.]+)$/)?.[1]??"";return q+J}}catch{}return q}async function g4(q,Z,X){let J={added:[],removed:[],unchanged:[]},$=[],Q=!1;try{$=await T6(q),Q=!0}catch{}if(Z.size===0&&!Q)return J;let H=[];for(let[U,G]of Z){let T=await $Y(U,G);H.push({name:U,targetName:T,sourcePath:G})}let z=new Set(H.map((U)=>U.targetName));for(let U of $)if(!z.has(U))await _6(v4(q,U),{recursive:!0,force:!0}),J.removed.push(U);if(Z.size===0){try{if((await T6(q)).length===0)await _6(q,{recursive:!0,force:!0})}catch{}return J}await qY(q,{recursive:!0});for(let{name:U,targetName:G,sourcePath:T}of H){let Y=v4(q,G);if(X==="link"){let _=await U6(T,Y);if(_==="created")J.added.push(U);else if(_==="replaced")J.added.push(U);else J.unchanged.push(U)}else try{await ZY(Y),await hq(T,Y),J.unchanged.push(U)}catch{await hq(T,Y),J.added.push(U)}}return J}import{rm as W6}from"node:fs/promises";import{join as L6}from"node:path";var V6="_agentdeps_managed";async function R6(q){let Z=X6(q);for(let{skills:X,agents:J}of Z)await W6(L6(X,V6),{recursive:!0,force:!0}),await W6(L6(J,V6),{recursive:!0,force:!0})}async function I6(q,Z){let X=await Promise.all(q.map(async($)=>{let Q=yq($.repo,Z),H=xq($.repo,$.ref);console.log(` \uD83D\uDCE6 ${$.repo} (${$.ref})`);let z=await w0(Q,$.ref,H);return{dep:$,result:z}}));return(await Promise.all(X.map(async({dep:$,result:Q})=>{if(!Q.success)return console.error(` ✗ Failed to cache ${$.repo}, skipping`),null;let[H,z]=await Promise.all([kq(Q.path),vq(Q.path)]),U=C4(H,$.skills),G=C4(z,$.agents);return f4($.repo,"skills",H,$.skills,U.missing),f4($.repo,"agents",z,$.agents,G.missing),{repo:$.repo,cachePath:Q.path,skills:U.selected,agents:G.selected}}))).filter(($)=>$!==null)}async function M6(q,Z,X,J){let $=new Map,Q=new Map;for(let U of q){for(let G of U.skills)$.set(G.name,G.sourcePath);for(let G of U.agents)Q.set(G.name,G.sourcePath)}let H=new Map;for(let U of Z){let G=X==="global"?h4(U.globalSkills):U.projectSkills,T=X==="global"?h4(U.globalAgents):U.projectAgents,Y=`${G}|${T}`,_=H.get(Y);if(_)_.displayNames.push(...U.displayNames);else H.set(Y,{skillsDir:G,agentsDir:T,displayNames:[...U.displayNames]})}let z=[];for(let{skillsDir:U,agentsDir:G,displayNames:T}of H.values()){let Y=u4(U,"_agentdeps_managed"),_=u4(G,"_agentdeps_managed"),V=await g4(Y,$,J),L=await g4(_,Q,J);z.push({displayNames:T,skillsAdded:V.added.length,skillsRemoved:V.removed.length,agentsAdded:L.added.length,agentsRemoved:L.removed.length})}return z}function K6(q,Z){if(Z.length===0)return` ✓ ${q}: nothing to do`;if(Z.length===1){let J=Z[0],$=J.skillsRemoved+J.agentsRemoved,Q=[];if(J.skillsAdded>0)Q.push(`${J.skillsAdded} skills added`);if(J.agentsAdded>0)Q.push(`${J.agentsAdded} agents added`);if($>0)Q.push(`${$} removed`);if(Q.length===0)Q.push("up to date");let H=J.displayNames.join(", ");return` ✓ ${q} (${H}): ${Q.join(", ")}`}let X=[];for(let J of Z){let $=J.skillsRemoved+J.agentsRemoved,Q=[];if(J.skillsAdded>0)Q.push(`${J.skillsAdded} skills added`);if(J.agentsAdded>0)Q.push(`${J.agentsAdded} agents added`);if($>0)Q.push(`${$} removed`);if(Q.length===0)Q.push("up to date");let H=J.displayNames.join(", ");X.push(` ${H}: ${Q.join(", ")}`)}return` ✓ ${q}:
|
|
232
|
-
${
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
217
|
+
${z}
|
|
218
|
+
`}default:{let H=`${F.default.cyan(f)} `,z=J.split(`
|
|
219
|
+
`).length;return`${J}${H}${j4({output:q.output,options:this.options,cursor:this.cursor,maxItems:q.maxItems,columnPadding:H.length,rowPadding:z+2,style:U}).join(`
|
|
220
|
+
${H}`)}
|
|
221
|
+
${F.default.cyan(D0)}
|
|
222
|
+
`}}}}).prompt()};var nT=F.default.magenta;var rT={light:j("─","-"),heavy:j("━","="),block:j("█","#")};var jq=(q,$)=>q.includes(`
|
|
223
|
+
`)?q.split(`
|
|
224
|
+
`).map((Z)=>$(Z)).join(`
|
|
225
|
+
`):$(q),f4=(q)=>{let $=(Z,X)=>{let J=Z.label??String(Z.value);switch(X){case"disabled":return`${F.default.gray(m$)} ${jq(J,F.default.gray)}${Z.hint?` ${F.default.dim(`(${Z.hint??"disabled"})`)}`:""}`;case"selected":return`${jq(J,F.default.dim)}`;case"active":return`${F.default.green(wG)} ${J}${Z.hint?` ${F.default.dim(`(${Z.hint})`)}`:""}`;case"cancelled":return`${jq(J,(Q)=>F.default.strikethrough(F.default.dim(Q)))}`;default:return`${F.default.dim(m$)} ${jq(J,F.default.dim)}`}};return new S4({options:q.options,signal:q.signal,input:q.input,output:q.output,initialValue:q.initialValue,render(){let Z=`${n$(this.state)} `,X=`${r$(this.state)} `,J=N1(q.output,q.message,X,Z),Q=`${F.default.gray(f)}
|
|
226
|
+
${J}
|
|
227
|
+
`;switch(this.state){case"submit":{let U=`${F.default.gray(f)} `,H=N1(q.output,$(this.options[this.cursor],"selected"),U);return`${Q}${H}`}case"cancel":{let U=`${F.default.gray(f)} `,H=N1(q.output,$(this.options[this.cursor],"cancelled"),U);return`${Q}${H}
|
|
228
|
+
${F.default.gray(f)}`}default:{let U=`${F.default.cyan(f)} `,H=Q.split(`
|
|
229
|
+
`).length;return`${Q}${U}${j4({output:q.output,cursor:this.cursor,options:this.options,maxItems:q.maxItems,columnPadding:U.length,rowPadding:H+2,style:(z,G)=>$(z,z.disabled?"disabled":G?"active":"inactive")}).join(`
|
|
230
|
+
${U}`)}
|
|
231
|
+
${F.default.cyan(D0)}
|
|
232
|
+
`}}}}).prompt()};var oT=`${F.default.gray(f)} `;var iG=[{name:"pi",displayName:"Pi",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.pi/agent/skills",globalAgents:"~/.pi/agent/agents",isUniversal:!0,legacyProjectPaths:{skills:".pi/skills",agents:".pi/agents"}},{name:"claude-code",displayName:"Claude Code",projectSkills:".claude/skills",projectAgents:".claude/agents",globalSkills:"~/.claude/skills",globalAgents:"~/.claude/agents",isUniversal:!1},{name:"cursor",displayName:"Cursor",projectSkills:".cursor/skills",projectAgents:".cursor/agents",globalSkills:"~/.cursor/skills",globalAgents:"~/.cursor/agents",isUniversal:!1},{name:"roo",displayName:"Roo",projectSkills:".roo/skills",projectAgents:".roo/agents",globalSkills:"~/.roo/skills",globalAgents:"~/.roo/agents",isUniversal:!1},{name:"cline",displayName:"Cline",projectSkills:".cline/skills",projectAgents:".cline/agents",globalSkills:"~/.cline/skills",globalAgents:"~/.cline/agents",isUniversal:!1},{name:"windsurf",displayName:"Windsurf",projectSkills:".windsurf/skills",projectAgents:".windsurf/agents",globalSkills:"~/.windsurf/skills",globalAgents:"~/.windsurf/agents",isUniversal:!1},{name:"opencode",displayName:"OpenCode",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/opencode/skills",globalAgents:"~/.config/opencode/agents",isUniversal:!0,legacyProjectPaths:{skills:".opencode/skills",agents:".opencode/agents"}},{name:"codex",displayName:"Codex",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/codex/skills",globalAgents:"~/.config/codex/agents",isUniversal:!0},{name:"amp",displayName:"Amp",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/amp/skills",globalAgents:"~/.config/amp/agents",isUniversal:!0},{name:"gemini-cli",displayName:"Gemini CLI",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/gemini-cli/skills",globalAgents:"~/.config/gemini-cli/agents",isUniversal:!0},{name:"github-copilot",displayName:"GitHub Copilot",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/github-copilot/skills",globalAgents:"~/.config/github-copilot/agents",isUniversal:!0},{name:"kimi-cli",displayName:"Kimi CLI",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/kimi-cli/skills",globalAgents:"~/.config/kimi-cli/agents",isUniversal:!0}],h1=[...iG];function y4(q){return h1.find(($)=>$.name===q)}function J5(){return h1.filter((q)=>q.isUniversal)}function Q5(){return h1.filter((q)=>!q.isUniversal)}function U5(q){let $=new Set,Z=[];for(let X of q){let J=y4(X);if(!J?.legacyProjectPaths)continue;let Q=`${J.legacyProjectPaths.skills}|${J.legacyProjectPaths.agents}`;if($.has(Q))continue;$.add(Q),Z.push(J.legacyProjectPaths)}return Z}function H5(q){return q.filter(($)=>!y4($))}function z5(q){let $=new Map;for(let Z of q){let X=y4(Z);if(!X)continue;let J=`${X.projectSkills}|${X.projectAgents}|${X.globalSkills}|${X.globalAgents}`,Q=$.get(J);if(Q)Q.displayNames.push(X.displayName);else $.set(J,{projectSkills:X.projectSkills,projectAgents:X.projectAgents,globalSkills:X.globalSkills,globalAgents:X.globalAgents,displayNames:[X.displayName]})}return Array.from($.values())}function fq(q){let $=new Set(Object.keys(q));h1=h1.filter((Z)=>!$.has(Z.name));for(let[Z,X]of Object.entries(q))h1.push({name:Z,displayName:Z,projectSkills:X.project_skills,projectAgents:X.project_agents,globalSkills:X.global_skills,globalAgents:X.global_agents,isUniversal:!1})}function G5(){return process.stdin.isTTY===!0}async function K0(q={}){let{defaults:$}=q;$5("⚙️ agentdeps setup");let Z=await f4({message:"How do you clone git repositories?",options:[{value:"ssh",label:"SSH (git@github.com:...)"},{value:"https",label:"HTTPS (https://github.com/...)"}],initialValue:$?.clone_method??"ssh"});if($1(Z)){Eq("Setup cancelled.");return}let X=J5(),J=Q5(),Q=[];for(let z of J)Q.push({value:z.name,label:`${z.displayName}`,hint:`${z.projectSkills}, ${z.projectAgents}`});for(let z of X)Q.push({value:z.name,label:`${z.displayName}`,hint:".agents/skills, .agents/agents (Universal)"});let U=await P0({message:"Which coding agents do you use? (space to select, enter to confirm)",options:Q,initialValues:$?.agents??[],required:!0});if($1(U)){Eq("Setup cancelled.");return}if(U.length===0)return T1.error("At least one agent must be selected."),K0(q);let H=await f4({message:"How should dependencies be installed?",options:[{value:"link",label:"Link (symlinks)",hint:"Fast, no duplication — default"},{value:"copy",label:"Copy (smart sync)",hint:"Portable, self-contained"}],initialValue:$?.install_method??"link"});if($1(H)){Eq("Setup cancelled.");return}return Z5("✅ Configuration saved!"),{clone_method:Z,agents:U,install_method:H,custom_agents:$?.custom_agents}}import{join as l4}from"node:path";import{mkdir as nG,readFile as rG,writeFile as oG,access as tG}from"node:fs/promises";import{dirname as eG}from"node:path";function qY(q,$){if(!q.repo)throw Error(`Dependency at index ${$} is missing required 'repo' field`);let Z;if(q.skills===void 0||q.skills==="*"||q.skills===!0)Z="*";else if(q.skills===!1)Z=!1;else if(Array.isArray(q.skills))Z=q.skills;else tq("config.normalize",`Dependency "${q.repo}" has unexpected skills value (${JSON.stringify(q.skills)}), defaulting to "*"`),Z="*";let X;if(q.agents===void 0||q.agents==="*"||q.agents===!0)X="*";else if(q.agents===!1)X=!1;else if(Array.isArray(q.agents))X=q.agents;else tq("config.normalize",`Dependency "${q.repo}" has unexpected agents value (${JSON.stringify(q.agents)}), defaulting to "*"`),X="*";return{repo:q.repo,ref:q.ref??"main",skills:Z,agents:X}}async function c(q){try{return await tG(q),!0}catch{return!1}}async function s(q){let $=await rG(q,"utf-8"),Z=_0($);if(!Z||!Z.dependencies){if(Z&&!Z.dependencies)console.warn("⚠ agents.yaml has no 'dependencies' field");return{dependencies:[]}}let X=Z.dependencies;if(!Array.isArray(X))throw Error("'dependencies' must be an array in agents.yaml");if(X.length===0)return console.warn("⚠ agents.yaml has an empty dependencies list"),{dependencies:[]};return{dependencies:X.map((Q,U)=>qY(Q,U))}}async function yq(q,$){let Z=eG(q);await nG(Z,{recursive:!0});let X={dependencies:$.dependencies.map((Q)=>{let U={repo:Q.repo};if(Q.ref!=="main")U.ref=Q.ref;if(Q.skills!=="*")U.skills=Q.skills;if(Q.agents!=="*")U.agents=Q.agents;return U})},J=W0(X,{lineWidth:0});await oG(q,J,"utf-8")}function $Y(q){if(q.includes("://"))return!1;if(q.startsWith("git@"))return!1;return q.split("/").length-1===1}function ZY(q,$){if($==="ssh")return`git@github.com:${q}.git`;return`https://github.com/${q}.git`}function xq(q,$){if($Y(q))return ZY(q,$);return q}function kq(q,$){let Z;if(q.startsWith("git@")){let J=q.indexOf(":");Z=q.slice(J+1)}else if(q.includes("://"))try{Z=new URL(q).pathname.slice(1)}catch{Z=q}else Z=q;if(Z.endsWith(".git"))Z=Z.slice(0,-4);return`${Z.replace(/\//g,"-")}-${$}`}import{readdir as Y5,access as XY}from"node:fs/promises";import{join as u1}from"node:path";async function gq(q){let $=u1(q,"skills");try{let X=(await Y5($,{withFileTypes:!0})).filter((Q)=>Q.isDirectory());return(await Promise.all(X.map(async(Q)=>{let U;try{await XY(u1($,Q.name,"SKILL.md")),U=!0}catch{U=!1}return U?{name:Q.name,sourcePath:u1($,Q.name)}:null}))).filter((Q)=>Q!==null).sort((Q,U)=>Q.name.localeCompare(U.name))}catch{return[]}}async function vq(q){let $=u1(q,"agents");try{let Z=await Y5($,{withFileTypes:!0}),X=[];for(let J of Z)if(J.isDirectory())X.push({name:J.name,sourcePath:u1($,J.name)});else if(J.isFile()&&J.name.endsWith(".md")){let Q=J.name.replace(/\.md$/,"");X.push({name:Q,sourcePath:u1($,J.name)})}return X.sort((J,Q)=>J.name.localeCompare(Q.name))}catch{return[]}}function x4(q,$){if($===!1)return{selected:[],missing:[]};if($==="*")return{selected:[...q],missing:[]};let Z=new Map(q.map((Q)=>[Q.name,Q])),X=[],J=[];for(let Q of $){let U=Z.get(Q);if(U)X.push(U);else J.push(Q)}return{selected:X,missing:J}}function k4(q,$,Z,X,J){if(X===!1)return;if(Z.length===0)console.warn(`⚠ No ${$} found in ${q}${$==="skills"?" (no skills/ directory or no SKILL.md files)":" (no agents/ directory)"}`);if(J.length>0)console.warn(`⚠ ${$} not found in ${q}: ${J.join(", ")}`)}import{readdir as R5,mkdir as WY,rm as I5,lstat as RY,stat as IY}from"node:fs/promises";import{join as h4}from"node:path";import{homedir as VY}from"node:os";import{symlink as JY,readlink as QY,unlink as UY,lstat as B5,rm as HY}from"node:fs/promises";import{platform as zY}from"node:os";import{execFile as GY}from"node:child_process";import{promisify as YY}from"node:util";var BY=YY(GY);async function g4(q,$){let Z=!1;try{Z=(await B5(q)).isFile()}catch{}try{await JY(q,$,Z?"file":"dir")}catch(X){if(zY()==="win32"&&!Z)try{await BY("cmd",["/c","mklink","/J",$,q])}catch(J){let Q=J instanceof Error?J.message:String(J);throw Error(`Failed to create symlink or junction at ${$}. Consider switching to install_method: copy, or enable Developer Mode on Windows. Error: ${Q.trim()}`)}else throw X}}async function T5(q,$){try{if((await B5($)).isSymbolicLink()){if(await QY($)===q)return"unchanged";return await UY($),await g4(q,$),"replaced"}return await HY($,{recursive:!0,force:!0}),await g4(q,$),"replaced"}catch(Z){if(Z.code==="ENOENT")return await g4(q,$),"created";throw Z}}import{readdir as L5,mkdir as TY,rm as LY,stat as hq,copyFile as _5}from"node:fs/promises";import{join as v4}from"node:path";async function uq(q,$){if((await hq(q)).isFile()){if(await W5(q,$))return await _5(q,$),!0;return!1}let X=!await _Y($);await TY($,{recursive:!0});let J=await L5(q,{withFileTypes:!0}),Q=new Set(J.map((H)=>H.name)),U=[];try{U=await L5($,{withFileTypes:!0})}catch{}for(let H of U)if(!Q.has(H.name))await LY(v4($,H.name),{recursive:!0,force:!0}),X=!0;for(let H of J){let z=v4(q,H.name),G=v4($,H.name);if(H.isDirectory()){if(await uq(z,G))X=!0}else if(H.isFile()){if(await W5(z,G))await _5(z,G),X=!0}}return X}async function W5(q,$){try{let[Z,X]=await Promise.all([hq(q),hq($)]);if(Z.size!==X.size)return!0;if(Z.mtimeMs>X.mtimeMs)return!0;return!1}catch{return!0}}async function _Y(q){try{return await hq(q),!0}catch{return!1}}function u4(q){if(q.startsWith("~/")||q==="~")return h4(VY(),q.slice(1));return q}async function DY(q,$){try{if((await IY($)).isFile()){let X=$.match(/(\.[^.]+)$/)?.[1]??"";return q+X}}catch{}return q}async function m4(q,$,Z){let X={added:[],updated:[],removed:[],unchanged:[]},J=[],Q=!1;try{J=await R5(q),Q=!0}catch{}if($.size===0&&!Q)return X;let U=[];for(let[z,G]of $){let B=await DY(z,G);U.push({name:z,targetName:B,sourcePath:G})}let H=new Set(U.map((z)=>z.targetName));for(let z of J)if(!H.has(z))await I5(h4(q,z),{recursive:!0,force:!0}),X.removed.push(z);if($.size===0){try{if((await R5(q)).length===0)await I5(q,{recursive:!0,force:!0})}catch{}return X}await WY(q,{recursive:!0});for(let{name:z,targetName:G,sourcePath:B}of U){let Y=h4(q,G);if(Z==="link"){let L=await T5(B,Y);if(L==="created")X.added.push(z);else if(L==="replaced")X.updated.push(z);else X.unchanged.push(z);continue}try{if(await RY(Y),await uq(B,Y))X.updated.push(z);else X.unchanged.push(z)}catch{await uq(B,Y),X.added.push(z)}}return X}import{rm as V5}from"node:fs/promises";import{join as D5}from"node:path";var M5="_agentdeps_managed";async function P5(q){let $=U5(q);for(let{skills:Z,agents:X}of $)await V5(D5(Z,M5),{recursive:!0,force:!0}),await V5(D5(X,M5),{recursive:!0,force:!0})}function K5(q,$){let Z=new Set,X=`${$}/`;for(let J of q){if(!J.startsWith(X))continue;let Q=J.slice(X.length),[U]=Q.split("/");if(!U)continue;if($==="agents"&&U.endsWith(".md"))Z.add(U.replace(/\.md$/,""));else Z.add(U)}return Z}function F5(q,$){let Z=[...q.added],X=[...q.updated],J=[...q.removed],Q=[...q.unchanged];for(let U of $){if(Z.includes(U)||J.includes(U)||X.includes(U))continue;let H=Q.indexOf(U);if(H!==-1)Q.splice(H,1);X.push(U)}return{added:Z,updated:X,removed:J,unchanged:Q}}function O5(q,$,Z){let X=[],J=new Set;for(let Q of q){let U=Z==="skills"?Q.skills:Q.agents,H=new Set(Z==="skills"?Q.updatedSkillNames:Q.updatedAgentNames);for(let z of U){if(!H.has(z.name))continue;if($.get(z.name)!==z.sourcePath)continue;if(J.has(z.name))continue;J.add(z.name),X.push(z.name)}}return X}async function N5(q,$){let Z=await Promise.all(q.map(async(J)=>{let Q=xq(J.repo,$),U=kq(J.repo,J.ref);console.log(` \uD83D\uDCE6 ${J.repo} (${J.ref})`);let H=await b0(Q,J.ref,U);return{dep:J,result:H}}));return(await Promise.all(Z.map(async({dep:J,result:Q})=>{if(!Q.success)return console.error(` ✗ Failed to cache ${J.repo}, skipping`),null;let[U,H]=await Promise.all([gq(Q.path),vq(Q.path)]),z=x4(U,J.skills),G=x4(H,J.agents),B=K5(Q.changedPaths,"skills"),Y=K5(Q.changedPaths,"agents");return k4(J.repo,"skills",U,J.skills,z.missing),k4(J.repo,"agents",H,J.agents,G.missing),{repo:J.repo,cachePath:Q.path,skills:z.selected,agents:G.selected,updatedSkillNames:z.selected.filter((L)=>B.has(L.name)).map((L)=>L.name),updatedAgentNames:G.selected.filter((L)=>Y.has(L.name)).map((L)=>L.name)}}))).filter((J)=>J!==null)}async function S5(q,$,Z,X){let J=new Map,Q=new Map;for(let B of q){for(let Y of B.skills)J.set(Y.name,Y.sourcePath);for(let Y of B.agents)Q.set(Y.name,Y.sourcePath)}let U=X==="link"?O5(q,J,"skills"):[],H=X==="link"?O5(q,Q,"agents"):[],z=new Map;for(let B of $){let Y=Z==="global"?u4(B.globalSkills):B.projectSkills,L=Z==="global"?u4(B.globalAgents):B.projectAgents,R=`${Y}|${L}`,W=z.get(R);if(W)W.displayNames.push(...B.displayNames);else z.set(R,{skillsDir:Y,agentsDir:L,displayNames:[...B.displayNames]})}let G=[];for(let{skillsDir:B,agentsDir:Y,displayNames:L}of z.values()){let R=l4(B,"_agentdeps_managed"),W=l4(Y,"_agentdeps_managed"),T=await m4(R,J,X),_=await m4(W,Q,X);G.push({displayNames:L,skills:F5(T,U),agents:F5(_,H)})}return G}function m1(q,$,Z){return`${q} ${$}${q===1?"":"s"} ${Z}`}function mq(q,$,Z){let X=[];if(Z.added.length>0)X.push(`${q}${$} added: ${Z.added.join(", ")}`);if(Z.updated.length>0)X.push(`${q}${$} updated: ${Z.updated.join(", ")}`);if(Z.removed.length>0)X.push(`${q}${$} removed: ${Z.removed.join(", ")}`);return X}function A5(q){let $=[];if(q.skills.added.length>0)$.push(m1(q.skills.added.length,"skill","added"));if(q.skills.updated.length>0)$.push(m1(q.skills.updated.length,"skill","updated"));if(q.skills.removed.length>0)$.push(m1(q.skills.removed.length,"skill","removed"));if(q.agents.added.length>0)$.push(m1(q.agents.added.length,"agent","added"));if(q.agents.updated.length>0)$.push(m1(q.agents.updated.length,"agent","updated"));if(q.agents.removed.length>0)$.push(m1(q.agents.removed.length,"agent","removed"));return $}function w5(q,$){if($.length===0)return` ✓ ${q}: nothing to do`;if($.length===1){let X=$[0],J=X.displayNames.join(", "),Q=A5(X);if(Q.length===0)return` ✓ ${q} (${J}): up to date`;let U=[...mq(" ","skills",X.skills),...mq(" ","agents",X.agents)];return` ✓ ${q} (${J}): ${Q.join(", ")}
|
|
233
|
+
${U.join(`
|
|
234
|
+
`)}`}let Z=[];for(let X of $){let J=X.displayNames.join(", "),Q=A5(X);Z.push(` ${J}: ${Q.length===0?"up to date":Q.join(", ")}`),Z.push(...mq(" ","skills",X.skills)),Z.push(...mq(" ","agents",X.agents))}return` ✓ ${q}:
|
|
235
|
+
${Z.join(`
|
|
236
|
+
`)}`}async function F0(q){if(q.custom_agents)fq(q.custom_agents);let $=H5(q.agents);if($.length>0)console.warn(`⚠ Unknown agents in config: ${$.join(", ")}`);let Z=z5(q.agents);await P5(q.agents);let X=v1();try{if(await c(X)){console.log(`
|
|
237
|
+
\uD83C\uDF10 Processing global dependencies...`);let Q=await s(X);if(Q.dependencies.length>0){let U=await N5(Q.dependencies,q.clone_method),H=await S5(U,Z,"global",q.install_method);console.log(w5("Global",H))}}}catch(Q){o("global-deps",Q),console.warn("⚠ Failed to process global dependencies")}let J=l4(process.cwd(),"agents.yaml");if(await c(J)){console.log(`
|
|
238
|
+
\uD83D\uDCC1 Processing project dependencies...`);let Q=await s(J);if(Q.dependencies.length>0){let U=await N5(Q.dependencies,q.clone_method),H=await S5(U,Z,"project",q.install_method);console.log(w5("Project",H))}else console.log(" ℹ No project dependencies defined")}else console.log(`
|
|
236
239
|
ℹ No project agents.yaml found — only global dependencies processed`);console.log(`
|
|
237
|
-
✅ Install complete`),
|
|
238
|
-
✓ ${
|
|
239
|
-
`),
|
|
240
|
-
`),
|
|
240
|
+
✅ Install complete`),w0()}var b5=new v("install").description("Install dependencies from agents.yaml").action(async()=>{let q=await B1();await F0(q)});import{join as MY}from"node:path";var E5=new v("add").description("Add a new dependency to agents.yaml").argument("<repo>","Repository (owner/repo or full URL)").option("--ref <ref>","Git ref (branch, tag, SHA)","main").option("--skill <name>","Install specific skill (repeatable)",j5,[]).option("--agent <name>","Install specific agent (repeatable)",j5,[]).option("--all","Install all skills and agents").option("--all-skills","Install all skills").option("--all-agents","Install all agents").option("--no-skills","Don't install any skills").option("--no-agents","Don't install any agents").option("-g, --global","Add dependency to global agents.yaml instead of project").action(async(q,$)=>{let Z=await B1(),X=!!$.global,J=X?v1():MY(process.cwd(),"agents.yaml"),Q=X?"global":"project",U;if(await c(J))U=(await s(J)).dependencies.find((D)=>D.repo===q||lq(D.repo)===lq(q));let H=xq(q,Z.clone_method),z=kq(q,$.ref);console.log(`\uD83D\uDCE6 Fetching ${q}...`);let G=await b0(H,$.ref,z);if(!G.success)console.error(`✗ Failed to clone ${q}`),process.exit(1);let[B,Y]=await Promise.all([gq(G.path),vq(G.path)]);console.log(` Found ${B.length} skill(s), ${Y.length} agent(s)`);let L,R;if($.all)L="*",R="*";else if($.skill.length>0||$.agent.length>0||$.allSkills||$.allAgents||$.skills===!1||$.agents===!1){if($.skills===!1)L=!1;else if($.allSkills)L="*";else if($.skill.length>0)L=$.skill;else L="*";if($.agents===!1)R=!1;else if($.allAgents)R="*";else if($.agent.length>0)R=$.agent;else R="*"}else{let V=await PY(B,Y,U);if(!V)return;L=V.skills,R=V.agents}let W={repo:q,ref:$.ref,skills:L,agents:R},T=await c(J)?await s(J):{dependencies:[]};if(U){let V=T.dependencies.findIndex((D)=>D.repo===q||lq(D.repo)===lq(q));T.dependencies[V]=W}else T.dependencies.push(W);await yq(J,T),console.log(`
|
|
241
|
+
✓ ${U?"Updated":"Added"} ${q} in ${Q} agents.yaml`),await F0(Z)});function j5(q,$){return $.concat([q])}function lq(q){return q.replace(/\.git$/,"").toLowerCase()}function C5(q,$){if($===void 0||$==="*")return q;if($===!1)return[];return $.filter((Z)=>q.includes(Z))}async function PY(q,$,Z){let X={skills:"*",agents:"*"};if(q.length>0){let J=q.map((H)=>H.name),Q=await P0({message:"Select skills to install (press 'a' to toggle all):",options:J.map((H)=>({value:H,label:H})),initialValues:C5(J,Z?.skills),required:!1});if($1(Q))return;let U=Q;if(U.length===J.length)X.skills="*";else if(U.length===0)X.skills=!1;else X.skills=U}else X.skills=!1;if($.length>0){let J=$.map((H)=>H.name),Q=await P0({message:"Select agents to install (press 'a' to toggle all):",options:J.map((H)=>({value:H,label:H})),initialValues:C5(J,Z?.agents),required:!1});if($1(Q))return;let U=Q;if(U.length===J.length)X.agents="*";else if(U.length===0)X.agents=!1;else X.agents=U}else X.agents=!1;return X}import{join as KY}from"node:path";var y5=new v("remove").description("Remove a dependency from agents.yaml").argument("<repo>","Repository to remove (owner/repo or full URL)").action(async(q)=>{let $=await B1(),Z=KY(process.cwd(),"agents.yaml");if(!await c(Z))console.error("✗ No agents.yaml found in current directory"),process.exit(1);let X=await s(Z),J=f5(q),Q=X.dependencies.findIndex((H)=>f5(H.repo)===J);if(Q===-1)console.error(`✗ ${q} not found in agents.yaml`),process.exit(1);let[U]=X.dependencies.splice(Q,1);if(!U)console.error(`✗ Unexpected error removing ${q}`),process.exit(1);await yq(Z,X),console.log(`✓ Removed ${U.repo} from agents.yaml`),await F0($)});function f5(q){return q.replace(/\.git$/,"").toLowerCase()}import{join as FY}from"node:path";var k5=new v("list").description("List installed dependencies").action(async()=>{let q=await B1(),$=!1,Z=v1();if(await c(Z)){let J=await s(Z);if(J.dependencies.length>0)$=!0,console.log(`\uD83C\uDF10 Global dependencies:
|
|
242
|
+
`),x5(J.dependencies,q.agents)}let X=FY(process.cwd(),"agents.yaml");if(await c(X)){let J=await s(X);if(J.dependencies.length>0)$=!0,console.log(`\uD83D\uDCC1 Project dependencies:
|
|
243
|
+
`),x5(J.dependencies,q.agents)}if(!$)console.log(`No dependencies configured.
|
|
241
244
|
|
|
242
245
|
Add one with:
|
|
243
246
|
agentdeps add <owner/repo>
|
|
244
247
|
|
|
245
|
-
Or create agents.yaml manually.`)});function
|
|
246
|
-
✓ Configuration saved`)});var
|
|
248
|
+
Or create agents.yaml manually.`)});function x5(q,$){for(let Z of q){if(console.log(` ${Z.repo} (ref: ${Z.ref})`),Z.skills==="*")console.log(" skills: all");else if(Z.skills===!1)console.log(" skills: none");else console.log(` skills: ${Z.skills.join(", ")}`);if(Z.agents==="*")console.log(" agents: all");else if(Z.agents===!1)console.log(" agents: none");else console.log(` agents: ${Z.agents.join(", ")}`);console.log(` targets: ${$.join(", ")}`),console.log()}}var g5=new v("config").description("Configure agentdeps (re-run interactive setup)").action(async()=>{let q=void 0;try{q=await B4()}catch(Z){o("config.load",Z),console.warn("⚠ Existing config is invalid, starting fresh")}if(q?.custom_agents)fq(q.custom_agents);let $=await K0({defaults:q});if(!$)return;if(q?.custom_agents&&!$.custom_agents)$.custom_agents=q.custom_agents;await Vq($),console.log(`
|
|
249
|
+
✓ Configuration saved`)});var v5="0.5.1";var L1=new v().name("agentdeps").version(v5).description("Declarative dependency manager for AI coding agent skills and subagents"),OY=new Set(["install","add","remove","list"]);L1.hook("preAction",async(q,$)=>{let Z=$.name();if(!OY.has(Z))return;if(!await R2())console.error(`✗ git is not installed or not in PATH.
|
|
247
250
|
`+` agentdeps requires git to clone and update repositories.
|
|
248
|
-
Install git: https://git-scm.com/downloads`),process.exit(1);if(!await
|
|
251
|
+
Install git: https://git-scm.com/downloads`),process.exit(1);if(!await S$()){if(!G5())console.error(`✗ No configuration found and terminal is not interactive.
|
|
249
252
|
`+" Run `agentdeps config` in an interactive terminal first."),process.exit(1);console.log(`Welcome to agentdeps! Let's set up your configuration.
|
|
250
|
-
`);let Q=await
|
|
253
|
+
`);let Q=await K0();if(!Q)process.exit(1);await Vq(Q)}});L1.addCommand(b5);L1.addCommand(E5);L1.addCommand(y5);L1.addCommand(k5);L1.addCommand(g5);L1.parse();
|