@juho0719/cckit 0.2.6 → 0.2.7

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 (33) hide show
  1. package/dist/agents-AEKT67A6.js +9 -0
  2. package/dist/{chunk-T5VPG46W.js → chunk-3GUKEMND.js} +0 -5
  3. package/dist/{chunk-33CGM7PI.js → chunk-3Y26YU4R.js} +3 -7
  4. package/dist/{chunk-4NEXS2FY.js → chunk-5XOKKPAA.js} +0 -5
  5. package/dist/{chunk-6COBMJZ6.js → chunk-E3INXQNO.js} +1 -5
  6. package/dist/{chunk-ZBGGTONN.js → chunk-EYY2IZ7N.js} +3 -7
  7. package/dist/{chunk-H4YDYF2X.js → chunk-ID643AV4.js} +3 -7
  8. package/dist/{chunk-FLBB3OH4.js → chunk-K25UZZVG.js} +0 -5
  9. package/dist/{chunk-MSCXXA2X.js → chunk-KEENFBLL.js} +2 -6
  10. package/dist/{chunk-7VVGOZDZ.js → chunk-SW3OJLHC.js} +1 -5
  11. package/dist/{chunk-VN5S6JGZ.js → chunk-W63UKEIT.js} +0 -5
  12. package/dist/{chunk-52Q6TDAH.js → chunk-W7RWPDBH.js} +3 -7
  13. package/dist/claudemd-KKQ2DL7P.js +7 -0
  14. package/dist/cli-DABSKXWN.js +477 -0
  15. package/dist/commands-P5LILVZ5.js +9 -0
  16. package/dist/hooks-A2WQ2LGG.js +9 -0
  17. package/dist/index.js +17 -21
  18. package/dist/mcps-67Q7TBGW.js +6 -0
  19. package/dist/{paths-B754SP2D.js → paths-FT6KBIRD.js} +1 -2
  20. package/dist/{registry-6CLDID6R.js → registry-KRLOB4TH.js} +2 -3
  21. package/dist/rules-EFSJ3L3A.js +9 -0
  22. package/dist/skills-ULMW3UCM.js +8 -0
  23. package/dist/{uninstall-cli-XU7E26JX.js → uninstall-cli-GLYJG5V2.js} +2 -14
  24. package/package.json +2 -1
  25. package/dist/agents-LI3AHTTX.js +0 -10
  26. package/dist/chunk-TLOORH3N.js +0 -50
  27. package/dist/claudemd-NWG63O2G.js +0 -8
  28. package/dist/cli-KHRWBZPV.js +0 -2735
  29. package/dist/commands-UAOYWGUX.js +0 -10
  30. package/dist/hooks-NONUWI6V.js +0 -10
  31. package/dist/mcps-ISPG3F7T.js +0 -7
  32. package/dist/rules-GZEAGCSL.js +0 -10
  33. package/dist/skills-ML3QLXUK.js +0 -9
