@notask/unity-cli-tools 1.2.0-rc.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.
Files changed (64) hide show
  1. package/.claude/settings.local.json +7 -0
  2. package/CHANGELOG.md +164 -164
  3. package/LICENSE +23 -23
  4. package/README.md +809 -347
  5. package/dist/cjs/errors/Result.js +76 -0
  6. package/dist/cjs/errors/UnityError.js +77 -0
  7. package/dist/cjs/errors/index.js +18 -0
  8. package/dist/cjs/events/hubEventEmitter.js +16 -16
  9. package/dist/cjs/events/hubEventParser.js +97 -27
  10. package/dist/cjs/events/patterns/implementations/bracketModulePattern.js +57 -0
  11. package/dist/cjs/events/patterns/implementations/errorPattern.js +99 -0
  12. package/dist/cjs/events/patterns/implementations/fallbackPattern.js +63 -0
  13. package/dist/cjs/events/patterns/implementations/index.js +9 -0
  14. package/dist/cjs/events/patterns/index.js +23 -0
  15. package/dist/cjs/events/patterns/patternRegistry.js +69 -0
  16. package/dist/cjs/events/patterns/statusNormalizer.js +280 -0
  17. package/dist/cjs/events/patterns/types.js +2 -0
  18. package/dist/cjs/index.js +8 -11
  19. package/dist/cjs/unityEditor.js +182 -230
  20. package/dist/cjs/unityHub.js +110 -85
  21. package/dist/cjs/utils/commandExecutor.js +8 -9
  22. package/dist/esm/errors/Result.d.ts +21 -0
  23. package/dist/esm/errors/Result.js +63 -0
  24. package/dist/esm/errors/UnityError.d.ts +36 -0
  25. package/dist/esm/errors/UnityError.js +64 -0
  26. package/dist/esm/errors/index.d.ts +2 -0
  27. package/dist/esm/errors/index.js +2 -0
  28. package/dist/esm/events/hubEventEmitter.d.ts +1 -1
  29. package/dist/esm/events/hubEventParser.d.ts +17 -3
  30. package/dist/esm/events/hubEventParser.js +97 -27
  31. package/dist/esm/events/patterns/implementations/bracketModulePattern.d.ts +11 -0
  32. package/dist/esm/events/patterns/implementations/bracketModulePattern.js +53 -0
  33. package/dist/esm/events/patterns/implementations/errorPattern.d.ts +22 -0
  34. package/dist/esm/events/patterns/implementations/errorPattern.js +95 -0
  35. package/dist/esm/events/patterns/implementations/fallbackPattern.d.ts +13 -0
  36. package/dist/esm/events/patterns/implementations/fallbackPattern.js +59 -0
  37. package/dist/esm/events/patterns/implementations/index.d.ts +3 -0
  38. package/dist/esm/events/patterns/implementations/index.js +3 -0
  39. package/dist/esm/events/patterns/index.d.ts +4 -0
  40. package/dist/esm/events/patterns/index.js +4 -0
  41. package/dist/esm/events/patterns/patternRegistry.d.ts +14 -0
  42. package/dist/esm/events/patterns/patternRegistry.js +65 -0
  43. package/dist/esm/events/patterns/statusNormalizer.d.ts +15 -0
  44. package/dist/esm/events/patterns/statusNormalizer.js +276 -0
  45. package/dist/esm/events/patterns/types.d.ts +30 -0
  46. package/dist/esm/events/patterns/types.js +1 -0
  47. package/dist/esm/index.d.ts +5 -6
  48. package/dist/esm/index.js +1 -2
  49. package/dist/esm/unityEditor.d.ts +11 -15
  50. package/dist/esm/unityEditor.js +196 -244
  51. package/dist/esm/unityHub.d.ts +13 -11
  52. package/dist/esm/unityHub.js +108 -83
  53. package/dist/esm/utils/commandExecutor.d.ts +4 -3
  54. package/dist/esm/utils/commandExecutor.js +8 -9
  55. package/package.json +70 -70
  56. package/sandbox/index.js +51 -0
  57. package/sandbox/node_modules/.package-lock.json +10495 -0
  58. package/sandbox/package.json +13 -0
  59. package/dist/cjs/configs/unityConfig.js +0 -74
  60. package/dist/cjs/unityTemplates.js +0 -29
  61. package/dist/esm/configs/unityConfig.d.ts +0 -25
  62. package/dist/esm/configs/unityConfig.js +0 -68
  63. package/dist/esm/unityTemplates.d.ts +0 -10
  64. package/dist/esm/unityTemplates.js +0 -24
