@uipath/packager-tool-workflowcompiler 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,1213 @@
1
+ // src/i18n/index.ts
2
+ import { I18nManager } from "@uipath/solutionpackager-tool-core";
3
+ // src/i18n/locales/de.json
4
+ var de_default = {
5
+ toolWorkflowcompiler: {
6
+ lifecycle: {
7
+ started: "[WorkflowCompiler] {operation} started",
8
+ command: "[WorkflowCompiler] Command: {command}",
9
+ completed: "[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}",
10
+ cancelled: "[WorkflowCompiler] Operation cancelled"
11
+ },
12
+ errors: {
13
+ processExited: "Process exited with code {exitCode}",
14
+ failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
15
+ processError: "[WorkflowCompiler] Process error: {message}",
16
+ startFailed: "Failed to start workflow compiler: {message}",
17
+ operationCancelled: "Operation cancelled"
18
+ },
19
+ pathResolver: {
20
+ info: {
21
+ usingCached: "[PathResolver] Using cached compiler path: {path}",
22
+ usingExplicitPath: "[PathResolver] Using explicit compiler path: {path}",
23
+ resolving: "[PathResolver] Resolving workflow compiler path...",
24
+ checkingEnvVar: "[PathResolver] Checking environment variable location: {path}",
25
+ foundViaEnv: "[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION",
26
+ checkingNuGetCache: "[PathResolver] Checking NuGet cache: {path}",
27
+ foundInNuGetCache: "[PathResolver] Found compiler in NuGet cache",
28
+ notFoundStartingInstall: "[PathResolver] Compiler not found, starting dotnet restore...",
29
+ restoringPackage: '[PathResolver] Restoring NuGet package "{packageName}" v{version} for platform "{platform}" via dotnet restore...',
30
+ runningDotnetRestore: "[PathResolver] Running dotnet restore...",
31
+ restoreCompleted: "[PathResolver] dotnet restore completed",
32
+ installCompleted: "[PathResolver] Compiler restored successfully",
33
+ cleaningUp: "[PathResolver] Cleaning up temp directory",
34
+ resolved: "[PathResolver] Compiler resolved at: {path}"
35
+ },
36
+ errors: {
37
+ unsupportedPlatform: "Unsupported platform: {platform}",
38
+ compilerNotFoundAfterRestore: "Compiler not found in NuGet cache after dotnet restore.",
39
+ dotnetRestoreFailed: "dotnet restore failed: {details}"
40
+ }
41
+ }
42
+ }
43
+ };
44
+
45
+ // src/i18n/locales/en.ts
46
+ var en = {
47
+ toolWorkflowcompiler: {
48
+ lifecycle: {
49
+ started: "[WorkflowCompiler] {operation} started",
50
+ command: "[WorkflowCompiler] Command: {command}",
51
+ completed: "[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}",
52
+ cancelled: "[WorkflowCompiler] Operation cancelled"
53
+ },
54
+ errors: {
55
+ processExited: "Process exited with code {exitCode}",
56
+ failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
57
+ processError: "[WorkflowCompiler] Process error: {message}",
58
+ startFailed: "Failed to start workflow compiler: {message}",
59
+ operationCancelled: "Operation cancelled"
60
+ },
61
+ pathResolver: {
62
+ info: {
63
+ usingCached: "[PathResolver] Using cached compiler path: {path}",
64
+ usingExplicitPath: "[PathResolver] Using explicit compiler path: {path}",
65
+ resolving: "[PathResolver] Resolving workflow compiler path...",
66
+ checkingEnvVar: "[PathResolver] Checking environment variable location: {path}",
67
+ foundViaEnv: "[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION",
68
+ checkingNuGetCache: "[PathResolver] Checking NuGet cache: {path}",
69
+ foundInNuGetCache: "[PathResolver] Found compiler in NuGet cache",
70
+ notFoundStartingInstall: "[PathResolver] Compiler not found, starting dotnet restore...",
71
+ restoringPackage: '[PathResolver] Restoring NuGet package "{packageName}" v{version} for platform "{platform}" via dotnet restore...',
72
+ runningDotnetRestore: "[PathResolver] Running dotnet restore...",
73
+ restoreCompleted: "[PathResolver] dotnet restore completed",
74
+ installCompleted: "[PathResolver] Compiler restored successfully",
75
+ cleaningUp: "[PathResolver] Cleaning up temp directory",
76
+ resolved: "[PathResolver] Compiler resolved at: {path}"
77
+ },
78
+ errors: {
79
+ unsupportedPlatform: "Unsupported platform: {platform}",
80
+ compilerNotFoundAfterRestore: "Compiler not found in NuGet cache after dotnet restore.",
81
+ dotnetRestoreFailed: "dotnet restore failed: {details}"
82
+ }
83
+ }
84
+ }
85
+ };
86
+ // src/i18n/locales/es.json
87
+ var es_default = {
88
+ toolWorkflowcompiler: {
89
+ lifecycle: {
90
+ started: "[WorkflowCompiler] {operation} started",
91
+ command: "[WorkflowCompiler] Command: {command}",
92
+ completed: "[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}",
93
+ cancelled: "[WorkflowCompiler] Operation cancelled"
94
+ },
95
+ errors: {
96
+ processExited: "Process exited with code {exitCode}",
97
+ failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
98
+ processError: "[WorkflowCompiler] Process error: {message}",
99
+ startFailed: "Failed to start workflow compiler: {message}",
100
+ operationCancelled: "Operation cancelled"
101
+ },
102
+ pathResolver: {
103
+ info: {
104
+ usingCached: "[PathResolver] Using cached compiler path: {path}",
105
+ usingExplicitPath: "[PathResolver] Using explicit compiler path: {path}",
106
+ resolving: "[PathResolver] Resolving workflow compiler path...",
107
+ checkingEnvVar: "[PathResolver] Checking environment variable location: {path}",
108
+ foundViaEnv: "[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION",
109
+ checkingNuGetCache: "[PathResolver] Checking NuGet cache: {path}",
110
+ foundInNuGetCache: "[PathResolver] Found compiler in NuGet cache",
111
+ notFoundStartingInstall: "[PathResolver] Compiler not found, starting dotnet restore...",
112
+ restoringPackage: '[PathResolver] Restoring NuGet package "{packageName}" v{version} for platform "{platform}" via dotnet restore...',
113
+ runningDotnetRestore: "[PathResolver] Running dotnet restore...",
114
+ restoreCompleted: "[PathResolver] dotnet restore completed",
115
+ installCompleted: "[PathResolver] Compiler restored successfully",
116
+ cleaningUp: "[PathResolver] Cleaning up temp directory",
117
+ resolved: "[PathResolver] Compiler resolved at: {path}"
118
+ },
119
+ errors: {
120
+ unsupportedPlatform: "Unsupported platform: {platform}",
121
+ compilerNotFoundAfterRestore: "Compiler not found in NuGet cache after dotnet restore.",
122
+ dotnetRestoreFailed: "dotnet restore failed: {details}"
123
+ }
124
+ }
125
+ }
126
+ };
127
+ // src/i18n/locales/es-MX.json
128
+ var es_MX_default = {
129
+ toolWorkflowcompiler: {
130
+ lifecycle: {
131
+ started: "[WorkflowCompiler] {operation} started",
132
+ command: "[WorkflowCompiler] Command: {command}",
133
+ completed: "[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}",
134
+ cancelled: "[WorkflowCompiler] Operation cancelled"
135
+ },
136
+ errors: {
137
+ processExited: "Process exited with code {exitCode}",
138
+ failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
139
+ processError: "[WorkflowCompiler] Process error: {message}",
140
+ startFailed: "Failed to start workflow compiler: {message}",
141
+ operationCancelled: "Operation cancelled"
142
+ },
143
+ pathResolver: {
144
+ info: {
145
+ usingCached: "[PathResolver] Using cached compiler path: {path}",
146
+ usingExplicitPath: "[PathResolver] Using explicit compiler path: {path}",
147
+ resolving: "[PathResolver] Resolving workflow compiler path...",
148
+ checkingEnvVar: "[PathResolver] Checking environment variable location: {path}",
149
+ foundViaEnv: "[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION",
150
+ checkingNuGetCache: "[PathResolver] Checking NuGet cache: {path}",
151
+ foundInNuGetCache: "[PathResolver] Found compiler in NuGet cache",
152
+ notFoundStartingInstall: "[PathResolver] Compiler not found, starting dotnet restore...",
153
+ restoringPackage: '[PathResolver] Restoring NuGet package "{packageName}" v{version} for platform "{platform}" via dotnet restore...',
154
+ runningDotnetRestore: "[PathResolver] Running dotnet restore...",
155
+ restoreCompleted: "[PathResolver] dotnet restore completed",
156
+ installCompleted: "[PathResolver] Compiler restored successfully",
157
+ cleaningUp: "[PathResolver] Cleaning up temp directory",
158
+ resolved: "[PathResolver] Compiler resolved at: {path}"
159
+ },
160
+ errors: {
161
+ unsupportedPlatform: "Unsupported platform: {platform}",
162
+ compilerNotFoundAfterRestore: "Compiler not found in NuGet cache after dotnet restore.",
163
+ dotnetRestoreFailed: "dotnet restore failed: {details}"
164
+ }
165
+ }
166
+ }
167
+ };
168
+ // src/i18n/locales/fr.json
169
+ var fr_default = {
170
+ toolWorkflowcompiler: {
171
+ lifecycle: {
172
+ started: "[WorkflowCompiler] {operation} started",
173
+ command: "[WorkflowCompiler] Command: {command}",
174
+ completed: "[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}",
175
+ cancelled: "[WorkflowCompiler] Operation cancelled"
176
+ },
177
+ errors: {
178
+ processExited: "Process exited with code {exitCode}",
179
+ failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
180
+ processError: "[WorkflowCompiler] Process error: {message}",
181
+ startFailed: "Failed to start workflow compiler: {message}",
182
+ operationCancelled: "Operation cancelled"
183
+ },
184
+ pathResolver: {
185
+ info: {
186
+ usingCached: "[PathResolver] Using cached compiler path: {path}",
187
+ usingExplicitPath: "[PathResolver] Using explicit compiler path: {path}",
188
+ resolving: "[PathResolver] Resolving workflow compiler path...",
189
+ checkingEnvVar: "[PathResolver] Checking environment variable location: {path}",
190
+ foundViaEnv: "[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION",
191
+ checkingNuGetCache: "[PathResolver] Checking NuGet cache: {path}",
192
+ foundInNuGetCache: "[PathResolver] Found compiler in NuGet cache",
193
+ notFoundStartingInstall: "[PathResolver] Compiler not found, starting dotnet restore...",
194
+ restoringPackage: '[PathResolver] Restoring NuGet package "{packageName}" v{version} for platform "{platform}" via dotnet restore...',
195
+ runningDotnetRestore: "[PathResolver] Running dotnet restore...",
196
+ restoreCompleted: "[PathResolver] dotnet restore completed",
197
+ installCompleted: "[PathResolver] Compiler restored successfully",
198
+ cleaningUp: "[PathResolver] Cleaning up temp directory",
199
+ resolved: "[PathResolver] Compiler resolved at: {path}"
200
+ },
201
+ errors: {
202
+ unsupportedPlatform: "Unsupported platform: {platform}",
203
+ compilerNotFoundAfterRestore: "Compiler not found in NuGet cache after dotnet restore.",
204
+ dotnetRestoreFailed: "dotnet restore failed: {details}"
205
+ }
206
+ }
207
+ }
208
+ };
209
+ // src/i18n/locales/ja.json
210
+ var ja_default = {
211
+ toolWorkflowcompiler: {
212
+ lifecycle: {
213
+ started: "[WorkflowCompiler] {operation} started",
214
+ command: "[WorkflowCompiler] Command: {command}",
215
+ completed: "[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}",
216
+ cancelled: "[WorkflowCompiler] Operation cancelled"
217
+ },
218
+ errors: {
219
+ processExited: "Process exited with code {exitCode}",
220
+ failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
221
+ processError: "[WorkflowCompiler] Process error: {message}",
222
+ startFailed: "Failed to start workflow compiler: {message}",
223
+ operationCancelled: "Operation cancelled"
224
+ },
225
+ pathResolver: {
226
+ info: {
227
+ usingCached: "[PathResolver] Using cached compiler path: {path}",
228
+ usingExplicitPath: "[PathResolver] Using explicit compiler path: {path}",
229
+ resolving: "[PathResolver] Resolving workflow compiler path...",
230
+ checkingEnvVar: "[PathResolver] Checking environment variable location: {path}",
231
+ foundViaEnv: "[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION",
232
+ checkingNuGetCache: "[PathResolver] Checking NuGet cache: {path}",
233
+ foundInNuGetCache: "[PathResolver] Found compiler in NuGet cache",
234
+ notFoundStartingInstall: "[PathResolver] Compiler not found, starting dotnet restore...",
235
+ restoringPackage: '[PathResolver] Restoring NuGet package "{packageName}" v{version} for platform "{platform}" via dotnet restore...',
236
+ runningDotnetRestore: "[PathResolver] Running dotnet restore...",
237
+ restoreCompleted: "[PathResolver] dotnet restore completed",
238
+ installCompleted: "[PathResolver] Compiler restored successfully",
239
+ cleaningUp: "[PathResolver] Cleaning up temp directory",
240
+ resolved: "[PathResolver] Compiler resolved at: {path}"
241
+ },
242
+ errors: {
243
+ unsupportedPlatform: "Unsupported platform: {platform}",
244
+ compilerNotFoundAfterRestore: "Compiler not found in NuGet cache after dotnet restore.",
245
+ dotnetRestoreFailed: "dotnet restore failed: {details}"
246
+ }
247
+ }
248
+ }
249
+ };
250
+ // src/i18n/locales/ko.json
251
+ var ko_default = {
252
+ toolWorkflowcompiler: {
253
+ lifecycle: {
254
+ started: "[WorkflowCompiler] {operation} started",
255
+ command: "[WorkflowCompiler] Command: {command}",
256
+ completed: "[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}",
257
+ cancelled: "[WorkflowCompiler] Operation cancelled"
258
+ },
259
+ errors: {
260
+ processExited: "Process exited with code {exitCode}",
261
+ failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
262
+ processError: "[WorkflowCompiler] Process error: {message}",
263
+ startFailed: "Failed to start workflow compiler: {message}",
264
+ operationCancelled: "Operation cancelled"
265
+ },
266
+ pathResolver: {
267
+ info: {
268
+ usingCached: "[PathResolver] Using cached compiler path: {path}",
269
+ usingExplicitPath: "[PathResolver] Using explicit compiler path: {path}",
270
+ resolving: "[PathResolver] Resolving workflow compiler path...",
271
+ checkingEnvVar: "[PathResolver] Checking environment variable location: {path}",
272
+ foundViaEnv: "[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION",
273
+ checkingNuGetCache: "[PathResolver] Checking NuGet cache: {path}",
274
+ foundInNuGetCache: "[PathResolver] Found compiler in NuGet cache",
275
+ notFoundStartingInstall: "[PathResolver] Compiler not found, starting dotnet restore...",
276
+ restoringPackage: '[PathResolver] Restoring NuGet package "{packageName}" v{version} for platform "{platform}" via dotnet restore...',
277
+ runningDotnetRestore: "[PathResolver] Running dotnet restore...",
278
+ restoreCompleted: "[PathResolver] dotnet restore completed",
279
+ installCompleted: "[PathResolver] Compiler restored successfully",
280
+ cleaningUp: "[PathResolver] Cleaning up temp directory",
281
+ resolved: "[PathResolver] Compiler resolved at: {path}"
282
+ },
283
+ errors: {
284
+ unsupportedPlatform: "Unsupported platform: {platform}",
285
+ compilerNotFoundAfterRestore: "Compiler not found in NuGet cache after dotnet restore.",
286
+ dotnetRestoreFailed: "dotnet restore failed: {details}"
287
+ }
288
+ }
289
+ }
290
+ };
291
+ // src/i18n/locales/pt.json
292
+ var pt_default = {
293
+ toolWorkflowcompiler: {
294
+ lifecycle: {
295
+ started: "[WorkflowCompiler] {operation} started",
296
+ command: "[WorkflowCompiler] Command: {command}",
297
+ completed: "[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}",
298
+ cancelled: "[WorkflowCompiler] Operation cancelled"
299
+ },
300
+ errors: {
301
+ processExited: "Process exited with code {exitCode}",
302
+ failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
303
+ processError: "[WorkflowCompiler] Process error: {message}",
304
+ startFailed: "Failed to start workflow compiler: {message}",
305
+ operationCancelled: "Operation cancelled"
306
+ },
307
+ pathResolver: {
308
+ info: {
309
+ usingCached: "[PathResolver] Using cached compiler path: {path}",
310
+ usingExplicitPath: "[PathResolver] Using explicit compiler path: {path}",
311
+ resolving: "[PathResolver] Resolving workflow compiler path...",
312
+ checkingEnvVar: "[PathResolver] Checking environment variable location: {path}",
313
+ foundViaEnv: "[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION",
314
+ checkingNuGetCache: "[PathResolver] Checking NuGet cache: {path}",
315
+ foundInNuGetCache: "[PathResolver] Found compiler in NuGet cache",
316
+ notFoundStartingInstall: "[PathResolver] Compiler not found, starting dotnet restore...",
317
+ restoringPackage: '[PathResolver] Restoring NuGet package "{packageName}" v{version} for platform "{platform}" via dotnet restore...',
318
+ runningDotnetRestore: "[PathResolver] Running dotnet restore...",
319
+ restoreCompleted: "[PathResolver] dotnet restore completed",
320
+ installCompleted: "[PathResolver] Compiler restored successfully",
321
+ cleaningUp: "[PathResolver] Cleaning up temp directory",
322
+ resolved: "[PathResolver] Compiler resolved at: {path}"
323
+ },
324
+ errors: {
325
+ unsupportedPlatform: "Unsupported platform: {platform}",
326
+ compilerNotFoundAfterRestore: "Compiler not found in NuGet cache after dotnet restore.",
327
+ dotnetRestoreFailed: "dotnet restore failed: {details}"
328
+ }
329
+ }
330
+ }
331
+ };
332
+ // src/i18n/locales/pt-BR.json
333
+ var pt_BR_default = {
334
+ toolWorkflowcompiler: {
335
+ lifecycle: {
336
+ started: "[WorkflowCompiler] {operation} started",
337
+ command: "[WorkflowCompiler] Command: {command}",
338
+ completed: "[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}",
339
+ cancelled: "[WorkflowCompiler] Operation cancelled"
340
+ },
341
+ errors: {
342
+ processExited: "Process exited with code {exitCode}",
343
+ failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
344
+ processError: "[WorkflowCompiler] Process error: {message}",
345
+ startFailed: "Failed to start workflow compiler: {message}",
346
+ operationCancelled: "Operation cancelled"
347
+ },
348
+ pathResolver: {
349
+ info: {
350
+ usingCached: "[PathResolver] Using cached compiler path: {path}",
351
+ usingExplicitPath: "[PathResolver] Using explicit compiler path: {path}",
352
+ resolving: "[PathResolver] Resolving workflow compiler path...",
353
+ checkingEnvVar: "[PathResolver] Checking environment variable location: {path}",
354
+ foundViaEnv: "[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION",
355
+ checkingNuGetCache: "[PathResolver] Checking NuGet cache: {path}",
356
+ foundInNuGetCache: "[PathResolver] Found compiler in NuGet cache",
357
+ notFoundStartingInstall: "[PathResolver] Compiler not found, starting dotnet restore...",
358
+ restoringPackage: '[PathResolver] Restoring NuGet package "{packageName}" v{version} for platform "{platform}" via dotnet restore...',
359
+ runningDotnetRestore: "[PathResolver] Running dotnet restore...",
360
+ restoreCompleted: "[PathResolver] dotnet restore completed",
361
+ installCompleted: "[PathResolver] Compiler restored successfully",
362
+ cleaningUp: "[PathResolver] Cleaning up temp directory",
363
+ resolved: "[PathResolver] Compiler resolved at: {path}"
364
+ },
365
+ errors: {
366
+ unsupportedPlatform: "Unsupported platform: {platform}",
367
+ compilerNotFoundAfterRestore: "Compiler not found in NuGet cache after dotnet restore.",
368
+ dotnetRestoreFailed: "dotnet restore failed: {details}"
369
+ }
370
+ }
371
+ }
372
+ };
373
+ // src/i18n/locales/ro.json
374
+ var ro_default = {
375
+ toolWorkflowcompiler: {
376
+ lifecycle: {
377
+ started: "[WorkflowCompiler] {operation} started",
378
+ command: "[WorkflowCompiler] Command: {command}",
379
+ completed: "[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}",
380
+ cancelled: "[WorkflowCompiler] Operation cancelled"
381
+ },
382
+ errors: {
383
+ processExited: "Process exited with code {exitCode}",
384
+ failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
385
+ processError: "[WorkflowCompiler] Process error: {message}",
386
+ startFailed: "Failed to start workflow compiler: {message}",
387
+ operationCancelled: "Operation cancelled"
388
+ },
389
+ pathResolver: {
390
+ info: {
391
+ usingCached: "[PathResolver] Using cached compiler path: {path}",
392
+ usingExplicitPath: "[PathResolver] Using explicit compiler path: {path}",
393
+ resolving: "[PathResolver] Resolving workflow compiler path...",
394
+ checkingEnvVar: "[PathResolver] Checking environment variable location: {path}",
395
+ foundViaEnv: "[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION",
396
+ checkingNuGetCache: "[PathResolver] Checking NuGet cache: {path}",
397
+ foundInNuGetCache: "[PathResolver] Found compiler in NuGet cache",
398
+ notFoundStartingInstall: "[PathResolver] Compiler not found, starting dotnet restore...",
399
+ restoringPackage: '[PathResolver] Restoring NuGet package "{packageName}" v{version} for platform "{platform}" via dotnet restore...',
400
+ runningDotnetRestore: "[PathResolver] Running dotnet restore...",
401
+ restoreCompleted: "[PathResolver] dotnet restore completed",
402
+ installCompleted: "[PathResolver] Compiler restored successfully",
403
+ cleaningUp: "[PathResolver] Cleaning up temp directory",
404
+ resolved: "[PathResolver] Compiler resolved at: {path}"
405
+ },
406
+ errors: {
407
+ unsupportedPlatform: "Unsupported platform: {platform}",
408
+ compilerNotFoundAfterRestore: "Compiler not found in NuGet cache after dotnet restore.",
409
+ dotnetRestoreFailed: "dotnet restore failed: {details}"
410
+ }
411
+ }
412
+ }
413
+ };
414
+ // src/i18n/locales/ru.json
415
+ var ru_default = {
416
+ toolWorkflowcompiler: {
417
+ lifecycle: {
418
+ started: "[WorkflowCompiler] {operation} started",
419
+ command: "[WorkflowCompiler] Command: {command}",
420
+ completed: "[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}",
421
+ cancelled: "[WorkflowCompiler] Operation cancelled"
422
+ },
423
+ errors: {
424
+ processExited: "Process exited with code {exitCode}",
425
+ failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
426
+ processError: "[WorkflowCompiler] Process error: {message}",
427
+ startFailed: "Failed to start workflow compiler: {message}",
428
+ operationCancelled: "Operation cancelled"
429
+ },
430
+ pathResolver: {
431
+ info: {
432
+ usingCached: "[PathResolver] Using cached compiler path: {path}",
433
+ usingExplicitPath: "[PathResolver] Using explicit compiler path: {path}",
434
+ resolving: "[PathResolver] Resolving workflow compiler path...",
435
+ checkingEnvVar: "[PathResolver] Checking environment variable location: {path}",
436
+ foundViaEnv: "[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION",
437
+ checkingNuGetCache: "[PathResolver] Checking NuGet cache: {path}",
438
+ foundInNuGetCache: "[PathResolver] Found compiler in NuGet cache",
439
+ notFoundStartingInstall: "[PathResolver] Compiler not found, starting dotnet restore...",
440
+ restoringPackage: '[PathResolver] Restoring NuGet package "{packageName}" v{version} for platform "{platform}" via dotnet restore...',
441
+ runningDotnetRestore: "[PathResolver] Running dotnet restore...",
442
+ restoreCompleted: "[PathResolver] dotnet restore completed",
443
+ installCompleted: "[PathResolver] Compiler restored successfully",
444
+ cleaningUp: "[PathResolver] Cleaning up temp directory",
445
+ resolved: "[PathResolver] Compiler resolved at: {path}"
446
+ },
447
+ errors: {
448
+ unsupportedPlatform: "Unsupported platform: {platform}",
449
+ compilerNotFoundAfterRestore: "Compiler not found in NuGet cache after dotnet restore.",
450
+ dotnetRestoreFailed: "dotnet restore failed: {details}"
451
+ }
452
+ }
453
+ }
454
+ };
455
+ // src/i18n/locales/tr.json
456
+ var tr_default = {
457
+ toolWorkflowcompiler: {
458
+ lifecycle: {
459
+ started: "[WorkflowCompiler] {operation} started",
460
+ command: "[WorkflowCompiler] Command: {command}",
461
+ completed: "[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}",
462
+ cancelled: "[WorkflowCompiler] Operation cancelled"
463
+ },
464
+ errors: {
465
+ processExited: "Process exited with code {exitCode}",
466
+ failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
467
+ processError: "[WorkflowCompiler] Process error: {message}",
468
+ startFailed: "Failed to start workflow compiler: {message}",
469
+ operationCancelled: "Operation cancelled"
470
+ },
471
+ pathResolver: {
472
+ info: {
473
+ usingCached: "[PathResolver] Using cached compiler path: {path}",
474
+ usingExplicitPath: "[PathResolver] Using explicit compiler path: {path}",
475
+ resolving: "[PathResolver] Resolving workflow compiler path...",
476
+ checkingEnvVar: "[PathResolver] Checking environment variable location: {path}",
477
+ foundViaEnv: "[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION",
478
+ checkingNuGetCache: "[PathResolver] Checking NuGet cache: {path}",
479
+ foundInNuGetCache: "[PathResolver] Found compiler in NuGet cache",
480
+ notFoundStartingInstall: "[PathResolver] Compiler not found, starting dotnet restore...",
481
+ restoringPackage: '[PathResolver] Restoring NuGet package "{packageName}" v{version} for platform "{platform}" via dotnet restore...',
482
+ runningDotnetRestore: "[PathResolver] Running dotnet restore...",
483
+ restoreCompleted: "[PathResolver] dotnet restore completed",
484
+ installCompleted: "[PathResolver] Compiler restored successfully",
485
+ cleaningUp: "[PathResolver] Cleaning up temp directory",
486
+ resolved: "[PathResolver] Compiler resolved at: {path}"
487
+ },
488
+ errors: {
489
+ unsupportedPlatform: "Unsupported platform: {platform}",
490
+ compilerNotFoundAfterRestore: "Compiler not found in NuGet cache after dotnet restore.",
491
+ dotnetRestoreFailed: "dotnet restore failed: {details}"
492
+ }
493
+ }
494
+ }
495
+ };
496
+ // src/i18n/locales/zh-CN.json
497
+ var zh_CN_default = {
498
+ toolWorkflowcompiler: {
499
+ lifecycle: {
500
+ started: "[WorkflowCompiler] {operation} started",
501
+ command: "[WorkflowCompiler] Command: {command}",
502
+ completed: "[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}",
503
+ cancelled: "[WorkflowCompiler] Operation cancelled"
504
+ },
505
+ errors: {
506
+ processExited: "Process exited with code {exitCode}",
507
+ failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
508
+ processError: "[WorkflowCompiler] Process error: {message}",
509
+ startFailed: "Failed to start workflow compiler: {message}",
510
+ operationCancelled: "Operation cancelled"
511
+ },
512
+ pathResolver: {
513
+ info: {
514
+ usingCached: "[PathResolver] Using cached compiler path: {path}",
515
+ usingExplicitPath: "[PathResolver] Using explicit compiler path: {path}",
516
+ resolving: "[PathResolver] Resolving workflow compiler path...",
517
+ checkingEnvVar: "[PathResolver] Checking environment variable location: {path}",
518
+ foundViaEnv: "[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION",
519
+ checkingNuGetCache: "[PathResolver] Checking NuGet cache: {path}",
520
+ foundInNuGetCache: "[PathResolver] Found compiler in NuGet cache",
521
+ notFoundStartingInstall: "[PathResolver] Compiler not found, starting dotnet restore...",
522
+ restoringPackage: '[PathResolver] Restoring NuGet package "{packageName}" v{version} for platform "{platform}" via dotnet restore...',
523
+ runningDotnetRestore: "[PathResolver] Running dotnet restore...",
524
+ restoreCompleted: "[PathResolver] dotnet restore completed",
525
+ installCompleted: "[PathResolver] Compiler restored successfully",
526
+ cleaningUp: "[PathResolver] Cleaning up temp directory",
527
+ resolved: "[PathResolver] Compiler resolved at: {path}"
528
+ },
529
+ errors: {
530
+ unsupportedPlatform: "Unsupported platform: {platform}",
531
+ compilerNotFoundAfterRestore: "Compiler not found in NuGet cache after dotnet restore.",
532
+ dotnetRestoreFailed: "dotnet restore failed: {details}"
533
+ }
534
+ }
535
+ }
536
+ };
537
+ // src/i18n/locales/zh-TW.json
538
+ var zh_TW_default = {
539
+ toolWorkflowcompiler: {
540
+ lifecycle: {
541
+ started: "[WorkflowCompiler] {operation} started",
542
+ command: "[WorkflowCompiler] Command: {command}",
543
+ completed: "[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}",
544
+ cancelled: "[WorkflowCompiler] Operation cancelled"
545
+ },
546
+ errors: {
547
+ processExited: "Process exited with code {exitCode}",
548
+ failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
549
+ processError: "[WorkflowCompiler] Process error: {message}",
550
+ startFailed: "Failed to start workflow compiler: {message}",
551
+ operationCancelled: "Operation cancelled"
552
+ },
553
+ pathResolver: {
554
+ info: {
555
+ usingCached: "[PathResolver] Using cached compiler path: {path}",
556
+ usingExplicitPath: "[PathResolver] Using explicit compiler path: {path}",
557
+ resolving: "[PathResolver] Resolving workflow compiler path...",
558
+ checkingEnvVar: "[PathResolver] Checking environment variable location: {path}",
559
+ foundViaEnv: "[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION",
560
+ checkingNuGetCache: "[PathResolver] Checking NuGet cache: {path}",
561
+ foundInNuGetCache: "[PathResolver] Found compiler in NuGet cache",
562
+ notFoundStartingInstall: "[PathResolver] Compiler not found, starting dotnet restore...",
563
+ restoringPackage: '[PathResolver] Restoring NuGet package "{packageName}" v{version} for platform "{platform}" via dotnet restore...',
564
+ runningDotnetRestore: "[PathResolver] Running dotnet restore...",
565
+ restoreCompleted: "[PathResolver] dotnet restore completed",
566
+ installCompleted: "[PathResolver] Compiler restored successfully",
567
+ cleaningUp: "[PathResolver] Cleaning up temp directory",
568
+ resolved: "[PathResolver] Compiler resolved at: {path}"
569
+ },
570
+ errors: {
571
+ unsupportedPlatform: "Unsupported platform: {platform}",
572
+ compilerNotFoundAfterRestore: "Compiler not found in NuGet cache after dotnet restore.",
573
+ dotnetRestoreFailed: "dotnet restore failed: {details}"
574
+ }
575
+ }
576
+ }
577
+ };
578
+ // src/i18n/locales/zu.json
579
+ var zu_default = {
580
+ toolWorkflowcompiler: {
581
+ lifecycle: {
582
+ started: "[WorkflowCompiler] {operation} started",
583
+ command: "[WorkflowCompiler] Command: {command}",
584
+ completed: "[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}",
585
+ cancelled: "[WorkflowCompiler] Operation cancelled"
586
+ },
587
+ errors: {
588
+ processExited: "Process exited with code {exitCode}",
589
+ failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
590
+ processError: "[WorkflowCompiler] Process error: {message}",
591
+ startFailed: "Failed to start workflow compiler: {message}",
592
+ operationCancelled: "Operation cancelled"
593
+ },
594
+ pathResolver: {
595
+ info: {
596
+ usingCached: "[PathResolver] Using cached compiler path: {path}",
597
+ usingExplicitPath: "[PathResolver] Using explicit compiler path: {path}",
598
+ resolving: "[PathResolver] Resolving workflow compiler path...",
599
+ checkingEnvVar: "[PathResolver] Checking environment variable location: {path}",
600
+ foundViaEnv: "[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION",
601
+ checkingNuGetCache: "[PathResolver] Checking NuGet cache: {path}",
602
+ foundInNuGetCache: "[PathResolver] Found compiler in NuGet cache",
603
+ notFoundStartingInstall: "[PathResolver] Compiler not found, starting dotnet restore...",
604
+ restoringPackage: '[PathResolver] Restoring NuGet package "{packageName}" v{version} for platform "{platform}" via dotnet restore...',
605
+ runningDotnetRestore: "[PathResolver] Running dotnet restore...",
606
+ restoreCompleted: "[PathResolver] dotnet restore completed",
607
+ installCompleted: "[PathResolver] Compiler restored successfully",
608
+ cleaningUp: "[PathResolver] Cleaning up temp directory",
609
+ resolved: "[PathResolver] Compiler resolved at: {path}"
610
+ },
611
+ errors: {
612
+ unsupportedPlatform: "Unsupported platform: {platform}",
613
+ compilerNotFoundAfterRestore: "Compiler not found in NuGet cache after dotnet restore.",
614
+ dotnetRestoreFailed: "dotnet restore failed: {details}"
615
+ }
616
+ }
617
+ }
618
+ };
619
+
620
+ // src/i18n/index.ts
621
+ I18nManager.registerTranslations("en", en);
622
+ I18nManager.registerTranslations("de", de_default);
623
+ I18nManager.registerTranslations("es", es_default);
624
+ I18nManager.registerTranslations("es-MX", es_MX_default);
625
+ I18nManager.registerTranslations("fr", fr_default);
626
+ I18nManager.registerTranslations("ja", ja_default);
627
+ I18nManager.registerTranslations("ko", ko_default);
628
+ I18nManager.registerTranslations("pt", pt_default);
629
+ I18nManager.registerTranslations("pt-BR", pt_BR_default);
630
+ I18nManager.registerTranslations("ro", ro_default);
631
+ I18nManager.registerTranslations("ru", ru_default);
632
+ I18nManager.registerTranslations("tr", tr_default);
633
+ I18nManager.registerTranslations("zh-CN", zh_CN_default);
634
+ I18nManager.registerTranslations("zh-TW", zh_TW_default);
635
+ I18nManager.registerTranslations("zu", zu_default);
636
+
637
+ // src/index.ts
638
+ import { toolsFactoryRepository } from "@uipath/solutionpackager-tool-core";
639
+
640
+ // src/workflow-compiler-tool-factory.ts
641
+ import {
642
+ ProjectTypes
643
+ } from "@uipath/solutionpackager-tool-core";
644
+
645
+ // src/workflow-compiler-tool.ts
646
+ import {
647
+ LogLevel,
648
+ ProjectTool
649
+ } from "@uipath/solutionpackager-tool-core";
650
+
651
+ // src/workflow-compiler-executor.ts
652
+ import { spawn } from "node:child_process";
653
+ import {
654
+ ToolErrorCodes,
655
+ ToolResult,
656
+ translate as translate2
657
+ } from "@uipath/solutionpackager-tool-core";
658
+
659
+ // src/workflow-compiler-path-resolver.ts
660
+ import { execFileSync } from "node:child_process";
661
+ import { homedir, platform } from "node:os";
662
+ import {
663
+ Path,
664
+ TemporaryStorageService,
665
+ translate
666
+ } from "@uipath/solutionpackager-tool-core";
667
+
668
+ // src/workflow-compiler-config.ts
669
+ var DEFAULT_WORKFLOW_COMPILER_VERSION = "26.0.0-alpha.22366";
670
+ var workflowCompilerConfig = {
671
+ workflowCompilerPath: undefined,
672
+ workflowCompilerVersion: DEFAULT_WORKFLOW_COMPILER_VERSION
673
+ };
674
+ function setupWorkflowCompiler(options) {
675
+ if (options.compilerPath !== undefined) {
676
+ workflowCompilerConfig.workflowCompilerPath = options.compilerPath;
677
+ }
678
+ if (options.version !== undefined) {
679
+ workflowCompilerConfig.workflowCompilerVersion = options.version;
680
+ }
681
+ }
682
+
683
+ // src/workflow-compiler-path-resolver.ts
684
+ var NUGET_FEED_URL = "https://uipath.pkgs.visualstudio.com/Public.Feeds/_packaging/UiPath-Internal/nuget/v3/index.json";
685
+ var PLATFORM_PACKAGES = {
686
+ win32: {
687
+ packageId: "UiPath.WorkflowCompiler.Windows",
688
+ compilerFileName: "UiPath.WorkflowCompiler.exe"
689
+ },
690
+ darwin: {
691
+ packageId: "UiPath.WorkflowCompiler.macOS",
692
+ compilerFileName: "UiPath.WorkflowCompiler.dll"
693
+ },
694
+ linux: {
695
+ packageId: "UiPath.WorkflowCompiler.Linux",
696
+ compilerFileName: "UiPath.WorkflowCompiler.dll"
697
+ }
698
+ };
699
+ var RESTORE_CSPROJ_TEMPLATE = `<Project Sdk="Microsoft.NET.Sdk">
700
+ <PropertyGroup>
701
+ <TargetFramework>net8.0</TargetFramework>
702
+ </PropertyGroup>
703
+ <ItemGroup>
704
+ <PackageReference Include="{packageId}" Version="{version}" />
705
+ </ItemGroup>
706
+ </Project>`;
707
+ var EMPTY_NUGET_CONFIG = `<?xml version="1.0" encoding="utf-8"?>
708
+ <configuration>
709
+ </configuration>`;
710
+
711
+ class WorkflowCompilerPathResolver {
712
+ logger;
713
+ fileSystem;
714
+ static instance = null;
715
+ cachedPath = null;
716
+ pendingResolution = null;
717
+ tempStorage;
718
+ constructor(logger, fileSystem) {
719
+ this.logger = logger;
720
+ this.fileSystem = fileSystem;
721
+ this.tempStorage = new TemporaryStorageService(fileSystem);
722
+ }
723
+ static getInstance(logger, fileSystem) {
724
+ if (!WorkflowCompilerPathResolver.instance) {
725
+ WorkflowCompilerPathResolver.instance = new WorkflowCompilerPathResolver(logger, fileSystem);
726
+ }
727
+ return WorkflowCompilerPathResolver.instance;
728
+ }
729
+ async getCompilerPathAsync() {
730
+ if (this.cachedPath) {
731
+ this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.usingCached", { path: this.cachedPath }));
732
+ return this.cachedPath;
733
+ }
734
+ if (this.pendingResolution) {
735
+ return this.pendingResolution;
736
+ }
737
+ this.pendingResolution = this.resolveCompilerPath();
738
+ this.cachedPath = await this.pendingResolution;
739
+ this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.resolved", {
740
+ path: this.cachedPath
741
+ }));
742
+ return this.cachedPath;
743
+ }
744
+ async resolveCompilerPath() {
745
+ this.logger.info("[PathResolver] resolveCompilerPath started");
746
+ if (workflowCompilerConfig.workflowCompilerPath) {
747
+ this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.usingExplicitPath", { path: workflowCompilerConfig.workflowCompilerPath }));
748
+ return workflowCompilerConfig.workflowCompilerPath;
749
+ }
750
+ this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.resolving"));
751
+ const envPath = await this.findInEnvLocation();
752
+ if (envPath)
753
+ return envPath;
754
+ const version = workflowCompilerConfig.workflowCompilerVersion;
755
+ const compilerPath = this.getNuGetCompilerPath(version);
756
+ this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.checkingNuGetCache", { path: compilerPath }));
757
+ if (await this.fileSystem.exists(compilerPath)) {
758
+ this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.foundInNuGetCache"));
759
+ return compilerPath;
760
+ }
761
+ this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.notFoundStartingInstall"));
762
+ return this.restoreAndResolve(compilerPath, version);
763
+ }
764
+ async findInEnvLocation() {
765
+ const location = process.env.UIPATH_WORKFLOWCOMPILER_LOCATION;
766
+ if (!location)
767
+ return null;
768
+ this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.checkingEnvVar", { path: location }));
769
+ if ((location.endsWith(".dll") || location.endsWith(".exe")) && await this.fileSystem.exists(location)) {
770
+ this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.foundViaEnv"));
771
+ return location;
772
+ }
773
+ return null;
774
+ }
775
+ async restoreAndResolve(compilerPath, version) {
776
+ const { packageId } = this.getPlatformInfo();
777
+ const tempDir = await this.tempStorage.getTempFolderPath();
778
+ try {
779
+ this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.restoringPackage", { packageName: packageId, version, platform: platform() }));
780
+ const csproj = RESTORE_CSPROJ_TEMPLATE.replace("{packageId}", packageId).replace("{version}", version);
781
+ await this.fileSystem.writeFile(Path.join(tempDir, "restore.csproj"), csproj);
782
+ await this.fileSystem.writeFile(Path.join(tempDir, "nuget.config"), EMPTY_NUGET_CONFIG);
783
+ this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.runningDotnetRestore"));
784
+ try {
785
+ execFileSync("dotnet", [
786
+ "restore",
787
+ "--source",
788
+ NUGET_FEED_URL,
789
+ "--source",
790
+ "https://api.nuget.org/v3/index.json"
791
+ ], {
792
+ cwd: tempDir,
793
+ stdio: "pipe"
794
+ });
795
+ } catch (error) {
796
+ const err = error;
797
+ const stderr = err?.stderr ? String(err.stderr).trim() : "";
798
+ const stdout = err?.stdout ? String(err.stdout).trim() : "";
799
+ const details = stderr || stdout || (error instanceof Error ? error.message : String(error));
800
+ throw new Error(translate.t("toolWorkflowcompiler.pathResolver.errors.dotnetRestoreFailed", { details }));
801
+ }
802
+ this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.restoreCompleted"));
803
+ if (!await this.fileSystem.exists(compilerPath)) {
804
+ throw new Error(translate.t("toolWorkflowcompiler.pathResolver.errors.compilerNotFoundAfterRestore"));
805
+ }
806
+ this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.installCompleted"));
807
+ return compilerPath;
808
+ } finally {
809
+ this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.cleaningUp"));
810
+ await this.tempStorage.cleanup();
811
+ }
812
+ }
813
+ getPlatformInfo() {
814
+ const info = PLATFORM_PACKAGES[platform()];
815
+ if (!info) {
816
+ throw new Error(translate.t("toolWorkflowcompiler.pathResolver.errors.unsupportedPlatform", { platform: platform() }));
817
+ }
818
+ return info;
819
+ }
820
+ getNuGetCompilerPath(version) {
821
+ const cacheRoot = process.env.NUGET_PACKAGES ?? Path.join(homedir(), ".nuget", "packages");
822
+ const { packageId, compilerFileName } = this.getPlatformInfo();
823
+ return Path.join(cacheRoot, packageId.toLowerCase(), version.toLowerCase(), "WorkflowCompiler", compilerFileName);
824
+ }
825
+ }
826
+
827
+ // src/workflow-compiler-executor.ts
828
+ function camelCaseKeys(obj) {
829
+ if (Array.isArray(obj)) {
830
+ return obj.map(camelCaseKeys);
831
+ }
832
+ if (obj !== null && typeof obj === "object") {
833
+ const result = {};
834
+ for (const [key, value] of Object.entries(obj)) {
835
+ result[key.charAt(0).toLowerCase() + key.slice(1)] = camelCaseKeys(value);
836
+ }
837
+ return result;
838
+ }
839
+ return obj;
840
+ }
841
+
842
+ class WorkflowCompilerExecutor {
843
+ logger;
844
+ static DOTNET_EXECUTABLE = "dotnet";
845
+ pathResolver;
846
+ constructor(logger, fileSystem) {
847
+ this.logger = logger;
848
+ this.pathResolver = WorkflowCompilerPathResolver.getInstance(logger, fileSystem);
849
+ }
850
+ async executeAsync(operation, args, cancellationToken) {
851
+ const startTime = Date.now();
852
+ const compilerPath = await this.pathResolver.getCompilerPathAsync();
853
+ const isDll = compilerPath.endsWith(".dll");
854
+ const executable = isDll ? WorkflowCompilerExecutor.DOTNET_EXECUTABLE : compilerPath;
855
+ const commandArgs = isDll ? [compilerPath, operation, ...args] : [operation, ...args];
856
+ this.logCommandStart(operation, executable, commandArgs);
857
+ return new Promise((resolve) => {
858
+ let result = null;
859
+ const fallbackErrors = [];
860
+ const childProcess = this.spawnProcess(executable, commandArgs);
861
+ let stdoutEnded = false;
862
+ let stderrEnded = false;
863
+ let processExited = false;
864
+ const checkComplete = () => {
865
+ if (stdoutEnded && stderrEnded && processExited) {
866
+ const elapsed = Date.now() - startTime;
867
+ if (result) {
868
+ result.elapsed = elapsed;
869
+ this.logger.info(translate2.t("toolWorkflowcompiler.lifecycle.completed", {
870
+ operation,
871
+ elapsed: elapsed.toString(),
872
+ errorCode: result.errorCode
873
+ }));
874
+ resolve(new ToolResult(result.errorCode, result.message, result.outputPackages));
875
+ } else {
876
+ const exitCode = childProcess.exitCode ?? -1;
877
+ const errorMessage = fallbackErrors.join(`
878
+ `) || translate2.t("toolWorkflowcompiler.errors.processExited", {
879
+ exitCode: exitCode.toString()
880
+ });
881
+ this.logger.error(translate2.t("toolWorkflowcompiler.errors.failed", {
882
+ operation,
883
+ errorMessage
884
+ }));
885
+ resolve(new ToolResult(ToolErrorCodes.InternalError, errorMessage, []));
886
+ }
887
+ }
888
+ };
889
+ const streamCompletion = {
890
+ markStdoutEnded: () => {
891
+ stdoutEnded = true;
892
+ checkComplete();
893
+ },
894
+ markStderrEnded: () => {
895
+ stderrEnded = true;
896
+ checkComplete();
897
+ },
898
+ markProcessExited: () => {
899
+ processExited = true;
900
+ checkComplete();
901
+ }
902
+ };
903
+ this.setupStdoutHandling(childProcess, streamCompletion, (r) => result = r);
904
+ this.setupStderrHandling(childProcess, streamCompletion, fallbackErrors);
905
+ this.setupProcessEventHandlers(childProcess, streamCompletion, resolve);
906
+ this.setupCancellationHandler(childProcess, cancellationToken, resolve);
907
+ });
908
+ }
909
+ spawnProcess(command, args) {
910
+ return spawn(command, args, {
911
+ stdio: ["ignore", "pipe", "pipe"],
912
+ shell: false,
913
+ windowsHide: true
914
+ });
915
+ }
916
+ logCommandStart(operation, executable, commandArgs) {
917
+ const fullCommand = [executable, ...commandArgs];
918
+ this.logger.info(translate2.t("toolWorkflowcompiler.lifecycle.started", {
919
+ operation
920
+ }));
921
+ this.logger.info(translate2.t("toolWorkflowcompiler.lifecycle.command", {
922
+ command: fullCommand.join(" ")
923
+ }));
924
+ }
925
+ setupStdoutHandling(childProcess, streamCompletion, onResult) {
926
+ if (!childProcess.stdout) {
927
+ streamCompletion.markStdoutEnded();
928
+ return;
929
+ }
930
+ let buffer = "";
931
+ childProcess.stdout.on("data", (data) => {
932
+ buffer += data.toString();
933
+ const lines = buffer.split(`
934
+ `);
935
+ buffer = lines.pop();
936
+ for (const line of lines) {
937
+ if (!line.trim())
938
+ continue;
939
+ this.processOutputLine(line, onResult);
940
+ }
941
+ });
942
+ childProcess.stdout.on("end", () => {
943
+ if (buffer.trim()) {
944
+ this.processOutputLine(buffer, onResult);
945
+ }
946
+ streamCompletion.markStdoutEnded();
947
+ });
948
+ }
949
+ processOutputLine(line, onResult) {
950
+ const entry = this.parseOutputEntry(line);
951
+ if (!entry)
952
+ return;
953
+ if (entry.type === "Result") {
954
+ onResult(entry);
955
+ } else if (entry.type === "Log") {
956
+ this.logMessage(entry);
957
+ } else if (entry.type === "Progress") {
958
+ this.logProgress(entry);
959
+ }
960
+ }
961
+ logMessage(log) {
962
+ switch (log.logLevel) {
963
+ case "Information":
964
+ this.logger.info(log.message);
965
+ break;
966
+ case "Warning":
967
+ this.logger.warn(log.message);
968
+ break;
969
+ case "Error":
970
+ this.logger.error(log.message);
971
+ break;
972
+ }
973
+ }
974
+ logProgress(progress) {
975
+ const percent = progress.percentage ? `${progress.percentage}%` : "";
976
+ const separator = percent && progress.message ? " - " : "";
977
+ this.logger.progress(`${percent}${separator}${progress.message ?? ""}`);
978
+ }
979
+ setupStderrHandling(childProcess, streamCompletion, fallbackErrors) {
980
+ if (!childProcess.stderr) {
981
+ streamCompletion.markStderrEnded();
982
+ return;
983
+ }
984
+ let buffer = "";
985
+ childProcess.stderr.on("data", (data) => {
986
+ buffer += data.toString();
987
+ const lines = buffer.split(`
988
+ `);
989
+ buffer = lines.pop();
990
+ for (const line of lines) {
991
+ if (!line.trim())
992
+ continue;
993
+ this.processErrorLine(line, fallbackErrors);
994
+ }
995
+ });
996
+ childProcess.stderr.on("end", () => {
997
+ if (buffer.trim()) {
998
+ this.processErrorLine(buffer, fallbackErrors);
999
+ }
1000
+ streamCompletion.markStderrEnded();
1001
+ });
1002
+ }
1003
+ processErrorLine(line, fallbackErrors) {
1004
+ const entry = this.parseOutputEntry(line);
1005
+ if (entry && entry.type === "Log") {
1006
+ this.logger.error(entry.message);
1007
+ } else {
1008
+ fallbackErrors.push(line);
1009
+ this.logger.error(line);
1010
+ }
1011
+ }
1012
+ setupProcessEventHandlers(childProcess, streamCompletion, resolve) {
1013
+ childProcess.on("exit", () => streamCompletion.markProcessExited());
1014
+ childProcess.on("error", (error) => {
1015
+ this.logger.error(translate2.t("toolWorkflowcompiler.errors.processError", {
1016
+ message: error.message
1017
+ }));
1018
+ resolve(new ToolResult(ToolErrorCodes.InternalError, translate2.t("toolWorkflowcompiler.errors.startFailed", {
1019
+ message: error.message
1020
+ }), []));
1021
+ });
1022
+ }
1023
+ setupCancellationHandler(childProcess, cancellationToken, resolve) {
1024
+ if (!cancellationToken)
1025
+ return;
1026
+ cancellationToken.addEventListener("abort", () => {
1027
+ this.logger.warn(translate2.t("toolWorkflowcompiler.lifecycle.cancelled"));
1028
+ childProcess.kill("SIGTERM");
1029
+ resolve(new ToolResult(ToolErrorCodes.Canceled, translate2.t("toolWorkflowcompiler.errors.operationCancelled"), []));
1030
+ });
1031
+ }
1032
+ parseOutputEntry(line) {
1033
+ try {
1034
+ const parsed = JSON.parse(line);
1035
+ const camelCased = camelCaseKeys(parsed);
1036
+ if (camelCased.errorCode !== undefined) {
1037
+ if (camelCased.errorCode === 0 || camelCased.success === true) {
1038
+ camelCased.errorCode = ToolErrorCodes.Success;
1039
+ } else {
1040
+ camelCased.errorCode = String(camelCased.errorCode);
1041
+ }
1042
+ }
1043
+ if (camelCased.outputPackages) {
1044
+ camelCased.outputPackages = camelCased.outputPackages.map((pkg) => pkg.path || pkg);
1045
+ }
1046
+ return camelCased;
1047
+ } catch {
1048
+ return null;
1049
+ }
1050
+ }
1051
+ }
1052
+
1053
+ // src/workflow-compiler-tool.ts
1054
+ class WorkflowCompilerTool extends ProjectTool {
1055
+ executor;
1056
+ constructor(fileSystem, logger) {
1057
+ super(fileSystem, logger);
1058
+ this.executor = new WorkflowCompilerExecutor(logger, fileSystem);
1059
+ }
1060
+ async restoreAsync(options, cancellationToken) {
1061
+ const args = [
1062
+ `-p`,
1063
+ options.projectPath,
1064
+ `--log-level`,
1065
+ String(options.logLevel ?? LogLevel.Info),
1066
+ `--destination`,
1067
+ options.outputPath ?? "",
1068
+ `--format-logs`,
1069
+ `true`,
1070
+ `--exclude-configured-sources`,
1071
+ `${options.excludeConfiguredSources}`
1072
+ ];
1073
+ if (options.nuGetSourcesConfigPath) {
1074
+ args.push(`--nuget-config-file`, options.nuGetSourcesConfigPath);
1075
+ }
1076
+ return this.executor.executeAsync("restore", args, cancellationToken);
1077
+ }
1078
+ async validateAsync(options, cancellationToken) {
1079
+ const args = [
1080
+ `-p`,
1081
+ options.projectPath,
1082
+ `--log-level`,
1083
+ String(options.logLevel ?? LogLevel.Info),
1084
+ `--format-logs`,
1085
+ `true`,
1086
+ `--skip-analyze`,
1087
+ `${options.skipAnalyze}`,
1088
+ `--exclude-configured-sources`,
1089
+ `${options.excludeConfiguredSources}`
1090
+ ];
1091
+ if (options.detailedLogPath) {
1092
+ args.push(`--detailed`, options.detailedLogPath);
1093
+ }
1094
+ if (options.defaultSeverity) {
1095
+ args.push(`--default-severity`, options.defaultSeverity);
1096
+ }
1097
+ if (options.policyFilePath) {
1098
+ args.push(`--policy-file`, options.policyFilePath);
1099
+ }
1100
+ if (options.policyFileType) {
1101
+ args.push(`--policy-file-type`, `${options.policyFileType}`);
1102
+ }
1103
+ if (options.nuGetSourcesConfigPath) {
1104
+ args.push(`--nuget-config-file`, options.nuGetSourcesConfigPath);
1105
+ }
1106
+ return this.executor.executeAsync("validate", args, cancellationToken);
1107
+ }
1108
+ async buildAsync(options, cancellationToken) {
1109
+ const args = [
1110
+ `-p`,
1111
+ options.projectPath,
1112
+ `-o`,
1113
+ options.outputPath,
1114
+ `--log-level`,
1115
+ String(options.logLevel ?? LogLevel.Info),
1116
+ `--format-logs`,
1117
+ `true`,
1118
+ `--skip-analyze`,
1119
+ `${options.skipAnalyze}`,
1120
+ `--skip-validate`,
1121
+ `${options.skipValidate}`,
1122
+ `--exclude-configured-sources`,
1123
+ `${options.excludeConfiguredSources}`
1124
+ ];
1125
+ if (options.detailedLogPath) {
1126
+ args.push(`--detailed`, options.detailedLogPath);
1127
+ }
1128
+ if (options.policyFilePath) {
1129
+ args.push(`--policy-file`, options.policyFilePath);
1130
+ }
1131
+ if (options.policyFileType) {
1132
+ args.push(`--policy-file-type`, `${options.policyFileType}`);
1133
+ }
1134
+ if (options.outputType) {
1135
+ const outputType = this.mapOutputType(options.outputType);
1136
+ args.push(`--output-type`, outputType);
1137
+ }
1138
+ if (options.nuGetSourcesConfigPath) {
1139
+ args.push(`--nuget-config-file`, options.nuGetSourcesConfigPath);
1140
+ }
1141
+ return this.executor.executeAsync("build", args, cancellationToken);
1142
+ }
1143
+ async packAsync(options, cancellationToken) {
1144
+ const args = [
1145
+ `-p`,
1146
+ options.projectPath,
1147
+ `-o`,
1148
+ options.outputPath,
1149
+ `--build-version`,
1150
+ options.package.version,
1151
+ `--log-level`,
1152
+ String(options.logLevel ?? LogLevel.Info),
1153
+ `--format-logs`,
1154
+ `true`,
1155
+ `--skip-analyze`,
1156
+ `${options.skipAnalyze}`,
1157
+ `--skip-validate`,
1158
+ `${options.skipValidate}`,
1159
+ `--no-optimize-deps`,
1160
+ `${options.skipDependencyOptimization}`,
1161
+ `--include-sources`,
1162
+ `${options.includeSources}`,
1163
+ `--split-packages`,
1164
+ `${options.splitPackages}`,
1165
+ `--exclude-configured-sources`,
1166
+ `${options.excludeConfiguredSources}`,
1167
+ `--pack-options`,
1168
+ JSON.stringify(options.package)
1169
+ ];
1170
+ if (options.package.id) {
1171
+ args.push(`--package-name`, options.package.id);
1172
+ }
1173
+ if (options.detailedLogPath) {
1174
+ args.push(`--detailed`, options.detailedLogPath);
1175
+ }
1176
+ if (options.policyFilePath) {
1177
+ args.push(`--policy-file`, options.policyFilePath);
1178
+ }
1179
+ if (options.policyFileType) {
1180
+ args.push(`--policy-file-type`, options.policyFileType);
1181
+ }
1182
+ if (options.outputType) {
1183
+ const outputType = this.mapOutputType(options.outputType);
1184
+ args.push(`--output-type`, outputType);
1185
+ }
1186
+ if (options.nuGetSourcesConfigPath) {
1187
+ args.push(`--nuget-config-file`, options.nuGetSourcesConfigPath);
1188
+ }
1189
+ return this.executor.executeAsync("build", args, cancellationToken);
1190
+ }
1191
+ mapOutputType(outputType) {
1192
+ return outputType === "WebApp" ? "Process" : outputType;
1193
+ }
1194
+ }
1195
+
1196
+ // src/workflow-compiler-tool-factory.ts
1197
+ class WorkflowCompilerToolFactory {
1198
+ supportedTypes = [
1199
+ ProjectTypes.Process,
1200
+ ProjectTypes.Library,
1201
+ ProjectTypes.Tests,
1202
+ ProjectTypes.WebApp
1203
+ ];
1204
+ async createAsync(logger, fileSystem) {
1205
+ return new WorkflowCompilerTool(fileSystem, logger);
1206
+ }
1207
+ }
1208
+
1209
+ // src/index.ts
1210
+ toolsFactoryRepository.registerProjectToolFactory(new WorkflowCompilerToolFactory);
1211
+ export {
1212
+ setupWorkflowCompiler
1213
+ };