@uipath/maestro-tool 0.1.10 → 0.1.12

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/tool.js CHANGED
@@ -1,174 +1,9 @@
1
- // ../../node_modules/@uipath/tool-bpmn/dist/index.js
2
- import { NugetConstants, NugetPackager, Path, ProjectTool, ProjectTypes, TemporaryStorageService, ToolErrorCodes, ToolResult, toolsFactoryRepository } from "@uipath/solutionpackager-tool-core";
3
- function _define_property(obj, key, value) {
4
- if (key in obj)
5
- Object.defineProperty(obj, key, {
6
- value,
7
- enumerable: true,
8
- configurable: true,
9
- writable: true
10
- });
11
- else
12
- obj[key] = value;
13
- return obj;
14
- }
15
- var BpmnConstants = {
16
- EntryPointsFileName: "entry-points.json",
17
- BindingsV2FileName: "bindings_v2.json"
18
- };
19
-
20
- class BpmnTool extends ProjectTool {
21
- async restoreAsync(_options, _cancellationToken) {
22
- this.logger.info("Restore operation is not required for ProcessOrchestration projects");
23
- return ToolResult.success();
24
- }
25
- async validateAsync(_options, _cancellationToken) {
26
- this.logger.info("Validate operation is not required for ProcessOrchestration projects");
27
- return ToolResult.success();
28
- }
29
- async buildAsync(options, _cancellationToken) {
30
- const tempFolder = await this._temporaryStorage.getTempFolderPath();
31
- const localBuildFolder = Path.join(tempFolder, NugetConstants.OutputFolderName);
32
- const contentFolder = Path.join(localBuildFolder, NugetConstants.ContentFolderName);
33
- try {
34
- this.logger.progress("Copying files...");
35
- await this.copyFiles(options.projectPath, contentFolder);
36
- this.logger.progress("Creating operate.json file...");
37
- await this.createOperateFile(options, contentFolder);
38
- this.logger.progress("Creating package-descriptor.json file...");
39
- await this.createPackageDescriptor(localBuildFolder, contentFolder);
40
- return new ToolResult(ToolErrorCodes.Success, "done", [
41
- localBuildFolder
42
- ]);
43
- } catch (error) {
44
- const errorMessage = error instanceof Error ? error.toString() : String(error);
45
- this.logger.error(errorMessage);
46
- return ToolResult.error(ToolErrorCodes.InternalError, "An error occurred while building ProcessOrchestration project files");
47
- }
48
- }
49
- async packAsync(options, cancellationToken) {
50
- const buildResult = await this.buildAsync(options, cancellationToken);
51
- if (!buildResult.isSuccess)
52
- return buildResult;
53
- const localBuildFolder = buildResult.packages[0];
54
- try {
55
- this.logger.progress("Creating NuGet package...");
56
- const nupkgFileName = `${options.package.id}.${options.package.version}.nupkg`;
57
- const nupkgPath = Path.join(options.outputPath, nupkgFileName);
58
- const packager = new NugetPackager(this.fileSystem);
59
- const result = await packager.packAsync(localBuildFolder, options.package, nupkgPath);
60
- this.logger.progress("Package created successfully");
61
- return new ToolResult(ToolErrorCodes.Success, "done", [
62
- result.outputPath
63
- ]);
64
- } catch (error) {
65
- const errorMessage = error instanceof Error ? error.toString() : String(error);
66
- this.logger.error(errorMessage);
67
- return ToolResult.error(ToolErrorCodes.InternalError, "An error occurred while packing ProcessOrchestration project");
68
- }
69
- }
70
- async dispose() {
71
- this.logger.info("Disposing ProcessOrchestration Tool");
72
- try {
73
- await this._temporaryStorage.cleanup();
74
- } catch {}
75
- }
76
- async copyFiles(sourcePath, destinationPath) {
77
- await this.fileSystem.mkdir(destinationPath);
78
- const files = await this.fileSystem.readdir(sourcePath);
79
- for (const file of files) {
80
- const sourceFile = Path.join(sourcePath, file);
81
- const destinationFile = Path.join(destinationPath, file);
82
- const stat = await this.fileSystem.stat(sourceFile);
83
- if (stat?.isFile()) {
84
- const content = await this.fileSystem.readFile(sourceFile);
85
- if (content)
86
- await this.fileSystem.writeFile(destinationFile, content);
87
- }
88
- }
89
- }
90
- async createOperateFile(options, contentFolder) {
91
- const operateJsonFilePath = Path.join(contentFolder, NugetConstants.OperateFileName);
92
- const exists = await this.fileSystem.exists(operateJsonFilePath);
93
- if (!exists)
94
- await this.createOperateJsonFile(contentFolder, options.projectStorageId ?? "", operateJsonFilePath);
95
- }
96
- async createOperateJsonFile(projectPath, projectId, filePath) {
97
- const entryPointsFilePath = Path.join(projectPath, BpmnConstants.EntryPointsFileName);
98
- let mainPath = "";
99
- const entryPointsExists = await this.fileSystem.exists(entryPointsFilePath);
100
- if (entryPointsExists) {
101
- const entryPointsContent = await this.fileSystem.readFile(entryPointsFilePath);
102
- if (entryPointsContent)
103
- try {
104
- const entryPointsText = new TextDecoder().decode(entryPointsContent);
105
- const entryPoints = JSON.parse(entryPointsText);
106
- mainPath = entryPoints.entryPoints?.[0]?.filePath ?? "";
107
- } catch {}
108
- }
109
- const operateFileModel = {
110
- $schema: "https://cloud.uipath.com/draft/2024-12/operate",
111
- contentType: ProjectTypes.ProcessOrchestration,
112
- projectId,
113
- main: mainPath,
114
- targetFramework: "Portable",
115
- runtimeOptions: {
116
- isAttended: false,
117
- requiresUserInteraction: false
118
- }
119
- };
120
- const operateJsonString = JSON.stringify(operateFileModel, null, 2);
121
- await this.fileSystem.writeFile(filePath, operateJsonString);
122
- }
123
- async createPackageDescriptor(localBuildFolder, contentFolder) {
124
- const descriptorFiles = {};
125
- descriptorFiles[NugetConstants.OperateFileName] = Path.join(NugetConstants.ContentFolderName, NugetConstants.OperateFileName);
126
- descriptorFiles[BpmnConstants.EntryPointsFileName] = Path.join(NugetConstants.ContentFolderName, BpmnConstants.EntryPointsFileName);
127
- descriptorFiles[NugetConstants.BindingsFileId] = Path.join(NugetConstants.ContentFolderName, BpmnConstants.BindingsV2FileName);
128
- const contentFiles = await this.fileSystem.readdir(contentFolder);
129
- for (const file of contentFiles)
130
- if (file.endsWith(".bpmn"))
131
- descriptorFiles[file] = Path.join(NugetConstants.ContentFolderName, file);
132
- const packageDescriptorPath = Path.join(localBuildFolder, NugetConstants.ContentFolderName, NugetConstants.PackageDescriptorFileName);
133
- const packageDescriptorJson = JSON.stringify({
134
- $schema: "https://cloud.uipath.com/draft/2024-12/package-descriptor",
135
- files: descriptorFiles
136
- }, null, 2);
137
- await this.fileSystem.writeFile(packageDescriptorPath, packageDescriptorJson);
138
- }
139
- constructor(fileSystem, logger) {
140
- super(fileSystem, logger), _define_property(this, "_temporaryStorage", undefined);
141
- this._temporaryStorage = new TemporaryStorageService(fileSystem);
142
- }
143
- }
144
- function bpmn_tool_factory_define_property(obj, key, value) {
145
- if (key in obj)
146
- Object.defineProperty(obj, key, {
147
- value,
148
- enumerable: true,
149
- configurable: true,
150
- writable: true
151
- });
152
- else
153
- obj[key] = value;
154
- return obj;
155
- }
156
-
157
- class BpmnToolFactory {
158
- async createAsync(logger, fileSystem) {
159
- return new BpmnTool(fileSystem, logger);
160
- }
161
- constructor() {
162
- bpmn_tool_factory_define_property(this, "supportedTypes", [
163
- ProjectTypes.ProcessOrchestration
164
- ]);
165
- }
166
- }
167
- toolsFactoryRepository.registerProjectToolFactory(new BpmnToolFactory);
1
+ // src/tool.ts
2
+ import"./packager-tool.js";
168
3
  // package.json
