@uipath/case-tool 1.204.0 → 1.205.0-preview.258

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.
Files changed (135) hide show
  1. package/dist/THIRD-PARTY-NOTICES.md +24 -11
  2. package/dist/{authoring-6ckkzfc9.js → authoring-kqh34zzm.js} +49 -30
  3. package/dist/{business-rule-export-kg5bk8aw.js → business-rule-export-ey588rv7.js} +2 -2
  4. package/dist/canvas-notes-86fxx1t8.js +19 -0
  5. package/dist/{case-api-rvamfn02.js → case-api-sme7esce.js} +6 -6
  6. package/dist/case-bindings-service-cht20gqt.js +430 -0
  7. package/dist/case-debug-solution-projects-h3w2nx0a.js +34 -0
  8. package/dist/{case-debug-studio-web-service-xxfesw4v.js → case-debug-studio-web-service-3mkrtaet.js} +16 -10
  9. package/dist/{case-described-io-service-14hdnqcc.js → case-described-io-service-dx1f4nxe.js} +37 -11
  10. package/dist/case-event-trigger-bindings-g9ftnm4x.js +16 -0
  11. package/dist/{case-format-service-yb48785t.js → case-format-service-6aew6tqc.js} +2 -2
  12. package/dist/{case-pack-service-9185h6ez.js → case-pack-service-pqq8wnfd.js} +6 -6
  13. package/dist/case-schema-version-h820ne16.js +20 -0
  14. package/dist/{case-shape-reader-mw58avr0.js → case-shape-reader-dsbraetf.js} +1 -1
  15. package/dist/{case-splice-service-tkmb7xjp.js → case-splice-service-s5gccctq.js} +53 -8
  16. package/dist/{case-validate-service-c84e2bhv.js → case-validate-service-rey6btew.js} +128 -42
  17. package/dist/{connector-enrichment-service-hfv0kwht.js → connector-enrichment-service-crqs2216.js} +23 -20
  18. package/dist/{connector-lookup-service-whgjceyj.js → connector-lookup-service-dwv8q5eh.js} +6 -6
  19. package/dist/connector-task-shape-mpazkf7s.js +14 -0
  20. package/dist/{connector-task-spec-k0cwavrm.js → connector-task-spec-trs4tcb3.js} +196 -40
  21. package/dist/{de-MUJPA4EB-dpg7t2rw.js → de-UZI7FJDO-mwvc4cxe.js} +29 -2
  22. package/dist/{de-FGHEJRCI-rv513mfh.js → de-WLW6KWOJ-2qnsqdtw.js} +238 -31
  23. package/dist/{debug-service-ch3v6jmm.js → debug-service-7q98j726.js} +3 -3
  24. package/dist/{embedded-file-reader-v8c2yj2a.js → embedded-file-reader-r66242ey.js} +2 -2
  25. package/dist/{en-FBPVNKFN-dqt573xn.js → en-EJCBA3LK-dtpdghgj.js} +12 -4
  26. package/dist/{en-BWGKA5OE-1qkvb9rn.js → en-M7GQYBV2-5nfmpnfz.js} +88 -6
  27. package/dist/{enrichment-service-3f1kygjs.js → enrichment-service-hv7ff88p.js} +56 -12
  28. package/dist/{es-7SE7HX2X-8yh1aj2y.js → es-4UBUTCQA-m1ytpyx2.js} +29 -2
  29. package/dist/{es-KR3ZSNMP-84zphx0x.js → es-5THCNRFN-tqwyrdgy.js} +235 -28
  30. package/dist/{es-MX-2MYFZU7X-3rek4r73.js → es-MX-5RELIXKI-9jhqtddc.js} +29 -2
  31. package/dist/{es-MX-XXZJGC4R-2mr8jtgm.js → es-MX-TWZBRAXK-gqd9swzw.js} +237 -30
  32. package/dist/filter-engine-7ep90g7f.js +11 -0
  33. package/dist/{fr-Y6NPVODW-8vr1ja4b.js → fr-CERONSRC-edpxhbmb.js} +237 -30
  34. package/dist/{fr-MDFKNZ4C-h4a122k9.js → fr-VBM5WRC2-63z7w4mh.js} +29 -2
  35. package/dist/index-332n0kxj.js +282 -0
  36. package/dist/{index-wmffgzmr.js → index-5dxh9z60.js} +21751 -11098
  37. package/dist/{index-aw2gqqat.js → index-a2fvrrth.js} +4 -4
  38. package/dist/{index-4yanx3rn.js → index-ekwtgx7y.js} +1089 -218
  39. package/dist/{index-ng2f77my.js → index-fyc0k5dd.js} +985 -617
  40. package/dist/index-n9qvnx4x.js +29 -0
  41. package/dist/{index-hhsf00x8.js → index-ngs0a2he.js} +1 -1
  42. package/dist/{index-j2r3jb6c.js → index-xq6ajhgq.js} +2 -2
  43. package/dist/index.js +12 -12
  44. package/dist/init-entry-points-hhpv3e3f.js +98 -0
  45. package/dist/{input-reader-1tcqt27f.js → input-reader-c7wz8ra2.js} +3 -3
  46. package/dist/{ja-UTQEAP34-8e0q6swp.js → ja-43QL7CGO-c3q8gre9.js} +29 -2
  47. package/dist/{ja-Q5PXKJ2V-p4msxzjd.js → ja-U2MCNHGT-gz0ap1jk.js} +235 -28
  48. package/dist/{known-types-0h9kqwyy.js → known-types-jvkdgmzz.js} +5 -4
  49. package/dist/{ko-AXCHW2OK-askct7f6.js → ko-TLL6Z6CD-wrt3n8a9.js} +29 -2
  50. package/dist/{ko-AYBDSRZG-41mdmsg1.js → ko-XAUYQWDR-zp81gjp4.js} +237 -30
  51. package/dist/localSolutionDiscovery-yyx234ak.js +13 -0
  52. package/dist/migration-diagnosis-ns5cw4e3.js +99 -0
  53. package/dist/{node-strategy-5pz40tee.js → node-strategy-v442hwgd.js} +1 -1
  54. package/dist/node-sync-service-1wkcyn1n.js +57 -0
  55. package/dist/out-target-wjgmna0r.js +111 -0
  56. package/dist/{packager-tool-85q4f3pq.js → packager-tool-1pcmxqny.js} +3 -3
  57. package/dist/{packager-tool-8a9yqfq7.js → packager-tool-1yfw674x.js} +4 -2
  58. package/dist/{packager-tool-pdhhzfr5.js → packager-tool-29x6vran.js} +296 -417
  59. package/dist/packager-tool-2sn7d8fd.js +41 -0
  60. package/dist/packager-tool-4p11fvf4.js +92 -0
  61. package/dist/{packager-tool-25hng8h4.js → packager-tool-4rtktkhv.js} +16211 -13084
  62. package/dist/{packager-tool-yfm83bzd.js → packager-tool-67vy1fz3.js} +4 -3
  63. package/dist/{packager-tool-d88rqwk8.js → packager-tool-6z1hsm2h.js} +13 -5
  64. package/dist/packager-tool-7hw344bt.js +107 -0
  65. package/dist/{packager-tool-3q3d1hk8.js → packager-tool-83v804p7.js} +56 -6
  66. package/dist/{packager-tool-00y70spr.js → packager-tool-87y6xw3a.js} +2 -1
  67. package/dist/packager-tool-93mdeqay.js +18 -0
  68. package/dist/{packager-tool-64rg5ekd.js → packager-tool-9e59z4d6.js} +75 -7
  69. package/dist/{packager-tool-vepqrsse.js → packager-tool-9kf3fqtr.js} +2 -2
  70. package/dist/packager-tool-9kvkzc05.js +74 -0
  71. package/dist/{packager-tool-s6619wtx.js → packager-tool-9sd483vs.js} +2 -2
  72. package/dist/{packager-tool-f78ntj5g.js → packager-tool-9y1w2wds.js} +51 -6
  73. package/dist/packager-tool-a17g0pj1.js +62 -0
  74. package/dist/{packager-tool-167qap9m.js → packager-tool-aagnvyba.js} +845 -38
  75. package/dist/{packager-tool-0p6dbsp0.js → packager-tool-c5q10254.js} +5 -5
  76. package/dist/{packager-tool-wj9d9mqe.js → packager-tool-e15kqpyh.js} +12 -13
  77. package/dist/{packager-tool-c31qx8kc.js → packager-tool-ezds6t5e.js} +2 -2
  78. package/dist/{packager-tool-d3zvghjd.js → packager-tool-f2z2dscy.js} +308 -120
  79. package/dist/{packager-tool-hvzjm2nk.js → packager-tool-f8vwy92w.js} +2093 -5805
  80. package/dist/{packager-tool-rgpdaxbx.js → packager-tool-gx2cer6a.js} +5385 -1098
  81. package/dist/{packager-tool-xdxr3ync.js → packager-tool-hdxtgckw.js} +11 -1
  82. package/dist/{packager-tool-mr149jsw.js → packager-tool-k5cpxdm4.js} +17 -7
  83. package/dist/packager-tool-k6jbedyc.js +69 -0
  84. package/dist/packager-tool-kdhey8gz.js +153 -0
  85. package/dist/{packager-tool-cenvh23g.js → packager-tool-kyrm4e5m.js} +718 -87
  86. package/dist/packager-tool-mqy97y5f.js +52 -0
  87. package/dist/{packager-tool-jfysbxdt.js → packager-tool-mzf4gmph.js} +4 -4
  88. package/dist/packager-tool-n7w9wx62.js +25 -0
  89. package/dist/{packager-tool-7q6z6npd.js → packager-tool-pcvhcn2k.js} +93 -11
  90. package/dist/packager-tool-r0x3qh59.js +307 -0
  91. package/dist/{packager-tool-w1b5pyj6.js → packager-tool-r6b5ktzb.js} +730 -14
  92. package/dist/{packager-tool-zbrda9sn.js → packager-tool-rk25wp3c.js} +1 -1
  93. package/dist/{packager-tool-xcd87qyx.js → packager-tool-v2kcgjbf.js} +2 -3
  94. package/dist/{case-bindings-service-d9vezn69.js → packager-tool-wekqkmgn.js} +20 -231
  95. package/dist/packager-tool-yct6zp4m.js +335 -0
  96. package/dist/{packager-tool-kpqr938m.js → packager-tool-ydyvtknp.js} +26 -3
  97. package/dist/{packager-tool-v99ygh9f.js → packager-tool-yn33pw57.js} +124 -58
  98. package/dist/{packager-tool-4rqd21wc.js → packager-tool-yn7r7zq2.js} +19 -5
  99. package/dist/{packager-tool-cmwets3m.js → packager-tool-zf8f9pmm.js} +1 -1
  100. package/dist/packager-tool.js +3 -3
  101. package/dist/{project-artifacts-rng5m6r2.js → project-artifacts-bgyyb0dm.js} +1 -1
  102. package/dist/{pt-BR-TKHNHMET-sn91xyq0.js → pt-BR-GNQNAAZ2-xadharv4.js} +237 -30
  103. package/dist/{pt-BR-Y6K6XHXK-mp3hwhw1.js → pt-BR-USP2T7GD-pedn77m1.js} +29 -2
  104. package/dist/{pt-3DIO5QWG-59b3f4bc.js → pt-RMIAKZB4-67enhx3m.js} +29 -2
  105. package/dist/{pt-ROXU257Y-2f6bxev4.js → pt-TO2DARY2-ftcce1bv.js} +237 -30
  106. package/dist/{resolved-check-p99hysaw.js → resolved-check-aqw7568y.js} +1 -1
  107. package/dist/{resourcesSyncService-zwjyp1qx.js → resourcesSyncService-d302jnap.js} +32 -170
  108. package/dist/{ro-BWR3ONRR-vzx3hy8a.js → ro-GHOBYW2S-mhnqsgaa.js} +29 -2
  109. package/dist/{ro-AVAWPKOO-b89pw79r.js → ro-WUYJV6OW-a8d9qy1n.js} +235 -28
  110. package/dist/{sdd-convert-service-vf0ps358.js → sdd-convert-service-8jpew7vz.js} +686 -445
  111. package/dist/{sdd-lookup-dwzpvvwn.js → sdd-lookup-fe900sdb.js} +2 -2
  112. package/dist/{sdd-resolve-service-mjqad2nn.js → sdd-resolve-service-qdtmxw9b.js} +38 -13
  113. package/dist/sdd-resolve-siblings-6kfxc2t6.js +53 -0
  114. package/dist/{solution-auth-kddmbm0p.js → solution-auth-30yycqtv.js} +3 -3
  115. package/dist/solution-discovery-g6ksnrg1.js +38 -0
  116. package/dist/{strict-case-rules-tz37bspw.js → strict-case-rules-4tjcaznr.js} +3 -2
  117. package/dist/{strict-entry-points-v14d7y50.js → strict-entry-points-g2pd4mf4.js} +29 -1
  118. package/dist/{strict-sdd-audit-4aqdeh59.js → strict-sdd-audit-q7tb9yj7.js} +7 -5
  119. package/dist/task-type-declaration-7a8fqdvs.js +46 -0
  120. package/dist/tool.js +12 -12
  121. package/dist/{tr-5IIHSFW5-hw4cewew.js → tr-GDTLECMM-k5fhmq13.js} +29 -2
  122. package/dist/{tr-JMIP7ZSL-c39b6pe4.js → tr-M3F5A6AU-bb0tg39m.js} +235 -28
  123. package/dist/{trigger-enrichment-service-g3vt051f.js → trigger-enrichment-service-sj0p2d1j.js} +23 -20
  124. package/dist/trigger-entry-point-id-yhqwnkx9.js +15 -0
  125. package/dist/{zh-CN-IFFXSEJS-9wm9gmrv.js → zh-CN-C5G4PC7C-ds9gkptg.js} +235 -28
  126. package/dist/{zh-CN-R2KU4U5L-tc1hat59.js → zh-CN-I5D7WHBD-sr5h0a98.js} +29 -2
  127. package/dist/{zh-TW-GNKMELBF-j674515r.js → zh-TW-2AVLM723-288pkc1z.js} +29 -2
  128. package/dist/{zh-TW-IYBNYAMG-8727c7v2.js → zh-TW-62HZIG6O-787kdwex.js} +234 -27
  129. package/package.json +2 -2
  130. package/dist/migration-diagnosis-ag2sgd1e.js +0 -71
  131. package/dist/node-sync-service-2tfrgbjs.js +0 -36
  132. package/dist/out-target-jakehnd3.js +0 -70
  133. package/dist/packager-tool-57pzrd0g.js +0 -32
  134. package/dist/packager-tool-dthjwajc.js +0 -13
  135. package/dist/packager-tool-xy04yy0v.js +0 -32
