@uipath/rpa-tool 0.9.3 → 0.9.4

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.
@@ -1,10 +1,1037 @@
1
+ // node_modules/@uipath/solutionpackager-tool-core/dist/index.js
2
+ class Path {
3
+ static normalize(path) {
4
+ return path.replace(/\\/g, "/").replace(/\/+/g, "/");
5
+ }
6
+ static join(...segments) {
7
+ return Path.normalize(segments.filter((s) => s.length > 0).join("/"));
8
+ }
9
+ static dirname(path) {
10
+ const normalized = Path.normalize(path).replace(/\/$/, "");
11
+ if (normalized === "")
12
+ return ".";
13
+ const lastSlash = normalized.lastIndexOf("/");
14
+ if (lastSlash === -1)
15
+ return ".";
16
+ if (lastSlash === 0)
17
+ return "/";
18
+ return normalized.substring(0, lastSlash);
19
+ }
20
+ static basename(path) {
21
+ const normalized = Path.normalize(path).replace(/\/$/, "");
22
+ if (normalized === "")
23
+ return "";
24
+ const lastSlash = normalized.lastIndexOf("/");
25
+ return lastSlash >= 0 ? normalized.substring(lastSlash + 1) : normalized;
26
+ }
27
+ static extname(path) {
28
+ const base = Path.basename(path);
29
+ const lastDot = base.lastIndexOf(".");
30
+ if (lastDot === -1 || lastDot === 0 || lastDot === base.length - 1) {
31
+ return "";
32
+ }
33
+ return base.substring(lastDot);
34
+ }
35
+ static async walkDirectory(fs, rootPath, currentRelativePath = "") {
36
+ const entries = [];
37
+ const absolutePath = currentRelativePath ? Path.join(rootPath, currentRelativePath) : rootPath;
38
+ const items = await fs.readdir(absolutePath);
39
+ for (const item of items) {
40
+ const itemRelativePath = currentRelativePath ? Path.join(currentRelativePath, item) : item;
41
+ const itemAbsolutePath = Path.join(rootPath, itemRelativePath);
42
+ const stat = await fs.stat(itemAbsolutePath);
43
+ if (stat?.isDirectory()) {
44
+ const subEntries = await Path.walkDirectory(fs, rootPath, itemRelativePath);
45
+ entries.push(...subEntries);
46
+ } else if (stat?.isFile()) {
47
+ entries.push({
48
+ relativePath: Path.normalize(itemRelativePath),
49
+ absolutePath: Path.normalize(itemAbsolutePath)
50
+ });
51
+ }
52
+ }
53
+ return entries;
54
+ }
55
+ }
56
+
57
+ class TemporaryStorageService {
58
+ fileSystem;
59
+ _tempFolderPath = null;
60
+ constructor(fileSystem) {
61
+ this.fileSystem = fileSystem;
62
+ }
63
+ async getTempFolderPath() {
64
+ if (!this._tempFolderPath) {
65
+ const systemTempDir = await this.fileSystem.getTempDir();
66
+ const uniqueFolderName = this.generateUniqueFolderName();
67
+ this._tempFolderPath = Path.join(systemTempDir, uniqueFolderName);
68
+ await this.fileSystem.mkdir(this._tempFolderPath);
69
+ }
70
+ return this._tempFolderPath;
71
+ }
72
+ generateUniqueFolderName() {
73
+ const timestamp = Date.now();
74
+ const random = Math.random().toString(36).substring(2, 10);
75
+ return `tool-temp-${timestamp}-${random}`;
76
+ }
77
+ async getTempSubfolderPathAsync(subfolder) {
78
+ const tempFolderPath = await this.getTempFolderPath();
79
+ const inputPath = Path.join(tempFolderPath, subfolder);
80
+ await this.fileSystem.mkdir(inputPath);
81
+ return inputPath;
82
+ }
83
+ async cleanup() {
84
+ try {
85
+ if (!this._tempFolderPath) {
86
+ return;
87
+ }
88
+ try {
89
+ const stats = await this.fileSystem.stat(this._tempFolderPath);
90
+ if (!stats) {
91
+ return;
92
+ }
93
+ } catch {
94
+ return;
95
+ }
96
+ const pathToCleanup = this._tempFolderPath;
97
+ await this.fileSystem.rm(this._tempFolderPath);
98
+ this._tempFolderPath = null;
99
+ } catch {}
100
+ }
101
+ }
102
+ function isPluralForm(value) {
103
+ return typeof value === "object" && value !== null && "other" in value;
104
+ }
105
+ function selectPluralForm(forms, count) {
106
+ if (count === 0 && forms.zero !== undefined) {
107
+ return forms.zero;
108
+ }
109
+ if (count === 1 && forms.one !== undefined) {
110
+ return forms.one;
111
+ }
112
+ if (count === 2 && forms.two !== undefined) {
113
+ return forms.two;
114
+ }
115
+ if (forms.few !== undefined) {
116
+ const mod10 = count % 10;
117
+ const mod100 = count % 100;
118
+ if (mod10 >= 2 && mod10 <= 4 && (mod100 < 10 || mod100 >= 20)) {
119
+ return forms.few;
120
+ }
121
+ }
122
+ if (forms.many !== undefined) {
123
+ const mod10 = count % 10;
124
+ const mod100 = count % 100;
125
+ if (count === 0 || mod10 === 0 && mod100 !== 0 || mod10 >= 5 && mod10 <= 9 || mod100 >= 11 && mod100 <= 14) {
126
+ return forms.many;
127
+ }
128
+ }
129
+ return forms.other;
130
+ }
131
+
132
+ class I18nManager {
133
+ static translations = {};
134
+ static currentLocale = "en";
135
+ static fallbackLocale = "en";
136
+ static registerTranslations(locale, catalog) {
137
+ if (!I18nManager.translations[locale]) {
138
+ I18nManager.translations[locale] = {};
139
+ }
140
+ I18nManager.translations[locale] = I18nManager.deepMerge(I18nManager.translations[locale], catalog);
141
+ }
142
+ static setLocale(locale) {
143
+ const normalized = I18nManager.normalizeLocale(locale);
144
+ if (I18nManager.translations[normalized]) {
145
+ I18nManager.currentLocale = normalized;
146
+ return normalized;
147
+ }
148
+ const baseLocale = normalized.split("-")[0];
149
+ if (baseLocale !== normalized && I18nManager.translations[baseLocale]) {
150
+ I18nManager.currentLocale = baseLocale;
151
+ return baseLocale;
152
+ }
153
+ return I18nManager.currentLocale;
154
+ }
155
+ static getLocale() {
156
+ return I18nManager.currentLocale;
157
+ }
158
+ static setFallbackLocale(locale) {
159
+ I18nManager.fallbackLocale = I18nManager.normalizeLocale(locale);
160
+ }
161
+ static t(key, params, locale) {
162
+ const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
163
+ let value = I18nManager.getTranslationValue(key, targetLocale);
164
+ if (value === undefined && targetLocale !== I18nManager.fallbackLocale) {
165
+ value = I18nManager.getTranslationValue(key, I18nManager.fallbackLocale);
166
+ }
167
+ if (value === undefined) {
168
+ return key;
169
+ }
170
+ if (isPluralForm(value) && params && "count" in params) {
171
+ const count = typeof params.count === "number" ? params.count : Number(params.count);
172
+ value = selectPluralForm(value, count);
173
+ } else if (isPluralForm(value)) {
174
+ value = value.other;
175
+ }
176
+ if (typeof value !== "string") {
177
+ return key;
178
+ }
179
+ return params ? I18nManager.interpolate(value, params) : value;
180
+ }
181
+ static has(key, locale) {
182
+ const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
183
+ const value = I18nManager.getTranslationValue(key, targetLocale);
184
+ if (value !== undefined) {
185
+ return true;
186
+ }
187
+ if (targetLocale !== I18nManager.fallbackLocale) {
188
+ return I18nManager.getTranslationValue(key, I18nManager.fallbackLocale) !== undefined;
189
+ }
190
+ return false;
191
+ }
192
+ static getAvailableLocales() {
193
+ return Object.keys(I18nManager.translations);
194
+ }
195
+ static clearTranslations() {
196
+ I18nManager.translations = {};
197
+ I18nManager.currentLocale = "en";
198
+ }
199
+ static getTranslationValue(key, locale) {
200
+ const catalog = I18nManager.translations[locale];
201
+ if (!catalog) {
202
+ return;
203
+ }
204
+ const keys = key.split(".");
205
+ let value = catalog;
206
+ for (const k of keys) {
207
+ if (value && typeof value === "object" && k in value) {
208
+ value = value[k];
209
+ } else {
210
+ return;
211
+ }
212
+ }
213
+ return value;
214
+ }
215
+ static interpolate(template, params) {
216
+ return template.replace(/\{(\w+)\}/g, (_, key) => {
217
+ const value = params[key];
218
+ return value !== undefined ? String(value) : `{${key}}`;
219
+ });
220
+ }
221
+ static normalizeLocale(locale) {
222
+ const normalized = locale.toLowerCase().replace(/_/g, "-");
223
+ const specialLocales = ["es-mx", "pt-br", "zh-cn", "zh-tw"];
224
+ if (specialLocales.includes(normalized)) {
225
+ return normalized;
226
+ }
227
+ return normalized.split("-")[0];
228
+ }
229
+ static deepMerge(target, source) {
230
+ const result = { ...target };
231
+ for (const key of Object.keys(source)) {
232
+ const sourceValue = source[key];
233
+ const targetValue = result[key];
234
+ if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue) && targetValue && typeof targetValue === "object" && !Array.isArray(targetValue)) {
235
+ result[key] = I18nManager.deepMerge(targetValue, sourceValue);
236
+ } else {
237
+ result[key] = sourceValue;
238
+ }
239
+ }
240
+ return result;
241
+ }
242
+ }
243
+ var de = {
244
+ toolCore: {
245
+ errors: {
246
+ internal: "Internal error: {message}",
247
+ fileNotFound: "File not found: {path}",
248
+ fileReadFailed: "Failed to read file: {path}",
249
+ fileWriteFailed: "Failed to write file: {path}",
250
+ directoryNotFound: "Directory not found: {path}",
251
+ invalidPath: "{path} is not a valid path",
252
+ operationCanceled: "Operation was canceled",
253
+ invalidParameter: "Invalid parameter: {parameter}"
254
+ },
255
+ progress: {
256
+ copying: "Copying files...",
257
+ building: "Building project...",
258
+ packaging: "Creating package...",
259
+ validating: "Validating...",
260
+ analyzing: "Analyzing...",
261
+ restoring: "Restoring dependencies..."
262
+ },
263
+ validation: {
264
+ requiredField: "{field} is required",
265
+ invalidValue: "Invalid value for {field}",
266
+ pathNotFound: "Path not found: {path}",
267
+ fileRequired: "File is required: {path}",
268
+ directoryRequired: "Directory is required: {path}"
269
+ },
270
+ warnings: {
271
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
272
+ },
273
+ info: {
274
+ operationComplete: "Operation completed successfully",
275
+ filesProcessed: {
276
+ zero: "No files processed",
277
+ one: "{count} file processed",
278
+ other: "{count} files processed"
279
+ }
280
+ }
281
+ }
282
+ };
283
+ var en = {
284
+ toolCore: {
285
+ errors: {
286
+ internal: "Internal error: {message}",
287
+ fileNotFound: "File not found: {path}",
288
+ fileReadFailed: "Failed to read file: {path}",
289
+ fileWriteFailed: "Failed to write file: {path}",
290
+ directoryNotFound: "Directory not found: {path}",
291
+ invalidPath: "{path} is not a valid path",
292
+ operationCanceled: "Operation was canceled",
293
+ invalidParameter: "Invalid parameter: {parameter}"
294
+ },
295
+ progress: {
296
+ copying: "Copying files...",
297
+ building: "Building project...",
298
+ packaging: "Creating package...",
299
+ validating: "Validating...",
300
+ analyzing: "Analyzing...",
301
+ restoring: "Restoring dependencies..."
302
+ },
303
+ validation: {
304
+ requiredField: "{field} is required",
305
+ invalidValue: "Invalid value for {field}",
306
+ pathNotFound: "Path not found: {path}",
307
+ fileRequired: "File is required: {path}",
308
+ directoryRequired: "Directory is required: {path}"
309
+ },
310
+ warnings: {
311
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
312
+ },
313
+ info: {
314
+ operationComplete: "Operation completed successfully",
315
+ filesProcessed: {
316
+ zero: "No files processed",
317
+ one: "{count} file processed",
318
+ other: "{count} files processed"
319
+ }
320
+ }
321
+ }
322
+ };
323
+ var es = {
324
+ toolCore: {
325
+ errors: {
326
+ internal: "Internal error: {message}",
327
+ fileNotFound: "File not found: {path}",
328
+ fileReadFailed: "Failed to read file: {path}",
329
+ fileWriteFailed: "Failed to write file: {path}",
330
+ directoryNotFound: "Directory not found: {path}",
331
+ invalidPath: "{path} is not a valid path",
332
+ operationCanceled: "Operation was canceled",
333
+ invalidParameter: "Invalid parameter: {parameter}"
334
+ },
335
+ progress: {
336
+ copying: "Copying files...",
337
+ building: "Building project...",
338
+ packaging: "Creating package...",
339
+ validating: "Validating...",
340
+ analyzing: "Analyzing...",
341
+ restoring: "Restoring dependencies..."
342
+ },
343
+ validation: {
344
+ requiredField: "{field} is required",
345
+ invalidValue: "Invalid value for {field}",
346
+ pathNotFound: "Path not found: {path}",
347
+ fileRequired: "File is required: {path}",
348
+ directoryRequired: "Directory is required: {path}"
349
+ },
350
+ warnings: {
351
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
352
+ },
353
+ info: {
354
+ operationComplete: "Operation completed successfully",
355
+ filesProcessed: {
356
+ zero: "No files processed",
357
+ one: "{count} file processed",
358
+ other: "{count} files processed"
359
+ }
360
+ }
361
+ }
362
+ };
363
+ var es_MX = {
364
+ toolCore: {
365
+ errors: {
366
+ internal: "Internal error: {message}",
367
+ fileNotFound: "File not found: {path}",
368
+ fileReadFailed: "Failed to read file: {path}",
369
+ fileWriteFailed: "Failed to write file: {path}",
370
+ directoryNotFound: "Directory not found: {path}",
371
+ invalidPath: "{path} is not a valid path",
372
+ operationCanceled: "Operation was canceled",
373
+ invalidParameter: "Invalid parameter: {parameter}"
374
+ },
375
+ progress: {
376
+ copying: "Copying files...",
377
+ building: "Building project...",
378
+ packaging: "Creating package...",
379
+ validating: "Validating...",
380
+ analyzing: "Analyzing...",
381
+ restoring: "Restoring dependencies..."
382
+ },
383
+ validation: {
384
+ requiredField: "{field} is required",
385
+ invalidValue: "Invalid value for {field}",
386
+ pathNotFound: "Path not found: {path}",
387
+ fileRequired: "File is required: {path}",
388
+ directoryRequired: "Directory is required: {path}"
389
+ },
390
+ warnings: {
391
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
392
+ },
393
+ info: {
394
+ operationComplete: "Operation completed successfully",
395
+ filesProcessed: {
396
+ zero: "No files processed",
397
+ one: "{count} file processed",
398
+ other: "{count} files processed"
399
+ }
400
+ }
401
+ }
402
+ };
403
+ var fr = {
404
+ toolCore: {
405
+ errors: {
406
+ internal: "Internal error: {message}",
407
+ fileNotFound: "File not found: {path}",
408
+ fileReadFailed: "Failed to read file: {path}",
409
+ fileWriteFailed: "Failed to write file: {path}",
410
+ directoryNotFound: "Directory not found: {path}",
411
+ invalidPath: "{path} is not a valid path",
412
+ operationCanceled: "Operation was canceled",
413
+ invalidParameter: "Invalid parameter: {parameter}"
414
+ },
415
+ progress: {
416
+ copying: "Copying files...",
417
+ building: "Building project...",
418
+ packaging: "Creating package...",
419
+ validating: "Validating...",
420
+ analyzing: "Analyzing...",
421
+ restoring: "Restoring dependencies..."
422
+ },
423
+ validation: {
424
+ requiredField: "{field} is required",
425
+ invalidValue: "Invalid value for {field}",
426
+ pathNotFound: "Path not found: {path}",
427
+ fileRequired: "File is required: {path}",
428
+ directoryRequired: "Directory is required: {path}"
429
+ },
430
+ warnings: {
431
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
432
+ },
433
+ info: {
434
+ operationComplete: "Operation completed successfully",
435
+ filesProcessed: {
436
+ zero: "No files processed",
437
+ one: "{count} file processed",
438
+ other: "{count} files processed"
439
+ }
440
+ }
441
+ }
442
+ };
443
+ var ja = {
444
+ toolCore: {
445
+ errors: {
446
+ internal: "Internal error: {message}",
447
+ fileNotFound: "File not found: {path}",
448
+ fileReadFailed: "Failed to read file: {path}",
449
+ fileWriteFailed: "Failed to write file: {path}",
450
+ directoryNotFound: "Directory not found: {path}",
451
+ invalidPath: "{path} is not a valid path",
452
+ operationCanceled: "Operation was canceled",
453
+ invalidParameter: "Invalid parameter: {parameter}"
454
+ },
455
+ progress: {
456
+ copying: "Copying files...",
457
+ building: "Building project...",
458
+ packaging: "Creating package...",
459
+ validating: "Validating...",
460
+ analyzing: "Analyzing...",
461
+ restoring: "Restoring dependencies..."
462
+ },
463
+ validation: {
464
+ requiredField: "{field} is required",
465
+ invalidValue: "Invalid value for {field}",
466
+ pathNotFound: "Path not found: {path}",
467
+ fileRequired: "File is required: {path}",
468
+ directoryRequired: "Directory is required: {path}"
469
+ },
470
+ warnings: {
471
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
472
+ },
473
+ info: {
474
+ operationComplete: "Operation completed successfully",
475
+ filesProcessed: {
476
+ zero: "No files processed",
477
+ one: "{count} file processed",
478
+ other: "{count} files processed"
479
+ }
480
+ }
481
+ }
482
+ };
483
+ var ko = {
484
+ toolCore: {
485
+ errors: {
486
+ internal: "Internal error: {message}",
487
+ fileNotFound: "File not found: {path}",
488
+ fileReadFailed: "Failed to read file: {path}",
489
+ fileWriteFailed: "Failed to write file: {path}",
490
+ directoryNotFound: "Directory not found: {path}",
491
+ invalidPath: "{path} is not a valid path",
492
+ operationCanceled: "Operation was canceled",
493
+ invalidParameter: "Invalid parameter: {parameter}"
494
+ },
495
+ progress: {
496
+ copying: "Copying files...",
497
+ building: "Building project...",
498
+ packaging: "Creating package...",
499
+ validating: "Validating...",
500
+ analyzing: "Analyzing...",
501
+ restoring: "Restoring dependencies..."
502
+ },
503
+ validation: {
504
+ requiredField: "{field} is required",
505
+ invalidValue: "Invalid value for {field}",
506
+ pathNotFound: "Path not found: {path}",
507
+ fileRequired: "File is required: {path}",
508
+ directoryRequired: "Directory is required: {path}"
509
+ },
510
+ warnings: {
511
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
512
+ },
513
+ info: {
514
+ operationComplete: "Operation completed successfully",
515
+ filesProcessed: {
516
+ zero: "No files processed",
517
+ one: "{count} file processed",
518
+ other: "{count} files processed"
519
+ }
520
+ }
521
+ }
522
+ };
523
+ var pt = {
524
+ toolCore: {
525
+ errors: {
526
+ internal: "Internal error: {message}",
527
+ fileNotFound: "File not found: {path}",
528
+ fileReadFailed: "Failed to read file: {path}",
529
+ fileWriteFailed: "Failed to write file: {path}",
530
+ directoryNotFound: "Directory not found: {path}",
531
+ invalidPath: "{path} is not a valid path",
532
+ operationCanceled: "Operation was canceled",
533
+ invalidParameter: "Invalid parameter: {parameter}"
534
+ },
535
+ progress: {
536
+ copying: "Copying files...",
537
+ building: "Building project...",
538
+ packaging: "Creating package...",
539
+ validating: "Validating...",
540
+ analyzing: "Analyzing...",
541
+ restoring: "Restoring dependencies..."
542
+ },
543
+ validation: {
544
+ requiredField: "{field} is required",
545
+ invalidValue: "Invalid value for {field}",
546
+ pathNotFound: "Path not found: {path}",
547
+ fileRequired: "File is required: {path}",
548
+ directoryRequired: "Directory is required: {path}"
549
+ },
550
+ warnings: {
551
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
552
+ },
553
+ info: {
554
+ operationComplete: "Operation completed successfully",
555
+ filesProcessed: {
556
+ zero: "No files processed",
557
+ one: "{count} file processed",
558
+ other: "{count} files processed"
559
+ }
560
+ }
561
+ }
562
+ };
563
+ var pt_BR = {
564
+ toolCore: {
565
+ errors: {
566
+ internal: "Internal error: {message}",
567
+ fileNotFound: "File not found: {path}",
568
+ fileReadFailed: "Failed to read file: {path}",
569
+ fileWriteFailed: "Failed to write file: {path}",
570
+ directoryNotFound: "Directory not found: {path}",
571
+ invalidPath: "{path} is not a valid path",
572
+ operationCanceled: "Operation was canceled",
573
+ invalidParameter: "Invalid parameter: {parameter}"
574
+ },
575
+ progress: {
576
+ copying: "Copying files...",
577
+ building: "Building project...",
578
+ packaging: "Creating package...",
579
+ validating: "Validating...",
580
+ analyzing: "Analyzing...",
581
+ restoring: "Restoring dependencies..."
582
+ },
583
+ validation: {
584
+ requiredField: "{field} is required",
585
+ invalidValue: "Invalid value for {field}",
586
+ pathNotFound: "Path not found: {path}",
587
+ fileRequired: "File is required: {path}",
588
+ directoryRequired: "Directory is required: {path}"
589
+ },
590
+ warnings: {
591
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
592
+ },
593
+ info: {
594
+ operationComplete: "Operation completed successfully",
595
+ filesProcessed: {
596
+ zero: "No files processed",
597
+ one: "{count} file processed",
598
+ other: "{count} files processed"
599
+ }
600
+ }
601
+ }
602
+ };
603
+ var ro = {
604
+ toolCore: {
605
+ errors: {
606
+ internal: "Internal error: {message}",
607
+ fileNotFound: "File not found: {path}",
608
+ fileReadFailed: "Failed to read file: {path}",
609
+ fileWriteFailed: "Failed to write file: {path}",
610
+ directoryNotFound: "Directory not found: {path}",
611
+ invalidPath: "{path} is not a valid path",
612
+ operationCanceled: "Operation was canceled",
613
+ invalidParameter: "Invalid parameter: {parameter}"
614
+ },
615
+ progress: {
616
+ copying: "Copying files...",
617
+ building: "Building project...",
618
+ packaging: "Creating package...",
619
+ validating: "Validating...",
620
+ analyzing: "Analyzing...",
621
+ restoring: "Restoring dependencies..."
622
+ },
623
+ validation: {
624
+ requiredField: "{field} is required",
625
+ invalidValue: "Invalid value for {field}",
626
+ pathNotFound: "Path not found: {path}",
627
+ fileRequired: "File is required: {path}",
628
+ directoryRequired: "Directory is required: {path}"
629
+ },
630
+ warnings: {
631
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
632
+ },
633
+ info: {
634
+ operationComplete: "Operation completed successfully",
635
+ filesProcessed: {
636
+ zero: "No files processed",
637
+ one: "{count} file processed",
638
+ other: "{count} files processed"
639
+ }
640
+ }
641
+ }
642
+ };
643
+ var ru = {
644
+ toolCore: {
645
+ errors: {
646
+ internal: "Internal error: {message}",
647
+ fileNotFound: "File not found: {path}",
648
+ fileReadFailed: "Failed to read file: {path}",
649
+ fileWriteFailed: "Failed to write file: {path}",
650
+ directoryNotFound: "Directory not found: {path}",
651
+ invalidPath: "{path} is not a valid path",
652
+ operationCanceled: "Operation was canceled",
653
+ invalidParameter: "Invalid parameter: {parameter}"
654
+ },
655
+ progress: {
656
+ copying: "Copying files...",
657
+ building: "Building project...",
658
+ packaging: "Creating package...",
659
+ validating: "Validating...",
660
+ analyzing: "Analyzing...",
661
+ restoring: "Restoring dependencies..."
662
+ },
663
+ validation: {
664
+ requiredField: "{field} is required",
665
+ invalidValue: "Invalid value for {field}",
666
+ pathNotFound: "Path not found: {path}",
667
+ fileRequired: "File is required: {path}",
668
+ directoryRequired: "Directory is required: {path}"
669
+ },
670
+ warnings: {
671
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
672
+ },
673
+ info: {
674
+ operationComplete: "Operation completed successfully",
675
+ filesProcessed: {
676
+ zero: "No files processed",
677
+ one: "{count} file processed",
678
+ other: "{count} files processed"
679
+ }
680
+ }
681
+ }
682
+ };
683
+ var tr = {
684
+ toolCore: {
685
+ errors: {
686
+ internal: "Internal error: {message}",
687
+ fileNotFound: "File not found: {path}",
688
+ fileReadFailed: "Failed to read file: {path}",
689
+ fileWriteFailed: "Failed to write file: {path}",
690
+ directoryNotFound: "Directory not found: {path}",
691
+ invalidPath: "{path} is not a valid path",
692
+ operationCanceled: "Operation was canceled",
693
+ invalidParameter: "Invalid parameter: {parameter}"
694
+ },
695
+ progress: {
696
+ copying: "Copying files...",
697
+ building: "Building project...",
698
+ packaging: "Creating package...",
699
+ validating: "Validating...",
700
+ analyzing: "Analyzing...",
701
+ restoring: "Restoring dependencies..."
702
+ },
703
+ validation: {
704
+ requiredField: "{field} is required",
705
+ invalidValue: "Invalid value for {field}",
706
+ pathNotFound: "Path not found: {path}",
707
+ fileRequired: "File is required: {path}",
708
+ directoryRequired: "Directory is required: {path}"
709
+ },
710
+ warnings: {
711
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
712
+ },
713
+ info: {
714
+ operationComplete: "Operation completed successfully",
715
+ filesProcessed: {
716
+ zero: "No files processed",
717
+ one: "{count} file processed",
718
+ other: "{count} files processed"
719
+ }
720
+ }
721
+ }
722
+ };
723
+ var zh_CN = {
724
+ toolCore: {
725
+ errors: {
726
+ internal: "Internal error: {message}",
727
+ fileNotFound: "File not found: {path}",
728
+ fileReadFailed: "Failed to read file: {path}",
729
+ fileWriteFailed: "Failed to write file: {path}",
730
+ directoryNotFound: "Directory not found: {path}",
731
+ invalidPath: "{path} is not a valid path",
732
+ operationCanceled: "Operation was canceled",
733
+ invalidParameter: "Invalid parameter: {parameter}"
734
+ },
735
+ progress: {
736
+ copying: "Copying files...",
737
+ building: "Building project...",
738
+ packaging: "Creating package...",
739
+ validating: "Validating...",
740
+ analyzing: "Analyzing...",
741
+ restoring: "Restoring dependencies..."
742
+ },
743
+ validation: {
744
+ requiredField: "{field} is required",
745
+ invalidValue: "Invalid value for {field}",
746
+ pathNotFound: "Path not found: {path}",
747
+ fileRequired: "File is required: {path}",
748
+ directoryRequired: "Directory is required: {path}"
749
+ },
750
+ warnings: {
751
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
752
+ },
753
+ info: {
754
+ operationComplete: "Operation completed successfully",
755
+ filesProcessed: {
756
+ zero: "No files processed",
757
+ one: "{count} file processed",
758
+ other: "{count} files processed"
759
+ }
760
+ }
761
+ }
762
+ };
763
+ var zh_TW = {
764
+ toolCore: {
765
+ errors: {
766
+ internal: "Internal error: {message}",
767
+ fileNotFound: "File not found: {path}",
768
+ fileReadFailed: "Failed to read file: {path}",
769
+ fileWriteFailed: "Failed to write file: {path}",
770
+ directoryNotFound: "Directory not found: {path}",
771
+ invalidPath: "{path} is not a valid path",
772
+ operationCanceled: "Operation was canceled",
773
+ invalidParameter: "Invalid parameter: {parameter}"
774
+ },
775
+ progress: {
776
+ copying: "Copying files...",
777
+ building: "Building project...",
778
+ packaging: "Creating package...",
779
+ validating: "Validating...",
780
+ analyzing: "Analyzing...",
781
+ restoring: "Restoring dependencies..."
782
+ },
783
+ validation: {
784
+ requiredField: "{field} is required",
785
+ invalidValue: "Invalid value for {field}",
786
+ pathNotFound: "Path not found: {path}",
787
+ fileRequired: "File is required: {path}",
788
+ directoryRequired: "Directory is required: {path}"
789
+ },
790
+ warnings: {
791
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
792
+ },
793
+ info: {
794
+ operationComplete: "Operation completed successfully",
795
+ filesProcessed: {
796
+ zero: "No files processed",
797
+ one: "{count} file processed",
798
+ other: "{count} files processed"
799
+ }
800
+ }
801
+ }
802
+ };
803
+ var zu = {
804
+ toolCore: {
805
+ errors: {
806
+ internal: "Internal error: {message}",
807
+ fileNotFound: "File not found: {path}",
808
+ fileReadFailed: "Failed to read file: {path}",
809
+ fileWriteFailed: "Failed to write file: {path}",
810
+ directoryNotFound: "Directory not found: {path}",
811
+ invalidPath: "{path} is not a valid path",
812
+ operationCanceled: "Operation was canceled",
813
+ invalidParameter: "Invalid parameter: {parameter}"
814
+ },
815
+ progress: {
816
+ copying: "Copying files...",
817
+ building: "Building project...",
818
+ packaging: "Creating package...",
819
+ validating: "Validating...",
820
+ analyzing: "Analyzing...",
821
+ restoring: "Restoring dependencies..."
822
+ },
823
+ validation: {
824
+ requiredField: "{field} is required",
825
+ invalidValue: "Invalid value for {field}",
826
+ pathNotFound: "Path not found: {path}",
827
+ fileRequired: "File is required: {path}",
828
+ directoryRequired: "Directory is required: {path}"
829
+ },
830
+ warnings: {
831
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
832
+ },
833
+ info: {
834
+ operationComplete: "Operation completed successfully",
835
+ filesProcessed: {
836
+ zero: "No files processed",
837
+ one: "{count} file processed",
838
+ other: "{count} files processed"
839
+ }
840
+ }
841
+ }
842
+ };
843
+
844
+ class TranslationService {
845
+ static instance;
846
+ currentLocale = "en";
847
+ constructor() {}
848
+ static getInstance() {
849
+ if (!TranslationService.instance) {
850
+ TranslationService.instance = new TranslationService;
851
+ }
852
+ return TranslationService.instance;
853
+ }
854
+ setLocale(locale) {
855
+ this.currentLocale = I18nManager.setLocale(locale);
856
+ }
857
+ getLocale() {
858
+ return this.currentLocale;
859
+ }
860
+ t(key, params) {
861
+ return I18nManager.t(key, params, this.currentLocale);
862
+ }
863
+ tLocale(key, locale, params) {
864
+ return I18nManager.t(key, params, locale);
865
+ }
866
+ has(key) {
867
+ return I18nManager.has(key, this.currentLocale);
868
+ }
869
+ getAvailableLocales() {
870
+ return I18nManager.getAvailableLocales();
871
+ }
872
+ }
873
+ var translate = TranslationService.getInstance();
874
+ I18nManager.registerTranslations("en", en);
875
+ I18nManager.registerTranslations("de", de);
876
+ I18nManager.registerTranslations("es", es);
877
+ I18nManager.registerTranslations("es-mx", es_MX);
878
+ I18nManager.registerTranslations("fr", fr);
879
+ I18nManager.registerTranslations("ja", ja);
880
+ I18nManager.registerTranslations("ko", ko);
881
+ I18nManager.registerTranslations("pt", pt);
882
+ I18nManager.registerTranslations("pt-br", pt_BR);
883
+ I18nManager.registerTranslations("ro", ro);
884
+ I18nManager.registerTranslations("ru", ru);
885
+ I18nManager.registerTranslations("tr", tr);
886
+ I18nManager.registerTranslations("zh-cn", zh_CN);
887
+ I18nManager.registerTranslations("zh-tw", zh_TW);
888
+ I18nManager.registerTranslations("zu", zu);
889
+ I18nManager.setLocale("en");
890
+ var BuildConfiguration;
891
+ ((BuildConfiguration2) => {
892
+ BuildConfiguration2["Debug"] = "Debug";
893
+ BuildConfiguration2["Release"] = "Release";
894
+ })(BuildConfiguration ||= {});
895
+ var LogLevel;
896
+ ((LogLevel2) => {
897
+ LogLevel2["Debug"] = "Debug";
898
+ LogLevel2["Info"] = "Information";
899
+ LogLevel2["Warn"] = "Warning";
900
+ LogLevel2["Error"] = "Error";
901
+ })(LogLevel ||= {});
902
+ var ProjectTypes;
903
+ ((ProjectTypes2) => {
904
+ ProjectTypes2["Agent"] = "Agent";
905
+ ProjectTypes2["Api"] = "Api";
906
+ ProjectTypes2["Connector"] = "Connector";
907
+ ProjectTypes2["CaseManagement"] = "CaseManagement";
908
+ ProjectTypes2["Flow"] = "Flow";
909
+ ProjectTypes2["Function"] = "Function";
910
+ ProjectTypes2["ProcessOrchestration"] = "ProcessOrchestration";
911
+ ProjectTypes2["Process"] = "Process";
912
+ ProjectTypes2["Library"] = "Library";
913
+ ProjectTypes2["WebApp"] = "WebApp";
914
+ ProjectTypes2["Tests"] = "Tests";
915
+ ProjectTypes2["AppV2"] = "AppV2";
916
+ })(ProjectTypes ||= {});
917
+ var TargetFramework;
918
+ ((TargetFramework2) => {
919
+ TargetFramework2["Portable"] = "Portable";
920
+ TargetFramework2["Windows"] = "Windows";
921
+ })(TargetFramework ||= {});
922
+ var ToolErrorCodes;
923
+ ((ToolErrorCodes2) => {
924
+ ToolErrorCodes2["Success"] = "SUCCESS";
925
+ ToolErrorCodes2["InternalError"] = "INTERNAL_ERROR";
926
+ ToolErrorCodes2["Canceled"] = "CANCELED";
927
+ })(ToolErrorCodes ||= {});
928
+
929
+ class ToolResult {
930
+ errorCode;
931
+ message;
932
+ packages;
933
+ constructor(errorCode, message, packages = []) {
934
+ this.errorCode = errorCode;
935
+ this.message = message;
936
+ this.packages = packages;
937
+ }
938
+ get isSuccess() {
939
+ return this.errorCode === "SUCCESS";
940
+ }
941
+ static success() {
942
+ return new ToolResult("SUCCESS");
943
+ }
944
+ static error(errorCode, message) {
945
+ return new ToolResult(errorCode, message);
946
+ }
947
+ }
948
+ class ProjectTool {
949
+ fileSystem;
950
+ logger;
951
+ static ProjectFileName = "project.uiproj";
952
+ constructor(fileSystem, logger) {
953
+ this.fileSystem = fileSystem;
954
+ this.logger = logger;
955
+ }
956
+ async restoreAsync(_options, _cancellationToken) {
957
+ this.logger.info("Restore operation is a noop");
958
+ return ToolResult.success();
959
+ }
960
+ async validateAsync(_options, _cancellationToken) {
961
+ this.logger.info("Validate operation is a noop");
962
+ return ToolResult.success();
963
+ }
964
+ async buildAsync(_options, _cancellationToken) {
965
+ this.logger.info("Build operation is a noop");
966
+ return ToolResult.success();
967
+ }
968
+ async packAsync(_options, _cancellationToken) {
969
+ this.logger.info("Pack operation is a noop");
970
+ return ToolResult.success();
971
+ }
972
+ async getUiProjectAsync(projectPath) {
973
+ const filePath = Path.join(projectPath, ProjectTool.ProjectFileName);
974
+ if (!await this.fileSystem.exists(filePath)) {
975
+ return;
976
+ }
977
+ const raw = await this.fileSystem.readFile(filePath);
978
+ if (!raw) {
979
+ return;
980
+ }
981
+ const json = typeof raw === "string" ? raw : new TextDecoder("utf-8").decode(raw);
982
+ return JSON.parse(json);
983
+ }
984
+ async dispose() {}
985
+ }
986
+ class ToolsFactoryRepository {
987
+ projectFactoryMap = new Map;
988
+ solutionFactory = null;
989
+ registerProjectToolFactory(factory) {
990
+ for (const type of factory.supportedTypes) {
991
+ if (this.projectFactoryMap.has(type)) {
992
+ console.warn(`Tool factory already registered for project type '${type}', skipping.`);
993
+ continue;
994
+ }
995
+ this.projectFactoryMap.set(type, factory);
996
+ }
997
+ }
998
+ registerSolutionToolFactory(factory) {
999
+ this.solutionFactory = factory;
1000
+ }
1001
+ getSolutionToolFactory() {
1002
+ if (!this.solutionFactory) {
1003
+ throw new Error("No solution tool factory is registered");
1004
+ }
1005
+ return this.solutionFactory;
1006
+ }
1007
+ canHandleProject(projectType) {
1008
+ return this.projectFactoryMap.has(projectType);
1009
+ }
1010
+ getProjectToolFactory(projectType) {
1011
+ const factory = this.projectFactoryMap.get(projectType);
1012
+ if (!factory) {
1013
+ throw new Error(`No tool factory found for project type '${projectType}'`);
1014
+ }
1015
+ return factory;
1016
+ }
1017
+ reset() {
1018
+ this.projectFactoryMap.clear();
1019
+ this.solutionFactory = null;
1020
+ }
1021
+ }
1022
+ var REGISTRY_KEY = Symbol.for("@uipath/solutionpackager-tool-core/toolsFactoryRepository");
1023
+ var _global = globalThis;
1024
+ if (!_global[REGISTRY_KEY]) {
1025
+ _global[REGISTRY_KEY] = new ToolsFactoryRepository;
1026
+ }
1027
+ var toolsFactoryRepository = _global[REGISTRY_KEY];
1028
+
1
1029
  // node_modules/@uipath/tool-workflowcompiler/dist/index.js
