@uipath/cli 1.206.0-preview.301 → 1.207.0-preview.305

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 (69) hide show
  1. package/README.md +48 -0
  2. package/dist/{browser-strategy-p5fhwxqj.js → browser-strategy-5rfwnk5q.js} +1 -1
  3. package/dist/cli-10857d67.js +28 -0
  4. package/dist/cliInstaller-3dxg6fbd.js +23 -0
  5. package/dist/{contentStore-cd7gxxmj.js → contentStore-z3t1yt3n.js} +7 -6
  6. package/dist/{environmentInfo-mbanfdjh.js → environmentInfo-dyhpheza.js} +6 -6
  7. package/dist/{feedbackPrompts-bx209g5v.js → feedbackPrompts-fc66gq0p.js} +3 -3
  8. package/dist/forcedUpdate-5hd8cp9x.js +21 -0
  9. package/dist/{handlers-jjwt24f2.js → handlers-rg3d62gb.js} +13 -9
  10. package/dist/index-2f6vv7yr.js +81 -0
  11. package/dist/{index-hweqs8nn.js → index-2g332j2f.js} +8 -12
  12. package/dist/index-319vtrwd.js +264 -0
  13. package/dist/{index-nn9v5yjd.js → index-3vkb4j13.js} +26 -17
  14. package/dist/index-5j78gm9c.js +41 -0
  15. package/dist/index-5ygg5mrs.js +1272 -0
  16. package/dist/{index-99emfvtm.js → index-65pyx6c9.js} +4 -2
  17. package/dist/{index-rr5hdtcy.js → index-81197qe5.js} +15 -17
  18. package/dist/{index-2mm750yx.js → index-8n0z4r6f.js} +69 -13
  19. package/dist/{index-8zhmg5tz.js → index-8pk6n4t9.js} +2 -2
  20. package/dist/{index-7wmyb1v6.js → index-9v7334md.js} +1 -1
  21. package/dist/{index-nsrrst23.js → index-ack311y7.js} +12 -2
  22. package/dist/{index-2n2vr5w5.js → index-dt6mjnkf.js} +39 -57
  23. package/dist/{index-y7d0cth0.js → index-e82sznr2.js} +7 -7
  24. package/dist/index-ej6eeger.js +23 -0
  25. package/dist/index-evcsjfyy.js +248 -0
  26. package/dist/{index-bxc30q35.js → index-gk5pc8xr.js} +2 -2
  27. package/dist/{index-7q9kcs3w.js → index-h2ctqv68.js} +14 -5
  28. package/dist/index-jk7em40j.js +37 -0
  29. package/dist/{index-vhn8f5d2.js → index-kdr4xvby.js} +5 -5
  30. package/dist/{index-h9f8kms8.js → index-kmacaa53.js} +2130 -834
  31. package/dist/{index-ckp8r4dh.js → index-mb62swmp.js} +2 -2
  32. package/dist/{index-24ffa480.js → index-md27nny8.js} +7 -10
  33. package/dist/{index-zj63x8ca.js → index-nex3q8cg.js} +2 -2
  34. package/dist/index-nyx7fh45.js +331 -0
  35. package/dist/index-nzfpbep9.js +14 -0
  36. package/dist/{index-z070caqq.js → index-p64w2wrt.js} +30 -8
  37. package/dist/{index-3aymb07j.js → index-t6hrzpm7.js} +30 -14
  38. package/dist/index-v7yphxb8.js +118 -0
  39. package/dist/index-vrfbee4d.js +340 -0
  40. package/dist/{index-69mcde3n.js → index-xw81b1gn.js} +196 -81
  41. package/dist/{index-wg3cne7n.js → index-xxms6rt8.js} +24 -5
  42. package/dist/{index-21kns9qg.js → index-y7v9rkq9.js} +1 -1
  43. package/dist/{index-dst4pf6j.js → index-z3q16ts7.js} +81 -58
  44. package/dist/{index-fdztq951.js → index-zhp702kh.js} +393 -82
  45. package/dist/index.js +23 -18
  46. package/dist/{install-kgcwdbqs.js → install-h76qyy1e.js} +6 -7
  47. package/dist/{node-strategy-p1n8wr5s.js → node-strategy-9t0ttffv.js} +2 -2
  48. package/dist/{project-context-caht70an.js → project-context-rc4ghykm.js} +13 -5
  49. package/dist/{prompt-8emxd7jz.js → prompt-66bnttv7.js} +5 -5
  50. package/dist/{server-pzt8qbff.js → server-pxfn9w9m.js} +5 -5
  51. package/dist/{skillCatalog-ppk9wtx1.js → skillCatalog-7gh14b4s.js} +8 -7
  52. package/dist/skillsService-wz3c21qb.js +35 -0
  53. package/dist/{telemetry-drain-rt346cfz.js → telemetry-drain-8qr5tzmf.js} +2 -2
  54. package/dist/tree-fk9gwh4v.js +16 -0
  55. package/dist/updateService-ybs9274t.js +377 -0
  56. package/dist/updateService.cli-xtqp78g7.js +15 -0
  57. package/dist/updateService.skills-pgst1fyj.js +27 -0
  58. package/dist/updateService.tools-m58m2fbt.js +19 -0
  59. package/package.json +2 -2
  60. package/dist/cli-5679d26y.js +0 -23
  61. package/dist/index-3qp7d08f.js +0 -240
  62. package/dist/index-3zf0ywpb.js +0 -95
  63. package/dist/index-753mncpq.js +0 -271
  64. package/dist/index-7sm7r2tj.js +0 -45
  65. package/dist/skillsService-mzk0y9kz.js +0 -29
  66. package/dist/tree-4dhk82fh.js +0 -17
  67. package/dist/updateService-7bygdrjv.js +0 -522
  68. package/dist/updateService.skills-3rpemp0h.js +0 -22
  69. package/dist/updateService.tools-3zfct9yk.js +0 -16
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import"./index-z070caqq.js";
2
+ import"./index-p64w2wrt.js";
3
3
  import {
4
4
  logger,
5
5
  configureLogger,
@@ -11,27 +11,32 @@ import {
11
11
  setProcessContextPollSignal,
12
12
  installConsoleGuard,
13
13
  createPollAbortController
14
- } from "./index-fdztq951.js";
15
- import"./index-99emfvtm.js";
14
+ } from "./index-zhp702kh.js";
15
+ import"./index-65pyx6c9.js";
16
16
  import {
17
17
  registerRobotClientLoader2
18
- } from "./index-2mm750yx.js";
18
+ } from "./index-8n0z4r6f.js";
19
19
  import {
20
20
  runNode
21
- } from "./index-h9f8kms8.js";
22
- import"./index-753mncpq.js";
23
- import"./index-vhn8f5d2.js";
24
- import"./index-8zhmg5tz.js";
25
- import"./index-hweqs8nn.js";
21
+ } from "./index-kmacaa53.js";
22
+ import"./index-ej6eeger.js";
23
+ import"./index-v7yphxb8.js";
24
+ import"./index-5ygg5mrs.js";
25
+ import"./index-kdr4xvby.js";
26
26
  import {
27
27
  ensureSystemCaTrustAsync
28
- } from "./index-3zf0ywpb.js";
29
- import"./index-69mcde3n.js";
30
- import"./index-2n2vr5w5.js";
31
- import"./index-7sm7r2tj.js";
32
- import"./index-wg3cne7n.js";
33
- import"./index-ckp8r4dh.js";
34
- import"./index-7q9kcs3w.js";
28
+ } from "./index-xw81b1gn.js";
29
+ import"./index-2f6vv7yr.js";
30
+ import"./index-evcsjfyy.js";
31
+ import"./index-jk7em40j.js";
32
+ import"./index-8pk6n4t9.js";
33
+ import"./index-2g332j2f.js";
34
+ import"./index-nyx7fh45.js";
35
+ import"./index-5j78gm9c.js";
36
+ import"./index-xxms6rt8.js";
37
+ import"./index-dt6mjnkf.js";
38
+ import"./index-mb62swmp.js";
39
+ import"./index-h2ctqv68.js";
35
40
  import {
36
41
  __toESM,
37
42
  __require
@@ -162,7 +167,7 @@ var isMain = __require.main == __require.module ?? process.argv[1] === currentFi
162
167
  if (isMain) {
163
168
  setTelemetrySidecarEntry(currentFile);
164
169
  if (process.argv[2] === TELEMETRY_DRAIN_ARGV) {
165
- const { drainPendingTelemetry } = await import("./telemetry-drain-rt346cfz.js");
170
+ const { drainPendingTelemetry } = await import("./telemetry-drain-8qr5tzmf.js");
166
171
  await drainPendingTelemetry();
167
172
  process.exit(0);
168
173
  }
@@ -173,4 +178,4 @@ export {
173
178
  run
174
179
  };
175
180
 
176
- //# debugId=629241929F9AB3BC64756E2164756E21
181
+ //# debugId=6937B829DC75A2C064756E2164756E21
@@ -1,13 +1,12 @@
1
- import"./index-z070caqq.js";
1
+ import"./index-p64w2wrt.js";
2
2
  import {
3
3
  catchError
4
- } from "./index-fdztq951.js";
5
- import"./index-vhn8f5d2.js";
6
- import"./index-69mcde3n.js";
7
- import"./index-3zf0ywpb.js";
4
+ } from "./index-zhp702kh.js";
5
+ import"./index-kdr4xvby.js";
6
+ import"./index-xw81b1gn.js";
8
7
  import {
9
8
  posixSq2
10
- } from "./index-bxc30q35.js";
9
+ } from "./index-gk5pc8xr.js";
11
10
 
