@microsoft/agents-hosting 1.6.0-beta.9.gce9d8facd2 → 1.7.0-beta.1.g8bcd4f11a7

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 (149) hide show
  1. package/dist/package.json +4 -9
  2. package/dist/src/agent-client/agentClient.js +2 -2
  3. package/dist/src/agent-client/agentClient.js.map +1 -1
  4. package/dist/src/agent-client/agentResponseHandler.js +2 -2
  5. package/dist/src/agent-client/agentResponseHandler.js.map +1 -1
  6. package/dist/src/app/agentApplication.js +28 -2
  7. package/dist/src/app/agentApplication.js.map +1 -1
  8. package/dist/src/app/agentApplicationOptions.d.ts +10 -0
  9. package/dist/src/app/attachmentDownloader.js +5 -10
  10. package/dist/src/app/attachmentDownloader.js.map +1 -1
  11. package/dist/src/app/auth/authorizationManager.d.ts +4 -0
  12. package/dist/src/app/auth/authorizationManager.js +94 -67
  13. package/dist/src/app/auth/authorizationManager.js.map +1 -1
  14. package/dist/src/app/auth/handlers/azureBotAuthorization.js +2 -2
  15. package/dist/src/app/auth/handlers/azureBotAuthorization.js.map +1 -1
  16. package/dist/src/app/proactive/createConversationOptionsBuilder.js +10 -6
  17. package/dist/src/app/proactive/createConversationOptionsBuilder.js.map +1 -1
  18. package/dist/src/app/proactive/proactive.d.ts +1 -0
  19. package/dist/src/app/proactive/proactive.js +30 -15
  20. package/dist/src/app/proactive/proactive.js.map +1 -1
  21. package/dist/src/app/streaming/streamingResponse.d.ts +11 -0
  22. package/dist/src/app/streaming/streamingResponse.js +21 -0
  23. package/dist/src/app/streaming/streamingResponse.js.map +1 -1
  24. package/dist/src/app/teamsAttachmentDownloader.js +6 -14
  25. package/dist/src/app/teamsAttachmentDownloader.js.map +1 -1
  26. package/dist/src/auth/MemoryCache.d.ts +2 -1
  27. package/dist/src/auth/MemoryCache.js +7 -1
  28. package/dist/src/auth/MemoryCache.js.map +1 -1
  29. package/dist/src/auth/authConfiguration.d.ts +2 -143
  30. package/dist/src/auth/authConfiguration.js +336 -257
  31. package/dist/src/auth/authConfiguration.js.map +1 -1
  32. package/dist/src/auth/authConstants.d.ts +7 -7
  33. package/dist/src/auth/authConstants.js.map +1 -1
  34. package/dist/src/auth/connectionManager.d.ts +92 -0
  35. package/dist/src/auth/{msalConnectionManager.js → connectionManager.js} +48 -33
  36. package/dist/src/auth/connectionManager.js.map +1 -0
  37. package/dist/src/auth/index.d.ts +5 -3
  38. package/dist/src/auth/index.js +5 -3
  39. package/dist/src/auth/index.js.map +1 -1
  40. package/dist/src/auth/jwt-middleware.d.ts +6 -0
  41. package/dist/src/auth/jwt-middleware.js +34 -2
  42. package/dist/src/auth/jwt-middleware.js.map +1 -1
  43. package/dist/src/auth/msal/msalConnectionManager.d.ts +17 -0
  44. package/dist/src/auth/msal/msalConnectionManager.js +50 -0
  45. package/dist/src/auth/msal/msalConnectionManager.js.map +1 -0
  46. package/dist/src/auth/msal/msalConnectionSettings.d.ts +68 -0
  47. package/dist/src/auth/msal/msalConnectionSettings.js +7 -0
  48. package/dist/src/auth/msal/msalConnectionSettings.js.map +1 -0
  49. package/dist/src/auth/{msalTokenCredential.d.ts → msal/msalTokenCredential.d.ts} +1 -1
  50. package/dist/src/auth/{msalTokenCredential.js → msal/msalTokenCredential.js} +2 -2
  51. package/dist/src/auth/msal/msalTokenCredential.js.map +1 -0
  52. package/dist/src/auth/{msalTokenProvider.d.ts → msal/msalTokenProvider.d.ts} +30 -3
  53. package/dist/src/auth/msal/msalTokenProvider.js +733 -0
  54. package/dist/src/auth/msal/msalTokenProvider.js.map +1 -0
  55. package/dist/src/auth/settings.d.ts +336 -0
  56. package/dist/src/auth/settings.js +202 -0
  57. package/dist/src/auth/settings.js.map +1 -0
  58. package/dist/src/auth/sidecar/sidecarAuthProvider.d.ts +74 -0
  59. package/dist/src/auth/sidecar/sidecarAuthProvider.js +181 -0
  60. package/dist/src/auth/sidecar/sidecarAuthProvider.js.map +1 -0
  61. package/dist/src/auth/sidecar/sidecarConnectionSettings.d.ts +65 -0
  62. package/dist/src/auth/sidecar/sidecarConnectionSettings.js +7 -0
  63. package/dist/src/auth/sidecar/sidecarConnectionSettings.js.map +1 -0
  64. package/dist/src/auth/sidecar/sidecarHttpClient.d.ts +95 -0
  65. package/dist/src/auth/sidecar/sidecarHttpClient.js +406 -0
  66. package/dist/src/auth/sidecar/sidecarHttpClient.js.map +1 -0
  67. package/dist/src/auth/sidecar/sidecarModels.d.ts +110 -0
  68. package/dist/src/auth/sidecar/sidecarModels.js +48 -0
  69. package/dist/src/auth/sidecar/sidecarModels.js.map +1 -0
  70. package/dist/src/auth/sidecar/sidecarTokenExpiry.d.ts +13 -0
  71. package/dist/src/auth/sidecar/sidecarTokenExpiry.js +39 -0
  72. package/dist/src/auth/sidecar/sidecarTokenExpiry.js.map +1 -0
  73. package/dist/src/cloudAdapter.d.ts +58 -1
  74. package/dist/src/cloudAdapter.js +233 -53
  75. package/dist/src/cloudAdapter.js.map +1 -1
  76. package/dist/src/connector-client/connectorClient.d.ts +12 -8
  77. package/dist/src/connector-client/connectorClient.js +99 -82
  78. package/dist/src/connector-client/connectorClient.js.map +1 -1
  79. package/dist/src/errorHelper.js +181 -7
  80. package/dist/src/errorHelper.js.map +1 -1
  81. package/dist/src/getProductInfo.d.ts +23 -0
  82. package/dist/src/getProductInfo.js +71 -1
  83. package/dist/src/getProductInfo.js.map +1 -1
  84. package/dist/src/headerPropagation.d.ts +17 -2
  85. package/dist/src/headerPropagation.js +46 -24
  86. package/dist/src/headerPropagation.js.map +1 -1
  87. package/dist/src/httpClient.d.ts +60 -0
  88. package/dist/src/httpClient.js +173 -0
  89. package/dist/src/httpClient.js.map +1 -0
  90. package/dist/src/index.d.ts +3 -2
  91. package/dist/src/index.js +8 -2
  92. package/dist/src/index.js.map +1 -1
  93. package/dist/src/oauth/userTokenClient.d.ts +17 -4
  94. package/dist/src/oauth/userTokenClient.js +119 -80
  95. package/dist/src/oauth/userTokenClient.js.map +1 -1
  96. package/dist/src/observability/traces.d.ts +11 -4
  97. package/dist/src/observability/traces.js +39 -7
  98. package/dist/src/observability/traces.js.map +1 -1
  99. package/dist/src/utils/env.d.ts +50 -0
  100. package/dist/src/utils/env.js +113 -0
  101. package/dist/src/utils/env.js.map +1 -0
  102. package/dist/src/utils.d.ts +10 -0
  103. package/dist/src/utils.js +18 -0
  104. package/dist/src/utils.js.map +1 -0
  105. package/package.json +4 -9
  106. package/src/agent-client/agentClient.ts +2 -2
  107. package/src/agent-client/agentResponseHandler.ts +2 -2
  108. package/src/app/agentApplication.ts +30 -3
  109. package/src/app/agentApplicationOptions.ts +11 -0
  110. package/src/app/attachmentDownloader.ts +6 -8
  111. package/src/app/auth/authorizationManager.ts +84 -41
  112. package/src/app/auth/handlers/azureBotAuthorization.ts +2 -2
  113. package/src/app/proactive/createConversationOptionsBuilder.ts +8 -4
  114. package/src/app/proactive/proactive.ts +39 -23
  115. package/src/app/streaming/streamingResponse.ts +24 -1
  116. package/src/app/teamsAttachmentDownloader.ts +7 -11
  117. package/src/auth/MemoryCache.ts +7 -1
  118. package/src/auth/authConfiguration.ts +350 -356
  119. package/src/auth/authConstants.ts +7 -7
  120. package/src/auth/{msalConnectionManager.ts → connectionManager.ts} +65 -44
  121. package/src/auth/index.ts +5 -3
  122. package/src/auth/jwt-middleware.ts +32 -2
  123. package/src/auth/msal/msalConnectionManager.ts +55 -0
  124. package/src/auth/msal/msalConnectionSettings.ts +79 -0
  125. package/src/auth/{msalTokenCredential.ts → msal/msalTokenCredential.ts} +2 -1
  126. package/src/auth/msal/msalTokenProvider.ts +881 -0
  127. package/src/auth/settings.ts +378 -0
  128. package/src/auth/sidecar/sidecarAuthProvider.ts +234 -0
  129. package/src/auth/sidecar/sidecarConnectionSettings.ts +72 -0
  130. package/src/auth/sidecar/sidecarHttpClient.ts +443 -0
  131. package/src/auth/sidecar/sidecarModels.ts +153 -0
  132. package/src/auth/sidecar/sidecarTokenExpiry.ts +35 -0
  133. package/src/cloudAdapter.ts +292 -13
  134. package/src/connector-client/connectorClient.ts +116 -94
  135. package/src/errorHelper.ts +206 -7
  136. package/src/getProductInfo.ts +79 -1
  137. package/src/headerPropagation.ts +55 -23
  138. package/src/httpClient.ts +223 -0
  139. package/src/index.ts +6 -2
  140. package/src/oauth/userTokenClient.ts +137 -84
  141. package/src/observability/traces.ts +39 -8
  142. package/src/utils/env.ts +105 -0
  143. package/src/utils.ts +14 -0
  144. package/dist/src/auth/msalConnectionManager.d.ts +0 -64
  145. package/dist/src/auth/msalConnectionManager.js.map +0 -1
  146. package/dist/src/auth/msalTokenCredential.js.map +0 -1
  147. package/dist/src/auth/msalTokenProvider.js +0 -485
  148. package/dist/src/auth/msalTokenProvider.js.map +0 -1
  149. package/src/auth/msalTokenProvider.ts +0 -562
