@uipath/rpa-tool 0.1.6 → 0.1.8
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 +7 -2
- package/dist/packager-tool.js +646 -0
- package/dist/tool.js +16600 -6807
- package/package.json +56 -58
|
@@ -0,0 +1,646 @@
|
|
|
1
|
+
// node_modules/@uipath/tool-workflowcompiler/dist/index.js
|
|
2
|
+
import { I18nManager, LogLevel, ProjectTool, ProjectTypes, TemporaryStorageService, ToolErrorCodes, ToolResult, toolsFactoryRepository, translate } from "@uipath/solutionpackager-tool-core";
|
|
3
|
+
import { execFileSync, spawn } from "child_process";
|
|
4
|
+
import { homedir, platform } from "os";
|
|
5
|
+
import { join } from "path";
|
|
6
|
+
var de_namespaceObject = JSON.parse('{"toolWorkflowcompiler":{"lifecycle":{"started":"[WorkflowCompiler] {operation} started","command":"[WorkflowCompiler] Command: {command}","completed":"[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}","cancelled":"[WorkflowCompiler] Operation cancelled"},"errors":{"processExited":"Process exited with code {exitCode}","failed":"[WorkflowCompiler] {operation} failed: {errorMessage}","processError":"[WorkflowCompiler] Process error: {message}","startFailed":"Failed to start workflow compiler: {message}","operationCancelled":"Operation cancelled"},"pathResolver":{"info":{"usingCached":"[PathResolver] Using cached compiler path: {path}","usingExplicitPath":"[PathResolver] Using explicit compiler path: {path}","resolving":"[PathResolver] Resolving workflow compiler path...","checkingEnvVar":"[PathResolver] Checking environment variable location: {path}","foundViaEnv":"[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION","checkingNuGetCache":"[PathResolver] Checking NuGet cache: {path}","foundInNuGetCache":"[PathResolver] Found compiler in NuGet cache","notFoundStartingInstall":"[PathResolver] Compiler not found, starting dotnet restore...","restoringPackage":"[PathResolver] Restoring NuGet package \\"{packageName}\\" v{version} for platform \\"{platform}\\" via dotnet restore...","runningDotnetRestore":"[PathResolver] Running dotnet restore...","restoreCompleted":"[PathResolver] dotnet restore completed","installCompleted":"[PathResolver] Compiler restored successfully","cleaningUp":"[PathResolver] Cleaning up temp directory","resolved":"[PathResolver] Compiler resolved at: {path}"},"errors":{"unsupportedPlatform":"Unsupported platform: {platform}","compilerNotFoundAfterRestore":"Compiler not found in NuGet cache after dotnet restore.","dotnetRestoreFailed":"dotnet restore failed: {details}"}}}}');
|
|
7
|
+
var en = {
|
|
8
|
+
toolWorkflowcompiler: {
|
|
9
|
+
lifecycle: {
|
|
10
|
+
started: "[WorkflowCompiler] {operation} started",
|
|
11
|
+
command: "[WorkflowCompiler] Command: {command}",
|
|
12
|
+
completed: "[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}",
|
|
13
|
+
cancelled: "[WorkflowCompiler] Operation cancelled"
|
|
14
|
+
},
|
|
15
|
+
errors: {
|
|
16
|
+
processExited: "Process exited with code {exitCode}",
|
|
17
|
+
failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
18
|
+
processError: "[WorkflowCompiler] Process error: {message}",
|
|
19
|
+
startFailed: "Failed to start workflow compiler: {message}",
|
|
20
|
+
operationCancelled: "Operation cancelled"
|
|
21
|
+
},
|
|
22
|
+
pathResolver: {
|
|
23
|
+
info: {
|
|
24
|
+
usingCached: "[PathResolver] Using cached compiler path: {path}",
|
|
25
|
+
usingExplicitPath: "[PathResolver] Using explicit compiler path: {path}",
|
|
26
|
+
resolving: "[PathResolver] Resolving workflow compiler path...",
|
|
27
|
+
checkingEnvVar: "[PathResolver] Checking environment variable location: {path}",
|
|
28
|
+
foundViaEnv: "[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION",
|
|
29
|
+
checkingNuGetCache: "[PathResolver] Checking NuGet cache: {path}",
|
|
30
|
+
foundInNuGetCache: "[PathResolver] Found compiler in NuGet cache",
|
|
31
|
+
notFoundStartingInstall: "[PathResolver] Compiler not found, starting dotnet restore...",
|
|
32
|
+
restoringPackage: '[PathResolver] Restoring NuGet package "{packageName}" v{version} for platform "{platform}" via dotnet restore...',
|
|
33
|
+
runningDotnetRestore: "[PathResolver] Running dotnet restore...",
|
|
34
|
+
restoreCompleted: "[PathResolver] dotnet restore completed",
|
|
35
|
+
installCompleted: "[PathResolver] Compiler restored successfully",
|
|
36
|
+
cleaningUp: "[PathResolver] Cleaning up temp directory",
|
|
37
|
+
resolved: "[PathResolver] Compiler resolved at: {path}"
|
|
38
|
+
},
|
|
39
|
+
errors: {
|
|
40
|
+
unsupportedPlatform: "Unsupported platform: {platform}",
|
|
41
|
+
compilerNotFoundAfterRestore: "Compiler not found in NuGet cache after dotnet restore.",
|
|
42
|
+
dotnetRestoreFailed: "dotnet restore failed: {details}"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var es_namespaceObject = JSON.parse('{"toolWorkflowcompiler":{"lifecycle":{"started":"[WorkflowCompiler] {operation} started","command":"[WorkflowCompiler] Command: {command}","completed":"[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}","cancelled":"[WorkflowCompiler] Operation cancelled"},"errors":{"processExited":"Process exited with code {exitCode}","failed":"[WorkflowCompiler] {operation} failed: {errorMessage}","processError":"[WorkflowCompiler] Process error: {message}","startFailed":"Failed to start workflow compiler: {message}","operationCancelled":"Operation cancelled"},"pathResolver":{"info":{"usingCached":"[PathResolver] Using cached compiler path: {path}","usingExplicitPath":"[PathResolver] Using explicit compiler path: {path}","resolving":"[PathResolver] Resolving workflow compiler path...","checkingEnvVar":"[PathResolver] Checking environment variable location: {path}","foundViaEnv":"[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION","checkingNuGetCache":"[PathResolver] Checking NuGet cache: {path}","foundInNuGetCache":"[PathResolver] Found compiler in NuGet cache","notFoundStartingInstall":"[PathResolver] Compiler not found, starting dotnet restore...","restoringPackage":"[PathResolver] Restoring NuGet package \\"{packageName}\\" v{version} for platform \\"{platform}\\" via dotnet restore...","runningDotnetRestore":"[PathResolver] Running dotnet restore...","restoreCompleted":"[PathResolver] dotnet restore completed","installCompleted":"[PathResolver] Compiler restored successfully","cleaningUp":"[PathResolver] Cleaning up temp directory","resolved":"[PathResolver] Compiler resolved at: {path}"},"errors":{"unsupportedPlatform":"Unsupported platform: {platform}","compilerNotFoundAfterRestore":"Compiler not found in NuGet cache after dotnet restore.","dotnetRestoreFailed":"dotnet restore failed: {details}"}}}}');
|
|
48
|
+
var es_MX_namespaceObject = JSON.parse('{"toolWorkflowcompiler":{"lifecycle":{"started":"[WorkflowCompiler] {operation} started","command":"[WorkflowCompiler] Command: {command}","completed":"[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}","cancelled":"[WorkflowCompiler] Operation cancelled"},"errors":{"processExited":"Process exited with code {exitCode}","failed":"[WorkflowCompiler] {operation} failed: {errorMessage}","processError":"[WorkflowCompiler] Process error: {message}","startFailed":"Failed to start workflow compiler: {message}","operationCancelled":"Operation cancelled"},"pathResolver":{"info":{"usingCached":"[PathResolver] Using cached compiler path: {path}","usingExplicitPath":"[PathResolver] Using explicit compiler path: {path}","resolving":"[PathResolver] Resolving workflow compiler path...","checkingEnvVar":"[PathResolver] Checking environment variable location: {path}","foundViaEnv":"[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION","checkingNuGetCache":"[PathResolver] Checking NuGet cache: {path}","foundInNuGetCache":"[PathResolver] Found compiler in NuGet cache","notFoundStartingInstall":"[PathResolver] Compiler not found, starting dotnet restore...","restoringPackage":"[PathResolver] Restoring NuGet package \\"{packageName}\\" v{version} for platform \\"{platform}\\" via dotnet restore...","runningDotnetRestore":"[PathResolver] Running dotnet restore...","restoreCompleted":"[PathResolver] dotnet restore completed","installCompleted":"[PathResolver] Compiler restored successfully","cleaningUp":"[PathResolver] Cleaning up temp directory","resolved":"[PathResolver] Compiler resolved at: {path}"},"errors":{"unsupportedPlatform":"Unsupported platform: {platform}","compilerNotFoundAfterRestore":"Compiler not found in NuGet cache after dotnet restore.","dotnetRestoreFailed":"dotnet restore failed: {details}"}}}}');
|
|
49
|
+
var fr_namespaceObject = JSON.parse('{"toolWorkflowcompiler":{"lifecycle":{"started":"[WorkflowCompiler] {operation} started","command":"[WorkflowCompiler] Command: {command}","completed":"[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}","cancelled":"[WorkflowCompiler] Operation cancelled"},"errors":{"processExited":"Process exited with code {exitCode}","failed":"[WorkflowCompiler] {operation} failed: {errorMessage}","processError":"[WorkflowCompiler] Process error: {message}","startFailed":"Failed to start workflow compiler: {message}","operationCancelled":"Operation cancelled"},"pathResolver":{"info":{"usingCached":"[PathResolver] Using cached compiler path: {path}","usingExplicitPath":"[PathResolver] Using explicit compiler path: {path}","resolving":"[PathResolver] Resolving workflow compiler path...","checkingEnvVar":"[PathResolver] Checking environment variable location: {path}","foundViaEnv":"[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION","checkingNuGetCache":"[PathResolver] Checking NuGet cache: {path}","foundInNuGetCache":"[PathResolver] Found compiler in NuGet cache","notFoundStartingInstall":"[PathResolver] Compiler not found, starting dotnet restore...","restoringPackage":"[PathResolver] Restoring NuGet package \\"{packageName}\\" v{version} for platform \\"{platform}\\" via dotnet restore...","runningDotnetRestore":"[PathResolver] Running dotnet restore...","restoreCompleted":"[PathResolver] dotnet restore completed","installCompleted":"[PathResolver] Compiler restored successfully","cleaningUp":"[PathResolver] Cleaning up temp directory","resolved":"[PathResolver] Compiler resolved at: {path}"},"errors":{"unsupportedPlatform":"Unsupported platform: {platform}","compilerNotFoundAfterRestore":"Compiler not found in NuGet cache after dotnet restore.","dotnetRestoreFailed":"dotnet restore failed: {details}"}}}}');
|
|
50
|
+
var ja_namespaceObject = JSON.parse('{"toolWorkflowcompiler":{"lifecycle":{"started":"[WorkflowCompiler] {operation} started","command":"[WorkflowCompiler] Command: {command}","completed":"[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}","cancelled":"[WorkflowCompiler] Operation cancelled"},"errors":{"processExited":"Process exited with code {exitCode}","failed":"[WorkflowCompiler] {operation} failed: {errorMessage}","processError":"[WorkflowCompiler] Process error: {message}","startFailed":"Failed to start workflow compiler: {message}","operationCancelled":"Operation cancelled"},"pathResolver":{"info":{"usingCached":"[PathResolver] Using cached compiler path: {path}","usingExplicitPath":"[PathResolver] Using explicit compiler path: {path}","resolving":"[PathResolver] Resolving workflow compiler path...","checkingEnvVar":"[PathResolver] Checking environment variable location: {path}","foundViaEnv":"[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION","checkingNuGetCache":"[PathResolver] Checking NuGet cache: {path}","foundInNuGetCache":"[PathResolver] Found compiler in NuGet cache","notFoundStartingInstall":"[PathResolver] Compiler not found, starting dotnet restore...","restoringPackage":"[PathResolver] Restoring NuGet package \\"{packageName}\\" v{version} for platform \\"{platform}\\" via dotnet restore...","runningDotnetRestore":"[PathResolver] Running dotnet restore...","restoreCompleted":"[PathResolver] dotnet restore completed","installCompleted":"[PathResolver] Compiler restored successfully","cleaningUp":"[PathResolver] Cleaning up temp directory","resolved":"[PathResolver] Compiler resolved at: {path}"},"errors":{"unsupportedPlatform":"Unsupported platform: {platform}","compilerNotFoundAfterRestore":"Compiler not found in NuGet cache after dotnet restore.","dotnetRestoreFailed":"dotnet restore failed: {details}"}}}}');
|
|
51
|
+
var ko_namespaceObject = JSON.parse('{"toolWorkflowcompiler":{"lifecycle":{"started":"[WorkflowCompiler] {operation} started","command":"[WorkflowCompiler] Command: {command}","completed":"[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}","cancelled":"[WorkflowCompiler] Operation cancelled"},"errors":{"processExited":"Process exited with code {exitCode}","failed":"[WorkflowCompiler] {operation} failed: {errorMessage}","processError":"[WorkflowCompiler] Process error: {message}","startFailed":"Failed to start workflow compiler: {message}","operationCancelled":"Operation cancelled"},"pathResolver":{"info":{"usingCached":"[PathResolver] Using cached compiler path: {path}","usingExplicitPath":"[PathResolver] Using explicit compiler path: {path}","resolving":"[PathResolver] Resolving workflow compiler path...","checkingEnvVar":"[PathResolver] Checking environment variable location: {path}","foundViaEnv":"[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION","checkingNuGetCache":"[PathResolver] Checking NuGet cache: {path}","foundInNuGetCache":"[PathResolver] Found compiler in NuGet cache","notFoundStartingInstall":"[PathResolver] Compiler not found, starting dotnet restore...","restoringPackage":"[PathResolver] Restoring NuGet package \\"{packageName}\\" v{version} for platform \\"{platform}\\" via dotnet restore...","runningDotnetRestore":"[PathResolver] Running dotnet restore...","restoreCompleted":"[PathResolver] dotnet restore completed","installCompleted":"[PathResolver] Compiler restored successfully","cleaningUp":"[PathResolver] Cleaning up temp directory","resolved":"[PathResolver] Compiler resolved at: {path}"},"errors":{"unsupportedPlatform":"Unsupported platform: {platform}","compilerNotFoundAfterRestore":"Compiler not found in NuGet cache after dotnet restore.","dotnetRestoreFailed":"dotnet restore failed: {details}"}}}}');
|
|
52
|
+
var pt_namespaceObject = JSON.parse('{"toolWorkflowcompiler":{"lifecycle":{"started":"[WorkflowCompiler] {operation} started","command":"[WorkflowCompiler] Command: {command}","completed":"[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}","cancelled":"[WorkflowCompiler] Operation cancelled"},"errors":{"processExited":"Process exited with code {exitCode}","failed":"[WorkflowCompiler] {operation} failed: {errorMessage}","processError":"[WorkflowCompiler] Process error: {message}","startFailed":"Failed to start workflow compiler: {message}","operationCancelled":"Operation cancelled"},"pathResolver":{"info":{"usingCached":"[PathResolver] Using cached compiler path: {path}","usingExplicitPath":"[PathResolver] Using explicit compiler path: {path}","resolving":"[PathResolver] Resolving workflow compiler path...","checkingEnvVar":"[PathResolver] Checking environment variable location: {path}","foundViaEnv":"[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION","checkingNuGetCache":"[PathResolver] Checking NuGet cache: {path}","foundInNuGetCache":"[PathResolver] Found compiler in NuGet cache","notFoundStartingInstall":"[PathResolver] Compiler not found, starting dotnet restore...","restoringPackage":"[PathResolver] Restoring NuGet package \\"{packageName}\\" v{version} for platform \\"{platform}\\" via dotnet restore...","runningDotnetRestore":"[PathResolver] Running dotnet restore...","restoreCompleted":"[PathResolver] dotnet restore completed","installCompleted":"[PathResolver] Compiler restored successfully","cleaningUp":"[PathResolver] Cleaning up temp directory","resolved":"[PathResolver] Compiler resolved at: {path}"},"errors":{"unsupportedPlatform":"Unsupported platform: {platform}","compilerNotFoundAfterRestore":"Compiler not found in NuGet cache after dotnet restore.","dotnetRestoreFailed":"dotnet restore failed: {details}"}}}}');
|
|
53
|
+
var pt_BR_namespaceObject = JSON.parse('{"toolWorkflowcompiler":{"lifecycle":{"started":"[WorkflowCompiler] {operation} started","command":"[WorkflowCompiler] Command: {command}","completed":"[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}","cancelled":"[WorkflowCompiler] Operation cancelled"},"errors":{"processExited":"Process exited with code {exitCode}","failed":"[WorkflowCompiler] {operation} failed: {errorMessage}","processError":"[WorkflowCompiler] Process error: {message}","startFailed":"Failed to start workflow compiler: {message}","operationCancelled":"Operation cancelled"},"pathResolver":{"info":{"usingCached":"[PathResolver] Using cached compiler path: {path}","usingExplicitPath":"[PathResolver] Using explicit compiler path: {path}","resolving":"[PathResolver] Resolving workflow compiler path...","checkingEnvVar":"[PathResolver] Checking environment variable location: {path}","foundViaEnv":"[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION","checkingNuGetCache":"[PathResolver] Checking NuGet cache: {path}","foundInNuGetCache":"[PathResolver] Found compiler in NuGet cache","notFoundStartingInstall":"[PathResolver] Compiler not found, starting dotnet restore...","restoringPackage":"[PathResolver] Restoring NuGet package \\"{packageName}\\" v{version} for platform \\"{platform}\\" via dotnet restore...","runningDotnetRestore":"[PathResolver] Running dotnet restore...","restoreCompleted":"[PathResolver] dotnet restore completed","installCompleted":"[PathResolver] Compiler restored successfully","cleaningUp":"[PathResolver] Cleaning up temp directory","resolved":"[PathResolver] Compiler resolved at: {path}"},"errors":{"unsupportedPlatform":"Unsupported platform: {platform}","compilerNotFoundAfterRestore":"Compiler not found in NuGet cache after dotnet restore.","dotnetRestoreFailed":"dotnet restore failed: {details}"}}}}');
|
|
54
|
+
var ro_namespaceObject = JSON.parse('{"toolWorkflowcompiler":{"lifecycle":{"started":"[WorkflowCompiler] {operation} started","command":"[WorkflowCompiler] Command: {command}","completed":"[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}","cancelled":"[WorkflowCompiler] Operation cancelled"},"errors":{"processExited":"Process exited with code {exitCode}","failed":"[WorkflowCompiler] {operation} failed: {errorMessage}","processError":"[WorkflowCompiler] Process error: {message}","startFailed":"Failed to start workflow compiler: {message}","operationCancelled":"Operation cancelled"},"pathResolver":{"info":{"usingCached":"[PathResolver] Using cached compiler path: {path}","usingExplicitPath":"[PathResolver] Using explicit compiler path: {path}","resolving":"[PathResolver] Resolving workflow compiler path...","checkingEnvVar":"[PathResolver] Checking environment variable location: {path}","foundViaEnv":"[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION","checkingNuGetCache":"[PathResolver] Checking NuGet cache: {path}","foundInNuGetCache":"[PathResolver] Found compiler in NuGet cache","notFoundStartingInstall":"[PathResolver] Compiler not found, starting dotnet restore...","restoringPackage":"[PathResolver] Restoring NuGet package \\"{packageName}\\" v{version} for platform \\"{platform}\\" via dotnet restore...","runningDotnetRestore":"[PathResolver] Running dotnet restore...","restoreCompleted":"[PathResolver] dotnet restore completed","installCompleted":"[PathResolver] Compiler restored successfully","cleaningUp":"[PathResolver] Cleaning up temp directory","resolved":"[PathResolver] Compiler resolved at: {path}"},"errors":{"unsupportedPlatform":"Unsupported platform: {platform}","compilerNotFoundAfterRestore":"Compiler not found in NuGet cache after dotnet restore.","dotnetRestoreFailed":"dotnet restore failed: {details}"}}}}');
|
|
55
|
+
var ru_namespaceObject = JSON.parse('{"toolWorkflowcompiler":{"lifecycle":{"started":"[WorkflowCompiler] {operation} started","command":"[WorkflowCompiler] Command: {command}","completed":"[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}","cancelled":"[WorkflowCompiler] Operation cancelled"},"errors":{"processExited":"Process exited with code {exitCode}","failed":"[WorkflowCompiler] {operation} failed: {errorMessage}","processError":"[WorkflowCompiler] Process error: {message}","startFailed":"Failed to start workflow compiler: {message}","operationCancelled":"Operation cancelled"},"pathResolver":{"info":{"usingCached":"[PathResolver] Using cached compiler path: {path}","usingExplicitPath":"[PathResolver] Using explicit compiler path: {path}","resolving":"[PathResolver] Resolving workflow compiler path...","checkingEnvVar":"[PathResolver] Checking environment variable location: {path}","foundViaEnv":"[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION","checkingNuGetCache":"[PathResolver] Checking NuGet cache: {path}","foundInNuGetCache":"[PathResolver] Found compiler in NuGet cache","notFoundStartingInstall":"[PathResolver] Compiler not found, starting dotnet restore...","restoringPackage":"[PathResolver] Restoring NuGet package \\"{packageName}\\" v{version} for platform \\"{platform}\\" via dotnet restore...","runningDotnetRestore":"[PathResolver] Running dotnet restore...","restoreCompleted":"[PathResolver] dotnet restore completed","installCompleted":"[PathResolver] Compiler restored successfully","cleaningUp":"[PathResolver] Cleaning up temp directory","resolved":"[PathResolver] Compiler resolved at: {path}"},"errors":{"unsupportedPlatform":"Unsupported platform: {platform}","compilerNotFoundAfterRestore":"Compiler not found in NuGet cache after dotnet restore.","dotnetRestoreFailed":"dotnet restore failed: {details}"}}}}');
|
|
56
|
+
var tr_namespaceObject = JSON.parse('{"toolWorkflowcompiler":{"lifecycle":{"started":"[WorkflowCompiler] {operation} started","command":"[WorkflowCompiler] Command: {command}","completed":"[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}","cancelled":"[WorkflowCompiler] Operation cancelled"},"errors":{"processExited":"Process exited with code {exitCode}","failed":"[WorkflowCompiler] {operation} failed: {errorMessage}","processError":"[WorkflowCompiler] Process error: {message}","startFailed":"Failed to start workflow compiler: {message}","operationCancelled":"Operation cancelled"},"pathResolver":{"info":{"usingCached":"[PathResolver] Using cached compiler path: {path}","usingExplicitPath":"[PathResolver] Using explicit compiler path: {path}","resolving":"[PathResolver] Resolving workflow compiler path...","checkingEnvVar":"[PathResolver] Checking environment variable location: {path}","foundViaEnv":"[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION","checkingNuGetCache":"[PathResolver] Checking NuGet cache: {path}","foundInNuGetCache":"[PathResolver] Found compiler in NuGet cache","notFoundStartingInstall":"[PathResolver] Compiler not found, starting dotnet restore...","restoringPackage":"[PathResolver] Restoring NuGet package \\"{packageName}\\" v{version} for platform \\"{platform}\\" via dotnet restore...","runningDotnetRestore":"[PathResolver] Running dotnet restore...","restoreCompleted":"[PathResolver] dotnet restore completed","installCompleted":"[PathResolver] Compiler restored successfully","cleaningUp":"[PathResolver] Cleaning up temp directory","resolved":"[PathResolver] Compiler resolved at: {path}"},"errors":{"unsupportedPlatform":"Unsupported platform: {platform}","compilerNotFoundAfterRestore":"Compiler not found in NuGet cache after dotnet restore.","dotnetRestoreFailed":"dotnet restore failed: {details}"}}}}');
|
|
57
|
+
var zh_CN_namespaceObject = JSON.parse('{"toolWorkflowcompiler":{"lifecycle":{"started":"[WorkflowCompiler] {operation} started","command":"[WorkflowCompiler] Command: {command}","completed":"[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}","cancelled":"[WorkflowCompiler] Operation cancelled"},"errors":{"processExited":"Process exited with code {exitCode}","failed":"[WorkflowCompiler] {operation} failed: {errorMessage}","processError":"[WorkflowCompiler] Process error: {message}","startFailed":"Failed to start workflow compiler: {message}","operationCancelled":"Operation cancelled"},"pathResolver":{"info":{"usingCached":"[PathResolver] Using cached compiler path: {path}","usingExplicitPath":"[PathResolver] Using explicit compiler path: {path}","resolving":"[PathResolver] Resolving workflow compiler path...","checkingEnvVar":"[PathResolver] Checking environment variable location: {path}","foundViaEnv":"[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION","checkingNuGetCache":"[PathResolver] Checking NuGet cache: {path}","foundInNuGetCache":"[PathResolver] Found compiler in NuGet cache","notFoundStartingInstall":"[PathResolver] Compiler not found, starting dotnet restore...","restoringPackage":"[PathResolver] Restoring NuGet package \\"{packageName}\\" v{version} for platform \\"{platform}\\" via dotnet restore...","runningDotnetRestore":"[PathResolver] Running dotnet restore...","restoreCompleted":"[PathResolver] dotnet restore completed","installCompleted":"[PathResolver] Compiler restored successfully","cleaningUp":"[PathResolver] Cleaning up temp directory","resolved":"[PathResolver] Compiler resolved at: {path}"},"errors":{"unsupportedPlatform":"Unsupported platform: {platform}","compilerNotFoundAfterRestore":"Compiler not found in NuGet cache after dotnet restore.","dotnetRestoreFailed":"dotnet restore failed: {details}"}}}}');
|
|
58
|
+
var zh_TW_namespaceObject = JSON.parse('{"toolWorkflowcompiler":{"lifecycle":{"started":"[WorkflowCompiler] {operation} started","command":"[WorkflowCompiler] Command: {command}","completed":"[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}","cancelled":"[WorkflowCompiler] Operation cancelled"},"errors":{"processExited":"Process exited with code {exitCode}","failed":"[WorkflowCompiler] {operation} failed: {errorMessage}","processError":"[WorkflowCompiler] Process error: {message}","startFailed":"Failed to start workflow compiler: {message}","operationCancelled":"Operation cancelled"},"pathResolver":{"info":{"usingCached":"[PathResolver] Using cached compiler path: {path}","usingExplicitPath":"[PathResolver] Using explicit compiler path: {path}","resolving":"[PathResolver] Resolving workflow compiler path...","checkingEnvVar":"[PathResolver] Checking environment variable location: {path}","foundViaEnv":"[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION","checkingNuGetCache":"[PathResolver] Checking NuGet cache: {path}","foundInNuGetCache":"[PathResolver] Found compiler in NuGet cache","notFoundStartingInstall":"[PathResolver] Compiler not found, starting dotnet restore...","restoringPackage":"[PathResolver] Restoring NuGet package \\"{packageName}\\" v{version} for platform \\"{platform}\\" via dotnet restore...","runningDotnetRestore":"[PathResolver] Running dotnet restore...","restoreCompleted":"[PathResolver] dotnet restore completed","installCompleted":"[PathResolver] Compiler restored successfully","cleaningUp":"[PathResolver] Cleaning up temp directory","resolved":"[PathResolver] Compiler resolved at: {path}"},"errors":{"unsupportedPlatform":"Unsupported platform: {platform}","compilerNotFoundAfterRestore":"Compiler not found in NuGet cache after dotnet restore.","dotnetRestoreFailed":"dotnet restore failed: {details}"}}}}');
|
|
59
|
+
var zu_namespaceObject = JSON.parse('{"toolWorkflowcompiler":{"lifecycle":{"started":"[WorkflowCompiler] {operation} started","command":"[WorkflowCompiler] Command: {command}","completed":"[WorkflowCompiler] {operation} completed in {elapsed}ms with code: {errorCode}","cancelled":"[WorkflowCompiler] Operation cancelled"},"errors":{"processExited":"Process exited with code {exitCode}","failed":"[WorkflowCompiler] {operation} failed: {errorMessage}","processError":"[WorkflowCompiler] Process error: {message}","startFailed":"Failed to start workflow compiler: {message}","operationCancelled":"Operation cancelled"},"pathResolver":{"info":{"usingCached":"[PathResolver] Using cached compiler path: {path}","usingExplicitPath":"[PathResolver] Using explicit compiler path: {path}","resolving":"[PathResolver] Resolving workflow compiler path...","checkingEnvVar":"[PathResolver] Checking environment variable location: {path}","foundViaEnv":"[PathResolver] Found compiler via UIPATH_WORKFLOWCOMPILER_LOCATION","checkingNuGetCache":"[PathResolver] Checking NuGet cache: {path}","foundInNuGetCache":"[PathResolver] Found compiler in NuGet cache","notFoundStartingInstall":"[PathResolver] Compiler not found, starting dotnet restore...","restoringPackage":"[PathResolver] Restoring NuGet package \\"{packageName}\\" v{version} for platform \\"{platform}\\" via dotnet restore...","runningDotnetRestore":"[PathResolver] Running dotnet restore...","restoreCompleted":"[PathResolver] dotnet restore completed","installCompleted":"[PathResolver] Compiler restored successfully","cleaningUp":"[PathResolver] Cleaning up temp directory","resolved":"[PathResolver] Compiler resolved at: {path}"},"errors":{"unsupportedPlatform":"Unsupported platform: {platform}","compilerNotFoundAfterRestore":"Compiler not found in NuGet cache after dotnet restore.","dotnetRestoreFailed":"dotnet restore failed: {details}"}}}}');
|
|
60
|
+
I18nManager.registerTranslations("en", en);
|
|
61
|
+
I18nManager.registerTranslations("de", de_namespaceObject);
|
|
62
|
+
I18nManager.registerTranslations("es", es_namespaceObject);
|
|
63
|
+
I18nManager.registerTranslations("es-MX", es_MX_namespaceObject);
|
|
64
|
+
I18nManager.registerTranslations("fr", fr_namespaceObject);
|
|
65
|
+
I18nManager.registerTranslations("ja", ja_namespaceObject);
|
|
66
|
+
I18nManager.registerTranslations("ko", ko_namespaceObject);
|
|
67
|
+
I18nManager.registerTranslations("pt", pt_namespaceObject);
|
|
68
|
+
I18nManager.registerTranslations("pt-BR", pt_BR_namespaceObject);
|
|
69
|
+
I18nManager.registerTranslations("ro", ro_namespaceObject);
|
|
70
|
+
I18nManager.registerTranslations("ru", ru_namespaceObject);
|
|
71
|
+
I18nManager.registerTranslations("tr", tr_namespaceObject);
|
|
72
|
+
I18nManager.registerTranslations("zh-CN", zh_CN_namespaceObject);
|
|
73
|
+
I18nManager.registerTranslations("zh-TW", zh_TW_namespaceObject);
|
|
74
|
+
I18nManager.registerTranslations("zu", zu_namespaceObject);
|
|
75
|
+
var DEFAULT_WORKFLOW_COMPILER_VERSION = "26.0.0-alpha.22366";
|
|
76
|
+
var workflowCompilerConfig = {
|
|
77
|
+
workflowCompilerPath: undefined,
|
|
78
|
+
workflowCompilerVersion: DEFAULT_WORKFLOW_COMPILER_VERSION
|
|
79
|
+
};
|
|
80
|
+
function _define_property(obj, key, value) {
|
|
81
|
+
if (key in obj)
|
|
82
|
+
Object.defineProperty(obj, key, {
|
|
83
|
+
value,
|
|
84
|
+
enumerable: true,
|
|
85
|
+
configurable: true,
|
|
86
|
+
writable: true
|
|
87
|
+
});
|
|
88
|
+
else
|
|
89
|
+
obj[key] = value;
|
|
90
|
+
return obj;
|
|
91
|
+
}
|
|
92
|
+
var NUGET_FEED_URL = "https://uipath.pkgs.visualstudio.com/Public.Feeds/_packaging/UiPath-Internal/nuget/v3/index.json";
|
|
93
|
+
var PLATFORM_PACKAGES = {
|
|
94
|
+
win32: {
|
|
95
|
+
packageId: "UiPath.WorkflowCompiler.Windows",
|
|
96
|
+
compilerFileName: "UiPath.WorkflowCompiler.exe"
|
|
97
|
+
},
|
|
98
|
+
darwin: {
|
|
99
|
+
packageId: "UiPath.WorkflowCompiler.macOS",
|
|
100
|
+
compilerFileName: "UiPath.WorkflowCompiler.dll"
|
|
101
|
+
},
|
|
102
|
+
linux: {
|
|
103
|
+
packageId: "UiPath.WorkflowCompiler.Linux",
|
|
104
|
+
compilerFileName: "UiPath.WorkflowCompiler.dll"
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
var RESTORE_CSPROJ_TEMPLATE = `<Project Sdk="Microsoft.NET.Sdk">
|
|
108
|
+
<PropertyGroup>
|
|
109
|
+
<TargetFramework>net8.0</TargetFramework>
|
|
110
|
+
</PropertyGroup>
|
|
111
|
+
<ItemGroup>
|
|
112
|
+
<PackageReference Include="{packageId}" Version="{version}" />
|
|
113
|
+
</ItemGroup>
|
|
114
|
+
</Project>`;
|
|
115
|
+
var EMPTY_NUGET_CONFIG = `<?xml version="1.0" encoding="utf-8"?>
|
|
116
|
+
<configuration>
|
|
117
|
+
</configuration>`;
|
|
118
|
+
|
|
119
|
+
class WorkflowCompilerPathResolver {
|
|
120
|
+
static getInstance(logger, fileSystem) {
|
|
121
|
+
if (!WorkflowCompilerPathResolver.instance)
|
|
122
|
+
WorkflowCompilerPathResolver.instance = new WorkflowCompilerPathResolver(logger, fileSystem);
|
|
123
|
+
return WorkflowCompilerPathResolver.instance;
|
|
124
|
+
}
|
|
125
|
+
async getCompilerPathAsync() {
|
|
126
|
+
if (this.cachedPath) {
|
|
127
|
+
this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.usingCached", {
|
|
128
|
+
path: this.cachedPath
|
|
129
|
+
}));
|
|
130
|
+
return this.cachedPath;
|
|
131
|
+
}
|
|
132
|
+
if (this.pendingResolution)
|
|
133
|
+
return this.pendingResolution;
|
|
134
|
+
this.pendingResolution = this.resolveCompilerPath();
|
|
135
|
+
this.cachedPath = await this.pendingResolution;
|
|
136
|
+
this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.resolved", {
|
|
137
|
+
path: this.cachedPath
|
|
138
|
+
}));
|
|
139
|
+
return this.cachedPath;
|
|
140
|
+
}
|
|
141
|
+
async resolveCompilerPath() {
|
|
142
|
+
this.logger.info("[PathResolver] resolveCompilerPath started");
|
|
143
|
+
if (workflowCompilerConfig.workflowCompilerPath) {
|
|
144
|
+
this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.usingExplicitPath", {
|
|
145
|
+
path: workflowCompilerConfig.workflowCompilerPath
|
|
146
|
+
}));
|
|
147
|
+
return workflowCompilerConfig.workflowCompilerPath;
|
|
148
|
+
}
|
|
149
|
+
this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.resolving"));
|
|
150
|
+
const envPath = await this.findInEnvLocation();
|
|
151
|
+
if (envPath)
|
|
152
|
+
return envPath;
|
|
153
|
+
const version = workflowCompilerConfig.workflowCompilerVersion;
|
|
154
|
+
const compilerPath = this.getNuGetCompilerPath(version);
|
|
155
|
+
this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.checkingNuGetCache", {
|
|
156
|
+
path: compilerPath
|
|
157
|
+
}));
|
|
158
|
+
if (await this.fileSystem.exists(compilerPath)) {
|
|
159
|
+
this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.foundInNuGetCache"));
|
|
160
|
+
return compilerPath;
|
|
161
|
+
}
|
|
162
|
+
this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.notFoundStartingInstall"));
|
|
163
|
+
return this.restoreAndResolve(compilerPath, version);
|
|
164
|
+
}
|
|
165
|
+
async findInEnvLocation() {
|
|
166
|
+
const location = process.env.UIPATH_WORKFLOWCOMPILER_LOCATION;
|
|
167
|
+
if (!location)
|
|
168
|
+
return null;
|
|
169
|
+
this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.checkingEnvVar", {
|
|
170
|
+
path: location
|
|
171
|
+
}));
|
|
172
|
+
if ((location.endsWith(".dll") || location.endsWith(".exe")) && await this.fileSystem.exists(location)) {
|
|
173
|
+
this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.foundViaEnv"));
|
|
174
|
+
return location;
|
|
175
|
+
}
|
|
176
|
+
return null;
|
|
177
|
+
}
|
|
178
|
+
async restoreAndResolve(compilerPath, version) {
|
|
179
|
+
const { packageId } = this.getPlatformInfo();
|
|
180
|
+
const tempDir = await this.tempStorage.getTempFolderPath();
|
|
181
|
+
try {
|
|
182
|
+
this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.restoringPackage", {
|
|
183
|
+
packageName: packageId,
|
|
184
|
+
version,
|
|
185
|
+
platform: platform()
|
|
186
|
+
}));
|
|
187
|
+
const csproj = RESTORE_CSPROJ_TEMPLATE.replace("{packageId}", packageId).replace("{version}", version);
|
|
188
|
+
await this.fileSystem.writeFile(join(tempDir, "restore.csproj"), csproj);
|
|
189
|
+
await this.fileSystem.writeFile(join(tempDir, "nuget.config"), EMPTY_NUGET_CONFIG);
|
|
190
|
+
this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.runningDotnetRestore"));
|
|
191
|
+
try {
|
|
192
|
+
execFileSync("dotnet", [
|
|
193
|
+
"restore",
|
|
194
|
+
"--source",
|
|
195
|
+
NUGET_FEED_URL,
|
|
196
|
+
"--source",
|
|
197
|
+
"https://api.nuget.org/v3/index.json"
|
|
198
|
+
], {
|
|
199
|
+
cwd: tempDir,
|
|
200
|
+
stdio: "pipe"
|
|
201
|
+
});
|
|
202
|
+
} catch (error) {
|
|
203
|
+
const err = error;
|
|
204
|
+
const stderr = err?.stderr ? String(err.stderr).trim() : "";
|
|
205
|
+
const stdout = err?.stdout ? String(err.stdout).trim() : "";
|
|
206
|
+
const details = stderr || stdout || (error instanceof Error ? error.message : String(error));
|
|
207
|
+
throw new Error(translate.t("toolWorkflowcompiler.pathResolver.errors.dotnetRestoreFailed", {
|
|
208
|
+
details
|
|
209
|
+
}));
|
|
210
|
+
}
|
|
211
|
+
this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.restoreCompleted"));
|
|
212
|
+
if (!await this.fileSystem.exists(compilerPath))
|
|
213
|
+
throw new Error(translate.t("toolWorkflowcompiler.pathResolver.errors.compilerNotFoundAfterRestore"));
|
|
214
|
+
this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.installCompleted"));
|
|
215
|
+
return compilerPath;
|
|
216
|
+
} finally {
|
|
217
|
+
this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.cleaningUp"));
|
|
218
|
+
await this.tempStorage.cleanup();
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
getPlatformInfo() {
|
|
222
|
+
const info = PLATFORM_PACKAGES[platform()];
|
|
223
|
+
if (!info)
|
|
224
|
+
throw new Error(translate.t("toolWorkflowcompiler.pathResolver.errors.unsupportedPlatform", {
|
|
225
|
+
platform: platform()
|
|
226
|
+
}));
|
|
227
|
+
return info;
|
|
228
|
+
}
|
|
229
|
+
getNuGetCompilerPath(version) {
|
|
230
|
+
const cacheRoot = process.env.NUGET_PACKAGES ?? join(homedir(), ".nuget", "packages");
|
|
231
|
+
const { packageId, compilerFileName } = this.getPlatformInfo();
|
|
232
|
+
return join(cacheRoot, packageId.toLowerCase(), version.toLowerCase(), "WorkflowCompiler", compilerFileName);
|
|
233
|
+
}
|
|
234
|
+
constructor(logger, fileSystem) {
|
|
235
|
+
_define_property(this, "logger", undefined);
|
|
236
|
+
_define_property(this, "fileSystem", undefined);
|
|
237
|
+
_define_property(this, "cachedPath", undefined);
|
|
238
|
+
_define_property(this, "pendingResolution", undefined);
|
|
239
|
+
_define_property(this, "tempStorage", undefined);
|
|
240
|
+
this.logger = logger;
|
|
241
|
+
this.fileSystem = fileSystem;
|
|
242
|
+
this.cachedPath = null;
|
|
243
|
+
this.pendingResolution = null;
|
|
244
|
+
this.tempStorage = new TemporaryStorageService(fileSystem);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
_define_property(WorkflowCompilerPathResolver, "instance", null);
|
|
248
|
+
function workflow_compiler_executor_define_property(obj, key, value) {
|
|
249
|
+
if (key in obj)
|
|
250
|
+
Object.defineProperty(obj, key, {
|
|
251
|
+
value,
|
|
252
|
+
enumerable: true,
|
|
253
|
+
configurable: true,
|
|
254
|
+
writable: true
|
|
255
|
+
});
|
|
256
|
+
else
|
|
257
|
+
obj[key] = value;
|
|
258
|
+
return obj;
|
|
259
|
+
}
|
|
260
|
+
function camelCaseKeys(obj) {
|
|
261
|
+
if (Array.isArray(obj))
|
|
262
|
+
return obj.map(camelCaseKeys);
|
|
263
|
+
if (obj !== null && typeof obj == "object") {
|
|
264
|
+
const result = {};
|
|
265
|
+
for (const [key, value] of Object.entries(obj))
|
|
266
|
+
result[key.charAt(0).toLowerCase() + key.slice(1)] = camelCaseKeys(value);
|
|
267
|
+
return result;
|
|
268
|
+
}
|
|
269
|
+
return obj;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
class WorkflowCompilerExecutor {
|
|
273
|
+
async executeAsync(operation, args, cancellationToken) {
|
|
274
|
+
const startTime = Date.now();
|
|
275
|
+
const compilerPath = await this.pathResolver.getCompilerPathAsync();
|
|
276
|
+
const isDll = compilerPath.endsWith(".dll");
|
|
277
|
+
const executable = isDll ? WorkflowCompilerExecutor.DOTNET_EXECUTABLE : compilerPath;
|
|
278
|
+
const commandArgs = isDll ? [
|
|
279
|
+
compilerPath,
|
|
280
|
+
operation,
|
|
281
|
+
...args
|
|
282
|
+
] : [
|
|
283
|
+
operation,
|
|
284
|
+
...args
|
|
285
|
+
];
|
|
286
|
+
this.logCommandStart(operation, executable, commandArgs);
|
|
287
|
+
return new Promise((resolve) => {
|
|
288
|
+
let result = null;
|
|
289
|
+
const fallbackErrors = [];
|
|
290
|
+
const childProcess = this.spawnProcess(executable, commandArgs);
|
|
291
|
+
let stdoutEnded = false;
|
|
292
|
+
let stderrEnded = false;
|
|
293
|
+
let processExited = false;
|
|
294
|
+
const checkComplete = () => {
|
|
295
|
+
if (stdoutEnded && stderrEnded && processExited) {
|
|
296
|
+
const elapsed = Date.now() - startTime;
|
|
297
|
+
if (result) {
|
|
298
|
+
result.elapsed = elapsed;
|
|
299
|
+
this.logger.info(translate.t("toolWorkflowcompiler.lifecycle.completed", {
|
|
300
|
+
operation,
|
|
301
|
+
elapsed: elapsed.toString(),
|
|
302
|
+
errorCode: result.errorCode
|
|
303
|
+
}));
|
|
304
|
+
resolve(new ToolResult(result.errorCode, result.message, result.outputPackages));
|
|
305
|
+
} else {
|
|
306
|
+
const exitCode = childProcess.exitCode ?? -1;
|
|
307
|
+
const errorMessage = fallbackErrors.join(`
|
|
308
|
+
`) || translate.t("toolWorkflowcompiler.errors.processExited", {
|
|
309
|
+
exitCode: exitCode.toString()
|
|
310
|
+
});
|
|
311
|
+
this.logger.error(translate.t("toolWorkflowcompiler.errors.failed", {
|
|
312
|
+
operation,
|
|
313
|
+
errorMessage
|
|
314
|
+
}));
|
|
315
|
+
resolve(new ToolResult(ToolErrorCodes.InternalError, errorMessage, []));
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
const streamCompletion = {
|
|
320
|
+
markStdoutEnded: () => {
|
|
321
|
+
stdoutEnded = true;
|
|
322
|
+
checkComplete();
|
|
323
|
+
},
|
|
324
|
+
markStderrEnded: () => {
|
|
325
|
+
stderrEnded = true;
|
|
326
|
+
checkComplete();
|
|
327
|
+
},
|
|
328
|
+
markProcessExited: () => {
|
|
329
|
+
processExited = true;
|
|
330
|
+
checkComplete();
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
this.setupStdoutHandling(childProcess, streamCompletion, (r) => result = r);
|
|
334
|
+
this.setupStderrHandling(childProcess, streamCompletion, fallbackErrors);
|
|
335
|
+
this.setupProcessEventHandlers(childProcess, streamCompletion, resolve);
|
|
336
|
+
this.setupCancellationHandler(childProcess, cancellationToken, resolve);
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
spawnProcess(command, args) {
|
|
340
|
+
return spawn(command, args, {
|
|
341
|
+
stdio: [
|
|
342
|
+
"ignore",
|
|
343
|
+
"pipe",
|
|
344
|
+
"pipe"
|
|
345
|
+
],
|
|
346
|
+
shell: false,
|
|
347
|
+
windowsHide: true
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
logCommandStart(operation, executable, commandArgs) {
|
|
351
|
+
const fullCommand = [
|
|
352
|
+
executable,
|
|
353
|
+
...commandArgs
|
|
354
|
+
];
|
|
355
|
+
this.logger.info(translate.t("toolWorkflowcompiler.lifecycle.started", {
|
|
356
|
+
operation
|
|
357
|
+
}));
|
|
358
|
+
this.logger.info(translate.t("toolWorkflowcompiler.lifecycle.command", {
|
|
359
|
+
command: fullCommand.join(" ")
|
|
360
|
+
}));
|
|
361
|
+
}
|
|
362
|
+
setupStdoutHandling(childProcess, streamCompletion, onResult) {
|
|
363
|
+
if (!childProcess.stdout)
|
|
364
|
+
return void streamCompletion.markStdoutEnded();
|
|
365
|
+
let buffer = "";
|
|
366
|
+
childProcess.stdout.on("data", (data) => {
|
|
367
|
+
buffer += data.toString();
|
|
368
|
+
const lines = buffer.split(`
|
|
369
|
+
`);
|
|
370
|
+
buffer = lines.pop();
|
|
371
|
+
for (const line of lines)
|
|
372
|
+
if (line.trim())
|
|
373
|
+
this.processOutputLine(line, onResult);
|
|
374
|
+
});
|
|
375
|
+
childProcess.stdout.on("end", () => {
|
|
376
|
+
if (buffer.trim())
|
|
377
|
+
this.processOutputLine(buffer, onResult);
|
|
378
|
+
streamCompletion.markStdoutEnded();
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
processOutputLine(line, onResult) {
|
|
382
|
+
const entry = this.parseOutputEntry(line);
|
|
383
|
+
if (!entry)
|
|
384
|
+
return;
|
|
385
|
+
if (entry.type === "Result")
|
|
386
|
+
onResult(entry);
|
|
387
|
+
else if (entry.type === "Log")
|
|
388
|
+
this.logMessage(entry);
|
|
389
|
+
else if (entry.type === "Progress")
|
|
390
|
+
this.logProgress(entry);
|
|
391
|
+
}
|
|
392
|
+
logMessage(log) {
|
|
393
|
+
switch (log.logLevel) {
|
|
394
|
+
case "Information":
|
|
395
|
+
this.logger.info(log.message);
|
|
396
|
+
break;
|
|
397
|
+
case "Warning":
|
|
398
|
+
this.logger.warn(log.message);
|
|
399
|
+
break;
|
|
400
|
+
case "Error":
|
|
401
|
+
this.logger.error(log.message);
|
|
402
|
+
break;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
logProgress(progress) {
|
|
406
|
+
const percent = progress.percentage ? `${progress.percentage}%` : "";
|
|
407
|
+
const separator = percent && progress.message ? " - " : "";
|
|
408
|
+
this.logger.progress(`${percent}${separator}${progress.message ?? ""}`);
|
|
409
|
+
}
|
|
410
|
+
setupStderrHandling(childProcess, streamCompletion, fallbackErrors) {
|
|
411
|
+
if (!childProcess.stderr)
|
|
412
|
+
return void streamCompletion.markStderrEnded();
|
|
413
|
+
let buffer = "";
|
|
414
|
+
childProcess.stderr.on("data", (data) => {
|
|
415
|
+
buffer += data.toString();
|
|
416
|
+
const lines = buffer.split(`
|
|
417
|
+
`);
|
|
418
|
+
buffer = lines.pop();
|
|
419
|
+
for (const line of lines)
|
|
420
|
+
if (line.trim())
|
|
421
|
+
this.processErrorLine(line, fallbackErrors);
|
|
422
|
+
});
|
|
423
|
+
childProcess.stderr.on("end", () => {
|
|
424
|
+
if (buffer.trim())
|
|
425
|
+
this.processErrorLine(buffer, fallbackErrors);
|
|
426
|
+
streamCompletion.markStderrEnded();
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
processErrorLine(line, fallbackErrors) {
|
|
430
|
+
const entry = this.parseOutputEntry(line);
|
|
431
|
+
if (entry && entry.type === "Log")
|
|
432
|
+
this.logger.error(entry.message);
|
|
433
|
+
else {
|
|
434
|
+
fallbackErrors.push(line);
|
|
435
|
+
this.logger.error(line);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
setupProcessEventHandlers(childProcess, streamCompletion, resolve) {
|
|
439
|
+
childProcess.on("exit", () => streamCompletion.markProcessExited());
|
|
440
|
+
childProcess.on("error", (error) => {
|
|
441
|
+
this.logger.error(translate.t("toolWorkflowcompiler.errors.processError", {
|
|
442
|
+
message: error.message
|
|
443
|
+
}));
|
|
444
|
+
resolve(new ToolResult(ToolErrorCodes.InternalError, translate.t("toolWorkflowcompiler.errors.startFailed", {
|
|
445
|
+
message: error.message
|
|
446
|
+
}), []));
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
setupCancellationHandler(childProcess, cancellationToken, resolve) {
|
|
450
|
+
if (!cancellationToken)
|
|
451
|
+
return;
|
|
452
|
+
cancellationToken.addEventListener("abort", () => {
|
|
453
|
+
this.logger.warn(translate.t("toolWorkflowcompiler.lifecycle.cancelled"));
|
|
454
|
+
childProcess.kill("SIGTERM");
|
|
455
|
+
resolve(new ToolResult(ToolErrorCodes.Canceled, translate.t("toolWorkflowcompiler.errors.operationCancelled"), []));
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
parseOutputEntry(line) {
|
|
459
|
+
try {
|
|
460
|
+
const parsed = JSON.parse(line);
|
|
461
|
+
const camelCased = camelCaseKeys(parsed);
|
|
462
|
+
if (camelCased.errorCode !== undefined)
|
|
463
|
+
if (camelCased.errorCode === 0 || camelCased.success === true)
|
|
464
|
+
camelCased.errorCode = ToolErrorCodes.Success;
|
|
465
|
+
else
|
|
466
|
+
camelCased.errorCode = String(camelCased.errorCode);
|
|
467
|
+
if (camelCased.outputPackages)
|
|
468
|
+
camelCased.outputPackages = camelCased.outputPackages.map((pkg) => pkg.path || pkg);
|
|
469
|
+
return camelCased;
|
|
470
|
+
} catch {
|
|
471
|
+
return null;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
constructor(logger, fileSystem) {
|
|
475
|
+
workflow_compiler_executor_define_property(this, "logger", undefined);
|
|
476
|
+
workflow_compiler_executor_define_property(this, "pathResolver", undefined);
|
|
477
|
+
this.logger = logger;
|
|
478
|
+
this.pathResolver = WorkflowCompilerPathResolver.getInstance(logger, fileSystem);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
workflow_compiler_executor_define_property(WorkflowCompilerExecutor, "DOTNET_EXECUTABLE", "dotnet");
|
|
482
|
+
function workflow_compiler_tool_define_property(obj, key, value) {
|
|
483
|
+
if (key in obj)
|
|
484
|
+
Object.defineProperty(obj, key, {
|
|
485
|
+
value,
|
|
486
|
+
enumerable: true,
|
|
487
|
+
configurable: true,
|
|
488
|
+
writable: true
|
|
489
|
+
});
|
|
490
|
+
else
|
|
491
|
+
obj[key] = value;
|
|
492
|
+
return obj;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
class WorkflowCompilerTool extends ProjectTool {
|
|
496
|
+
async restoreAsync(options, cancellationToken) {
|
|
497
|
+
const args = [
|
|
498
|
+
"-p",
|
|
499
|
+
options.projectPath,
|
|
500
|
+
"--log-level",
|
|
501
|
+
String(options.logLevel ?? LogLevel.Info),
|
|
502
|
+
"--destination",
|
|
503
|
+
options.outputPath ?? "",
|
|
504
|
+
"--format-logs",
|
|
505
|
+
"true",
|
|
506
|
+
"--exclude-configured-sources",
|
|
507
|
+
`${options.excludeConfiguredSources}`
|
|
508
|
+
];
|
|
509
|
+
if (options.nuGetSourcesConfigPath)
|
|
510
|
+
args.push("--nuget-config-file", options.nuGetSourcesConfigPath);
|
|
511
|
+
return this.executor.executeAsync("restore", args, cancellationToken);
|
|
512
|
+
}
|
|
513
|
+
async validateAsync(options, cancellationToken) {
|
|
514
|
+
const args = [
|
|
515
|
+
"-p",
|
|
516
|
+
options.projectPath,
|
|
517
|
+
"--log-level",
|
|
518
|
+
String(options.logLevel ?? LogLevel.Info),
|
|
519
|
+
"--format-logs",
|
|
520
|
+
"true",
|
|
521
|
+
"--skip-analyze",
|
|
522
|
+
`${options.skipAnalyze}`,
|
|
523
|
+
"--exclude-configured-sources",
|
|
524
|
+
`${options.excludeConfiguredSources}`
|
|
525
|
+
];
|
|
526
|
+
if (options.detailedLogPath)
|
|
527
|
+
args.push("--detailed", options.detailedLogPath);
|
|
528
|
+
if (options.defaultSeverity)
|
|
529
|
+
args.push("--default-severity", options.defaultSeverity);
|
|
530
|
+
if (options.policyFilePath)
|
|
531
|
+
args.push("--policy-file", options.policyFilePath);
|
|
532
|
+
if (options.policyFileType)
|
|
533
|
+
args.push("--policy-file-type", `${options.policyFileType}`);
|
|
534
|
+
if (options.nuGetSourcesConfigPath)
|
|
535
|
+
args.push("--nuget-config-file", options.nuGetSourcesConfigPath);
|
|
536
|
+
return this.executor.executeAsync("validate", args, cancellationToken);
|
|
537
|
+
}
|
|
538
|
+
async buildAsync(options, cancellationToken) {
|
|
539
|
+
const args = [
|
|
540
|
+
"-p",
|
|
541
|
+
options.projectPath,
|
|
542
|
+
"-o",
|
|
543
|
+
options.outputPath,
|
|
544
|
+
"--log-level",
|
|
545
|
+
String(options.logLevel ?? LogLevel.Info),
|
|
546
|
+
"--format-logs",
|
|
547
|
+
"true",
|
|
548
|
+
"--skip-analyze",
|
|
549
|
+
`${options.skipAnalyze}`,
|
|
550
|
+
"--skip-validate",
|
|
551
|
+
`${options.skipValidate}`,
|
|
552
|
+
"--exclude-configured-sources",
|
|
553
|
+
`${options.excludeConfiguredSources}`
|
|
554
|
+
];
|
|
555
|
+
if (options.detailedLogPath)
|
|
556
|
+
args.push("--detailed", options.detailedLogPath);
|
|
557
|
+
if (options.policyFilePath)
|
|
558
|
+
args.push("--policy-file", options.policyFilePath);
|
|
559
|
+
if (options.policyFileType)
|
|
560
|
+
args.push("--policy-file-type", `${options.policyFileType}`);
|
|
561
|
+
if (options.outputType) {
|
|
562
|
+
const outputType = this.mapOutputType(options.outputType);
|
|
563
|
+
args.push("--output-type", outputType);
|
|
564
|
+
}
|
|
565
|
+
if (options.nuGetSourcesConfigPath)
|
|
566
|
+
args.push("--nuget-config-file", options.nuGetSourcesConfigPath);
|
|
567
|
+
return this.executor.executeAsync("build", args, cancellationToken);
|
|
568
|
+
}
|
|
569
|
+
async packAsync(options, cancellationToken) {
|
|
570
|
+
const args = [
|
|
571
|
+
"-p",
|
|
572
|
+
options.projectPath,
|
|
573
|
+
"-o",
|
|
574
|
+
options.outputPath,
|
|
575
|
+
"--build-version",
|
|
576
|
+
options.package.version,
|
|
577
|
+
"--log-level",
|
|
578
|
+
String(options.logLevel ?? LogLevel.Info),
|
|
579
|
+
"--format-logs",
|
|
580
|
+
"true",
|
|
581
|
+
"--skip-analyze",
|
|
582
|
+
`${options.skipAnalyze}`,
|
|
583
|
+
"--skip-validate",
|
|
584
|
+
`${options.skipValidate}`,
|
|
585
|
+
"--no-optimize-deps",
|
|
586
|
+
`${options.skipDependencyOptimization}`,
|
|
587
|
+
"--include-sources",
|
|
588
|
+
`${options.includeSources}`,
|
|
589
|
+
"--split-packages",
|
|
590
|
+
`${options.splitPackages}`,
|
|
591
|
+
"--exclude-configured-sources",
|
|
592
|
+
`${options.excludeConfiguredSources}`,
|
|
593
|
+
"--pack-options",
|
|
594
|
+
JSON.stringify(options.package)
|
|
595
|
+
];
|
|
596
|
+
if (options.package.id)
|
|
597
|
+
args.push("--package-name", options.package.id);
|
|
598
|
+
if (options.detailedLogPath)
|
|
599
|
+
args.push("--detailed", options.detailedLogPath);
|
|
600
|
+
if (options.policyFilePath)
|
|
601
|
+
args.push("--policy-file", options.policyFilePath);
|
|
602
|
+
if (options.policyFileType)
|
|
603
|
+
args.push("--policy-file-type", options.policyFileType);
|
|
604
|
+
if (options.outputType) {
|
|
605
|
+
const outputType = this.mapOutputType(options.outputType);
|
|
606
|
+
args.push("--output-type", outputType);
|
|
607
|
+
}
|
|
608
|
+
if (options.nuGetSourcesConfigPath)
|
|
609
|
+
args.push("--nuget-config-file", options.nuGetSourcesConfigPath);
|
|
610
|
+
return this.executor.executeAsync("build", args, cancellationToken);
|
|
611
|
+
}
|
|
612
|
+
mapOutputType(outputType) {
|
|
613
|
+
return outputType === "WebApp" ? "Process" : outputType;
|
|
614
|
+
}
|
|
615
|
+
constructor(fileSystem, logger) {
|
|
616
|
+
super(fileSystem, logger), workflow_compiler_tool_define_property(this, "executor", undefined);
|
|
617
|
+
this.executor = new WorkflowCompilerExecutor(logger, fileSystem);
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
function workflow_compiler_tool_factory_define_property(obj, key, value) {
|
|
621
|
+
if (key in obj)
|
|
622
|
+
Object.defineProperty(obj, key, {
|
|
623
|
+
value,
|
|
624
|
+
enumerable: true,
|
|
625
|
+
configurable: true,
|
|
626
|
+
writable: true
|
|
627
|
+
});
|
|
628
|
+
else
|
|
629
|
+
obj[key] = value;
|
|
630
|
+
return obj;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
class WorkflowCompilerToolFactory {
|
|
634
|
+
async createAsync(logger, fileSystem) {
|
|
635
|
+
return new WorkflowCompilerTool(fileSystem, logger);
|
|
636
|
+
}
|
|
637
|
+
constructor() {
|
|
638
|
+
workflow_compiler_tool_factory_define_property(this, "supportedTypes", [
|
|
639
|
+
ProjectTypes.Process,
|
|
640
|
+
ProjectTypes.Library,
|
|
641
|
+
ProjectTypes.Tests,
|
|
642
|
+
ProjectTypes.WebApp
|
|
643
|
+
]);
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
toolsFactoryRepository.registerProjectToolFactory(new WorkflowCompilerToolFactory);
|