@visulima/cerebro 3.0.0-alpha.9 → 3.0.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.
- package/CHANGELOG.md +593 -0
- package/LICENSE.md +1295 -3950
- package/README.md +182 -2
- package/dist/commands/completion-command.d.ts +6 -5
- package/dist/commands/completion-command.js +5 -203
- package/dist/commands/help-command.d.ts +10 -9
- package/dist/commands/help-command.js +1 -3
- package/dist/commands/readme-command.d.ts +6 -5
- package/dist/commands/readme-command.js +32 -330
- package/dist/commands/version-command.d.ts +4 -3
- package/dist/commands/version-command.js +1 -18
- package/dist/index.d.ts +516 -95
- package/dist/index.js +1 -7
- package/dist/logger/create-pail-logger.d.ts +770 -8
- package/dist/logger/create-pail-logger.js +1 -34
- package/dist/packem_chunks/has-new-version.js +1 -259
- package/dist/packem_shared/Cerebro-Czc4t-75.js +4 -0
- package/dist/packem_shared/VERBOSITY_DEBUG-XPultrIA.js +1 -0
- package/dist/packem_shared/VisulimaError-C90oeIMu.js +76 -0
- package/dist/packem_shared/VisulimaError-DTMgXonA-CzaryRgZ.js +1 -0
- package/dist/packem_shared/cerebro-error-BjBcYVRO.js +1 -0
- package/dist/packem_shared/command.d-DbhtfXF4.d.ts +639 -0
- package/dist/packem_shared/index-DvVGK4kr.js +29 -0
- package/dist/packem_shared/index.d-BL4NtVR3.d.ts +127 -0
- package/dist/packem_shared/lazyNamed-DMUm8mZe.js +1 -0
- package/dist/packem_shared/renderError-B3ePOoBG-BmZlyMcr.js +25 -0
- package/dist/packem_shared/runtime-process-Dmz0vCJy.js +1 -0
- package/dist/packem_shared/split-by-case-Dbpgd7rf.js +1 -0
- package/dist/plugins/error-handler-plugin.d.ts +21 -19
- package/dist/plugins/error-handler-plugin.js +1 -636
- package/dist/plugins/runtime-version-check-plugin.d.ts +22 -20
- package/dist/plugins/runtime-version-check-plugin.js +1 -77
- package/dist/plugins/update-notifier/update-notifier-plugin.d.ts +28 -8
- package/dist/plugins/update-notifier/update-notifier-plugin.js +1 -517
- package/dist/util/general/compile-cache.d.ts +41 -0
- package/dist/util/general/compile-cache.js +1 -0
- package/dist/util/general/heap-tuning.d.ts +18 -0
- package/dist/util/general/heap-tuning.js +1 -0
- package/package.json +53 -48
- package/dist/cli.d.ts +0 -203
- package/dist/constants.d.ts +0 -29
- package/dist/default-env.d.ts +0 -7
- package/dist/default-options.d.ts +0 -3
- package/dist/empty-toolbox.d.ts +0 -15
- package/dist/errors/cerebro-error.d.ts +0 -10
- package/dist/errors/command-not-found-error.d.ts +0 -9
- package/dist/errors/command-validation-error.d.ts +0 -10
- package/dist/errors/completion-error.d.ts +0 -9
- package/dist/errors/conflicting-options-error.d.ts +0 -10
- package/dist/errors/plugin-error.d.ts +0 -9
- package/dist/errors/update-notifier-error.d.ts +0 -7
- package/dist/packem_shared/Cerebro-C2mnCyQf.js +0 -3313
- package/dist/packem_shared/VERBOSITY_QUIET-Dp46zlLW.js +0 -10
- package/dist/packem_shared/VisulimaError-DA7QsCxH.js +0 -34
- package/dist/packem_shared/cerebro-error-GmJ3jN7Q.js +0 -16
- package/dist/packem_shared/help-command-BY7rQUvM.js +0 -249
- package/dist/packem_shared/index-C2-8b3A4.js +0 -259
- package/dist/packem_shared/runtime-process-B6ZplyWn.js +0 -187
- package/dist/plugin-manager.d.ts +0 -53
- package/dist/plugins/update-notifier/cache.d.ts +0 -11
- package/dist/plugins/update-notifier/get-distribution-version.d.ts +0 -2
- package/dist/plugins/update-notifier/has-new-version.d.ts +0 -14
- package/dist/types/cli.d.ts +0 -102
- package/dist/types/command-line-usage.d.ts +0 -37
- package/dist/types/command.d.ts +0 -136
- package/dist/types/option-types.d.ts +0 -83
- package/dist/types/options.d.ts +0 -4
- package/dist/types/plugin.d.ts +0 -53
- package/dist/types/toolbox.d.ts +0 -96
- package/dist/util/arg-processing/get-boolean-values.d.ts +0 -7
- package/dist/util/arg-processing/get-parameter-option.d.ts +0 -7
- package/dist/util/arg-processing/map-option-type-label.d.ts +0 -3
- package/dist/util/arg-processing/option-is-boolean.d.ts +0 -9
- package/dist/util/arg-processing/remove-boolean-values.d.ts +0 -9
- package/dist/util/command-line-commands.d.ts +0 -10
- package/dist/util/command-line-usage/get-terminal-width.d.ts +0 -7
- package/dist/util/command-line-usage/index.d.ts +0 -3
- package/dist/util/command-line-usage/section/base-section.d.ts +0 -8
- package/dist/util/command-line-usage/section/content-section.d.ts +0 -65
- package/dist/util/command-line-usage/section/option-list-section.d.ts +0 -44
- package/dist/util/command-processing/command-processor.d.ts +0 -37
- package/dist/util/command-processing/command-validation.d.ts +0 -17
- package/dist/util/command-processing/nested-command-parser.d.ts +0 -25
- package/dist/util/command-processing/option-processor.d.ts +0 -44
- package/dist/util/data-processing/list-missing-arguments.d.ts +0 -15
- package/dist/util/data-processing/merge-arguments.d.ts +0 -7
- package/dist/util/general/find-alternatives.d.ts +0 -8
- package/dist/util/general/hide-bin.d.ts +0 -2
- package/dist/util/general/parse-raw-command.d.ts +0 -7
- package/dist/util/general/register-exception-handler.d.ts +0 -9
- package/dist/util/general/runtime-process.d.ts +0 -65
- package/dist/util/general/semver-gt.d.ts +0 -2
- package/dist/util/general/validate-input.d.ts +0 -24
- package/dist/util/process-env-variables.d.ts +0 -9
- package/dist/util/security.d.ts +0 -58
- package/dist/util/text-processing/template-format.d.ts +0 -5
package/dist/util/security.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Security utilities for preventing injection attacks and malicious inputs
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Sanitizes a command argument to prevent injection attacks.
|
|
6
|
-
* @param argument The argument string to sanitize.
|
|
7
|
-
* @returns The sanitized argument with whitespace trimmed.
|
|
8
|
-
* @throws {TypeError} If the argument is not a string.
|
|
9
|
-
* @throws {Error} If the argument exceeds maximum length or contains dangerous characters.
|
|
10
|
-
*/
|
|
11
|
-
export declare const sanitizeArgument: (argument: string) => string;
|
|
12
|
-
/**
|
|
13
|
-
* Sanitizes an array of arguments.
|
|
14
|
-
* @param args The array of arguments to sanitize.
|
|
15
|
-
* @returns Array of sanitized arguments.
|
|
16
|
-
* @throws {TypeError} If args is not an array or if any argument is not a string.
|
|
17
|
-
* @throws {Error} If there are too many arguments or if any argument is invalid.
|
|
18
|
-
*/
|
|
19
|
-
export declare const sanitizeArguments: (args: ReadonlyArray<string>) => string[];
|
|
20
|
-
/**
|
|
21
|
-
* Validates that a file path is safe (prevents directory traversal).
|
|
22
|
-
* @param path The file path to validate.
|
|
23
|
-
* @returns The validated path with whitespace trimmed.
|
|
24
|
-
* @throws {TypeError} If the path is not a string.
|
|
25
|
-
* @throws {Error} If the path contains traversal sequences, is absolute, or exceeds maximum length.
|
|
26
|
-
*/
|
|
27
|
-
export declare const validateSafePath: (path: string) => string;
|
|
28
|
-
/**
|
|
29
|
-
* Rate limiting helper to prevent brute force attacks
|
|
30
|
-
* Automatically cleans up expired entries to prevent memory leaks
|
|
31
|
-
*/
|
|
32
|
-
export declare class RateLimiter {
|
|
33
|
-
private attempts;
|
|
34
|
-
private readonly maxAttempts;
|
|
35
|
-
private readonly windowMs;
|
|
36
|
-
/**
|
|
37
|
-
* Creates a new RateLimiter instance.
|
|
38
|
-
* @param maxAttempts Maximum number of attempts allowed within the time window (default: 5).
|
|
39
|
-
* @param windowMs Time window in milliseconds (default: 60000).
|
|
40
|
-
*/
|
|
41
|
-
constructor(maxAttempts?: number, windowMs?: number);
|
|
42
|
-
/**
|
|
43
|
-
* Checks if the key has exceeded the rate limit.
|
|
44
|
-
* @param key Unique identifier for the rate limit check.
|
|
45
|
-
* @returns true if the request is allowed, false if rate limit exceeded.
|
|
46
|
-
*/
|
|
47
|
-
checkLimit(key: string): boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Resets the rate limit for a specific key.
|
|
50
|
-
* @param key The key to reset.
|
|
51
|
-
*/
|
|
52
|
-
reset(key: string): void;
|
|
53
|
-
/**
|
|
54
|
-
* Removes expired entries from the attempts map.
|
|
55
|
-
* @param now Current timestamp.
|
|
56
|
-
*/
|
|
57
|
-
private cleanup;
|
|
58
|
-
}
|