@buiducnhat/agent-skills 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1667 -0
  2. package/package.json +50 -0
package/dist/index.js ADDED
@@ -0,0 +1,1667 @@
1
+ #!/usr/bin/env node
2
+ import fs, { existsSync, mkdtempSync } from "node:fs";
3
+ import path from "node:path";
4
+ import { stripVTControlCharacters } from "node:util";
5
+ import y, { stdin, stdout } from "node:process";
6
+ import * as g from "node:readline";
7
+ import O from "node:readline";
8
+ import { Writable } from "node:stream";
9
+ import { execSync } from "node:child_process";
10
+ import { tmpdir } from "node:os";
11
+
12
+ //#region \0rolldown/runtime.js
13
+ var __create = Object.create;
14
+ var __defProp = Object.defineProperty;
15
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
16
+ var __getOwnPropNames = Object.getOwnPropertyNames;
17
+ var __getProtoOf = Object.getPrototypeOf;
18
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
19
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
20
+ var __copyProps = (to, from, except, desc) => {
21
+ if (from && typeof from === "object" || typeof from === "function") {
22
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
23
+ key = keys[i];
24
+ if (!__hasOwnProp.call(to, key) && key !== except) {
25
+ __defProp(to, key, {
26
+ get: ((k) => from[k]).bind(null, key),
27
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
28
+ });
29
+ }
30
+ }
31
+ }
32
+ return to;
33
+ };
34
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
35
+ value: mod,
36
+ enumerable: true
37
+ }) : target, mod));
38
+
39
+ //#endregion
40
+ //#region node_modules/sisteransi/src/index.js
41
+ var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
42
+ const ESC = "\x1B";
43
+ const CSI = `${ESC}[`;
44
+ const beep = "\x07";
45
+ const cursor = {
46
+ to(x, y) {
47
+ if (!y) return `${CSI}${x + 1}G`;
48
+ return `${CSI}${y + 1};${x + 1}H`;
49
+ },
50
+ move(x, y) {
51
+ let ret = "";
52
+ if (x < 0) ret += `${CSI}${-x}D`;
53
+ else if (x > 0) ret += `${CSI}${x}C`;
54
+ if (y < 0) ret += `${CSI}${-y}A`;
55
+ else if (y > 0) ret += `${CSI}${y}B`;
56
+ return ret;
57
+ },
58
+ up: (count = 1) => `${CSI}${count}A`,
59
+ down: (count = 1) => `${CSI}${count}B`,
60
+ forward: (count = 1) => `${CSI}${count}C`,
61
+ backward: (count = 1) => `${CSI}${count}D`,
62
+ nextLine: (count = 1) => `${CSI}E`.repeat(count),
63
+ prevLine: (count = 1) => `${CSI}F`.repeat(count),
64
+ left: `${CSI}G`,
65
+ hide: `${CSI}?25l`,
66
+ show: `${CSI}?25h`,
67
+ save: `${ESC}7`,
68
+ restore: `${ESC}8`
69
+ };
70
+ const scroll = {
71
+ up: (count = 1) => `${CSI}S`.repeat(count),
72
+ down: (count = 1) => `${CSI}T`.repeat(count)
73
+ };
74
+ const erase = {
75
+ screen: `${CSI}2J`,
76
+ up: (count = 1) => `${CSI}1J`.repeat(count),
77
+ down: (count = 1) => `${CSI}J`.repeat(count),
78
+ line: `${CSI}2K`,
79
+ lineEnd: `${CSI}K`,
80
+ lineStart: `${CSI}1K`,
81
+ lines(count) {
82
+ let clear = "";
83
+ for (let i = 0; i < count; i++) clear += this.line + (i < count - 1 ? cursor.up() : "");
84
+ if (count) clear += cursor.left;
85
+ return clear;
86
+ }
87
+ };
88
+ module.exports = {
89
+ cursor,
90
+ scroll,
91
+ erase,
92
+ beep
93
+ };
94
+ }));
95
+
96
+ //#endregion
97
+ //#region node_modules/picocolors/picocolors.js
98
+ var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
99
+ let p = process || {}, argv = p.argv || [], env = p.env || {};
100
+ let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
101
+ let formatter = (open, close, replace = open) => (input) => {
102
+ let string = "" + input, index = string.indexOf(close, open.length);
103
+ return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
104
+ };
105
+ let replaceClose = (string, close, replace, index) => {
106
+ let result = "", cursor = 0;
107
+ do {
108
+ result += string.substring(cursor, index) + replace;
109
+ cursor = index + close.length;
110
+ index = string.indexOf(close, cursor);
111
+ } while (~index);
112
+ return result + string.substring(cursor);
113
+ };
114
+ let createColors = (enabled = isColorSupported) => {
115
+ let f = enabled ? formatter : () => String;
116
+ return {
117
+ isColorSupported: enabled,
118
+ reset: f("\x1B[0m", "\x1B[0m"),
119
+ bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
120
+ dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
121
+ italic: f("\x1B[3m", "\x1B[23m"),
122
+ underline: f("\x1B[4m", "\x1B[24m"),
123
+ inverse: f("\x1B[7m", "\x1B[27m"),
124
+ hidden: f("\x1B[8m", "\x1B[28m"),
125
+ strikethrough: f("\x1B[9m", "\x1B[29m"),
126
+ black: f("\x1B[30m", "\x1B[39m"),
127
+ red: f("\x1B[31m", "\x1B[39m"),
128
+ green: f("\x1B[32m", "\x1B[39m"),
129
+ yellow: f("\x1B[33m", "\x1B[39m"),
130
+ blue: f("\x1B[34m", "\x1B[39m"),
131
+ magenta: f("\x1B[35m", "\x1B[39m"),
132
+ cyan: f("\x1B[36m", "\x1B[39m"),
133
+ white: f("\x1B[37m", "\x1B[39m"),
134
+ gray: f("\x1B[90m", "\x1B[39m"),
135
+ bgBlack: f("\x1B[40m", "\x1B[49m"),
136
+ bgRed: f("\x1B[41m", "\x1B[49m"),
137
+ bgGreen: f("\x1B[42m", "\x1B[49m"),
138
+ bgYellow: f("\x1B[43m", "\x1B[49m"),
139
+ bgBlue: f("\x1B[44m", "\x1B[49m"),
140
+ bgMagenta: f("\x1B[45m", "\x1B[49m"),
141
+ bgCyan: f("\x1B[46m", "\x1B[49m"),
142
+ bgWhite: f("\x1B[47m", "\x1B[49m"),
143
+ blackBright: f("\x1B[90m", "\x1B[39m"),
144
+ redBright: f("\x1B[91m", "\x1B[39m"),
145
+ greenBright: f("\x1B[92m", "\x1B[39m"),
146
+ yellowBright: f("\x1B[93m", "\x1B[39m"),
147
+ blueBright: f("\x1B[94m", "\x1B[39m"),
148
+ magentaBright: f("\x1B[95m", "\x1B[39m"),
149
+ cyanBright: f("\x1B[96m", "\x1B[39m"),
150
+ whiteBright: f("\x1B[97m", "\x1B[39m"),
151
+ bgBlackBright: f("\x1B[100m", "\x1B[49m"),
152
+ bgRedBright: f("\x1B[101m", "\x1B[49m"),
153
+ bgGreenBright: f("\x1B[102m", "\x1B[49m"),
154
+ bgYellowBright: f("\x1B[103m", "\x1B[49m"),
155
+ bgBlueBright: f("\x1B[104m", "\x1B[49m"),
156
+ bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
157
+ bgCyanBright: f("\x1B[106m", "\x1B[49m"),
158
+ bgWhiteBright: f("\x1B[107m", "\x1B[49m")
159
+ };
160
+ };
161
+ module.exports = createColors();
162
+ module.exports.createColors = createColors;
163
+ }));
164
+
165
+ //#endregion
166
+ //#region node_modules/@clack/core/dist/index.mjs
167
+ var import_src = require_src();
168
+ var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
169
+ function DD({ onlyFirst: e = !1 } = {}) {
170
+ const t = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
171
+ return new RegExp(t, e ? void 0 : "g");
172
+ }
173
+ const uD = DD();
174
+ function P$1(e) {
175
+ if (typeof e != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);
176
+ return e.replace(uD, "");
177
+ }
178
+ function L$1(e) {
179
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
180
+ }
181
+ var W$1 = { exports: {} };
182
+ (function(e) {
183
+ var u = {};
184
+ e.exports = u, u.eastAsianWidth = function(F) {
185
+ var s = F.charCodeAt(0), i = F.length == 2 ? F.charCodeAt(1) : 0, D = s;
186
+ return 55296 <= s && s <= 56319 && 56320 <= i && i <= 57343 && (s &= 1023, i &= 1023, D = s << 10 | i, D += 65536), D == 12288 || 65281 <= D && D <= 65376 || 65504 <= D && D <= 65510 ? "F" : D == 8361 || 65377 <= D && D <= 65470 || 65474 <= D && D <= 65479 || 65482 <= D && D <= 65487 || 65490 <= D && D <= 65495 || 65498 <= D && D <= 65500 || 65512 <= D && D <= 65518 ? "H" : 4352 <= D && D <= 4447 || 4515 <= D && D <= 4519 || 4602 <= D && D <= 4607 || 9001 <= D && D <= 9002 || 11904 <= D && D <= 11929 || 11931 <= D && D <= 12019 || 12032 <= D && D <= 12245 || 12272 <= D && D <= 12283 || 12289 <= D && D <= 12350 || 12353 <= D && D <= 12438 || 12441 <= D && D <= 12543 || 12549 <= D && D <= 12589 || 12593 <= D && D <= 12686 || 12688 <= D && D <= 12730 || 12736 <= D && D <= 12771 || 12784 <= D && D <= 12830 || 12832 <= D && D <= 12871 || 12880 <= D && D <= 13054 || 13056 <= D && D <= 19903 || 19968 <= D && D <= 42124 || 42128 <= D && D <= 42182 || 43360 <= D && D <= 43388 || 44032 <= D && D <= 55203 || 55216 <= D && D <= 55238 || 55243 <= D && D <= 55291 || 63744 <= D && D <= 64255 || 65040 <= D && D <= 65049 || 65072 <= D && D <= 65106 || 65108 <= D && D <= 65126 || 65128 <= D && D <= 65131 || 110592 <= D && D <= 110593 || 127488 <= D && D <= 127490 || 127504 <= D && D <= 127546 || 127552 <= D && D <= 127560 || 127568 <= D && D <= 127569 || 131072 <= D && D <= 194367 || 177984 <= D && D <= 196605 || 196608 <= D && D <= 262141 ? "W" : 32 <= D && D <= 126 || 162 <= D && D <= 163 || 165 <= D && D <= 166 || D == 172 || D == 175 || 10214 <= D && D <= 10221 || 10629 <= D && D <= 10630 ? "Na" : D == 161 || D == 164 || 167 <= D && D <= 168 || D == 170 || 173 <= D && D <= 174 || 176 <= D && D <= 180 || 182 <= D && D <= 186 || 188 <= D && D <= 191 || D == 198 || D == 208 || 215 <= D && D <= 216 || 222 <= D && D <= 225 || D == 230 || 232 <= D && D <= 234 || 236 <= D && D <= 237 || D == 240 || 242 <= D && D <= 243 || 247 <= D && D <= 250 || D == 252 || D == 254 || D == 257 || D == 273 || D == 275 || D == 283 || 294 <= D && D <= 295 || D == 299 || 305 <= D && D <= 307 || D == 312 || 319 <= D && D <= 322 || D == 324 || 328 <= D && D <= 331 || D == 333 || 338 <= D && D <= 339 || 358 <= D && D <= 359 || D == 363 || D == 462 || D == 464 || D == 466 || D == 468 || D == 470 || D == 472 || D == 474 || D == 476 || D == 593 || D == 609 || D == 708 || D == 711 || 713 <= D && D <= 715 || D == 717 || D == 720 || 728 <= D && D <= 731 || D == 733 || D == 735 || 768 <= D && D <= 879 || 913 <= D && D <= 929 || 931 <= D && D <= 937 || 945 <= D && D <= 961 || 963 <= D && D <= 969 || D == 1025 || 1040 <= D && D <= 1103 || D == 1105 || D == 8208 || 8211 <= D && D <= 8214 || 8216 <= D && D <= 8217 || 8220 <= D && D <= 8221 || 8224 <= D && D <= 8226 || 8228 <= D && D <= 8231 || D == 8240 || 8242 <= D && D <= 8243 || D == 8245 || D == 8251 || D == 8254 || D == 8308 || D == 8319 || 8321 <= D && D <= 8324 || D == 8364 || D == 8451 || D == 8453 || D == 8457 || D == 8467 || D == 8470 || 8481 <= D && D <= 8482 || D == 8486 || D == 8491 || 8531 <= D && D <= 8532 || 8539 <= D && D <= 8542 || 8544 <= D && D <= 8555 || 8560 <= D && D <= 8569 || D == 8585 || 8592 <= D && D <= 8601 || 8632 <= D && D <= 8633 || D == 8658 || D == 8660 || D == 8679 || D == 8704 || 8706 <= D && D <= 8707 || 8711 <= D && D <= 8712 || D == 8715 || D == 8719 || D == 8721 || D == 8725 || D == 8730 || 8733 <= D && D <= 8736 || D == 8739 || D == 8741 || 8743 <= D && D <= 8748 || D == 8750 || 8756 <= D && D <= 8759 || 8764 <= D && D <= 8765 || D == 8776 || D == 8780 || D == 8786 || 8800 <= D && D <= 8801 || 8804 <= D && D <= 8807 || 8810 <= D && D <= 8811 || 8814 <= D && D <= 8815 || 8834 <= D && D <= 8835 || 8838 <= D && D <= 8839 || D == 8853 || D == 8857 || D == 8869 || D == 8895 || D == 8978 || 9312 <= D && D <= 9449 || 9451 <= D && D <= 9547 || 9552 <= D && D <= 9587 || 9600 <= D && D <= 9615 || 9618 <= D && D <= 9621 || 9632 <= D && D <= 9633 || 9635 <= D && D <= 9641 || 9650 <= D && D <= 9651 || 9654 <= D && D <= 9655 || 9660 <= D && D <= 9661 || 9664 <= D && D <= 9665 || 9670 <= D && D <= 9672 || D == 9675 || 9678 <= D && D <= 9681 || 9698 <= D && D <= 9701 || D == 9711 || 9733 <= D && D <= 9734 || D == 9737 || 9742 <= D && D <= 9743 || 9748 <= D && D <= 9749 || D == 9756 || D == 9758 || D == 9792 || D == 9794 || 9824 <= D && D <= 9825 || 9827 <= D && D <= 9829 || 9831 <= D && D <= 9834 || 9836 <= D && D <= 9837 || D == 9839 || 9886 <= D && D <= 9887 || 9918 <= D && D <= 9919 || 9924 <= D && D <= 9933 || 9935 <= D && D <= 9953 || D == 9955 || 9960 <= D && D <= 9983 || D == 10045 || D == 10071 || 10102 <= D && D <= 10111 || 11093 <= D && D <= 11097 || 12872 <= D && D <= 12879 || 57344 <= D && D <= 63743 || 65024 <= D && D <= 65039 || D == 65533 || 127232 <= D && D <= 127242 || 127248 <= D && D <= 127277 || 127280 <= D && D <= 127337 || 127344 <= D && D <= 127386 || 917760 <= D && D <= 917999 || 983040 <= D && D <= 1048573 || 1048576 <= D && D <= 1114109 ? "A" : "N";
187
+ }, u.characterLength = function(F) {
188
+ var s = this.eastAsianWidth(F);
189
+ return s == "F" || s == "W" || s == "A" ? 2 : 1;
190
+ };
191
+ function t(F) {
192
+ return F.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
193
+ }
194
+ u.length = function(F) {
195
+ for (var s = t(F), i = 0, D = 0; D < s.length; D++) i = i + this.characterLength(s[D]);
196
+ return i;
197
+ }, u.slice = function(F, s, i) {
198
+ textLen = u.length(F), s = s || 0, i = i || 1, s < 0 && (s = textLen + s), i < 0 && (i = textLen + i);
199
+ for (var D = "", r = 0, n = t(F), E = 0; E < n.length; E++) {
200
+ var a = n[E], o = u.length(a);
201
+ if (r >= s - (o == 2 ? 1 : 0)) if (r + o <= i) D += a;
202
+ else break;
203
+ r += o;
204
+ }
205
+ return D;
206
+ };
207
+ })(W$1);
208
+ var tD = W$1.exports;
209
+ const eD = L$1(tD);
210
+ var FD = function() {
211
+ 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;
212
+ };
213
+ const sD = L$1(FD);
214
+ function p(e, u = {}) {
215
+ if (typeof e != "string" || e.length === 0 || (u = {
216
+ ambiguousIsNarrow: !0,
217
+ ...u
218
+ }, e = P$1(e), e.length === 0)) return 0;
219
+ e = e.replace(sD(), " ");
220
+ const t = u.ambiguousIsNarrow ? 1 : 2;
221
+ let F = 0;
222
+ for (const s of e) {
223
+ const i = s.codePointAt(0);
224
+ if (i <= 31 || i >= 127 && i <= 159 || i >= 768 && i <= 879) continue;
225
+ switch (eD.eastAsianWidth(s)) {
226
+ case "F":
227
+ case "W":
228
+ F += 2;
229
+ break;
230
+ case "A":
231
+ F += t;
232
+ break;
233
+ default: F += 1;
234
+ }
235
+ }
236
+ return F;
237
+ }
238
+ const w = 10, N = (e = 0) => (u) => `\x1B[${u + e}m`, I = (e = 0) => (u) => `\x1B[${38 + e};5;${u}m`, R = (e = 0) => (u, t, F) => `\x1B[${38 + e};2;${u};${t};${F}m`, C$1 = {
239
+ modifier: {
240
+ reset: [0, 0],
241
+ bold: [1, 22],
242
+ dim: [2, 22],
243
+ italic: [3, 23],
244
+ underline: [4, 24],
245
+ overline: [53, 55],
246
+ inverse: [7, 27],
247
+ hidden: [8, 28],
248
+ strikethrough: [9, 29]
249
+ },
250
+ color: {
251
+ black: [30, 39],
252
+ red: [31, 39],
253
+ green: [32, 39],
254
+ yellow: [33, 39],
255
+ blue: [34, 39],
256
+ magenta: [35, 39],
257
+ cyan: [36, 39],
258
+ white: [37, 39],
259
+ blackBright: [90, 39],
260
+ gray: [90, 39],
261
+ grey: [90, 39],
262
+ redBright: [91, 39],
263
+ greenBright: [92, 39],
264
+ yellowBright: [93, 39],
265
+ blueBright: [94, 39],
266
+ magentaBright: [95, 39],
267
+ cyanBright: [96, 39],
268
+ whiteBright: [97, 39]
269
+ },
270
+ bgColor: {
271
+ bgBlack: [40, 49],
272
+ bgRed: [41, 49],
273
+ bgGreen: [42, 49],
274
+ bgYellow: [43, 49],
275
+ bgBlue: [44, 49],
276
+ bgMagenta: [45, 49],
277
+ bgCyan: [46, 49],
278
+ bgWhite: [47, 49],
279
+ bgBlackBright: [100, 49],
280
+ bgGray: [100, 49],
281
+ bgGrey: [100, 49],
282
+ bgRedBright: [101, 49],
283
+ bgGreenBright: [102, 49],
284
+ bgYellowBright: [103, 49],
285
+ bgBlueBright: [104, 49],
286
+ bgMagentaBright: [105, 49],
287
+ bgCyanBright: [106, 49],
288
+ bgWhiteBright: [107, 49]
289
+ }
290
+ };
291
+ Object.keys(C$1.modifier);
292
+ const iD = Object.keys(C$1.color), rD = Object.keys(C$1.bgColor);
293
+ [...iD, ...rD];
294
+ function CD() {
295
+ const e = /* @__PURE__ */ new Map();
296
+ for (const [u, t] of Object.entries(C$1)) {
297
+ for (const [F, s] of Object.entries(t)) C$1[F] = {
298
+ open: `\x1B[${s[0]}m`,
299
+ close: `\x1B[${s[1]}m`
300
+ }, t[F] = C$1[F], e.set(s[0], s[1]);
301
+ Object.defineProperty(C$1, u, {
302
+ value: t,
303
+ enumerable: !1
304
+ });
305
+ }
306
+ return Object.defineProperty(C$1, "codes", {
307
+ value: e,
308
+ enumerable: !1
309
+ }), C$1.color.close = "\x1B[39m", C$1.bgColor.close = "\x1B[49m", C$1.color.ansi = N(), C$1.color.ansi256 = I(), C$1.color.ansi16m = R(), C$1.bgColor.ansi = N(w), C$1.bgColor.ansi256 = I(w), C$1.bgColor.ansi16m = R(w), Object.defineProperties(C$1, {
310
+ rgbToAnsi256: {
311
+ value: (u, t, F) => u === t && t === F ? u < 8 ? 16 : u > 248 ? 231 : Math.round((u - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u / 255 * 5) + 6 * Math.round(t / 255 * 5) + Math.round(F / 255 * 5),
312
+ enumerable: !1
313
+ },
314
+ hexToRgb: {
315
+ value: (u) => {
316
+ const t = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));
317
+ if (!t) return [
318
+ 0,
319
+ 0,
320
+ 0
321
+ ];
322
+ let [F] = t;
323
+ F.length === 3 && (F = [...F].map((i) => i + i).join(""));
324
+ const s = Number.parseInt(F, 16);
325
+ return [
326
+ s >> 16 & 255,
327
+ s >> 8 & 255,
328
+ s & 255
329
+ ];
330
+ },
331
+ enumerable: !1
332
+ },
333
+ hexToAnsi256: {
334
+ value: (u) => C$1.rgbToAnsi256(...C$1.hexToRgb(u)),
335
+ enumerable: !1
336
+ },
337
+ ansi256ToAnsi: {
338
+ value: (u) => {
339
+ if (u < 8) return 30 + u;
340
+ if (u < 16) return 90 + (u - 8);
341
+ let t, F, s;
342
+ if (u >= 232) t = ((u - 232) * 10 + 8) / 255, F = t, s = t;
343
+ else {
344
+ u -= 16;
345
+ const r = u % 36;
346
+ t = Math.floor(u / 36) / 5, F = Math.floor(r / 6) / 5, s = r % 6 / 5;
347
+ }
348
+ const i = Math.max(t, F, s) * 2;
349
+ if (i === 0) return 30;
350
+ let D = 30 + (Math.round(s) << 2 | Math.round(F) << 1 | Math.round(t));
351
+ return i === 2 && (D += 60), D;
352
+ },
353
+ enumerable: !1
354
+ },
355
+ rgbToAnsi: {
356
+ value: (u, t, F) => C$1.ansi256ToAnsi(C$1.rgbToAnsi256(u, t, F)),
357
+ enumerable: !1
358
+ },
359
+ hexToAnsi: {
360
+ value: (u) => C$1.ansi256ToAnsi(C$1.hexToAnsi256(u)),
361
+ enumerable: !1
362
+ }
363
+ }), C$1;
364
+ }
365
+ const ED = CD(), d$1 = new Set(["\x1B", "›"]), oD = 39, y$1 = "\x07", V$1 = "[", nD = "]", G$1 = "m", _$1 = `${nD}8;;`, z = (e) => `${d$1.values().next().value}${V$1}${e}${G$1}`, K$1 = (e) => `${d$1.values().next().value}${_$1}${e}${y$1}`, aD = (e) => e.split(" ").map((u) => p(u)), k$1 = (e, u, t) => {
366
+ const F = [...u];
367
+ let s = !1, i = !1, D = p(P$1(e[e.length - 1]));
368
+ for (const [r, n] of F.entries()) {
369
+ const E = p(n);
370
+ if (D + E <= t ? e[e.length - 1] += n : (e.push(n), D = 0), d$1.has(n) && (s = !0, i = F.slice(r + 1).join("").startsWith(_$1)), s) {
371
+ i ? n === y$1 && (s = !1, i = !1) : n === G$1 && (s = !1);
372
+ continue;
373
+ }
374
+ D += E, D === t && r < F.length - 1 && (e.push(""), D = 0);
375
+ }
376
+ !D && e[e.length - 1].length > 0 && e.length > 1 && (e[e.length - 2] += e.pop());
377
+ }, hD = (e) => {
378
+ const u = e.split(" ");
379
+ let t = u.length;
380
+ for (; t > 0 && !(p(u[t - 1]) > 0);) t--;
381
+ return t === u.length ? e : u.slice(0, t).join(" ") + u.slice(t).join("");
382
+ }, lD = (e, u, t = {}) => {
383
+ if (t.trim !== !1 && e.trim() === "") return "";
384
+ let F = "", s, i;
385
+ const D = aD(e);
386
+ let r = [""];
387
+ for (const [E, a] of e.split(" ").entries()) {
388
+ t.trim !== !1 && (r[r.length - 1] = r[r.length - 1].trimStart());
389
+ let o = p(r[r.length - 1]);
390
+ if (E !== 0 && (o >= u && (t.wordWrap === !1 || t.trim === !1) && (r.push(""), o = 0), (o > 0 || t.trim === !1) && (r[r.length - 1] += " ", o++)), t.hard && D[E] > u) {
391
+ const c = u - o, f = 1 + Math.floor((D[E] - c - 1) / u);
392
+ Math.floor((D[E] - 1) / u) < f && r.push(""), k$1(r, a, u);
393
+ continue;
394
+ }
395
+ if (o + D[E] > u && o > 0 && D[E] > 0) {
396
+ if (t.wordWrap === !1 && o < u) {
397
+ k$1(r, a, u);
398
+ continue;
399
+ }
400
+ r.push("");
401
+ }
402
+ if (o + D[E] > u && t.wordWrap === !1) {
403
+ k$1(r, a, u);
404
+ continue;
405
+ }
406
+ r[r.length - 1] += a;
407
+ }
408
+ t.trim !== !1 && (r = r.map((E) => hD(E)));
409
+ const n = [...r.join(`
410
+ `)];
411
+ for (const [E, a] of n.entries()) {
412
+ if (F += a, d$1.has(a)) {
413
+ const { groups: c } = new RegExp(`(?:\\${V$1}(?<code>\\d+)m|\\${_$1}(?<uri>.*)${y$1})`).exec(n.slice(E).join("")) || { groups: {} };
414
+ if (c.code !== void 0) {
415
+ const f = Number.parseFloat(c.code);
416
+ s = f === oD ? void 0 : f;
417
+ } else c.uri !== void 0 && (i = c.uri.length === 0 ? void 0 : c.uri);
418
+ }
419
+ const o = ED.codes.get(Number(s));
420
+ n[E + 1] === `
421
+ ` ? (i && (F += K$1("")), s && o && (F += z(o))) : a === `
422
+ ` && (s && o && (F += z(s)), i && (F += K$1(i)));
423
+ }
424
+ return F;
425
+ };
426
+ function Y$1(e, u, t) {
427
+ return String(e).normalize().replace(/\r\n/g, `
428
+ `).split(`
429
+ `).map((F) => lD(F, u, t)).join(`
430
+ `);
431
+ }
432
+ const B = {
433
+ actions: new Set([
434
+ "up",
435
+ "down",
436
+ "left",
437
+ "right",
438
+ "space",
439
+ "enter",
440
+ "cancel"
441
+ ]),
442
+ aliases: new Map([
443
+ ["k", "up"],
444
+ ["j", "down"],
445
+ ["h", "left"],
446
+ ["l", "right"],
447
+ ["", "cancel"],
448
+ ["escape", "cancel"]
449
+ ])
450
+ };
451
+ function $(e, u) {
452
+ if (typeof e == "string") return B.aliases.get(e) === u;
453
+ for (const t of e) if (t !== void 0 && $(t, u)) return !0;
454
+ return !1;
455
+ }
456
+ function BD(e, u) {
457
+ if (e === u) return;
458
+ const t = e.split(`
459
+ `), F = u.split(`
460
+ `), s = [];
461
+ for (let i = 0; i < Math.max(t.length, F.length); i++) t[i] !== F[i] && s.push(i);
462
+ return s;
463
+ }
464
+ const AD = globalThis.process.platform.startsWith("win"), S = Symbol("clack:cancel");
465
+ function pD(e) {
466
+ return e === S;
467
+ }
468
+ function m(e, u) {
469
+ const t = e;
470
+ t.isTTY && t.setRawMode(u);
471
+ }
472
+ function fD({ input: e = stdin, output: u = stdout, overwrite: t = !0, hideCursor: F = !0 } = {}) {
473
+ const s = g.createInterface({
474
+ input: e,
475
+ output: u,
476
+ prompt: "",
477
+ tabSize: 1
478
+ });
479
+ g.emitKeypressEvents(e, s), e.isTTY && e.setRawMode(!0);
480
+ const i = (D, { name: r, sequence: n }) => {
481
+ if ($([
482
+ String(D),
483
+ r,
484
+ n
485
+ ], "cancel")) {
486
+ F && u.write(import_src.cursor.show), process.exit(0);
487
+ return;
488
+ }
489
+ if (!t) return;
490
+ const a = r === "return" ? 0 : -1, o = r === "return" ? -1 : 0;
491
+ g.moveCursor(u, a, o, () => {
492
+ g.clearLine(u, 1, () => {
493
+ e.once("keypress", i);
494
+ });
495
+ });
496
+ };
497
+ return F && u.write(import_src.cursor.hide), e.once("keypress", i), () => {
498
+ e.off("keypress", i), F && u.write(import_src.cursor.show), e.isTTY && !AD && e.setRawMode(!1), s.terminal = !1, s.close();
499
+ };
500
+ }
501
+ var gD = Object.defineProperty, vD = (e, u, t) => u in e ? gD(e, u, {
502
+ enumerable: !0,
503
+ configurable: !0,
504
+ writable: !0,
505
+ value: t
506
+ }) : e[u] = t, h = (e, u, t) => (vD(e, typeof u != "symbol" ? u + "" : u, t), t);
507
+ var x$1 = class {
508
+ constructor(u, t = !0) {
509
+ h(this, "input"), h(this, "output"), h(this, "_abortSignal"), h(this, "rl"), h(this, "opts"), h(this, "_render"), h(this, "_track", !1), h(this, "_prevFrame", ""), h(this, "_subscribers", /* @__PURE__ */ new Map()), h(this, "_cursor", 0), h(this, "state", "initial"), h(this, "error", ""), h(this, "value");
510
+ const { input: F = stdin, output: s = stdout, render: i, signal: D, ...r } = u;
511
+ this.opts = r, 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 = D, this.input = F, this.output = s;
512
+ }
513
+ unsubscribe() {
514
+ this._subscribers.clear();
515
+ }
516
+ setSubscriber(u, t) {
517
+ const F = this._subscribers.get(u) ?? [];
518
+ F.push(t), this._subscribers.set(u, F);
519
+ }
520
+ on(u, t) {
521
+ this.setSubscriber(u, { cb: t });
522
+ }
523
+ once(u, t) {
524
+ this.setSubscriber(u, {
525
+ cb: t,
526
+ once: !0
527
+ });
528
+ }
529
+ emit(u, ...t) {
530
+ const F = this._subscribers.get(u) ?? [], s = [];
531
+ for (const i of F) i.cb(...t), i.once && s.push(() => F.splice(F.indexOf(i), 1));
532
+ for (const i of s) i();
533
+ }
534
+ prompt() {
535
+ return new Promise((u, t) => {
536
+ if (this._abortSignal) {
537
+ if (this._abortSignal.aborted) return this.state = "cancel", this.close(), u(S);
538
+ this._abortSignal.addEventListener("abort", () => {
539
+ this.state = "cancel", this.close();
540
+ }, { once: !0 });
541
+ }
542
+ const F = new Writable();
543
+ F._write = (s, i, D) => {
544
+ this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D();
545
+ }, this.input.pipe(F), this.rl = O.createInterface({
546
+ input: this.input,
547
+ output: F,
548
+ tabSize: 2,
549
+ prompt: "",
550
+ escapeCodeTimeout: 50,
551
+ terminal: !0
552
+ }), O.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), m(this.input, !0), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
553
+ this.output.write(import_src.cursor.show), this.output.off("resize", this.render), m(this.input, !1), u(this.value);
554
+ }), this.once("cancel", () => {
555
+ this.output.write(import_src.cursor.show), this.output.off("resize", this.render), m(this.input, !1), u(S);
556
+ });
557
+ });
558
+ }
559
+ onKeypress(u, t) {
560
+ if (this.state === "error" && (this.state = "active"), t?.name && (!this._track && B.aliases.has(t.name) && this.emit("cursor", B.aliases.get(t.name)), B.actions.has(t.name) && this.emit("cursor", t.name)), u && (u.toLowerCase() === "y" || u.toLowerCase() === "n") && this.emit("confirm", u.toLowerCase() === "y"), u === " " && this.opts.placeholder && (this.value || (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u && this.emit("key", u.toLowerCase()), t?.name === "return") {
561
+ if (!this.value && this.opts.placeholder && (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder)), this.opts.validate) {
562
+ const F = this.opts.validate(this.value);
563
+ F && (this.error = F instanceof Error ? F.message : F, this.state = "error", this.rl?.write(this.value));
564
+ }
565
+ this.state !== "error" && (this.state = "submit");
566
+ }
567
+ $([
568
+ u,
569
+ t?.name,
570
+ t?.sequence
571
+ ], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
572
+ }
573
+ close() {
574
+ this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
575
+ `), m(this.input, !1), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
576
+ }
577
+ restoreCursor() {
578
+ const u = Y$1(this._prevFrame, process.stdout.columns, { hard: !0 }).split(`
579
+ `).length - 1;
580
+ this.output.write(import_src.cursor.move(-999, u * -1));
581
+ }
582
+ render() {
583
+ const u = Y$1(this._render(this) ?? "", process.stdout.columns, { hard: !0 });
584
+ if (u !== this._prevFrame) {
585
+ if (this.state === "initial") this.output.write(import_src.cursor.hide);
586
+ else {
587
+ const t = BD(this._prevFrame, u);
588
+ if (this.restoreCursor(), t && t?.length === 1) {
589
+ const F = t[0];
590
+ this.output.write(import_src.cursor.move(0, F)), this.output.write(import_src.erase.lines(1));
591
+ const s = u.split(`
592
+ `);
593
+ this.output.write(s[F]), this._prevFrame = u, this.output.write(import_src.cursor.move(0, s.length - F - 1));
594
+ return;
595
+ }
596
+ if (t && t?.length > 1) {
597
+ const F = t[0];
598
+ this.output.write(import_src.cursor.move(0, F)), this.output.write(import_src.erase.down());
599
+ const s = u.split(`
600
+ `).slice(F);
601
+ this.output.write(s.join(`
602
+ `)), this._prevFrame = u;
603
+ return;
604
+ }
605
+ this.output.write(import_src.erase.down());
606
+ }
607
+ this.output.write(u), this.state === "initial" && (this.state = "active"), this._prevFrame = u;
608
+ }
609
+ }
610
+ };
611
+ var dD = class extends x$1 {
612
+ get cursor() {
613
+ return this.value ? 0 : 1;
614
+ }
615
+ get _value() {
616
+ return this.cursor === 0;
617
+ }
618
+ constructor(u) {
619
+ super(u, !1), this.value = !!u.initialValue, this.on("value", () => {
620
+ this.value = this._value;
621
+ }), this.on("confirm", (t) => {
622
+ this.output.write(import_src.cursor.move(0, -1)), this.value = t, this.state = "submit", this.close();
623
+ }), this.on("cursor", () => {
624
+ this.value = !this.value;
625
+ });
626
+ }
627
+ };
628
+ var mD = Object.defineProperty, bD = (e, u, t) => u in e ? mD(e, u, {
629
+ enumerable: !0,
630
+ configurable: !0,
631
+ writable: !0,
632
+ value: t
633
+ }) : e[u] = t, Z = (e, u, t) => (bD(e, typeof u != "symbol" ? u + "" : u, t), t), q$1 = (e, u, t) => {
634
+ if (!u.has(e)) throw TypeError("Cannot " + t);
635
+ }, T$1 = (e, u, t) => (q$1(e, u, "read from private field"), t ? t.call(e) : u.get(e)), wD = (e, u, t) => {
636
+ if (u.has(e)) throw TypeError("Cannot add the same private member more than once");
637
+ u instanceof WeakSet ? u.add(e) : u.set(e, t);
638
+ }, yD = (e, u, t, F) => (q$1(e, u, "write to private field"), F ? F.call(e, t) : u.set(e, t), t), A$1;
639
+ let _D = class extends x$1 {
640
+ constructor(u) {
641
+ super(u, !1), Z(this, "options"), Z(this, "cursor", 0), wD(this, A$1, void 0);
642
+ const { options: t } = u;
643
+ yD(this, A$1, u.selectableGroups !== !1), this.options = Object.entries(t).flatMap(([F, s]) => [{
644
+ value: F,
645
+ group: !0,
646
+ label: F
647
+ }, ...s.map((i) => ({
648
+ ...i,
649
+ group: F
650
+ }))]), this.value = [...u.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F }) => F === u.cursorAt), T$1(this, A$1) ? 0 : 1), this.on("cursor", (F) => {
651
+ switch (F) {
652
+ case "left":
653
+ case "up": {
654
+ this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
655
+ const s = this.options[this.cursor]?.group === !0;
656
+ !T$1(this, A$1) && s && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
657
+ break;
658
+ }
659
+ case "down":
660
+ case "right": {
661
+ this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
662
+ const s = this.options[this.cursor]?.group === !0;
663
+ !T$1(this, A$1) && s && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
664
+ break;
665
+ }
666
+ case "space":
667
+ this.toggleValue();
668
+ break;
669
+ }
670
+ });
671
+ }
672
+ getGroupItems(u) {
673
+ return this.options.filter((t) => t.group === u);
674
+ }
675
+ isGroupSelected(u) {
676
+ return this.getGroupItems(u).every((t) => this.value.includes(t.value));
677
+ }
678
+ toggleValue() {
679
+ const u = this.options[this.cursor];
680
+ if (u.group === !0) {
681
+ const t = u.value, F = this.getGroupItems(t);
682
+ this.isGroupSelected(t) ? this.value = this.value.filter((s) => F.findIndex((i) => i.value === s) === -1) : this.value = [...this.value, ...F.map((s) => s.value)], this.value = Array.from(new Set(this.value));
683
+ } else this.value = this.value.includes(u.value) ? this.value.filter((F) => F !== u.value) : [...this.value, u.value];
684
+ }
685
+ };
686
+ A$1 = /* @__PURE__ */ new WeakMap();
687
+ var kD = Object.defineProperty, $D = (e, u, t) => u in e ? kD(e, u, {
688
+ enumerable: !0,
689
+ configurable: !0,
690
+ writable: !0,
691
+ value: t
692
+ }) : e[u] = t, H = (e, u, t) => ($D(e, typeof u != "symbol" ? u + "" : u, t), t);
693
+ let SD = class extends x$1 {
694
+ constructor(u) {
695
+ super(u, !1), H(this, "options"), H(this, "cursor", 0), this.options = u.options, this.value = [...u.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: t }) => t === u.cursorAt), 0), this.on("key", (t) => {
696
+ t === "a" && this.toggleAll();
697
+ }), this.on("cursor", (t) => {
698
+ switch (t) {
699
+ case "left":
700
+ case "up":
701
+ this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
702
+ break;
703
+ case "down":
704
+ case "right":
705
+ this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
706
+ break;
707
+ case "space":
708
+ this.toggleValue();
709
+ break;
710
+ }
711
+ });
712
+ }
713
+ get _value() {
714
+ return this.options[this.cursor].value;
715
+ }
716
+ toggleAll() {
717
+ this.value = this.value.length === this.options.length ? [] : this.options.map((t) => t.value);
718
+ }
719
+ toggleValue() {
720
+ this.value = this.value.includes(this._value) ? this.value.filter((t) => t !== this._value) : [...this.value, this._value];
721
+ }
722
+ };
723
+ var TD = Object.defineProperty, jD = (e, u, t) => u in e ? TD(e, u, {
724
+ enumerable: !0,
725
+ configurable: !0,
726
+ writable: !0,
727
+ value: t
728
+ }) : e[u] = t, U$1 = (e, u, t) => (jD(e, typeof u != "symbol" ? u + "" : u, t), t);
729
+ var MD = class extends x$1 {
730
+ constructor({ mask: u, ...t }) {
731
+ super(t), U$1(this, "valueWithCursor", ""), U$1(this, "_mask", "•"), this._mask = u ?? "•", this.on("finalize", () => {
732
+ this.valueWithCursor = this.masked;
733
+ }), this.on("value", () => {
734
+ if (this.cursor >= this.value.length) this.valueWithCursor = `${this.masked}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`;
735
+ else {
736
+ const F = this.masked.slice(0, this.cursor), s = this.masked.slice(this.cursor);
737
+ this.valueWithCursor = `${F}${import_picocolors.default.inverse(s[0])}${s.slice(1)}`;
738
+ }
739
+ });
740
+ }
741
+ get cursor() {
742
+ return this._cursor;
743
+ }
744
+ get masked() {
745
+ return this.value.replaceAll(/./g, this._mask);
746
+ }
747
+ };
748
+ var OD = Object.defineProperty, PD = (e, u, t) => u in e ? OD(e, u, {
749
+ enumerable: !0,
750
+ configurable: !0,
751
+ writable: !0,
752
+ value: t
753
+ }) : e[u] = t, J$1 = (e, u, t) => (PD(e, typeof u != "symbol" ? u + "" : u, t), t);
754
+ var LD = class extends x$1 {
755
+ constructor(u) {
756
+ super(u, !1), J$1(this, "options"), J$1(this, "cursor", 0), this.options = u.options, this.cursor = this.options.findIndex(({ value: t }) => t === u.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (t) => {
757
+ switch (t) {
758
+ case "left":
759
+ case "up":
760
+ this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
761
+ break;
762
+ case "down":
763
+ case "right":
764
+ this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
765
+ break;
766
+ }
767
+ this.changeValue();
768
+ });
769
+ }
770
+ get _value() {
771
+ return this.options[this.cursor];
772
+ }
773
+ changeValue() {
774
+ this.value = this._value.value;
775
+ }
776
+ };
777
+ var WD = Object.defineProperty, ND = (e, u, t) => u in e ? WD(e, u, {
778
+ enumerable: !0,
779
+ configurable: !0,
780
+ writable: !0,
781
+ value: t
782
+ }) : e[u] = t, Q = (e, u, t) => (ND(e, typeof u != "symbol" ? u + "" : u, t), t);
783
+ var ID = class extends x$1 {
784
+ constructor(u) {
785
+ super(u, !1), Q(this, "options"), Q(this, "cursor", 0), this.options = u.options;
786
+ const t = this.options.map(({ value: [F] }) => F?.toLowerCase());
787
+ this.cursor = Math.max(t.indexOf(u.initialValue), 0), this.on("key", (F) => {
788
+ if (!t.includes(F)) return;
789
+ const s = this.options.find(({ value: [i] }) => i?.toLowerCase() === F);
790
+ s && (this.value = s.value, this.state = "submit", this.emit("submit"));
791
+ });
792
+ }
793
+ };
794
+ var RD = class extends x$1 {
795
+ get valueWithCursor() {
796
+ if (this.state === "submit") return this.value;
797
+ if (this.cursor >= this.value.length) return `${this.value}\u2588`;
798
+ const u = this.value.slice(0, this.cursor), [t, ...F] = this.value.slice(this.cursor);
799
+ return `${u}${import_picocolors.default.inverse(t)}${F.join("")}`;
800
+ }
801
+ get cursor() {
802
+ return this._cursor;
803
+ }
804
+ constructor(u) {
805
+ super(u), this.on("finalize", () => {
806
+ this.value || (this.value = u.defaultValue);
807
+ });
808
+ }
809
+ };
810
+
811
+ //#endregion
812
+ //#region node_modules/@clack/prompts/dist/index.mjs
813
+ function ce() {
814
+ return y.platform !== "win32" ? y.env.TERM !== "linux" : !!y.env.CI || !!y.env.WT_SESSION || !!y.env.TERMINUS_SUBLIME || y.env.ConEmuTask === "{cmd::Cmder}" || y.env.TERM_PROGRAM === "Terminus-Sublime" || y.env.TERM_PROGRAM === "vscode" || y.env.TERM === "xterm-256color" || y.env.TERM === "alacritty" || y.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
815
+ }
816
+ const V = ce(), u = (t, n) => V ? t : n, le = u("◆", "*"), L = u("■", "x"), W = u("▲", "x"), C = u("◇", "o"), ue = u("┌", "T"), o = u("│", "|"), d = u("└", "—"), k = u("●", ">"), P = u("○", " "), A = u("◻", "[•]"), T = u("◼", "[+]"), F = u("◻", "[ ]"), $e = u("▪", "•"), _ = u("─", "-"), me = u("╮", "+"), de = u("├", "+"), pe = u("╯", "+"), q = u("●", "•"), D = u("◆", "*"), U = u("▲", "!"), K = u("■", "x"), b = (t) => {
817
+ switch (t) {
818
+ case "initial":
819
+ case "active": return import_picocolors.default.cyan(le);
820
+ case "cancel": return import_picocolors.default.red(L);
821
+ case "error": return import_picocolors.default.yellow(W);
822
+ case "submit": return import_picocolors.default.green(C);
823
+ }
824
+ }, G = (t) => {
825
+ const { cursor: n, options: r, style: i } = t, s = t.maxItems ?? Number.POSITIVE_INFINITY, c = Math.max(process.stdout.rows - 4, 0), a = Math.min(c, Math.max(s, 5));
826
+ let l = 0;
827
+ n >= l + a - 3 ? l = Math.max(Math.min(n - a + 3, r.length - a), 0) : n < l + 2 && (l = Math.max(n - 2, 0));
828
+ const $ = a < r.length && l > 0, g = a < r.length && l + a < r.length;
829
+ return r.slice(l, l + a).map((p, v, f) => {
830
+ const j = v === 0 && $, E = v === f.length - 1 && g;
831
+ return j || E ? import_picocolors.default.dim("...") : i(p, v + l === n);
832
+ });
833
+ }, he = (t) => new RD({
834
+ validate: t.validate,
835
+ placeholder: t.placeholder,
836
+ defaultValue: t.defaultValue,
837
+ initialValue: t.initialValue,
838
+ render() {
839
+ const n = `${import_picocolors.default.gray(o)}
840
+ ${b(this.state)} ${t.message}
841
+ `, r = t.placeholder ? import_picocolors.default.inverse(t.placeholder[0]) + import_picocolors.default.dim(t.placeholder.slice(1)) : import_picocolors.default.inverse(import_picocolors.default.hidden("_")), i = this.value ? this.valueWithCursor : r;
842
+ switch (this.state) {
843
+ case "error": return `${n.trim()}
844
+ ${import_picocolors.default.yellow(o)} ${i}
845
+ ${import_picocolors.default.yellow(d)} ${import_picocolors.default.yellow(this.error)}
846
+ `;
847
+ case "submit": return `${n}${import_picocolors.default.gray(o)} ${import_picocolors.default.dim(this.value || t.placeholder)}`;
848
+ case "cancel": return `${n}${import_picocolors.default.gray(o)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(this.value ?? ""))}${this.value?.trim() ? `
849
+ ${import_picocolors.default.gray(o)}` : ""}`;
850
+ default: return `${n}${import_picocolors.default.cyan(o)} ${i}
851
+ ${import_picocolors.default.cyan(d)}
852
+ `;
853
+ }
854
+ }
855
+ }).prompt(), ge = (t) => new MD({
856
+ validate: t.validate,
857
+ mask: t.mask ?? $e,
858
+ render() {
859
+ const n = `${import_picocolors.default.gray(o)}
860
+ ${b(this.state)} ${t.message}
861
+ `, r = this.valueWithCursor, i = this.masked;
862
+ switch (this.state) {
863
+ case "error": return `${n.trim()}
864
+ ${import_picocolors.default.yellow(o)} ${i}
865
+ ${import_picocolors.default.yellow(d)} ${import_picocolors.default.yellow(this.error)}
866
+ `;
867
+ case "submit": return `${n}${import_picocolors.default.gray(o)} ${import_picocolors.default.dim(i)}`;
868
+ case "cancel": return `${n}${import_picocolors.default.gray(o)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(i ?? ""))}${i ? `
869
+ ${import_picocolors.default.gray(o)}` : ""}`;
870
+ default: return `${n}${import_picocolors.default.cyan(o)} ${r}
871
+ ${import_picocolors.default.cyan(d)}
872
+ `;
873
+ }
874
+ }
875
+ }).prompt(), ye = (t) => {
876
+ const n = t.active ?? "Yes", r = t.inactive ?? "No";
877
+ return new dD({
878
+ active: n,
879
+ inactive: r,
880
+ initialValue: t.initialValue ?? !0,
881
+ render() {
882
+ const i = `${import_picocolors.default.gray(o)}
883
+ ${b(this.state)} ${t.message}
884
+ `, s = this.value ? n : r;
885
+ switch (this.state) {
886
+ case "submit": return `${i}${import_picocolors.default.gray(o)} ${import_picocolors.default.dim(s)}`;
887
+ case "cancel": return `${i}${import_picocolors.default.gray(o)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(s))}
888
+ ${import_picocolors.default.gray(o)}`;
889
+ default: return `${i}${import_picocolors.default.cyan(o)} ${this.value ? `${import_picocolors.default.green(k)} ${n}` : `${import_picocolors.default.dim(P)} ${import_picocolors.default.dim(n)}`} ${import_picocolors.default.dim("/")} ${this.value ? `${import_picocolors.default.dim(P)} ${import_picocolors.default.dim(r)}` : `${import_picocolors.default.green(k)} ${r}`}
890
+ ${import_picocolors.default.cyan(d)}
891
+ `;
892
+ }
893
+ }
894
+ }).prompt();
895
+ }, ve = (t) => {
896
+ const n = (r, i) => {
897
+ const s = r.label ?? String(r.value);
898
+ switch (i) {
899
+ case "selected": return `${import_picocolors.default.dim(s)}`;
900
+ case "active": return `${import_picocolors.default.green(k)} ${s} ${r.hint ? import_picocolors.default.dim(`(${r.hint})`) : ""}`;
901
+ case "cancelled": return `${import_picocolors.default.strikethrough(import_picocolors.default.dim(s))}`;
902
+ default: return `${import_picocolors.default.dim(P)} ${import_picocolors.default.dim(s)}`;
903
+ }
904
+ };
905
+ return new LD({
906
+ options: t.options,
907
+ initialValue: t.initialValue,
908
+ render() {
909
+ const r = `${import_picocolors.default.gray(o)}
910
+ ${b(this.state)} ${t.message}
911
+ `;
912
+ switch (this.state) {
913
+ case "submit": return `${r}${import_picocolors.default.gray(o)} ${n(this.options[this.cursor], "selected")}`;
914
+ case "cancel": return `${r}${import_picocolors.default.gray(o)} ${n(this.options[this.cursor], "cancelled")}
915
+ ${import_picocolors.default.gray(o)}`;
916
+ default: return `${r}${import_picocolors.default.cyan(o)} ${G({
917
+ cursor: this.cursor,
918
+ options: this.options,
919
+ maxItems: t.maxItems,
920
+ style: (i, s) => n(i, s ? "active" : "inactive")
921
+ }).join(`
922
+ ${import_picocolors.default.cyan(o)} `)}
923
+ ${import_picocolors.default.cyan(d)}
924
+ `;
925
+ }
926
+ }
927
+ }).prompt();
928
+ }, we = (t) => {
929
+ const n = (r, i = "inactive") => {
930
+ const s = r.label ?? String(r.value);
931
+ return i === "selected" ? `${import_picocolors.default.dim(s)}` : i === "cancelled" ? `${import_picocolors.default.strikethrough(import_picocolors.default.dim(s))}` : i === "active" ? `${import_picocolors.default.bgCyan(import_picocolors.default.gray(` ${r.value} `))} ${s} ${r.hint ? import_picocolors.default.dim(`(${r.hint})`) : ""}` : `${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(` ${r.value} `)))} ${s} ${r.hint ? import_picocolors.default.dim(`(${r.hint})`) : ""}`;
932
+ };
933
+ return new ID({
934
+ options: t.options,
935
+ initialValue: t.initialValue,
936
+ render() {
937
+ const r = `${import_picocolors.default.gray(o)}
938
+ ${b(this.state)} ${t.message}
939
+ `;
940
+ switch (this.state) {
941
+ case "submit": return `${r}${import_picocolors.default.gray(o)} ${n(this.options.find((i) => i.value === this.value) ?? t.options[0], "selected")}`;
942
+ case "cancel": return `${r}${import_picocolors.default.gray(o)} ${n(this.options[0], "cancelled")}
943
+ ${import_picocolors.default.gray(o)}`;
944
+ default: return `${r}${import_picocolors.default.cyan(o)} ${this.options.map((i, s) => n(i, s === this.cursor ? "active" : "inactive")).join(`
945
+ ${import_picocolors.default.cyan(o)} `)}
946
+ ${import_picocolors.default.cyan(d)}
947
+ `;
948
+ }
949
+ }
950
+ }).prompt();
951
+ }, fe = (t) => {
952
+ const n = (r, i) => {
953
+ const s = r.label ?? String(r.value);
954
+ return i === "active" ? `${import_picocolors.default.cyan(A)} ${s} ${r.hint ? import_picocolors.default.dim(`(${r.hint})`) : ""}` : i === "selected" ? `${import_picocolors.default.green(T)} ${import_picocolors.default.dim(s)} ${r.hint ? import_picocolors.default.dim(`(${r.hint})`) : ""}` : i === "cancelled" ? `${import_picocolors.default.strikethrough(import_picocolors.default.dim(s))}` : i === "active-selected" ? `${import_picocolors.default.green(T)} ${s} ${r.hint ? import_picocolors.default.dim(`(${r.hint})`) : ""}` : i === "submitted" ? `${import_picocolors.default.dim(s)}` : `${import_picocolors.default.dim(F)} ${import_picocolors.default.dim(s)}`;
955
+ };
956
+ return new SD({
957
+ options: t.options,
958
+ initialValues: t.initialValues,
959
+ required: t.required ?? !0,
960
+ cursorAt: t.cursorAt,
961
+ validate(r) {
962
+ if (this.required && r.length === 0) return `Please select at least one option.
963
+ ${import_picocolors.default.reset(import_picocolors.default.dim(`Press ${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(" space ")))} to select, ${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(" enter ")))} to submit`))}`;
964
+ },
965
+ render() {
966
+ const r = `${import_picocolors.default.gray(o)}
967
+ ${b(this.state)} ${t.message}
968
+ `, i = (s, c) => {
969
+ const a = this.value.includes(s.value);
970
+ return c && a ? n(s, "active-selected") : a ? n(s, "selected") : n(s, c ? "active" : "inactive");
971
+ };
972
+ switch (this.state) {
973
+ case "submit": return `${r}${import_picocolors.default.gray(o)} ${this.options.filter(({ value: s }) => this.value.includes(s)).map((s) => n(s, "submitted")).join(import_picocolors.default.dim(", ")) || import_picocolors.default.dim("none")}`;
974
+ case "cancel": {
975
+ const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => n(c, "cancelled")).join(import_picocolors.default.dim(", "));
976
+ return `${r}${import_picocolors.default.gray(o)} ${s.trim() ? `${s}
977
+ ${import_picocolors.default.gray(o)}` : ""}`;
978
+ }
979
+ case "error": {
980
+ const s = this.error.split(`
981
+ `).map((c, a) => a === 0 ? `${import_picocolors.default.yellow(d)} ${import_picocolors.default.yellow(c)}` : ` ${c}`).join(`
982
+ `);
983
+ return `${r + import_picocolors.default.yellow(o)} ${G({
984
+ options: this.options,
985
+ cursor: this.cursor,
986
+ maxItems: t.maxItems,
987
+ style: i
988
+ }).join(`
989
+ ${import_picocolors.default.yellow(o)} `)}
990
+ ${s}
991
+ `;
992
+ }
993
+ default: return `${r}${import_picocolors.default.cyan(o)} ${G({
994
+ options: this.options,
995
+ cursor: this.cursor,
996
+ maxItems: t.maxItems,
997
+ style: i
998
+ }).join(`
999
+ ${import_picocolors.default.cyan(o)} `)}
1000
+ ${import_picocolors.default.cyan(d)}
1001
+ `;
1002
+ }
1003
+ }
1004
+ }).prompt();
1005
+ }, be = (t) => {
1006
+ const { selectableGroups: n = !0 } = t, r = (i, s, c = []) => {
1007
+ const a = i.label ?? String(i.value), l = typeof i.group == "string", $ = l && (c[c.indexOf(i) + 1] ?? { group: !0 }), g = l && $.group === !0, p = l ? n ? `${g ? d : o} ` : " " : "";
1008
+ if (s === "active") return `${import_picocolors.default.dim(p)}${import_picocolors.default.cyan(A)} ${a} ${i.hint ? import_picocolors.default.dim(`(${i.hint})`) : ""}`;
1009
+ if (s === "group-active") return `${p}${import_picocolors.default.cyan(A)} ${import_picocolors.default.dim(a)}`;
1010
+ if (s === "group-active-selected") return `${p}${import_picocolors.default.green(T)} ${import_picocolors.default.dim(a)}`;
1011
+ if (s === "selected") {
1012
+ const f = l || n ? import_picocolors.default.green(T) : "";
1013
+ return `${import_picocolors.default.dim(p)}${f} ${import_picocolors.default.dim(a)} ${i.hint ? import_picocolors.default.dim(`(${i.hint})`) : ""}`;
1014
+ }
1015
+ if (s === "cancelled") return `${import_picocolors.default.strikethrough(import_picocolors.default.dim(a))}`;
1016
+ if (s === "active-selected") return `${import_picocolors.default.dim(p)}${import_picocolors.default.green(T)} ${a} ${i.hint ? import_picocolors.default.dim(`(${i.hint})`) : ""}`;
1017
+ if (s === "submitted") return `${import_picocolors.default.dim(a)}`;
1018
+ const v = l || n ? import_picocolors.default.dim(F) : "";
1019
+ return `${import_picocolors.default.dim(p)}${v} ${import_picocolors.default.dim(a)}`;
1020
+ };
1021
+ return new _D({
1022
+ options: t.options,
1023
+ initialValues: t.initialValues,
1024
+ required: t.required ?? !0,
1025
+ cursorAt: t.cursorAt,
1026
+ selectableGroups: n,
1027
+ validate(i) {
1028
+ if (this.required && i.length === 0) return `Please select at least one option.
1029
+ ${import_picocolors.default.reset(import_picocolors.default.dim(`Press ${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(" space ")))} to select, ${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(" enter ")))} to submit`))}`;
1030
+ },
1031
+ render() {
1032
+ const i = `${import_picocolors.default.gray(o)}
1033
+ ${b(this.state)} ${t.message}
1034
+ `;
1035
+ switch (this.state) {
1036
+ case "submit": return `${i}${import_picocolors.default.gray(o)} ${this.options.filter(({ value: s }) => this.value.includes(s)).map((s) => r(s, "submitted")).join(import_picocolors.default.dim(", "))}`;
1037
+ case "cancel": {
1038
+ const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => r(c, "cancelled")).join(import_picocolors.default.dim(", "));
1039
+ return `${i}${import_picocolors.default.gray(o)} ${s.trim() ? `${s}
1040
+ ${import_picocolors.default.gray(o)}` : ""}`;
1041
+ }
1042
+ case "error": {
1043
+ const s = this.error.split(`
1044
+ `).map((c, a) => a === 0 ? `${import_picocolors.default.yellow(d)} ${import_picocolors.default.yellow(c)}` : ` ${c}`).join(`
1045
+ `);
1046
+ return `${i}${import_picocolors.default.yellow(o)} ${this.options.map((c, a, l) => {
1047
+ const $ = this.value.includes(c.value) || c.group === !0 && this.isGroupSelected(`${c.value}`), g = a === this.cursor;
1048
+ return !g && typeof c.group == "string" && this.options[this.cursor].value === c.group ? r(c, $ ? "group-active-selected" : "group-active", l) : g && $ ? r(c, "active-selected", l) : $ ? r(c, "selected", l) : r(c, g ? "active" : "inactive", l);
1049
+ }).join(`
1050
+ ${import_picocolors.default.yellow(o)} `)}
1051
+ ${s}
1052
+ `;
1053
+ }
1054
+ default: return `${i}${import_picocolors.default.cyan(o)} ${this.options.map((s, c, a) => {
1055
+ const l = this.value.includes(s.value) || s.group === !0 && this.isGroupSelected(`${s.value}`), $ = c === this.cursor;
1056
+ return !$ && typeof s.group == "string" && this.options[this.cursor].value === s.group ? r(s, l ? "group-active-selected" : "group-active", a) : $ && l ? r(s, "active-selected", a) : l ? r(s, "selected", a) : r(s, $ ? "active" : "inactive", a);
1057
+ }).join(`
1058
+ ${import_picocolors.default.cyan(o)} `)}
1059
+ ${import_picocolors.default.cyan(d)}
1060
+ `;
1061
+ }
1062
+ }
1063
+ }).prompt();
1064
+ }, Me = (t = "", n = "") => {
1065
+ const r = `
1066
+ ${t}
1067
+ `.split(`
1068
+ `), i = stripVTControlCharacters(n).length, s = Math.max(r.reduce((a, l) => {
1069
+ const $ = stripVTControlCharacters(l);
1070
+ return $.length > a ? $.length : a;
1071
+ }, 0), i) + 2, c = r.map((a) => `${import_picocolors.default.gray(o)} ${import_picocolors.default.dim(a)}${" ".repeat(s - stripVTControlCharacters(a).length)}${import_picocolors.default.gray(o)}`).join(`
1072
+ `);
1073
+ process.stdout.write(`${import_picocolors.default.gray(o)}
1074
+ ${import_picocolors.default.green(C)} ${import_picocolors.default.reset(n)} ${import_picocolors.default.gray(_.repeat(Math.max(s - i - 1, 1)) + me)}
1075
+ ${c}
1076
+ ${import_picocolors.default.gray(de + _.repeat(s + 2) + pe)}
1077
+ `);
1078
+ }, xe = (t = "") => {
1079
+ process.stdout.write(`${import_picocolors.default.gray(d)} ${import_picocolors.default.red(t)}
1080
+
1081
+ `);
1082
+ }, Ie = (t = "") => {
1083
+ process.stdout.write(`${import_picocolors.default.gray(ue)} ${t}
1084
+ `);
1085
+ }, Se = (t = "") => {
1086
+ process.stdout.write(`${import_picocolors.default.gray(o)}
1087
+ ${import_picocolors.default.gray(d)} ${t}
1088
+
1089
+ `);
1090
+ }, M = {
1091
+ message: (t = "", { symbol: n = import_picocolors.default.gray(o) } = {}) => {
1092
+ const r = [`${import_picocolors.default.gray(o)}`];
1093
+ if (t) {
1094
+ const [i, ...s] = t.split(`
1095
+ `);
1096
+ r.push(`${n} ${i}`, ...s.map((c) => `${import_picocolors.default.gray(o)} ${c}`));
1097
+ }
1098
+ process.stdout.write(`${r.join(`
1099
+ `)}
1100
+ `);
1101
+ },
1102
+ info: (t) => {
1103
+ M.message(t, { symbol: import_picocolors.default.blue(q) });
1104
+ },
1105
+ success: (t) => {
1106
+ M.message(t, { symbol: import_picocolors.default.green(D) });
1107
+ },
1108
+ step: (t) => {
1109
+ M.message(t, { symbol: import_picocolors.default.green(C) });
1110
+ },
1111
+ warn: (t) => {
1112
+ M.message(t, { symbol: import_picocolors.default.yellow(U) });
1113
+ },
1114
+ warning: (t) => {
1115
+ M.warn(t);
1116
+ },
1117
+ error: (t) => {
1118
+ M.message(t, { symbol: import_picocolors.default.red(K) });
1119
+ }
1120
+ }, J = `${import_picocolors.default.gray(o)} `, x = {
1121
+ message: async (t, { symbol: n = import_picocolors.default.gray(o) } = {}) => {
1122
+ process.stdout.write(`${import_picocolors.default.gray(o)}
1123
+ ${n} `);
1124
+ let r = 3;
1125
+ for await (let i of t) {
1126
+ i = i.replace(/\n/g, `
1127
+ ${J}`), i.includes(`
1128
+ `) && (r = 3 + stripVTControlCharacters(i.slice(i.lastIndexOf(`
1129
+ `))).length);
1130
+ const s = stripVTControlCharacters(i).length;
1131
+ r + s < process.stdout.columns ? (r += s, process.stdout.write(i)) : (process.stdout.write(`
1132
+ ${J}${i.trimStart()}`), r = 3 + stripVTControlCharacters(i.trimStart()).length);
1133
+ }
1134
+ process.stdout.write(`
1135
+ `);
1136
+ },
1137
+ info: (t) => x.message(t, { symbol: import_picocolors.default.blue(q) }),
1138
+ success: (t) => x.message(t, { symbol: import_picocolors.default.green(D) }),
1139
+ step: (t) => x.message(t, { symbol: import_picocolors.default.green(C) }),
1140
+ warn: (t) => x.message(t, { symbol: import_picocolors.default.yellow(U) }),
1141
+ warning: (t) => x.warn(t),
1142
+ error: (t) => x.message(t, { symbol: import_picocolors.default.red(K) })
1143
+ }, Y = ({ indicator: t = "dots" } = {}) => {
1144
+ const n = V ? [
1145
+ "◒",
1146
+ "◐",
1147
+ "◓",
1148
+ "◑"
1149
+ ] : [
1150
+ "•",
1151
+ "o",
1152
+ "O",
1153
+ "0"
1154
+ ], r = V ? 80 : 120, i = process.env.CI === "true";
1155
+ let s, c, a = !1, l = "", $, g = performance.now();
1156
+ const p = (m) => {
1157
+ a && N(m > 1 ? "Something went wrong" : "Canceled", m);
1158
+ }, v = () => p(2), f = () => p(1), j = () => {
1159
+ process.on("uncaughtExceptionMonitor", v), process.on("unhandledRejection", v), process.on("SIGINT", f), process.on("SIGTERM", f), process.on("exit", p);
1160
+ }, E = () => {
1161
+ process.removeListener("uncaughtExceptionMonitor", v), process.removeListener("unhandledRejection", v), process.removeListener("SIGINT", f), process.removeListener("SIGTERM", f), process.removeListener("exit", p);
1162
+ }, B = () => {
1163
+ if ($ === void 0) return;
1164
+ i && process.stdout.write(`
1165
+ `);
1166
+ const m = $.split(`
1167
+ `);
1168
+ process.stdout.write(import_src.cursor.move(-999, m.length - 1)), process.stdout.write(import_src.erase.down(m.length));
1169
+ }, R = (m) => m.replace(/\.+$/, ""), O = (m) => {
1170
+ const h = (performance.now() - m) / 1e3, w = Math.floor(h / 60), I = Math.floor(h % 60);
1171
+ return w > 0 ? `[${w}m ${I}s]` : `[${I}s]`;
1172
+ }, H = (m = "") => {
1173
+ a = !0, s = fD(), l = R(m), g = performance.now(), process.stdout.write(`${import_picocolors.default.gray(o)}
1174
+ `);
1175
+ let h = 0, w = 0;
1176
+ j(), c = setInterval(() => {
1177
+ if (i && l === $) return;
1178
+ B(), $ = l;
1179
+ const I = import_picocolors.default.magenta(n[h]);
1180
+ if (i) process.stdout.write(`${I} ${l}...`);
1181
+ else if (t === "timer") process.stdout.write(`${I} ${l} ${O(g)}`);
1182
+ else {
1183
+ const z = ".".repeat(Math.floor(w)).slice(0, 3);
1184
+ process.stdout.write(`${I} ${l}${z}`);
1185
+ }
1186
+ h = h + 1 < n.length ? h + 1 : 0, w = w < n.length ? w + .125 : 0;
1187
+ }, r);
1188
+ }, N = (m = "", h = 0) => {
1189
+ a = !1, clearInterval(c), B();
1190
+ const w = h === 0 ? import_picocolors.default.green(C) : h === 1 ? import_picocolors.default.red(L) : import_picocolors.default.red(W);
1191
+ l = R(m ?? l), t === "timer" ? process.stdout.write(`${w} ${l} ${O(g)}
1192
+ `) : process.stdout.write(`${w} ${l}
1193
+ `), E(), s();
1194
+ };
1195
+ return {
1196
+ start: H,
1197
+ stop: N,
1198
+ message: (m = "") => {
1199
+ l = R(m ?? l);
1200
+ }
1201
+ };
1202
+ }, Ce = async (t, n) => {
1203
+ const r = {}, i = Object.keys(t);
1204
+ for (const s of i) {
1205
+ const c = t[s], a = await c({ results: r })?.catch((l) => {
1206
+ throw l;
1207
+ });
1208
+ if (typeof n?.onCancel == "function" && pD(a)) {
1209
+ r[s] = "canceled", n.onCancel({ results: r });
1210
+ continue;
1211
+ }
1212
+ r[s] = a;
1213
+ }
1214
+ return r;
1215
+ }, Te = async (t) => {
1216
+ for (const n of t) {
1217
+ if (n.enabled === !1) continue;
1218
+ const r = Y();
1219
+ r.start(n.title);
1220
+ const i = await n.task(r.message);
1221
+ r.stop(i || n.title);
1222
+ }
1223
+ };
1224
+
1225
+ //#endregion
1226
+ //#region src/apply.ts
1227
+ async function runRulerApply(projectDir, agents) {
1228
+ const s = Y();
1229
+ s.start("Running ruler to generate agent configurations...");
1230
+ const agentFlag = agents.join(",");
1231
+ try {
1232
+ execSync(`npx --yes @intellectronica/ruler apply --agents ${agentFlag}`, {
1233
+ cwd: projectDir,
1234
+ stdio: "pipe",
1235
+ timeout: 12e4
1236
+ });
1237
+ s.stop("Generated agent configurations");
1238
+ } catch {
1239
+ s.stop("ruler apply encountered issues");
1240
+ M.warn(`ruler apply had warnings or errors. You can run it manually:
1241
+ npx @intellectronica/ruler apply --agents ${agentFlag}`);
1242
+ }
1243
+ }
1244
+
1245
+ //#endregion
1246
+ //#region src/configure.ts
1247
+ function configureRulerToml(projectDir, agents) {
1248
+ const tomlPath = path.join(projectDir, ".ruler", "ruler.toml");
1249
+ if (!fs.existsSync(tomlPath)) {
1250
+ M.warn("ruler.toml not found, skipping configuration");
1251
+ return;
1252
+ }
1253
+ let content = fs.readFileSync(tomlPath, "utf-8");
1254
+ const newLine = `default_agents = [${agents.map((a) => `"${a}"`).join(", ")}]`;
1255
+ if (/^#?\s*default_agents\s*=/m.test(content)) content = content.replace(/^#?\s*default_agents\s*=.*$/m, newLine);
1256
+ else {
1257
+ const insertPoint = content.indexOf("\n\n");
1258
+ if (insertPoint !== -1) content = content.slice(0, insertPoint) + "\n" + newLine + content.slice(insertPoint);
1259
+ else content += `\n${newLine}\n`;
1260
+ }
1261
+ fs.writeFileSync(tomlPath, content, "utf-8");
1262
+ M.info(`Configured ruler.toml with agents: ${agents.join(", ")}`);
1263
+ }
1264
+
1265
+ //#endregion
1266
+ //#region src/constants.ts
1267
+ const REPO_URL = "https://github.com/buiducnhat/agent-skills.git";
1268
+ const REPO_BRANCH = "main";
1269
+ const RULER_AGENTS = [
1270
+ {
1271
+ value: "claude",
1272
+ label: "Claude Code",
1273
+ hint: "Anthropic"
1274
+ },
1275
+ {
1276
+ value: "copilot",
1277
+ label: "GitHub Copilot",
1278
+ hint: "GitHub"
1279
+ },
1280
+ {
1281
+ value: "cursor",
1282
+ label: "Cursor",
1283
+ hint: "Cursor"
1284
+ },
1285
+ {
1286
+ value: "windsurf",
1287
+ label: "Windsurf",
1288
+ hint: "Codeium"
1289
+ },
1290
+ {
1291
+ value: "codex",
1292
+ label: "OpenAI Codex CLI",
1293
+ hint: "OpenAI"
1294
+ },
1295
+ {
1296
+ value: "gemini-cli",
1297
+ label: "Gemini CLI",
1298
+ hint: "Google"
1299
+ },
1300
+ {
1301
+ value: "amp",
1302
+ label: "Amp",
1303
+ hint: "Sourcegraph"
1304
+ },
1305
+ {
1306
+ value: "cline",
1307
+ label: "Cline",
1308
+ hint: "VS Code"
1309
+ },
1310
+ {
1311
+ value: "roo",
1312
+ label: "Roo Code",
1313
+ hint: "VS Code"
1314
+ },
1315
+ {
1316
+ value: "aider",
1317
+ label: "Aider",
1318
+ hint: "Terminal"
1319
+ },
1320
+ {
1321
+ value: "antigravity",
1322
+ label: "Antigravity",
1323
+ hint: ""
1324
+ },
1325
+ {
1326
+ value: "pi",
1327
+ label: "Pi Coding Agent",
1328
+ hint: ""
1329
+ },
1330
+ {
1331
+ value: "jules",
1332
+ label: "Jules",
1333
+ hint: "Google"
1334
+ },
1335
+ {
1336
+ value: "kiro",
1337
+ label: "Kiro",
1338
+ hint: "AWS"
1339
+ },
1340
+ {
1341
+ value: "kilocode",
1342
+ label: "Kilo Code",
1343
+ hint: "VS Code"
1344
+ },
1345
+ {
1346
+ value: "crush",
1347
+ label: "Crush",
1348
+ hint: ""
1349
+ },
1350
+ {
1351
+ value: "amazonqcli",
1352
+ label: "Amazon Q CLI",
1353
+ hint: "AWS"
1354
+ },
1355
+ {
1356
+ value: "firebase",
1357
+ label: "Firebase Studio",
1358
+ hint: "Google"
1359
+ },
1360
+ {
1361
+ value: "openhands",
1362
+ label: "Open Hands",
1363
+ hint: ""
1364
+ },
1365
+ {
1366
+ value: "junie",
1367
+ label: "Junie",
1368
+ hint: "JetBrains"
1369
+ },
1370
+ {
1371
+ value: "jetbrains-ai",
1372
+ label: "JetBrains AI Assistant",
1373
+ hint: "JetBrains"
1374
+ },
1375
+ {
1376
+ value: "augmentcode",
1377
+ label: "AugmentCode",
1378
+ hint: ""
1379
+ },
1380
+ {
1381
+ value: "opencode",
1382
+ label: "OpenCode",
1383
+ hint: ""
1384
+ },
1385
+ {
1386
+ value: "goose",
1387
+ label: "Goose",
1388
+ hint: "Block"
1389
+ },
1390
+ {
1391
+ value: "qwen",
1392
+ label: "Qwen Code",
1393
+ hint: "Alibaba"
1394
+ },
1395
+ {
1396
+ value: "zed",
1397
+ label: "Zed",
1398
+ hint: ""
1399
+ },
1400
+ {
1401
+ value: "trae",
1402
+ label: "Trae AI",
1403
+ hint: "ByteDance"
1404
+ },
1405
+ {
1406
+ value: "warp",
1407
+ label: "Warp",
1408
+ hint: ""
1409
+ },
1410
+ {
1411
+ value: "firebender",
1412
+ label: "Firebender",
1413
+ hint: ""
1414
+ },
1415
+ {
1416
+ value: "factory",
1417
+ label: "Factory Droid",
1418
+ hint: ""
1419
+ },
1420
+ {
1421
+ value: "mistral",
1422
+ label: "Mistral Vibe",
1423
+ hint: "Mistral"
1424
+ }
1425
+ ];
1426
+ const POPULAR_AGENTS = [
1427
+ "claude",
1428
+ "copilot",
1429
+ "cursor",
1430
+ "windsurf",
1431
+ "codex",
1432
+ "gemini-cli"
1433
+ ];
1434
+
1435
+ //#endregion
1436
+ //#region src/fetch.ts
1437
+ async function fetchTemplates() {
1438
+ const s = Y();
1439
+ s.start("Downloading agent skills from GitHub...");
1440
+ const tempDir = mkdtempSync(path.join(tmpdir(), "agent-skills-"));
1441
+ try {
1442
+ execSync(`git clone --depth 1 --branch ${REPO_BRANCH} "${REPO_URL}" "${tempDir}"`, { stdio: "pipe" });
1443
+ if (!existsSync(path.join(tempDir, "templates"))) throw new Error("templates/ directory not found in the repository");
1444
+ s.stop("Downloaded agent skills");
1445
+ return tempDir;
1446
+ } catch (err) {
1447
+ s.stop("Download failed");
1448
+ const message = err instanceof Error ? err.message : String(err);
1449
+ throw new Error(message.startsWith("templates/") ? message : "Failed to clone repository. Ensure git is installed and you have internet access.");
1450
+ }
1451
+ }
1452
+ function cleanupTemp(tempDir) {
1453
+ try {
1454
+ execSync(`rm -rf "${tempDir}"`, { stdio: "pipe" });
1455
+ } catch {}
1456
+ }
1457
+
1458
+ //#endregion
1459
+ //#region src/prompts.ts
1460
+ function handleCancel(value) {
1461
+ if (pD(value)) {
1462
+ xe("Operation cancelled.");
1463
+ process.exit(0);
1464
+ }
1465
+ }
1466
+ async function promptExistingAction() {
1467
+ const action = await ve({
1468
+ message: "Existing .ruler/ directory found. What would you like to do?",
1469
+ options: [{
1470
+ value: "update",
1471
+ label: "Update existing configuration"
1472
+ }, {
1473
+ value: "fresh",
1474
+ label: "Fresh install (backs up and overwrites current)"
1475
+ }]
1476
+ });
1477
+ handleCancel(action);
1478
+ return action;
1479
+ }
1480
+ async function promptAgentSelection() {
1481
+ const selected = await fe({
1482
+ message: "Which AI agents do you use? (space to toggle, enter to confirm)",
1483
+ options: [...RULER_AGENTS].sort((a, b) => {
1484
+ const aPopular = POPULAR_AGENTS.includes(a.value);
1485
+ const bPopular = POPULAR_AGENTS.includes(b.value);
1486
+ if (aPopular && !bPopular) return -1;
1487
+ if (!aPopular && bPopular) return 1;
1488
+ return a.label.localeCompare(b.label);
1489
+ }).map((a) => ({
1490
+ value: a.value,
1491
+ label: a.label,
1492
+ hint: a.hint || void 0
1493
+ })),
1494
+ initialValues: ["claude"],
1495
+ required: true
1496
+ });
1497
+ handleCancel(selected);
1498
+ return selected;
1499
+ }
1500
+
1501
+ //#endregion
1502
+ //#region src/utils.ts
1503
+ function parseArgs(argv) {
1504
+ const args = {
1505
+ nonInteractive: false,
1506
+ help: false,
1507
+ version: false
1508
+ };
1509
+ for (let i = 0; i < argv.length; i++) switch (argv[i]) {
1510
+ case "--agents":
1511
+ args.agents = argv[++i];
1512
+ break;
1513
+ case "--non-interactive":
1514
+ args.nonInteractive = true;
1515
+ break;
1516
+ case "--help":
1517
+ case "-h":
1518
+ args.help = true;
1519
+ break;
1520
+ case "--version":
1521
+ case "-v":
1522
+ args.version = true;
1523
+ break;
1524
+ }
1525
+ if (args.agents) args.nonInteractive = true;
1526
+ return args;
1527
+ }
1528
+ function copyDirectory(src, dest) {
1529
+ fs.mkdirSync(dest, { recursive: true });
1530
+ const entries = fs.readdirSync(src, { withFileTypes: true });
1531
+ for (const entry of entries) {
1532
+ const srcPath = path.join(src, entry.name);
1533
+ const destPath = path.join(dest, entry.name);
1534
+ if (entry.isDirectory()) copyDirectory(srcPath, destPath);
1535
+ else fs.copyFileSync(srcPath, destPath);
1536
+ }
1537
+ }
1538
+ async function copyTemplates(tempDir, projectDir, action) {
1539
+ const s = Y();
1540
+ s.start("Copying templates to your project...");
1541
+ const templatesDir = path.join(tempDir, "templates");
1542
+ const srcRuler = path.join(templatesDir, ".ruler");
1543
+ const srcClaude = path.join(templatesDir, ".claude");
1544
+ const destRuler = path.join(projectDir, ".ruler");
1545
+ const destClaude = path.join(projectDir, ".claude");
1546
+ if (action === "fresh") {
1547
+ if (fs.existsSync(destRuler)) {
1548
+ const backupPath = `${destRuler}.backup-${Date.now()}`;
1549
+ fs.renameSync(destRuler, backupPath);
1550
+ M.info(`Backed up existing .ruler/ to ${path.basename(backupPath)}`);
1551
+ }
1552
+ if (fs.existsSync(destClaude)) {
1553
+ const backupPath = `${destClaude}.backup-${Date.now()}`;
1554
+ fs.renameSync(destClaude, backupPath);
1555
+ M.info(`Backed up existing .claude/ to ${path.basename(backupPath)}`);
1556
+ }
1557
+ }
1558
+ if (fs.existsSync(srcRuler)) {
1559
+ copyDirectory(srcRuler, destRuler);
1560
+ const scriptsDir = path.join(destRuler, "scripts");
1561
+ if (fs.existsSync(scriptsDir)) for (const script of fs.readdirSync(scriptsDir).filter((f) => f.endsWith(".sh"))) fs.chmodSync(path.join(scriptsDir, script), 493);
1562
+ }
1563
+ if (fs.existsSync(srcClaude)) copyDirectory(srcClaude, destClaude);
1564
+ s.stop("Copied templates to project");
1565
+ }
1566
+ function printHelp() {
1567
+ console.log(`
1568
+ @buiducnhat/agent-skills - Install AI agent skills for coding assistants
1569
+
1570
+ Usage: npx @buiducnhat/agent-skills [options]
1571
+
1572
+ Options:
1573
+ --agents <list> Comma-separated agent IDs (e.g., claude,cursor,copilot)
1574
+ --non-interactive Skip all prompts, use defaults
1575
+ -h, --help Show this help message
1576
+ -v, --version Show version
1577
+
1578
+ Examples:
1579
+ npx @buiducnhat/agent-skills
1580
+ npx @buiducnhat/agent-skills --agents claude,cursor
1581
+ npx @buiducnhat/agent-skills --agents claude --non-interactive
1582
+
1583
+ Supported agents:
1584
+ claude, copilot, cursor, windsurf, codex, gemini-cli, amp, cline, roo,
1585
+ aider, antigravity, pi, jules, kiro, kilocode, crush, amazonqcli,
1586
+ firebase, openhands, junie, jetbrains-ai, augmentcode, opencode,
1587
+ goose, qwen, zed, trae, warp, firebender, factory, mistral
1588
+ `);
1589
+ }
1590
+ function printSummary(agents, projectDir) {
1591
+ const skillCount = countSkills(projectDir);
1592
+ M.success("Installation complete!");
1593
+ M.message("");
1594
+ M.message("What was set up:");
1595
+ M.message(` .claude/ - Claude vibe coding settings`);
1596
+ M.message(` .ruler/AGENTS.md - Agent instructions`);
1597
+ M.message(` .ruler/ruler.toml - Ruler config (agents: ${agents.join(", ")})`);
1598
+ M.message(` .ruler/scripts/ - Helper scripts`);
1599
+ M.message(` .ruler/skills/ - ${skillCount} workflow skills`);
1600
+ M.message("");
1601
+ M.message("Agent configurations generated for:");
1602
+ for (const agent of agents) M.message(` - ${agent}`);
1603
+ M.message("");
1604
+ M.message("Next steps:");
1605
+ M.message(" 1. Review .ruler/AGENTS.md for agent instructions");
1606
+ M.message(" 2. Customize .ruler/ruler.toml if needed");
1607
+ M.message(" 3. Commit the generated files to your repository");
1608
+ }
1609
+ function countSkills(projectDir) {
1610
+ const skillsDir = path.join(projectDir, ".ruler", "skills");
1611
+ if (!fs.existsSync(skillsDir)) return 0;
1612
+ return fs.readdirSync(skillsDir, { withFileTypes: true }).filter((d) => d.isDirectory()).length;
1613
+ }
1614
+
1615
+ //#endregion
1616
+ //#region src/index.ts
1617
+ async function main() {
1618
+ const args = parseArgs(process.argv.slice(2));
1619
+ if (args.help) {
1620
+ printHelp();
1621
+ process.exit(0);
1622
+ }
1623
+ if (args.version) {
1624
+ console.log("0.1.0");
1625
+ process.exit(0);
1626
+ }
1627
+ Ie(import_picocolors.default.bold(import_picocolors.default.cyan(" Agent Skills Installer ")));
1628
+ const cwd = process.cwd();
1629
+ const rulerDir = path.join(cwd, ".ruler");
1630
+ const existingInstall = fs.existsSync(rulerDir);
1631
+ let action = "fresh";
1632
+ if (existingInstall) if (args.nonInteractive) {
1633
+ action = "update";
1634
+ M.info("Existing .ruler/ found, updating...");
1635
+ } else action = await promptExistingAction();
1636
+ let selectedAgents;
1637
+ if (args.agents) {
1638
+ selectedAgents = args.agents.split(",").map((a) => a.trim());
1639
+ M.info(`Using agents: ${selectedAgents.join(", ")}`);
1640
+ } else if (args.nonInteractive) {
1641
+ selectedAgents = ["claude"];
1642
+ M.info("Using default agent: claude");
1643
+ } else selectedAgents = await promptAgentSelection();
1644
+ if (selectedAgents.length === 0) {
1645
+ xe("No agents selected.");
1646
+ process.exit(1);
1647
+ }
1648
+ let tempDir;
1649
+ try {
1650
+ tempDir = await fetchTemplates();
1651
+ await copyTemplates(tempDir, cwd, action);
1652
+ configureRulerToml(cwd, selectedAgents);
1653
+ await runRulerApply(cwd, selectedAgents);
1654
+ printSummary(selectedAgents, cwd);
1655
+ Se(import_picocolors.default.green("Done! Your AI agent skills are ready."));
1656
+ } catch (err) {
1657
+ const message = err instanceof Error ? err.message : String(err);
1658
+ xe(import_picocolors.default.red(`Error: ${message}`));
1659
+ process.exit(1);
1660
+ } finally {
1661
+ if (tempDir) cleanupTemp(tempDir);
1662
+ }
1663
+ }
1664
+ main();
1665
+
1666
+ //#endregion
1667
+ export { };