@uipath/rpa-tool 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/tool.js +216 -9
  2. package/package.json +5 -5
package/dist/tool.js CHANGED
@@ -26969,6 +26969,7 @@ __export(exports_dist2, {
26969
26969
  refreshAccessToken: () => refreshAccessToken,
26970
26970
  readAuthFromEnv: () => readAuthFromEnv,
26971
26971
  populateTelemetryAuthContext: () => populateTelemetryAuthContext,
26972
+ parseJWT: () => parseJWT,
26972
26973
  logoutWithDeps: () => logoutWithDeps,
26973
26974
  logout: () => logout,
26974
26975
  loadConfigAsync: () => loadConfigAsync,
@@ -43293,7 +43294,37 @@ Please ensure your config file contains valid JSON.`;
43293
43294
  tenantId,
43294
43295
  expiration
43295
43296
  };
43296
- }, DEFAULT_TIMEOUT_MS2 = 1000, CLOSE_TIMEOUT_MS = 500, NOTICE_SENTINEL, withTimeout = (promise2, timeoutMs) => new Promise((resolve22, reject) => {
43297
+ }, DEFAULT_TIMEOUT_MS2 = 1000, CLOSE_TIMEOUT_MS = 500, NOTICE_SENTINEL, snapshotActiveHandles = () => {
43298
+ const getActiveHandles = process._getActiveHandles;
43299
+ if (typeof getActiveHandles !== "function")
43300
+ return new Set;
43301
+ const [, handles] = catchError2(() => getActiveHandles.call(process));
43302
+ return new Set(Array.isArray(handles) ? handles : []);
43303
+ }, forciblyDisposeLingeringRobotPipes = (handlesBefore) => {
43304
+ const getActiveHandles = process._getActiveHandles;
43305
+ if (typeof getActiveHandles !== "function")
43306
+ return;
43307
+ const [error48, handles] = catchError2(() => getActiveHandles.call(process));
43308
+ if (error48 || !Array.isArray(handles))
43309
+ return;
43310
+ for (const handle of handles) {
43311
+ if (handlesBefore.has(handle))
43312
+ continue;
43313
+ const isPipeSocket = handle?._handle?.constructor?.name === "Pipe";
43314
+ if (!isPipeSocket)
43315
+ continue;
43316
+ catchError2(() => {
43317
+ const h = handle;
43318
+ if (typeof h.destroy === "function") {
43319
+ h.destroy();
43320
+ } else if (typeof h.close === "function") {
43321
+ h.close();
43322
+ } else if (typeof h.unref === "function") {
43323
+ h.unref();
43324
+ }
43325
+ });
43326
+ }
43327
+ }, withTimeout = (promise2, timeoutMs) => new Promise((resolve22, reject) => {
43297
43328
  const timer = setTimeout(() => reject(new Error(`Robot IPC call timed out after ${timeoutMs}ms`)), timeoutMs);
43298
43329
  promise2.then((value) => {
43299
43330
  clearTimeout(timer);
@@ -43341,6 +43372,7 @@ Please ensure your config file contains valid JSON.`;
43341
43372
  const mod22 = await loadModule();
43342
43373
  if (!mod22)
43343
43374
  return;
43375
+ const handlesBeforeProxy = snapshotActiveHandles();
43344
43376
  const [ctorError, proxy] = catchError2(() => new mod22.RobotProxyConstructor);
43345
43377
  if (ctorError || !proxy) {
43346
43378
  logger2.debug(`Failed to construct RobotAgentProxy: ${String(ctorError)}`);
@@ -43392,6 +43424,7 @@ Please ensure your config file contains valid JSON.`;
43392
43424
  return;
43393
43425
  } finally {
43394
43426
  await catchError2(() => withTimeout(proxy.CloseAsync(), CLOSE_TIMEOUT_MS));
43427
+ forciblyDisposeLingeringRobotPipes(handlesBeforeProxy);
43395
43428
  }
43396
43429
  }, AuthTelemetryEvents, refreshAccessToken = async ({
43397
43430
  refreshToken,
@@ -43925,10 +43958,13 @@ Available tenants: ${availableTenants}`);
43925
43958
  const orgId = tokenData.prtId || tokenData.organizationId || tokenData.prt_id;
43926
43959
  if (typeof orgId === "string") {
43927
43960
  logger2.info(`✓ Organization ID: ${orgId}`);
43961
+ credentials.UIPATH_ORGANIZATION_ID = orgId;
43962
+ if (organization) {
43963
+ credentials.UIPATH_ORGANIZATION_NAME = organization;
43964
+ }
43928
43965
  try {
43929
43966
  const [tenantName, tenantId, orgName] = await tenantSelector(config2.baseUrl, tokens.UIPATH_ACCESS_TOKEN, orgId, tenant, interactive);
43930
43967
  credentials.UIPATH_ORGANIZATION_NAME = orgName;
43931
- credentials.UIPATH_ORGANIZATION_ID = orgId;
43932
43968
  credentials.UIPATH_TENANT_NAME = tenantName;
43933
43969
  credentials.UIPATH_TENANT_ID = tenantId;
43934
43970
  telemetry2.trackEvent(AuthTelemetryEvents.TenantSelected, {
@@ -43939,13 +43975,18 @@ Available tenants: ${availableTenants}`);
43939
43975
  logger2.error("Continuing without tenant selection. You can set UIPATH_TENANT_ID manually if needed.");
43940
43976
  credentials.UIPATH_TENANT_NAME = undefined;
43941
43977
  credentials.UIPATH_TENANT_ID = undefined;
43978
+ if (!organization) {
43979
+ credentials.UIPATH_ORGANIZATION_NAME = undefined;
43980
+ }
43942
43981
  telemetry2.trackEvent(AuthTelemetryEvents.TenantSelected, {
43943
43982
  success: "false",
43944
43983
  errorMessage: error48 instanceof Error ? error48.message : String(error48)
43945
43984
  });
43946
43985
  }
43947
43986
  }
43948
- } catch {}
43987
+ } catch (parseError) {
43988
+ logger2.warn(`Could not extract organization from token: ${parseError instanceof Error ? parseError.message : String(parseError)}`);
43989
+ }
43949
43990
  const fs72 = getFs2();
43950
43991
  let savePath = envFilePath ?? DEFAULT_ENV_FILENAME;
43951
43992
  let savedLocally = false;
@@ -69770,6 +69811,7 @@ You can specify the URL via:
69770
69811
  "LLMOps",
69771
69812
  "OMS",
69772
69813
  "RCS.FolderAuthorization",
69814
+ "RCS.TagsManagement",
69773
69815
  "TM.Projects",
69774
69816
  "TM.TestCases",
69775
69817
  "TM.Requirements",
@@ -70076,7 +70118,7 @@ var {
70076
70118
  // package.json
70077
70119
  var package_default = {
70078
70120
  name: "@uipath/rpa-tool",
70079
- version: "0.9.0",
70121
+ version: "0.9.1",
70080
70122
  description: "Tool for creating and managing UiPath RPA projects",
70081
70123
  keywords: [
70082
70124
  "uipcli-tool",
@@ -70122,11 +70164,11 @@ var package_default = {
70122
70164
  "@biomejs/biome": "^2.4.12",
70123
70165
  "@types/bun": "^1.3.12",
70124
70166
  "@types/node": "^25.6.0",
70125
- "@uipath/auth": "^1.0.0-alpha.20260424.4963",
70126
- "@uipath/common": "^1.0.0-alpha.20260424.4963",
70167
+ "@uipath/auth": "1.0.0-alpha.20260428.5427",
70168
+ "@uipath/common": "1.0.0-alpha.20260428.5402",
70127
70169
  "@uipath/coreipc": "^2.5.1-20260324-07",
70128
- "@uipath/project-packager": "^1.1.15-alpha.20260424.4963",
70129
- "@uipath/solutionpackager-tool-core": "^0.0.33-alpha.20260424.4963",
70170
+ "@uipath/project-packager": "1.1.15-alpha.20260428.5402",
70171
+ "@uipath/solutionpackager-tool-core": "0.0.33-alpha.20260428.5402",
70130
70172
  "@uipath/tool-workflowcompiler": "^0.0.14",
70131
70173
  "camelcase-keys": "^10.0.2",
70132
70174
  commander: "^14.0.3",
@@ -70945,7 +70987,7 @@ class WorkflowCompilerToolFactory {
70945
70987
  toolsFactoryRepository.registerProjectToolFactory(new WorkflowCompilerToolFactory);
70946
70988
 
70947
70989
  // src/resolution/helm-config.ts
70948
- var DEFAULT_HELM_VERSION = "0.9.0";
70990
+ var DEFAULT_HELM_VERSION = "0.9.1";
70949
70991
  var helmConfig = {
70950
70992
  helmVersion: DEFAULT_HELM_VERSION
70951
70993
  };
@@ -70984,6 +71026,23 @@ async function disposeIpcConnections() {
70984
71026
  }
70985
71027
 
70986
71028
  // src/studio_interop/proxies.ts
71029
+ class AnalyzerRulesServiceProxy {
71030
+ GetRules(scope) {
71031
+ throw null;
71032
+ }
71033
+ }
71034
+ __legacyDecorateClassTS([
71035
+ import_coreipc2.ipc.$operation
71036
+ ], AnalyzerRulesServiceProxy.prototype, "GetRules", null);
71037
+ AnalyzerRulesServiceProxy = __legacyDecorateClassTS([
71038
+ import_coreipc2.ipc.$service({ endpoint: "IAnalyzerRulesService" })
71039
+ ], AnalyzerRulesServiceProxy);
71040
+ function adaptAnalyzerRulesServiceProxy(proxy) {
71041
+ return {
71042
+ getRules: (scope) => proxy.GetRules(scope)
71043
+ };
71044
+ }
71045
+
70987
71046
  class AuthenticationServiceProxy {
70988
71047
  GetAccessToken() {
70989
71048
  throw null;
@@ -71453,6 +71512,7 @@ function adaptTestingServiceProxy(proxy) {
71453
71512
  }
71454
71513
 
71455
71514
  class StudioServices {
71515
+ analyzerRules;
71456
71516
  authentication;
71457
71517
  activity;
71458
71518
  diff;
@@ -71468,6 +71528,7 @@ class StudioServices {
71468
71528
  constructor(pipeName) {
71469
71529
  trackPipe(pipeName);
71470
71530
  const addr = import_coreipc2.ipc.namedPipe(pipeName);
71531
+ this.analyzerRules = adaptAnalyzerRulesServiceProxy(import_coreipc2.ipc.proxy.withAddress(addr).withService(AnalyzerRulesServiceProxy));
71471
71532
  this.authentication = adaptAuthenticationServiceProxy(import_coreipc2.ipc.proxy.withAddress(addr).withService(AuthenticationServiceProxy));
71472
71533
  this.activity = adaptAutopilotActivityServiceProxy(import_coreipc2.ipc.proxy.withAddress(addr).withService(AutopilotActivityServiceProxy));
71473
71534
  this.diff = adaptAutopilotDiffServiceProxy(import_coreipc2.ipc.proxy.withAddress(addr).withService(AutopilotDiffServiceProxy));
@@ -71725,6 +71786,23 @@ var HELM_INTEROP_MANIFEST = "helm-interop-manifest.json";
71725
71786
  // src/resolution/helm-nuget-resolver.ts
71726
71787
  var RESTORE_HEARTBEAT_INTERVAL_MS = 15000;
71727
71788
  var HELM_PACKAGE_PREFIX = "UiPath.Studio.Helm";
71789
+ var UIPATH_OFFICIAL_FEED_URL = "https://pkgs.dev.azure.com/uipath/Public.Feeds/_packaging/UiPath-Official/nuget/v3/index.json";
71790
+ var UIPATH_INTERNAL_FEED_URL = "https://uipath.pkgs.visualstudio.com/Public.Feeds/_packaging/UiPath-Internal/nuget/v3/index.json";
71791
+ function isPrereleaseVersion(version) {
71792
+ return version.includes("-");
71793
+ }
71794
+ function buildHelmNuGetConfigXml(version) {
71795
+ const prerelease = isPrereleaseVersion(version);
71796
+ const feedKey = prerelease ? "UiPath-Internal" : "UiPath-Official";
71797
+ const feedUrl = prerelease ? UIPATH_INTERNAL_FEED_URL : UIPATH_OFFICIAL_FEED_URL;
71798
+ return `<?xml version="1.0" encoding="utf-8"?>
71799
+ <configuration>
71800
+ <packageSources>
71801
+ <add key="${feedKey}" value="${feedUrl}" />
71802
+ </packageSources>
71803
+ </configuration>
71804
+ `;
71805
+ }
71728
71806
  function getHelmPackageSuffix() {
71729
71807
  switch (process.platform) {
71730
71808
  case "win32":
@@ -71806,6 +71884,8 @@ async function restoreHelmPackage(packageId, version, deps, nugetSource) {
71806
71884
  </Project>`;
71807
71885
  const projectPath = join4(tempDir, "HelmRestore.csproj");
71808
71886
  writeFileSync(projectPath, projectContent, "utf-8");
71887
+ const nugetConfigPath = join4(tempDir, "nuget.config");
71888
+ writeFileSync(nugetConfigPath, buildHelmNuGetConfigXml(version), "utf-8");
71809
71889
  const args = ["restore", projectPath, "--verbosity", "quiet"];
71810
71890
  if (nugetSource) {
71811
71891
  args.push("--source", nugetSource);
@@ -72295,6 +72375,7 @@ var ToolName = {
72295
72375
  Diff: "diff",
72296
72376
  FindActivities: "find-activities",
72297
72377
  FocusActivity: "focus-activity",
72378
+ GetAnalyzerRules: "get-analyzer-rules",
72298
72379
  GetDefaultActivityXaml: "get-default-activity-xaml",
72299
72380
  GetErrors: "get-errors",
72300
72381
  GetManualTestCases: "get-manual-test-cases",
@@ -72886,6 +72967,7 @@ class HelmAuthContextProvider {
72886
72967
  // src/studio_interop/interop-manifest.json
72887
72968
  var interop_manifest_default = {
72888
72969
  endpoints: {
72970
+ IAnalyzerRulesService: ["getRules"],
72889
72971
  IAuthenticationService: [
72890
72972
  "getAccessToken",
72891
72973
  "getEnvironment",
@@ -74281,6 +74363,130 @@ function focusActivityTool(session) {
74281
74363
  });
74282
74364
  }
74283
74365
 
74366
+ // src/tools/local/get-analyzer-rules.ts
74367
+ var SCOPES = ["Activity", "Workflow", "Project", "Coded Workflow"];
74368
+ function parseRule(json3) {
74369
+ try {
74370
+ const raw = JSON.parse(json3);
74371
+ if (!raw?.id || !raw?.scope) {
74372
+ return null;
74373
+ }
74374
+ return {
74375
+ id: raw.id,
74376
+ description: raw.description ?? "",
74377
+ scope: raw.scope,
74378
+ recommendation: raw.recommendation,
74379
+ errorLevel: raw.errorLevel ?? "info",
74380
+ documentationLink: raw.documentationLink,
74381
+ parameters: Array.isArray(raw.parameters) ? raw.parameters.filter((p) => typeof p?.key === "string").map((p) => ({
74382
+ key: p.key,
74383
+ value: p.value
74384
+ })) : []
74385
+ };
74386
+ } catch {
74387
+ return null;
74388
+ }
74389
+ }
74390
+ function formatRule(rule) {
74391
+ const header = `[${rule.errorLevel}] ${rule.id} (${rule.scope}) - ${rule.description}`;
74392
+ const lines = [header];
74393
+ if (rule.recommendation) {
74394
+ lines.push(` recommendation: ${rule.recommendation}`);
74395
+ }
74396
+ if (rule.parameters.length > 0) {
74397
+ const params = rule.parameters.map((p) => `${p.key}=${p.value ?? ""}`).join(", ");
74398
+ lines.push(` parameters: ${params}`);
74399
+ }
74400
+ if (rule.documentationLink) {
74401
+ lines.push(` docs: ${rule.documentationLink}`);
74402
+ }
74403
+ return lines.join(`
74404
+ `);
74405
+ }
74406
+ function formatRules(rules, unparseableCount) {
74407
+ if (rules.length === 0 && unparseableCount === 0) {
74408
+ return "No analyzer rules found.";
74409
+ }
74410
+ const byScope = new Map;
74411
+ for (const rule of rules) {
74412
+ const list = byScope.get(rule.scope) ?? [];
74413
+ list.push(rule);
74414
+ byScope.set(rule.scope, list);
74415
+ }
74416
+ const parts = [`Found ${rules.length} enabled rule(s):`];
74417
+ for (const scope of SCOPES) {
74418
+ const list = byScope.get(scope);
74419
+ if (!list || list.length === 0)
74420
+ continue;
74421
+ parts.push("", `# ${scope}`);
74422
+ for (const rule of list) {
74423
+ parts.push(formatRule(rule));
74424
+ }
74425
+ }
74426
+ for (const [scope, list] of byScope) {
74427
+ if (SCOPES.includes(scope))
74428
+ continue;
74429
+ parts.push("", `# ${scope}`);
74430
+ for (const rule of list) {
74431
+ parts.push(formatRule(rule));
74432
+ }
74433
+ }
74434
+ if (unparseableCount > 0) {
74435
+ parts.push("", `(${unparseableCount} rule(s) could not be parsed)`);
74436
+ }
74437
+ return parts.join(`
74438
+ `);
74439
+ }
74440
+ function getAnalyzerRulesTool(session) {
74441
+ return createToolHandler(session, {
74442
+ name: ToolName.GetAnalyzerRules,
74443
+ title: "Get Analyzer Rules",
74444
+ description: "Lists the enabled workflow analyzer rules for the currently open project. " + "Each rule describes a constraint your generated XAML or coded-workflow output must comply with — " + "id, severity, scope, description, recommendation, configured parameter values, and docs link. " + "Call this BEFORE generating or editing workflows/code so the output respects project rules. " + "Use the optional `scope` argument to narrow results: " + "'Activity' for single-activity generation, 'Workflow' for full-workflow authoring, " + "'Project' for project-level constraints, 'Coded Workflow' for coded-automation Roslyn analyzers. " + "Disabled rules are filtered out server-side.",
74445
+ requiresProject: true,
74446
+ inputSchema: {
74447
+ type: "object",
74448
+ properties: {
74449
+ scope: {
74450
+ type: "string",
74451
+ enum: [...SCOPES],
74452
+ description: "Optional scope filter. When omitted, rules from all scopes are returned."
74453
+ }
74454
+ }
74455
+ }
74456
+ }, async (session2, args, _projectDir) => {
74457
+ const scope = args.scope;
74458
+ try {
74459
+ const rawRules = await session2.execute((instance) => instance.services.analyzerRules.getRules(scope ?? null), { requiresProject: true, backend: "helm" /* Helm */ });
74460
+ const parsed = rawRules.map(parseRule);
74461
+ const rules = parsed.filter((r) => r !== null);
74462
+ const unparseableCount = parsed.length - rules.length;
74463
+ return {
74464
+ content: [
74465
+ {
74466
+ type: "text",
74467
+ text: formatRules(rules, unparseableCount)
74468
+ }
74469
+ ]
74470
+ };
74471
+ } catch (e) {
74472
+ const errorMessage2 = e instanceof Error ? e.message : String(e);
74473
+ console.error(`[get-analyzer-rules] error:`, errorMessage2);
74474
+ return {
74475
+ content: [
74476
+ {
74477
+ type: "text",
74478
+ text: JSON.stringify({
74479
+ success: false,
74480
+ errorMessage: errorMessage2
74481
+ })
74482
+ }
74483
+ ],
74484
+ isError: true
74485
+ };
74486
+ }
74487
+ });
74488
+ }
74489
+
74284
74490
  // src/tools/local/get-default-activity-xaml.ts
74285
74491
  function getDefaultActivityXamlTool(session) {
74286
74492
  return createToolHandler(session, {
@@ -75792,6 +75998,7 @@ function createAllLocalTools(session, cloudClient, hostStudioPid) {
75792
75998
  closeProjectTool(session),
75793
75999
  runFileTool(session),
75794
76000
  diffTool(session),
76001
+ getAnalyzerRulesTool(session),
75795
76002
  getErrorsTool(session),
75796
76003
  getManualTestCasesTool(session),
75797
76004
  getManualTestStepsTool(session),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/rpa-tool",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Tool for creating and managing UiPath RPA projects",
5
5
  "keywords": [
6
6
  "uipcli-tool",
@@ -46,11 +46,11 @@
46
46
  "@biomejs/biome": "^2.4.12",
47
47
  "@types/bun": "^1.3.12",
48
48
  "@types/node": "^25.6.0",
49
- "@uipath/auth": "^1.0.0-alpha.20260424.4963",
50
- "@uipath/common": "^1.0.0-alpha.20260424.4963",
49
+ "@uipath/auth": "1.0.0-alpha.20260428.5427",
50
+ "@uipath/common": "1.0.0-alpha.20260428.5402",
51
51
  "@uipath/coreipc": "^2.5.1-20260324-07",
52
- "@uipath/project-packager": "^1.1.15-alpha.20260424.4963",
53
- "@uipath/solutionpackager-tool-core": "^0.0.33-alpha.20260424.4963",
52
+ "@uipath/project-packager": "1.1.15-alpha.20260428.5402",
53
+ "@uipath/solutionpackager-tool-core": "0.0.33-alpha.20260428.5402",
54
54
  "@uipath/tool-workflowcompiler": "^0.0.14",
55
55
  "camelcase-keys": "^10.0.2",
56
56
  "commander": "^14.0.3",