@alexgorbatchev/shadcn 0.0.37 → 0.0.41
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 +34 -0
- package/THIRD_PARTY_NOTICES.md +4 -0
- package/dist/{chunk-6grcm62s.js → chunk-1hj251b8.js} +1 -1
- package/dist/{chunk-r9qrb6b6.js → chunk-5bw5h08v.js} +1 -1
- package/dist/{chunk-kmvvw1vr.js → chunk-sb00e3gj.js} +1 -1
- package/dist/{chunk-f71469fs.js → chunk-v0va5w5c.js} +1 -1
- package/dist/components/data-grid/index.js +2 -2
- package/dist/components/gantt/index.js +2 -2
- package/dist/components/json-render/index.js +3 -3
- package/dist/components/virtual-data-grid/index.js +2 -2
- package/dist/index.js +3 -3
- package/dist/prototype.js +3665 -0
- package/dist/theme.css +20 -0
- package/licenses/commander-MIT.txt +22 -0
- package/llms/components/forms/NativeSelect.md +8 -0
- package/llms/setup.md +34 -0
- package/package.json +9 -3
- package/templates/prototype/AGENTS.md +23 -0
- package/templates/prototype/gitignore +5 -0
- package/templates/prototype/index.html +12 -0
- package/templates/prototype/justfile +18 -0
- package/templates/prototype/src/components/ScenarioContent.tsx +41 -0
- package/templates/prototype/src/components/Workbench.tsx +132 -0
- package/templates/prototype/src/main.tsx +12 -0
- package/templates/prototype/src/prototypes/dashboard/components/Dashboard.tsx +80 -0
- package/templates/prototype/src/prototypes/dashboard/data.ts +5 -0
- package/templates/prototype/src/prototypes/dashboard/prototype.ts +9 -0
- package/templates/prototype/src/prototypes/projects/components/Projects.tsx +151 -0
- package/templates/prototype/src/prototypes/projects/data.ts +5 -0
- package/templates/prototype/src/prototypes/projects/prototype.ts +9 -0
- package/templates/prototype/src/prototypes/settings/components/Settings.tsx +72 -0
- package/templates/prototype/src/prototypes/settings/prototype.ts +9 -0
- package/templates/prototype/src/styles.css +7 -0
- package/templates/prototype/src/types.ts +9 -0
- package/templates/prototype/tsconfig.json +13 -0
- package/templates/prototype/vite.config.ts +8 -0
|
@@ -0,0 +1,3665 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// @bun
|
|
3
|
+
|
|
4
|
+
// cli/main.ts
|
|
5
|
+
import { homedir as homedir2 } from "os";
|
|
6
|
+
import { resolve as resolve3 } from "path";
|
|
7
|
+
|
|
8
|
+
// node_modules/commander/lib/error.js
|
|
9
|
+
class CommanderError extends Error {
|
|
10
|
+
constructor(exitCode, code, message) {
|
|
11
|
+
super(message);
|
|
12
|
+
Error.captureStackTrace(this, this.constructor);
|
|
13
|
+
this.name = this.constructor.name;
|
|
14
|
+
this.code = code;
|
|
15
|
+
this.exitCode = exitCode;
|
|
16
|
+
this.nestedError = undefined;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
class InvalidArgumentError extends CommanderError {
|
|
21
|
+
constructor(message) {
|
|
22
|
+
super(1, "commander.invalidArgument", message);
|
|
23
|
+
Error.captureStackTrace(this, this.constructor);
|
|
24
|
+
this.name = this.constructor.name;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// node_modules/commander/lib/argument.js
|
|
29
|
+
class Argument {
|
|
30
|
+
constructor(name, description) {
|
|
31
|
+
this.description = description || "";
|
|
32
|
+
this.variadic = false;
|
|
33
|
+
this.parseArg = undefined;
|
|
34
|
+
this.defaultValue = undefined;
|
|
35
|
+
this.defaultValueDescription = undefined;
|
|
36
|
+
this.argChoices = undefined;
|
|
37
|
+
switch (name[0]) {
|
|
38
|
+
case "<":
|
|
39
|
+
this.required = true;
|
|
40
|
+
this._name = name.slice(1, -1);
|
|
41
|
+
break;
|
|
42
|
+
case "[":
|
|
43
|
+
this.required = false;
|
|
44
|
+
this._name = name.slice(1, -1);
|
|
45
|
+
break;
|
|
46
|
+
default:
|
|
47
|
+
this.required = true;
|
|
48
|
+
this._name = name;
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
if (this._name.endsWith("...")) {
|
|
52
|
+
this.variadic = true;
|
|
53
|
+
this._name = this._name.slice(0, -3);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
name() {
|
|
57
|
+
return this._name;
|
|
58
|
+
}
|
|
59
|
+
_collectValue(value, previous) {
|
|
60
|
+
if (previous === this.defaultValue || !Array.isArray(previous)) {
|
|
61
|
+
return [value];
|
|
62
|
+
}
|
|
63
|
+
previous.push(value);
|
|
64
|
+
return previous;
|
|
65
|
+
}
|
|
66
|
+
default(value, description) {
|
|
67
|
+
this.defaultValue = value;
|
|
68
|
+
this.defaultValueDescription = description;
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
argParser(fn) {
|
|
72
|
+
this.parseArg = fn;
|
|
73
|
+
return this;
|
|
74
|
+
}
|
|
75
|
+
choices(values) {
|
|
76
|
+
this.argChoices = values.slice();
|
|
77
|
+
this.parseArg = (arg, previous) => {
|
|
78
|
+
if (!this.argChoices.includes(arg)) {
|
|
79
|
+
throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(", ")}.`);
|
|
80
|
+
}
|
|
81
|
+
if (this.variadic) {
|
|
82
|
+
return this._collectValue(arg, previous);
|
|
83
|
+
}
|
|
84
|
+
return arg;
|
|
85
|
+
};
|
|
86
|
+
return this;
|
|
87
|
+
}
|
|
88
|
+
argRequired() {
|
|
89
|
+
this.required = true;
|
|
90
|
+
return this;
|
|
91
|
+
}
|
|
92
|
+
argOptional() {
|
|
93
|
+
this.required = false;
|
|
94
|
+
return this;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
function humanReadableArgName(arg) {
|
|
98
|
+
const nameOutput = arg.name() + (arg.variadic === true ? "..." : "");
|
|
99
|
+
return arg.required ? "<" + nameOutput + ">" : "[" + nameOutput + "]";
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// node_modules/commander/lib/command.js
|
|
103
|
+
import { EventEmitter } from "events";
|
|
104
|
+
import childProcess from "child_process";
|
|
105
|
+
import path from "path";
|
|
106
|
+
import fs from "fs";
|
|
107
|
+
import process2 from "process";
|
|
108
|
+
import { stripVTControlCharacters as stripVTControlCharacters2 } from "util";
|
|
109
|
+
|
|
110
|
+
// node_modules/commander/lib/help.js
|
|
111
|
+
import { stripVTControlCharacters } from "util";
|
|
112
|
+
|
|
113
|
+
class Help {
|
|
114
|
+
constructor() {
|
|
115
|
+
this.helpWidth = undefined;
|
|
116
|
+
this.minWidthToWrap = 40;
|
|
117
|
+
this.sortSubcommands = false;
|
|
118
|
+
this.sortOptions = false;
|
|
119
|
+
this.showGlobalOptions = false;
|
|
120
|
+
}
|
|
121
|
+
prepareContext(contextOptions) {
|
|
122
|
+
this.helpWidth = this.helpWidth ?? contextOptions.helpWidth ?? 80;
|
|
123
|
+
}
|
|
124
|
+
visibleCommands(cmd) {
|
|
125
|
+
const visibleCommands = cmd.commands.filter((cmd) => !cmd._hidden);
|
|
126
|
+
const helpCommand = cmd._getHelpCommand();
|
|
127
|
+
if (helpCommand && !helpCommand._hidden) {
|
|
128
|
+
visibleCommands.push(helpCommand);
|
|
129
|
+
}
|
|
130
|
+
if (this.sortSubcommands) {
|
|
131
|
+
visibleCommands.sort((a, b) => {
|
|
132
|
+
return a.name().localeCompare(b.name());
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
return visibleCommands;
|
|
136
|
+
}
|
|
137
|
+
compareOptions(a, b) {
|
|
138
|
+
const getSortKey = (option) => {
|
|
139
|
+
return option.short ? option.short.replace(/^-/, "") : option.long.replace(/^--/, "");
|
|
140
|
+
};
|
|
141
|
+
return getSortKey(a).localeCompare(getSortKey(b));
|
|
142
|
+
}
|
|
143
|
+
visibleOptions(cmd) {
|
|
144
|
+
const visibleOptions = cmd.options.filter((option) => !option.hidden);
|
|
145
|
+
const helpOption = cmd._getHelpOption();
|
|
146
|
+
if (helpOption && !helpOption.hidden) {
|
|
147
|
+
const removeShort = helpOption.short && cmd._findOption(helpOption.short);
|
|
148
|
+
const removeLong = helpOption.long && cmd._findOption(helpOption.long);
|
|
149
|
+
if (!removeShort && !removeLong) {
|
|
150
|
+
visibleOptions.push(helpOption);
|
|
151
|
+
} else if (helpOption.long && !removeLong) {
|
|
152
|
+
visibleOptions.push(cmd.createOption(helpOption.long, helpOption.description));
|
|
153
|
+
} else if (helpOption.short && !removeShort) {
|
|
154
|
+
visibleOptions.push(cmd.createOption(helpOption.short, helpOption.description));
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
if (this.sortOptions) {
|
|
158
|
+
visibleOptions.sort(this.compareOptions);
|
|
159
|
+
}
|
|
160
|
+
return visibleOptions;
|
|
161
|
+
}
|
|
162
|
+
visibleGlobalOptions(cmd) {
|
|
163
|
+
if (!this.showGlobalOptions)
|
|
164
|
+
return [];
|
|
165
|
+
const globalOptions = [];
|
|
166
|
+
for (let ancestorCmd = cmd.parent;ancestorCmd; ancestorCmd = ancestorCmd.parent) {
|
|
167
|
+
const visibleOptions = ancestorCmd.options.filter((option) => !option.hidden);
|
|
168
|
+
globalOptions.push(...visibleOptions);
|
|
169
|
+
}
|
|
170
|
+
if (this.sortOptions) {
|
|
171
|
+
globalOptions.sort(this.compareOptions);
|
|
172
|
+
}
|
|
173
|
+
return globalOptions;
|
|
174
|
+
}
|
|
175
|
+
visibleArguments(cmd) {
|
|
176
|
+
if (cmd._argsDescription) {
|
|
177
|
+
cmd.registeredArguments.forEach((argument) => {
|
|
178
|
+
argument.description = argument.description || cmd._argsDescription[argument.name()] || "";
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
if (cmd.registeredArguments.find((argument) => argument.description)) {
|
|
182
|
+
return cmd.registeredArguments;
|
|
183
|
+
}
|
|
184
|
+
return [];
|
|
185
|
+
}
|
|
186
|
+
subcommandTerm(cmd) {
|
|
187
|
+
const args = cmd.registeredArguments.map((arg) => humanReadableArgName(arg)).join(" ");
|
|
188
|
+
return cmd._name + (cmd._aliases[0] ? "|" + cmd._aliases[0] : "") + (cmd.options.length ? " [options]" : "") + (args ? " " + args : "");
|
|
189
|
+
}
|
|
190
|
+
optionTerm(option) {
|
|
191
|
+
return option.flags;
|
|
192
|
+
}
|
|
193
|
+
argumentTerm(argument) {
|
|
194
|
+
return argument.name();
|
|
195
|
+
}
|
|
196
|
+
longestSubcommandTermLength(cmd, helper) {
|
|
197
|
+
return helper.visibleCommands(cmd).reduce((max, command) => {
|
|
198
|
+
return Math.max(max, this.displayWidth(helper.styleSubcommandTerm(helper.subcommandTerm(command))));
|
|
199
|
+
}, 0);
|
|
200
|
+
}
|
|
201
|
+
longestOptionTermLength(cmd, helper) {
|
|
202
|
+
return helper.visibleOptions(cmd).reduce((max, option) => {
|
|
203
|
+
return Math.max(max, this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))));
|
|
204
|
+
}, 0);
|
|
205
|
+
}
|
|
206
|
+
longestGlobalOptionTermLength(cmd, helper) {
|
|
207
|
+
return helper.visibleGlobalOptions(cmd).reduce((max, option) => {
|
|
208
|
+
return Math.max(max, this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))));
|
|
209
|
+
}, 0);
|
|
210
|
+
}
|
|
211
|
+
longestArgumentTermLength(cmd, helper) {
|
|
212
|
+
return helper.visibleArguments(cmd).reduce((max, argument) => {
|
|
213
|
+
return Math.max(max, this.displayWidth(helper.styleArgumentTerm(helper.argumentTerm(argument))));
|
|
214
|
+
}, 0);
|
|
215
|
+
}
|
|
216
|
+
commandUsage(cmd) {
|
|
217
|
+
let cmdName = cmd._name;
|
|
218
|
+
if (cmd._aliases[0]) {
|
|
219
|
+
cmdName = cmdName + "|" + cmd._aliases[0];
|
|
220
|
+
}
|
|
221
|
+
let ancestorCmdNames = "";
|
|
222
|
+
for (let ancestorCmd = cmd.parent;ancestorCmd; ancestorCmd = ancestorCmd.parent) {
|
|
223
|
+
ancestorCmdNames = ancestorCmd.name() + " " + ancestorCmdNames;
|
|
224
|
+
}
|
|
225
|
+
return ancestorCmdNames + cmdName + " " + cmd.usage();
|
|
226
|
+
}
|
|
227
|
+
commandDescription(cmd) {
|
|
228
|
+
return cmd.description();
|
|
229
|
+
}
|
|
230
|
+
subcommandDescription(cmd) {
|
|
231
|
+
return cmd.summary() || cmd.description();
|
|
232
|
+
}
|
|
233
|
+
optionDescription(option) {
|
|
234
|
+
const extraInfo = [];
|
|
235
|
+
if (option.argChoices) {
|
|
236
|
+
extraInfo.push(`choices: ${option.argChoices.map((choice) => JSON.stringify(choice)).join(", ")}`);
|
|
237
|
+
}
|
|
238
|
+
if (option.defaultValue !== undefined) {
|
|
239
|
+
const showDefault = option.required || option.optional || option.isBoolean() && typeof option.defaultValue === "boolean";
|
|
240
|
+
if (showDefault) {
|
|
241
|
+
extraInfo.push(`default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}`);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
if (option.presetArg !== undefined && option.optional) {
|
|
245
|
+
extraInfo.push(`preset: ${JSON.stringify(option.presetArg)}`);
|
|
246
|
+
}
|
|
247
|
+
if (option.envVar !== undefined) {
|
|
248
|
+
extraInfo.push(`env: ${option.envVar}`);
|
|
249
|
+
}
|
|
250
|
+
if (extraInfo.length > 0) {
|
|
251
|
+
const extraDescription = `(${extraInfo.join(", ")})`;
|
|
252
|
+
if (option.description) {
|
|
253
|
+
return `${option.description} ${extraDescription}`;
|
|
254
|
+
}
|
|
255
|
+
return extraDescription;
|
|
256
|
+
}
|
|
257
|
+
return option.description;
|
|
258
|
+
}
|
|
259
|
+
argumentDescription(argument) {
|
|
260
|
+
const extraInfo = [];
|
|
261
|
+
if (argument.argChoices) {
|
|
262
|
+
extraInfo.push(`choices: ${argument.argChoices.map((choice) => JSON.stringify(choice)).join(", ")}`);
|
|
263
|
+
}
|
|
264
|
+
if (argument.defaultValue !== undefined) {
|
|
265
|
+
extraInfo.push(`default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}`);
|
|
266
|
+
}
|
|
267
|
+
if (extraInfo.length > 0) {
|
|
268
|
+
const extraDescription = `(${extraInfo.join(", ")})`;
|
|
269
|
+
if (argument.description) {
|
|
270
|
+
return `${argument.description} ${extraDescription}`;
|
|
271
|
+
}
|
|
272
|
+
return extraDescription;
|
|
273
|
+
}
|
|
274
|
+
return argument.description;
|
|
275
|
+
}
|
|
276
|
+
formatItemList(heading, items, helper) {
|
|
277
|
+
if (items.length === 0)
|
|
278
|
+
return [];
|
|
279
|
+
return [helper.styleTitle(heading), ...items, ""];
|
|
280
|
+
}
|
|
281
|
+
groupItems(unsortedItems, visibleItems, getGroup) {
|
|
282
|
+
const result = new Map;
|
|
283
|
+
unsortedItems.forEach((item) => {
|
|
284
|
+
const group = getGroup(item);
|
|
285
|
+
if (!result.has(group))
|
|
286
|
+
result.set(group, []);
|
|
287
|
+
});
|
|
288
|
+
visibleItems.forEach((item) => {
|
|
289
|
+
const group = getGroup(item);
|
|
290
|
+
if (!result.has(group)) {
|
|
291
|
+
result.set(group, []);
|
|
292
|
+
}
|
|
293
|
+
result.get(group).push(item);
|
|
294
|
+
});
|
|
295
|
+
return result;
|
|
296
|
+
}
|
|
297
|
+
formatHelp(cmd, helper) {
|
|
298
|
+
const termWidth = helper.padWidth(cmd, helper);
|
|
299
|
+
const helpWidth = helper.helpWidth ?? 80;
|
|
300
|
+
function callFormatItem(term, description) {
|
|
301
|
+
return helper.formatItem(term, termWidth, description, helper);
|
|
302
|
+
}
|
|
303
|
+
let output = [
|
|
304
|
+
`${helper.styleTitle("Usage:")} ${helper.styleUsage(helper.commandUsage(cmd))}`,
|
|
305
|
+
""
|
|
306
|
+
];
|
|
307
|
+
const commandDescription = helper.commandDescription(cmd);
|
|
308
|
+
if (commandDescription.length > 0) {
|
|
309
|
+
output = output.concat([
|
|
310
|
+
helper.boxWrap(helper.styleCommandDescription(commandDescription), helpWidth),
|
|
311
|
+
""
|
|
312
|
+
]);
|
|
313
|
+
}
|
|
314
|
+
const argumentList = helper.visibleArguments(cmd).map((argument) => {
|
|
315
|
+
return callFormatItem(helper.styleArgumentTerm(helper.argumentTerm(argument)), helper.styleArgumentDescription(helper.argumentDescription(argument)));
|
|
316
|
+
});
|
|
317
|
+
output = output.concat(this.formatItemList("Arguments:", argumentList, helper));
|
|
318
|
+
const optionGroups = this.groupItems(cmd.options, helper.visibleOptions(cmd), (option) => option.helpGroupHeading ?? "Options:");
|
|
319
|
+
optionGroups.forEach((options, group) => {
|
|
320
|
+
const optionList = options.map((option) => {
|
|
321
|
+
return callFormatItem(helper.styleOptionTerm(helper.optionTerm(option)), helper.styleOptionDescription(helper.optionDescription(option)));
|
|
322
|
+
});
|
|
323
|
+
output = output.concat(this.formatItemList(group, optionList, helper));
|
|
324
|
+
});
|
|
325
|
+
if (helper.showGlobalOptions) {
|
|
326
|
+
const globalOptionList = helper.visibleGlobalOptions(cmd).map((option) => {
|
|
327
|
+
return callFormatItem(helper.styleOptionTerm(helper.optionTerm(option)), helper.styleOptionDescription(helper.optionDescription(option)));
|
|
328
|
+
});
|
|
329
|
+
output = output.concat(this.formatItemList("Global Options:", globalOptionList, helper));
|
|
330
|
+
}
|
|
331
|
+
const commandGroups = this.groupItems(cmd.commands, helper.visibleCommands(cmd), (sub) => sub.helpGroup() || "Commands:");
|
|
332
|
+
commandGroups.forEach((commands, group) => {
|
|
333
|
+
const commandList = commands.map((sub) => {
|
|
334
|
+
return callFormatItem(helper.styleSubcommandTerm(helper.subcommandTerm(sub)), helper.styleSubcommandDescription(helper.subcommandDescription(sub)));
|
|
335
|
+
});
|
|
336
|
+
output = output.concat(this.formatItemList(group, commandList, helper));
|
|
337
|
+
});
|
|
338
|
+
return output.join(`
|
|
339
|
+
`);
|
|
340
|
+
}
|
|
341
|
+
displayWidth(str) {
|
|
342
|
+
return stripVTControlCharacters(str).length;
|
|
343
|
+
}
|
|
344
|
+
styleTitle(str) {
|
|
345
|
+
return str;
|
|
346
|
+
}
|
|
347
|
+
styleUsage(str) {
|
|
348
|
+
return str.split(" ").map((word) => {
|
|
349
|
+
if (word === "[options]")
|
|
350
|
+
return this.styleOptionText(word);
|
|
351
|
+
if (word === "[command]")
|
|
352
|
+
return this.styleSubcommandText(word);
|
|
353
|
+
if (word[0] === "[" || word[0] === "<")
|
|
354
|
+
return this.styleArgumentText(word);
|
|
355
|
+
return this.styleCommandText(word);
|
|
356
|
+
}).join(" ");
|
|
357
|
+
}
|
|
358
|
+
styleCommandDescription(str) {
|
|
359
|
+
return this.styleDescriptionText(str);
|
|
360
|
+
}
|
|
361
|
+
styleOptionDescription(str) {
|
|
362
|
+
return this.styleDescriptionText(str);
|
|
363
|
+
}
|
|
364
|
+
styleSubcommandDescription(str) {
|
|
365
|
+
return this.styleDescriptionText(str);
|
|
366
|
+
}
|
|
367
|
+
styleArgumentDescription(str) {
|
|
368
|
+
return this.styleDescriptionText(str);
|
|
369
|
+
}
|
|
370
|
+
styleDescriptionText(str) {
|
|
371
|
+
return str;
|
|
372
|
+
}
|
|
373
|
+
styleOptionTerm(str) {
|
|
374
|
+
return this.styleOptionText(str);
|
|
375
|
+
}
|
|
376
|
+
styleSubcommandTerm(str) {
|
|
377
|
+
return str.split(" ").map((word) => {
|
|
378
|
+
if (word === "[options]")
|
|
379
|
+
return this.styleOptionText(word);
|
|
380
|
+
if (word[0] === "[" || word[0] === "<")
|
|
381
|
+
return this.styleArgumentText(word);
|
|
382
|
+
return this.styleSubcommandText(word);
|
|
383
|
+
}).join(" ");
|
|
384
|
+
}
|
|
385
|
+
styleArgumentTerm(str) {
|
|
386
|
+
return this.styleArgumentText(str);
|
|
387
|
+
}
|
|
388
|
+
styleOptionText(str) {
|
|
389
|
+
return str;
|
|
390
|
+
}
|
|
391
|
+
styleArgumentText(str) {
|
|
392
|
+
return str;
|
|
393
|
+
}
|
|
394
|
+
styleSubcommandText(str) {
|
|
395
|
+
return str;
|
|
396
|
+
}
|
|
397
|
+
styleCommandText(str) {
|
|
398
|
+
return str;
|
|
399
|
+
}
|
|
400
|
+
padWidth(cmd, helper) {
|
|
401
|
+
return Math.max(helper.longestOptionTermLength(cmd, helper), helper.longestGlobalOptionTermLength(cmd, helper), helper.longestSubcommandTermLength(cmd, helper), helper.longestArgumentTermLength(cmd, helper));
|
|
402
|
+
}
|
|
403
|
+
preformatted(str) {
|
|
404
|
+
return /\n[^\S\r\n]/.test(str);
|
|
405
|
+
}
|
|
406
|
+
formatItem(term, termWidth, description, helper) {
|
|
407
|
+
const itemIndent = 2;
|
|
408
|
+
const itemIndentStr = " ".repeat(itemIndent);
|
|
409
|
+
if (!description)
|
|
410
|
+
return itemIndentStr + term;
|
|
411
|
+
const paddedTerm = term.padEnd(termWidth + term.length - helper.displayWidth(term));
|
|
412
|
+
const spacerWidth = 2;
|
|
413
|
+
const helpWidth = this.helpWidth ?? 80;
|
|
414
|
+
const remainingWidth = helpWidth - termWidth - spacerWidth - itemIndent;
|
|
415
|
+
let formattedDescription;
|
|
416
|
+
if (remainingWidth < this.minWidthToWrap || helper.preformatted(description)) {
|
|
417
|
+
formattedDescription = description;
|
|
418
|
+
} else {
|
|
419
|
+
const wrappedDescription = helper.boxWrap(description, remainingWidth);
|
|
420
|
+
formattedDescription = wrappedDescription.replace(/\n/g, `
|
|
421
|
+
` + " ".repeat(termWidth + spacerWidth));
|
|
422
|
+
}
|
|
423
|
+
return itemIndentStr + paddedTerm + " ".repeat(spacerWidth) + formattedDescription.replace(/\n/g, `
|
|
424
|
+
${itemIndentStr}`);
|
|
425
|
+
}
|
|
426
|
+
boxWrap(str, width) {
|
|
427
|
+
if (width < this.minWidthToWrap)
|
|
428
|
+
return str;
|
|
429
|
+
const rawLines = str.split(/\r\n|\n/);
|
|
430
|
+
const chunkPattern = /[\s]*[^\s]+/g;
|
|
431
|
+
const wrappedLines = [];
|
|
432
|
+
rawLines.forEach((line) => {
|
|
433
|
+
const chunks = line.match(chunkPattern);
|
|
434
|
+
if (chunks === null) {
|
|
435
|
+
wrappedLines.push("");
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
let sumChunks = [chunks.shift()];
|
|
439
|
+
let sumWidth = this.displayWidth(sumChunks[0]);
|
|
440
|
+
chunks.forEach((chunk) => {
|
|
441
|
+
const visibleWidth = this.displayWidth(chunk);
|
|
442
|
+
if (sumWidth + visibleWidth <= width) {
|
|
443
|
+
sumChunks.push(chunk);
|
|
444
|
+
sumWidth += visibleWidth;
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
wrappedLines.push(sumChunks.join(""));
|
|
448
|
+
const nextChunk = chunk.trimStart();
|
|
449
|
+
sumChunks = [nextChunk];
|
|
450
|
+
sumWidth = this.displayWidth(nextChunk);
|
|
451
|
+
});
|
|
452
|
+
wrappedLines.push(sumChunks.join(""));
|
|
453
|
+
});
|
|
454
|
+
return wrappedLines.join(`
|
|
455
|
+
`);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
// node_modules/commander/lib/option.js
|
|
460
|
+
class Option {
|
|
461
|
+
constructor(flags, description) {
|
|
462
|
+
this.flags = flags;
|
|
463
|
+
this.description = description || "";
|
|
464
|
+
this.required = flags.includes("<");
|
|
465
|
+
this.optional = flags.includes("[");
|
|
466
|
+
this.variadic = /\w\.\.\.[>\]]$/.test(flags);
|
|
467
|
+
this.mandatory = false;
|
|
468
|
+
const optionFlags = splitOptionFlags(flags);
|
|
469
|
+
this.short = optionFlags.shortFlag;
|
|
470
|
+
this.long = optionFlags.longFlag;
|
|
471
|
+
this.negate = false;
|
|
472
|
+
if (this.long) {
|
|
473
|
+
this.negate = this.long.startsWith("--no-");
|
|
474
|
+
}
|
|
475
|
+
this.defaultValue = undefined;
|
|
476
|
+
this.defaultValueDescription = undefined;
|
|
477
|
+
this.presetArg = undefined;
|
|
478
|
+
this.envVar = undefined;
|
|
479
|
+
this.parseArg = undefined;
|
|
480
|
+
this.hidden = false;
|
|
481
|
+
this.argChoices = undefined;
|
|
482
|
+
this.conflictsWith = [];
|
|
483
|
+
this.implied = undefined;
|
|
484
|
+
this.helpGroupHeading = undefined;
|
|
485
|
+
}
|
|
486
|
+
default(value, description) {
|
|
487
|
+
this.defaultValue = value;
|
|
488
|
+
this.defaultValueDescription = description;
|
|
489
|
+
return this;
|
|
490
|
+
}
|
|
491
|
+
preset(arg) {
|
|
492
|
+
this.presetArg = arg;
|
|
493
|
+
return this;
|
|
494
|
+
}
|
|
495
|
+
conflicts(names) {
|
|
496
|
+
this.conflictsWith = this.conflictsWith.concat(names);
|
|
497
|
+
return this;
|
|
498
|
+
}
|
|
499
|
+
implies(impliedOptionValues) {
|
|
500
|
+
let newImplied = impliedOptionValues;
|
|
501
|
+
if (typeof impliedOptionValues === "string") {
|
|
502
|
+
newImplied = { [impliedOptionValues]: true };
|
|
503
|
+
}
|
|
504
|
+
this.implied = Object.assign(this.implied || {}, newImplied);
|
|
505
|
+
return this;
|
|
506
|
+
}
|
|
507
|
+
env(name) {
|
|
508
|
+
this.envVar = name;
|
|
509
|
+
return this;
|
|
510
|
+
}
|
|
511
|
+
argParser(fn) {
|
|
512
|
+
this.parseArg = fn;
|
|
513
|
+
return this;
|
|
514
|
+
}
|
|
515
|
+
makeOptionMandatory(mandatory = true) {
|
|
516
|
+
this.mandatory = !!mandatory;
|
|
517
|
+
return this;
|
|
518
|
+
}
|
|
519
|
+
hideHelp(hide = true) {
|
|
520
|
+
this.hidden = !!hide;
|
|
521
|
+
return this;
|
|
522
|
+
}
|
|
523
|
+
_collectValue(value, previous) {
|
|
524
|
+
if (previous === this.defaultValue || !Array.isArray(previous)) {
|
|
525
|
+
return [value];
|
|
526
|
+
}
|
|
527
|
+
previous.push(value);
|
|
528
|
+
return previous;
|
|
529
|
+
}
|
|
530
|
+
choices(values) {
|
|
531
|
+
this.argChoices = values.slice();
|
|
532
|
+
this.parseArg = (arg, previous) => {
|
|
533
|
+
if (!this.argChoices.includes(arg)) {
|
|
534
|
+
throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(", ")}.`);
|
|
535
|
+
}
|
|
536
|
+
if (this.variadic) {
|
|
537
|
+
return this._collectValue(arg, previous);
|
|
538
|
+
}
|
|
539
|
+
return arg;
|
|
540
|
+
};
|
|
541
|
+
return this;
|
|
542
|
+
}
|
|
543
|
+
name() {
|
|
544
|
+
if (this.long) {
|
|
545
|
+
return this.long.replace(/^--/, "");
|
|
546
|
+
}
|
|
547
|
+
return this.short.replace(/^-/, "");
|
|
548
|
+
}
|
|
549
|
+
attributeName() {
|
|
550
|
+
if (this.negate) {
|
|
551
|
+
return camelcase(this.name().replace(/^no-/, ""));
|
|
552
|
+
}
|
|
553
|
+
return camelcase(this.name());
|
|
554
|
+
}
|
|
555
|
+
helpGroup(heading) {
|
|
556
|
+
this.helpGroupHeading = heading;
|
|
557
|
+
return this;
|
|
558
|
+
}
|
|
559
|
+
is(arg) {
|
|
560
|
+
return this.short === arg || this.long === arg;
|
|
561
|
+
}
|
|
562
|
+
isBoolean() {
|
|
563
|
+
return !this.required && !this.optional && !this.negate;
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
class DualOptions {
|
|
568
|
+
constructor(options) {
|
|
569
|
+
this.positiveOptions = new Map;
|
|
570
|
+
this.negativeOptions = new Map;
|
|
571
|
+
this.dualOptions = new Set;
|
|
572
|
+
options.forEach((option) => {
|
|
573
|
+
if (option.negate) {
|
|
574
|
+
this.negativeOptions.set(option.attributeName(), option);
|
|
575
|
+
} else {
|
|
576
|
+
this.positiveOptions.set(option.attributeName(), option);
|
|
577
|
+
}
|
|
578
|
+
});
|
|
579
|
+
this.negativeOptions.forEach((value, key) => {
|
|
580
|
+
if (this.positiveOptions.has(key)) {
|
|
581
|
+
this.dualOptions.add(key);
|
|
582
|
+
}
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
valueFromOption(value, option) {
|
|
586
|
+
const optionKey = option.attributeName();
|
|
587
|
+
if (!this.dualOptions.has(optionKey))
|
|
588
|
+
return true;
|
|
589
|
+
const preset = this.negativeOptions.get(optionKey).presetArg;
|
|
590
|
+
const negativeValue = preset !== undefined ? preset : false;
|
|
591
|
+
return option.negate === (negativeValue === value);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
function camelcase(str) {
|
|
595
|
+
return str.split("-").reduce((str, word) => {
|
|
596
|
+
return str + word[0].toUpperCase() + word.slice(1);
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
function splitOptionFlags(flags) {
|
|
600
|
+
let shortFlag;
|
|
601
|
+
let longFlag;
|
|
602
|
+
const shortFlagExp = /^-[^-]$/;
|
|
603
|
+
const longFlagExp = /^--[^-]/;
|
|
604
|
+
const flagParts = flags.split(/[ |,]+/).concat("guard");
|
|
605
|
+
if (shortFlagExp.test(flagParts[0]))
|
|
606
|
+
shortFlag = flagParts.shift();
|
|
607
|
+
if (longFlagExp.test(flagParts[0]))
|
|
608
|
+
longFlag = flagParts.shift();
|
|
609
|
+
if (!shortFlag && shortFlagExp.test(flagParts[0]))
|
|
610
|
+
shortFlag = flagParts.shift();
|
|
611
|
+
if (!shortFlag && longFlagExp.test(flagParts[0])) {
|
|
612
|
+
shortFlag = longFlag;
|
|
613
|
+
longFlag = flagParts.shift();
|
|
614
|
+
}
|
|
615
|
+
if (flagParts[0].startsWith("-")) {
|
|
616
|
+
const unsupportedFlag = flagParts[0];
|
|
617
|
+
const baseError = `option creation failed due to '${unsupportedFlag}' in option flags '${flags}'`;
|
|
618
|
+
if (/^-[^-][^-]/.test(unsupportedFlag))
|
|
619
|
+
throw new Error(`${baseError}
|
|
620
|
+
- a short flag is a single dash and a single character
|
|
621
|
+
- either use a single dash and a single character (for a short flag)
|
|
622
|
+
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`);
|
|
623
|
+
if (shortFlagExp.test(unsupportedFlag))
|
|
624
|
+
throw new Error(`${baseError}
|
|
625
|
+
- too many short flags`);
|
|
626
|
+
if (longFlagExp.test(unsupportedFlag))
|
|
627
|
+
throw new Error(`${baseError}
|
|
628
|
+
- too many long flags`);
|
|
629
|
+
throw new Error(`${baseError}
|
|
630
|
+
- unrecognised flag format`);
|
|
631
|
+
}
|
|
632
|
+
if (shortFlag === undefined && longFlag === undefined)
|
|
633
|
+
throw new Error(`option creation failed due to no flags found in '${flags}'.`);
|
|
634
|
+
return { shortFlag, longFlag };
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
// node_modules/commander/lib/suggestSimilar.js
|
|
638
|
+
var maxDistance = 3;
|
|
639
|
+
function editDistance(a, b) {
|
|
640
|
+
if (Math.abs(a.length - b.length) > maxDistance)
|
|
641
|
+
return Math.max(a.length, b.length);
|
|
642
|
+
const d = [];
|
|
643
|
+
for (let i = 0;i <= a.length; i++) {
|
|
644
|
+
d[i] = [i];
|
|
645
|
+
}
|
|
646
|
+
for (let j = 0;j <= b.length; j++) {
|
|
647
|
+
d[0][j] = j;
|
|
648
|
+
}
|
|
649
|
+
for (let j = 1;j <= b.length; j++) {
|
|
650
|
+
for (let i = 1;i <= a.length; i++) {
|
|
651
|
+
let cost;
|
|
652
|
+
if (a[i - 1] === b[j - 1]) {
|
|
653
|
+
cost = 0;
|
|
654
|
+
} else {
|
|
655
|
+
cost = 1;
|
|
656
|
+
}
|
|
657
|
+
d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost);
|
|
658
|
+
if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {
|
|
659
|
+
d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + 1);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
return d[a.length][b.length];
|
|
664
|
+
}
|
|
665
|
+
function suggestSimilar(word, candidates) {
|
|
666
|
+
if (!candidates || candidates.length === 0)
|
|
667
|
+
return "";
|
|
668
|
+
candidates = Array.from(new Set(candidates));
|
|
669
|
+
const searchingOptions = word.startsWith("--");
|
|
670
|
+
if (searchingOptions) {
|
|
671
|
+
word = word.slice(2);
|
|
672
|
+
candidates = candidates.map((candidate) => candidate.slice(2));
|
|
673
|
+
}
|
|
674
|
+
let similar = [];
|
|
675
|
+
let bestDistance = maxDistance;
|
|
676
|
+
const minSimilarity = 0.4;
|
|
677
|
+
candidates.forEach((candidate) => {
|
|
678
|
+
if (candidate.length <= 1)
|
|
679
|
+
return;
|
|
680
|
+
const distance = editDistance(word, candidate);
|
|
681
|
+
const length = Math.max(word.length, candidate.length);
|
|
682
|
+
const similarity = (length - distance) / length;
|
|
683
|
+
if (similarity > minSimilarity) {
|
|
684
|
+
if (distance < bestDistance) {
|
|
685
|
+
bestDistance = distance;
|
|
686
|
+
similar = [candidate];
|
|
687
|
+
} else if (distance === bestDistance) {
|
|
688
|
+
similar.push(candidate);
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
});
|
|
692
|
+
similar.sort((a, b) => a.localeCompare(b));
|
|
693
|
+
if (searchingOptions) {
|
|
694
|
+
similar = similar.map((candidate) => `--${candidate}`);
|
|
695
|
+
}
|
|
696
|
+
if (similar.length > 1) {
|
|
697
|
+
return `
|
|
698
|
+
(Did you mean one of ${similar.join(", ")}?)`;
|
|
699
|
+
}
|
|
700
|
+
if (similar.length === 1) {
|
|
701
|
+
return `
|
|
702
|
+
(Did you mean ${similar[0]}?)`;
|
|
703
|
+
}
|
|
704
|
+
return "";
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
// node_modules/commander/lib/command.js
|
|
708
|
+
class Command extends EventEmitter {
|
|
709
|
+
constructor(name) {
|
|
710
|
+
super();
|
|
711
|
+
this.commands = [];
|
|
712
|
+
this.options = [];
|
|
713
|
+
this.parent = null;
|
|
714
|
+
this._allowUnknownOption = false;
|
|
715
|
+
this._allowExcessArguments = false;
|
|
716
|
+
this.registeredArguments = [];
|
|
717
|
+
this._args = this.registeredArguments;
|
|
718
|
+
this.args = [];
|
|
719
|
+
this.rawArgs = [];
|
|
720
|
+
this.processedArgs = [];
|
|
721
|
+
this._scriptPath = null;
|
|
722
|
+
this._name = name || "";
|
|
723
|
+
this._optionValues = {};
|
|
724
|
+
this._optionValueSources = {};
|
|
725
|
+
this._storeOptionsAsProperties = false;
|
|
726
|
+
this._actionHandler = null;
|
|
727
|
+
this._executableHandler = false;
|
|
728
|
+
this._executableFile = null;
|
|
729
|
+
this._executableDir = null;
|
|
730
|
+
this._defaultCommandName = null;
|
|
731
|
+
this._exitCallback = null;
|
|
732
|
+
this._aliases = [];
|
|
733
|
+
this._combineFlagAndOptionalValue = true;
|
|
734
|
+
this._description = "";
|
|
735
|
+
this._summary = "";
|
|
736
|
+
this._argsDescription = undefined;
|
|
737
|
+
this._enablePositionalOptions = false;
|
|
738
|
+
this._passThroughOptions = false;
|
|
739
|
+
this._lifeCycleHooks = {};
|
|
740
|
+
this._showHelpAfterError = false;
|
|
741
|
+
this._showSuggestionAfterError = true;
|
|
742
|
+
this._savedState = null;
|
|
743
|
+
this._outputConfiguration = {
|
|
744
|
+
writeOut: (str) => process2.stdout.write(str),
|
|
745
|
+
writeErr: (str) => process2.stderr.write(str),
|
|
746
|
+
outputError: (str, write) => write(str),
|
|
747
|
+
getOutHelpWidth: () => process2.stdout.isTTY ? process2.stdout.columns : undefined,
|
|
748
|
+
getErrHelpWidth: () => process2.stderr.isTTY ? process2.stderr.columns : undefined,
|
|
749
|
+
getOutHasColors: () => useColor() ?? (process2.stdout.isTTY && process2.stdout.hasColors?.()),
|
|
750
|
+
getErrHasColors: () => useColor() ?? (process2.stderr.isTTY && process2.stderr.hasColors?.()),
|
|
751
|
+
stripColor: (str) => stripVTControlCharacters2(str)
|
|
752
|
+
};
|
|
753
|
+
this._hidden = false;
|
|
754
|
+
this._helpOption = undefined;
|
|
755
|
+
this._addImplicitHelpCommand = undefined;
|
|
756
|
+
this._helpCommand = undefined;
|
|
757
|
+
this._helpConfiguration = {};
|
|
758
|
+
this._helpGroupHeading = undefined;
|
|
759
|
+
this._defaultCommandGroup = undefined;
|
|
760
|
+
this._defaultOptionGroup = undefined;
|
|
761
|
+
}
|
|
762
|
+
copyInheritedSettings(sourceCommand) {
|
|
763
|
+
this._outputConfiguration = sourceCommand._outputConfiguration;
|
|
764
|
+
this._helpOption = sourceCommand._helpOption;
|
|
765
|
+
this._helpCommand = sourceCommand._helpCommand;
|
|
766
|
+
this._helpConfiguration = sourceCommand._helpConfiguration;
|
|
767
|
+
this._exitCallback = sourceCommand._exitCallback;
|
|
768
|
+
this._storeOptionsAsProperties = sourceCommand._storeOptionsAsProperties;
|
|
769
|
+
this._combineFlagAndOptionalValue = sourceCommand._combineFlagAndOptionalValue;
|
|
770
|
+
this._allowExcessArguments = sourceCommand._allowExcessArguments;
|
|
771
|
+
this._enablePositionalOptions = sourceCommand._enablePositionalOptions;
|
|
772
|
+
this._showHelpAfterError = sourceCommand._showHelpAfterError;
|
|
773
|
+
this._showSuggestionAfterError = sourceCommand._showSuggestionAfterError;
|
|
774
|
+
return this;
|
|
775
|
+
}
|
|
776
|
+
_getCommandAndAncestors() {
|
|
777
|
+
const result = [];
|
|
778
|
+
for (let command = this;command; command = command.parent) {
|
|
779
|
+
result.push(command);
|
|
780
|
+
}
|
|
781
|
+
return result;
|
|
782
|
+
}
|
|
783
|
+
command(nameAndArgs, actionOptsOrExecDesc, execOpts) {
|
|
784
|
+
let desc = actionOptsOrExecDesc;
|
|
785
|
+
let opts = execOpts;
|
|
786
|
+
if (typeof desc === "object" && desc !== null) {
|
|
787
|
+
opts = desc;
|
|
788
|
+
desc = null;
|
|
789
|
+
}
|
|
790
|
+
opts = opts || {};
|
|
791
|
+
const [, name, args] = nameAndArgs.match(/([^ ]+) *(.*)/);
|
|
792
|
+
const cmd = this.createCommand(name);
|
|
793
|
+
if (desc) {
|
|
794
|
+
cmd.description(desc);
|
|
795
|
+
cmd._executableHandler = true;
|
|
796
|
+
}
|
|
797
|
+
if (opts.isDefault)
|
|
798
|
+
this._defaultCommandName = cmd._name;
|
|
799
|
+
cmd._hidden = !!(opts.noHelp || opts.hidden);
|
|
800
|
+
cmd._executableFile = opts.executableFile || null;
|
|
801
|
+
if (args)
|
|
802
|
+
cmd.arguments(args);
|
|
803
|
+
this._registerCommand(cmd);
|
|
804
|
+
cmd.parent = this;
|
|
805
|
+
cmd.copyInheritedSettings(this);
|
|
806
|
+
if (desc)
|
|
807
|
+
return this;
|
|
808
|
+
return cmd;
|
|
809
|
+
}
|
|
810
|
+
createCommand(name) {
|
|
811
|
+
return new Command(name);
|
|
812
|
+
}
|
|
813
|
+
createHelp() {
|
|
814
|
+
return Object.assign(new Help, this.configureHelp());
|
|
815
|
+
}
|
|
816
|
+
configureHelp(configuration) {
|
|
817
|
+
if (configuration === undefined)
|
|
818
|
+
return this._helpConfiguration;
|
|
819
|
+
this._helpConfiguration = configuration;
|
|
820
|
+
return this;
|
|
821
|
+
}
|
|
822
|
+
configureOutput(configuration) {
|
|
823
|
+
if (configuration === undefined)
|
|
824
|
+
return this._outputConfiguration;
|
|
825
|
+
this._outputConfiguration = {
|
|
826
|
+
...this._outputConfiguration,
|
|
827
|
+
...configuration
|
|
828
|
+
};
|
|
829
|
+
return this;
|
|
830
|
+
}
|
|
831
|
+
showHelpAfterError(displayHelp = true) {
|
|
832
|
+
if (typeof displayHelp !== "string")
|
|
833
|
+
displayHelp = !!displayHelp;
|
|
834
|
+
this._showHelpAfterError = displayHelp;
|
|
835
|
+
return this;
|
|
836
|
+
}
|
|
837
|
+
showSuggestionAfterError(displaySuggestion = true) {
|
|
838
|
+
this._showSuggestionAfterError = !!displaySuggestion;
|
|
839
|
+
return this;
|
|
840
|
+
}
|
|
841
|
+
addCommand(cmd, opts) {
|
|
842
|
+
if (!cmd._name) {
|
|
843
|
+
throw new Error(`Command passed to .addCommand() must have a name
|
|
844
|
+
- specify the name in Command constructor or using .name()`);
|
|
845
|
+
}
|
|
846
|
+
opts = opts || {};
|
|
847
|
+
if (opts.isDefault)
|
|
848
|
+
this._defaultCommandName = cmd._name;
|
|
849
|
+
if (opts.noHelp || opts.hidden)
|
|
850
|
+
cmd._hidden = true;
|
|
851
|
+
this._registerCommand(cmd);
|
|
852
|
+
cmd.parent = this;
|
|
853
|
+
cmd._checkForBrokenPassThrough();
|
|
854
|
+
return this;
|
|
855
|
+
}
|
|
856
|
+
createArgument(name, description) {
|
|
857
|
+
return new Argument(name, description);
|
|
858
|
+
}
|
|
859
|
+
argument(name, description, parseArg, defaultValue) {
|
|
860
|
+
const argument = this.createArgument(name, description);
|
|
861
|
+
if (typeof parseArg === "function") {
|
|
862
|
+
argument.default(defaultValue).argParser(parseArg);
|
|
863
|
+
} else {
|
|
864
|
+
argument.default(parseArg);
|
|
865
|
+
}
|
|
866
|
+
this.addArgument(argument);
|
|
867
|
+
return this;
|
|
868
|
+
}
|
|
869
|
+
arguments(names) {
|
|
870
|
+
names.trim().split(/ +/).forEach((detail) => {
|
|
871
|
+
this.argument(detail);
|
|
872
|
+
});
|
|
873
|
+
return this;
|
|
874
|
+
}
|
|
875
|
+
addArgument(argument) {
|
|
876
|
+
const previousArgument = this.registeredArguments.slice(-1)[0];
|
|
877
|
+
if (previousArgument?.variadic) {
|
|
878
|
+
throw new Error(`only the last argument can be variadic '${previousArgument.name()}'`);
|
|
879
|
+
}
|
|
880
|
+
if (argument.required && argument.defaultValue !== undefined && argument.parseArg === undefined) {
|
|
881
|
+
throw new Error(`a default value for a required argument is never used: '${argument.name()}'`);
|
|
882
|
+
}
|
|
883
|
+
this.registeredArguments.push(argument);
|
|
884
|
+
return this;
|
|
885
|
+
}
|
|
886
|
+
helpCommand(enableOrNameAndArgs, description) {
|
|
887
|
+
if (typeof enableOrNameAndArgs === "boolean") {
|
|
888
|
+
this._addImplicitHelpCommand = enableOrNameAndArgs;
|
|
889
|
+
if (enableOrNameAndArgs && this._defaultCommandGroup) {
|
|
890
|
+
this._initCommandGroup(this._getHelpCommand());
|
|
891
|
+
}
|
|
892
|
+
return this;
|
|
893
|
+
}
|
|
894
|
+
const nameAndArgs = enableOrNameAndArgs ?? "help [command]";
|
|
895
|
+
const [, helpName, helpArgs] = nameAndArgs.match(/([^ ]+) *(.*)/);
|
|
896
|
+
const helpDescription = description ?? "display help for command";
|
|
897
|
+
const helpCommand = this.createCommand(helpName);
|
|
898
|
+
helpCommand.helpOption(false);
|
|
899
|
+
if (helpArgs)
|
|
900
|
+
helpCommand.arguments(helpArgs);
|
|
901
|
+
if (helpDescription)
|
|
902
|
+
helpCommand.description(helpDescription);
|
|
903
|
+
this._addImplicitHelpCommand = true;
|
|
904
|
+
this._helpCommand = helpCommand;
|
|
905
|
+
if (enableOrNameAndArgs || description)
|
|
906
|
+
this._initCommandGroup(helpCommand);
|
|
907
|
+
return this;
|
|
908
|
+
}
|
|
909
|
+
addHelpCommand(helpCommand, deprecatedDescription) {
|
|
910
|
+
if (typeof helpCommand !== "object") {
|
|
911
|
+
this.helpCommand(helpCommand, deprecatedDescription);
|
|
912
|
+
return this;
|
|
913
|
+
}
|
|
914
|
+
this._addImplicitHelpCommand = true;
|
|
915
|
+
this._helpCommand = helpCommand;
|
|
916
|
+
this._initCommandGroup(helpCommand);
|
|
917
|
+
return this;
|
|
918
|
+
}
|
|
919
|
+
_getHelpCommand() {
|
|
920
|
+
const hasImplicitHelpCommand = this._addImplicitHelpCommand ?? (this.commands.length && !this._actionHandler && !this._findCommand("help"));
|
|
921
|
+
if (hasImplicitHelpCommand) {
|
|
922
|
+
if (this._helpCommand === undefined) {
|
|
923
|
+
this.helpCommand(undefined, undefined);
|
|
924
|
+
}
|
|
925
|
+
return this._helpCommand;
|
|
926
|
+
}
|
|
927
|
+
return null;
|
|
928
|
+
}
|
|
929
|
+
hook(event, listener) {
|
|
930
|
+
const allowedValues = ["preSubcommand", "preAction", "postAction"];
|
|
931
|
+
if (!allowedValues.includes(event)) {
|
|
932
|
+
throw new Error(`Unexpected value for event passed to hook : '${event}'.
|
|
933
|
+
Expecting one of '${allowedValues.join("', '")}'`);
|
|
934
|
+
}
|
|
935
|
+
if (this._lifeCycleHooks[event]) {
|
|
936
|
+
this._lifeCycleHooks[event].push(listener);
|
|
937
|
+
} else {
|
|
938
|
+
this._lifeCycleHooks[event] = [listener];
|
|
939
|
+
}
|
|
940
|
+
return this;
|
|
941
|
+
}
|
|
942
|
+
exitOverride(fn) {
|
|
943
|
+
if (fn) {
|
|
944
|
+
this._exitCallback = fn;
|
|
945
|
+
} else {
|
|
946
|
+
this._exitCallback = (err) => {
|
|
947
|
+
if (err.code !== "commander.executeSubCommandAsync") {
|
|
948
|
+
throw err;
|
|
949
|
+
}
|
|
950
|
+
};
|
|
951
|
+
}
|
|
952
|
+
return this;
|
|
953
|
+
}
|
|
954
|
+
_exit(exitCode, code, message) {
|
|
955
|
+
if (this._exitCallback) {
|
|
956
|
+
this._exitCallback(new CommanderError(exitCode, code, message));
|
|
957
|
+
}
|
|
958
|
+
process2.exit(exitCode);
|
|
959
|
+
}
|
|
960
|
+
action(fn) {
|
|
961
|
+
const listener = (args) => {
|
|
962
|
+
const expectedArgsCount = this.registeredArguments.length;
|
|
963
|
+
const actionArgs = args.slice(0, expectedArgsCount);
|
|
964
|
+
if (this._storeOptionsAsProperties) {
|
|
965
|
+
actionArgs[expectedArgsCount] = this;
|
|
966
|
+
} else {
|
|
967
|
+
actionArgs[expectedArgsCount] = this.opts();
|
|
968
|
+
}
|
|
969
|
+
actionArgs.push(this);
|
|
970
|
+
return fn.apply(this, actionArgs);
|
|
971
|
+
};
|
|
972
|
+
this._actionHandler = listener;
|
|
973
|
+
return this;
|
|
974
|
+
}
|
|
975
|
+
createOption(flags, description) {
|
|
976
|
+
return new Option(flags, description);
|
|
977
|
+
}
|
|
978
|
+
_callParseArg(target, value, previous, invalidArgumentMessage) {
|
|
979
|
+
try {
|
|
980
|
+
return target.parseArg(value, previous);
|
|
981
|
+
} catch (err) {
|
|
982
|
+
if (err.code === "commander.invalidArgument") {
|
|
983
|
+
const message = `${invalidArgumentMessage} ${err.message}`;
|
|
984
|
+
this.error(message, { exitCode: err.exitCode, code: err.code });
|
|
985
|
+
}
|
|
986
|
+
throw err;
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
_registerOption(option) {
|
|
990
|
+
const matchingOption = option.short && this._findOption(option.short) || option.long && this._findOption(option.long);
|
|
991
|
+
if (matchingOption) {
|
|
992
|
+
const matchingFlag = option.long && this._findOption(option.long) ? option.long : option.short;
|
|
993
|
+
throw new Error(`Cannot add option '${option.flags}'${this._name && ` to command '${this._name}'`} due to conflicting flag '${matchingFlag}'
|
|
994
|
+
- already used by option '${matchingOption.flags}'`);
|
|
995
|
+
}
|
|
996
|
+
this._initOptionGroup(option);
|
|
997
|
+
this.options.push(option);
|
|
998
|
+
}
|
|
999
|
+
_registerCommand(command) {
|
|
1000
|
+
const knownBy = (cmd) => {
|
|
1001
|
+
return [cmd.name()].concat(cmd.aliases());
|
|
1002
|
+
};
|
|
1003
|
+
const alreadyUsed = knownBy(command).find((name) => this._findCommand(name));
|
|
1004
|
+
if (alreadyUsed) {
|
|
1005
|
+
const existingCmd = knownBy(this._findCommand(alreadyUsed)).join("|");
|
|
1006
|
+
const newCmd = knownBy(command).join("|");
|
|
1007
|
+
throw new Error(`cannot add command '${newCmd}' as already have command '${existingCmd}'`);
|
|
1008
|
+
}
|
|
1009
|
+
this._initCommandGroup(command);
|
|
1010
|
+
this.commands.push(command);
|
|
1011
|
+
}
|
|
1012
|
+
addOption(option) {
|
|
1013
|
+
this._registerOption(option);
|
|
1014
|
+
const oname = option.name();
|
|
1015
|
+
const name = option.attributeName();
|
|
1016
|
+
if (option.defaultValue !== undefined) {
|
|
1017
|
+
this.setOptionValueWithSource(name, option.defaultValue, "default");
|
|
1018
|
+
}
|
|
1019
|
+
const handleOptionValue = (val, invalidValueMessage, valueSource) => {
|
|
1020
|
+
if (val == null && option.presetArg !== undefined) {
|
|
1021
|
+
val = option.presetArg;
|
|
1022
|
+
}
|
|
1023
|
+
const oldValue = this.getOptionValue(name);
|
|
1024
|
+
if (val !== null && option.parseArg) {
|
|
1025
|
+
val = this._callParseArg(option, val, oldValue, invalidValueMessage);
|
|
1026
|
+
} else if (val !== null && option.variadic) {
|
|
1027
|
+
val = option._collectValue(val, oldValue);
|
|
1028
|
+
}
|
|
1029
|
+
if (val == null) {
|
|
1030
|
+
if (option.negate) {
|
|
1031
|
+
val = false;
|
|
1032
|
+
} else if (option.isBoolean() || option.optional) {
|
|
1033
|
+
val = true;
|
|
1034
|
+
} else {
|
|
1035
|
+
val = "";
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
this.setOptionValueWithSource(name, val, valueSource);
|
|
1039
|
+
};
|
|
1040
|
+
this.on("option:" + oname, (val) => {
|
|
1041
|
+
const invalidValueMessage = `error: option '${option.flags}' argument '${val}' is invalid.`;
|
|
1042
|
+
handleOptionValue(val, invalidValueMessage, "cli");
|
|
1043
|
+
});
|
|
1044
|
+
if (option.envVar) {
|
|
1045
|
+
this.on("optionEnv:" + oname, (val) => {
|
|
1046
|
+
const invalidValueMessage = `error: option '${option.flags}' value '${val}' from env '${option.envVar}' is invalid.`;
|
|
1047
|
+
handleOptionValue(val, invalidValueMessage, "env");
|
|
1048
|
+
});
|
|
1049
|
+
}
|
|
1050
|
+
return this;
|
|
1051
|
+
}
|
|
1052
|
+
_optionEx(config, flags, description, fn, defaultValue) {
|
|
1053
|
+
if (typeof flags === "object" && flags instanceof Option) {
|
|
1054
|
+
throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");
|
|
1055
|
+
}
|
|
1056
|
+
const option = this.createOption(flags, description);
|
|
1057
|
+
option.makeOptionMandatory(!!config.mandatory);
|
|
1058
|
+
if (typeof fn === "function") {
|
|
1059
|
+
option.default(defaultValue).argParser(fn);
|
|
1060
|
+
} else if (fn instanceof RegExp) {
|
|
1061
|
+
const regex = fn;
|
|
1062
|
+
fn = (val, def) => {
|
|
1063
|
+
const m = regex.exec(val);
|
|
1064
|
+
return m ? m[0] : def;
|
|
1065
|
+
};
|
|
1066
|
+
option.default(defaultValue).argParser(fn);
|
|
1067
|
+
} else {
|
|
1068
|
+
option.default(fn);
|
|
1069
|
+
}
|
|
1070
|
+
return this.addOption(option);
|
|
1071
|
+
}
|
|
1072
|
+
option(flags, description, parseArg, defaultValue) {
|
|
1073
|
+
return this._optionEx({}, flags, description, parseArg, defaultValue);
|
|
1074
|
+
}
|
|
1075
|
+
requiredOption(flags, description, parseArg, defaultValue) {
|
|
1076
|
+
return this._optionEx({ mandatory: true }, flags, description, parseArg, defaultValue);
|
|
1077
|
+
}
|
|
1078
|
+
combineFlagAndOptionalValue(combine = true) {
|
|
1079
|
+
this._combineFlagAndOptionalValue = !!combine;
|
|
1080
|
+
return this;
|
|
1081
|
+
}
|
|
1082
|
+
allowUnknownOption(allowUnknown = true) {
|
|
1083
|
+
this._allowUnknownOption = !!allowUnknown;
|
|
1084
|
+
return this;
|
|
1085
|
+
}
|
|
1086
|
+
allowExcessArguments(allowExcess = true) {
|
|
1087
|
+
this._allowExcessArguments = !!allowExcess;
|
|
1088
|
+
return this;
|
|
1089
|
+
}
|
|
1090
|
+
enablePositionalOptions(positional = true) {
|
|
1091
|
+
this._enablePositionalOptions = !!positional;
|
|
1092
|
+
return this;
|
|
1093
|
+
}
|
|
1094
|
+
passThroughOptions(passThrough = true) {
|
|
1095
|
+
this._passThroughOptions = !!passThrough;
|
|
1096
|
+
this._checkForBrokenPassThrough();
|
|
1097
|
+
return this;
|
|
1098
|
+
}
|
|
1099
|
+
_checkForBrokenPassThrough() {
|
|
1100
|
+
if (this.parent && this._passThroughOptions && !this.parent._enablePositionalOptions) {
|
|
1101
|
+
throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`);
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
storeOptionsAsProperties(storeAsProperties = true) {
|
|
1105
|
+
if (this.options.length) {
|
|
1106
|
+
throw new Error("call .storeOptionsAsProperties() before adding options");
|
|
1107
|
+
}
|
|
1108
|
+
if (Object.keys(this._optionValues).length) {
|
|
1109
|
+
throw new Error("call .storeOptionsAsProperties() before setting option values");
|
|
1110
|
+
}
|
|
1111
|
+
this._storeOptionsAsProperties = !!storeAsProperties;
|
|
1112
|
+
return this;
|
|
1113
|
+
}
|
|
1114
|
+
getOptionValue(key) {
|
|
1115
|
+
if (this._storeOptionsAsProperties) {
|
|
1116
|
+
return this[key];
|
|
1117
|
+
}
|
|
1118
|
+
return this._optionValues[key];
|
|
1119
|
+
}
|
|
1120
|
+
setOptionValue(key, value) {
|
|
1121
|
+
return this.setOptionValueWithSource(key, value, undefined);
|
|
1122
|
+
}
|
|
1123
|
+
setOptionValueWithSource(key, value, source) {
|
|
1124
|
+
if (this._storeOptionsAsProperties) {
|
|
1125
|
+
this[key] = value;
|
|
1126
|
+
} else {
|
|
1127
|
+
this._optionValues[key] = value;
|
|
1128
|
+
}
|
|
1129
|
+
this._optionValueSources[key] = source;
|
|
1130
|
+
return this;
|
|
1131
|
+
}
|
|
1132
|
+
getOptionValueSource(key) {
|
|
1133
|
+
return this._optionValueSources[key];
|
|
1134
|
+
}
|
|
1135
|
+
getOptionValueSourceWithGlobals(key) {
|
|
1136
|
+
let source;
|
|
1137
|
+
this._getCommandAndAncestors().forEach((cmd) => {
|
|
1138
|
+
if (cmd.getOptionValueSource(key) !== undefined) {
|
|
1139
|
+
source = cmd.getOptionValueSource(key);
|
|
1140
|
+
}
|
|
1141
|
+
});
|
|
1142
|
+
return source;
|
|
1143
|
+
}
|
|
1144
|
+
_prepareUserArgs(argv, parseOptions) {
|
|
1145
|
+
if (argv !== undefined && !Array.isArray(argv)) {
|
|
1146
|
+
throw new Error("first parameter to parse must be array or undefined");
|
|
1147
|
+
}
|
|
1148
|
+
parseOptions = parseOptions || {};
|
|
1149
|
+
if (argv === undefined && parseOptions.from === undefined) {
|
|
1150
|
+
if (process2.versions?.electron) {
|
|
1151
|
+
parseOptions.from = "electron";
|
|
1152
|
+
}
|
|
1153
|
+
const execArgv = process2.execArgv ?? [];
|
|
1154
|
+
if (execArgv.includes("-e") || execArgv.includes("--eval") || execArgv.includes("-p") || execArgv.includes("--print")) {
|
|
1155
|
+
parseOptions.from = "eval";
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
if (argv === undefined) {
|
|
1159
|
+
argv = process2.argv;
|
|
1160
|
+
}
|
|
1161
|
+
this.rawArgs = argv.slice();
|
|
1162
|
+
let userArgs;
|
|
1163
|
+
switch (parseOptions.from) {
|
|
1164
|
+
case undefined:
|
|
1165
|
+
case "node":
|
|
1166
|
+
this._scriptPath = argv[1];
|
|
1167
|
+
userArgs = argv.slice(2);
|
|
1168
|
+
break;
|
|
1169
|
+
case "electron":
|
|
1170
|
+
if (process2.defaultApp) {
|
|
1171
|
+
this._scriptPath = argv[1];
|
|
1172
|
+
userArgs = argv.slice(2);
|
|
1173
|
+
} else {
|
|
1174
|
+
userArgs = argv.slice(1);
|
|
1175
|
+
}
|
|
1176
|
+
break;
|
|
1177
|
+
case "user":
|
|
1178
|
+
userArgs = argv.slice(0);
|
|
1179
|
+
break;
|
|
1180
|
+
case "eval":
|
|
1181
|
+
userArgs = argv.slice(1);
|
|
1182
|
+
break;
|
|
1183
|
+
default:
|
|
1184
|
+
throw new Error(`unexpected parse option { from: '${parseOptions.from}' }`);
|
|
1185
|
+
}
|
|
1186
|
+
if (!this._name && this._scriptPath)
|
|
1187
|
+
this.nameFromFilename(this._scriptPath);
|
|
1188
|
+
this._name = this._name || "program";
|
|
1189
|
+
return userArgs;
|
|
1190
|
+
}
|
|
1191
|
+
parse(argv, parseOptions) {
|
|
1192
|
+
this._prepareForParse();
|
|
1193
|
+
const userArgs = this._prepareUserArgs(argv, parseOptions);
|
|
1194
|
+
this._parseCommand([], userArgs);
|
|
1195
|
+
return this;
|
|
1196
|
+
}
|
|
1197
|
+
async parseAsync(argv, parseOptions) {
|
|
1198
|
+
this._prepareForParse();
|
|
1199
|
+
const userArgs = this._prepareUserArgs(argv, parseOptions);
|
|
1200
|
+
await this._parseCommand([], userArgs);
|
|
1201
|
+
return this;
|
|
1202
|
+
}
|
|
1203
|
+
_prepareForParse() {
|
|
1204
|
+
if (this._savedState === null) {
|
|
1205
|
+
this.options.filter((option) => option.negate && option.defaultValue === undefined && this.getOptionValue(option.attributeName()) === undefined).forEach((option) => {
|
|
1206
|
+
const positiveLongFlag = option.long.replace(/^--no-/, "--");
|
|
1207
|
+
if (!this._findOption(positiveLongFlag)) {
|
|
1208
|
+
this.setOptionValueWithSource(option.attributeName(), true, "default");
|
|
1209
|
+
}
|
|
1210
|
+
});
|
|
1211
|
+
this.saveStateBeforeParse();
|
|
1212
|
+
} else {
|
|
1213
|
+
this.restoreStateBeforeParse();
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
saveStateBeforeParse() {
|
|
1217
|
+
this._savedState = {
|
|
1218
|
+
_name: this._name,
|
|
1219
|
+
_optionValues: { ...this._optionValues },
|
|
1220
|
+
_optionValueSources: { ...this._optionValueSources }
|
|
1221
|
+
};
|
|
1222
|
+
}
|
|
1223
|
+
restoreStateBeforeParse() {
|
|
1224
|
+
if (this._storeOptionsAsProperties)
|
|
1225
|
+
throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
1226
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);
|
|
1227
|
+
this._name = this._savedState._name;
|
|
1228
|
+
this._scriptPath = null;
|
|
1229
|
+
this.rawArgs = [];
|
|
1230
|
+
this._optionValues = { ...this._savedState._optionValues };
|
|
1231
|
+
this._optionValueSources = { ...this._savedState._optionValueSources };
|
|
1232
|
+
this.args = [];
|
|
1233
|
+
this.processedArgs = [];
|
|
1234
|
+
}
|
|
1235
|
+
_checkForMissingExecutable(executableFile, executableDir, subcommandName) {
|
|
1236
|
+
if (fs.existsSync(executableFile))
|
|
1237
|
+
return;
|
|
1238
|
+
const executableDirMessage = executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory";
|
|
1239
|
+
const executableMissing = `'${executableFile}' does not exist
|
|
1240
|
+
- if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
1241
|
+
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
1242
|
+
- ${executableDirMessage}`;
|
|
1243
|
+
throw new Error(executableMissing);
|
|
1244
|
+
}
|
|
1245
|
+
_executeSubCommand(subcommand, args) {
|
|
1246
|
+
args = args.slice();
|
|
1247
|
+
const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
1248
|
+
function findFile(baseDir, baseName) {
|
|
1249
|
+
const localBin = path.resolve(baseDir, baseName);
|
|
1250
|
+
if (fs.existsSync(localBin))
|
|
1251
|
+
return localBin;
|
|
1252
|
+
if (sourceExt.includes(path.extname(baseName)))
|
|
1253
|
+
return;
|
|
1254
|
+
const foundExt = sourceExt.find((ext) => fs.existsSync(`${localBin}${ext}`));
|
|
1255
|
+
if (foundExt)
|
|
1256
|
+
return `${localBin}${foundExt}`;
|
|
1257
|
+
return;
|
|
1258
|
+
}
|
|
1259
|
+
this._checkForMissingMandatoryOptions();
|
|
1260
|
+
this._checkForConflictingOptions();
|
|
1261
|
+
let executableFile = subcommand._executableFile || `${this._name}-${subcommand._name}`;
|
|
1262
|
+
let executableDir = this._executableDir || "";
|
|
1263
|
+
if (this._scriptPath) {
|
|
1264
|
+
let resolvedScriptPath;
|
|
1265
|
+
try {
|
|
1266
|
+
resolvedScriptPath = fs.realpathSync(this._scriptPath);
|
|
1267
|
+
} catch {
|
|
1268
|
+
resolvedScriptPath = this._scriptPath;
|
|
1269
|
+
}
|
|
1270
|
+
executableDir = path.resolve(path.dirname(resolvedScriptPath), executableDir);
|
|
1271
|
+
}
|
|
1272
|
+
if (executableDir) {
|
|
1273
|
+
let localFile = findFile(executableDir, executableFile);
|
|
1274
|
+
if (!localFile && !subcommand._executableFile && this._scriptPath) {
|
|
1275
|
+
const legacyName = path.basename(this._scriptPath, path.extname(this._scriptPath));
|
|
1276
|
+
if (legacyName !== this._name) {
|
|
1277
|
+
localFile = findFile(executableDir, `${legacyName}-${subcommand._name}`);
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
executableFile = localFile || executableFile;
|
|
1281
|
+
}
|
|
1282
|
+
const launchWithNode = sourceExt.includes(path.extname(executableFile));
|
|
1283
|
+
let proc;
|
|
1284
|
+
if (process2.platform !== "win32") {
|
|
1285
|
+
if (launchWithNode) {
|
|
1286
|
+
args.unshift(executableFile);
|
|
1287
|
+
args = incrementNodeInspectorPort(process2.execArgv).concat(args);
|
|
1288
|
+
proc = childProcess.spawn(process2.argv[0], args, { stdio: "inherit" });
|
|
1289
|
+
} else {
|
|
1290
|
+
proc = childProcess.spawn(executableFile, args, { stdio: "inherit" });
|
|
1291
|
+
}
|
|
1292
|
+
} else {
|
|
1293
|
+
this._checkForMissingExecutable(executableFile, executableDir, subcommand._name);
|
|
1294
|
+
args.unshift(executableFile);
|
|
1295
|
+
args = incrementNodeInspectorPort(process2.execArgv).concat(args);
|
|
1296
|
+
proc = childProcess.spawn(process2.execPath, args, { stdio: "inherit" });
|
|
1297
|
+
}
|
|
1298
|
+
if (!proc.killed) {
|
|
1299
|
+
const signals = ["SIGUSR1", "SIGUSR2", "SIGTERM", "SIGINT", "SIGHUP"];
|
|
1300
|
+
signals.forEach((signal) => {
|
|
1301
|
+
process2.on(signal, () => {
|
|
1302
|
+
if (proc.killed === false && proc.exitCode === null) {
|
|
1303
|
+
proc.kill(signal);
|
|
1304
|
+
}
|
|
1305
|
+
});
|
|
1306
|
+
});
|
|
1307
|
+
}
|
|
1308
|
+
const exitCallback = this._exitCallback;
|
|
1309
|
+
proc.on("close", (code) => {
|
|
1310
|
+
code = code ?? 1;
|
|
1311
|
+
if (!exitCallback) {
|
|
1312
|
+
process2.exit(code);
|
|
1313
|
+
} else {
|
|
1314
|
+
exitCallback(new CommanderError(code, "commander.executeSubCommandAsync", "(close)"));
|
|
1315
|
+
}
|
|
1316
|
+
});
|
|
1317
|
+
proc.on("error", (err) => {
|
|
1318
|
+
if (err.code === "ENOENT") {
|
|
1319
|
+
this._checkForMissingExecutable(executableFile, executableDir, subcommand._name);
|
|
1320
|
+
} else if (err.code === "EACCES") {
|
|
1321
|
+
throw new Error(`'${executableFile}' not executable`);
|
|
1322
|
+
}
|
|
1323
|
+
if (!exitCallback) {
|
|
1324
|
+
process2.exit(1);
|
|
1325
|
+
} else {
|
|
1326
|
+
const wrappedError = new CommanderError(1, "commander.executeSubCommandAsync", "(error)");
|
|
1327
|
+
wrappedError.nestedError = err;
|
|
1328
|
+
exitCallback(wrappedError);
|
|
1329
|
+
}
|
|
1330
|
+
});
|
|
1331
|
+
this.runningCommand = proc;
|
|
1332
|
+
}
|
|
1333
|
+
_dispatchSubcommand(commandName, operands, unknown) {
|
|
1334
|
+
const subCommand = this._findCommand(commandName);
|
|
1335
|
+
if (!subCommand)
|
|
1336
|
+
this.help({ error: true });
|
|
1337
|
+
subCommand._prepareForParse();
|
|
1338
|
+
let promiseChain;
|
|
1339
|
+
promiseChain = this._chainOrCallSubCommandHook(promiseChain, subCommand, "preSubcommand");
|
|
1340
|
+
promiseChain = this._chainOrCall(promiseChain, () => {
|
|
1341
|
+
if (subCommand._executableHandler) {
|
|
1342
|
+
this._executeSubCommand(subCommand, operands.concat(unknown));
|
|
1343
|
+
} else {
|
|
1344
|
+
return subCommand._parseCommand(operands, unknown);
|
|
1345
|
+
}
|
|
1346
|
+
});
|
|
1347
|
+
return promiseChain;
|
|
1348
|
+
}
|
|
1349
|
+
_dispatchHelpCommand(subcommandName) {
|
|
1350
|
+
if (!subcommandName) {
|
|
1351
|
+
this.help();
|
|
1352
|
+
}
|
|
1353
|
+
const subCommand = this._findCommand(subcommandName);
|
|
1354
|
+
if (subCommand && !subCommand._executableHandler) {
|
|
1355
|
+
subCommand.help();
|
|
1356
|
+
}
|
|
1357
|
+
return this._dispatchSubcommand(subcommandName, [], [this._getHelpOption()?.long ?? this._getHelpOption()?.short ?? "--help"]);
|
|
1358
|
+
}
|
|
1359
|
+
_checkNumberOfArguments() {
|
|
1360
|
+
this.registeredArguments.forEach((arg, i) => {
|
|
1361
|
+
if (arg.required && this.args[i] == null) {
|
|
1362
|
+
this.missingArgument(arg.name());
|
|
1363
|
+
}
|
|
1364
|
+
});
|
|
1365
|
+
if (this.registeredArguments.length > 0 && this.registeredArguments[this.registeredArguments.length - 1].variadic) {
|
|
1366
|
+
return;
|
|
1367
|
+
}
|
|
1368
|
+
if (this.args.length > this.registeredArguments.length) {
|
|
1369
|
+
this._excessArguments(this.args);
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
_processArguments() {
|
|
1373
|
+
const myParseArg = (argument, value, previous) => {
|
|
1374
|
+
let parsedValue = value;
|
|
1375
|
+
if (value !== null && argument.parseArg) {
|
|
1376
|
+
const invalidValueMessage = `error: command-argument value '${value}' is invalid for argument '${argument.name()}'.`;
|
|
1377
|
+
parsedValue = this._callParseArg(argument, value, previous, invalidValueMessage);
|
|
1378
|
+
}
|
|
1379
|
+
return parsedValue;
|
|
1380
|
+
};
|
|
1381
|
+
this._checkNumberOfArguments();
|
|
1382
|
+
const processedArgs = [];
|
|
1383
|
+
this.registeredArguments.forEach((declaredArg, index) => {
|
|
1384
|
+
let value = declaredArg.defaultValue;
|
|
1385
|
+
if (declaredArg.variadic) {
|
|
1386
|
+
if (index < this.args.length) {
|
|
1387
|
+
value = this.args.slice(index);
|
|
1388
|
+
if (declaredArg.parseArg) {
|
|
1389
|
+
value = value.reduce((processed, v) => {
|
|
1390
|
+
return myParseArg(declaredArg, v, processed);
|
|
1391
|
+
}, declaredArg.defaultValue);
|
|
1392
|
+
}
|
|
1393
|
+
} else if (value === undefined) {
|
|
1394
|
+
value = [];
|
|
1395
|
+
}
|
|
1396
|
+
} else if (index < this.args.length) {
|
|
1397
|
+
value = this.args[index];
|
|
1398
|
+
if (declaredArg.parseArg) {
|
|
1399
|
+
value = myParseArg(declaredArg, value, declaredArg.defaultValue);
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
processedArgs[index] = value;
|
|
1403
|
+
});
|
|
1404
|
+
this.processedArgs = processedArgs;
|
|
1405
|
+
}
|
|
1406
|
+
_chainOrCall(promise, fn) {
|
|
1407
|
+
if (promise?.then && typeof promise.then === "function") {
|
|
1408
|
+
return promise.then(() => fn());
|
|
1409
|
+
}
|
|
1410
|
+
return fn();
|
|
1411
|
+
}
|
|
1412
|
+
_chainOrCallHooks(promise, event) {
|
|
1413
|
+
let result = promise;
|
|
1414
|
+
const hooks = [];
|
|
1415
|
+
this._getCommandAndAncestors().reverse().filter((cmd) => cmd._lifeCycleHooks[event] !== undefined).forEach((hookedCommand) => {
|
|
1416
|
+
hookedCommand._lifeCycleHooks[event].forEach((callback) => {
|
|
1417
|
+
hooks.push({ hookedCommand, callback });
|
|
1418
|
+
});
|
|
1419
|
+
});
|
|
1420
|
+
if (event === "postAction") {
|
|
1421
|
+
hooks.reverse();
|
|
1422
|
+
}
|
|
1423
|
+
hooks.forEach((hookDetail) => {
|
|
1424
|
+
result = this._chainOrCall(result, () => {
|
|
1425
|
+
return hookDetail.callback(hookDetail.hookedCommand, this);
|
|
1426
|
+
});
|
|
1427
|
+
});
|
|
1428
|
+
return result;
|
|
1429
|
+
}
|
|
1430
|
+
_chainOrCallSubCommandHook(promise, subCommand, event) {
|
|
1431
|
+
let result = promise;
|
|
1432
|
+
if (this._lifeCycleHooks[event] !== undefined) {
|
|
1433
|
+
this._lifeCycleHooks[event].forEach((hook) => {
|
|
1434
|
+
result = this._chainOrCall(result, () => {
|
|
1435
|
+
return hook(this, subCommand);
|
|
1436
|
+
});
|
|
1437
|
+
});
|
|
1438
|
+
}
|
|
1439
|
+
return result;
|
|
1440
|
+
}
|
|
1441
|
+
_parseCommand(operands, unknown) {
|
|
1442
|
+
const parsed = this.parseOptions(unknown);
|
|
1443
|
+
this._parseOptionsEnv();
|
|
1444
|
+
this._parseOptionsImplied();
|
|
1445
|
+
operands = operands.concat(parsed.operands);
|
|
1446
|
+
unknown = parsed.unknown;
|
|
1447
|
+
this.args = operands.concat(unknown);
|
|
1448
|
+
if (operands && this._findCommand(operands[0])) {
|
|
1449
|
+
return this._dispatchSubcommand(operands[0], operands.slice(1), unknown);
|
|
1450
|
+
}
|
|
1451
|
+
if (this._getHelpCommand() && operands[0] === this._getHelpCommand().name()) {
|
|
1452
|
+
return this._dispatchHelpCommand(operands[1]);
|
|
1453
|
+
}
|
|
1454
|
+
if (this._defaultCommandName) {
|
|
1455
|
+
this._outputHelpIfRequested(unknown);
|
|
1456
|
+
return this._dispatchSubcommand(this._defaultCommandName, operands, unknown);
|
|
1457
|
+
}
|
|
1458
|
+
if (this.commands.length && this.args.length === 0 && !this._actionHandler && !this._defaultCommandName) {
|
|
1459
|
+
this.help({ error: true });
|
|
1460
|
+
}
|
|
1461
|
+
this._outputHelpIfRequested(parsed.unknown);
|
|
1462
|
+
this._checkForMissingMandatoryOptions();
|
|
1463
|
+
this._checkForConflictingOptions();
|
|
1464
|
+
const checkForUnknownOptions = () => {
|
|
1465
|
+
if (parsed.unknown.length > 0) {
|
|
1466
|
+
this.unknownOption(parsed.unknown[0]);
|
|
1467
|
+
}
|
|
1468
|
+
};
|
|
1469
|
+
const commandEvent = `command:${this.name()}`;
|
|
1470
|
+
if (this._actionHandler) {
|
|
1471
|
+
checkForUnknownOptions();
|
|
1472
|
+
this._processArguments();
|
|
1473
|
+
let promiseChain;
|
|
1474
|
+
promiseChain = this._chainOrCallHooks(promiseChain, "preAction");
|
|
1475
|
+
promiseChain = this._chainOrCall(promiseChain, () => this._actionHandler(this.processedArgs));
|
|
1476
|
+
if (this.parent) {
|
|
1477
|
+
promiseChain = this._chainOrCall(promiseChain, () => {
|
|
1478
|
+
this.parent.emit(commandEvent, operands, unknown);
|
|
1479
|
+
});
|
|
1480
|
+
}
|
|
1481
|
+
promiseChain = this._chainOrCallHooks(promiseChain, "postAction");
|
|
1482
|
+
return promiseChain;
|
|
1483
|
+
}
|
|
1484
|
+
if (this.parent?.listenerCount(commandEvent)) {
|
|
1485
|
+
checkForUnknownOptions();
|
|
1486
|
+
this._processArguments();
|
|
1487
|
+
this.parent.emit(commandEvent, operands, unknown);
|
|
1488
|
+
} else if (operands.length) {
|
|
1489
|
+
if (this._findCommand("*")) {
|
|
1490
|
+
return this._dispatchSubcommand("*", operands, unknown);
|
|
1491
|
+
}
|
|
1492
|
+
if (this.listenerCount("command:*")) {
|
|
1493
|
+
this.emit("command:*", operands, unknown);
|
|
1494
|
+
} else if (this.commands.length) {
|
|
1495
|
+
this.unknownCommand();
|
|
1496
|
+
} else {
|
|
1497
|
+
checkForUnknownOptions();
|
|
1498
|
+
this._processArguments();
|
|
1499
|
+
}
|
|
1500
|
+
} else if (this.commands.length) {
|
|
1501
|
+
checkForUnknownOptions();
|
|
1502
|
+
this.help({ error: true });
|
|
1503
|
+
} else {
|
|
1504
|
+
checkForUnknownOptions();
|
|
1505
|
+
this._processArguments();
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
_findCommand(name) {
|
|
1509
|
+
if (!name)
|
|
1510
|
+
return;
|
|
1511
|
+
return this.commands.find((cmd) => cmd._name === name || cmd._aliases.includes(name));
|
|
1512
|
+
}
|
|
1513
|
+
_findOption(arg) {
|
|
1514
|
+
return this.options.find((option) => option.is(arg));
|
|
1515
|
+
}
|
|
1516
|
+
_checkForMissingMandatoryOptions() {
|
|
1517
|
+
this._getCommandAndAncestors().forEach((cmd) => {
|
|
1518
|
+
cmd.options.forEach((anOption) => {
|
|
1519
|
+
if (anOption.mandatory && cmd.getOptionValue(anOption.attributeName()) === undefined) {
|
|
1520
|
+
cmd.missingMandatoryOptionValue(anOption);
|
|
1521
|
+
}
|
|
1522
|
+
});
|
|
1523
|
+
});
|
|
1524
|
+
}
|
|
1525
|
+
_checkForConflictingLocalOptions() {
|
|
1526
|
+
const definedNonDefaultOptions = this.options.filter((option) => {
|
|
1527
|
+
const optionKey = option.attributeName();
|
|
1528
|
+
if (this.getOptionValue(optionKey) === undefined) {
|
|
1529
|
+
return false;
|
|
1530
|
+
}
|
|
1531
|
+
return this.getOptionValueSource(optionKey) !== "default";
|
|
1532
|
+
});
|
|
1533
|
+
const optionsWithConflicting = definedNonDefaultOptions.filter((option) => option.conflictsWith.length > 0);
|
|
1534
|
+
optionsWithConflicting.forEach((option) => {
|
|
1535
|
+
const conflictingAndDefined = definedNonDefaultOptions.find((defined) => option.conflictsWith.includes(defined.attributeName()));
|
|
1536
|
+
if (conflictingAndDefined) {
|
|
1537
|
+
this._conflictingOption(option, conflictingAndDefined);
|
|
1538
|
+
}
|
|
1539
|
+
});
|
|
1540
|
+
}
|
|
1541
|
+
_checkForConflictingOptions() {
|
|
1542
|
+
this._getCommandAndAncestors().forEach((cmd) => {
|
|
1543
|
+
cmd._checkForConflictingLocalOptions();
|
|
1544
|
+
});
|
|
1545
|
+
}
|
|
1546
|
+
parseOptions(args) {
|
|
1547
|
+
const operands = [];
|
|
1548
|
+
const unknown = [];
|
|
1549
|
+
let dest = operands;
|
|
1550
|
+
function maybeOption(arg) {
|
|
1551
|
+
return arg.length > 1 && arg[0] === "-";
|
|
1552
|
+
}
|
|
1553
|
+
const negativeNumberArg = (arg) => {
|
|
1554
|
+
if (!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(arg))
|
|
1555
|
+
return false;
|
|
1556
|
+
return !this._getCommandAndAncestors().some((cmd) => cmd.options.map((opt) => opt.short).some((short) => /^-\d$/.test(short)));
|
|
1557
|
+
};
|
|
1558
|
+
let activeVariadicOption = null;
|
|
1559
|
+
let activeGroup = null;
|
|
1560
|
+
let i = 0;
|
|
1561
|
+
while (i < args.length || activeGroup) {
|
|
1562
|
+
const arg = activeGroup ?? args[i++];
|
|
1563
|
+
activeGroup = null;
|
|
1564
|
+
if (arg === "--") {
|
|
1565
|
+
if (dest === unknown)
|
|
1566
|
+
dest.push(arg);
|
|
1567
|
+
dest.push(...args.slice(i));
|
|
1568
|
+
break;
|
|
1569
|
+
}
|
|
1570
|
+
if (activeVariadicOption && (!maybeOption(arg) || negativeNumberArg(arg))) {
|
|
1571
|
+
this.emit(`option:${activeVariadicOption.name()}`, arg);
|
|
1572
|
+
continue;
|
|
1573
|
+
}
|
|
1574
|
+
activeVariadicOption = null;
|
|
1575
|
+
if (maybeOption(arg)) {
|
|
1576
|
+
const option = this._findOption(arg);
|
|
1577
|
+
if (option) {
|
|
1578
|
+
if (option.required) {
|
|
1579
|
+
const value = args[i++];
|
|
1580
|
+
if (value === undefined)
|
|
1581
|
+
this.optionMissingArgument(option);
|
|
1582
|
+
this.emit(`option:${option.name()}`, value);
|
|
1583
|
+
} else if (option.optional) {
|
|
1584
|
+
let value = null;
|
|
1585
|
+
if (i < args.length && (!maybeOption(args[i]) || negativeNumberArg(args[i]))) {
|
|
1586
|
+
value = args[i++];
|
|
1587
|
+
}
|
|
1588
|
+
this.emit(`option:${option.name()}`, value);
|
|
1589
|
+
} else {
|
|
1590
|
+
this.emit(`option:${option.name()}`);
|
|
1591
|
+
}
|
|
1592
|
+
activeVariadicOption = option.variadic ? option : null;
|
|
1593
|
+
continue;
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
if (arg.length > 2 && arg[0] === "-" && arg[1] !== "-") {
|
|
1597
|
+
const option = this._findOption(`-${arg[1]}`);
|
|
1598
|
+
if (option) {
|
|
1599
|
+
if (option.required || option.optional && this._combineFlagAndOptionalValue) {
|
|
1600
|
+
this.emit(`option:${option.name()}`, arg.slice(2));
|
|
1601
|
+
} else {
|
|
1602
|
+
this.emit(`option:${option.name()}`);
|
|
1603
|
+
activeGroup = `-${arg.slice(2)}`;
|
|
1604
|
+
}
|
|
1605
|
+
continue;
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
if (/^--[^=]+=/.test(arg)) {
|
|
1609
|
+
const index = arg.indexOf("=");
|
|
1610
|
+
const option = this._findOption(arg.slice(0, index));
|
|
1611
|
+
if (option && (option.required || option.optional)) {
|
|
1612
|
+
this.emit(`option:${option.name()}`, arg.slice(index + 1));
|
|
1613
|
+
continue;
|
|
1614
|
+
}
|
|
1615
|
+
}
|
|
1616
|
+
if (dest === operands && maybeOption(arg) && !(this.commands.length === 0 && negativeNumberArg(arg))) {
|
|
1617
|
+
dest = unknown;
|
|
1618
|
+
}
|
|
1619
|
+
if ((this._enablePositionalOptions || this._passThroughOptions) && operands.length === 0 && unknown.length === 0) {
|
|
1620
|
+
if (this._findCommand(arg)) {
|
|
1621
|
+
operands.push(arg);
|
|
1622
|
+
unknown.push(...args.slice(i));
|
|
1623
|
+
break;
|
|
1624
|
+
} else if (this._getHelpCommand() && arg === this._getHelpCommand().name()) {
|
|
1625
|
+
operands.push(arg, ...args.slice(i));
|
|
1626
|
+
break;
|
|
1627
|
+
} else if (this._defaultCommandName) {
|
|
1628
|
+
unknown.push(arg, ...args.slice(i));
|
|
1629
|
+
break;
|
|
1630
|
+
}
|
|
1631
|
+
}
|
|
1632
|
+
if (this._passThroughOptions) {
|
|
1633
|
+
dest.push(arg, ...args.slice(i));
|
|
1634
|
+
break;
|
|
1635
|
+
}
|
|
1636
|
+
dest.push(arg);
|
|
1637
|
+
}
|
|
1638
|
+
return { operands, unknown };
|
|
1639
|
+
}
|
|
1640
|
+
opts() {
|
|
1641
|
+
if (this._storeOptionsAsProperties) {
|
|
1642
|
+
const result = {};
|
|
1643
|
+
const len = this.options.length;
|
|
1644
|
+
for (let i = 0;i < len; i++) {
|
|
1645
|
+
const key = this.options[i].attributeName();
|
|
1646
|
+
result[key] = key === this._versionOptionName ? this._version : this[key];
|
|
1647
|
+
}
|
|
1648
|
+
return result;
|
|
1649
|
+
}
|
|
1650
|
+
return this._optionValues;
|
|
1651
|
+
}
|
|
1652
|
+
optsWithGlobals() {
|
|
1653
|
+
return this._getCommandAndAncestors().reduce((combinedOptions, cmd) => Object.assign(combinedOptions, cmd.opts()), {});
|
|
1654
|
+
}
|
|
1655
|
+
error(message, errorOptions) {
|
|
1656
|
+
this._outputConfiguration.outputError(`${message}
|
|
1657
|
+
`, this._outputConfiguration.writeErr);
|
|
1658
|
+
if (typeof this._showHelpAfterError === "string") {
|
|
1659
|
+
this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
1660
|
+
`);
|
|
1661
|
+
} else if (this._showHelpAfterError) {
|
|
1662
|
+
this._outputConfiguration.writeErr(`
|
|
1663
|
+
`);
|
|
1664
|
+
this.outputHelp({ error: true });
|
|
1665
|
+
}
|
|
1666
|
+
const config = errorOptions || {};
|
|
1667
|
+
const exitCode = config.exitCode || 1;
|
|
1668
|
+
const code = config.code || "commander.error";
|
|
1669
|
+
this._exit(exitCode, code, message);
|
|
1670
|
+
}
|
|
1671
|
+
_parseOptionsEnv() {
|
|
1672
|
+
this.options.forEach((option) => {
|
|
1673
|
+
if (option.envVar && option.envVar in process2.env) {
|
|
1674
|
+
const optionKey = option.attributeName();
|
|
1675
|
+
if (this.getOptionValue(optionKey) === undefined || ["default", "config", "env"].includes(this.getOptionValueSource(optionKey))) {
|
|
1676
|
+
if (option.required || option.optional) {
|
|
1677
|
+
this.emit(`optionEnv:${option.name()}`, process2.env[option.envVar]);
|
|
1678
|
+
} else {
|
|
1679
|
+
this.emit(`optionEnv:${option.name()}`);
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
});
|
|
1684
|
+
}
|
|
1685
|
+
_parseOptionsImplied() {
|
|
1686
|
+
const dualHelper = new DualOptions(this.options);
|
|
1687
|
+
const hasCustomOptionValue = (optionKey) => {
|
|
1688
|
+
return this.getOptionValue(optionKey) !== undefined && !["default", "implied"].includes(this.getOptionValueSource(optionKey));
|
|
1689
|
+
};
|
|
1690
|
+
this.options.filter((option) => option.implied !== undefined && hasCustomOptionValue(option.attributeName()) && dualHelper.valueFromOption(this.getOptionValue(option.attributeName()), option)).forEach((option) => {
|
|
1691
|
+
Object.keys(option.implied).filter((impliedKey) => !hasCustomOptionValue(impliedKey)).forEach((impliedKey) => {
|
|
1692
|
+
this.setOptionValueWithSource(impliedKey, option.implied[impliedKey], "implied");
|
|
1693
|
+
});
|
|
1694
|
+
});
|
|
1695
|
+
}
|
|
1696
|
+
missingArgument(name) {
|
|
1697
|
+
const message = `error: missing required argument '${name}'`;
|
|
1698
|
+
this.error(message, { code: "commander.missingArgument" });
|
|
1699
|
+
}
|
|
1700
|
+
optionMissingArgument(option) {
|
|
1701
|
+
const message = `error: option '${option.flags}' argument missing`;
|
|
1702
|
+
this.error(message, { code: "commander.optionMissingArgument" });
|
|
1703
|
+
}
|
|
1704
|
+
missingMandatoryOptionValue(option) {
|
|
1705
|
+
const message = `error: required option '${option.flags}' not specified`;
|
|
1706
|
+
this.error(message, { code: "commander.missingMandatoryOptionValue" });
|
|
1707
|
+
}
|
|
1708
|
+
_conflictingOption(option, conflictingOption) {
|
|
1709
|
+
const findBestOptionFromValue = (option) => {
|
|
1710
|
+
const optionKey = option.attributeName();
|
|
1711
|
+
const optionValue = this.getOptionValue(optionKey);
|
|
1712
|
+
const negativeOption = this.options.find((target) => target.negate && optionKey === target.attributeName());
|
|
1713
|
+
const positiveOption = this.options.find((target) => !target.negate && optionKey === target.attributeName());
|
|
1714
|
+
if (negativeOption && (negativeOption.presetArg === undefined && optionValue === false || negativeOption.presetArg !== undefined && optionValue === negativeOption.presetArg)) {
|
|
1715
|
+
return negativeOption;
|
|
1716
|
+
}
|
|
1717
|
+
return positiveOption || option;
|
|
1718
|
+
};
|
|
1719
|
+
const getErrorMessage = (option) => {
|
|
1720
|
+
const bestOption = findBestOptionFromValue(option);
|
|
1721
|
+
const optionKey = bestOption.attributeName();
|
|
1722
|
+
const source = this.getOptionValueSource(optionKey);
|
|
1723
|
+
if (source === "env") {
|
|
1724
|
+
return `environment variable '${bestOption.envVar}'`;
|
|
1725
|
+
}
|
|
1726
|
+
return `option '${bestOption.flags}'`;
|
|
1727
|
+
};
|
|
1728
|
+
const message = `error: ${getErrorMessage(option)} cannot be used with ${getErrorMessage(conflictingOption)}`;
|
|
1729
|
+
this.error(message, { code: "commander.conflictingOption" });
|
|
1730
|
+
}
|
|
1731
|
+
unknownOption(flag) {
|
|
1732
|
+
if (this._allowUnknownOption)
|
|
1733
|
+
return;
|
|
1734
|
+
let suggestion = "";
|
|
1735
|
+
if (flag.startsWith("--") && this._showSuggestionAfterError) {
|
|
1736
|
+
let candidateFlags = [];
|
|
1737
|
+
let command = this;
|
|
1738
|
+
do {
|
|
1739
|
+
const moreFlags = command.createHelp().visibleOptions(command).filter((option) => option.long).map((option) => option.long);
|
|
1740
|
+
candidateFlags = candidateFlags.concat(moreFlags);
|
|
1741
|
+
command = command.parent;
|
|
1742
|
+
} while (command && !command._enablePositionalOptions);
|
|
1743
|
+
suggestion = suggestSimilar(flag, candidateFlags);
|
|
1744
|
+
}
|
|
1745
|
+
const message = `error: unknown option '${flag}'${suggestion}`;
|
|
1746
|
+
this.error(message, { code: "commander.unknownOption" });
|
|
1747
|
+
}
|
|
1748
|
+
_excessArguments(receivedArgs) {
|
|
1749
|
+
if (this._allowExcessArguments)
|
|
1750
|
+
return;
|
|
1751
|
+
const expected = this.registeredArguments.length;
|
|
1752
|
+
const s = expected === 1 ? "" : "s";
|
|
1753
|
+
const received = receivedArgs.length;
|
|
1754
|
+
const forSubcommand = this.parent ? ` for '${this.name()}'` : "";
|
|
1755
|
+
const details = receivedArgs.join(", ");
|
|
1756
|
+
const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${received}: ${details}.`;
|
|
1757
|
+
this.error(message, { code: "commander.excessArguments" });
|
|
1758
|
+
}
|
|
1759
|
+
unknownCommand() {
|
|
1760
|
+
const unknownName = this.args[0];
|
|
1761
|
+
let suggestion = "";
|
|
1762
|
+
if (this._showSuggestionAfterError) {
|
|
1763
|
+
const candidateNames = [];
|
|
1764
|
+
this.createHelp().visibleCommands(this).forEach((command) => {
|
|
1765
|
+
candidateNames.push(command.name());
|
|
1766
|
+
if (command.alias())
|
|
1767
|
+
candidateNames.push(command.alias());
|
|
1768
|
+
});
|
|
1769
|
+
suggestion = suggestSimilar(unknownName, candidateNames);
|
|
1770
|
+
}
|
|
1771
|
+
const message = `error: unknown command '${unknownName}'${suggestion}`;
|
|
1772
|
+
this.error(message, { code: "commander.unknownCommand" });
|
|
1773
|
+
}
|
|
1774
|
+
version(str, flags, description) {
|
|
1775
|
+
if (str === undefined)
|
|
1776
|
+
return this._version;
|
|
1777
|
+
this._version = str;
|
|
1778
|
+
flags = flags || "-V, --version";
|
|
1779
|
+
description = description || "output the version number";
|
|
1780
|
+
const versionOption = this.createOption(flags, description);
|
|
1781
|
+
this._versionOptionName = versionOption.attributeName();
|
|
1782
|
+
this._registerOption(versionOption);
|
|
1783
|
+
this.on("option:" + versionOption.name(), () => {
|
|
1784
|
+
this._outputConfiguration.writeOut(`${str}
|
|
1785
|
+
`);
|
|
1786
|
+
this._exit(0, "commander.version", str);
|
|
1787
|
+
});
|
|
1788
|
+
return this;
|
|
1789
|
+
}
|
|
1790
|
+
description(str, argsDescription) {
|
|
1791
|
+
if (str === undefined && argsDescription === undefined)
|
|
1792
|
+
return this._description;
|
|
1793
|
+
this._description = str;
|
|
1794
|
+
if (argsDescription) {
|
|
1795
|
+
this._argsDescription = argsDescription;
|
|
1796
|
+
}
|
|
1797
|
+
return this;
|
|
1798
|
+
}
|
|
1799
|
+
summary(str) {
|
|
1800
|
+
if (str === undefined)
|
|
1801
|
+
return this._summary;
|
|
1802
|
+
this._summary = str;
|
|
1803
|
+
return this;
|
|
1804
|
+
}
|
|
1805
|
+
alias(alias) {
|
|
1806
|
+
if (alias === undefined)
|
|
1807
|
+
return this._aliases[0];
|
|
1808
|
+
let command = this;
|
|
1809
|
+
if (this.commands.length !== 0 && this.commands[this.commands.length - 1]._executableHandler) {
|
|
1810
|
+
command = this.commands[this.commands.length - 1];
|
|
1811
|
+
}
|
|
1812
|
+
if (alias === command._name)
|
|
1813
|
+
throw new Error("Command alias can't be the same as its name");
|
|
1814
|
+
const matchingCommand = this.parent?._findCommand(alias);
|
|
1815
|
+
if (matchingCommand) {
|
|
1816
|
+
const existingCmd = [matchingCommand.name()].concat(matchingCommand.aliases()).join("|");
|
|
1817
|
+
throw new Error(`cannot add alias '${alias}' to command '${this.name()}' as already have command '${existingCmd}'`);
|
|
1818
|
+
}
|
|
1819
|
+
command._aliases.push(alias);
|
|
1820
|
+
return this;
|
|
1821
|
+
}
|
|
1822
|
+
aliases(aliases) {
|
|
1823
|
+
if (aliases === undefined)
|
|
1824
|
+
return this._aliases;
|
|
1825
|
+
aliases.forEach((alias) => this.alias(alias));
|
|
1826
|
+
return this;
|
|
1827
|
+
}
|
|
1828
|
+
usage(str) {
|
|
1829
|
+
if (str === undefined) {
|
|
1830
|
+
if (this._usage)
|
|
1831
|
+
return this._usage;
|
|
1832
|
+
const args = this.registeredArguments.map((arg) => {
|
|
1833
|
+
return humanReadableArgName(arg);
|
|
1834
|
+
});
|
|
1835
|
+
return [].concat(this.options.length || this._helpOption !== null ? "[options]" : [], this.commands.length ? "[command]" : [], this.registeredArguments.length ? args : []).join(" ");
|
|
1836
|
+
}
|
|
1837
|
+
this._usage = str;
|
|
1838
|
+
return this;
|
|
1839
|
+
}
|
|
1840
|
+
name(str) {
|
|
1841
|
+
if (str === undefined)
|
|
1842
|
+
return this._name;
|
|
1843
|
+
this._name = str;
|
|
1844
|
+
return this;
|
|
1845
|
+
}
|
|
1846
|
+
helpGroup(heading) {
|
|
1847
|
+
if (heading === undefined)
|
|
1848
|
+
return this._helpGroupHeading ?? "";
|
|
1849
|
+
this._helpGroupHeading = heading;
|
|
1850
|
+
return this;
|
|
1851
|
+
}
|
|
1852
|
+
commandsGroup(heading) {
|
|
1853
|
+
if (heading === undefined)
|
|
1854
|
+
return this._defaultCommandGroup ?? "";
|
|
1855
|
+
this._defaultCommandGroup = heading;
|
|
1856
|
+
return this;
|
|
1857
|
+
}
|
|
1858
|
+
optionsGroup(heading) {
|
|
1859
|
+
if (heading === undefined)
|
|
1860
|
+
return this._defaultOptionGroup ?? "";
|
|
1861
|
+
this._defaultOptionGroup = heading;
|
|
1862
|
+
return this;
|
|
1863
|
+
}
|
|
1864
|
+
_initOptionGroup(option) {
|
|
1865
|
+
if (this._defaultOptionGroup && !option.helpGroupHeading)
|
|
1866
|
+
option.helpGroup(this._defaultOptionGroup);
|
|
1867
|
+
}
|
|
1868
|
+
_initCommandGroup(cmd) {
|
|
1869
|
+
if (this._defaultCommandGroup && !cmd.helpGroup())
|
|
1870
|
+
cmd.helpGroup(this._defaultCommandGroup);
|
|
1871
|
+
}
|
|
1872
|
+
nameFromFilename(filename) {
|
|
1873
|
+
this._name = path.basename(filename, path.extname(filename));
|
|
1874
|
+
return this;
|
|
1875
|
+
}
|
|
1876
|
+
executableDir(path2) {
|
|
1877
|
+
if (path2 === undefined)
|
|
1878
|
+
return this._executableDir;
|
|
1879
|
+
this._executableDir = path2;
|
|
1880
|
+
return this;
|
|
1881
|
+
}
|
|
1882
|
+
helpInformation(contextOptions) {
|
|
1883
|
+
const helper = this.createHelp();
|
|
1884
|
+
const context = this._getOutputContext(contextOptions);
|
|
1885
|
+
helper.prepareContext({
|
|
1886
|
+
error: context.error,
|
|
1887
|
+
helpWidth: context.helpWidth,
|
|
1888
|
+
outputHasColors: context.hasColors
|
|
1889
|
+
});
|
|
1890
|
+
const text = helper.formatHelp(this, helper);
|
|
1891
|
+
if (context.hasColors)
|
|
1892
|
+
return text;
|
|
1893
|
+
return this._outputConfiguration.stripColor(text);
|
|
1894
|
+
}
|
|
1895
|
+
_getOutputContext(contextOptions) {
|
|
1896
|
+
contextOptions = contextOptions || {};
|
|
1897
|
+
const error = !!contextOptions.error;
|
|
1898
|
+
let baseWrite;
|
|
1899
|
+
let hasColors;
|
|
1900
|
+
let helpWidth;
|
|
1901
|
+
if (error) {
|
|
1902
|
+
baseWrite = (str) => this._outputConfiguration.writeErr(str);
|
|
1903
|
+
hasColors = this._outputConfiguration.getErrHasColors();
|
|
1904
|
+
helpWidth = this._outputConfiguration.getErrHelpWidth();
|
|
1905
|
+
} else {
|
|
1906
|
+
baseWrite = (str) => this._outputConfiguration.writeOut(str);
|
|
1907
|
+
hasColors = this._outputConfiguration.getOutHasColors();
|
|
1908
|
+
helpWidth = this._outputConfiguration.getOutHelpWidth();
|
|
1909
|
+
}
|
|
1910
|
+
const write = (str) => {
|
|
1911
|
+
if (!hasColors)
|
|
1912
|
+
str = this._outputConfiguration.stripColor(str);
|
|
1913
|
+
return baseWrite(str);
|
|
1914
|
+
};
|
|
1915
|
+
return { error, write, hasColors, helpWidth };
|
|
1916
|
+
}
|
|
1917
|
+
outputHelp(contextOptions) {
|
|
1918
|
+
let deprecatedCallback;
|
|
1919
|
+
if (typeof contextOptions === "function") {
|
|
1920
|
+
deprecatedCallback = contextOptions;
|
|
1921
|
+
contextOptions = undefined;
|
|
1922
|
+
}
|
|
1923
|
+
const outputContext = this._getOutputContext(contextOptions);
|
|
1924
|
+
const eventContext = {
|
|
1925
|
+
error: outputContext.error,
|
|
1926
|
+
write: outputContext.write,
|
|
1927
|
+
command: this
|
|
1928
|
+
};
|
|
1929
|
+
this._getCommandAndAncestors().reverse().forEach((command) => command.emit("beforeAllHelp", eventContext));
|
|
1930
|
+
this.emit("beforeHelp", eventContext);
|
|
1931
|
+
let helpInformation = this.helpInformation({ error: outputContext.error });
|
|
1932
|
+
if (deprecatedCallback) {
|
|
1933
|
+
helpInformation = deprecatedCallback(helpInformation);
|
|
1934
|
+
if (typeof helpInformation !== "string" && !Buffer.isBuffer(helpInformation)) {
|
|
1935
|
+
throw new Error("outputHelp callback must return a string or a Buffer");
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
outputContext.write(helpInformation);
|
|
1939
|
+
if (this._getHelpOption()?.long) {
|
|
1940
|
+
this.emit(this._getHelpOption().long);
|
|
1941
|
+
}
|
|
1942
|
+
this.emit("afterHelp", eventContext);
|
|
1943
|
+
this._getCommandAndAncestors().forEach((command) => command.emit("afterAllHelp", eventContext));
|
|
1944
|
+
}
|
|
1945
|
+
helpOption(flags, description) {
|
|
1946
|
+
if (typeof flags === "boolean") {
|
|
1947
|
+
if (flags) {
|
|
1948
|
+
if (this._helpOption === null)
|
|
1949
|
+
this._helpOption = undefined;
|
|
1950
|
+
if (this._defaultOptionGroup) {
|
|
1951
|
+
this._initOptionGroup(this._getHelpOption());
|
|
1952
|
+
}
|
|
1953
|
+
} else {
|
|
1954
|
+
this._helpOption = null;
|
|
1955
|
+
}
|
|
1956
|
+
return this;
|
|
1957
|
+
}
|
|
1958
|
+
this._helpOption = this.createOption(flags ?? "-h, --help", description ?? "display help for command");
|
|
1959
|
+
if (flags || description)
|
|
1960
|
+
this._initOptionGroup(this._helpOption);
|
|
1961
|
+
return this;
|
|
1962
|
+
}
|
|
1963
|
+
_getHelpOption() {
|
|
1964
|
+
if (this._helpOption === undefined) {
|
|
1965
|
+
this.helpOption(undefined, undefined);
|
|
1966
|
+
}
|
|
1967
|
+
return this._helpOption;
|
|
1968
|
+
}
|
|
1969
|
+
addHelpOption(option) {
|
|
1970
|
+
this._helpOption = option;
|
|
1971
|
+
this._initOptionGroup(option);
|
|
1972
|
+
return this;
|
|
1973
|
+
}
|
|
1974
|
+
help(contextOptions) {
|
|
1975
|
+
this.outputHelp(contextOptions);
|
|
1976
|
+
let exitCode = Number(process2.exitCode ?? 0);
|
|
1977
|
+
if (exitCode === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) {
|
|
1978
|
+
exitCode = 1;
|
|
1979
|
+
}
|
|
1980
|
+
this._exit(exitCode, "commander.help", "(outputHelp)");
|
|
1981
|
+
}
|
|
1982
|
+
addHelpText(position, text) {
|
|
1983
|
+
const allowedValues = ["beforeAll", "before", "after", "afterAll"];
|
|
1984
|
+
if (!allowedValues.includes(position)) {
|
|
1985
|
+
throw new Error(`Unexpected value for position to addHelpText.
|
|
1986
|
+
Expecting one of '${allowedValues.join("', '")}'`);
|
|
1987
|
+
}
|
|
1988
|
+
const helpEvent = `${position}Help`;
|
|
1989
|
+
this.on(helpEvent, (context) => {
|
|
1990
|
+
let helpStr;
|
|
1991
|
+
if (typeof text === "function") {
|
|
1992
|
+
helpStr = text({ error: context.error, command: context.command });
|
|
1993
|
+
} else {
|
|
1994
|
+
helpStr = text;
|
|
1995
|
+
}
|
|
1996
|
+
if (helpStr) {
|
|
1997
|
+
context.write(`${helpStr}
|
|
1998
|
+
`);
|
|
1999
|
+
}
|
|
2000
|
+
});
|
|
2001
|
+
return this;
|
|
2002
|
+
}
|
|
2003
|
+
_outputHelpIfRequested(args) {
|
|
2004
|
+
const helpOption = this._getHelpOption();
|
|
2005
|
+
const helpRequested = helpOption && args.find((arg) => helpOption.is(arg));
|
|
2006
|
+
if (helpRequested) {
|
|
2007
|
+
this.outputHelp();
|
|
2008
|
+
this._exit(0, "commander.helpDisplayed", "(outputHelp)");
|
|
2009
|
+
}
|
|
2010
|
+
}
|
|
2011
|
+
}
|
|
2012
|
+
function incrementNodeInspectorPort(args) {
|
|
2013
|
+
return args.map((arg) => {
|
|
2014
|
+
if (!arg.startsWith("--inspect")) {
|
|
2015
|
+
return arg;
|
|
2016
|
+
}
|
|
2017
|
+
let debugOption;
|
|
2018
|
+
let debugHost = "127.0.0.1";
|
|
2019
|
+
let debugPort = "9229";
|
|
2020
|
+
let match;
|
|
2021
|
+
if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {
|
|
2022
|
+
debugOption = match[1];
|
|
2023
|
+
} else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null) {
|
|
2024
|
+
debugOption = match[1];
|
|
2025
|
+
if (/^\d+$/.test(match[3])) {
|
|
2026
|
+
debugPort = match[3];
|
|
2027
|
+
} else {
|
|
2028
|
+
debugHost = match[3];
|
|
2029
|
+
}
|
|
2030
|
+
} else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null) {
|
|
2031
|
+
debugOption = match[1];
|
|
2032
|
+
debugHost = match[3];
|
|
2033
|
+
debugPort = match[4];
|
|
2034
|
+
}
|
|
2035
|
+
if (debugOption && debugPort !== "0") {
|
|
2036
|
+
return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;
|
|
2037
|
+
}
|
|
2038
|
+
return arg;
|
|
2039
|
+
});
|
|
2040
|
+
}
|
|
2041
|
+
function useColor() {
|
|
2042
|
+
if (process2.env.NO_COLOR || process2.env.FORCE_COLOR === "0" || process2.env.FORCE_COLOR === "false")
|
|
2043
|
+
return false;
|
|
2044
|
+
if (process2.env.FORCE_COLOR || process2.env.CLICOLOR_FORCE !== undefined)
|
|
2045
|
+
return true;
|
|
2046
|
+
return;
|
|
2047
|
+
}
|
|
2048
|
+
|
|
2049
|
+
// node_modules/commander/index.js
|
|
2050
|
+
var program = new Command;
|
|
2051
|
+
// package.json
|
|
2052
|
+
var package_default = {
|
|
2053
|
+
name: "@alexgorbatchev/shadcn",
|
|
2054
|
+
version: "0.0.41",
|
|
2055
|
+
description: "Sharp, monospace React components with compact and comfortable densities.",
|
|
2056
|
+
license: "MIT",
|
|
2057
|
+
repository: {
|
|
2058
|
+
type: "git",
|
|
2059
|
+
url: "git+https://github.com/alexgorbatchev/shadcn.git"
|
|
2060
|
+
},
|
|
2061
|
+
bin: {
|
|
2062
|
+
"shadcn-prototype": "dist/prototype.js"
|
|
2063
|
+
},
|
|
2064
|
+
files: [
|
|
2065
|
+
"dist",
|
|
2066
|
+
"llms",
|
|
2067
|
+
"llms.txt",
|
|
2068
|
+
"patches",
|
|
2069
|
+
"LICENSE",
|
|
2070
|
+
"THIRD_PARTY_NOTICES.md",
|
|
2071
|
+
"assistant-ui-catalog.json",
|
|
2072
|
+
"licenses",
|
|
2073
|
+
"templates/prototype"
|
|
2074
|
+
],
|
|
2075
|
+
type: "module",
|
|
2076
|
+
sideEffects: [
|
|
2077
|
+
"**/*.css"
|
|
2078
|
+
],
|
|
2079
|
+
exports: {
|
|
2080
|
+
".": {
|
|
2081
|
+
types: "./dist/index.d.ts",
|
|
2082
|
+
import: "./dist/index.js"
|
|
2083
|
+
},
|
|
2084
|
+
"./theme.css": "./dist/theme.css",
|
|
2085
|
+
"./typeset.css": "./dist/typeset.css",
|
|
2086
|
+
"./fonts.css": "./dist/fonts.css",
|
|
2087
|
+
"./chart": {
|
|
2088
|
+
types: "./dist/components/chart/index.d.ts",
|
|
2089
|
+
import: "./dist/components/chart/index.js"
|
|
2090
|
+
},
|
|
2091
|
+
"./calendar": {
|
|
2092
|
+
types: "./dist/components/calendar/index.d.ts",
|
|
2093
|
+
import: "./dist/components/calendar/index.js"
|
|
2094
|
+
},
|
|
2095
|
+
"./persian-calendar": {
|
|
2096
|
+
types: "./dist/components/persian-calendar/index.d.ts",
|
|
2097
|
+
import: "./dist/components/persian-calendar/index.js"
|
|
2098
|
+
},
|
|
2099
|
+
"./carousel": {
|
|
2100
|
+
types: "./dist/components/carousel/index.d.ts",
|
|
2101
|
+
import: "./dist/components/carousel/index.js"
|
|
2102
|
+
},
|
|
2103
|
+
"./command": {
|
|
2104
|
+
types: "./dist/components/command/index.d.ts",
|
|
2105
|
+
import: "./dist/components/command/index.js"
|
|
2106
|
+
},
|
|
2107
|
+
"./resizable": {
|
|
2108
|
+
types: "./dist/components/resizable/index.d.ts",
|
|
2109
|
+
import: "./dist/components/resizable/index.js"
|
|
2110
|
+
},
|
|
2111
|
+
"./sonner": {
|
|
2112
|
+
types: "./dist/components/sonner/index.d.ts",
|
|
2113
|
+
import: "./dist/components/sonner/index.js"
|
|
2114
|
+
},
|
|
2115
|
+
"./input-otp": {
|
|
2116
|
+
types: "./dist/components/input-otp/index.d.ts",
|
|
2117
|
+
import: "./dist/components/input-otp/index.js"
|
|
2118
|
+
},
|
|
2119
|
+
"./message-scroller": {
|
|
2120
|
+
types: "./dist/components/message-scroller/index.d.ts",
|
|
2121
|
+
import: "./dist/components/message-scroller/index.js"
|
|
2122
|
+
},
|
|
2123
|
+
"./questionnaire": {
|
|
2124
|
+
types: "./dist/components/questionnaire/index.d.ts",
|
|
2125
|
+
import: "./dist/components/questionnaire/index.js"
|
|
2126
|
+
},
|
|
2127
|
+
"./assistant-ui": {
|
|
2128
|
+
types: "./dist/components/assistant-ui/index.d.ts",
|
|
2129
|
+
import: "./dist/components/assistant-ui/index.js"
|
|
2130
|
+
},
|
|
2131
|
+
"./assistant-ui/native": {
|
|
2132
|
+
types: "./dist/components/assistant-ui/native/index.d.ts",
|
|
2133
|
+
import: "./dist/components/assistant-ui/native/index.js"
|
|
2134
|
+
},
|
|
2135
|
+
"./assistant-ui.css": "./dist/assistant-ui.css",
|
|
2136
|
+
"./assistant-ui/inline-citation": {
|
|
2137
|
+
types: "./dist/components/assistant-ui/elements/InlineCitation.d.ts",
|
|
2138
|
+
import: "./dist/components/assistant-ui/elements/InlineCitation.js"
|
|
2139
|
+
},
|
|
2140
|
+
"./assistant-ui/composer-voice": {
|
|
2141
|
+
types: "./dist/components/assistant-ui/elements/ComposerVoice.d.ts",
|
|
2142
|
+
import: "./dist/components/assistant-ui/elements/ComposerVoice.js"
|
|
2143
|
+
},
|
|
2144
|
+
"./assistant-ui/approval-card": {
|
|
2145
|
+
types: "./dist/components/assistant-ui/elements/ApprovalCard.d.ts",
|
|
2146
|
+
import: "./dist/components/assistant-ui/elements/ApprovalCard.js"
|
|
2147
|
+
},
|
|
2148
|
+
"./assistant-ui/voice-conversation": {
|
|
2149
|
+
types: "./dist/components/assistant-ui/elements/VoiceConversation.d.ts",
|
|
2150
|
+
import: "./dist/components/assistant-ui/elements/VoiceConversation.js"
|
|
2151
|
+
},
|
|
2152
|
+
"./assistant-ui/run-activity": {
|
|
2153
|
+
types: "./dist/components/assistant-ui/elements/RunActivity.d.ts",
|
|
2154
|
+
import: "./dist/components/assistant-ui/elements/RunActivity.js"
|
|
2155
|
+
},
|
|
2156
|
+
"./assistant-ui/eve-ask-question": {
|
|
2157
|
+
types: "./dist/components/assistant-ui/elements/EveAskQuestion.d.ts",
|
|
2158
|
+
import: "./dist/components/assistant-ui/elements/EveAskQuestion.js"
|
|
2159
|
+
},
|
|
2160
|
+
"./assistant-ui/file-tree": {
|
|
2161
|
+
types: "./dist/components/assistant-ui/elements/FileTree.d.ts",
|
|
2162
|
+
import: "./dist/components/assistant-ui/elements/FileTree.js"
|
|
2163
|
+
},
|
|
2164
|
+
"./assistant-ui/confidence-marker": {
|
|
2165
|
+
types: "./dist/components/assistant-ui/elements/ConfidenceMarker.d.ts",
|
|
2166
|
+
import: "./dist/components/assistant-ui/elements/ConfidenceMarker.js"
|
|
2167
|
+
},
|
|
2168
|
+
"./assistant-ui/artifact-card": {
|
|
2169
|
+
types: "./dist/components/assistant-ui/elements/ArtifactCard.d.ts",
|
|
2170
|
+
import: "./dist/components/assistant-ui/elements/ArtifactCard.js"
|
|
2171
|
+
},
|
|
2172
|
+
"./assistant-ui/frac": {
|
|
2173
|
+
types: "./dist/components/assistant-ui/elements/Frac.d.ts",
|
|
2174
|
+
import: "./dist/components/assistant-ui/elements/Frac.js"
|
|
2175
|
+
},
|
|
2176
|
+
"./assistant-ui/permission-grant": {
|
|
2177
|
+
types: "./dist/components/assistant-ui/elements/PermissionGrant.d.ts",
|
|
2178
|
+
import: "./dist/components/assistant-ui/elements/PermissionGrant.js"
|
|
2179
|
+
},
|
|
2180
|
+
"./assistant-ui/option-text": {
|
|
2181
|
+
types: "./dist/components/assistant-ui/elements/OptionText.d.ts",
|
|
2182
|
+
import: "./dist/components/assistant-ui/elements/OptionText.js"
|
|
2183
|
+
},
|
|
2184
|
+
"./assistant-ui/model-selector-item": {
|
|
2185
|
+
types: "./dist/components/assistant-ui/elements/ModelSelectorItem.d.ts",
|
|
2186
|
+
import: "./dist/components/assistant-ui/elements/ModelSelectorItem.js"
|
|
2187
|
+
},
|
|
2188
|
+
"./assistant-ui/math-block": {
|
|
2189
|
+
types: "./dist/components/assistant-ui/elements/MathBlock.d.ts",
|
|
2190
|
+
import: "./dist/components/assistant-ui/elements/MathBlock.js"
|
|
2191
|
+
},
|
|
2192
|
+
"./assistant-ui/schedule-card": {
|
|
2193
|
+
types: "./dist/components/assistant-ui/elements/ScheduleCard.d.ts",
|
|
2194
|
+
import: "./dist/components/assistant-ui/elements/ScheduleCard.js"
|
|
2195
|
+
},
|
|
2196
|
+
"./assistant-ui/model-selector-value": {
|
|
2197
|
+
types: "./dist/components/assistant-ui/elements/ModelSelectorValue.d.ts",
|
|
2198
|
+
import: "./dist/components/assistant-ui/elements/ModelSelectorValue.js"
|
|
2199
|
+
},
|
|
2200
|
+
"./assistant-ui/subagent-list": {
|
|
2201
|
+
types: "./dist/components/assistant-ui/elements/SubagentList.d.ts",
|
|
2202
|
+
import: "./dist/components/assistant-ui/elements/SubagentList.js"
|
|
2203
|
+
},
|
|
2204
|
+
"./assistant-ui/mcp-server-panel": {
|
|
2205
|
+
types: "./dist/components/assistant-ui/elements/McpServerPanel.d.ts",
|
|
2206
|
+
import: "./dist/components/assistant-ui/elements/McpServerPanel.js"
|
|
2207
|
+
},
|
|
2208
|
+
"./assistant-ui/reviewable-diff": {
|
|
2209
|
+
types: "./dist/components/assistant-ui/elements/ReviewableDiff.d.ts",
|
|
2210
|
+
import: "./dist/components/assistant-ui/elements/ReviewableDiff.js"
|
|
2211
|
+
},
|
|
2212
|
+
"./assistant-ui/retrieval-chunks": {
|
|
2213
|
+
types: "./dist/components/assistant-ui/elements/RetrievalChunks.d.ts",
|
|
2214
|
+
import: "./dist/components/assistant-ui/elements/RetrievalChunks.js"
|
|
2215
|
+
},
|
|
2216
|
+
"./assistant-ui/image-generation": {
|
|
2217
|
+
types: "./dist/components/assistant-ui/elements/ImageGeneration.d.ts",
|
|
2218
|
+
import: "./dist/components/assistant-ui/elements/ImageGeneration.js"
|
|
2219
|
+
},
|
|
2220
|
+
"./assistant-ui/claude-logo": {
|
|
2221
|
+
types: "./dist/components/assistant-ui/elements/ClaudeLogo.d.ts",
|
|
2222
|
+
import: "./dist/components/assistant-ui/elements/ClaudeLogo.js"
|
|
2223
|
+
},
|
|
2224
|
+
"./assistant-ui/context-display": {
|
|
2225
|
+
types: "./dist/components/assistant-ui/elements/ContextDisplay.d.ts",
|
|
2226
|
+
import: "./dist/components/assistant-ui/elements/ContextDisplay.js"
|
|
2227
|
+
},
|
|
2228
|
+
"./assistant-ui/composer-model-trigger": {
|
|
2229
|
+
types: "./dist/components/assistant-ui/elements/ComposerModelTrigger.d.ts",
|
|
2230
|
+
import: "./dist/components/assistant-ui/elements/ComposerModelTrigger.js"
|
|
2231
|
+
},
|
|
2232
|
+
"./assistant-ui/video-player": {
|
|
2233
|
+
types: "./dist/components/assistant-ui/elements/VideoPlayer.d.ts",
|
|
2234
|
+
import: "./dist/components/assistant-ui/elements/VideoPlayer.js"
|
|
2235
|
+
},
|
|
2236
|
+
"./assistant-ui/agent-status": {
|
|
2237
|
+
types: "./dist/components/assistant-ui/elements/AgentStatus.d.ts",
|
|
2238
|
+
import: "./dist/components/assistant-ui/elements/AgentStatus.js"
|
|
2239
|
+
},
|
|
2240
|
+
"./assistant-ui/model-selector-search": {
|
|
2241
|
+
types: "./dist/components/assistant-ui/elements/ModelSelectorSearch.d.ts",
|
|
2242
|
+
import: "./dist/components/assistant-ui/elements/ModelSelectorSearch.js"
|
|
2243
|
+
},
|
|
2244
|
+
"./assistant-ui/typing-indicator": {
|
|
2245
|
+
types: "./dist/components/assistant-ui/elements/TypingIndicator.d.ts",
|
|
2246
|
+
import: "./dist/components/assistant-ui/elements/TypingIndicator.js"
|
|
2247
|
+
},
|
|
2248
|
+
"./assistant-ui/question-flow": {
|
|
2249
|
+
types: "./dist/components/assistant-ui/elements/QuestionFlow.d.ts",
|
|
2250
|
+
import: "./dist/components/assistant-ui/elements/QuestionFlow.js"
|
|
2251
|
+
},
|
|
2252
|
+
"./assistant-ui/composer-command-item": {
|
|
2253
|
+
types: "./dist/components/assistant-ui/elements/ComposerCommandItem.d.ts",
|
|
2254
|
+
import: "./dist/components/assistant-ui/elements/ComposerCommandItem.js"
|
|
2255
|
+
},
|
|
2256
|
+
"./assistant-ui/composer-person-item": {
|
|
2257
|
+
types: "./dist/components/assistant-ui/elements/ComposerPersonItem.d.ts",
|
|
2258
|
+
import: "./dist/components/assistant-ui/elements/ComposerPersonItem.js"
|
|
2259
|
+
},
|
|
2260
|
+
"./assistant-ui/composer-attachment-chip": {
|
|
2261
|
+
types: "./dist/components/assistant-ui/elements/ComposerAttachmentChip.d.ts",
|
|
2262
|
+
import: "./dist/components/assistant-ui/elements/ComposerAttachmentChip.js"
|
|
2263
|
+
},
|
|
2264
|
+
"./assistant-ui/composer-toolbar": {
|
|
2265
|
+
types: "./dist/components/assistant-ui/elements/ComposerToolbar.d.ts",
|
|
2266
|
+
import: "./dist/components/assistant-ui/elements/ComposerToolbar.js"
|
|
2267
|
+
},
|
|
2268
|
+
"./assistant-ui/context-breakdown": {
|
|
2269
|
+
types: "./dist/components/assistant-ui/elements/ContextBreakdown.d.ts",
|
|
2270
|
+
import: "./dist/components/assistant-ui/elements/ContextBreakdown.js"
|
|
2271
|
+
},
|
|
2272
|
+
"./assistant-ui/composer-actions": {
|
|
2273
|
+
types: "./dist/components/assistant-ui/elements/ComposerActions.d.ts",
|
|
2274
|
+
import: "./dist/components/assistant-ui/elements/ComposerActions.js"
|
|
2275
|
+
},
|
|
2276
|
+
"./assistant-ui/agent-plan": {
|
|
2277
|
+
types: "./dist/components/assistant-ui/elements/AgentPlan.d.ts",
|
|
2278
|
+
import: "./dist/components/assistant-ui/elements/AgentPlan.js"
|
|
2279
|
+
},
|
|
2280
|
+
"./assistant-ui/prompt-library": {
|
|
2281
|
+
types: "./dist/components/assistant-ui/elements/PromptLibrary.d.ts",
|
|
2282
|
+
import: "./dist/components/assistant-ui/elements/PromptLibrary.js"
|
|
2283
|
+
},
|
|
2284
|
+
"./assistant-ui/thread-search": {
|
|
2285
|
+
types: "./dist/components/assistant-ui/elements/ThreadSearch.d.ts",
|
|
2286
|
+
import: "./dist/components/assistant-ui/elements/ThreadSearch.js"
|
|
2287
|
+
},
|
|
2288
|
+
"./assistant-ui/composer": {
|
|
2289
|
+
types: "./dist/components/assistant-ui/elements/Composer.d.ts",
|
|
2290
|
+
import: "./dist/components/assistant-ui/elements/Composer.js"
|
|
2291
|
+
},
|
|
2292
|
+
"./assistant-ui/model-selector-content": {
|
|
2293
|
+
types: "./dist/components/assistant-ui/elements/ModelSelectorContent.d.ts",
|
|
2294
|
+
import: "./dist/components/assistant-ui/elements/ModelSelectorContent.js"
|
|
2295
|
+
},
|
|
2296
|
+
"./assistant-ui/composer-attach-button": {
|
|
2297
|
+
types: "./dist/components/assistant-ui/elements/ComposerAttachButton.d.ts",
|
|
2298
|
+
import: "./dist/components/assistant-ui/elements/ComposerAttachButton.js"
|
|
2299
|
+
},
|
|
2300
|
+
"./assistant-ui/syntax-highlighter": {
|
|
2301
|
+
types: "./dist/components/assistant-ui/elements/SyntaxHighlighter.d.ts",
|
|
2302
|
+
import: "./dist/components/assistant-ui/elements/SyntaxHighlighter.js"
|
|
2303
|
+
},
|
|
2304
|
+
"./assistant-ui/todo-list": {
|
|
2305
|
+
types: "./dist/components/assistant-ui/elements/TodoList.d.ts",
|
|
2306
|
+
import: "./dist/components/assistant-ui/elements/TodoList.js"
|
|
2307
|
+
},
|
|
2308
|
+
"./assistant-ui/memory-chips": {
|
|
2309
|
+
types: "./dist/components/assistant-ui/elements/MemoryChips.d.ts",
|
|
2310
|
+
import: "./dist/components/assistant-ui/elements/MemoryChips.js"
|
|
2311
|
+
},
|
|
2312
|
+
"./assistant-ui/composer-context": {
|
|
2313
|
+
types: "./dist/components/assistant-ui/elements/ComposerContext.d.ts",
|
|
2314
|
+
import: "./dist/components/assistant-ui/elements/ComposerContext.js"
|
|
2315
|
+
},
|
|
2316
|
+
"./assistant-ui/message-branches": {
|
|
2317
|
+
types: "./dist/components/assistant-ui/elements/MessageBranches.d.ts",
|
|
2318
|
+
import: "./dist/components/assistant-ui/elements/MessageBranches.js"
|
|
2319
|
+
},
|
|
2320
|
+
"./assistant-ui/model-selector-separator": {
|
|
2321
|
+
types: "./dist/components/assistant-ui/elements/ModelSelectorSeparator.d.ts",
|
|
2322
|
+
import: "./dist/components/assistant-ui/elements/ModelSelectorSeparator.js"
|
|
2323
|
+
},
|
|
2324
|
+
"./assistant-ui/sources": {
|
|
2325
|
+
types: "./dist/components/assistant-ui/elements/Sources.d.ts",
|
|
2326
|
+
import: "./dist/components/assistant-ui/elements/Sources.js"
|
|
2327
|
+
},
|
|
2328
|
+
"./assistant-ui/error-state": {
|
|
2329
|
+
types: "./dist/components/assistant-ui/elements/ErrorState.d.ts",
|
|
2330
|
+
import: "./dist/components/assistant-ui/elements/ErrorState.js"
|
|
2331
|
+
},
|
|
2332
|
+
"./assistant-ui/audio-player": {
|
|
2333
|
+
types: "./dist/components/assistant-ui/elements/AudioPlayer.d.ts",
|
|
2334
|
+
import: "./dist/components/assistant-ui/elements/AudioPlayer.js"
|
|
2335
|
+
},
|
|
2336
|
+
"./assistant-ui/background-inbox": {
|
|
2337
|
+
types: "./dist/components/assistant-ui/elements/BackgroundInbox.d.ts",
|
|
2338
|
+
import: "./dist/components/assistant-ui/elements/BackgroundInbox.js"
|
|
2339
|
+
},
|
|
2340
|
+
"./assistant-ui/tool-call": {
|
|
2341
|
+
types: "./dist/components/assistant-ui/elements/ToolCall.d.ts",
|
|
2342
|
+
import: "./dist/components/assistant-ui/elements/ToolCall.js"
|
|
2343
|
+
},
|
|
2344
|
+
"./assistant-ui/document-reference": {
|
|
2345
|
+
types: "./dist/components/assistant-ui/elements/DocumentReference.d.ts",
|
|
2346
|
+
import: "./dist/components/assistant-ui/elements/DocumentReference.js"
|
|
2347
|
+
},
|
|
2348
|
+
"./assistant-ui/command-palette": {
|
|
2349
|
+
types: "./dist/components/assistant-ui/elements/CommandPalette.d.ts",
|
|
2350
|
+
import: "./dist/components/assistant-ui/elements/CommandPalette.js"
|
|
2351
|
+
},
|
|
2352
|
+
"./assistant-ui/open-ai-logo": {
|
|
2353
|
+
types: "./dist/components/assistant-ui/elements/OpenAILogo.d.ts",
|
|
2354
|
+
import: "./dist/components/assistant-ui/elements/OpenAILogo.js"
|
|
2355
|
+
},
|
|
2356
|
+
"./assistant-ui/web-search": {
|
|
2357
|
+
types: "./dist/components/assistant-ui/elements/WebSearch.d.ts",
|
|
2358
|
+
import: "./dist/components/assistant-ui/elements/WebSearch.js"
|
|
2359
|
+
},
|
|
2360
|
+
"./assistant-ui/message-timing": {
|
|
2361
|
+
types: "./dist/components/assistant-ui/elements/MessageTiming.d.ts",
|
|
2362
|
+
import: "./dist/components/assistant-ui/elements/MessageTiming.js"
|
|
2363
|
+
},
|
|
2364
|
+
"./assistant-ui/reasoning-root": {
|
|
2365
|
+
types: "./dist/components/assistant-ui/elements/ReasoningRoot.d.ts",
|
|
2366
|
+
import: "./dist/components/assistant-ui/elements/ReasoningRoot.js"
|
|
2367
|
+
},
|
|
2368
|
+
"./assistant-ui/cost-meter": {
|
|
2369
|
+
types: "./dist/components/assistant-ui/elements/CostMeter.d.ts",
|
|
2370
|
+
import: "./dist/components/assistant-ui/elements/CostMeter.js"
|
|
2371
|
+
},
|
|
2372
|
+
"./assistant-ui/model-selector-group": {
|
|
2373
|
+
types: "./dist/components/assistant-ui/elements/ModelSelectorGroup.d.ts",
|
|
2374
|
+
import: "./dist/components/assistant-ui/elements/ModelSelectorGroup.js"
|
|
2375
|
+
},
|
|
2376
|
+
"./assistant-ui/chart": {
|
|
2377
|
+
types: "./dist/components/assistant-ui/elements/Chart.d.ts",
|
|
2378
|
+
import: "./dist/components/assistant-ui/elements/Chart.js"
|
|
2379
|
+
},
|
|
2380
|
+
"./assistant-ui/context-display-content": {
|
|
2381
|
+
types: "./dist/components/assistant-ui/elements/ContextDisplayContent.d.ts",
|
|
2382
|
+
import: "./dist/components/assistant-ui/elements/ContextDisplayContent.js"
|
|
2383
|
+
},
|
|
2384
|
+
"./assistant-ui/tool-error": {
|
|
2385
|
+
types: "./dist/components/assistant-ui/elements/ToolError.d.ts",
|
|
2386
|
+
import: "./dist/components/assistant-ui/elements/ToolError.js"
|
|
2387
|
+
},
|
|
2388
|
+
"./assistant-ui/message-queue": {
|
|
2389
|
+
types: "./dist/components/assistant-ui/elements/MessageQueue.d.ts",
|
|
2390
|
+
import: "./dist/components/assistant-ui/elements/MessageQueue.js"
|
|
2391
|
+
},
|
|
2392
|
+
"./assistant-ui/model-selector-focus-anchor": {
|
|
2393
|
+
types: "./dist/components/assistant-ui/elements/ModelSelectorFocusAnchor.d.ts",
|
|
2394
|
+
import: "./dist/components/assistant-ui/elements/ModelSelectorFocusAnchor.js"
|
|
2395
|
+
},
|
|
2396
|
+
"./assistant-ui/reasoning-effort": {
|
|
2397
|
+
types: "./dist/components/assistant-ui/elements/ReasoningEffort.d.ts",
|
|
2398
|
+
import: "./dist/components/assistant-ui/elements/ReasoningEffort.js"
|
|
2399
|
+
},
|
|
2400
|
+
"./assistant-ui/dot-matrix": {
|
|
2401
|
+
types: "./dist/components/assistant-ui/elements/DotMatrix.d.ts",
|
|
2402
|
+
import: "./dist/components/assistant-ui/elements/DotMatrix.js"
|
|
2403
|
+
},
|
|
2404
|
+
"./assistant-ui/generation-loader": {
|
|
2405
|
+
types: "./dist/components/assistant-ui/elements/GenerationLoader.d.ts",
|
|
2406
|
+
import: "./dist/components/assistant-ui/elements/GenerationLoader.js"
|
|
2407
|
+
},
|
|
2408
|
+
"./assistant-ui/model-selector-effort": {
|
|
2409
|
+
types: "./dist/components/assistant-ui/elements/ModelSelectorEffort.d.ts",
|
|
2410
|
+
import: "./dist/components/assistant-ui/elements/ModelSelectorEffort.js"
|
|
2411
|
+
},
|
|
2412
|
+
"./assistant-ui/generative-ui": {
|
|
2413
|
+
types: "./dist/components/assistant-ui/elements/GenerativeUi.d.ts",
|
|
2414
|
+
import: "./dist/components/assistant-ui/elements/GenerativeUi.js"
|
|
2415
|
+
},
|
|
2416
|
+
"./assistant-ui/model-selector-empty": {
|
|
2417
|
+
types: "./dist/components/assistant-ui/elements/ModelSelectorEmpty.d.ts",
|
|
2418
|
+
import: "./dist/components/assistant-ui/elements/ModelSelectorEmpty.js"
|
|
2419
|
+
},
|
|
2420
|
+
"./assistant-ui/number-roll": {
|
|
2421
|
+
types: "./dist/components/assistant-ui/elements/NumberRoll.d.ts",
|
|
2422
|
+
import: "./dist/components/assistant-ui/elements/NumberRoll.js"
|
|
2423
|
+
},
|
|
2424
|
+
"./assistant-ui/elicitation-form": {
|
|
2425
|
+
types: "./dist/components/assistant-ui/elements/ElicitationForm.d.ts",
|
|
2426
|
+
import: "./dist/components/assistant-ui/elements/ElicitationForm.js"
|
|
2427
|
+
},
|
|
2428
|
+
"./assistant-ui/thinking-indicator": {
|
|
2429
|
+
types: "./dist/components/assistant-ui/elements/ThinkingIndicator.d.ts",
|
|
2430
|
+
import: "./dist/components/assistant-ui/elements/ThinkingIndicator.js"
|
|
2431
|
+
},
|
|
2432
|
+
"./assistant-ui/scroll-anchor": {
|
|
2433
|
+
types: "./dist/components/assistant-ui/elements/ScrollAnchor.d.ts",
|
|
2434
|
+
import: "./dist/components/assistant-ui/elements/ScrollAnchor.js"
|
|
2435
|
+
},
|
|
2436
|
+
"./assistant-ui/directive-text": {
|
|
2437
|
+
types: "./dist/components/assistant-ui/elements/DirectiveText.d.ts",
|
|
2438
|
+
import: "./dist/components/assistant-ui/elements/DirectiveText.js"
|
|
2439
|
+
},
|
|
2440
|
+
"./assistant-ui/activity-graph": {
|
|
2441
|
+
types: "./dist/components/assistant-ui/elements/ActivityGraph.d.ts",
|
|
2442
|
+
import: "./dist/components/assistant-ui/elements/ActivityGraph.js"
|
|
2443
|
+
},
|
|
2444
|
+
"./assistant-ui/code-diff": {
|
|
2445
|
+
types: "./dist/components/assistant-ui/elements/CodeDiff.d.ts",
|
|
2446
|
+
import: "./dist/components/assistant-ui/elements/CodeDiff.js"
|
|
2447
|
+
},
|
|
2448
|
+
"./assistant-ui/conversation-search": {
|
|
2449
|
+
types: "./dist/components/assistant-ui/elements/ConversationSearch.d.ts",
|
|
2450
|
+
import: "./dist/components/assistant-ui/elements/ConversationSearch.js"
|
|
2451
|
+
},
|
|
2452
|
+
"./assistant-ui/context-display-text": {
|
|
2453
|
+
types: "./dist/components/assistant-ui/elements/ContextDisplayText.d.ts",
|
|
2454
|
+
import: "./dist/components/assistant-ui/elements/ContextDisplayText.js"
|
|
2455
|
+
},
|
|
2456
|
+
"./assistant-ui/context-display-ring": {
|
|
2457
|
+
types: "./dist/components/assistant-ui/elements/ContextDisplayRing.d.ts",
|
|
2458
|
+
import: "./dist/components/assistant-ui/elements/ContextDisplayRing.js"
|
|
2459
|
+
},
|
|
2460
|
+
"./assistant-ui/thread-list": {
|
|
2461
|
+
types: "./dist/components/assistant-ui/elements/ThreadList.d.ts",
|
|
2462
|
+
import: "./dist/components/assistant-ui/elements/ThreadList.js"
|
|
2463
|
+
},
|
|
2464
|
+
"./assistant-ui/map-answer": {
|
|
2465
|
+
types: "./dist/components/assistant-ui/elements/MapAnswer.d.ts",
|
|
2466
|
+
import: "./dist/components/assistant-ui/elements/MapAnswer.js"
|
|
2467
|
+
},
|
|
2468
|
+
"./assistant-ui/code-runner": {
|
|
2469
|
+
types: "./dist/components/assistant-ui/elements/CodeRunner.d.ts",
|
|
2470
|
+
import: "./dist/components/assistant-ui/elements/CodeRunner.js"
|
|
2471
|
+
},
|
|
2472
|
+
"./assistant-ui/file": {
|
|
2473
|
+
types: "./dist/components/assistant-ui/elements/File.d.ts",
|
|
2474
|
+
import: "./dist/components/assistant-ui/elements/File.js"
|
|
2475
|
+
},
|
|
2476
|
+
"./assistant-ui/model-selector": {
|
|
2477
|
+
types: "./dist/components/assistant-ui/elements/ModelSelector.d.ts",
|
|
2478
|
+
import: "./dist/components/assistant-ui/elements/ModelSelector.js"
|
|
2479
|
+
},
|
|
2480
|
+
"./assistant-ui/message-attachments": {
|
|
2481
|
+
types: "./dist/components/assistant-ui/elements/MessageAttachments.d.ts",
|
|
2482
|
+
import: "./dist/components/assistant-ui/elements/MessageAttachments.js"
|
|
2483
|
+
},
|
|
2484
|
+
"./assistant-ui/citation": {
|
|
2485
|
+
types: "./dist/components/assistant-ui/elements/Citation.d.ts",
|
|
2486
|
+
import: "./dist/components/assistant-ui/elements/Citation.js"
|
|
2487
|
+
},
|
|
2488
|
+
"./assistant-ui/message-actions": {
|
|
2489
|
+
types: "./dist/components/assistant-ui/elements/MessageActions.d.ts",
|
|
2490
|
+
import: "./dist/components/assistant-ui/elements/MessageActions.js"
|
|
2491
|
+
},
|
|
2492
|
+
"./assistant-ui/quote-reply": {
|
|
2493
|
+
types: "./dist/components/assistant-ui/elements/QuoteReply.d.ts",
|
|
2494
|
+
import: "./dist/components/assistant-ui/elements/QuoteReply.js"
|
|
2495
|
+
},
|
|
2496
|
+
"./assistant-ui/read-aloud": {
|
|
2497
|
+
types: "./dist/components/assistant-ui/elements/ReadAloud.d.ts",
|
|
2498
|
+
import: "./dist/components/assistant-ui/elements/ReadAloud.js"
|
|
2499
|
+
},
|
|
2500
|
+
"./assistant-ui/computer-use": {
|
|
2501
|
+
types: "./dist/components/assistant-ui/elements/ComputerUse.d.ts",
|
|
2502
|
+
import: "./dist/components/assistant-ui/elements/ComputerUse.js"
|
|
2503
|
+
},
|
|
2504
|
+
"./assistant-ui/day-separator": {
|
|
2505
|
+
types: "./dist/components/assistant-ui/elements/DaySeparator.d.ts",
|
|
2506
|
+
import: "./dist/components/assistant-ui/elements/DaySeparator.js"
|
|
2507
|
+
},
|
|
2508
|
+
"./assistant-ui/reasoning-text": {
|
|
2509
|
+
types: "./dist/components/assistant-ui/elements/ReasoningText.d.ts",
|
|
2510
|
+
import: "./dist/components/assistant-ui/elements/ReasoningText.js"
|
|
2511
|
+
},
|
|
2512
|
+
"./assistant-ui/heat-graph": {
|
|
2513
|
+
types: "./dist/components/assistant-ui/elements/HeatGraph.d.ts",
|
|
2514
|
+
import: "./dist/components/assistant-ui/elements/HeatGraph.js"
|
|
2515
|
+
},
|
|
2516
|
+
"./assistant-ui/mobile-composer": {
|
|
2517
|
+
types: "./dist/components/assistant-ui/elements/MobileComposer.d.ts",
|
|
2518
|
+
import: "./dist/components/assistant-ui/elements/MobileComposer.js"
|
|
2519
|
+
},
|
|
2520
|
+
"./assistant-ui/streaming-text": {
|
|
2521
|
+
types: "./dist/components/assistant-ui/elements/StreamingText.d.ts",
|
|
2522
|
+
import: "./dist/components/assistant-ui/elements/StreamingText.js"
|
|
2523
|
+
},
|
|
2524
|
+
"./assistant-ui/sup": {
|
|
2525
|
+
types: "./dist/components/assistant-ui/elements/Sup.d.ts",
|
|
2526
|
+
import: "./dist/components/assistant-ui/elements/Sup.js"
|
|
2527
|
+
},
|
|
2528
|
+
"./assistant-ui/guardrail-notice": {
|
|
2529
|
+
types: "./dist/components/assistant-ui/elements/GuardrailNotice.d.ts",
|
|
2530
|
+
import: "./dist/components/assistant-ui/elements/GuardrailNotice.js"
|
|
2531
|
+
},
|
|
2532
|
+
"./assistant-ui/reasoning-content": {
|
|
2533
|
+
types: "./dist/components/assistant-ui/elements/ReasoningContent.d.ts",
|
|
2534
|
+
import: "./dist/components/assistant-ui/elements/ReasoningContent.js"
|
|
2535
|
+
},
|
|
2536
|
+
"./assistant-ui/context-display-root": {
|
|
2537
|
+
types: "./dist/components/assistant-ui/elements/ContextDisplayRoot.d.ts",
|
|
2538
|
+
import: "./dist/components/assistant-ui/elements/ContextDisplayRoot.js"
|
|
2539
|
+
},
|
|
2540
|
+
"./assistant-ui/source-glyph": {
|
|
2541
|
+
types: "./dist/components/assistant-ui/elements/SourceGlyph.d.ts",
|
|
2542
|
+
import: "./dist/components/assistant-ui/elements/SourceGlyph.js"
|
|
2543
|
+
},
|
|
2544
|
+
"./assistant-ui/empty-state-composer": {
|
|
2545
|
+
types: "./dist/components/assistant-ui/elements/EmptyStateComposer.d.ts",
|
|
2546
|
+
import: "./dist/components/assistant-ui/elements/EmptyStateComposer.js"
|
|
2547
|
+
},
|
|
2548
|
+
"./assistant-ui/image": {
|
|
2549
|
+
types: "./dist/components/assistant-ui/elements/Image.d.ts",
|
|
2550
|
+
import: "./dist/components/assistant-ui/elements/Image.js"
|
|
2551
|
+
},
|
|
2552
|
+
"./assistant-ui/feedback-dialog": {
|
|
2553
|
+
types: "./dist/components/assistant-ui/elements/FeedbackDialog.d.ts",
|
|
2554
|
+
import: "./dist/components/assistant-ui/elements/FeedbackDialog.js"
|
|
2555
|
+
},
|
|
2556
|
+
"./assistant-ui/context-display-value": {
|
|
2557
|
+
types: "./dist/components/assistant-ui/elements/ContextDisplayValue.d.ts",
|
|
2558
|
+
import: "./dist/components/assistant-ui/elements/ContextDisplayValue.js"
|
|
2559
|
+
},
|
|
2560
|
+
"./assistant-ui/shared-conversation": {
|
|
2561
|
+
types: "./dist/components/assistant-ui/elements/SharedConversation.d.ts",
|
|
2562
|
+
import: "./dist/components/assistant-ui/elements/SharedConversation.js"
|
|
2563
|
+
},
|
|
2564
|
+
"./assistant-ui/number-ticker": {
|
|
2565
|
+
types: "./dist/components/assistant-ui/elements/NumberTicker.d.ts",
|
|
2566
|
+
import: "./dist/components/assistant-ui/elements/NumberTicker.js"
|
|
2567
|
+
},
|
|
2568
|
+
"./assistant-ui/gemini-logo": {
|
|
2569
|
+
types: "./dist/components/assistant-ui/elements/GeminiLogo.d.ts",
|
|
2570
|
+
import: "./dist/components/assistant-ui/elements/GeminiLogo.js"
|
|
2571
|
+
},
|
|
2572
|
+
"./assistant-ui/reasoning-fade": {
|
|
2573
|
+
types: "./dist/components/assistant-ui/elements/ReasoningFade.d.ts",
|
|
2574
|
+
import: "./dist/components/assistant-ui/elements/ReasoningFade.js"
|
|
2575
|
+
},
|
|
2576
|
+
"./assistant-ui/job-progress": {
|
|
2577
|
+
types: "./dist/components/assistant-ui/elements/JobProgress.d.ts",
|
|
2578
|
+
import: "./dist/components/assistant-ui/elements/JobProgress.js"
|
|
2579
|
+
},
|
|
2580
|
+
"./assistant-ui/stopped-run": {
|
|
2581
|
+
types: "./dist/components/assistant-ui/elements/StoppedRun.d.ts",
|
|
2582
|
+
import: "./dist/components/assistant-ui/elements/StoppedRun.js"
|
|
2583
|
+
},
|
|
2584
|
+
"./assistant-ui/conversation-map": {
|
|
2585
|
+
types: "./dist/components/assistant-ui/elements/ConversationMap.d.ts",
|
|
2586
|
+
import: "./dist/components/assistant-ui/elements/ConversationMap.js"
|
|
2587
|
+
},
|
|
2588
|
+
"./assistant-ui/geo-map": {
|
|
2589
|
+
types: "./dist/components/assistant-ui/elements/GeoMap.d.ts",
|
|
2590
|
+
import: "./dist/components/assistant-ui/elements/GeoMap.js"
|
|
2591
|
+
},
|
|
2592
|
+
"./assistant-ui/empty-state-suggestion": {
|
|
2593
|
+
types: "./dist/components/assistant-ui/elements/EmptyStateSuggestion.d.ts",
|
|
2594
|
+
import: "./dist/components/assistant-ui/elements/EmptyStateSuggestion.js"
|
|
2595
|
+
},
|
|
2596
|
+
"./assistant-ui/link-preview": {
|
|
2597
|
+
types: "./dist/components/assistant-ui/elements/LinkPreview.d.ts",
|
|
2598
|
+
import: "./dist/components/assistant-ui/elements/LinkPreview.js"
|
|
2599
|
+
},
|
|
2600
|
+
"./assistant-ui/option-list": {
|
|
2601
|
+
types: "./dist/components/assistant-ui/elements/OptionList.d.ts",
|
|
2602
|
+
import: "./dist/components/assistant-ui/elements/OptionList.js"
|
|
2603
|
+
},
|
|
2604
|
+
"./assistant-ui/agent-handoff": {
|
|
2605
|
+
types: "./dist/components/assistant-ui/elements/AgentHandoff.d.ts",
|
|
2606
|
+
import: "./dist/components/assistant-ui/elements/AgentHandoff.js"
|
|
2607
|
+
},
|
|
2608
|
+
"./assistant-ui/markdown-text": {
|
|
2609
|
+
types: "./dist/components/assistant-ui/elements/MarkdownText.d.ts",
|
|
2610
|
+
import: "./dist/components/assistant-ui/elements/MarkdownText.js"
|
|
2611
|
+
},
|
|
2612
|
+
"./assistant-ui/suggestions": {
|
|
2613
|
+
types: "./dist/components/assistant-ui/elements/Suggestions.d.ts",
|
|
2614
|
+
import: "./dist/components/assistant-ui/elements/Suggestions.js"
|
|
2615
|
+
},
|
|
2616
|
+
"./assistant-ui/tooltip-icon-button": {
|
|
2617
|
+
types: "./dist/components/assistant-ui/elements/TooltipIconButton.d.ts",
|
|
2618
|
+
import: "./dist/components/assistant-ui/elements/TooltipIconButton.js"
|
|
2619
|
+
},
|
|
2620
|
+
"./assistant-ui/speaker-identity": {
|
|
2621
|
+
types: "./dist/components/assistant-ui/elements/SpeakerIdentity.d.ts",
|
|
2622
|
+
import: "./dist/components/assistant-ui/elements/SpeakerIdentity.js"
|
|
2623
|
+
},
|
|
2624
|
+
"./assistant-ui/trace-waterfall": {
|
|
2625
|
+
types: "./dist/components/assistant-ui/elements/TraceWaterfall.d.ts",
|
|
2626
|
+
import: "./dist/components/assistant-ui/elements/TraceWaterfall.js"
|
|
2627
|
+
},
|
|
2628
|
+
"./assistant-ui/comparison-card": {
|
|
2629
|
+
types: "./dist/components/assistant-ui/elements/ComparisonCard.d.ts",
|
|
2630
|
+
import: "./dist/components/assistant-ui/elements/ComparisonCard.js"
|
|
2631
|
+
},
|
|
2632
|
+
"./assistant-ui/composer-menu-item": {
|
|
2633
|
+
types: "./dist/components/assistant-ui/elements/ComposerMenuItem.d.ts",
|
|
2634
|
+
import: "./dist/components/assistant-ui/elements/ComposerMenuItem.js"
|
|
2635
|
+
},
|
|
2636
|
+
"./assistant-ui/composer-bar": {
|
|
2637
|
+
types: "./dist/components/assistant-ui/elements/ComposerBar.d.ts",
|
|
2638
|
+
import: "./dist/components/assistant-ui/elements/ComposerBar.js"
|
|
2639
|
+
},
|
|
2640
|
+
"./assistant-ui/tool-timeline": {
|
|
2641
|
+
types: "./dist/components/assistant-ui/elements/ToolTimeline.d.ts",
|
|
2642
|
+
import: "./dist/components/assistant-ui/elements/ToolTimeline.js"
|
|
2643
|
+
},
|
|
2644
|
+
"./assistant-ui/diagram": {
|
|
2645
|
+
types: "./dist/components/assistant-ui/elements/Diagram.d.ts",
|
|
2646
|
+
import: "./dist/components/assistant-ui/elements/Diagram.js"
|
|
2647
|
+
},
|
|
2648
|
+
"./assistant-ui/edit-message": {
|
|
2649
|
+
types: "./dist/components/assistant-ui/elements/EditMessage.d.ts",
|
|
2650
|
+
import: "./dist/components/assistant-ui/elements/EditMessage.js"
|
|
2651
|
+
},
|
|
2652
|
+
"./assistant-ui/voice-orb": {
|
|
2653
|
+
types: "./dist/components/assistant-ui/elements/VoiceOrb.d.ts",
|
|
2654
|
+
import: "./dist/components/assistant-ui/elements/VoiceOrb.js"
|
|
2655
|
+
},
|
|
2656
|
+
"./assistant-ui/score-breakdown": {
|
|
2657
|
+
types: "./dist/components/assistant-ui/elements/ScoreBreakdown.d.ts",
|
|
2658
|
+
import: "./dist/components/assistant-ui/elements/ScoreBreakdown.js"
|
|
2659
|
+
},
|
|
2660
|
+
"./assistant-ui/flow-graph": {
|
|
2661
|
+
types: "./dist/components/assistant-ui/elements/FlowGraph.d.ts",
|
|
2662
|
+
import: "./dist/components/assistant-ui/elements/FlowGraph.js"
|
|
2663
|
+
},
|
|
2664
|
+
"./assistant-ui/empty-state-suggestions": {
|
|
2665
|
+
types: "./dist/components/assistant-ui/elements/EmptyStateSuggestions.d.ts",
|
|
2666
|
+
import: "./dist/components/assistant-ui/elements/EmptyStateSuggestions.js"
|
|
2667
|
+
},
|
|
2668
|
+
"./assistant-ui/agent-card": {
|
|
2669
|
+
types: "./dist/components/assistant-ui/elements/AgentCard.d.ts",
|
|
2670
|
+
import: "./dist/components/assistant-ui/elements/AgentCard.js"
|
|
2671
|
+
},
|
|
2672
|
+
"./assistant-ui/data-table": {
|
|
2673
|
+
types: "./dist/components/assistant-ui/elements/DataTable.d.ts",
|
|
2674
|
+
import: "./dist/components/assistant-ui/elements/DataTable.js"
|
|
2675
|
+
},
|
|
2676
|
+
"./assistant-ui/research-report": {
|
|
2677
|
+
types: "./dist/components/assistant-ui/elements/ResearchReport.d.ts",
|
|
2678
|
+
import: "./dist/components/assistant-ui/elements/ResearchReport.js"
|
|
2679
|
+
},
|
|
2680
|
+
"./assistant-ui/model-selector-list": {
|
|
2681
|
+
types: "./dist/components/assistant-ui/elements/ModelSelectorList.d.ts",
|
|
2682
|
+
import: "./dist/components/assistant-ui/elements/ModelSelectorList.js"
|
|
2683
|
+
},
|
|
2684
|
+
"./assistant-ui/swap-label": {
|
|
2685
|
+
types: "./dist/components/assistant-ui/elements/SwapLabel.d.ts",
|
|
2686
|
+
import: "./dist/components/assistant-ui/elements/SwapLabel.js"
|
|
2687
|
+
},
|
|
2688
|
+
"./assistant-ui/image-gallery": {
|
|
2689
|
+
types: "./dist/components/assistant-ui/elements/ImageGallery.d.ts",
|
|
2690
|
+
import: "./dist/components/assistant-ui/elements/ImageGallery.js"
|
|
2691
|
+
},
|
|
2692
|
+
"./assistant-ui/tool-group": {
|
|
2693
|
+
types: "./dist/components/assistant-ui/elements/ToolGroup.d.ts",
|
|
2694
|
+
import: "./dist/components/assistant-ui/elements/ToolGroup.js"
|
|
2695
|
+
},
|
|
2696
|
+
"./assistant-ui/spec-sheet": {
|
|
2697
|
+
types: "./dist/components/assistant-ui/elements/SpecSheet.d.ts",
|
|
2698
|
+
import: "./dist/components/assistant-ui/elements/SpecSheet.js"
|
|
2699
|
+
},
|
|
2700
|
+
"./assistant-ui/quota-banner": {
|
|
2701
|
+
types: "./dist/components/assistant-ui/elements/QuotaBanner.d.ts",
|
|
2702
|
+
import: "./dist/components/assistant-ui/elements/QuotaBanner.js"
|
|
2703
|
+
},
|
|
2704
|
+
"./assistant-ui/chat-panel": {
|
|
2705
|
+
types: "./dist/components/assistant-ui/elements/ChatPanel.d.ts",
|
|
2706
|
+
import: "./dist/components/assistant-ui/elements/ChatPanel.js"
|
|
2707
|
+
},
|
|
2708
|
+
"./assistant-ui/reasoning-panel": {
|
|
2709
|
+
types: "./dist/components/assistant-ui/elements/ReasoningPanel.d.ts",
|
|
2710
|
+
import: "./dist/components/assistant-ui/elements/ReasoningPanel.js"
|
|
2711
|
+
},
|
|
2712
|
+
"./assistant-ui/regenerate-menu": {
|
|
2713
|
+
types: "./dist/components/assistant-ui/elements/RegenerateMenu.d.ts",
|
|
2714
|
+
import: "./dist/components/assistant-ui/elements/RegenerateMenu.js"
|
|
2715
|
+
},
|
|
2716
|
+
"./assistant-ui/empty-state": {
|
|
2717
|
+
types: "./dist/components/assistant-ui/elements/EmptyState.d.ts",
|
|
2718
|
+
import: "./dist/components/assistant-ui/elements/EmptyState.js"
|
|
2719
|
+
},
|
|
2720
|
+
"./assistant-ui/timeline": {
|
|
2721
|
+
types: "./dist/components/assistant-ui/elements/Timeline.d.ts",
|
|
2722
|
+
import: "./dist/components/assistant-ui/elements/Timeline.js"
|
|
2723
|
+
},
|
|
2724
|
+
"./assistant-ui/shiki-highlighter": {
|
|
2725
|
+
types: "./dist/components/assistant-ui/elements/ShikiHighlighter.d.ts",
|
|
2726
|
+
import: "./dist/components/assistant-ui/elements/ShikiHighlighter.js"
|
|
2727
|
+
},
|
|
2728
|
+
"./assistant-ui/task-state-icon": {
|
|
2729
|
+
types: "./dist/components/assistant-ui/elements/TaskStateIcon.d.ts",
|
|
2730
|
+
import: "./dist/components/assistant-ui/elements/TaskStateIcon.js"
|
|
2731
|
+
},
|
|
2732
|
+
"./assistant-ui/composer-send": {
|
|
2733
|
+
types: "./dist/components/assistant-ui/elements/ComposerSend.d.ts",
|
|
2734
|
+
import: "./dist/components/assistant-ui/elements/ComposerSend.js"
|
|
2735
|
+
},
|
|
2736
|
+
"./assistant-ui/task-card": {
|
|
2737
|
+
types: "./dist/components/assistant-ui/elements/TaskCard.d.ts",
|
|
2738
|
+
import: "./dist/components/assistant-ui/elements/TaskCard.js"
|
|
2739
|
+
},
|
|
2740
|
+
"./assistant-ui/sub": {
|
|
2741
|
+
types: "./dist/components/assistant-ui/elements/Sub.d.ts",
|
|
2742
|
+
import: "./dist/components/assistant-ui/elements/Sub.js"
|
|
2743
|
+
},
|
|
2744
|
+
"./assistant-ui/canvas-split": {
|
|
2745
|
+
types: "./dist/components/assistant-ui/elements/CanvasSplit.d.ts",
|
|
2746
|
+
import: "./dist/components/assistant-ui/elements/CanvasSplit.js"
|
|
2747
|
+
},
|
|
2748
|
+
"./assistant-ui/draft-restore": {
|
|
2749
|
+
types: "./dist/components/assistant-ui/elements/DraftRestore.d.ts",
|
|
2750
|
+
import: "./dist/components/assistant-ui/elements/DraftRestore.js"
|
|
2751
|
+
},
|
|
2752
|
+
"./assistant-ui/git-hub-icon": {
|
|
2753
|
+
types: "./dist/components/assistant-ui/elements/GitHubIcon.d.ts",
|
|
2754
|
+
import: "./dist/components/assistant-ui/elements/GitHubIcon.js"
|
|
2755
|
+
},
|
|
2756
|
+
"./assistant-ui/composer-attachments": {
|
|
2757
|
+
types: "./dist/components/assistant-ui/elements/ComposerAttachments.d.ts",
|
|
2758
|
+
import: "./dist/components/assistant-ui/elements/ComposerAttachments.js"
|
|
2759
|
+
},
|
|
2760
|
+
"./assistant-ui/model-selector-trigger": {
|
|
2761
|
+
types: "./dist/components/assistant-ui/elements/ModelSelectorTrigger.d.ts",
|
|
2762
|
+
import: "./dist/components/assistant-ui/elements/ModelSelectorTrigger.js"
|
|
2763
|
+
},
|
|
2764
|
+
"./assistant-ui/settings-panel": {
|
|
2765
|
+
types: "./dist/components/assistant-ui/elements/SettingsPanel.d.ts",
|
|
2766
|
+
import: "./dist/components/assistant-ui/elements/SettingsPanel.js"
|
|
2767
|
+
},
|
|
2768
|
+
"./assistant-ui/context-display-bar": {
|
|
2769
|
+
types: "./dist/components/assistant-ui/elements/ContextDisplayBar.d.ts",
|
|
2770
|
+
import: "./dist/components/assistant-ui/elements/ContextDisplayBar.js"
|
|
2771
|
+
},
|
|
2772
|
+
"./assistant-ui/connection-state": {
|
|
2773
|
+
types: "./dist/components/assistant-ui/elements/ConnectionState.d.ts",
|
|
2774
|
+
import: "./dist/components/assistant-ui/elements/ConnectionState.js"
|
|
2775
|
+
},
|
|
2776
|
+
"./assistant-ui/composer-model-item": {
|
|
2777
|
+
types: "./dist/components/assistant-ui/elements/ComposerModelItem.d.ts",
|
|
2778
|
+
import: "./dist/components/assistant-ui/elements/ComposerModelItem.js"
|
|
2779
|
+
},
|
|
2780
|
+
"./assistant-ui/shimmer-label": {
|
|
2781
|
+
types: "./dist/components/assistant-ui/elements/ShimmerLabel.d.ts",
|
|
2782
|
+
import: "./dist/components/assistant-ui/elements/ShimmerLabel.js"
|
|
2783
|
+
},
|
|
2784
|
+
"./assistant-ui/checkpoint-history": {
|
|
2785
|
+
types: "./dist/components/assistant-ui/elements/CheckpointHistory.d.ts",
|
|
2786
|
+
import: "./dist/components/assistant-ui/elements/CheckpointHistory.js"
|
|
2787
|
+
},
|
|
2788
|
+
"./assistant-ui/model-picker": {
|
|
2789
|
+
types: "./dist/components/assistant-ui/elements/ModelPicker.d.ts",
|
|
2790
|
+
import: "./dist/components/assistant-ui/elements/ModelPicker.js"
|
|
2791
|
+
},
|
|
2792
|
+
"./assistant-ui/web-preview": {
|
|
2793
|
+
types: "./dist/components/assistant-ui/elements/WebPreview.d.ts",
|
|
2794
|
+
import: "./dist/components/assistant-ui/elements/WebPreview.js"
|
|
2795
|
+
},
|
|
2796
|
+
"./assistant-ui/context-display-trigger": {
|
|
2797
|
+
types: "./dist/components/assistant-ui/elements/ContextDisplayTrigger.d.ts",
|
|
2798
|
+
import: "./dist/components/assistant-ui/elements/ContextDisplayTrigger.js"
|
|
2799
|
+
},
|
|
2800
|
+
"./assistant-ui/share-meter": {
|
|
2801
|
+
types: "./dist/components/assistant-ui/elements/ShareMeter.d.ts",
|
|
2802
|
+
import: "./dist/components/assistant-ui/elements/ShareMeter.js"
|
|
2803
|
+
},
|
|
2804
|
+
"./assistant-ui/empty-state-greeting": {
|
|
2805
|
+
types: "./dist/components/assistant-ui/elements/EmptyStateGreeting.d.ts",
|
|
2806
|
+
import: "./dist/components/assistant-ui/elements/EmptyStateGreeting.js"
|
|
2807
|
+
},
|
|
2808
|
+
"./assistant-ui/launcher-bubble": {
|
|
2809
|
+
types: "./dist/components/assistant-ui/elements/LauncherBubble.d.ts",
|
|
2810
|
+
import: "./dist/components/assistant-ui/elements/LauncherBubble.js"
|
|
2811
|
+
},
|
|
2812
|
+
"./assistant-ui/mermaid-diagram": {
|
|
2813
|
+
types: "./dist/components/assistant-ui/elements/MermaidDiagram.d.ts",
|
|
2814
|
+
import: "./dist/components/assistant-ui/elements/MermaidDiagram.js"
|
|
2815
|
+
},
|
|
2816
|
+
"./assistant-ui/composer-menu": {
|
|
2817
|
+
types: "./dist/components/assistant-ui/elements/ComposerMenu.d.ts",
|
|
2818
|
+
import: "./dist/components/assistant-ui/elements/ComposerMenu.js"
|
|
2819
|
+
},
|
|
2820
|
+
"./assistant-ui/reasoning-trigger": {
|
|
2821
|
+
types: "./dist/components/assistant-ui/elements/ReasoningTrigger.d.ts",
|
|
2822
|
+
import: "./dist/components/assistant-ui/elements/ReasoningTrigger.js"
|
|
2823
|
+
},
|
|
2824
|
+
"./assistant-ui/terminal-block": {
|
|
2825
|
+
types: "./dist/components/assistant-ui/elements/TerminalBlock.d.ts",
|
|
2826
|
+
import: "./dist/components/assistant-ui/elements/TerminalBlock.js"
|
|
2827
|
+
},
|
|
2828
|
+
"./assistant-ui/onboarding": {
|
|
2829
|
+
types: "./dist/components/assistant-ui/elements/Onboarding.d.ts",
|
|
2830
|
+
import: "./dist/components/assistant-ui/elements/Onboarding.js"
|
|
2831
|
+
},
|
|
2832
|
+
"./assistant-ui/model-selector-root": {
|
|
2833
|
+
types: "./dist/components/assistant-ui/elements/ModelSelectorRoot.d.ts",
|
|
2834
|
+
import: "./dist/components/assistant-ui/elements/ModelSelectorRoot.js"
|
|
2835
|
+
},
|
|
2836
|
+
"./assistant-ui/composer-voice-button": {
|
|
2837
|
+
types: "./dist/components/assistant-ui/elements/ComposerVoiceButton.d.ts",
|
|
2838
|
+
import: "./dist/components/assistant-ui/elements/ComposerVoiceButton.js"
|
|
2839
|
+
},
|
|
2840
|
+
"./assistant-ui/composer-input": {
|
|
2841
|
+
types: "./dist/components/assistant-ui/elements/ComposerInput.d.ts",
|
|
2842
|
+
import: "./dist/components/assistant-ui/elements/ComposerInput.js"
|
|
2843
|
+
},
|
|
2844
|
+
"./assistant-ui/message-pair": {
|
|
2845
|
+
types: "./dist/components/assistant-ui/elements/MessagePair.d.ts",
|
|
2846
|
+
import: "./dist/components/assistant-ui/elements/MessagePair.js"
|
|
2847
|
+
},
|
|
2848
|
+
"./assistant-ui/recommendation-card": {
|
|
2849
|
+
types: "./dist/components/assistant-ui/elements/RecommendationCard.d.ts",
|
|
2850
|
+
import: "./dist/components/assistant-ui/elements/RecommendationCard.js"
|
|
2851
|
+
},
|
|
2852
|
+
"./assistant-ui/native/voice-conversation": {
|
|
2853
|
+
types: "./dist/components/assistant-ui/native/VoiceConversation.d.ts",
|
|
2854
|
+
import: "./dist/components/assistant-ui/native/VoiceConversation.js"
|
|
2855
|
+
},
|
|
2856
|
+
"./assistant-ui/native/quote-block": {
|
|
2857
|
+
types: "./dist/components/assistant-ui/native/QuoteBlock.d.ts",
|
|
2858
|
+
import: "./dist/components/assistant-ui/native/QuoteBlock.js"
|
|
2859
|
+
},
|
|
2860
|
+
"./assistant-ui/native/context-display": {
|
|
2861
|
+
types: "./dist/components/assistant-ui/native/ContextDisplay.d.ts",
|
|
2862
|
+
import: "./dist/components/assistant-ui/native/ContextDisplay.js"
|
|
2863
|
+
},
|
|
2864
|
+
"./assistant-ui/native/agent-status": {
|
|
2865
|
+
types: "./dist/components/assistant-ui/native/AgentStatus.d.ts",
|
|
2866
|
+
import: "./dist/components/assistant-ui/native/AgentStatus.js"
|
|
2867
|
+
},
|
|
2868
|
+
"./assistant-ui/native/attachment-preview": {
|
|
2869
|
+
types: "./dist/components/assistant-ui/native/AttachmentPreview.d.ts",
|
|
2870
|
+
import: "./dist/components/assistant-ui/native/AttachmentPreview.js"
|
|
2871
|
+
},
|
|
2872
|
+
"./assistant-ui/native/syntax-highlighter": {
|
|
2873
|
+
types: "./dist/components/assistant-ui/native/SyntaxHighlighter.d.ts",
|
|
2874
|
+
import: "./dist/components/assistant-ui/native/SyntaxHighlighter.js"
|
|
2875
|
+
},
|
|
2876
|
+
"./assistant-ui/native/assistant-modal": {
|
|
2877
|
+
types: "./dist/components/assistant-ui/native/AssistantModal.d.ts",
|
|
2878
|
+
import: "./dist/components/assistant-ui/native/AssistantModal.js"
|
|
2879
|
+
},
|
|
2880
|
+
"./assistant-ui/native/sources": {
|
|
2881
|
+
types: "./dist/components/assistant-ui/native/Sources.d.ts",
|
|
2882
|
+
import: "./dist/components/assistant-ui/native/Sources.js"
|
|
2883
|
+
},
|
|
2884
|
+
"./assistant-ui/native/voice-connect-button": {
|
|
2885
|
+
types: "./dist/components/assistant-ui/native/VoiceConnectButton.d.ts",
|
|
2886
|
+
import: "./dist/components/assistant-ui/native/VoiceConnectButton.js"
|
|
2887
|
+
},
|
|
2888
|
+
"./assistant-ui/native/message-timing": {
|
|
2889
|
+
types: "./dist/components/assistant-ui/native/MessageTiming.d.ts",
|
|
2890
|
+
import: "./dist/components/assistant-ui/native/MessageTiming.js"
|
|
2891
|
+
},
|
|
2892
|
+
"./assistant-ui/native/voice-disconnect-button": {
|
|
2893
|
+
types: "./dist/components/assistant-ui/native/VoiceDisconnectButton.d.ts",
|
|
2894
|
+
import: "./dist/components/assistant-ui/native/VoiceDisconnectButton.js"
|
|
2895
|
+
},
|
|
2896
|
+
"./assistant-ui/native/context-display-runtime-root": {
|
|
2897
|
+
types: "./dist/components/assistant-ui/native/ContextDisplayRuntimeRoot.d.ts",
|
|
2898
|
+
import: "./dist/components/assistant-ui/native/ContextDisplayRuntimeRoot.js"
|
|
2899
|
+
},
|
|
2900
|
+
"./assistant-ui/native/selection-toolbar": {
|
|
2901
|
+
types: "./dist/components/assistant-ui/native/SelectionToolbar.d.ts",
|
|
2902
|
+
import: "./dist/components/assistant-ui/native/SelectionToolbar.js"
|
|
2903
|
+
},
|
|
2904
|
+
"./assistant-ui/native/directive-text": {
|
|
2905
|
+
types: "./dist/components/assistant-ui/native/DirectiveText.d.ts",
|
|
2906
|
+
import: "./dist/components/assistant-ui/native/DirectiveText.js"
|
|
2907
|
+
},
|
|
2908
|
+
"./assistant-ui/native/context-display-text": {
|
|
2909
|
+
types: "./dist/components/assistant-ui/native/ContextDisplayText.d.ts",
|
|
2910
|
+
import: "./dist/components/assistant-ui/native/ContextDisplayText.js"
|
|
2911
|
+
},
|
|
2912
|
+
"./assistant-ui/native/context-display-ring": {
|
|
2913
|
+
types: "./dist/components/assistant-ui/native/ContextDisplayRing.d.ts",
|
|
2914
|
+
import: "./dist/components/assistant-ui/native/ContextDisplayRing.js"
|
|
2915
|
+
},
|
|
2916
|
+
"./assistant-ui/native/thread-list": {
|
|
2917
|
+
types: "./dist/components/assistant-ui/native/ThreadList.d.ts",
|
|
2918
|
+
import: "./dist/components/assistant-ui/native/ThreadList.js"
|
|
2919
|
+
},
|
|
2920
|
+
"./assistant-ui/native/model-selector": {
|
|
2921
|
+
types: "./dist/components/assistant-ui/native/ModelSelector.d.ts",
|
|
2922
|
+
import: "./dist/components/assistant-ui/native/ModelSelector.js"
|
|
2923
|
+
},
|
|
2924
|
+
"./assistant-ui/native/voice-status-dot": {
|
|
2925
|
+
types: "./dist/components/assistant-ui/native/VoiceStatusDot.d.ts",
|
|
2926
|
+
import: "./dist/components/assistant-ui/native/VoiceStatusDot.js"
|
|
2927
|
+
},
|
|
2928
|
+
"./assistant-ui/native/assistant-sidebar": {
|
|
2929
|
+
types: "./dist/components/assistant-ui/native/AssistantSidebar.d.ts",
|
|
2930
|
+
import: "./dist/components/assistant-ui/native/AssistantSidebar.js"
|
|
2931
|
+
},
|
|
2932
|
+
"./assistant-ui/native/composer-trigger-popover": {
|
|
2933
|
+
types: "./dist/components/assistant-ui/native/ComposerTriggerPopover.d.ts",
|
|
2934
|
+
import: "./dist/components/assistant-ui/native/ComposerTriggerPopover.js"
|
|
2935
|
+
},
|
|
2936
|
+
"./assistant-ui/native/context-display-root": {
|
|
2937
|
+
types: "./dist/components/assistant-ui/native/ContextDisplayRoot.d.ts",
|
|
2938
|
+
import: "./dist/components/assistant-ui/native/ContextDisplayRoot.js"
|
|
2939
|
+
},
|
|
2940
|
+
"./assistant-ui/native/conversation-map-aui": {
|
|
2941
|
+
types: "./dist/components/assistant-ui/native/ConversationMapAui.d.ts",
|
|
2942
|
+
import: "./dist/components/assistant-ui/native/ConversationMapAui.js"
|
|
2943
|
+
},
|
|
2944
|
+
"./assistant-ui/native/tool-fallback-root": {
|
|
2945
|
+
types: "./dist/components/assistant-ui/native/ToolFallbackRoot.d.ts",
|
|
2946
|
+
import: "./dist/components/assistant-ui/native/ToolFallbackRoot.js"
|
|
2947
|
+
},
|
|
2948
|
+
"./assistant-ui/native/voice-control": {
|
|
2949
|
+
types: "./dist/components/assistant-ui/native/VoiceControl.d.ts",
|
|
2950
|
+
import: "./dist/components/assistant-ui/native/VoiceControl.js"
|
|
2951
|
+
},
|
|
2952
|
+
"./assistant-ui/native/mcp-config-dialog": {
|
|
2953
|
+
types: "./dist/components/assistant-ui/native/McpConfigDialog.d.ts",
|
|
2954
|
+
import: "./dist/components/assistant-ui/native/McpConfigDialog.js"
|
|
2955
|
+
},
|
|
2956
|
+
"./assistant-ui/native/composer-quote-preview": {
|
|
2957
|
+
types: "./dist/components/assistant-ui/native/ComposerQuotePreview.d.ts",
|
|
2958
|
+
import: "./dist/components/assistant-ui/native/ComposerQuotePreview.js"
|
|
2959
|
+
},
|
|
2960
|
+
"./assistant-ui/native/thread-list-sidebar": {
|
|
2961
|
+
types: "./dist/components/assistant-ui/native/ThreadListSidebar.d.ts",
|
|
2962
|
+
import: "./dist/components/assistant-ui/native/ThreadListSidebar.js"
|
|
2963
|
+
},
|
|
2964
|
+
"./assistant-ui/native/thread": {
|
|
2965
|
+
types: "./dist/components/assistant-ui/native/Thread.d.ts",
|
|
2966
|
+
import: "./dist/components/assistant-ui/native/Thread.js"
|
|
2967
|
+
},
|
|
2968
|
+
"./assistant-ui/native/voice-orb": {
|
|
2969
|
+
types: "./dist/components/assistant-ui/native/VoiceOrb.d.ts",
|
|
2970
|
+
import: "./dist/components/assistant-ui/native/VoiceOrb.js"
|
|
2971
|
+
},
|
|
2972
|
+
"./assistant-ui/native/tool-group": {
|
|
2973
|
+
types: "./dist/components/assistant-ui/native/ToolGroup.d.ts",
|
|
2974
|
+
import: "./dist/components/assistant-ui/native/ToolGroup.js"
|
|
2975
|
+
},
|
|
2976
|
+
"./assistant-ui/native/task-card": {
|
|
2977
|
+
types: "./dist/components/assistant-ui/native/TaskCard.d.ts",
|
|
2978
|
+
import: "./dist/components/assistant-ui/native/TaskCard.js"
|
|
2979
|
+
},
|
|
2980
|
+
"./assistant-ui/native/voice-mute-button": {
|
|
2981
|
+
types: "./dist/components/assistant-ui/native/VoiceMuteButton.d.ts",
|
|
2982
|
+
import: "./dist/components/assistant-ui/native/VoiceMuteButton.js"
|
|
2983
|
+
},
|
|
2984
|
+
"./assistant-ui/native/context-display-bar": {
|
|
2985
|
+
types: "./dist/components/assistant-ui/native/ContextDisplayBar.d.ts",
|
|
2986
|
+
import: "./dist/components/assistant-ui/native/ContextDisplayBar.js"
|
|
2987
|
+
},
|
|
2988
|
+
"./assistant-ui/native/mermaid-diagram": {
|
|
2989
|
+
types: "./dist/components/assistant-ui/native/MermaidDiagram.d.ts",
|
|
2990
|
+
import: "./dist/components/assistant-ui/native/MermaidDiagram.js"
|
|
2991
|
+
},
|
|
2992
|
+
"./assistant-ui/native/reasoning": {
|
|
2993
|
+
types: "./dist/components/assistant-ui/native/Reasoning.d.ts",
|
|
2994
|
+
import: "./dist/components/assistant-ui/native/Reasoning.js"
|
|
2995
|
+
},
|
|
2996
|
+
"./assistant-ui/native/followup-suggestions-row": {
|
|
2997
|
+
types: "./dist/components/assistant-ui/native/FollowupSuggestionsRow.d.ts",
|
|
2998
|
+
import: "./dist/components/assistant-ui/native/FollowupSuggestionsRow.js"
|
|
2999
|
+
},
|
|
3000
|
+
"./assistant-ui/mermaid-zoom": {
|
|
3001
|
+
types: "./dist/components/assistant-ui/elements/MermaidZoom.d.ts",
|
|
3002
|
+
import: "./dist/components/assistant-ui/elements/MermaidZoom.js"
|
|
3003
|
+
},
|
|
3004
|
+
"./assistant-ui/diff-viewer": {
|
|
3005
|
+
types: "./dist/components/assistant-ui/elements/DiffViewer.d.ts",
|
|
3006
|
+
import: "./dist/components/assistant-ui/elements/DiffViewer.js"
|
|
3007
|
+
},
|
|
3008
|
+
"./assistant-ui/diff-viewer-file-badge": {
|
|
3009
|
+
types: "./dist/components/assistant-ui/elements/DiffViewerFileBadge.d.ts",
|
|
3010
|
+
import: "./dist/components/assistant-ui/elements/DiffViewerFileBadge.js"
|
|
3011
|
+
},
|
|
3012
|
+
"./assistant-ui/diff-viewer-stats": {
|
|
3013
|
+
types: "./dist/components/assistant-ui/elements/DiffViewerStats.d.ts",
|
|
3014
|
+
import: "./dist/components/assistant-ui/elements/DiffViewerStats.js"
|
|
3015
|
+
},
|
|
3016
|
+
"./assistant-ui/diff-viewer-file": {
|
|
3017
|
+
types: "./dist/components/assistant-ui/elements/DiffViewerFile.d.ts",
|
|
3018
|
+
import: "./dist/components/assistant-ui/elements/DiffViewerFile.js"
|
|
3019
|
+
},
|
|
3020
|
+
"./assistant-ui/diff-viewer-content": {
|
|
3021
|
+
types: "./dist/components/assistant-ui/elements/DiffViewerContent.d.ts",
|
|
3022
|
+
import: "./dist/components/assistant-ui/elements/DiffViewerContent.js"
|
|
3023
|
+
},
|
|
3024
|
+
"./assistant-ui/diff-viewer-header": {
|
|
3025
|
+
types: "./dist/components/assistant-ui/elements/DiffViewerHeader.d.ts",
|
|
3026
|
+
import: "./dist/components/assistant-ui/elements/DiffViewerHeader.js"
|
|
3027
|
+
},
|
|
3028
|
+
"./assistant-ui/diff-viewer-line": {
|
|
3029
|
+
types: "./dist/components/assistant-ui/elements/DiffViewerLine.d.ts",
|
|
3030
|
+
import: "./dist/components/assistant-ui/elements/DiffViewerLine.js"
|
|
3031
|
+
},
|
|
3032
|
+
"./assistant-ui/diff-viewer-split-line": {
|
|
3033
|
+
types: "./dist/components/assistant-ui/elements/DiffViewerSplitLine.d.ts",
|
|
3034
|
+
import: "./dist/components/assistant-ui/elements/DiffViewerSplitLine.js"
|
|
3035
|
+
},
|
|
3036
|
+
"./assistant-ui/eve-ask-question-toolkit": {
|
|
3037
|
+
types: "./dist/components/assistant-ui/eveAskQuestionToolkit.d.ts",
|
|
3038
|
+
import: "./dist/components/assistant-ui/eveAskQuestionToolkit.js"
|
|
3039
|
+
},
|
|
3040
|
+
"./assistant-ui/markdown.css": "./dist/assistant-ui/markdown.css",
|
|
3041
|
+
"./assistant-ui/geo-map.css": "./dist/assistant-ui/geo-map.css",
|
|
3042
|
+
"./assistant-ui/native/task-group": {
|
|
3043
|
+
types: "./dist/components/assistant-ui/native/TaskGroup.d.ts",
|
|
3044
|
+
import: "./dist/components/assistant-ui/native/TaskGroup.js"
|
|
3045
|
+
},
|
|
3046
|
+
"./assistant-ui/native/task-tray": {
|
|
3047
|
+
types: "./dist/components/assistant-ui/native/TaskTray.d.ts",
|
|
3048
|
+
import: "./dist/components/assistant-ui/native/TaskTray.js"
|
|
3049
|
+
},
|
|
3050
|
+
"./virtual-table": {
|
|
3051
|
+
types: "./dist/components/virtual-table/index.d.ts",
|
|
3052
|
+
import: "./dist/components/virtual-table/index.js"
|
|
3053
|
+
},
|
|
3054
|
+
"./color-picker": {
|
|
3055
|
+
types: "./dist/components/color-picker/index.d.ts",
|
|
3056
|
+
import: "./dist/components/color-picker/index.js"
|
|
3057
|
+
},
|
|
3058
|
+
"./file-upload": {
|
|
3059
|
+
types: "./dist/components/file-upload/index.d.ts",
|
|
3060
|
+
import: "./dist/components/file-upload/index.js"
|
|
3061
|
+
},
|
|
3062
|
+
"./image-crop": {
|
|
3063
|
+
types: "./dist/components/image-crop/index.d.ts",
|
|
3064
|
+
import: "./dist/components/image-crop/index.js"
|
|
3065
|
+
},
|
|
3066
|
+
"./editor": {
|
|
3067
|
+
types: "./dist/components/editor/index.d.ts",
|
|
3068
|
+
import: "./dist/components/editor/index.js"
|
|
3069
|
+
},
|
|
3070
|
+
"./tree": {
|
|
3071
|
+
types: "./dist/components/tree/index.d.ts",
|
|
3072
|
+
import: "./dist/components/tree/index.js"
|
|
3073
|
+
},
|
|
3074
|
+
"./data-grid": {
|
|
3075
|
+
types: "./dist/components/data-grid/index.d.ts",
|
|
3076
|
+
import: "./dist/components/data-grid/index.js"
|
|
3077
|
+
},
|
|
3078
|
+
"./virtual-data-grid": {
|
|
3079
|
+
types: "./dist/components/virtual-data-grid/index.d.ts",
|
|
3080
|
+
import: "./dist/components/virtual-data-grid/index.js"
|
|
3081
|
+
},
|
|
3082
|
+
"./event-calendar": {
|
|
3083
|
+
types: "./dist/components/event-calendar/index.d.ts",
|
|
3084
|
+
import: "./dist/components/event-calendar/index.js"
|
|
3085
|
+
},
|
|
3086
|
+
"./event-calendar.css": "./dist/event-calendar.css",
|
|
3087
|
+
"./gantt": {
|
|
3088
|
+
types: "./dist/components/gantt/index.d.ts",
|
|
3089
|
+
import: "./dist/components/gantt/index.js"
|
|
3090
|
+
},
|
|
3091
|
+
"./json-render": {
|
|
3092
|
+
types: "./dist/components/json-render/index.d.ts",
|
|
3093
|
+
import: "./dist/components/json-render/index.js"
|
|
3094
|
+
},
|
|
3095
|
+
"./json-render/catalog": {
|
|
3096
|
+
types: "./dist/components/json-render/catalog.d.ts",
|
|
3097
|
+
import: "./dist/components/json-render/catalog.js"
|
|
3098
|
+
}
|
|
3099
|
+
},
|
|
3100
|
+
publishConfig: {
|
|
3101
|
+
access: "public",
|
|
3102
|
+
registry: "https://registry.npmjs.org/"
|
|
3103
|
+
},
|
|
3104
|
+
scripts: {
|
|
3105
|
+
test: "vitest run --config .storybook/vitest.config.ts && bun run test:native && bun run test:package",
|
|
3106
|
+
"test:package": "bun run build && bun test scripts/__tests__ ./.storybook/__tests__/createStorybookViteConfig.test.ts",
|
|
3107
|
+
"test:preview": "bun test scripts/storybookPreview.test.ts",
|
|
3108
|
+
"test:prototype": "bun test --config=./cli/bunfig.toml --coverage cli && vitest run --config .storybook/vitest.prototype.config.ts --coverage",
|
|
3109
|
+
"test:native": "vitest run --config .storybook/vitest.native.config.ts",
|
|
3110
|
+
"test:coverage": "vitest run --config .storybook/vitest.coverage.config.ts --coverage",
|
|
3111
|
+
"test:contrast": "vitest run --config .storybook/vitest.contrast.config.ts",
|
|
3112
|
+
build: "bun scripts/build.ts",
|
|
3113
|
+
typecheck: "tsc --noEmit",
|
|
3114
|
+
lint: "oxlint --deny-warnings src .storybook scripts cli templates/prototype/src templates/prototype/vite.config.ts && oxfmt --check . && bun run lint:unused",
|
|
3115
|
+
"lint:unused": "ts-unused check tsconfig.json",
|
|
3116
|
+
storybook: "bun scripts/buildLlmDocs.ts && storybook dev --host 127.0.0.1 -p 6006 --no-open",
|
|
3117
|
+
"build-storybook": "bun scripts/buildLlmDocs.ts && storybook build",
|
|
3118
|
+
prepack: "bun run build",
|
|
3119
|
+
"test:reduced-motion": "vitest run --config .storybook/vitest.reduced-motion.config.ts",
|
|
3120
|
+
"test:visual": "vitest run --config .storybook/vitest.visual.config.ts Button.stories.tsx Badge.stories.tsx Card.stories.tsx Input.stories.tsx ScrollArea.stories.tsx",
|
|
3121
|
+
"test:visual:update": "bun run test:visual --update"
|
|
3122
|
+
},
|
|
3123
|
+
devDependencies: {
|
|
3124
|
+
"@assistant-ui/ai-sdk": "0.0.14",
|
|
3125
|
+
"@assistant-ui/generative-ui": "0.0.6",
|
|
3126
|
+
"@assistant-ui/react": "0.15.30",
|
|
3127
|
+
"@assistant-ui/react-markdown": "0.14.23",
|
|
3128
|
+
"@assistant-ui/react-mcp": "0.1.24",
|
|
3129
|
+
"@assistant-ui/react-syntax-highlighter": "0.14.7",
|
|
3130
|
+
"@assistant-ui/store": "0.3.22",
|
|
3131
|
+
"@base-ui/react": "^1.9.0",
|
|
3132
|
+
"@base-ui/utils": "0.5.0",
|
|
3133
|
+
"@date-fns/tz": "1.5.0",
|
|
3134
|
+
"@daypicker/persian": "^10.0.2",
|
|
3135
|
+
"@daypicker/react": "^10.0.2",
|
|
3136
|
+
"@fontsource-variable/jetbrains-mono": "^5.3.0",
|
|
3137
|
+
"@headless-tree/core": "1.8.0",
|
|
3138
|
+
"@headless-tree/react": "1.8.0",
|
|
3139
|
+
"@hookform/resolvers": "5.9.1",
|
|
3140
|
+
"@json-render/core": "0.21.1",
|
|
3141
|
+
"@json-render/react": "0.21.1",
|
|
3142
|
+
"@shadcn/react": "0.3.1",
|
|
3143
|
+
"@storybook/addon-a11y": "^10.6.1",
|
|
3144
|
+
"@storybook/addon-docs": "^10.6.1",
|
|
3145
|
+
"@storybook/addon-vitest": "^10.6.1",
|
|
3146
|
+
"@storybook/react-vite": "^10.6.1",
|
|
3147
|
+
"@tailwindcss/vite": "^4.3.3",
|
|
3148
|
+
"@tanstack/react-table": "9.2.8",
|
|
3149
|
+
"@tanstack/react-virtual": "3.14.13",
|
|
3150
|
+
"@testing-library/react": "^16.3.3",
|
|
3151
|
+
"@tiptap/core": "3.32.0",
|
|
3152
|
+
"@tiptap/pm": "3.32.0",
|
|
3153
|
+
"@tiptap/react": "3.32.0",
|
|
3154
|
+
"@tiptap/starter-kit": "3.32.0",
|
|
3155
|
+
"@types/bun": "^1.4.2",
|
|
3156
|
+
"@types/cssesc": "3.0.2",
|
|
3157
|
+
"@types/leaflet": "^1.9.22",
|
|
3158
|
+
"@types/react": "^19.3.0",
|
|
3159
|
+
"@types/react-big-calendar": "1.16.3",
|
|
3160
|
+
"@types/react-dom": "^19.3.0",
|
|
3161
|
+
"@types/react-syntax-highlighter": "^15.5.13",
|
|
3162
|
+
"@typescript/native": "npm:typescript@^7.0.2",
|
|
3163
|
+
"@vitejs/plugin-react": "^6.1.2",
|
|
3164
|
+
"@vitest/browser": "4.1.11",
|
|
3165
|
+
"@vitest/browser-playwright": "^4.1.6",
|
|
3166
|
+
"@vitest/coverage-istanbul": "4.1.11",
|
|
3167
|
+
"@vitest/coverage-v8": "^4.1.6",
|
|
3168
|
+
anser: "2.3.5",
|
|
3169
|
+
"beautiful-mermaid": "^1.1.3",
|
|
3170
|
+
bun: "1.4.2",
|
|
3171
|
+
"bun-plugin-tailwind": "^0.1.2",
|
|
3172
|
+
"chrono-node": "^2.10.2",
|
|
3173
|
+
"class-variance-authority": "^0.7.1",
|
|
3174
|
+
clsx: "^2.1.1",
|
|
3175
|
+
cmdk: "^1.1.1",
|
|
3176
|
+
"colorjs.io": "0.7.1",
|
|
3177
|
+
commander: "^15.0.0",
|
|
3178
|
+
cssesc: "3.0.0",
|
|
3179
|
+
"date-fns": "4.4.0",
|
|
3180
|
+
diff: "9.0.0",
|
|
3181
|
+
"embla-carousel-autoplay": "8.6.0",
|
|
3182
|
+
"embla-carousel-react": "^8.6.0",
|
|
3183
|
+
"es-toolkit": "1.52.0",
|
|
3184
|
+
"heat-graph": "0.0.25",
|
|
3185
|
+
"input-otp": "1.5.0",
|
|
3186
|
+
leaflet: "^1.9.4",
|
|
3187
|
+
"lucide-react": "^1.53.0",
|
|
3188
|
+
motion: "14.0.0",
|
|
3189
|
+
oxfmt: "^0.72.0",
|
|
3190
|
+
oxlint: "^1.87.0",
|
|
3191
|
+
"parse-diff": "0.12.0",
|
|
3192
|
+
playwright: "^1.64.0",
|
|
3193
|
+
"react-big-calendar": "1.20.0",
|
|
3194
|
+
"react-colorful": "5.8.1",
|
|
3195
|
+
"react-dropzone": "20.1.4",
|
|
3196
|
+
"react-hook-form": "7.89.0",
|
|
3197
|
+
"react-image-crop": "11.1.2",
|
|
3198
|
+
"react-markdown": "^10.1.0",
|
|
3199
|
+
"react-resizable-panels": "^4.14.3",
|
|
3200
|
+
"react-shiki": "^0.11.2",
|
|
3201
|
+
"react-syntax-highlighter": "^16.1.2",
|
|
3202
|
+
recharts: "3.8.0",
|
|
3203
|
+
"remark-gfm": "^4.0.1",
|
|
3204
|
+
shiki: "^4.5.0",
|
|
3205
|
+
sonner: "2.0.8",
|
|
3206
|
+
storybook: "^10.6.1",
|
|
3207
|
+
"strip-ansi": "7.2.0",
|
|
3208
|
+
"tailwind-merge": "^3.7.0",
|
|
3209
|
+
tailwindcss: "^4.3.3",
|
|
3210
|
+
"ts-unused": "3.7.1",
|
|
3211
|
+
"tw-animate-css": "^1.4.0",
|
|
3212
|
+
typescript: "npm:@typescript/typescript6@^6.0.2",
|
|
3213
|
+
"usehooks-ts": "^3.1.1",
|
|
3214
|
+
vite: "^8.3.4",
|
|
3215
|
+
vitest: "^4.1.6",
|
|
3216
|
+
"vitest-browser-react": "^2.3.0",
|
|
3217
|
+
zod: "4.6.5",
|
|
3218
|
+
zustand: "5.0.15"
|
|
3219
|
+
},
|
|
3220
|
+
peerDependencies: {
|
|
3221
|
+
"@assistant-ui/ai-sdk": "0.0.14",
|
|
3222
|
+
"@assistant-ui/generative-ui": "0.0.6",
|
|
3223
|
+
"@assistant-ui/react": "0.15.30",
|
|
3224
|
+
"@assistant-ui/react-markdown": "0.14.23",
|
|
3225
|
+
"@assistant-ui/react-mcp": "0.1.24",
|
|
3226
|
+
"@assistant-ui/react-syntax-highlighter": "0.14.7",
|
|
3227
|
+
"@assistant-ui/store": "0.3.22",
|
|
3228
|
+
"@base-ui/react": "^1.9.0",
|
|
3229
|
+
"@base-ui/utils": "0.5.0",
|
|
3230
|
+
"@date-fns/tz": "^1.5.0",
|
|
3231
|
+
"@daypicker/persian": "^10.0.2",
|
|
3232
|
+
"@daypicker/react": "^10.0.2",
|
|
3233
|
+
"@fontsource-variable/jetbrains-mono": "^5.3.0",
|
|
3234
|
+
"@headless-tree/core": "^1.8.0",
|
|
3235
|
+
"@headless-tree/react": "^1.8.0",
|
|
3236
|
+
"@json-render/core": "0.21.1",
|
|
3237
|
+
"@json-render/react": "0.21.1",
|
|
3238
|
+
"@shadcn/react": "0.3.1",
|
|
3239
|
+
"@tanstack/react-table": "9.2.8",
|
|
3240
|
+
"@tanstack/react-virtual": "^3.14.13",
|
|
3241
|
+
"@tiptap/core": "^3.32.0",
|
|
3242
|
+
"@tiptap/pm": "^3.32.0",
|
|
3243
|
+
"@tiptap/react": "^3.32.0",
|
|
3244
|
+
"@tiptap/starter-kit": "^3.32.0",
|
|
3245
|
+
"@types/react-big-calendar": "^1.16.3",
|
|
3246
|
+
anser: "2.3.5",
|
|
3247
|
+
"beautiful-mermaid": "^1.1.3",
|
|
3248
|
+
"class-variance-authority": "^0.7.1",
|
|
3249
|
+
clsx: "^2.1.1",
|
|
3250
|
+
cmdk: "^1.1.1",
|
|
3251
|
+
"colorjs.io": "0.7.1",
|
|
3252
|
+
cssesc: "3.0.0",
|
|
3253
|
+
"date-fns": "^4.4.0",
|
|
3254
|
+
diff: "9.0.0",
|
|
3255
|
+
"embla-carousel-react": "^8.6.0",
|
|
3256
|
+
"es-toolkit": "1.52.0",
|
|
3257
|
+
"heat-graph": "0.0.25",
|
|
3258
|
+
"input-otp": "1.5.0",
|
|
3259
|
+
leaflet: "^1.9.4",
|
|
3260
|
+
"lucide-react": "^1.53.0",
|
|
3261
|
+
"parse-diff": "0.12.0",
|
|
3262
|
+
react: "^19.3.0",
|
|
3263
|
+
"react-colorful": "^5.8.1",
|
|
3264
|
+
"react-dom": "^19.3.0",
|
|
3265
|
+
"react-dropzone": "^20.1.4",
|
|
3266
|
+
"react-image-crop": "^11.1.2",
|
|
3267
|
+
"react-markdown": "^10.1.0",
|
|
3268
|
+
"react-resizable-panels": "^4.14.3",
|
|
3269
|
+
"react-shiki": "^0.11.2",
|
|
3270
|
+
"react-syntax-highlighter": "^16.1.2",
|
|
3271
|
+
recharts: "3.8.0",
|
|
3272
|
+
"remark-gfm": "^4.0.1",
|
|
3273
|
+
shiki: "^4.5.0",
|
|
3274
|
+
sonner: "2.0.8",
|
|
3275
|
+
"strip-ansi": "7.2.0",
|
|
3276
|
+
"tailwind-merge": "^3.7.0",
|
|
3277
|
+
"tw-animate-css": "^1.4.0",
|
|
3278
|
+
"usehooks-ts": "^3.1.1",
|
|
3279
|
+
zustand: "5.0.15"
|
|
3280
|
+
},
|
|
3281
|
+
peerDependenciesMeta: {
|
|
3282
|
+
recharts: {
|
|
3283
|
+
optional: true
|
|
3284
|
+
},
|
|
3285
|
+
cssesc: {
|
|
3286
|
+
optional: true
|
|
3287
|
+
},
|
|
3288
|
+
"es-toolkit": {
|
|
3289
|
+
optional: true
|
|
3290
|
+
},
|
|
3291
|
+
"@daypicker/react": {
|
|
3292
|
+
optional: true
|
|
3293
|
+
},
|
|
3294
|
+
"@daypicker/persian": {
|
|
3295
|
+
optional: true
|
|
3296
|
+
},
|
|
3297
|
+
"embla-carousel-react": {
|
|
3298
|
+
optional: true
|
|
3299
|
+
},
|
|
3300
|
+
cmdk: {
|
|
3301
|
+
optional: true
|
|
3302
|
+
},
|
|
3303
|
+
"react-resizable-panels": {
|
|
3304
|
+
optional: true
|
|
3305
|
+
},
|
|
3306
|
+
"@fontsource-variable/jetbrains-mono": {
|
|
3307
|
+
optional: true
|
|
3308
|
+
},
|
|
3309
|
+
"@assistant-ui/ai-sdk": {
|
|
3310
|
+
optional: true
|
|
3311
|
+
},
|
|
3312
|
+
"@assistant-ui/generative-ui": {
|
|
3313
|
+
optional: true
|
|
3314
|
+
},
|
|
3315
|
+
"@assistant-ui/react": {
|
|
3316
|
+
optional: true
|
|
3317
|
+
},
|
|
3318
|
+
"@assistant-ui/react-markdown": {
|
|
3319
|
+
optional: true
|
|
3320
|
+
},
|
|
3321
|
+
"@assistant-ui/react-mcp": {
|
|
3322
|
+
optional: true
|
|
3323
|
+
},
|
|
3324
|
+
"@assistant-ui/react-syntax-highlighter": {
|
|
3325
|
+
optional: true
|
|
3326
|
+
},
|
|
3327
|
+
"@assistant-ui/store": {
|
|
3328
|
+
optional: true
|
|
3329
|
+
},
|
|
3330
|
+
"beautiful-mermaid": {
|
|
3331
|
+
optional: true
|
|
3332
|
+
},
|
|
3333
|
+
"heat-graph": {
|
|
3334
|
+
optional: true
|
|
3335
|
+
},
|
|
3336
|
+
leaflet: {
|
|
3337
|
+
optional: true
|
|
3338
|
+
},
|
|
3339
|
+
"react-markdown": {
|
|
3340
|
+
optional: true
|
|
3341
|
+
},
|
|
3342
|
+
"react-shiki": {
|
|
3343
|
+
optional: true
|
|
3344
|
+
},
|
|
3345
|
+
"react-syntax-highlighter": {
|
|
3346
|
+
optional: true
|
|
3347
|
+
},
|
|
3348
|
+
"remark-gfm": {
|
|
3349
|
+
optional: true
|
|
3350
|
+
},
|
|
3351
|
+
shiki: {
|
|
3352
|
+
optional: true
|
|
3353
|
+
},
|
|
3354
|
+
"strip-ansi": {
|
|
3355
|
+
optional: true
|
|
3356
|
+
},
|
|
3357
|
+
zustand: {
|
|
3358
|
+
optional: true
|
|
3359
|
+
},
|
|
3360
|
+
anser: {
|
|
3361
|
+
optional: true
|
|
3362
|
+
},
|
|
3363
|
+
diff: {
|
|
3364
|
+
optional: true
|
|
3365
|
+
},
|
|
3366
|
+
"parse-diff": {
|
|
3367
|
+
optional: true
|
|
3368
|
+
},
|
|
3369
|
+
"colorjs.io": {
|
|
3370
|
+
optional: true
|
|
3371
|
+
},
|
|
3372
|
+
"@tanstack/react-virtual": {
|
|
3373
|
+
optional: true
|
|
3374
|
+
},
|
|
3375
|
+
"react-dropzone": {
|
|
3376
|
+
optional: true
|
|
3377
|
+
},
|
|
3378
|
+
"react-image-crop": {
|
|
3379
|
+
optional: true
|
|
3380
|
+
},
|
|
3381
|
+
"react-colorful": {
|
|
3382
|
+
optional: true
|
|
3383
|
+
},
|
|
3384
|
+
"@headless-tree/core": {
|
|
3385
|
+
optional: true
|
|
3386
|
+
},
|
|
3387
|
+
"@headless-tree/react": {
|
|
3388
|
+
optional: true
|
|
3389
|
+
},
|
|
3390
|
+
"@tiptap/core": {
|
|
3391
|
+
optional: true
|
|
3392
|
+
},
|
|
3393
|
+
"@tiptap/react": {
|
|
3394
|
+
optional: true
|
|
3395
|
+
},
|
|
3396
|
+
"@tiptap/pm": {
|
|
3397
|
+
optional: true
|
|
3398
|
+
},
|
|
3399
|
+
"@tiptap/starter-kit": {
|
|
3400
|
+
optional: true
|
|
3401
|
+
},
|
|
3402
|
+
"date-fns": {
|
|
3403
|
+
optional: true
|
|
3404
|
+
},
|
|
3405
|
+
"@date-fns/tz": {
|
|
3406
|
+
optional: true
|
|
3407
|
+
},
|
|
3408
|
+
"@tanstack/react-table": {
|
|
3409
|
+
optional: true
|
|
3410
|
+
},
|
|
3411
|
+
"@types/react-big-calendar": {
|
|
3412
|
+
optional: true
|
|
3413
|
+
},
|
|
3414
|
+
"@json-render/core": {
|
|
3415
|
+
optional: true
|
|
3416
|
+
},
|
|
3417
|
+
"@json-render/react": {
|
|
3418
|
+
optional: true
|
|
3419
|
+
},
|
|
3420
|
+
"@base-ui/react": {
|
|
3421
|
+
optional: true
|
|
3422
|
+
},
|
|
3423
|
+
"@base-ui/utils": {
|
|
3424
|
+
optional: true
|
|
3425
|
+
},
|
|
3426
|
+
"@shadcn/react": {
|
|
3427
|
+
optional: true
|
|
3428
|
+
},
|
|
3429
|
+
"class-variance-authority": {
|
|
3430
|
+
optional: true
|
|
3431
|
+
},
|
|
3432
|
+
clsx: {
|
|
3433
|
+
optional: true
|
|
3434
|
+
},
|
|
3435
|
+
"input-otp": {
|
|
3436
|
+
optional: true
|
|
3437
|
+
},
|
|
3438
|
+
"lucide-react": {
|
|
3439
|
+
optional: true
|
|
3440
|
+
},
|
|
3441
|
+
sonner: {
|
|
3442
|
+
optional: true
|
|
3443
|
+
},
|
|
3444
|
+
"tailwind-merge": {
|
|
3445
|
+
optional: true
|
|
3446
|
+
},
|
|
3447
|
+
"tw-animate-css": {
|
|
3448
|
+
optional: true
|
|
3449
|
+
},
|
|
3450
|
+
"usehooks-ts": {
|
|
3451
|
+
optional: true
|
|
3452
|
+
}
|
|
3453
|
+
},
|
|
3454
|
+
packageManager: "bun@1.4.2",
|
|
3455
|
+
patchedDependencies: {
|
|
3456
|
+
"@shadcn/react@0.3.1": "patches/@shadcn%2Freact@0.3.1.patch",
|
|
3457
|
+
"sonner@2.0.8": "patches/sonner@2.0.8.patch",
|
|
3458
|
+
"input-otp@1.5.0": "patches/input-otp@1.5.0.patch",
|
|
3459
|
+
"@vitest/coverage-istanbul@4.1.11": "patches/@vitest%2Fcoverage-istanbul@4.1.11.patch",
|
|
3460
|
+
"storybook@10.6.1": "patches/storybook@10.6.1.patch",
|
|
3461
|
+
"uncontrollable@7.2.1": "patches/uncontrollable@7.2.1.patch"
|
|
3462
|
+
}
|
|
3463
|
+
};
|
|
3464
|
+
|
|
3465
|
+
// cli/createWorkspace.ts
|
|
3466
|
+
import { mkdir, rm } from "fs/promises";
|
|
3467
|
+
import { basename, resolve } from "path";
|
|
3468
|
+
async function createWorkspace(directory, templateDirectory) {
|
|
3469
|
+
const destination = resolve(directory);
|
|
3470
|
+
const files = await Array.fromAsync(new Bun.Glob("**/*").scan({ cwd: templateDirectory, dot: true, onlyFiles: true }));
|
|
3471
|
+
if (!files.length)
|
|
3472
|
+
throw new Error("Prototype templates are missing. Reinstall @alexgorbatchev/shadcn.");
|
|
3473
|
+
await mkdir(resolve(destination, ".."), { recursive: true });
|
|
3474
|
+
await mkdir(destination);
|
|
3475
|
+
try {
|
|
3476
|
+
for (const file of files) {
|
|
3477
|
+
await Bun.write(resolve(destination, file === "gitignore" ? ".gitignore" : file), Bun.file(resolve(templateDirectory, file)));
|
|
3478
|
+
}
|
|
3479
|
+
const peers = package_default.peerDependencies;
|
|
3480
|
+
const development = package_default.devDependencies;
|
|
3481
|
+
await Bun.write(resolve(destination, "package.json"), JSON.stringify({
|
|
3482
|
+
name: basename(destination).toLowerCase().replace(/[^a-z0-9-]/g, "-"),
|
|
3483
|
+
private: true,
|
|
3484
|
+
type: "module",
|
|
3485
|
+
packageManager: package_default.packageManager,
|
|
3486
|
+
dependencies: {
|
|
3487
|
+
[package_default.name]: package_default.version,
|
|
3488
|
+
react: peers.react,
|
|
3489
|
+
"react-dom": peers["react-dom"],
|
|
3490
|
+
"@base-ui/react": peers["@base-ui/react"],
|
|
3491
|
+
"@base-ui/utils": peers["@base-ui/utils"],
|
|
3492
|
+
"class-variance-authority": peers["class-variance-authority"],
|
|
3493
|
+
clsx: peers.clsx,
|
|
3494
|
+
"lucide-react": peers["lucide-react"],
|
|
3495
|
+
"tailwind-merge": peers["tailwind-merge"],
|
|
3496
|
+
"tw-animate-css": peers["tw-animate-css"],
|
|
3497
|
+
"usehooks-ts": peers["usehooks-ts"]
|
|
3498
|
+
},
|
|
3499
|
+
devDependencies: {
|
|
3500
|
+
vite: development.vite,
|
|
3501
|
+
"@vitejs/plugin-react": development["@vitejs/plugin-react"],
|
|
3502
|
+
"@tailwindcss/vite": development["@tailwindcss/vite"],
|
|
3503
|
+
tailwindcss: development.tailwindcss,
|
|
3504
|
+
"@types/react": development["@types/react"],
|
|
3505
|
+
"@types/react-dom": development["@types/react-dom"],
|
|
3506
|
+
"@types/bun": development["@types/bun"],
|
|
3507
|
+
"@typescript/native": development["@typescript/native"]
|
|
3508
|
+
}
|
|
3509
|
+
}, null, 2) + `
|
|
3510
|
+
`);
|
|
3511
|
+
} catch (error) {
|
|
3512
|
+
await rm(destination, { recursive: true, force: true });
|
|
3513
|
+
throw error;
|
|
3514
|
+
}
|
|
3515
|
+
return destination;
|
|
3516
|
+
}
|
|
3517
|
+
|
|
3518
|
+
// cli/runWorkspace.ts
|
|
3519
|
+
import { resolve as resolve2 } from "path";
|
|
3520
|
+
import { homedir } from "os";
|
|
3521
|
+
|
|
3522
|
+
// cli/formatOutput.ts
|
|
3523
|
+
function formatOutput(text, home) {
|
|
3524
|
+
return text.replaceAll(home, (match, offset, source) => {
|
|
3525
|
+
const before = source[offset - 1];
|
|
3526
|
+
const after = source[offset + match.length];
|
|
3527
|
+
return (!before || /[\s"'=(]/.test(before)) && (!after || /[/\\\s"'):]/.test(after)) ? "~" : match;
|
|
3528
|
+
});
|
|
3529
|
+
}
|
|
3530
|
+
|
|
3531
|
+
// cli/runWorkspace.ts
|
|
3532
|
+
async function runWorkspace(directory, action, port) {
|
|
3533
|
+
const cwd = resolve2(directory);
|
|
3534
|
+
const vite = resolve2(cwd, "node_modules/vite/bin/vite.js");
|
|
3535
|
+
if (!await Bun.file(resolve2(cwd, "vite.config.ts")).exists()) {
|
|
3536
|
+
throw new Error(`No prototype workspace at ${cwd}. Create one with shadcn-prototype workspace create <directory>.`);
|
|
3537
|
+
}
|
|
3538
|
+
if (!await Bun.file(vite).exists()) {
|
|
3539
|
+
throw new Error(`Dependencies are missing in ${cwd}. Run bun install in that directory first.`);
|
|
3540
|
+
}
|
|
3541
|
+
const args = action === "build" ? ["build"] : ["--host", "127.0.0.1", "--port", String(port), "--strictPort"];
|
|
3542
|
+
const child = Bun.spawn([process.execPath, vite, ...args], { cwd, stdin: "inherit", stdout: "pipe", stderr: "pipe" });
|
|
3543
|
+
const stop = () => child.kill("SIGTERM");
|
|
3544
|
+
process.once("SIGINT", stop);
|
|
3545
|
+
process.once("SIGTERM", stop);
|
|
3546
|
+
try {
|
|
3547
|
+
const forward = async (stream, output) => {
|
|
3548
|
+
const decoder = new TextDecoder;
|
|
3549
|
+
let pending = "";
|
|
3550
|
+
for await (const bytes of stream) {
|
|
3551
|
+
pending += decoder.decode(bytes, { stream: true });
|
|
3552
|
+
const end = pending.lastIndexOf(`
|
|
3553
|
+
`);
|
|
3554
|
+
if (end >= 0) {
|
|
3555
|
+
output.write(formatOutput(pending.slice(0, end + 1), homedir()));
|
|
3556
|
+
pending = pending.slice(end + 1);
|
|
3557
|
+
}
|
|
3558
|
+
}
|
|
3559
|
+
output.write(formatOutput(pending + decoder.decode(), homedir()));
|
|
3560
|
+
};
|
|
3561
|
+
await Promise.all([forward(child.stdout, process.stdout), forward(child.stderr, process.stderr)]);
|
|
3562
|
+
return await child.exited;
|
|
3563
|
+
} finally {
|
|
3564
|
+
child.kill("SIGTERM");
|
|
3565
|
+
await child.exited;
|
|
3566
|
+
process.removeListener("SIGINT", stop);
|
|
3567
|
+
process.removeListener("SIGTERM", stop);
|
|
3568
|
+
}
|
|
3569
|
+
}
|
|
3570
|
+
|
|
3571
|
+
// cli/createProgram.ts
|
|
3572
|
+
function createProgram(options) {
|
|
3573
|
+
const program = new Command("shadcn-prototype").description("Create and preview editable React mockups.").version(package_default.version).exitOverride().showHelpAfterError();
|
|
3574
|
+
program.configureOutput({ writeOut: options.writeOut, writeErr: options.writeErr });
|
|
3575
|
+
program.configureHelp({
|
|
3576
|
+
formatHelp(command, helper) {
|
|
3577
|
+
const lines = [`Usage: ${helper.commandUsage(command)}`, "", command.description(), "", "Options:"];
|
|
3578
|
+
for (const option of helper.visibleOptions(command))
|
|
3579
|
+
lines.push(` ${option.flags} ${option.description}`);
|
|
3580
|
+
const visit = (parent, prefix) => {
|
|
3581
|
+
const commands = helper.visibleCommands(parent);
|
|
3582
|
+
for (const [index, child] of commands.entries()) {
|
|
3583
|
+
const isLast = index === commands.length - 1;
|
|
3584
|
+
const marker = options.isAgent ? "- " : isLast ? "\u2570\u2500 " : "\u251C\u2500 ";
|
|
3585
|
+
const name = `${prefix}${marker}${helper.subcommandTerm(child)}`;
|
|
3586
|
+
lines.push(options.isAgent ? `${name}: ${child.description()}` : `${name.padEnd(44)} ${child.description()}`);
|
|
3587
|
+
visit(child, `${prefix}${options.isAgent ? " " : isLast ? " " : "\u2502 "}`);
|
|
3588
|
+
}
|
|
3589
|
+
};
|
|
3590
|
+
if (command.commands.length) {
|
|
3591
|
+
lines.push("", "Commands:");
|
|
3592
|
+
visit(command, " ");
|
|
3593
|
+
}
|
|
3594
|
+
const body = lines.map((line) => !options.isAgent && line.length > options.width ? `${line.slice(0, Math.max(0, options.width - 3))}...` : line).join(`
|
|
3595
|
+
`) + `
|
|
3596
|
+
`;
|
|
3597
|
+
return options.isAgent ? "ALERT: Agents must read `AGENT=1 shadcn-prototype skill` before using this tool.\n" + body : body;
|
|
3598
|
+
}
|
|
3599
|
+
});
|
|
3600
|
+
program.command("skill").description("Show the agent skill installation instructions.").action(() => {
|
|
3601
|
+
options.writeOut(`Install the shadcn-prototype skill using the Skills CLI:
|
|
3602
|
+
|
|
3603
|
+
npx skills add alexgorbatchev/shadcn --skill shadcn-prototype
|
|
3604
|
+
|
|
3605
|
+
Skill:
|
|
3606
|
+
|
|
3607
|
+
https://github.com/alexgorbatchev/shadcn/tree/main/skills/shadcn-prototype
|
|
3608
|
+
`);
|
|
3609
|
+
});
|
|
3610
|
+
const workspace = program.command("workspace").description("Manage local prototype workspaces.");
|
|
3611
|
+
workspace.command("create <directory>").description("Create a workspace with three runnable recipes.").action(async (directory) => {
|
|
3612
|
+
const destination = await createWorkspace(directory, options.templateDirectory);
|
|
3613
|
+
options.writeOut(`Created ${destination}
|
|
3614
|
+
Run bun install in that directory, then shadcn-prototype workspace start .
|
|
3615
|
+
`);
|
|
3616
|
+
});
|
|
3617
|
+
workspace.command("start [directory]").description("Preview a workspace with live updates.").option("-p, --port <number>", "Preview port (0 chooses an available port).", (value) => {
|
|
3618
|
+
const number = Number(value);
|
|
3619
|
+
if (!/^\d+$/.test(value) || !Number.isInteger(number) || number < 0 || number > 65535) {
|
|
3620
|
+
throw new InvalidArgumentError("Port must be an integer between 0 and 65535.");
|
|
3621
|
+
}
|
|
3622
|
+
return number;
|
|
3623
|
+
}, 5173).action(async (directory = ".", flags) => {
|
|
3624
|
+
process.exitCode = await runWorkspace(directory, "start", flags.port);
|
|
3625
|
+
});
|
|
3626
|
+
workspace.command("build [directory]").description("Build a workspace for static hosting.").action(async (directory = ".") => {
|
|
3627
|
+
process.exitCode = await runWorkspace(directory, "build", 0);
|
|
3628
|
+
});
|
|
3629
|
+
return program;
|
|
3630
|
+
}
|
|
3631
|
+
|
|
3632
|
+
// cli/main.ts
|
|
3633
|
+
async function main(options = {
|
|
3634
|
+
argv: process.argv,
|
|
3635
|
+
agent: process.env.AGENT,
|
|
3636
|
+
home: homedir2(),
|
|
3637
|
+
width: process.stdout.columns || Number(process.env.COLUMNS) || 100,
|
|
3638
|
+
writeOut: (text) => process.stdout.write(text),
|
|
3639
|
+
writeErr: (text) => process.stderr.write(text)
|
|
3640
|
+
}) {
|
|
3641
|
+
const isAgent = ["1", "true", "yes"].includes(options.agent ?? "");
|
|
3642
|
+
const program = createProgram({
|
|
3643
|
+
templateDirectory: resolve3(import.meta.dirname, "../templates/prototype"),
|
|
3644
|
+
isAgent,
|
|
3645
|
+
width: options.width,
|
|
3646
|
+
writeOut: (text) => options.writeOut(formatOutput(text, options.home)),
|
|
3647
|
+
writeErr: (text) => options.writeErr(formatOutput(text, options.home))
|
|
3648
|
+
});
|
|
3649
|
+
try {
|
|
3650
|
+
await program.parseAsync(options.argv);
|
|
3651
|
+
return Number(process.exitCode ?? 0);
|
|
3652
|
+
} catch (error) {
|
|
3653
|
+
if (error instanceof CommanderError)
|
|
3654
|
+
return error.exitCode;
|
|
3655
|
+
const message = error instanceof Error ? isAgent ? error.stack ?? error.message : error.message : String(error);
|
|
3656
|
+
options.writeErr(formatOutput(`ERR: ${message}
|
|
3657
|
+
`, options.home));
|
|
3658
|
+
return 1;
|
|
3659
|
+
}
|
|
3660
|
+
}
|
|
3661
|
+
if (import.meta.main)
|
|
3662
|
+
process.exitCode = await main();
|
|
3663
|
+
export {
|
|
3664
|
+
main
|
|
3665
|
+
};
|