@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.
@@ -5,12 +5,13 @@
5
5
  export declare const en: {
6
6
  readonly toolWorkflowCompilerBrowser: {
7
7
  readonly info: {
8
- readonly startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}";
8
+ readonly startingRemoteAgent: "Starting remote {operation} agent for {count} project(s): {paths}";
9
9
  readonly connectingToHub: "Connecting to SignalR hub: {url}";
10
10
  readonly remoteAgentStartedExecution: "Remote agent started execution";
11
11
  readonly downloadingArchive: "Downloading pack result archive from bucket {bucketId}";
12
12
  readonly extractingArchive: "Extracting archive ({size} bytes) to {path}";
13
13
  readonly distributingPackages: "Distributing packages for {count} project(s)";
14
+ readonly skippingRemoteCompilation: "No connection info available — skipping remote compilation for workflow compiler projects";
14
15
  readonly cleaningUpTempDir: "Cleaning up temporary directory {path}";
15
16
  readonly deletingBucket: "Deleting temporary storage bucket {bucketId}";
16
17
  readonly copyingFiles: "Copying {count} file(s) for project {designId} to {path}";
@@ -20,7 +21,7 @@ export declare const en: {
20
21
  readonly signalRConnectionFailed: "Failed to connect to SignalR hub";
21
22
  readonly hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}";
22
23
  readonly packSucceededNoBucket: "Pack succeeded but no BucketId was returned";
23
- readonly packAgentFailed: "Pack agent failed with status {status} (code {errorCode})";
24
+ readonly agentFailed: "{operation} agent failed with status {status} (code {errorCode})";
24
25
  readonly noResultForProject: "No result for project";
25
26
  readonly beginSessionFailed: "BeginSession failed ({status}): {errorText}";
26
27
  readonly hubConnectionClosed: "Hub connection closed unexpectedly";
@@ -33,6 +34,7 @@ export declare const en: {
33
34
  readonly noOutputForProject: "No output found for project {designId}";
34
35
  readonly distributePackagesFailed: "Failed to distribute packages for {designId}: {message}";
35
36
  readonly sessionTimeout: "Session timed out waiting for projects: received {received} of {expected} expected projects";
37
+ readonly bundleOperationMismatch: "Cannot mix {sessionOperation} and {entryOperation} in the same context";
36
38
  };
37
39
  };
38
40
  };
