give-skill 1.0.2 → 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.
- package/README.md +165 -54
- package/dist/index.js +68 -68
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -76,26 +76,100 @@ npx give-skill expo/skills --global
|
|
|
76
76
|
npx give-skill expo/skills --list
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
+
## Managing Skills
|
|
80
|
+
|
|
81
|
+
`give-skill` tracks installed skills and makes it easy to manage them.
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# List all installed skills
|
|
85
|
+
npx give-skill list
|
|
86
|
+
|
|
87
|
+
# Check status of all installed skills (compact view)
|
|
88
|
+
npx give-skill status
|
|
89
|
+
|
|
90
|
+
# Check status with detailed information
|
|
91
|
+
npx give-skill status --verbose
|
|
92
|
+
|
|
93
|
+
# Check status of specific skills (automatically shows details)
|
|
94
|
+
npx give-skill status pr-reviewer test-generator
|
|
95
|
+
|
|
96
|
+
# Update all skills with available updates (interactive selection)
|
|
97
|
+
npx give-skill update
|
|
98
|
+
|
|
99
|
+
# Update specific skills
|
|
100
|
+
npx give-skill update pr-reviewer test-generator
|
|
101
|
+
|
|
102
|
+
# Update without confirmation (auto-selects all with updates)
|
|
103
|
+
npx give-skill update -y
|
|
104
|
+
|
|
105
|
+
# Remove specific skills
|
|
106
|
+
npx give-skill remove pr-reviewer
|
|
107
|
+
|
|
108
|
+
# Remove without confirmation (auto-selects all)
|
|
109
|
+
npx give-skill remove -y
|
|
110
|
+
|
|
111
|
+
# Interactive removal (shows multiselect of all installed skills)
|
|
112
|
+
npx give-skill remove
|
|
113
|
+
|
|
114
|
+
# Clean up orphaned entries
|
|
115
|
+
npx give-skill clean
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Status Indicators
|
|
119
|
+
|
|
120
|
+
The `status` command shows one of the following states for each skill:
|
|
121
|
+
|
|
122
|
+
| Icon | Status | Description |
|
|
123
|
+
| ---- | ------ | ----------- |
|
|
124
|
+
| ✓ | `latest` | Skill is up to date with the remote repository |
|
|
125
|
+
| ↓ | `update-available` | A newer version is available |
|
|
126
|
+
| ✗ | `error` | Failed to check for updates (network issues, repo deleted, etc.) |
|
|
127
|
+
| ○ | `orphaned` | No valid installations found (folders were manually deleted) |
|
|
128
|
+
|
|
79
129
|
## Command Reference
|
|
80
130
|
|
|
81
131
|
```
|
|
82
132
|
give-skill <source> [options]
|
|
83
133
|
|
|
84
134
|
Arguments:
|
|
85
|
-
source Git repo URL
|
|
135
|
+
source Git repo URL, GitHub shorthand (owner/repo), or direct path to skill
|
|
86
136
|
|
|
87
137
|
Options:
|
|
88
|
-
-g, --global Install
|
|
89
|
-
-a, --agent <...>
|
|
90
|
-
-s, --skill <...>
|
|
91
|
-
-l, --list List skills without installing
|
|
138
|
+
-g, --global Install skill globally (user-level) instead of project-level
|
|
139
|
+
-a, --agent <...> Specify agents to install to (windsurf, gemini, claude-code, cursor, copilot, etc.)
|
|
140
|
+
-s, --skill <...> Specify skill names to install (skip selection prompt)
|
|
141
|
+
-l, --list List available skills in the repository without installing
|
|
92
142
|
-y, --yes Skip all prompts (CI-friendly)
|
|
93
143
|
-V, --version Show version
|
|
94
144
|
-h, --help Show help
|
|
145
|
+
|
|
146
|
+
Commands:
|
|
147
|
+
update [skills...] Update installed skills to their latest versions
|
|
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)
|
|
150
|
+
list List all installed skills
|
|
151
|
+
clean Remove orphaned skill entries from state
|
|
95
152
|
```
|
|
96
153
|
|
|
97
154
|
## Examples
|
|
98
155
|
|
|
156
|
+
### Install from specific branch
|
|
157
|
+
|
|
158
|
+
By default, `give-skill` uses the repository's default branch. To install from a specific branch, use the full GitHub URL with the branch:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
# Install from develop branch
|
|
162
|
+
npx give-skill https://github.com/org/repo/tree/develop
|
|
163
|
+
|
|
164
|
+
# Install from develop branch with subpath
|
|
165
|
+
npx give-skill https://github.com/org/repo/tree/develop/skills/custom
|
|
166
|
+
|
|
167
|
+
# Install from a feature branch
|
|
168
|
+
npx give-skill https://github.com/org/repo/tree/feature/new-skill
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
The branch is saved in the state file, so future updates will continue using the same branch.
|
|
172
|
+
|
|
99
173
|
### Install specific skills
|
|
100
174
|
|
|
101
175
|
```bash
|
|
@@ -114,53 +188,25 @@ npx give-skill expo/skills -a claude-code -a copilot -a cursor
|
|
|
114
188
|
npx give-skill expo/skills -s pr-reviewer -g -a copilot -y
|
|
115
189
|
```
|
|
116
190
|
|
|
117
|
-
### Install from subdirectory
|
|
118
|
-
|
|
119
|
-
```bash
|
|
120
|
-
npx give-skill https://github.com/org/repo/tree/main/skills/custom
|
|
121
|
-
```
|
|
122
|
-
|
|
123
191
|
## Where Skills Go
|
|
124
192
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
|
128
|
-
|
|
|
129
|
-
|
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
|
133
|
-
|
|
|
134
|
-
|
|
|
135
|
-
|
|
|
136
|
-
|
|
|
137
|
-
|
|
|
138
|
-
|
|
|
139
|
-
|
|
|
140
|
-
|
|
|
141
|
-
|
|
|
142
|
-
| Roo Code | `.roo/skills/<name>/` |
|
|
143
|
-
| Goose | `.goose/skills/<name>/` |
|
|
144
|
-
|
|
145
|
-
### Global Level (`--global`)
|
|
146
|
-
|
|
147
|
-
| Agent | Path |
|
|
148
|
-
| ------------- | -------------------------------------- |
|
|
149
|
-
| Claude Code | `~/.claude/skills/<name>/` |
|
|
150
|
-
| Cursor | `~/.cursor/skills/<name>/` |
|
|
151
|
-
| Copilot | `~/.copilot/skills/<name>/` |
|
|
152
|
-
| Gemini CLI | `~/.gemini/skills/<name>/` |
|
|
153
|
-
| Windsurf | `~/.codeium/windsurf/skills/<name>/` |
|
|
154
|
-
| Trae | Project-level only (SOLO mode) |
|
|
155
|
-
| Factory Droid | `~/.factory/skills/<name>/` |
|
|
156
|
-
| Letta | `~/.letta/skills/<name>/` |
|
|
157
|
-
| OpenCode | `~/.config/opencode/skill/<name>/` |
|
|
158
|
-
| Codex | `~/.codex/skills/<name>/` |
|
|
159
|
-
| Antigravity | `~/.gemini/antigravity/skills/<name>/` |
|
|
160
|
-
| Amp | `~/.config/agents/skills/<name>/` |
|
|
161
|
-
| Kilo Code | `~/.kilocode/skills/<name>/` |
|
|
162
|
-
| Roo Code | `~/.roo/skills/<name>/` |
|
|
163
|
-
| Goose | `~/.config/goose/skills/<name>/` |
|
|
193
|
+
| Agent | Project Level | Global Level (`--global`) |
|
|
194
|
+
| ------------- | ------------------------------------ | ------------------------------------------- |
|
|
195
|
+
| Claude Code | `.claude/skills/<name>/` | `~/.claude/skills/<name>/` |
|
|
196
|
+
| Cursor | `.cursor/skills/<name>/` | `~/.cursor/skills/<name>/` |
|
|
197
|
+
| Copilot | `.github/skills/<name>/` | `~/.copilot/skills/<name>/` |
|
|
198
|
+
| Gemini CLI | `.gemini/skills/<name>/` | `~/.gemini/skills/<name>/` |
|
|
199
|
+
| Windsurf | `.windsurf/skills/<name>/` | `~/.codeium/windsurf/skills/<name>/` |
|
|
200
|
+
| Trae | `.trae/skills/<name>/` | Project-level only (SOLO mode) |
|
|
201
|
+
| Factory Droid | `.factory/skills/<name>/` | `~/.factory/skills/<name>/` |
|
|
202
|
+
| Letta | `.skills/<name>/` | `~/.letta/skills/<name>/` |
|
|
203
|
+
| OpenCode | `.opencode/skill/<name>/` | `~/.config/opencode/skill/<name>/` |
|
|
204
|
+
| Codex | `.codex/skills/<name>/` | `~/.codex/skills/<name>/` |
|
|
205
|
+
| Antigravity | `.agent/skills/<name>/` | `~/.gemini/antigravity/skills/<name>/` |
|
|
206
|
+
| Amp | `.agents/skills/<name>/` | `~/.config/agents/skills/<name>/` |
|
|
207
|
+
| Kilo Code | `.kilocode/skills/<name>/` | `~/.kilocode/skills/<name>/` |
|
|
208
|
+
| Roo Code | `.roo/skills/<name>/` | `~/.roo/skills/<name>/` |
|
|
209
|
+
| Goose | `.goose/skills/<name>/` | `~/.config/goose/skills/<name>/` |
|
|
164
210
|
|
|
165
211
|
## Creating Skills
|
|
166
212
|
|
|
@@ -234,10 +280,51 @@ If a folder matches an agent's skill directory, the CLI will find it.
|
|
|
234
280
|
└──────────────┘
|
|
235
281
|
```
|
|
236
282
|
|
|
237
|
-
1. **Clone** the source repository
|
|
238
|
-
2. **Discover** all `SKILL.md` files
|
|
239
|
-
3. **Detect** installed agents on your system
|
|
283
|
+
1. **Clone** the source repository (supports specific branches and subpaths)
|
|
284
|
+
2. **Discover** all `SKILL.md` files in common and agent-specific directories
|
|
285
|
+
3. **Detect** installed agents on your system automatically
|
|
240
286
|
4. **Install** skills to agent-specific directories
|
|
287
|
+
5. **Track** installation state for future updates and management
|
|
288
|
+
|
|
289
|
+
## State Management
|
|
290
|
+
|
|
291
|
+
`give-skill` stores installation state in `~/.give-skill/state.json`. This enables:
|
|
292
|
+
|
|
293
|
+
- **Update tracking**: Know when skills have updates available
|
|
294
|
+
- **Source tracking**: Remember where each skill came from
|
|
295
|
+
- **Batch operations**: Update all skills without re-specifying sources
|
|
296
|
+
- **Branch tracking**: Remember which branch was used for installation
|
|
297
|
+
|
|
298
|
+
**Important**: State tracking only works for skills installed via `give-skill`. Manually installed skills are not tracked.
|
|
299
|
+
|
|
300
|
+
The state file contains:
|
|
301
|
+
|
|
302
|
+
```json
|
|
303
|
+
{
|
|
304
|
+
"lastUpdate": "2025-01-16T10:00:00Z",
|
|
305
|
+
"skills": {
|
|
306
|
+
"pr-reviewer": {
|
|
307
|
+
"source": "https://github.com/expo/skills.git",
|
|
308
|
+
"url": "https://github.com/expo/skills.git",
|
|
309
|
+
"branch": "main",
|
|
310
|
+
"commit": "abc123...",
|
|
311
|
+
"subpath": "skills/.curated",
|
|
312
|
+
"installedAt": "2025-01-15T10:00:00Z",
|
|
313
|
+
"installations": [
|
|
314
|
+
{
|
|
315
|
+
"agent": "claude-code",
|
|
316
|
+
"type": "global",
|
|
317
|
+
"path": "~/.claude/skills/pr-reviewer"
|
|
318
|
+
}
|
|
319
|
+
]
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
Skills are stored by name (lowercased). If you install a skill with the same name from a different source, it will overwrite the existing entry after confirmation.
|
|
326
|
+
|
|
327
|
+
If you manually delete skill folders, run `npx give-skill clean` to remove orphaned entries.
|
|
241
328
|
|
|
242
329
|
## Troubleshooting
|
|
243
330
|
|
|
@@ -258,7 +345,31 @@ Check you have write permissions for the target directory.
|
|
|
258
345
|
|
|
259
346
|
### Agent not detected
|
|
260
347
|
|
|
261
|
-
The CLI
|
|
348
|
+
The CLI automatically detects installed agents by checking their default directories. To see which agents are detected, run a command and review the agent selection prompt. Manually specify with `-a` if needed.
|
|
349
|
+
|
|
350
|
+
### Source URL formats
|
|
351
|
+
|
|
352
|
+
`give-skill` supports multiple source formats:
|
|
353
|
+
|
|
354
|
+
```bash
|
|
355
|
+
# GitHub shorthand
|
|
356
|
+
npx give-skill expo/skills
|
|
357
|
+
|
|
358
|
+
# Full GitHub URL
|
|
359
|
+
npx give-skill https://github.com/expo/skills
|
|
360
|
+
|
|
361
|
+
# Specific branch
|
|
362
|
+
npx give-skill https://github.com/expo/skills/tree/develop
|
|
363
|
+
|
|
364
|
+
# Specific branch with subpath
|
|
365
|
+
npx give-skill https://github.com/expo/skills/tree/develop/skills/custom
|
|
366
|
+
|
|
367
|
+
# GitLab
|
|
368
|
+
npx give-skill https://gitlab.com/org/repo
|
|
369
|
+
|
|
370
|
+
# Any git repository
|
|
371
|
+
npx give-skill https://example.com/repo.git
|
|
372
|
+
```
|
|
262
373
|
|
|
263
374
|
## License
|
|
264
375
|
|
package/dist/index.js
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as
|
|
3
|
-
`)}displayWidth(l){return
|
|
4
|
-
`+" ".repeat(
|
|
5
|
-
${
|
|
6
|
-
`)}}function
|
|
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(
|
|
10
|
-
- too many short flags`);if(
|
|
11
|
-
- too many long flags`);throw Error(`${
|
|
12
|
-
- unrecognised flag format`)}if(
|
|
13
|
-
(Did you mean one of ${
|
|
14
|
-
(Did you mean ${
|
|
15
|
-
- specify the name in Command constructor or using .name()`);if(
|
|
16
|
-
Expecting one of '${
|
|
17
|
-
- already used by option '${
|
|
18
|
-
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(l,
|
|
19
|
-
- if '${
|
|
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
|
-
- ${
|
|
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
|
|
25
|
-
`),this._exit(0,"commander.version",l)}),this}description(l,
|
|
26
|
-
Expecting one of '${
|
|
27
|
-
`)}),this}_outputHelpIfRequested(l){let y=this._getHelpOption();if(y&&l.find(($)=>y.is($)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function dl(l){return l.map((y)=>{if(!y.startsWith("--inspect"))return y;let f,$="127.0.0.1",k="9229",b;if((b=y.match(/^(--inspect(-brk)?)$/))!==null)f=b[1];else if((b=y.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(f=b[1],/^\d+$/.test(b[3]))k=b[3];else $=b[3];else if((b=y.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)f=b[1],$=b[3],k=b[4];if(f&&k!=="0")return`${f}=${$}:${parseInt(k)+1}`;return y})}function Ll(){if(J.env.NO_COLOR||J.env.FORCE_COLOR==="0"||J.env.FORCE_COLOR==="false")return!1;if(J.env.FORCE_COLOR||J.env.CLICOLOR_FORCE!==void 0)return!0;return}My.Command=ql;My.useColor=Ll});var el=V((Ny)=>{var{Argument:al}=u(),{Command:_l}=rl(),{CommanderError:wy,InvalidArgumentError:pl}=n(),{Help:Wy}=Il(),{Option:ol}=Rl();Ny.program=new _l;Ny.createCommand=(l)=>new _l(l);Ny.createOption=(l,y)=>new ol(l,y);Ny.createArgument=(l,y)=>new al(l,y);Ny.Command=_l;Ny.Option=ol;Ny.Argument=al;Ny.Help=Wy;Ny.CommanderError=wy;Ny.InvalidArgumentError=pl;Ny.InvalidOptionArgumentError=pl});var Yl=V((Zf,y1)=>{var Gl={to(l,y){if(!y)return`\x1B[${l+1}G`;return`\x1B[${y+1};${l+1}H`},move(l,y){let f="";if(l<0)f+=`\x1B[${-l}D`;else if(l>0)f+=`\x1B[${l}C`;if(y<0)f+=`\x1B[${-y}A`;else if(y>0)f+=`\x1B[${y}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"},sy={up:(l=1)=>"\x1B[S".repeat(l),down:(l=1)=>"\x1B[T".repeat(l)},iy={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 y="";for(let f=0;f<l;f++)y+=this.line+(f<l-1?Gl.up():"");if(l)y+=Gl.left;return y}};y1.exports={cursor:Gl,scroll:sy,erase:iy,beep:"\x07"}});var p=V((Pf,Xl)=>{var a=process||{},S1=a.argv||[],r=a.env||{},my=!(!!r.NO_COLOR||S1.includes("--no-color"))&&(!!r.FORCE_COLOR||S1.includes("--color")||a.platform==="win32"||(a.stdout||{}).isTTY&&r.TERM!=="dumb"||!!r.CI),Dy=(l,y,f=l)=>($)=>{let k=""+$,b=k.indexOf(y,l.length);return~b?l+ny(k,y,f,b)+y:l+k+y},ny=(l,y,f,$)=>{let k="",b=0;do k+=l.substring(b,$)+f,b=$+y.length,$=l.indexOf(y,b);while(~$);return k+l.substring(b)},f1=(l=my)=>{let y=l?Dy:()=>String;return{isColorSupported:l,reset:y("\x1B[0m","\x1B[0m"),bold:y("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:y("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:y("\x1B[3m","\x1B[23m"),underline:y("\x1B[4m","\x1B[24m"),inverse:y("\x1B[7m","\x1B[27m"),hidden:y("\x1B[8m","\x1B[28m"),strikethrough:y("\x1B[9m","\x1B[29m"),black:y("\x1B[30m","\x1B[39m"),red:y("\x1B[31m","\x1B[39m"),green:y("\x1B[32m","\x1B[39m"),yellow:y("\x1B[33m","\x1B[39m"),blue:y("\x1B[34m","\x1B[39m"),magenta:y("\x1B[35m","\x1B[39m"),cyan:y("\x1B[36m","\x1B[39m"),white:y("\x1B[37m","\x1B[39m"),gray:y("\x1B[90m","\x1B[39m"),bgBlack:y("\x1B[40m","\x1B[49m"),bgRed:y("\x1B[41m","\x1B[49m"),bgGreen:y("\x1B[42m","\x1B[49m"),bgYellow:y("\x1B[43m","\x1B[49m"),bgBlue:y("\x1B[44m","\x1B[49m"),bgMagenta:y("\x1B[45m","\x1B[49m"),bgCyan:y("\x1B[46m","\x1B[49m"),bgWhite:y("\x1B[47m","\x1B[49m"),blackBright:y("\x1B[90m","\x1B[39m"),redBright:y("\x1B[91m","\x1B[39m"),greenBright:y("\x1B[92m","\x1B[39m"),yellowBright:y("\x1B[93m","\x1B[39m"),blueBright:y("\x1B[94m","\x1B[39m"),magentaBright:y("\x1B[95m","\x1B[39m"),cyanBright:y("\x1B[96m","\x1B[39m"),whiteBright:y("\x1B[97m","\x1B[39m"),bgBlackBright:y("\x1B[100m","\x1B[49m"),bgRedBright:y("\x1B[101m","\x1B[49m"),bgGreenBright:y("\x1B[102m","\x1B[49m"),bgYellowBright:y("\x1B[103m","\x1B[49m"),bgBlueBright:y("\x1B[104m","\x1B[49m"),bgMagentaBright:y("\x1B[105m","\x1B[49m"),bgCyanBright:y("\x1B[106m","\x1B[49m"),bgWhiteBright:y("\x1B[107m","\x1B[49m")}};Xl.exports=f1();Xl.exports.createColors=f1});var l1=v(el(),1),{program:Jl,createCommand:Tf,createArgument:Bf,createOption:Lf,CommanderError:qf,InvalidArgumentError:_f,InvalidOptionArgumentError:Jf,Command:Gf,Argument:Yf,Option:Xf,Help:zf}=l1.default;var M=v(Yl(),1);import{stdin as _1,stdout as J1}from"node:process";import*as O from"node:readline";import $1 from"node:readline";import{Writable as ty}from"node:stream";function uy({onlyFirst:l=!1}={}){let y=["[\\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(y,l?void 0:"g")}var dy=uy();function G1(l){if(typeof l!="string")throw TypeError(`Expected a \`string\`, got \`${typeof l}\``);return l.replace(dy,"")}function Y1(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var X1={exports:{}};(function(l){var y={};l.exports=y,y.eastAsianWidth=function($){var k=$.charCodeAt(0),b=$.length==2?$.charCodeAt(1):0,S=k;return 55296<=k&&k<=56319&&56320<=b&&b<=57343&&(k&=1023,b&=1023,S=k<<10|b,S+=65536),S==12288||65281<=S&&S<=65376||65504<=S&&S<=65510?"F":S==8361||65377<=S&&S<=65470||65474<=S&&S<=65479||65482<=S&&S<=65487||65490<=S&&S<=65495||65498<=S&&S<=65500||65512<=S&&S<=65518?"H":4352<=S&&S<=4447||4515<=S&&S<=4519||4602<=S&&S<=4607||9001<=S&&S<=9002||11904<=S&&S<=11929||11931<=S&&S<=12019||12032<=S&&S<=12245||12272<=S&&S<=12283||12289<=S&&S<=12350||12353<=S&&S<=12438||12441<=S&&S<=12543||12549<=S&&S<=12589||12593<=S&&S<=12686||12688<=S&&S<=12730||12736<=S&&S<=12771||12784<=S&&S<=12830||12832<=S&&S<=12871||12880<=S&&S<=13054||13056<=S&&S<=19903||19968<=S&&S<=42124||42128<=S&&S<=42182||43360<=S&&S<=43388||44032<=S&&S<=55203||55216<=S&&S<=55238||55243<=S&&S<=55291||63744<=S&&S<=64255||65040<=S&&S<=65049||65072<=S&&S<=65106||65108<=S&&S<=65126||65128<=S&&S<=65131||110592<=S&&S<=110593||127488<=S&&S<=127490||127504<=S&&S<=127546||127552<=S&&S<=127560||127568<=S&&S<=127569||131072<=S&&S<=194367||177984<=S&&S<=196605||196608<=S&&S<=262141?"W":32<=S&&S<=126||162<=S&&S<=163||165<=S&&S<=166||S==172||S==175||10214<=S&&S<=10221||10629<=S&&S<=10630?"Na":S==161||S==164||167<=S&&S<=168||S==170||173<=S&&S<=174||176<=S&&S<=180||182<=S&&S<=186||188<=S&&S<=191||S==198||S==208||215<=S&&S<=216||222<=S&&S<=225||S==230||232<=S&&S<=234||236<=S&&S<=237||S==240||242<=S&&S<=243||247<=S&&S<=250||S==252||S==254||S==257||S==273||S==275||S==283||294<=S&&S<=295||S==299||305<=S&&S<=307||S==312||319<=S&&S<=322||S==324||328<=S&&S<=331||S==333||338<=S&&S<=339||358<=S&&S<=359||S==363||S==462||S==464||S==466||S==468||S==470||S==472||S==474||S==476||S==593||S==609||S==708||S==711||713<=S&&S<=715||S==717||S==720||728<=S&&S<=731||S==733||S==735||768<=S&&S<=879||913<=S&&S<=929||931<=S&&S<=937||945<=S&&S<=961||963<=S&&S<=969||S==1025||1040<=S&&S<=1103||S==1105||S==8208||8211<=S&&S<=8214||8216<=S&&S<=8217||8220<=S&&S<=8221||8224<=S&&S<=8226||8228<=S&&S<=8231||S==8240||8242<=S&&S<=8243||S==8245||S==8251||S==8254||S==8308||S==8319||8321<=S&&S<=8324||S==8364||S==8451||S==8453||S==8457||S==8467||S==8470||8481<=S&&S<=8482||S==8486||S==8491||8531<=S&&S<=8532||8539<=S&&S<=8542||8544<=S&&S<=8555||8560<=S&&S<=8569||S==8585||8592<=S&&S<=8601||8632<=S&&S<=8633||S==8658||S==8660||S==8679||S==8704||8706<=S&&S<=8707||8711<=S&&S<=8712||S==8715||S==8719||S==8721||S==8725||S==8730||8733<=S&&S<=8736||S==8739||S==8741||8743<=S&&S<=8748||S==8750||8756<=S&&S<=8759||8764<=S&&S<=8765||S==8776||S==8780||S==8786||8800<=S&&S<=8801||8804<=S&&S<=8807||8810<=S&&S<=8811||8814<=S&&S<=8815||8834<=S&&S<=8835||8838<=S&&S<=8839||S==8853||S==8857||S==8869||S==8895||S==8978||9312<=S&&S<=9449||9451<=S&&S<=9547||9552<=S&&S<=9587||9600<=S&&S<=9615||9618<=S&&S<=9621||9632<=S&&S<=9633||9635<=S&&S<=9641||9650<=S&&S<=9651||9654<=S&&S<=9655||9660<=S&&S<=9661||9664<=S&&S<=9665||9670<=S&&S<=9672||S==9675||9678<=S&&S<=9681||9698<=S&&S<=9701||S==9711||9733<=S&&S<=9734||S==9737||9742<=S&&S<=9743||9748<=S&&S<=9749||S==9756||S==9758||S==9792||S==9794||9824<=S&&S<=9825||9827<=S&&S<=9829||9831<=S&&S<=9834||9836<=S&&S<=9837||S==9839||9886<=S&&S<=9887||9918<=S&&S<=9919||9924<=S&&S<=9933||9935<=S&&S<=9953||S==9955||9960<=S&&S<=9983||S==10045||S==10071||10102<=S&&S<=10111||11093<=S&&S<=11097||12872<=S&&S<=12879||57344<=S&&S<=63743||65024<=S&&S<=65039||S==65533||127232<=S&&S<=127242||127248<=S&&S<=127277||127280<=S&&S<=127337||127344<=S&&S<=127386||917760<=S&&S<=917999||983040<=S&&S<=1048573||1048576<=S&&S<=1114109?"A":"N"},y.characterLength=function($){var k=this.eastAsianWidth($);return k=="F"||k=="W"||k=="A"?2:1};function f($){return $.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}y.length=function($){for(var k=f($),b=0,S=0;S<k.length;S++)b=b+this.characterLength(k[S]);return b},y.slice=function($,k,b){textLen=y.length($),k=k||0,b=b||1,k<0&&(k=textLen+k),b<0&&(b=textLen+b);for(var S="",I=0,T=f($),R=0;R<T.length;R++){var B=T[R],q=y.length(B);if(I>=k-(q==2?1:0))if(I+q<=b)S+=B;else break;I+=q}return S}})(X1);var ry=X1.exports,ay=Y1(ry),py=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},oy=Y1(py);function t(l,y={}){if(typeof l!="string"||l.length===0||(y={ambiguousIsNarrow:!0,...y},l=G1(l),l.length===0))return 0;l=l.replace(oy()," ");let f=y.ambiguousIsNarrow?1:2,$=0;for(let k of l){let b=k.codePointAt(0);if(b<=31||b>=127&&b<=159||b>=768&&b<=879)continue;switch(ay.eastAsianWidth(k)){case"F":case"W":$+=2;break;case"A":$+=f;break;default:$+=1}}return $}var zl=10,k1=(l=0)=>(y)=>`\x1B[${y+l}m`,b1=(l=0)=>(y)=>`\x1B[${38+l};5;${y}m`,I1=(l=0)=>(y,f,$)=>`\x1B[${38+l};2;${y};${f};${$}m`,Z={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(Z.modifier);var ey=Object.keys(Z.color),lS=Object.keys(Z.bgColor);[...ey,...lS];function yS(){let l=new Map;for(let[y,f]of Object.entries(Z)){for(let[$,k]of Object.entries(f))Z[$]={open:`\x1B[${k[0]}m`,close:`\x1B[${k[1]}m`},f[$]=Z[$],l.set(k[0],k[1]);Object.defineProperty(Z,y,{value:f,enumerable:!1})}return Object.defineProperty(Z,"codes",{value:l,enumerable:!1}),Z.color.close="\x1B[39m",Z.bgColor.close="\x1B[49m",Z.color.ansi=k1(),Z.color.ansi256=b1(),Z.color.ansi16m=I1(),Z.bgColor.ansi=k1(zl),Z.bgColor.ansi256=b1(zl),Z.bgColor.ansi16m=I1(zl),Object.defineProperties(Z,{rgbToAnsi256:{value:(y,f,$)=>y===f&&f===$?y<8?16:y>248?231:Math.round((y-8)/247*24)+232:16+36*Math.round(y/255*5)+6*Math.round(f/255*5)+Math.round($/255*5),enumerable:!1},hexToRgb:{value:(y)=>{let f=/[a-f\d]{6}|[a-f\d]{3}/i.exec(y.toString(16));if(!f)return[0,0,0];let[$]=f;$.length===3&&($=[...$].map((b)=>b+b).join(""));let k=Number.parseInt($,16);return[k>>16&255,k>>8&255,k&255]},enumerable:!1},hexToAnsi256:{value:(y)=>Z.rgbToAnsi256(...Z.hexToRgb(y)),enumerable:!1},ansi256ToAnsi:{value:(y)=>{if(y<8)return 30+y;if(y<16)return 90+(y-8);let f,$,k;if(y>=232)f=((y-232)*10+8)/255,$=f,k=f;else{y-=16;let I=y%36;f=Math.floor(y/36)/5,$=Math.floor(I/6)/5,k=I%6/5}let b=Math.max(f,$,k)*2;if(b===0)return 30;let S=30+(Math.round(k)<<2|Math.round($)<<1|Math.round(f));return b===2&&(S+=60),S},enumerable:!1},rgbToAnsi:{value:(y,f,$)=>Z.ansi256ToAnsi(Z.rgbToAnsi256(y,f,$)),enumerable:!1},hexToAnsi:{value:(y)=>Z.ansi256ToAnsi(Z.hexToAnsi256(y)),enumerable:!1}}),Z}var SS=yS(),ll=new Set(["\x1B",""]),fS=39,Pl="\x07",z1="[",$S="]",Q1="m",Ul=`${$S}8;;`,R1=(l)=>`${ll.values().next().value}${z1}${l}${Q1}`,T1=(l)=>`${ll.values().next().value}${Ul}${l}${Pl}`,kS=(l)=>l.split(" ").map((y)=>t(y)),Ql=(l,y,f)=>{let $=[...y],k=!1,b=!1,S=t(G1(l[l.length-1]));for(let[I,T]of $.entries()){let R=t(T);if(S+R<=f?l[l.length-1]+=T:(l.push(T),S=0),ll.has(T)&&(k=!0,b=$.slice(I+1).join("").startsWith(Ul)),k){b?T===Pl&&(k=!1,b=!1):T===Q1&&(k=!1);continue}S+=R,S===f&&I<$.length-1&&(l.push(""),S=0)}!S&&l[l.length-1].length>0&&l.length>1&&(l[l.length-2]+=l.pop())},bS=(l)=>{let y=l.split(" "),f=y.length;for(;f>0&&!(t(y[f-1])>0);)f--;return f===y.length?l:y.slice(0,f).join(" ")+y.slice(f).join("")},IS=(l,y,f={})=>{if(f.trim!==!1&&l.trim()==="")return"";let $="",k,b,S=kS(l),I=[""];for(let[R,B]of l.split(" ").entries()){f.trim!==!1&&(I[I.length-1]=I[I.length-1].trimStart());let q=t(I[I.length-1]);if(R!==0&&(q>=y&&(f.wordWrap===!1||f.trim===!1)&&(I.push(""),q=0),(q>0||f.trim===!1)&&(I[I.length-1]+=" ",q++)),f.hard&&S[R]>y){let X=y-q,P=1+Math.floor((S[R]-X-1)/y);Math.floor((S[R]-1)/y)<P&&I.push(""),Ql(I,B,y);continue}if(q+S[R]>y&&q>0&&S[R]>0){if(f.wordWrap===!1&&q<y){Ql(I,B,y);continue}I.push("")}if(q+S[R]>y&&f.wordWrap===!1){Ql(I,B,y);continue}I[I.length-1]+=B}f.trim!==!1&&(I=I.map((R)=>bS(R)));let T=[...I.join(`
|
|
28
|
-
`)];for(let[
|
|
29
|
-
`?(
|
|
30
|
-
`&&(
|
|
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((
|
|
33
|
-
`)}var
|
|
34
|
-
`)
|
|
35
|
-
`),
|
|
36
|
-
`),
|
|
37
|
-
`).length-1;this.output.write(
|
|
38
|
-
`);this.output.write(
|
|
39
|
-
`).slice(
|
|
40
|
-
`)),this._prevFrame=l;return}this.output.write(
|
|
41
|
-
${
|
|
42
|
-
`,
|
|
43
|
-
${
|
|
44
|
-
${
|
|
45
|
-
`}}}).prompt()},
|
|
46
|
-
${
|
|
47
|
-
`;switch(this.state){case"submit":return`${
|
|
48
|
-
${
|
|
49
|
-
${
|
|
50
|
-
${
|
|
51
|
-
`}}}).prompt()};var
|
|
52
|
-
${
|
|
53
|
-
${
|
|
54
|
-
|
|
55
|
-
${
|
|
56
|
-
`).map((
|
|
57
|
-
`);return`${
|
|
58
|
-
${
|
|
59
|
-
${
|
|
60
|
-
`}default:return`${
|
|
61
|
-
${
|
|
62
|
-
${
|
|
63
|
-
`}}}).prompt()};var
|
|
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
|
-
`)},
|
|
66
|
-
`)},
|
|
67
|
-
${
|
|
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
|
-
`)},
|
|
70
|
-
`);
|
|
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)=>{
|
|
73
|
-
`);let
|
|
74
|
-
`);process.stdout.write(
|
|
75
|
-
`);let
|
|
76
|
-
`):process.stdout.write(`${
|
|
77
|
-
`),
|
|
78
|
-
`)){let S=b.indexOf(":");if(S===-1)continue;let I=b.slice(0,S).trim(),T=b.slice(S+1).trim();if(T.startsWith('"')&&T.endsWith('"')||T.startsWith("'")&&T.endsWith("'"))k[I]=T.slice(1,-1);else if(I==="metadata")try{let R={},B=T.replace(/^\{|\}$/g,"").trim();if(B){for(let q of B.split(",")){let[X,P]=q.split("=").map((m)=>m.trim());if(X&&P)R[X]=P.replace(/^['"]|['"]$/g,"")}k[I]=JSON.stringify(R)}}catch{k[I]=T}else k[I]=T}return{data:k,content:$}}async function xl(l){try{let y=x(l,"SKILL.md");return(await xS(y)).isFile()}catch{return!1}}async function Al(l){try{let y=await AS(l,"utf-8"),{data:f}=vS(y);if(!f.name||!f.description)return null;return{name:f.name,description:f.description,path:OS(l),metadata:f.metadata?JSON.parse(f.metadata):void 0}}catch{return null}}async function O1(l,y=0,f=5){let $=[];if(y>f)return $;try{if(await xl(l))$.push(l);let k=await C1(l,{withFileTypes:!0});for(let b of k)if(b.isDirectory()&&!FS.includes(b.name)){let S=await O1(x(l,b.name),y+1,f);$.push(...S)}}catch{}return $}async function F1(l,y){let f=[],$=new Set,k=y?x(l,y):l;if(await xl(k)){let S=await Al(x(k,"SKILL.md"));if(S)return f.push(S),f}let b=gS(k);for(let S of b)try{let I=await C1(S,{withFileTypes:!0});for(let T of I)if(T.isDirectory()){let R=x(S,T.name);if(await xl(R)){let B=await Al(x(R,"SKILL.md"));if(B&&!$.has(B.name))f.push(B),$.add(B.name)}}}catch{}if(f.length===0){let S=await O1(k);for(let I of S){let T=await Al(x(I,"SKILL.md"));if(T&&!$.has(T.name))f.push(T),$.add(T.name)}}return f}function C(l){return l.name||CS(l.path)}import{mkdir as c1,cp as hS,access as sS,readdir as iS}from"fs/promises";import{join as c,basename as mS}from"path";async function g1(l,y,f={}){let $=j[y],k=l.name||mS(l.path),b=f.global?$.globalSkillsDir:c(f.cwd||process.cwd(),$.skillsDir),S=c(b,k);try{return await c1(S,{recursive:!0}),await v1(l.path,S),{success:!0,path:S}}catch(I){return{success:!1,path:S,error:I instanceof Error?I.message:"Unknown error"}}}var DS=new Set(["README.md","metadata.json"]),nS=(l)=>{if(DS.has(l))return!0;if(l.startsWith("_"))return!0;return!1};async function v1(l,y){await c1(y,{recursive:!0});let f=await iS(l,{withFileTypes:!0});for(let $ of f){if(nS($.name))continue;let k=c(l,$.name),b=c(y,$.name);if($.isDirectory())await v1(k,b);else await hS(k,b)}}async function h1(l,y,f={}){let $=j[y],k=f.global?$.globalSkillsDir:c(f.cwd||process.cwd(),$.skillsDir),b=c(k,l);try{return await sS(b),!0}catch{return!1}}function s1(l,y,f={}){let $=j[y],k=f.global?$.globalSkillsDir:c(f.cwd||process.cwd(),$.skillsDir);return c(k,l)}async function i1(l,y){let f={tempDir:null,spinner:W1()};try{f.spinner.start("Parsing source...");let $=E1(l);f.spinner.stop(`Source: ${z.default.cyan($.url)}${$.subpath?` (${$.subpath})`:""}`),f.spinner.start("Cloning repository..."),f.tempDir=await V1($.url),f.spinner.stop("Repository cloned"),f.spinner.start("Discovering skills...");let k=await F1(f.tempDir,$.subpath);if(k.length===0)return f.spinner.stop(z.default.red("No skills found")),i(z.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 ${z.default.green(k.length)} skill${k.length>1?"s":""}`),y.list){console.log(),_.step(z.default.bold("Available Skills"));for(let B of k)_.message(` ${z.default.cyan(C(B))}`),_.message(` ${z.default.dim(B.description)}`);return console.log(),i("Use --skill <name> to install specific skills"),{success:!0,installed:0,failed:0,results:[]}}let b=await tS(k,y);if(!b)return{success:!1,installed:0,failed:0,results:[]};let S=await uS(y,f);if(!S)return{success:!1,installed:0,failed:0,results:[]};let I=await dS(y);if(I===null)return{success:!1,installed:0,failed:0,results:[]};if(!await rS(y,b,S,I))return{success:!1,installed:0,failed:0,results:[]};f.spinner.start("Installing skills...");let R=await aS(b,S,I);return f.spinner.stop("Installation complete"),R}finally{if(f.tempDir)await A1(f.tempDir)}}async function tS(l,y){let f;if(y.skill&&y.skill.length>0){if(f=l.filter(($)=>y.skill.some((k)=>$.name.toLowerCase()===k.toLowerCase()||C($).toLowerCase()===k.toLowerCase())),f.length===0){_.error(`No matching skills found for: ${y.skill.join(", ")}`),_.info("Available skills:");for(let $ of l)_.message(` - ${C($)}`);return null}_.info(`Selected ${f.length} skill${f.length!==1?"s":""}: ${f.map(($)=>z.default.cyan(C($))).join(", ")}`)}else if(l.length===1){f=l;let $=l[0];_.info(`Skill: ${z.default.cyan(C($))}`),_.message(z.default.dim($.description))}else if(y.yes)f=l,_.info(`Installing all ${l.length} skills`);else{let $=l.map((b)=>({value:b,label:C(b),hint:b.description.length>60?b.description.slice(0,57)+"...":b.description})),k=await fl({message:"Select skills to install",options:$,required:!0});if(F(k))return s("Installation cancelled"),null;f=k}return f}async function uS(l,y){if(l.agent&&l.agent.length>0){let $=Object.keys(j),k=l.agent.filter((b)=>!$.includes(b));if(k.length>0)return _.error(`Invalid agents: ${k.join(", ")}`),_.info(`Valid agents: ${$.join(", ")}`),null;return l.agent}y.spinner.start("Detecting installed agents...");let f=await x1();if(y.spinner.stop(`Detected ${f.length} agent${f.length!==1?"s":""}`),f.length===0)if(l.yes){let $=Object.keys(j);return _.info("Installing to all agents (none detected)"),$}else{_.warn("No coding agents detected. You can still install skills.");let $=Object.entries(j).map(([b,S])=>({value:b,label:S.displayName})),k=await fl({message:"Select agents to install skills to",options:$,required:!0});if(F(k))return s("Installation cancelled"),null;return k}else if(f.length===1||l.yes){if(f.length===1){let $=f[0];_.info(`Installing to: ${z.default.cyan(j[$].displayName)}`)}else _.info(`Installing to: ${f.map(($)=>z.default.cyan(j[$].displayName)).join(", ")}`);return f}else{let $=f.map((b)=>({value:b,label:j[b].displayName,hint:j[b].skillsDir})),k=await fl({message:"Select agents to install skills to",options:$,required:!0,initialValues:f});if(F(k))return s("Installation cancelled"),null;return k}}async function dS(l){let y=l.global??!1;if(l.global===void 0&&!l.yes){let f=await K1({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(F(f))return s("Installation cancelled"),null;y=f}return y}async function rS(l,y,f,$){console.log(),_.step(z.default.bold("Installation Summary"));for(let k of y){_.message(` ${z.default.cyan(C(k))}`);for(let b of f){let S=s1(k.name,b,{global:$}),T=await h1(k.name,b,{global:$})?z.default.yellow(" (will overwrite)"):"";_.message(` ${z.default.dim("→")} ${j[b].displayName}: ${z.default.dim(S)}${T}`)}}if(console.log(),!l.yes){let k=await H1({message:"Proceed with installation?"});if(F(k)||!k)return s("Installation cancelled"),!1}return!0}async function aS(l,y,f){let $=l.flatMap((T)=>y.map((R)=>g1(T,R,{global:f}))),b=(await Promise.all($)).map((T,R)=>{let B=Math.floor(R/y.length),q=R%y.length,X=l[B],P=y[q];return{skill:C(X),agent:j[P].displayName,...T}});console.log();let S=b.filter((T)=>T.success),I=b.filter((T)=>!T.success);if(S.length>0){_.success(z.default.green(`Successfully installed ${S.length} skill${S.length!==1?"s":""}`));for(let T of S)_.message(` ${z.default.green("✓")} ${T.skill} → ${T.agent}`),_.message(` ${z.default.dim(T.path)}`)}if(I.length>0){console.log(),_.error(z.default.red(`Failed to install ${I.length} skill${I.length!==1?"s":""}`));for(let T of I)_.message(` ${z.default.red("✗")} ${T.skill} → ${T.agent}`),_.message(` ${z.default.dim(T.error)}`)}return console.log(),i(z.default.green("Done!")),{success:I.length===0,installed:S.length,failed:I.length,results:b}}var m1={name:"give-skill",version:"1.0.2",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 oS=m1.version;Jl.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(oS).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,y)=>{await eS(l,y)});Jl.parse();async function eS(l,y){console.log(),w1($l.default.bgCyan($l.default.black(" give-skill ")));try{let f=await i1(l,y);if(!f.success&&f.installed===0&&f.failed===0)process.exit(1);if(f.failed>0)process.exit(1)}catch(f){_.error(f instanceof Error?f.message:"Unknown error occurred"),i($l.default.red("Installation 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)}}
|