@uipath/agent-tool 1.0.4 → 1.195.0

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 (3) hide show
  1. package/dist/packager-tool.js +247 -108
  2. package/dist/tool.js +9911 -7693
  3. package/package.json +53 -52
@@ -822,6 +822,7 @@ class ToolResult {
822
822
  errorCode;
823
823
  message;
824
824
  packages;
825
+ details;
825
826
  constructor(errorCode, message, packages = []) {
826
827
  this.errorCode = errorCode;
827
828
  this.message = message;
@@ -15168,7 +15169,7 @@ var import_semver, createStorageSchema = (factory) => {
15168
15169
  }, migrationV40, version16 = "41.0.0", nodePositionSchemaV41, nodeSizeSchemaV41, resourceNodeSchemaV41, stickyNoteNodeSchemaV41, flowLayoutSchemaV41, lowCodeAgentSchemaV41, codedAgentSchemaV41, agentStorageSchemaV41, storageSchemaV41, v41, migrationV41, version17 = "42.0.0", ENTITIES_TO_REMOVE, lowCodeAgentSchemaV42, codedAgentSchemaV42, agentStorageSchemaV42, storageSchemaV42, v42, migrationV42, version18 = "43.0.0", lowCodeAgentSchemaV43, codedAgentSchemaV43, agentStorageSchemaV43, storageSchemaV43, v43, migrationV43, version19 = "44.0.0", _memorySpaceStorageSchemaV43, msEscalationSettingsSchemaV44, escalationStorageSchemaV44, resourceStorageSchemaV44, resourcesFolderSchemaV44, lowCodeAgentSchemaV44, codedAgentSchemaV44, agentStorageSchemaV44, storageSchemaV44, v44, migrationV44, version20 = "45.0.0", appearanceSchema2, lowCodeAgentSchemaV45, codedAgentSchemaV45, agentStorageSchemaV45, storageSchemaV45, v45, migrationV45, version21 = "46.0.0", lowCodeAgentSchemaV46, codedAgentSchemaV46, agentStorageSchemaV46, storageSchemaV46, v46, migrationV46, version222 = "47.0.0", processOrchestrationToolStorageSchemaV47, toolStorageSchemaV47, resourceStorageSchemaV47, resourcesFolderSchemaV47, lowCodeAgentSchemaV47, codedAgentSchemaV47, agentStorageSchemaV47, storageSchemaV47, v47, migrationV47, version23 = "48.0.0", vdoInputValueSchemaV48, requiredEntityInputSchemaV48, dataFabricEntityItemSchemaV48, indexOrAttachmentsContextStorageSchemaV48, dataFabricContextStorageSchemaV48, contextStorageSchemaV48, a2aStorageSchemaV48, resourceStorageSchemaV48, resourcesFolderSchemaV48, lowCodeAgentSchemaV48, codedAgentSchemaV48, agentStorageSchemaV48, storageSchemaV48, migrateContextResource = (context) => ({
15169
15170
  ...context,
15170
15171
  contextType: context.contextType ?? (context.attachments ? "attachments" : "index")
15171
- }), v48, migrationV48, version24 = "49.0.0", lowCodeAgentSchemaV49, codedAgentSchemaV49, agentStorageSchemaV49, storageSchemaV49, v49, migrationV49, version25 = "50.0.0", RECIPIENT_TYPE3, escalationChannelActionCenterSchemaV50, escalationStorageSchemaV50, baseLowCodeSettingsSchema, _v49ProcessToolSchema, standardLowCodeAgentSettingsV50, advancedLowCodeAgentSettingsV50, lowCodeAgentSettingsV50, lowCodeAgentSchemaV50, codedAgentSchemaV50, agentStorageSchemaV50, clientSideToolStorageSchemaV50, toolStorageSchemaV50, resourceStorageSchemaV50, resourcesFolderSchemaV50, storageSchemaV50, v50, migrationV50, migrations, currentStorageSchemaMigration, currentStorageSchema, currentAgentStorageSchema, currentResourceStorageSchema, currentFeatureStorageSchema, currentEvaluationSetStorageSchema, currentCodedAgentStorageSchema, currentFlowLayoutStorageSchema, applyMigrations = async (migrations2, data, currentVersion9, options = {}) => {
15172
+ }), v48, migrationV48, version24 = "49.0.0", lowCodeAgentSchemaV49, codedAgentSchemaV49, agentStorageSchemaV49, storageSchemaV49, v49, migrationV49, version25 = "50.0.0", RECIPIENT_TYPE3, escalationChannelActionCenterSchemaV50, escalationStorageSchemaV50, baseLowCodeSettingsSchema, _v49ProcessToolSchema, flowToolStorageSchemaV50, voiceSettingsExtension, standardLowCodeAgentSettingsV50, advancedLowCodeAgentSettingsV50, lowCodeAgentSettingsV50, lowCodeAgentSchemaV50, codedAgentSchemaV50, agentStorageSchemaV50, clientSideToolStorageSchemaV50, toolStorageSchemaV50, discoveryModeSchemaV50, mcpToolStorageSchemaV50, resourceStorageSchemaV50, resourcesFolderSchemaV50, storageSchemaV50, v50, migrationV50, migrations, currentStorageSchemaMigration, currentStorageSchema, currentAgentStorageSchema, currentResourceStorageSchema, currentFeatureStorageSchema, currentEvaluationSetStorageSchema, currentCodedAgentStorageSchema, currentFlowLayoutStorageSchema, applyMigrations = async (migrations2, data, currentVersion9, options = {}) => {
15172
15173
  const parsedCurrentVersion = import_semver.coerce(currentVersion9);
15173
15174
  if (!parsedCurrentVersion) {
15174
15175
  throw new Error(`Invalid current version: ${currentVersion9}`);
@@ -23390,7 +23391,8 @@ var init_dist2 = __esm(() => {
23390
23391
  featuresFolder: v46.featuresFolder,
23391
23392
  flowLayout: v46.flowLayout,
23392
23393
  mcp: v46.mcp,
23393
- tool: toolStorageSchemaV47
23394
+ tool: toolStorageSchemaV47,
23395
+ processOrchestrationTool: processOrchestrationToolStorageSchemaV47
23394
23396
  };
23395
23397
  migrationV47 = createMigration({
23396
23398
  from: v46.storage,
@@ -23567,7 +23569,8 @@ var init_dist2 = __esm(() => {
23567
23569
  flowLayout: v47.flowLayout,
23568
23570
  mcp: v47.mcp,
23569
23571
  a2a: a2aStorageSchemaV48,
23570
- tool: v47.tool
23572
+ tool: v47.tool,
23573
+ processOrchestrationTool: v47.processOrchestrationTool
23571
23574
  };
23572
23575
  migrationV48 = createMigration({
23573
23576
  from: v47.storage,
@@ -23689,7 +23692,8 @@ var init_dist2 = __esm(() => {
23689
23692
  flowLayout: v48.flowLayout,
23690
23693
  mcp: v48.mcp,
23691
23694
  a2a: v48.a2a,
23692
- tool: v48.tool
23695
+ tool: v48.tool,
23696
+ processOrchestrationTool: v48.processOrchestrationTool
23693
23697
  };
23694
23698
  migrationV49 = createMigration({
23695
23699
  from: v48.storage,
@@ -23793,15 +23797,27 @@ var init_dist2 = __esm(() => {
23793
23797
  });
23794
23798
  baseLowCodeSettingsSchema = v49.lowCodeAgent.shape.settings;
23795
23799
  _v49ProcessToolSchema = v49.tool.options[1];
23796
- standardLowCodeAgentSettingsV50 = baseLowCodeSettingsSchema.extend({ mode: exports_external.literal("standard") });
23797
- advancedLowCodeAgentSettingsV50 = baseLowCodeSettingsSchema.extend({ mode: exports_external.literal("advanced") });
23800
+ flowToolStorageSchemaV50 = v49.processOrchestrationTool.extend({
23801
+ type: exports_external.literal("flow")
23802
+ });
23803
+ voiceSettingsExtension = {
23804
+ voice: exports_external.object({
23805
+ model: exports_external.string(),
23806
+ maxTokens: exports_external.number(),
23807
+ temperature: exports_external.number(),
23808
+ persona: exports_external.string()
23809
+ }).optional()
23810
+ };
23811
+ standardLowCodeAgentSettingsV50 = baseLowCodeSettingsSchema.extend({ mode: exports_external.literal("standard") }).extend(voiceSettingsExtension);
23812
+ advancedLowCodeAgentSettingsV50 = baseLowCodeSettingsSchema.extend({ mode: exports_external.literal("advanced") }).extend(voiceSettingsExtension);
23798
23813
  lowCodeAgentSettingsV50 = exports_external.discriminatedUnion("mode", [
23799
23814
  standardLowCodeAgentSettingsV50,
23800
23815
  advancedLowCodeAgentSettingsV50
23801
23816
  ]);
23802
23817
  lowCodeAgentSchemaV50 = v49.lowCodeAgent.extend({
23803
23818
  metadata: v49.lowCodeAgent.shape.metadata.extend({
23804
- storageVersion: exports_external.literal(version25)
23819
+ storageVersion: exports_external.literal(version25),
23820
+ variant: exports_external.enum(["caseManager"]).optional()
23805
23821
  }),
23806
23822
  settings: lowCodeAgentSettingsV50,
23807
23823
  id: exports_external.string().optional(),
@@ -23836,13 +23852,21 @@ var init_dist2 = __esm(() => {
23836
23852
  });
23837
23853
  toolStorageSchemaV50 = exports_external.discriminatedUnion("type", [
23838
23854
  ...v49.tool.options,
23839
- clientSideToolStorageSchemaV50
23855
+ clientSideToolStorageSchemaV50,
23856
+ flowToolStorageSchemaV50
23840
23857
  ]);
23858
+ discoveryModeSchemaV50 = exports_external.discriminatedUnion("type", [
23859
+ exports_external.object({ type: exports_external.literal("cached") }),
23860
+ exports_external.object({ type: exports_external.literal("dynamic"), allowAll: exports_external.boolean() })
23861
+ ]);
23862
+ mcpToolStorageSchemaV50 = v49.mcp.omit({ dynamicTools: true }).extend({
23863
+ toolsConfiguration: exports_external.object({ discoveryMode: discoveryModeSchemaV50 }).default({ discoveryMode: { type: "cached" } })
23864
+ });
23841
23865
  resourceStorageSchemaV50 = exports_external.union([
23842
23866
  toolStorageSchemaV50,
23843
23867
  v49.context,
23844
23868
  escalationStorageSchemaV50,
23845
- v49.mcp,
23869
+ mcpToolStorageSchemaV50,
23846
23870
  v49.a2a
23847
23871
  ]);
23848
23872
  resourcesFolderSchemaV50 = exports_external.object({
@@ -23890,6 +23914,7 @@ var init_dist2 = __esm(() => {
23890
23914
  },
23891
23915
  defaultStorageContents: {
23892
23916
  ...migrationV49.defaultStorageContents,
23917
+ folders: migrationV49.defaultStorageContents.folders,
23893
23918
  files: [
23894
23919
  {
23895
23920
  ...migrationV49.defaultStorageContents.files[0],
@@ -23917,8 +23942,9 @@ var init_dist2 = __esm(() => {
23917
23942
  const evalsFolder8 = prev.folders.find((folder) => folder.name === "evals");
23918
23943
  const featuresFolder = prev.folders.find((folder) => folder.name === "features");
23919
23944
  const resourcesFolder8 = prev.folders.find((folder) => folder.name === "resources");
23945
+ const rootFolders = [evalsFolder8, featuresFolder, resourcesFolder8];
23920
23946
  return {
23921
- folders: [evalsFolder8, featuresFolder, resourcesFolder8],
23947
+ folders: rootFolders,
23922
23948
  files: [
23923
23949
  {
23924
23950
  name: "agent.json",
@@ -35377,7 +35403,7 @@ var init_v42 = __esm(() => {
35377
35403
  init_classic2();
35378
35404
  });
35379
35405
 
35380
- // ../../node_modules/@uipath/tool-agent/dist/chunk-7ZQB234J.js
35406
+ // ../../node_modules/@uipath/tool-agent/dist/chunk-4JNYQN2C.js
35381
35407
  function serializeJson(value) {
35382
35408
  return JSON.stringify(value, (_key, val) => val === undefined || val === null ? undefined : val, 2);
35383
35409
  }
@@ -35404,11 +35430,6 @@ async function writeJsonFile(fileSystem, path, data) {
35404
35430
  const serialized = serializeJson(data);
35405
35431
  await fileSystem.writeFile(path, serialized);
35406
35432
  }
35407
- async function readOptionalJsonFile(fileSystem, path, parser) {
35408
- if (!await fileSystem.exists(path))
35409
- return;
35410
- return parser ? readJsonFile(fileSystem, path, parser) : readJsonFile(fileSystem, path);
35411
- }
35412
35433
  function getSupportedRootFolders(storageMajorVersion) {
35413
35434
  const supported = [];
35414
35435
  if (storageMajorVersion >= 1) {
@@ -35570,11 +35591,13 @@ function stripResourceDesignFields(data) {
35570
35591
  return stripDesignFields(data, RESOURCE_DESIGN_ONLY_FIELDS);
35571
35592
  }
35572
35593
  function buildAgentUnifiedModel(agent, resources, features, options) {
35573
- const id = options?.projectStorageId;
35574
- const name = options?.projectName;
35594
+ if (agent.type === "lowCode") {
35595
+ if (!agent.id && options?.projectStorageId)
35596
+ agent.id = options.projectStorageId;
35597
+ if (options?.projectName)
35598
+ agent.name = options.projectName;
35599
+ }
35575
35600
  return {
35576
- ...id ? { id } : {},
35577
- ...name ? { name } : {},
35578
35601
  ...agent,
35579
35602
  resources: resources.map(stripResourceDesignFields),
35580
35603
  features: features.map(stripResourceDesignFields)
@@ -35695,7 +35718,7 @@ var import_semver2, FileConstants, AgentProjectConstants, CodedProjectConstants,
35695
35718
  };
35696
35719
  }
35697
35720
  }, defaultStorageSchemaTranslator, PackageConstants, PackageDescriptorConstants, SchemaConstants, RESOURCE_DESIGN_ONLY_FIELDS;
35698
- var init_chunk_7ZQB234J = __esm(() => {
35721
+ var init_chunk_4JNYQN2C = __esm(() => {
35699
35722
  init_dist();
35700
35723
  init_dist();
35701
35724
  init_dist2();
@@ -35753,7 +35776,7 @@ var init_chunk_7ZQB234J = __esm(() => {
35753
35776
  RESOURCE_DESIGN_ONLY_FIELDS = ["iconUrl", "originalName", "location"];
35754
35777
  });
35755
35778
 
35756
- // ../../node_modules/@uipath/tool-agent/dist/chunk-RQQ7Q4C6.js
35779
+ // ../../node_modules/@uipath/tool-agent/dist/chunk-XB3E4BGG.js
35757
35780
  function isAssetRecipientType(type) {
35758
35781
  return ASSET_RECIPIENT_TYPES.has(type);
35759
35782
  }
@@ -35766,13 +35789,26 @@ function defaultMetadata() {
35766
35789
  [BindingsConstants.BindingsMetadataSolutionsSupport]: BindingsConstants.BindingsMetadataTrue
35767
35790
  };
35768
35791
  }
35769
- function createProcessBinding(processName, subType) {
35792
+ function resolveFolderPathBindingValue(raw) {
35793
+ if (!raw || raw === SOLUTION_FOLDER_SENTINEL)
35794
+ return;
35795
+ return raw;
35796
+ }
35797
+ function addFolderPathToValue(value, raw) {
35798
+ const resolved = resolveFolderPathBindingValue(raw);
35799
+ if (resolved === undefined)
35800
+ return;
35801
+ value[BindingsConstants.BindingsValueFolderPathKey] = createBindingValue(resolved, BindingsConstants.BindingsValueFolderPathDisplayName);
35802
+ }
35803
+ function createProcessBinding(processName, subType, rawFolderPath) {
35804
+ const value = {
35805
+ [BindingsConstants.BindingsValueNameKey]: createBindingValue(processName, BindingsConstants.BindingsValueProcessNameDisplayName)
35806
+ };
35807
+ addFolderPathToValue(value, rawFolderPath);
35770
35808
  return {
35771
35809
  resource: BindingsConstants.ProcessResource,
35772
35810
  key: processName,
35773
- value: {
35774
- [BindingsConstants.BindingsValueNameKey]: createBindingValue(processName, BindingsConstants.BindingsValueProcessNameDisplayName)
35775
- },
35811
+ value,
35776
35812
  metadata: {
35777
35813
  [BindingsConstants.BindingsMetadataSubTypeKey]: subType,
35778
35814
  ...defaultMetadata()
@@ -35793,33 +35829,51 @@ function createConnectionBinding(connectionId, connectorKey, displayName) {
35793
35829
  }
35794
35830
  };
35795
35831
  }
35796
- function createIndexBinding(indexName) {
35832
+ function createIndexBinding(indexName, rawFolderPath) {
35833
+ const value = {
35834
+ [BindingsConstants.BindingsValueNameKey]: createBindingValue(indexName, BindingsConstants.BindingsValueIndexNameDisplayName)
35835
+ };
35836
+ addFolderPathToValue(value, rawFolderPath);
35797
35837
  return {
35798
35838
  resource: BindingsConstants.IndexResource,
35799
35839
  key: indexName,
35800
- value: {
35801
- [BindingsConstants.BindingsValueNameKey]: createBindingValue(indexName, BindingsConstants.BindingsValueIndexNameDisplayName)
35802
- },
35840
+ value,
35803
35841
  metadata: defaultMetadata()
35804
35842
  };
35805
35843
  }
35806
- function createAppBinding(appName) {
35844
+ function createAppBinding(appName, rawFolderPath) {
35845
+ const value = {
35846
+ [BindingsConstants.BindingsValueNameKey]: createBindingValue(appName, BindingsConstants.BindingsValueAppNameDisplayName)
35847
+ };
35848
+ addFolderPathToValue(value, rawFolderPath);
35807
35849
  return {
35808
35850
  resource: BindingsConstants.AppResource,
35809
35851
  key: appName,
35810
- value: {
35811
- [BindingsConstants.BindingsValueNameKey]: createBindingValue(appName, BindingsConstants.BindingsValueAppNameDisplayName)
35812
- },
35852
+ value,
35813
35853
  metadata: defaultMetadata()
35814
35854
  };
35815
35855
  }
35816
- function createAssetBinding(assetName) {
35856
+ function createAssetBinding(assetName, rawFolderPath) {
35857
+ const value = {
35858
+ [BindingsConstants.BindingsValueNameKey]: createBindingValue(assetName, BindingsConstants.BindingsValueAssetNameDisplayName)
35859
+ };
35860
+ addFolderPathToValue(value, rawFolderPath);
35817
35861
  return {
35818
35862
  resource: BindingsConstants.AssetResource,
35819
35863
  key: assetName,
35820
- value: {
35821
- [BindingsConstants.BindingsValueNameKey]: createBindingValue(assetName, BindingsConstants.BindingsValueAssetNameDisplayName)
35822
- },
35864
+ value,
35865
+ metadata: defaultMetadata()
35866
+ };
35867
+ }
35868
+ function createBucketBinding(bucketName, rawFolderPath) {
35869
+ const value = {
35870
+ [BindingsConstants.BindingsValueNameKey]: createBindingValue(bucketName, BindingsConstants.BindingsValueBucketNameDisplayName)
35871
+ };
35872
+ addFolderPathToValue(value, rawFolderPath);
35873
+ return {
35874
+ resource: BindingsConstants.BucketResource,
35875
+ key: bucketName,
35876
+ value,
35823
35877
  metadata: defaultMetadata()
35824
35878
  };
35825
35879
  }
@@ -35842,11 +35896,11 @@ function generateAgentGuardrailBindings(agent) {
35842
35896
  const { action } = guardrail;
35843
35897
  const appName = action.app?.name;
35844
35898
  if (appName) {
35845
- bindings.push(createAppBinding(appName));
35899
+ bindings.push(createAppBinding(appName, action.app?.folderName));
35846
35900
  }
35847
35901
  const recipient = action.recipient;
35848
35902
  if (recipient && isAssetRecipientType(recipient.type) && "assetName" in recipient && recipient.assetName) {
35849
- bindings.push(createAssetBinding(recipient.assetName));
35903
+ bindings.push(createAssetBinding(recipient.assetName, "folderPath" in recipient ? recipient.folderPath : undefined));
35850
35904
  }
35851
35905
  }
35852
35906
  }
@@ -35857,13 +35911,15 @@ function generateAgentBindings(agent) {
35857
35911
  }
35858
35912
  function generateFeatureBindings(feature) {
35859
35913
  if (feature.$featureType === "memorySpace") {
35914
+ const value = {
35915
+ [BindingsConstants.BindingsValueNameKey]: createBindingValue(feature.memorySpaceName, BindingsConstants.BindingsValueMemoryNameDisplayName)
35916
+ };
35917
+ addFolderPathToValue(value, feature.folderPath);
35860
35918
  return [
35861
35919
  {
35862
35920
  resource: BindingsConstants.MemorySpaceResource,
35863
35921
  key: feature.memorySpaceName,
35864
- value: {
35865
- [BindingsConstants.BindingsValueNameKey]: createBindingValue(feature.memorySpaceName, BindingsConstants.BindingsValueMemoryNameDisplayName)
35866
- },
35922
+ value,
35867
35923
  metadata: defaultMetadata()
35868
35924
  }
35869
35925
  ];
@@ -35871,7 +35927,7 @@ function generateFeatureBindings(feature) {
35871
35927
  return [];
35872
35928
  }
35873
35929
  function createProcessToolBinding(tool, subType) {
35874
- return [createProcessBinding(tool.properties.processName, subType)];
35930
+ return [createProcessBinding(tool.properties.processName, subType, tool.properties.folderPath)];
35875
35931
  }
35876
35932
  function createIntegrationToolBindings(tool) {
35877
35933
  return [
@@ -35924,12 +35980,16 @@ function resolveToolBindingsFromRegistry(tool, registry3) {
35924
35980
  return registry3.api?.(tool);
35925
35981
  case "processOrchestration":
35926
35982
  return registry3.processOrchestration?.(tool);
35983
+ case "flow":
35984
+ return registry3.flow?.(tool);
35927
35985
  case "integration":
35928
35986
  return registry3.integration?.(tool);
35929
35987
  case "ixp":
35930
35988
  return registry3.ixp?.(tool);
35931
35989
  case "internal":
35932
35990
  return;
35991
+ case "clientSide":
35992
+ return registry3.clientSide?.(tool);
35933
35993
  default:
35934
35994
  return unhandledBindingsType(tool);
35935
35995
  }
@@ -35939,7 +35999,7 @@ function generateToolBindings(tool, registry3 = DEFAULT_TOOL_BINDING_HANDLER_REG
35939
35999
  if (tool.guardrail?.policies) {
35940
36000
  for (const policy of tool.guardrail.policies) {
35941
36001
  if (policy.action?.$actionType === "escalate" && policy.action.app?.name) {
35942
- bindings.push(createAppBinding(policy.action.app.name));
36002
+ bindings.push(createAppBinding(policy.action.app.name, policy.action.app.folderName));
35943
36003
  }
35944
36004
  }
35945
36005
  }
@@ -35949,48 +36009,44 @@ function generateDataFabricEntitySetBindings(context) {
35949
36009
  if (context.entitySet.length === 0) {
35950
36010
  return [];
35951
36011
  }
35952
- return context.entitySet.map((entity) => ({
35953
- resource: BindingsConstants.DataFabricEntityResource,
35954
- key: entity.referenceKey ?? entity.id,
35955
- value: {
35956
- [BindingsConstants.BindingsValueNameKey]: createBindingValue(entity.name, BindingsConstants.BindingsValueDataFabricEntityNameDisplayName),
35957
- [BindingsConstants.BindingsValueFolderPathKey]: createBindingValue(entity.folderId, BindingsConstants.BindingsValueFolderPathDisplayName)
35958
- },
35959
- metadata: {
35960
- ...defaultMetadata(),
35961
- scope: "folder"
35962
- }
35963
- }));
36012
+ return context.entitySet.map((entity) => {
36013
+ const value = {
36014
+ [BindingsConstants.BindingsValueNameKey]: createBindingValue(entity.name, BindingsConstants.BindingsValueDataFabricEntityNameDisplayName)
36015
+ };
36016
+ addFolderPathToValue(value, entity.folderId);
36017
+ return {
36018
+ resource: BindingsConstants.DataFabricEntityResource,
36019
+ key: entity.referenceKey ?? entity.id,
36020
+ value,
36021
+ metadata: {
36022
+ ...defaultMetadata(),
36023
+ scope: "folder"
36024
+ }
36025
+ };
36026
+ });
35964
36027
  }
35965
36028
  function generateContextBindings(context) {
35966
36029
  if (context.contextType === "datafabricentityset") {
35967
36030
  return generateDataFabricEntitySetBindings(context);
35968
36031
  }
35969
- return [createIndexBinding(context.indexName)];
36032
+ return [createIndexBinding(context.indexName, context.folderPath)];
35970
36033
  }
35971
36034
  function generateEscalationBindings(escalation) {
35972
36035
  const bindings = [];
35973
36036
  if (escalation.escalationType === BindingsConstants.VsEscalationType) {
35974
36037
  const bucketName = escalation.vsEscalationProperties?.storageBucketName;
35975
36038
  if (bucketName) {
35976
- bindings.push({
35977
- resource: BindingsConstants.BucketResource,
35978
- key: bucketName,
35979
- value: {
35980
- [BindingsConstants.BindingsValueNameKey]: createBindingValue(bucketName, BindingsConstants.BindingsValueBucketNameDisplayName)
35981
- },
35982
- metadata: defaultMetadata()
35983
- });
36039
+ bindings.push(createBucketBinding(bucketName, escalation.vsEscalationProperties?.storageBucketFolderPath));
35984
36040
  }
35985
36041
  } else {
35986
36042
  for (const channel of escalation.channels ?? []) {
35987
36043
  const appName = channel.properties?.appName;
35988
36044
  if (appName) {
35989
- bindings.push(createAppBinding(appName));
36045
+ bindings.push(createAppBinding(appName, channel.properties?.folderName));
35990
36046
  }
35991
36047
  for (const recipient of channel.recipients ?? []) {
35992
36048
  if (isAssetRecipientType(recipient.type) && "assetName" in recipient && recipient.assetName) {
35993
- bindings.push(createAssetBinding(recipient.assetName));
36049
+ bindings.push(createAssetBinding(recipient.assetName, "folderPath" in recipient ? recipient.folderPath : undefined));
35994
36050
  }
35995
36051
  }
35996
36052
  }
@@ -35998,13 +36054,29 @@ function generateEscalationBindings(escalation) {
35998
36054
  return bindings;
35999
36055
  }
36000
36056
  function generateMcpBindings(mcp) {
36057
+ const value = {
36058
+ [BindingsConstants.BindingsValueNameKey]: createBindingValue(mcp.slug, BindingsConstants.BindingsValueSlugDisplayName)
36059
+ };
36060
+ addFolderPathToValue(value, mcp.folderPath);
36001
36061
  return [
36002
36062
  {
36003
36063
  resource: BindingsConstants.McpResource,
36004
36064
  key: mcp.slug,
36005
- value: {
36006
- [BindingsConstants.BindingsValueNameKey]: createBindingValue(mcp.slug, BindingsConstants.BindingsValueSlugDisplayName)
36007
- },
36065
+ value,
36066
+ metadata: defaultMetadata()
36067
+ }
36068
+ ];
36069
+ }
36070
+ function generateA2aBindings(a2a) {
36071
+ const value = {
36072
+ [BindingsConstants.BindingsValueNameKey]: createBindingValue(a2a.slug, BindingsConstants.BindingsValueSlugDisplayName)
36073
+ };
36074
+ addFolderPathToValue(value, a2a.folderPath);
36075
+ return [
36076
+ {
36077
+ resource: BindingsConstants.RemoteA2aAgentResource,
36078
+ key: a2a.slug,
36079
+ value,
36008
36080
  metadata: defaultMetadata()
36009
36081
  }
36010
36082
  ];
@@ -36020,7 +36092,7 @@ function resolveResourceBindingsFromRegistry(resource, registry3) {
36020
36092
  case "mcp":
36021
36093
  return registry3.mcp?.(resource);
36022
36094
  case "a2a":
36023
- return;
36095
+ return registry3.a2a?.(resource);
36024
36096
  default:
36025
36097
  return unhandledBindingsType(resource);
36026
36098
  }
@@ -36051,8 +36123,8 @@ function generateBindings(agent, resources, features) {
36051
36123
  resources: uniqueBindings
36052
36124
  };
36053
36125
  }
36054
- var BindingsConstants, ASSET_RECIPIENT_TYPES, DEFAULT_TOOL_BINDING_HANDLER_REGISTRY, DEFAULT_RESOURCE_BINDING_HANDLER_REGISTRY;
36055
- var init_chunk_RQQ7Q4C6 = __esm(() => {
36126
+ var BindingsConstants, ASSET_RECIPIENT_TYPES, SOLUTION_FOLDER_SENTINEL = "solution_folder", DEFAULT_TOOL_BINDING_HANDLER_REGISTRY, DEFAULT_RESOURCE_BINDING_HANDLER_REGISTRY;
36127
+ var init_chunk_XB3E4BGG = __esm(() => {
36056
36128
  BindingsConstants = {
36057
36129
  ProcessResource: "process",
36058
36130
  ConnectionResource: "connection",
@@ -36064,6 +36136,7 @@ var init_chunk_RQQ7Q4C6 = __esm(() => {
36064
36136
  BucketResource: "bucket",
36065
36137
  IxpResource: "ixp",
36066
36138
  DataFabricEntityResource: "entity",
36139
+ RemoteA2aAgentResource: "remoteA2aAgent",
36067
36140
  VsEscalationType: 1,
36068
36141
  BindingsModelVersion: "2.0",
36069
36142
  BindingsValueNameKey: "name",
@@ -36082,7 +36155,7 @@ var init_chunk_RQQ7Q4C6 = __esm(() => {
36082
36155
  BindingsValueIxpProjectVersionDisplayName: "IXP project version",
36083
36156
  BindingsValueDataFabricEntityNameDisplayName: "Entity name",
36084
36157
  BindingsValueFolderPathKey: "folderPath",
36085
- BindingsValueFolderPathDisplayName: "folderPath",
36158
+ BindingsValueFolderPathDisplayName: "Folder path",
36086
36159
  BindingsMetadataSubTypeKey: "subType",
36087
36160
  BindingsMetadataConnectorKey: "connector",
36088
36161
  BindingsMetadataUseConnectionServiceKey: "useConnectionService",
@@ -36092,6 +36165,7 @@ var init_chunk_RQQ7Q4C6 = __esm(() => {
36092
36165
  BindingsMetadataProcessSubType: "process",
36093
36166
  BindingsMetadataApiWorkflowSubType: "api",
36094
36167
  BindingsMetadataAgenticProcessSubType: "processOrchestration",
36168
+ BindingsMetadataFlowSubType: "flow",
36095
36169
  BindingsMetadataVersion: "2.2",
36096
36170
  BindingsMetadataTrue: "true"
36097
36171
  };
@@ -36101,6 +36175,7 @@ var init_chunk_RQQ7Q4C6 = __esm(() => {
36101
36175
  agent: (tool) => createProcessToolBinding(tool, BindingsConstants.BindingsMetadataAgentSubType),
36102
36176
  api: (tool) => createProcessToolBinding(tool, BindingsConstants.BindingsMetadataApiWorkflowSubType),
36103
36177
  processOrchestration: (tool) => createProcessToolBinding(tool, BindingsConstants.BindingsMetadataAgenticProcessSubType),
36178
+ flow: (tool) => createProcessToolBinding(tool, BindingsConstants.BindingsMetadataFlowSubType),
36104
36179
  integration: createIntegrationToolBindings,
36105
36180
  ixp: createIxpToolBindings
36106
36181
  };
@@ -36108,27 +36183,61 @@ var init_chunk_RQQ7Q4C6 = __esm(() => {
36108
36183
  tool: (resource) => generateToolBindings(resource),
36109
36184
  context: (resource) => generateContextBindings(resource),
36110
36185
  escalation: (resource) => generateEscalationBindings(resource),
36111
- mcp: (resource) => generateMcpBindings(resource)
36186
+ mcp: (resource) => generateMcpBindings(resource),
36187
+ a2a: (resource) => generateA2aBindings(resource)
36112
36188
  };
36113
36189
  });
36114
36190
 
36115
- // ../../node_modules/@uipath/tool-agent/dist/chunk-LDMMPF7X.js
36191
+ // ../../node_modules/@uipath/tool-agent/dist/chunk-6YYPJAXQ.js
36116
36192
  function compilePolicy(policy) {
36117
36193
  return {
36118
36194
  contentDirectory: policy.contentDirectory,
36195
+ fileExtensionsIncluded: new Set(policy.fileExtensionsIncluded.map((e) => e.toLowerCase())),
36196
+ filesIncluded: new Set(policy.filesIncluded),
36197
+ filesExcluded: new Set(policy.filesExcluded),
36119
36198
  ignoredFiles: new Set(policy.ignoredFiles),
36120
36199
  ignoredDirectories: new Set(policy.ignoredDirectories),
36200
+ directoriesExcluded: new Set(policy.directoriesExcluded),
36121
36201
  fileNameMappings: policy.fileNameMappings
36122
36202
  };
36123
36203
  }
36124
- async function copyDirectoryRecursively(fileSystem, sourceDir, targetDir, policy) {
36204
+ async function isVenvDirectory(fileSystem, dirPath) {
36205
+ const [posix, windows] = await Promise.all([
36206
+ fileSystem.exists(Path.join(dirPath, "bin", "activate")),
36207
+ fileSystem.exists(Path.join(dirPath, "Scripts", "activate"))
36208
+ ]);
36209
+ return posix || windows;
36210
+ }
36211
+ function fileExtension(name) {
36212
+ const dot = name.lastIndexOf(".");
36213
+ return dot <= 0 ? "" : name.slice(dot).toLowerCase();
36214
+ }
36215
+ function shouldIncludeFile(name, relPath, policy) {
36216
+ if (name.startsWith("."))
36217
+ return false;
36218
+ const included = policy.fileExtensionsIncluded.has(fileExtension(name)) || policy.filesIncluded.has(name) && relPath === name || policy.filesIncluded.has(relPath);
36219
+ const excluded = policy.ignoredFiles.has(name) || policy.filesExcluded.has(name) && relPath === name || policy.filesExcluded.has(relPath);
36220
+ return included && !excluded;
36221
+ }
36222
+ async function shouldSkipDirectory(fileSystem, name, relPath, sourcePath, policy) {
36223
+ if (name.startsWith("."))
36224
+ return true;
36225
+ if (policy.ignoredDirectories.has(name))
36226
+ return true;
36227
+ if (policy.directoriesExcluded.has(name) && relPath === name || policy.directoriesExcluded.has(relPath)) {
36228
+ return true;
36229
+ }
36230
+ return isVenvDirectory(fileSystem, sourcePath);
36231
+ }
36232
+ async function copyDirectoryRecursively(fileSystem, sourceDir, targetDir, relDir, policy) {
36125
36233
  await fileSystem.mkdir(targetDir);
36126
36234
  const entries = await fileSystem.readdir(sourceDir);
36127
36235
  for (const entry of entries) {
36128
36236
  const sourcePath = Path.join(sourceDir, entry);
36237
+ const relPath = relDir ? `${relDir}/${entry}` : entry;
36129
36238
  const stat = await fileSystem.stat(sourcePath);
36130
36239
  if (stat?.isFile()) {
36131
- if (policy.ignoredFiles.has(entry))
36240
+ if (!shouldIncludeFile(entry, relPath, policy))
36132
36241
  continue;
36133
36242
  const targetFileName = policy.fileNameMappings[entry] ?? entry;
36134
36243
  const content = await fileSystem.readFile(sourcePath);
@@ -36136,15 +36245,32 @@ async function copyDirectoryRecursively(fileSystem, sourceDir, targetDir, policy
36136
36245
  await fileSystem.writeFile(Path.join(targetDir, targetFileName), content);
36137
36246
  }
36138
36247
  } else if (stat?.isDirectory()) {
36139
- if (policy.ignoredDirectories.has(entry))
36248
+ if (await shouldSkipDirectory(fileSystem, entry, relPath, sourcePath, policy))
36140
36249
  continue;
36141
- await copyDirectoryRecursively(fileSystem, sourcePath, Path.join(targetDir, entry), policy);
36250
+ await copyDirectoryRecursively(fileSystem, sourcePath, Path.join(targetDir, entry), relPath, policy);
36142
36251
  }
36143
36252
  }
36144
36253
  }
36145
36254
  async function copyCodeFiles(fileSystem, sourcePath, outputPath, policy = DEFAULT_CODE_COPY_POLICY) {
36146
36255
  const compiledPolicy = compilePolicy(policy);
36147
- await copyDirectoryRecursively(fileSystem, sourcePath, Path.join(outputPath, compiledPolicy.contentDirectory), compiledPolicy);
36256
+ await copyDirectoryRecursively(fileSystem, sourcePath, Path.join(outputPath, compiledPolicy.contentDirectory), "", compiledPolicy);
36257
+ }
36258
+ function buildCopyPolicy(packOptions) {
36259
+ if (!packOptions)
36260
+ return DEFAULT_CODE_COPY_POLICY;
36261
+ return {
36262
+ ...DEFAULT_CODE_COPY_POLICY,
36263
+ fileExtensionsIncluded: [
36264
+ ...DEFAULT_CODE_COPY_POLICY.fileExtensionsIncluded,
36265
+ ...packOptions.fileExtensionsIncluded ?? []
36266
+ ],
36267
+ filesIncluded: [...DEFAULT_CODE_COPY_POLICY.filesIncluded, ...packOptions.filesIncluded ?? []],
36268
+ filesExcluded: [...DEFAULT_CODE_COPY_POLICY.filesExcluded, ...packOptions.filesExcluded ?? []],
36269
+ directoriesExcluded: [
36270
+ ...DEFAULT_CODE_COPY_POLICY.directoriesExcluded,
36271
+ ...packOptions.directoriesExcluded ?? []
36272
+ ]
36273
+ };
36148
36274
  }
36149
36275
  async function detectProjectKind(fileSystem, projectPath) {
36150
36276
  const pythonDependenciesPath = Path.join(projectPath, CodedProjectConstants.PythonDependenciesFileName);
@@ -36182,26 +36308,23 @@ function mapToolErrorToResult(error79) {
36182
36308
  const message = error79 instanceof Error ? error79.message : String(error79);
36183
36309
  return ToolResult.error(ToolErrorCodes.InternalError, message);
36184
36310
  }
36185
- var entryPointSchema, entryPointsFileSchema, codedConfigSchema, DEFAULT_CODE_COPY_POLICY, PackageBuilder = class {
36311
+ var entryPointSchema, entryPointsFileSchema, packOptionsSchema, codedConfigSchema, DEFAULT_CODE_COPY_POLICY, PackageBuilder = class {
36186
36312
  constructor(fileSystem, logger) {
36187
36313
  this.fileSystem = fileSystem;
36188
36314
  this.logger = logger;
36189
36315
  }
36190
- async buildAgentsPackage(projectPath, outputPath, projectStorageId) {
36316
+ async buildAgentsPackage(projectPath, outputPath, options = {}) {
36191
36317
  this.logger.progress("Reading agent data...");
36192
- const [agentData, projectConfig] = await Promise.all([
36193
- readAgentsProjectData(this.fileSystem, this.logger, projectPath),
36194
- readOptionalJsonFile(this.fileSystem, Path.join(projectPath, FileConstants.ProjectConfigFileName))
36195
- ]);
36318
+ const agentData = await readAgentsProjectData(this.fileSystem, this.logger, projectPath);
36196
36319
  this.logger.progress("Generating package artifacts...");
36197
36320
  const out = (file3) => Path.join(outputPath, file3);
36198
- const agentOutput = buildAgentUnifiedModel(agentData.agent, agentData.resources, agentData.features, { projectStorageId, projectName: projectConfig?.name });
36321
+ const agentUnifiedModel = buildAgentUnifiedModel(agentData.agent, agentData.resources, agentData.features, { projectStorageId: options.projectStorageId, projectName: options.projectName });
36199
36322
  await Promise.all([
36200
- writeJsonFile(this.fileSystem, out(PackageDescriptorConstants.AgentFilePath), agentOutput),
36323
+ writeJsonFile(this.fileSystem, out(PackageDescriptorConstants.AgentFilePath), agentUnifiedModel),
36201
36324
  agentData.flowLayout ? writeJsonFile(this.fileSystem, out(PackageDescriptorConstants.FlowLayoutFilePath), agentData.flowLayout) : Promise.resolve(),
36202
36325
  writeJsonFile(this.fileSystem, out(PackageDescriptorConstants.BindingsFilePath), generateBindings(agentData.agent, agentData.resources, agentData.features)),
36203
36326
  writeJsonFile(this.fileSystem, out(PackageDescriptorConstants.EntryPointsFilePath), createEntryPointsAgent(agentData.agent)),
36204
- writeJsonFile(this.fileSystem, out(PackageDescriptorConstants.OperateFilePath), createOperateAgent(agentData.agent, agentData.resources, projectStorageId)),
36327
+ writeJsonFile(this.fileSystem, out(PackageDescriptorConstants.OperateFilePath), createOperateAgent(agentData.agent, agentData.resources, options.projectStorageId)),
36205
36328
  writeJsonFile(this.fileSystem, out(PackageDescriptorConstants.PackageDescriptorFilePath), createPackageDescriptorAgent(Boolean(agentData.flowLayout)))
36206
36329
  ]);
36207
36330
  }
@@ -36215,16 +36338,17 @@ var entryPointSchema, entryPointsFileSchema, codedConfigSchema, DEFAULT_CODE_COP
36215
36338
  }
36216
36339
  this.logger.progress("Generating package artifacts...");
36217
36340
  const out = (file3) => Path.join(outputPath, file3);
36341
+ const copyPolicy = buildCopyPolicy(codedConfig.packOptions);
36218
36342
  await Promise.all([
36219
- copyCodeFiles(this.fileSystem, projectPath, outputPath),
36343
+ copyCodeFiles(this.fileSystem, projectPath, outputPath, copyPolicy),
36220
36344
  writeJsonFile(this.fileSystem, out(PackageDescriptorConstants.OperateFilePath), createOperatePython(projectStorageId, codedConfig, firstEntryPoint)),
36221
36345
  writeJsonFile(this.fileSystem, out(PackageDescriptorConstants.PackageDescriptorFilePath), createPackageDescriptorPython())
36222
36346
  ]);
36223
36347
  }
36224
36348
  }, AgentToolError, AgentBuildError, AgentPackError, AgentTool;
36225
- var init_chunk_LDMMPF7X = __esm(() => {
36226
- init_chunk_7ZQB234J();
36227
- init_chunk_RQQ7Q4C6();
36349
+ var init_chunk_6YYPJAXQ = __esm(() => {
36350
+ init_chunk_4JNYQN2C();
36351
+ init_chunk_XB3E4BGG();
36228
36352
  init_dist();
36229
36353
  init_dist();
36230
36354
  init_v42();
@@ -36241,18 +36365,29 @@ var init_chunk_LDMMPF7X = __esm(() => {
36241
36365
  entryPointsFileSchema = exports_external2.object({
36242
36366
  entryPoints: exports_external2.array(entryPointSchema)
36243
36367
  });
36368
+ packOptionsSchema = exports_external2.object({
36369
+ fileExtensionsIncluded: exports_external2.array(exports_external2.string()).optional(),
36370
+ filesIncluded: exports_external2.array(exports_external2.string()).optional(),
36371
+ filesExcluded: exports_external2.array(exports_external2.string()).optional(),
36372
+ directoriesExcluded: exports_external2.array(exports_external2.string()).optional()
36373
+ }).loose();
36244
36374
  codedConfigSchema = exports_external2.object({
36245
36375
  runtimeOptions: exports_external2.object({
36246
36376
  isConversational: exports_external2.boolean().optional()
36247
- }).optional()
36377
+ }).optional(),
36378
+ packOptions: packOptionsSchema.optional()
36248
36379
  }).loose();
36249
36380
  DEFAULT_CODE_COPY_POLICY = {
36250
36381
  contentDirectory: PackageConstants.ContentDirectory,
36382
+ fileExtensionsIncluded: [".py", ".mermaid", ".json", ".yaml", ".yml", ".md"],
36383
+ filesIncluded: ["pyproject.toml", "uv.lock"],
36384
+ filesExcluded: [],
36251
36385
  ignoredFiles: [FileConstants.AgentFileName, FileConstants.ProjectConfigFileName],
36252
36386
  ignoredDirectories: [
36253
36387
  CodedProjectConstants.EvalsDirectoryName,
36254
36388
  CodedProjectConstants.LegacyEvalsDirectoryName
36255
36389
  ],
36390
+ directoriesExcluded: [],
36256
36391
  fileNameMappings: {
36257
36392
  [PackageConstants.BindingsFileName]: PackageConstants.BindingsV2FileName
36258
36393
  }
@@ -36294,7 +36429,11 @@ var init_chunk_LDMMPF7X = __esm(() => {
36294
36429
  if (projectKind === "coded") {
36295
36430
  await this._packageBuilder.buildCodedPackage(options.projectPath, localBuildFolder, options.projectStorageId);
36296
36431
  } else {
36297
- await this._packageBuilder.buildAgentsPackage(options.projectPath, localBuildFolder, options.projectStorageId);
36432
+ const uiProject = await this.getUiProjectAsync(options.projectPath);
36433
+ await this._packageBuilder.buildAgentsPackage(options.projectPath, localBuildFolder, {
36434
+ projectStorageId: options.projectStorageId,
36435
+ projectName: uiProject?.Name
36436
+ });
36298
36437
  }
36299
36438
  this.logger.info(`buildAsync finished: outputPath=${localBuildFolder}`);
36300
36439
  this.logger.progress("Build completed successfully");
@@ -36345,21 +36484,21 @@ var init_chunk_LDMMPF7X = __esm(() => {
36345
36484
  };
36346
36485
  });
36347
36486
 
36348
- // ../../node_modules/@uipath/tool-agent/dist/agent-tool-DLZZJOCT.js
36349
- var exports_agent_tool_DLZZJOCT = {};
36350
- __export(exports_agent_tool_DLZZJOCT, {
36487
+ // ../../node_modules/@uipath/tool-agent/dist/agent-tool-A6X34LFA.js
36488
+ var exports_agent_tool_A6X34LFA = {};
36489
+ __export(exports_agent_tool_A6X34LFA, {
36351
36490
  AgentTool: () => AgentTool
36352
36491
  });
36353
- var init_agent_tool_DLZZJOCT = __esm(() => {
36354
- init_chunk_LDMMPF7X();
36355
- init_chunk_7ZQB234J();
36356
- init_chunk_RQQ7Q4C6();
36492
+ var init_agent_tool_A6X34LFA = __esm(() => {
36493
+ init_chunk_6YYPJAXQ();
36494
+ init_chunk_4JNYQN2C();
36495
+ init_chunk_XB3E4BGG();
36357
36496
  });
36358
36497
 
36359
36498
  // ../../node_modules/@uipath/tool-agent/dist/index.js
36360
- init_chunk_LDMMPF7X();
36361
- init_chunk_7ZQB234J();
36362
- init_chunk_RQQ7Q4C6();
36499
+ init_chunk_6YYPJAXQ();
36500
+ init_chunk_4JNYQN2C();
36501
+ init_chunk_XB3E4BGG();
36363
36502
  init_dist();
36364
36503
  init_dist();
36365
36504
  var AgentToolFactory = class {
@@ -36367,7 +36506,7 @@ var AgentToolFactory = class {
36367
36506
  this.supportedTypes = [ProjectTypes.Agent];
36368
36507
  }
36369
36508
  async createAsync(logger, fileSystem) {
36370
- const { AgentTool: AgentTool2 } = await Promise.resolve().then(() => (init_agent_tool_DLZZJOCT(), exports_agent_tool_DLZZJOCT));
36509
+ const { AgentTool: AgentTool2 } = await Promise.resolve().then(() => (init_agent_tool_A6X34LFA(), exports_agent_tool_A6X34LFA));
36371
36510
  return new AgentTool2(fileSystem, logger);
36372
36511
  }
36373
36512
  };