@@ -1,12 +1,12 @@
1
1
  // Copyright (c) Microsoft Corporation. All rights reserved.
2
2
  // Licensed under the MIT License.
3
3
 
4
- import axios, { AxiosInstance } from 'axios'
4
+ import { HttpClient, HttpError } from '../httpClient'
5
5
  import { Activity, ConversationReference } from '@microsoft/agents-activity'
6
6
  import { debug } from '@microsoft/agents-telemetry'
7
7
  import { normalizeTokenExchangeState } from '../activityWireCompat'
8
8
  import { AadResourceUrls, SignInResource, TokenExchangeRequest, TokenOrSinginResourceResponse, TokenResponse, TokenStatus } from './userTokenClient.types'
9
- import { getProductInfo } from '../getProductInfo'
9
+ import { applyUserAgentHeader, getProductInfo } from '../getProductInfo'
10
10
  import { AuthProvider } from '../auth'
11
11
  import { HeaderPropagation, HeaderPropagationCollection } from '../headerPropagation'
12
12
  import { getTokenServiceEndpoint } from './customUserTokenAPI'
@@ -15,12 +15,30 @@ import { UserTokenClientTraceDefinitions } from '../observability'
15
15
 
16
16
  const logger = debug('agents:user-token-client')
17
17
 
