@uipath/agenthub-tool 1.198.0 → 1.199.0-preview.104
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(() => {
|
|
@@ -10203,6 +10207,7 @@ var init_command_attribution = __esm(() => {
|
|
|
10203
10207
|
KNOWN_SKILL_NAMES = new Set(Object.keys(SKILL_ATTRIBUTION));
|
|
10204
10208
|
COMMAND_ATTRIBUTION = commandAttribution([
|
|
10205
10209
|
["cli", "troubleshoot", ["uip.feedback"]],
|
|
10210
|
+
["llm-gateway", "operate", ["uip.llm-gateway"]],
|
|
10206
10211
|
["llm-gateway", "operate", ["uip.llm-configuration", "uip.model-hub"]],
|
|
10207
10212
|
["context-grounding", "build", ["uip.context-grounding"]],
|
|
10208
10213
|
["api-workflow", "build", ["uip.api-workflow"]],
|
|
@@ -11011,7 +11016,7 @@ var init_package = __esm(() => {
|
|
|
11011
11016
|
package_default3 = {
|
|
11012
11017
|
name: "@uipath/orchestrator-sdk",
|
|
11013
11018
|
license: "MIT",
|
|
11014
|
-
version: "1.
|
|
11019
|
+
version: "1.199.0",
|
|
11015
11020
|
repository: {
|
|
11016
11021
|
type: "git",
|
|
11017
11022
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -45540,6 +45545,7 @@ var DEFAULT_CLIENT_ID2 = "36dea5b8-e8bb-423d-8e7b-c808df8f1c00", AUTH_FILE_CONFI
|
|
|
45540
45545
|
customAuthority,
|
|
45541
45546
|
customClientId,
|
|
45542
45547
|
customClientSecret,
|
|
45548
|
+
customClientAssertion,
|
|
45543
45549
|
customScopes
|
|
45544
45550
|
} = {}) => {
|
|
45545
45551
|
const fileAuth = getAuthFileConfig2();
|
|
@@ -45565,7 +45571,7 @@ var DEFAULT_CLIENT_ID2 = "36dea5b8-e8bb-423d-8e7b-c808df8f1c00", AUTH_FILE_CONFI
|
|
|
45565
45571
|
if (!clientSecret && fileAuth.clientSecret) {
|
|
45566
45572
|
clientSecret = fileAuth.clientSecret;
|
|
45567
45573
|
}
|
|
45568
|
-
const isExternalAppAuth = clientId !== DEFAULT_CLIENT_ID2 && Boolean(clientSecret);
|
|
45574
|
+
const isExternalAppAuth = clientId !== DEFAULT_CLIENT_ID2 && (Boolean(clientSecret) || Boolean(customClientAssertion));
|
|
45569
45575
|
const scopes = resolveScopes2(isExternalAppAuth, customScopes, fileAuth.scopes);
|
|
45570
45576
|
return {
|
|
45571
45577
|
clientId,
|
|
@@ -64909,9 +64915,19 @@ var init_authContext = __esm(() => {
|
|
|
64909
64915
|
init_loginStatus();
|
|
64910
64916
|
});
|
|
64911
64917
|
|
|
64918
|
+
// ../auth/src/tokenGrant.ts
|
|
64919
|
+
var init_tokenGrant = () => {};
|
|
64920
|
+
|
|
64912
64921
|
// ../auth/src/clientCredentials.ts
|
|
64913
64922
|
var init_clientCredentials = __esm(() => {
|
|
64914
64923
|
init_config();
|
|
64924
|
+
init_tokenGrant();
|
|
64925
|
+
});
|
|
64926
|
+
|
|
64927
|
+
// ../auth/src/federatedCredentials.ts
|
|
64928
|
+
var init_federatedCredentials = __esm(() => {
|
|
64929
|
+
init_config();
|
|
64930
|
+
init_tokenGrant();
|
|
64915
64931
|
});
|
|
64916
64932
|
// ../auth/src/selectTenant.ts
|
|
64917
64933
|
var TENANT_SELECTION_REQUIRED_CODE2 = "TENANT_SELECTION_REQUIRED", INVALID_TENANT_CODE2 = "INVALID_TENANT", TENANT_SELECTION_CODES2;
|
|
@@ -64926,6 +64942,7 @@ var init_interactive = __esm(() => {
|
|
|
64926
64942
|
init_src2();
|
|
64927
64943
|
init_clientCredentials();
|
|
64928
64944
|
init_config();
|
|
64945
|
+
init_federatedCredentials();
|
|
64929
64946
|
init_src5();
|
|
64930
64947
|
init_selectTenant();
|
|
64931
64948
|
init_envFile();
|
|
@@ -64952,6 +64969,7 @@ var init_src5 = __esm(() => {
|
|
|
64952
64969
|
init_config();
|
|
64953
64970
|
init_constants3();
|
|
64954
64971
|
init_envAuth();
|
|
64972
|
+
init_federatedCredentials();
|
|
64955
64973
|
init_refreshCircuitBreaker();
|
|
64956
64974
|
init_selectTenant();
|
|
64957
64975
|
init_server2();
|
|
@@ -67629,7 +67647,7 @@ init_esm();
|
|
|
67629
67647
|
var package_default = {
|
|
67630
67648
|
name: "@uipath/agenthub-tool",
|
|
67631
67649
|
license: "MIT",
|
|
67632
|
-
version: "1.
|
|
67650
|
+
version: "1.199.0-preview.104",
|
|
67633
67651
|
description: "Manage UiPath AgentHub MCP server registrations, tools, and remote A2A agents.",
|
|
67634
67652
|
private: false,
|
|
67635
67653
|
repository: {
|
|
@@ -67664,6 +67682,7 @@ var package_default = {
|
|
|
67664
67682
|
},
|
|
67665
67683
|
devDependencies: {
|
|
67666
67684
|
"@uipath/agenthub-sdk": "workspace:*",
|
|
67685
|
+
"@uipath/auth": "workspace:*",
|
|
67667
67686
|
"@uipath/common": "workspace:*",
|
|
67668
67687
|
"@uipath/filesystem": "workspace:*",
|
|
67669
67688
|
"@uipath/integrationservice-sdk": "workspace:*",
|
|
@@ -86766,7 +86785,7 @@ class VoidApiResponse {
|
|
|
86766
86785
|
var package_default2 = {
|
|
86767
86786
|
name: "@uipath/agenthub-sdk",
|
|
86768
86787
|
license: "MIT",
|
|
86769
|
-
version: "1.
|
|
86788
|
+
version: "1.199.0",
|
|
86770
86789
|
repository: {
|
|
86771
86790
|
type: "git",
|
|
86772
86791
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -87942,6 +87961,7 @@ var resolveConfigAsync = async ({
|
|
|
87942
87961
|
customAuthority,
|
|
87943
87962
|
customClientId,
|
|
87944
87963
|
customClientSecret,
|
|
87964
|
+
customClientAssertion,
|
|
87945
87965
|
customScopes
|
|
87946
87966
|
} = {}) => {
|
|
87947
87967
|
const fileAuth = getAuthFileConfig();
|
|
@@ -87967,7 +87987,7 @@ var resolveConfigAsync = async ({
|
|
|
87967
87987
|
if (!clientSecret && fileAuth.clientSecret) {
|
|
87968
87988
|
clientSecret = fileAuth.clientSecret;
|
|
87969
87989
|
}
|
|
87970
|
-
const isExternalAppAuth = clientId !== DEFAULT_CLIENT_ID && Boolean(clientSecret);
|
|
87990
|
+
const isExternalAppAuth = clientId !== DEFAULT_CLIENT_ID && (Boolean(clientSecret) || Boolean(customClientAssertion));
|
|
87971
87991
|
const scopes = resolveScopes(isExternalAppAuth, customScopes, fileAuth.scopes);
|
|
87972
87992
|
return {
|
|
87973
87993
|
clientId,
|
|
@@ -90330,6 +90350,7 @@ var CREATE_EXAMPLES_BY_TYPE = {
|
|
|
90330
90350
|
};
|
|
90331
90351
|
|
|
90332
90352
|
// src/commands/mcp-tools.ts
|
|
90353
|
+
init_src5();
|
|
90333
90354
|
init_src3();
|
|
90334
90355
|
|
|
90335
90356
|
// ../integrationservice-sdk/src/user-agent.ts
|
|
@@ -90865,7 +90886,7 @@ class TextApiResponse2 {
|
|
|
90865
90886
|
var package_default4 = {
|
|
90866
90887
|
name: "@uipath/integrationservice-sdk",
|
|
90867
90888
|
license: "MIT",
|
|
90868
|
-
version: "1.
|
|
90889
|
+
version: "1.199.0-preview.104",
|
|
90869
90890
|
repository: {
|
|
90870
90891
|
type: "git",
|
|
90871
90892
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -97421,7 +97442,7 @@ class JSONApiResponse5 {
|
|
|
97421
97442
|
var package_default5 = {
|
|
97422
97443
|
name: "@uipath/resourcecatalog-sdk",
|
|
97423
97444
|
license: "MIT",
|
|
97424
|
-
version: "1.
|
|
97445
|
+
version: "1.199.0",
|
|
97425
97446
|
description: "SDK for the UiPath Resource Catalog Service API.",
|
|
97426
97447
|
repository: {
|
|
97427
97448
|
type: "git",
|
|
@@ -98144,6 +98165,35 @@ var ALL_CANDIDATE_CATEGORIES = [
|
|
|
98144
98165
|
"is-activity"
|
|
98145
98166
|
];
|
|
98146
98167
|
var PROCESS_TYPE_API = "Api";
|
|
98168
|
+
var isIsActivityToolPayload = (payload) => Number(payload.type) === 1 && typeof payload.processType === "string" && payload.processType.toLowerCase() === PROCESS_TYPE_API.toLowerCase();
|
|
98169
|
+
var IS_ACTIVITY_UNAVAILABLE_HOSTS = new Set([
|
|
98170
|
+
"cloud.uipath.com"
|
|
98171
|
+
]);
|
|
98172
|
+
var assertIsActivityAvailable = async (options, code) => {
|
|
98173
|
+
if (options.force)
|
|
98174
|
+
return true;
|
|
98175
|
+
const [authError, ctx] = await catchError2(getAuthContext2({
|
|
98176
|
+
tenant: options.tenant,
|
|
98177
|
+
ensureTokenValidityMinutes: options.loginValidity
|
|
98178
|
+
}));
|
|
98179
|
+
if (authError) {
|
|
98180
|
+
await emitError(code, authError);
|
|
98181
|
+
return false;
|
|
98182
|
+
}
|
|
98183
|
+
let host;
|
|
98184
|
+
try {
|
|
98185
|
+
host = new URL(ctx?.baseUrl ?? "").hostname.toLowerCase();
|
|
98186
|
+
} catch {
|
|
98187
|
+
return true;
|
|
98188
|
+
}
|
|
98189
|
+
if (!IS_ACTIVITY_UNAVAILABLE_HOSTS.has(host))
|
|
98190
|
+
return true;
|
|
98191
|
+
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.`), {
|
|
98192
|
+
Reason: "IsActivityNotAvailable",
|
|
98193
|
+
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."
|
|
98194
|
+
});
|
|
98195
|
+
return false;
|
|
98196
|
+
};
|
|
98147
98197
|
var validateIsActivityMapping = (metadataRaw) => {
|
|
98148
98198
|
let metadata;
|
|
98149
98199
|
if (typeof metadataRaw === "string") {
|
|
@@ -98539,7 +98589,7 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98539
98589
|
Data: options.allowMultiple ? matches : matches[0]
|
|
98540
98590
|
});
|
|
98541
98591
|
});
|
|
98542
|
-
const resolveTargetByName = async (targetName, category, options) => {
|
|
98592
|
+
const resolveTargetByName = async (targetName, category, options, explicitTargetFolderKey) => {
|
|
98543
98593
|
if (!category) {
|
|
98544
98594
|
const error = new Error("--target-name requires --category to scope the RCS lookup. Pass --category automation|agent|agentic-process|api-workflow.");
|
|
98545
98595
|
error.code = "MissingCategory";
|
|
@@ -98560,8 +98610,8 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98560
98610
|
name: targetName,
|
|
98561
98611
|
entityTypes: [...filterDef.entityTypes],
|
|
98562
98612
|
entitySubType: [...filterDef.entitySubType],
|
|
98563
|
-
xUIPATHFolderKey: options.folderKey,
|
|
98564
|
-
xUIPATHFolderPath: options.folderPath
|
|
98613
|
+
xUIPATHFolderKey: explicitTargetFolderKey ?? options.folderKey,
|
|
98614
|
+
xUIPATHFolderPath: explicitTargetFolderKey ? undefined : options.folderPath
|
|
98565
98615
|
});
|
|
98566
98616
|
const entities = result?.value ?? [];
|
|
98567
98617
|
const exact = entities.filter((e) => e.name === targetName);
|
|
@@ -98596,7 +98646,44 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98596
98646
|
targetFolderKey: folderKey
|
|
98597
98647
|
};
|
|
98598
98648
|
};
|
|
98599
|
-
const
|
|
98649
|
+
const listConnectorConnections = async (category, options) => {
|
|
98650
|
+
const connectionsApi = await createApiClient3(ConnectionsApi, {
|
|
98651
|
+
tenant: options.tenant,
|
|
98652
|
+
loginValidity: options.loginValidity
|
|
98653
|
+
});
|
|
98654
|
+
const pageSize = 100;
|
|
98655
|
+
const maxPages = 20;
|
|
98656
|
+
const seen = new Set;
|
|
98657
|
+
const rows = [];
|
|
98658
|
+
for (let pageIndex = 0;pageIndex < maxPages; pageIndex++) {
|
|
98659
|
+
const batch = await connectionsApi.apiV1ConnectionsGet({
|
|
98660
|
+
allFolders: true,
|
|
98661
|
+
pageSize,
|
|
98662
|
+
pageIndex
|
|
98663
|
+
});
|
|
98664
|
+
const items = batch ?? [];
|
|
98665
|
+
let added = 0;
|
|
98666
|
+
for (const c of items) {
|
|
98667
|
+
const id = c.id ?? "";
|
|
98668
|
+
if (!id || seen.has(id))
|
|
98669
|
+
continue;
|
|
98670
|
+
seen.add(id);
|
|
98671
|
+
added++;
|
|
98672
|
+
const matchesConnector = c?.connector?.key === category || c?.elementInstance?.key === category;
|
|
98673
|
+
if (matchesConnector) {
|
|
98674
|
+
rows.push({
|
|
98675
|
+
id,
|
|
98676
|
+
name: c.name ?? "",
|
|
98677
|
+
folder: c.folder?.key ?? ""
|
|
98678
|
+
});
|
|
98679
|
+
}
|
|
98680
|
+
}
|
|
98681
|
+
if (items.length < pageSize || added === 0)
|
|
98682
|
+
break;
|
|
98683
|
+
}
|
|
98684
|
+
return rows;
|
|
98685
|
+
};
|
|
98686
|
+
const resolveIsActivityByName = async (targetName, category, options, explicitTargetFolderKey) => {
|
|
98600
98687
|
if (!category) {
|
|
98601
98688
|
const error = new Error("--target-name on is-activity requires --category <connector-key> to scope the IS connector. Discover via `uip is connectors list`.");
|
|
98602
98689
|
error.code = "MissingCategory";
|
|
@@ -98606,15 +98693,43 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98606
98693
|
tenant: options.tenant,
|
|
98607
98694
|
loginValidity: options.loginValidity
|
|
98608
98695
|
});
|
|
98609
|
-
const
|
|
98696
|
+
const [defaultConnError, defaultConnection] = await catchError2(api.apiV1ConnectorsKeyOrIdConnectionGet({
|
|
98610
98697
|
keyOrId: category
|
|
98611
|
-
});
|
|
98698
|
+
}));
|
|
98699
|
+
if (defaultConnError && explicitTargetFolderKey === undefined) {
|
|
98700
|
+
throw defaultConnError;
|
|
98701
|
+
}
|
|
98702
|
+
const connection = defaultConnError ? undefined : defaultConnection;
|
|
98703
|
+
const folderKey = connection?.folder?.key ?? "";
|
|
98704
|
+
if (explicitTargetFolderKey !== undefined) {
|
|
98705
|
+
if (connection?.id && folderKey.toLowerCase() === explicitTargetFolderKey.toLowerCase()) {
|
|
98706
|
+
return {
|
|
98707
|
+
targetIdentifier: connection.id,
|
|
98708
|
+
targetFolderKey: folderKey
|
|
98709
|
+
};
|
|
98710
|
+
}
|
|
98711
|
+
let candidates = [];
|
|
98712
|
+
try {
|
|
98713
|
+
candidates = await listConnectorConnections(category, options);
|
|
98714
|
+
} catch {}
|
|
98715
|
+
const inFolder = candidates.filter((c) => c.folder.toLowerCase() === explicitTargetFolderKey.toLowerCase());
|
|
98716
|
+
if (inFolder.length === 1) {
|
|
98717
|
+
return {
|
|
98718
|
+
targetIdentifier: inFolder[0].id,
|
|
98719
|
+
targetFolderKey: explicitTargetFolderKey
|
|
98720
|
+
};
|
|
98721
|
+
}
|
|
98722
|
+
const defaultNote = connection?.id ? `; the default connection '${connection.name ?? connection.id}' lives in folder ${folderKey || "unknown"}` : "; the connector has no default connection";
|
|
98723
|
+
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.`);
|
|
98724
|
+
error.code = inFolder.length === 0 ? "TargetFolderMismatch" : "AmbiguousConnection";
|
|
98725
|
+
error.candidates = inFolder.length > 0 ? inFolder : candidates;
|
|
98726
|
+
throw error;
|
|
98727
|
+
}
|
|
98612
98728
|
if (!connection?.id) {
|
|
98613
98729
|
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.`);
|
|
98614
98730
|
error.code = "NoDefaultConnection";
|
|
98615
98731
|
throw error;
|
|
98616
98732
|
}
|
|
98617
|
-
const folderKey = connection.folder?.key ?? "";
|
|
98618
98733
|
if (!folderKey) {
|
|
98619
98734
|
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.`);
|
|
98620
98735
|
error.code = "MissingFolderKey";
|
|
@@ -98626,19 +98741,7 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98626
98741
|
if (serverFolderKey && folderKey.toLowerCase() !== serverFolderKey.toLowerCase()) {
|
|
98627
98742
|
let candidates = [];
|
|
98628
98743
|
try {
|
|
98629
|
-
|
|
98630
|
-
tenant: options.tenant,
|
|
98631
|
-
loginValidity: options.loginValidity
|
|
98632
|
-
});
|
|
98633
|
-
const all = await connectionsApi.apiV1ConnectionsGet({
|
|
98634
|
-
allFolders: true,
|
|
98635
|
-
pageSize: 100
|
|
98636
|
-
});
|
|
98637
|
-
candidates = (all ?? []).filter((c) => c?.connector?.key === category || c?.elementInstance?.key === category).map((c) => ({
|
|
98638
|
-
id: c.id ?? "",
|
|
98639
|
-
name: c.name ?? "",
|
|
98640
|
-
folder: c.folder?.key ?? ""
|
|
98641
|
-
}));
|
|
98744
|
+
candidates = await listConnectorConnections(category, options);
|
|
98642
98745
|
} catch {}
|
|
98643
98746
|
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.`);
|
|
98644
98747
|
error.code = "CrossFolderConnection";
|
|
@@ -98658,10 +98761,23 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98658
98761
|
}
|
|
98659
98762
|
return;
|
|
98660
98763
|
};
|
|
98764
|
+
const resolveExplicitTargetFolderKey = async (options) => {
|
|
98765
|
+
if (options.targetFolderKey !== undefined)
|
|
98766
|
+
return options.targetFolderKey;
|
|
98767
|
+
if (options.targetFolderPath !== undefined) {
|
|
98768
|
+
return await resolveFolderNameToGuid(options.targetFolderPath, options);
|
|
98769
|
+
}
|
|
98770
|
+
return;
|
|
98771
|
+
};
|
|
98661
98772
|
const validateFolderInputsForTool = async (options, code) => {
|
|
98662
98773
|
try {
|
|
98663
98774
|
chooseFolderInput({ key: options.folderKey, path: options.folderPath }, "folder");
|
|
98664
98775
|
assertFolderKeyIsGuid(options.folderKey, "folder");
|
|
98776
|
+
chooseFolderInput({
|
|
98777
|
+
key: options.targetFolderKey,
|
|
98778
|
+
path: options.targetFolderPath
|
|
98779
|
+
}, "target-folder");
|
|
98780
|
+
assertFolderKeyIsGuid(options.targetFolderKey, "target-folder");
|
|
98665
98781
|
} catch (error) {
|
|
98666
98782
|
const errCode = error.code;
|
|
98667
98783
|
await emitError(code, error, errCode ? { Reason: errCode } : {});
|
|
@@ -98670,17 +98786,24 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98670
98786
|
return true;
|
|
98671
98787
|
};
|
|
98672
98788
|
const createTool = async (kind, options) => {
|
|
98789
|
+
if (kind === "is-activity" && !await assertIsActivityAvailable(options, OUTPUT_CODES2.Create))
|
|
98790
|
+
return;
|
|
98673
98791
|
if (!await validateFolderInputsForTool(options, OUTPUT_CODES2.Create))
|
|
98674
98792
|
return;
|
|
98675
98793
|
if (!await requireParentType(options.mcp, "uipath", options, OUTPUT_CODES2.Create))
|
|
98676
98794
|
return;
|
|
98795
|
+
const [targetFolderError, explicitTargetFolderKey] = await catchError2(resolveExplicitTargetFolderKey(options));
|
|
98796
|
+
if (targetFolderError) {
|
|
98797
|
+
const code = targetFolderError.code;
|
|
98798
|
+
return await emitError(OUTPUT_CODES2.Create, targetFolderError, code ? { Reason: code } : {});
|
|
98799
|
+
}
|
|
98677
98800
|
let resolvedIdentifier = options.targetIdentifier;
|
|
98678
98801
|
let resolvedFolderKey;
|
|
98679
98802
|
if (kind === "resource" && options.targetName && !options.targetIdentifier) {
|
|
98680
98803
|
try {
|
|
98681
|
-
const resolved = await resolveTargetByName(options.targetName, options.category, options);
|
|
98804
|
+
const resolved = await resolveTargetByName(options.targetName, options.category, options, explicitTargetFolderKey);
|
|
98682
98805
|
resolvedIdentifier = resolved.targetIdentifier;
|
|
98683
|
-
resolvedFolderKey =
|
|
98806
|
+
resolvedFolderKey = explicitTargetFolderKey ?? resolved.targetFolderKey;
|
|
98684
98807
|
} catch (resolveError) {
|
|
98685
98808
|
const code = resolveError.code;
|
|
98686
98809
|
const candidates = resolveError.candidates;
|
|
@@ -98693,9 +98816,9 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98693
98816
|
}
|
|
98694
98817
|
if (kind === "is-activity" && options.targetName && !options.targetIdentifier) {
|
|
98695
98818
|
try {
|
|
98696
|
-
const resolved = await resolveIsActivityByName(options.targetName, options.category, options);
|
|
98819
|
+
const resolved = await resolveIsActivityByName(options.targetName, options.category, options, explicitTargetFolderKey);
|
|
98697
98820
|
resolvedIdentifier = resolved.targetIdentifier;
|
|
98698
|
-
resolvedFolderKey =
|
|
98821
|
+
resolvedFolderKey = resolved.targetFolderKey;
|
|
98699
98822
|
} catch (resolveError) {
|
|
98700
98823
|
const code = resolveError.code;
|
|
98701
98824
|
const candidates = resolveError.candidates;
|
|
@@ -98706,12 +98829,16 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98706
98829
|
}
|
|
98707
98830
|
}
|
|
98708
98831
|
if (kind !== "raw" && !resolvedFolderKey) {
|
|
98709
|
-
|
|
98710
|
-
|
|
98711
|
-
|
|
98712
|
-
|
|
98832
|
+
if (explicitTargetFolderKey !== undefined) {
|
|
98833
|
+
resolvedFolderKey = explicitTargetFolderKey;
|
|
98834
|
+
} else {
|
|
98835
|
+
const [serverFolderError, serverFolderKey] = await catchError2(resolveServerFolderKey(options));
|
|
98836
|
+
if (serverFolderError) {
|
|
98837
|
+
const code = serverFolderError.code;
|
|
98838
|
+
return await emitError(OUTPUT_CODES2.Create, serverFolderError, code ? { Reason: code } : {});
|
|
98839
|
+
}
|
|
98840
|
+
resolvedFolderKey = serverFolderKey;
|
|
98713
98841
|
}
|
|
98714
|
-
resolvedFolderKey = serverFolderKey;
|
|
98715
98842
|
}
|
|
98716
98843
|
const scalar = kind === "raw" ? {} : {
|
|
98717
98844
|
type: kind === "is-activity" ? 1 : 0,
|
|
@@ -98732,7 +98859,12 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98732
98859
|
if (validateError)
|
|
98733
98860
|
return await emitError(OUTPUT_CODES2.Create, validateError);
|
|
98734
98861
|
const payloadObj = payload;
|
|
98735
|
-
|
|
98862
|
+
if (explicitTargetFolderKey !== undefined && (options.file || options.body || kind === "raw")) {
|
|
98863
|
+
payloadObj.targetFolderKey = explicitTargetFolderKey;
|
|
98864
|
+
}
|
|
98865
|
+
const isIsActivityPayload = kind === "is-activity" || isIsActivityToolPayload(payloadObj);
|
|
98866
|
+
if (kind !== "is-activity" && isIsActivityPayload && !await assertIsActivityAvailable(options, OUTPUT_CODES2.Create))
|
|
98867
|
+
return;
|
|
98736
98868
|
if (isIsActivityPayload) {
|
|
98737
98869
|
const [mappingError] = await catchError2(Promise.resolve().then(() => validateIsActivityMapping(payloadObj.metadata)));
|
|
98738
98870
|
if (mappingError) {
|
|
@@ -98781,7 +98913,10 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98781
98913
|
["create-is-activity", "is-activity"],
|
|
98782
98914
|
["create-raw", "raw"]
|
|
98783
98915
|
]) {
|
|
98784
|
-
const
|
|
98916
|
+
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.");
|
|
98917
|
+
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.");
|
|
98918
|
+
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).");
|
|
98919
|
+
const leaf = addInputOptions(base).examples(TOOL_CREATE_EXAMPLES_BY_KIND[kind]);
|
|
98785
98920
|
leaf.trackedAction(processContext, async (options) => createTool(kind, options));
|
|
98786
98921
|
}
|
|
98787
98922
|
addInputOptions(tools.command("update").description([
|
|
@@ -98790,7 +98925,7 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98790
98925
|
"Use `--rename <new-name>` to change the tool's name; the",
|
|
98791
98926
|
"lookup `--name` flag selects the existing tool to update."
|
|
98792
98927
|
].join(`
|
|
98793
|
-
`)).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) => {
|
|
98928
|
+
`)).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) => {
|
|
98794
98929
|
if (!await validateFolderInputsForTool(options, OUTPUT_CODES2.Update))
|
|
98795
98930
|
return;
|
|
98796
98931
|
if (!await requireParentType(options.mcp, "uipath", options, OUTPUT_CODES2.Update))
|
|
@@ -98798,8 +98933,13 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98798
98933
|
const ids = await resolveToolIds(options, id ? [id] : [], OUTPUT_CODES2.Update);
|
|
98799
98934
|
if (!ids)
|
|
98800
98935
|
return;
|
|
98801
|
-
|
|
98802
|
-
if (
|
|
98936
|
+
const [targetFolderError, explicitTargetFolderKey] = await catchError2(resolveExplicitTargetFolderKey(options));
|
|
98937
|
+
if (targetFolderError) {
|
|
98938
|
+
const code = targetFolderError.code;
|
|
98939
|
+
return await emitError(OUTPUT_CODES2.Update, targetFolderError, code ? { Reason: code } : {});
|
|
98940
|
+
}
|
|
98941
|
+
let resolvedTargetFolderKey = explicitTargetFolderKey;
|
|
98942
|
+
if (resolvedTargetFolderKey === undefined && options.targetIdentifier) {
|
|
98803
98943
|
const [serverFolderError, serverFolderKey] = await catchError2(resolveServerFolderKey(options));
|
|
98804
98944
|
if (serverFolderError) {
|
|
98805
98945
|
const code = serverFolderError.code;
|
|
@@ -98821,6 +98961,11 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98821
98961
|
const [validateError] = await catchError2(Promise.resolve().then(() => validateJsonStrings(payload)));
|
|
98822
98962
|
if (validateError)
|
|
98823
98963
|
return await emitError(OUTPUT_CODES2.Update, validateError);
|
|
98964
|
+
if (isIsActivityToolPayload(payload) && !await assertIsActivityAvailable(options, OUTPUT_CODES2.Update))
|
|
98965
|
+
return;
|
|
98966
|
+
if (explicitTargetFolderKey !== undefined && (options.file || options.body)) {
|
|
98967
|
+
payload.targetFolderKey = explicitTargetFolderKey;
|
|
98968
|
+
}
|
|
98824
98969
|
if (options.dryRun) {
|
|
98825
98970
|
OutputFormatter.success({
|
|
98826
98971
|
Result: RESULTS.Success,
|
|
@@ -98958,7 +99103,7 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98958
99103
|
}
|
|
98959
99104
|
return originalOptionMissingArgument(option);
|
|
98960
99105
|
};
|
|
98961
|
-
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) => {
|
|
99106
|
+
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) => {
|
|
98962
99107
|
const offset = resolveDeprecatedOptionAlias({
|
|
98963
99108
|
preferredValue: options.offset,
|
|
98964
99109
|
deprecatedValue: options.skip,
|
|
@@ -98983,6 +99128,8 @@ var registerMcpToolsCommand = (parent) => {
|
|
|
98983
99128
|
return await emitError(OUTPUT_CODES2.Candidates, new Error(`Invalid --category '${category}'. Use one of: ${ALL_CANDIDATE_CATEGORIES.join(", ")}.`));
|
|
98984
99129
|
}
|
|
98985
99130
|
if (category === "is-activity") {
|
|
99131
|
+
if (!await assertIsActivityAvailable(options, OUTPUT_CODES2.Candidates))
|
|
99132
|
+
return;
|
|
98986
99133
|
const needle = options.name?.toLowerCase();
|
|
98987
99134
|
const skip = offset.value ?? 0;
|
|
98988
99135
|
const limit = options.limit ?? DEFAULT_PAGE_SIZE;
|
|
@@ -99544,4 +99691,4 @@ export {
|
|
|
99544
99691
|
createStandaloneProgram
|
|
99545
99692
|
};
|
|
99546
99693
|
|
|
99547
|
-
//# debugId=
|
|
99694
|
+
//# debugId=EA927289E84F50B464756E2164756E21
|
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.104",
|
|
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": "829a8ab8a25bce5b62c284bd1ddc674d2947f647"
|
|
30
30
|
}
|