convoker 0.3.4 → 0.4.1

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 (47) hide show
  1. package/LICENSE +1 -1
  2. package/dist/color/index.d.mts +2 -0
  3. package/dist/color/index.mjs +3 -0
  4. package/dist/{color-OlJQTTxb.mjs → color-s-N9yh90.mjs} +7 -41
  5. package/dist/color-s-N9yh90.mjs.map +1 -0
  6. package/dist/command/index.d.mts +5 -0
  7. package/dist/command/index.mjs +9 -0
  8. package/dist/{command-D2UiQBNA.mjs → command-C9QIG--8.mjs} +187 -148
  9. package/dist/command-C9QIG--8.mjs.map +1 -0
  10. package/dist/{index-Dikc5KAP.d.mts → index-C0cH9MIP.d.mts} +4 -3
  11. package/dist/{input-B12iaqb8.d.mts → index-C6iJZTo3.d.mts} +20 -5
  12. package/dist/index-CCQ6jz54.d.mts +58 -0
  13. package/dist/{command-BXmfoT-l.d.mts → index-OUlP1L9o.d.mts} +10 -25
  14. package/dist/index.d.mts +62 -43
  15. package/dist/index.mjs +8 -9
  16. package/dist/input/index.d.mts +3 -0
  17. package/dist/input/index.mjs +4 -0
  18. package/dist/{input-DRy_sVxZ.mjs → input-li13L1uf.mjs} +5 -3
  19. package/dist/input-li13L1uf.mjs.map +1 -0
  20. package/dist/prompt/index.d.mts +3 -3
  21. package/dist/prompt/index.mjs +5 -6
  22. package/dist/prompt/raw.mjs +1 -2
  23. package/dist/{prompt-Cvufljin.mjs → prompt-OXGrAkDf.mjs} +30 -58
  24. package/dist/prompt-OXGrAkDf.mjs.map +1 -0
  25. package/dist/raw-BqvlveTU.d.mts +2 -1
  26. package/dist/{raw--889icsd.mjs → raw-DVT5lw11.mjs} +4 -21
  27. package/dist/raw-DVT5lw11.mjs.map +1 -0
  28. package/dist/{standard-schema-DLeKaehR.d.mts → standard-schema-D1sStgzy.d.mts} +3 -2
  29. package/dist/standard-schema-WhGEzW0C.mjs +32 -0
  30. package/dist/standard-schema-WhGEzW0C.mjs.map +1 -0
  31. package/dist/{utils-ChmY93uA.mjs → theme-Chg3mOhZ.mjs} +36 -13
  32. package/dist/theme-Chg3mOhZ.mjs.map +1 -0
  33. package/dist/theme-EERPMtQU.d.mts +115 -0
  34. package/dist/theme.d.mts +2 -0
  35. package/dist/theme.mjs +4 -0
  36. package/package.json +18 -17
  37. package/dist/color-BuHvMolk.d.mts +0 -158
  38. package/dist/color.d.mts +0 -2
  39. package/dist/color.mjs +0 -4
  40. package/dist/command.d.mts +0 -5
  41. package/dist/command.mjs +0 -10
  42. package/dist/error-C1S1gs8L.mjs +0 -115
  43. package/dist/error.d.mts +0 -5
  44. package/dist/error.mjs +0 -3
  45. package/dist/input.d.mts +0 -3
  46. package/dist/input.mjs +0 -5
  47. package/dist/standard-schema-DBXbMy6L.mjs +0 -17
