aliasmate 1.6.1 → 2.0.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.
- package/CHANGELOG.md +37 -0
- package/README.md +61 -876
- package/dist/cli/completion.d.ts +5 -0
- package/dist/cli/completion.d.ts.map +1 -0
- package/dist/cli/completion.js +144 -0
- package/dist/cli/completion.js.map +1 -0
- package/dist/cli/manage.d.ts +20 -0
- package/dist/cli/manage.d.ts.map +1 -0
- package/dist/cli/manage.js +213 -0
- package/dist/cli/manage.js.map +1 -0
- package/dist/cli/run.d.ts +6 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +46 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/cli/save.d.ts +9 -0
- package/dist/cli/save.d.ts.map +1 -0
- package/dist/cli/save.js +52 -0
- package/dist/cli/save.js.map +1 -0
- package/dist/cli/transfer.d.ts +5 -0
- package/dist/cli/transfer.d.ts.map +1 -0
- package/dist/cli/transfer.js +118 -0
- package/dist/cli/transfer.js.map +1 -0
- package/dist/core/commands.d.ts +27 -0
- package/dist/core/commands.d.ts.map +1 -0
- package/dist/core/commands.js +194 -0
- package/dist/core/commands.js.map +1 -0
- package/dist/core/env.d.ts +9 -0
- package/dist/core/env.d.ts.map +1 -0
- package/dist/core/env.js +45 -0
- package/dist/core/env.js.map +1 -0
- package/dist/core/executor.d.ts +7 -0
- package/dist/core/executor.d.ts.map +1 -0
- package/dist/{utils → core}/executor.js +10 -46
- package/dist/core/executor.js.map +1 -0
- package/dist/core/history.d.ts +11 -0
- package/dist/core/history.d.ts.map +1 -0
- package/dist/core/history.js +117 -0
- package/dist/core/history.js.map +1 -0
- package/dist/core/recent.d.ts +14 -0
- package/dist/core/recent.d.ts.map +1 -0
- package/dist/core/recent.js +54 -0
- package/dist/core/recent.js.map +1 -0
- package/dist/core/runner.d.ts +13 -0
- package/dist/core/runner.d.ts.map +1 -0
- package/dist/core/runner.js +83 -0
- package/dist/core/runner.js.map +1 -0
- package/dist/core/store.d.ts +29 -0
- package/dist/core/store.d.ts.map +1 -0
- package/dist/core/store.js +131 -0
- package/dist/core/store.js.map +1 -0
- package/dist/core/types.d.ts +29 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +3 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/validate.d.ts +6 -0
- package/dist/core/validate.d.ts.map +1 -0
- package/dist/core/validate.js +139 -0
- package/dist/core/validate.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +169 -0
- package/dist/index.js.map +1 -0
- package/dist/ui/format.d.ts +16 -0
- package/dist/ui/format.d.ts.map +1 -0
- package/dist/ui/format.js +112 -0
- package/dist/ui/format.js.map +1 -0
- package/dist/ui/interactive.d.ts +6 -0
- package/dist/ui/interactive.d.ts.map +1 -0
- package/dist/ui/interactive.js +147 -0
- package/dist/ui/interactive.js.map +1 -0
- package/dist/ui/onboarding.d.ts +3 -0
- package/dist/ui/onboarding.d.ts.map +1 -0
- package/dist/ui/onboarding.js +82 -0
- package/dist/ui/onboarding.js.map +1 -0
- package/dist/ui/prompts.d.ts +14 -0
- package/dist/ui/prompts.d.ts.map +1 -0
- package/dist/ui/prompts.js +96 -0
- package/dist/ui/prompts.js.map +1 -0
- package/dist/ui/theme.d.ts +28 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/dist/ui/theme.js +43 -0
- package/dist/ui/theme.js.map +1 -0
- package/package.json +4 -5
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -252
- package/dist/cli.js.map +0 -1
- package/dist/commands/alias.d.ts +0 -30
- package/dist/commands/alias.d.ts.map +0 -1
- package/dist/commands/alias.js +0 -213
- package/dist/commands/alias.js.map +0 -1
- package/dist/commands/changelog.d.ts +0 -9
- package/dist/commands/changelog.d.ts.map +0 -1
- package/dist/commands/changelog.js +0 -72
- package/dist/commands/changelog.js.map +0 -1
- package/dist/commands/completion.d.ts +0 -17
- package/dist/commands/completion.d.ts.map +0 -1
- package/dist/commands/completion.js +0 -363
- package/dist/commands/completion.js.map +0 -1
- package/dist/commands/delete.d.ts +0 -14
- package/dist/commands/delete.d.ts.map +0 -1
- package/dist/commands/delete.js +0 -54
- package/dist/commands/delete.js.map +0 -1
- package/dist/commands/edit.d.ts +0 -16
- package/dist/commands/edit.d.ts.map +0 -1
- package/dist/commands/edit.js +0 -231
- package/dist/commands/edit.js.map +0 -1
- package/dist/commands/export.d.ts +0 -23
- package/dist/commands/export.d.ts.map +0 -1
- package/dist/commands/export.js +0 -122
- package/dist/commands/export.js.map +0 -1
- package/dist/commands/import.d.ts +0 -23
- package/dist/commands/import.d.ts.map +0 -1
- package/dist/commands/import.js +0 -235
- package/dist/commands/import.js.map +0 -1
- package/dist/commands/list.d.ts +0 -25
- package/dist/commands/list.d.ts.map +0 -1
- package/dist/commands/list.js +0 -58
- package/dist/commands/list.js.map +0 -1
- package/dist/commands/prev.d.ts +0 -15
- package/dist/commands/prev.d.ts.map +0 -1
- package/dist/commands/prev.js +0 -138
- package/dist/commands/prev.js.map +0 -1
- package/dist/commands/recent.d.ts +0 -24
- package/dist/commands/recent.d.ts.map +0 -1
- package/dist/commands/recent.js +0 -132
- package/dist/commands/recent.js.map +0 -1
- package/dist/commands/run.d.ts +0 -22
- package/dist/commands/run.d.ts.map +0 -1
- package/dist/commands/run.js +0 -217
- package/dist/commands/run.js.map +0 -1
- package/dist/commands/save.d.ts +0 -17
- package/dist/commands/save.d.ts.map +0 -1
- package/dist/commands/save.js +0 -232
- package/dist/commands/save.js.map +0 -1
- package/dist/commands/search.d.ts +0 -19
- package/dist/commands/search.d.ts.map +0 -1
- package/dist/commands/search.js +0 -113
- package/dist/commands/search.js.map +0 -1
- package/dist/commands/validate.d.ts +0 -10
- package/dist/commands/validate.d.ts.map +0 -1
- package/dist/commands/validate.js +0 -162
- package/dist/commands/validate.js.map +0 -1
- package/dist/storage/index.d.ts +0 -117
- package/dist/storage/index.d.ts.map +0 -1
- package/dist/storage/index.js +0 -262
- package/dist/storage/index.js.map +0 -1
- package/dist/utils/changelog.d.ts +0 -41
- package/dist/utils/changelog.d.ts.map +0 -1
- package/dist/utils/changelog.js +0 -192
- package/dist/utils/changelog.js.map +0 -1
- package/dist/utils/constants.d.ts +0 -48
- package/dist/utils/constants.d.ts.map +0 -1
- package/dist/utils/constants.js +0 -51
- package/dist/utils/constants.js.map +0 -1
- package/dist/utils/env.d.ts +0 -64
- package/dist/utils/env.d.ts.map +0 -1
- package/dist/utils/env.js +0 -199
- package/dist/utils/env.js.map +0 -1
- package/dist/utils/errors.d.ts +0 -30
- package/dist/utils/errors.d.ts.map +0 -1
- package/dist/utils/errors.js +0 -62
- package/dist/utils/errors.js.map +0 -1
- package/dist/utils/executor.d.ts +0 -33
- package/dist/utils/executor.d.ts.map +0 -1
- package/dist/utils/executor.js.map +0 -1
- package/dist/utils/formatters.d.ts +0 -30
- package/dist/utils/formatters.d.ts.map +0 -1
- package/dist/utils/formatters.js +0 -188
- package/dist/utils/formatters.js.map +0 -1
- package/dist/utils/history.d.ts +0 -37
- package/dist/utils/history.d.ts.map +0 -1
- package/dist/utils/history.js +0 -179
- package/dist/utils/history.js.map +0 -1
- package/dist/utils/llm-generator.d.ts +0 -21
- package/dist/utils/llm-generator.d.ts.map +0 -1
- package/dist/utils/llm-generator.js +0 -915
- package/dist/utils/llm-generator.js.map +0 -1
- package/dist/utils/onboarding.d.ts +0 -10
- package/dist/utils/onboarding.d.ts.map +0 -1
- package/dist/utils/onboarding.js +0 -316
- package/dist/utils/onboarding.js.map +0 -1
- package/dist/utils/paths.d.ts +0 -44
- package/dist/utils/paths.d.ts.map +0 -1
- package/dist/utils/paths.js +0 -115
- package/dist/utils/paths.js.map +0 -1
- package/dist/utils/prompts.d.ts +0 -66
- package/dist/utils/prompts.d.ts.map +0 -1
- package/dist/utils/prompts.js +0 -51
- package/dist/utils/prompts.js.map +0 -1
- package/dist/utils/recent.d.ts +0 -55
- package/dist/utils/recent.d.ts.map +0 -1
- package/dist/utils/recent.js +0 -102
- package/dist/utils/recent.js.map +0 -1
- package/dist/utils/validator.d.ts +0 -56
- package/dist/utils/validator.d.ts.map +0 -1
- package/dist/utils/validator.js +0 -413
- package/dist/utils/validator.js.map +0 -1
- package/dist/utils/version-checker.d.ts +0 -29
- package/dist/utils/version-checker.d.ts.map +0 -1
- package/dist/utils/version-checker.js +0 -191
- package/dist/utils/version-checker.js.map +0 -1
- package/whats-new.json +0 -202
package/dist/utils/recent.d.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Execution history entry
|
|
3
|
-
*/
|
|
4
|
-
export interface ExecutionEntry {
|
|
5
|
-
/** Name of the command that was executed */
|
|
6
|
-
commandName: string;
|
|
7
|
-
/** ISO 8601 timestamp when the command was executed */
|
|
8
|
-
executedAt: string;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Configuration for execution history
|
|
12
|
-
*/
|
|
13
|
-
export interface RecentConfig {
|
|
14
|
-
/** Maximum number of entries to keep in history */
|
|
15
|
-
maxSize: number;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Get the recent commands configuration
|
|
19
|
-
*/
|
|
20
|
-
export declare function getRecentConfig(): RecentConfig;
|
|
21
|
-
/**
|
|
22
|
-
* Set the recent commands configuration
|
|
23
|
-
*/
|
|
24
|
-
export declare function setRecentConfig(config: RecentConfig): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Get execution history
|
|
27
|
-
*/
|
|
28
|
-
export declare function getExecutionHistory(): ExecutionEntry[];
|
|
29
|
-
/**
|
|
30
|
-
* Record a command execution
|
|
31
|
-
* @param commandName - The name of the command that was executed
|
|
32
|
-
*/
|
|
33
|
-
export declare function recordExecution(commandName: string): void;
|
|
34
|
-
/**
|
|
35
|
-
* Get recent command names (most recent first, deduplicated)
|
|
36
|
-
* @param limit - Maximum number of entries to return
|
|
37
|
-
* @returns Array of unique command names in order of most recent execution
|
|
38
|
-
*/
|
|
39
|
-
export declare function getRecentCommands(limit?: number): string[];
|
|
40
|
-
/**
|
|
41
|
-
* Get the Nth most recent command (0-indexed)
|
|
42
|
-
* @param index - Index of the command (0 = most recent)
|
|
43
|
-
* @returns Command name if found, undefined otherwise
|
|
44
|
-
*/
|
|
45
|
-
export declare function getRecentCommandByIndex(index: number): string | undefined;
|
|
46
|
-
/**
|
|
47
|
-
* Clear execution history
|
|
48
|
-
*/
|
|
49
|
-
export declare function clearExecutionHistory(): boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Get full execution history with timestamps
|
|
52
|
-
* @param limit - Maximum number of entries to return
|
|
53
|
-
*/
|
|
54
|
-
export declare function getRecentCommandsWithTimestamps(limit?: number): ExecutionEntry[];
|
|
55
|
-
//# sourceMappingURL=recent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"recent.d.ts","sourceRoot":"","sources":["../../src/utils/recent.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;CACjB;AAMD;;GAEG;AACH,wBAAgB,eAAe,IAAI,YAAY,CAG9C;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAE7D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,cAAc,EAAE,CAGtD;AASD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAgBzD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAiB1D;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGzE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,cAAc,EAAE,CAGhF"}
|
package/dist/utils/recent.js
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRecentConfig = getRecentConfig;
|
|
4
|
-
exports.setRecentConfig = setRecentConfig;
|
|
5
|
-
exports.getExecutionHistory = getExecutionHistory;
|
|
6
|
-
exports.recordExecution = recordExecution;
|
|
7
|
-
exports.getRecentCommands = getRecentCommands;
|
|
8
|
-
exports.getRecentCommandByIndex = getRecentCommandByIndex;
|
|
9
|
-
exports.clearExecutionHistory = clearExecutionHistory;
|
|
10
|
-
exports.getRecentCommandsWithTimestamps = getRecentCommandsWithTimestamps;
|
|
11
|
-
const storage_1 = require("../storage");
|
|
12
|
-
const RECENT_HISTORY_KEY = 'execution_history';
|
|
13
|
-
const RECENT_CONFIG_KEY = 'recent_config';
|
|
14
|
-
const DEFAULT_MAX_SIZE = 50;
|
|
15
|
-
/**
|
|
16
|
-
* Get the recent commands configuration
|
|
17
|
-
*/
|
|
18
|
-
function getRecentConfig() {
|
|
19
|
-
const config = (0, storage_1.getMetadata)(RECENT_CONFIG_KEY);
|
|
20
|
-
return config || { maxSize: DEFAULT_MAX_SIZE };
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Set the recent commands configuration
|
|
24
|
-
*/
|
|
25
|
-
function setRecentConfig(config) {
|
|
26
|
-
return (0, storage_1.setMetadata)(RECENT_CONFIG_KEY, config);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Get execution history
|
|
30
|
-
*/
|
|
31
|
-
function getExecutionHistory() {
|
|
32
|
-
const history = (0, storage_1.getMetadata)(RECENT_HISTORY_KEY);
|
|
33
|
-
return history || [];
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Save execution history
|
|
37
|
-
*/
|
|
38
|
-
function saveExecutionHistory(history) {
|
|
39
|
-
return (0, storage_1.setMetadata)(RECENT_HISTORY_KEY, history);
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Record a command execution
|
|
43
|
-
* @param commandName - The name of the command that was executed
|
|
44
|
-
*/
|
|
45
|
-
function recordExecution(commandName) {
|
|
46
|
-
const history = getExecutionHistory();
|
|
47
|
-
const config = getRecentConfig();
|
|
48
|
-
// Add new entry to the beginning
|
|
49
|
-
history.unshift({
|
|
50
|
-
commandName,
|
|
51
|
-
executedAt: new Date().toISOString(),
|
|
52
|
-
});
|
|
53
|
-
// Trim to max size
|
|
54
|
-
if (history.length > config.maxSize) {
|
|
55
|
-
history.splice(config.maxSize);
|
|
56
|
-
}
|
|
57
|
-
saveExecutionHistory(history);
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Get recent command names (most recent first, deduplicated)
|
|
61
|
-
* @param limit - Maximum number of entries to return
|
|
62
|
-
* @returns Array of unique command names in order of most recent execution
|
|
63
|
-
*/
|
|
64
|
-
function getRecentCommands(limit) {
|
|
65
|
-
const history = getExecutionHistory();
|
|
66
|
-
const seen = new Set();
|
|
67
|
-
const result = [];
|
|
68
|
-
for (const entry of history) {
|
|
69
|
-
if (!seen.has(entry.commandName)) {
|
|
70
|
-
seen.add(entry.commandName);
|
|
71
|
-
result.push(entry.commandName);
|
|
72
|
-
if (limit && result.length >= limit) {
|
|
73
|
-
break;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
return result;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Get the Nth most recent command (0-indexed)
|
|
81
|
-
* @param index - Index of the command (0 = most recent)
|
|
82
|
-
* @returns Command name if found, undefined otherwise
|
|
83
|
-
*/
|
|
84
|
-
function getRecentCommandByIndex(index) {
|
|
85
|
-
const recentCommands = getRecentCommands();
|
|
86
|
-
return recentCommands[index];
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Clear execution history
|
|
90
|
-
*/
|
|
91
|
-
function clearExecutionHistory() {
|
|
92
|
-
return saveExecutionHistory([]);
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Get full execution history with timestamps
|
|
96
|
-
* @param limit - Maximum number of entries to return
|
|
97
|
-
*/
|
|
98
|
-
function getRecentCommandsWithTimestamps(limit) {
|
|
99
|
-
const history = getExecutionHistory();
|
|
100
|
-
return limit ? history.slice(0, limit) : history;
|
|
101
|
-
}
|
|
102
|
-
//# sourceMappingURL=recent.js.map
|
package/dist/utils/recent.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"recent.js","sourceRoot":"","sources":["../../src/utils/recent.ts"],"names":[],"mappings":";;AA2BA,0CAGC;AAKD,0CAEC;AAKD,kDAGC;AAaD,0CAgBC;AAOD,8CAiBC;AAOD,0DAGC;AAKD,sDAEC;AAMD,0EAGC;AA5HD,wCAAsD;AAoBtD,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAC/C,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAC1C,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAE5B;;GAEG;AACH,SAAgB,eAAe;IAC7B,MAAM,MAAM,GAAG,IAAA,qBAAW,EAAe,iBAAiB,CAAC,CAAC;IAC5D,OAAO,MAAM,IAAI,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;AACjD,CAAC;AAED;;GAEG;AACH,SAAgB,eAAe,CAAC,MAAoB;IAClD,OAAO,IAAA,qBAAW,EAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;AAChD,CAAC;AAED;;GAEG;AACH,SAAgB,mBAAmB;IACjC,MAAM,OAAO,GAAG,IAAA,qBAAW,EAAmB,kBAAkB,CAAC,CA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gB,uBAAuB,CAAC,KAAa;IACnD,MAAM,cAAc,GAAG,iBAAiB,EAAE,CAAC;IAC3C,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,SAAgB,qBAAqB;IACnC,OAAO,oBAAoB,CAAC,EAAE,CAAC,CAAC;AAClC,CAAC;AAED;;;GAGG;AACH,SAAgB,+BAA+B,CAAC,KAAc;IAC5D,MAAM,OAAO,GAAG,mBAAmB,EAAE,CAAC;IACtC,OAAO,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AACnD,CAAC"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Validation result for a single check
|
|
3
|
-
*/
|
|
4
|
-
export interface ValidationResult {
|
|
5
|
-
valid: boolean;
|
|
6
|
-
message?: string;
|
|
7
|
-
warning?: boolean;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Validation issue details
|
|
11
|
-
*/
|
|
12
|
-
export interface ValidationIssue {
|
|
13
|
-
type: 'error' | 'warning';
|
|
14
|
-
field: string;
|
|
15
|
-
message: string;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Full validation report
|
|
19
|
-
*/
|
|
20
|
-
export interface ValidationReport {
|
|
21
|
-
valid: boolean;
|
|
22
|
-
issues: ValidationIssue[];
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Check if a command exists in PATH
|
|
26
|
-
* @param command - The command string (e.g., "npm run build")
|
|
27
|
-
* @returns Validation result
|
|
28
|
-
*/
|
|
29
|
-
export declare function validateCommandExists(command: string): ValidationResult;
|
|
30
|
-
/**
|
|
31
|
-
* Validate directory exists and is accessible
|
|
32
|
-
* @param directory - The directory path
|
|
33
|
-
* @returns Validation result
|
|
34
|
-
*/
|
|
35
|
-
export declare function validateDirectory(directory: string): ValidationResult;
|
|
36
|
-
/**
|
|
37
|
-
* Basic shell syntax validation
|
|
38
|
-
* @param command - The command string
|
|
39
|
-
* @returns Validation result
|
|
40
|
-
*/
|
|
41
|
-
export declare function validateShellSyntax(command: string): ValidationResult;
|
|
42
|
-
/**
|
|
43
|
-
* Validate environment variable names
|
|
44
|
-
* @param envVars - Object containing environment variables
|
|
45
|
-
* @returns Validation result
|
|
46
|
-
*/
|
|
47
|
-
export declare function validateEnvVars(envVars: Record<string, string>): ValidationResult;
|
|
48
|
-
/**
|
|
49
|
-
* Validate a command alias comprehensively
|
|
50
|
-
* @param command - The command string
|
|
51
|
-
* @param directory - The working directory
|
|
52
|
-
* @param envVars - Optional environment variables
|
|
53
|
-
* @returns Full validation report
|
|
54
|
-
*/
|
|
55
|
-
export declare function validateCommandAlias(command: string, directory: string, envVars?: Record<string, string>): ValidationReport;
|
|
56
|
-
//# sourceMappingURL=validator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../src/utils/validator.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,eAAe,EAAE,CAAC;CAC3B;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAgGvE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CA+CrE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAsHrE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,gBAAgB,CAuBjF;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,gBAAgB,CAsElB"}
|
package/dist/utils/validator.js
DELETED
|
@@ -1,413 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.validateCommandExists = validateCommandExists;
|
|
37
|
-
exports.validateDirectory = validateDirectory;
|
|
38
|
-
exports.validateShellSyntax = validateShellSyntax;
|
|
39
|
-
exports.validateEnvVars = validateEnvVars;
|
|
40
|
-
exports.validateCommandAlias = validateCommandAlias;
|
|
41
|
-
const fs = __importStar(require("fs"));
|
|
42
|
-
const path = __importStar(require("path"));
|
|
43
|
-
const child_process_1 = require("child_process");
|
|
44
|
-
/**
|
|
45
|
-
* Check if a command exists in PATH
|
|
46
|
-
* @param command - The command string (e.g., "npm run build")
|
|
47
|
-
* @returns Validation result
|
|
48
|
-
*/
|
|
49
|
-
function validateCommandExists(command) {
|
|
50
|
-
if (!command || !command.trim()) {
|
|
51
|
-
return {
|
|
52
|
-
valid: false,
|
|
53
|
-
message: 'Command cannot be empty',
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
// Extract the first word (the actual command)
|
|
57
|
-
const trimmed = command.trim();
|
|
58
|
-
const firstWord = trimmed.split(/\s+/)[0];
|
|
59
|
-
// Skip validation for shell built-ins and special characters
|
|
60
|
-
const shellBuiltins = [
|
|
61
|
-
'cd',
|
|
62
|
-
'echo',
|
|
63
|
-
'export',
|
|
64
|
-
'source',
|
|
65
|
-
'.',
|
|
66
|
-
'eval',
|
|
67
|
-
'exec',
|
|
68
|
-
'set',
|
|
69
|
-
'unset',
|
|
70
|
-
'alias',
|
|
71
|
-
'bg',
|
|
72
|
-
'fg',
|
|
73
|
-
'jobs',
|
|
74
|
-
'kill',
|
|
75
|
-
'pwd',
|
|
76
|
-
'test',
|
|
77
|
-
'[',
|
|
78
|
-
'exit',
|
|
79
|
-
'return',
|
|
80
|
-
];
|
|
81
|
-
// Check if it starts with special characters (shell operators, pipes, etc.)
|
|
82
|
-
if (/^[|&;<>()]/.test(firstWord)) {
|
|
83
|
-
return {
|
|
84
|
-
valid: true,
|
|
85
|
-
warning: true,
|
|
86
|
-
message: 'Command starts with shell operator - validation skipped',
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
// Check if it's a shell builtin
|
|
90
|
-
if (shellBuiltins.includes(firstWord)) {
|
|
91
|
-
return { valid: true };
|
|
92
|
-
}
|
|
93
|
-
// Check if it's a path (contains /)
|
|
94
|
-
if (firstWord.includes('/')) {
|
|
95
|
-
// It's a path - check if the file exists and is executable
|
|
96
|
-
try {
|
|
97
|
-
const stats = fs.statSync(firstWord);
|
|
98
|
-
if (!stats.isFile()) {
|
|
99
|
-
return {
|
|
100
|
-
valid: false,
|
|
101
|
-
message: `Path "${firstWord}" exists but is not a file`,
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
// Check if executable (on Unix-like systems)
|
|
105
|
-
if (process.platform !== 'win32') {
|
|
106
|
-
try {
|
|
107
|
-
fs.accessSync(firstWord, fs.constants.X_OK);
|
|
108
|
-
}
|
|
109
|
-
catch {
|
|
110
|
-
return {
|
|
111
|
-
valid: true,
|
|
112
|
-
warning: true,
|
|
113
|
-
message: `File "${firstWord}" exists but may not be executable`,
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
return { valid: true };
|
|
118
|
-
}
|
|
119
|
-
catch {
|
|
120
|
-
return {
|
|
121
|
-
valid: false,
|
|
122
|
-
message: `Command file "${firstWord}" not found`,
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
// Check if the command exists in PATH
|
|
127
|
-
try {
|
|
128
|
-
if (process.platform === 'win32') {
|
|
129
|
-
(0, child_process_1.execSync)(`where ${firstWord}`, { stdio: 'ignore' });
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
(0, child_process_1.execSync)(`which ${firstWord}`, { stdio: 'ignore' });
|
|
133
|
-
}
|
|
134
|
-
return { valid: true };
|
|
135
|
-
}
|
|
136
|
-
catch {
|
|
137
|
-
return {
|
|
138
|
-
valid: true,
|
|
139
|
-
warning: true,
|
|
140
|
-
message: `Command "${firstWord}" not found in PATH - it may not be installed`,
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Validate directory exists and is accessible
|
|
146
|
-
* @param directory - The directory path
|
|
147
|
-
* @returns Validation result
|
|
148
|
-
*/
|
|
149
|
-
function validateDirectory(directory) {
|
|
150
|
-
if (!directory || !directory.trim()) {
|
|
151
|
-
return {
|
|
152
|
-
valid: false,
|
|
153
|
-
message: 'Directory cannot be empty',
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
const resolvedPath = path.resolve(directory);
|
|
157
|
-
// Check if directory exists
|
|
158
|
-
try {
|
|
159
|
-
const stats = fs.statSync(resolvedPath);
|
|
160
|
-
if (!stats.isDirectory()) {
|
|
161
|
-
return {
|
|
162
|
-
valid: false,
|
|
163
|
-
message: `Path "${directory}" exists but is not a directory`,
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
catch {
|
|
168
|
-
return {
|
|
169
|
-
valid: false,
|
|
170
|
-
message: `Directory "${directory}" does not exist`,
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
// Check read/write permissions
|
|
174
|
-
try {
|
|
175
|
-
fs.accessSync(resolvedPath, fs.constants.R_OK);
|
|
176
|
-
}
|
|
177
|
-
catch {
|
|
178
|
-
return {
|
|
179
|
-
valid: false,
|
|
180
|
-
message: `Directory "${directory}" is not readable`,
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
try {
|
|
184
|
-
fs.accessSync(resolvedPath, fs.constants.W_OK);
|
|
185
|
-
}
|
|
186
|
-
catch {
|
|
187
|
-
return {
|
|
188
|
-
valid: true,
|
|
189
|
-
warning: true,
|
|
190
|
-
message: `Directory "${directory}" is not writable`,
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
return { valid: true };
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Basic shell syntax validation
|
|
197
|
-
* @param command - The command string
|
|
198
|
-
* @returns Validation result
|
|
199
|
-
*/
|
|
200
|
-
function validateShellSyntax(command) {
|
|
201
|
-
if (!command || !command.trim()) {
|
|
202
|
-
return {
|
|
203
|
-
valid: false,
|
|
204
|
-
message: 'Command cannot be empty',
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
const trimmed = command.trim();
|
|
208
|
-
// Skip complex validation for commands with heredocs (they have their own syntax rules)
|
|
209
|
-
const hasHeredoc = /<<\s*['"]?[A-Z_]+['"]?/.test(trimmed);
|
|
210
|
-
if (hasHeredoc) {
|
|
211
|
-
// For heredocs, just do basic validation
|
|
212
|
-
return { valid: true };
|
|
213
|
-
}
|
|
214
|
-
// Check for unclosed quotes
|
|
215
|
-
const singleQuotes = (trimmed.match(/'/g) || []).length;
|
|
216
|
-
const doubleQuotes = (trimmed.match(/"/g) || []).length;
|
|
217
|
-
const backticks = (trimmed.match(/`/g) || []).length;
|
|
218
|
-
if (singleQuotes % 2 !== 0) {
|
|
219
|
-
return {
|
|
220
|
-
valid: false,
|
|
221
|
-
message: 'Unclosed single quote in command',
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
if (doubleQuotes % 2 !== 0) {
|
|
225
|
-
return {
|
|
226
|
-
valid: false,
|
|
227
|
-
message: 'Unclosed double quote in command',
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
if (backticks % 2 !== 0) {
|
|
231
|
-
return {
|
|
232
|
-
valid: false,
|
|
233
|
-
message: 'Unclosed backtick in command',
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
// Check for unmatched parentheses
|
|
237
|
-
let parenDepth = 0;
|
|
238
|
-
for (const char of trimmed) {
|
|
239
|
-
if (char === '(')
|
|
240
|
-
parenDepth++;
|
|
241
|
-
if (char === ')')
|
|
242
|
-
parenDepth--;
|
|
243
|
-
if (parenDepth < 0) {
|
|
244
|
-
return {
|
|
245
|
-
valid: false,
|
|
246
|
-
message: 'Unmatched closing parenthesis in command',
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
if (parenDepth !== 0) {
|
|
251
|
-
return {
|
|
252
|
-
valid: false,
|
|
253
|
-
message: 'Unmatched opening parenthesis in command',
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
// Check for unmatched braces
|
|
257
|
-
let braceDepth = 0;
|
|
258
|
-
for (const char of trimmed) {
|
|
259
|
-
if (char === '{')
|
|
260
|
-
braceDepth++;
|
|
261
|
-
if (char === '}')
|
|
262
|
-
braceDepth--;
|
|
263
|
-
if (braceDepth < 0) {
|
|
264
|
-
return {
|
|
265
|
-
valid: false,
|
|
266
|
-
message: 'Unmatched closing brace in command',
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
if (braceDepth !== 0) {
|
|
271
|
-
return {
|
|
272
|
-
valid: false,
|
|
273
|
-
message: 'Unmatched opening brace in command',
|
|
274
|
-
};
|
|
275
|
-
}
|
|
276
|
-
// Check for unmatched brackets
|
|
277
|
-
let bracketDepth = 0;
|
|
278
|
-
for (const char of trimmed) {
|
|
279
|
-
if (char === '[')
|
|
280
|
-
bracketDepth++;
|
|
281
|
-
if (char === ']')
|
|
282
|
-
bracketDepth--;
|
|
283
|
-
if (bracketDepth < 0) {
|
|
284
|
-
return {
|
|
285
|
-
valid: false,
|
|
286
|
-
message: 'Unmatched closing bracket in command',
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
if (bracketDepth !== 0) {
|
|
291
|
-
return {
|
|
292
|
-
valid: false,
|
|
293
|
-
message: 'Unmatched opening bracket in command',
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
// Check for invalid pipe sequences
|
|
297
|
-
if (/\|\s*\|/.test(trimmed) && !/\|\|/.test(trimmed)) {
|
|
298
|
-
return {
|
|
299
|
-
valid: true,
|
|
300
|
-
warning: true,
|
|
301
|
-
message: 'Suspicious pipe sequence detected',
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
// Check for trailing operators that need continuation
|
|
305
|
-
if (/[|&]$/.test(trimmed)) {
|
|
306
|
-
return {
|
|
307
|
-
valid: false,
|
|
308
|
-
message: 'Command ends with pipe or ampersand operator',
|
|
309
|
-
};
|
|
310
|
-
}
|
|
311
|
-
return { valid: true };
|
|
312
|
-
}
|
|
313
|
-
/**
|
|
314
|
-
* Validate environment variable names
|
|
315
|
-
* @param envVars - Object containing environment variables
|
|
316
|
-
* @returns Validation result
|
|
317
|
-
*/
|
|
318
|
-
function validateEnvVars(envVars) {
|
|
319
|
-
if (!envVars || Object.keys(envVars).length === 0) {
|
|
320
|
-
return { valid: true };
|
|
321
|
-
}
|
|
322
|
-
const invalidVars = [];
|
|
323
|
-
for (const key of Object.keys(envVars)) {
|
|
324
|
-
// Check if variable name is valid
|
|
325
|
-
// Valid env var names: start with letter or underscore, contain only alphanumeric and underscore
|
|
326
|
-
if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(key)) {
|
|
327
|
-
invalidVars.push(key);
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
if (invalidVars.length > 0) {
|
|
331
|
-
return {
|
|
332
|
-
valid: false,
|
|
333
|
-
message: `Invalid environment variable names: ${invalidVars.join(', ')}`,
|
|
334
|
-
};
|
|
335
|
-
}
|
|
336
|
-
return { valid: true };
|
|
337
|
-
}
|
|
338
|
-
/**
|
|
339
|
-
* Validate a command alias comprehensively
|
|
340
|
-
* @param command - The command string
|
|
341
|
-
* @param directory - The working directory
|
|
342
|
-
* @param envVars - Optional environment variables
|
|
343
|
-
* @returns Full validation report
|
|
344
|
-
*/
|
|
345
|
-
function validateCommandAlias(command, directory, envVars) {
|
|
346
|
-
const issues = [];
|
|
347
|
-
// Validate command syntax
|
|
348
|
-
const syntaxResult = validateShellSyntax(command);
|
|
349
|
-
if (!syntaxResult.valid) {
|
|
350
|
-
issues.push({
|
|
351
|
-
type: 'error',
|
|
352
|
-
field: 'command',
|
|
353
|
-
message: syntaxResult.message || 'Invalid shell syntax',
|
|
354
|
-
});
|
|
355
|
-
}
|
|
356
|
-
else if (syntaxResult.warning && syntaxResult.message) {
|
|
357
|
-
issues.push({
|
|
358
|
-
type: 'warning',
|
|
359
|
-
field: 'command',
|
|
360
|
-
message: syntaxResult.message,
|
|
361
|
-
});
|
|
362
|
-
}
|
|
363
|
-
// Validate command exists
|
|
364
|
-
const commandExistsResult = validateCommandExists(command);
|
|
365
|
-
if (!commandExistsResult.valid) {
|
|
366
|
-
issues.push({
|
|
367
|
-
type: 'error',
|
|
368
|
-
field: 'command',
|
|
369
|
-
message: commandExistsResult.message || 'Command validation failed',
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
else if (commandExistsResult.warning && commandExistsResult.message) {
|
|
373
|
-
issues.push({
|
|
374
|
-
type: 'warning',
|
|
375
|
-
field: 'command',
|
|
376
|
-
message: commandExistsResult.message,
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
// Validate directory
|
|
380
|
-
const directoryResult = validateDirectory(directory);
|
|
381
|
-
if (!directoryResult.valid) {
|
|
382
|
-
issues.push({
|
|
383
|
-
type: 'error',
|
|
384
|
-
field: 'directory',
|
|
385
|
-
message: directoryResult.message || 'Directory validation failed',
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
else if (directoryResult.warning && directoryResult.message) {
|
|
389
|
-
issues.push({
|
|
390
|
-
type: 'warning',
|
|
391
|
-
field: 'directory',
|
|
392
|
-
message: directoryResult.message,
|
|
393
|
-
});
|
|
394
|
-
}
|
|
395
|
-
// Validate environment variables
|
|
396
|
-
if (envVars) {
|
|
397
|
-
const envResult = validateEnvVars(envVars);
|
|
398
|
-
if (!envResult.valid) {
|
|
399
|
-
issues.push({
|
|
400
|
-
type: 'error',
|
|
401
|
-
field: 'environment',
|
|
402
|
-
message: envResult.message || 'Environment variable validation failed',
|
|
403
|
-
});
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
// Determine if overall validation passed
|
|
407
|
-
const valid = !issues.some((issue) => issue.type === 'error');
|
|
408
|
-
return {
|
|
409
|
-
valid,
|
|
410
|
-
issues,
|
|
411
|
-
};
|
|
412
|
-
}
|
|
413
|
-
//# sourceMappingURL=validator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../../src/utils/validator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,sDAgGC;AAOD,8CA+CC;AAOD,kDAsHC;AAOD,0CAuBC;AASD,oDA0EC;AAvaD,uCAAyB;AACzB,2CAA6B;AAC7B,iDAAyC;AA4BzC;;;;GAIG;AACH,SAAgB,qBAAqB,CAAC,OAAe;IACnD,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;QAChC,OAAO;YACL,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE,yBAAyB;SACnC,CAAC;IACJ,CAAC;IAED,8CAA8C;IAC9C,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAC/B,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAE1C,6DAA6D;IAC7D,MAAM,aAAa,GAAG;QACpB,IAAI;QACJ,MAAM;QACN,QAAQ;QACR,QAAQ;QACR,GAAG;QACH,MAAM;QACN,MAAM;QACN,KAAK;QACL,OAAO;QACP,OAAO;QACP,IAAI;QACJ,IAAI;QACJ,MAAM;QACN,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aACvE,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,yCAAyC;IACzC,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;IAE9D,OAAO;QACL,KAAK;QACL,MAAM;KACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Metadata interface for version check tracking
|
|
3
|
-
*/
|
|
4
|
-
export interface VersionCheckMetadata {
|
|
5
|
-
lastCheckDate?: string;
|
|
6
|
-
lastSeenVersion?: string;
|
|
7
|
-
dismissedForToday?: boolean;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Compare two semantic version strings
|
|
11
|
-
* @param current - Current version (e.g., "1.4.0")
|
|
12
|
-
* @param latest - Latest version (e.g., "1.5.0")
|
|
13
|
-
* @returns true if latest is greater than current
|
|
14
|
-
*/
|
|
15
|
-
export declare function isNewerVersion(current: string, latest: string): boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Fetch the latest version from npm registry
|
|
18
|
-
* @returns Promise that resolves to the latest version string or null on error
|
|
19
|
-
*/
|
|
20
|
-
export declare function fetchLatestVersion(): Promise<string | null>;
|
|
21
|
-
/**
|
|
22
|
-
* Check for updates and notify the user if a new version is available
|
|
23
|
-
* This function:
|
|
24
|
-
* - Only runs once per day
|
|
25
|
-
* - Silently fails if offline or on error
|
|
26
|
-
* - Updates metadata after checking
|
|
27
|
-
*/
|
|
28
|
-
export declare function checkForUpdates(): Promise<void>;
|
|
29
|
-
//# sourceMappingURL=version-checker.d.ts.map
|