@uipath/cli 1.196.0 → 1.196.2

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 (2) hide show
  1. package/dist/index.js +148 -28
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -946,6 +946,32 @@ function settlePromiseLike(thenable) {
946
946
  }
947
947
 
948
948
  // ../common/src/error-handler.ts
949
+ function describeConnectivityError(error) {
950
+ let current = error;
951
+ for (let depth = 0;depth < 5 && current !== null && typeof current === "object"; depth++) {
952
+ const cur = current;
953
+ const code = typeof cur.code === "string" ? cur.code : undefined;
954
+ const message = typeof cur.message === "string" ? cur.message : undefined;
955
+ if (code && TLS_ERROR_CODES.has(code)) {
956
+ return {
957
+ code,
958
+ kind: "tls",
959
+ message: message ?? code,
960
+ instructions: TLS_INSTRUCTIONS
961
+ };
962
+ }
963
+ if (code && NETWORK_ERROR_CODES.has(code)) {
964
+ return {
965
+ code,
966
+ kind: "network",
967
+ message: message ?? code,
968
+ instructions: NETWORK_INSTRUCTIONS
969
+ };
970
+ }
971
+ current = cur.cause;
972
+ }
973
+ return;
974
+ }
949
975
  function extractErrorMessageSync(error) {
950
976
  if (error instanceof Error) {
951
977
  return error.message;
@@ -960,7 +986,7 @@ function extractErrorMessageSync(error) {
960
986
  }
961
987
  return String(error);
962
988
  }
963
- var DEFAULT_401 = "Unauthorized (401). Run `uip login` to authenticate.", NETWORK_ERROR_CODES;
989
+ var DEFAULT_401 = "Unauthorized (401). Run `uip login` to authenticate.", NETWORK_ERROR_CODES, TLS_ERROR_CODES, TLS_INSTRUCTIONS, NETWORK_INSTRUCTIONS;
964
990
  var init_error_handler = __esm(() => {
965
991
  NETWORK_ERROR_CODES = new Set([
966
992
  "ECONNREFUSED",
@@ -973,6 +999,18 @@ var init_error_handler = __esm(() => {
973
999
  "ENETUNREACH",
974
1000
  "EAI_FAIL"
975
1001
  ]);
1002
+ TLS_ERROR_CODES = new Set([
1003
+ "SELF_SIGNED_CERT_IN_CHAIN",
1004
+ "DEPTH_ZERO_SELF_SIGNED_CERT",
1005
+ "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
1006
+ "UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
1007
+ "UNABLE_TO_GET_ISSUER_CERT",
1008
+ "CERT_HAS_EXPIRED",
1009
+ "CERT_UNTRUSTED",
1010
+ "ERR_TLS_CERT_ALTNAME_INVALID"
1011
+ ]);
1012
+ TLS_INSTRUCTIONS = "The server's TLS certificate could not be verified. Most often a " + "corporate proxy/firewall re-signs HTTPS with a root CA that Node does " + "not trust — set NODE_EXTRA_CA_CERTS to that CA's PEM file (and HTTPS_PROXY " + "if you connect through a proxy). If the certificate is instead expired or " + "its hostname does not match, fix the endpoint URL or the system clock. " + "Then retry.";
1013
+ NETWORK_INSTRUCTIONS = "Could not reach the UiPath service. Check your network connection and " + "VPN, confirm any HTTP_PROXY/HTTPS_PROXY/NO_PROXY settings are correct, " + "then retry.";
976
1014
  });
977
1015
 
978
1016
  // ../common/src/attachment-binding.ts
@@ -44573,6 +44611,12 @@ function resolveEnvReference(value) {
44573
44611
  }
44574
44612
  return value;
44575
44613
  }
44614
+
44615
+ // ../common/src/error-instructions.ts
44616
+ var init_error_instructions = __esm(() => {
44617
+ init_error_handler();
44618
+ });
44619
+
44576
44620
  // ../common/src/guid.ts
44577
44621
  var init_guid = () => {};
44578
44622
 
@@ -46168,6 +46212,7 @@ var init_src2 = __esm(() => {
46168
46212
  init_confirmation();
46169
46213
  init_constants();
46170
46214
  init_error_handler();
46215
+ init_error_instructions();
46171
46216
  init_formatter();
46172
46217
  init_guid();
46173
46218
  init_interactivity_context();
@@ -46195,7 +46240,7 @@ var init_package = __esm(() => {
46195
46240
  package_default = {
46196
46241
  name: "@uipath/cli",
46197
46242
  license: "MIT",
46198
- version: "1.196.0",
46243
+ version: "1.196.2",
46199
46244
  description: "Cross platform CLI for UiPath",
46200
46245
  repository: {
46201
46246
  type: "git",
@@ -51363,6 +51408,20 @@ function pickForChannel(versions, channel) {
51363
51408
  const tag = `-${channel}.`;
51364
51409
  return versions.find((v) => v.includes(tag)) ?? null;
51365
51410
  }
51411
+ function channelFallbacks(channel) {
51412
+ if (channel === "beta") {
51413
+ return ["beta", "alpha", "stable"];
51414
+ }
51415
+ return [channel];
51416
+ }
51417
+ function pickForChannelWithFallback(versions, channel) {
51418
+ for (const candidate of channelFallbacks(channel)) {
51419
+ const picked = pickForChannel(versions, candidate);
51420
+ if (picked)
51421
+ return picked;
51422
+ }
51423
+ return null;
51424
+ }
51366
51425
  async function isDevMode() {
51367
51426
  const [error, result] = await catchError((async () => {
51368
51427
  const fs7 = getFileSystem();
@@ -51661,7 +51720,7 @@ ${errors4.map((e) => ` - ${e}`).join(`
51661
51720
  }
51662
51721
  if (versionPrefix && info.availableVersions) {
51663
51722
  const matching = info.availableVersions.filter((v) => v.startsWith(versionPrefix));
51664
- const picked = pickForChannel(matching, channel);
51723
+ const picked = pickForChannelWithFallback(matching, channel);
51665
51724
  if (picked) {
51666
51725
  logger.debug(`Resolved version: ${picked} (${channel}, prefix match)`);
51667
51726
  return picked;
@@ -51670,7 +51729,7 @@ ${errors4.map((e) => ` - ${e}`).join(`
51670
51729
  return null;
51671
51730
  }
51672
51731
  if (channel !== "stable" && info.availableVersions) {
51673
- const picked = pickForChannel(info.availableVersions, channel);
51732
+ const picked = pickForChannelWithFallback(info.availableVersions, channel);
51674
51733
  logger.debug(`Resolved version: ${picked ?? "null"} (${channel}, no prefix)`);
51675
51734
  return picked;
51676
51735
  }
@@ -88934,12 +88993,28 @@ function instructionsForLoginError(error51, message) {
88934
88993
  if (code === AUTH_TIMEOUT_ERROR_CODE) {
88935
88994
  return `The browser did not return an authorization code within the timeout. Make sure your default browser opened, complete the sign-in, then retry. ${ENV_AUTH_FALLBACK_HINT}`;
88936
88995
  }
88996
+ const connectivity = describeConnectivityError(error51);
88997
+ if (connectivity) {
88998
+ return connectivity.instructions;
88999
+ }
88937
89000
  return `Inspect command arguments and message and try again. ${ENV_AUTH_FALLBACK_HINT}`;
88938
89001
  }
89002
+ function loginErrorMessage(error51) {
89003
+ const base = error51 instanceof Error ? error51.message : String(error51);
89004
+ const connectivity = describeConnectivityError(error51);
89005
+ if (connectivity && connectivity.message !== base) {
89006
+ return `${base}: ${connectivity.message}`;
89007
+ }
89008
+ return base;
89009
+ }
88939
89010
  function instructionsForStatusError(err) {
88940
89011
  if (err instanceof EnvAuthConfigError) {
88941
89012
  return "Check the UIPATH_CLI_* environment variables and re-run.";
88942
89013
  }
89014
+ const connectivity = describeConnectivityError(err);
89015
+ if (connectivity) {
89016
+ return connectivity.instructions;
89017
+ }
88943
89018
  return "Failed to read login status. Check your credentials file.";
88944
89019
  }
88945
89020
  function buildRefreshData(status) {
@@ -89054,7 +89129,7 @@ function registerLoginCommand(program2, context) {
89054
89129
  onEvent: handleAuthEvent
89055
89130
  }));
89056
89131
  if (error51) {
89057
- const message = error51 instanceof Error ? error51.message : String(error51);
89132
+ const message = loginErrorMessage(error51);
89058
89133
  trackAuthLogin(authFlow, {
89059
89134
  success: false,
89060
89135
  errorMessage: message
@@ -89122,7 +89197,7 @@ function registerLoginCommand(program2, context) {
89122
89197
  if (statusError) {
89123
89198
  OutputFormatter.error({
89124
89199
  Result: RESULTS.ConfigError,
89125
- Message: statusError.message,
89200
+ Message: loginErrorMessage(statusError),
89126
89201
  Instructions: instructionsForStatusError(statusError)
89127
89202
  });
89128
89203
  return;
@@ -89163,7 +89238,7 @@ function registerLoginCommand(program2, context) {
89163
89238
  if (statusError) {
89164
89239
  OutputFormatter.error({
89165
89240
  Result: RESULTS.AuthenticationError,
89166
- Message: `Could not read credentials: ${statusError.message}`,
89241
+ Message: `Could not read credentials: ${loginErrorMessage(statusError)}`,
89167
89242
  Instructions: instructionsForStatusError(statusError)
89168
89243
  });
89169
89244
  context.exit(2);
@@ -89191,7 +89266,7 @@ function registerLoginCommand(program2, context) {
89191
89266
  if (statusError) {
89192
89267
  OutputFormatter.error({
89193
89268
  Result: RESULTS.ConfigError,
89194
- Message: statusError.message,
89269
+ Message: loginErrorMessage(statusError),
89195
89270
  Instructions: instructionsForStatusError(statusError)
89196
89271
  });
89197
89272
  return;
@@ -89207,10 +89282,11 @@ function registerLoginCommand(program2, context) {
89207
89282
  }
89208
89283
  const [fetchError, data] = await catchError(auth.fetchTenants(status.baseUrl, status.accessToken, status.organizationId));
89209
89284
  if (fetchError) {
89285
+ const connectivity = describeConnectivityError(fetchError);
89210
89286
  OutputFormatter.error({
89211
89287
  Result: RESULTS.Failure,
89212
- Message: fetchError.message,
89213
- Instructions: "Failed to fetch tenants. Check your network connection and try again."
89288
+ Message: loginErrorMessage(fetchError),
89289
+ Instructions: connectivity?.instructions ?? "Failed to fetch tenants. Check your network connection and try again."
89214
89290
  });
89215
89291
  return;
89216
89292
  }
@@ -89268,7 +89344,7 @@ function registerLoginCommand(program2, context) {
89268
89344
  if (statusError) {
89269
89345
  OutputFormatter.error({
89270
89346
  Result: RESULTS.ConfigError,
89271
- Message: statusError.message,
89347
+ Message: loginErrorMessage(statusError),
89272
89348
  Instructions: instructionsForStatusError(statusError)
89273
89349
  });
89274
89350
  return;
@@ -106417,6 +106493,7 @@ var init_copilot = __esm(() => {
106417
106493
  init_detect();
106418
106494
  def4 = {
106419
106495
  localSubdir: [".github", "skills"],
106496
+ globalSubdir: [".copilot", "skills"],
106420
106497
  detect: () => verifiedCommandOnPath(["copilot"], /GitHub Copilot/i)
106421
106498
  };
106422
106499
  });
@@ -106441,11 +106518,21 @@ var init_gemini = __esm(() => {
106441
106518
  };
106442
106519
  });
106443
106520
 
106444
- // src/commands/skills/agents/opencode.ts
106521
+ // src/commands/skills/agents/kiro.ts
106445
106522
  var def7;
106446
- var init_opencode = __esm(() => {
106523
+ var init_kiro = __esm(() => {
106447
106524
  init_detect();
106448
106525
  def7 = {
106526
+ localSubdir: [".kiro", "skills"],
106527
+ detect: () => homePathExists(".kiro")
106528
+ };
106529
+ });
106530
+
106531
+ // src/commands/skills/agents/opencode.ts
106532
+ var def8;
106533
+ var init_opencode = __esm(() => {
106534
+ init_detect();
106535
+ def8 = {
106449
106536
  localSubdir: [".opencode", "skills"],
106450
106537
  globalSubdir: [".config", "opencode", "skills"],
106451
106538
  detect: () => verifiedCommandOnPath(["opencode"], /opencode/i, ["--help"])
@@ -106454,8 +106541,8 @@ var init_opencode = __esm(() => {
106454
106541
 
106455
106542
  // src/commands/skills/agents/index.ts
106456
106543
  function subdirFor(agent, isLocal) {
106457
- const def8 = AGENT_DEFS[agent];
106458
- return isLocal ? def8.localSubdir : def8.globalSubdir ?? def8.localSubdir;
106544
+ const def9 = AGENT_DEFS[agent];
106545
+ return isLocal ? def9.localSubdir : def9.globalSubdir ?? def9.localSubdir;
106459
106546
  }
106460
106547
  function getSkillsDir(agent, rootDir, isLocal) {
106461
106548
  const fs7 = getFileSystem();
@@ -106506,6 +106593,7 @@ var init_agents = __esm(() => {
106506
106593
  init_copilot();
106507
106594
  init_cursor();
106508
106595
  init_gemini();
106596
+ init_kiro();
106509
106597
  init_opencode();
106510
106598
  AGENT_DEFS = {
106511
106599
  claude: def2,
@@ -106513,8 +106601,9 @@ var init_agents = __esm(() => {
106513
106601
  copilot: def4,
106514
106602
  gemini: def6,
106515
106603
  codex: def3,
106516
- opencode: def7,
106517
- autopilot: def
106604
+ opencode: def8,
106605
+ autopilot: def,
106606
+ kiro: def7
106518
106607
  };
106519
106608
  });
106520
106609
 
@@ -106985,7 +107074,8 @@ var init_prompt = __esm(() => {
106985
107074
  "gemini",
106986
107075
  "codex",
106987
107076
  "opencode",
106988
- "autopilot"
107077
+ "autopilot",
107078
+ "kiro"
106989
107079
  ];
106990
107080
  AGENT_DISPLAY_NAMES = {
106991
107081
  claude: "Claude Code (Plugin)",
@@ -106994,7 +107084,8 @@ var init_prompt = __esm(() => {
106994
107084
  gemini: "Gemini CLI",
106995
107085
  codex: "Codex",
106996
107086
  opencode: "OpenCode",
106997
- autopilot: "UiPath Autopilot"
107087
+ autopilot: "UiPath Autopilot",
107088
+ kiro: "Kiro (Amazon Q)"
106998
107089
  };
106999
107090
  });
107000
107091
 
@@ -107070,8 +107161,8 @@ async function detectInstalledAgents(isLocal) {
107070
107161
  }
107071
107162
  async function runOneAgent(agent, operation, resolved) {
107072
107163
  const { rootDir, storePath, selectedSkills, isLocal } = resolved;
107073
- const def8 = AGENT_DEFS[agent];
107074
- const customHook = operation === "update" ? def8.update ?? def8.install : def8.install;
107164
+ const def9 = AGENT_DEFS[agent];
107165
+ const customHook = operation === "update" ? def9.update ?? def9.install : def9.install;
107075
107166
  if (customHook) {
107076
107167
  const [installError] = await catchError(customHook({ skills: selectedSkills, rootDir, storePath, isLocal }));
107077
107168
  if (installError) {
@@ -107293,9 +107384,9 @@ async function readSkillNames(storePath) {
107293
107384
  }
107294
107385
  async function uninstallForAgent(targetAgent, ctx, uninstalled) {
107295
107386
  const { skillNames, rootDir, storePath, isLocal } = ctx;
107296
- const def8 = AGENT_DEFS[targetAgent];
107297
- if (def8.uninstall) {
107298
- const [err] = await catchError(def8.uninstall({ skillNames, rootDir, storePath, isLocal }));
107387
+ const def9 = AGENT_DEFS[targetAgent];
107388
+ if (def9.uninstall) {
107389
+ const [err] = await catchError(def9.uninstall({ skillNames, rootDir, storePath, isLocal }));
107299
107390
  if (err) {
107300
107391
  OutputFormatter.error({
107301
107392
  Result: RESULTS.Failure,
@@ -112519,9 +112610,9 @@ async function runSync(context, state, opts) {
112519
112610
  return false;
112520
112611
  }
112521
112612
  const fs7 = getFileSystem();
112522
- return opts.fromLogin ? runLoginEnvSync(state, fs7) : runDailyAutoUpdate(state, fs7);
112613
+ return opts.fromLogin ? runLoginEnvSync(fs7) : runDailyAutoUpdate(state, fs7);
112523
112614
  }
112524
- async function runLoginEnvSync(state, fs7) {
112615
+ async function runLoginEnvSync(fs7) {
112525
112616
  const { auth: auth2 } = await Promise.resolve().then(() => (init_auth(), exports_auth));
112526
112617
  const [statusErr, status] = await catchError(auth2.getLoginStatus());
112527
112618
  if (statusErr || status.loginStatus !== "Logged in" || !status.baseUrl) {
@@ -112571,8 +112662,8 @@ async function runLoginEnvSync(state, fs7) {
112571
112662
  } else {
112572
112663
  logger.debug(`core.version already ${pinned} (environment); re-checking alignment`);
112573
112664
  }
112574
- await writeState(fs7, { lastUpdateDate: todayLocal() });
112575
- return applyUpdate(state, fs7, resolvePinnedVersion(), false);
112665
+ await clearState(fs7);
112666
+ return false;
112576
112667
  }
112577
112668
  async function runDailyAutoUpdate(state, fs7) {
112578
112669
  const today = todayLocal();
@@ -112728,6 +112819,12 @@ async function readState(fs7) {
112728
112819
  async function writeState(fs7, state) {
112729
112820
  await catchError(fs7.writeFile(stateFilePath(fs7), JSON.stringify(state, null, 2)));
112730
112821
  }
112822
+ async function clearState(fs7) {
112823
+ const [rmErr] = await catchError(fs7.rm(stateFilePath(fs7)));
112824
+ if (rmErr) {
112825
+ logger.debug(`Failed to clear version sync state: ${rmErr.message}`);
112826
+ }
112827
+ }
112731
112828
  async function downloadVersions() {
112732
112829
  const [dlErr, raw] = await catchError(toolService.downloadPackageFile(VERSIONS_PACKAGE, VERSIONS_FILENAME, {
112733
112830
  timeoutMs: DOWNLOAD_TIMEOUT_MS,
@@ -113073,14 +113170,37 @@ class TerminalSink {
113073
113170
  }
113074
113171
  }
113075
113172
 
113173
+ // src/system-ca.ts
113174
+ import * as tls from "node:tls";
113175
+ function installSystemCaTrust(tlsModule = tls) {
113176
+ const getCertificates = tlsModule.getCACertificates;
113177
+ const setDefaultCertificates = tlsModule.setDefaultCACertificates;
113178
+ if (typeof getCertificates !== "function" || typeof setDefaultCertificates !== "function") {
113179
+ return "unsupported";
113180
+ }
113181
+ try {
113182
+ const system = getCertificates.call(tlsModule, "system");
113183
+ if (!Array.isArray(system) || system.length === 0) {
113184
+ return "empty";
113185
+ }
113186
+ const current = getCertificates.call(tlsModule, "default") ?? [];
113187
+ setDefaultCertificates.call(tlsModule, [...current, ...system]);
113188
+ return "applied";
113189
+ } catch {
113190
+ return "error";
113191
+ }
113192
+ }
113193
+
113076
113194
  // index.ts
113077
113195
  import { fileURLToPath as fileURLToPath4 } from "node:url";
113196
+ var systemCaTrust = installSystemCaTrust();
113078
113197
  process.stdout.on("error", (err) => {
113079
113198
  if (err.code === "EPIPE")
113080
113199
  process.exit(0);
113081
113200
  });
113082
113201
  process.stderr.on("error", () => {});
113083
113202
  configureLogger({ sink: new TerminalSink });
113203
+ logger.debug(`OS certificate-store trust: ${systemCaTrust}`);
113084
113204
  installConsoleGuard();
113085
113205
  var pollController = createPollAbortController();
113086
113206
  setProcessContextPollSignal(pollController.signal);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/cli",
3
3
  "license": "MIT",
4
- "version": "1.196.0",
4
+ "version": "1.196.2",
5
5
  "description": "Cross platform CLI for UiPath",
6
6
  "repository": {
7
7
  "type": "git",
@@ -31,5 +31,5 @@
31
31
  "mihaigirleanu",
32
32
  "vlad-uipath"
33
33
  ],
34
- "gitHead": "94d71f9c52214980a1f0ae62b3f5372095788553"
34
+ "gitHead": "fe1d29f88ea348e6c827b3126e2d5d8d755520aa"
35
35
  }