12
11
  // src/commands/completion/bash.ts
13
12
  function generateBash(root) {
@@ -555,4 +554,4 @@ export {
555
554
  resolveUninstallTarget
556
555
  };
557
556
 
558
- //# debugId=F5BF273A118025BB64756E2164756E21
557
+ //# debugId=6E382E53CBCFF32464756E2164756E21
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  getFileSystem2
3
- } from "./index-z070caqq.js";
3
+ } from "./index-p64w2wrt.js";
4
4
  import {
5
5
  DEFAULT_AUTH_TIMEOUT_MS2,
6
6
  AUTH_TIMEOUT_ERROR_CODE2,
7
7
  AUTH_CANCELLED_ERROR_CODE2,
8
8
  AUTH_RECLAIMED_ERROR_CODE2
9
- } from "./index-99emfvtm.js";
9
+ } from "./index-65pyx6c9.js";
10
10
  import {
11
11
  catchError2
12
12
  } from "./index-xd2w5pct.js";
@@ -1,14 +1,22 @@
1
1
  import {
2
2
  getFileSystem2
3
- } from "./index-z070caqq.js";
3
+ } from "./index-p64w2wrt.js";
4
4
  import {
5
5
  ProjectDimensions,
6
6
  solutionIdentityProperties,
7
7
  projectKey,
8
8
  logger
9
- } from "./index-fdztq951.js";
9
+ } from "./index-zhp702kh.js";
10
10
 
