give-skill 1.1.0 → 1.1.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.
Files changed (3) hide show
  1. package/README.md +7 -10
  2. package/dist/index.js +68 -68
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -84,10 +84,13 @@ npx give-skill expo/skills --list
84
84
  # List all installed skills
85
85
  npx give-skill list
86
86
 
87
- # Check status of all installed skills
87
+ # Check status of all installed skills (compact view)
88
88
  npx give-skill status
89
89
 
90
- # Check status of specific skills
90
+ # Check status with detailed information
91
+ npx give-skill status --verbose
92
+
93
+ # Check status of specific skills (automatically shows details)
91
94
  npx give-skill status pr-reviewer test-generator
92
95
 
93
96
  # Update all skills with available updates (interactive selection)
@@ -102,12 +105,6 @@ npx give-skill update -y
102
105
  # Remove specific skills
103
106
  npx give-skill remove pr-reviewer
104
107
 
105
- # Remove from specific agent only
106
- npx give-skill remove pr-reviewer -a claude-code
107
-
108
- # Remove global installation only
109
- npx give-skill remove pr-reviewer --global
110
-
111
108
  # Remove without confirmation (auto-selects all)
112
109
  npx give-skill remove -y
113
110
 
@@ -148,8 +145,8 @@ Options:
148
145
 
149
146
  Commands:
150
147
  update [skills...] Update installed skills to their latest versions
151
- status [skills...] Check status of installed skills (updates available, orphaned, etc.)
152
- remove [skills...] Remove installed skills (interactive if no skills specified)
148
+ status [skills...] Check status of installed skills (compact view, use -v for details)
149
+ remove [skills...] Remove installed skills (use -y to skip confirmation)
153
150
  list List all installed skills
154
151
  clean Remove orphaned skill entries from state