18
+ function formatHttpErrorMessage (error: HttpError): string {
19
+ const responseData = error.response?.data
20
+ if (responseData === undefined) {
21
+ return error.message
22
+ }
23
+
24
+ try {
25
+ const serializedResponseData = JSON.stringify(responseData)
26
+ return serializedResponseData === undefined ? error.message : `${error.message}: ${serializedResponseData}`
27
+ } catch {
28
+ return error.message
29
+ }
30
+ }
31
+
18
32
  /**
19
33
  * Client for managing user tokens.
20
34
  */
21
35
  export class UserTokenClient {
22
- client: AxiosInstance
36
+ client: HttpClient
23
37
  private msAppId: string = ''
38
+ private authProvider?: AuthProvider
39
+ private authScope?: string
40
+ private authInitialized = false
41
+ private authInitialization?: Promise<void>
24
42
  /**
25
43
  * Creates a new instance of UserTokenClient.
26
44
  * @param msAppId The Microsoft application ID.
@@ -28,14 +46,21 @@ export class UserTokenClient {
28
46
  constructor (msAppId: string)
29
47
  /**
30
48
  * Creates a new instance of UserTokenClient.
31
- * @param axiosInstance The axios instance.
49
+ * @param httpClient The HttpClient instance.
50
+ */
51
+ constructor (httpClient: HttpClient)
52
+ /**
53
+ * Creates a new instance of UserTokenClient with lazy authentication.
54
+ * @param httpClient The HttpClient instance.
55
+ * @param authProvider The authentication provider.
56
+ * @param authScope The authentication scope.
32
57
  */
33
- constructor (axiosInstance: AxiosInstance)
58
+ constructor (httpClient: HttpClient, authProvider?: AuthProvider, authScope?: string)
34
59
 
35
- constructor (param: string | AxiosInstance) {
60
+ constructor (param: string | HttpClient, authProvider?: AuthProvider, authScope?: string) {
36
61
  if (typeof param === 'string') {
37
62
  const baseURL = getTokenServiceEndpoint()
38
- this.client = axios.create({
63
+ this.client = new HttpClient({
39
64
  baseURL,
40
65
  headers: {
41
66
  Accept: 'application/json',
@@ -46,54 +71,9 @@ export class UserTokenClient {
46
71
  this.client = param
47
72
  }
48
73
 
49
- this.client.interceptors.request.use((config) => {
50
- const { method, url, data, headers, params } = config
51
- const { Authorization, authorization, ...headersToLog } = headers || {}
52
- logger.debug('Request: ', {
53
- host: this.client.getUri(),
54
- url,
55
- data,
56
- method,
57
- params,
58
- headers: headersToLog
59
- })
60
- return config
61
- })
62
-
63
- this.client.interceptors.response.use(
64
- (config) => {
65
- const { status, statusText, config: requestConfig, headers } = config
66
- const { Authorization, authorization, ...headersToLog } = headers || {}
67
- const { token, ...redactedData } = requestConfig?.data || {}
68
- logger.debug('Response: ', {
69
- status,
70
- statusText,
71
- host: this.client.getUri(),
72
- url: requestConfig?.url,
73
- data: redactedData,
74
- method: requestConfig?.method,
75
- headers: headersToLog
76
- })
77
- return config
78
- },
79
- (error) => {
80
- const { code, status, message, stack, response } = error
81
- const { headers } = response || {}
82
- const errorDetails = {
83
- code,
84
- host: this.client.getUri(),
85
- url: error.config.url,
86
- method: error.config.method,
87
- data: error.config.data,
88
- message: message + JSON.stringify(response?.data),
89
- headers,
90
- stack,
91
- }
92
- logger.debug('Response error: ', errorDetails)
93
- if (errorDetails.url === '/api/usertoken/GetToken' && status !== 404) {
94
- return Promise.reject(errorDetails)
95
- }
96
- })
74
+ this.authProvider = authProvider
75
+ this.authScope = authScope
76
+ this.authInitialized = Boolean(this.client.defaultHeaders.authorization)
97
77
  }
98
78
 
99
79
  /**
@@ -112,29 +92,18 @@ export class UserTokenClient {
112
92
  headers?: HeaderPropagationCollection
113
93
  ): Promise<UserTokenClient> {
114
94
  const headerPropagation = headers ?? new HeaderPropagation({})
115
- const userAgent = headerPropagation.outgoing['user-agent']
116
- const productInfo = getProductInfo()
117
- if (!userAgent) {
118
- headerPropagation.add({ 'User-Agent': productInfo })
119
- } else if (!userAgent.includes(productInfo)) {
120
- headerPropagation.concat({ 'User-Agent': productInfo })
121
- }
95
+ applyUserAgentHeader(headerPropagation)
122
96
  headerPropagation.override({
123
97
  Accept: 'application/json',
124
- 'Content-Type': 'application/json', // Required by transformRequest
98
+ 'Content-Type': 'application/json',
125
99
  })
126
100
 
127
- const axiosInstance = axios.create({
101
+ const httpClient = new HttpClient({
128
102
  baseURL,
129
- headers: headerPropagation.outgoing,
103
+ headers: { ...headerPropagation.outgoing },
130
104
  })
131
105
 
132
- const token = await authProvider?.getAccessToken(scope)
133
- if (token && token.length > 1) {
134
- axiosInstance.defaults.headers.common.Authorization = `Bearer ${token}`
135
- }
136
-
137
- return new UserTokenClient(axiosInstance)
106
+ return new UserTokenClient(httpClient, authProvider, scope)
138
107
  }
139
108
 
140
109
  /**
@@ -149,13 +118,21 @@ export class UserTokenClient {
149
118
  return trace(UserTokenClientTraceDefinitions.getUserToken, async ({ record }) => {
150
119
  const [channelId] = Activity.parseChannelId(channelIdComposite)
151
120
  const params = { connectionName, channelId, userId, code }
152
- const response = await this.client.get('/api/usertoken/GetToken', { params })
153
- record({ connectionName, channelId, userId, httpStatusCode: response.status?.toString() })
121
+ try {
122
+ const response = await this.executeRequest('get', '/api/usertoken/GetToken', undefined, { params })
123
+ record({ connectionName, channelId, userId, httpStatusCode: response.status?.toString() })
154
124
 
155
- if (response?.data) {
156
- return response.data as TokenResponse
125
+ if (response?.data) {
126
+ return response.data as TokenResponse
127
+ }
128
+ return { token: undefined }
129
+ } catch (error: any) {
130
+ if (error instanceof HttpError && error.status === 404) {
131
+ record({ connectionName, channelId, userId, httpStatusCode: '404' })
132
+ return { token: undefined }
133
+ }
134
+ throw error
157
135
  }
158
- return { token: undefined }
159
136
  })
160
137
  }
161
138
 
@@ -170,7 +147,7 @@ export class UserTokenClient {
170
147
  return trace(UserTokenClientTraceDefinitions.signOut, async ({ record }) => {
171
148
  const [channelId] = Activity.parseChannelId(channelIdComposite)
172
149
  const params = { userId, connectionName, channelId }
173
- const response = await this.client.delete('/api/usertoken/SignOut', { params })
150
+ const response = await this.executeRequest('delete', '/api/usertoken/SignOut', undefined, { params })
174
151
  record({ userId, connectionName, channelId, httpStatusCode: response.status?.toString() })
175
152
  if (response.status !== 200) {
176
153
  throw new Error('Failed to sign out')
@@ -197,7 +174,7 @@ export class UserTokenClient {
197
174
  const tokenExchangeStateNormalized = normalizeTokenExchangeState(tokenExchangeState)
198
175
  const state = Buffer.from(JSON.stringify(tokenExchangeStateNormalized)).toString('base64')
199
176
  const params = { state }
200
- const response = await this.client.get('/api/botsignin/GetSignInResource', { params })
177
+ const response = await this.executeRequest('get', '/api/botsignin/GetSignInResource', undefined, { params })
201
178
  record({ connectionName, httpStatusCode: response.status?.toString() })
202
179
  return response.data as SignInResource
203
180
  })
@@ -215,7 +192,7 @@ export class UserTokenClient {
215
192
  return trace(UserTokenClientTraceDefinitions.exchangeToken, async ({ record }) => {
216
193
  const [channelId] = Activity.parseChannelId(channelIdComposite)
217
194
  const params = { userId, connectionName, channelId }
218
- const response = await this.client.post('/api/usertoken/exchange', tokenExchangeRequest, { params })
195
+ const response = await this.executeRequest('post', '/api/usertoken/exchange', tokenExchangeRequest, { params })
219
196
  record({ userId, connectionName, channelId, httpStatusCode: response.status?.toString() })
220
197
  if (response?.data) {
221
198
  return response.data as TokenResponse
@@ -242,8 +219,8 @@ export class UserTokenClient {
242
219
  const [channelId] = Activity.parseChannelId(channelIdComposite)
243
220
  const state = Buffer.from(JSON.stringify({ conversation, relatesTo, connectionName, msAppId: this.msAppId })).toString('base64')
244
221
  const params = { userId, connectionName, channelId, state, code, finalRedirect, fwdUrl }
245
- const response = await this.client.get('/api/usertoken/GetTokenOrSignInResource', { params })
246
- record({ userId, connectionName, channelId, httpStatusCode: response.status?.toString() })
222
+ const response = await this.executeRequest('get', '/api/usertoken/GetTokenOrSignInResource', undefined, { params })
223
+ record({ userId, connectionName, channelId, httpStatusCode: response?.status?.toString() })
247
224
  return response.data as TokenOrSinginResourceResponse
248
225
  })
249
226
  }
@@ -259,7 +236,7 @@ export class UserTokenClient {
259
236
  return trace(UserTokenClientTraceDefinitions.getTokenStatus, async ({ record }) => {
260
237
  const [channelId] = Activity.parseChannelId(channelIdComposite)
261
238
  const params = { userId, channelId, include }
262
- const response = await this.client.get('/api/usertoken/GetTokenStatus', { params })
239
+ const response = await this.executeRequest('get', '/api/usertoken/GetTokenStatus', undefined, { params })
263
240
  record({ userId, channelId, httpStatusCode: response.status?.toString() })
264
241
  return response.data as TokenStatus[]
265
242
  })
@@ -277,13 +254,89 @@ export class UserTokenClient {
277
254
  return trace(UserTokenClientTraceDefinitions.getAadTokens, async ({ record }) => {
278
255
  const [channelId] = Activity.parseChannelId(channelIdComposite)
279
256
  const params = { userId, connectionName, channelId }
280
- const response = await this.client.post('/api/usertoken/GetAadTokens', resourceUrls, { params })
257
+ const response = await this.executeRequest('post', '/api/usertoken/GetAadTokens', resourceUrls, { params })
281
258
  record({ userId, connectionName, channelId, httpStatusCode: response.status?.toString() })
282
259
  return response.data as Record<string, TokenResponse>
283
260
  })
284
261
  }
285
262
 
286
263
  public updateAuthToken (token: string): void {
287
- this.client.defaults.headers.common.Authorization = `Bearer ${token}`
264
+ this.client.setHeader('Authorization', `Bearer ${token}`)
265
+ this.authInitialized = true
266
+ this.authInitialization = undefined
267
+ }
268
+
269
+ private async executeRequest<T = unknown> (method: string, url: string, data?: unknown, options?: { params?: Record<string, string | undefined> }): Promise<{ data: T, status: number, statusText: string }> {
270
+ await this.ensureAuthorizationHeader()
271
+
272
+ const { params } = options ?? {}
273
+ const { Authorization, authorization, ...headersToLog } = this.client.defaultHeaders
274
+ logger.debug('Request: ', {
275
+ host: this.client.baseURL,
276
+ url,
277
+ data,
278
+ method,
279
+ params,
280
+ headers: headersToLog
281
+ })
282
+
283
+ try {
284
+ const response = await this.client.request<T>({ method, url, data, params })
285
+ const { token: _token, ...redactedData } = (response.config?.data ?? {}) as Record<string, unknown>
286
+ logger.debug('Response: ', {
287
+ status: response.status,
288
+ statusText: response.statusText,
289
+ host: this.client.baseURL,
290
+ url: response.config?.url,
291
+ data: redactedData,
292
+ method: response.config?.method,
293
+ })
294
+ return response
295
+ } catch (error: any) {
296
+ if (error instanceof HttpError) {
297
+ const message = formatHttpErrorMessage(error)
298
+ const errorDetails = {
299
+ host: this.client.baseURL,
300
+ url: error.config.url,
301
+ method: error.config.method,
302
+ data: error.config.data,
303
+ message,
304
+ headers: error.response?.headers,
305
+ stack: error.stack,
306
+ }
307
+ logger.debug('Response error: ', errorDetails)
308
+
309
+ Object.assign(error, {
310
+ host: this.client.baseURL,
311
+ url: error.config.url,
312
+ method: error.config.method,
313
+ data: error.config.data,
314
+ headers: error.response?.headers,
315
+ message,
316
+ })
317
+ }
318
+ throw error
319
+ }
320
+ }
321
+
322
+ private async ensureAuthorizationHeader (): Promise<void> {
323
+ if (this.authInitialized || !this.authProvider || !this.authScope) {
324
+ return
325
+ }
326
+
327
+ if (!this.authInitialization) {
328
+ this.authInitialization = this.authProvider.getAccessToken(this.authScope)
329
+ .then((token) => {
330
+ if (!this.authInitialized && token && token.length > 1) {
331
+ this.client.setHeader('Authorization', `Bearer ${token}`)
332
+ this.authInitialized = true
333
+ }
334
+ })
335
+ .finally(() => {
336
+ this.authInitialization = undefined
337
+ })
338
+ }
339
+
340
+ await this.authInitialization
288
341
  }
289
342
  }
@@ -5,6 +5,7 @@ import { SpanNames, trace } from '@microsoft/agents-telemetry'
5
5
  import { HostingMetrics } from './metrics'
6
6
  import { Activity, ConversationReference } from '@microsoft/agents-activity'
7
7
  import { HandlerStorage } from '../app/auth/handlerStorage'
8
+ import type { Storage } from '../storage'
8
9
 
9
10
  export const AgentApplicationTraceDefinitions = {
10
11
  run: trace.define({
@@ -121,13 +122,13 @@ export const AdapterTraceDefinitions = {
121
122
  name: SpanNames.ADAPTER_CREATE_CONNECTOR_CLIENT,
122
123
  record: {
123
124
  serviceUrl: '',
124
- scope: '',
125
+ scopes: [] as string[],
125
126
  activityIsAgentic: false,
126
127
  },
127
128
  end ({ span, record }) {
128
129
  span.setAttributes({
129
130
  service_url: record.serviceUrl ?? 'unknown',
130
- 'auth.scope': record.scope ?? 'unknown',
131
+ 'auth.scopes': record.scopes ?? 'unknown',
131
132
  })
132
133
 
133
134
  if (record.activityIsAgentic !== undefined) {
@@ -259,6 +260,12 @@ export const ProactiveTraceDefinitions = {
259
260
  record: {
260
261
  conversationId: '',
261
262
  },
263
+ actions: ({ span }) => ({
264
+ async link (storage: Storage, key: string) {
265
+ const item = (await storage.read([key]))?.[key] ?? {}
266
+ return link(span, item)
267
+ }
268
+ }),
262
269
  end ({ span, record }) {
263
270
  span.setAttributes({
264
271
  'activity.conversation_id': record.conversationId ?? 'unknown',
@@ -307,6 +314,12 @@ export const ProactiveTraceDefinitions = {
307
314
  channelId: '',
308
315
  activityType: '',
309
316
  },
317
+ actions: ({ span }) => ({
318
+ async link (storage: Storage, key: string) {
319
+ const item = (await storage.read([key]))?.[key] ?? {}
320
+ link(span, item)
321
+ }
322
+ }),
310
323
  end ({ span, record, duration, error }) {
311
324
  const attributes = {
312
325
  'activity.channel_id': record.channelId ?? 'unknown',
@@ -335,6 +348,12 @@ export const ProactiveTraceDefinitions = {
335
348
  channelId: '',
336
349
  hasAutoSignIn: false,
337
350
  },
351
+ actions: ({ span }) => ({
352
+ async link (storage: Storage, key: string) {
353
+ const item = (await storage.read([key]))?.[key] ?? {}
354
+ link(span, item)
355
+ }
356
+ }),
338
357
  end ({ span, record, duration, error }) {
339
358
  const attributes = {
340
359
  'activity.channel_id': record.channelId ?? 'unknown',
@@ -783,12 +802,7 @@ export const AuthorizationTraceDefinitions = {
783
802
  return
784
803
  }
785
804
 
786
- if (active.__link) {
787
- span.addLink({ context: active.__link })
788
- }
789
-
790
- active.__link = span.spanContext()
791
- await storage.write(active)
805
+ await storage.write(link(span, active))
792
806
  }
793
807
  }),
794
808
  end ({ span, record }) {
@@ -986,3 +1000,20 @@ export const UserTokenClientTraceDefinitions = {
986
1000
  }
987
1001
  }),
988
1002
  }
1003
+
1004
+ /**
1005
+ * Adds a link to the span in the item and returns the updated item with the new link context.
1006
+ * @remarks
1007
+ * - **Parent to child**: use the returned item to 'link' future child spans.
1008
+ * - **Parent to children**: use the original item to 'link' future child spans. Ignore the returned item.
1009
+ */
1010
+ function link <T extends { __link?: unknown }> (span: any, item?: T) {
1011
+ if (item?.__link) {
1012
+ span.addLink({ context: item.__link })
1013
+ }
1014
+
1015
+ return {
1016
+ ...(item ?? {}),
1017
+ __link: span.spanContext()
1018
+ } as T
1019
+ }
@@ -0,0 +1,105 @@
1
+ // Copyright (c) Microsoft Corporation. All rights reserved.
2
+ // Licensed under the MIT License.
3
+
4
+ /**
5
+ * Internal helpers for parsing environment-variable strings into typed values.
6
+ *
7
+ * These helpers are intentionally NOT exported from the package's public
8
+ * `index.ts`; they are an internal utility shared between the adapter,
9
+ * authentication, and connector-client modules. Keeping them internal lets us
10
+ * normalize behavior across the package without growing the public API.
11
+ */
12
+
13
+ /**
14
+ * Parses an environment-variable string into a boolean.
15
+ *
16
+ * Recognized truthy values (case-insensitive, trimmed): `"true"`, `"1"`.
17
+ * Recognized falsy values (case-insensitive, trimmed): `"false"`, `"0"`.
18
+ * Returns `undefined` for unset (`undefined`), empty strings, or any other
19
+ * value, so callers can distinguish "not specified" from explicit `false`.
20
+ *
21
+ * @param value - The raw environment variable value (typically
22
+ * `process.env.X`).
23
+ * @returns `true`, `false`, or `undefined` when the value is unset or
24
+ * unrecognized.
25
+ */
26
+ export function parseBooleanEnv (value: string | undefined): boolean | undefined {
27
+ if (value === undefined) return undefined
28
+ const v = value.trim().toLowerCase()
29
+ if (v === 'true' || v === '1') return true
30
+ if (v === '') return undefined
31
+ if (v === 'false' || v === '0') return false
32
+ return undefined
33
+ }
34
+
35
+ /**
36
+ * Parses an environment-variable string into an integer, returning the
37
+ * supplied fallback for unset, empty, or non-numeric values.
38
+ *
39
+ * @param value - The raw environment variable value.
40
+ * @param fallback - The value to return when the input is unset or invalid.
41
+ * @returns A finite integer, or `fallback` when the input cannot be parsed.
42
+ */
43
+ export function parseIntEnv (value: string | undefined, fallback: number): number {
44
+ if (value === undefined || value.trim() === '') return fallback
45
+ const parsed = parseInt(value, 10)
46
+ return Number.isNaN(parsed) ? fallback : parsed
47
+ }
48
+
49
+ /**
50
+ * Returns the candidate from `candidates` that is closest to `input` by
51
+ * Levenshtein edit distance, provided the distance is no greater than
52
+ * `maxDistance`. Returns `undefined` when no candidate is close enough or the
53
+ * input is empty.
54
+ *
55
+ * Intended for "did you mean X?" hints on unknown configuration keys.
56
+ * Comparison is case-insensitive so casing differences alone never count as
57
+ * an edit. Ties are broken by the order in which candidates appear.
58
+ *
59
+ * In addition to `maxDistance`, the match must be within 50% of the input
60
+ * length (rounded up). This prevents confident-but-wrong suggestions on
61
+ * short inputs (e.g., a 4-char typo matching a 6-char canonical name).
62
+ *
63
+ * @param input - The unknown name supplied by the user.
64
+ * @param candidates - The set of known valid names.
65
+ * @param maxDistance - Maximum edit distance to consider a match (default 2).
66
+ */
67
+ export function suggestClosest (
68
+ input: string,
69
+ candidates: readonly string[],
70
+ maxDistance = 2
71
+ ): string | undefined {
72
+ if (!input) return undefined
73
+ const a = input.toLowerCase()
74
+ const cutoff = Math.min(maxDistance, Math.max(1, Math.ceil(a.length / 2)))
75
+ let best: { name: string, distance: number } | undefined
76
+ for (const candidate of candidates) {
77
+ const d = levenshtein(a, candidate.toLowerCase())
78
+ if (d <= cutoff && (!best || d < best.distance)) {
79
+ best = { name: candidate, distance: d }
80
+ if (d === 0) break
81
+ }
82
+ }
83
+ return best?.name
84
+ }
85
+
86
+ /** Standard Levenshtein edit distance using a single-row dynamic-programming table. */
87
+ function levenshtein (a: string, b: string): number {
88
+ if (a === b) return 0
89
+ if (a.length === 0) return b.length
90
+ if (b.length === 0) return a.length
91
+ const row = new Array<number>(b.length + 1)
92
+ for (let j = 0; j <= b.length; j++) row[j] = j
93
+ for (let i = 1; i <= a.length; i++) {
94
+ let prev = i - 1
95
+ row[0] = i
96
+ for (let j = 1; j <= b.length; j++) {
97
+ const temp = row[j]
98
+ row[j] = a[i - 1] === b[j - 1]
99
+ ? prev
100
+ : 1 + Math.min(prev, row[j - 1], row[j])
101
+ prev = temp
102
+ }
103
+ }
104
+ return row[b.length]
105
+ }
package/src/utils.ts ADDED
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /**
7
+ * Utility function to prune undefined values from an object. This is useful for cleaning up configuration objects before logging or processing, ensuring that only defined values are included.
8
+ * @param obj The object to prune
9
+ * @returns A new object with all undefined values removed
10
+ */
11
+ export const prune = <T extends Record<string, any>>(obj: T) => {
12
+ const entries = Object.entries(obj).filter(([, value]) => value !== undefined)
13
+ return Object.fromEntries(entries) as T
14
+ }
@@ -1,64 +0,0 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { Activity } from '@microsoft/agents-activity';
6
- import { AuthConfiguration } from './authConfiguration';
7
- import { Connections } from './connections';
8
- import { MsalTokenProvider } from './msalTokenProvider';
9
- import { JwtPayload } from 'jsonwebtoken';
10
- export interface ConnectionMapItem {
11
- audience?: string;
12
- serviceUrl: string;
13
- connection: string;
14
- }
15
- export declare class MsalConnectionManager implements Connections {
16
- private _connections;
17
- private _connectionsMap;
18
- private _serviceConnectionConfiguration;
19
- private static readonly DEFAULT_CONNECTION;
20
- constructor(connectionsConfigurations?: Map<string, AuthConfiguration>, connectionsMap?: ConnectionMapItem[], configuration?: AuthConfiguration);
21
- /**
22
- * Get the OAuth connection for the agent.
23
- * @param connectionName The name of the connection.
24
- * @returns The OAuth connection for the agent.
25
- */
26
- getConnection(connectionName: string): MsalTokenProvider;
27
- /**
28
- * Get the default OAuth connection for the agent.
29
- * @returns The default OAuth connection for the agent.
30
- */
31
- getDefaultConnection(): MsalTokenProvider;
32
- /**
33
- * Finds a connection based on a map.
34
- *
35
- * @param identity - The identity. Usually TurnContext.identity.
36
- * @param serviceUrl The service URL.
37
- * @returns The TokenProvider for the connection.
38
- *
39
- * @remarks
40
- * Example environment variables:
41
- * connectionsMap__0__connection=seviceConnection
42
- * connectionsMap__0__serviceUrl=http://*..botframework.com/*
43
- * connectionsMap__0__audience=optional
44
- * connectionsMap__1__connection=agentic
45
- * connectionsMap__1__serviceUrl=agentic
46
- *
47
- * ServiceUrl is: A regex to match with, or "*" for any serviceUrl value.
48
- * Connection is: A name in the 'Connections' list.
49
- */
50
- getTokenProvider(identity: JwtPayload, serviceUrl: string): MsalTokenProvider;
51
- /**
52
- * Finds a connection based on an activity's blueprint.
53
- * @param identity - The identity. Usually TurnContext.identity.
54
- * @param activity The activity.
55
- * @returns The TokenProvider for the connection.
56
- */
57
- getTokenProviderFromActivity(identity: JwtPayload, activity: Activity): MsalTokenProvider;
58
- /**
59
- * Get the default connection configuration for the agent.
60
- * @returns The default connection configuration for the agent.
61
- */
62
- getDefaultConnectionConfiguration(): AuthConfiguration;
63
- private applyConnectionDefaults;
64
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"msalConnectionManager.js","sourceRoot":"","sources":["../../../src/auth/msalConnectionManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,gEAAgE;AAChE,kEAAmD;AACnD,2DAAyE;AAEzE,2DAAuD;AAGvD,MAAM,MAAM,GAAG,IAAA,wBAAK,EAAC,kCAAkC,CAAC,CAAA;AAQxD,MAAa,qBAAqB;IAMhC,YACE,4BAA4D,IAAI,GAAG,EAAE,EACrE,iBAAsC,EAAE,EACxC,gBAAmC,EAAE;;QACrC,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,EAAE,CAAA;QAC7B,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,cAAc,IAAI,EAAE,CAAC,CAAA;QACxG,IAAI,CAAC,+BAA+B,GAAG,EAAE,CAAA;QAEzC,MAAM,mBAAmB,GAAG,yBAAyB,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,WAAW,IAAI,IAAI,GAAG,EAAE,CAAC,CAAA;QAErI,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,mBAAmB,EAAE,CAAC;YACjD,oDAAoD;YACpD,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,qCAAiB,CAAC,MAAM,CAAC,CAAC,CAAA;YAC1D,IAAI,IAAI,KAAK,qBAA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