powerautomate-mcp 0.7.1 → 0.7.2

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/index.js CHANGED
@@ -1006,6 +1006,11 @@ async function createWamAuthProvider(config, silentOnly = false) {
1006
1006
  "No cached credentials available. Run 'powerautomate-mcp --setup' first to authenticate."
1007
1007
  );
1008
1008
  }
1009
+ if (currentAccount) {
1010
+ throw new AuthenticationError(
1011
+ `Silent token acquisition failed for scopes: ${mutableScopes.join(", ")}. Resource may not be registered in the app registration. Re-run --setup to update permissions.`
1012
+ );
1013
+ }
1009
1014
  try {
1010
1015
  const result = await pca.acquireTokenInteractive({
1011
1016
  scopes: mutableScopes,
@@ -14800,6 +14805,11 @@ async function createDeviceCodeAuthProvider(config, silentOnly = false) {
14800
14805
  "No cached credentials available. Run 'powerautomate-mcp --setup' first to authenticate."
14801
14806
  );
14802
14807
  }
14808
+ if (currentAccount) {
14809
+ throw new AuthenticationError(
14810
+ `Silent token acquisition failed for scopes: ${mutableScopes.join(", ")}. Resource may not be registered in the app registration. Re-run --setup to update permissions.`
14811
+ );
14812
+ }
14803
14813
  try {
14804
14814
  logger.info("Starting device code authentication flow");
14805
14815
  const deviceCodeRequest = {
@@ -14946,6 +14956,15 @@ var REQUIRED_RESOURCE_ACCESS = [
14946
14956
  resourceAccess: [
14947
14957
  { id: "78ce3f0f-a1ce-49c2-8cde-64b5c0896db4", type: "Scope" }
14948
14958
  ]
14959
+ },
14960
+ {
14961
+ // Business Application Platform (BAP) API — required for environment
14962
+ // discovery and Power Platform admin operations
14963
+ resourceAppId: "0e0bf3cc-3078-4fd4-9ef3-cb6dc0245b10",
14964
+ resourceAccess: [
14965
+ { id: "4ae1bf56-f562-4747-b7bc-2fa0874ed46f", type: "Scope" }
14966
+ // user_impersonation
14967
+ ]
14949
14968
  }
14950
14969
  ];
14951
14970
  var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;