@uipath/cli 1.198.0-preview.88 → 1.198.0-preview.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -68775,6 +68775,22 @@ async function readStdin() {
68775
68775
  process.stdin.on("error", reject);
68776
68776
  });
68777
68777
  }
68778
+ async function readStdinWithTimeout(timeoutMs) {
68779
+ let timer;
68780
+ const timeout = new Promise((resolve2) => {
68781
+ timer = setTimeout(() => {
68782
+ process.stdin.unref?.();
68783
+ resolve2(null);
68784
+ }, timeoutMs);
68785
+ });
68786
+ try {
68787
+ return await Promise.race([readStdin(), timeout]);
68788
+ } finally {
68789
+ if (timer) {
68790
+ clearTimeout(timer);
68791
+ }
68792
+ }
68793
+ }
68778
68794
  // ../common/src/telemetry/ship-succeeded.ts
68779
68795
  var shippedKeysSlot;
68780
68796
  var init_ship_succeeded = __esm(() => {
@@ -68838,7 +68854,7 @@ var init_package = __esm(() => {
68838
68854
  package_default = {
68839
68855
  name: "@uipath/cli",
68840
68856
  license: "MIT",
68841
- version: "1.198.0-preview.88",
68857
+ version: "1.198.0-preview.93",
68842
68858
  description: "Cross platform CLI for UiPath",
68843
68859
  repository: {
68844
68860
  type: "git",
@@ -130332,15 +130348,87 @@ async function reviewFeedback(draft, email3, attachmentCount, context) {
130332
130348
  const result = await confirmFeedback({ ...draft, slackThreadUrl }, { email: email3, attachmentCount }, (message) => context.output.writeErr(message));
130333
130349
  return result.action === "send" ? result.draft : undefined;
130334
130350
  }
130351
+ function validationError(message, instructions) {
130352
+ return {
130353
+ Result: RESULTS.ValidationError,
130354
+ Message: message,
130355
+ Instructions: instructions
130356
+ };
130357
+ }
130358
+ async function readRawDescription(options) {
130359
+ if (options.description !== undefined && options.descriptionFile !== undefined) {
130360
+ return {
130361
+ error: validationError("Both --description and --description-file were provided.", "Pass the description through exactly one of --description, --description-file, or stdin.")
130362
+ };
130363
+ }
130364
+ if (options.description !== undefined) {
130365
+ return { text: options.description, source: "--description" };
130366
+ }
130367
+ if (options.descriptionFile !== undefined) {
130368
+ return readDescriptionFile(options.descriptionFile);
130369
+ }
130370
+ const [readError, piped] = await catchError(readStdinWithTimeout(STDIN_READ_TIMEOUT_MS));
130371
+ if (readError) {
130372
+ return {
130373
+ error: validationError("Could not read description from stdin.", readError.message)
130374
+ };
130375
+ }
130376
+ if (piped !== null) {
130377
+ return { text: piped, source: "stdin" };
130378
+ }
130379
+ return {
130380
+ error: validationError("A description is required.", "Provide --description <text>, --description-file <path>, or pipe the body via stdin.")
130381
+ };
130382
+ }
130383
+ async function readDescriptionFile(filePath) {
130384
+ const fs7 = getFileSystem();
130385
+ if (!await fs7.exists(filePath)) {
130386
+ return {
130387
+ error: validationError(`Description file not found: "${filePath}"`, "Check the file path and try again.")
130388
+ };
130389
+ }
130390
+ const [readError, content] = await catchError(fs7.readFile(filePath, "utf-8"));
130391
+ if (readError || content === null) {
130392
+ return {
130393
+ error: validationError(`Could not read description file: "${filePath}"`, readError?.message ?? "Check that the file is readable and try again.")
130394
+ };
130395
+ }
130396
+ return { text: content, source: `--description-file "${filePath}"` };
130397
+ }
130398
+ async function resolveDescription(options) {
130399
+ const raw = await readRawDescription(options);
130400
+ if ("error" in raw) {
130401
+ return raw;
130402
+ }
130403
+ const description = raw.text.trim();
130404
+ if (description.length === 0) {
130405
+ return {
130406
+ error: validationError(`The description from ${raw.source} is empty.`, "Provide a non-empty description body.")
130407
+ };
130408
+ }
130409
+ const byteLength = Buffer.byteLength(description, "utf8");
130410
+ if (byteLength > MAX_DESCRIPTION_BYTES) {
130411
+ return {
130412
+ error: validationError(`The description from ${raw.source} is too large (${byteLength} bytes; max ${MAX_DESCRIPTION_BYTES}).`, "Shorten the description body and try again.")
130413
+ };
130414
+ }
130415
+ return { description };
130416
+ }
130335
130417
  function registerFeedbackCommand(program2, context) {
130336
130418
  const feedback = program2.command("feedback").description("Send bug reports and improvement suggestions");
130337
- feedback.command("send").description("Send feedback (bug report or improvement suggestion) to the UiPath team").requiredOption("--type <type>", "Feedback type: bug or improvement").requiredOption("--title <title>", "Issue title / summary").requiredOption("--description <text>", "Detailed description or steps to reproduce").option("--priority <priority>", "Priority: critical, normal, or minor (default: normal)", "normal").option("--email <email>", "Contact email address").option("--attachment <paths...>", "File(s) to attach (max 10, max 10MB each)").option("--slack-thread <url>", "Link to a related Slack discussion to include in the ticket").examples(FEEDBACK_SEND_EXAMPLES).trackedAction(context, async (options) => {
130419
+ feedback.command("send").description("Send feedback (bug report or improvement suggestion) to the UiPath team. Provide the description body via exactly one of --description, --description-file, or stdin.").requiredOption("--type <type>", "Feedback type: bug or improvement").requiredOption("--title <title>", "Issue title / summary").option("--description <text>", "Detailed description or steps to reproduce (single-line safe; for large multi-line bodies use --description-file or stdin)").option("--description-file <path>", "Read the description body from a file. Shell-safe for large multi-line markdown — required on Windows PowerShell, where inlining --description mangles the value").option("--priority <priority>", "Priority: critical, normal, or minor (default: normal)", "normal").option("--email <email>", "Contact email address").option("--attachment <paths...>", "File(s) to attach (max 10, max 10MB each)").option("--slack-thread <url>", "Link to a related Slack discussion to include in the ticket").examples(FEEDBACK_SEND_EXAMPLES).trackedAction(context, async (options) => {
130338
130420
  const attachments = options.attachment ?? [];
130339
- const validationError = await validateSendInputs(options, attachments);
130340
- if (validationError) {
130341
- OutputFormatter.error(validationError);
130421
+ const validationError2 = await validateSendInputs(options, attachments);
130422
+ if (validationError2) {
130423
+ OutputFormatter.error(validationError2);
130424
+ return;
130425
+ }
130426
+ const resolvedDescription = await resolveDescription(options);
130427
+ if ("error" in resolvedDescription) {
130428
+ OutputFormatter.error(resolvedDescription.error);
130342
130429
  return;
130343
130430
  }
130431
+ const description = resolvedDescription.description;
130344
130432
  const [deviceIdError, deviceId] = await catchError(getOrCreateDeviceId());
130345
130433
  if (deviceIdError) {
130346
130434
  OutputFormatter.error({
@@ -130356,7 +130444,7 @@ function registerFeedbackCommand(program2, context) {
130356
130444
  type: options.type,
130357
130445
  priority: options.priority,
130358
130446
  title: options.title,
130359
- description: options.description,
130447
+ description,
130360
130448
  slackThreadUrl: options.slackThread === undefined ? undefined : normalizeUrl(options.slackThread)
130361
130449
  };
130362
130450
  if (canPrompt()) {
@@ -130419,7 +130507,7 @@ function registerFeedbackCommand(program2, context) {
130419
130507
  attachmentCount: options.attachment?.length ?? 0
130420
130508
  }));
130421
130509
  }
130422
- var MAX_ATTACHMENTS = 10, FEEDBACK_SEND_EXAMPLES;
130510
+ var MAX_ATTACHMENTS = 10, FEEDBACK_SEND_EXAMPLES, STDIN_READ_TIMEOUT_MS = 1e4, MAX_DESCRIPTION_BYTES;
130423
130511
  var init_send_feedback = __esm(() => {
130424
130512
  init_src2();
130425
130513
  init_src();
@@ -130440,8 +130528,22 @@ var init_send_feedback = __esm(() => {
130440
130528
  Title: "Crash on login"
130441
130529
  }
130442
130530
  }
130531
+ },
130532
+ {
130533
+ Description: "Send a report with a large multi-line description read from a file (shell-safe on Windows PowerShell)",
130534
+ Command: 'uip feedback send --type bug --title "[RPA] Crash on run" --description-file ./feedback-body.md',
130535
+ Output: {
130536
+ Code: "FeedbackSent",
130537
+ Data: {
130538
+ IssueKey: "UIP-12346",
130539
+ IssueUrl: "https://uipath.atlassian.net/browse/UIP-12346",
130540
+ Type: "bug",
130541
+ Title: "[RPA] Crash on run"
130542
+ }
130543
+ }
130443
130544
  }
130444
130545
  ];
130546
+ MAX_DESCRIPTION_BYTES = 32 * 1024;
130445
130547
  });
130446
130548
 
130447
130549
  // src/commands/skills/agents/detect.ts
@@ -137654,21 +137756,6 @@ function isParsableJson(raw) {
137654
137756
  return false;
137655
137757
  }
137656
137758
  }
137657
- async function readStdinWithTimeout(timeoutMs) {
137658
- let timer;
137659
- const timeout = new Promise((resolve2) => {
137660
- timer = setTimeout(() => {
137661
- process.stdin.unref?.();
137662
- resolve2(null);
137663
- }, timeoutMs);
137664
- });
137665
- try {
137666
- return await Promise.race([readStdin(), timeout]);
137667
- } finally {
137668
- if (timer)
137669
- clearTimeout(timer);
137670
- }
137671
- }
137672
137759
  function resolveSkillsEventName(raw) {
137673
137760
  let token;
137674
137761
  try {
@@ -139422,4 +139509,4 @@ export {
139422
139509
  ready
139423
139510
  };
139424
139511
 
139425
- //# debugId=3205D8D666BB8C3A64756E2164756E21
139512
+ //# debugId=33AA27579DBA72F864756E2164756E21
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/cli",
3
3
  "license": "MIT",
4
- "version": "1.198.0-preview.88",
4
+ "version": "1.198.0-preview.93",
5
5
  "description": "Cross platform CLI for UiPath",
6
6
  "repository": {
7
7
  "type": "git",
@@ -34,5 +34,5 @@
34
34
  "mihaigirleanu",
35
35
  "vlad-uipath"
36
36
  ],
37
- "gitHead": "9be5d51c7d9ccd184c980771e7f06e240c75a9e2"
37
+ "gitHead": "559533da0c886708d0a553ed2adb5bcb74b26fac"
38
38
  }