@shell-shock/core 0.10.0 → 0.11.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 (131) hide show
  1. package/dist/components/docs.cjs +4 -4
  2. package/dist/components/docs.cjs.map +1 -1
  3. package/dist/components/docs.d.cts +5 -5
  4. package/dist/components/docs.d.cts.map +1 -1
  5. package/dist/components/docs.d.mts +5 -5
  6. package/dist/components/helpers.d.cts +6 -6
  7. package/dist/components/helpers.d.mts +6 -6
  8. package/dist/components/helpers.d.mts.map +1 -1
  9. package/dist/components/options-parser-logic.cjs +31 -31
  10. package/dist/components/options-parser-logic.cjs.map +1 -1
  11. package/dist/components/options-parser-logic.d.cts +9 -9
  12. package/dist/components/options-parser-logic.d.cts.map +1 -1
  13. package/dist/components/options-parser-logic.d.mts +9 -9
  14. package/dist/components/options-parser-logic.d.mts.map +1 -1
  15. package/dist/components/options-parser-logic.mjs +26 -26
  16. package/dist/components/options-parser-logic.mjs.map +1 -1
  17. package/dist/components/usage.cjs +5 -5
  18. package/dist/components/usage.cjs.map +1 -1
  19. package/dist/components/usage.d.cts +2 -2
  20. package/dist/components/usage.d.cts.map +1 -1
  21. package/dist/components/usage.d.mts +2 -2
  22. package/dist/components/usage.mjs +4 -4
  23. package/dist/components/usage.mjs.map +1 -1
  24. package/dist/components/utils-builtin.cjs +2 -2
  25. package/dist/components/utils-builtin.cjs.map +1 -1
  26. package/dist/components/utils-builtin.mjs +5 -5
  27. package/dist/components/utils-builtin.mjs.map +1 -1
  28. package/dist/contexts/options.cjs +2 -2
  29. package/dist/contexts/options.cjs.map +1 -1
  30. package/dist/contexts/options.d.cts +1 -1
  31. package/dist/contexts/options.d.cts.map +1 -1
  32. package/dist/contexts/options.d.mts +1 -1
  33. package/dist/contexts/options.d.mts.map +1 -1
  34. package/dist/contexts/options.mjs +4 -4
  35. package/dist/contexts/options.mjs.map +1 -1
  36. package/dist/helpers/automd.cjs +2 -2
  37. package/dist/helpers/automd.cjs.map +1 -1
  38. package/dist/helpers/automd.mjs.map +1 -1
  39. package/dist/helpers/paths.cjs +125 -0
  40. package/dist/helpers/paths.cjs.map +1 -0
  41. package/dist/helpers/paths.mjs +121 -0
  42. package/dist/helpers/paths.mjs.map +1 -0
  43. package/dist/helpers/persistence.cjs +68 -116
  44. package/dist/helpers/persistence.cjs.map +1 -1
  45. package/dist/helpers/persistence.mjs +68 -116
  46. package/dist/helpers/persistence.mjs.map +1 -1
  47. package/dist/helpers/update-package-json.cjs +4 -4
  48. package/dist/helpers/update-package-json.cjs.map +1 -1
  49. package/dist/helpers/utilities.cjs +1 -1
  50. package/dist/helpers/utilities.mjs +1 -1
  51. package/dist/helpers/validations.cjs +2 -3
  52. package/dist/helpers/validations.cjs.map +1 -1
  53. package/dist/helpers/validations.mjs +2 -2
  54. package/dist/helpers/validations.mjs.map +1 -1
  55. package/dist/index.cjs +14 -11
  56. package/dist/index.d.cts +2 -2
  57. package/dist/index.d.mts +2 -2
  58. package/dist/index.mjs +3 -3
  59. package/dist/plugin-utils/deepkit.cjs +72 -0
  60. package/dist/plugin-utils/deepkit.cjs.map +1 -0
  61. package/dist/plugin-utils/deepkit.d.cts +24 -0
  62. package/dist/plugin-utils/deepkit.d.cts.map +1 -0
  63. package/dist/plugin-utils/deepkit.d.mts +24 -0
  64. package/dist/plugin-utils/deepkit.d.mts.map +1 -0
  65. package/dist/plugin-utils/deepkit.mjs +70 -0
  66. package/dist/plugin-utils/deepkit.mjs.map +1 -0
  67. package/dist/plugin-utils/get-command-tree.cjs +2 -2
  68. package/dist/plugin-utils/get-command-tree.cjs.map +1 -1
  69. package/dist/plugin-utils/index.cjs +27 -18
  70. package/dist/plugin-utils/index.d.cts +3 -1
  71. package/dist/plugin-utils/index.d.mts +3 -1
  72. package/dist/plugin-utils/index.mjs +3 -1
  73. package/dist/plugin-utils/reflect.cjs +4 -5
  74. package/dist/plugin-utils/reflect.cjs.map +1 -1
  75. package/dist/plugin-utils/reflect.mjs +4 -4
  76. package/dist/plugin-utils/reflect.mjs.map +1 -1
  77. package/dist/plugin-utils/type-checks.cjs +89 -0
  78. package/dist/plugin-utils/type-checks.cjs.map +1 -0
  79. package/dist/plugin-utils/type-checks.d.cts +42 -0
  80. package/dist/plugin-utils/type-checks.d.cts.map +1 -0
  81. package/dist/plugin-utils/type-checks.d.mts +42 -0
  82. package/dist/plugin-utils/type-checks.d.mts.map +1 -0
  83. package/dist/plugin-utils/type-checks.mjs +84 -0
  84. package/dist/plugin-utils/type-checks.mjs.map +1 -0
  85. package/dist/plugin.cjs +28 -24
  86. package/dist/plugin.cjs.map +1 -1
  87. package/dist/plugin.d.cts.map +1 -1
  88. package/dist/plugin.d.mts.map +1 -1
  89. package/dist/plugin.mjs +12 -8
  90. package/dist/plugin.mjs.map +1 -1
  91. package/dist/resolver/deepkit.cjs +129 -0
  92. package/dist/resolver/deepkit.cjs.map +1 -0
  93. package/dist/resolver/deepkit.mjs +128 -0
  94. package/dist/resolver/deepkit.mjs.map +1 -0
  95. package/dist/resolver/helpers.cjs +173 -0
  96. package/dist/resolver/helpers.cjs.map +1 -0
  97. package/dist/resolver/helpers.mjs +168 -0
  98. package/dist/resolver/helpers.mjs.map +1 -0
  99. package/dist/resolver/module.cjs +144 -0
  100. package/dist/resolver/module.cjs.map +1 -0
  101. package/dist/resolver/module.mjs +143 -0
  102. package/dist/resolver/module.mjs.map +1 -0
  103. package/dist/resolver/resolve.cjs +209 -0
  104. package/dist/resolver/resolve.cjs.map +1 -0
  105. package/dist/resolver/resolve.mjs +208 -0
  106. package/dist/resolver/resolve.mjs.map +1 -0
  107. package/dist/types/command.cjs +127 -104
  108. package/dist/types/command.cjs.map +1 -1
  109. package/dist/types/command.d.cts +39 -78
  110. package/dist/types/command.d.cts.map +1 -1
  111. package/dist/types/command.d.mts +39 -78
  112. package/dist/types/command.d.mts.map +1 -1
  113. package/dist/types/command.mjs +115 -95
  114. package/dist/types/command.mjs.map +1 -1
  115. package/dist/types/context.cjs +1 -1
  116. package/dist/types/context.cjs.map +1 -1
  117. package/dist/types/context.d.cts +2 -2
  118. package/dist/types/context.d.cts.map +1 -1
  119. package/dist/types/context.d.mts +2 -2
  120. package/dist/types/context.d.mts.map +1 -1
  121. package/dist/types/context.mjs +1 -1
  122. package/dist/types/context.mjs.map +1 -1
  123. package/dist/types/index.cjs +13 -10
  124. package/dist/types/index.d.cts +2 -2
  125. package/dist/types/index.d.mts +2 -2
  126. package/dist/types/index.mjs +2 -2
  127. package/package.json +24 -75
  128. package/dist/helpers/resolve-command.cjs +0 -430
  129. package/dist/helpers/resolve-command.cjs.map +0 -1
  130. package/dist/helpers/resolve-command.mjs +0 -425
  131. package/dist/helpers/resolve-command.mjs.map +0 -1