169
4
  var package_default = {
170
5
  name: "@uipath/maestro-tool",
171
- version: "0.1.10",
6
+ version: "0.1.12",
172
7
  description: "Create, debug, and run Maestro projects and jobs.",
173
8
  private: false,
174
9
  repository: {
@@ -177,7 +12,7 @@ var package_default = {
177
12
  directory: "packages/maestro-tool"
178
13
  },
179
14
  publishConfig: {
180
- registry: "https://registry.npmjs.org/"
15
+ registry: "https://npm.pkg.github.com/@uipath"
181
16
  },
182
17
  keywords: [
183
18
  "cli-tool"
@@ -194,7 +29,7 @@ var package_default = {
194
29
  "dist"
195
30
  ],
196
31
  scripts: {
197
- build: "bun build ./src/tool.ts --outdir dist --format esm --target node --external commander --external @uipath/common --external @uipath/auth --external @uipath/filesystem --external @uipath/solutionpackager-tool-core && bun build ./src/index.ts --outdir dist --format esm --target node --external '*/tool.js' --external commander --external @uipath/common --external @uipath/auth --external @uipath/filesystem --external @uipath/solutionpackager-tool-core",
32
+ build: "bun ../../tools/build-tool.ts",
198
33
  package: "bun run build && bun pm pack",
199
34
  test: "vitest run && vitest run -c vitest.isolated.config.ts",
200
35
  "test:isolated": "vitest run -c vitest.isolated.config.ts",
@@ -204,17 +39,17 @@ var package_default = {
204
39
  },
205
40
  peerDependencies: {
206
41
  commander: "^14.0.3",
207
- "@uipath/common": "^0.1.7",
208
- "@uipath/auth": "^0.1.6",
42
+ "@uipath/common": "^0.1.13",
43
+ "@uipath/auth": "^0.1.9",
209
44
  "@uipath/filesystem": "^0.1.6",
210
- "@uipath/solutionpackager-tool-core": "^0.0.29"
45
+ "@uipath/solutionpackager-tool-core": "workspace:*"
211
46
  },
212
47
  devDependencies: {
213
- "@uipath/tool-bpmn": "0.0.5",
48
+ "@uipath/packager-tool-bpmn": "workspace:*",
214
49
  "@uipath/maestro-sdk": "workspace:*",
215
50
  "@uipath/orchestrator-sdk": "workspace:*",
216
51
  "bpmn-moddle": "^9.0.4",
217
- "@types/node": "^25.2.3",
52
+ "@types/node": "^25.5.0",
218
53
  typescript: "^5"
219
54
  }
220
55
  };
@@ -225,11 +60,19 @@ import {
225
60
  catchError as catchError7,
226
61
  logger as logger7,
227
62
  OutputFormatter as OutputFormatter2,
228
- processContext as processContext2
63
+ processContext as processContext3
229
64
  } from "@uipath/common";
230
65
 
231
66
  // src/services/maestro-api.ts
232
- import { catchError as catchError2, logger as logger2 } from "@uipath/common";
67
+ import {
68
+ catchError as catchError2,
69
+ ErrorDecision,
70
+ logger as logger2,
71
+ MIN_INTERVAL_MS,
72
+ PollOutcome,
73
+ pollUntil,
74
+ processContext
75
+ } from "@uipath/common";
233
76
  import { getFileSystem } from "@uipath/filesystem";
234
77
 
235
78
  // ../orchestrator-sdk/generated/src/runtime.ts
@@ -725,6 +568,34 @@ function ResourceOverwriteDtoToJSONTyped(value, ignoreDiscriminator = false) {
725
568
  };
726
569
  }
727
570
 
571
+ // ../orchestrator-sdk/generated/src/models/VideoRecordingSettingsDto.ts
572
+ function VideoRecordingSettingsDtoFromJSON(json) {
573
+ return VideoRecordingSettingsDtoFromJSONTyped(json, false);
574
+ }
575
+ function VideoRecordingSettingsDtoFromJSONTyped(json, ignoreDiscriminator) {
576
+ if (json == null) {
577
+ return json;
578
+ }
579
+ return {
580
+ videoRecordingType: json["VideoRecordingType"] == null ? undefined : json["VideoRecordingType"],
581
+ queueItemVideoRecordingType: json["QueueItemVideoRecordingType"] == null ? undefined : json["QueueItemVideoRecordingType"],
582
+ maxDurationSeconds: json["MaxDurationSeconds"] == null ? undefined : json["MaxDurationSeconds"]
583
+ };
584
+ }
585
+ function VideoRecordingSettingsDtoToJSON(json) {
586
+ return VideoRecordingSettingsDtoToJSONTyped(json, false);
587
+ }
588
+ function VideoRecordingSettingsDtoToJSONTyped(value, ignoreDiscriminator = false) {
589
+ if (value == null) {
590
+ return value;
591
+ }
592
+ return {
593
+ VideoRecordingType: value["videoRecordingType"],
594
+ QueueItemVideoRecordingType: value["queueItemVideoRecordingType"],
595
+ MaxDurationSeconds: value["maxDurationSeconds"]
596
+ };
597
+ }
598
+
728
599
  // ../orchestrator-sdk/generated/src/models/TestAutomationJobDto.ts
729
600
  function TestAutomationJobDtoToJSON(json) {
730
601
  return TestAutomationJobDtoToJSONTyped(json, false);
@@ -739,7 +610,14 @@ function TestAutomationJobDtoToJSONTyped(value, ignoreDiscriminator = false) {
739
610
  releaseVersionId: value["releaseVersionId"],
740
611
  inputArguments: value["inputArguments"],
741
612
  entryPointPath: value["entryPointPath"],
742
- robotId: value["robotId"]
613
+ robotId: value["robotId"],
614
+ runtimeType: value["runtimeType"],
615
+ machineId: value["machineId"],
616
+ hostMachineName: value["hostMachineName"],
617
+ serviceUserName: value["serviceUserName"],
618
+ remoteControlAccess: value["remoteControlAccess"],
619
+ autopilotForRobots: AutopilotForRobotsSettingsDtoToJSON(value["autopilotForRobots"]),
620
+ videoRecordingSettings: VideoRecordingSettingsDtoToJSON(value["videoRecordingSettings"])
743
621
  };
744
622
  }
745
623
 
@@ -1726,34 +1604,6 @@ function ProcessSettingsDtoToJSONTyped(value, ignoreDiscriminator = false) {
1726
1604
  };
1727
1605
  }
1728
1606
 
1729
- // ../orchestrator-sdk/generated/src/models/VideoRecordingSettingsDto.ts
1730
- function VideoRecordingSettingsDtoFromJSON(json) {
1731
- return VideoRecordingSettingsDtoFromJSONTyped(json, false);
1732
- }
1733
- function VideoRecordingSettingsDtoFromJSONTyped(json, ignoreDiscriminator) {
1734
- if (json == null) {
1735
- return json;
1736
- }
1737
- return {
1738
- videoRecordingType: json["VideoRecordingType"] == null ? undefined : json["VideoRecordingType"],
1739
- queueItemVideoRecordingType: json["QueueItemVideoRecordingType"] == null ? undefined : json["QueueItemVideoRecordingType"],
1740
- maxDurationSeconds: json["MaxDurationSeconds"] == null ? undefined : json["MaxDurationSeconds"]
1741
- };
1742
- }
1743
- function VideoRecordingSettingsDtoToJSON(json) {
1744
- return VideoRecordingSettingsDtoToJSONTyped(json, false);
1745
- }
1746
- function VideoRecordingSettingsDtoToJSONTyped(value, ignoreDiscriminator = false) {
1747
- if (value == null) {
1748
- return value;
1749
- }
1750
- return {
1751
- VideoRecordingType: value["videoRecordingType"],
1752
- QueueItemVideoRecordingType: value["queueItemVideoRecordingType"],
1753
- MaxDurationSeconds: value["maxDurationSeconds"]
1754
- };
1755
- }
1756
-
1757
1607
  // ../orchestrator-sdk/generated/src/models/SimpleReleaseDto.ts
1758
1608
  function SimpleReleaseDtoFromJSON(json) {
1759
1609
  return SimpleReleaseDtoFromJSONTyped(json, false);
@@ -4650,21 +4500,6 @@ class JobsApi extends BaseAPI {
4650
4500
  if (requestParameters["$expand"] != null) {
4651
4501
  queryParameters["$expand"] = requestParameters["$expand"];
4652
4502
  }
4653
- if (requestParameters["$filter"] != null) {
4654
- queryParameters["$filter"] = requestParameters["$filter"];
4655
- }
4656
- if (requestParameters["$orderby"] != null) {
4657
- queryParameters["$orderby"] = requestParameters["$orderby"];
4658
- }
4659
- if (requestParameters["$top"] != null) {
4660
- queryParameters["$top"] = requestParameters["$top"];
4661
- }
4662
- if (requestParameters["$skip"] != null) {
4663
- queryParameters["$skip"] = requestParameters["$skip"];
4664
- }
4665
- if (requestParameters["$count"] != null) {
4666
- queryParameters["$count"] = requestParameters["$count"];
4667
- }
4668
4503
  const headerParameters = {};
4669
4504
  if (requestParameters["xUIPATHOrganizationUnitId"] != null) {
4670
4505
  headerParameters["X-UIPATH-OrganizationUnitId"] = String(requestParameters["xUIPATHOrganizationUnitId"]);
@@ -6408,64 +6243,99 @@ async function startMaestroProjectJob(config) {
6408
6243
  }
6409
6244
  return startMaestroJob(config);
6410
6245
  }
6246
+ var TRACE_TERMINAL_STATES = ["Completed", "Faulted", "Cancelled"];
6247
+ function extractTerminalStatus(spans) {
6248
+ const processRunSpan = spans.find((s) => s.SpanType === "ProcessRun");
6249
+ if (!processRunSpan) {
6250
+ return;
6251
+ }
6252
+ const [parseErr, attributes] = catchError2(() => JSON.parse(processRunSpan.Attributes));
6253
+ if (parseErr) {
6254
+ logger2.warn("Failed to parse ProcessRun span attributes");
6255
+ return;
6256
+ }
6257
+ const status = attributes.status;
6258
+ if (status && TRACE_TERMINAL_STATES.includes(status)) {
6259
+ return status;
6260
+ }
6261
+ return;
6262
+ }
6411
6263
  async function streamJobTraces(config, jobKey, options = {}) {
6412
6264
  const startTime = Date.now();
6413
6265
  const pollInterval = options.pollInterval || 2000;
6414
6266
  const maxPolls = options.maxPolls || 300;
6415
6267
  const traceId = jobKey;
6416
- let pollCount = 0;
6268
+ const effectiveInterval = Math.max(pollInterval, MIN_INTERVAL_MS);
6269
+ const timeoutMs = maxPolls * effectiveInterval;
6417
6270
  const seenSpanIds = new Set;
6418
6271
  let tracesFound = false;
6419
- while (pollCount < maxPolls) {
6420
- const [tracesErr, spans] = await catchError2(getMaestroTraces(config, traceId));
6421
- if (tracesErr) {
6422
- if (tracesErr.message.includes("404") || tracesErr.message.includes("400")) {
6423
- if (!tracesFound && pollCount % 5 === 0) {
6424
- logger2.info(`Waiting for traces... (${pollCount * pollInterval / 1000}s)`);
6272
+ let transientErrorCount = 0;
6273
+ const result = await pollUntil({
6274
+ fn: () => getMaestroTraces(config, traceId),
6275
+ until: (spans) => extractTerminalStatus(spans) !== undefined,
6276
+ label: `job ${jobKey}`,
6277
+ logPrefix: "maestro",
6278
+ intervalMs: pollInterval,
6279
+ timeoutMs,
6280
+ maxConsecutiveErrors: 0,
6281
+ signal: processContext.pollSignal,
6282
+ onPoll: (spans) => {
6283
+ transientErrorCount = 0;
6284
+ if (!tracesFound && spans.length > 0) {
6285
+ tracesFound = true;
6286
+ logger2.info("Execution started, streaming traces...");
6287
+ }
6288
+ for (const span of spans) {
6289
+ if (!seenSpanIds.has(span.Id)) {
6290
+ seenSpanIds.add(span.Id);
6291
+ options.onTrace?.(spanToTraceEvent(span));
6425
6292
  }
6426
- await new Promise((resolve) => setTimeout(resolve, pollInterval));
6427
- pollCount++;
6428
- continue;
6429
6293
  }
6430
- throw tracesErr;
6431
- }
6432
- if (!tracesFound && spans.length > 0) {
6433
- tracesFound = true;
6434
- logger2.info("Execution started, streaming traces...");
6435
- }
6436
- for (const span of spans) {
6437
- if (!seenSpanIds.has(span.Id)) {
6438
- seenSpanIds.add(span.Id);
6439
- const traceEvent = spanToTraceEvent(span);
6440
- options.onTrace?.(traceEvent);
6441
- }
6442
- }
6443
- const processRunSpan = spans.find((s) => s.SpanType === "ProcessRun");
6444
- if (processRunSpan) {
6445
- const [parseErr, attributes] = catchError2(() => JSON.parse(processRunSpan.Attributes));
6446
- if (parseErr || !attributes)
6447
- continue;
6448
- const status = attributes.status;
6449
- if (!status)
6450
- continue;
6451
- const terminalStates = ["Completed", "Faulted", "Cancelled"];
6452
- if (terminalStates.includes(status)) {
6453
- const success = status === "Completed";
6454
- const result = {
6455
- success,
6456
- jobKey,
6457
- traceId,
6458
- finalState: status,
6459
- duration: Date.now() - startTime
6460
- };
6461
- options.onComplete?.(result);
6462
- return result;
6294
+ },
6295
+ onError: (error) => {
6296
+ if (error.message.includes("404") || error.message.includes("400")) {
6297
+ if (!tracesFound && transientErrorCount % 5 === 0) {
6298
+ logger2.info("Waiting for traces...");
6299
+ }
6300
+ transientErrorCount++;
6301
+ return;
6463
6302
  }
6303
+ return ErrorDecision.Abort;
6464
6304
  }
6465
- await new Promise((resolve) => setTimeout(resolve, pollInterval));
6466
- pollCount++;
6305
+ });
6306
+ const elapsed = Date.now() - startTime;
6307
+ if (result.outcome === PollOutcome.Completed && result.data) {
6308
+ const status = extractTerminalStatus(result.data);
6309
+ const finalState = status ?? "Unknown";
6310
+ const runResult = {
6311
+ success: finalState === "Completed",
6312
+ jobKey,
6313
+ traceId,
6314
+ finalState,
6315
+ duration: elapsed
6316
+ };
6317
+ options.onComplete?.(runResult);
6318
+ return runResult;
6319
+ }
6320
+ if (result.outcome === PollOutcome.Timeout) {
6321
+ return {
6322
+ success: false,
6323
+ jobKey,
6324
+ traceId,
6325
+ error: `Polling timed out after ${timeoutMs / 1000}s`,
6326
+ duration: elapsed,
6327
+ finalState: "Failed"
6328
+ };
6467
6329
  }
6468
- throw new Error(`Polling timed out after ${maxPolls * pollInterval / 1000}s`);
6330
+ const errorMsg = result.error?.message ?? `Polling ended: ${result.outcome}`;
6331
+ return {
6332
+ success: false,
6333
+ jobKey,
6334
+ traceId,
6335
+ error: errorMsg,
6336
+ duration: elapsed,
6337
+ finalState: "Failed"
6338
+ };
6469
6339
  }
6470
6340
  async function getJobStatusDetailed(config, jobKey) {
6471
6341
  const folder = await resolveFolder({ folderKey: config.folderKey }, { tenant: config.tenantName });
@@ -7017,7 +6887,7 @@ import {
7017
6887
  extractErrorMessage,
7018
6888
  logger as logger5,
7019
6889
  OutputFormatter,
7020
- processContext
6890
+ processContext as processContext2
7021
6891
  } from "@uipath/common";
7022
6892
  async function withPimsCall(fn, errorMessage) {
7023
6893
  const [configError, config] = await catchError5(createPimsConfig());
@@ -7028,7 +6898,7 @@ async function withPimsCall(fn, errorMessage) {
7028
6898
  Message: errorMessage,
7029
6899
  Instructions: configError.message
7030
6900
  });
7031
- processContext.exit(1);
6901
+ processContext2.exit(1);
7032
6902
  return;
7033
6903
  }
7034
6904
  const [error, result] = await catchError5(fn(config));
@@ -7040,7 +6910,7 @@ async function withPimsCall(fn, errorMessage) {
7040
6910
  Message: errorMessage,
7041
6911
  Instructions: msg
7042
6912
  });
7043
- processContext.exit(1);
6913
+ processContext2.exit(1);
7044
6914
  return;
7045
6915
  }
7046
6916
  return result;
@@ -7368,7 +7238,7 @@ function parseFolderId(raw, fallback) {
7368
7238
 
7369
7239
  // src/commands/debug.ts
7370
7240
  function registerDebugCommand(program) {
7371
- program.command("debug").description("Debug a maestro project by uploading to Studio Web and running a debug session").argument("<project-path>", "Path to the maestro project directory (must contain project.uiproj)").option("--folder-id <id>", "Orchestrator folder ID (OrganizationUnitId). Auto-detected if not provided.").option("--poll-interval <ms>", "Polling interval in milliseconds", "2000").option("-i, --inputs <json>", "Input parameters as JSON string or @file.json").option("--login-validity <minutes>", "Minimum minutes before token expiration to trigger a refresh (default: 10)", parseInt, 10).trackedAction(processContext2, async (projectPath, options) => {
7241
+ program.command("debug").description("Debug a maestro project by uploading to Studio Web and running a debug session").argument("<project-path>", "Path to the maestro project directory (must contain project.uiproj)").option("--folder-id <id>", "Orchestrator folder ID (OrganizationUnitId). Auto-detected if not provided.").option("--poll-interval <ms>", "Polling interval in milliseconds", "2000").option("-i, --inputs <json>", "Input parameters as JSON string or @file.json").option("--login-validity <minutes>", "Minimum minutes before token expiration to trigger a refresh (default: 10)", parseInt, 10).trackedAction(processContext3, async (projectPath, options) => {
7372
7242
  const [loginError, loginStatus] = await catchError7(getLoginStatusAsync3({
7373
7243
  ensureTokenValidityMinutes: options.loginValidity
7374
7244
  }));
@@ -7378,7 +7248,7 @@ function registerDebugCommand(program) {
7378
7248
  Message: loginError.message,
7379
7249
  Instructions: "Check authentication and BPMN file"
7380
7250
  });
7381
- processContext2.exit(1);
7251
+ processContext3.exit(1);
7382
7252
  return;
7383
7253
  }
7384
7254
  if (loginStatus.loginStatus !== "Logged in" || !loginStatus.baseUrl) {
@@ -7387,7 +7257,7 @@ function registerDebugCommand(program) {
7387
7257
  Message: "Not logged in. Run 'uip login' first.",
7388
7258
  Instructions: "Check authentication and BPMN file"
7389
7259
  });
7390
- processContext2.exit(1);
7260
+ processContext3.exit(1);
7391
7261
  return;
7392
7262
  }
7393
7263
  if (!loginStatus.organizationId) {
@@ -7396,7 +7266,7 @@ function registerDebugCommand(program) {
7396
7266
  Message: "Organization ID not available from login.",
7397
7267
  Instructions: "Check authentication and BPMN file"
7398
7268
  });
7399
- processContext2.exit(1);
7269
+ processContext3.exit(1);
7400
7270
  return;
7401
7271
  }
7402
7272
  if (!loginStatus.tenantId) {
@@ -7405,7 +7275,7 @@ function registerDebugCommand(program) {
7405
7275
  Message: "Tenant ID not available from login.",
7406
7276
  Instructions: "Check authentication and BPMN file"
7407
7277
  });
7408
- processContext2.exit(1);
7278
+ processContext3.exit(1);
7409
7279
  return;
7410
7280
  }
7411
7281
  if (!loginStatus.tenantName) {
@@ -7414,7 +7284,7 @@ function registerDebugCommand(program) {
7414
7284
  Message: "Tenant name not available from login.",
7415
7285
  Instructions: "Check authentication and BPMN file"
7416
7286
  });
7417
- processContext2.exit(1);
7287
+ processContext3.exit(1);
7418
7288
  return;
7419
7289
  }
7420
7290
  if (!loginStatus.accessToken) {
@@ -7423,7 +7293,7 @@ function registerDebugCommand(program) {
7423
7293
  Message: "Access token not available from login.",
7424
7294
  Instructions: "Check authentication and BPMN file"
7425
7295
  });
7426
- processContext2.exit(1);
7296
+ processContext3.exit(1);
7427
7297
  return;
7428
7298
  }
7429
7299
  const [folderErr, organizationUnitId] = catchError7(() => parseFolderId(options.folderId, loginStatus.organizationUnitId));
@@ -7433,7 +7303,7 @@ function registerDebugCommand(program) {
7433
7303
  Message: folderErr.message,
7434
7304
  Instructions: "Check authentication and BPMN file"
7435
7305
  });
7436
- processContext2.exit(1);
7306
+ processContext3.exit(1);
7437
7307
  return;
7438
7308
  }
7439
7309
  const pimsConfig = {
@@ -7453,7 +7323,7 @@ function registerDebugCommand(program) {
7453
7323
  Message: `Invalid poll-interval: "${options.pollInterval}". Must be a positive number in milliseconds.`,
7454
7324
  Instructions: "Provide a valid positive integer, e.g. --poll-interval 2000"
7455
7325
  });
7456
- processContext2.exit(1);
7326
+ processContext3.exit(1);
7457
7327
  return;
7458
7328
  }
7459
7329
  let inputs;
@@ -7465,7 +7335,7 @@ function registerDebugCommand(program) {
7465
7335
  Message: "Failed to parse inputs",
7466
7336
  Instructions: parseError.message
7467
7337
  });
7468
- processContext2.exit(1);
7338
+ processContext3.exit(1);
7469
7339
  return;
7470
7340
  }