@@ -1,13 +1,22 @@
1
1
  import {
2
2
  resolveJsonInput
3
- } from "./packager-tool-jfysbxdt.js";
4
- import {
5
- getAuthContext
6
- } from "./packager-tool-v99ygh9f.js";
3
+ } from "./packager-tool-mzf4gmph.js";
7
4
  import {
8
5
  DEBUG_MODE_MAP,
9
- SIMULATION_MODE_MAP
10
- } from "./packager-tool-64rg5ekd.js";
6
+ SIMULATION_MODE_MAP,
7
+ beginDebugSession,
8
+ createDebugInstance,
9
+ debugPimsGet,
10
+ debugPimsPatch,
11
+ debugPimsPost,
12
+ debugPimsPut,
13
+ fetchDebugInstanceVariables,
14
+ getPersonalFolderKey
15
+ } from "./packager-tool-9e59z4d6.js";
16
+ import {
17
+ getAuthContext,
18
+ getLoginStatusAsync
19
+ } from "./packager-tool-yn33pw57.js";
11
20
  import {
12
21
  DEFAULT_PAGE_SIZE,
13
22
  EXIT_CODES,
@@ -23,30 +32,7 @@ import {
23
32
  parseLimit,
24
33
  parseOffset,
25
34
  processContext
26
- } from "./packager-tool-3q3d1hk8.js";
27
-
28
- // ../maestro-sdk/src/query-string.ts
29
- function buildQueryString(params) {
30
- const entries = [];
31
- for (const [key, value] of Object.entries(params)) {
32
- if (value === undefined)
33
- continue;
34
- if (Array.isArray(value)) {
35
- for (const item of value) {
36
- entries.push([key, item]);
37
- }
38
- continue;
39
- }
40
- entries.push([key, String(value)]);
41
- }
42
- if (entries.length === 0)
43
- return "";
44
- return `?${new URLSearchParams(entries).toString()}`;
45
- }
46
-
47
- // ../maestro-sdk/src/shared-commands/debug-instances.ts
48
- var VALID_DEBUG_MODES = Object.keys(DEBUG_MODE_MAP);
49
- var VALID_SIMULATION_MODES = Object.keys(SIMULATION_MODE_MAP);
35
+ } from "./packager-tool-83v804p7.js";
50
36
 
