@uipath/packager-tool-workflowcompiler-browser 0.0.29 → 0.0.33
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/i18n/locales/en.d.ts +4 -2
- package/dist/index.js +84 -71
- package/dist/project-bundle-executor.d.ts +14 -6
- package/dist/workflow-compiler-tool.d.ts +4 -3
- package/package.json +5 -4
- package/src/i18n/locales/de.json +0 -2
- package/src/i18n/locales/en.ts +8 -4
- package/src/i18n/locales/es-MX.json +0 -2
- package/src/i18n/locales/es.json +0 -2
- package/src/i18n/locales/fr.json +0 -2
- package/src/i18n/locales/ja.json +0 -2
- package/src/i18n/locales/ko.json +0 -2
- package/src/i18n/locales/pt-BR.json +0 -2
- package/src/i18n/locales/pt.json +0 -2
- package/src/i18n/locales/ro.json +0 -2
- package/src/i18n/locales/ru.json +0 -2
- package/src/i18n/locales/tr.json +0 -2
- package/src/i18n/locales/zh-CN.json +0 -2
- package/src/i18n/locales/zh-TW.json +0 -2
- package/src/i18n/locales/zu.json +0 -2
- package/src/pack-result-processor.ts +1 -1
- package/src/project-bundle-executor.ts +125 -39
- package/src/workflow-compiler-tool.ts +15 -9
package/src/i18n/locales/en.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
export const en = {
|
|
7
7
|
toolWorkflowCompilerBrowser: {
|
|
8
8
|
info: {
|
|
9
|
-
|
|
10
|
-
"Starting remote
|
|
9
|
+
startingRemoteAgent:
|
|
10
|
+
"Starting remote {operation} agent for {count} project(s): {paths}",
|
|
11
11
|
connectingToHub: "Connecting to SignalR hub: {url}",
|
|
12
12
|
remoteAgentStartedExecution: "Remote agent started execution",
|
|
13
13
|
downloadingArchive:
|
|
@@ -15,6 +15,8 @@ export const en = {
|
|
|
15
15
|
extractingArchive: "Extracting archive ({size} bytes) to {path}",
|
|
16
16
|
distributingPackages:
|
|
17
17
|
"Distributing packages for {count} project(s)",
|
|
18
|
+
skippingRemoteCompilation:
|
|
19
|
+
"No connection info available — skipping remote compilation for workflow compiler projects",
|
|
18
20
|
cleaningUpTempDir: "Cleaning up temporary directory {path}",
|
|
19
21
|
deletingBucket: "Deleting temporary storage bucket {bucketId}",
|
|
20
22
|
copyingFiles:
|
|
@@ -28,8 +30,8 @@ export const en = {
|
|
|
28
30
|
"Failed to connect to SignalR hub at {url}: {message}",
|
|
29
31
|
packSucceededNoBucket:
|
|
30
32
|
"Pack succeeded but no BucketId was returned",
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
+
agentFailed:
|
|
34
|
+
"{operation} agent failed with status {status} (code {errorCode})",
|
|
33
35
|
noResultForProject: "No result for project",
|
|
34
36
|
beginSessionFailed: "BeginSession failed ({status}): {errorText}",
|
|
35
37
|
hubConnectionClosed: "Hub connection closed unexpectedly",
|
|
@@ -49,6 +51,8 @@ export const en = {
|
|
|
49
51
|
"Failed to distribute packages for {designId}: {message}",
|
|
50
52
|
sessionTimeout:
|
|
51
53
|
"Session timed out waiting for projects: received {received} of {expected} expected projects",
|
|
54
|
+
bundleOperationMismatch:
|
|
55
|
+
"Cannot mix {sessionOperation} and {entryOperation} in the same context",
|
|
52
56
|
},
|
|
53
57
|
},
|
|
54
58
|
} as const;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"toolWorkflowCompilerBrowser": {
|
|
3
3
|
"info": {
|
|
4
|
-
"startingRemotePackAgent": "Starting remote pack agent for {count} project(s): {paths}",
|
|
5
4
|
"connectingToHub": "Connecting to SignalR hub: {url}",
|
|
6
5
|
"remoteAgentStartedExecution": "Remote agent started execution",
|
|
7
6
|
"downloadingArchive": "Downloading pack result archive from bucket {bucketId}",
|
|
@@ -16,7 +15,6 @@
|
|
|
16
15
|
"signalRConnectionFailed": "Failed to connect to SignalR hub",
|
|
17
16
|
"hubConnectionFailed": "Failed to connect to SignalR hub at {url}: {message}",
|
|
18
17
|
"packSucceededNoBucket": "Pack succeeded but no BucketId was returned",
|
|
19
|
-
"packAgentFailed": "Pack agent failed with status {status} (code {errorCode})",
|
|
20
18
|
"noResultForProject": "No result for project",
|
|
21
19
|
"beginSessionFailed": "BeginSession failed ({status}): {errorText}",
|
|
22
20
|
"hubConnectionClosed": "Hub connection closed unexpectedly",
|
package/src/i18n/locales/es.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"toolWorkflowCompilerBrowser": {
|
|
3
3
|
"info": {
|
|
4
|
-
"startingRemotePackAgent": "Starting remote pack agent for {count} project(s): {paths}",
|
|
5
4
|
"connectingToHub": "Connecting to SignalR hub: {url}",
|
|
6
5
|
"remoteAgentStartedExecution": "Remote agent started execution",
|
|
7
6
|
"downloadingArchive": "Downloading pack result archive from bucket {bucketId}",
|
|
@@ -16,7 +15,6 @@
|
|
|
16
15
|
"signalRConnectionFailed": "Failed to connect to SignalR hub",
|
|
17
16
|
"hubConnectionFailed": "Failed to connect to SignalR hub at {url}: {message}",
|
|
18
17
|
"packSucceededNoBucket": "Pack succeeded but no BucketId was returned",
|
|
19
|
-
"packAgentFailed": "Pack agent failed with status {status} (code {errorCode})",
|
|
20
18
|
"noResultForProject": "No result for project",
|
|
21
19
|
"beginSessionFailed": "BeginSession failed ({status}): {errorText}",
|
|
22
20
|
"hubConnectionClosed": "Hub connection closed unexpectedly",
|
package/src/i18n/locales/fr.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"toolWorkflowCompilerBrowser": {
|
|
3
3
|
"info": {
|
|
4
|
-
"startingRemotePackAgent": "Starting remote pack agent for {count} project(s): {paths}",
|
|
5
4
|
"connectingToHub": "Connecting to SignalR hub: {url}",
|
|
6
5
|
"remoteAgentStartedExecution": "Remote agent started execution",
|
|
7
6
|
"downloadingArchive": "Downloading pack result archive from bucket {bucketId}",
|
|
@@ -16,7 +15,6 @@
|
|
|
16
15
|
"signalRConnectionFailed": "Failed to connect to SignalR hub",
|
|
17
16
|
"hubConnectionFailed": "Failed to connect to SignalR hub at {url}: {message}",
|
|
18
17
|
"packSucceededNoBucket": "Pack succeeded but no BucketId was returned",
|
|
19
|
-
"packAgentFailed": "Pack agent failed with status {status} (code {errorCode})",
|
|
20
18
|
"noResultForProject": "No result for project",
|
|
21
19
|
"beginSessionFailed": "BeginSession failed ({status}): {errorText}",
|
|
22
20
|
"hubConnectionClosed": "Hub connection closed unexpectedly",
|
package/src/i18n/locales/ja.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"toolWorkflowCompilerBrowser": {
|
|
3
3
|
"info": {
|
|
4
|
-
"startingRemotePackAgent": "Starting remote pack agent for {count} project(s): {paths}",
|
|
5
4
|
"connectingToHub": "Connecting to SignalR hub: {url}",
|
|
6
5
|
"remoteAgentStartedExecution": "Remote agent started execution",
|
|
7
6
|
"downloadingArchive": "Downloading pack result archive from bucket {bucketId}",
|
|
@@ -16,7 +15,6 @@
|
|
|
16
15
|
"signalRConnectionFailed": "Failed to connect to SignalR hub",
|
|
17
16
|
"hubConnectionFailed": "Failed to connect to SignalR hub at {url}: {message}",
|
|
18
17
|
"packSucceededNoBucket": "Pack succeeded but no BucketId was returned",
|
|
19
|
-
"packAgentFailed": "Pack agent failed with status {status} (code {errorCode})",
|
|
20
18
|
"noResultForProject": "No result for project",
|
|
21
19
|
"beginSessionFailed": "BeginSession failed ({status}): {errorText}",
|
|
22
20
|
"hubConnectionClosed": "Hub connection closed unexpectedly",
|
package/src/i18n/locales/ko.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"toolWorkflowCompilerBrowser": {
|
|
3
3
|
"info": {
|
|
4
|
-
"startingRemotePackAgent": "Starting remote pack agent for {count} project(s): {paths}",
|
|
5
4
|
"connectingToHub": "Connecting to SignalR hub: {url}",
|
|
6
5
|
"remoteAgentStartedExecution": "Remote agent started execution",
|
|
7
6
|
"downloadingArchive": "Downloading pack result archive from bucket {bucketId}",
|
|
@@ -16,7 +15,6 @@
|
|
|
16
15
|
"signalRConnectionFailed": "Failed to connect to SignalR hub",
|
|
17
16
|
"hubConnectionFailed": "Failed to connect to SignalR hub at {url}: {message}",
|
|
18
17
|
"packSucceededNoBucket": "Pack succeeded but no BucketId was returned",
|
|
19
|
-
"packAgentFailed": "Pack agent failed with status {status} (code {errorCode})",
|
|
20
18
|
"noResultForProject": "No result for project",
|
|
21
19
|
"beginSessionFailed": "BeginSession failed ({status}): {errorText}",
|
|
22
20
|
"hubConnectionClosed": "Hub connection closed unexpectedly",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"toolWorkflowCompilerBrowser": {
|
|
3
3
|
"info": {
|
|
4
|
-
"startingRemotePackAgent": "Starting remote pack agent for {count} project(s): {paths}",
|
|
5
4
|
"connectingToHub": "Connecting to SignalR hub: {url}",
|
|
6
5
|
"remoteAgentStartedExecution": "Remote agent started execution",
|
|
7
6
|
"downloadingArchive": "Downloading pack result archive from bucket {bucketId}",
|
|
@@ -16,7 +15,6 @@
|
|
|
16
15
|
"signalRConnectionFailed": "Failed to connect to SignalR hub",
|
|
17
16
|
"hubConnectionFailed": "Failed to connect to SignalR hub at {url}: {message}",
|
|
18
17
|
"packSucceededNoBucket": "Pack succeeded but no BucketId was returned",
|
|
19
|
-
"packAgentFailed": "Pack agent failed with status {status} (code {errorCode})",
|
|
20
18
|
"noResultForProject": "No result for project",
|
|
21
19
|
"beginSessionFailed": "BeginSession failed ({status}): {errorText}",
|
|
22
20
|
"hubConnectionClosed": "Hub connection closed unexpectedly",
|
package/src/i18n/locales/pt.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"toolWorkflowCompilerBrowser": {
|
|
3
3
|
"info": {
|
|
4
|
-
"startingRemotePackAgent": "Starting remote pack agent for {count} project(s): {paths}",
|
|
5
4
|
"connectingToHub": "Connecting to SignalR hub: {url}",
|
|
6
5
|
"remoteAgentStartedExecution": "Remote agent started execution",
|
|
7
6
|
"downloadingArchive": "Downloading pack result archive from bucket {bucketId}",
|
|
@@ -16,7 +15,6 @@
|
|
|
16
15
|
"signalRConnectionFailed": "Failed to connect to SignalR hub",
|
|
17
16
|
"hubConnectionFailed": "Failed to connect to SignalR hub at {url}: {message}",
|
|
18
17
|
"packSucceededNoBucket": "Pack succeeded but no BucketId was returned",
|
|
19
|
-
"packAgentFailed": "Pack agent failed with status {status} (code {errorCode})",
|
|
20
18
|
"noResultForProject": "No result for project",
|
|
21
19
|
"beginSessionFailed": "BeginSession failed ({status}): {errorText}",
|
|
22
20
|
"hubConnectionClosed": "Hub connection closed unexpectedly",
|
package/src/i18n/locales/ro.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"toolWorkflowCompilerBrowser": {
|
|
3
3
|
"info": {
|
|
4
|
-
"startingRemotePackAgent": "Starting remote pack agent for {count} project(s): {paths}",
|
|
5
4
|
"connectingToHub": "Connecting to SignalR hub: {url}",
|
|
6
5
|
"remoteAgentStartedExecution": "Remote agent started execution",
|
|
7
6
|
"downloadingArchive": "Downloading pack result archive from bucket {bucketId}",
|
|
@@ -16,7 +15,6 @@
|
|
|
16
15
|
"signalRConnectionFailed": "Failed to connect to SignalR hub",
|
|
17
16
|
"hubConnectionFailed": "Failed to connect to SignalR hub at {url}: {message}",
|
|
18
17
|
"packSucceededNoBucket": "Pack succeeded but no BucketId was returned",
|
|
19
|
-
"packAgentFailed": "Pack agent failed with status {status} (code {errorCode})",
|
|
20
18
|
"noResultForProject": "No result for project",
|
|
21
19
|
"beginSessionFailed": "BeginSession failed ({status}): {errorText}",
|
|
22
20
|
"hubConnectionClosed": "Hub connection closed unexpectedly",
|
package/src/i18n/locales/ru.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"toolWorkflowCompilerBrowser": {
|
|
3
3
|
"info": {
|
|
4
|
-
"startingRemotePackAgent": "Starting remote pack agent for {count} project(s): {paths}",
|
|
5
4
|
"connectingToHub": "Connecting to SignalR hub: {url}",
|
|
6
5
|
"remoteAgentStartedExecution": "Remote agent started execution",
|
|
7
6
|
"downloadingArchive": "Downloading pack result archive from bucket {bucketId}",
|
|
@@ -16,7 +15,6 @@
|
|
|
16
15
|
"signalRConnectionFailed": "Failed to connect to SignalR hub",
|
|
17
16
|
"hubConnectionFailed": "Failed to connect to SignalR hub at {url}: {message}",
|
|
18
17
|
"packSucceededNoBucket": "Pack succeeded but no BucketId was returned",
|
|
19
|
-
"packAgentFailed": "Pack agent failed with status {status} (code {errorCode})",
|
|
20
18
|
"noResultForProject": "No result for project",
|
|
21
19
|
"beginSessionFailed": "BeginSession failed ({status}): {errorText}",
|
|
22
20
|
"hubConnectionClosed": "Hub connection closed unexpectedly",
|
package/src/i18n/locales/tr.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"toolWorkflowCompilerBrowser": {
|
|
3
3
|
"info": {
|
|
4
|
-
"startingRemotePackAgent": "Starting remote pack agent for {count} project(s): {paths}",
|
|
5
4
|
"connectingToHub": "Connecting to SignalR hub: {url}",
|
|
6
5
|
"remoteAgentStartedExecution": "Remote agent started execution",
|
|
7
6
|
"downloadingArchive": "Downloading pack result archive from bucket {bucketId}",
|
|
@@ -16,7 +15,6 @@
|
|
|
16
15
|
"signalRConnectionFailed": "Failed to connect to SignalR hub",
|
|
17
16
|
"hubConnectionFailed": "Failed to connect to SignalR hub at {url}: {message}",
|
|
18
17
|
"packSucceededNoBucket": "Pack succeeded but no BucketId was returned",
|
|
19
|
-
"packAgentFailed": "Pack agent failed with status {status} (code {errorCode})",
|
|
20
18
|
"noResultForProject": "No result for project",
|
|
21
19
|
"beginSessionFailed": "BeginSession failed ({status}): {errorText}",
|
|
22
20
|
"hubConnectionClosed": "Hub connection closed unexpectedly",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"toolWorkflowCompilerBrowser": {
|
|
3
3
|
"info": {
|
|
4
|
-
"startingRemotePackAgent": "Starting remote pack agent for {count} project(s): {paths}",
|
|
5
4
|
"connectingToHub": "Connecting to SignalR hub: {url}",
|
|
6
5
|
"remoteAgentStartedExecution": "Remote agent started execution",
|
|
7
6
|
"downloadingArchive": "Downloading pack result archive from bucket {bucketId}",
|
|
@@ -16,7 +15,6 @@
|
|
|
16
15
|
"signalRConnectionFailed": "Failed to connect to SignalR hub",
|
|
17
16
|
"hubConnectionFailed": "Failed to connect to SignalR hub at {url}: {message}",
|
|
18
17
|
"packSucceededNoBucket": "Pack succeeded but no BucketId was returned",
|
|
19
|
-
"packAgentFailed": "Pack agent failed with status {status} (code {errorCode})",
|
|
20
18
|
"noResultForProject": "No result for project",
|
|
21
19
|
"beginSessionFailed": "BeginSession failed ({status}): {errorText}",
|
|
22
20
|
"hubConnectionClosed": "Hub connection closed unexpectedly",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"toolWorkflowCompilerBrowser": {
|
|
3
3
|
"info": {
|
|
4
|
-
"startingRemotePackAgent": "Starting remote pack agent for {count} project(s): {paths}",
|
|
5
4
|
"connectingToHub": "Connecting to SignalR hub: {url}",
|
|
6
5
|
"remoteAgentStartedExecution": "Remote agent started execution",
|
|
7
6
|
"downloadingArchive": "Downloading pack result archive from bucket {bucketId}",
|
|
@@ -16,7 +15,6 @@
|
|
|
16
15
|
"signalRConnectionFailed": "Failed to connect to SignalR hub",
|
|
17
16
|
"hubConnectionFailed": "Failed to connect to SignalR hub at {url}: {message}",
|
|
18
17
|
"packSucceededNoBucket": "Pack succeeded but no BucketId was returned",
|
|
19
|
-
"packAgentFailed": "Pack agent failed with status {status} (code {errorCode})",
|
|
20
18
|
"noResultForProject": "No result for project",
|
|
21
19
|
"beginSessionFailed": "BeginSession failed ({status}): {errorText}",
|
|
22
20
|
"hubConnectionClosed": "Hub connection closed unexpectedly",
|
package/src/i18n/locales/zu.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"toolWorkflowCompilerBrowser": {
|
|
3
3
|
"info": {
|
|
4
|
-
"startingRemotePackAgent": "Starting remote pack agent for {count} project(s): {paths}",
|
|
5
4
|
"connectingToHub": "Connecting to SignalR hub: {url}",
|
|
6
5
|
"remoteAgentStartedExecution": "Remote agent started execution",
|
|
7
6
|
"downloadingArchive": "Downloading pack result archive from bucket {bucketId}",
|
|
@@ -16,7 +15,6 @@
|
|
|
16
15
|
"signalRConnectionFailed": "Failed to connect to SignalR hub",
|
|
17
16
|
"hubConnectionFailed": "Failed to connect to SignalR hub at {url}: {message}",
|
|
18
17
|
"packSucceededNoBucket": "Pack succeeded but no BucketId was returned",
|
|
19
|
-
"packAgentFailed": "Pack agent failed with status {status} (code {errorCode})",
|
|
20
18
|
"noResultForProject": "No result for project",
|
|
21
19
|
"beginSessionFailed": "BeginSession failed ({status}): {errorText}",
|
|
22
20
|
"hubConnectionClosed": "Hub connection closed unexpectedly",
|
|
@@ -219,7 +219,7 @@ export class PackResultProcessor {
|
|
|
219
219
|
results: Map<string, ToolResult>,
|
|
220
220
|
): Promise<void> {
|
|
221
221
|
for (const [projectPath, entry] of projects) {
|
|
222
|
-
const project = context.
|
|
222
|
+
const project = context.projects.find(
|
|
223
223
|
(p) => p.ProjectPath === projectPath,
|
|
224
224
|
);
|
|
225
225
|
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
type IFileSystem,
|
|
4
4
|
type IProjectPackOptions,
|
|
5
5
|
type IProjectToolFactory,
|
|
6
|
+
type IProjectValidateOptions,
|
|
6
7
|
type IToolLogger,
|
|
7
8
|
type ProjectOperationContext,
|
|
8
9
|
ToolResult,
|
|
@@ -18,12 +19,27 @@ import {
|
|
|
18
19
|
|
|
19
20
|
type ResolveCallback = (result: ToolResult) => void;
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
export enum BundleOperation {
|
|
23
|
+
Pack = "Pack",
|
|
24
|
+
Validate = "Validate",
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface PackEntry {
|
|
28
|
+
operation: BundleOperation.Pack;
|
|
22
29
|
options: IProjectPackOptions;
|
|
23
30
|
resolve: ResolveCallback;
|
|
24
31
|
}
|
|
25
32
|
|
|
33
|
+
interface ValidateEntry {
|
|
34
|
+
operation: BundleOperation.Validate;
|
|
35
|
+
options: IProjectValidateOptions;
|
|
36
|
+
resolve: ResolveCallback;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
type ProjectEntry = PackEntry | ValidateEntry;
|
|
40
|
+
|
|
26
41
|
interface BundleSession {
|
|
42
|
+
operation: BundleOperation;
|
|
27
43
|
expectedCount: number;
|
|
28
44
|
projects: Map<string, ProjectEntry>;
|
|
29
45
|
timeout?: ReturnType<typeof setTimeout>;
|
|
@@ -34,12 +50,17 @@ export interface IProjectBundleExecutor {
|
|
|
34
50
|
options: IProjectPackOptions,
|
|
35
51
|
context: ProjectOperationContext,
|
|
36
52
|
): Promise<ToolResult>;
|
|
53
|
+
|
|
54
|
+
validateAsync(
|
|
55
|
+
options: IProjectValidateOptions,
|
|
56
|
+
context: ProjectOperationContext,
|
|
57
|
+
): Promise<ToolResult>;
|
|
37
58
|
}
|
|
38
59
|
|
|
39
60
|
/**
|
|
40
|
-
* Coordinates
|
|
41
|
-
* Waits until all compatible projects have submitted their
|
|
42
|
-
* then executes a single bundled operation and resolves all pending promises.
|
|
61
|
+
* Coordinates pack or validate of multiple projects within a single operation context.
|
|
62
|
+
* Waits until all compatible projects have submitted their options,
|
|
63
|
+
* then executes a single bundled remote-agent operation and resolves all pending promises.
|
|
43
64
|
*/
|
|
44
65
|
export class ProjectBundleExecutor implements IProjectBundleExecutor {
|
|
45
66
|
static readonly SESSION_TIMEOUT_MS = 1_800_000;
|
|
@@ -59,25 +80,59 @@ export class ProjectBundleExecutor implements IProjectBundleExecutor {
|
|
|
59
80
|
options: IProjectPackOptions,
|
|
60
81
|
context: ProjectOperationContext,
|
|
61
82
|
): Promise<ToolResult> {
|
|
62
|
-
|
|
83
|
+
return this.enqueueAsync(context, {
|
|
84
|
+
operation: BundleOperation.Pack,
|
|
85
|
+
options,
|
|
86
|
+
resolve: () => {},
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
async validateAsync(
|
|
91
|
+
options: IProjectValidateOptions,
|
|
92
|
+
context: ProjectOperationContext,
|
|
93
|
+
): Promise<ToolResult> {
|
|
94
|
+
return this.enqueueAsync(context, {
|
|
95
|
+
operation: BundleOperation.Validate,
|
|
96
|
+
options,
|
|
97
|
+
resolve: () => {},
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
private async enqueueAsync(
|
|
102
|
+
context: ProjectOperationContext,
|
|
103
|
+
entry: ProjectEntry,
|
|
104
|
+
): Promise<ToolResult> {
|
|
105
|
+
const projectPath = entry.options.projectPath;
|
|
63
106
|
context.logger?.info(
|
|
64
|
-
`[BundleExecutor]
|
|
107
|
+
`[BundleExecutor] ${entry.operation}Async called for project: ${projectPath}`,
|
|
65
108
|
);
|
|
66
|
-
const session = await this.getSessionAsync(context);
|
|
109
|
+
const session = await this.getSessionAsync(context, entry.operation);
|
|
67
110
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
111
|
+
if (session.operation !== entry.operation) {
|
|
112
|
+
return ToolResult.error(
|
|
113
|
+
"BundleOperationMismatch",
|
|
114
|
+
translate.t(
|
|
115
|
+
"toolWorkflowCompilerBrowser.errors.bundleOperationMismatch",
|
|
116
|
+
{
|
|
117
|
+
sessionOperation: session.operation,
|
|
118
|
+
entryOperation: entry.operation,
|
|
119
|
+
},
|
|
120
|
+
),
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const promise = new Promise<ToolResult>((resolve) => {
|
|
125
|
+
entry.resolve = resolve;
|
|
71
126
|
});
|
|
72
|
-
session.projects.set(projectPath,
|
|
127
|
+
session.projects.set(projectPath, entry);
|
|
73
128
|
const allReceived = session.projects.size === session.expectedCount;
|
|
74
129
|
context.logger?.info(
|
|
75
|
-
`[BundleExecutor] session: ${session.projects.size}/${session.expectedCount} projects received. allReceived=${allReceived}`,
|
|
130
|
+
`[BundleExecutor] session (${session.operation}): ${session.projects.size}/${session.expectedCount} projects received. allReceived=${allReceived}`,
|
|
76
131
|
);
|
|
77
132
|
|
|
78
133
|
if (allReceived) {
|
|
79
134
|
clearTimeout(session.timeout);
|
|
80
|
-
await this.
|
|
135
|
+
await this.runAgentAsync(session, context);
|
|
81
136
|
this.sessions.delete(context.id);
|
|
82
137
|
}
|
|
83
138
|
|
|
@@ -86,6 +141,7 @@ export class ProjectBundleExecutor implements IProjectBundleExecutor {
|
|
|
86
141
|
|
|
87
142
|
private getSessionAsync(
|
|
88
143
|
context: ProjectOperationContext,
|
|
144
|
+
operation: BundleOperation,
|
|
89
145
|
): Promise<BundleSession> {
|
|
90
146
|
const existing = this.sessions.get(context.id);
|
|
91
147
|
if (existing) {
|
|
@@ -94,7 +150,7 @@ export class ProjectBundleExecutor implements IProjectBundleExecutor {
|
|
|
94
150
|
|
|
95
151
|
let pending = this.pendingSessionCreations.get(context.id);
|
|
96
152
|
if (!pending) {
|
|
97
|
-
pending = this.createSessionAsync(context);
|
|
153
|
+
pending = this.createSessionAsync(context, operation);
|
|
98
154
|
this.pendingSessionCreations.set(context.id, pending);
|
|
99
155
|
}
|
|
100
156
|
return pending;
|
|
@@ -102,9 +158,11 @@ export class ProjectBundleExecutor implements IProjectBundleExecutor {
|
|
|
102
158
|
|
|
103
159
|
private async createSessionAsync(
|
|
104
160
|
context: ProjectOperationContext,
|
|
161
|
+
operation: BundleOperation,
|
|
105
162
|
): Promise<BundleSession> {
|
|
106
163
|
const expectedCount = this.countCompatibleProjects(context);
|
|
107
164
|
const session: BundleSession = {
|
|
165
|
+
operation,
|
|
108
166
|
expectedCount,
|
|
109
167
|
projects: new Map(),
|
|
110
168
|
};
|
|
@@ -135,15 +193,16 @@ export class ProjectBundleExecutor implements IProjectBundleExecutor {
|
|
|
135
193
|
return session;
|
|
136
194
|
}
|
|
137
195
|
|
|
138
|
-
private async
|
|
196
|
+
private async runAgentAsync(
|
|
139
197
|
session: BundleSession,
|
|
140
198
|
context: ProjectOperationContext,
|
|
141
199
|
): Promise<void> {
|
|
142
200
|
const projectPaths = [...session.projects.keys()];
|
|
143
201
|
context.logger?.info(
|
|
144
202
|
translate.t(
|
|
145
|
-
"toolWorkflowCompilerBrowser.info.
|
|
203
|
+
"toolWorkflowCompilerBrowser.info.startingRemoteAgent",
|
|
146
204
|
{
|
|
205
|
+
operation: session.operation,
|
|
147
206
|
count: session.expectedCount,
|
|
148
207
|
paths: projectPaths.join(", "),
|
|
149
208
|
},
|
|
@@ -205,16 +264,16 @@ export class ProjectBundleExecutor implements IProjectBundleExecutor {
|
|
|
205
264
|
context.logger?.info(
|
|
206
265
|
`[BundleExecutor] Got result: errorCode=${result.errorCode}, status=${result.status}, message=${result.message}, bucketId=${result.bucketId}`,
|
|
207
266
|
);
|
|
208
|
-
await this.
|
|
267
|
+
await this.handleAgentResultAsync(result, session, context);
|
|
209
268
|
} catch (error) {
|
|
210
269
|
const message =
|
|
211
270
|
error instanceof Error ? error.message : String(error);
|
|
212
271
|
context.logger?.error(
|
|
213
|
-
`[BundleExecutor]
|
|
272
|
+
`[BundleExecutor] runAgentAsync caught error: ${message}`,
|
|
214
273
|
);
|
|
215
274
|
this.resolveAll(
|
|
216
275
|
session,
|
|
217
|
-
ToolResult.error(
|
|
276
|
+
ToolResult.error(`${session.operation}AgentError`, message),
|
|
218
277
|
);
|
|
219
278
|
} finally {
|
|
220
279
|
await hubConnection.disconnectAsync();
|
|
@@ -251,7 +310,7 @@ export class ProjectBundleExecutor implements IProjectBundleExecutor {
|
|
|
251
310
|
}
|
|
252
311
|
}
|
|
253
312
|
|
|
254
|
-
private async
|
|
313
|
+
private async handleAgentResultAsync(
|
|
255
314
|
result: PackAgentResult,
|
|
256
315
|
session: BundleSession,
|
|
257
316
|
context: ProjectOperationContext,
|
|
@@ -263,11 +322,12 @@ export class ProjectBundleExecutor implements IProjectBundleExecutor {
|
|
|
263
322
|
this.resolveAll(
|
|
264
323
|
session,
|
|
265
324
|
ToolResult.error(
|
|
266
|
-
|
|
325
|
+
`${session.operation}AgentError`,
|
|
267
326
|
result.message ??
|
|
268
327
|
translate.t(
|
|
269
|
-
"toolWorkflowCompilerBrowser.errors.
|
|
328
|
+
"toolWorkflowCompilerBrowser.errors.agentFailed",
|
|
270
329
|
{
|
|
330
|
+
operation: session.operation,
|
|
271
331
|
status: result.status,
|
|
272
332
|
errorCode: result.errorCode,
|
|
273
333
|
},
|
|
@@ -277,6 +337,19 @@ export class ProjectBundleExecutor implements IProjectBundleExecutor {
|
|
|
277
337
|
return;
|
|
278
338
|
}
|
|
279
339
|
|
|
340
|
+
if (session.operation === BundleOperation.Pack) {
|
|
341
|
+
await this.handlePackBucketAsync(result, session, context);
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
this.resolveAll(session, ToolResult.success());
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
private async handlePackBucketAsync(
|
|
349
|
+
result: PackAgentResult,
|
|
350
|
+
session: BundleSession,
|
|
351
|
+
context: ProjectOperationContext,
|
|
352
|
+
): Promise<void> {
|
|
280
353
|
if (result.bucketId == null) {
|
|
281
354
|
this.resolveAll(
|
|
282
355
|
session,
|
|
@@ -290,13 +363,20 @@ export class ProjectBundleExecutor implements IProjectBundleExecutor {
|
|
|
290
363
|
return;
|
|
291
364
|
}
|
|
292
365
|
|
|
366
|
+
const packEntries = new Map<string, { options: IProjectPackOptions }>();
|
|
367
|
+
for (const [projectPath, entry] of session.projects) {
|
|
368
|
+
if (entry.operation === BundleOperation.Pack) {
|
|
369
|
+
packEntries.set(projectPath, { options: entry.options });
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
293
373
|
const resultProcessor = new PackResultProcessor(
|
|
294
374
|
this.fileSystem,
|
|
295
375
|
context.logger,
|
|
296
376
|
);
|
|
297
377
|
const perProjectResults = await resultProcessor.processAsync(
|
|
298
378
|
result.bucketId,
|
|
299
|
-
|
|
379
|
+
packEntries,
|
|
300
380
|
context,
|
|
301
381
|
);
|
|
302
382
|
for (const [projectPath, entry] of session.projects) {
|
|
@@ -321,54 +401,60 @@ export class ProjectBundleExecutor implements IProjectBundleExecutor {
|
|
|
321
401
|
): Promise<void> {
|
|
322
402
|
const relativeBase = toRelativeUrl(connection.cloudUrl!);
|
|
323
403
|
const url = `${relativeBase}/orchestrator_/api/serverless/jobs`;
|
|
404
|
+
//const url = `${relativeBase}/orchestrator_/api/RobotDebug/BeginSession`;
|
|
405
|
+
|
|
324
406
|
context.logger?.info(`[BundleExecutor] BeginSession URL: ${url}`);
|
|
325
407
|
|
|
326
|
-
// Use the first entry for shared fields (package info, options)
|
|
327
408
|
const firstEntry = session.projects.values().next().value!;
|
|
328
|
-
const pkg = firstEntry.options.package;
|
|
329
409
|
const opts = firstEntry.options;
|
|
330
410
|
|
|
331
|
-
// Build RpaProjects from all projects in the session
|
|
332
411
|
const rpaProjects = [...session.projects.entries()].map(
|
|
333
412
|
([projectPath, entry]) => {
|
|
334
|
-
const project = context.
|
|
413
|
+
const project = context.projects.find(
|
|
335
414
|
(p) => p.ProjectPath === projectPath,
|
|
336
415
|
);
|
|
337
416
|
return {
|
|
338
417
|
RelativePath: project?.ProjectRelativePath ?? "",
|
|
339
418
|
DesignId: project?.Id ?? "",
|
|
340
|
-
PackageId:
|
|
419
|
+
PackageId:
|
|
420
|
+
entry.operation === BundleOperation.Pack
|
|
421
|
+
? entry.options.package.id
|
|
422
|
+
: "",
|
|
341
423
|
};
|
|
342
424
|
},
|
|
343
425
|
);
|
|
344
426
|
|
|
345
|
-
const executorInfo =
|
|
346
|
-
Command:
|
|
427
|
+
const executorInfo: Record<string, unknown> = {
|
|
428
|
+
Command: session.operation,
|
|
347
429
|
SupportedProtocolVersions: ["2.0"],
|
|
348
|
-
ProjectId: "",
|
|
349
430
|
DownloadUrl: context.downloadUrl ?? "",
|
|
350
431
|
SessionId: sessionId,
|
|
351
432
|
ProfileKey: "StudioWeb",
|
|
352
433
|
LicenseType: "Development",
|
|
353
434
|
LogLevel: opts.logLevel ?? "Warning",
|
|
354
|
-
Name: pkg.id,
|
|
355
|
-
Configuration: context.configuration,
|
|
356
435
|
Culture: "en-US",
|
|
357
|
-
|
|
358
|
-
Author: pkg.author ?? "",
|
|
359
|
-
Description: pkg.description ?? "",
|
|
436
|
+
DownloadTimeoutInSeconds: 300,
|
|
360
437
|
SkipAnalyze: String(opts.skipAnalyze),
|
|
361
438
|
SkipValidate: String(opts.skipValidate),
|
|
362
439
|
TargetFramework: context.targetFramework,
|
|
363
440
|
RpaProjects: rpaProjects,
|
|
364
441
|
WorkflowCompilerVersion: context.workflowCompilerVersion ?? "",
|
|
365
|
-
}
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
if (firstEntry.operation === BundleOperation.Pack) {
|
|
445
|
+
executorInfo.Configuration = context.configuration;
|
|
446
|
+
const pkg = firstEntry.options.package;
|
|
447
|
+
executorInfo.Name = pkg.id;
|
|
448
|
+
executorInfo.Version = pkg.version;
|
|
449
|
+
executorInfo.Author = pkg.author ?? "";
|
|
450
|
+
executorInfo.Description = pkg.description ?? "";
|
|
451
|
+
}
|
|
366
452
|
|
|
367
453
|
const body = {
|
|
368
454
|
source: "StudioWeb",
|
|
369
455
|
targetFramework: context.targetFramework,
|
|
370
456
|
jobType: "PublishStudioProject",
|
|
371
|
-
inputArguments: executorInfo,
|
|
457
|
+
inputArguments: JSON.stringify(executorInfo),
|
|
372
458
|
};
|
|
373
459
|
|
|
374
460
|
const headers: Record<string, string> = {
|
|
@@ -405,7 +491,7 @@ export class ProjectBundleExecutor implements IProjectBundleExecutor {
|
|
|
405
491
|
}
|
|
406
492
|
|
|
407
493
|
private countCompatibleProjects(context: ProjectOperationContext): number {
|
|
408
|
-
return context.
|
|
494
|
+
return context.projects.filter(
|
|
409
495
|
(p) =>
|
|
410
496
|
p.ProjectPath != null &&
|
|
411
497
|
this.toolFactory.supportedTypes.includes(p.Type),
|