@uipath/flow-tool 1.202.1-preview.159 → 1.203.0-preview.160

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 (150) hide show
  1. package/dist/THIRD-PARTY-NOTICES.md +162 -9
  2. package/dist/{authoring-cyybnqy9.js → authoring-tv4dh80p.js} +31 -9
  3. package/dist/{binding-service-6g80xdbd.js → binding-service-m1729g4d.js} +37 -29
  4. package/dist/{connector-service-7ncm35ap.js → connector-service-hcscpb7k.js} +225 -57
  5. package/dist/{conversion-FQTRFHRX-j8vsrk1c.js → conversion-FQTRFHRX-5bww6cg9.js} +11 -10
  6. package/dist/de-FGHEJRCI-gn4cf5gh.js +2697 -0
  7. package/dist/de-MUJPA4EB-dpg7t2rw.js +173 -0
  8. package/dist/{debug-conversation-trigger-zyj7ksk0.js → debug-conversation-trigger-m9zwsek2.js} +21 -18
  9. package/dist/{debug-http-client-4ev9xna7.js → debug-http-client-53qk6pc5.js} +2 -2
  10. package/dist/{debug-service-2skv6t3q.js → debug-service-nyk0s6mc.js} +3 -3
  11. package/dist/{edge-service-wda2nfze.js → edge-service-ey6a128k.js} +19 -16
  12. package/dist/{index-4b8634za.js → embedded-file-reader-0sjt4nkj.js} +96 -16641
  13. package/dist/{en-TBNO2WUV-rfe87pgh.js → en-BWGKA5OE-1qkvb9rn.js} +2 -2
  14. package/dist/en-FBPVNKFN-dqt573xn.js +138 -0
  15. package/dist/en-TBNO2WUV-9nan43e5.js +1936 -0
  16. package/dist/es-7SE7HX2X-8yh1aj2y.js +173 -0
  17. package/dist/es-KR3ZSNMP-0cszm2n3.js +2697 -0
  18. package/dist/es-MX-2MYFZU7X-3rek4r73.js +173 -0
  19. package/dist/es-MX-XXZJGC4R-b4fbwe9d.js +2697 -0
  20. package/dist/first-party-service-srxaftkn.js +27 -0
  21. package/dist/{flow-api-p1jy8t6k.js → flow-api-f49qbvf6.js} +8 -8
  22. package/dist/{flow-debug-service-r57t6cy5.js → flow-debug-service-12553vsz.js} +65 -40
  23. package/dist/{flow-eval-node-target-d9pgp7se.js → flow-eval-node-target-y11g5wga.js} +24 -17
  24. package/dist/flow-eval-run-api-1bw5e0k4.js +13 -0
  25. package/dist/{flow-eval-run-service-2px8c3pt.js → flow-eval-run-service-5yb42k28.js} +105 -220
  26. package/dist/{flow-eval-service-d7xrfp36.js → flow-eval-service-62jbxh61.js} +350 -306
  27. package/dist/flow-init-service-8my1tazk.js +42 -0
  28. package/dist/{flow-io-spxmy6de.js → flow-io-fftvq9gn.js} +18 -15
  29. package/dist/{flow-migrate-service-ebzera76.js → flow-migrate-service-bh0cxn16.js} +27 -23
  30. package/dist/{flow-pack-service-kk1cwyb6.js → flow-pack-service-z34abxpg.js} +44 -36
  31. package/dist/flow-validate-service-kesk1p8a.js +65 -0
  32. package/dist/fr-MDFKNZ4C-h4a122k9.js +173 -0
  33. package/dist/fr-Y6NPVODW-q5ef3htr.js +2697 -0
  34. package/dist/{governance-fetcher-vfk3g97x.js → governance-fetcher-qqp2kfm6.js} +6 -5
  35. package/dist/{headless-my7j1typ.js → headless-rkxtgwts.js} +42909 -1756
  36. package/dist/{hitl-service-5ew0gfa7.js → hitl-service-sbdq031m.js} +18 -15
  37. package/dist/{index-1kgxzh8x.js → index-3ts7y9d3.js} +15 -3
  38. package/dist/{index-apf8q9y0.js → index-51z10z84.js} +4 -4
  39. package/dist/{index-d1yqqk6q.js → index-55cym5j7.js} +6 -4
  40. package/dist/index-kmp9fmhb.js +25 -0
  41. package/dist/index-sc7ddh21.js +16742 -0
  42. package/dist/{index-acd6bpqc.js → index-ymsd3pyx.js} +12 -15
  43. package/dist/{index-wxzc6q8y.js → index-zc0rre3h.js} +6 -4
  44. package/dist/index.js +13 -24
  45. package/dist/init.js +23 -19
  46. package/dist/{input-reader-mm2ydeh5.js → input-reader-tw0j373f.js} +1 -1
  47. package/dist/ja-Q5PXKJ2V-tzf2rvz2.js +2697 -0
  48. package/dist/ja-UTQEAP34-8e0q6swp.js +173 -0
  49. package/dist/known-types-8dhhqk35.js +19 -0
  50. package/dist/ko-AXCHW2OK-askct7f6.js +173 -0
  51. package/dist/ko-AYBDSRZG-am0h0m2r.js +2697 -0
  52. package/dist/{maestro-automate-entry-6bxz7zxn.js → maestro-automate-entry-pqy9xqm3.js} +2 -2
  53. package/dist/{node-service-yc736svp.js → node-service-ttx9qj8a.js} +37 -29
  54. package/dist/{node-sync-service-ed0hz0ry.js → node-sync-service-t1atntv4.js} +15 -15
  55. package/dist/{node-npgt73aj.js → node-wn6npa2d.js} +2344 -376
  56. package/dist/{packager-tool-nnm6kw3x.js → packager-tool-0egkaa38.js} +1 -1
  57. package/dist/{packager-tool-0hrz9qfd.js → packager-tool-10t52r3c.js} +7 -7
  58. package/dist/{packager-tool-nq4rcqqg.js → packager-tool-1frs4sr4.js} +32 -2
  59. package/dist/{packager-tool-bddj2zb4.js → packager-tool-1r5dnt9q.js} +1 -1
  60. package/dist/{packager-tool-f0kd5kq4.js → packager-tool-26ydwf12.js} +130 -15
  61. package/dist/{packager-tool-4p7hr2rw.js → packager-tool-2c2wm7ss.js} +10 -10
  62. package/dist/{packager-tool-9ydywwp2.js → packager-tool-321a1806.js} +1 -1
  63. package/dist/packager-tool-53w8skv5.js +262 -0
  64. package/dist/{packager-tool-rew0hp2h.js → packager-tool-6k8s7pt9.js} +269 -23
  65. package/dist/{packager-tool-29eg86w6.js → packager-tool-6rsegsby.js} +6 -7
  66. package/dist/packager-tool-795gzq9k.js +208 -0
  67. package/dist/packager-tool-7q6z6npd.js +1937 -0
  68. package/dist/{packager-tool-h1mds3r4.js → packager-tool-8dj442ex.js} +5 -4
  69. package/dist/packager-tool-8qp60s20.js +12 -0
  70. package/dist/packager-tool-94nyzk85.js +1889 -0
  71. package/dist/{packager-tool-114a3x6s.js → packager-tool-9kx94sj5.js} +16 -6
  72. package/dist/{packager-tool-30ras1nc.js → packager-tool-9mm51nrg.js} +1 -1
  73. package/dist/{packager-tool-0d7tcvg1.js → packager-tool-b1xs6aty.js} +4 -1
  74. package/dist/{packager-tool-0e9sf7xz.js → packager-tool-b3m0jr5g.js} +4 -3
  75. package/dist/{packager-tool-vefnjbz8.js → packager-tool-bhgzjh7h.js} +310 -13
  76. package/dist/{packager-tool-r3fjpcv2.js → packager-tool-cgr7y554.js} +23 -5
  77. package/dist/packager-tool-d88rqwk8.js +135 -0
  78. package/dist/{packager-tool-pm3qh1hy.js → packager-tool-dh5nppv4.js} +1 -1
  79. package/dist/{packager-tool-r87gxwqa.js → packager-tool-e87tzg4y.js} +2 -2
  80. package/dist/packager-tool-e93xbetx.js +3513 -0
  81. package/dist/{packager-tool-0eeka8mc.js → packager-tool-edemj2dc.js} +10 -13
  82. package/dist/packager-tool-fvm2dddf.js +6297 -0
  83. package/dist/{packager-tool-3bra2c4j.js → packager-tool-gctpkdzs.js} +1 -1
  84. package/dist/packager-tool-gdtpsdn7.js +342 -0
  85. package/dist/{packager-tool-aa481g36.js → packager-tool-gpwec9sp.js} +6 -6
  86. package/dist/{packager-tool-a1hbfmws.js → packager-tool-gzpvdcnw.js} +124 -2
  87. package/dist/{packager-tool-03hjxcd7.js → packager-tool-h9d8c9rf.js} +1 -1
  88. package/dist/packager-tool-j78fwwhq.js +16 -0
  89. package/dist/{packager-tool-rx1fn179.js → packager-tool-j7fbzh3b.js} +2 -2
  90. package/dist/packager-tool-jysvpt8p.js +11 -0
  91. package/dist/{packager-tool-beew3axz.js → packager-tool-np5sdn2n.js} +9 -9
  92. package/dist/{packager-tool-5kd7msdf.js → packager-tool-nsmy7aap.js} +5 -5
  93. package/dist/packager-tool-paq9c70w.js +1332 -0
  94. package/dist/{packager-tool-j0grwqsp.js → packager-tool-qzg0br7p.js} +100 -127
  95. package/dist/packager-tool-qzxscmvb.js +261 -0
  96. package/dist/{packager-tool-tr5gfx9a.js → packager-tool-r7j4amsv.js} +209 -199
  97. package/dist/{packager-tool-j5mr6edn.js → packager-tool-rpr68as1.js} +8 -8
  98. package/dist/{packager-tool-sc5tddfj.js → packager-tool-s0mzv3sx.js} +1 -1
  99. package/dist/{packager-tool-81ekt01e.js → packager-tool-t9c77psy.js} +3098 -3179
  100. package/dist/{packager-tool-vfb74f9p.js → packager-tool-vbser1d9.js} +7 -7
  101. package/dist/packager-tool-vcjq9xkc.js +1895 -0
  102. package/dist/{packager-tool-w20r6n9v.js → packager-tool-vck7ct1e.js} +2877 -2221
  103. package/dist/{packager-tool-e8td7b01.js → packager-tool-vdc8r21p.js} +10328 -16610
  104. package/dist/{packager-tool-yr3bws42.js → packager-tool-vqcnvaae.js} +15 -15
  105. package/dist/packager-tool-w5a1hhyj.js +13 -0
  106. package/dist/{packager-tool-vbk4q3pf.js → packager-tool-yfbcqbvs.js} +31 -30
  107. package/dist/{packager-tool-9y5am147.js → packager-tool-z185rq2a.js} +4 -4
  108. package/dist/{packager-tool-dh3ve8ea.js → packager-tool-zh87cczz.js} +15 -56
  109. package/dist/packager-tool.js +17 -14
  110. package/dist/pt-3DIO5QWG-59b3f4bc.js +173 -0
  111. package/dist/pt-BR-TKHNHMET-dn6zxk1d.js +2697 -0
  112. package/dist/pt-BR-Y6K6XHXK-mp3hwhw1.js +173 -0
  113. package/dist/pt-ROXU257Y-yd80gx6s.js +2697 -0
  114. package/dist/ro-AVAWPKOO-42m6am1w.js +2697 -0
  115. package/dist/ro-BWR3ONRR-vzx3hy8a.js +173 -0
  116. package/dist/ru-GSCT4ARZ-jrxwev63.js +10 -0
  117. package/dist/ru-WBLQ5B2U-s4em88p0.js +10 -0
  118. package/dist/{serialization-BXU6AKAN-n5b0v0kd.js → serialization-BXU6AKAN-z0vcrhpz.js} +13 -12
  119. package/dist/services/connector-binding-validator.d.ts +10 -1
  120. package/dist/services/definitions-lookup.d.ts +27 -0
  121. package/dist/services/flow-debug-service.d.ts +290 -0
  122. package/dist/services/flow-eval-types.d.ts +2 -2
  123. package/dist/services/flow-eval-utils.d.ts +29 -0
  124. package/dist/services/flow-validate-service.d.ts +39 -0
  125. package/dist/services/node-validators/connector-validator.d.ts +8 -0
  126. package/dist/services/vars-reference-rule.d.ts +113 -13
  127. package/dist/{shared-utils-ka4xn0nn.js → shared-utils-wv356cvj.js} +1 -1
  128. package/dist/tidy-service-6s3tg778.js +39 -0
  129. package/dist/tool.js +13 -24
  130. package/dist/tr-5IIHSFW5-hw4cewew.js +173 -0
  131. package/dist/tr-JMIP7ZSL-fb67ft9w.js +2696 -0
  132. package/dist/utils/handle-expansion.d.ts +34 -0
  133. package/dist/utils/write-resolved-flow.d.ts +7 -0
  134. package/dist/validation.js +46 -39
  135. package/dist/{variable-service-55sbdkdj.js → variable-service-73bvxzy9.js} +22 -19
  136. package/dist/{wait-for-flow-job-xtnb6zfc.js → wait-for-flow-job-yp3mhy43.js} +8 -8
  137. package/dist/zh-CN-IFFXSEJS-tke4mzty.js +2697 -0
  138. package/dist/zh-CN-R2KU4U5L-tc1hat59.js +173 -0
  139. package/dist/zh-TW-GNKMELBF-j674515r.js +173 -0
  140. package/dist/zh-TW-IYBNYAMG-wcan0qpb.js +2697 -0
  141. package/package.json +3 -2
  142. package/dist/flow-init-service-hpqvmvfr.js +0 -38
  143. package/dist/flow-validate-service-2gkxvy3s.js +0 -59
  144. package/dist/known-types-eq32py2n.js +0 -20
  145. package/dist/packager-tool-2wefykg9.js +0 -106
  146. package/dist/packager-tool-8j92afwp.js +0 -58
  147. package/dist/packager-tool-jjpc0yka.js +0 -304
  148. package/dist/packager-tool-qjt4xans.js +0 -4945
  149. package/dist/tidy-service-a3qdxj8t.js +0 -36
  150. /package/dist/{localization-w8ada88j.js → localization-y790z9vm.js} +0 -0