@@ -1,2735 +0,0 @@
1
- import {
2
- installMcps
3
- } from "./chunk-VN5S6JGZ.js";
4
- import {
5
- installClaudemd
6
- } from "./chunk-7VVGOZDZ.js";
7
- import {
8
- getAgents,
9
- getClaudemdItems,
10
- getCommands,
11
- getHooks,
12
- getMcpServers,
13
- getRuleCategories,
14
- getSkills
15
- } from "./chunk-6COBMJZ6.js";
16
- import {
17
- installAgents
18
- } from "./chunk-ZBGGTONN.js";
19
- import {
20
- installSkills
21
- } from "./chunk-MSCXXA2X.js";
22
- import {
23
- installCommands
24
- } from "./chunk-33CGM7PI.js";
25
- import {
26
- installHooks
27
- } from "./chunk-52Q6TDAH.js";
28
- import {
29
- installRules
30
- } from "./chunk-H4YDYF2X.js";
31
- import {
32
- backupIfExists
33
- } from "./chunk-FLBB3OH4.js";
34
- import {
35
- copyFileUtil
36
- } from "./chunk-T5VPG46W.js";
37
- import {
38
- getAssetsDir,
39
- getGlobalDir,
40
- getProjectDir
41
- } from "./chunk-4NEXS2FY.js";
42
- import {
43
- __commonJS,
44
- __require,
45
- __toESM,
46
- init_esm_shims
47
- } from "./chunk-TLOORH3N.js";
48
-
49
- // node_modules/yoctocolors-cjs/index.js
50
- var require_yoctocolors_cjs = __commonJS({
51
- "node_modules/yoctocolors-cjs/index.js"(exports, module) {
52
- "use strict";
53
- init_esm_shims();
54
- var tty = __require("tty");
55
- var hasColors = tty?.WriteStream?.prototype?.hasColors?.() ?? false;
56
- var format = (open, close) => {
57
- if (!hasColors) {
58
- return (input2) => input2;
59
- }
60
- const openCode = `\x1B[${open}m`;
61
- const closeCode = `\x1B[${close}m`;
62
- return (input2) => {
63
- const string = input2 + "";
64
- let index = string.indexOf(closeCode);
65
- if (index === -1) {
66
- return openCode + string + closeCode;
67
- }
68
- let result = openCode;
69
- let lastIndex = 0;
70
- const reopenOnNestedClose = close === 22;
71
- const replaceCode = (reopenOnNestedClose ? closeCode : "") + openCode;
72
- while (index !== -1) {
73
- result += string.slice(lastIndex, index) + replaceCode;
74
- lastIndex = index + closeCode.length;
75
- index = string.indexOf(closeCode, lastIndex);
76
- }
77
- result += string.slice(lastIndex) + closeCode;
78
- return result;
79
- };
80
- };
81
- var colors2 = {};
82
- colors2.reset = format(0, 0);
83
- colors2.bold = format(1, 22);
84
- colors2.dim = format(2, 22);
85
- colors2.italic = format(3, 23);
86
- colors2.underline = format(4, 24);
87
- colors2.overline = format(53, 55);
88
- colors2.inverse = format(7, 27);
89
- colors2.hidden = format(8, 28);
90
- colors2.strikethrough = format(9, 29);
91
- colors2.black = format(30, 39);
92
- colors2.red = format(31, 39);
93
- colors2.green = format(32, 39);
94
- colors2.yellow = format(33, 39);
95
- colors2.blue = format(34, 39);
96
- colors2.magenta = format(35, 39);
97
- colors2.cyan = format(36, 39);
98
- colors2.white = format(37, 39);
99
- colors2.gray = format(90, 39);
100
- colors2.bgBlack = format(40, 49);
101
- colors2.bgRed = format(41, 49);
102
- colors2.bgGreen = format(42, 49);
103
- colors2.bgYellow = format(43, 49);
104
- colors2.bgBlue = format(44, 49);
105
- colors2.bgMagenta = format(45, 49);
106
- colors2.bgCyan = format(46, 49);
107
- colors2.bgWhite = format(47, 49);
108
- colors2.bgGray = format(100, 49);
109
- colors2.redBright = format(91, 39);
110
- colors2.greenBright = format(92, 39);
111
- colors2.yellowBright = format(93, 39);
112
- colors2.blueBright = format(94, 39);
113
- colors2.magentaBright = format(95, 39);
114
- colors2.cyanBright = format(96, 39);
115
- colors2.whiteBright = format(97, 39);
116
- colors2.bgRedBright = format(101, 49);
117
- colors2.bgGreenBright = format(102, 49);
118
- colors2.bgYellowBright = format(103, 49);
119
- colors2.bgBlueBright = format(104, 49);
120
- colors2.bgMagentaBright = format(105, 49);
121
- colors2.bgCyanBright = format(106, 49);
122
- colors2.bgWhiteBright = format(107, 49);
123
- module.exports = colors2;
124
- }
125
- });
126
-
127
- // node_modules/cli-width/index.js
128
- var require_cli_width = __commonJS({
129
- "node_modules/cli-width/index.js"(exports, module) {
130
- "use strict";
131
- init_esm_shims();
132
- module.exports = cliWidth2;
133
- function normalizeOpts(options) {
134
- const defaultOpts = {
135
- defaultWidth: 0,
136
- output: process.stdout,
137
- tty: __require("tty")
138
- };
139
- if (!options) {
140
- return defaultOpts;
141
- }
142
- Object.keys(defaultOpts).forEach(function(key) {
143
- if (!options[key]) {
144
- options[key] = defaultOpts[key];
145
- }
146
- });
147
- return options;
148
- }
149
- function cliWidth2(options) {
150
- const opts = normalizeOpts(options);
151
- if (opts.output.getWindowSize) {
152
- return opts.output.getWindowSize()[0] || opts.defaultWidth;
153
- }
154
- if (opts.tty.getWindowSize) {
155
- return opts.tty.getWindowSize()[1] || opts.defaultWidth;
156
- }
157
- if (opts.output.columns) {
158
- return opts.output.columns;
159
- }
160
- if (process.env.CLI_WIDTH) {
161
- const width = parseInt(process.env.CLI_WIDTH, 10);
162
- if (!isNaN(width) && width !== 0) {
163
- return width;
164
- }
165
- }
166
- return opts.defaultWidth;
167
- }
168
- }
169
- });
170
-
171
- // node_modules/wrap-ansi/node_modules/ansi-regex/index.js
172
- var require_ansi_regex = __commonJS({
173
- "node_modules/wrap-ansi/node_modules/ansi-regex/index.js"(exports, module) {
174
- "use strict";
175
- init_esm_shims();
176
- module.exports = ({ onlyFirst = false } = {}) => {
177
- const pattern = [
178
- "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
179
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
180
- ].join("|");
181
- return new RegExp(pattern, onlyFirst ? void 0 : "g");
182
- };
183
- }
184
- });
185
-
186
- // node_modules/wrap-ansi/node_modules/strip-ansi/index.js
187
- var require_strip_ansi = __commonJS({
188
- "node_modules/wrap-ansi/node_modules/strip-ansi/index.js"(exports, module) {
189
- "use strict";
190
- init_esm_shims();
191
- var ansiRegex = require_ansi_regex();
192
- module.exports = (string) => typeof string === "string" ? string.replace(ansiRegex(), "") : string;
193
- }
194
- });
195
-
196
- // node_modules/is-fullwidth-code-point/index.js
197
- var require_is_fullwidth_code_point = __commonJS({
198
- "node_modules/is-fullwidth-code-point/index.js"(exports, module) {
199
- "use strict";
200
- init_esm_shims();
201
- var isFullwidthCodePoint = (codePoint) => {
202
- if (Number.isNaN(codePoint)) {
203
- return false;
204
- }
205
- if (codePoint >= 4352 && (codePoint <= 4447 || // Hangul Jamo
206
- codePoint === 9001 || // LEFT-POINTING ANGLE BRACKET
207
- codePoint === 9002 || // RIGHT-POINTING ANGLE BRACKET
208
- // CJK Radicals Supplement .. Enclosed CJK Letters and Months
209
- 11904 <= codePoint && codePoint <= 12871 && codePoint !== 12351 || // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
210
- 12880 <= codePoint && codePoint <= 19903 || // CJK Unified Ideographs .. Yi Radicals
211
- 19968 <= codePoint && codePoint <= 42182 || // Hangul Jamo Extended-A
212
- 43360 <= codePoint && codePoint <= 43388 || // Hangul Syllables
213
- 44032 <= codePoint && codePoint <= 55203 || // CJK Compatibility Ideographs
214
- 63744 <= codePoint && codePoint <= 64255 || // Vertical Forms
215
- 65040 <= codePoint && codePoint <= 65049 || // CJK Compatibility Forms .. Small Form Variants
216
- 65072 <= codePoint && codePoint <= 65131 || // Halfwidth and Fullwidth Forms
217
- 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 || // Kana Supplement
218
- 110592 <= codePoint && codePoint <= 110593 || // Enclosed Ideographic Supplement
219
- 127488 <= codePoint && codePoint <= 127569 || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
220
- 131072 <= codePoint && codePoint <= 262141)) {
221
- return true;
222
- }
223
- return false;
224
- };
225
- module.exports = isFullwidthCodePoint;
226
- module.exports.default = isFullwidthCodePoint;
227
- }
228
- });
229
-
230
- // node_modules/wrap-ansi/node_modules/emoji-regex/index.js
231
- var require_emoji_regex = __commonJS({
232
- "node_modules/wrap-ansi/node_modules/emoji-regex/index.js"(exports, module) {
233
- "use strict";
234
- init_esm_shims();
235
- module.exports = function() {
236
- return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\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\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])|\uD83C[\uDF3E\uDF73\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])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\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])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\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\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*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\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\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\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[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
237
- };
238
- }
239
- });
240
-
241
- // node_modules/wrap-ansi/node_modules/string-width/index.js
242
- var require_string_width = __commonJS({
243
- "node_modules/wrap-ansi/node_modules/string-width/index.js"(exports, module) {
244
- "use strict";
245
- init_esm_shims();
246
- var stripAnsi = require_strip_ansi();
247
- var isFullwidthCodePoint = require_is_fullwidth_code_point();
248
- var emojiRegex = require_emoji_regex();
249
- var stringWidth = (string) => {
250
- if (typeof string !== "string" || string.length === 0) {
251
- return 0;
252
- }
253
- string = stripAnsi(string);
254
- if (string.length === 0) {
255
- return 0;
256
- }
257
- string = string.replace(emojiRegex(), " ");
258
- let width = 0;
259
- for (let i = 0; i < string.length; i++) {
260
- const code = string.codePointAt(i);
261
- if (code <= 31 || code >= 127 && code <= 159) {
262
- continue;
263
- }
264
- if (code >= 768 && code <= 879) {
265
- continue;
266
- }
267
- if (code > 65535) {
268
- i++;
269
- }
270
- width += isFullwidthCodePoint(code) ? 2 : 1;
271
- }
272
- return width;
273
- };
274
- module.exports = stringWidth;
275
- module.exports.default = stringWidth;
276
- }
277
- });
278
-
279
- // node_modules/color-name/index.js
280
- var require_color_name = __commonJS({
281
- "node_modules/color-name/index.js"(exports, module) {
282
- "use strict";
283
- init_esm_shims();
284
- module.exports = {
285
- "aliceblue": [240, 248, 255],
286
- "antiquewhite": [250, 235, 215],
287
- "aqua": [0, 255, 255],
288
- "aquamarine": [127, 255, 212],
289
- "azure": [240, 255, 255],
290
- "beige": [245, 245, 220],
291
- "bisque": [255, 228, 196],
292
- "black": [0, 0, 0],
293
- "blanchedalmond": [255, 235, 205],
294
- "blue": [0, 0, 255],
295
- "blueviolet": [138, 43, 226],
296
- "brown": [165, 42, 42],
297
- "burlywood": [222, 184, 135],
298
- "cadetblue": [95, 158, 160],
299
- "chartreuse": [127, 255, 0],
300
- "chocolate": [210, 105, 30],
301
- "coral": [255, 127, 80],
302
- "cornflowerblue": [100, 149, 237],
303
- "cornsilk": [255, 248, 220],
304
- "crimson": [220, 20, 60],
305
- "cyan": [0, 255, 255],
306
- "darkblue": [0, 0, 139],
307
- "darkcyan": [0, 139, 139],
308
- "darkgoldenrod": [184, 134, 11],
309
- "darkgray": [169, 169, 169],
310
- "darkgreen": [0, 100, 0],
311
- "darkgrey": [169, 169, 169],
312
- "darkkhaki": [189, 183, 107],
313
- "darkmagenta": [139, 0, 139],
314
- "darkolivegreen": [85, 107, 47],
315
- "darkorange": [255, 140, 0],
316
- "darkorchid": [153, 50, 204],
317
- "darkred": [139, 0, 0],
318
- "darksalmon": [233, 150, 122],
319
- "darkseagreen": [143, 188, 143],
320
- "darkslateblue": [72, 61, 139],
321
- "darkslategray": [47, 79, 79],
322
- "darkslategrey": [47, 79, 79],
323
- "darkturquoise": [0, 206, 209],
324
- "darkviolet": [148, 0, 211],
325
- "deeppink": [255, 20, 147],
326
- "deepskyblue": [0, 191, 255],
327
- "dimgray": [105, 105, 105],
328
- "dimgrey": [105, 105, 105],
329
- "dodgerblue": [30, 144, 255],
330
- "firebrick": [178, 34, 34],
331
- "floralwhite": [255, 250, 240],
332
- "forestgreen": [34, 139, 34],
333
- "fuchsia": [255, 0, 255],
334
- "gainsboro": [220, 220, 220],
335
- "ghostwhite": [248, 248, 255],
336
- "gold": [255, 215, 0],
337
- "goldenrod": [218, 165, 32],
338
- "gray": [128, 128, 128],
339
- "green": [0, 128, 0],
340
- "greenyellow": [173, 255, 47],
341
- "grey": [128, 128, 128],
342
- "honeydew": [240, 255, 240],
343
- "hotpink": [255, 105, 180],
344
- "indianred": [205, 92, 92],
345
- "indigo": [75, 0, 130],
346
- "ivory": [255, 255, 240],
347
- "khaki": [240, 230, 140],
348
- "lavender": [230, 230, 250],
349
- "lavenderblush": [255, 240, 245],
350
- "lawngreen": [124, 252, 0],
351
- "lemonchiffon": [255, 250, 205],
352
- "lightblue": [173, 216, 230],
353
- "lightcoral": [240, 128, 128],
354
- "lightcyan": [224, 255, 255],
355
- "lightgoldenrodyellow": [250, 250, 210],
356
- "lightgray": [211, 211, 211],
357
- "lightgreen": [144, 238, 144],
358
- "lightgrey": [211, 211, 211],
359
- "lightpink": [255, 182, 193],
360
- "lightsalmon": [255, 160, 122],
361
- "lightseagreen": [32, 178, 170],
362
- "lightskyblue": [135, 206, 250],
363
- "lightslategray": [119, 136, 153],
364
- "lightslategrey": [119, 136, 153],
365
- "lightsteelblue": [176, 196, 222],
366
- "lightyellow": [255, 255, 224],
367
- "lime": [0, 255, 0],
368
- "limegreen": [50, 205, 50],
369
- "linen": [250, 240, 230],
370
- "magenta": [255, 0, 255],
371
- "maroon": [128, 0, 0],
372
- "mediumaquamarine": [102, 205, 170],
373
- "mediumblue": [0, 0, 205],
374
- "mediumorchid": [186, 85, 211],
375
- "mediumpurple": [147, 112, 219],
376
- "mediumseagreen": [60, 179, 113],
377
- "mediumslateblue": [123, 104, 238],
378
- "mediumspringgreen": [0, 250, 154],
379
- "mediumturquoise": [72, 209, 204],
380
- "mediumvioletred": [199, 21, 133],
381
- "midnightblue": [25, 25, 112],
382
- "mintcream": [245, 255, 250],
383
- "mistyrose": [255, 228, 225],
384
- "moccasin": [255, 228, 181],
385
- "navajowhite": [255, 222, 173],
386
- "navy": [0, 0, 128],
387
- "oldlace": [253, 245, 230],
388
- "olive": [128, 128, 0],
389
- "olivedrab": [107, 142, 35],
390
- "orange": [255, 165, 0],
391
- "orangered": [255, 69, 0],
392
- "orchid": [218, 112, 214],
393
- "palegoldenrod": [238, 232, 170],
394
- "palegreen": [152, 251, 152],
395
- "paleturquoise": [175, 238, 238],
396
- "palevioletred": [219, 112, 147],
397
- "papayawhip": [255, 239, 213],
398
- "peachpuff": [255, 218, 185],
399
- "peru": [205, 133, 63],
400
- "pink": [255, 192, 203],
401
- "plum": [221, 160, 221],
402
- "powderblue": [176, 224, 230],
403
- "purple": [128, 0, 128],
404
- "rebeccapurple": [102, 51, 153],
405
- "red": [255, 0, 0],
406
- "rosybrown": [188, 143, 143],
407
- "royalblue": [65, 105, 225],
408
- "saddlebrown": [139, 69, 19],
409
- "salmon": [250, 128, 114],
410
- "sandybrown": [244, 164, 96],
411
- "seagreen": [46, 139, 87],
412
- "seashell": [255, 245, 238],
413
- "sienna": [160, 82, 45],
414
- "silver": [192, 192, 192],
415
- "skyblue": [135, 206, 235],
416
- "slateblue": [106, 90, 205],
417
- "slategray": [112, 128, 144],
418
- "slategrey": [112, 128, 144],
419
- "snow": [255, 250, 250],
420
- "springgreen": [0, 255, 127],
421
- "steelblue": [70, 130, 180],
422
- "tan": [210, 180, 140],
423
- "teal": [0, 128, 128],
424
- "thistle": [216, 191, 216],
425
- "tomato": [255, 99, 71],
426
- "turquoise": [64, 224, 208],
427
- "violet": [238, 130, 238],
428
- "wheat": [245, 222, 179],
429
- "white": [255, 255, 255],
430
- "whitesmoke": [245, 245, 245],
431
- "yellow": [255, 255, 0],
432
- "yellowgreen": [154, 205, 50]
433
- };
434
- }
435
- });
436
-
437
- // node_modules/color-convert/conversions.js
438
- var require_conversions = __commonJS({
439
- "node_modules/color-convert/conversions.js"(exports, module) {
440
- "use strict";
441
- init_esm_shims();
442
- var cssKeywords = require_color_name();
443
- var reverseKeywords = {};
444
- for (const key of Object.keys(cssKeywords)) {
445
- reverseKeywords[cssKeywords[key]] = key;
446
- }
447
- var convert = {
448
- rgb: { channels: 3, labels: "rgb" },
449
- hsl: { channels: 3, labels: "hsl" },
450
- hsv: { channels: 3, labels: "hsv" },
451
- hwb: { channels: 3, labels: "hwb" },
452
- cmyk: { channels: 4, labels: "cmyk" },
453
- xyz: { channels: 3, labels: "xyz" },
454
- lab: { channels: 3, labels: "lab" },
455
- lch: { channels: 3, labels: "lch" },
456
- hex: { channels: 1, labels: ["hex"] },
457
- keyword: { channels: 1, labels: ["keyword"] },
458
- ansi16: { channels: 1, labels: ["ansi16"] },
459
- ansi256: { channels: 1, labels: ["ansi256"] },
460
- hcg: { channels: 3, labels: ["h", "c", "g"] },
461
- apple: { channels: 3, labels: ["r16", "g16", "b16"] },
462
- gray: { channels: 1, labels: ["gray"] }
463
- };
464
- module.exports = convert;
465
- for (const model of Object.keys(convert)) {
466
- if (!("channels" in convert[model])) {
467
- throw new Error("missing channels property: " + model);
468
- }
469
- if (!("labels" in convert[model])) {
470
- throw new Error("missing channel labels property: " + model);
471
- }
472
- if (convert[model].labels.length !== convert[model].channels) {
473
- throw new Error("channel and label counts mismatch: " + model);
474
- }
475
- const { channels, labels } = convert[model];
476
- delete convert[model].channels;
477
- delete convert[model].labels;
478
- Object.defineProperty(convert[model], "channels", { value: channels });
479
- Object.defineProperty(convert[model], "labels", { value: labels });
480
- }
481
- convert.rgb.hsl = function(rgb) {
482
- const r = rgb[0] / 255;
483
- const g = rgb[1] / 255;
484
- const b = rgb[2] / 255;
485
- const min = Math.min(r, g, b);
486
- const max = Math.max(r, g, b);
487
- const delta = max - min;
488
- let h;
489
- let s;
490
- if (max === min) {
491
- h = 0;
492
- } else if (r === max) {
493
- h = (g - b) / delta;
494
- } else if (g === max) {
495
- h = 2 + (b - r) / delta;
496
- } else if (b === max) {
497
- h = 4 + (r - g) / delta;
498
- }
499
- h = Math.min(h * 60, 360);
500
- if (h < 0) {
501
- h += 360;
502
- }
503
- const l = (min + max) / 2;
504
- if (max === min) {
505
- s = 0;
506
- } else if (l <= 0.5) {
507
- s = delta / (max + min);
508
- } else {
509
- s = delta / (2 - max - min);
510
- }
511
- return [h, s * 100, l * 100];
512
- };
513
- convert.rgb.hsv = function(rgb) {
514
- let rdif;
515
- let gdif;
516
- let bdif;
517
- let h;
518
- let s;
519
- const r = rgb[0] / 255;
520
- const g = rgb[1] / 255;
521
- const b = rgb[2] / 255;
522
- const v = Math.max(r, g, b);
523
- const diff = v - Math.min(r, g, b);
524
- const diffc = function(c) {
525
- return (v - c) / 6 / diff + 1 / 2;
526
- };
527
- if (diff === 0) {
528
- h = 0;
529
- s = 0;
530
- } else {
531
- s = diff / v;
532
- rdif = diffc(r);
533
- gdif = diffc(g);
534
- bdif = diffc(b);
535
- if (r === v) {
536
- h = bdif - gdif;
537
- } else if (g === v) {
538
- h = 1 / 3 + rdif - bdif;
539
- } else if (b === v) {
540
- h = 2 / 3 + gdif - rdif;
541
- }
542
- if (h < 0) {
543
- h += 1;
544
- } else if (h > 1) {
545
- h -= 1;
546
- }
547
- }
548
- return [
549
- h * 360,
550
- s * 100,
551
- v * 100
552
- ];
553
- };
554
- convert.rgb.hwb = function(rgb) {
555
- const r = rgb[0];
556
- const g = rgb[1];
557
- let b = rgb[2];
558
- const h = convert.rgb.hsl(rgb)[0];
559
- const w = 1 / 255 * Math.min(r, Math.min(g, b));
560
- b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
561
- return [h, w * 100, b * 100];
562
- };
563
- convert.rgb.cmyk = function(rgb) {
564
- const r = rgb[0] / 255;
565
- const g = rgb[1] / 255;
566
- const b = rgb[2] / 255;
567
- const k = Math.min(1 - r, 1 - g, 1 - b);
568
- const c = (1 - r - k) / (1 - k) || 0;
569
- const m = (1 - g - k) / (1 - k) || 0;
570
- const y = (1 - b - k) / (1 - k) || 0;
571
- return [c * 100, m * 100, y * 100, k * 100];
572
- };
573
- function comparativeDistance(x, y) {
574
- return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
575
- }
576
- convert.rgb.keyword = function(rgb) {
577
- const reversed = reverseKeywords[rgb];
578
- if (reversed) {
579
- return reversed;
580
- }
581
- let currentClosestDistance = Infinity;
582
- let currentClosestKeyword;
583
- for (const keyword of Object.keys(cssKeywords)) {
584
- const value = cssKeywords[keyword];
585
- const distance = comparativeDistance(rgb, value);
586
- if (distance < currentClosestDistance) {
587
- currentClosestDistance = distance;
588
- currentClosestKeyword = keyword;
589
- }
590
- }
591
- return currentClosestKeyword;
592
- };
593
- convert.keyword.rgb = function(keyword) {
594
- return cssKeywords[keyword];
595
- };
596
- convert.rgb.xyz = function(rgb) {
597
- let r = rgb[0] / 255;
598
- let g = rgb[1] / 255;
599
- let b = rgb[2] / 255;
600
- r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
601
- g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
602
- b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
603
- const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
604
- const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
605
- const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
606
- return [x * 100, y * 100, z * 100];
607
- };
608
- convert.rgb.lab = function(rgb) {
609
- const xyz = convert.rgb.xyz(rgb);
610
- let x = xyz[0];
611
- let y = xyz[1];
612
- let z = xyz[2];
613
- x /= 95.047;
614
- y /= 100;
615
- z /= 108.883;
616
- x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
617
- y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
618
- z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
619
- const l = 116 * y - 16;
620
- const a = 500 * (x - y);
621
- const b = 200 * (y - z);
622
- return [l, a, b];
623
- };
624
- convert.hsl.rgb = function(hsl) {
625
- const h = hsl[0] / 360;
626
- const s = hsl[1] / 100;
627
- const l = hsl[2] / 100;
628
- let t2;
629
- let t3;
630
- let val;
631
- if (s === 0) {
632
- val = l * 255;
633
- return [val, val, val];
634
- }
635
- if (l < 0.5) {
636
- t2 = l * (1 + s);
637
- } else {
638
- t2 = l + s - l * s;
639
- }
640
- const t1 = 2 * l - t2;
641
- const rgb = [0, 0, 0];
642
- for (let i = 0; i < 3; i++) {
643
- t3 = h + 1 / 3 * -(i - 1);
644
- if (t3 < 0) {
645
- t3++;
646
- }
647
- if (t3 > 1) {
648
- t3--;
649
- }
650
- if (6 * t3 < 1) {
651
- val = t1 + (t2 - t1) * 6 * t3;
652
- } else if (2 * t3 < 1) {
653
- val = t2;
654
- } else if (3 * t3 < 2) {
655
- val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
656
- } else {
657
- val = t1;
658
- }
659
- rgb[i] = val * 255;
660
- }
661
- return rgb;
662
- };
663
- convert.hsl.hsv = function(hsl) {
664
- const h = hsl[0];
665
- let s = hsl[1] / 100;
666
- let l = hsl[2] / 100;
667
- let smin = s;
668
- const lmin = Math.max(l, 0.01);
669
- l *= 2;
670
- s *= l <= 1 ? l : 2 - l;
671
- smin *= lmin <= 1 ? lmin : 2 - lmin;
672
- const v = (l + s) / 2;
673
- const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
674
- return [h, sv * 100, v * 100];
675
- };
676
- convert.hsv.rgb = function(hsv) {
677
- const h = hsv[0] / 60;
678
- const s = hsv[1] / 100;
679
- let v = hsv[2] / 100;
680
- const hi = Math.floor(h) % 6;
681
- const f = h - Math.floor(h);
682
- const p = 255 * v * (1 - s);
683
- const q = 255 * v * (1 - s * f);
684
- const t = 255 * v * (1 - s * (1 - f));
685
- v *= 255;
686
- switch (hi) {
687
- case 0:
688
- return [v, t, p];
689
- case 1:
690
- return [q, v, p];
691
- case 2:
692
- return [p, v, t];
693
- case 3:
694
- return [p, q, v];
695
- case 4:
696
- return [t, p, v];
697
- case 5:
698
- return [v, p, q];
699
- }
700
- };
701
- convert.hsv.hsl = function(hsv) {
702
- const h = hsv[0];
703
- const s = hsv[1] / 100;
704
- const v = hsv[2] / 100;
705
- const vmin = Math.max(v, 0.01);
706
- let sl;
707
- let l;
708
- l = (2 - s) * v;
709
- const lmin = (2 - s) * vmin;
710
- sl = s * vmin;
711
- sl /= lmin <= 1 ? lmin : 2 - lmin;
712
- sl = sl || 0;
713
- l /= 2;
714
- return [h, sl * 100, l * 100];
715
- };
716
- convert.hwb.rgb = function(hwb) {
717
- const h = hwb[0] / 360;
718
- let wh = hwb[1] / 100;
719
- let bl = hwb[2] / 100;
720
- const ratio = wh + bl;
721
- let f;
722
- if (ratio > 1) {
723
- wh /= ratio;
724
- bl /= ratio;
725
- }
726
- const i = Math.floor(6 * h);
727
- const v = 1 - bl;
728
- f = 6 * h - i;
729
- if ((i & 1) !== 0) {
730
- f = 1 - f;
731
- }
732
- const n = wh + f * (v - wh);
733
- let r;
734
- let g;
735
- let b;
736
- switch (i) {
737
- default:
738
- case 6:
739
- case 0:
740
- r = v;
741
- g = n;
742
- b = wh;
743
- break;
744
- case 1:
745
- r = n;
746
- g = v;
747
- b = wh;
748
- break;
749
- case 2:
750
- r = wh;
751
- g = v;
752
- b = n;
753
- break;
754
- case 3:
755
- r = wh;
756
- g = n;
757
- b = v;
758
- break;
759
- case 4:
760
- r = n;
761
- g = wh;
762
- b = v;
763
- break;
764
- case 5:
765
- r = v;
766
- g = wh;
767
- b = n;
768
- break;
769
- }
770
- return [r * 255, g * 255, b * 255];
771
- };
772
- convert.cmyk.rgb = function(cmyk) {
773
- const c = cmyk[0] / 100;
774
- const m = cmyk[1] / 100;
775
- const y = cmyk[2] / 100;
776
- const k = cmyk[3] / 100;
777
- const r = 1 - Math.min(1, c * (1 - k) + k);
778
- const g = 1 - Math.min(1, m * (1 - k) + k);
779
- const b = 1 - Math.min(1, y * (1 - k) + k);
780
- return [r * 255, g * 255, b * 255];
781
- };
782
- convert.xyz.rgb = function(xyz) {
783
- const x = xyz[0] / 100;
784
- const y = xyz[1] / 100;
785
- const z = xyz[2] / 100;
786
- let r;
787
- let g;
788
- let b;
789
- r = x * 3.2406 + y * -1.5372 + z * -0.4986;
790
- g = x * -0.9689 + y * 1.8758 + z * 0.0415;
791
- b = x * 0.0557 + y * -0.204 + z * 1.057;
792
- r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
793
- g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
794
- b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
795
- r = Math.min(Math.max(0, r), 1);
796
- g = Math.min(Math.max(0, g), 1);
797
- b = Math.min(Math.max(0, b), 1);
798
- return [r * 255, g * 255, b * 255];
799
- };
800
- convert.xyz.lab = function(xyz) {
801
- let x = xyz[0];
802
- let y = xyz[1];
803
- let z = xyz[2];
804
- x /= 95.047;
805
- y /= 100;
806
- z /= 108.883;
807
- x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
808
- y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
809
- z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
810
- const l = 116 * y - 16;
811
- const a = 500 * (x - y);
812
- const b = 200 * (y - z);
813
- return [l, a, b];
814
- };
815
- convert.lab.xyz = function(lab) {
816
- const l = lab[0];
817
- const a = lab[1];
818
- const b = lab[2];
819
- let x;
820
- let y;
821
- let z;
822
- y = (l + 16) / 116;
823
- x = a / 500 + y;
824
- z = y - b / 200;
825
- const y2 = y ** 3;
826
- const x2 = x ** 3;
827
- const z2 = z ** 3;
828
- y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
829
- x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
830
- z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
831
- x *= 95.047;
832
- y *= 100;
833
- z *= 108.883;
834
- return [x, y, z];
835
- };
836
- convert.lab.lch = function(lab) {
837
- const l = lab[0];
838
- const a = lab[1];
839
- const b = lab[2];
840
- let h;
841
- const hr = Math.atan2(b, a);
842
- h = hr * 360 / 2 / Math.PI;
843
- if (h < 0) {
844
- h += 360;
845
- }
846
- const c = Math.sqrt(a * a + b * b);
847
- return [l, c, h];
848
- };
849
- convert.lch.lab = function(lch) {
850
- const l = lch[0];
851
- const c = lch[1];
852
- const h = lch[2];
853
- const hr = h / 360 * 2 * Math.PI;
854
- const a = c * Math.cos(hr);
855
- const b = c * Math.sin(hr);
856
- return [l, a, b];
857
- };
858
- convert.rgb.ansi16 = function(args, saturation = null) {
859
- const [r, g, b] = args;
860
- let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
861
- value = Math.round(value / 50);
862
- if (value === 0) {
863
- return 30;
864
- }
865
- let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
866
- if (value === 2) {
867
- ansi += 60;
868
- }
869
- return ansi;
870
- };
871
- convert.hsv.ansi16 = function(args) {
872
- return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
873
- };
874
- convert.rgb.ansi256 = function(args) {
875
- const r = args[0];
876
- const g = args[1];
877
- const b = args[2];
878
- if (r === g && g === b) {
879
- if (r < 8) {
880
- return 16;
881
- }
882
- if (r > 248) {
883
- return 231;
884
- }
885
- return Math.round((r - 8) / 247 * 24) + 232;
886
- }
887
- const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
888
- return ansi;
889
- };
890
- convert.ansi16.rgb = function(args) {
891
- let color = args % 10;
892
- if (color === 0 || color === 7) {
893
- if (args > 50) {
894
- color += 3.5;
895
- }
896
- color = color / 10.5 * 255;
897
- return [color, color, color];
898
- }
899
- const mult = (~~(args > 50) + 1) * 0.5;
900
- const r = (color & 1) * mult * 255;
901
- const g = (color >> 1 & 1) * mult * 255;
902
- const b = (color >> 2 & 1) * mult * 255;
903
- return [r, g, b];
904
- };
905
- convert.ansi256.rgb = function(args) {
906
- if (args >= 232) {
907
- const c = (args - 232) * 10 + 8;
908
- return [c, c, c];
909
- }
910
- args -= 16;
911
- let rem;
912
- const r = Math.floor(args / 36) / 5 * 255;
913
- const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
914
- const b = rem % 6 / 5 * 255;
915
- return [r, g, b];
916
- };
917
- convert.rgb.hex = function(args) {
918
- const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
919
- const string = integer.toString(16).toUpperCase();
920
- return "000000".substring(string.length) + string;
921
- };
922
- convert.hex.rgb = function(args) {
923
- const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
924
- if (!match) {
925
- return [0, 0, 0];
926
- }
927
- let colorString = match[0];
928
- if (match[0].length === 3) {
929
- colorString = colorString.split("").map((char) => {
930
- return char + char;
931
- }).join("");
932
- }
933
- const integer = parseInt(colorString, 16);
934
- const r = integer >> 16 & 255;
935
- const g = integer >> 8 & 255;
936
- const b = integer & 255;
937
- return [r, g, b];
938
- };
939
- convert.rgb.hcg = function(rgb) {
940
- const r = rgb[0] / 255;
941
- const g = rgb[1] / 255;
942
- const b = rgb[2] / 255;
943
- const max = Math.max(Math.max(r, g), b);
944
- const min = Math.min(Math.min(r, g), b);
945
- const chroma = max - min;
946
- let grayscale;
947
- let hue;
948
- if (chroma < 1) {
949
- grayscale = min / (1 - chroma);
950
- } else {
951
- grayscale = 0;
952
- }
953
- if (chroma <= 0) {
954
- hue = 0;
955
- } else if (max === r) {
956
- hue = (g - b) / chroma % 6;
957
- } else if (max === g) {
958
- hue = 2 + (b - r) / chroma;
959
- } else {
960
- hue = 4 + (r - g) / chroma;
961
- }
962
- hue /= 6;
963
- hue %= 1;
964
- return [hue * 360, chroma * 100, grayscale * 100];
965
- };
966
- convert.hsl.hcg = function(hsl) {
967
- const s = hsl[1] / 100;
968
- const l = hsl[2] / 100;
969
- const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
970
- let f = 0;
971
- if (c < 1) {
972
- f = (l - 0.5 * c) / (1 - c);
973
- }
974
- return [hsl[0], c * 100, f * 100];
975
- };
976
- convert.hsv.hcg = function(hsv) {
977
- const s = hsv[1] / 100;
978
- const v = hsv[2] / 100;
979
- const c = s * v;
980
- let f = 0;
981
- if (c < 1) {
982
- f = (v - c) / (1 - c);
983
- }
984
- return [hsv[0], c * 100, f * 100];
985
- };
986
- convert.hcg.rgb = function(hcg) {
987
- const h = hcg[0] / 360;
988
- const c = hcg[1] / 100;
989
- const g = hcg[2] / 100;
990
- if (c === 0) {
991
- return [g * 255, g * 255, g * 255];
992
- }
993
- const pure = [0, 0, 0];
994
- const hi = h % 1 * 6;
995
- const v = hi % 1;
996
- const w = 1 - v;
997
- let mg = 0;
998
- switch (Math.floor(hi)) {
999
- case 0:
1000
- pure[0] = 1;
1001
- pure[1] = v;
1002
- pure[2] = 0;
1003
- break;
1004
- case 1:
1005
- pure[0] = w;
1006
- pure[1] = 1;
1007
- pure[2] = 0;
1008
- break;
1009
- case 2:
1010
- pure[0] = 0;
1011
- pure[1] = 1;
1012
- pure[2] = v;
1013
- break;
1014
- case 3:
1015
- pure[0] = 0;
1016
- pure[1] = w;
1017
- pure[2] = 1;
1018
- break;
1019
- case 4:
1020
- pure[0] = v;
1021
- pure[1] = 0;
1022
- pure[2] = 1;
1023
- break;
1024
- default:
1025
- pure[0] = 1;
1026
- pure[1] = 0;
1027
- pure[2] = w;
1028
- }
1029
- mg = (1 - c) * g;
1030
- return [
1031
- (c * pure[0] + mg) * 255,
1032
- (c * pure[1] + mg) * 255,
1033
- (c * pure[2] + mg) * 255
1034
- ];
1035
- };
1036
- convert.hcg.hsv = function(hcg) {
1037
- const c = hcg[1] / 100;
1038
- const g = hcg[2] / 100;
1039
- const v = c + g * (1 - c);
1040
- let f = 0;
1041
- if (v > 0) {
1042
- f = c / v;
1043
- }
1044
- return [hcg[0], f * 100, v * 100];
1045
- };
1046
- convert.hcg.hsl = function(hcg) {
1047
- const c = hcg[1] / 100;
1048
- const g = hcg[2] / 100;
1049
- const l = g * (1 - c) + 0.5 * c;
1050
- let s = 0;
1051
- if (l > 0 && l < 0.5) {
1052
- s = c / (2 * l);
1053
- } else if (l >= 0.5 && l < 1) {
1054
- s = c / (2 * (1 - l));
1055
- }
1056
- return [hcg[0], s * 100, l * 100];
1057
- };
1058
- convert.hcg.hwb = function(hcg) {
1059
- const c = hcg[1] / 100;
1060
- const g = hcg[2] / 100;
1061
- const v = c + g * (1 - c);
1062
- return [hcg[0], (v - c) * 100, (1 - v) * 100];
1063
- };
1064
- convert.hwb.hcg = function(hwb) {
1065
- const w = hwb[1] / 100;
1066
- const b = hwb[2] / 100;
1067
- const v = 1 - b;
1068
- const c = v - w;
1069
- let g = 0;
1070
- if (c < 1) {
1071
- g = (v - c) / (1 - c);
1072
- }
1073
- return [hwb[0], c * 100, g * 100];
1074
- };
1075
- convert.apple.rgb = function(apple) {
1076
- return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
1077
- };
1078
- convert.rgb.apple = function(rgb) {
1079
- return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
1080
- };
1081
- convert.gray.rgb = function(args) {
1082
- return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
1083
- };
1084
- convert.gray.hsl = function(args) {
1085
- return [0, 0, args[0]];
1086
- };
1087
- convert.gray.hsv = convert.gray.hsl;
1088
- convert.gray.hwb = function(gray) {
1089
- return [0, 100, gray[0]];
1090
- };
1091
- convert.gray.cmyk = function(gray) {
1092
- return [0, 0, 0, gray[0]];
1093
- };
1094
- convert.gray.lab = function(gray) {
1095
- return [gray[0], 0, 0];
1096
- };
1097
- convert.gray.hex = function(gray) {
1098
- const val = Math.round(gray[0] / 100 * 255) & 255;
1099
- const integer = (val << 16) + (val << 8) + val;
1100
- const string = integer.toString(16).toUpperCase();
1101
- return "000000".substring(string.length) + string;
1102
- };
1103
- convert.rgb.gray = function(rgb) {
1104
- const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
1105
- return [val / 255 * 100];
1106
- };
1107
- }
1108
- });
1109
-
1110
- // node_modules/color-convert/route.js
1111
- var require_route = __commonJS({
1112
- "node_modules/color-convert/route.js"(exports, module) {
1113
- "use strict";
1114
- init_esm_shims();
1115
- var conversions = require_conversions();
1116
- function buildGraph() {
1117
- const graph = {};
1118
- const models = Object.keys(conversions);
1119
- for (let len = models.length, i = 0; i < len; i++) {
1120
- graph[models[i]] = {
1121
- // http://jsperf.com/1-vs-infinity
1122
- // micro-opt, but this is simple.
1123
- distance: -1,
1124
- parent: null
1125
- };
1126
- }
1127
- return graph;
1128
- }
1129
- function deriveBFS(fromModel) {
1130
- const graph = buildGraph();
1131
- const queue = [fromModel];
1132
- graph[fromModel].distance = 0;
1133
- while (queue.length) {
1134
- const current = queue.pop();
1135
- const adjacents = Object.keys(conversions[current]);
1136
- for (let len = adjacents.length, i = 0; i < len; i++) {
1137
- const adjacent = adjacents[i];
1138
- const node = graph[adjacent];
1139
- if (node.distance === -1) {
1140
- node.distance = graph[current].distance + 1;
1141
- node.parent = current;
1142
- queue.unshift(adjacent);
1143
- }
1144
- }
1145
- }
1146
- return graph;
1147
- }
1148
- function link(from, to) {
1149
- return function(args) {
1150
- return to(from(args));
1151
- };
1152
- }
1153
- function wrapConversion(toModel, graph) {
1154
- const path = [graph[toModel].parent, toModel];
1155
- let fn = conversions[graph[toModel].parent][toModel];
1156
- let cur = graph[toModel].parent;
1157
- while (graph[cur].parent) {
1158
- path.unshift(graph[cur].parent);
1159
- fn = link(conversions[graph[cur].parent][cur], fn);
1160
- cur = graph[cur].parent;
1161
- }
1162
- fn.conversion = path;
1163
- return fn;
1164
- }
1165
- module.exports = function(fromModel) {
1166
- const graph = deriveBFS(fromModel);
1167
- const conversion = {};
1168
- const models = Object.keys(graph);
1169
- for (let len = models.length, i = 0; i < len; i++) {
1170
- const toModel = models[i];
1171
- const node = graph[toModel];
1172
- if (node.parent === null) {
1173
- continue;
1174
- }
1175
- conversion[toModel] = wrapConversion(toModel, graph);
1176
- }
1177
- return conversion;
1178
- };
1179
- }
1180
- });
1181
-
1182
- // node_modules/color-convert/index.js
1183
- var require_color_convert = __commonJS({
1184
- "node_modules/color-convert/index.js"(exports, module) {
1185
- "use strict";
1186
- init_esm_shims();
1187
- var conversions = require_conversions();
1188
- var route = require_route();
1189
- var convert = {};
1190
- var models = Object.keys(conversions);
1191
- function wrapRaw(fn) {
1192
- const wrappedFn = function(...args) {
1193
- const arg0 = args[0];
1194
- if (arg0 === void 0 || arg0 === null) {
1195
- return arg0;
1196
- }
1197
- if (arg0.length > 1) {
1198
- args = arg0;
1199
- }
1200
- return fn(args);
1201
- };
1202
- if ("conversion" in fn) {
1203
- wrappedFn.conversion = fn.conversion;
1204
- }
1205
- return wrappedFn;
1206
- }
1207
- function wrapRounded(fn) {
1208
- const wrappedFn = function(...args) {
1209
- const arg0 = args[0];
1210
- if (arg0 === void 0 || arg0 === null) {
1211
- return arg0;
1212
- }
1213
- if (arg0.length > 1) {
1214
- args = arg0;
1215
- }
1216
- const result = fn(args);
1217
- if (typeof result === "object") {
1218
- for (let len = result.length, i = 0; i < len; i++) {
1219
- result[i] = Math.round(result[i]);
1220
- }
1221
- }
1222
- return result;
1223
- };
1224
- if ("conversion" in fn) {
1225
- wrappedFn.conversion = fn.conversion;
1226
- }
1227
- return wrappedFn;
1228
- }
1229
- models.forEach((fromModel) => {
1230
- convert[fromModel] = {};
1231
- Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
1232
- Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
1233
- const routes = route(fromModel);
1234
- const routeModels = Object.keys(routes);
1235
- routeModels.forEach((toModel) => {
1236
- const fn = routes[toModel];
1237
- convert[fromModel][toModel] = wrapRounded(fn);
1238
- convert[fromModel][toModel].raw = wrapRaw(fn);
1239
- });
1240
- });
1241
- module.exports = convert;
1242
- }
1243
- });
1244
-
1245
- // node_modules/ansi-styles/index.js
1246
- var require_ansi_styles = __commonJS({
1247
- "node_modules/ansi-styles/index.js"(exports, module) {
1248
- "use strict";
1249
- init_esm_shims();
1250
- var wrapAnsi16 = (fn, offset) => (...args) => {
1251
- const code = fn(...args);
1252
- return `\x1B[${code + offset}m`;
1253
- };
1254
- var wrapAnsi256 = (fn, offset) => (...args) => {
1255
- const code = fn(...args);
1256
- return `\x1B[${38 + offset};5;${code}m`;
1257
- };
1258
- var wrapAnsi16m = (fn, offset) => (...args) => {
1259
- const rgb = fn(...args);
1260
- return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
1261
- };
1262
- var ansi2ansi = (n) => n;
1263
- var rgb2rgb = (r, g, b) => [r, g, b];
1264
- var setLazyProperty = (object, property, get) => {
1265
- Object.defineProperty(object, property, {
1266
- get: () => {
1267
- const value = get();
1268
- Object.defineProperty(object, property, {
1269
- value,
1270
- enumerable: true,
1271
- configurable: true
1272
- });
1273
- return value;
1274
- },
1275
- enumerable: true,
1276
- configurable: true
1277
- });
1278
- };
1279
- var colorConvert;
1280
- var makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
1281
- if (colorConvert === void 0) {
1282
- colorConvert = require_color_convert();
1283
- }
1284
- const offset = isBackground ? 10 : 0;
1285
- const styles = {};
1286
- for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
1287
- const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
1288
- if (sourceSpace === targetSpace) {
1289
- styles[name] = wrap(identity, offset);
1290
- } else if (typeof suite === "object") {
1291
- styles[name] = wrap(suite[targetSpace], offset);
1292
- }
1293
- }
1294
- return styles;
1295
- };
1296
- function assembleStyles() {
1297
- const codes = /* @__PURE__ */ new Map();
1298
- const styles = {
1299
- modifier: {
1300
- reset: [0, 0],
1301
- // 21 isn't widely supported and 22 does the same thing
1302
- bold: [1, 22],
1303
- dim: [2, 22],
1304
- italic: [3, 23],
1305
- underline: [4, 24],
1306
- inverse: [7, 27],
1307
- hidden: [8, 28],
1308
- strikethrough: [9, 29]
1309
- },
1310
- color: {
1311
- black: [30, 39],
1312
- red: [31, 39],
1313
- green: [32, 39],
1314
- yellow: [33, 39],
1315
- blue: [34, 39],
1316
- magenta: [35, 39],
1317
- cyan: [36, 39],
1318
- white: [37, 39],
1319
- // Bright color
1320
- blackBright: [90, 39],
1321
- redBright: [91, 39],
1322
- greenBright: [92, 39],
1323
- yellowBright: [93, 39],
1324
- blueBright: [94, 39],
1325
- magentaBright: [95, 39],
1326
- cyanBright: [96, 39],
1327
- whiteBright: [97, 39]
1328
- },
1329
- bgColor: {
1330
- bgBlack: [40, 49],
1331
- bgRed: [41, 49],
1332
- bgGreen: [42, 49],
1333
- bgYellow: [43, 49],
1334
- bgBlue: [44, 49],
1335
- bgMagenta: [45, 49],
1336
- bgCyan: [46, 49],
1337
- bgWhite: [47, 49],
1338
- // Bright color
1339
- bgBlackBright: [100, 49],
1340
- bgRedBright: [101, 49],
1341
- bgGreenBright: [102, 49],
1342
- bgYellowBright: [103, 49],
1343
- bgBlueBright: [104, 49],
1344
- bgMagentaBright: [105, 49],
1345
- bgCyanBright: [106, 49],
1346
- bgWhiteBright: [107, 49]
1347
- }
1348
- };
1349
- styles.color.gray = styles.color.blackBright;
1350
- styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
1351
- styles.color.grey = styles.color.blackBright;
1352
- styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
1353
- for (const [groupName, group] of Object.entries(styles)) {
1354
- for (const [styleName, style] of Object.entries(group)) {
1355
- styles[styleName] = {
1356
- open: `\x1B[${style[0]}m`,
1357
- close: `\x1B[${style[1]}m`
1358
- };
1359
- group[styleName] = styles[styleName];
1360
- codes.set(style[0], style[1]);
1361
- }
1362
- Object.defineProperty(styles, groupName, {
1363
- value: group,
1364
- enumerable: false
1365
- });
1366
- }
1367
- Object.defineProperty(styles, "codes", {
1368
- value: codes,
1369
- enumerable: false
1370
- });
1371
- styles.color.close = "\x1B[39m";
1372
- styles.bgColor.close = "\x1B[49m";
1373
- setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
1374
- setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
1375
- setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
1376
- setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
1377
- setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
1378
- setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
1379
- return styles;
1380
- }
1381
- Object.defineProperty(module, "exports", {
1382
- enumerable: true,
1383
- get: assembleStyles
1384
- });
1385
- }
1386
- });
1387
-
1388
- // node_modules/wrap-ansi/index.js
1389
- var require_wrap_ansi = __commonJS({
1390
- "node_modules/wrap-ansi/index.js"(exports, module) {
1391
- "use strict";
1392
- init_esm_shims();
1393
- var stringWidth = require_string_width();
1394
- var stripAnsi = require_strip_ansi();
1395
- var ansiStyles = require_ansi_styles();
1396
- var ESCAPES = /* @__PURE__ */ new Set([
1397
- "\x1B",
1398
- "\x9B"
1399
- ]);
1400
- var END_CODE = 39;
1401
- var wrapAnsi2 = (code) => `${ESCAPES.values().next().value}[${code}m`;
1402
- var wordLengths = (string) => string.split(" ").map((character) => stringWidth(character));
1403
- var wrapWord = (rows, word, columns) => {
1404
- const characters = [...word];
1405
- let isInsideEscape = false;
1406
- let visible = stringWidth(stripAnsi(rows[rows.length - 1]));
1407
- for (const [index, character] of characters.entries()) {
1408
- const characterLength = stringWidth(character);
1409
- if (visible + characterLength <= columns) {
1410
- rows[rows.length - 1] += character;
1411
- } else {
1412
- rows.push(character);
1413
- visible = 0;
1414
- }
1415
- if (ESCAPES.has(character)) {
1416
- isInsideEscape = true;
1417
- } else if (isInsideEscape && character === "m") {
1418
- isInsideEscape = false;
1419
- continue;
1420
- }
1421
- if (isInsideEscape) {
1422
- continue;
1423
- }
1424
- visible += characterLength;
1425
- if (visible === columns && index < characters.length - 1) {
1426
- rows.push("");
1427
- visible = 0;
1428
- }
1429
- }
1430
- if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) {
1431
- rows[rows.length - 2] += rows.pop();
1432
- }
1433
- };
1434
- var stringVisibleTrimSpacesRight = (str) => {
1435
- const words = str.split(" ");
1436
- let last = words.length;
1437
- while (last > 0) {
1438
- if (stringWidth(words[last - 1]) > 0) {
1439
- break;
1440
- }
1441
- last--;
1442
- }
1443
- if (last === words.length) {
1444
- return str;
1445
- }
1446
- return words.slice(0, last).join(" ") + words.slice(last).join("");
1447
- };
1448
- var exec = (string, columns, options = {}) => {
1449
- if (options.trim !== false && string.trim() === "") {
1450
- return "";
1451
- }
1452
- let pre = "";
1453
- let ret = "";
1454
- let escapeCode;
1455
- const lengths = wordLengths(string);
1456
- let rows = [""];
1457
- for (const [index, word] of string.split(" ").entries()) {
1458
- if (options.trim !== false) {
1459
- rows[rows.length - 1] = rows[rows.length - 1].trimLeft();
1460
- }
1461
- let rowLength = stringWidth(rows[rows.length - 1]);
1462
- if (index !== 0) {
1463
- if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
1464
- rows.push("");
1465
- rowLength = 0;
1466
- }
1467
- if (rowLength > 0 || options.trim === false) {
1468
- rows[rows.length - 1] += " ";
1469
- rowLength++;
1470
- }
1471
- }
1472
- if (options.hard && lengths[index] > columns) {
1473
- const remainingColumns = columns - rowLength;
1474
- const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
1475
- const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);
1476
- if (breaksStartingNextLine < breaksStartingThisLine) {
1477
- rows.push("");
1478
- }
1479
- wrapWord(rows, word, columns);
1480
- continue;
1481
- }
1482
- if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
1483
- if (options.wordWrap === false && rowLength < columns) {
1484
- wrapWord(rows, word, columns);
1485
- continue;
1486
- }
1487
- rows.push("");
1488
- }
1489
- if (rowLength + lengths[index] > columns && options.wordWrap === false) {
1490
- wrapWord(rows, word, columns);
1491
- continue;
1492
- }
1493
- rows[rows.length - 1] += word;
1494
- }
1495
- if (options.trim !== false) {
1496
- rows = rows.map(stringVisibleTrimSpacesRight);
1497
- }
1498
- pre = rows.join("\n");
1499
- for (const [index, character] of [...pre].entries()) {
1500
- ret += character;
1501
- if (ESCAPES.has(character)) {
1502
- const code2 = parseFloat(/\d[^m]*/.exec(pre.slice(index, index + 4)));
1503
- escapeCode = code2 === END_CODE ? null : code2;
1504
- }
1505
- const code = ansiStyles.codes.get(Number(escapeCode));
1506
- if (escapeCode && code) {
1507
- if (pre[index + 1] === "\n") {
1508
- ret += wrapAnsi2(code);
1509
- } else if (character === "\n") {
1510
- ret += wrapAnsi2(escapeCode);
1511
- }
1512
- }
1513
- }
1514
- return ret;
1515
- };
1516
- module.exports = (string, columns, options) => {
1517
- return String(string).normalize().replace(/\r\n/g, "\n").split("\n").map((line) => exec(line, columns, options)).join("\n");
1518
- };
1519
- }
1520
- });
1521
-
1522
- // node_modules/mute-stream/lib/index.js
1523
- var require_lib = __commonJS({
1524
- "node_modules/mute-stream/lib/index.js"(exports, module) {
1525
- "use strict";
1526
- init_esm_shims();
1527
- var Stream = __require("stream");
1528
- var MuteStream2 = class extends Stream {
1529
- #isTTY = null;
1530
- constructor(opts = {}) {
1531
- super(opts);
1532
- this.writable = this.readable = true;
1533
- this.muted = false;
1534
- this.on("pipe", this._onpipe);
1535
- this.replace = opts.replace;
1536
- this._prompt = opts.prompt || null;
1537
- this._hadControl = false;
1538
- }
1539
- #destSrc(key, def) {
1540
- if (this._dest) {
1541
- return this._dest[key];
1542
- }
1543
- if (this._src) {
1544
- return this._src[key];
1545
- }
1546
- return def;
1547
- }
1548
- #proxy(method, ...args) {
1549
- if (typeof this._dest?.[method] === "function") {
1550
- this._dest[method](...args);
1551
- }
1552
- if (typeof this._src?.[method] === "function") {
1553
- this._src[method](...args);
1554
- }
1555
- }
1556
- get isTTY() {
1557
- if (this.#isTTY !== null) {
1558
- return this.#isTTY;
1559
- }
1560
- return this.#destSrc("isTTY", false);
1561
- }
1562
- // basically just get replace the getter/setter with a regular value
1563
- set isTTY(val) {
1564
- this.#isTTY = val;
1565
- }
1566
- get rows() {
1567
- return this.#destSrc("rows");
1568
- }
1569
- get columns() {
1570
- return this.#destSrc("columns");
1571
- }
1572
- mute() {
1573
- this.muted = true;
1574
- }
1575
- unmute() {
1576
- this.muted = false;
1577
- }
1578
- _onpipe(src) {
1579
- this._src = src;
1580
- }
1581
- pipe(dest, options) {
1582
- this._dest = dest;
1583
- return super.pipe(dest, options);
1584
- }
1585
- pause() {
1586
- if (this._src) {
1587
- return this._src.pause();
1588
- }
1589
- }
1590
- resume() {
1591
- if (this._src) {
1592
- return this._src.resume();
1593
- }
1594
- }
1595
- write(c) {
1596
- if (this.muted) {
1597
- if (!this.replace) {
1598
- return true;
1599
- }
1600
- if (c.match(/^\u001b/)) {
1601
- if (c.indexOf(this._prompt) === 0) {
1602
- c = c.slice(this._prompt.length);
1603
- c = c.replace(/./g, this.replace);
1604
- c = this._prompt + c;
1605
- }
1606
- this._hadControl = true;
1607
- return this.emit("data", c);
1608
- } else {
1609
- if (this._prompt && this._hadControl && c.indexOf(this._prompt) === 0) {
1610
- this._hadControl = false;
1611
- this.emit("data", this._prompt);
1612
- c = c.slice(this._prompt.length);
1613
- }
1614
- c = c.toString().replace(/./g, this.replace);
1615
- }
1616
- }
1617
- this.emit("data", c);
1618
- }
1619
- end(c) {
1620
- if (this.muted) {
1621
- if (c && this.replace) {
1622
- c = c.toString().replace(/./g, this.replace);
1623
- } else {
1624
- c = null;
1625
- }
1626
- }
1627
- if (c) {
1628
- this.emit("data", c);
1629
- }
1630
- this.emit("end");
1631
- }
1632
- destroy(...args) {
1633
- return this.#proxy("destroy", ...args);
1634
- }
1635
- destroySoon(...args) {
1636
- return this.#proxy("destroySoon", ...args);
1637
- }
1638
- close(...args) {
1639
- return this.#proxy("close", ...args);
1640
- }
1641
- };
1642
- module.exports = MuteStream2;
1643
- }
1644
- });
1645
-
1646
- // src/cli.ts
1647
- init_esm_shims();
1648
- import { checkbox, select, input, confirm } from "@inquirer/prompts";
1649
-
1650
- // node_modules/@inquirer/core/dist/esm/index.js
1651
- init_esm_shims();
1652
-
1653
- // node_modules/@inquirer/core/dist/esm/lib/key.js
1654
- init_esm_shims();
1655
-
1656
- // node_modules/@inquirer/core/dist/esm/lib/errors.js
1657
- init_esm_shims();
1658
- var AbortPromptError = class extends Error {
1659
- name = "AbortPromptError";
1660
- message = "Prompt was aborted";
1661
- constructor(options) {
1662
- super();
1663
- this.cause = options?.cause;
1664
- }
1665
- };
1666
- var ExitPromptError = class extends Error {
1667
- name = "ExitPromptError";
1668
- };
1669
-
1670
- // node_modules/@inquirer/core/dist/esm/lib/use-prefix.js
1671
- init_esm_shims();
1672
-
1673
- // node_modules/@inquirer/core/dist/esm/lib/use-state.js
1674
- init_esm_shims();
1675
- import { AsyncResource as AsyncResource2 } from "async_hooks";
1676
-
1677
- // node_modules/@inquirer/core/dist/esm/lib/hook-engine.js
1678
- init_esm_shims();
1679
- import { AsyncLocalStorage, AsyncResource } from "async_hooks";
1680
- var hookStorage = new AsyncLocalStorage();
1681
-
1682
- // node_modules/@inquirer/core/dist/esm/lib/use-effect.js
1683
- init_esm_shims();
1684
-
1685
- // node_modules/@inquirer/core/dist/esm/lib/make-theme.js
1686
- init_esm_shims();
1687
-
1688
- // node_modules/@inquirer/core/dist/esm/lib/theme.js
1689
- init_esm_shims();
1690
- var import_yoctocolors_cjs = __toESM(require_yoctocolors_cjs(), 1);
1691
-
1692
- // node_modules/@inquirer/figures/dist/esm/index.js
1693
- init_esm_shims();
1694
- import process2 from "process";
1695
- function isUnicodeSupported() {
1696
- if (process2.platform !== "win32") {
1697
- return process2.env["TERM"] !== "linux";
1698
- }
1699
- return Boolean(process2.env["WT_SESSION"]) || // Windows Terminal
1700
- Boolean(process2.env["TERMINUS_SUBLIME"]) || // Terminus (<0.2.27)
1701
- process2.env["ConEmuTask"] === "{cmd::Cmder}" || // ConEmu and cmder
1702
- process2.env["TERM_PROGRAM"] === "Terminus-Sublime" || process2.env["TERM_PROGRAM"] === "vscode" || process2.env["TERM"] === "xterm-256color" || process2.env["TERM"] === "alacritty" || process2.env["TERMINAL_EMULATOR"] === "JetBrains-JediTerm";
1703
- }
1704
- var common = {
1705
- circleQuestionMark: "(?)",
1706
- questionMarkPrefix: "(?)",
1707
- square: "\u2588",
1708
- squareDarkShade: "\u2593",
1709
- squareMediumShade: "\u2592",
1710
- squareLightShade: "\u2591",
1711
- squareTop: "\u2580",
1712
- squareBottom: "\u2584",
1713
- squareLeft: "\u258C",
1714
- squareRight: "\u2590",
1715
- squareCenter: "\u25A0",
1716
- bullet: "\u25CF",
1717
- dot: "\u2024",
1718
- ellipsis: "\u2026",
1719
- pointerSmall: "\u203A",
1720
- triangleUp: "\u25B2",
1721
- triangleUpSmall: "\u25B4",
1722
- triangleDown: "\u25BC",
1723
- triangleDownSmall: "\u25BE",
1724
- triangleLeftSmall: "\u25C2",
1725
- triangleRightSmall: "\u25B8",
1726
- home: "\u2302",
1727
- heart: "\u2665",
1728
- musicNote: "\u266A",
1729
- musicNoteBeamed: "\u266B",
1730
- arrowUp: "\u2191",
1731
- arrowDown: "\u2193",
1732
- arrowLeft: "\u2190",
1733
- arrowRight: "\u2192",
1734
- arrowLeftRight: "\u2194",
1735
- arrowUpDown: "\u2195",
1736
- almostEqual: "\u2248",
1737
- notEqual: "\u2260",
1738
- lessOrEqual: "\u2264",
1739
- greaterOrEqual: "\u2265",
1740
- identical: "\u2261",
1741
- infinity: "\u221E",
1742
- subscriptZero: "\u2080",
1743
- subscriptOne: "\u2081",
1744
- subscriptTwo: "\u2082",
1745
- subscriptThree: "\u2083",
1746
- subscriptFour: "\u2084",
1747
- subscriptFive: "\u2085",
1748
- subscriptSix: "\u2086",
1749
- subscriptSeven: "\u2087",
1750
- subscriptEight: "\u2088",
1751
- subscriptNine: "\u2089",
1752
- oneHalf: "\xBD",
1753
- oneThird: "\u2153",
1754
- oneQuarter: "\xBC",
1755
- oneFifth: "\u2155",
1756
- oneSixth: "\u2159",
1757
- oneEighth: "\u215B",
1758
- twoThirds: "\u2154",
1759
- twoFifths: "\u2156",
1760
- threeQuarters: "\xBE",
1761
- threeFifths: "\u2157",
1762
- threeEighths: "\u215C",
1763
- fourFifths: "\u2158",
1764
- fiveSixths: "\u215A",
1765
- fiveEighths: "\u215D",
1766
- sevenEighths: "\u215E",
1767
- line: "\u2500",
1768
- lineBold: "\u2501",
1769
- lineDouble: "\u2550",
1770
- lineDashed0: "\u2504",
1771
- lineDashed1: "\u2505",
1772
- lineDashed2: "\u2508",
1773
- lineDashed3: "\u2509",
1774
- lineDashed4: "\u254C",
1775
- lineDashed5: "\u254D",
1776
- lineDashed6: "\u2574",
1777
- lineDashed7: "\u2576",
1778
- lineDashed8: "\u2578",
1779
- lineDashed9: "\u257A",
1780
- lineDashed10: "\u257C",
1781
- lineDashed11: "\u257E",
1782
- lineDashed12: "\u2212",
1783
- lineDashed13: "\u2013",
1784
- lineDashed14: "\u2010",
1785
- lineDashed15: "\u2043",
1786
- lineVertical: "\u2502",
1787
- lineVerticalBold: "\u2503",
1788
- lineVerticalDouble: "\u2551",
1789
- lineVerticalDashed0: "\u2506",
1790
- lineVerticalDashed1: "\u2507",
1791
- lineVerticalDashed2: "\u250A",
1792
- lineVerticalDashed3: "\u250B",
1793
- lineVerticalDashed4: "\u254E",
1794
- lineVerticalDashed5: "\u254F",
1795
- lineVerticalDashed6: "\u2575",
1796
- lineVerticalDashed7: "\u2577",
1797
- lineVerticalDashed8: "\u2579",
1798
- lineVerticalDashed9: "\u257B",
1799
- lineVerticalDashed10: "\u257D",
1800
- lineVerticalDashed11: "\u257F",
1801
- lineDownLeft: "\u2510",
1802
- lineDownLeftArc: "\u256E",
1803
- lineDownBoldLeftBold: "\u2513",
1804
- lineDownBoldLeft: "\u2512",
1805
- lineDownLeftBold: "\u2511",
1806
- lineDownDoubleLeftDouble: "\u2557",
1807
- lineDownDoubleLeft: "\u2556",
1808
- lineDownLeftDouble: "\u2555",
1809
- lineDownRight: "\u250C",
1810
- lineDownRightArc: "\u256D",
1811
- lineDownBoldRightBold: "\u250F",
1812
- lineDownBoldRight: "\u250E",
1813
- lineDownRightBold: "\u250D",
1814
- lineDownDoubleRightDouble: "\u2554",
1815
- lineDownDoubleRight: "\u2553",
1816
- lineDownRightDouble: "\u2552",
1817
- lineUpLeft: "\u2518",
1818
- lineUpLeftArc: "\u256F",
1819
- lineUpBoldLeftBold: "\u251B",
1820
- lineUpBoldLeft: "\u251A",
1821
- lineUpLeftBold: "\u2519",
1822
- lineUpDoubleLeftDouble: "\u255D",
1823
- lineUpDoubleLeft: "\u255C",
1824
- lineUpLeftDouble: "\u255B",
1825
- lineUpRight: "\u2514",
1826
- lineUpRightArc: "\u2570",
1827
- lineUpBoldRightBold: "\u2517",
1828
- lineUpBoldRight: "\u2516",
1829
- lineUpRightBold: "\u2515",
1830
- lineUpDoubleRightDouble: "\u255A",
1831
- lineUpDoubleRight: "\u2559",
1832
- lineUpRightDouble: "\u2558",
1833
- lineUpDownLeft: "\u2524",
1834
- lineUpBoldDownBoldLeftBold: "\u252B",
1835
- lineUpBoldDownBoldLeft: "\u2528",
1836
- lineUpDownLeftBold: "\u2525",
1837
- lineUpBoldDownLeftBold: "\u2529",
1838
- lineUpDownBoldLeftBold: "\u252A",
1839
- lineUpDownBoldLeft: "\u2527",
1840
- lineUpBoldDownLeft: "\u2526",
1841
- lineUpDoubleDownDoubleLeftDouble: "\u2563",
1842
- lineUpDoubleDownDoubleLeft: "\u2562",
1843
- lineUpDownLeftDouble: "\u2561",
1844
- lineUpDownRight: "\u251C",
1845
- lineUpBoldDownBoldRightBold: "\u2523",
1846
- lineUpBoldDownBoldRight: "\u2520",
1847
- lineUpDownRightBold: "\u251D",
1848
- lineUpBoldDownRightBold: "\u2521",
1849
- lineUpDownBoldRightBold: "\u2522",
1850
- lineUpDownBoldRight: "\u251F",
1851
- lineUpBoldDownRight: "\u251E",
1852
- lineUpDoubleDownDoubleRightDouble: "\u2560",
1853
- lineUpDoubleDownDoubleRight: "\u255F",
1854
- lineUpDownRightDouble: "\u255E",
1855
- lineDownLeftRight: "\u252C",
1856
- lineDownBoldLeftBoldRightBold: "\u2533",
1857
- lineDownLeftBoldRightBold: "\u252F",
1858
- lineDownBoldLeftRight: "\u2530",
1859
- lineDownBoldLeftBoldRight: "\u2531",
1860
- lineDownBoldLeftRightBold: "\u2532",
1861
- lineDownLeftRightBold: "\u252E",
1862
- lineDownLeftBoldRight: "\u252D",
1863
- lineDownDoubleLeftDoubleRightDouble: "\u2566",
1864
- lineDownDoubleLeftRight: "\u2565",
1865
- lineDownLeftDoubleRightDouble: "\u2564",
1866
- lineUpLeftRight: "\u2534",
1867
- lineUpBoldLeftBoldRightBold: "\u253B",
1868
- lineUpLeftBoldRightBold: "\u2537",
1869
- lineUpBoldLeftRight: "\u2538",
1870
- lineUpBoldLeftBoldRight: "\u2539",
1871
- lineUpBoldLeftRightBold: "\u253A",
1872
- lineUpLeftRightBold: "\u2536",
1873
- lineUpLeftBoldRight: "\u2535",
1874
- lineUpDoubleLeftDoubleRightDouble: "\u2569",
1875
- lineUpDoubleLeftRight: "\u2568",
1876
- lineUpLeftDoubleRightDouble: "\u2567",
1877
- lineUpDownLeftRight: "\u253C",
1878
- lineUpBoldDownBoldLeftBoldRightBold: "\u254B",
1879
- lineUpDownBoldLeftBoldRightBold: "\u2548",
1880
- lineUpBoldDownLeftBoldRightBold: "\u2547",
1881
- lineUpBoldDownBoldLeftRightBold: "\u254A",
1882
- lineUpBoldDownBoldLeftBoldRight: "\u2549",
1883
- lineUpBoldDownLeftRight: "\u2540",
1884
- lineUpDownBoldLeftRight: "\u2541",
1885
- lineUpDownLeftBoldRight: "\u253D",
1886
- lineUpDownLeftRightBold: "\u253E",
1887
- lineUpBoldDownBoldLeftRight: "\u2542",
1888
- lineUpDownLeftBoldRightBold: "\u253F",
1889
- lineUpBoldDownLeftBoldRight: "\u2543",
1890
- lineUpBoldDownLeftRightBold: "\u2544",
1891
- lineUpDownBoldLeftBoldRight: "\u2545",
1892
- lineUpDownBoldLeftRightBold: "\u2546",
1893
- lineUpDoubleDownDoubleLeftDoubleRightDouble: "\u256C",
1894
- lineUpDoubleDownDoubleLeftRight: "\u256B",
1895
- lineUpDownLeftDoubleRightDouble: "\u256A",
1896
- lineCross: "\u2573",
1897
- lineBackslash: "\u2572",
1898
- lineSlash: "\u2571"
1899
- };
1900
- var specialMainSymbols = {
1901
- tick: "\u2714",
1902
- info: "\u2139",
1903
- warning: "\u26A0",
1904
- cross: "\u2718",
1905
- squareSmall: "\u25FB",
1906
- squareSmallFilled: "\u25FC",
1907
- circle: "\u25EF",
1908
- circleFilled: "\u25C9",
1909
- circleDotted: "\u25CC",
1910
- circleDouble: "\u25CE",
1911
- circleCircle: "\u24DE",
1912
- circleCross: "\u24E7",
1913
- circlePipe: "\u24BE",
1914
- radioOn: "\u25C9",
1915
- radioOff: "\u25EF",
1916
- checkboxOn: "\u2612",
1917
- checkboxOff: "\u2610",
1918
- checkboxCircleOn: "\u24E7",
1919
- checkboxCircleOff: "\u24BE",
1920
- pointer: "\u276F",
1921
- triangleUpOutline: "\u25B3",
1922
- triangleLeft: "\u25C0",
1923
- triangleRight: "\u25B6",
1924
- lozenge: "\u25C6",
1925
- lozengeOutline: "\u25C7",
1926
- hamburger: "\u2630",
1927
- smiley: "\u32E1",
1928
- mustache: "\u0DF4",
1929
- star: "\u2605",
1930
- play: "\u25B6",
1931
- nodejs: "\u2B22",
1932
- oneSeventh: "\u2150",
1933
- oneNinth: "\u2151",
1934
- oneTenth: "\u2152"
1935
- };
1936
- var specialFallbackSymbols = {
1937
- tick: "\u221A",
1938
- info: "i",
1939
- warning: "\u203C",
1940
- cross: "\xD7",
1941
- squareSmall: "\u25A1",
1942
- squareSmallFilled: "\u25A0",
1943
- circle: "( )",
1944
- circleFilled: "(*)",
1945
- circleDotted: "( )",
1946
- circleDouble: "( )",
1947
- circleCircle: "(\u25CB)",
1948
- circleCross: "(\xD7)",
1949
- circlePipe: "(\u2502)",
1950
- radioOn: "(*)",
1951
- radioOff: "( )",
1952
- checkboxOn: "[\xD7]",
1953
- checkboxOff: "[ ]",
1954
- checkboxCircleOn: "(\xD7)",
1955
- checkboxCircleOff: "( )",
1956
- pointer: ">",
1957
- triangleUpOutline: "\u2206",
1958
- triangleLeft: "\u25C4",
1959
- triangleRight: "\u25BA",
1960
- lozenge: "\u2666",
1961
- lozengeOutline: "\u25CA",
1962
- hamburger: "\u2261",
1963
- smiley: "\u263A",
1964
- mustache: "\u250C\u2500\u2510",
1965
- star: "\u2736",
1966
- play: "\u25BA",
1967
- nodejs: "\u2666",
1968
- oneSeventh: "1/7",
1969
- oneNinth: "1/9",
1970
- oneTenth: "1/10"
1971
- };
1972
- var mainSymbols = {
1973
- ...common,
1974
- ...specialMainSymbols
1975
- };
1976
- var fallbackSymbols = {
1977
- ...common,
1978
- ...specialFallbackSymbols
1979
- };
1980
- var shouldUseMain = isUnicodeSupported();
1981
- var figures = shouldUseMain ? mainSymbols : fallbackSymbols;
1982
- var esm_default = figures;
1983
- var replacements = Object.entries(specialMainSymbols);
1984
-
1985
- // node_modules/@inquirer/core/dist/esm/lib/theme.js
1986
- var defaultTheme = {
1987
- prefix: {
1988
- idle: import_yoctocolors_cjs.default.blue("?"),
1989
- done: import_yoctocolors_cjs.default.green(esm_default.tick)
1990
- },
1991
- spinner: {
1992
- interval: 80,
1993
- frames: ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"].map((frame) => import_yoctocolors_cjs.default.yellow(frame))
1994
- },
1995
- style: {
1996
- answer: import_yoctocolors_cjs.default.cyan,
1997
- message: import_yoctocolors_cjs.default.bold,
1998
- error: (text) => import_yoctocolors_cjs.default.red(`> ${text}`),
1999
- defaultAnswer: (text) => import_yoctocolors_cjs.default.dim(`(${text})`),
2000
- help: import_yoctocolors_cjs.default.dim,
2001
- highlight: import_yoctocolors_cjs.default.cyan,
2002
- key: (text) => import_yoctocolors_cjs.default.cyan(import_yoctocolors_cjs.default.bold(`<${text}>`))
2003
- }
2004
- };
2005
-
2006
- // node_modules/@inquirer/core/dist/esm/lib/use-memo.js
2007
- init_esm_shims();
2008
-
2009
- // node_modules/@inquirer/core/dist/esm/lib/use-ref.js
2010
- init_esm_shims();
2011
-
2012
- // node_modules/@inquirer/core/dist/esm/lib/use-keypress.js
2013
- init_esm_shims();
2014
-
2015
- // node_modules/@inquirer/core/dist/esm/lib/pagination/use-pagination.js
2016
- init_esm_shims();
2017
-
2018
- // node_modules/@inquirer/core/dist/esm/lib/utils.js
2019
- init_esm_shims();
2020
- var import_cli_width = __toESM(require_cli_width(), 1);
2021
- var import_wrap_ansi = __toESM(require_wrap_ansi(), 1);
2022
-
2023
- // node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
2024
- init_esm_shims();
2025
- var import_mute_stream = __toESM(require_lib(), 1);
2026
- import * as readline2 from "readline";
2027
- import { AsyncResource as AsyncResource3 } from "async_hooks";
2028
-
2029
- // node_modules/signal-exit/dist/mjs/index.js
2030
- init_esm_shims();
2031
-
2032
- // node_modules/signal-exit/dist/mjs/signals.js
2033
- init_esm_shims();
2034
- var signals = [];
2035
- signals.push("SIGHUP", "SIGINT", "SIGTERM");
2036
- if (process.platform !== "win32") {
2037
- signals.push(
2038
- "SIGALRM",
2039
- "SIGABRT",
2040
- "SIGVTALRM",
2041
- "SIGXCPU",
2042
- "SIGXFSZ",
2043
- "SIGUSR2",
2044
- "SIGTRAP",
2045
- "SIGSYS",
2046
- "SIGQUIT",
2047
- "SIGIOT"
2048
- // should detect profiler and enable/disable accordingly.
2049
- // see #21
2050
- // 'SIGPROF'
2051
- );
2052
- }
2053
- if (process.platform === "linux") {
2054
- signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
2055
- }
2056
-
2057
- // node_modules/signal-exit/dist/mjs/index.js
2058
- var processOk = (process4) => !!process4 && typeof process4 === "object" && typeof process4.removeListener === "function" && typeof process4.emit === "function" && typeof process4.reallyExit === "function" && typeof process4.listeners === "function" && typeof process4.kill === "function" && typeof process4.pid === "number" && typeof process4.on === "function";
2059
- var kExitEmitter = /* @__PURE__ */ Symbol.for("signal-exit emitter");
2060
- var global = globalThis;
2061
- var ObjectDefineProperty = Object.defineProperty.bind(Object);
2062
- var Emitter = class {
2063
- emitted = {
2064
- afterExit: false,
2065
- exit: false
2066
- };
2067
- listeners = {
2068
- afterExit: [],
2069
- exit: []
2070
- };
2071
- count = 0;
2072
- id = Math.random();
2073
- constructor() {
2074
- if (global[kExitEmitter]) {
2075
- return global[kExitEmitter];
2076
- }
2077
- ObjectDefineProperty(global, kExitEmitter, {
2078
- value: this,
2079
- writable: false,
2080
- enumerable: false,
2081
- configurable: false
2082
- });
2083
- }
2084
- on(ev, fn) {
2085
- this.listeners[ev].push(fn);
2086
- }
2087
- removeListener(ev, fn) {
2088
- const list = this.listeners[ev];
2089
- const i = list.indexOf(fn);
2090
- if (i === -1) {
2091
- return;
2092
- }
2093
- if (i === 0 && list.length === 1) {
2094
- list.length = 0;
2095
- } else {
2096
- list.splice(i, 1);
2097
- }
2098
- }
2099
- emit(ev, code, signal) {
2100
- if (this.emitted[ev]) {
2101
- return false;
2102
- }
2103
- this.emitted[ev] = true;
2104
- let ret = false;
2105
- for (const fn of this.listeners[ev]) {
2106
- ret = fn(code, signal) === true || ret;
2107
- }
2108
- if (ev === "exit") {
2109
- ret = this.emit("afterExit", code, signal) || ret;
2110
- }
2111
- return ret;
2112
- }
2113
- };
2114
- var SignalExitBase = class {
2115
- };
2116
- var signalExitWrap = (handler) => {
2117
- return {
2118
- onExit(cb, opts) {
2119
- return handler.onExit(cb, opts);
2120
- },
2121
- load() {
2122
- return handler.load();
2123
- },
2124
- unload() {
2125
- return handler.unload();
2126
- }
2127
- };
2128
- };
2129
- var SignalExitFallback = class extends SignalExitBase {
2130
- onExit() {
2131
- return () => {
2132
- };
2133
- }
2134
- load() {
2135
- }
2136
- unload() {
2137
- }
2138
- };
2139
- var SignalExit = class extends SignalExitBase {
2140
- // "SIGHUP" throws an `ENOSYS` error on Windows,
2141
- // so use a supported signal instead
2142
- /* c8 ignore start */
2143
- #hupSig = process3.platform === "win32" ? "SIGINT" : "SIGHUP";
2144
- /* c8 ignore stop */
2145
- #emitter = new Emitter();
2146
- #process;
2147
- #originalProcessEmit;
2148
- #originalProcessReallyExit;
2149
- #sigListeners = {};
2150
- #loaded = false;
2151
- constructor(process4) {
2152
- super();
2153
- this.#process = process4;
2154
- this.#sigListeners = {};
2155
- for (const sig of signals) {
2156
- this.#sigListeners[sig] = () => {
2157
- const listeners = this.#process.listeners(sig);
2158
- let { count } = this.#emitter;
2159
- const p = process4;
2160
- if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
2161
- count += p.__signal_exit_emitter__.count;
2162
- }
2163
- if (listeners.length === count) {
2164
- this.unload();
2165
- const ret = this.#emitter.emit("exit", null, sig);
2166
- const s = sig === "SIGHUP" ? this.#hupSig : sig;
2167
- if (!ret)
2168
- process4.kill(process4.pid, s);
2169
- }
2170
- };
2171
- }
2172
- this.#originalProcessReallyExit = process4.reallyExit;
2173
- this.#originalProcessEmit = process4.emit;
2174
- }
2175
- onExit(cb, opts) {
2176
- if (!processOk(this.#process)) {
2177
- return () => {
2178
- };
2179
- }
2180
- if (this.#loaded === false) {
2181
- this.load();
2182
- }
2183
- const ev = opts?.alwaysLast ? "afterExit" : "exit";
2184
- this.#emitter.on(ev, cb);
2185
- return () => {
2186
- this.#emitter.removeListener(ev, cb);
2187
- if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) {
2188
- this.unload();
2189
- }
2190
- };
2191
- }
2192
- load() {
2193
- if (this.#loaded) {
2194
- return;
2195
- }
2196
- this.#loaded = true;
2197
- this.#emitter.count += 1;
2198
- for (const sig of signals) {
2199
- try {
2200
- const fn = this.#sigListeners[sig];
2201
- if (fn)
2202
- this.#process.on(sig, fn);
2203
- } catch (_) {
2204
- }
2205
- }
2206
- this.#process.emit = (ev, ...a) => {
2207
- return this.#processEmit(ev, ...a);
2208
- };
2209
- this.#process.reallyExit = (code) => {
2210
- return this.#processReallyExit(code);
2211
- };
2212
- }
2213
- unload() {
2214
- if (!this.#loaded) {
2215
- return;
2216
- }
2217
- this.#loaded = false;
2218
- signals.forEach((sig) => {
2219
- const listener = this.#sigListeners[sig];
2220
- if (!listener) {
2221
- throw new Error("Listener not defined for signal: " + sig);
2222
- }
2223
- try {
2224
- this.#process.removeListener(sig, listener);
2225
- } catch (_) {
2226
- }
2227
- });
2228
- this.#process.emit = this.#originalProcessEmit;
2229
- this.#process.reallyExit = this.#originalProcessReallyExit;
2230
- this.#emitter.count -= 1;
2231
- }
2232
- #processReallyExit(code) {
2233
- if (!processOk(this.#process)) {
2234
- return 0;
2235
- }
2236
- this.#process.exitCode = code || 0;
2237
- this.#emitter.emit("exit", this.#process.exitCode, null);
2238
- return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
2239
- }
2240
- #processEmit(ev, ...args) {
2241
- const og = this.#originalProcessEmit;
2242
- if (ev === "exit" && processOk(this.#process)) {
2243
- if (typeof args[0] === "number") {
2244
- this.#process.exitCode = args[0];
2245
- }
2246
- const ret = og.call(this.#process, ev, ...args);
2247
- this.#emitter.emit("exit", this.#process.exitCode, null);
2248
- return ret;
2249
- } else {
2250
- return og.call(this.#process, ev, ...args);
2251
- }
2252
- }
2253
- };
2254
- var process3 = globalThis.process;
2255
- var {
2256
- /**
2257
- * Called when the process is exiting, whether via signal, explicit
2258
- * exit, or running out of stuff to do.
2259
- *
2260
- * If the global process object is not suitable for instrumentation,
2261
- * then this will be a no-op.
2262
- *
2263
- * Returns a function that may be used to unload signal-exit.
2264
- */
2265
- onExit,
2266
- /**
2267
- * Load the listeners. Likely you never need to call this, unless
2268
- * doing a rather deep integration with signal-exit functionality.
2269
- * Mostly exposed for the benefit of testing.
2270
- *
2271
- * @internal
2272
- */
2273
- load,
2274
- /**
2275
- * Unload the listeners. Likely you never need to call this, unless
2276
- * doing a rather deep integration with signal-exit functionality.
2277
- * Mostly exposed for the benefit of testing.
2278
- *
2279
- * @internal
2280
- */
2281
- unload
2282
- } = signalExitWrap(processOk(process3) ? new SignalExit(process3) : new SignalExitFallback());
2283
-
2284
- // node_modules/@inquirer/core/dist/esm/lib/screen-manager.js
2285
- init_esm_shims();
2286
- import { stripVTControlCharacters } from "util";
2287
-
2288
- // node_modules/@inquirer/ansi/dist/esm/index.js
2289
- init_esm_shims();
2290
- var ESC = "\x1B[";
2291
- var cursorLeft = ESC + "G";
2292
- var cursorHide = ESC + "?25l";
2293
- var cursorShow = ESC + "?25h";
2294
- var eraseLine = ESC + "2K";
2295
-
2296
- // node_modules/@inquirer/core/dist/esm/lib/promise-polyfill.js
2297
- init_esm_shims();
2298
-
2299
- // node_modules/@inquirer/core/dist/esm/lib/Separator.js
2300
- init_esm_shims();
2301
-
2302
- // src/cli.ts
2303
- import chalk from "chalk";
2304
- import ora from "ora";
2305
- import { join as join2 } from "path";
2306
-
2307
- // src/installers/statusline.ts
2308
- init_esm_shims();
2309
- import { join } from "path";
2310
- import { chmod } from "fs/promises";
2311
- async function installStatusline() {
2312
- const src = join(getAssetsDir(), "statusline", "statusline.sh");
2313
- const dest = join(getGlobalDir(), "statusline.sh");
2314
- await backupIfExists(dest);
2315
- await copyFileUtil(src, dest);
2316
- await chmod(dest, 493);
2317
- }
2318
-
2319
- // src/cli.ts
2320
- var BACK = /* @__PURE__ */ Symbol("BACK");
2321
- var STEP_SCOPE = 0;
2322
- var STEP_CATEGORIES = 1;
2323
- var STEP_ITEMS = 2;
2324
- var STEP_CONFIRM = 3;
2325
- async function withEsc(promptFn) {
2326
- const ac = new AbortController();
2327
- const onData = (data) => {
2328
- if (data.length === 1 && data[0] === 27) {
2329
- ac.abort();
2330
- }
2331
- };
2332
- process.stdin.on("data", onData);
2333
- try {
2334
- return await promptFn({ signal: ac.signal });
2335
- } catch (err) {
2336
- if (err instanceof AbortPromptError) {
2337
- return BACK;
2338
- }
2339
- throw err;
2340
- } finally {
2341
- process.stdin.removeListener("data", onData);
2342
- }
2343
- }
2344
- function printBanner() {
2345
- console.log(
2346
- chalk.cyan.bold(`
2347
- \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557
2348
- \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2551 \u2588\u2588\u2554\u255D\u2588\u2588\u2551\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D
2349
- \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2551 \u2588\u2588\u2551
2350
- \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2551
2351
- \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551
2352
- \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D
2353
- `)
2354
- );
2355
- console.log(chalk.gray(" Claude Code Harness Installer"));
2356
- console.log(chalk.gray(" ESC: back / Ctrl+C: exit\n"));
2357
- }
2358
- function createEmptyPlan(scope) {
2359
- return {
2360
- scope,
2361
- agents: [],
2362
- skills: [],
2363
- commands: [],
2364
- hooks: [],
2365
- ruleCategories: [],
2366
- mcps: [],
2367
- mcpEnvValues: /* @__PURE__ */ new Map(),
2368
- claudemds: [],
2369
- statusline: false
2370
- };
2371
- }
2372
- async function runCli() {
2373
- printBanner();
2374
- let step = STEP_SCOPE;
2375
- let scope = "global";
2376
- let targetDir = "";
2377
- let selectedCategories = [];
2378
- let plan = createEmptyPlan(scope);
2379
- let skippedMcps = /* @__PURE__ */ new Map();
2380
- try {
2381
- while (step <= STEP_CONFIRM) {
2382
- switch (step) {
2383
- // ── Step 0: 설치 범위 선택 ──
2384
- case STEP_SCOPE: {
2385
- const result = await withEsc(
2386
- (ctx) => select({
2387
- message: "Install scope:",
2388
- choices: [
2389
- {
2390
- name: `Global ${chalk.gray("~/.claude/")}`,
2391
- value: "global"
2392
- },
2393
- {
2394
- name: `Project ${chalk.gray("./.claude/")}`,
2395
- value: "project"
2396
- }
2397
- ]
2398
- }, ctx)
2399
- );
2400
- if (result === BACK) {
2401
- console.log(chalk.yellow("\n Exiting."));
2402
- return;
2403
- }
2404
- scope = result;
2405
- targetDir = scope === "global" ? getGlobalDir() : getProjectDir();
2406
- step = STEP_CATEGORIES;
2407
- break;
2408
- }
2409
- // ── Step 1: 카테고리 멀티셀렉트 ──
2410
- case STEP_CATEGORIES: {
2411
- const result = await withEsc(
2412
- (ctx) => checkbox({
2413
- message: "Select categories to install:",
2414
- choices: [
2415
- { name: "Agents - AI sub-agents", value: "agents" },
2416
- { name: "Skills - Reusable skill prompts", value: "skills" },
2417
- { name: "Commands - Slash commands", value: "commands" },
2418
- { name: "Hooks - Post-tool hooks", value: "hooks" },
2419
- { name: "Rules - CLAUDE.md rules", value: "rules" },
2420
- { name: "MCPs - MCP server configs", value: "mcps" },
2421
- { name: "ClaudeMd - Behavioral guidelines", value: "claudemd" },
2422
- { name: "Statusline - Terminal statusline script", value: "statusline" }
2423
- ]
2424
- }, ctx)
2425
- );
2426
- if (result === BACK) {
2427
- step = STEP_SCOPE;
2428
- break;
2429
- }
2430
- if (result.length === 0) {
2431
- console.log(chalk.yellow("\n No categories selected.\n"));
2432
- break;
2433
- }
2434
- selectedCategories = result;
2435
- plan = createEmptyPlan(scope);
2436
- skippedMcps = /* @__PURE__ */ new Map();
2437
- step = STEP_ITEMS;
2438
- break;
2439
- }
2440
- // ── Step 2: 각 카테고리별 항목 선택 ──
2441
- case STEP_ITEMS: {
2442
- let wentBack = false;
2443
- for (const cat of selectedCategories) {
2444
- if (cat === "statusline") {
2445
- plan.statusline = true;
2446
- continue;
2447
- }
2448
- if (cat === "agents") {
2449
- const allAgents = await getAgents();
2450
- const result = await withEsc(
2451
- (ctx) => checkbox({
2452
- message: "Select agents:",
2453
- choices: allAgents.map((a) => ({
2454
- name: `${chalk.bold(a.name.padEnd(30))} ${chalk.gray(a.description.slice(0, 60))}`,
2455
- value: a,
2456
- checked: false
2457
- }))
2458
- }, ctx)
2459
- );
2460
- if (result === BACK) {
2461
- wentBack = true;
2462
- break;
2463
- }
2464
- plan.agents = result;
2465
- }
2466
- if (cat === "skills") {
2467
- const allSkills = await getSkills();
2468
- const result = await withEsc(
2469
- (ctx) => checkbox({
2470
- message: "Select skills:",
2471
- choices: allSkills.map((s) => ({
2472
- name: `${chalk.bold(s.name.padEnd(35))} ${chalk.gray(s.description.slice(0, 55))}`,
2473
- value: s,
2474
- checked: false
2475
- }))
2476
- }, ctx)
2477
- );
2478
- if (result === BACK) {
2479
- wentBack = true;
2480
- break;
2481
- }
2482
- plan.skills = result;
2483
- }
2484
- if (cat === "commands") {
2485
- const allCommands = await getCommands();
2486
- const result = await withEsc(
2487
- (ctx) => checkbox({
2488
- message: "Select commands:",
2489
- choices: allCommands.map((c) => ({
2490
- name: `${chalk.bold(c.name.padEnd(25))} ${chalk.gray(c.description.slice(0, 65))}`,
2491
- value: c,
2492
- checked: false
2493
- }))
2494
- }, ctx)
2495
- );
2496
- if (result === BACK) {
2497
- wentBack = true;
2498
- break;
2499
- }
2500
- plan.commands = result;
2501
- }
2502
- if (cat === "hooks") {
2503
- const allHooks = await getHooks();
2504
- const result = await withEsc(
2505
- (ctx) => checkbox({
2506
- message: "Select hooks:",
2507
- choices: allHooks.map((h) => ({
2508
- name: `${chalk.bold(h.name.padEnd(35))} ${chalk.gray(h.description.slice(0, 55))}`,
2509
- value: h,
2510
- checked: false
2511
- }))
2512
- }, ctx)
2513
- );
2514
- if (result === BACK) {
2515
- wentBack = true;
2516
- break;
2517
- }
2518
- plan.hooks = result;
2519
- }
2520
- if (cat === "rules") {
2521
- const allCategories = await getRuleCategories();
2522
- const result = await withEsc(
2523
- (ctx) => checkbox({
2524
- message: "Select rule categories:",
2525
- choices: allCategories.map((rc) => ({
2526
- name: `${chalk.bold(rc.category.padEnd(20))} ${chalk.gray(`(${rc.files.length} files)`)}`,
2527
- value: rc.category,
2528
- checked: false
2529
- }))
2530
- }, ctx)
2531
- );
2532
- if (result === BACK) {
2533
- wentBack = true;
2534
- break;
2535
- }
2536
- plan.ruleCategories = result;
2537
- }
2538
- if (cat === "claudemd") {
2539
- const allClaudemds = await getClaudemdItems();
2540
- const result = await withEsc(
2541
- (ctx) => checkbox({
2542
- message: "Select claudemd items:",
2543
- choices: allClaudemds.map((c) => ({
2544
- name: `${chalk.bold(c.name.padEnd(35))} ${chalk.gray(c.description.slice(0, 55))}`,
2545
- value: c,
2546
- checked: false
2547
- }))
2548
- }, ctx)
2549
- );
2550
- if (result === BACK) {
2551
- wentBack = true;
2552
- break;
2553
- }
2554
- plan.claudemds = result;
2555
- }
2556
- if (cat === "mcps") {
2557
- const allMcps = await getMcpServers();
2558
- const mcpResult = await withEsc(
2559
- (ctx) => checkbox({
2560
- message: "Select MCP servers:",
2561
- choices: allMcps.map((m) => ({
2562
- name: `${chalk.bold(m.name.padEnd(30))} ${chalk.gray(m.description.slice(0, 55))}`,
2563
- value: m,
2564
- checked: false
2565
- }))
2566
- }, ctx)
2567
- );
2568
- if (mcpResult === BACK) {
2569
- wentBack = true;
2570
- break;
2571
- }
2572
- plan.mcps = mcpResult;
2573
- for (const server of plan.mcps) {
2574
- if (server.type === "http" || server.envVars.length === 0) continue;
2575
- console.log(chalk.yellow(`
2576
- ${server.name} requires environment variables:`));
2577
- const envMap = {};
2578
- const skippedKeys = [];
2579
- for (const envKey of server.envVars) {
2580
- const action = await withEsc(
2581
- (ctx) => select({
2582
- message: ` How do you want to set ${chalk.bold(envKey)}?`,
2583
- choices: [
2584
- { name: "Enter value now", value: "enter" },
2585
- { name: `Skip ${chalk.gray(`(keep placeholder: YOUR_${envKey}_HERE)`)}`, value: "skip" }
2586
- ]
2587
- }, ctx)
2588
- );
2589
- if (action === BACK) {
2590
- wentBack = true;
2591
- break;
2592
- }
2593
- if (action === "skip") {
2594
- skippedKeys.push(envKey);
2595
- } else {
2596
- const value = await withEsc(
2597
- (ctx) => input({
2598
- message: ` ${envKey}:`,
2599
- default: ""
2600
- }, ctx)
2601
- );
2602
- if (value === BACK) {
2603
- wentBack = true;
2604
- break;
2605
- }
2606
- if (value) envMap[envKey] = value;
2607
- }
2608
- }
2609
- if (wentBack) break;
2610
- plan.mcpEnvValues.set(server.name, envMap);
2611
- if (skippedKeys.length > 0) {
2612
- skippedMcps.set(server.name, skippedKeys);
2613
- }
2614
- }
2615
- if (wentBack) break;
2616
- }
2617
- }
2618
- if (wentBack) {
2619
- plan = createEmptyPlan(scope);
2620
- skippedMcps = /* @__PURE__ */ new Map();
2621
- step = STEP_CATEGORIES;
2622
- } else {
2623
- step = STEP_CONFIRM;
2624
- }
2625
- break;
2626
- }
2627
- // ── Step 3: 설치 요약 + 확인 ──
2628
- case STEP_CONFIRM: {
2629
- console.log(chalk.bold("\n Installation Summary"));
2630
- console.log(chalk.gray(" \u2500".repeat(40)));
2631
- console.log(` Scope : ${chalk.cyan(scope)} (${targetDir})`);
2632
- if (plan.agents.length) console.log(` Agents : ${plan.agents.map((a) => a.name).join(", ")}`);
2633
- if (plan.skills.length) console.log(` Skills : ${plan.skills.map((s) => s.name).join(", ")}`);
2634
- if (plan.commands.length) console.log(` Commands: ${plan.commands.map((c) => c.name).join(", ")}`);
2635
- if (plan.hooks.length) console.log(` Hooks : ${plan.hooks.map((h) => h.name).join(", ")}`);
2636
- if (plan.ruleCategories.length) console.log(` Rules : ${plan.ruleCategories.join(", ")}`);
2637
- if (plan.mcps.length) console.log(` MCPs : ${plan.mcps.map((m) => m.name).join(", ")}`);
2638
- if (plan.claudemds.length) console.log(` ClaudeMd : ${plan.claudemds.map((c) => c.name).join(", ")}`);
2639
- if (plan.statusline) console.log(` Statusline: statusline.sh \u2192 ~/.claude/statusline.sh`);
2640
- console.log("");
2641
- const totalItems = plan.agents.length + plan.skills.length + plan.commands.length + plan.hooks.length + plan.ruleCategories.length + plan.mcps.length + plan.claudemds.length + (plan.statusline ? 1 : 0);
2642
- if (totalItems === 0) {
2643
- console.log(chalk.yellow(" Nothing selected.\n"));
2644
- plan = createEmptyPlan(scope);
2645
- skippedMcps = /* @__PURE__ */ new Map();
2646
- step = STEP_CATEGORIES;
2647
- break;
2648
- }
2649
- const ok = await withEsc(
2650
- (ctx) => confirm({ message: "Proceed with installation?", default: true }, ctx)
2651
- );
2652
- if (ok === BACK) {
2653
- plan = createEmptyPlan(scope);
2654
- skippedMcps = /* @__PURE__ */ new Map();
2655
- step = STEP_CATEGORIES;
2656
- break;
2657
- }
2658
- if (!ok) {
2659
- console.log(chalk.yellow("\n Aborted."));
2660
- return;
2661
- }
2662
- console.log("");
2663
- const spinner = ora("Installing...").start();
2664
- try {
2665
- if (plan.agents.length) {
2666
- spinner.text = "Installing agents...";
2667
- await installAgents(plan.agents, targetDir);
2668
- }
2669
- if (plan.skills.length) {
2670
- spinner.text = "Installing skills...";
2671
- await installSkills(plan.skills, targetDir);
2672
- }
2673
- if (plan.commands.length) {
2674
- spinner.text = "Installing commands...";
2675
- await installCommands(plan.commands, targetDir);
2676
- }
2677
- if (plan.hooks.length) {
2678
- spinner.text = "Installing hooks...";
2679
- await installHooks(plan.hooks, targetDir);
2680
- }
2681
- if (plan.ruleCategories.length) {
2682
- spinner.text = "Installing rules...";
2683
- await installRules(plan.ruleCategories, targetDir);
2684
- }
2685
- if (plan.mcps.length) {
2686
- spinner.text = "Installing MCP servers...";
2687
- await installMcps(plan.mcps, plan.scope, plan.mcpEnvValues);
2688
- }
2689
- if (plan.claudemds.length) {
2690
- spinner.text = "Installing claudemd...";
2691
- await installClaudemd(plan.claudemds, targetDir);
2692
- }
2693
- if (plan.statusline) {
2694
- spinner.text = "Installing statusline...";
2695
- await installStatusline();
2696
- }
2697
- spinner.succeed(chalk.green("Installation complete!"));
2698
- console.log("");
2699
- if (plan.agents.length) console.log(` ${chalk.green("\u2713")} ${plan.agents.length} agent(s) \u2192 ${join2(targetDir, "agents")}`);
2700
- if (plan.skills.length) console.log(` ${chalk.green("\u2713")} ${plan.skills.length} skill(s) \u2192 ${join2(targetDir, "skills")}`);
2701
- if (plan.commands.length) console.log(` ${chalk.green("\u2713")} ${plan.commands.length} command(s) \u2192 ${join2(targetDir, "commands")}`);
2702
- if (plan.hooks.length) console.log(` ${chalk.green("\u2713")} ${plan.hooks.length} hook(s) \u2192 ${join2(targetDir, "hooks")}`);
2703
- if (plan.ruleCategories.length) console.log(` ${chalk.green("\u2713")} Rules copied \u2192 ${join2(targetDir, "rules")}`);
2704
- if (plan.mcps.length) console.log(` ${chalk.green("\u2713")} ${plan.mcps.length} MCP server(s) \u2192 ${scope === "global" ? "~/.claude.json" : "./.claude.json"}`);
2705
- if (plan.claudemds.length) console.log(` ${chalk.green("\u2713")} ClaudeMd appended \u2192 ${join2(targetDir, "CLAUDE.md")}`);
2706
- if (plan.statusline) console.log(` ${chalk.green("\u2713")} Statusline installed \u2192 ~/.claude/statusline.sh`);
2707
- console.log("");
2708
- if (skippedMcps.size > 0) {
2709
- console.log(chalk.yellow(" \u26A0 The following MCP servers have placeholder env vars:"));
2710
- for (const [serverName, keys] of skippedMcps) {
2711
- console.log(` ${chalk.bold("-")} ${serverName} ${chalk.gray(`(${keys.join(", ")})`)} `);
2712
- }
2713
- const configPath = scope === "global" ? "~/.claude.json" : "./.claude.json";
2714
- console.log(chalk.gray(` \u2192 Edit ${configPath} to set the actual values`));
2715
- console.log("");
2716
- }
2717
- } catch (err) {
2718
- spinner.fail(chalk.red("Installation failed"));
2719
- throw err;
2720
- }
2721
- return;
2722
- }
2723
- }
2724
- }
2725
- } catch (err) {
2726
- if (err instanceof ExitPromptError) {
2727
- console.log(chalk.yellow("\n Exiting."));
2728
- return;
2729
- }
2730
- throw err;
2731
- }
2732
- }
2733
- export {
2734
- runCli
2735
- };