7471
7341
  inputs = parsedInputs;
@@ -7491,7 +7361,7 @@ function registerDebugCommand(program) {
7491
7361
  Message: executeError.message,
7492
7362
  Instructions: "Check authentication and BPMN file"
7493
7363
  });
7494
- processContext2.exit(1);
7364
+ processContext3.exit(1);
7495
7365
  return;
7496
7366
  }
7497
7367
  OutputFormatter2.success({
@@ -7507,15 +7377,15 @@ function registerDebugCommand(program) {
7507
7377
  Instructions: `Debug completed with status: ${result.finalStatus}`
7508
7378
  });
7509
7379
  const success = result.finalStatus === "Completed" || result.finalStatus === "Successful";
7510
- processContext2.exit(success ? 0 : 1);
7380
+ processContext3.exit(success ? 0 : 1);
7511
7381
  });
7512
7382
  }
7513
7383
 
7514
7384
  // src/commands/incidents.ts
7515
- import { OutputFormatter as OutputFormatter3, processContext as processContext3 } from "@uipath/common";
7385
+ import { OutputFormatter as OutputFormatter3, processContext as processContext4 } from "@uipath/common";
7516
7386
  var registerIncidentsCommand = (program) => {
7517
- const incidents = program.command("incidents").description("Manage Maestro incident summaries");
7518
- incidents.command("list").description("List all incident summaries across processes").trackedAction(processContext3, async () => {
7387
+ const incident = program.command("incident").description("Manage Maestro incidents");
7388
+ incident.command("summary").description("Get Maestro incident summaries across processes").trackedAction(processContext4, async () => {
7519
7389
  const result = await withPimsCall((config) => pimsGet(config, "/incidents/summary"), "Error listing incidents");
7520
7390
  if (!result)
7521
7391
  return;
@@ -7525,10 +7395,21 @@ var registerIncidentsCommand = (program) => {
7525
7395
  Data: result
7526
7396
  });
7527
7397
  });
7398
+ incident.command("get").description("Get a single Maestro incident by ID").argument("<incident-id>", "Incident ID").requiredOption("--folder-key <key>", "Folder key").trackedAction(processContext4, async (incidentId, options) => {
7399
+ const reqOptions = { folderKey: options.folderKey };
7400
+ const result = await withPimsCall((config) => pimsGet(config, `/incidents/${encodeURIComponent(incidentId)}`, reqOptions), "Error getting incident");
7401
+ if (!result)
7402
+ return;
7403
+ OutputFormatter3.success({
7404
+ Result: "Success",
7405
+ Code: "IncidentGet",
7406
+ Data: result
7407
+ });
7408
+ });
7528
7409
  };
7529
7410
 
7530
7411
  // src/commands/init.ts
7531
- import { catchError as catchError8, OutputFormatter as OutputFormatter4, processContext as processContext4 } from "@uipath/common";
7412
+ import { catchError as catchError8, OutputFormatter as OutputFormatter4, processContext as processContext5 } from "@uipath/common";
7532
7413
  import { getFileSystem as getFileSystem3 } from "@uipath/filesystem";
7533
7414
 
7534
7415
  // ../../node_modules/min-dash/dist/index.esm.js
@@ -13497,7 +13378,7 @@ function SimpleBpmnModdle(additionalPackages, options) {
13497
13378
  // src/commands/init.ts
13498
13379
  var VALID_PROJECT_NAME_REGEX = /^[a-zA-Z0-9_-]+$/;
13499
13380
  var registerInitCommand = (program) => {
13500
- program.command("init").description("Create a new Maestro project with boilerplate files").argument("<name>", "Maestro project name").option("--force", "Force initialization even if target directory is not empty (writes files without clearing existing contents)").trackedAction(processContext4, async (name2, options) => {
13381
+ program.command("init").description("Create a new Maestro project with boilerplate files").argument("<name>", "Maestro project name").option("--force", "Force initialization even if target directory is not empty (writes files without clearing existing contents)").trackedAction(processContext5, async (name2, options) => {
13501
13382
  const [error3] = await catchError8(initMaestroProject(name2, options));
13502
13383
  if (error3) {
13503
13384
  OutputFormatter4.error({
@@ -13505,7 +13386,7 @@ var registerInitCommand = (program) => {
13505
13386
  Message: "Failed to create Maestro project",
13506
13387
  Instructions: error3.message
13507
13388
  });
13508
- processContext4.exit(1);
13389
+ processContext5.exit(1);
13509
13390
  }
13510
13391
  });
13511
13392
  };
@@ -13649,11 +13530,11 @@ import {
13649
13530
  catchError as catchError9,
13650
13531
  DEFAULT_PAGE_SIZE,
13651
13532
  OutputFormatter as OutputFormatter5,
13652
- processContext as processContext5
13533
+ processContext as processContext6
13653
13534
  } from "@uipath/common";
13654
13535
  var registerInstancesCommand = (program) => {
13655
13536
  const instances = program.command("instances").description("Manage Maestro process instances");
13656
- instances.command("list").description("List process instances").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").option("-l, --limit <number>", "Number of items to return", String(DEFAULT_PAGE_SIZE)).option("--offset <number>", "Number of items to skip", "0").option("--process-key <process-key>", "Filter by process key").option("--package-id <id>", "Filter by package ID").option("--error-code <code>", "Filter by error code").trackedAction(processContext5, async (options) => {
13537
+ instances.command("list").description("List process instances").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").option("-l, --limit <number>", "Number of items to return", String(DEFAULT_PAGE_SIZE)).option("--offset <number>", "Number of items to skip", "0").option("--process-key <process-key>", "Filter by process key").option("--package-id <id>", "Filter by package ID").option("--error-code <code>", "Filter by error code").trackedAction(processContext6, async (options) => {
13657
13538
  const query = buildQueryString({
13658
13539
  processKey: options.processKey,
13659
13540
  packageId: options.packageId,
@@ -13671,7 +13552,7 @@ var registerInstancesCommand = (program) => {
13671
13552
  Data: result.value || []
13672
13553
  });
13673
13554
  });
13674
- instances.command("get").description("Get a process instance by ID").argument("<instance-id>", "Process instance ID").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").trackedAction(processContext5, async (instanceId, options) => {
13555
+ instances.command("get").description("Get a process instance by ID").argument("<instance-id>", "Process instance ID").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").trackedAction(processContext6, async (instanceId, options) => {
13675
13556
  const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}`, { folderKey: options.folderKey }), "Error getting instance");
13676
13557
  if (!result)
13677
13558
  return;
@@ -13681,7 +13562,7 @@ var registerInstancesCommand = (program) => {
13681
13562
  Data: result
13682
13563
  });
13683
13564
  });
13684
- instances.command("pause").description("Pause a running process instance").argument("<instance-id>", "Process instance ID").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").option("--comment <text>", "Optional comment for the operation").trackedAction(processContext5, async (instanceId, options) => {
13565
+ instances.command("pause").description("Pause a running process instance").argument("<instance-id>", "Process instance ID").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").option("--comment <text>", "Optional comment for the operation").trackedAction(processContext6, async (instanceId, options) => {
13685
13566
  const body = { comment: options.comment || "" };
13686
13567
  const reqOptions = { folderKey: options.folderKey };
13687
13568
  const result = await withPimsCall((config) => pimsPost(config, `/instances/${instanceId}/pause`, body, reqOptions), "Error pausing instance");
@@ -13693,7 +13574,7 @@ var registerInstancesCommand = (program) => {
13693
13574
  Data: result
13694
13575
  });
13695
13576
  });
13696
- instances.command("resume").description("Resume a paused process instance").argument("<instance-id>", "Process instance ID").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").option("--comment <text>", "Optional comment for the operation").trackedAction(processContext5, async (instanceId, options) => {
13577
+ instances.command("resume").description("Resume a paused process instance").argument("<instance-id>", "Process instance ID").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").option("--comment <text>", "Optional comment for the operation").trackedAction(processContext6, async (instanceId, options) => {
13697
13578
  const body = { comment: options.comment || "" };
13698
13579
  const reqOptions = { folderKey: options.folderKey };
13699
13580
  const result = await withPimsCall((config) => pimsPost(config, `/instances/${instanceId}/resume`, body, reqOptions), "Error resuming instance");
@@ -13705,7 +13586,7 @@ var registerInstancesCommand = (program) => {
13705
13586
  Data: result
13706
13587
  });
13707
13588
  });
13708
- instances.command("cancel").description("Cancel a process instance").argument("<instance-id>", "Process instance ID").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").option("--comment <text>", "Optional comment for the operation").trackedAction(processContext5, async (instanceId, options) => {
13589
+ instances.command("cancel").description("Cancel a process instance").argument("<instance-id>", "Process instance ID").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").option("--comment <text>", "Optional comment for the operation").trackedAction(processContext6, async (instanceId, options) => {
13709
13590
  const body = { comment: options.comment || "" };
13710
13591
  const reqOptions = { folderKey: options.folderKey };
13711
13592
  const result = await withPimsCall((config) => pimsPost(config, `/instances/${instanceId}/cancel`, body, reqOptions), "Error canceling instance");
@@ -13717,7 +13598,7 @@ var registerInstancesCommand = (program) => {
13717
13598
  Data: result
13718
13599
  });
13719
13600
  });
13720
- instances.command("variables").description("Get variables for a process instance").argument("<instance-id>", "Process instance ID").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").option("--parent-element-id <id>", "Filter variables by parent element ID").trackedAction(processContext5, async (instanceId, options) => {
13601
+ instances.command("variables").description("Get variables for a process instance").argument("<instance-id>", "Process instance ID").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").option("--parent-element-id <id>", "Filter variables by parent element ID").trackedAction(processContext6, async (instanceId, options) => {
13721
13602
  const query = buildQueryString({
13722
13603
  parentElementId: options.parentElementId
13723
13604
  });
@@ -13731,7 +13612,7 @@ var registerInstancesCommand = (program) => {
13731
13612
  Data: result
13732
13613
  });
13733
13614
  });
13734
- instances.command("incidents").description("Get incidents for a process instance").argument("<instance-id>", "Process instance ID").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").trackedAction(processContext5, async (instanceId, options) => {
13615
+ instances.command("incidents").description("Get incidents for a process instance").argument("<instance-id>", "Process instance ID").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").trackedAction(processContext6, async (instanceId, options) => {
13735
13616
  const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}/incidents`, { folderKey: options.folderKey }), "Error getting incidents");
13736
13617
  if (!result)
13737
13618
  return;
@@ -13741,7 +13622,7 @@ var registerInstancesCommand = (program) => {
13741
13622
  Data: result
13742
13623
  });
13743
13624
  });
