@uipath/case-tool 1.203.0-preview.212 → 1.204.0-preview.211

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 (85) hide show
  1. package/README.md +6 -1
  2. package/dist/THIRD-PARTY-NOTICES.md +10 -9
  3. package/dist/authoring-0hr88kff.js +623 -0
  4. package/dist/{case-api-v6cjyrfw.js → case-api-gdaj9469.js} +5 -5
  5. package/dist/case-bindings-service-c2mze9vj.js +476 -0
  6. package/dist/{case-debug-studio-web-service-8th9d8sm.js → case-debug-studio-web-service-6q9ch7cq.js} +11 -10
  7. package/dist/case-described-io-service-cpe5h2ks.js +132 -0
  8. package/dist/{case-format-service-q345a2fd.js → case-format-service-qwyjyt0y.js} +2 -2
  9. package/dist/{case-pack-service-29rza2q2.js → case-pack-service-47yrvmg0.js} +11 -11
  10. package/dist/case-shape-reader-mw58avr0.js +13 -0
  11. package/dist/case-splice-service-9zvw19ca.js +312 -0
  12. package/dist/{case-validate-service-84drzwx3.js → case-validate-service-jcdf4n67.js} +415 -1449
  13. package/dist/{connector-enrichment-service-2982ykgb.js → connector-enrichment-service-60wwjarq.js} +20 -18
  14. package/dist/{connector-lookup-service-8ddh4pq2.js → connector-lookup-service-zhf8fz2j.js} +7 -7
  15. package/dist/{connector-task-spec-qs7q7vnv.js → connector-task-spec-96e3wzx7.js} +86 -26
  16. package/dist/{debug-service-8x087xxt.js → debug-service-vf5mw0nr.js} +3 -3
  17. package/dist/{embedded-file-reader-0sjt4nkj.js → embedded-file-reader-v8c2yj2a.js} +2 -2
  18. package/dist/{enrichment-service-7vbxcwge.js → enrichment-service-78b0gqck.js} +8 -7
  19. package/dist/index-hhsf00x8.js +15 -0
  20. package/dist/{index-fz4ttsde.js → index-j2r3jb6c.js} +5 -3
  21. package/dist/{index-yj8fb3q6.js → index-k7gkw7s9.js} +59 -27
  22. package/dist/{index-jxj2jz45.js → index-rgw7caht.js} +416 -87
  23. package/dist/{index-k4xz16db.js → index-wmffgzmr.js} +12522 -7316
  24. package/dist/index.js +15 -11
  25. package/dist/{input-reader-pnh948bq.js → input-reader-bb0ptk2v.js} +2 -2
  26. package/dist/migration-diagnosis-ag2sgd1e.js +71 -0
  27. package/dist/{node-strategy-gc4sg6a2.js → node-strategy-5pz40tee.js} +1 -1
  28. package/dist/{node-sync-service-t193ery3.js → node-sync-service-zwjcwgwc.js} +6 -6
  29. package/dist/out-target-1f4n9vqb.js +70 -0
  30. package/dist/{packager-tool-wefb1zw3.js → packager-tool-0p3td5zv.js} +8 -7
  31. package/dist/packager-tool-21qfsbxn.js +17 -0
  32. package/dist/{strict-sdd-audit-8e2fh9jg.js → packager-tool-4e56rmwe.js} +2771 -1746
  33. package/dist/{packager-tool-sfkyb4kz.js → packager-tool-4rqd21wc.js} +194 -2
  34. package/dist/packager-tool-57pzrd0g.js +32 -0
  35. package/dist/{packager-tool-kpcjnxd1.js → packager-tool-58kx79ta.js} +586 -113
  36. package/dist/{packager-tool-hrdan5ms.js → packager-tool-5qghkdd0.js} +2 -2
  37. package/dist/packager-tool-5qp9xza1.js +10 -0
  38. package/dist/{packager-tool-3qkp2fts.js → packager-tool-76ms0wdw.js} +4 -4
  39. package/dist/packager-tool-8a9yqfq7.js +76 -0
  40. package/dist/packager-tool-b250k6w4.js +75 -0
  41. package/dist/packager-tool-bfgdz1zh.js +73 -0
  42. package/dist/{packager-tool-p7jgrm5r.js → packager-tool-cmwets3m.js} +1 -1
  43. package/dist/{packager-tool-d4sjk46c.js → packager-tool-cv05dwac.js} +18 -21
  44. package/dist/packager-tool-d7jjng8a.js +21 -0
  45. package/dist/{packager-tool-rh07gzxw.js → packager-tool-dqnc61h1.js} +5 -5
  46. package/dist/packager-tool-dthjwajc.js +13 -0
  47. package/dist/packager-tool-f78ntj5g.js +228 -0
  48. package/dist/{packager-tool-r1g8rqcs.js → packager-tool-gjhg49r1.js} +4 -4
  49. package/dist/{packager-tool-cg2j4rma.js → packager-tool-kacqd7h7.js} +4 -4
  50. package/dist/packager-tool-mknccck5.js +24 -0
  51. package/dist/{packager-tool-sv0d6wb6.js → packager-tool-nj4seavy.js} +7 -3
  52. package/dist/{packager-tool-adcaxdhs.js → packager-tool-paepfv5d.js} +1 -1
  53. package/dist/{packager-tool-052kvydg.js → packager-tool-pm646ag4.js} +1 -1
  54. package/dist/{packager-tool-qht4xd0y.js → packager-tool-q86py4rp.js} +320 -200
  55. package/dist/{packager-tool-geaetyks.js → packager-tool-qmeaj10z.js} +669 -100
  56. package/dist/{packager-tool-dd8bq6az.js → packager-tool-rgpdaxbx.js} +548 -108
  57. package/dist/{packager-tool-8q7vzh65.js → packager-tool-s3e2kepj.js} +455 -13
  58. package/dist/{packager-tool-r84ng21s.js → packager-tool-sag9gz55.js} +3 -1
  59. package/dist/{packager-tool-0mj06yen.js → packager-tool-sq931c23.js} +5 -22
  60. package/dist/{packager-tool-7mggwye6.js → packager-tool-tmfbp50w.js} +6 -6
  61. package/dist/{packager-tool-yrsrzz1a.js → packager-tool-v99ygh9f.js} +23 -8
  62. package/dist/packager-tool-wj9d9mqe.js +267 -0
  63. package/dist/{packager-tool-hz1mz8fs.js → packager-tool-wjaya2k2.js} +2 -2
  64. package/dist/packager-tool-xcd87qyx.js +44 -0
  65. package/dist/{packager-tool-0v3s8r01.js → packager-tool-xdxr3ync.js} +4 -2
  66. package/dist/{packager-tool-61hxhgeg.js → packager-tool-xkgq5fkf.js} +3 -3
  67. package/dist/packager-tool.js +6 -6
  68. package/dist/{project-artifacts-8snev67g.js → project-artifacts-wzrhketn.js} +1 -1
  69. package/dist/resolved-check-p99hysaw.js +50 -0
  70. package/dist/{resourcesSyncService-01qr5zp7.js → resourcesSyncService-rjt0tht7.js} +25 -18
  71. package/dist/rule-group-members-zje7n3kf.js +76 -0
  72. package/dist/sdd-convert-service-gp9733qv.js +1962 -0
  73. package/dist/{sdd-lookup-x08j9g9m.js → sdd-lookup-vpjej1kt.js} +2 -2
  74. package/dist/sdd-resolve-service-4hx64x3z.js +288 -0
  75. package/dist/strict-case-rules-ksy8q7pg.js +731 -0
  76. package/dist/strict-entry-points-v14d7y50.js +124 -0
  77. package/dist/strict-sdd-audit-k6hh0mbr.js +23 -0
  78. package/dist/task-selector-8bjn35dv.js +57 -0
  79. package/dist/tool.js +15 -11
  80. package/dist/{trigger-enrichment-service-sddbphf2.js → trigger-enrichment-service-kst89jbe.js} +41 -23
  81. package/package.json +2 -2
  82. package/dist/authoring-kngaggwm.js +0 -360
  83. package/dist/case-bindings-service-1wxfghzd.js +0 -240
  84. package/dist/packager-tool-83qnybab.js +0 -1564
  85. package/dist/strict-case-rules-x6t0vb40.js +0 -409
