opencode-m365-copilot 0.3.2 → 0.3.4

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.
@@ -1,4 +1,4 @@
1
- import { _ as createLogger, b as AGENT_FILE, d as POWERPLATFORM_SCOPE, l as BAP_SCOPE, y as writePrivateFile } from "./server-Buz1ZIg5.mjs";
1
+ import { _ as createLogger, b as AGENT_FILE, d as POWERPLATFORM_SCOPE, l as BAP_SCOPE, y as writePrivateFile } from "./server-DQW-8ns2.mjs";
2
2
  import { createHash } from "node:crypto";
3
3
  import { readFileSync } from "node:fs";
4
4
  //#region src/agent.ts
@@ -126,7 +126,7 @@ async function getOrCreateAgent(deps) {
126
126
  async function discoverEnvironmentId(doFetch, getTokenForScope) {
127
127
  const token = await getTokenForScope([BAP_SCOPE]);
128
128
  const response = await doFetch(BAP_ENVIRONMENT_URL, { headers: { Authorization: `Bearer ${token}` } });
129
- if (!response.ok) throw new Error(await describeFailure("environment discovery", response));
129
+ if (!response.ok) throw new AgentHttpError(await describeFailure("environment discovery", response), response.status);
130
130
  const name = (await response.json())?.name ?? "";
131
131
  const guid = name.replace(/^Default-/i, "");
132
132
  if (!guid) throw new Error(`Power Platform returned an unexpected environment name: ${JSON.stringify(name)}`);
@@ -140,7 +140,7 @@ async function discoverEnvironmentId(doFetch, getTokenForScope) {
140
140
  */
141
141
  async function findBot(doFetch, host, token, name) {
142
142
  const response = await doFetch(`https://${host}/copilotstudio/minimalBots/api/botlist?api-version=${COPILOT_STUDIO_API_VERSION}`, { headers: { Authorization: `Bearer ${token}` } });
143
- if (!response.ok) throw new Error(await describeFailure("listing agents", response));
143
+ if (!response.ok) throw new AgentHttpError(await describeFailure("listing agents", response), response.status);
144
144
  const body = await response.json();
145
145
  const match = (body?.value ?? body?.bots ?? []).find((bot) => bot?.shortBotName === name || bot?.displayName === name);
146
146
  if (!match) return void 0;
@@ -167,7 +167,7 @@ async function createBot(doFetch, host, token, name) {
167
167
  }
168
168
  })
169
169
  });
170
- if (!response.ok) throw new Error(await describeFailure("creating the agent", response));
170
+ if (!response.ok) throw new AgentHttpError(await describeFailure("creating the agent", response), response.status);
171
171
  const body = await response.json();
172
172
  const botId = body?.botId ?? body?.id;
173
173
  if (!botId) throw new Error("Copilot Studio created an agent but returned no bot id");
@@ -182,12 +182,21 @@ async function publishBot(doFetch, host, token, botId) {
182
182
  },
183
183
  body: JSON.stringify({ botId })
184
184
  });
185
- if (!response.ok) throw new Error(await describeFailure("publishing the agent", response));
185
+ if (!response.ok) throw new AgentHttpError(await describeFailure("publishing the agent", response), response.status);
186
186
  const body = await response.json();
187
187
  const titleId = body?.titleId ?? body?.TitleId;
188
188
  if (!titleId) throw new Error("Copilot Studio published the agent but returned no title id");
189
189
  return titleId;
190
190
  }
