@descript/platform-cli 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +169 -0
- package/dist/descript-cli.cjs +136 -0
- package/package.json +39 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Descript, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# @descript/platform-cli
|
|
2
|
+
|
|
3
|
+
A command-line tool for interacting with the [Descript API](https://docs.descriptapi.com). Import media and run AI agents.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i -g @descript/platform-cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Configure API key
|
|
15
|
+
descript-api config set api-key
|
|
16
|
+
|
|
17
|
+
# Import media to a new project
|
|
18
|
+
descript-api import --name "My Project" --media "https://example.com/video.mp4"
|
|
19
|
+
|
|
20
|
+
# Run AI editing on a project
|
|
21
|
+
descript-api agent --project-id <uuid> --prompt "add studio sound"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Commands
|
|
25
|
+
|
|
26
|
+
### `import`
|
|
27
|
+
|
|
28
|
+
Import media files, sequences, and compositions into a project.
|
|
29
|
+
|
|
30
|
+
**Simple mode** (CLI arguments):
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Create new project with media
|
|
34
|
+
descript-api import --name "My Project" --media "https://example.com/video.mp4"
|
|
35
|
+
|
|
36
|
+
# Import to existing project
|
|
37
|
+
descript-api import --project-id <uuid> --media "https://example.com/video.mp4"
|
|
38
|
+
|
|
39
|
+
# Import multiple files
|
|
40
|
+
descript-api import --name "My Project" \
|
|
41
|
+
--media "https://example.com/video1.mp4" \
|
|
42
|
+
--media "https://example.com/video2.mp4"
|
|
43
|
+
|
|
44
|
+
# Import with webhook callback
|
|
45
|
+
descript-api import --name "My Project" \
|
|
46
|
+
--media "https://example.com/video.mp4" \
|
|
47
|
+
--callback-url "https://myapp.com/webhooks/descript"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Interactive mode** (no `--media` flag):
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
descript-api import
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The interactive builder lets you:
|
|
57
|
+
- **Add media files** — Import from URLs with optional custom names
|
|
58
|
+
- **Add sequences** — Create multitrack sequences (e.g., multicam) with time offsets
|
|
59
|
+
- **Add compositions** — Build timelines by selecting media and sequences
|
|
60
|
+
|
|
61
|
+
**Options:**
|
|
62
|
+
|
|
63
|
+
| Option | Description |
|
|
64
|
+
|--------|-------------|
|
|
65
|
+
| `-n, --name <name>` | Project name (for new projects) |
|
|
66
|
+
| `-p, --project-id <id>` | Existing project UUID |
|
|
67
|
+
| `-m, --media <urls...>` | Media URL(s) to import (simple mode) |
|
|
68
|
+
| `--team-access <level>` | Team access level: `edit`, `comment`, `none` |
|
|
69
|
+
| `--callback-url <url>` | Webhook URL for job completion notifications |
|
|
70
|
+
| `--timeout <minutes>` | Job polling timeout in minutes (default: 30) |
|
|
71
|
+
| `--new` | Create new project with default name |
|
|
72
|
+
| `--no-composition` | Skip creating a composition with imported media |
|
|
73
|
+
|
|
74
|
+
### `agent`
|
|
75
|
+
|
|
76
|
+
Run AI agent editing on a project.
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# Edit an existing project
|
|
80
|
+
descript-api agent --project-id <uuid> --prompt "add studio sound to all clips"
|
|
81
|
+
|
|
82
|
+
# Create a new project and edit it
|
|
83
|
+
descript-api agent --name "My Project" --prompt "remove filler words"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**Options:**
|
|
87
|
+
|
|
88
|
+
| Option | Description |
|
|
89
|
+
|--------|-------------|
|
|
90
|
+
| `-p, --project-id <id>` | Existing project UUID |
|
|
91
|
+
| `-n, --name <name>` | Project name (for new projects) |
|
|
92
|
+
| `-c, --composition-id <id>` | Specific composition (optional) |
|
|
93
|
+
| `--prompt <prompt>` | Natural language editing instruction |
|
|
94
|
+
| `--model <model>` | AI model to use for editing |
|
|
95
|
+
| `--callback-url <url>` | Webhook URL for job notifications |
|
|
96
|
+
| `--timeout <minutes>` | Job polling timeout in minutes (default: 30) |
|
|
97
|
+
| `--new` | Create new project with default name |
|
|
98
|
+
|
|
99
|
+
## Configuration
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# Interactive configuration menu
|
|
103
|
+
descript-api config
|
|
104
|
+
|
|
105
|
+
# Show all configuration values
|
|
106
|
+
descript-api config list
|
|
107
|
+
|
|
108
|
+
# Set values (prompts if value not provided)
|
|
109
|
+
descript-api config set api-key
|
|
110
|
+
descript-api config set api-url <url>
|
|
111
|
+
|
|
112
|
+
# Get values
|
|
113
|
+
descript-api config get api-key
|
|
114
|
+
descript-api config get api-url
|
|
115
|
+
|
|
116
|
+
# Clear values (revert to default)
|
|
117
|
+
descript-api config clear api-url
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Configuration Keys
|
|
121
|
+
|
|
122
|
+
| Key | Description |
|
|
123
|
+
|-----|-------------|
|
|
124
|
+
| `api-key` | Your Descript API key (format: `dx_bearer_...:dx_secret_...`) |
|
|
125
|
+
| `api-url` | API base URL (default: `https://descriptapi.com/v1/`) |
|
|
126
|
+
| `debug` | Enable debug mode to print API requests (default: `false`) |
|
|
127
|
+
|
|
128
|
+
Configuration is saved to `~/.descript-cli/config.json`.
|
|
129
|
+
|
|
130
|
+
### Profiles
|
|
131
|
+
|
|
132
|
+
Profiles let you manage multiple configurations (e.g., development, staging, production):
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
# List all profiles (* marks active)
|
|
136
|
+
descript-api config profiles
|
|
137
|
+
|
|
138
|
+
# Create and switch to a new profile
|
|
139
|
+
descript-api config profile:create staging
|
|
140
|
+
descript-api config profile staging
|
|
141
|
+
|
|
142
|
+
# Delete a profile
|
|
143
|
+
descript-api config profile:delete staging
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Environment Variables
|
|
147
|
+
|
|
148
|
+
Environment variables override config file values:
|
|
149
|
+
|
|
150
|
+
| Variable | Description |
|
|
151
|
+
|----------|-------------|
|
|
152
|
+
| `DESCRIPT_API_KEY` | API key |
|
|
153
|
+
| `DESCRIPT_API_URL` | API base URL |
|
|
154
|
+
| `DESCRIPT_DEBUG` | Enable debug mode (`true` or `1`) |
|
|
155
|
+
| `DESCRIPT_PROFILE` | Use a specific profile for the command |
|
|
156
|
+
|
|
157
|
+
### Debug Mode
|
|
158
|
+
|
|
159
|
+
Enable debug mode to see detailed API request information:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
# Enable via config
|
|
163
|
+
descript-api config set debug true
|
|
164
|
+
|
|
165
|
+
# Or via environment variable
|
|
166
|
+
DESCRIPT_DEBUG=true descript-api import --name "Test" --media "https://example.com/video.mp4"
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
When enabled, all API requests will print to stderr showing the HTTP method, URL, headers (with masked API key), and request body.
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";var Ji=Object.create;var kt=Object.defineProperty;var zi=Object.getOwnPropertyDescriptor;var Yi=Object.getOwnPropertyNames;var Zi=Object.getPrototypeOf,Qi=Object.prototype.hasOwnProperty;var q=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Xi=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Yi(e))!Qi.call(r,s)&&s!==t&&kt(r,s,{get:()=>e[s],enumerable:!(n=zi(e,s))||n.enumerable});return r};var Q=(r,e,t)=>(t=r!=null?Ji(Zi(r)):{},Xi(e||!r||!r.__esModule?kt(t,"default",{value:r,enumerable:!0}):t,r));var me=q(Je=>{var ye=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},Ke=class extends ye{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Je.CommanderError=ye;Je.InvalidArgumentError=Ke});var _e=q(Ye=>{var{InvalidArgumentError:er}=me(),ze=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new er(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,n):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function tr(r){let e=r.name()+(r.variadic===!0?"...":"");return r.required?"<"+e+">":"["+e+"]"}Ye.Argument=ze;Ye.humanReadableArgName=tr});var Qe=q(jt=>{var{humanReadableArgName:ir}=_e(),Ze=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let t=e.commands.filter(s=>!s._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((s,u)=>s.name().localeCompare(u.name())),t}compareOptions(e,t){let n=s=>s.short?s.short.replace(/^-/,""):s.long.replace(/^--/,"");return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(s=>!s.hidden),n=e._getHelpOption();if(n&&!n.hidden){let s=n.short&&e._findOption(n.short),u=n.long&&e._findOption(n.long);!s&&!u?t.push(n):n.long&&!u?t.push(e.createOption(n.long,n.description)):n.short&&!s&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let s=n.options.filter(u=>!u.hidden);t.push(...s)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(n=>ir(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((n,s)=>Math.max(n,t.subcommandTerm(s).length),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((n,s)=>Math.max(n,t.optionTerm(s).length),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((n,s)=>Math.max(n,t.optionTerm(s).length),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((n,s)=>Math.max(n,t.argumentTerm(s).length),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let s=e.parent;s;s=s.parent)n=s.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];return e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,t){let n=t.padWidth(e,t),s=t.helpWidth||80,u=2,i=2;function o(p,f){if(f){let g=`${p.padEnd(n+i)}${f}`;return t.wrap(g,s-u,n+i)}return p}function a(p){return p.join(`
|
|
3
|
+
`).replace(/^/gm," ".repeat(u))}let l=[`Usage: ${t.commandUsage(e)}`,""],c=t.commandDescription(e);c.length>0&&(l=l.concat([t.wrap(c,s,0),""]));let h=t.visibleArguments(e).map(p=>o(t.argumentTerm(p),t.argumentDescription(p)));h.length>0&&(l=l.concat(["Arguments:",a(h),""]));let m=t.visibleOptions(e).map(p=>o(t.optionTerm(p),t.optionDescription(p)));if(m.length>0&&(l=l.concat(["Options:",a(m),""])),this.showGlobalOptions){let p=t.visibleGlobalOptions(e).map(f=>o(t.optionTerm(f),t.optionDescription(f)));p.length>0&&(l=l.concat(["Global Options:",a(p),""]))}let C=t.visibleCommands(e).map(p=>o(t.subcommandTerm(p),t.subcommandDescription(p)));return C.length>0&&(l=l.concat(["Commands:",a(C),""])),l.join(`
|
|
4
|
+
`)}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,n,s=40){let u=" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",i=new RegExp(`[\\n][${u}]+`);if(e.match(i))return e;let o=t-n;if(o<s)return e;let a=e.slice(0,n),l=e.slice(n).replace(`\r
|
|
5
|
+
`,`
|
|
6
|
+
`),c=" ".repeat(n),m="\\s\u200B",C=new RegExp(`
|
|
7
|
+
|.{1,${o-1}}([${m}]|$)|[^${m}]+?([${m}]|$)`,"g"),p=l.match(C)||[];return a+p.map((f,g)=>f===`
|
|
8
|
+
`?"":(g>0?c:"")+f.trimEnd()).join(`
|
|
9
|
+
`)}};jt.Help=Ze});var it=q(tt=>{var{InvalidArgumentError:rr}=me(),Xe=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=sr(e);this.short=n.shortFlag,this.long=n.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}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e=="string"&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new rr(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,n):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return nr(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},et=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let s=this.negativeOptions.get(n).presetArg,u=s!==void 0?s:!1;return t.negate===(u===e)}};function nr(r){return r.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function sr(r){let e,t,n=r.split(/[ |,]+/);return n.length>1&&!/^[[<]/.test(n[1])&&(e=n.shift()),t=n.shift(),!e&&/^-[^-]$/.test(t)&&(e=t,t=void 0),{shortFlag:e,longFlag:t}}tt.Option=Xe;tt.DualOptions=et});var Tt=q(Rt=>{function ur(r,e){if(Math.abs(r.length-e.length)>3)return Math.max(r.length,e.length);let t=[];for(let n=0;n<=r.length;n++)t[n]=[n];for(let n=0;n<=e.length;n++)t[0][n]=n;for(let n=1;n<=e.length;n++)for(let s=1;s<=r.length;s++){let u=1;r[s-1]===e[n-1]?u=0:u=1,t[s][n]=Math.min(t[s-1][n]+1,t[s][n-1]+1,t[s-1][n-1]+u),s>1&&n>1&&r[s-1]===e[n-2]&&r[s-2]===e[n-1]&&(t[s][n]=Math.min(t[s][n],t[s-2][n-2]+1))}return t[r.length][e.length]}function or(r,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let t=r.startsWith("--");t&&(r=r.slice(2),e=e.map(i=>i.slice(2)));let n=[],s=3,u=.4;return e.forEach(i=>{if(i.length<=1)return;let o=ur(r,i),a=Math.max(r.length,i.length);(a-o)/a>u&&(o<s?(s=o,n=[i]):o===s&&n.push(i))}),n.sort((i,o)=>i.localeCompare(o)),t&&(n=n.map(i=>`--${i}`)),n.length>1?`
|
|
10
|
+
(Did you mean one of ${n.join(", ")}?)`:n.length===1?`
|
|
11
|
+
(Did you mean ${n[0]}?)`:""}Rt.suggestSimilar=or});var qt=q(Ut=>{var ar=require("node:events").EventEmitter,rt=require("node:child_process"),L=require("node:path"),nt=require("node:fs"),$=require("node:process"),{Argument:Dr,humanReadableArgName:lr}=_e(),{CommanderError:st}=me(),{Help:cr}=Qe(),{Option:Vt,DualOptions:pr}=it(),{suggestSimilar:Mt}=Tt(),ut=class r extends ar{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",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._outputConfiguration={writeOut:t=>$.stdout.write(t),writeErr:t=>$.stderr.write(t),getOutHelpWidth:()=>$.stdout.isTTY?$.stdout.columns:void 0,getErrHelpWidth:()=>$.stderr.isTTY?$.stderr.columns:void 0,outputError:(t,n)=>n(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let s=t,u=n;typeof s=="object"&&s!==null&&(u=s,s=null),u=u||{};let[,i,o]=e.match(/([^ ]+) *(.*)/),a=this.createCommand(i);return s&&(a.description(s),a._executableHandler=!0),u.isDefault&&(this._defaultCommandName=a._name),a._hidden=!!(u.noHelp||u.hidden),a._executableFile=u.executableFile||null,o&&a.arguments(o),this._registerCommand(a),a.parent=this,a.copyInheritedSettings(this),s?this:a}createCommand(e){return new r(e)}createHelp(){return Object.assign(new cr,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
|
|
12
|
+
- specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new Dr(e,t)}argument(e,t,n,s){let u=this.createArgument(e,t);return typeof n=="function"?u.default(s).argParser(n):u.default(n),this.addArgument(u),this}arguments(e){return e.trim().split(/ +/).forEach(t=>{this.argument(t)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";let[,n,s]=e.match(/([^ ]+) *(.*)/),u=t??"display help for command",i=this.createCommand(n);return i.helpOption(!1),s&&i.arguments(s),u&&i.description(u),this._addImplicitHelpCommand=!0,this._helpCommand=i,this}addHelpCommand(e,t){return typeof e!="object"?(this.helpCommand(e,t),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
|
|
13
|
+
Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync")throw t},this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new st(e,t,n)),$.exit(e)}action(e){let t=n=>{let s=this.registeredArguments.length,u=n.slice(0,s);return this._storeOptionsAsProperties?u[s]=this:u[s]=this.opts(),u.push(this),e.apply(this,u)};return this._actionHandler=t,this}createOption(e,t){return new Vt(e,t)}_callParseArg(e,t,n,s){try{return e.parseArg(t,n)}catch(u){if(u.code==="commander.invalidArgument"){let i=`${s} ${u.message}`;this.error(i,{exitCode:u.exitCode,code:u.code})}throw u}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
|
|
14
|
+
- already used by option '${t.flags}'`)}this.options.push(e)}_registerCommand(e){let t=s=>[s.name()].concat(s.aliases()),n=t(e).find(s=>this._findCommand(s));if(n){let s=t(this._findCommand(n)).join("|"),u=t(e).join("|");throw new Error(`cannot add command '${u}' as already have command '${s}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),n=e.attributeName();if(e.negate){let u=e.long.replace(/^--no-/,"--");this._findOption(u)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let s=(u,i,o)=>{u==null&&e.presetArg!==void 0&&(u=e.presetArg);let a=this.getOptionValue(n);u!==null&&e.parseArg?u=this._callParseArg(e,u,a,i):u!==null&&e.variadic&&(u=e._concatValue(u,a)),u==null&&(e.negate?u=!1:e.isBoolean()||e.optional?u=!0:u=""),this.setOptionValueWithSource(n,u,o)};return this.on("option:"+t,u=>{let i=`error: option '${e.flags}' argument '${u}' is invalid.`;s(u,i,"cli")}),e.envVar&&this.on("optionEnv:"+t,u=>{let i=`error: option '${e.flags}' value '${u}' from env '${e.envVar}' is invalid.`;s(u,i,"env")}),this}_optionEx(e,t,n,s,u){if(typeof t=="object"&&t instanceof Vt)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let i=this.createOption(t,n);if(i.makeOptionMandatory(!!e.mandatory),typeof s=="function")i.default(u).argParser(s);else if(s instanceof RegExp){let o=s;s=(a,l)=>{let c=o.exec(a);return c?c[0]:l},i.default(u).argParser(s)}else i.default(s);return this.addOption(i)}option(e,t,n,s){return this._optionEx({},e,t,n,s)}requiredOption(e,t,n,s){return this._optionEx({mandatory:!0},e,t,n,s)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(t=n.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(t=t||{},e===void 0&&t.from===void 0){$.versions?.electron&&(t.from="electron");let s=$.execArgv??[];(s.includes("-e")||s.includes("--eval")||s.includes("-p")||s.includes("--print"))&&(t.from="eval")}e===void 0&&(e=$.argv),this.rawArgs=e.slice();let n;switch(t.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":$.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,t){let n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){let n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_executeSubCommand(e,t){t=t.slice();let n=!1,s=[".js",".ts",".tsx",".mjs",".cjs"];function u(c,h){let m=L.resolve(c,h);if(nt.existsSync(m))return m;if(s.includes(L.extname(h)))return;let C=s.find(p=>nt.existsSync(`${m}${p}`));if(C)return`${m}${C}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=e._executableFile||`${this._name}-${e._name}`,o=this._executableDir||"";if(this._scriptPath){let c;try{c=nt.realpathSync(this._scriptPath)}catch{c=this._scriptPath}o=L.resolve(L.dirname(c),o)}if(o){let c=u(o,i);if(!c&&!e._executableFile&&this._scriptPath){let h=L.basename(this._scriptPath,L.extname(this._scriptPath));h!==this._name&&(c=u(o,`${h}-${e._name}`))}i=c||i}n=s.includes(L.extname(i));let a;$.platform!=="win32"?n?(t.unshift(i),t=Nt($.execArgv).concat(t),a=rt.spawn($.argv[0],t,{stdio:"inherit"})):a=rt.spawn(i,t,{stdio:"inherit"}):(t.unshift(i),t=Nt($.execArgv).concat(t),a=rt.spawn($.execPath,t,{stdio:"inherit"})),a.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(h=>{$.on(h,()=>{a.killed===!1&&a.exitCode===null&&a.kill(h)})});let l=this._exitCallback;a.on("close",c=>{c=c??1,l?l(new st(c,"commander.executeSubCommandAsync","(close)")):$.exit(c)}),a.on("error",c=>{if(c.code==="ENOENT"){let h=o?`searched for local subcommand relative to directory '${o}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",m=`'${i}' does not exist
|
|
15
|
+
- if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
16
|
+
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
17
|
+
- ${h}`;throw new Error(m)}else if(c.code==="EACCES")throw new Error(`'${i}' not executable`);if(!l)$.exit(1);else{let h=new st(1,"commander.executeSubCommandAsync","(error)");h.nestedError=c,l(h)}}),this.runningCommand=a}_dispatchSubcommand(e,t,n){let s=this._findCommand(e);s||this.help({error:!0});let u;return u=this._chainOrCallSubCommandHook(u,s,"preSubcommand"),u=this._chainOrCall(u,()=>{if(s._executableHandler)this._executeSubCommand(s,t.concat(n));else return s._parseCommand(t,n)}),u}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,s,u)=>{let i=s;if(s!==null&&n.parseArg){let o=`error: command-argument value '${s}' is invalid for argument '${n.name()}'.`;i=this._callParseArg(n,s,u,o)}return i};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((n,s)=>{let u=n.defaultValue;n.variadic?s<this.args.length?(u=this.args.slice(s),n.parseArg&&(u=u.reduce((i,o)=>e(n,o,i),n.defaultValue))):u===void 0&&(u=[]):s<this.args.length&&(u=this.args[s],n.parseArg&&(u=e(n,u,n.defaultValue))),t[s]=u}),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&typeof e.then=="function"?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e,s=[];return this._getCommandAndAncestors().reverse().filter(u=>u._lifeCycleHooks[t]!==void 0).forEach(u=>{u._lifeCycleHooks[t].forEach(i=>{s.push({hookedCommand:u,callback:i})})}),t==="postAction"&&s.reverse(),s.forEach(u=>{n=this._chainOrCall(n,()=>u.callback(u.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let s=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(u=>{s=this._chainOrCall(s,()=>u(this,t))}),s}_parseCommand(e,t){let n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},u=`command:${this.name()}`;if(this._actionHandler){s(),this._processArguments();let i;return i=this._chainOrCallHooks(i,"preAction"),i=this._chainOrCall(i,()=>this._actionHandler(this.processedArgs)),this.parent&&(i=this._chainOrCall(i,()=>{this.parent.emit(u,e,t)})),i=this._chainOrCallHooks(i,"postAction"),i}if(this.parent&&this.parent.listenerCount(u))s(),this._processArguments(),this.parent.emit(u,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(s(),this._processArguments())}else this.commands.length?(s(),this.help({error:!0})):(s(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let s=n.attributeName();return this.getOptionValue(s)===void 0?!1:this.getOptionValueSource(s)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let s=e.find(u=>n.conflictsWith.includes(u.attributeName()));s&&this._conflictingOption(n,s)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],n=[],s=t,u=e.slice();function i(a){return a.length>1&&a[0]==="-"}let o=null;for(;u.length;){let a=u.shift();if(a==="--"){s===n&&s.push(a),s.push(...u);break}if(o&&!i(a)){this.emit(`option:${o.name()}`,a);continue}if(o=null,i(a)){let l=this._findOption(a);if(l){if(l.required){let c=u.shift();c===void 0&&this.optionMissingArgument(l),this.emit(`option:${l.name()}`,c)}else if(l.optional){let c=null;u.length>0&&!i(u[0])&&(c=u.shift()),this.emit(`option:${l.name()}`,c)}else this.emit(`option:${l.name()}`);o=l.variadic?l:null;continue}}if(a.length>2&&a[0]==="-"&&a[1]!=="-"){let l=this._findOption(`-${a[1]}`);if(l){l.required||l.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${l.name()}`,a.slice(2)):(this.emit(`option:${l.name()}`),u.unshift(`-${a.slice(2)}`));continue}}if(/^--[^=]+=/.test(a)){let l=a.indexOf("="),c=this._findOption(a.slice(0,l));if(c&&(c.required||c.optional)){this.emit(`option:${c.name()}`,a.slice(l+1));continue}}if(i(a)&&(s=n),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(a)){t.push(a),u.length>0&&n.push(...u);break}else if(this._getHelpCommand()&&a===this._getHelpCommand().name()){t.push(a),u.length>0&&t.push(...u);break}else if(this._defaultCommandName){n.push(a),u.length>0&&n.push(...u);break}}if(this._passThroughOptions){s.push(a),u.length>0&&s.push(...u);break}s.push(a)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let n=0;n<t;n++){let s=this.options[n].attributeName();e[s]=s===this._versionOptionName?this._version:this[s]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}
|
|
18
|
+
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
19
|
+
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
20
|
+
`),this.outputHelp({error:!0}));let n=t||{},s=n.exitCode||1,u=n.code||"commander.error";this._exit(s,u,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in $.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,$.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new pr(this.options),t=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(s=>!t(s)).forEach(s=>{this.setOptionValueWithSource(s,n.implied[s],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let n=i=>{let o=i.attributeName(),a=this.getOptionValue(o),l=this.options.find(h=>h.negate&&o===h.attributeName()),c=this.options.find(h=>!h.negate&&o===h.attributeName());return l&&(l.presetArg===void 0&&a===!1||l.presetArg!==void 0&&a===l.presetArg)?l:c||i},s=i=>{let o=n(i),a=o.attributeName();return this.getOptionValueSource(a)==="env"?`environment variable '${o.envVar}'`:`option '${o.flags}'`},u=`error: ${s(e)} cannot be used with ${s(t)}`;this.error(u,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let s=[],u=this;do{let i=u.createHelp().visibleOptions(u).filter(o=>o.long).map(o=>o.long);s=s.concat(i),u=u.parent}while(u&&!u._enablePositionalOptions);t=Mt(e,s)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?"":"s",u=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${n} but got ${e.length}.`;this.error(u,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let s=[];this.createHelp().visibleCommands(this).forEach(u=>{s.push(u.name()),u.alias()&&s.push(u.alias())}),t=Mt(e,s)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:"commander.unknownCommand"})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",n=n||"output the version number";let s=this.createOption(t,n);return this._versionOptionName=s.attributeName(),this._registerOption(s),this.on("option:"+s.name(),()=>{this._outputConfiguration.writeOut(`${e}
|
|
21
|
+
`),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let s=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${s}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map(n=>lr(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=L.basename(e,L.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp();return t.helpWidth===void 0&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){e=e||{};let t={error:!!e.error},n;return t.error?n=s=>this._outputConfiguration.writeErr(s):n=s=>this._outputConfiguration.writeOut(s),t.write=e.write||n,t.command=this,t}outputHelp(e){let t;typeof e=="function"&&(t=e,e=void 0);let n=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach(u=>u.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let s=this.helpInformation(n);if(t&&(s=t(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(u=>u.emit("afterAllHelp",n))}helpOption(e,t){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",t=t??"display help for command",this._helpOption=this.createOption(e,t),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let t=$.exitCode||0;t===0&&e&&typeof e!="function"&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
|
|
22
|
+
Expecting one of '${n.join("', '")}'`);let s=`${e}Help`;return this.on(s,u=>{let i;typeof t=="function"?i=t({error:u.error,command:u.command}):i=t,i&&u.write(`${i}
|
|
23
|
+
`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(s=>t.is(s))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Nt(r){return r.map(e=>{if(!e.startsWith("--inspect"))return e;let t,n="127.0.0.1",s="9229",u;return(u=e.match(/^(--inspect(-brk)?)$/))!==null?t=u[1]:(u=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=u[1],/^\d+$/.test(u[3])?s=u[3]:n=u[3]):(u=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=u[1],n=u[3],s=u[4]),t&&s!=="0"?`${t}=${n}:${parseInt(s)+1}`:e})}Ut.Command=ut});var Gt=q(I=>{var{Argument:Lt}=_e(),{Command:ot}=qt(),{CommanderError:hr,InvalidArgumentError:Ht}=me(),{Help:dr}=Qe(),{Option:Wt}=it();I.program=new ot;I.createCommand=r=>new ot(r);I.createOption=(r,e)=>new Wt(r,e);I.createArgument=(r,e)=>new Lt(r,e);I.Command=ot;I.Option=Wt;I.Argument=Lt;I.Help=dr;I.CommanderError=hr;I.InvalidArgumentError=Ht;I.InvalidOptionArgumentError=Ht});var Dt=q((ns,Jt)=>{"use strict";var at={to(r,e){return e?`\x1B[${e+1};${r+1}H`:`\x1B[${r+1}G`},move(r,e){let t="";return r<0?t+=`\x1B[${-r}D`:r>0&&(t+=`\x1B[${r}C`),e<0?t+=`\x1B[${-e}A`:e>0&&(t+=`\x1B[${e}B`),t},up:(r=1)=>`\x1B[${r}A`,down:(r=1)=>`\x1B[${r}B`,forward:(r=1)=>`\x1B[${r}C`,backward:(r=1)=>`\x1B[${r}D`,nextLine:(r=1)=>"\x1B[E".repeat(r),prevLine:(r=1)=>"\x1B[F".repeat(r),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},mr={up:(r=1)=>"\x1B[S".repeat(r),down:(r=1)=>"\x1B[T".repeat(r)},fr={screen:"\x1B[2J",up:(r=1)=>"\x1B[1J".repeat(r),down:(r=1)=>"\x1B[J".repeat(r),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(r){let e="";for(let t=0;t<r;t++)e+=this.line+(t<r-1?at.up():"");return r&&(e+=at.left),e}};Jt.exports={cursor:at,scroll:mr,erase:fr,beep:"\x07"}});var ct=q((ss,lt)=>{var xe=process||{},zt=xe.argv||[],ve=xe.env||{},gr=!(ve.NO_COLOR||zt.includes("--no-color"))&&(!!ve.FORCE_COLOR||zt.includes("--color")||xe.platform==="win32"||(xe.stdout||{}).isTTY&&ve.TERM!=="dumb"||!!ve.CI),Cr=(r,e,t=r)=>n=>{let s=""+n,u=s.indexOf(e,r.length);return~u?r+Fr(s,e,t,u)+e:r+s+e},Fr=(r,e,t,n)=>{let s="",u=0;do s+=r.substring(u,n)+t,u=n+e.length,n=r.indexOf(e,u);while(~n);return s+r.substring(u)},Yt=(r=gr)=>{let e=r?Cr:()=>String;return{isColorSupported:r,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};lt.exports=Yt();lt.exports.createColors=Yt});var Kt=Q(Gt(),1),{program:Kn,createCommand:Jn,createArgument:zn,createOption:Yn,CommanderError:Zn,InvalidArgumentError:Qn,InvalidOptionArgumentError:Xn,Command:X,Argument:es,Option:ts,Help:is}=Kt.default;var v=Q(Dt(),1),De=require("node:process"),ee=Q(require("node:readline"),1),dt=Q(require("node:readline"),1),oi=require("node:tty"),re=Q(ct(),1);function Er({onlyFirst:r=!1}={}){let e=["[\\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(e,r?void 0:"g")}var br=Er();function ai(r){if(typeof r!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof r}\``);return r.replace(br,"")}function Di(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var li={exports:{}};(function(r){var e={};r.exports=e,e.eastAsianWidth=function(n){var s=n.charCodeAt(0),u=n.length==2?n.charCodeAt(1):0,i=s;return 55296<=s&&s<=56319&&56320<=u&&u<=57343&&(s&=1023,u&=1023,i=s<<10|u,i+=65536),i==12288||65281<=i&&i<=65376||65504<=i&&i<=65510?"F":i==8361||65377<=i&&i<=65470||65474<=i&&i<=65479||65482<=i&&i<=65487||65490<=i&&i<=65495||65498<=i&&i<=65500||65512<=i&&i<=65518?"H":4352<=i&&i<=4447||4515<=i&&i<=4519||4602<=i&&i<=4607||9001<=i&&i<=9002||11904<=i&&i<=11929||11931<=i&&i<=12019||12032<=i&&i<=12245||12272<=i&&i<=12283||12289<=i&&i<=12350||12353<=i&&i<=12438||12441<=i&&i<=12543||12549<=i&&i<=12589||12593<=i&&i<=12686||12688<=i&&i<=12730||12736<=i&&i<=12771||12784<=i&&i<=12830||12832<=i&&i<=12871||12880<=i&&i<=13054||13056<=i&&i<=19903||19968<=i&&i<=42124||42128<=i&&i<=42182||43360<=i&&i<=43388||44032<=i&&i<=55203||55216<=i&&i<=55238||55243<=i&&i<=55291||63744<=i&&i<=64255||65040<=i&&i<=65049||65072<=i&&i<=65106||65108<=i&&i<=65126||65128<=i&&i<=65131||110592<=i&&i<=110593||127488<=i&&i<=127490||127504<=i&&i<=127546||127552<=i&&i<=127560||127568<=i&&i<=127569||131072<=i&&i<=194367||177984<=i&&i<=196605||196608<=i&&i<=262141?"W":32<=i&&i<=126||162<=i&&i<=163||165<=i&&i<=166||i==172||i==175||10214<=i&&i<=10221||10629<=i&&i<=10630?"Na":i==161||i==164||167<=i&&i<=168||i==170||173<=i&&i<=174||176<=i&&i<=180||182<=i&&i<=186||188<=i&&i<=191||i==198||i==208||215<=i&&i<=216||222<=i&&i<=225||i==230||232<=i&&i<=234||236<=i&&i<=237||i==240||242<=i&&i<=243||247<=i&&i<=250||i==252||i==254||i==257||i==273||i==275||i==283||294<=i&&i<=295||i==299||305<=i&&i<=307||i==312||319<=i&&i<=322||i==324||328<=i&&i<=331||i==333||338<=i&&i<=339||358<=i&&i<=359||i==363||i==462||i==464||i==466||i==468||i==470||i==472||i==474||i==476||i==593||i==609||i==708||i==711||713<=i&&i<=715||i==717||i==720||728<=i&&i<=731||i==733||i==735||768<=i&&i<=879||913<=i&&i<=929||931<=i&&i<=937||945<=i&&i<=961||963<=i&&i<=969||i==1025||1040<=i&&i<=1103||i==1105||i==8208||8211<=i&&i<=8214||8216<=i&&i<=8217||8220<=i&&i<=8221||8224<=i&&i<=8226||8228<=i&&i<=8231||i==8240||8242<=i&&i<=8243||i==8245||i==8251||i==8254||i==8308||i==8319||8321<=i&&i<=8324||i==8364||i==8451||i==8453||i==8457||i==8467||i==8470||8481<=i&&i<=8482||i==8486||i==8491||8531<=i&&i<=8532||8539<=i&&i<=8542||8544<=i&&i<=8555||8560<=i&&i<=8569||i==8585||8592<=i&&i<=8601||8632<=i&&i<=8633||i==8658||i==8660||i==8679||i==8704||8706<=i&&i<=8707||8711<=i&&i<=8712||i==8715||i==8719||i==8721||i==8725||i==8730||8733<=i&&i<=8736||i==8739||i==8741||8743<=i&&i<=8748||i==8750||8756<=i&&i<=8759||8764<=i&&i<=8765||i==8776||i==8780||i==8786||8800<=i&&i<=8801||8804<=i&&i<=8807||8810<=i&&i<=8811||8814<=i&&i<=8815||8834<=i&&i<=8835||8838<=i&&i<=8839||i==8853||i==8857||i==8869||i==8895||i==8978||9312<=i&&i<=9449||9451<=i&&i<=9547||9552<=i&&i<=9587||9600<=i&&i<=9615||9618<=i&&i<=9621||9632<=i&&i<=9633||9635<=i&&i<=9641||9650<=i&&i<=9651||9654<=i&&i<=9655||9660<=i&&i<=9661||9664<=i&&i<=9665||9670<=i&&i<=9672||i==9675||9678<=i&&i<=9681||9698<=i&&i<=9701||i==9711||9733<=i&&i<=9734||i==9737||9742<=i&&i<=9743||9748<=i&&i<=9749||i==9756||i==9758||i==9792||i==9794||9824<=i&&i<=9825||9827<=i&&i<=9829||9831<=i&&i<=9834||9836<=i&&i<=9837||i==9839||9886<=i&&i<=9887||9918<=i&&i<=9919||9924<=i&&i<=9933||9935<=i&&i<=9953||i==9955||9960<=i&&i<=9983||i==10045||i==10071||10102<=i&&i<=10111||11093<=i&&i<=11097||12872<=i&&i<=12879||57344<=i&&i<=63743||65024<=i&&i<=65039||i==65533||127232<=i&&i<=127242||127248<=i&&i<=127277||127280<=i&&i<=127337||127344<=i&&i<=127386||917760<=i&&i<=917999||983040<=i&&i<=1048573||1048576<=i&&i<=1114109?"A":"N"},e.characterLength=function(n){var s=this.eastAsianWidth(n);return s=="F"||s=="W"||s=="A"?2:1};function t(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var s=t(n),u=0,i=0;i<s.length;i++)u=u+this.characterLength(s[i]);return u},e.slice=function(n,s,u){textLen=e.length(n),s=s||0,u=u||1,s<0&&(s=textLen+s),u<0&&(u=textLen+u);for(var i="",o=0,a=t(n),l=0;l<a.length;l++){var c=a[l],h=e.length(c);if(o>=s-(h==2?1:0))if(o+h<=u)i+=c;else break;o+=h}return i}})(li);var Ar=li.exports,$r=Di(Ar),wr=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},yr=Di(wr);function fe(r,e={}){if(typeof r!="string"||r.length===0||(e={ambiguousIsNarrow:!0,...e},r=ai(r),r.length===0))return 0;r=r.replace(yr()," ");let t=e.ambiguousIsNarrow?1:2,n=0;for(let s of r){let u=s.codePointAt(0);if(!(u<=31||u>=127&&u<=159||u>=768&&u<=879))switch($r.eastAsianWidth(s)){case"F":case"W":n+=2;break;case"A":n+=t;break;default:n+=1}}return n}var pt=10,Zt=(r=0)=>e=>`\x1B[${e+r}m`,Qt=(r=0)=>e=>`\x1B[${38+r};5;${e}m`,Xt=(r=0)=>(e,t,n)=>`\x1B[${38+r};2;${e};${t};${n}m`,A={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(A.modifier);var _r=Object.keys(A.color),vr=Object.keys(A.bgColor);[..._r,...vr];function xr(){let r=new Map;for(let[e,t]of Object.entries(A)){for(let[n,s]of Object.entries(t))A[n]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},t[n]=A[n],r.set(s[0],s[1]);Object.defineProperty(A,e,{value:t,enumerable:!1})}return Object.defineProperty(A,"codes",{value:r,enumerable:!1}),A.color.close="\x1B[39m",A.bgColor.close="\x1B[49m",A.color.ansi=Zt(),A.color.ansi256=Qt(),A.color.ansi16m=Xt(),A.bgColor.ansi=Zt(pt),A.bgColor.ansi256=Qt(pt),A.bgColor.ansi16m=Xt(pt),Object.defineProperties(A,{rgbToAnsi256:{value:(e,t,n)=>e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(u=>u+u).join(""));let s=Number.parseInt(n,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:e=>A.rgbToAnsi256(...A.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,s;if(e>=232)t=((e-232)*10+8)/255,n=t,s=t;else{e-=16;let o=e%36;t=Math.floor(e/36)/5,n=Math.floor(o/6)/5,s=o%6/5}let u=Math.max(t,n,s)*2;if(u===0)return 30;let i=30+(Math.round(s)<<2|Math.round(n)<<1|Math.round(t));return u===2&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>A.ansi256ToAnsi(A.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>A.ansi256ToAnsi(A.hexToAnsi256(e)),enumerable:!1}}),A}var Br=xr(),Pe=new Set(["\x1B","\x9B"]),Or=39,mt="\x07",ci="[",Sr="]",pi="m",ft=`${Sr}8;;`,ei=r=>`${Pe.values().next().value}${ci}${r}${pi}`,ti=r=>`${Pe.values().next().value}${ft}${r}${mt}`,Ir=r=>r.split(" ").map(e=>fe(e)),ht=(r,e,t)=>{let n=[...e],s=!1,u=!1,i=fe(ai(r[r.length-1]));for(let[o,a]of n.entries()){let l=fe(a);if(i+l<=t?r[r.length-1]+=a:(r.push(a),i=0),Pe.has(a)&&(s=!0,u=n.slice(o+1).join("").startsWith(ft)),s){u?a===mt&&(s=!1,u=!1):a===pi&&(s=!1);continue}i+=l,i===t&&o<n.length-1&&(r.push(""),i=0)}!i&&r[r.length-1].length>0&&r.length>1&&(r[r.length-2]+=r.pop())},Pr=r=>{let e=r.split(" "),t=e.length;for(;t>0&&!(fe(e[t-1])>0);)t--;return t===e.length?r:e.slice(0,t).join(" ")+e.slice(t).join("")},kr=(r,e,t={})=>{if(t.trim!==!1&&r.trim()==="")return"";let n="",s,u,i=Ir(r),o=[""];for(let[l,c]of r.split(" ").entries()){t.trim!==!1&&(o[o.length-1]=o[o.length-1].trimStart());let h=fe(o[o.length-1]);if(l!==0&&(h>=e&&(t.wordWrap===!1||t.trim===!1)&&(o.push(""),h=0),(h>0||t.trim===!1)&&(o[o.length-1]+=" ",h++)),t.hard&&i[l]>e){let m=e-h,C=1+Math.floor((i[l]-m-1)/e);Math.floor((i[l]-1)/e)<C&&o.push(""),ht(o,c,e);continue}if(h+i[l]>e&&h>0&&i[l]>0){if(t.wordWrap===!1&&h<e){ht(o,c,e);continue}o.push("")}if(h+i[l]>e&&t.wordWrap===!1){ht(o,c,e);continue}o[o.length-1]+=c}t.trim!==!1&&(o=o.map(l=>Pr(l)));let a=[...o.join(`
|
|
24
|
+
`)];for(let[l,c]of a.entries()){if(n+=c,Pe.has(c)){let{groups:m}=new RegExp(`(?:\\${ci}(?<code>\\d+)m|\\${ft}(?<uri>.*)${mt})`).exec(a.slice(l).join(""))||{groups:{}};if(m.code!==void 0){let C=Number.parseFloat(m.code);s=C===Or?void 0:C}else m.uri!==void 0&&(u=m.uri.length===0?void 0:m.uri)}let h=Br.codes.get(Number(s));a[l+1]===`
|
|
25
|
+
`?(u&&(n+=ti("")),s&&h&&(n+=ei(h))):c===`
|
|
26
|
+
`&&(s&&h&&(n+=ei(s)),u&&(n+=ti(u)))}return n};function ii(r,e,t){return String(r).normalize().replace(/\r\n/g,`
|
|
27
|
+
`).split(`
|
|
28
|
+
`).map(n=>kr(n,e,t)).join(`
|
|
29
|
+
`)}var jr=Object.defineProperty,Rr=(r,e,t)=>e in r?jr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,P=(r,e,t)=>(Rr(r,typeof e!="symbol"?e+"":e,t),t);function Tr(r,e){if(r===e)return;let t=r.split(`
|
|
30
|
+
`),n=e.split(`
|
|
31
|
+
`),s=[];for(let u=0;u<Math.max(t.length,n.length);u++)t[u]!==n[u]&&s.push(u);return s}var hi=Symbol("clack:cancel");function b(r){return r===hi}function Be(r,e){r.isTTY&&r.setRawMode(e)}var ri=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),Vr=new Set(["up","down","left","right","space","enter"]),ne=class{constructor({render:e,input:t=De.stdin,output:n=De.stdout,...s},u=!0){P(this,"input"),P(this,"output"),P(this,"rl"),P(this,"opts"),P(this,"_track",!1),P(this,"_render"),P(this,"_cursor",0),P(this,"state","initial"),P(this,"value"),P(this,"error",""),P(this,"subscribers",new Map),P(this,"_prevFrame",""),this.opts=s,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=e.bind(this),this._track=u,this.input=t,this.output=n}prompt(){let e=new oi.WriteStream(0);return e._write=(t,n,s)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),s()},this.input.pipe(e),this.rl=dt.default.createInterface({input:this.input,output:e,tabSize:2,prompt:"",escapeCodeTimeout:50}),dt.default.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),Be(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((t,n)=>{this.once("submit",()=>{this.output.write(v.cursor.show),this.output.off("resize",this.render),Be(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(v.cursor.show),this.output.off("resize",this.render),Be(this.input,!1),t(hi)})})}on(e,t){let n=this.subscribers.get(e)??[];n.push({cb:t}),this.subscribers.set(e,n)}once(e,t){let n=this.subscribers.get(e)??[];n.push({cb:t,once:!0}),this.subscribers.set(e,n)}emit(e,...t){let n=this.subscribers.get(e)??[],s=[];for(let u of n)u.cb(...t),u.once&&s.push(()=>n.splice(n.indexOf(u),1));for(let u of s)u()}unsubscribe(){this.subscribers.clear()}onKeypress(e,t){if(this.state==="error"&&(this.state="active"),t?.name&&!this._track&&ri.has(t.name)&&this.emit("cursor",ri.get(t.name)),t?.name&&Vr.has(t.name)&&this.emit("cursor",t.name),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),e===" "&&this.opts.placeholder&&(this.value||(this.rl.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),e&&this.emit("key",e.toLowerCase()),t?.name==="return"){if(this.opts.validate){let n=this.opts.validate(this.value);n&&(this.error=n,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}e===""&&(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(`
|
|
32
|
+
`),Be(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=ii(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
33
|
+
`).length-1;this.output.write(v.cursor.move(-999,e*-1))}render(){let e=ii(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(v.cursor.hide);else{let t=Tr(this._prevFrame,e);if(this.restoreCursor(),t&&t?.length===1){let n=t[0];this.output.write(v.cursor.move(0,n)),this.output.write(v.erase.lines(1));let s=e.split(`
|
|
34
|
+
`);this.output.write(s[n]),this._prevFrame=e,this.output.write(v.cursor.move(0,s.length-n-1));return}else if(t&&t?.length>1){let n=t[0];this.output.write(v.cursor.move(0,n)),this.output.write(v.erase.down());let s=e.split(`
|
|
35
|
+
`).slice(n);this.output.write(s.join(`
|
|
36
|
+
`)),this._prevFrame=e;return}this.output.write(v.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},Oe=class extends ne{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",t=>{this.output.write(v.cursor.move(0,-1)),this.value=t,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var Mr=Object.defineProperty,Nr=(r,e,t)=>e in r?Mr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ni=(r,e,t)=>(Nr(r,typeof e!="symbol"?e+"":e,t),t),di=class extends ne{constructor(r){super(r,!1),ni(this,"options"),ni(this,"cursor",0),this.options=r.options,this.value=[...r.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:e})=>e===r.cursorAt),0),this.on("key",e=>{e==="a"&&this.toggleAll()}),this.on("cursor",e=>{switch(e){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 r=this.value.length===this.options.length;this.value=r?[]:this.options.map(e=>e.value)}toggleValue(){let r=this.value.includes(this._value);this.value=r?this.value.filter(e=>e!==this._value):[...this.value,this._value]}},Ur=Object.defineProperty,qr=(r,e,t)=>e in r?Ur(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,si=(r,e,t)=>(qr(r,typeof e!="symbol"?e+"":e,t),t),Se=class extends ne{constructor({mask:e,...t}){super(t),si(this,"valueWithCursor",""),si(this,"_mask","\u2022"),this._mask=e??"\u2022",this.on("finalize",()=>{this.valueWithCursor=this.masked}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.masked}${re.default.inverse(re.default.hidden("_"))}`;else{let n=this.masked.slice(0,this.cursor),s=this.masked.slice(this.cursor);this.valueWithCursor=`${n}${re.default.inverse(s[0])}${s.slice(1)}`}})}get cursor(){return this._cursor}get masked(){return this.value.replaceAll(/./g,this._mask)}},Lr=Object.defineProperty,Hr=(r,e,t)=>e in r?Lr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ui=(r,e,t)=>(Hr(r,typeof e!="symbol"?e+"":e,t),t),mi=class extends ne{constructor(r){super(r,!1),ui(this,"options"),ui(this,"cursor",0),this.options=r.options,this.cursor=this.options.findIndex(({value:e})=>e===r.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",e=>{switch(e){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 Wr=Object.defineProperty,Gr=(r,e,t)=>e in r?Wr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Kr=(r,e,t)=>(Gr(r,typeof e!="symbol"?e+"":e,t),t),Ie=class extends ne{constructor(e){super(e),Kr(this,"valueWithCursor",""),this.on("finalize",()=>{this.value||(this.value=e.defaultValue),this.valueWithCursor=this.value}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${re.default.inverse(re.default.hidden("_"))}`;else{let t=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.valueWithCursor=`${t}${re.default.inverse(n[0])}${n.slice(1)}`}})}get cursor(){return this._cursor}},Jr=globalThis.process.platform.startsWith("win");function fi({input:r=De.stdin,output:e=De.stdout,overwrite:t=!0,hideCursor:n=!0}={}){let s=ee.createInterface({input:r,output:e,prompt:"",tabSize:1});ee.emitKeypressEvents(r,s),r.isTTY&&r.setRawMode(!0);let u=(i,{name:o})=>{if(String(i)===""){n&&e.write(v.cursor.show),process.exit(0);return}if(!t)return;ee.moveCursor(e,o==="return"?0:-1,o==="return"?-1:0,()=>{ee.clearLine(e,1,()=>{r.once("keypress",u)})})};return n&&e.write(v.cursor.hide),r.once("keypress",u),()=>{r.off("keypress",u),n&&e.write(v.cursor.show),r.isTTY&&!Jr&&r.setRawMode(!1),s.terminal=!1,s.close()}}var k=Q(require("node:process"),1),D=Q(ct(),1),le=Q(Dt(),1);function zr(){return k.default.platform!=="win32"?k.default.env.TERM!=="linux":!!k.default.env.CI||!!k.default.env.WT_SESSION||!!k.default.env.TERMINUS_SUBLIME||k.default.env.ConEmuTask==="{cmd::Cmder}"||k.default.env.TERM_PROGRAM==="Terminus-Sublime"||k.default.env.TERM_PROGRAM==="vscode"||k.default.env.TERM==="xterm-256color"||k.default.env.TERM==="alacritty"||k.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Ct=zr(),w=(r,e)=>Ct?r:e,Yr=w("\u25C6","*"),Fi=w("\u25A0","x"),Ei=w("\u25B2","x"),ke=w("\u25C7","o"),Zr=w("\u250C","T"),F=w("\u2502","|"),R=w("\u2514","\u2014"),Ft=w("\u25CF",">"),Et=w("\u25CB"," "),Qr=w("\u25FB","[\u2022]"),gi=w("\u25FC","[+]"),Xr=w("\u25FB","[ ]"),en=w("\u25AA","\u2022"),Ci=w("\u2500","-"),tn=w("\u256E","+"),rn=w("\u251C","+"),nn=w("\u256F","+"),sn=w("\u25CF","\u2022"),un=w("\u25C6","*"),on=w("\u25B2","!"),an=w("\u25A0","x"),ge=r=>{switch(r){case"initial":case"active":return D.default.cyan(Yr);case"cancel":return D.default.red(Fi);case"error":return D.default.yellow(Ei);case"submit":return D.default.green(ke)}},x=r=>new Ie({validate:r.validate,placeholder:r.placeholder,defaultValue:r.defaultValue,initialValue:r.initialValue,render(){let e=`${D.default.gray(F)}
|
|
37
|
+
${ge(this.state)} ${r.message}
|
|
38
|
+
`,t=r.placeholder?D.default.inverse(r.placeholder[0])+D.default.dim(r.placeholder.slice(1)):D.default.inverse(D.default.hidden("_")),n=this.value?this.valueWithCursor:t;switch(this.state){case"error":return`${e.trim()}
|
|
39
|
+
${D.default.yellow(F)} ${n}
|
|
40
|
+
${D.default.yellow(R)} ${D.default.yellow(this.error)}
|
|
41
|
+
`;case"submit":return`${e}${D.default.gray(F)} ${D.default.dim(this.value||r.placeholder)}`;case"cancel":return`${e}${D.default.gray(F)} ${D.default.strikethrough(D.default.dim(this.value??""))}${this.value?.trim()?`
|
|
42
|
+
`+D.default.gray(F):""}`;default:return`${e}${D.default.cyan(F)} ${n}
|
|
43
|
+
${D.default.cyan(R)}
|
|
44
|
+
`}}}).prompt(),je=r=>new Se({validate:r.validate,mask:r.mask??en,render(){let e=`${D.default.gray(F)}
|
|
45
|
+
${ge(this.state)} ${r.message}
|
|
46
|
+
`,t=this.valueWithCursor,n=this.masked;switch(this.state){case"error":return`${e.trim()}
|
|
47
|
+
${D.default.yellow(F)} ${n}
|
|
48
|
+
${D.default.yellow(R)} ${D.default.yellow(this.error)}
|
|
49
|
+
`;case"submit":return`${e}${D.default.gray(F)} ${D.default.dim(n)}`;case"cancel":return`${e}${D.default.gray(F)} ${D.default.strikethrough(D.default.dim(n??""))}${n?`
|
|
50
|
+
`+D.default.gray(F):""}`;default:return`${e}${D.default.cyan(F)} ${t}
|
|
51
|
+
${D.default.cyan(R)}
|
|
52
|
+
`}}}).prompt(),Ce=r=>{let e=r.active??"Yes",t=r.inactive??"No";return new Oe({active:e,inactive:t,initialValue:r.initialValue??!0,render(){let n=`${D.default.gray(F)}
|
|
53
|
+
${ge(this.state)} ${r.message}
|
|
54
|
+
`,s=this.value?e:t;switch(this.state){case"submit":return`${n}${D.default.gray(F)} ${D.default.dim(s)}`;case"cancel":return`${n}${D.default.gray(F)} ${D.default.strikethrough(D.default.dim(s))}
|
|
55
|
+
${D.default.gray(F)}`;default:return`${n}${D.default.cyan(F)} ${this.value?`${D.default.green(Ft)} ${e}`:`${D.default.dim(Et)} ${D.default.dim(e)}`} ${D.default.dim("/")} ${this.value?`${D.default.dim(Et)} ${D.default.dim(t)}`:`${D.default.green(Ft)} ${t}`}
|
|
56
|
+
${D.default.cyan(R)}
|
|
57
|
+
`}}}).prompt()},te=r=>{let e=(n,s)=>{let u=n.label??String(n.value);return s==="active"?`${D.default.green(Ft)} ${u} ${n.hint?D.default.dim(`(${n.hint})`):""}`:s==="selected"?`${D.default.dim(u)}`:s==="cancelled"?`${D.default.strikethrough(D.default.dim(u))}`:`${D.default.dim(Et)} ${D.default.dim(u)}`},t=0;return new mi({options:r.options,initialValue:r.initialValue,render(){let n=`${D.default.gray(F)}
|
|
58
|
+
${ge(this.state)} ${r.message}
|
|
59
|
+
`;switch(this.state){case"submit":return`${n}${D.default.gray(F)} ${e(this.options[this.cursor],"selected")}`;case"cancel":return`${n}${D.default.gray(F)} ${e(this.options[this.cursor],"cancelled")}
|
|
60
|
+
${D.default.gray(F)}`;default:{let s=r.maxItems===void 0?1/0:Math.max(r.maxItems,5);this.cursor>=t+s-3?t=Math.max(Math.min(this.cursor-s+3,this.options.length-s),0):this.cursor<t+2&&(t=Math.max(this.cursor-2,0));let u=s<this.options.length&&t>0,i=s<this.options.length&&t+s<this.options.length;return`${n}${D.default.cyan(F)} ${this.options.slice(t,t+s).map((o,a,l)=>a===0&&u?D.default.dim("..."):a===l.length-1&&i?D.default.dim("..."):e(o,a+t===this.cursor?"active":"inactive")).join(`
|
|
61
|
+
${D.default.cyan(F)} `)}
|
|
62
|
+
${D.default.cyan(R)}
|
|
63
|
+
`}}}}).prompt()};var bi=r=>{let e=(t,n)=>{let s=t.label??String(t.value);return n==="active"?`${D.default.cyan(Qr)} ${s} ${t.hint?D.default.dim(`(${t.hint})`):""}`:n==="selected"?`${D.default.green(gi)} ${D.default.dim(s)}`:n==="cancelled"?`${D.default.strikethrough(D.default.dim(s))}`:n==="active-selected"?`${D.default.green(gi)} ${s} ${t.hint?D.default.dim(`(${t.hint})`):""}`:n==="submitted"?`${D.default.dim(s)}`:`${D.default.dim(Xr)} ${D.default.dim(s)}`};return new di({options:r.options,initialValues:r.initialValues,required:r.required??!0,cursorAt:r.cursorAt,validate(t){if(this.required&&t.length===0)return`Please select at least one option.
|
|
64
|
+
${D.default.reset(D.default.dim(`Press ${D.default.gray(D.default.bgWhite(D.default.inverse(" space ")))} to select, ${D.default.gray(D.default.bgWhite(D.default.inverse(" enter ")))} to submit`))}`},render(){let t=`${D.default.gray(F)}
|
|
65
|
+
${ge(this.state)} ${r.message}
|
|
66
|
+
`;switch(this.state){case"submit":return`${t}${D.default.gray(F)} ${this.options.filter(({value:n})=>this.value.includes(n)).map(n=>e(n,"submitted")).join(D.default.dim(", "))||D.default.dim("none")}`;case"cancel":{let n=this.options.filter(({value:s})=>this.value.includes(s)).map(s=>e(s,"cancelled")).join(D.default.dim(", "));return`${t}${D.default.gray(F)} ${n.trim()?`${n}
|
|
67
|
+
${D.default.gray(F)}`:""}`}case"error":{let n=this.error.split(`
|
|
68
|
+
`).map((s,u)=>u===0?`${D.default.yellow(R)} ${D.default.yellow(s)}`:` ${s}`).join(`
|
|
69
|
+
`);return t+D.default.yellow(F)+" "+this.options.map((s,u)=>{let i=this.value.includes(s.value),o=u===this.cursor;return o&&i?e(s,"active-selected"):i?e(s,"selected"):e(s,o?"active":"inactive")}).join(`
|
|
70
|
+
${D.default.yellow(F)} `)+`
|
|
71
|
+
`+n+`
|
|
72
|
+
`}default:return`${t}${D.default.cyan(F)} ${this.options.map((n,s)=>{let u=this.value.includes(n.value),i=s===this.cursor;return i&&u?e(n,"active-selected"):u?e(n,"selected"):e(n,i?"active":"inactive")}).join(`
|
|
73
|
+
${D.default.cyan(F)} `)}
|
|
74
|
+
${D.default.cyan(R)}
|
|
75
|
+
`}}}).prompt()};var gt=r=>r.replace(Dn(),""),H=(r="",e="")=>{let t=`
|
|
76
|
+
${r}
|
|
77
|
+
`.split(`
|
|
78
|
+
`),n=gt(e).length,s=Math.max(t.reduce((i,o)=>(o=gt(o),o.length>i?o.length:i),0),n)+2,u=t.map(i=>`${D.default.gray(F)} ${D.default.dim(i)}${" ".repeat(s-gt(i).length)}${D.default.gray(F)}`).join(`
|
|
79
|
+
`);process.stdout.write(`${D.default.gray(F)}
|
|
80
|
+
${D.default.green(ke)} ${D.default.reset(e)} ${D.default.gray(Ci.repeat(Math.max(s-n-1,1))+tn)}
|
|
81
|
+
${u}
|
|
82
|
+
${D.default.gray(rn+Ci.repeat(s+2)+nn)}
|
|
83
|
+
`)},y=(r="")=>{process.stdout.write(`${D.default.gray(R)} ${D.default.red(r)}
|
|
84
|
+
|
|
85
|
+
`)},se=(r="")=>{process.stdout.write(`${D.default.gray(Zr)} ${r}
|
|
86
|
+
`)},ce=(r="")=>{process.stdout.write(`${D.default.gray(F)}
|
|
87
|
+
${D.default.gray(R)} ${r}
|
|
88
|
+
|
|
89
|
+
`)},d={message:(r="",{symbol:e=D.default.gray(F)}={})=>{let t=[`${D.default.gray(F)}`];if(r){let[n,...s]=r.split(`
|
|
90
|
+
`);t.push(`${e} ${n}`,...s.map(u=>`${D.default.gray(F)} ${u}`))}process.stdout.write(`${t.join(`
|
|
91
|
+
`)}
|
|
92
|
+
`)},info:r=>{d.message(r,{symbol:D.default.blue(sn)})},success:r=>{d.message(r,{symbol:D.default.green(un)})},step:r=>{d.message(r,{symbol:D.default.green(ke)})},warn:r=>{d.message(r,{symbol:D.default.yellow(on)})},warning:r=>{d.warn(r)},error:r=>{d.message(r,{symbol:D.default.red(an)})}},ie=()=>{let r=Ct?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],e=Ct?80:120,t,n,s=!1,u="",i=(c="")=>{s=!0,t=fi(),u=c.replace(/\.+$/,""),process.stdout.write(`${D.default.gray(F)}
|
|
93
|
+
`);let h=0,m=0;n=setInterval(()=>{let C=D.default.magenta(r[h]),p=".".repeat(Math.floor(m)).slice(0,3);process.stdout.write(le.cursor.move(-999,0)),process.stdout.write(le.erase.down(1)),process.stdout.write(`${C} ${u}${p}`),h=h+1<r.length?h+1:0,m=m<r.length?m+.125:0},e)},o=(c="",h=0)=>{u=c??u,s=!1,clearInterval(n);let m=h===0?D.default.green(ke):h===1?D.default.red(Fi):D.default.red(Ei);process.stdout.write(le.cursor.move(-999,0)),process.stdout.write(le.erase.down(1)),process.stdout.write(`${m} ${u}
|
|
94
|
+
`),t()},a=(c="")=>{u=c??u},l=c=>{let h=c>1?"Something went wrong":"Canceled";s&&o(h,c)};return process.on("uncaughtExceptionMonitor",()=>l(2)),process.on("unhandledRejection",()=>l(2)),process.on("SIGINT",()=>l(1)),process.on("SIGTERM",()=>l(1)),process.on("exit",l),{start:i,stop:o,message:a}};function Dn(){let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(r,"g")}var ln={"Content-Type":"application/json"},cn=/\{[^{}]+\}/g,bt=class extends Request{constructor(e,t){super(e,t);for(let n in t)n in this||(this[n]=t[n])}};function At(r){let{baseUrl:e="",fetch:t=globalThis.fetch,querySerializer:n,bodySerializer:s,headers:u,...i}={...r};e.endsWith("/")&&(e=e.substring(0,e.length-1)),u=$i(ln,u);let o=[];async function a(l,c){let{fetch:h=t,headers:m,params:C={},parseAs:p="json",querySerializer:f,bodySerializer:g=s??hn,...E}=c||{},S=typeof n=="function"?n:Ai(n);f&&(S=typeof f=="function"?f:Ai({...typeof n=="object"?n:{},...f}));let U={redirect:"follow",...i,...E,headers:$i(u,m,C.header)};U.body&&(U.body=g(U.body)),U.body instanceof FormData&&U.headers.delete("Content-Type");let z=new bt(dn(l,{baseUrl:e,params:C,querySerializer:S}),U),Pt={baseUrl:e,fetch:h,parseAs:p,querySerializer:S,bodySerializer:g};for(let Y of o)if(Y&&typeof Y=="object"&&typeof Y.onRequest=="function"){z.schemaPath=l,z.params=C;let Z=await Y.onRequest(z,Pt);if(Z){if(!(Z instanceof Request))throw new Error("Middleware must return new Request() when modifying the request");z=Z}}let B=await h(z);for(let Y=o.length-1;Y>=0;Y--){let Z=o[Y];if(Z&&typeof Z=="object"&&typeof Z.onResponse=="function"){z.schemaPath=l,z.params=C;let Ge=await Z.onResponse(B,Pt,z);if(Ge){if(!(Ge instanceof Response))throw new Error("Middleware must return new Response() when modifying the response");B=Ge}}}if(B.status===204||B.headers.get("Content-Length")==="0")return B.ok?{data:{},response:B}:{error:{},response:B};if(B.ok)return p==="stream"?{data:B.body,response:B}:{data:await B[p](),response:B};let We=await B.text();try{We=JSON.parse(We)}catch{}return{error:We,response:B}}return{async GET(l,c){return a(l,{...c,method:"GET"})},async PUT(l,c){return a(l,{...c,method:"PUT"})},async POST(l,c){return a(l,{...c,method:"POST"})},async DELETE(l,c){return a(l,{...c,method:"DELETE"})},async OPTIONS(l,c){return a(l,{...c,method:"OPTIONS"})},async HEAD(l,c){return a(l,{...c,method:"HEAD"})},async PATCH(l,c){return a(l,{...c,method:"PATCH"})},async TRACE(l,c){return a(l,{...c,method:"TRACE"})},use(...l){for(let c of l)if(c){if(typeof c!="object"||!("onRequest"in c||"onResponse"in c))throw new Error("Middleware must be an object with one of `onRequest()` or `onResponse()`");o.push(c)}},eject(...l){for(let c of l){let h=o.indexOf(c);h!==-1&&o.splice(h,1)}}}}function Re(r,e,t){if(e==null)return"";if(typeof e=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${r}=${t?.allowReserved===!0?e:encodeURIComponent(e)}`}function wi(r,e,t){if(!e||typeof e!="object")return"";let n=[],s={simple:",",label:".",matrix:";"}[t.style]||"&";if(t.style!=="deepObject"&&t.explode===!1){for(let o in e)n.push(o,t.allowReserved===!0?e[o]:encodeURIComponent(e[o]));let i=n.join(",");switch(t.style){case"form":return`${r}=${i}`;case"label":return`.${i}`;case"matrix":return`;${r}=${i}`;default:return i}}for(let i in e){let o=t.style==="deepObject"?`${r}[${i}]`:i;n.push(Re(o,e[i],t))}let u=n.join(s);return t.style==="label"||t.style==="matrix"?`${s}${u}`:u}function yi(r,e,t){if(!Array.isArray(e))return"";if(t.explode===!1){let u={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[t.style]||",",i=(t.allowReserved===!0?e:e.map(o=>encodeURIComponent(o))).join(u);switch(t.style){case"simple":return i;case"label":return`.${i}`;case"matrix":return`;${r}=${i}`;default:return`${r}=${i}`}}let n={simple:",",label:".",matrix:";"}[t.style]||"&",s=[];for(let u of e)t.style==="simple"||t.style==="label"?s.push(t.allowReserved===!0?u:encodeURIComponent(u)):s.push(Re(r,u,t));return t.style==="label"||t.style==="matrix"?`${n}${s.join(n)}`:s.join(n)}function Ai(r){return function(t){let n=[];if(t&&typeof t=="object")for(let s in t){let u=t[s];if(u!=null){if(Array.isArray(u)){n.push(yi(s,u,{style:"form",explode:!0,...r?.array,allowReserved:r?.allowReserved||!1}));continue}if(typeof u=="object"){n.push(wi(s,u,{style:"deepObject",explode:!0,...r?.object,allowReserved:r?.allowReserved||!1}));continue}n.push(Re(s,u,r))}}return n.join("&")}}function pn(r,e){let t=r;for(let n of r.match(cn)??[]){let s=n.substring(1,n.length-1),u=!1,i="simple";if(s.endsWith("*")&&(u=!0,s=s.substring(0,s.length-1)),s.startsWith(".")?(i="label",s=s.substring(1)):s.startsWith(";")&&(i="matrix",s=s.substring(1)),!e||e[s]===void 0||e[s]===null)continue;let o=e[s];if(Array.isArray(o)){t=t.replace(n,yi(s,o,{style:i,explode:u}));continue}if(typeof o=="object"){t=t.replace(n,wi(s,o,{style:i,explode:u}));continue}if(i==="matrix"){t=t.replace(n,`;${Re(s,o)}`);continue}t=t.replace(n,i==="label"?`.${o}`:o)}return t}function hn(r){return JSON.stringify(r)}function dn(r,e){let t=`${e.baseUrl}${r}`;e.params?.path&&(t=pn(t,e.params.path));let n=e.querySerializer(e.params.query??{});return n.startsWith("?")&&(n=n.substring(1)),n&&(t+=`?${n}`),t}function $i(...r){let e=new Headers;for(let t of r){if(!t||typeof t!="object")continue;let n=t instanceof Headers?t.entries():Object.entries(t);for(let[s,u]of n)if(u===null)e.delete(s);else if(Array.isArray(u))for(let i of u)e.append(s,i);else u!==void 0&&e.set(s,u)}return e}var G=require("node:fs"),_i=require("node:os"),wt=require("node:path");var ue=class extends Error{constructor(e){super(e),this.name="CliError"}},T=class extends ue{constructor(e){super(e),this.name="ConfigError"}},O=class extends ue{constructor(t,n,s,u){super(`API Error (${t}): ${n}`);this.statusCode=t;this.errorType=s;this.details=u;this.name="ApiError"}},W=class extends ue{constructor(t,n,s){super(`Job ${t}: ${n??"Unknown error"}`);this.status=t;this.errorMessage=n;this.details=s;this.name="JobError"}formatDetails(){let t=[this.message];if(this.details){let n=this.details.results;if(n)for(let[s,u]of Object.entries(n))u.status==="failed"&&u.error_message&&t.push(` ${s}: ${u.error_message}`)}return t}},Te=class extends ue{constructor(e){super(e),this.name="TimeoutError"}};var oe=class extends ue{constructor(e){super(e),this.name="ValidationError"}};var $t=(0,wt.join)((0,_i.homedir)(),".descript-cli"),Ee=(0,wt.join)($t,"config.json"),K="https://descriptapi.com/v1/",Ve="default";function mn(){(0,G.existsSync)($t)||(0,G.mkdirSync)($t,{recursive:!0})}function j(){try{if((0,G.existsSync)(Ee)){let r=(0,G.readFileSync)(Ee,"utf-8"),e=JSON.parse(r);return e.profiles?e:{activeProfile:Ve,profiles:{[Ve]:{apiKey:e.apiKey,apiUrl:e.apiUrl,debug:e.debug}}}}}catch(r){console.error(`Warning: Could not parse config file at ${Ee}`),r instanceof Error&&console.error(` ${r.message}`)}return{activeProfile:Ve,profiles:{}}}function ae(r){mn(),(0,G.writeFileSync)(Ee,JSON.stringify(r,null,2))}function Me(){let r=j(),e=process.env.DESCRIPT_PROFILE||r.activeProfile;return r.profiles[e]||{}}function pe(){return process.env.DESCRIPT_API_KEY?process.env.DESCRIPT_API_KEY:Me().apiKey}function be(r){let e=j(),t=e.activeProfile;e.profiles[t]||(e.profiles[t]={}),e.profiles[t].apiKey=r,ae(e)}function Ae(){return Ee}function V(){return process.env.DESCRIPT_API_URL?process.env.DESCRIPT_API_URL:Me().apiUrl??K}function $e(){return Me().apiUrl}function Ne(r){let e=j(),t=e.activeProfile;e.profiles[t]||(e.profiles[t]={}),e.profiles[t].apiUrl=r,ae(e)}function yt(){let r=j(),e=r.activeProfile;r.profiles[e]&&(delete r.profiles[e].apiUrl,ae(r))}function _(){return process.env.DESCRIPT_DEBUG?process.env.DESCRIPT_DEBUG==="true"||process.env.DESCRIPT_DEBUG==="1":Me().debug??!1}function _t(r){let e=j(),t=e.activeProfile;e.profiles[t]||(e.profiles[t]={}),e.profiles[t].debug=r,ae(e)}function Ue(){return process.env.DESCRIPT_PROFILE?process.env.DESCRIPT_PROFILE:j().activeProfile}function vt(){let r=j();return Object.keys(r.profiles)}function xt(r){let e=j();if(!e.profiles[r])throw new T(`Profile "${r}" does not exist`);e.activeProfile=r,ae(e)}function Bt(r){let e=j();if(e.profiles[r])throw new T(`Profile "${r}" already exists`);e.profiles[r]={},ae(e)}function vi(r){let e=j();if(r===Ve)throw new T("Cannot delete the default profile");if(!e.profiles[r])throw new T(`Profile "${r}" does not exist`);if(e.activeProfile===r)throw new T("Cannot delete the active profile. Switch to another profile first.");delete e.profiles[r],ae(e)}function xi(r){let e=j();return r in e.profiles}var fn="@descript/platform-cli",gn="0.2.1";function Cn(r){return r.length<=12?"Bearer ***":`Bearer ${r.slice(0,8)}...${r.slice(-4)}`}function Bi(r,e){let t=At({baseUrl:e,headers:{Authorization:`Bearer ${r}`,"User-Agent":`${fn}/${gn} node/${process.version}`}});return _()&&t.use({async onRequest(s){try{if(console.error(`
|
|
95
|
+
--- API Request ---`),console.error(`${s.method} ${s.url}`),s.headers){let u=Object.fromEntries(s.headers.entries());u.authorization&&(u.authorization=Cn(r)),console.error("Headers:",u)}if(s.body)try{let i=await s.clone().text();i&&console.error("Body:",JSON.stringify(JSON.parse(i),null,2))}catch{}console.error(`-------------------
|
|
96
|
+
`)}catch(u){console.error("Error logging request:",u instanceof Error?u.message:u)}return s}}),t}function qe(){let r=pe();if(!r)throw new T("API key not configured. Run `descript-cli config` to set up.");return Bi(r,V())}function Oi(r){return Bi(r,V())}var de=["api-key","api-url","debug"];function Si(r){return r.length<=12?"***":r.slice(0,8)+"..."+r.slice(-4)}function he(r){switch(r){case"api-key":return pe();case"api-url":return $e();case"debug":return _()}}function Ot(r,e){switch(r){case"api-key":be(e);break;case"api-url":Ne(e);break;case"debug":_t(e);break}}function Ii(r,e){if(r==="api-url"){let t=V();return e||`${t} (default)`}return r==="debug"?e?"enabled":"disabled":e?r==="api-key"?Si(e):e:"Not configured"}async function St(r){let e=ie();e.start("Validating API key...");try{let t=Oi(r),{error:n}=await t.GET("/status");return n&&"error"in n&&n.error==="unauthorized"?(e.stop("Invalid API key"),!1):(e.stop("API key validated successfully!"),!0)}catch{return e.stop("Could not validate (saved anyway)"),!0}}var M=new X("config").description("Manage CLI configuration").addHelpText("after",`
|
|
97
|
+
Profile Commands:
|
|
98
|
+
config profiles List all profiles (* marks active)
|
|
99
|
+
config profile <name> Switch to a different profile
|
|
100
|
+
config profile:create <name> Create a new profile
|
|
101
|
+
config profile:delete <name> Delete a profile
|
|
102
|
+
|
|
103
|
+
Configuration Commands:
|
|
104
|
+
config list Show all configuration values
|
|
105
|
+
config get <key> Get a specific value
|
|
106
|
+
config set <key> [value] Set a configuration value
|
|
107
|
+
config clear api-url Clear API URL (revert to default)
|
|
108
|
+
|
|
109
|
+
Examples:
|
|
110
|
+
$ descript-cli config # Interactive configuration
|
|
111
|
+
$ descript-cli config profile:create staging # Create staging profile
|
|
112
|
+
$ descript-cli config profile staging # Switch to staging
|
|
113
|
+
$ descript-cli config set api-key # Set API key for active profile
|
|
114
|
+
$ descript-cli config list # View current configuration
|
|
115
|
+
`).action(async()=>{await Fn()});async function Fn(){se("Descript CLI - Configuration");let r=vt(),e=Ue(),t;if(r.length===0)d.info("No profiles found. Creating default profile."),t="default";else if(r.length===1)t=r[0];else{let s=await te({message:"Which profile would you like to configure?",options:[...r.map(u=>({value:u,label:u,hint:u===e?"(active)":""})),{value:"new",label:"Create new profile",hint:""}]});if(b(s)){y("Configuration cancelled");return}if(s==="new"){let u=await x({message:"Enter new profile name:",validate:i=>{if(!i)return"Profile name is required";if(xi(i))return"Profile already exists"}});if(b(u)){y("Configuration cancelled");return}Bt(u),t=u,d.success(`Created profile: ${t}`)}else t=s}for(t!==e&&(xt(t),d.info(`Switched to profile: ${t}`)),d.info(`Configuring profile: ${t}`),pe()||(d.info("First-time setup - please configure your settings:"),await En());;){let s=de.map(i=>{let o=he(i),a=Ii(i,o);return{value:i,label:i,hint:a}});s.push({value:"done",label:"Done",hint:"Exit configuration"});let u=await te({message:"Select a setting to update:",options:s});if(b(u)||u==="done"){ce(`Configuration saved to ${Ae()}`);return}await bn(u)}}async function En(){let r=await je({message:"Enter your Descript API key:",validate:n=>{if(!n)return"API key is required";if(n.length<10)return"API key seems too short"}});b(r)&&(y("Setup cancelled"),process.exit(0)),await St(r)?(be(r),d.success("API key saved")):(d.error("API key validation failed - saved anyway"),be(r));let t=await Ce({message:"Use custom API URL? (default: "+K+")",initialValue:!1});if(b(t)&&(y("Setup cancelled"),process.exit(0)),t){let n=await x({message:"Enter API base URL:",placeholder:K,validate:s=>{if(!s)return"API URL is required";try{new URL(s)}catch{return"Please enter a valid URL"}}});b(n)||(Ne(n),d.success("API URL saved"))}d.success("Setup complete!")}async function bn(r){if(r==="api-key"){let e=pe(),t=await je({message:"Enter your Descript API key:",validate:s=>{if(!s)return"API key is required";if(s.length<10)return"API key seems too short"}});if(b(t))return;if(t===e){d.info("API key unchanged");return}await St(t)?(be(t),d.success("API key saved")):d.error("Invalid API key - not saved")}else if(r==="api-url"){let e=$e(),t=await te({message:"API URL action:",options:[{value:"set",label:"Set custom URL",hint:e??"Currently using default"},{value:"clear",label:"Reset to default",hint:K}]});if(b(t))return;if(t==="clear"){if(!e){d.info("Already using default URL");return}yt(),d.success(`API URL reset to default: ${K}`)}else{let n=await x({message:"Enter API base URL:",placeholder:K,initialValue:e??"",validate:s=>{if(!s)return"API URL is required";try{new URL(s)}catch{return"Please enter a valid URL"}}});if(b(n))return;if(n===e){d.info("API URL unchanged");return}Ne(n),d.success("API URL saved")}}else if(r==="debug"){let e=_(),t=await Ce({message:"Enable debug mode? (prints API requests)",initialValue:e});if(b(t))return;if(t===e){d.info("Debug mode unchanged");return}_t(t),d.success(`Debug mode ${t?"enabled":"disabled"}`)}}M.command("list").description("Show all configuration values").action(()=>{An()});function An(){let r=Ue();console.log(`
|
|
116
|
+
Configuration (${Ae()}):`),console.log(`Active Profile: ${r}
|
|
117
|
+
`);for(let e of de){let t=he(e),n=Ii(e,t);console.log(` ${e}: ${n}`)}console.log("")}M.command("get <key>").description("Get a configuration value").action(r=>{if(de.includes(r)||(console.error(`Unknown config key: ${r}`),console.error(`Valid keys: ${de.join(", ")}`),process.exit(1)),r==="api-url"){console.log(V());return}if(r==="debug"){console.log(_());return}let e=he(r);e?console.log(r==="api-key"?Si(e):e):(console.error(`${r} is not configured`),process.exit(1))});M.command("set <key> [value]").description("Set a configuration value (prompts if value not provided)").action(async(r,e)=>{de.includes(r)||(console.error(`Unknown config key: ${r}`),console.error(`Valid keys: ${de.join(", ")}`),process.exit(1));let t=r;if(!e){if(se(`Set ${r}`),t==="api-key"){let n=await je({message:"Enter your Descript API key:",validate:s=>{if(!s)return"API key is required";if(s.length<10)return"API key seems too short"}});b(n)&&(y("Cancelled"),process.exit(0)),e=n}else if(t==="api-url"){let n=$e(),s=await x({message:"Enter API base URL:",placeholder:K,initialValue:n??"",validate:u=>{if(!u)return"API URL is required (use `config clear api-url` to reset to default)";try{new URL(u)}catch{return"Please enter a valid URL"}}});b(s)&&(y("Cancelled"),process.exit(0)),e=s}else if(t==="debug"){let n=_(),s=await Ce({message:"Enable debug mode? (prints API requests)",initialValue:n});b(s)&&(y("Cancelled"),process.exit(0));let u=s,i=he(t);if(u===i){d.info("Debug mode unchanged");return}Ot(t,u),d.success(`Debug mode ${u?"enabled":"disabled"}`);return}}if(t==="api-key"&&e&&(await St(e)||(y("The API key is invalid. Please check and try again."),process.exit(1))),t==="api-url"&&e)try{new URL(e)}catch{console.error("Invalid URL format for api-url"),process.exit(1)}if(t==="debug"&&typeof e=="string"){e!=="true"&&e!=="false"&&(console.error('Invalid debug value. Use "true" or "false"'),process.exit(1));let n=e==="true",s=he(t);if(n===s){console.log(`${r} unchanged`);return}Ot(t,n),console.log(`${r} saved to ${Ae()}`);return}if(e!=null){let n=he(t);if(e===n){console.log(`${r} unchanged`);return}Ot(t,e),console.log(`${r} saved to ${Ae()}`)}});M.command("clear <key>").description("Clear a configuration value (revert to default)").action(r=>{if(r!=="api-url"&&(console.error(`Cannot clear ${r}. Only api-url can be cleared (to revert to default).`),console.error('Use "config set" to update other values.'),process.exit(1)),!$e()){console.log("api-url already using default");return}yt(),console.log(`api-url cleared. Now using default: ${K}`)});M.command("profiles").description("List all profiles").action(()=>{let r=vt(),e=Ue();if(r.length===0){console.log("No profiles configured");return}console.log(`
|
|
118
|
+
Profiles:
|
|
119
|
+
`);for(let t of r)console.log(`${t===e?"* ":" "}${t}`);console.log("")});M.command("profile <name>").description("Switch to a different profile").action(r=>{try{xt(r),console.log(`Switched to profile: ${r}`)}catch(e){e instanceof Error?console.error(e.message):console.error("An unexpected error occurred"),process.exit(1)}});M.command("profile:create <name>").description("Create a new profile").action(r=>{try{Bt(r),console.log(`Created profile: ${r}`),console.log(`Use "config profile ${r}" to switch to it`)}catch(e){e instanceof Error?console.error(e.message):console.error("An unexpected error occurred"),process.exit(1)}});M.command("profile:delete <name>").description("Delete a profile").action(r=>{try{vi(r),console.log(`Deleted profile: ${r}`)}catch(e){e instanceof Error?console.error(e.message):console.error("An unexpected error occurred"),process.exit(1)}});function Pi(r){if(!r)return null;let e=parseInt(r,10);if(!isNaN(e)&&e>=0)return e*1e3;let t=Date.parse(r);return isNaN(t)?null:Math.max(0,t-Date.now())}function ki(r){return r===429||r===503}var $n=["stopped","cancelled"];function wn(r){return $n.includes(r)}function ji(r){return new Promise(e=>setTimeout(e,r))}function yn(r){if(r.result&&r.result.status==="error")return r.result.error_message}async function Le(r,e,t,n={}){let{intervalMs:s=2e3,timeoutMs:u=18e5,maxRetries:i=5,quiet:o=!1}=n,a=o?null:ie(),l=Date.now(),c=()=>`${Math.floor((Date.now()-l)/1e3)}s`;a?.start(`${t} (${c()})`);let h=0;for(;;){let{data:m,error:C,response:p}=await r.GET("/jobs/{job_id}",{params:{path:{job_id:e}}});if(C){if(p&&ki(p.status)){if(h<i){let E=Pi(p.headers.get("Retry-After"))??Math.min(s*Math.pow(2,h),6e4),U=`${p.status===429?"rate limited":"service unavailable"} (${p.status}), retry ${h+1}/${i} in ${Math.ceil(E/1e3)}s`;o?d.warn(`Job ${e}: ${U}`):a?.message(`${t} (${c()}) - ${U}`),await ji(E),h++;continue}throw a?.stop("Rate limit exceeded"),new O(p.status,`Rate limited after ${i} retries`,"rate_limited")}if(p&&p.status>=400&&p.status<500)return a?.stop("Job polling not available"),o||(d.warn(`Jobs endpoint returned ${p.status} - polling unavailable`),_()&&(console.error(`
|
|
120
|
+
Polling error response:`),console.error(JSON.stringify(C,null,2)))),null;throw a?.stop("Job status check failed"),new O(p?.status??500,"error"in C?C.error:"Unknown error","error"in C?C.error:void 0)}if(h=0,!m)throw a?.stop("Job status check failed"),new O(500,"No response data");let f=m.job_state;if(wn(f)){if(f==="cancelled")throw a?.stop(`Job cancelled (${c()})`),new W("cancelled","Job was cancelled",m);let g=yn(m);if(g)throw a?.stop(`Job failed (${c()})`),_()&&(console.error(`
|
|
121
|
+
Job failed - full response:`),console.error(JSON.stringify(m,null,2))),new W("failed",g,m);return a?.stop(`Job completed successfully! (${c()})`),_()&&(console.log(`
|
|
122
|
+
Job completed - full response:`),console.log(JSON.stringify(m,null,2))),m}if(Date.now()-l>u)throw a?.stop("Job timed out"),new Te(`Job ${e} did not complete within ${u}ms`);a?.message(`${t} (${c()}) - ${f}`),await ji(s)}}var _n=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function vn(r){return _n.test(r)}function xn(r){try{return new URL(r),!0}catch{return!1}}function we(r){b(r)&&(y("Operation cancelled"),process.exit(0))}async function Bn(r){if(r)return d.step(`Project ID: ${r}`),r;let e=await x({message:"Enter project ID:",placeholder:"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",validate:t=>{if(!t)return"Project ID is required";if(!vn(t))return"Please enter a valid UUID"}});return we(e),e}async function He(r,e,t="CLI Import",n=!1){if(r)return d.step(`Project ID: ${r}`),{projectId:r};if(e)return d.step(`Project name: ${e}`),{projectName:e};if(n){let u=new Date().toISOString().split("T")[0],i=`${t} ${u}`;return d.step(`Project name: ${i}`),{projectName:i}}let s=await te({message:"Import to new or existing project?",options:[{value:"new",label:"Create new project"},{value:"existing",label:"Use existing project"}]});if(we(s),s==="new"){let u=new Date().toISOString().split("T")[0],i=`${t} ${u}`,o=await x({message:"Enter project name:",placeholder:i,defaultValue:i});return we(o),{projectName:o||i}}else return{projectId:await Bn()}}async function Ri(r){if(r)return d.step(`Prompt: "${r}"`),r;let e=await x({message:"What would you like the AI to do?",placeholder:"e.g., add studio sound to all clips",validate:t=>{if(!t)return"Prompt is required"}});return we(e),e}function Ti(){return{media:new Map,sequences:new Map,compositions:[]}}function On(r){let e=[];for(let t of r.media.keys())e.push({name:t,type:"media"});for(let t of r.sequences.keys())e.push({name:t,type:"sequence"});return e}function Vi(r){let e=new Set;for(let t of r.media.keys())e.add(t);for(let[t,n]of r.sequences){e.add(t);for(let s of n)e.add(s.media)}return e}function Sn(r,e){try{let n=new URL(r).pathname.split("/");return n[n.length-1]||e}catch{return e}}function In(r,e){if(!e.has(r))return r;let t=r.lastIndexOf("."),n=t>0?r.slice(0,t):r,s=t>0?r.slice(t):"",u=2,i;do i=`${n} ${u}${s}`,u++;while(e.has(i));return i}async function Mi(r){let e=r.media.size+r.sequences.size,t=r.compositions.length,n=await te({message:"What would you like to add?",options:[{value:"media",label:"Media file",hint:"Import from URL"},{value:"sequence",label:"Sequence",hint:"Multitrack (e.g., multicam)"},{value:"composition",label:"Composition",hint:e===0?"Add media first":"Timeline with clips"},{value:"done",label:"Done",hint:e===0?"Nothing to import":`${e} items, ${t} compositions`}]});return we(n),n}async function It(r){let e=await x({message:"Enter media URL:",placeholder:"https://example.com/video.mp4",validate:o=>{if(o&&!xn(o))return"Please enter a valid URL"}});if(b(e)||!e)return null;let t=Vi(r),n=Sn(e,`media_${r.media.size+1}`),s=In(n,t),u=await x({message:"Name for this file:",placeholder:s});if(b(u))return null;let i=u||s;if(u&&t.has(i)){d.warn(`Name "${i}" already exists. Please use a different name.`);let o=await x({message:"Enter a different name:",validate:a=>{if(!a)return"Name is required";if(t.has(a))return"Name already exists"}});return b(o)?null:{name:o,url:e}}return{name:i,url:e}}async function Ni(r){let e=Vi(r),t="Sequence",n=1;for(;e.has(t);)t=`Sequence_${n}`,n++;let s=await x({message:"Sequence name (press Enter for default):",placeholder:t,validate:c=>{if(c&&e.has(c))return"Name already exists"}});if(b(s))return null;let u=s||t;if(e.add(u),Array.from(r.media.entries()).length===0)return d.warn("No media files available. Add some media first before creating a sequence."),null;let o=new Set,a=[],l=!0;for(;l;){let m=[...Array.from(r.media.entries()).filter(([E])=>!o.has(E)).map(([E])=>({value:E,label:E,hint:"media"})),{value:"add_new",label:"Add new media file",hint:""},{value:"done",label:"Done adding tracks",hint:""}],C=await te({message:a.length===0?"Select media for first track:":"Select media for next track:",options:m});if(b(C)){if(a.length===0)return null;break}if(C==="add_new"){let E=await It(r);E&&(r.media.set(E.name,E.url),d.success(`Added media: ${E.name}`));continue}if(C==="done"){if(a.length===0){d.warn("Sequence must have at least one track.");continue}break}let p=C,f=r.media.get(p),g=await x({message:"Time offset in seconds:",placeholder:"0",defaultValue:"0",validate:E=>{let S=parseFloat(E||"0");if(isNaN(S))return"Please enter a valid number"}});if(b(g)){if(a.length===0)return null;break}o.add(p),a.push({media:p,url:f,offset:parseFloat(g||"0")})}return a.length===0?(d.warn("Sequence must have at least one track. Skipping."),null):{name:u,tracks:a}}async function Ui(r){let e=On(r);if(e.length===0)return d.warn("No media or sequences available. Add some first."),null;let t=await x({message:"Composition name (optional):",placeholder:"Leave empty for default"});if(b(t))return null;let n=t||void 0,s=await bi({message:"Select items for this composition (space to select, enter to confirm):",options:e.map(i=>({value:i.name,label:i.name,hint:i.type})),required:!1});if(b(s))return null;let u=s;return u.length===0?(d.warn("No items selected. Composition not added."),null):{name:n,items:u}}function qi(){return process.stdout.columns||80}function Pn(r,e){if(e<1&&(e=1),r.length<=e)return[r];let t=r.split(" "),n=[],s="";for(let u of t)if(s.length===0)if(u.length>e){for(let i=0;i<u.length;i+=e)n.push(u.slice(i,i+e));s=n.pop()}else s=u;else if(s.length+1+u.length<=e)s+=" "+u;else if(n.push(s),u.length>e){for(let i=0;i<u.length;i+=e)n.push(u.slice(i,i+e));s=n.pop()}else s=u;return s.length>0&&n.push(s),n}function Li(r,e){return r.split(`
|
|
123
|
+
`).flatMap(t=>{let n=t.match(/^(\s*)/)?.[0]??"",s=t.slice(n.length),u=e-n.length;return u<1?[t]:s.length===0?[""]:Pn(s,u).map(i=>n+i)}).join(`
|
|
124
|
+
`)}function J(r){let e=qi()-4;return Li(r,e)}function Hi(r){let e=qi()-3;return Li(r,e)}function kn(r,e=60){if(r.length<=e)return r;try{let t=new URL(r),n=`${t.origin}${t.pathname}`;return n.length<=e?n+(t.search?"...":""):n.slice(0,e-3)+"..."}catch{return r.slice(0,e-3)+"..."}}function jn(r,e,t){let n=[],s="projectId"in e?`Existing project: ${e.projectId}`:`New project: ${e.projectName}`;if(n.push(s),t&&n.push(`Team access: ${t}`),r.media.size>0){n.push(""),n.push(`Media files (${r.media.size}):`);for(let[u,i]of r.media)n.push(` ${u}: ${kn(i)}`)}if(r.sequences.size>0){n.push(""),n.push(`Sequences (${r.sequences.size}):`);for(let[u,i]of r.sequences){let o=i.map(a=>a.media).join(", ");n.push(` ${u}: ${o} (${i.length} tracks)`)}}if(r.compositions.length>0){n.push(""),n.push(`Compositions (${r.compositions.length}):`);for(let u of r.compositions){let i=u.name||"(default)",o=u.items.length>0?u.items.join(", "):"(empty)";n.push(` ${i}: ${o}`)}}return n.join(`
|
|
125
|
+
`)}function Rn(r){let e={};for(let[t,n]of r.media)e[t]={url:n};for(let[t,n]of r.sequences){for(let s of n)e[s.media]||(e[s.media]={url:s.url});e[t]={tracks:n.map(s=>({media:s.media,offset:s.offset!==0?s.offset:void 0}))}}return e}function Tn(r,e=!1){if(r.compositions.length>0)return r.compositions.map(n=>({name:n.name,clips:n.items.map(s=>({media:s}))}));if(!e)return[];let t=[...r.media.keys(),...r.sequences.keys()];return t.length===0?[]:[{clips:t.map(n=>({media:n}))}]}var Wi=new X("import").description("Import media, sequences, and compositions to a project").option("-n, --name, --project-name <name>","Project name (for new projects)").option("-p, --project-id <id>","Existing project ID").option("-m, --media <urls...>","Media URL(s) to import (simple mode)").option("--team-access <level>","Team access level for new projects: edit, comment, none").option("--callback-url <url>","Callback URL for import job notifications").option("--timeout <minutes>","Job polling timeout in minutes","30").option("--new","Create new project with default name").option("--no-composition","Skip creating a composition with imported media").action(async r=>{se("Descript CLI - Import");try{d.info(`API: ${V()}`);let e=qe(),t=parseInt(r.timeout??"30",10);if(isNaN(t)||t<=0)throw new oe("Timeout must be a positive number of minutes");let n=t*60*1e3;if(r.teamAccess&&!["edit","comment","none"].includes(r.teamAccess))throw new oe("Team access must be one of: edit, comment, none");let s=await He(r.projectId,r.name,"CLI Import",r.new),u=Ti();if(r.media&&r.media.length>0){d.step(`Media URLs: ${r.media.length} file(s) from CLI`);for(let[p,f]of r.media.entries())try{let E=new URL(f).pathname.split("/"),S=E[E.length-1]||`media_${p+1}`;u.media.set(S,f)}catch{u.media.set(`media_${p+1}`,f)}}else{let p=!1;for(;!p;)switch(await Mi(u)){case"media":{let g=await It(u);g&&(u.media.set(g.name,g.url),d.success(`Added media: ${g.name}`));break}case"sequence":{let g=await Ni(u);g&&(u.sequences.set(g.name,g.tracks),d.success(`Added sequence: ${g.name} (${g.tracks.length} tracks)`));break}case"composition":{let g=await Ui(u);g&&(u.compositions.push(g),d.success(`Added composition: ${g.name||"(default)"}`));break}case"done":p=!0;break}}let i=Rn(u),o=Tn(u,r.composition);H(J(jn(u,s,r.teamAccess)),"Import Details");let a=ie();a.start("Creating import job...");let{data:l,error:c,response:h}=await e.POST("/jobs/import/project_media",{body:{..."projectId"in s?{project_id:s.projectId}:{project_name:s.projectName},add_media:i,add_compositions:o,...r.teamAccess&&{team_access:r.teamAccess},...r.callbackUrl&&{callback_url:r.callbackUrl}}});if(c){a.stop("Failed to create import job"),_()&&(console.error(`
|
|
126
|
+
API error response:`),console.error(JSON.stringify(c,null,2)));let p="message"in c?c.message:"Unknown error",f="statusCode"in c?c.statusCode:h?.status,g=[];if("details"in c&&Array.isArray(c.details))for(let E of c.details)E&&typeof E=="object"&&"message"in E&&g.push(String(E.message));throw new O(f??400,p,void 0,g.length>0?g:void 0)}if(!l)throw a.stop("Failed to create import job"),new O(500,"No response data");a.stop("Import job created successfully!"),_()&&(console.log(`
|
|
127
|
+
Import job response:`),console.log(JSON.stringify(l,null,2)));let m=[`Job ID: ${l.job_id}`,`Project ID: ${l.project_id}`,`Project URL: ${l.project_url}`];H(J(m.join(`
|
|
128
|
+
`)),"Import Started");let C=await Le(e,l.job_id,"Waiting for import to complete...",{timeoutMs:n});if(C&&C.job_type==="import/project_media"&&C.result){let p=C.result,f=[`Status: ${p.status}`];if(p.status!=="error"){f.push(""),f.push("Media:");for(let[g,E]of Object.entries(p.media_status))if(E.status==="success"){let S=E.duration_seconds!=null?` (${E.duration_seconds.toFixed(1)}s)`:"";f.push(` ${g}: ${E.status}${S}`)}else{let S=E.error_message?` - ${E.error_message}`:"";f.push(` ${g}: ${E.status}${S}`)}if(p.created_compositions&&p.created_compositions.length>0){f.push(""),f.push("Compositions created:");for(let g of p.created_compositions)f.push(` ${g.name??g.id??"(unnamed)"}`)}f.push(""),f.push(`Media seconds used: ${p.media_seconds_used}`)}H(J(f.join(`
|
|
129
|
+
`)),"Import Complete")}ce(`Project: ${l.project_url}`)}catch(e){if(e instanceof W){let t=e.formatDetails();y(t[0]),t.length>1&&d.error(t.slice(1).join(`
|
|
130
|
+
`))}else if(e instanceof O){if(y(e.message),e.details&&e.details.length>0)for(let t of e.details)d.error(` ${t}`)}else e instanceof Error?y(e.message):y("An unexpected error occurred");process.exit(1)}});var Gi=new X("agent").description("Run AI agent editing on a project").option("-p, --project-id <id>","Existing project ID").option("-n, --name, --project-name <name>","Project name (for new projects)").option("-c, --composition-id <id>","Composition ID (optional)").option("--prompt <prompt>","Natural language editing instruction").option("--model <model>","AI model to use for editing").option("--callback-url <url>","Callback URL for job notifications").option("--timeout <minutes>","Job polling timeout in minutes","30").option("--new","Create new project with default name").action(async r=>{se("Descript CLI - AI Agent");try{d.info(`API: ${V()}`);let e=qe(),t=parseInt(r.timeout??"30",10);if(isNaN(t)||t<=0)throw new oe("Timeout must be a positive number of minutes");let n=t*60*1e3,s=await He(r.projectId,r.name,"CLI Edit",r.new),u=await Ri(r.prompt),o=["projectId"in s?`Existing project: ${s.projectId}`:`New project: ${s.projectName}`,`Prompt: "${u}"`];r.compositionId&&o.push(`Composition ID: ${r.compositionId}`),r.model&&o.push(`Model: ${r.model}`),H(J(o.join(`
|
|
131
|
+
`)),"Agent Details");let a=ie();a.start("Submitting agent request...");let{data:l,error:c,response:h}=await e.POST("/jobs/agent",{body:{..."projectId"in s?{project_id:s.projectId}:{project_name:s.projectName},composition_id:r.compositionId,prompt:u,model:r.model,...r.callbackUrl&&{callback_url:r.callbackUrl}}});if(c){a.stop("Failed to create agent job"),_()&&(console.error(`
|
|
132
|
+
API error response:`),console.error(JSON.stringify(c,null,2)));let p="message"in c?c.message:"Unknown error",f="statusCode"in c?c.statusCode:h?.status,g=[];if("details"in c&&Array.isArray(c.details))for(let E of c.details)E&&typeof E=="object"&&"message"in E&&g.push(String(E.message));throw new O(f??400,p,void 0,g.length>0?g:void 0)}if(!l)throw a.stop("Failed to create agent job"),new O(500,"No response data");a.stop("Agent job created successfully!"),_()&&(console.log(`
|
|
133
|
+
Agent job response:`),console.log(JSON.stringify(l,null,2)));let m=[`Job ID: ${l.job_id}`,`Project ID: ${l.project_id}`,`Project URL: ${l.project_url}`];H(J(m.join(`
|
|
134
|
+
`)),"Agent Job Submitted");let C=await Le(e,l.job_id,"Waiting for agent to complete...",{timeoutMs:n});if(C&&C.job_type==="agent"&&C.result){let p=C.result;if(p.status!=="error"){p.agent_response&&(d.step("Agent Response"),d.message(Hi(p.agent_response)));let f=[`Status: ${p.status}`];f.push(`Project changed: ${p.project_changed?"yes":"no"}`),p.media_seconds_used!=null&&f.push(`Media seconds used: ${p.media_seconds_used}`),p.ai_credits_used!=null&&f.push(`AI credits used: ${p.ai_credits_used}`),H(J(f.join(`
|
|
135
|
+
`)),"Agent Complete")}else H(J(`Status: ${p.status}`),"Agent Complete")}ce(`Project: ${l.project_url}`)}catch(e){if(e instanceof W){let t=e.formatDetails();y(t[0]),t.length>1&&d.error(t.slice(1).join(`
|
|
136
|
+
`))}else if(e instanceof O){if(y(e.message),e.details&&e.details.length>0)for(let t of e.details)d.error(` ${t}`)}else e instanceof Error?y(e.message):y("An unexpected error occurred");process.exit(1)}});var Vn="0.2.1",N=new X;N.name("descript-api").description("CLI for Descript API - import media and run AI edits").version(Vn);N.addCommand(M);N.addCommand(Wi);N.addCommand(Gi);N.command("help [command]").description("Show help for a command").action(r=>{if(!r){N.help();return}let e=N.commands.find(t=>t.name()===r);e?e.help():(console.error(`Unknown command: ${r}`),console.error("Run 'descript-api --help' to see available commands."),process.exit(1))});N.action(()=>{N.help()});function Ki(r){N.parse(r,{from:"user"})}Ki(process.argv.slice(2));
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@descript/platform-cli",
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "CLI for Descript API - import media and run AI edits",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/descriptinc/descript-api-examples.git",
|
|
10
|
+
"directory": "cli"
|
|
11
|
+
},
|
|
12
|
+
"keywords": ["descript", "cli", "api", "video", "audio", "ai"],
|
|
13
|
+
"files": ["dist/"],
|
|
14
|
+
"bin": {
|
|
15
|
+
"descript-api": "./dist/descript-cli.cjs"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "node build.mjs",
|
|
19
|
+
"build:tsc": "tsc",
|
|
20
|
+
"dev": "tsx bin/descript-cli.ts",
|
|
21
|
+
"typecheck": "tsc --noEmit",
|
|
22
|
+
"prepublishOnly": "pnpm run build",
|
|
23
|
+
"clean": "rm -rf dist",
|
|
24
|
+
"generate:types": "openapi-typescript openapi.yaml -o src/api/schema.d.ts"
|
|
25
|
+
},
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=18"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@clack/prompts": "^0.7.0",
|
|
31
|
+
"@types/node": "^20.0.0",
|
|
32
|
+
"commander": "^12.0.0",
|
|
33
|
+
"esbuild": "^0.27.3",
|
|
34
|
+
"openapi-fetch": "^0.9.0",
|
|
35
|
+
"openapi-typescript": "^7.0.0",
|
|
36
|
+
"tsx": "^4.0.0",
|
|
37
|
+
"typescript": "^5.3.0"
|
|
38
|
+
}
|
|
39
|
+
}
|