@shell-shock/core 0.17.10 → 0.17.11

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 (257) hide show
  1. package/dist/api.cjs +31 -143
  2. package/dist/api.cjs.map +1 -0
  3. package/dist/api.d.cts +2 -77
  4. package/dist/api.d.cts.map +1 -1
  5. package/dist/api.d.mts +2 -76
  6. package/dist/api.d.mts.map +1 -1
  7. package/dist/api.mjs +30 -140
  8. package/dist/api.mjs.map +1 -1
  9. package/dist/components/command-validation-logic.cjs +14 -15
  10. package/dist/components/command-validation-logic.cjs.map +1 -0
  11. package/dist/components/command-validation-logic.d.cts +1 -3
  12. package/dist/components/command-validation-logic.d.cts.map +1 -1
  13. package/dist/components/command-validation-logic.d.mts +1 -3
  14. package/dist/components/command-validation-logic.d.mts.map +1 -1
  15. package/dist/components/command-validation-logic.mjs +12 -13
  16. package/dist/components/command-validation-logic.mjs.map +1 -1
  17. package/dist/components/docs.cjs +6 -6
  18. package/dist/components/docs.cjs.map +1 -0
  19. package/dist/components/docs.d.cts +4 -5
  20. package/dist/components/docs.d.cts.map +1 -1
  21. package/dist/components/docs.d.mts +4 -5
  22. package/dist/components/docs.d.mts.map +1 -1
  23. package/dist/components/docs.mjs +4 -4
  24. package/dist/components/docs.mjs.map +1 -1
  25. package/dist/components/exec-builtin.cjs +9 -11
  26. package/dist/components/exec-builtin.cjs.map +1 -0
  27. package/dist/components/exec-builtin.d.cts +1 -2
  28. package/dist/components/exec-builtin.d.cts.map +1 -1
  29. package/dist/components/exec-builtin.d.mts +1 -2
  30. package/dist/components/exec-builtin.d.mts.map +1 -1
  31. package/dist/components/exec-builtin.mjs +7 -10
  32. package/dist/components/exec-builtin.mjs.map +1 -1
  33. package/dist/components/helpers.cjs +4 -5
  34. package/dist/components/helpers.cjs.map +1 -0
  35. package/dist/components/helpers.d.cts +6 -8
  36. package/dist/components/helpers.d.cts.map +1 -1
  37. package/dist/components/helpers.d.mts +6 -8
  38. package/dist/components/helpers.d.mts.map +1 -1
  39. package/dist/components/helpers.mjs +2 -3
  40. package/dist/components/helpers.mjs.map +1 -1
  41. package/dist/components/options-parser-logic.cjs +29 -30
  42. package/dist/components/options-parser-logic.cjs.map +1 -0
  43. package/dist/components/options-parser-logic.d.cts +8 -9
  44. package/dist/components/options-parser-logic.d.cts.map +1 -1
  45. package/dist/components/options-parser-logic.d.mts +8 -9
  46. package/dist/components/options-parser-logic.d.mts.map +1 -1
  47. package/dist/components/options-parser-logic.mjs +27 -28
  48. package/dist/components/options-parser-logic.mjs.map +1 -1
  49. package/dist/components/state-builtin.cjs +3 -2
  50. package/dist/components/state-builtin.cjs.map +1 -0
  51. package/dist/components/state-builtin.d.cts +4 -5
  52. package/dist/components/state-builtin.d.cts.map +1 -1
  53. package/dist/components/state-builtin.d.mts +4 -5
  54. package/dist/components/state-builtin.d.mts.map +1 -1
  55. package/dist/components/state-builtin.mjs +1 -1
  56. package/dist/components/state-builtin.mjs.map +1 -1
  57. package/dist/components/usage.cjs +4 -5
  58. package/dist/components/usage.cjs.map +1 -0
  59. package/dist/components/usage.d.cts +1 -2
  60. package/dist/components/usage.d.cts.map +1 -1
  61. package/dist/components/usage.d.mts +1 -2
  62. package/dist/components/usage.d.mts.map +1 -1
  63. package/dist/components/usage.mjs +2 -3
  64. package/dist/components/usage.mjs.map +1 -1
  65. package/dist/components/utils-builtin.cjs +5 -4
  66. package/dist/components/utils-builtin.cjs.map +1 -0
  67. package/dist/components/utils-builtin.d.cts +7 -8
  68. package/dist/components/utils-builtin.d.cts.map +1 -1
  69. package/dist/components/utils-builtin.d.mts +7 -8
  70. package/dist/components/utils-builtin.d.mts.map +1 -1
  71. package/dist/components/utils-builtin.mjs +3 -3
  72. package/dist/components/utils-builtin.mjs.map +1 -1
  73. package/dist/config.cjs +53 -19
  74. package/dist/config.cjs.map +1 -0
  75. package/dist/config.d.cts +29 -8
  76. package/dist/config.d.cts.map +1 -1
  77. package/dist/config.d.mts +29 -8
  78. package/dist/config.d.mts.map +1 -1
  79. package/dist/config.mjs +51 -18
  80. package/dist/config.mjs.map +1 -1
  81. package/dist/contexts/command.cjs +2 -2
  82. package/dist/contexts/command.cjs.map +1 -0
  83. package/dist/contexts/command.d.cts.map +1 -1
  84. package/dist/contexts/command.d.mts.map +1 -1
  85. package/dist/contexts/command.mjs.map +1 -1
  86. package/dist/contexts/options.cjs +4 -4
  87. package/dist/contexts/options.cjs.map +1 -0
  88. package/dist/contexts/options.d.cts.map +1 -1
  89. package/dist/contexts/options.d.mts.map +1 -1
  90. package/dist/contexts/options.mjs +2 -3
  91. package/dist/contexts/options.mjs.map +1 -1
  92. package/dist/engine.cjs +138 -0
  93. package/dist/engine.cjs.map +1 -0
  94. package/dist/engine.d.cts +79 -0
  95. package/dist/engine.d.cts.map +1 -0
  96. package/dist/engine.d.mts +79 -0
  97. package/dist/engine.d.mts.map +1 -0
  98. package/dist/engine.mjs +136 -0
  99. package/dist/engine.mjs.map +1 -0
  100. package/dist/helpers/automd.cjs +6 -7
  101. package/dist/helpers/automd.cjs.map +1 -0
  102. package/dist/helpers/automd.mjs +2 -3
  103. package/dist/helpers/automd.mjs.map +1 -1
  104. package/dist/helpers/docs-helpers.cjs +2 -2
  105. package/dist/helpers/docs-helpers.cjs.map +1 -0
  106. package/dist/helpers/docs-helpers.mjs.map +1 -1
  107. package/dist/helpers/get-framework.cjs +24 -0
  108. package/dist/helpers/get-framework.cjs.map +1 -0
  109. package/dist/helpers/get-framework.mjs +24 -0
  110. package/dist/helpers/get-framework.mjs.map +1 -0
  111. package/dist/helpers/paths.cjs +5 -5
  112. package/dist/helpers/paths.cjs.map +1 -0
  113. package/dist/helpers/paths.mjs +4 -4
  114. package/dist/helpers/paths.mjs.map +1 -1
  115. package/dist/helpers/persistence.cjs +4 -6
  116. package/dist/helpers/persistence.cjs.map +1 -0
  117. package/dist/helpers/persistence.mjs +3 -3
  118. package/dist/helpers/persistence.mjs.map +1 -1
  119. package/dist/helpers/update-package-json.cjs +2 -2
  120. package/dist/helpers/update-package-json.cjs.map +1 -0
  121. package/dist/helpers/update-package-json.mjs.map +1 -1
  122. package/dist/helpers/utilities.cjs +3 -3
  123. package/dist/helpers/utilities.cjs.map +1 -0
  124. package/dist/helpers/utilities.mjs +1 -1
  125. package/dist/helpers/utilities.mjs.map +1 -1
  126. package/dist/helpers/validations.cjs +3 -3
  127. package/dist/helpers/validations.cjs.map +1 -0
  128. package/dist/helpers/validations.mjs +1 -3
  129. package/dist/helpers/validations.mjs.map +1 -1
  130. package/dist/index.cjs +121 -51
  131. package/dist/index.cjs.map +1 -0
  132. package/dist/index.d.cts +80 -5
  133. package/dist/index.d.cts.map +1 -0
  134. package/dist/index.d.mts +80 -5
  135. package/dist/index.d.mts.map +1 -0
  136. package/dist/index.mjs +118 -6
  137. package/dist/index.mjs.map +1 -0
  138. package/dist/package.cjs +12 -0
  139. package/dist/package.cjs.map +1 -0
  140. package/dist/package.mjs +6 -0
  141. package/dist/package.mjs.map +1 -0
  142. package/dist/plugin-utils/compute-bin.cjs +8 -10
  143. package/dist/plugin-utils/compute-bin.cjs.map +1 -0
  144. package/dist/plugin-utils/compute-bin.d.cts +2 -2
  145. package/dist/plugin-utils/compute-bin.d.cts.map +1 -1
  146. package/dist/plugin-utils/compute-bin.d.mts +2 -2
  147. package/dist/plugin-utils/compute-bin.d.mts.map +1 -1
  148. package/dist/plugin-utils/compute-bin.mjs +6 -8
  149. package/dist/plugin-utils/compute-bin.mjs.map +1 -1
  150. package/dist/plugin-utils/context-helpers.cjs +7 -14
  151. package/dist/plugin-utils/context-helpers.cjs.map +1 -0
  152. package/dist/plugin-utils/context-helpers.d.cts +4 -4
  153. package/dist/plugin-utils/context-helpers.d.cts.map +1 -1
  154. package/dist/plugin-utils/context-helpers.d.mts +4 -4
  155. package/dist/plugin-utils/context-helpers.d.mts.map +1 -1
  156. package/dist/plugin-utils/context-helpers.mjs +5 -12
  157. package/dist/plugin-utils/context-helpers.mjs.map +1 -1
  158. package/dist/plugin-utils/deepkit.cjs +15 -16
  159. package/dist/plugin-utils/deepkit.cjs.map +1 -0
  160. package/dist/plugin-utils/deepkit.d.cts +5 -5
  161. package/dist/plugin-utils/deepkit.d.cts.map +1 -1
  162. package/dist/plugin-utils/deepkit.d.mts +5 -5
  163. package/dist/plugin-utils/deepkit.d.mts.map +1 -1
  164. package/dist/plugin-utils/deepkit.mjs +14 -15
  165. package/dist/plugin-utils/deepkit.mjs.map +1 -1
  166. package/dist/plugin-utils/description-helpers.cjs +2 -1
  167. package/dist/plugin-utils/description-helpers.cjs.map +1 -0
  168. package/dist/plugin-utils/description-helpers.d.cts.map +1 -1
  169. package/dist/plugin-utils/description-helpers.d.mts.map +1 -1
  170. package/dist/plugin-utils/description-helpers.mjs.map +1 -1
  171. package/dist/plugin-utils/get-command-tree.cjs +2 -1
  172. package/dist/plugin-utils/get-command-tree.cjs.map +1 -0
  173. package/dist/plugin-utils/get-command-tree.d.cts.map +1 -1
  174. package/dist/plugin-utils/get-command-tree.d.mts.map +1 -1
  175. package/dist/plugin-utils/get-command-tree.mjs.map +1 -1
  176. package/dist/plugin-utils/index.cjs +1 -1
  177. package/dist/plugin-utils/index.d.cts +2 -2
  178. package/dist/plugin-utils/index.d.mts +2 -2
  179. package/dist/plugin-utils/index.mjs +2 -2
  180. package/dist/plugin-utils/reflect.cjs +5 -5
  181. package/dist/plugin-utils/reflect.cjs.map +1 -0
  182. package/dist/plugin-utils/reflect.d.cts.map +1 -1
  183. package/dist/plugin-utils/reflect.d.mts.map +1 -1
  184. package/dist/plugin-utils/reflect.mjs +3 -5
  185. package/dist/plugin-utils/reflect.mjs.map +1 -1
  186. package/dist/plugin-utils/traverse-command-tree.cjs +2 -1
  187. package/dist/plugin-utils/traverse-command-tree.cjs.map +1 -0
  188. package/dist/plugin-utils/traverse-command-tree.d.cts.map +1 -1
  189. package/dist/plugin-utils/traverse-command-tree.d.mts.map +1 -1
  190. package/dist/plugin-utils/traverse-command-tree.mjs.map +1 -1
  191. package/dist/plugin-utils/type-checks.cjs +146 -17
  192. package/dist/plugin-utils/type-checks.cjs.map +1 -0
  193. package/dist/plugin-utils/type-checks.d.cts +5 -5
  194. package/dist/plugin-utils/type-checks.d.cts.map +1 -1
  195. package/dist/plugin-utils/type-checks.d.mts +5 -5
  196. package/dist/plugin-utils/type-checks.d.mts.map +1 -1
  197. package/dist/plugin-utils/type-checks.mjs +145 -16
  198. package/dist/plugin-utils/type-checks.mjs.map +1 -1
  199. package/dist/plugin.cjs +80 -56
  200. package/dist/plugin.cjs.map +1 -0
  201. package/dist/plugin.d.cts.map +1 -1
  202. package/dist/plugin.d.mts.map +1 -1
  203. package/dist/plugin.mjs +75 -52
  204. package/dist/plugin.mjs.map +1 -1
  205. package/dist/resolver/helpers.cjs +33 -24
  206. package/dist/resolver/helpers.cjs.map +1 -0
  207. package/dist/resolver/helpers.mjs +32 -22
  208. package/dist/resolver/helpers.mjs.map +1 -1
  209. package/dist/resolver/resolve.cjs +316 -59
  210. package/dist/resolver/resolve.cjs.map +1 -0
  211. package/dist/resolver/resolve.mjs +313 -56
  212. package/dist/resolver/resolve.mjs.map +1 -1
  213. package/dist/types/command.cjs +43 -82
  214. package/dist/types/command.cjs.map +1 -0
  215. package/dist/types/command.d.cts +61 -119
  216. package/dist/types/command.d.cts.map +1 -1
  217. package/dist/types/command.d.mts +61 -119
  218. package/dist/types/command.d.mts.map +1 -1
  219. package/dist/types/command.mjs +42 -80
  220. package/dist/types/command.mjs.map +1 -1
  221. package/dist/types/config.cjs +45 -4
  222. package/dist/types/config.cjs.map +1 -0
  223. package/dist/types/config.d.cts +15 -10
  224. package/dist/types/config.d.cts.map +1 -1
  225. package/dist/types/config.d.mts +15 -10
  226. package/dist/types/config.d.mts.map +1 -1
  227. package/dist/types/config.mjs +40 -4
  228. package/dist/types/config.mjs.map +1 -1
  229. package/dist/types/context.cjs +9 -1
  230. package/dist/types/context.cjs.map +1 -0
  231. package/dist/types/context.d.cts +3 -2
  232. package/dist/types/context.d.cts.map +1 -1
  233. package/dist/types/context.d.mts +3 -2
  234. package/dist/types/context.d.mts.map +1 -1
  235. package/dist/types/context.mjs +7 -1
  236. package/dist/types/context.mjs.map +1 -1
  237. package/dist/types/env.cjs +2 -1
  238. package/dist/types/env.cjs.map +1 -0
  239. package/dist/types/env.d.cts.map +1 -1
  240. package/dist/types/env.d.mts.map +1 -1
  241. package/dist/types/env.mjs.map +1 -1
  242. package/dist/types/index.cjs +6 -3
  243. package/dist/types/index.d.cts +4 -4
  244. package/dist/types/index.d.mts +4 -4
  245. package/dist/types/index.mjs +4 -4
  246. package/dist/types/options.cjs +2 -1
  247. package/dist/types/options.cjs.map +1 -0
  248. package/dist/types/options.d.cts.map +1 -1
  249. package/dist/types/options.d.mts.map +1 -1
  250. package/dist/types/options.mjs.map +1 -1
  251. package/package.json +43 -35
  252. package/dist/resolver/deepkit.cjs +0 -135
  253. package/dist/resolver/deepkit.mjs +0 -135
  254. package/dist/resolver/deepkit.mjs.map +0 -1
  255. package/dist/resolver/module.cjs +0 -145
  256. package/dist/resolver/module.mjs +0 -145
  257. package/dist/resolver/module.mjs.map +0 -1
