@uipath/agent-tool 1.203.0-preview.203 → 1.204.0-preview.206

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,3 +1,11 @@
1
+ import {
2
+ NugetConstants,
3
+ NugetPackager,
4
+ Path,
5
+ ProjectTool,
6
+ TemporaryStorageService,
7
+ ToolResult
8
+ } from "./packager-tool-22e4nhzm.js";
1
9
  import {
2
10
  applyMigrations,
3
11
  currentAgentStorageSchema,
@@ -8,9 +16,6 @@ import {
8
16
  getLatestVersion,
9
17
  migrations
10
18
  } from "./packager-tool-mc1499dc.js";
11
- import {
12
- zipSync
13
- } from "./packager-tool-b098y4a2.js";
14
19
  import {
15
20
  __commonJS,
16
21
  __export,
@@ -1800,1178 +1805,6 @@ var require_semver2 = __commonJS(function(exports, module) {
1800
1805
  };
1801
1806
  });
1802
1807
 
1803
- // ../packager/packager-core/dist/index.js
1804
- class Path {
1805
- static normalize(path) {
1806
- return path.replace(/\\/g, "/").replace(/\/+/g, "/");
1807
- }
1808
- static join(...segments) {
1809
- return Path.normalize(segments.filter((s) => s.length > 0).join("/"));
1810
- }
1811
- static dirname(path) {
1812
- const normalized = Path.normalize(path).replace(/\/$/, "");
1813
- if (normalized === "")
1814
- return ".";
1815
- const lastSlash = normalized.lastIndexOf("/");
1816
- if (lastSlash === -1)
1817
- return ".";
1818
- if (lastSlash === 0)
1819
- return "/";
1820
- return normalized.substring(0, lastSlash);
1821
- }
1822
- static basename(path) {
1823
- const normalized = Path.normalize(path).replace(/\/$/, "");
1824
- if (normalized === "")
1825
- return "";
1826
- const lastSlash = normalized.lastIndexOf("/");
1827
- return lastSlash >= 0 ? normalized.substring(lastSlash + 1) : normalized;
1828
- }
1829
- static extname(path) {
1830
- const base = Path.basename(path);
1831
- const lastDot = base.lastIndexOf(".");
1832
- if (lastDot === -1 || lastDot === 0 || lastDot === base.length - 1) {
1833
- return "";
1834
- }
1835
- return base.substring(lastDot);
1836
- }
1837
- static async walkDirectory(fs, rootPath, currentRelativePath = "") {
1838
- const entries = [];
1839
- const absolutePath = currentRelativePath ? Path.join(rootPath, currentRelativePath) : rootPath;
1840
- const items = await fs.readdir(absolutePath);
1841
- for (const item of items) {
1842
- const itemRelativePath = currentRelativePath ? Path.join(currentRelativePath, item) : item;
1843
- const itemAbsolutePath = Path.join(rootPath, itemRelativePath);
1844
- const stat = await fs.stat(itemAbsolutePath);
1845
- if (stat?.isDirectory()) {
1846
- const subEntries = await Path.walkDirectory(fs, rootPath, itemRelativePath);
1847
- entries.push(...subEntries);
1848
- } else if (stat?.isFile()) {
1849
- entries.push({
1850
- relativePath: Path.normalize(itemRelativePath),
1851
- absolutePath: Path.normalize(itemAbsolutePath)
1852
- });
1853
- }
1854
- }
1855
- return entries;
1856
- }
1857
- }
1858
-
1859
- class TemporaryStorageService {
1860
- fileSystem;
1861
- _tempFolderPath = null;
1862
- constructor(fileSystem) {
1863
- this.fileSystem = fileSystem;
1864
- }
1865
- async getTempFolderPath() {
1866
- if (!this._tempFolderPath) {
1867
- const systemTempDir = await this.fileSystem.getTempDir();
1868
- const uniqueFolderName = this.generateUniqueFolderName();
1869
- this._tempFolderPath = Path.join(systemTempDir, uniqueFolderName);
1870
- await this.fileSystem.mkdir(this._tempFolderPath);
1871
- }
1872
- return this._tempFolderPath;
1873
- }
1874
- generateUniqueFolderName() {
1875
- const timestamp = Date.now();
1876
- const random = Math.random().toString(36).substring(2, 10);
1877
- return `tool-temp-${timestamp}-${random}`;
1878
- }
1879
- async getTempSubfolderPathAsync(subfolder) {
1880
- const tempFolderPath = await this.getTempFolderPath();
1881
- const inputPath = Path.join(tempFolderPath, subfolder);
1882
- await this.fileSystem.mkdir(inputPath);
1883
- return inputPath;
1884
- }
1885
- async cleanup() {
1886
- try {
1887
- if (!this._tempFolderPath) {
1888
- return;
1889
- }
1890
- try {
1891
- const stats = await this.fileSystem.stat(this._tempFolderPath);
1892
- if (!stats) {
1893
- return;
1894
- }
1895
- } catch {
1896
- return;
1897
- }
1898
- const _pathToCleanup = this._tempFolderPath;
1899
- await this.fileSystem.rm(this._tempFolderPath);
1900
- this._tempFolderPath = null;
1901
- } catch {}
1902
- }
1903
- }
1904
- function isPluralForm(value) {
1905
- return typeof value === "object" && value !== null && "other" in value;
1906
- }
1907
- function selectPluralForm(forms, count) {
1908
- if (count === 0 && forms.zero !== undefined) {
1909
- return forms.zero;
1910
- }
1911
- if (count === 1 && forms.one !== undefined) {
1912
- return forms.one;
1913
- }
1914
- if (count === 2 && forms.two !== undefined) {
1915
- return forms.two;
1916
- }
1917
- if (forms.few !== undefined) {
1918
- const mod10 = count % 10;
1919
- const mod100 = count % 100;
1920
- if (mod10 >= 2 && mod10 <= 4 && (mod100 < 10 || mod100 >= 20)) {
1921
- return forms.few;
1922
- }
1923
- }
1924
- if (forms.many !== undefined) {
1925
- const mod10 = count % 10;
1926
- const mod100 = count % 100;
1927
- if (count === 0 || mod10 === 0 && mod100 !== 0 || mod10 >= 5 && mod10 <= 9 || mod100 >= 11 && mod100 <= 14) {
1928
- return forms.many;
1929
- }
1930
- }
1931
- return forms.other;
1932
- }
1933
-
1934
- class I18nManager {
1935
- static translations = {};
1936
- static currentLocale = "en";
1937
- static fallbackLocale = "en";
1938
- static registerTranslations(locale, catalog) {
1939
- if (!I18nManager.translations[locale]) {
1940
- I18nManager.translations[locale] = {};
1941
- }
1942
- I18nManager.translations[locale] = I18nManager.deepMerge(I18nManager.translations[locale], catalog);
1943
- }
1944
- static setLocale(locale) {
1945
- const normalized = I18nManager.normalizeLocale(locale);
1946
- if (I18nManager.translations[normalized]) {
1947
- I18nManager.currentLocale = normalized;
1948
- return normalized;
1949
- }
1950
- const baseLocale = normalized.split("-")[0];
1951
- if (baseLocale !== normalized && I18nManager.translations[baseLocale]) {
1952
- I18nManager.currentLocale = baseLocale;
1953
- return baseLocale;
1954
- }
1955
- return I18nManager.currentLocale;
1956
- }
1957
- static getLocale() {
1958
- return I18nManager.currentLocale;
1959
- }
1960
- static setFallbackLocale(locale) {
1961
- I18nManager.fallbackLocale = I18nManager.normalizeLocale(locale);
1962
- }
1963
- static t(key, params, locale) {
1964
- const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
1965
- let value = I18nManager.getTranslationValue(key, targetLocale);
1966
- if (value === undefined && targetLocale !== I18nManager.fallbackLocale) {
1967
- value = I18nManager.getTranslationValue(key, I18nManager.fallbackLocale);
1968
- }
1969
- if (value === undefined) {
1970
- return key;
1971
- }
1972
- if (isPluralForm(value) && params && "count" in params) {
1973
- const count = typeof params.count === "number" ? params.count : Number(params.count);
1974
- value = selectPluralForm(value, count);
1975
- } else if (isPluralForm(value)) {
1976
- value = value.other;
1977
- }
1978
- if (typeof value !== "string") {
1979
- return key;
1980
- }
1981
- return params ? I18nManager.interpolate(value, params) : value;
1982
- }
1983
- static has(key, locale) {
1984
- const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
1985
- const value = I18nManager.getTranslationValue(key, targetLocale);
1986
- if (value !== undefined) {
1987
- return true;
1988
- }
1989
- if (targetLocale !== I18nManager.fallbackLocale) {
1990
- return I18nManager.getTranslationValue(key, I18nManager.fallbackLocale) !== undefined;
1991
- }
1992
- return false;
1993
- }
1994
- static getAvailableLocales() {
1995
- return Object.keys(I18nManager.translations);
1996
- }
1997
- static clearTranslations() {
1998
- I18nManager.translations = {};
1999
- I18nManager.currentLocale = "en";
2000
- }
2001
- static getTranslationValue(key, locale) {
2002
- const catalog = I18nManager.translations[locale];
2003
- if (!catalog) {
2004
- return;
2005
- }
2006
- const keys = key.split(".");
2007
- let value = catalog;
2008
- for (const k of keys) {
2009
- if (value && typeof value === "object" && k in value) {
2010
- value = value[k];
2011
- } else {
2012
- return;
2013
- }
2014
- }
2015
- return value;
2016
- }
2017
- static interpolate(template, params) {
2018
- return template.replace(/\{(\w+)\}/g, (_, key) => {
2019
- const value = params[key];
2020
- return value !== undefined ? String(value) : `{${key}}`;
2021
- });
2022
- }
2023
- static normalizeLocale(locale) {
2024
- const normalized = locale.toLowerCase().replace(/_/g, "-");
2025
- const specialLocales = ["es-mx", "pt-br", "zh-cn", "zh-tw"];
2026
- if (specialLocales.includes(normalized)) {
2027
- return normalized;
2028
- }
2029
- return normalized.split("-")[0];
2030
- }
2031
- static deepMerge(target, source) {
2032
- const result = { ...target };
2033
- for (const key of Object.keys(source)) {
2034
- const sourceValue = source[key];
2035
- const targetValue = result[key];
2036
- if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue) && targetValue && typeof targetValue === "object" && !Array.isArray(targetValue)) {
2037
- result[key] = I18nManager.deepMerge(targetValue, sourceValue);
2038
- } else {
2039
- result[key] = sourceValue;
2040
- }
2041
- }
2042
- return result;
2043
- }
2044
- }
2045
- var de = {
2046
- toolCore: {
2047
- errors: {
2048
- internal: "Internal error: {message}",
2049
- fileNotFound: "File not found: {path}",
2050
- fileReadFailed: "Failed to read file: {path}",
2051
- fileWriteFailed: "Failed to write file: {path}",
2052
- directoryNotFound: "Directory not found: {path}",
2053
- invalidPath: "{path} is not a valid path",
2054
- operationCanceled: "Operation was canceled",
2055
- invalidParameter: "Invalid parameter: {parameter}"
2056
- },
2057
- progress: {
2058
- copying: "Copying files...",
2059
- building: "Building project...",
2060
- packaging: "Creating package...",
2061
- validating: "Validating...",
2062
- analyzing: "Analyzing...",
2063
- restoring: "Restoring dependencies..."
2064
- },
2065
- validation: {
2066
- requiredField: "{field} is required",
2067
- invalidValue: "Invalid value for {field}",
2068
- pathNotFound: "Path not found: {path}",
2069
- fileRequired: "File is required: {path}",
2070
- directoryRequired: "Directory is required: {path}"
2071
- },
2072
- warnings: {
2073
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
2074
- },
2075
- info: {
2076
- operationComplete: "Operation completed successfully",
2077
- filesProcessed: {
2078
- zero: "No files processed",
2079
- one: "{count} file processed",
2080
- other: "{count} files processed"
2081
- }
2082
- }
2083
- }
2084
- };
2085
- var en = {
2086
- toolCore: {
2087
- errors: {
2088
- internal: "Internal error: {message}",
2089
- fileNotFound: "File not found: {path}",
2090
- fileReadFailed: "Failed to read file: {path}",
2091
- fileWriteFailed: "Failed to write file: {path}",
2092
- directoryNotFound: "Directory not found: {path}",
2093
- invalidPath: "{path} is not a valid path",
2094
- operationCanceled: "Operation was canceled",
2095
- invalidParameter: "Invalid parameter: {parameter}"
2096
- },
2097
- progress: {
2098
- copying: "Copying files...",
2099
- building: "Building project...",
2100
- packaging: "Creating package...",
2101
- validating: "Validating...",
2102
- analyzing: "Analyzing...",
2103
- restoring: "Restoring dependencies..."
2104
- },
2105
- validation: {
2106
- requiredField: "{field} is required",
2107
- invalidValue: "Invalid value for {field}",
2108
- pathNotFound: "Path not found: {path}",
2109
- fileRequired: "File is required: {path}",
2110
- directoryRequired: "Directory is required: {path}"
2111
- },
2112
- warnings: {
2113
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
2114
- },
2115
- info: {
2116
- operationComplete: "Operation completed successfully",
2117
- filesProcessed: {
2118
- zero: "No files processed",
2119
- one: "{count} file processed",
2120
- other: "{count} files processed"
2121
- }
2122
- }
2123
- }
2124
- };
2125
- var es = {
2126
- toolCore: {
2127
- errors: {
2128
- internal: "Internal error: {message}",
2129
- fileNotFound: "File not found: {path}",
2130
- fileReadFailed: "Failed to read file: {path}",
2131
- fileWriteFailed: "Failed to write file: {path}",
2132
- directoryNotFound: "Directory not found: {path}",
2133
- invalidPath: "{path} is not a valid path",
2134
- operationCanceled: "Operation was canceled",
2135
- invalidParameter: "Invalid parameter: {parameter}"
2136
- },
2137
- progress: {
2138
- copying: "Copying files...",
2139
- building: "Building project...",
2140
- packaging: "Creating package...",
2141
- validating: "Validating...",
2142
- analyzing: "Analyzing...",
2143
- restoring: "Restoring dependencies..."
2144
- },
2145
- validation: {
2146
- requiredField: "{field} is required",
2147
- invalidValue: "Invalid value for {field}",
2148
- pathNotFound: "Path not found: {path}",
2149
- fileRequired: "File is required: {path}",
2150
- directoryRequired: "Directory is required: {path}"
2151
- },
2152
- warnings: {
2153
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
2154
- },
2155
- info: {
2156
- operationComplete: "Operation completed successfully",
2157
- filesProcessed: {
2158
- zero: "No files processed",
2159
- one: "{count} file processed",
2160
- other: "{count} files processed"
2161
- }
2162
- }
2163
- }
2164
- };
2165
- var es_MX = {
2166
- toolCore: {
2167
- errors: {
2168
- internal: "Internal error: {message}",
2169
- fileNotFound: "File not found: {path}",
2170
- fileReadFailed: "Failed to read file: {path}",
2171
- fileWriteFailed: "Failed to write file: {path}",
2172
- directoryNotFound: "Directory not found: {path}",
2173
- invalidPath: "{path} is not a valid path",
2174
- operationCanceled: "Operation was canceled",
2175
- invalidParameter: "Invalid parameter: {parameter}"
2176
- },
2177
- progress: {
2178
- copying: "Copying files...",
2179
- building: "Building project...",
2180
- packaging: "Creating package...",
2181
- validating: "Validating...",
2182
- analyzing: "Analyzing...",
2183
- restoring: "Restoring dependencies..."
2184
- },
2185
- validation: {
2186
- requiredField: "{field} is required",
2187
- invalidValue: "Invalid value for {field}",
2188
- pathNotFound: "Path not found: {path}",
2189
- fileRequired: "File is required: {path}",
2190
- directoryRequired: "Directory is required: {path}"
2191
- },
2192
- warnings: {
2193
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
2194
- },
2195
- info: {
2196
- operationComplete: "Operation completed successfully",
2197
- filesProcessed: {
2198
- zero: "No files processed",
2199
- one: "{count} file processed",
2200
- other: "{count} files processed"
2201
- }
2202
- }
2203
- }
2204
- };
2205
- var fr = {
2206
- toolCore: {
2207
- errors: {
2208
- internal: "Internal error: {message}",
2209
- fileNotFound: "File not found: {path}",
2210
- fileReadFailed: "Failed to read file: {path}",
2211
- fileWriteFailed: "Failed to write file: {path}",
2212
- directoryNotFound: "Directory not found: {path}",
2213
- invalidPath: "{path} is not a valid path",
2214
- operationCanceled: "Operation was canceled",
2215
- invalidParameter: "Invalid parameter: {parameter}"
2216
- },
2217
- progress: {
2218
- copying: "Copying files...",
2219
- building: "Building project...",
2220
- packaging: "Creating package...",
2221
- validating: "Validating...",
2222
- analyzing: "Analyzing...",
2223
- restoring: "Restoring dependencies..."
2224
- },
2225
- validation: {
2226
- requiredField: "{field} is required",
2227
- invalidValue: "Invalid value for {field}",
2228
- pathNotFound: "Path not found: {path}",
2229
- fileRequired: "File is required: {path}",
2230
- directoryRequired: "Directory is required: {path}"
2231
- },
2232
- warnings: {
2233
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
2234
- },
2235
- info: {
2236
- operationComplete: "Operation completed successfully",
2237
- filesProcessed: {
2238
- zero: "No files processed",
2239
- one: "{count} file processed",
2240
- other: "{count} files processed"
2241
- }
2242
- }
2243
- }
2244
- };
2245
- var ja = {
2246
- toolCore: {
2247
- errors: {
2248
- internal: "Internal error: {message}",
2249
- fileNotFound: "File not found: {path}",
2250
- fileReadFailed: "Failed to read file: {path}",
2251
- fileWriteFailed: "Failed to write file: {path}",
2252
- directoryNotFound: "Directory not found: {path}",
2253
- invalidPath: "{path} is not a valid path",
2254
- operationCanceled: "Operation was canceled",
2255
- invalidParameter: "Invalid parameter: {parameter}"
2256
- },
2257
- progress: {
2258
- copying: "Copying files...",
2259
- building: "Building project...",
2260
- packaging: "Creating package...",
2261
- validating: "Validating...",
2262
- analyzing: "Analyzing...",
2263
- restoring: "Restoring dependencies..."
2264
- },
2265
- validation: {
2266
- requiredField: "{field} is required",
2267
- invalidValue: "Invalid value for {field}",
2268
- pathNotFound: "Path not found: {path}",
2269
- fileRequired: "File is required: {path}",
2270
- directoryRequired: "Directory is required: {path}"
2271
- },
2272
- warnings: {
2273
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
2274
- },
2275
- info: {
2276
- operationComplete: "Operation completed successfully",
2277
- filesProcessed: {
2278
- zero: "No files processed",
2279
- one: "{count} file processed",
2280
- other: "{count} files processed"
2281
- }
2282
- }
2283
- }
2284
- };
2285
- var ko = {
2286
- toolCore: {
2287
- errors: {
2288
- internal: "Internal error: {message}",
2289
- fileNotFound: "File not found: {path}",
2290
- fileReadFailed: "Failed to read file: {path}",
2291
- fileWriteFailed: "Failed to write file: {path}",
2292
- directoryNotFound: "Directory not found: {path}",
2293
- invalidPath: "{path} is not a valid path",
2294
- operationCanceled: "Operation was canceled",
2295
- invalidParameter: "Invalid parameter: {parameter}"
2296
- },
2297
- progress: {
2298
- copying: "Copying files...",
2299
- building: "Building project...",
2300
- packaging: "Creating package...",
2301
- validating: "Validating...",
2302
- analyzing: "Analyzing...",
2303
- restoring: "Restoring dependencies..."
2304
- },
2305
- validation: {
2306
- requiredField: "{field} is required",
2307
- invalidValue: "Invalid value for {field}",
2308
- pathNotFound: "Path not found: {path}",
2309
- fileRequired: "File is required: {path}",
2310
- directoryRequired: "Directory is required: {path}"
2311
- },
2312
- warnings: {
2313
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
2314
- },
2315
- info: {
2316
- operationComplete: "Operation completed successfully",
2317
- filesProcessed: {
2318
- zero: "No files processed",
2319
- one: "{count} file processed",
2320
- other: "{count} files processed"
2321
- }
2322
- }
2323
- }
2324
- };
2325
- var pt = {
2326
- toolCore: {
2327
- errors: {
2328
- internal: "Internal error: {message}",
2329
- fileNotFound: "File not found: {path}",
2330
- fileReadFailed: "Failed to read file: {path}",
2331
- fileWriteFailed: "Failed to write file: {path}",
2332
- directoryNotFound: "Directory not found: {path}",
2333
- invalidPath: "{path} is not a valid path",
2334
- operationCanceled: "Operation was canceled",
2335
- invalidParameter: "Invalid parameter: {parameter}"
2336
- },
2337
- progress: {
2338
- copying: "Copying files...",
2339
- building: "Building project...",
2340
- packaging: "Creating package...",
2341
- validating: "Validating...",
2342
- analyzing: "Analyzing...",
2343
- restoring: "Restoring dependencies..."
2344
- },
2345
- validation: {
2346
- requiredField: "{field} is required",
2347
- invalidValue: "Invalid value for {field}",
2348
- pathNotFound: "Path not found: {path}",
2349
- fileRequired: "File is required: {path}",
2350
- directoryRequired: "Directory is required: {path}"
2351
- },
2352
- warnings: {
2353
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
2354
- },
2355
- info: {
2356
- operationComplete: "Operation completed successfully",
2357
- filesProcessed: {
2358
- zero: "No files processed",
2359
- one: "{count} file processed",
2360
- other: "{count} files processed"
2361
- }
2362
- }
2363
- }
2364
- };
2365
- var pt_BR = {
2366
- toolCore: {
2367
- errors: {
2368
- internal: "Internal error: {message}",
2369
- fileNotFound: "File not found: {path}",
2370
- fileReadFailed: "Failed to read file: {path}",
2371
- fileWriteFailed: "Failed to write file: {path}",
2372
- directoryNotFound: "Directory not found: {path}",
2373
- invalidPath: "{path} is not a valid path",
2374
- operationCanceled: "Operation was canceled",
2375
- invalidParameter: "Invalid parameter: {parameter}"
2376
- },
2377
- progress: {
2378
- copying: "Copying files...",
2379
- building: "Building project...",
2380
- packaging: "Creating package...",
2381
- validating: "Validating...",
2382
- analyzing: "Analyzing...",
2383
- restoring: "Restoring dependencies..."
2384
- },
2385
- validation: {
2386
- requiredField: "{field} is required",
2387
- invalidValue: "Invalid value for {field}",
2388
- pathNotFound: "Path not found: {path}",
2389
- fileRequired: "File is required: {path}",
2390
- directoryRequired: "Directory is required: {path}"
2391
- },
2392
- warnings: {
2393
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
2394
- },
2395
- info: {
2396
- operationComplete: "Operation completed successfully",
2397
- filesProcessed: {
2398
- zero: "No files processed",
2399
- one: "{count} file processed",
2400
- other: "{count} files processed"
2401
- }
2402
- }
2403
- }
2404
- };
2405
- var ro = {
2406
- toolCore: {
2407
- errors: {
2408
- internal: "Internal error: {message}",
2409
- fileNotFound: "File not found: {path}",
2410
- fileReadFailed: "Failed to read file: {path}",
2411
- fileWriteFailed: "Failed to write file: {path}",
2412
- directoryNotFound: "Directory not found: {path}",
2413
- invalidPath: "{path} is not a valid path",
2414
- operationCanceled: "Operation was canceled",
2415
- invalidParameter: "Invalid parameter: {parameter}"
2416
- },
2417
- progress: {
2418
- copying: "Copying files...",
2419
- building: "Building project...",
2420
- packaging: "Creating package...",
2421
- validating: "Validating...",
2422
- analyzing: "Analyzing...",
2423
- restoring: "Restoring dependencies..."
2424
- },
2425
- validation: {
2426
- requiredField: "{field} is required",
2427
- invalidValue: "Invalid value for {field}",
2428
- pathNotFound: "Path not found: {path}",
2429
- fileRequired: "File is required: {path}",
2430
- directoryRequired: "Directory is required: {path}"
2431
- },
2432
- warnings: {
2433
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
2434
- },
2435
- info: {
2436
- operationComplete: "Operation completed successfully",
2437
- filesProcessed: {
2438
- zero: "No files processed",
2439
- one: "{count} file processed",
2440
- other: "{count} files processed"
2441
- }
2442
- }
2443
- }
2444
- };
2445
- var ru = {
2446
- toolCore: {
2447
- errors: {
2448
- internal: "Internal error: {message}",
2449
- fileNotFound: "File not found: {path}",
2450
- fileReadFailed: "Failed to read file: {path}",
2451
- fileWriteFailed: "Failed to write file: {path}",
2452
- directoryNotFound: "Directory not found: {path}",
2453
- invalidPath: "{path} is not a valid path",
2454
- operationCanceled: "Operation was canceled",
2455
- invalidParameter: "Invalid parameter: {parameter}"
2456
- },
2457
- progress: {
2458
- copying: "Copying files...",
2459
- building: "Building project...",
2460
- packaging: "Creating package...",
2461
- validating: "Validating...",
2462
- analyzing: "Analyzing...",
2463
- restoring: "Restoring dependencies..."
2464
- },
2465
- validation: {
2466
- requiredField: "{field} is required",
2467
- invalidValue: "Invalid value for {field}",
2468
- pathNotFound: "Path not found: {path}",
2469
- fileRequired: "File is required: {path}",
2470
- directoryRequired: "Directory is required: {path}"
2471
- },
2472
- warnings: {
2473
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
2474
- },
2475
- info: {
2476
- operationComplete: "Operation completed successfully",
2477
- filesProcessed: {
2478
- zero: "No files processed",
2479
- one: "{count} file processed",
2480
- other: "{count} files processed"
2481
- }
2482
- }
2483
- }
2484
- };
2485
- var tr = {
2486
- toolCore: {
2487
- errors: {
2488
- internal: "Internal error: {message}",
2489
- fileNotFound: "File not found: {path}",
2490
- fileReadFailed: "Failed to read file: {path}",
2491
- fileWriteFailed: "Failed to write file: {path}",
2492
- directoryNotFound: "Directory not found: {path}",
2493
- invalidPath: "{path} is not a valid path",
2494
- operationCanceled: "Operation was canceled",
2495
- invalidParameter: "Invalid parameter: {parameter}"
2496
- },
2497
- progress: {
2498
- copying: "Copying files...",
2499
- building: "Building project...",
2500
- packaging: "Creating package...",
2501
- validating: "Validating...",
2502
- analyzing: "Analyzing...",
2503
- restoring: "Restoring dependencies..."
2504
- },
2505
- validation: {
2506
- requiredField: "{field} is required",
2507
- invalidValue: "Invalid value for {field}",
2508
- pathNotFound: "Path not found: {path}",
2509
- fileRequired: "File is required: {path}",
2510
- directoryRequired: "Directory is required: {path}"
2511
- },
2512
- warnings: {
2513
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
2514
- },
2515
- info: {
2516
- operationComplete: "Operation completed successfully",
2517
- filesProcessed: {
2518
- zero: "No files processed",
2519
- one: "{count} file processed",
2520
- other: "{count} files processed"
2521
- }
2522
- }
2523
- }
2524
- };
2525
- var zh_CN = {
2526
- toolCore: {
2527
- errors: {
2528
- internal: "Internal error: {message}",
2529
- fileNotFound: "File not found: {path}",
2530
- fileReadFailed: "Failed to read file: {path}",
2531
- fileWriteFailed: "Failed to write file: {path}",
2532
- directoryNotFound: "Directory not found: {path}",
2533
- invalidPath: "{path} is not a valid path",
2534
- operationCanceled: "Operation was canceled",
2535
- invalidParameter: "Invalid parameter: {parameter}"
2536
- },
2537
- progress: {
2538
- copying: "Copying files...",
2539
- building: "Building project...",
2540
- packaging: "Creating package...",
2541
- validating: "Validating...",
2542
- analyzing: "Analyzing...",
2543
- restoring: "Restoring dependencies..."
2544
- },
2545
- validation: {
2546
- requiredField: "{field} is required",
2547
- invalidValue: "Invalid value for {field}",
2548
- pathNotFound: "Path not found: {path}",
2549
- fileRequired: "File is required: {path}",
2550
- directoryRequired: "Directory is required: {path}"
2551
- },
2552
- warnings: {
2553
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
2554
- },
2555
- info: {
2556
- operationComplete: "Operation completed successfully",
2557
- filesProcessed: {
2558
- zero: "No files processed",
2559
- one: "{count} file processed",
2560
- other: "{count} files processed"
2561
- }
2562
- }
2563
- }
2564
- };
2565
- var zh_TW = {
2566
- toolCore: {
2567
- errors: {
2568
- internal: "Internal error: {message}",
2569
- fileNotFound: "File not found: {path}",
2570
- fileReadFailed: "Failed to read file: {path}",
2571
- fileWriteFailed: "Failed to write file: {path}",
2572
- directoryNotFound: "Directory not found: {path}",
2573
- invalidPath: "{path} is not a valid path",
2574
- operationCanceled: "Operation was canceled",
2575
- invalidParameter: "Invalid parameter: {parameter}"
2576
- },
2577
- progress: {
2578
- copying: "Copying files...",
2579
- building: "Building project...",
2580
- packaging: "Creating package...",
2581
- validating: "Validating...",
2582
- analyzing: "Analyzing...",
2583
- restoring: "Restoring dependencies..."
2584
- },
2585
- validation: {
2586
- requiredField: "{field} is required",
2587
- invalidValue: "Invalid value for {field}",
2588
- pathNotFound: "Path not found: {path}",
2589
- fileRequired: "File is required: {path}",
2590
- directoryRequired: "Directory is required: {path}"
2591
- },
2592
- warnings: {
2593
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
2594
- },
2595
- info: {
2596
- operationComplete: "Operation completed successfully",
2597
- filesProcessed: {
2598
- zero: "No files processed",
2599
- one: "{count} file processed",
2600
- other: "{count} files processed"
2601
- }
2602
- }
2603
- }
2604
- };
2605
- var zu = {
2606
- toolCore: {
2607
- errors: {
2608
- internal: "Internal error: {message}",
2609
- fileNotFound: "File not found: {path}",
2610
- fileReadFailed: "Failed to read file: {path}",
2611
- fileWriteFailed: "Failed to write file: {path}",
2612
- directoryNotFound: "Directory not found: {path}",
2613
- invalidPath: "{path} is not a valid path",
2614
- operationCanceled: "Operation was canceled",
2615
- invalidParameter: "Invalid parameter: {parameter}"
2616
- },
2617
- progress: {
2618
- copying: "Copying files...",
2619
- building: "Building project...",
2620
- packaging: "Creating package...",
2621
- validating: "Validating...",
2622
- analyzing: "Analyzing...",
2623
- restoring: "Restoring dependencies..."
2624
- },
2625
- validation: {
2626
- requiredField: "{field} is required",
2627
- invalidValue: "Invalid value for {field}",
2628
- pathNotFound: "Path not found: {path}",
2629
- fileRequired: "File is required: {path}",
2630
- directoryRequired: "Directory is required: {path}"
2631
- },
2632
- warnings: {
2633
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
2634
- },
2635
- info: {
2636
- operationComplete: "Operation completed successfully",
2637
- filesProcessed: {
2638
- zero: "No files processed",
2639
- one: "{count} file processed",
2640
- other: "{count} files processed"
2641
- }
2642
- }
2643
- }
2644
- };
2645
-
2646
- class TranslationService {
2647
- static instance;
2648
- currentLocale = "en";
2649
- constructor() {}
2650
- static getInstance() {
2651
- if (!TranslationService.instance) {
2652
- TranslationService.instance = new TranslationService;
2653
- }
2654
- return TranslationService.instance;
2655
- }
2656
- setLocale(locale) {
2657
- this.currentLocale = I18nManager.setLocale(locale);
2658
- }
2659
- getLocale() {
2660
- return this.currentLocale;
2661
- }
2662
- t(key, params) {
2663
- return I18nManager.t(key, params, this.currentLocale);
2664
- }
2665
- tLocale(key, locale, params) {
2666
- return I18nManager.t(key, params, locale);
2667
- }
2668
- has(key) {
2669
- return I18nManager.has(key, this.currentLocale);
2670
- }
2671
- getAvailableLocales() {
2672
- return I18nManager.getAvailableLocales();
2673
- }
2674
- }
2675
- var translate = TranslationService.getInstance();
2676
- I18nManager.registerTranslations("en", en);
2677
- I18nManager.registerTranslations("de", de);
2678
- I18nManager.registerTranslations("es", es);
2679
- I18nManager.registerTranslations("es-mx", es_MX);
2680
- I18nManager.registerTranslations("fr", fr);
2681
- I18nManager.registerTranslations("ja", ja);
2682
- I18nManager.registerTranslations("ko", ko);
2683
- I18nManager.registerTranslations("pt", pt);
2684
- I18nManager.registerTranslations("pt-br", pt_BR);
2685
- I18nManager.registerTranslations("ro", ro);
2686
- I18nManager.registerTranslations("ru", ru);
2687
- I18nManager.registerTranslations("tr", tr);
2688
- I18nManager.registerTranslations("zh-cn", zh_CN);
2689
- I18nManager.registerTranslations("zh-tw", zh_TW);
2690
- I18nManager.registerTranslations("zu", zu);
2691
- I18nManager.setLocale("en");
2692
- var BuildConfiguration;
2693
- ((BuildConfiguration2) => {
2694
- BuildConfiguration2["Debug"] = "Debug";
2695
- BuildConfiguration2["Release"] = "Release";
2696
- })(BuildConfiguration ||= {});
2697
- var LogLevel;
2698
- ((LogLevel2) => {
2699
- LogLevel2["Debug"] = "Debug";
2700
- LogLevel2["Info"] = "Information";
2701
- LogLevel2["Warn"] = "Warning";
2702
- LogLevel2["Error"] = "Error";
2703
- })(LogLevel ||= {});
2704
- var NugetConstants = {
2705
- OutputFolderName: "bundle",
2706
- ContentFolderName: "content",
2707
- OperateFileName: "operate.json",
2708
- EntryPointsFileName: "entry-points.json",
2709
- PackageDescriptorFileName: "package-descriptor.json",
2710
- BindingsV2FileName: "bindings_v2.json",
2711
- BindingsFileId: "bindings.json"
2712
- };
2713
- var PackJobTargetKind;
2714
- ((PackJobTargetKind2) => {
2715
- PackJobTargetKind2["Serverless"] = "Serverless";
2716
- PackJobTargetKind2["LocalRobot"] = "LocalRobot";
2717
- })(PackJobTargetKind ||= {});
2718
- var ProjectTypes;
2719
- ((ProjectTypes2) => {
2720
- ProjectTypes2["Agent"] = "Agent";
2721
- ProjectTypes2["Api"] = "Api";
2722
- ProjectTypes2["BusinessRules"] = "BusinessRules";
2723
- ProjectTypes2["Connector"] = "Connector";
2724
- ProjectTypes2["CaseManagement"] = "CaseManagement";
2725
- ProjectTypes2["Flow"] = "Flow";
2726
- ProjectTypes2["Function"] = "Function";
2727
- ProjectTypes2["ProcessOrchestration"] = "ProcessOrchestration";
2728
- ProjectTypes2["Process"] = "Process";
2729
- ProjectTypes2["Library"] = "Library";
2730
- ProjectTypes2["WebApp"] = "WebApp";
2731
- ProjectTypes2["Tests"] = "Tests";
2732
- ProjectTypes2["AppV2"] = "AppV2";
2733
- })(ProjectTypes ||= {});
2734
- var TargetFramework;
2735
- ((TargetFramework2) => {
2736
- TargetFramework2["Portable"] = "Portable";
2737
- TargetFramework2["Windows"] = "Windows";
2738
- })(TargetFramework ||= {});
2739
- var ToolErrorCodes;
2740
- ((ToolErrorCodes2) => {
2741
- ToolErrorCodes2["Success"] = "SUCCESS";
2742
- ToolErrorCodes2["InternalError"] = "INTERNAL_ERROR";
2743
- ToolErrorCodes2["Canceled"] = "CANCELED";
2744
- })(ToolErrorCodes ||= {});
2745
-
2746
- class ToolResult {
2747
- errorCode;
2748
- message;
2749
- packages;
2750
- details;
2751
- instructions;
2752
- constructor(errorCode, message, packages = [], instructions) {
2753
- this.errorCode = errorCode;
2754
- this.message = message;
2755
- this.packages = packages;
2756
- this.instructions = instructions;
2757
- }
2758
- get isSuccess() {
2759
- return this.errorCode === "SUCCESS";
2760
- }
2761
- static success() {
2762
- return new ToolResult("SUCCESS");
2763
- }
2764
- static error(errorCode, message, instructions) {
2765
- return new ToolResult(errorCode, message, [], instructions);
2766
- }
2767
- }
2768
- function escapeXml(str) {
2769
- if (str === null || str === undefined) {
2770
- return "";
2771
- }
2772
- return String(str).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
2773
- }
2774
- function optionalElement(name, value) {
2775
- if (value === undefined || value === "")
2776
- return "";
2777
- return ` <${name}>${escapeXml(value)}</${name}>
2778
- `;
2779
- }
2780
- function generateDependenciesXml(dependencies) {
2781
- if (!dependencies || dependencies.length === 0)
2782
- return "";
2783
- const deps = dependencies.map((d) => ` <dependency id="${escapeXml(d.id)}" version="${escapeXml(d.version)}" />`).join(`
2784
- `);
2785
- return ` <dependencies>
2786
- ${deps}
2787
- </dependencies>
2788
- `;
2789
- }
2790
- function generateRepositoryXml(packageInfo) {
2791
- if (!packageInfo.repositoryType || !packageInfo.repositoryUrl)
2792
- return "";
2793
- let repoXml = ` <repository type="${escapeXml(packageInfo.repositoryType)}" url="${escapeXml(packageInfo.repositoryUrl)}"`;
2794
- if (packageInfo.repositoryBranch) {
2795
- repoXml += ` branch="${escapeXml(packageInfo.repositoryBranch)}"`;
2796
- }
2797
- if (packageInfo.repositoryCommit) {
2798
- repoXml += ` commit="${escapeXml(packageInfo.repositoryCommit)}"`;
2799
- }
2800
- repoXml += ` />
2801
- `;
2802
- return repoXml;
2803
- }
2804
- function generateNuspecXml(packageInfo) {
2805
- const author = packageInfo.author?.trim() || "UiPath";
2806
- const description = packageInfo.description?.trim() || "Created by UiPath";
2807
- const title = packageInfo.title?.trim() || packageInfo.id;
2808
- const requireLicenseAcceptance = packageInfo.requireLicenseAcceptance === true ? "true" : "false";
2809
- const releaseNotes = packageInfo.releaseNotes ?? "";
2810
- const xml = `\uFEFF<?xml version="1.0" encoding="utf-8"?>
2811
- <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
2812
- <metadata>
2813
- <id>${escapeXml(packageInfo.id)}</id>
2814
- <version>${escapeXml(packageInfo.version)}</version>
2815
- <title>${escapeXml(title)}</title>
2816
- <authors>${escapeXml(author)}</authors>
2817
- <requireLicenseAcceptance>${requireLicenseAcceptance}</requireLicenseAcceptance>
2818
- <description>${escapeXml(description)}</description>
2819
- <releaseNotes>${escapeXml(releaseNotes)}</releaseNotes>
2820
- ${optionalElement("tags", packageInfo.tags)}${optionalElement("iconUrl", packageInfo.iconUrl)}${optionalElement("projectUrl", packageInfo.projectUrl)}${optionalElement("licenseUrl", packageInfo.licenseUrl)}${optionalElement("copyright", packageInfo.copyright)}${generateRepositoryXml(packageInfo)}${generateDependenciesXml(packageInfo.dependencies)} </metadata>
2821
- </package>
2822
- `;
2823
- return xml;
2824
- }
2825
- function generatePsmdcpXml(packageInfo) {
2826
- const author = packageInfo.author?.trim() || "UiPath";
2827
- const description = packageInfo.description?.trim() || "Created by UiPath";
2828
- return `<?xml version="1.0" encoding="utf-8"?>
2829
- <coreProperties xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.openxmlformats.org/package/2006/metadata/core-properties">
2830
- <dc:creator>${escapeXml(author)}</dc:creator>
2831
- <dc:description>${escapeXml(description)}</dc:description>
2832
- <dc:identifier>${escapeXml(packageInfo.id)}</dc:identifier>
2833
- <version>${escapeXml(packageInfo.version)}</version>
2834
- <keywords></keywords>
2835
- <lastModifiedBy>NuGet.Packaging, Version=6.12.1.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35;.NET 5.0</lastModifiedBy>
2836
- </coreProperties>`;
2837
- }
2838
-
2839
- class NugetPackager {
2840
- fileSystem;
2841
- constructor(fileSystem) {
2842
- this.fileSystem = fileSystem;
2843
- }
2844
- async packAsync(rootPath, packageInfo, outputPath) {
2845
- const normalizedOutputPath = Path.normalize(outputPath);
2846
- const nuspecXml = generateNuspecXml(packageInfo);
2847
- const nuspecFileName = `${packageInfo.id}.nuspec`;
2848
- const fileEntries = await Path.walkDirectory(this.fileSystem, rootPath);
2849
- const zipContents = {};
2850
- const encoder = new TextEncoder;
2851
- const psmdcpId = Array.from({ length: 4 }, () => Math.floor(Math.random() * 4294967296).toString(16).padStart(8, "0")).join("");
2852
- const psmdcpFileName = `${psmdcpId}.psmdcp`;
2853
- const psmdcpPath = `package/services/metadata/core-properties/${psmdcpFileName}`;
2854
- const contentTypesXml = `<?xml version="1.0" encoding="utf-8"?>
2855
- <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
2856
- <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" />
2857
- <Default Extension="psmdcp" ContentType="application/vnd.openxmlformats-package.core-properties+xml" />
2858
- <Default Extension="uiproj" ContentType="application/octet" />
2859
- <Default Extension="json" ContentType="application/octet" />
2860
- <Default Extension="nuspec" ContentType="application/octet" />
2861
- </Types>`;
2862
- zipContents["[Content_Types].xml"] = encoder.encode(contentTypesXml);
2863
- const manifestRelId = `R${Date.now().toString(16).toUpperCase()}`;
2864
- const corePropsRelId = `R${(Date.now() + 1).toString(16).toUpperCase()}`;
2865
- const relsXml = `<?xml version="1.0" encoding="utf-8"?>
2866
- <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
2867
- <Relationship Type="http://schemas.microsoft.com/packaging/2010/07/manifest" Target="/${nuspecFileName}" Id="${manifestRelId}" />
2868
- <Relationship Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="/${psmdcpPath}" Id="${corePropsRelId}" />
2869
- </Relationships>`;
2870
- zipContents["_rels/.rels"] = encoder.encode(relsXml);
2871
- zipContents[psmdcpPath] = encoder.encode(generatePsmdcpXml(packageInfo));
2872
- zipContents[nuspecFileName] = encoder.encode(nuspecXml);
2873
- for (const entry of fileEntries) {
2874
- const content = await this.fileSystem.readFile(entry.absolutePath);
2875
- if (content !== null) {
2876
- zipContents[entry.relativePath] = content;
2877
- }
2878
- }
2879
- const zippedData = zipSync(zipContents);
2880
- await this.fileSystem.writeFile(normalizedOutputPath, zippedData);
2881
- return {
2882
- outputPath: normalizedOutputPath
2883
- };
2884
- }
2885
- }
2886
-
2887
- class ProjectTool {
2888
- fileSystem;
2889
- logger;
2890
- static ProjectFileName = "project.uiproj";
2891
- constructor(fileSystem, logger) {
2892
- this.fileSystem = fileSystem;
2893
- this.logger = logger;
2894
- }
2895
- async restoreAsync(_options, _cancellationToken) {
2896
- this.logger.info("Restore operation is a noop");
2897
- return ToolResult.success();
2898
- }
2899
- async validateAsync(_options, _cancellationToken) {
2900
- this.logger.info("Validate operation is a noop");
2901
- return ToolResult.success();
2902
- }
2903
- async buildAsync(_options, _cancellationToken) {
2904
- this.logger.info("Build operation is a noop");
2905
- return ToolResult.success();
2906
- }
2907
- async packAsync(_options, _cancellationToken) {
2908
- this.logger.info("Pack operation is a noop");
2909
- return ToolResult.success();
2910
- }
2911
- async cleanupAsync(_options, _cancellationToken) {
2912
- this.logger.info("Cleanup operation is a noop");
2913
- return ToolResult.success();
2914
- }
2915
- async getUiProjectAsync(projectPath) {
2916
- const filePath = Path.join(projectPath, ProjectTool.ProjectFileName);
2917
- if (!await this.fileSystem.exists(filePath)) {
2918
- return;
2919
- }
2920
- const raw = await this.fileSystem.readFile(filePath);
2921
- if (!raw) {
2922
- return;
2923
- }
2924
- const json = typeof raw === "string" ? raw : new TextDecoder("utf-8").decode(raw);
2925
- return JSON.parse(json);
2926
- }
2927
- async dispose() {}
2928
- }
2929
- class ToolsFactoryRepository {
2930
- projectFactoryMap = new Map;
2931
- solutionFactory = null;
2932
- registerProjectToolFactory(factory) {
2933
- for (const type of factory.supportedTypes) {
2934
- const existing = this.projectFactoryMap.get(type);
2935
- if (existing) {
2936
- if (existing.constructor?.name !== factory.constructor?.name) {
2937
- console.warn(`Tool factory conflict for project type '${type}': ` + `'${existing.constructor?.name}' already registered, ` + `ignoring '${factory.constructor?.name}'.`);
2938
- }
2939
- continue;
2940
- }
2941
- this.projectFactoryMap.set(type, factory);
2942
- }
2943
- }
2944
- registerSolutionToolFactory(factory) {
2945
- this.solutionFactory = factory;
2946
- }
2947
- getSolutionToolFactory() {
2948
- if (!this.solutionFactory) {
2949
- throw new Error("No solution tool factory is registered");
2950
- }
2951
- return this.solutionFactory;
2952
- }
2953
- canHandleProject(projectType) {
2954
- return this.projectFactoryMap.has(projectType);
2955
- }
2956
- getProjectToolFactory(projectType) {
2957
- const factory = this.projectFactoryMap.get(projectType);
2958
- if (!factory) {
2959
- throw new Error(`Cannot pack project type '${projectType}': no packager is installed for it.`);
2960
- }
2961
- return factory;
2962
- }
2963
- reset() {
2964
- this.projectFactoryMap.clear();
2965
- this.solutionFactory = null;
2966
- }
2967
- }
2968
- var REGISTRY_KEY = Symbol.for("@uipath/solutionpackager-tool-core/toolsFactoryRepository");
2969
- var _global = globalThis;
2970
- if (!_global[REGISTRY_KEY]) {
2971
- _global[REGISTRY_KEY] = new ToolsFactoryRepository;
2972
- }
2973
- var toolsFactoryRepository = _global[REGISTRY_KEY];
2974
-
2975
1808
  // ../../node_modules/@uipath/tool-agent/dist/chunk-XNTAT66P.js
