@uipath/function-tool 1.202.0 → 1.203.0-preview.160

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,660 +1,911 @@
1
+ import {
2
+ zipSync
3
+ } from "./packager-tool-b098y4a2.js";
1
4
  import {
2
5
  __require
3
- } from "./packager-tool-1bx83sw4.js";
6
+ } from "./packager-tool-1de529jm.js";
7
+ // ../packager/packager-core/src/i18n/types.ts
8
+ function isPluralForm(value) {
9
+ return typeof value === "object" && value !== null && "other" in value;
10
+ }
11
+ function selectPluralForm(forms, count) {
12
+ if (count === 0 && forms.zero !== undefined) {
13
+ return forms.zero;
14
+ }
15
+ if (count === 1 && forms.one !== undefined) {
16
+ return forms.one;
17
+ }
18
+ if (count === 2 && forms.two !== undefined) {
19
+ return forms.two;
20
+ }
21
+ if (forms.few !== undefined) {
22
+ const mod10 = count % 10;
23
+ const mod100 = count % 100;
24
+ if (mod10 >= 2 && mod10 <= 4 && (mod100 < 10 || mod100 >= 20)) {
25
+ return forms.few;
26
+ }
27
+ }
28
+ if (forms.many !== undefined) {
29
+ const mod10 = count % 10;
30
+ const mod100 = count % 100;
31
+ if (count === 0 || mod10 === 0 && mod100 !== 0 || mod10 >= 5 && mod10 <= 9 || mod100 >= 11 && mod100 <= 14) {
32
+ return forms.many;
33
+ }
34
+ }
35
+ return forms.other;
36
+ }
4
37
 
5
- // ../../node_modules/fflate/esm/index.mjs
6
- import { createRequire } from "module";
7
- var require2 = createRequire("/");
8
- var _a;
9
- var Worker;
10
- var isMarkedAsUntransferable;
11
- try {
12
- _a = require2("worker_threads"), Worker = _a.Worker, isMarkedAsUntransferable = _a.isMarkedAsUntransferable;
13
- } catch (e) {}
14
- var u8 = Uint8Array;
15
- var u16 = Uint16Array;
16
- var i32 = Int32Array;
17
- var fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0]);
18
- var fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0]);
19
- var clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
20
- var freb = function(eb, start) {
21
- var b = new u16(31);
22
- for (var i = 0;i < 31; ++i) {
23
- b[i] = start += 1 << eb[i - 1];
24
- }
25
- var r = new i32(b[30]);
26
- for (var i = 1;i < 30; ++i) {
27
- for (var j = b[i];j < b[i + 1]; ++j) {
28
- r[j] = j - b[i] << 5 | i;
29
- }
30
- }
31
- return { b, r };
32
- };
33
- var _a = freb(fleb, 2);
34
- var fl = _a.b;
35
- var revfl = _a.r;
36
- fl[28] = 258, revfl[258] = 28;
37
- var _b = freb(fdeb, 0);
38
- var fd = _b.b;
39
- var revfd = _b.r;
40
- var rev = new u16(32768);
41
- for (i = 0;i < 32768; ++i) {
42
- x = (i & 43690) >> 1 | (i & 21845) << 1;
43
- x = (x & 52428) >> 2 | (x & 13107) << 2;
44
- x = (x & 61680) >> 4 | (x & 3855) << 4;
45
- rev[i] = ((x & 65280) >> 8 | (x & 255) << 8) >> 1;
38
+ // ../packager/packager-core/src/i18n/i18n-manager.ts
39
+ class I18nManager {
40
+ static translations = {};
41
+ static currentLocale = "en";
42
+ static fallbackLocale = "en";
43
+ static registerTranslations(locale, catalog) {
44
+ if (!I18nManager.translations[locale]) {
45
+ I18nManager.translations[locale] = {};
46
+ }
47
+ I18nManager.translations[locale] = I18nManager.deepMerge(I18nManager.translations[locale], catalog);
48
+ }
49
+ static setLocale(locale) {
50
+ const normalized = I18nManager.normalizeLocale(locale);
51
+ if (I18nManager.translations[normalized]) {
52
+ I18nManager.currentLocale = normalized;
53
+ return normalized;
54
+ }
55
+ const baseLocale = normalized.split("-")[0];
56
+ if (baseLocale !== normalized && I18nManager.translations[baseLocale]) {
57
+ I18nManager.currentLocale = baseLocale;
58
+ return baseLocale;
59
+ }
60
+ return I18nManager.currentLocale;
61
+ }
62
+ static getLocale() {
63
+ return I18nManager.currentLocale;
64
+ }
65
+ static setFallbackLocale(locale) {
66
+ I18nManager.fallbackLocale = I18nManager.normalizeLocale(locale);
67
+ }
68
+ static t(key, params, locale) {
69
+ const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
70
+ let value = I18nManager.getTranslationValue(key, targetLocale);
71
+ if (value === undefined && targetLocale !== I18nManager.fallbackLocale) {
72
+ value = I18nManager.getTranslationValue(key, I18nManager.fallbackLocale);
73
+ }
74
+ if (value === undefined) {
75
+ return key;
76
+ }
77
+ if (isPluralForm(value) && params && "count" in params) {
78
+ const count = typeof params.count === "number" ? params.count : Number(params.count);
79
+ value = selectPluralForm(value, count);
80
+ } else if (isPluralForm(value)) {
81
+ value = value.other;
82
+ }
83
+ if (typeof value !== "string") {
84
+ return key;
85
+ }
86
+ return params ? I18nManager.interpolate(value, params) : value;
87
+ }
88
+ static has(key, locale) {
89
+ const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
90
+ const value = I18nManager.getTranslationValue(key, targetLocale);
91
+ if (value !== undefined) {
92
+ return true;
93
+ }
94
+ if (targetLocale !== I18nManager.fallbackLocale) {
95
+ return I18nManager.getTranslationValue(key, I18nManager.fallbackLocale) !== undefined;
96
+ }
97
+ return false;
98
+ }
99
+ static getAvailableLocales() {
100
+ return Object.keys(I18nManager.translations);
101
+ }
102
+ static clearTranslations() {
103
+ I18nManager.translations = {};
104
+ I18nManager.currentLocale = "en";
105
+ }
106
+ static getTranslationValue(key, locale) {
107
+ const catalog = I18nManager.translations[locale];
108
+ if (!catalog) {
109
+ return;
110
+ }
111
+ const keys = key.split(".");
112
+ let value = catalog;
113
+ for (const k of keys) {
114
+ if (value && typeof value === "object" && k in value) {
115
+ value = value[k];
116
+ } else {
117
+ return;
118
+ }
119
+ }
120
+ return value;
121
+ }
122
+ static interpolate(template, params) {
123
+ return template.replace(/\{(\w+)\}/g, (_, key) => {
124
+ const value = params[key];
125
+ return value !== undefined ? String(value) : `{${key}}`;
126
+ });
127
+ }
128
+ static normalizeLocale(locale) {
129
+ const normalized = locale.toLowerCase().replace(/_/g, "-");
130
+ const specialLocales = ["es-mx", "pt-br", "zh-cn", "zh-tw"];
131
+ if (specialLocales.includes(normalized)) {
132
+ return normalized;
133
+ }
134
+ return normalized.split("-")[0];
135
+ }
136
+ static deepMerge(target, source) {
137
+ const result = { ...target };
138
+ for (const key of Object.keys(source)) {
139
+ const sourceValue = source[key];
140
+ const targetValue = result[key];
141
+ if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue) && targetValue && typeof targetValue === "object" && !Array.isArray(targetValue)) {
142
+ result[key] = I18nManager.deepMerge(targetValue, sourceValue);
143
+ } else {
144
+ result[key] = sourceValue;
145
+ }
146
+ }
147
+ return result;
148
+ }
46
149
  }