@@ -1,158 +0,0 @@
1
- declare namespace color_d_exports {
2
- export { DEFAULT_THEME, Theme, bgBlack, bgBlue, bgBlueBright, bgCyan, bgCyanBright, bgGray, bgGreen, bgGreenBright, bgMagenta, bgMagentaBright, bgRed, bgRedBright, bgWhite, bgWhiteBright, bgYellow, bgYellowBright, black, blue, blueBright, bold, createAnsiColor, cyan, cyanBright, defineTheme, dim, gray, green, greenBright, hidden, inverse, italic, magenta, magentaBright, overline, red, redBright, reset, strikethrough, supportsColor, underline, white, whiteBright, yellow, yellowBright };
3
- }
4
- /**
5
- * If the runtime supports color.
6
- */
7
- declare const supportsColor: boolean;
8
- /**
9
- * Creates a function that wraps a string in ANSI codes.
10
- * @param open The opening ANSI code.
11
- * @param close The closing ANSI code.
12
- * @returns A function that wraps the string in ANSI codes.
13
- */
14
- declare function createAnsiColor(open: number, close: number): (input: any) => string;
15
- declare const reset: (input: any) => string;
16
- declare const bold: (input: any) => string;
17
- declare const dim: (input: any) => string;
18
- declare const italic: (input: any) => string;
19
- declare const underline: (input: any) => string;
20
- declare const overline: (input: any) => string;
21
- declare const inverse: (input: any) => string;
22
- declare const hidden: (input: any) => string;
23
- declare const strikethrough: (input: any) => string;
24
- declare const black: (input: any) => string;
25
- declare const red: (input: any) => string;
26
- declare const green: (input: any) => string;
27
- declare const yellow: (input: any) => string;
28
- declare const blue: (input: any) => string;
29
- declare const magenta: (input: any) => string;
30
- declare const cyan: (input: any) => string;
31
- declare const white: (input: any) => string;
32
- declare const gray: (input: any) => string;
33
- declare const bgBlack: (input: any) => string;
34
- declare const bgRed: (input: any) => string;
35
- declare const bgGreen: (input: any) => string;
36
- declare const bgYellow: (input: any) => string;
37
- declare const bgBlue: (input: any) => string;
38
- declare const bgMagenta: (input: any) => string;
39
- declare const bgCyan: (input: any) => string;
40
- declare const bgWhite: (input: any) => string;
41
- declare const bgGray: (input: any) => string;
42
- declare const redBright: (input: any) => string;
43
- declare const greenBright: (input: any) => string;
44
- declare const yellowBright: (input: any) => string;
45
- declare const blueBright: (input: any) => string;
46
- declare const magentaBright: (input: any) => string;
47
- declare const cyanBright: (input: any) => string;
48
- declare const whiteBright: (input: any) => string;
49
- declare const bgRedBright: (input: any) => string;
50
- declare const bgGreenBright: (input: any) => string;
51
- declare const bgYellowBright: (input: any) => string;
52
- declare const bgBlueBright: (input: any) => string;
53
- declare const bgMagentaBright: (input: any) => string;
54
- declare const bgCyanBright: (input: any) => string;
55
- declare const bgWhiteBright: (input: any) => string;
56
- /**
57
- * A theme.
58
- */
59
- interface Theme {
60
- /**
61
- * Wraps a string in a background ANSI code.
62
- * @param a The string to wrap.
63
- */
64
- background?(a: string): string;
65
- /**
66
- * Wraps a string in a foreground ANSI code.
67
- * @param a The string to wrap.
68
- */
69
- foreground?(a: string): string;
70
- /**
71
- * Wraps a string in a primary ANSI code.
72
- * @param a The string to wrap.
73
- */
74
- primary(a: string): string;
75
- /**
76
- * Wraps a string in a secondary ANSI code.
77
- * @param a The string to wrap.
78
- */
79
- secondary(a: string): string;
80
- /**
81
- * Wraps a string in a accent ANSI code.
82
- * @param a The string to wrap.
83
- */
84
- accent?(a: string): string;
85
- /**
86
- * Wraps a string in a success ANSI code.
87
- * @param a The string to wrap.
88
- */
89
- success(a: string): string;
90
- /**
91
- * Wraps a string in a warning ANSI code.
92
- * @param a The string to wrap.
93
- */
94
- warning(a: string): string;
95
- /**
96
- * Wraps a string in a error ANSI code.
97
- * @param a The string to wrap.
98
- */
99
- error(a: string): string;
100
- /**
101
- * Wraps a string in a info ANSI code.
102
- * @param a The string to wrap.
103
- */
104
- info?(a: string): string;
105
- /**
106
- * Set of symbols for logging.
107
- */
108
- symbols?: {
109
- /**
110
- * Success message symbol.
111
- */
112
- success: string;
113
- /**
114
- * Error message symbol.
115
- */
116
- error: string;
117
- /**
118
- * Warning message symbol.
119
- */
120
- warning: string;
121
- /**
122
- * Information message symbol.
123
- */
124
- info?: string;
125
- };
126
- /**
127
- * Optional styles.
128
- */
129
- styles?: {
130
- /**
131
- * Wraps a string in a bold ANSI code.
132
- * @param a The string to wrap.
133
- */
134
- bold?(a: string): string;
135
- /**
136
- * Wraps a string in an italic ANSI code.
137
- * @param a The string to wrap.
138
- */
139
- italic?(a: string): string;
140
- /**
141
- * Wraps a string in an underline ANSI code.
142
- * @param a The string to wrap.
143
- */
144
- underline?(a: string): string;
145
- };
146
- }
147
- /**
148
- * The default theme.
149
- */
150
- declare const DEFAULT_THEME: Theme;
151
- /**
152
- * Defines a theme.
153
- * @param theme The (partial) theme.
154
- * @returns The theme, merged with the default theme.
155
- */
156
- declare function defineTheme(theme: Partial<Theme>): Theme;
157
- //#endregion
158
- export { green as A, reset as B, color_d_exports as C, defineTheme as D, cyanBright as E, magenta as F, whiteBright as G, supportsColor as H, magentaBright as I, yellow as K, overline as L, hidden as M, inverse as N, dim as O, italic as P, red as R, bold as S, cyan as T, underline as U, strikethrough as V, white as W, bgYellow as _, bgBlueBright as a, blue as b, bgGray as c, bgMagenta as d, bgMagentaBright as f, bgWhiteBright as g, bgWhite as h, bgBlue as i, greenBright as j, gray as k, bgGreen as l, bgRedBright as m, Theme as n, bgCyan as o, bgRed as p, yellowBright as q, bgBlack as r, bgCyanBright as s, DEFAULT_THEME as t, bgGreenBright as u, bgYellowBright as v, createAnsiColor as w, blueBright as x, black as y, redBright as z };
package/dist/color.d.mts DELETED
@@ -1,2 +0,0 @@
1
- import { A as green, B as reset, D as defineTheme, E as cyanBright, F as magenta, G as whiteBright, H as supportsColor, I as magentaBright, K as yellow, L as overline, M as hidden, N as inverse, O as dim, P as italic, R as red, S as bold, T as cyan, U as underline, V as strikethrough, W as white, _ as bgYellow, a as bgBlueBright, b as blue, c as bgGray, d as bgMagenta, f as bgMagentaBright, g as bgWhiteBright, h as bgWhite, i as bgBlue, j as greenBright, k as gray, l as bgGreen, m as bgRedBright, n as Theme, o as bgCyan, p as bgRed, q as yellowBright, r as bgBlack, s as bgCyanBright, t as DEFAULT_THEME, u as bgGreenBright, v as bgYellowBright, w as createAnsiColor, x as blueBright, y as black, z as redBright } from "./color-BuHvMolk.mjs";
2
- export { DEFAULT_THEME, Theme, bgBlack, bgBlue, bgBlueBright, bgCyan, bgCyanBright, bgGray, bgGreen, bgGreenBright, bgMagenta, bgMagentaBright, bgRed, bgRedBright, bgWhite, bgWhiteBright, bgYellow, bgYellowBright, black, blue, blueBright, bold, createAnsiColor, cyan, cyanBright, defineTheme, dim, gray, green, greenBright, hidden, inverse, italic, magenta, magentaBright, overline, red, redBright, reset, strikethrough, supportsColor, underline, white, whiteBright, yellow, yellowBright };
package/dist/color.mjs DELETED
@@ -1,4 +0,0 @@
1
- import "./utils-ChmY93uA.mjs";
2
- import { A as greenBright, B as strikethrough, C as createAnsiColor, D as dim, E as defineTheme, F as magentaBright, G as yellow, H as underline, I as overline, K as yellowBright, L as red, M as inverse, N as italic, O as gray, P as magenta, R as redBright, T as cyanBright, U as white, V as supportsColor, W as whiteBright, _ as bgYellowBright, a as bgCyan, b as blueBright, c as bgGreen, d as bgMagentaBright, f as bgRed, g as bgYellow, h as bgWhiteBright, i as bgBlueBright, j as hidden, k as green, l as bgGreenBright, m as bgWhite, n as bgBlack, o as bgCyanBright, p as bgRedBright, r as bgBlue, s as bgGray, t as DEFAULT_THEME, u as bgMagenta, v as black, w as cyan, x as bold, y as blue, z as reset } from "./color-OlJQTTxb.mjs";
3
-
4
- export { DEFAULT_THEME, bgBlack, bgBlue, bgBlueBright, bgCyan, bgCyanBright, bgGray, bgGreen, bgGreenBright, bgMagenta, bgMagentaBright, bgRed, bgRedBright, bgWhite, bgWhiteBright, bgYellow, bgYellowBright, black, blue, blueBright, bold, createAnsiColor, cyan, cyanBright, defineTheme, dim, gray, green, greenBright, hidden, inverse, italic, magenta, magentaBright, overline, red, redBright, reset, strikethrough, supportsColor, underline, white, whiteBright, yellow, yellowBright };
@@ -1,5 +0,0 @@
1
- import "./color-BuHvMolk.mjs";
2
- import "./standard-schema-DLeKaehR.mjs";
3
- import "./input-B12iaqb8.mjs";
4
- import { a as ErrorFn, i as CommandAlias, n as Builder, o as MiddlewareFn, r as Command, s as ParseResult, t as ActionFn } from "./command-BXmfoT-l.mjs";
5
- export { ActionFn, Builder, Command, CommandAlias, ErrorFn, MiddlewareFn, ParseResult };
package/dist/command.mjs DELETED
@@ -1,10 +0,0 @@
1
- import "./utils-ChmY93uA.mjs";
2
- import "./color-OlJQTTxb.mjs";
3
- import "./error-C1S1gs8L.mjs";
4
- import "./standard-schema-DBXbMy6L.mjs";
5
- import "./raw--889icsd.mjs";
6
- import "./prompt-Cvufljin.mjs";
7
- import { t as Command } from "./command-D2UiQBNA.mjs";
8
- import "./input-DRy_sVxZ.mjs";
9
-
10
- export { Command };
@@ -1,115 +0,0 @@
1
- import { t as __export } from "./chunk-z5eko27R.mjs";
2
-
3
- //#region src/error.ts
4
- var error_exports = /* @__PURE__ */ __export({
5
- ConvokerError: () => ConvokerError,
6
- HelpAskedError: () => HelpAskedError,
7
- InputValidationError: () => InputValidationError,
8
- MissingRequiredArgumentError: () => MissingRequiredArgumentError,
9
- MissingRequiredOptionError: () => MissingRequiredOptionError,
10
- TooManyArgumentsError: () => TooManyArgumentsError,
11
- UnknownOptionError: () => UnknownOptionError
12
- });
13
- /**
14
- * Thrown when the command fails to validate an input.
15
- */
16
- var InputValidationError = class extends Error {
17
- /**
18
- * Creates a new input validation error.
19
- * @param messages The messages.
20
- */
21
- constructor(messages) {
22
- super(`Validation failed: ${messages.join(", ")}`);
23
- this.messages = messages;
24
- }
25
- };
26
- /**
27
- * A Convoker-related error. These are usually handled by default.
28
- */
29
- var ConvokerError = class extends Error {
30
- /**
31
- * Creates a new Convoker error.
32
- * @param message The message.
33
- * @param command The command.
34
- */
35
- constructor(message, command) {
36
- super(message);
37
- this.command = command;
38
- }
39
- /**
40
- * Prints the error's message.
41
- */
42
- print() {
43
- console.error(this.message);
44
- }
45
- };
46
- /**
47
- * When the user asks for help.
48
- */
49
- var HelpAskedError = class extends ConvokerError {
50
- /**
51
- * Creates a new help asked error.
52
- * @param command The command.
53
- */
54
- constructor(command) {
55
- super("user asked for help!", command);
56
- }
57
- };
58
- /**
59
- * When you pass too many arguments.
60
- */
61
- var TooManyArgumentsError = class extends ConvokerError {
62
- /**
63
- * Creates a new too many arguments error.
64
- * @param command The command.
65
- */
66
- constructor(command) {
67
- super("too many arguments!", command);
68
- }
69
- };
70
- /**
71
- * When you pass an unknown option, when unknown options aren't allowed.
72
- */
73
- var UnknownOptionError = class extends ConvokerError {
74
- /**
75
- * Creates a new unknown option error.
76
- * @param command The command.
77
- * @param key The key.
78
- */
79
- constructor(command, key) {
80
- super(`unknown option: ${key}!`, command);
81
- this.key = key;
82
- }
83
- };
84
- /**
85
- * When a required option is missing.
86
- */
87
- var MissingRequiredOptionError = class extends ConvokerError {
88
- /**
89
- * Creates a new missing required option error.
90
- * @param command The command.
91
- * @param key The key.
92
- * @param entry The entry.
93
- */
94
- constructor(command, key, entry) {
95
- super(`missing required option: ${key}!`, command);
96
- this.key = key;
97
- this.entry = entry;
98
- }
99
- };
100
- var MissingRequiredArgumentError = class extends ConvokerError {
101
- /**
102
- * Creates a new missing required argument error.
103
- * @param command The command.
104
- * @param key The key.
105
- * @param entry The entry.
106
- */
107
- constructor(command, key, entry) {
108
- super(`missing required positional argument: ${key}!`, command);
109
- this.key = key;
110
- this.entry = entry;
111
- }
112
- };
113
-
114
- //#endregion
115
- export { MissingRequiredOptionError as a, error_exports as c, MissingRequiredArgumentError as i, HelpAskedError as n, TooManyArgumentsError as o, InputValidationError as r, UnknownOptionError as s, ConvokerError as t };
package/dist/error.d.mts DELETED
@@ -1,5 +0,0 @@
1
- import "./color-BuHvMolk.mjs";
2
- import "./standard-schema-DLeKaehR.mjs";
3
- import "./input-B12iaqb8.mjs";
4
- import { c as ConvokerError, d as MissingRequiredArgumentError, f as MissingRequiredOptionError, l as HelpAskedError, m as UnknownOptionError, p as TooManyArgumentsError, u as InputValidationError } from "./command-BXmfoT-l.mjs";
5
- export { ConvokerError, HelpAskedError, InputValidationError, MissingRequiredArgumentError, MissingRequiredOptionError, TooManyArgumentsError, UnknownOptionError };
package/dist/error.mjs DELETED
@@ -1,3 +0,0 @@
1
- import { a as MissingRequiredOptionError, i as MissingRequiredArgumentError, n as HelpAskedError, o as TooManyArgumentsError, r as InputValidationError, s as UnknownOptionError, t as ConvokerError } from "./error-C1S1gs8L.mjs";
2
-
3
- export { ConvokerError, HelpAskedError, InputValidationError, MissingRequiredArgumentError, MissingRequiredOptionError, TooManyArgumentsError, UnknownOptionError };
package/dist/input.d.mts DELETED
@@ -1,3 +0,0 @@
1
- import "./standard-schema-DLeKaehR.mjs";
2
- import { a as Kind, c as TypeOf, f as option, i as Input, l as argument, n as InferEntry, o as Option, p as positional, r as InferInput, s as Positional, t as BasicKind, u as convert } from "./input-B12iaqb8.mjs";
3
- export { BasicKind, InferEntry, InferInput, Input, Kind, Option, Positional, TypeOf, argument, convert, option, positional };
package/dist/input.mjs DELETED
@@ -1,5 +0,0 @@
1
- import "./error-C1S1gs8L.mjs";
2
- import "./standard-schema-DBXbMy6L.mjs";
3
- import { i as convert, n as Positional, o as option, r as argument, s as positional, t as Option } from "./input-DRy_sVxZ.mjs";
4
-
5
- export { Option, Positional, argument, convert, option, positional };
@@ -1,17 +0,0 @@
1
- import { r as InputValidationError } from "./error-C1S1gs8L.mjs";
2
-
3
- //#region src/standard-schema.ts
4
- /**
5
- * Validates a value.
6
- * @param entry The Standard Schema validator.
7
- * @param value The value to validate.
8
- * @returns The validated value.
9
- */
10
- async function validate(entry, value) {
11
- const result = await entry["~standard"].validate(value);
12
- if (result.issues) throw new InputValidationError(result.issues.map((i) => i.message));
13
- return result.value;
14
- }
15
-
16
- //#endregion
17
- export { validate as t };