@@ -6,12 +6,12 @@ import {
6
6
  orchestratorGet,
7
7
  orchestratorPost,
8
8
  studioWebPost
9
- } from "./packager-tool-sc5tddfj.js";
9
+ } from "./packager-tool-s0mzv3sx.js";
10
10
  import {
11
11
  RESULTS,
12
12
  catchError,
13
13
  logger
14
- } from "./packager-tool-rew0hp2h.js";
14
+ } from "./packager-tool-6k8s7pt9.js";
15
15
 
16
16
  // ../maestro-sdk/src/debug-service.ts
17
17
  import { randomUUID } from "node:crypto";
@@ -56,7 +56,12 @@ function injectSolutionProjectProcessEntries(fpsProperties, solutionProjects) {
56
56
  const entries = solutionProjects.map((project) => ({
57
57
  name: project.name,
58
58
  projectType: project.projectType,
59
- executorInfo: JSON.stringify({
59
+ executorInfo: JSON.stringify(project.projectType === "Function" ? {
60
+ projectId: project.projectId,
61
+ command: "debug",
62
+ args: ["--attach=none"],
63
+ entryPoint: project.entryPoint
64
+ } : {
60
65
  projectId: project.projectId,
61
66
  debugArgs: {
62
67
  debugMode: project.debugMode ?? DEBUG_MODE_MAP.Default,
@@ -274,6 +279,7 @@ var PIMS_TERMINAL_STATUSES = [
274
279
  "Cancelled",
275
280
  "Failed"
276
281
  ];
282
+ var ORCHESTRATOR_JOB_KEY = /^[0-9a-fA-F-]+$/;
277
283
  var ORCHESTRATOR_TERMINAL_STATUSES = [
278
284
  "Successful",
279
285
  "Faulted",
@@ -320,6 +326,10 @@ function buildPollTimeoutFailureOutput(err, inspectCommand) {
320
326
  async function pollDebugInstanceStatus(config, instanceId, callbacks, pollInterval = 2000, maxPolls = 300, jobKey) {
321
327
  let pollCount = 0;
322
328
  let lastStatus = "";
329
+ const canCheckOrchestratorJob = jobKey !== undefined && ORCHESTRATOR_JOB_KEY.test(jobKey);
330
+ if (jobKey !== undefined && !canCheckOrchestratorJob) {
331
+ logger.warn(`Skipping the Orchestrator job status fallback: "${jobKey}" is not a job key.`);
332
+ }
323
333
  while (pollCount < maxPolls) {
324
334
  const status = await debugPimsGet(config, `/api/v1/debug-instances/${instanceId}/element-executions`, "poll-instance-status");
325
335
  if (status.status !== lastStatus) {
@@ -340,8 +350,8 @@ async function pollDebugInstanceStatus(config, instanceId, callbacks, pollInterv
340
350
  logger.info(`Debug session reached terminal status: ${status.status}`);
341
351
  return status;
342
352
  }
343
- if (jobKey && pollCount > 0 && pollCount % 5 === 0) {
344
- const [, jobResponse] = await catchError(orchestratorGet(config, `/odata/Jobs?$filter=Key eq '${jobKey}'&$top=1`, "check-orchestrator-job-status"));
353
+ if (canCheckOrchestratorJob && pollCount > 0 && pollCount % 5 === 0) {
354
+ const [, jobResponse] = await catchError(orchestratorGet(config, `/odata/Jobs?$filter=Key eq ${jobKey}&$top=1`, "check-orchestrator-job-status"));
345
355
  const jobState = jobResponse?.value?.[0]?.State;
346
356
  if (jobState && ORCHESTRATOR_TERMINAL_STATUSES.includes(jobState)) {
347
357
  const jobInfo = jobResponse?.value?.[0]?.Info ?? "";
@@ -599,4 +609,4 @@ async function patchConnectionOverwrites(config, organizationName, solutionId, s
599
609
 
600
610
  export { FpsPropertiesInjectionError, injectInlineAgentProcessEntries, injectSolutionProjectProcessEntries, extractStartEventId, getPersonalFolderKey, getPersonalFolderInfo, prepareForCustomDebug, getFolderInfoById, beginDebugSession, DEBUG_MODE_MAP, SIMULATION_MODE_MAP, createDebugInstance, DebugPollTimeoutError, buildPollTimeoutFailureOutput, pollDebugInstanceStatus, fetchDebugInstanceIncidents, DebugVariablesFetchFailedError, fetchDebugInstanceVariables, isFaultedDebugStatus, isSuccessfulDebugStatus, resolveFaultIncidents, buildStudioWebDesignerUrl, uploadAndDebugSolution, patchConnectionOverwrites };
601
611
 
602
- //# debugId=50B9C8A084F4991B64756E2164756E21
612
+ //# debugId=F817DF346555CDD564756E2164756E21
@@ -3,7 +3,7 @@ import {
3
3
  } from "./packager-tool-w0kr4mbc.js";
4
4
  import {
5
5
  FlowToolFactory
6
- } from "./packager-tool-tr5gfx9a.js";
6
+ } from "./packager-tool-r7j4amsv.js";
7
7
 
8
8
  // src/packager-tool.ts
9
9
  function registerPackagerFactories() {
@@ -158,6 +158,9 @@ class ZipService {
158
158
  });
159
159
  return zipData;
160
160
  }
161
+ compressEntries(entries) {
162
+ return zipSync(entries, { level: 6 });
163
+ }
161
164
  }
162
165
  function isPluralForm(value) {
163
166
  return typeof value === "object" && value !== null && "other" in value;
@@ -1443,4 +1446,4 @@ var toolsFactoryRepository = _global[REGISTRY_KEY];
1443
1446
 
1444
1447
  export { Path, TemporaryStorageService, ZipService, I18nManager, translate, LogLevel, LogMessage, NugetConstants, ProjectTypes, TargetFramework, ToolErrorCodes, ToolResult, ensureProjectId, writeContentOperateFile, NugetPackager, ProjectTool, toolsFactoryRepository };
1445
1448
 
1446
- //# debugId=9B8BA321036CF45D64756E2164756E21
1449
+ //# debugId=F3B2EBDF290E821564756E2164756E21
@@ -1,8 +1,9 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "@uipath/flow-tool",
4
+ author: "UiPath",
4
5
  license: "SEE LICENSE IN LICENSE.txt",
5
- version: "1.202.1-preview.159",
6
+ version: "1.203.0-preview.160",
6
7
  description: "Create, debug, and run UiPath Flow projects and jobs.",
7
8
  private: false,
8
9
  repository: {
@@ -53,7 +54,7 @@ var package_default = {
53
54
  "@uipath/common": "workspace:*",
54
55
  "@uipath/filesystem": "workspace:*",
55
56
  "@uipath/flow-converter": "0.69.3",
56
- "@uipath/flow-core": "0.112.0",
57
+ "@uipath/flow-core": "0.115.4-develop",
57
58
  "@uipath/flow-expression-model": "0.11.4",
58
59
  "@uipath/flow-migrations": "0.56.2",
59
60
  "@uipath/flow-schema": "0.68.0",
@@ -74,4 +75,4 @@ var package_default = {
74
75
 
75
76
  export { package_default };
76
77
 
77
- //# debugId=BB50081F8023F01064756E2164756E21
78
+ //# debugId=0374E14B9144CC6F64756E2164756E21
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  enableErrorHandlingForErrorEdges,
3
3
  expandHandleIds
4
- } from "./packager-tool-nq4rcqqg.js";
4
+ } from "./packager-tool-1frs4sr4.js";
5
5
  import {
6
6
  readFlowWorkflow,
7
7
  writeFlowWorkflow
8
- } from "./packager-tool-j5mr6edn.js";
8
+ } from "./packager-tool-rpr68as1.js";
9
9
  import {
10
10
  DEFAULT_LAYOUT_OPTIONS,
11
11
  GRID_SPACING,
12
12
  resolveHeight,
13
13
  resolveWidth,
14
14
  snapToGrid
15
- } from "./packager-tool-29eg86w6.js";
15
+ } from "./packager-tool-6rsegsby.js";
16
16
  import {
17
17
  generateNodeVariables
18
- } from "./packager-tool-jjpc0yka.js";
18
+ } from "./packager-tool-vcjq9xkc.js";
19
19
  import {
20
20
  __require,
21
21
  __toESM
@@ -437,11 +437,187 @@ var ElkLayoutEngine = class {
437
437
  return { totalWidth: maxX - minX, totalHeight: maxY - minY, executionTime };
438
438
  }
439
439
  };
440
+ var SPINE_STRAIGHTNESS_PRIORITY = "1";
441
+ function findSpineEdgeIds(childIds, edges) {
442
+ if (childIds.length === 0 || edges.length === 0)
443
+ return /* @__PURE__ */ new Set;
444
+ const idSet = new Set(childIds);
445
+ const outDegree = new Map(childIds.map((id) => [id, 0]));
446
+ const inDegree = new Map(childIds.map((id) => [id, 0]));
447
+ for (const e of edges) {
448
+ const src = e.sources[0];
449
+ const tgt = e.targets[0];
450
+ if (!idSet.has(src) || !idSet.has(tgt) || src === tgt)
451
+ continue;
452
+ outDegree.set(src, (outDegree.get(src) ?? 0) + 1);
453
+ inDegree.set(tgt, (inDegree.get(tgt) ?? 0) + 1);
454
+ }
455
+ const spine = /* @__PURE__ */ new Set;
456
+ for (const e of edges) {
457
+ const src = e.sources[0];
458
+ const tgt = e.targets[0];
459
+ if (!idSet.has(src) || !idSet.has(tgt) || src === tgt)
460
+ continue;
461
+ if ((outDegree.get(src) ?? 0) === 1 && (inDegree.get(tgt) ?? 0) === 1) {
462
+ spine.add(e.id);
463
+ }
464
+ }
465
+ return spine;
466
+ }
467
+ function buildTidyElkContainer(containerId, params) {
468
+ const directChildren = params.childrenByParent.get(containerId) ?? [];
469
+ const localEdges = params.edgesByParent.get(containerId) ?? [];
470
+ const elkChildren = directChildren.map((child) => {
471
+ if (child.isContainer)
472
+ return buildTidyElkContainer(child.id, params);
473
+ const oh = params.overhangById?.get(child.id);
474
+ return {
475
+ id: child.id,
476
+ width: child.width + (oh?.left ?? 0) + (oh?.right ?? 0),
477
+ height: child.height + (oh?.top ?? 0) + (oh?.bottom ?? 0)
478
+ };
479
+ });
480
+ const spineEdgeIds = findSpineEdgeIds(directChildren.map((c) => c.id), localEdges);
481
+ const annotatedEdges = localEdges.map((e) => spineEdgeIds.has(e.id) ? { ...e, layoutOptions: { ...e.layoutOptions, "org.eclipse.elk.layered.priority.straightness": SPINE_STRAIGHTNESS_PRIORITY } } : e);
482
+ return {
483
+ id: containerId,
484
+ width: params.fit.minWidth,
485
+ height: params.fit.minHeight,
486
+ layoutOptions: {
487
+ "elk.algorithm": "layered",
488
+ "elk.direction": params.direction,
489
+ "elk.padding": params.fit.elkPadding,
490
+ "elk.spacing.nodeNode": String(params.nodeSpacing),
491
+ "elk.layered.spacing.nodeNodeBetweenLayers": String(params.layerSpacing),
492
+ "elk.layered.nodePlacement.strategy": "BRANDES_KOEPF",
493
+ "elk.layered.nodePlacement.bk.fixedAlignment": "BALANCED",
494
+ "elk.layered.considerModelOrder.strategy": "NODES_AND_EDGES",
495
+ "elk.layered.crossingMinimization.forceNodeModelOrder": "true",
496
+ ...params.orthogonalRouting ? { "elk.edgeRouting": "ORTHOGONAL" } : {},
497
+ "elk.hierarchyHandling": "SEPARATE_CHILDREN",
498
+ "elk.nodeSize.constraints": "MINIMUM_SIZE",
499
+ "elk.nodeSize.minimum": `(${params.fit.minWidth},${params.fit.minHeight})`
500
+ },
501
+ children: elkChildren,
502
+ edges: annotatedEdges
503
+ };
504
+ }
505
+ function clamp(value, lo, hi) {
506
+ if (hi < lo)
507
+ return lo;
508
+ return Math.min(hi, Math.max(lo, value));
509
+ }
510
+ function applyTidyContainerLayout(node, updates, containerOffsets, params) {
511
+ const { fit } = params;
512
+ const horizontal = params.direction === "RIGHT" || params.direction === "LEFT";
513
+ const children = node.children ?? [];
514
+ const isContainerElkNode = node.layoutOptions !== undefined;
515
+ if (children.length === 0) {
516
+ if (isContainerElkNode) {
517
+ const w = params.snapUp(Math.max(fit.minWidth, node.width ?? 0));
518
+ const h = params.snapUp(Math.max(fit.minHeight, node.height ?? 0));
519
+ updates.set(node.id, { width: w, height: h });
520
+ return { width: w, height: h };
521
+ }
522
+ return { width: node.width ?? params.defaultNodeSize, height: node.height ?? params.defaultNodeSize };
523
+ }
524
+ const childSizes = /* @__PURE__ */ new Map;
525
+ for (const child of children) {
526
+ childSizes.set(child.id, applyTidyContainerLayout(child, updates, containerOffsets, params));
527
+ }
528
+ const childAnchorAdjustments = horizontal && params.hooks?.resolveChildAnchorAdjustments ? params.hooks.resolveChildAnchorAdjustments(node.id, children, childSizes) : /* @__PURE__ */ new Map;
529
+ let minX = Number.POSITIVE_INFINITY;
530
+ let minY = Number.POSITIVE_INFINITY;
531
+ let maxX = 0;
532
+ let maxY = 0;
533
+ for (const child of children) {
534
+ const x = child.x ?? 0;
535
+ const y = (child.y ?? 0) + (childAnchorAdjustments.get(child.id) ?? 0);
536
+ const { width: w, height: h } = childSizes.get(child.id);
537
+ if (x < minX)
538
+ minX = x;
539
+ if (y < minY)
540
+ minY = y;
541
+ if (x + w > maxX)
542
+ maxX = x + w;
543
+ if (y + h > maxY)
544
+ maxY = y + h;
545
+ }
546
+ const bboxWidth = maxX - minX;
547
+ const bboxHeight = maxY - minY;
548
+ const finalWidth = params.snapUp(Math.max(fit.minWidth, bboxWidth + fit.paddingLeft + fit.paddingRight));
549
+ const baseHeight = params.snapUp(Math.max(fit.minHeight, bboxHeight + fit.paddingTop + fit.paddingBottom));
550
+ const dxTarget = (finalWidth - bboxWidth) / 2 - minX;
551
+ const dx = clamp(dxTarget, fit.paddingLeft - minX, finalWidth - fit.paddingRight - maxX);
552
+ const entryRailY = horizontal && params.hooks?.resolveEntryRail ? params.hooks.resolveEntryRail(node.id, children, childSizes, childAnchorAdjustments) : undefined;
553
+ let finalHeight = baseHeight;
554
+ let dy = clamp((finalHeight - bboxHeight) / 2 - minY, fit.paddingTop - minY, finalHeight - fit.paddingBottom - maxY);
555
+ if (typeof entryRailY === "number") {
556
+ finalHeight = params.snapUp(Math.max(baseHeight, 2 * (fit.paddingTop - minY + entryRailY), 2 * (maxY - entryRailY + fit.paddingBottom)));
557
+ dy = finalHeight / 2 - entryRailY;
558
+ }
559
+ containerOffsets.set(node.id, { dx, dy });
560
+ updates.set(node.id, { width: finalWidth, height: finalHeight });
561
+ for (const child of children) {
562
+ const size = childSizes.get(child.id);
563
+ const oh = params.overhangById?.get(child.id);
564
+ const offsetX = oh?.left ?? 0;
565
+ const offsetY = oh?.top ?? 0;
566
+ const realWidth = size.width - offsetX - (oh?.right ?? 0);
567
+ const realHeight = size.height - offsetY - (oh?.bottom ?? 0);
568
+ updates.set(child.id, {
569
+ position: {
570
+ x: snapToGrid((child.x ?? 0) + dx + offsetX),
571
+ y: snapToGrid((child.y ?? 0) + (childAnchorAdjustments.get(child.id) ?? 0) + dy + offsetY)
572
+ },
573
+ width: realWidth,
574
+ height: realHeight
575
+ });
576
+ }
577
+ return { width: finalWidth, height: finalHeight };
578
+ }
579
+ async function tidyContainerHierarchy(params) {
580
+ const root = buildTidyElkContainer(params.containerId, params);
581
+ const layouted = await params.layout(root);
582
+ const updates = /* @__PURE__ */ new Map;
583
+ const containerOffsets = /* @__PURE__ */ new Map;
584
+ applyTidyContainerLayout(layouted, updates, containerOffsets, params);
585
+ return { layouted, updates, containerOffsets };
586
+ }
587
+ function snapUpToGrid(value, gridSize = GRID_SPACING) {
588
+ return Math.ceil(value / gridSize) * gridSize;
589
+ }
590
+ var DEFAULT_INTERIOR_NODE_SPACING = 32;
591
+ var DEFAULT_INTERIOR_LAYER_SPACING = 64;
592
+ var DEFAULT_MIN_WIDTH = 560;
593
+ var DEFAULT_MIN_HEIGHT = 320;
594
+ var DEFAULT_PADDING_TOP = 96;
595
+ var DEFAULT_PADDING_BOTTOM = 48;
596
+ var DEFAULT_PADDING_LEFT = 144;
597
+ var DEFAULT_PADDING_RIGHT = 144;
598
+ function defaultContainerFit() {
599
+ return {
600
+ minWidth: DEFAULT_MIN_WIDTH,
601
+ minHeight: DEFAULT_MIN_HEIGHT,
602
+ paddingTop: DEFAULT_PADDING_TOP,
603
+ paddingBottom: DEFAULT_PADDING_BOTTOM,
604
+ paddingLeft: DEFAULT_PADDING_LEFT,
605
+ paddingRight: DEFAULT_PADDING_RIGHT,
606
+ elkPadding: `[top=${DEFAULT_PADDING_TOP},left=${DEFAULT_PADDING_LEFT},bottom=${DEFAULT_PADDING_BOTTOM},right=${DEFAULT_PADDING_RIGHT}]`
607
+ };
608
+ }
440
609
 
441
610
  // src/services/tidy-service.ts
442
611
  var COLLAPSED_NODE_SIZE = 96;
443
612
  var EXPANDED_RECTANGLE_WIDTH = 288;
444
- var CONTAINER_SIZE = { width: 560, height: 320 };
613
+ var CONTAINER_SIZE = {
614
+ width: defaultContainerFit().minWidth,
615
+ height: defaultContainerFit().minHeight
616
+ };
617
+ function parentIdOf(node) {
618
+ const pid = node?.parentId;
619
+ return typeof pid === "string" && pid.length > 0 ? pid : undefined;
620
+ }
445
621
  function expandedSizeForShape(shape) {
446
622
  if (shape === "container") {
447
623
  return { ...CONTAINER_SIZE };
@@ -625,6 +801,9 @@ function applyLayoutToNodes(nodes, layoutedNodes, shapeOf) {
625
801
  let repositioned = 0;
626
802
  let resized = 0;
627
803
  for (const node of nodes) {
804
+ if (UI_ONLY_NODE_TYPES.has(node.type)) {
805
+ continue;
806
+ }
628
807
  const newPos = positionMap.get(node.id);
629
808
  if (!newPos)
630
809
  continue;
@@ -634,9 +813,6 @@ function applyLayoutToNodes(nodes, layoutedNodes, shapeOf) {
634
813
  node.ui.position = { x: newPos.x, y: newPos.y };
635
814
  repositioned++;
636
815
  }
637
- if (UI_ONLY_NODE_TYPES.has(node.type)) {
638
- continue;
639
- }
640
816
  const targetSize = expandedSizeForShape(shapeOf(node));
641
817
  const currentSize = node.ui.size;
642
818
  const sizeNeedsUpdate = currentSize?.width !== targetSize.width || currentSize?.height !== targetSize.height;
@@ -647,23 +823,140 @@ function applyLayoutToNodes(nodes, layoutedNodes, shapeOf) {
647
823
  }
648
824
  return { repositioned, resized };
649
825
  }
826
+ function applyContainerLayout(nodes, childRelPositions, nodeSizes) {
827
+ let repositioned = 0;
828
+ let resized = 0;
829
+ for (const node of nodes) {
830
+ const rel = childRelPositions.get(node.id);
831
+ if (rel && (node.ui.position.x !== rel.x || node.ui.position.y !== rel.y)) {
832
+ node.ui.position = { x: rel.x, y: rel.y };
833
+ repositioned++;
834
+ }
835
+ const size = nodeSizes.get(node.id);
836
+ if (size && (node.ui.size?.width !== size.width || node.ui.size?.height !== size.height)) {
837
+ node.ui.size = size;
838
+ resized++;
839
+ }
840
+ }
841
+ return { repositioned, resized };
842
+ }
650
843
  async function tidyNodesAndEdges(engine, nodes, edges, portResolver, shapeOf) {
651
844
  if (nodes.length === 0) {
652
845
  return { repositioned: 0, resized: 0 };
653
846
  }
654
847
  const allNodes = nodesToLayoutNodes(nodes, shapeOf);
655
848
  const allEdges = edgesToLayoutEdges(edges);
849
+ const nodeIds = new Set(allNodes.map((n) => n.id));
850
+ const layoutNodeById = new Map(allNodes.map((n) => [n.id, n]));
851
+ const nodeInstanceOf = (id) => id === undefined ? undefined : layoutNodeById.get(id)?.data;
852
+ const isContainerId = (id) => {
853
+ const inst = nodeInstanceOf(id);
854
+ return inst !== undefined && shapeOf(inst) === "container";
855
+ };
856
+ const chainTerminates = (id) => {
857
+ const seen = new Set;
858
+ let cur = id;
859
+ while (cur !== undefined) {
860
+ if (seen.has(cur))
861
+ return false;
862
+ seen.add(cur);
863
+ const p = parentIdOf(nodeInstanceOf(cur));
864
+ if (p === undefined || !nodeIds.has(p))
865
+ return true;
866
+ cur = p;
867
+ }
868
+ return true;
869
+ };
870
+ const childrenByParent = new Map;
871
+ for (const n of allNodes) {
872
+ if (UI_ONLY_NODE_TYPES.has(n.type))
873
+ continue;
874
+ const pid = parentIdOf(n.data);
875
+ if (pid && pid !== n.id && nodeIds.has(pid) && isContainerId(pid) && chainTerminates(n.id)) {
876
+ const group = childrenByParent.get(pid);
877
+ if (group)
878
+ group.push(n);
879
+ else
880
+ childrenByParent.set(pid, [n]);
881
+ }
882
+ }
883
+ const containerChildIds = new Set([...childrenByParent.values()].flat().map((n) => n.id));
884
+ const interiorEdgesByParent = new Map;
885
+ for (const e of allEdges) {
886
+ const sp = parentIdOf(nodeInstanceOf(e.source));
887
+ const tp = parentIdOf(nodeInstanceOf(e.target));
888
+ if (sp && sp === tp) {
889
+ const list = interiorEdgesByParent.get(sp);
890
+ if (list)
891
+ list.push(e);
892
+ else
893
+ interiorEdgesByParent.set(sp, [e]);
894
+ }
895
+ }
896
+ const tidyChildrenByParent = new Map;
897
+ for (const [pid, kids] of childrenByParent) {
898
+ tidyChildrenByParent.set(pid, kids.map((k) => ({
899
+ id: k.id,
900
+ width: k.width ?? COLLAPSED_NODE_SIZE,
901
+ height: k.height ?? COLLAPSED_NODE_SIZE,
902
+ isContainer: childrenByParent.has(k.id)
903
+ })));
904
+ }
905
+ const elkEdgesByParent = new Map;
906
+ for (const [pid, es] of interiorEdgesByParent) {
907
+ elkEdgesByParent.set(pid, es.map((e) => ({
908
+ id: e.id,
909
+ sources: [e.source],
910
+ targets: [e.target]
911
+ })));
912
+ }
913
+ const childRelPositions = new Map;
914
+ const nodeSizes = new Map;
915
+ const topLevelContainerIds = [...childrenByParent.keys()].filter((id) => !containerChildIds.has(id));
916
+ for (const containerId of topLevelContainerIds) {
917
+ const { updates } = await tidyContainerHierarchy({
918
+ containerId,
919
+ childrenByParent: tidyChildrenByParent,
920
+ edgesByParent: elkEdgesByParent,
921
+ fit: defaultContainerFit(),
922
+ direction: "RIGHT",
923
+ nodeSpacing: DEFAULT_INTERIOR_NODE_SPACING,
924
+ layerSpacing: DEFAULT_INTERIOR_LAYER_SPACING,
925
+ orthogonalRouting: true,
926
+ snapUp: snapUpToGrid,
927
+ defaultNodeSize: COLLAPSED_NODE_SIZE,
928
+ layout: (root) => engine.layoutHierarchical(root)
929
+ });
930
+ for (const [id, upd] of updates) {
931
+ if (upd.position) {
932
+ childRelPositions.set(id, upd.position);
933
+ }
934
+ if (upd.width !== undefined && upd.height !== undefined) {
935
+ nodeSizes.set(id, { width: upd.width, height: upd.height });
936
+ }
937
+ }
938
+ }
656
939
  const artifactChildIds = identifyArtifactChildIds(allEdges, portResolver, allNodes);
657
940
  const collapsedIds = new Set(allNodes.filter((n) => n.data?.ui?.isCollapsed).map((n) => n.id));
658
941
  const hiddenIds = collectArtifactDescendants(collapsedIds, allEdges, artifactChildIds);
659
- const layoutNodes = allNodes.filter((n) => !hiddenIds.has(n.id));
660
- const layoutEdges = allEdges.filter((e) => !hiddenIds.has(e.source) && !hiddenIds.has(e.target));
942
+ const excludedIds = new Set([...hiddenIds, ...containerChildIds]);
943
+ const layoutNodes = allNodes.filter((n) => !excludedIds.has(n.id));
944
+ const layoutEdges = allEdges.filter((e) => !excludedIds.has(e.source) && !excludedIds.has(e.target));
661
945
  const hiddenNodes = allNodes.filter((n) => hiddenIds.has(n.id));
946
+ for (const n of layoutNodes) {
947
+ const grown = nodeSizes.get(n.id);
948
+ if (grown) {
949
+ n.width = grown.width;
950
+ n.height = grown.height;
951
+ }
952
+ }
662
953
  if (layoutNodes.length === 0) {
663
954
  return { repositioned: 0, resized: 0 };
664
955
  }
665
956
  const preLayoutPositions = new Map(layoutNodes.map((n) => [n.id, { ...n.position }]));
666
- const leftmostNode = layoutNodes.reduce((left, node) => node.position.x < left.position.x ? node : left);
957
+ const anchorCandidates = layoutNodes.filter((node) => !UI_ONLY_NODE_TYPES.has(node.type ?? ""));
958
+ const anchorPool = anchorCandidates.length > 0 ? anchorCandidates : layoutNodes;
959
+ const leftmostNode = anchorPool.reduce((left, node) => node.position.x < left.position.x ? node : left, anchorPool[0]);
667
960
  const originalLeftX = leftmostNode.position.x;
668
961
  const originalLeftY = leftmostNode.position.y;
669
962
  const { nodes: layoutedNodes } = await engine.layout(layoutNodes, layoutEdges, { ...DEFAULT_LAYOUT_OPTIONS, animate: false }, portResolver);
@@ -678,7 +971,11 @@ async function tidyNodesAndEdges(engine, nodes, edges, portResolver, shapeOf) {
678
971
  }
679
972
  const hiddenUpdates = propagateHiddenArtifactPositions(layoutedNodes, preLayoutPositions, hiddenNodes, allEdges, artifactChildIds);
680
973
  const allUpdated = [...layoutedNodes, ...hiddenUpdates];
681
- return applyLayoutToNodes(nodes, allUpdated, shapeOf);
974
+ const result = applyLayoutToNodes(nodes, allUpdated, shapeOf);
975
+ const nested = applyContainerLayout(nodes, childRelPositions, nodeSizes);
976
+ result.repositioned += nested.repositioned;
977
+ result.resized += nested.resized;
978
+ return result;
682
979
  }
683
980
  async function tidyFlow(filePath) {
684
981
  const { workflow, refMap } = await readFlowWorkflow(filePath);
@@ -754,4 +1051,4 @@ function regenerateNodeVariables(workflow) {
754
1051
 
755
1052
  export { UI_ONLY_NODE_TYPES, tidyFlow };
756
1053
 
757
- //# debugId=61782660AAF1BE9364756E2164756E21
1054
+ //# debugId=DEA00C408BBCA7A764756E2164756E21
@@ -1,13 +1,16 @@
1
1
  import {
2
2
  isRecord
3
- } from "./packager-tool-8j92afwp.js";
3
+ } from "./packager-tool-gzpvdcnw.js";
4
4
  import {
5
5
  collectAgentInputLeaves,
6
6
  isInlineAgentNodeType
7
- } from "./packager-tool-tr5gfx9a.js";
7
+ } from "./packager-tool-r7j4amsv.js";
8
+ import {
9
+ isStartEventNode
10
+ } from "./packager-tool-fvm2dddf.js";
8
11
  import {
9
12
  catchError
10
- } from "./packager-tool-rew0hp2h.js";
13
+ } from "./packager-tool-6k8s7pt9.js";
11
14
 
12
15
  // src/services/flow-eval-node-target.ts
13
16
  function findFlowNode(flowContent, nodeId) {
@@ -21,6 +24,21 @@ function findFlowNode(flowContent, nodeId) {
21
24
  const node = [...topLevel, ...nested].find((candidate) => isRecord(candidate) && candidate.id === nodeId);
22
25
  return { flowParsed: true, node };
23
26
  }
27
+ function listTriggerNodeIds(flowContent) {
28
+ const [parseError, parsed] = catchError(() => JSON.parse(flowContent));
29
+ if (parseError || !isRecord(parsed) || !Array.isArray(parsed.nodes)) {
30
+ return [];
31
+ }
32
+ return parsed.nodes.filter((node) => isRecord(node) && typeof node.id === "string" && typeof node.type === "string" && isStartEventNode({
33
+ id: node.id,
34
+ type: node.type,
35
+ typeVersion: typeof node.typeVersion === "string" ? node.typeVersion : "1.0"
36
+ })).map((node) => node.id);
37
+ }
38
+ function formatTriggerIdsHint(flowContent) {
39
+ const triggerIds = flowContent === undefined ? [] : listTriggerNodeIds(flowContent);
40
+ return triggerIds.length > 0 ? ` Valid trigger node ids: ${triggerIds.join(", ")}.` : "";
41
+ }
24
42
  function readAgentSourceId(node) {
25
43
  const inputs = isRecord(node.inputs) ? node.inputs : undefined;
26
44
  const source = inputs?.source;
@@ -116,6 +134,6 @@ function readEvalSetScope(set) {
116
134
  return "flow";
117
135
  }
118
136
 
119
- export { findFlowNode, readAgentSourceId, isNodeEvalTarget, isDocumentEvalNode, readNodeTargetId, FlowAgentNodeSchemaReader, readEvalSetScope };
137
+ export { findFlowNode, listTriggerNodeIds, formatTriggerIdsHint, readAgentSourceId, isNodeEvalTarget, isDocumentEvalNode, readNodeTargetId, FlowAgentNodeSchemaReader, readEvalSetScope };
120
138
 
121
- //# debugId=D51E7B5AE34841EC64756E2164756E21
139
+ //# debugId=53DBC3C325A7BC8264756E2164756E21