2
- import { I18nManager, LogLevel, ProjectTool, ProjectTypes, TemporaryStorageService, ToolErrorCodes, ToolResult, toolsFactoryRepository, translate } from "@uipath/solutionpackager-tool-core";
3
1030
  import { execFileSync, spawn } from "child_process";
4
1031
  import { homedir, platform } from "os";
5
1032
  import { join } from "path";
6
1033
  var de_namespaceObject = JSON.parse('{"toolWorkflowcompiler":{"lifecycle":{"started":"[WorkflowCompiler] {operation} started","command":"[WorkflowCompiler] Command: {command}","completed":"[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}","cancelled":"[WorkflowCompiler] Operation cancelled"},"errors":{"processExited":"Process exited with code {exitCode}","failed":"[WorkflowCompiler] {operation} failed: {errorMessage}","processError":"[WorkflowCompiler] Process error: {message}","startFailed":"Failed to start workflow compiler: {message}","operationCancelled":"Operation cancelled"},"pathResolver":{"info":{"usingCached":"[PathResolver] Using cached compiler path: {path}","usingExplicitPath":"[PathResolver] Using explicit compiler path: {path}","resolving":"[PathResolver] Resolving workflow compiler path...","checkingEnvVar":"[PathResolver] Checking environment variable location: {path}","foundViaEnv":"[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION","checkingNuGetCache":"[PathResolver] Checking NuGet cache: {path}","foundInNuGetCache":"[PathResolver] Found compiler in NuGet cache","notFoundStartingInstall":"[PathResolver] Compiler not found, starting dotnet restore...","restoringPackage":"[PathResolver] Restoring NuGet package \\"{packageName}\\" v{version} for platform \\"{platform}\\" via dotnet restore...","runningDotnetRestore":"[PathResolver] Running dotnet restore...","restoreCompleted":"[PathResolver] dotnet restore completed","installCompleted":"[PathResolver] Compiler restored successfully","cleaningUp":"[PathResolver] Cleaning up temp directory","resolved":"[PathResolver] Compiler resolved at: {path}"},"errors":{"unsupportedPlatform":"Unsupported platform: {platform}","compilerNotFoundAfterRestore":"Compiler not found in NuGet cache after dotnet restore.","dotnetRestoreFailed":"dotnet restore failed: {details}"}}}}');