11
11
  // ../solution-sdk/src/solution-file.ts
12
+ class SolutionFileError extends Error {
13
+ errorCode;
14
+ constructor(message, errorCode) {
15
+ super(message);
16
+ this.name = "SolutionFileError";
17
+ this.errorCode = errorCode;
18
+ }
19
+ }
12
20
  function toPortableRelativePath(relativePath) {
13
21
  return relativePath.replace(/\\/g, "/");
14
22
  }
@@ -21,11 +29,11 @@ async function findSolutionFileUpward(fs, startDir) {
21
29
  return fs.path.join(dir, files[0]);
22
30
  }
23
31
  if (files.length > 1) {
24
- throw new Error(`Multiple .uipx files found in ${dir}. Please specify which solution file to use.`);
32
+ throw new SolutionFileError(`Multiple .uipx files found in ${dir}. Please specify which solution file to use.`, "invalid_argument");
25
33
  }
26
34
  const parent = fs.path.dirname(dir);
27
35
  if (parent === dir) {
28
- throw new Error(`No .uipx solution file found (searched from ${startDir} to filesystem root)`);
36
+ throw new SolutionFileError(`No .uipx solution file found (searched from ${startDir} to filesystem root)`, "not_found");
29
37
  }
30
38
  dir = parent;
31
39
  }
@@ -91,4 +99,4 @@ export {
91
99
  readProjectSolutionContext
92
100
  };
93
101
 
94
- //# debugId=7BE43A2C9B9D908064756E2164756E21
102
+ //# debugId=A198C6E47A8DC0A164756E2164756E21
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  promptAgentSelection2
3
- } from "./index-7wmyb1v6.js";
3
+ } from "./index-9v7334md.js";
4
4
  import"./index-5j0bfd3e.js";
5
- import"./index-hweqs8nn.js";
6
- import"./index-ckp8r4dh.js";
7
- import"./index-fdztq951.js";
8
- import"./index-z070caqq.js";
5
+ import"./index-2g332j2f.js";
6
+ import"./index-mb62swmp.js";
7
+ import"./index-zhp702kh.js";
8
+ import"./index-p64w2wrt.js";
9
9
  export {
10
10
  promptAgentSelection2 as promptAgentSelection
11
11
  };