13744
- instances.command("asset").description("Get the BPMN XML asset for a process instance").argument("<instance-id>", "Process instance ID").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").trackedAction(processContext5, async (instanceId, options) => {
13625
+ instances.command("asset").description("Get the BPMN XML asset for a process instance").argument("<instance-id>", "Process instance ID").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").trackedAction(processContext6, async (instanceId, options) => {
13745
13626
  const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}/asset?type=bpmn`, { folderKey: options.folderKey }), "Error getting asset");
13746
13627
  if (!result)
13747
13628
  return;
@@ -13751,7 +13632,7 @@ var registerInstancesCommand = (program) => {
13751
13632
  Data: result
13752
13633
  });
13753
13634
  });
13754
- instances.command("retry").description("Retry a faulted process instance").argument("<instance-id>", "Process instance ID").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").option("--comment <text>", "Optional comment for the operation").trackedAction(processContext5, async (instanceId, options) => {
13635
+ instances.command("retry").description("Retry a faulted process instance").argument("<instance-id>", "Process instance ID").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").option("--comment <text>", "Optional comment for the operation").trackedAction(processContext6, async (instanceId, options) => {
13755
13636
  const body = { comment: options.comment || "" };
13756
13637
  const reqOptions = { folderKey: options.folderKey };
13757
13638
  const result = await withPimsCall((config) => pimsPost(config, `/instances/${instanceId}/retry`, body, reqOptions), "Error retrying instance");
@@ -13763,7 +13644,7 @@ var registerInstancesCommand = (program) => {
13763
13644
  Data: result
13764
13645
  });
13765
13646
  });
13766
- instances.command("migrate").description("Migrate a process instance to a different package version").argument("<instance-id>", "Process instance ID").argument("<new-version>", "Target package version").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").option("--comment <text>", "Optional comment for the operation").trackedAction(processContext5, async (instanceId, newVersion, options) => {
13647
+ instances.command("migrate").description("Migrate a process instance to a different package version").argument("<instance-id>", "Process instance ID").argument("<new-version>", "Target package version").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").option("--comment <text>", "Optional comment for the operation").trackedAction(processContext6, async (instanceId, newVersion, options) => {
13767
13648
  const body = {
13768
13649
  newVersion,
13769
13650
  comment: options.comment || ""
@@ -13778,7 +13659,7 @@ var registerInstancesCommand = (program) => {
13778
13659
  Data: result
13779
13660
  });
13780
13661
  });
13781
- instances.command("goto").description("Move execution cursor from one element to another").argument("<instance-id>", "Process instance ID").argument("<transitions>", `JSON array of transitions, e.g. '[{"sourceElementId":"A","targetElementId":"B"}]'`).requiredOption("-f, --folder-key <key>", "Folder key (GUID)").trackedAction(processContext5, async (instanceId, transitionsJson, options) => {
13662
+ instances.command("goto").description("Move execution cursor from one element to another").argument("<instance-id>", "Process instance ID").argument("<transitions>", `JSON array of transitions, e.g. '[{"sourceElementId":"A","targetElementId":"B"}]'`).requiredOption("-f, --folder-key <key>", "Folder key (GUID)").trackedAction(processContext6, async (instanceId, transitionsJson, options) => {
13782
13663
  const [parseError, transitions] = catchError9(() => JSON.parse(transitionsJson));
13783
13664
  const isValidShape = !parseError && Array.isArray(transitions) && transitions.every((t) => t.sourceElementId && t.targetElementId);
13784
13665
  if (!isValidShape) {
@@ -13787,7 +13668,7 @@ var registerInstancesCommand = (program) => {
13787
13668
  Message: "Error applying goto",
13788
13669
  Instructions: parseError ? `Invalid transitions JSON: ${parseError.message}` : 'Each transition must have "sourceElementId" and "targetElementId"'
13789
13670
  });
13790
- processContext5.exit(1);
13671
+ processContext6.exit(1);
13791
13672
  return;
13792
13673
  }
13793
13674
  const body = { transitions };
@@ -13801,7 +13682,7 @@ var registerInstancesCommand = (program) => {
13801
13682
  Data: result
13802
13683
  });
13803
13684
  });
13804
- instances.command("cursors").description("Get current execution cursor positions for a process instance").argument("<instance-id>", "Process instance ID").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").trackedAction(processContext5, async (instanceId, options) => {
13685
+ instances.command("cursors").description("Get current execution cursor positions for a process instance").argument("<instance-id>", "Process instance ID").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").trackedAction(processContext6, async (instanceId, options) => {
13805
13686
  const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}/goto/cursors`, { folderKey: options.folderKey }), "Error getting cursors");
