agentprofiles-cli 0.3.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.
- package/README.md +392 -0
- package/dist/index.js +3461 -0
- package/dist/index.js.map +1 -0
- package/package.json +71 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,3461 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __esm = (fn, res) => function __init() {
|
|
9
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
10
|
+
};
|
|
11
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
12
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
13
|
+
};
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
27
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
28
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
29
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
30
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
31
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
32
|
+
mod
|
|
33
|
+
));
|
|
34
|
+
|
|
35
|
+
// node_modules/tsup/assets/esm_shims.js
|
|
36
|
+
import path from "path";
|
|
37
|
+
import { fileURLToPath } from "url";
|
|
38
|
+
var init_esm_shims = __esm({
|
|
39
|
+
"node_modules/tsup/assets/esm_shims.js"() {
|
|
40
|
+
"use strict";
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// node_modules/citty/dist/_chunks/libs/scule.mjs
|
|
45
|
+
function isUppercase(char = "") {
|
|
46
|
+
if (NUMBER_CHAR_RE.test(char)) return;
|
|
47
|
+
return char !== char.toLowerCase();
|
|
48
|
+
}
|
|
49
|
+
function splitByCase(str, separators) {
|
|
50
|
+
const splitters = separators ?? STR_SPLITTERS;
|
|
51
|
+
const parts = [];
|
|
52
|
+
if (!str || typeof str !== "string") return parts;
|
|
53
|
+
let buff = "";
|
|
54
|
+
let previousUpper;
|
|
55
|
+
let previousSplitter;
|
|
56
|
+
for (const char of str) {
|
|
57
|
+
const isSplitter = splitters.includes(char);
|
|
58
|
+
if (isSplitter === true) {
|
|
59
|
+
parts.push(buff);
|
|
60
|
+
buff = "";
|
|
61
|
+
previousUpper = void 0;
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
const isUpper = isUppercase(char);
|
|
65
|
+
if (previousSplitter === false) {
|
|
66
|
+
if (previousUpper === false && isUpper === true) {
|
|
67
|
+
parts.push(buff);
|
|
68
|
+
buff = char;
|
|
69
|
+
previousUpper = isUpper;
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
if (previousUpper === true && isUpper === false && buff.length > 1) {
|
|
73
|
+
const lastChar = buff.at(-1);
|
|
74
|
+
parts.push(buff.slice(0, Math.max(0, buff.length - 1)));
|
|
75
|
+
buff = lastChar + char;
|
|
76
|
+
previousUpper = isUpper;
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
buff += char;
|
|
81
|
+
previousUpper = isUpper;
|
|
82
|
+
previousSplitter = isSplitter;
|
|
83
|
+
}
|
|
84
|
+
parts.push(buff);
|
|
85
|
+
return parts;
|
|
86
|
+
}
|
|
87
|
+
function upperFirst(str) {
|
|
88
|
+
return str ? str[0].toUpperCase() + str.slice(1) : "";
|
|
89
|
+
}
|
|
90
|
+
function lowerFirst(str) {
|
|
91
|
+
return str ? str[0].toLowerCase() + str.slice(1) : "";
|
|
92
|
+
}
|
|
93
|
+
function pascalCase(str, opts) {
|
|
94
|
+
return str ? (Array.isArray(str) ? str : splitByCase(str)).map((p2) => upperFirst(opts?.normalize ? p2.toLowerCase() : p2)).join("") : "";
|
|
95
|
+
}
|
|
96
|
+
function camelCase(str, opts) {
|
|
97
|
+
return lowerFirst(pascalCase(str || "", opts));
|
|
98
|
+
}
|
|
99
|
+
function kebabCase(str, joiner) {
|
|
100
|
+
return str ? (Array.isArray(str) ? str : splitByCase(str)).map((p2) => p2.toLowerCase()).join(joiner ?? "-") : "";
|
|
101
|
+
}
|
|
102
|
+
var NUMBER_CHAR_RE, STR_SPLITTERS;
|
|
103
|
+
var init_scule = __esm({
|
|
104
|
+
"node_modules/citty/dist/_chunks/libs/scule.mjs"() {
|
|
105
|
+
"use strict";
|
|
106
|
+
init_esm_shims();
|
|
107
|
+
NUMBER_CHAR_RE = /\d/;
|
|
108
|
+
STR_SPLITTERS = [
|
|
109
|
+
"-",
|
|
110
|
+
"_",
|
|
111
|
+
"/",
|
|
112
|
+
"."
|
|
113
|
+
];
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
// node_modules/citty/dist/index.mjs
|
|
118
|
+
import { parseArgs as parseArgs$1 } from "util";
|
|
119
|
+
function toArray(val) {
|
|
120
|
+
if (Array.isArray(val)) return val;
|
|
121
|
+
return val === void 0 ? [] : [val];
|
|
122
|
+
}
|
|
123
|
+
function formatLineColumns(lines, linePrefix = "") {
|
|
124
|
+
const maxLength = [];
|
|
125
|
+
for (const line of lines) for (const [i, element] of line.entries()) maxLength[i] = Math.max(maxLength[i] || 0, element.length);
|
|
126
|
+
return lines.map((l2) => l2.map((c, i) => linePrefix + c[i === 0 ? "padStart" : "padEnd"](maxLength[i])).join(" ")).join("\n");
|
|
127
|
+
}
|
|
128
|
+
function resolveValue(input) {
|
|
129
|
+
return typeof input === "function" ? input() : input;
|
|
130
|
+
}
|
|
131
|
+
function parseRawArgs(args2 = [], opts = {}) {
|
|
132
|
+
const booleans = new Set(opts.boolean || []);
|
|
133
|
+
const strings = new Set(opts.string || []);
|
|
134
|
+
const aliasMap = opts.alias || {};
|
|
135
|
+
const defaults = opts.default || {};
|
|
136
|
+
const aliasToMain = /* @__PURE__ */ new Map();
|
|
137
|
+
const mainToAliases = /* @__PURE__ */ new Map();
|
|
138
|
+
for (const [key, value] of Object.entries(aliasMap)) {
|
|
139
|
+
const targets = value;
|
|
140
|
+
for (const target of targets) {
|
|
141
|
+
aliasToMain.set(key, target);
|
|
142
|
+
if (!mainToAliases.has(target)) mainToAliases.set(target, []);
|
|
143
|
+
mainToAliases.get(target).push(key);
|
|
144
|
+
aliasToMain.set(target, key);
|
|
145
|
+
if (!mainToAliases.has(key)) mainToAliases.set(key, []);
|
|
146
|
+
mainToAliases.get(key).push(target);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
const options = {};
|
|
150
|
+
function getType(name) {
|
|
151
|
+
if (booleans.has(name)) return "boolean";
|
|
152
|
+
const aliases = mainToAliases.get(name) || [];
|
|
153
|
+
for (const alias of aliases) if (booleans.has(alias)) return "boolean";
|
|
154
|
+
return "string";
|
|
155
|
+
}
|
|
156
|
+
const allOptions = /* @__PURE__ */ new Set([
|
|
157
|
+
...booleans,
|
|
158
|
+
...strings,
|
|
159
|
+
...Object.keys(aliasMap),
|
|
160
|
+
...Object.values(aliasMap).flat(),
|
|
161
|
+
...Object.keys(defaults)
|
|
162
|
+
]);
|
|
163
|
+
for (const name of allOptions) if (!options[name]) options[name] = {
|
|
164
|
+
type: getType(name),
|
|
165
|
+
default: defaults[name]
|
|
166
|
+
};
|
|
167
|
+
for (const [alias, main] of aliasToMain.entries()) if (alias.length === 1 && options[main] && !options[main].short) options[main].short = alias;
|
|
168
|
+
const processedArgs = [];
|
|
169
|
+
const negatedFlags = {};
|
|
170
|
+
for (let i = 0; i < args2.length; i++) {
|
|
171
|
+
const arg = args2[i];
|
|
172
|
+
if (arg === "--") {
|
|
173
|
+
processedArgs.push(...args2.slice(i));
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
if (arg.startsWith("--no-")) {
|
|
177
|
+
const flagName = arg.slice(5);
|
|
178
|
+
negatedFlags[flagName] = true;
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
processedArgs.push(arg);
|
|
182
|
+
}
|
|
183
|
+
let parsed;
|
|
184
|
+
try {
|
|
185
|
+
parsed = parseArgs$1({
|
|
186
|
+
args: processedArgs,
|
|
187
|
+
options: Object.keys(options).length > 0 ? options : void 0,
|
|
188
|
+
allowPositionals: true,
|
|
189
|
+
strict: false
|
|
190
|
+
});
|
|
191
|
+
} catch {
|
|
192
|
+
parsed = {
|
|
193
|
+
values: {},
|
|
194
|
+
positionals: processedArgs
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
const out = { _: [] };
|
|
198
|
+
out._ = parsed.positionals;
|
|
199
|
+
for (const [key, value] of Object.entries(parsed.values)) out[key] = value;
|
|
200
|
+
for (const [name] of Object.entries(negatedFlags)) out[name] = false;
|
|
201
|
+
for (const [alias, main] of aliasToMain.entries()) {
|
|
202
|
+
if (out[alias] !== void 0 && out[main] === void 0) out[main] = out[alias];
|
|
203
|
+
if (out[main] !== void 0 && out[alias] === void 0) out[alias] = out[main];
|
|
204
|
+
}
|
|
205
|
+
return out;
|
|
206
|
+
}
|
|
207
|
+
function parseArgs(rawArgs, argsDef) {
|
|
208
|
+
const parseOptions = {
|
|
209
|
+
boolean: [],
|
|
210
|
+
string: [],
|
|
211
|
+
alias: {},
|
|
212
|
+
default: {}
|
|
213
|
+
};
|
|
214
|
+
const args2 = resolveArgs(argsDef);
|
|
215
|
+
for (const arg of args2) {
|
|
216
|
+
if (arg.type === "positional") continue;
|
|
217
|
+
if (arg.type === "string" || arg.type === "enum") parseOptions.string.push(arg.name);
|
|
218
|
+
else if (arg.type === "boolean") parseOptions.boolean.push(arg.name);
|
|
219
|
+
if (arg.default !== void 0) parseOptions.default[arg.name] = arg.default;
|
|
220
|
+
if (arg.alias) parseOptions.alias[arg.name] = arg.alias;
|
|
221
|
+
const camelName = camelCase(arg.name);
|
|
222
|
+
const kebabName = kebabCase(arg.name);
|
|
223
|
+
if (camelName !== arg.name || kebabName !== arg.name) {
|
|
224
|
+
const existingAliases = toArray(parseOptions.alias[arg.name] || []);
|
|
225
|
+
if (camelName !== arg.name && !existingAliases.includes(camelName)) existingAliases.push(camelName);
|
|
226
|
+
if (kebabName !== arg.name && !existingAliases.includes(kebabName)) existingAliases.push(kebabName);
|
|
227
|
+
if (existingAliases.length > 0) parseOptions.alias[arg.name] = existingAliases;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
const parsed = parseRawArgs(rawArgs, parseOptions);
|
|
231
|
+
const [...positionalArguments] = parsed._;
|
|
232
|
+
const parsedArgsProxy = new Proxy(parsed, { get(target, prop) {
|
|
233
|
+
return target[prop] ?? target[camelCase(prop)] ?? target[kebabCase(prop)];
|
|
234
|
+
} });
|
|
235
|
+
for (const [, arg] of args2.entries()) if (arg.type === "positional") {
|
|
236
|
+
const nextPositionalArgument = positionalArguments.shift();
|
|
237
|
+
if (nextPositionalArgument !== void 0) parsedArgsProxy[arg.name] = nextPositionalArgument;
|
|
238
|
+
else if (arg.default === void 0 && arg.required !== false) throw new CLIError(`Missing required positional argument: ${arg.name.toUpperCase()}`, "EARG");
|
|
239
|
+
else parsedArgsProxy[arg.name] = arg.default;
|
|
240
|
+
} else if (arg.type === "enum") {
|
|
241
|
+
const argument = parsedArgsProxy[arg.name];
|
|
242
|
+
const options = arg.options || [];
|
|
243
|
+
if (argument !== void 0 && options.length > 0 && !options.includes(argument)) throw new CLIError(`Invalid value for argument: ${cyan(`--${arg.name}`)} (${cyan(argument)}). Expected one of: ${options.map((o2) => cyan(o2)).join(", ")}.`, "EARG");
|
|
244
|
+
} else if (arg.required && parsedArgsProxy[arg.name] === void 0) throw new CLIError(`Missing required argument: --${arg.name}`, "EARG");
|
|
245
|
+
return parsedArgsProxy;
|
|
246
|
+
}
|
|
247
|
+
function resolveArgs(argsDef) {
|
|
248
|
+
const args2 = [];
|
|
249
|
+
for (const [name, argDef] of Object.entries(argsDef || {})) args2.push({
|
|
250
|
+
...argDef,
|
|
251
|
+
name,
|
|
252
|
+
alias: toArray(argDef.alias)
|
|
253
|
+
});
|
|
254
|
+
return args2;
|
|
255
|
+
}
|
|
256
|
+
function defineCommand(def) {
|
|
257
|
+
return def;
|
|
258
|
+
}
|
|
259
|
+
async function runCommand(cmd, opts) {
|
|
260
|
+
const cmdArgs = await resolveValue(cmd.args || {});
|
|
261
|
+
const parsedArgs = parseArgs(opts.rawArgs, cmdArgs);
|
|
262
|
+
const context = {
|
|
263
|
+
rawArgs: opts.rawArgs,
|
|
264
|
+
args: parsedArgs,
|
|
265
|
+
data: opts.data,
|
|
266
|
+
cmd
|
|
267
|
+
};
|
|
268
|
+
if (typeof cmd.setup === "function") await cmd.setup(context);
|
|
269
|
+
let result;
|
|
270
|
+
try {
|
|
271
|
+
const subCommands = await resolveValue(cmd.subCommands);
|
|
272
|
+
if (subCommands && Object.keys(subCommands).length > 0) {
|
|
273
|
+
const subCommandArgIndex = opts.rawArgs.findIndex((arg) => !arg.startsWith("-"));
|
|
274
|
+
const subCommandName = opts.rawArgs[subCommandArgIndex];
|
|
275
|
+
if (subCommandName) {
|
|
276
|
+
if (!subCommands[subCommandName]) throw new CLIError(`Unknown command ${cyan(subCommandName)}`, "E_UNKNOWN_COMMAND");
|
|
277
|
+
const subCommand = await resolveValue(subCommands[subCommandName]);
|
|
278
|
+
if (subCommand) await runCommand(subCommand, { rawArgs: opts.rawArgs.slice(subCommandArgIndex + 1) });
|
|
279
|
+
} else if (!cmd.run) throw new CLIError(`No command specified.`, "E_NO_COMMAND");
|
|
280
|
+
}
|
|
281
|
+
if (typeof cmd.run === "function") result = await cmd.run(context);
|
|
282
|
+
} finally {
|
|
283
|
+
if (typeof cmd.cleanup === "function") await cmd.cleanup(context);
|
|
284
|
+
}
|
|
285
|
+
return { result };
|
|
286
|
+
}
|
|
287
|
+
async function resolveSubCommand(cmd, rawArgs, parent) {
|
|
288
|
+
const subCommands = await resolveValue(cmd.subCommands);
|
|
289
|
+
if (subCommands && Object.keys(subCommands).length > 0) {
|
|
290
|
+
const subCommandArgIndex = rawArgs.findIndex((arg) => !arg.startsWith("-"));
|
|
291
|
+
const subCommandName = rawArgs[subCommandArgIndex];
|
|
292
|
+
const subCommand = await resolveValue(subCommands[subCommandName]);
|
|
293
|
+
if (subCommand) return resolveSubCommand(subCommand, rawArgs.slice(subCommandArgIndex + 1), cmd);
|
|
294
|
+
}
|
|
295
|
+
return [cmd, parent];
|
|
296
|
+
}
|
|
297
|
+
async function showUsage(cmd, parent) {
|
|
298
|
+
try {
|
|
299
|
+
console.log(await renderUsage(cmd, parent) + "\n");
|
|
300
|
+
} catch (error) {
|
|
301
|
+
console.error(error);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
async function renderUsage(cmd, parent) {
|
|
305
|
+
const cmdMeta = await resolveValue(cmd.meta || {});
|
|
306
|
+
const cmdArgs = resolveArgs(await resolveValue(cmd.args || {}));
|
|
307
|
+
const parentMeta = await resolveValue(parent?.meta || {});
|
|
308
|
+
const commandName = `${parentMeta.name ? `${parentMeta.name} ` : ""}` + (cmdMeta.name || process.argv[1]);
|
|
309
|
+
const argLines = [];
|
|
310
|
+
const posLines = [];
|
|
311
|
+
const commandsLines = [];
|
|
312
|
+
const usageLine = [];
|
|
313
|
+
for (const arg of cmdArgs) if (arg.type === "positional") {
|
|
314
|
+
const name = arg.name.toUpperCase();
|
|
315
|
+
const isRequired = arg.required !== false && arg.default === void 0;
|
|
316
|
+
const defaultHint = arg.default ? `="${arg.default}"` : "";
|
|
317
|
+
posLines.push([
|
|
318
|
+
cyan(name + defaultHint),
|
|
319
|
+
arg.description || "",
|
|
320
|
+
arg.valueHint ? `<${arg.valueHint}>` : ""
|
|
321
|
+
]);
|
|
322
|
+
usageLine.push(isRequired ? `<${name}>` : `[${name}]`);
|
|
323
|
+
} else {
|
|
324
|
+
const isRequired = arg.required === true && arg.default === void 0;
|
|
325
|
+
const argStr = [...(arg.alias || []).map((a) => `-${a}`), `--${arg.name}`].join(", ") + (arg.type === "string" && (arg.valueHint || arg.default) ? `=${arg.valueHint ? `<${arg.valueHint}>` : `"${arg.default || ""}"`}` : "") + (arg.type === "enum" && arg.options ? `=<${arg.options.join("|")}>` : "");
|
|
326
|
+
argLines.push([cyan(argStr + (isRequired ? " (required)" : "")), arg.description || ""]);
|
|
327
|
+
if (arg.type === "boolean" && (arg.default === true || arg.negativeDescription) && !negativePrefixRe.test(arg.name)) {
|
|
328
|
+
const negativeArgStr = [...(arg.alias || []).map((a) => `--no-${a}`), `--no-${arg.name}`].join(", ");
|
|
329
|
+
argLines.push([cyan(negativeArgStr + (isRequired ? " (required)" : "")), arg.negativeDescription || ""]);
|
|
330
|
+
}
|
|
331
|
+
if (isRequired) usageLine.push(argStr);
|
|
332
|
+
}
|
|
333
|
+
if (cmd.subCommands) {
|
|
334
|
+
const commandNames = [];
|
|
335
|
+
const subCommands = await resolveValue(cmd.subCommands);
|
|
336
|
+
for (const [name, sub] of Object.entries(subCommands)) {
|
|
337
|
+
const meta = await resolveValue((await resolveValue(sub))?.meta);
|
|
338
|
+
if (meta?.hidden) continue;
|
|
339
|
+
commandsLines.push([cyan(name), meta?.description || ""]);
|
|
340
|
+
commandNames.push(name);
|
|
341
|
+
}
|
|
342
|
+
usageLine.push(commandNames.join("|"));
|
|
343
|
+
}
|
|
344
|
+
const usageLines = [];
|
|
345
|
+
const version = cmdMeta.version || parentMeta.version;
|
|
346
|
+
usageLines.push(gray(`${cmdMeta.description} (${commandName + (version ? ` v${version}` : "")})`), "");
|
|
347
|
+
const hasOptions = argLines.length > 0 || posLines.length > 0;
|
|
348
|
+
usageLines.push(`${underline(bold("USAGE"))} ${cyan(`${commandName}${hasOptions ? " [OPTIONS]" : ""} ${usageLine.join(" ")}`)}`, "");
|
|
349
|
+
if (posLines.length > 0) {
|
|
350
|
+
usageLines.push(underline(bold("ARGUMENTS")), "");
|
|
351
|
+
usageLines.push(formatLineColumns(posLines, " "));
|
|
352
|
+
usageLines.push("");
|
|
353
|
+
}
|
|
354
|
+
if (argLines.length > 0) {
|
|
355
|
+
usageLines.push(underline(bold("OPTIONS")), "");
|
|
356
|
+
usageLines.push(formatLineColumns(argLines, " "));
|
|
357
|
+
usageLines.push("");
|
|
358
|
+
}
|
|
359
|
+
if (commandsLines.length > 0) {
|
|
360
|
+
usageLines.push(underline(bold("COMMANDS")), "");
|
|
361
|
+
usageLines.push(formatLineColumns(commandsLines, " "));
|
|
362
|
+
usageLines.push("", `Use ${cyan(`${commandName} <command> --help`)} for more information about a command.`);
|
|
363
|
+
}
|
|
364
|
+
return usageLines.filter((l2) => typeof l2 === "string").join("\n");
|
|
365
|
+
}
|
|
366
|
+
async function runMain(cmd, opts = {}) {
|
|
367
|
+
const rawArgs = opts.rawArgs || process.argv.slice(2);
|
|
368
|
+
const showUsage$1 = opts.showUsage || showUsage;
|
|
369
|
+
try {
|
|
370
|
+
if (rawArgs.includes("--help") || rawArgs.includes("-h")) {
|
|
371
|
+
await showUsage$1(...await resolveSubCommand(cmd, rawArgs));
|
|
372
|
+
process.exit(0);
|
|
373
|
+
} else if (rawArgs.length === 1 && rawArgs[0] === "--version") {
|
|
374
|
+
const meta = typeof cmd.meta === "function" ? await cmd.meta() : await cmd.meta;
|
|
375
|
+
if (!meta?.version) throw new CLIError("No version specified", "E_NO_VERSION");
|
|
376
|
+
console.log(meta.version);
|
|
377
|
+
} else await runCommand(cmd, { rawArgs });
|
|
378
|
+
} catch (error) {
|
|
379
|
+
if (error instanceof CLIError) {
|
|
380
|
+
await showUsage$1(...await resolveSubCommand(cmd, rawArgs));
|
|
381
|
+
console.error(error.message);
|
|
382
|
+
} else console.error(error, "\n");
|
|
383
|
+
process.exit(1);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
var CLIError, noColor, _c, bold, cyan, gray, underline, negativePrefixRe;
|
|
387
|
+
var init_dist = __esm({
|
|
388
|
+
"node_modules/citty/dist/index.mjs"() {
|
|
389
|
+
"use strict";
|
|
390
|
+
init_esm_shims();
|
|
391
|
+
init_scule();
|
|
392
|
+
CLIError = class extends Error {
|
|
393
|
+
code;
|
|
394
|
+
constructor(message, code) {
|
|
395
|
+
super(message);
|
|
396
|
+
this.name = "CLIError";
|
|
397
|
+
this.code = code;
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
noColor = /* @__PURE__ */ (() => {
|
|
401
|
+
const env = globalThis.process?.env ?? {};
|
|
402
|
+
return env.NO_COLOR === "1" || env.TERM === "dumb" || env.TEST || env.CI;
|
|
403
|
+
})();
|
|
404
|
+
_c = (c, r2 = 39) => (t) => noColor ? t : `\x1B[${c}m${t}\x1B[${r2}m`;
|
|
405
|
+
bold = /* @__PURE__ */ _c(1, 22);
|
|
406
|
+
cyan = /* @__PURE__ */ _c(36);
|
|
407
|
+
gray = /* @__PURE__ */ _c(90);
|
|
408
|
+
underline = /* @__PURE__ */ _c(4, 24);
|
|
409
|
+
negativePrefixRe = /^no[-A-Z]/;
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
|
|
413
|
+
// node_modules/picocolors/picocolors.js
|
|
414
|
+
var require_picocolors = __commonJS({
|
|
415
|
+
"node_modules/picocolors/picocolors.js"(exports, module) {
|
|
416
|
+
"use strict";
|
|
417
|
+
init_esm_shims();
|
|
418
|
+
var p2 = process || {};
|
|
419
|
+
var argv = p2.argv || [];
|
|
420
|
+
var env = p2.env || {};
|
|
421
|
+
var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p2.platform === "win32" || (p2.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
422
|
+
var formatter = (open, close, replace = open) => (input) => {
|
|
423
|
+
let string = "" + input, index = string.indexOf(close, open.length);
|
|
424
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
425
|
+
};
|
|
426
|
+
var replaceClose = (string, close, replace, index) => {
|
|
427
|
+
let result = "", cursor = 0;
|
|
428
|
+
do {
|
|
429
|
+
result += string.substring(cursor, index) + replace;
|
|
430
|
+
cursor = index + close.length;
|
|
431
|
+
index = string.indexOf(close, cursor);
|
|
432
|
+
} while (~index);
|
|
433
|
+
return result + string.substring(cursor);
|
|
434
|
+
};
|
|
435
|
+
var createColors = (enabled = isColorSupported) => {
|
|
436
|
+
let f = enabled ? formatter : () => String;
|
|
437
|
+
return {
|
|
438
|
+
isColorSupported: enabled,
|
|
439
|
+
reset: f("\x1B[0m", "\x1B[0m"),
|
|
440
|
+
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
441
|
+
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
442
|
+
italic: f("\x1B[3m", "\x1B[23m"),
|
|
443
|
+
underline: f("\x1B[4m", "\x1B[24m"),
|
|
444
|
+
inverse: f("\x1B[7m", "\x1B[27m"),
|
|
445
|
+
hidden: f("\x1B[8m", "\x1B[28m"),
|
|
446
|
+
strikethrough: f("\x1B[9m", "\x1B[29m"),
|
|
447
|
+
black: f("\x1B[30m", "\x1B[39m"),
|
|
448
|
+
red: f("\x1B[31m", "\x1B[39m"),
|
|
449
|
+
green: f("\x1B[32m", "\x1B[39m"),
|
|
450
|
+
yellow: f("\x1B[33m", "\x1B[39m"),
|
|
451
|
+
blue: f("\x1B[34m", "\x1B[39m"),
|
|
452
|
+
magenta: f("\x1B[35m", "\x1B[39m"),
|
|
453
|
+
cyan: f("\x1B[36m", "\x1B[39m"),
|
|
454
|
+
white: f("\x1B[37m", "\x1B[39m"),
|
|
455
|
+
gray: f("\x1B[90m", "\x1B[39m"),
|
|
456
|
+
bgBlack: f("\x1B[40m", "\x1B[49m"),
|
|
457
|
+
bgRed: f("\x1B[41m", "\x1B[49m"),
|
|
458
|
+
bgGreen: f("\x1B[42m", "\x1B[49m"),
|
|
459
|
+
bgYellow: f("\x1B[43m", "\x1B[49m"),
|
|
460
|
+
bgBlue: f("\x1B[44m", "\x1B[49m"),
|
|
461
|
+
bgMagenta: f("\x1B[45m", "\x1B[49m"),
|
|
462
|
+
bgCyan: f("\x1B[46m", "\x1B[49m"),
|
|
463
|
+
bgWhite: f("\x1B[47m", "\x1B[49m"),
|
|
464
|
+
blackBright: f("\x1B[90m", "\x1B[39m"),
|
|
465
|
+
redBright: f("\x1B[91m", "\x1B[39m"),
|
|
466
|
+
greenBright: f("\x1B[92m", "\x1B[39m"),
|
|
467
|
+
yellowBright: f("\x1B[93m", "\x1B[39m"),
|
|
468
|
+
blueBright: f("\x1B[94m", "\x1B[39m"),
|
|
469
|
+
magentaBright: f("\x1B[95m", "\x1B[39m"),
|
|
470
|
+
cyanBright: f("\x1B[96m", "\x1B[39m"),
|
|
471
|
+
whiteBright: f("\x1B[97m", "\x1B[39m"),
|
|
472
|
+
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
|
|
473
|
+
bgRedBright: f("\x1B[101m", "\x1B[49m"),
|
|
474
|
+
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
|
|
475
|
+
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
|
|
476
|
+
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
|
|
477
|
+
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
|
|
478
|
+
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
479
|
+
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
480
|
+
};
|
|
481
|
+
};
|
|
482
|
+
module.exports = createColors();
|
|
483
|
+
module.exports.createColors = createColors;
|
|
484
|
+
}
|
|
485
|
+
});
|
|
486
|
+
|
|
487
|
+
// node_modules/sisteransi/src/index.js
|
|
488
|
+
var require_src = __commonJS({
|
|
489
|
+
"node_modules/sisteransi/src/index.js"(exports, module) {
|
|
490
|
+
"use strict";
|
|
491
|
+
init_esm_shims();
|
|
492
|
+
var ESC = "\x1B";
|
|
493
|
+
var CSI = `${ESC}[`;
|
|
494
|
+
var beep = "\x07";
|
|
495
|
+
var cursor = {
|
|
496
|
+
to(x2, y3) {
|
|
497
|
+
if (!y3) return `${CSI}${x2 + 1}G`;
|
|
498
|
+
return `${CSI}${y3 + 1};${x2 + 1}H`;
|
|
499
|
+
},
|
|
500
|
+
move(x2, y3) {
|
|
501
|
+
let ret = "";
|
|
502
|
+
if (x2 < 0) ret += `${CSI}${-x2}D`;
|
|
503
|
+
else if (x2 > 0) ret += `${CSI}${x2}C`;
|
|
504
|
+
if (y3 < 0) ret += `${CSI}${-y3}A`;
|
|
505
|
+
else if (y3 > 0) ret += `${CSI}${y3}B`;
|
|
506
|
+
return ret;
|
|
507
|
+
},
|
|
508
|
+
up: (count = 1) => `${CSI}${count}A`,
|
|
509
|
+
down: (count = 1) => `${CSI}${count}B`,
|
|
510
|
+
forward: (count = 1) => `${CSI}${count}C`,
|
|
511
|
+
backward: (count = 1) => `${CSI}${count}D`,
|
|
512
|
+
nextLine: (count = 1) => `${CSI}E`.repeat(count),
|
|
513
|
+
prevLine: (count = 1) => `${CSI}F`.repeat(count),
|
|
514
|
+
left: `${CSI}G`,
|
|
515
|
+
hide: `${CSI}?25l`,
|
|
516
|
+
show: `${CSI}?25h`,
|
|
517
|
+
save: `${ESC}7`,
|
|
518
|
+
restore: `${ESC}8`
|
|
519
|
+
};
|
|
520
|
+
var scroll = {
|
|
521
|
+
up: (count = 1) => `${CSI}S`.repeat(count),
|
|
522
|
+
down: (count = 1) => `${CSI}T`.repeat(count)
|
|
523
|
+
};
|
|
524
|
+
var erase = {
|
|
525
|
+
screen: `${CSI}2J`,
|
|
526
|
+
up: (count = 1) => `${CSI}1J`.repeat(count),
|
|
527
|
+
down: (count = 1) => `${CSI}J`.repeat(count),
|
|
528
|
+
line: `${CSI}2K`,
|
|
529
|
+
lineEnd: `${CSI}K`,
|
|
530
|
+
lineStart: `${CSI}1K`,
|
|
531
|
+
lines(count) {
|
|
532
|
+
let clear = "";
|
|
533
|
+
for (let i = 0; i < count; i++)
|
|
534
|
+
clear += this.line + (i < count - 1 ? cursor.up() : "");
|
|
535
|
+
if (count)
|
|
536
|
+
clear += cursor.left;
|
|
537
|
+
return clear;
|
|
538
|
+
}
|
|
539
|
+
};
|
|
540
|
+
module.exports = { cursor, scroll, erase, beep };
|
|
541
|
+
}
|
|
542
|
+
});
|
|
543
|
+
|
|
544
|
+
// node_modules/@clack/core/dist/index.mjs
|
|
545
|
+
import { stdin as j, stdout as M } from "process";
|
|
546
|
+
import * as g from "readline";
|
|
547
|
+
import O from "readline";
|
|
548
|
+
import { Writable as X } from "stream";
|
|
549
|
+
function DD({ onlyFirst: e2 = false } = {}) {
|
|
550
|
+
const t = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
|
|
551
|
+
return new RegExp(t, e2 ? void 0 : "g");
|
|
552
|
+
}
|
|
553
|
+
function P(e2) {
|
|
554
|
+
if (typeof e2 != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof e2}\``);
|
|
555
|
+
return e2.replace(uD, "");
|
|
556
|
+
}
|
|
557
|
+
function L(e2) {
|
|
558
|
+
return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
|
|
559
|
+
}
|
|
560
|
+
function p(e2, u2 = {}) {
|
|
561
|
+
if (typeof e2 != "string" || e2.length === 0 || (u2 = { ambiguousIsNarrow: true, ...u2 }, e2 = P(e2), e2.length === 0)) return 0;
|
|
562
|
+
e2 = e2.replace(sD(), " ");
|
|
563
|
+
const t = u2.ambiguousIsNarrow ? 1 : 2;
|
|
564
|
+
let F2 = 0;
|
|
565
|
+
for (const s of e2) {
|
|
566
|
+
const i = s.codePointAt(0);
|
|
567
|
+
if (i <= 31 || i >= 127 && i <= 159 || i >= 768 && i <= 879) continue;
|
|
568
|
+
switch (eD.eastAsianWidth(s)) {
|
|
569
|
+
case "F":
|
|
570
|
+
case "W":
|
|
571
|
+
F2 += 2;
|
|
572
|
+
break;
|
|
573
|
+
case "A":
|
|
574
|
+
F2 += t;
|
|
575
|
+
break;
|
|
576
|
+
default:
|
|
577
|
+
F2 += 1;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
return F2;
|
|
581
|
+
}
|
|
582
|
+
function rD() {
|
|
583
|
+
const e2 = /* @__PURE__ */ new Map();
|
|
584
|
+
for (const [u2, t] of Object.entries(r)) {
|
|
585
|
+
for (const [F2, s] of Object.entries(t)) r[F2] = { open: `\x1B[${s[0]}m`, close: `\x1B[${s[1]}m` }, t[F2] = r[F2], e2.set(s[0], s[1]);
|
|
586
|
+
Object.defineProperty(r, u2, { value: t, enumerable: false });
|
|
587
|
+
}
|
|
588
|
+
return Object.defineProperty(r, "codes", { value: e2, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = N(), r.color.ansi256 = I(), r.color.ansi16m = R(), r.bgColor.ansi = N(w), r.bgColor.ansi256 = I(w), r.bgColor.ansi16m = R(w), Object.defineProperties(r, { rgbToAnsi256: { value: (u2, t, F2) => u2 === t && t === F2 ? u2 < 8 ? 16 : u2 > 248 ? 231 : Math.round((u2 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u2 / 255 * 5) + 6 * Math.round(t / 255 * 5) + Math.round(F2 / 255 * 5), enumerable: false }, hexToRgb: { value: (u2) => {
|
|
589
|
+
const t = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u2.toString(16));
|
|
590
|
+
if (!t) return [0, 0, 0];
|
|
591
|
+
let [F2] = t;
|
|
592
|
+
F2.length === 3 && (F2 = [...F2].map((i) => i + i).join(""));
|
|
593
|
+
const s = Number.parseInt(F2, 16);
|
|
594
|
+
return [s >> 16 & 255, s >> 8 & 255, s & 255];
|
|
595
|
+
}, enumerable: false }, hexToAnsi256: { value: (u2) => r.rgbToAnsi256(...r.hexToRgb(u2)), enumerable: false }, ansi256ToAnsi: { value: (u2) => {
|
|
596
|
+
if (u2 < 8) return 30 + u2;
|
|
597
|
+
if (u2 < 16) return 90 + (u2 - 8);
|
|
598
|
+
let t, F2, s;
|
|
599
|
+
if (u2 >= 232) t = ((u2 - 232) * 10 + 8) / 255, F2 = t, s = t;
|
|
600
|
+
else {
|
|
601
|
+
u2 -= 16;
|
|
602
|
+
const C2 = u2 % 36;
|
|
603
|
+
t = Math.floor(u2 / 36) / 5, F2 = Math.floor(C2 / 6) / 5, s = C2 % 6 / 5;
|
|
604
|
+
}
|
|
605
|
+
const i = Math.max(t, F2, s) * 2;
|
|
606
|
+
if (i === 0) return 30;
|
|
607
|
+
let D2 = 30 + (Math.round(s) << 2 | Math.round(F2) << 1 | Math.round(t));
|
|
608
|
+
return i === 2 && (D2 += 60), D2;
|
|
609
|
+
}, enumerable: false }, rgbToAnsi: { value: (u2, t, F2) => r.ansi256ToAnsi(r.rgbToAnsi256(u2, t, F2)), enumerable: false }, hexToAnsi: { value: (u2) => r.ansi256ToAnsi(r.hexToAnsi256(u2)), enumerable: false } }), r;
|
|
610
|
+
}
|
|
611
|
+
function Y(e2, u2, t) {
|
|
612
|
+
return String(e2).normalize().replace(/\r\n/g, `
|
|
613
|
+
`).split(`
|
|
614
|
+
`).map((F2) => lD(F2, u2, t)).join(`
|
|
615
|
+
`);
|
|
616
|
+
}
|
|
617
|
+
function $(e2, u2) {
|
|
618
|
+
if (typeof e2 == "string") return B.aliases.get(e2) === u2;
|
|
619
|
+
for (const t of e2) if (t !== void 0 && $(t, u2)) return true;
|
|
620
|
+
return false;
|
|
621
|
+
}
|
|
622
|
+
function BD(e2, u2) {
|
|
623
|
+
if (e2 === u2) return;
|
|
624
|
+
const t = e2.split(`
|
|
625
|
+
`), F2 = u2.split(`
|
|
626
|
+
`), s = [];
|
|
627
|
+
for (let i = 0; i < Math.max(t.length, F2.length); i++) t[i] !== F2[i] && s.push(i);
|
|
628
|
+
return s;
|
|
629
|
+
}
|
|
630
|
+
function pD(e2) {
|
|
631
|
+
return e2 === S;
|
|
632
|
+
}
|
|
633
|
+
function m(e2, u2) {
|
|
634
|
+
const t = e2;
|
|
635
|
+
t.isTTY && t.setRawMode(u2);
|
|
636
|
+
}
|
|
637
|
+
function fD({ input: e2 = j, output: u2 = M, overwrite: t = true, hideCursor: F2 = true } = {}) {
|
|
638
|
+
const s = g.createInterface({ input: e2, output: u2, prompt: "", tabSize: 1 });
|
|
639
|
+
g.emitKeypressEvents(e2, s), e2.isTTY && e2.setRawMode(true);
|
|
640
|
+
const i = (D2, { name: C2, sequence: n }) => {
|
|
641
|
+
const E = String(D2);
|
|
642
|
+
if ($([E, C2, n], "cancel")) {
|
|
643
|
+
F2 && u2.write(import_sisteransi.cursor.show), process.exit(0);
|
|
644
|
+
return;
|
|
645
|
+
}
|
|
646
|
+
if (!t) return;
|
|
647
|
+
const a = C2 === "return" ? 0 : -1, o2 = C2 === "return" ? -1 : 0;
|
|
648
|
+
g.moveCursor(u2, a, o2, () => {
|
|
649
|
+
g.clearLine(u2, 1, () => {
|
|
650
|
+
e2.once("keypress", i);
|
|
651
|
+
});
|
|
652
|
+
});
|
|
653
|
+
};
|
|
654
|
+
return F2 && u2.write(import_sisteransi.cursor.hide), e2.once("keypress", i), () => {
|
|
655
|
+
e2.off("keypress", i), F2 && u2.write(import_sisteransi.cursor.show), e2.isTTY && !AD && e2.setRawMode(false), s.terminal = false, s.close();
|
|
656
|
+
};
|
|
657
|
+
}
|
|
658
|
+
var import_sisteransi, import_picocolors2, uD, W, tD, eD, FD, sD, w, N, I, R, r, iD, CD, ED, d, oD, y, V, nD, G, _, z, K, aD, k, hD, lD, xD, B, AD, S, gD, vD, h, x, dD, A, OD, PD, J, LD, RD;
|
|
659
|
+
var init_dist2 = __esm({
|
|
660
|
+
"node_modules/@clack/core/dist/index.mjs"() {
|
|
661
|
+
"use strict";
|
|
662
|
+
init_esm_shims();
|
|
663
|
+
import_sisteransi = __toESM(require_src(), 1);
|
|
664
|
+
import_picocolors2 = __toESM(require_picocolors(), 1);
|
|
665
|
+
uD = DD();
|
|
666
|
+
W = { exports: {} };
|
|
667
|
+
(function(e2) {
|
|
668
|
+
var u2 = {};
|
|
669
|
+
e2.exports = u2, u2.eastAsianWidth = function(F2) {
|
|
670
|
+
var s = F2.charCodeAt(0), i = F2.length == 2 ? F2.charCodeAt(1) : 0, D2 = s;
|
|
671
|
+
return 55296 <= s && s <= 56319 && 56320 <= i && i <= 57343 && (s &= 1023, i &= 1023, D2 = s << 10 | i, D2 += 65536), D2 == 12288 || 65281 <= D2 && D2 <= 65376 || 65504 <= D2 && D2 <= 65510 ? "F" : D2 == 8361 || 65377 <= D2 && D2 <= 65470 || 65474 <= D2 && D2 <= 65479 || 65482 <= D2 && D2 <= 65487 || 65490 <= D2 && D2 <= 65495 || 65498 <= D2 && D2 <= 65500 || 65512 <= D2 && D2 <= 65518 ? "H" : 4352 <= D2 && D2 <= 4447 || 4515 <= D2 && D2 <= 4519 || 4602 <= D2 && D2 <= 4607 || 9001 <= D2 && D2 <= 9002 || 11904 <= D2 && D2 <= 11929 || 11931 <= D2 && D2 <= 12019 || 12032 <= D2 && D2 <= 12245 || 12272 <= D2 && D2 <= 12283 || 12289 <= D2 && D2 <= 12350 || 12353 <= D2 && D2 <= 12438 || 12441 <= D2 && D2 <= 12543 || 12549 <= D2 && D2 <= 12589 || 12593 <= D2 && D2 <= 12686 || 12688 <= D2 && D2 <= 12730 || 12736 <= D2 && D2 <= 12771 || 12784 <= D2 && D2 <= 12830 || 12832 <= D2 && D2 <= 12871 || 12880 <= D2 && D2 <= 13054 || 13056 <= D2 && D2 <= 19903 || 19968 <= D2 && D2 <= 42124 || 42128 <= D2 && D2 <= 42182 || 43360 <= D2 && D2 <= 43388 || 44032 <= D2 && D2 <= 55203 || 55216 <= D2 && D2 <= 55238 || 55243 <= D2 && D2 <= 55291 || 63744 <= D2 && D2 <= 64255 || 65040 <= D2 && D2 <= 65049 || 65072 <= D2 && D2 <= 65106 || 65108 <= D2 && D2 <= 65126 || 65128 <= D2 && D2 <= 65131 || 110592 <= D2 && D2 <= 110593 || 127488 <= D2 && D2 <= 127490 || 127504 <= D2 && D2 <= 127546 || 127552 <= D2 && D2 <= 127560 || 127568 <= D2 && D2 <= 127569 || 131072 <= D2 && D2 <= 194367 || 177984 <= D2 && D2 <= 196605 || 196608 <= D2 && D2 <= 262141 ? "W" : 32 <= D2 && D2 <= 126 || 162 <= D2 && D2 <= 163 || 165 <= D2 && D2 <= 166 || D2 == 172 || D2 == 175 || 10214 <= D2 && D2 <= 10221 || 10629 <= D2 && D2 <= 10630 ? "Na" : D2 == 161 || D2 == 164 || 167 <= D2 && D2 <= 168 || D2 == 170 || 173 <= D2 && D2 <= 174 || 176 <= D2 && D2 <= 180 || 182 <= D2 && D2 <= 186 || 188 <= D2 && D2 <= 191 || D2 == 198 || D2 == 208 || 215 <= D2 && D2 <= 216 || 222 <= D2 && D2 <= 225 || D2 == 230 || 232 <= D2 && D2 <= 234 || 236 <= D2 && D2 <= 237 || D2 == 240 || 242 <= D2 && D2 <= 243 || 247 <= D2 && D2 <= 250 || D2 == 252 || D2 == 254 || D2 == 257 || D2 == 273 || D2 == 275 || D2 == 283 || 294 <= D2 && D2 <= 295 || D2 == 299 || 305 <= D2 && D2 <= 307 || D2 == 312 || 319 <= D2 && D2 <= 322 || D2 == 324 || 328 <= D2 && D2 <= 331 || D2 == 333 || 338 <= D2 && D2 <= 339 || 358 <= D2 && D2 <= 359 || D2 == 363 || D2 == 462 || D2 == 464 || D2 == 466 || D2 == 468 || D2 == 470 || D2 == 472 || D2 == 474 || D2 == 476 || D2 == 593 || D2 == 609 || D2 == 708 || D2 == 711 || 713 <= D2 && D2 <= 715 || D2 == 717 || D2 == 720 || 728 <= D2 && D2 <= 731 || D2 == 733 || D2 == 735 || 768 <= D2 && D2 <= 879 || 913 <= D2 && D2 <= 929 || 931 <= D2 && D2 <= 937 || 945 <= D2 && D2 <= 961 || 963 <= D2 && D2 <= 969 || D2 == 1025 || 1040 <= D2 && D2 <= 1103 || D2 == 1105 || D2 == 8208 || 8211 <= D2 && D2 <= 8214 || 8216 <= D2 && D2 <= 8217 || 8220 <= D2 && D2 <= 8221 || 8224 <= D2 && D2 <= 8226 || 8228 <= D2 && D2 <= 8231 || D2 == 8240 || 8242 <= D2 && D2 <= 8243 || D2 == 8245 || D2 == 8251 || D2 == 8254 || D2 == 8308 || D2 == 8319 || 8321 <= D2 && D2 <= 8324 || D2 == 8364 || D2 == 8451 || D2 == 8453 || D2 == 8457 || D2 == 8467 || D2 == 8470 || 8481 <= D2 && D2 <= 8482 || D2 == 8486 || D2 == 8491 || 8531 <= D2 && D2 <= 8532 || 8539 <= D2 && D2 <= 8542 || 8544 <= D2 && D2 <= 8555 || 8560 <= D2 && D2 <= 8569 || D2 == 8585 || 8592 <= D2 && D2 <= 8601 || 8632 <= D2 && D2 <= 8633 || D2 == 8658 || D2 == 8660 || D2 == 8679 || D2 == 8704 || 8706 <= D2 && D2 <= 8707 || 8711 <= D2 && D2 <= 8712 || D2 == 8715 || D2 == 8719 || D2 == 8721 || D2 == 8725 || D2 == 8730 || 8733 <= D2 && D2 <= 8736 || D2 == 8739 || D2 == 8741 || 8743 <= D2 && D2 <= 8748 || D2 == 8750 || 8756 <= D2 && D2 <= 8759 || 8764 <= D2 && D2 <= 8765 || D2 == 8776 || D2 == 8780 || D2 == 8786 || 8800 <= D2 && D2 <= 8801 || 8804 <= D2 && D2 <= 8807 || 8810 <= D2 && D2 <= 8811 || 8814 <= D2 && D2 <= 8815 || 8834 <= D2 && D2 <= 8835 || 8838 <= D2 && D2 <= 8839 || D2 == 8853 || D2 == 8857 || D2 == 8869 || D2 == 8895 || D2 == 8978 || 9312 <= D2 && D2 <= 9449 || 9451 <= D2 && D2 <= 9547 || 9552 <= D2 && D2 <= 9587 || 9600 <= D2 && D2 <= 9615 || 9618 <= D2 && D2 <= 9621 || 9632 <= D2 && D2 <= 9633 || 9635 <= D2 && D2 <= 9641 || 9650 <= D2 && D2 <= 9651 || 9654 <= D2 && D2 <= 9655 || 9660 <= D2 && D2 <= 9661 || 9664 <= D2 && D2 <= 9665 || 9670 <= D2 && D2 <= 9672 || D2 == 9675 || 9678 <= D2 && D2 <= 9681 || 9698 <= D2 && D2 <= 9701 || D2 == 9711 || 9733 <= D2 && D2 <= 9734 || D2 == 9737 || 9742 <= D2 && D2 <= 9743 || 9748 <= D2 && D2 <= 9749 || D2 == 9756 || D2 == 9758 || D2 == 9792 || D2 == 9794 || 9824 <= D2 && D2 <= 9825 || 9827 <= D2 && D2 <= 9829 || 9831 <= D2 && D2 <= 9834 || 9836 <= D2 && D2 <= 9837 || D2 == 9839 || 9886 <= D2 && D2 <= 9887 || 9918 <= D2 && D2 <= 9919 || 9924 <= D2 && D2 <= 9933 || 9935 <= D2 && D2 <= 9953 || D2 == 9955 || 9960 <= D2 && D2 <= 9983 || D2 == 10045 || D2 == 10071 || 10102 <= D2 && D2 <= 10111 || 11093 <= D2 && D2 <= 11097 || 12872 <= D2 && D2 <= 12879 || 57344 <= D2 && D2 <= 63743 || 65024 <= D2 && D2 <= 65039 || D2 == 65533 || 127232 <= D2 && D2 <= 127242 || 127248 <= D2 && D2 <= 127277 || 127280 <= D2 && D2 <= 127337 || 127344 <= D2 && D2 <= 127386 || 917760 <= D2 && D2 <= 917999 || 983040 <= D2 && D2 <= 1048573 || 1048576 <= D2 && D2 <= 1114109 ? "A" : "N";
|
|
672
|
+
}, u2.characterLength = function(F2) {
|
|
673
|
+
var s = this.eastAsianWidth(F2);
|
|
674
|
+
return s == "F" || s == "W" || s == "A" ? 2 : 1;
|
|
675
|
+
};
|
|
676
|
+
function t(F2) {
|
|
677
|
+
return F2.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
|
|
678
|
+
}
|
|
679
|
+
u2.length = function(F2) {
|
|
680
|
+
for (var s = t(F2), i = 0, D2 = 0; D2 < s.length; D2++) i = i + this.characterLength(s[D2]);
|
|
681
|
+
return i;
|
|
682
|
+
}, u2.slice = function(F2, s, i) {
|
|
683
|
+
textLen = u2.length(F2), s = s || 0, i = i || 1, s < 0 && (s = textLen + s), i < 0 && (i = textLen + i);
|
|
684
|
+
for (var D2 = "", C2 = 0, n = t(F2), E = 0; E < n.length; E++) {
|
|
685
|
+
var a = n[E], o2 = u2.length(a);
|
|
686
|
+
if (C2 >= s - (o2 == 2 ? 1 : 0)) if (C2 + o2 <= i) D2 += a;
|
|
687
|
+
else break;
|
|
688
|
+
C2 += o2;
|
|
689
|
+
}
|
|
690
|
+
return D2;
|
|
691
|
+
};
|
|
692
|
+
})(W);
|
|
693
|
+
tD = W.exports;
|
|
694
|
+
eD = L(tD);
|
|
695
|
+
FD = function() {
|
|
696
|
+
return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
|
|
697
|
+
};
|
|
698
|
+
sD = L(FD);
|
|
699
|
+
w = 10;
|
|
700
|
+
N = (e2 = 0) => (u2) => `\x1B[${u2 + e2}m`;
|
|
701
|
+
I = (e2 = 0) => (u2) => `\x1B[${38 + e2};5;${u2}m`;
|
|
702
|
+
R = (e2 = 0) => (u2, t, F2) => `\x1B[${38 + e2};2;${u2};${t};${F2}m`;
|
|
703
|
+
r = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } };
|
|
704
|
+
Object.keys(r.modifier);
|
|
705
|
+
iD = Object.keys(r.color);
|
|
706
|
+
CD = Object.keys(r.bgColor);
|
|
707
|
+
[...iD, ...CD];
|
|
708
|
+
ED = rD();
|
|
709
|
+
d = /* @__PURE__ */ new Set(["\x1B", "\x9B"]);
|
|
710
|
+
oD = 39;
|
|
711
|
+
y = "\x07";
|
|
712
|
+
V = "[";
|
|
713
|
+
nD = "]";
|
|
714
|
+
G = "m";
|
|
715
|
+
_ = `${nD}8;;`;
|
|
716
|
+
z = (e2) => `${d.values().next().value}${V}${e2}${G}`;
|
|
717
|
+
K = (e2) => `${d.values().next().value}${_}${e2}${y}`;
|
|
718
|
+
aD = (e2) => e2.split(" ").map((u2) => p(u2));
|
|
719
|
+
k = (e2, u2, t) => {
|
|
720
|
+
const F2 = [...u2];
|
|
721
|
+
let s = false, i = false, D2 = p(P(e2[e2.length - 1]));
|
|
722
|
+
for (const [C2, n] of F2.entries()) {
|
|
723
|
+
const E = p(n);
|
|
724
|
+
if (D2 + E <= t ? e2[e2.length - 1] += n : (e2.push(n), D2 = 0), d.has(n) && (s = true, i = F2.slice(C2 + 1).join("").startsWith(_)), s) {
|
|
725
|
+
i ? n === y && (s = false, i = false) : n === G && (s = false);
|
|
726
|
+
continue;
|
|
727
|
+
}
|
|
728
|
+
D2 += E, D2 === t && C2 < F2.length - 1 && (e2.push(""), D2 = 0);
|
|
729
|
+
}
|
|
730
|
+
!D2 && e2[e2.length - 1].length > 0 && e2.length > 1 && (e2[e2.length - 2] += e2.pop());
|
|
731
|
+
};
|
|
732
|
+
hD = (e2) => {
|
|
733
|
+
const u2 = e2.split(" ");
|
|
734
|
+
let t = u2.length;
|
|
735
|
+
for (; t > 0 && !(p(u2[t - 1]) > 0); ) t--;
|
|
736
|
+
return t === u2.length ? e2 : u2.slice(0, t).join(" ") + u2.slice(t).join("");
|
|
737
|
+
};
|
|
738
|
+
lD = (e2, u2, t = {}) => {
|
|
739
|
+
if (t.trim !== false && e2.trim() === "") return "";
|
|
740
|
+
let F2 = "", s, i;
|
|
741
|
+
const D2 = aD(e2);
|
|
742
|
+
let C2 = [""];
|
|
743
|
+
for (const [E, a] of e2.split(" ").entries()) {
|
|
744
|
+
t.trim !== false && (C2[C2.length - 1] = C2[C2.length - 1].trimStart());
|
|
745
|
+
let o2 = p(C2[C2.length - 1]);
|
|
746
|
+
if (E !== 0 && (o2 >= u2 && (t.wordWrap === false || t.trim === false) && (C2.push(""), o2 = 0), (o2 > 0 || t.trim === false) && (C2[C2.length - 1] += " ", o2++)), t.hard && D2[E] > u2) {
|
|
747
|
+
const c = u2 - o2, f = 1 + Math.floor((D2[E] - c - 1) / u2);
|
|
748
|
+
Math.floor((D2[E] - 1) / u2) < f && C2.push(""), k(C2, a, u2);
|
|
749
|
+
continue;
|
|
750
|
+
}
|
|
751
|
+
if (o2 + D2[E] > u2 && o2 > 0 && D2[E] > 0) {
|
|
752
|
+
if (t.wordWrap === false && o2 < u2) {
|
|
753
|
+
k(C2, a, u2);
|
|
754
|
+
continue;
|
|
755
|
+
}
|
|
756
|
+
C2.push("");
|
|
757
|
+
}
|
|
758
|
+
if (o2 + D2[E] > u2 && t.wordWrap === false) {
|
|
759
|
+
k(C2, a, u2);
|
|
760
|
+
continue;
|
|
761
|
+
}
|
|
762
|
+
C2[C2.length - 1] += a;
|
|
763
|
+
}
|
|
764
|
+
t.trim !== false && (C2 = C2.map((E) => hD(E)));
|
|
765
|
+
const n = [...C2.join(`
|
|
766
|
+
`)];
|
|
767
|
+
for (const [E, a] of n.entries()) {
|
|
768
|
+
if (F2 += a, d.has(a)) {
|
|
769
|
+
const { groups: c } = new RegExp(`(?:\\${V}(?<code>\\d+)m|\\${_}(?<uri>.*)${y})`).exec(n.slice(E).join("")) || { groups: {} };
|
|
770
|
+
if (c.code !== void 0) {
|
|
771
|
+
const f = Number.parseFloat(c.code);
|
|
772
|
+
s = f === oD ? void 0 : f;
|
|
773
|
+
} else c.uri !== void 0 && (i = c.uri.length === 0 ? void 0 : c.uri);
|
|
774
|
+
}
|
|
775
|
+
const o2 = ED.codes.get(Number(s));
|
|
776
|
+
n[E + 1] === `
|
|
777
|
+
` ? (i && (F2 += K("")), s && o2 && (F2 += z(o2))) : a === `
|
|
778
|
+
` && (s && o2 && (F2 += z(s)), i && (F2 += K(i)));
|
|
779
|
+
}
|
|
780
|
+
return F2;
|
|
781
|
+
};
|
|
782
|
+
xD = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
783
|
+
B = { actions: new Set(xD), aliases: /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["", "cancel"], ["escape", "cancel"]]) };
|
|
784
|
+
AD = globalThis.process.platform.startsWith("win");
|
|
785
|
+
S = /* @__PURE__ */ Symbol("clack:cancel");
|
|
786
|
+
gD = Object.defineProperty;
|
|
787
|
+
vD = (e2, u2, t) => u2 in e2 ? gD(e2, u2, { enumerable: true, configurable: true, writable: true, value: t }) : e2[u2] = t;
|
|
788
|
+
h = (e2, u2, t) => (vD(e2, typeof u2 != "symbol" ? u2 + "" : u2, t), t);
|
|
789
|
+
x = class {
|
|
790
|
+
constructor(u2, t = true) {
|
|
791
|
+
h(this, "input"), h(this, "output"), h(this, "_abortSignal"), h(this, "rl"), h(this, "opts"), h(this, "_render"), h(this, "_track", false), h(this, "_prevFrame", ""), h(this, "_subscribers", /* @__PURE__ */ new Map()), h(this, "_cursor", 0), h(this, "state", "initial"), h(this, "error", ""), h(this, "value");
|
|
792
|
+
const { input: F2 = j, output: s = M, render: i, signal: D2, ...C2 } = u2;
|
|
793
|
+
this.opts = C2, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = i.bind(this), this._track = t, this._abortSignal = D2, this.input = F2, this.output = s;
|
|
794
|
+
}
|
|
795
|
+
unsubscribe() {
|
|
796
|
+
this._subscribers.clear();
|
|
797
|
+
}
|
|
798
|
+
setSubscriber(u2, t) {
|
|
799
|
+
const F2 = this._subscribers.get(u2) ?? [];
|
|
800
|
+
F2.push(t), this._subscribers.set(u2, F2);
|
|
801
|
+
}
|
|
802
|
+
on(u2, t) {
|
|
803
|
+
this.setSubscriber(u2, { cb: t });
|
|
804
|
+
}
|
|
805
|
+
once(u2, t) {
|
|
806
|
+
this.setSubscriber(u2, { cb: t, once: true });
|
|
807
|
+
}
|
|
808
|
+
emit(u2, ...t) {
|
|
809
|
+
const F2 = this._subscribers.get(u2) ?? [], s = [];
|
|
810
|
+
for (const i of F2) i.cb(...t), i.once && s.push(() => F2.splice(F2.indexOf(i), 1));
|
|
811
|
+
for (const i of s) i();
|
|
812
|
+
}
|
|
813
|
+
prompt() {
|
|
814
|
+
return new Promise((u2, t) => {
|
|
815
|
+
if (this._abortSignal) {
|
|
816
|
+
if (this._abortSignal.aborted) return this.state = "cancel", this.close(), u2(S);
|
|
817
|
+
this._abortSignal.addEventListener("abort", () => {
|
|
818
|
+
this.state = "cancel", this.close();
|
|
819
|
+
}, { once: true });
|
|
820
|
+
}
|
|
821
|
+
const F2 = new X();
|
|
822
|
+
F2._write = (s, i, D2) => {
|
|
823
|
+
this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D2();
|
|
824
|
+
}, this.input.pipe(F2), this.rl = O.createInterface({ input: this.input, output: F2, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), O.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), m(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
825
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), m(this.input, false), u2(this.value);
|
|
826
|
+
}), this.once("cancel", () => {
|
|
827
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), m(this.input, false), u2(S);
|
|
828
|
+
});
|
|
829
|
+
});
|
|
830
|
+
}
|
|
831
|
+
onKeypress(u2, t) {
|
|
832
|
+
if (this.state === "error" && (this.state = "active"), t?.name && (!this._track && B.aliases.has(t.name) && this.emit("cursor", B.aliases.get(t.name)), B.actions.has(t.name) && this.emit("cursor", t.name)), u2 && (u2.toLowerCase() === "y" || u2.toLowerCase() === "n") && this.emit("confirm", u2.toLowerCase() === "y"), u2 === " " && this.opts.placeholder && (this.value || (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u2 && this.emit("key", u2.toLowerCase()), t?.name === "return") {
|
|
833
|
+
if (this.opts.validate) {
|
|
834
|
+
const F2 = this.opts.validate(this.value);
|
|
835
|
+
F2 && (this.error = F2 instanceof Error ? F2.message : F2, this.state = "error", this.rl?.write(this.value));
|
|
836
|
+
}
|
|
837
|
+
this.state !== "error" && (this.state = "submit");
|
|
838
|
+
}
|
|
839
|
+
$([u2, t?.name, t?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
840
|
+
}
|
|
841
|
+
close() {
|
|
842
|
+
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
843
|
+
`), m(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
844
|
+
}
|
|
845
|
+
restoreCursor() {
|
|
846
|
+
const u2 = Y(this._prevFrame, process.stdout.columns, { hard: true }).split(`
|
|
847
|
+
`).length - 1;
|
|
848
|
+
this.output.write(import_sisteransi.cursor.move(-999, u2 * -1));
|
|
849
|
+
}
|
|
850
|
+
render() {
|
|
851
|
+
const u2 = Y(this._render(this) ?? "", process.stdout.columns, { hard: true });
|
|
852
|
+
if (u2 !== this._prevFrame) {
|
|
853
|
+
if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
|
|
854
|
+
else {
|
|
855
|
+
const t = BD(this._prevFrame, u2);
|
|
856
|
+
if (this.restoreCursor(), t && t?.length === 1) {
|
|
857
|
+
const F2 = t[0];
|
|
858
|
+
this.output.write(import_sisteransi.cursor.move(0, F2)), this.output.write(import_sisteransi.erase.lines(1));
|
|
859
|
+
const s = u2.split(`
|
|
860
|
+
`);
|
|
861
|
+
this.output.write(s[F2]), this._prevFrame = u2, this.output.write(import_sisteransi.cursor.move(0, s.length - F2 - 1));
|
|
862
|
+
return;
|
|
863
|
+
}
|
|
864
|
+
if (t && t?.length > 1) {
|
|
865
|
+
const F2 = t[0];
|
|
866
|
+
this.output.write(import_sisteransi.cursor.move(0, F2)), this.output.write(import_sisteransi.erase.down());
|
|
867
|
+
const s = u2.split(`
|
|
868
|
+
`).slice(F2);
|
|
869
|
+
this.output.write(s.join(`
|
|
870
|
+
`)), this._prevFrame = u2;
|
|
871
|
+
return;
|
|
872
|
+
}
|
|
873
|
+
this.output.write(import_sisteransi.erase.down());
|
|
874
|
+
}
|
|
875
|
+
this.output.write(u2), this.state === "initial" && (this.state = "active"), this._prevFrame = u2;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
};
|
|
879
|
+
dD = class extends x {
|
|
880
|
+
get cursor() {
|
|
881
|
+
return this.value ? 0 : 1;
|
|
882
|
+
}
|
|
883
|
+
get _value() {
|
|
884
|
+
return this.cursor === 0;
|
|
885
|
+
}
|
|
886
|
+
constructor(u2) {
|
|
887
|
+
super(u2, false), this.value = !!u2.initialValue, this.on("value", () => {
|
|
888
|
+
this.value = this._value;
|
|
889
|
+
}), this.on("confirm", (t) => {
|
|
890
|
+
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = t, this.state = "submit", this.close();
|
|
891
|
+
}), this.on("cursor", () => {
|
|
892
|
+
this.value = !this.value;
|
|
893
|
+
});
|
|
894
|
+
}
|
|
895
|
+
};
|
|
896
|
+
A = /* @__PURE__ */ new WeakMap();
|
|
897
|
+
OD = Object.defineProperty;
|
|
898
|
+
PD = (e2, u2, t) => u2 in e2 ? OD(e2, u2, { enumerable: true, configurable: true, writable: true, value: t }) : e2[u2] = t;
|
|
899
|
+
J = (e2, u2, t) => (PD(e2, typeof u2 != "symbol" ? u2 + "" : u2, t), t);
|
|
900
|
+
LD = class extends x {
|
|
901
|
+
constructor(u2) {
|
|
902
|
+
super(u2, false), J(this, "options"), J(this, "cursor", 0), this.options = u2.options, this.cursor = this.options.findIndex(({ value: t }) => t === u2.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (t) => {
|
|
903
|
+
switch (t) {
|
|
904
|
+
case "left":
|
|
905
|
+
case "up":
|
|
906
|
+
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
907
|
+
break;
|
|
908
|
+
case "down":
|
|
909
|
+
case "right":
|
|
910
|
+
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
911
|
+
break;
|
|
912
|
+
}
|
|
913
|
+
this.changeValue();
|
|
914
|
+
});
|
|
915
|
+
}
|
|
916
|
+
get _value() {
|
|
917
|
+
return this.options[this.cursor];
|
|
918
|
+
}
|
|
919
|
+
changeValue() {
|
|
920
|
+
this.value = this._value.value;
|
|
921
|
+
}
|
|
922
|
+
};
|
|
923
|
+
RD = class extends x {
|
|
924
|
+
get valueWithCursor() {
|
|
925
|
+
if (this.state === "submit") return this.value;
|
|
926
|
+
if (this.cursor >= this.value.length) return `${this.value}\u2588`;
|
|
927
|
+
const u2 = this.value.slice(0, this.cursor), [t, ...F2] = this.value.slice(this.cursor);
|
|
928
|
+
return `${u2}${import_picocolors2.default.inverse(t)}${F2.join("")}`;
|
|
929
|
+
}
|
|
930
|
+
get cursor() {
|
|
931
|
+
return this._cursor;
|
|
932
|
+
}
|
|
933
|
+
constructor(u2) {
|
|
934
|
+
super(u2), this.on("finalize", () => {
|
|
935
|
+
this.value || (this.value = u2.defaultValue);
|
|
936
|
+
});
|
|
937
|
+
}
|
|
938
|
+
};
|
|
939
|
+
}
|
|
940
|
+
});
|
|
941
|
+
|
|
942
|
+
// node_modules/@clack/prompts/dist/index.mjs
|
|
943
|
+
import { stripVTControlCharacters as S2 } from "util";
|
|
944
|
+
import y2 from "process";
|
|
945
|
+
function ce() {
|
|
946
|
+
return y2.platform !== "win32" ? y2.env.TERM !== "linux" : !!y2.env.CI || !!y2.env.WT_SESSION || !!y2.env.TERMINUS_SUBLIME || y2.env.ConEmuTask === "{cmd::Cmder}" || y2.env.TERM_PROGRAM === "Terminus-Sublime" || y2.env.TERM_PROGRAM === "vscode" || y2.env.TERM === "xterm-256color" || y2.env.TERM === "alacritty" || y2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
947
|
+
}
|
|
948
|
+
var import_picocolors3, import_sisteransi2, V2, u, le, L2, W2, C, ue, o, d2, k2, P2, A2, T, F, $e, _2, me, de, pe, q, D, U, K2, b2, G2, he, ye, ve, Me, xe, Ie, Se, M2, J2, Y2;
|
|
949
|
+
var init_dist3 = __esm({
|
|
950
|
+
"node_modules/@clack/prompts/dist/index.mjs"() {
|
|
951
|
+
"use strict";
|
|
952
|
+
init_esm_shims();
|
|
953
|
+
init_dist2();
|
|
954
|
+
init_dist2();
|
|
955
|
+
import_picocolors3 = __toESM(require_picocolors(), 1);
|
|
956
|
+
import_sisteransi2 = __toESM(require_src(), 1);
|
|
957
|
+
V2 = ce();
|
|
958
|
+
u = (t, n) => V2 ? t : n;
|
|
959
|
+
le = u("\u25C6", "*");
|
|
960
|
+
L2 = u("\u25A0", "x");
|
|
961
|
+
W2 = u("\u25B2", "x");
|
|
962
|
+
C = u("\u25C7", "o");
|
|
963
|
+
ue = u("\u250C", "T");
|
|
964
|
+
o = u("\u2502", "|");
|
|
965
|
+
d2 = u("\u2514", "\u2014");
|
|
966
|
+
k2 = u("\u25CF", ">");
|
|
967
|
+
P2 = u("\u25CB", " ");
|
|
968
|
+
A2 = u("\u25FB", "[\u2022]");
|
|
969
|
+
T = u("\u25FC", "[+]");
|
|
970
|
+
F = u("\u25FB", "[ ]");
|
|
971
|
+
$e = u("\u25AA", "\u2022");
|
|
972
|
+
_2 = u("\u2500", "-");
|
|
973
|
+
me = u("\u256E", "+");
|
|
974
|
+
de = u("\u251C", "+");
|
|
975
|
+
pe = u("\u256F", "+");
|
|
976
|
+
q = u("\u25CF", "\u2022");
|
|
977
|
+
D = u("\u25C6", "*");
|
|
978
|
+
U = u("\u25B2", "!");
|
|
979
|
+
K2 = u("\u25A0", "x");
|
|
980
|
+
b2 = (t) => {
|
|
981
|
+
switch (t) {
|
|
982
|
+
case "initial":
|
|
983
|
+
case "active":
|
|
984
|
+
return import_picocolors3.default.cyan(le);
|
|
985
|
+
case "cancel":
|
|
986
|
+
return import_picocolors3.default.red(L2);
|
|
987
|
+
case "error":
|
|
988
|
+
return import_picocolors3.default.yellow(W2);
|
|
989
|
+
case "submit":
|
|
990
|
+
return import_picocolors3.default.green(C);
|
|
991
|
+
}
|
|
992
|
+
};
|
|
993
|
+
G2 = (t) => {
|
|
994
|
+
const { cursor: n, options: r2, 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));
|
|
995
|
+
let l2 = 0;
|
|
996
|
+
n >= l2 + a - 3 ? l2 = Math.max(Math.min(n - a + 3, r2.length - a), 0) : n < l2 + 2 && (l2 = Math.max(n - 2, 0));
|
|
997
|
+
const $2 = a < r2.length && l2 > 0, g2 = a < r2.length && l2 + a < r2.length;
|
|
998
|
+
return r2.slice(l2, l2 + a).map((p2, v2, f) => {
|
|
999
|
+
const j2 = v2 === 0 && $2, E = v2 === f.length - 1 && g2;
|
|
1000
|
+
return j2 || E ? import_picocolors3.default.dim("...") : i(p2, v2 + l2 === n);
|
|
1001
|
+
});
|
|
1002
|
+
};
|
|
1003
|
+
he = (t) => new RD({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, render() {
|
|
1004
|
+
const n = `${import_picocolors3.default.gray(o)}
|
|
1005
|
+
${b2(this.state)} ${t.message}
|
|
1006
|
+
`, r2 = t.placeholder ? import_picocolors3.default.inverse(t.placeholder[0]) + import_picocolors3.default.dim(t.placeholder.slice(1)) : import_picocolors3.default.inverse(import_picocolors3.default.hidden("_")), i = this.value ? this.valueWithCursor : r2;
|
|
1007
|
+
switch (this.state) {
|
|
1008
|
+
case "error":
|
|
1009
|
+
return `${n.trim()}
|
|
1010
|
+
${import_picocolors3.default.yellow(o)} ${i}
|
|
1011
|
+
${import_picocolors3.default.yellow(d2)} ${import_picocolors3.default.yellow(this.error)}
|
|
1012
|
+
`;
|
|
1013
|
+
case "submit":
|
|
1014
|
+
return `${n}${import_picocolors3.default.gray(o)} ${import_picocolors3.default.dim(this.value || t.placeholder)}`;
|
|
1015
|
+
case "cancel":
|
|
1016
|
+
return `${n}${import_picocolors3.default.gray(o)} ${import_picocolors3.default.strikethrough(import_picocolors3.default.dim(this.value ?? ""))}${this.value?.trim() ? `
|
|
1017
|
+
${import_picocolors3.default.gray(o)}` : ""}`;
|
|
1018
|
+
default:
|
|
1019
|
+
return `${n}${import_picocolors3.default.cyan(o)} ${i}
|
|
1020
|
+
${import_picocolors3.default.cyan(d2)}
|
|
1021
|
+
`;
|
|
1022
|
+
}
|
|
1023
|
+
} }).prompt();
|
|
1024
|
+
ye = (t) => {
|
|
1025
|
+
const n = t.active ?? "Yes", r2 = t.inactive ?? "No";
|
|
1026
|
+
return new dD({ active: n, inactive: r2, initialValue: t.initialValue ?? true, render() {
|
|
1027
|
+
const i = `${import_picocolors3.default.gray(o)}
|
|
1028
|
+
${b2(this.state)} ${t.message}
|
|
1029
|
+
`, s = this.value ? n : r2;
|
|
1030
|
+
switch (this.state) {
|
|
1031
|
+
case "submit":
|
|
1032
|
+
return `${i}${import_picocolors3.default.gray(o)} ${import_picocolors3.default.dim(s)}`;
|
|
1033
|
+
case "cancel":
|
|
1034
|
+
return `${i}${import_picocolors3.default.gray(o)} ${import_picocolors3.default.strikethrough(import_picocolors3.default.dim(s))}
|
|
1035
|
+
${import_picocolors3.default.gray(o)}`;
|
|
1036
|
+
default:
|
|
1037
|
+
return `${i}${import_picocolors3.default.cyan(o)} ${this.value ? `${import_picocolors3.default.green(k2)} ${n}` : `${import_picocolors3.default.dim(P2)} ${import_picocolors3.default.dim(n)}`} ${import_picocolors3.default.dim("/")} ${this.value ? `${import_picocolors3.default.dim(P2)} ${import_picocolors3.default.dim(r2)}` : `${import_picocolors3.default.green(k2)} ${r2}`}
|
|
1038
|
+
${import_picocolors3.default.cyan(d2)}
|
|
1039
|
+
`;
|
|
1040
|
+
}
|
|
1041
|
+
} }).prompt();
|
|
1042
|
+
};
|
|
1043
|
+
ve = (t) => {
|
|
1044
|
+
const n = (r2, i) => {
|
|
1045
|
+
const s = r2.label ?? String(r2.value);
|
|
1046
|
+
switch (i) {
|
|
1047
|
+
case "selected":
|
|
1048
|
+
return `${import_picocolors3.default.dim(s)}`;
|
|
1049
|
+
case "active":
|
|
1050
|
+
return `${import_picocolors3.default.green(k2)} ${s} ${r2.hint ? import_picocolors3.default.dim(`(${r2.hint})`) : ""}`;
|
|
1051
|
+
case "cancelled":
|
|
1052
|
+
return `${import_picocolors3.default.strikethrough(import_picocolors3.default.dim(s))}`;
|
|
1053
|
+
default:
|
|
1054
|
+
return `${import_picocolors3.default.dim(P2)} ${import_picocolors3.default.dim(s)}`;
|
|
1055
|
+
}
|
|
1056
|
+
};
|
|
1057
|
+
return new LD({ options: t.options, initialValue: t.initialValue, render() {
|
|
1058
|
+
const r2 = `${import_picocolors3.default.gray(o)}
|
|
1059
|
+
${b2(this.state)} ${t.message}
|
|
1060
|
+
`;
|
|
1061
|
+
switch (this.state) {
|
|
1062
|
+
case "submit":
|
|
1063
|
+
return `${r2}${import_picocolors3.default.gray(o)} ${n(this.options[this.cursor], "selected")}`;
|
|
1064
|
+
case "cancel":
|
|
1065
|
+
return `${r2}${import_picocolors3.default.gray(o)} ${n(this.options[this.cursor], "cancelled")}
|
|
1066
|
+
${import_picocolors3.default.gray(o)}`;
|
|
1067
|
+
default:
|
|
1068
|
+
return `${r2}${import_picocolors3.default.cyan(o)} ${G2({ cursor: this.cursor, options: this.options, maxItems: t.maxItems, style: (i, s) => n(i, s ? "active" : "inactive") }).join(`
|
|
1069
|
+
${import_picocolors3.default.cyan(o)} `)}
|
|
1070
|
+
${import_picocolors3.default.cyan(d2)}
|
|
1071
|
+
`;
|
|
1072
|
+
}
|
|
1073
|
+
} }).prompt();
|
|
1074
|
+
};
|
|
1075
|
+
Me = (t = "", n = "") => {
|
|
1076
|
+
const r2 = `
|
|
1077
|
+
${t}
|
|
1078
|
+
`.split(`
|
|
1079
|
+
`), i = S2(n).length, s = Math.max(r2.reduce((a, l2) => {
|
|
1080
|
+
const $2 = S2(l2);
|
|
1081
|
+
return $2.length > a ? $2.length : a;
|
|
1082
|
+
}, 0), i) + 2, c = r2.map((a) => `${import_picocolors3.default.gray(o)} ${import_picocolors3.default.dim(a)}${" ".repeat(s - S2(a).length)}${import_picocolors3.default.gray(o)}`).join(`
|
|
1083
|
+
`);
|
|
1084
|
+
process.stdout.write(`${import_picocolors3.default.gray(o)}
|
|
1085
|
+
${import_picocolors3.default.green(C)} ${import_picocolors3.default.reset(n)} ${import_picocolors3.default.gray(_2.repeat(Math.max(s - i - 1, 1)) + me)}
|
|
1086
|
+
${c}
|
|
1087
|
+
${import_picocolors3.default.gray(de + _2.repeat(s + 2) + pe)}
|
|
1088
|
+
`);
|
|
1089
|
+
};
|
|
1090
|
+
xe = (t = "") => {
|
|
1091
|
+
process.stdout.write(`${import_picocolors3.default.gray(d2)} ${import_picocolors3.default.red(t)}
|
|
1092
|
+
|
|
1093
|
+
`);
|
|
1094
|
+
};
|
|
1095
|
+
Ie = (t = "") => {
|
|
1096
|
+
process.stdout.write(`${import_picocolors3.default.gray(ue)} ${t}
|
|
1097
|
+
`);
|
|
1098
|
+
};
|
|
1099
|
+
Se = (t = "") => {
|
|
1100
|
+
process.stdout.write(`${import_picocolors3.default.gray(o)}
|
|
1101
|
+
${import_picocolors3.default.gray(d2)} ${t}
|
|
1102
|
+
|
|
1103
|
+
`);
|
|
1104
|
+
};
|
|
1105
|
+
M2 = { message: (t = "", { symbol: n = import_picocolors3.default.gray(o) } = {}) => {
|
|
1106
|
+
const r2 = [`${import_picocolors3.default.gray(o)}`];
|
|
1107
|
+
if (t) {
|
|
1108
|
+
const [i, ...s] = t.split(`
|
|
1109
|
+
`);
|
|
1110
|
+
r2.push(`${n} ${i}`, ...s.map((c) => `${import_picocolors3.default.gray(o)} ${c}`));
|
|
1111
|
+
}
|
|
1112
|
+
process.stdout.write(`${r2.join(`
|
|
1113
|
+
`)}
|
|
1114
|
+
`);
|
|
1115
|
+
}, info: (t) => {
|
|
1116
|
+
M2.message(t, { symbol: import_picocolors3.default.blue(q) });
|
|
1117
|
+
}, success: (t) => {
|
|
1118
|
+
M2.message(t, { symbol: import_picocolors3.default.green(D) });
|
|
1119
|
+
}, step: (t) => {
|
|
1120
|
+
M2.message(t, { symbol: import_picocolors3.default.green(C) });
|
|
1121
|
+
}, warn: (t) => {
|
|
1122
|
+
M2.message(t, { symbol: import_picocolors3.default.yellow(U) });
|
|
1123
|
+
}, warning: (t) => {
|
|
1124
|
+
M2.warn(t);
|
|
1125
|
+
}, error: (t) => {
|
|
1126
|
+
M2.message(t, { symbol: import_picocolors3.default.red(K2) });
|
|
1127
|
+
} };
|
|
1128
|
+
J2 = `${import_picocolors3.default.gray(o)} `;
|
|
1129
|
+
Y2 = ({ indicator: t = "dots" } = {}) => {
|
|
1130
|
+
const n = V2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], r2 = V2 ? 80 : 120, i = process.env.CI === "true";
|
|
1131
|
+
let s, c, a = false, l2 = "", $2, g2 = performance.now();
|
|
1132
|
+
const p2 = (m2) => {
|
|
1133
|
+
const h2 = m2 > 1 ? "Something went wrong" : "Canceled";
|
|
1134
|
+
a && N2(h2, m2);
|
|
1135
|
+
}, v2 = () => p2(2), f = () => p2(1), j2 = () => {
|
|
1136
|
+
process.on("uncaughtExceptionMonitor", v2), process.on("unhandledRejection", v2), process.on("SIGINT", f), process.on("SIGTERM", f), process.on("exit", p2);
|
|
1137
|
+
}, E = () => {
|
|
1138
|
+
process.removeListener("uncaughtExceptionMonitor", v2), process.removeListener("unhandledRejection", v2), process.removeListener("SIGINT", f), process.removeListener("SIGTERM", f), process.removeListener("exit", p2);
|
|
1139
|
+
}, B2 = () => {
|
|
1140
|
+
if ($2 === void 0) return;
|
|
1141
|
+
i && process.stdout.write(`
|
|
1142
|
+
`);
|
|
1143
|
+
const m2 = $2.split(`
|
|
1144
|
+
`);
|
|
1145
|
+
process.stdout.write(import_sisteransi2.cursor.move(-999, m2.length - 1)), process.stdout.write(import_sisteransi2.erase.down(m2.length));
|
|
1146
|
+
}, R2 = (m2) => m2.replace(/\.+$/, ""), O2 = (m2) => {
|
|
1147
|
+
const h2 = (performance.now() - m2) / 1e3, w2 = Math.floor(h2 / 60), I2 = Math.floor(h2 % 60);
|
|
1148
|
+
return w2 > 0 ? `[${w2}m ${I2}s]` : `[${I2}s]`;
|
|
1149
|
+
}, H = (m2 = "") => {
|
|
1150
|
+
a = true, s = fD(), l2 = R2(m2), g2 = performance.now(), process.stdout.write(`${import_picocolors3.default.gray(o)}
|
|
1151
|
+
`);
|
|
1152
|
+
let h2 = 0, w2 = 0;
|
|
1153
|
+
j2(), c = setInterval(() => {
|
|
1154
|
+
if (i && l2 === $2) return;
|
|
1155
|
+
B2(), $2 = l2;
|
|
1156
|
+
const I2 = import_picocolors3.default.magenta(n[h2]);
|
|
1157
|
+
if (i) process.stdout.write(`${I2} ${l2}...`);
|
|
1158
|
+
else if (t === "timer") process.stdout.write(`${I2} ${l2} ${O2(g2)}`);
|
|
1159
|
+
else {
|
|
1160
|
+
const z2 = ".".repeat(Math.floor(w2)).slice(0, 3);
|
|
1161
|
+
process.stdout.write(`${I2} ${l2}${z2}`);
|
|
1162
|
+
}
|
|
1163
|
+
h2 = h2 + 1 < n.length ? h2 + 1 : 0, w2 = w2 < n.length ? w2 + 0.125 : 0;
|
|
1164
|
+
}, r2);
|
|
1165
|
+
}, N2 = (m2 = "", h2 = 0) => {
|
|
1166
|
+
a = false, clearInterval(c), B2();
|
|
1167
|
+
const w2 = h2 === 0 ? import_picocolors3.default.green(C) : h2 === 1 ? import_picocolors3.default.red(L2) : import_picocolors3.default.red(W2);
|
|
1168
|
+
l2 = R2(m2 ?? l2), t === "timer" ? process.stdout.write(`${w2} ${l2} ${O2(g2)}
|
|
1169
|
+
`) : process.stdout.write(`${w2} ${l2}
|
|
1170
|
+
`), E(), s();
|
|
1171
|
+
};
|
|
1172
|
+
return { start: H, stop: N2, message: (m2 = "") => {
|
|
1173
|
+
l2 = R2(m2 ?? l2);
|
|
1174
|
+
} };
|
|
1175
|
+
};
|
|
1176
|
+
}
|
|
1177
|
+
});
|
|
1178
|
+
|
|
1179
|
+
// src/lib/onboarding.ts
|
|
1180
|
+
var onboarding_exports = {};
|
|
1181
|
+
__export(onboarding_exports, {
|
|
1182
|
+
ensureInitialized: () => ensureInitialized,
|
|
1183
|
+
isInitialized: () => isInitialized,
|
|
1184
|
+
runOnboarding: () => runOnboarding
|
|
1185
|
+
});
|
|
1186
|
+
import fs2 from "fs/promises";
|
|
1187
|
+
import path2 from "path";
|
|
1188
|
+
import os from "os";
|
|
1189
|
+
function getXdgConfigHome() {
|
|
1190
|
+
return process.env.XDG_CONFIG_HOME || path2.join(os.homedir(), ".config");
|
|
1191
|
+
}
|
|
1192
|
+
function getDefaultConfigDir() {
|
|
1193
|
+
if (process.env.AGENTPROFILES_CONFIG_DIR) {
|
|
1194
|
+
return process.env.AGENTPROFILES_CONFIG_DIR;
|
|
1195
|
+
}
|
|
1196
|
+
return path2.join(getXdgConfigHome(), "agentprofiles");
|
|
1197
|
+
}
|
|
1198
|
+
function getConfigPath() {
|
|
1199
|
+
return path2.join(getDefaultConfigDir(), "config.json");
|
|
1200
|
+
}
|
|
1201
|
+
async function isInitialized() {
|
|
1202
|
+
try {
|
|
1203
|
+
await fs2.access(getConfigPath());
|
|
1204
|
+
return true;
|
|
1205
|
+
} catch {
|
|
1206
|
+
return false;
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
async function runOnboarding(options = {}) {
|
|
1210
|
+
const configDir = getDefaultConfigDir();
|
|
1211
|
+
const configPath = getConfigPath();
|
|
1212
|
+
if (options.isRerun) {
|
|
1213
|
+
Ie(import_picocolors4.default.cyan("Re-running agentprofiles setup"));
|
|
1214
|
+
} else {
|
|
1215
|
+
Ie(import_picocolors4.default.cyan("Welcome to agentprofiles!"));
|
|
1216
|
+
Me(
|
|
1217
|
+
`This tool manages configuration profiles for LLM agent tools.
|
|
1218
|
+
Profiles are stored as directories that can be activated per-project using direnv.`,
|
|
1219
|
+
"About"
|
|
1220
|
+
);
|
|
1221
|
+
}
|
|
1222
|
+
M2.info(`Config directory: ${import_picocolors4.default.dim(configDir)}`);
|
|
1223
|
+
const defaultContentDir = configDir;
|
|
1224
|
+
const contentDirChoice = await he({
|
|
1225
|
+
message: "Where should profile contents be stored?",
|
|
1226
|
+
placeholder: defaultContentDir,
|
|
1227
|
+
defaultValue: defaultContentDir,
|
|
1228
|
+
validate: (value) => {
|
|
1229
|
+
if (!value) return "Please enter a directory path";
|
|
1230
|
+
if (!path2.isAbsolute(value) && !value.startsWith("~")) {
|
|
1231
|
+
return "Please enter an absolute path";
|
|
1232
|
+
}
|
|
1233
|
+
return void 0;
|
|
1234
|
+
}
|
|
1235
|
+
});
|
|
1236
|
+
if (pD(contentDirChoice)) {
|
|
1237
|
+
xe("Setup cancelled.");
|
|
1238
|
+
return false;
|
|
1239
|
+
}
|
|
1240
|
+
let contentDir = contentDirChoice;
|
|
1241
|
+
if (contentDir.startsWith("~")) {
|
|
1242
|
+
contentDir = path2.join(os.homedir(), contentDir.slice(1));
|
|
1243
|
+
}
|
|
1244
|
+
const spinner = Y2();
|
|
1245
|
+
spinner.start("Creating directories...");
|
|
1246
|
+
try {
|
|
1247
|
+
await fs2.mkdir(configDir, { recursive: true });
|
|
1248
|
+
await fs2.mkdir(contentDir, { recursive: true });
|
|
1249
|
+
const config = {
|
|
1250
|
+
contentDir: contentDir === configDir ? void 0 : contentDir,
|
|
1251
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1252
|
+
version: 1
|
|
1253
|
+
};
|
|
1254
|
+
await fs2.writeFile(configPath, JSON.stringify(config, null, 2));
|
|
1255
|
+
for (const tool of ["claude", "opencode"]) {
|
|
1256
|
+
await fs2.mkdir(path2.join(contentDir, tool), { recursive: true });
|
|
1257
|
+
}
|
|
1258
|
+
spinner.stop("Directories created");
|
|
1259
|
+
} catch (error) {
|
|
1260
|
+
spinner.stop("Failed to create directories");
|
|
1261
|
+
M2.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
1262
|
+
return false;
|
|
1263
|
+
}
|
|
1264
|
+
Se(
|
|
1265
|
+
import_picocolors4.default.green("Setup complete! Run `agentprofiles add <agent>` to create your first profile.")
|
|
1266
|
+
);
|
|
1267
|
+
return true;
|
|
1268
|
+
}
|
|
1269
|
+
async function ensureInitialized() {
|
|
1270
|
+
if (await isInitialized()) {
|
|
1271
|
+
return true;
|
|
1272
|
+
}
|
|
1273
|
+
if (!process.stdout.isTTY) {
|
|
1274
|
+
console.error(import_picocolors4.default.red("agentprofiles is not initialized."));
|
|
1275
|
+
console.error(`Run ${import_picocolors4.default.cyan("agentprofiles init")} to set up.`);
|
|
1276
|
+
process.exit(1);
|
|
1277
|
+
}
|
|
1278
|
+
return runOnboarding();
|
|
1279
|
+
}
|
|
1280
|
+
var import_picocolors4;
|
|
1281
|
+
var init_onboarding = __esm({
|
|
1282
|
+
"src/lib/onboarding.ts"() {
|
|
1283
|
+
"use strict";
|
|
1284
|
+
init_esm_shims();
|
|
1285
|
+
init_dist3();
|
|
1286
|
+
import_picocolors4 = __toESM(require_picocolors(), 1);
|
|
1287
|
+
}
|
|
1288
|
+
});
|
|
1289
|
+
|
|
1290
|
+
// src/types/index.ts
|
|
1291
|
+
var SUPPORTED_TOOLS;
|
|
1292
|
+
var init_types = __esm({
|
|
1293
|
+
"src/types/index.ts"() {
|
|
1294
|
+
"use strict";
|
|
1295
|
+
init_esm_shims();
|
|
1296
|
+
SUPPORTED_TOOLS = {
|
|
1297
|
+
claude: {
|
|
1298
|
+
envVar: "CLAUDE_CONFIG_DIR",
|
|
1299
|
+
xdgCompliant: false,
|
|
1300
|
+
description: "Claude Code"
|
|
1301
|
+
},
|
|
1302
|
+
opencode: {
|
|
1303
|
+
envVar: "OPENCODE_CONFIG_DIR",
|
|
1304
|
+
xdgCompliant: true,
|
|
1305
|
+
description: "OpenCode"
|
|
1306
|
+
}
|
|
1307
|
+
};
|
|
1308
|
+
}
|
|
1309
|
+
});
|
|
1310
|
+
|
|
1311
|
+
// src/lib/validation.ts
|
|
1312
|
+
function slugify(name) {
|
|
1313
|
+
return name.trim().toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9._-]/g, "").replace(/-+/g, "-").replace(/^-+|-+$/g, "");
|
|
1314
|
+
}
|
|
1315
|
+
function validateProfileName(name) {
|
|
1316
|
+
const trimmed = name.trim();
|
|
1317
|
+
if (trimmed.length === 0) return "Profile name is required.";
|
|
1318
|
+
if (trimmed !== name) return "Profile name must not include surrounding whitespace.";
|
|
1319
|
+
const slug = slugify(name);
|
|
1320
|
+
if (slug.length === 0) return "Profile name must contain at least one letter or number.";
|
|
1321
|
+
if (slug.includes("..")) return 'Profile name must not include "..".';
|
|
1322
|
+
return null;
|
|
1323
|
+
}
|
|
1324
|
+
function validateSlug(slug) {
|
|
1325
|
+
if (slug.length === 0) return "Slug is required.";
|
|
1326
|
+
if (!SLUG_REGEX.test(slug)) {
|
|
1327
|
+
return 'Slug must be lowercase letters, numbers, ".", "-", "_".';
|
|
1328
|
+
}
|
|
1329
|
+
if (slug.includes("..")) return 'Slug must not include "..".';
|
|
1330
|
+
return null;
|
|
1331
|
+
}
|
|
1332
|
+
var SLUG_REGEX;
|
|
1333
|
+
var init_validation = __esm({
|
|
1334
|
+
"src/lib/validation.ts"() {
|
|
1335
|
+
"use strict";
|
|
1336
|
+
init_esm_shims();
|
|
1337
|
+
SLUG_REGEX = /^[a-z0-9][a-z0-9._-]*$/;
|
|
1338
|
+
}
|
|
1339
|
+
});
|
|
1340
|
+
|
|
1341
|
+
// src/lib/gitignore.ts
|
|
1342
|
+
function getAgentGitignore(agent) {
|
|
1343
|
+
switch (agent) {
|
|
1344
|
+
case "claude":
|
|
1345
|
+
return CLAUDE_GITIGNORE;
|
|
1346
|
+
case "opencode":
|
|
1347
|
+
return OPENCODE_GITIGNORE;
|
|
1348
|
+
default:
|
|
1349
|
+
return "";
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
var CLAUDE_GITIGNORE, OPENCODE_GITIGNORE;
|
|
1353
|
+
var init_gitignore = __esm({
|
|
1354
|
+
"src/lib/gitignore.ts"() {
|
|
1355
|
+
"use strict";
|
|
1356
|
+
init_esm_shims();
|
|
1357
|
+
CLAUDE_GITIGNORE = `# Generated by agentprofiles
|
|
1358
|
+
cache/
|
|
1359
|
+
debug/
|
|
1360
|
+
downloads/
|
|
1361
|
+
file-history/
|
|
1362
|
+
history.jsonl
|
|
1363
|
+
ide/
|
|
1364
|
+
plugins/cache/
|
|
1365
|
+
plugins/marketplaces/
|
|
1366
|
+
projects/
|
|
1367
|
+
session-env/
|
|
1368
|
+
shell-snapshots/
|
|
1369
|
+
stats-cache.json
|
|
1370
|
+
statsig/
|
|
1371
|
+
todos/
|
|
1372
|
+
.DS_Store
|
|
1373
|
+
.claude.json
|
|
1374
|
+
.claude.json.backup
|
|
1375
|
+
`;
|
|
1376
|
+
OPENCODE_GITIGNORE = `# Generated by agentprofiles
|
|
1377
|
+
cache/
|
|
1378
|
+
logs/
|
|
1379
|
+
history*
|
|
1380
|
+
tmp/
|
|
1381
|
+
.DS_Store
|
|
1382
|
+
`;
|
|
1383
|
+
}
|
|
1384
|
+
});
|
|
1385
|
+
|
|
1386
|
+
// src/lib/config.ts
|
|
1387
|
+
import fs3 from "fs/promises";
|
|
1388
|
+
import path3 from "path";
|
|
1389
|
+
import os2 from "os";
|
|
1390
|
+
function getXdgConfigHome2() {
|
|
1391
|
+
return process.env.XDG_CONFIG_HOME || path3.join(os2.homedir(), ".config");
|
|
1392
|
+
}
|
|
1393
|
+
function getDefaultConfigDir2() {
|
|
1394
|
+
if (process.env.AGENTPROFILES_CONFIG_DIR) {
|
|
1395
|
+
return process.env.AGENTPROFILES_CONFIG_DIR;
|
|
1396
|
+
}
|
|
1397
|
+
return path3.join(getXdgConfigHome2(), "agentprofiles");
|
|
1398
|
+
}
|
|
1399
|
+
var ConfigManager;
|
|
1400
|
+
var init_config = __esm({
|
|
1401
|
+
"src/lib/config.ts"() {
|
|
1402
|
+
"use strict";
|
|
1403
|
+
init_esm_shims();
|
|
1404
|
+
init_types();
|
|
1405
|
+
init_validation();
|
|
1406
|
+
init_gitignore();
|
|
1407
|
+
ConfigManager = class {
|
|
1408
|
+
configDir;
|
|
1409
|
+
contentDir;
|
|
1410
|
+
tools;
|
|
1411
|
+
cliConfig = null;
|
|
1412
|
+
constructor() {
|
|
1413
|
+
this.configDir = getDefaultConfigDir2();
|
|
1414
|
+
this.tools = SUPPORTED_TOOLS;
|
|
1415
|
+
this.contentDir = this.resolveContentDir();
|
|
1416
|
+
}
|
|
1417
|
+
resolveContentDir() {
|
|
1418
|
+
if (process.env.AGENTPROFILES_CONTENT_DIR) {
|
|
1419
|
+
return process.env.AGENTPROFILES_CONTENT_DIR;
|
|
1420
|
+
}
|
|
1421
|
+
if (this.cliConfig?.contentDir) {
|
|
1422
|
+
const configuredDir = this.cliConfig.contentDir;
|
|
1423
|
+
if (!path3.isAbsolute(configuredDir)) {
|
|
1424
|
+
return path3.join(this.configDir, configuredDir);
|
|
1425
|
+
}
|
|
1426
|
+
return configuredDir;
|
|
1427
|
+
}
|
|
1428
|
+
return this.configDir;
|
|
1429
|
+
}
|
|
1430
|
+
async loadCliConfig() {
|
|
1431
|
+
const configPath = path3.join(this.configDir, "config.json");
|
|
1432
|
+
try {
|
|
1433
|
+
const content = await fs3.readFile(configPath, "utf-8");
|
|
1434
|
+
return JSON.parse(content);
|
|
1435
|
+
} catch {
|
|
1436
|
+
return {};
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
async init() {
|
|
1440
|
+
this.cliConfig = await this.loadCliConfig();
|
|
1441
|
+
this.contentDir = this.resolveContentDir();
|
|
1442
|
+
}
|
|
1443
|
+
getConfigDir() {
|
|
1444
|
+
return this.configDir;
|
|
1445
|
+
}
|
|
1446
|
+
getContentDir() {
|
|
1447
|
+
return this.contentDir;
|
|
1448
|
+
}
|
|
1449
|
+
async ensureConfigDir() {
|
|
1450
|
+
await fs3.mkdir(this.configDir, { recursive: true });
|
|
1451
|
+
const configPath = path3.join(this.configDir, "config.json");
|
|
1452
|
+
try {
|
|
1453
|
+
await fs3.access(configPath);
|
|
1454
|
+
this.cliConfig = await this.loadCliConfig();
|
|
1455
|
+
} catch {
|
|
1456
|
+
const defaultConfig = {};
|
|
1457
|
+
await fs3.writeFile(configPath, JSON.stringify(defaultConfig, null, 2));
|
|
1458
|
+
this.cliConfig = defaultConfig;
|
|
1459
|
+
}
|
|
1460
|
+
this.contentDir = this.resolveContentDir();
|
|
1461
|
+
await fs3.mkdir(this.contentDir, { recursive: true });
|
|
1462
|
+
for (const tool of Object.keys(this.tools)) {
|
|
1463
|
+
const toolDir = path3.join(this.contentDir, tool);
|
|
1464
|
+
await fs3.mkdir(toolDir, { recursive: true });
|
|
1465
|
+
await this.ensureAgentGitignore(toolDir, tool);
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
async ensureAgentGitignore(agentDir, agent) {
|
|
1469
|
+
const gitignorePath = path3.join(agentDir, ".gitignore");
|
|
1470
|
+
try {
|
|
1471
|
+
await fs3.access(gitignorePath);
|
|
1472
|
+
return;
|
|
1473
|
+
} catch {
|
|
1474
|
+
}
|
|
1475
|
+
const content = getAgentGitignore(agent);
|
|
1476
|
+
if (!content) return;
|
|
1477
|
+
await fs3.writeFile(gitignorePath, content);
|
|
1478
|
+
}
|
|
1479
|
+
async getProfiles(agent) {
|
|
1480
|
+
const agentDir = path3.join(this.contentDir, agent);
|
|
1481
|
+
try {
|
|
1482
|
+
const entries = await fs3.readdir(agentDir, { withFileTypes: true });
|
|
1483
|
+
const profiles = [];
|
|
1484
|
+
for (const entry of entries) {
|
|
1485
|
+
if (!entry.isDirectory()) continue;
|
|
1486
|
+
const dirName = entry.name;
|
|
1487
|
+
if (validateSlug(dirName) !== null) continue;
|
|
1488
|
+
const metaPath = path3.join(agentDir, dirName, "meta.json");
|
|
1489
|
+
let meta = {};
|
|
1490
|
+
try {
|
|
1491
|
+
const content = await fs3.readFile(metaPath, "utf-8");
|
|
1492
|
+
meta = JSON.parse(content);
|
|
1493
|
+
} catch {
|
|
1494
|
+
}
|
|
1495
|
+
profiles.push({
|
|
1496
|
+
name: meta.name || dirName,
|
|
1497
|
+
slug: dirName,
|
|
1498
|
+
agent,
|
|
1499
|
+
description: meta.description,
|
|
1500
|
+
created_at: meta.created_at
|
|
1501
|
+
});
|
|
1502
|
+
}
|
|
1503
|
+
return profiles;
|
|
1504
|
+
} catch {
|
|
1505
|
+
return [];
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
async createProfile(agent, name, description) {
|
|
1509
|
+
if (!this.tools[agent]) {
|
|
1510
|
+
throw new Error(`Unsupported agent: ${agent}`);
|
|
1511
|
+
}
|
|
1512
|
+
const validationError = validateProfileName(name);
|
|
1513
|
+
if (validationError) {
|
|
1514
|
+
throw new Error(validationError);
|
|
1515
|
+
}
|
|
1516
|
+
const slug = slugify(name);
|
|
1517
|
+
const profileDir = path3.join(this.contentDir, agent, slug);
|
|
1518
|
+
try {
|
|
1519
|
+
await fs3.access(profileDir);
|
|
1520
|
+
throw new Error(`Profile '${slug}' already exists for agent '${agent}'`);
|
|
1521
|
+
} catch (err) {
|
|
1522
|
+
if (err instanceof Error && "code" in err && err.code !== "ENOENT") {
|
|
1523
|
+
throw err;
|
|
1524
|
+
}
|
|
1525
|
+
if (err instanceof Error && !("code" in err)) {
|
|
1526
|
+
throw err;
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
await fs3.mkdir(profileDir, { recursive: true });
|
|
1530
|
+
const meta = {
|
|
1531
|
+
name,
|
|
1532
|
+
slug,
|
|
1533
|
+
agent,
|
|
1534
|
+
description,
|
|
1535
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1536
|
+
};
|
|
1537
|
+
await fs3.writeFile(path3.join(profileDir, "meta.json"), JSON.stringify(meta, null, 2));
|
|
1538
|
+
return profileDir;
|
|
1539
|
+
}
|
|
1540
|
+
};
|
|
1541
|
+
}
|
|
1542
|
+
});
|
|
1543
|
+
|
|
1544
|
+
// src/commands/list.ts
|
|
1545
|
+
var list_exports = {};
|
|
1546
|
+
__export(list_exports, {
|
|
1547
|
+
default: () => list_default,
|
|
1548
|
+
listCommand: () => listCommand
|
|
1549
|
+
});
|
|
1550
|
+
async function listCommand(agent) {
|
|
1551
|
+
const config = new ConfigManager();
|
|
1552
|
+
await config.init();
|
|
1553
|
+
if (agent && !SUPPORTED_TOOLS[agent]) {
|
|
1554
|
+
console.error(import_picocolors5.default.red(`Unsupported agent: ${agent}`));
|
|
1555
|
+
process.exit(1);
|
|
1556
|
+
}
|
|
1557
|
+
const configDir = config.getConfigDir();
|
|
1558
|
+
const contentDir = config.getContentDir();
|
|
1559
|
+
console.log(import_picocolors5.default.bold("Configuration:"));
|
|
1560
|
+
console.log(` Config: ${import_picocolors5.default.dim(configDir)}`);
|
|
1561
|
+
if (contentDir !== configDir) {
|
|
1562
|
+
console.log(` Content: ${import_picocolors5.default.dim(contentDir)}`);
|
|
1563
|
+
}
|
|
1564
|
+
const agents = agent ? [agent] : Object.keys(SUPPORTED_TOOLS);
|
|
1565
|
+
for (const a of agents) {
|
|
1566
|
+
const profiles = await config.getProfiles(a);
|
|
1567
|
+
const tool = SUPPORTED_TOOLS[a];
|
|
1568
|
+
if (!tool) continue;
|
|
1569
|
+
console.log(import_picocolors5.default.bold(`
|
|
1570
|
+
${tool.description} Profiles:`));
|
|
1571
|
+
if (profiles.length === 0) {
|
|
1572
|
+
console.log(import_picocolors5.default.dim(" No profiles found"));
|
|
1573
|
+
} else {
|
|
1574
|
+
for (const p2 of profiles) {
|
|
1575
|
+
const label = p2.name !== p2.slug ? `${p2.name} (${p2.slug})` : p2.name;
|
|
1576
|
+
console.log(` ${import_picocolors5.default.cyan(label)} - ${p2.description || "No description"}`);
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
var import_picocolors5, list_default;
|
|
1582
|
+
var init_list = __esm({
|
|
1583
|
+
"src/commands/list.ts"() {
|
|
1584
|
+
"use strict";
|
|
1585
|
+
init_esm_shims();
|
|
1586
|
+
init_dist();
|
|
1587
|
+
init_config();
|
|
1588
|
+
init_types();
|
|
1589
|
+
import_picocolors5 = __toESM(require_picocolors(), 1);
|
|
1590
|
+
list_default = defineCommand({
|
|
1591
|
+
meta: {
|
|
1592
|
+
name: "list",
|
|
1593
|
+
description: "List available profiles"
|
|
1594
|
+
},
|
|
1595
|
+
args: {
|
|
1596
|
+
agent: {
|
|
1597
|
+
type: "positional",
|
|
1598
|
+
description: "Filter by agent name",
|
|
1599
|
+
required: false
|
|
1600
|
+
}
|
|
1601
|
+
},
|
|
1602
|
+
async run({ args: args2 }) {
|
|
1603
|
+
await listCommand(args2.agent);
|
|
1604
|
+
}
|
|
1605
|
+
});
|
|
1606
|
+
}
|
|
1607
|
+
});
|
|
1608
|
+
|
|
1609
|
+
// node_modules/@criblinc/docker-names/lib/index.js
|
|
1610
|
+
var require_lib = __commonJS({
|
|
1611
|
+
"node_modules/@criblinc/docker-names/lib/index.js"(exports) {
|
|
1612
|
+
"use strict";
|
|
1613
|
+
init_esm_shims();
|
|
1614
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1615
|
+
exports.generateNameWithNumber = exports.generateName = exports.right = exports.left = void 0;
|
|
1616
|
+
exports.left = [
|
|
1617
|
+
"admiring",
|
|
1618
|
+
"adoring",
|
|
1619
|
+
"affectionate",
|
|
1620
|
+
"amazing",
|
|
1621
|
+
"authentic",
|
|
1622
|
+
"awesome",
|
|
1623
|
+
"beautiful",
|
|
1624
|
+
"beloved",
|
|
1625
|
+
"blissful",
|
|
1626
|
+
"bold",
|
|
1627
|
+
"brave",
|
|
1628
|
+
"caprine",
|
|
1629
|
+
"charming",
|
|
1630
|
+
"clever",
|
|
1631
|
+
"cool",
|
|
1632
|
+
"compassionate",
|
|
1633
|
+
"competent",
|
|
1634
|
+
"confident",
|
|
1635
|
+
"curious",
|
|
1636
|
+
"dazzling",
|
|
1637
|
+
"determined",
|
|
1638
|
+
"dreamy",
|
|
1639
|
+
"eager",
|
|
1640
|
+
"ecstatic",
|
|
1641
|
+
"elastic",
|
|
1642
|
+
"elated",
|
|
1643
|
+
"elegant",
|
|
1644
|
+
"eloquent",
|
|
1645
|
+
"epic",
|
|
1646
|
+
"exciting",
|
|
1647
|
+
"fervent",
|
|
1648
|
+
"festive",
|
|
1649
|
+
"flamboyant",
|
|
1650
|
+
"focused",
|
|
1651
|
+
"friendly",
|
|
1652
|
+
"frosty",
|
|
1653
|
+
"funny",
|
|
1654
|
+
"gallant",
|
|
1655
|
+
"gifted",
|
|
1656
|
+
"goofy",
|
|
1657
|
+
"gracious",
|
|
1658
|
+
"great",
|
|
1659
|
+
"happy",
|
|
1660
|
+
"heuristic",
|
|
1661
|
+
"hopeful",
|
|
1662
|
+
"infallible",
|
|
1663
|
+
"inspiring",
|
|
1664
|
+
"interesting",
|
|
1665
|
+
"intelligent",
|
|
1666
|
+
"jolly",
|
|
1667
|
+
"jovial",
|
|
1668
|
+
"keen",
|
|
1669
|
+
"kind",
|
|
1670
|
+
"laughing",
|
|
1671
|
+
"lucid",
|
|
1672
|
+
"magical",
|
|
1673
|
+
"mystifying",
|
|
1674
|
+
"modest",
|
|
1675
|
+
"musing",
|
|
1676
|
+
"nice",
|
|
1677
|
+
"nifty",
|
|
1678
|
+
"nostalgic",
|
|
1679
|
+
"objective",
|
|
1680
|
+
"optimistic",
|
|
1681
|
+
"peaceful",
|
|
1682
|
+
"practical",
|
|
1683
|
+
"priceless",
|
|
1684
|
+
"problematic",
|
|
1685
|
+
"quirky",
|
|
1686
|
+
"quizzical",
|
|
1687
|
+
"recursing",
|
|
1688
|
+
"relaxed",
|
|
1689
|
+
"retentive",
|
|
1690
|
+
"reverent",
|
|
1691
|
+
"ruminant",
|
|
1692
|
+
"serene",
|
|
1693
|
+
"sharp",
|
|
1694
|
+
"stoic",
|
|
1695
|
+
"sweet",
|
|
1696
|
+
"tender",
|
|
1697
|
+
"trusting",
|
|
1698
|
+
"unruffled",
|
|
1699
|
+
"upbeat",
|
|
1700
|
+
"vibrant",
|
|
1701
|
+
"vigilant",
|
|
1702
|
+
"vigorous",
|
|
1703
|
+
"wizardly",
|
|
1704
|
+
"wonderful",
|
|
1705
|
+
"xenodochial",
|
|
1706
|
+
"youthful",
|
|
1707
|
+
"zealous",
|
|
1708
|
+
"zen"
|
|
1709
|
+
];
|
|
1710
|
+
exports.right = [
|
|
1711
|
+
// Muhammad ibn Jābir al-Ḥarrānī al-Battānī was a founding father of astronomy. https://en.wikipedia.org/wiki/Mu%E1%B8%A5ammad_ibn_J%C4%81bir_al-%E1%B8%A4arr%C4%81n%C4%AB_al-Batt%C4%81n%C4%AB
|
|
1712
|
+
"albattani",
|
|
1713
|
+
// Frances E. Allen, became the first female IBM Fellow in 1989. In 2006, she became the first female recipient of the ACM's Turing Award. https://en.wikipedia.org/wiki/Frances_E._Allen
|
|
1714
|
+
"allen",
|
|
1715
|
+
// June Almeida - Scottish virologist who took the first pictures of the rubella virus - https://en.wikipedia.org/wiki/June_Almeida
|
|
1716
|
+
"almeida",
|
|
1717
|
+
// Kathleen Antonelli, American computer programmer and one of the six original programmers of the ENIAC - https://en.wikipedia.org/wiki/Kathleen_Antonelli
|
|
1718
|
+
"antonelli",
|
|
1719
|
+
// Maria Gaetana Agnesi - Italian mathematician, philosopher, theologian and humanitarian. She was the first woman to write a mathematics handbook and the first woman appointed as a Mathematics Professor at a University. https://en.wikipedia.org/wiki/Maria_Gaetana_Agnesi
|
|
1720
|
+
"agnesi",
|
|
1721
|
+
// Archimedes was a physicist, engineer and mathematician who invented too many things to list them here. https://en.wikipedia.org/wiki/Archimedes
|
|
1722
|
+
"archimedes",
|
|
1723
|
+
// Maria Ardinghelli - Italian translator, mathematician and physicist - https://en.wikipedia.org/wiki/Maria_Ardinghelli
|
|
1724
|
+
"ardinghelli",
|
|
1725
|
+
// Aryabhata - Ancient Indian mathematician-astronomer during 476-550 CE https://en.wikipedia.org/wiki/Aryabhata
|
|
1726
|
+
"aryabhata",
|
|
1727
|
+
// Wanda Austin - Wanda Austin is the President and CEO of The Aerospace Corporation, a leading architect for the US security space programs. https://en.wikipedia.org/wiki/Wanda_Austin
|
|
1728
|
+
"austin",
|
|
1729
|
+
// Charles Babbage invented the concept of a programmable computer. https://en.wikipedia.org/wiki/Charles_Babbage.
|
|
1730
|
+
"babbage",
|
|
1731
|
+
// Stefan Banach - Polish mathematician, was one of the founders of modern functional analysis. https://en.wikipedia.org/wiki/Stefan_Banach
|
|
1732
|
+
"banach",
|
|
1733
|
+
// Buckaroo Banzai and his mentor Dr. Hikita perfected the "oscillation overthruster", a device that allows one to pass through solid matter. - https://en.wikipedia.org/wiki/The_Adventures_of_Buckaroo_Banzai_Across_the_8th_Dimension
|
|
1734
|
+
"banzai",
|
|
1735
|
+
// John Bardeen co-invented the transistor - https://en.wikipedia.org/wiki/John_Bardeen
|
|
1736
|
+
"bardeen",
|
|
1737
|
+
// Jean Bartik, born Betty Jean Jennings, was one of the original programmers for the ENIAC computer. https://en.wikipedia.org/wiki/Jean_Bartik
|
|
1738
|
+
"bartik",
|
|
1739
|
+
// Laura Bassi, the world's first female professor https://en.wikipedia.org/wiki/Laura_Bassi
|
|
1740
|
+
"bassi",
|
|
1741
|
+
// Alexander Graham Bell - an eminent Scottish-born scientist, inventor, engineer and innovator who is credited with inventing the first practical telephone - https://en.wikipedia.org/wiki/Alexander_Graham_Bell
|
|
1742
|
+
"bell",
|
|
1743
|
+
// Karl Friedrich Benz - a German automobile engineer. Inventor of the first practical motorcar. https://en.wikipedia.org/wiki/Karl_Benz
|
|
1744
|
+
"benz",
|
|
1745
|
+
// Homi J Bhabha - was an Indian nuclear physicist, founding director, and professor of physics at the Tata Institute of Fundamental Research. Colloquially known as "father of Indian nuclear programme"- https://en.wikipedia.org/wiki/Homi_J._Bhabha
|
|
1746
|
+
"bhabha",
|
|
1747
|
+
// Bhaskara II - Ancient Indian mathematician-astronomer whose work on calculus predates Newton and Leibniz by over half a millennium - https://en.wikipedia.org/wiki/Bh%C4%81skara_II#Calculus
|
|
1748
|
+
"bhaskara",
|
|
1749
|
+
// Elizabeth Helen Blackburn - Australian-American Nobel laureate; best known for co-discovering telomerase. https://en.wikipedia.org/wiki/Elizabeth_Blackburn
|
|
1750
|
+
"blackburn",
|
|
1751
|
+
// Elizabeth Blackwell - American doctor and first American woman to receive a medical degree - https://en.wikipedia.org/wiki/Elizabeth_Blackwell
|
|
1752
|
+
"blackwell",
|
|
1753
|
+
// Niels Bohr is the father of quantum theory. https://en.wikipedia.org/wiki/Niels_Bohr.
|
|
1754
|
+
"bohr",
|
|
1755
|
+
// Kathleen Booth, she's credited with writing the first assembly language. https://en.wikipedia.org/wiki/Kathleen_Booth
|
|
1756
|
+
"booth",
|
|
1757
|
+
// Anita Borg - Anita Borg was the founding director of the Institute for Women and Technology (IWT). https://en.wikipedia.org/wiki/Anita_Borg
|
|
1758
|
+
"borg",
|
|
1759
|
+
// Satyendra Nath Bose - He provided the foundation for Bose–Einstein statistics and the theory of the Bose–Einstein condensate. - https://en.wikipedia.org/wiki/Satyendra_Nath_Bose
|
|
1760
|
+
"bose",
|
|
1761
|
+
// Katherine Louise Bouman is an imaging scientist and Assistant Professor of Computer Science at the California Institute of Technology. She researches computational methods for imaging, and developed an algorithm that made possible the picture first visualization of a black hole using the Event Horizon Telescope. - https://en.wikipedia.org/wiki/Katie_Bouman
|
|
1762
|
+
"bouman",
|
|
1763
|
+
// Evelyn Boyd Granville - She was one of the first African-American woman to receive a Ph.D. in mathematics; she earned it in 1949 from Yale University. https://en.wikipedia.org/wiki/Evelyn_Boyd_Granville
|
|
1764
|
+
"boyd",
|
|
1765
|
+
// Brahmagupta - Ancient Indian mathematician during 598-670 CE who gave rules to compute with zero - https://en.wikipedia.org/wiki/Brahmagupta#Zero
|
|
1766
|
+
"brahmagupta",
|
|
1767
|
+
// Walter Houser Brattain co-invented the transistor - https://en.wikipedia.org/wiki/Walter_Houser_Brattain
|
|
1768
|
+
"brattain",
|
|
1769
|
+
// Emmett Brown invented time travel. https://en.wikipedia.org/wiki/Emmett_Brown (thanks Brian Goff)
|
|
1770
|
+
"brown",
|
|
1771
|
+
// Linda Brown Buck - American biologist and Nobel laureate best known for her genetic and molecular analyses of the mechanisms of smell. https://en.wikipedia.org/wiki/Linda_B._Buck
|
|
1772
|
+
"buck",
|
|
1773
|
+
// Dame Susan Jocelyn Bell Burnell - Northern Irish astrophysicist who discovered radio pulsars and was the first to analyse them. https://en.wikipedia.org/wiki/Jocelyn_Bell_Burnell
|
|
1774
|
+
"burnell",
|
|
1775
|
+
// Annie Jump Cannon - pioneering female astronomer who classified hundreds of thousands of stars and created the system we use to understand stars today. https://en.wikipedia.org/wiki/Annie_Jump_Cannon
|
|
1776
|
+
"cannon",
|
|
1777
|
+
// Rachel Carson - American marine biologist and conservationist, her book Silent Spring and other writings are credited with advancing the global environmental movement. https://en.wikipedia.org/wiki/Rachel_Carson
|
|
1778
|
+
"carson",
|
|
1779
|
+
// Dame Mary Lucy Cartwright - British mathematician who was one of the first to study what is now known as chaos theory. Also known for Cartwright's theorem which finds applications in signal processing. https://en.wikipedia.org/wiki/Mary_Cartwright
|
|
1780
|
+
"cartwright",
|
|
1781
|
+
// George Washington Carver - American agricultural scientist and inventor. He was the most prominent black scientist of the early 20th century. https://en.wikipedia.org/wiki/George_Washington_Carver
|
|
1782
|
+
"carver",
|
|
1783
|
+
// Vinton Gray Cerf - American Internet pioneer, recognised as one of "the fathers of the Internet". With Robert Elliot Kahn, he designed TCP and IP, the primary data communication protocols of the Internet and other computer networks. https://en.wikipedia.org/wiki/Vint_Cerf
|
|
1784
|
+
"cerf",
|
|
1785
|
+
// Subrahmanyan Chandrasekhar - Astrophysicist known for his mathematical theory on different stages and evolution in structures of the stars. He has won nobel prize for physics - https://en.wikipedia.org/wiki/Subrahmanyan_Chandrasekhar
|
|
1786
|
+
"chandrasekhar",
|
|
1787
|
+
// Sergey Alexeyevich Chaplygin (Russian: Серге́й Алексе́евич Чаплы́гин; April 5, 1869 – October 8, 1942) was a Russian and Soviet physicist, mathematician, and mechanical engineer. He is known for mathematical formulas such as Chaplygin's equation and for a hypothetical substance in cosmology called Chaplygin gas, named after him. https://en.wikipedia.org/wiki/Sergey_Chaplygin
|
|
1788
|
+
"chaplygin",
|
|
1789
|
+
// Émilie du Châtelet - French natural philosopher, mathematician, physicist, and author during the early 1730s, known for her translation of and commentary on Isaac Newton's book Principia containing basic laws of physics. https://en.wikipedia.org/wiki/%C3%89milie_du_Ch%C3%A2telet
|
|
1790
|
+
"chatelet",
|
|
1791
|
+
// Asima Chatterjee was an Indian organic chemist noted for her research on vinca alkaloids, development of drugs for treatment of epilepsy and malaria - https://en.wikipedia.org/wiki/Asima_Chatterjee
|
|
1792
|
+
"chatterjee",
|
|
1793
|
+
// Pafnuty Chebyshev - Russian mathematician. He is known fo his works on probability, statistics, mechanics, analytical geometry and number theory https://en.wikipedia.org/wiki/Pafnuty_Chebyshev
|
|
1794
|
+
"chebyshev",
|
|
1795
|
+
// Bram Cohen - American computer programmer and author of the BitTorrent peer-to-peer protocol. https://en.wikipedia.org/wiki/Bram_Cohen
|
|
1796
|
+
"cohen",
|
|
1797
|
+
// David Lee Chaum - American computer scientist and cryptographer. Known for his seminal contributions in the field of anonymous communication. https://en.wikipedia.org/wiki/David_Chaum
|
|
1798
|
+
"chaum",
|
|
1799
|
+
// Joan Clarke - Bletchley Park code breaker during the Second World War who pioneered techniques that remained top secret for decades. Also an accomplished numismatist https://en.wikipedia.org/wiki/Joan_Clarke
|
|
1800
|
+
"clarke",
|
|
1801
|
+
// Jane Colden - American botanist widely considered the first female American botanist - https://en.wikipedia.org/wiki/Jane_Colden
|
|
1802
|
+
"colden",
|
|
1803
|
+
// Gerty Theresa Cori - American biochemist who became the third woman—and first American woman—to win a Nobel Prize in science, and the first woman to be awarded the Nobel Prize in Physiology or Medicine. Cori was born in Prague. https://en.wikipedia.org/wiki/Gerty_Cori
|
|
1804
|
+
"cori",
|
|
1805
|
+
// Seymour Roger Cray was an American electrical engineer and supercomputer architect who designed a series of computers that were the fastest in the world for decades. https://en.wikipedia.org/wiki/Seymour_Cray
|
|
1806
|
+
"cray",
|
|
1807
|
+
// This entry reflects a husband and wife team who worked together:
|
|
1808
|
+
// Joan Curran was a Welsh scientist who developed radar and invented chaff, a radar countermeasure. https://en.wikipedia.org/wiki/Joan_Curran
|
|
1809
|
+
// Samuel Curran was an Irish physicist who worked alongside his wife during WWII and invented the proximity fuse. https://en.wikipedia.org/wiki/Samuel_Curran
|
|
1810
|
+
"curran",
|
|
1811
|
+
// Marie Skłodowska-Curie discovered radioactivity. https://en.wikipedia.org/wiki/Marie_Curie.
|
|
1812
|
+
"curie",
|
|
1813
|
+
// Charles Darwin established the principles of natural evolution. https://en.wikipedia.org/wiki/Charles_Darwin.
|
|
1814
|
+
"darwin",
|
|
1815
|
+
// Leonardo Da Vinci invented too many things to list here. https://en.wikipedia.org/wiki/Leonardo_da_Vinci.
|
|
1816
|
+
"davinci",
|
|
1817
|
+
// A. K. (Alexander Keewatin) Dewdney, Canadian mathematician, computer scientist, author and filmmaker. Contributor to Scientific American's "Computer Recreations" from 1984 to 1991. Author of Core War (program), The Planiverse, The Armchair Universe, The Magic Machine, The New Turing Omnibus, and more. https://en.wikipedia.org/wiki/Alexander_Dewdney
|
|
1818
|
+
"dewdney",
|
|
1819
|
+
// Satish Dhawan - Indian mathematician and aerospace engineer, known for leading the successful and indigenous development of the Indian space programme. https://en.wikipedia.org/wiki/Satish_Dhawan
|
|
1820
|
+
"dhawan",
|
|
1821
|
+
// Bailey Whitfield Diffie - American cryptographer and one of the pioneers of public-key cryptography. https://en.wikipedia.org/wiki/Whitfield_Diffie
|
|
1822
|
+
"diffie",
|
|
1823
|
+
// Edsger Wybe Dijkstra was a Dutch computer scientist and mathematical scientist. https://en.wikipedia.org/wiki/Edsger_W._Dijkstra.
|
|
1824
|
+
"dijkstra",
|
|
1825
|
+
// Paul Adrien Maurice Dirac - English theoretical physicist who made fundamental contributions to the early development of both quantum mechanics and quantum electrodynamics. https://en.wikipedia.org/wiki/Paul_Dirac
|
|
1826
|
+
"dirac",
|
|
1827
|
+
// Agnes Meyer Driscoll - American cryptanalyst during World Wars I and II who successfully cryptanalysed a number of Japanese ciphers. She was also the co-developer of one of the cipher machines of the US Navy, the CM. https://en.wikipedia.org/wiki/Agnes_Meyer_Driscoll
|
|
1828
|
+
"driscoll",
|
|
1829
|
+
// Donna Dubinsky - played an integral role in the development of personal digital assistants (PDAs) serving as CEO of Palm, Inc. and co-founding Handspring. https://en.wikipedia.org/wiki/Donna_Dubinsky
|
|
1830
|
+
"dubinsky",
|
|
1831
|
+
// Thomas Alva Edison, prolific inventor https://en.wikipedia.org/wiki/Thomas_Edison
|
|
1832
|
+
"edison",
|
|
1833
|
+
// Albert Einstein invented the general theory of relativity. https://en.wikipedia.org/wiki/Albert_Einstein
|
|
1834
|
+
"einstein",
|
|
1835
|
+
// Alexandra Asanovna Elbakyan (Russian: Алекса́ндра Аса́новна Элбакя́н) is a Kazakhstani graduate student, computer programmer, internet pirate in hiding, and the creator of the site Sci-Hub. Nature has listed her in 2016 in the top ten people that mattered in science, and Ars Technica has compared her to Aaron Swartz. - https://en.wikipedia.org/wiki/Alexandra_Elbakyan
|
|
1836
|
+
"elbakyan",
|
|
1837
|
+
// Taher A. ElGamal - Egyptian cryptographer best known for the ElGamal discrete log cryptosystem and the ElGamal digital signature scheme. https://en.wikipedia.org/wiki/Taher_Elgamal
|
|
1838
|
+
"elgamal",
|
|
1839
|
+
// Gertrude Elion - American biochemist, pharmacologist and the 1988 recipient of the Nobel Prize in Medicine - https://en.wikipedia.org/wiki/Gertrude_Elion
|
|
1840
|
+
"elion",
|
|
1841
|
+
// James Henry Ellis - British engineer and cryptographer employed by the GCHQ. Best known for conceiving for the first time, the idea of public-key cryptography. https://en.wikipedia.org/wiki/James_H._Ellis
|
|
1842
|
+
"ellis",
|
|
1843
|
+
// Douglas Engelbart gave the mother of all demos: https://en.wikipedia.org/wiki/Douglas_Engelbart
|
|
1844
|
+
"engelbart",
|
|
1845
|
+
// Euclid invented geometry. https://en.wikipedia.org/wiki/Euclid
|
|
1846
|
+
"euclid",
|
|
1847
|
+
// Leonhard Euler invented large parts of modern mathematics. https://de.wikipedia.org/wiki/Leonhard_Euler
|
|
1848
|
+
"euler",
|
|
1849
|
+
// Michael Faraday - British scientist who contributed to the study of electromagnetism and electrochemistry. https://en.wikipedia.org/wiki/Michael_Faraday
|
|
1850
|
+
"faraday",
|
|
1851
|
+
// Horst Feistel - German-born American cryptographer who was one of the earliest non-government researchers to study the design and theory of block ciphers. Co-developer of DES and Lucifer. Feistel networks, a symmetric structure used in the construction of block ciphers are named after him. https://en.wikipedia.org/wiki/Horst_Feistel
|
|
1852
|
+
"feistel",
|
|
1853
|
+
// Pierre de Fermat pioneered several aspects of modern mathematics. https://en.wikipedia.org/wiki/Pierre_de_Fermat
|
|
1854
|
+
"fermat",
|
|
1855
|
+
// Enrico Fermi invented the first nuclear reactor. https://en.wikipedia.org/wiki/Enrico_Fermi.
|
|
1856
|
+
"fermi",
|
|
1857
|
+
// Richard Feynman was a key contributor to quantum mechanics and particle physics. https://en.wikipedia.org/wiki/Richard_Feynman
|
|
1858
|
+
"feynman",
|
|
1859
|
+
// Benjamin Franklin is famous for his experiments in electricity and the invention of the lightning rod.
|
|
1860
|
+
"franklin",
|
|
1861
|
+
// Yuri Alekseyevich Gagarin - Soviet pilot and cosmonaut, best known as the first human to journey into outer space. https://en.wikipedia.org/wiki/Yuri_Gagarin
|
|
1862
|
+
"gagarin",
|
|
1863
|
+
// Galileo was a founding father of modern astronomy, and faced politics and obscurantism to establish scientific truth. https://en.wikipedia.org/wiki/Galileo_Galilei
|
|
1864
|
+
"galileo",
|
|
1865
|
+
// Évariste Galois - French mathematician whose work laid the foundations of Galois theory and group theory, two major branches of abstract algebra, and the subfield of Galois connections, all while still in his late teens. https://en.wikipedia.org/wiki/%C3%89variste_Galois
|
|
1866
|
+
"galois",
|
|
1867
|
+
// Kadambini Ganguly - Indian physician, known for being the first South Asian female physician, trained in western medicine, to graduate in South Asia. https://en.wikipedia.org/wiki/Kadambini_Ganguly
|
|
1868
|
+
"ganguly",
|
|
1869
|
+
// William Henry "Bill" Gates III is an American business magnate, philanthropist, investor, computer programmer, and inventor. https://en.wikipedia.org/wiki/Bill_Gates
|
|
1870
|
+
"gates",
|
|
1871
|
+
// Johann Carl Friedrich Gauss - German mathematician who made significant contributions to many fields, including number theory, algebra, statistics, analysis, differential geometry, geodesy, geophysics, mechanics, electrostatics, magnetic fields, astronomy, matrix theory, and optics. https://en.wikipedia.org/wiki/Carl_Friedrich_Gauss
|
|
1872
|
+
"gauss",
|
|
1873
|
+
// Marie-Sophie Germain - French mathematician, physicist and philosopher. Known for her work on elasticity theory, number theory and philosophy. https://en.wikipedia.org/wiki/Sophie_Germain
|
|
1874
|
+
"germain",
|
|
1875
|
+
// Adele Goldberg, was one of the designers and developers of the Smalltalk language. https://en.wikipedia.org/wiki/Adele_Goldberg_(computer_scientist)
|
|
1876
|
+
"goldberg",
|
|
1877
|
+
// Adele Goldstine, born Adele Katz, wrote the complete technical description for the first electronic digital computer, ENIAC. https://en.wikipedia.org/wiki/Adele_Goldstine
|
|
1878
|
+
"goldstine",
|
|
1879
|
+
// Shafi Goldwasser is a computer scientist known for creating theoretical foundations of modern cryptography. Winner of 2012 ACM Turing Award. https://en.wikipedia.org/wiki/Shafi_Goldwasser
|
|
1880
|
+
"goldwasser",
|
|
1881
|
+
// James Golick, all around gangster.
|
|
1882
|
+
"golick",
|
|
1883
|
+
// Jane Goodall - British primatologist, ethologist, and anthropologist who is considered to be the world's foremost expert on chimpanzees - https://en.wikipedia.org/wiki/Jane_Goodall
|
|
1884
|
+
"goodall",
|
|
1885
|
+
// Stephen Jay Gould was was an American paleontologist, evolutionary biologist, and historian of science. He is most famous for the theory of punctuated equilibrium - https://en.wikipedia.org/wiki/Stephen_Jay_Gould
|
|
1886
|
+
"gould",
|
|
1887
|
+
// Carolyn Widney Greider - American molecular biologist and joint winner of the 2009 Nobel Prize for Physiology or Medicine for the discovery of telomerase. https://en.wikipedia.org/wiki/Carol_W._Greider
|
|
1888
|
+
"greider",
|
|
1889
|
+
// Alexander Grothendieck - German-born French mathematician who became a leading figure in the creation of modern algebraic geometry. https://en.wikipedia.org/wiki/Alexander_Grothendieck
|
|
1890
|
+
"grothendieck",
|
|
1891
|
+
// Lois Haibt - American computer scientist, part of the team at IBM that developed FORTRAN - https://en.wikipedia.org/wiki/Lois_Haibt
|
|
1892
|
+
"haibt",
|
|
1893
|
+
// Margaret Hamilton - Director of the Software Engineering Division of the MIT Instrumentation Laboratory, which developed on-board flight software for the Apollo space program. https://en.wikipedia.org/wiki/Margaret_Hamilton_(scientist)
|
|
1894
|
+
"hamilton",
|
|
1895
|
+
// Caroline Harriet Haslett - English electrical engineer, electricity industry administrator and champion of women's rights. Co-author of British Standard 1363 that specifies AC power plugs and sockets used across the United Kingdom (which is widely considered as one of the safest designs). https://en.wikipedia.org/wiki/Caroline_Haslett
|
|
1896
|
+
"haslett",
|
|
1897
|
+
// Stephen Hawking pioneered the field of cosmology by combining general relativity and quantum mechanics. https://en.wikipedia.org/wiki/Stephen_Hawking
|
|
1898
|
+
"hawking",
|
|
1899
|
+
// Martin Edward Hellman - American cryptologist, best known for his invention of public-key cryptography in co-operation with Whitfield Diffie and Ralph Merkle. https://en.wikipedia.org/wiki/Martin_Hellman
|
|
1900
|
+
"hellman",
|
|
1901
|
+
// Werner Heisenberg was a founding father of quantum mechanics. https://en.wikipedia.org/wiki/Werner_Heisenberg
|
|
1902
|
+
"heisenberg",
|
|
1903
|
+
// Grete Hermann was a German philosopher noted for her philosophical work on the foundations of quantum mechanics. https://en.wikipedia.org/wiki/Grete_Hermann
|
|
1904
|
+
"hermann",
|
|
1905
|
+
// Caroline Lucretia Herschel - German astronomer and discoverer of several comets. https://en.wikipedia.org/wiki/Caroline_Herschel
|
|
1906
|
+
"herschel",
|
|
1907
|
+
// Heinrich Rudolf Hertz - German physicist who first conclusively proved the existence of the electromagnetic waves. https://en.wikipedia.org/wiki/Heinrich_Hertz
|
|
1908
|
+
"hertz",
|
|
1909
|
+
// Jaroslav Heyrovský was the inventor of the polarographic method, father of the electroanalytical method, and recipient of the Nobel Prize in 1959. His main field of work was polarography. https://en.wikipedia.org/wiki/Jaroslav_Heyrovsk%C3%BD
|
|
1910
|
+
"heyrovsky",
|
|
1911
|
+
// Dorothy Hodgkin was a British biochemist, credited with the development of protein crystallography. She was awarded the Nobel Prize in Chemistry in 1964. https://en.wikipedia.org/wiki/Dorothy_Hodgkin
|
|
1912
|
+
"hodgkin",
|
|
1913
|
+
// Douglas R. Hofstadter is an American professor of cognitive science and author of the Pulitzer Prize and American Book Award-winning work Goedel, Escher, Bach: An Eternal Golden Braid in 1979. A mind-bending work which coined Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's Law." https://en.wikipedia.org/wiki/Douglas_Hofstadter
|
|
1914
|
+
"hofstadter",
|
|
1915
|
+
// Erna Schneider Hoover revolutionized modern communication by inventing a computerized telephone switching method. https://en.wikipedia.org/wiki/Erna_Schneider_Hoover
|
|
1916
|
+
"hoover",
|
|
1917
|
+
// Grace Hopper developed the first compiler for a computer programming language and is credited with popularizing the term "debugging" for fixing computer glitches. https://en.wikipedia.org/wiki/Grace_Hopper
|
|
1918
|
+
"hopper",
|
|
1919
|
+
// Frances Hugle, she was an American scientist, engineer, and inventor who contributed to the understanding of semiconductors, integrated circuitry, and the unique electrical principles of microscopic materials. https://en.wikipedia.org/wiki/Frances_Hugle
|
|
1920
|
+
"hugle",
|
|
1921
|
+
// Hypatia - Greek Alexandrine Neoplatonist philosopher in Egypt who was one of the earliest mothers of mathematics - https://en.wikipedia.org/wiki/Hypatia
|
|
1922
|
+
"hypatia",
|
|
1923
|
+
// Teruko Ishizaka - Japanese scientist and immunologist who co-discovered the antibody class Immunoglobulin E. https://en.wikipedia.org/wiki/Teruko_Ishizaka
|
|
1924
|
+
"ishizaka",
|
|
1925
|
+
// Mary Jackson, American mathematician and aerospace engineer who earned the highest title within NASA's engineering department - https://en.wikipedia.org/wiki/Mary_Jackson_(engineer)
|
|
1926
|
+
"jackson",
|
|
1927
|
+
// Mae Carol Jemison - is an American engineer, physician, and former NASA astronaut. She became the first black woman to travel in space when she served as a mission specialist aboard the Space Shuttle Endeavour - https://en.wikipedia.org/wiki/Mae_Jemison
|
|
1928
|
+
"jemison",
|
|
1929
|
+
// Betty Jennings - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Jean_Bartik
|
|
1930
|
+
"jennings",
|
|
1931
|
+
// Mary Lou Jepsen, was the founder and chief technology officer of One Laptop Per Child (OLPC), and the founder of Pixel Qi. https://en.wikipedia.org/wiki/Mary_Lou_Jepsen
|
|
1932
|
+
"jepsen",
|
|
1933
|
+
// Irène Joliot-Curie - French scientist who was awarded the Nobel Prize for Chemistry in 1935. Daughter of Marie and Pierre Curie. https://en.wikipedia.org/wiki/Ir%C3%A8ne_Joliot-Curie
|
|
1934
|
+
"joliot",
|
|
1935
|
+
// Karen Spärck Jones came up with the concept of inverse document frequency, which is used in most search engines today. https://en.wikipedia.org/wiki/Karen_Sp%C3%A4rck_Jones
|
|
1936
|
+
"jones",
|
|
1937
|
+
// A. P. J. Abdul Kalam - is an Indian scientist aka Missile Man of India for his work on the development of ballistic missile and launch vehicle technology - https://en.wikipedia.org/wiki/A._P._J._Abdul_Kalam
|
|
1938
|
+
"kalam",
|
|
1939
|
+
// Dan Kaminsky - (Feb. 7, 1979 - April 23, 2021) cybersecurity hero known for his study on DNS cache poisoning and his investingations into the Sony Rootkit attacks.
|
|
1940
|
+
"kaminsky",
|
|
1941
|
+
// Sergey Petrovich Kapitsa (Russian: Серге́й Петро́вич Капи́ца; 14 February 1928 – 14 August 2012) was a Russian physicist and demographer. He was best known as host of the popular and long-running Russian scientific TV show, Evident, but Incredible. His father was the Nobel laureate Soviet-era physicist Pyotr Kapitsa, and his brother was the geographer and Antarctic explorer Andrey Kapitsa. - https://en.wikipedia.org/wiki/Sergey_Kapitsa
|
|
1942
|
+
"kapitsa",
|
|
1943
|
+
// Susan Kare, created the icons and many of the interface elements for the original Apple Macintosh in the 1980s, and was an original employee of NeXT, working as the Creative Director. https://en.wikipedia.org/wiki/Susan_Kare
|
|
1944
|
+
"kare",
|
|
1945
|
+
// Mstislav Keldysh - a Soviet scientist in the field of mathematics and mechanics, academician of the USSR Academy of Sciences (1946), President of the USSR Academy of Sciences (1961–1975), three times Hero of Socialist Labor (1956, 1961, 1971), fellow of the Royal Society of Edinburgh (1968). https://en.wikipedia.org/wiki/Mstislav_Keldysh
|
|
1946
|
+
"keldysh",
|
|
1947
|
+
// Mary Kenneth Keller, Sister Mary Kenneth Keller became the first American woman to earn a PhD in Computer Science in 1965. https://en.wikipedia.org/wiki/Mary_Kenneth_Keller
|
|
1948
|
+
"keller",
|
|
1949
|
+
// Johannes Kepler, German astronomer known for his three laws of planetary motion - https://en.wikipedia.org/wiki/Johannes_Kepler
|
|
1950
|
+
"kepler",
|
|
1951
|
+
// Omar Khayyam - Persian mathematician, astronomer and poet. Known for his work on the classification and solution of cubic equations, for his contribution to the understanding of Euclid's fifth postulate and for computing the length of a year very accurately. https://en.wikipedia.org/wiki/Omar_Khayyam
|
|
1952
|
+
"khayyam",
|
|
1953
|
+
// Har Gobind Khorana - Indian-American biochemist who shared the 1968 Nobel Prize for Physiology - https://en.wikipedia.org/wiki/Har_Gobind_Khorana
|
|
1954
|
+
"khorana",
|
|
1955
|
+
// Jack Kilby invented silicon integrated circuits and gave Silicon Valley its name. - https://en.wikipedia.org/wiki/Jack_Kilby
|
|
1956
|
+
"kilby",
|
|
1957
|
+
// Maria Kirch - German astronomer and first woman to discover a comet - https://en.wikipedia.org/wiki/Maria_Margarethe_Kirch
|
|
1958
|
+
"kirch",
|
|
1959
|
+
// Donald Knuth - American computer scientist, author of "The Art of Computer Programming" and creator of the TeX typesetting system. https://en.wikipedia.org/wiki/Donald_Knuth
|
|
1960
|
+
"knuth",
|
|
1961
|
+
// Sophie Kowalevski - Russian mathematician responsible for important original contributions to analysis, differential equations and mechanics - https://en.wikipedia.org/wiki/Sofia_Kovalevskaya
|
|
1962
|
+
"kowalevski",
|
|
1963
|
+
// Marie-Jeanne de Lalande - French astronomer, mathematician and cataloguer of stars - https://en.wikipedia.org/wiki/Marie-Jeanne_de_Lalande
|
|
1964
|
+
"lalande",
|
|
1965
|
+
// Hedy Lamarr - Actress and inventor. The principles of her work are now incorporated into modern Wi-Fi, CDMA and Bluetooth technology. https://en.wikipedia.org/wiki/Hedy_Lamarr
|
|
1966
|
+
"lamarr",
|
|
1967
|
+
// Leslie B. Lamport - American computer scientist. Lamport is best known for his seminal work in distributed systems and was the winner of the 2013 Turing Award. https://en.wikipedia.org/wiki/Leslie_Lamport
|
|
1968
|
+
"lamport",
|
|
1969
|
+
// Mary Leakey - British paleoanthropologist who discovered the first fossilized Proconsul skull - https://en.wikipedia.org/wiki/Mary_Leakey
|
|
1970
|
+
"leakey",
|
|
1971
|
+
// Henrietta Swan Leavitt - she was an American astronomer who discovered the relation between the luminosity and the period of Cepheid variable stars. https://en.wikipedia.org/wiki/Henrietta_Swan_Leavitt
|
|
1972
|
+
"leavitt",
|
|
1973
|
+
// Esther Miriam Zimmer Lederberg - American microbiologist and a pioneer of bacterial genetics. https://en.wikipedia.org/wiki/Esther_Lederberg
|
|
1974
|
+
"lederberg",
|
|
1975
|
+
// Inge Lehmann - Danish seismologist and geophysicist. Known for discovering in 1936 that the Earth has a solid inner core inside a molten outer core. https://en.wikipedia.org/wiki/Inge_Lehmann
|
|
1976
|
+
"lehmann",
|
|
1977
|
+
// Daniel Lewin - Mathematician, Akamai co-founder, soldier, 9/11 victim-- Developed optimization techniques for routing traffic on the internet. Died attempting to stop the 9-11 hijackers. https://en.wikipedia.org/wiki/Daniel_Lewin
|
|
1978
|
+
"lewin",
|
|
1979
|
+
// Ruth Lichterman - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Ruth_Teitelbaum
|
|
1980
|
+
"lichterman",
|
|
1981
|
+
// Barbara Liskov - co-developed the Liskov substitution principle. Liskov was also the winner of the Turing Prize in 2008. - https://en.wikipedia.org/wiki/Barbara_Liskov
|
|
1982
|
+
"liskov",
|
|
1983
|
+
// Ada Lovelace invented the first algorithm. https://en.wikipedia.org/wiki/Ada_Lovelace (thanks James Turnbull)
|
|
1984
|
+
"lovelace",
|
|
1985
|
+
// Auguste and Louis Lumière - the first filmmakers in history - https://en.wikipedia.org/wiki/Auguste_and_Louis_Lumi%C3%A8re
|
|
1986
|
+
"lumiere",
|
|
1987
|
+
// Mahavira - Ancient Indian mathematician during 9th century AD who discovered basic algebraic identities - https://en.wikipedia.org/wiki/Mah%C4%81v%C4%ABra_(mathematician)
|
|
1988
|
+
"mahavira",
|
|
1989
|
+
// Lynn Margulis (b. Lynn Petra Alexander) - an American evolutionary theorist and biologist, science author, educator, and popularizer, and was the primary modern proponent for the significance of symbiosis in evolution. - https://en.wikipedia.org/wiki/Lynn_Margulis
|
|
1990
|
+
"margulis",
|
|
1991
|
+
// Yukihiro Matsumoto - Japanese computer scientist and software programmer best known as the chief designer of the Ruby programming language. https://en.wikipedia.org/wiki/Yukihiro_Matsumoto
|
|
1992
|
+
"matsumoto",
|
|
1993
|
+
// James Clerk Maxwell - Scottish physicist, best known for his formulation of electromagnetic theory. https://en.wikipedia.org/wiki/James_Clerk_Maxwell
|
|
1994
|
+
"maxwell",
|
|
1995
|
+
// Maria Mayer - American theoretical physicist and Nobel laureate in Physics for proposing the nuclear shell model of the atomic nucleus - https://en.wikipedia.org/wiki/Maria_Mayer
|
|
1996
|
+
"mayer",
|
|
1997
|
+
// John McCarthy invented LISP: https://en.wikipedia.org/wiki/John_McCarthy_(computer_scientist)
|
|
1998
|
+
"mccarthy",
|
|
1999
|
+
// Barbara McClintock - a distinguished American cytogeneticist, 1983 Nobel Laureate in Physiology or Medicine for discovering transposons. https://en.wikipedia.org/wiki/Barbara_McClintock
|
|
2000
|
+
"mcclintock",
|
|
2001
|
+
// Anne Laura Dorinthea McLaren - British developmental biologist whose work helped lead to human in-vitro fertilisation. https://en.wikipedia.org/wiki/Anne_McLaren
|
|
2002
|
+
"mclaren",
|
|
2003
|
+
// Malcolm McLean invented the modern shipping container: https://en.wikipedia.org/wiki/Malcom_McLean
|
|
2004
|
+
"mclean",
|
|
2005
|
+
// Kay McNulty - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Kathleen_Antonelli
|
|
2006
|
+
"mcnulty",
|
|
2007
|
+
// Gregor Johann Mendel - Czech scientist and founder of genetics. https://en.wikipedia.org/wiki/Gregor_Mendel
|
|
2008
|
+
"mendel",
|
|
2009
|
+
// Dmitri Mendeleev - a chemist and inventor. He formulated the Periodic Law, created a farsighted version of the periodic table of elements, and used it to correct the properties of some already discovered elements and also to predict the properties of eight elements yet to be discovered. https://en.wikipedia.org/wiki/Dmitri_Mendeleev
|
|
2010
|
+
"mendeleev",
|
|
2011
|
+
// Lise Meitner - Austrian/Swedish physicist who was involved in the discovery of nuclear fission. The element meitnerium is named after her - https://en.wikipedia.org/wiki/Lise_Meitner
|
|
2012
|
+
"meitner",
|
|
2013
|
+
// Carla Meninsky, was the game designer and programmer for Atari 2600 games Dodge 'Em and Warlords. https://en.wikipedia.org/wiki/Carla_Meninsky
|
|
2014
|
+
"meninsky",
|
|
2015
|
+
// Ralph C. Merkle - American computer scientist, known for devising Merkle's puzzles - one of the very first schemes for public-key cryptography. Also, inventor of Merkle trees and co-inventor of the Merkle-Damgård construction for building collision-resistant cryptographic hash functions and the Merkle-Hellman knapsack cryptosystem. https://en.wikipedia.org/wiki/Ralph_Merkle
|
|
2016
|
+
"merkle",
|
|
2017
|
+
// Johanna Mestorf - German prehistoric archaeologist and first female museum director in Germany - https://en.wikipedia.org/wiki/Johanna_Mestorf
|
|
2018
|
+
"mestorf",
|
|
2019
|
+
// Maryam Mirzakhani - an Iranian mathematician and the first woman to win the Fields Medal. https://en.wikipedia.org/wiki/Maryam_Mirzakhani
|
|
2020
|
+
"mirzakhani",
|
|
2021
|
+
// Rita Levi-Montalcini - Won Nobel Prize in Physiology or Medicine jointly with colleague Stanley Cohen for the discovery of nerve growth factor (https://en.wikipedia.org/wiki/Rita_Levi-Montalcini)
|
|
2022
|
+
"montalcini",
|
|
2023
|
+
// Gordon Earle Moore - American engineer, Silicon Valley founding father, author of Moore's law. https://en.wikipedia.org/wiki/Gordon_Moore
|
|
2024
|
+
"moore",
|
|
2025
|
+
// Samuel Morse - contributed to the invention of a single-wire telegraph system based on European telegraphs and was a co-developer of the Morse code - https://en.wikipedia.org/wiki/Samuel_Morse
|
|
2026
|
+
"morse",
|
|
2027
|
+
// Ian Murdock - founder of the Debian project - https://en.wikipedia.org/wiki/Ian_Murdock
|
|
2028
|
+
"murdock",
|
|
2029
|
+
// May-Britt Moser - Nobel prize winner neuroscientist who contributed to the discovery of grid cells in the brain. https://en.wikipedia.org/wiki/May-Britt_Moser
|
|
2030
|
+
"moser",
|
|
2031
|
+
// John Napier of Merchiston - Scottish landowner known as an astronomer, mathematician and physicist. Best known for his discovery of logarithms. https://en.wikipedia.org/wiki/John_Napier
|
|
2032
|
+
"napier",
|
|
2033
|
+
// John Forbes Nash, Jr. - American mathematician who made fundamental contributions to game theory, differential geometry, and the study of partial differential equations. https://en.wikipedia.org/wiki/John_Forbes_Nash_Jr.
|
|
2034
|
+
"nash",
|
|
2035
|
+
// John von Neumann - todays computer architectures are based on the von Neumann architecture. https://en.wikipedia.org/wiki/Von_Neumann_architecture
|
|
2036
|
+
"neumann",
|
|
2037
|
+
// Isaac Newton invented classic mechanics and modern optics. https://en.wikipedia.org/wiki/Isaac_Newton
|
|
2038
|
+
"newton",
|
|
2039
|
+
// Florence Nightingale, more prominently known as a nurse, was also the first female member of the Royal Statistical Society and a pioneer in statistical graphics https://en.wikipedia.org/wiki/Florence_Nightingale#Statistics_and_sanitary_reform
|
|
2040
|
+
"nightingale",
|
|
2041
|
+
// Alfred Nobel - a Swedish chemist, engineer, innovator, and armaments manufacturer (inventor of dynamite) - https://en.wikipedia.org/wiki/Alfred_Nobel
|
|
2042
|
+
"nobel",
|
|
2043
|
+
// Emmy Noether, German mathematician. Noether's Theorem is named after her. https://en.wikipedia.org/wiki/Emmy_Noether
|
|
2044
|
+
"noether",
|
|
2045
|
+
// Poppy Northcutt. Poppy Northcutt was the first woman to work as part of NASA’s Mission Control. http://www.businessinsider.com/poppy-northcutt-helped-apollo-astronauts-2014-12?op=1
|
|
2046
|
+
"northcutt",
|
|
2047
|
+
// Robert Noyce invented silicon integrated circuits and gave Silicon Valley its name. - https://en.wikipedia.org/wiki/Robert_Noyce
|
|
2048
|
+
"noyce",
|
|
2049
|
+
// Panini - Ancient Indian linguist and grammarian from 4th century CE who worked on the world's first formal system - https://en.wikipedia.org/wiki/P%C4%81%E1%B9%87ini#Comparison_with_modern_formal_systems
|
|
2050
|
+
"panini",
|
|
2051
|
+
// Ambroise Pare invented modern surgery. https://en.wikipedia.org/wiki/Ambroise_Par%C3%A9
|
|
2052
|
+
"pare",
|
|
2053
|
+
// Blaise Pascal, French mathematician, physicist, and inventor - https://en.wikipedia.org/wiki/Blaise_Pascal
|
|
2054
|
+
"pascal",
|
|
2055
|
+
// Louis Pasteur discovered vaccination, fermentation and pasteurization. https://en.wikipedia.org/wiki/Louis_Pasteur.
|
|
2056
|
+
"pasteur",
|
|
2057
|
+
// Cecilia Payne-Gaposchkin was an astronomer and astrophysicist who, in 1925, proposed in her Ph.D. thesis an explanation for the composition of stars in terms of the relative abundances of hydrogen and helium. https://en.wikipedia.org/wiki/Cecilia_Payne-Gaposchkin
|
|
2058
|
+
"payne",
|
|
2059
|
+
// Radia Perlman is a software designer and network engineer and most famous for her invention of the spanning-tree protocol (STP). https://en.wikipedia.org/wiki/Radia_Perlman
|
|
2060
|
+
"perlman",
|
|
2061
|
+
// Rob Pike was a key contributor to Unix, Plan 9, the X graphic system, utf-8, and the Go programming language. https://en.wikipedia.org/wiki/Rob_Pike
|
|
2062
|
+
"pike",
|
|
2063
|
+
// Henri Poincaré made fundamental contributions in several fields of mathematics. https://en.wikipedia.org/wiki/Henri_Poincar%C3%A9
|
|
2064
|
+
"poincare",
|
|
2065
|
+
// Laura Poitras is a director and producer whose work, made possible by open source crypto tools, advances the causes of truth and freedom of information by reporting disclosures by whistleblowers such as Edward Snowden. https://en.wikipedia.org/wiki/Laura_Poitras
|
|
2066
|
+
"poitras",
|
|
2067
|
+
// Tat’yana Avenirovna Proskuriakova (Russian: Татья́на Авени́ровна Проскуряко́ва) (January 23 [O.S. January 10] 1909 – August 30, 1985) was a Russian-American Mayanist scholar and archaeologist who contributed significantly to the deciphering of Maya hieroglyphs, the writing system of the pre-Columbian Maya civilization of Mesoamerica. https://en.wikipedia.org/wiki/Tatiana_Proskouriakoff
|
|
2068
|
+
"proskuriakova",
|
|
2069
|
+
// Claudius Ptolemy - a Greco-Egyptian writer of Alexandria, known as a mathematician, astronomer, geographer, astrologer, and poet of a single epigram in the Greek Anthology - https://en.wikipedia.org/wiki/Ptolemy
|
|
2070
|
+
"ptolemy",
|
|
2071
|
+
// C. V. Raman - Indian physicist who won the Nobel Prize in 1930 for proposing the Raman effect. - https://en.wikipedia.org/wiki/C._V._Raman
|
|
2072
|
+
"raman",
|
|
2073
|
+
// Srinivasa Ramanujan - Indian mathematician and autodidact who made extraordinary contributions to mathematical analysis, number theory, infinite series, and continued fractions. - https://en.wikipedia.org/wiki/Srinivasa_Ramanujan
|
|
2074
|
+
"ramanujan",
|
|
2075
|
+
// Dennis Ritchie - co-creator of UNIX and the C programming language. - https://en.wikipedia.org/wiki/Dennis_Ritchie
|
|
2076
|
+
"ritchie",
|
|
2077
|
+
// Ida Rhodes - American pioneer in computer programming, designed the first computer used for Social Security. https://en.wikipedia.org/wiki/Ida_Rhodes
|
|
2078
|
+
"rhodes",
|
|
2079
|
+
// Julia Hall Bowman Robinson - American mathematician renowned for her contributions to the fields of computability theory and computational complexity theory. https://en.wikipedia.org/wiki/Julia_Robinson
|
|
2080
|
+
"robinson",
|
|
2081
|
+
// Wilhelm Conrad Röntgen - German physicist who was awarded the first Nobel Prize in Physics in 1901 for the discovery of X-rays (Röntgen rays). https://en.wikipedia.org/wiki/Wilhelm_R%C3%B6ntgen
|
|
2082
|
+
"roentgen",
|
|
2083
|
+
// Rosalind Franklin - British biophysicist and X-ray crystallographer whose research was critical to the understanding of DNA - https://en.wikipedia.org/wiki/Rosalind_Franklin
|
|
2084
|
+
"rosalind",
|
|
2085
|
+
// Vera Rubin - American astronomer who pioneered work on galaxy rotation rates. https://en.wikipedia.org/wiki/Vera_Rubin
|
|
2086
|
+
"rubin",
|
|
2087
|
+
// Meghnad Saha - Indian astrophysicist best known for his development of the Saha equation, used to describe chemical and physical conditions in stars - https://en.wikipedia.org/wiki/Meghnad_Saha
|
|
2088
|
+
"saha",
|
|
2089
|
+
// Jean E. Sammet developed FORMAC, the first widely used computer language for symbolic manipulation of mathematical formulas. https://en.wikipedia.org/wiki/Jean_E._Sammet
|
|
2090
|
+
"sammet",
|
|
2091
|
+
// Mildred Sanderson - American mathematician best known for Sanderson's theorem concerning modular invariants. https://en.wikipedia.org/wiki/Mildred_Sanderson
|
|
2092
|
+
"sanderson",
|
|
2093
|
+
// Satoshi Nakamoto is the name used by the unknown person or group of people who developed bitcoin, authored the bitcoin white paper, and created and deployed bitcoin's original reference implementation. https://en.wikipedia.org/wiki/Satoshi_Nakamoto
|
|
2094
|
+
"satoshi",
|
|
2095
|
+
// Adi Shamir - Israeli cryptographer whose numerous inventions and contributions to cryptography include the Ferge Fiat Shamir identification scheme, the Rivest Shamir Adleman (RSA) public-key cryptosystem, the Shamir's secret sharing scheme, the breaking of the Merkle-Hellman cryptosystem, the TWINKLE and TWIRL factoring devices and the discovery of differential cryptanalysis (with Eli Biham). https://en.wikipedia.org/wiki/Adi_Shamir
|
|
2096
|
+
"shamir",
|
|
2097
|
+
// Claude Shannon - The father of information theory and founder of digital circuit design theory. (https://en.wikipedia.org/wiki/Claude_Shannon)
|
|
2098
|
+
"shannon",
|
|
2099
|
+
// Carol Shaw - Originally an Atari employee, Carol Shaw is said to be the first female video game designer. https://en.wikipedia.org/wiki/Carol_Shaw_(video_game_designer)
|
|
2100
|
+
"shaw",
|
|
2101
|
+
// Dame Stephanie "Steve" Shirley - Founded a software company in 1962 employing women working from home. https://en.wikipedia.org/wiki/Steve_Shirley
|
|
2102
|
+
"shirley",
|
|
2103
|
+
// William Shockley co-invented the transistor - https://en.wikipedia.org/wiki/William_Shockley
|
|
2104
|
+
"shockley",
|
|
2105
|
+
// Lina Solomonovna Stern (or Shtern; Russian: Лина Соломоновна Штерн; 26 August 1878 – 7 March 1968) was a Soviet biochemist, physiologist and humanist whose medical discoveries saved thousands of lives at the fronts of World War II. She is best known for her pioneering work on blood–brain barrier, which she described as hemato-encephalic barrier in 1921. https://en.wikipedia.org/wiki/Lina_Stern
|
|
2106
|
+
"shtern",
|
|
2107
|
+
// Françoise Barré-Sinoussi - French virologist and Nobel Prize Laureate in Physiology or Medicine; her work was fundamental in identifying HIV as the cause of AIDS. https://en.wikipedia.org/wiki/Fran%C3%A7oise_Barr%C3%A9-Sinoussi
|
|
2108
|
+
"sinoussi",
|
|
2109
|
+
// Betty Snyder - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Betty_Holberton
|
|
2110
|
+
"snyder",
|
|
2111
|
+
// Cynthia Solomon - Pioneer in the fields of artificial intelligence, computer science and educational computing. Known for creation of Logo, an educational programming language. https://en.wikipedia.org/wiki/Cynthia_Solomon
|
|
2112
|
+
"solomon",
|
|
2113
|
+
// Frances Spence - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Frances_Spence
|
|
2114
|
+
"spence",
|
|
2115
|
+
// Michael Stonebraker is a database research pioneer and architect of Ingres, Postgres, VoltDB and SciDB. Winner of 2014 ACM Turing Award. https://en.wikipedia.org/wiki/Michael_Stonebraker
|
|
2116
|
+
"stonebraker",
|
|
2117
|
+
// Ivan Edward Sutherland - American computer scientist and Internet pioneer, widely regarded as the father of computer graphics. https://en.wikipedia.org/wiki/Ivan_Sutherland
|
|
2118
|
+
"sutherland",
|
|
2119
|
+
// Janese Swanson (with others) developed the first of the Carmen Sandiego games. She went on to found Girl Tech. https://en.wikipedia.org/wiki/Janese_Swanson
|
|
2120
|
+
"swanson",
|
|
2121
|
+
// Aaron Swartz was influential in creating RSS, Markdown, Creative Commons, Reddit, and much of the internet as we know it today. He was devoted to freedom of information on the web. https://en.wikiquote.org/wiki/Aaron_Swartz
|
|
2122
|
+
"swartz",
|
|
2123
|
+
// Bertha Swirles was a theoretical physicist who made a number of contributions to early quantum theory. https://en.wikipedia.org/wiki/Bertha_Swirles
|
|
2124
|
+
"swirles",
|
|
2125
|
+
// Helen Brooke Taussig - American cardiologist and founder of the field of paediatric cardiology. https://en.wikipedia.org/wiki/Helen_B._Taussig
|
|
2126
|
+
"taussig",
|
|
2127
|
+
// Valentina Tereshkova is a Russian engineer, cosmonaut and politician. She was the first woman to fly to space in 1963. In 2013, at the age of 76, she offered to go on a one-way mission to Mars. https://en.wikipedia.org/wiki/Valentina_Tereshkova
|
|
2128
|
+
"tereshkova",
|
|
2129
|
+
// Nikola Tesla invented the AC electric system and every gadget ever used by a James Bond villain. https://en.wikipedia.org/wiki/Nikola_Tesla
|
|
2130
|
+
"tesla",
|
|
2131
|
+
// Marie Tharp - American geologist and oceanic cartographer who co-created the first scientific map of the Atlantic Ocean floor. Her work led to the acceptance of the theories of plate tectonics and continental drift. https://en.wikipedia.org/wiki/Marie_Tharp
|
|
2132
|
+
"tharp",
|
|
2133
|
+
// Ken Thompson - co-creator of UNIX and the C programming language - https://en.wikipedia.org/wiki/Ken_Thompson
|
|
2134
|
+
"thompson",
|
|
2135
|
+
// Linus Torvalds invented Linux and Git. https://en.wikipedia.org/wiki/Linus_Torvalds
|
|
2136
|
+
"torvalds",
|
|
2137
|
+
// Youyou Tu - Chinese pharmaceutical chemist and educator known for discovering artemisinin and dihydroartemisinin, used to treat malaria, which has saved millions of lives. Joint winner of the 2015 Nobel Prize in Physiology or Medicine. https://en.wikipedia.org/wiki/Tu_Youyou
|
|
2138
|
+
"tu",
|
|
2139
|
+
// Alan Turing was a founding father of computer science. https://en.wikipedia.org/wiki/Alan_Turing.
|
|
2140
|
+
"turing",
|
|
2141
|
+
// Varahamihira - Ancient Indian mathematician who discovered trigonometric formulae during 505-587 CE - https://en.wikipedia.org/wiki/Var%C4%81hamihira#Contributions
|
|
2142
|
+
"varahamihira",
|
|
2143
|
+
// Dorothy Vaughan was a NASA mathematician and computer programmer on the SCOUT launch vehicle program that put America's first satellites into space - https://en.wikipedia.org/wiki/Dorothy_Vaughan
|
|
2144
|
+
"vaughan",
|
|
2145
|
+
// Sir Mokshagundam Visvesvaraya - is a notable Indian engineer. He is a recipient of the Indian Republic's highest honour, the Bharat Ratna, in 1955. On his birthday, 15 September is celebrated as Engineer's Day in India in his memory - https://en.wikipedia.org/wiki/Visvesvaraya
|
|
2146
|
+
"visvesvaraya",
|
|
2147
|
+
// Christiane Nüsslein-Volhard - German biologist, won Nobel Prize in Physiology or Medicine in 1995 for research on the genetic control of embryonic development. https://en.wikipedia.org/wiki/Christiane_N%C3%BCsslein-Volhard
|
|
2148
|
+
"volhard",
|
|
2149
|
+
// Cédric Villani - French mathematician, won Fields Medal, Fermat Prize and Poincaré Price for his work in differential geometry and statistical mechanics. https://en.wikipedia.org/wiki/C%C3%A9dric_Villani
|
|
2150
|
+
"villani",
|
|
2151
|
+
// Marlyn Wescoff - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Marlyn_Meltzer
|
|
2152
|
+
"wescoff",
|
|
2153
|
+
// Sylvia B. Wilbur - British computer scientist who helped develop the ARPANET, was one of the first to exchange email in the UK and a leading researcher in computer-supported collaborative work. https://en.wikipedia.org/wiki/Sylvia_Wilbur
|
|
2154
|
+
"wilbur",
|
|
2155
|
+
// Andrew Wiles - Notable British mathematician who proved the enigmatic Fermat's Last Theorem - https://en.wikipedia.org/wiki/Andrew_Wiles
|
|
2156
|
+
"wiles",
|
|
2157
|
+
// Roberta Williams, did pioneering work in graphical adventure games for personal computers, particularly the King's Quest series. https://en.wikipedia.org/wiki/Roberta_Williams
|
|
2158
|
+
"williams",
|
|
2159
|
+
// Malcolm John Williamson - British mathematician and cryptographer employed by the GCHQ. Developed in 1974 what is now known as Diffie-Hellman key exchange (Diffie and Hellman first published the scheme in 1976). https://en.wikipedia.org/wiki/Malcolm_J._Williamson
|
|
2160
|
+
"williamson",
|
|
2161
|
+
// Sophie Wilson designed the first Acorn Micro-Computer and the instruction set for ARM processors. https://en.wikipedia.org/wiki/Sophie_Wilson
|
|
2162
|
+
"wilson",
|
|
2163
|
+
// Jeannette Wing - co-developed the Liskov substitution principle. - https://en.wikipedia.org/wiki/Jeannette_Wing
|
|
2164
|
+
"wing",
|
|
2165
|
+
// Steve Wozniak invented the Apple I and Apple II. https://en.wikipedia.org/wiki/Steve_Wozniak
|
|
2166
|
+
"wozniak",
|
|
2167
|
+
// The Wright brothers, Orville and Wilbur - credited with inventing and building the world's first successful airplane and making the first controlled, powered and sustained heavier-than-air human flight - https://en.wikipedia.org/wiki/Wright_brothers
|
|
2168
|
+
"wright",
|
|
2169
|
+
// Chien-Shiung Wu - Chinese-American experimental physicist who made significant contributions to nuclear physics. https://en.wikipedia.org/wiki/Chien-Shiung_Wu
|
|
2170
|
+
"wu",
|
|
2171
|
+
// Rosalyn Sussman Yalow - Rosalyn Sussman Yalow was an American medical physicist, and a co-winner of the 1977 Nobel Prize in Physiology or Medicine for development of the radioimmunoassay technique. https://en.wikipedia.org/wiki/Rosalyn_Sussman_Yalow
|
|
2172
|
+
"yalow",
|
|
2173
|
+
// Ada Yonath - an Israeli crystallographer, the first woman from the Middle East to win a Nobel prize in the sciences. https://en.wikipedia.org/wiki/Ada_Yonath
|
|
2174
|
+
"yonath",
|
|
2175
|
+
// Nikolay Yegorovich Zhukovsky (Russian: Никола́й Его́рович Жуко́вский, January 17 1847 – March 17, 1921) was a Russian scientist, mathematician and engineer, and a founding father of modern aero- and hydrodynamics. Whereas contemporary scientists scoffed at the idea of human flight, Zhukovsky was the first to undertake the study of airflow. He is often called the Father of Russian Aviation. https://en.wikipedia.org/wiki/Nikolay_Yegorovich_Zhukovsky
|
|
2176
|
+
"zhukovsky",
|
|
2177
|
+
// Cribl Employees - Add your family name (or nickname) to this list in alphabetical order
|
|
2178
|
+
"adebajo",
|
|
2179
|
+
"ago",
|
|
2180
|
+
"amir",
|
|
2181
|
+
"ansell",
|
|
2182
|
+
"balala",
|
|
2183
|
+
"barrett",
|
|
2184
|
+
"bhaskar",
|
|
2185
|
+
"bieron",
|
|
2186
|
+
"bitincka",
|
|
2187
|
+
// Ledion Bitincka - Co-founder and Chief Technology Officer
|
|
2188
|
+
"bondo",
|
|
2189
|
+
"bourbie",
|
|
2190
|
+
"bradford",
|
|
2191
|
+
"brunette",
|
|
2192
|
+
"bryant",
|
|
2193
|
+
"bui",
|
|
2194
|
+
"buzzard",
|
|
2195
|
+
"cavuto",
|
|
2196
|
+
"chakka",
|
|
2197
|
+
"checkoway",
|
|
2198
|
+
"chelikowsky",
|
|
2199
|
+
"chiorean",
|
|
2200
|
+
"choi",
|
|
2201
|
+
"chung",
|
|
2202
|
+
"collins",
|
|
2203
|
+
"conway",
|
|
2204
|
+
"correll",
|
|
2205
|
+
"cullen",
|
|
2206
|
+
"dagan",
|
|
2207
|
+
"dalpe",
|
|
2208
|
+
"dar",
|
|
2209
|
+
"davis",
|
|
2210
|
+
"dewadiga",
|
|
2211
|
+
"disha",
|
|
2212
|
+
"draese",
|
|
2213
|
+
"dryden",
|
|
2214
|
+
"duca",
|
|
2215
|
+
"dugas",
|
|
2216
|
+
"duke",
|
|
2217
|
+
"dzhumakaliev",
|
|
2218
|
+
"easley",
|
|
2219
|
+
"edens",
|
|
2220
|
+
"eltahir",
|
|
2221
|
+
"emmy",
|
|
2222
|
+
"fones",
|
|
2223
|
+
"fritze",
|
|
2224
|
+
"gardner",
|
|
2225
|
+
"gian",
|
|
2226
|
+
"gifford",
|
|
2227
|
+
"gilbert",
|
|
2228
|
+
"gleich",
|
|
2229
|
+
"gomes",
|
|
2230
|
+
"goolya",
|
|
2231
|
+
"goozy",
|
|
2232
|
+
"gorney",
|
|
2233
|
+
"halastra",
|
|
2234
|
+
"hall",
|
|
2235
|
+
"hayes",
|
|
2236
|
+
"heady",
|
|
2237
|
+
"hink",
|
|
2238
|
+
"hoffman",
|
|
2239
|
+
"janssen",
|
|
2240
|
+
"jarzyna",
|
|
2241
|
+
"jayaram",
|
|
2242
|
+
"jeebus",
|
|
2243
|
+
"kaczynski",
|
|
2244
|
+
"kanson",
|
|
2245
|
+
"katz",
|
|
2246
|
+
// Eugene Katz - Sr Professional Services Consultant
|
|
2247
|
+
"kellogg",
|
|
2248
|
+
"krueger",
|
|
2249
|
+
"kulkarni",
|
|
2250
|
+
"laarits",
|
|
2251
|
+
"lang",
|
|
2252
|
+
"laughlin",
|
|
2253
|
+
"lee",
|
|
2254
|
+
"lewis",
|
|
2255
|
+
"litras",
|
|
2256
|
+
"maislin",
|
|
2257
|
+
"mana",
|
|
2258
|
+
"marandola",
|
|
2259
|
+
"marcus",
|
|
2260
|
+
"marko",
|
|
2261
|
+
"martins",
|
|
2262
|
+
"mccombs",
|
|
2263
|
+
"mccririe",
|
|
2264
|
+
"mcgovern",
|
|
2265
|
+
"mersin",
|
|
2266
|
+
"miatselski",
|
|
2267
|
+
"mikhailov",
|
|
2268
|
+
"mikkleson",
|
|
2269
|
+
"mitchell",
|
|
2270
|
+
"mohammed",
|
|
2271
|
+
"molla",
|
|
2272
|
+
"monroy",
|
|
2273
|
+
"mortazavi",
|
|
2274
|
+
"mullins",
|
|
2275
|
+
"mullins",
|
|
2276
|
+
"mungel",
|
|
2277
|
+
"muni",
|
|
2278
|
+
"murad",
|
|
2279
|
+
"nguyen",
|
|
2280
|
+
"nurkulov",
|
|
2281
|
+
"owen",
|
|
2282
|
+
"padilla",
|
|
2283
|
+
"paplinski",
|
|
2284
|
+
"perumal",
|
|
2285
|
+
"pilarczyk",
|
|
2286
|
+
"polychronis",
|
|
2287
|
+
"pondrom",
|
|
2288
|
+
"prodan",
|
|
2289
|
+
"purfield",
|
|
2290
|
+
"quick",
|
|
2291
|
+
"quintero",
|
|
2292
|
+
"radecki",
|
|
2293
|
+
"raher",
|
|
2294
|
+
"ramanathan",
|
|
2295
|
+
"rattana",
|
|
2296
|
+
"reed",
|
|
2297
|
+
"rivendell",
|
|
2298
|
+
"rochette",
|
|
2299
|
+
"romano",
|
|
2300
|
+
// Mariano Romano - Sr Technical Customer Training Mgr
|
|
2301
|
+
"romero",
|
|
2302
|
+
"romito",
|
|
2303
|
+
"ross",
|
|
2304
|
+
"russell",
|
|
2305
|
+
"rust",
|
|
2306
|
+
"salerno",
|
|
2307
|
+
"santos",
|
|
2308
|
+
"searle",
|
|
2309
|
+
"semple",
|
|
2310
|
+
"shah",
|
|
2311
|
+
"shahbaz",
|
|
2312
|
+
"shanaghy",
|
|
2313
|
+
// Mick Shanaghy - Head of Customer Support & Professional Services
|
|
2314
|
+
"sharp",
|
|
2315
|
+
"shtylla",
|
|
2316
|
+
"singh",
|
|
2317
|
+
"smoczynska",
|
|
2318
|
+
"sobolewski",
|
|
2319
|
+
"souza",
|
|
2320
|
+
"strong",
|
|
2321
|
+
"suara",
|
|
2322
|
+
"sundaravarathan",
|
|
2323
|
+
"szmajnta",
|
|
2324
|
+
"tankersley",
|
|
2325
|
+
"trusov",
|
|
2326
|
+
"turcic",
|
|
2327
|
+
"uppuluri",
|
|
2328
|
+
"valeo",
|
|
2329
|
+
"vandoren",
|
|
2330
|
+
// Tim VanDoren - Sr Software Engineer
|
|
2331
|
+
// Trevor VanDoren - Software Engineer
|
|
2332
|
+
"wali",
|
|
2333
|
+
"wallace",
|
|
2334
|
+
"walters",
|
|
2335
|
+
"wilk",
|
|
2336
|
+
"wilkins",
|
|
2337
|
+
"woger",
|
|
2338
|
+
"wolfe",
|
|
2339
|
+
"zahid",
|
|
2340
|
+
"zamora",
|
|
2341
|
+
"zastawny"
|
|
2342
|
+
// Bartek Zastawny - Sr Software Engineer
|
|
2343
|
+
];
|
|
2344
|
+
function generateName3() {
|
|
2345
|
+
var leftElement = exports.left[Math.floor(Math.random() * exports.left.length)];
|
|
2346
|
+
var rightElement = exports.right[Math.floor(Math.random() * exports.right.length)];
|
|
2347
|
+
return leftElement + "-" + rightElement;
|
|
2348
|
+
}
|
|
2349
|
+
exports.generateName = generateName3;
|
|
2350
|
+
function generateNameWithNumber() {
|
|
2351
|
+
return generateName3() + "-" + (Math.floor(Math.random() * 6) + 1);
|
|
2352
|
+
}
|
|
2353
|
+
exports.generateNameWithNumber = generateNameWithNumber;
|
|
2354
|
+
}
|
|
2355
|
+
});
|
|
2356
|
+
|
|
2357
|
+
// src/lib/prompts.ts
|
|
2358
|
+
async function promptForAgent(message = "Select an agent:") {
|
|
2359
|
+
const options = Object.entries(SUPPORTED_TOOLS).map(([key, tool]) => ({
|
|
2360
|
+
value: key,
|
|
2361
|
+
label: tool.description,
|
|
2362
|
+
hint: key
|
|
2363
|
+
}));
|
|
2364
|
+
const response = await ve({
|
|
2365
|
+
message,
|
|
2366
|
+
options
|
|
2367
|
+
});
|
|
2368
|
+
if (pD(response)) {
|
|
2369
|
+
xe("Operation cancelled.");
|
|
2370
|
+
process.exit(0);
|
|
2371
|
+
}
|
|
2372
|
+
return response;
|
|
2373
|
+
}
|
|
2374
|
+
async function promptForProfile(config, agent, message = "Select a profile:") {
|
|
2375
|
+
const profiles = await config.getProfiles(agent);
|
|
2376
|
+
if (profiles.length === 0) {
|
|
2377
|
+
return null;
|
|
2378
|
+
}
|
|
2379
|
+
const response = await ve({
|
|
2380
|
+
message,
|
|
2381
|
+
options: profiles.map((p2) => ({
|
|
2382
|
+
value: p2.slug,
|
|
2383
|
+
label: p2.name,
|
|
2384
|
+
hint: p2.description
|
|
2385
|
+
}))
|
|
2386
|
+
});
|
|
2387
|
+
if (pD(response)) {
|
|
2388
|
+
xe("Operation cancelled.");
|
|
2389
|
+
process.exit(0);
|
|
2390
|
+
}
|
|
2391
|
+
return response;
|
|
2392
|
+
}
|
|
2393
|
+
var init_prompts = __esm({
|
|
2394
|
+
"src/lib/prompts.ts"() {
|
|
2395
|
+
"use strict";
|
|
2396
|
+
init_esm_shims();
|
|
2397
|
+
init_dist3();
|
|
2398
|
+
init_types();
|
|
2399
|
+
}
|
|
2400
|
+
});
|
|
2401
|
+
|
|
2402
|
+
// src/commands/add.ts
|
|
2403
|
+
var add_exports = {};
|
|
2404
|
+
__export(add_exports, {
|
|
2405
|
+
addCommand: () => addCommand,
|
|
2406
|
+
default: () => add_default
|
|
2407
|
+
});
|
|
2408
|
+
async function addCommand(agent, name) {
|
|
2409
|
+
let resolvedAgent = agent;
|
|
2410
|
+
if (!resolvedAgent) {
|
|
2411
|
+
resolvedAgent = await promptForAgent("Select agent to create profile for:");
|
|
2412
|
+
}
|
|
2413
|
+
if (!SUPPORTED_TOOLS[resolvedAgent]) {
|
|
2414
|
+
console.error(import_picocolors6.default.red(`Unsupported agent: ${resolvedAgent}`));
|
|
2415
|
+
process.exit(1);
|
|
2416
|
+
}
|
|
2417
|
+
if (!name) {
|
|
2418
|
+
const suggestedName = (0, import_docker_names.generateName)();
|
|
2419
|
+
const response = await he({
|
|
2420
|
+
message: "Enter profile name:",
|
|
2421
|
+
placeholder: suggestedName,
|
|
2422
|
+
initialValue: suggestedName,
|
|
2423
|
+
validate(value) {
|
|
2424
|
+
return validateProfileName(value) || void 0;
|
|
2425
|
+
}
|
|
2426
|
+
});
|
|
2427
|
+
if (pD(response)) {
|
|
2428
|
+
xe("Operation cancelled.");
|
|
2429
|
+
process.exit(0);
|
|
2430
|
+
}
|
|
2431
|
+
name = response;
|
|
2432
|
+
}
|
|
2433
|
+
const validationError = validateProfileName(name);
|
|
2434
|
+
if (validationError) {
|
|
2435
|
+
console.error(import_picocolors6.default.red(validationError));
|
|
2436
|
+
process.exit(1);
|
|
2437
|
+
}
|
|
2438
|
+
const config = new ConfigManager();
|
|
2439
|
+
await config.init();
|
|
2440
|
+
try {
|
|
2441
|
+
const path9 = await config.createProfile(resolvedAgent, name);
|
|
2442
|
+
Se(`Profile created at ${import_picocolors6.default.cyan(path9)}`);
|
|
2443
|
+
} catch (error) {
|
|
2444
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
2445
|
+
console.error(import_picocolors6.default.red(message));
|
|
2446
|
+
process.exit(1);
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
var import_picocolors6, import_docker_names, add_default;
|
|
2450
|
+
var init_add = __esm({
|
|
2451
|
+
"src/commands/add.ts"() {
|
|
2452
|
+
"use strict";
|
|
2453
|
+
init_esm_shims();
|
|
2454
|
+
init_dist();
|
|
2455
|
+
init_dist3();
|
|
2456
|
+
init_config();
|
|
2457
|
+
init_types();
|
|
2458
|
+
import_picocolors6 = __toESM(require_picocolors(), 1);
|
|
2459
|
+
init_validation();
|
|
2460
|
+
import_docker_names = __toESM(require_lib(), 1);
|
|
2461
|
+
init_prompts();
|
|
2462
|
+
add_default = defineCommand({
|
|
2463
|
+
meta: {
|
|
2464
|
+
name: "add",
|
|
2465
|
+
description: "Create a new profile (alias: create)"
|
|
2466
|
+
},
|
|
2467
|
+
args: {
|
|
2468
|
+
agent: {
|
|
2469
|
+
type: "positional",
|
|
2470
|
+
description: "Agent name (claude/opencode)",
|
|
2471
|
+
required: false
|
|
2472
|
+
},
|
|
2473
|
+
name: {
|
|
2474
|
+
type: "positional",
|
|
2475
|
+
description: "Profile name",
|
|
2476
|
+
required: false
|
|
2477
|
+
}
|
|
2478
|
+
},
|
|
2479
|
+
async run({ args: args2 }) {
|
|
2480
|
+
await addCommand(args2.agent, args2.name);
|
|
2481
|
+
}
|
|
2482
|
+
});
|
|
2483
|
+
}
|
|
2484
|
+
});
|
|
2485
|
+
|
|
2486
|
+
// src/lib/envrc.ts
|
|
2487
|
+
function escapeRegExp(value) {
|
|
2488
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
2489
|
+
}
|
|
2490
|
+
function ensureEndsWithNewline(content) {
|
|
2491
|
+
return content.endsWith("\n") ? content : `${content}
|
|
2492
|
+
`;
|
|
2493
|
+
}
|
|
2494
|
+
function ensureBootstrapBlock(content) {
|
|
2495
|
+
const block = `${BOOTSTRAP_BEGIN}
|
|
2496
|
+
watch_file ${MANAGED_ENVRC_FILENAME}
|
|
2497
|
+
source_env_if_exists ${MANAGED_ENVRC_FILENAME}
|
|
2498
|
+
${BOOTSTRAP_END}`;
|
|
2499
|
+
const blockRegex = new RegExp(
|
|
2500
|
+
`${escapeRegExp(BOOTSTRAP_BEGIN)}[\\s\\S]*?${escapeRegExp(BOOTSTRAP_END)}`
|
|
2501
|
+
);
|
|
2502
|
+
if (blockRegex.test(content)) {
|
|
2503
|
+
return ensureEndsWithNewline(content.replace(blockRegex, block));
|
|
2504
|
+
}
|
|
2505
|
+
const prefix = content.length && !content.endsWith("\n") ? `${content}
|
|
2506
|
+
` : content;
|
|
2507
|
+
return ensureEndsWithNewline(`${prefix}${block}`);
|
|
2508
|
+
}
|
|
2509
|
+
function normalizeHeader(content) {
|
|
2510
|
+
const trimmedStart = content.trimStart();
|
|
2511
|
+
const next = trimmedStart.startsWith(HEADER) ? trimmedStart : `${HEADER}
|
|
2512
|
+
${trimmedStart ? `
|
|
2513
|
+
${trimmedStart}` : ""}`;
|
|
2514
|
+
return ensureEndsWithNewline(next);
|
|
2515
|
+
}
|
|
2516
|
+
function updateAgentBlock(content, agent, envVar, profilePath) {
|
|
2517
|
+
const begin = `### agentprofiles:begin ${agent}`;
|
|
2518
|
+
const end = `### agentprofiles:end ${agent}`;
|
|
2519
|
+
const block = `${begin}
|
|
2520
|
+
export ${envVar}="${profilePath}"
|
|
2521
|
+
${end}`;
|
|
2522
|
+
const blockRegex = new RegExp(`${escapeRegExp(begin)}[\\s\\S]*?${escapeRegExp(end)}`);
|
|
2523
|
+
let next = content;
|
|
2524
|
+
if (blockRegex.test(next)) {
|
|
2525
|
+
next = next.replace(blockRegex, block);
|
|
2526
|
+
} else {
|
|
2527
|
+
const prefix = next.length && !next.endsWith("\n") ? `${next}
|
|
2528
|
+
` : next;
|
|
2529
|
+
next = `${prefix}${block}
|
|
2530
|
+
`;
|
|
2531
|
+
}
|
|
2532
|
+
return normalizeHeader(next);
|
|
2533
|
+
}
|
|
2534
|
+
function removeAgentBlock(content, agent) {
|
|
2535
|
+
const begin = `### agentprofiles:begin ${agent}`;
|
|
2536
|
+
const end = `### agentprofiles:end ${agent}`;
|
|
2537
|
+
const blockRegex = new RegExp(`${escapeRegExp(begin)}[\\s\\S]*?${escapeRegExp(end)}\\n?`, "g");
|
|
2538
|
+
let next = content.replace(blockRegex, "");
|
|
2539
|
+
next = next.replace(/\n{3,}/g, "\n\n").trim();
|
|
2540
|
+
return normalizeHeader(next);
|
|
2541
|
+
}
|
|
2542
|
+
function getActiveProfile(content, agent) {
|
|
2543
|
+
const begin = `### agentprofiles:begin ${agent}`;
|
|
2544
|
+
const end = `### agentprofiles:end ${agent}`;
|
|
2545
|
+
const blockRegex = new RegExp(`${escapeRegExp(begin)}[\\s\\S]*?${escapeRegExp(end)}`);
|
|
2546
|
+
const match = content.match(blockRegex);
|
|
2547
|
+
if (!match) return null;
|
|
2548
|
+
const exportMatch = match[0].match(/export\s+\w+="([^"]+)"/);
|
|
2549
|
+
if (!exportMatch || !exportMatch[1]) return null;
|
|
2550
|
+
const profilePath = exportMatch[1];
|
|
2551
|
+
const parts = profilePath.replace("$HOME", "").split("/");
|
|
2552
|
+
return parts[parts.length - 1] ?? null;
|
|
2553
|
+
}
|
|
2554
|
+
function hasAnyAgentBlocks(content) {
|
|
2555
|
+
const agentBlockRegex = /### agentprofiles:begin \w+[\s\S]*?### agentprofiles:end \w+/;
|
|
2556
|
+
return agentBlockRegex.test(content);
|
|
2557
|
+
}
|
|
2558
|
+
function removeBootstrapBlock(content) {
|
|
2559
|
+
const blockRegex = new RegExp(
|
|
2560
|
+
`${escapeRegExp(BOOTSTRAP_BEGIN)}[\\s\\S]*?${escapeRegExp(BOOTSTRAP_END)}\\n?`
|
|
2561
|
+
);
|
|
2562
|
+
let next = content.replace(blockRegex, "");
|
|
2563
|
+
next = next.replace(/\n{3,}/g, "\n\n").trim();
|
|
2564
|
+
return next;
|
|
2565
|
+
}
|
|
2566
|
+
function isEffectivelyEmpty(content) {
|
|
2567
|
+
const stripped = content.split("\n").filter((line) => {
|
|
2568
|
+
const trimmed = line.trim();
|
|
2569
|
+
return trimmed.length > 0 && !trimmed.startsWith("#");
|
|
2570
|
+
}).join("");
|
|
2571
|
+
return stripped.length === 0;
|
|
2572
|
+
}
|
|
2573
|
+
var BOOTSTRAP_BEGIN, BOOTSTRAP_END, HEADER, MANAGED_ENVRC_FILENAME, LEGACY_MANAGED_ENVRC_FILENAME;
|
|
2574
|
+
var init_envrc = __esm({
|
|
2575
|
+
"src/lib/envrc.ts"() {
|
|
2576
|
+
"use strict";
|
|
2577
|
+
init_esm_shims();
|
|
2578
|
+
BOOTSTRAP_BEGIN = "### agentprofiles:begin";
|
|
2579
|
+
BOOTSTRAP_END = "### agentprofiles:end";
|
|
2580
|
+
HEADER = "# tool-generated; do not edit";
|
|
2581
|
+
MANAGED_ENVRC_FILENAME = ".envrc.agentprofiles";
|
|
2582
|
+
LEGACY_MANAGED_ENVRC_FILENAME = ".envrc.agent";
|
|
2583
|
+
}
|
|
2584
|
+
});
|
|
2585
|
+
|
|
2586
|
+
// src/lib/direnv.ts
|
|
2587
|
+
import path4 from "path";
|
|
2588
|
+
function isDirenvHookLoaded(env) {
|
|
2589
|
+
return Boolean(env.DIRENV_DIR || env.DIRENV_FILE || env.DIRENV_WATCHES);
|
|
2590
|
+
}
|
|
2591
|
+
function getDirenvHookHint(shellPath) {
|
|
2592
|
+
const shellName = shellPath ? path4.basename(shellPath) : "";
|
|
2593
|
+
switch (shellName) {
|
|
2594
|
+
case "bash":
|
|
2595
|
+
case "zsh":
|
|
2596
|
+
return `eval "$(direnv hook ${shellName})"`;
|
|
2597
|
+
case "fish":
|
|
2598
|
+
return "direnv hook fish | source";
|
|
2599
|
+
case "tcsh":
|
|
2600
|
+
return "eval `direnv hook tcsh`";
|
|
2601
|
+
case "elvish":
|
|
2602
|
+
return "eval (direnv hook elvish)";
|
|
2603
|
+
default:
|
|
2604
|
+
return "direnv hook <your-shell>";
|
|
2605
|
+
}
|
|
2606
|
+
}
|
|
2607
|
+
var init_direnv = __esm({
|
|
2608
|
+
"src/lib/direnv.ts"() {
|
|
2609
|
+
"use strict";
|
|
2610
|
+
init_esm_shims();
|
|
2611
|
+
}
|
|
2612
|
+
});
|
|
2613
|
+
|
|
2614
|
+
// src/commands/set.ts
|
|
2615
|
+
var set_exports = {};
|
|
2616
|
+
__export(set_exports, {
|
|
2617
|
+
default: () => set_default,
|
|
2618
|
+
setCommand: () => setCommand
|
|
2619
|
+
});
|
|
2620
|
+
import fs4 from "fs/promises";
|
|
2621
|
+
import os3 from "os";
|
|
2622
|
+
import path5 from "path";
|
|
2623
|
+
import { spawn } from "child_process";
|
|
2624
|
+
function toShellPath(absolutePath) {
|
|
2625
|
+
const home = os3.homedir();
|
|
2626
|
+
if (absolutePath.startsWith(home)) {
|
|
2627
|
+
return absolutePath.replace(home, "$HOME");
|
|
2628
|
+
}
|
|
2629
|
+
return absolutePath;
|
|
2630
|
+
}
|
|
2631
|
+
function runDirenvAllow() {
|
|
2632
|
+
return new Promise((resolve, reject) => {
|
|
2633
|
+
const child = spawn("direnv", ["allow"], { stdio: "inherit" });
|
|
2634
|
+
child.on("error", reject);
|
|
2635
|
+
child.on("exit", (code) => {
|
|
2636
|
+
if (code === 0) return resolve();
|
|
2637
|
+
reject(new Error(`direnv allow failed with exit code ${code ?? "unknown"}`));
|
|
2638
|
+
});
|
|
2639
|
+
});
|
|
2640
|
+
}
|
|
2641
|
+
async function resolveManagedEnvrcPath(cwd) {
|
|
2642
|
+
const nextPath = path5.join(cwd, MANAGED_ENVRC_FILENAME);
|
|
2643
|
+
const legacyPath = path5.join(cwd, LEGACY_MANAGED_ENVRC_FILENAME);
|
|
2644
|
+
try {
|
|
2645
|
+
await fs4.access(nextPath);
|
|
2646
|
+
return nextPath;
|
|
2647
|
+
} catch {
|
|
2648
|
+
}
|
|
2649
|
+
try {
|
|
2650
|
+
await fs4.access(legacyPath);
|
|
2651
|
+
try {
|
|
2652
|
+
await fs4.rename(legacyPath, nextPath);
|
|
2653
|
+
} catch {
|
|
2654
|
+
try {
|
|
2655
|
+
const legacyContent = await fs4.readFile(legacyPath, "utf-8");
|
|
2656
|
+
await fs4.writeFile(nextPath, legacyContent);
|
|
2657
|
+
await fs4.unlink(legacyPath);
|
|
2658
|
+
} catch {
|
|
2659
|
+
}
|
|
2660
|
+
}
|
|
2661
|
+
} catch {
|
|
2662
|
+
}
|
|
2663
|
+
return nextPath;
|
|
2664
|
+
}
|
|
2665
|
+
async function setCommand(agent, name, options) {
|
|
2666
|
+
const resolvedAgent = agent ?? await promptForAgent("Select agent to set profile for:");
|
|
2667
|
+
let resolvedName = typeof name === "string" ? name : void 0;
|
|
2668
|
+
const resolvedOptions = typeof name === "object" ? name : options;
|
|
2669
|
+
if (!SUPPORTED_TOOLS[resolvedAgent]) {
|
|
2670
|
+
console.error(import_picocolors7.default.red(`Unsupported agent: ${resolvedAgent}`));
|
|
2671
|
+
process.exit(1);
|
|
2672
|
+
}
|
|
2673
|
+
const config = new ConfigManager();
|
|
2674
|
+
await config.init();
|
|
2675
|
+
if (!resolvedName) {
|
|
2676
|
+
const profiles = await config.getProfiles(resolvedAgent);
|
|
2677
|
+
if (profiles.length === 0) {
|
|
2678
|
+
Me(`No profiles found for ${resolvedAgent}. Let's create one.`, "New Profile");
|
|
2679
|
+
const suggestedName = (0, import_docker_names2.generateName)();
|
|
2680
|
+
const nameResponse = await he({
|
|
2681
|
+
message: "Enter a name for this profile:",
|
|
2682
|
+
placeholder: suggestedName,
|
|
2683
|
+
initialValue: suggestedName,
|
|
2684
|
+
validate(value) {
|
|
2685
|
+
return validateProfileName(value) || void 0;
|
|
2686
|
+
}
|
|
2687
|
+
});
|
|
2688
|
+
if (pD(nameResponse)) {
|
|
2689
|
+
xe("Operation cancelled.");
|
|
2690
|
+
process.exit(0);
|
|
2691
|
+
}
|
|
2692
|
+
const newName = nameResponse;
|
|
2693
|
+
await config.createProfile(resolvedAgent, newName);
|
|
2694
|
+
Me(`Created profile ${import_picocolors7.default.cyan(newName)}`, "Profile Created");
|
|
2695
|
+
resolvedName = slugify(newName);
|
|
2696
|
+
} else {
|
|
2697
|
+
const response = await ve({
|
|
2698
|
+
message: "Select a profile to activate:",
|
|
2699
|
+
options: profiles.map((p2) => ({
|
|
2700
|
+
value: p2.slug,
|
|
2701
|
+
label: p2.name,
|
|
2702
|
+
hint: p2.description
|
|
2703
|
+
}))
|
|
2704
|
+
});
|
|
2705
|
+
if (pD(response)) {
|
|
2706
|
+
xe("Operation cancelled.");
|
|
2707
|
+
process.exit(0);
|
|
2708
|
+
}
|
|
2709
|
+
resolvedName = response;
|
|
2710
|
+
}
|
|
2711
|
+
} else {
|
|
2712
|
+
const validationError = validateProfileName(resolvedName);
|
|
2713
|
+
if (validationError) {
|
|
2714
|
+
console.error(import_picocolors7.default.red(validationError));
|
|
2715
|
+
process.exit(1);
|
|
2716
|
+
}
|
|
2717
|
+
resolvedName = slugify(resolvedName);
|
|
2718
|
+
}
|
|
2719
|
+
if (!resolvedName) {
|
|
2720
|
+
console.error(import_picocolors7.default.red("Profile name is required."));
|
|
2721
|
+
process.exit(1);
|
|
2722
|
+
}
|
|
2723
|
+
const cwd = process.cwd();
|
|
2724
|
+
const envrcPath = path5.join(cwd, ".envrc");
|
|
2725
|
+
const managedEnvrcPath = await resolveManagedEnvrcPath(cwd);
|
|
2726
|
+
const profileDir = path5.join(config.getContentDir(), resolvedAgent, resolvedName);
|
|
2727
|
+
try {
|
|
2728
|
+
await fs4.access(profileDir);
|
|
2729
|
+
} catch {
|
|
2730
|
+
console.error(import_picocolors7.default.red(`Profile '${resolvedName}' not found for agent '${resolvedAgent}'`));
|
|
2731
|
+
process.exit(1);
|
|
2732
|
+
}
|
|
2733
|
+
let envrcContent = "";
|
|
2734
|
+
try {
|
|
2735
|
+
envrcContent = await fs4.readFile(envrcPath, "utf-8");
|
|
2736
|
+
} catch {
|
|
2737
|
+
envrcContent = "";
|
|
2738
|
+
}
|
|
2739
|
+
const nextEnvrc = ensureBootstrapBlock(envrcContent);
|
|
2740
|
+
await fs4.writeFile(envrcPath, nextEnvrc);
|
|
2741
|
+
let managedContent = "";
|
|
2742
|
+
try {
|
|
2743
|
+
managedContent = await fs4.readFile(managedEnvrcPath, "utf-8");
|
|
2744
|
+
} catch {
|
|
2745
|
+
managedContent = "";
|
|
2746
|
+
}
|
|
2747
|
+
const envVar = SUPPORTED_TOOLS[resolvedAgent].envVar;
|
|
2748
|
+
const profilePath = toShellPath(profileDir);
|
|
2749
|
+
const nextManaged = updateAgentBlock(managedContent, resolvedAgent, envVar, profilePath);
|
|
2750
|
+
await fs4.writeFile(managedEnvrcPath, nextManaged);
|
|
2751
|
+
if (resolvedOptions?.allow) {
|
|
2752
|
+
try {
|
|
2753
|
+
await runDirenvAllow();
|
|
2754
|
+
Se(`Activated ${import_picocolors7.default.cyan(resolvedName)} profile for ${resolvedAgent} (direnv allowed).`);
|
|
2755
|
+
} catch (error) {
|
|
2756
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
2757
|
+
console.error(import_picocolors7.default.red(message));
|
|
2758
|
+
process.exit(1);
|
|
2759
|
+
}
|
|
2760
|
+
} else {
|
|
2761
|
+
Se(`Activated ${import_picocolors7.default.cyan(resolvedName)} profile for ${resolvedAgent}.`);
|
|
2762
|
+
console.log(import_picocolors7.default.dim("Run 'direnv allow' to apply changes."));
|
|
2763
|
+
}
|
|
2764
|
+
if (!isDirenvHookLoaded(process.env)) {
|
|
2765
|
+
const hint = getDirenvHookHint(process.env.SHELL);
|
|
2766
|
+
console.log(import_picocolors7.default.yellow("direnv hook not detected in this shell."));
|
|
2767
|
+
console.log(import_picocolors7.default.dim(`Add this to your shell rc and restart: ${hint}`));
|
|
2768
|
+
}
|
|
2769
|
+
}
|
|
2770
|
+
var import_picocolors7, import_docker_names2, set_default;
|
|
2771
|
+
var init_set = __esm({
|
|
2772
|
+
"src/commands/set.ts"() {
|
|
2773
|
+
"use strict";
|
|
2774
|
+
init_esm_shims();
|
|
2775
|
+
init_dist();
|
|
2776
|
+
init_dist3();
|
|
2777
|
+
init_config();
|
|
2778
|
+
init_types();
|
|
2779
|
+
import_picocolors7 = __toESM(require_picocolors(), 1);
|
|
2780
|
+
init_envrc();
|
|
2781
|
+
init_validation();
|
|
2782
|
+
init_direnv();
|
|
2783
|
+
import_docker_names2 = __toESM(require_lib(), 1);
|
|
2784
|
+
init_prompts();
|
|
2785
|
+
set_default = defineCommand({
|
|
2786
|
+
meta: {
|
|
2787
|
+
name: "set",
|
|
2788
|
+
description: "Set the active profile for the current directory"
|
|
2789
|
+
},
|
|
2790
|
+
args: {
|
|
2791
|
+
agent: {
|
|
2792
|
+
type: "positional",
|
|
2793
|
+
description: "Agent name",
|
|
2794
|
+
required: false
|
|
2795
|
+
},
|
|
2796
|
+
name: {
|
|
2797
|
+
type: "positional",
|
|
2798
|
+
description: "Profile name",
|
|
2799
|
+
required: false
|
|
2800
|
+
},
|
|
2801
|
+
allow: {
|
|
2802
|
+
type: "boolean",
|
|
2803
|
+
alias: "y",
|
|
2804
|
+
description: "Run direnv allow after updating files"
|
|
2805
|
+
}
|
|
2806
|
+
},
|
|
2807
|
+
async run({ args: args2 }) {
|
|
2808
|
+
await setCommand(args2.agent, args2.name, { allow: args2.allow });
|
|
2809
|
+
}
|
|
2810
|
+
});
|
|
2811
|
+
}
|
|
2812
|
+
});
|
|
2813
|
+
|
|
2814
|
+
// src/commands/unset.ts
|
|
2815
|
+
var unset_exports = {};
|
|
2816
|
+
__export(unset_exports, {
|
|
2817
|
+
default: () => unset_default,
|
|
2818
|
+
unsetCommand: () => unsetCommand
|
|
2819
|
+
});
|
|
2820
|
+
import fs5 from "fs/promises";
|
|
2821
|
+
import path6 from "path";
|
|
2822
|
+
import { spawn as spawn2 } from "child_process";
|
|
2823
|
+
function runDirenvAllow2() {
|
|
2824
|
+
return new Promise((resolve, reject) => {
|
|
2825
|
+
const child = spawn2("direnv", ["allow"], { stdio: "inherit" });
|
|
2826
|
+
child.on("error", reject);
|
|
2827
|
+
child.on("exit", (code) => {
|
|
2828
|
+
if (code === 0) return resolve();
|
|
2829
|
+
reject(new Error(`direnv allow failed with exit code ${code ?? "unknown"}`));
|
|
2830
|
+
});
|
|
2831
|
+
});
|
|
2832
|
+
}
|
|
2833
|
+
async function resolveManagedEnvrcPath2(cwd) {
|
|
2834
|
+
const nextPath = path6.join(cwd, MANAGED_ENVRC_FILENAME);
|
|
2835
|
+
const legacyPath = path6.join(cwd, LEGACY_MANAGED_ENVRC_FILENAME);
|
|
2836
|
+
try {
|
|
2837
|
+
await fs5.access(nextPath);
|
|
2838
|
+
return nextPath;
|
|
2839
|
+
} catch {
|
|
2840
|
+
}
|
|
2841
|
+
try {
|
|
2842
|
+
await fs5.access(legacyPath);
|
|
2843
|
+
try {
|
|
2844
|
+
await fs5.rename(legacyPath, nextPath);
|
|
2845
|
+
} catch {
|
|
2846
|
+
try {
|
|
2847
|
+
const legacyContent = await fs5.readFile(legacyPath, "utf-8");
|
|
2848
|
+
await fs5.writeFile(nextPath, legacyContent);
|
|
2849
|
+
await fs5.unlink(legacyPath);
|
|
2850
|
+
} catch {
|
|
2851
|
+
}
|
|
2852
|
+
}
|
|
2853
|
+
} catch {
|
|
2854
|
+
}
|
|
2855
|
+
return nextPath;
|
|
2856
|
+
}
|
|
2857
|
+
async function unsetCommand(agent, options) {
|
|
2858
|
+
const resolvedAgent = agent ?? await promptForAgent("Select agent to unset:");
|
|
2859
|
+
if (!SUPPORTED_TOOLS[resolvedAgent]) {
|
|
2860
|
+
console.error(import_picocolors8.default.red(`Unsupported agent: ${resolvedAgent}`));
|
|
2861
|
+
process.exit(1);
|
|
2862
|
+
}
|
|
2863
|
+
const cwd = process.cwd();
|
|
2864
|
+
const envrcPath = path6.join(cwd, ".envrc");
|
|
2865
|
+
const managedEnvrcPath = await resolveManagedEnvrcPath2(cwd);
|
|
2866
|
+
let managedContent = "";
|
|
2867
|
+
try {
|
|
2868
|
+
managedContent = await fs5.readFile(managedEnvrcPath, "utf-8");
|
|
2869
|
+
} catch {
|
|
2870
|
+
managedContent = "";
|
|
2871
|
+
}
|
|
2872
|
+
const nextManaged = removeAgentBlock(managedContent, resolvedAgent);
|
|
2873
|
+
if (!hasAnyAgentBlocks(nextManaged)) {
|
|
2874
|
+
try {
|
|
2875
|
+
await fs5.unlink(managedEnvrcPath);
|
|
2876
|
+
} catch {
|
|
2877
|
+
}
|
|
2878
|
+
try {
|
|
2879
|
+
const envrcContent = await fs5.readFile(envrcPath, "utf-8");
|
|
2880
|
+
const withoutBootstrap = removeBootstrapBlock(envrcContent);
|
|
2881
|
+
if (isEffectivelyEmpty(withoutBootstrap)) {
|
|
2882
|
+
await fs5.unlink(envrcPath);
|
|
2883
|
+
} else {
|
|
2884
|
+
await fs5.writeFile(envrcPath, withoutBootstrap + "\n");
|
|
2885
|
+
}
|
|
2886
|
+
} catch {
|
|
2887
|
+
}
|
|
2888
|
+
} else {
|
|
2889
|
+
await fs5.writeFile(managedEnvrcPath, nextManaged);
|
|
2890
|
+
}
|
|
2891
|
+
if (options?.allow) {
|
|
2892
|
+
try {
|
|
2893
|
+
await runDirenvAllow2();
|
|
2894
|
+
Se(`Unset ${resolvedAgent} profile (direnv allowed).`);
|
|
2895
|
+
} catch (error) {
|
|
2896
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
2897
|
+
console.error(import_picocolors8.default.red(message));
|
|
2898
|
+
process.exit(1);
|
|
2899
|
+
}
|
|
2900
|
+
} else {
|
|
2901
|
+
Se(`Unset ${resolvedAgent} profile.`);
|
|
2902
|
+
console.log(import_picocolors8.default.dim("Run 'direnv allow' to apply changes."));
|
|
2903
|
+
}
|
|
2904
|
+
}
|
|
2905
|
+
var import_picocolors8, unset_default;
|
|
2906
|
+
var init_unset = __esm({
|
|
2907
|
+
"src/commands/unset.ts"() {
|
|
2908
|
+
"use strict";
|
|
2909
|
+
init_esm_shims();
|
|
2910
|
+
init_dist();
|
|
2911
|
+
init_dist3();
|
|
2912
|
+
init_types();
|
|
2913
|
+
import_picocolors8 = __toESM(require_picocolors(), 1);
|
|
2914
|
+
init_envrc();
|
|
2915
|
+
init_prompts();
|
|
2916
|
+
unset_default = defineCommand({
|
|
2917
|
+
meta: {
|
|
2918
|
+
name: "unset",
|
|
2919
|
+
description: "Unset the active profile for the current directory"
|
|
2920
|
+
},
|
|
2921
|
+
args: {
|
|
2922
|
+
agent: {
|
|
2923
|
+
type: "positional",
|
|
2924
|
+
description: "Agent name",
|
|
2925
|
+
required: false
|
|
2926
|
+
},
|
|
2927
|
+
allow: {
|
|
2928
|
+
type: "boolean",
|
|
2929
|
+
alias: "y",
|
|
2930
|
+
description: "Run direnv allow after updating files"
|
|
2931
|
+
}
|
|
2932
|
+
},
|
|
2933
|
+
async run({ args: args2 }) {
|
|
2934
|
+
await unsetCommand(args2.agent, { allow: args2.allow });
|
|
2935
|
+
}
|
|
2936
|
+
});
|
|
2937
|
+
}
|
|
2938
|
+
});
|
|
2939
|
+
|
|
2940
|
+
// src/commands/edit.ts
|
|
2941
|
+
var edit_exports = {};
|
|
2942
|
+
__export(edit_exports, {
|
|
2943
|
+
default: () => edit_default,
|
|
2944
|
+
editCommand: () => editCommand
|
|
2945
|
+
});
|
|
2946
|
+
import { spawn as spawn3 } from "child_process";
|
|
2947
|
+
import path7 from "path";
|
|
2948
|
+
async function editCommand(agent, name) {
|
|
2949
|
+
const resolvedAgent = agent ?? await promptForAgent("Select agent:");
|
|
2950
|
+
if (!SUPPORTED_TOOLS[resolvedAgent]) {
|
|
2951
|
+
console.error(import_picocolors9.default.red(`Unsupported agent: ${resolvedAgent}`));
|
|
2952
|
+
process.exit(1);
|
|
2953
|
+
}
|
|
2954
|
+
const config = new ConfigManager();
|
|
2955
|
+
await config.init();
|
|
2956
|
+
let resolvedName;
|
|
2957
|
+
if (name) {
|
|
2958
|
+
resolvedName = name;
|
|
2959
|
+
} else {
|
|
2960
|
+
const selected = await promptForProfile(config, resolvedAgent, "Select profile to edit:");
|
|
2961
|
+
if (!selected) {
|
|
2962
|
+
Me(
|
|
2963
|
+
`No profiles found for ${resolvedAgent}. Create one first with: agentprofiles add ${resolvedAgent}`,
|
|
2964
|
+
"No Profiles"
|
|
2965
|
+
);
|
|
2966
|
+
process.exit(0);
|
|
2967
|
+
}
|
|
2968
|
+
resolvedName = selected;
|
|
2969
|
+
}
|
|
2970
|
+
const profileDir = path7.join(config.getContentDir(), resolvedAgent, resolvedName);
|
|
2971
|
+
const editor = process.env.EDITOR;
|
|
2972
|
+
if (editor) {
|
|
2973
|
+
const child2 = spawn3(editor, [profileDir], { stdio: "inherit" });
|
|
2974
|
+
child2.on("exit", () => {
|
|
2975
|
+
Se("Editor closed");
|
|
2976
|
+
});
|
|
2977
|
+
return;
|
|
2978
|
+
}
|
|
2979
|
+
const platform = process.platform;
|
|
2980
|
+
const openCommand = platform === "darwin" ? "open" : platform === "linux" ? "xdg-open" : null;
|
|
2981
|
+
if (!openCommand) {
|
|
2982
|
+
console.log(profileDir);
|
|
2983
|
+
return;
|
|
2984
|
+
}
|
|
2985
|
+
const child = spawn3(openCommand, [profileDir], { stdio: "inherit" });
|
|
2986
|
+
child.on("error", () => {
|
|
2987
|
+
console.log(profileDir);
|
|
2988
|
+
});
|
|
2989
|
+
}
|
|
2990
|
+
var import_picocolors9, edit_default;
|
|
2991
|
+
var init_edit = __esm({
|
|
2992
|
+
"src/commands/edit.ts"() {
|
|
2993
|
+
"use strict";
|
|
2994
|
+
init_esm_shims();
|
|
2995
|
+
init_dist();
|
|
2996
|
+
init_dist3();
|
|
2997
|
+
init_config();
|
|
2998
|
+
init_types();
|
|
2999
|
+
import_picocolors9 = __toESM(require_picocolors(), 1);
|
|
3000
|
+
init_prompts();
|
|
3001
|
+
edit_default = defineCommand({
|
|
3002
|
+
meta: {
|
|
3003
|
+
name: "edit",
|
|
3004
|
+
description: "Edit a profile configuration"
|
|
3005
|
+
},
|
|
3006
|
+
args: {
|
|
3007
|
+
agent: {
|
|
3008
|
+
type: "positional",
|
|
3009
|
+
description: "Agent name",
|
|
3010
|
+
required: false
|
|
3011
|
+
},
|
|
3012
|
+
name: {
|
|
3013
|
+
type: "positional",
|
|
3014
|
+
description: "Profile name",
|
|
3015
|
+
required: false
|
|
3016
|
+
}
|
|
3017
|
+
},
|
|
3018
|
+
async run({ args: args2 }) {
|
|
3019
|
+
await editCommand(args2.agent, args2.name);
|
|
3020
|
+
}
|
|
3021
|
+
});
|
|
3022
|
+
}
|
|
3023
|
+
});
|
|
3024
|
+
|
|
3025
|
+
// src/commands/remove.ts
|
|
3026
|
+
var remove_exports = {};
|
|
3027
|
+
__export(remove_exports, {
|
|
3028
|
+
default: () => remove_default,
|
|
3029
|
+
removeCommand: () => removeCommand
|
|
3030
|
+
});
|
|
3031
|
+
import fs6 from "fs/promises";
|
|
3032
|
+
import path8 from "path";
|
|
3033
|
+
async function removeCommand(agent, name) {
|
|
3034
|
+
const resolvedAgent = agent ?? await promptForAgent("Select agent:");
|
|
3035
|
+
if (!SUPPORTED_TOOLS[resolvedAgent]) {
|
|
3036
|
+
console.error(import_picocolors10.default.red(`Unsupported agent: ${resolvedAgent}`));
|
|
3037
|
+
process.exit(1);
|
|
3038
|
+
}
|
|
3039
|
+
const config = new ConfigManager();
|
|
3040
|
+
await config.init();
|
|
3041
|
+
const profiles = await config.getProfiles(resolvedAgent);
|
|
3042
|
+
if (profiles.length === 0) {
|
|
3043
|
+
Me(`No profiles found for ${resolvedAgent}. Nothing to remove.`, "No Profiles");
|
|
3044
|
+
process.exit(0);
|
|
3045
|
+
}
|
|
3046
|
+
let resolvedName;
|
|
3047
|
+
if (name) {
|
|
3048
|
+
resolvedName = name;
|
|
3049
|
+
} else {
|
|
3050
|
+
const selected = await promptForProfile(config, resolvedAgent, "Select a profile to remove:");
|
|
3051
|
+
if (!selected) {
|
|
3052
|
+
Me(`No profiles found for ${resolvedAgent}.`, "No Profiles");
|
|
3053
|
+
process.exit(0);
|
|
3054
|
+
}
|
|
3055
|
+
resolvedName = selected;
|
|
3056
|
+
}
|
|
3057
|
+
const profileDir = path8.join(config.getContentDir(), resolvedAgent, resolvedName);
|
|
3058
|
+
try {
|
|
3059
|
+
await fs6.access(profileDir);
|
|
3060
|
+
} catch {
|
|
3061
|
+
console.error(import_picocolors10.default.red(`Profile '${resolvedName}' not found for agent '${resolvedAgent}'`));
|
|
3062
|
+
process.exit(1);
|
|
3063
|
+
}
|
|
3064
|
+
const shouldDelete = await ye({
|
|
3065
|
+
message: `Are you sure you want to delete the profile ${import_picocolors10.default.cyan(resolvedName)}? This cannot be undone.`,
|
|
3066
|
+
initialValue: false
|
|
3067
|
+
});
|
|
3068
|
+
if (pD(shouldDelete) || !shouldDelete) {
|
|
3069
|
+
xe("Operation cancelled.");
|
|
3070
|
+
process.exit(0);
|
|
3071
|
+
}
|
|
3072
|
+
const cwd = process.cwd();
|
|
3073
|
+
const envrcPath = path8.join(cwd, ".envrc");
|
|
3074
|
+
const managedEnvrcPath = path8.join(cwd, MANAGED_ENVRC_FILENAME);
|
|
3075
|
+
try {
|
|
3076
|
+
const managedContent = await fs6.readFile(managedEnvrcPath, "utf-8");
|
|
3077
|
+
const activeProfile = getActiveProfile(managedContent, resolvedAgent);
|
|
3078
|
+
if (activeProfile === resolvedName) {
|
|
3079
|
+
const nextManaged = removeAgentBlock(managedContent, resolvedAgent);
|
|
3080
|
+
if (!hasAnyAgentBlocks(nextManaged)) {
|
|
3081
|
+
await fs6.unlink(managedEnvrcPath);
|
|
3082
|
+
try {
|
|
3083
|
+
const envrcContent = await fs6.readFile(envrcPath, "utf-8");
|
|
3084
|
+
const withoutBootstrap = removeBootstrapBlock(envrcContent);
|
|
3085
|
+
if (isEffectivelyEmpty(withoutBootstrap)) {
|
|
3086
|
+
await fs6.unlink(envrcPath);
|
|
3087
|
+
} else {
|
|
3088
|
+
await fs6.writeFile(envrcPath, withoutBootstrap + "\n");
|
|
3089
|
+
}
|
|
3090
|
+
} catch {
|
|
3091
|
+
}
|
|
3092
|
+
} else {
|
|
3093
|
+
await fs6.writeFile(managedEnvrcPath, nextManaged);
|
|
3094
|
+
}
|
|
3095
|
+
Me(
|
|
3096
|
+
`Profile was active in this directory. Unset automatically.
|
|
3097
|
+
Run 'direnv allow' to apply changes.`,
|
|
3098
|
+
"Auto-unset"
|
|
3099
|
+
);
|
|
3100
|
+
}
|
|
3101
|
+
} catch {
|
|
3102
|
+
}
|
|
3103
|
+
await fs6.rm(profileDir, { recursive: true, force: true });
|
|
3104
|
+
Se(`Deleted profile ${import_picocolors10.default.cyan(resolvedName)} for ${resolvedAgent}.`);
|
|
3105
|
+
}
|
|
3106
|
+
var import_picocolors10, remove_default;
|
|
3107
|
+
var init_remove = __esm({
|
|
3108
|
+
"src/commands/remove.ts"() {
|
|
3109
|
+
"use strict";
|
|
3110
|
+
init_esm_shims();
|
|
3111
|
+
init_dist();
|
|
3112
|
+
init_dist3();
|
|
3113
|
+
init_config();
|
|
3114
|
+
init_types();
|
|
3115
|
+
import_picocolors10 = __toESM(require_picocolors(), 1);
|
|
3116
|
+
init_prompts();
|
|
3117
|
+
init_envrc();
|
|
3118
|
+
remove_default = defineCommand({
|
|
3119
|
+
meta: {
|
|
3120
|
+
name: "remove",
|
|
3121
|
+
description: "Remove a profile (alias: rm)"
|
|
3122
|
+
},
|
|
3123
|
+
args: {
|
|
3124
|
+
agent: {
|
|
3125
|
+
type: "positional",
|
|
3126
|
+
description: "Agent name (claude/opencode)",
|
|
3127
|
+
required: false
|
|
3128
|
+
},
|
|
3129
|
+
name: {
|
|
3130
|
+
type: "positional",
|
|
3131
|
+
description: "Profile name",
|
|
3132
|
+
required: false
|
|
3133
|
+
}
|
|
3134
|
+
},
|
|
3135
|
+
async run({ args: args2 }) {
|
|
3136
|
+
await removeCommand(args2.agent, args2.name);
|
|
3137
|
+
}
|
|
3138
|
+
});
|
|
3139
|
+
}
|
|
3140
|
+
});
|
|
3141
|
+
|
|
3142
|
+
// src/lib/main-menu.ts
|
|
3143
|
+
var main_menu_exports = {};
|
|
3144
|
+
__export(main_menu_exports, {
|
|
3145
|
+
showMainMenu: () => showMainMenu
|
|
3146
|
+
});
|
|
3147
|
+
async function showMainMenu() {
|
|
3148
|
+
const response = await ve({
|
|
3149
|
+
message: "What would you like to do?",
|
|
3150
|
+
options: menuOptions
|
|
3151
|
+
});
|
|
3152
|
+
if (pD(response)) {
|
|
3153
|
+
xe("Goodbye!");
|
|
3154
|
+
process.exit(0);
|
|
3155
|
+
}
|
|
3156
|
+
const action = response;
|
|
3157
|
+
switch (action) {
|
|
3158
|
+
case "list": {
|
|
3159
|
+
const { listCommand: listCommand2 } = await Promise.resolve().then(() => (init_list(), list_exports));
|
|
3160
|
+
await listCommand2();
|
|
3161
|
+
break;
|
|
3162
|
+
}
|
|
3163
|
+
case "add": {
|
|
3164
|
+
const { addCommand: addCommand2 } = await Promise.resolve().then(() => (init_add(), add_exports));
|
|
3165
|
+
await addCommand2();
|
|
3166
|
+
break;
|
|
3167
|
+
}
|
|
3168
|
+
case "set": {
|
|
3169
|
+
const { setCommand: setCommand2 } = await Promise.resolve().then(() => (init_set(), set_exports));
|
|
3170
|
+
await setCommand2();
|
|
3171
|
+
break;
|
|
3172
|
+
}
|
|
3173
|
+
case "unset": {
|
|
3174
|
+
const { unsetCommand: unsetCommand2 } = await Promise.resolve().then(() => (init_unset(), unset_exports));
|
|
3175
|
+
await unsetCommand2();
|
|
3176
|
+
break;
|
|
3177
|
+
}
|
|
3178
|
+
case "edit": {
|
|
3179
|
+
const { editCommand: editCommand2 } = await Promise.resolve().then(() => (init_edit(), edit_exports));
|
|
3180
|
+
await editCommand2();
|
|
3181
|
+
break;
|
|
3182
|
+
}
|
|
3183
|
+
case "remove": {
|
|
3184
|
+
const { removeCommand: removeCommand2 } = await Promise.resolve().then(() => (init_remove(), remove_exports));
|
|
3185
|
+
await removeCommand2();
|
|
3186
|
+
break;
|
|
3187
|
+
}
|
|
3188
|
+
}
|
|
3189
|
+
}
|
|
3190
|
+
var menuOptions;
|
|
3191
|
+
var init_main_menu = __esm({
|
|
3192
|
+
"src/lib/main-menu.ts"() {
|
|
3193
|
+
"use strict";
|
|
3194
|
+
init_esm_shims();
|
|
3195
|
+
init_dist3();
|
|
3196
|
+
menuOptions = [
|
|
3197
|
+
{ value: "list", label: "List profiles", hint: "Show all profiles" },
|
|
3198
|
+
{ value: "add", label: "Add profile", hint: "Create a new profile" },
|
|
3199
|
+
{ value: "set", label: "Set profile", hint: "Activate a profile for this directory" },
|
|
3200
|
+
{ value: "unset", label: "Unset profile", hint: "Deactivate a profile for this directory" },
|
|
3201
|
+
{ value: "edit", label: "Edit profile", hint: "Open a profile in your editor" },
|
|
3202
|
+
{ value: "remove", label: "Remove profile", hint: "Delete a profile" }
|
|
3203
|
+
];
|
|
3204
|
+
}
|
|
3205
|
+
});
|
|
3206
|
+
|
|
3207
|
+
// src/commands/setup.ts
|
|
3208
|
+
var setup_exports = {};
|
|
3209
|
+
__export(setup_exports, {
|
|
3210
|
+
default: () => setup_default,
|
|
3211
|
+
setupCommand: () => setupCommand
|
|
3212
|
+
});
|
|
3213
|
+
async function setupCommand() {
|
|
3214
|
+
await runOnboarding({ isRerun: true });
|
|
3215
|
+
}
|
|
3216
|
+
var setup_default;
|
|
3217
|
+
var init_setup = __esm({
|
|
3218
|
+
"src/commands/setup.ts"() {
|
|
3219
|
+
"use strict";
|
|
3220
|
+
init_esm_shims();
|
|
3221
|
+
init_dist();
|
|
3222
|
+
init_onboarding();
|
|
3223
|
+
setup_default = defineCommand({
|
|
3224
|
+
meta: {
|
|
3225
|
+
name: "setup",
|
|
3226
|
+
description: "Initialize the agentprofiles system (alias: init)"
|
|
3227
|
+
},
|
|
3228
|
+
async run() {
|
|
3229
|
+
await setupCommand();
|
|
3230
|
+
}
|
|
3231
|
+
});
|
|
3232
|
+
}
|
|
3233
|
+
});
|
|
3234
|
+
|
|
3235
|
+
// src/commands/init.ts
|
|
3236
|
+
var init_exports = {};
|
|
3237
|
+
__export(init_exports, {
|
|
3238
|
+
default: () => init_default
|
|
3239
|
+
});
|
|
3240
|
+
var init_default;
|
|
3241
|
+
var init_init = __esm({
|
|
3242
|
+
"src/commands/init.ts"() {
|
|
3243
|
+
"use strict";
|
|
3244
|
+
init_esm_shims();
|
|
3245
|
+
init_dist();
|
|
3246
|
+
init_setup();
|
|
3247
|
+
init_default = defineCommand({
|
|
3248
|
+
meta: {
|
|
3249
|
+
name: "init",
|
|
3250
|
+
hidden: true
|
|
3251
|
+
},
|
|
3252
|
+
async run() {
|
|
3253
|
+
await setupCommand();
|
|
3254
|
+
}
|
|
3255
|
+
});
|
|
3256
|
+
}
|
|
3257
|
+
});
|
|
3258
|
+
|
|
3259
|
+
// src/commands/create.ts
|
|
3260
|
+
var create_exports = {};
|
|
3261
|
+
__export(create_exports, {
|
|
3262
|
+
default: () => create_default
|
|
3263
|
+
});
|
|
3264
|
+
var create_default;
|
|
3265
|
+
var init_create = __esm({
|
|
3266
|
+
"src/commands/create.ts"() {
|
|
3267
|
+
"use strict";
|
|
3268
|
+
init_esm_shims();
|
|
3269
|
+
init_dist();
|
|
3270
|
+
init_add();
|
|
3271
|
+
create_default = defineCommand({
|
|
3272
|
+
meta: {
|
|
3273
|
+
name: "create",
|
|
3274
|
+
description: "Create a new profile (alias for add)",
|
|
3275
|
+
hidden: true
|
|
3276
|
+
},
|
|
3277
|
+
args: {
|
|
3278
|
+
agent: {
|
|
3279
|
+
type: "positional",
|
|
3280
|
+
description: "Agent name (claude/opencode)",
|
|
3281
|
+
required: false
|
|
3282
|
+
},
|
|
3283
|
+
name: {
|
|
3284
|
+
type: "positional",
|
|
3285
|
+
description: "Profile name",
|
|
3286
|
+
required: false
|
|
3287
|
+
}
|
|
3288
|
+
},
|
|
3289
|
+
async run({ args: args2 }) {
|
|
3290
|
+
await addCommand(args2.agent, args2.name);
|
|
3291
|
+
}
|
|
3292
|
+
});
|
|
3293
|
+
}
|
|
3294
|
+
});
|
|
3295
|
+
|
|
3296
|
+
// src/commands/rm.ts
|
|
3297
|
+
var rm_exports = {};
|
|
3298
|
+
__export(rm_exports, {
|
|
3299
|
+
default: () => rm_default
|
|
3300
|
+
});
|
|
3301
|
+
var rm_default;
|
|
3302
|
+
var init_rm = __esm({
|
|
3303
|
+
"src/commands/rm.ts"() {
|
|
3304
|
+
"use strict";
|
|
3305
|
+
init_esm_shims();
|
|
3306
|
+
init_dist();
|
|
3307
|
+
init_remove();
|
|
3308
|
+
rm_default = defineCommand({
|
|
3309
|
+
meta: {
|
|
3310
|
+
name: "rm",
|
|
3311
|
+
hidden: true
|
|
3312
|
+
},
|
|
3313
|
+
args: {
|
|
3314
|
+
agent: {
|
|
3315
|
+
type: "positional",
|
|
3316
|
+
description: "Agent name (claude/opencode)",
|
|
3317
|
+
required: true
|
|
3318
|
+
},
|
|
3319
|
+
name: {
|
|
3320
|
+
type: "positional",
|
|
3321
|
+
description: "Profile name",
|
|
3322
|
+
required: false
|
|
3323
|
+
}
|
|
3324
|
+
},
|
|
3325
|
+
async run({ args: args2 }) {
|
|
3326
|
+
await removeCommand(args2.agent, args2.name);
|
|
3327
|
+
}
|
|
3328
|
+
});
|
|
3329
|
+
}
|
|
3330
|
+
});
|
|
3331
|
+
|
|
3332
|
+
// src/index.ts
|
|
3333
|
+
init_esm_shims();
|
|
3334
|
+
init_dist();
|
|
3335
|
+
import { createRequire } from "module";
|
|
3336
|
+
|
|
3337
|
+
// src/lib/banner.ts
|
|
3338
|
+
init_esm_shims();
|
|
3339
|
+
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
3340
|
+
var isDev = true ? false : true;
|
|
3341
|
+
var buildTime = true ? "" : "";
|
|
3342
|
+
var gitSha = true ? "" : "";
|
|
3343
|
+
var BANNER = "\n\x1B[94m \x1B[39m\x1B[91m\u2584\u2580\u2588\x1B[39m\x1B[31m \x1B[39m\x1B[91m\u2588\u2580\u2580\x1B[39m\x1B[36m \x1B[39m\x1B[35m\u2588\u2580\u2580\x1B[39m\x1B[36m \x1B[39m\x1B[91m\u2588\u2584 \u2588\x1B[39m\x1B[36m \x1B[39m\x1B[31m\u2580\u2588\u2580\x1B[39m\x1B[33m \x1B[39m\x1B[32m\u2588\u2580\u2588\x1B[39m\x1B[95m \x1B[39m\x1B[94m\u2588\u2580\u2588\x1B[39m\x1B[33m \x1B[39m\x1B[31m\u2588\u2580\u2588\x1B[39m\x1B[95m \x1B[39m\x1B[36m\u2588\u2580\u2580\x1B[39m\x1B[91m \x1B[39m\x1B[31m\u2588\x1B[39m\x1B[91m \x1B[39m\x1B[36m\u2588 \x1B[39m\x1B[35m \x1B[39m\x1B[96m\u2588\u2580\u2580\x1B[39m\n\x1B[31m \x1B[39m\x1B[94m\u2588\u2580\u2588\x1B[39m\x1B[95m \x1B[39m\x1B[93m\u2588\u2584\u2588\x1B[39m\x1B[32m \x1B[39m\x1B[36m\u2588\u2588\u2584\x1B[39m\x1B[94m \x1B[39m\x1B[32m\u2588 \u2580\u2588\x1B[39m\x1B[95m \x1B[39m\x1B[92m \u2588 \x1B[39m\x1B[31m \x1B[39m\x1B[93m\u2588\u2580\u2580\x1B[39m\x1B[94m \x1B[39m\x1B[33m\u2588\u2580\u2584\x1B[39m\x1B[33m \x1B[39m\x1B[31m\u2588\u2584\u2588\x1B[39m\x1B[92m \x1B[39m\x1B[36m\u2588\u2580 \x1B[39m\x1B[93m \x1B[39m\x1B[31m\u2588\x1B[39m\x1B[93m \x1B[39m\x1B[94m\u2588\u2584\u2584\x1B[39m\x1B[94m \x1B[39m\x1B[92m\u2588\u2588\u2584\x1B[39m\n";
|
|
3344
|
+
function renderBanner() {
|
|
3345
|
+
console.log(BANNER);
|
|
3346
|
+
}
|
|
3347
|
+
function renderInfo(pkg2) {
|
|
3348
|
+
const devMetaParts = [];
|
|
3349
|
+
if (gitSha) devMetaParts.push(gitSha);
|
|
3350
|
+
if (buildTime) devMetaParts.push(`@ ${buildTime}`);
|
|
3351
|
+
const devLabel = devMetaParts.length > 0 ? `dev ${devMetaParts.join(" ")}` : "dev";
|
|
3352
|
+
const devTag = isDev ? import_picocolors.default.yellow(` (${devLabel})`) : "";
|
|
3353
|
+
const info = `${import_picocolors.default.dim(pkg2.name)} ${import_picocolors.default.cyan(`v${pkg2.version}`)}${devTag}`;
|
|
3354
|
+
const desc = pkg2.description ? import_picocolors.default.dim(` \u2014 ${pkg2.description}`) : "";
|
|
3355
|
+
console.log(`${info}${desc}
|
|
3356
|
+
`);
|
|
3357
|
+
}
|
|
3358
|
+
|
|
3359
|
+
// src/lib/update.ts
|
|
3360
|
+
init_esm_shims();
|
|
3361
|
+
import { execSync } from "child_process";
|
|
3362
|
+
import fs from "fs";
|
|
3363
|
+
function getInstallLocation(binName) {
|
|
3364
|
+
try {
|
|
3365
|
+
const whichResult = execSync(`which ${binName}`, { encoding: "utf-8" }).trim();
|
|
3366
|
+
return fs.realpathSync(whichResult);
|
|
3367
|
+
} catch {
|
|
3368
|
+
return null;
|
|
3369
|
+
}
|
|
3370
|
+
}
|
|
3371
|
+
function detectPackageManager(installPath, pkgName) {
|
|
3372
|
+
if (!installPath) {
|
|
3373
|
+
return { manager: "unknown", updateCommand: `npm i -g ${pkgName}` };
|
|
3374
|
+
}
|
|
3375
|
+
const path9 = installPath.toLowerCase();
|
|
3376
|
+
if (path9.includes("pnpm/global") || path9.includes(".local/share/pnpm")) {
|
|
3377
|
+
return { manager: "pnpm", updateCommand: `pnpm add -g ${pkgName}` };
|
|
3378
|
+
}
|
|
3379
|
+
if (path9.includes("yarn/global") || path9.includes(".yarn")) {
|
|
3380
|
+
return { manager: "yarn", updateCommand: `yarn global add ${pkgName}` };
|
|
3381
|
+
}
|
|
3382
|
+
if (path9.includes(".volta/")) {
|
|
3383
|
+
return { manager: "volta", updateCommand: `volta install ${pkgName}` };
|
|
3384
|
+
}
|
|
3385
|
+
return { manager: "npm", updateCommand: `npm i -g ${pkgName}` };
|
|
3386
|
+
}
|
|
3387
|
+
async function checkForUpdates(pkg2) {
|
|
3388
|
+
const { default: updateNotifier } = await import("update-notifier");
|
|
3389
|
+
const installPath = getInstallLocation("agentprofiles");
|
|
3390
|
+
const { updateCommand } = detectPackageManager(installPath, pkg2.name);
|
|
3391
|
+
const notifier = updateNotifier({
|
|
3392
|
+
pkg: pkg2,
|
|
3393
|
+
updateCheckInterval: 1e3 * 60 * 60 * 24
|
|
3394
|
+
});
|
|
3395
|
+
notifier.notify({
|
|
3396
|
+
message: `Update available {currentVersion} \u2192 {latestVersion}
|
|
3397
|
+
Run ${updateCommand} to update`,
|
|
3398
|
+
defer: true
|
|
3399
|
+
});
|
|
3400
|
+
}
|
|
3401
|
+
|
|
3402
|
+
// src/index.ts
|
|
3403
|
+
var require2 = createRequire(import.meta.url);
|
|
3404
|
+
var pkg = require2("../package.json");
|
|
3405
|
+
var isQuiet = process.argv.includes("--quiet") || process.argv.includes("-q");
|
|
3406
|
+
if (!isQuiet) {
|
|
3407
|
+
renderBanner();
|
|
3408
|
+
renderInfo(pkg);
|
|
3409
|
+
}
|
|
3410
|
+
checkForUpdates(pkg).catch(() => {
|
|
3411
|
+
});
|
|
3412
|
+
var knownSubcommands = [
|
|
3413
|
+
"setup",
|
|
3414
|
+
"init",
|
|
3415
|
+
"list",
|
|
3416
|
+
"add",
|
|
3417
|
+
"create",
|
|
3418
|
+
"edit",
|
|
3419
|
+
"remove",
|
|
3420
|
+
"rm",
|
|
3421
|
+
"set",
|
|
3422
|
+
"unset"
|
|
3423
|
+
];
|
|
3424
|
+
var args = process.argv.slice(2);
|
|
3425
|
+
var hasSubcommand = args.some(
|
|
3426
|
+
(arg) => knownSubcommands.includes(arg) || arg === "--help" || arg === "-h"
|
|
3427
|
+
);
|
|
3428
|
+
var isHelpOrVersion = args.some(
|
|
3429
|
+
(arg) => arg === "--help" || arg === "-h" || arg === "--version" || arg === "-V"
|
|
3430
|
+
);
|
|
3431
|
+
var isInitCommand = args.some((arg) => arg === "init" || arg === "setup");
|
|
3432
|
+
if (!isInitCommand && !isHelpOrVersion) {
|
|
3433
|
+
const { ensureInitialized: ensureInitialized2 } = await Promise.resolve().then(() => (init_onboarding(), onboarding_exports));
|
|
3434
|
+
await ensureInitialized2();
|
|
3435
|
+
}
|
|
3436
|
+
if (!hasSubcommand && !isHelpOrVersion) {
|
|
3437
|
+
const { showMainMenu: showMainMenu2 } = await Promise.resolve().then(() => (init_main_menu(), main_menu_exports));
|
|
3438
|
+
await showMainMenu2();
|
|
3439
|
+
} else {
|
|
3440
|
+
const main = defineCommand({
|
|
3441
|
+
meta: {
|
|
3442
|
+
name: "agentprofiles",
|
|
3443
|
+
version: pkg.version,
|
|
3444
|
+
description: pkg.description
|
|
3445
|
+
},
|
|
3446
|
+
subCommands: {
|
|
3447
|
+
setup: () => Promise.resolve().then(() => (init_setup(), setup_exports)).then((m2) => m2.default),
|
|
3448
|
+
init: () => Promise.resolve().then(() => (init_init(), init_exports)).then((m2) => m2.default),
|
|
3449
|
+
list: () => Promise.resolve().then(() => (init_list(), list_exports)).then((m2) => m2.default),
|
|
3450
|
+
add: () => Promise.resolve().then(() => (init_add(), add_exports)).then((m2) => m2.default),
|
|
3451
|
+
create: () => Promise.resolve().then(() => (init_create(), create_exports)).then((m2) => m2.default),
|
|
3452
|
+
edit: () => Promise.resolve().then(() => (init_edit(), edit_exports)).then((m2) => m2.default),
|
|
3453
|
+
remove: () => Promise.resolve().then(() => (init_remove(), remove_exports)).then((m2) => m2.default),
|
|
3454
|
+
rm: () => Promise.resolve().then(() => (init_rm(), rm_exports)).then((m2) => m2.default),
|
|
3455
|
+
set: () => Promise.resolve().then(() => (init_set(), set_exports)).then((m2) => m2.default),
|
|
3456
|
+
unset: () => Promise.resolve().then(() => (init_unset(), unset_exports)).then((m2) => m2.default)
|
|
3457
|
+
}
|
|
3458
|
+
});
|
|
3459
|
+
runMain(main);
|
|
3460
|
+
}
|
|
3461
|
+
//# sourceMappingURL=index.js.map
|