2976
1809
  var import_semver = __toESM(require_semver2(), 1);
2977
1810
 
@@ -14597,10 +13430,10 @@ function mapToolErrorToResult(error40) {
14597
13430
  return ToolResult.error(error40.code, message2);
14598
13431
  }
14599
13432
  if (isAbortError(error40)) {
14600
- return ToolResult.error(ToolErrorCodes.Canceled, "Operation canceled");
13433
+ return ToolResult.error("CANCELED" /* Canceled */, "Operation canceled");
14601
13434
  }
14602
13435
  const message = error40 instanceof Error ? error40.message : String(error40);
14603
- return ToolResult.error(ToolErrorCodes.InternalError, message);
13436
+ return ToolResult.error("INTERNAL_ERROR" /* InternalError */, message);
14604
13437
  }
14605
13438
  var AgentTool = class extends ProjectTool {
14606
13439
  constructor(fileSystem, logger) {
@@ -14627,12 +13460,12 @@ var AgentTool = class extends ProjectTool {
14627
13460
  }
14628
13461
  this.logger.info(`buildAsync finished: outputPath=${localBuildFolder}`);
14629
13462
  this.logger.progress("Build completed successfully");
14630
- return new ToolResult(ToolErrorCodes.Success, "done", [localBuildFolder]);
13463
+ return new ToolResult("SUCCESS" /* Success */, "done", [localBuildFolder]);
14631
13464
  } catch (error40) {
14632
13465
  const errorMessage = error40 instanceof Error ? error40.toString() : String(error40);
14633
13466
  this.logger.error(`buildAsync failed: ${errorMessage}`);
14634
13467
  const canceledResult = mapToolErrorToResult(error40);
14635
- if (canceledResult.errorCode === ToolErrorCodes.Canceled) {
13468
+ if (canceledResult.errorCode === "CANCELED" /* Canceled */) {
14636
13469
  return canceledResult;
14637
13470
  }
14638
13471
  return mapToolErrorToResult(new AgentBuildError("An error occurred while building agent project", error40));
@@ -14654,12 +13487,12 @@ var AgentTool = class extends ProjectTool {
14654
13487
  const result = await packager.packAsync(localBuildFolder, options.package, nupkgPath);
14655
13488
  this.logger.info(`packAsync finished: nupkgPath=${result.outputPath}`);
14656
13489
  this.logger.progress("Package created successfully");
14657
- return new ToolResult(ToolErrorCodes.Success, "done", [result.outputPath]);
13490
+ return new ToolResult("SUCCESS" /* Success */, "done", [result.outputPath]);
14658
13491
  } catch (error40) {
14659
13492
  const errorMessage = error40 instanceof Error ? error40.toString() : String(error40);
14660
13493
  this.logger.error(`packAsync failed: ${errorMessage}`);
14661
13494
  const canceledResult = mapToolErrorToResult(error40);
14662
- if (canceledResult.errorCode === ToolErrorCodes.Canceled) {
13495
+ if (canceledResult.errorCode === "CANCELED" /* Canceled */) {
14663
13496
  return canceledResult;
14664
13497
  }
14665
13498
  return mapToolErrorToResult(new AgentPackError("An error occurred while packing agent project", error40));
@@ -14673,6 +13506,6 @@ var AgentTool = class extends ProjectTool {
14673
13506
  }
14674
13507
  };
14675
13508
 
14676
- export { ProjectTypes, toolsFactoryRepository, AgentTool };
13509
+ export { AgentTool };
14677
13510
 
14678
- //# debugId=17A0B9112E989BBA64756E2164756E21
13511
+ //# debugId=CCDA568220882E6F64756E2164756E21