agentica 0.13.1 → 0.13.3
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/bin/index.mjs +3 -0
- package/package.json +8 -8
- package/bin/index.js +0 -81
package/bin/index.mjs
ADDED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentica",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.13.
|
|
4
|
+
"version": "0.13.3",
|
|
5
5
|
"description": "Agentic AI Library specialized in LLM Function Calling",
|
|
6
6
|
"author": "Wrtn Technologies",
|
|
7
7
|
"license": "MIT",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"openapi"
|
|
26
26
|
],
|
|
27
27
|
"exports": {
|
|
28
|
-
".": "./bin/index.
|
|
28
|
+
".": "./bin/index.mjs"
|
|
29
29
|
},
|
|
30
|
-
"main": "bin/index.
|
|
31
|
-
"bin": "bin/index.
|
|
30
|
+
"main": "bin/index.mjs",
|
|
31
|
+
"bin": "bin/index.mjs",
|
|
32
32
|
"files": [
|
|
33
33
|
"LICENSE",
|
|
34
34
|
"README.md",
|
|
@@ -46,7 +46,6 @@
|
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@clack/prompts": "^0.10.0",
|
|
49
|
-
"@rslib/core": "^0.5.4",
|
|
50
49
|
"@ryoppippi/unplugin-typia": "^2.1.3",
|
|
51
50
|
"@types/node": "^20.14.8",
|
|
52
51
|
"@wrtnlabs/eslint-config": "^0.3.1",
|
|
@@ -59,12 +58,13 @@
|
|
|
59
58
|
"ts-patch": "^3.3.0",
|
|
60
59
|
"type-fest": "^4.37.0",
|
|
61
60
|
"typescript": "~5.8.2",
|
|
62
|
-
"typia": "^8.0.
|
|
61
|
+
"typia": "^8.0.4",
|
|
62
|
+
"unbuild": "^3.5.0",
|
|
63
63
|
"vitest": "^3.0.9"
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|
|
66
|
-
"build": "
|
|
67
|
-
"dev": "
|
|
66
|
+
"build": "unbuild",
|
|
67
|
+
"dev": "unbuild --watch",
|
|
68
68
|
"typecheck": "tsc --noEmit",
|
|
69
69
|
"lint": "eslint .",
|
|
70
70
|
"format": "eslint --fix .",
|
package/bin/index.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import*as e from"child_process";import*as t from"events";import*as u from"fs";import*as r from"path";import*as i from"process";import*as D from"node:process";import*as s from"node:util";import*as n from"node:readline";import*as o from"node:tty";import*as a from"node:fs";import*as l from"node:fs/promises";import*as h from"node:path";import*as c from"node:child_process";import*as p from"giget";var m={"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js":function(e){let t=process||{},u=t.argv||[],r=t.env||{},i=!(r.NO_COLOR||u.includes("--no-color"))&&(!!r.FORCE_COLOR||u.includes("--color")||"win32"===t.platform||(t.stdout||{}).isTTY&&"dumb"!==r.TERM||!!r.CI),D=(e,t,u=e)=>r=>{let i=""+r,D=i.indexOf(t,e.length);return~D?e+s(i,t,u,D)+t:e+i+t},s=(e,t,u,r)=>{let i="",D=0;do i+=e.substring(D,r)+u,D=r+t.length,r=e.indexOf(t,D);while(~r);return i+e.substring(D)},n=(e=i)=>{let t=e?D:()=>String;return{isColorSupported:e,reset:t("\x1b[0m","\x1b[0m"),bold:t("\x1b[1m","\x1b[22m","\x1b[22m\x1b[1m"),dim:t("\x1b[2m","\x1b[22m","\x1b[22m\x1b[2m"),italic:t("\x1b[3m","\x1b[23m"),underline:t("\x1b[4m","\x1b[24m"),inverse:t("\x1b[7m","\x1b[27m"),hidden:t("\x1b[8m","\x1b[28m"),strikethrough:t("\x1b[9m","\x1b[29m"),black:t("\x1b[30m","\x1b[39m"),red:t("\x1b[31m","\x1b[39m"),green:t("\x1b[32m","\x1b[39m"),yellow:t("\x1b[33m","\x1b[39m"),blue:t("\x1b[34m","\x1b[39m"),magenta:t("\x1b[35m","\x1b[39m"),cyan:t("\x1b[36m","\x1b[39m"),white:t("\x1b[37m","\x1b[39m"),gray:t("\x1b[90m","\x1b[39m"),bgBlack:t("\x1b[40m","\x1b[49m"),bgRed:t("\x1b[41m","\x1b[49m"),bgGreen:t("\x1b[42m","\x1b[49m"),bgYellow:t("\x1b[43m","\x1b[49m"),bgBlue:t("\x1b[44m","\x1b[49m"),bgMagenta:t("\x1b[45m","\x1b[49m"),bgCyan:t("\x1b[46m","\x1b[49m"),bgWhite:t("\x1b[47m","\x1b[49m"),blackBright:t("\x1b[90m","\x1b[39m"),redBright:t("\x1b[91m","\x1b[39m"),greenBright:t("\x1b[92m","\x1b[39m"),yellowBright:t("\x1b[93m","\x1b[39m"),blueBright:t("\x1b[94m","\x1b[39m"),magentaBright:t("\x1b[95m","\x1b[39m"),cyanBright:t("\x1b[96m","\x1b[39m"),whiteBright:t("\x1b[97m","\x1b[39m"),bgBlackBright:t("\x1b[100m","\x1b[49m"),bgRedBright:t("\x1b[101m","\x1b[49m"),bgGreenBright:t("\x1b[102m","\x1b[49m"),bgYellowBright:t("\x1b[103m","\x1b[49m"),bgBlueBright:t("\x1b[104m","\x1b[49m"),bgMagentaBright:t("\x1b[105m","\x1b[49m"),bgCyanBright:t("\x1b[106m","\x1b[49m"),bgWhiteBright:t("\x1b[107m","\x1b[49m")}};e.exports=n(),e.exports.createColors=n},"../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js":function(e){let t=`\x1b[`,u={to:(e,u)=>u?`${t}${u+1};${e+1}H`:`${t}${e+1}G`,move(e,u){let r="";return e<0?r+=`${t}${-e}D`:e>0&&(r+=`${t}${e}C`),u<0?r+=`${t}${-u}A`:u>0&&(r+=`${t}${u}B`),r},up:(e=1)=>`${t}${e}A`,down:(e=1)=>`${t}${e}B`,forward:(e=1)=>`${t}${e}C`,backward:(e=1)=>`${t}${e}D`,nextLine:(e=1)=>`${t}E`.repeat(e),prevLine:(e=1)=>`${t}F`.repeat(e),left:`${t}G`,hide:`${t}?25l`,show:`${t}?25h`,save:`\x1b7`,restore:`\x1b8`},r={screen:`${t}2J`,up:(e=1)=>`${t}1J`.repeat(e),down:(e=1)=>`${t}J`.repeat(e),line:`${t}2K`,lineEnd:`${t}K`,lineStart:`${t}1K`,lines(e){let t="";for(let r=0;r<e;r++)t+=this.line+(r<e-1?u.up():"");return e&&(t+=u.left),t}};e.exports={cursor:u,scroll:{up:(e=1)=>`${t}S`.repeat(e),down:(e=1)=>`${t}T`.repeat(e)},erase:r,beep:"\x07"}},"../../node_modules/.pnpm/typia@8.0.3_@samchon+openapi@3.1.0_typescript@5.8.2/node_modules/typia/lib/internal/_assertGuard.js":function(e,t,u){t._assertGuard=void 0;let r=u("../../node_modules/.pnpm/typia@8.0.3_@samchon+openapi@3.1.0_typescript@5.8.2/node_modules/typia/lib/TypeGuardError.mjs");t._assertGuard=(e,t,u)=>{if(!0===e){if(u)throw u(t);throw new r.TypeGuardError(t)}return!1}},child_process:function(t){t.exports=e},events:function(e){e.exports=t},fs:function(e){e.exports=u},path:function(e){e.exports=r},process:function(e){e.exports=i},"../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/index.js":function(e,t,u){let{Argument:r}=u("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/argument.js"),{Command:i}=u("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/command.js"),{CommanderError:D,InvalidArgumentError:s}=u("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/error.js"),{Help:n}=u("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/help.js"),{Option:o}=u("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/option.js");(t=e.exports=new i).program=t,t.Argument=r,t.Command=i,t.CommanderError=D,t.Help=n,t.InvalidArgumentError=s,t.InvalidOptionArgumentError=s,t.Option=o},"../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/argument.js":function(e,t,u){let{InvalidArgumentError:r}=u("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/error.js");t.Argument=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}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)?t.concat(e):[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=(e,t)=>{if(!this.argChoices.includes(e))throw new r(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(e,t):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}},t.humanReadableArgName=function(e){let t=e.name()+(!0===e.variadic?"...":"");return e.required?"<"+t+">":"["+t+"]"}},"../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/command.js":function(e,t,u){let r=u("events").EventEmitter,i=u("child_process"),D=u("path"),s=u("fs"),n=u("process"),{Argument:o,humanReadableArgName:a}=u("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/argument.js"),{CommanderError:l}=u("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/error.js"),{Help:h}=u("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/help.js"),{Option:c,splitOptionFlags:p,DualOptions:m}=u("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/option.js"),{suggestSimilar:d}=u("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/suggestSimilar.js");class F extends r{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],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:e=>n.stdout.write(e),writeErr:e=>n.stderr.write(e),getOutHelpWidth:()=>n.stdout.isTTY?n.stdout.columns:void 0,getErrHelpWidth:()=>n.stderr.isTTY?n.stderr.columns:void 0,outputError:(e,t)=>t(e)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._hasHelpOption=e._hasHelpOption,this._helpFlags=e._helpFlags,this._helpDescription=e._helpDescription,this._helpShortFlag=e._helpShortFlag,this._helpLongFlag=e._helpLongFlag,this._helpCommandName=e._helpCommandName,this._helpCommandnameAndArgs=e._helpCommandnameAndArgs,this._helpCommandDescription=e._helpCommandDescription,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}command(e,t,u){let r=t,i=u;"object"==typeof r&&null!==r&&(i=r,r=null),i=i||{};let[,D,s]=e.match(/([^ ]+) *(.*)/),n=this.createCommand(D);return(r&&(n.description(r),n._executableHandler=!0),i.isDefault&&(this._defaultCommandName=n._name),n._hidden=!!(i.noHelp||i.hidden),n._executableFile=i.executableFile||null,s&&n.arguments(s),this.commands.push(n),n.parent=this,n.copyInheritedSettings(this),r)?this:n}createCommand(e){return new F(e)}createHelp(){return Object.assign(new h,this.configureHelp())}configureHelp(e){return void 0===e?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return void 0===e?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return"string"!=typeof e&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw Error(`Command passed to .addCommand() must have a name
|
|
3
|
-
- specify the name in Command constructor or using .name()`);return(t=t||{}).isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this.commands.push(e),e.parent=this,this}createArgument(e,t){return new o(e,t)}argument(e,t,u,r){let i=this.createArgument(e,t);return"function"==typeof u?i.default(r).argParser(u):i.default(u),this.addArgument(i),this}arguments(e){return e.split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(e){let t=this._args.slice(-1)[0];if(t&&t.variadic)throw Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&void 0!==e.defaultValue&&void 0===e.parseArg)throw Error(`a default value for a required argument is never used: '${e.name()}'`);return this._args.push(e),this}addHelpCommand(e,t){return!1===e?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,"string"==typeof e&&(this._helpCommandName=e.split(" ")[0],this._helpCommandnameAndArgs=e),this._helpCommandDescription=t||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return void 0===this._addImplicitHelpCommand?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(e,t){let u=["preSubcommand","preAction","postAction"];if(!u.includes(e))throw Error(`Unexpected value for event passed to hook : '${e}'.
|
|
4
|
-
Expecting one of '${u.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=e=>{if("commander.executeSubCommandAsync"!==e.code)throw e},this}_exit(e,t,u){this._exitCallback&&this._exitCallback(new l(e,t,u)),n.exit(e)}action(e){return this._actionHandler=t=>{let u=this._args.length,r=t.slice(0,u);return this._storeOptionsAsProperties?r[u]=this:r[u]=this.opts(),r.push(this),e.apply(this,r)},this}createOption(e,t){return new c(e,t)}addOption(e){let t=e.name(),u=e.attributeName();if(e.negate){let t=e.long.replace(/^--no-/,"--");this._findOption(t)||this.setOptionValueWithSource(u,void 0===e.defaultValue||e.defaultValue,"default")}else void 0!==e.defaultValue&&this.setOptionValueWithSource(u,e.defaultValue,"default");this.options.push(e);let r=(t,r,i)=>{null==t&&void 0!==e.presetArg&&(t=e.presetArg);let D=this.getOptionValue(u);if(null!==t&&e.parseArg)try{t=e.parseArg(t,D)}catch(e){if("commander.invalidArgument"===e.code){let t=`${r} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}else null!==t&&e.variadic&&(t=e._concatValue(t,D));null==t&&(t=!e.negate&&(!!e.isBoolean()||!!e.optional||"")),this.setOptionValueWithSource(u,t,i)};return this.on("option:"+t,t=>{let u=`error: option '${e.flags}' argument '${t}' is invalid.`;r(t,u,"cli")}),e.envVar&&this.on("optionEnv:"+t,t=>{let u=`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`;r(t,u,"env")}),this}_optionEx(e,t,u,r,i){if("object"==typeof t&&t instanceof c)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let D=this.createOption(t,u);if(D.makeOptionMandatory(!!e.mandatory),"function"==typeof r)D.default(i).argParser(r);else if(r instanceof RegExp){let e=r;r=(t,u)=>{let r=e.exec(t);return r?r[0]:u},D.default(i).argParser(r)}else D.default(r);return this.addOption(D)}option(e,t,u,r){return this._optionEx({},e,t,u,r)}requiredOption(e,t,u,r){return this._optionEx({mandatory:!0},e,t,u,r)}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){if(this._passThroughOptions=!!e,this.parent&&e&&!this.parent._enablePositionalOptions)throw Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(e=!0){if(this._storeOptionsAsProperties=!!e,this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,u){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=u,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return E(this).forEach(u=>{void 0!==u.getOptionValueSource(e)&&(t=u.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){let u;if(void 0!==e&&!Array.isArray(e))throw Error("first parameter to parse must be array or undefined");switch(t=t||{},void 0===e&&(e=n.argv,n.versions&&n.versions.electron&&(t.from="electron")),this.rawArgs=e.slice(),t.from){case void 0:case"node":this._scriptPath=e[1],u=e.slice(2);break;case"electron":n.defaultApp?(this._scriptPath=e[1],u=e.slice(2)):u=e.slice(1);break;case"user":u=e.slice(0);break;default:throw Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",u}parse(e,t){let u=this._prepareUserArgs(e,t);return this._parseCommand([],u),this}async parseAsync(e,t){let u=this._prepareUserArgs(e,t);return await this._parseCommand([],u),this}_executeSubCommand(e,t){let u;t=t.slice();let r=!1,o=[".js",".ts",".tsx",".mjs",".cjs"];function a(e,t){let u=D.resolve(e,t);if(s.existsSync(u))return u;if(o.includes(D.extname(t)))return;let r=o.find(e=>s.existsSync(`${u}${e}`));if(r)return`${u}${r}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let h=e._executableFile||`${this._name}-${e._name}`,c=this._executableDir||"";if(this._scriptPath){let e;try{e=s.realpathSync(this._scriptPath)}catch(t){e=this._scriptPath}c=D.resolve(D.dirname(e),c)}if(c){let t=a(c,h);if(!t&&!e._executableFile&&this._scriptPath){let u=D.basename(this._scriptPath,D.extname(this._scriptPath));u!==this._name&&(t=a(c,`${u}-${e._name}`))}h=t||h}r=o.includes(D.extname(h)),"win32"!==n.platform?r?(t.unshift(h),t=g(n.execArgv).concat(t),u=i.spawn(n.argv[0],t,{stdio:"inherit"})):u=i.spawn(h,t,{stdio:"inherit"}):(t.unshift(h),t=g(n.execArgv).concat(t),u=i.spawn(n.execPath,t,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(e=>{n.on(e,()=>{!1===u.killed&&null===u.exitCode&&u.kill(e)})});let p=this._exitCallback;p?u.on("close",()=>{p(new l(n.exitCode||0,"commander.executeSubCommandAsync","(close)"))}):u.on("close",n.exit.bind(n)),u.on("error",t=>{if("ENOENT"===t.code){let t=c?`searched for local subcommand relative to directory '${c}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory";throw Error(`'${h}' does not exist
|
|
5
|
-
- if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
6
|
-
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
7
|
-
- ${t}`)}if("EACCES"===t.code)throw Error(`'${h}' not executable`);if(p){let e=new l(1,"commander.executeSubCommandAsync","(error)");e.nestedError=t,p(e)}else n.exit(1)}),this.runningCommand=u}_dispatchSubcommand(e,t,u){let r;let i=this._findCommand(e);return i||this.help({error:!0}),r=this._chainOrCallSubCommandHook(r,i,"preSubcommand"),r=this._chainOrCall(r,()=>{if(!i._executableHandler)return i._parseCommand(t,u);this._executeSubCommand(i,t.concat(u))})}_checkNumberOfArguments(){this._args.forEach((e,t)=>{e.required&&null==this.args[t]&&this.missingArgument(e.name())}),(!(this._args.length>0)||!this._args[this._args.length-1].variadic)&&this.args.length>this._args.length&&this._excessArguments(this.args)}_processArguments(){let e=(e,t,u)=>{let r=t;if(null!==t&&e.parseArg)try{r=e.parseArg(t,u)}catch(u){if("commander.invalidArgument"===u.code){let r=`error: command-argument value '${t}' is invalid for argument '${e.name()}'. ${u.message}`;this.error(r,{exitCode:u.exitCode,code:u.code})}throw u}return r};this._checkNumberOfArguments();let t=[];this._args.forEach((u,r)=>{let i=u.defaultValue;u.variadic?r<this.args.length?(i=this.args.slice(r),u.parseArg&&(i=i.reduce((t,r)=>e(u,r,t),u.defaultValue))):void 0===i&&(i=[]):r<this.args.length&&(i=this.args[r],u.parseArg&&(i=e(u,i,u.defaultValue))),t[r]=i}),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&"function"==typeof e.then?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let u=e,r=[];return E(this).reverse().filter(e=>void 0!==e._lifeCycleHooks[t]).forEach(e=>{e._lifeCycleHooks[t].forEach(t=>{r.push({hookedCommand:e,callback:t})})}),"postAction"===t&&r.reverse(),r.forEach(e=>{u=this._chainOrCall(u,()=>e.callback(e.hookedCommand,this))}),u}_chainOrCallSubCommandHook(e,t,u){let r=e;return void 0!==this._lifeCycleHooks[u]&&this._lifeCycleHooks[u].forEach(e=>{r=this._chainOrCall(r,()=>e(this,t))}),r}_parseCommand(e,t){let u=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(u.operands),t=u.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._hasImplicitHelpCommand()&&e[0]===this._helpCommandName)return 1===e.length&&this.help(),this._dispatchSubcommand(e[1],[],[this._helpLongFlag]);if(this._defaultCommandName)return C(this,t),this._dispatchSubcommand(this._defaultCommandName,e,t);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),C(this,u.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{u.unknown.length>0&&this.unknownOption(u.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){let u;return r(),this._processArguments(),u=this._chainOrCallHooks(u,"preAction"),u=this._chainOrCall(u,()=>this._actionHandler(this.processedArgs)),this.parent&&(u=this._chainOrCall(u,()=>{this.parent.emit(i,e,t)})),u=this._chainOrCallHooks(u,"postAction")}if(this.parent&&this.parent.listenerCount(i))r(),this._processArguments(),this.parent.emit(i,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():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),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(){for(let e=this;e;e=e.parent)e.options.forEach(t=>{t.mandatory&&void 0===e.getOptionValue(t.attributeName())&&e.missingMandatoryOptionValue(t)})}_checkForConflictingLocalOptions(){let e=this.options.filter(e=>{let t=e.attributeName();return void 0!==this.getOptionValue(t)&&"default"!==this.getOptionValueSource(t)});e.filter(e=>e.conflictsWith.length>0).forEach(t=>{let u=e.find(e=>t.conflictsWith.includes(e.attributeName()));u&&this._conflictingOption(t,u)})}_checkForConflictingOptions(){for(let e=this;e;e=e.parent)e._checkForConflictingLocalOptions()}parseOptions(e){let t=[],u=[],r=t,i=e.slice();function D(e){return e.length>1&&"-"===e[0]}let s=null;for(;i.length;){let e=i.shift();if("--"===e){r===u&&r.push(e),r.push(...i);break}if(s&&!D(e)){this.emit(`option:${s.name()}`,e);continue}if(s=null,D(e)){let t=this._findOption(e);if(t){if(t.required){let e=i.shift();void 0===e&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,e)}else if(t.optional){let e=null;i.length>0&&!D(i[0])&&(e=i.shift()),this.emit(`option:${t.name()}`,e)}else this.emit(`option:${t.name()}`);s=t.variadic?t:null;continue}}if(e.length>2&&"-"===e[0]&&"-"!==e[1]){let t=this._findOption(`-${e[1]}`);if(t){t.required||t.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${t.name()}`,e.slice(2)):(this.emit(`option:${t.name()}`),i.unshift(`-${e.slice(2)}`));continue}}if(/^--[^=]+=/.test(e)){let t=e.indexOf("="),u=this._findOption(e.slice(0,t));if(u&&(u.required||u.optional)){this.emit(`option:${u.name()}`,e.slice(t+1));continue}}if(D(e)&&(r=u),(this._enablePositionalOptions||this._passThroughOptions)&&0===t.length&&0===u.length){if(this._findCommand(e)){t.push(e),i.length>0&&u.push(...i);break}if(e===this._helpCommandName&&this._hasImplicitHelpCommand()){t.push(e),i.length>0&&t.push(...i);break}if(this._defaultCommandName){u.push(e),i.length>0&&u.push(...i);break}}if(this._passThroughOptions){r.push(e),i.length>0&&r.push(...i);break}r.push(e)}return{operands:t,unknown:u}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let u=0;u<t;u++){let t=this.options[u].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return E(this).reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}
|
|
8
|
-
`,this._outputConfiguration.writeErr),"string"==typeof this._showHelpAfterError?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
9
|
-
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr("\n"),this.outputHelp({error:!0}));let u=t||{},r=u.exitCode||1,i=u.code||"commander.error";this._exit(r,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in n.env){let t=e.attributeName();(void 0===this.getOptionValue(t)||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,n.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new m(this.options),t=e=>void 0!==this.getOptionValue(e)&&!["default","implied"].includes(this.getOptionValueSource(e));this.options.filter(u=>void 0!==u.implied&&t(u.attributeName())&&e.valueFromOption(this.getOptionValue(u.attributeName()),u)).forEach(e=>{Object.keys(e.implied).filter(e=>!t(e)).forEach(t=>{this.setOptionValueWithSource(t,e.implied[t],"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 u=e=>{let t=e.attributeName(),u=this.getOptionValue(t),r=this.options.find(e=>e.negate&&t===e.attributeName()),i=this.options.find(e=>!e.negate&&t===e.attributeName());return r&&(void 0===r.presetArg&&!1===u||void 0!==r.presetArg&&u===r.presetArg)?r:i||e},r=e=>{let t=u(e),r=t.attributeName();return"env"===this.getOptionValueSource(r)?`environment variable '${t.envVar}'`:`option '${t.flags}'`},i=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let u=[],r=this;do{let e=r.createHelp().visibleOptions(r).filter(e=>e.long).map(e=>e.long);u=u.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=d(e,u)}let u=`error: unknown option '${e}'${t}`;this.error(u,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this._args.length,u=this.parent?` for '${this.name()}'`:"",r=`error: too many arguments${u}. Expected ${t} argument${1===t?"":"s"} but got ${e.length}.`;this.error(r,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let u=[];this.createHelp().visibleCommands(this).forEach(e=>{u.push(e.name()),e.alias()&&u.push(e.alias())}),t=d(e,u)}let u=`error: unknown command '${e}'${t}`;this.error(u,{code:"commander.unknownCommand"})}version(e,t,u){if(void 0===e)return this._version;this._version=e,t=t||"-V, --version",u=u||"output the version number";let r=this.createOption(t,u);return this._versionOptionName=r.attributeName(),this.options.push(r),this.on("option:"+r.name(),()=>{this._outputConfiguration.writeOut(`${e}
|
|
10
|
-
`),this._exit(0,"commander.version",e)}),this}description(e,t){return void 0===e&&void 0===t?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return void 0===e?this._summary:(this._summary=e,this)}alias(e){if(void 0===e)return this._aliases[0];let t=this;if(0!==this.commands.length&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw Error("Command alias can't be the same as its name");return t._aliases.push(e),this}aliases(e){return void 0===e?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(void 0===e){if(this._usage)return this._usage;let e=this._args.map(e=>a(e));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?e:[]).join(" ")}return this._usage=e,this}name(e){return void 0===e?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=D.basename(e,D.extname(e)),this}executableDir(e){return void 0===e?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp();return void 0===t.helpWidth&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){let t;let u={error:!!(e=e||{}).error};return t=u.error?e=>this._outputConfiguration.writeErr(e):e=>this._outputConfiguration.writeOut(e),u.write=e.write||t,u.command=this,u}outputHelp(e){let t;"function"==typeof e&&(t=e,e=void 0);let u=this._getHelpContext(e);E(this).reverse().forEach(e=>e.emit("beforeAllHelp",u)),this.emit("beforeHelp",u);let r=this.helpInformation(u);if(t&&"string"!=typeof(r=t(r))&&!Buffer.isBuffer(r))throw Error("outputHelp callback must return a string or a Buffer");u.write(r),this.emit(this._helpLongFlag),this.emit("afterHelp",u),E(this).forEach(e=>e.emit("afterAllHelp",u))}helpOption(e,t){if("boolean"==typeof e)return this._hasHelpOption=e,this;this._helpFlags=e||this._helpFlags,this._helpDescription=t||this._helpDescription;let u=p(this._helpFlags);return this._helpShortFlag=u.shortFlag,this._helpLongFlag=u.longFlag,this}help(e){this.outputHelp(e);let t=n.exitCode||0;0===t&&e&&"function"!=typeof e&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let u=["beforeAll","before","after","afterAll"];if(!u.includes(e))throw Error(`Unexpected value for position to addHelpText.
|
|
11
|
-
Expecting one of '${u.join("', '")}'`);let r=`${e}Help`;return this.on(r,e=>{let u;(u="function"==typeof t?t({error:e.error,command:e.command}):t)&&e.write(`${u}
|
|
12
|
-
`)}),this}}function C(e,t){e._hasHelpOption&&t.find(t=>t===e._helpLongFlag||t===e._helpShortFlag)&&(e.outputHelp(),e._exit(0,"commander.helpDisplayed","(outputHelp)"))}function g(e){return e.map(e=>{let t,u;if(!e.startsWith("--inspect"))return e;let r="127.0.0.1",i="9229";return(null!==(u=e.match(/^(--inspect(-brk)?)$/))?t=u[1]:null!==(u=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(t=u[1],/^\d+$/.test(u[3])?i=u[3]:r=u[3]):null!==(u=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(t=u[1],r=u[3],i=u[4]),t&&"0"!==i)?`${t}=${r}:${parseInt(i)+1}`:e})}function E(e){let t=[];for(let u=e;u;u=u.parent)t.push(u);return t}t.Command=F},"../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/error.js":function(e,t){class u extends Error{constructor(e,t,u){super(u),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}}t.CommanderError=u,t.InvalidArgumentError=class extends u{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}},"../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/help.js":function(e,t,u){let{humanReadableArgName:r}=u("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/argument.js");t.Help=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden);if(e._hasImplicitHelpCommand()){let[,u,r]=e._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),i=e.createCommand(u).helpOption(!1);i.description(e._helpCommandDescription),r&&i.arguments(r),t.push(i)}return this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let u=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");return u(e).localeCompare(u(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),u=e._hasHelpOption&&e._helpShortFlag&&!e._findOption(e._helpShortFlag),r=e._hasHelpOption&&!e._findOption(e._helpLongFlag);if(u||r){let i;i=u?r?e.createOption(e._helpFlags,e._helpDescription):e.createOption(e._helpShortFlag,e._helpDescription):e.createOption(e._helpLongFlag,e._helpDescription),t.push(i)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let u=e.parent;u;u=u.parent){let e=u.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return(e._argsDescription&&e._args.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e._args.find(e=>e.description))?e._args:[]}subcommandTerm(e){let t=e._args.map(e=>r(e)).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((e,u)=>Math.max(e,t.subcommandTerm(u).length),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,u)=>Math.max(e,t.optionTerm(u).length),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,u)=>Math.max(e,t.optionTerm(u).length),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,u)=>Math.max(e,t.argumentTerm(u).length),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let u="";for(let t=e.parent;t;t=t.parent)u=t.name()+" "+u;return u+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(e=>JSON.stringify(e)).join(", ")}`),void 0!==e.defaultValue&&(e.required||e.optional||e.isBoolean()&&"boolean"==typeof e.defaultValue)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),void 0!==e.presetArg&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),void 0!==e.envVar&&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(e=>JSON.stringify(e)).join(", ")}`),void 0!==e.defaultValue&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let u=`(${t.join(", ")})`;return e.description?`${e.description} ${u}`:u}return e.description}formatHelp(e,t){let u=t.padWidth(e,t),r=t.helpWidth||80;function i(e,i){if(i){let D=`${e.padEnd(u+2)}${i}`;return t.wrap(D,r-2,u+2)}return e}function D(e){return e.join("\n").replace(/^/gm," ".repeat(2))}let s=[`Usage: ${t.commandUsage(e)}`,""],n=t.commandDescription(e);n.length>0&&(s=s.concat([t.wrap(n,r,0),""]));let o=t.visibleArguments(e).map(e=>i(t.argumentTerm(e),t.argumentDescription(e)));o.length>0&&(s=s.concat(["Arguments:",D(o),""]));let a=t.visibleOptions(e).map(e=>i(t.optionTerm(e),t.optionDescription(e)));if(a.length>0&&(s=s.concat(["Options:",D(a),""])),this.showGlobalOptions){let u=t.visibleGlobalOptions(e).map(e=>i(t.optionTerm(e),t.optionDescription(e)));u.length>0&&(s=s.concat(["Global Options:",D(u),""]))}let l=t.visibleCommands(e).map(e=>i(t.subcommandTerm(e),t.subcommandDescription(e)));return l.length>0&&(s=s.concat(["Commands:",D(l),""])),s.join("\n")}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,u,r=40){let i=RegExp(`[\\n][ \\f\\t\\v\u00a0\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]+`);if(e.match(i))return e;let D=t-u;if(D<r)return e;let s=e.slice(0,u),n=e.slice(u).replace("\r\n","\n"),o=" ".repeat(u),a=`\\s\u200B`,l=RegExp(`
|
|
13
|
-
|.{1,${D-1}}([${a}]|$)|[^${a}]+?([${a}]|$)`,"g");return s+(n.match(l)||[]).map((e,t)=>"\n"===e?"":(t>0?o:"")+e.trimEnd()).join("\n")}}},"../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/option.js":function(e,t,u){let{InvalidArgumentError:r}=u("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/error.js");function i(e){let t,u;let r=e.split(/[ |,]+/);return r.length>1&&!/^[[<]/.test(r[1])&&(t=r.shift()),u=r.shift(),!t&&/^-[^-]$/.test(u)&&(t=u,u=void 0),{shortFlag:t,longFlag:u}}t.Option=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 u=i(e);this.short=u.shortFlag,this.long=u.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"string"==typeof e&&(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)?t.concat(e):[e]}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new r(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(e,t):e},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.name().replace(/^no-/,"").split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},t.splitOptionFlags=i,t.DualOptions=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){let u=t.attributeName();if(!this.dualOptions.has(u))return!0;let r=this.negativeOptions.get(u).presetArg;return t.negate===((void 0!==r&&r)===e)}}},"../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/suggestSimilar.js":function(e,t){t.suggestSimilar=function(e,t){if(!t||0===t.length)return"";t=Array.from(new Set(t));let u=e.startsWith("--");u&&(e=e.slice(2),t=t.map(e=>e.slice(2)));let r=[],i=3;return(t.forEach(t=>{if(t.length<=1)return;let u=function(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let u=[];for(let t=0;t<=e.length;t++)u[t]=[t];for(let e=0;e<=t.length;e++)u[0][e]=e;for(let r=1;r<=t.length;r++)for(let i=1;i<=e.length;i++){let D=1;D=+(e[i-1]!==t[r-1]),u[i][r]=Math.min(u[i-1][r]+1,u[i][r-1]+1,u[i-1][r-1]+D),i>1&&r>1&&e[i-1]===t[r-2]&&e[i-2]===t[r-1]&&(u[i][r]=Math.min(u[i][r],u[i-2][r-2]+1))}return u[e.length][t.length]}(e,t),D=Math.max(e.length,t.length);(D-u)/D>.4&&(u<i?(i=u,r=[t]):u===i&&r.push(t))}),r.sort((e,t)=>e.localeCompare(t)),u&&(r=r.map(e=>`--${e}`)),r.length>1)?`
|
|
14
|
-
(Did you mean one of ${r.join(", ")}?)`:1===r.length?`
|
|
15
|
-
(Did you mean ${r[0]}?)`:""}},"../../node_modules/.pnpm/typia@8.0.3_@samchon+openapi@3.1.0_typescript@5.8.2/node_modules/typia/lib/TypeGuardError.mjs":function(e,t,u){u.r(t),u.d(t,{TypeGuardError:()=>r});class r extends Error{method;path;expected;value;fake_expected_typed_value_;constructor(e){super(e.message||`Error on ${e.method}(): invalid type${e.path?` on ${e.path}`:""}, expect to be ${e.expected}`);let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.method=e.method,this.path=e.path,this.expected=e.expected,this.value=e.value}}}},d={};function F(e){var t=d[e];if(void 0!==t)return t.exports;var u=d[e]={exports:{}};return m[e](u,u.exports,F),u.exports}F.d=(e,t)=>{for(var u in t)F.o(t,u)&&!F.o(e,u)&&Object.defineProperty(e,u,{enumerable:!0,get:t[u]})},F.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),F.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var C=F("../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"),g=F("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");let E=function({onlyFirst:e=!1}={}){return RegExp("[\\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=><~]))",e?void 0:"g")}();function f(e){if("string"!=typeof e)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(E,"")}function b(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _={exports:{}};!function(e){var t={};function u(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.exports=t,t.eastAsianWidth=function(e){var t=e.charCodeAt(0),u=2==e.length?e.charCodeAt(1):0,r=t;return 55296<=t&&t<=56319&&56320<=u&&u<=57343&&(t&=1023,u&=1023,r=(t<<10|u)+65536),12288==r||65281<=r&&r<=65376||65504<=r&&r<=65510?"F":8361==r||65377<=r&&r<=65470||65474<=r&&r<=65479||65482<=r&&r<=65487||65490<=r&&r<=65495||65498<=r&&r<=65500||65512<=r&&r<=65518?"H":4352<=r&&r<=4447||4515<=r&&r<=4519||4602<=r&&r<=4607||9001<=r&&r<=9002||11904<=r&&r<=11929||11931<=r&&r<=12019||12032<=r&&r<=12245||12272<=r&&r<=12283||12289<=r&&r<=12350||12353<=r&&r<=12438||12441<=r&&r<=12543||12549<=r&&r<=12589||12593<=r&&r<=12686||12688<=r&&r<=12730||12736<=r&&r<=12771||12784<=r&&r<=12830||12832<=r&&r<=12871||12880<=r&&r<=13054||13056<=r&&r<=19903||19968<=r&&r<=42124||42128<=r&&r<=42182||43360<=r&&r<=43388||44032<=r&&r<=55203||55216<=r&&r<=55238||55243<=r&&r<=55291||63744<=r&&r<=64255||65040<=r&&r<=65049||65072<=r&&r<=65106||65108<=r&&r<=65126||65128<=r&&r<=65131||110592<=r&&r<=110593||127488<=r&&r<=127490||127504<=r&&r<=127546||127552<=r&&r<=127560||127568<=r&&r<=127569||131072<=r&&r<=194367||177984<=r&&r<=196605||196608<=r&&r<=262141?"W":32<=r&&r<=126||162<=r&&r<=163||165<=r&&r<=166||172==r||175==r||10214<=r&&r<=10221||10629<=r&&r<=10630?"Na":161==r||164==r||167<=r&&r<=168||170==r||173<=r&&r<=174||176<=r&&r<=180||182<=r&&r<=186||188<=r&&r<=191||198==r||208==r||215<=r&&r<=216||222<=r&&r<=225||230==r||232<=r&&r<=234||236<=r&&r<=237||240==r||242<=r&&r<=243||247<=r&&r<=250||252==r||254==r||257==r||273==r||275==r||283==r||294<=r&&r<=295||299==r||305<=r&&r<=307||312==r||319<=r&&r<=322||324==r||328<=r&&r<=331||333==r||338<=r&&r<=339||358<=r&&r<=359||363==r||462==r||464==r||466==r||468==r||470==r||472==r||474==r||476==r||593==r||609==r||708==r||711==r||713<=r&&r<=715||717==r||720==r||728<=r&&r<=731||733==r||735==r||768<=r&&r<=879||913<=r&&r<=929||931<=r&&r<=937||945<=r&&r<=961||963<=r&&r<=969||1025==r||1040<=r&&r<=1103||1105==r||8208==r||8211<=r&&r<=8214||8216<=r&&r<=8217||8220<=r&&r<=8221||8224<=r&&r<=8226||8228<=r&&r<=8231||8240==r||8242<=r&&r<=8243||8245==r||8251==r||8254==r||8308==r||8319==r||8321<=r&&r<=8324||8364==r||8451==r||8453==r||8457==r||8467==r||8470==r||8481<=r&&r<=8482||8486==r||8491==r||8531<=r&&r<=8532||8539<=r&&r<=8542||8544<=r&&r<=8555||8560<=r&&r<=8569||8585==r||8592<=r&&r<=8601||8632<=r&&r<=8633||8658==r||8660==r||8679==r||8704==r||8706<=r&&r<=8707||8711<=r&&r<=8712||8715==r||8719==r||8721==r||8725==r||8730==r||8733<=r&&r<=8736||8739==r||8741==r||8743<=r&&r<=8748||8750==r||8756<=r&&r<=8759||8764<=r&&r<=8765||8776==r||8780==r||8786==r||8800<=r&&r<=8801||8804<=r&&r<=8807||8810<=r&&r<=8811||8814<=r&&r<=8815||8834<=r&&r<=8835||8838<=r&&r<=8839||8853==r||8857==r||8869==r||8895==r||8978==r||9312<=r&&r<=9449||9451<=r&&r<=9547||9552<=r&&r<=9587||9600<=r&&r<=9615||9618<=r&&r<=9621||9632<=r&&r<=9633||9635<=r&&r<=9641||9650<=r&&r<=9651||9654<=r&&r<=9655||9660<=r&&r<=9661||9664<=r&&r<=9665||9670<=r&&r<=9672||9675==r||9678<=r&&r<=9681||9698<=r&&r<=9701||9711==r||9733<=r&&r<=9734||9737==r||9742<=r&&r<=9743||9748<=r&&r<=9749||9756==r||9758==r||9792==r||9794==r||9824<=r&&r<=9825||9827<=r&&r<=9829||9831<=r&&r<=9834||9836<=r&&r<=9837||9839==r||9886<=r&&r<=9887||9918<=r&&r<=9919||9924<=r&&r<=9933||9935<=r&&r<=9953||9955==r||9960<=r&&r<=9983||10045==r||10071==r||10102<=r&&r<=10111||11093<=r&&r<=11097||12872<=r&&r<=12879||57344<=r&&r<=63743||65024<=r&&r<=65039||65533==r||127232<=r&&r<=127242||127248<=r&&r<=127277||127280<=r&&r<=127337||127344<=r&&r<=127386||917760<=r&&r<=917999||983040<=r&&r<=1048573||1048576<=r&&r<=1114109?"A":"N"},t.characterLength=function(e){var t=this.eastAsianWidth(e);return"F"==t||"W"==t||"A"==t?2:1},t.length=function(e){for(var t=u(e),r=0,i=0;i<t.length;i++)r+=this.characterLength(t[i]);return r},t.slice=function(e,r,i){textLen=t.length(e),i=i||1,(r=r||0)<0&&(r=textLen+r),i<0&&(i=textLen+i);for(var D="",s=0,n=u(e),o=0;o<n.length;o++){var a=n[o],l=t.length(a);if(s>=r-+(2==l)){if(s+l<=i)D+=a;else break}s+=l}return D}}(_);let v=b(_.exports),A=b(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});function B(e,t={}){if("string"!=typeof e||0===e.length||(t={ambiguousIsNarrow:!0,...t},0===(e=f(e)).length))return 0;e=e.replace(A()," ");let u=t.ambiguousIsNarrow?1:2,r=0;for(let t of e){let e=t.codePointAt(0);if(!(e<=31)&&(!(e>=127)||!(e<=159))&&(!(e>=768)||!(e<=879)))switch(v.eastAsianWidth(t)){case"F":case"W":r+=2;break;case"A":r+=u;break;default:r+=1}}return r}let y=(e=0)=>t=>`\x1b[${t+e}m`,$=(e=0)=>t=>`\x1b[${38+e};5;${t}m`,w=(e=0)=>(t,u,r)=>`\x1b[${38+e};2;${t};${u};${r}m`,x={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(x.modifier),[...Object.keys(x.color),...Object.keys(x.bgColor)];let O=function(){let e=new Map;for(let[t,u]of Object.entries(x)){for(let[t,r]of Object.entries(u))x[t]={open:`\x1b[${r[0]}m`,close:`\x1b[${r[1]}m`},u[t]=x[t],e.set(r[0],r[1]);Object.defineProperty(x,t,{value:u,enumerable:!1})}return Object.defineProperty(x,"codes",{value:e,enumerable:!1}),x.color.close="\x1b[39m",x.bgColor.close="\x1b[49m",x.color.ansi=y(),x.color.ansi256=$(),x.color.ansi16m=w(),x.bgColor.ansi=y(10),x.bgColor.ansi256=$(10),x.bgColor.ansi16m=w(10),Object.defineProperties(x,{rgbToAnsi256:{value:(e,t,u)=>e===t&&t===u?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(u/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[u]=t;3===u.length&&(u=[...u].map(e=>e+e).join(""));let r=Number.parseInt(u,16);return[r>>16&255,r>>8&255,255&r]},enumerable:!1},hexToAnsi256:{value:e=>x.rgbToAnsi256(...x.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{let t,u,r;if(e<8)return 30+e;if(e<16)return 90+(e-8);if(e>=232)u=t=((e-232)*10+8)/255,r=t;else{let i=(e-=16)%36;t=Math.floor(e/36)/5,u=Math.floor(i/6)/5,r=i%6/5}let i=2*Math.max(t,u,r);if(0===i)return 30;let D=30+(Math.round(r)<<2|Math.round(u)<<1|Math.round(t));return 2===i&&(D+=60),D},enumerable:!1},rgbToAnsi:{value:(e,t,u)=>x.ansi256ToAnsi(x.rgbToAnsi256(e,t,u)),enumerable:!1},hexToAnsi:{value:e=>x.ansi256ToAnsi(x.hexToAnsi256(e)),enumerable:!1}}),x}(),j=new Set(["\x1b","\x9b"]),k="]8;;",S=e=>`${j.values().next().value}[${e}m`,T=e=>`${j.values().next().value}${k}${e}\x07`,V=e=>e.split(" ").map(e=>B(e)),M=(e,t,u)=>{let r=[...t],i=!1,D=!1,s=B(f(e[e.length-1]));for(let[t,n]of r.entries()){let o=B(n);if(s+o<=u?e[e.length-1]+=n:(e.push(n),s=0),j.has(n)&&(i=!0,D=r.slice(t+1).join("").startsWith(k)),i){D?"\x07"===n&&(i=!1,D=!1):"m"===n&&(i=!1);continue}(s+=o)===u&&t<r.length-1&&(e.push(""),s=0)}!s&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},P=e=>{let t=e.split(" "),u=t.length;for(;u>0&&!(B(t[u-1])>0);)u--;return u===t.length?e:t.slice(0,u).join(" ")+t.slice(u).join("")},I=(e,t,u={})=>{if(!1!==u.trim&&""===e.trim())return"";let r="",i,D,s=V(e),n=[""];for(let[r,i]of e.split(" ").entries()){!1!==u.trim&&(n[n.length-1]=n[n.length-1].trimStart());let e=B(n[n.length-1]);if(0!==r&&(e>=t&&(!1===u.wordWrap||!1===u.trim)&&(n.push(""),e=0),(e>0||!1===u.trim)&&(n[n.length-1]+=" ",e++)),u.hard&&s[r]>t){let u=t-e,D=1+Math.floor((s[r]-u-1)/t);Math.floor((s[r]-1)/t)<D&&n.push(""),M(n,i,t);continue}if(e+s[r]>t&&e>0&&s[r]>0){if(!1===u.wordWrap&&e<t){M(n,i,t);continue}n.push("")}if(e+s[r]>t&&!1===u.wordWrap){M(n,i,t);continue}n[n.length-1]+=i}!1!==u.trim&&(n=n.map(e=>P(e)));let o=[...n.join(`
|
|
16
|
-
`)];for(let[e,t]of o.entries()){if(r+=t,j.has(t)){let{groups:t}=RegExp(`(?:\\[(?<code>\\d+)m|\\${k}(?<uri>.*)\x07)`).exec(o.slice(e).join(""))||{groups:{}};if(void 0!==t.code){let e=Number.parseFloat(t.code);i=39===e?void 0:e}else void 0!==t.uri&&(D=0===t.uri.length?void 0:t.uri)}let u=O.codes.get(Number(i));o[e+1]===`
|
|
17
|
-
`?(D&&(r+=T("")),i&&u&&(r+=S(u))):t===`
|
|
18
|
-
`&&(i&&u&&(r+=S(i)),D&&(r+=T(D)))}return r};function H(e,t,u){return String(e).normalize().replace(/\r\n/g,`
|
|
19
|
-
`).split(`
|
|
20
|
-
`).map(e=>I(e,t,u)).join(`
|
|
21
|
-
`)}let N={actions:new Set(["up","down","left","right","space","enter","cancel"]),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};function G(e,t){if("string"==typeof e)return N.aliases.get(e)===t;for(let u of e)if(void 0!==u&&G(u,t))return!0;return!1}let R=globalThis.process.platform.startsWith("win"),W=Symbol("clack:cancel");function L(e,t){e.isTTY&&e.setRawMode(t)}var K=Object.defineProperty,q=(e,t,u)=>t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:u}):e[t]=u,U=(e,t,u)=>(q(e,"symbol"!=typeof t?t+"":t,u),u);class Y{constructor(e,t=!0){U(this,"input"),U(this,"output"),U(this,"_abortSignal"),U(this,"rl"),U(this,"opts"),U(this,"_render"),U(this,"_track",!1),U(this,"_prevFrame",""),U(this,"_subscribers",new Map),U(this,"_cursor",0),U(this,"state","initial"),U(this,"error",""),U(this,"value");let{input:u=D.stdin,output:r=D.stdout,render:i,signal:s,...n}=e;this.opts=n,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=i.bind(this),this._track=t,this._abortSignal=s,this.input=u,this.output=r}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let u=this._subscribers.get(e)??[];u.push(t),this._subscribers.set(e,u)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){let u=this._subscribers.get(e)??[],r=[];for(let e of u)e.cb(...t),e.once&&r.push(()=>u.splice(u.indexOf(e),1));for(let e of r)e()}prompt(){return new Promise((e,t)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(W);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let u=new o.WriteStream(0);u._write=(e,t,u)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),u()},this.input.pipe(u),this.rl=n.default.createInterface({input:this.input,output:u,tabSize:2,prompt:"",escapeCodeTimeout:50}),n.default.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),void 0!==this.opts.initialValue&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),L(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(C.cursor.show),this.output.off("resize",this.render),L(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(C.cursor.show),this.output.off("resize",this.render),L(this.input,!1),e(W)})})}onKeypress(e,t){if("error"===this.state&&(this.state="active"),t?.name&&(!this._track&&N.aliases.has(t.name)&&this.emit("cursor",N.aliases.get(t.name)),N.actions.has(t.name)&&this.emit("cursor",t.name)),e&&("y"===e.toLowerCase()||"n"===e.toLowerCase())&&this.emit("confirm","y"===e.toLowerCase())," "===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 e=this.opts.validate(this.value);e&&(this.error=e instanceof Error?e.message:e,this.state="error",this.rl?.write(this.value))}"error"!==this.state&&(this.state="submit")}G([e,t?.name,t?.sequence],"cancel")&&(this.state="cancel"),("submit"===this.state||"cancel"===this.state)&&this.emit("finalize"),this.render(),("submit"===this.state||"cancel"===this.state)&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
22
|
-
`),L(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=H(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
23
|
-
`).length-1;this.output.write(C.cursor.move(-999,-1*e))}render(){let e=H(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if("initial"===this.state)this.output.write(C.cursor.hide);else{let t=function(e,t){if(e===t)return;let u=e.split(`
|
|
24
|
-
`),r=t.split(`
|
|
25
|
-
`),i=[];for(let e=0;e<Math.max(u.length,r.length);e++)u[e]!==r[e]&&i.push(e);return i}(this._prevFrame,e);if(this.restoreCursor(),t&&t?.length===1){let u=t[0];this.output.write(C.cursor.move(0,u)),this.output.write(C.erase.lines(1));let r=e.split(`
|
|
26
|
-
`);this.output.write(r[u]),this._prevFrame=e,this.output.write(C.cursor.move(0,r.length-u-1));return}if(t&&t?.length>1){let u=t[0];this.output.write(C.cursor.move(0,u)),this.output.write(C.erase.down());let r=e.split(`
|
|
27
|
-
`).slice(u);this.output.write(r.join(`
|
|
28
|
-
`)),this._prevFrame=e;return}this.output.write(C.erase.down())}this.output.write(e),"initial"===this.state&&(this.state="active"),this._prevFrame=e}}}class z extends Y{get cursor(){return+!this.value}get _value(){return 0===this.cursor}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",e=>{this.output.write(C.cursor.move(0,-1)),this.value=e,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var J=Object.defineProperty,Z=(e,t,u)=>t in e?J(e,t,{enumerable:!0,configurable:!0,writable:!0,value:u}):e[t]=u,Q=(e,t,u)=>(Z(e,"symbol"!=typeof t?t+"":t,u),u);let X=class extends Y{constructor(e){super(e,!1),Q(this,"options"),Q(this,"cursor",0),this.options=e.options,this.value=[...e.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:t})=>t===e.cursorAt),0),this.on("key",e=>{"a"===e&&this.toggleAll()}),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=0===this.cursor?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()}})}get _value(){return this.options[this.cursor].value}toggleAll(){let e=this.value.length===this.options.length;this.value=e?[]:this.options.map(e=>e.value)}toggleValue(){let e=this.value.includes(this._value);this.value=e?this.value.filter(e=>e!==this._value):[...this.value,this._value]}};var ee=Object.defineProperty,et=(e,t,u)=>t in e?ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:u}):e[t]=u,eu=(e,t,u)=>(et(e,"symbol"!=typeof t?t+"":t,u),u);class er extends Y{constructor(e){super(e,!1),eu(this,"options"),eu(this,"cursor",0),this.options=e.options,this.cursor=this.options.findIndex(({value:t})=>t===e.initialValue),-1===this.cursor&&(this.cursor=0),this.changeValue(),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=0===this.cursor?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}}class ei extends Y{get valueWithCursor(){if("submit"===this.state)return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let e=this.value.slice(0,this.cursor),[t,...u]=this.value.slice(this.cursor);return`${e}${g.inverse(t)}${u.join("")}`}get cursor(){return this._cursor}constructor(e){super(e),this.on("finalize",()=>{this.value||(this.value=e.defaultValue)})}}let eD="win32"!==D.default.platform?"linux"!==D.default.env.TERM:!!D.default.env.CI||!!D.default.env.WT_SESSION||!!D.default.env.TERMINUS_SUBLIME||"{cmd::Cmder}"===D.default.env.ConEmuTask||"Terminus-Sublime"===D.default.env.TERM_PROGRAM||"vscode"===D.default.env.TERM_PROGRAM||"xterm-256color"===D.default.env.TERM||"alacritty"===D.default.env.TERM||"JetBrains-JediTerm"===D.default.env.TERMINAL_EMULATOR,es=(e,t)=>eD?e:t,en=es("◆","*"),eo=es("■","x"),ea=es("▲","x"),el=es("◇","o"),eh=es("┌","T"),ec=es("│","|"),ep=es("└","—"),em=es("●",">"),ed=es("○"," "),eF=es("◻","[•]"),eC=es("◼","[+]"),eg=es("◻","[ ]"),eE=(es("▪","•"),es("─","-"),es("╮","+"),es("├","+"),es("╯","+"),es("●","•")),ef=es("◆","*"),eb=es("▲","!"),e_=es("■","x"),ev=e=>{switch(e){case"initial":case"active":return g.cyan(en);case"cancel":return g.red(eo);case"error":return g.yellow(ea);case"submit":return g.green(el)}},eA=e=>{let{cursor:t,options:u,style:r}=e,i=e.maxItems??Number.POSITIVE_INFINITY,D=Math.min(Math.max(process.stdout.rows-4,0),Math.max(i,5)),s=0;t>=0+D-3?s=Math.max(Math.min(t-D+3,u.length-D),0):t<s+2&&(s=Math.max(t-2,0));let n=D<u.length&&s>0,o=D<u.length&&s+D<u.length;return u.slice(s,s+D).map((e,u,i)=>{let D=u===i.length-1&&o;return 0===u&&n||D?g.dim("..."):r(e,u+s===t)})},eB=e=>new ei({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,render(){let t=`${g.gray(ec)}
|
|
29
|
-
${ev(this.state)} ${e.message}
|
|
30
|
-
`,u=e.placeholder?g.inverse(e.placeholder[0])+g.dim(e.placeholder.slice(1)):g.inverse(g.hidden("_")),r=this.value?this.valueWithCursor:u;switch(this.state){case"error":return`${t.trim()}
|
|
31
|
-
${g.yellow(ec)} ${r}
|
|
32
|
-
${g.yellow(ep)} ${g.yellow(this.error)}
|
|
33
|
-
`;case"submit":return`${t}${g.gray(ec)} ${g.dim(this.value||e.placeholder)}`;case"cancel":return`${t}${g.gray(ec)} ${g.strikethrough(g.dim(this.value??""))}${this.value?.trim()?`
|
|
34
|
-
${g.gray(ec)}`:""}`;default:return`${t}${g.cyan(ec)} ${r}
|
|
35
|
-
${g.cyan(ep)}
|
|
36
|
-
`}}}).prompt(),ey=e=>{let t=e.active??"Yes",u=e.inactive??"No";return new z({active:t,inactive:u,initialValue:e.initialValue??!0,render(){let r=`${g.gray(ec)}
|
|
37
|
-
${ev(this.state)} ${e.message}
|
|
38
|
-
`,i=this.value?t:u;switch(this.state){case"submit":return`${r}${g.gray(ec)} ${g.dim(i)}`;case"cancel":return`${r}${g.gray(ec)} ${g.strikethrough(g.dim(i))}
|
|
39
|
-
${g.gray(ec)}`;default:return`${r}${g.cyan(ec)} ${this.value?`${g.green(em)} ${t}`:`${g.dim(ed)} ${g.dim(t)}`} ${g.dim("/")} ${this.value?`${g.dim(ed)} ${g.dim(u)}`:`${g.green(em)} ${u}`}
|
|
40
|
-
${g.cyan(ep)}
|
|
41
|
-
`}}}).prompt()},e$=e=>{let t=(e,t)=>{let u=e.label??String(e.value);switch(t){case"selected":return`${g.dim(u)}`;case"active":return`${g.green(em)} ${u} ${e.hint?g.dim(`(${e.hint})`):""}`;case"cancelled":return`${g.strikethrough(g.dim(u))}`;default:return`${g.dim(ed)} ${g.dim(u)}`}};return new er({options:e.options,initialValue:e.initialValue,render(){let u=`${g.gray(ec)}
|
|
42
|
-
${ev(this.state)} ${e.message}
|
|
43
|
-
`;switch(this.state){case"submit":return`${u}${g.gray(ec)} ${t(this.options[this.cursor],"selected")}`;case"cancel":return`${u}${g.gray(ec)} ${t(this.options[this.cursor],"cancelled")}
|
|
44
|
-
${g.gray(ec)}`;default:return`${u}${g.cyan(ec)} ${eA({cursor:this.cursor,options:this.options,maxItems:e.maxItems,style:(e,u)=>t(e,u?"active":"inactive")}).join(`
|
|
45
|
-
${g.cyan(ec)} `)}
|
|
46
|
-
${g.cyan(ep)}
|
|
47
|
-
`}}}).prompt()},ew=e=>{let t=(e,t)=>{let u=e.label??String(e.value);return"active"===t?`${g.cyan(eF)} ${u} ${e.hint?g.dim(`(${e.hint})`):""}`:"selected"===t?`${g.green(eC)} ${g.dim(u)}`:"cancelled"===t?`${g.strikethrough(g.dim(u))}`:"active-selected"===t?`${g.green(eC)} ${u} ${e.hint?g.dim(`(${e.hint})`):""}`:"submitted"===t?`${g.dim(u)}`:`${g.dim(eg)} ${g.dim(u)}`};return new X({options:e.options,initialValues:e.initialValues,required:e.required??!0,cursorAt:e.cursorAt,validate(e){if(this.required&&0===e.length)return`Please select at least one option.
|
|
48
|
-
${g.reset(g.dim(`Press ${g.gray(g.bgWhite(g.inverse(" space ")))} to select, ${g.gray(g.bgWhite(g.inverse(" enter ")))} to submit`))}`},render(){let u=`${g.gray(ec)}
|
|
49
|
-
${ev(this.state)} ${e.message}
|
|
50
|
-
`,r=(e,u)=>{let r=this.value.includes(e.value);return u&&r?t(e,"active-selected"):r?t(e,"selected"):t(e,u?"active":"inactive")};switch(this.state){case"submit":return`${u}${g.gray(ec)} ${this.options.filter(({value:e})=>this.value.includes(e)).map(e=>t(e,"submitted")).join(g.dim(", "))||g.dim("none")}`;case"cancel":{let e=this.options.filter(({value:e})=>this.value.includes(e)).map(e=>t(e,"cancelled")).join(g.dim(", "));return`${u}${g.gray(ec)} ${e.trim()?`${e}
|
|
51
|
-
${g.gray(ec)}`:""}`}case"error":{let t=this.error.split(`
|
|
52
|
-
`).map((e,t)=>0===t?`${g.yellow(ep)} ${g.yellow(e)}`:` ${e}`).join(`
|
|
53
|
-
`);return`${u+g.yellow(ec)} ${eA({options:this.options,cursor:this.cursor,maxItems:e.maxItems,style:r}).join(`
|
|
54
|
-
${g.yellow(ec)} `)}
|
|
55
|
-
${t}
|
|
56
|
-
`}default:return`${u}${g.cyan(ec)} ${eA({options:this.options,cursor:this.cursor,maxItems:e.maxItems,style:r}).join(`
|
|
57
|
-
${g.cyan(ec)} `)}
|
|
58
|
-
${g.cyan(ep)}
|
|
59
|
-
`}}}).prompt()},ex=(e="")=>{process.stdout.write(`${g.gray(eh)} ${e}
|
|
60
|
-
`)},eO=(e="")=>{process.stdout.write(`${g.gray(ec)}
|
|
61
|
-
${g.gray(ep)} ${e}
|
|
62
|
-
|
|
63
|
-
`)},ej={message:(e="",{symbol:t=g.gray(ec)}={})=>{let u=[`${g.gray(ec)}`];if(e){let[r,...i]=e.split(`
|
|
64
|
-
`);u.push(`${t} ${r}`,...i.map(e=>`${g.gray(ec)} ${e}`))}process.stdout.write(`${u.join(`
|
|
65
|
-
`)}
|
|
66
|
-
`)},info:e=>{ej.message(e,{symbol:g.blue(eE)})},success:e=>{ej.message(e,{symbol:g.green(ef)})},step:e=>{ej.message(e,{symbol:g.green(el)})},warn:e=>{ej.message(e,{symbol:g.yellow(eb)})},warning:e=>{ej.warn(e)},error:e=>{ej.message(e,{symbol:g.red(e_)})}},ek=(g.gray(ec),({indicator:e="dots"}={})=>{let t=eD?["◒","◐","◓","◑"]:["•","o","O","0"],u=eD?80:120,r="true"===process.env.CI,i,s,o=!1,a="",l,h=performance.now(),c=e=>{o&&_(e>1?"Something went wrong":"Canceled",e)},p=()=>c(2),m=()=>c(1),d=()=>{process.on("uncaughtExceptionMonitor",p),process.on("unhandledRejection",p),process.on("SIGINT",m),process.on("SIGTERM",m),process.on("exit",c)},F=()=>{process.removeListener("uncaughtExceptionMonitor",p),process.removeListener("unhandledRejection",p),process.removeListener("SIGINT",m),process.removeListener("SIGTERM",m),process.removeListener("exit",c)},E=()=>{if(void 0===l)return;r&&process.stdout.write(`
|
|
67
|
-
`);let e=l.split(`
|
|
68
|
-
`);process.stdout.write(C.cursor.move(-999,e.length-1)),process.stdout.write(C.erase.down(e.length))},f=e=>e.replace(/\.+$/,""),b=e=>{let t=(performance.now()-e)/1e3,u=Math.floor(t/60),r=Math.floor(t%60);return u>0?`[${u}m ${r}s]`:`[${r}s]`},_=(t="",u=0)=>{o=!1,clearInterval(s),E();let r=0===u?g.green(el):1===u?g.red(eo):g.red(ea);a=f(t??a),"timer"===e?process.stdout.write(`${r} ${a} ${b(h)}
|
|
69
|
-
`):process.stdout.write(`${r} ${a}
|
|
70
|
-
`),F(),i()};return{start:(c="")=>{o=!0,i=function({input:e=D.stdin,output:t=D.stdout,overwrite:u=!0,hideCursor:r=!0}={}){let i=n.createInterface({input:e,output:t,prompt:"",tabSize:1});n.emitKeypressEvents(e,i),e.isTTY&&e.setRawMode(!0);let s=(i,{name:D,sequence:o})=>{if(G([String(i),D,o],"cancel")){r&&t.write(C.cursor.show),process.exit(0);return}u&&n.moveCursor(t,"return"===D?0:-1,"return"===D?-1:0,()=>{n.clearLine(t,1,()=>{e.once("keypress",s)})})};return r&&t.write(C.cursor.hide),e.once("keypress",s),()=>{e.off("keypress",s),r&&t.write(C.cursor.show),e.isTTY&&!R&&e.setRawMode(!1),i.terminal=!1,i.close()}}(),a=f(c),h=performance.now(),process.stdout.write(`${g.gray(ec)}
|
|
71
|
-
`);let p=0,m=0;d(),s=setInterval(()=>{if(r&&a===l)return;E(),l=a;let u=g.magenta(t[p]);if(r)process.stdout.write(`${u} ${a}...`);else if("timer"===e)process.stdout.write(`${u} ${a} ${b(h)}`);else{let e=".".repeat(Math.floor(m)).slice(0,3);process.stdout.write(`${u} ${a}${e}`)}p=p+1<t.length?p+1:0,m=m<t.length?m+.125:0},u)},stop:_,message:(e="")=>{a=f(e??a)}}}),{program:eS,createCommand:eT,createArgument:eV,createOption:eM,CommanderError:eP,InvalidArgumentError:eI,InvalidOptionArgumentError:eH,Command:eN,Argument:eG,Option:eR,Help:eW}=F("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/index.js");var eL=F("../../node_modules/.pnpm/typia@8.0.3_@samchon+openapi@3.1.0_typescript@5.8.2/node_modules/typia/lib/internal/_assertGuard.js");function eK(e){return e.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}async function eq(e){try{let t=await import("prettier");return await t.format(e,{parser:"typescript"})}catch{return e}}let eU=(0,s.promisify)(c.exec),eY="@wrtnlabs/connector-";async function ez(){let e=await fetch("https://raw.githubusercontent.com/wrtnlabs/connectors/refs/heads/main/connectors-list.json"),t=await e.json();return(()=>{let e;let t=e=>Array.isArray(e.connectors)&&e.connectors.every(e=>"string"==typeof e&&RegExp(/^@wrtnlabs\/connector\x2d(.*)/).test(e))&&"string"==typeof e.version,u=(t,u,r=!0)=>((Array.isArray(t.connectors)||eL._assertGuard(r,{method:"typia.assert",path:u+".connectors",expected:"Array<`@wrtnlabs/connector-${string}`>",value:t.connectors},e))&&t.connectors.every((t,i)=>"string"==typeof t&&RegExp(/^@wrtnlabs\/connector\x2d(.*)/).test(t)||eL._assertGuard(r,{method:"typia.assert",path:u+".connectors["+i+"]",expected:"`@wrtnlabs/connector-${string}`",value:t},e))||eL._assertGuard(r,{method:"typia.assert",path:u+".connectors",expected:"Array<`@wrtnlabs/connector-${string}`>",value:t.connectors},e))&&("string"==typeof t.version||eL._assertGuard(r,{method:"typia.assert",path:u+".version",expected:"string",value:t.version},e)),r=e=>"object"==typeof e&&null!==e&&t(e);return(t,i)=>(!1===r(t)&&(e=i,((t,r,i=!0)=>("object"==typeof t&&null!==t||eL._assertGuard(!0,{method:"typia.assert",path:r+"",expected:"UnwrapTaggedConnectors",value:t},e))&&u(t,r+"",!0)||eL._assertGuard(!0,{method:"typia.assert",path:r+"",expected:"UnwrapTaggedConnectors",value:t},e))(t,"$input",!0)),t)})()(t)}async function eJ(){return(await ez()).connectors.map(e=>{let t=e.replace(eY,""),u=t.replace("-"," ").toUpperCase();return{packageName:e,serviceName:t,displayName:u}})}function eZ(e){return e.map(e=>{let t=eK(e);return`{
|
|
72
|
-
name: "${t} Connector",
|
|
73
|
-
protocol: "class",
|
|
74
|
-
application: typia.llm.application<${t}Service, "chatgpt">(),
|
|
75
|
-
execute: new ${t}Service(),
|
|
76
|
-
}`}).join(",\n")}function eQ(e){return e.map(e=>`import { ${eK(e)}Service } from "${eY}${e}";`).join("\n")}function eX({content:e,importCode:t,connectorCode:u}){return e.replace("/// INSERT IMPORT HERE",t).replace("/// INSERT CONTROLLER HERE",u)}async function e0({template:e,project:t}){await (0,p.downloadTemplate)(`github:wrtnlabs/agentica.template.${e}`,{dir:t}),await (0,l.rm)((0,h.join)(t,".github/dependabot.yml"),{force:!0})}async function e2({projectPath:e,dotEnvfileName:t,apiKeys:u}){if(!(0,a.existsSync)(e))throw Error(`${e} directory does not exist.`);let r=(0,h.join)(e,t??".env"),i=((0,a.existsSync)(r)?"\n":"")+u.map(({key:e,value:t})=>`${e}=${t}`).join("\n");await (0,l.appendFile)(r,i)}async function e3({packageManager:e,projectAbsolutePath:t,services:u}){let r=function({packageManager:e,pkg:t}){switch(e){case"npm":return`npm install ${t}`;case"yarn":return`yarn add ${t}`;case"pnpm":return`pnpm add ${t}`;case"bun":return`bun add ${t}`;default:throw Error(`Unsupported package manager: ${e}`)}}({packageManager:e,pkg:[...u.map(e=>`${eY}${e}`),"typescript"].join(" ")}),i=ek();i.start("\uD83D\uDCE6 Package installation in progress..."),await eU(r,{cwd:t}),i.stop("✅ Package installation completed")}async function e8({template:e}){let t={template:e};{let e=await eB({message:"Enter the project directory path:",placeholder:"./my-agentica-project",validate:e=>""===e?"Please enter a directory path":"."!==e[0]?"Please enter a relative path.":(0,a.existsSync)(e)?"Directory already exists":void 0});e===W&&D.default.exit(0);let u=(0,h.join)(D.default.cwd(),e);t.projectAbsolutePath=u}{let e=await e$({message:"Which package manager do you want to use?",initialValue:function(){let e=D.default.env.npm_config_user_agent;switch(!0){case e?.startsWith("npm"):return"npm";case e?.startsWith("yarn"):return"yarn";case e?.startsWith("pnpm"):return"pnpm";case e?.startsWith("bun"):return"bun";default:return"npm"}}(),options:[{value:"npm",label:"npm"},{value:"pnpm",label:"pnpm"},{value:"yarn",label:`yarn (${g.blueBright("berry is not supported")})`},{value:"bun",label:"bun"}]});e===W&&D.default.exit(0),ej.info(`📦 Using ${e} as package manager`),t.packageManager=e}if(null==t.template){let e=await e$({message:"Which project type do you want to start?",options:[{value:"standalone",label:`Standalone ${g.blueBright("Agent Server")}`},{value:"nodejs",label:`NodeJS ${g.blueBright("Agent Server")}`},{value:"nestjs",label:`NestJS ${g.blueBright("Agent Server")}`},{value:"react",label:`React ${g.blueBright("Application")}`},{value:"nestjs+react",label:`NestJS + React ${g.blueBright("Agent Server + Client Application")}`}]});e===W&&D.default.exit(0),t.template=e}if("standalone"!==t.template){let e=await eB({message:"Server Port(if project is client app, this port mean ws server port):",initialValue:"3000",validate(e){if(Number.isNaN(Number.parseInt(e)))return"Port must be an integer"}});e===W&&D.default.exit(0),t.port=Number(e)}if("react"!==t.template){let e=(await eJ()).sort((e,t)=>e.displayName.localeCompare(t.displayName)).map(({displayName:e,serviceName:t})=>({label:e,value:t})),u=await ew({message:"Which connectors do you want to include?",options:e,required:!1});u===W&&D.default.exit(0),t.services=u}{let e=await ey({message:"Enter your OpenAI API key?",initialValue:!1});if(e===W&&D.default.exit(0),e){let e=await eB({message:"Please enter your OPENAI API key:"});e===W&&D.default.exit(0),t.openAIKey=e}else t.openAIKey=null}try{(()=>{let e;let t=e=>("npm"===e.packageManager||"yarn"===e.packageManager||"pnpm"===e.packageManager||"bun"===e.packageManager)&&"string"==typeof e.projectAbsolutePath&&("nodejs"===e.template||"nestjs"===e.template||"react"===e.template||"standalone"===e.template||"nestjs+react"===e.template)&&(null===e.openAIKey||"string"==typeof e.openAIKey)&&(void 0===e.port||"number"==typeof e.port)&&Array.isArray(e.services)&&e.services.every(e=>"string"==typeof e),u=(t,u,r=!0)=>("npm"===t.packageManager||"yarn"===t.packageManager||"pnpm"===t.packageManager||"bun"===t.packageManager||eL._assertGuard(r,{method:"typia.assertGuard",path:u+".packageManager",expected:'("bun" | "npm" | "pnpm" | "yarn")',value:t.packageManager},e))&&("string"==typeof t.projectAbsolutePath||eL._assertGuard(r,{method:"typia.assertGuard",path:u+".projectAbsolutePath",expected:"string",value:t.projectAbsolutePath},e))&&("nodejs"===t.template||"nestjs"===t.template||"react"===t.template||"standalone"===t.template||"nestjs+react"===t.template||eL._assertGuard(r,{method:"typia.assertGuard",path:u+".template",expected:'("nestjs" | "nestjs+react" | "nodejs" | "react" | "standalone")',value:t.template},e))&&(null===t.openAIKey||"string"==typeof t.openAIKey||eL._assertGuard(r,{method:"typia.assertGuard",path:u+".openAIKey",expected:"(null | string)",value:t.openAIKey},e))&&(void 0===t.port||"number"==typeof t.port||eL._assertGuard(r,{method:"typia.assertGuard",path:u+".port",expected:"(number | undefined)",value:t.port},e))&&((Array.isArray(t.services)||eL._assertGuard(r,{method:"typia.assertGuard",path:u+".services",expected:"Array<string>",value:t.services},e))&&t.services.every((t,i)=>"string"==typeof t||eL._assertGuard(r,{method:"typia.assertGuard",path:u+".services["+i+"]",expected:"string",value:t},e))||eL._assertGuard(r,{method:"typia.assertGuard",path:u+".services",expected:"Array<string>",value:t.services},e)),r=e=>"object"==typeof e&&null!==e&&t(e);return(t,i)=>{!1===r(t)&&(e=i,((t,r,i=!0)=>("object"==typeof t&&null!==t||eL._assertGuard(!0,{method:"typia.assertGuard",path:r+"",expected:"__type",value:t},e))&&u(t,r+"",!0)||eL._assertGuard(!0,{method:"typia.assertGuard",path:r+"",expected:"__type",value:t},e))(t,"$input",!0))}})()(t)}catch(e){throw Error(`❌ ${e.toString()}`)}return t}async function e1({projectAbsolutePath:e,context:t}){await e0({template:"standalone",project:e}),ej.success("✅ Template downloaded");let u=eQ(t.services),r=eZ(t.services),i=(0,h.join)(e,"src/index.ts"),D=eX({content:await (0,l.readFile)(i,"utf-8"),importCode:u,connectorCode:r}),s=await eq(D);await (0,l.writeFile)(i,s),await e2({projectPath:e,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""}]}),ej.success("✅ .env created"),await e3({packageManager:t.packageManager,projectAbsolutePath:e,services:t.services})}async function e6({projectAbsolutePath:e,context:t}){await e0({template:"nodejs",project:e}),ej.success("✅ Template downloaded");let u=eQ(t.services),r=eZ(t.services),i=(0,h.join)(e,"src/index.ts"),D=await (0,l.readFile)(i,"utf-8"),s=eX({content:D=D.replace(/import \{ BbsArticleService \}.*;\n/g,"").replace(/controllers:\s*\[[\s\S]*?\],\n/,"controllers: [/// INSERT CONTROLLER HERE],\n"),importCode:u,connectorCode:r}),n=await eq(s);await (0,l.writeFile)(i,n),await e2({projectPath:e,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},{key:"PORT",value:t.port?.toString()??"3000"}]}),ej.success("✅ .env created"),await e3({packageManager:t.packageManager,projectAbsolutePath:e,services:t.services})}async function e7({projectAbsolutePath:e,context:t}){await e0({template:"nestjs",project:e}),ej.success("✅ Template downloaded");let u=eQ(t.services),r=eZ(t.services),i=(0,h.join)(e,"src/controllers/chat/ChatController.ts"),D=eX({content:await (0,l.readFile)(i,"utf-8"),importCode:u,connectorCode:r}),s=await eq(D);await (0,l.writeFile)(i,s),await e2({projectPath:e,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},{key:"API_PORT",value:t.port?.toString()??"3000"}]}),ej.success("✅ .env created"),await e3({packageManager:t.packageManager,projectAbsolutePath:e,services:t.services})}async function e9({projectAbsolutePath:e,context:t}){await e0({template:"react",project:e}),ej.success("✅ Template downloaded"),await e2({projectPath:e,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},{key:"VITE_AGENTICA_WS_URL",value:`ws://localhost:${t.port}/chat`}]}),ej.success("✅ .env created"),await e3({packageManager:t.packageManager,projectAbsolutePath:e,services:t.services})}async function e4({template:e}){ex("Agentica Start Wizard");let t=await e8({template:e}),{projectAbsolutePath:u}=t;switch(t.template){case"standalone":await e1({projectAbsolutePath:u,context:t});break;case"nodejs":await e6({projectAbsolutePath:u,context:t});break;case"nestjs":await e7({projectAbsolutePath:u,context:t});break;case"react":await e9({projectAbsolutePath:u,context:t});break;case"nestjs+react":await e7({projectAbsolutePath:(0,h.join)(u,"server"),context:t}),await e9({projectAbsolutePath:(0,h.join)(u,"client"),context:t});break;default:throw t.template,Error(`❌ Template ${t.template} not supported`)}eO(`
|
|
77
|
-
🎉 Project ${u} created
|
|
78
|
-
⚠️ ${g.yellow("Note:")} Please implement constructor values for each controller generated in agent.ts or index.ts
|
|
79
|
-
`)}let e5=new eN;e5.command("start").description("Start a new project").option("-p, --project [nodejs|nestjs|react|nestjs+react|standalone]","The project type").action(async e=>{let t;if(!0===e.project){ej.error(`
|
|
80
|
-
❌ The value of ${g.redBright("--project")} is required`);return}if(void 0!==(t=e.project)&&"nodejs"!==t&&"nestjs"!==t&&"react"!==t&&"standalone"!==t&&"nestjs+react"!==t){ej.error(`
|
|
81
|
-
❌ The value of ${g.redBright("--project")} is invalid`);return}await e4({template:e.project})}),ex(`🚀 ${g.blueBright("Agentica")} Setup Wizard`),e5.parse(D.default.argv);
|