47
- var x;
48
- var i;
49
- var hMap = function(cd, mb, r) {
50
- var s = cd.length;
51
- var i2 = 0;
52
- var l = new u16(mb);
53
- for (;i2 < s; ++i2) {
54
- if (cd[i2])
55
- ++l[cd[i2] - 1];
56
- }
57
- var le = new u16(mb);
58
- for (i2 = 1;i2 < mb; ++i2) {
59
- le[i2] = le[i2 - 1] + l[i2 - 1] << 1;
60
- }
61
- var co;
62
- if (r) {
63
- co = new u16(1 << mb);
64
- var rvb = 15 - mb;
65
- for (i2 = 0;i2 < s; ++i2) {
66
- if (cd[i2]) {
67
- var sv = i2 << 4 | cd[i2];
68
- var r_1 = mb - cd[i2];
69
- var v = le[cd[i2] - 1]++ << r_1;
70
- for (var m = v | (1 << r_1) - 1;v <= m; ++v) {
71
- co[rev[v] >> rvb] = sv;
72
- }
150
+
151
+ // ../packager/packager-core/src/i18n/locales/de.ts
152
+ var de = {
153
+ toolCore: {
154
+ errors: {
155
+ internal: "Internal error: {message}",
156
+ fileNotFound: "File not found: {path}",
157
+ fileReadFailed: "Failed to read file: {path}",
158
+ fileWriteFailed: "Failed to write file: {path}",
159
+ directoryNotFound: "Directory not found: {path}",
160
+ invalidPath: "{path} is not a valid path",
161
+ operationCanceled: "Operation was canceled",
162
+ invalidParameter: "Invalid parameter: {parameter}"
163
+ },
164
+ progress: {
165
+ copying: "Copying files...",
166
+ building: "Building project...",
167
+ packaging: "Creating package...",
168
+ validating: "Validating...",
169
+ analyzing: "Analyzing...",
170
+ restoring: "Restoring dependencies..."
171
+ },
172
+ validation: {
173
+ requiredField: "{field} is required",
174
+ invalidValue: "Invalid value for {field}",
175
+ pathNotFound: "Path not found: {path}",
176
+ fileRequired: "File is required: {path}",
177
+ directoryRequired: "Directory is required: {path}"
178
+ },
179
+ warnings: {
180
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
181
+ },
182
+ info: {
183
+ operationComplete: "Operation completed successfully",
184
+ filesProcessed: {
185
+ zero: "No files processed",
186
+ one: "{count} file processed",
187
+ other: "{count} files processed"
188
+ }
189
+ }
190
+ }
191
+ };
192
+
193
+ // ../packager/packager-core/src/i18n/locales/en.ts
194
+ var en = {
195
+ toolCore: {
196
+ errors: {
197
+ internal: "Internal error: {message}",
198
+ fileNotFound: "File not found: {path}",
199
+ fileReadFailed: "Failed to read file: {path}",
200
+ fileWriteFailed: "Failed to write file: {path}",
201
+ directoryNotFound: "Directory not found: {path}",
202
+ invalidPath: "{path} is not a valid path",
203
+ operationCanceled: "Operation was canceled",
204
+ invalidParameter: "Invalid parameter: {parameter}"
205
+ },
206
+ progress: {
207
+ copying: "Copying files...",
208
+ building: "Building project...",
209
+ packaging: "Creating package...",
210
+ validating: "Validating...",
211
+ analyzing: "Analyzing...",
212
+ restoring: "Restoring dependencies..."
213
+ },
214
+ validation: {
215
+ requiredField: "{field} is required",
216
+ invalidValue: "Invalid value for {field}",
217
+ pathNotFound: "Path not found: {path}",
218
+ fileRequired: "File is required: {path}",
219
+ directoryRequired: "Directory is required: {path}"
220
+ },
221
+ warnings: {
222
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
223
+ },
224
+ info: {
225
+ operationComplete: "Operation completed successfully",
226
+ filesProcessed: {
227
+ zero: "No files processed",
228
+ one: "{count} file processed",
229
+ other: "{count} files processed"
230
+ }
231
+ }
232
+ }
233
+ };
234
+
235
+ // ../packager/packager-core/src/i18n/locales/es.ts
236
+ var es = {
237
+ toolCore: {
238
+ errors: {
239
+ internal: "Internal error: {message}",
240
+ fileNotFound: "File not found: {path}",
241
+ fileReadFailed: "Failed to read file: {path}",
242
+ fileWriteFailed: "Failed to write file: {path}",
243
+ directoryNotFound: "Directory not found: {path}",
244
+ invalidPath: "{path} is not a valid path",
245
+ operationCanceled: "Operation was canceled",
246
+ invalidParameter: "Invalid parameter: {parameter}"
247
+ },
248
+ progress: {
249
+ copying: "Copying files...",
250
+ building: "Building project...",
251
+ packaging: "Creating package...",
252
+ validating: "Validating...",
253
+ analyzing: "Analyzing...",
254
+ restoring: "Restoring dependencies..."
255
+ },
256
+ validation: {
257
+ requiredField: "{field} is required",
258
+ invalidValue: "Invalid value for {field}",
259
+ pathNotFound: "Path not found: {path}",
260
+ fileRequired: "File is required: {path}",
261
+ directoryRequired: "Directory is required: {path}"
262
+ },
263
+ warnings: {
264
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
265
+ },
266
+ info: {
267
+ operationComplete: "Operation completed successfully",
268
+ filesProcessed: {
269
+ zero: "No files processed",
270
+ one: "{count} file processed",
271
+ other: "{count} files processed"
272
+ }
273
+ }
274
+ }
275
+ };
276
+
277
+ // ../packager/packager-core/src/i18n/locales/es-MX.ts
278
+ var es_MX = {
279
+ toolCore: {
280
+ errors: {
281
+ internal: "Internal error: {message}",
282
+ fileNotFound: "File not found: {path}",
283
+ fileReadFailed: "Failed to read file: {path}",
284
+ fileWriteFailed: "Failed to write file: {path}",
285
+ directoryNotFound: "Directory not found: {path}",
286
+ invalidPath: "{path} is not a valid path",
287
+ operationCanceled: "Operation was canceled",
288
+ invalidParameter: "Invalid parameter: {parameter}"
289
+ },
290
+ progress: {
291
+ copying: "Copying files...",
292
+ building: "Building project...",
293
+ packaging: "Creating package...",
294
+ validating: "Validating...",
295
+ analyzing: "Analyzing...",
296
+ restoring: "Restoring dependencies..."
297
+ },
298
+ validation: {
299
+ requiredField: "{field} is required",
300
+ invalidValue: "Invalid value for {field}",
301
+ pathNotFound: "Path not found: {path}",
302
+ fileRequired: "File is required: {path}",
303
+ directoryRequired: "Directory is required: {path}"
304
+ },
305
+ warnings: {
306
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
307
+ },
308
+ info: {
309
+ operationComplete: "Operation completed successfully",
310
+ filesProcessed: {
311
+ zero: "No files processed",
312
+ one: "{count} file processed",
313
+ other: "{count} files processed"
314
+ }
315
+ }
316
+ }
317
+ };
318
+
319
+ // ../packager/packager-core/src/i18n/locales/fr.ts
320
+ var fr = {
321
+ toolCore: {
322
+ errors: {
323
+ internal: "Internal error: {message}",
324
+ fileNotFound: "File not found: {path}",
325
+ fileReadFailed: "Failed to read file: {path}",
326
+ fileWriteFailed: "Failed to write file: {path}",
327
+ directoryNotFound: "Directory not found: {path}",
328
+ invalidPath: "{path} is not a valid path",
329
+ operationCanceled: "Operation was canceled",
330
+ invalidParameter: "Invalid parameter: {parameter}"
331
+ },
332
+ progress: {
333
+ copying: "Copying files...",
334
+ building: "Building project...",
335
+ packaging: "Creating package...",
336
+ validating: "Validating...",
337
+ analyzing: "Analyzing...",
338
+ restoring: "Restoring dependencies..."
339
+ },
340
+ validation: {
341
+ requiredField: "{field} is required",
342
+ invalidValue: "Invalid value for {field}",
343
+ pathNotFound: "Path not found: {path}",
344
+ fileRequired: "File is required: {path}",
345
+ directoryRequired: "Directory is required: {path}"
346
+ },
347
+ warnings: {
348
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
349
+ },
350
+ info: {
351
+ operationComplete: "Operation completed successfully",
352
+ filesProcessed: {
353
+ zero: "No files processed",
354
+ one: "{count} file processed",
355
+ other: "{count} files processed"
356
+ }
357
+ }
358
+ }
359
+ };
360
+
361
+ // ../packager/packager-core/src/i18n/locales/ja.ts
362
+ var ja = {
363
+ toolCore: {
364
+ errors: {
365
+ internal: "Internal error: {message}",
366
+ fileNotFound: "File not found: {path}",
367
+ fileReadFailed: "Failed to read file: {path}",
368
+ fileWriteFailed: "Failed to write file: {path}",
369
+ directoryNotFound: "Directory not found: {path}",
370
+ invalidPath: "{path} is not a valid path",
371
+ operationCanceled: "Operation was canceled",
372
+ invalidParameter: "Invalid parameter: {parameter}"
373
+ },
374
+ progress: {
375
+ copying: "Copying files...",
376
+ building: "Building project...",
377
+ packaging: "Creating package...",
378
+ validating: "Validating...",
379
+ analyzing: "Analyzing...",
380
+ restoring: "Restoring dependencies..."
381
+ },
382
+ validation: {
383
+ requiredField: "{field} is required",
384
+ invalidValue: "Invalid value for {field}",
385
+ pathNotFound: "Path not found: {path}",
386
+ fileRequired: "File is required: {path}",
387
+ directoryRequired: "Directory is required: {path}"
388
+ },
389
+ warnings: {
390
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
391
+ },
392
+ info: {
393
+ operationComplete: "Operation completed successfully",
394
+ filesProcessed: {
395
+ zero: "No files processed",
396
+ one: "{count} file processed",
397
+ other: "{count} files processed"
398
+ }
399
+ }
400
+ }
401
+ };
402
+
403
+ // ../packager/packager-core/src/i18n/locales/ko.ts
404
+ var ko = {
405
+ toolCore: {
406
+ errors: {
407
+ internal: "Internal error: {message}",
408
+ fileNotFound: "File not found: {path}",
409
+ fileReadFailed: "Failed to read file: {path}",
410
+ fileWriteFailed: "Failed to write file: {path}",
411
+ directoryNotFound: "Directory not found: {path}",
412
+ invalidPath: "{path} is not a valid path",
413
+ operationCanceled: "Operation was canceled",
414
+ invalidParameter: "Invalid parameter: {parameter}"
415
+ },
416
+ progress: {
417
+ copying: "Copying files...",
418
+ building: "Building project...",
419
+ packaging: "Creating package...",
420
+ validating: "Validating...",
421
+ analyzing: "Analyzing...",
422
+ restoring: "Restoring dependencies..."
423
+ },
424
+ validation: {
425
+ requiredField: "{field} is required",
426
+ invalidValue: "Invalid value for {field}",
427
+ pathNotFound: "Path not found: {path}",
428
+ fileRequired: "File is required: {path}",
429
+ directoryRequired: "Directory is required: {path}"
430
+ },
431
+ warnings: {
432
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
433
+ },
434
+ info: {
435
+ operationComplete: "Operation completed successfully",
436
+ filesProcessed: {
437
+ zero: "No files processed",
438
+ one: "{count} file processed",
439
+ other: "{count} files processed"
440
+ }
441
+ }
442
+ }
443
+ };
444
+
445
+ // ../packager/packager-core/src/i18n/locales/pt.ts
446
+ var pt = {
447
+ toolCore: {
448
+ errors: {
449
+ internal: "Internal error: {message}",
450
+ fileNotFound: "File not found: {path}",
451
+ fileReadFailed: "Failed to read file: {path}",
452
+ fileWriteFailed: "Failed to write file: {path}",
453
+ directoryNotFound: "Directory not found: {path}",
454
+ invalidPath: "{path} is not a valid path",
455
+ operationCanceled: "Operation was canceled",
456
+ invalidParameter: "Invalid parameter: {parameter}"
457
+ },
458
+ progress: {
459
+ copying: "Copying files...",
460
+ building: "Building project...",
461
+ packaging: "Creating package...",
462
+ validating: "Validating...",
463
+ analyzing: "Analyzing...",
464
+ restoring: "Restoring dependencies..."
465
+ },
466
+ validation: {
467
+ requiredField: "{field} is required",
468
+ invalidValue: "Invalid value for {field}",
469
+ pathNotFound: "Path not found: {path}",
470
+ fileRequired: "File is required: {path}",
471
+ directoryRequired: "Directory is required: {path}"
472
+ },
473
+ warnings: {
474
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
475
+ },
476
+ info: {
477
+ operationComplete: "Operation completed successfully",
478
+ filesProcessed: {
479
+ zero: "No files processed",
480
+ one: "{count} file processed",
481
+ other: "{count} files processed"
482
+ }
483
+ }
484
+ }
485
+ };
486
+
487
+ // ../packager/packager-core/src/i18n/locales/pt-BR.ts
488
+ var pt_BR = {
489
+ toolCore: {
490
+ errors: {
491
+ internal: "Internal error: {message}",
492
+ fileNotFound: "File not found: {path}",
493
+ fileReadFailed: "Failed to read file: {path}",
494
+ fileWriteFailed: "Failed to write file: {path}",
495
+ directoryNotFound: "Directory not found: {path}",
496
+ invalidPath: "{path} is not a valid path",
497
+ operationCanceled: "Operation was canceled",
498
+ invalidParameter: "Invalid parameter: {parameter}"
499
+ },
500
+ progress: {
501
+ copying: "Copying files...",
502
+ building: "Building project...",
503
+ packaging: "Creating package...",
504
+ validating: "Validating...",
505
+ analyzing: "Analyzing...",
506
+ restoring: "Restoring dependencies..."
507
+ },
508
+ validation: {
509
+ requiredField: "{field} is required",
510
+ invalidValue: "Invalid value for {field}",
511
+ pathNotFound: "Path not found: {path}",
512
+ fileRequired: "File is required: {path}",
513
+ directoryRequired: "Directory is required: {path}"
514
+ },
515
+ warnings: {
516
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
517
+ },
518
+ info: {
519
+ operationComplete: "Operation completed successfully",
520
+ filesProcessed: {
521
+ zero: "No files processed",
522
+ one: "{count} file processed",
523
+ other: "{count} files processed"
73
524
  }
74
525
  }
75
- } else {
76
- co = new u16(s);
77
- for (i2 = 0;i2 < s; ++i2) {
78
- if (cd[i2]) {
79
- co[i2] = rev[le[cd[i2] - 1]++] >> 15 - cd[i2];
526
+ }
527
+ };
528
+
529
+ // ../packager/packager-core/src/i18n/locales/ro.ts
530
+ var ro = {
531
+ toolCore: {
532
+ errors: {
533
+ internal: "Internal error: {message}",
534
+ fileNotFound: "File not found: {path}",
535
+ fileReadFailed: "Failed to read file: {path}",
536
+ fileWriteFailed: "Failed to write file: {path}",
537
+ directoryNotFound: "Directory not found: {path}",
538
+ invalidPath: "{path} is not a valid path",
539
+ operationCanceled: "Operation was canceled",
540
+ invalidParameter: "Invalid parameter: {parameter}"
541
+ },
542
+ progress: {
543
+ copying: "Copying files...",
544
+ building: "Building project...",
545
+ packaging: "Creating package...",
546
+ validating: "Validating...",
547
+ analyzing: "Analyzing...",
548
+ restoring: "Restoring dependencies..."
549
+ },
550
+ validation: {
551
+ requiredField: "{field} is required",
552
+ invalidValue: "Invalid value for {field}",
553
+ pathNotFound: "Path not found: {path}",
554
+ fileRequired: "File is required: {path}",
555
+ directoryRequired: "Directory is required: {path}"
556
+ },
557
+ warnings: {
558
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
559
+ },
560
+ info: {
561
+ operationComplete: "Operation completed successfully",
562
+ filesProcessed: {
563
+ zero: "No files processed",
564
+ one: "{count} file processed",
565
+ other: "{count} files processed"
80
566
  }
81
567
  }
82
568
  }
83
- return co;
84
- };
85
- var flt = new u8(288);
86
- for (i = 0;i < 144; ++i)
87
- flt[i] = 8;
88
- var i;
89
- for (i = 144;i < 256; ++i)
90
- flt[i] = 9;
91
- var i;
92
- for (i = 256;i < 280; ++i)
93
- flt[i] = 7;
94
- var i;
95
- for (i = 280;i < 288; ++i)
96
- flt[i] = 8;
97
- var i;
98
- var fdt = new u8(32);
99
- for (i = 0;i < 32; ++i)
100
- fdt[i] = 5;
101
- var i;
102
- var flm = /* @__PURE__ */ hMap(flt, 9, 0);
103
- var fdm = /* @__PURE__ */ hMap(fdt, 5, 0);
104
- var shft = function(p) {
105
- return (p + 7) / 8 | 0;
106
- };
107
- var slc = function(v, s, e) {
108
- if (s == null || s < 0)
109
- s = 0;
110
- if (e == null || e > v.length)
111
- e = v.length;
112
- return new u8(v.subarray(s, e));
113
569
  };
114
- var ec = [
115
- "unexpected EOF",
116
- "invalid block type",
117
- "invalid length/literal",
118
- "invalid distance",
119
- "stream finished",
120
- "no stream handler",
121
- ,
122
- "no callback",
123
- "invalid UTF-8 data",
124
- "extra field too long",
125
- "date not in range 1980-2099",
126
- "filename too long",
127
- "stream finishing",
128
- "invalid zip data"
129
- ];
130
- var err = function(ind, msg, nt) {
131
- var e = new Error(msg || ec[ind]);
132
- e.code = ind;
133
- if (Error.captureStackTrace)
134
- Error.captureStackTrace(e, err);
135
- if (!nt)
136
- throw e;
137
- return e;
138
- };
139
- var wbits = function(d, p, v) {
140
- v <<= p & 7;
141
- var o = p / 8 | 0;
142
- d[o] |= v;
143
- d[o + 1] |= v >> 8;
570
+
571
+ // ../packager/packager-core/src/i18n/locales/ru.ts
572
+ var ru = {
573
+ toolCore: {
574
+ errors: {
575
+ internal: "Internal error: {message}",
576
+ fileNotFound: "File not found: {path}",
577
+ fileReadFailed: "Failed to read file: {path}",
578
+ fileWriteFailed: "Failed to write file: {path}",
579
+ directoryNotFound: "Directory not found: {path}",
580
+ invalidPath: "{path} is not a valid path",
581
+ operationCanceled: "Operation was canceled",
582
+ invalidParameter: "Invalid parameter: {parameter}"
583
+ },
584
+ progress: {
585
+ copying: "Copying files...",
586
+ building: "Building project...",
587
+ packaging: "Creating package...",
588
+ validating: "Validating...",
589
+ analyzing: "Analyzing...",
590
+ restoring: "Restoring dependencies..."
591
+ },
592
+ validation: {
593
+ requiredField: "{field} is required",
594
+ invalidValue: "Invalid value for {field}",
595
+ pathNotFound: "Path not found: {path}",
596
+ fileRequired: "File is required: {path}",
597
+ directoryRequired: "Directory is required: {path}"
598
+ },
599
+ warnings: {
600
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
601
+ },
602
+ info: {
603
+ operationComplete: "Operation completed successfully",
604
+ filesProcessed: {
605
+ zero: "No files processed",
606
+ one: "{count} file processed",
607
+ other: "{count} files processed"
608
+ }
609
+ }
610
+ }
144
611
  };
145
- var wbits16 = function(d, p, v) {
146
- v <<= p & 7;
147
- var o = p / 8 | 0;
148
- d[o] |= v;
149
- d[o + 1] |= v >> 8;
150
- d[o + 2] |= v >> 16;
612
+
613
+ // ../packager/packager-core/src/i18n/locales/tr.ts
614
+ var tr = {
615
+ toolCore: {
616
+ errors: {
617
+ internal: "Internal error: {message}",
618
+ fileNotFound: "File not found: {path}",
619
+ fileReadFailed: "Failed to read file: {path}",
620
+ fileWriteFailed: "Failed to write file: {path}",
621
+ directoryNotFound: "Directory not found: {path}",
622
+ invalidPath: "{path} is not a valid path",
623
+ operationCanceled: "Operation was canceled",
624
+ invalidParameter: "Invalid parameter: {parameter}"
625
+ },
626
+ progress: {
627
+ copying: "Copying files...",
628
+ building: "Building project...",
629
+ packaging: "Creating package...",
630
+ validating: "Validating...",
631
+ analyzing: "Analyzing...",
632
+ restoring: "Restoring dependencies..."
633
+ },
634
+ validation: {
635
+ requiredField: "{field} is required",
636
+ invalidValue: "Invalid value for {field}",
637
+ pathNotFound: "Path not found: {path}",
638
+ fileRequired: "File is required: {path}",
639
+ directoryRequired: "Directory is required: {path}"
640
+ },
641
+ warnings: {
642
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
643
+ },
644
+ info: {
645
+ operationComplete: "Operation completed successfully",
646
+ filesProcessed: {
647
+ zero: "No files processed",
648
+ one: "{count} file processed",
649
+ other: "{count} files processed"
650
+ }
651
+ }
652
+ }
151
653
  };
152
- var hTree = function(d, mb) {
153
- var t = [];
154
- for (var i2 = 0;i2 < d.length; ++i2) {
155
- if (d[i2])
156
- t.push({ s: i2, f: d[i2] });
157
- }
158
- var s = t.length;
159
- var t2 = t.slice();
160
- if (!s)
161
- return { t: et, l: 0 };
162
- if (s == 1) {
163
- var v = new u8(t[0].s + 1);
164
- v[t[0].s] = 1;
165
- return { t: v, l: 1 };
166
- }
167
- t.sort(function(a, b) {
168
- return a.f - b.f;
169
- });
170
- t.push({ s: -1, f: 25001 });
171
- var l = t[0], r = t[1], i0 = 0, i1 = 1, i22 = 2;
172
- t[0] = { s: -1, f: l.f + r.f, l, r };
173
- while (i1 != s - 1) {
174
- l = t[t[i0].f < t[i22].f ? i0++ : i22++];
175
- r = t[i0 != i1 && t[i0].f < t[i22].f ? i0++ : i22++];
176
- t[i1++] = { s: -1, f: l.f + r.f, l, r };
177
- }
178
- var maxSym = t2[0].s;
179
- for (var i2 = 1;i2 < s; ++i2) {
180
- if (t2[i2].s > maxSym)
181
- maxSym = t2[i2].s;
182
- }
183
- var tr = new u16(maxSym + 1);
184
- var mbt = ln(t[i1 - 1], tr, 0);
185
- if (mbt > mb) {
186
- var i2 = 0, dt = 0;
187
- var lft = mbt - mb, cst = 1 << lft;
188
- t2.sort(function(a, b) {
189
- return tr[b.s] - tr[a.s] || a.f - b.f;
190
- });
191
- for (;i2 < s; ++i2) {
192
- var i2_1 = t2[i2].s;
193
- if (tr[i2_1] > mb) {
194
- dt += cst - (1 << mbt - tr[i2_1]);
195
- tr[i2_1] = mb;
196
- } else
197
- break;
198
- }
199
- dt >>= lft;
200
- while (dt > 0) {
201
- var i2_2 = t2[i2].s;
202
- if (tr[i2_2] < mb)
203
- dt -= 1 << mb - tr[i2_2]++ - 1;
204
- else
205
- ++i2;
206
- }
207
- for (;i2 >= 0 && dt; --i2) {
208
- var i2_3 = t2[i2].s;
209
- if (tr[i2_3] == mb) {
210
- --tr[i2_3];
211
- ++dt;
654
+
655
+ // ../packager/packager-core/src/i18n/locales/zh-CN.ts
656
+ var zh_CN = {
657
+ toolCore: {
658
+ errors: {
659
+ internal: "Internal error: {message}",
660
+ fileNotFound: "File not found: {path}",
661
+ fileReadFailed: "Failed to read file: {path}",
662
+ fileWriteFailed: "Failed to write file: {path}",
663
+ directoryNotFound: "Directory not found: {path}",
664
+ invalidPath: "{path} is not a valid path",
665
+ operationCanceled: "Operation was canceled",
666
+ invalidParameter: "Invalid parameter: {parameter}"
667
+ },
668
+ progress: {
669
+ copying: "Copying files...",
670
+ building: "Building project...",
671
+ packaging: "Creating package...",
672
+ validating: "Validating...",
673
+ analyzing: "Analyzing...",
674
+ restoring: "Restoring dependencies..."
675
+ },
676
+ validation: {
677
+ requiredField: "{field} is required",
678
+ invalidValue: "Invalid value for {field}",
679
+ pathNotFound: "Path not found: {path}",
680
+ fileRequired: "File is required: {path}",
681
+ directoryRequired: "Directory is required: {path}"
682
+ },
683
+ warnings: {
684
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
685
+ },
686
+ info: {
687
+ operationComplete: "Operation completed successfully",
688
+ filesProcessed: {
689
+ zero: "No files processed",
690
+ one: "{count} file processed",
691
+ other: "{count} files processed"
212
692
  }
213
693
  }
214
- mbt = mb;
215
694
  }
216
- return { t: new u8(tr), l: mbt };
217
695
  };
218
- var ln = function(n, l, d) {
219
- return n.s == -1 ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1)) : l[n.s] = d;
696
+
697
+ // ../packager/packager-core/src/i18n/locales/zh-TW.ts
698
+ var zh_TW = {
699
+ toolCore: {
700
+ errors: {
701
+ internal: "Internal error: {message}",
702
+ fileNotFound: "File not found: {path}",
703
+ fileReadFailed: "Failed to read file: {path}",
704
+ fileWriteFailed: "Failed to write file: {path}",
705
+ directoryNotFound: "Directory not found: {path}",
706
+ invalidPath: "{path} is not a valid path",
707
+ operationCanceled: "Operation was canceled",
708
+ invalidParameter: "Invalid parameter: {parameter}"
709
+ },
710
+ progress: {
711
+ copying: "Copying files...",
712
+ building: "Building project...",
713
+ packaging: "Creating package...",
714
+ validating: "Validating...",
715
+ analyzing: "Analyzing...",
716
+ restoring: "Restoring dependencies..."
717
+ },
718
+ validation: {
719
+ requiredField: "{field} is required",
720
+ invalidValue: "Invalid value for {field}",
721
+ pathNotFound: "Path not found: {path}",
722
+ fileRequired: "File is required: {path}",
723
+ directoryRequired: "Directory is required: {path}"
724
+ },
725
+ warnings: {
726
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
727
+ },
728
+ info: {
729
+ operationComplete: "Operation completed successfully",
730
+ filesProcessed: {
731
+ zero: "No files processed",
732
+ one: "{count} file processed",
733
+ other: "{count} files processed"
734
+ }
735
+ }
736
+ }
220
737
  };
221
- var lc = function(c) {
222
- var s = c.length;
223
- while (s && !c[--s])
224
- ;
225
- var cl = new u16(++s);
226
- var cli = 0, cln = c[0], cls = 1;
227
- var w = function(v) {
228
- cl[cli++] = v;
229
- };
230
- for (var i2 = 1;i2 <= s; ++i2) {
231
- if (c[i2] == cln && i2 != s)
232
- ++cls;
233
- else {
234
- if (!cln && cls > 2) {
235
- for (;cls > 138; cls -= 138)
236
- w(32754);
237
- if (cls > 2) {
238
- w(cls > 10 ? cls - 11 << 5 | 28690 : cls - 3 << 5 | 12305);
239
- cls = 0;
240
- }
241
- } else if (cls > 3) {
242
- w(cln), --cls;
243
- for (;cls > 6; cls -= 6)
244
- w(8304);
245
- if (cls > 2)
246
- w(cls - 3 << 5 | 8208), cls = 0;
738
+
739
+ // ../packager/packager-core/src/i18n/locales/zu.ts
740
+ var zu = {
741
+ toolCore: {
742
+ errors: {
743
+ internal: "Internal error: {message}",
744
+ fileNotFound: "File not found: {path}",
745
+ fileReadFailed: "Failed to read file: {path}",
746
+ fileWriteFailed: "Failed to write file: {path}",
747
+ directoryNotFound: "Directory not found: {path}",
748
+ invalidPath: "{path} is not a valid path",
749
+ operationCanceled: "Operation was canceled",
750
+ invalidParameter: "Invalid parameter: {parameter}"
751
+ },
752
+ progress: {
753
+ copying: "Copying files...",
754
+ building: "Building project...",
755
+ packaging: "Creating package...",
756
+ validating: "Validating...",
757
+ analyzing: "Analyzing...",
758
+ restoring: "Restoring dependencies..."
759
+ },
760
+ validation: {
761
+ requiredField: "{field} is required",
762
+ invalidValue: "Invalid value for {field}",
763
+ pathNotFound: "Path not found: {path}",
764
+ fileRequired: "File is required: {path}",
765
+ directoryRequired: "Directory is required: {path}"
766
+ },
767
+ warnings: {
768
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
769
+ },
770
+ info: {
771
+ operationComplete: "Operation completed successfully",
772
+ filesProcessed: {
773
+ zero: "No files processed",
774
+ one: "{count} file processed",
775
+ other: "{count} files processed"
247
776
  }
248
- while (cls--)
249
- w(cln);
250
- cls = 1;
251
- cln = c[i2];
252
777
  }
253
778
  }
254
- return { c: cl.subarray(0, cli), n: s };
255
779
  };
256
- var clen = function(cf, cl) {
257
- var l = 0;
258
- for (var i2 = 0;i2 < cl.length; ++i2)
259
- l += cf[i2] * cl[i2];
260
- return l;
261
- };
262
- var wfblk = function(out, pos, dat) {
263
- var s = dat.length;
264
- var o = shft(pos + 2);
265
- out[o] = s & 255;
266
- out[o + 1] = s >> 8;
267
- out[o + 2] = out[o] ^ 255;
268
- out[o + 3] = out[o + 1] ^ 255;
269
- for (var i2 = 0;i2 < s; ++i2)
270
- out[o + i2 + 4] = dat[i2];
271
- return (o + 4 + s) * 8;
272
- };
273
- var wblk = function(dat, out, final, syms, lf, df, eb, li, bs, bl, p) {
274
- wbits(out, p++, final);
275
- ++lf[256];
276
- var _a2 = hTree(lf, 15), dlt = _a2.t, mlb = _a2.l;
277
- var _b2 = hTree(df, 15), ddt = _b2.t, mdb = _b2.l;
278
- var _c = lc(dlt), lclt = _c.c, nlc = _c.n;
279
- var _d = lc(ddt), lcdt = _d.c, ndc = _d.n;
280
- var lcfreq = new u16(19);
281
- for (var i2 = 0;i2 < lclt.length; ++i2)
282
- ++lcfreq[lclt[i2] & 31];
283
- for (var i2 = 0;i2 < lcdt.length; ++i2)
284
- ++lcfreq[lcdt[i2] & 31];
285
- var _e = hTree(lcfreq, 7), lct = _e.t, mlcb = _e.l;
286
- var nlcc = 19;
287
- for (;nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)
288
- ;
289
- var flen = bl + 5 << 3;
290
- var ftlen = clen(lf, flt) + clen(df, fdt) + eb;
291
- var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18];
292
- if (bs >= 0 && flen <= ftlen && flen <= dtlen)
293
- return wfblk(out, p, dat.subarray(bs, bs + bl));
294
- var lm, ll, dm, dl;
295
- wbits(out, p, 1 + (dtlen < ftlen)), p += 2;
296
- if (dtlen < ftlen) {
297
- lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;
298
- var llm = hMap(lct, mlcb, 0);
299
- wbits(out, p, nlc - 257);
300
- wbits(out, p + 5, ndc - 1);
301
- wbits(out, p + 10, nlcc - 4);
302
- p += 14;
303
- for (var i2 = 0;i2 < nlcc; ++i2)
304
- wbits(out, p + 3 * i2, lct[clim[i2]]);
305
- p += 3 * nlcc;
306
- var lcts = [lclt, lcdt];
307
- for (var it = 0;it < 2; ++it) {
308
- var clct = lcts[it];
309
- for (var i2 = 0;i2 < clct.length; ++i2) {
310
- var len = clct[i2] & 31;
311
- wbits(out, p, llm[len]), p += lct[len];
312
- if (len > 15)
313
- wbits(out, p, clct[i2] >> 5 & 127), p += clct[i2] >> 12;
314
- }
780
+
781
+ // ../packager/packager-core/src/i18n/translation-service.ts
782
+ class TranslationService {
783
+ static instance;
784
+ currentLocale = "en";
785
+ constructor() {}
786
+ static getInstance() {
787
+ if (!TranslationService.instance) {
788
+ TranslationService.instance = new TranslationService;
315
789
  }
316
- } else {
317
- lm = flm, ll = flt, dm = fdm, dl = fdt;
318
- }
319
- for (var i2 = 0;i2 < li; ++i2) {
320
- var sym = syms[i2];
321
- if (sym > 255) {
322
- var len = sym >> 18 & 31;
323
- wbits16(out, p, lm[len + 257]), p += ll[len + 257];
324
- if (len > 7)
325
- wbits(out, p, sym >> 23 & 31), p += fleb[len];
326
- var dst = sym & 31;
327
- wbits16(out, p, dm[dst]), p += dl[dst];
328
- if (dst > 3)
329
- wbits16(out, p, sym >> 5 & 8191), p += fdeb[dst];
330
- } else {
331
- wbits16(out, p, lm[sym]), p += ll[sym];
332
- }
333
- }
334
- wbits16(out, p, lm[256]);
335
- return p + ll[256];
336
- };
337
- var deo = /* @__PURE__ */ new i32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);
338
- var et = /* @__PURE__ */ new u8(0);
339
- var dflt = function(dat, lvl, plvl, pre, post, st) {
340
- var s = st.z || dat.length;
341
- var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);
342
- var w = o.subarray(pre, o.length - post);
343
- var lst = st.l;
344
- var pos = (st.r || 0) & 7;
345
- if (lvl) {
346
- if (pos)
347
- w[0] = st.r >> 3;
348
- var opt = deo[lvl - 1];
349
- var n = opt >> 13, c = opt & 8191;
350
- var msk_1 = (1 << plvl) - 1;
351
- var prev = st.p || new u16(32768), head = st.h || new u16(msk_1 + 1);
352
- var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;
353
- var hsh = function(i3) {
354
- return (dat[i3] ^ dat[i3 + 1] << bs1_1 ^ dat[i3 + 2] << bs2_1) & msk_1;
355
- };
356
- var syms = new i32(25000);
357
- var lf = new u16(288), df = new u16(32);
358
- var lc_1 = 0, eb = 0, i2 = st.i || 0, li = 0, wi = st.w || 0, bs = 0;
359
- for (;i2 + 2 < s; ++i2) {
360
- var hv = hsh(i2);
361
- var imod = i2 & 32767, pimod = head[hv];
362
- prev[imod] = pimod;
363
- head[hv] = imod;
364
- if (wi <= i2) {
365
- var rem = s - i2;
366
- if ((lc_1 > 7000 || li > 24576) && (rem > 423 || !lst)) {
367
- pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i2 - bs, pos);
368
- li = lc_1 = eb = 0, bs = i2;
369
- for (var j = 0;j < 286; ++j)
370
- lf[j] = 0;
371
- for (var j = 0;j < 30; ++j)
372
- df[j] = 0;
373
- }
374
- var l = 2, d = 0, ch_1 = c, dif = imod - pimod & 32767;
375
- if (rem > 2 && hv == hsh(i2 - dif)) {
376
- var maxn = Math.min(n, rem) - 1;
377
- var maxd = Math.min(32767, i2);
378
- var ml = Math.min(258, rem);
379
- while (dif <= maxd && --ch_1 && imod != pimod) {
380
- if (dat[i2 + l] == dat[i2 + l - dif]) {
381
- var nl = 0;
382
- for (;nl < ml && dat[i2 + nl] == dat[i2 + nl - dif]; ++nl)
383
- ;
384
- if (nl > l) {
385
- l = nl, d = dif;
386
- if (nl > maxn)
387
- break;
388
- var mmd = Math.min(dif, nl - 2);
389
- var md = 0;
390
- for (var j = 0;j < mmd; ++j) {
391
- var ti = i2 - dif + j & 32767;
392
- var pti = prev[ti];
393
- var cd = ti - pti & 32767;
394
- if (cd > md)
395
- md = cd, pimod = ti;
396
- }
397
- }
398
- }
399
- imod = pimod, pimod = prev[imod];
400
- dif += imod - pimod & 32767;
401
- }
402
- }
403
- if (d) {
404
- syms[li++] = 268435456 | revfl[l] << 18 | revfd[d];
405
- var lin = revfl[l] & 31, din = revfd[d] & 31;
406
- eb += fleb[lin] + fdeb[din];
407
- ++lf[257 + lin];
408
- ++df[din];
409
- wi = i2 + l;
410
- ++lc_1;
411
- } else {
412
- syms[li++] = dat[i2];
413
- ++lf[dat[i2]];
790
+ return TranslationService.instance;
791
+ }
792
+ setLocale(locale) {
793
+ this.currentLocale = I18nManager.setLocale(locale);
794
+ }
795
+ getLocale() {
796
+ return this.currentLocale;
797
+ }
798
+ t(key, params) {
799
+ return I18nManager.t(key, params, this.currentLocale);
800
+ }
801
+ tLocale(key, locale, params) {
802
+ return I18nManager.t(key, params, locale);
803
+ }
804
+ has(key) {
805
+ return I18nManager.has(key, this.currentLocale);
806
+ }
807
+ getAvailableLocales() {
808
+ return I18nManager.getAvailableLocales();
809
+ }
810
+ }
811
+ var translate = TranslationService.getInstance();
812
+
813
+ // ../packager/packager-core/src/i18n/index.ts
814
+ I18nManager.registerTranslations("en", en);
815
+ I18nManager.registerTranslations("de", de);
816
+ I18nManager.registerTranslations("es", es);
817
+ I18nManager.registerTranslations("es-mx", es_MX);
818
+ I18nManager.registerTranslations("fr", fr);
819
+ I18nManager.registerTranslations("ja", ja);
820
+ I18nManager.registerTranslations("ko", ko);
821
+ I18nManager.registerTranslations("pt", pt);
822
+ I18nManager.registerTranslations("pt-br", pt_BR);
823
+ I18nManager.registerTranslations("ro", ro);
824
+ I18nManager.registerTranslations("ru", ru);
825
+ I18nManager.registerTranslations("tr", tr);
826
+ I18nManager.registerTranslations("zh-cn", zh_CN);
827
+ I18nManager.registerTranslations("zh-tw", zh_TW);
828
+ I18nManager.registerTranslations("zu", zu);
829
+ I18nManager.setLocale("en");
830
+ // ../packager/packager-core/src/models/tool-result.ts
831
+ class ToolResult {
832
+ errorCode;
833
+ message;
834
+ packages;
835
+ details;
836
+ instructions;
837
+ constructor(errorCode, message, packages = [], instructions) {
838
+ this.errorCode = errorCode;
839
+ this.message = message;
840
+ this.packages = packages;
841
+ this.instructions = instructions;
842
+ }
843
+ get isSuccess() {
844
+ return this.errorCode === "SUCCESS" /* Success */;
845
+ }
846
+ static success() {
847
+ return new ToolResult("SUCCESS" /* Success */);
848
+ }
849
+ static error(errorCode, message, instructions) {
850
+ return new ToolResult(errorCode, message, [], instructions);
851
+ }
852
+ }
853
+ // ../packager/packager-core/src/services/tools-factory-repository.ts
854
+ class ToolsFactoryRepository {
855
+ projectFactoryMap = new Map;
856
+ solutionFactory = null;
857
+ registerProjectToolFactory(factory) {
858
+ for (const type of factory.supportedTypes) {
859
+ const existing = this.projectFactoryMap.get(type);
860
+ if (existing) {
861
+ if (existing.constructor?.name !== factory.constructor?.name) {
862
+ console.warn(`Tool factory conflict for project type '${type}': ` + `'${existing.constructor?.name}' already registered, ` + `ignoring '${factory.constructor?.name}'.`);
414
863
  }
864
+ continue;
415
865
  }
866
+ this.projectFactoryMap.set(type, factory);
416
867
  }
417
- for (i2 = Math.max(i2, wi);i2 < s; ++i2) {
418
- syms[li++] = dat[i2];
419
- ++lf[dat[i2]];
420
- }
421
- pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i2 - bs, pos);
422
- if (!lst) {
423
- st.r = pos & 7 | w[pos / 8 | 0] << 3;
424
- pos -= 7;
425
- st.h = head, st.p = prev, st.i = i2, st.w = wi;
426
- }
427
- } else {
428
- for (var i2 = st.w || 0;i2 < s + lst; i2 += 65535) {
429
- var e = i2 + 65535;
430
- if (e >= s) {
431
- w[pos / 8 | 0] = lst;
432
- e = s;
433
- }
434
- pos = wfblk(w, pos + 1, dat.subarray(i2, e));
435
- }
436
- st.i = s;
437
868
  }
438
- return slc(o, 0, pre + shft(pos) + post);
439
- };
440
- var crct = /* @__PURE__ */ function() {
441
- var t = new Int32Array(256);
442
- for (var i2 = 0;i2 < 256; ++i2) {
443
- var c = i2, k = 9;
444
- while (--k)
445
- c = (c & 1 && -306674912) ^ c >>> 1;
446
- t[i2] = c;
447
- }
448
- return t;
449
- }();
450
- var crc = function() {
451
- var c = -1;
452
- return {
453
- p: function(d) {
454
- var cr = c;
455
- for (var i2 = 0;i2 < d.length; ++i2)
456
- cr = crct[cr & 255 ^ d[i2]] ^ cr >>> 8;
457
- c = cr;
458
- },
459
- d: function() {
460
- return ~c;
461
- }
462
- };
463
- };
464
- var dopt = function(dat, opt, pre, post, st) {
465
- if (!st) {
466
- st = { l: 1 };
467
- if (opt.dictionary) {
468
- var dict = opt.dictionary.subarray(-32768);
469
- var newDat = new u8(dict.length + dat.length);
470
- newDat.set(dict);
471
- newDat.set(dat, dict.length);
472
- dat = newDat;
473
- st.w = dict.length;
474
- }
475
- }
476
- return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? st.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 20 : 12 + opt.mem, pre, post, st);
477
- };
478
- var mrg = function(a, b) {
479
- var o = {};
480
- for (var k in a)
481
- o[k] = a[k];
482
- for (var k in b)
483
- o[k] = b[k];
484
- return o;
485
- };
486
- var wbytes = function(d, b, v) {
487
- for (;v; ++b)
488
- d[b] = v, v >>>= 8;
489
- };
490
- function deflateSync(data, opts) {
491
- return dopt(data, opts || {}, 0, 0);
492
- }
493
- var fltn = function(d, p, t, o) {
494
- for (var k in d) {
495
- var val = d[k], n = p + k, op = o;
496
- if (Array.isArray(val))
497
- op = mrg(o, val[1]), val = val[0];
498
- if (ArrayBuffer.isView(val))
499
- t[n] = [val, op];
500
- else {
501
- t[n += "/"] = [new u8(0), op];
502
- fltn(val, n, t, o);
869
+ registerSolutionToolFactory(factory) {
870
+ this.solutionFactory = factory;
871
+ }
872
+ getSolutionToolFactory() {
873
+ if (!this.solutionFactory) {
874
+ throw new Error("No solution tool factory is registered");
503
875
  }
876
+ return this.solutionFactory;
504
877
  }
505
- };
506
- var te = typeof TextEncoder != "undefined" && /* @__PURE__ */ new TextEncoder;
507
- var td = typeof TextDecoder != "undefined" && /* @__PURE__ */ new TextDecoder;
508
- var tds = 0;
509
- try {
510
- td.decode(et, { stream: true });
511
- tds = 1;
512
- } catch (e) {}
513
- function strToU8(str, latin1) {
514
- if (latin1) {
515
- var ar_1 = new u8(str.length);
516
- for (var i2 = 0;i2 < str.length; ++i2)
517
- ar_1[i2] = str.charCodeAt(i2);
518
- return ar_1;
519
- }
520
- if (te)
521
- return te.encode(str);
522
- var l = str.length;
523
- var ar = new u8(str.length + (str.length >> 1));
524
- var ai = 0;
525
- var w = function(v) {
526
- ar[ai++] = v;
527
- };
528
- for (var i2 = 0;i2 < l; ++i2) {
529
- if (ai + 5 > ar.length) {
530
- var n = new u8(ai + 8 + (l - i2 << 1));
531
- n.set(ar);
532
- ar = n;
533
- }
534
- var c = str.charCodeAt(i2);
535
- if (c < 128 || latin1)
536
- w(c);
537
- else if (c < 2048)
538
- w(192 | c >> 6), w(128 | c & 63);
539
- else if (c > 55295 && c < 57344)
540
- c = 65536 + (c & 1023 << 10) | str.charCodeAt(++i2) & 1023, w(240 | c >> 18), w(128 | c >> 12 & 63), w(128 | c >> 6 & 63), w(128 | c & 63);
541
- else
542
- w(224 | c >> 12), w(128 | c >> 6 & 63), w(128 | c & 63);
543
- }
544
- return slc(ar, 0, ai);
545
- }
546
- var exfl = function(ex) {
547
- var le = 0;
548
- if (ex) {
549
- for (var k in ex) {
550
- var l = ex[k].length;
551
- if (l > 65535)
552
- err(9);
553
- le += l + 4;
878
+ canHandleProject(projectType) {
879
+ return this.projectFactoryMap.has(projectType);
880
+ }
881
+ getProjectToolFactory(projectType) {
882
+ const factory = this.projectFactoryMap.get(projectType);
883
+ if (!factory) {
884
+ throw new Error(`Cannot pack project type '${projectType}': no packager is installed for it.`);
554
885
  }
886
+ return factory;
887
+ }
888
+ reset() {
889
+ this.projectFactoryMap.clear();
890
+ this.solutionFactory = null;
555
891
  }
556
- return le;
557
- };
558
- var wzh = function(d, b, f, fn, u, c, ce, co) {
559
- var fl2 = fn.length, ex = f.extra, col = co && co.length;
560
- var exl = exfl(ex);
561
- wbytes(d, b, ce != null ? 33639248 : 67324752), b += 4;
562
- if (ce != null)
563
- d[b++] = 20, d[b++] = f.os;
564
- d[b] = 20, b += 2;
565
- d[b++] = f.flag << 1 | (c < 0 && 8), d[b++] = u && 8;
566
- d[b++] = f.compression & 255, d[b++] = f.compression >> 8;
567
- var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;
568
- if (y < 0 || y > 119)
569
- err(10);
570
- wbytes(d, b, y << 25 | dt.getMonth() + 1 << 21 | dt.getDate() << 16 | dt.getHours() << 11 | dt.getMinutes() << 5 | dt.getSeconds() >> 1), b += 4;
571
- if (c != -1) {
572
- wbytes(d, b, f.crc);
573
- wbytes(d, b + 4, c < 0 ? -c - 2 : c);
574
- wbytes(d, b + 8, f.size);
575
- }
576
- wbytes(d, b + 12, fl2);
577
- wbytes(d, b + 14, exl), b += 16;
578
- if (ce != null) {
579
- wbytes(d, b, col);
580
- wbytes(d, b + 6, f.attrs);
581
- wbytes(d, b + 10, ce), b += 14;
582
- }
583
- d.set(fn, b);
584
- b += fl2;
585
- if (exl) {
586
- for (var k in ex) {
587
- var exf = ex[k], l = exf.length;
588
- wbytes(d, b, +k);
589
- wbytes(d, b + 2, l);
590
- d.set(exf, b + 4), b += 4 + l;
591
- }
592
- }
593
- if (col)
594
- d.set(co, b), b += col;
595
- return b;
596
- };
597
- var wzf = function(o, b, c, d, e) {
598
- wbytes(o, b, 101010256);
599
- wbytes(o, b + 8, c);
600
- wbytes(o, b + 10, c);
601
- wbytes(o, b + 12, d);
602
- wbytes(o, b + 16, e);
603
- };
604
- function zipSync(data, opts) {
605
- if (!opts)
606
- opts = {};
607
- var r = {};
608
- var files = [];
609
- fltn(data, "", r, opts);
610
- var o = 0;
611
- var tot = 0;
612
- for (var fn in r) {
613
- var _a2 = r[fn], file = _a2[0], p = _a2[1];
614
- var compression = p.level == 0 ? 0 : 8;
615
- var f = strToU8(fn), s = f.length;
616
- var com = p.comment, m = com && strToU8(com), ms = m && m.length;
617
- var exl = exfl(p.extra);
618
- if (s > 65535)
619
- err(11);
620
- var d = compression ? deflateSync(file, p) : file, l = d.length;
621
- var c = crc();
622
- c.p(file);
623
- files.push(mrg(p, {
624
- size: file.length,
625
- crc: c.d(),
626
- c: d,
627
- f,
628
- m,
629
- u: s != fn.length || m && com.length != ms,
630
- o,
631
- compression
632
- }));
633
- o += 30 + s + exl + l;
634
- tot += 76 + 2 * (s + exl) + (ms || 0) + l;
635
- }
636
- var out = new u8(tot + 22), oe = o, cdl = tot - o;
637
- for (var i2 = 0;i2 < files.length; ++i2) {
638
- var f = files[i2];
639
- wzh(out, f.o, f, f.f, f.u, f.c.length);
640
- var badd = 30 + f.f.length + exfl(f.extra);
641
- out.set(f.c, f.o + badd);
642
- wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);
643
- }
644
- wzf(out, o, files.length, cdl, oe);
645
- return out;
646
892
  }
647
-
893
+ var REGISTRY_KEY = Symbol.for("@uipath/solutionpackager-tool-core/toolsFactoryRepository");
894
+ var _global = globalThis;
895
+ if (!_global[REGISTRY_KEY]) {
896
+ _global[REGISTRY_KEY] = new ToolsFactoryRepository;
897
+ }
898
+ var toolsFactoryRepository = _global[REGISTRY_KEY];
648
899
  // ../packager/packager-core/dist/index.js
649
- class Path {
900
+ class Path2 {
650
901
  static normalize(path) {
651
902
  return path.replace(/\\/g, "/").replace(/\/+/g, "/");
652
903
  }
653
904
  static join(...segments) {
654
- return Path.normalize(segments.filter((s) => s.length > 0).join("/"));
905
+ return Path2.normalize(segments.filter((s) => s.length > 0).join("/"));
655
906
  }
656
907
  static dirname(path) {
657
- const normalized = Path.normalize(path).replace(/\/$/, "");
908
+ const normalized = Path2.normalize(path).replace(/\/$/, "");
658
909
  if (normalized === "")
659
910
  return ".";
660
911
  const lastSlash = normalized.lastIndexOf("/");
@@ -665,14 +916,14 @@ class Path {
665
916
  return normalized.substring(0, lastSlash);
666
917
  }
667
918
  static basename(path) {
668
- const normalized = Path.normalize(path).replace(/\/$/, "");
919
+ const normalized = Path2.normalize(path).replace(/\/$/, "");
669
920
  if (normalized === "")
670
921
  return "";
671
922
  const lastSlash = normalized.lastIndexOf("/");
672
923
  return lastSlash >= 0 ? normalized.substring(lastSlash + 1) : normalized;
673
924
  }
674
925
  static extname(path) {
675
- const base = Path.basename(path);
926
+ const base = Path2.basename(path);
676
927
  const lastDot = base.lastIndexOf(".");
677
928
  if (lastDot === -1 || lastDot === 0 || lastDot === base.length - 1) {
678
929
  return "";
@@ -681,19 +932,19 @@ class Path {
681
932
  }
682
933
  static async walkDirectory(fs, rootPath, currentRelativePath = "") {
683
934
  const entries = [];
684
- const absolutePath = currentRelativePath ? Path.join(rootPath, currentRelativePath) : rootPath;
935
+ const absolutePath = currentRelativePath ? Path2.join(rootPath, currentRelativePath) : rootPath;
685
936
  const items = await fs.readdir(absolutePath);
686
937
  for (const item of items) {
687
- const itemRelativePath = currentRelativePath ? Path.join(currentRelativePath, item) : item;
688
- const itemAbsolutePath = Path.join(rootPath, itemRelativePath);
938
+ const itemRelativePath = currentRelativePath ? Path2.join(currentRelativePath, item) : item;
939
+ const itemAbsolutePath = Path2.join(rootPath, itemRelativePath);
689
940
  const stat = await fs.stat(itemAbsolutePath);
690
941
  if (stat?.isDirectory()) {
691
- const subEntries = await Path.walkDirectory(fs, rootPath, itemRelativePath);
942
+ const subEntries = await Path2.walkDirectory(fs, rootPath, itemRelativePath);
692
943
  entries.push(...subEntries);
693
944
  } else if (stat?.isFile()) {
694
945
  entries.push({
695
- relativePath: Path.normalize(itemRelativePath),
696
- absolutePath: Path.normalize(itemAbsolutePath)
946
+ relativePath: Path2.normalize(itemRelativePath),
947
+ absolutePath: Path2.normalize(itemAbsolutePath)
697
948
  });
698
949
  }
699
950
  }
@@ -701,7 +952,7 @@ class Path {
701
952
  }
702
953
  }
703
954
 
704
- class TemporaryStorageService {
955
+ class TemporaryStorageService2 {
705
956
  fileSystem;
706
957
  _tempFolderPath = null;
707
958
  constructor(fileSystem) {
@@ -711,7 +962,7 @@ class TemporaryStorageService {
711
962
  if (!this._tempFolderPath) {
712
963
  const systemTempDir = await this.fileSystem.getTempDir();
713
964
  const uniqueFolderName = this.generateUniqueFolderName();
714
- this._tempFolderPath = Path.join(systemTempDir, uniqueFolderName);
965
+ this._tempFolderPath = Path2.join(systemTempDir, uniqueFolderName);
715
966
  await this.fileSystem.mkdir(this._tempFolderPath);
716
967
  }
717
968
  return this._tempFolderPath;
@@ -723,7 +974,7 @@ class TemporaryStorageService {
723
974
  }
724
975
  async getTempSubfolderPathAsync(subfolder) {
725
976
  const tempFolderPath = await this.getTempFolderPath();
726
- const inputPath = Path.join(tempFolderPath, subfolder);
977
+ const inputPath = Path2.join(tempFolderPath, subfolder);
727
978
  await this.fileSystem.mkdir(inputPath);
728
979
  return inputPath;
729
980
  }
@@ -746,10 +997,10 @@ class TemporaryStorageService {
746
997
  } catch {}
747
998
  }
748
999
  }
749
- function isPluralForm(value) {
1000
+ function isPluralForm2(value) {
750
1001
  return typeof value === "object" && value !== null && "other" in value;
751
1002
  }
752
- function selectPluralForm(forms, count) {
1003
+ function selectPluralForm2(forms, count) {
753
1004
  if (count === 0 && forms.zero !== undefined) {
754
1005
  return forms.zero;
755
1006
  }
@@ -776,75 +1027,75 @@ function selectPluralForm(forms, count) {
776
1027
  return forms.other;
777
1028
  }
778
1029
 
779
- class I18nManager {
1030
+ class I18nManager2 {
780
1031
  static translations = {};
781
1032
  static currentLocale = "en";
782
1033
  static fallbackLocale = "en";
783
1034
  static registerTranslations(locale, catalog) {
784
- if (!I18nManager.translations[locale]) {
785
- I18nManager.translations[locale] = {};
1035
+ if (!I18nManager2.translations[locale]) {
1036
+ I18nManager2.translations[locale] = {};
786
1037
  }
787
- I18nManager.translations[locale] = I18nManager.deepMerge(I18nManager.translations[locale], catalog);
1038
+ I18nManager2.translations[locale] = I18nManager2.deepMerge(I18nManager2.translations[locale], catalog);
788
1039
  }
789
1040
  static setLocale(locale) {
790
- const normalized = I18nManager.normalizeLocale(locale);
791
- if (I18nManager.translations[normalized]) {
792
- I18nManager.currentLocale = normalized;
1041
+ const normalized = I18nManager2.normalizeLocale(locale);
1042
+ if (I18nManager2.translations[normalized]) {
1043
+ I18nManager2.currentLocale = normalized;
793
1044
  return normalized;
794
1045
  }
795
1046
  const baseLocale = normalized.split("-")[0];
796
- if (baseLocale !== normalized && I18nManager.translations[baseLocale]) {
797
- I18nManager.currentLocale = baseLocale;
1047
+ if (baseLocale !== normalized && I18nManager2.translations[baseLocale]) {
1048
+ I18nManager2.currentLocale = baseLocale;
798
1049
  return baseLocale;
799
1050
  }
800
- return I18nManager.currentLocale;
1051
+ return I18nManager2.currentLocale;
801
1052
  }
802
1053
  static getLocale() {
803
- return I18nManager.currentLocale;
1054
+ return I18nManager2.currentLocale;
804
1055
  }
805
1056
  static setFallbackLocale(locale) {
806
- I18nManager.fallbackLocale = I18nManager.normalizeLocale(locale);
1057
+ I18nManager2.fallbackLocale = I18nManager2.normalizeLocale(locale);
807
1058
  }
808
1059
  static t(key, params, locale) {
809
- const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
810
- let value = I18nManager.getTranslationValue(key, targetLocale);
811
- if (value === undefined && targetLocale !== I18nManager.fallbackLocale) {
812
- value = I18nManager.getTranslationValue(key, I18nManager.fallbackLocale);
1060
+ const targetLocale = locale ? I18nManager2.normalizeLocale(locale) : I18nManager2.currentLocale;
1061
+ let value = I18nManager2.getTranslationValue(key, targetLocale);
1062
+ if (value === undefined && targetLocale !== I18nManager2.fallbackLocale) {
1063
+ value = I18nManager2.getTranslationValue(key, I18nManager2.fallbackLocale);
813
1064
  }
814
1065
  if (value === undefined) {
815
1066
  return key;
816
1067
  }
817
- if (isPluralForm(value) && params && "count" in params) {
1068
+ if (isPluralForm2(value) && params && "count" in params) {
818
1069
  const count = typeof params.count === "number" ? params.count : Number(params.count);
819
- value = selectPluralForm(value, count);
820
- } else if (isPluralForm(value)) {
1070
+ value = selectPluralForm2(value, count);
1071
+ } else if (isPluralForm2(value)) {
821
1072
  value = value.other;
822
1073
  }
823
1074
  if (typeof value !== "string") {
824
1075
  return key;
825
1076
  }
826
- return params ? I18nManager.interpolate(value, params) : value;
1077
+ return params ? I18nManager2.interpolate(value, params) : value;
827
1078
  }
828
1079
  static has(key, locale) {
829
- const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
830
- const value = I18nManager.getTranslationValue(key, targetLocale);
1080
+ const targetLocale = locale ? I18nManager2.normalizeLocale(locale) : I18nManager2.currentLocale;
1081
+ const value = I18nManager2.getTranslationValue(key, targetLocale);
831
1082
  if (value !== undefined) {
832
1083
  return true;
833
1084
  }
834
- if (targetLocale !== I18nManager.fallbackLocale) {
835
- return I18nManager.getTranslationValue(key, I18nManager.fallbackLocale) !== undefined;
1085
+ if (targetLocale !== I18nManager2.fallbackLocale) {
1086
+ return I18nManager2.getTranslationValue(key, I18nManager2.fallbackLocale) !== undefined;
836
1087
  }
837
1088
  return false;
838
1089
  }
839
1090
  static getAvailableLocales() {
840
- return Object.keys(I18nManager.translations);
1091
+ return Object.keys(I18nManager2.translations);
841
1092
  }
842
1093
  static clearTranslations() {
843
- I18nManager.translations = {};
844
- I18nManager.currentLocale = "en";
1094
+ I18nManager2.translations = {};
1095
+ I18nManager2.currentLocale = "en";
845
1096
  }
846
1097
  static getTranslationValue(key, locale) {
847
- const catalog = I18nManager.translations[locale];
1098
+ const catalog = I18nManager2.translations[locale];
848
1099
  if (!catalog) {
849
1100
  return;
850
1101
  }
@@ -879,7 +1130,7 @@ class I18nManager {
879
1130
  const sourceValue = source[key];
880
1131
  const targetValue = result[key];
881
1132
  if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue) && targetValue && typeof targetValue === "object" && !Array.isArray(targetValue)) {
882
- result[key] = I18nManager.deepMerge(targetValue, sourceValue);
1133
+ result[key] = I18nManager2.deepMerge(targetValue, sourceValue);
883
1134
  } else {
884
1135
  result[key] = sourceValue;
885
1136
  }
@@ -887,7 +1138,7 @@ class I18nManager {
887
1138
  return result;
888
1139
  }
889
1140
  }
890
- var de = {
1141
+ var de2 = {
891
1142
  toolCore: {
892
1143
  errors: {
893
1144
  internal: "Internal error: {message}",
@@ -927,7 +1178,7 @@ var de = {
927
1178
  }
928
1179
  }
929
1180
  };
930
- var en = {
1181
+ var en2 = {
931
1182
  toolCore: {
932
1183
  errors: {
933
1184
  internal: "Internal error: {message}",
@@ -967,7 +1218,7 @@ var en = {
967
1218
  }
968
1219
  }
969
1220
  };
970
- var es = {
1221
+ var es2 = {
971
1222
  toolCore: {
972
1223
  errors: {
973
1224
  internal: "Internal error: {message}",
@@ -1007,7 +1258,7 @@ var es = {
1007
1258
  }
1008
1259
  }
1009
1260
  };
1010
- var es_MX = {
1261
+ var es_MX2 = {
1011
1262
  toolCore: {
1012
1263
  errors: {
1013
1264
  internal: "Internal error: {message}",
@@ -1047,7 +1298,7 @@ var es_MX = {
1047
1298
  }
1048
1299
  }
1049
1300
  };
1050
- var fr = {
1301
+ var fr2 = {
1051
1302
  toolCore: {
1052
1303
  errors: {
1053
1304
  internal: "Internal error: {message}",
@@ -1087,7 +1338,7 @@ var fr = {
1087
1338
  }
1088
1339
  }
1089
1340
  };
1090
- var ja = {
1341
+ var ja2 = {
1091
1342
  toolCore: {
1092
1343
  errors: {
1093
1344
  internal: "Internal error: {message}",
@@ -1127,7 +1378,7 @@ var ja = {
1127
1378
  }
1128
1379
  }
1129
1380
  };
1130
- var ko = {
1381
+ var ko2 = {
1131
1382
  toolCore: {
1132
1383
  errors: {
1133
1384
  internal: "Internal error: {message}",
@@ -1167,7 +1418,7 @@ var ko = {
1167
1418
  }
1168
1419
  }
1169
1420
  };
1170
- var pt = {
1421
+ var pt2 = {
1171
1422
  toolCore: {
1172
1423
  errors: {
1173
1424
  internal: "Internal error: {message}",
@@ -1207,7 +1458,7 @@ var pt = {
1207
1458
  }
1208
1459
  }
1209
1460
  };
1210
- var pt_BR = {
1461
+ var pt_BR2 = {
1211
1462
  toolCore: {
1212
1463
  errors: {
1213
1464
  internal: "Internal error: {message}",
@@ -1247,7 +1498,7 @@ var pt_BR = {
1247
1498
  }
1248
1499
  }
1249
1500
  };
1250
- var ro = {
1501
+ var ro2 = {
1251
1502
  toolCore: {
1252
1503
  errors: {
1253
1504
  internal: "Internal error: {message}",
@@ -1287,7 +1538,7 @@ var ro = {
1287
1538
  }
1288
1539
  }
1289
1540
  };
1290
- var ru = {
1541
+ var ru2 = {
1291
1542
  toolCore: {
1292
1543
  errors: {
1293
1544
  internal: "Internal error: {message}",
@@ -1327,7 +1578,7 @@ var ru = {
1327
1578
  }
1328
1579
  }
1329
1580
  };
1330
- var tr = {
1581
+ var tr2 = {
1331
1582
  toolCore: {
1332
1583
  errors: {
1333
1584
  internal: "Internal error: {message}",
@@ -1367,7 +1618,7 @@ var tr = {
1367
1618
  }
1368
1619
  }
1369
1620
  };
1370
- var zh_CN = {
1621
+ var zh_CN2 = {
1371
1622
  toolCore: {
1372
1623
  errors: {
1373
1624
  internal: "Internal error: {message}",
@@ -1407,7 +1658,7 @@ var zh_CN = {
1407
1658
  }
1408
1659
  }
1409
1660
  };
1410
- var zh_TW = {
1661
+ var zh_TW2 = {
1411
1662
  toolCore: {
1412
1663
  errors: {
1413
1664
  internal: "Internal error: {message}",
@@ -1447,7 +1698,7 @@ var zh_TW = {
1447
1698
  }
1448
1699
  }
1449
1700
  };
1450
- var zu = {
1701
+ var zu2 = {
1451
1702
  toolCore: {
1452
1703
  errors: {
1453
1704
  internal: "Internal error: {message}",
@@ -1488,65 +1739,65 @@ var zu = {
1488
1739
  }
1489
1740
  };
1490
1741
 
1491
- class TranslationService {
1742
+ class TranslationService2 {
1492
1743
  static instance;
1493
1744
  currentLocale = "en";
1494
1745
  constructor() {}
1495
1746
  static getInstance() {
1496
- if (!TranslationService.instance) {
1497
- TranslationService.instance = new TranslationService;
1747
+ if (!TranslationService2.instance) {
1748
+ TranslationService2.instance = new TranslationService2;
1498
1749
  }
1499
- return TranslationService.instance;
1750
+ return TranslationService2.instance;
1500
1751
  }
1501
1752
  setLocale(locale) {
1502
- this.currentLocale = I18nManager.setLocale(locale);
1753
+ this.currentLocale = I18nManager2.setLocale(locale);
1503
1754
  }
1504
1755
  getLocale() {
1505
1756
  return this.currentLocale;
1506
1757
  }
1507
1758
  t(key, params) {
1508
- return I18nManager.t(key, params, this.currentLocale);
1759
+ return I18nManager2.t(key, params, this.currentLocale);
1509
1760
  }
1510
1761
  tLocale(key, locale, params) {
1511
- return I18nManager.t(key, params, locale);
1762
+ return I18nManager2.t(key, params, locale);
1512
1763
  }
1513
1764
  has(key) {
1514
- return I18nManager.has(key, this.currentLocale);
1765
+ return I18nManager2.has(key, this.currentLocale);
1515
1766
  }
1516
1767
  getAvailableLocales() {
1517
- return I18nManager.getAvailableLocales();
1768
+ return I18nManager2.getAvailableLocales();
1518
1769
  }
1519
1770
  }
1520
- var translate = TranslationService.getInstance();
1521
- I18nManager.registerTranslations("en", en);
1522
- I18nManager.registerTranslations("de", de);
1523
- I18nManager.registerTranslations("es", es);
1524
- I18nManager.registerTranslations("es-mx", es_MX);
1525
- I18nManager.registerTranslations("fr", fr);
1526
- I18nManager.registerTranslations("ja", ja);
1527
- I18nManager.registerTranslations("ko", ko);
1528
- I18nManager.registerTranslations("pt", pt);
1529
- I18nManager.registerTranslations("pt-br", pt_BR);
1530
- I18nManager.registerTranslations("ro", ro);
1531
- I18nManager.registerTranslations("ru", ru);
1532
- I18nManager.registerTranslations("tr", tr);
1533
- I18nManager.registerTranslations("zh-cn", zh_CN);
1534
- I18nManager.registerTranslations("zh-tw", zh_TW);
1535
- I18nManager.registerTranslations("zu", zu);
1536
- I18nManager.setLocale("en");
1537
- var BuildConfiguration;
1538
- ((BuildConfiguration2) => {
1539
- BuildConfiguration2["Debug"] = "Debug";
1540
- BuildConfiguration2["Release"] = "Release";
1541
- })(BuildConfiguration ||= {});
1542
- var LogLevel;
1543
- ((LogLevel2) => {
1544
- LogLevel2["Debug"] = "Debug";
1545
- LogLevel2["Info"] = "Information";
1546
- LogLevel2["Warn"] = "Warning";
1547
- LogLevel2["Error"] = "Error";
1548
- })(LogLevel ||= {});
1549
- var NugetConstants = {
1771
+ var translate2 = TranslationService2.getInstance();
1772
+ I18nManager2.registerTranslations("en", en2);
1773
+ I18nManager2.registerTranslations("de", de2);
1774
+ I18nManager2.registerTranslations("es", es2);
1775
+ I18nManager2.registerTranslations("es-mx", es_MX2);
1776
+ I18nManager2.registerTranslations("fr", fr2);
1777
+ I18nManager2.registerTranslations("ja", ja2);
1778
+ I18nManager2.registerTranslations("ko", ko2);
1779
+ I18nManager2.registerTranslations("pt", pt2);
1780
+ I18nManager2.registerTranslations("pt-br", pt_BR2);
1781
+ I18nManager2.registerTranslations("ro", ro2);
1782
+ I18nManager2.registerTranslations("ru", ru2);
1783
+ I18nManager2.registerTranslations("tr", tr2);
1784
+ I18nManager2.registerTranslations("zh-cn", zh_CN2);
1785
+ I18nManager2.registerTranslations("zh-tw", zh_TW2);
1786
+ I18nManager2.registerTranslations("zu", zu2);
1787
+ I18nManager2.setLocale("en");
1788
+ var BuildConfiguration2;
1789
+ ((BuildConfiguration22) => {
1790
+ BuildConfiguration22["Debug"] = "Debug";
1791
+ BuildConfiguration22["Release"] = "Release";
1792
+ })(BuildConfiguration2 ||= {});
1793
+ var LogLevel2;
1794
+ ((LogLevel22) => {
1795
+ LogLevel22["Debug"] = "Debug";
1796
+ LogLevel22["Info"] = "Information";
1797
+ LogLevel22["Warn"] = "Warning";
1798
+ LogLevel22["Error"] = "Error";
1799
+ })(LogLevel2 ||= {});
1800
+ var NugetConstants2 = {
1550
1801
  OutputFolderName: "bundle",
1551
1802
  ContentFolderName: "content",
1552
1803
  OperateFileName: "operate.json",
@@ -1555,40 +1806,40 @@ var NugetConstants = {
1555
1806
  BindingsV2FileName: "bindings_v2.json",
1556
1807
  BindingsFileId: "bindings.json"
1557
1808
  };
1558
- var PackJobTargetKind;
1559
- ((PackJobTargetKind2) => {
1560
- PackJobTargetKind2["Serverless"] = "Serverless";
1561
- PackJobTargetKind2["LocalRobot"] = "LocalRobot";
1562
- })(PackJobTargetKind ||= {});
1563
- var ProjectTypes;
1564
- ((ProjectTypes2) => {
1565
- ProjectTypes2["Agent"] = "Agent";
1566
- ProjectTypes2["Api"] = "Api";
1567
- ProjectTypes2["BusinessRules"] = "BusinessRules";
1568
- ProjectTypes2["Connector"] = "Connector";
1569
- ProjectTypes2["CaseManagement"] = "CaseManagement";
1570
- ProjectTypes2["Flow"] = "Flow";
1571
- ProjectTypes2["Function"] = "Function";
1572
- ProjectTypes2["ProcessOrchestration"] = "ProcessOrchestration";
1573
- ProjectTypes2["Process"] = "Process";
1574
- ProjectTypes2["Library"] = "Library";
1575
- ProjectTypes2["WebApp"] = "WebApp";
1576
- ProjectTypes2["Tests"] = "Tests";
1577
- ProjectTypes2["AppV2"] = "AppV2";
1578
- })(ProjectTypes ||= {});
1579
- var TargetFramework;
1580
- ((TargetFramework2) => {
1581
- TargetFramework2["Portable"] = "Portable";
1582
- TargetFramework2["Windows"] = "Windows";
1583
- })(TargetFramework ||= {});
1584
- var ToolErrorCodes;
1585
- ((ToolErrorCodes2) => {
1586
- ToolErrorCodes2["Success"] = "SUCCESS";
1587
- ToolErrorCodes2["InternalError"] = "INTERNAL_ERROR";
1588
- ToolErrorCodes2["Canceled"] = "CANCELED";
1589
- })(ToolErrorCodes ||= {});
1809
+ var PackJobTargetKind2;
1810
+ ((PackJobTargetKind22) => {
1811
+ PackJobTargetKind22["Serverless"] = "Serverless";
1812
+ PackJobTargetKind22["LocalRobot"] = "LocalRobot";
1813
+ })(PackJobTargetKind2 ||= {});
1814
+ var ProjectTypes2;
1815
+ ((ProjectTypes22) => {
1816
+ ProjectTypes22["Agent"] = "Agent";
1817
+ ProjectTypes22["Api"] = "Api";
1818
+ ProjectTypes22["BusinessRules"] = "BusinessRules";
1819
+ ProjectTypes22["Connector"] = "Connector";
1820
+ ProjectTypes22["CaseManagement"] = "CaseManagement";
1821
+ ProjectTypes22["Flow"] = "Flow";
1822
+ ProjectTypes22["Function"] = "Function";
1823
+ ProjectTypes22["ProcessOrchestration"] = "ProcessOrchestration";
1824
+ ProjectTypes22["Process"] = "Process";
1825
+ ProjectTypes22["Library"] = "Library";
1826
+ ProjectTypes22["WebApp"] = "WebApp";
1827
+ ProjectTypes22["Tests"] = "Tests";
1828
+ ProjectTypes22["AppV2"] = "AppV2";
1829
+ })(ProjectTypes2 ||= {});
1830
+ var TargetFramework2;
1831
+ ((TargetFramework22) => {
1832
+ TargetFramework22["Portable"] = "Portable";
1833
+ TargetFramework22["Windows"] = "Windows";
1834
+ })(TargetFramework2 ||= {});
1835
+ var ToolErrorCodes2;
1836
+ ((ToolErrorCodes22) => {
1837
+ ToolErrorCodes22["Success"] = "SUCCESS";
1838
+ ToolErrorCodes22["InternalError"] = "INTERNAL_ERROR";
1839
+ ToolErrorCodes22["Canceled"] = "CANCELED";
1840
+ })(ToolErrorCodes2 ||= {});
1590
1841
 
1591
- class ToolResult {
1842
+ class ToolResult2 {
1592
1843
  errorCode;
1593
1844
  message;
1594
1845
  packages;
@@ -1604,10 +1855,10 @@ class ToolResult {
1604
1855
  return this.errorCode === "SUCCESS";
1605
1856
  }
1606
1857
  static success() {
1607
- return new ToolResult("SUCCESS");
1858
+ return new ToolResult2("SUCCESS");
1608
1859
  }
1609
1860
  static error(errorCode, message, instructions) {
1610
- return new ToolResult(errorCode, message, [], instructions);
1861
+ return new ToolResult2(errorCode, message, [], instructions);
1611
1862
  }
1612
1863
  }
1613
1864
  var OPERATE_FILE = "operate.json";
@@ -1639,8 +1890,8 @@ async function writeJsonObject(fs, filePath, data) {
1639
1890
  await fs.writeFile(filePath, `${JSON.stringify(data, null, 2)}
1640
1891
  `);
1641
1892
  }
1642
- async function ensureProjectId(projectPath, fs) {
1643
- const operatePath = Path.join(projectPath, OPERATE_FILE);
1893
+ async function ensureProjectId2(projectPath, fs) {
1894
+ const operatePath = Path2.join(projectPath, OPERATE_FILE);
1644
1895
  const operateExists = await fs.exists(operatePath);
1645
1896
  if (operateExists) {
1646
1897
  const operate = await readJsonObject(fs, operatePath);
@@ -1657,7 +1908,7 @@ async function ensureProjectId(projectPath, fs) {
1657
1908
  }
1658
1909
  return crypto.randomUUID();
1659
1910
  }
1660
- const projectFilePath = Path.join(projectPath, PROJECT_FILE);
1911
+ const projectFilePath = Path2.join(projectPath, PROJECT_FILE);
1661
1912
  const projectFileExists = await fs.exists(projectFilePath);
1662
1913
  if (projectFileExists) {
1663
1914
  const projectFile = await readJsonObject(fs, projectFilePath);
@@ -1747,16 +1998,16 @@ function generatePsmdcpXml(packageInfo) {
1747
1998
  </coreProperties>`;
1748
1999
  }
1749
2000
 
1750
- class NugetPackager {
2001
+ class NugetPackager2 {
1751
2002
  fileSystem;
1752
2003
  constructor(fileSystem) {
1753
2004
  this.fileSystem = fileSystem;
1754
2005
  }
1755
2006
  async packAsync(rootPath, packageInfo, outputPath) {
1756
- const normalizedOutputPath = Path.normalize(outputPath);
2007
+ const normalizedOutputPath = Path2.normalize(outputPath);
1757
2008
  const nuspecXml = generateNuspecXml(packageInfo);
1758
2009
  const nuspecFileName = `${packageInfo.id}.nuspec`;
1759
- const fileEntries = await Path.walkDirectory(this.fileSystem, rootPath);
2010
+ const fileEntries = await Path2.walkDirectory(this.fileSystem, rootPath);
1760
2011
  const zipContents = {};
1761
2012
  const encoder = new TextEncoder;
1762
2013
  const psmdcpId = Array.from({ length: 4 }, () => Math.floor(Math.random() * 4294967296).toString(16).padStart(8, "0")).join("");
@@ -1795,7 +2046,7 @@ class NugetPackager {
1795
2046
  }
1796
2047
  }
1797
2048
 
1798
- class ProjectTool {
2049
+ class ProjectTool2 {
1799
2050
  fileSystem;
1800
2051
  logger;
1801
2052
  static ProjectFileName = "project.uiproj";
@@ -1805,26 +2056,26 @@ class ProjectTool {
1805
2056
  }
1806
2057
  async restoreAsync(_options, _cancellationToken) {
1807
2058
  this.logger.info("Restore operation is a noop");
1808
- return ToolResult.success();
2059
+ return ToolResult2.success();
1809
2060
  }
1810
2061
  async validateAsync(_options, _cancellationToken) {
1811
2062
  this.logger.info("Validate operation is a noop");
1812
- return ToolResult.success();
2063
+ return ToolResult2.success();
1813
2064
  }
1814
2065
  async buildAsync(_options, _cancellationToken) {
1815
2066
  this.logger.info("Build operation is a noop");
1816
- return ToolResult.success();
2067
+ return ToolResult2.success();
1817
2068
  }
1818
2069
  async packAsync(_options, _cancellationToken) {
1819
2070
  this.logger.info("Pack operation is a noop");
1820
- return ToolResult.success();
2071
+ return ToolResult2.success();
1821
2072
  }
1822
2073
  async cleanupAsync(_options, _cancellationToken) {
1823
2074
  this.logger.info("Cleanup operation is a noop");
1824
- return ToolResult.success();
2075
+ return ToolResult2.success();
1825
2076
  }
1826
2077
  async getUiProjectAsync(projectPath) {
1827
- const filePath = Path.join(projectPath, ProjectTool.ProjectFileName);
2078
+ const filePath = Path2.join(projectPath, ProjectTool2.ProjectFileName);
1828
2079
  if (!await this.fileSystem.exists(filePath)) {
1829
2080
  return;
1830
2081
  }
@@ -1837,7 +2088,7 @@ class ProjectTool {
1837
2088
  }
1838
2089
  async dispose() {}
1839
2090
  }
1840
- class ToolsFactoryRepository {
2091
+ class ToolsFactoryRepository2 {
1841
2092
  projectFactoryMap = new Map;
1842
2093
  solutionFactory = null;
1843
2094
  registerProjectToolFactory(factory) {
@@ -1876,42 +2127,118 @@ class ToolsFactoryRepository {
1876
2127
  this.solutionFactory = null;
1877
2128
  }
1878
2129
  }
1879
- var REGISTRY_KEY = Symbol.for("@uipath/solutionpackager-tool-core/toolsFactoryRepository");
1880
- var _global = globalThis;
1881
- if (!_global[REGISTRY_KEY]) {
1882
- _global[REGISTRY_KEY] = new ToolsFactoryRepository;
2130
+ var REGISTRY_KEY2 = Symbol.for("@uipath/solutionpackager-tool-core/toolsFactoryRepository");
2131
+ var _global2 = globalThis;
2132
+ if (!_global2[REGISTRY_KEY2]) {
2133
+ _global2[REGISTRY_KEY2] = new ToolsFactoryRepository2;
1883
2134
  }
1884
- var toolsFactoryRepository = _global[REGISTRY_KEY];
2135
+ var toolsFactoryRepository2 = _global2[REGISTRY_KEY2];
1885
2136
 
1886
- // ../packager/packager-tool-functions/dist/index.js
1887
- var EXCLUDED_NAMES = new Set([
1888
- "node_modules",
1889
- ".git",
1890
- ".env",
1891
- ".deno",
1892
- "dist",
1893
- ".uipath"
1894
- ]);
1895
- var EXCLUDED_EXTENSIONS = [".nupkg"];
1896
- var NPMRC = ".npmrc";
1897
- var UIPATH_SCOPE = "@uipath:";
2137
+ // ../../node_modules/@uipath/coded-functions-js-packager/dist/index.js
2138
+ var npm = { name: "npm", lockFile: "package-lock.json", installHint: "npm install" };
2139
+ var bun = { name: "bun", lockFile: "bun.lock", installHint: "bun install" };
2140
+ var SUPPORTED_MANAGERS = [npm, bun];
2141
+ var RECOGNIZED_UNSUPPORTED_LOCK_FILES = ["yarn.lock", "pnpm-lock.yaml", "bun.lockb"];
2142
+ function detectPackageManager(present) {
2143
+ const supported = SUPPORTED_MANAGERS.filter((manager) => present.has(manager.lockFile));
2144
+ if (supported.length > 1)
2145
+ return { kind: "ambiguous", managers: supported };
2146
+ if (supported.length === 1)
2147
+ return { kind: "found", manager: supported[0] };
2148
+ const unsupported = RECOGNIZED_UNSUPPORTED_LOCK_FILES.filter((name) => present.has(name));
2149
+ return unsupported.length > 0 ? { kind: "unsupported", fileNames: unsupported } : { kind: "none" };
2150
+ }
2151
+ var CANDIDATE_LOCK_FILES = [
2152
+ ...SUPPORTED_MANAGERS.map((manager) => manager.lockFile),
2153
+ ...RECOGNIZED_UNSUPPORTED_LOCK_FILES
2154
+ ];
2155
+ async function probeLockFiles(reader) {
2156
+ const present = new Set;
2157
+ for (const fileName of CANDIDATE_LOCK_FILES) {
2158
+ if (await reader.fileExists(fileName))
2159
+ present.add(fileName);
2160
+ }
2161
+ return present;
2162
+ }
2163
+ function supportedLockFilesLabel() {
2164
+ return SUPPORTED_MANAGERS.map((manager) => `${manager.lockFile} (${manager.name})`).join(" or ");
2165
+ }
2166
+ function describeDependencyProblem(detection) {
2167
+ const defaultHint = SUPPORTED_MANAGERS[0].installHint;
2168
+ switch (detection.kind) {
2169
+ case "none":
2170
+ return {
2171
+ problem: `No dependency lock file found; expected ${supportedLockFilesLabel()}.`,
2172
+ remedyCommand: defaultHint
2173
+ };
2174
+ case "unsupported": {
2175
+ const names = detection.fileNames.join(" and ");
2176
+ return {
2177
+ problem: `Found ${names}, which cannot be installed from; expected ${supportedLockFilesLabel()}. ` + `Create a supported lock file, then delete ${names}.`,
2178
+ remedyCommand: defaultHint
2179
+ };
2180
+ }
2181
+ case "ambiguous":
2182
+ return {
2183
+ problem: `Found ${detection.managers.map((manager) => manager.lockFile).join(" and ")}. Keep exactly one: ` + `with two lock files the installer that runs on the pod picks one and the other's resolution ` + `is silently ignored.`,
2184
+ remedyCommand: null
2185
+ };
2186
+ }
2187
+ }
2188
+ var REGISTRY_CONFIG_FILE = ".npmrc";
2189
+ function isRegistryConfigFile(fileName) {
2190
+ return fileName === REGISTRY_CONFIG_FILE;
2191
+ }
1898
2192
  var CREDENTIAL_KEYS = ["_authtoken", "_auth", "_password"];
1899
2193
  function isComment(line) {
1900
2194
  return line === "" || line.startsWith("#") || line.startsWith(";");
1901
2195
  }
1902
- function isOurs(line) {
2196
+ function settingKey(line) {
1903
2197
  const trimmed = line.trim();
1904
2198
  if (isComment(trimmed))
1905
- return false;
1906
- const key = (trimmed.split("=")[0] ?? "").trim().toLowerCase();
1907
- return key.startsWith(UIPATH_SCOPE) || CREDENTIAL_KEYS.some((c) => key.endsWith(c));
2199
+ return null;
2200
+ return (trimmed.split("=")[0] ?? "").trim().toLowerCase();
1908
2201
  }
1909
- function sanitizeNpmrc(content) {
1910
- const kept = content.split(/\r?\n/).filter((line) => !isOurs(line));
2202
+ function sanitizeRegistryConfig(content, stripScopes) {
2203
+ const stripped = stripScopes.map((scope) => `${scope.replace(/:$/, "")}:`.toLowerCase());
2204
+ const kept = content.split(/\r?\n/).filter((line) => {
2205
+ const key = settingKey(line);
2206
+ if (key === null)
2207
+ return true;
2208
+ if (stripped.some((scope) => key.startsWith(scope)))
2209
+ return false;
2210
+ return !CREDENTIAL_KEYS.some((credential) => key.endsWith(credential));
2211
+ });
1911
2212
  return kept.some((line) => !isComment(line.trim())) ? kept.join(`
1912
2213
  `) : null;
1913
2214
  }
1914
- var LOCK_FILES = new Set(["bun.lock", "package-lock.json", "deno.lock", "yarn.lock"]);
2215
+ function ifsProjectFileReader(fs, projectPath) {
2216
+ return {
2217
+ async fileExists(fileName) {
2218
+ try {
2219
+ return await fs.exists(fs.path.join(projectPath, fileName));
2220
+ } catch {
2221
+ return false;
2222
+ }
2223
+ },
2224
+ async readFile(fileName) {
2225
+ const content = await fs.readFile(fs.path.join(projectPath, fileName), "utf-8");
2226
+ if (content === null)
2227
+ throw new Error(`${fileName} not found in ${projectPath}.`);
2228
+ return content;
2229
+ }
2230
+ };
2231
+ }
2232
+ var EXCLUDED_NAMES = new Set([
2233
+ "node_modules",
2234
+ ".git",
2235
+ ".env",
2236
+ ".deno",
2237
+ "dist",
2238
+ ".uipath"
2239
+ ]);
2240
+ var EXCLUDED_EXTENSIONS = [".nupkg"];
2241
+ var SCOPES_NOT_PACKAGED = ["@uipath"];
1915
2242
  async function buildFunctionsPackage(fs, options) {
1916
2243
  const { projectPath, outputPath, projectStorageId } = options;
1917
2244
  const contentPath = fs.path.join(outputPath, "content");
@@ -1935,8 +2262,16 @@ async function buildFunctionsPackage(fs, options) {
1935
2262
  const packageJsonRaw = await fs.readFile(fs.path.join(projectPath, "package.json"), "utf-8");
1936
2263
  const packageDependencies = packageJsonRaw ? JSON.parse(packageJsonRaw).dependencies ?? {} : {};
1937
2264
  const targetRuntime = detectRuntime(uipathJson.functions);
1938
- const includeLockFile = options.excludeLockFile ? false : uipathJson.packOptions?.includeLockFile ?? true;
1939
- await copyProjectFiles(fs, projectPath, contentPath, includeLockFile, uipathJson.packOptions);
2265
+ const detection = detectPackageManager(await probeLockFiles(ifsProjectFileReader(fs, projectPath)));
2266
+ if (detection.kind !== "found") {
2267
+ const { problem, remedyCommand } = describeDependencyProblem(detection);
2268
+ throw new Error(remedyCommand !== null ? `${problem} Run '${remedyCommand}' in the project, then pack again.` : `${problem} Then pack again.`);
2269
+ }
2270
+ const lockFile = detection.manager.lockFile;
2271
+ if (uipathJson.packOptions?.includeLockFile === false) {
2272
+ console.warn(`uipath.json packOptions.includeLockFile is ignored: ${lockFile} is always packaged.`);
2273
+ }
2274
+ await copyProjectFiles(fs, projectPath, contentPath, lockFile, uipathJson.packOptions);
1940
2275
  const operateJson = {
1941
2276
  $schema: "https://cloud.uipath.com/draft/2024-12/operate",
1942
2277
  projectId: projectStorageId,
@@ -1982,9 +2317,10 @@ function detectRuntime(functions) {
1982
2317
  return "python";
1983
2318
  return "javascript";
1984
2319
  }
1985
- async function copyProjectFiles(fs, sourcePath, destPath, includeLockFile, packOptions) {
2320
+ async function copyProjectFiles(fs, sourcePath, destPath, lockFile, packOptions) {
1986
2321
  const extraExcludedDirs = new Set(packOptions?.directoriesExcluded ?? []);
1987
2322
  const extraExcludedFiles = new Set(packOptions?.filesExcluded ?? []);
2323
+ const otherLockFiles = new Set(CANDIDATE_LOCK_FILES.filter((name) => name !== lockFile));
1988
2324
  async function walk(src, dest) {
1989
2325
  await fs.mkdir(dest);
1990
2326
  const entries = await fs.readdir(src);
@@ -1997,15 +2333,16 @@ async function copyProjectFiles(fs, sourcePath, destPath, includeLockFile, packO
1997
2333
  continue;
1998
2334
  if (EXCLUDED_EXTENSIONS.some((ext) => name.endsWith(ext)))
1999
2335
  continue;
2000
- if (!includeLockFile && LOCK_FILES.has(name))
2336
+ if (otherLockFiles.has(name))
2001
2337
  continue;
2002
2338
  const srcEntry = fs.path.join(src, name);
2003
2339
  const destEntry = fs.path.join(dest, name);
2004
2340
  const stat = await fs.stat(srcEntry);
2005
2341
  if (stat?.isDirectory()) {
2006
2342
  await walk(srcEntry, destEntry);
2007
- } else if (name === NPMRC) {
2008
- const sanitized = sanitizeNpmrc(await fs.readFile(srcEntry, "utf-8") ?? "");
2343
+ } else if (isRegistryConfigFile(name)) {
2344
+ const raw = await fs.readFile(srcEntry, "utf-8") ?? "";
2345
+ const sanitized = sanitizeRegistryConfig(raw, SCOPES_NOT_PACKAGED);
2009
2346
  if (sanitized !== null)
2010
2347
  await fs.writeFile(destEntry, sanitized);
2011
2348
  } else if (stat?.isFile()) {
@@ -2017,6 +2354,8 @@ async function copyProjectFiles(fs, sourcePath, destPath, includeLockFile, packO
2017
2354
  }
2018
2355
  await walk(sourcePath, destPath);
2019
2356
  }
2357
+
2358
+ // ../packager/packager-tool-functions/src/js/build-js-functions-package.ts
2020
2359
  async function buildJsFunctionsPackage(fileSystem, options) {
2021
2360
  await buildFunctionsPackage(fileSystem, {
2022
2361
  projectPath: options.projectPath,
@@ -2024,6 +2363,7 @@ async function buildJsFunctionsPackage(fileSystem, options) {
2024
2363
  projectStorageId: options.projectStorageId
2025
2364
  });
2026
2365
  }
2366
+ // ../packager/packager-tool-functions/src/py/constants.ts
2027
2367
  var EXCLUDED_NAMES2 = new Set([
2028
2368
  "agent.json",
2029
2369
  "project.uiproj",
@@ -2060,8 +2400,10 @@ var SCHEMAS = {
2060
2400
  Operate: `${SCHEMA_BASE_URL}/operate`,
2061
2401
  PackageDescriptor: `${SCHEMA_BASE_URL}/package-descriptor`
2062
2402
  };
2403
+
2404
+ // ../packager/packager-tool-functions/src/py/build-py-functions-package.ts
2063
2405
  async function buildPyFunctionsPackage(fileSystem, options) {
2064
- const contentFolder = Path.join(options.outputPath, NugetConstants.ContentFolderName);
2406
+ const contentFolder = Path2.join(options.outputPath, NugetConstants2.ContentFolderName);
2065
2407
  await validateProjectFiles(fileSystem, options.projectPath);
2066
2408
  await copyFiles(fileSystem, options.projectPath, contentFolder);
2067
2409
  await writeEntryPointsFile(fileSystem, options.projectPath, contentFolder);
@@ -2070,8 +2412,8 @@ async function buildPyFunctionsPackage(fileSystem, options) {
2070
2412
  await createPackageDescriptor(fileSystem, options.outputPath);
2071
2413
  }
2072
2414
  async function validateProjectFiles(fileSystem, projectPath) {
2073
- const uipathJsonPath = Path.join(projectPath, UIPATH_JSON_FILE_NAME);
2074
- const entryPointsPath = Path.join(projectPath, NugetConstants.EntryPointsFileName);
2415
+ const uipathJsonPath = Path2.join(projectPath, UIPATH_JSON_FILE_NAME);
2416
+ const entryPointsPath = Path2.join(projectPath, NugetConstants2.EntryPointsFileName);
2075
2417
  if (!await fileSystem.exists(uipathJsonPath)) {
2076
2418
  throw new Error("uipath.json is missing from the project.");
2077
2419
  }
@@ -2083,8 +2425,8 @@ async function copyFiles(fileSystem, sourcePath, destinationPath) {
2083
2425
  await fileSystem.mkdir(destinationPath);
2084
2426
  const entries = await fileSystem.readdir(sourcePath);
2085
2427
  for (const entry of entries) {
2086
- const sourceFile = Path.join(sourcePath, entry);
2087
- const destinationFile = Path.join(destinationPath, entry);
2428
+ const sourceFile = Path2.join(sourcePath, entry);
2429
+ const destinationFile = Path2.join(destinationPath, entry);
2088
2430
  const stat = await fileSystem.stat(sourceFile);
2089
2431
  if (stat?.isFile()) {
2090
2432
  if (EXCLUDED_NAMES2.has(entry)) {
@@ -2103,12 +2445,12 @@ async function copyFiles(fileSystem, sourcePath, destinationPath) {
2103
2445
  }
2104
2446
  }
2105
2447
  async function createOperateFile(fileSystem, contentFolder, projectStorageId) {
2106
- const operateJsonFilePath = Path.join(contentFolder, NugetConstants.OperateFileName);
2448
+ const operateJsonFilePath = Path2.join(contentFolder, NugetConstants2.OperateFileName);
2107
2449
  const exists = await fileSystem.exists(operateJsonFilePath);
2108
2450
  if (exists) {
2109
2451
  return;
2110
2452
  }
2111
- const entryPointsFilePath = Path.join(contentFolder, NugetConstants.EntryPointsFileName);
2453
+ const entryPointsFilePath = Path2.join(contentFolder, NugetConstants2.EntryPointsFileName);
2112
2454
  let mainPath = "";
2113
2455
  const entryPointsExists = await fileSystem.exists(entryPointsFilePath);
2114
2456
  if (entryPointsExists) {
@@ -2138,8 +2480,8 @@ async function createOperateFile(fileSystem, contentFolder, projectStorageId) {
2138
2480
  await fileSystem.writeFile(operateJsonFilePath, operateJsonString);
2139
2481
  }
2140
2482
  async function writeEntryPointsFile(fileSystem, projectPath, contentFolder) {
2141
- const sourcePath = Path.join(projectPath, NugetConstants.EntryPointsFileName);
2142
- const destinationPath = Path.join(contentFolder, NugetConstants.EntryPointsFileName);
2483
+ const sourcePath = Path2.join(projectPath, NugetConstants2.EntryPointsFileName);
2484
+ const destinationPath = Path2.join(contentFolder, NugetConstants2.EntryPointsFileName);
2143
2485
  const raw = await fileSystem.readFile(sourcePath);
2144
2486
  if (!raw) {
2145
2487
  throw new Error("entry-points.json is missing from the project.");
@@ -2158,14 +2500,14 @@ async function writeEntryPointsFile(fileSystem, projectPath, contentFolder) {
2158
2500
  }));
2159
2501
  const normalized = {
2160
2502
  $schema: SCHEMAS.EntryPoint,
2161
- $id: NugetConstants.EntryPointsFileName,
2503
+ $id: NugetConstants2.EntryPointsFileName,
2162
2504
  entryPoints: normalizedEntries
2163
2505
  };
2164
2506
  await fileSystem.writeFile(destinationPath, JSON.stringify(normalized, null, 2));
2165
2507
  }
2166
2508
  async function createBindingsFile(fileSystem, projectPath, contentFolder) {
2167
- const bindingsOutputPath = Path.join(contentFolder, NugetConstants.BindingsV2FileName);
2168
- const sourcePath = Path.join(projectPath, BINDINGS_SOURCE_FILE_NAME);
2509
+ const bindingsOutputPath = Path2.join(contentFolder, NugetConstants2.BindingsV2FileName);
2510
+ const sourcePath = Path2.join(projectPath, BINDINGS_SOURCE_FILE_NAME);
2169
2511
  let bindings = null;
2170
2512
  if (await fileSystem.exists(sourcePath)) {
2171
2513
  const raw = await fileSystem.readFile(sourcePath);
@@ -2190,10 +2532,10 @@ async function createPackageDescriptor(fileSystem, localBuildFolder) {
2190
2532
  const packageDescriptor = {
2191
2533
  files: {}
2192
2534
  };
2193
- addFileToDescriptor(packageDescriptor, NugetConstants.OperateFileName, NugetConstants.OperateFileName);
2194
- addFileToDescriptor(packageDescriptor, NugetConstants.EntryPointsFileName, NugetConstants.EntryPointsFileName);
2195
- addFileToDescriptor(packageDescriptor, NugetConstants.BindingsFileId, NugetConstants.BindingsV2FileName);
2196
- const packageDescriptorPath = Path.join(localBuildFolder, NugetConstants.ContentFolderName, NugetConstants.PackageDescriptorFileName);
2535
+ addFileToDescriptor(packageDescriptor, NugetConstants2.OperateFileName, NugetConstants2.OperateFileName);
2536
+ addFileToDescriptor(packageDescriptor, NugetConstants2.EntryPointsFileName, NugetConstants2.EntryPointsFileName);
2537
+ addFileToDescriptor(packageDescriptor, NugetConstants2.BindingsFileId, NugetConstants2.BindingsV2FileName);
2538
+ const packageDescriptorPath = Path2.join(localBuildFolder, NugetConstants2.ContentFolderName, NugetConstants2.PackageDescriptorFileName);
2197
2539
  const packageDescriptorJson = JSON.stringify({
2198
2540
  $schema: SCHEMAS.PackageDescriptor,
2199
2541
  ...packageDescriptor
@@ -2201,9 +2543,10 @@ async function createPackageDescriptor(fileSystem, localBuildFolder) {
2201
2543
  await fileSystem.writeFile(packageDescriptorPath, packageDescriptorJson);
2202
2544
  }
2203
2545
  function addFileToDescriptor(packageDescriptor, key, fileName) {
2204
- const relativePath = Path.join(NugetConstants.ContentFolderName, fileName);
2546
+ const relativePath = Path2.join(NugetConstants2.ContentFolderName, fileName);
2205
2547
  packageDescriptor.files[key] = relativePath;
2206
2548
  }
2549
+ // ../packager/packager-tool-functions/src/types.ts
2207
2550
  var Languages = {
2208
2551
  JavaScript: "javascript",
2209
2552
  Python: "python"
@@ -2213,39 +2556,40 @@ var LanguageLabels = {
2213
2556
  [Languages.Python]: "Python"
2214
2557
  };
2215
2558
 
2216
- class FunctionsTool extends ProjectTool {
2559
+ // ../packager/packager-tool-functions/src/functions-tool.ts
2560
+ class FunctionsTool extends ProjectTool2 {
2217
2561
  _temporaryStorage;
2218
2562
  constructor(fileSystem, logger) {
2219
2563
  super(fileSystem, logger);
2220
- this._temporaryStorage = new TemporaryStorageService(fileSystem);
2564
+ this._temporaryStorage = new TemporaryStorageService2(fileSystem);
2221
2565
  }
2222
2566
  async restoreAsync(_options, _cancellationToken) {
2223
2567
  this.logger.info("Restore not required for Functions projects.");
2224
- return ToolResult.success();
2568
+ return ToolResult2.success();
2225
2569
  }
2226
2570
  async validateAsync(_options, _cancellationToken) {
2227
2571
  this.logger.info("Validate not required for Functions projects.");
2228
- return ToolResult.success();
2572
+ return ToolResult2.success();
2229
2573
  }
2230
2574
  async buildAsync(options, _cancellationToken) {
2231
2575
  const language = await this.detectLanguage(options.projectPath);
2232
2576
  const tempFolder = await this._temporaryStorage.getTempFolderPath();
2233
- const localBuildFolder = Path.join(tempFolder, NugetConstants.OutputFolderName);
2577
+ const localBuildFolder = Path2.join(tempFolder, NugetConstants2.OutputFolderName);
2234
2578
  const build = language === Languages.Python ? buildPyFunctionsPackage : buildJsFunctionsPackage;
2235
2579
  const languageLabel = LanguageLabels[language];
2236
2580
  try {
2237
2581
  this.logger.progress(`Building ${languageLabel} Functions package...`);
2238
- const projectStorageId = options.projectStorageId ?? await ensureProjectId(options.projectPath, this.fileSystem);
2582
+ const projectStorageId = options.projectStorageId ?? await ensureProjectId2(options.projectPath, this.fileSystem);
2239
2583
  await build(this.fileSystem, {
2240
2584
  projectPath: options.projectPath,
2241
2585
  outputPath: localBuildFolder,
2242
2586
  projectStorageId
2243
2587
  });
2244
- return new ToolResult(ToolErrorCodes.Success, "Build completed successfully.", [localBuildFolder]);
2588
+ return new ToolResult2(ToolErrorCodes2.Success, "Build completed successfully.", [localBuildFolder]);
2245
2589
  } catch (error) {
2246
2590
  const errorMessage = error instanceof Error ? error.toString() : String(error);
2247
2591
  this.logger.error(errorMessage);
2248
- return ToolResult.error(ToolErrorCodes.InternalError, `Build failed for ${languageLabel} Functions project.`);
2592
+ return ToolResult2.error(ToolErrorCodes2.InternalError, `Build failed for ${languageLabel} Functions project.`);
2249
2593
  }
2250
2594
  }
2251
2595
  async packAsync(options, cancellationToken) {
@@ -2257,15 +2601,15 @@ class FunctionsTool extends ProjectTool {
2257
2601
  try {
2258
2602
  this.logger.progress("Creating NuGet package...");
2259
2603
  const nupkgFileName = `${options.package.id}.${options.package.version}.nupkg`;
2260
- const nupkgPath = Path.join(options.outputPath, nupkgFileName);
2261
- const packager = new NugetPackager(this.fileSystem);
2604
+ const nupkgPath = Path2.join(options.outputPath, nupkgFileName);
2605
+ const packager = new NugetPackager2(this.fileSystem);
2262
2606
  const result = await packager.packAsync(localBuildFolder, options.package, nupkgPath);
2263
2607
  this.logger.progress("Package created successfully.");
2264
- return new ToolResult(ToolErrorCodes.Success, "Pack completed successfully.", [result.outputPath]);
2608
+ return new ToolResult2(ToolErrorCodes2.Success, "Pack completed successfully.", [result.outputPath]);
2265
2609
  } catch (error) {
2266
2610
  const errorMessage = error instanceof Error ? error.toString() : String(error);
2267
2611
  this.logger.error(errorMessage);
2268
- return ToolResult.error(ToolErrorCodes.InternalError, "Pack failed for Functions project.");
2612
+ return ToolResult2.error(ToolErrorCodes2.InternalError, "Pack failed for Functions project.");
2269
2613
  }
2270
2614
  }
2271
2615
  async dispose() {
@@ -2275,7 +2619,7 @@ class FunctionsTool extends ProjectTool {
2275
2619
  } catch {}
2276
2620
  }
2277
2621
  async detectLanguage(projectPath) {
2278
- const uipathJsonContent = await this.fileSystem.readFile(Path.join(projectPath, "uipath.json"), "utf-8");
2622
+ const uipathJsonContent = await this.fileSystem.readFile(Path2.join(projectPath, "uipath.json"), "utf-8");
2279
2623
  if (uipathJsonContent) {
2280
2624
  try {
2281
2625
  const uipathJson = JSON.parse(uipathJsonContent);
@@ -2290,20 +2634,19 @@ class FunctionsTool extends ProjectTool {
2290
2634
  }
2291
2635
  } catch {}
2292
2636
  }
2293
- const pyprojectStat = await this.fileSystem.stat(Path.join(projectPath, "pyproject.toml"));
2637
+ const pyprojectStat = await this.fileSystem.stat(Path2.join(projectPath, "pyproject.toml"));
2294
2638
  if (pyprojectStat?.isFile())
2295
2639
  return Languages.Python;
2296
2640
  return Languages.JavaScript;
2297
2641
  }
2298
2642
  }
2299
-
2643
+ // ../packager/packager-tool-functions/src/functions-tool-factory.ts
2300
2644
  class FunctionsToolFactory {
2301
- supportedTypes = [ProjectTypes.Function];
2645
+ supportedTypes = [ProjectTypes2.Function];
2302
2646
  async createAsync(logger, fileSystem) {
2303
2647
  return new FunctionsTool(fileSystem, logger);
2304
2648
  }
2305
2649
  }
2306
-
2307
2650
  // src/services/manifest-generating-functions-tool.ts
2308
2651
  function createManifestGeneratingFunctionsToolFactory() {
2309
2652
  class ManifestGeneratingFunctionsTool extends FunctionsTool {
@@ -2312,12 +2655,12 @@ function createManifestGeneratingFunctionsToolFactory() {
2312
2655
  if (language === Languages.JavaScript) {
2313
2656
  this.logger.progress("Generating Functions manifests...");
2314
2657
  try {
2315
- const { generateManifests } = await import("./cliRunner-gtb0dftd.js");
2658
+ const { generateManifests } = await import("./cliRunner-23vh097s.js");
2316
2659
  await generateManifests(options.projectPath);
2317
2660
  } catch (error) {
2318
2661
  const errorMessage = error instanceof Error ? error.toString() : String(error);
2319
2662
  this.logger.error(errorMessage);
2320
- return ToolResult.error(ToolErrorCodes.InternalError, "Manifest generation failed for JS/TS Functions project.");
2663
+ return ToolResult.error("INTERNAL_ERROR" /* InternalError */, "Manifest generation failed for JS/TS Functions project.");
2321
2664
  }
2322
2665
  }
2323
2666
  return super.buildAsync(options, cancellationToken);
@@ -2340,4 +2683,4 @@ export {
2340
2683
  registerPackagerFactories
2341
2684
  };
2342
2685
 
2343
- //# debugId=F1DD9E77602436F664756E2164756E21
2686
+ //# debugId=1176BB1F0904B21364756E2164756E21