@shell-shock/preset-cli 0.5.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/components/banner-function-declaration.cjs +6 -6
  2. package/dist/components/banner-function-declaration.d.cts +2 -2
  3. package/dist/components/banner-function-declaration.d.cts.map +1 -1
  4. package/dist/components/banner-function-declaration.d.mts +2 -2
  5. package/dist/components/banner-function-declaration.d.mts.map +1 -1
  6. package/dist/components/banner-function-declaration.mjs +6 -6
  7. package/dist/components/banner-function-declaration.mjs.map +1 -1
  8. package/dist/components/command-entry.cjs +178 -120
  9. package/dist/components/command-entry.d.cts +2 -2
  10. package/dist/components/command-entry.d.mts +2 -2
  11. package/dist/components/command-entry.mjs +177 -119
  12. package/dist/components/command-entry.mjs.map +1 -1
  13. package/dist/components/command-router.d.cts +3 -3
  14. package/dist/components/command-router.d.cts.map +1 -1
  15. package/dist/components/index.cjs +1 -0
  16. package/dist/components/index.d.cts +2 -2
  17. package/dist/components/index.d.mts +2 -2
  18. package/dist/components/index.mjs +2 -2
  19. package/dist/components/prompts-builtin.cjs +485 -57
  20. package/dist/components/prompts-builtin.d.cts +13 -9
  21. package/dist/components/prompts-builtin.d.cts.map +1 -1
  22. package/dist/components/prompts-builtin.d.mts +13 -9
  23. package/dist/components/prompts-builtin.d.mts.map +1 -1
  24. package/dist/components/prompts-builtin.mjs +495 -68
  25. package/dist/components/prompts-builtin.mjs.map +1 -1
  26. package/dist/components/virtual-command-entry.cjs +4 -3
  27. package/dist/components/virtual-command-entry.mjs +3 -2
  28. package/dist/components/virtual-command-entry.mjs.map +1 -1
  29. package/dist/index.cjs +3 -0
  30. package/dist/index.d.cts.map +1 -1
  31. package/dist/index.d.mts.map +1 -1
  32. package/dist/index.mjs +3 -0
  33. package/dist/index.mjs.map +1 -1
  34. package/dist/plugin-upgrade/dist/components/index.cjs +2 -0
  35. package/dist/plugin-upgrade/dist/components/index.mjs +4 -0
  36. package/dist/plugin-upgrade/dist/components/upgrade-builtin.cjs +661 -0
  37. package/dist/plugin-upgrade/dist/components/upgrade-builtin.mjs +655 -0
  38. package/dist/plugin-upgrade/dist/components/upgrade-builtin.mjs.map +1 -0
  39. package/dist/plugin-upgrade/dist/components/upgrade-command.cjs +96 -0
  40. package/dist/plugin-upgrade/dist/components/upgrade-command.mjs +96 -0
  41. package/dist/plugin-upgrade/dist/components/upgrade-command.mjs.map +1 -0
  42. package/dist/plugin-upgrade/dist/index.cjs +49 -0
  43. package/dist/plugin-upgrade/dist/index.mjs +49 -0
  44. package/dist/plugin-upgrade/dist/index.mjs.map +1 -0
  45. package/dist/types/plugin.d.cts +6 -10
  46. package/dist/types/plugin.d.cts.map +1 -1
  47. package/dist/types/plugin.d.mts +6 -10
  48. package/dist/types/plugin.d.mts.map +1 -1
  49. package/package.json +10 -10
@@ -3,18 +3,18 @@ import { VirtualCommandEntry } from "./virtual-command-entry.mjs";
3
3
  import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
4
4
  import { For, Match, Show, Switch, code, computed } from "@alloy-js/core";
5
5
  import { ElseIfClause, IfStatement } from "@alloy-js/typescript";
6
+ import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
7
+ import defu from "defu";
8
+ import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
6
9
  import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
10
+ import { joinPaths } from "@stryke/path/join";
7
11
  import { isDynamicPathSegment } from "@shell-shock/core/plugin-utils/context-helpers";
8
- import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
9
- import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
10
12
  import { EntryFile } from "@powerlines/plugin-alloy/typescript/components/entry-file";
11
13
  import { CommandHandlerDeclaration, CommandValidationLogic } from "@shell-shock/preset-script/components/command-entry";
12
14
  import { findFilePath, relativePath } from "@stryke/path/find";
13
- import { joinPaths } from "@stryke/path/join";
14
15
  import { replaceExtension } from "@stryke/path/replace";
15
16
  import { camelCase } from "@stryke/string-format/camel-case";
16
17
  import { pascalCase } from "@stryke/string-format/pascal-case";
17
- import defu from "defu";
18
18
 
19
19
  //#region src/components/command-entry.tsx