@@ -1,18 +1,9 @@
1
- import { JsonSchema7TupleType } from "@stryke/json";
2
- import { ResolvedEntryTypeDefinition } from "powerlines";
3
- import { AnyFunction } from "@stryke/types/base";
4
- import { StandardJSONSchemaV1 } from "@standard-schema/spec";
5
- import { JSONSchema7Object } from "json-schema";
6
- import * as z3 from "zod/v3";
1
+ import { JsonSchemaStringFormat, SchemaInput } from "@powerlines/schema";
2
+ import { ResolvedEntryFileReference } from "powerlines";
3
+ import { AnyFunction, RequiredKeys } from "@stryke/types/base";
7
4
 
8
5
  //#region src/types/command.d.ts
9
- type CommandParameterType = string | number | boolean | (string | number)[];
10
- declare const CommandParameterKinds: {
11
- readonly string: "string";
12
- readonly number: "number";
13
- readonly boolean: "boolean";
14
- };
15
- type CommandParameterKind = (typeof CommandParameterKinds)[keyof typeof CommandParameterKinds];
6
+ type CommandParameterType = "string" | "number" | "boolean";
16
7
  interface BaseCommandParameter {
17
8
  /**
18
9
  * The option name.
@@ -21,7 +12,7 @@ interface BaseCommandParameter {
21
12
  /**
22
13
  * The option kind.
23
14
  */
24
- kind: CommandParameterKind;
15
+ type: CommandParameterType;
25
16
  /**
26
17
  * The display title.
27
18
  */
@@ -43,9 +34,9 @@ interface BaseCommandParameter {
43
34
  */
44
35
  env: string | false;
45
36
  /**
46
- * Whether the option is optional.
37
+ * Whether the option is required.
47
38
  */
48
- optional: boolean;
39
+ required: boolean;
49
40
  /**
50
41
  * Whether the option accepts multiple values.
51
42
  */
@@ -75,7 +66,7 @@ interface BaseStringCommandParameter extends BaseCommandParameter {
75
66
  /**
76
67
  * The option kind.
77
68
  */
78
- kind: "string";
69
+ type: "string";
79
70
  /**
80
71
  * The default value.
81
72
  */
@@ -83,7 +74,7 @@ interface BaseStringCommandParameter extends BaseCommandParameter {
83
74
  /**
84
75
  * A standard string format to validate the option value against.
85
76
  */
86
- format?: "email" | "uri" | "uuid" | "ipv4" | "ipv6" | "date" | "time" | "date-time" | "duration";
77
+ format?: JsonSchemaStringFormat | string;
87
78
  /**
88
79
  * The allowed choices for the option value.
89
80
  */
@@ -114,7 +105,7 @@ interface BaseNumberCommandParameter extends BaseCommandParameter {
114
105
  /**
115
106
  * The option kind.
116
107
  */
117
- kind: "number";
108
+ type: "number";
118
109
  /**
119
110
  * The default value.
120
111
  */
@@ -149,7 +140,7 @@ interface BaseBooleanCommandParameter extends BaseCommandParameter {
149
140
  /**
150
141
  * The option kind.
151
142
  */
152
- kind: "boolean";
143
+ type: "boolean";
153
144
  /**
154
145
  * The default value.
155
146
  */
@@ -177,7 +168,7 @@ interface VariadicBooleanCommandParameter extends BaseBooleanCommandParameter {
177
168
  }
178
169
  type BooleanCommandParameter = SingleBooleanCommandParameter | VariadicBooleanCommandParameter;
179
170
  type CommandParameter = StringCommandParameter | NumberCommandParameter | BooleanCommandParameter;
180
- type AsCommandParameterConfig<T extends BaseCommandParameter> = Pick<T, "kind" | "alias"> & Partial<Omit<T, "kind" | "alias">> & {
171
+ type AsCommandParameterConfig<T extends BaseCommandParameter> = Pick<T, "type"> & Partial<Omit<T, "type" | "alias">> & {
181
172
  alias?: string | string[];
182
173
  };
183
174
  type StringCommandParameterConfig = AsCommandParameterConfig<StringCommandParameter>;
@@ -198,7 +189,48 @@ type CommandOption = StringCommandParameter | NumberCommandParameter | BooleanCo
198
189
  type CommandOptionConfig = AsCommandParameterConfig<CommandOption>;
199
190
  type CommandArgument = StringCommandParameter | NumberCommandParameter | BooleanCommandParameter;
200
191
  type CommandArgumentConfig = AsCommandParameterConfig<CommandArgument>;
201
- interface CommandBase {
192
+ interface CommandMetadata {
193
+ /**
194
+ * The display name of the command.
195
+ *
196
+ * @remarks
197
+ * This value will be used in various displays of the user interface and documentation. If not provided, a formatted value of the command name will be used.
198
+ */
199
+ title?: string;
200
+ /**
201
+ * A brief description of what the command does.
202
+ *
203
+ * @remarks
204
+ * This value will be used in various displays of the user interface and documentation. If not provided, a default message may be shown.
205
+ */
206
+ description?: string;
207
+ /**
208
+ * One or more alternative names for the command.
209
+ */
210
+ alias?: string | string[];
211
+ /**
212
+ * Optional tags for the command.
213
+ *
214
+ * @remarks
215
+ * Tags can be used to categorize and organize commands, and can also be utilized by plugins to provide additional functionality or filtering based on tags.
216
+ */
217
+ tags?: string[];
218
+ /**
219
+ * An optional icon to visually represent the command in user interfaces.
220
+ *
221
+ * @remarks
222
+ * This can be a string containing an emoji, a Unicode character, or any other symbol that helps to visually identify the command. If not provided, no icon will be displayed.
223
+ */
224
+ icon?: string;
225
+ /**
226
+ * A URL to the command documentation or reference.
227
+ *
228
+ * @remarks
229
+ * This URL can be used in various displays of the user interface and documentation to provide users with a reference for the command. It can also be used by plugins to link to the documentation in relevant contexts. If the token `{command}` is included in the URL, it will be replaced with the full command path to provide links to command specific documentation. For example, `myapp command subcommand` will be translated to `{docs}/command/subcommand`.
230
+ */
231
+ docs?: string;
232
+ }
233
+ interface CommandBase extends CommandMetadata {
202
234
  /**
203
235
  * The command id.
204
236
  */
@@ -215,33 +247,17 @@ interface CommandBase {
215
247
  * The path segments.
216
248
  */
217
249
  segments: string[];
218
- /**
219
- * The display title.
220
- */
221
- title?: string;
222
- /**
223
- * The command description.
224
- */
225
- description?: string;
226
250
  /**
227
251
  * Alternative command names.
228
252
  */
229
253
  alias?: string[];
230
- /**
231
- * The command icon.
232
- */
233
- icon?: string;
234
- /**
235
- * A URL to the command documentation or reference.
236
- */
237
- reference?: string;
238
254
  /**
239
255
  * Whether the command is virtual.
240
256
  *
241
257
  * @remarks
242
258
  * Virtual commands are considered forks in the command tree and are not directly executable. They are used to group related subcommands together without having an actual command handler or entry point.
243
259
  */
244
- isVirtual: boolean;
260
+ virtual: boolean;
245
261
  }
246
262
  interface CommandConfig extends CommandBase {
247
263
  /**
@@ -251,43 +267,10 @@ interface CommandConfig extends CommandBase {
251
267
  /**
252
268
  * The resolved entry definition.
253
269
  */
254
- entry: ResolvedEntryTypeDefinition;
255
- /**
256
- * Optional tags for the command.
257
- *
258
- * @remarks
259
- * Tags can be used to categorize and organize commands, and can also be utilized by plugins to provide additional functionality or filtering based on tags.
260
- */
261
- tags?: string[];
262
- /**
263
- * A string representing the source of the command, which can be "file", a specific plugin name, or any other string value that describes the source that added the command.
264
- */
265
- source?: "file" | string;
270
+ entry: ResolvedEntryFileReference;
271
+ tags?: CommandMetadata["tags"];
266
272
  }
267
- type CommandTree = CommandConfig & {
268
- /**
269
- * The display title.
270
- */
271
- title: string;
272
- /**
273
- * The command description.
274
- */
275
- description: string;
276
- /**
277
- * Alternative command names.
278
- */
279
- alias: string[];
280
- /**
281
- * A set of tags for the command.
282
- *
283
- * @remarks
284
- * Tags can be used to categorize and organize commands, and can also be utilized by plugins to provide additional functionality or filtering based on tags.
285
- */
286
- tags: string[];
287
- /**
288
- * A string representing the source of the command, which can be "file", a specific plugin name, or any other string value that describes the source that added the command.
289
- */
290
- source: "file" | string;
273
+ type CommandTree = RequiredKeys<CommandConfig, "title" | "description" | "alias" | "tags"> & {
291
274
  /**
292
275
  * The command options.
293
276
  */
@@ -315,53 +298,12 @@ type SerializedCommandTree = Omit<CommandTree, "parent" | "children"> & {
315
298
  */
316
299
  children: Record<string, SerializedCommandTree>;
317
300
  };
318
- interface CommandMetadata {
319
- /**
320
- * The display name of the command.
321
- *
322
- * @remarks
323
- * This value will be used in various displays of the user interface and documentation. If not provided, a formatted value of the command name will be used.
324
- */
325
- title?: string;
326
- /**
327
- * A brief description of what the command does.
328
- *
329
- * @remarks
330
- * This value will be used in various displays of the user interface and documentation. If not provided, a default message may be shown.
331
- */
332
- description?: string;
333
- /**
334
- * One or more alternative names for the command.
335
- */
336
- alias?: string | string[];
337
- /**
338
- * Optional tags for the command.
339
- *
340
- * @remarks
341
- * Tags can be used to categorize and organize commands, and can also be utilized by plugins to provide additional functionality or filtering based on tags.
342
- */
343
- tags?: string[];
344
- /**
345
- * An optional icon to visually represent the command in user interfaces.
346
- *
347
- * @remarks
348
- * This can be a string containing an emoji, a Unicode character, or any other symbol that helps to visually identify the command. If not provided, no icon will be displayed.
349
- */
350
- icon?: string;
351
- /**
352
- * A URL to the command documentation or reference.
353
- *
354
- * @remarks
355
- * This URL can be used in various displays of the user interface and documentation to provide users with a reference for the command. It can also be used by plugins to link to the documentation in relevant contexts. If the token `{command}` is included in the URL, it will be replaced with the full command path to provide links to command specific documentation. For example, `myapp command subcommand` will be translated to `{referenceLink}/command/subcommand`.
356
- */
357
- reference?: string;
358
- }
359
301
  interface CommandModule {
360
302
  metadata?: CommandMetadata;
361
- options?: Record<string, CommandOptionConfig> | JSONSchema7Object | StandardJSONSchemaV1<Record<string, CommandParameterType>> | z3.AnyZodObject;
362
- args?: CommandArgumentConfig[] | JsonSchema7TupleType | StandardJSONSchemaV1<CommandParameterType[]> | z3.AnyZodTuple;
303
+ options?: Record<string, CommandOptionConfig> | SchemaInput;
304
+ args?: (CommandArgumentConfig | SchemaInput)[];
363
305
  default?: AnyFunction;
364
306
  }
365
307
  //#endregion
366
- export { AsCommandParameterConfig, BaseBooleanCommandParameter, BaseCommandParameter, BaseNumberCommandParameter, BaseSingleCommandParameter, BaseStringCommandParameter, BaseVariadicCommandParameter, BooleanCommandOption, BooleanCommandParameter, BooleanCommandParameterConfig, CommandArgument, CommandArgumentConfig, CommandBase, CommandConfig, CommandMetadata, CommandModule, CommandOption, CommandOptionConfig, CommandParameter, CommandParameterConfig, CommandParameterKind, CommandParameterKinds, CommandParameterType, CommandTree, NumberCommandParameter, NumberCommandParameterConfig, SerializedCommandTree, SingleBooleanCommandParameter, SingleNumberCommandParameter, SingleStringCommandParameter, StringCommandParameter, StringCommandParameterConfig, VariadicBooleanCommandParameter, VariadicNumberCommandParameter, VariadicStringCommandParameter };
308
+ export { AsCommandParameterConfig, BaseBooleanCommandParameter, BaseCommandParameter, BaseNumberCommandParameter, BaseSingleCommandParameter, BaseStringCommandParameter, BaseVariadicCommandParameter, BooleanCommandOption, BooleanCommandParameter, BooleanCommandParameterConfig, CommandArgument, CommandArgumentConfig, CommandBase, CommandConfig, CommandMetadata, CommandModule, CommandOption, CommandOptionConfig, CommandParameter, CommandParameterConfig, CommandParameterType, CommandTree, NumberCommandParameter, NumberCommandParameterConfig, SerializedCommandTree, SingleBooleanCommandParameter, SingleNumberCommandParameter, SingleStringCommandParameter, StringCommandParameter, StringCommandParameterConfig, VariadicBooleanCommandParameter, VariadicNumberCommandParameter, VariadicStringCommandParameter };
367
309
  //# sourceMappingURL=command.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command.d.mts","names":[],"sources":["../../src/types/command.ts"],"mappings":";;;;;;;;KAyBY,oBAAA;AAAA,cAMC,qBAAA;EAAA;;;;KAMD,oBAAA,WACF,qBAAA,eAAoC,qBAAA;AAAA,UAE7B,oBAAA;EALP;;;EASR,IAAA;;;;EAKA,IAAA,EAAM,oBAAA;EAZI;;;EAiBV,KAAA;EAhBiE;AAEnE;;EAmBE,WAAA;EAV0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A;EAvCe;;;;;;EA+Cf,IAAA;EAtCO;;;EA2CP,MAAA;EA9BM;AAGR;;EAgCE,OAAA,EAAS,MAAA,SAAe,aAAA;EAhCA;;;EAqCxB,IAAA,EAAM,eAAA;EAKS;;;EAAf,MAAA,SAAe,WAAA;EAKC;;;EAAhB,QAAA,EAAU,MAAA,SAAe,WAAA;AAAA;AAAA,KAGf,qBAAA,GAAwB,IAAA,CAAK,WAAA;EAvBvC;;;EA2BA,MAAA;EAjBA;;;EAqBA,QAAA,EAAU,MAAA,SAAe,qBAAA;AAAA;AAAA,UAGV,eAAA;EAdU;;;AAG3B;;;EAkBE,KAAA;EAlBkC;;;;;;EA0BlC,WAAA;EAtBA;;;EA2BA,KAAA;EAvB8C;;AAGhD;;;;EA4BE,IAAA;EAbA;;;;;;EAqBA,IAAA;EAWe;;;;;;EAHf,SAAA;AAAA;AAAA,UAGe,aAAA;EACf,QAAA,GAAW,eAAA;EACX,OAAA,GACI,MAAA,SAAe,mBAAA,IACf,iBAAA,GACA,oBAAA,CAAqB,MAAA,SAAe,oBAAA,KACpC,EAAA,CAAG,YAAA;EACP,IAAA,GACI,qBAAA,KACA,oBAAA,GACA,oBAAA,CAAqB,oBAAA,MACrB,EAAA,CAAG,WAAA;EACP,OAAA,GAAU,WAAA;AAAA"}
1
+ {"version":3,"file":"command.d.mts","names":[],"sources":["../../src/types/command.ts"],"mappings":""}
@@ -30,23 +30,18 @@ const __ΩExclude = [
30
30
  "Exclude",
31
31
  "l6!Re$!RPe#!e$\"qk#%QRb!b\"Pde\"!p)w#y"
32
32
  ];
33
- const __ΩCommandParameterType = ["CommandParameterType", "P&')P&'JFJw!y"];
34
- const CommandParameterKinds = {
35
- string: "string",
36
- number: "number",
37
- boolean: "boolean"
38
- };
39
- const __ΩCommandParameterKind = [
40
- () => CommandParameterKinds,
41
- () => CommandParameterKinds,
42
- "CommandParameterKind",
43
- "i!i\"gfw#y"
33
+ const __ΩCommandParameterType = [
34
+ "string",
35
+ "number",
36
+ "boolean",
37
+ "CommandParameterType",
38
+ "P.!.\".#Jw$y"
44
39
  ];
45
40
  const __ΩBaseCommandParameter = [
46
41
  "name",
47
42
  "The option name.",
48
- () => __ΩCommandParameterKind,
49
- "kind",
43
+ () => __ΩCommandParameterType,
44
+ "type",
50
45
  "The option kind.",
51
46
  "title",
52
47
  "The display title.",
@@ -59,8 +54,8 @@ const __ΩBaseCommandParameter = [
59
54
  false,
60
55
  "env",
61
56
  "The environment variable name or false to disable.",
62
- "optional",
63
- "Whether the option is optional.",
57
+ "required",
58
+ "Whether the option is required.",
64
59
  "variadic",
65
60
  "Whether the option accepts multiple values.",
66
61
  "BaseCommandParameter",
@@ -87,25 +82,16 @@ const __ΩBaseVariadicCommandParameter = [
87
82
  const __ΩBaseStringCommandParameter = [
88
83
  () => __ΩBaseCommandParameter,
89
84
  "string",
90
- "kind",
85
+ "type",
91
86
  "The option kind.",
92
87
  "default",
93
88
  "The default value.",
94
- "email",
95
- "uri",
96
- "uuid",
97
- "ipv4",
98
- "ipv6",
99
- "date",
100
- "time",
101
- "date-time",
102
- "duration",
103
89
  "format",
104
90
  "A standard string format to validate the option value against.",
105
91
  "choices",
106
92
  "The allowed choices for the option value.",
107
93
  "BaseStringCommandParameter",
108
- "Pn!.\"4#?$P&&FJ4%8?&P.'.(.).*.+.,.-.../J408?1&F428?3Mw4y"
94
+ "Pn!.\"4#?$P&&FJ4%8?&P!&J4'8?(&F4)8?*Mw+y"
109
95
  ];
110
96
  const __ΩSingleStringCommandParameter = [
111
97
  () => __ΩBaseStringCommandParameter,
@@ -136,7 +122,7 @@ const __ΩStringCommandParameter = [
136
122
  const __ΩBaseNumberCommandParameter = [
137
123
  () => __ΩBaseCommandParameter,
138
124
  "number",
139
- "kind",
125
+ "type",
140
126
  "The option kind.",
141
127
  "default",
142
128
  "The default value.",
@@ -174,7 +160,7 @@ const __ΩNumberCommandParameter = [
174
160
  const __ΩBaseBooleanCommandParameter = [
175
161
  () => __ΩBaseCommandParameter,
176
162
  "boolean",
177
- "kind",
163
+ "type",
178
164
  "The option kind.",
179
165
  "default",
180
166
  "The default value.",
@@ -217,15 +203,14 @@ const __ΩCommandParameter = [
217
203
  const __ΩAsCommandParameterConfig = [
218
204
  "T",
219
205
  () => __ΩPick,
220
- "kind",
221
- "alias",
206
+ "type",
222
207
  () => __ΩPartial,
223
208
  () => __ΩOmit,
224
- "kind",
209
+ "type",
225
210
  "alias",
226
211
  "alias",
227
212
  "AsCommandParameterConfig",
228
- "b!Pe\"!P.#.$Jo\"#e\"!P.'.(Jo&#o%\"PP&&FJ4)8MKw*y"
213
+ "b!Pe\"!.#o\"#e\"!P.&.'Jo%#o$\"PP&&FJ4(8MKw)y"
229
214
  ];
230
215
  const __ΩStringCommandParameterConfig = [
231
216
  () => __ΩAsCommandParameterConfig,
@@ -288,7 +273,24 @@ const __ΩCommandArgumentConfig = [
288
273
  "CommandArgumentConfig",
289
274
  "n\"o!\"w#y"
290
275
  ];
276
+ const __ΩCommandMetadata = [
277
+ "title",
278
+ "The display name of the command.",
279
+ "description",
280
+ "A brief description of what the command does.",
281
+ "alias",
282
+ "One or more alternative names for the command.",
283
+ "tags",
284
+ "Optional tags for the command.",
285
+ "icon",
286
+ "An optional icon to visually represent the command in user interfaces.",
287
+ "docs",
288
+ "A URL to the command documentation or reference.",
289
+ "CommandMetadata",
290
+ "P&4!8?\"&4#8?$P&&FJ4%8?&&F4'8?(&4)8?*&4+8?,Mw-y"
291
+ ];
291
292
  const __ΩCommandBase = [
293
+ () => __ΩCommandMetadata,
292
294
  "id",
293
295
  "The command id.",
294
296
  "name",
@@ -297,20 +299,12 @@ const __ΩCommandBase = [
297
299
  "The full command path value.",
298
300
  "segments",
299
301
  "The path segments.",
300
- "title",
301
- "The display title.",
302
- "description",
303
- "The command description.",
304
302
  "alias",
305
303
  "Alternative command names.",
306
- "icon",
307
- "The command icon.",
308
- "reference",
309
- "A URL to the command documentation or reference.",
310
- "isVirtual",
304
+ "virtual",
311
305
  "Whether the command is virtual.",
312
306
  "CommandBase",
313
- "PP&,J4!?\"&4#?$P&,J4%?&&F4'?(&4)8?*&4+8?,&F4-8?.&4/8?0&418?2)43?4Mw5y"
307
+ "Pn!P&,J4\"?#&4$?%P&,J4&?'&F4(?)&F4*8?+)4,?-Mw.y"
314
308
  ];
315
309
  const __ΩCommandConfig = [
316
310
  () => __ΩCommandBase,
@@ -318,27 +312,13 @@ const __ΩCommandConfig = [
318
312
  "The command id.",
319
313
  "entry",
320
314
  "The resolved entry definition.",
315
+ () => __ΩCommandMetadata,
316
+ "tags",
321
317
  "tags",
322
- "Optional tags for the command.",
323
- "file",
324
- "source",
325
- "A string representing the source of the command, which can be \"file\", a specific plugin name, or any other string value that describes the source that added the command.",
326
318
  "CommandConfig",
327
- "Pn!&4\"?#!4$?%&F4&8?'P.(&J4)8?*Mw+y"
319
+ "Pn!&4\"?#!4$?%n&.'f4(8Mw)y"
328
320
  ];
329
321
  const __ΩCommandTree = [
330
- () => __ΩCommandConfig,
331
- "title",
332
- "The display title.",
333
- "description",
334
- "The command description.",
335
- "alias",
336
- "Alternative command names.",
337
- "tags",
338
- "A set of tags for the command.",
339
- "file",
340
- "source",
341
- "A string representing the source of the command, which can be \"file\", a specific plugin name, or any other string value that describes the source that added the command.",
342
322
  () => __ΩRecord,
343
323
  () => __ΩCommandOption,
344
324
  "options",
@@ -354,7 +334,7 @@ const __ΩCommandTree = [
354
334
  "children",
355
335
  "Child commands.",
356
336
  "CommandTree",
357
- "Pn!P&4\"?#&4$?%&F4&?'&F4(?)P.*&J4+?,&n.o-#4/?0n1F42?3P,n4J45?6&n8o7#49?:MKw;y"
337
+ "P!P&n\"o!#4#?$n%F4&?'P,n(J4)?*&n,o+#4-?.MKw/y"
358
338
  ];
359
339
  const __ΩSerializedCommandTree = [
360
340
  () => __ΩOmit,
@@ -370,37 +350,19 @@ const __ΩSerializedCommandTree = [
370
350
  "SerializedCommandTree",
371
351
  "Pn\"P.#.$Jo!#PP,&J4%?&&n(o'#4)?*MKw+y"
372
352
  ];
373
- const __ΩCommandMetadata = [
374
- "title",
375
- "The display name of the command.",
376
- "description",
377
- "A brief description of what the command does.",
378
- "alias",
379
- "One or more alternative names for the command.",
380
- "tags",
381
- "Optional tags for the command.",
382
- "icon",
383
- "An optional icon to visually represent the command in user interfaces.",
384
- "reference",
385
- "A URL to the command documentation or reference.",
386
- "CommandMetadata",
387
- "P&4!8?\"&4#8?$P&&FJ4%8?&&F4'8?(&4)8?*&4+8?,Mw-y"
388
- ];
389
353
  const __ΩCommandModule = [
390
354
  () => __ΩCommandMetadata,
391
355
  "metadata",
392
356
  () => __ΩRecord,
393
357
  () => __ΩCommandOptionConfig,
394
- "JSONSchema7Object",
395
- "StandardJSONSchemaV1",
396
358
  "options",
397
359
  () => __ΩCommandArgumentConfig,
398
360
  "args",
399
361
  "default",
400
362
  "CommandModule",
401
- "Pn!4\"8P&n$o##\"w%\"w&!J4'8Pn(F!\"w&!J4)8!4*8Mw+y"
363
+ "Pn!4\"8P&n$o##!J4%8Pn&!JF4'8!4(8Mw)y"
402
364
  ];
403
365
 
404
366
  //#endregion
405
- export { CommandParameterKinds, __ΩAsCommandParameterConfig, __ΩBaseBooleanCommandParameter, __ΩBaseCommandParameter, __ΩBaseNumberCommandParameter, __ΩBaseSingleCommandParameter, __ΩBaseStringCommandParameter, __ΩBaseVariadicCommandParameter, __ΩBooleanCommandOption, __ΩBooleanCommandParameter, __ΩBooleanCommandParameterConfig, __ΩCommandArgument, __ΩCommandArgumentConfig, __ΩCommandBase, __ΩCommandConfig, __ΩCommandMetadata, __ΩCommandModule, __ΩCommandOption, __ΩCommandOptionConfig, __ΩCommandParameter, __ΩCommandParameterConfig, __ΩCommandParameterKind, __ΩCommandParameterType, __ΩCommandTree, __ΩNumberCommandParameter, __ΩNumberCommandParameterConfig, __ΩSerializedCommandTree, __ΩSingleBooleanCommandParameter, __ΩSingleNumberCommandParameter, __ΩSingleStringCommandParameter, __ΩStringCommandParameter, __ΩStringCommandParameterConfig, __ΩVariadicBooleanCommandParameter, __ΩVariadicNumberCommandParameter, __ΩVariadicStringCommandParameter };
367
+ export { __ΩAsCommandParameterConfig, __ΩBaseBooleanCommandParameter, __ΩBaseCommandParameter, __ΩBaseNumberCommandParameter, __ΩBaseSingleCommandParameter, __ΩBaseStringCommandParameter, __ΩBaseVariadicCommandParameter, __ΩBooleanCommandOption, __ΩBooleanCommandParameter, __ΩBooleanCommandParameterConfig, __ΩCommandArgument, __ΩCommandArgumentConfig, __ΩCommandBase, __ΩCommandConfig, __ΩCommandMetadata, __ΩCommandModule, __ΩCommandOption, __ΩCommandOptionConfig, __ΩCommandParameter, __ΩCommandParameterConfig, __ΩCommandParameterType, __ΩCommandTree, __ΩNumberCommandParameter, __ΩNumberCommandParameterConfig, __ΩSerializedCommandTree, __ΩSingleBooleanCommandParameter, __ΩSingleNumberCommandParameter, __ΩSingleStringCommandParameter, __ΩStringCommandParameter, __ΩStringCommandParameterConfig, __ΩVariadicBooleanCommandParameter, __ΩVariadicNumberCommandParameter, __ΩVariadicStringCommandParameter };
406
368
  //# sourceMappingURL=command.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"command.mjs","names":[],"sources":["../../src/types/command.ts"],"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 type { StandardJSONSchemaV1 } from \"@standard-schema/spec\";\nimport type { JsonSchema7TupleType } from \"@stryke/json\";\nimport type { AnyFunction } from \"@stryke/types/base\";\nimport type { JSONSchema7Object } from \"json-schema\";\nimport type { ResolvedEntryTypeDefinition } from \"powerlines\";\nimport type * as z3 from \"zod/v3\";\n\nexport type CommandParameterType =\n | string\n | number\n | boolean\n | (string | number)[];\n\nexport const CommandParameterKinds = {\n string: \"string\",\n number: \"number\",\n boolean: \"boolean\"\n} as const;\n\nexport type CommandParameterKind =\n (typeof CommandParameterKinds)[keyof typeof CommandParameterKinds];\n\nexport interface BaseCommandParameter {\n /**\n * The option name.\n */\n name: string;\n\n /**\n * The option kind.\n */\n kind: CommandParameterKind;\n\n /**\n * The display title.\n */\n title: string;\n\n /**\n * The option description.\n */\n description: string;\n\n /**\n * Alternative option names.\n */\n alias: string[];\n\n /**\n * The default value.\n */\n default?: string | number | boolean | string[] | number[] | boolean[];\n\n /**\n * The environment variable name or false to disable.\n */\n env: string | false;\n\n /**\n * Whether the option is optional.\n */\n optional: boolean;\n\n /**\n * Whether the option accepts multiple values.\n */\n variadic: boolean;\n}\n\nexport interface BaseSingleCommandParameter {\n /**\n * The default value.\n */\n default?: string | number | boolean;\n\n /**\n * Whether the option accepts multiple values.\n */\n variadic: false;\n}\n\nexport interface BaseVariadicCommandParameter {\n /**\n * The default value.\n */\n default?: string[] | number[] | boolean[];\n\n /**\n * Whether the option accepts multiple values.\n */\n variadic: true;\n}\n\nexport interface BaseStringCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: \"string\";\n\n /**\n * The default value.\n */\n default?: string | string[];\n\n /**\n * A standard string format to validate the option value against.\n */\n format?:\n | \"email\"\n | \"uri\"\n | \"uuid\"\n | \"ipv4\"\n | \"ipv6\"\n | \"date\"\n | \"time\"\n | \"date-time\"\n | \"duration\";\n\n /**\n * The allowed choices for the option value.\n */\n choices?: string[];\n}\n\nexport interface SingleStringCommandParameter extends BaseStringCommandParameter {\n /**\n * The default value.\n */\n default?: string;\n\n /**\n * Whether the option accepts multiple values.\n */\n variadic: false;\n}\n\nexport interface VariadicStringCommandParameter extends BaseStringCommandParameter {\n /**\n * The default value.\n */\n default?: string[];\n\n /**\n * Whether the option accepts multiple values.\n */\n variadic: true;\n}\n\nexport type StringCommandParameter =\n | SingleStringCommandParameter\n | VariadicStringCommandParameter;\n\nexport interface BaseNumberCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: \"number\";\n\n /**\n * The default value.\n */\n default?: number | number[];\n\n /**\n * The allowed choices for the option value.\n */\n choices?: number[];\n}\n\nexport interface SingleNumberCommandParameter extends BaseNumberCommandParameter {\n /**\n * The default value.\n */\n default?: number;\n\n /**\n * Whether the option accepts multiple values.\n */\n variadic: false;\n}\n\nexport interface VariadicNumberCommandParameter extends BaseNumberCommandParameter {\n /**\n * The default value.\n */\n default?: number[];\n\n /**\n * Whether the option accepts multiple values.\n */\n variadic: true;\n}\n\nexport type NumberCommandParameter =\n | SingleNumberCommandParameter\n | VariadicNumberCommandParameter;\n\nexport interface BaseBooleanCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: \"boolean\";\n\n /**\n * The default value.\n */\n default?: boolean | boolean[];\n}\n\nexport interface SingleBooleanCommandParameter extends BaseBooleanCommandParameter {\n /**\n * The default value.\n */\n default?: boolean;\n\n /**\n * Whether the option accepts multiple values.\n */\n variadic: false;\n}\n\nexport interface VariadicBooleanCommandParameter extends BaseBooleanCommandParameter {\n /**\n * The default value.\n */\n default?: boolean[];\n\n /**\n * Whether the option accepts multiple values.\n */\n variadic: true;\n}\n\nexport type BooleanCommandParameter =\n | SingleBooleanCommandParameter\n | VariadicBooleanCommandParameter;\n\nexport type CommandParameter =\n | StringCommandParameter\n | NumberCommandParameter\n | BooleanCommandParameter;\n\nexport type AsCommandParameterConfig<T extends BaseCommandParameter> = Pick<\n T,\n \"kind\" | \"alias\"\n> &\n Partial<Omit<T, \"kind\" | \"alias\">> & {\n alias?: string | string[];\n };\n\nexport type StringCommandParameterConfig =\n AsCommandParameterConfig<StringCommandParameter>;\nexport type NumberCommandParameterConfig =\n AsCommandParameterConfig<NumberCommandParameter>;\nexport type BooleanCommandParameterConfig =\n AsCommandParameterConfig<BooleanCommandParameter>;\n\nexport type CommandParameterConfig =\n | StringCommandParameterConfig\n | NumberCommandParameterConfig\n | BooleanCommandParameterConfig;\n\nexport interface BooleanCommandOption extends SingleBooleanCommandParameter {\n /**\n * The option this negates.\n */\n isNegativeOf?: string;\n\n /**\n * Whether to skip adding a negative option.\n */\n skipAddingNegative?: boolean;\n}\n\nexport type CommandOption =\n | StringCommandParameter\n | NumberCommandParameter\n | BooleanCommandOption\n | VariadicBooleanCommandParameter;\nexport type CommandOptionConfig = AsCommandParameterConfig<CommandOption>;\n\nexport type CommandArgument =\n | StringCommandParameter\n | NumberCommandParameter\n | BooleanCommandParameter;\nexport type CommandArgumentConfig = AsCommandParameterConfig<CommandArgument>;\n\nexport interface CommandBase {\n /**\n * The command id.\n */\n id: string | null;\n\n /**\n * The command name.\n */\n name: string;\n\n /**\n * The full command path value.\n */\n path: string | null;\n\n /**\n * The path segments.\n */\n segments: string[];\n\n /**\n * The display title.\n */\n title?: string;\n\n /**\n * The command description.\n */\n description?: string;\n\n /**\n * Alternative command names.\n */\n alias?: string[];\n\n /**\n * The command icon.\n */\n icon?: string;\n\n /**\n * A URL to the command documentation or reference.\n */\n reference?: string;\n\n /**\n * Whether the command is virtual.\n *\n * @remarks\n * Virtual commands are considered forks in the command tree and are not directly executable. They are used to group related subcommands together without having an actual command handler or entry point.\n */\n isVirtual: boolean;\n}\n\nexport interface CommandConfig extends CommandBase {\n /**\n * The command id.\n */\n id: string;\n\n /**\n * The resolved entry definition.\n */\n entry: ResolvedEntryTypeDefinition;\n\n /**\n * Optional tags for the command.\n *\n * @remarks\n * Tags can be used to categorize and organize commands, and can also be utilized by plugins to provide additional functionality or filtering based on tags.\n */\n tags?: string[];\n\n /**\n * A string representing the source of the command, which can be \"file\", a specific plugin name, or any other string value that describes the source that added the command.\n */\n source?: \"file\" | string;\n}\n\nexport type CommandTree = CommandConfig & {\n /**\n * The display title.\n */\n title: string;\n\n /**\n * The command description.\n */\n description: string;\n\n /**\n * Alternative command names.\n */\n alias: string[];\n\n /**\n * A set of tags for the command.\n *\n * @remarks\n * Tags can be used to categorize and organize commands, and can also be utilized by plugins to provide additional functionality or filtering based on tags.\n */\n tags: string[];\n\n /**\n * A string representing the source of the command, which can be \"file\", a specific plugin name, or any other string value that describes the source that added the command.\n */\n source: \"file\" | string;\n\n /**\n * The command options.\n */\n options: Record<string, CommandOption>;\n\n /**\n * The positional arguments provided to the command.\n */\n args: CommandArgument[];\n\n /**\n * The parent command.\n */\n parent: null | CommandTree;\n\n /**\n * Child commands.\n */\n children: Record<string, CommandTree>;\n};\n\nexport type SerializedCommandTree = Omit<CommandTree, \"parent\" | \"children\"> & {\n /**\n * The parent command id.\n */\n parent: null | string;\n /**\n * Serialized child commands.\n */\n children: Record<string, SerializedCommandTree>;\n};\n\nexport interface CommandMetadata {\n /**\n * The display name of the command.\n *\n * @remarks\n * This value will be used in various displays of the user interface and documentation. If not provided, a formatted value of the command name will be used.\n */\n title?: string;\n\n /**\n * A brief description of what the command does.\n *\n * @remarks\n * This value will be used in various displays of the user interface and documentation. If not provided, a default message may be shown.\n */\n description?: string;\n\n /**\n * One or more alternative names for the command.\n */\n alias?: string | string[];\n\n /**\n * Optional tags for the command.\n *\n * @remarks\n * Tags can be used to categorize and organize commands, and can also be utilized by plugins to provide additional functionality or filtering based on tags.\n */\n tags?: string[];\n\n /**\n * An optional icon to visually represent the command in user interfaces.\n *\n * @remarks\n * This can be a string containing an emoji, a Unicode character, or any other symbol that helps to visually identify the command. If not provided, no icon will be displayed.\n */\n icon?: string;\n\n /**\n * A URL to the command documentation or reference.\n *\n * @remarks\n * This URL can be used in various displays of the user interface and documentation to provide users with a reference for the command. It can also be used by plugins to link to the documentation in relevant contexts. If the token `{command}` is included in the URL, it will be replaced with the full command path to provide links to command specific documentation. For example, `myapp command subcommand` will be translated to `{referenceLink}/command/subcommand`.\n */\n reference?: string;\n}\n\nexport interface CommandModule {\n metadata?: CommandMetadata;\n options?:\n | Record<string, CommandOptionConfig>\n | JSONSchema7Object\n | StandardJSONSchemaV1<Record<string, CommandParameterType>>\n | z3.AnyZodObject;\n args?:\n | CommandArgumentConfig[]\n | JsonSchema7TupleType\n | StandardJSONSchemaV1<CommandParameterType[]>\n | z3.AnyZodTuple;\n default?: AnyFunction;\n}\n"],"mappings":";AAAA,MAAM,UAAU;CAAC;CAAK;CAAK;CAAQ;CAA4B;;;;;;AAE/D,MAAM,UAAU;CAAC;CAAG;OAAM;OAAiB;CAAA;CAAA;CAAA;;;;;;;AAE3C,MAAM,aAAS;CAAA;CAAS;CAAG;CAAY;CAA2B;AAClE,MAAI,0BAA4B,CAAC,wBAAqB,gBAAa;AAEnE,MAAK,wBAA0B;;CAE9B,QAAS;CACT,SAAU;CACV;AACD,MAAC,0BAA+B;OAAG;OAAkB;CAAA;CAAA;CAAA;AAErD,MAAM,0BAAqB;CAAM;CAAG;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEpC,MAAM,gCAAgC;CAAC;CAAW;CAAoB;CAAA;CAAA;CAAA;CAAA;CAAA;AAEtE,MAAM,kCAA+B;CAAI;CAAW;CAAa;CAAA;CAAA;CAAA;CAAA;CAAA;AAEjE,MAAM,gCAA6B;OAAO;CAAW;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAErD,MAAM,kCAAQ;OAA8B;CAAiB;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;;;;;;;;;;;AAI7D,MAAI,4BAAA;OAAA;OAAA;CAAA;CAAA;CAAA;AAEJ,MAAI,gCAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;;;;;;;;;;;AAIJ,MAAE,oCA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CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEtD,MAAM,qBAAe;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAErB,MAAI,mBAAA;OAAA;CAAA;OAAA;OAAA;CAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA"}
1
+ {"version":3,"file":"command.mjs","names":[],"sources":[],"mappings":""}
@@ -64,7 +64,7 @@ const __ΩBaseOptions = [
64
64
  "autoAssignEnv",
65
65
  "Should Shell Shock attempt to automatically assign environment variables to manipulate default values for command options based on the option name?",
66
66
  () => __ΩReferenceOptions,
67
- "reference",
67
+ "docs",
68
68
  "A URL to the application documentation or reference.",
69
69
  "BaseOptions",
70
70
  "PP\"w!FP\"w\"2#\"w$2%\"w!F/&.'J4(8?))4*8>+?,P&&FJ4-8?.P./&J408?1Pn2&J438?4Mw5y"
@@ -95,14 +95,50 @@ const __ΩUserConfig = [
95
95
  "UserConfig",
96
96
  "Pn!!Pn\"4#8?$MKw%y"
97
97
  ];
98
+ const __ΩUserConfigFnObject = [
99
+ "env",
100
+ () => __ΩUserConfig,
101
+ () => __ΩUserConfig,
102
+ "",
103
+ "UserConfigFnObject",
104
+ "P!2!Pn\"n#FJ/$w%y"
105
+ ];
106
+ const __ΩUserConfigFnPromise = [
107
+ "env",
108
+ () => __ΩUserConfig,
109
+ () => __ΩUserConfig,
110
+ "",
111
+ "UserConfigFnPromise",
112
+ "P!2!Pn\"n#FJ`/$w%y"
113
+ ];
114
+ const __ΩUserConfigFn = [
115
+ "env",
116
+ () => __ΩUserConfig,
117
+ () => __ΩUserConfig,
118
+ () => __ΩUserConfig,
119
+ () => __ΩUserConfig,
120
+ "",
121
+ "UserConfigFn",
122
+ "P!2!Pn\"n#FPn$n%FJ`J/&w'y"
123
+ ];
124
+ const __ΩUserConfigExport = [
125
+ () => __ΩUserConfig,
126
+ () => __ΩUserConfig,
127
+ () => __ΩUserConfig,
128
+ () => __ΩUserConfig,
129
+ () => __ΩUserConfigFnObject,
130
+ () => __ΩUserConfigFnPromise,
131
+ () => __ΩUserConfigFn,
132
+ "UserConfigExport",
133
+ "Pn!n\"FPn#n$FJ`n%n&n'Jw(y"
134
+ ];
98
135
  const __ΩEngineOptions = [
99
136
  () => __ΩOmit,
100
137
  "root",
101
138
  "name",
102
139
  "framework",
103
- () => __ΩUserConfig,
104
140
  "EngineOptions",
105
- "P!P.\".#.$Jo!#n%Kw&y"
141
+ "!P.\".#.$Jo!#w%y"
106
142
  ];
107
143
  const __ΩResolvedConfig = [
108
144
  () => __ΩRequired,
@@ -131,4 +167,9 @@ exports.__ΩOptions = __ΩOptions;
131
167
  exports.__ΩOutputConfig = __ΩOutputConfig;
132
168
  exports.__ΩReferenceOptions = __ΩReferenceOptions;
133
169
  exports.__ΩResolvedConfig = __ΩResolvedConfig;
134
- exports.__ΩUserConfig = __ΩUserConfig;
170
+ exports.__ΩUserConfig = __ΩUserConfig;
171
+ exports.__ΩUserConfigExport = __ΩUserConfigExport;
172
+ exports.__ΩUserConfigFn = __ΩUserConfigFn;
173
+ exports.__ΩUserConfigFnObject = __ΩUserConfigFnObject;
174
+ exports.__ΩUserConfigFnPromise = __ΩUserConfigFnPromise;
175
+ //# sourceMappingURL=config.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.cjs","names":[],"sources":[],"mappings":""}