@@ -1,40 +1,110 @@
1
- import { InstallerStatus } from "../types/unity.js";
1
+ import { PatternRegistry, StatusNormalizer, BracketModulePattern, ErrorPattern, FallbackPattern, } from "./patterns/index.js";
2
2
  export class UnityHubEventParser {
3
- static errorPatterns = [/Error:.*/];
3
+ static patternRegistry;
4
+ static statusNormalizer;
5
+ static config = {
6
+ locale: "en",
7
+ logUnknownStatuses: true,
8
+ minConfidence: 30,
9
+ useFallbackPatterns: true,
10
+ };
11
+ static initialize() {
12
+ if (this.patternRegistry) {
13
+ return;
14
+ }
15
+ this.statusNormalizer = new StatusNormalizer();
16
+ this.patternRegistry = new PatternRegistry();
17
+ this.patternRegistry.register(new ErrorPattern(this.config.locale));
18
+ this.patternRegistry.register(new BracketModulePattern(this.statusNormalizer, this.config.locale));
19
+ if (this.config.useFallbackPatterns) {
20
+ this.patternRegistry.register(new FallbackPattern(this.statusNormalizer, this.config.locale));
21
+ }
22
+ }
4
23
  static parseUnityHubEvent(event) {
24
+ this.initialize();
25
+ const result = this.parseWithDetails(event);
26
+ return result.events;
27
+ }
28
+ static parseWithDetails(event) {
29
+ this.initialize();
5
30
  const events = [];
6
- const lines = event.split("\n");
31
+ const unparsedLines = [];
32
+ const lines = event.split(/\r?\n/);
7
33
  for (const line of lines) {
8
- const errorLine = this.checkForErrors(line);
9
- if (errorLine) {
10
- events.push(errorLine);
34
+ const trimmedLine = line.trim();
35
+ if (!trimmedLine) {
11
36
  continue;
12
37
  }
13
- }
14
- const pattern = /^\[(?<module>[^\]]+)\]\s+(?<status>.+?)(?:(?:\s+(?<progress>\d+(?:\.\d+)?))%)?\.*$/;
15
- for (const line of lines) {
16
- const match = line.match(pattern);
17
- if (match?.groups) {
18
- const { module, status, progress } = match.groups;
38
+ const match = this.patternRegistry.match(trimmedLine, this.config.locale, this.config.minConfidence);
39
+ if (match) {
19
40
  events.push({
20
- module: module.trim(),
21
- status: status.replace(/\.\.\.$/, "").trim(),
22
- progress: progress ? parseFloat(progress) : status !== InstallerStatus.Downloading ? null : 0,
41
+ module: match.module,
42
+ status: match.status,
43
+ progress: match.progress,
44
+ error: match.error,
23
45
  });
24
46
  }
25
- }
26
- return events;
27
- }
28
- static checkForErrors(line) {
29
- for (const pattern of this.errorPatterns) {
30
- if (pattern.test(line)) {
31
- return {
32
- module: "UnityHub",
33
- status: InstallerStatus.Error,
34
- error: line.trim(),
35
- };
47
+ else {
48
+ unparsedLines.push(trimmedLine);
49
+ if (this.config.logUnknownStatuses) {
50
+ console.debug(`UnityHubEventParser: Could not parse line: "${trimmedLine}"`);
51
+ }
36
52
  }
37
53
  }
38
- return null;
54
+ return {
55
+ events,
56
+ unknownStatuses: this.statusNormalizer.getUnknownStatuses(),
57
+ unparsedLines,
58
+ };
59
+ }
60
+ static setLocale(locale) {
61
+ this.config.locale = locale;
62
+ if (this.patternRegistry) {
63
+ this.patternRegistry.clear();
64
+ this.initialize();
65
+ }
66
+ }
67
+ static getLocale() {
68
+ return this.config.locale;
69
+ }
70
+ static registerCustomPattern(pattern) {
71
+ this.initialize();
72
+ this.patternRegistry.register(pattern);
73
+ }
74
+ static addStatusNormalization(statusText, status, locale) {
75
+ this.initialize();
76
+ this.statusNormalizer.addNormalization({ text: statusText, status, locale });
77
+ }
78
+ static getUnknownStatuses() {
79
+ this.initialize();
80
+ return this.statusNormalizer.getUnknownStatuses();
81
+ }
82
+ static clearUnknownStatuses() {
83
+ this.initialize();
84
+ this.statusNormalizer.clearUnknownStatuses();
85
+ }
86
+ static configure(config) {
87
+ this.config = { ...this.config, ...config };
88
+ if (config.locale && this.patternRegistry) {
89
+ this.patternRegistry.clear();
90
+ this.initialize();
91
+ }
92
+ }
93
+ static getConfig() {
94
+ return { ...this.config };
95
+ }
96
+ static reset() {
97
+ this.patternRegistry = undefined;
98
+ this.statusNormalizer = undefined;
99
+ this.config = {
100
+ locale: "en",
101
+ logUnknownStatuses: true,
102
+ minConfidence: 30,
103
+ useFallbackPatterns: true,
104
+ };
105
+ }
106
+ static getPatternNames() {
107
+ this.initialize();
108
+ return this.patternRegistry.getPatternNames();
39
109
  }
40
110
  }
@@ -0,0 +1,11 @@
1
+ import { Pattern, PatternMatch } from "../types.js";
2
+ import { StatusNormalizer } from "../statusNormalizer.js";
3
+ export declare class BracketModulePattern implements Pattern {
4
+ readonly name = "BracketModulePattern";
5
+ readonly priority = 80;
6
+ readonly locale?: string;
7
+ private statusNormalizer;
8
+ private pattern;
9
+ constructor(statusNormalizer: StatusNormalizer, locale?: string);
10
+ match(line: string, locale?: string): PatternMatch | null;
11
+ }
@@ -0,0 +1,53 @@
1
+ import { InstallerStatus } from "../../../types/unity.js";
2
+ export class BracketModulePattern {
3
+ name = "BracketModulePattern";
4
+ priority = 80;
5
+ locale;
6
+ statusNormalizer;
7
+ pattern = /^\s*[\[\(]([^\]\)]+)[\]\)]\s+(.+?)(?:\s+(\d+(?:\.\d+)?)\s*%)?\.{0,3}\s*$/;
8
+ constructor(statusNormalizer, locale) {
9
+ this.statusNormalizer = statusNormalizer;
10
+ this.locale = locale;
11
+ }
12
+ match(line, locale) {
13
+ const trimmedLine = line.trim();
14
+ if (!trimmedLine) {
15
+ return null;
16
+ }
17
+ const match = trimmedLine.match(this.pattern);
18
+ if (!match) {
19
+ return null;
20
+ }
21
+ const [, moduleName, statusText, progressStr] = match;
22
+ if (!moduleName || !statusText) {
23
+ return null;
24
+ }
25
+ const effectiveLocale = locale || this.locale;
26
+ const normalizedStatus = this.statusNormalizer.normalize(statusText, effectiveLocale);
27
+ if (!normalizedStatus) {
28
+ return {
29
+ module: moduleName.trim(),
30
+ status: statusText.trim(),
31
+ progress: progressStr ? parseFloat(progressStr) : null,
32
+ confidence: 40,
33
+ };
34
+ }
35
+ let progress = null;
36
+ if (progressStr) {
37
+ const parsed = parseFloat(progressStr);
38
+ if (!isNaN(parsed) && parsed >= 0 && parsed <= 100) {
39
+ progress = parsed;
40
+ }
41
+ }
42
+ else if (normalizedStatus === InstallerStatus.Downloading ||
43
+ normalizedStatus === InstallerStatus.Installing) {
44
+ progress = 0;
45
+ }
46
+ return {
47
+ module: moduleName.trim(),
48
+ status: normalizedStatus,
49
+ progress,
50
+ confidence: 85,
51
+ };
52
+ }
53
+ }
@@ -0,0 +1,22 @@
1
+ import { Pattern, PatternMatch } from "../types.js";
2
+ declare enum ErrorSeverity {
3
+ Critical = "critical",
4
+ Error = "error",
5
+ Warning = "warning"
6
+ }
7
+ export declare class ErrorPattern implements Pattern {
8
+ readonly name = "ErrorPattern";
9
+ readonly priority = 90;
10
+ readonly locale?: string;
11
+ private criticalPatterns;
12
+ private errorPatterns;
13
+ private warningPatterns;
14
+ private localizedErrorPatterns;
15
+ constructor(locale?: string);
16
+ match(line: string, locale?: string): PatternMatch | null;
17
+ private matchesAnyPattern;
18
+ private createErrorMatch;
19
+ addErrorPattern(pattern: RegExp, severity?: ErrorSeverity): void;
20
+ addLocalizedPatterns(locale: string, patterns: RegExp[]): void;
21
+ }
22
+ export {};
@@ -0,0 +1,95 @@
1
+ import { InstallerStatus } from "../../../types/unity.js";
2
+ var ErrorSeverity;
3
+ (function (ErrorSeverity) {
4
+ ErrorSeverity["Critical"] = "critical";
5
+ ErrorSeverity["Error"] = "error";
6
+ ErrorSeverity["Warning"] = "warning";
7
+ })(ErrorSeverity || (ErrorSeverity = {}));
8
+ export class ErrorPattern {
9
+ name = "ErrorPattern";
10
+ priority = 90;
11
+ locale;
12
+ criticalPatterns = [
13
+ /\b(?:fatal|critical|emergency)\b/i,
14
+ /\bexception\b/i,
15
+ /\bstack\s*trace\b/i,
16
+ /\bcrash(?:ed)?\b/i,
17
+ ];
18
+ errorPatterns = [
19
+ /\berror\s*:/i,
20
+ /\berror\b/i,
21
+ /\bfailed\b/i,
22
+ /\bcannot\b/i,
23
+ /\bunable\s+to\b/i,
24
+ /\bcould\s+not\b/i,
25
+ /\bfailure\b/i,
26
+ ];
27
+ warningPatterns = [/\bwarning\s*:/i, /\bwarning\b/i, /\bcaution\b/i];
28
+ localizedErrorPatterns = new Map([
29
+ ["ja", [/エラー/, /失敗/, /例外/, /できません/]],
30
+ ["de", [/fehler/i, /fehlgeschlagen/i, /ausnahme/i, /kann\s+nicht/i]],
31
+ ["fr", [/erreur/i, /échec/i, /échoué/i, /exception/i, /impossible/i]],
32
+ ["es", [/error/i, /fallo/i, /fallido/i, /excepción/i, /no\s+se\s+puede/i]],
33
+ ["zh-Hans", [/错误/, /失败/, /异常/, /无法/]],
34
+ ["zh-Hant", [/錯誤/, /失敗/, /異常/, /無法/]],
35
+ ["ko", [/오류/, /실패/, /예외/, /할\s*수\s*없습니다/]],
36
+ ]);
37
+ constructor(locale) {
38
+ this.locale = locale;
39
+ }
40
+ match(line, locale) {
41
+ const trimmedLine = line.trim();
42
+ if (!trimmedLine) {
43
+ return null;
44
+ }
45
+ const effectiveLocale = locale || this.locale;
46
+ if (this.matchesAnyPattern(trimmedLine, this.criticalPatterns)) {
47
+ return this.createErrorMatch(trimmedLine, ErrorSeverity.Critical, 95);
48
+ }
49
+ if (this.matchesAnyPattern(trimmedLine, this.errorPatterns)) {
50
+ return this.createErrorMatch(trimmedLine, ErrorSeverity.Error, 90);
51
+ }
52
+ if (effectiveLocale && this.localizedErrorPatterns.has(effectiveLocale)) {
53
+ const patterns = this.localizedErrorPatterns.get(effectiveLocale);
54
+ if (this.matchesAnyPattern(trimmedLine, patterns)) {
55
+ return this.createErrorMatch(trimmedLine, ErrorSeverity.Error, 88);
56
+ }
57
+ }
58
+ if (this.matchesAnyPattern(trimmedLine, this.warningPatterns)) {
59
+ return this.createErrorMatch(trimmedLine, ErrorSeverity.Warning, 70);
60
+ }
61
+ return null;
62
+ }
63
+ matchesAnyPattern(line, patterns) {
64
+ return patterns.some((pattern) => pattern.test(line));
65
+ }
66
+ createErrorMatch(line, severity, confidence) {
67
+ const bracketMatch = line.match(/^\s*[\[\(]([^\]\)]+)[\]\)]/);
68
+ const module = bracketMatch ? bracketMatch[1].trim() : "UnityHub";
69
+ return {
70
+ module,
71
+ status: InstallerStatus.Error,
72
+ error: line.trim(),
73
+ confidence,
74
+ };
75
+ }
76
+ addErrorPattern(pattern, severity = ErrorSeverity.Error) {
77
+ switch (severity) {
78
+ case ErrorSeverity.Critical:
79
+ this.criticalPatterns.push(pattern);
80
+ break;
81
+ case ErrorSeverity.Error:
82
+ this.errorPatterns.push(pattern);
83
+ break;
84
+ case ErrorSeverity.Warning:
85
+ this.warningPatterns.push(pattern);
86
+ break;
87
+ }
88
+ }
89
+ addLocalizedPatterns(locale, patterns) {
90
+ if (!this.localizedErrorPatterns.has(locale)) {
91
+ this.localizedErrorPatterns.set(locale, []);
92
+ }
93
+ this.localizedErrorPatterns.get(locale).push(...patterns);
94
+ }
95
+ }
@@ -0,0 +1,13 @@
1
+ import { Pattern, PatternMatch } from "../types.js";
2
+ import { StatusNormalizer } from "../statusNormalizer.js";
3
+ export declare class FallbackPattern implements Pattern {
4
+ readonly name = "FallbackPattern";
5
+ readonly priority = 20;
6
+ readonly locale?: string;
7
+ private statusNormalizer;
8
+ constructor(statusNormalizer: StatusNormalizer, locale?: string);
9
+ match(line: string, locale?: string): PatternMatch | null;
10
+ private findStatusInLine;
11
+ private extractModuleName;
12
+ private escapeRegex;
13
+ }
@@ -0,0 +1,59 @@
1
+ export class FallbackPattern {
2
+ name = "FallbackPattern";
3
+ priority = 20;
4
+ locale;
5
+ statusNormalizer;
6
+ constructor(statusNormalizer, locale) {
7
+ this.statusNormalizer = statusNormalizer;
8
+ this.locale = locale;
9
+ }
10
+ match(line, locale) {
11
+ const trimmedLine = line.trim();
12
+ if (!trimmedLine) {
13
+ return null;
14
+ }
15
+ const effectiveLocale = locale || this.locale;
16
+ const progressMatch = trimmedLine.match(/(\d+(?:\.\d+)?)\s*%/);
17
+ const progress = progressMatch ? parseFloat(progressMatch[1]) : null;
18
+ const statusMatch = this.findStatusInLine(trimmedLine, effectiveLocale);
19
+ if (!statusMatch) {
20
+ return null;
21
+ }
22
+ const moduleName = this.extractModuleName(trimmedLine, statusMatch.statusText);
23
+ return {
24
+ module: moduleName || "Unknown",
25
+ status: statusMatch.status,
26
+ progress,
27
+ confidence: 30,
28
+ };
29
+ }
30
+ findStatusInLine(line, locale) {
31
+ const normalizations = this.statusNormalizer.getNormalizationsForLocale(locale);
32
+ const sortedNormalizations = Array.from(normalizations.entries()).sort((a, b) => b[0].length - a[0].length);
33
+ for (const [statusText, status] of sortedNormalizations) {
34
+ const pattern = new RegExp(`\\b${this.escapeRegex(statusText)}\\b`, "i");
35
+ if (pattern.test(line)) {
36
+ return { status, statusText };
37
+ }
38
+ }
39
+ return null;
40
+ }
41
+ extractModuleName(line, statusText) {
42
+ let cleanLine = line.replace(new RegExp(`\\b${this.escapeRegex(statusText)}\\b`, "gi"), "");
43
+ cleanLine = cleanLine.replace(/\d+(?:\.\d+)?\s*%/, "");
44
+ cleanLine = cleanLine.replace(/[:\-\[\]\(\)]/g, " ");
45
+ cleanLine = cleanLine.trim();
46
+ const words = cleanLine.split(/\s+/).filter((w) => w.length > 0);
47
+ if (words.length === 0) {
48
+ return null;
49
+ }
50
+ const capitalizedWords = words.filter((w) => /^[A-Z]/.test(w));
51
+ if (capitalizedWords.length > 0) {
52
+ return capitalizedWords.join(" ");
53
+ }
54
+ return words.join(" ");
55
+ }
56
+ escapeRegex(str) {
57
+ return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
58
+ }
59
+ }
@@ -0,0 +1,3 @@
1
+ export { BracketModulePattern } from "./bracketModulePattern.js";
2
+ export { ErrorPattern } from "./errorPattern.js";
3
+ export { FallbackPattern } from "./fallbackPattern.js";
@@ -0,0 +1,3 @@
1
+ export { BracketModulePattern } from "./bracketModulePattern.js";
2
+ export { ErrorPattern } from "./errorPattern.js";
3
+ export { FallbackPattern } from "./fallbackPattern.js";
@@ -0,0 +1,4 @@
1
+ export * from "./types.js";
2
+ export { StatusNormalizer } from "./statusNormalizer.js";
3
+ export { PatternRegistry } from "./patternRegistry.js";
4
+ export * from "./implementations/index.js";
@@ -0,0 +1,4 @@
1
+ export * from "./types.js";
2
+ export { StatusNormalizer } from "./statusNormalizer.js";
3
+ export { PatternRegistry } from "./patternRegistry.js";
4
+ export * from "./implementations/index.js";
@@ -0,0 +1,14 @@
1
+ import { Pattern, PatternMatch } from "./types.js";
2
+ export declare class PatternRegistry {
3
+ private patterns;
4
+ register(pattern: Pattern): void;
5
+ registerAll(patterns: Pattern[]): void;
6
+ unregister(patternName: string): boolean;
7
+ getPatterns(locale?: string): Pattern[];
8
+ match(line: string, locale?: string, minConfidence?: number): PatternMatch | null;
9
+ matchAll(line: string, locale?: string): PatternMatch[];
10
+ getPatternNames(): string[];
11
+ clear(): void;
12
+ count(): number;
13
+ private sortPatterns;
14
+ }
@@ -0,0 +1,65 @@
1
+ export class PatternRegistry {
2
+ patterns = [];
3
+ register(pattern) {
4
+ this.patterns.push(pattern);
5
+ this.sortPatterns();
6
+ }
7
+ registerAll(patterns) {
8
+ this.patterns.push(...patterns);
9
+ this.sortPatterns();
10
+ }
11
+ unregister(patternName) {
12
+ const initialLength = this.patterns.length;
13
+ this.patterns = this.patterns.filter((p) => p.name !== patternName);
14
+ return this.patterns.length < initialLength;
15
+ }
16
+ getPatterns(locale) {
17
+ if (!locale) {
18
+ return [...this.patterns];
19
+ }
20
+ return this.patterns.filter((p) => !p.locale || p.locale === locale);
21
+ }
22
+ match(line, locale, minConfidence = 0) {
23
+ const applicablePatterns = this.getPatterns(locale);
24
+ for (const pattern of applicablePatterns) {
25
+ try {
26
+ const match = pattern.match(line, locale);
27
+ if (match && match.confidence >= minConfidence) {
28
+ return match;
29
+ }
30
+ }
31
+ catch (error) {
32
+ console.error(`Error in pattern "${pattern.name}":`, error);
33
+ }
34
+ }
35
+ return null;
36
+ }
37
+ matchAll(line, locale) {
38
+ const applicablePatterns = this.getPatterns(locale);
39
+ const matches = [];
40
+ for (const pattern of applicablePatterns) {
41
+ try {
42
+ const match = pattern.match(line, locale);
43
+ if (match) {
44
+ matches.push(match);
45
+ }
46
+ }
47
+ catch (error) {
48
+ console.error(`Error in pattern "${pattern.name}":`, error);
49
+ }
50
+ }
51
+ return matches.sort((a, b) => b.confidence - a.confidence);
52
+ }
53
+ getPatternNames() {
54
+ return this.patterns.map((p) => p.name);
55
+ }
56
+ clear() {
57
+ this.patterns = [];
58
+ }
59
+ count() {
60
+ return this.patterns.length;
61
+ }
62
+ sortPatterns() {
63
+ this.patterns.sort((a, b) => b.priority - a.priority);
64
+ }
65
+ }
@@ -0,0 +1,15 @@
1
+ import { InstallerStatus } from "../../types/unity.js";
2
+ import { StatusNormalization } from "./types.js";
3
+ export declare class StatusNormalizer {
4
+ private normalizations;
5
+ private localeNormalizations;
6
+ private unknownStatuses;
7
+ constructor();
8
+ private initializeDefaultNormalizations;
9
+ addNormalization(normalization: StatusNormalization): void;
10
+ normalize(statusText: string, locale?: string): InstallerStatus | null;
11
+ isKnownStatus(statusText: string, locale?: string): boolean;
12
+ getUnknownStatuses(): string[];
13
+ clearUnknownStatuses(): void;
14
+ getNormalizationsForLocale(locale?: string): Map<string, InstallerStatus>;
15
+ }