@@ -1,10 +1,18 @@
1
1
  import { ResolvedEntryTypeDefinition } from "powerlines";
2
- import { ReflectionFunction, ReflectionKind, ReflectionParameter, ReflectionProperty, SerializedTypes } from "@powerlines/deepkit/vendor/type";
2
+ import { JsonSchema7TupleType } from "@stryke/json";
3
+ import { StandardJSONSchemaV1 } from "@standard-schema/spec";
3
4
  import { AnyFunction } from "@stryke/types/base";
5
+ import { JSONSchema7Object } from "json-schema";
4
6
  import * as z3 from "zod/v3";
5
- import * as z4 from "zod/v4/core";
6
7
 
7
8
  //#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];
8
16
  interface BaseCommandParameter {
9
17
  /**
10
18
  * The option name.
@@ -13,7 +21,7 @@ interface BaseCommandParameter {
13
21
  /**
14
22
  * The option kind.
15
23
  */
16
- kind: ReflectionKind;
24
+ kind: CommandParameterKind;
17
25
  /**
18
26
  * The display title.
19
27
  */
@@ -39,11 +47,15 @@ interface StringCommandParameter extends BaseCommandParameter {
39
47
  /**
40
48
  * The option kind.
41
49
  */
42
- kind: ReflectionKind.string;
50
+ kind: "string";
43
51
  /**
44
52
  * The default value.
45
53
  */
46
54
  default?: string;
55
+ /**
56
+ * A standard string format to validate the option value against.
57
+ */
58
+ format?: "email" | "uri" | "uuid" | "ipv4" | "ipv6" | "date" | "time" | "date-time" | "duration";
47
59
  /**
48
60
  * Whether the option accepts multiple values.
49
61
  */
@@ -57,7 +69,7 @@ interface NumberCommandParameter extends BaseCommandParameter {
57
69
  /**
58
70
  * The option kind.
59
71
  */
60
- kind: ReflectionKind.number;
72
+ kind: "number";
61
73
  /**
62
74
  * The default value.
63
75
  */
@@ -75,37 +87,21 @@ interface BooleanCommandParameter extends BaseCommandParameter {
75
87
  /**
76
88
  * The option kind.
77
89
  */
78
- kind: ReflectionKind.boolean;
90
+ kind: "boolean";
79
91
  /**
80
92
  * The default value.
81
93
  */
82
94
  default?: boolean;
83
- /**
84
- * The option this negates.
85
- */
86
- isNegativeOf?: string;
87
- /**
88
- * Whether to skip adding a negative option.
89
- */
90
- skipAddingNegative?: boolean;
91
- }
92
- interface StringCommandOption extends StringCommandParameter {
93
- /**
94
- * The property reflection.
95
- */
96
- reflection?: ReflectionProperty;
97
- }
98
- interface NumberCommandOption extends NumberCommandParameter {
99
- /**
100
- * The property reflection.
101
- */
102
- reflection?: ReflectionProperty;
103
95
  }
96
+ type CommandParameter = StringCommandParameter | NumberCommandParameter | BooleanCommandParameter;
97
+ type AsCommandParameterConfig<T extends BaseCommandParameter> = Pick<T, "kind" | "alias"> & Partial<Omit<T, "kind" | "alias">> & {
98
+ alias?: string | string[];
99
+ };
100
+ type StringCommandParameterConfig = AsCommandParameterConfig<StringCommandParameter>;
101
+ type NumberCommandParameterConfig = AsCommandParameterConfig<NumberCommandParameter>;
102
+ type BooleanCommandParameterConfig = AsCommandParameterConfig<BooleanCommandParameter>;
103
+ type CommandParameterConfig = StringCommandParameterConfig | NumberCommandParameterConfig | BooleanCommandParameterConfig;
104
104
  interface BooleanCommandOption extends BooleanCommandParameter {
105
- /**
106
- * The property reflection.
107
- */
108
- reflection?: ReflectionProperty;
109
105
  /**
110
106
  * The option this negates.
111
107
  */
@@ -115,26 +111,10 @@ interface BooleanCommandOption extends BooleanCommandParameter {
115
111
  */
116
112
  skipAddingNegative?: boolean;
117
113
  }
118
- type CommandOption = StringCommandOption | NumberCommandOption | BooleanCommandOption;
119
- interface StringCommandArgument extends StringCommandParameter {
120
- /**
121
- * The parameter reflection.
122
- */
123
- reflection: ReflectionParameter;
124
- }
125
- interface NumberCommandArgument extends NumberCommandParameter {
126
- /**
127
- * The parameter reflection.
128
- */
129
- reflection: ReflectionParameter;
130
- }
131
- interface BooleanCommandArgument extends BooleanCommandParameter {
132
- /**
133
- * The parameter reflection.
134
- */
135
- reflection: ReflectionParameter;
136
- }
137
- type CommandArgument = StringCommandArgument | NumberCommandArgument | BooleanCommandArgument;
114
+ type CommandOption = StringCommandParameter | NumberCommandParameter | BooleanCommandOption;
115
+ type CommandOptionConfig = AsCommandParameterConfig<CommandOption>;
116
+ type CommandArgument = StringCommandParameter | NumberCommandParameter | BooleanCommandParameter;
117
+ type CommandArgumentConfig = AsCommandParameterConfig<CommandArgument>;
138
118
  interface CommandBase {
139
119
  /**
140
120
  * The command id.
@@ -176,7 +156,7 @@ interface CommandBase {
176
156
  */
177
157
  isVirtual: boolean;
178
158
  }
179
- interface CommandInput extends CommandBase {
159
+ interface CommandConfig extends CommandBase {
180
160
  /**
181
161
  * The command id.
182
162
  */
@@ -186,7 +166,7 @@ interface CommandInput extends CommandBase {
186
166
  */
187
167
  entry: ResolvedEntryTypeDefinition;
188
168
  }
189
- type CommandTree = CommandInput & {
169
+ type CommandTree = CommandConfig & {
190
170
  /**
191
171
  * The display title.
192
172
  */
@@ -206,7 +186,7 @@ type CommandTree = CommandInput & {
206
186
  /**
207
187
  * The positional arguments provided to the command.
208
188
  */
209
- arguments: CommandArgument[];
189
+ args: CommandArgument[];
210
190
  /**
211
191
  * The parent command.
212
192
  */
@@ -215,22 +195,8 @@ type CommandTree = CommandInput & {
215
195
  * Child commands.
216
196
  */
217
197
  children: Record<string, CommandTree>;
218
- /**
219
- * The command handler reflection.
220
- */
221
- reflection: ReflectionFunction | null;
222
198
  };
223
- type SerializedCommandOption = Omit<CommandOption, "reflection">;
224
- type SerializedCommandArgument = Omit<CommandArgument, "reflection">;
225
- type SerializedCommandTree = Omit<CommandTree, "options" | "arguments" | "parent" | "children" | "reflection"> & {
226
- /**
227
- * The command options.
228
- */
229
- options: Record<string, SerializedCommandOption>;
230
- /**
231
- * The positional arguments provided to the command.
232
- */
233
- arguments: SerializedCommandArgument[];
199
+ type SerializedCommandTree = Omit<CommandTree, "parent" | "children"> & {
234
200
  /**
235
201
  * The parent command id.
236
202
  */
@@ -239,12 +205,8 @@ type SerializedCommandTree = Omit<CommandTree, "options" | "arguments" | "parent
239
205
  * Serialized child commands.
240
206
  */
241
207
  children: Record<string, SerializedCommandTree>;
242
- /**
243
- * The command handler reflection.
244
- */
245
- reflection?: SerializedTypes;
246
208
  };
247
- interface Metadata {
209
+ interface CommandMetadata {
248
210
  /**
249
211
  * The display name of the command.
250
212
  *
@@ -271,13 +233,12 @@ interface Metadata {
271
233
  */
272
234
  icon?: string;
273
235
  }
274
- type CommandParameterSchema = z3.ZodTypeAny | z4.$ZodType;
275
236
  interface CommandModule {
276
- metadata?: Metadata;
277
- options?: Record<string, CommandParameterSchema>;
278
- arguments?: CommandParameterSchema[];
237
+ metadata?: CommandMetadata;
238
+ options?: Record<string, CommandOptionConfig> | JSONSchema7Object | StandardJSONSchemaV1<Record<string, CommandParameterType>> | z3.AnyZodObject;
239
+ args?: CommandArgumentConfig[] | JsonSchema7TupleType | StandardJSONSchemaV1<CommandParameterType[]> | z3.AnyZodTuple;
279
240
  default?: AnyFunction;
280
241
  }
281
242
  //#endregion
282
- export { BaseCommandParameter, BooleanCommandArgument, BooleanCommandOption, BooleanCommandParameter, CommandArgument, CommandBase, CommandInput, CommandModule, CommandOption, CommandParameterSchema, CommandTree, Metadata, NumberCommandArgument, NumberCommandOption, NumberCommandParameter, SerializedCommandArgument, SerializedCommandOption, SerializedCommandTree, StringCommandArgument, StringCommandOption, StringCommandParameter };
243
+ export { AsCommandParameterConfig, BaseCommandParameter, BooleanCommandOption, BooleanCommandParameter, BooleanCommandParameterConfig, CommandArgument, CommandArgumentConfig, CommandBase, CommandConfig, CommandMetadata, CommandModule, CommandOption, CommandOptionConfig, CommandParameter, CommandParameterConfig, CommandParameterKind, CommandParameterKinds, CommandParameterType, CommandTree, NumberCommandParameter, NumberCommandParameterConfig, SerializedCommandTree, StringCommandParameter, StringCommandParameterConfig };
283
244
  //# sourceMappingURL=command.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command.d.mts","names":[],"sources":["../../src/types/command.ts"],"sourcesContent":[],"mappings":";;;;;;;UA8BiB,oBAAA;;AAAjB;AA+BA;EAoBiB,IAAA,EAAA,MAAA;EAoBA;AAmBjB;AAOA;EAOiB,IAAA,EAhGT,cAgGS;EAeL;;;EAGR,KAAA,EAAA,MAAA;EAAoB;AAExB;AAOA;EAOiB,WAAA,EAAA,MAAA;EAOL;;;EAGR,KAAA,EAAA,MAAA,EAAA;EAAsB;AAE1B;AAkDA;EAYY,GAAA,EAAA,MAAA,GAAW,KAAA;EAAG;;;EAoBb,QAAA,EAAA,OAAA;;AAQc,UAjNV,sBAAA,SAA+B,oBAiNrB,CAAA;EAAf;;;EAOA,IAAA,EApNJ,cAAA,CAAe,MAoNY;EAEvB;AAEZ;;EAAoC,OAAA,CAAA,EAAA,MAAA;EAOV;;;EAYC,QAAA,EAAA,OAAA;EAAf;;;EAOK,OAAA,CAAA,EAAA,MAAQ,EAAA;AA+BzB;AAEiB,UAnQA,sBAAA,SAA+B,oBAmQlB,CAAA;EACjB;;;EAEC,IAAA,EAlQN,cAAA,CAAe,MAkQT;EACF;;;;;;;;;;;;;UAnPK,uBAAA,SAAgC;;;;QAIzC,cAAA,CAAe;;;;;;;;;;;;;;UAeN,mBAAA,SAA4B;;;;eAI9B;;UAGE,mBAAA,SAA4B;;;;eAI9B;;UAGE,oBAAA,SAA6B;;;;eAI/B;;;;;;;;;;KAWH,aAAA,GACR,sBACA,sBACA;UAEa,qBAAA,SAA8B;;;;cAIjC;;UAGG,qBAAA,SAA8B;;;;cAIjC;;UAGG,sBAAA,SAA+B;;;;cAIlC;;KAGF,eAAA,GACR,wBACA,wBACA;UAEa,WAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAkDA,YAAA,SAAqB;;;;;;;;SAS7B;;KAGG,WAAA,GAAc;;;;;;;;;;;;;;;;WAgBf,eAAe;;;;aAIb;;;;iBAII;;;;YAIL,eAAe;;;;cAIb;;KAGF,uBAAA,GAA0B,KAAK;KAE/B,yBAAA,GAA4B,KAAK;KAEjC,qBAAA,GAAwB,KAClC;;;;WAMS,eAAe;;;;aAIb;;;;;;;;YAQD,eAAe;;;;eAIZ;;UAGE,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+BL,sBAAA,GAAyB,EAAA,CAAG,aAAa,EAAA,CAAG;UAEvC,aAAA;aACJ;YACD,eAAe;cACb;YACF"}
1
+ {"version":3,"file":"command.d.mts","names":[],"sources":["../../src/types/command.ts"],"sourcesContent":[],"mappings":";;;;;;;;KAyBY,oBAAA;cAMC;EAND,SAAA,MAAA,EAAA,QAAoB;EAMnB,SAAA,MAAA,EAAA,QAIH;EAEE,SAAA,OAAA,EAAA,SAAoB;AAGhC,CAAA;AA+BiB,KAlCL,oBAAA,GAkC4B,CAAA,OAjC9B,qBAiC0D,CAAA,CAAA,MAAA,OAjCtB,qBAiCsB,CAAA;AAiCnD,UAhEA,oBAAA,CAgEuB;EAoBvB;AAWjB;;EAEI,IAAA,EAAA,MAAA;EACA;;AAEJ;EAA+C,IAAA,EA5FvC,oBA4FuC;EAC7C;;;EAGQ,KAAA,EAAA,MAAA;EAAR;;AAIF;EAEY,WAAA,EAAA,MAAA;EAEA;AAGZ;;EAEI,KAAA,EAAA,MAAA,EAAA;EACA;;AAEJ;EAWY,GAAA,EAAA,MAAA,GAAA,KAAa;EACrB;;;EAEoB,QAAA,EAAA,OAAA;AACxB;AAEY,UA1GK,sBAAA,SAA+B,oBA0GrB,CAAA;EACvB;;;EAEuB,IAAA,EAAA,QAAA;EACf;AAEZ;AAkDA;EAYY,OAAA,CAAA,EAAA,MAAW;EAAG;;;EAoBlB,MAAA,CAAA,EAAA,OAAA,GAAA,KAAA,GAAA,MAAA,GAAA,MAAA,GAAA,MAAA,GAAA,MAAA,GAAA,MAAA,GAAA,WAAA,GAAA,UAAA;EAIS;;;EAIC,QAAA,EAAA,OAAA;EAGN;;;EAQe,OAAA,CAAA,EAAA,MAAA,EAAA;;AAAT,UApLD,sBAAA,SAA+B,oBAoL9B,CAAA;EAGD;AA+BjB;;EAGqB,IAAA,EAAA,QAAA;EAAf;;;EAEqB,OAAA,CAAA,EAAA,MAAA;EAArB;;;EAIA,QAAA,EAAA,OAAA;EACqB;;;EAEf,OAAA,CAAA,EAAA,MAAA,EAAA;;UA9MK,uBAAA,SAAgC;;;;;;;;;;KAWrC,gBAAA,GACR,yBACA,yBACA;KAEQ,mCAAmC,wBAAwB,KACrE,uBAGA,QAAQ,KAAK;;;KAIH,4BAAA,GACV,yBAAyB;KACf,4BAAA,GACV,yBAAyB;KACf,6BAAA,GACV,yBAAyB;KAEf,sBAAA,GACR,+BACA,+BACA;UAEa,oBAAA,SAA6B;;;;;;;;;;KAWlC,aAAA,GACR,yBACA,yBACA;KACQ,mBAAA,GAAsB,yBAAyB;KAE/C,eAAA,GACR,yBACA,yBACA;KACQ,qBAAA,GAAwB,yBAAyB;UAE5C,WAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAkDA,aAAA,SAAsB;;;;;;;;SAS9B;;KAGG,WAAA,GAAc;;;;;;;;;;;;;;;;WAgBf,eAAe;;;;QAIlB;;;;iBAIS;;;;YAIL,eAAe;;KAGf,qBAAA,GAAwB,KAAK;;;;;;;;YAQ7B,eAAe;;UAGV,eAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;UA+BA,aAAA;aACJ;YAEP,eAAe,uBACf,oBACA,qBAAqB,eAAe,yBACpC,EAAA,CAAG;SAEH,0BACA,uBACA,qBAAqB,0BACrB,EAAA,CAAG;YACG"}
@@ -1,9 +1,14 @@
1
1
  //#region src/types/command.ts
2
- const __ΩRecord = [
2
+ const __ΩPick = [
3
+ "T",
3
4
  "K",
5
+ "Pick",
6
+ "l+e#!e\"!fRb!b\"Pde\"\"N#!w#y"
7
+ ];
8
+ const __ΩPartial = [
4
9
  "T",
5
- "Record",
6
- "l'e#\"Rb!b\"Pde\"!N#!w#y"
10
+ "Partial",
11
+ "l+e#!e\"!fRb!Pde\"!gN#\"w\"y"
7
12
  ];
8
13
  const __ΩOmit = [
9
14
  "T",
@@ -13,11 +18,11 @@ const __ΩOmit = [
13
18
  "Omit",
14
19
  "b!b\"e!!e!!ge!\"o$#o##w%y"
15
20
  ];
16
- const __ΩPick = [
17
- "T",
21
+ const __ΩRecord = [
18
22
  "K",
19
- "Pick",
20
- "l+e#!e\"!fRb!b\"Pde\"\"N#!w#y"
23
+ "T",
24
+ "Record",
25
+ "l'e#\"Rb!b\"Pde\"!N#!w#y"
21
26
  ];
22
27
  const __ΩExclude = [
23
28
  "T",
@@ -25,9 +30,21 @@ const __ΩExclude = [
25
30
  "Exclude",
26
31
  "l6!Re$!RPe#!e$\"qk#%QRb!b\"Pde\"!p)w#y"
27
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"
44
+ ];
28
45
  const __ΩBaseCommandParameter = [
29
46
  "name",
30
- "ReflectionKind",
47
+ () => __ΩCommandParameterKind,
31
48
  "kind",
32
49
  "title",
33
50
  "description",
@@ -36,96 +53,124 @@ const __ΩBaseCommandParameter = [
36
53
  "env",
37
54
  "optional",
38
55
  "BaseCommandParameter",
39
- "P&4!\"w\"4#&4$&4%&F4&P&.'J4()4)Mw*y"
56
+ "P&4!n\"4#&4$&4%&F4&P&.'J4()4)Mw*y"
40
57
  ];
41
58
  const __ΩStringCommandParameter = [
42
59
  () => __ΩBaseCommandParameter,
43
- 5,
60
+ "string",
44
61
  "kind",
45
62
  "default",
63
+ "email",
64
+ "uri",
65
+ "uuid",
66
+ "ipv4",
67
+ "ipv6",
68
+ "date",
69
+ "time",
70
+ "date-time",
71
+ "duration",
72
+ "format",
46
73
  "variadic",
47
74
  "choices",
48
75
  "StringCommandParameter",
49
- "Pn!a\"4#&4$8)4%&F4&8Mw'y"
76
+ "Pn!.\"4#&4$8P.%.&.'.(.).*.+.,.-J4.8)4/&F408Mw1y"
50
77
  ];
51
78
  const __ΩNumberCommandParameter = [
52
79
  () => __ΩBaseCommandParameter,
53
- 6,
80
+ "number",
54
81
  "kind",
55
82
  "default",
56
83
  "variadic",
57
84
  "choices",
58
85
  "NumberCommandParameter",
59
- "Pn!a\"4#'4$8)4%'F4&8Mw'y"
86
+ "Pn!.\"4#'4$8)4%'F4&8Mw'y"
60
87
  ];
61
88
  const __ΩBooleanCommandParameter = [
62
89
  () => __ΩBaseCommandParameter,
63
- 7,
90
+ "boolean",
64
91
  "kind",
65
92
  "default",
66
- "isNegativeOf",
67
- "skipAddingNegative",
68
93
  "BooleanCommandParameter",
69
- "Pn!a\"4#)4$8&4%8)4&8Mw'y"
94
+ "Pn!.\"4#)4$8Mw%y"
95
+ ];
96
+ const __ΩCommandParameter = [
97
+ () => __ΩStringCommandParameter,
98
+ () => __ΩNumberCommandParameter,
99
+ () => __ΩBooleanCommandParameter,
100
+ "CommandParameter",
101
+ "Pn!n\"n#Jw$y"
102
+ ];
103
+ const __ΩAsCommandParameterConfig = [
104
+ "T",
105
+ () => __ΩPick,
106
+ "kind",
107
+ "alias",
108
+ () => __ΩPartial,
109
+ () => __ΩOmit,
110
+ "kind",
111
+ "alias",
112
+ "alias",
113
+ "AsCommandParameterConfig",
114
+ "b!Pe\"!P.#.$Jo\"#e\"!P.'.(Jo&#o%\"PP&&FJ4)8MKw*y"
70
115
  ];
71
- const __ΩStringCommandOption = [
116
+ const __ΩStringCommandParameterConfig = [
117
+ () => __ΩAsCommandParameterConfig,
72
118
  () => __ΩStringCommandParameter,
73
- "ReflectionProperty",
74
- "reflection",
75
- "StringCommandOption",
76
- "Pn!\"w\"4#8Mw$y"
119
+ "StringCommandParameterConfig",
120
+ "n\"o!\"w#y"
77
121
  ];
78
- const __ΩNumberCommandOption = [
122
+ const __ΩNumberCommandParameterConfig = [
123
+ () => __ΩAsCommandParameterConfig,
79
124
  () => __ΩNumberCommandParameter,
80
- "ReflectionProperty",
81
- "reflection",
82
- "NumberCommandOption",
83
- "Pn!\"w\"4#8Mw$y"
125
+ "NumberCommandParameterConfig",
126
+ "n\"o!\"w#y"
127
+ ];
128
+ const __ΩBooleanCommandParameterConfig = [
129
+ () => __ΩAsCommandParameterConfig,
130
+ () => __ΩBooleanCommandParameter,
131
+ "BooleanCommandParameterConfig",
132
+ "n\"o!\"w#y"
133
+ ];
134
+ const __ΩCommandParameterConfig = [
135
+ () => __ΩStringCommandParameterConfig,
136
+ () => __ΩNumberCommandParameterConfig,
137
+ () => __ΩBooleanCommandParameterConfig,
138
+ "CommandParameterConfig",
139
+ "Pn!n\"n#Jw$y"
84
140
  ];
85
141
  const __ΩBooleanCommandOption = [
86
142
  () => __ΩBooleanCommandParameter,
87
- "ReflectionProperty",
88
- "reflection",
89
143
  "isNegativeOf",
90
144
  "skipAddingNegative",
91
145
  "BooleanCommandOption",
92
- "Pn!\"w\"4#8&4$8)4%8Mw&y"
146
+ "Pn!&4\"8)4#8Mw$y"
93
147
  ];
94
148
  const __ΩCommandOption = [
95
- () => __ΩStringCommandOption,
96
- () => __ΩNumberCommandOption,
149
+ () => __ΩStringCommandParameter,
150
+ () => __ΩNumberCommandParameter,
97
151
  () => __ΩBooleanCommandOption,
98
152
  "CommandOption",
99
153
  "Pn!n\"n#Jw$y"
100
154
  ];
101
- const __ΩStringCommandArgument = [
102
- () => __ΩStringCommandParameter,
103
- "ReflectionParameter",
104
- "reflection",
105
- "StringCommandArgument",
106
- "Pn!\"w\"4#Mw$y"
155
+ const __ΩCommandOptionConfig = [
156
+ () => __ΩAsCommandParameterConfig,
157
+ () => __ΩCommandOption,
158
+ "CommandOptionConfig",
159
+ "n\"o!\"w#y"
107
160
  ];
108
- const __ΩNumberCommandArgument = [
161
+ const __ΩCommandArgument = [
162
+ () => __ΩStringCommandParameter,
109
163
  () => __ΩNumberCommandParameter,
110
- "ReflectionParameter",
111
- "reflection",
112
- "NumberCommandArgument",
113
- "Pn!\"w\"4#Mw$y"
114
- ];
115
- const __ΩBooleanCommandArgument = [
116
164
  () => __ΩBooleanCommandParameter,
117
- "ReflectionParameter",
118
- "reflection",
119
- "BooleanCommandArgument",
120
- "Pn!\"w\"4#Mw$y"
121
- ];
122
- const __ΩCommandArgument = [
123
- () => __ΩStringCommandArgument,
124
- () => __ΩNumberCommandArgument,
125
- () => __ΩBooleanCommandArgument,
126
165
  "CommandArgument",
127
166
  "Pn!n\"n#Jw$y"
128
167
  ];
168
+ const __ΩCommandArgumentConfig = [
169
+ () => __ΩAsCommandParameterConfig,
170
+ () => __ΩCommandArgument,
171
+ "CommandArgumentConfig",
172
+ "n\"o!\"w#y"
173
+ ];
129
174
  const __ΩCommandBase = [
130
175
  "id",
131
176
  "name",
@@ -139,15 +184,15 @@ const __ΩCommandBase = [
139
184
  "CommandBase",
140
185
  "PP&,J4!&4\"P&,J4#&F4$&4%8&4&8&F4'8&4(8)4)Mw*y"
141
186
  ];
142
- const __ΩCommandInput = [
187
+ const __ΩCommandConfig = [
143
188
  () => __ΩCommandBase,
144
189
  "id",
145
190
  "entry",
146
- "CommandInput",
191
+ "CommandConfig",
147
192
  "Pn!&4\"!4#Mw$y"
148
193
  ];
149
194
  const __ΩCommandTree = [
150
- () => __ΩCommandInput,
195
+ () => __ΩCommandConfig,
151
196
  "title",
152
197
  "description",
153
198
  "alias",
@@ -155,75 +200,50 @@ const __ΩCommandTree = [
155
200
  () => __ΩCommandOption,
156
201
  "options",
157
202
  () => __ΩCommandArgument,
158
- "arguments",
203
+ "args",
159
204
  0,
160
205
  "parent",
161
206
  () => __ΩRecord,
162
207
  0,
163
208
  "children",
164
- "ReflectionFunction",
165
- "reflection",
166
209
  "CommandTree",
167
- "Pn!P&4\"&4#&F4$&n&o%#4'n(F4)P,n*J4+&n-o,#4.P\"w/,J40MKw1y"
168
- ];
169
- const __ΩSerializedCommandOption = [
170
- () => __ΩOmit,
171
- () => __ΩCommandOption,
172
- "reflection",
173
- "SerializedCommandOption",
174
- "n\".#o!#w$y"
175
- ];
176
- const __ΩSerializedCommandArgument = [
177
- () => __ΩOmit,
178
- () => __ΩCommandArgument,
179
- "reflection",
180
- "SerializedCommandArgument",
181
- "n\".#o!#w$y"
210
+ "Pn!P&4\"&4#&F4$&n&o%#4'n(F4)P,n*J4+&n-o,#4.MKw/y"
182
211
  ];
183
212
  const __ΩSerializedCommandTree = [
184
213
  () => __ΩOmit,
185
214
  () => __ΩCommandTree,
186
- "options",
187
- "arguments",
188
215
  "parent",
189
216
  "children",
190
- "reflection",
191
- () => __ΩRecord,
192
- () => __ΩSerializedCommandOption,
193
- "options",
194
- () => __ΩSerializedCommandArgument,
195
- "arguments",
196
217
  "parent",
197
218
  () => __ΩRecord,
198
219
  0,
199
220
  "children",
200
- "SerializedTypes",
201
- "reflection",
202
221
  "SerializedCommandTree",
203
- "Pn\"P.#.$.%.&.'Jo!#P&n)o(#4*n+F4,P,&J4-&n/o.#40\"w1428MKw3y"
222
+ "Pn\"P.#.$Jo!#PP,&J4%&n'o&#4(MKw)y"
204
223
  ];
205
- const __ΩMetadata = [
224
+ const __ΩCommandMetadata = [
206
225
  "title",
207
226
  "description",
208
227
  "alias",
209
228
  "icon",
210
- "Metadata",
229
+ "CommandMetadata",
211
230
  "P&4!8&4\"8P&&FJ4#8&4$8Mw%y"
212
231
  ];
213
- const __ΩCommandParameterSchema = ["CommandParameterSchema", "P!!Jw!y"];
214
232
  const __ΩCommandModule = [
215
- () => __ΩMetadata,
233
+ () => __ΩCommandMetadata,
216
234
  "metadata",
217
235
  () => __ΩRecord,
218
- () => __ΩCommandParameterSchema,
236
+ () => __ΩCommandOptionConfig,
237
+ "JSONSchema7Object",
238
+ "StandardJSONSchemaV1",
219
239
  "options",
220
- () => __ΩCommandParameterSchema,
221
- "arguments",
240
+ () => __ΩCommandArgumentConfig,
241
+ "args",
222
242
  "default",
223
243
  "CommandModule",
224
- "Pn!4\"8&n$o##4%8n&F4'8!4(8Mw)y"
244
+ "Pn!4\"8P&n$o##\"w%\"w&!J4'8Pn(F!\"w&!J4)8!4*8Mw+y"
225
245
  ];
226
246
 
227
247
  //#endregion
228
- export { __ΩBaseCommandParameter, __ΩBooleanCommandArgument, __ΩBooleanCommandOption, __ΩBooleanCommandParameter, __ΩCommandArgument, __ΩCommandBase, __ΩCommandInput, __ΩCommandModule, __ΩCommandOption, __ΩCommandParameterSchema, __ΩCommandTree, __ΩMetadata, __ΩNumberCommandArgument, __ΩNumberCommandOption, __ΩNumberCommandParameter, __ΩSerializedCommandArgument, __ΩSerializedCommandOption, __ΩSerializedCommandTree, __ΩStringCommandArgument, __ΩStringCommandOption, __ΩStringCommandParameter };
248
+ export { CommandParameterKinds, __ΩAsCommandParameterConfig, __ΩBaseCommandParameter, __ΩBooleanCommandOption, __ΩBooleanCommandParameter, __ΩBooleanCommandParameterConfig, __ΩCommandArgument, __ΩCommandArgumentConfig, __ΩCommandBase, __ΩCommandConfig, __ΩCommandMetadata, __ΩCommandModule, __ΩCommandOption, __ΩCommandOptionConfig, __ΩCommandParameter, __ΩCommandParameterConfig, __ΩCommandParameterKind, __ΩCommandParameterType, __ΩCommandTree, __ΩNumberCommandParameter, __ΩNumberCommandParameterConfig, __ΩSerializedCommandTree, __ΩStringCommandParameter, __ΩStringCommandParameterConfig };
229
249
  //# 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 {\n ReflectionFunction,\n ReflectionKind,\n ReflectionParameter,\n ReflectionProperty,\n SerializedTypes\n} from \"@powerlines/deepkit/vendor/type\";\nimport type { AnyFunction } from \"@stryke/types/base\";\nimport type { ResolvedEntryTypeDefinition } from \"powerlines\";\nimport type * as z3 from \"zod/v3\";\nimport type * as z4 from \"zod/v4/core\";\n\nexport interface BaseCommandParameter {\n /**\n * The option name.\n */\n name: string;\n /**\n * The option kind.\n */\n kind: ReflectionKind;\n /**\n * The display title.\n */\n title: string;\n /**\n * The option description.\n */\n description: string;\n /**\n * Alternative option names.\n */\n alias: string[];\n /**\n * The environment variable name or false to disable.\n */\n env: string | false;\n /**\n * Whether the option is optional.\n */\n optional: boolean;\n}\n\nexport interface StringCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: ReflectionKind.string;\n /**\n * The default value.\n */\n default?: string;\n /**\n * Whether the option accepts multiple values.\n */\n variadic: boolean;\n\n /**\n * The allowed choices for the option value.\n */\n choices?: string[];\n}\n\nexport interface NumberCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: ReflectionKind.number;\n /**\n * The default value.\n */\n default?: number;\n /**\n * Whether the option accepts multiple values.\n */\n variadic: boolean;\n\n /**\n * The allowed choices for the option value.\n */\n choices?: number[];\n}\n\nexport interface BooleanCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: ReflectionKind.boolean;\n /**\n * The default value.\n */\n default?: boolean;\n /**\n * The option this negates.\n */\n isNegativeOf?: string;\n /**\n * Whether to skip adding a negative option.\n */\n skipAddingNegative?: boolean;\n}\n\nexport interface StringCommandOption extends StringCommandParameter {\n /**\n * The property reflection.\n */\n reflection?: ReflectionProperty;\n}\n\nexport interface NumberCommandOption extends NumberCommandParameter {\n /**\n * The property reflection.\n */\n reflection?: ReflectionProperty;\n}\n\nexport interface BooleanCommandOption extends BooleanCommandParameter {\n /**\n * The property reflection.\n */\n reflection?: ReflectionProperty;\n /**\n * The option this negates.\n */\n isNegativeOf?: string;\n /**\n * Whether to skip adding a negative option.\n */\n skipAddingNegative?: boolean;\n}\n\nexport type CommandOption =\n | StringCommandOption\n | NumberCommandOption\n | BooleanCommandOption;\n\nexport interface StringCommandArgument extends StringCommandParameter {\n /**\n * The parameter reflection.\n */\n reflection: ReflectionParameter;\n}\n\nexport interface NumberCommandArgument extends NumberCommandParameter {\n /**\n * The parameter reflection.\n */\n reflection: ReflectionParameter;\n}\n\nexport interface BooleanCommandArgument extends BooleanCommandParameter {\n /**\n * The parameter reflection.\n */\n reflection: ReflectionParameter;\n}\n\nexport type CommandArgument =\n | StringCommandArgument\n | NumberCommandArgument\n | BooleanCommandArgument;\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 * 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 CommandInput extends CommandBase {\n /**\n * The command id.\n */\n id: string;\n\n /**\n * The resolved entry definition.\n */\n entry: ResolvedEntryTypeDefinition;\n}\n\nexport type CommandTree = CommandInput & {\n /**\n * The display title.\n */\n title: string;\n /**\n * The command description.\n */\n description: string;\n /**\n * Alternative command names.\n */\n alias: string[];\n /**\n * The command options.\n */\n options: Record<string, CommandOption>;\n /**\n * The positional arguments provided to the command.\n */\n arguments: CommandArgument[];\n /**\n * The parent command.\n */\n parent: null | CommandTree;\n /**\n * Child commands.\n */\n children: Record<string, CommandTree>;\n /**\n * The command handler reflection.\n */\n reflection: ReflectionFunction | null;\n};\n\nexport type SerializedCommandOption = Omit<CommandOption, \"reflection\">;\n\nexport type SerializedCommandArgument = Omit<CommandArgument, \"reflection\">;\n\nexport type SerializedCommandTree = Omit<\n CommandTree,\n \"options\" | \"arguments\" | \"parent\" | \"children\" | \"reflection\"\n> & {\n /**\n * The command options.\n */\n options: Record<string, SerializedCommandOption>;\n /**\n * The positional arguments provided to the command.\n */\n arguments: SerializedCommandArgument[];\n /**\n * The parent command id.\n */\n parent: null | string;\n /**\n * Serialized child commands.\n */\n children: Record<string, SerializedCommandTree>;\n /**\n * The command handler reflection.\n */\n reflection?: SerializedTypes;\n};\n\nexport interface Metadata {\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 * 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\nexport type CommandParameterSchema = z3.ZodTypeAny | z4.$ZodType;\n\nexport interface CommandModule {\n metadata?: Metadata;\n options?: Record<string, CommandParameterSchema>;\n arguments?: CommandParameterSchema[];\n default?: AnyFunction;\n}\n"],"mappings":";AAAA,MAAM,YAAY;CAAC;CAAK;CAAK;CAAU;CAAyB;;;;;;;;;AAEhE,MAAM,UAAU;CAAC;CAAK;CAAK;CAAQ;CAAY;;;;;;;AAE/C,MAAM,0BAA0B;CAAC;CAAQ;CAAkB;CAAQ;CAAG;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEtE,MAAM,4BAA4B;OAAO;CAAyB;CAAG;CAAE;CAAA;CAAA;CAAA;CAAA;CAAA;;;;;;;;;;;AAIvE,MAAM,6BAA6B;OAAO;CAAyB;CAAG;CAAC;CAAA;CAAA;CAAA;CAAA;CAAA;AAEvE,MAAM,yBAAyB;OAAO;CAAqB;CAAA;CAAA;CAAA;CAAA;AAE3D,MAAM,yBAAyB;OAAK;CAAA;CAAA;CAAA;CAAA;CAAA;AAEpC,MAAM,0BAA0B;OAAO;CAA4B;CAAG;CAAA;CAAA;CAAA;CAAA;CAAA;AAEtE,MAAM,mBAAM;OAAA;OAAA;OAAA;CAAA;CAAA;CAAA;AAEZ,MAAM,2BAAU;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEhB,MAAM,2BAAc;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEpB,MAAM,4BAA4B;OAAM;CAAA;CAAA;CAAA;CAAA;CAAA;AAExC,MAAM,qBAAqB;OAAO;OAA2B;OAAA;CAAA;CAAA;CAAA;AAE7D,MAAM,iBAAiB;CAAC;CAAM;CAAQ;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEtC,MAAM,kBAAkB;OAAO;CAAO;CAAA;CAAA;CAAA;CAAA;AAEtC,MAAM,iBAAc;OAAA;CAAA;CAAA;CAAA;OAAA;OAAA;CAAA;OAAA;CAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEpB,MAAM,6BAAQ;OAAA;OAAA;CAAA;CAAA;CAAA;CAAA;AAEd,MAAM,+BAAc;OAAA;OAAA;CAAA;CAAA;CAAA;CAAA;AAEpB,MAAM,2BAAgB;OAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;OAAA;OAAA;CAAA;OAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEtB,MAAM,cAAc;CAAC;CAAC;CAAA;CAAA;CAAA;CAAA;CAAA;AAEtB,MAAM,4BAAS,CAAA,0BAAA,UAAA;AAEf,MAAM,mBAAmB;OAAE;CAAA;OAAA;OAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA"}
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 * The option kind.\n */\n kind: CommandParameterKind;\n /**\n * The display title.\n */\n title: string;\n /**\n * The option description.\n */\n description: string;\n /**\n * Alternative option names.\n */\n alias: string[];\n /**\n * The environment variable name or false to disable.\n */\n env: string | false;\n /**\n * Whether the option is optional.\n */\n optional: boolean;\n}\n\nexport interface StringCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: \"string\";\n /**\n * The default value.\n */\n default?: string;\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 * Whether the option accepts multiple values.\n */\n variadic: boolean;\n\n /**\n * The allowed choices for the option value.\n */\n choices?: string[];\n}\n\nexport interface NumberCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: \"number\";\n /**\n * The default value.\n */\n default?: number;\n /**\n * Whether the option accepts multiple values.\n */\n variadic: boolean;\n\n /**\n * The allowed choices for the option value.\n */\n choices?: number[];\n}\n\nexport interface BooleanCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: \"boolean\";\n /**\n * The default value.\n */\n default?: boolean;\n}\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 BooleanCommandParameter {\n /**\n * The option this negates.\n */\n isNegativeOf?: string;\n /**\n * Whether to skip adding a negative option.\n */\n skipAddingNegative?: boolean;\n}\n\nexport type CommandOption =\n | StringCommandParameter\n | NumberCommandParameter\n | BooleanCommandOption;\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 * 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\nexport type CommandTree = CommandConfig & {\n /**\n * The display title.\n */\n title: string;\n /**\n * The command description.\n */\n description: string;\n /**\n * Alternative command names.\n */\n alias: string[];\n /**\n * The command options.\n */\n options: Record<string, CommandOption>;\n /**\n * The positional arguments provided to the command.\n */\n args: CommandArgument[];\n /**\n * The parent command.\n */\n parent: null | CommandTree;\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 * 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\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;CAAK;OAAW;OAAc;CAAA;CAAA;CAAA;;;;;;;AAE/C,MAAM,aAAa;CAAC;CAAK;CAAK;CAAW;CAA6B;AACtE,MAAM,0BAA0B,CAAC,wBAAwB,gBAAW;AAEpE,MAAa,wBAAwB;;CAEjC,QAAQ;CACR,SAAS;CACZ;AACD,MAAM,0BAA0B;OAAO;OAAoB;CAAA;CAAA;CAAA;AAE3D,MAAM,0BAA0B;CAAC;OAAG;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEpC,MAAM,4BAA4B;OAAO;CAAyB;CAAI;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEtE,MAAM,4BAA4B;OAAO;CAAwB;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEjE,MAAM,6BAA6B;OAAO;CAAW;CAAA;CAAA;CAAA;CAAA;CAAA;AAErD,MAAM,sBAAsB;OAAO;OAA0B;OAAA;CAAA;CAAA;CAAA;;;;;;;;;;;;;;AAI7D,MAAM,kCAAG;OAAA;OAAA;CAAA;CAAA;CAAA;AAET,MAAM,kCAAI;OAAA;OAAA;CAAA;CAAA;CAAA;;;;;;;AAIV,MAAM,4BAAY;OAAA;OAAA;OAAA;CAAA;CAAA;CAAA;AAElB,MAAM,0BAAa;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;;;;;;;;AAInB,MAAM,yBAAyB;OAAO;OAA8B;CAAA;CAAA;CAAA;AAEpE,MAAM,qBAAqB;OAAO;OAAI;OAAA;CAAA;CAAA;CAAA;AAEtC,MAAM,2BAAc;OAAA;OAAA;CAAA;CAAA;CAAA;AAEpB,MAAM,iBAAQ;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEd,MAAM,mBAAc;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEpB,MAAM,iBAAiB;OAAK;CAAA;CAAA;CAAA;OAAA;OAAA;CAAA;OAAA;CAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAE5B,MAAM,2BAAgB;OAAA;OAAA;CAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEtB,MAAM,qBAAS;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEf,MAAM,mBAAmB;OAAE;CAAA;OAAA;OAAA;CAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA"}
@@ -12,7 +12,7 @@ const __ΩContext = [
12
12
  "commandsPath",
13
13
  "CommandOption",
14
14
  "options",
15
- "CommandInput",
15
+ "CommandConfig",
16
16
  "inputs",
17
17
  () => __ΩRecord,
18
18
  "CommandTree",
@@ -1 +1 @@
1
- {"version":3,"file":"context.cjs","names":[],"sources":["../../src/types/context.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 { NodeJsPluginContext } from \"@powerlines/plugin-nodejs/types/plugin\";\nimport type { TsdownPluginContext } from \"@powerlines/plugin-tsdown/types/plugin\";\nimport type { UnresolvedContext as PowerlinesUnresolvedContext } from \"powerlines\";\nimport type { CommandInput, CommandOption, CommandTree } from \"./command\";\nimport type { ResolvedConfig } from \"./config\";\n\nexport type Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> =\n TsdownPluginContext<TResolvedConfig> &\n NodeJsPluginContext<TResolvedConfig> & {\n /**\n * The root path where commands are located.\n */\n commandsPath: string;\n\n /**\n * The default command arguments to apply to all application commands.\n */\n options: CommandOption[];\n\n /**\n * The list of commands discovered in the project.\n */\n inputs: CommandInput[];\n\n /**\n * The command-line application structure.\n */\n commands: Record<string, CommandTree>;\n };\n\nexport type UnresolvedContext<\n TResolvedConfig extends ResolvedConfig = ResolvedConfig\n> = PowerlinesUnresolvedContext<TResolvedConfig>;\n"],"mappings":";;AAAA,MAAM,YAAY;CAAC;CAAK;CAAK;CAAU;CAAyB"}
1
+ {"version":3,"file":"context.cjs","names":[],"sources":["../../src/types/context.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 { NodeJsPluginContext } from \"@powerlines/plugin-nodejs/types/plugin\";\nimport type { TsdownPluginContext } from \"@powerlines/plugin-tsdown/types/plugin\";\nimport type { UnresolvedContext as PowerlinesUnresolvedContext } from \"powerlines\";\nimport type { CommandConfig, CommandOption, CommandTree } from \"./command\";\nimport type { ResolvedConfig } from \"./config\";\n\nexport type Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> =\n TsdownPluginContext<TResolvedConfig> &\n NodeJsPluginContext<TResolvedConfig> & {\n /**\n * The root path where commands are located.\n */\n commandsPath: string;\n\n /**\n * The default command arguments to apply to all application commands.\n */\n options: CommandOption[];\n\n /**\n * The list of commands discovered in the project.\n */\n inputs: CommandConfig[];\n\n /**\n * The command-line application structure.\n */\n commands: Record<string, CommandTree>;\n };\n\nexport type UnresolvedContext<\n TResolvedConfig extends ResolvedConfig = ResolvedConfig\n> = PowerlinesUnresolvedContext<TResolvedConfig>;\n"],"mappings":";;AAAA,MAAM,YAAY;CAAC;CAAK;CAAK;CAAU;CAAyB"}
@@ -1,4 +1,4 @@
1
- import { CommandInput, CommandOption, CommandTree } from "./command.cjs";
1
+ import { CommandConfig, CommandOption, CommandTree } from "./command.cjs";
2
2
  import { ResolvedConfig } from "./config.cjs";
3
3
  import { UnresolvedContext as UnresolvedContext$1 } from "powerlines";
4
4
  import { NodeJsPluginContext } from "@powerlines/plugin-nodejs/types/plugin";
@@ -17,7 +17,7 @@ type Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = TsdownPl
17
17
  /**
18
18
  * The list of commands discovered in the project.
19
19
  */
20
- inputs: CommandInput[];
20
+ inputs: CommandConfig[];
21
21
  /**
22
22
  * The command-line application structure.
23
23
  */
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.cts","names":[],"sources":["../../src/types/context.ts"],"sourcesContent":[],"mappings":";;;;;;;KAwBY,gCAAgC,iBAAiB,kBAC3D,oBAAoB,mBAClB,oBAAoB;;AAFxB;;EAA6D,YAAA,EAAA,MAAA;EACvC;;;EAClB,OAAA,EASW,aATX,EAAA;EASW;;;EAUC,MAAA,EALF,YAKE,EAAA;EAAM;AAGtB;;EAC2C,QAAA,EAJ3B,MAI2B,CAAA,MAAA,EAJZ,WAIY,CAAA;CACX;AAA5B,KAFQ,iBAER,CAAA,wBADsB,cACtB,GADuC,cACvC,CAAA,GAAA,mBAAA,CAA4B,eAA5B,CAAA"}
1
+ {"version":3,"file":"context.d.cts","names":[],"sources":["../../src/types/context.ts"],"sourcesContent":[],"mappings":";;;;;;;KAwBY,gCAAgC,iBAAiB,kBAC3D,oBAAoB,mBAClB,oBAAoB;;AAFxB;;EAA6D,YAAA,EAAA,MAAA;EACvC;;;EAClB,OAAA,EASW,aATX,EAAA;EASW;;;EAUC,MAAA,EALF,aAKE,EAAA;EAAM;AAGtB;;EAC2C,QAAA,EAJ3B,MAI2B,CAAA,MAAA,EAJZ,WAIY,CAAA;CACX;AAA5B,KAFQ,iBAER,CAAA,wBADsB,cACtB,GADuC,cACvC,CAAA,GAAA,mBAAA,CAA4B,eAA5B,CAAA"}