155
152
  ```
package/dist/index.js CHANGED
@@ -1,78 +1,78 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as Yt}from"node:module";var qt=Object.create;var{getPrototypeOf:rt,defineProperty:ks,getOwnPropertyNames:Jt}=Object;var Pt=Object.prototype.hasOwnProperty;var d=(l,s,f)=>{f=l!=null?qt(rt(l)):{};let y=s||!l||!l.__esModule?ks(f,"default",{value:l,enumerable:!0}):f;for(let i of Jt(l))if(!Pt.call(y,i))ks(y,i,{get:()=>l[i],enumerable:!0});return y};var a=(l,s)=>()=>(s||l((s={exports:{}}).exports,s),s.exports);var il=Yt(import.meta.url);var Sl=a((Gt)=>{class Ql extends Error{constructor(l,s,f){super(f);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=s,this.exitCode=l,this.nestedError=void 0}}class cs extends Ql{constructor(l){super(1,"commander.invalidArgument",l);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}Gt.CommanderError=Ql;Gt.InvalidArgumentError=cs});var cl=a((jt)=>{var{InvalidArgumentError:Qt}=Sl();class bs{constructor(l,s){switch(this.description=s||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,l[0]){case"<":this.required=!0,this._name=l.slice(1,-1);break;case"[":this.required=!1,this._name=l.slice(1,-1);break;default:this.required=!0,this._name=l;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(l,s){if(s===this.defaultValue||!Array.isArray(s))return[l];return s.push(l),s}default(l,s){return this.defaultValue=l,this.defaultValueDescription=s,this}argParser(l){return this.parseArg=l,this}choices(l){return this.argChoices=l.slice(),this.parseArg=(s,f)=>{if(!this.argChoices.includes(s))throw new Qt(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(s,f);return s},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function Zt(l){let s=l.name()+(l.variadic===!0?"...":"");return l.required?"<"+s+">":"["+s+"]"}jt.Argument=bs;jt.humanReadableArgName=Zt});var Zl=a((Wt)=>{var{humanReadableArgName:Kt}=cl();class ns{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(l){this.helpWidth=this.helpWidth??l.helpWidth??80}visibleCommands(l){let s=l.commands.filter((y)=>!y._hidden),f=l._getHelpCommand();if(f&&!f._hidden)s.push(f);if(this.sortSubcommands)s.sort((y,i)=>{return y.name().localeCompare(i.name())});return s}compareOptions(l,s){let f=(y)=>{return y.short?y.short.replace(/^-/,""):y.long.replace(/^--/,"")};return f(l).localeCompare(f(s))}visibleOptions(l){let s=l.options.filter((y)=>!y.hidden),f=l._getHelpOption();if(f&&!f.hidden){let y=f.short&&l._findOption(f.short),i=f.long&&l._findOption(f.long);if(!y&&!i)s.push(f);else if(f.long&&!i)s.push(l.createOption(f.long,f.description));else if(f.short&&!y)s.push(l.createOption(f.short,f.description))}if(this.sortOptions)s.sort(this.compareOptions);return s}visibleGlobalOptions(l){if(!this.showGlobalOptions)return[];let s=[];for(let f=l.parent;f;f=f.parent){let y=f.options.filter((i)=>!i.hidden);s.push(...y)}if(this.sortOptions)s.sort(this.compareOptions);return s}visibleArguments(l){if(l._argsDescription)l.registeredArguments.forEach((s)=>{s.description=s.description||l._argsDescription[s.name()]||""});if(l.registeredArguments.find((s)=>s.description))return l.registeredArguments;return[]}subcommandTerm(l){let s=l.registeredArguments.map((f)=>Kt(f)).join(" ");return l._name+(l._aliases[0]?"|"+l._aliases[0]:"")+(l.options.length?" [options]":"")+(s?" "+s:"")}optionTerm(l){return l.flags}argumentTerm(l){return l.name()}longestSubcommandTermLength(l,s){return s.visibleCommands(l).reduce((f,y)=>{return Math.max(f,this.displayWidth(s.styleSubcommandTerm(s.subcommandTerm(y))))},0)}longestOptionTermLength(l,s){return s.visibleOptions(l).reduce((f,y)=>{return Math.max(f,this.displayWidth(s.styleOptionTerm(s.optionTerm(y))))},0)}longestGlobalOptionTermLength(l,s){return s.visibleGlobalOptions(l).reduce((f,y)=>{return Math.max(f,this.displayWidth(s.styleOptionTerm(s.optionTerm(y))))},0)}longestArgumentTermLength(l,s){return s.visibleArguments(l).reduce((f,y)=>{return Math.max(f,this.displayWidth(s.styleArgumentTerm(s.argumentTerm(y))))},0)}commandUsage(l){let s=l._name;if(l._aliases[0])s=s+"|"+l._aliases[0];let f="";for(let y=l.parent;y;y=y.parent)f=y.name()+" "+f;return f+s+" "+l.usage()}commandDescription(l){return l.description()}subcommandDescription(l){return l.summary()||l.description()}optionDescription(l){let s=[];if(l.argChoices)s.push(`choices: ${l.argChoices.map((f)=>JSON.stringify(f)).join(", ")}`);if(l.defaultValue!==void 0){if(l.required||l.optional||l.isBoolean()&&typeof l.defaultValue==="boolean")s.push(`default: ${l.defaultValueDescription||JSON.stringify(l.defaultValue)}`)}if(l.presetArg!==void 0&&l.optional)s.push(`preset: ${JSON.stringify(l.presetArg)}`);if(l.envVar!==void 0)s.push(`env: ${l.envVar}`);if(s.length>0){let f=`(${s.join(", ")})`;if(l.description)return`${l.description} ${f}`;return f}return l.description}argumentDescription(l){let s=[];if(l.argChoices)s.push(`choices: ${l.argChoices.map((f)=>JSON.stringify(f)).join(", ")}`);if(l.defaultValue!==void 0)s.push(`default: ${l.defaultValueDescription||JSON.stringify(l.defaultValue)}`);if(s.length>0){let f=`(${s.join(", ")})`;if(l.description)return`${l.description} ${f}`;return f}return l.description}formatItemList(l,s,f){if(s.length===0)return[];return[f.styleTitle(l),...s,""]}groupItems(l,s,f){let y=new Map;return l.forEach((i)=>{let S=f(i);if(!y.has(S))y.set(S,[])}),s.forEach((i)=>{let S=f(i);if(!y.has(S))y.set(S,[]);y.get(S).push(i)}),y}formatHelp(l,s){let f=s.padWidth(l,s),y=s.helpWidth??80;function i(b,U){return s.formatItem(b,f,U,s)}let S=[`${s.styleTitle("Usage:")} ${s.styleUsage(s.commandUsage(l))}`,""],t=s.commandDescription(l);if(t.length>0)S=S.concat([s.boxWrap(s.styleCommandDescription(t),y),""]);let $=s.visibleArguments(l).map((b)=>{return i(s.styleArgumentTerm(s.argumentTerm(b)),s.styleArgumentDescription(s.argumentDescription(b)))});if(S=S.concat(this.formatItemList("Arguments:",$,s)),this.groupItems(l.options,s.visibleOptions(l),(b)=>b.helpGroupHeading??"Options:").forEach((b,U)=>{let w=b.map((n)=>{return i(s.styleOptionTerm(s.optionTerm(n)),s.styleOptionDescription(s.optionDescription(n)))});S=S.concat(this.formatItemList(U,w,s))}),s.showGlobalOptions){let b=s.visibleGlobalOptions(l).map((U)=>{return i(s.styleOptionTerm(s.optionTerm(U)),s.styleOptionDescription(s.optionDescription(U)))});S=S.concat(this.formatItemList("Global Options:",b,s))}return this.groupItems(l.commands,s.visibleCommands(l),(b)=>b.helpGroup()||"Commands:").forEach((b,U)=>{let w=b.map((n)=>{return i(s.styleSubcommandTerm(s.subcommandTerm(n)),s.styleSubcommandDescription(s.subcommandDescription(n)))});S=S.concat(this.formatItemList(U,w,s))}),S.join(`
3
- `)}displayWidth(l){return Is(l).length}styleTitle(l){return l}styleUsage(l){return l.split(" ").map((s)=>{if(s==="[options]")return this.styleOptionText(s);if(s==="[command]")return this.styleSubcommandText(s);if(s[0]==="["||s[0]==="<")return this.styleArgumentText(s);return this.styleCommandText(s)}).join(" ")}styleCommandDescription(l){return this.styleDescriptionText(l)}styleOptionDescription(l){return this.styleDescriptionText(l)}styleSubcommandDescription(l){return this.styleDescriptionText(l)}styleArgumentDescription(l){return this.styleDescriptionText(l)}styleDescriptionText(l){return l}styleOptionTerm(l){return this.styleOptionText(l)}styleSubcommandTerm(l){return l.split(" ").map((s)=>{if(s==="[options]")return this.styleOptionText(s);if(s[0]==="["||s[0]==="<")return this.styleArgumentText(s);return this.styleSubcommandText(s)}).join(" ")}styleArgumentTerm(l){return this.styleArgumentText(l)}styleOptionText(l){return l}styleArgumentText(l){return l}styleSubcommandText(l){return l}styleCommandText(l){return l}padWidth(l,s){return Math.max(s.longestOptionTermLength(l,s),s.longestGlobalOptionTermLength(l,s),s.longestSubcommandTermLength(l,s),s.longestArgumentTermLength(l,s))}preformatted(l){return/\n[^\S\r\n]/.test(l)}formatItem(l,s,f,y){let S=" ".repeat(2);if(!f)return S+l;let t=l.padEnd(s+l.length-y.displayWidth(l)),$=2,k=(this.helpWidth??80)-s-$-2,b;if(k<this.minWidthToWrap||y.preformatted(f))b=f;else b=y.boxWrap(f,k).replace(/\n/g,`
4
- `+" ".repeat(s+$));return S+t+" ".repeat($)+b.replace(/\n/g,`
5
- ${S}`)}boxWrap(l,s){if(s<this.minWidthToWrap)return l;let f=l.split(/\r\n|\n/),y=/[\s]*[^\s]+/g,i=[];return f.forEach((S)=>{let t=S.match(y);if(t===null){i.push("");return}let $=[t.shift()],c=this.displayWidth($[0]);t.forEach((k)=>{let b=this.displayWidth(k);if(c+b<=s){$.push(k),c+=b;return}i.push($.join(""));let U=k.trimStart();$=[U],c=this.displayWidth(U)}),i.push($.join(""))}),i.join(`
6
- `)}}function Is(l){let s=/\x1b\[\d*(;\d*)*m/g;return l.replace(s,"")}Wt.Help=ns;Wt.stripColor=Is});var jl=a((Vt)=>{var{InvalidArgumentError:Ct}=Sl();class gs{constructor(l,s){this.flags=l,this.description=s||"",this.required=l.includes("<"),this.optional=l.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(l),this.mandatory=!1;let f=Nt(l);if(this.short=f.shortFlag,this.long=f.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(l,s){return this.defaultValue=l,this.defaultValueDescription=s,this}preset(l){return this.presetArg=l,this}conflicts(l){return this.conflictsWith=this.conflictsWith.concat(l),this}implies(l){let s=l;if(typeof l==="string")s={[l]:!0};return this.implied=Object.assign(this.implied||{},s),this}env(l){return this.envVar=l,this}argParser(l){return this.parseArg=l,this}makeOptionMandatory(l=!0){return this.mandatory=!!l,this}hideHelp(l=!0){return this.hidden=!!l,this}_collectValue(l,s){if(s===this.defaultValue||!Array.isArray(s))return[l];return s.push(l),s}choices(l){return this.argChoices=l.slice(),this.parseArg=(s,f)=>{if(!this.argChoices.includes(s))throw new Ct(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(s,f);return s},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return ws(this.name().replace(/^no-/,""));return ws(this.name())}helpGroup(l){return this.helpGroupHeading=l,this}is(l){return this.short===l||this.long===l}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class Us{constructor(l){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,l.forEach((s)=>{if(s.negate)this.negativeOptions.set(s.attributeName(),s);else this.positiveOptions.set(s.attributeName(),s)}),this.negativeOptions.forEach((s,f)=>{if(this.positiveOptions.has(f))this.dualOptions.add(f)})}valueFromOption(l,s){let f=s.attributeName();if(!this.dualOptions.has(f))return!0;let y=this.negativeOptions.get(f).presetArg,i=y!==void 0?y:!1;return s.negate===(i===l)}}function ws(l){return l.split("-").reduce((s,f)=>{return s+f[0].toUpperCase()+f.slice(1)})}function Nt(l){let s,f,y=/^-[^-]$/,i=/^--[^-]/,S=l.split(/[ |,]+/).concat("guard");if(y.test(S[0]))s=S.shift();if(i.test(S[0]))f=S.shift();if(!s&&y.test(S[0]))s=S.shift();if(!s&&i.test(S[0]))s=f,f=S.shift();if(S[0].startsWith("-")){let t=S[0],$=`option creation failed due to '${t}' in option flags '${l}'`;if(/^-[^-][^-]/.test(t))throw Error(`${$}
2
+ import{createRequire as qt}from"node:module";var Lt=Object.create;var{getPrototypeOf:Ut,defineProperty:as,getOwnPropertyNames:Bt}=Object;var Nt=Object.prototype.hasOwnProperty;var A=(l,s,i)=>{i=l!=null?Lt(Ut(l)):{};let n=s||!l||!l.__esModule?as(i,"default",{value:l,enumerable:!0}):i;for(let f of Bt(l))if(!Nt.call(n,f))as(n,f,{get:()=>l[f],enumerable:!0});return n};var v=(l,s)=>()=>(s||l((s={exports:{}}).exports,s),s.exports);var el=qt(import.meta.url);var al=v((_t)=>{class Xl extends Error{constructor(l,s,i){super(i);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=s,this.exitCode=l,this.nestedError=void 0}}class ks extends Xl{constructor(l){super(1,"commander.invalidArgument",l);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}_t.CommanderError=Xl;_t.InvalidArgumentError=ks});var ol=v((Xt)=>{var{InvalidArgumentError:Yt}=al();class ys{constructor(l,s){switch(this.description=s||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,l[0]){case"<":this.required=!0,this._name=l.slice(1,-1);break;case"[":this.required=!1,this._name=l.slice(1,-1);break;default:this.required=!0,this._name=l;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(l,s){if(s===this.defaultValue||!Array.isArray(s))return[l];return s.push(l),s}default(l,s){return this.defaultValue=l,this.defaultValueDescription=s,this}argParser(l){return this.parseArg=l,this}choices(l){return this.argChoices=l.slice(),this.parseArg=(s,i)=>{if(!this.argChoices.includes(s))throw new Yt(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(s,i);return s},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function Gt(l){let s=l.name()+(l.variadic===!0?"...":"");return l.required?"<"+s+">":"["+s+"]"}Xt.Argument=ys;Xt.humanReadableArgName=Gt});var zl=v((Zt)=>{var{humanReadableArgName:Qt}=ol();class Ss{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(l){this.helpWidth=this.helpWidth??l.helpWidth??80}visibleCommands(l){let s=l.commands.filter((n)=>!n._hidden),i=l._getHelpCommand();if(i&&!i._hidden)s.push(i);if(this.sortSubcommands)s.sort((n,f)=>{return n.name().localeCompare(f.name())});return s}compareOptions(l,s){let i=(n)=>{return n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"")};return i(l).localeCompare(i(s))}visibleOptions(l){let s=l.options.filter((n)=>!n.hidden),i=l._getHelpOption();if(i&&!i.hidden){let n=i.short&&l._findOption(i.short),f=i.long&&l._findOption(i.long);if(!n&&!f)s.push(i);else if(i.long&&!f)s.push(l.createOption(i.long,i.description));else if(i.short&&!n)s.push(l.createOption(i.short,i.description))}if(this.sortOptions)s.sort(this.compareOptions);return s}visibleGlobalOptions(l){if(!this.showGlobalOptions)return[];let s=[];for(let i=l.parent;i;i=i.parent){let n=i.options.filter((f)=>!f.hidden);s.push(...n)}if(this.sortOptions)s.sort(this.compareOptions);return s}visibleArguments(l){if(l._argsDescription)l.registeredArguments.forEach((s)=>{s.description=s.description||l._argsDescription[s.name()]||""});if(l.registeredArguments.find((s)=>s.description))return l.registeredArguments;return[]}subcommandTerm(l){let s=l.registeredArguments.map((i)=>Qt(i)).join(" ");return l._name+(l._aliases[0]?"|"+l._aliases[0]:"")+(l.options.length?" [options]":"")+(s?" "+s:"")}optionTerm(l){return l.flags}argumentTerm(l){return l.name()}longestSubcommandTermLength(l,s){return s.visibleCommands(l).reduce((i,n)=>{return Math.max(i,this.displayWidth(s.styleSubcommandTerm(s.subcommandTerm(n))))},0)}longestOptionTermLength(l,s){return s.visibleOptions(l).reduce((i,n)=>{return Math.max(i,this.displayWidth(s.styleOptionTerm(s.optionTerm(n))))},0)}longestGlobalOptionTermLength(l,s){return s.visibleGlobalOptions(l).reduce((i,n)=>{return Math.max(i,this.displayWidth(s.styleOptionTerm(s.optionTerm(n))))},0)}longestArgumentTermLength(l,s){return s.visibleArguments(l).reduce((i,n)=>{return Math.max(i,this.displayWidth(s.styleArgumentTerm(s.argumentTerm(n))))},0)}commandUsage(l){let s=l._name;if(l._aliases[0])s=s+"|"+l._aliases[0];let i="";for(let n=l.parent;n;n=n.parent)i=n.name()+" "+i;return i+s+" "+l.usage()}commandDescription(l){return l.description()}subcommandDescription(l){return l.summary()||l.description()}optionDescription(l){let s=[];if(l.argChoices)s.push(`choices: ${l.argChoices.map((i)=>JSON.stringify(i)).join(", ")}`);if(l.defaultValue!==void 0){if(l.required||l.optional||l.isBoolean()&&typeof l.defaultValue==="boolean")s.push(`default: ${l.defaultValueDescription||JSON.stringify(l.defaultValue)}`)}if(l.presetArg!==void 0&&l.optional)s.push(`preset: ${JSON.stringify(l.presetArg)}`);if(l.envVar!==void 0)s.push(`env: ${l.envVar}`);if(s.length>0){let i=`(${s.join(", ")})`;if(l.description)return`${l.description} ${i}`;return i}return l.description}argumentDescription(l){let s=[];if(l.argChoices)s.push(`choices: ${l.argChoices.map((i)=>JSON.stringify(i)).join(", ")}`);if(l.defaultValue!==void 0)s.push(`default: ${l.defaultValueDescription||JSON.stringify(l.defaultValue)}`);if(s.length>0){let i=`(${s.join(", ")})`;if(l.description)return`${l.description} ${i}`;return i}return l.description}formatItemList(l,s,i){if(s.length===0)return[];return[i.styleTitle(l),...s,""]}groupItems(l,s,i){let n=new Map;return l.forEach((f)=>{let c=i(f);if(!n.has(c))n.set(c,[])}),s.forEach((f)=>{let c=i(f);if(!n.has(c))n.set(c,[]);n.get(c).push(f)}),n}formatHelp(l,s){let i=s.padWidth(l,s),n=s.helpWidth??80;function f(k,b){return s.formatItem(k,i,b,s)}let c=[`${s.styleTitle("Usage:")} ${s.styleUsage(s.commandUsage(l))}`,""],t=s.commandDescription(l);if(t.length>0)c=c.concat([s.boxWrap(s.styleCommandDescription(t),n),""]);let r=s.visibleArguments(l).map((k)=>{return f(s.styleArgumentTerm(s.argumentTerm(k)),s.styleArgumentDescription(s.argumentDescription(k)))});if(c=c.concat(this.formatItemList("Arguments:",r,s)),this.groupItems(l.options,s.visibleOptions(l),(k)=>k.helpGroupHeading??"Options:").forEach((k,b)=>{let $=k.map((y)=>{return f(s.styleOptionTerm(s.optionTerm(y)),s.styleOptionDescription(s.optionDescription(y)))});c=c.concat(this.formatItemList(b,$,s))}),s.showGlobalOptions){let k=s.visibleGlobalOptions(l).map((b)=>{return f(s.styleOptionTerm(s.optionTerm(b)),s.styleOptionDescription(s.optionDescription(b)))});c=c.concat(this.formatItemList("Global Options:",k,s))}return this.groupItems(l.commands,s.visibleCommands(l),(k)=>k.helpGroup()||"Commands:").forEach((k,b)=>{let $=k.map((y)=>{return f(s.styleSubcommandTerm(s.subcommandTerm(y)),s.styleSubcommandDescription(s.subcommandDescription(y)))});c=c.concat(this.formatItemList(b,$,s))}),c.join(`
3
+ `)}displayWidth(l){return $s(l).length}styleTitle(l){return l}styleUsage(l){return l.split(" ").map((s)=>{if(s==="[options]")return this.styleOptionText(s);if(s==="[command]")return this.styleSubcommandText(s);if(s[0]==="["||s[0]==="<")return this.styleArgumentText(s);return this.styleCommandText(s)}).join(" ")}styleCommandDescription(l){return this.styleDescriptionText(l)}styleOptionDescription(l){return this.styleDescriptionText(l)}styleSubcommandDescription(l){return this.styleDescriptionText(l)}styleArgumentDescription(l){return this.styleDescriptionText(l)}styleDescriptionText(l){return l}styleOptionTerm(l){return this.styleOptionText(l)}styleSubcommandTerm(l){return l.split(" ").map((s)=>{if(s==="[options]")return this.styleOptionText(s);if(s[0]==="["||s[0]==="<")return this.styleArgumentText(s);return this.styleSubcommandText(s)}).join(" ")}styleArgumentTerm(l){return this.styleArgumentText(l)}styleOptionText(l){return l}styleArgumentText(l){return l}styleSubcommandText(l){return l}styleCommandText(l){return l}padWidth(l,s){return Math.max(s.longestOptionTermLength(l,s),s.longestGlobalOptionTermLength(l,s),s.longestSubcommandTermLength(l,s),s.longestArgumentTermLength(l,s))}preformatted(l){return/\n[^\S\r\n]/.test(l)}formatItem(l,s,i,n){let c=" ".repeat(2);if(!i)return c+l;let t=l.padEnd(s+l.length-n.displayWidth(l)),r=2,e=(this.helpWidth??80)-s-r-2,k;if(e<this.minWidthToWrap||n.preformatted(i))k=i;else k=n.boxWrap(i,e).replace(/\n/g,`
4
+ `+" ".repeat(s+r));return c+t+" ".repeat(r)+k.replace(/\n/g,`
5
+ ${c}`)}boxWrap(l,s){if(s<this.minWidthToWrap)return l;let i=l.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,f=[];return i.forEach((c)=>{let t=c.match(n);if(t===null){f.push("");return}let r=[t.shift()],a=this.displayWidth(r[0]);t.forEach((e)=>{let k=this.displayWidth(e);if(a+k<=s){r.push(e),a+=k;return}f.push(r.join(""));let b=e.trimStart();r=[b],a=this.displayWidth(b)}),f.push(r.join(""))}),f.join(`
6
+ `)}}function $s(l){let s=/\x1b\[\d*(;\d*)*m/g;return l.replace(s,"")}Zt.Help=Ss;Zt.stripColor=$s});var Ml=v((Wt)=>{var{InvalidArgumentError:Kt}=al();class bs{constructor(l,s){this.flags=l,this.description=s||"",this.required=l.includes("<"),this.optional=l.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(l),this.mandatory=!1;let i=xt(l);if(this.short=i.shortFlag,this.long=i.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(l,s){return this.defaultValue=l,this.defaultValueDescription=s,this}preset(l){return this.presetArg=l,this}conflicts(l){return this.conflictsWith=this.conflictsWith.concat(l),this}implies(l){let s=l;if(typeof l==="string")s={[l]:!0};return this.implied=Object.assign(this.implied||{},s),this}env(l){return this.envVar=l,this}argParser(l){return this.parseArg=l,this}makeOptionMandatory(l=!0){return this.mandatory=!!l,this}hideHelp(l=!0){return this.hidden=!!l,this}_collectValue(l,s){if(s===this.defaultValue||!Array.isArray(s))return[l];return s.push(l),s}choices(l){return this.argChoices=l.slice(),this.parseArg=(s,i)=>{if(!this.argChoices.includes(s))throw new Kt(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(s,i);return s},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return os(this.name().replace(/^no-/,""));return os(this.name())}helpGroup(l){return this.helpGroupHeading=l,this}is(l){return this.short===l||this.long===l}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class gs{constructor(l){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,l.forEach((s)=>{if(s.negate)this.negativeOptions.set(s.attributeName(),s);else this.positiveOptions.set(s.attributeName(),s)}),this.negativeOptions.forEach((s,i)=>{if(this.positiveOptions.has(i))this.dualOptions.add(i)})}valueFromOption(l,s){let i=s.attributeName();if(!this.dualOptions.has(i))return!0;let n=this.negativeOptions.get(i).presetArg,f=n!==void 0?n:!1;return s.negate===(f===l)}}function os(l){return l.split("-").reduce((s,i)=>{return s+i[0].toUpperCase()+i.slice(1)})}function xt(l){let s,i,n=/^-[^-]$/,f=/^--[^-]/,c=l.split(/[ |,]+/).concat("guard");if(n.test(c[0]))s=c.shift();if(f.test(c[0]))i=c.shift();if(!s&&n.test(c[0]))s=c.shift();if(!s&&f.test(c[0]))s=i,i=c.shift();if(c[0].startsWith("-")){let t=c[0],r=`option creation failed due to '${t}' in option flags '${l}'`;if(/^-[^-][^-]/.test(t))throw Error(`${r}
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(y.test(t))throw Error(`${$}
10
- - too many short flags`);if(i.test(t))throw Error(`${$}
11
- - too many long flags`);throw Error(`${$}
12
- - unrecognised flag format`)}if(s===void 0&&f===void 0)throw Error(`option creation failed due to no flags found in '${l}'.`);return{shortFlag:s,longFlag:f}}Vt.Option=gs;Vt.DualOptions=Us});var Ls=a((at)=>{function Ot(l,s){if(Math.abs(l.length-s.length)>3)return Math.max(l.length,s.length);let f=[];for(let y=0;y<=l.length;y++)f[y]=[y];for(let y=0;y<=s.length;y++)f[0][y]=y;for(let y=1;y<=s.length;y++)for(let i=1;i<=l.length;i++){let S=1;if(l[i-1]===s[y-1])S=0;else S=1;if(f[i][y]=Math.min(f[i-1][y]+1,f[i][y-1]+1,f[i-1][y-1]+S),i>1&&y>1&&l[i-1]===s[y-2]&&l[i-2]===s[y-1])f[i][y]=Math.min(f[i][y],f[i-2][y-2]+1)}return f[l.length][s.length]}function Ft(l,s){if(!s||s.length===0)return"";s=Array.from(new Set(s));let f=l.startsWith("--");if(f)l=l.slice(2),s=s.map((t)=>t.slice(2));let y=[],i=3,S=0.4;if(s.forEach((t)=>{if(t.length<=1)return;let $=Ot(l,t),c=Math.max(l.length,t.length);if((c-$)/c>S){if($<i)i=$,y=[t];else if($===i)y.push(t)}}),y.sort((t,$)=>t.localeCompare($)),f)y=y.map((t)=>`--${t}`);if(y.length>1)return`
13
- (Did you mean one of ${y.join(", ")}?)`;if(y.length===1)return`
14
- (Did you mean ${y[0]}?)`;return""}at.suggestSimilar=Ft});var _s=a((Dt)=>{var ot=il("node:events").EventEmitter,Ml=il("node:child_process"),v=il("node:path"),bl=il("node:fs"),B=il("node:process"),{Argument:mt,humanReadableArgName:ut}=cl(),{CommanderError:Hl}=Sl(),{Help:dt,stripColor:et}=Zl(),{Option:Rs,DualOptions:pt}=jl(),{suggestSimilar:Ts}=Ls();class Wl extends ot{constructor(l){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=l||"",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:(s)=>B.stdout.write(s),writeErr:(s)=>B.stderr.write(s),outputError:(s,f)=>f(s),getOutHelpWidth:()=>B.stdout.isTTY?B.stdout.columns:void 0,getErrHelpWidth:()=>B.stderr.isTTY?B.stderr.columns:void 0,getOutHasColors:()=>Kl()??(B.stdout.isTTY&&B.stdout.hasColors?.()),getErrHasColors:()=>Kl()??(B.stderr.isTTY&&B.stderr.hasColors?.()),stripColor:(s)=>et(s)},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(l){return this._outputConfiguration=l._outputConfiguration,this._helpOption=l._helpOption,this._helpCommand=l._helpCommand,this._helpConfiguration=l._helpConfiguration,this._exitCallback=l._exitCallback,this._storeOptionsAsProperties=l._storeOptionsAsProperties,this._combineFlagAndOptionalValue=l._combineFlagAndOptionalValue,this._allowExcessArguments=l._allowExcessArguments,this._enablePositionalOptions=l._enablePositionalOptions,this._showHelpAfterError=l._showHelpAfterError,this._showSuggestionAfterError=l._showSuggestionAfterError,this}_getCommandAndAncestors(){let l=[];for(let s=this;s;s=s.parent)l.push(s);return l}command(l,s,f){let y=s,i=f;if(typeof y==="object"&&y!==null)i=y,y=null;i=i||{};let[,S,t]=l.match(/([^ ]+) *(.*)/),$=this.createCommand(S);if(y)$.description(y),$._executableHandler=!0;if(i.isDefault)this._defaultCommandName=$._name;if($._hidden=!!(i.noHelp||i.hidden),$._executableFile=i.executableFile||null,t)$.arguments(t);if(this._registerCommand($),$.parent=this,$.copyInheritedSettings(this),y)return this;return $}createCommand(l){return new Wl(l)}createHelp(){return Object.assign(new dt,this.configureHelp())}configureHelp(l){if(l===void 0)return this._helpConfiguration;return this._helpConfiguration=l,this}configureOutput(l){if(l===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...l},this}showHelpAfterError(l=!0){if(typeof l!=="string")l=!!l;return this._showHelpAfterError=l,this}showSuggestionAfterError(l=!0){return this._showSuggestionAfterError=!!l,this}addCommand(l,s){if(!l._name)throw Error(`Command passed to .addCommand() must have a name
15
- - specify the name in Command constructor or using .name()`);if(s=s||{},s.isDefault)this._defaultCommandName=l._name;if(s.noHelp||s.hidden)l._hidden=!0;return this._registerCommand(l),l.parent=this,l._checkForBrokenPassThrough(),this}createArgument(l,s){return new mt(l,s)}argument(l,s,f,y){let i=this.createArgument(l,s);if(typeof f==="function")i.default(y).argParser(f);else i.default(f);return this.addArgument(i),this}arguments(l){return l.trim().split(/ +/).forEach((s)=>{this.argument(s)}),this}addArgument(l){let s=this.registeredArguments.slice(-1)[0];if(s?.variadic)throw Error(`only the last argument can be variadic '${s.name()}'`);if(l.required&&l.defaultValue!==void 0&&l.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${l.name()}'`);return this.registeredArguments.push(l),this}helpCommand(l,s){if(typeof l==="boolean"){if(this._addImplicitHelpCommand=l,l&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let f=l??"help [command]",[,y,i]=f.match(/([^ ]+) *(.*)/),S=s??"display help for command",t=this.createCommand(y);if(t.helpOption(!1),i)t.arguments(i);if(S)t.description(S);if(this._addImplicitHelpCommand=!0,this._helpCommand=t,l||s)this._initCommandGroup(t);return this}addHelpCommand(l,s){if(typeof l!=="object")return this.helpCommand(l,s),this;return this._addImplicitHelpCommand=!0,this._helpCommand=l,this._initCommandGroup(l),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(l,s){let f=["preSubcommand","preAction","postAction"];if(!f.includes(l))throw Error(`Unexpected value for event passed to hook : '${l}'.
16
- Expecting one of '${f.join("', '")}'`);if(this._lifeCycleHooks[l])this._lifeCycleHooks[l].push(s);else this._lifeCycleHooks[l]=[s];return this}exitOverride(l){if(l)this._exitCallback=l;else this._exitCallback=(s)=>{if(s.code!=="commander.executeSubCommandAsync")throw s};return this}_exit(l,s,f){if(this._exitCallback)this._exitCallback(new Hl(l,s,f));B.exit(l)}action(l){let s=(f)=>{let y=this.registeredArguments.length,i=f.slice(0,y);if(this._storeOptionsAsProperties)i[y]=this;else i[y]=this.opts();return i.push(this),l.apply(this,i)};return this._actionHandler=s,this}createOption(l,s){return new Rs(l,s)}_callParseArg(l,s,f,y){try{return l.parseArg(s,f)}catch(i){if(i.code==="commander.invalidArgument"){let S=`${y} ${i.message}`;this.error(S,{exitCode:i.exitCode,code:i.code})}throw i}}_registerOption(l){let s=l.short&&this._findOption(l.short)||l.long&&this._findOption(l.long);if(s){let f=l.long&&this._findOption(l.long)?l.long:l.short;throw Error(`Cannot add option '${l.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${f}'
17
- - already used by option '${s.flags}'`)}this._initOptionGroup(l),this.options.push(l)}_registerCommand(l){let s=(y)=>{return[y.name()].concat(y.aliases())},f=s(l).find((y)=>this._findCommand(y));if(f){let y=s(this._findCommand(f)).join("|"),i=s(l).join("|");throw Error(`cannot add command '${i}' as already have command '${y}'`)}this._initCommandGroup(l),this.commands.push(l)}addOption(l){this._registerOption(l);let s=l.name(),f=l.attributeName();if(l.negate){let i=l.long.replace(/^--no-/,"--");if(!this._findOption(i))this.setOptionValueWithSource(f,l.defaultValue===void 0?!0:l.defaultValue,"default")}else if(l.defaultValue!==void 0)this.setOptionValueWithSource(f,l.defaultValue,"default");let y=(i,S,t)=>{if(i==null&&l.presetArg!==void 0)i=l.presetArg;let $=this.getOptionValue(f);if(i!==null&&l.parseArg)i=this._callParseArg(l,i,$,S);else if(i!==null&&l.variadic)i=l._collectValue(i,$);if(i==null)if(l.negate)i=!1;else if(l.isBoolean()||l.optional)i=!0;else i="";this.setOptionValueWithSource(f,i,t)};if(this.on("option:"+s,(i)=>{let S=`error: option '${l.flags}' argument '${i}' is invalid.`;y(i,S,"cli")}),l.envVar)this.on("optionEnv:"+s,(i)=>{let S=`error: option '${l.flags}' value '${i}' from env '${l.envVar}' is invalid.`;y(i,S,"env")});return this}_optionEx(l,s,f,y,i){if(typeof s==="object"&&s instanceof Rs)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let S=this.createOption(s,f);if(S.makeOptionMandatory(!!l.mandatory),typeof y==="function")S.default(i).argParser(y);else if(y instanceof RegExp){let t=y;y=($,c)=>{let k=t.exec($);return k?k[0]:c},S.default(i).argParser(y)}else S.default(y);return this.addOption(S)}option(l,s,f,y){return this._optionEx({},l,s,f,y)}requiredOption(l,s,f,y){return this._optionEx({mandatory:!0},l,s,f,y)}combineFlagAndOptionalValue(l=!0){return this._combineFlagAndOptionalValue=!!l,this}allowUnknownOption(l=!0){return this._allowUnknownOption=!!l,this}allowExcessArguments(l=!0){return this._allowExcessArguments=!!l,this}enablePositionalOptions(l=!0){return this._enablePositionalOptions=!!l,this}passThroughOptions(l=!0){return this._passThroughOptions=!!l,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(l=!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=!!l,this}getOptionValue(l){if(this._storeOptionsAsProperties)return this[l];return this._optionValues[l]}setOptionValue(l,s){return this.setOptionValueWithSource(l,s,void 0)}setOptionValueWithSource(l,s,f){if(this._storeOptionsAsProperties)this[l]=s;else this._optionValues[l]=s;return this._optionValueSources[l]=f,this}getOptionValueSource(l){return this._optionValueSources[l]}getOptionValueSourceWithGlobals(l){let s;return this._getCommandAndAncestors().forEach((f)=>{if(f.getOptionValueSource(l)!==void 0)s=f.getOptionValueSource(l)}),s}_prepareUserArgs(l,s){if(l!==void 0&&!Array.isArray(l))throw Error("first parameter to parse must be array or undefined");if(s=s||{},l===void 0&&s.from===void 0){if(B.versions?.electron)s.from="electron";let y=B.execArgv??[];if(y.includes("-e")||y.includes("--eval")||y.includes("-p")||y.includes("--print"))s.from="eval"}if(l===void 0)l=B.argv;this.rawArgs=l.slice();let f;switch(s.from){case void 0:case"node":this._scriptPath=l[1],f=l.slice(2);break;case"electron":if(B.defaultApp)this._scriptPath=l[1],f=l.slice(2);else f=l.slice(1);break;case"user":f=l.slice(0);break;case"eval":f=l.slice(1);break;default:throw Error(`unexpected parse option { from: '${s.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",f}parse(l,s){this._prepareForParse();let f=this._prepareUserArgs(l,s);return this._parseCommand([],f),this}async parseAsync(l,s){this._prepareForParse();let f=this._prepareUserArgs(l,s);return await this._parseCommand([],f),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(l,s,f){if(bl.existsSync(l))return;let y=s?`searched for local subcommand relative to directory '${s}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",i=`'${l}' does not exist
19
- - if '${f}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
9
+ - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(n.test(t))throw Error(`${r}
10
+ - too many short flags`);if(f.test(t))throw Error(`${r}
11
+ - too many long flags`);throw Error(`${r}
12
+ - unrecognised flag format`)}if(s===void 0&&i===void 0)throw Error(`option creation failed due to no flags found in '${l}'.`);return{shortFlag:s,longFlag:i}}Wt.Option=bs;Wt.DualOptions=gs});var Is=v((At)=>{function Vt(l,s){if(Math.abs(l.length-s.length)>3)return Math.max(l.length,s.length);let i=[];for(let n=0;n<=l.length;n++)i[n]=[n];for(let n=0;n<=s.length;n++)i[0][n]=n;for(let n=1;n<=s.length;n++)for(let f=1;f<=l.length;f++){let c=1;if(l[f-1]===s[n-1])c=0;else c=1;if(i[f][n]=Math.min(i[f-1][n]+1,i[f][n-1]+1,i[f-1][n-1]+c),f>1&&n>1&&l[f-1]===s[n-2]&&l[f-2]===s[n-1])i[f][n]=Math.min(i[f][n],i[f-2][n-2]+1)}return i[l.length][s.length]}function mt(l,s){if(!s||s.length===0)return"";s=Array.from(new Set(s));let i=l.startsWith("--");if(i)l=l.slice(2),s=s.map((t)=>t.slice(2));let n=[],f=3,c=0.4;if(s.forEach((t)=>{if(t.length<=1)return;let r=Vt(l,t),a=Math.max(l.length,t.length);if((a-r)/a>c){if(r<f)f=r,n=[t];else if(r===f)n.push(t)}}),n.sort((t,r)=>t.localeCompare(r)),i)n=n.map((t)=>`--${t}`);if(n.length>1)return`
13
+ (Did you mean one of ${n.join(", ")}?)`;if(n.length===1)return`
14
+ (Did you mean ${n[0]}?)`;return""}At.suggestSimilar=mt});var Ps=v((li)=>{var Ot=el("node:events").EventEmitter,Ql=el("node:child_process"),O=el("node:path"),bl=el("node:fs"),R=el("node:process"),{Argument:Ft,humanReadableArgName:ut}=ol(),{CommanderError:Zl}=al(),{Help:dt,stripColor:pt}=zl(),{Option:ws,DualOptions:Dt}=Ml(),{suggestSimilar:Rs}=Is();class hl extends Ot{constructor(l){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=l||"",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:(s)=>R.stdout.write(s),writeErr:(s)=>R.stderr.write(s),outputError:(s,i)=>i(s),getOutHelpWidth:()=>R.stdout.isTTY?R.stdout.columns:void 0,getErrHelpWidth:()=>R.stderr.isTTY?R.stderr.columns:void 0,getOutHasColors:()=>Hl()??(R.stdout.isTTY&&R.stdout.hasColors?.()),getErrHasColors:()=>Hl()??(R.stderr.isTTY&&R.stderr.hasColors?.()),stripColor:(s)=>pt(s)},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(l){return this._outputConfiguration=l._outputConfiguration,this._helpOption=l._helpOption,this._helpCommand=l._helpCommand,this._helpConfiguration=l._helpConfiguration,this._exitCallback=l._exitCallback,this._storeOptionsAsProperties=l._storeOptionsAsProperties,this._combineFlagAndOptionalValue=l._combineFlagAndOptionalValue,this._allowExcessArguments=l._allowExcessArguments,this._enablePositionalOptions=l._enablePositionalOptions,this._showHelpAfterError=l._showHelpAfterError,this._showSuggestionAfterError=l._showSuggestionAfterError,this}_getCommandAndAncestors(){let l=[];for(let s=this;s;s=s.parent)l.push(s);return l}command(l,s,i){let n=s,f=i;if(typeof n==="object"&&n!==null)f=n,n=null;f=f||{};let[,c,t]=l.match(/([^ ]+) *(.*)/),r=this.createCommand(c);if(n)r.description(n),r._executableHandler=!0;if(f.isDefault)this._defaultCommandName=r._name;if(r._hidden=!!(f.noHelp||f.hidden),r._executableFile=f.executableFile||null,t)r.arguments(t);if(this._registerCommand(r),r.parent=this,r.copyInheritedSettings(this),n)return this;return r}createCommand(l){return new hl(l)}createHelp(){return Object.assign(new dt,this.configureHelp())}configureHelp(l){if(l===void 0)return this._helpConfiguration;return this._helpConfiguration=l,this}configureOutput(l){if(l===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...l},this}showHelpAfterError(l=!0){if(typeof l!=="string")l=!!l;return this._showHelpAfterError=l,this}showSuggestionAfterError(l=!0){return this._showSuggestionAfterError=!!l,this}addCommand(l,s){if(!l._name)throw Error(`Command passed to .addCommand() must have a name
15
+ - specify the name in Command constructor or using .name()`);if(s=s||{},s.isDefault)this._defaultCommandName=l._name;if(s.noHelp||s.hidden)l._hidden=!0;return this._registerCommand(l),l.parent=this,l._checkForBrokenPassThrough(),this}createArgument(l,s){return new Ft(l,s)}argument(l,s,i,n){let f=this.createArgument(l,s);if(typeof i==="function")f.default(n).argParser(i);else f.default(i);return this.addArgument(f),this}arguments(l){return l.trim().split(/ +/).forEach((s)=>{this.argument(s)}),this}addArgument(l){let s=this.registeredArguments.slice(-1)[0];if(s?.variadic)throw Error(`only the last argument can be variadic '${s.name()}'`);if(l.required&&l.defaultValue!==void 0&&l.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${l.name()}'`);return this.registeredArguments.push(l),this}helpCommand(l,s){if(typeof l==="boolean"){if(this._addImplicitHelpCommand=l,l&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let i=l??"help [command]",[,n,f]=i.match(/([^ ]+) *(.*)/),c=s??"display help for command",t=this.createCommand(n);if(t.helpOption(!1),f)t.arguments(f);if(c)t.description(c);if(this._addImplicitHelpCommand=!0,this._helpCommand=t,l||s)this._initCommandGroup(t);return this}addHelpCommand(l,s){if(typeof l!=="object")return this.helpCommand(l,s),this;return this._addImplicitHelpCommand=!0,this._helpCommand=l,this._initCommandGroup(l),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(l,s){let i=["preSubcommand","preAction","postAction"];if(!i.includes(l))throw Error(`Unexpected value for event passed to hook : '${l}'.
16
+ Expecting one of '${i.join("', '")}'`);if(this._lifeCycleHooks[l])this._lifeCycleHooks[l].push(s);else this._lifeCycleHooks[l]=[s];return this}exitOverride(l){if(l)this._exitCallback=l;else this._exitCallback=(s)=>{if(s.code!=="commander.executeSubCommandAsync")throw s};return this}_exit(l,s,i){if(this._exitCallback)this._exitCallback(new Zl(l,s,i));R.exit(l)}action(l){let s=(i)=>{let n=this.registeredArguments.length,f=i.slice(0,n);if(this._storeOptionsAsProperties)f[n]=this;else f[n]=this.opts();return f.push(this),l.apply(this,f)};return this._actionHandler=s,this}createOption(l,s){return new ws(l,s)}_callParseArg(l,s,i,n){try{return l.parseArg(s,i)}catch(f){if(f.code==="commander.invalidArgument"){let c=`${n} ${f.message}`;this.error(c,{exitCode:f.exitCode,code:f.code})}throw f}}_registerOption(l){let s=l.short&&this._findOption(l.short)||l.long&&this._findOption(l.long);if(s){let i=l.long&&this._findOption(l.long)?l.long:l.short;throw Error(`Cannot add option '${l.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'
17
+ - already used by option '${s.flags}'`)}this._initOptionGroup(l),this.options.push(l)}_registerCommand(l){let s=(n)=>{return[n.name()].concat(n.aliases())},i=s(l).find((n)=>this._findCommand(n));if(i){let n=s(this._findCommand(i)).join("|"),f=s(l).join("|");throw Error(`cannot add command '${f}' as already have command '${n}'`)}this._initCommandGroup(l),this.commands.push(l)}addOption(l){this._registerOption(l);let s=l.name(),i=l.attributeName();if(l.negate){let f=l.long.replace(/^--no-/,"--");if(!this._findOption(f))this.setOptionValueWithSource(i,l.defaultValue===void 0?!0:l.defaultValue,"default")}else if(l.defaultValue!==void 0)this.setOptionValueWithSource(i,l.defaultValue,"default");let n=(f,c,t)=>{if(f==null&&l.presetArg!==void 0)f=l.presetArg;let r=this.getOptionValue(i);if(f!==null&&l.parseArg)f=this._callParseArg(l,f,r,c);else if(f!==null&&l.variadic)f=l._collectValue(f,r);if(f==null)if(l.negate)f=!1;else if(l.isBoolean()||l.optional)f=!0;else f="";this.setOptionValueWithSource(i,f,t)};if(this.on("option:"+s,(f)=>{let c=`error: option '${l.flags}' argument '${f}' is invalid.`;n(f,c,"cli")}),l.envVar)this.on("optionEnv:"+s,(f)=>{let c=`error: option '${l.flags}' value '${f}' from env '${l.envVar}' is invalid.`;n(f,c,"env")});return this}_optionEx(l,s,i,n,f){if(typeof s==="object"&&s instanceof ws)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let c=this.createOption(s,i);if(c.makeOptionMandatory(!!l.mandatory),typeof n==="function")c.default(f).argParser(n);else if(n instanceof RegExp){let t=n;n=(r,a)=>{let e=t.exec(r);return e?e[0]:a},c.default(f).argParser(n)}else c.default(n);return this.addOption(c)}option(l,s,i,n){return this._optionEx({},l,s,i,n)}requiredOption(l,s,i,n){return this._optionEx({mandatory:!0},l,s,i,n)}combineFlagAndOptionalValue(l=!0){return this._combineFlagAndOptionalValue=!!l,this}allowUnknownOption(l=!0){return this._allowUnknownOption=!!l,this}allowExcessArguments(l=!0){return this._allowExcessArguments=!!l,this}enablePositionalOptions(l=!0){return this._enablePositionalOptions=!!l,this}passThroughOptions(l=!0){return this._passThroughOptions=!!l,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(l=!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=!!l,this}getOptionValue(l){if(this._storeOptionsAsProperties)return this[l];return this._optionValues[l]}setOptionValue(l,s){return this.setOptionValueWithSource(l,s,void 0)}setOptionValueWithSource(l,s,i){if(this._storeOptionsAsProperties)this[l]=s;else this._optionValues[l]=s;return this._optionValueSources[l]=i,this}getOptionValueSource(l){return this._optionValueSources[l]}getOptionValueSourceWithGlobals(l){let s;return this._getCommandAndAncestors().forEach((i)=>{if(i.getOptionValueSource(l)!==void 0)s=i.getOptionValueSource(l)}),s}_prepareUserArgs(l,s){if(l!==void 0&&!Array.isArray(l))throw Error("first parameter to parse must be array or undefined");if(s=s||{},l===void 0&&s.from===void 0){if(R.versions?.electron)s.from="electron";let n=R.execArgv??[];if(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))s.from="eval"}if(l===void 0)l=R.argv;this.rawArgs=l.slice();let i;switch(s.from){case void 0:case"node":this._scriptPath=l[1],i=l.slice(2);break;case"electron":if(R.defaultApp)this._scriptPath=l[1],i=l.slice(2);else i=l.slice(1);break;case"user":i=l.slice(0);break;case"eval":i=l.slice(1);break;default:throw Error(`unexpected parse option { from: '${s.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",i}parse(l,s){this._prepareForParse();let i=this._prepareUserArgs(l,s);return this._parseCommand([],i),this}async parseAsync(l,s){this._prepareForParse();let i=this._prepareUserArgs(l,s);return await this._parseCommand([],i),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(l,s,i){if(bl.existsSync(l))return;let n=s?`searched for local subcommand relative to directory '${s}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",f=`'${l}' does not exist
19
+ - if '${i}' 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
- - ${y}`;throw Error(i)}_executeSubCommand(l,s){s=s.slice();let f=!1,y=[".js",".ts",".tsx",".mjs",".cjs"];function i(k,b){let U=v.resolve(k,b);if(bl.existsSync(U))return U;if(y.includes(v.extname(b)))return;let w=y.find((n)=>bl.existsSync(`${U}${n}`));if(w)return`${U}${w}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let S=l._executableFile||`${this._name}-${l._name}`,t=this._executableDir||"";if(this._scriptPath){let k;try{k=bl.realpathSync(this._scriptPath)}catch{k=this._scriptPath}t=v.resolve(v.dirname(k),t)}if(t){let k=i(t,S);if(!k&&!l._executableFile&&this._scriptPath){let b=v.basename(this._scriptPath,v.extname(this._scriptPath));if(b!==this._name)k=i(t,`${b}-${l._name}`)}S=k||S}f=y.includes(v.extname(S));let $;if(B.platform!=="win32")if(f)s.unshift(S),s=Bs(B.execArgv).concat(s),$=Ml.spawn(B.argv[0],s,{stdio:"inherit"});else $=Ml.spawn(S,s,{stdio:"inherit"});else this._checkForMissingExecutable(S,t,l._name),s.unshift(S),s=Bs(B.execArgv).concat(s),$=Ml.spawn(B.execPath,s,{stdio:"inherit"});if(!$.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((b)=>{B.on(b,()=>{if($.killed===!1&&$.exitCode===null)$.kill(b)})});let c=this._exitCallback;$.on("close",(k)=>{if(k=k??1,!c)B.exit(k);else c(new Hl(k,"commander.executeSubCommandAsync","(close)"))}),$.on("error",(k)=>{if(k.code==="ENOENT")this._checkForMissingExecutable(S,t,l._name);else if(k.code==="EACCES")throw Error(`'${S}' not executable`);if(!c)B.exit(1);else{let b=new Hl(1,"commander.executeSubCommandAsync","(error)");b.nestedError=k,c(b)}}),this.runningCommand=$}_dispatchSubcommand(l,s,f){let y=this._findCommand(l);if(!y)this.help({error:!0});y._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,y,"preSubcommand"),i=this._chainOrCall(i,()=>{if(y._executableHandler)this._executeSubCommand(y,s.concat(f));else return y._parseCommand(s,f)}),i}_dispatchHelpCommand(l){if(!l)this.help();let s=this._findCommand(l);if(s&&!s._executableHandler)s.help();return this._dispatchSubcommand(l,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((l,s)=>{if(l.required&&this.args[s]==null)this.missingArgument(l.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 l=(f,y,i)=>{let S=y;if(y!==null&&f.parseArg){let t=`error: command-argument value '${y}' is invalid for argument '${f.name()}'.`;S=this._callParseArg(f,y,i,t)}return S};this._checkNumberOfArguments();let s=[];this.registeredArguments.forEach((f,y)=>{let i=f.defaultValue;if(f.variadic){if(y<this.args.length){if(i=this.args.slice(y),f.parseArg)i=i.reduce((S,t)=>{return l(f,t,S)},f.defaultValue)}else if(i===void 0)i=[]}else if(y<this.args.length){if(i=this.args[y],f.parseArg)i=l(f,i,f.defaultValue)}s[y]=i}),this.processedArgs=s}_chainOrCall(l,s){if(l?.then&&typeof l.then==="function")return l.then(()=>s());return s()}_chainOrCallHooks(l,s){let f=l,y=[];if(this._getCommandAndAncestors().reverse().filter((i)=>i._lifeCycleHooks[s]!==void 0).forEach((i)=>{i._lifeCycleHooks[s].forEach((S)=>{y.push({hookedCommand:i,callback:S})})}),s==="postAction")y.reverse();return y.forEach((i)=>{f=this._chainOrCall(f,()=>{return i.callback(i.hookedCommand,this)})}),f}_chainOrCallSubCommandHook(l,s,f){let y=l;if(this._lifeCycleHooks[f]!==void 0)this._lifeCycleHooks[f].forEach((i)=>{y=this._chainOrCall(y,()=>{return i(this,s)})});return y}_parseCommand(l,s){let f=this.parseOptions(s);if(this._parseOptionsEnv(),this._parseOptionsImplied(),l=l.concat(f.operands),s=f.unknown,this.args=l.concat(s),l&&this._findCommand(l[0]))return this._dispatchSubcommand(l[0],l.slice(1),s);if(this._getHelpCommand()&&l[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(l[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(s),this._dispatchSubcommand(this._defaultCommandName,l,s);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(f.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let y=()=>{if(f.unknown.length>0)this.unknownOption(f.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){y(),this._processArguments();let S;if(S=this._chainOrCallHooks(S,"preAction"),S=this._chainOrCall(S,()=>this._actionHandler(this.processedArgs)),this.parent)S=this._chainOrCall(S,()=>{this.parent.emit(i,l,s)});return S=this._chainOrCallHooks(S,"postAction"),S}if(this.parent?.listenerCount(i))y(),this._processArguments(),this.parent.emit(i,l,s);else if(l.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",l,s);if(this.listenerCount("command:*"))this.emit("command:*",l,s);else if(this.commands.length)this.unknownCommand();else y(),this._processArguments()}else if(this.commands.length)y(),this.help({error:!0});else y(),this._processArguments()}_findCommand(l){if(!l)return;return this.commands.find((s)=>s._name===l||s._aliases.includes(l))}_findOption(l){return this.options.find((s)=>s.is(l))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((l)=>{l.options.forEach((s)=>{if(s.mandatory&&l.getOptionValue(s.attributeName())===void 0)l.missingMandatoryOptionValue(s)})})}_checkForConflictingLocalOptions(){let l=this.options.filter((f)=>{let y=f.attributeName();if(this.getOptionValue(y)===void 0)return!1;return this.getOptionValueSource(y)!=="default"});l.filter((f)=>f.conflictsWith.length>0).forEach((f)=>{let y=l.find((i)=>f.conflictsWith.includes(i.attributeName()));if(y)this._conflictingOption(f,y)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((l)=>{l._checkForConflictingLocalOptions()})}parseOptions(l){let s=[],f=[],y=s;function i(k){return k.length>1&&k[0]==="-"}let S=(k)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(k))return!1;return!this._getCommandAndAncestors().some((b)=>b.options.map((U)=>U.short).some((U)=>/^-\d$/.test(U)))},t=null,$=null,c=0;while(c<l.length||$){let k=$??l[c++];if($=null,k==="--"){if(y===f)y.push(k);y.push(...l.slice(c));break}if(t&&(!i(k)||S(k))){this.emit(`option:${t.name()}`,k);continue}if(t=null,i(k)){let b=this._findOption(k);if(b){if(b.required){let U=l[c++];if(U===void 0)this.optionMissingArgument(b);this.emit(`option:${b.name()}`,U)}else if(b.optional){let U=null;if(c<l.length&&(!i(l[c])||S(l[c])))U=l[c++];this.emit(`option:${b.name()}`,U)}else this.emit(`option:${b.name()}`);t=b.variadic?b:null;continue}}if(k.length>2&&k[0]==="-"&&k[1]!=="-"){let b=this._findOption(`-${k[1]}`);if(b){if(b.required||b.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${b.name()}`,k.slice(2));else this.emit(`option:${b.name()}`),$=`-${k.slice(2)}`;continue}}if(/^--[^=]+=/.test(k)){let b=k.indexOf("="),U=this._findOption(k.slice(0,b));if(U&&(U.required||U.optional)){this.emit(`option:${U.name()}`,k.slice(b+1));continue}}if(y===s&&i(k)&&!(this.commands.length===0&&S(k)))y=f;if((this._enablePositionalOptions||this._passThroughOptions)&&s.length===0&&f.length===0){if(this._findCommand(k)){s.push(k),f.push(...l.slice(c));break}else if(this._getHelpCommand()&&k===this._getHelpCommand().name()){s.push(k,...l.slice(c));break}else if(this._defaultCommandName){f.push(k,...l.slice(c));break}}if(this._passThroughOptions){y.push(k,...l.slice(c));break}y.push(k)}return{operands:s,unknown:f}}opts(){if(this._storeOptionsAsProperties){let l={},s=this.options.length;for(let f=0;f<s;f++){let y=this.options[f].attributeName();l[y]=y===this._versionOptionName?this._version:this[y]}return l}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((l,s)=>Object.assign(l,s.opts()),{})}error(l,s){if(this._outputConfiguration.outputError(`${l}
21
+ - ${n}`;throw Error(f)}_executeSubCommand(l,s){s=s.slice();let i=!1,n=[".js",".ts",".tsx",".mjs",".cjs"];function f(e,k){let b=O.resolve(e,k);if(bl.existsSync(b))return b;if(n.includes(O.extname(k)))return;let $=n.find((y)=>bl.existsSync(`${b}${y}`));if($)return`${b}${$}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let c=l._executableFile||`${this._name}-${l._name}`,t=this._executableDir||"";if(this._scriptPath){let e;try{e=bl.realpathSync(this._scriptPath)}catch{e=this._scriptPath}t=O.resolve(O.dirname(e),t)}if(t){let e=f(t,c);if(!e&&!l._executableFile&&this._scriptPath){let k=O.basename(this._scriptPath,O.extname(this._scriptPath));if(k!==this._name)e=f(t,`${k}-${l._name}`)}c=e||c}i=n.includes(O.extname(c));let r;if(R.platform!=="win32")if(i)s.unshift(c),s=Ts(R.execArgv).concat(s),r=Ql.spawn(R.argv[0],s,{stdio:"inherit"});else r=Ql.spawn(c,s,{stdio:"inherit"});else this._checkForMissingExecutable(c,t,l._name),s.unshift(c),s=Ts(R.execArgv).concat(s),r=Ql.spawn(R.execPath,s,{stdio:"inherit"});if(!r.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((k)=>{R.on(k,()=>{if(r.killed===!1&&r.exitCode===null)r.kill(k)})});let a=this._exitCallback;r.on("close",(e)=>{if(e=e??1,!a)R.exit(e);else a(new Zl(e,"commander.executeSubCommandAsync","(close)"))}),r.on("error",(e)=>{if(e.code==="ENOENT")this._checkForMissingExecutable(c,t,l._name);else if(e.code==="EACCES")throw Error(`'${c}' not executable`);if(!a)R.exit(1);else{let k=new Zl(1,"commander.executeSubCommandAsync","(error)");k.nestedError=e,a(k)}}),this.runningCommand=r}_dispatchSubcommand(l,s,i){let n=this._findCommand(l);if(!n)this.help({error:!0});n._prepareForParse();let f;return f=this._chainOrCallSubCommandHook(f,n,"preSubcommand"),f=this._chainOrCall(f,()=>{if(n._executableHandler)this._executeSubCommand(n,s.concat(i));else return n._parseCommand(s,i)}),f}_dispatchHelpCommand(l){if(!l)this.help();let s=this._findCommand(l);if(s&&!s._executableHandler)s.help();return this._dispatchSubcommand(l,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((l,s)=>{if(l.required&&this.args[s]==null)this.missingArgument(l.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 l=(i,n,f)=>{let c=n;if(n!==null&&i.parseArg){let t=`error: command-argument value '${n}' is invalid for argument '${i.name()}'.`;c=this._callParseArg(i,n,f,t)}return c};this._checkNumberOfArguments();let s=[];this.registeredArguments.forEach((i,n)=>{let f=i.defaultValue;if(i.variadic){if(n<this.args.length){if(f=this.args.slice(n),i.parseArg)f=f.reduce((c,t)=>{return l(i,t,c)},i.defaultValue)}else if(f===void 0)f=[]}else if(n<this.args.length){if(f=this.args[n],i.parseArg)f=l(i,f,i.defaultValue)}s[n]=f}),this.processedArgs=s}_chainOrCall(l,s){if(l?.then&&typeof l.then==="function")return l.then(()=>s());return s()}_chainOrCallHooks(l,s){let i=l,n=[];if(this._getCommandAndAncestors().reverse().filter((f)=>f._lifeCycleHooks[s]!==void 0).forEach((f)=>{f._lifeCycleHooks[s].forEach((c)=>{n.push({hookedCommand:f,callback:c})})}),s==="postAction")n.reverse();return n.forEach((f)=>{i=this._chainOrCall(i,()=>{return f.callback(f.hookedCommand,this)})}),i}_chainOrCallSubCommandHook(l,s,i){let n=l;if(this._lifeCycleHooks[i]!==void 0)this._lifeCycleHooks[i].forEach((f)=>{n=this._chainOrCall(n,()=>{return f(this,s)})});return n}_parseCommand(l,s){let i=this.parseOptions(s);if(this._parseOptionsEnv(),this._parseOptionsImplied(),l=l.concat(i.operands),s=i.unknown,this.args=l.concat(s),l&&this._findCommand(l[0]))return this._dispatchSubcommand(l[0],l.slice(1),s);if(this._getHelpCommand()&&l[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(l[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(s),this._dispatchSubcommand(this._defaultCommandName,l,s);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{if(i.unknown.length>0)this.unknownOption(i.unknown[0])},f=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let c;if(c=this._chainOrCallHooks(c,"preAction"),c=this._chainOrCall(c,()=>this._actionHandler(this.processedArgs)),this.parent)c=this._chainOrCall(c,()=>{this.parent.emit(f,l,s)});return c=this._chainOrCallHooks(c,"postAction"),c}if(this.parent?.listenerCount(f))n(),this._processArguments(),this.parent.emit(f,l,s);else if(l.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",l,s);if(this.listenerCount("command:*"))this.emit("command:*",l,s);else if(this.commands.length)this.unknownCommand();else n(),this._processArguments()}else if(this.commands.length)n(),this.help({error:!0});else n(),this._processArguments()}_findCommand(l){if(!l)return;return this.commands.find((s)=>s._name===l||s._aliases.includes(l))}_findOption(l){return this.options.find((s)=>s.is(l))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((l)=>{l.options.forEach((s)=>{if(s.mandatory&&l.getOptionValue(s.attributeName())===void 0)l.missingMandatoryOptionValue(s)})})}_checkForConflictingLocalOptions(){let l=this.options.filter((i)=>{let n=i.attributeName();if(this.getOptionValue(n)===void 0)return!1;return this.getOptionValueSource(n)!=="default"});l.filter((i)=>i.conflictsWith.length>0).forEach((i)=>{let n=l.find((f)=>i.conflictsWith.includes(f.attributeName()));if(n)this._conflictingOption(i,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((l)=>{l._checkForConflictingLocalOptions()})}parseOptions(l){let s=[],i=[],n=s;function f(e){return e.length>1&&e[0]==="-"}let c=(e)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(e))return!1;return!this._getCommandAndAncestors().some((k)=>k.options.map((b)=>b.short).some((b)=>/^-\d$/.test(b)))},t=null,r=null,a=0;while(a<l.length||r){let e=r??l[a++];if(r=null,e==="--"){if(n===i)n.push(e);n.push(...l.slice(a));break}if(t&&(!f(e)||c(e))){this.emit(`option:${t.name()}`,e);continue}if(t=null,f(e)){let k=this._findOption(e);if(k){if(k.required){let b=l[a++];if(b===void 0)this.optionMissingArgument(k);this.emit(`option:${k.name()}`,b)}else if(k.optional){let b=null;if(a<l.length&&(!f(l[a])||c(l[a])))b=l[a++];this.emit(`option:${k.name()}`,b)}else this.emit(`option:${k.name()}`);t=k.variadic?k:null;continue}}if(e.length>2&&e[0]==="-"&&e[1]!=="-"){let k=this._findOption(`-${e[1]}`);if(k){if(k.required||k.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${k.name()}`,e.slice(2));else this.emit(`option:${k.name()}`),r=`-${e.slice(2)}`;continue}}if(/^--[^=]+=/.test(e)){let k=e.indexOf("="),b=this._findOption(e.slice(0,k));if(b&&(b.required||b.optional)){this.emit(`option:${b.name()}`,e.slice(k+1));continue}}if(n===s&&f(e)&&!(this.commands.length===0&&c(e)))n=i;if((this._enablePositionalOptions||this._passThroughOptions)&&s.length===0&&i.length===0){if(this._findCommand(e)){s.push(e),i.push(...l.slice(a));break}else if(this._getHelpCommand()&&e===this._getHelpCommand().name()){s.push(e,...l.slice(a));break}else if(this._defaultCommandName){i.push(e,...l.slice(a));break}}if(this._passThroughOptions){n.push(e,...l.slice(a));break}n.push(e)}return{operands:s,unknown:i}}opts(){if(this._storeOptionsAsProperties){let l={},s=this.options.length;for(let i=0;i<s;i++){let n=this.options[i].attributeName();l[n]=n===this._versionOptionName?this._version:this[n]}return l}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((l,s)=>Object.assign(l,s.opts()),{})}error(l,s){if(this._outputConfiguration.outputError(`${l}
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 f=s||{},y=f.exitCode||1,i=f.code||"commander.error";this._exit(y,i,l)}_parseOptionsEnv(){this.options.forEach((l)=>{if(l.envVar&&l.envVar in B.env){let s=l.attributeName();if(this.getOptionValue(s)===void 0||["default","config","env"].includes(this.getOptionValueSource(s)))if(l.required||l.optional)this.emit(`optionEnv:${l.name()}`,B.env[l.envVar]);else this.emit(`optionEnv:${l.name()}`)}})}_parseOptionsImplied(){let l=new pt(this.options),s=(f)=>{return this.getOptionValue(f)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(f))};this.options.filter((f)=>f.implied!==void 0&&s(f.attributeName())&&l.valueFromOption(this.getOptionValue(f.attributeName()),f)).forEach((f)=>{Object.keys(f.implied).filter((y)=>!s(y)).forEach((y)=>{this.setOptionValueWithSource(y,f.implied[y],"implied")})})}missingArgument(l){let s=`error: missing required argument '${l}'`;this.error(s,{code:"commander.missingArgument"})}optionMissingArgument(l){let s=`error: option '${l.flags}' argument missing`;this.error(s,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(l){let s=`error: required option '${l.flags}' not specified`;this.error(s,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(l,s){let f=(S)=>{let t=S.attributeName(),$=this.getOptionValue(t),c=this.options.find((b)=>b.negate&&t===b.attributeName()),k=this.options.find((b)=>!b.negate&&t===b.attributeName());if(c&&(c.presetArg===void 0&&$===!1||c.presetArg!==void 0&&$===c.presetArg))return c;return k||S},y=(S)=>{let t=f(S),$=t.attributeName();if(this.getOptionValueSource($)==="env")return`environment variable '${t.envVar}'`;return`option '${t.flags}'`},i=`error: ${y(l)} cannot be used with ${y(s)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(l){if(this._allowUnknownOption)return;let s="";if(l.startsWith("--")&&this._showSuggestionAfterError){let y=[],i=this;do{let S=i.createHelp().visibleOptions(i).filter((t)=>t.long).map((t)=>t.long);y=y.concat(S),i=i.parent}while(i&&!i._enablePositionalOptions);s=Ts(l,y)}let f=`error: unknown option '${l}'${s}`;this.error(f,{code:"commander.unknownOption"})}_excessArguments(l){if(this._allowExcessArguments)return;let s=this.registeredArguments.length,f=s===1?"":"s",i=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${s} argument${f} but got ${l.length}.`;this.error(i,{code:"commander.excessArguments"})}unknownCommand(){let l=this.args[0],s="";if(this._showSuggestionAfterError){let y=[];this.createHelp().visibleCommands(this).forEach((i)=>{if(y.push(i.name()),i.alias())y.push(i.alias())}),s=Ts(l,y)}let f=`error: unknown command '${l}'${s}`;this.error(f,{code:"commander.unknownCommand"})}version(l,s,f){if(l===void 0)return this._version;this._version=l,s=s||"-V, --version",f=f||"output the version number";let y=this.createOption(s,f);return this._versionOptionName=y.attributeName(),this._registerOption(y),this.on("option:"+y.name(),()=>{this._outputConfiguration.writeOut(`${l}
25
- `),this._exit(0,"commander.version",l)}),this}description(l,s){if(l===void 0&&s===void 0)return this._description;if(this._description=l,s)this._argsDescription=s;return this}summary(l){if(l===void 0)return this._summary;return this._summary=l,this}alias(l){if(l===void 0)return this._aliases[0];let s=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)s=this.commands[this.commands.length-1];if(l===s._name)throw Error("Command alias can't be the same as its name");let f=this.parent?._findCommand(l);if(f){let y=[f.name()].concat(f.aliases()).join("|");throw Error(`cannot add alias '${l}' to command '${this.name()}' as already have command '${y}'`)}return s._aliases.push(l),this}aliases(l){if(l===void 0)return this._aliases;return l.forEach((s)=>this.alias(s)),this}usage(l){if(l===void 0){if(this._usage)return this._usage;let s=this.registeredArguments.map((f)=>{return ut(f)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?s:[]).join(" ")}return this._usage=l,this}name(l){if(l===void 0)return this._name;return this._name=l,this}helpGroup(l){if(l===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=l,this}commandsGroup(l){if(l===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=l,this}optionsGroup(l){if(l===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=l,this}_initOptionGroup(l){if(this._defaultOptionGroup&&!l.helpGroupHeading)l.helpGroup(this._defaultOptionGroup)}_initCommandGroup(l){if(this._defaultCommandGroup&&!l.helpGroup())l.helpGroup(this._defaultCommandGroup)}nameFromFilename(l){return this._name=v.basename(l,v.extname(l)),this}executableDir(l){if(l===void 0)return this._executableDir;return this._executableDir=l,this}helpInformation(l){let s=this.createHelp(),f=this._getOutputContext(l);s.prepareContext({error:f.error,helpWidth:f.helpWidth,outputHasColors:f.hasColors});let y=s.formatHelp(this,s);if(f.hasColors)return y;return this._outputConfiguration.stripColor(y)}_getOutputContext(l){l=l||{};let s=!!l.error,f,y,i;if(s)f=(t)=>this._outputConfiguration.writeErr(t),y=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth();else f=(t)=>this._outputConfiguration.writeOut(t),y=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth();return{error:s,write:(t)=>{if(!y)t=this._outputConfiguration.stripColor(t);return f(t)},hasColors:y,helpWidth:i}}outputHelp(l){let s;if(typeof l==="function")s=l,l=void 0;let f=this._getOutputContext(l),y={error:f.error,write:f.write,command:this};this._getCommandAndAncestors().reverse().forEach((S)=>S.emit("beforeAllHelp",y)),this.emit("beforeHelp",y);let i=this.helpInformation({error:f.error});if(s){if(i=s(i),typeof i!=="string"&&!Buffer.isBuffer(i))throw Error("outputHelp callback must return a string or a Buffer")}if(f.write(i),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",y),this._getCommandAndAncestors().forEach((S)=>S.emit("afterAllHelp",y))}helpOption(l,s){if(typeof l==="boolean"){if(l){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(l??"-h, --help",s??"display help for command"),l||s)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(l){return this._helpOption=l,this._initOptionGroup(l),this}help(l){this.outputHelp(l);let s=Number(B.exitCode??0);if(s===0&&l&&typeof l!=="function"&&l.error)s=1;this._exit(s,"commander.help","(outputHelp)")}addHelpText(l,s){let f=["beforeAll","before","after","afterAll"];if(!f.includes(l))throw Error(`Unexpected value for position to addHelpText.
26
- Expecting one of '${f.join("', '")}'`);let y=`${l}Help`;return this.on(y,(i)=>{let S;if(typeof s==="function")S=s({error:i.error,command:i.command});else S=s;if(S)i.write(`${S}
27
- `)}),this}_outputHelpIfRequested(l){let s=this._getHelpOption();if(s&&l.find((y)=>s.is(y)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function Bs(l){return l.map((s)=>{if(!s.startsWith("--inspect"))return s;let f,y="127.0.0.1",i="9229",S;if((S=s.match(/^(--inspect(-brk)?)$/))!==null)f=S[1];else if((S=s.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(f=S[1],/^\d+$/.test(S[3]))i=S[3];else y=S[3];else if((S=s.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)f=S[1],y=S[3],i=S[4];if(f&&i!=="0")return`${f}=${y}:${parseInt(i)+1}`;return s})}function Kl(){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}Dt.Command=Wl;Dt.useColor=Kl});var Ps=a((yf)=>{var{Argument:qs}=cl(),{Command:El}=_s(),{CommanderError:tf,InvalidArgumentError:rs}=Sl(),{Help:ff}=Zl(),{Option:Js}=jl();yf.program=new El;yf.createCommand=(l)=>new El(l);yf.createOption=(l,s)=>new Js(l,s);yf.createArgument=(l,s)=>new qs(l,s);yf.Command=El;yf.Option=Js;yf.Argument=qs;yf.Help=ff;yf.CommanderError=tf;yf.InvalidArgumentError=rs;yf.InvalidOptionArgumentError=rs});var Cl=a((ci,Gs)=>{var xl={to(l,s){if(!s)return`\x1B[${l+1}G`;return`\x1B[${s+1};${l+1}H`},move(l,s){let f="";if(l<0)f+=`\x1B[${-l}D`;else if(l>0)f+=`\x1B[${l}C`;if(s<0)f+=`\x1B[${-s}A`;else if(s>0)f+=`\x1B[${s}B`;return f},up:(l=1)=>`\x1B[${l}A`,down:(l=1)=>`\x1B[${l}B`,forward:(l=1)=>`\x1B[${l}C`,backward:(l=1)=>`\x1B[${l}D`,nextLine:(l=1)=>"\x1B[E".repeat(l),prevLine:(l=1)=>"\x1B[F".repeat(l),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},Rf={up:(l=1)=>"\x1B[S".repeat(l),down:(l=1)=>"\x1B[T".repeat(l)},Tf={screen:"\x1B[2J",up:(l=1)=>"\x1B[1J".repeat(l),down:(l=1)=>"\x1B[J".repeat(l),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(l){let s="";for(let f=0;f<l;f++)s+=this.line+(f<l-1?xl.up():"");if(l)s+=xl.left;return s}};Gs.exports={cursor:xl,scroll:Rf,erase:Tf,beep:"\x07"}});var sl=a((bi,Nl)=>{var Il=process||{},Xs=Il.argv||[],nl=Il.env||{},Bf=!(!!nl.NO_COLOR||Xs.includes("--no-color"))&&(!!nl.FORCE_COLOR||Xs.includes("--color")||Il.platform==="win32"||(Il.stdout||{}).isTTY&&nl.TERM!=="dumb"||!!nl.CI),_f=(l,s,f=l)=>(y)=>{let i=""+y,S=i.indexOf(s,l.length);return~S?l+qf(i,s,f,S)+s:l+i+s},qf=(l,s,f,y)=>{let i="",S=0;do i+=l.substring(S,y)+f,S=y+s.length,y=l.indexOf(s,S);while(~y);return i+l.substring(S)},zs=(l=Bf)=>{let s=l?_f:()=>String;return{isColorSupported:l,reset:s("\x1B[0m","\x1B[0m"),bold:s("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:s("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:s("\x1B[3m","\x1B[23m"),underline:s("\x1B[4m","\x1B[24m"),inverse:s("\x1B[7m","\x1B[27m"),hidden:s("\x1B[8m","\x1B[28m"),strikethrough:s("\x1B[9m","\x1B[29m"),black:s("\x1B[30m","\x1B[39m"),red:s("\x1B[31m","\x1B[39m"),green:s("\x1B[32m","\x1B[39m"),yellow:s("\x1B[33m","\x1B[39m"),blue:s("\x1B[34m","\x1B[39m"),magenta:s("\x1B[35m","\x1B[39m"),cyan:s("\x1B[36m","\x1B[39m"),white:s("\x1B[37m","\x1B[39m"),gray:s("\x1B[90m","\x1B[39m"),bgBlack:s("\x1B[40m","\x1B[49m"),bgRed:s("\x1B[41m","\x1B[49m"),bgGreen:s("\x1B[42m","\x1B[49m"),bgYellow:s("\x1B[43m","\x1B[49m"),bgBlue:s("\x1B[44m","\x1B[49m"),bgMagenta:s("\x1B[45m","\x1B[49m"),bgCyan:s("\x1B[46m","\x1B[49m"),bgWhite:s("\x1B[47m","\x1B[49m"),blackBright:s("\x1B[90m","\x1B[39m"),redBright:s("\x1B[91m","\x1B[39m"),greenBright:s("\x1B[92m","\x1B[39m"),yellowBright:s("\x1B[93m","\x1B[39m"),blueBright:s("\x1B[94m","\x1B[39m"),magentaBright:s("\x1B[95m","\x1B[39m"),cyanBright:s("\x1B[96m","\x1B[39m"),whiteBright:s("\x1B[97m","\x1B[39m"),bgBlackBright:s("\x1B[100m","\x1B[49m"),bgRedBright:s("\x1B[101m","\x1B[49m"),bgGreenBright:s("\x1B[102m","\x1B[49m"),bgYellowBright:s("\x1B[103m","\x1B[49m"),bgBlueBright:s("\x1B[104m","\x1B[49m"),bgMagentaBright:s("\x1B[105m","\x1B[49m"),bgCyanBright:s("\x1B[106m","\x1B[49m"),bgWhiteBright:s("\x1B[107m","\x1B[49m")}};Nl.exports=zs();Nl.exports.createColors=zs});var Ys=d(Ps(),1),{program:e,createCommand:py,createArgument:Dy,createOption:li,CommanderError:si,InvalidArgumentError:ti,InvalidOptionArgumentError:fi,Command:yi,Argument:ii,Option:Si,Help:$i}=Ys.default;var H=d(Cl(),1);import{stdin as Cs,stdout as Ns}from"node:process";import*as p from"node:readline";import Qs from"node:readline";import{Writable as rf}from"node:stream";function Jf({onlyFirst:l=!1}={}){let s=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(s,l?void 0:"g")}var Pf=Jf();function Vs(l){if(typeof l!="string")throw TypeError(`Expected a \`string\`, got \`${typeof l}\``);return l.replace(Pf,"")}function As(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var hs={exports:{}};(function(l){var s={};l.exports=s,s.eastAsianWidth=function(y){var i=y.charCodeAt(0),S=y.length==2?y.charCodeAt(1):0,t=i;return 55296<=i&&i<=56319&&56320<=S&&S<=57343&&(i&=1023,S&=1023,t=i<<10|S,t+=65536),t==12288||65281<=t&&t<=65376||65504<=t&&t<=65510?"F":t==8361||65377<=t&&t<=65470||65474<=t&&t<=65479||65482<=t&&t<=65487||65490<=t&&t<=65495||65498<=t&&t<=65500||65512<=t&&t<=65518?"H":4352<=t&&t<=4447||4515<=t&&t<=4519||4602<=t&&t<=4607||9001<=t&&t<=9002||11904<=t&&t<=11929||11931<=t&&t<=12019||12032<=t&&t<=12245||12272<=t&&t<=12283||12289<=t&&t<=12350||12353<=t&&t<=12438||12441<=t&&t<=12543||12549<=t&&t<=12589||12593<=t&&t<=12686||12688<=t&&t<=12730||12736<=t&&t<=12771||12784<=t&&t<=12830||12832<=t&&t<=12871||12880<=t&&t<=13054||13056<=t&&t<=19903||19968<=t&&t<=42124||42128<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||55216<=t&&t<=55238||55243<=t&&t<=55291||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65106||65108<=t&&t<=65126||65128<=t&&t<=65131||110592<=t&&t<=110593||127488<=t&&t<=127490||127504<=t&&t<=127546||127552<=t&&t<=127560||127568<=t&&t<=127569||131072<=t&&t<=194367||177984<=t&&t<=196605||196608<=t&&t<=262141?"W":32<=t&&t<=126||162<=t&&t<=163||165<=t&&t<=166||t==172||t==175||10214<=t&&t<=10221||10629<=t&&t<=10630?"Na":t==161||t==164||167<=t&&t<=168||t==170||173<=t&&t<=174||176<=t&&t<=180||182<=t&&t<=186||188<=t&&t<=191||t==198||t==208||215<=t&&t<=216||222<=t&&t<=225||t==230||232<=t&&t<=234||236<=t&&t<=237||t==240||242<=t&&t<=243||247<=t&&t<=250||t==252||t==254||t==257||t==273||t==275||t==283||294<=t&&t<=295||t==299||305<=t&&t<=307||t==312||319<=t&&t<=322||t==324||328<=t&&t<=331||t==333||338<=t&&t<=339||358<=t&&t<=359||t==363||t==462||t==464||t==466||t==468||t==470||t==472||t==474||t==476||t==593||t==609||t==708||t==711||713<=t&&t<=715||t==717||t==720||728<=t&&t<=731||t==733||t==735||768<=t&&t<=879||913<=t&&t<=929||931<=t&&t<=937||945<=t&&t<=961||963<=t&&t<=969||t==1025||1040<=t&&t<=1103||t==1105||t==8208||8211<=t&&t<=8214||8216<=t&&t<=8217||8220<=t&&t<=8221||8224<=t&&t<=8226||8228<=t&&t<=8231||t==8240||8242<=t&&t<=8243||t==8245||t==8251||t==8254||t==8308||t==8319||8321<=t&&t<=8324||t==8364||t==8451||t==8453||t==8457||t==8467||t==8470||8481<=t&&t<=8482||t==8486||t==8491||8531<=t&&t<=8532||8539<=t&&t<=8542||8544<=t&&t<=8555||8560<=t&&t<=8569||t==8585||8592<=t&&t<=8601||8632<=t&&t<=8633||t==8658||t==8660||t==8679||t==8704||8706<=t&&t<=8707||8711<=t&&t<=8712||t==8715||t==8719||t==8721||t==8725||t==8730||8733<=t&&t<=8736||t==8739||t==8741||8743<=t&&t<=8748||t==8750||8756<=t&&t<=8759||8764<=t&&t<=8765||t==8776||t==8780||t==8786||8800<=t&&t<=8801||8804<=t&&t<=8807||8810<=t&&t<=8811||8814<=t&&t<=8815||8834<=t&&t<=8835||8838<=t&&t<=8839||t==8853||t==8857||t==8869||t==8895||t==8978||9312<=t&&t<=9449||9451<=t&&t<=9547||9552<=t&&t<=9587||9600<=t&&t<=9615||9618<=t&&t<=9621||9632<=t&&t<=9633||9635<=t&&t<=9641||9650<=t&&t<=9651||9654<=t&&t<=9655||9660<=t&&t<=9661||9664<=t&&t<=9665||9670<=t&&t<=9672||t==9675||9678<=t&&t<=9681||9698<=t&&t<=9701||t==9711||9733<=t&&t<=9734||t==9737||9742<=t&&t<=9743||9748<=t&&t<=9749||t==9756||t==9758||t==9792||t==9794||9824<=t&&t<=9825||9827<=t&&t<=9829||9831<=t&&t<=9834||9836<=t&&t<=9837||t==9839||9886<=t&&t<=9887||9918<=t&&t<=9919||9924<=t&&t<=9933||9935<=t&&t<=9953||t==9955||9960<=t&&t<=9983||t==10045||t==10071||10102<=t&&t<=10111||11093<=t&&t<=11097||12872<=t&&t<=12879||57344<=t&&t<=63743||65024<=t&&t<=65039||t==65533||127232<=t&&t<=127242||127248<=t&&t<=127277||127280<=t&&t<=127337||127344<=t&&t<=127386||917760<=t&&t<=917999||983040<=t&&t<=1048573||1048576<=t&&t<=1114109?"A":"N"},s.characterLength=function(y){var i=this.eastAsianWidth(y);return i=="F"||i=="W"||i=="A"?2:1};function f(y){return y.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}s.length=function(y){for(var i=f(y),S=0,t=0;t<i.length;t++)S=S+this.characterLength(i[t]);return S},s.slice=function(y,i,S){textLen=s.length(y),i=i||0,S=S||1,i<0&&(i=textLen+i),S<0&&(S=textLen+S);for(var t="",$=0,c=f(y),k=0;k<c.length;k++){var b=c[k],U=s.length(b);if($>=i-(U==2?1:0))if($+U<=S)t+=b;else break;$+=U}return t}})(hs);var Yf=hs.exports,Gf=As(Yf),Xf=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},zf=As(Xf);function $l(l,s={}){if(typeof l!="string"||l.length===0||(s={ambiguousIsNarrow:!0,...s},l=Vs(l),l.length===0))return 0;l=l.replace(zf()," ");let f=s.ambiguousIsNarrow?1:2,y=0;for(let i of l){let S=i.codePointAt(0);if(S<=31||S>=127&&S<=159||S>=768&&S<=879)continue;switch(Gf.eastAsianWidth(i)){case"F":case"W":y+=2;break;case"A":y+=f;break;default:y+=1}}return y}var Vl=10,Zs=(l=0)=>(s)=>`\x1B[${s+l}m`,js=(l=0)=>(s)=>`\x1B[${38+l};5;${s}m`,Ms=(l=0)=>(s,f,y)=>`\x1B[${38+l};2;${s};${f};${y}m`,G={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(G.modifier);var Qf=Object.keys(G.color),Zf=Object.keys(G.bgColor);[...Qf,...Zf];function jf(){let l=new Map;for(let[s,f]of Object.entries(G)){for(let[y,i]of Object.entries(f))G[y]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},f[y]=G[y],l.set(i[0],i[1]);Object.defineProperty(G,s,{value:f,enumerable:!1})}return Object.defineProperty(G,"codes",{value:l,enumerable:!1}),G.color.close="\x1B[39m",G.bgColor.close="\x1B[49m",G.color.ansi=Zs(),G.color.ansi256=js(),G.color.ansi16m=Ms(),G.bgColor.ansi=Zs(Vl),G.bgColor.ansi256=js(Vl),G.bgColor.ansi16m=Ms(Vl),Object.defineProperties(G,{rgbToAnsi256:{value:(s,f,y)=>s===f&&f===y?s<8?16:s>248?231:Math.round((s-8)/247*24)+232:16+36*Math.round(s/255*5)+6*Math.round(f/255*5)+Math.round(y/255*5),enumerable:!1},hexToRgb:{value:(s)=>{let f=/[a-f\d]{6}|[a-f\d]{3}/i.exec(s.toString(16));if(!f)return[0,0,0];let[y]=f;y.length===3&&(y=[...y].map((S)=>S+S).join(""));let i=Number.parseInt(y,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:(s)=>G.rgbToAnsi256(...G.hexToRgb(s)),enumerable:!1},ansi256ToAnsi:{value:(s)=>{if(s<8)return 30+s;if(s<16)return 90+(s-8);let f,y,i;if(s>=232)f=((s-232)*10+8)/255,y=f,i=f;else{s-=16;let $=s%36;f=Math.floor(s/36)/5,y=Math.floor($/6)/5,i=$%6/5}let S=Math.max(f,y,i)*2;if(S===0)return 30;let t=30+(Math.round(i)<<2|Math.round(y)<<1|Math.round(f));return S===2&&(t+=60),t},enumerable:!1},rgbToAnsi:{value:(s,f,y)=>G.ansi256ToAnsi(G.rgbToAnsi256(s,f,y)),enumerable:!1},hexToAnsi:{value:(s)=>G.ansi256ToAnsi(G.hexToAnsi256(s)),enumerable:!1}}),G}var Mf=jf(),Ul=new Set(["\x1B","›"]),Hf=39,Ol="\x07",Os="[",Kf="]",Fs="m",Fl=`${Kf}8;;`,Hs=(l)=>`${Ul.values().next().value}${Os}${l}${Fs}`,Ks=(l)=>`${Ul.values().next().value}${Fl}${l}${Ol}`,Wf=(l)=>l.split(" ").map((s)=>$l(s)),Al=(l,s,f)=>{let y=[...s],i=!1,S=!1,t=$l(Vs(l[l.length-1]));for(let[$,c]of y.entries()){let k=$l(c);if(t+k<=f?l[l.length-1]+=c:(l.push(c),t=0),Ul.has(c)&&(i=!0,S=y.slice($+1).join("").startsWith(Fl)),i){S?c===Ol&&(i=!1,S=!1):c===Fs&&(i=!1);continue}t+=k,t===f&&$<y.length-1&&(l.push(""),t=0)}!t&&l[l.length-1].length>0&&l.length>1&&(l[l.length-2]+=l.pop())},Ef=(l)=>{let s=l.split(" "),f=s.length;for(;f>0&&!($l(s[f-1])>0);)f--;return f===s.length?l:s.slice(0,f).join(" ")+s.slice(f).join("")},xf=(l,s,f={})=>{if(f.trim!==!1&&l.trim()==="")return"";let y="",i,S,t=Wf(l),$=[""];for(let[k,b]of l.split(" ").entries()){f.trim!==!1&&($[$.length-1]=$[$.length-1].trimStart());let U=$l($[$.length-1]);if(k!==0&&(U>=s&&(f.wordWrap===!1||f.trim===!1)&&($.push(""),U=0),(U>0||f.trim===!1)&&($[$.length-1]+=" ",U++)),f.hard&&t[k]>s){let w=s-U,n=1+Math.floor((t[k]-w-1)/s);Math.floor((t[k]-1)/s)<n&&$.push(""),Al($,b,s);continue}if(U+t[k]>s&&U>0&&t[k]>0){if(f.wordWrap===!1&&U<s){Al($,b,s);continue}$.push("")}if(U+t[k]>s&&f.wordWrap===!1){Al($,b,s);continue}$[$.length-1]+=b}f.trim!==!1&&($=$.map((k)=>Ef(k)));let c=[...$.join(`
28
- `)];for(let[k,b]of c.entries()){if(y+=b,Ul.has(b)){let{groups:w}=new RegExp(`(?:\\${Os}(?<code>\\d+)m|\\${Fl}(?<uri>.*)${Ol})`).exec(c.slice(k).join(""))||{groups:{}};if(w.code!==void 0){let n=Number.parseFloat(w.code);i=n===Hf?void 0:n}else w.uri!==void 0&&(S=w.uri.length===0?void 0:w.uri)}let U=Mf.codes.get(Number(i));c[k+1]===`
29
- `?(S&&(y+=Ks("")),i&&U&&(y+=Hs(U))):b===`
30
- `&&(i&&U&&(y+=Hs(i)),S&&(y+=Ks(S)))}return y};function Ws(l,s,f){return String(l).normalize().replace(/\r\n/g,`
24
+ `),this.outputHelp({error:!0});let i=s||{},n=i.exitCode||1,f=i.code||"commander.error";this._exit(n,f,l)}_parseOptionsEnv(){this.options.forEach((l)=>{if(l.envVar&&l.envVar in R.env){let s=l.attributeName();if(this.getOptionValue(s)===void 0||["default","config","env"].includes(this.getOptionValueSource(s)))if(l.required||l.optional)this.emit(`optionEnv:${l.name()}`,R.env[l.envVar]);else this.emit(`optionEnv:${l.name()}`)}})}_parseOptionsImplied(){let l=new Dt(this.options),s=(i)=>{return this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i))};this.options.filter((i)=>i.implied!==void 0&&s(i.attributeName())&&l.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach((i)=>{Object.keys(i.implied).filter((n)=>!s(n)).forEach((n)=>{this.setOptionValueWithSource(n,i.implied[n],"implied")})})}missingArgument(l){let s=`error: missing required argument '${l}'`;this.error(s,{code:"commander.missingArgument"})}optionMissingArgument(l){let s=`error: option '${l.flags}' argument missing`;this.error(s,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(l){let s=`error: required option '${l.flags}' not specified`;this.error(s,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(l,s){let i=(c)=>{let t=c.attributeName(),r=this.getOptionValue(t),a=this.options.find((k)=>k.negate&&t===k.attributeName()),e=this.options.find((k)=>!k.negate&&t===k.attributeName());if(a&&(a.presetArg===void 0&&r===!1||a.presetArg!==void 0&&r===a.presetArg))return a;return e||c},n=(c)=>{let t=i(c),r=t.attributeName();if(this.getOptionValueSource(r)==="env")return`environment variable '${t.envVar}'`;return`option '${t.flags}'`},f=`error: ${n(l)} cannot be used with ${n(s)}`;this.error(f,{code:"commander.conflictingOption"})}unknownOption(l){if(this._allowUnknownOption)return;let s="";if(l.startsWith("--")&&this._showSuggestionAfterError){let n=[],f=this;do{let c=f.createHelp().visibleOptions(f).filter((t)=>t.long).map((t)=>t.long);n=n.concat(c),f=f.parent}while(f&&!f._enablePositionalOptions);s=Rs(l,n)}let i=`error: unknown option '${l}'${s}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(l){if(this._allowExcessArguments)return;let s=this.registeredArguments.length,i=s===1?"":"s",f=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${s} argument${i} but got ${l.length}.`;this.error(f,{code:"commander.excessArguments"})}unknownCommand(){let l=this.args[0],s="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach((f)=>{if(n.push(f.name()),f.alias())n.push(f.alias())}),s=Rs(l,n)}let i=`error: unknown command '${l}'${s}`;this.error(i,{code:"commander.unknownCommand"})}version(l,s,i){if(l===void 0)return this._version;this._version=l,s=s||"-V, --version",i=i||"output the version number";let n=this.createOption(s,i);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${l}
25
+ `),this._exit(0,"commander.version",l)}),this}description(l,s){if(l===void 0&&s===void 0)return this._description;if(this._description=l,s)this._argsDescription=s;return this}summary(l){if(l===void 0)return this._summary;return this._summary=l,this}alias(l){if(l===void 0)return this._aliases[0];let s=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)s=this.commands[this.commands.length-1];if(l===s._name)throw Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(l);if(i){let n=[i.name()].concat(i.aliases()).join("|");throw Error(`cannot add alias '${l}' to command '${this.name()}' as already have command '${n}'`)}return s._aliases.push(l),this}aliases(l){if(l===void 0)return this._aliases;return l.forEach((s)=>this.alias(s)),this}usage(l){if(l===void 0){if(this._usage)return this._usage;let s=this.registeredArguments.map((i)=>{return ut(i)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?s:[]).join(" ")}return this._usage=l,this}name(l){if(l===void 0)return this._name;return this._name=l,this}helpGroup(l){if(l===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=l,this}commandsGroup(l){if(l===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=l,this}optionsGroup(l){if(l===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=l,this}_initOptionGroup(l){if(this._defaultOptionGroup&&!l.helpGroupHeading)l.helpGroup(this._defaultOptionGroup)}_initCommandGroup(l){if(this._defaultCommandGroup&&!l.helpGroup())l.helpGroup(this._defaultCommandGroup)}nameFromFilename(l){return this._name=O.basename(l,O.extname(l)),this}executableDir(l){if(l===void 0)return this._executableDir;return this._executableDir=l,this}helpInformation(l){let s=this.createHelp(),i=this._getOutputContext(l);s.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let n=s.formatHelp(this,s);if(i.hasColors)return n;return this._outputConfiguration.stripColor(n)}_getOutputContext(l){l=l||{};let s=!!l.error,i,n,f;if(s)i=(t)=>this._outputConfiguration.writeErr(t),n=this._outputConfiguration.getErrHasColors(),f=this._outputConfiguration.getErrHelpWidth();else i=(t)=>this._outputConfiguration.writeOut(t),n=this._outputConfiguration.getOutHasColors(),f=this._outputConfiguration.getOutHelpWidth();return{error:s,write:(t)=>{if(!n)t=this._outputConfiguration.stripColor(t);return i(t)},hasColors:n,helpWidth:f}}outputHelp(l){let s;if(typeof l==="function")s=l,l=void 0;let i=this._getOutputContext(l),n={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach((c)=>c.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let f=this.helpInformation({error:i.error});if(s){if(f=s(f),typeof f!=="string"&&!Buffer.isBuffer(f))throw Error("outputHelp callback must return a string or a Buffer")}if(i.write(f),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",n),this._getCommandAndAncestors().forEach((c)=>c.emit("afterAllHelp",n))}helpOption(l,s){if(typeof l==="boolean"){if(l){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(l??"-h, --help",s??"display help for command"),l||s)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(l){return this._helpOption=l,this._initOptionGroup(l),this}help(l){this.outputHelp(l);let s=Number(R.exitCode??0);if(s===0&&l&&typeof l!=="function"&&l.error)s=1;this._exit(s,"commander.help","(outputHelp)")}addHelpText(l,s){let i=["beforeAll","before","after","afterAll"];if(!i.includes(l))throw Error(`Unexpected value for position to addHelpText.
26
+ Expecting one of '${i.join("', '")}'`);let n=`${l}Help`;return this.on(n,(f)=>{let c;if(typeof s==="function")c=s({error:f.error,command:f.command});else c=s;if(c)f.write(`${c}
27
+ `)}),this}_outputHelpIfRequested(l){let s=this._getHelpOption();if(s&&l.find((n)=>s.is(n)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function Ts(l){return l.map((s)=>{if(!s.startsWith("--inspect"))return s;let i,n="127.0.0.1",f="9229",c;if((c=s.match(/^(--inspect(-brk)?)$/))!==null)i=c[1];else if((c=s.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(i=c[1],/^\d+$/.test(c[3]))f=c[3];else n=c[3];else if((c=s.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)i=c[1],n=c[3],f=c[4];if(i&&f!=="0")return`${i}=${n}:${parseInt(f)+1}`;return s})}function Hl(){if(R.env.NO_COLOR||R.env.FORCE_COLOR==="0"||R.env.FORCE_COLOR==="false")return!1;if(R.env.FORCE_COLOR||R.env.CLICOLOR_FORCE!==void 0)return!0;return}li.Command=hl;li.useColor=Hl});var Ns=v((fi)=>{var{Argument:Ls}=ol(),{Command:Kl}=Ps(),{CommanderError:ii,InvalidArgumentError:Us}=al(),{Help:ni}=zl(),{Option:Bs}=Ml();fi.program=new Kl;fi.createCommand=(l)=>new Kl(l);fi.createOption=(l,s)=>new Bs(l,s);fi.createArgument=(l,s)=>new Ls(l,s);fi.Command=Kl;fi.Option=Bs;fi.Argument=Ls;fi.Help=ni;fi.CommanderError=ii;fi.InvalidArgumentError=Us;fi.InvalidOptionArgumentError=Us});var Wl=v(($f,_s)=>{var xl={to(l,s){if(!s)return`\x1B[${l+1}G`;return`\x1B[${s+1};${l+1}H`},move(l,s){let i="";if(l<0)i+=`\x1B[${-l}D`;else if(l>0)i+=`\x1B[${l}C`;if(s<0)i+=`\x1B[${-s}A`;else if(s>0)i+=`\x1B[${s}B`;return i},up:(l=1)=>`\x1B[${l}A`,down:(l=1)=>`\x1B[${l}B`,forward:(l=1)=>`\x1B[${l}C`,backward:(l=1)=>`\x1B[${l}D`,nextLine:(l=1)=>"\x1B[E".repeat(l),prevLine:(l=1)=>"\x1B[F".repeat(l),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},Ii={up:(l=1)=>"\x1B[S".repeat(l),down:(l=1)=>"\x1B[T".repeat(l)},wi={screen:"\x1B[2J",up:(l=1)=>"\x1B[1J".repeat(l),down:(l=1)=>"\x1B[J".repeat(l),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(l){let s="";for(let i=0;i<l;i++)s+=this.line+(i<l-1?xl.up():"");if(l)s+=xl.left;return s}};_s.exports={cursor:xl,scroll:Ii,erase:wi,beep:"\x07"}});var tl=v((of,El)=>{var Il=process||{},Js=Il.argv||[],gl=Il.env||{},Ri=!(!!gl.NO_COLOR||Js.includes("--no-color"))&&(!!gl.FORCE_COLOR||Js.includes("--color")||Il.platform==="win32"||(Il.stdout||{}).isTTY&&gl.TERM!=="dumb"||!!gl.CI),Ti=(l,s,i=l)=>(n)=>{let f=""+n,c=f.indexOf(s,l.length);return~c?l+Pi(f,s,i,c)+s:l+f+s},Pi=(l,s,i,n)=>{let f="",c=0;do f+=l.substring(c,n)+i,c=n+s.length,n=l.indexOf(s,c);while(~n);return f+l.substring(c)},js=(l=Ri)=>{let s=l?Ti:()=>String;return{isColorSupported:l,reset:s("\x1B[0m","\x1B[0m"),bold:s("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:s("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:s("\x1B[3m","\x1B[23m"),underline:s("\x1B[4m","\x1B[24m"),inverse:s("\x1B[7m","\x1B[27m"),hidden:s("\x1B[8m","\x1B[28m"),strikethrough:s("\x1B[9m","\x1B[29m"),black:s("\x1B[30m","\x1B[39m"),red:s("\x1B[31m","\x1B[39m"),green:s("\x1B[32m","\x1B[39m"),yellow:s("\x1B[33m","\x1B[39m"),blue:s("\x1B[34m","\x1B[39m"),magenta:s("\x1B[35m","\x1B[39m"),cyan:s("\x1B[36m","\x1B[39m"),white:s("\x1B[37m","\x1B[39m"),gray:s("\x1B[90m","\x1B[39m"),bgBlack:s("\x1B[40m","\x1B[49m"),bgRed:s("\x1B[41m","\x1B[49m"),bgGreen:s("\x1B[42m","\x1B[49m"),bgYellow:s("\x1B[43m","\x1B[49m"),bgBlue:s("\x1B[44m","\x1B[49m"),bgMagenta:s("\x1B[45m","\x1B[49m"),bgCyan:s("\x1B[46m","\x1B[49m"),bgWhite:s("\x1B[47m","\x1B[49m"),blackBright:s("\x1B[90m","\x1B[39m"),redBright:s("\x1B[91m","\x1B[39m"),greenBright:s("\x1B[92m","\x1B[39m"),yellowBright:s("\x1B[93m","\x1B[39m"),blueBright:s("\x1B[94m","\x1B[39m"),magentaBright:s("\x1B[95m","\x1B[39m"),cyanBright:s("\x1B[96m","\x1B[39m"),whiteBright:s("\x1B[97m","\x1B[39m"),bgBlackBright:s("\x1B[100m","\x1B[49m"),bgRedBright:s("\x1B[101m","\x1B[49m"),bgGreenBright:s("\x1B[102m","\x1B[49m"),bgYellowBright:s("\x1B[103m","\x1B[49m"),bgBlueBright:s("\x1B[104m","\x1B[49m"),bgMagentaBright:s("\x1B[105m","\x1B[49m"),bgCyanBright:s("\x1B[106m","\x1B[49m"),bgWhiteBright:s("\x1B[107m","\x1B[49m")}};El.exports=js();El.exports.createColors=js});var qs=A(Ns(),1),{program:D,createCommand:sf,createArgument:tf,createOption:nf,CommanderError:ff,InvalidArgumentError:cf,InvalidOptionArgumentError:rf,Command:ef,Argument:af,Option:kf,Help:yf}=qs.default;var z=A(Wl(),1);import{stdin as Ks,stdout as xs}from"node:process";import*as ll from"node:readline";import Ys from"node:readline";import{Writable as Li}from"node:stream";function Ui({onlyFirst:l=!1}={}){let s=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(s,l?void 0:"g")}var Bi=Ui();function Ws(l){if(typeof l!="string")throw TypeError(`Expected a \`string\`, got \`${typeof l}\``);return l.replace(Bi,"")}function Es(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Cs={exports:{}};(function(l){var s={};l.exports=s,s.eastAsianWidth=function(n){var f=n.charCodeAt(0),c=n.length==2?n.charCodeAt(1):0,t=f;return 55296<=f&&f<=56319&&56320<=c&&c<=57343&&(f&=1023,c&=1023,t=f<<10|c,t+=65536),t==12288||65281<=t&&t<=65376||65504<=t&&t<=65510?"F":t==8361||65377<=t&&t<=65470||65474<=t&&t<=65479||65482<=t&&t<=65487||65490<=t&&t<=65495||65498<=t&&t<=65500||65512<=t&&t<=65518?"H":4352<=t&&t<=4447||4515<=t&&t<=4519||4602<=t&&t<=4607||9001<=t&&t<=9002||11904<=t&&t<=11929||11931<=t&&t<=12019||12032<=t&&t<=12245||12272<=t&&t<=12283||12289<=t&&t<=12350||12353<=t&&t<=12438||12441<=t&&t<=12543||12549<=t&&t<=12589||12593<=t&&t<=12686||12688<=t&&t<=12730||12736<=t&&t<=12771||12784<=t&&t<=12830||12832<=t&&t<=12871||12880<=t&&t<=13054||13056<=t&&t<=19903||19968<=t&&t<=42124||42128<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||55216<=t&&t<=55238||55243<=t&&t<=55291||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65106||65108<=t&&t<=65126||65128<=t&&t<=65131||110592<=t&&t<=110593||127488<=t&&t<=127490||127504<=t&&t<=127546||127552<=t&&t<=127560||127568<=t&&t<=127569||131072<=t&&t<=194367||177984<=t&&t<=196605||196608<=t&&t<=262141?"W":32<=t&&t<=126||162<=t&&t<=163||165<=t&&t<=166||t==172||t==175||10214<=t&&t<=10221||10629<=t&&t<=10630?"Na":t==161||t==164||167<=t&&t<=168||t==170||173<=t&&t<=174||176<=t&&t<=180||182<=t&&t<=186||188<=t&&t<=191||t==198||t==208||215<=t&&t<=216||222<=t&&t<=225||t==230||232<=t&&t<=234||236<=t&&t<=237||t==240||242<=t&&t<=243||247<=t&&t<=250||t==252||t==254||t==257||t==273||t==275||t==283||294<=t&&t<=295||t==299||305<=t&&t<=307||t==312||319<=t&&t<=322||t==324||328<=t&&t<=331||t==333||338<=t&&t<=339||358<=t&&t<=359||t==363||t==462||t==464||t==466||t==468||t==470||t==472||t==474||t==476||t==593||t==609||t==708||t==711||713<=t&&t<=715||t==717||t==720||728<=t&&t<=731||t==733||t==735||768<=t&&t<=879||913<=t&&t<=929||931<=t&&t<=937||945<=t&&t<=961||963<=t&&t<=969||t==1025||1040<=t&&t<=1103||t==1105||t==8208||8211<=t&&t<=8214||8216<=t&&t<=8217||8220<=t&&t<=8221||8224<=t&&t<=8226||8228<=t&&t<=8231||t==8240||8242<=t&&t<=8243||t==8245||t==8251||t==8254||t==8308||t==8319||8321<=t&&t<=8324||t==8364||t==8451||t==8453||t==8457||t==8467||t==8470||8481<=t&&t<=8482||t==8486||t==8491||8531<=t&&t<=8532||8539<=t&&t<=8542||8544<=t&&t<=8555||8560<=t&&t<=8569||t==8585||8592<=t&&t<=8601||8632<=t&&t<=8633||t==8658||t==8660||t==8679||t==8704||8706<=t&&t<=8707||8711<=t&&t<=8712||t==8715||t==8719||t==8721||t==8725||t==8730||8733<=t&&t<=8736||t==8739||t==8741||8743<=t&&t<=8748||t==8750||8756<=t&&t<=8759||8764<=t&&t<=8765||t==8776||t==8780||t==8786||8800<=t&&t<=8801||8804<=t&&t<=8807||8810<=t&&t<=8811||8814<=t&&t<=8815||8834<=t&&t<=8835||8838<=t&&t<=8839||t==8853||t==8857||t==8869||t==8895||t==8978||9312<=t&&t<=9449||9451<=t&&t<=9547||9552<=t&&t<=9587||9600<=t&&t<=9615||9618<=t&&t<=9621||9632<=t&&t<=9633||9635<=t&&t<=9641||9650<=t&&t<=9651||9654<=t&&t<=9655||9660<=t&&t<=9661||9664<=t&&t<=9665||9670<=t&&t<=9672||t==9675||9678<=t&&t<=9681||9698<=t&&t<=9701||t==9711||9733<=t&&t<=9734||t==9737||9742<=t&&t<=9743||9748<=t&&t<=9749||t==9756||t==9758||t==9792||t==9794||9824<=t&&t<=9825||9827<=t&&t<=9829||9831<=t&&t<=9834||9836<=t&&t<=9837||t==9839||9886<=t&&t<=9887||9918<=t&&t<=9919||9924<=t&&t<=9933||9935<=t&&t<=9953||t==9955||9960<=t&&t<=9983||t==10045||t==10071||10102<=t&&t<=10111||11093<=t&&t<=11097||12872<=t&&t<=12879||57344<=t&&t<=63743||65024<=t&&t<=65039||t==65533||127232<=t&&t<=127242||127248<=t&&t<=127277||127280<=t&&t<=127337||127344<=t&&t<=127386||917760<=t&&t<=917999||983040<=t&&t<=1048573||1048576<=t&&t<=1114109?"A":"N"},s.characterLength=function(n){var f=this.eastAsianWidth(n);return f=="F"||f=="W"||f=="A"?2:1};function i(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}s.length=function(n){for(var f=i(n),c=0,t=0;t<f.length;t++)c=c+this.characterLength(f[t]);return c},s.slice=function(n,f,c){textLen=s.length(n),f=f||0,c=c||1,f<0&&(f=textLen+f),c<0&&(c=textLen+c);for(var t="",r=0,a=i(n),e=0;e<a.length;e++){var k=a[e],b=s.length(k);if(r>=f-(b==2?1:0))if(r+b<=c)t+=k;else break;r+=b}return t}})(Cs);var Ni=Cs.exports,qi=Es(Ni),_i=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},Ji=Es(_i);function kl(l,s={}){if(typeof l!="string"||l.length===0||(s={ambiguousIsNarrow:!0,...s},l=Ws(l),l.length===0))return 0;l=l.replace(Ji()," ");let i=s.ambiguousIsNarrow?1:2,n=0;for(let f of l){let c=f.codePointAt(0);if(c<=31||c>=127&&c<=159||c>=768&&c<=879)continue;switch(qi.eastAsianWidth(f)){case"F":case"W":n+=2;break;case"A":n+=i;break;default:n+=1}}return n}var Cl=10,Gs=(l=0)=>(s)=>`\x1B[${s+l}m`,Xs=(l=0)=>(s)=>`\x1B[${38+l};5;${s}m`,zs=(l=0)=>(s,i,n)=>`\x1B[${38+l};2;${s};${i};${n}m`,N={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(N.modifier);var ji=Object.keys(N.color),Yi=Object.keys(N.bgColor);[...ji,...Yi];function Gi(){let l=new Map;for(let[s,i]of Object.entries(N)){for(let[n,f]of Object.entries(i))N[n]={open:`\x1B[${f[0]}m`,close:`\x1B[${f[1]}m`},i[n]=N[n],l.set(f[0],f[1]);Object.defineProperty(N,s,{value:i,enumerable:!1})}return Object.defineProperty(N,"codes",{value:l,enumerable:!1}),N.color.close="\x1B[39m",N.bgColor.close="\x1B[49m",N.color.ansi=Gs(),N.color.ansi256=Xs(),N.color.ansi16m=zs(),N.bgColor.ansi=Gs(Cl),N.bgColor.ansi256=Xs(Cl),N.bgColor.ansi16m=zs(Cl),Object.defineProperties(N,{rgbToAnsi256:{value:(s,i,n)=>s===i&&i===n?s<8?16:s>248?231:Math.round((s-8)/247*24)+232:16+36*Math.round(s/255*5)+6*Math.round(i/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:(s)=>{let i=/[a-f\d]{6}|[a-f\d]{3}/i.exec(s.toString(16));if(!i)return[0,0,0];let[n]=i;n.length===3&&(n=[...n].map((c)=>c+c).join(""));let f=Number.parseInt(n,16);return[f>>16&255,f>>8&255,f&255]},enumerable:!1},hexToAnsi256:{value:(s)=>N.rgbToAnsi256(...N.hexToRgb(s)),enumerable:!1},ansi256ToAnsi:{value:(s)=>{if(s<8)return 30+s;if(s<16)return 90+(s-8);let i,n,f;if(s>=232)i=((s-232)*10+8)/255,n=i,f=i;else{s-=16;let r=s%36;i=Math.floor(s/36)/5,n=Math.floor(r/6)/5,f=r%6/5}let c=Math.max(i,n,f)*2;if(c===0)return 30;let t=30+(Math.round(f)<<2|Math.round(n)<<1|Math.round(i));return c===2&&(t+=60),t},enumerable:!1},rgbToAnsi:{value:(s,i,n)=>N.ansi256ToAnsi(N.rgbToAnsi256(s,i,n)),enumerable:!1},hexToAnsi:{value:(s)=>N.ansi256ToAnsi(N.hexToAnsi256(s)),enumerable:!1}}),N}var Xi=Gi(),Tl=new Set(["\x1B","›"]),zi=39,Al="\x07",Vs="[",Mi="]",ms="m",vl=`${Mi}8;;`,Ms=(l)=>`${Tl.values().next().value}${Vs}${l}${ms}`,Qs=(l)=>`${Tl.values().next().value}${vl}${l}${Al}`,Qi=(l)=>l.split(" ").map((s)=>kl(s)),Vl=(l,s,i)=>{let n=[...s],f=!1,c=!1,t=kl(Ws(l[l.length-1]));for(let[r,a]of n.entries()){let e=kl(a);if(t+e<=i?l[l.length-1]+=a:(l.push(a),t=0),Tl.has(a)&&(f=!0,c=n.slice(r+1).join("").startsWith(vl)),f){c?a===Al&&(f=!1,c=!1):a===ms&&(f=!1);continue}t+=e,t===i&&r<n.length-1&&(l.push(""),t=0)}!t&&l[l.length-1].length>0&&l.length>1&&(l[l.length-2]+=l.pop())},Zi=(l)=>{let s=l.split(" "),i=s.length;for(;i>0&&!(kl(s[i-1])>0);)i--;return i===s.length?l:s.slice(0,i).join(" ")+s.slice(i).join("")},Hi=(l,s,i={})=>{if(i.trim!==!1&&l.trim()==="")return"";let n="",f,c,t=Qi(l),r=[""];for(let[e,k]of l.split(" ").entries()){i.trim!==!1&&(r[r.length-1]=r[r.length-1].trimStart());let b=kl(r[r.length-1]);if(e!==0&&(b>=s&&(i.wordWrap===!1||i.trim===!1)&&(r.push(""),b=0),(b>0||i.trim===!1)&&(r[r.length-1]+=" ",b++)),i.hard&&t[e]>s){let $=s-b,y=1+Math.floor((t[e]-$-1)/s);Math.floor((t[e]-1)/s)<y&&r.push(""),Vl(r,k,s);continue}if(b+t[e]>s&&b>0&&t[e]>0){if(i.wordWrap===!1&&b<s){Vl(r,k,s);continue}r.push("")}if(b+t[e]>s&&i.wordWrap===!1){Vl(r,k,s);continue}r[r.length-1]+=k}i.trim!==!1&&(r=r.map((e)=>Zi(e)));let a=[...r.join(`
28
+ `)];for(let[e,k]of a.entries()){if(n+=k,Tl.has(k)){let{groups:$}=new RegExp(`(?:\\${Vs}(?<code>\\d+)m|\\${vl}(?<uri>.*)${Al})`).exec(a.slice(e).join(""))||{groups:{}};if($.code!==void 0){let y=Number.parseFloat($.code);f=y===zi?void 0:y}else $.uri!==void 0&&(c=$.uri.length===0?void 0:$.uri)}let b=Xi.codes.get(Number(f));a[e+1]===`
29
+ `?(c&&(n+=Qs("")),f&&b&&(n+=Ms(b))):k===`
30
+ `&&(f&&b&&(n+=Ms(f)),c&&(n+=Qs(c)))}return n};function Zs(l,s,i){return String(l).normalize().replace(/\r\n/g,`
31
31
  `).split(`
32
- `).map((y)=>xf(y,s,f)).join(`
33
- `)}var Cf=["up","down","left","right","space","enter","cancel"],gl={actions:new Set(Cf),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};function al(l,s){if(typeof l=="string")return gl.aliases.get(l)===s;for(let f of l)if(f!==void 0&&al(f,s))return!0;return!1}function Nf(l,s){if(l===s)return;let f=l.split(`
34
- `),y=s.split(`
35
- `),i=[];for(let S=0;S<Math.max(f.length,y.length);S++)f[S]!==y[S]&&i.push(S);return i}var Vf=globalThis.process.platform.startsWith("win"),hl=Symbol("clack:cancel");function K(l){return l===hl}function wl(l,s){let f=l;f.isTTY&&f.setRawMode(s)}function as({input:l=Cs,output:s=Ns,overwrite:f=!0,hideCursor:y=!0}={}){let i=p.createInterface({input:l,output:s,prompt:"",tabSize:1});p.emitKeypressEvents(l,i),l.isTTY&&l.setRawMode(!0);let S=(t,{name:$,sequence:c})=>{let k=String(t);if(al([k,$,c],"cancel")){y&&s.write(H.cursor.show),process.exit(0);return}if(!f)return;p.moveCursor(s,$==="return"?0:-1,$==="return"?-1:0,()=>{p.clearLine(s,1,()=>{l.once("keypress",S)})})};return y&&s.write(H.cursor.hide),l.once("keypress",S),()=>{l.off("keypress",S),y&&s.write(H.cursor.show),l.isTTY&&!Vf&&l.setRawMode(!1),i.terminal=!1,i.close()}}var Af=Object.defineProperty,hf=(l,s,f)=>(s in l)?Af(l,s,{enumerable:!0,configurable:!0,writable:!0,value:f}):l[s]=f,N=(l,s,f)=>(hf(l,typeof s!="symbol"?s+"":s,f),f);class Ll{constructor(l,s=!0){N(this,"input"),N(this,"output"),N(this,"_abortSignal"),N(this,"rl"),N(this,"opts"),N(this,"_render"),N(this,"_track",!1),N(this,"_prevFrame",""),N(this,"_subscribers",new Map),N(this,"_cursor",0),N(this,"state","initial"),N(this,"error",""),N(this,"value");let{input:f=Cs,output:y=Ns,render:i,signal:S,...t}=l;this.opts=t,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=i.bind(this),this._track=s,this._abortSignal=S,this.input=f,this.output=y}unsubscribe(){this._subscribers.clear()}setSubscriber(l,s){let f=this._subscribers.get(l)??[];f.push(s),this._subscribers.set(l,f)}on(l,s){this.setSubscriber(l,{cb:s})}once(l,s){this.setSubscriber(l,{cb:s,once:!0})}emit(l,...s){let f=this._subscribers.get(l)??[],y=[];for(let i of f)i.cb(...s),i.once&&y.push(()=>f.splice(f.indexOf(i),1));for(let i of y)i()}prompt(){return new Promise((l,s)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),l(hl);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let f=new rf;f._write=(y,i,S)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),S()},this.input.pipe(f),this.rl=Qs.createInterface({input:this.input,output:f,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),Qs.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),wl(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(H.cursor.show),this.output.off("resize",this.render),wl(this.input,!1),l(this.value)}),this.once("cancel",()=>{this.output.write(H.cursor.show),this.output.off("resize",this.render),wl(this.input,!1),l(hl)})})}onKeypress(l,s){if(this.state==="error"&&(this.state="active"),s?.name&&(!this._track&&gl.aliases.has(s.name)&&this.emit("cursor",gl.aliases.get(s.name)),gl.actions.has(s.name)&&this.emit("cursor",s.name)),l&&(l.toLowerCase()==="y"||l.toLowerCase()==="n")&&this.emit("confirm",l.toLowerCase()==="y"),l==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),l&&this.emit("key",l.toLowerCase()),s?.name==="return"){if(this.opts.validate){let f=this.opts.validate(this.value);f&&(this.error=f instanceof Error?f.message:f,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}al([l,s?.name,s?.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(`
36
- `),wl(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let l=Ws(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
37
- `).length-1;this.output.write(H.cursor.move(-999,l*-1))}render(){let l=Ws(this._render(this)??"",process.stdout.columns,{hard:!0});if(l!==this._prevFrame){if(this.state==="initial")this.output.write(H.cursor.hide);else{let s=Nf(this._prevFrame,l);if(this.restoreCursor(),s&&s?.length===1){let f=s[0];this.output.write(H.cursor.move(0,f)),this.output.write(H.erase.lines(1));let y=l.split(`
38
- `);this.output.write(y[f]),this._prevFrame=l,this.output.write(H.cursor.move(0,y.length-f-1));return}if(s&&s?.length>1){let f=s[0];this.output.write(H.cursor.move(0,f)),this.output.write(H.erase.down());let y=l.split(`
39
- `).slice(f);this.output.write(y.join(`
40
- `)),this._prevFrame=l;return}this.output.write(H.erase.down())}this.output.write(l),this.state==="initial"&&(this.state="active"),this._prevFrame=l}}}class vl extends Ll{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(l){super(l,!1),this.value=!!l.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(s)=>{this.output.write(H.cursor.move(0,-1)),this.value=s,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var Of;Of=new WeakMap;var Ff=Object.defineProperty,af=(l,s,f)=>(s in l)?Ff(l,s,{enumerable:!0,configurable:!0,writable:!0,value:f}):l[s]=f,Es=(l,s,f)=>(af(l,typeof s!="symbol"?s+"":s,f),f),vs=class extends Ll{constructor(l){super(l,!1),Es(this,"options"),Es(this,"cursor",0),this.options=l.options,this.value=[...l.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:s})=>s===l.cursorAt),0),this.on("key",(s)=>{s==="a"&&this.toggleAll()}),this.on("cursor",(s)=>{switch(s){case"left":case"up":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;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let l=this.value.length===this.options.length;this.value=l?[]:this.options.map((s)=>s.value)}toggleValue(){let l=this.value.includes(this._value);this.value=l?this.value.filter((s)=>s!==this._value):[...this.value,this._value]}};var vf=Object.defineProperty,of=(l,s,f)=>(s in l)?vf(l,s,{enumerable:!0,configurable:!0,writable:!0,value:f}):l[s]=f,xs=(l,s,f)=>(of(l,typeof s!="symbol"?s+"":s,f),f);class ol extends Ll{constructor(l){super(l,!1),xs(this,"options"),xs(this,"cursor",0),this.options=l.options,this.cursor=this.options.findIndex(({value:s})=>s===l.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(s)=>{switch(s){case"left":case"up":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;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}}var g=d(sl(),1),Rl=d(Cl(),1);import h from"node:process";function mf(){return h.platform!=="win32"?h.env.TERM!=="linux":!!h.env.CI||!!h.env.WT_SESSION||!!h.env.TERMINUS_SUBLIME||h.env.ConEmuTask==="{cmd::Cmder}"||h.env.TERM_PROGRAM==="Terminus-Sublime"||h.env.TERM_PROGRAM==="vscode"||h.env.TERM==="xterm-256color"||h.env.TERM==="alacritty"||h.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var ml=mf(),Q=(l,s)=>ml?l:s,uf=Q("◆","*"),ms=Q("■","x"),us=Q("▲","x"),pl=Q("◇","o"),df=Q("┌","T"),P=Q("│","|"),tl=Q("└","—"),ul=Q("●",">"),dl=Q("○"," "),ef=Q("◻","[•]"),os=Q("◼","[+]"),pf=Q("◻","[ ]"),Ji=Q("▪","•"),Pi=Q("─","-"),Yi=Q("╮","+"),Gi=Q("├","+"),Xi=Q("╯","+"),Df=Q("●","•"),ly=Q("◆","*"),sy=Q("▲","!"),ty=Q("■","x"),Dl=(l)=>{switch(l){case"initial":case"active":return g.default.cyan(uf);case"cancel":return g.default.red(ms);case"error":return g.default.yellow(us);case"submit":return g.default.green(pl)}},el=(l)=>{let{cursor:s,options:f,style:y}=l,i=l.maxItems??Number.POSITIVE_INFINITY,S=Math.max(process.stdout.rows-4,0),t=Math.min(S,Math.max(i,5)),$=0;s>=$+t-3?$=Math.max(Math.min(s-t+3,f.length-t),0):s<$+2&&($=Math.max(s-2,0));let c=t<f.length&&$>0,k=t<f.length&&$+t<f.length;return f.slice($,$+t).map((b,U,w)=>{let n=U===0&&c,L=U===w.length-1&&k;return n||L?g.default.dim("..."):y(b,U+$===s)})};var fl=(l)=>{let s=l.active??"Yes",f=l.inactive??"No";return new vl({active:s,inactive:f,initialValue:l.initialValue??!0,render(){let y=`${g.default.gray(P)}
41
- ${Dl(this.state)} ${l.message}
42
- `,i=this.value?s:f;switch(this.state){case"submit":return`${y}${g.default.gray(P)} ${g.default.dim(i)}`;case"cancel":return`${y}${g.default.gray(P)} ${g.default.strikethrough(g.default.dim(i))}
43
- ${g.default.gray(P)}`;default:return`${y}${g.default.cyan(P)} ${this.value?`${g.default.green(ul)} ${s}`:`${g.default.dim(dl)} ${g.default.dim(s)}`} ${g.default.dim("/")} ${this.value?`${g.default.dim(dl)} ${g.default.dim(f)}`:`${g.default.green(ul)} ${f}`}
44
- ${g.default.cyan(tl)}
45
- `}}}).prompt()},ds=(l)=>{let s=(f,y)=>{let i=f.label??String(f.value);switch(y){case"selected":return`${g.default.dim(i)}`;case"active":return`${g.default.green(ul)} ${i} ${f.hint?g.default.dim(`(${f.hint})`):""}`;case"cancelled":return`${g.default.strikethrough(g.default.dim(i))}`;default:return`${g.default.dim(dl)} ${g.default.dim(i)}`}};return new ol({options:l.options,initialValue:l.initialValue,render(){let f=`${g.default.gray(P)}
46
- ${Dl(this.state)} ${l.message}
47
- `;switch(this.state){case"submit":return`${f}${g.default.gray(P)} ${s(this.options[this.cursor],"selected")}`;case"cancel":return`${f}${g.default.gray(P)} ${s(this.options[this.cursor],"cancelled")}
48
- ${g.default.gray(P)}`;default:return`${f}${g.default.cyan(P)} ${el({cursor:this.cursor,options:this.options,maxItems:l.maxItems,style:(y,i)=>s(y,i?"active":"inactive")}).join(`
49
- ${g.default.cyan(P)} `)}
50
- ${g.default.cyan(tl)}
51
- `}}}).prompt()};var o=(l)=>{let s=(f,y)=>{let i=f.label??String(f.value);return y==="active"?`${g.default.cyan(ef)} ${i} ${f.hint?g.default.dim(`(${f.hint})`):""}`:y==="selected"?`${g.default.green(os)} ${g.default.dim(i)} ${f.hint?g.default.dim(`(${f.hint})`):""}`:y==="cancelled"?`${g.default.strikethrough(g.default.dim(i))}`:y==="active-selected"?`${g.default.green(os)} ${i} ${f.hint?g.default.dim(`(${f.hint})`):""}`:y==="submitted"?`${g.default.dim(i)}`:`${g.default.dim(pf)} ${g.default.dim(i)}`};return new vs({options:l.options,initialValues:l.initialValues,required:l.required??!0,cursorAt:l.cursorAt,validate(f){if(this.required&&f.length===0)return`Please select at least one option.
52
- ${g.default.reset(g.default.dim(`Press ${g.default.gray(g.default.bgWhite(g.default.inverse(" space ")))} to select, ${g.default.gray(g.default.bgWhite(g.default.inverse(" enter ")))} to submit`))}`},render(){let f=`${g.default.gray(P)}
53
- ${Dl(this.state)} ${l.message}
54
- `,y=(i,S)=>{let t=this.value.includes(i.value);return S&&t?s(i,"active-selected"):t?s(i,"selected"):s(i,S?"active":"inactive")};switch(this.state){case"submit":return`${f}${g.default.gray(P)} ${this.options.filter(({value:i})=>this.value.includes(i)).map((i)=>s(i,"submitted")).join(g.default.dim(", "))||g.default.dim("none")}`;case"cancel":{let i=this.options.filter(({value:S})=>this.value.includes(S)).map((S)=>s(S,"cancelled")).join(g.default.dim(", "));return`${f}${g.default.gray(P)} ${i.trim()?`${i}
55
- ${g.default.gray(P)}`:""}`}case"error":{let i=this.error.split(`
56
- `).map((S,t)=>t===0?`${g.default.yellow(tl)} ${g.default.yellow(S)}`:` ${S}`).join(`
57
- `);return`${f+g.default.yellow(P)} ${el({options:this.options,cursor:this.cursor,maxItems:l.maxItems,style:y}).join(`
58
- ${g.default.yellow(P)} `)}
59
- ${i}
60
- `}default:return`${f}${g.default.cyan(P)} ${el({options:this.options,cursor:this.cursor,maxItems:l.maxItems,style:y}).join(`
61
- ${g.default.cyan(P)} `)}
62
- ${g.default.cyan(tl)}
63
- `}}}).prompt()};var V=(l="")=>{process.stdout.write(`${g.default.gray(tl)} ${g.default.red(l)}
32
+ `).map((n)=>Hi(n,s,i)).join(`
33
+ `)}var hi=["up","down","left","right","space","enter","cancel"],Rl={actions:new Set(hi),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};function Ol(l,s){if(typeof l=="string")return Rl.aliases.get(l)===s;for(let i of l)if(i!==void 0&&Ol(i,s))return!0;return!1}function Ki(l,s){if(l===s)return;let i=l.split(`
34
+ `),n=s.split(`
35
+ `),f=[];for(let c=0;c<Math.max(i.length,n.length);c++)i[c]!==n[c]&&f.push(c);return f}var xi=globalThis.process.platform.startsWith("win"),ml=Symbol("clack:cancel");function M(l){return l===ml}function wl(l,s){let i=l;i.isTTY&&i.setRawMode(s)}function As({input:l=Ks,output:s=xs,overwrite:i=!0,hideCursor:n=!0}={}){let f=ll.createInterface({input:l,output:s,prompt:"",tabSize:1});ll.emitKeypressEvents(l,f),l.isTTY&&l.setRawMode(!0);let c=(t,{name:r,sequence:a})=>{let e=String(t);if(Ol([e,r,a],"cancel")){n&&s.write(z.cursor.show),process.exit(0);return}if(!i)return;ll.moveCursor(s,r==="return"?0:-1,r==="return"?-1:0,()=>{ll.clearLine(s,1,()=>{l.once("keypress",c)})})};return n&&s.write(z.cursor.hide),l.once("keypress",c),()=>{l.off("keypress",c),n&&s.write(z.cursor.show),l.isTTY&&!xi&&l.setRawMode(!1),f.terminal=!1,f.close()}}var Wi=Object.defineProperty,Ei=(l,s,i)=>(s in l)?Wi(l,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):l[s]=i,K=(l,s,i)=>(Ei(l,typeof s!="symbol"?s+"":s,i),i);class Pl{constructor(l,s=!0){K(this,"input"),K(this,"output"),K(this,"_abortSignal"),K(this,"rl"),K(this,"opts"),K(this,"_render"),K(this,"_track",!1),K(this,"_prevFrame",""),K(this,"_subscribers",new Map),K(this,"_cursor",0),K(this,"state","initial"),K(this,"error",""),K(this,"value");let{input:i=Ks,output:n=xs,render:f,signal:c,...t}=l;this.opts=t,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=f.bind(this),this._track=s,this._abortSignal=c,this.input=i,this.output=n}unsubscribe(){this._subscribers.clear()}setSubscriber(l,s){let i=this._subscribers.get(l)??[];i.push(s),this._subscribers.set(l,i)}on(l,s){this.setSubscriber(l,{cb:s})}once(l,s){this.setSubscriber(l,{cb:s,once:!0})}emit(l,...s){let i=this._subscribers.get(l)??[],n=[];for(let f of i)f.cb(...s),f.once&&n.push(()=>i.splice(i.indexOf(f),1));for(let f of n)f()}prompt(){return new Promise((l,s)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),l(ml);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let i=new Li;i._write=(n,f,c)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),c()},this.input.pipe(i),this.rl=Ys.createInterface({input:this.input,output:i,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),Ys.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),wl(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(z.cursor.show),this.output.off("resize",this.render),wl(this.input,!1),l(this.value)}),this.once("cancel",()=>{this.output.write(z.cursor.show),this.output.off("resize",this.render),wl(this.input,!1),l(ml)})})}onKeypress(l,s){if(this.state==="error"&&(this.state="active"),s?.name&&(!this._track&&Rl.aliases.has(s.name)&&this.emit("cursor",Rl.aliases.get(s.name)),Rl.actions.has(s.name)&&this.emit("cursor",s.name)),l&&(l.toLowerCase()==="y"||l.toLowerCase()==="n")&&this.emit("confirm",l.toLowerCase()==="y"),l==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),l&&this.emit("key",l.toLowerCase()),s?.name==="return"){if(this.opts.validate){let i=this.opts.validate(this.value);i&&(this.error=i instanceof Error?i.message:i,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}Ol([l,s?.name,s?.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(`
36
+ `),wl(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let l=Zs(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
37
+ `).length-1;this.output.write(z.cursor.move(-999,l*-1))}render(){let l=Zs(this._render(this)??"",process.stdout.columns,{hard:!0});if(l!==this._prevFrame){if(this.state==="initial")this.output.write(z.cursor.hide);else{let s=Ki(this._prevFrame,l);if(this.restoreCursor(),s&&s?.length===1){let i=s[0];this.output.write(z.cursor.move(0,i)),this.output.write(z.erase.lines(1));let n=l.split(`
38
+ `);this.output.write(n[i]),this._prevFrame=l,this.output.write(z.cursor.move(0,n.length-i-1));return}if(s&&s?.length>1){let i=s[0];this.output.write(z.cursor.move(0,i)),this.output.write(z.erase.down());let n=l.split(`
39
+ `).slice(i);this.output.write(n.join(`
40
+ `)),this._prevFrame=l;return}this.output.write(z.erase.down())}this.output.write(l),this.state==="initial"&&(this.state="active"),this._prevFrame=l}}}class Fl extends Pl{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(l){super(l,!1),this.value=!!l.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(s)=>{this.output.write(z.cursor.move(0,-1)),this.value=s,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var Ci;Ci=new WeakMap;var Vi=Object.defineProperty,mi=(l,s,i)=>(s in l)?Vi(l,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):l[s]=i,Hs=(l,s,i)=>(mi(l,typeof s!="symbol"?s+"":s,i),i),vs=class extends Pl{constructor(l){super(l,!1),Hs(this,"options"),Hs(this,"cursor",0),this.options=l.options,this.value=[...l.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:s})=>s===l.cursorAt),0),this.on("key",(s)=>{s==="a"&&this.toggleAll()}),this.on("cursor",(s)=>{switch(s){case"left":case"up":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;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let l=this.value.length===this.options.length;this.value=l?[]:this.options.map((s)=>s.value)}toggleValue(){let l=this.value.includes(this._value);this.value=l?this.value.filter((s)=>s!==this._value):[...this.value,this._value]}};var Ai=Object.defineProperty,vi=(l,s,i)=>(s in l)?Ai(l,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):l[s]=i,hs=(l,s,i)=>(vi(l,typeof s!="symbol"?s+"":s,i),i);class ul extends Pl{constructor(l){super(l,!1),hs(this,"options"),hs(this,"cursor",0),this.options=l.options,this.cursor=this.options.findIndex(({value:s})=>s===l.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(s)=>{switch(s){case"left":case"up":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;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}}var o=A(tl(),1),Ll=A(Wl(),1);import C from"node:process";function Oi(){return C.platform!=="win32"?C.env.TERM!=="linux":!!C.env.CI||!!C.env.WT_SESSION||!!C.env.TERMINUS_SUBLIME||C.env.ConEmuTask==="{cmd::Cmder}"||C.env.TERM_PROGRAM==="Terminus-Sublime"||C.env.TERM_PROGRAM==="vscode"||C.env.TERM==="xterm-256color"||C.env.TERM==="alacritty"||C.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var dl=Oi(),J=(l,s)=>dl?l:s,Fi=J("◆","*"),Fs=J("■","x"),us=J("▲","x"),ss=J("◇","o"),ui=J("┌","T"),B=J("│","|"),fl=J("└","—"),pl=J("●",">"),Dl=J("○"," "),di=J("◻","[•]"),Os=J("◼","[+]"),pi=J("◻","[ ]"),_f=J("▪","•"),Jf=J("─","-"),jf=J("╮","+"),Yf=J("├","+"),Gf=J("╯","+"),Di=J("●","•"),ln=J("◆","*"),sn=J("▲","!"),tn=J("■","x"),ts=(l)=>{switch(l){case"initial":case"active":return o.default.cyan(Fi);case"cancel":return o.default.red(Fs);case"error":return o.default.yellow(us);case"submit":return o.default.green(ss)}},ls=(l)=>{let{cursor:s,options:i,style:n}=l,f=l.maxItems??Number.POSITIVE_INFINITY,c=Math.max(process.stdout.rows-4,0),t=Math.min(c,Math.max(f,5)),r=0;s>=r+t-3?r=Math.max(Math.min(s-t+3,i.length-t),0):s<r+2&&(r=Math.max(s-2,0));let a=t<i.length&&r>0,e=t<i.length&&r+t<i.length;return i.slice(r,r+t).map((k,b,$)=>{let y=b===0&&a,g=b===$.length-1&&e;return y||g?o.default.dim("..."):n(k,b+r===s)})};var cl=(l)=>{let s=l.active??"Yes",i=l.inactive??"No";return new Fl({active:s,inactive:i,initialValue:l.initialValue??!0,render(){let n=`${o.default.gray(B)}
41
+ ${ts(this.state)} ${l.message}
42
+ `,f=this.value?s:i;switch(this.state){case"submit":return`${n}${o.default.gray(B)} ${o.default.dim(f)}`;case"cancel":return`${n}${o.default.gray(B)} ${o.default.strikethrough(o.default.dim(f))}
43
+ ${o.default.gray(B)}`;default:return`${n}${o.default.cyan(B)} ${this.value?`${o.default.green(pl)} ${s}`:`${o.default.dim(Dl)} ${o.default.dim(s)}`} ${o.default.dim("/")} ${this.value?`${o.default.dim(Dl)} ${o.default.dim(i)}`:`${o.default.green(pl)} ${i}`}
44
+ ${o.default.cyan(fl)}
45
+ `}}}).prompt()},ds=(l)=>{let s=(i,n)=>{let f=i.label??String(i.value);switch(n){case"selected":return`${o.default.dim(f)}`;case"active":return`${o.default.green(pl)} ${f} ${i.hint?o.default.dim(`(${i.hint})`):""}`;case"cancelled":return`${o.default.strikethrough(o.default.dim(f))}`;default:return`${o.default.dim(Dl)} ${o.default.dim(f)}`}};return new ul({options:l.options,initialValue:l.initialValue,render(){let i=`${o.default.gray(B)}
46
+ ${ts(this.state)} ${l.message}
47
+ `;switch(this.state){case"submit":return`${i}${o.default.gray(B)} ${s(this.options[this.cursor],"selected")}`;case"cancel":return`${i}${o.default.gray(B)} ${s(this.options[this.cursor],"cancelled")}
48
+ ${o.default.gray(B)}`;default:return`${i}${o.default.cyan(B)} ${ls({cursor:this.cursor,options:this.options,maxItems:l.maxItems,style:(n,f)=>s(n,f?"active":"inactive")}).join(`
49
+ ${o.default.cyan(B)} `)}
50
+ ${o.default.cyan(fl)}
51
+ `}}}).prompt()};var F=(l)=>{let s=(i,n)=>{let f=i.label??String(i.value);return n==="active"?`${o.default.cyan(di)} ${f} ${i.hint?o.default.dim(`(${i.hint})`):""}`:n==="selected"?`${o.default.green(Os)} ${o.default.dim(f)} ${i.hint?o.default.dim(`(${i.hint})`):""}`:n==="cancelled"?`${o.default.strikethrough(o.default.dim(f))}`:n==="active-selected"?`${o.default.green(Os)} ${f} ${i.hint?o.default.dim(`(${i.hint})`):""}`:n==="submitted"?`${o.default.dim(f)}`:`${o.default.dim(pi)} ${o.default.dim(f)}`};return new vs({options:l.options,initialValues:l.initialValues,required:l.required??!0,cursorAt:l.cursorAt,validate(i){if(this.required&&i.length===0)return`Please select at least one option.
52
+ ${o.default.reset(o.default.dim(`Press ${o.default.gray(o.default.bgWhite(o.default.inverse(" space ")))} to select, ${o.default.gray(o.default.bgWhite(o.default.inverse(" enter ")))} to submit`))}`},render(){let i=`${o.default.gray(B)}
53
+ ${ts(this.state)} ${l.message}
54
+ `,n=(f,c)=>{let t=this.value.includes(f.value);return c&&t?s(f,"active-selected"):t?s(f,"selected"):s(f,c?"active":"inactive")};switch(this.state){case"submit":return`${i}${o.default.gray(B)} ${this.options.filter(({value:f})=>this.value.includes(f)).map((f)=>s(f,"submitted")).join(o.default.dim(", "))||o.default.dim("none")}`;case"cancel":{let f=this.options.filter(({value:c})=>this.value.includes(c)).map((c)=>s(c,"cancelled")).join(o.default.dim(", "));return`${i}${o.default.gray(B)} ${f.trim()?`${f}
55
+ ${o.default.gray(B)}`:""}`}case"error":{let f=this.error.split(`
56
+ `).map((c,t)=>t===0?`${o.default.yellow(fl)} ${o.default.yellow(c)}`:` ${c}`).join(`
57
+ `);return`${i+o.default.yellow(B)} ${ls({options:this.options,cursor:this.cursor,maxItems:l.maxItems,style:n}).join(`
58
+ ${o.default.yellow(B)} `)}
59
+ ${f}
60
+ `}default:return`${i}${o.default.cyan(B)} ${ls({options:this.options,cursor:this.cursor,maxItems:l.maxItems,style:n}).join(`
61
+ ${o.default.cyan(B)} `)}
62
+ ${o.default.cyan(fl)}
63
+ `}}}).prompt()};var x=(l="")=>{process.stdout.write(`${o.default.gray(fl)} ${o.default.red(l)}
64
64
 
65
- `)},ll=(l="")=>{process.stdout.write(`${g.default.gray(df)} ${l}
66
- `)},j=(l="")=>{process.stdout.write(`${g.default.gray(P)}
67
- ${g.default.gray(tl)} ${l}
65
+ `)},il=(l="")=>{process.stdout.write(`${o.default.gray(ui)} ${l}
66
+ `)},G=(l="")=>{process.stdout.write(`${o.default.gray(B)}
67
+ ${o.default.gray(fl)} ${l}
68
68
 
69
- `)},I={message:(l="",{symbol:s=g.default.gray(P)}={})=>{let f=[`${g.default.gray(P)}`];if(l){let[y,...i]=l.split(`
70
- `);f.push(`${s} ${y}`,...i.map((S)=>`${g.default.gray(P)} ${S}`))}process.stdout.write(`${f.join(`
69
+ `)},S={message:(l="",{symbol:s=o.default.gray(B)}={})=>{let i=[`${o.default.gray(B)}`];if(l){let[n,...f]=l.split(`
70
+ `);i.push(`${s} ${n}`,...f.map((c)=>`${o.default.gray(B)} ${c}`))}process.stdout.write(`${i.join(`
71
71
  `)}
72
- `)},info:(l)=>{I.message(l,{symbol:g.default.blue(Df)})},success:(l)=>{I.message(l,{symbol:g.default.green(ly)})},step:(l)=>{I.message(l,{symbol:g.default.green(pl)})},warn:(l)=>{I.message(l,{symbol:g.default.yellow(sy)})},warning:(l)=>{I.warn(l)},error:(l)=>{I.message(l,{symbol:g.default.red(ty)})}},zi=`${g.default.gray(P)} `;var D=({indicator:l="dots"}={})=>{let s=ml?["◒","◐","◓","◑"]:["•","o","O","0"],f=ml?80:120,y=process.env.CI==="true",i,S,t=!1,$="",c,k=performance.now(),b=(M)=>{let x=M>1?"Something went wrong":"Canceled";t&&A(x,M)},U=()=>b(2),w=()=>b(1),n=()=>{process.on("uncaughtExceptionMonitor",U),process.on("unhandledRejection",U),process.on("SIGINT",w),process.on("SIGTERM",w),process.on("exit",b)},L=()=>{process.removeListener("uncaughtExceptionMonitor",U),process.removeListener("unhandledRejection",U),process.removeListener("SIGINT",w),process.removeListener("SIGTERM",w),process.removeListener("exit",b)},J=()=>{if(c===void 0)return;y&&process.stdout.write(`
73
- `);let M=c.split(`
74
- `);process.stdout.write(Rl.cursor.move(-999,M.length-1)),process.stdout.write(Rl.erase.down(M.length))},T=(M)=>M.replace(/\.+$/,""),X=(M)=>{let x=(performance.now()-M)/1000,C=Math.floor(x/60),E=Math.floor(x%60);return C>0?`[${C}m ${E}s]`:`[${E}s]`},O=(M="")=>{t=!0,i=as(),$=T(M),k=performance.now(),process.stdout.write(`${g.default.gray(P)}
75
- `);let x=0,C=0;n(),S=setInterval(()=>{if(y&&$===c)return;J(),c=$;let E=g.default.magenta(s[x]);if(y)process.stdout.write(`${E} ${$}...`);else if(l==="timer")process.stdout.write(`${E} ${$} ${X(k)}`);else{let zl=".".repeat(Math.floor(C)).slice(0,3);process.stdout.write(`${E} ${$}${zl}`)}x=x+1<s.length?x+1:0,C=C<s.length?C+0.125:0},f)},A=(M="",x=0)=>{t=!1,clearInterval(S),J();let C=x===0?g.default.green(pl):x===1?g.default.red(ms):g.default.red(us);$=T(M??$),l==="timer"?process.stdout.write(`${C} ${$} ${X(k)}
76
- `):process.stdout.write(`${C} ${$}
77
- `),L(),i()};return{start:O,stop:A,message:(M="")=>{$=T(M??$)}}};var Z=d(sl(),1);var _=d(sl(),1);import{join as fy}from"path";import{rmSync as yy}from"fs";import{tmpdir as iy}from"os";import{spawn as ls}from"child_process";function es(l){let s=l.match(/github\.com\/([^/]+)\/([^/]+)\/tree\/([^/]+)(?:\/(.+))?$/);if(s){let[,t,$,c,k]=s;return{type:"github",url:`https://github.com/${t}/${$}.git`,branch:c,subpath:k}}let f=l.match(/github\.com\/([^/]+)\/([^/]+)/);if(f){let[,t,$]=f,c=$.replace(/\.git$/,"");return{type:"github",url:`https://github.com/${t}/${c}.git`}}let y=l.match(/gitlab\.com\/([^/]+)\/([^/]+)\/-\/tree\/([^/]+)(?:\/(.+))?$/);if(y){let[,t,$,c,k]=y;return{type:"gitlab",url:`https://gitlab.com/${t}/${$}.git`,branch:c,subpath:k}}let i=l.match(/gitlab\.com\/([^/]+)\/([^/]+)/);if(i){let[,t,$]=i,c=$.replace(/\.git$/,"");return{type:"gitlab",url:`https://gitlab.com/${t}/${c}.git`}}let S=l.match(/^([^/]+)\/([^/]+)(?:\/(.+))?$/);if(S&&!l.includes(":")){let[,t,$,c]=S;return{type:"github",url:`https://github.com/${t}/${$}.git`,subpath:c}}return{type:"git",url:l}}async function Bl(l,s){let f=fy(iy(),`give-skill-${Date.now()}`),y=["clone","--depth","1"];if(s)y.push("--branch",s);return y.push(l,f),await new Promise((i,S)=>{let t=ls("git",y,{stdio:"pipe"});t.on("close",($)=>{if($===0)i();else S(Error(`Failed to clone repository: ${l}`))}),t.on("error",S)}),f}async function ps(l,s="main"){return await new Promise((y,i)=>{let S="",t=ls("git",["ls-remote",l,`refs/heads/${s}`],{stdio:"pipe"});t.stdout?.on("data",($)=>{S+=$.toString()}),t.on("close",($)=>{if($===0&&S.trim())y(S.trim().split(/\s+/)[0]??"");else i(Error(`Failed to get latest commit from ${l}`))}),t.on("error",i)})}async function _l(l){return await new Promise((f,y)=>{let i="",S=ls("git",["rev-parse","HEAD"],{cwd:l,stdio:"pipe"});S.stdout?.on("data",(t)=>{i+=t.toString()}),S.on("close",(t)=>{if(t===0&&i.trim())f(i.trim());else y(Error("Failed to get commit hash"))}),S.on("error",y)})}async function ql(l){yy(l,{recursive:!0,force:!0})}import{readdir as lt,readFile as $y,stat as ky}from"fs/promises";import{join as m,basename as cy,dirname as by}from"path";import{homedir as Sy}from"os";import{join as q}from"path";import{existsSync as W}from"fs";var r=Sy(),z={opencode:{name:"opencode",displayName:"OpenCode",skillsDir:".opencode/skill",globalSkillsDir:q(r,".config/opencode/skill"),detectInstalled:async()=>{return W(q(r,".config/opencode"))}},"claude-code":{name:"claude-code",displayName:"Claude Code",skillsDir:".claude/skills",globalSkillsDir:q(r,".claude/skills"),detectInstalled:async()=>{return W(q(r,".claude"))}},codex:{name:"codex",displayName:"Codex",skillsDir:".codex/skills",globalSkillsDir:q(r,".codex/skills"),detectInstalled:async()=>{return W(q(r,".codex"))}},cursor:{name:"cursor",displayName:"Cursor",skillsDir:".cursor/skills",globalSkillsDir:q(r,".cursor/skills"),detectInstalled:async()=>{return W(q(r,".cursor"))}},amp:{name:"amp",displayName:"Amp",skillsDir:".agents/skills",globalSkillsDir:q(r,".config/agents/skills"),detectInstalled:async()=>{return W(q(r,".config/amp"))}},kilo:{name:"kilo",displayName:"Kilo Code",skillsDir:".kilocode/skills",globalSkillsDir:q(r,".kilocode/skills"),detectInstalled:async()=>{return W(q(r,".kilocode"))}},roo:{name:"roo",displayName:"Roo Code",skillsDir:".roo/skills",globalSkillsDir:q(r,".roo/skills"),detectInstalled:async()=>{return W(q(r,".roo"))}},goose:{name:"goose",displayName:"Goose",skillsDir:".goose/skills",globalSkillsDir:q(r,".config/goose/skills"),detectInstalled:async()=>{return W(q(r,".config/goose"))}},antigravity:{name:"antigravity",displayName:"Antigravity",skillsDir:".agent/skills",globalSkillsDir:q(r,".gemini/antigravity/skills"),detectInstalled:async()=>{return W(q(r,".gemini/antigravity"))}},copilot:{name:"copilot",displayName:"GitHub Copilot",skillsDir:".github/skills",globalSkillsDir:q(r,".copilot/skills"),detectInstalled:async()=>{return W(q(r,".copilot"))}},gemini:{name:"gemini",displayName:"Gemini CLI",skillsDir:".gemini/skills",globalSkillsDir:q(r,".gemini/skills"),detectInstalled:async()=>{return W(q(r,".gemini"))}},windsurf:{name:"windsurf",displayName:"Windsurf",skillsDir:".windsurf/skills",globalSkillsDir:q(r,".codeium/windsurf/skills"),detectInstalled:async()=>{return W(q(r,".codeium/windsurf"))}},trae:{name:"trae",displayName:"Trae",skillsDir:".trae/skills",globalSkillsDir:q(r,".trae/skills"),detectInstalled:async()=>{return W(q(r,".trae"))}},factory:{name:"factory",displayName:"Factory Droid",skillsDir:".factory/skills",globalSkillsDir:q(r,".factory/skills"),detectInstalled:async()=>{return W(q(r,".factory"))}},letta:{name:"letta",displayName:"Letta",skillsDir:".skills",globalSkillsDir:q(r,".letta/skills"),detectInstalled:async()=>{return W(q(r,".letta"))}}};async function Ds(){let l=[];for(let[s,f]of Object.entries(z))if(await f.detectInstalled())l.push(s);return l}var ny=["node_modules",".git","dist","build","__pycache__"],Iy=["skills","skills/.curated","skills/.experimental","skills/.system"];function wy(l){let s=[l];for(let y of Iy)s.push(m(l,y));let f=new Set;for(let y of Object.values(z))f.add(m(l,y.skillsDir));return s.push(...f),s}function gy(l){let s=l.match(/^---\n([\s\S]+?)\n---\n([\s\S]*)$/);if(!s)return{data:{},content:l};let f=s[1],y=s[2],i={};for(let S of f.split(`
78
- `)){let t=S.indexOf(":");if(t===-1)continue;let $=S.slice(0,t).trim(),c=S.slice(t+1).trim();if(c.startsWith('"')&&c.endsWith('"')||c.startsWith("'")&&c.endsWith("'"))i[$]=c.slice(1,-1);else if($==="metadata")try{let k={},b=c.replace(/^\{|\}$/g,"").trim();if(b){for(let U of b.split(",")){let[w,n]=U.split("=").map((L)=>L.trim());if(w&&n)k[w]=n.replace(/^['"]|['"]$/g,"")}i[$]=JSON.stringify(k)}}catch{i[$]=c}else i[$]=c}return{data:i,content:y}}async function ts(l){try{let s=m(l,"SKILL.md");return(await ky(s)).isFile()}catch{return!1}}async function ss(l){try{let s=await $y(l,"utf-8"),{data:f}=gy(s);if(!f.name||!f.description)return null;return{name:f.name,description:f.description,path:by(l),metadata:f.metadata?JSON.parse(f.metadata):void 0}}catch{return null}}async function st(l,s=0,f=5){let y=[];if(s>f)return y;try{if(await ts(l))y.push(l);let i=await lt(l,{withFileTypes:!0});for(let S of i)if(S.isDirectory()&&!ny.includes(S.name)){let t=await st(m(l,S.name),s+1,f);y.push(...t)}}catch{}return y}async function rl(l,s){let f=[],y=new Set,i=s?m(l,s):l;if(await ts(i)){let t=await ss(m(i,"SKILL.md"));if(t)return f.push(t),f}let S=wy(i);for(let t of S)try{let $=await lt(t,{withFileTypes:!0});for(let c of $)if(c.isDirectory()){let k=m(t,c.name);if(await ts(k)){let b=await ss(m(k,"SKILL.md"));if(b&&!y.has(b.name))f.push(b),y.add(b.name)}}}catch{}if(f.length===0){let t=await st(i);for(let $ of t){let c=await ss(m($,"SKILL.md"));if(c&&!y.has(c.name))f.push(c),y.add(c.name)}}return f}function u(l){return l.name||cy(l.path)}import{mkdir as tt,cp as Uy,access as Ly,readdir as Ry}from"fs/promises";import{join as F,basename as Ty}from"path";async function Jl(l,s,f={}){let y=z[s],i=l.name||Ty(l.path),S=f.cwd||process.cwd(),t=f.global?y.globalSkillsDir:F(S,y.skillsDir),$=F(t,i);try{return await tt($,{recursive:!0}),await ft(l.path,$),{success:!0,path:$,originalPath:f.global?$:F(y.skillsDir,i)}}catch(c){return{success:!1,path:$,originalPath:f.global?$:F(y.skillsDir,i),error:c instanceof Error?c.message:"Unknown error"}}}var By=new Set(["README.md","metadata.json"]),_y=(l)=>{if(By.has(l))return!0;if(l.startsWith("_"))return!0;return!1};async function ft(l,s){await tt(s,{recursive:!0});let f=await Ry(l,{withFileTypes:!0});for(let y of f){if(_y(y.name))continue;let i=F(l,y.name),S=F(s,y.name);if(y.isDirectory())await ft(i,S);else await Uy(i,S)}}async function yt(l,s,f={}){let y=z[s],i=f.global?y.globalSkillsDir:F(f.cwd||process.cwd(),y.skillsDir),S=F(i,l);try{return await Ly(S),!0}catch{return!1}}function it(l,s,f={}){let y=z[s],i=f.global?y.globalSkillsDir:F(f.cwd||process.cwd(),y.skillsDir);return F(i,l)}import{homedir as qy}from"os";import{join as ys}from"path";import{existsSync as is,readFileSync as ry,writeFileSync as St,mkdirSync as Jy}from"fs";var fs=ys(qy(),".give-skill"),Pl=ys(fs,"state.json");function $t(){if(!is(fs))Jy(fs,{recursive:!0})}function kl(){if($t(),!is(Pl)){let l={lastUpdate:new Date().toISOString(),skills:{}};return St(Pl,JSON.stringify(l,null,2)),l}try{let l=ry(Pl,"utf-8");return JSON.parse(l)}catch{return{lastUpdate:new Date().toISOString(),skills:{}}}}function Yl(l){$t(),l.lastUpdate=new Date().toISOString(),St(Pl,JSON.stringify(l,null,2))}function kt(l,s,f,y,i,S){let t=kl(),$=l.toLowerCase(),c=!1,k;if(!t.skills[$])t.skills[$]={source:s,url:s,subpath:f,branch:y,commit:i,installedAt:new Date().toISOString(),installations:[]};else{if(t.skills[$].branch!==y)k=t.skills[$].branch,t.skills[$].branch=y,t.skills[$].commit=i,c=!0;if(t.skills[$].url=s,t.skills[$].source=s,f)t.skills[$].subpath=f}let b=t.skills[$].installations.findIndex((U)=>U.agent===S.agent&&U.path===S.path);if(b>=0)t.skills[$].installations[b]=S;else t.skills[$].installations.push(S);return Yl(t),{updated:c,previousBranch:k}}function Gl(l,s,f){let y=kl(),i=l.toLowerCase();if(!y.skills[i])return;if(y.skills[i].installations=y.skills[i].installations.filter((S)=>!(S.agent===s&&S.path===f)),y.skills[i].installations.length===0)delete y.skills[i];Yl(y)}function ct(l,s){let f=kl(),y=l.toLowerCase();if(f.skills[y])f.skills[y].commit=s,Yl(f)}function yl(){return kl()}async function bt(){let l=kl(),s=[];for(let[f,y]of Object.entries(l.skills)){let i=[];for(let S of y.installations)try{let t=S.type==="global"?S.path:ys(process.cwd(),S.path);if(is(t))i.push(S)}catch{}if(i.length===0)s.push(f);else if(i.length!==y.installations.length)y.installations=i}for(let f of s)delete l.skills[f];if(s.length>0)Yl(l)}async function nt(l,s){let f={tempDir:null,spinner:D()};try{f.spinner.start("Parsing source...");let y=es(l),i=y.branch??"main";f.spinner.stop(`Source: ${_.default.cyan(y.url)}${y.subpath?` (${y.subpath})`:""}${y.branch?` @ ${_.default.cyan(y.branch)}`:""}`),f.spinner.start("Cloning repository..."),f.tempDir=await Bl(y.url,y.branch),f.spinner.stop("Repository cloned");let S=await _l(f.tempDir);f.spinner.start("Discovering skills...");let t=await rl(f.tempDir,y.subpath);if(t.length===0)return f.spinner.stop(_.default.red("No skills found")),j(_.default.red("No valid skills found. Skills require a SKILL.md with name and description.")),{success:!1,installed:0,failed:0,results:[]};if(f.spinner.stop(`Found ${_.default.green(t.length)} skill${t.length>1?"s":""}`),s.list){console.log(),I.step(_.default.bold("Available Skills"));for(let w of t)I.message(` ${_.default.cyan(u(w))}`),I.message(` ${_.default.dim(w.description)}`);return console.log(),j("Use --skill <name> to install specific skills"),{success:!0,installed:0,failed:0,results:[]}}let $=await Py(t,s);if(!$)return{success:!1,installed:0,failed:0,results:[]};let c=await Yy(s,f);if(!c)return{success:!1,installed:0,failed:0,results:[]};let k=await Gy(s);if(k===null)return{success:!1,installed:0,failed:0,results:[]};if(!await Xy(s,$,c,k))return{success:!1,installed:0,failed:0,results:[]};f.spinner.start("Installing skills...");let U=await zy($,c,k,y,S,i);return f.spinner.stop("Installation complete"),U}finally{if(f.tempDir)await ql(f.tempDir)}}async function Py(l,s){let f;if(s.skill&&s.skill.length>0){if(f=l.filter((y)=>s.skill.some((i)=>y.name.toLowerCase()===i.toLowerCase()||u(y).toLowerCase()===i.toLowerCase())),f.length===0){I.error(`No matching skills found for: ${s.skill.join(", ")}`),I.info("Available skills:");for(let y of l)I.message(` - ${u(y)}`);return null}I.info(`Selected ${f.length} skill${f.length!==1?"s":""}: ${f.map((y)=>_.default.cyan(u(y))).join(", ")}`)}else if(l.length===1){f=l;let y=l[0];I.info(`Skill: ${_.default.cyan(u(y))}`),I.message(_.default.dim(y.description))}else if(s.yes)f=l,I.info(`Installing all ${l.length} skills`);else{let y=l.map((S)=>({value:S,label:u(S),hint:S.description.length>60?S.description.slice(0,57)+"...":S.description})),i=await o({message:"Select skills to install",options:y,required:!0});if(K(i))return V("Installation cancelled"),null;f=i}return f}async function Yy(l,s){if(l.agent&&l.agent.length>0){let y=Object.keys(z),i=l.agent.filter((S)=>!y.includes(S));if(i.length>0)return I.error(`Invalid agents: ${i.join(", ")}`),I.info(`Valid agents: ${y.join(", ")}`),null;return l.agent}s.spinner.start("Detecting installed agents...");let f=await Ds();if(s.spinner.stop(`Detected ${f.length} agent${f.length!==1?"s":""}`),f.length===0)if(l.yes){let y=Object.keys(z);return I.info("Installing to all agents (none detected)"),y}else{I.warn("No coding agents detected. You can still install skills.");let y=Object.entries(z).map(([S,t])=>({value:S,label:t.displayName})),i=await o({message:"Select agents to install skills to",options:y,required:!0});if(K(i))return V("Installation cancelled"),null;return i}else if(f.length===1||l.yes){if(f.length===1){let y=f[0];I.info(`Installing to: ${_.default.cyan(z[y].displayName)}`)}else I.info(`Installing to: ${f.map((y)=>_.default.cyan(z[y].displayName)).join(", ")}`);return f}else{let y=f.map((S)=>({value:S,label:z[S].displayName,hint:z[S].skillsDir})),i=await o({message:"Select agents to install skills to",options:y,required:!0,initialValues:f});if(K(i))return V("Installation cancelled"),null;return i}}async function Gy(l){let s=l.global??!1;if(l.global===void 0&&!l.yes){let f=await ds({message:"Installation scope",options:[{value:!1,label:"Project",hint:"Install in current directory (committed with your project)"},{value:!0,label:"Global",hint:"Install in home directory (available across all projects)"}]});if(K(f))return V("Installation cancelled"),null;s=f}return s}async function Xy(l,s,f,y){console.log(),I.step(_.default.bold("Installation Summary"));for(let i of s){I.message(` ${_.default.cyan(u(i))}`);for(let S of f){let t=it(i.name,S,{global:y}),c=await yt(i.name,S,{global:y})?_.default.yellow(" (will overwrite)"):"";I.message(` ${_.default.dim("→")} ${z[S].displayName}: ${_.default.dim(t)}${c}`)}}if(console.log(),!l.yes){let i=await fl({message:"Proceed with installation?"});if(K(i)||!i)return V("Installation cancelled"),!1}return!0}async function zy(l,s,f,y,i,S){let t=l.flatMap((w)=>s.map((n)=>Jl(w,n,{global:f}))),$=await Promise.all(t),c=$.map((w,n)=>{let L=Math.floor(n/s.length),J=n%s.length,T=l[L],X=s[J];return{skill:u(T),agent:z[X].displayName,...w}}),k=new Map;for(let[w,n]of $.entries())if(n.success){let L=Math.floor(w/s.length),J=w%s.length,T=l[L],X=s[J],O=kt(T.name,y.url,y.subpath,S,i,{agent:X,type:f?"global":"project",path:n.originalPath});if(O.updated&&O.previousBranch){let A=k.get(T.name);k.set(T.name,{previous:A?.previous??O.previousBranch,current:A?.current??S})}}console.log();let b=c.filter((w)=>w.success),U=c.filter((w)=>!w.success);if(k.size>0){console.log();for(let[w,{previous:n,current:L}]of k)I.warn(_.default.yellow(` ${_.default.cyan(w)}: ${_.default.dim(n)} → ${_.default.green(L)}`))}if(b.length>0){console.log(),I.success(_.default.green(`Successfully installed ${b.length} skill${b.length!==1?"s":""}`));for(let w of b)I.message(` ${_.default.green("✓")} ${w.skill} → ${w.agent}`),I.message(` ${_.default.dim(w.path)}`)}if(U.length>0){console.log(),I.error(_.default.red(`Failed to install ${U.length} skill${U.length!==1?"s":""}`));for(let w of U)I.message(` ${_.default.red("✗")} ${w.skill} → ${w.agent}`),I.message(` ${_.default.dim(w.error)}`)}return console.log(),j(_.default.green("Done!")),{success:U.length===0,installed:b.length,failed:U.length,results:c}}var R=d(sl(),1);import{existsSync as wt}from"fs";import{join as Qy,resolve as Zy}from"path";function gt(l){return l.type==="global"?l.path:Zy(process.cwd(),l.path)}async function It(l,s){let f=s.installations.map((i)=>{let S=gt(i);return{agent:z[i.agent].displayName,path:S,exists:wt(S)}});if(f.filter((i)=>i.exists).length===0)return{skillName:l,currentCommit:s.commit,latestCommit:s.commit,status:"orphaned",installations:f};try{let i=await ps(s.url,s.branch),S=i===s.commit;return{skillName:l,currentCommit:s.commit,latestCommit:i,status:S?"latest":"update-available",installations:f}}catch(i){return{skillName:l,currentCommit:s.commit,latestCommit:s.commit,status:"error",installations:f,error:i instanceof Error?i.message:"Unknown error"}}}async function Ss(l){let s=yl(),f=[],y=Object.entries(s.skills).map(([t,$])=>({skillName:t,state:$})),i;if(l&&l.length>0){let t=new Set(l.map(($)=>$.toLowerCase()));i=y.filter(({skillName:$})=>t.has($.toLowerCase()))}else i=y;if(i.length===0)return[];let S=D();if(i.length===1){let{skillName:t,state:$}=i[0];S.start(`Checking ${R.default.cyan(t)}...`);let c=await It(t,$);S.stop(c.status==="latest"?R.default.green("Up to date"):R.default.yellow("Update available")),f.push(c)}else{S.start(`Checking ${i.length} skill${i.length>1?"s":""}...`);for(let{skillName:t,state:$}of i){let c=await It(t,$);f.push(c)}S.stop("Check complete")}return f}async function Ut(l,s={}){let f=yl(),y=[],i=Object.entries(f.skills).map(([n,L])=>({skillName:n,state:L})),S;if(l&&l.length>0){let n=new Set(l.map((L)=>L.toLowerCase()));S=i.filter(({skillName:L})=>n.has(L.toLowerCase()))}else S=i;if(S.length===0)return I.warn("No skills found to update"),[];let t=await Ss(l),$=t.filter((n)=>n.status==="update-available");if($.length===0){let n=t.filter((L)=>L.status==="orphaned");if(n.length>0){I.warn(`${n.length} skill${n.length>1?"s":""} have no valid installations`);for(let L of n)I.message(` ${R.default.yellow("○")} ${R.default.cyan(L.skillName)} - all installations removed`)}return I.success(R.default.green("All skills are up to date")),[]}console.log(),I.step(R.default.bold("Updates Available"));let c=$.map((n)=>({value:n.skillName,label:n.skillName,hint:`${n.currentCommit.slice(0,7)} → ${n.latestCommit.slice(0,7)}`})),k;if(s.yes)k=$.map((n)=>n.skillName);else{let n=await o({message:"Select skills to update",options:c,required:!0,initialValues:$.map((L)=>L.skillName)});if(K(n))return V("Update cancelled"),[];k=n}console.log(),I.step(R.default.bold("Will Update"));for(let n of k){let L=$.find((J)=>J.skillName===n);if(L)I.message(` ${R.default.cyan(L.skillName)}`),I.message(` ${R.default.dim("Current:")} ${R.default.yellow(L.currentCommit.slice(0,7))} ${R.default.dim("→")} ${R.default.green(L.latestCommit.slice(0,7))}`)}if(console.log(),!s.yes){let n=await fl({message:"Proceed with update?"});if(K(n)||!n)return V("Update cancelled"),[]}let b=D();b.start(`Updating ${k.length} skill${k.length>1?"s":""}...`);for(let{skillName:n,state:L}of S){let J=t.find((A)=>A.skillName===n);if(!J||J.status!=="update-available"){if(J?.status==="latest")y.push({skillName:n,success:!0,updated:0,failed:0});else y.push({skillName:n,success:!1,updated:0,failed:0});continue}if(!k.includes(n))continue;let T=null,X=0,O=0;try{T=await Bl(L.url);let A=await _l(T),M=L.subpath?Qy(T,L.subpath):T,C=(await rl(M)).find((E)=>E.name.toLowerCase()===n.toLowerCase());if(!C)throw Error("Skill not found in repository");for(let E of L.installations){let zl=gt(E);if(!wt(zl)){Gl(n,E.agent,E.path);continue}if((await Jl(C,E.agent,{global:E.type==="global"})).success)X++;else O++}ct(n,A),y.push({skillName:n,success:O===0,updated:X,failed:O})}catch(A){y.push({skillName:n,success:!1,updated:X,failed:O+1,error:A instanceof Error?A.message:"Unknown error"})}finally{if(T)await ql(T)}}b.stop("Update complete"),console.log();let U=y.filter((n)=>n.success&&n.updated>0),w=y.filter((n)=>!n.success||n.failed>0);if(U.length>0){I.success(R.default.green(`Updated ${U.length} skill${U.length!==1?"s":""}`));for(let n of U)I.message(` ${R.default.green("✓")} ${R.default.cyan(n.skillName)} (${n.updated} installation${n.updated!==1?"s":""})`)}if(w.length>0){console.log(),I.error(R.default.red(`Failed to update ${w.length} skill${w.length!==1?"s":""}`));for(let n of w)if(I.message(` ${R.default.red("✗")} ${R.default.cyan(n.skillName)}`),n.error)I.message(` ${R.default.dim(n.error)}`)}if(console.log(),U.length>0)j(R.default.green("Done!"));else j(R.default.yellow("No skills were updated"));return y}async function Lt(l){if(l.length===0){I.warn("No skills tracked. Install skills with:"),console.log(),I.message(` ${R.default.cyan("npx give-skill <repo>")}`),console.log();return}console.log(),I.step(R.default.bold("Skills Status"));for(let s of l){let f={latest:R.default.green("✓"),"update-available":R.default.yellow("↓"),error:R.default.red("✗"),orphaned:R.default.dim("○")}[s.status],y={latest:R.default.green("latest"),"update-available":R.default.yellow("update available"),error:R.default.red("error"),orphaned:R.default.dim("orphaned")}[s.status];if(I.message(`${f} ${R.default.cyan(s.skillName)}`),I.message(` Status: ${y}`),s.status==="update-available")I.message(` ${R.default.dim("Commit:")} ${R.default.yellow(s.currentCommit.slice(0,7))} ${R.default.dim("→")} ${R.default.green(s.latestCommit.slice(0,7))}`);else if(s.status==="latest")I.message(` ${R.default.dim("Commit:")} ${s.currentCommit.slice(0,7)}`);if(s.error)I.message(` ${R.default.red(s.error)}`);let i=s.installations.filter((t)=>t.exists);if(i.length>0){I.message(` ${R.default.dim("Installed in:")}`);for(let t of i)I.message(` ${R.default.dim("•")} ${t.agent}: ${R.default.dim(t.path)}`)}let S=s.installations.filter((t)=>!t.exists);if(S.length>0){I.message(` ${R.default.yellow("Missing installations:")}`);for(let t of S)I.message(` ${R.default.dim("•")} ${t.agent}: ${R.default.dim(t.path)}`)}console.log()}}async function Rt(){let l=D();l.start("Checking for orphaned entries..."),await bt(),l.stop(R.default.green("Cleaned up orphaned entries"))}var Y=d(sl(),1);import{existsSync as Xl,rmSync as jy}from"fs";import{resolve as My}from"path";function $s(l){return l.type==="global"?l.path:My(process.cwd(),l.path)}async function Hy(l){try{if(Xl(l))jy(l,{recursive:!0,force:!0});return{success:!0}}catch(s){return{success:!1,error:s instanceof Error?s.message:"Unknown error"}}}async function Tt(l=[],s={}){let f=yl(),y=[];if(Object.keys(f.skills).length===0)return I.warn("No skills tracked. Install skills with:"),console.log(),I.message(` ${Y.default.cyan("npx give-skill <repo>")}`),console.log(),[];let i=Object.entries(f.skills).map(([w,n])=>({skillName:w,state:n})),S;if(l.length>0){let w=new Set(l.map((n)=>n.toLowerCase()));S=i.filter(({skillName:n})=>w.has(n.toLowerCase()))}else{let n=i.map(({skillName:L,state:J})=>{let T=J.installations.map((X)=>({installation:X,resolvedPath:$s(X)})).filter(({resolvedPath:X})=>Xl(X));return{value:L,label:L,hint:T.length>0?`${T.length} installation${T.length!==1?"s":""}`:"no valid installations"}}).filter((L)=>L.hint!=="no valid installations");if(n.length===0)return I.warn("No valid installations found"),[];if(s.yes)S=i.filter(({skillName:L})=>n.some((J)=>J.value===L));else{let L=await o({message:"Select skills to remove",options:n,required:!0,initialValues:n.map((T)=>T.value)});if(K(L))return V("Remove cancelled"),[];let J=L;S=i.filter(({skillName:T})=>J.includes(T))}}if(S.length===0){if(l.length>0){I.error(`No matching skills found for: ${l.join(", ")}`),I.info("Tracked skills:");for(let w of i)I.message(` - ${Y.default.cyan(w.skillName)}`)}return[]}console.log(),I.step(Y.default.bold("Skills to Remove"));let t=[];for(let{skillName:w,state:n}of S){let L=n.installations;if(s.agent&&s.agent.length>0){let T=new Set(s.agent);L=L.filter((X)=>T.has(X.agent))}if(s.global!==void 0){let T=s.global?"global":"project";L=L.filter((X)=>X.type===T)}let J=L.map((T)=>({installation:T,resolvedPath:$s(T)})).filter(({resolvedPath:T})=>Xl(T));if(J.length>0){t.push({skillName:w,installations:J}),I.message(` ${Y.default.cyan(w)}`);for(let{resolvedPath:T}of J)I.message(` ${Y.default.dim("→")} ${T}`)}}if(t.length===0)return I.warn("No installations match the specified criteria"),[];let $=l.length===0,c;if(s.yes||$)c=t.map(({skillName:w})=>w);else{let w=t.map(({skillName:L,installations:J})=>({value:L,label:L,hint:`${J.length} installation${J.length!==1?"s":""}`})),n=await o({message:"Select skills to remove",options:w,required:!0,initialValues:t.map(({skillName:L})=>L)});if(K(n))return V("Remove cancelled"),[];c=n}console.log(),I.step(Y.default.bold("Will Remove"));for(let w of c){let n=t.find((L)=>L.skillName===w);if(n){I.message(` ${Y.default.cyan(n.skillName)}`);for(let{resolvedPath:L}of n.installations)I.message(` ${Y.default.dim("→")} ${L}`)}}if(console.log(),!s.yes){let w=await fl({message:"Remove these skills?"});if(K(w)||!w)return V("Remove cancelled"),[]}let k=D();k.start(`Removing ${c.length} skill${c.length>1?"s":""}...`);for(let{skillName:w,installations:n}of t){if(!c.includes(w))continue;let L={skillName:w,success:!0,removed:0,failed:0,installations:[]};for(let{installation:J,resolvedPath:T}of n){let X=await Hy(T);if(L.installations.push({agent:z[J.agent].displayName,path:T,removed:X.success,error:X.error}),X.success)L.removed++,Gl(w,J.agent,J.path);else L.failed++,L.success=!1}y.push(L)}k.stop("Remove complete"),console.log();let b=y.filter((w)=>w.success&&w.removed>0),U=y.filter((w)=>!w.success||w.failed>0);if(b.length>0){I.success(Y.default.green(`Removed ${b.length} skill${b.length!==1?"s":""}`));for(let w of b)I.message(` ${Y.default.green("✓")} ${Y.default.cyan(w.skillName)}`),I.message(` ${Y.default.dim(`${w.removed} installation${w.removed!==1?"s":""} removed`)}`)}if(U.length>0){console.log(),I.error(Y.default.red(`Failed to remove ${U.length} skill${U.length!==1?"s":""}`));for(let w of U){I.message(` ${Y.default.red("✗")} ${Y.default.cyan(w.skillName)}`);for(let n of w.installations.filter((L)=>!L.removed))if(n.error)I.message(` ${Y.default.dim(n.error)}`)}}return console.log(),j(Y.default.green("Done!")),y}async function Bt(){let l=yl();if(Object.keys(l.skills).length===0){I.warn("No skills tracked. Install skills with:"),console.log(),I.message(` ${Y.default.cyan("npx give-skill <repo>")}`),console.log();return}console.log(),I.step(Y.default.bold("Installed Skills"));for(let[s,f]of Object.entries(l.skills)){I.message(`${Y.default.cyan(s)}`);let y=f.installations.map((i)=>({installation:i,resolvedPath:$s(i)})).filter(({resolvedPath:i})=>Xl(i));if(y.length>0){I.message(` ${Y.default.dim("Installed in:")}`);for(let{installation:i,resolvedPath:S}of y){let t=i.type==="global"?"global":"project";I.message(` ${Y.default.dim("•")} ${z[i.agent].displayName} ${Y.default.dim(`(${t})`)}: ${Y.default.dim(S)}`)}}console.log()}}var _t={name:"give-skill",version:"1.1.0",description:"Universal skill installer for AI coding agents - Claude, Cursor, Copilot, and more",type:"module",bin:{"give-skill":"./dist/index.js"},files:["dist","README.md"],scripts:{build:"bun build src/index.ts --outdir dist --target node --minify",dev:"bun src/index.ts",prepublishOnly:"bun run build"},keywords:["cli","skills","claude","cursor","copilot","github-copilot","ai-agents","agent-skills","coding-assistant"],repository:{type:"git",url:"git+https://github.com/compilecafe/give-skill.git"},homepage:"https://github.com/compilecafe/give-skill#readme",bugs:{url:"https://github.com/compilecafe/give-skill/issues"},author:"Compile Café",license:"MIT",dependencies:{"@clack/prompts":"^0.11.0",commander:"^14.0.2",picocolors:"^1.1.1"},devDependencies:{"@types/bun":"latest"},module:"src/index.ts"};var Wy=_t.version;e.name("give-skill").description("Install skills onto coding agents (Claude Code, Cursor, Copilot, Gemini, Windsurf, Trae, Factory, Letta, OpenCode, Codex, Antigravity, Amp, Kilo, Roo, Goose)").version(Wy).argument("<source>","Git repo URL, GitHub shorthand (owner/repo), or direct path to skill").option("-g, --global","Install skill globally (user-level) instead of project-level").option("-a, --agent <agents...>","Specify agents to install to (windsurf, gemini, claude-code, cursor, copilot, etc.)").option("-s, --skill <skills...>","Specify skill names to install (skip selection prompt)").option("-l, --list","List available skills in the repository without installing").option("-y, --yes","Skip confirmation prompts").action(async(l,s)=>{await Ey(l,s)});e.command("update [skills...]").description("Update installed skills to their latest versions").option("-y, --yes","Skip confirmation prompts").action(async(l,s)=>{await xy(l,s)});e.command("status [skills...]").description("Check status of installed skills (updates available, orphaned, etc.)").action(async(l)=>{await Cy(l)});e.command("remove [skills...]").description("Remove installed skills").option("-g, --global","Remove from global location only").option("-a, --agent <agents...>","Remove from specific agents only").option("-y, --yes","Skip confirmation prompts").action(async(l,s)=>{await Ny(l,s)});e.command("list").description("List all installed skills").action(async()=>{await Vy()});e.command("clean").description("Remove orphaned skill entries from state").action(async()=>{await Ay()});e.parse();async function Ey(l,s){console.log(),ll(Z.default.bgCyan(Z.default.black(" give-skill ")));try{let f=await nt(l,s);if(!f.success&&f.installed===0&&f.failed===0)process.exit(1);if(f.failed>0)process.exit(1)}catch(f){I.error(f instanceof Error?f.message:"Unknown error occurred"),j(Z.default.red("Installation failed")),process.exit(1)}}async function xy(l,s){console.log(),ll(Z.default.bgCyan(Z.default.black(" give-skill ")));try{await Ut(l.length>0?l:void 0,s)}catch(f){I.error(f instanceof Error?f.message:"Unknown error occurred"),j(Z.default.red("Update failed")),process.exit(1)}}async function Cy(l){console.log(),ll(Z.default.bgCyan(Z.default.black(" give-skill ")));try{let s=await Ss(l.length>0?l:void 0);await Lt(s),j("Done!")}catch(s){I.error(s instanceof Error?s.message:"Unknown error occurred"),j(Z.default.red("Status check failed")),process.exit(1)}}async function Ny(l,s){console.log(),ll(Z.default.bgCyan(Z.default.black(" give-skill ")));try{await Tt(l,s)}catch(f){I.error(f instanceof Error?f.message:"Unknown error occurred"),j(Z.default.red("Remove failed")),process.exit(1)}}async function Vy(){console.log(),ll(Z.default.bgCyan(Z.default.black(" give-skill ")));try{await Bt(),j("Done!")}catch(l){I.error(l instanceof Error?l.message:"Unknown error occurred"),j(Z.default.red("List failed")),process.exit(1)}}async function Ay(){console.log(),ll(Z.default.bgCyan(Z.default.black(" give-skill ")));try{await Rt(),console.log(),j(Z.default.green("Done!"))}catch(l){I.error(l instanceof Error?l.message:"Unknown error occurred"),j(Z.default.red("Clean failed")),process.exit(1)}}
72
+ `)},info:(l)=>{S.message(l,{symbol:o.default.blue(Di)})},success:(l)=>{S.message(l,{symbol:o.default.green(ln)})},step:(l)=>{S.message(l,{symbol:o.default.green(ss)})},warn:(l)=>{S.message(l,{symbol:o.default.yellow(sn)})},warning:(l)=>{S.warn(l)},error:(l)=>{S.message(l,{symbol:o.default.red(tn)})}},Xf=`${o.default.gray(B)} `;var sl=({indicator:l="dots"}={})=>{let s=dl?["◒","◐","◓","◑"]:["•","o","O","0"],i=dl?80:120,n=process.env.CI==="true",f,c,t=!1,r="",a,e=performance.now(),k=(X)=>{let H=X>1?"Something went wrong":"Canceled";t&&E(H,X)},b=()=>k(2),$=()=>k(1),y=()=>{process.on("uncaughtExceptionMonitor",b),process.on("unhandledRejection",b),process.on("SIGINT",$),process.on("SIGTERM",$),process.on("exit",k)},g=()=>{process.removeListener("uncaughtExceptionMonitor",b),process.removeListener("unhandledRejection",b),process.removeListener("SIGINT",$),process.removeListener("SIGTERM",$),process.removeListener("exit",k)},w=()=>{if(a===void 0)return;n&&process.stdout.write(`
73
+ `);let X=a.split(`
74
+ `);process.stdout.write(Ll.cursor.move(-999,X.length-1)),process.stdout.write(Ll.erase.down(X.length))},U=(X)=>X.replace(/\.+$/,""),Y=(X)=>{let H=(performance.now()-X)/1000,h=Math.floor(H/60),Z=Math.floor(H%60);return h>0?`[${h}m ${Z}s]`:`[${Z}s]`},V=(X="")=>{t=!0,f=As(),r=U(X),e=performance.now(),process.stdout.write(`${o.default.gray(B)}
75
+ `);let H=0,h=0;y(),c=setInterval(()=>{if(n&&r===a)return;w(),a=r;let Z=o.default.magenta(s[H]);if(n)process.stdout.write(`${Z} ${r}...`);else if(l==="timer")process.stdout.write(`${Z} ${r} ${Y(e)}`);else{let Gl=".".repeat(Math.floor(h)).slice(0,3);process.stdout.write(`${Z} ${r}${Gl}`)}H=H+1<s.length?H+1:0,h=h<s.length?h+0.125:0},i)},E=(X="",H=0)=>{t=!1,clearInterval(c),w();let h=H===0?o.default.green(ss):H===1?o.default.red(Fs):o.default.red(us);r=U(X??r),l==="timer"?process.stdout.write(`${h} ${r} ${Y(e)}
76
+ `):process.stdout.write(`${h} ${r}
77
+ `),g(),f()};return{start:V,stop:E,message:(X="")=>{r=U(X??r)}}};var j=A(tl(),1);var T=A(tl(),1);import{join as nn}from"path";import{rmSync as fn}from"fs";import{tmpdir as cn}from"os";import{spawn as is}from"child_process";function ps(l){let s=l.match(/github\.com\/([^/]+)\/([^/]+)\/tree\/([^/]+)(?:\/(.+))?$/);if(s){let[,t,r,a,e]=s;return{type:"github",url:`https://github.com/${t}/${r}.git`,branch:a,subpath:e}}let i=l.match(/github\.com\/([^/]+)\/([^/]+)/);if(i){let[,t,r]=i,a=r.replace(/\.git$/,"");return{type:"github",url:`https://github.com/${t}/${a}.git`}}let n=l.match(/gitlab\.com\/([^/]+)\/([^/]+)\/-\/tree\/([^/]+)(?:\/(.+))?$/);if(n){let[,t,r,a,e]=n;return{type:"gitlab",url:`https://gitlab.com/${t}/${r}.git`,branch:a,subpath:e}}let f=l.match(/gitlab\.com\/([^/]+)\/([^/]+)/);if(f){let[,t,r]=f,a=r.replace(/\.git$/,"");return{type:"gitlab",url:`https://gitlab.com/${t}/${a}.git`}}let c=l.match(/^([^/]+)\/([^/]+)(?:\/(.+))?$/);if(c&&!l.includes(":")){let[,t,r,a]=c;return{type:"github",url:`https://github.com/${t}/${r}.git`,subpath:a}}return{type:"git",url:l}}async function Ul(l,s){let i=nn(cn(),`give-skill-${Date.now()}`),n=["clone","--depth","1"];if(s)n.push("--branch",s);return n.push(l,i),await new Promise((f,c)=>{let t=is("git",n,{stdio:"pipe"});t.on("close",(r)=>{if(r===0)f();else c(Error(`Failed to clone repository: ${l}`))}),t.on("error",c)}),i}async function Ds(l,s="main"){return await new Promise((n,f)=>{let c="",t=is("git",["ls-remote",l,`refs/heads/${s}`],{stdio:"pipe"});t.stdout?.on("data",(r)=>{c+=r.toString()}),t.on("close",(r)=>{if(r===0&&c.trim())n(c.trim().split(/\s+/)[0]??"");else f(Error(`Failed to get latest commit from ${l}`))}),t.on("error",f)})}async function Bl(l){return await new Promise((i,n)=>{let f="",c=is("git",["rev-parse","HEAD"],{cwd:l,stdio:"pipe"});c.stdout?.on("data",(t)=>{f+=t.toString()}),c.on("close",(t)=>{if(t===0&&f.trim())i(f.trim());else n(Error("Failed to get commit hash"))}),c.on("error",n)})}async function Nl(l){fn(l,{recursive:!0,force:!0})}import{readdir as st,readFile as en,stat as an}from"fs/promises";import{join as u,basename as kn,dirname as yn}from"path";import{homedir as rn}from"os";import{join as P}from"path";import{existsSync as Q}from"fs";var L=rn(),_={opencode:{name:"opencode",displayName:"OpenCode",skillsDir:".opencode/skill",globalSkillsDir:P(L,".config/opencode/skill"),detectInstalled:async()=>{return Q(P(L,".config/opencode"))}},"claude-code":{name:"claude-code",displayName:"Claude Code",skillsDir:".claude/skills",globalSkillsDir:P(L,".claude/skills"),detectInstalled:async()=>{return Q(P(L,".claude"))}},codex:{name:"codex",displayName:"Codex",skillsDir:".codex/skills",globalSkillsDir:P(L,".codex/skills"),detectInstalled:async()=>{return Q(P(L,".codex"))}},cursor:{name:"cursor",displayName:"Cursor",skillsDir:".cursor/skills",globalSkillsDir:P(L,".cursor/skills"),detectInstalled:async()=>{return Q(P(L,".cursor"))}},amp:{name:"amp",displayName:"Amp",skillsDir:".agents/skills",globalSkillsDir:P(L,".config/agents/skills"),detectInstalled:async()=>{return Q(P(L,".config/amp"))}},kilo:{name:"kilo",displayName:"Kilo Code",skillsDir:".kilocode/skills",globalSkillsDir:P(L,".kilocode/skills"),detectInstalled:async()=>{return Q(P(L,".kilocode"))}},roo:{name:"roo",displayName:"Roo Code",skillsDir:".roo/skills",globalSkillsDir:P(L,".roo/skills"),detectInstalled:async()=>{return Q(P(L,".roo"))}},goose:{name:"goose",displayName:"Goose",skillsDir:".goose/skills",globalSkillsDir:P(L,".config/goose/skills"),detectInstalled:async()=>{return Q(P(L,".config/goose"))}},antigravity:{name:"antigravity",displayName:"Antigravity",skillsDir:".agent/skills",globalSkillsDir:P(L,".gemini/antigravity/skills"),detectInstalled:async()=>{return Q(P(L,".gemini/antigravity"))}},copilot:{name:"copilot",displayName:"GitHub Copilot",skillsDir:".github/skills",globalSkillsDir:P(L,".copilot/skills"),detectInstalled:async()=>{return Q(P(L,".copilot"))}},gemini:{name:"gemini",displayName:"Gemini CLI",skillsDir:".gemini/skills",globalSkillsDir:P(L,".gemini/skills"),detectInstalled:async()=>{return Q(P(L,".gemini"))}},windsurf:{name:"windsurf",displayName:"Windsurf",skillsDir:".windsurf/skills",globalSkillsDir:P(L,".codeium/windsurf/skills"),detectInstalled:async()=>{return Q(P(L,".codeium/windsurf"))}},trae:{name:"trae",displayName:"Trae",skillsDir:".trae/skills",globalSkillsDir:P(L,".trae/skills"),detectInstalled:async()=>{return Q(P(L,".trae"))}},factory:{name:"factory",displayName:"Factory Droid",skillsDir:".factory/skills",globalSkillsDir:P(L,".factory/skills"),detectInstalled:async()=>{return Q(P(L,".factory"))}},letta:{name:"letta",displayName:"Letta",skillsDir:".skills",globalSkillsDir:P(L,".letta/skills"),detectInstalled:async()=>{return Q(P(L,".letta"))}}};async function lt(){let l=[];for(let[s,i]of Object.entries(_))if(await i.detectInstalled())l.push(s);return l}var Sn=["node_modules",".git","dist","build","__pycache__"],$n=["skills","skills/.curated","skills/.experimental","skills/.system"];function on(l){let s=[l];for(let n of $n)s.push(u(l,n));let i=new Set;for(let n of Object.values(_))i.add(u(l,n.skillsDir));return s.push(...i),s}function bn(l){let s=l.match(/^---\n([\s\S]+?)\n---\n([\s\S]*)$/);if(!s)return{data:{},content:l};let i=s[1],n=s[2],f={};for(let c of i.split(`
78
+ `)){let t=c.indexOf(":");if(t===-1)continue;let r=c.slice(0,t).trim(),a=c.slice(t+1).trim();if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))f[r]=a.slice(1,-1);else if(r==="metadata")try{let e={},k=a.replace(/^\{|\}$/g,"").trim();if(k){for(let b of k.split(",")){let[$,y]=b.split("=").map((g)=>g.trim());if($&&y)e[$]=y.replace(/^['"]|['"]$/g,"")}f[r]=JSON.stringify(e)}}catch{f[r]=a}else f[r]=a}return{data:f,content:n}}async function fs(l){try{let s=u(l,"SKILL.md");return(await an(s)).isFile()}catch{return!1}}async function ns(l){try{let s=await en(l,"utf-8"),{data:i}=bn(s);if(!i.name||!i.description)return null;return{name:i.name,description:i.description,path:yn(l),metadata:i.metadata?JSON.parse(i.metadata):void 0}}catch{return null}}async function tt(l,s=0,i=5){let n=[];if(s>i)return n;try{if(await fs(l))n.push(l);let f=await st(l,{withFileTypes:!0});for(let c of f)if(c.isDirectory()&&!Sn.includes(c.name)){let t=await tt(u(l,c.name),s+1,i);n.push(...t)}}catch{}return n}async function ql(l,s){let i=[],n=new Set,f=s?u(l,s):l;if(await fs(f)){let t=await ns(u(f,"SKILL.md"));if(t)return i.push(t),i}let c=on(f);for(let t of c)try{let r=await st(t,{withFileTypes:!0});for(let a of r)if(a.isDirectory()){let e=u(t,a.name);if(await fs(e)){let k=await ns(u(e,"SKILL.md"));if(k&&!n.has(k.name))i.push(k),n.add(k.name)}}}catch{}if(i.length===0){let t=await tt(f);for(let r of t){let a=await ns(u(r,"SKILL.md"));if(a&&!n.has(a.name))i.push(a),n.add(a.name)}}return i}function d(l){return l.name||kn(l.path)}import{mkdir as it,cp as gn,access as In,readdir as wn}from"fs/promises";import{join as m,basename as Rn}from"path";async function _l(l,s,i={}){let n=_[s],f=l.name||Rn(l.path),c=i.cwd||process.cwd(),t=i.global?n.globalSkillsDir:m(c,n.skillsDir),r=m(t,f);try{return await it(r,{recursive:!0}),await nt(l.path,r),{success:!0,path:r,originalPath:i.global?r:m(n.skillsDir,f)}}catch(a){return{success:!1,path:r,originalPath:i.global?r:m(n.skillsDir,f),error:a instanceof Error?a.message:"Unknown error"}}}var Tn=new Set(["README.md","metadata.json"]),Pn=(l)=>{if(Tn.has(l))return!0;if(l.startsWith("_"))return!0;return!1};async function nt(l,s){await it(s,{recursive:!0});let i=await wn(l,{withFileTypes:!0});for(let n of i){if(Pn(n.name))continue;let f=m(l,n.name),c=m(s,n.name);if(n.isDirectory())await nt(f,c);else await gn(f,c)}}async function ft(l,s,i={}){let n=_[s],f=i.global?n.globalSkillsDir:m(i.cwd||process.cwd(),n.skillsDir),c=m(f,l);try{return await In(c),!0}catch{return!1}}function ct(l,s,i={}){let n=_[s],f=i.global?n.globalSkillsDir:m(i.cwd||process.cwd(),n.skillsDir);return m(f,l)}import{homedir as Nn}from"os";import{join as rs}from"path";import{existsSync as et,readFileSync as qn,writeFileSync as at,mkdirSync as _n}from"fs";import{existsSync as Ln,readdirSync as Un}from"fs";import{resolve as Bn}from"path";var rt=A(tl(),1);function p(l){if(!Ln(l))return!1;try{let s=Un(l);if(s.length===0)return!1;return s.includes("SKILL.md")}catch{return!1}}function nl(l){return l.type==="global"?l.path:Bn(process.cwd(),l.path)}function Sl(){S.warn("No skills tracked. Install skills with:"),S.message(` ${rt.default.cyan("npx give-skill <repo>")}`)}var W=(l,s,i)=>{return l===1?s:i??`${s}s`};var cs=rs(Nn(),".give-skill"),Jl=rs(cs,"state.json");function kt(){if(!et(cs))_n(cs,{recursive:!0})}function $l(){if(kt(),!et(Jl)){let l={lastUpdate:new Date().toISOString(),skills:{}};return at(Jl,JSON.stringify(l,null,2)),l}try{let l=qn(Jl,"utf-8");return JSON.parse(l)}catch{return{lastUpdate:new Date().toISOString(),skills:{}}}}function jl(l){kt(),l.lastUpdate=new Date().toISOString(),at(Jl,JSON.stringify(l,null,2))}function yt(l,s,i,n,f,c){let t=$l(),r=l.toLowerCase(),a=!1,e;if(!t.skills[r])t.skills[r]={source:s,url:s,subpath:i,branch:n,commit:f,installedAt:new Date().toISOString(),installations:[]};else{if(t.skills[r].branch!==n)e=t.skills[r].branch,t.skills[r].branch=n,t.skills[r].commit=f,a=!0;if(t.skills[r].url=s,t.skills[r].source=s,i)t.skills[r].subpath=i}let k=t.skills[r].installations.findIndex((b)=>b.agent===c.agent&&b.path===c.path);if(k>=0)t.skills[r].installations[k]=c;else t.skills[r].installations.push(c);return jl(t),{updated:a,previousBranch:e}}function Yl(l,s,i){let n=$l(),f=l.toLowerCase();if(!n.skills[f])return;if(n.skills[f].installations=n.skills[f].installations.filter((c)=>!(c.agent===s&&c.path===i)),n.skills[f].installations.length===0)delete n.skills[f];jl(n)}function St(l,s){let i=$l(),n=l.toLowerCase();if(i.skills[n])i.skills[n].commit=s,jl(i)}function rl(){return $l()}async function $t(){let l=$l(),s=[];for(let[i,n]of Object.entries(l.skills)){let f=[];for(let c of n.installations)try{let t=c.type==="global"?c.path:rs(process.cwd(),c.path);if(p(t))f.push(c)}catch{}if(f.length===0)s.push(i);else if(f.length!==n.installations.length)n.installations=f}for(let i of s)delete l.skills[i];if(s.length>0)jl(l)}async function ot(l,s){let i={tempDir:null,spinner:sl()};try{i.spinner.start("Parsing source...");let n=ps(l),f=n.branch??"main";i.spinner.stop(`Source: ${T.default.cyan(n.url)}${n.subpath?` (${n.subpath})`:""}${n.branch?` @ ${T.default.cyan(n.branch)}`:""}`),i.spinner.start("Cloning repository..."),i.tempDir=await Ul(n.url,n.branch),i.spinner.stop("Repository cloned");let c=await Bl(i.tempDir);i.spinner.start("Discovering skills...");let t=await ql(i.tempDir,n.subpath);if(t.length===0)return i.spinner.stop(T.default.red("No skills found")),G(T.default.red("No valid skills found. Skills require a SKILL.md with name and description.")),{success:!1,installed:0,failed:0,results:[]};if(i.spinner.stop(`Found ${T.default.green(t.length)} skill${t.length>1?"s":""}`),s.list){S.step(T.default.bold("Available Skills"));for(let $ of t)S.message(` ${T.default.cyan(d($))}`),S.message(` ${T.default.dim($.description)}`);return G("Use --skill <name> to install specific skills"),{success:!0,installed:0,failed:0,results:[]}}let r=await Jn(t,s);if(!r)return{success:!1,installed:0,failed:0,results:[]};let a=await jn(s,i);if(!a)return{success:!1,installed:0,failed:0,results:[]};let e=await Yn(s);if(e===null)return{success:!1,installed:0,failed:0,results:[]};if(!await Gn(s,r,a,e))return{success:!1,installed:0,failed:0,results:[]};i.spinner.start("Installing skills...");let b=await Xn(r,a,e,n,c,f);return i.spinner.stop("Installation complete"),b}finally{if(i.tempDir)await Nl(i.tempDir)}}async function Jn(l,s){let i;if(s.skill&&s.skill.length>0){if(i=l.filter((n)=>s.skill.some((f)=>n.name.toLowerCase()===f.toLowerCase()||d(n).toLowerCase()===f.toLowerCase())),i.length===0){S.error(`No matching skills found for: ${s.skill.join(", ")}`),S.info("Available skills:");for(let n of l)S.message(` - ${d(n)}`);return null}S.info(`Selected ${i.length} skill${i.length!==1?"s":""}: ${i.map((n)=>T.default.cyan(d(n))).join(", ")}`)}else if(l.length===1){i=l;let n=l[0];S.info(`Skill: ${T.default.cyan(d(n))}`),S.message(T.default.dim(n.description))}else if(s.yes)i=l,S.info(`Installing all ${l.length} skills`);else{let n=l.map((c)=>({value:c,label:d(c),hint:c.description.length>60?c.description.slice(0,57)+"...":c.description})),f=await F({message:"Select skills to install",options:n,required:!0});if(M(f))return x("Installation cancelled"),null;i=f}return i}async function jn(l,s){if(l.agent&&l.agent.length>0){let n=Object.keys(_),f=l.agent.filter((c)=>!n.includes(c));if(f.length>0)return S.error(`Invalid agents: ${f.join(", ")}`),S.info(`Valid agents: ${n.join(", ")}`),null;return l.agent}s.spinner.start("Detecting installed agents...");let i=await lt();if(s.spinner.stop(`Detected ${i.length} agent${i.length!==1?"s":""}`),i.length===0)if(l.yes){let n=Object.keys(_);return S.info("Installing to all agents (none detected)"),n}else{S.warn("No coding agents detected. You can still install skills.");let n=Object.entries(_).map(([c,t])=>({value:c,label:t.displayName})),f=await F({message:"Select agents to install skills to",options:n,required:!0});if(M(f))return x("Installation cancelled"),null;return f}else if(i.length===1||l.yes){if(i.length===1){let n=i[0];S.info(`Installing to: ${T.default.cyan(_[n].displayName)}`)}else S.info(`Installing to: ${i.map((n)=>T.default.cyan(_[n].displayName)).join(", ")}`);return i}else{let n=i.map((c)=>({value:c,label:_[c].displayName,hint:_[c].skillsDir})),f=await F({message:"Select agents to install skills to",options:n,required:!0,initialValues:i});if(M(f))return x("Installation cancelled"),null;return f}}async function Yn(l){let s=l.global??!1;if(l.global===void 0&&!l.yes){let i=await ds({message:"Installation scope",options:[{value:!1,label:"Project",hint:"Install in current directory (committed with your project)"},{value:!0,label:"Global",hint:"Install in home directory (available across all projects)"}]});if(M(i))return x("Installation cancelled"),null;s=i}return s}async function Gn(l,s,i,n){S.step(T.default.bold("Installation Summary"));for(let f of s){S.message(` ${T.default.cyan(d(f))}`);for(let c of i){let t=ct(f.name,c,{global:n}),a=await ft(f.name,c,{global:n})?T.default.yellow(" (will overwrite)"):"";S.message(` ${T.default.dim("→")} ${_[c].displayName}: ${T.default.dim(t)}${a}`)}}if(!l.yes){let f=await cl({message:"Proceed with installation?"});if(M(f)||!f)return x("Installation cancelled"),!1}return!0}async function Xn(l,s,i,n,f,c){let t=l.flatMap(($)=>s.map((y)=>_l($,y,{global:i}))),r=await Promise.all(t),a=r.map(($,y)=>{let g=Math.floor(y/s.length),w=y%s.length,U=l[g],Y=s[w];return{skill:d(U),agent:_[Y].displayName,...$}}),e=new Map;for(let[$,y]of r.entries())if(y.success){let g=Math.floor($/s.length),w=$%s.length,U=l[g],Y=s[w],V=yt(U.name,n.url,n.subpath,c,f,{agent:Y,type:i?"global":"project",path:y.originalPath});if(V.updated&&V.previousBranch){let E=e.get(U.name);e.set(U.name,{previous:E?.previous??V.previousBranch,current:E?.current??c})}}let k=a.filter(($)=>$.success),b=a.filter(($)=>!$.success);if(e.size>0)for(let[$,{previous:y,current:g}]of e)S.warn(T.default.yellow(` ${T.default.cyan($)}: ${T.default.dim(y)} → ${T.default.green(g)}`));if(k.length>0){S.success(T.default.green(`Successfully installed ${k.length} skill${k.length!==1?"s":""}`));for(let $ of k)S.message(` ${T.default.green("✓")} ${$.skill} → ${$.agent}`),S.message(` ${T.default.dim($.path)}`)}if(b.length>0){S.error(T.default.red(`Failed to install ${b.length} skill${b.length!==1?"s":""}`));for(let $ of b)S.message(` ${T.default.red("✗")} ${$.skill} → ${$.agent}`),S.message(` ${T.default.dim($.error)}`)}return G(T.default.green("Done!")),{success:b.length===0,installed:k.length,failed:b.length,results:a}}var I=A(tl(),1);import{join as zn}from"path";async function bt(l,s){let i=s.installations.map((f)=>{let c=nl(f);return{agent:_[f.agent].displayName,path:c,exists:p(c)}});if(i.filter((f)=>f.exists).length===0)return{skillName:l,currentCommit:s.commit,latestCommit:s.commit,status:"orphaned",installations:i};try{let f=await Ds(s.url,s.branch),c=f===s.commit;return{skillName:l,currentCommit:s.commit,latestCommit:f,status:c?"latest":"update-available",installations:i}}catch(f){return{skillName:l,currentCommit:s.commit,latestCommit:s.commit,status:"error",installations:i,error:f instanceof Error?f.message:"Unknown error"}}}async function es(l){let s=rl(),i=[],n=Object.entries(s.skills).map(([t,r])=>({skillName:t,state:r})),f;if(l&&l.length>0){let t=new Set(l.map((r)=>r.toLowerCase()));f=n.filter(({skillName:r})=>t.has(r.toLowerCase()))}else f=n;if(f.length===0)return[];let c=sl();if(f.length===1){let{skillName:t,state:r}=f[0];c.start(`Checking ${I.default.cyan(t)}...`);let a=await bt(t,r);c.stop(a.status==="latest"?I.default.green("Up to date"):I.default.yellow("Update available")),i.push(a)}else{c.start(`Checking ${f.length} ${W(f.length,"skill")}...`);for(let{skillName:t,state:r}of f){let a=await bt(t,r);i.push(a)}c.stop("Check complete")}return i}async function gt(l,s={}){let i=rl(),n=[],f=Object.entries(i.skills).map(([y,g])=>({skillName:y,state:g})),c;if(l&&l.length>0){let y=new Set(l.map((g)=>g.toLowerCase()));c=f.filter(({skillName:g})=>y.has(g.toLowerCase()))}else c=f;if(c.length===0)return S.warn("No skills found to update"),[];let t=await es(l),r=t.filter((y)=>y.status==="update-available");if(r.length===0){let y=t.filter((g)=>g.status==="orphaned");if(y.length>0){S.warn(`${y.length} skill${y.length>1?"s":""} have no valid installations`);for(let g of y)S.message(` ${I.default.yellow("○")} ${I.default.cyan(g.skillName)} - all installations removed`)}return S.success(I.default.green("All skills are up to date")),[]}S.step(I.default.bold("Updates Available"));let a=r.map((y)=>({value:y.skillName,label:y.skillName,hint:`${y.currentCommit.slice(0,7)} → ${y.latestCommit.slice(0,7)}`})),e;if(s.yes)e=r.map((y)=>y.skillName);else{let y=await F({message:"Select skills to update",options:a,required:!0,initialValues:r.map((g)=>g.skillName)});if(M(y))return x("Update cancelled"),[];e=y}S.step(I.default.bold("Will Update"));for(let y of e){let g=r.find((w)=>w.skillName===y);if(g)S.message(` ${I.default.cyan(g.skillName)}`),S.message(` ${I.default.dim("Current:")} ${I.default.yellow(g.currentCommit.slice(0,7))} ${I.default.dim("→")} ${I.default.green(g.latestCommit.slice(0,7))}`)}if(!s.yes){let y=await cl({message:"Proceed with update?"});if(M(y)||!y)return x("Update cancelled"),[]}let k=sl();k.start(`Updating ${e.length} ${W(e.length,"skill")}...`);for(let{skillName:y,state:g}of c){let w=t.find((E)=>E.skillName===y);if(!w||w.status!=="update-available"){if(w?.status==="latest")n.push({skillName:y,success:!0,updated:0,failed:0});else n.push({skillName:y,success:!1,updated:0,failed:0});continue}if(!e.includes(y))continue;let U=null,Y=0,V=0;try{U=await Ul(g.url);let E=await Bl(U),X=g.subpath?zn(U,g.subpath):U,h=(await ql(X)).find((Z)=>Z.name.toLowerCase()===y.toLowerCase());if(!h)throw Error("Skill not found in repository");for(let Z of g.installations){let Gl=nl(Z);if(!p(Gl)){Yl(y,Z.agent,Z.path);continue}if((await _l(h,Z.agent,{global:Z.type==="global"})).success)Y++;else V++}St(y,E),n.push({skillName:y,success:V===0,updated:Y,failed:V})}catch(E){n.push({skillName:y,success:!1,updated:Y,failed:V+1,error:E instanceof Error?E.message:"Unknown error"})}finally{if(U)await Nl(U)}}k.stop("Update complete");let b=n.filter((y)=>y.success&&y.updated>0),$=n.filter((y)=>!y.success||y.failed>0);if(b.length>0){S.success(I.default.green(`Updated ${b.length} ${W(b.length,"skill")}`));for(let y of b)S.message(` ${I.default.green("✓")} ${I.default.cyan(y.skillName)} (${y.updated} ${W(y.updated,"installation")})`)}if($.length>0){S.error(I.default.red(`Failed to update ${$.length} ${W($.length,"skill")}`));for(let y of $)if(S.message(` ${I.default.red("✗")} ${I.default.cyan(y.skillName)}`),y.error)S.message(` ${I.default.dim(y.error)}`)}if(b.length>0)G(I.default.green("Done!"));else G(I.default.yellow("No skills were updated"));return n}async function It(l,s=!1){if(l.length===0){Sl();return}S.step(I.default.bold("Skills Status"));for(let i of l){let n={latest:I.default.green("✓"),"update-available":I.default.yellow("↓"),error:I.default.red("✗"),orphaned:I.default.dim("○")}[i.status],f={latest:I.default.green("latest"),"update-available":I.default.yellow("update available"),error:I.default.red("error"),orphaned:I.default.dim("orphaned")}[i.status],c=i.installations.filter((r)=>r.exists),t=i.installations.filter((r)=>!r.exists);if(!s){let r=c.length,a=r>0?` (${r} ${W(r,"installation")})`:"";S.message(`${n} ${I.default.cyan(i.skillName)}${I.default.dim(a)} - ${f}`)}else{if(S.message(`${n} ${I.default.cyan(i.skillName)}`),S.message(` Status: ${f}`),i.status==="update-available")S.message(` ${I.default.dim("Commit:")} ${I.default.yellow(i.currentCommit.slice(0,7))} ${I.default.dim("→")} ${I.default.green(i.latestCommit.slice(0,7))}`);else if(i.status==="latest")S.message(` ${I.default.dim("Commit:")} ${i.currentCommit.slice(0,7)}`);if(i.error)S.message(` ${I.default.red(i.error)}`);if(c.length>0){S.message(` ${I.default.dim("Installed in:")}`);for(let r of c)S.message(` ${I.default.dim("•")} ${r.agent}: ${I.default.dim(r.path)}`)}if(t.length>0){S.message(` ${I.default.yellow("Missing installations:")}`);for(let r of t)S.message(` ${I.default.dim("•")} ${r.agent}: ${I.default.dim(r.path)}`)}}}if(!s)S.info(`Use ${I.default.cyan("--verbose")} or ${I.default.cyan("-v")} for detailed information`)}async function wt(){let l=sl();l.start("Checking for orphaned entries..."),await $t(),l.stop(I.default.green("Cleaned up orphaned entries"))}var q=A(tl(),1);import{existsSync as Mn,rmSync as Qn}from"fs";async function Zn(l){try{if(Mn(l))Qn(l,{recursive:!0,force:!0});return{success:!0}}catch(s){return{success:!1,error:s instanceof Error?s.message:"Unknown error"}}}async function Rt(l=[],s={}){let i=rl(),n=[];if(Object.keys(i.skills).length===0)return Sl(),[];let f=Object.entries(i.skills).map(([$,y])=>({skillName:$,state:y})),c;if(l.length>0){let $=new Set(l.map((y)=>y.toLowerCase()));c=f.filter(({skillName:y})=>$.has(y.toLowerCase()))}else{let y=f.map(({skillName:g,state:w})=>{let U=w.installations.map((Y)=>({installation:Y,resolvedPath:nl(Y)})).filter(({resolvedPath:Y})=>p(Y));return{value:g,label:g,hint:U.length>0?`${U.length} ${W(U.length,"installation")}`:"no valid installations"}}).filter((g)=>g.hint!=="no valid installations");if(y.length===0)return S.warn("No valid installations found"),[];if(s.yes)c=f.filter(({skillName:g})=>y.some((w)=>w.value===g));else{let g=await F({message:"Select skills to remove",options:y,required:!0,initialValues:y.map((U)=>U.value)});if(M(g))return x("Remove cancelled"),[];let w=g;c=f.filter(({skillName:U})=>w.includes(U))}}if(c.length===0){if(l.length>0){S.error(`No matching skills found for: ${l.join(", ")}`),S.info("Tracked skills:");for(let $ of f)S.message(` - ${q.default.cyan($.skillName)}`)}return[]}S.step(q.default.bold("Skills to Remove"));let t=[];for(let{skillName:$,state:y}of c){let g=y.installations.map((w)=>({installation:w,resolvedPath:nl(w)})).filter(({resolvedPath:w})=>p(w));if(g.length>0){t.push({skillName:$,installations:g}),S.message(` ${q.default.cyan($)}`);for(let{resolvedPath:w}of g)S.message(` ${q.default.dim("→")} ${w}`)}}if(t.length===0)return S.warn("No installations match the specified criteria"),[];let r=l.length===0,a;if(s.yes||r)a=t.map(({skillName:$})=>$);else{let $=t.map(({skillName:g,installations:w})=>({value:g,label:g,hint:`${w.length} ${W(w.length,"installation")}`})),y=await F({message:"Select skills to remove",options:$,required:!0,initialValues:t.map(({skillName:g})=>g)});if(M(y))return x("Remove cancelled"),[];a=y}S.step(q.default.bold("Will Remove"));for(let $ of a){let y=t.find((g)=>g.skillName===$);if(y){S.message(` ${q.default.cyan(y.skillName)}`);for(let{resolvedPath:g}of y.installations)S.message(` ${q.default.dim("→")} ${g}`)}}if(!s.yes){let $=await cl({message:"Remove these skills?"});if(M($)||!$)return x("Remove cancelled"),[]}let e=sl();e.start(`Removing ${a.length} skill${a.length>1?"s":""}...`);for(let{skillName:$,installations:y}of t){if(!a.includes($))continue;let g={skillName:$,success:!0,removed:0,failed:0,installations:[]};for(let{installation:w,resolvedPath:U}of y){let Y=await Zn(U);if(g.installations.push({agent:_[w.agent].displayName,path:U,removed:Y.success,error:Y.error}),Y.success)g.removed++,Yl($,w.agent,w.path);else g.failed++,g.success=!1}n.push(g)}e.stop("Remove complete");let k=n.filter(($)=>$.success&&$.removed>0),b=n.filter(($)=>!$.success||$.failed>0);if(k.length>0){S.success(q.default.green(`Removed ${k.length} ${W(k.length,"skill")}`));for(let $ of k)S.message(` ${q.default.green("✓")} ${q.default.cyan($.skillName)}`),S.message(` ${q.default.dim(`${$.removed} ${W($.removed,"installation")} removed`)}`)}if(b.length>0){S.error(q.default.red(`Failed to remove ${b.length} ${W(b.length,"skill")}`));for(let $ of b){S.message(` ${q.default.red("✗")} ${q.default.cyan($.skillName)}`);for(let y of $.installations.filter((g)=>!g.removed))if(y.error)S.message(` ${q.default.dim(y.error)}`)}}return G(q.default.green("Done!")),n}async function Tt(){let l=rl();if(Object.keys(l.skills).length===0){Sl();return}S.step(q.default.bold("Installed Skills"));for(let[s,i]of Object.entries(l.skills)){S.message(`${q.default.cyan(s)}`);let n=i.installations.map((f)=>({installation:f,resolvedPath:nl(f)})).filter(({resolvedPath:f})=>p(f));if(n.length>0){S.message(` ${q.default.dim("Installed in:")}`);for(let{installation:f,resolvedPath:c}of n){let t=f.type==="global"?"global":"project";S.message(` ${q.default.dim("•")} ${_[f.agent].displayName} ${q.default.dim(`(${t})`)}: ${q.default.dim(c)}`)}}}}var Pt={name:"give-skill",version:"1.1.1",description:"Universal skill installer for AI coding agents - Claude, Cursor, Copilot, and more",type:"module",bin:{"give-skill":"./dist/index.js"},files:["dist","README.md"],scripts:{build:"bun build src/index.ts --outdir dist --target node --minify",dev:"bun src/index.ts",prepublishOnly:"bun run build"},keywords:["cli","skills","claude","cursor","copilot","github-copilot","ai-agents","agent-skills","coding-assistant"],repository:{type:"git",url:"git+https://github.com/compilecafe/give-skill.git"},homepage:"https://github.com/compilecafe/give-skill#readme",bugs:{url:"https://github.com/compilecafe/give-skill/issues"},author:"Compile Café",license:"MIT",dependencies:{"@clack/prompts":"^0.11.0",commander:"^14.0.2",picocolors:"^1.1.1"},devDependencies:{"@types/bun":"latest"},module:"src/index.ts"};var hn=Pt.version;D.name("give-skill").description("Install skills onto coding agents (Claude Code, Cursor, Copilot, Gemini, Windsurf, Trae, Factory, Letta, OpenCode, Codex, Antigravity, Amp, Kilo, Roo, Goose)").version(hn).argument("<source>","Git repo URL, GitHub shorthand (owner/repo), or direct path to skill").option("-g, --global","Install skill globally (user-level) instead of project-level").option("-a, --agent <agents...>","Specify agents to install to (windsurf, gemini, claude-code, cursor, copilot, etc.)").option("-s, --skill <skills...>","Specify skill names to install (skip selection prompt)").option("-l, --list","List available skills in the repository without installing").option("-y, --yes","Skip confirmation prompts").action(async(l,s)=>{await Kn(l,s)});D.command("update [skills...]").description("Update installed skills to their latest versions").option("-y, --yes","Skip confirmation prompts").action(async(l,s)=>{await xn(l,s)});D.command("status [skills...]").description("Check status of installed skills (updates available, orphaned, etc.)").option("-v, --verbose","Show detailed information including installation paths").action(async(l,s)=>{await Wn(l,s)});D.command("remove [skills...]").description("Remove installed skills").option("-y, --yes","Skip confirmation prompts").action(async(l,s)=>{await En(l,s)});D.command("list").description("List all installed skills").action(async()=>{await Cn()});D.command("clean").description("Remove orphaned skill entries from state").action(async()=>{await Vn()});D.parse();async function Kn(l,s){il(j.default.bgCyan(j.default.black(" give-skill ")));try{let i=await ot(l,s);if(!i.success&&i.installed===0&&i.failed===0)process.exit(1);if(i.failed>0)process.exit(1)}catch(i){S.error(i instanceof Error?i.message:"Unknown error occurred"),G(j.default.red("Installation failed")),process.exit(1)}}async function xn(l,s){il(j.default.bgCyan(j.default.black(" give-skill ")));try{await gt(l.length>0?l:void 0,s)}catch(i){S.error(i instanceof Error?i.message:"Unknown error occurred"),G(j.default.red("Update failed")),process.exit(1)}}async function Wn(l,s={}){il(j.default.bgCyan(j.default.black(" give-skill ")));try{let i=await es(l.length>0?l:void 0),n=s.verbose||l.length>0;await It(i,n),G("Done!")}catch(i){S.error(i instanceof Error?i.message:"Unknown error occurred"),G(j.default.red("Status check failed")),process.exit(1)}}async function En(l,s){il(j.default.bgCyan(j.default.black(" give-skill ")));try{await Rt(l,s)}catch(i){S.error(i instanceof Error?i.message:"Unknown error occurred"),G(j.default.red("Remove failed")),process.exit(1)}}async function Cn(){il(j.default.bgCyan(j.default.black(" give-skill ")));try{await Tt(),G("Done!")}catch(l){S.error(l instanceof Error?l.message:"Unknown error occurred"),G(j.default.red("List failed")),process.exit(1)}}async function Vn(){il(j.default.bgCyan(j.default.black(" give-skill ")));try{await wt(),G(j.default.green("Done!"))}catch(l){S.error(l instanceof Error?l.message:"Unknown error occurred"),G(j.default.red("Clean failed")),process.exit(1)}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "give-skill",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Universal skill installer for AI coding agents - Claude, Cursor, Copilot, and more",
5
5
  "type": "module",
6
6
  "bin": {