13806
13687
  if (!result)
13807
13688
  return;
@@ -13811,7 +13692,7 @@ var registerInstancesCommand = (program) => {
13811
13692
  Data: result
13812
13693
  });
13813
13694
  });
13814
- instances.command("element-executions").description("Get element executions for a process instance").argument("<instance-id>", "Process instance ID").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").trackedAction(processContext5, async (instanceId, options) => {
13695
+ instances.command("element-executions").description("Get element executions for a process instance").argument("<instance-id>", "Process instance ID").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").trackedAction(processContext6, async (instanceId, options) => {
13815
13696
  const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}/element-executions`, { folderKey: options.folderKey }), "Error getting element executions");
13816
13697
  if (!result)
13817
13698
  return;
@@ -13829,11 +13710,11 @@ import {
13829
13710
  catchError as catchError10,
13830
13711
  logger as logger8,
13831
13712
  OutputFormatter as OutputFormatter6,
13832
- processContext as processContext6
13713
+ processContext as processContext7
13833
13714
  } from "@uipath/common";
13834
13715
  function registerJobCommand(program) {
13835
13716
  const jobCmd = program.command("job").description("Manage Maestro jobs");
13836
- jobCmd.command("traces").description("Stream traces for a running job").argument("<job-key>", "Job key (GUID from run command)").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to authenticated tenant)").option("--poll-interval <ms>", "Polling interval in milliseconds", "2000").option("--traces-service <name>", "Traces service name (default: llmopstenant_)", "llmopstenant_").option("--pretty", "Show traces in human-readable format instead of raw JSON").option("--login-validity <minutes>", "Minimum minutes before token expiration to trigger a refresh (default: 10)", parseInt, 10).trackedAction(processContext6, async (jobKey, options) => {
13717
+ jobCmd.command("traces").description("Stream traces for a running job").argument("<job-key>", "Job key (GUID from run command)").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to authenticated tenant)").option("--poll-interval <ms>", "Polling interval in milliseconds", "2000").option("--traces-service <name>", "Traces service name (default: llmopstenant_)", "llmopstenant_").option("--pretty", "Show traces in human-readable format instead of raw JSON").option("--login-validity <minutes>", "Minimum minutes before token expiration to trigger a refresh (default: 10)", parseInt, 10).trackedAction(processContext7, async (jobKey, options) => {
13837
13718
  const [loginErr, loginStatus] = await catchError10(getLoginStatusAsync4({
13838
13719
  ensureTokenValidityMinutes: options.loginValidity
13839
13720
  }));
@@ -13843,7 +13724,7 @@ function registerJobCommand(program) {
13843
13724
  Message: loginErr.message,
13844
13725
  Instructions: "Check authentication and parameters"
13845
13726
  });
13846
- processContext6.exit(1);
13727
+ processContext7.exit(1);
13847
13728
  return;
13848
13729
  }
13849
13730
  if (loginStatus.loginStatus !== "Logged in" || !loginStatus.baseUrl) {
@@ -13852,7 +13733,7 @@ function registerJobCommand(program) {
13852
13733
  Message: "Not logged in. Run 'uipcli login' first.",
13853
13734
  Instructions: "Check authentication and parameters"
13854
13735
  });
13855
- processContext6.exit(1);
13736
+ processContext7.exit(1);
13856
13737
  return;
13857
13738
  }
13858
13739
  const tenantName = options.tenant || loginStatus.tenantName;
@@ -13862,7 +13743,7 @@ function registerJobCommand(program) {
13862
13743
  Message: "Missing tenant or organization info.",
13863
13744
  Instructions: "Check authentication and parameters"
13864
13745
  });
13865
- processContext6.exit(1);
13746
+ processContext7.exit(1);
13866
13747
  return;
13867
13748
  }
13868
13749
  const config = {
@@ -13883,7 +13764,7 @@ function registerJobCommand(program) {
13883
13764
  Message: `Invalid poll-interval: ${options.pollInterval}. Must be a positive number.`,
13884
13765
  Instructions: "Check authentication and parameters"
13885
13766
  });
13886
- processContext6.exit(1);
13767
+ processContext7.exit(1);
13887
13768
  return;
13888
13769
  }
13889
13770
  const pollSeconds = pollIntervalMs / 1000;
@@ -13915,12 +13796,12 @@ function registerJobCommand(program) {
13915
13796
  Message: streamErr.message,
13916
13797
  Instructions: "Check authentication and parameters"
13917
13798
  });
13918
- processContext6.exit(1);
13799
+ processContext7.exit(1);
13919
13800
  return;
13920
13801
  }
13921
- processContext6.exit(result.success ? 0 : 1);
13802
+ processContext7.exit(result.success ? 0 : 1);
13922
13803
  });
13923
- jobCmd.command("status").description("Get detailed status of a Maestro job").argument("<job-key>", "Job key (GUID from run command)").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to authenticated tenant)").option("--folder-key <key>", "Folder key (GUID from list command, defaults to authenticated folder)").option("--detailed", "Show full response with all fields").option("--login-validity <minutes>", "Minimum minutes before token expiration to trigger a refresh (default: 10)", parseInt, 10).trackedAction(processContext6, async (jobKey, options) => {
13804
+ jobCmd.command("status").description("Get detailed status of a Maestro job").argument("<job-key>", "Job key (GUID from run command)").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to authenticated tenant)").option("--folder-key <key>", "Folder key (GUID from list command, defaults to authenticated folder)").option("--detailed", "Show full response with all fields").option("--login-validity <minutes>", "Minimum minutes before token expiration to trigger a refresh (default: 10)", parseInt, 10).trackedAction(processContext7, async (jobKey, options) => {
13924
13805
  const [loginErr, loginStatus] = await catchError10(getLoginStatusAsync4({
13925
13806
  ensureTokenValidityMinutes: options.loginValidity
13926
13807
  }));
@@ -13930,7 +13811,7 @@ function registerJobCommand(program) {
13930
13811
  Message: loginErr.message,
13931
13812
  Instructions: "Check job key, authentication, and folder permissions"
13932
13813
  });
13933
- processContext6.exit(1);
13814
+ processContext7.exit(1);
13934
13815
  return;
13935
13816
  }
13936
13817
  if (loginStatus.loginStatus !== "Logged in" || !loginStatus.baseUrl) {
@@ -13939,7 +13820,7 @@ function registerJobCommand(program) {
13939
13820
  Message: "Not logged in. Run 'uipcli login' first.",
13940
13821
  Instructions: "Check job key, authentication, and folder permissions"
13941
13822
  });
13942
- processContext6.exit(1);
13823
+ processContext7.exit(1);
13943
13824
  return;
13944
13825
  }
13945
13826
  const tenantName = options.tenant || loginStatus.tenantName;
@@ -13949,7 +13830,7 @@ function registerJobCommand(program) {
13949
13830
  Message: "Missing tenant or organization info.",
13950
13831
  Instructions: "Check job key, authentication, and folder permissions"
13951
13832
  });
13952
- processContext6.exit(1);
13833
+ processContext7.exit(1);
13953
13834
  return;
13954
13835
  }
13955
13836
  const config = {
@@ -13969,7 +13850,7 @@ function registerJobCommand(program) {
13969
13850
  Message: statusErr.message,
13970
13851
  Instructions: "Check job key, authentication, and folder permissions"
13971
13852
  });
13972
- processContext6.exit(1);
13853
+ processContext7.exit(1);
13973
13854
  return;
13974
13855
  }
13975
13856
  const outputData = options.detailed ? status : {
@@ -13997,12 +13878,12 @@ function registerJobCommand(program) {
13997
13878
  }
13998
13879
 
13999
13880
  // src/commands/pack.ts
14000
- import { catchError as catchError12, OutputFormatter as OutputFormatter7, processContext as processContext7 } from "@uipath/common";
13881
+ import { catchError as catchError12, OutputFormatter as OutputFormatter7, processContext as processContext8 } from "@uipath/common";
14001
13882
 
14002
13883
  // src/services/maestro-pack-service.ts
14003
13884
  import { catchError as catchError11, logger as logger9 } from "@uipath/common";
14004
13885
  import { getFileSystem as getFileSystem4 } from "@uipath/filesystem";
14005
- import { NugetPackager as NugetPackager2 } from "@uipath/solutionpackager-tool-core";
13886
+ import { NugetPackager } from "@uipath/solutionpackager-tool-core";
14006
13887
  var VALID_PACKAGE_NAME_REGEX = /^[a-zA-Z0-9._-]+$/;
14007
13888
 
14008
13889
  class MaestroPackService {
@@ -14062,7 +13943,7 @@ Packing Maestro project...
14062
13943
  const packageId = `${packageName}.processOrchestration.ProcessOrchestration`;
14063
13944
  const version = options.version || "1.0.0";
14064
13945
  const nupkgPath = this.fs.path.join(absoluteOutputPath, `${packageId}.${version}.nupkg`);
14065
- const packager = new NugetPackager2(this.fs);
13946
+ const packager = new NugetPackager(this.fs);
14066
13947
  const result = await packager.packAsync(stagingDir, {
14067
13948
  id: packageId,
14068
13949
  version,
@@ -14104,7 +13985,7 @@ Packing Maestro project...
14104
13985
 
14105
13986
  // src/commands/pack.ts
14106
13987
  var registerPackCommand = (program) => {
14107
- program.command("pack").description("Pack a Maestro project into a .nupkg file").argument("<projectPath>", "Path to the Maestro project directory").argument("<outputPath>", "Output directory where the .nupkg will be saved").option("-n, --name <name>", "Package name (default: project folder name)").option("-v, --version <version>", "Package version (default: 1.0.0)", "1.0.0").trackedAction(processContext7, async (projectPath, outputPath, options) => {
13988
+ program.command("pack").description("Pack a Maestro project into a .nupkg file").argument("<projectPath>", "Path to the Maestro project directory").argument("<outputPath>", "Output directory where the .nupkg will be saved").option("-n, --name <name>", "Package name (default: project folder name)").option("-v, --version <version>", "Package version (default: 1.0.0)", "1.0.0").trackedAction(processContext8, async (projectPath, outputPath, options) => {
14108
13989
  const service = new MaestroPackService;
14109
13990
  const [error3, result] = await catchError12(service.execute(projectPath, {
14110
13991
  output: outputPath,
@@ -14117,7 +13998,7 @@ var registerPackCommand = (program) => {
14117
13998
  Message: "Maestro pack failed",
14118
13999
  Instructions: error3.message
14119
14000
  });
14120
- processContext7.exit(1);
14001
+ processContext8.exit(1);
14121
14002
  return;
14122
14003
  }
14123
14004
  OutputFormatter7.success({
@@ -14137,7 +14018,7 @@ import {
14137
14018
  catchError as catchError13,
14138
14019
  logger as logger10,
14139
14020
  OutputFormatter as OutputFormatter8,
14140
- processContext as processContext8
14021
+ processContext as processContext9
14141
14022
  } from "@uipath/common";
14142
14023
 
14143
14024
  // src/utils/input-reader.ts
@@ -14163,7 +14044,7 @@ async function readStdin() {
14163
14044
  // src/commands/process.ts
14164
14045
  function registerProcessCommand(program) {
14165
14046
  const processCmd = program.command("process").description("Manage Maestro processes");
14166
- processCmd.command("list").description("List available Maestro processes").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to authenticated tenant)").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").option("--filter <odata>", "Additional OData filter").option("--login-validity <minutes>", "Minimum minutes before token expiration to trigger a refresh (default: 10)", parseInt, 10).trackedAction(processContext8, async (options) => {
14047
+ processCmd.command("list").description("List available Maestro processes").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to authenticated tenant)").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").option("--filter <odata>", "Additional OData filter").option("--login-validity <minutes>", "Minimum minutes before token expiration to trigger a refresh (default: 10)", parseInt, 10).trackedAction(processContext9, async (options) => {
14167
14048
  const [loginErr, loginStatus] = await catchError13(getLoginStatusAsync5({
14168
14049
  ensureTokenValidityMinutes: options.loginValidity
14169
14050
  }));
@@ -14173,7 +14054,7 @@ function registerProcessCommand(program) {
14173
14054
  Message: loginErr.message,
14174
14055
  Instructions: "Check authentication and permissions"
14175
14056
  });
14176
- processContext8.exit(1);
14057
+ processContext9.exit(1);
14177
14058
  return;
14178
14059
  }
14179
14060
  if (loginStatus.loginStatus !== "Logged in" || !loginStatus.baseUrl) {
@@ -14182,7 +14063,7 @@ function registerProcessCommand(program) {
14182
14063
  Message: "Not logged in. Run 'uip login' first.",
14183
14064
  Instructions: "Check authentication and permissions"
14184
14065
  });
14185
- processContext8.exit(1);
14066
+ processContext9.exit(1);
14186
14067
  return;
14187
14068
  }
14188
14069
  const tenantName = options.tenant || loginStatus.tenantName;
@@ -14192,7 +14073,7 @@ function registerProcessCommand(program) {
14192
14073
  Message: "Tenant not provided and not available from login. Use --tenant flag.",
14193
14074
  Instructions: "Check authentication and permissions"
14194
14075
  });
14195
- processContext8.exit(1);
14076
+ processContext9.exit(1);
14196
14077
  return;
14197
14078
  }
14198
14079
  if (!loginStatus.organizationId) {
@@ -14201,7 +14082,7 @@ function registerProcessCommand(program) {
14201
14082
  Message: "Organization ID not available from login.",
14202
14083
  Instructions: "Check authentication and permissions"
14203
14084
  });
14204
- processContext8.exit(1);
14085
+ processContext9.exit(1);
14205
14086
  return;
14206
14087
  }
14207
14088
  const config = {
@@ -14220,7 +14101,7 @@ function registerProcessCommand(program) {
14220
14101
  Message: listErr.message,
14221
14102
  Instructions: "Check authentication and permissions"
14222
14103
  });
14223
- processContext8.exit(1);
14104
+ processContext9.exit(1);
14224
14105
  return;
14225
14106
  }
14226
14107
  if (processes.length === 0) {
@@ -14229,7 +14110,7 @@ function registerProcessCommand(program) {
14229
14110
  Message: "No Maestro processes found.",
14230
14111
  Instructions: "Check folder permissions or try a different folder."
14231
14112
  });
14232
- processContext8.exit(1);
14113
+ processContext9.exit(1);
14233
14114
  return;
14234
14115
  }
14235
14116
  const formattedData = processes.map((p) => ({
@@ -14249,7 +14130,7 @@ function registerProcessCommand(program) {
14249
14130
  Instructions: `Found ${processes.length} Maestro process(es)`
14250
14131
  });
14251
14132
  });
14252
- processCmd.command("get").description("Get Maestro process schema and details").argument("<process-key>", "Process key").argument("<feed-id>", "Feed ID (from 'maestro process list')").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to authenticated tenant)").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").option("--login-validity <minutes>", "Minimum minutes before token expiration to trigger a refresh (default: 10)", parseInt, 10).trackedAction(processContext8, async (processKey, feedId, options) => {
14133
+ processCmd.command("get").description("Get Maestro process schema and details").argument("<process-key>", "Process key").argument("<feed-id>", "Feed ID (from 'maestro process list')").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to authenticated tenant)").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").option("--login-validity <minutes>", "Minimum minutes before token expiration to trigger a refresh (default: 10)", parseInt, 10).trackedAction(processContext9, async (processKey, feedId, options) => {
14253
14134
  const [loginErr, loginStatus] = await catchError13(getLoginStatusAsync5({
14254
14135
  ensureTokenValidityMinutes: options.loginValidity
14255
14136
  }));
@@ -14259,7 +14140,7 @@ function registerProcessCommand(program) {
14259
14140
  Message: loginErr.message,
14260
14141
  Instructions: "Check authentication and process key"
14261
14142
  });
14262
- processContext8.exit(1);
14143
+ processContext9.exit(1);
14263
14144
  return;
14264
14145
  }
14265
14146
  if (loginStatus.loginStatus !== "Logged in" || !loginStatus.baseUrl) {
@@ -14268,7 +14149,7 @@ function registerProcessCommand(program) {
14268
14149
  Message: "Not logged in. Run 'uip login' first.",
14269
14150
  Instructions: "Check authentication and process key"
14270
14151
  });
14271
- processContext8.exit(1);
14152
+ processContext9.exit(1);
14272
14153
  return;
14273
14154
  }
14274
14155
  const tenantName = options.tenant || loginStatus.tenantName;
@@ -14278,7 +14159,7 @@ function registerProcessCommand(program) {
14278
14159
  Message: "Tenant not provided and not available from login. Use --tenant flag.",
14279
14160
  Instructions: "Check authentication and process key"
14280
14161
  });
14281
- processContext8.exit(1);
14162
+ processContext9.exit(1);
14282
14163
  return;
14283
14164
  }
14284
14165
  if (!loginStatus.organizationId) {
@@ -14287,7 +14168,7 @@ function registerProcessCommand(program) {
14287
14168
  Message: "Organization ID not available from login.",
14288
14169
  Instructions: "Check authentication and process key"
14289
14170
  });
14290
- processContext8.exit(1);
14171
+ processContext9.exit(1);
14291
14172
  return;
14292
14173
  }
14293
14174
  const config = {
@@ -14307,7 +14188,7 @@ function registerProcessCommand(program) {
14307
14188
  Message: entryErr.message,
14308
14189
  Instructions: "Check authentication and process key"
14309
14190
  });
14310
- processContext8.exit(1);
14191
+ processContext9.exit(1);
14311
14192
  return;
14312
14193
  }
14313
14194
  if (entryPoints.length === 0) {
@@ -14316,7 +14197,7 @@ function registerProcessCommand(program) {
14316
14197
  Message: "No entry points found for this process.",
14317
14198
  Instructions: "Verify the process key is correct and published."
14318
14199
  });
14319
- processContext8.exit(1);
14200
+ processContext9.exit(1);
14320
14201
  return;
14321
14202
  }
14322
14203
  const formattedData = entryPoints.map((ep) => {
@@ -14336,7 +14217,7 @@ function registerProcessCommand(program) {
14336
14217
  Instructions: `Found ${entryPoints.length} entry point(s) for ${processKey}`
14337
14218
  });
14338
14219
  });
14339
- processCmd.command("run").description("Run a Maestro process with inputs").argument("<process-key>", "Process key").argument("<folder-key>", "Folder key (GUID)").option("-i, --inputs <json>", "Input parameters as JSON string or @file.json").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to authenticated tenant)").option("--release-key <key>", "Release key (GUID, from list command)").option("--feed-id <id>", "Feed ID for package lookup (optional)").option("--robot-ids <ids>", "Comma-separated robot IDs (optional)").option("--validate", "Validate inputs against process schema (basic: required fields + primitive types)").option("--login-validity <minutes>", "Minimum minutes before token expiration to trigger a refresh (default: 10)", parseInt, 10).trackedAction(processContext8, async (processKey, folderKey, options) => {
14220
+ processCmd.command("run").description("Run a Maestro process with inputs").argument("<process-key>", "Process key").argument("<folder-key>", "Folder key (GUID)").option("-i, --inputs <json>", "Input parameters as JSON string or @file.json").option("-t, --tenant <tenant-name>", "Tenant (optional, defaults to authenticated tenant)").option("--release-key <key>", "Release key (GUID, from list command)").option("--feed-id <id>", "Feed ID for package lookup (optional)").option("--robot-ids <ids>", "Comma-separated robot IDs (optional)").option("--validate", "Validate inputs against process schema (basic: required fields + primitive types)").option("--login-validity <minutes>", "Minimum minutes before token expiration to trigger a refresh (default: 10)", parseInt, 10).trackedAction(processContext9, async (processKey, folderKey, options) => {
14340
14221
  const [loginErr, loginStatus] = await catchError13(getLoginStatusAsync5({
14341
14222
  ensureTokenValidityMinutes: options.loginValidity
14342
14223
  }));
@@ -14346,7 +14227,7 @@ function registerProcessCommand(program) {
14346
14227
  Message: loginErr.message,
14347
14228
  Instructions: "Check authentication and parameters"
14348
14229
  });
14349
- processContext8.exit(1);
14230
+ processContext9.exit(1);
14350
14231
  return;
14351
14232
  }
14352
14233
  if (loginStatus.loginStatus !== "Logged in" || !loginStatus.baseUrl) {
@@ -14355,7 +14236,7 @@ function registerProcessCommand(program) {
14355
14236
  Message: "Not logged in. Run 'uip login' first.",
14356
14237
  Instructions: "Check authentication and parameters"
14357
14238
  });
14358
- processContext8.exit(1);
14239
+ processContext9.exit(1);
14359
14240
  return;
14360
14241
  }
14361
14242
  const tenantName = options.tenant || loginStatus.tenantName;
@@ -14365,7 +14246,7 @@ function registerProcessCommand(program) {
14365
14246
  Message: "Tenant not provided and not available from login. Use --tenant flag.",
14366
14247
  Instructions: "Check authentication and parameters"
14367
14248
  });
14368
- processContext8.exit(1);
14249
+ processContext9.exit(1);
14369
14250
  return;
14370
14251
  }
14371
14252
  if (!loginStatus.organizationId) {
@@ -14374,7 +14255,7 @@ function registerProcessCommand(program) {
14374
14255
  Message: "Organization ID not available from login.",
14375
14256
  Instructions: "Check authentication and parameters"
14376
14257
  });
14377
- processContext8.exit(1);
14258
+ processContext9.exit(1);
14378
14259
  return;
14379
14260
  }
14380
14261
  let inputs = {};
@@ -14386,7 +14267,7 @@ function registerProcessCommand(program) {
14386
14267
  Message: parseErr.message,
14387
14268
  Instructions: "Check authentication and parameters"
14388
14269
  });
14389
- processContext8.exit(1);
14270
+ processContext9.exit(1);
14390
14271
  return;
14391
14272
  }
14392
14273
  inputs = parsedInputs;
@@ -14398,7 +14279,7 @@ function registerProcessCommand(program) {
14398
14279
  Message: stdinErr.message,
14399
14280
  Instructions: "Check authentication and parameters"
14400
14281
  });
14401
- processContext8.exit(1);
14282
+ processContext9.exit(1);
14402
14283
  return;
14403
14284
  }
14404
14285
  if (stdinData) {
@@ -14409,7 +14290,7 @@ function registerProcessCommand(program) {
14409
14290
  Message: parseErr.message,
14410
14291
  Instructions: "Check authentication and parameters"
14411
14292
  });
14412
- processContext8.exit(1);
14293
+ processContext9.exit(1);
14413
14294
  return;
14414
14295
  }
14415
14296
  inputs = parsedInputs;
@@ -14435,7 +14316,7 @@ function registerProcessCommand(program) {
14435
14316
  Message: `Invalid robot-ids: ${options.robotIds}. Must be comma-separated numbers.`,
14436
14317
  Instructions: "Check authentication and parameters"
14437
14318
  });
14438
- processContext8.exit(1);
14319
+ processContext9.exit(1);
14439
14320
  return;
14440
14321
  }
14441
14322
  }
@@ -14447,7 +14328,7 @@ function registerProcessCommand(program) {
14447
14328
  Message: validateErr.message,
14448
14329
  Instructions: "Check authentication and parameters"
14449
14330
  });
14450
- processContext8.exit(1);
14331
+ processContext9.exit(1);
14451
14332
  return;
14452
14333
  }
14453
14334
  if (!validation.valid) {
@@ -14458,7 +14339,7 @@ function registerProcessCommand(program) {
14458
14339
  Message: "Input validation failed",
14459
14340
  Instructions: errorList || "Check required input fields"
14460
14341
  });
14461
- processContext8.exit(1);
14342
+ processContext9.exit(1);
14462
14343
  return;
14463
14344
  }
14464
14345
  logger10.info("Input validation passed");
@@ -14470,7 +14351,7 @@ function registerProcessCommand(program) {
14470
14351
  Message: jobErr.message,
14471
14352
  Instructions: "Check authentication and parameters"
14472
14353
  });
14473
- processContext8.exit(1);
14354
+ processContext9.exit(1);
14474
14355
  return;
14475
14356
  }
14476
14357
  OutputFormatter8.success({
@@ -14483,7 +14364,7 @@ function registerProcessCommand(program) {
14483
14364
  },
14484
14365
  Instructions: `Watch traces: uip maestro job traces ${job.key}`
14485
14366
  });
14486
- processContext8.exit(0);
14367
+ processContext9.exit(0);
14487
14368
  });
14488
14369
  }
14489
14370
  function parseEntryPointSchemas(ep) {
@@ -14499,10 +14380,10 @@ function parseEntryPointSchemas(ep) {
14499
14380
  }
14500
14381
 
14501
14382
  // src/commands/processes.ts
14502
- import { OutputFormatter as OutputFormatter9, processContext as processContext9 } from "@uipath/common";
14383
+ import { OutputFormatter as OutputFormatter9, processContext as processContext10 } from "@uipath/common";
14503
14384
  var registerProcessesCommand = (program) => {
14504
14385
  const processes = program.command("processes").description("Manage Maestro process summaries");
14505
- processes.command("list").description("List all process summaries").trackedAction(processContext9, async () => {
14386
+ processes.command("list").description("List all process summaries").trackedAction(processContext10, async () => {
14506
14387
  const result = await withPimsCall((config) => pimsGet(config, "/processes/summary"), "Error listing processes");
14507
14388
  if (!result)
14508
14389
  return;
@@ -14512,7 +14393,7 @@ var registerProcessesCommand = (program) => {
14512
14393
  Data: result
14513
14394
  });
14514
14395
  });
14515
- processes.command("incidents").description("Get incidents for a specific process").argument("<process-key>", "Process definition key").option("--folder-key <key>", "Folder key").trackedAction(processContext9, async (processKey, options) => {
14396
+ processes.command("incidents").description("Get incidents for a specific process").argument("<process-key>", "Process definition key").option("--folder-key <key>", "Folder key").trackedAction(processContext10, async (processKey, options) => {
14516
14397
  const reqOptions = { folderKey: options.folderKey };
14517
14398
  const result = await withPimsCall((config) => pimsGet(config, `/incidents/process/${processKey}`, reqOptions), "Error getting process incidents");
14518
14399
  if (!result)