@uipath/agenthub-tool 1.198.0-preview.90 → 1.199.0-preview.91
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/tool.js +192 -45
- package/package.json +2 -2
package/dist/tool.js
CHANGED
|
@@ -3134,6 +3134,9 @@ function classifyError(status, error) {
|
|
|
3134
3134
|
if (status === 405) {
|
|
3135
3135
|
return { errorCode: "method_not_allowed", retry: "RetryWillNotFix" };
|
|
3136
3136
|
}
|
|
3137
|
+
if (status === 413) {
|
|
3138
|
+
return { errorCode: "invalid_argument", retry: "RetryWillNotFix" };
|
|
3139
|
+
}
|
|
3137
3140
|
if (status === 408) {
|
|
3138
3141
|
return { errorCode: "timeout", retry: "RetryLater" };
|
|
3139
3142
|
}
|
|
@@ -3211,6 +3214,8 @@ async function extractErrorDetails(error, options) {
|
|
|
3211
3214
|
result = "AuthenticationError";
|
|
3212
3215
|
} else if (status === 405) {
|
|
3213
3216
|
message = DEFAULT_405;
|
|
3217
|
+
} else if (status === 413) {
|
|
3218
|
+
message = DEFAULT_413;
|
|
3214
3219
|
} else if (status === 400 || status === 422) {
|
|
3215
3220
|
message = formatHttpStatusMessage(status, rawMessage, extractedMessage, inferredStatus);
|
|
3216
3221
|
result = "ValidationError";
|
|
@@ -3333,7 +3338,7 @@ async function extractErrorMessage(error, options) {
|
|
|
3333
3338
|
const { message } = await extractErrorDetails(error, options);
|
|
3334
3339
|
return message;
|
|
3335
3340
|
}
|
|
3336
|
-
var DEFAULT_401 = "Unauthorized (401). Run `uip login` to authenticate.", DEFAULT_403 = "Forbidden (403). Ensure the account has the required permissions.", DEFAULT_405 = "Method Not Allowed (405). The endpoint may not exist or the base URL may be incorrect.", HTML_RESPONSE_MESSAGE = "Received HTML instead of the expected JSON response.", NETWORK_ERROR_CODES, TLS_ERROR_CODES, TLS_INSTRUCTIONS, NETWORK_INSTRUCTIONS;
|
|
3341
|
+
var DEFAULT_401 = "Unauthorized (401). Run `uip login` to authenticate.", DEFAULT_403 = "Forbidden (403). Ensure the account has the required permissions.", DEFAULT_405 = "Method Not Allowed (405). The endpoint may not exist or the base URL may be incorrect.", DEFAULT_413 = "Payload too large (413). The upload exceeded the server or CDN size limit. Reduce the package size — for example, exclude unused dependencies or remove large files from the project — and try again.", HTML_RESPONSE_MESSAGE = "Received HTML instead of the expected JSON response.", NETWORK_ERROR_CODES, TLS_ERROR_CODES, TLS_INSTRUCTIONS, NETWORK_INSTRUCTIONS;
|
|
3337
3342
|
var init_error_handler = __esm(() => {
|
|
3338
3343
|
NETWORK_ERROR_CODES = new Set([
|
|
3339
3344
|
"ECONNREFUSED",
|
|
@@ -3365,7 +3370,6 @@ var init_attachment_binding = __esm(() => {
|
|
|
3365
3370
|
init_src2();
|
|
3366
3371
|
init_error_handler();
|
|
3367
3372
|
});
|
|
3368
|
-
|
|
3369
3373
|
// ../common/src/command-examples.ts
|
|
3370
3374
|
var examplesByCommand;
|
|
3371
3375
|
var init_command_examples = __esm(() => {
|
|
@@ -9964,6 +9968,7 @@ var init_command_attribution = __esm(() => {
|
|
|
9964
9968
|
KNOWN_SKILL_NAMES = new Set(Object.keys(SKILL_ATTRIBUTION));
|
|
9965
9969
|
COMMAND_ATTRIBUTION = commandAttribution([
|
|
9966
9970
|
["cli", "troubleshoot", ["uip.feedback"]],
|
|
9971
|
+
["llm-gateway", "operate", ["uip.llm-gateway"]],
|
|
9967
9972
|
["llm-gateway", "operate", ["uip.llm-configuration", "uip.model-hub"]],
|
|
9968
9973
|
["context-grounding", "build", ["uip.context-grounding"]],
|
|
9969
9974
|
["api-workflow", "build", ["uip.api-workflow"]],
|
|
@@ -10895,7 +10900,7 @@ var init_package = __esm(() => {
|
|
|
10895
10900
|
package_default3 = {
|
|
10896
10901
|
name: "@uipath/orchestrator-sdk",
|
|
10897
10902
|
license: "MIT",
|
|
10898
|
-
version: "1.
|
|
10903
|
+
version: "1.199.0",
|
|
10899
10904
|
repository: {
|
|
10900
10905
|
type: "git",
|
|
10901
10906
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -45424,6 +45429,7 @@ var DEFAULT_CLIENT_ID2 = "36dea5b8-e8bb-423d-8e7b-c808df8f1c00", AUTH_FILE_CONFI
|
|
|
45424
45429
|
customAuthority,
|
|
45425
45430
|
customClientId,
|
|
45426
45431
|
customClientSecret,
|
|
45432
|
+
customClientAssertion,
|
|
45427
45433
|
customScopes
|
|
45428
45434
|
} = {}) => {
|
|
45429
45435
|
const fileAuth = getAuthFileConfig2();
|
|
@@ -45449,7 +45455,7 @@ var DEFAULT_CLIENT_ID2 = "36dea5b8-e8bb-423d-8e7b-c808df8f1c00", AUTH_FILE_CONFI
|
|
|
45449
45455
|
if (!clientSecret && fileAuth.clientSecret) {
|
|
45450
45456
|
clientSecret = fileAuth.clientSecret;
|
|
45451
45457
|
}
|
|
45452
|
-
const isExternalAppAuth = clientId !== DEFAULT_CLIENT_ID2 && Boolean(clientSecret);
|
|
45458
|
+
const isExternalAppAuth = clientId !== DEFAULT_CLIENT_ID2 && (Boolean(clientSecret) || Boolean(customClientAssertion));
|
|
45453
45459
|
const scopes = resolveScopes2(isExternalAppAuth, customScopes, fileAuth.scopes);
|
|
45454
45460
|
return {
|
|
45455
45461
|
clientId,
|
|
@@ -64793,9 +64799,19 @@ var init_authContext = __esm(() => {
|
|
|
64793
64799
|
init_loginStatus();
|
|
64794
64800
|
});
|
|
64795
64801
|
|
|
64802
|
+
// ../auth/src/tokenGrant.ts
|
|
64803
|
+
var init_tokenGrant = () => {};
|
|
64804
|
+
|
|
64796
64805
|
// ../auth/src/clientCredentials.ts
|
|
64797
64806
|
var init_clientCredentials = __esm(() => {
|
|
64798
64807
|
init_config();
|
|
64808
|
+
init_tokenGrant();
|
|
64809
|
+
});
|
|
64810
|
+
|
|
64811
|
+
// ../auth/src/federatedCredentials.ts
|
|
64812
|
+
var init_federatedCredentials = __esm(() => {
|
|
64813
|
+
init_config();
|
|
64814
|
+
init_tokenGrant();
|
|
64799
64815
|
});
|
|
64800
64816
|
// ../auth/src/selectTenant.ts
|
|
64801
64817
|
var TENANT_SELECTION_REQUIRED_CODE2 = "TENANT_SELECTION_REQUIRED", INVALID_TENANT_CODE2 = "INVALID_TENANT", TENANT_SELECTION_CODES2;
|
|
@@ -64810,6 +64826,7 @@ var init_interactive = __esm(() => {
|
|
|
64810
64826
|
init_src2();
|
|
64811
64827
|
init_clientCredentials();
|
|
64812
64828
|
init_config();
|
|
64829
|
+
init_federatedCredentials();
|
|
64813
64830
|
init_src5();
|
|
64814
64831
|
init_selectTenant();
|
|
64815
64832
|
init_envFile();
|
|
@@ -64836,6 +64853,7 @@ var init_src5 = __esm(() => {
|
|
|
64836
64853
|
init_config();
|
|
64837
64854
|
init_constants3();
|
|
64838
64855
|
init_envAuth();
|
|
64856
|
+
init_federatedCredentials();
|
|
64839
64857
|
init_refreshCircuitBreaker();
|
|
64840
64858
|
init_selectTenant();
|
|
64841
64859
|
init_server2();
|
|
@@ -67513,7 +67531,7 @@ init_esm();
|
|
|
67513
67531
|
var package_default = {
|
|
67514
67532
|
name: "@uipath/agenthub-tool",
|
|
67515
67533
|
license: "MIT",
|
|
67516
|
-
version: "1.
|
|
67534
|
+
version: "1.199.0-preview.91",
|
|
67517
67535
|
description: "Manage UiPath AgentHub MCP server registrations, tools, and remote A2A agents.",
|
|
67518
67536
|
private: false,
|
|
67519
67537
|
repository: {
|
|
@@ -67548,6 +67566,7 @@ var package_default = {
|
|
|
67548
67566
|
},
|
|
67549
67567
|
devDependencies: {
|
|
67550
67568
|
"@uipath/agenthub-sdk": "workspace:*",
|
|
67569
|
+
"@uipath/auth": "workspace:*",
|
|
67551
67570
|
"@uipath/common": "workspace:*",
|
|
67552
67571
|
"@uipath/filesystem": "workspace:*",
|
|
67553
67572
|
"@uipath/integrationservice-sdk": "workspace:*",
|
|
@@ -86650,7 +86669,7 @@ class VoidApiResponse {
|
|
|
86650
86669
|
var package_default2 = {
|
|
86651
86670
|
name: "@uipath/agenthub-sdk",
|
|
86652
86671
|
license: "MIT",
|
|
86653
|
-
version: "1.
|
|
86672
|
+
version: "1.199.0",
|
|
86654
86673
|
repository: {
|
|
86655
86674
|
type: "git",
|
|
86656
86675
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -87826,6 +87845,7 @@ var resolveConfigAsync = async ({
|
|
|
87826
87845
|
customAuthority,
|
|
87827
87846
|
customClientId,
|
|
87828
87847
|
customClientSecret,
|
|
87848
|
+
customClientAssertion,
|
|
87829
87849
|
customScopes
|
|
87830
87850
|
} = {}) => {
|
|
87831
87851
|
const fileAuth = getAuthFileConfig();
|
|
@@ -87851,7 +87871,7 @@ var resolveConfigAsync = async ({
|
|
|
87851
87871
|
if (!clientSecret && fileAuth.clientSecret) {
|
|
87852
87872
|
clientSecret = fileAuth.clientSecret;
|
|
87853
87873
|
}
|
|
87854
|
-
const isExternalAppAuth = clientId !== DEFAULT_CLIENT_ID && Boolean(clientSecret);
|
|
87874
|
+
const isExternalAppAuth = clientId !== DEFAULT_CLIENT_ID && (Boolean(clientSecret) || Boolean(customClientAssertion));
|
|
87855
87875
|
const scopes = resolveScopes(isExternalAppAuth, customScopes, fileAuth.scopes);
|
|
87856
87876
|
return {
|
|
87857
87877
|
clientId,
|
|
@@ -90214,6 +90234,7 @@ var CREATE_EXAMPLES_BY_TYPE = {
|
|
|
90214
90234
|
};
|
|
90215
90235
|
|
|
90216
90236
|
// src/commands/mcp-tools.ts
|
|
90237
|
+
init_src5();
|
|
90217
90238
|
init_src3();
|
|
90218
90239
|
|
|
90219
90240
|
// ../integrationservice-sdk/src/user-agent.ts
|
|
@@ -90749,7 +90770,7 @@ class TextApiResponse2 {
|
|
|
90749
90770
|
var package_default4 = {
|
|
90750
90771
|
name: "@uipath/integrationservice-sdk",
|
|
90751
90772
|
license: "MIT",
|
|
90752
|
-
version: "1.
|
|
90773
|
+
version: "1.199.0-preview.91",
|
|
90753
90774
|
repository: {
|
|
90754
90775
|
type: "git",
|
|
90755
90776
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -97305,7 +97326,7 @@ class JSONApiResponse5 {
|
|
|
97305
97326
|
var package_default5 = {
|
|
97306
97327
|
name: "@uipath/resourcecatalog-sdk",
|
|
97307
97328
|
license: "MIT",
|
|
97308
|
-
version: "1.
|
|
97329
|
+
version: "1.199.0",
|
|
97309
97330
|
description: "SDK for the UiPath Resource Catalog Service API.",
|
|
97310
97331
|
repository: {
|
|
97311
97332
|
type: "git",
|
|
@@ -98028,6 +98049,35 @@ var ALL_CANDIDATE_CATEGORIES = [
|
|
|
98028
98049
|
"is-activity"
|
|
98029
98050
|
];
|
|
98030
98051
|
var PROCESS_TYPE_API = "Api";
|
|
98052
|
+
var isIsActivityToolPayload = (payload) => Number(payload.type) === 1 && typeof payload.processType === "string" && payload.processType.toLowerCase() === PROCESS_TYPE_API.toLowerCase();
|
|
98053
|
+
var IS_ACTIVITY_UNAVAILABLE_HOSTS = new Set([
|
|
98054
|
+
"cloud.uipath.com"
|
|
98055
|
+
]);
|
|
98056
|
+
var assertIsActivityAvailable = async (options, code) => {
|
|
98057
|
+
if (options.force)
|
|
98058
|
+
return true;
|
|
98059
|
+
const [authError, ctx] = await catchError2(getAuthContext2({
|
|
98060
|
+
tenant: options.tenant,
|
|
98061
|
+
ensureTokenValidityMinutes: options.loginValidity
|
|
98062
|
+
}));
|
|
98063
|
+
if (authError) {
|
|
98064
|
+
await emitError(code, authError);
|
|
98065
|
+
return false;
|
|
98066
|
+
}
|
|
98067
|
+
let host;
|
|
98068
|
+
try {
|
|
98069
|
+
host = new URL(ctx?.baseUrl ?? "").hostname.toLowerCase();
|
|
98070
|
+
} catch {
|
|
98071
|
+
return true;
|
|
98072
|
+
}
|
|
98073
|
+
if (!IS_ACTIVITY_UNAVAILABLE_HOSTS.has(host))
|
|
98074
|
+
return true;
|
|
98075
|
+
await emitError(code, new Error(`IS-activity MCP tools are not yet available on ${host} — the feature is rolling out and is currently enabled on alpha/staging only.`), {
|
|
98076
|
+
Reason: "IsActivityNotAvailable",
|
|
98077
|
+
Hint: "Author the tool as create-resource or create-raw instead, or use an alpha/staging tenant. " + "If this tenant is enrolled in the rollout, re-run with --force."
|
|
98078
|
+
});
|
|
98079
|
+
return false;
|
|
98080
|
+
};
|
|
98031
98081
|
var validateIsActivityMapping = (metadataRaw) => {
|
|
98032
98082
|
let metadata;
|
|
98033
98083
|
if (typeof metadataRaw === "string") {
|
|
@@ -98423,7 +98473,7 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98423
98473
|
Data: options.allowMultiple ? matches : matches[0]
|
|
98424
98474
|
});
|
|
98425
98475
|
});
|
|
98426
|
-
const resolveTargetByName = async (targetName, category, options) => {
|
|
98476
|
+
const resolveTargetByName = async (targetName, category, options, explicitTargetFolderKey) => {
|
|
98427
98477
|
if (!category) {
|
|
98428
98478
|
const error = new Error("--target-name requires --category to scope the RCS lookup. Pass --category automation|agent|agentic-process|api-workflow.");
|
|
98429
98479
|
error.code = "MissingCategory";
|
|
@@ -98444,8 +98494,8 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98444
98494
|
name: targetName,
|
|
98445
98495
|
entityTypes: [...filterDef.entityTypes],
|
|
98446
98496
|
entitySubType: [...filterDef.entitySubType],
|
|
98447
|
-
xUIPATHFolderKey: options.folderKey,
|
|
98448
|
-
xUIPATHFolderPath: options.folderPath
|
|
98497
|
+
xUIPATHFolderKey: explicitTargetFolderKey ?? options.folderKey,
|
|
98498
|
+
xUIPATHFolderPath: explicitTargetFolderKey ? undefined : options.folderPath
|
|
98449
98499
|
});
|
|
98450
98500
|
const entities = result?.value ?? [];
|
|
98451
98501
|
const exact = entities.filter((e) => e.name === targetName);
|
|
@@ -98480,7 +98530,44 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98480
98530
|
targetFolderKey: folderKey
|
|
98481
98531
|
};
|
|
98482
98532
|
};
|
|
98483
|
-
const
|
|
98533
|
+
const listConnectorConnections = async (category, options) => {
|
|
98534
|
+
const connectionsApi = await createApiClient3(ConnectionsApi, {
|
|
98535
|
+
tenant: options.tenant,
|
|
98536
|
+
loginValidity: options.loginValidity
|
|
98537
|
+
});
|
|
98538
|
+
const pageSize = 100;
|
|
98539
|
+
const maxPages = 20;
|
|
98540
|
+
const seen = new Set;
|
|
98541
|
+
const rows = [];
|
|
98542
|
+
for (let pageIndex = 0;pageIndex < maxPages; pageIndex++) {
|
|
98543
|
+
const batch = await connectionsApi.apiV1ConnectionsGet({
|
|
98544
|
+
allFolders: true,
|
|
98545
|
+
pageSize,
|
|
98546
|
+
pageIndex
|
|
98547
|
+
});
|
|
98548
|
+
const items = batch ?? [];
|
|
98549
|
+
let added = 0;
|
|
98550
|
+
for (const c of items) {
|
|
98551
|
+
const id = c.id ?? "";
|
|
98552
|
+
if (!id || seen.has(id))
|
|
98553
|
+
continue;
|
|
98554
|
+
seen.add(id);
|
|
98555
|
+
added++;
|
|
98556
|
+
const matchesConnector = c?.connector?.key === category || c?.elementInstance?.key === category;
|
|
98557
|
+
if (matchesConnector) {
|
|
98558
|
+
rows.push({
|
|
98559
|
+
id,
|
|
98560
|
+
name: c.name ?? "",
|
|
98561
|
+
folder: c.folder?.key ?? ""
|
|
98562
|
+
});
|
|
98563
|
+
}
|
|
98564
|
+
}
|
|
98565
|
+
if (items.length < pageSize || added === 0)
|
|
98566
|
+
break;
|
|
98567
|
+
}
|
|
98568
|
+
return rows;
|
|
98569
|
+
};
|
|
98570
|
+
const resolveIsActivityByName = async (targetName, category, options, explicitTargetFolderKey) => {
|
|
98484
98571
|
if (!category) {
|
|
98485
98572
|
const error = new Error("--target-name on is-activity requires --category <connector-key> to scope the IS connector. Discover via `uip is connectors list`.");
|
|
98486
98573
|
error.code = "MissingCategory";
|
|
@@ -98490,15 +98577,43 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98490
98577
|
tenant: options.tenant,
|
|
98491
98578
|
loginValidity: options.loginValidity
|
|
98492
98579
|
});
|
|
98493
|
-
const
|
|
98580
|
+
const [defaultConnError, defaultConnection] = await catchError2(api.apiV1ConnectorsKeyOrIdConnectionGet({
|
|
98494
98581
|
keyOrId: category
|
|
98495
|
-
});
|
|
98582
|
+
}));
|
|
98583
|
+
if (defaultConnError && explicitTargetFolderKey === undefined) {
|
|
98584
|
+
throw defaultConnError;
|
|
98585
|
+
}
|
|
98586
|
+
const connection = defaultConnError ? undefined : defaultConnection;
|
|
98587
|
+
const folderKey = connection?.folder?.key ?? "";
|
|
98588
|
+
if (explicitTargetFolderKey !== undefined) {
|
|
98589
|
+
if (connection?.id && folderKey.toLowerCase() === explicitTargetFolderKey.toLowerCase()) {
|
|
98590
|
+
return {
|
|
98591
|
+
targetIdentifier: connection.id,
|
|
98592
|
+
targetFolderKey: folderKey
|
|
98593
|
+
};
|
|
98594
|
+
}
|
|
98595
|
+
let candidates = [];
|
|
98596
|
+
try {
|
|
98597
|
+
candidates = await listConnectorConnections(category, options);
|
|
98598
|
+
} catch {}
|
|
98599
|
+
const inFolder = candidates.filter((c) => c.folder.toLowerCase() === explicitTargetFolderKey.toLowerCase());
|
|
98600
|
+
if (inFolder.length === 1) {
|
|
98601
|
+
return {
|
|
98602
|
+
targetIdentifier: inFolder[0].id,
|
|
98603
|
+
targetFolderKey: explicitTargetFolderKey
|
|
98604
|
+
};
|
|
98605
|
+
}
|
|
98606
|
+
const defaultNote = connection?.id ? `; the default connection '${connection.name ?? connection.id}' lives in folder ${folderKey || "unknown"}` : "; the connector has no default connection";
|
|
98607
|
+
const error = new Error(inFolder.length === 0 ? `No connection for connector '${category}' lives in target folder ${explicitTargetFolderKey}${defaultNote}. Create a connection in that folder or pass --target-identifier <conn-guid> explicitly.` : `Found ${inFolder.length} connections for connector '${category}' in target folder ${explicitTargetFolderKey}. Pass --target-identifier <conn-guid> to pick one.`);
|
|
98608
|
+
error.code = inFolder.length === 0 ? "TargetFolderMismatch" : "AmbiguousConnection";
|
|
98609
|
+
error.candidates = inFolder.length > 0 ? inFolder : candidates;
|
|
98610
|
+
throw error;
|
|
98611
|
+
}
|
|
98496
98612
|
if (!connection?.id) {
|
|
98497
98613
|
const error = new Error(`No default connection found for connector '${category}' (activity '${targetName}'). Create one via \`uip is connections create '${category}'\` or pass --target-identifier <connection-guid> explicitly.`);
|
|
98498
98614
|
error.code = "NoDefaultConnection";
|
|
98499
98615
|
throw error;
|
|
98500
98616
|
}
|
|
98501
|
-
const folderKey = connection.folder?.key ?? "";
|
|
98502
98617
|
if (!folderKey) {
|
|
98503
98618
|
const error = new Error(`Default connection '${connection.name ?? connection.id}' for connector '${category}' has no folder key. Use --folder-* to set the MCP server folder.`);
|
|
98504
98619
|
error.code = "MissingFolderKey";
|
|
@@ -98510,19 +98625,7 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98510
98625
|
if (serverFolderKey && folderKey.toLowerCase() !== serverFolderKey.toLowerCase()) {
|
|
98511
98626
|
let candidates = [];
|
|
98512
98627
|
try {
|
|
98513
|
-
|
|
98514
|
-
tenant: options.tenant,
|
|
98515
|
-
loginValidity: options.loginValidity
|
|
98516
|
-
});
|
|
98517
|
-
const all = await connectionsApi.apiV1ConnectionsGet({
|
|
98518
|
-
allFolders: true,
|
|
98519
|
-
pageSize: 100
|
|
98520
|
-
});
|
|
98521
|
-
candidates = (all ?? []).filter((c) => c?.connector?.key === category || c?.elementInstance?.key === category).map((c) => ({
|
|
98522
|
-
id: c.id ?? "",
|
|
98523
|
-
name: c.name ?? "",
|
|
98524
|
-
folder: c.folder?.key ?? ""
|
|
98525
|
-
}));
|
|
98628
|
+
candidates = await listConnectorConnections(category, options);
|
|
98526
98629
|
} catch {}
|
|
98527
98630
|
const error = new Error(`Default connection '${connection.name ?? connection.id}' lives in folder ${folderKey}; MCP server folder is ${serverFolderKey}. Pick a connection in the server's folder or pass --target-identifier <conn-guid> explicitly.`);
|
|
98528
98631
|
error.code = "CrossFolderConnection";
|
|
@@ -98542,10 +98645,23 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98542
98645
|
}
|
|
98543
98646
|
return;
|
|
98544
98647
|
};
|
|
98648
|
+
const resolveExplicitTargetFolderKey = async (options) => {
|
|
98649
|
+
if (options.targetFolderKey !== undefined)
|
|
98650
|
+
return options.targetFolderKey;
|
|
98651
|
+
if (options.targetFolderPath !== undefined) {
|
|
98652
|
+
return await resolveFolderNameToGuid(options.targetFolderPath, options);
|
|
98653
|
+
}
|
|
98654
|
+
return;
|
|
98655
|
+
};
|
|
98545
98656
|
const validateFolderInputsForTool = async (options, code) => {
|
|
98546
98657
|
try {
|
|
98547
98658
|
chooseFolderInput({ key: options.folderKey, path: options.folderPath }, "folder");
|
|
98548
98659
|
assertFolderKeyIsGuid(options.folderKey, "folder");
|
|
98660
|
+
chooseFolderInput({
|
|
98661
|
+
key: options.targetFolderKey,
|
|
98662
|
+
path: options.targetFolderPath
|
|
98663
|
+
}, "target-folder");
|
|
98664
|
+
assertFolderKeyIsGuid(options.targetFolderKey, "target-folder");
|
|
98549
98665
|
} catch (error) {
|
|
98550
98666
|
const errCode = error.code;
|
|
98551
98667
|
await emitError(code, error, errCode ? { Reason: errCode } : {});
|
|
@@ -98554,17 +98670,24 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98554
98670
|
return true;
|
|
98555
98671
|
};
|
|
98556
98672
|
const createTool = async (kind, options) => {
|
|
98673
|
+
if (kind === "is-activity" && !await assertIsActivityAvailable(options, OUTPUT_CODES2.Create))
|
|
98674
|
+
return;
|
|
98557
98675
|
if (!await validateFolderInputsForTool(options, OUTPUT_CODES2.Create))
|
|
98558
98676
|
return;
|
|
98559
98677
|
if (!await requireParentType(options.mcp, "uipath", options, OUTPUT_CODES2.Create))
|
|
98560
98678
|
return;
|
|
98679
|
+
const [targetFolderError, explicitTargetFolderKey] = await catchError2(resolveExplicitTargetFolderKey(options));
|
|
98680
|
+
if (targetFolderError) {
|
|
98681
|
+
const code = targetFolderError.code;
|
|
98682
|
+
return await emitError(OUTPUT_CODES2.Create, targetFolderError, code ? { Reason: code } : {});
|
|
98683
|
+
}
|
|
98561
98684
|
let resolvedIdentifier = options.targetIdentifier;
|
|
98562
98685
|
let resolvedFolderKey;
|
|
98563
98686
|
if (kind === "resource" && options.targetName && !options.targetIdentifier) {
|
|
98564
98687
|
try {
|
|
98565
|
-
const resolved = await resolveTargetByName(options.targetName, options.category, options);
|
|
98688
|
+
const resolved = await resolveTargetByName(options.targetName, options.category, options, explicitTargetFolderKey);
|
|
98566
98689
|
resolvedIdentifier = resolved.targetIdentifier;
|
|
98567
|
-
resolvedFolderKey =
|
|
98690
|
+
resolvedFolderKey = explicitTargetFolderKey ?? resolved.targetFolderKey;
|
|
98568
98691
|
} catch (resolveError) {
|
|
98569
98692
|
const code = resolveError.code;
|
|
98570
98693
|
const candidates = resolveError.candidates;
|
|
@@ -98577,9 +98700,9 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98577
98700
|
}
|
|
98578
98701
|
if (kind === "is-activity" && options.targetName && !options.targetIdentifier) {
|
|
98579
98702
|
try {
|
|
98580
|
-
const resolved = await resolveIsActivityByName(options.targetName, options.category, options);
|
|
98703
|
+
const resolved = await resolveIsActivityByName(options.targetName, options.category, options, explicitTargetFolderKey);
|
|
98581
98704
|
resolvedIdentifier = resolved.targetIdentifier;
|
|
98582
|
-
resolvedFolderKey =
|
|
98705
|
+
resolvedFolderKey = resolved.targetFolderKey;
|
|
98583
98706
|
} catch (resolveError) {
|
|
98584
98707
|
const code = resolveError.code;
|
|
98585
98708
|
const candidates = resolveError.candidates;
|
|
@@ -98590,12 +98713,16 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98590
98713
|
}
|
|
98591
98714
|
}
|
|
98592
98715
|
if (kind !== "raw" && !resolvedFolderKey) {
|
|
98593
|
-
|
|
98594
|
-
|
|
98595
|
-
|
|
98596
|
-
|
|
98716
|
+
if (explicitTargetFolderKey !== undefined) {
|
|
98717
|
+
resolvedFolderKey = explicitTargetFolderKey;
|
|
98718
|
+
} else {
|
|
98719
|
+
const [serverFolderError, serverFolderKey] = await catchError2(resolveServerFolderKey(options));
|
|
98720
|
+
if (serverFolderError) {
|
|
98721
|
+
const code = serverFolderError.code;
|
|
98722
|
+
return await emitError(OUTPUT_CODES2.Create, serverFolderError, code ? { Reason: code } : {});
|
|
98723
|
+
}
|
|
98724
|
+
resolvedFolderKey = serverFolderKey;
|
|
98597
98725
|
}
|
|
98598
|
-
resolvedFolderKey = serverFolderKey;
|
|
98599
98726
|
}
|
|
98600
98727
|
const scalar = kind === "raw" ? {} : {
|
|
98601
98728
|
type: kind === "is-activity" ? 1 : 0,
|
|
@@ -98616,7 +98743,12 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98616
98743
|
if (validateError)
|
|
98617
98744
|
return await emitError(OUTPUT_CODES2.Create, validateError);
|
|
98618
98745
|
const payloadObj = payload;
|
|
98619
|
-
|
|
98746
|
+
if (explicitTargetFolderKey !== undefined && (options.file || options.body || kind === "raw")) {
|
|
98747
|
+
payloadObj.targetFolderKey = explicitTargetFolderKey;
|
|
98748
|
+
}
|
|
98749
|
+
const isIsActivityPayload = kind === "is-activity" || isIsActivityToolPayload(payloadObj);
|
|
98750
|
+
if (kind !== "is-activity" && isIsActivityPayload && !await assertIsActivityAvailable(options, OUTPUT_CODES2.Create))
|
|
98751
|
+
return;
|
|
98620
98752
|
if (isIsActivityPayload) {
|
|
98621
98753
|
const [mappingError] = await catchError2(Promise.resolve().then(() => validateIsActivityMapping(payloadObj.metadata)));
|
|
98622
98754
|
if (mappingError) {
|
|
@@ -98665,7 +98797,10 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98665
98797
|
["create-is-activity", "is-activity"],
|
|
98666
98798
|
["create-raw", "raw"]
|
|
98667
98799
|
]) {
|
|
98668
|
-
const
|
|
98800
|
+
const base = tools.command(verb).description(`Create a ${kind} tool on a uipath MCP server.`).option("--name <name>", "Tool name.").option("--description <text>", "Tool description.").option("--target-name <name>", "Resolve target by display name.").option("--target-identifier <guid>", "Target identifier.").option("--category <category>", "Tool category/process type.").option("--input-schema <json>", "JSON input schema.").option("--output-schema <json>", "JSON output schema.").option("--metadata <json>", "JSON metadata.").option("--continue-on-error", "Continue after per-tool failures.", true).option("--fail-fast", "Stop after the first per-tool failure.");
|
|
98801
|
+
base.option("--target-folder-key <key>", "Orchestrator folder key (GUID) of the target's folder (IS connection, Orchestrator resource, or raw payload target), when it differs from the MCP server's folder. Use --target-folder-path for the folder name or fully-qualified path.").option("--target-folder-path <path>", "Orchestrator folder display name or fully-qualified path of the target's folder (e.g. 'Shared' or 'Foo/Shared'). Resolved to the folder key via the Orchestrator SDK.");
|
|
98802
|
+
base.option("--force", kind === "is-activity" ? "Bypass the IS-activity environment availability gate (only for tenants enrolled in the cloud rollout)." : "Bypass the IS-activity environment availability gate when the payload is an IS-activity tool (type 1, processType Api; only for tenants enrolled in the cloud rollout).");
|
|
98803
|
+
const leaf = addInputOptions(base).examples(TOOL_CREATE_EXAMPLES_BY_KIND[kind]);
|
|
98669
98804
|
leaf.trackedAction(processContext, async (options) => createTool(kind, options));
|
|
98670
98805
|
}
|
|
98671
98806
|
addInputOptions(tools.command("update").description([
|
|
@@ -98674,7 +98809,7 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98674
98809
|
"Use `--rename <new-name>` to change the tool's name; the",
|
|
98675
98810
|
"lookup `--name` flag selects the existing tool to update."
|
|
98676
98811
|
].join(`
|
|
98677
|
-
`)).argument("[id]", "Tool id (omit when using --name).").option("--name <substr>", "Lookup by tool name substring.").option("--allow-multiple", "Apply the update to every name match.").option("--rename <name>", "Rename the tool to this value.").option("--description <text>", "Updated description.").option("--target-identifier <guid>", "Updated target identifier.").option("--input-schema <json>", "JSON input schema.").option("--output-schema <json>", "JSON output schema.").option("--metadata <json>", "JSON metadata.")).examples(TOOL_UPDATE_EXAMPLES).trackedAction(processContext, async (id, options) => {
|
|
98812
|
+
`)).argument("[id]", "Tool id (omit when using --name).").option("--name <substr>", "Lookup by tool name substring.").option("--allow-multiple", "Apply the update to every name match.").option("--rename <name>", "Rename the tool to this value.").option("--description <text>", "Updated description.").option("--target-identifier <guid>", "Updated target identifier.").option("--target-folder-key <key>", "Orchestrator folder key (GUID) of the target's folder, when it differs from the MCP server's folder. Use --target-folder-path for the folder name or fully-qualified path.").option("--target-folder-path <path>", "Orchestrator folder display name or fully-qualified path of the target's folder (e.g. 'Shared' or 'Foo/Shared'). Resolved to the folder key via the Orchestrator SDK.").option("--input-schema <json>", "JSON input schema.").option("--output-schema <json>", "JSON output schema.").option("--metadata <json>", "JSON metadata.").option("--force", "Bypass the IS-activity environment availability gate when the payload is an IS-activity tool (type 1, processType Api; only for tenants enrolled in the cloud rollout).")).examples(TOOL_UPDATE_EXAMPLES).trackedAction(processContext, async (id, options) => {
|
|
98678
98813
|
if (!await validateFolderInputsForTool(options, OUTPUT_CODES2.Update))
|
|
98679
98814
|
return;
|
|
98680
98815
|
if (!await requireParentType(options.mcp, "uipath", options, OUTPUT_CODES2.Update))
|
|
@@ -98682,8 +98817,13 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98682
98817
|
const ids = await resolveToolIds(options, id ? [id] : [], OUTPUT_CODES2.Update);
|
|
98683
98818
|
if (!ids)
|
|
98684
98819
|
return;
|
|
98685
|
-
|
|
98686
|
-
if (
|
|
98820
|
+
const [targetFolderError, explicitTargetFolderKey] = await catchError2(resolveExplicitTargetFolderKey(options));
|
|
98821
|
+
if (targetFolderError) {
|
|
98822
|
+
const code = targetFolderError.code;
|
|
98823
|
+
return await emitError(OUTPUT_CODES2.Update, targetFolderError, code ? { Reason: code } : {});
|
|
98824
|
+
}
|
|
98825
|
+
let resolvedTargetFolderKey = explicitTargetFolderKey;
|
|
98826
|
+
if (resolvedTargetFolderKey === undefined && options.targetIdentifier) {
|
|
98687
98827
|
const [serverFolderError, serverFolderKey] = await catchError2(resolveServerFolderKey(options));
|
|
98688
98828
|
if (serverFolderError) {
|
|
98689
98829
|
const code = serverFolderError.code;
|
|
@@ -98705,6 +98845,11 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98705
98845
|
const [validateError] = await catchError2(Promise.resolve().then(() => validateJsonStrings(payload)));
|
|
98706
98846
|
if (validateError)
|
|
98707
98847
|
return await emitError(OUTPUT_CODES2.Update, validateError);
|
|
98848
|
+
if (isIsActivityToolPayload(payload) && !await assertIsActivityAvailable(options, OUTPUT_CODES2.Update))
|
|
98849
|
+
return;
|
|
98850
|
+
if (explicitTargetFolderKey !== undefined && (options.file || options.body)) {
|
|
98851
|
+
payload.targetFolderKey = explicitTargetFolderKey;
|
|
98852
|
+
}
|
|
98708
98853
|
if (options.dryRun) {
|
|
98709
98854
|
OutputFormatter.success({
|
|
98710
98855
|
Result: RESULTS.Success,
|
|
@@ -98842,7 +98987,7 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98842
98987
|
}
|
|
98843
98988
|
return originalOptionMissingArgument(option);
|
|
98844
98989
|
};
|
|
98845
|
-
addCommonOptions2(candidatesCmd.option("--name <substr>", "Filter candidate name substring.").option("--connector <key>", "Connector key (only used with --category is-activity). " + "When supplied, lists activities for the connector instead " + "of listing connectors. Discover via " + "`uip is connectors list --output json` or run `candidates --category is-activity` without --connector first.").option("--limit <number>", "Page size.", (v) => Number.parseInt(v, 10)).option("--offset <number>", "Offset.", (v) => Number.parseInt(v, 10)).addOption(new Option("--skip <number>").hideHelp().argParser((v) => Number.parseInt(v, 10)))).examples(TOOL_CANDIDATES_EXAMPLES).trackedAction(processContext, async (options) => {
|
|
98990
|
+
addCommonOptions2(candidatesCmd.option("--name <substr>", "Filter candidate name substring.").option("--connector <key>", "Connector key (only used with --category is-activity). " + "When supplied, lists activities for the connector instead " + "of listing connectors. Discover via " + "`uip is connectors list --output json` or run `candidates --category is-activity` without --connector first.").option("--force", "Bypass the IS-activity environment availability gate (only for tenants enrolled in the cloud rollout).").option("--limit <number>", "Page size.", (v) => Number.parseInt(v, 10)).option("--offset <number>", "Offset.", (v) => Number.parseInt(v, 10)).addOption(new Option("--skip <number>").hideHelp().argParser((v) => Number.parseInt(v, 10)))).examples(TOOL_CANDIDATES_EXAMPLES).trackedAction(processContext, async (options) => {
|
|
98846
98991
|
const offset = resolveDeprecatedOptionAlias({
|
|
98847
98992
|
preferredValue: options.offset,
|
|
98848
98993
|
deprecatedValue: options.skip,
|
|
@@ -98867,6 +99012,8 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98867
99012
|
return await emitError(OUTPUT_CODES2.Candidates, new Error(`Invalid --category '${category}'. Use one of: ${ALL_CANDIDATE_CATEGORIES.join(", ")}.`));
|
|
98868
99013
|
}
|
|
98869
99014
|
if (category === "is-activity") {
|
|
99015
|
+
if (!await assertIsActivityAvailable(options, OUTPUT_CODES2.Candidates))
|
|
99016
|
+
return;
|
|
98870
99017
|
const needle = options.name?.toLowerCase();
|
|
98871
99018
|
const skip = offset.value ?? 0;
|
|
98872
99019
|
const limit = options.limit ?? DEFAULT_PAGE_SIZE;
|
|
@@ -99428,4 +99575,4 @@ export {
|
|
|
99428
99575
|
createStandaloneProgram
|
|
99429
99576
|
};
|
|
99430
99577
|
|
|
99431
|
-
//# debugId=
|
|
99578
|
+
//# debugId=BAA8FBE200FE623364756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/agenthub-tool",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.199.0-preview.91",
|
|
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": "
|
|
29
|
+
"gitHead": "f428cb1e61ba89ad18394b0c6106784055699f02"
|
|
30
30
|
}
|