@uipath/cli 1.196.0 → 1.196.1

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 +147 -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.1",
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;
@@ -106441,11 +106517,21 @@ var init_gemini = __esm(() => {
106441
106517
  };
106442
106518
  });
106443
106519
 
106444
- // src/commands/skills/agents/opencode.ts
106520
+ // src/commands/skills/agents/kiro.ts
106445
106521
  var def7;
106446
- var init_opencode = __esm(() => {
106522
+ var init_kiro = __esm(() => {
106447
106523
  init_detect();
106448
106524
  def7 = {
106525
+ localSubdir: [".kiro", "skills"],
106526
+ detect: () => homePathExists(".kiro")
106527
+ };
106528
+ });
106529
+
106530
+ // src/commands/skills/agents/opencode.ts
106531
+ var def8;
106532
+ var init_opencode = __esm(() => {
106533
+ init_detect();
106534
+ def8 = {
106449
106535
  localSubdir: [".opencode", "skills"],
106450
106536
  globalSubdir: [".config", "opencode", "skills"],
106451
106537
  detect: () => verifiedCommandOnPath(["opencode"], /opencode/i, ["--help"])
@@ -106454,8 +106540,8 @@ var init_opencode = __esm(() => {
106454
106540
 
106455
106541
  // src/commands/skills/agents/index.ts
106456
106542
  function subdirFor(agent, isLocal) {
106457
- const def8 = AGENT_DEFS[agent];
106458
- return isLocal ? def8.localSubdir : def8.globalSubdir ?? def8.localSubdir;
106543
+ const def9 = AGENT_DEFS[agent];
106544
+ return isLocal ? def9.localSubdir : def9.globalSubdir ?? def9.localSubdir;
106459
106545
  }
106460
106546
  function getSkillsDir(agent, rootDir, isLocal) {
106461
106547
  const fs7 = getFileSystem();
@@ -106506,6 +106592,7 @@ var init_agents = __esm(() => {
106506
106592
  init_copilot();
106507
106593
  init_cursor();
106508
106594
  init_gemini();
106595
+ init_kiro();
106509
106596
  init_opencode();
106510
106597
  AGENT_DEFS = {
106511
106598
  claude: def2,
@@ -106513,8 +106600,9 @@ var init_agents = __esm(() => {
106513
106600
  copilot: def4,
106514
106601
  gemini: def6,
106515
106602
  codex: def3,
106516
- opencode: def7,
106517
- autopilot: def
106603
+ opencode: def8,
106604
+ autopilot: def,
106605
+ kiro: def7
106518
106606
  };
106519
106607
  });
106520
106608
 
@@ -106985,7 +107073,8 @@ var init_prompt = __esm(() => {
106985
107073
  "gemini",
106986
107074
  "codex",
106987
107075
  "opencode",
106988
- "autopilot"
107076
+ "autopilot",
107077
+ "kiro"
106989
107078
  ];
106990
107079
  AGENT_DISPLAY_NAMES = {
106991
107080
  claude: "Claude Code (Plugin)",
@@ -106994,7 +107083,8 @@ var init_prompt = __esm(() => {
106994
107083
  gemini: "Gemini CLI",
106995
107084
  codex: "Codex",
106996
107085
  opencode: "OpenCode",
106997
- autopilot: "UiPath Autopilot"
107086
+ autopilot: "UiPath Autopilot",
107087
+ kiro: "Kiro (Amazon Q)"
106998
107088
  };
106999
107089
  });
107000
107090
 
@@ -107070,8 +107160,8 @@ async function detectInstalledAgents(isLocal) {
107070
107160
  }
107071
107161
  async function runOneAgent(agent, operation, resolved) {
107072
107162
  const { rootDir, storePath, selectedSkills, isLocal } = resolved;
107073
- const def8 = AGENT_DEFS[agent];
107074
- const customHook = operation === "update" ? def8.update ?? def8.install : def8.install;
107163
+ const def9 = AGENT_DEFS[agent];
107164
+ const customHook = operation === "update" ? def9.update ?? def9.install : def9.install;
107075
107165
  if (customHook) {
107076
107166
  const [installError] = await catchError(customHook({ skills: selectedSkills, rootDir, storePath, isLocal }));
107077
107167
  if (installError) {
@@ -107293,9 +107383,9 @@ async function readSkillNames(storePath) {
107293
107383
  }
107294
107384
  async function uninstallForAgent(targetAgent, ctx, uninstalled) {
107295
107385
  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 }));
107386
+ const def9 = AGENT_DEFS[targetAgent];
107387
+ if (def9.uninstall) {
107388
+ const [err] = await catchError(def9.uninstall({ skillNames, rootDir, storePath, isLocal }));
107299
107389
  if (err) {
107300
107390
  OutputFormatter.error({
107301
107391
  Result: RESULTS.Failure,
@@ -112519,9 +112609,9 @@ async function runSync(context, state, opts) {
112519
112609
  return false;
112520
112610
  }
112521
112611
  const fs7 = getFileSystem();
112522
- return opts.fromLogin ? runLoginEnvSync(state, fs7) : runDailyAutoUpdate(state, fs7);
112612
+ return opts.fromLogin ? runLoginEnvSync(fs7) : runDailyAutoUpdate(state, fs7);
112523
112613
  }
112524
- async function runLoginEnvSync(state, fs7) {
112614
+ async function runLoginEnvSync(fs7) {
112525
112615
  const { auth: auth2 } = await Promise.resolve().then(() => (init_auth(), exports_auth));
112526
112616
  const [statusErr, status] = await catchError(auth2.getLoginStatus());
112527
112617
  if (statusErr || status.loginStatus !== "Logged in" || !status.baseUrl) {
@@ -112571,8 +112661,8 @@ async function runLoginEnvSync(state, fs7) {
112571
112661
  } else {
112572
112662
  logger.debug(`core.version already ${pinned} (environment); re-checking alignment`);
112573
112663
  }
112574
- await writeState(fs7, { lastUpdateDate: todayLocal() });
112575
- return applyUpdate(state, fs7, resolvePinnedVersion(), false);
112664
+ await clearState(fs7);
112665
+ return false;
112576
112666
  }
112577
112667
  async function runDailyAutoUpdate(state, fs7) {
112578
112668
  const today = todayLocal();
@@ -112728,6 +112818,12 @@ async function readState(fs7) {
112728
112818
  async function writeState(fs7, state) {
112729
112819
  await catchError(fs7.writeFile(stateFilePath(fs7), JSON.stringify(state, null, 2)));
112730
112820
  }
112821
+ async function clearState(fs7) {
112822
+ const [rmErr] = await catchError(fs7.rm(stateFilePath(fs7)));
112823
+ if (rmErr) {
112824
+ logger.debug(`Failed to clear version sync state: ${rmErr.message}`);
112825
+ }
112826
+ }
112731
112827
  async function downloadVersions() {
112732
112828
  const [dlErr, raw] = await catchError(toolService.downloadPackageFile(VERSIONS_PACKAGE, VERSIONS_FILENAME, {
112733
112829
  timeoutMs: DOWNLOAD_TIMEOUT_MS,
@@ -113073,14 +113169,37 @@ class TerminalSink {
113073
113169
  }
113074
113170
  }
113075
113171
 
113172
+ // src/system-ca.ts
113173
+ import * as tls from "node:tls";
113174
+ function installSystemCaTrust(tlsModule = tls) {
113175
+ const getCertificates = tlsModule.getCACertificates;
113176
+ const setDefaultCertificates = tlsModule.setDefaultCACertificates;
113177
+ if (typeof getCertificates !== "function" || typeof setDefaultCertificates !== "function") {
113178
+ return "unsupported";
113179
+ }
113180
+ try {
113181
+ const system = getCertificates.call(tlsModule, "system");
113182
+ if (!Array.isArray(system) || system.length === 0) {
113183
+ return "empty";
113184
+ }
113185
+ const current = getCertificates.call(tlsModule, "default") ?? [];
113186
+ setDefaultCertificates.call(tlsModule, [...current, ...system]);
113187
+ return "applied";
113188
+ } catch {
113189
+ return "error";
113190
+ }
113191
+ }
113192
+
113076
113193
  // index.ts
113077
113194
  import { fileURLToPath as fileURLToPath4 } from "node:url";
113195
+ var systemCaTrust = installSystemCaTrust();
113078
113196
  process.stdout.on("error", (err) => {
113079
113197
  if (err.code === "EPIPE")
113080
113198
  process.exit(0);
113081
113199
  });
113082
113200
  process.stderr.on("error", () => {});
113083
113201
  configureLogger({ sink: new TerminalSink });
113202
+ logger.debug(`OS certificate-store trust: ${systemCaTrust}`);
113084
113203
  installConsoleGuard();
113085
113204
  var pollController = createPollAbortController();
113086
113205
  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.1",
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": "bed2b46f1ec33a47a7dcae2e6d4b7ab99bd06981"
35
35
  }