@voidagency/skills 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,336 @@
1
+ import { r as __toESM } from "../../rolldown-runtime.mjs";
2
+ import { a as SD, c as fD, d as require_src, n as LD, o as _D, s as dD, u as require_picocolors } from "./core.mjs";
3
+ import { stripVTControlCharacters } from "node:util";
4
+ import y from "node:process";
5
+ //#region ../../node_modules/@clack/prompts/dist/index.mjs
6
+ var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
7
+ var import_src = require_src();
8
+ function ce() {
9
+ return y.platform !== "win32" ? y.env.TERM !== "linux" : !!y.env.CI || !!y.env.WT_SESSION || !!y.env.TERMINUS_SUBLIME || y.env.ConEmuTask === "{cmd::Cmder}" || y.env.TERM_PROGRAM === "Terminus-Sublime" || y.env.TERM_PROGRAM === "vscode" || y.env.TERM === "xterm-256color" || y.env.TERM === "alacritty" || y.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
10
+ }
11
+ const V = ce(), u = (t, n) => V ? t : n, le = u("◆", "*"), L = u("■", "x"), W = u("▲", "x"), C = u("◇", "o"), ue = u("┌", "T"), o = u("│", "|"), d = u("└", "—"), k = u("●", ">"), P = u("○", " "), A = u("◻", "[•]"), T = u("◼", "[+]"), F = u("◻", "[ ]");
12
+ u("▪", "•");
13
+ const _ = u("─", "-"), me = u("╮", "+"), de = u("├", "+"), pe = u("╯", "+"), q = u("●", "•"), D = u("◆", "*"), U = u("▲", "!"), K = u("■", "x"), b = (t) => {
14
+ switch (t) {
15
+ case "initial":
16
+ case "active": return import_picocolors.default.cyan(le);
17
+ case "cancel": return import_picocolors.default.red(L);
18
+ case "error": return import_picocolors.default.yellow(W);
19
+ case "submit": return import_picocolors.default.green(C);
20
+ }
21
+ }, G = (t) => {
22
+ const { cursor: n, options: r, style: i } = t, s = t.maxItems ?? Number.POSITIVE_INFINITY, c = Math.max(process.stdout.rows - 4, 0), a = Math.min(c, Math.max(s, 5));
23
+ let l = 0;
24
+ n >= l + a - 3 ? l = Math.max(Math.min(n - a + 3, r.length - a), 0) : n < l + 2 && (l = Math.max(n - 2, 0));
25
+ const $ = a < r.length && l > 0, g = a < r.length && l + a < r.length;
26
+ return r.slice(l, l + a).map((p, v, f) => {
27
+ const j = v === 0 && $, E = v === f.length - 1 && g;
28
+ return j || E ? import_picocolors.default.dim("...") : i(p, v + l === n);
29
+ });
30
+ }, ye = (t) => {
31
+ const n = t.active ?? "Yes", r = t.inactive ?? "No";
32
+ return new dD({
33
+ active: n,
34
+ inactive: r,
35
+ initialValue: t.initialValue ?? !0,
36
+ render() {
37
+ const i = `${import_picocolors.default.gray(o)}
38
+ ${b(this.state)} ${t.message}
39
+ `, s = this.value ? n : r;
40
+ switch (this.state) {
41
+ case "submit": return `${i}${import_picocolors.default.gray(o)} ${import_picocolors.default.dim(s)}`;
42
+ case "cancel": return `${i}${import_picocolors.default.gray(o)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(s))}
43
+ ${import_picocolors.default.gray(o)}`;
44
+ default: return `${i}${import_picocolors.default.cyan(o)} ${this.value ? `${import_picocolors.default.green(k)} ${n}` : `${import_picocolors.default.dim(P)} ${import_picocolors.default.dim(n)}`} ${import_picocolors.default.dim("/")} ${this.value ? `${import_picocolors.default.dim(P)} ${import_picocolors.default.dim(r)}` : `${import_picocolors.default.green(k)} ${r}`}
45
+ ${import_picocolors.default.cyan(d)}
46
+ `;
47
+ }
48
+ }
49
+ }).prompt();
50
+ }, ve = (t) => {
51
+ const n = (r, i) => {
52
+ const s = r.label ?? String(r.value);
53
+ switch (i) {
54
+ case "selected": return `${import_picocolors.default.dim(s)}`;
55
+ case "active": return `${import_picocolors.default.green(k)} ${s} ${r.hint ? import_picocolors.default.dim(`(${r.hint})`) : ""}`;
56
+ case "cancelled": return `${import_picocolors.default.strikethrough(import_picocolors.default.dim(s))}`;
57
+ default: return `${import_picocolors.default.dim(P)} ${import_picocolors.default.dim(s)}`;
58
+ }
59
+ };
60
+ return new LD({
61
+ options: t.options,
62
+ initialValue: t.initialValue,
63
+ render() {
64
+ const r = `${import_picocolors.default.gray(o)}
65
+ ${b(this.state)} ${t.message}
66
+ `;
67
+ switch (this.state) {
68
+ case "submit": return `${r}${import_picocolors.default.gray(o)} ${n(this.options[this.cursor], "selected")}`;
69
+ case "cancel": return `${r}${import_picocolors.default.gray(o)} ${n(this.options[this.cursor], "cancelled")}
70
+ ${import_picocolors.default.gray(o)}`;
71
+ default: return `${r}${import_picocolors.default.cyan(o)} ${G({
72
+ cursor: this.cursor,
73
+ options: this.options,
74
+ maxItems: t.maxItems,
75
+ style: (i, s) => n(i, s ? "active" : "inactive")
76
+ }).join(`
77
+ ${import_picocolors.default.cyan(o)} `)}
78
+ ${import_picocolors.default.cyan(d)}
79
+ `;
80
+ }
81
+ }
82
+ }).prompt();
83
+ }, fe = (t) => {
84
+ const n = (r, i) => {
85
+ const s = r.label ?? String(r.value);
86
+ return i === "active" ? `${import_picocolors.default.cyan(A)} ${s} ${r.hint ? import_picocolors.default.dim(`(${r.hint})`) : ""}` : i === "selected" ? `${import_picocolors.default.green(T)} ${import_picocolors.default.dim(s)} ${r.hint ? import_picocolors.default.dim(`(${r.hint})`) : ""}` : i === "cancelled" ? `${import_picocolors.default.strikethrough(import_picocolors.default.dim(s))}` : i === "active-selected" ? `${import_picocolors.default.green(T)} ${s} ${r.hint ? import_picocolors.default.dim(`(${r.hint})`) : ""}` : i === "submitted" ? `${import_picocolors.default.dim(s)}` : `${import_picocolors.default.dim(F)} ${import_picocolors.default.dim(s)}`;
87
+ };
88
+ return new SD({
89
+ options: t.options,
90
+ initialValues: t.initialValues,
91
+ required: t.required ?? !0,
92
+ cursorAt: t.cursorAt,
93
+ validate(r) {
94
+ if (this.required && r.length === 0) return `Please select at least one option.
95
+ ${import_picocolors.default.reset(import_picocolors.default.dim(`Press ${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(" space ")))} to select, ${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(" enter ")))} to submit`))}`;
96
+ },
97
+ render() {
98
+ const r = `${import_picocolors.default.gray(o)}
99
+ ${b(this.state)} ${t.message}
100
+ `, i = (s, c) => {
101
+ const a = this.value.includes(s.value);
102
+ return c && a ? n(s, "active-selected") : a ? n(s, "selected") : n(s, c ? "active" : "inactive");
103
+ };
104
+ switch (this.state) {
105
+ case "submit": return `${r}${import_picocolors.default.gray(o)} ${this.options.filter(({ value: s }) => this.value.includes(s)).map((s) => n(s, "submitted")).join(import_picocolors.default.dim(", ")) || import_picocolors.default.dim("none")}`;
106
+ case "cancel": {
107
+ const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => n(c, "cancelled")).join(import_picocolors.default.dim(", "));
108
+ return `${r}${import_picocolors.default.gray(o)} ${s.trim() ? `${s}
109
+ ${import_picocolors.default.gray(o)}` : ""}`;
110
+ }
111
+ case "error": {
112
+ const s = this.error.split(`
113
+ `).map((c, a) => a === 0 ? `${import_picocolors.default.yellow(d)} ${import_picocolors.default.yellow(c)}` : ` ${c}`).join(`
114
+ `);
115
+ return `${r + import_picocolors.default.yellow(o)} ${G({
116
+ options: this.options,
117
+ cursor: this.cursor,
118
+ maxItems: t.maxItems,
119
+ style: i
120
+ }).join(`
121
+ ${import_picocolors.default.yellow(o)} `)}
122
+ ${s}
123
+ `;
124
+ }
125
+ default: return `${r}${import_picocolors.default.cyan(o)} ${G({
126
+ options: this.options,
127
+ cursor: this.cursor,
128
+ maxItems: t.maxItems,
129
+ style: i
130
+ }).join(`
131
+ ${import_picocolors.default.cyan(o)} `)}
132
+ ${import_picocolors.default.cyan(d)}
133
+ `;
134
+ }
135
+ }
136
+ }).prompt();
137
+ }, be = (t) => {
138
+ const { selectableGroups: n = !0 } = t, r = (i, s, c = []) => {
139
+ const a = i.label ?? String(i.value), l = typeof i.group == "string", $ = l && (c[c.indexOf(i) + 1] ?? { group: !0 }), g = l && $.group === !0, p = l ? n ? `${g ? d : o} ` : " " : "";
140
+ if (s === "active") return `${import_picocolors.default.dim(p)}${import_picocolors.default.cyan(A)} ${a} ${i.hint ? import_picocolors.default.dim(`(${i.hint})`) : ""}`;
141
+ if (s === "group-active") return `${p}${import_picocolors.default.cyan(A)} ${import_picocolors.default.dim(a)}`;
142
+ if (s === "group-active-selected") return `${p}${import_picocolors.default.green(T)} ${import_picocolors.default.dim(a)}`;
143
+ if (s === "selected") {
144
+ const f = l || n ? import_picocolors.default.green(T) : "";
145
+ return `${import_picocolors.default.dim(p)}${f} ${import_picocolors.default.dim(a)} ${i.hint ? import_picocolors.default.dim(`(${i.hint})`) : ""}`;
146
+ }
147
+ if (s === "cancelled") return `${import_picocolors.default.strikethrough(import_picocolors.default.dim(a))}`;
148
+ if (s === "active-selected") return `${import_picocolors.default.dim(p)}${import_picocolors.default.green(T)} ${a} ${i.hint ? import_picocolors.default.dim(`(${i.hint})`) : ""}`;
149
+ if (s === "submitted") return `${import_picocolors.default.dim(a)}`;
150
+ const v = l || n ? import_picocolors.default.dim(F) : "";
151
+ return `${import_picocolors.default.dim(p)}${v} ${import_picocolors.default.dim(a)}`;
152
+ };
153
+ return new _D({
154
+ options: t.options,
155
+ initialValues: t.initialValues,
156
+ required: t.required ?? !0,
157
+ cursorAt: t.cursorAt,
158
+ selectableGroups: n,
159
+ validate(i) {
160
+ if (this.required && i.length === 0) return `Please select at least one option.
161
+ ${import_picocolors.default.reset(import_picocolors.default.dim(`Press ${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(" space ")))} to select, ${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(" enter ")))} to submit`))}`;
162
+ },
163
+ render() {
164
+ const i = `${import_picocolors.default.gray(o)}
165
+ ${b(this.state)} ${t.message}
166
+ `;
167
+ switch (this.state) {
168
+ case "submit": return `${i}${import_picocolors.default.gray(o)} ${this.options.filter(({ value: s }) => this.value.includes(s)).map((s) => r(s, "submitted")).join(import_picocolors.default.dim(", "))}`;
169
+ case "cancel": {
170
+ const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => r(c, "cancelled")).join(import_picocolors.default.dim(", "));
171
+ return `${i}${import_picocolors.default.gray(o)} ${s.trim() ? `${s}
172
+ ${import_picocolors.default.gray(o)}` : ""}`;
173
+ }
174
+ case "error": {
175
+ const s = this.error.split(`
176
+ `).map((c, a) => a === 0 ? `${import_picocolors.default.yellow(d)} ${import_picocolors.default.yellow(c)}` : ` ${c}`).join(`
177
+ `);
178
+ return `${i}${import_picocolors.default.yellow(o)} ${this.options.map((c, a, l) => {
179
+ const $ = this.value.includes(c.value) || c.group === !0 && this.isGroupSelected(`${c.value}`), g = a === this.cursor;
180
+ return !g && typeof c.group == "string" && this.options[this.cursor].value === c.group ? r(c, $ ? "group-active-selected" : "group-active", l) : g && $ ? r(c, "active-selected", l) : $ ? r(c, "selected", l) : r(c, g ? "active" : "inactive", l);
181
+ }).join(`
182
+ ${import_picocolors.default.yellow(o)} `)}
183
+ ${s}
184
+ `;
185
+ }
186
+ default: return `${i}${import_picocolors.default.cyan(o)} ${this.options.map((s, c, a) => {
187
+ const l = this.value.includes(s.value) || s.group === !0 && this.isGroupSelected(`${s.value}`), $ = c === this.cursor;
188
+ return !$ && typeof s.group == "string" && this.options[this.cursor].value === s.group ? r(s, l ? "group-active-selected" : "group-active", a) : $ && l ? r(s, "active-selected", a) : l ? r(s, "selected", a) : r(s, $ ? "active" : "inactive", a);
189
+ }).join(`
190
+ ${import_picocolors.default.cyan(o)} `)}
191
+ ${import_picocolors.default.cyan(d)}
192
+ `;
193
+ }
194
+ }
195
+ }).prompt();
196
+ }, Me = (t = "", n = "") => {
197
+ const r = `
198
+ ${t}
199
+ `.split(`
200
+ `), i = stripVTControlCharacters(n).length, s = Math.max(r.reduce((a, l) => {
201
+ const $ = stripVTControlCharacters(l);
202
+ return $.length > a ? $.length : a;
203
+ }, 0), i) + 2, c = r.map((a) => `${import_picocolors.default.gray(o)} ${import_picocolors.default.dim(a)}${" ".repeat(s - stripVTControlCharacters(a).length)}${import_picocolors.default.gray(o)}`).join(`
204
+ `);
205
+ process.stdout.write(`${import_picocolors.default.gray(o)}
206
+ ${import_picocolors.default.green(C)} ${import_picocolors.default.reset(n)} ${import_picocolors.default.gray(_.repeat(Math.max(s - i - 1, 1)) + me)}
207
+ ${c}
208
+ ${import_picocolors.default.gray(de + _.repeat(s + 2) + pe)}
209
+ `);
210
+ }, xe = (t = "") => {
211
+ process.stdout.write(`${import_picocolors.default.gray(d)} ${import_picocolors.default.red(t)}
212
+
213
+ `);
214
+ }, Ie = (t = "") => {
215
+ process.stdout.write(`${import_picocolors.default.gray(ue)} ${t}
216
+ `);
217
+ }, Se = (t = "") => {
218
+ process.stdout.write(`${import_picocolors.default.gray(o)}
219
+ ${import_picocolors.default.gray(d)} ${t}
220
+
221
+ `);
222
+ }, M = {
223
+ message: (t = "", { symbol: n = import_picocolors.default.gray(o) } = {}) => {
224
+ const r = [`${import_picocolors.default.gray(o)}`];
225
+ if (t) {
226
+ const [i, ...s] = t.split(`
227
+ `);
228
+ r.push(`${n} ${i}`, ...s.map((c) => `${import_picocolors.default.gray(o)} ${c}`));
229
+ }
230
+ process.stdout.write(`${r.join(`
231
+ `)}
232
+ `);
233
+ },
234
+ info: (t) => {
235
+ M.message(t, { symbol: import_picocolors.default.blue(q) });
236
+ },
237
+ success: (t) => {
238
+ M.message(t, { symbol: import_picocolors.default.green(D) });
239
+ },
240
+ step: (t) => {
241
+ M.message(t, { symbol: import_picocolors.default.green(C) });
242
+ },
243
+ warn: (t) => {
244
+ M.message(t, { symbol: import_picocolors.default.yellow(U) });
245
+ },
246
+ warning: (t) => {
247
+ M.warn(t);
248
+ },
249
+ error: (t) => {
250
+ M.message(t, { symbol: import_picocolors.default.red(K) });
251
+ }
252
+ }, J = `${import_picocolors.default.gray(o)} `, x = {
253
+ message: async (t, { symbol: n = import_picocolors.default.gray(o) } = {}) => {
254
+ process.stdout.write(`${import_picocolors.default.gray(o)}
255
+ ${n} `);
256
+ let r = 3;
257
+ for await (let i of t) {
258
+ i = i.replace(/\n/g, `
259
+ ${J}`), i.includes(`
260
+ `) && (r = 3 + stripVTControlCharacters(i.slice(i.lastIndexOf(`
261
+ `))).length);
262
+ const s = stripVTControlCharacters(i).length;
263
+ r + s < process.stdout.columns ? (r += s, process.stdout.write(i)) : (process.stdout.write(`
264
+ ${J}${i.trimStart()}`), r = 3 + stripVTControlCharacters(i.trimStart()).length);
265
+ }
266
+ process.stdout.write(`
267
+ `);
268
+ },
269
+ info: (t) => x.message(t, { symbol: import_picocolors.default.blue(q) }),
270
+ success: (t) => x.message(t, { symbol: import_picocolors.default.green(D) }),
271
+ step: (t) => x.message(t, { symbol: import_picocolors.default.green(C) }),
272
+ warn: (t) => x.message(t, { symbol: import_picocolors.default.yellow(U) }),
273
+ warning: (t) => x.warn(t),
274
+ error: (t) => x.message(t, { symbol: import_picocolors.default.red(K) })
275
+ }, Y = ({ indicator: t = "dots" } = {}) => {
276
+ const n = V ? [
277
+ "◒",
278
+ "◐",
279
+ "◓",
280
+ "◑"
281
+ ] : [
282
+ "•",
283
+ "o",
284
+ "O",
285
+ "0"
286
+ ], r = V ? 80 : 120, i = process.env.CI === "true";
287
+ let s, c, a = !1, l = "", $, g = performance.now();
288
+ const p = (m) => {
289
+ a && N(m > 1 ? "Something went wrong" : "Canceled", m);
290
+ }, v = () => p(2), f = () => p(1), j = () => {
291
+ process.on("uncaughtExceptionMonitor", v), process.on("unhandledRejection", v), process.on("SIGINT", f), process.on("SIGTERM", f), process.on("exit", p);
292
+ }, E = () => {
293
+ process.removeListener("uncaughtExceptionMonitor", v), process.removeListener("unhandledRejection", v), process.removeListener("SIGINT", f), process.removeListener("SIGTERM", f), process.removeListener("exit", p);
294
+ }, B = () => {
295
+ if ($ === void 0) return;
296
+ i && process.stdout.write(`
297
+ `);
298
+ const m = $.split(`
299
+ `);
300
+ process.stdout.write(import_src.cursor.move(-999, m.length - 1)), process.stdout.write(import_src.erase.down(m.length));
301
+ }, R = (m) => m.replace(/\.+$/, ""), O = (m) => {
302
+ const h = (performance.now() - m) / 1e3, w = Math.floor(h / 60), I = Math.floor(h % 60);
303
+ return w > 0 ? `[${w}m ${I}s]` : `[${I}s]`;
304
+ }, H = (m = "") => {
305
+ a = !0, s = fD(), l = R(m), g = performance.now(), process.stdout.write(`${import_picocolors.default.gray(o)}
306
+ `);
307
+ let h = 0, w = 0;
308
+ j(), c = setInterval(() => {
309
+ if (i && l === $) return;
310
+ B(), $ = l;
311
+ const I = import_picocolors.default.magenta(n[h]);
312
+ if (i) process.stdout.write(`${I} ${l}...`);
313
+ else if (t === "timer") process.stdout.write(`${I} ${l} ${O(g)}`);
314
+ else {
315
+ const z = ".".repeat(Math.floor(w)).slice(0, 3);
316
+ process.stdout.write(`${I} ${l}${z}`);
317
+ }
318
+ h = h + 1 < n.length ? h + 1 : 0, w = w < n.length ? w + .125 : 0;
319
+ }, r);
320
+ }, N = (m = "", h = 0) => {
321
+ a = !1, clearInterval(c), B();
322
+ const w = h === 0 ? import_picocolors.default.green(C) : h === 1 ? import_picocolors.default.red(L) : import_picocolors.default.red(W);
323
+ l = R(m ?? l), t === "timer" ? process.stdout.write(`${w} ${l} ${O(g)}
324
+ `) : process.stdout.write(`${w} ${l}
325
+ `), E(), s();
326
+ };
327
+ return {
328
+ start: H,
329
+ stop: N,
330
+ message: (m = "") => {
331
+ l = R(m ?? l);
332
+ }
333
+ };
334
+ };
335
+ //#endregion
336
+ export { Y as a, ve as c, Se as i, xe as l, M as n, be as o, Me as r, fe as s, Ie as t, ye as u };