@uipath/rpa-tool 1.202.1 → 1.203.0

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.
@@ -2058,7 +2058,7 @@ function addSdkUserAgentHeader(headers, userAgent) {
2058
2058
  }
2059
2059
  var package_default = {
2060
2060
  name: "@uipath/packager-orchestrator-client",
2061
- version: "1.202.0",
2061
+ version: "1.203.0",
2062
2062
  description: "UiPath packager client for Orchestrator package-feed interaction (feed discovery + NuGet source composition)",
2063
2063
  type: "module",
2064
2064
  private: true,
@@ -13093,28 +13093,32 @@ function isPlainRecord(value) {
13093
13093
  const prototype = Object.getPrototypeOf(value);
13094
13094
  return prototype === Object.prototype || prototype === null;
13095
13095
  }
13096
- function extractPagedRows(value) {
13096
+ function splitPagedEnvelope(value) {
13097
13097
  if (Array.isArray(value) || !isPlainRecord(value))
13098
13098
  return null;
13099
- const entries = Object.values(value);
13099
+ const entries = Object.entries(value);
13100
13100
  if (entries.length === 0)
13101
13101
  return null;
13102
- let rows = null;
13103
- let hasScalarSibling = false;
13104
- for (const entry of entries) {
13102
+ let found = null;
13103
+ const meta = Object.create(null);
13104
+ for (const [key, entry] of entries) {
13105
13105
  if (Array.isArray(entry)) {
13106
- if (rows !== null)
13106
+ if (found !== null)
13107
13107
  return null;
13108
- rows = entry;
13108
+ found = { key, rows: entry };
13109
13109
  } else if (entry !== null && typeof entry === "object") {
13110
13110
  return null;
13111
13111
  } else {
13112
- hasScalarSibling = true;
13112
+ meta[key] = entry;
13113
13113
  }
13114
13114
  }
13115
- if (rows === null || !hasScalarSibling)
13115
+ if (found === null || Object.keys(meta).length === 0)
13116
13116
  return null;
13117
- return rows;
13117
+ return { ...found, meta };
13118
+ }
13119
+ function extractPagedRows(value) {
13120
+ const paged = splitPagedEnvelope(value);
13121
+ return paged === null ? null : paged.rows;
13118
13122
  }
13119
13123
  function toLowerCamelCaseKey(key) {
13120
13124
  if (!key)
@@ -13218,6 +13222,9 @@ function printOutput(data, format = "json", logFn, asciiSafe = false, tableRowSt
13218
13222
  }
13219
13223
  break;
13220
13224
  }
13225
+ case "markdown":
13226
+ logFn(renderMarkdown(data));
13227
+ break;
13221
13228
  default: {
13222
13229
  const hasData = "Data" in data && data.Data != null;
13223
13230
  const pagedRows = hasData ? extractPagedRows(data.Data) : null;
@@ -13242,6 +13249,10 @@ function logOutput(data, format = "json", tableRowStyle) {
13242
13249
  printOutput(data, format, (msg) => sink.writeOut(`${msg}
13243
13250
  `), needsAsciiSafeJson(sink), styleFn);
13244
13251
  }
13252
+ var PLUMBING_KEYS = new Set(["code", "log"]);
13253
+ function isPlumbingKey(key) {
13254
+ return PLUMBING_KEYS.has(key.toLowerCase());
13255
+ }
13245
13256
  function cellToString(val) {
13246
13257
  return val != null && typeof val === "object" ? JSON.stringify(val) : String(val ?? "");
13247
13258
  }
@@ -13257,7 +13268,7 @@ function wrapText(text, width) {
13257
13268
  function printTable(data, logFn, externalLogValue, tableRowStyle) {
13258
13269
  if (data.length === 0)
13259
13270
  return;
13260
- const keys = Object.keys(data[0]).filter((key) => !["code", "log"].includes(key.toLowerCase()));
13271
+ const keys = Object.keys(data[0]).filter((key) => !isPlumbingKey(key));
13261
13272
  const maxWidths = keys.map((key) => Math.max(key.length, ...data.map((item) => cellToString(item[key]).length)));
13262
13273
  const header = keys.map((key, i) => key.padEnd(maxWidths[i])).join(" | ");
13263
13274
  logFn(header);
@@ -13279,7 +13290,7 @@ function isNonEmptyPlainObject(value) {
13279
13290
  }
13280
13291
  var NESTED_INDENT = " ";
13281
13292
  function printVerticalTable(data, logFn = console.log, externalLogValue) {
13282
- const keys = Object.keys(data).filter((key) => !["code", "log"].includes(key.toLowerCase()));
13293
+ const keys = Object.keys(data).filter((key) => !isPlumbingKey(key));
13283
13294
  if (keys.length === 0)
13284
13295
  return;
13285
13296
  const isBlockValue = (value) => isPlainObjectArray(value) || isNonEmptyPlainObject(value);
@@ -13310,7 +13321,7 @@ function printVerticalTable(data, logFn = console.log, externalLogValue) {
13310
13321
  function printResizableTable(data, logFn = console.log, externalLogValue, availableWidth, tableRowStyle) {
13311
13322
  if (data.length === 0)
13312
13323
  return;
13313
- const keys = Object.keys(data[0]).filter((key) => !["code", "log"].includes(key.toLowerCase()));
13324
+ const keys = Object.keys(data[0]).filter((key) => !isPlumbingKey(key));
13314
13325
  if (keys.length === 0)
13315
13326
  return;
13316
13327
  if (!process.stdout.isTTY) {
@@ -13384,6 +13395,216 @@ function printResizableTable(data, logFn = console.log, externalLogValue, availa
13384
13395
  logFn(`Log: ${externalLogValue}`);
13385
13396
  }
13386
13397
  }
13398
+ var MARKDOWN_MAX_CELL = 200;
13399
+ var MARKDOWN_MAX_DEPTH = 3;
13400
+ function markdownHeading(depth) {
13401
+ return "#".repeat(Math.min(3 + depth, 6));
13402
+ }
13403
+ var BACKTICK_RUN = /`+/g;
13404
+ function fencedBlock(text) {
13405
+ const first = text.trimStart()[0];
13406
+ const language = first === "<" ? "xml" : first === "{" || first === "[" ? "json" : "";
13407
+ const longestRun = Math.max(0, ...Array.from(text.matchAll(BACKTICK_RUN), (match) => match[0].length));
13408
+ const fence = "`".repeat(Math.max(3, longestRun + 1));
13409
+ return `${fence}${language}
13410
+ ${text}
13411
+ ${fence}`;
13412
+ }
13413
+ function markdownCell(value) {
13414
+ const text = value instanceof Date ? value.toISOString() : cellToString(value);
13415
+ return text.replace(/\s*\n\s*/g, " ").replace(/\|/g, "\\|");
13416
+ }
13417
+ function markdownLabel(key) {
13418
+ return key.replace(/\s*\n\s*/g, " ").replace(/[\\`*|]/g, "\\$&");
13419
+ }
13420
+ function withoutPlumbing(record) {
13421
+ const kept = Object.create(null);
13422
+ for (const [key, value] of Object.entries(record)) {
13423
+ if (!isPlumbingKey(key))
13424
+ kept[key] = value;
13425
+ }
13426
+ return kept;
13427
+ }
13428
+ function rowsWithoutPlumbing(rows) {
13429
+ return rows.map((row) => isPlainRecord(row) ? withoutPlumbing(row) : row);
13430
+ }
13431
+ function markdownTable(rows) {
13432
+ const columns = [];
13433
+ const seen = new Set;
13434
+ for (const row of rows) {
13435
+ for (const key of Object.keys(row)) {
13436
+ if (!seen.has(key)) {
13437
+ seen.add(key);
13438
+ columns.push(key);
13439
+ }
13440
+ }
13441
+ }
13442
+ if (columns.length === 0)
13443
+ return null;
13444
+ const cells = rows.map((row) => columns.map((key) => markdownCell(row[key])));
13445
+ if (cells.some((row) => row.some((c) => c.length > MARKDOWN_MAX_CELL))) {
13446
+ return null;
13447
+ }
13448
+ return [
13449
+ `| ${columns.map(markdownLabel).join(" | ")} |`,
13450
+ `| ${columns.map(() => "---").join(" | ")} |`,
13451
+ ...cells.map((row) => `| ${row.join(" | ")} |`)
13452
+ ].join(`
13453
+ `);
13454
+ }
13455
+ function extractMessageSequence(rows) {
13456
+ const messages = [];
13457
+ for (const row of rows) {
13458
+ const message = extractSingleMessage(row);
13459
+ if (message === null)
13460
+ return null;
13461
+ messages.push(message);
13462
+ }
13463
+ return messages.join(`
13464
+
13465
+ `);
13466
+ }
13467
+ function markdownRows(rows, depth) {
13468
+ if (rows.length === 0)
13469
+ return "(none)";
13470
+ if (!isPlainObjectArray(rows)) {
13471
+ return rows.map((item) => `- ${markdownCell(item)}`).join(`
13472
+ `);
13473
+ }
13474
+ const prose = extractMessageSequence(rows);
13475
+ if (prose !== null)
13476
+ return prose;
13477
+ const table = markdownTable(rows);
13478
+ if (table !== null)
13479
+ return table;
13480
+ if (depth >= MARKDOWN_MAX_DEPTH) {
13481
+ return fencedBlock(JSON.stringify(rows, null, 2));
13482
+ }
13483
+ return rows.map((row, index) => [
13484
+ `${markdownHeading(depth)} ${index + 1}`,
13485
+ markdownObject(row, depth + 1)
13486
+ ].join(`
13487
+
13488
+ `)).join(`
13489
+
13490
+ `);
13491
+ }
13492
+ function markdownObject(obj, depth) {
13493
+ const scalars = [];
13494
+ const blocks = [];
13495
+ for (const [key, value] of Object.entries(obj)) {
13496
+ if (value === undefined)
13497
+ continue;
13498
+ const label = markdownLabel(key);
13499
+ if (Array.isArray(value)) {
13500
+ blocks.push(`${markdownHeading(depth)} ${label}
13501
+
13502
+ ${markdownRows(value, depth + 1)}`);
13503
+ } else if (isNonEmptyPlainObject(value)) {
13504
+ const nested = depth < MARKDOWN_MAX_DEPTH ? markdownObject(value, depth + 1) : fencedBlock(JSON.stringify(value, null, 2));
13505
+ if (nested !== "") {
13506
+ blocks.push(`${markdownHeading(depth)} ${label}
13507
+
13508
+ ${nested}`);
13509
+ }
13510
+ } else if (typeof value === "string" && value.includes(`
13511
+ `)) {
13512
+ blocks.push(`**${label}:**
13513
+
13514
+ ${fencedBlock(value)}`);
13515
+ } else {
13516
+ scalars.push(`**${label}:** ${markdownCell(value)}`);
13517
+ }
13518
+ }
13519
+ const sections = scalars.length > 0 ? [scalars.join(`
13520
+ `)] : [];
13521
+ sections.push(...blocks);
13522
+ return sections.join(`
13523
+
13524
+ `);
13525
+ }
13526
+ function extractSingleMessage(payload) {
13527
+ if (!isPlainRecord(payload))
13528
+ return null;
13529
+ const keys = Object.keys(payload);
13530
+ if (keys.length !== 1 || keys[0].toLowerCase() !== "message")
13531
+ return null;
13532
+ const value = payload[keys[0]];
13533
+ return typeof value === "string" ? value : null;
13534
+ }
13535
+ function markdownPayload(payload) {
13536
+ const message = extractSingleMessage(payload);
13537
+ if (message !== null)
13538
+ return message;
13539
+ if (Array.isArray(payload)) {
13540
+ return markdownRows(rowsWithoutPlumbing(payload), 0);
13541
+ }
13542
+ const visible = withoutPlumbing(payload);
13543
+ const paged = splitPagedEnvelope(visible);
13544
+ if (paged !== null) {
13545
+ const meta = markdownObject(paged.meta, 0);
13546
+ const rows = `${markdownHeading(0)} ${markdownLabel(paged.key)}
13547
+
13548
+ ${markdownRows(rowsWithoutPlumbing(paged.rows), 1)}`;
13549
+ return meta === "" ? rows : `${meta}
13550
+
13551
+ ${rows}`;
13552
+ }
13553
+ return markdownObject(visible, 0);
13554
+ }
13555
+ function isPaginationWorthShowing(value) {
13556
+ if (typeof value !== "object" || value === null)
13557
+ return false;
13558
+ const page = value;
13559
+ return page.HasMore === true || typeof page.Offset === "number" && page.Offset > 0;
13560
+ }
13561
+ function markdownEnvelopeNotes(data) {
13562
+ const envelope = data;
13563
+ const notes = [];
13564
+ const warning = envelope.Warning;
13565
+ if (typeof warning === "string" && warning !== "") {
13566
+ notes.push(`> **Warning:** ${warning}`);
13567
+ }
13568
+ const instructions = envelope.Instructions;
13569
+ if (typeof instructions === "string" && instructions !== "") {
13570
+ notes.push(`> ${instructions}`);
13571
+ }
13572
+ const pagination = envelope.Pagination;
13573
+ if (isPaginationWorthShowing(pagination)) {
13574
+ const body = markdownObject(pagination, 1);
13575
+ if (body !== "") {
13576
+ notes.push(`${markdownHeading(0)} Pagination
13577
+
13578
+ ${body}`);
13579
+ }
13580
+ }
13581
+ const log = envelope.Log;
13582
+ if (typeof log === "string" && log !== "") {
13583
+ notes.push(`**Log:** ${log}`);
13584
+ }
13585
+ return notes;
13586
+ }
13587
+ function renderMarkdown(data) {
13588
+ if (data.Result !== RESULTS.Success) {
13589
+ const failure = data;
13590
+ const sections = [`**Failed:** ${failure.Message}`];
13591
+ if (failure.Data != null) {
13592
+ sections.push(markdownPayload(failure.Data));
13593
+ }
13594
+ if (failure.Instructions) {
13595
+ sections.push(`> ${failure.Instructions}`);
13596
+ }
13597
+ return sections.filter((section) => section !== "").join(`
13598
+
13599
+ `);
13600
+ }
13601
+ if (!("Data" in data) || data.Data == null) {
13602
+ return markdownObject(withoutPlumbing(data), 0);
13603
+ }
13604
+ return [markdownPayload(data.Data), ...markdownEnvelopeNotes(data)].filter((section) => section !== "").join(`
13605
+
13606
+ `);
13607
+ }
13387
13608
  function toYaml(data) {
13388
13609
  const codec = getYamlCodec();
13389
13610
  if (!codec) {
@@ -14300,6 +14521,7 @@ import { dirname as dirname2, join as join2 } from "node:path";
14300
14521
 
14301
14522
  // src/resolution/paths.ts
14302
14523
  var ROBOT_SUBDIR = "Robot";
14524
+ var HELM_DOTNET_MAJOR = 10;
14303
14525
  var HELM_EXE = process.platform === "win32" ? "UiPath.Studio.Helm.exe" : "UiPath.Studio.Helm";
14304
14526
 
14305
14527
  // src/resolution/runtime-arch.ts
@@ -14381,6 +14603,7 @@ import {
14381
14603
  import { homedir as homedir3 } from "node:os";
14382
14604
  import { join as join3 } from "node:path";
14383
14605
  var READY_MARKER = ".ready";
14606
+ var PAYLOAD_NOT_SHIPPED = new Set(["System.Activities.ViewModels.dll"]);
14384
14607
  var STALE_LOCK_MS = 5 * 60000;
14385
14608
  var STALE_STAGING_MS = 10 * 60000;
14386
14609
  function resolveHelmCacheRoot() {
@@ -14413,7 +14636,14 @@ function helmSlotIfReady(version, cacheRoot = resolveHelmCacheRoot()) {
14413
14636
  import { join as join4, posix, win32 } from "node:path";
14414
14637
  var ROBOT_WINDOWS_MARKER = "UiRobot.exe";
14415
14638
  var ROBOT_MACOS_MARKER = "UiRobot.dll";
14416
- var MACOS_ASSISTANT_ROBOT_PATH = "/Applications/UiPath Assistant.app/Contents/Robot";
14639
+ var MACOS_ASSISTANT_APP = "UiPath Assistant.app";
14640
+ var MACOS_CONNECTED_ASSISTANT_SUBDIR = "UiPath Connected/Assistant";
14641
+ var MACOS_CONNECTED_CURRENT = "current";
14642
+ var MACOS_BUNDLE_ROBOT_SUBDIRS = [
14643
+ "Contents/Resources/assistant/Robot",
14644
+ "Contents/Robot"
14645
+ ];
14646
+ var byVersionDesc = (a, b) => b.localeCompare(a, undefined, { numeric: true });
14417
14647
  var REGISTRY_HIVES = [
14418
14648
  "HKCU\\Software\\UiPath\\UiPath Studio",
14419
14649
  "HKLM\\Software\\UiPath\\UiPath Studio"
@@ -14438,6 +14668,32 @@ function resolveRobotComponentDir(installRoot, deps) {
14438
14668
  const nested = win32.join(installRoot, ROBOT_SUBDIR);
14439
14669
  return deps.fileExists(win32.join(nested, ROBOT_WINDOWS_MARKER)) ? nested : installRoot;
14440
14670
  }
14671
+ function* macosRobotDirCandidates(deps) {
14672
+ const home = process.env.HOME;
14673
+ const appRoots = [
14674
+ "/Applications",
14675
+ ...home ? [posix.join(home, "Applications")] : []
14676
+ ];
14677
+ for (const appRoot of appRoots) {
14678
+ const connectedDir = posix.join(appRoot, MACOS_CONNECTED_ASSISTANT_SUBDIR);
14679
+ let versions;
14680
+ try {
14681
+ versions = deps.readDir(connectedDir).filter((entry) => entry !== MACOS_CONNECTED_CURRENT).sort(byVersionDesc);
14682
+ } catch {
14683
+ versions = [];
14684
+ }
14685
+ const bundles = [
14686
+ posix.join(connectedDir, MACOS_CONNECTED_CURRENT, MACOS_ASSISTANT_APP),
14687
+ ...versions.map((version) => posix.join(connectedDir, version, MACOS_ASSISTANT_APP)),
14688
+ posix.join(appRoot, MACOS_ASSISTANT_APP)
14689
+ ];
14690
+ for (const bundle of bundles) {
14691
+ for (const subdir of MACOS_BUNDLE_ROBOT_SUBDIRS) {
14692
+ yield posix.join(bundle, subdir);
14693
+ }
14694
+ }
14695
+ }
14696
+ }
14441
14697
  function resolveRobotDir(cliPath, deps) {
14442
14698
  if (cliPath) {
14443
14699
  deps.log(`Using --robot-dir: ${cliPath}`);
@@ -14462,18 +14718,21 @@ function resolveRobotDir(cliPath, deps) {
14462
14718
  }
14463
14719
  }
14464
14720
  if (process.platform === "darwin") {
14465
- if (deps.fileExists(posix.join(MACOS_ASSISTANT_ROBOT_PATH, ROBOT_MACOS_MARKER))) {
14466
- deps.log(`Found robot at well-known path: ${MACOS_ASSISTANT_ROBOT_PATH}`);
14467
- return MACOS_ASSISTANT_ROBOT_PATH;
14721
+ for (const candidate of macosRobotDirCandidates(deps)) {
14722
+ if (deps.fileExists(posix.join(candidate, ROBOT_MACOS_MARKER))) {
14723
+ deps.log(`Found robot at well-known path: ${candidate}`);
14724
+ return candidate;
14725
+ }
14468
14726
  }
14469
14727
  }
14470
14728
  deps.log("Robot dir not resolved — Robot must already be running");
14471
14729
  return null;
14472
14730
  }
14473
14731
  var DOTNET_ROLL_FORWARD_ENV = {
14474
- DOTNET_ROLL_FORWARD: "Major"
14732
+ DOTNET_ROLL_FORWARD: "LatestMajor"
14475
14733
  };
14476
- var MIN_BUNDLED_DOTNET_MAJOR = 8;
14734
+ var DOTNET_ROOT_ARCH_ENV = `DOTNET_ROOT_${process.arch === "ia32" ? "X86" : process.arch.toUpperCase()}`;
14735
+ var MIN_BUNDLED_DOTNET_MAJOR = HELM_DOTNET_MAJOR;
14477
14736
  var DOTNET_ROOT_ENV = "UIPATH_DOTNET_ROOT";
14478
14737
  var RUNTIMES_SUBDIR = "Runtimes";
14479
14738
  var dotnetExeName = () => process.platform === "win32" ? "dotnet.exe" : "dotnet";
@@ -14508,7 +14767,7 @@ function* rootsAtOrUnder(dir, deps) {
14508
14767
  } catch {
14509
14768
  return;
14510
14769
  }
14511
- for (const entry of entries.sort((a, b) => b.localeCompare(a, undefined, { numeric: true }))) {
14770
+ for (const entry of entries.sort(byVersionDesc)) {
14512
14771
  yield layoutPath().join(dir, entry);
14513
14772
  }
14514
14773
  }
@@ -14518,6 +14777,8 @@ function* dotnetRootCandidates(robotDir, deps) {
14518
14777
  deps.log(`Using ${DOTNET_ROOT_ENV}: ${declaredRoot}`);
14519
14778
  yield* rootsAtOrUnder(declaredRoot, deps);
14520
14779
  }
14780
+ if (!robotDir)
14781
+ return;
14521
14782
  if (process.platform !== "win32") {
14522
14783
  yield layoutPath().join(robotDir, "dotnet");
14523
14784
  return;
@@ -14526,8 +14787,6 @@ function* dotnetRootCandidates(robotDir, deps) {
14526
14787
  yield* rootsAtOrUnder(win32.resolve(robotDir, "..", "..", RUNTIMES_SUBDIR), deps);
14527
14788
  }
14528
14789
  function resolveBundledDotnet(robotDir, deps) {
14529
- if (!robotDir)
14530
- return;
14531
14790
  for (const dotnetRoot of dotnetRootCandidates(robotDir, deps)) {
14532
14791
  const exePath = layoutPath().join(dotnetRoot, dotnetExeName());
14533
14792
  if (!deps.fileExists(exePath))
@@ -14542,6 +14801,7 @@ function resolveBundledDotnet(robotDir, deps) {
14542
14801
  exePath,
14543
14802
  env: {
14544
14803
  DOTNET_ROOT: dotnetRoot,
14804
+ [DOTNET_ROOT_ARCH_ENV]: dotnetRoot,
14545
14805
  DOTNET_MULTILEVEL_LOOKUP: "0",
14546
14806
  ...DOTNET_ROLL_FORWARD_ENV
14547
14807
  }