20
20
  /**
@@ -71,6 +71,7 @@ function CommandEntry(props) {
71
71
  ],
72
72
  prompts: [
73
73
  "text",
74
+ "numeric",
74
75
  "toggle",
75
76
  "select",
76
77
  "isCancel",
@@ -92,83 +93,113 @@ function CommandEntry(props) {
92
93
  get children() {
93
94
  return createComponent(CommandValidationLogic, { command });
94
95
  }
95
- }), createComponent(ElseIfClause, {
96
- get condition() {
97
- return code`!isHelp && (${Object.values(command.options ?? {}).filter((option) => !option.optional).map((option) => (option.kind === ReflectionKind.string || option.kind === ReflectionKind.number) && option.variadic ? `(!options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} || options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`}.length === 0)` : `options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} === undefined`).join(" || ")}${Object.values(command.options ?? {}).filter((option) => !option.optional).length > 0 && Object.values(command.arguments ?? {}).filter((argument) => !argument.optional).length > 0 ? " || " : ""}${Object.values(command.arguments ?? {}).filter((argument) => !argument.optional).map((argument) => (argument.kind === ReflectionKind.string || argument.kind === ReflectionKind.number) && argument.variadic ? `(!${camelCase(argument.name)} || ${camelCase(argument.name)}.length === 0)` : `${camelCase(argument.name)} === undefined`).join(" || ")}) `;
96
+ }), createComponent(Show, {
97
+ get when() {
98
+ return Object.values(command.options ?? {}).filter((option) => !option.optional).length > 0 || Object.values(command.arguments ?? {}).filter((argument) => !argument.optional).length > 0;
98
99
  },
99
100
  get children() {
100
- return [
101
- code`writeLine(""); `,
102
- createComponent(Spacing, {}),
103
- createComponent(For, {
104
- get each() {
105
- return Object.values(command.options ?? {});
106
- },
107
- doubleHardline: true,
108
- children: (option) => [createComponent(Show, {
109
- get when() {
110
- return !option.optional;
111
- },
112
- get children() {
113
- return [createComponent(IfStatement, {
114
- get condition() {
115
- return code`!options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`}`;
101
+ return createComponent(ElseIfClause, {
102
+ get condition() {
103
+ return code`!isHelp && (${Object.values(command.options ?? {}).filter((option) => !option.optional).map((option) => (option.kind === ReflectionKind.string || option.kind === ReflectionKind.number) && option.variadic ? `(!options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} || options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`}.length === 0)` : `options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} === undefined`).join(" || ")}${Object.values(command.options ?? {}).filter((option) => !option.optional).length > 0 && Object.values(command.arguments ?? {}).filter((argument) => !argument.optional).length > 0 ? " || " : ""}${Object.values(command.arguments ?? {}).filter((argument) => !argument.optional).map((argument) => (argument.kind === ReflectionKind.string || argument.kind === ReflectionKind.number) && argument.variadic ? `(!${camelCase(argument.name)} || ${camelCase(argument.name)}.length === 0)` : `${camelCase(argument.name)} === undefined`).join(" || ")}) `;
104
+ },
105
+ get children() {
106
+ return [
107
+ code`writeLine(""); `,
108
+ createComponent(Spacing, {}),
109
+ createComponent(For, {
110
+ get each() {
111
+ return Object.values(command.options ?? {});
112
+ },
113
+ doubleHardline: true,
114
+ children: (option) => [createComponent(Show, {
115
+ get when() {
116
+ return !option.optional;
116
117
  },
117
118
  get children() {
118
- return createComponent(Switch, { get children() {
119
- return [createComponent(Match, {
120
- get when() {
121
- return option.kind === ReflectionKind.string || option.kind === ReflectionKind.number;
122
- },
123
- get children() {
124
- return code`
119
+ return [createComponent(IfStatement, {
120
+ get condition() {
121
+ return code`!options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`}`;
122
+ },
123
+ get children() {
124
+ return createComponent(Switch, { get children() {
125
+ return [
126
+ createComponent(Match, {
127
+ get when() {
128
+ return option.kind === ReflectionKind.string;
129
+ },
130
+ get children() {
131
+ return code`
125
132
  const value = await text({
126
- message: "Please provide a${option.kind === ReflectionKind.number ? " numeric" : ""} value for the \\"${option.name}\\" option",
133
+ message: "Please provide a value for the \\"${option.name}\\" option",
127
134
  ${option.description ? `description: "${option.description}",
128
135
  ` : ""}validate(val) {
129
136
  if (!val || val.trim() === "") {
130
137
  return "A value must be provided for this option";
131
138
  }
132
- ${option.kind === ReflectionKind.number ? `if (Number.isNaN(Number(val))) {
133
- return "The value provided must be a valid number";
134
- }` : ""}
135
- return undefined;
139
+
140
+ return null;
136
141
  }
137
142
  });
138
143
  if (isCancel(value)) {
139
144
  return;
140
145
  }
141
146
 
142
- options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} = ${option.kind === ReflectionKind.number ? `Number(value)` : "value"};
147
+ options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} = value;
143
148
  `;
144
- }
145
- }), createComponent(Match, {
146
- get when() {
147
- return option.kind === ReflectionKind.boolean;
148
- },
149
- get children() {
150
- return code`
151
- options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} = await toggle({
152
- message: "Please select a value for the "${option.name}" option",
149
+ }
150
+ }),
151
+ createComponent(Match, {
152
+ get when() {
153
+ return option.kind === ReflectionKind.number;
154
+ },
155
+ get children() {
156
+ return code`
157
+ const value = await numeric({
158
+ message: "Please provide a numeric value for the \\"${option.name}\\" option",
159
+ ${option.description ? `description: "${option.description}",
160
+ ` : ""}
161
+ });
162
+ if (isCancel(value)) {
163
+ return;
164
+ }
165
+
166
+ options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} = value;
167
+ `;
168
+ }
169
+ }),
170
+ createComponent(Match, {
171
+ get when() {
172
+ return option.kind === ReflectionKind.boolean;
173
+ },
174
+ get children() {
175
+ return code`
176
+ const value = await toggle({
177
+ message: "Please select a value for the \\"${option.name}\\" option",
153
178
  ${option.description ? `description: "${option.description}",
154
179
  ` : ""}
155
180
  });
181
+ if (isCancel(value)) {
182
+ return;
183
+ }
184
+
185
+ options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} = value;
156
186
  `;
157
- }
158
- })];
159
- } });
160
- }
161
- }), createComponent(Show, {
162
- get when() {
163
- return (option.kind === ReflectionKind.string || option.kind === ReflectionKind.number) && option.variadic;
164
- },
165
- get children() {
166
- return createComponent(ElseIfClause, {
167
- get condition() {
168
- return code`options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`}.length === 0`;
187
+ }
188
+ })
189
+ ];
190
+ } });
191
+ }
192
+ }), createComponent(Show, {
193
+ get when() {
194
+ return (option.kind === ReflectionKind.string || option.kind === ReflectionKind.number) && option.variadic;
169
195
  },
170
196
  get children() {
171
- return code`
197
+ return createComponent(ElseIfClause, {
198
+ get condition() {
199
+ return code`options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`}.length === 0`;
200
+ },
201
+ get children() {
202
+ return code`
172
203
  const value = await text({
173
204
  message: "Please provide one or more${option.kind === ReflectionKind.number ? " numeric" : ""} values for the \\"${option.name}\\" option (values are separated by a \\",\\" character)",
174
205
  ${option.description ? `description: "${option.description}",
@@ -192,83 +223,108 @@ function CommandEntry(props) {
192
223
 
193
224
  options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} = value.split(",").map(value => value.trim()).filter(Boolean)${option.kind === ReflectionKind.number ? `.map(Number)` : ""} ;
194
225
  `;
226
+ }
227
+ });
195
228
  }
196
- });
229
+ })];
197
230
  }
198
- })];
199
- }
200
- })]
201
- }),
202
- createComponent(Spacing, {}),
203
- createComponent(For, {
204
- get each() {
205
- return command.arguments;
206
- },
207
- doubleHardline: true,
208
- children: (argument) => [createComponent(Show, {
209
- get when() {
210
- return !argument.optional;
211
- },
212
- get children() {
213
- return [createComponent(IfStatement, {
214
- get condition() {
215
- return code`!${camelCase(argument.name)}`;
231
+ })]
232
+ }),
233
+ createComponent(Spacing, {}),
234
+ createComponent(For, {
235
+ get each() {
236
+ return command.arguments;
237
+ },
238
+ doubleHardline: true,
239
+ children: (argument) => [createComponent(Show, {
240
+ get when() {
241
+ return !argument.optional;
216
242
  },
217
243
  get children() {
218
- return createComponent(Switch, { get children() {
219
- return [createComponent(Match, {
220
- get when() {
221
- return argument.kind === ReflectionKind.string || argument.kind === ReflectionKind.number;
222
- },
223
- get children() {
224
- return code`
244
+ return [createComponent(IfStatement, {
245
+ get condition() {
246
+ return code`!${camelCase(argument.name)}`;
247
+ },
248
+ get children() {
249
+ return createComponent(Switch, { get children() {
250
+ return [
251
+ createComponent(Match, {
252
+ get when() {
253
+ return argument.kind === ReflectionKind.string;
254
+ },
255
+ get children() {
256
+ return code`
225
257
  const value = await text({
226
- message: "Please provide a${argument.kind === ReflectionKind.number ? " numeric" : ""} value for the \\"${argument.name}\\" argument",
258
+ message: "Please provide a value for the \\"${argument.name}\\" argument",
227
259
  ${argument.description ? `description: "${argument.description}",
228
260
  ` : ""}validate(val) {
229
261
  if (!val || val.trim() === "") {
230
262
  return "A value must be provided for this argument";
231
263
  }
232
- ${argument.kind === ReflectionKind.number ? `if (Number.isNaN(Number(val))) {
233
- return "The provided value must be a valid number";
234
- }` : ""}
235
- return undefined;
264
+
265
+ return null;
236
266
  }
237
267
  });
238
268
  if (isCancel(value)) {
239
269
  return;
240
270
  }
241
271
 
242
- ${camelCase(argument.name)} = ${argument.kind === ReflectionKind.number ? `Number(value)` : "value"};
272
+ ${camelCase(argument.name)} = value;
273
+ `;
274
+ }
275
+ }),
276
+ createComponent(Match, {
277
+ get when() {
278
+ return argument.kind === ReflectionKind.number;
279
+ },
280
+ get children() {
281
+ return code`
282
+ const value = await numeric({
283
+ message: "Please provide a numeric value for the \\"${argument.name}\\" argument",
284
+ ${argument.description ? `description: "${argument.description}",
285
+ ` : ""}
286
+ });
287
+ if (isCancel(value)) {
288
+ return;
289
+ }
290
+
291
+ ${camelCase(argument.name)} = value;
243
292
  `;
244
- }
245
- }), createComponent(Match, {
246
- get when() {
247
- return argument.kind === ReflectionKind.boolean;
248
- },
249
- get children() {
250
- return code`
251
- ${camelCase(argument.name)} = await toggle({
293
+ }
294
+ }),
295
+ createComponent(Match, {
296
+ get when() {
297
+ return argument.kind === ReflectionKind.boolean;
298
+ },
299
+ get children() {
300
+ return code`
301
+ const value = await toggle({
252
302
  message: "Please select a value for the \\"${argument.name}\\" argument",
253
303
  ${argument.description ? `description: "${argument.description}",
254
304
  ` : ""}
255
305
  });
306
+ if (isCancel(value)) {
307
+ return;
308
+ }
309
+
310
+ ${camelCase(argument.name)} = value;
256
311
  `;
257
- }
258
- })];
259
- } });
260
- }
261
- }), createComponent(Show, {
262
- get when() {
263
- return (argument.kind === ReflectionKind.string || argument.kind === ReflectionKind.number) && argument.variadic;
264
- },
265
- get children() {
266
- return createComponent(ElseIfClause, {
267
- get condition() {
268
- return code`${camelCase(argument.name)}.length === 0`;
312
+ }
313
+ })
314
+ ];
315
+ } });
316
+ }
317
+ }), createComponent(Show, {
318
+ get when() {
319
+ return (argument.kind === ReflectionKind.string || argument.kind === ReflectionKind.number) && argument.variadic;
269
320
  },
270
321
  get children() {
271
- return code`
322
+ return createComponent(ElseIfClause, {
323
+ get condition() {
324
+ return code`${camelCase(argument.name)}.length === 0`;
325
+ },
326
+ get children() {
327
+ return code`
272
328
  const value = await text({
273
329
  message: "Please provide one or more${argument.kind === ReflectionKind.number ? " numeric" : ""} (values are separated by a \\",\\" character)",
274
330
  ${argument.description ? `description: "${argument.description}",
@@ -293,16 +349,18 @@ function CommandEntry(props) {
293
349
 
294
350
  ${camelCase(argument.name)} = value.split(",").map(value => value.trim()).filter(Boolean)${argument.kind === ReflectionKind.number ? `.map(Number)` : ""} ;
295
351
  `;
352
+ }
353
+ });
296
354
  }
297
- });
355
+ })];
298
356
  }
299
- })];
300
- }
301
- })]
302
- }),
303
- code`writeLine(""); `,
304
- createComponent(Spacing, {})
305
- ];
357
+ })]
358
+ }),
359
+ code`writeLine(""); `,
360
+ createComponent(Spacing, {})
361
+ ];
362
+ }
363
+ });
306
364
  }
307
365
  })];
308
366
  }
@@ -1 +1 @@
1
- {"version":3,"file":"command-entry.mjs","names":["code","computed","For","Match","Show","Switch","ElseIfClause","IfStatement","ReflectionKind","Spacing","usePowerlines","EntryFile","isDynamicPathSegment","CommandHandlerDeclaration","CommandValidationLogic","findFilePath","relativePath","joinPaths","replaceExtension","camelCase","pascalCase","defu","BannerFunctionDeclaration","VirtualCommandEntry","CommandEntry","props","command","imports","builtinImports","rest","context","filePath","segments","filter","segment","join","commandSourcePath","entryPath","value","entry","input","file","typeDefinition","output","id","_$createComponent","_$mergeProps","path","name","prompts","env","console","utils","children","_$createIntrinsic","banner","condition","Object","values","options","option","optional","map","kind","string","number","variadic","includes","length","arguments","argument","each","doubleHardline","when","description","boolean","child","isVirtual","fallback"],"sources":["../../src/components/command-entry.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, computed, For, Match, Show, Switch } from \"@alloy-js/core\";\nimport { ElseIfClause, IfStatement } from \"@alloy-js/typescript\";\nimport { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { EntryFileProps } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport { EntryFile } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport { isDynamicPathSegment } from \"@shell-shock/core/plugin-utils/context-helpers\";\nimport type { CommandTree } from \"@shell-shock/core/types/command\";\nimport {\n CommandHandlerDeclaration,\n CommandValidationLogic\n} from \"@shell-shock/preset-script/components/command-entry\";\nimport { findFilePath, relativePath } from \"@stryke/path/find\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { replaceExtension } from \"@stryke/path/replace\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport defu from \"defu\";\nimport type { CLIPresetContext } from \"../types/plugin\";\nimport { BannerFunctionDeclaration } from \"./banner-function-declaration\";\nimport { VirtualCommandEntry } from \"./virtual-command-entry\";\n\nexport interface CommandEntryProps extends Omit<\n EntryFileProps,\n \"path\" | \"typeDefinition\"\n> {\n command: CommandTree;\n}\n\n/**\n * The command entry point for the Shell Shock project.\n */\nexport function CommandEntry(props: CommandEntryProps) {\n const { command, imports, builtinImports, ...rest } = props;\n\n const context = usePowerlines<CLIPresetContext>();\n const filePath = computed(() =>\n joinPaths(\n command.segments\n .filter(segment => !isDynamicPathSegment(segment))\n .join(\"/\"),\n \"index.ts\"\n )\n );\n const commandSourcePath = computed(() =>\n replaceExtension(\n relativePath(\n joinPaths(context.entryPath, findFilePath(filePath.value)),\n command.entry.input?.file || command.entry.file\n )\n )\n );\n const typeDefinition = computed(() => ({\n ...command.entry,\n output: command.id\n }));\n\n return (\n <>\n <EntryFile\n {...rest}\n path={filePath.value}\n typeDefinition={typeDefinition.value}\n imports={defu(imports ?? {}, {\n [commandSourcePath.value]: `handle${pascalCase(command.name)}`,\n prompts: \"prompts\"\n })}\n builtinImports={defu(builtinImports ?? {}, {\n env: [\"env\", \"isDevelopment\", \"isDebug\"],\n console: [\n \"debug\",\n \"warn\",\n \"error\",\n \"table\",\n \"colors\",\n \"stripAnsi\",\n \"writeLine\",\n \"splitText\"\n ],\n utils: [\n \"useApp\",\n \"useArgs\",\n \"hasFlag\",\n \"isMinimal\",\n \"isInteractive\",\n \"isHelp\",\n \"isUnicodeSupported\",\n \"internal_commandContext\"\n ],\n prompts: [\"text\", \"toggle\", \"select\", \"isCancel\", \"sleep\"]\n })}>\n <BannerFunctionDeclaration command={command} />\n <hbr />\n <hbr />\n <CommandHandlerDeclaration\n command={command}\n banner={code`await banner(); `}>\n <IfStatement condition={code`!isInteractive`}>\n <CommandValidationLogic command={command} />\n </IfStatement>\n <ElseIfClause\n condition={code`!isHelp && (${Object.values(command.options ?? {})\n .filter(option => !option.optional)\n .map(option =>\n (option.kind === ReflectionKind.string ||\n option.kind === ReflectionKind.number) &&\n option.variadic\n ? `(!options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } || options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n }.length === 0)`\n : `options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } === undefined`\n )\n .join(\" || \")}${\n Object.values(command.options ?? {}).filter(\n option => !option.optional\n ).length > 0 &&\n Object.values(command.arguments ?? {}).filter(\n argument => !argument.optional\n ).length > 0\n ? \" || \"\n : \"\"\n }${Object.values(command.arguments ?? {})\n .filter(argument => !argument.optional)\n .map(argument =>\n (argument.kind === ReflectionKind.string ||\n argument.kind === ReflectionKind.number) &&\n argument.variadic\n ? `(!${camelCase(\n argument.name\n )} || ${camelCase(argument.name)}.length === 0)`\n : `${camelCase(argument.name)} === undefined`\n )\n .join(\" || \")}) `}>\n {code`writeLine(\"\"); `}\n <Spacing />\n <For each={Object.values(command.options ?? {})} doubleHardline>\n {option => (\n <>\n <Show when={!option.optional}>\n <IfStatement\n condition={code`!options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n }`}>\n <Switch>\n <Match\n when={\n option.kind === ReflectionKind.string ||\n option.kind === ReflectionKind.number\n }>{code`\n const value = await text({\n message: \"Please provide a${\n option.kind === ReflectionKind.number\n ? \" numeric\"\n : \"\"\n } value for the \\\\\"${option.name}\\\\\" option\",\n ${\n option.description\n ? `description: \"${option.description}\",\n `\n : \"\"\n }validate(val) {\n if (!val || val.trim() === \"\") {\n return \"A value must be provided for this option\";\n }\n ${\n option.kind === ReflectionKind.number\n ? `if (Number.isNaN(Number(val))) {\n return \"The value provided must be a valid number\";\n }`\n : \"\"\n }\n return undefined;\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } = ${\n option.kind === ReflectionKind.number\n ? `Number(value)`\n : \"value\"\n };\n `}</Match>\n <Match\n when={option.kind === ReflectionKind.boolean}>{code`\n options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } = await toggle({\n message: \"Please select a value for the \"${\n option.name\n }\" option\",\n ${\n option.description\n ? `description: \"${option.description}\",\n `\n : \"\"\n }\n });\n `}</Match>\n </Switch>\n </IfStatement>\n <Show\n when={\n (option.kind === ReflectionKind.string ||\n option.kind === ReflectionKind.number) &&\n option.variadic\n }>\n <ElseIfClause\n condition={code`options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n }.length === 0`}>\n {code`\n const value = await text({\n message: \"Please provide one or more${\n option.kind === ReflectionKind.number\n ? \" numeric\"\n : \"\"\n } values for the \\\\\"${option.name}\\\\\" option (values are separated by a \\\\\",\\\\\" character)\",\n ${\n option.description\n ? `description: \"${option.description}\",\n `\n : \"\"\n }validate(val) {\n if (!val || val.trim() === \"\") {\n return \"A value must be provided for this option\";\n }\n if (val.split(\",\").map(v => v.trim()).filter(Boolean).length === 0) {\n return \"At least one value must be provided for this option\";\n }\n ${\n option.kind === ReflectionKind.number\n ? `const invalidIndex = val.split(\",\").map(v => v.trim()).filter(Boolean).findIndex(v => Number.isNaN(Number(v));\n if (invalidIndex !== -1) {\n return \\`Invalid numeric value provided for item #\\${invalidIndex + 1} - all provided items must be a valid number\\`;\n } `\n : \"\"\n }\n return undefined;\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } = value.split(\",\").map(value => value.trim()).filter(Boolean)${\n option.kind === ReflectionKind.number\n ? `.map(Number)`\n : \"\"\n } ;\n `}\n </ElseIfClause>\n </Show>\n </Show>\n </>\n )}\n </For>\n <Spacing />\n <For each={command.arguments} doubleHardline>\n {argument => (\n <>\n <Show when={!argument.optional}>\n <IfStatement condition={code`!${camelCase(argument.name)}`}>\n <Switch>\n <Match\n when={\n argument.kind === ReflectionKind.string ||\n argument.kind === ReflectionKind.number\n }>{code`\n const value = await text({\n message: \"Please provide a${\n argument.kind === ReflectionKind.number\n ? \" numeric\"\n : \"\"\n } value for the \\\\\"${argument.name}\\\\\" argument\",\n ${\n argument.description\n ? `description: \"${argument.description}\",\n `\n : \"\"\n }validate(val) {\n if (!val || val.trim() === \"\") {\n return \"A value must be provided for this argument\";\n }\n ${\n argument.kind === ReflectionKind.number\n ? `if (Number.isNaN(Number(val))) {\n return \"The provided value must be a valid number\";\n }`\n : \"\"\n }\n return undefined;\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n ${camelCase(argument.name)} = ${\n argument.kind === ReflectionKind.number\n ? `Number(value)`\n : \"value\"\n };\n `}</Match>\n <Match\n when={argument.kind === ReflectionKind.boolean}>{code`\n ${camelCase(argument.name)} = await toggle({\n message: \"Please select a value for the \\\\\"${argument.name}\\\\\" argument\",\n ${\n argument.description\n ? `description: \"${argument.description}\",\n `\n : \"\"\n }\n });\n `}</Match>\n </Switch>\n </IfStatement>\n <Show\n when={\n (argument.kind === ReflectionKind.string ||\n argument.kind === ReflectionKind.number) &&\n argument.variadic\n }>\n <ElseIfClause\n condition={code`${camelCase(argument.name)}.length === 0`}>\n {code`\n const value = await text({\n message: \"Please provide one or more${\n argument.kind === ReflectionKind.number\n ? \" numeric\"\n : \"\"\n } (values are separated by a \\\\\",\\\\\" character)\",\n ${\n argument.description\n ? `description: \"${argument.description}\",\n `\n : \"\"\n }validate(val) {\n if (!val || val.trim() === \"\") {\n return \"A value must be provided for this argument\";\n }\n if (val.split(\",\").map(v => v.trim()).filter(Boolean).length === 0) {\n return \"At least one value must be provided for this argument\";\n }\n ${\n argument.kind === ReflectionKind.number\n ? `const invalidIndex = val.split(\",\").map(v => v.trim()).filter(Boolean).findIndex(v => Number.isNaN(Number(v));\n if (invalidIndex !== -1) {\n return \\`Invalid numeric value provided for item #\\${invalidIndex + 1} - all provided items must be a valid number\\`;\n } `\n : \"\"\n }\n\n return undefined;\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n ${camelCase(argument.name)} = value.split(\",\").map(value => value.trim()).filter(Boolean)${\n argument.kind === ReflectionKind.number\n ? `.map(Number)`\n : \"\"\n } ;\n `}\n </ElseIfClause>\n </Show>\n </Show>\n </>\n )}\n </For>\n {code`writeLine(\"\"); `}\n <Spacing />\n </ElseIfClause>\n </CommandHandlerDeclaration>\n </EntryFile>\n <For each={Object.values(command.children)}>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAmDA,SAAgBwB,aAAaC,OAA0B;CACrD,MAAM,EAAEC,SAASC,SAASC,gBAAgB,GAAGC,SAASJ;CAEtD,MAAMK,UAAUpB,eAAiC;CACjD,MAAMqB,WAAW9B,eACfgB,UACES,QAAQM,SACLC,QAAOC,YAAW,CAACtB,qBAAqBsB,QAAQ,CAAC,CACjDC,KAAK,IAAI,EACZ,WAEJ,CAAC;CACD,MAAMC,oBAAoBnC,eACxBiB,iBACEF,aACEC,UAAUa,QAAQO,WAAWtB,aAAagB,SAASO,MAAM,CAAC,EAC1DZ,QAAQa,MAAMC,OAAOC,QAAQf,QAAQa,MAAME,KAE/C,CACF,CAAC;CACD,MAAMC,iBAAiBzC,gBAAgB;EACrC,GAA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C,SAAO,EAAA,CAAA;SAAA;;OAAA,CAAA,CAAA;;KAAA,CAAA;IAAA;;EAAA,CAAA,CAAA,EAAAoC,gBAIb3C,KAAG;EAAA,IAACqE,OAAI;AAAA,UAAEd,OAAOC,OAAOhC,QAAQ2B,SAAS;;EAAAA,WACvCuB,UAAK/B,gBACHzC,MAAI;GAAA,IACHqE,OAAI;AAAA,WAAEG,MAAMC;;GAAS,IACrBC,WAAQ;AAAA,WAAAjC,gBAAGrB,cAAY,EAACE,SAASkD,OAAK,CAAA;;GAAA,IAAAvB,WAAA;AAAA,WAAAR,gBACrCtB,qBAAmB,EAACG,SAASkD,OAAK,CAAA;;GAAA,CAAA;EAEtC,CAAA,CAAA"}
1
+ {"version":3,"file":"command-entry.mjs","names":["code","computed","For","Match","Show","Switch","ElseIfClause","IfStatement","ReflectionKind","Spacing","usePowerlines","EntryFile","isDynamicPathSegment","CommandHandlerDeclaration","CommandValidationLogic","findFilePath","relativePath","joinPaths","replaceExtension","camelCase","pascalCase","defu","BannerFunctionDeclaration","VirtualCommandEntry","CommandEntry","props","command","imports","builtinImports","rest","context","filePath","segments","filter","segment","join","commandSourcePath","entryPath","value","entry","input","file","typeDefinition","output","id","_$createComponent","_$mergeProps","path","name","prompts","env","console","utils","children","_$createIntrinsic","banner","condition","when","Object","values","options","option","optional","length","arguments","argument","map","kind","string","number","variadic","includes","each","doubleHardline","description","boolean","child","isVirtual","fallback"],"sources":["../../src/components/command-entry.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, computed, For, Match, Show, Switch } from \"@alloy-js/core\";\nimport { ElseIfClause, IfStatement } from \"@alloy-js/typescript\";\nimport { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { EntryFileProps } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport { EntryFile } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport { isDynamicPathSegment } from \"@shell-shock/core/plugin-utils/context-helpers\";\nimport type { CommandTree } from \"@shell-shock/core/types/command\";\nimport {\n CommandHandlerDeclaration,\n CommandValidationLogic\n} from \"@shell-shock/preset-script/components/command-entry\";\nimport { findFilePath, relativePath } from \"@stryke/path/find\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { replaceExtension } from \"@stryke/path/replace\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport defu from \"defu\";\nimport type { CLIPresetContext } from \"../types/plugin\";\nimport { BannerFunctionDeclaration } from \"./banner-function-declaration\";\nimport { VirtualCommandEntry } from \"./virtual-command-entry\";\n\nexport interface CommandEntryProps extends Omit<\n EntryFileProps,\n \"path\" | \"typeDefinition\"\n> {\n command: CommandTree;\n}\n\n/**\n * The command entry point for the Shell Shock project.\n */\nexport function CommandEntry(props: CommandEntryProps) {\n const { command, imports, builtinImports, ...rest } = props;\n\n const context = usePowerlines<CLIPresetContext>();\n const filePath = computed(() =>\n joinPaths(\n command.segments\n .filter(segment => !isDynamicPathSegment(segment))\n .join(\"/\"),\n \"index.ts\"\n )\n );\n const commandSourcePath = computed(() =>\n replaceExtension(\n relativePath(\n joinPaths(context.entryPath, findFilePath(filePath.value)),\n command.entry.input?.file || command.entry.file\n )\n )\n );\n const typeDefinition = computed(() => ({\n ...command.entry,\n output: command.id\n }));\n\n return (\n <>\n <EntryFile\n {...rest}\n path={filePath.value}\n typeDefinition={typeDefinition.value}\n imports={defu(imports ?? {}, {\n [commandSourcePath.value]: `handle${pascalCase(command.name)}`,\n prompts: \"prompts\"\n })}\n builtinImports={defu(builtinImports ?? {}, {\n env: [\"env\", \"isDevelopment\", \"isDebug\"],\n console: [\n \"debug\",\n \"warn\",\n \"error\",\n \"table\",\n \"colors\",\n \"stripAnsi\",\n \"writeLine\",\n \"splitText\"\n ],\n utils: [\n \"useApp\",\n \"useArgs\",\n \"hasFlag\",\n \"isMinimal\",\n \"isInteractive\",\n \"isHelp\",\n \"isUnicodeSupported\",\n \"internal_commandContext\"\n ],\n prompts: [\"text\", \"numeric\", \"toggle\", \"select\", \"isCancel\", \"sleep\"]\n })}>\n <BannerFunctionDeclaration command={command} />\n <hbr />\n <hbr />\n <CommandHandlerDeclaration\n command={command}\n banner={code`await banner(); `}>\n <IfStatement condition={code`!isInteractive`}>\n <CommandValidationLogic command={command} />\n </IfStatement>\n <Show\n when={\n Object.values(command.options ?? {}).filter(\n option => !option.optional\n ).length > 0 ||\n Object.values(command.arguments ?? {}).filter(\n argument => !argument.optional\n ).length > 0\n }>\n <ElseIfClause\n condition={code`!isHelp && (${Object.values(command.options ?? {})\n .filter(option => !option.optional)\n .map(option =>\n (option.kind === ReflectionKind.string ||\n option.kind === ReflectionKind.number) &&\n option.variadic\n ? `(!options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } || options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n }.length === 0)`\n : `options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } === undefined`\n )\n .join(\" || \")}${\n Object.values(command.options ?? {}).filter(\n option => !option.optional\n ).length > 0 &&\n Object.values(command.arguments ?? {}).filter(\n argument => !argument.optional\n ).length > 0\n ? \" || \"\n : \"\"\n }${Object.values(command.arguments ?? {})\n .filter(argument => !argument.optional)\n .map(argument =>\n (argument.kind === ReflectionKind.string ||\n argument.kind === ReflectionKind.number) &&\n argument.variadic\n ? `(!${camelCase(\n argument.name\n )} || ${camelCase(argument.name)}.length === 0)`\n : `${camelCase(argument.name)} === undefined`\n )\n .join(\" || \")}) `}>\n {code`writeLine(\"\"); `}\n <Spacing />\n <For each={Object.values(command.options ?? {})} doubleHardline>\n {option => (\n <>\n <Show when={!option.optional}>\n <IfStatement\n condition={code`!options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n }`}>\n <Switch>\n <Match\n when={option.kind === ReflectionKind.string}>{code`\n const value = await text({\n message: \"Please provide a value for the \\\\\"${option.name}\\\\\" option\",\n ${\n option.description\n ? `description: \"${option.description}\",\n `\n : \"\"\n }validate(val) {\n if (!val || val.trim() === \"\") {\n return \"A value must be provided for this option\";\n }\n\n return null;\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } = value;\n `}</Match>\n <Match\n when={option.kind === ReflectionKind.number}>{code`\n const value = await numeric({\n message: \"Please provide a numeric value for the \\\\\"${option.name}\\\\\" option\",\n ${\n option.description\n ? `description: \"${option.description}\",\n `\n : \"\"\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } = value;\n `}</Match>\n <Match\n when={option.kind === ReflectionKind.boolean}>{code`\n const value = await toggle({\n message: \"Please select a value for the \\\\\"${\n option.name\n }\\\\\" option\",\n ${\n option.description\n ? `description: \"${option.description}\",\n `\n : \"\"\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } = value;\n `}</Match>\n </Switch>\n </IfStatement>\n <Show\n when={\n (option.kind === ReflectionKind.string ||\n option.kind === ReflectionKind.number) &&\n option.variadic\n }>\n <ElseIfClause\n condition={code`options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n }.length === 0`}>\n {code`\n const value = await text({\n message: \"Please provide one or more${\n option.kind === ReflectionKind.number\n ? \" numeric\"\n : \"\"\n } values for the \\\\\"${option.name}\\\\\" option (values are separated by a \\\\\",\\\\\" character)\",\n ${\n option.description\n ? `description: \"${option.description}\",\n `\n : \"\"\n }validate(val) {\n if (!val || val.trim() === \"\") {\n return \"A value must be provided for this option\";\n }\n if (val.split(\",\").map(v => v.trim()).filter(Boolean).length === 0) {\n return \"At least one value must be provided for this option\";\n }\n ${\n option.kind === ReflectionKind.number\n ? `const invalidIndex = val.split(\",\").map(v => v.trim()).filter(Boolean).findIndex(v => Number.isNaN(Number(v));\n if (invalidIndex !== -1) {\n return \\`Invalid numeric value provided for item #\\${invalidIndex + 1} - all provided items must be a valid number\\`;\n } `\n : \"\"\n }\n return undefined;\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } = value.split(\",\").map(value => value.trim()).filter(Boolean)${\n option.kind === ReflectionKind.number\n ? `.map(Number)`\n : \"\"\n } ;\n `}\n </ElseIfClause>\n </Show>\n </Show>\n </>\n )}\n </For>\n <Spacing />\n <For each={command.arguments} doubleHardline>\n {argument => (\n <>\n <Show when={!argument.optional}>\n <IfStatement\n condition={code`!${camelCase(argument.name)}`}>\n <Switch>\n <Match\n when={\n argument.kind === ReflectionKind.string\n }>{code`\n const value = await text({\n message: \"Please provide a value for the \\\\\"${argument.name}\\\\\" argument\",\n ${\n argument.description\n ? `description: \"${argument.description}\",\n `\n : \"\"\n }validate(val) {\n if (!val || val.trim() === \"\") {\n return \"A value must be provided for this argument\";\n }\n\n return null;\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n ${camelCase(argument.name)} = value;\n `}</Match>\n <Match\n when={\n argument.kind === ReflectionKind.number\n }>{code`\n const value = await numeric({\n message: \"Please provide a numeric value for the \\\\\"${argument.name}\\\\\" argument\",\n ${\n argument.description\n ? `description: \"${argument.description}\",\n `\n : \"\"\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n ${camelCase(argument.name)} = value;\n `}</Match>\n <Match\n when={\n argument.kind === ReflectionKind.boolean\n }>{code`\n const value = await toggle({\n message: \"Please select a value for the \\\\\"${argument.name}\\\\\" argument\",\n ${\n argument.description\n ? `description: \"${argument.description}\",\n `\n : \"\"\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n ${camelCase(argument.name)} = value;\n `}</Match>\n </Switch>\n </IfStatement>\n <Show\n when={\n (argument.kind === ReflectionKind.string ||\n argument.kind === ReflectionKind.number) &&\n argument.variadic\n }>\n <ElseIfClause\n condition={code`${camelCase(argument.name)}.length === 0`}>\n {code`\n const value = await text({\n message: \"Please provide one or more${\n argument.kind === ReflectionKind.number\n ? \" numeric\"\n : \"\"\n } (values are separated by a \\\\\",\\\\\" character)\",\n ${\n argument.description\n ? `description: \"${argument.description}\",\n `\n : \"\"\n }validate(val) {\n if (!val || val.trim() === \"\") {\n return \"A value must be provided for this argument\";\n }\n if (val.split(\",\").map(v => v.trim()).filter(Boolean).length === 0) {\n return \"At least one value must be provided for this argument\";\n }\n ${\n argument.kind === ReflectionKind.number\n ? `const invalidIndex = val.split(\",\").map(v => v.trim()).filter(Boolean).findIndex(v => Number.isNaN(Number(v));\n if (invalidIndex !== -1) {\n return \\`Invalid numeric value provided for item #\\${invalidIndex + 1} - all provided items must be a valid number\\`;\n } `\n : \"\"\n }\n\n return undefined;\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n ${camelCase(argument.name)} = value.split(\",\").map(value => value.trim()).filter(Boolean)${\n argument.kind === ReflectionKind.number\n ? `.map(Number)`\n : \"\"\n } ;\n `}\n </ElseIfClause>\n </Show>\n </Show>\n </>\n )}\n </For>\n {code`writeLine(\"\"); `}\n <Spacing />\n </ElseIfClause>\n </Show>\n </CommandHandlerDeclaration>\n </EntryFile>\n <For each={Object.values(command.children)}>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAmDA,SAAgBwB,aAAaC,OAA0B;CACrD,MAAM,EAAEC,SAASC,SAASC,gBAAgB,GAAGC,SAASJ;CAEtD,MAAMK,UAAUpB,eAAiC;CACjD,MAAMqB,WAAW9B,eACfgB,UACES,QAAQM,SACLC,QAAOC,YAAW,CAACtB,qBAAqBsB,QAAQ,CAAC,CACjDC,KAAK,IAAI,EACZ,WAEJ,CAAC;CACD,MAAMC,oBAAoBnC,eACxBiB,iBACEF,aACEC,UAAUa,QAAQO,WAAWtB,aAAagB,SAASO,MAAM,CAAC,EAC1DZ,QAAQa,MAAMC,OAAOC,QAAQf,QAAQa,MAAME,KAE/C,CACF,CAAC;CACD,MAAMC,iBAAiBzC,gBAAgB;EACrC,GAAGyB,QAAQa;EACXI,QAAQjB,QAAQkB;EACjB,EAAE;AAEH,QAAA,CAAAC,gBAEKlC,WAASmC,WACJjB,MAAI;EAAA,IACRkB,OAAI;AAAA,UAAEhB,SAASO;;EAAK,IACpBI,iBAAc;AAAA,UAAEA,eAAeJ;;EAAK,IACpCX,UAAO;AAAA,UAAEN,KAAKM,WAAW,EAAE,EAAE;KAC1BS,kBAAkBE,QAAQ,SAASlB,WAAWM,QAAQsB,KAAK;IAC5DC,SAAS;IACV,CAAC;;EAAA,IACFrB,iBAAc;AAAA,UAAEP,KAAKO,kBAAkB,EAAE,EAAE;IACzCsB,KAAK;KAAC;KAAO;KAAiB;KAAU;IACxCC,SAAS;KACP;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACD;IACDC,OAAO;KACL;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACD;IACDH,SAAS;KAAC;KAAQ;KAAW;KAAU;KAAU;KAAY;KAAO;IACrE,CAAC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AAA;;KAAA,CAAA;IAAA;;EAAA,CAAA,CAAA,EAAAoC,gBAKf3C,KAAG;EAAA,IAACsE,OAAI;AAAA,UAAEd,OAAOC,OAAOjC,QAAQ2B,SAAS;;EAAAA,WACvCuB,UAAK/B,gBACHzC,MAAI;GAAA,IACHqD,OAAI;AAAA,WAAEmB,MAAMC;;GAAS,IACrBC,WAAQ;AAAA,WAAAjC,gBAAGrB,cAAY,EAACE,SAASkD,OAAK,CAAA;;GAAA,IAAAvB,WAAA;AAAA,WAAAR,gBACrCtB,qBAAmB,EAACG,SAASkD,OAAK,CAAA;;GAAA,CAAA;EAEtC,CAAA,CAAA"}
@@ -1,4 +1,4 @@
1
- import * as _alloy_js_core0 from "@alloy-js/core";
1
+ import * as _alloy_js_core10 from "@alloy-js/core";
2
2
  import { CommandTree } from "@shell-shock/core/types/command";
3
3
  import { CommandRouterProps } from "@shell-shock/preset-script/components/command-router";
4
4
 
@@ -6,11 +6,11 @@ import { CommandRouterProps } from "@shell-shock/preset-script/components/comman
6
6
  interface CommandRouterSelectOptionsProps {
7
7
  commands?: Record<string, CommandTree>;
8
8
  }
9
- declare function CommandRouterSelectOptions(props: CommandRouterSelectOptionsProps): _alloy_js_core0.Children;
9
+ declare function CommandRouterSelectOptions(props: CommandRouterSelectOptionsProps): _alloy_js_core10.Children;
10
10
  /**
11
11
  * A component that renders a command router interface, allowing users to select and execute commands from a provided list of commands and segments. This component serves as a wrapper around the base CommandRouter, adding additional UI elements and logic for command selection.
12
12
  */
13
- declare function CommandRouter(props: CommandRouterProps): _alloy_js_core0.Children;
13
+ declare function CommandRouter(props: CommandRouterProps): _alloy_js_core10.Children;
14
14
  //#endregion
15
15
  export { CommandRouter, CommandRouterSelectOptions, CommandRouterSelectOptionsProps };
16
16
  //# sourceMappingURL=command-router.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-router.d.cts","names":[],"sources":["../../src/components/command-router.tsx"],"sourcesContent":[],"mappings":";;;;;UA4BiB,+BAAA;aACJ,eAAe;;AADX,iBAID,0BAAA,CAHY,KAAA,EAInB,+BAJU,CAAA,EAIqB,eAAA,CAAA,QAJrB;AAGnB;AAyBA;;iBAAgB,aAAA,QAAqB,qBAAkB,eAAA,CAAA"}
1
+ {"version":3,"file":"command-router.d.cts","names":[],"sources":["../../src/components/command-router.tsx"],"sourcesContent":[],"mappings":";;;;;UA4BiB,+BAAA;aACJ,eAAe;;AADX,iBAID,0BAAA,CAHY,KAAA,EAInB,+BAJU,CAAA,EAIqB,gBAAA,CAAA,QAJrB;AAGnB;AAyBA;;iBAAgB,aAAA,QAAqB,qBAAkB,gBAAA,CAAA"}
@@ -9,6 +9,7 @@ exports.BasePromptDeclarations = require_components_prompts_builtin.BasePromptDe
9
9
  exports.CommandEntry = require_components_command_entry.CommandEntry;
10
10
  exports.CommandRouter = require_components_command_router.CommandRouter;
11
11
  exports.CommandRouterSelectOptions = require_components_command_router.CommandRouterSelectOptions;
12
+ exports.ConfirmPromptDeclarations = require_components_prompts_builtin.ConfirmPromptDeclarations;
12
13
  exports.NumericPromptDeclarations = require_components_prompts_builtin.NumericPromptDeclarations;
13
14
  exports.PasswordPromptDeclaration = require_components_prompts_builtin.PasswordPromptDeclaration;
14
15
  exports.PromptsBuiltin = require_components_prompts_builtin.PromptsBuiltin;
@@ -1,6 +1,6 @@
1
1
  import { BannerFunctionDeclaration } from "./banner-function-declaration.cjs";
2
2
  import { CommandEntry, CommandEntryProps } from "./command-entry.cjs";
3
3
  import { CommandRouter, CommandRouterSelectOptions, CommandRouterSelectOptionsProps } from "./command-router.cjs";
4
- import { BasePromptDeclarations, NumericPromptDeclarations, PasswordPromptDeclaration, PromptsBuiltin, PromptsBuiltinProps, SelectPromptDeclarations, TextPromptDeclarations, TogglePromptDeclarations } from "./prompts-builtin.cjs";
4
+ import { BasePromptDeclarations, ConfirmPromptDeclarations, NumericPromptDeclarations, PasswordPromptDeclaration, PromptsBuiltin, PromptsBuiltinProps, SelectPromptDeclarations, TextPromptDeclarations, TogglePromptDeclarations } from "./prompts-builtin.cjs";
5
5
  import { VirtualCommandEntry, VirtualCommandEntryProps } from "./virtual-command-entry.cjs";
6
- export { BannerFunctionDeclaration, BasePromptDeclarations, CommandEntry, CommandEntryProps, CommandRouter, CommandRouterSelectOptions, CommandRouterSelectOptionsProps, NumericPromptDeclarations, PasswordPromptDeclaration, PromptsBuiltin, PromptsBuiltinProps, SelectPromptDeclarations, TextPromptDeclarations, TogglePromptDeclarations, VirtualCommandEntry, VirtualCommandEntryProps };
6
+ export { BannerFunctionDeclaration, BasePromptDeclarations, CommandEntry, CommandEntryProps, CommandRouter, CommandRouterSelectOptions, CommandRouterSelectOptionsProps, ConfirmPromptDeclarations, NumericPromptDeclarations, PasswordPromptDeclaration, PromptsBuiltin, PromptsBuiltinProps, SelectPromptDeclarations, TextPromptDeclarations, TogglePromptDeclarations, VirtualCommandEntry, VirtualCommandEntryProps };
@@ -1,6 +1,6 @@
1
1
  import { BannerFunctionDeclaration } from "./banner-function-declaration.mjs";
2
2
  import { CommandEntry, CommandEntryProps } from "./command-entry.mjs";
3
3
  import { CommandRouter, CommandRouterSelectOptions, CommandRouterSelectOptionsProps } from "./command-router.mjs";
4
- import { BasePromptDeclarations, NumericPromptDeclarations, PasswordPromptDeclaration, PromptsBuiltin, PromptsBuiltinProps, SelectPromptDeclarations, TextPromptDeclarations, TogglePromptDeclarations } from "./prompts-builtin.mjs";
4
+ import { BasePromptDeclarations, ConfirmPromptDeclarations, NumericPromptDeclarations, PasswordPromptDeclaration, PromptsBuiltin, PromptsBuiltinProps, SelectPromptDeclarations, TextPromptDeclarations, TogglePromptDeclarations } from "./prompts-builtin.mjs";
5
5
  import { VirtualCommandEntry, VirtualCommandEntryProps } from "./virtual-command-entry.mjs";
6
- export { BannerFunctionDeclaration, BasePromptDeclarations, CommandEntry, CommandEntryProps, CommandRouter, CommandRouterSelectOptions, CommandRouterSelectOptionsProps, NumericPromptDeclarations, PasswordPromptDeclaration, PromptsBuiltin, PromptsBuiltinProps, SelectPromptDeclarations, TextPromptDeclarations, TogglePromptDeclarations, VirtualCommandEntry, VirtualCommandEntryProps };
6
+ export { BannerFunctionDeclaration, BasePromptDeclarations, CommandEntry, CommandEntryProps, CommandRouter, CommandRouterSelectOptions, CommandRouterSelectOptionsProps, ConfirmPromptDeclarations, NumericPromptDeclarations, PasswordPromptDeclaration, PromptsBuiltin, PromptsBuiltinProps, SelectPromptDeclarations, TextPromptDeclarations, TogglePromptDeclarations, VirtualCommandEntry, VirtualCommandEntryProps };
@@ -2,6 +2,6 @@ import { BannerFunctionDeclaration } from "./banner-function-declaration.mjs";
2
2
  import { CommandRouter, CommandRouterSelectOptions } from "./command-router.mjs";
3
3
  import { VirtualCommandEntry } from "./virtual-command-entry.mjs";
4
4
  import { CommandEntry } from "./command-entry.mjs";
5
- import { BasePromptDeclarations, NumericPromptDeclarations, PasswordPromptDeclaration, PromptsBuiltin, SelectPromptDeclarations, TextPromptDeclarations, TogglePromptDeclarations } from "./prompts-builtin.mjs";
5
+ import { BasePromptDeclarations, ConfirmPromptDeclarations, NumericPromptDeclarations, PasswordPromptDeclaration, PromptsBuiltin, SelectPromptDeclarations, TextPromptDeclarations, TogglePromptDeclarations } from "./prompts-builtin.mjs";
6
6
 
7
- export { BannerFunctionDeclaration, BasePromptDeclarations, CommandEntry, CommandRouter, CommandRouterSelectOptions, NumericPromptDeclarations, PasswordPromptDeclaration, PromptsBuiltin, SelectPromptDeclarations, TextPromptDeclarations, TogglePromptDeclarations, VirtualCommandEntry };
7
+ export { BannerFunctionDeclaration, BasePromptDeclarations, CommandEntry, CommandRouter, CommandRouterSelectOptions, ConfirmPromptDeclarations, NumericPromptDeclarations, PasswordPromptDeclaration, PromptsBuiltin, SelectPromptDeclarations, TextPromptDeclarations, TogglePromptDeclarations, VirtualCommandEntry };