51
37
  // ../maestro-sdk/src/client.ts
52
38
  function parseBackendErrorBody(body) {
@@ -194,6 +180,820 @@ async function createPimsConfig() {
194
180
  };
195
181
  }
196
182
 
183
+ // ../maestro-sdk/src/query-string.ts
184
+ function buildQueryString(params) {
185
+ const entries = [];
186
+ for (const [key, value] of Object.entries(params)) {
187
+ if (value === undefined)
188
+ continue;
189
+ if (Array.isArray(value)) {
190
+ for (const item of value) {
191
+ entries.push([key, item]);
192
+ }
193
+ continue;
194
+ }
195
+ entries.push([key, String(value)]);
196
+ }
197
+ if (entries.length === 0)
198
+ return "";
199
+ return `?${new URLSearchParams(entries).toString()}`;
200
+ }
201
+
202
+ // ../maestro-sdk/src/with-debug-pims-call.ts
203
+ async function createDebugPimsConfig() {
204
+ const status = await getLoginStatusAsync({
205
+ ensureTokenValidityMinutes: 10
206
+ });
207
+ if (status.loginStatus !== "Logged in" || !status.baseUrl || !status.accessToken) {
208
+ throw new Error(status.hint ? `Not logged in. ${status.hint}` : "Not logged in. Run 'uip login' first.");
209
+ }
210
+ if (!status.organizationId) {
211
+ throw new Error("Organization ID not available. Ensure you are logged in with an organization context.");
212
+ }
213
+ if (!status.tenantId) {
214
+ throw new Error("Tenant ID not available. Ensure UIPATH_TENANT_ID is set.");
215
+ }
216
+ if (!status.tenantName) {
217
+ throw new Error("Tenant name not available. Ensure you are logged in with a tenant context.");
218
+ }
219
+ return {
220
+ baseUrl: status.baseUrl,
221
+ organizationId: status.organizationId,
222
+ tenantName: status.tenantName,
223
+ tenantId: status.tenantId,
224
+ authToken: status.accessToken
225
+ };
226
+ }
227
+ async function withDebugPimsCall(fn, errorMessage) {
228
+ const [configError, config] = await catchError(createDebugPimsConfig());
229
+ if (configError) {
230
+ logger.warn(`${errorMessage}: ${configError.message}`);
231
+ OutputFormatter.error({
232
+ Result: RESULTS.Failure,
233
+ Message: errorMessage,
234
+ Instructions: configError.message
235
+ });
236
+ processContext.exit(1);
237
+ return;
238
+ }
239
+ if (!config.folderKey) {
240
+ const [folderError, folder] = await catchError(getPersonalFolderKey(config));
241
+ if (folderError) {
242
+ logger.warn(`Could not resolve personal folder: ${folderError.message}`);
243
+ } else {
244
+ config.folderKey = folder.key;
245
+ config.organizationUnitId = folder.id;
246
+ }
247
+ }
248
+ const [error, result] = await catchError(fn(config));
249
+ if (error) {
250
+ const msg = await extractErrorMessage(error);
251
+ logger.warn(`${errorMessage}: ${msg}`);
252
+ OutputFormatter.error({
253
+ Result: RESULTS.Failure,
254
+ Message: errorMessage,
255
+ Instructions: msg
256
+ });
257
+ processContext.exit(1);
258
+ return;
259
+ }
260
+ return result;
261
+ }
262
+
263
+ // ../maestro-sdk/src/shared-commands/examples.ts
264
+ var INSTANCE = "f4a1c2b3-0000-4000-8000-000000000001";
265
+ var FOLDER = "b2c3d4e5-0000-4000-8000-000000000002";
266
+ var PROCESS = "c3d4e5f6-0000-4000-8000-000000000003";
267
+ var INCIDENT = "d4e5f6a7-0000-4000-8000-000000000004";
268
+ var ELEMENT = "Task_Review";
269
+ var SOLUTION = "e5f6a7b8-0000-4000-8000-000000000009";
270
+ var PROJECT = "f6a7b8c9-0000-4000-8000-00000000000a";
271
+ var operation = (verb, code, description, status) => (prefix) => ({
272
+ Description: description,
273
+ Command: `${prefix} instance ${verb} ${INSTANCE} --folder-key ${FOLDER}`,
274
+ Output: { Code: code, Data: { InstanceId: INSTANCE, Status: status } }
275
+ });
276
+ var EXAMPLES = {
277
+ "instance list": (prefix) => ({
278
+ Description: "List the faulted instances in a folder",
279
+ Command: `${prefix} instance list --folder-key ${FOLDER} --status Faulted --limit 2`,
280
+ Output: {
281
+ Code: "InstanceList",
282
+ Data: [
283
+ {
284
+ InstanceId: INSTANCE,
285
+ InstanceDisplayName: "Claim 1042",
286
+ ProcessKey: PROCESS,
287
+ PackageVersion: "1.0.3",
288
+ LatestRunStatus: "Faulted",
289
+ StartedTime: "2026-10-13T09:12:00Z"
290
+ }
291
+ ]
292
+ }
293
+ }),
294
+ "instance get": (prefix) => ({
295
+ Description: "Get one instance and its latest run",
296
+ Command: `${prefix} instance get ${INSTANCE} --folder-key ${FOLDER}`,
297
+ Output: {
298
+ Code: "InstanceGet",
299
+ Data: {
300
+ InstanceId: INSTANCE,
301
+ InstanceDisplayName: "Claim 1042",
302
+ ProcessKey: PROCESS,
303
+ PackageVersion: "1.0.3",
304
+ LatestRunStatus: "Running",
305
+ StartedTime: "2026-10-13T09:12:00Z",
306
+ CompletedTime: null
307
+ }
308
+ }
309
+ }),
310
+ "instance pause": operation("pause", "InstancePaused", "Pause a running instance", "Paused"),
311
+ "instance resume": operation("resume", "InstanceResumed", "Resume a paused instance", "Running"),
312
+ "instance cancel": operation("cancel", "InstanceCanceled", "Cancel an instance", "Canceling"),
313
+ "instance retry": operation("retry", "InstanceRetried", "Retry a faulted instance from where it failed", "Running"),
314
+ "instance variables": (prefix) => ({
315
+ Description: "Read an instance's variables",
316
+ Command: `${prefix} instance variables ${INSTANCE} --folder-key ${FOLDER}`,
317
+ Output: {
318
+ Code: "InstanceVariables",
319
+ Data: {
320
+ InstanceId: INSTANCE,
321
+ ParentElementId: null,
322
+ GlobalVariables: [
323
+ {
324
+ Id: "claimAmount",
325
+ Name: "claimAmount",
326
+ Type: "number",
327
+ Value: 1200,
328
+ ElementId: "root",
329
+ Source: "=vars.claimAmount"
330
+ }
331
+ ],
332
+ Elements: []
333
+ }
334
+ }
335
+ }),
336
+ "instance variables-all": (prefix) => ({
337
+ Description: "Read the variables of every scope in an instance",
338
+ Command: `${prefix} instance variables-all ${INSTANCE} --folder-key ${FOLDER}`,
339
+ Output: {
340
+ Code: "InstanceVariablesAll",
341
+ Data: {
342
+ Variables: [
343
+ {
344
+ InstanceId: INSTANCE,
345
+ ParentElementId: null,
346
+ GlobalVariables: [],
347
+ Elements: []
348
+ }
349
+ ]
350
+ }
351
+ }
352
+ }),
353
+ "instance global-variables": (prefix) => ({
354
+ Description: "Read an instance's global variables",
355
+ Command: `${prefix} instance global-variables ${INSTANCE} --folder-key ${FOLDER}`,
356
+ Output: {
357
+ Code: "InstanceGlobalVariables",
358
+ Data: {
359
+ InstanceId: INSTANCE,
360
+ Globals: { claimAmount: 1200 },
361
+ Count: 1,
362
+ RetrievedAt: "2026-10-13T09:20:00Z"
363
+ }
364
+ }
365
+ }),
366
+ "instance variables-set": (prefix) => ({
367
+ Description: "Patch variables on a running instance from a file",
368
+ Command: `${prefix} instance variables-set ${INSTANCE} --folder-key ${FOLDER} --inputs @patch.json`,
369
+ Output: {
370
+ Code: "InstanceVariablesSet",
371
+ Data: {}
372
+ }
373
+ }),
374
+ "instance incidents": (prefix) => ({
375
+ Description: "List the incidents an instance raised",
376
+ Command: `${prefix} instance incidents ${INSTANCE} --folder-key ${FOLDER}`,
377
+ Output: {
378
+ Code: "InstanceIncidents",
379
+ Data: [
380
+ {
381
+ IncidentId: INCIDENT,
382
+ InstanceId: INSTANCE,
383
+ ElementId: ELEMENT,
384
+ IncidentStatus: "Open",
385
+ ErrorCode: "TaskFailed",
386
+ ErrorMessage: "The action app returned an error"
387
+ }
388
+ ]
389
+ }
390
+ }),
391
+ "instance asset": (prefix) => ({
392
+ Description: "Get the asset an instance runs",
393
+ Command: `${prefix} instance asset ${INSTANCE} --folder-key ${FOLDER}`,
394
+ Output: { Code: "InstanceAsset", Data: {} }
395
+ }),
396
+ "instance migrate": (prefix) => ({
397
+ Description: "Move an instance to a newer package version",
398
+ Command: `${prefix} instance migrate ${INSTANCE} 1.0.4 --folder-key ${FOLDER} --comment "Fix review step"`,
399
+ Output: {
400
+ Code: "InstanceMigrated",
401
+ Data: { InstanceId: INSTANCE, Status: "Running" }
402
+ }
403
+ }),
404
+ "instance goto": (prefix) => ({
405
+ Description: "Move an instance's cursor from one element to another",
406
+ Command: `${prefix} instance goto ${INSTANCE} '[{"sourceElementId":"${ELEMENT}","targetElementId":"Task_Approve"}]' --folder-key ${FOLDER}`,
407
+ Output: {
408
+ Code: "InstanceGoto",
409
+ Data: { InstanceId: INSTANCE, Status: "Running" }
410
+ }
411
+ }),
412
+ "instance cursors": (prefix) => ({
413
+ Description: "List the elements an instance is currently at",
414
+ Command: `${prefix} instance cursors ${INSTANCE} --folder-key ${FOLDER}`,
415
+ Output: {
416
+ Code: "InstanceCursors",
417
+ Data: { ElementIds: [ELEMENT] }
418
+ }
419
+ }),
420
+ "instance message send": (prefix) => ({
421
+ Description: "Send a message to the instances waiting for it",
422
+ Command: `${prefix} instance message send --folder-key ${FOLDER} --inputs @message.json`,
423
+ Output: {
424
+ Code: "MessageSent",
425
+ Data: {
426
+ Id: "e5f6a7b8-0000-4000-8000-000000000005",
427
+ JobId: "f6a7b8c9-0000-4000-8000-000000000006"
428
+ }
429
+ }
430
+ }),
431
+ "instance element-executions": (prefix) => ({
432
+ Description: "List how each element of an instance ran",
433
+ Command: `${prefix} instance element-executions ${INSTANCE} --folder-key ${FOLDER}`,
434
+ Output: {
435
+ Code: "InstanceElementExecutions",
436
+ Data: {
437
+ InstanceId: INSTANCE,
438
+ ProcessKey: PROCESS,
439
+ Status: "Running",
440
+ ElementExecutions: [
441
+ {
442
+ ElementId: ELEMENT,
443
+ ElementType: "UserTask",
444
+ Status: "Completed",
445
+ StartedTimeUtc: "2026-10-13T09:12:05Z"
446
+ }
447
+ ]
448
+ }
449
+ }
450
+ }),
451
+ "instance element cancel": (prefix) => ({
452
+ Description: "Cancel one running element of an instance",
453
+ Command: `${prefix} instance element cancel ${INSTANCE} ${ELEMENT} --folder-key ${FOLDER}`,
454
+ Output: {
455
+ Code: "ElementCanceled",
456
+ Data: { InstanceId: INSTANCE, Status: "Running" }
457
+ }
458
+ }),
459
+ "instance element retry": (prefix) => ({
460
+ Description: "Retry one faulted element of an instance",
461
+ Command: `${prefix} instance element retry ${INSTANCE} ${ELEMENT} --folder-key ${FOLDER}`,
462
+ Output: {
463
+ Code: "ElementRetried",
464
+ Data: { InstanceId: INSTANCE, Status: "Running" }
465
+ }
466
+ }),
467
+ "incident summary": (prefix) => ({
468
+ Description: "Summarize the open incidents in a folder by error",
469
+ Command: `${prefix} incident summary --folder-key ${FOLDER} --limit 2`,
470
+ Output: {
471
+ Code: "IncidentSummary",
472
+ Data: [
473
+ {
474
+ ProcessKey: PROCESS,
475
+ ErrorCode: "TaskFailed",
476
+ ErrorMessage: "The action app returned an error",
477
+ Count: 3,
478
+ FirstTimeUtc: "2026-10-12T15:02:00Z"
479
+ }
480
+ ]
481
+ }
482
+ }),
483
+ "incident get": (prefix) => ({
484
+ Description: "Get one incident with its error details",
485
+ Command: `${prefix} incident get ${INCIDENT} --folder-key ${FOLDER}`,
486
+ Output: {
487
+ Code: "IncidentGet",
488
+ Data: {
489
+ IncidentId: INCIDENT,
490
+ InstanceId: INSTANCE,
491
+ ProcessKey: PROCESS,
492
+ IncidentStatus: "Open",
493
+ ElementId: ELEMENT,
494
+ ErrorCode: "TaskFailed",
495
+ ErrorMessage: "The action app returned an error",
496
+ ErrorTime: "2026-10-12T15:02:00Z"
497
+ }
498
+ }
499
+ }),
500
+ "process settings get": (prefix) => ({
501
+ Description: "Read a process's settings",
502
+ Command: `${prefix} process settings get ${PROCESS} --folder-key ${FOLDER}`,
503
+ Output: {
504
+ Code: "ProcessSettingsGet",
505
+ Data: {
506
+ VariableTags: {
507
+ Elements: {},
508
+ SourcePackageVersion: "1.0.3",
509
+ LastUpdateTimeUtc: "2026-10-12T15:00:00Z"
510
+ }
511
+ }
512
+ }
513
+ }),
514
+ "process settings set": (prefix) => ({
515
+ Description: "Replace a process's settings from a file",
516
+ Command: `${prefix} process settings set ${PROCESS} --folder-key ${FOLDER} --inputs @settings.json`,
517
+ Output: {
518
+ Code: "ProcessSettingsSet",
519
+ Data: {}
520
+ }
521
+ }),
522
+ "process variable-tags get": (prefix) => ({
523
+ Description: "Read which variables are tagged for instance search",
524
+ Command: `${prefix} process variable-tags get ${PROCESS} --folder-key ${FOLDER}`,
525
+ Output: {
526
+ Code: "ProcessVariableTagsGet",
527
+ Data: {
528
+ Elements: {},
529
+ SourcePackageVersion: "1.0.3",
530
+ LastUpdateTimeUtc: "2026-10-12T15:00:00Z"
531
+ }
532
+ }
533
+ }),
534
+ "process variable-tags set": (prefix) => ({
535
+ Description: "Make a variable searchable when filtering instances",
536
+ Command: `${prefix} process variable-tags set ${PROCESS} --folder-key ${FOLDER} --variable claimAmount --searchable true`,
537
+ Output: {
538
+ Code: "ProcessVariableTagsSet",
539
+ Data: {
540
+ Updated: [
541
+ {
542
+ ElementId: ELEMENT,
543
+ Name: "claimAmount",
544
+ Tags: ["Searchable"]
545
+ }
546
+ ],
547
+ VariableTags: {
548
+ Elements: {
549
+ [ELEMENT]: {
550
+ Outputs: [
551
+ {
552
+ Name: "claimAmount",
553
+ Tags: ["Searchable"],
554
+ ExtractPath: "claimAmount",
555
+ Label: "Claim amount",
556
+ ExtractedValueType: "number"
557
+ }
558
+ ]
559
+ }
560
+ },
561
+ SourcePackageVersion: "1.0.3",
562
+ LastUpdateTimeUtc: "2026-10-12T15:00:00Z"
563
+ }
564
+ }
565
+ }
566
+ }),
567
+ "processes list": (prefix) => ({
568
+ Description: "List processes with their running and faulted counts",
569
+ Command: `${prefix} processes list --folder-key ${FOLDER} --limit 2`,
570
+ Output: {
571
+ Code: "ProcessList",
572
+ Data: {
573
+ Processes: [
574
+ { ProcessKey: PROCESS, RunningCount: 4, FaultedCount: 1 }
575
+ ]
576
+ }
577
+ }
578
+ }),
579
+ "processes incidents": (prefix) => ({
580
+ Description: "List a process's incidents",
581
+ Command: `${prefix} processes incidents ${PROCESS} --folder-key ${FOLDER}`,
582
+ Output: {
583
+ Code: "ProcessIncidents",
584
+ Data: [
585
+ {
586
+ IncidentId: INCIDENT,
587
+ InstanceId: INSTANCE,
588
+ ProcessKey: PROCESS,
589
+ ElementId: ELEMENT,
590
+ IncidentStatus: "Open",
591
+ ErrorCode: "TaskFailed",
592
+ ErrorMessage: "The action app returned an error"
593
+ }
594
+ ]
595
+ }
596
+ }),
597
+ "processes diagnose": (prefix) => ({
598
+ Description: "Diagnose why a process's instances fault",
599
+ Command: `${prefix} processes diagnose ${PROCESS} --folder-key ${FOLDER}`,
600
+ Output: {
601
+ Code: "ProcessDiagnostics",
602
+ Data: {
603
+ ProcessKey: PROCESS,
604
+ FolderKey: FOLDER,
605
+ Summary: {
606
+ ProcessKey: PROCESS,
607
+ RunningCount: 4,
608
+ FaultedCount: 1
609
+ },
610
+ FaultedCount: 1,
611
+ RunningCount: 4,
612
+ Incidents: [
613
+ {
614
+ IncidentId: INCIDENT,
615
+ InstanceId: INSTANCE,
616
+ ElementId: ELEMENT,
617
+ ErrorCode: "TaskFailed"
618
+ }
619
+ ],
620
+ IncidentCount: 1,
621
+ ErrorCodes: [
622
+ {
623
+ ErrorCode: "TaskFailed",
624
+ ErrorMessage: "The action app returned an error"
625
+ }
626
+ ],
627
+ ErrorCodeCount: 1
628
+ }
629
+ }
630
+ }),
631
+ "processes error-codes": (prefix) => ({
632
+ Description: "List the error codes a process's incidents carry",
633
+ Command: `${prefix} processes error-codes ${PROCESS} --folder-key ${FOLDER}`,
634
+ Output: {
635
+ Code: "ProcessIncidentErrorCodes",
636
+ Data: [
637
+ {
638
+ ErrorCode: "TaskFailed",
639
+ ErrorMessage: "The action app returned an error"
640
+ }
641
+ ]
642
+ }
643
+ }),
644
+ "debug-instance create": (prefix) => ({
645
+ Description: "Start a debug run of an uploaded solution's entry point",
646
+ Command: `${prefix} debug-instance create --solution-id ${SOLUTION} --project-id ${PROJECT} --entry-point "/Main.bpmn#start" --debug-mode StepByStep`,
647
+ Output: {
648
+ Code: "DebugInstanceCreated",
649
+ Data: {
650
+ InstanceId: INSTANCE,
651
+ RunId: "a7b8c9d0-0000-4000-8000-000000000007",
652
+ JobKey: "b8c9d0e1-0000-4000-8000-000000000008"
653
+ }
654
+ }
655
+ }),
656
+ "debug-instance status": (prefix) => ({
657
+ Description: "Check where a debug run is",
658
+ Command: `${prefix} debug-instance status ${INSTANCE}`,
659
+ Output: {
660
+ Code: "DebugInstanceStatus",
661
+ Data: {
662
+ InstanceId: INSTANCE,
663
+ Status: "Paused",
664
+ StartedTimeUtc: "2026-10-13T09:12:00Z",
665
+ CompletedTimeUtc: null
666
+ }
667
+ }
668
+ }),
669
+ "debug-instance breakpoints": (prefix) => ({
670
+ Description: "Replace a debug run's breakpoints from a file",
671
+ Command: `${prefix} debug-instance breakpoints ${INSTANCE} --inputs @breakpoints.json`,
672
+ Output: {
673
+ Code: "DebugInstanceBreakpointsUpdated",
674
+ Data: {}
675
+ }
676
+ }),
677
+ "debug-instance cancel": (prefix) => ({
678
+ Description: "Stop a debug run",
679
+ Command: `${prefix} debug-instance cancel ${INSTANCE}`,
680
+ Output: {
681
+ Code: "DebugInstanceCanceled",
682
+ Data: {}
683
+ }
684
+ }),
685
+ "debug-instance continue": (prefix) => ({
686
+ Description: "Continue a paused debug run",
687
+ Command: `${prefix} debug-instance continue ${INSTANCE}`,
688
+ Output: {
689
+ Code: "DebugInstanceContinued",
690
+ Data: {}
691
+ }
692
+ }),
693
+ "debug-instance incidents": (prefix) => ({
694
+ Description: "List the incidents a debug run raised",
695
+ Command: `${prefix} debug-instance incidents ${INSTANCE}`,
696
+ Output: {
697
+ Code: "DebugInstanceIncidents",
698
+ Data: [
699
+ {
700
+ IncidentId: INCIDENT,
701
+ ElementId: ELEMENT,
702
+ ErrorCode: "TaskFailed"
703
+ }
704
+ ]
705
+ }
706
+ }),
707
+ "debug-instance variables": (prefix) => ({
708
+ Description: "Read a paused debug run's variables",
709
+ Command: `${prefix} debug-instance variables ${INSTANCE}`,
710
+ Output: {
711
+ Code: "DebugInstanceVariables",
712
+ Data: { InstanceId: INSTANCE, Globals: {}, Elements: [] }
713
+ }
714
+ }),
715
+ "debug-instance variables-set": (prefix) => ({
716
+ Description: "Patch a paused debug run's variables from a file",
717
+ Command: `${prefix} debug-instance variables-set ${INSTANCE} --inputs @patch.json`,
718
+ Output: {
719
+ Code: "DebugInstanceVariablesSet",
720
+ Data: {}
721
+ }
722
+ }),
723
+ "debug-instance variables-all": (prefix) => ({
724
+ Description: "Read the variables of every scope in a debug run",
725
+ Command: `${prefix} debug-instance variables-all ${INSTANCE}`,
726
+ Output: {
727
+ Code: "DebugInstanceVariablesAll",
728
+ Data: { Variables: [] }
729
+ }
730
+ })
731
+ };
732
+ var pathOf = (command) => {
733
+ const names = [];
734
+ for (let at = command;at !== null; at = at.parent) {
735
+ if (at.parent === null)
736
+ break;
737
+ names.unshift(at.name());
738
+ }
739
+ return ["uip", ...names];
740
+ };
741
+ var attachSharedExamples = (group) => {
742
+ const visit = (command) => {
743
+ if (command.commands.length > 0) {
744
+ for (const child of command.commands)
745
+ visit(child);
746
+ return;
747
+ }
748
+ const path = pathOf(command);
749
+ for (let words = 3;words >= 2; words -= 1) {
750
+ const key = path.slice(-words).join(" ");
751
+ const example = EXAMPLES[key];
752
+ if (example === undefined)
753
+ continue;
754
+ const prefix = path.slice(0, path.length - words).join(" ");
755
+ command.examples([example(prefix)]);
756
+ return;
757
+ }
758
+ };
759
+ visit(group);
760
+ };
761
+
762
+ // ../maestro-sdk/src/shared-commands/debug-instances.ts
763
+ var DEBUG_API_PREFIX = "/api/v1/debug-instances";
764
+ var VALID_DEBUG_MODES = Object.keys(DEBUG_MODE_MAP);
765
+ var VALID_SIMULATION_MODES = Object.keys(SIMULATION_MODE_MAP);
766
+ var registerSharedDebugInstanceCommands = (program, config) => {
767
+ const { toolLabel } = config;
768
+ const debugInstance = program.command("debug-instance").description(`Manage ${toolLabel} debug instance operations`);
769
+ debugInstance.command("create").description(`Create a ${toolLabel} debug instance from an already-uploaded solution`).requiredOption("--solution-id <id>", "Solution ID (from a previous upload or Studio Web)").requiredOption("--project-id <id>", "Studio Web project ID within the solution").requiredOption("--entry-point <path>", 'Entry point path (e.g. "/Main.bpmn#start")').option("--process-type <type>", "Process type", "processOrchestration").option("--debug-mode <mode>", "Debug mode: Default (pause at breakpoints), StepByStep (pause at every step), SingleStep (one step only)", "Default").option("--simulation-mode <mode>", "Simulation mode: None, All (simulate all elements), Selective (simulate except opt-outs)", "None").option("-i, --inputs <json>", "Input arguments as JSON string", "{}").trackedAction(processContext, async (options) => {
770
+ if (!VALID_DEBUG_MODES.includes(options.debugMode)) {
771
+ OutputFormatter.error({
772
+ Result: RESULTS.Failure,
773
+ Message: `Invalid --debug-mode "${options.debugMode}". Valid values: ${VALID_DEBUG_MODES.join(", ")}.`,
774
+ Instructions: ""
775
+ });
776
+ processContext.exit(1);
777
+ return;
778
+ }
779
+ if (!VALID_SIMULATION_MODES.includes(options.simulationMode)) {
780
+ OutputFormatter.error({
781
+ Result: RESULTS.Failure,
782
+ Message: `Invalid --simulation-mode "${options.simulationMode}". Valid values: ${VALID_SIMULATION_MODES.join(", ")}.`,
783
+ Instructions: ""
784
+ });
785
+ processContext.exit(1);
786
+ return;
787
+ }
788
+ const [configError, config2] = await catchError(createDebugPimsConfig());
789
+ if (configError) {
790
+ OutputFormatter.error({
791
+ Result: RESULTS.Failure,
792
+ Message: "Error creating debug instance",
793
+ Instructions: configError.message
794
+ });
795
+ processContext.exit(1);
796
+ return;
797
+ }
798
+ const [folderError, folder] = await catchError(getPersonalFolderKey(config2));
799
+ if (folderError) {
800
+ OutputFormatter.error({
801
+ Result: RESULTS.Failure,
802
+ Message: "Error getting personal workspace folder",
803
+ Instructions: folderError.message
804
+ });
805
+ processContext.exit(1);
806
+ return;
807
+ }
808
+ config2.folderKey = folder.key;
809
+ config2.organizationUnitId = folder.id;
810
+ const [sessionError, session] = await catchError(beginDebugSession(config2, options.inputs));
811
+ if (sessionError) {
812
+ OutputFormatter.error({
813
+ Result: RESULTS.Failure,
814
+ Message: "Error beginning debug session",
815
+ Instructions: sessionError.message
816
+ });
817
+ processContext.exit(1);
818
+ return;
819
+ }
820
+ const [createError, result] = await catchError(createDebugInstance(config2, session.jobKey, options.solutionId, options.projectId, options.entryPoint, options.processType, options.debugMode, options.simulationMode));
821
+ if (createError) {
822
+ OutputFormatter.error({
823
+ Result: RESULTS.Failure,
824
+ Message: "Error creating debug instance",
825
+ Instructions: createError.message
826
+ });
827
+ processContext.exit(1);
828
+ return;
829
+ }
830
+ OutputFormatter.success({
831
+ Result: RESULTS.Success,
832
+ Code: "DebugInstanceCreated",
833
+ Data: {
834
+ instanceId: result.instanceId,
835
+ runId: result.runId,
836
+ jobKey: session.jobKey
837
+ },
838
+ Instructions: "Use 'debug-instance status <instance-id>' to check the run. Use 'debug-instance incidents <instance-id>' or 'debug-instance variables <instance-id>' to inspect it."
839
+ });
840
+ });
841
+ debugInstance.command("status").description(`Get the current status of a ${toolLabel} debug instance`).argument("<instance-id>", "Debug instance ID").trackedAction(processContext, async (instanceId) => {
842
+ const result = await withDebugPimsCall((cfg) => debugPimsGet(cfg, `${DEBUG_API_PREFIX}/${instanceId}/element-executions`, "get-debug-instance-status"), "Error getting debug instance status");
843
+ if (!result)
844
+ return;
845
+ OutputFormatter.success({
846
+ Result: RESULTS.Success,
847
+ Code: "DebugInstanceStatus",
848
+ Data: result
849
+ });
850
+ });
851
+ debugInstance.command("breakpoints").description(`Update breakpoints for a ${toolLabel} debug instance`).argument("<instance-id>", "Debug instance ID").option("--inputs <value>", "Breakpoints payload as JSON string, @file path, or piped via stdin").trackedAction(processContext, async (instanceId, options) => {
852
+ const [readError, data] = await catchError(resolveJsonInput({
853
+ inline: options.inputs,
854
+ allowStdin: true
855
+ }));
856
+ if (readError) {
857
+ OutputFormatter.error({
858
+ Result: RESULTS.Failure,
859
+ Message: "Error reading breakpoints input",
860
+ Instructions: readError.message
861
+ });
862
+ processContext.exit(1);
863
+ return;
864
+ }
865
+ const body = data ?? {
866
+ breakpoints: []
867
+ };
868
+ const result = await withDebugPimsCall((cfg) => debugPimsPut(cfg, `${DEBUG_API_PREFIX}/${instanceId}/breakpoints`, body), "Error updating breakpoints");
869
+ if (!result)
870
+ return;
871
+ OutputFormatter.success({
872
+ Result: RESULTS.Success,
873
+ Code: "DebugInstanceBreakpointsUpdated",
874
+ Data: result
875
+ });
876
+ });
877
+ debugInstance.command("cancel").description(`Cancel a ${toolLabel} debug instance`).argument("<instance-id>", "Debug instance ID").trackedAction(processContext, async (instanceId) => {
878
+ const result = await withDebugPimsCall((cfg) => debugPimsPost(cfg, `${DEBUG_API_PREFIX}/${instanceId}/cancel`, { comment: "" }), "Error canceling debug instance");
879
+ if (!result)
880
+ return;
881
+ OutputFormatter.success({
882
+ Result: RESULTS.Success,
883
+ Code: "DebugInstanceCanceled",
884
+ Data: result
885
+ });
886
+ });
887
+ debugInstance.command("continue").description(`Continue execution on a paused ${toolLabel} debug instance`).argument("<instance-id>", "Debug instance ID").option("--inputs <value>", "Continue payload as JSON string, @file path, or piped via stdin").trackedAction(processContext, async (instanceId, options) => {
888
+ const [readError, data] = await catchError(resolveJsonInput({
889
+ inline: options.inputs,
890
+ allowStdin: true
891
+ }));
892
+ if (readError) {
893
+ OutputFormatter.error({
894
+ Result: RESULTS.Failure,
895
+ Message: "Error reading continue input",
896
+ Instructions: readError.message
897
+ });
898
+ processContext.exit(1);
899
+ return;
900
+ }
901
+ const body = data ?? {
902
+ nextStep: false
903
+ };
904
+ const result = await withDebugPimsCall((cfg) => debugPimsPost(cfg, `${DEBUG_API_PREFIX}/${instanceId}/continue`, body), "Error continuing debug instance");
905
+ if (!result)
906
+ return;
907
+ OutputFormatter.success({
908
+ Result: RESULTS.Success,
909
+ Code: "DebugInstanceContinued",
910
+ Data: result
911
+ });
912
+ });
913
+ debugInstance.command("incidents").description(`Get incidents for a ${toolLabel} debug instance`).argument("<instance-id>", "Debug instance ID").trackedAction(processContext, async (instanceId) => {
914
+ const result = await withDebugPimsCall((cfg) => debugPimsGet(cfg, `${DEBUG_API_PREFIX}/${instanceId}/incidents`), "Error getting debug instance incidents");
915
+ if (!result)
916
+ return;
917
+ OutputFormatter.success({
918
+ Result: RESULTS.Success,
919
+ Code: "DebugInstanceIncidents",
920
+ Data: result ?? []
921
+ });
922
+ });
923
+ debugInstance.command("variables").description(`Get variables for a ${toolLabel} debug instance`).argument("<instance-id>", "Debug instance ID").option("--parent-element-id <id>", "Filter variables by parent element ID").option("--expected-outputs <ids...>", "Output variable ids the record must define; retried until it does, failed if it never does").trackedAction(processContext, async (instanceId, options) => {
924
+ const expectGlobals = options.expectedOutputs ?? [];
925
+ if (expectGlobals.length > 0 && options.parentElementId !== undefined) {
926
+ OutputFormatter.error({
927
+ Result: RESULTS.Failure,
928
+ Message: "--expected-outputs cannot be combined with --parent-element-id",
929
+ Instructions: "Drop --parent-element-id: --expected-outputs checks the instance's root variables record."
930
+ });
931
+ processContext.exit(1);
932
+ return;
933
+ }
934
+ const query = buildQueryString({
935
+ parentElementId: options.parentElementId
936
+ });
937
+ const result = await withDebugPimsCall((cfg) => expectGlobals.length > 0 ? fetchDebugInstanceVariables(cfg, instanceId, {
938
+ expectGlobals
939
+ }) : debugPimsGet(cfg, `${DEBUG_API_PREFIX}/${instanceId}/variables${query}`), "Error getting debug instance variables");
940
+ if (!result)
941
+ return;
942
+ OutputFormatter.success({
943
+ Result: RESULTS.Success,
944
+ Code: "DebugInstanceVariables",
945
+ Data: result
946
+ });
947
+ });
948
+ debugInstance.command("variables-set").description(`Update variables for a ${toolLabel} debug instance`).argument("<instance-id>", "Debug instance ID").option("--inputs <value>", "Patch variables payload as JSON string, @file path, or piped via stdin").option("--parent-element-id <id>", "Filter by parent element ID").trackedAction(processContext, async (instanceId, options) => {
949
+ const [readError, data] = await catchError(resolveJsonInput({
950
+ inline: options.inputs,
951
+ allowStdin: true
952
+ }));
953
+ if (readError) {
954
+ OutputFormatter.error({
955
+ Result: RESULTS.Failure,
956
+ Message: "Error reading variables payload",
957
+ Instructions: readError.message
958
+ });
959
+ processContext.exit(1);
960
+ return;
961
+ }
962
+ if (data === undefined) {
963
+ OutputFormatter.error({
964
+ Result: RESULTS.Failure,
965
+ Message: "Missing variables payload",
966
+ Instructions: "Provide --inputs <json|@file> or pipe JSON via stdin."
967
+ });
968
+ processContext.exit(1);
969
+ return;
970
+ }
971
+ const body = data;
972
+ const query = buildQueryString({
973
+ parentElementId: options.parentElementId
974
+ });
975
+ const result = await withDebugPimsCall((cfg) => debugPimsPatch(cfg, `${DEBUG_API_PREFIX}/${instanceId}/variables${query}`, body), "Error updating debug instance variables");
976
+ if (!result)
977
+ return;
978
+ OutputFormatter.success({
979
+ Result: RESULTS.Success,
980
+ Code: "DebugInstanceVariablesSet",
981
+ Data: result
982
+ });
983
+ });
984
+ debugInstance.command("variables-all").description(`Get all variables including subprocesses for a ${toolLabel} debug instance`).argument("<instance-id>", "Debug instance ID").trackedAction(processContext, async (instanceId) => {
985
+ const result = await withDebugPimsCall((cfg) => debugPimsGet(cfg, `${DEBUG_API_PREFIX}/${instanceId}/variables-all`), "Error getting all debug instance variables");
986
+ if (!result)
987
+ return;
988
+ OutputFormatter.success({
989
+ Result: RESULTS.Success,
990
+ Code: "DebugInstanceVariablesAll",
991
+ Data: result
992
+ });
993
+ });
994
+ attachSharedExamples(debugInstance);
995
+ };
996
+
197
997
  // ../maestro-sdk/src/with-pims-call.ts
