give-skill 1.0.1 → 1.1.0
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 +170 -52
- package/dist/index.js +68 -68
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,6 +28,7 @@ All agents support the [Agent Skills](https://agentskills.io) open standard:
|
|
|
28
28
|
| [Windsurf](https://windsurf.com) | ✅ |
|
|
29
29
|
| [Trae](https://trae.ai) | ✅¹ |
|
|
30
30
|
| [Factory Droid](https://factory.ai) | ✅ |
|
|
31
|
+
| [Letta](https://www.letta.com) | ✅ |
|
|
31
32
|
| [OpenCode](https://opencode.ai) | ✅ |
|
|
32
33
|
| [Codex](https://openai.com/codex) | ✅ |
|
|
33
34
|
| [Antigravity](https://antigravity.google) | ✅ |
|
|
@@ -75,26 +76,103 @@ npx give-skill expo/skills --global
|
|
|
75
76
|
npx give-skill expo/skills --list
|
|
76
77
|
```
|
|
77
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
|
|
88
|
+
npx give-skill status
|
|
89
|
+
|
|
90
|
+
# Check status of specific skills
|
|
91
|
+
npx give-skill status pr-reviewer test-generator
|
|
92
|
+
|
|
93
|
+
# Update all skills with available updates (interactive selection)
|
|
94
|
+
npx give-skill update
|
|
95
|
+
|
|
96
|
+
# Update specific skills
|
|
97
|
+
npx give-skill update pr-reviewer test-generator
|
|
98
|
+
|
|
99
|
+
# Update without confirmation (auto-selects all with updates)
|
|
100
|
+
npx give-skill update -y
|
|
101
|
+
|
|
102
|
+
# Remove specific skills
|
|
103
|
+
npx give-skill remove pr-reviewer
|
|
104
|
+
|
|
105
|
+
# Remove from specific agent only
|
|
106
|
+
npx give-skill remove pr-reviewer -a claude-code
|
|
107
|
+
|
|
108
|
+
# Remove global installation only
|
|
109
|
+
npx give-skill remove pr-reviewer --global
|
|
110
|
+
|
|
111
|
+
# Remove without confirmation (auto-selects all)
|
|
112
|
+
npx give-skill remove -y
|
|
113
|
+
|
|
114
|
+
# Interactive removal (shows multiselect of all installed skills)
|
|
115
|
+
npx give-skill remove
|
|
116
|
+
|
|
117
|
+
# Clean up orphaned entries
|
|
118
|
+
npx give-skill clean
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Status Indicators
|
|
122
|
+
|
|
123
|
+
The `status` command shows one of the following states for each skill:
|
|
124
|
+
|
|
125
|
+
| Icon | Status | Description |
|
|
126
|
+
| ---- | ------ | ----------- |
|
|
127
|
+
| ✓ | `latest` | Skill is up to date with the remote repository |
|
|
128
|
+
| ↓ | `update-available` | A newer version is available |
|
|
129
|
+
| ✗ | `error` | Failed to check for updates (network issues, repo deleted, etc.) |
|
|
130
|
+
| ○ | `orphaned` | No valid installations found (folders were manually deleted) |
|
|
131
|
+
|
|
78
132
|
## Command Reference
|
|
79
133
|
|
|
80
134
|
```
|
|
81
135
|
give-skill <source> [options]
|
|
82
136
|
|
|
83
137
|
Arguments:
|
|
84
|
-
source Git repo URL
|
|
138
|
+
source Git repo URL, GitHub shorthand (owner/repo), or direct path to skill
|
|
85
139
|
|
|
86
140
|
Options:
|
|
87
|
-
-g, --global Install
|
|
88
|
-
-a, --agent <...>
|
|
89
|
-
-s, --skill <...>
|
|
90
|
-
-l, --list List skills without installing
|
|
141
|
+
-g, --global Install skill globally (user-level) instead of project-level
|
|
142
|
+
-a, --agent <...> Specify agents to install to (windsurf, gemini, claude-code, cursor, copilot, etc.)
|
|
143
|
+
-s, --skill <...> Specify skill names to install (skip selection prompt)
|
|
144
|
+
-l, --list List available skills in the repository without installing
|
|
91
145
|
-y, --yes Skip all prompts (CI-friendly)
|
|
92
146
|
-V, --version Show version
|
|
93
147
|
-h, --help Show help
|
|
148
|
+
|
|
149
|
+
Commands:
|
|
150
|
+
update [skills...] Update installed skills to their latest versions
|
|
151
|
+
status [skills...] Check status of installed skills (updates available, orphaned, etc.)
|
|
152
|
+
remove [skills...] Remove installed skills (interactive if no skills specified)
|
|
153
|
+
list List all installed skills
|
|
154
|
+
clean Remove orphaned skill entries from state
|
|
94
155
|
```
|
|
95
156
|
|
|
96
157
|
## Examples
|
|
97
158
|
|
|
159
|
+
### Install from specific branch
|
|
160
|
+
|
|
161
|
+
By default, `give-skill` uses the repository's default branch. To install from a specific branch, use the full GitHub URL with the branch:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# Install from develop branch
|
|
165
|
+
npx give-skill https://github.com/org/repo/tree/develop
|
|
166
|
+
|
|
167
|
+
# Install from develop branch with subpath
|
|
168
|
+
npx give-skill https://github.com/org/repo/tree/develop/skills/custom
|
|
169
|
+
|
|
170
|
+
# Install from a feature branch
|
|
171
|
+
npx give-skill https://github.com/org/repo/tree/feature/new-skill
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
The branch is saved in the state file, so future updates will continue using the same branch.
|
|
175
|
+
|
|
98
176
|
### Install specific skills
|
|
99
177
|
|
|
100
178
|
```bash
|
|
@@ -113,51 +191,25 @@ npx give-skill expo/skills -a claude-code -a copilot -a cursor
|
|
|
113
191
|
npx give-skill expo/skills -s pr-reviewer -g -a copilot -y
|
|
114
192
|
```
|
|
115
193
|
|
|
116
|
-
### Install from subdirectory
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
npx give-skill https://github.com/org/repo/tree/main/skills/custom
|
|
120
|
-
```
|
|
121
|
-
|
|
122
194
|
## Where Skills Go
|
|
123
195
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
|
127
|
-
|
|
|
128
|
-
|
|
|
129
|
-
|
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
|
133
|
-
|
|
|
134
|
-
|
|
|
135
|
-
|
|
|
136
|
-
|
|
|
137
|
-
|
|
|
138
|
-
|
|
|
139
|
-
|
|
|
140
|
-
|
|
|
141
|
-
| Goose | `.goose/skills/<name>/` |
|
|
142
|
-
|
|
143
|
-
### Global Level (`--global`)
|
|
144
|
-
|
|
145
|
-
| Agent | Path |
|
|
146
|
-
| ----------- | -------------------------------------- |
|
|
147
|
-
| Claude Code | `~/.claude/skills/<name>/` |
|
|
148
|
-
| Cursor | `~/.cursor/skills/<name>/` |
|
|
149
|
-
| Copilot | `~/.copilot/skills/<name>/` |
|
|
150
|
-
| Gemini CLI | `~/.gemini/skills/<name>/` |
|
|
151
|
-
| Windsurf | `~/.codeium/windsurf/skills/<name>/` |
|
|
152
|
-
| Trae | Project-level only (SOLO mode) |
|
|
153
|
-
| Factory Droid | `~/.factory/skills/<name>/` |
|
|
154
|
-
| OpenCode | `~/.config/opencode/skill/<name>/` |
|
|
155
|
-
| Codex | `~/.codex/skills/<name>/` |
|
|
156
|
-
| Antigravity | `~/.gemini/antigravity/skills/<name>/` |
|
|
157
|
-
| Amp | `~/.config/agents/skills/<name>/` |
|
|
158
|
-
| Kilo Code | `~/.kilocode/skills/<name>/` |
|
|
159
|
-
| Roo Code | `~/.roo/skills/<name>/` |
|
|
160
|
-
| Goose | `~/.config/goose/skills/<name>/` |
|
|
196
|
+
| Agent | Project Level | Global Level (`--global`) |
|
|
197
|
+
| ------------- | ------------------------------------ | ------------------------------------------- |
|
|
198
|
+
| Claude Code | `.claude/skills/<name>/` | `~/.claude/skills/<name>/` |
|
|
199
|
+
| Cursor | `.cursor/skills/<name>/` | `~/.cursor/skills/<name>/` |
|
|
200
|
+
| Copilot | `.github/skills/<name>/` | `~/.copilot/skills/<name>/` |
|
|
201
|
+
| Gemini CLI | `.gemini/skills/<name>/` | `~/.gemini/skills/<name>/` |
|
|
202
|
+
| Windsurf | `.windsurf/skills/<name>/` | `~/.codeium/windsurf/skills/<name>/` |
|
|
203
|
+
| Trae | `.trae/skills/<name>/` | Project-level only (SOLO mode) |
|
|
204
|
+
| Factory Droid | `.factory/skills/<name>/` | `~/.factory/skills/<name>/` |
|
|
205
|
+
| Letta | `.skills/<name>/` | `~/.letta/skills/<name>/` |
|
|
206
|
+
| OpenCode | `.opencode/skill/<name>/` | `~/.config/opencode/skill/<name>/` |
|
|
207
|
+
| Codex | `.codex/skills/<name>/` | `~/.codex/skills/<name>/` |
|
|
208
|
+
| Antigravity | `.agent/skills/<name>/` | `~/.gemini/antigravity/skills/<name>/` |
|
|
209
|
+
| Amp | `.agents/skills/<name>/` | `~/.config/agents/skills/<name>/` |
|
|
210
|
+
| Kilo Code | `.kilocode/skills/<name>/` | `~/.kilocode/skills/<name>/` |
|
|
211
|
+
| Roo Code | `.roo/skills/<name>/` | `~/.roo/skills/<name>/` |
|
|
212
|
+
| Goose | `.goose/skills/<name>/` | `~/.config/goose/skills/<name>/` |
|
|
161
213
|
|
|
162
214
|
## Creating Skills
|
|
163
215
|
|
|
@@ -205,6 +257,7 @@ The CLI automatically searches these paths in a repository:
|
|
|
205
257
|
- `.windsurf/skills/`
|
|
206
258
|
- `.trae/skills/`
|
|
207
259
|
- `.factory/skills/`
|
|
260
|
+
- `.skills/` (Letta)
|
|
208
261
|
- `.opencode/skill/`
|
|
209
262
|
- `.codex/skills/`
|
|
210
263
|
- `.agent/skills/`
|
|
@@ -230,10 +283,51 @@ If a folder matches an agent's skill directory, the CLI will find it.
|
|
|
230
283
|
└──────────────┘
|
|
231
284
|
```
|
|
232
285
|
|
|
233
|
-
1. **Clone** the source repository
|
|
234
|
-
2. **Discover** all `SKILL.md` files
|
|
235
|
-
3. **Detect** installed agents on your system
|
|
286
|
+
1. **Clone** the source repository (supports specific branches and subpaths)
|
|
287
|
+
2. **Discover** all `SKILL.md` files in common and agent-specific directories
|
|
288
|
+
3. **Detect** installed agents on your system automatically
|
|
236
289
|
4. **Install** skills to agent-specific directories
|
|
290
|
+
5. **Track** installation state for future updates and management
|
|
291
|
+
|
|
292
|
+
## State Management
|
|
293
|
+
|
|
294
|
+
`give-skill` stores installation state in `~/.give-skill/state.json`. This enables:
|
|
295
|
+
|
|
296
|
+
- **Update tracking**: Know when skills have updates available
|
|
297
|
+
- **Source tracking**: Remember where each skill came from
|
|
298
|
+
- **Batch operations**: Update all skills without re-specifying sources
|
|
299
|
+
- **Branch tracking**: Remember which branch was used for installation
|
|
300
|
+
|
|
301
|
+
**Important**: State tracking only works for skills installed via `give-skill`. Manually installed skills are not tracked.
|
|
302
|
+
|
|
303
|
+
The state file contains:
|
|
304
|
+
|
|
305
|
+
```json
|
|
306
|
+
{
|
|
307
|
+
"lastUpdate": "2025-01-16T10:00:00Z",
|
|
308
|
+
"skills": {
|
|
309
|
+
"pr-reviewer": {
|
|
310
|
+
"source": "https://github.com/expo/skills.git",
|
|
311
|
+
"url": "https://github.com/expo/skills.git",
|
|
312
|
+
"branch": "main",
|
|
313
|
+
"commit": "abc123...",
|
|
314
|
+
"subpath": "skills/.curated",
|
|
315
|
+
"installedAt": "2025-01-15T10:00:00Z",
|
|
316
|
+
"installations": [
|
|
317
|
+
{
|
|
318
|
+
"agent": "claude-code",
|
|
319
|
+
"type": "global",
|
|
320
|
+
"path": "~/.claude/skills/pr-reviewer"
|
|
321
|
+
}
|
|
322
|
+
]
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
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.
|
|
329
|
+
|
|
330
|
+
If you manually delete skill folders, run `npx give-skill clean` to remove orphaned entries.
|
|
237
331
|
|
|
238
332
|
## Troubleshooting
|
|
239
333
|
|
|
@@ -254,7 +348,31 @@ Check you have write permissions for the target directory.
|
|
|
254
348
|
|
|
255
349
|
### Agent not detected
|
|
256
350
|
|
|
257
|
-
The CLI
|
|
351
|
+
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.
|
|
352
|
+
|
|
353
|
+
### Source URL formats
|
|
354
|
+
|
|
355
|
+
`give-skill` supports multiple source formats:
|
|
356
|
+
|
|
357
|
+
```bash
|
|
358
|
+
# GitHub shorthand
|
|
359
|
+
npx give-skill expo/skills
|
|
360
|
+
|
|
361
|
+
# Full GitHub URL
|
|
362
|
+
npx give-skill https://github.com/expo/skills
|
|
363
|
+
|
|
364
|
+
# Specific branch
|
|
365
|
+
npx give-skill https://github.com/expo/skills/tree/develop
|
|
366
|
+
|
|
367
|
+
# Specific branch with subpath
|
|
368
|
+
npx give-skill https://github.com/expo/skills/tree/develop/skills/custom
|
|
369
|
+
|
|
370
|
+
# GitLab
|
|
371
|
+
npx give-skill https://gitlab.com/org/repo
|
|
372
|
+
|
|
373
|
+
# Any git repository
|
|
374
|
+
npx give-skill https://example.com/repo.git
|
|
375
|
+
```
|
|
258
376
|
|
|
259
377
|
## License
|
|
260
378
|
|
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 Yt}from"node:module";var qt=Object.create;var{getPrototypeOf:rt,defineProperty:ks,getOwnPropertyNames:Jt}=Object;var Pt=Object.prototype.hasOwnProperty;var d=(l,s,f)=>{f=l!=null?qt(rt(l)):{};let y=s||!l||!l.__esModule?ks(f,"default",{value:l,enumerable:!0}):f;for(let i of Jt(l))if(!Pt.call(y,i))ks(y,i,{get:()=>l[i],enumerable:!0});return y};var a=(l,s)=>()=>(s||l((s={exports:{}}).exports,s),s.exports);var il=Yt(import.meta.url);var Sl=a((Gt)=>{class Ql extends Error{constructor(l,s,f){super(f);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=s,this.exitCode=l,this.nestedError=void 0}}class cs extends Ql{constructor(l){super(1,"commander.invalidArgument",l);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}Gt.CommanderError=Ql;Gt.InvalidArgumentError=cs});var cl=a((jt)=>{var{InvalidArgumentError:Qt}=Sl();class bs{constructor(l,s){switch(this.description=s||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,l[0]){case"<":this.required=!0,this._name=l.slice(1,-1);break;case"[":this.required=!1,this._name=l.slice(1,-1);break;default:this.required=!0,this._name=l;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(l,s){if(s===this.defaultValue||!Array.isArray(s))return[l];return s.push(l),s}default(l,s){return this.defaultValue=l,this.defaultValueDescription=s,this}argParser(l){return this.parseArg=l,this}choices(l){return this.argChoices=l.slice(),this.parseArg=(s,f)=>{if(!this.argChoices.includes(s))throw new Qt(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(s,f);return s},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function Zt(l){let s=l.name()+(l.variadic===!0?"...":"");return l.required?"<"+s+">":"["+s+"]"}jt.Argument=bs;jt.humanReadableArgName=Zt});var Zl=a((Wt)=>{var{humanReadableArgName:Kt}=cl();class ns{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(l){this.helpWidth=this.helpWidth??l.helpWidth??80}visibleCommands(l){let s=l.commands.filter((y)=>!y._hidden),f=l._getHelpCommand();if(f&&!f._hidden)s.push(f);if(this.sortSubcommands)s.sort((y,i)=>{return y.name().localeCompare(i.name())});return s}compareOptions(l,s){let f=(y)=>{return y.short?y.short.replace(/^-/,""):y.long.replace(/^--/,"")};return f(l).localeCompare(f(s))}visibleOptions(l){let s=l.options.filter((y)=>!y.hidden),f=l._getHelpOption();if(f&&!f.hidden){let y=f.short&&l._findOption(f.short),i=f.long&&l._findOption(f.long);if(!y&&!i)s.push(f);else if(f.long&&!i)s.push(l.createOption(f.long,f.description));else if(f.short&&!y)s.push(l.createOption(f.short,f.description))}if(this.sortOptions)s.sort(this.compareOptions);return s}visibleGlobalOptions(l){if(!this.showGlobalOptions)return[];let s=[];for(let f=l.parent;f;f=f.parent){let y=f.options.filter((i)=>!i.hidden);s.push(...y)}if(this.sortOptions)s.sort(this.compareOptions);return s}visibleArguments(l){if(l._argsDescription)l.registeredArguments.forEach((s)=>{s.description=s.description||l._argsDescription[s.name()]||""});if(l.registeredArguments.find((s)=>s.description))return l.registeredArguments;return[]}subcommandTerm(l){let s=l.registeredArguments.map((f)=>Kt(f)).join(" ");return l._name+(l._aliases[0]?"|"+l._aliases[0]:"")+(l.options.length?" [options]":"")+(s?" "+s:"")}optionTerm(l){return l.flags}argumentTerm(l){return l.name()}longestSubcommandTermLength(l,s){return s.visibleCommands(l).reduce((f,y)=>{return Math.max(f,this.displayWidth(s.styleSubcommandTerm(s.subcommandTerm(y))))},0)}longestOptionTermLength(l,s){return s.visibleOptions(l).reduce((f,y)=>{return Math.max(f,this.displayWidth(s.styleOptionTerm(s.optionTerm(y))))},0)}longestGlobalOptionTermLength(l,s){return s.visibleGlobalOptions(l).reduce((f,y)=>{return Math.max(f,this.displayWidth(s.styleOptionTerm(s.optionTerm(y))))},0)}longestArgumentTermLength(l,s){return s.visibleArguments(l).reduce((f,y)=>{return Math.max(f,this.displayWidth(s.styleArgumentTerm(s.argumentTerm(y))))},0)}commandUsage(l){let s=l._name;if(l._aliases[0])s=s+"|"+l._aliases[0];let f="";for(let y=l.parent;y;y=y.parent)f=y.name()+" "+f;return f+s+" "+l.usage()}commandDescription(l){return l.description()}subcommandDescription(l){return l.summary()||l.description()}optionDescription(l){let s=[];if(l.argChoices)s.push(`choices: ${l.argChoices.map((f)=>JSON.stringify(f)).join(", ")}`);if(l.defaultValue!==void 0){if(l.required||l.optional||l.isBoolean()&&typeof l.defaultValue==="boolean")s.push(`default: ${l.defaultValueDescription||JSON.stringify(l.defaultValue)}`)}if(l.presetArg!==void 0&&l.optional)s.push(`preset: ${JSON.stringify(l.presetArg)}`);if(l.envVar!==void 0)s.push(`env: ${l.envVar}`);if(s.length>0){let f=`(${s.join(", ")})`;if(l.description)return`${l.description} ${f}`;return f}return l.description}argumentDescription(l){let s=[];if(l.argChoices)s.push(`choices: ${l.argChoices.map((f)=>JSON.stringify(f)).join(", ")}`);if(l.defaultValue!==void 0)s.push(`default: ${l.defaultValueDescription||JSON.stringify(l.defaultValue)}`);if(s.length>0){let f=`(${s.join(", ")})`;if(l.description)return`${l.description} ${f}`;return f}return l.description}formatItemList(l,s,f){if(s.length===0)return[];return[f.styleTitle(l),...s,""]}groupItems(l,s,f){let y=new Map;return l.forEach((i)=>{let S=f(i);if(!y.has(S))y.set(S,[])}),s.forEach((i)=>{let S=f(i);if(!y.has(S))y.set(S,[]);y.get(S).push(i)}),y}formatHelp(l,s){let f=s.padWidth(l,s),y=s.helpWidth??80;function i(b,U){return s.formatItem(b,f,U,s)}let S=[`${s.styleTitle("Usage:")} ${s.styleUsage(s.commandUsage(l))}`,""],t=s.commandDescription(l);if(t.length>0)S=S.concat([s.boxWrap(s.styleCommandDescription(t),y),""]);let $=s.visibleArguments(l).map((b)=>{return i(s.styleArgumentTerm(s.argumentTerm(b)),s.styleArgumentDescription(s.argumentDescription(b)))});if(S=S.concat(this.formatItemList("Arguments:",$,s)),this.groupItems(l.options,s.visibleOptions(l),(b)=>b.helpGroupHeading??"Options:").forEach((b,U)=>{let w=b.map((n)=>{return i(s.styleOptionTerm(s.optionTerm(n)),s.styleOptionDescription(s.optionDescription(n)))});S=S.concat(this.formatItemList(U,w,s))}),s.showGlobalOptions){let b=s.visibleGlobalOptions(l).map((U)=>{return i(s.styleOptionTerm(s.optionTerm(U)),s.styleOptionDescription(s.optionDescription(U)))});S=S.concat(this.formatItemList("Global Options:",b,s))}return this.groupItems(l.commands,s.visibleCommands(l),(b)=>b.helpGroup()||"Commands:").forEach((b,U)=>{let w=b.map((n)=>{return i(s.styleSubcommandTerm(s.subcommandTerm(n)),s.styleSubcommandDescription(s.subcommandDescription(n)))});S=S.concat(this.formatItemList(U,w,s))}),S.join(`
|
|
3
|
+
`)}displayWidth(l){return Is(l).length}styleTitle(l){return l}styleUsage(l){return l.split(" ").map((s)=>{if(s==="[options]")return this.styleOptionText(s);if(s==="[command]")return this.styleSubcommandText(s);if(s[0]==="["||s[0]==="<")return this.styleArgumentText(s);return this.styleCommandText(s)}).join(" ")}styleCommandDescription(l){return this.styleDescriptionText(l)}styleOptionDescription(l){return this.styleDescriptionText(l)}styleSubcommandDescription(l){return this.styleDescriptionText(l)}styleArgumentDescription(l){return this.styleDescriptionText(l)}styleDescriptionText(l){return l}styleOptionTerm(l){return this.styleOptionText(l)}styleSubcommandTerm(l){return l.split(" ").map((s)=>{if(s==="[options]")return this.styleOptionText(s);if(s[0]==="["||s[0]==="<")return this.styleArgumentText(s);return this.styleSubcommandText(s)}).join(" ")}styleArgumentTerm(l){return this.styleArgumentText(l)}styleOptionText(l){return l}styleArgumentText(l){return l}styleSubcommandText(l){return l}styleCommandText(l){return l}padWidth(l,s){return Math.max(s.longestOptionTermLength(l,s),s.longestGlobalOptionTermLength(l,s),s.longestSubcommandTermLength(l,s),s.longestArgumentTermLength(l,s))}preformatted(l){return/\n[^\S\r\n]/.test(l)}formatItem(l,s,f,y){let S=" ".repeat(2);if(!f)return S+l;let t=l.padEnd(s+l.length-y.displayWidth(l)),$=2,k=(this.helpWidth??80)-s-$-2,b;if(k<this.minWidthToWrap||y.preformatted(f))b=f;else b=y.boxWrap(f,k).replace(/\n/g,`
|
|
4
|
+
`+" ".repeat(s+$));return S+t+" ".repeat($)+b.replace(/\n/g,`
|
|
5
|
+
${S}`)}boxWrap(l,s){if(s<this.minWidthToWrap)return l;let f=l.split(/\r\n|\n/),y=/[\s]*[^\s]+/g,i=[];return f.forEach((S)=>{let t=S.match(y);if(t===null){i.push("");return}let $=[t.shift()],c=this.displayWidth($[0]);t.forEach((k)=>{let b=this.displayWidth(k);if(c+b<=s){$.push(k),c+=b;return}i.push($.join(""));let U=k.trimStart();$=[U],c=this.displayWidth(U)}),i.push($.join(""))}),i.join(`
|
|
6
|
+
`)}}function Is(l){let s=/\x1b\[\d*(;\d*)*m/g;return l.replace(s,"")}Wt.Help=ns;Wt.stripColor=Is});var jl=a((Vt)=>{var{InvalidArgumentError:Ct}=Sl();class gs{constructor(l,s){this.flags=l,this.description=s||"",this.required=l.includes("<"),this.optional=l.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(l),this.mandatory=!1;let f=Nt(l);if(this.short=f.shortFlag,this.long=f.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(l,s){return this.defaultValue=l,this.defaultValueDescription=s,this}preset(l){return this.presetArg=l,this}conflicts(l){return this.conflictsWith=this.conflictsWith.concat(l),this}implies(l){let s=l;if(typeof l==="string")s={[l]:!0};return this.implied=Object.assign(this.implied||{},s),this}env(l){return this.envVar=l,this}argParser(l){return this.parseArg=l,this}makeOptionMandatory(l=!0){return this.mandatory=!!l,this}hideHelp(l=!0){return this.hidden=!!l,this}_collectValue(l,s){if(s===this.defaultValue||!Array.isArray(s))return[l];return s.push(l),s}choices(l){return this.argChoices=l.slice(),this.parseArg=(s,f)=>{if(!this.argChoices.includes(s))throw new Ct(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(s,f);return s},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return ws(this.name().replace(/^no-/,""));return ws(this.name())}helpGroup(l){return this.helpGroupHeading=l,this}is(l){return this.short===l||this.long===l}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class Us{constructor(l){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,l.forEach((s)=>{if(s.negate)this.negativeOptions.set(s.attributeName(),s);else this.positiveOptions.set(s.attributeName(),s)}),this.negativeOptions.forEach((s,f)=>{if(this.positiveOptions.has(f))this.dualOptions.add(f)})}valueFromOption(l,s){let f=s.attributeName();if(!this.dualOptions.has(f))return!0;let y=this.negativeOptions.get(f).presetArg,i=y!==void 0?y:!1;return s.negate===(i===l)}}function ws(l){return l.split("-").reduce((s,f)=>{return s+f[0].toUpperCase()+f.slice(1)})}function Nt(l){let s,f,y=/^-[^-]$/,i=/^--[^-]/,S=l.split(/[ |,]+/).concat("guard");if(y.test(S[0]))s=S.shift();if(i.test(S[0]))f=S.shift();if(!s&&y.test(S[0]))s=S.shift();if(!s&&i.test(S[0]))s=f,f=S.shift();if(S[0].startsWith("-")){let t=S[0],$=`option creation failed due to '${t}' in option flags '${l}'`;if(/^-[^-][^-]/.test(t))throw Error(`${$}
|
|
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(y.test(t))throw Error(`${$}
|
|
10
|
+
- too many short flags`);if(i.test(t))throw Error(`${$}
|
|
11
|
+
- too many long flags`);throw Error(`${$}
|
|
12
|
+
- unrecognised flag format`)}if(s===void 0&&f===void 0)throw Error(`option creation failed due to no flags found in '${l}'.`);return{shortFlag:s,longFlag:f}}Vt.Option=gs;Vt.DualOptions=Us});var Ls=a((at)=>{function Ot(l,s){if(Math.abs(l.length-s.length)>3)return Math.max(l.length,s.length);let f=[];for(let y=0;y<=l.length;y++)f[y]=[y];for(let y=0;y<=s.length;y++)f[0][y]=y;for(let y=1;y<=s.length;y++)for(let i=1;i<=l.length;i++){let S=1;if(l[i-1]===s[y-1])S=0;else S=1;if(f[i][y]=Math.min(f[i-1][y]+1,f[i][y-1]+1,f[i-1][y-1]+S),i>1&&y>1&&l[i-1]===s[y-2]&&l[i-2]===s[y-1])f[i][y]=Math.min(f[i][y],f[i-2][y-2]+1)}return f[l.length][s.length]}function Ft(l,s){if(!s||s.length===0)return"";s=Array.from(new Set(s));let f=l.startsWith("--");if(f)l=l.slice(2),s=s.map((t)=>t.slice(2));let y=[],i=3,S=0.4;if(s.forEach((t)=>{if(t.length<=1)return;let $=Ot(l,t),c=Math.max(l.length,t.length);if((c-$)/c>S){if($<i)i=$,y=[t];else if($===i)y.push(t)}}),y.sort((t,$)=>t.localeCompare($)),f)y=y.map((t)=>`--${t}`);if(y.length>1)return`
|
|
13
|
+
(Did you mean one of ${y.join(", ")}?)`;if(y.length===1)return`
|
|
14
|
+
(Did you mean ${y[0]}?)`;return""}at.suggestSimilar=Ft});var _s=a((Dt)=>{var ot=il("node:events").EventEmitter,Ml=il("node:child_process"),v=il("node:path"),bl=il("node:fs"),B=il("node:process"),{Argument:mt,humanReadableArgName:ut}=cl(),{CommanderError:Hl}=Sl(),{Help:dt,stripColor:et}=Zl(),{Option:Rs,DualOptions:pt}=jl(),{suggestSimilar:Ts}=Ls();class Wl extends ot{constructor(l){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=l||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(s)=>B.stdout.write(s),writeErr:(s)=>B.stderr.write(s),outputError:(s,f)=>f(s),getOutHelpWidth:()=>B.stdout.isTTY?B.stdout.columns:void 0,getErrHelpWidth:()=>B.stderr.isTTY?B.stderr.columns:void 0,getOutHasColors:()=>Kl()??(B.stdout.isTTY&&B.stdout.hasColors?.()),getErrHasColors:()=>Kl()??(B.stderr.isTTY&&B.stderr.hasColors?.()),stripColor:(s)=>et(s)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(l){return this._outputConfiguration=l._outputConfiguration,this._helpOption=l._helpOption,this._helpCommand=l._helpCommand,this._helpConfiguration=l._helpConfiguration,this._exitCallback=l._exitCallback,this._storeOptionsAsProperties=l._storeOptionsAsProperties,this._combineFlagAndOptionalValue=l._combineFlagAndOptionalValue,this._allowExcessArguments=l._allowExcessArguments,this._enablePositionalOptions=l._enablePositionalOptions,this._showHelpAfterError=l._showHelpAfterError,this._showSuggestionAfterError=l._showSuggestionAfterError,this}_getCommandAndAncestors(){let l=[];for(let s=this;s;s=s.parent)l.push(s);return l}command(l,s,f){let y=s,i=f;if(typeof y==="object"&&y!==null)i=y,y=null;i=i||{};let[,S,t]=l.match(/([^ ]+) *(.*)/),$=this.createCommand(S);if(y)$.description(y),$._executableHandler=!0;if(i.isDefault)this._defaultCommandName=$._name;if($._hidden=!!(i.noHelp||i.hidden),$._executableFile=i.executableFile||null,t)$.arguments(t);if(this._registerCommand($),$.parent=this,$.copyInheritedSettings(this),y)return this;return $}createCommand(l){return new Wl(l)}createHelp(){return Object.assign(new dt,this.configureHelp())}configureHelp(l){if(l===void 0)return this._helpConfiguration;return this._helpConfiguration=l,this}configureOutput(l){if(l===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...l},this}showHelpAfterError(l=!0){if(typeof l!=="string")l=!!l;return this._showHelpAfterError=l,this}showSuggestionAfterError(l=!0){return this._showSuggestionAfterError=!!l,this}addCommand(l,s){if(!l._name)throw Error(`Command passed to .addCommand() must have a name
|
|
15
|
+
- specify the name in Command constructor or using .name()`);if(s=s||{},s.isDefault)this._defaultCommandName=l._name;if(s.noHelp||s.hidden)l._hidden=!0;return this._registerCommand(l),l.parent=this,l._checkForBrokenPassThrough(),this}createArgument(l,s){return new mt(l,s)}argument(l,s,f,y){let i=this.createArgument(l,s);if(typeof f==="function")i.default(y).argParser(f);else i.default(f);return this.addArgument(i),this}arguments(l){return l.trim().split(/ +/).forEach((s)=>{this.argument(s)}),this}addArgument(l){let s=this.registeredArguments.slice(-1)[0];if(s?.variadic)throw Error(`only the last argument can be variadic '${s.name()}'`);if(l.required&&l.defaultValue!==void 0&&l.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${l.name()}'`);return this.registeredArguments.push(l),this}helpCommand(l,s){if(typeof l==="boolean"){if(this._addImplicitHelpCommand=l,l&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let f=l??"help [command]",[,y,i]=f.match(/([^ ]+) *(.*)/),S=s??"display help for command",t=this.createCommand(y);if(t.helpOption(!1),i)t.arguments(i);if(S)t.description(S);if(this._addImplicitHelpCommand=!0,this._helpCommand=t,l||s)this._initCommandGroup(t);return this}addHelpCommand(l,s){if(typeof l!=="object")return this.helpCommand(l,s),this;return this._addImplicitHelpCommand=!0,this._helpCommand=l,this._initCommandGroup(l),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(l,s){let f=["preSubcommand","preAction","postAction"];if(!f.includes(l))throw Error(`Unexpected value for event passed to hook : '${l}'.
|
|
16
|
+
Expecting one of '${f.join("', '")}'`);if(this._lifeCycleHooks[l])this._lifeCycleHooks[l].push(s);else this._lifeCycleHooks[l]=[s];return this}exitOverride(l){if(l)this._exitCallback=l;else this._exitCallback=(s)=>{if(s.code!=="commander.executeSubCommandAsync")throw s};return this}_exit(l,s,f){if(this._exitCallback)this._exitCallback(new Hl(l,s,f));B.exit(l)}action(l){let s=(f)=>{let y=this.registeredArguments.length,i=f.slice(0,y);if(this._storeOptionsAsProperties)i[y]=this;else i[y]=this.opts();return i.push(this),l.apply(this,i)};return this._actionHandler=s,this}createOption(l,s){return new Rs(l,s)}_callParseArg(l,s,f,y){try{return l.parseArg(s,f)}catch(i){if(i.code==="commander.invalidArgument"){let S=`${y} ${i.message}`;this.error(S,{exitCode:i.exitCode,code:i.code})}throw i}}_registerOption(l){let s=l.short&&this._findOption(l.short)||l.long&&this._findOption(l.long);if(s){let f=l.long&&this._findOption(l.long)?l.long:l.short;throw Error(`Cannot add option '${l.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${f}'
|
|
17
|
+
- already used by option '${s.flags}'`)}this._initOptionGroup(l),this.options.push(l)}_registerCommand(l){let s=(y)=>{return[y.name()].concat(y.aliases())},f=s(l).find((y)=>this._findCommand(y));if(f){let y=s(this._findCommand(f)).join("|"),i=s(l).join("|");throw Error(`cannot add command '${i}' as already have command '${y}'`)}this._initCommandGroup(l),this.commands.push(l)}addOption(l){this._registerOption(l);let s=l.name(),f=l.attributeName();if(l.negate){let i=l.long.replace(/^--no-/,"--");if(!this._findOption(i))this.setOptionValueWithSource(f,l.defaultValue===void 0?!0:l.defaultValue,"default")}else if(l.defaultValue!==void 0)this.setOptionValueWithSource(f,l.defaultValue,"default");let y=(i,S,t)=>{if(i==null&&l.presetArg!==void 0)i=l.presetArg;let $=this.getOptionValue(f);if(i!==null&&l.parseArg)i=this._callParseArg(l,i,$,S);else if(i!==null&&l.variadic)i=l._collectValue(i,$);if(i==null)if(l.negate)i=!1;else if(l.isBoolean()||l.optional)i=!0;else i="";this.setOptionValueWithSource(f,i,t)};if(this.on("option:"+s,(i)=>{let S=`error: option '${l.flags}' argument '${i}' is invalid.`;y(i,S,"cli")}),l.envVar)this.on("optionEnv:"+s,(i)=>{let S=`error: option '${l.flags}' value '${i}' from env '${l.envVar}' is invalid.`;y(i,S,"env")});return this}_optionEx(l,s,f,y,i){if(typeof s==="object"&&s instanceof Rs)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let S=this.createOption(s,f);if(S.makeOptionMandatory(!!l.mandatory),typeof y==="function")S.default(i).argParser(y);else if(y instanceof RegExp){let t=y;y=($,c)=>{let k=t.exec($);return k?k[0]:c},S.default(i).argParser(y)}else S.default(y);return this.addOption(S)}option(l,s,f,y){return this._optionEx({},l,s,f,y)}requiredOption(l,s,f,y){return this._optionEx({mandatory:!0},l,s,f,y)}combineFlagAndOptionalValue(l=!0){return this._combineFlagAndOptionalValue=!!l,this}allowUnknownOption(l=!0){return this._allowUnknownOption=!!l,this}allowExcessArguments(l=!0){return this._allowExcessArguments=!!l,this}enablePositionalOptions(l=!0){return this._enablePositionalOptions=!!l,this}passThroughOptions(l=!0){return this._passThroughOptions=!!l,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(l=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!l,this}getOptionValue(l){if(this._storeOptionsAsProperties)return this[l];return this._optionValues[l]}setOptionValue(l,s){return this.setOptionValueWithSource(l,s,void 0)}setOptionValueWithSource(l,s,f){if(this._storeOptionsAsProperties)this[l]=s;else this._optionValues[l]=s;return this._optionValueSources[l]=f,this}getOptionValueSource(l){return this._optionValueSources[l]}getOptionValueSourceWithGlobals(l){let s;return this._getCommandAndAncestors().forEach((f)=>{if(f.getOptionValueSource(l)!==void 0)s=f.getOptionValueSource(l)}),s}_prepareUserArgs(l,s){if(l!==void 0&&!Array.isArray(l))throw Error("first parameter to parse must be array or undefined");if(s=s||{},l===void 0&&s.from===void 0){if(B.versions?.electron)s.from="electron";let y=B.execArgv??[];if(y.includes("-e")||y.includes("--eval")||y.includes("-p")||y.includes("--print"))s.from="eval"}if(l===void 0)l=B.argv;this.rawArgs=l.slice();let f;switch(s.from){case void 0:case"node":this._scriptPath=l[1],f=l.slice(2);break;case"electron":if(B.defaultApp)this._scriptPath=l[1],f=l.slice(2);else f=l.slice(1);break;case"user":f=l.slice(0);break;case"eval":f=l.slice(1);break;default:throw Error(`unexpected parse option { from: '${s.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",f}parse(l,s){this._prepareForParse();let f=this._prepareUserArgs(l,s);return this._parseCommand([],f),this}async parseAsync(l,s){this._prepareForParse();let f=this._prepareUserArgs(l,s);return await this._parseCommand([],f),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
18
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(l,s,f){if(bl.existsSync(l))return;let y=s?`searched for local subcommand relative to directory '${s}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",i=`'${l}' does not exist
|
|
19
|
+
- if '${f}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
20
20
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
21
|
-
- ${
|
|
21
|
+
- ${y}`;throw Error(i)}_executeSubCommand(l,s){s=s.slice();let f=!1,y=[".js",".ts",".tsx",".mjs",".cjs"];function i(k,b){let U=v.resolve(k,b);if(bl.existsSync(U))return U;if(y.includes(v.extname(b)))return;let w=y.find((n)=>bl.existsSync(`${U}${n}`));if(w)return`${U}${w}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let S=l._executableFile||`${this._name}-${l._name}`,t=this._executableDir||"";if(this._scriptPath){let k;try{k=bl.realpathSync(this._scriptPath)}catch{k=this._scriptPath}t=v.resolve(v.dirname(k),t)}if(t){let k=i(t,S);if(!k&&!l._executableFile&&this._scriptPath){let b=v.basename(this._scriptPath,v.extname(this._scriptPath));if(b!==this._name)k=i(t,`${b}-${l._name}`)}S=k||S}f=y.includes(v.extname(S));let $;if(B.platform!=="win32")if(f)s.unshift(S),s=Bs(B.execArgv).concat(s),$=Ml.spawn(B.argv[0],s,{stdio:"inherit"});else $=Ml.spawn(S,s,{stdio:"inherit"});else this._checkForMissingExecutable(S,t,l._name),s.unshift(S),s=Bs(B.execArgv).concat(s),$=Ml.spawn(B.execPath,s,{stdio:"inherit"});if(!$.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((b)=>{B.on(b,()=>{if($.killed===!1&&$.exitCode===null)$.kill(b)})});let c=this._exitCallback;$.on("close",(k)=>{if(k=k??1,!c)B.exit(k);else c(new Hl(k,"commander.executeSubCommandAsync","(close)"))}),$.on("error",(k)=>{if(k.code==="ENOENT")this._checkForMissingExecutable(S,t,l._name);else if(k.code==="EACCES")throw Error(`'${S}' not executable`);if(!c)B.exit(1);else{let b=new Hl(1,"commander.executeSubCommandAsync","(error)");b.nestedError=k,c(b)}}),this.runningCommand=$}_dispatchSubcommand(l,s,f){let y=this._findCommand(l);if(!y)this.help({error:!0});y._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,y,"preSubcommand"),i=this._chainOrCall(i,()=>{if(y._executableHandler)this._executeSubCommand(y,s.concat(f));else return y._parseCommand(s,f)}),i}_dispatchHelpCommand(l){if(!l)this.help();let s=this._findCommand(l);if(s&&!s._executableHandler)s.help();return this._dispatchSubcommand(l,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((l,s)=>{if(l.required&&this.args[s]==null)this.missingArgument(l.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let l=(f,y,i)=>{let S=y;if(y!==null&&f.parseArg){let t=`error: command-argument value '${y}' is invalid for argument '${f.name()}'.`;S=this._callParseArg(f,y,i,t)}return S};this._checkNumberOfArguments();let s=[];this.registeredArguments.forEach((f,y)=>{let i=f.defaultValue;if(f.variadic){if(y<this.args.length){if(i=this.args.slice(y),f.parseArg)i=i.reduce((S,t)=>{return l(f,t,S)},f.defaultValue)}else if(i===void 0)i=[]}else if(y<this.args.length){if(i=this.args[y],f.parseArg)i=l(f,i,f.defaultValue)}s[y]=i}),this.processedArgs=s}_chainOrCall(l,s){if(l?.then&&typeof l.then==="function")return l.then(()=>s());return s()}_chainOrCallHooks(l,s){let f=l,y=[];if(this._getCommandAndAncestors().reverse().filter((i)=>i._lifeCycleHooks[s]!==void 0).forEach((i)=>{i._lifeCycleHooks[s].forEach((S)=>{y.push({hookedCommand:i,callback:S})})}),s==="postAction")y.reverse();return y.forEach((i)=>{f=this._chainOrCall(f,()=>{return i.callback(i.hookedCommand,this)})}),f}_chainOrCallSubCommandHook(l,s,f){let y=l;if(this._lifeCycleHooks[f]!==void 0)this._lifeCycleHooks[f].forEach((i)=>{y=this._chainOrCall(y,()=>{return i(this,s)})});return y}_parseCommand(l,s){let f=this.parseOptions(s);if(this._parseOptionsEnv(),this._parseOptionsImplied(),l=l.concat(f.operands),s=f.unknown,this.args=l.concat(s),l&&this._findCommand(l[0]))return this._dispatchSubcommand(l[0],l.slice(1),s);if(this._getHelpCommand()&&l[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(l[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(s),this._dispatchSubcommand(this._defaultCommandName,l,s);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(f.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let y=()=>{if(f.unknown.length>0)this.unknownOption(f.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){y(),this._processArguments();let S;if(S=this._chainOrCallHooks(S,"preAction"),S=this._chainOrCall(S,()=>this._actionHandler(this.processedArgs)),this.parent)S=this._chainOrCall(S,()=>{this.parent.emit(i,l,s)});return S=this._chainOrCallHooks(S,"postAction"),S}if(this.parent?.listenerCount(i))y(),this._processArguments(),this.parent.emit(i,l,s);else if(l.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",l,s);if(this.listenerCount("command:*"))this.emit("command:*",l,s);else if(this.commands.length)this.unknownCommand();else y(),this._processArguments()}else if(this.commands.length)y(),this.help({error:!0});else y(),this._processArguments()}_findCommand(l){if(!l)return;return this.commands.find((s)=>s._name===l||s._aliases.includes(l))}_findOption(l){return this.options.find((s)=>s.is(l))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((l)=>{l.options.forEach((s)=>{if(s.mandatory&&l.getOptionValue(s.attributeName())===void 0)l.missingMandatoryOptionValue(s)})})}_checkForConflictingLocalOptions(){let l=this.options.filter((f)=>{let y=f.attributeName();if(this.getOptionValue(y)===void 0)return!1;return this.getOptionValueSource(y)!=="default"});l.filter((f)=>f.conflictsWith.length>0).forEach((f)=>{let y=l.find((i)=>f.conflictsWith.includes(i.attributeName()));if(y)this._conflictingOption(f,y)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((l)=>{l._checkForConflictingLocalOptions()})}parseOptions(l){let s=[],f=[],y=s;function i(k){return k.length>1&&k[0]==="-"}let S=(k)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(k))return!1;return!this._getCommandAndAncestors().some((b)=>b.options.map((U)=>U.short).some((U)=>/^-\d$/.test(U)))},t=null,$=null,c=0;while(c<l.length||$){let k=$??l[c++];if($=null,k==="--"){if(y===f)y.push(k);y.push(...l.slice(c));break}if(t&&(!i(k)||S(k))){this.emit(`option:${t.name()}`,k);continue}if(t=null,i(k)){let b=this._findOption(k);if(b){if(b.required){let U=l[c++];if(U===void 0)this.optionMissingArgument(b);this.emit(`option:${b.name()}`,U)}else if(b.optional){let U=null;if(c<l.length&&(!i(l[c])||S(l[c])))U=l[c++];this.emit(`option:${b.name()}`,U)}else this.emit(`option:${b.name()}`);t=b.variadic?b:null;continue}}if(k.length>2&&k[0]==="-"&&k[1]!=="-"){let b=this._findOption(`-${k[1]}`);if(b){if(b.required||b.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${b.name()}`,k.slice(2));else this.emit(`option:${b.name()}`),$=`-${k.slice(2)}`;continue}}if(/^--[^=]+=/.test(k)){let b=k.indexOf("="),U=this._findOption(k.slice(0,b));if(U&&(U.required||U.optional)){this.emit(`option:${U.name()}`,k.slice(b+1));continue}}if(y===s&&i(k)&&!(this.commands.length===0&&S(k)))y=f;if((this._enablePositionalOptions||this._passThroughOptions)&&s.length===0&&f.length===0){if(this._findCommand(k)){s.push(k),f.push(...l.slice(c));break}else if(this._getHelpCommand()&&k===this._getHelpCommand().name()){s.push(k,...l.slice(c));break}else if(this._defaultCommandName){f.push(k,...l.slice(c));break}}if(this._passThroughOptions){y.push(k,...l.slice(c));break}y.push(k)}return{operands:s,unknown:f}}opts(){if(this._storeOptionsAsProperties){let l={},s=this.options.length;for(let f=0;f<s;f++){let y=this.options[f].attributeName();l[y]=y===this._versionOptionName?this._version:this[y]}return l}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((l,s)=>Object.assign(l,s.opts()),{})}error(l,s){if(this._outputConfiguration.outputError(`${l}
|
|
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 S,$="127.0.0.1",k="9229",b;if((b=y.match(/^(--inspect(-brk)?)$/))!==null)S=b[1];else if((b=y.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(S=b[1],/^\d+$/.test(b[3]))k=b[3];else $=b[3];else if((b=y.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)S=b[1],$=b[3],k=b[4];if(S&&k!=="0")return`${S}=${$}:${parseInt(k)+1}`;return y})}function ql(){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=Ll;My.useColor=ql});var el=V((Ny)=>{var{Argument:pl}=t(),{Command:_l}=rl(),{CommanderError:wy,InvalidArgumentError:al}=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 pl(l,y);Ny.Command=_l;Ny.Option=ol;Ny.Argument=pl;Ny.Help=Wy;Ny.CommanderError=wy;Ny.InvalidArgumentError=al;Ny.InvalidOptionArgumentError=al});var Yl=V((PS,y1)=>{var Gl={to(l,y){if(!y)return`\x1B[${l+1}G`;return`\x1B[${y+1};${l+1}H`},move(l,y){let S="";if(l<0)S+=`\x1B[${-l}D`;else if(l>0)S+=`\x1B[${l}C`;if(y<0)S+=`\x1B[${-y}A`;else if(y>0)S+=`\x1B[${y}B`;return S},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 S=0;S<l;S++)y+=this.line+(S<l-1?Gl.up():"");if(l)y+=Gl.left;return y}};y1.exports={cursor:Gl,scroll:sy,erase:iy,beep:"\x07"}});var a=V((US,Xl)=>{var p=process||{},f1=p.argv||[],r=p.env||{},my=!(!!r.NO_COLOR||f1.includes("--no-color"))&&(!!r.FORCE_COLOR||f1.includes("--color")||p.platform==="win32"||(p.stdout||{}).isTTY&&r.TERM!=="dumb"||!!r.CI),Dy=(l,y,S=l)=>($)=>{let k=""+$,b=k.indexOf(y,l.length);return~b?l+ny(k,y,S,b)+y:l+k+y},ny=(l,y,S,$)=>{let k="",b=0;do k+=l.substring(b,$)+S,b=$+y.length,$=l.indexOf(y,b);while(~$);return k+l.substring(b)},S1=(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=S1();Xl.exports.createColors=S1});var l1=g(el(),1),{program:Jl,createCommand:BS,createArgument:qS,createOption:LS,CommanderError:_S,InvalidArgumentError:JS,InvalidOptionArgumentError:GS,Command:YS,Argument:XS,Option:zS,Help:QS}=l1.default;var M=g(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 uy}from"node:stream";function ty({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=ty();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,f=k;return 55296<=k&&k<=56319&&56320<=b&&b<=57343&&(k&=1023,b&=1023,f=k<<10|b,f+=65536),f==12288||65281<=f&&f<=65376||65504<=f&&f<=65510?"F":f==8361||65377<=f&&f<=65470||65474<=f&&f<=65479||65482<=f&&f<=65487||65490<=f&&f<=65495||65498<=f&&f<=65500||65512<=f&&f<=65518?"H":4352<=f&&f<=4447||4515<=f&&f<=4519||4602<=f&&f<=4607||9001<=f&&f<=9002||11904<=f&&f<=11929||11931<=f&&f<=12019||12032<=f&&f<=12245||12272<=f&&f<=12283||12289<=f&&f<=12350||12353<=f&&f<=12438||12441<=f&&f<=12543||12549<=f&&f<=12589||12593<=f&&f<=12686||12688<=f&&f<=12730||12736<=f&&f<=12771||12784<=f&&f<=12830||12832<=f&&f<=12871||12880<=f&&f<=13054||13056<=f&&f<=19903||19968<=f&&f<=42124||42128<=f&&f<=42182||43360<=f&&f<=43388||44032<=f&&f<=55203||55216<=f&&f<=55238||55243<=f&&f<=55291||63744<=f&&f<=64255||65040<=f&&f<=65049||65072<=f&&f<=65106||65108<=f&&f<=65126||65128<=f&&f<=65131||110592<=f&&f<=110593||127488<=f&&f<=127490||127504<=f&&f<=127546||127552<=f&&f<=127560||127568<=f&&f<=127569||131072<=f&&f<=194367||177984<=f&&f<=196605||196608<=f&&f<=262141?"W":32<=f&&f<=126||162<=f&&f<=163||165<=f&&f<=166||f==172||f==175||10214<=f&&f<=10221||10629<=f&&f<=10630?"Na":f==161||f==164||167<=f&&f<=168||f==170||173<=f&&f<=174||176<=f&&f<=180||182<=f&&f<=186||188<=f&&f<=191||f==198||f==208||215<=f&&f<=216||222<=f&&f<=225||f==230||232<=f&&f<=234||236<=f&&f<=237||f==240||242<=f&&f<=243||247<=f&&f<=250||f==252||f==254||f==257||f==273||f==275||f==283||294<=f&&f<=295||f==299||305<=f&&f<=307||f==312||319<=f&&f<=322||f==324||328<=f&&f<=331||f==333||338<=f&&f<=339||358<=f&&f<=359||f==363||f==462||f==464||f==466||f==468||f==470||f==472||f==474||f==476||f==593||f==609||f==708||f==711||713<=f&&f<=715||f==717||f==720||728<=f&&f<=731||f==733||f==735||768<=f&&f<=879||913<=f&&f<=929||931<=f&&f<=937||945<=f&&f<=961||963<=f&&f<=969||f==1025||1040<=f&&f<=1103||f==1105||f==8208||8211<=f&&f<=8214||8216<=f&&f<=8217||8220<=f&&f<=8221||8224<=f&&f<=8226||8228<=f&&f<=8231||f==8240||8242<=f&&f<=8243||f==8245||f==8251||f==8254||f==8308||f==8319||8321<=f&&f<=8324||f==8364||f==8451||f==8453||f==8457||f==8467||f==8470||8481<=f&&f<=8482||f==8486||f==8491||8531<=f&&f<=8532||8539<=f&&f<=8542||8544<=f&&f<=8555||8560<=f&&f<=8569||f==8585||8592<=f&&f<=8601||8632<=f&&f<=8633||f==8658||f==8660||f==8679||f==8704||8706<=f&&f<=8707||8711<=f&&f<=8712||f==8715||f==8719||f==8721||f==8725||f==8730||8733<=f&&f<=8736||f==8739||f==8741||8743<=f&&f<=8748||f==8750||8756<=f&&f<=8759||8764<=f&&f<=8765||f==8776||f==8780||f==8786||8800<=f&&f<=8801||8804<=f&&f<=8807||8810<=f&&f<=8811||8814<=f&&f<=8815||8834<=f&&f<=8835||8838<=f&&f<=8839||f==8853||f==8857||f==8869||f==8895||f==8978||9312<=f&&f<=9449||9451<=f&&f<=9547||9552<=f&&f<=9587||9600<=f&&f<=9615||9618<=f&&f<=9621||9632<=f&&f<=9633||9635<=f&&f<=9641||9650<=f&&f<=9651||9654<=f&&f<=9655||9660<=f&&f<=9661||9664<=f&&f<=9665||9670<=f&&f<=9672||f==9675||9678<=f&&f<=9681||9698<=f&&f<=9701||f==9711||9733<=f&&f<=9734||f==9737||9742<=f&&f<=9743||9748<=f&&f<=9749||f==9756||f==9758||f==9792||f==9794||9824<=f&&f<=9825||9827<=f&&f<=9829||9831<=f&&f<=9834||9836<=f&&f<=9837||f==9839||9886<=f&&f<=9887||9918<=f&&f<=9919||9924<=f&&f<=9933||9935<=f&&f<=9953||f==9955||9960<=f&&f<=9983||f==10045||f==10071||10102<=f&&f<=10111||11093<=f&&f<=11097||12872<=f&&f<=12879||57344<=f&&f<=63743||65024<=f&&f<=65039||f==65533||127232<=f&&f<=127242||127248<=f&&f<=127277||127280<=f&&f<=127337||127344<=f&&f<=127386||917760<=f&&f<=917999||983040<=f&&f<=1048573||1048576<=f&&f<=1114109?"A":"N"},y.characterLength=function($){var k=this.eastAsianWidth($);return k=="F"||k=="W"||k=="A"?2:1};function S($){return $.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}y.length=function($){for(var k=S($),b=0,f=0;f<k.length;f++)b=b+this.characterLength(k[f]);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 f="",I=0,T=S($),R=0;R<T.length;R++){var B=T[R],L=y.length(B);if(I>=k-(L==2?1:0))if(I+L<=b)f+=B;else break;I+=L}return f}})(X1);var ry=X1.exports,py=Y1(ry),ay=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(ay);function u(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 S=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(py.eastAsianWidth(k)){case"F":case"W":$+=2;break;case"A":$+=S;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,S,$)=>`\x1B[${38+l};2;${y};${S};${$}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),lf=Object.keys(Z.bgColor);[...ey,...lf];function yf(){let l=new Map;for(let[y,S]of Object.entries(Z)){for(let[$,k]of Object.entries(S))Z[$]={open:`\x1B[${k[0]}m`,close:`\x1B[${k[1]}m`},S[$]=Z[$],l.set(k[0],k[1]);Object.defineProperty(Z,y,{value:S,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,S,$)=>y===S&&S===$?y<8?16:y>248?231:Math.round((y-8)/247*24)+232:16+36*Math.round(y/255*5)+6*Math.round(S/255*5)+Math.round($/255*5),enumerable:!1},hexToRgb:{value:(y)=>{let S=/[a-f\d]{6}|[a-f\d]{3}/i.exec(y.toString(16));if(!S)return[0,0,0];let[$]=S;$.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 S,$,k;if(y>=232)S=((y-232)*10+8)/255,$=S,k=S;else{y-=16;let I=y%36;S=Math.floor(y/36)/5,$=Math.floor(I/6)/5,k=I%6/5}let b=Math.max(S,$,k)*2;if(b===0)return 30;let f=30+(Math.round(k)<<2|Math.round($)<<1|Math.round(S));return b===2&&(f+=60),f},enumerable:!1},rgbToAnsi:{value:(y,S,$)=>Z.ansi256ToAnsi(Z.rgbToAnsi256(y,S,$)),enumerable:!1},hexToAnsi:{value:(y)=>Z.ansi256ToAnsi(Z.hexToAnsi256(y)),enumerable:!1}}),Z}var ff=yf(),ll=new Set(["\x1B",""]),Sf=39,Pl="\x07",z1="[",$f="]",Q1="m",Ul=`${$f}8;;`,R1=(l)=>`${ll.values().next().value}${z1}${l}${Q1}`,T1=(l)=>`${ll.values().next().value}${Ul}${l}${Pl}`,kf=(l)=>l.split(" ").map((y)=>u(y)),Ql=(l,y,S)=>{let $=[...y],k=!1,b=!1,f=u(G1(l[l.length-1]));for(let[I,T]of $.entries()){let R=u(T);if(f+R<=S?l[l.length-1]+=T:(l.push(T),f=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}f+=R,f===S&&I<$.length-1&&(l.push(""),f=0)}!f&&l[l.length-1].length>0&&l.length>1&&(l[l.length-2]+=l.pop())},bf=(l)=>{let y=l.split(" "),S=y.length;for(;S>0&&!(u(y[S-1])>0);)S--;return S===y.length?l:y.slice(0,S).join(" ")+y.slice(S).join("")},If=(l,y,S={})=>{if(S.trim!==!1&&l.trim()==="")return"";let $="",k,b,f=kf(l),I=[""];for(let[R,B]of l.split(" ").entries()){S.trim!==!1&&(I[I.length-1]=I[I.length-1].trimStart());let L=u(I[I.length-1]);if(R!==0&&(L>=y&&(S.wordWrap===!1||S.trim===!1)&&(I.push(""),L=0),(L>0||S.trim===!1)&&(I[I.length-1]+=" ",L++)),S.hard&&f[R]>y){let X=y-L,P=1+Math.floor((f[R]-X-1)/y);Math.floor((f[R]-1)/y)<P&&I.push(""),Ql(I,B,y);continue}if(L+f[R]>y&&L>0&&f[R]>0){if(S.wordWrap===!1&&L<y){Ql(I,B,y);continue}I.push("")}if(L+f[R]>y&&S.wordWrap===!1){Ql(I,B,y);continue}I[I.length-1]+=B}S.trim!==!1&&(I=I.map((R)=>bf(R)));let T=[...I.join(`
|
|
28
|
-
`)];for(let[
|
|
29
|
-
`?(
|
|
30
|
-
`&&(
|
|
24
|
+
`),this.outputHelp({error:!0});let f=s||{},y=f.exitCode||1,i=f.code||"commander.error";this._exit(y,i,l)}_parseOptionsEnv(){this.options.forEach((l)=>{if(l.envVar&&l.envVar in B.env){let s=l.attributeName();if(this.getOptionValue(s)===void 0||["default","config","env"].includes(this.getOptionValueSource(s)))if(l.required||l.optional)this.emit(`optionEnv:${l.name()}`,B.env[l.envVar]);else this.emit(`optionEnv:${l.name()}`)}})}_parseOptionsImplied(){let l=new pt(this.options),s=(f)=>{return this.getOptionValue(f)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(f))};this.options.filter((f)=>f.implied!==void 0&&s(f.attributeName())&&l.valueFromOption(this.getOptionValue(f.attributeName()),f)).forEach((f)=>{Object.keys(f.implied).filter((y)=>!s(y)).forEach((y)=>{this.setOptionValueWithSource(y,f.implied[y],"implied")})})}missingArgument(l){let s=`error: missing required argument '${l}'`;this.error(s,{code:"commander.missingArgument"})}optionMissingArgument(l){let s=`error: option '${l.flags}' argument missing`;this.error(s,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(l){let s=`error: required option '${l.flags}' not specified`;this.error(s,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(l,s){let f=(S)=>{let t=S.attributeName(),$=this.getOptionValue(t),c=this.options.find((b)=>b.negate&&t===b.attributeName()),k=this.options.find((b)=>!b.negate&&t===b.attributeName());if(c&&(c.presetArg===void 0&&$===!1||c.presetArg!==void 0&&$===c.presetArg))return c;return k||S},y=(S)=>{let t=f(S),$=t.attributeName();if(this.getOptionValueSource($)==="env")return`environment variable '${t.envVar}'`;return`option '${t.flags}'`},i=`error: ${y(l)} cannot be used with ${y(s)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(l){if(this._allowUnknownOption)return;let s="";if(l.startsWith("--")&&this._showSuggestionAfterError){let y=[],i=this;do{let S=i.createHelp().visibleOptions(i).filter((t)=>t.long).map((t)=>t.long);y=y.concat(S),i=i.parent}while(i&&!i._enablePositionalOptions);s=Ts(l,y)}let f=`error: unknown option '${l}'${s}`;this.error(f,{code:"commander.unknownOption"})}_excessArguments(l){if(this._allowExcessArguments)return;let s=this.registeredArguments.length,f=s===1?"":"s",i=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${s} argument${f} but got ${l.length}.`;this.error(i,{code:"commander.excessArguments"})}unknownCommand(){let l=this.args[0],s="";if(this._showSuggestionAfterError){let y=[];this.createHelp().visibleCommands(this).forEach((i)=>{if(y.push(i.name()),i.alias())y.push(i.alias())}),s=Ts(l,y)}let f=`error: unknown command '${l}'${s}`;this.error(f,{code:"commander.unknownCommand"})}version(l,s,f){if(l===void 0)return this._version;this._version=l,s=s||"-V, --version",f=f||"output the version number";let y=this.createOption(s,f);return this._versionOptionName=y.attributeName(),this._registerOption(y),this.on("option:"+y.name(),()=>{this._outputConfiguration.writeOut(`${l}
|
|
25
|
+
`),this._exit(0,"commander.version",l)}),this}description(l,s){if(l===void 0&&s===void 0)return this._description;if(this._description=l,s)this._argsDescription=s;return this}summary(l){if(l===void 0)return this._summary;return this._summary=l,this}alias(l){if(l===void 0)return this._aliases[0];let s=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)s=this.commands[this.commands.length-1];if(l===s._name)throw Error("Command alias can't be the same as its name");let f=this.parent?._findCommand(l);if(f){let y=[f.name()].concat(f.aliases()).join("|");throw Error(`cannot add alias '${l}' to command '${this.name()}' as already have command '${y}'`)}return s._aliases.push(l),this}aliases(l){if(l===void 0)return this._aliases;return l.forEach((s)=>this.alias(s)),this}usage(l){if(l===void 0){if(this._usage)return this._usage;let s=this.registeredArguments.map((f)=>{return ut(f)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?s:[]).join(" ")}return this._usage=l,this}name(l){if(l===void 0)return this._name;return this._name=l,this}helpGroup(l){if(l===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=l,this}commandsGroup(l){if(l===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=l,this}optionsGroup(l){if(l===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=l,this}_initOptionGroup(l){if(this._defaultOptionGroup&&!l.helpGroupHeading)l.helpGroup(this._defaultOptionGroup)}_initCommandGroup(l){if(this._defaultCommandGroup&&!l.helpGroup())l.helpGroup(this._defaultCommandGroup)}nameFromFilename(l){return this._name=v.basename(l,v.extname(l)),this}executableDir(l){if(l===void 0)return this._executableDir;return this._executableDir=l,this}helpInformation(l){let s=this.createHelp(),f=this._getOutputContext(l);s.prepareContext({error:f.error,helpWidth:f.helpWidth,outputHasColors:f.hasColors});let y=s.formatHelp(this,s);if(f.hasColors)return y;return this._outputConfiguration.stripColor(y)}_getOutputContext(l){l=l||{};let s=!!l.error,f,y,i;if(s)f=(t)=>this._outputConfiguration.writeErr(t),y=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth();else f=(t)=>this._outputConfiguration.writeOut(t),y=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth();return{error:s,write:(t)=>{if(!y)t=this._outputConfiguration.stripColor(t);return f(t)},hasColors:y,helpWidth:i}}outputHelp(l){let s;if(typeof l==="function")s=l,l=void 0;let f=this._getOutputContext(l),y={error:f.error,write:f.write,command:this};this._getCommandAndAncestors().reverse().forEach((S)=>S.emit("beforeAllHelp",y)),this.emit("beforeHelp",y);let i=this.helpInformation({error:f.error});if(s){if(i=s(i),typeof i!=="string"&&!Buffer.isBuffer(i))throw Error("outputHelp callback must return a string or a Buffer")}if(f.write(i),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",y),this._getCommandAndAncestors().forEach((S)=>S.emit("afterAllHelp",y))}helpOption(l,s){if(typeof l==="boolean"){if(l){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption(l??"-h, --help",s??"display help for command"),l||s)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(l){return this._helpOption=l,this._initOptionGroup(l),this}help(l){this.outputHelp(l);let s=Number(B.exitCode??0);if(s===0&&l&&typeof l!=="function"&&l.error)s=1;this._exit(s,"commander.help","(outputHelp)")}addHelpText(l,s){let f=["beforeAll","before","after","afterAll"];if(!f.includes(l))throw Error(`Unexpected value for position to addHelpText.
|
|
26
|
+
Expecting one of '${f.join("', '")}'`);let y=`${l}Help`;return this.on(y,(i)=>{let S;if(typeof s==="function")S=s({error:i.error,command:i.command});else S=s;if(S)i.write(`${S}
|
|
27
|
+
`)}),this}_outputHelpIfRequested(l){let s=this._getHelpOption();if(s&&l.find((y)=>s.is(y)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function Bs(l){return l.map((s)=>{if(!s.startsWith("--inspect"))return s;let f,y="127.0.0.1",i="9229",S;if((S=s.match(/^(--inspect(-brk)?)$/))!==null)f=S[1];else if((S=s.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(f=S[1],/^\d+$/.test(S[3]))i=S[3];else y=S[3];else if((S=s.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)f=S[1],y=S[3],i=S[4];if(f&&i!=="0")return`${f}=${y}:${parseInt(i)+1}`;return s})}function Kl(){if(B.env.NO_COLOR||B.env.FORCE_COLOR==="0"||B.env.FORCE_COLOR==="false")return!1;if(B.env.FORCE_COLOR||B.env.CLICOLOR_FORCE!==void 0)return!0;return}Dt.Command=Wl;Dt.useColor=Kl});var Ps=a((yf)=>{var{Argument:qs}=cl(),{Command:El}=_s(),{CommanderError:tf,InvalidArgumentError:rs}=Sl(),{Help:ff}=Zl(),{Option:Js}=jl();yf.program=new El;yf.createCommand=(l)=>new El(l);yf.createOption=(l,s)=>new Js(l,s);yf.createArgument=(l,s)=>new qs(l,s);yf.Command=El;yf.Option=Js;yf.Argument=qs;yf.Help=ff;yf.CommanderError=tf;yf.InvalidArgumentError=rs;yf.InvalidOptionArgumentError=rs});var Cl=a((ci,Gs)=>{var xl={to(l,s){if(!s)return`\x1B[${l+1}G`;return`\x1B[${s+1};${l+1}H`},move(l,s){let f="";if(l<0)f+=`\x1B[${-l}D`;else if(l>0)f+=`\x1B[${l}C`;if(s<0)f+=`\x1B[${-s}A`;else if(s>0)f+=`\x1B[${s}B`;return f},up:(l=1)=>`\x1B[${l}A`,down:(l=1)=>`\x1B[${l}B`,forward:(l=1)=>`\x1B[${l}C`,backward:(l=1)=>`\x1B[${l}D`,nextLine:(l=1)=>"\x1B[E".repeat(l),prevLine:(l=1)=>"\x1B[F".repeat(l),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},Rf={up:(l=1)=>"\x1B[S".repeat(l),down:(l=1)=>"\x1B[T".repeat(l)},Tf={screen:"\x1B[2J",up:(l=1)=>"\x1B[1J".repeat(l),down:(l=1)=>"\x1B[J".repeat(l),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(l){let s="";for(let f=0;f<l;f++)s+=this.line+(f<l-1?xl.up():"");if(l)s+=xl.left;return s}};Gs.exports={cursor:xl,scroll:Rf,erase:Tf,beep:"\x07"}});var sl=a((bi,Nl)=>{var Il=process||{},Xs=Il.argv||[],nl=Il.env||{},Bf=!(!!nl.NO_COLOR||Xs.includes("--no-color"))&&(!!nl.FORCE_COLOR||Xs.includes("--color")||Il.platform==="win32"||(Il.stdout||{}).isTTY&&nl.TERM!=="dumb"||!!nl.CI),_f=(l,s,f=l)=>(y)=>{let i=""+y,S=i.indexOf(s,l.length);return~S?l+qf(i,s,f,S)+s:l+i+s},qf=(l,s,f,y)=>{let i="",S=0;do i+=l.substring(S,y)+f,S=y+s.length,y=l.indexOf(s,S);while(~y);return i+l.substring(S)},zs=(l=Bf)=>{let s=l?_f:()=>String;return{isColorSupported:l,reset:s("\x1B[0m","\x1B[0m"),bold:s("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:s("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:s("\x1B[3m","\x1B[23m"),underline:s("\x1B[4m","\x1B[24m"),inverse:s("\x1B[7m","\x1B[27m"),hidden:s("\x1B[8m","\x1B[28m"),strikethrough:s("\x1B[9m","\x1B[29m"),black:s("\x1B[30m","\x1B[39m"),red:s("\x1B[31m","\x1B[39m"),green:s("\x1B[32m","\x1B[39m"),yellow:s("\x1B[33m","\x1B[39m"),blue:s("\x1B[34m","\x1B[39m"),magenta:s("\x1B[35m","\x1B[39m"),cyan:s("\x1B[36m","\x1B[39m"),white:s("\x1B[37m","\x1B[39m"),gray:s("\x1B[90m","\x1B[39m"),bgBlack:s("\x1B[40m","\x1B[49m"),bgRed:s("\x1B[41m","\x1B[49m"),bgGreen:s("\x1B[42m","\x1B[49m"),bgYellow:s("\x1B[43m","\x1B[49m"),bgBlue:s("\x1B[44m","\x1B[49m"),bgMagenta:s("\x1B[45m","\x1B[49m"),bgCyan:s("\x1B[46m","\x1B[49m"),bgWhite:s("\x1B[47m","\x1B[49m"),blackBright:s("\x1B[90m","\x1B[39m"),redBright:s("\x1B[91m","\x1B[39m"),greenBright:s("\x1B[92m","\x1B[39m"),yellowBright:s("\x1B[93m","\x1B[39m"),blueBright:s("\x1B[94m","\x1B[39m"),magentaBright:s("\x1B[95m","\x1B[39m"),cyanBright:s("\x1B[96m","\x1B[39m"),whiteBright:s("\x1B[97m","\x1B[39m"),bgBlackBright:s("\x1B[100m","\x1B[49m"),bgRedBright:s("\x1B[101m","\x1B[49m"),bgGreenBright:s("\x1B[102m","\x1B[49m"),bgYellowBright:s("\x1B[103m","\x1B[49m"),bgBlueBright:s("\x1B[104m","\x1B[49m"),bgMagentaBright:s("\x1B[105m","\x1B[49m"),bgCyanBright:s("\x1B[106m","\x1B[49m"),bgWhiteBright:s("\x1B[107m","\x1B[49m")}};Nl.exports=zs();Nl.exports.createColors=zs});var Ys=d(Ps(),1),{program:e,createCommand:py,createArgument:Dy,createOption:li,CommanderError:si,InvalidArgumentError:ti,InvalidOptionArgumentError:fi,Command:yi,Argument:ii,Option:Si,Help:$i}=Ys.default;var H=d(Cl(),1);import{stdin as Cs,stdout as Ns}from"node:process";import*as p from"node:readline";import Qs from"node:readline";import{Writable as rf}from"node:stream";function Jf({onlyFirst:l=!1}={}){let s=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(s,l?void 0:"g")}var Pf=Jf();function Vs(l){if(typeof l!="string")throw TypeError(`Expected a \`string\`, got \`${typeof l}\``);return l.replace(Pf,"")}function As(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var hs={exports:{}};(function(l){var s={};l.exports=s,s.eastAsianWidth=function(y){var i=y.charCodeAt(0),S=y.length==2?y.charCodeAt(1):0,t=i;return 55296<=i&&i<=56319&&56320<=S&&S<=57343&&(i&=1023,S&=1023,t=i<<10|S,t+=65536),t==12288||65281<=t&&t<=65376||65504<=t&&t<=65510?"F":t==8361||65377<=t&&t<=65470||65474<=t&&t<=65479||65482<=t&&t<=65487||65490<=t&&t<=65495||65498<=t&&t<=65500||65512<=t&&t<=65518?"H":4352<=t&&t<=4447||4515<=t&&t<=4519||4602<=t&&t<=4607||9001<=t&&t<=9002||11904<=t&&t<=11929||11931<=t&&t<=12019||12032<=t&&t<=12245||12272<=t&&t<=12283||12289<=t&&t<=12350||12353<=t&&t<=12438||12441<=t&&t<=12543||12549<=t&&t<=12589||12593<=t&&t<=12686||12688<=t&&t<=12730||12736<=t&&t<=12771||12784<=t&&t<=12830||12832<=t&&t<=12871||12880<=t&&t<=13054||13056<=t&&t<=19903||19968<=t&&t<=42124||42128<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||55216<=t&&t<=55238||55243<=t&&t<=55291||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65106||65108<=t&&t<=65126||65128<=t&&t<=65131||110592<=t&&t<=110593||127488<=t&&t<=127490||127504<=t&&t<=127546||127552<=t&&t<=127560||127568<=t&&t<=127569||131072<=t&&t<=194367||177984<=t&&t<=196605||196608<=t&&t<=262141?"W":32<=t&&t<=126||162<=t&&t<=163||165<=t&&t<=166||t==172||t==175||10214<=t&&t<=10221||10629<=t&&t<=10630?"Na":t==161||t==164||167<=t&&t<=168||t==170||173<=t&&t<=174||176<=t&&t<=180||182<=t&&t<=186||188<=t&&t<=191||t==198||t==208||215<=t&&t<=216||222<=t&&t<=225||t==230||232<=t&&t<=234||236<=t&&t<=237||t==240||242<=t&&t<=243||247<=t&&t<=250||t==252||t==254||t==257||t==273||t==275||t==283||294<=t&&t<=295||t==299||305<=t&&t<=307||t==312||319<=t&&t<=322||t==324||328<=t&&t<=331||t==333||338<=t&&t<=339||358<=t&&t<=359||t==363||t==462||t==464||t==466||t==468||t==470||t==472||t==474||t==476||t==593||t==609||t==708||t==711||713<=t&&t<=715||t==717||t==720||728<=t&&t<=731||t==733||t==735||768<=t&&t<=879||913<=t&&t<=929||931<=t&&t<=937||945<=t&&t<=961||963<=t&&t<=969||t==1025||1040<=t&&t<=1103||t==1105||t==8208||8211<=t&&t<=8214||8216<=t&&t<=8217||8220<=t&&t<=8221||8224<=t&&t<=8226||8228<=t&&t<=8231||t==8240||8242<=t&&t<=8243||t==8245||t==8251||t==8254||t==8308||t==8319||8321<=t&&t<=8324||t==8364||t==8451||t==8453||t==8457||t==8467||t==8470||8481<=t&&t<=8482||t==8486||t==8491||8531<=t&&t<=8532||8539<=t&&t<=8542||8544<=t&&t<=8555||8560<=t&&t<=8569||t==8585||8592<=t&&t<=8601||8632<=t&&t<=8633||t==8658||t==8660||t==8679||t==8704||8706<=t&&t<=8707||8711<=t&&t<=8712||t==8715||t==8719||t==8721||t==8725||t==8730||8733<=t&&t<=8736||t==8739||t==8741||8743<=t&&t<=8748||t==8750||8756<=t&&t<=8759||8764<=t&&t<=8765||t==8776||t==8780||t==8786||8800<=t&&t<=8801||8804<=t&&t<=8807||8810<=t&&t<=8811||8814<=t&&t<=8815||8834<=t&&t<=8835||8838<=t&&t<=8839||t==8853||t==8857||t==8869||t==8895||t==8978||9312<=t&&t<=9449||9451<=t&&t<=9547||9552<=t&&t<=9587||9600<=t&&t<=9615||9618<=t&&t<=9621||9632<=t&&t<=9633||9635<=t&&t<=9641||9650<=t&&t<=9651||9654<=t&&t<=9655||9660<=t&&t<=9661||9664<=t&&t<=9665||9670<=t&&t<=9672||t==9675||9678<=t&&t<=9681||9698<=t&&t<=9701||t==9711||9733<=t&&t<=9734||t==9737||9742<=t&&t<=9743||9748<=t&&t<=9749||t==9756||t==9758||t==9792||t==9794||9824<=t&&t<=9825||9827<=t&&t<=9829||9831<=t&&t<=9834||9836<=t&&t<=9837||t==9839||9886<=t&&t<=9887||9918<=t&&t<=9919||9924<=t&&t<=9933||9935<=t&&t<=9953||t==9955||9960<=t&&t<=9983||t==10045||t==10071||10102<=t&&t<=10111||11093<=t&&t<=11097||12872<=t&&t<=12879||57344<=t&&t<=63743||65024<=t&&t<=65039||t==65533||127232<=t&&t<=127242||127248<=t&&t<=127277||127280<=t&&t<=127337||127344<=t&&t<=127386||917760<=t&&t<=917999||983040<=t&&t<=1048573||1048576<=t&&t<=1114109?"A":"N"},s.characterLength=function(y){var i=this.eastAsianWidth(y);return i=="F"||i=="W"||i=="A"?2:1};function f(y){return y.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}s.length=function(y){for(var i=f(y),S=0,t=0;t<i.length;t++)S=S+this.characterLength(i[t]);return S},s.slice=function(y,i,S){textLen=s.length(y),i=i||0,S=S||1,i<0&&(i=textLen+i),S<0&&(S=textLen+S);for(var t="",$=0,c=f(y),k=0;k<c.length;k++){var b=c[k],U=s.length(b);if($>=i-(U==2?1:0))if($+U<=S)t+=b;else break;$+=U}return t}})(hs);var Yf=hs.exports,Gf=As(Yf),Xf=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},zf=As(Xf);function $l(l,s={}){if(typeof l!="string"||l.length===0||(s={ambiguousIsNarrow:!0,...s},l=Vs(l),l.length===0))return 0;l=l.replace(zf()," ");let f=s.ambiguousIsNarrow?1:2,y=0;for(let i of l){let S=i.codePointAt(0);if(S<=31||S>=127&&S<=159||S>=768&&S<=879)continue;switch(Gf.eastAsianWidth(i)){case"F":case"W":y+=2;break;case"A":y+=f;break;default:y+=1}}return y}var Vl=10,Zs=(l=0)=>(s)=>`\x1B[${s+l}m`,js=(l=0)=>(s)=>`\x1B[${38+l};5;${s}m`,Ms=(l=0)=>(s,f,y)=>`\x1B[${38+l};2;${s};${f};${y}m`,G={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(G.modifier);var Qf=Object.keys(G.color),Zf=Object.keys(G.bgColor);[...Qf,...Zf];function jf(){let l=new Map;for(let[s,f]of Object.entries(G)){for(let[y,i]of Object.entries(f))G[y]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},f[y]=G[y],l.set(i[0],i[1]);Object.defineProperty(G,s,{value:f,enumerable:!1})}return Object.defineProperty(G,"codes",{value:l,enumerable:!1}),G.color.close="\x1B[39m",G.bgColor.close="\x1B[49m",G.color.ansi=Zs(),G.color.ansi256=js(),G.color.ansi16m=Ms(),G.bgColor.ansi=Zs(Vl),G.bgColor.ansi256=js(Vl),G.bgColor.ansi16m=Ms(Vl),Object.defineProperties(G,{rgbToAnsi256:{value:(s,f,y)=>s===f&&f===y?s<8?16:s>248?231:Math.round((s-8)/247*24)+232:16+36*Math.round(s/255*5)+6*Math.round(f/255*5)+Math.round(y/255*5),enumerable:!1},hexToRgb:{value:(s)=>{let f=/[a-f\d]{6}|[a-f\d]{3}/i.exec(s.toString(16));if(!f)return[0,0,0];let[y]=f;y.length===3&&(y=[...y].map((S)=>S+S).join(""));let i=Number.parseInt(y,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:(s)=>G.rgbToAnsi256(...G.hexToRgb(s)),enumerable:!1},ansi256ToAnsi:{value:(s)=>{if(s<8)return 30+s;if(s<16)return 90+(s-8);let f,y,i;if(s>=232)f=((s-232)*10+8)/255,y=f,i=f;else{s-=16;let $=s%36;f=Math.floor(s/36)/5,y=Math.floor($/6)/5,i=$%6/5}let S=Math.max(f,y,i)*2;if(S===0)return 30;let t=30+(Math.round(i)<<2|Math.round(y)<<1|Math.round(f));return S===2&&(t+=60),t},enumerable:!1},rgbToAnsi:{value:(s,f,y)=>G.ansi256ToAnsi(G.rgbToAnsi256(s,f,y)),enumerable:!1},hexToAnsi:{value:(s)=>G.ansi256ToAnsi(G.hexToAnsi256(s)),enumerable:!1}}),G}var Mf=jf(),Ul=new Set(["\x1B",""]),Hf=39,Ol="\x07",Os="[",Kf="]",Fs="m",Fl=`${Kf}8;;`,Hs=(l)=>`${Ul.values().next().value}${Os}${l}${Fs}`,Ks=(l)=>`${Ul.values().next().value}${Fl}${l}${Ol}`,Wf=(l)=>l.split(" ").map((s)=>$l(s)),Al=(l,s,f)=>{let y=[...s],i=!1,S=!1,t=$l(Vs(l[l.length-1]));for(let[$,c]of y.entries()){let k=$l(c);if(t+k<=f?l[l.length-1]+=c:(l.push(c),t=0),Ul.has(c)&&(i=!0,S=y.slice($+1).join("").startsWith(Fl)),i){S?c===Ol&&(i=!1,S=!1):c===Fs&&(i=!1);continue}t+=k,t===f&&$<y.length-1&&(l.push(""),t=0)}!t&&l[l.length-1].length>0&&l.length>1&&(l[l.length-2]+=l.pop())},Ef=(l)=>{let s=l.split(" "),f=s.length;for(;f>0&&!($l(s[f-1])>0);)f--;return f===s.length?l:s.slice(0,f).join(" ")+s.slice(f).join("")},xf=(l,s,f={})=>{if(f.trim!==!1&&l.trim()==="")return"";let y="",i,S,t=Wf(l),$=[""];for(let[k,b]of l.split(" ").entries()){f.trim!==!1&&($[$.length-1]=$[$.length-1].trimStart());let U=$l($[$.length-1]);if(k!==0&&(U>=s&&(f.wordWrap===!1||f.trim===!1)&&($.push(""),U=0),(U>0||f.trim===!1)&&($[$.length-1]+=" ",U++)),f.hard&&t[k]>s){let w=s-U,n=1+Math.floor((t[k]-w-1)/s);Math.floor((t[k]-1)/s)<n&&$.push(""),Al($,b,s);continue}if(U+t[k]>s&&U>0&&t[k]>0){if(f.wordWrap===!1&&U<s){Al($,b,s);continue}$.push("")}if(U+t[k]>s&&f.wordWrap===!1){Al($,b,s);continue}$[$.length-1]+=b}f.trim!==!1&&($=$.map((k)=>Ef(k)));let c=[...$.join(`
|
|
28
|
+
`)];for(let[k,b]of c.entries()){if(y+=b,Ul.has(b)){let{groups:w}=new RegExp(`(?:\\${Os}(?<code>\\d+)m|\\${Fl}(?<uri>.*)${Ol})`).exec(c.slice(k).join(""))||{groups:{}};if(w.code!==void 0){let n=Number.parseFloat(w.code);i=n===Hf?void 0:n}else w.uri!==void 0&&(S=w.uri.length===0?void 0:w.uri)}let U=Mf.codes.get(Number(i));c[k+1]===`
|
|
29
|
+
`?(S&&(y+=Ks("")),i&&U&&(y+=Hs(U))):b===`
|
|
30
|
+
`&&(i&&U&&(y+=Hs(i)),S&&(y+=Ks(S)))}return y};function Ws(l,s,f){return String(l).normalize().replace(/\r\n/g,`
|
|
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((y)=>xf(y,s,f)).join(`
|
|
33
|
+
`)}var Cf=["up","down","left","right","space","enter","cancel"],gl={actions:new Set(Cf),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};function al(l,s){if(typeof l=="string")return gl.aliases.get(l)===s;for(let f of l)if(f!==void 0&&al(f,s))return!0;return!1}function Nf(l,s){if(l===s)return;let f=l.split(`
|
|
34
|
+
`),y=s.split(`
|
|
35
|
+
`),i=[];for(let S=0;S<Math.max(f.length,y.length);S++)f[S]!==y[S]&&i.push(S);return i}var Vf=globalThis.process.platform.startsWith("win"),hl=Symbol("clack:cancel");function K(l){return l===hl}function wl(l,s){let f=l;f.isTTY&&f.setRawMode(s)}function as({input:l=Cs,output:s=Ns,overwrite:f=!0,hideCursor:y=!0}={}){let i=p.createInterface({input:l,output:s,prompt:"",tabSize:1});p.emitKeypressEvents(l,i),l.isTTY&&l.setRawMode(!0);let S=(t,{name:$,sequence:c})=>{let k=String(t);if(al([k,$,c],"cancel")){y&&s.write(H.cursor.show),process.exit(0);return}if(!f)return;p.moveCursor(s,$==="return"?0:-1,$==="return"?-1:0,()=>{p.clearLine(s,1,()=>{l.once("keypress",S)})})};return y&&s.write(H.cursor.hide),l.once("keypress",S),()=>{l.off("keypress",S),y&&s.write(H.cursor.show),l.isTTY&&!Vf&&l.setRawMode(!1),i.terminal=!1,i.close()}}var Af=Object.defineProperty,hf=(l,s,f)=>(s in l)?Af(l,s,{enumerable:!0,configurable:!0,writable:!0,value:f}):l[s]=f,N=(l,s,f)=>(hf(l,typeof s!="symbol"?s+"":s,f),f);class Ll{constructor(l,s=!0){N(this,"input"),N(this,"output"),N(this,"_abortSignal"),N(this,"rl"),N(this,"opts"),N(this,"_render"),N(this,"_track",!1),N(this,"_prevFrame",""),N(this,"_subscribers",new Map),N(this,"_cursor",0),N(this,"state","initial"),N(this,"error",""),N(this,"value");let{input:f=Cs,output:y=Ns,render:i,signal:S,...t}=l;this.opts=t,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=i.bind(this),this._track=s,this._abortSignal=S,this.input=f,this.output=y}unsubscribe(){this._subscribers.clear()}setSubscriber(l,s){let f=this._subscribers.get(l)??[];f.push(s),this._subscribers.set(l,f)}on(l,s){this.setSubscriber(l,{cb:s})}once(l,s){this.setSubscriber(l,{cb:s,once:!0})}emit(l,...s){let f=this._subscribers.get(l)??[],y=[];for(let i of f)i.cb(...s),i.once&&y.push(()=>f.splice(f.indexOf(i),1));for(let i of y)i()}prompt(){return new Promise((l,s)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),l(hl);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let f=new rf;f._write=(y,i,S)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),S()},this.input.pipe(f),this.rl=Qs.createInterface({input:this.input,output:f,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),Qs.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),wl(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(H.cursor.show),this.output.off("resize",this.render),wl(this.input,!1),l(this.value)}),this.once("cancel",()=>{this.output.write(H.cursor.show),this.output.off("resize",this.render),wl(this.input,!1),l(hl)})})}onKeypress(l,s){if(this.state==="error"&&(this.state="active"),s?.name&&(!this._track&&gl.aliases.has(s.name)&&this.emit("cursor",gl.aliases.get(s.name)),gl.actions.has(s.name)&&this.emit("cursor",s.name)),l&&(l.toLowerCase()==="y"||l.toLowerCase()==="n")&&this.emit("confirm",l.toLowerCase()==="y"),l==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),l&&this.emit("key",l.toLowerCase()),s?.name==="return"){if(this.opts.validate){let f=this.opts.validate(this.value);f&&(this.error=f instanceof Error?f.message:f,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}al([l,s?.name,s?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
36
|
+
`),wl(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let l=Ws(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
37
|
+
`).length-1;this.output.write(H.cursor.move(-999,l*-1))}render(){let l=Ws(this._render(this)??"",process.stdout.columns,{hard:!0});if(l!==this._prevFrame){if(this.state==="initial")this.output.write(H.cursor.hide);else{let s=Nf(this._prevFrame,l);if(this.restoreCursor(),s&&s?.length===1){let f=s[0];this.output.write(H.cursor.move(0,f)),this.output.write(H.erase.lines(1));let y=l.split(`
|
|
38
|
+
`);this.output.write(y[f]),this._prevFrame=l,this.output.write(H.cursor.move(0,y.length-f-1));return}if(s&&s?.length>1){let f=s[0];this.output.write(H.cursor.move(0,f)),this.output.write(H.erase.down());let y=l.split(`
|
|
39
|
+
`).slice(f);this.output.write(y.join(`
|
|
40
|
+
`)),this._prevFrame=l;return}this.output.write(H.erase.down())}this.output.write(l),this.state==="initial"&&(this.state="active"),this._prevFrame=l}}}class vl extends Ll{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(l){super(l,!1),this.value=!!l.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(s)=>{this.output.write(H.cursor.move(0,-1)),this.value=s,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var Of;Of=new WeakMap;var Ff=Object.defineProperty,af=(l,s,f)=>(s in l)?Ff(l,s,{enumerable:!0,configurable:!0,writable:!0,value:f}):l[s]=f,Es=(l,s,f)=>(af(l,typeof s!="symbol"?s+"":s,f),f),vs=class extends Ll{constructor(l){super(l,!1),Es(this,"options"),Es(this,"cursor",0),this.options=l.options,this.value=[...l.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:s})=>s===l.cursorAt),0),this.on("key",(s)=>{s==="a"&&this.toggleAll()}),this.on("cursor",(s)=>{switch(s){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let l=this.value.length===this.options.length;this.value=l?[]:this.options.map((s)=>s.value)}toggleValue(){let l=this.value.includes(this._value);this.value=l?this.value.filter((s)=>s!==this._value):[...this.value,this._value]}};var vf=Object.defineProperty,of=(l,s,f)=>(s in l)?vf(l,s,{enumerable:!0,configurable:!0,writable:!0,value:f}):l[s]=f,xs=(l,s,f)=>(of(l,typeof s!="symbol"?s+"":s,f),f);class ol extends Ll{constructor(l){super(l,!1),xs(this,"options"),xs(this,"cursor",0),this.options=l.options,this.cursor=this.options.findIndex(({value:s})=>s===l.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(s)=>{switch(s){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}}var g=d(sl(),1),Rl=d(Cl(),1);import h from"node:process";function mf(){return h.platform!=="win32"?h.env.TERM!=="linux":!!h.env.CI||!!h.env.WT_SESSION||!!h.env.TERMINUS_SUBLIME||h.env.ConEmuTask==="{cmd::Cmder}"||h.env.TERM_PROGRAM==="Terminus-Sublime"||h.env.TERM_PROGRAM==="vscode"||h.env.TERM==="xterm-256color"||h.env.TERM==="alacritty"||h.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var ml=mf(),Q=(l,s)=>ml?l:s,uf=Q("◆","*"),ms=Q("■","x"),us=Q("▲","x"),pl=Q("◇","o"),df=Q("┌","T"),P=Q("│","|"),tl=Q("└","—"),ul=Q("●",">"),dl=Q("○"," "),ef=Q("◻","[•]"),os=Q("◼","[+]"),pf=Q("◻","[ ]"),Ji=Q("▪","•"),Pi=Q("─","-"),Yi=Q("╮","+"),Gi=Q("├","+"),Xi=Q("╯","+"),Df=Q("●","•"),ly=Q("◆","*"),sy=Q("▲","!"),ty=Q("■","x"),Dl=(l)=>{switch(l){case"initial":case"active":return g.default.cyan(uf);case"cancel":return g.default.red(ms);case"error":return g.default.yellow(us);case"submit":return g.default.green(pl)}},el=(l)=>{let{cursor:s,options:f,style:y}=l,i=l.maxItems??Number.POSITIVE_INFINITY,S=Math.max(process.stdout.rows-4,0),t=Math.min(S,Math.max(i,5)),$=0;s>=$+t-3?$=Math.max(Math.min(s-t+3,f.length-t),0):s<$+2&&($=Math.max(s-2,0));let c=t<f.length&&$>0,k=t<f.length&&$+t<f.length;return f.slice($,$+t).map((b,U,w)=>{let n=U===0&&c,L=U===w.length-1&&k;return n||L?g.default.dim("..."):y(b,U+$===s)})};var fl=(l)=>{let s=l.active??"Yes",f=l.inactive??"No";return new vl({active:s,inactive:f,initialValue:l.initialValue??!0,render(){let y=`${g.default.gray(P)}
|
|
41
|
+
${Dl(this.state)} ${l.message}
|
|
42
|
+
`,i=this.value?s:f;switch(this.state){case"submit":return`${y}${g.default.gray(P)} ${g.default.dim(i)}`;case"cancel":return`${y}${g.default.gray(P)} ${g.default.strikethrough(g.default.dim(i))}
|
|
43
|
+
${g.default.gray(P)}`;default:return`${y}${g.default.cyan(P)} ${this.value?`${g.default.green(ul)} ${s}`:`${g.default.dim(dl)} ${g.default.dim(s)}`} ${g.default.dim("/")} ${this.value?`${g.default.dim(dl)} ${g.default.dim(f)}`:`${g.default.green(ul)} ${f}`}
|
|
44
|
+
${g.default.cyan(tl)}
|
|
45
|
+
`}}}).prompt()},ds=(l)=>{let s=(f,y)=>{let i=f.label??String(f.value);switch(y){case"selected":return`${g.default.dim(i)}`;case"active":return`${g.default.green(ul)} ${i} ${f.hint?g.default.dim(`(${f.hint})`):""}`;case"cancelled":return`${g.default.strikethrough(g.default.dim(i))}`;default:return`${g.default.dim(dl)} ${g.default.dim(i)}`}};return new ol({options:l.options,initialValue:l.initialValue,render(){let f=`${g.default.gray(P)}
|
|
46
|
+
${Dl(this.state)} ${l.message}
|
|
47
|
+
`;switch(this.state){case"submit":return`${f}${g.default.gray(P)} ${s(this.options[this.cursor],"selected")}`;case"cancel":return`${f}${g.default.gray(P)} ${s(this.options[this.cursor],"cancelled")}
|
|
48
|
+
${g.default.gray(P)}`;default:return`${f}${g.default.cyan(P)} ${el({cursor:this.cursor,options:this.options,maxItems:l.maxItems,style:(y,i)=>s(y,i?"active":"inactive")}).join(`
|
|
49
|
+
${g.default.cyan(P)} `)}
|
|
50
|
+
${g.default.cyan(tl)}
|
|
51
|
+
`}}}).prompt()};var o=(l)=>{let s=(f,y)=>{let i=f.label??String(f.value);return y==="active"?`${g.default.cyan(ef)} ${i} ${f.hint?g.default.dim(`(${f.hint})`):""}`:y==="selected"?`${g.default.green(os)} ${g.default.dim(i)} ${f.hint?g.default.dim(`(${f.hint})`):""}`:y==="cancelled"?`${g.default.strikethrough(g.default.dim(i))}`:y==="active-selected"?`${g.default.green(os)} ${i} ${f.hint?g.default.dim(`(${f.hint})`):""}`:y==="submitted"?`${g.default.dim(i)}`:`${g.default.dim(pf)} ${g.default.dim(i)}`};return new vs({options:l.options,initialValues:l.initialValues,required:l.required??!0,cursorAt:l.cursorAt,validate(f){if(this.required&&f.length===0)return`Please select at least one option.
|
|
52
|
+
${g.default.reset(g.default.dim(`Press ${g.default.gray(g.default.bgWhite(g.default.inverse(" space ")))} to select, ${g.default.gray(g.default.bgWhite(g.default.inverse(" enter ")))} to submit`))}`},render(){let f=`${g.default.gray(P)}
|
|
53
|
+
${Dl(this.state)} ${l.message}
|
|
54
|
+
`,y=(i,S)=>{let t=this.value.includes(i.value);return S&&t?s(i,"active-selected"):t?s(i,"selected"):s(i,S?"active":"inactive")};switch(this.state){case"submit":return`${f}${g.default.gray(P)} ${this.options.filter(({value:i})=>this.value.includes(i)).map((i)=>s(i,"submitted")).join(g.default.dim(", "))||g.default.dim("none")}`;case"cancel":{let i=this.options.filter(({value:S})=>this.value.includes(S)).map((S)=>s(S,"cancelled")).join(g.default.dim(", "));return`${f}${g.default.gray(P)} ${i.trim()?`${i}
|
|
55
|
+
${g.default.gray(P)}`:""}`}case"error":{let i=this.error.split(`
|
|
56
|
+
`).map((S,t)=>t===0?`${g.default.yellow(tl)} ${g.default.yellow(S)}`:` ${S}`).join(`
|
|
57
|
+
`);return`${f+g.default.yellow(P)} ${el({options:this.options,cursor:this.cursor,maxItems:l.maxItems,style:y}).join(`
|
|
58
|
+
${g.default.yellow(P)} `)}
|
|
59
|
+
${i}
|
|
60
|
+
`}default:return`${f}${g.default.cyan(P)} ${el({options:this.options,cursor:this.cursor,maxItems:l.maxItems,style:y}).join(`
|
|
61
|
+
${g.default.cyan(P)} `)}
|
|
62
|
+
${g.default.cyan(tl)}
|
|
63
|
+
`}}}).prompt()};var V=(l="")=>{process.stdout.write(`${g.default.gray(tl)} ${g.default.red(l)}
|
|
64
64
|
|
|
65
|
-
`)},
|
|
66
|
-
`)},
|
|
67
|
-
${
|
|
65
|
+
`)},ll=(l="")=>{process.stdout.write(`${g.default.gray(df)} ${l}
|
|
66
|
+
`)},j=(l="")=>{process.stdout.write(`${g.default.gray(P)}
|
|
67
|
+
${g.default.gray(tl)} ${l}
|
|
68
68
|
|
|
69
|
-
`)},
|
|
70
|
-
`);
|
|
69
|
+
`)},I={message:(l="",{symbol:s=g.default.gray(P)}={})=>{let f=[`${g.default.gray(P)}`];if(l){let[y,...i]=l.split(`
|
|
70
|
+
`);f.push(`${s} ${y}`,...i.map((S)=>`${g.default.gray(P)} ${S}`))}process.stdout.write(`${f.join(`
|
|
71
71
|
`)}
|
|
72
|
-
`)},info:(l)=>{
|
|
73
|
-
`);let
|
|
74
|
-
`);process.stdout.write(
|
|
75
|
-
`);let
|
|
76
|
-
`):process.stdout.write(`${
|
|
77
|
-
`),
|
|
78
|
-
`)){let f=b.indexOf(":");if(f===-1)continue;let I=b.slice(0,f).trim(),T=b.slice(f+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 L of B.split(",")){let[X,P]=L.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 xf(y)).isFile()}catch{return!1}}async function Al(l){try{let y=await Af(l,"utf-8"),{data:S}=gf(y);if(!S.name||!S.description)return null;return{name:S.name,description:S.description,path:Of(l),metadata:S.metadata?JSON.parse(S.metadata):void 0}}catch{return null}}async function O1(l,y=0,S=5){let $=[];if(y>S)return $;try{if(await xl(l))$.push(l);let k=await C1(l,{withFileTypes:!0});for(let b of k)if(b.isDirectory()&&!Ff.includes(b.name)){let f=await O1(x(l,b.name),y+1,S);$.push(...f)}}catch{}return $}async function F1(l,y){let S=[],$=new Set,k=y?x(l,y):l;if(await xl(k)){let f=await Al(x(k,"SKILL.md"));if(f)return S.push(f),S}let b=vf(k);for(let f of b)try{let I=await C1(f,{withFileTypes:!0});for(let T of I)if(T.isDirectory()){let R=x(f,T.name);if(await xl(R)){let B=await Al(x(R,"SKILL.md"));if(B&&!$.has(B.name))S.push(B),$.add(B.name)}}}catch{}if(S.length===0){let f=await O1(k);for(let I of f){let T=await Al(x(I,"SKILL.md"));if(T&&!$.has(T.name))S.push(T),$.add(T.name)}}return S}function C(l){return l.name||Cf(l.path)}import{mkdir as c1,cp as hf,access as sf,readdir as mf}from"fs/promises";import{join as c,basename as Df}from"path";async function v1(l,y,S={}){let $=j[y],k=l.name||Df(l.path),b=S.global?$.globalSkillsDir:c(S.cwd||process.cwd(),$.skillsDir),f=c(b,k);try{return await c1(f,{recursive:!0}),await g1(l.path,f),{success:!0,path:f}}catch(I){return{success:!1,path:f,error:I instanceof Error?I.message:"Unknown error"}}}var nf=new Set(["README.md","metadata.json"]),uf=(l)=>{if(nf.has(l))return!0;if(l.startsWith("_"))return!0;return!1};async function g1(l,y){await c1(y,{recursive:!0});let S=await mf(l,{withFileTypes:!0});for(let $ of S){if(uf($.name))continue;let k=c(l,$.name),b=c(y,$.name);if($.isDirectory())await g1(k,b);else await hf(k,b)}}async function h1(l,y,S={}){let $=j[y],k=S.global?$.globalSkillsDir:c(S.cwd||process.cwd(),$.skillsDir),b=c(k,l);try{return await sf(b),!0}catch{return!1}}function s1(l,y,S={}){let $=j[y],k=S.global?$.globalSkillsDir:c(S.cwd||process.cwd(),$.skillsDir);return c(k,l)}async function i1(l,y){let S={tempDir:null,spinner:W1()};try{S.spinner.start("Parsing source...");let $=E1(l);S.spinner.stop(`Source: ${z.default.cyan($.url)}${$.subpath?` (${$.subpath})`:""}`),S.spinner.start("Cloning repository..."),S.tempDir=await V1($.url),S.spinner.stop("Repository cloned"),S.spinner.start("Discovering skills...");let k=await F1(S.tempDir,$.subpath);if(k.length===0)return S.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(S.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 tf(k,y);if(!b)return{success:!1,installed:0,failed:0,results:[]};let f=await df(y,S);if(!f)return{success:!1,installed:0,failed:0,results:[]};let I=await rf(y);if(I===null)return{success:!1,installed:0,failed:0,results:[]};if(!await pf(y,b,f,I))return{success:!1,installed:0,failed:0,results:[]};S.spinner.start("Installing skills...");let R=await af(b,f,I);return S.spinner.stop("Installation complete"),R}finally{if(S.tempDir)await A1(S.tempDir)}}async function tf(l,y){let S;if(y.skill&&y.skill.length>0){if(S=l.filter(($)=>y.skill.some((k)=>$.name.toLowerCase()===k.toLowerCase()||C($).toLowerCase()===k.toLowerCase())),S.length===0){_.error(`No matching skills found for: ${y.skill.join(", ")}`),_.info("Available skills:");for(let $ of l)_.message(` - ${C($)}`);return null}_.info(`Selected ${S.length} skill${S.length!==1?"s":""}: ${S.map(($)=>z.default.cyan(C($))).join(", ")}`)}else if(l.length===1){S=l;let $=l[0];_.info(`Skill: ${z.default.cyan(C($))}`),_.message(z.default.dim($.description))}else if(y.yes)S=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 Sl({message:"Select skills to install",options:$,required:!0});if(F(k))return s("Installation cancelled"),null;S=k}return S}async function df(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 S=await x1();if(y.spinner.stop(`Detected ${S.length} agent${S.length!==1?"s":""}`),S.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,f])=>({value:b,label:f.displayName})),k=await Sl({message:"Select agents to install skills to",options:$,required:!0});if(F(k))return s("Installation cancelled"),null;return k}else if(S.length===1||l.yes){if(S.length===1){let $=S[0];_.info(`Installing to: ${z.default.cyan(j[$].displayName)}`)}else _.info(`Installing to: ${S.map(($)=>z.default.cyan(j[$].displayName)).join(", ")}`);return S}else{let $=S.map((b)=>({value:b,label:j[b].displayName,hint:j[b].skillsDir})),k=await Sl({message:"Select agents to install skills to",options:$,required:!0,initialValues:S});if(F(k))return s("Installation cancelled"),null;return k}}async function rf(l){let y=l.global??!1;if(l.global===void 0&&!l.yes){let S=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(S))return s("Installation cancelled"),null;y=S}return y}async function pf(l,y,S,$){console.log(),_.step(z.default.bold("Installation Summary"));for(let k of y){_.message(` ${z.default.cyan(C(k))}`);for(let b of S){let f=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(f)}${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 af(l,y,S){let $=l.flatMap((T)=>y.map((R)=>v1(T,R,{global:S}))),b=(await Promise.all($)).map((T,R)=>{let B=Math.floor(R/y.length),L=R%y.length,X=l[B],P=y[L];return{skill:C(X),agent:j[P].displayName,...T}});console.log();let f=b.filter((T)=>T.success),I=b.filter((T)=>!T.success);if(f.length>0){_.success(z.default.green(`Successfully installed ${f.length} skill${f.length!==1?"s":""}`));for(let T of f)_.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:f.length,failed:I.length,results:b}}var m1={name:"give-skill",version:"1.0.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 ef=m1.version;Jl.name("give-skill").description("Install skills onto coding agents (Claude Code, Cursor, Copilot, Gemini, Windsurf, Trae, Factory, OpenCode, Codex, Antigravity, Amp, Kilo, Roo, Goose)").version(ef).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 lS(l,y)});Jl.parse();async function lS(l,y){console.log(),w1($l.default.bgCyan($l.default.black(" give-skill ")));try{let S=await i1(l,y);if(!S.success&&S.installed===0&&S.failed===0)process.exit(1);if(S.failed>0)process.exit(1)}catch(S){_.error(S instanceof Error?S.message:"Unknown error occurred"),i($l.default.red("Installation failed")),process.exit(1)}}
|
|
72
|
+
`)},info:(l)=>{I.message(l,{symbol:g.default.blue(Df)})},success:(l)=>{I.message(l,{symbol:g.default.green(ly)})},step:(l)=>{I.message(l,{symbol:g.default.green(pl)})},warn:(l)=>{I.message(l,{symbol:g.default.yellow(sy)})},warning:(l)=>{I.warn(l)},error:(l)=>{I.message(l,{symbol:g.default.red(ty)})}},zi=`${g.default.gray(P)} `;var D=({indicator:l="dots"}={})=>{let s=ml?["◒","◐","◓","◑"]:["•","o","O","0"],f=ml?80:120,y=process.env.CI==="true",i,S,t=!1,$="",c,k=performance.now(),b=(M)=>{let x=M>1?"Something went wrong":"Canceled";t&&A(x,M)},U=()=>b(2),w=()=>b(1),n=()=>{process.on("uncaughtExceptionMonitor",U),process.on("unhandledRejection",U),process.on("SIGINT",w),process.on("SIGTERM",w),process.on("exit",b)},L=()=>{process.removeListener("uncaughtExceptionMonitor",U),process.removeListener("unhandledRejection",U),process.removeListener("SIGINT",w),process.removeListener("SIGTERM",w),process.removeListener("exit",b)},J=()=>{if(c===void 0)return;y&&process.stdout.write(`
|
|
73
|
+
`);let M=c.split(`
|
|
74
|
+
`);process.stdout.write(Rl.cursor.move(-999,M.length-1)),process.stdout.write(Rl.erase.down(M.length))},T=(M)=>M.replace(/\.+$/,""),X=(M)=>{let x=(performance.now()-M)/1000,C=Math.floor(x/60),E=Math.floor(x%60);return C>0?`[${C}m ${E}s]`:`[${E}s]`},O=(M="")=>{t=!0,i=as(),$=T(M),k=performance.now(),process.stdout.write(`${g.default.gray(P)}
|
|
75
|
+
`);let x=0,C=0;n(),S=setInterval(()=>{if(y&&$===c)return;J(),c=$;let E=g.default.magenta(s[x]);if(y)process.stdout.write(`${E} ${$}...`);else if(l==="timer")process.stdout.write(`${E} ${$} ${X(k)}`);else{let zl=".".repeat(Math.floor(C)).slice(0,3);process.stdout.write(`${E} ${$}${zl}`)}x=x+1<s.length?x+1:0,C=C<s.length?C+0.125:0},f)},A=(M="",x=0)=>{t=!1,clearInterval(S),J();let C=x===0?g.default.green(pl):x===1?g.default.red(ms):g.default.red(us);$=T(M??$),l==="timer"?process.stdout.write(`${C} ${$} ${X(k)}
|
|
76
|
+
`):process.stdout.write(`${C} ${$}
|
|
77
|
+
`),L(),i()};return{start:O,stop:A,message:(M="")=>{$=T(M??$)}}};var Z=d(sl(),1);var _=d(sl(),1);import{join as fy}from"path";import{rmSync as yy}from"fs";import{tmpdir as iy}from"os";import{spawn as ls}from"child_process";function es(l){let s=l.match(/github\.com\/([^/]+)\/([^/]+)\/tree\/([^/]+)(?:\/(.+))?$/);if(s){let[,t,$,c,k]=s;return{type:"github",url:`https://github.com/${t}/${$}.git`,branch:c,subpath:k}}let f=l.match(/github\.com\/([^/]+)\/([^/]+)/);if(f){let[,t,$]=f,c=$.replace(/\.git$/,"");return{type:"github",url:`https://github.com/${t}/${c}.git`}}let y=l.match(/gitlab\.com\/([^/]+)\/([^/]+)\/-\/tree\/([^/]+)(?:\/(.+))?$/);if(y){let[,t,$,c,k]=y;return{type:"gitlab",url:`https://gitlab.com/${t}/${$}.git`,branch:c,subpath:k}}let i=l.match(/gitlab\.com\/([^/]+)\/([^/]+)/);if(i){let[,t,$]=i,c=$.replace(/\.git$/,"");return{type:"gitlab",url:`https://gitlab.com/${t}/${c}.git`}}let S=l.match(/^([^/]+)\/([^/]+)(?:\/(.+))?$/);if(S&&!l.includes(":")){let[,t,$,c]=S;return{type:"github",url:`https://github.com/${t}/${$}.git`,subpath:c}}return{type:"git",url:l}}async function Bl(l,s){let f=fy(iy(),`give-skill-${Date.now()}`),y=["clone","--depth","1"];if(s)y.push("--branch",s);return y.push(l,f),await new Promise((i,S)=>{let t=ls("git",y,{stdio:"pipe"});t.on("close",($)=>{if($===0)i();else S(Error(`Failed to clone repository: ${l}`))}),t.on("error",S)}),f}async function ps(l,s="main"){return await new Promise((y,i)=>{let S="",t=ls("git",["ls-remote",l,`refs/heads/${s}`],{stdio:"pipe"});t.stdout?.on("data",($)=>{S+=$.toString()}),t.on("close",($)=>{if($===0&&S.trim())y(S.trim().split(/\s+/)[0]??"");else i(Error(`Failed to get latest commit from ${l}`))}),t.on("error",i)})}async function _l(l){return await new Promise((f,y)=>{let i="",S=ls("git",["rev-parse","HEAD"],{cwd:l,stdio:"pipe"});S.stdout?.on("data",(t)=>{i+=t.toString()}),S.on("close",(t)=>{if(t===0&&i.trim())f(i.trim());else y(Error("Failed to get commit hash"))}),S.on("error",y)})}async function ql(l){yy(l,{recursive:!0,force:!0})}import{readdir as lt,readFile as $y,stat as ky}from"fs/promises";import{join as m,basename as cy,dirname as by}from"path";import{homedir as Sy}from"os";import{join as q}from"path";import{existsSync as W}from"fs";var r=Sy(),z={opencode:{name:"opencode",displayName:"OpenCode",skillsDir:".opencode/skill",globalSkillsDir:q(r,".config/opencode/skill"),detectInstalled:async()=>{return W(q(r,".config/opencode"))}},"claude-code":{name:"claude-code",displayName:"Claude Code",skillsDir:".claude/skills",globalSkillsDir:q(r,".claude/skills"),detectInstalled:async()=>{return W(q(r,".claude"))}},codex:{name:"codex",displayName:"Codex",skillsDir:".codex/skills",globalSkillsDir:q(r,".codex/skills"),detectInstalled:async()=>{return W(q(r,".codex"))}},cursor:{name:"cursor",displayName:"Cursor",skillsDir:".cursor/skills",globalSkillsDir:q(r,".cursor/skills"),detectInstalled:async()=>{return W(q(r,".cursor"))}},amp:{name:"amp",displayName:"Amp",skillsDir:".agents/skills",globalSkillsDir:q(r,".config/agents/skills"),detectInstalled:async()=>{return W(q(r,".config/amp"))}},kilo:{name:"kilo",displayName:"Kilo Code",skillsDir:".kilocode/skills",globalSkillsDir:q(r,".kilocode/skills"),detectInstalled:async()=>{return W(q(r,".kilocode"))}},roo:{name:"roo",displayName:"Roo Code",skillsDir:".roo/skills",globalSkillsDir:q(r,".roo/skills"),detectInstalled:async()=>{return W(q(r,".roo"))}},goose:{name:"goose",displayName:"Goose",skillsDir:".goose/skills",globalSkillsDir:q(r,".config/goose/skills"),detectInstalled:async()=>{return W(q(r,".config/goose"))}},antigravity:{name:"antigravity",displayName:"Antigravity",skillsDir:".agent/skills",globalSkillsDir:q(r,".gemini/antigravity/skills"),detectInstalled:async()=>{return W(q(r,".gemini/antigravity"))}},copilot:{name:"copilot",displayName:"GitHub Copilot",skillsDir:".github/skills",globalSkillsDir:q(r,".copilot/skills"),detectInstalled:async()=>{return W(q(r,".copilot"))}},gemini:{name:"gemini",displayName:"Gemini CLI",skillsDir:".gemini/skills",globalSkillsDir:q(r,".gemini/skills"),detectInstalled:async()=>{return W(q(r,".gemini"))}},windsurf:{name:"windsurf",displayName:"Windsurf",skillsDir:".windsurf/skills",globalSkillsDir:q(r,".codeium/windsurf/skills"),detectInstalled:async()=>{return W(q(r,".codeium/windsurf"))}},trae:{name:"trae",displayName:"Trae",skillsDir:".trae/skills",globalSkillsDir:q(r,".trae/skills"),detectInstalled:async()=>{return W(q(r,".trae"))}},factory:{name:"factory",displayName:"Factory Droid",skillsDir:".factory/skills",globalSkillsDir:q(r,".factory/skills"),detectInstalled:async()=>{return W(q(r,".factory"))}},letta:{name:"letta",displayName:"Letta",skillsDir:".skills",globalSkillsDir:q(r,".letta/skills"),detectInstalled:async()=>{return W(q(r,".letta"))}}};async function Ds(){let l=[];for(let[s,f]of Object.entries(z))if(await f.detectInstalled())l.push(s);return l}var ny=["node_modules",".git","dist","build","__pycache__"],Iy=["skills","skills/.curated","skills/.experimental","skills/.system"];function wy(l){let s=[l];for(let y of Iy)s.push(m(l,y));let f=new Set;for(let y of Object.values(z))f.add(m(l,y.skillsDir));return s.push(...f),s}function gy(l){let s=l.match(/^---\n([\s\S]+?)\n---\n([\s\S]*)$/);if(!s)return{data:{},content:l};let f=s[1],y=s[2],i={};for(let S of f.split(`
|
|
78
|
+
`)){let t=S.indexOf(":");if(t===-1)continue;let $=S.slice(0,t).trim(),c=S.slice(t+1).trim();if(c.startsWith('"')&&c.endsWith('"')||c.startsWith("'")&&c.endsWith("'"))i[$]=c.slice(1,-1);else if($==="metadata")try{let k={},b=c.replace(/^\{|\}$/g,"").trim();if(b){for(let U of b.split(",")){let[w,n]=U.split("=").map((L)=>L.trim());if(w&&n)k[w]=n.replace(/^['"]|['"]$/g,"")}i[$]=JSON.stringify(k)}}catch{i[$]=c}else i[$]=c}return{data:i,content:y}}async function ts(l){try{let s=m(l,"SKILL.md");return(await ky(s)).isFile()}catch{return!1}}async function ss(l){try{let s=await $y(l,"utf-8"),{data:f}=gy(s);if(!f.name||!f.description)return null;return{name:f.name,description:f.description,path:by(l),metadata:f.metadata?JSON.parse(f.metadata):void 0}}catch{return null}}async function st(l,s=0,f=5){let y=[];if(s>f)return y;try{if(await ts(l))y.push(l);let i=await lt(l,{withFileTypes:!0});for(let S of i)if(S.isDirectory()&&!ny.includes(S.name)){let t=await st(m(l,S.name),s+1,f);y.push(...t)}}catch{}return y}async function rl(l,s){let f=[],y=new Set,i=s?m(l,s):l;if(await ts(i)){let t=await ss(m(i,"SKILL.md"));if(t)return f.push(t),f}let S=wy(i);for(let t of S)try{let $=await lt(t,{withFileTypes:!0});for(let c of $)if(c.isDirectory()){let k=m(t,c.name);if(await ts(k)){let b=await ss(m(k,"SKILL.md"));if(b&&!y.has(b.name))f.push(b),y.add(b.name)}}}catch{}if(f.length===0){let t=await st(i);for(let $ of t){let c=await ss(m($,"SKILL.md"));if(c&&!y.has(c.name))f.push(c),y.add(c.name)}}return f}function u(l){return l.name||cy(l.path)}import{mkdir as tt,cp as Uy,access as Ly,readdir as Ry}from"fs/promises";import{join as F,basename as Ty}from"path";async function Jl(l,s,f={}){let y=z[s],i=l.name||Ty(l.path),S=f.cwd||process.cwd(),t=f.global?y.globalSkillsDir:F(S,y.skillsDir),$=F(t,i);try{return await tt($,{recursive:!0}),await ft(l.path,$),{success:!0,path:$,originalPath:f.global?$:F(y.skillsDir,i)}}catch(c){return{success:!1,path:$,originalPath:f.global?$:F(y.skillsDir,i),error:c instanceof Error?c.message:"Unknown error"}}}var By=new Set(["README.md","metadata.json"]),_y=(l)=>{if(By.has(l))return!0;if(l.startsWith("_"))return!0;return!1};async function ft(l,s){await tt(s,{recursive:!0});let f=await Ry(l,{withFileTypes:!0});for(let y of f){if(_y(y.name))continue;let i=F(l,y.name),S=F(s,y.name);if(y.isDirectory())await ft(i,S);else await Uy(i,S)}}async function yt(l,s,f={}){let y=z[s],i=f.global?y.globalSkillsDir:F(f.cwd||process.cwd(),y.skillsDir),S=F(i,l);try{return await Ly(S),!0}catch{return!1}}function it(l,s,f={}){let y=z[s],i=f.global?y.globalSkillsDir:F(f.cwd||process.cwd(),y.skillsDir);return F(i,l)}import{homedir as qy}from"os";import{join as ys}from"path";import{existsSync as is,readFileSync as ry,writeFileSync as St,mkdirSync as Jy}from"fs";var fs=ys(qy(),".give-skill"),Pl=ys(fs,"state.json");function $t(){if(!is(fs))Jy(fs,{recursive:!0})}function kl(){if($t(),!is(Pl)){let l={lastUpdate:new Date().toISOString(),skills:{}};return St(Pl,JSON.stringify(l,null,2)),l}try{let l=ry(Pl,"utf-8");return JSON.parse(l)}catch{return{lastUpdate:new Date().toISOString(),skills:{}}}}function Yl(l){$t(),l.lastUpdate=new Date().toISOString(),St(Pl,JSON.stringify(l,null,2))}function kt(l,s,f,y,i,S){let t=kl(),$=l.toLowerCase(),c=!1,k;if(!t.skills[$])t.skills[$]={source:s,url:s,subpath:f,branch:y,commit:i,installedAt:new Date().toISOString(),installations:[]};else{if(t.skills[$].branch!==y)k=t.skills[$].branch,t.skills[$].branch=y,t.skills[$].commit=i,c=!0;if(t.skills[$].url=s,t.skills[$].source=s,f)t.skills[$].subpath=f}let b=t.skills[$].installations.findIndex((U)=>U.agent===S.agent&&U.path===S.path);if(b>=0)t.skills[$].installations[b]=S;else t.skills[$].installations.push(S);return Yl(t),{updated:c,previousBranch:k}}function Gl(l,s,f){let y=kl(),i=l.toLowerCase();if(!y.skills[i])return;if(y.skills[i].installations=y.skills[i].installations.filter((S)=>!(S.agent===s&&S.path===f)),y.skills[i].installations.length===0)delete y.skills[i];Yl(y)}function ct(l,s){let f=kl(),y=l.toLowerCase();if(f.skills[y])f.skills[y].commit=s,Yl(f)}function yl(){return kl()}async function bt(){let l=kl(),s=[];for(let[f,y]of Object.entries(l.skills)){let i=[];for(let S of y.installations)try{let t=S.type==="global"?S.path:ys(process.cwd(),S.path);if(is(t))i.push(S)}catch{}if(i.length===0)s.push(f);else if(i.length!==y.installations.length)y.installations=i}for(let f of s)delete l.skills[f];if(s.length>0)Yl(l)}async function nt(l,s){let f={tempDir:null,spinner:D()};try{f.spinner.start("Parsing source...");let y=es(l),i=y.branch??"main";f.spinner.stop(`Source: ${_.default.cyan(y.url)}${y.subpath?` (${y.subpath})`:""}${y.branch?` @ ${_.default.cyan(y.branch)}`:""}`),f.spinner.start("Cloning repository..."),f.tempDir=await Bl(y.url,y.branch),f.spinner.stop("Repository cloned");let S=await _l(f.tempDir);f.spinner.start("Discovering skills...");let t=await rl(f.tempDir,y.subpath);if(t.length===0)return f.spinner.stop(_.default.red("No skills found")),j(_.default.red("No valid skills found. Skills require a SKILL.md with name and description.")),{success:!1,installed:0,failed:0,results:[]};if(f.spinner.stop(`Found ${_.default.green(t.length)} skill${t.length>1?"s":""}`),s.list){console.log(),I.step(_.default.bold("Available Skills"));for(let w of t)I.message(` ${_.default.cyan(u(w))}`),I.message(` ${_.default.dim(w.description)}`);return console.log(),j("Use --skill <name> to install specific skills"),{success:!0,installed:0,failed:0,results:[]}}let $=await Py(t,s);if(!$)return{success:!1,installed:0,failed:0,results:[]};let c=await Yy(s,f);if(!c)return{success:!1,installed:0,failed:0,results:[]};let k=await Gy(s);if(k===null)return{success:!1,installed:0,failed:0,results:[]};if(!await Xy(s,$,c,k))return{success:!1,installed:0,failed:0,results:[]};f.spinner.start("Installing skills...");let U=await zy($,c,k,y,S,i);return f.spinner.stop("Installation complete"),U}finally{if(f.tempDir)await ql(f.tempDir)}}async function Py(l,s){let f;if(s.skill&&s.skill.length>0){if(f=l.filter((y)=>s.skill.some((i)=>y.name.toLowerCase()===i.toLowerCase()||u(y).toLowerCase()===i.toLowerCase())),f.length===0){I.error(`No matching skills found for: ${s.skill.join(", ")}`),I.info("Available skills:");for(let y of l)I.message(` - ${u(y)}`);return null}I.info(`Selected ${f.length} skill${f.length!==1?"s":""}: ${f.map((y)=>_.default.cyan(u(y))).join(", ")}`)}else if(l.length===1){f=l;let y=l[0];I.info(`Skill: ${_.default.cyan(u(y))}`),I.message(_.default.dim(y.description))}else if(s.yes)f=l,I.info(`Installing all ${l.length} skills`);else{let y=l.map((S)=>({value:S,label:u(S),hint:S.description.length>60?S.description.slice(0,57)+"...":S.description})),i=await o({message:"Select skills to install",options:y,required:!0});if(K(i))return V("Installation cancelled"),null;f=i}return f}async function Yy(l,s){if(l.agent&&l.agent.length>0){let y=Object.keys(z),i=l.agent.filter((S)=>!y.includes(S));if(i.length>0)return I.error(`Invalid agents: ${i.join(", ")}`),I.info(`Valid agents: ${y.join(", ")}`),null;return l.agent}s.spinner.start("Detecting installed agents...");let f=await Ds();if(s.spinner.stop(`Detected ${f.length} agent${f.length!==1?"s":""}`),f.length===0)if(l.yes){let y=Object.keys(z);return I.info("Installing to all agents (none detected)"),y}else{I.warn("No coding agents detected. You can still install skills.");let y=Object.entries(z).map(([S,t])=>({value:S,label:t.displayName})),i=await o({message:"Select agents to install skills to",options:y,required:!0});if(K(i))return V("Installation cancelled"),null;return i}else if(f.length===1||l.yes){if(f.length===1){let y=f[0];I.info(`Installing to: ${_.default.cyan(z[y].displayName)}`)}else I.info(`Installing to: ${f.map((y)=>_.default.cyan(z[y].displayName)).join(", ")}`);return f}else{let y=f.map((S)=>({value:S,label:z[S].displayName,hint:z[S].skillsDir})),i=await o({message:"Select agents to install skills to",options:y,required:!0,initialValues:f});if(K(i))return V("Installation cancelled"),null;return i}}async function Gy(l){let s=l.global??!1;if(l.global===void 0&&!l.yes){let f=await ds({message:"Installation scope",options:[{value:!1,label:"Project",hint:"Install in current directory (committed with your project)"},{value:!0,label:"Global",hint:"Install in home directory (available across all projects)"}]});if(K(f))return V("Installation cancelled"),null;s=f}return s}async function Xy(l,s,f,y){console.log(),I.step(_.default.bold("Installation Summary"));for(let i of s){I.message(` ${_.default.cyan(u(i))}`);for(let S of f){let t=it(i.name,S,{global:y}),c=await yt(i.name,S,{global:y})?_.default.yellow(" (will overwrite)"):"";I.message(` ${_.default.dim("→")} ${z[S].displayName}: ${_.default.dim(t)}${c}`)}}if(console.log(),!l.yes){let i=await fl({message:"Proceed with installation?"});if(K(i)||!i)return V("Installation cancelled"),!1}return!0}async function zy(l,s,f,y,i,S){let t=l.flatMap((w)=>s.map((n)=>Jl(w,n,{global:f}))),$=await Promise.all(t),c=$.map((w,n)=>{let L=Math.floor(n/s.length),J=n%s.length,T=l[L],X=s[J];return{skill:u(T),agent:z[X].displayName,...w}}),k=new Map;for(let[w,n]of $.entries())if(n.success){let L=Math.floor(w/s.length),J=w%s.length,T=l[L],X=s[J],O=kt(T.name,y.url,y.subpath,S,i,{agent:X,type:f?"global":"project",path:n.originalPath});if(O.updated&&O.previousBranch){let A=k.get(T.name);k.set(T.name,{previous:A?.previous??O.previousBranch,current:A?.current??S})}}console.log();let b=c.filter((w)=>w.success),U=c.filter((w)=>!w.success);if(k.size>0){console.log();for(let[w,{previous:n,current:L}]of k)I.warn(_.default.yellow(` ${_.default.cyan(w)}: ${_.default.dim(n)} → ${_.default.green(L)}`))}if(b.length>0){console.log(),I.success(_.default.green(`Successfully installed ${b.length} skill${b.length!==1?"s":""}`));for(let w of b)I.message(` ${_.default.green("✓")} ${w.skill} → ${w.agent}`),I.message(` ${_.default.dim(w.path)}`)}if(U.length>0){console.log(),I.error(_.default.red(`Failed to install ${U.length} skill${U.length!==1?"s":""}`));for(let w of U)I.message(` ${_.default.red("✗")} ${w.skill} → ${w.agent}`),I.message(` ${_.default.dim(w.error)}`)}return console.log(),j(_.default.green("Done!")),{success:U.length===0,installed:b.length,failed:U.length,results:c}}var R=d(sl(),1);import{existsSync as wt}from"fs";import{join as Qy,resolve as Zy}from"path";function gt(l){return l.type==="global"?l.path:Zy(process.cwd(),l.path)}async function It(l,s){let f=s.installations.map((i)=>{let S=gt(i);return{agent:z[i.agent].displayName,path:S,exists:wt(S)}});if(f.filter((i)=>i.exists).length===0)return{skillName:l,currentCommit:s.commit,latestCommit:s.commit,status:"orphaned",installations:f};try{let i=await ps(s.url,s.branch),S=i===s.commit;return{skillName:l,currentCommit:s.commit,latestCommit:i,status:S?"latest":"update-available",installations:f}}catch(i){return{skillName:l,currentCommit:s.commit,latestCommit:s.commit,status:"error",installations:f,error:i instanceof Error?i.message:"Unknown error"}}}async function Ss(l){let s=yl(),f=[],y=Object.entries(s.skills).map(([t,$])=>({skillName:t,state:$})),i;if(l&&l.length>0){let t=new Set(l.map(($)=>$.toLowerCase()));i=y.filter(({skillName:$})=>t.has($.toLowerCase()))}else i=y;if(i.length===0)return[];let S=D();if(i.length===1){let{skillName:t,state:$}=i[0];S.start(`Checking ${R.default.cyan(t)}...`);let c=await It(t,$);S.stop(c.status==="latest"?R.default.green("Up to date"):R.default.yellow("Update available")),f.push(c)}else{S.start(`Checking ${i.length} skill${i.length>1?"s":""}...`);for(let{skillName:t,state:$}of i){let c=await It(t,$);f.push(c)}S.stop("Check complete")}return f}async function Ut(l,s={}){let f=yl(),y=[],i=Object.entries(f.skills).map(([n,L])=>({skillName:n,state:L})),S;if(l&&l.length>0){let n=new Set(l.map((L)=>L.toLowerCase()));S=i.filter(({skillName:L})=>n.has(L.toLowerCase()))}else S=i;if(S.length===0)return I.warn("No skills found to update"),[];let t=await Ss(l),$=t.filter((n)=>n.status==="update-available");if($.length===0){let n=t.filter((L)=>L.status==="orphaned");if(n.length>0){I.warn(`${n.length} skill${n.length>1?"s":""} have no valid installations`);for(let L of n)I.message(` ${R.default.yellow("○")} ${R.default.cyan(L.skillName)} - all installations removed`)}return I.success(R.default.green("All skills are up to date")),[]}console.log(),I.step(R.default.bold("Updates Available"));let c=$.map((n)=>({value:n.skillName,label:n.skillName,hint:`${n.currentCommit.slice(0,7)} → ${n.latestCommit.slice(0,7)}`})),k;if(s.yes)k=$.map((n)=>n.skillName);else{let n=await o({message:"Select skills to update",options:c,required:!0,initialValues:$.map((L)=>L.skillName)});if(K(n))return V("Update cancelled"),[];k=n}console.log(),I.step(R.default.bold("Will Update"));for(let n of k){let L=$.find((J)=>J.skillName===n);if(L)I.message(` ${R.default.cyan(L.skillName)}`),I.message(` ${R.default.dim("Current:")} ${R.default.yellow(L.currentCommit.slice(0,7))} ${R.default.dim("→")} ${R.default.green(L.latestCommit.slice(0,7))}`)}if(console.log(),!s.yes){let n=await fl({message:"Proceed with update?"});if(K(n)||!n)return V("Update cancelled"),[]}let b=D();b.start(`Updating ${k.length} skill${k.length>1?"s":""}...`);for(let{skillName:n,state:L}of S){let J=t.find((A)=>A.skillName===n);if(!J||J.status!=="update-available"){if(J?.status==="latest")y.push({skillName:n,success:!0,updated:0,failed:0});else y.push({skillName:n,success:!1,updated:0,failed:0});continue}if(!k.includes(n))continue;let T=null,X=0,O=0;try{T=await Bl(L.url);let A=await _l(T),M=L.subpath?Qy(T,L.subpath):T,C=(await rl(M)).find((E)=>E.name.toLowerCase()===n.toLowerCase());if(!C)throw Error("Skill not found in repository");for(let E of L.installations){let zl=gt(E);if(!wt(zl)){Gl(n,E.agent,E.path);continue}if((await Jl(C,E.agent,{global:E.type==="global"})).success)X++;else O++}ct(n,A),y.push({skillName:n,success:O===0,updated:X,failed:O})}catch(A){y.push({skillName:n,success:!1,updated:X,failed:O+1,error:A instanceof Error?A.message:"Unknown error"})}finally{if(T)await ql(T)}}b.stop("Update complete"),console.log();let U=y.filter((n)=>n.success&&n.updated>0),w=y.filter((n)=>!n.success||n.failed>0);if(U.length>0){I.success(R.default.green(`Updated ${U.length} skill${U.length!==1?"s":""}`));for(let n of U)I.message(` ${R.default.green("✓")} ${R.default.cyan(n.skillName)} (${n.updated} installation${n.updated!==1?"s":""})`)}if(w.length>0){console.log(),I.error(R.default.red(`Failed to update ${w.length} skill${w.length!==1?"s":""}`));for(let n of w)if(I.message(` ${R.default.red("✗")} ${R.default.cyan(n.skillName)}`),n.error)I.message(` ${R.default.dim(n.error)}`)}if(console.log(),U.length>0)j(R.default.green("Done!"));else j(R.default.yellow("No skills were updated"));return y}async function Lt(l){if(l.length===0){I.warn("No skills tracked. Install skills with:"),console.log(),I.message(` ${R.default.cyan("npx give-skill <repo>")}`),console.log();return}console.log(),I.step(R.default.bold("Skills Status"));for(let s of l){let f={latest:R.default.green("✓"),"update-available":R.default.yellow("↓"),error:R.default.red("✗"),orphaned:R.default.dim("○")}[s.status],y={latest:R.default.green("latest"),"update-available":R.default.yellow("update available"),error:R.default.red("error"),orphaned:R.default.dim("orphaned")}[s.status];if(I.message(`${f} ${R.default.cyan(s.skillName)}`),I.message(` Status: ${y}`),s.status==="update-available")I.message(` ${R.default.dim("Commit:")} ${R.default.yellow(s.currentCommit.slice(0,7))} ${R.default.dim("→")} ${R.default.green(s.latestCommit.slice(0,7))}`);else if(s.status==="latest")I.message(` ${R.default.dim("Commit:")} ${s.currentCommit.slice(0,7)}`);if(s.error)I.message(` ${R.default.red(s.error)}`);let i=s.installations.filter((t)=>t.exists);if(i.length>0){I.message(` ${R.default.dim("Installed in:")}`);for(let t of i)I.message(` ${R.default.dim("•")} ${t.agent}: ${R.default.dim(t.path)}`)}let S=s.installations.filter((t)=>!t.exists);if(S.length>0){I.message(` ${R.default.yellow("Missing installations:")}`);for(let t of S)I.message(` ${R.default.dim("•")} ${t.agent}: ${R.default.dim(t.path)}`)}console.log()}}async function Rt(){let l=D();l.start("Checking for orphaned entries..."),await bt(),l.stop(R.default.green("Cleaned up orphaned entries"))}var Y=d(sl(),1);import{existsSync as Xl,rmSync as jy}from"fs";import{resolve as My}from"path";function $s(l){return l.type==="global"?l.path:My(process.cwd(),l.path)}async function Hy(l){try{if(Xl(l))jy(l,{recursive:!0,force:!0});return{success:!0}}catch(s){return{success:!1,error:s instanceof Error?s.message:"Unknown error"}}}async function Tt(l=[],s={}){let f=yl(),y=[];if(Object.keys(f.skills).length===0)return I.warn("No skills tracked. Install skills with:"),console.log(),I.message(` ${Y.default.cyan("npx give-skill <repo>")}`),console.log(),[];let i=Object.entries(f.skills).map(([w,n])=>({skillName:w,state:n})),S;if(l.length>0){let w=new Set(l.map((n)=>n.toLowerCase()));S=i.filter(({skillName:n})=>w.has(n.toLowerCase()))}else{let n=i.map(({skillName:L,state:J})=>{let T=J.installations.map((X)=>({installation:X,resolvedPath:$s(X)})).filter(({resolvedPath:X})=>Xl(X));return{value:L,label:L,hint:T.length>0?`${T.length} installation${T.length!==1?"s":""}`:"no valid installations"}}).filter((L)=>L.hint!=="no valid installations");if(n.length===0)return I.warn("No valid installations found"),[];if(s.yes)S=i.filter(({skillName:L})=>n.some((J)=>J.value===L));else{let L=await o({message:"Select skills to remove",options:n,required:!0,initialValues:n.map((T)=>T.value)});if(K(L))return V("Remove cancelled"),[];let J=L;S=i.filter(({skillName:T})=>J.includes(T))}}if(S.length===0){if(l.length>0){I.error(`No matching skills found for: ${l.join(", ")}`),I.info("Tracked skills:");for(let w of i)I.message(` - ${Y.default.cyan(w.skillName)}`)}return[]}console.log(),I.step(Y.default.bold("Skills to Remove"));let t=[];for(let{skillName:w,state:n}of S){let L=n.installations;if(s.agent&&s.agent.length>0){let T=new Set(s.agent);L=L.filter((X)=>T.has(X.agent))}if(s.global!==void 0){let T=s.global?"global":"project";L=L.filter((X)=>X.type===T)}let J=L.map((T)=>({installation:T,resolvedPath:$s(T)})).filter(({resolvedPath:T})=>Xl(T));if(J.length>0){t.push({skillName:w,installations:J}),I.message(` ${Y.default.cyan(w)}`);for(let{resolvedPath:T}of J)I.message(` ${Y.default.dim("→")} ${T}`)}}if(t.length===0)return I.warn("No installations match the specified criteria"),[];let $=l.length===0,c;if(s.yes||$)c=t.map(({skillName:w})=>w);else{let w=t.map(({skillName:L,installations:J})=>({value:L,label:L,hint:`${J.length} installation${J.length!==1?"s":""}`})),n=await o({message:"Select skills to remove",options:w,required:!0,initialValues:t.map(({skillName:L})=>L)});if(K(n))return V("Remove cancelled"),[];c=n}console.log(),I.step(Y.default.bold("Will Remove"));for(let w of c){let n=t.find((L)=>L.skillName===w);if(n){I.message(` ${Y.default.cyan(n.skillName)}`);for(let{resolvedPath:L}of n.installations)I.message(` ${Y.default.dim("→")} ${L}`)}}if(console.log(),!s.yes){let w=await fl({message:"Remove these skills?"});if(K(w)||!w)return V("Remove cancelled"),[]}let k=D();k.start(`Removing ${c.length} skill${c.length>1?"s":""}...`);for(let{skillName:w,installations:n}of t){if(!c.includes(w))continue;let L={skillName:w,success:!0,removed:0,failed:0,installations:[]};for(let{installation:J,resolvedPath:T}of n){let X=await Hy(T);if(L.installations.push({agent:z[J.agent].displayName,path:T,removed:X.success,error:X.error}),X.success)L.removed++,Gl(w,J.agent,J.path);else L.failed++,L.success=!1}y.push(L)}k.stop("Remove complete"),console.log();let b=y.filter((w)=>w.success&&w.removed>0),U=y.filter((w)=>!w.success||w.failed>0);if(b.length>0){I.success(Y.default.green(`Removed ${b.length} skill${b.length!==1?"s":""}`));for(let w of b)I.message(` ${Y.default.green("✓")} ${Y.default.cyan(w.skillName)}`),I.message(` ${Y.default.dim(`${w.removed} installation${w.removed!==1?"s":""} removed`)}`)}if(U.length>0){console.log(),I.error(Y.default.red(`Failed to remove ${U.length} skill${U.length!==1?"s":""}`));for(let w of U){I.message(` ${Y.default.red("✗")} ${Y.default.cyan(w.skillName)}`);for(let n of w.installations.filter((L)=>!L.removed))if(n.error)I.message(` ${Y.default.dim(n.error)}`)}}return console.log(),j(Y.default.green("Done!")),y}async function Bt(){let l=yl();if(Object.keys(l.skills).length===0){I.warn("No skills tracked. Install skills with:"),console.log(),I.message(` ${Y.default.cyan("npx give-skill <repo>")}`),console.log();return}console.log(),I.step(Y.default.bold("Installed Skills"));for(let[s,f]of Object.entries(l.skills)){I.message(`${Y.default.cyan(s)}`);let y=f.installations.map((i)=>({installation:i,resolvedPath:$s(i)})).filter(({resolvedPath:i})=>Xl(i));if(y.length>0){I.message(` ${Y.default.dim("Installed in:")}`);for(let{installation:i,resolvedPath:S}of y){let t=i.type==="global"?"global":"project";I.message(` ${Y.default.dim("•")} ${z[i.agent].displayName} ${Y.default.dim(`(${t})`)}: ${Y.default.dim(S)}`)}}console.log()}}var _t={name:"give-skill",version:"1.1.0",description:"Universal skill installer for AI coding agents - Claude, Cursor, Copilot, and more",type:"module",bin:{"give-skill":"./dist/index.js"},files:["dist","README.md"],scripts:{build:"bun build src/index.ts --outdir dist --target node --minify",dev:"bun src/index.ts",prepublishOnly:"bun run build"},keywords:["cli","skills","claude","cursor","copilot","github-copilot","ai-agents","agent-skills","coding-assistant"],repository:{type:"git",url:"git+https://github.com/compilecafe/give-skill.git"},homepage:"https://github.com/compilecafe/give-skill#readme",bugs:{url:"https://github.com/compilecafe/give-skill/issues"},author:"Compile Café",license:"MIT",dependencies:{"@clack/prompts":"^0.11.0",commander:"^14.0.2",picocolors:"^1.1.1"},devDependencies:{"@types/bun":"latest"},module:"src/index.ts"};var Wy=_t.version;e.name("give-skill").description("Install skills onto coding agents (Claude Code, Cursor, Copilot, Gemini, Windsurf, Trae, Factory, Letta, OpenCode, Codex, Antigravity, Amp, Kilo, Roo, Goose)").version(Wy).argument("<source>","Git repo URL, GitHub shorthand (owner/repo), or direct path to skill").option("-g, --global","Install skill globally (user-level) instead of project-level").option("-a, --agent <agents...>","Specify agents to install to (windsurf, gemini, claude-code, cursor, copilot, etc.)").option("-s, --skill <skills...>","Specify skill names to install (skip selection prompt)").option("-l, --list","List available skills in the repository without installing").option("-y, --yes","Skip confirmation prompts").action(async(l,s)=>{await Ey(l,s)});e.command("update [skills...]").description("Update installed skills to their latest versions").option("-y, --yes","Skip confirmation prompts").action(async(l,s)=>{await xy(l,s)});e.command("status [skills...]").description("Check status of installed skills (updates available, orphaned, etc.)").action(async(l)=>{await Cy(l)});e.command("remove [skills...]").description("Remove installed skills").option("-g, --global","Remove from global location only").option("-a, --agent <agents...>","Remove from specific agents only").option("-y, --yes","Skip confirmation prompts").action(async(l,s)=>{await Ny(l,s)});e.command("list").description("List all installed skills").action(async()=>{await Vy()});e.command("clean").description("Remove orphaned skill entries from state").action(async()=>{await Ay()});e.parse();async function Ey(l,s){console.log(),ll(Z.default.bgCyan(Z.default.black(" give-skill ")));try{let f=await nt(l,s);if(!f.success&&f.installed===0&&f.failed===0)process.exit(1);if(f.failed>0)process.exit(1)}catch(f){I.error(f instanceof Error?f.message:"Unknown error occurred"),j(Z.default.red("Installation failed")),process.exit(1)}}async function xy(l,s){console.log(),ll(Z.default.bgCyan(Z.default.black(" give-skill ")));try{await Ut(l.length>0?l:void 0,s)}catch(f){I.error(f instanceof Error?f.message:"Unknown error occurred"),j(Z.default.red("Update failed")),process.exit(1)}}async function Cy(l){console.log(),ll(Z.default.bgCyan(Z.default.black(" give-skill ")));try{let s=await Ss(l.length>0?l:void 0);await Lt(s),j("Done!")}catch(s){I.error(s instanceof Error?s.message:"Unknown error occurred"),j(Z.default.red("Status check failed")),process.exit(1)}}async function Ny(l,s){console.log(),ll(Z.default.bgCyan(Z.default.black(" give-skill ")));try{await Tt(l,s)}catch(f){I.error(f instanceof Error?f.message:"Unknown error occurred"),j(Z.default.red("Remove failed")),process.exit(1)}}async function Vy(){console.log(),ll(Z.default.bgCyan(Z.default.black(" give-skill ")));try{await Bt(),j("Done!")}catch(l){I.error(l instanceof Error?l.message:"Unknown error occurred"),j(Z.default.red("List failed")),process.exit(1)}}async function Ay(){console.log(),ll(Z.default.bgCyan(Z.default.black(" give-skill ")));try{await Rt(),console.log(),j(Z.default.green("Done!"))}catch(l){I.error(l instanceof Error?l.message:"Unknown error occurred"),j(Z.default.red("Clean failed")),process.exit(1)}}
|