@mcp-s/skills 1.0.5 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +399 -96
- package/ThirdPartyNoticeText.txt +171 -0
- package/bin/cli.mjs +14 -0
- package/dist/_chunks/libs/@clack/core.mjs +767 -0
- package/dist/_chunks/libs/@clack/prompts.mjs +275 -0
- package/dist/_chunks/libs/@kwsites/file-exists.mjs +562 -0
- package/dist/_chunks/libs/@kwsites/promise-deferred.mjs +37 -0
- package/dist/_chunks/libs/bluebird.mjs +4141 -0
- package/dist/_chunks/libs/core-util-is.mjs +65 -0
- package/dist/_chunks/libs/duplexer2.mjs +1726 -0
- package/dist/_chunks/libs/esprima.mjs +5338 -0
- package/dist/_chunks/libs/extend-shallow.mjs +31 -0
- package/dist/_chunks/libs/fs-extra.mjs +1801 -0
- package/dist/_chunks/libs/gray-matter.mjs +2596 -0
- package/dist/_chunks/libs/node-int64.mjs +103 -0
- package/dist/_chunks/libs/simple-git.mjs +3584 -0
- package/dist/_chunks/libs/unzipper.mjs +945 -0
- package/dist/_chunks/libs/xdg-basedir.mjs +14 -0
- package/dist/_chunks/rolldown-runtime.mjs +24 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +4258 -0
- package/package.json +85 -27
- package/dist/agents.js +0 -246
- package/dist/api.js +0 -98
- package/dist/auth.js +0 -117
- package/dist/index.js +0 -495
- package/dist/installer.js +0 -231
- package/dist/types.js +0 -1
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { r as __toESM } from "../../rolldown-runtime.mjs";
|
|
2
|
+
import { a as SD, c as fD, d as require_src, i as RD, l as pD, n as LD, o as _D, r as MD, s as dD, t as ID, u as require_picocolors } from "./core.mjs";
|
|
3
|
+
import { stripVTControlCharacters } from "node:util";
|
|
4
|
+
import y from "node:process";
|
|
5
|
+
var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
6
|
+
var import_src = require_src();
|
|
7
|
+
function ce() {
|
|
8
|
+
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";
|
|
9
|
+
}
|
|
10
|
+
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("◻", "[ ]");
|
|
11
|
+
u("▪", "•");
|
|
12
|
+
const _ = u("─", "-"), me = u("╮", "+"), de = u("├", "+"), pe = u("╯", "+"), q = u("●", "•"), D = u("◆", "*"), U = u("▲", "!"), K = u("■", "x"), b = (t) => {
|
|
13
|
+
switch (t) {
|
|
14
|
+
case "initial":
|
|
15
|
+
case "active": return import_picocolors.default.cyan(le);
|
|
16
|
+
case "cancel": return import_picocolors.default.red(L);
|
|
17
|
+
case "error": return import_picocolors.default.yellow(W);
|
|
18
|
+
case "submit": return import_picocolors.default.green(C);
|
|
19
|
+
}
|
|
20
|
+
}, G = (t) => {
|
|
21
|
+
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));
|
|
22
|
+
let l = 0;
|
|
23
|
+
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));
|
|
24
|
+
const $ = a < r.length && l > 0, g = a < r.length && l + a < r.length;
|
|
25
|
+
return r.slice(l, l + a).map((p, v, f) => {
|
|
26
|
+
const j = v === 0 && $, E = v === f.length - 1 && g;
|
|
27
|
+
return j || E ? import_picocolors.default.dim("...") : i(p, v + l === n);
|
|
28
|
+
});
|
|
29
|
+
}, ye = (t) => {
|
|
30
|
+
const n = t.active ?? "Yes", r = t.inactive ?? "No";
|
|
31
|
+
return new dD({
|
|
32
|
+
active: n,
|
|
33
|
+
inactive: r,
|
|
34
|
+
initialValue: t.initialValue ?? !0,
|
|
35
|
+
render() {
|
|
36
|
+
const i = `${import_picocolors.default.gray(o)}
|
|
37
|
+
${b(this.state)} ${t.message}
|
|
38
|
+
`, s = this.value ? n : r;
|
|
39
|
+
switch (this.state) {
|
|
40
|
+
case "submit": return `${i}${import_picocolors.default.gray(o)} ${import_picocolors.default.dim(s)}`;
|
|
41
|
+
case "cancel": return `${i}${import_picocolors.default.gray(o)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(s))}
|
|
42
|
+
${import_picocolors.default.gray(o)}`;
|
|
43
|
+
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}`}
|
|
44
|
+
${import_picocolors.default.cyan(d)}
|
|
45
|
+
`;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}).prompt();
|
|
49
|
+
}, ve = (t) => {
|
|
50
|
+
const n = (r, i) => {
|
|
51
|
+
const s = r.label ?? String(r.value);
|
|
52
|
+
switch (i) {
|
|
53
|
+
case "selected": return `${import_picocolors.default.dim(s)}`;
|
|
54
|
+
case "active": return `${import_picocolors.default.green(k)} ${s} ${r.hint ? import_picocolors.default.dim(`(${r.hint})`) : ""}`;
|
|
55
|
+
case "cancelled": return `${import_picocolors.default.strikethrough(import_picocolors.default.dim(s))}`;
|
|
56
|
+
default: return `${import_picocolors.default.dim(P)} ${import_picocolors.default.dim(s)}`;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
return new LD({
|
|
60
|
+
options: t.options,
|
|
61
|
+
initialValue: t.initialValue,
|
|
62
|
+
render() {
|
|
63
|
+
const r = `${import_picocolors.default.gray(o)}
|
|
64
|
+
${b(this.state)} ${t.message}
|
|
65
|
+
`;
|
|
66
|
+
switch (this.state) {
|
|
67
|
+
case "submit": return `${r}${import_picocolors.default.gray(o)} ${n(this.options[this.cursor], "selected")}`;
|
|
68
|
+
case "cancel": return `${r}${import_picocolors.default.gray(o)} ${n(this.options[this.cursor], "cancelled")}
|
|
69
|
+
${import_picocolors.default.gray(o)}`;
|
|
70
|
+
default: return `${r}${import_picocolors.default.cyan(o)} ${G({
|
|
71
|
+
cursor: this.cursor,
|
|
72
|
+
options: this.options,
|
|
73
|
+
maxItems: t.maxItems,
|
|
74
|
+
style: (i, s) => n(i, s ? "active" : "inactive")
|
|
75
|
+
}).join(`
|
|
76
|
+
${import_picocolors.default.cyan(o)} `)}
|
|
77
|
+
${import_picocolors.default.cyan(d)}
|
|
78
|
+
`;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}).prompt();
|
|
82
|
+
}, fe = (t) => {
|
|
83
|
+
const n = (r, i) => {
|
|
84
|
+
const s = r.label ?? String(r.value);
|
|
85
|
+
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)}`;
|
|
86
|
+
};
|
|
87
|
+
return new SD({
|
|
88
|
+
options: t.options,
|
|
89
|
+
initialValues: t.initialValues,
|
|
90
|
+
required: t.required ?? !0,
|
|
91
|
+
cursorAt: t.cursorAt,
|
|
92
|
+
validate(r) {
|
|
93
|
+
if (this.required && r.length === 0) return `Please select at least one option.
|
|
94
|
+
${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`))}`;
|
|
95
|
+
},
|
|
96
|
+
render() {
|
|
97
|
+
const r = `${import_picocolors.default.gray(o)}
|
|
98
|
+
${b(this.state)} ${t.message}
|
|
99
|
+
`, i = (s, c) => {
|
|
100
|
+
const a = this.value.includes(s.value);
|
|
101
|
+
return c && a ? n(s, "active-selected") : a ? n(s, "selected") : n(s, c ? "active" : "inactive");
|
|
102
|
+
};
|
|
103
|
+
switch (this.state) {
|
|
104
|
+
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")}`;
|
|
105
|
+
case "cancel": {
|
|
106
|
+
const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => n(c, "cancelled")).join(import_picocolors.default.dim(", "));
|
|
107
|
+
return `${r}${import_picocolors.default.gray(o)} ${s.trim() ? `${s}
|
|
108
|
+
${import_picocolors.default.gray(o)}` : ""}`;
|
|
109
|
+
}
|
|
110
|
+
case "error": {
|
|
111
|
+
const s = this.error.split(`
|
|
112
|
+
`).map((c, a) => a === 0 ? `${import_picocolors.default.yellow(d)} ${import_picocolors.default.yellow(c)}` : ` ${c}`).join(`
|
|
113
|
+
`);
|
|
114
|
+
return `${r + import_picocolors.default.yellow(o)} ${G({
|
|
115
|
+
options: this.options,
|
|
116
|
+
cursor: this.cursor,
|
|
117
|
+
maxItems: t.maxItems,
|
|
118
|
+
style: i
|
|
119
|
+
}).join(`
|
|
120
|
+
${import_picocolors.default.yellow(o)} `)}
|
|
121
|
+
${s}
|
|
122
|
+
`;
|
|
123
|
+
}
|
|
124
|
+
default: return `${r}${import_picocolors.default.cyan(o)} ${G({
|
|
125
|
+
options: this.options,
|
|
126
|
+
cursor: this.cursor,
|
|
127
|
+
maxItems: t.maxItems,
|
|
128
|
+
style: i
|
|
129
|
+
}).join(`
|
|
130
|
+
${import_picocolors.default.cyan(o)} `)}
|
|
131
|
+
${import_picocolors.default.cyan(d)}
|
|
132
|
+
`;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}).prompt();
|
|
136
|
+
}, Me = (t = "", n = "") => {
|
|
137
|
+
const r = `
|
|
138
|
+
${t}
|
|
139
|
+
`.split(`
|
|
140
|
+
`), i = stripVTControlCharacters(n).length, s = Math.max(r.reduce((a, l) => {
|
|
141
|
+
const $ = stripVTControlCharacters(l);
|
|
142
|
+
return $.length > a ? $.length : a;
|
|
143
|
+
}, 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(`
|
|
144
|
+
`);
|
|
145
|
+
process.stdout.write(`${import_picocolors.default.gray(o)}
|
|
146
|
+
${import_picocolors.default.green(C)} ${import_picocolors.default.reset(n)} ${import_picocolors.default.gray(_.repeat(Math.max(s - i - 1, 1)) + me)}
|
|
147
|
+
${c}
|
|
148
|
+
${import_picocolors.default.gray(de + _.repeat(s + 2) + pe)}
|
|
149
|
+
`);
|
|
150
|
+
}, xe = (t = "") => {
|
|
151
|
+
process.stdout.write(`${import_picocolors.default.gray(d)} ${import_picocolors.default.red(t)}
|
|
152
|
+
|
|
153
|
+
`);
|
|
154
|
+
}, Ie = (t = "") => {
|
|
155
|
+
process.stdout.write(`${import_picocolors.default.gray(ue)} ${t}
|
|
156
|
+
`);
|
|
157
|
+
}, Se = (t = "") => {
|
|
158
|
+
process.stdout.write(`${import_picocolors.default.gray(o)}
|
|
159
|
+
${import_picocolors.default.gray(d)} ${t}
|
|
160
|
+
|
|
161
|
+
`);
|
|
162
|
+
}, M = {
|
|
163
|
+
message: (t = "", { symbol: n = import_picocolors.default.gray(o) } = {}) => {
|
|
164
|
+
const r = [`${import_picocolors.default.gray(o)}`];
|
|
165
|
+
if (t) {
|
|
166
|
+
const [i, ...s] = t.split(`
|
|
167
|
+
`);
|
|
168
|
+
r.push(`${n} ${i}`, ...s.map((c) => `${import_picocolors.default.gray(o)} ${c}`));
|
|
169
|
+
}
|
|
170
|
+
process.stdout.write(`${r.join(`
|
|
171
|
+
`)}
|
|
172
|
+
`);
|
|
173
|
+
},
|
|
174
|
+
info: (t) => {
|
|
175
|
+
M.message(t, { symbol: import_picocolors.default.blue(q) });
|
|
176
|
+
},
|
|
177
|
+
success: (t) => {
|
|
178
|
+
M.message(t, { symbol: import_picocolors.default.green(D) });
|
|
179
|
+
},
|
|
180
|
+
step: (t) => {
|
|
181
|
+
M.message(t, { symbol: import_picocolors.default.green(C) });
|
|
182
|
+
},
|
|
183
|
+
warn: (t) => {
|
|
184
|
+
M.message(t, { symbol: import_picocolors.default.yellow(U) });
|
|
185
|
+
},
|
|
186
|
+
warning: (t) => {
|
|
187
|
+
M.warn(t);
|
|
188
|
+
},
|
|
189
|
+
error: (t) => {
|
|
190
|
+
M.message(t, { symbol: import_picocolors.default.red(K) });
|
|
191
|
+
}
|
|
192
|
+
}, J = `${import_picocolors.default.gray(o)} `, x = {
|
|
193
|
+
message: async (t, { symbol: n = import_picocolors.default.gray(o) } = {}) => {
|
|
194
|
+
process.stdout.write(`${import_picocolors.default.gray(o)}
|
|
195
|
+
${n} `);
|
|
196
|
+
let r = 3;
|
|
197
|
+
for await (let i of t) {
|
|
198
|
+
i = i.replace(/\n/g, `
|
|
199
|
+
${J}`), i.includes(`
|
|
200
|
+
`) && (r = 3 + stripVTControlCharacters(i.slice(i.lastIndexOf(`
|
|
201
|
+
`))).length);
|
|
202
|
+
const s = stripVTControlCharacters(i).length;
|
|
203
|
+
r + s < process.stdout.columns ? (r += s, process.stdout.write(i)) : (process.stdout.write(`
|
|
204
|
+
${J}${i.trimStart()}`), r = 3 + stripVTControlCharacters(i.trimStart()).length);
|
|
205
|
+
}
|
|
206
|
+
process.stdout.write(`
|
|
207
|
+
`);
|
|
208
|
+
},
|
|
209
|
+
info: (t) => x.message(t, { symbol: import_picocolors.default.blue(q) }),
|
|
210
|
+
success: (t) => x.message(t, { symbol: import_picocolors.default.green(D) }),
|
|
211
|
+
step: (t) => x.message(t, { symbol: import_picocolors.default.green(C) }),
|
|
212
|
+
warn: (t) => x.message(t, { symbol: import_picocolors.default.yellow(U) }),
|
|
213
|
+
warning: (t) => x.warn(t),
|
|
214
|
+
error: (t) => x.message(t, { symbol: import_picocolors.default.red(K) })
|
|
215
|
+
}, Y = ({ indicator: t = "dots" } = {}) => {
|
|
216
|
+
const n = V ? [
|
|
217
|
+
"◒",
|
|
218
|
+
"◐",
|
|
219
|
+
"◓",
|
|
220
|
+
"◑"
|
|
221
|
+
] : [
|
|
222
|
+
"•",
|
|
223
|
+
"o",
|
|
224
|
+
"O",
|
|
225
|
+
"0"
|
|
226
|
+
], r = V ? 80 : 120, i = process.env.CI === "true";
|
|
227
|
+
let s, c, a = !1, l = "", $, g = performance.now();
|
|
228
|
+
const p = (m) => {
|
|
229
|
+
a && N(m > 1 ? "Something went wrong" : "Canceled", m);
|
|
230
|
+
}, v = () => p(2), f = () => p(1), j = () => {
|
|
231
|
+
process.on("uncaughtExceptionMonitor", v), process.on("unhandledRejection", v), process.on("SIGINT", f), process.on("SIGTERM", f), process.on("exit", p);
|
|
232
|
+
}, E = () => {
|
|
233
|
+
process.removeListener("uncaughtExceptionMonitor", v), process.removeListener("unhandledRejection", v), process.removeListener("SIGINT", f), process.removeListener("SIGTERM", f), process.removeListener("exit", p);
|
|
234
|
+
}, B = () => {
|
|
235
|
+
if ($ === void 0) return;
|
|
236
|
+
i && process.stdout.write(`
|
|
237
|
+
`);
|
|
238
|
+
const m = $.split(`
|
|
239
|
+
`);
|
|
240
|
+
process.stdout.write(import_src.cursor.move(-999, m.length - 1)), process.stdout.write(import_src.erase.down(m.length));
|
|
241
|
+
}, R = (m) => m.replace(/\.+$/, ""), O = (m) => {
|
|
242
|
+
const h = (performance.now() - m) / 1e3, w = Math.floor(h / 60), I = Math.floor(h % 60);
|
|
243
|
+
return w > 0 ? `[${w}m ${I}s]` : `[${I}s]`;
|
|
244
|
+
}, H = (m = "") => {
|
|
245
|
+
a = !0, s = fD(), l = R(m), g = performance.now(), process.stdout.write(`${import_picocolors.default.gray(o)}
|
|
246
|
+
`);
|
|
247
|
+
let h = 0, w = 0;
|
|
248
|
+
j(), c = setInterval(() => {
|
|
249
|
+
if (i && l === $) return;
|
|
250
|
+
B(), $ = l;
|
|
251
|
+
const I = import_picocolors.default.magenta(n[h]);
|
|
252
|
+
if (i) process.stdout.write(`${I} ${l}...`);
|
|
253
|
+
else if (t === "timer") process.stdout.write(`${I} ${l} ${O(g)}`);
|
|
254
|
+
else {
|
|
255
|
+
const z = ".".repeat(Math.floor(w)).slice(0, 3);
|
|
256
|
+
process.stdout.write(`${I} ${l}${z}`);
|
|
257
|
+
}
|
|
258
|
+
h = h + 1 < n.length ? h + 1 : 0, w = w < n.length ? w + .125 : 0;
|
|
259
|
+
}, r);
|
|
260
|
+
}, N = (m = "", h = 0) => {
|
|
261
|
+
a = !1, clearInterval(c), B();
|
|
262
|
+
const w = h === 0 ? import_picocolors.default.green(C) : h === 1 ? import_picocolors.default.red(L) : import_picocolors.default.red(W);
|
|
263
|
+
l = R(m ?? l), t === "timer" ? process.stdout.write(`${w} ${l} ${O(g)}
|
|
264
|
+
`) : process.stdout.write(`${w} ${l}
|
|
265
|
+
`), E(), s();
|
|
266
|
+
};
|
|
267
|
+
return {
|
|
268
|
+
start: H,
|
|
269
|
+
stop: N,
|
|
270
|
+
message: (m = "") => {
|
|
271
|
+
l = R(m ?? l);
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
export { Y as a, xe as c, Se as i, ye as l, M as n, fe as o, Me as r, ve as s, Ie as t };
|