package/README.md CHANGED
@@ -22,6 +22,10 @@ All commands are available under the `case` prefix:
22
22
  uip maestro case <command>
23
23
  ```
24
24
 
25
+ `case compile`, `case check`, `case decompile` and `case merge` run the
26
+ project's builder SDK (`@uipath/maestro-builder-sdk`); see
27
+ [Authoring commands](../maestro-tool/README.md#authoring-commands).
28
+
25
29
  ### `registry pull`
26
30
 
27
31
  Fetch and cache all resource types from the UiPath platform.
@@ -45,6 +49,7 @@ uip maestro case registry pull [options]
45
49
  | `api` | API workflows |
46
50
  | `processOrchestration` | Agentic processes |
47
51
  | `caseManagement` | Case management workflows |
52
+ | `function` | Coded Functions |
48
53
  | `typecache-activities` | Connector activities (Integration Service) |
49
54
  | `typecache-triggers` | Connector triggers (Integration Service) |
50
55
  | `action-apps` | Deployed human action apps |
@@ -288,7 +293,7 @@ Change detection uses SHA-256 hashing — if the fetched data is identical to th
288
293
 
289
294
  | Resource type | Endpoint |
290
295
  | :--- | :--- |
291
- | `agent`, `process`, `api`, `processOrchestration`, `caseManagement` | `/{accountId}/{tenantId}/resourcecatalog_/Entities/Process?entitySubType=<type>` |
296
+ | `agent`, `process`, `api`, `processOrchestration`, `caseManagement`, `function` | `/{accountId}/{tenantId}/resourcecatalog_/Entities/Process?entitySubType=<type>` |
292
297
  | `action-apps` | `/{accountId}/apps_/default/api/v1/default/action-apps?state=deployed` |
293
298
  | `typecache-activities` | `/{accountId}/studio_/typecache/api/Activities/SearchActivities` |
294
299
  | `typecache-triggers` | `/{accountId}/studio_/typecache/api/Activities/SearchTriggers` |
@@ -10,11 +10,11 @@ those licences require.
10
10
  - @jsep-plugin/object@1.2.2 — MIT
11
11
  - @serverlessworkflow/sdk@1.0.1 — Apache-2.0
12
12
  - @uipath/agents-storage-schemas@1.35.0 — see below
13
- - @uipath/case-schema@0.1052.3 — UNLICENSED
13
+ - @uipath/case-schema@0.1147.0 — SEE LICENSE IN LICENSE.txt
14
14
  - @uipath/flow-core@0.115.4-develop — MIT
15
15
  - @uipath/flow-schema@0.72.2-develop — MIT
16
16
  - @uipath/integration-service-design-time@0.25.2 — see below
17
- - @uipath/resource-builder-sdk@2025.11.0-alpha5891-4020 — ISC
17
+ - @uipath/resource-builder-sdk@2025.11.0-alpha6004-4107 — ISC
18
18
  - acorn@8.17.0 — MIT
19
19
  - ajv@8.20.0 — MIT
20
20
  - ajv-errors@3.0.0 — MIT
@@ -313,14 +313,15 @@ internal IP policy, and is listed here because it is bundled.
313
313
 
314
314
  ---
315
315
 
316
- ## @uipath/case-schema@0.1052.3
316
+ ## @uipath/case-schema@0.1147.0
317
317
 
318
- SPDX: UNLICENSED as declared, cleared for distribution.
318
+ SPDX: SEE LICENSE IN LICENSE.txt
319
319
 
320
- A UiPath package published from another team's registry. It
321
- ships no licence text and its npm metadata grants nothing, so
322
- there is no third-party licence to reproduce: it is covered by
323
- internal IP policy, and is listed here because it is bundled.
320
+ ```
321
+ © 2026 UiPath
322
+ Use of this product is subject (a) to the applicable licensing agreement available: https://www.uipath.com/legal/trust-and-security/legal-terms#content-1 and, (b) for paid products listed here https://licensing.uipath.com/: the licensing agreement agreed between you and UiPath.
323
+ (UiPath means UiPath SRL with headquarters at 4 Vasile Alecsandri Str. and 11 Constantin Daniel Str., Building A, floors 5 and 6, District 1, Bucharest 010639, Romania and UiPath Inc. with principal place of business: One Vanderbilt Avenue, 60th Floor, New York, NY 10017)
324
+ ```
324
325
 
325
326
  ---
326
327
 
@@ -355,7 +356,7 @@ internal IP policy, and is listed here because it is bundled.
355
356
 
356
357
  ---
357
358
 
358
- ## @uipath/resource-builder-sdk@2025.11.0-alpha5891-4020
359
+ ## @uipath/resource-builder-sdk@2025.11.0-alpha6004-4107
359
360
 
360
361
  SPDX: ISC
361
362
 
@@ -0,0 +1,623 @@
1
+ import {
2
+ resolveMaestroRegistry
3
+ } from "./packager-tool-5qghkdd0.js";
4
+ import {
5
+ Option,
6
+ OutputFormatter,
7
+ RESULTS,
8
+ getOutputSink,
9
+ pascalCaseDataKeys,
10
+ processContext
11
+ } from "./packager-tool-58kx79ta.js";
12
+ import {
13
+ getFileSystem
14
+ } from "./packager-tool-xdxr3ync.js";
15
+ import"./packager-tool-1yh8g550.js";
16
+
17
+ // ../builder-sdk/src/argv.ts
18
+ function addValue(argv, flag, value) {
19
+ if (typeof value === "string") {
20
+ argv.push(flag, value);
21
+ }
22
+ }
23
+
24
+ // ../builder-sdk/src/delegate.ts
25
+ import { spawn as spawn2 } from "node:child_process";
26
+ import { createRequire } from "node:module";
27
+ import { StringDecoder } from "node:string_decoder";
28
+
29
+ // ../builder-sdk/src/npm-global-root.ts
30
+ import { spawn } from "node:child_process";
31
+ var NPM_ROOT_TIMEOUT_MS = 5000;
32
+ var npmRootLookup;
33
+ function npmGlobalRoot() {
34
+ const prefix = npmConfigPrefix(process.env);
35
+ if (prefix.trim() !== "") {
36
+ return Promise.resolve(process.platform === "win32" ? getFileSystem().path.join(prefix, "node_modules") : getFileSystem().path.join(prefix, "lib", "node_modules"));
37
+ }
38
+ npmRootLookup ??= runNpmRootGlobal();
39
+ return npmRootLookup;
40
+ }
41
+ function runNpmRootGlobal() {
42
+ return new Promise((resolve) => {
43
+ const stdio = ["ignore", "pipe", "ignore"];
44
+ const onWindows = { shell: true, stdio, windowsHide: true };
45
+ const proc = process.platform === "win32" ? spawn("npm root -g", [], onWindows) : spawn("npm", ["root", "-g"], { stdio });
46
+ let stdout = "";
47
+ proc.stdout?.on("data", (d) => {
48
+ stdout += d.toString();
49
+ });
50
+ const timer = setTimeout(() => {
51
+ proc.kill("SIGTERM");
52
+ resolve(null);
53
+ }, NPM_ROOT_TIMEOUT_MS);
54
+ proc.on("error", () => {
55
+ clearTimeout(timer);
56
+ resolve(null);
57
+ });
58
+ proc.on("close", (code) => {
59
+ clearTimeout(timer);
60
+ const root = stdout.trim();
61
+ resolve(code === 0 && root && !root.includes("***") ? root : null);
62
+ });
63
+ });
64
+ }
65
+ function npmConfigPrefix(env) {
66
+ let prefix = "";
67
+ for (const [key, value] of Object.entries(env)) {
68
+ if (key.toLowerCase() === "npm_config_prefix" && value !== undefined) {
69
+ prefix = value;
70
+ }
71
+ }
72
+ return prefix;
73
+ }
74
+
75
+ // ../builder-sdk/src/delegate.ts
76
+ var FLOW_SDK_PACKAGE = {
77
+ name: "@uipath/maestro-builder-sdk",
78
+ minimumVersion: "6.11.1"
79
+ };
80
+ var BPMN_CONNECTOR_OPTIONS_VERSION = "6.15.0";
81
+ function commandLabel(family, verb) {
82
+ return `uip maestro ${family} ${verb}`;
83
+ }
84
+ function parseVersion(version) {
85
+ const match = /^(\d+)\.(\d+)\.(\d+)(-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/.exec(version);
86
+ if (!match)
87
+ return null;
88
+ return [
89
+ Number(match[1]),
90
+ Number(match[2]),
91
+ Number(match[3]),
92
+ match[4] !== undefined
93
+ ];
94
+ }
95
+ function versionMeetsFloor(version, floor) {
96
+ const installed = parseVersion(version);
97
+ const minimum = parseVersion(floor);
98
+ if (!installed || !minimum)
99
+ return false;
100
+ for (let index = 0;index < 3; index++) {
101
+ if (installed[index] !== minimum[index]) {
102
+ return installed[index] > minimum[index];
103
+ }
104
+ }
105
+ return !installed[3] || minimum[3];
106
+ }
107
+ var FLOW_SDK_INVOKED_AS = "uip maestro";
108
+ function resultCode(family, verb) {
109
+ return [family, verb].map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
110
+ }
111
+ function stdoutAsData(stdout) {
112
+ const text = stdout.trimEnd();
113
+ const trimmed = text.trimStart();
114
+ if (trimmed.startsWith("{") || trimmed.startsWith("[")) {
115
+ try {
116
+ const parsed = JSON.parse(trimmed);
117
+ if (parsed !== null && typeof parsed === "object") {
118
+ if (!Array.isArray(parsed) && "ok" in parsed) {
119
+ const { ok: _ok, ...fields } = parsed;
120
+ return fields;
121
+ }
122
+ return parsed;
123
+ }
124
+ } catch {}
125
+ }
126
+ return { Output: text };
127
+ }
128
+ function failureReason(out, err) {
129
+ try {
130
+ const parsed = JSON.parse(out.trim());
131
+ if (parsed !== null && typeof parsed === "object" && typeof parsed.error === "string") {
132
+ return parsed.error;
133
+ }
134
+ } catch {}
135
+ const lines = err.split(`
136
+ `).filter((line) => line.trim() !== "");
137
+ return lines.at(-1)?.trim() ?? out.trim();
138
+ }
139
+ function spawnSdk(cliPath, args, cwd) {
140
+ return new Promise((settle) => {
141
+ let settled = false;
142
+ const resolve = (outcome) => {
143
+ if (settled)
144
+ return;
145
+ settled = true;
146
+ settle(outcome);
147
+ };
148
+ const child = spawn2("node", [cliPath, ...args], {
149
+ cwd,
150
+ env: {
151
+ ...process.env,
152
+ FLOW_SDK_INVOKED_AS
153
+ },
154
+ stdio: ["inherit", "pipe", "pipe"]
155
+ });
156
+ const stdout = [];
157
+ const stderr = [];
158
+ const decoderErr = new StringDecoder("utf8");
159
+ const writeLive = (text) => {
160
+ if (text)
161
+ getOutputSink().writeErr(text);
162
+ };
163
+ child.stdout?.on("data", (chunk) => {
164
+ stdout.push(chunk);
165
+ });
166
+ child.stderr?.on("data", (chunk) => {
167
+ stderr.push(chunk);
168
+ writeLive(decoderErr.write(chunk));
169
+ });
170
+ child.once("error", (error) => {
171
+ resolve({ kind: "spawn-error", message: error.message });
172
+ });
173
+ child.once("close", (exitCode, signal) => {
174
+ if (settled)
175
+ return;
176
+ writeLive(decoderErr.end());
177
+ resolve({
178
+ kind: "closed",
179
+ exitCode,
180
+ signal,
181
+ out: Buffer.concat(stdout).toString("utf-8"),
182
+ err: Buffer.concat(stderr).toString("utf-8").trim()
183
+ });
184
+ });
185
+ });
186
+ }
187
+ async function runChild(cliPath, args, cwd, label) {
188
+ const outcome = await spawnSdk(cliPath, args, cwd);
189
+ if (outcome.kind === "spawn-error") {
190
+ return {
191
+ ok: false,
192
+ exitCode: 1,
193
+ result: RESULTS.Failure,
194
+ message: `${label}: ${outcome.message}`,
195
+ instructions: "Check that node is on PATH, then retry."
196
+ };
197
+ }
198
+ const { exitCode, signal, out, err } = outcome;
199
+ if (exitCode === 0) {
200
+ return { ok: true, data: stdoutAsData(out) };
201
+ }
202
+ if (exitCode !== null) {
203
+ const detail = failureReason(out, err) || `SDK exited with code ${exitCode}`;
204
+ return {
205
+ ok: false,
206
+ exitCode,
207
+ result: RESULTS.Failure,
208
+ message: `${label}: ${detail}`,
209
+ instructions: err ? "Fix what the builder SDK reported (on stderr, and in Message), then retry." : "Fix what the builder SDK reported (see Message), then retry.",
210
+ ...out.trim() ? { data: stdoutAsData(out) } : {}
211
+ };
212
+ }
213
+ return {
214
+ ok: false,
215
+ exitCode: 1,
216
+ result: RESULTS.Failure,
217
+ message: `${label}: SDK process ended with signal ${signal ?? "unknown"}.`,
218
+ instructions: "Retry the command."
219
+ };
220
+ }
221
+ function upgradeInstructions(found) {
222
+ return found === "workspace" ? `npm install --save-dev ${FLOW_SDK_PACKAGE.name}@latest` : `npm install -g ${FLOW_SDK_PACKAGE.name}@latest`;
223
+ }
224
+ function resolveLocalPackageJson(workspace) {
225
+ const require2 = createRequire(import.meta.url);
226
+ try {
227
+ return require2.resolve(`${FLOW_SDK_PACKAGE.name}/package.json`, {
228
+ paths: [workspace]
229
+ });
230
+ } catch {
231
+ return null;
232
+ }
233
+ }
234
+ async function resolveGlobalPackageJson() {
235
+ const root = await npmGlobalRoot();
236
+ if (!root)
237
+ return null;
238
+ const fs = getFileSystem();
239
+ const candidate = fs.path.join(root, ...FLOW_SDK_PACKAGE.name.split("/"), "package.json");
240
+ return await fs.exists(candidate) ? candidate : null;
241
+ }
242
+ async function resolveFlowSdk(workspace, label) {
243
+ const fs = getFileSystem();
244
+ const { name, minimumVersion } = FLOW_SDK_PACKAGE;
245
+ const localPath = resolveLocalPackageJson(workspace);
246
+ const packagePath = localPath ?? await resolveGlobalPackageJson();
247
+ const found = localPath ? "workspace" : packagePath ? "global" : "none";
248
+ if (!packagePath) {
249
+ return {
250
+ ok: false,
251
+ message: `${label}: ${name} is not installed in this workspace or globally.`,
252
+ instructions: upgradeInstructions(found)
253
+ };
254
+ }
255
+ const packageText = await fs.readFile(packagePath, "utf-8");
256
+ if (packageText === null) {
257
+ return {
258
+ ok: false,
259
+ message: `${label}: could not read ${packagePath}.`,
260
+ instructions: `Reinstall ${name}, then retry.`
261
+ };
262
+ }
263
+ let version = "";
264
+ try {
265
+ const parsed = JSON.parse(packageText);
266
+ version = typeof parsed.version === "string" ? parsed.version : "";
267
+ } catch {
268
+ version = "";
269
+ }
270
+ if (!versionMeetsFloor(version, minimumVersion)) {
271
+ return {
272
+ ok: false,
273
+ message: `${label}: found ${name} ${version || "with no valid version"}; need >= ${minimumVersion}.`,
274
+ instructions: upgradeInstructions(found)
275
+ };
276
+ }
277
+ return {
278
+ ok: true,
279
+ packageDir: fs.path.dirname(packagePath),
280
+ version,
281
+ found: found === "workspace" ? "workspace" : "global"
282
+ };
283
+ }
284
+ async function runFlowSdk({
285
+ family,
286
+ commandVerb,
287
+ sdkVerb = commandVerb,
288
+ argv,
289
+ cwd,
290
+ requiresSdkVersion
291
+ }) {
292
+ const fs = getFileSystem();
293
+ const workspace = cwd ?? fs.env.cwd();
294
+ const label = commandLabel(family, commandVerb);
295
+ const resolution = await resolveFlowSdk(workspace, label);
296
+ if (!resolution.ok) {
297
+ return {
298
+ ok: false,
299
+ exitCode: 1,
300
+ result: RESULTS.ConfigError,
301
+ message: resolution.message,
302
+ instructions: resolution.instructions
303
+ };
304
+ }
305
+ if (requiresSdkVersion && !versionMeetsFloor(resolution.version, requiresSdkVersion.version)) {
306
+ return {
307
+ ok: false,
308
+ exitCode: 1,
309
+ result: RESULTS.ConfigError,
310
+ message: `${label}: ${requiresSdkVersion.because} needs ${FLOW_SDK_PACKAGE.name} >= ${requiresSdkVersion.version}; found ${resolution.version}.`,
311
+ instructions: upgradeInstructions(resolution.found)
312
+ };
313
+ }
314
+ const cliPath = fs.path.join(resolution.packageDir, "dist", "cli", "index.js");
315
+ const sdkArgv = argv.includes("--json") ? [...argv] : [...argv, "--json"];
316
+ return await runChild(cliPath, [family, sdkVerb, ...sdkArgv], workspace, label);
317
+ }
318
+ async function delegateToFlowSdk(request) {
319
+ const result = await runFlowSdk(request);
320
+ if (result.ok) {
321
+ OutputFormatter.success({
322
+ Result: RESULTS.Success,
323
+ Code: resultCode(request.family, request.commandVerb),
324
+ Data: result.data
325
+ });
326
+ return 0;
327
+ }
328
+ OutputFormatter.error({
329
+ Result: result.result,
330
+ Message: result.message,
331
+ Instructions: result.instructions,
332
+ ...result.data ? { Data: pascalCaseDataKeys(result.data) } : {}
333
+ });
334
+ return result.exitCode;
335
+ }
336
+
337
+ // ../builder-sdk/src/examples.ts
338
+ function sdkCliExample(family, verb, description, command, data) {
339
+ return [
340
+ {
341
+ Description: description,
342
+ Command: command,
343
+ Output: {
344
+ Code: resultCode(family, verb),
345
+ Data: data
346
+ }
347
+ }
348
+ ];
349
+ }
350
+
351
+ // ../builder-sdk/src/library-option.ts
352
+ async function resolveLibraryOption(explicit) {
353
+ if (explicit !== undefined)
354
+ return explicit;
355
+ if (getFileSystem().env.getenv("FLOW_SDK_LIBRARY_JSON"))
356
+ return;
357
+ const registry = await resolveMaestroRegistry();
358
+ return registry?.libraryJson;
359
+ }
360
+ async function connectorLibraryInPlay(explicit) {
361
+ if (explicit !== undefined)
362
+ return true;
363
+ if (getFileSystem().env.getenv("FLOW_SDK_LIBRARY_JSON"))
364
+ return true;
365
+ return (await resolveMaestroRegistry())?.libraryJson !== undefined;
366
+ }
367
+
368
+ // ../builder-sdk/src/commands/check.ts
369
+ var CHECK_EXAMPLES = {
370
+ flow: { input: "Order.flow.ts" },
371
+ case: { input: "Claims.case.ts" },
372
+ bpmn: { input: "Approval.bpmn.ts" }
373
+ };
374
+ var CHECK_RESULT = { Errors: 0, Warnings: 0, Diagnostics: [] };
375
+ var registerCheckCommand = (program, family) => {
376
+ const command = program.command("check <input>").description("Check a source file for authoring errors before compiling it.").option("--source", "Check authored TypeScript");
377
+ if (family === "flow" || family === "bpmn") {
378
+ command.option("--library <dir>", "Connector library directory (defaults to $FLOW_SDK_LIBRARY_JSON, else the pulled library)").option("--connectors-local <dir>", "Connection-resolved connector overlay (default: ./connectors-local)");
379
+ }
380
+ if (family === "bpmn") {
381
+ command.option("--graph", "Also print the resolved wiring: every element with the flows leaving it, implied edges marked ~>");
382
+ }
383
+ const example = CHECK_EXAMPLES[family];
384
+ command.examples(sdkCliExample(family, "check", `Check a ${family} source file before compiling it`, `uip maestro ${family} check ${example.input} --source`, CHECK_RESULT)).trackedAction(processContext, async (input, options) => {
385
+ const argv = [input];
386
+ if (options.source)
387
+ argv.push("--source");
388
+ const connectorOptions = family === "flow" || family === "bpmn";
389
+ const library = connectorOptions ? await resolveLibraryOption(options.library) : undefined;
390
+ addValue(argv, "--library", library);
391
+ addValue(argv, "--connectors-local", connectorOptions ? options.connectorsLocal : undefined);
392
+ if (options.graph)
393
+ argv.push("--graph");
394
+ const gateBpmnConnectors = family === "bpmn" && (options.connectorsLocal !== undefined || await connectorLibraryInPlay(options.library));
395
+ const code = await delegateToFlowSdk({
396
+ family,
397
+ commandVerb: "check",
398
+ argv,
399
+ ...gateBpmnConnectors ? {
400
+ requiresSdkVersion: {
401
+ version: BPMN_CONNECTOR_OPTIONS_VERSION,
402
+ because: "the connector library on bpmn check"
403
+ }
404
+ } : {}
405
+ });
406
+ if (code !== 0)
407
+ processContext.exit(code);
408
+ });
409
+ };
410
+ // ../builder-sdk/src/commands/compile.ts
411
+ var COMPILE_EXAMPLES = {
412
+ flow: {
413
+ source: "Order.flow.ts",
414
+ output: "Order.flow",
415
+ result: {
416
+ Path: "/work/Order.flow",
417
+ Nodes: 3,
418
+ Edges: 2,
419
+ Sidecars: [],
420
+ Errors: 0,
421
+ Warnings: 0,
422
+ Diagnostics: []
423
+ }
424
+ },
425
+ case: {
426
+ source: "Claims.case.ts",
427
+ output: "caseplan.json",
428
+ result: { Path: "/work/caseplan.json", Stages: 3 }
429
+ },
430
+ bpmn: {
431
+ source: "Approval.bpmn.ts",
432
+ output: "Approval.bpmn",
433
+ result: { Path: "/work/Approval.bpmn", Elements: 4 }
434
+ }
435
+ };
436
+ var registerCompileCommand = (program, family) => {
437
+ const command = program.command("compile <source>").description(`Compile authored TypeScript to a ${family} artifact.`).option("-o, --output <file>", "Output artifact path").option("--library <dir>", "Connector library directory (defaults to the pulled registry)").option("--bindings <file>", "bindings.json path").option("--connectors-local <dir>", "Connection-resolved connector overlay (default: ./connectors-local)");
438
+ if (family === "flow") {
439
+ command.option("--no-check", "Skip the source-level check");
440
+ }
441
+ const example = COMPILE_EXAMPLES[family];
442
+ command.examples(sdkCliExample(family, "compile", `Compile a ${family} source file to an artifact`, `uip maestro ${family} compile ${example.source} --output ${example.output}`, example.result)).trackedAction(processContext, async (source, options) => {
443
+ const argv = [source];
444
+ addValue(argv, "-o", options.output);
445
+ addValue(argv, "--library", await resolveLibraryOption(options.library));
446
+ addValue(argv, "--bindings", options.bindings);
447
+ addValue(argv, "--connectors-local", options.connectorsLocal);
448
+ if (options.check === false)
449
+ argv.push("--no-check");
450
+ const code = await delegateToFlowSdk({
451
+ family,
452
+ commandVerb: "compile",
453
+ argv,
454
+ ...family === "bpmn" && options.connectorsLocal !== undefined ? {
455
+ requiresSdkVersion: {
456
+ version: BPMN_CONNECTOR_OPTIONS_VERSION,
457
+ because: "--connectors-local on bpmn compile"
458
+ }
459
+ } : {}
460
+ });
461
+ if (code !== 0)
462
+ processContext.exit(code);
463
+ });
464
+ };
465
+ // ../builder-sdk/src/commands/decompile.ts
466
+ var DECOMPILE_EXAMPLES = {
467
+ flow: {
468
+ input: "Order.flow",
469
+ output: "Order.flow.ts",
470
+ result: {
471
+ Path: "/work/Order.flow.ts",
472
+ Pipeline: "/work/Order.pipeline.mjs"
473
+ }
474
+ },
475
+ case: {
476
+ input: "caseplan.json",
477
+ output: "Claims.case.ts",
478
+ result: {
479
+ Path: "/work/Claims.case.ts",
480
+ Pipeline: "/work/Claims.pipeline.mjs",
481
+ Diagnostics: []
482
+ }
483
+ },
484
+ bpmn: {
485
+ input: "Approval/Approval.bpmn",
486
+ output: "Approval.bpmn.ts",
487
+ result: { Path: "/work/Approval.bpmn.ts" },
488
+ extra: " --style nested"
489
+ }
490
+ };
491
+ var ARTIFACT = {
492
+ flow: { artifact: ".flow", source: ".flow.ts" },
493
+ case: { artifact: "caseplan.json", source: ".case.ts" },
494
+ bpmn: { artifact: ".bpmn", source: ".bpmn.ts" }
495
+ };
496
+ var registerDecompileCommand = (program, family) => {
497
+ const command = program.command("decompile <input>").description(`Convert a ${ARTIFACT[family].artifact} artifact to authored TypeScript.`).option("-o, --output <file>", `Output ${ARTIFACT[family].source} path`).option("--import <specifier>", "SDK import specifier in generated source");
498
+ if (family === "flow") {
499
+ command.option("--strict", "Fail on unsupported constructs");
500
+ } else if (family === "case") {
501
+ command.option("--library <dir>", "Connector library directory (defaults to the pulled registry)").option("--best-effort", "Emit a marked repair scaffold for unsupported constructs");
502
+ } else {
503
+ command.addOption(new Option("--style <style>", "explicit (default) or nested: lift boundary events, gateways and event sub-processes into the nesting constructs where the graph is provably the same").choices(["explicit", "nested"]));
504
+ }
505
+ if (family !== "bpmn") {
506
+ command.option("--no-pipeline", "Do not emit a brownfield pipeline helper");
507
+ }
508
+ const example = DECOMPILE_EXAMPLES[family];
509
+ command.examples(sdkCliExample(family, "decompile", `Convert a ${family} artifact back to authored TypeScript`, `uip maestro ${family} decompile ${example.input} --output ${example.output}${example.extra ?? ""}`, example.result)).trackedAction(processContext, async (input, options) => {
510
+ const argv = [input];
511
+ addValue(argv, "-o", options.output);
512
+ addValue(argv, "--import", options.import);
513
+ if (family === "case") {
514
+ addValue(argv, "--library", await resolveLibraryOption(options.library));
515
+ }
516
+ if (options.strict)
517
+ argv.push("--strict");
518
+ if (options.bestEffort)
519
+ argv.push("--best-effort");
520
+ if (options.pipeline === false)
521
+ argv.push("--no-pipeline");
522
+ addValue(argv, "--style", options.style);
523
+ const code = await delegateToFlowSdk({
524
+ family,
525
+ commandVerb: "decompile",
526
+ argv
527
+ });
528
+ if (code !== 0)
529
+ processContext.exit(code);
530
+ });
531
+ };
532
+ // ../builder-sdk/src/named-second.ts
533
+ function namedOrLegacy(spec) {
534
+ if (spec.named !== undefined && spec.legacy !== undefined) {
535
+ usageError(`pass ${spec.flag} or a second argument, not both`, spec.usage);
536
+ }
537
+ if (spec.named === "") {
538
+ usageError(`option '${spec.flag}' argument missing`, spec.usage);
539
+ }
540
+ if (spec.named !== undefined)
541
+ return spec.named;
542
+ if (spec.legacy === undefined) {
543
+ usageError(`required option '${spec.flag}' not specified`, spec.usage);
544
+ }
545
+ getOutputSink().writeErr(`[WARN] The two-argument form is deprecated. Use \`${spec.usage}\` instead.
546
+ `);
547
+ return spec.legacy;
548
+ }
549
+ function usageError(message, usage) {
550
+ throw Object.assign(new Error(message), {
551
+ result: RESULTS.ValidationError,
552
+ errorCode: "invalid_argument",
553
+ retry: "RetryWillNotFix",
554
+ instructions: `Usage: ${usage}`
555
+ });
556
+ }
557
+
558
+ // ../builder-sdk/src/commands/merge.ts
559
+ var MERGE_EXAMPLES = {
560
+ flow: {
561
+ description: "Merge edited authored content into the original Flow artifact",
562
+ command: "uip maestro flow merge Edited.flow --original Original.flow --output Merged.flow --baseline Baseline.flow",
563
+ result: { Path: "/work/Merged.flow", Nodes: 3, Edges: 2 }
564
+ },
565
+ case: {
566
+ description: "Merge edited authored content into the original Case artifact",
567
+ command: "uip maestro case merge edited.caseplan.json --original original.caseplan.json --output merged.caseplan.json",
568
+ result: { Path: "/work/merged.caseplan.json", Stages: 3 }
569
+ },
570
+ bpmn: {
571
+ description: "Merge an edited process into the original BPMN artifact, keeping untouched elements byte for byte",
572
+ command: "uip maestro bpmn merge Edited.bpmn --original Original.bpmn --output Merged.bpmn --baseline Baseline.bpmn",
573
+ result: {
574
+ Path: "/work/Merged.bpmn",
575
+ Preserved: 5,
576
+ Authored: 1,
577
+ Removed: 0
578
+ }
579
+ }
580
+ };
581
+ var registerMergeCommand = (program, family) => {
582
+ const command = program.command("merge <edited>").description(`Merge an edited ${family} with its original artifact.`).option("--original <file>", "Original artifact to merge into (required)").option("-o, --output <file>", "Merged output path").allowExcessArguments(true);
583
+ if (family !== "case") {
584
+ command.option("--baseline <file>", "Compiled pristine decompile");
585
+ }
586
+ const example = MERGE_EXAMPLES[family];
587
+ command.examples(sdkCliExample(family, "merge", example.description, example.command, example.result)).trackedAction(processContext, async (first, options, cmd) => {
588
+ const usage = `uip maestro ${family} merge <edited> --original <file>`;
589
+ if (cmd.args.length > 2) {
590
+ usageError(`unexpected argument '${cmd.args[2]}'`, usage);
591
+ }
592
+ const legacyEdited = cmd.args[1];
593
+ const original = namedOrLegacy({
594
+ named: options.original,
595
+ legacy: legacyEdited === undefined ? undefined : first,
596
+ flag: "--original",
597
+ usage
598
+ });
599
+ const edited = legacyEdited ?? first;
600
+ const tail = [];
601
+ addValue(tail, "-o", options.output);
602
+ addValue(tail, "--baseline", options.baseline);
603
+ const code = await delegateToFlowSdk({
604
+ family,
605
+ commandVerb: "merge",
606
+ argv: [edited, "--original", original, ...tail]
607
+ });
608
+ if (code !== 0)
609
+ processContext.exit(code);
610
+ });
611
+ };
612
+ // src/commands/authoring.ts
613
+ var registerCaseAuthoringCommands = (program) => {
614
+ registerCompileCommand(program, "case");
615
+ registerCheckCommand(program, "case");
616
+ registerDecompileCommand(program, "case");
617
+ registerMergeCommand(program, "case");
618
+ };
619
+ export {
620
+ registerCaseAuthoringCommands
621
+ };
622
+
623
+ //# debugId=A2583E8292E3CD4464756E2164756E21