@@ -1,4 +1,4 @@
1
- import"./index-z070caqq.js";
1
+ import"./index-p64w2wrt.js";
2
2
  import {
3
3
  catchError,
4
4
  runWithSink,
@@ -10,11 +10,11 @@ import {
10
10
  resetExitCode,
11
11
  OUTPUT_FORMATS,
12
12
  collectCommands
13
- } from "./index-fdztq951.js";
14
- import"./index-99emfvtm.js";
13
+ } from "./index-zhp702kh.js";
14
+ import"./index-65pyx6c9.js";
15
15
  import {
16
16
  runWithAuthProfile2
17
- } from "./index-2mm750yx.js";
17
+ } from "./index-8n0z4r6f.js";
18
18
  import {
19
19
  string,
20
20
  number,
@@ -89,7 +89,7 @@ async function runOne(cleanArgs) {
89
89
  resetExitCode();
90
90
  setGlobalSink(sink);
91
91
  const [error] = await catchError(async () => {
92
- const { run } = await import("./cli-5679d26y.js");
92
+ const { run } = await import("./cli-10857d67.js");
93
93
  await runWithAuthProfile2(undefined, () => runWithSink(sink, () => run(context)));
94
94
  });
95
95
  if (error) {
@@ -4,13 +4,14 @@ import {
4
4
  writeSkillCatalog2,
5
5
  removeSkillCatalog2,
6
6
  searchSkillCatalog2
7
- } from "./index-24ffa480.js";
8
- import"./index-dst4pf6j.js";
9
- import"./index-ckp8r4dh.js";
10
- import"./index-3zf0ywpb.js";
11
- import"./index-fdztq951.js";
7
+ } from "./index-md27nny8.js";
8
+ import"./index-z3q16ts7.js";
9
+ import"./index-mb62swmp.js";
10
+ import"./index-jk7em40j.js";
11
+ import"./index-xw81b1gn.js";
12
+ import"./index-zhp702kh.js";
12
13
  import"./index-5gce5wfd.js";
13
- import"./index-z070caqq.js";
14
+ import"./index-p64w2wrt.js";
14
15
  export {
15
16
  SKILL_CATALOG_SKILL_NAME2 as SKILL_CATALOG_SKILL_NAME,
16
17
  buildSkillCatalog2 as buildSkillCatalog,
@@ -19,4 +20,4 @@ export {
19
20
  writeSkillCatalog2 as writeSkillCatalog
20
21
  };
21
22
 
22
- //# debugId=30ED806502B5BCEE64756E2164756E21
23
+ //# debugId=9B3FF20A5758770364756E2164756E21
@@ -0,0 +1,35 @@
1
+ import {
2
+ SkillsError2,
3
+ resolveSkillsTarget2,
4
+ resolveRootDir2,
5
+ resolveSkillsContext2,
6
+ runAgentInstalls2,
7
+ cleanupStaleSkills2
8
+ } from "./index-3vkb4j13.js";
9
+ import"./index-9v7334md.js";
10
+ import"./index-md27nny8.js";
11
+ import"./index-z3q16ts7.js";
12
+ import"./index-5j0bfd3e.js";
13
+ import"./index-evcsjfyy.js";
14
+ import"./index-2g332j2f.js";
15
+ import"./index-5ygg5mrs.js";
16
+ import"./index-v7yphxb8.js";
17
+ import"./index-ej6eeger.js";
18
+ import"./index-mb62swmp.js";
19
+ import"./index-jk7em40j.js";
20
+ import"./index-xw81b1gn.js";
21
+ import"./index-zhp702kh.js";
22
+ import"./index-8n0z4r6f.js";
23
+ import"./index-5gce5wfd.js";
24
+ import"./index-p64w2wrt.js";
25
+ import"./index-65pyx6c9.js";
26
+ export {
27
+ SkillsError2 as SkillsError,
28
+ cleanupStaleSkills2 as cleanupStaleSkills,
29
+ resolveRootDir2 as resolveRootDir,
30
+ resolveSkillsContext2 as resolveSkillsContext,
31
+ resolveSkillsTarget2 as resolveSkillsTarget,
32
+ runAgentInstalls2 as runAgentInstalls
33
+ };
34
+
35
+ //# debugId=658187AF219841B764756E2164756E21
@@ -1,4 +1,4 @@
1
- import"./index-z070caqq.js";
1
+ import"./index-p64w2wrt.js";
2
2
  import {
3
3
  catchError,
4
4
  logger,
@@ -8,7 +8,7 @@ import {
8
8
  discardClaimedSpoolFile,
9
9
  sweepTelemetrySpool,
10
10
  getTelemetryIngestionOrigin
11
- } from "./index-fdztq951.js";
11
+ } from "./index-zhp702kh.js";
12
12
 
13
13
  // src/services/telemetry-drain.ts
14
14
  import { promisify } from "node:util";
@@ -0,0 +1,16 @@
1
+ import {
2
+ buildFullTree2,
3
+ detectShell2,
4
+ posixSq2
5
+ } from "./index-gk5pc8xr.js";
6
+ import"./index-kdr4xvby.js";
7
+ import"./index-xw81b1gn.js";
8
+ import"./index-zhp702kh.js";
9
+ import"./index-p64w2wrt.js";
10
+ export {
11
+ buildFullTree2 as buildFullTree,
12
+ detectShell2 as detectShell,
13
+ posixSq2 as posixSq
14
+ };
15
+
16
+ //# debugId=D7773CE45FDFCC6764756E2164756E21
@@ -0,0 +1,377 @@
1
+ import"./index-p64w2wrt.js";
2
+ import {
3
+ catchError,
4
+ logger
5
+ } from "./index-zhp702kh.js";
6
+ import"./index-ej6eeger.js";
7
+ import {
8
+ parseVersionPin,
9
+ versionLinePrefix,
10
+ formatVersionPin,
11
+ matchesPin
12
+ } from "./index-v7yphxb8.js";
13
+ import {
14
+ freezeFailure
15
+ } from "./index-5ygg5mrs.js";
16
+ import {
17
+ TOOLS_WHITELIST,
18
+ compareSemver,
19
+ resolveToolPackageName,
20
+ toolShortName,
21
+ npmErrorCode,
22
+ classifyNpmOutput,
23
+ classifyInstallError,
24
+ isPermissionError
25
+ } from "./index-xw81b1gn.js";
26
+ import {
27
+ detectCliInstallContext2,
28
+ resolveUpdateCommand2,
29
+ detectShadowedCliInstall2,
30
+ readInstalledCliVersion2,
31
+ CliSelfUpdateError2,
32
+ runCliSelfUpdate2
33
+ } from "./index-319vtrwd.js";
34
+ import"./index-65pyx6c9.js";
35
+ import"./index-8n0z4r6f.js";
36
+ import {
37
+ checkCliVersion2,
38
+ isVersionPublished2
39
+ } from "./index-2f6vv7yr.js";
40
+ import {
41
+ TOOLS_UPDATE_PHASES2,
42
+ isListedTool2,
43
+ runToolsUpdate2,
44
+ readToolVersionsOnDisk2
45
+ } from "./index-vrfbee4d.js";
46
+ import"./index-5gce5wfd.js";
47
+ import"./index-jk7em40j.js";
48
+ import"./index-z3q16ts7.js";
49
+ import {
50
+ PIN_INSTALL_FAILED_INSTRUCTIONS,
51
+ TOOL_PIN_INSTRUCTIONS
52
+ } from "./index-evcsjfyy.js";
53
+ import"./index-2g332j2f.js";
54
+ import"./index-5j0bfd3e.js";
55
+ import"./index-9v7334md.js";
56
+ import"./index-md27nny8.js";
57
+ import"./index-3vkb4j13.js";
58
+ import {
59
+ runSkillsUpdate2
60
+ } from "./index-t6hrzpm7.js";
61
+ import {
62
+ channelForVersion
63
+ } from "./index-5j78gm9c.js";
64
+ import"./index-xxms6rt8.js";
65
+ import {
66
+ toolFailureRemediation,
67
+ describeDowngradeReason
68
+ } from "./index-dt6mjnkf.js";
69
+ import"./index-mb62swmp.js";
70
+
71
+ // src/services/updateService.pins.ts
72
+ async function offPinAfterUpdate(run, state) {
73
+ return [...await cliOffPin(run), ...await toolsOffPin(run, state)];
74
+ }
75
+ async function cliOffPin({
76
+ cliPin,
77
+ cliReport,
78
+ selfUpdate,
79
+ hostOwned,
80
+ cliPkgVersion,
81
+ isDev
82
+ }) {
83
+ if (isDev || cliReport?.action === "failed")
84
+ return [];
85
+ const installed = await readInstalledCliVersion2() ?? (detectCliInstallContext2().kind === "unknown" ? cliPkgVersion : undefined);
86
+ if (installed === undefined) {
87
+ return [
88
+ {
89
+ Subsystem: "cli",
90
+ ...freezeFailure("cliUnreadAfterUpdate", { pin: cliPin })
91
+ }
92
+ ];
93
+ }
94
+ if (matchesPin(cliPin, installed))
95
+ return [];
96
+ const skippedBy = cliReport === null ? "--no-cli-check" : !selfUpdate && !hostOwned && cliReport.action === "notice" ? "--no-self" : undefined;
97
+ return [
98
+ {
99
+ Subsystem: "cli",
100
+ ...freezeFailure("offPinAfterUpdate", {
101
+ name: "the CLI",
102
+ installed,
103
+ pin: cliPin,
104
+ skippedBy,
105
+ manualCommand: cliReport?.action === "notice" ? cliReport.manualCommand : undefined,
106
+ hostOwned
107
+ })
108
+ }
109
+ ];
110
+ }
111
+ async function toolsOffPin({ toolPins, toolName, toolEntries }, state) {
112
+ if (toolPins === undefined)
113
+ return [];
114
+ const failed = new Set((toolEntries ?? []).filter((entry) => entry.status === "failed").map((entry) => entry.name));
115
+ const pins = Object.entries(toolPins).filter(([packageName]) => TOOLS_WHITELIST.has(packageName) && !failed.has(toolShortName(packageName)) && (toolName === undefined || resolveToolPackageName(toolName) === packageName));
116
+ const onDisk = await readToolVersionsOnDisk2(state, pins.map(([packageName]) => toolShortName(packageName)));
117
+ return pins.flatMap(([packageName, pin]) => {
118
+ const installed = onDisk.get(toolShortName(packageName));
119
+ if (installed !== undefined && matchesPin(pin, installed)) {
120
+ return [];
121
+ }
122
+ return [
123
+ {
124
+ Subsystem: "tools",
125
+ ...freezeFailure("offPinAfterUpdate", {
126
+ name: packageName,
127
+ installed,
128
+ pin
129
+ })
130
+ }
131
+ ];
132
+ });
133
+ }
134
+
135
+ // src/services/updateService.ts
136
+ function isUnpublishedVersion(output, packageName, version) {
137
+ return npmErrorCode(output) === "ETARGET" && output.includes(`No matching version found for ${packageName}@${version}`);
138
+ }
139
+ function listedToolFailureClass(entry) {
140
+ const output = entry.error ?? "";
141
+ if (entry.to !== undefined && isUnpublishedVersion(output, resolveToolPackageName(entry.name), entry.to)) {
142
+ return { ErrorCode: "not_found", Retry: "RetryWillNotFix" };
143
+ }
144
+ return failedInstallClass(output, classifyNpmOutput(output));
145
+ }
146
+ function failedInstallClass(output, npmClass) {
147
+ const known = npmErrorCode(output) === "ETARGET" ? undefined : npmClass;
148
+ return failedRunClass(known ?? { errorCode: "unknown_error", retry: "RetryWillNotFix" });
149
+ }
150
+ function failedRunClass({
151
+ errorCode,
152
+ retry
153
+ }) {
154
+ return {
155
+ ErrorCode: errorCode === "unknown_error" ? "execution_failed" : errorCode,
156
+ Retry: retry
157
+ };
158
+ }
159
+ async function runUpdate(options, state, cliEnv) {
160
+ const { sections, channel, dryRun } = options;
161
+ const errors = [];
162
+ const onProgress = options.onProgress;
163
+ const selfUpdate = options.cli?.self !== false;
164
+ let detectedInstallCtx = null;
165
+ const getDetectedInstallCtx = () => {
166
+ detectedInstallCtx ??= detectCliInstallContext2();
167
+ return detectedInstallCtx;
168
+ };
169
+ if (sections.cli)
170
+ onProgress?.("Checking the CLI version…");
171
+ const pins = options.versionPins ?? {};
172
+ const cliPinned = options.versionPin !== undefined && options.versionPin !== null;
173
+ let cliReport = sections.cli ? await checkCliVersion2({
174
+ channel,
175
+ cliPkgVersion: cliEnv.cliPkgVersion,
176
+ isDev: cliEnv.isDev,
177
+ pin: options.versionPin ?? null,
178
+ maxMajor: options.maxMajor
179
+ }) : null;
180
+ if (cliReport?.action === "notice" && cliReport.available) {
181
+ const installCtx = getDetectedInstallCtx();
182
+ const target = `@uipath/cli@${cliReport.available}`;
183
+ const global = !cliEnv.isLocal;
184
+ const manualCommand = await resolveUpdateCommand2(target, installCtx, cliEnv.installPath, global);
185
+ if (dryRun || !selfUpdate || installCtx.kind === "unknown") {
186
+ cliReport = { ...cliReport, manualCommand };
187
+ }
188
+ if (installCtx.kind !== "unknown") {
189
+ const noticeReport = cliReport;
190
+ const available = noticeReport.available;
191
+ const pinOnBrew = installCtx.kind === "brew" && cliPinned && available !== noticeReport.current;
192
+ if (!dryRun && selfUpdate && pinOnBrew) {
193
+ errors.push({
194
+ Subsystem: "cli",
195
+ ...freezeFailure("cliPinOnBrew", { pin: available })
196
+ });
197
+ cliReport = { ...noticeReport, action: "failed" };
198
+ } else if (!dryRun && selfUpdate) {
199
+ const pin = options.versionPin ?? null;
200
+ if (pin && compareSemver(available, noticeReport.current) < 0) {
201
+ logger.info(`Downgrading @uipath/cli ${noticeReport.current} → ${available} to match ${describeDowngradeReason(options.versionPinOrigin)}.`);
202
+ }
203
+ onProgress?.(`Updating @uipath/cli to ${available}…`);
204
+ const [installErr] = await catchError(runCliSelfUpdate2(target, installCtx, cliEnv.installPath, global));
205
+ if (installErr && cliPinned && isUnpublishedVersion(installErr.message, "@uipath/cli", available)) {
206
+ errors.push({
207
+ Subsystem: "cli",
208
+ ...freezeFailure("cliPinNotPublished", {
209
+ pin: available
210
+ })
211
+ });
212
+ cliReport = { ...noticeReport, action: "failed" };
213
+ } else if (installErr) {
214
+ const isWindows = process.platform === "win32";
215
+ const instructions = isPermissionError(installErr) ? isWindows ? "Re-run from an elevated terminal (right-click → Run as administrator): uip update" : "Re-run with elevated permissions, e.g. sudo uip update" : `Run manually: ${getManualCommandForInstallError(installErr, manualCommand)}`;
216
+ errors.push({
217
+ Subsystem: "cli",
218
+ Result: "Failure",
219
+ Message: `Failed to self-update @uipath/cli to ${available}: ${installErr.message}`,
220
+ Instructions: instructions,
221
+ ...failedInstallClass(installErr.message, await classifyInstallError(installErr))
222
+ });
223
+ cliReport = { ...noticeReport, action: "failed" };
224
+ } else {
225
+ cliReport = { ...noticeReport, action: "updated" };
226
+ }
227
+ } else if (dryRun && selfUpdate && cliPinned && !pinOnBrew) {
228
+ const published = await isVersionPublished2("@uipath/cli", available);
229
+ if (published === false) {
230
+ errors.push({
231
+ Subsystem: "cli",
232
+ ...freezeFailure("cliPinNotPublished", {
233
+ pin: available
234
+ })
235
+ });
236
+ cliReport = { ...noticeReport, action: "failed" };
237
+ } else if (published === null) {
238
+ const reason = noticeReport.reason ?? `the CLI pin is ${available}`;
239
+ cliReport = {
240
+ ...noticeReport,
241
+ reason: `${reason}; could not check whether @uipath/cli@${available} is published, because the registry lookup failed`
242
+ };
243
+ }
244
+ }
245
+ }
246
+ }
247
+ if (sections.cli && !cliEnv.isDev) {
248
+ const installCtx = getDetectedInstallCtx();
249
+ const shadow = await detectShadowedCliInstall2(!cliEnv.isLocal, cliEnv.installPath, cliEnv.cliPkgVersion, installCtx);
250
+ if (shadow) {
251
+ logger.warn(`@uipath/cli ${shadow.installedVersion} is installed at ${shadow.packageDir}, ` + `but this process is running ${cliEnv.cliPkgVersion} from a different install. ` + "Your PATH may resolve an outdated copy — check `which uip` (Windows: `where uip`) " + "and update or remove the copy it points to.");
252
+ }
253
+ }
254
+ const settledCliVersion = resolveSettledCliVersion(cliReport, dryRun, selfUpdate, getDetectedInstallCtx);
255
+ const toolsChannel = (settledCliVersion ? channelForVersion(settledCliVersion) : undefined) ?? options.tools.channel ?? channel;
256
+ const toolsLinePrefix = settledCliVersion ? versionLinePrefix(settledCliVersion) : undefined;
257
+ let toolsReport = sections.tools && (!cliPinned || pins.tools) ? await runToolsUpdate2({
258
+ dryRun,
259
+ channel: toolsChannel,
260
+ cliVersionPrefix: toolsLinePrefix,
261
+ name: options.tools.name,
262
+ toolPins: pins.tools,
263
+ onProgress: onProgress ? ({ current, total, tool, phase }) => {
264
+ const verb = phase === TOOLS_UPDATE_PHASES2.Checking ? "Checking" : "Installing";
265
+ onProgress(`[${current}/${total}] ${verb} ${tool}`);
266
+ } : undefined
267
+ }, state) : null;
268
+ if (toolsReport?.fatal?.code === "NO_TOOLS_INSTALLED") {
269
+ toolsReport = { entries: [] };
270
+ }
271
+ if (toolsReport?.fatal) {
272
+ errors.push({
273
+ Subsystem: "tools",
274
+ Result: toolsReport.fatal.result,
275
+ Message: toolsReport.fatal.message,
276
+ Instructions: toolsReport.fatal.instructions,
277
+ ...toolsReport.fatal.errorCode ? { ErrorCode: toolsReport.fatal.errorCode } : {},
278
+ ...toolsReport.fatal.retry ? { Retry: toolsReport.fatal.retry } : {}
279
+ });
280
+ }
281
+ if (toolsReport) {
282
+ for (const entry of toolsReport.entries) {
283
+ if (entry.status === "failed") {
284
+ errors.push({
285
+ Subsystem: "tools",
286
+ Result: "Failure",
287
+ Message: `Failed to update ${entry.name}: ${entry.error ?? "unknown error"}`,
288
+ Instructions: entry.errorKind === "tool-pin" ? TOOL_PIN_INSTRUCTIONS : isListedTool2(pins.tools, entry.name) ? PIN_INSTALL_FAILED_INSTRUCTIONS : toolFailureRemediation(options.versionPinOrigin),
289
+ ...entry.errorKind !== "tool-pin" && isListedTool2(pins.tools, entry.name) ? listedToolFailureClass(entry) : {},
290
+ Kind: entry.errorKind,
291
+ Registry: entry.searchedRegistry
292
+ });
293
+ }
294
+ }
295
+ }
296
+ const targetVersion = resolveSkillsCliTarget(cliReport, dryRun, selfUpdate, cliEnv.cliPkgVersion, getDetectedInstallCtx);
297
+ const skillsPin = parseVersionPin(pins.skills);
298
+ const runSkills = sections.skills && (!cliPinned || skillsPin !== null);
299
+ if (runSkills)
300
+ onProgress?.("Refreshing skills…");
301
+ const skillsReport = runSkills ? await runSkillsUpdate2({
302
+ dryRun,
303
+ agent: options.skills.agent,
304
+ local: options.skills.local,
305
+ targetVersion: skillsPin ? formatVersionPin(skillsPin) : targetVersion,
306
+ skillsVersion: skillsPin ? formatVersionPin(skillsPin) : undefined
307
+ }) : null;
308
+ if (skillsReport) {
309
+ for (const s of skillsReport.sections) {
310
+ if (s.error) {
311
+ errors.push({
312
+ Subsystem: "skills",
313
+ Scope: s.scope,
314
+ Result: s.error.result,
315
+ Message: s.error.message,
316
+ Instructions: s.error.instructions,
317
+ ...s.error.errorCode ? { ErrorCode: s.error.errorCode } : {},
318
+ ...s.error.retry ? { Retry: s.error.retry } : {}
319
+ });
320
+ }
321
+ }
322
+ }
323
+ const offPin = !dryRun && options.versionPin && options.versionPinOrigin === "config" ? await offPinAfterUpdate({
324
+ cliPin: formatVersionPin(options.versionPin),
325
+ cliReport,
326
+ selfUpdate,
327
+ hostOwned: options.cli?.hostOwned === true,
328
+ cliPkgVersion: cliEnv.cliPkgVersion,
329
+ isDev: cliEnv.isDev,
330
+ toolPins: toolsReport && !toolsReport.fatal ? pins.tools : undefined,
331
+ toolName: options.tools.name,
332
+ toolEntries: toolsReport?.entries ?? null
333
+ }, state) : [];
334
+ errors.push(...offPin);
335
+ const toolsFailed = !!toolsReport && (!!toolsReport.fatal || toolsReport.entries.some((e) => e.status === "failed"));
336
+ const skillsFailed = !!skillsReport && skillsReport.sections.some((s) => !!s.error);
337
+ const cliFailed = cliReport?.action === "failed";
338
+ const toolsPayload = toolsReport && !toolsReport.fatal ? toolsReport.entries : null;
339
+ return {
340
+ DryRun: dryRun,
341
+ Channel: channel,
342
+ Cli: cliReport,
343
+ Tools: toolsPayload,
344
+ Skills: skillsReport ? { Sections: skillsReport.sections } : null,
345
+ Errors: errors,
346
+ HasFailures: toolsFailed || skillsFailed || cliFailed || offPin.length > 0
347
+ };
348
+ }
349
+ function resolveSkillsCliTarget(cliReport, dryRun, selfUpdate, fallbackVersion, getInstallCtx) {
350
+ if (cliReport?.action === "failed") {
351
+ return cliReport.current ?? fallbackVersion;
352
+ }
353
+ if (cliReport?.action === "updated") {
354
+ return cliReport.available ?? fallbackVersion;
355
+ }
356
+ if (dryRun && selfUpdate && cliReport?.action === "notice" && getInstallCtx().kind !== "unknown") {
357
+ return cliReport.available ?? fallbackVersion;
358
+ }
359
+ return cliReport?.current ?? fallbackVersion;
360
+ }
361
+ function resolveSettledCliVersion(cliReport, dryRun, selfUpdate, getInstallCtx) {
362
+ if (cliReport?.action === "updated") {
363
+ return cliReport.available ?? null;
364
+ }
365
+ if (dryRun && selfUpdate && cliReport?.action === "notice" && getInstallCtx().kind !== "unknown") {
366
+ return cliReport.available ?? null;
367
+ }
368
+ return null;
369
+ }
370
+ function getManualCommandForInstallError(error, fallback) {
371
+ return error instanceof CliSelfUpdateError2 ? error.manualCommand : fallback;
372
+ }
373
+ export {
374
+ runUpdate
375
+ };
376
+
377
+ //# debugId=86E35956E378D6C564756E2164756E21