package/dist/index.js CHANGED
@@ -7,7 +7,6 @@ import { I18nManager } from "@uipath/solutionpackager-tool-core";
7
7
  var de_default = {
8
8
  toolWorkflowCompilerBrowser: {
9
9
  info: {
10
- startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
11
10
  connectingToHub: "Connecting to SignalR hub: {url}",
12
11
  remoteAgentStartedExecution: "Remote agent started execution",
13
12
  downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
@@ -22,7 +21,6 @@ var de_default = {
22
21
  signalRConnectionFailed: "Failed to connect to SignalR hub",
23
22
  hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
24
23
  packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
25
- packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
26
24
  noResultForProject: "No result for project",
27
25
  beginSessionFailed: "BeginSession failed ({status}): {errorText}",
28
26
  hubConnectionClosed: "Hub connection closed unexpectedly",
@@ -43,12 +41,13 @@ var de_default = {
43
41
  var en = {
44
42
  toolWorkflowCompilerBrowser: {
45
43
  info: {
46
- startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
44
+ startingRemoteAgent: "Starting remote {operation} agent for {count} project(s): {paths}",
47
45
  connectingToHub: "Connecting to SignalR hub: {url}",
48
46
  remoteAgentStartedExecution: "Remote agent started execution",
49
47
  downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
50
48
  extractingArchive: "Extracting archive ({size} bytes) to {path}",
51
49
  distributingPackages: "Distributing packages for {count} project(s)",
50
+ skippingRemoteCompilation: "No connection info available — skipping remote compilation for workflow compiler projects",
52
51
  cleaningUpTempDir: "Cleaning up temporary directory {path}",
53
52
  deletingBucket: "Deleting temporary storage bucket {bucketId}",
54
53
  copyingFiles: "Copying {count} file(s) for project {designId} to {path}"
@@ -58,7 +57,7 @@ var en = {
58
57
  signalRConnectionFailed: "Failed to connect to SignalR hub",
59
58
  hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
60
59
  packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
61
- packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
60
+ agentFailed: "{operation} agent failed with status {status} (code {errorCode})",
62
61
  noResultForProject: "No result for project",
63
62
  beginSessionFailed: "BeginSession failed ({status}): {errorText}",
64
63
  hubConnectionClosed: "Hub connection closed unexpectedly",
@@ -70,7 +69,8 @@ var en = {
70
69
  noMatchingProject: "No matching project found for path: {projectPath}",
71
70
  noOutputForProject: "No output found for project {designId}",
72
71
  distributePackagesFailed: "Failed to distribute packages for {designId}: {message}",
73
- sessionTimeout: "Session timed out waiting for projects: received {received} of {expected} expected projects"
72
+ sessionTimeout: "Session timed out waiting for projects: received {received} of {expected} expected projects",
73
+ bundleOperationMismatch: "Cannot mix {sessionOperation} and {entryOperation} in the same context"
74
74
  }
75
75
  }
76
76
  };
@@ -78,7 +78,6 @@ var en = {
78
78
  var es_default = {
79
79
  toolWorkflowCompilerBrowser: {
80
80
  info: {
81
- startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
82
81
  connectingToHub: "Connecting to SignalR hub: {url}",
83
82
  remoteAgentStartedExecution: "Remote agent started execution",
84
83
  downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
@@ -93,7 +92,6 @@ var es_default = {
93
92
  signalRConnectionFailed: "Failed to connect to SignalR hub",
94
93
  hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
95
94
  packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
96
- packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
97
95
  noResultForProject: "No result for project",
98
96
  beginSessionFailed: "BeginSession failed ({status}): {errorText}",
99
97
  hubConnectionClosed: "Hub connection closed unexpectedly",
@@ -113,7 +111,6 @@ var es_default = {
113
111
  var es_MX_default = {
114
112
  toolWorkflowCompilerBrowser: {
115
113
  info: {
116
- startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
117
114
  connectingToHub: "Connecting to SignalR hub: {url}",
118
115
  remoteAgentStartedExecution: "Remote agent started execution",
119
116
  downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
@@ -128,7 +125,6 @@ var es_MX_default = {
128
125
  signalRConnectionFailed: "Failed to connect to SignalR hub",
129
126
  hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
130
127
  packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
131
- packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
132
128
  noResultForProject: "No result for project",
133
129
  beginSessionFailed: "BeginSession failed ({status}): {errorText}",
134
130
  hubConnectionClosed: "Hub connection closed unexpectedly",
@@ -148,7 +144,6 @@ var es_MX_default = {
148
144
  var fr_default = {
149
145
  toolWorkflowCompilerBrowser: {
150
146
  info: {
151
- startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
152
147
  connectingToHub: "Connecting to SignalR hub: {url}",
153
148
  remoteAgentStartedExecution: "Remote agent started execution",
154
149
  downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
@@ -163,7 +158,6 @@ var fr_default = {
163
158
  signalRConnectionFailed: "Failed to connect to SignalR hub",
164
159
  hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
165
160
  packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
166
- packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
167
161
  noResultForProject: "No result for project",
168
162
  beginSessionFailed: "BeginSession failed ({status}): {errorText}",
169
163
  hubConnectionClosed: "Hub connection closed unexpectedly",
@@ -183,7 +177,6 @@ var fr_default = {
183
177
  var ja_default = {
184
178
  toolWorkflowCompilerBrowser: {
185
179
  info: {
186
- startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
187
180
  connectingToHub: "Connecting to SignalR hub: {url}",
188
181
  remoteAgentStartedExecution: "Remote agent started execution",
189
182
  downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
@@ -198,7 +191,6 @@ var ja_default = {
198
191
  signalRConnectionFailed: "Failed to connect to SignalR hub",
199
192
  hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
200
193
  packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
201
- packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
202
194
  noResultForProject: "No result for project",
203
195
  beginSessionFailed: "BeginSession failed ({status}): {errorText}",
204
196
  hubConnectionClosed: "Hub connection closed unexpectedly",
@@ -218,7 +210,6 @@ var ja_default = {
218
210
  var ko_default = {
219
211
  toolWorkflowCompilerBrowser: {
220
212
  info: {
221
- startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
222
213
  connectingToHub: "Connecting to SignalR hub: {url}",
223
214
  remoteAgentStartedExecution: "Remote agent started execution",
224
215
  downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
@@ -233,7 +224,6 @@ var ko_default = {
233
224
  signalRConnectionFailed: "Failed to connect to SignalR hub",
234
225
  hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
235
226
  packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
236
- packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
237
227
  noResultForProject: "No result for project",
238
228
  beginSessionFailed: "BeginSession failed ({status}): {errorText}",
239
229
  hubConnectionClosed: "Hub connection closed unexpectedly",
@@ -253,7 +243,6 @@ var ko_default = {
253
243
  var pt_default = {
254
244
  toolWorkflowCompilerBrowser: {
255
245
  info: {
256
- startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
257
246
  connectingToHub: "Connecting to SignalR hub: {url}",
258
247
  remoteAgentStartedExecution: "Remote agent started execution",
259
248
  downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
@@ -268,7 +257,6 @@ var pt_default = {
268
257
  signalRConnectionFailed: "Failed to connect to SignalR hub",
269
258
  hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
270
259
  packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
271
- packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
272
260
  noResultForProject: "No result for project",
273
261
  beginSessionFailed: "BeginSession failed ({status}): {errorText}",
274
262
  hubConnectionClosed: "Hub connection closed unexpectedly",
@@ -288,7 +276,6 @@ var pt_default = {
288
276
  var pt_BR_default = {
289
277
  toolWorkflowCompilerBrowser: {
290
278
  info: {
291
- startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
292
279
  connectingToHub: "Connecting to SignalR hub: {url}",
293
280
  remoteAgentStartedExecution: "Remote agent started execution",
294
281
  downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
@@ -303,7 +290,6 @@ var pt_BR_default = {
303
290
  signalRConnectionFailed: "Failed to connect to SignalR hub",
304
291
  hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
305
292
  packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
306
- packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
307
293
  noResultForProject: "No result for project",
308
294
  beginSessionFailed: "BeginSession failed ({status}): {errorText}",
309
295
  hubConnectionClosed: "Hub connection closed unexpectedly",
@@ -323,7 +309,6 @@ var pt_BR_default = {
323
309
  var ro_default = {
324
310
  toolWorkflowCompilerBrowser: {
325
311
  info: {
326
- startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
327
312
  connectingToHub: "Connecting to SignalR hub: {url}",
328
313
  remoteAgentStartedExecution: "Remote agent started execution",
329
314
  downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
@@ -338,7 +323,6 @@ var ro_default = {
338
323
  signalRConnectionFailed: "Failed to connect to SignalR hub",
339
324
  hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
340
325
  packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
341
- packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
342
326
  noResultForProject: "No result for project",
343
327
  beginSessionFailed: "BeginSession failed ({status}): {errorText}",
344
328
  hubConnectionClosed: "Hub connection closed unexpectedly",
@@ -358,7 +342,6 @@ var ro_default = {
358
342
  var ru_default = {
359
343
  toolWorkflowCompilerBrowser: {
360
344
  info: {
361
- startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
362
345
  connectingToHub: "Connecting to SignalR hub: {url}",
363
346
  remoteAgentStartedExecution: "Remote agent started execution",
364
347
  downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
@@ -373,7 +356,6 @@ var ru_default = {
373
356
  signalRConnectionFailed: "Failed to connect to SignalR hub",
374
357
  hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
375
358
  packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
376
- packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
377
359
  noResultForProject: "No result for project",
378
360
  beginSessionFailed: "BeginSession failed ({status}): {errorText}",
379
361
  hubConnectionClosed: "Hub connection closed unexpectedly",
@@ -393,7 +375,6 @@ var ru_default = {
393
375
  var tr_default = {
394
376
  toolWorkflowCompilerBrowser: {
395
377
  info: {
396
- startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
397
378
  connectingToHub: "Connecting to SignalR hub: {url}",
398
379
  remoteAgentStartedExecution: "Remote agent started execution",
399
380
  downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
@@ -408,7 +389,6 @@ var tr_default = {
408
389
  signalRConnectionFailed: "Failed to connect to SignalR hub",
409
390
  hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
410
391
  packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
411
- packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
412
392
  noResultForProject: "No result for project",
413
393
  beginSessionFailed: "BeginSession failed ({status}): {errorText}",
414
394
  hubConnectionClosed: "Hub connection closed unexpectedly",
@@ -428,7 +408,6 @@ var tr_default = {
428
408
  var zh_CN_default = {
429
409
  toolWorkflowCompilerBrowser: {
430
410
  info: {
431
- startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
432
411
  connectingToHub: "Connecting to SignalR hub: {url}",
433
412
  remoteAgentStartedExecution: "Remote agent started execution",
434
413
  downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
@@ -443,7 +422,6 @@ var zh_CN_default = {
443
422
  signalRConnectionFailed: "Failed to connect to SignalR hub",
444
423
  hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
445
424
  packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
446
- packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
447
425
  noResultForProject: "No result for project",
448
426
  beginSessionFailed: "BeginSession failed ({status}): {errorText}",
449
427
  hubConnectionClosed: "Hub connection closed unexpectedly",
@@ -463,7 +441,6 @@ var zh_CN_default = {
463
441
  var zh_TW_default = {
464
442
  toolWorkflowCompilerBrowser: {
465
443
  info: {
466
- startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
467
444
  connectingToHub: "Connecting to SignalR hub: {url}",
468
445
  remoteAgentStartedExecution: "Remote agent started execution",
469
446
  downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
@@ -478,7 +455,6 @@ var zh_TW_default = {
478
455
  signalRConnectionFailed: "Failed to connect to SignalR hub",
479
456
  hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
480
457
  packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
481
- packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
482
458
  noResultForProject: "No result for project",
483
459
  beginSessionFailed: "BeginSession failed ({status}): {errorText}",
484
460
  hubConnectionClosed: "Hub connection closed unexpectedly",
@@ -498,7 +474,6 @@ var zh_TW_default = {
498
474
  var zu_default = {
499
475
  toolWorkflowCompilerBrowser: {
500
476
  info: {
501
- startingRemotePackAgent: "Starting remote pack agent for {count} project(s): {paths}",
502
477
  connectingToHub: "Connecting to SignalR hub: {url}",
503
478
  remoteAgentStartedExecution: "Remote agent started execution",
504
479
  downloadingArchive: "Downloading pack result archive from bucket {bucketId}",
@@ -513,7 +488,6 @@ var zu_default = {
513
488
  signalRConnectionFailed: "Failed to connect to SignalR hub",
514
489
  hubConnectionFailed: "Failed to connect to SignalR hub at {url}: {message}",
515
490
  packSucceededNoBucket: "Pack succeeded but no BucketId was returned",
516
- packAgentFailed: "Pack agent failed with status {status} (code {errorCode})",
517
491
  noResultForProject: "No result for project",
518
492
  beginSessionFailed: "BeginSession failed ({status}): {errorText}",
519
493
  hubConnectionClosed: "Hub connection closed unexpectedly",
@@ -670,7 +644,7 @@ class PackResultProcessor {
670
644
  }
671
645
  async distributePackages(extractPath, projects, context, results) {
672
646
  for (const [projectPath, entry] of projects) {
673
- const project = context.solution.Projects.find((p) => p.ProjectPath === projectPath);
647
+ const project = context.projects.find((p) => p.ProjectPath === projectPath);
674
648
  if (!project) {
675
649
  results.set(projectPath, ToolResult.error("PackResultError", translate.t("toolWorkflowCompilerBrowser.errors.noMatchingProject", { projectPath })));
676
650
  continue;
@@ -858,38 +832,58 @@ class ProjectBundleExecutor {
858
832
  this.fileSystem = fileSystem;
859
833
  }
860
834
  async packAsync(options, context) {
861
- const projectPath = options.projectPath;
862
- context.logger?.info(`[BundleExecutor] packAsync called for project: ${projectPath}`);
863
- const session = await this.getSessionAsync(context);
864
- let resolve;
865
- const promise = new Promise((r) => {
866
- resolve = r;
835
+ return this.enqueueAsync(context, {
836
+ operation: "Pack" /* Pack */,
837
+ options,
838
+ resolve: () => {}
839
+ });
840
+ }
841
+ async validateAsync(options, context) {
842
+ return this.enqueueAsync(context, {
843
+ operation: "Validate" /* Validate */,
844
+ options,
845
+ resolve: () => {}
846
+ });
847
+ }
848
+ async enqueueAsync(context, entry) {
849
+ const projectPath = entry.options.projectPath;
850
+ context.logger?.info(`[BundleExecutor] ${entry.operation}Async called for project: ${projectPath}`);
851
+ const session = await this.getSessionAsync(context, entry.operation);
852
+ if (session.operation !== entry.operation) {
853
+ return ToolResult2.error("BundleOperationMismatch", translate3.t("toolWorkflowCompilerBrowser.errors.bundleOperationMismatch", {
854
+ sessionOperation: session.operation,
855
+ entryOperation: entry.operation
856
+ }));
857
+ }
858
+ const promise = new Promise((resolve) => {
859
+ entry.resolve = resolve;
867
860
  });
868
- session.projects.set(projectPath, { options, resolve });
861
+ session.projects.set(projectPath, entry);
869
862
  const allReceived = session.projects.size === session.expectedCount;
870
- context.logger?.info(`[BundleExecutor] session: ${session.projects.size}/${session.expectedCount} projects received. allReceived=${allReceived}`);
863
+ context.logger?.info(`[BundleExecutor] session (${session.operation}): ${session.projects.size}/${session.expectedCount} projects received. allReceived=${allReceived}`);
871
864
  if (allReceived) {
872
865
  clearTimeout(session.timeout);
873
- await this.packOnAgentAsync(session, context);
866
+ await this.runAgentAsync(session, context);
874
867
  this.sessions.delete(context.id);
875
868
  }
876
869
  return promise;
877
870
  }
878
- getSessionAsync(context) {
871
+ getSessionAsync(context, operation) {
879
872
  const existing = this.sessions.get(context.id);
880
873
  if (existing) {
881
874
  return Promise.resolve(existing);
882
875
  }
883
876
  let pending = this.pendingSessionCreations.get(context.id);
884
877
  if (!pending) {
885
- pending = this.createSessionAsync(context);
878
+ pending = this.createSessionAsync(context, operation);
886
879
  this.pendingSessionCreations.set(context.id, pending);
887
880
  }
888
881
  return pending;
889
882
  }
890
- async createSessionAsync(context) {
883
+ async createSessionAsync(context, operation) {
891
884
  const expectedCount = this.countCompatibleProjects(context);
892
885
  const session = {
886
+ operation,
893
887
  expectedCount,
894
888
  projects: new Map
895
889
  };
@@ -907,9 +901,10 @@ class ProjectBundleExecutor {
907
901
  this.pendingSessionCreations.delete(context.id);
908
902
  return session;
909
903
  }
910
- async packOnAgentAsync(session, context) {
904
+ async runAgentAsync(session, context) {
911
905
  const projectPaths = [...session.projects.keys()];
912
- context.logger?.info(translate3.t("toolWorkflowCompilerBrowser.info.startingRemotePackAgent", {
906
+ context.logger?.info(translate3.t("toolWorkflowCompilerBrowser.info.startingRemoteAgent", {
907
+ operation: session.operation,
913
908
  count: session.expectedCount,
914
909
  paths: projectPaths.join(", ")
915
910
  }));
@@ -931,11 +926,11 @@ class ProjectBundleExecutor {
931
926
  context.logger?.info(`[BundleExecutor] BeginSession succeeded. Waiting for completion...`);
932
927
  const result = await hubConnection.waitForCompletionAsync();
933
928
  context.logger?.info(`[BundleExecutor] Got result: errorCode=${result.errorCode}, status=${result.status}, message=${result.message}, bucketId=${result.bucketId}`);
934
- await this.handlePackResultAsync(result, session, context);
929
+ await this.handleAgentResultAsync(result, session, context);
935
930
  } catch (error) {
936
931
  const message = error instanceof Error ? error.message : String(error);
937
- context.logger?.error(`[BundleExecutor] packOnAgentAsync caught error: ${message}`);
938
- this.resolveAll(session, ToolResult2.error("PackAgentError", message));
932
+ context.logger?.error(`[BundleExecutor] runAgentAsync caught error: ${message}`);
933
+ this.resolveAll(session, ToolResult2.error(`${session.operation}AgentError`, message));
939
934
  } finally {
940
935
  await hubConnection.disconnectAsync();
941
936
  }
@@ -956,20 +951,34 @@ class ProjectBundleExecutor {
956
951
  return null;
957
952
  }
958
953
  }
959
- async handlePackResultAsync(result, session, context) {
954
+ async handleAgentResultAsync(result, session, context) {
960
955
  if (result.errorCode !== 0 || result.status !== 0 /* Succeeded */) {
961
- this.resolveAll(session, ToolResult2.error("PackAgentError", result.message ?? translate3.t("toolWorkflowCompilerBrowser.errors.packAgentFailed", {
956
+ this.resolveAll(session, ToolResult2.error(`${session.operation}AgentError`, result.message ?? translate3.t("toolWorkflowCompilerBrowser.errors.agentFailed", {
957
+ operation: session.operation,
962
958
  status: result.status,
963
959
  errorCode: result.errorCode
964
960
  })));
965
961
  return;
966
962
  }
963
+ if (session.operation === "Pack" /* Pack */) {
964
+ await this.handlePackBucketAsync(result, session, context);
965
+ return;
966
+ }
967
+ this.resolveAll(session, ToolResult2.success());
968
+ }
969
+ async handlePackBucketAsync(result, session, context) {
967
970
  if (result.bucketId == null) {
968
971
  this.resolveAll(session, ToolResult2.error("PackAgentError", translate3.t("toolWorkflowCompilerBrowser.errors.packSucceededNoBucket")));
969
972
  return;
970
973
  }
974
+ const packEntries = new Map;
975
+ for (const [projectPath, entry] of session.projects) {
976
+ if (entry.operation === "Pack" /* Pack */) {
977
+ packEntries.set(projectPath, { options: entry.options });
978
+ }
979
+ }
971
980
  const resultProcessor = new PackResultProcessor(this.fileSystem, context.logger);
972
- const perProjectResults = await resultProcessor.processAsync(result.bucketId, session.projects, context);
981
+ const perProjectResults = await resultProcessor.processAsync(result.bucketId, packEntries, context);
973
982
  for (const [projectPath, entry] of session.projects) {
974
983
  const projectResult = perProjectResults.get(projectPath);
975
984
  entry.resolve(projectResult ?? ToolResult2.error("PackResultError", translate3.t("toolWorkflowCompilerBrowser.errors.noResultForProject")));
@@ -980,42 +989,44 @@ class ProjectBundleExecutor {
980
989
  const url = `${relativeBase}/orchestrator_/api/serverless/jobs`;
981
990
  context.logger?.info(`[BundleExecutor] BeginSession URL: ${url}`);
982
991
  const firstEntry = session.projects.values().next().value;
983
- const pkg = firstEntry.options.package;
984
992
  const opts = firstEntry.options;
985
993
  const rpaProjects = [...session.projects.entries()].map(([projectPath, entry]) => {
986
- const project = context.solution.Projects.find((p) => p.ProjectPath === projectPath);
994
+ const project = context.projects.find((p) => p.ProjectPath === projectPath);
987
995
  return {
988
996
  RelativePath: project?.ProjectRelativePath ?? "",
989
997
  DesignId: project?.Id ?? "",
990
- PackageId: entry.options.package.id
998
+ PackageId: entry.operation === "Pack" /* Pack */ ? entry.options.package.id : ""
991
999
  };
992
1000
  });
993
- const executorInfo = JSON.stringify({
994
- Command: "Pack",
1001
+ const executorInfo = {
1002
+ Command: session.operation,
995
1003
  SupportedProtocolVersions: ["2.0"],
996
- ProjectId: "",
997
1004
  DownloadUrl: context.downloadUrl ?? "",
998
1005
  SessionId: sessionId,
999
1006
  ProfileKey: "StudioWeb",
1000
1007
  LicenseType: "Development",
1001
1008
  LogLevel: opts.logLevel ?? "Warning",
1002
- Name: pkg.id,
1003
- Configuration: context.configuration,
1004
1009
  Culture: "en-US",
1005
- Version: pkg.version,
1006
- Author: pkg.author ?? "",
1007
- Description: pkg.description ?? "",
1010
+ DownloadTimeoutInSeconds: 300,
1008
1011
  SkipAnalyze: String(opts.skipAnalyze),
1009
1012
  SkipValidate: String(opts.skipValidate),
1010
1013
  TargetFramework: context.targetFramework,
1011
1014
  RpaProjects: rpaProjects,
1012
1015
  WorkflowCompilerVersion: context.workflowCompilerVersion ?? ""
1013
- });
1016
+ };
1017
+ if (firstEntry.operation === "Pack" /* Pack */) {
1018
+ executorInfo.Configuration = context.configuration;
1019
+ const pkg = firstEntry.options.package;
1020
+ executorInfo.Name = pkg.id;
1021
+ executorInfo.Version = pkg.version;
1022
+ executorInfo.Author = pkg.author ?? "";
1023
+ executorInfo.Description = pkg.description ?? "";
1024
+ }
1014
1025
  const body = {
1015
1026
  source: "StudioWeb",
1016
1027
  targetFramework: context.targetFramework,
1017
1028
  jobType: "PublishStudioProject",
1018
- inputArguments: executorInfo
1029
+ inputArguments: JSON.stringify(executorInfo)
1019
1030
  };
1020
1031
  const headers = {
1021
1032
  "Content-Type": "application/json",
@@ -1041,13 +1052,14 @@ class ProjectBundleExecutor {
1041
1052
  }
1042
1053
  }
1043
1054
  countCompatibleProjects(context) {
1044
- return context.solution.Projects.filter((p) => p.ProjectPath != null && this.toolFactory.supportedTypes.includes(p.Type)).length;
1055
+ return context.projects.filter((p) => p.ProjectPath != null && this.toolFactory.supportedTypes.includes(p.Type)).length;
1045
1056
  }
1046
1057
  }
1047
1058
 
1048
1059
  // src/workflow-compiler-tool.ts
1049
1060
  import {
1050
1061
  ProjectTool,
1062
+ ToolErrorCodes as ToolErrorCodes2,
1051
1063
  ToolResult as ToolResult3
1052
1064
  } from "@uipath/solutionpackager-tool-core";
1053
1065
 
@@ -1063,9 +1075,11 @@ class WorkflowCompilerTool extends ProjectTool {
1063
1075
  this.logger.warn("Restore operation is not supported in browser environment");
1064
1076
  return ToolResult3.success();
1065
1077
  }
1066
- async validateAsync(_options, _cancellationToken) {
1067
- this.logger.warn("Validate operation is not supported in browser environment");
1068
- return ToolResult3.success();
1078
+ async validateAsync(options, _cancellationToken) {
1079
+ if (!this.context) {
1080
+ return ToolResult3.error(ToolErrorCodes2.InternalError, "Validate operation requires a project operation context");
1081
+ }
1082
+ return this.bundleExecutor.validateAsync(options, this.context);
1069
1083
  }
1070
1084
  async buildAsync(_options, _cancellationToken) {
1071
1085
  this.logger.warn("Build operation is not supported in browser environment");
@@ -1073,8 +1087,7 @@ class WorkflowCompilerTool extends ProjectTool {
1073
1087
  }
1074
1088
  async packAsync(options, _cancellationToken) {
1075
1089
  if (!this.context) {
1076
- this.logger.warn("Pack operation requires a project operation context");
1077
- return ToolResult3.success();
1090
+ return ToolResult3.error(ToolErrorCodes2.InternalError, "Pack operation requires a project operation context");
1078
1091
  }
1079
1092
  return this.bundleExecutor.packAsync(options, this.context);
1080
1093
  }
@@ -1,11 +1,16 @@
1
- import { type IFileSystem, type IProjectPackOptions, type IProjectToolFactory, type ProjectOperationContext, ToolResult } from "@uipath/solutionpackager-tool-core";
1
+ import { type IFileSystem, type IProjectPackOptions, type IProjectToolFactory, type IProjectValidateOptions, type ProjectOperationContext, ToolResult } from "@uipath/solutionpackager-tool-core";
2
+ export declare enum BundleOperation {
3
+ Pack = "Pack",
4
+ Validate = "Validate"
5
+ }
2
6
  export interface IProjectBundleExecutor {
3
7
  packAsync(options: IProjectPackOptions, context: ProjectOperationContext): Promise<ToolResult>;
8
+ validateAsync(options: IProjectValidateOptions, context: ProjectOperationContext): Promise<ToolResult>;
4
9
  }
5
10
  /**
6
- * Coordinates packing of multiple projects within a single operation context.
7
- * Waits until all compatible projects have submitted their pack options,
8
- * then executes a single bundled operation and resolves all pending promises.
11
+ * Coordinates pack or validate of multiple projects within a single operation context.
12
+ * Waits until all compatible projects have submitted their options,
13
+ * then executes a single bundled remote-agent operation and resolves all pending promises.
9
14
  */
10
15
  export declare class ProjectBundleExecutor implements IProjectBundleExecutor {
11
16
  private readonly toolFactory;
@@ -15,11 +20,14 @@ export declare class ProjectBundleExecutor implements IProjectBundleExecutor {
15
20
  private readonly pendingSessionCreations;
16
21
  constructor(toolFactory: IProjectToolFactory, fileSystem: IFileSystem);
17
22
  packAsync(options: IProjectPackOptions, context: ProjectOperationContext): Promise<ToolResult>;
23
+ validateAsync(options: IProjectValidateOptions, context: ProjectOperationContext): Promise<ToolResult>;
24
+ private enqueueAsync;
18
25
  private getSessionAsync;
19
26
  private createSessionAsync;
20
- private packOnAgentAsync;
27
+ private runAgentAsync;
21
28
  private connectToHubAsync;
22
- private handlePackResultAsync;
29
+ private handleAgentResultAsync;
30
+ private handlePackBucketAsync;
23
31
  private sendBeginSessionAsync;
24
32
  private resolveAll;
25
33
  private countCompatibleProjects;
@@ -2,15 +2,16 @@ import { type IFileSystem, type IProjectBuildOptions, type IProjectPackOptions,
2
2
  import type { IProjectBundleExecutor } from "./project-bundle-executor.js";
3
3
  /**
4
4
  * Browser workflow compiler tool implementation.
5
- * DUMMY: Logs messages indicating where robot/remote agent integration will be added.
6
- * Future: Will send pack commands to robot which starts remote agent to pack projects.
5
+ * Delegates pack and validate to a bundle executor that coordinates a
6
+ * single remote-agent invocation across all compatible projects in the
7
+ * solution via SignalR.
7
8
  */
8
9
  export declare class WorkflowCompilerTool extends ProjectTool {
9
10
  private readonly bundleExecutor;
10
11
  private readonly context?;
11
12
  constructor(fileSystem: IFileSystem, logger: IToolLogger, bundleExecutor: IProjectBundleExecutor, context?: ProjectOperationContext | undefined);
12
13
  restoreAsync(_options: IProjectRestoreOptions, _cancellationToken?: AbortSignal): Promise<ToolResult>;
13
- validateAsync(_options: IProjectValidateOptions, _cancellationToken?: AbortSignal): Promise<ToolResult>;
14
+ validateAsync(options: IProjectValidateOptions, _cancellationToken?: AbortSignal): Promise<ToolResult>;
14
15
  buildAsync(_options: IProjectBuildOptions, _cancellationToken?: AbortSignal): Promise<ToolResult>;
15
16
  packAsync(options: IProjectPackOptions, _cancellationToken?: AbortSignal): Promise<ToolResult>;
16
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/packager-tool-workflowcompiler-browser",
3
- "version": "0.0.29",
3
+ "version": "0.0.33",
4
4
  "description": "UiPath Workflow Compiler tool - browser implementation",
5
5
  "type": "module",
6
6
  "exports": {
@@ -46,15 +46,16 @@
46
46
  "@microsoft/signalr": "^10.0.0"
47
47
  },
48
48
  "peerDependencies": {
49
- "@uipath/solutionpackager-tool-core": "0.0.31"
49
+ "@uipath/solutionpackager-tool-core": "0.0.33"
50
50
  },
51
51
  "devDependencies": {
52
- "@uipath/solutionpackager-tool-core": "0.0.31",
52
+ "@uipath/solutionpackager-tool-core": "0.0.33",
53
53
  "@vitest/browser": "^4.0.14",
54
54
  "@vitest/browser-playwright": "^4.0.14",
55
55
  "@vitest/coverage-v8": "^4.0.14",
56
56
  "playwright": "^1.57.0",
57
57
  "typescript": "^5.9.3",
58
58
  "vitest": "^4.0.14"
59
- }
59
+ },
60
+ "gitHead": "3f1b4d8e9f910be81e4cab956537f21dbd5d63ac"
60
61
  }
@@ -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",