191
+ /** A Copilot Studio / Power Platform call answered with a non-2xx status. */
192
+ var AgentHttpError = class extends Error {
193
+ status;
194
+ constructor(message, status) {
195
+ super(message);
196
+ this.status = status;
197
+ this.name = "AgentHttpError";
198
+ }
199
+ };
191
200
  async function describeFailure(what, response) {
192
201
  let detail = "";
193
202
  try {
package/dist/cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { C as SECRETS_FILE, M as LOCAL_TITLE_MODEL, S as CONFIG_DIR, T as PROVIDER_ID, a as startServer, b as AGENT_FILE, g as createTokenClient, j as DEFAULT_MODEL, k as mergeOpencodeConfig, x as CACHE_FILE } from "./server-Buz1ZIg5.mjs";
3
- import { t as getOrCreateAgent } from "./agent-C28PfLXM.mjs";
2
+ import { C as SECRETS_FILE, M as LOCAL_TITLE_MODEL, S as CONFIG_DIR, T as PROVIDER_ID, a as startServer, b as AGENT_FILE, g as createTokenClient, j as DEFAULT_MODEL, k as mergeOpencodeConfig, x as CACHE_FILE } from "./server-DQW-8ns2.mjs";
3
+ import { t as getOrCreateAgent } from "./agent-Cd7BGDdu.mjs";
4
4
  import { copyFileSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
5
5
  import { homedir } from "node:os";
6
6
  import { dirname, join, resolve } from "node:path";
@@ -46,7 +46,7 @@ to complete SSO/MFA by hand once — the only option on tenants with push-only
46
46
  MFA, FIDO2, or a federated IdP.`);
47
47
  }
48
48
  async function doLogin(args) {
49
- const { login } = await import("./login-Y2igNqfw.mjs");
49
+ const { login } = await import("./login-DTenVKcz.mjs");
50
50
  const interactive = args.includes("--interactive");
51
51
  try {
52
52
  const account = await login({
@@ -1,9 +1,9 @@
1
- import { F as __require, I as __toESM, P as __commonJSMin } from "./server-Buz1ZIg5.mjs";
1
+ import { F as __require, I as __toESM, P as __commonJSMin } from "./server-DQW-8ns2.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import http from "http";
4
4
  import crypto, { createHash as createHash$1 } from "crypto";
5
5
  //#region node_modules/@azure/msal-node/dist/cache/serializer/Serializer.mjs
6
- /*! @azure/msal-node v6.0.1 2026-09-15 */
6
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
7
7
  /**
8
8
  * This class serializes cache entities to be saved into in-memory object types defined internally
9
9
  * @internal
@@ -143,7 +143,7 @@ var Serializer = class {
143
143
  };
144
144
  //#endregion
145
145
  //#region node_modules/@azure/msal-common/dist/constants/AADServerParamKeys.mjs
146
- /*! @azure/msal-common v16.14.1 2026-09-15 */
146
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
147
147
  const CLIENT_ID = "client_id";
148
148
  const REDIRECT_URI = "redirect_uri";
149
149
  const RESPONSE_TYPE = "response_type";
@@ -190,7 +190,7 @@ const CLI_DATA = "clidata";
190
190
  const ATTRIBUTE_TOKENS = "attribute_tokens";
191
191
  //#endregion
192
192
  //#region node_modules/@azure/msal-common/dist/utils/Constants.mjs
193
- /*! @azure/msal-common v16.14.1 2026-09-15 */
193
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
194
194
  const SKU = "msal.js.common";
195
195
  const DEFAULT_AUTHORITY = "https://login.microsoftonline.com/common/";
196
196
  const DEFAULT_AUTHORITY_HOST = "login.microsoftonline.com";
@@ -393,7 +393,7 @@ const EncodingTypes = {
393
393
  };
394
394
  //#endregion
395
395
  //#region node_modules/@azure/msal-common/dist/error/AuthError.mjs
396
- /*! @azure/msal-common v16.14.1 2026-09-15 */
396
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
397
397
  function getDefaultErrorMessage(code) {
398
398
  return `See https://aka.ms/msal.js.errors#${code} for details`;
399
399
  }
@@ -418,7 +418,7 @@ function createAuthError(code, correlationId, additionalMessage) {
418
418
  }
419
419
  //#endregion
420
420
  //#region node_modules/@azure/msal-common/dist/error/ClientAuthError.mjs
421
- /*! @azure/msal-common v16.14.1 2026-09-15 */
421
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
422
422
  /**
423
423
  * ClientAuthErrorMessage class containing string constants used by error codes and messages.
424
424
  */
@@ -437,7 +437,7 @@ function createClientAuthError(errorCode, correlationId, additionalMessage) {
437
437
  }
438
438
  //#endregion
439
439
  //#region node_modules/@azure/msal-common/dist/error/ClientAuthErrorCodes.mjs
440
- /*! @azure/msal-common v16.14.1 2026-09-15 */
440
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
441
441
  const clientInfoDecodingError = "client_info_decoding_error";
442
442
  const clientInfoEmptyError = "client_info_empty_error";
443
443
  const tokenParsingError = "token_parsing_error";
@@ -468,7 +468,7 @@ const resourceParameterRequired = "resource_parameter_required";
468
468
  const misplacedResourceParam = "misplaced_resource_parameter";
469
469
  //#endregion
470
470
  //#region node_modules/@azure/msal-common/dist/account/ClientInfo.mjs
471
- /*! @azure/msal-common v16.14.1 2026-09-15 */
471
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
472
472
  /**
473
473
  * Function to build a client info object from server clientInfo string
474
474
  * @param rawClientInfo
@@ -497,7 +497,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
497
497
  }
498
498
  //#endregion
499
499
  //#region node_modules/@azure/msal-common/dist/account/AuthToken.mjs
500
- /*! @azure/msal-common v16.14.1 2026-09-15 */
500
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
501
501
  /**
502
502
  * Extract token by decoding the rawToken
503
503
  *
@@ -549,7 +549,7 @@ function getJWSPayload(authToken, correlationId) {
549
549
  }
550
550
  //#endregion
551
551
  //#region node_modules/@azure/msal-common/dist/account/AccountInfo.mjs
552
- /*! @azure/msal-common v16.14.1 2026-09-15 */
552
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
553
553
  /**
554
554
  * Returns true if tenantId matches the utid portion of homeAccountId
555
555
  * @param tenantId
@@ -626,7 +626,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
626
626
  }
627
627
  //#endregion
628
628
  //#region node_modules/@azure/msal-common/dist/authority/AuthorityType.mjs
629
- /*! @azure/msal-common v16.14.1 2026-09-15 */
629
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
630
630
  /**
631
631
  * Authority types supported by MSAL.
632
632
  */
@@ -637,7 +637,7 @@ const AuthorityType = {
637
637
  };
638
638
  //#endregion
639
639
  //#region node_modules/@azure/msal-common/dist/account/TokenClaims.mjs
640
- /*! @azure/msal-common v16.14.1 2026-09-15 */
640
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
641
641
  /**
642
642
  * Gets tenantId from available ID token claims to set as credential realm with the following precedence:
643
643
  * 1. tid - if the token is acquired from an Azure AD tenant tid will be present
@@ -653,7 +653,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
653
653
  }
654
654
  //#endregion
655
655
  //#region node_modules/@azure/msal-common/dist/authority/ProtocolMode.mjs
656
- /*! @azure/msal-common v16.14.1 2026-09-15 */
656
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
657
657
  /**
658
658
  * Protocol modes supported by MSAL.
659
659
  */
@@ -674,7 +674,7 @@ const ProtocolMode = {
674
674
  };
675
675
  //#endregion
676
676
  //#region node_modules/@azure/msal-common/dist/cache/utils/AccountEntityUtils.mjs
677
- /*! @azure/msal-common v16.14.1 2026-09-15 */
677
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
678
678
  /**
679
679
  * Returns the AccountInfo interface for this account.
680
680
  * @internal
@@ -771,11 +771,11 @@ function isAccountEntity(entity) {
771
771
  }
772
772
  //#endregion
773
773
  //#region node_modules/@azure/msal-common/dist/error/AuthErrorCodes.mjs
774
- /*! @azure/msal-common v16.14.1 2026-09-15 */
774
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
775
775
  const postRequestFailed = "post_request_failed";
776
776
  //#endregion
777
777
  //#region node_modules/@azure/msal-common/dist/error/ClientConfigurationError.mjs
778
- /*! @azure/msal-common v16.14.1 2026-09-15 */
778
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
779
779
  /**
780
780
  * Error thrown when there is an error in configuration of the MSAL.js library.
781
781
  */
@@ -791,7 +791,7 @@ function createClientConfigurationError(errorCode, correlationId) {
791
791
  }
792
792
  //#endregion
793
793
  //#region node_modules/@azure/msal-common/dist/error/ClientConfigurationErrorCodes.mjs
794
- /*! @azure/msal-common v16.14.1 2026-09-15 */
794
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
795
795
  const redirectUriEmpty = "redirect_uri_empty";
796
796
  const authorityUriInsecure = "authority_uri_insecure";
797
797
  const urlParseError = "url_parse_error";
@@ -813,13 +813,13 @@ const invalidDpopNonce = "invalid_dpop_nonce";
813
813
  const dpopMissingResourceContext = "dpop_missing_resource_context";
814
814
  //#endregion
815
815
  //#region node_modules/@azure/msal-common/dist/authority/OpenIdConfigResponse.mjs
816
- /*! @azure/msal-common v16.14.1 2026-09-15 */
816
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
817
817
  function isOpenIdConfigResponse(response) {
818
818
  return response.hasOwnProperty("authorization_endpoint") && response.hasOwnProperty("token_endpoint") && response.hasOwnProperty("issuer") && response.hasOwnProperty("jwks_uri");
819
819
  }
820
820
  //#endregion
821
821
  //#region node_modules/@azure/msal-common/dist/utils/StringUtils.mjs
822
- /*! @azure/msal-common v16.14.1 2026-09-15 */
822
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
823
823
  /**
824
824
  * @hidden
825
825
  */
@@ -889,7 +889,7 @@ var StringUtils = class {
889
889
  };
890
890
  //#endregion
891
891
  //#region node_modules/@azure/msal-common/dist/url/UrlString.mjs
892
- /*! @azure/msal-common v16.14.1 2026-09-15 */
892
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
893
893
  /**
894
894
  * Url object class which can perform various transformations on url strings.
895
895
  */
@@ -996,7 +996,7 @@ var UrlString = class UrlString {
996
996
  };
997
997
  //#endregion
998
998
  //#region node_modules/@azure/msal-common/dist/authority/AuthorityMetadata.mjs
999
- /*! @azure/msal-common v16.14.1 2026-09-15 */
999
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1000
1000
  const endpointHosts = [
1001
1001
  { host: "login.microsoftonline.com" },
1002
1002
  { host: "login.partner.microsoftonline.cn" },
@@ -1127,7 +1127,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
1127
1127
  }
1128
1128
  //#endregion
1129
1129
  //#region node_modules/@azure/msal-common/dist/authority/AuthorityOptions.mjs
1130
- /*! @azure/msal-common v16.14.1 2026-09-15 */
1130
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1131
1131
  const AzureCloudInstance = {
1132
1132
  None: "none",
1133
1133
  AzurePublic: "https://login.microsoftonline.com",
@@ -1137,19 +1137,19 @@ const AzureCloudInstance = {
1137
1137
  };
1138
1138
  //#endregion
1139
1139
  //#region node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryResponse.mjs
1140
- /*! @azure/msal-common v16.14.1 2026-09-15 */
1140
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1141
1141
  function isCloudInstanceDiscoveryResponse(response) {
1142
1142
  return response.hasOwnProperty("tenant_discovery_endpoint") && response.hasOwnProperty("metadata");
1143
1143
  }
1144
1144
  //#endregion
1145
1145
  //#region node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs
1146
- /*! @azure/msal-common v16.14.1 2026-09-15 */
1146
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1147
1147
  function isCloudInstanceDiscoveryErrorResponse(response) {
1148
1148
  return response.hasOwnProperty("error") && response.hasOwnProperty("error_description");
1149
1149
  }
1150
1150
  //#endregion
1151
1151
  //#region node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceEvents.mjs
1152
- /*! @azure/msal-common v16.14.1 2026-09-15 */
1152
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1153
1153
  /**
1154
1154
  * Time spent sending/waiting for the response of a request to the token endpoint
1155
1155
  */
@@ -1208,7 +1208,7 @@ const RegionDiscoveryGetCurrentVersion = "regionDiscoveryGetCurrentVersion";
1208
1208
  const CacheManagerGetRefreshToken = "cacheManagerGetRefreshToken";
1209
1209
  //#endregion
1210
1210
  //#region node_modules/@azure/msal-common/dist/utils/FunctionWrappers.mjs
1211
- /*! @azure/msal-common v16.14.1 2026-09-15 */
1211
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1212
1212
  /**
1213
1213
  * Wraps a function with a performance measurement.
1214
1214
  * Usage: invoke(functionToCall, performanceClient, "EventName", "correlationId")(...argsToPassToFunction)
@@ -1277,7 +1277,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
1277
1277
  };
1278
1278
  //#endregion
1279
1279
  //#region node_modules/@azure/msal-common/dist/authority/RegionDiscovery.mjs
1280
- /*! @azure/msal-common v16.14.1 2026-09-15 */
1280
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1281
1281
  var RegionDiscovery = class RegionDiscovery {
1282
1282
  constructor(networkInterface, logger, performanceClient, correlationId) {
1283
1283
  this.networkInterface = networkInterface;
@@ -1348,7 +1348,7 @@ var RegionDiscovery = class RegionDiscovery {
1348
1348
  RegionDiscovery.IMDS_OPTIONS = { headers: { Metadata: "true" } };
1349
1349
  //#endregion
1350
1350
  //#region node_modules/@azure/msal-common/dist/utils/TimeUtils.mjs
1351
- /*! @azure/msal-common v16.14.1 2026-09-15 */
1351
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1352
1352
  /**
1353
1353
  * Utility functions for managing date and time operations.
1354
1354
  */
@@ -1393,7 +1393,7 @@ function delay(t, value) {
1393
1393
  }
1394
1394
  //#endregion
1395
1395
  //#region node_modules/@azure/msal-common/dist/cache/utils/CacheHelpers.mjs
1396
- /*! @azure/msal-common v16.14.1 2026-09-15 */
1396
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1397
1397
  /**
1398
1398
  * Create IdTokenEntity
1399
1399
  * @param homeAccountId
@@ -1593,7 +1593,7 @@ function serializeAttributeTokens(attributeTokens) {
1593
1593
  }
1594
1594
  //#endregion
1595
1595
  //#region node_modules/@azure/msal-common/dist/authority/Authority.mjs
1596
- /*! @azure/msal-common v16.14.1 2026-09-15 */
1596
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1597
1597
  /**
1598
1598
  * The authority class validates the authority URIs used by the user, and retrieves the OpenID Configuration Data from the
1599
1599
  * endpoint. It will store the pertinent config data in this object for use during token calls.
@@ -2327,7 +2327,7 @@ function buildStaticAuthorityOptions(authOptions) {
2327
2327
  }
2328
2328
  //#endregion
2329
2329
  //#region node_modules/@azure/msal-common/dist/authority/AuthorityFactory.mjs
2330
- /*! @azure/msal-common v16.14.1 2026-09-15 */
2330
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
2331
2331
  /**
2332
2332
  * Create an authority object of the correct type based on the url
2333
2333
  * Performs basic authority validation - checks to see if the authority is of a valid type (i.e. aad, b2c, adfs)
@@ -2354,7 +2354,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
2354
2354
  }
2355
2355
  //#endregion
2356
2356
  //#region node_modules/@azure/msal-common/dist/request/ScopeSet.mjs
2357
- /*! @azure/msal-common v16.14.1 2026-09-15 */
2357
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
2358
2358
  /**
2359
2359
  * The ScopeSet class creates a set of scopes. Scopes are case-insensitive, unique values, so the Set object in JS makes
2360
2360
  * the most sense to implement for this class. All scopes are trimmed and converted to lower case strings in intersection and union functions
@@ -2506,7 +2506,7 @@ var ScopeSet = class ScopeSet {
2506
2506
  };
2507
2507
  //#endregion
2508
2508
  //#region node_modules/@azure/msal-common/dist/request/RequestParameterBuilder.mjs
2509
- /*! @azure/msal-common v16.14.1 2026-09-15 */
2509
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
2510
2510
  function instrumentBrokerParams(parameters, correlationId, performanceClient) {
2511
2511
  if (!correlationId) return;
2512
2512
  const clientId = parameters.get(CLIENT_ID);
@@ -2915,7 +2915,7 @@ function addAttributeTokens(parameters, attributeTokens) {
2915
2915
  }
2916
2916
  //#endregion
2917
2917
  //#region node_modules/@azure/msal-common/dist/utils/UrlUtils.mjs
2918
- /*! @azure/msal-common v16.14.1 2026-09-15 */
2918
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
2919
2919
  /**
2920
2920
  * Parses hash string from given string. Returns empty string if no hash symbol is found.
2921
2921
  * @param hashString
@@ -2951,7 +2951,7 @@ function mapToQueryString(parameters) {
2951
2951
  }
2952
2952
  //#endregion
2953
2953
  //#region node_modules/@azure/msal-common/dist/crypto/ICrypto.mjs
2954
- /*! @azure/msal-common v16.14.1 2026-09-15 */
2954
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
2955
2955
  /**
2956
2956
  * Shared JOSE algorithm literals used by MSAL package internals.
2957
2957
  * @internal
@@ -2995,7 +2995,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
2995
2995
  };
2996
2996
  //#endregion
2997
2997
  //#region node_modules/@azure/msal-common/dist/crypto/ITokenBindingKeyManager.mjs
2998
- /*! @azure/msal-common v16.14.1 2026-09-15 */
2998
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
2999
2999
  /**
3000
3000
  * Default token-binding key manager used when a platform-specific implementation
3001
3001
  * has not been provided.
@@ -3014,7 +3014,7 @@ const DEFAULT_TOKEN_BINDING_KEY_MANAGER = {
3014
3014
  };
3015
3015
  //#endregion
3016
3016
  //#region node_modules/@azure/msal-common/dist/logger/Logger.mjs
3017
- /*! @azure/msal-common v16.14.1 2026-09-15 */
3017
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
3018
3018
  /**
3019
3019
  * Log message level.
3020
3020
  */
@@ -3245,17 +3245,17 @@ var Logger = class Logger {
3245
3245
  };
3246
3246
  //#endregion
3247
3247
  //#region node_modules/@azure/msal-common/dist/packageMetadata.mjs
3248
- /*! @azure/msal-common v16.14.1 2026-09-15 */
3248
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
3249
3249
  const name$1 = "@azure/msal-common";
3250
- const version$1 = "16.14.1";
3250
+ const version$1 = "16.14.2";
3251
3251
  //#endregion
3252
3252
  //#region node_modules/@azure/msal-common/dist/error/CacheErrorCodes.mjs
3253
- /*! @azure/msal-common v16.14.1 2026-09-15 */
3253
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
3254
3254
  const cacheQuotaExceeded = "cache_quota_exceeded";
3255
3255
  const cacheErrorUnknown = "cache_error_unknown";
3256
3256
  //#endregion
3257
3257
  //#region node_modules/@azure/msal-common/dist/error/CacheError.mjs
3258
- /*! @azure/msal-common v16.14.1 2026-09-15 */
3258
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
3259
3259
  /**
3260
3260
  * Error thrown when there is an error with the cache
3261
3261
  */
@@ -3281,7 +3281,7 @@ function createCacheError(e) {
3281
3281
  }
3282
3282
  //#endregion
3283
3283
  //#region node_modules/@azure/msal-common/dist/cache/CacheManager.mjs
3284
- /*! @azure/msal-common v16.14.1 2026-09-15 */
3284
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
3285
3285
  /**
3286
3286
  * Interface class which implement cache storage functions used by MSAL to perform validity checks, and store tokens.
3287
3287
  * @internal
@@ -4130,7 +4130,7 @@ var DefaultStorageClass = class extends CacheManager {
4130
4130
  };
4131
4131
  //#endregion
4132
4132
  //#region node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceEvent.mjs
4133
- /*! @azure/msal-common v16.14.1 2026-09-15 */
4133
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
4134
4134
  /**
4135
4135
  * State of the performance event.
4136
4136
  *
@@ -4144,7 +4144,7 @@ const PerformanceEventStatus = {
4144
4144
  };
4145
4145
  //#endregion
4146
4146
  //#region node_modules/@azure/msal-common/dist/telemetry/performance/StubPerformanceClient.mjs
4147
- /*! @azure/msal-common v16.14.1 2026-09-15 */
4147
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
4148
4148
  var StubPerformanceClient = class {
4149
4149
  generateId() {
4150
4150
  return "callback-id";
@@ -4186,7 +4186,7 @@ var StubPerformanceClient = class {
4186
4186
  };
4187
4187
  //#endregion
4188
4188
  //#region node_modules/@azure/msal-common/dist/config/ClientConfiguration.mjs
4189
- /*! @azure/msal-common v16.14.1 2026-09-15 */
4189
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
4190
4190
  const DEFAULT_SYSTEM_OPTIONS$1 = {
4191
4191
  tokenRenewalOffsetSeconds: 300,
4192
4192
  preventCorsPreflight: false
@@ -4244,7 +4244,7 @@ function buildClientConfiguration({ authOptions: userAuthOptions, systemOptions:
4244
4244
  ...userSystemOptions
4245
4245
  },
4246
4246
  loggerOptions,
4247
- storageInterface: storageImplementation || new DefaultStorageClass(userAuthOptions.clientId, DEFAULT_CRYPTO_IMPLEMENTATION, new Logger(loggerOptions, "@azure/msal-common", "16.14.1"), new StubPerformanceClient(), void 0, resolvedTokenBindingKeyManager),
4247
+ storageInterface: storageImplementation || new DefaultStorageClass(userAuthOptions.clientId, DEFAULT_CRYPTO_IMPLEMENTATION, new Logger(loggerOptions, "@azure/msal-common", "16.14.2"), new StubPerformanceClient(), void 0, resolvedTokenBindingKeyManager),
4248
4248
  networkInterface: networkImplementation || DEFAULT_NETWORK_IMPLEMENTATION,
4249
4249
  cryptoInterface: cryptoImplementation || DEFAULT_CRYPTO_IMPLEMENTATION,
4250
4250
  tokenBindingKeyManager: resolvedTokenBindingKeyManager,
@@ -4284,7 +4284,7 @@ function isOidcProtocolMode(config) {
4284
4284
  }
4285
4285
  //#endregion
4286
4286
  //#region node_modules/@azure/msal-common/dist/cache/persistence/TokenCacheContext.mjs
4287
- /*! @azure/msal-common v16.14.1 2026-09-15 */
4287
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
4288
4288
  /**
4289
4289
  * This class instance helps track the memory changes facilitating
4290
4290
  * decisions to read from and write to the persistent cache
@@ -4308,7 +4308,7 @@ function isOidcProtocolMode(config) {
4308
4308
  };
4309
4309
  //#endregion
4310
4310
  //#region node_modules/@azure/msal-common/dist/error/JoseHeaderError.mjs
4311
- /*! @azure/msal-common v16.14.1 2026-09-15 */
4311
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
4312
4312
  /**
4313
4313
  * Error thrown when there is an error in the client code running on the browser.
4314
4314
  */
@@ -4325,7 +4325,7 @@ function createJoseHeaderError(code, correlationId) {
4325
4325
  }
4326
4326
  //#endregion
4327
4327
  //#region node_modules/@azure/msal-common/dist/utils/ObjectUtils.mjs
4328
- /*! @azure/msal-common v16.14.1 2026-09-15 */
4328
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
4329
4329
  /**
4330
4330
  * Checks whether a value is a plain JSON-like object.
4331
4331
  * Allows objects with null prototypes, but rejects arrays and object subclasses.
@@ -4339,14 +4339,14 @@ function isPlainObject(value) {
4339
4339
  }
4340
4340
  //#endregion
4341
4341
  //#region node_modules/@azure/msal-common/dist/error/JoseHeaderErrorCodes.mjs
4342
- /*! @azure/msal-common v16.14.1 2026-09-15 */
4342
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
4343
4343
  const missingKidError = "missing_kid_error";
4344
4344
  const missingAlgError = "missing_alg_error";
4345
4345
  const missingJwkError = "missing_jwk_error";
4346
4346
  const invalidJwkError = "invalid_jwk_error";
4347
4347
  //#endregion
4348
4348
  //#region node_modules/@azure/msal-common/dist/crypto/JoseHeader.mjs
4349
- /*! @azure/msal-common v16.14.1 2026-09-15 */
4349
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
4350
4350
  /** @internal */
4351
4351
  var JoseHeader = class JoseHeader {
4352
4352
  constructor(options, correlationId) {
@@ -4393,7 +4393,7 @@ var JoseHeader = class JoseHeader {
4393
4393
  };
4394
4394
  //#endregion
4395
4395
  //#region node_modules/@azure/msal-common/dist/crypto/PopTokenGenerator.mjs
4396
- /*! @azure/msal-common v16.14.1 2026-09-15 */
4396
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
4397
4397
  const KeyLocation = { SW: "sw" };
4398
4398
  const SHR_TOKEN_BINDING_KEY_TYPE = "shr";
4399
4399
  const SHR_TOKEN_BINDING_KEY_ALGORITHM = JsonWebTokenAlgorithms.RS256;
@@ -4478,7 +4478,7 @@ var PopTokenGenerator = class {
4478
4478
  };
4479
4479
  //#endregion
4480
4480
  //#region node_modules/@azure/msal-common/dist/crypto/DpopProofGenerator.mjs
4481
- /*! @azure/msal-common v16.14.1 2026-09-15 */
4481
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
4482
4482
  const DPOP_HTM_REGEX = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
4483
4483
  const DPOP_TOKEN_BINDING_KEY_TYPE = "dpop";
4484
4484
  const DPOP_JWT_HEADER_ALGORITHM = JsonWebTokenAlgorithms.ES256;
@@ -4603,7 +4603,7 @@ var DpopProofGenerator = class {
4603
4603
  };
4604
4604
  //#endregion
4605
4605
  //#region node_modules/@azure/msal-common/dist/error/InteractionRequiredAuthErrorCodes.mjs
4606
- /*! @azure/msal-common v16.14.1 2026-09-15 */
4606
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
4607
4607
  /**
4608
4608
  * MSAL-defined interaction required error code indicating no tokens are found in cache.
4609
4609
  * @public
@@ -4616,7 +4616,7 @@ const noTokensFound = "no_tokens_found";
4616
4616
  const refreshTokenExpired = "refresh_token_expired";
4617
4617
  //#endregion
4618
4618
  //#region node_modules/@azure/msal-common/dist/error/InteractionRequiredAuthError.mjs
4619
- /*! @azure/msal-common v16.14.1 2026-09-15 */
4619
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
4620
4620
  /**
4621
4621
  * InteractionRequiredServerErrorMessage contains string constants used by error codes and messages returned by the server indicating interaction is required
4622
4622
  */
@@ -4674,7 +4674,7 @@ function createInteractionRequiredAuthError(errorCode, correlationId, errorMessa
4674
4674
  }
4675
4675
  //#endregion
4676
4676
  //#region node_modules/@azure/msal-common/dist/error/ServerError.mjs
4677
- /*! @azure/msal-common v16.14.1 2026-09-15 */
4677
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
4678
4678
  /**
4679
4679
  * Error thrown when there is an error with the server code, for example, unavailability.
4680
4680
  */
@@ -4689,7 +4689,7 @@ var ServerError = class ServerError extends AuthError {
4689
4689
  };
4690
4690
  //#endregion
4691
4691
  //#region node_modules/@azure/msal-common/dist/utils/ProtocolUtils.mjs
4692
- /*! @azure/msal-common v16.14.1 2026-09-15 */
4692
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
4693
4693
  /**
4694
4694
  * Parses the state into the RequestStateObject, which contains the LibraryState info and the state passed by the user.
4695
4695
  * @param base64Decode
@@ -4715,7 +4715,7 @@ function parseRequestState(base64Decode, state, correlationId) {
4715
4715
  }
4716
4716
  //#endregion
4717
4717
  //#region node_modules/@azure/msal-common/dist/response/ResponseHandler.mjs
4718
- /*! @azure/msal-common v16.14.1 2026-09-15 */
4718
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
4719
4719
  /**
4720
4720
  * Class that handles response parsing.
4721
4721
  * @internal
@@ -4985,14 +4985,14 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
4985
4985
  }
4986
4986
  //#endregion
4987
4987
  //#region node_modules/@azure/msal-common/dist/account/CcsCredential.mjs
4988
- /*! @azure/msal-common v16.14.1 2026-09-15 */
4988
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
4989
4989
  const CcsCredentialType = {
4990
4990
  HOME_ACCOUNT_ID: "home_account_id",
4991
4991
  UPN: "UPN"
4992
4992
  };
4993
4993
  //#endregion
4994
4994
  //#region node_modules/@azure/msal-common/dist/utils/ClientAssertionUtils.mjs
4995
- /*! @azure/msal-common v16.14.1 2026-09-15 */
4995
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
4996
4996
  async function getClientAssertion(clientAssertion, clientId, tokenEndpoint, fmiPath) {
4997
4997
  if (typeof clientAssertion === "string") return clientAssertion;
4998
4998
  else return clientAssertion({
@@ -5003,7 +5003,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint, fmiP
5003
5003
  }
5004
5004
  //#endregion
5005
5005
  //#region node_modules/@azure/msal-common/dist/network/RequestThumbprint.mjs
5006
- /*! @azure/msal-common v16.14.1 2026-09-15 */
5006
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5007
5007
  function getRequestThumbprint(clientId, request, homeAccountId) {
5008
5008
  return {
5009
5009
  clientId,
@@ -5023,7 +5023,7 @@ function getRequestThumbprint(clientId, request, homeAccountId) {
5023
5023
  }
5024
5024
  //#endregion
5025
5025
  //#region node_modules/@azure/msal-common/dist/network/ThrottlingUtils.mjs
5026
- /*! @azure/msal-common v16.14.1 2026-09-15 */
5026
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5027
5027
  /** @internal */
5028
5028
  var ThrottlingUtils = class ThrottlingUtils {
5029
5029
  /**
@@ -5099,7 +5099,7 @@ var ThrottlingUtils = class ThrottlingUtils {
5099
5099
  };
5100
5100
  //#endregion
5101
5101
  //#region node_modules/@azure/msal-common/dist/error/NetworkError.mjs
5102
- /*! @azure/msal-common v16.14.1 2026-09-15 */
5102
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5103
5103
  /**
5104
5104
  * Represents network related errors
5105
5105
  */
@@ -5126,7 +5126,7 @@ function createNetworkError(error, httpStatus, responseHeaders, additionalError)
5126
5126
  }
5127
5127
  //#endregion
5128
5128
  //#region node_modules/@azure/msal-common/dist/protocol/Token.mjs
5129
- /*! @azure/msal-common v16.14.1 2026-09-15 */
5129
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5130
5130
  /**
5131
5131
  * Creates default headers for requests to token endpoint
5132
5132
  */
@@ -5232,7 +5232,7 @@ async function sendPostRequest(thumbprint, tokenEndpoint, options, correlationId
5232
5232
  }
5233
5233
  //#endregion
5234
5234
  //#region node_modules/@azure/msal-common/dist/client/AuthorizationCodeClient.mjs
5235
- /*! @azure/msal-common v16.14.1 2026-09-15 */
5235
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5236
5236
  /**
5237
5237
  * Oauth2.0 Authorization Code client
5238
5238
  * @internal
@@ -5392,7 +5392,7 @@ var AuthorizationCodeClient = class {
5392
5392
  };
5393
5393
  //#endregion
5394
5394
  //#region node_modules/@azure/msal-common/dist/protocol/Authorize.mjs
5395
- /*! @azure/msal-common v16.14.1 2026-09-15 */
5395
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5396
5396
  /**
5397
5397
  * Returns map of parameters that are applicable to all calls to /authorize whether using PKCE or EAR
5398
5398
  * @param config
@@ -5503,7 +5503,7 @@ function extractLoginHint(account) {
5503
5503
  }
5504
5504
  //#endregion
5505
5505
  //#region node_modules/@azure/msal-common/dist/client/RefreshTokenClient.mjs
5506
- /*! @azure/msal-common v16.14.1 2026-09-15 */
5506
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5507
5507
  const DEFAULT_REFRESH_TOKEN_EXPIRATION_OFFSET_SECONDS = 300;
5508
5508
  /**
5509
5509
  * OAuth2.0 refresh token client
@@ -5606,6 +5606,7 @@ var RefreshTokenClient = class {
5606
5606
  addClientId(parameters, request.embeddedClientId || request.extraParameters?.["client_id"] || this.config.authOptions.clientId);
5607
5607
  if (request.redirectUri) addRedirectUri(parameters, request.redirectUri);
5608
5608
  addScopes(parameters, request.scopes, request.correlationId, true, this.config.authOptions.authority.options.OIDCOptions?.defaultScopes);
5609
+ addResource(parameters, request.resource);
5609
5610
  addGrantType(parameters, GrantType.REFRESH_TOKEN_GRANT);
5610
5611
  addClientInfo(parameters);
5611
5612
  addLibraryInfo(parameters, this.config.libraryInfo);
@@ -5650,7 +5651,7 @@ var RefreshTokenClient = class {
5650
5651
  };
5651
5652
  //#endregion
5652
5653
  //#region node_modules/@azure/msal-common/dist/telemetry/server/ServerTelemetryManager.mjs
5653
- /*! @azure/msal-common v16.14.1 2026-09-15 */
5654
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5654
5655
  const skuGroupSeparator = ",";
5655
5656
  const skuValueSeparator = "|";
5656
5657
  function makeExtraSkuString(params) {
@@ -5845,7 +5846,7 @@ var ServerTelemetryManager = class ServerTelemetryManager {
5845
5846
  };
5846
5847
  //#endregion
5847
5848
  //#region node_modules/@azure/msal-common/dist/client/SilentFlowClient.mjs
5848
- /*! @azure/msal-common v16.14.1 2026-09-15 */
5849
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5849
5850
  /** @internal */
5850
5851
  var SilentFlowClient = class {
5851
5852
  constructor(configuration, performanceClient) {
@@ -5930,7 +5931,7 @@ var SilentFlowClient = class {
5930
5931
  };
5931
5932
  //#endregion
5932
5933
  //#region node_modules/@azure/msal-common/dist/request/BaseAuthRequest.mjs
5933
- /*! @azure/msal-common v16.14.1 2026-09-15 */
5934
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5934
5935
  /**
5935
5936
  * Helper to enforce resource parameter presence in token requests when isMcp is set in the configuration.
5936
5937
  * If resource parameter is set in both the request and in extraQueryParameters or extraParameters, an error will be thrown.
@@ -5949,7 +5950,7 @@ function containsResourceParam(params) {
5949
5950
  }
5950
5951
  //#endregion
5951
5952
  //#region node_modules/@azure/msal-node/dist/cache/serializer/Deserializer.mjs
5952
- /*! @azure/msal-node v6.0.1 2026-09-15 */
5953
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
5953
5954
  /**
5954
5955
  * This class deserializes cache entities read from the file into in-memory object types defined internally
5955
5956
  * @internal
@@ -6097,7 +6098,7 @@ var Deserializer = class {
6097
6098
  };
6098
6099
  }
6099
6100
  };
6100
- /*! @azure/msal-node v6.0.1 2026-09-15 */
6101
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
6101
6102
  /**
6102
6103
  * Managed Identity Query Parameters - used in network requests
6103
6104
  */
@@ -6210,7 +6211,7 @@ const LOOPBACK_SERVER_CONSTANTS = {
6210
6211
  };
6211
6212
  //#endregion
6212
6213
  //#region node_modules/@azure/msal-node/dist/network/HttpClient.mjs
6213
- /*! @azure/msal-node v6.0.1 2026-09-15 */
6214
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
6214
6215
  /**
6215
6216
  * HTTP client implementation using Node.js native fetch API.
6216
6217
  *
@@ -6347,7 +6348,7 @@ function getFetchHeaders(options) {
6347
6348
  }
6348
6349
  //#endregion
6349
6350
  //#region node_modules/@azure/msal-node/dist/error/ManagedIdentityErrorCodes.mjs
6350
- /*! @azure/msal-node v6.0.1 2026-09-15 */
6351
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
6351
6352
  const invalidFileExtension = "invalid_file_extension";
6352
6353
  const invalidFilePath = "invalid_file_path";
6353
6354
  const invalidManagedIdentityIdType = "invalid_managed_identity_id_type";
@@ -6371,7 +6372,7 @@ const MsiEnvironmentVariableUrlMalformedErrorCodes = {
6371
6372
  };
6372
6373
  //#endregion
6373
6374
  //#region node_modules/@azure/msal-node/dist/error/ManagedIdentityError.mjs
6374
- /*! @azure/msal-node v6.0.1 2026-09-15 */
6375
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
6375
6376
  /**
6376
6377
  * ManagedIdentityErrorMessage class containing string constants used by error codes and messages.
6377
6378
  */
@@ -6408,10 +6409,10 @@ function createManagedIdentityError(errorCode, correlationId) {
6408
6409
  }
6409
6410
  //#endregion
6410
6411
  //#region node_modules/@azure/msal-node/dist/config/ManagedIdentityId.mjs
6411
- /*! @azure/msal-node v6.0.1 2026-09-15 */
6412
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
6412
6413
  //#endregion
6413
6414
  //#region node_modules/@azure/msal-node/dist/error/NodeAuthError.mjs
6414
- /*! @azure/msal-node v6.0.1 2026-09-15 */
6415
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
6415
6416
  /**
6416
6417
  * NodeAuthErrorMessage class containing string constants used by error codes and messages.
6417
6418
  */
@@ -6440,6 +6441,10 @@ const NodeAuthErrorMessage = {
6440
6441
  code: "loopback_server_timeout",
6441
6442
  desc: "Timed out waiting for auth code listener to be registered."
6442
6443
  },
6444
+ loopbackServerQueryResponseNotSupported: {
6445
+ code: "loopback_server_query_response_not_supported",
6446
+ desc: "The loopback server received an OAuth response in the URL. Interactive authentication requires form_post."
6447
+ },
6443
6448
  stateNotFoundError: {
6444
6449
  code: "state_not_found",
6445
6450
  desc: "State not found. Please verify that the request originated from msal."
@@ -6495,6 +6500,12 @@ var NodeAuthError = class NodeAuthError extends AuthError {
6495
6500
  return new NodeAuthError(NodeAuthErrorMessage.loopbackServerTimeout.code, correlationId, `${NodeAuthErrorMessage.loopbackServerTimeout.desc}`);
6496
6501
  }
6497
6502
  /**
6503
+ * Creates an error thrown if the loopback server receives an OAuth response in a query string.
6504
+ */
6505
+ static createLoopbackServerQueryResponseNotSupportedError() {
6506
+ return new NodeAuthError(NodeAuthErrorMessage.loopbackServerQueryResponseNotSupported.code, "", NodeAuthErrorMessage.loopbackServerQueryResponseNotSupported.desc);
6507
+ }
6508
+ /**
6498
6509
  * Creates an error thrown when the state is not present.
6499
6510
  */
6500
6511
  static createStateNotFoundError(correlationId = "") {
@@ -6515,7 +6526,7 @@ var NodeAuthError = class NodeAuthError extends AuthError {
6515
6526
  };
6516
6527
  //#endregion
6517
6528
  //#region node_modules/@azure/msal-node/dist/config/Configuration.mjs
6518
- /*! @azure/msal-node v6.0.1 2026-09-15 */
6529
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
6519
6530
  const DEFAULT_AUTH_OPTIONS = {
6520
6531
  clientId: "",
6521
6532
  authority: DEFAULT_AUTHORITY,
@@ -6590,7 +6601,7 @@ function buildAppConfiguration({ auth, broker, cache, system, telemetry }) {
6590
6601
  }
6591
6602
  //#endregion
6592
6603
  //#region node_modules/@azure/msal-node/dist/crypto/GuidGenerator.mjs
6593
- /*! @azure/msal-node v6.0.1 2026-09-15 */
6604
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
6594
6605
  var GuidGenerator = class {
6595
6606
  /**
6596
6607
  * Generates a random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) version 4 UUID. The UUID is generated using a
@@ -6609,7 +6620,7 @@ var GuidGenerator = class {
6609
6620
  };
6610
6621
  //#endregion
6611
6622
  //#region node_modules/@azure/msal-node/dist/utils/EncodingUtils.mjs
6612
- /*! @azure/msal-node v6.0.1 2026-09-15 */
6623
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
6613
6624
  var EncodingUtils = class EncodingUtils {
6614
6625
  /**
6615
6626
  * 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
@@ -6647,7 +6658,7 @@ var EncodingUtils = class EncodingUtils {
6647
6658
  };
6648
6659
  //#endregion
6649
6660
  //#region node_modules/@azure/msal-node/dist/crypto/HashUtils.mjs
6650
- /*! @azure/msal-node v6.0.1 2026-09-15 */
6661
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
6651
6662
  var HashUtils = class {
6652
6663
  /**
6653
6664
  * generate 'SHA256' hash
@@ -6659,7 +6670,7 @@ var HashUtils = class {
6659
6670
  };
6660
6671
  //#endregion
6661
6672
  //#region node_modules/@azure/msal-node/dist/crypto/PkceGenerator.mjs
6662
- /*! @azure/msal-node v6.0.1 2026-09-15 */
6673
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
6663
6674
  /**
6664
6675
  * https://tools.ietf.org/html/rfc7636#page-8
6665
6676
  */
@@ -6703,7 +6714,7 @@ var PkceGenerator = class {
6703
6714
  };
6704
6715
  //#endregion
6705
6716
  //#region node_modules/@azure/msal-node/dist/crypto/CryptoProvider.mjs
6706
- /*! @azure/msal-node v6.0.1 2026-09-15 */
6717
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
6707
6718
  /**
6708
6719
  * This class implements MSAL node's crypto interface, which allows it to perform base64 encoding and decoding, generating cryptographically random GUIDs and
6709
6720
  * implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).
@@ -6790,7 +6801,7 @@ var CryptoProvider = class {
6790
6801
  };
6791
6802
  //#endregion
6792
6803
  //#region node_modules/@azure/msal-node/dist/cache/CacheHelpers.mjs
6793
- /*! @azure/msal-node v6.0.1 2026-09-15 */
6804
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
6794
6805
  /**
6795
6806
  * Computes a combined hash from additional cache key components.
6796
6807
  *
@@ -6844,7 +6855,7 @@ function generateAccountKey(account) {
6844
6855
  }
6845
6856
  //#endregion
6846
6857
  //#region node_modules/@azure/msal-node/dist/cache/NodeStorage.mjs
6847
- /*! @azure/msal-node v6.0.1 2026-09-15 */
6858
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
6848
6859
  /**
6849
6860
  * This class implements Storage for node, reading cache from user specified storage location or an extension library
6850
6861
  * @public
@@ -7211,7 +7222,7 @@ var NodeStorage = class extends CacheManager {
7211
7222
  };
7212
7223
  //#endregion
7213
7224
  //#region node_modules/@azure/msal-node/dist/cache/TokenCache.mjs
7214
- /*! @azure/msal-node v6.0.1 2026-09-15 */
7225
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
7215
7226
  const defaultSerializedCache = {
7216
7227
  Account: {},
7217
7228
  IdToken: {},
@@ -11607,7 +11618,7 @@ var import_jsonwebtoken = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin
11607
11618
  TokenExpiredError: require_TokenExpiredError()
11608
11619
  };
11609
11620
  })))(), 1);
11610
- /*! @azure/msal-node v6.0.1 2026-09-15 */
11621
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
11611
11622
  const userTimeoutReached = "user_timeout_reached";
11612
11623
  const invalidAssertion = "invalid_assertion";
11613
11624
  const deviceCodePollingCancelled = "device_code_polling_cancelled";
@@ -11615,7 +11626,7 @@ const deviceCodeExpired = "device_code_expired";
11615
11626
  const deviceCodeUnknownError = "device_code_unknown_error";
11616
11627
  //#endregion
11617
11628
  //#region node_modules/@azure/msal-node/dist/client/ClientAssertion.mjs
11618
- /*! @azure/msal-node v6.0.1 2026-09-15 */
11629
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
11619
11630
  /**
11620
11631
  * Client assertion of type jwt-bearer used in confidential client flows
11621
11632
  * @public
@@ -11723,12 +11734,12 @@ var ClientAssertion = class ClientAssertion {
11723
11734
  };
11724
11735
  //#endregion
11725
11736
  //#region node_modules/@azure/msal-node/dist/packageMetadata.mjs
11726
- /*! @azure/msal-node v6.0.1 2026-09-15 */
11737
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
11727
11738
  const name = "@azure/msal-node";
11728
- const version = "6.0.1";
11739
+ const version = "7.0.1";
11729
11740
  //#endregion
11730
11741
  //#region node_modules/@azure/msal-node/dist/client/BaseClient.mjs
11731
- /*! @azure/msal-node v6.0.1 2026-09-15 */
11742
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
11732
11743
  /**
11733
11744
  * Base application class which will construct requests to send to and handle responses from the Microsoft STS using the authorization code flow.
11734
11745
  * @internal
@@ -11780,7 +11791,7 @@ var BaseClient = class {
11780
11791
  };
11781
11792
  //#endregion
11782
11793
  //#region node_modules/@azure/msal-node/dist/client/UsernamePasswordClient.mjs
11783
- /*! @azure/msal-node v6.0.1 2026-09-15 */
11794
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
11784
11795
  /**
11785
11796
  * Oauth2.0 Password grant client
11786
11797
  * Note: We are only supporting public clients for password grant and for purely testing purposes
@@ -11861,7 +11872,7 @@ var UsernamePasswordClient = class extends BaseClient {
11861
11872
  };
11862
11873
  //#endregion
11863
11874
  //#region node_modules/@azure/msal-node/dist/protocol/Authorize.mjs
11864
- /*! @azure/msal-node v6.0.1 2026-09-15 */
11875
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
11865
11876
  /**
11866
11877
  * Constructs the full /authorize URL with request parameters
11867
11878
  * @param config
@@ -11889,8 +11900,103 @@ function getAuthCodeRequestUrl(config, authority, request, logger) {
11889
11900
  return getAuthorizeUrl(authority, parameters);
11890
11901
  }
11891
11902
  //#endregion
11903
+ //#region node_modules/@azure/msal-node/dist/client/SilentRequestCoalescer.mjs
11904
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
11905
+ const activeSilentTokenRequests = /* @__PURE__ */ new WeakMap();
11906
+ /**
11907
+ * Shares an in-flight silent acquisition while preserving each caller's correlation ID.
11908
+ */
11909
+ function acquireTokenSilentDeduped(owner, logger, silentRequestKey, correlationId, acquireToken) {
11910
+ const existingRequests = activeSilentTokenRequests.get(owner);
11911
+ const activeRequests = existingRequests || /* @__PURE__ */ new Map();
11912
+ if (!existingRequests) activeSilentTokenRequests.set(owner, activeRequests);
11913
+ const inProgressRequest = activeRequests.get(silentRequestKey);
11914
+ if (inProgressRequest) {
11915
+ logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call", correlationId);
11916
+ return applyCallerCorrelationIdToResult(inProgressRequest, correlationId);
11917
+ }
11918
+ logger.verbose("acquireTokenSilent called for the first time, storing active request", correlationId);
11919
+ const activeRequest = Promise.resolve().then(acquireToken).finally(() => {
11920
+ activeRequests.delete(silentRequestKey);
11921
+ if (activeRequests.size === 0) activeSilentTokenRequests.delete(owner);
11922
+ });
11923
+ activeRequests.set(silentRequestKey, activeRequest);
11924
+ return applyCallerCorrelationIdToResult(activeRequest, correlationId);
11925
+ }
11926
+ /**
11927
+ * Builds the key used to identify equivalent in-progress silent requests.
11928
+ */
11929
+ function getSilentRequestKey(input) {
11930
+ const { request } = input;
11931
+ const authority = input.requestType === "native" ? request.authority : input.authority;
11932
+ const commonKeyFields = {
11933
+ requestType: input.requestType,
11934
+ clientId: input.requestType === "native" ? input.request.clientId : input.clientId,
11935
+ authority,
11936
+ scopes: canonicalizeRequestValues(request.scopes),
11937
+ claims: request.claims,
11938
+ authenticationScheme: request.authenticationScheme,
11939
+ resourceRequestMethod: request.resourceRequestMethod,
11940
+ resourceRequestUri: request.resourceRequestUri,
11941
+ forceRefresh: request.forceRefresh,
11942
+ redirectUri: request.redirectUri || "",
11943
+ resource: request.resource,
11944
+ extraParameters: canonicalizeRequestValues(request.extraParameters)
11945
+ };
11946
+ if (input.requestType === "native") return JSON.stringify({
11947
+ ...commonKeyFields,
11948
+ accountId: input.request.accountId,
11949
+ shrNonce: input.request.shrNonce,
11950
+ extraScopesToConsent: canonicalizeRequestValues(input.request.extraScopesToConsent),
11951
+ loginHint: input.request.loginHint,
11952
+ prompt: input.request.prompt
11953
+ });
11954
+ const nonNativeRequest = input.request;
11955
+ const thumbprint = getRequestThumbprint(input.clientId, {
11956
+ ...nonNativeRequest,
11957
+ authority
11958
+ }, nonNativeRequest.account.homeAccountId);
11959
+ return JSON.stringify({
11960
+ ...thumbprint,
11961
+ ...commonKeyFields,
11962
+ accountTenantId: nonNativeRequest.account.tenantId,
11963
+ accountEnvironment: nonNativeRequest.account.environment,
11964
+ refreshTokenExpirationOffsetSeconds: nonNativeRequest.refreshTokenExpirationOffsetSeconds,
11965
+ extraQueryParameters: canonicalizeRequestValues(nonNativeRequest.extraQueryParameters),
11966
+ skipBrokerClaims: thumbprint.embeddedClientId || nonNativeRequest.extraParameters?.["brk_client_id"] ? nonNativeRequest.skipBrokerClaims : void 0
11967
+ });
11968
+ }
11969
+ /**
11970
+ * Copies mutable native request values so execution cannot diverge from the stored key.
11971
+ */
11972
+ function snapshotNativeRequest(request) {
11973
+ return {
11974
+ ...request,
11975
+ scopes: [...request.scopes],
11976
+ extraParameters: request.extraParameters ? { ...request.extraParameters } : void 0,
11977
+ extraScopesToConsent: request.extraScopesToConsent ? [...request.extraScopesToConsent] : void 0
11978
+ };
11979
+ }
11980
+ /**
11981
+ * Canonicalizes scope sets and request dictionaries without changing the outgoing request.
11982
+ */
11983
+ function canonicalizeRequestValues(values) {
11984
+ if (Array.isArray(values)) return Array.from(new Set(values.map((scope) => scope.trim()).filter((scope) => scope.length > 0))).sort();
11985
+ return values ? Object.keys(values).sort().map((key) => [key, values[key]]) : void 0;
11986
+ }
11987
+ /**
11988
+ * Applies the caller's correlation ID to successful results.
11989
+ * Shared failures retain the original error and underlying operation correlation ID.
11990
+ */
11991
+ function applyCallerCorrelationIdToResult(activeRequest, correlationId) {
11992
+ return activeRequest.then((result) => ({
11993
+ ...result,
11994
+ correlationId
11995
+ }));
11996
+ }
11997
+ //#endregion
11892
11998
  //#region node_modules/@azure/msal-node/dist/client/ClientApplication.mjs
11893
- /*! @azure/msal-node v6.0.1 2026-09-15 */
11999
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
11894
12000
  /**
11895
12001
  * Base abstract class for all ClientApplications - public and confidential
11896
12002
  * @public
@@ -12001,6 +12107,7 @@ var ClientApplication = class {
12001
12107
  *
12002
12108
  * This API expects the user to provide an account object and looks into the cache to retrieve the token if present.
12003
12109
  * There is also an optional "forceRefresh" boolean the user can send to bypass the cache for access_token and id_token.
12110
+ * Concurrent requests with the same request thumbprint return the same in-progress result.
12004
12111
  * In case the refresh_token is expired or not found, an error is thrown
12005
12112
  * and the guidance is for the user to call any interactive token acquisition API (eg: `acquireTokenByCode()`).
12006
12113
  */
@@ -12010,9 +12117,19 @@ var ClientApplication = class {
12010
12117
  ...await this.initializeBaseRequest(request),
12011
12118
  forceRefresh: request.forceRefresh || false
12012
12119
  };
12120
+ if (!validRequest.account) return this.acquireTokenSilentAsync(validRequest, request.azureCloudOptions);
12121
+ const silentRequestKey = getSilentRequestKey({
12122
+ requestType: "non-native",
12123
+ request: validRequest,
12124
+ authority: Authority.generateAuthority(validRequest.authority, request.azureCloudOptions || this.config.auth.azureCloudOptions),
12125
+ clientId: this.config.auth.clientId
12126
+ });
12127
+ return acquireTokenSilentDeduped(this, this.logger, silentRequestKey, validRequest.correlationId, () => this.acquireTokenSilentAsync(validRequest, request.azureCloudOptions));
12128
+ }
12129
+ async acquireTokenSilentAsync(validRequest, azureCloudOptions) {
12013
12130
  const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent, validRequest.correlationId, validRequest.forceRefresh);
12014
12131
  try {
12015
- const discoveredAuthority = await this.createAuthority(validRequest.authority, validRequest.correlationId, void 0, request.azureCloudOptions);
12132
+ const discoveredAuthority = await this.createAuthority(validRequest.authority, validRequest.correlationId, void 0, azureCloudOptions);
12016
12133
  const clientConfiguration = await this.buildOauthClientConfiguration(discoveredAuthority, validRequest.correlationId, validRequest.redirectUri || "", serverTelemetryManager);
12017
12134
  const silentFlowClient = new SilentFlowClient(clientConfiguration, new StubPerformanceClient());
12018
12135
  this.logger.verbose("Silent flow client created", validRequest.correlationId);
@@ -12210,7 +12327,7 @@ var ClientApplication = class {
12210
12327
  };
12211
12328
  //#endregion
12212
12329
  //#region node_modules/@azure/msal-node/dist/network/LoopbackClient.mjs
12213
- /*! @azure/msal-node v6.0.1 2026-09-15 */
12330
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
12214
12331
  var LoopbackClient = class {
12215
12332
  constructor(preferredPort) {
12216
12333
  this.preferredPort = preferredPort;
@@ -12252,12 +12369,9 @@ var LoopbackClient = class {
12252
12369
  res.end();
12253
12370
  return;
12254
12371
  }
12255
- if (authCodeResponse.code) {
12256
- res.writeHead(302, { location: redirectUri });
12257
- res.end();
12258
- }
12259
- if (authCodeResponse.error) res.end(errorTemplate || `Error occurred: ${authCodeResponse.error}`);
12260
- resolve(authCodeResponse);
12372
+ res.writeHead(400);
12373
+ res.end("OAuth responses must use form_post and cannot be returned in the URL.");
12374
+ reject(NodeAuthError.createLoopbackServerQueryResponseNotSupportedError());
12261
12375
  } else {
12262
12376
  res.writeHead(200);
12263
12377
  res.end();
@@ -12333,7 +12447,7 @@ var LoopbackClient = class {
12333
12447
  };
12334
12448
  //#endregion
12335
12449
  //#region node_modules/@azure/msal-node/dist/client/DeviceCodeClient.mjs
12336
- /*! @azure/msal-node v6.0.1 2026-09-15 */
12450
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
12337
12451
  /**
12338
12452
  * OAuth2.0 Device code client
12339
12453
  * @public
@@ -12507,7 +12621,7 @@ var DeviceCodeClient = class extends BaseClient {
12507
12621
  };
12508
12622
  //#endregion
12509
12623
  //#region node_modules/@azure/msal-node/dist/client/PublicClientApplication.mjs
12510
- /*! @azure/msal-node v6.0.1 2026-09-15 */
12624
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
12511
12625
  /**
12512
12626
  * This class is to be used to acquire tokens for public client applications (desktop, mobile). Public client applications
12513
12627
  * are not trusted to safely store application secrets, and therefore can only request tokens in the name of an user.
@@ -12600,8 +12714,8 @@ var PublicClientApplication = class extends ClientApplication {
12600
12714
  }
12601
12715
  const { verifier, challenge } = await this.cryptoProvider.generatePkceCodes();
12602
12716
  const loopbackClient = new LoopbackClient(preferredPort);
12603
- const responseMode = remainingProperties.responseMode ?? ResponseMode$1.FORM_POST;
12604
- if (responseMode !== ResponseMode$1.QUERY && responseMode !== ResponseMode$1.FORM_POST) throw createClientConfigurationError(invalidResponseMode, correlationId);
12717
+ const responseMode = remainingProperties.responseMode;
12718
+ if (responseMode !== void 0 && responseMode !== ResponseMode$1.FORM_POST) throw createClientConfigurationError(invalidResponseMode, correlationId);
12605
12719
  let authCodeResponse = {};
12606
12720
  let authCodeListenerError = null;
12607
12721
  try {
@@ -12616,7 +12730,7 @@ var PublicClientApplication = class extends ClientApplication {
12616
12730
  correlationId,
12617
12731
  scopes: request.scopes || OIDC_DEFAULT_SCOPES,
12618
12732
  redirectUri,
12619
- responseMode,
12733
+ responseMode: ResponseMode$1.FORM_POST,
12620
12734
  codeChallenge: challenge,
12621
12735
  codeChallengeMethod: CodeChallengeMethodValues.S256
12622
12736
  };
@@ -12647,7 +12761,8 @@ var PublicClientApplication = class extends ClientApplication {
12647
12761
  this.logger.trace("acquireTokenSilent called", correlationId);
12648
12762
  enforceResourceParameter(this.config.auth.isMcp, request);
12649
12763
  if (this.nativeBrokerPlugin) {
12650
- const brokerRequest = {
12764
+ const nativeBrokerPlugin = this.nativeBrokerPlugin;
12765
+ const brokerRequest = snapshotNativeRequest({
12651
12766
  ...request,
12652
12767
  clientId: this.config.auth.clientId,
12653
12768
  scopes: request.scopes || OIDC_DEFAULT_SCOPES,
@@ -12661,8 +12776,12 @@ var PublicClientApplication = class extends ClientApplication {
12661
12776
  },
12662
12777
  accountId: request.account.nativeAccountId,
12663
12778
  forceRefresh: request.forceRefresh || false
12664
- };
12665
- return this.nativeBrokerPlugin.acquireTokenSilent(brokerRequest);
12779
+ });
12780
+ const silentRequestKey = getSilentRequestKey({
12781
+ requestType: "native",
12782
+ request: brokerRequest
12783
+ });
12784
+ return acquireTokenSilentDeduped(this, this.logger, silentRequestKey, correlationId, () => nativeBrokerPlugin.acquireTokenSilent(brokerRequest));
12666
12785
  }
12667
12786
  if (request.redirectUri) {
12668
12787
  if (!this.config.broker.nativeBrokerPlugin) throw NodeAuthError.createRedirectUriNotSupportedError(correlationId);
@@ -12748,19 +12867,19 @@ var PublicClientApplication = class extends ClientApplication {
12748
12867
  };
12749
12868
  //#endregion
12750
12869
  //#region node_modules/@azure/msal-node/dist/client/ClientCredentialClient.mjs
12751
- /*! @azure/msal-node v6.0.1 2026-09-15 */
12870
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
12752
12871
  //#endregion
12753
12872
  //#region node_modules/@azure/msal-node/dist/client/OnBehalfOfClient.mjs
12754
- /*! @azure/msal-node v6.0.1 2026-09-15 */
12873
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
12755
12874
  //#endregion
12756
12875
  //#region node_modules/@azure/msal-node/dist/client/UserFederatedIdentityCredentialClient.mjs
12757
- /*! @azure/msal-node v6.0.1 2026-09-15 */
12876
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
12758
12877
  //#endregion
12759
12878
  //#region node_modules/@azure/msal-node/dist/client/ConfidentialClientApplication.mjs
12760
- /*! @azure/msal-node v6.0.1 2026-09-15 */
12879
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
12761
12880
  //#endregion
12762
12881
  //#region node_modules/@azure/msal-node/dist/utils/TimeUtils.mjs
12763
- /*! @azure/msal-node v6.0.1 2026-09-15 */
12882
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
12764
12883
  /**
12765
12884
  * @internal
12766
12885
  * Checks if a given date string is in ISO 8601 format.
@@ -12775,7 +12894,7 @@ function isIso8601(dateString) {
12775
12894
  }
12776
12895
  //#endregion
12777
12896
  //#region node_modules/@azure/msal-node/dist/network/HttpClientWithRetries.mjs
12778
- /*! @azure/msal-node v6.0.1 2026-09-15 */
12897
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
12779
12898
  var HttpClientWithRetries = class {
12780
12899
  constructor(httpClientNoRetries, retryPolicy, logger) {
12781
12900
  this.httpClientNoRetries = httpClientNoRetries;
@@ -12805,7 +12924,7 @@ var HttpClientWithRetries = class {
12805
12924
  };
12806
12925
  //#endregion
12807
12926
  //#region node_modules/@azure/msal-node/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs
12808
- /*! @azure/msal-node v6.0.1 2026-09-15 */
12927
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
12809
12928
  /**
12810
12929
  * Managed Identity User Assigned Id Query Parameter Names
12811
12930
  */
@@ -12995,21 +13114,21 @@ BaseManagedIdentitySource.getValidatedEnvVariableUrlString = (envVariableStringN
12995
13114
  throw createManagedIdentityError(MsiEnvironmentVariableUrlMalformedErrorCodes[envVariableStringName], "");
12996
13115
  }
12997
13116
  };
12998
- /*! @azure/msal-node v6.0.1 2026-09-15 */
12999
- /*! @azure/msal-node v6.0.1 2026-09-15 */
13000
- /*! @azure/msal-node v6.0.1 2026-09-15 */
13001
- /*! @azure/msal-node v6.0.1 2026-09-15 */
13117
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
13118
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
13119
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
13120
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
13002
13121
  `${process.env["ProgramData"]}`;
13003
13122
  `${process.env["ProgramFiles"]}`;
13004
- /*! @azure/msal-node v6.0.1 2026-09-15 */
13005
- /*! @azure/msal-node v6.0.1 2026-09-15 */
13006
- /*! @azure/msal-node v6.0.1 2026-09-15 */
13007
- /*! @azure/msal-node v6.0.1 2026-09-15 */
13008
- /*! @azure/msal-node v6.0.1 2026-09-15 */
13123
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
13124
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
13125
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
13126
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
13127
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
13009
13128
  `${ManagedIdentitySourceNames.MACHINE_LEARNING}`;
13010
- /*! @azure/msal-node v6.0.1 2026-09-15 */
13011
- /*! @azure/msal-node v6.0.1 2026-09-15 */
13129
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
13130
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
13012
13131
  ManagedIdentitySourceNames.SERVICE_FABRIC;
13013
- /*! @azure/msal-node v6.0.1 2026-09-15 */
13132
+ /*! @azure/msal-node v7.0.1 2026-10-02 */
13014
13133
  //#endregion
13015
13134
  export { CryptoProvider, PublicClientApplication };
@@ -1,4 +1,4 @@
1
- import { C as SECRETS_FILE, S as CONFIG_DIR, _ as createLogger, c as AUTHORITY, f as REDIRECT_URI, h as createCachePlugin, m as authCodeFromUrl, o as object, p as SYDNEY_SCOPES, s as string, u as CLIENT_ID, v as ensurePrivateDir } from "./server-Buz1ZIg5.mjs";
1
+ import { C as SECRETS_FILE, S as CONFIG_DIR, _ as createLogger, c as AUTHORITY, f as REDIRECT_URI, h as createCachePlugin, m as authCodeFromUrl, o as object, p as SYDNEY_SCOPES, s as string, u as CLIENT_ID, v as ensurePrivateDir } from "./server-DQW-8ns2.mjs";
2
2
  import { chmodSync, existsSync, readFileSync, statSync } from "node:fs";
3
3
  import { join } from "node:path";
4
4
  //#region src/login.ts
@@ -96,7 +96,7 @@ async function login(options = {}) {
96
96
  const secrets = loadSecrets(options.secretsFile);
97
97
  const interactive = options.interactive ?? !secrets?.mfaSecret;
98
98
  if (!interactive && !secrets) throw new Error(`No credentials at ${options.secretsFile ?? SECRETS_FILE}. Create it with { "email", "password", "mfaSecret" }, or sign in interactively with --interactive.`);
99
- const { PublicClientApplication, CryptoProvider } = await import("./dist-BGVW-hOf.mjs");
99
+ const { PublicClientApplication, CryptoProvider } = await import("./dist-CMVPFMhc.mjs");
100
100
  const app = new PublicClientApplication({
101
101
  auth: {
102
102
  clientId: CLIENT_ID,
package/dist/plugin.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { A as resolveOptions, D as buildModelInfos, E as applyPluginConfig, N as isLocalModel, O as buildProviderInfo, T as PROVIDER_ID, _ as createLogger, a as startServer, g as createTokenClient, j as DEFAULT_MODEL, r as SESSION_ID_HEADER, t as AUX_REQUEST_KIND_HEADER, w as PLUGIN_ID } from "./server-Buz1ZIg5.mjs";
2
- import { t as getOrCreateAgent } from "./agent-C28PfLXM.mjs";
1
+ import { A as resolveOptions, D as buildModelInfos, E as applyPluginConfig, N as isLocalModel, O as buildProviderInfo, T as PROVIDER_ID, _ as createLogger, a as startServer, g as createTokenClient, j as DEFAULT_MODEL, r as SESSION_ID_HEADER, t as AUX_REQUEST_KIND_HEADER, w as PLUGIN_ID } from "./server-DQW-8ns2.mjs";
2
+ import { t as getOrCreateAgent } from "./agent-Cd7BGDdu.mjs";
3
3
  //#region src/runtime.ts
4
4
  /**
5
5
  * The part of the plugin that is the same under both opencode plugin APIs.
@@ -1004,7 +1004,7 @@ function createTokenClient(options = {}) {
1004
1004
  const cache = /* @__PURE__ */ new Map();
1005
1005
  async function client() {
1006
1006
  if (app) return app;
1007
- const { PublicClientApplication } = await import("./dist-BGVW-hOf.mjs");
1007
+ const { PublicClientApplication } = await import("./dist-CMVPFMhc.mjs");
1008
1008
  app = new PublicClientApplication({
1009
1009
  auth: {
1010
1010
  clientId: CLIENT_ID,
@@ -3172,11 +3172,16 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3172
3172
  this._bufferedAmount = 0;
3173
3173
  this._isServer = false;
3174
3174
  this._redirects = 0;
3175
- if (protocols === void 0) protocols = [];
3176
- else if (!Array.isArray(protocols)) {
3175
+ if (protocols === void 0) {
3176
+ if (!options || options.protocols === void 0) protocols = [];
3177
+ else if (Array.isArray(options.protocols)) protocols = options.protocols;
3178
+ else protocols = [options.protocols];
3179
+ } else if (!Array.isArray(protocols)) {
3177
3180
  if (typeof protocols === "object" && protocols !== null) {
3178
3181
  options = protocols;
3179
- protocols = [];
3182
+ if (options.protocols === void 0) protocols = [];
3183
+ else if (Array.isArray(options.protocols)) protocols = options.protocols;
3184
+ else protocols = [options.protocols];
3180
3185
  } else protocols = [protocols];
3181
3186
  }
3182
3187
  initAsClient(this, address, protocols, options);
@@ -3366,12 +3371,12 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3366
3371
  if (this._closeFrameSent && (this._closeFrameReceived || this._receiver._writableState.errorEmitted)) this._socket.end();
3367
3372
  return;
3368
3373
  }
3369
- this._readyState = WebSocket.CLOSING;
3370
3374
  this._sender.close(code, data, !this._isServer, (err) => {
3371
3375
  if (err) return;
3372
3376
  this._closeFrameSent = true;
3373
3377
  if (this._closeFrameReceived || this._receiver._writableState.errorEmitted) this._socket.end();
3374
3378
  });
3379
+ this._readyState = WebSocket.CLOSING;
3375
3380
  setCloseTimer(this);
3376
3381
  }
3377
3382
  /**
@@ -3654,6 +3659,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3654
3659
  socketPath: void 0,
3655
3660
  hostname: void 0,
3656
3661
  protocol: void 0,
3662
+ protocols: void 0,
3657
3663
  timeout: void 0,
3658
3664
  method: "GET",
3659
3665
  host: void 0,
@@ -4814,7 +4820,10 @@ var CopilotSession = class {
4814
4820
  };
4815
4821
  turn.signal?.addEventListener("abort", onAbort, { once: true });
4816
4822
  socket.on("error", (error) => finish(error instanceof Error ? error : new Error(String(error))));
4817
- socket.on("close", () => finish());
4823
+ socket.on("close", (code, reason) => {
4824
+ const why = reason.toString();
4825
+ finish(/* @__PURE__ */ new Error(`M365 connection closed before the turn completed (code ${code}${why ? `: ${why}` : ""})`));
4826
+ });
4818
4827
  socket.on("open", () => {
4819
4828
  socket.send(`${JSON.stringify({
4820
4829
  protocol: "json",
@@ -10702,7 +10711,10 @@ async function startServer(deps) {
10702
10711
  const agentId = async () => {
10703
10712
  if (!deps.resolveAgent) return null;
10704
10713
  agentPromise ??= deps.resolveAgent().catch((error) => {
10705
- log.warn("could not resolve a declarative agent; continuing without one", String(error));
10714
+ const status = error?.status;
10715
+ const permanent = status === 401 || status === 403;
10716
+ log.warn(permanent ? "no Copilot Studio access; continuing without a declarative agent" : "could not resolve a declarative agent; continuing without one and retrying next time", String(error));
10717
+ if (!permanent) agentPromise = void 0;
10706
10718
  return null;
10707
10719
  });
10708
10720
  return agentPromise;
package/dist/server.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { a as startServer, i as generateApiKey, j as DEFAULT_MODEL, n as DEFAULT_MAX_BODY_BYTES, r as SESSION_ID_HEADER, t as AUX_REQUEST_KIND_HEADER } from "./server-Buz1ZIg5.mjs";
1
+ import { a as startServer, i as generateApiKey, j as DEFAULT_MODEL, n as DEFAULT_MAX_BODY_BYTES, r as SESSION_ID_HEADER, t as AUX_REQUEST_KIND_HEADER } from "./server-DQW-8ns2.mjs";
2
2
  export { AUX_REQUEST_KIND_HEADER, DEFAULT_MAX_BODY_BYTES, DEFAULT_MODEL, SESSION_ID_HEADER, generateApiKey, startServer };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-m365-copilot",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "Use your org's Microsoft 365 Copilot as the model backend for opencode",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -32,7 +32,7 @@
32
32
  "typecheck": "tsc --noEmit"
33
33
  },
34
34
  "dependencies": {
35
- "@azure/msal-node": "^6.0.0",
35
+ "@azure/msal-node": "^7.0.0",
36
36
  "otpauth": "^9.5.0",
37
37
  "ws": "^8.20.0",
38
38
  "zod": "^4.3.6"