7
- var en = {
1034
+ var en2 = {
8
1035
  toolWorkflowcompiler: {
9
1036
  lifecycle: {
10
1037
  started: "[WorkflowCompiler] {operation} started",
@@ -57,7 +1084,7 @@ var tr_namespaceObject = JSON.parse('{"toolWorkflowcompiler":{"lifecycle":{"star
57
1084
  var zh_CN_namespaceObject = JSON.parse('{"toolWorkflowcompiler":{"lifecycle":{"started":"[WorkflowCompiler] {operation} started","command":"[WorkflowCompiler] Command: {command}","completed":"[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}","cancelled":"[WorkflowCompiler] Operation cancelled"},"errors":{"processExited":"Process exited with code {exitCode}","failed":"[WorkflowCompiler] {operation} failed: {errorMessage}","processError":"[WorkflowCompiler] Process error: {message}","startFailed":"Failed to start workflow compiler: {message}","operationCancelled":"Operation cancelled"},"pathResolver":{"info":{"usingCached":"[PathResolver] Using cached compiler path: {path}","usingExplicitPath":"[PathResolver] Using explicit compiler path: {path}","resolving":"[PathResolver] Resolving workflow compiler path...","checkingEnvVar":"[PathResolver] Checking environment variable location: {path}","foundViaEnv":"[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION","checkingNuGetCache":"[PathResolver] Checking NuGet cache: {path}","foundInNuGetCache":"[PathResolver] Found compiler in NuGet cache","notFoundStartingInstall":"[PathResolver] Compiler not found, starting dotnet restore...","restoringPackage":"[PathResolver] Restoring NuGet package \\"{packageName}\\" v{version} for platform \\"{platform}\\" via dotnet restore...","runningDotnetRestore":"[PathResolver] Running dotnet restore...","restoreCompleted":"[PathResolver] dotnet restore completed","installCompleted":"[PathResolver] Compiler restored successfully","cleaningUp":"[PathResolver] Cleaning up temp directory","resolved":"[PathResolver] Compiler resolved at: {path}"},"errors":{"unsupportedPlatform":"Unsupported platform: {platform}","compilerNotFoundAfterRestore":"Compiler not found in NuGet cache after dotnet restore.","dotnetRestoreFailed":"dotnet restore failed: {details}"}}}}');
58
1085
  var zh_TW_namespaceObject = JSON.parse('{"toolWorkflowcompiler":{"lifecycle":{"started":"[WorkflowCompiler] {operation} started","command":"[WorkflowCompiler] Command: {command}","completed":"[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}","cancelled":"[WorkflowCompiler] Operation cancelled"},"errors":{"processExited":"Process exited with code {exitCode}","failed":"[WorkflowCompiler] {operation} failed: {errorMessage}","processError":"[WorkflowCompiler] Process error: {message}","startFailed":"Failed to start workflow compiler: {message}","operationCancelled":"Operation cancelled"},"pathResolver":{"info":{"usingCached":"[PathResolver] Using cached compiler path: {path}","usingExplicitPath":"[PathResolver] Using explicit compiler path: {path}","resolving":"[PathResolver] Resolving workflow compiler path...","checkingEnvVar":"[PathResolver] Checking environment variable location: {path}","foundViaEnv":"[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION","checkingNuGetCache":"[PathResolver] Checking NuGet cache: {path}","foundInNuGetCache":"[PathResolver] Found compiler in NuGet cache","notFoundStartingInstall":"[PathResolver] Compiler not found, starting dotnet restore...","restoringPackage":"[PathResolver] Restoring NuGet package \\"{packageName}\\" v{version} for platform \\"{platform}\\" via dotnet restore...","runningDotnetRestore":"[PathResolver] Running dotnet restore...","restoreCompleted":"[PathResolver] dotnet restore completed","installCompleted":"[PathResolver] Compiler restored successfully","cleaningUp":"[PathResolver] Cleaning up temp directory","resolved":"[PathResolver] Compiler resolved at: {path}"},"errors":{"unsupportedPlatform":"Unsupported platform: {platform}","compilerNotFoundAfterRestore":"Compiler not found in NuGet cache after dotnet restore.","dotnetRestoreFailed":"dotnet restore failed: {details}"}}}}');
59
1086
  var zu_namespaceObject = JSON.parse('{"toolWorkflowcompiler":{"lifecycle":{"started":"[WorkflowCompiler] {operation} started","command":"[WorkflowCompiler] Command: {command}","completed":"[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}","cancelled":"[WorkflowCompiler] Operation cancelled"},"errors":{"processExited":"Process exited with code {exitCode}","failed":"[WorkflowCompiler] {operation} failed: {errorMessage}","processError":"[WorkflowCompiler] Process error: {message}","startFailed":"Failed to start workflow compiler: {message}","operationCancelled":"Operation cancelled"},"pathResolver":{"info":{"usingCached":"[PathResolver] Using cached compiler path: {path}","usingExplicitPath":"[PathResolver] Using explicit compiler path: {path}","resolving":"[PathResolver] Resolving workflow compiler path...","checkingEnvVar":"[PathResolver] Checking environment variable location: {path}","foundViaEnv":"[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION","checkingNuGetCache":"[PathResolver] Checking NuGet cache: {path}","foundInNuGetCache":"[PathResolver] Found compiler in NuGet cache","notFoundStartingInstall":"[PathResolver] Compiler not found, starting dotnet restore...","restoringPackage":"[PathResolver] Restoring NuGet package \\"{packageName}\\" v{version} for platform \\"{platform}\\" via dotnet restore...","runningDotnetRestore":"[PathResolver] Running dotnet restore...","restoreCompleted":"[PathResolver] dotnet restore completed","installCompleted":"[PathResolver] Compiler restored successfully","cleaningUp":"[PathResolver] Cleaning up temp directory","resolved":"[PathResolver] Compiler resolved at: {path}"},"errors":{"unsupportedPlatform":"Unsupported platform: {platform}","compilerNotFoundAfterRestore":"Compiler not found in NuGet cache after dotnet restore.","dotnetRestoreFailed":"dotnet restore failed: {details}"}}}}');
60
- I18nManager.registerTranslations("en", en);
1087
+ I18nManager.registerTranslations("en", en2);
61
1088
  I18nManager.registerTranslations("de", de_namespaceObject);
62
1089
  I18nManager.registerTranslations("es", es_namespaceObject);
63
1090
  I18nManager.registerTranslations("es-MX", es_MX_namespaceObject);
package/dist/tool.js CHANGED
@@ -61025,7 +61025,7 @@ var {
61025
61025
  // package.json
61026
61026
  var package_default = {
61027
61027
  name: "@uipath/rpa-tool",
61028
- version: "0.9.3",
61028
+ version: "0.9.4",
61029
61029
  description: "Tool for creating and managing UiPath RPA projects",
61030
61030
  keywords: [
61031
61031
  "uipcli-tool",
@@ -61058,7 +61058,7 @@ var package_default = {
61058
61058
  registry: "https://npm.pkg.github.com"
61059
61059
  },
61060
61060
  scripts: {
61061
- build: "bunx tsc --noEmit && bun build ./src/packager-tool.ts --outdir dist --format esm --target node --external @uipath/solutionpackager-tool-core && bun build ./src/tool.ts --outdir dist --format esm --target node --external '*/packager-tool.js' --external applicationinsights && bun build ./src/index.ts --outdir dist --format esm --target node --external '*/tool.js' --external applicationinsights",
61061
+ build: "bunx tsc --noEmit && bun build ./src/packager-tool.ts --outdir dist --format esm --target node && bun build ./src/tool.ts --outdir dist --format esm --target node --external '*/packager-tool.js' --external applicationinsights && bun build ./src/index.ts --outdir dist --format esm --target node --external '*/tool.js' --external applicationinsights",
61062
61062
  package: "bun run build && bun pm pack",
61063
61063
  "generate-docs": "bun run scripts/generate-docs.ts",
61064
61064
  "bump-uipath-alpha": "bun run scripts/bump-uipath-alpha.ts",
@@ -61894,7 +61894,7 @@ class WorkflowCompilerToolFactory {
61894
61894
  toolsFactoryRepository.registerProjectToolFactory(new WorkflowCompilerToolFactory);
61895
61895
 
61896
61896
  // src/resolution/helm-config.ts
61897
- var DEFAULT_HELM_VERSION = "0.9.3";
61897
+ var DEFAULT_HELM_VERSION = "0.9.4";
61898
61898
  var helmConfig = {
61899
61899
  helmVersion: DEFAULT_HELM_VERSION
61900
61900
  };
@@ -64366,9 +64366,17 @@ function writeCache(path4, entry, deps) {
64366
64366
 
64367
64367
  // src/external-cli/forward.ts
64368
64368
  import { spawn as spawn5 } from "node:child_process";
64369
- function spawnForward(exePath, args) {
64369
+ function mergeEnv(extra) {
64370
+ if (!extra)
64371
+ return;
64372
+ return { ...process.env, ...extra };
64373
+ }
64374
+ function spawnForward(exePath, args, env) {
64370
64375
  return new Promise((resolve5, reject) => {
64371
- const child = spawn5(exePath, args, { stdio: "inherit" });
64376
+ const child = spawn5(exePath, args, {
64377
+ stdio: "inherit",
64378
+ env: mergeEnv(env)
64379
+ });
64372
64380
  child.on("error", (err2) => {
64373
64381
  reject(new Error(`Failed to spawn '${exePath}': ${err2.message}`));
64374
64382
  });
@@ -64377,10 +64385,11 @@ function spawnForward(exePath, args) {
64377
64385
  });
64378
64386
  });
64379
64387
  }
64380
- function spawnCapture(exePath, args) {
64388
+ function spawnCapture(exePath, args, env) {
64381
64389
  return new Promise((resolve5, reject) => {
64382
64390
  const child = spawn5(exePath, args, {
64383
- stdio: ["inherit", "pipe", "pipe"]
64391
+ stdio: ["inherit", "pipe", "pipe"],
64392
+ env: mergeEnv(env)
64384
64393
  });
64385
64394
  const stdoutChunks = [];
64386
64395
  const stderrChunks = [];
@@ -64410,6 +64419,37 @@ var defaultDeps3 = {
64410
64419
  fileExists: existsSync9,
64411
64420
  readFile: (path4) => readFileSync4(path4, "utf-8")
64412
64421
  };
64422
+ function getCurrentPlatformKey() {
64423
+ let osSegment;
64424
+ switch (process.platform) {
64425
+ case "win32":
64426
+ osSegment = "win";
64427
+ break;
64428
+ case "darwin":
64429
+ osSegment = "osx";
64430
+ break;
64431
+ case "linux":
64432
+ osSegment = "linux";
64433
+ break;
64434
+ default:
64435
+ osSegment = process.platform;
64436
+ }
64437
+ return `${osSegment}-${process.arch}`;
64438
+ }
64439
+ function resolveExecutableRelativePath(manifest, manifestPath, platformKey) {
64440
+ const { executable, executables } = manifest.tool;
64441
+ if (executables) {
64442
+ const match = executables[platformKey];
64443
+ if (!match) {
64444
+ const supported = Object.keys(executables).sort().join(", ");
64445
+ throw new Error(`No executable declared for platform '${platformKey}' in ${manifestPath}. ` + `Supported platforms: ${supported || "(none)"}.`);
64446
+ }
64447
+ return match;
64448
+ }
64449
+ if (executable)
64450
+ return executable;
64451
+ throw new Error(`Manifest ${manifestPath} declares neither 'tool.executable' nor 'tool.executables'.`);
64452
+ }
64413
64453
  function readCliManifest(packageRoot, deps = defaultDeps3) {
64414
64454
  const manifestPath = join14(packageRoot, MANIFEST_FILENAME);
64415
64455
  if (!deps.fileExists(manifestPath)) {
@@ -64424,7 +64464,9 @@ function readCliManifest(packageRoot, deps = defaultDeps3) {
64424
64464
  if (manifest.manifestVersion !== 1) {
64425
64465
  throw new Error(`Unsupported manifest version ${manifest.manifestVersion} in ${manifestPath}. Expected 1.`);
64426
64466
  }
64427
- const exePath = join14(packageRoot, manifest.tool.executable);
64467
+ const platformKey = (deps.getPlatformKey ?? getCurrentPlatformKey)();
64468
+ const relExe = resolveExecutableRelativePath(manifest, manifestPath, platformKey);
64469
+ const exePath = join14(packageRoot, relExe);
64428
64470
  if (!deps.fileExists(exePath)) {
64429
64471
  throw new Error(`Executable not found at ${exePath} as declared in ${manifestPath}.`);
64430
64472
  }
@@ -64432,8 +64474,8 @@ function readCliManifest(packageRoot, deps = defaultDeps3) {
64432
64474
  }
64433
64475
 
64434
64476
  // src/external-cli/register-cli-commands.ts
64435
- function registerExternalCliCommands(program3, projectDir, config2, deps, session, defaultFormat) {
64436
- const resolvedDeps = resolveDeps(projectDir, config2, deps, session);
64477
+ function registerExternalCliCommands(program3, projectDir, config2, deps, session, defaultFormat, runtime) {
64478
+ const resolvedDeps = resolveDeps(projectDir, config2, deps, session, runtime);
64437
64479
  const group = program3.command(config2.commandName).description(config2.description);
64438
64480
  let exePath;
64439
64481
  let manifest;
@@ -64506,17 +64548,18 @@ function registerCommand(parent, exePath, projectDir, cmd, config2, deps, comman
64506
64548
  throw new Error(`Command '${currentPath.join(" ")}' does not support --format.`);
64507
64549
  }
64508
64550
  const run = async () => {
64551
+ const env = deps.resolveEnv?.();
64509
64552
  if (supportsFormat) {
64510
64553
  const { format: _stripped, ...forwardOpts } = opts;
64511
64554
  const args = buildArgs(currentPath, positionalValues, forwardOpts, cmd, config2, effectiveProjectDir, "json");
64512
- const result = await deps.spawnCapture(exePath, args);
64555
+ const result = await deps.spawnCapture(exePath, args, env);
64513
64556
  renderCapturedOutput(result);
64514
64557
  if (result.exitCode !== 0) {
64515
64558
  processContext.exit(result.exitCode);
64516
64559
  }
64517
64560
  } else {
64518
64561
  const args = buildArgs(currentPath, positionalValues, opts, cmd, config2, effectiveProjectDir);
64519
- const exitCode = await deps.spawnForward(exePath, args);
64562
+ const exitCode = await deps.spawnForward(exePath, args, env);
64520
64563
  if (exitCode !== 0) {
64521
64564
  processContext.exit(exitCode);
64522
64565
  }
@@ -64644,7 +64687,7 @@ function renderCapturedOutput(captured) {
64644
64687
  OutputFormatter.error(new FailureOutput(envelope.Result || "Failure", envelope.Message ?? "Unknown error from external CLI", envelope.Instructions ?? "Check external CLI logs for details."));
64645
64688
  }
64646
64689
  }
64647
- function resolveDeps(_projectDir, config2, partial2, session) {
64690
+ function resolveDeps(_projectDir, config2, partial2, session, runtime) {
64648
64691
  return {
64649
64692
  discover: partial2?.discover ?? ((dir) => {
64650
64693
  const packageRoot = discoverPackageRootCached({
@@ -64658,7 +64701,23 @@ function resolveDeps(_projectDir, config2, partial2, session) {
64658
64701
  spawnCapture: partial2?.spawnCapture ?? spawnCapture,
64659
64702
  openProject: partial2?.openProject ?? (session ? (dir, operation) => session.execute(async () => {
64660
64703
  await operation();
64661
- }, { projectDir: dir, backend: "helm" /* Helm */ }) : undefined)
64704
+ }, { projectDir: dir, backend: "helm" /* Helm */ }) : undefined),
64705
+ resolveEnv: partial2?.resolveEnv ?? buildBundledDotnetEnvResolver(runtime)
64706
+ };
64707
+ }
64708
+ function buildBundledDotnetEnvResolver(runtime) {
64709
+ const resolverDeps = runtime?.resolverDeps;
64710
+ if (!resolverDeps)
64711
+ return;
64712
+ let cached3;
64713
+ let resolved = false;
64714
+ return () => {
64715
+ if (!resolved) {
64716
+ const robotDir = resolveRobotDir(runtime?.robotDir, resolverDeps);
64717
+ cached3 = resolveBundledDotnet(robotDir, resolverDeps)?.env;
64718
+ resolved = true;
64719
+ }
64720
+ return cached3;
64662
64721
  };
64663
64722
  }
64664
64723
 
@@ -67087,7 +67146,8 @@ var registerCommands = async (program3, options) => {
67087
67146
  registerAnalyzeCommand(program3);
67088
67147
  registerBuildCommand(program3);
67089
67148
  registerPackCommand(program3);
67090
- const session = createSession(resolved);
67149
+ const resolverDeps = buildResolverDeps(resolved);
67150
+ const session = createSession(resolved, resolverDeps);
67091
67151
  const format = extractArg(process.argv, "format");
67092
67152
  registerExternalCliCommands(program3, resolved.projectDir, {
67093
67153
  commandName: "uia",
@@ -67096,7 +67156,7 @@ var registerCommands = async (program3, options) => {
67096
67156
  minVersion: "26.4.1-preview",
67097
67157
  injectProjectDir: "project-dir",
67098
67158
  injectFormat: "format"
67099
- }, undefined, session, format);
67159
+ }, undefined, session, format, { resolverDeps, robotDir: resolved.robotDir });
67100
67160
  const toolProvider = resolveToolProvider(resolved, session);
67101
67161
  await registerMcpCommands(program3, toolProvider);
67102
67162
  const parentOptionDefs = [
@@ -67125,13 +67185,16 @@ Run 'start-studio' to start a Studio instance — ` + "additional commands may b
67125
67185
  process.exit(1);
67126
67186
  });
67127
67187
  };
67128
- function createSession(options) {
67129
- if (!options)
67130
- return;
67131
- const deps = options.verbose ? {
67188
+ function buildResolverDeps(options) {
67189
+ return options.verbose ? {
67132
67190
  ...defaultResolverDeps,
67133
67191
  log: (msg) => console.debug(`[rpa-tool] ${msg}`)
67134
67192
  } : defaultResolverDeps;
67193
+ }
67194
+ function createSession(options, deps) {
67195
+ if (!options)
67196
+ return;
67197
+ const resolverDeps = deps ?? buildResolverDeps(options);
67135
67198
  const timeoutMs = options.timeoutSeconds != null ? options.timeoutSeconds * 1000 : undefined;
67136
67199
  return new StudioSession({
67137
67200
  projectDir: options.projectDir,
@@ -67140,7 +67203,7 @@ function createSession(options) {
67140
67203
  useStudio: options.useStudio,
67141
67204
  hostStudioPid: options.hostStudioPid,
67142
67205
  timeoutMs
67143
- }, deps);
67206
+ }, resolverDeps);
67144
67207
  }
67145
67208
  function resolveToolProvider(options, session) {
67146
67209
  const localTools = new LocalToolProvider;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/rpa-tool",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "description": "Tool for creating and managing UiPath RPA projects",
5
5
  "keywords": [
6
6
  "uipcli-tool",
@@ -33,7 +33,7 @@
33
33
  "registry": "https://npm.pkg.github.com"
34
34
  },
35
35
  "scripts": {
36
- "build": "bunx tsc --noEmit && bun build ./src/packager-tool.ts --outdir dist --format esm --target node --external @uipath/solutionpackager-tool-core && bun build ./src/tool.ts --outdir dist --format esm --target node --external '*/packager-tool.js' --external applicationinsights && bun build ./src/index.ts --outdir dist --format esm --target node --external '*/tool.js' --external applicationinsights",
36
+ "build": "bunx tsc --noEmit && bun build ./src/packager-tool.ts --outdir dist --format esm --target node && bun build ./src/tool.ts --outdir dist --format esm --target node --external '*/packager-tool.js' --external applicationinsights && bun build ./src/index.ts --outdir dist --format esm --target node --external '*/tool.js' --external applicationinsights",
37
37
  "package": "bun run build && bun pm pack",
38
38
  "generate-docs": "bun run scripts/generate-docs.ts",
39
39
  "bump-uipath-alpha": "bun run scripts/bump-uipath-alpha.ts",