198
998
  var NETWORK_ERROR_CODES = new Set([
199
999
  "ECONNREFUSED",
@@ -386,6 +1186,7 @@ var registerSharedIncidentCommands = (program, config) => {
386
1186
  Data: result
387
1187
  });
388
1188
  });
1189
+ attachSharedExamples(incident);
389
1190
  };
390
1191
 
391
1192
  // ../maestro-sdk/src/instance-status.ts
@@ -798,6 +1599,7 @@ var registerSharedInstanceCommands = (program, config) => {
798
1599
  Data: result
799
1600
  });
800
1601
  });
1602
+ attachSharedExamples(instances);
801
1603
  };
802
1604
 
803
1605
  // ../maestro-sdk/src/shared-commands/process.ts
@@ -1040,14 +1842,19 @@ var registerSharedProcessCommands = (processCmd, config) => {
1040
1842
  }
1041
1843
  await setVariableTagsFromPayload(processKey, options);
1042
1844
  });
1845
+ attachSharedExamples(settingsCmd);
1846
+ attachSharedExamples(variableTagsCmd);
1043
1847
  };
1044
1848
 
1045
1849
  // ../maestro-sdk/src/shared-commands/processes.ts
1046
- function findProcessSummary(summaries, processKey) {
1850
+ async function findProcessSummary(config, processKey, folderKey, processType) {
1851
+ const page = await pimsGet(config, `/processes/summary${buildQueryString({ processType, processKey })}`, { folderKey });
1852
+ const summaries = Array.isArray(page?.processes) ? page.processes : [];
1047
1853
  return summaries.find((summary) => summary.processKey === processKey) ?? null;
1048
1854
  }
1049
1855
  var registerSharedProcessesCommands = (program, config) => {
1050
1856
  const { toolLabel, processType } = config;
1857
+ const incidentsQuery = buildQueryString({ processType });
1051
1858
  const processes = program.command("processes").description(`Manage ${toolLabel} process summaries`);
1052
1859
  processes.command("list").description(`List all ${toolLabel} process summaries`).option("--folder-key <key>", "Folder key").option("-l, --limit <number>", "Number of items to return (1-10000)", parseLimit).option("--offset <number>", "Number of items to skip (0-1000000)", parseOffset, 0).option("--status <status>", "Filter by process status").trackedAction(processContext, async (options) => {
1053
1860
  const query = buildQueryString({
@@ -1068,7 +1875,7 @@ var registerSharedProcessesCommands = (program, config) => {
1068
1875
  });
1069
1876
  processes.command("incidents").description(`Get incidents for a specific ${toolLabel} process`).argument("<process-key>", "Process definition key").requiredOption("--folder-key <key>", "Folder key").trackedAction(processContext, async (processKey, options) => {
1070
1877
  const reqOptions = { folderKey: options.folderKey };
1071
- const result = await withPimsCall((config2) => pimsGet(config2, `/incidents/process/${encodeURIComponent(processKey)}`, reqOptions), "Error getting process incidents", { resource: "process", id: processKey });
1878
+ const result = await withPimsCall((config2) => pimsGet(config2, `/incidents/process/${encodeURIComponent(processKey)}${incidentsQuery}`, reqOptions), "Error getting process incidents", { resource: "process", id: processKey });
1072
1879
  if (!result)
1073
1880
  return;
1074
1881
  OutputFormatter.success({
@@ -1079,12 +1886,11 @@ var registerSharedProcessesCommands = (program, config) => {
1079
1886
  });
1080
1887
  processes.command("diagnose").description(`Correlate ${toolLabel} process summary, incidents, and error codes`).argument("<process-key>", "Process definition key").requiredOption("--folder-key <key>", "Folder key").trackedAction(processContext, async (processKey, options) => {
1081
1888
  const result = await withPimsCall(async (config2) => {
1082
- const query = processType ? buildQueryString({ processType }) : "";
1083
- const summaries = await pimsGet(config2, `/processes/summary${query}`);
1084
- const incidents = await pimsGet(config2, `/incidents/process/${encodeURIComponent(processKey)}`, { folderKey: options.folderKey });
1889
+ const summary = await findProcessSummary(config2, processKey, options.folderKey, processType);
1890
+ const incidents = await pimsGet(config2, `/incidents/process/${encodeURIComponent(processKey)}${incidentsQuery}`, { folderKey: options.folderKey });
1085
1891
  const errorCodes = await pimsGet(config2, `/incidents/process/${encodeURIComponent(processKey)}/error-codes`, { folderKey: options.folderKey });
1086
1892
  return {
1087
- summary: findProcessSummary(summaries, processKey),
1893
+ summary,
1088
1894
  incidents,
1089
1895
  errorCodes: errorCodes.errorCodes || []
1090
1896
  };
@@ -1118,8 +1924,9 @@ var registerSharedProcessesCommands = (program, config) => {
1118
1924
  Data: result.errorCodes || []
1119
1925
  });
1120
1926
  });
1927
+ attachSharedExamples(processes);
1121
1928
  };
1122
1929
 
1123
- export { registerSharedIncidentCommands, registerSharedInstanceCommands, registerSharedProcessCommands, registerSharedProcessesCommands };
1930
+ export { pimsGet, pimsPost, pimsPut, pimsPatch, createPimsConfig, buildQueryString, withDebugPimsCall, registerSharedDebugInstanceCommands, withPimsCall, registerSharedIncidentCommands, registerSharedInstanceCommands, registerSharedProcessCommands, registerSharedProcessesCommands };
1124
1931
 
1125
- //# debugId=98A588F258A04C4164756E2164756E21
1932
+ //# debugId=5B0AC5D48415912064756E2164756E21