@uipath/agenthub-tool 1.201.0 → 1.202.0-preview.136

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __require
3
- } from "./tool-0v6na3yp.js";
3
+ } from "./tool-1de529jm.js";
4
4
 
5
5
  // ../filesystem/src/node.ts
6
6
  import { randomUUID } from "node:crypto";
@@ -32,7 +32,7 @@ class NodeFileSystem {
32
32
  };
33
33
  utils = {
34
34
  open: async (url) => {
35
- const { default: open } = await import("./index-w03qc9m8.js");
35
+ const { default: open } = await import("./index-sby22td6.js");
36
36
  await open(url);
37
37
  }
38
38
  };
@@ -20,15 +20,15 @@ import {
20
20
  requireConfirmation,
21
21
  resolveDeprecatedOptionAlias,
22
22
  warnDeprecatedOptionAlias
23
- } from "./tool-p5fv2x1s.js";
23
+ } from "./tool-6ng40zzs.js";
24
24
  import {
25
25
  __require
26
- } from "./tool-0v6na3yp.js";
26
+ } from "./tool-1de529jm.js";
27
27
  // package.json
28
28
  var package_default = {
29
29
  name: "@uipath/agenthub-tool",
30
30
  license: "MIT",
31
- version: "1.201.0",
31
+ version: "1.202.0-preview.136",
32
32
  description: "Manage UiPath AgentHub MCP server registrations, tools, and remote A2A agents.",
33
33
  private: false,
34
34
  repository: {
@@ -473,9 +473,9 @@ var init_is_in_ssh = __esm(() => {
473
473
  });
474
474
  var exports_open = {};
475
475
  __export(exports_open, {
476
- openApp: () => openApp,
476
+ apps: () => apps,
477
477
  default: () => open_default,
478
- apps: () => apps
478
+ openApp: () => openApp
479
479
  });
480
480
  function detectArchBinary(binary) {
481
481
  if (typeof binary === "string" || Array.isArray(binary)) {
@@ -1364,7 +1364,7 @@ class VoidApiResponse {
1364
1364
  var package_default2 = {
1365
1365
  name: "@uipath/agenthub-sdk",
1366
1366
  license: "MIT",
1367
- version: "1.201.0",
1367
+ version: "1.202.0",
1368
1368
  repository: {
1369
1369
  type: "git",
1370
1370
  url: "https://github.com/UiPath/cli.git",
@@ -2499,7 +2499,7 @@ class InvalidBaseUrlError extends Error {
2499
2499
  super(`Invalid base URL: "${url}"
2500
2500
  ` + `Reason: ${reason}
2501
2501
 
2502
- ` + `Expected format: an https:// URL, e.g. https://cloud.uipath.com (commercial), https://govcloud.uipath.us (Public Sector), or your Automation Suite host (https://<your-host>).
2502
+ ` + `Expected format: an https:// URL (or bare host — https:// is assumed), e.g. https://cloud.uipath.com (commercial), https://govcloud.uipath.us (Public Sector), or your Automation Suite host (https://<your-host>).
2503
2503
  ` + `You can specify the URL via:
2504
2504
  ` + ` • --authority flag
2505
2505
  ` + ` • UIPATH_URL environment variable
@@ -2520,10 +2520,16 @@ var normalizeAndValidateBaseUrl = (rawUrl) => {
2520
2520
  while (baseUrl.endsWith("/")) {
2521
2521
  baseUrl = baseUrl.slice(0, -1);
2522
2522
  }
2523
+ const hasScheme = /^[a-z][a-z0-9+.-]*:\/\//i.test(baseUrl);
2524
+ const [hostCandidate] = baseUrl.split(/[/?#]/, 1);
2525
+ if (!hasScheme && hostCandidate.includes(".")) {
2526
+ baseUrl = `https://${baseUrl}`;
2527
+ }
2523
2528
  const resolvedBaseUrl = baseUrl;
2524
2529
  const [urlError, url] = catchError2(() => new URL(resolvedBaseUrl));
2525
2530
  if (urlError) {
2526
- throw new InvalidBaseUrlError(baseUrl, `Malformed URL. ${urlError instanceof Error ? urlError.message : "Unknown error"}`);
2531
+ const shapeHint = !hasScheme && !hostCandidate.includes(".") ? ` "${rawUrl.trim()}" is not a URL or a host name. Pass the full authority URL — https://<host>, or just <host> (https:// is assumed).` : ` ${urlError instanceof Error ? urlError.message : "Unknown error"}`;
2532
+ throw new InvalidBaseUrlError(baseUrl, `Malformed URL.${shapeHint}`);
2527
2533
  }
2528
2534
  if (url.protocol !== "https:") {
2529
2535
  throw new InvalidBaseUrlError(baseUrl, `Authority must use https:// scheme, got ${url.protocol}//. OIDC token exchange requires TLS end-to-end.`);
@@ -2801,6 +2807,17 @@ var requireEnv = (name) => {
2801
2807
  }
2802
2808
  return value;
2803
2809
  };
2810
+ var OPAQUE_TOKEN_BASE_URL_VAR = "UIPATH_URL";
2811
+ var resolveBaseUrl = (rawUrl, failureContext) => {
2812
+ const [baseUrlError, baseUrl] = catchError2(() => normalizeAndValidateBaseUrl(rawUrl));
2813
+ if (baseUrlError) {
2814
+ if (baseUrlError instanceof InvalidBaseUrlError) {
2815
+ throw baseUrlError;
2816
+ }
2817
+ throw new EnvAuthConfigError(`${failureContext}: ` + `${baseUrlError instanceof Error ? baseUrlError.message : String(baseUrlError)}`);
2818
+ }
2819
+ return baseUrl;
2820
+ };
2804
2821
  var readAuthFromEnv = () => {
2805
2822
  const accessToken = requireEnv(ENV_AUTH_VARS.token);
2806
2823
  const organizationName = requireEnv(ENV_AUTH_VARS.organizationName);
@@ -2809,19 +2826,29 @@ var readAuthFromEnv = () => {
2809
2826
  const tenantId = requireEnv(ENV_AUTH_VARS.tenantId);
2810
2827
  const [parseError, payload] = catchError2(() => parseJWT(accessToken));
2811
2828
  if (parseError) {
2812
- throw new EnvAuthConfigError(`${ENV_AUTH_VARS.token} is not a valid JWT: ` + `${parseError instanceof Error ? parseError.message : String(parseError)}`);
2829
+ const parseErrorMessage = parseError instanceof Error ? parseError.message : String(parseError);
2830
+ const rawUrl = process.env[OPAQUE_TOKEN_BASE_URL_VAR];
2831
+ if (!rawUrl) {
2832
+ throw new EnvAuthConfigError(`${ENV_AUTH_VARS.token} is not a JWT (treating it as an opaque token, ` + `e.g. a Personal Access Token). Set ${OPAQUE_TOKEN_BASE_URL_VAR} to the ` + `UiPath base URL if this is a PAT, or fix the token if it was meant to ` + `be a JWT (parse error: ${parseErrorMessage}).`);
2833
+ }
2834
+ const baseUrl2 = resolveBaseUrl(rawUrl, `Failed to validate ${OPAQUE_TOKEN_BASE_URL_VAR}`);
2835
+ return {
2836
+ loginStatus: "Logged in",
2837
+ accessToken,
2838
+ baseUrl: baseUrl2,
2839
+ organizationName,
2840
+ organizationId,
2841
+ tenantName,
2842
+ tenantId,
2843
+ source: "env-vars",
2844
+ hint: "Token is opaque (not a JWT) - expiration and identity cannot be " + "determined locally. Commands will fail with 401 once it is revoked or " + `expired. If this was meant to be a JWT instead of a PAT, note: ${parseErrorMessage}`
2845
+ };
2813
2846
  }
2814
2847
  const iss = payload.iss;
2815
2848
  if (typeof iss !== "string" || iss.length === 0) {
2816
2849
  throw new EnvAuthConfigError(`${ENV_AUTH_VARS.token} has no 'iss' claim; cannot determine ` + `the UiPath server. Ensure the token was issued by a UiPath identity server.`);
2817
2850
  }
2818
- const [baseUrlError, baseUrl] = catchError2(() => normalizeAndValidateBaseUrl(iss));
2819
- if (baseUrlError) {
2820
- if (baseUrlError instanceof InvalidBaseUrlError) {
2821
- throw baseUrlError;
2822
- }
2823
- throw new EnvAuthConfigError(`Failed to derive server URL from token 'iss' claim: ` + `${baseUrlError instanceof Error ? baseUrlError.message : String(baseUrlError)}`);
2824
- }
2851
+ const baseUrl = resolveBaseUrl(iss, "Failed to derive server URL from token 'iss' claim");
2825
2852
  const expiration = getTokenExpiration(accessToken);
2826
2853
  const loginStatus = expiration && expiration <= new Date ? "Expired" : "Logged in";
2827
2854
  const identity = resolveSessionIdentity(accessToken);
@@ -3747,6 +3774,7 @@ var getAuthContext = async (options = {}) => {
3747
3774
  };
3748
3775
  init_constants();
3749
3776
  init_src();
3777
+ init_constants();
3750
3778
  var IDENTIFIER_STATUSES = new Set([400, 403, 404]);
3751
3779
  var TENANT_SELECTION_REQUIRED_CODE = "TENANT_SELECTION_REQUIRED";
3752
3780
  var INVALID_TENANT_CODE = "INVALID_TENANT";
@@ -3934,7 +3962,7 @@ var emitError = async (code, error, extra) => {
3934
3962
  processContext.exit(1);
3935
3963
  };
3936
3964
  var jsonFromFile = async (file) => {
3937
- const { getFileSystem: getFileSystem2 } = await import("./index-9w47a2kz.js");
3965
+ const { getFileSystem: getFileSystem2 } = await import("./index-r2vc4whd.js");
3938
3966
  const fs7 = getFileSystem2();
3939
3967
  const raw = await fs7.readFile(file, "utf-8");
3940
3968
  if (raw == null)
@@ -4220,7 +4248,7 @@ var templateFor = (type) => {
4220
4248
  }
4221
4249
  };
4222
4250
  var fetchServersAcrossFolders = async (options) => {
4223
- const { FoldersApi: FoldersApi2, createOrchestratorConfig: createOrchestratorConfig2 } = await import("./index-qq69m47w.js");
4251
+ const { FoldersApi: FoldersApi2, createOrchestratorConfig: createOrchestratorConfig2 } = await import("./index-dd3vp1he.js");
4224
4252
  const orchestratorConfig = await createOrchestratorConfig2({
4225
4253
  tenant: options.tenant,
4226
4254
  loginValidity: options.loginValidity
@@ -5241,7 +5269,7 @@ class JSONApiResponse2 {
5241
5269
  var package_default3 = {
5242
5270
  name: "@uipath/resourcecatalog-sdk",
5243
5271
  license: "MIT",
5244
- version: "1.201.0",
5272
+ version: "1.202.0",
5245
5273
  description: "SDK for the UiPath Resource Catalog Service API.",
5246
5274
  repository: {
5247
5275
  type: "git",
@@ -7147,4 +7175,4 @@ var createStandaloneProgram = async () => {
7147
7175
 
7148
7176
  export { metadata, registerCommands, createStandaloneProgram };
7149
7177
 
7150
- //# debugId=93EAA6F6D0668BF264756E2164756E21
7178
+ //# debugId=1C48A2CE363B8FDD64756E2164756E21
package/dist/tool.js CHANGED
@@ -2,17 +2,14 @@ import {
2
2
  createStandaloneProgram,
3
3
  metadata,
4
4
  registerCommands
5
- } from "./tool-11ye3vnr.js";
6
- import"./tool-p5fv2x1s.js";
7
- import"./tool-9qecd4wb.js";
8
- import"./tool-qa9gftnj.js";
9
- import"./tool-5arsyj36.js";
10
- import"./tool-pczesvtm.js";
11
- import"./tool-0v6na3yp.js";
5
+ } from "./tool-csy1rqva.js";
6
+ import"./tool-6ng40zzs.js";
7
+ import"./tool-ayyhwvs8.js";
8
+ import"./tool-1de529jm.js";
12
9
  export {
13
- registerCommands,
10
+ createStandaloneProgram,
14
11
  metadata,
15
- createStandaloneProgram
12
+ registerCommands
16
13
  };
17
14
 
18
- //# debugId=DC2999AB197CA7B264756E2164756E21
15
+ //# debugId=59C3FB4D3C38231864756E2164756E21
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/agenthub-tool",
3
3
  "license": "MIT",
4
- "version": "1.201.0",
4
+ "version": "1.202.0-preview.136",
5
5
  "description": "Manage UiPath AgentHub MCP server registrations, tools, and remote A2A agents.",
6
6
  "private": false,
7
7
  "repository": {
@@ -26,5 +26,5 @@
26
26
  "files": [
27
27
  "dist"
28
28
  ],
29
- "gitHead": "7933378ad5276ac369900293a1447474dcec6826"
29
+ "gitHead": "f6270de2c7c04f4c43b2f5187b0c3d3c314c2610"
30
30
  }
@@ -1,99 +0,0 @@
1
- import {
2
- getGlobalThis
3
- } from "./tool-9qecd4wb.js";
4
- import {
5
- AUTH_CANCELLED_ERROR_CODE
6
- } from "./tool-5arsyj36.js";
7
- import"./tool-0v6na3yp.js";
8
-
9
- // ../auth/src/strategies/browser-strategy.ts
10
- class BrowserAuthStrategy {
11
- async execute(url, _redirectUri, expectedState, opts) {
12
- const global = getGlobalThis();
13
- if (!global?.window) {
14
- throw new Error("Browser environment required for authentication");
15
- }
16
- const screenWidth = global.window.screen?.width ?? 1024;
17
- const screenHeight = global.window.screen?.height ?? 768;
18
- const width = 600;
19
- const height = 700;
20
- const left = screenWidth / 2 - width / 2;
21
- const top = screenHeight / 2 - height / 2;
22
- if (!global.window.open) {
23
- throw new Error("window.open is not available");
24
- }
25
- const popupResult = global.window.open(url, "uip_auth", `width=${width},height=${height},left=${left},top=${top},resizable=yes,scrollbars=yes,status=yes`);
26
- const popup = popupResult;
27
- if (!popup) {
28
- throw new Error(`Authentication popup was blocked by your browser.
29
-
30
- ` + `To continue:
31
- ` + `1. Look for a popup blocker icon in your address bar
32
- ` + `2. Allow popups for this site
33
- ` + `3. Try logging in again
34
-
35
- ` + "If using an ad blocker, you may need to temporarily disable it.");
36
- }
37
- return new Promise((resolve, reject) => {
38
- let timer;
39
- const messageHandler = (event) => {
40
- if (event.data?.type === "UIP_AUTH_CODE" && event.data.code) {
41
- if (event.data.state !== expectedState) {
42
- cleanup();
43
- reject(new Error("OAuth state mismatch — the callback state does not match the expected value. " + "This may indicate a CSRF attack. Please try signing in again."));
44
- popup.close();
45
- return;
46
- }
47
- cleanup();
48
- resolve(event.data.code);
49
- popup.close();
50
- } else if (event.data?.type === "UIP_AUTH_ERROR") {
51
- cleanup();
52
- const errorMsg = event.data.error || "Authentication failed";
53
- reject(new Error(`Authentication failed: ${errorMsg}
54
-
55
- ` + "Please check your credentials and try again. " + "If the problem persists, verify your UiPath account is active."));
56
- popup.close();
57
- }
58
- };
59
- const cleanup = () => {
60
- global.window?.removeEventListener?.("message", messageHandler);
61
- opts?.signal?.removeEventListener("abort", onAbort);
62
- if (timer)
63
- clearInterval(timer);
64
- };
65
- const onAbort = () => {
66
- cleanup();
67
- const err = new Error(`Authentication was cancelled.
68
-
69
- ` + "The sign-in was cancelled before completing the login process. " + "Please try again and complete the authentication flow.");
70
- err.code = AUTH_CANCELLED_ERROR_CODE;
71
- reject(err);
72
- popup.close();
73
- };
74
- if (opts?.signal) {
75
- if (opts.signal.aborted) {
76
- onAbort();
77
- return;
78
- }
79
- opts.signal.addEventListener("abort", onAbort, { once: true });
80
- }
81
- if (global.window?.addEventListener) {
82
- global.window.addEventListener("message", messageHandler);
83
- }
84
- timer = setInterval(() => {
85
- if (popup.closed) {
86
- cleanup();
87
- reject(new Error(`Authentication was cancelled.
88
-
89
- ` + "The authentication popup was closed before completing the login process. " + "Please try again and complete the authentication flow."));
90
- }
91
- }, 1000);
92
- });
93
- }
94
- }
95
- export {
96
- BrowserAuthStrategy
97
- };
98
-
99
- //# debugId=B13A3005E9EE6C6564756E2164756E21
@@ -1,15 +0,0 @@
1
- import {
2
- NodeFileSystem,
3
- getFileSystem,
4
- getFileSystemAsync,
5
- setFileSystem
6
- } from "./tool-pczesvtm.js";
7
- import"./tool-0v6na3yp.js";
8
- export {
9
- setFileSystem,
10
- getFileSystemAsync,
11
- getFileSystem,
12
- NodeFileSystem
13
- };
14
-
15
- //# debugId=B37CFC3E9804A88664756E2164756E21