@openclaw/msteams 2026.5.27 → 2026.5.28-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (701) hide show
  1. package/dist/api.js +2 -2
  2. package/dist/{channel-c7nnGfMx.js → channel-C_AMaSpi.js} +5 -5
  3. package/dist/channel-config-api.js +1 -1
  4. package/dist/channel-plugin-api.js +1 -1
  5. package/dist/{channel.runtime-Boha-kk1.js → channel.runtime-BJJ1R1iY.js} +3 -3
  6. package/dist/{config-schema-CuksCQKC.js → config-schema-BL4qQZiA.js} +8 -0
  7. package/dist/{graph-users-uPAE6-KQ.js → errors-B4snzfP5.js} +378 -624
  8. package/dist/{oauth-C5ObhLG6.js → oauth-BrKjrCNK.js} +1 -1
  9. package/dist/{oauth.token-BNbWziwM.js → oauth.token-5ygi8ycy.js} +8 -6
  10. package/dist/{probe-istgFnuw.js → probe-DRwI-ZqW.js} +221 -120
  11. package/dist/setup-plugin-api.js +3 -3
  12. package/dist/{setup-surface-evwYex71.js → setup-surface-C-uCiIKh.js} +2 -2
  13. package/dist/{src-ui0zJEZI.js → src-Cc3f8Zi2.js} +786 -994
  14. package/node_modules/@microsoft/teams.api/dist/activities/activity.d.mts +0 -1
  15. package/node_modules/@microsoft/teams.api/dist/activities/activity.d.ts +0 -1
  16. package/node_modules/@microsoft/teams.api/dist/activities/activity.js +0 -4
  17. package/node_modules/@microsoft/teams.api/dist/activities/activity.js.map +1 -1
  18. package/node_modules/@microsoft/teams.api/dist/activities/activity.mjs +0 -4
  19. package/node_modules/@microsoft/teams.api/dist/activities/activity.mjs.map +1 -1
  20. package/node_modules/@microsoft/teams.api/dist/activities/index.d.mts +3 -2
  21. package/node_modules/@microsoft/teams.api/dist/activities/index.d.ts +3 -2
  22. package/node_modules/@microsoft/teams.api/dist/activities/invoke/index.d.mts +3 -2
  23. package/node_modules/@microsoft/teams.api/dist/activities/invoke/index.d.ts +3 -2
  24. package/node_modules/@microsoft/teams.api/dist/activities/invoke/index.js +7 -0
  25. package/node_modules/@microsoft/teams.api/dist/activities/invoke/index.mjs +1 -0
  26. package/node_modules/@microsoft/teams.api/dist/activities/invoke/message-extension/fetch-task.d.mts +3 -2
  27. package/node_modules/@microsoft/teams.api/dist/activities/invoke/message-extension/fetch-task.d.ts +3 -2
  28. package/node_modules/@microsoft/teams.api/dist/activities/invoke/message-extension/index.d.mts +3 -2
  29. package/node_modules/@microsoft/teams.api/dist/activities/invoke/message-extension/index.d.ts +3 -2
  30. package/node_modules/@microsoft/teams.api/dist/activities/invoke/message-extension/submit-action.d.mts +3 -2
  31. package/node_modules/@microsoft/teams.api/dist/activities/invoke/message-extension/submit-action.d.ts +3 -2
  32. package/node_modules/@microsoft/teams.api/dist/activities/invoke/suggested-action-submit.d.mts +48 -0
  33. package/node_modules/@microsoft/teams.api/dist/activities/invoke/suggested-action-submit.d.ts +48 -0
  34. package/node_modules/@microsoft/teams.api/dist/activities/invoke/suggested-action-submit.js +4 -0
  35. package/node_modules/@microsoft/teams.api/dist/activities/invoke/suggested-action-submit.js.map +1 -0
  36. package/node_modules/@microsoft/teams.api/dist/activities/invoke/suggested-action-submit.mjs +3 -0
  37. package/node_modules/@microsoft/teams.api/dist/activities/invoke/suggested-action-submit.mjs.map +1 -0
  38. package/node_modules/@microsoft/teams.api/dist/activities/message/index.d.mts +3 -3
  39. package/node_modules/@microsoft/teams.api/dist/activities/message/index.d.ts +3 -3
  40. package/node_modules/@microsoft/teams.api/dist/activities/message/message.d.mts +2 -2
  41. package/node_modules/@microsoft/teams.api/dist/activities/message/message.d.ts +2 -2
  42. package/node_modules/@microsoft/teams.api/dist/activities/message/message.js +60 -2
  43. package/node_modules/@microsoft/teams.api/dist/activities/message/message.js.map +1 -1
  44. package/node_modules/@microsoft/teams.api/dist/activities/message/message.mjs +60 -2
  45. package/node_modules/@microsoft/teams.api/dist/activities/message/message.mjs.map +1 -1
  46. package/node_modules/@microsoft/teams.api/dist/activities/utils/index.d.mts +4 -3
  47. package/node_modules/@microsoft/teams.api/dist/activities/utils/index.d.ts +4 -3
  48. package/node_modules/@microsoft/teams.api/dist/activities/utils/strip-mentions-text.d.mts +2 -2
  49. package/node_modules/@microsoft/teams.api/dist/activities/utils/strip-mentions-text.d.ts +2 -2
  50. package/node_modules/@microsoft/teams.api/dist/activities/utils/to-activity-params.d.mts +4 -3
  51. package/node_modules/@microsoft/teams.api/dist/activities/utils/to-activity-params.d.ts +4 -3
  52. package/node_modules/@microsoft/teams.api/dist/{activity-Be6r1tJJ.d.ts → activity-DzKP6phL.d.ts} +3 -2
  53. package/node_modules/@microsoft/teams.api/dist/{activity-CJery-zL.d.mts → activity-KJJs2q-W.d.mts} +3 -2
  54. package/node_modules/@microsoft/teams.api/dist/auth/json-web-token.d.mts +14 -0
  55. package/node_modules/@microsoft/teams.api/dist/auth/json-web-token.d.ts +14 -0
  56. package/node_modules/@microsoft/teams.api/dist/auth/json-web-token.js +14 -0
  57. package/node_modules/@microsoft/teams.api/dist/auth/json-web-token.js.map +1 -1
  58. package/node_modules/@microsoft/teams.api/dist/auth/json-web-token.mjs +14 -0
  59. package/node_modules/@microsoft/teams.api/dist/auth/json-web-token.mjs.map +1 -1
  60. package/node_modules/@microsoft/teams.api/dist/clients/conversation/activity.d.mts +4 -3
  61. package/node_modules/@microsoft/teams.api/dist/clients/conversation/activity.d.ts +4 -3
  62. package/node_modules/@microsoft/teams.api/dist/clients/conversation/index.d.mts +4 -3
  63. package/node_modules/@microsoft/teams.api/dist/clients/conversation/index.d.ts +4 -3
  64. package/node_modules/@microsoft/teams.api/dist/clients/index.d.mts +4 -3
  65. package/node_modules/@microsoft/teams.api/dist/clients/index.d.ts +4 -3
  66. package/node_modules/@microsoft/teams.api/dist/index.d.mts +3 -2
  67. package/node_modules/@microsoft/teams.api/dist/index.d.ts +3 -2
  68. package/node_modules/@microsoft/teams.api/dist/{message-BwI6kmCe.d.ts → message-D0n_F-cL.d.ts} +37 -1
  69. package/node_modules/@microsoft/teams.api/dist/{message-Bd75JRjv.d.mts → message-DTEe5v6q.d.mts} +37 -1
  70. package/node_modules/@microsoft/teams.api/dist/models/activity-like.d.mts +4 -3
  71. package/node_modules/@microsoft/teams.api/dist/models/activity-like.d.ts +4 -3
  72. package/node_modules/@microsoft/teams.api/dist/models/card/card-action.d.mts +8 -1
  73. package/node_modules/@microsoft/teams.api/dist/models/card/card-action.d.ts +8 -1
  74. package/node_modules/@microsoft/teams.api/dist/models/index.d.mts +3 -2
  75. package/node_modules/@microsoft/teams.api/dist/models/index.d.ts +3 -2
  76. package/node_modules/@microsoft/teams.api/dist/models/invoke-response.d.mts +5 -3
  77. package/node_modules/@microsoft/teams.api/dist/models/invoke-response.d.ts +5 -3
  78. package/node_modules/@microsoft/teams.api/dist/models/invoke-response.js.map +1 -1
  79. package/node_modules/@microsoft/teams.api/dist/models/invoke-response.mjs.map +1 -1
  80. package/node_modules/@microsoft/teams.api/dist/models/messaging-extension/index.d.mts +4 -3
  81. package/node_modules/@microsoft/teams.api/dist/models/messaging-extension/index.d.ts +4 -3
  82. package/node_modules/@microsoft/teams.api/dist/models/messaging-extension/messaging-extension-action-response.d.mts +4 -3
  83. package/node_modules/@microsoft/teams.api/dist/models/messaging-extension/messaging-extension-action-response.d.ts +4 -3
  84. package/node_modules/@microsoft/teams.api/dist/models/messaging-extension/messaging-extension-action.d.mts +4 -3
  85. package/node_modules/@microsoft/teams.api/dist/models/messaging-extension/messaging-extension-action.d.ts +4 -3
  86. package/node_modules/@microsoft/teams.api/dist/models/messaging-extension/messaging-extension-response.d.mts +4 -3
  87. package/node_modules/@microsoft/teams.api/dist/models/messaging-extension/messaging-extension-response.d.ts +4 -3
  88. package/node_modules/@microsoft/teams.api/dist/models/messaging-extension/messaging-extension-result.d.mts +4 -3
  89. package/node_modules/@microsoft/teams.api/dist/models/messaging-extension/messaging-extension-result.d.ts +4 -3
  90. package/node_modules/@microsoft/teams.api/package.json +5 -5
  91. package/node_modules/@microsoft/teams.apps/dist/contexts/activity.d.ts +27 -2
  92. package/node_modules/@microsoft/teams.apps/dist/contexts/activity.js +119 -58
  93. package/node_modules/@microsoft/teams.apps/dist/contexts/activity.test.js +235 -33
  94. package/node_modules/@microsoft/teams.apps/dist/http/express-adapter.d.ts +8 -1
  95. package/node_modules/@microsoft/teams.apps/dist/http/express-adapter.js +10 -4
  96. package/node_modules/@microsoft/teams.apps/dist/http/http-server.js +14 -1
  97. package/node_modules/@microsoft/teams.apps/dist/http/http-stream.d.ts +77 -46
  98. package/node_modules/@microsoft/teams.apps/dist/http/http-stream.js +31 -16
  99. package/node_modules/@microsoft/teams.apps/dist/routes/invoke/index.d.ts +1 -0
  100. package/node_modules/@microsoft/teams.apps/dist/routes/invoke/index.js +2 -1
  101. package/node_modules/@microsoft/teams.apps/dist/types/app-routing.d.ts +2 -2
  102. package/node_modules/@microsoft/teams.apps/dist/types/streamer.d.ts +9 -0
  103. package/node_modules/@microsoft/teams.apps/package.json +5 -5
  104. package/node_modules/@microsoft/teams.cards/dist/actions/submit/collab-stage.js.map +1 -1
  105. package/node_modules/@microsoft/teams.cards/dist/actions/submit/collab-stage.mjs.map +1 -1
  106. package/node_modules/@microsoft/teams.cards/dist/actions/submit/im-back.js.map +1 -1
  107. package/node_modules/@microsoft/teams.cards/dist/actions/submit/im-back.mjs.map +1 -1
  108. package/node_modules/@microsoft/teams.cards/dist/actions/submit/invoke.js.map +1 -1
  109. package/node_modules/@microsoft/teams.cards/dist/actions/submit/invoke.mjs.map +1 -1
  110. package/node_modules/@microsoft/teams.cards/dist/actions/submit/message-back.d.mts +1 -1
  111. package/node_modules/@microsoft/teams.cards/dist/actions/submit/message-back.d.ts +1 -1
  112. package/node_modules/@microsoft/teams.cards/dist/actions/submit/message-back.js.map +1 -1
  113. package/node_modules/@microsoft/teams.cards/dist/actions/submit/message-back.mjs.map +1 -1
  114. package/node_modules/@microsoft/teams.cards/dist/actions/submit/sign-in.js.map +1 -1
  115. package/node_modules/@microsoft/teams.cards/dist/actions/submit/sign-in.mjs.map +1 -1
  116. package/node_modules/@microsoft/teams.cards/dist/actions/submit/task-fetch.js.map +1 -1
  117. package/node_modules/@microsoft/teams.cards/dist/actions/submit/task-fetch.mjs.map +1 -1
  118. package/node_modules/@microsoft/teams.cards/package.json +2 -2
  119. package/node_modules/@microsoft/teams.common/dist/events/event-emitter.d.mts +2 -2
  120. package/node_modules/@microsoft/teams.common/dist/events/event-emitter.d.ts +2 -2
  121. package/node_modules/@microsoft/teams.common/dist/events/event-emitter.js.map +1 -1
  122. package/node_modules/@microsoft/teams.common/dist/events/event-emitter.mjs.map +1 -1
  123. package/node_modules/@microsoft/teams.common/dist/http/client.d.mts +1 -1
  124. package/node_modules/@microsoft/teams.common/dist/http/client.d.ts +1 -1
  125. package/node_modules/@microsoft/teams.common/dist/http/client.js +3 -1
  126. package/node_modules/@microsoft/teams.common/dist/http/client.js.map +1 -1
  127. package/node_modules/@microsoft/teams.common/dist/http/client.mjs +3 -1
  128. package/node_modules/@microsoft/teams.common/dist/http/client.mjs.map +1 -1
  129. package/node_modules/@microsoft/teams.common/dist/logging/console.d.mts +1 -1
  130. package/node_modules/@microsoft/teams.common/dist/logging/console.d.ts +1 -1
  131. package/node_modules/@microsoft/teams.common/dist/logging/console.js +3 -1
  132. package/node_modules/@microsoft/teams.common/dist/logging/console.js.map +1 -1
  133. package/node_modules/@microsoft/teams.common/dist/logging/console.mjs +3 -1
  134. package/node_modules/@microsoft/teams.common/dist/logging/console.mjs.map +1 -1
  135. package/node_modules/@microsoft/teams.common/dist/logging/string.js.map +1 -1
  136. package/node_modules/@microsoft/teams.common/dist/logging/string.mjs.map +1 -1
  137. package/node_modules/@microsoft/teams.common/dist/storage/list-local-storage.js.map +1 -1
  138. package/node_modules/@microsoft/teams.common/dist/storage/list-local-storage.mjs.map +1 -1
  139. package/node_modules/@microsoft/teams.common/dist/storage/local-storage.js.map +1 -1
  140. package/node_modules/@microsoft/teams.common/dist/storage/local-storage.mjs.map +1 -1
  141. package/node_modules/@microsoft/teams.common/package.json +2 -2
  142. package/node_modules/@microsoft/teams.graph/dist/index.js +2 -2
  143. package/node_modules/@microsoft/teams.graph/dist/index.mjs +2 -2
  144. package/node_modules/@microsoft/teams.graph/package.json +4 -4
  145. package/node_modules/jose/README.md +62 -83
  146. package/node_modules/jose/dist/types/index.d.ts +48 -55
  147. package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +4 -12
  148. package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +9 -22
  149. package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +4 -12
  150. package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +21 -24
  151. package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +4 -19
  152. package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +21 -35
  153. package/node_modules/jose/dist/types/jwk/embedded.d.ts +2 -10
  154. package/node_modules/jose/dist/types/jwk/thumbprint.d.ts +5 -16
  155. package/node_modules/jose/dist/types/jwks/local.d.ts +13 -16
  156. package/node_modules/jose/dist/types/jwks/remote.d.ts +16 -204
  157. package/node_modules/jose/dist/types/jws/compact/sign.d.ts +6 -18
  158. package/node_modules/jose/dist/types/jws/compact/verify.d.ts +5 -13
  159. package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +8 -18
  160. package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +5 -13
  161. package/node_modules/jose/dist/types/jws/general/sign.d.ts +12 -24
  162. package/node_modules/jose/dist/types/jws/general/verify.d.ts +5 -21
  163. package/node_modules/jose/dist/types/jwt/decrypt.d.ts +5 -13
  164. package/node_modules/jose/dist/types/jwt/encrypt.d.ts +17 -31
  165. package/node_modules/jose/dist/types/jwt/sign.d.ts +6 -26
  166. package/node_modules/jose/dist/types/jwt/unsecured.d.ts +7 -29
  167. package/node_modules/jose/dist/types/jwt/verify.d.ts +6 -14
  168. package/node_modules/jose/dist/types/key/export.d.ts +12 -24
  169. package/node_modules/jose/dist/types/key/generate_key_pair.d.ts +11 -22
  170. package/node_modules/jose/dist/types/key/generate_secret.d.ts +8 -24
  171. package/node_modules/jose/dist/types/key/import.d.ts +33 -62
  172. package/node_modules/jose/dist/types/types.d.ts +165 -407
  173. package/node_modules/jose/dist/types/util/base64url.d.ts +16 -6
  174. package/node_modules/jose/dist/types/util/decode_jwt.d.ts +2 -10
  175. package/node_modules/jose/dist/types/util/decode_protected_header.d.ts +2 -11
  176. package/node_modules/jose/dist/types/util/errors.d.ts +36 -98
  177. package/node_modules/jose/package.json +17 -127
  178. package/node_modules/jwks-rsa/package.json +4 -4
  179. package/node_modules/jwks-rsa/src/integrations/config.js +1 -0
  180. package/node_modules/jwks-rsa/src/utils.js +2 -0
  181. package/node_modules/jwks-rsa/src/wrappers/cache.js +1 -1
  182. package/node_modules/lru-cache/README.md +117 -420
  183. package/node_modules/lru-cache/package.json +12 -132
  184. package/node_modules/lru-memoizer/README.md +21 -22
  185. package/node_modules/lru-memoizer/lib/async.d.ts +32 -15
  186. package/node_modules/lru-memoizer/lib/async.js +113 -55
  187. package/node_modules/lru-memoizer/lib/freeze.d.ts +0 -1
  188. package/node_modules/lru-memoizer/lib/freeze.js +1 -1
  189. package/node_modules/lru-memoizer/lib/index.d.ts +0 -1
  190. package/node_modules/lru-memoizer/lib/index.js +2 -2
  191. package/node_modules/lru-memoizer/lib/sync.d.ts +16 -17
  192. package/node_modules/lru-memoizer/lib/sync.js +62 -34
  193. package/node_modules/lru-memoizer/lib/util.d.ts +40 -41
  194. package/node_modules/lru-memoizer/lib/util.js +1 -1
  195. package/node_modules/lru-memoizer/package.json +4 -3
  196. package/node_modules/lru-memoizer/test/lru-memoizer.clone.test.js +1 -2
  197. package/node_modules/lru-memoizer/test/lru-memoizer.freeze.test.js +0 -1
  198. package/node_modules/lru-memoizer/test/lru-memoizer.itemmaxage.test.js +26 -26
  199. package/node_modules/lru-memoizer/test/lru-memoizer.nokey.test.js +0 -1
  200. package/node_modules/lru-memoizer/test/lru-memoizer.queumaxage.test.js +3 -4
  201. package/node_modules/lru-memoizer/test/lru-memoizer.sync.clone.test.js +2 -4
  202. package/node_modules/lru-memoizer/test/lru-memoizer.sync.freeze.js +2 -4
  203. package/node_modules/lru-memoizer/tsconfig.json +56 -16
  204. package/node_modules/semver/classes/range.js +7 -0
  205. package/node_modules/semver/package.json +1 -1
  206. package/node_modules/semver/ranges/subset.js +2 -2
  207. package/npm-shrinkwrap.json +52 -98
  208. package/openclaw.plugin.json +21 -0
  209. package/package.json +6 -10
  210. package/dist/test-api.js +0 -2
  211. package/node_modules/@microsoft/teams.apps/node_modules/jose/LICENSE.md +0 -21
  212. package/node_modules/@microsoft/teams.apps/node_modules/jose/README.md +0 -132
  213. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/index.d.ts +0 -48
  214. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +0 -23
  215. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +0 -52
  216. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +0 -23
  217. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +0 -80
  218. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +0 -23
  219. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +0 -60
  220. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/jwk/embedded.d.ts +0 -9
  221. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/jwk/thumbprint.d.ts +0 -21
  222. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/jwks/local.d.ts +0 -26
  223. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/jwks/remote.d.ts +0 -49
  224. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/jws/compact/sign.d.ts +0 -24
  225. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/jws/compact/verify.d.ts +0 -25
  226. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/jws/flattened/sign.d.ts +0 -32
  227. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/jws/flattened/verify.d.ts +0 -25
  228. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/jws/general/sign.d.ts +0 -41
  229. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/jws/general/verify.d.ts +0 -25
  230. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/jwt/decrypt.d.ts +0 -27
  231. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/jwt/encrypt.d.ts +0 -77
  232. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/jwt/sign.d.ts +0 -23
  233. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/jwt/unsecured.d.ts +0 -21
  234. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/jwt/verify.d.ts +0 -29
  235. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/key/export.d.ts +0 -21
  236. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/key/generate_key_pair.d.ts +0 -36
  237. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/key/generate_secret.d.ts +0 -19
  238. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/key/import.d.ts +0 -54
  239. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/types.d.ts +0 -610
  240. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/util/base64url.d.ts +0 -19
  241. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/util/decode_jwt.d.ts +0 -10
  242. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/util/decode_protected_header.d.ts +0 -8
  243. package/node_modules/@microsoft/teams.apps/node_modules/jose/dist/types/util/errors.d.ts +0 -151
  244. package/node_modules/@microsoft/teams.apps/node_modules/jose/package.json +0 -90
  245. package/node_modules/@microsoft/teams.apps/node_modules/jwks-rsa/LICENSE +0 -21
  246. package/node_modules/@microsoft/teams.apps/node_modules/jwks-rsa/README.md +0 -84
  247. package/node_modules/@microsoft/teams.apps/node_modules/jwks-rsa/index.d.ts +0 -139
  248. package/node_modules/@microsoft/teams.apps/node_modules/jwks-rsa/package.json +0 -74
  249. package/node_modules/@microsoft/teams.apps/node_modules/jwks-rsa/src/JwksClient.js +0 -91
  250. package/node_modules/@microsoft/teams.apps/node_modules/jwks-rsa/src/errors/ArgumentError.js +0 -10
  251. package/node_modules/@microsoft/teams.apps/node_modules/jwks-rsa/src/errors/JwksError.js +0 -10
  252. package/node_modules/@microsoft/teams.apps/node_modules/jwks-rsa/src/errors/JwksRateLimitError.js +0 -10
  253. package/node_modules/@microsoft/teams.apps/node_modules/jwks-rsa/src/errors/SigningKeyNotFoundError.js +0 -10
  254. package/node_modules/@microsoft/teams.apps/node_modules/jwks-rsa/src/errors/index.js +0 -6
  255. package/node_modules/@microsoft/teams.apps/node_modules/jwks-rsa/src/index.js +0 -22
  256. package/node_modules/@microsoft/teams.apps/node_modules/jwks-rsa/src/integrations/config.js +0 -15
  257. package/node_modules/@microsoft/teams.apps/node_modules/jwks-rsa/src/integrations/express.js +0 -60
  258. package/node_modules/@microsoft/teams.apps/node_modules/jwks-rsa/src/integrations/hapi.js +0 -59
  259. package/node_modules/@microsoft/teams.apps/node_modules/jwks-rsa/src/integrations/koa.js +0 -30
  260. package/node_modules/@microsoft/teams.apps/node_modules/jwks-rsa/src/integrations/passport.js +0 -52
  261. package/node_modules/@microsoft/teams.apps/node_modules/jwks-rsa/src/utils.js +0 -80
  262. package/node_modules/@microsoft/teams.apps/node_modules/jwks-rsa/src/wrappers/cache.js +0 -15
  263. package/node_modules/@microsoft/teams.apps/node_modules/jwks-rsa/src/wrappers/callbackSupport.js +0 -16
  264. package/node_modules/@microsoft/teams.apps/node_modules/jwks-rsa/src/wrappers/index.js +0 -7
  265. package/node_modules/@microsoft/teams.apps/node_modules/jwks-rsa/src/wrappers/interceptor.js +0 -30
  266. package/node_modules/@microsoft/teams.apps/node_modules/jwks-rsa/src/wrappers/rateLimit.js +0 -34
  267. package/node_modules/@microsoft/teams.apps/node_modules/jwks-rsa/src/wrappers/request.js +0 -54
  268. package/node_modules/@microsoft/teams.apps/node_modules/lru-cache/README.md +0 -166
  269. package/node_modules/@microsoft/teams.apps/node_modules/lru-cache/package.json +0 -34
  270. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/.jshintrc +0 -41
  271. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/LICENSE +0 -21
  272. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/README.md +0 -88
  273. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/lib/async.d.ts +0 -85
  274. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/lib/async.js +0 -178
  275. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/lib/freeze.d.ts +0 -1
  276. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/lib/freeze.js +0 -23
  277. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/lib/index.d.ts +0 -2
  278. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/lib/index.js +0 -4
  279. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/lib/sync.d.ts +0 -65
  280. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/lib/sync.js +0 -114
  281. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/lib/util.d.ts +0 -162
  282. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/lib/util.js +0 -3
  283. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/package.json +0 -34
  284. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/test/lru-memoizer.bypass.test.js +0 -39
  285. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/test/lru-memoizer.clone.test.js +0 -44
  286. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/test/lru-memoizer.disable.test.js +0 -49
  287. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/test/lru-memoizer.events.test.js +0 -132
  288. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/test/lru-memoizer.freeze.test.js +0 -43
  289. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/test/lru-memoizer.itemmaxage.test.js +0 -204
  290. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/test/lru-memoizer.lock.test.js +0 -36
  291. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/test/lru-memoizer.nokey.test.js +0 -43
  292. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/test/lru-memoizer.queumaxage.test.js +0 -110
  293. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/test/lru-memoizer.sync.clone.test.js +0 -76
  294. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/test/lru-memoizer.sync.events.test.js +0 -95
  295. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/test/lru-memoizer.sync.freeze.js +0 -74
  296. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/test/lru-memoizer.sync.test.js +0 -47
  297. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/test/lru-memoizer.test.js +0 -88
  298. package/node_modules/@microsoft/teams.apps/node_modules/lru-memoizer/tsconfig.json +0 -59
  299. package/node_modules/jose/dist/webapi/index.js +0 -32
  300. package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +0 -27
  301. package/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +0 -27
  302. package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +0 -159
  303. package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +0 -167
  304. package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +0 -31
  305. package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +0 -182
  306. package/node_modules/jose/dist/webapi/jwk/embedded.js +0 -17
  307. package/node_modules/jose/dist/webapi/jwk/thumbprint.js +0 -68
  308. package/node_modules/jose/dist/webapi/jwks/local.js +0 -119
  309. package/node_modules/jose/dist/webapi/jwks/remote.js +0 -179
  310. package/node_modules/jose/dist/webapi/jws/compact/sign.js +0 -18
  311. package/node_modules/jose/dist/webapi/jws/compact/verify.js +0 -21
  312. package/node_modules/jose/dist/webapi/jws/flattened/sign.js +0 -89
  313. package/node_modules/jose/dist/webapi/jws/flattened/verify.js +0 -110
  314. package/node_modules/jose/dist/webapi/jws/general/sign.js +0 -70
  315. package/node_modules/jose/dist/webapi/jws/general/verify.js +0 -24
  316. package/node_modules/jose/dist/webapi/jwt/decrypt.js +0 -23
  317. package/node_modules/jose/dist/webapi/jwt/encrypt.js +0 -101
  318. package/node_modules/jose/dist/webapi/jwt/sign.js +0 -52
  319. package/node_modules/jose/dist/webapi/jwt/unsecured.js +0 -63
  320. package/node_modules/jose/dist/webapi/jwt/verify.js +0 -15
  321. package/node_modules/jose/dist/webapi/key/export.js +0 -11
  322. package/node_modules/jose/dist/webapi/key/generate_key_pair.js +0 -97
  323. package/node_modules/jose/dist/webapi/key/generate_secret.js +0 -40
  324. package/node_modules/jose/dist/webapi/key/import.js +0 -57
  325. package/node_modules/jose/dist/webapi/lib/aesgcmkw.js +0 -15
  326. package/node_modules/jose/dist/webapi/lib/aeskw.js +0 -25
  327. package/node_modules/jose/dist/webapi/lib/asn1.js +0 -243
  328. package/node_modules/jose/dist/webapi/lib/base64.js +0 -22
  329. package/node_modules/jose/dist/webapi/lib/buffer_utils.js +0 -43
  330. package/node_modules/jose/dist/webapi/lib/check_key_type.js +0 -122
  331. package/node_modules/jose/dist/webapi/lib/content_encryption.js +0 -217
  332. package/node_modules/jose/dist/webapi/lib/crypto_key.js +0 -136
  333. package/node_modules/jose/dist/webapi/lib/deflate.js +0 -44
  334. package/node_modules/jose/dist/webapi/lib/ecdhes.js +0 -52
  335. package/node_modules/jose/dist/webapi/lib/helpers.js +0 -19
  336. package/node_modules/jose/dist/webapi/lib/invalid_key_input.js +0 -27
  337. package/node_modules/jose/dist/webapi/lib/is_key_like.js +0 -17
  338. package/node_modules/jose/dist/webapi/lib/jwk_to_key.js +0 -107
  339. package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +0 -238
  340. package/node_modules/jose/dist/webapi/lib/key_management.js +0 -186
  341. package/node_modules/jose/dist/webapi/lib/key_to_jwk.js +0 -31
  342. package/node_modules/jose/dist/webapi/lib/normalize_key.js +0 -166
  343. package/node_modules/jose/dist/webapi/lib/pbes2kw.js +0 -42
  344. package/node_modules/jose/dist/webapi/lib/rsaes.js +0 -24
  345. package/node_modules/jose/dist/webapi/lib/signing.js +0 -68
  346. package/node_modules/jose/dist/webapi/lib/type_checks.js +0 -40
  347. package/node_modules/jose/dist/webapi/lib/validate_algorithms.js +0 -10
  348. package/node_modules/jose/dist/webapi/lib/validate_crit.js +0 -33
  349. package/node_modules/jose/dist/webapi/util/base64url.js +0 -30
  350. package/node_modules/jose/dist/webapi/util/decode_jwt.js +0 -32
  351. package/node_modules/jose/dist/webapi/util/decode_protected_header.js +0 -34
  352. package/node_modules/jose/dist/webapi/util/errors.js +0 -99
  353. package/node_modules/lru-cache/LICENSE.md +0 -55
  354. package/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.d.ts.map +0 -1
  355. package/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.js.map +0 -1
  356. package/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.d.ts +0 -5
  357. package/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.js +0 -7
  358. package/node_modules/lru-cache/dist/commonjs/browser/index.d.ts +0 -1400
  359. package/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map +0 -1
  360. package/node_modules/lru-cache/dist/commonjs/browser/index.js +0 -1726
  361. package/node_modules/lru-cache/dist/commonjs/browser/index.js.map +0 -1
  362. package/node_modules/lru-cache/dist/commonjs/browser/index.min.js +0 -2
  363. package/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map +0 -7
  364. package/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts +0 -12
  365. package/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map +0 -1
  366. package/node_modules/lru-cache/dist/commonjs/browser/perf.js +0 -10
  367. package/node_modules/lru-cache/dist/commonjs/browser/perf.js.map +0 -1
  368. package/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.cjs.map +0 -1
  369. package/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.d.cts.map +0 -1
  370. package/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts +0 -5
  371. package/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js +0 -7
  372. package/node_modules/lru-cache/dist/commonjs/index.d.ts +0 -1400
  373. package/node_modules/lru-cache/dist/commonjs/index.d.ts.map +0 -1
  374. package/node_modules/lru-cache/dist/commonjs/index.js +0 -1726
  375. package/node_modules/lru-cache/dist/commonjs/index.js.map +0 -1
  376. package/node_modules/lru-cache/dist/commonjs/index.min.js +0 -2
  377. package/node_modules/lru-cache/dist/commonjs/index.min.js.map +0 -7
  378. package/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.d.ts.map +0 -1
  379. package/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.js.map +0 -1
  380. package/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.d.ts +0 -5
  381. package/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.js +0 -9
  382. package/node_modules/lru-cache/dist/commonjs/node/index.d.ts +0 -1400
  383. package/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map +0 -1
  384. package/node_modules/lru-cache/dist/commonjs/node/index.js +0 -1726
  385. package/node_modules/lru-cache/dist/commonjs/node/index.js.map +0 -1
  386. package/node_modules/lru-cache/dist/commonjs/node/index.min.js +0 -2
  387. package/node_modules/lru-cache/dist/commonjs/node/index.min.js.map +0 -7
  388. package/node_modules/lru-cache/dist/commonjs/node/perf.d.ts +0 -12
  389. package/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map +0 -1
  390. package/node_modules/lru-cache/dist/commonjs/node/perf.js +0 -10
  391. package/node_modules/lru-cache/dist/commonjs/node/perf.js.map +0 -1
  392. package/node_modules/lru-cache/dist/commonjs/package.json +0 -3
  393. package/node_modules/lru-cache/dist/commonjs/perf.d.ts +0 -12
  394. package/node_modules/lru-cache/dist/commonjs/perf.d.ts.map +0 -1
  395. package/node_modules/lru-cache/dist/commonjs/perf.js +0 -10
  396. package/node_modules/lru-cache/dist/commonjs/perf.js.map +0 -1
  397. package/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.ts.map +0 -1
  398. package/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.js.map +0 -1
  399. package/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.d.ts +0 -5
  400. package/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.js +0 -4
  401. package/node_modules/lru-cache/dist/esm/browser/index.d.ts +0 -1400
  402. package/node_modules/lru-cache/dist/esm/browser/index.d.ts.map +0 -1
  403. package/node_modules/lru-cache/dist/esm/browser/index.js +0 -1722
  404. package/node_modules/lru-cache/dist/esm/browser/index.js.map +0 -1
  405. package/node_modules/lru-cache/dist/esm/browser/index.min.js +0 -2
  406. package/node_modules/lru-cache/dist/esm/browser/index.min.js.map +0 -7
  407. package/node_modules/lru-cache/dist/esm/browser/perf.d.ts +0 -12
  408. package/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map +0 -1
  409. package/node_modules/lru-cache/dist/esm/browser/perf.js +0 -7
  410. package/node_modules/lru-cache/dist/esm/browser/perf.js.map +0 -1
  411. package/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.d.mts.map +0 -1
  412. package/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.mjs.map +0 -1
  413. package/node_modules/lru-cache/dist/esm/diagnostics-channel.d.ts +0 -5
  414. package/node_modules/lru-cache/dist/esm/diagnostics-channel.js +0 -19
  415. package/node_modules/lru-cache/dist/esm/index.d.ts +0 -1400
  416. package/node_modules/lru-cache/dist/esm/index.d.ts.map +0 -1
  417. package/node_modules/lru-cache/dist/esm/index.js +0 -1722
  418. package/node_modules/lru-cache/dist/esm/index.js.map +0 -1
  419. package/node_modules/lru-cache/dist/esm/index.min.js +0 -2
  420. package/node_modules/lru-cache/dist/esm/index.min.js.map +0 -7
  421. package/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.ts.map +0 -1
  422. package/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.js.map +0 -1
  423. package/node_modules/lru-cache/dist/esm/node/diagnostics-channel.d.ts +0 -5
  424. package/node_modules/lru-cache/dist/esm/node/diagnostics-channel.js +0 -6
  425. package/node_modules/lru-cache/dist/esm/node/index.d.ts +0 -1400
  426. package/node_modules/lru-cache/dist/esm/node/index.d.ts.map +0 -1
  427. package/node_modules/lru-cache/dist/esm/node/index.js +0 -1722
  428. package/node_modules/lru-cache/dist/esm/node/index.js.map +0 -1
  429. package/node_modules/lru-cache/dist/esm/node/index.min.js +0 -2
  430. package/node_modules/lru-cache/dist/esm/node/index.min.js.map +0 -7
  431. package/node_modules/lru-cache/dist/esm/node/perf.d.ts +0 -12
  432. package/node_modules/lru-cache/dist/esm/node/perf.d.ts.map +0 -1
  433. package/node_modules/lru-cache/dist/esm/node/perf.js +0 -7
  434. package/node_modules/lru-cache/dist/esm/node/perf.js.map +0 -1
  435. package/node_modules/lru-cache/dist/esm/package.json +0 -3
  436. package/node_modules/lru-cache/dist/esm/perf.d.ts +0 -12
  437. package/node_modules/lru-cache/dist/esm/perf.d.ts.map +0 -1
  438. package/node_modules/lru-cache/dist/esm/perf.js +0 -7
  439. package/node_modules/lru-cache/dist/esm/perf.js.map +0 -1
  440. package/node_modules/lru-memoizer/lib/async.d.ts.map +0 -1
  441. package/node_modules/lru-memoizer/lib/async.js.map +0 -1
  442. package/node_modules/lru-memoizer/lib/freeze.d.ts.map +0 -1
  443. package/node_modules/lru-memoizer/lib/freeze.js.map +0 -1
  444. package/node_modules/lru-memoizer/lib/index.d.ts.map +0 -1
  445. package/node_modules/lru-memoizer/lib/index.js.map +0 -1
  446. package/node_modules/lru-memoizer/lib/sync.d.ts.map +0 -1
  447. package/node_modules/lru-memoizer/lib/sync.js.map +0 -1
  448. package/node_modules/lru-memoizer/lib/util.d.ts.map +0 -1
  449. package/node_modules/lru-memoizer/lib/util.js.map +0 -1
  450. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/index.js +0 -0
  451. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/jwe/compact/decrypt.js +0 -0
  452. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/jwe/compact/encrypt.js +0 -0
  453. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/jwe/flattened/decrypt.js +0 -0
  454. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/jwe/flattened/encrypt.js +0 -0
  455. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/jwe/general/decrypt.js +0 -0
  456. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/jwe/general/encrypt.js +0 -0
  457. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/jwk/embedded.js +0 -0
  458. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/jwk/thumbprint.js +0 -0
  459. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/jwks/local.js +0 -0
  460. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/jwks/remote.js +0 -0
  461. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/jws/compact/sign.js +0 -0
  462. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/jws/compact/verify.js +0 -0
  463. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/jws/flattened/sign.js +0 -0
  464. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/jws/flattened/verify.js +0 -0
  465. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/jws/general/sign.js +0 -0
  466. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/jws/general/verify.js +0 -0
  467. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/jwt/decrypt.js +0 -0
  468. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/jwt/encrypt.js +0 -0
  469. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/jwt/produce.js +0 -0
  470. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/jwt/sign.js +0 -0
  471. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/jwt/unsecured.js +0 -0
  472. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/jwt/verify.js +0 -0
  473. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/key/export.js +0 -0
  474. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/key/generate_key_pair.js +0 -0
  475. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/key/generate_secret.js +0 -0
  476. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/key/import.js +0 -0
  477. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/lib/aesgcmkw.js +0 -0
  478. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/lib/buffer_utils.js +0 -0
  479. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/lib/cek.js +0 -0
  480. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/lib/check_iv_length.js +0 -0
  481. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/lib/check_key_type.js +0 -0
  482. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/lib/check_p2s.js +0 -0
  483. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/lib/crypto_key.js +0 -0
  484. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/lib/decrypt_key_management.js +0 -0
  485. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/lib/encrypt_key_management.js +0 -0
  486. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/lib/epoch.js +0 -0
  487. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/lib/format_pem.js +0 -0
  488. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/lib/invalid_key_input.js +0 -0
  489. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/lib/is_disjoint.js +0 -0
  490. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/lib/is_object.js +0 -0
  491. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/lib/iv.js +0 -0
  492. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/lib/jwt_claims_set.js +0 -0
  493. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/lib/secs.js +0 -0
  494. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/lib/validate_algorithms.js +0 -0
  495. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/lib/validate_crit.js +0 -0
  496. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/package.json +0 -0
  497. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/aeskw.js +0 -0
  498. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/asn1.js +0 -0
  499. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/base64url.js +0 -0
  500. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/bogus.js +0 -0
  501. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/check_cek_length.js +0 -0
  502. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/check_key_length.js +0 -0
  503. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/decrypt.js +0 -0
  504. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/digest.js +0 -0
  505. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/ecdhes.js +0 -0
  506. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/encrypt.js +0 -0
  507. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/fetch_jwks.js +0 -0
  508. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/generate.js +0 -0
  509. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/get_sign_verify_key.js +0 -0
  510. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/is_key_like.js +0 -0
  511. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/jwk_to_key.js +0 -0
  512. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/key_to_jwk.js +0 -0
  513. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/pbes2kw.js +0 -0
  514. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/random.js +0 -0
  515. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/rsaes.js +0 -0
  516. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/runtime.js +0 -0
  517. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/sign.js +0 -0
  518. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/subtle_dsa.js +0 -0
  519. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/subtle_rsaes.js +0 -0
  520. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/timing_safe_equal.js +0 -0
  521. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/verify.js +0 -0
  522. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/webcrypto.js +0 -0
  523. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/runtime/zlib.js +0 -0
  524. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/util/base64url.js +0 -0
  525. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/util/decode_jwt.js +0 -0
  526. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/util/decode_protected_header.js +0 -0
  527. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/util/errors.js +0 -0
  528. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/browser/util/runtime.js +0 -0
  529. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/index.js +0 -0
  530. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/jwe/compact/decrypt.js +0 -0
  531. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/jwe/compact/encrypt.js +0 -0
  532. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/jwe/flattened/decrypt.js +0 -0
  533. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/jwe/flattened/encrypt.js +0 -0
  534. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/jwe/general/decrypt.js +0 -0
  535. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/jwe/general/encrypt.js +0 -0
  536. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/jwk/embedded.js +0 -0
  537. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/jwk/thumbprint.js +0 -0
  538. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/jwks/local.js +0 -0
  539. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/jwks/remote.js +0 -0
  540. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/jws/compact/sign.js +0 -0
  541. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/jws/compact/verify.js +0 -0
  542. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/jws/flattened/sign.js +0 -0
  543. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/jws/flattened/verify.js +0 -0
  544. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/jws/general/sign.js +0 -0
  545. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/jws/general/verify.js +0 -0
  546. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/jwt/decrypt.js +0 -0
  547. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/jwt/encrypt.js +0 -0
  548. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/jwt/produce.js +0 -0
  549. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/jwt/sign.js +0 -0
  550. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/jwt/unsecured.js +0 -0
  551. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/jwt/verify.js +0 -0
  552. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/key/export.js +0 -0
  553. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/key/generate_key_pair.js +0 -0
  554. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/key/generate_secret.js +0 -0
  555. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/key/import.js +0 -0
  556. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/lib/aesgcmkw.js +0 -0
  557. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/lib/buffer_utils.js +0 -0
  558. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/lib/cek.js +0 -0
  559. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/lib/check_iv_length.js +0 -0
  560. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/lib/check_key_type.js +0 -0
  561. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/lib/check_p2s.js +0 -0
  562. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/lib/crypto_key.js +0 -0
  563. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/lib/decrypt_key_management.js +0 -0
  564. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/lib/encrypt_key_management.js +0 -0
  565. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/lib/epoch.js +0 -0
  566. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/lib/invalid_key_input.js +0 -0
  567. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/lib/is_disjoint.js +0 -0
  568. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/lib/is_object.js +0 -0
  569. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/lib/iv.js +0 -0
  570. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/lib/jwt_claims_set.js +0 -0
  571. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/lib/secs.js +0 -0
  572. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/lib/validate_algorithms.js +0 -0
  573. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/lib/validate_crit.js +0 -0
  574. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/aeskw.js +0 -0
  575. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/asn1.js +0 -0
  576. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/asn1_sequence_decoder.js +0 -0
  577. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/asn1_sequence_encoder.js +0 -0
  578. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/base64url.js +0 -0
  579. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/cbc_tag.js +0 -0
  580. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/check_cek_length.js +0 -0
  581. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/check_modulus_length.js +0 -0
  582. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/ciphers.js +0 -0
  583. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/decrypt.js +0 -0
  584. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/digest.js +0 -0
  585. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/dsa_digest.js +0 -0
  586. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/ecdhes.js +0 -0
  587. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/encrypt.js +0 -0
  588. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/fetch_jwks.js +0 -0
  589. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/flags.js +0 -0
  590. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/generate.js +0 -0
  591. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/get_named_curve.js +0 -0
  592. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/get_sign_verify_key.js +0 -0
  593. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/hmac_digest.js +0 -0
  594. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/is_key_like.js +0 -0
  595. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/is_key_object.js +0 -0
  596. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/jwk_to_key.js +0 -0
  597. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/key_to_jwk.js +0 -0
  598. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/node_key.js +0 -0
  599. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/pbes2kw.js +0 -0
  600. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/random.js +0 -0
  601. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/rsaes.js +0 -0
  602. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/runtime.js +0 -0
  603. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/sign.js +0 -0
  604. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/timing_safe_equal.js +0 -0
  605. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/verify.js +0 -0
  606. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/webcrypto.js +0 -0
  607. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/runtime/zlib.js +0 -0
  608. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/util/base64url.js +0 -0
  609. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/util/decode_jwt.js +0 -0
  610. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/util/decode_protected_header.js +0 -0
  611. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/util/errors.js +0 -0
  612. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/cjs/util/runtime.js +0 -0
  613. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/index.js +0 -0
  614. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/jwe/compact/decrypt.js +0 -0
  615. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/jwe/compact/encrypt.js +0 -0
  616. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/jwe/flattened/decrypt.js +0 -0
  617. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/jwe/flattened/encrypt.js +0 -0
  618. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/jwe/general/decrypt.js +0 -0
  619. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/jwe/general/encrypt.js +0 -0
  620. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/jwk/embedded.js +0 -0
  621. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/jwk/thumbprint.js +0 -0
  622. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/jwks/local.js +0 -0
  623. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/jwks/remote.js +0 -0
  624. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/jws/compact/sign.js +0 -0
  625. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/jws/compact/verify.js +0 -0
  626. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/jws/flattened/sign.js +0 -0
  627. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/jws/flattened/verify.js +0 -0
  628. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/jws/general/sign.js +0 -0
  629. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/jws/general/verify.js +0 -0
  630. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/jwt/decrypt.js +0 -0
  631. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/jwt/encrypt.js +0 -0
  632. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/jwt/produce.js +0 -0
  633. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/jwt/sign.js +0 -0
  634. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/jwt/unsecured.js +0 -0
  635. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/jwt/verify.js +0 -0
  636. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/key/export.js +0 -0
  637. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/key/generate_key_pair.js +0 -0
  638. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/key/generate_secret.js +0 -0
  639. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/key/import.js +0 -0
  640. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/lib/aesgcmkw.js +0 -0
  641. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/lib/buffer_utils.js +0 -0
  642. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/lib/cek.js +0 -0
  643. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/lib/check_iv_length.js +0 -0
  644. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/lib/check_key_type.js +0 -0
  645. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/lib/check_p2s.js +0 -0
  646. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/lib/crypto_key.js +0 -0
  647. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/lib/decrypt_key_management.js +0 -0
  648. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/lib/encrypt_key_management.js +0 -0
  649. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/lib/epoch.js +0 -0
  650. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/lib/invalid_key_input.js +0 -0
  651. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/lib/is_disjoint.js +0 -0
  652. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/lib/is_object.js +0 -0
  653. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/lib/iv.js +0 -0
  654. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/lib/jwt_claims_set.js +0 -0
  655. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/lib/secs.js +0 -0
  656. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/lib/validate_algorithms.js +0 -0
  657. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/lib/validate_crit.js +0 -0
  658. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/package.json +0 -0
  659. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/aeskw.js +0 -0
  660. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/asn1.js +0 -0
  661. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/asn1_sequence_decoder.js +0 -0
  662. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/asn1_sequence_encoder.js +0 -0
  663. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/base64url.js +0 -0
  664. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/cbc_tag.js +0 -0
  665. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/check_cek_length.js +0 -0
  666. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/check_modulus_length.js +0 -0
  667. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/ciphers.js +0 -0
  668. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/decrypt.js +0 -0
  669. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/digest.js +0 -0
  670. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/dsa_digest.js +0 -0
  671. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/ecdhes.js +0 -0
  672. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/encrypt.js +0 -0
  673. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/fetch_jwks.js +0 -0
  674. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/flags.js +0 -0
  675. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/generate.js +0 -0
  676. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/get_named_curve.js +0 -0
  677. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/get_sign_verify_key.js +0 -0
  678. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/hmac_digest.js +0 -0
  679. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/is_key_like.js +0 -0
  680. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/is_key_object.js +0 -0
  681. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/jwk_to_key.js +0 -0
  682. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/key_to_jwk.js +0 -0
  683. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/node_key.js +0 -0
  684. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/pbes2kw.js +0 -0
  685. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/random.js +0 -0
  686. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/rsaes.js +0 -0
  687. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/runtime.js +0 -0
  688. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/sign.js +0 -0
  689. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/timing_safe_equal.js +0 -0
  690. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/verify.js +0 -0
  691. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/webcrypto.js +0 -0
  692. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/runtime/zlib.js +0 -0
  693. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/util/base64url.js +0 -0
  694. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/util/decode_jwt.js +0 -0
  695. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/util/decode_protected_header.js +0 -0
  696. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/util/errors.js +0 -0
  697. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/node/esm/util/runtime.js +0 -0
  698. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/types/jwt/produce.d.ts +0 -0
  699. /package/node_modules/{@microsoft/teams.apps/node_modules/jose → jose}/dist/types/util/runtime.d.ts +0 -0
  700. /package/node_modules/{@microsoft/teams.apps/node_modules/lru-cache → lru-cache}/LICENSE +0 -0
  701. /package/node_modules/{@microsoft/teams.apps/node_modules/lru-cache → lru-cache}/index.js +0 -0
@@ -1,11 +1,11 @@
1
1
  import { A as summarizeMapping, D as resolveDefaultGroupPolicy, E as resolveChannelMediaMaxBytes, M as getMSTeamsRuntime, N as getOptionalMSTeamsRuntime, _ as isDangerousNameMatchingEnabled, a as buildMediaPayload, b as logTypingFailure, c as createChannelMessageReplyPipeline, f as dispatchReplyFromConfigWithSettledDispatcher$1, l as createChannelPairingController, n as DEFAULT_WEBHOOK_MAX_BODY_BYTES, t as DEFAULT_ACCOUNT_ID, v as keepHttpServerTaskAlive, x as mergeAllowlist } from "./runtime-api-BlvMnDKz.js";
2
- import { $ as safeHostForUrl, B as extractHtmlFromAttachment, C as loadMSTeamsSdkWithAuth, D as formatMSTeamsSendErrorHint, E as classifyMSTeamsSendError, F as GRAPH_ROOT, G as isRecord$1, H as inferPlaceholder, I as IMG_SRC_RE, J as readNestedString, K as isUrlAllowed, L as applyAuthorizationHeaderForUrl, N as tryNormalizeBotFrameworkServiceUrl, O as formatUnknownError, P as ATTACHMENT_TAG_RE, Q as safeFetchWithPolicy, R as encodeGraphShareId, S as createMSTeamsTokenProvider, T as ensureUserAgentHeader, U as isDownloadableAttachment, V as extractInlineImageCandidates, W as isLikelyImageAttachment, X as resolveMediaSsrfPolicy, Y as resolveAttachmentFetchPolicy, Z as resolveRequestUrl, _ as resolveMSTeamsStorePath, a as fetchGraphJson, b as createBotFrameworkJwtValidator, et as tryBuildGraphSharesUrlForSharedLink, h as resolveMSTeamsCredentials, q as normalizeContentType, w as buildUserAgent, x as createMSTeamsAdapter, z as estimateBase64DecodedBytes } from "./graph-users-uPAE6-KQ.js";
3
- import { d as resolveMSTeamsUserAllowlist, u as resolveMSTeamsChannelAllowlist } from "./setup-surface-evwYex71.js";
4
- import { a as resolveMSTeamsReplyPolicy, i as resolveMSTeamsAllowlistMatch, o as resolveMSTeamsRouteConfig } from "./channel-c7nnGfMx.js";
5
- import { C as readJsonFile, S as createMSTeamsConversationStoreFs, T as writeJsonFile, _ as buildFileInfoCard, b as createMSTeamsPollStoreFs, c as renderReplyPayloadsToMessages, d as withRevokedProxyFallback, f as resolveGraphChatId, g as removePendingUploadFs, h as getPendingUploadFs, l as sendMSTeamsMessages, m as removePendingUpload, p as getPendingUpload, s as buildConversationReference, u as AI_GENERATED_ENTITY, v as parseFileConsentInvoke, w as withFileLock, x as extractMSTeamsPollVote, y as uploadToConsentUrl } from "./probe-istgFnuw.js";
2
+ import { $ as safeFetchWithPolicy, B as estimateBase64DecodedBytes, E as loadMSTeamsSdkWithAuth, F as ATTACHMENT_TAG_RE, G as isLikelyImageAttachment, H as extractInlineImageCandidates, I as GRAPH_ROOT, J as normalizeContentType, K as isRecord$1, L as IMG_SRC_RE, M as tryNormalizeBotFrameworkServiceUrl, N as resolveMSTeamsSdkCloudOptions, O as ensureUserAgentHeader, Q as resolveRequestUrl, R as applyAuthorizationHeaderForUrl, T as createMSTeamsTokenProvider, U as inferPlaceholder, V as extractHtmlFromAttachment, W as isDownloadableAttachment, X as resolveAttachmentFetchPolicy, Y as readNestedString, Z as resolveMediaSsrfPolicy, et as safeHostForUrl, l as fetchGraphJson, n as formatMSTeamsSendErrorHint, q as isUrlAllowed, r as formatUnknownError, t as classifyMSTeamsSendError, tt as tryBuildGraphSharesUrlForSharedLink, w as createMSTeamsExpressAdapter, x as resolveMSTeamsStorePath, y as resolveMSTeamsCredentials, z as encodeGraphShareId } from "./errors-B4snzfP5.js";
3
+ import { d as resolveMSTeamsUserAllowlist, u as resolveMSTeamsChannelAllowlist } from "./setup-surface-C-uCiIKh.js";
4
+ import { a as resolveMSTeamsReplyPolicy, i as resolveMSTeamsAllowlistMatch, o as resolveMSTeamsRouteConfig } from "./channel-C_AMaSpi.js";
5
+ import { C as readJsonFile, S as createMSTeamsConversationStoreFs, T as writeJsonFile, _ as buildFileInfoCard, b as createMSTeamsPollStoreFs, c as renderReplyPayloadsToMessages, d as withRevokedProxyFallback, f as resolveGraphChatId, g as removePendingUploadFs, h as getPendingUploadFs, l as sendMSTeamsMessages, m as removePendingUpload, p as getPendingUpload, s as buildConversationReference, u as sendMSTeamsActivityWithReference, v as parseFileConsentInvoke, w as withFileLock, x as extractMSTeamsPollVote, y as uploadToConsentUrl } from "./probe-DRwI-ZqW.js";
6
6
  import { formatAllowlistMatchMeta } from "openclaw/plugin-sdk/allow-from";
7
- import { buildChannelProgressDraftLine, buildChannelProgressDraftLineForEntry, createChannelProgressDraftGate, createDraftStreamLoop, createLiveMessageState, createPreviewMessageReceipt, defineFinalizableLivePreviewAdapter, deliverWithFinalizableLivePreviewAdapter, formatChannelProgressDraftText, isChannelProgressDraftWorkToolName, markLiveMessageFinalized, mergeChannelProgressDraftLine, normalizeChannelProgressDraftLineIdentity, resolveChannelPreviewStreamMode, resolveChannelProgressDraftMaxLines, resolveChannelStreamingBlockEnabled, resolveChannelStreamingPreviewToolProgress } from "openclaw/plugin-sdk/channel-outbound";
8
- import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, readStringValue, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
7
+ import { buildChannelProgressDraftLine, buildChannelProgressDraftLineForEntry, createChannelProgressDraftGate, formatChannelProgressDraftText, isChannelProgressDraftWorkToolName, mergeChannelProgressDraftLine, normalizeChannelProgressDraftLineIdentity, resolveChannelPreviewStreamMode, resolveChannelProgressDraftMaxLines, resolveChannelStreamingBlockEnabled, resolveChannelStreamingPreviewToolProgress, resolveChannelStreamingSuppressDefaultToolProgressMessages } from "openclaw/plugin-sdk/channel-outbound";
8
+ import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
9
9
  import { saveResponseMedia } from "openclaw/plugin-sdk/media-runtime";
10
10
  import { buildChannelInboundEventContext, dispatchReplyFromConfigWithSettledDispatcher, hasFinalInboundReplyDispatch, logInboundDrop, resolveInboundMentionDecision, resolveInboundReplyDispatchCounts, resolveInboundSessionEnvelopeContext } from "openclaw/plugin-sdk/channel-inbound";
11
11
  import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
@@ -195,16 +195,11 @@ function createReflectionCaptureDispatcher(params) {
195
195
  };
196
196
  }
197
197
  async function sendReflectionFollowUp(params) {
198
- const proactiveRef = {
199
- ...buildConversationReference(params.conversationRef),
200
- activityId: void 0
201
- };
202
- await params.adapter.continueConversation(params.appId, proactiveRef, async (ctx) => {
203
- await ctx.sendActivity({
204
- type: "message",
205
- text: params.userMessage
206
- });
207
- });
198
+ const baseRef = buildConversationReference(params.conversationRef);
199
+ await sendMSTeamsActivityWithReference(params.app, baseRef, {
200
+ type: "message",
201
+ text: params.userMessage
202
+ }, { serviceUrlBoundary: resolveMSTeamsSdkCloudOptions(params.cfg.channels?.msteams) });
208
203
  }
209
204
  /**
210
205
  * Run a background reflection after negative feedback.
@@ -280,8 +275,8 @@ async function runFeedbackReflection(params) {
280
275
  }
281
276
  try {
282
277
  await sendReflectionFollowUp({
283
- adapter: params.adapter,
284
- appId: params.appId,
278
+ cfg,
279
+ app: params.app,
285
280
  conversationRef: params.conversationRef,
286
281
  userMessage: parsedReflection.userMessage
287
282
  });
@@ -367,114 +362,6 @@ function wasMSTeamsBotMentioned(activity) {
367
362
  return (activity.entities ?? []).some((e) => e.type === "mention" && e.mentioned?.id === botId);
368
363
  }
369
364
  //#endregion
370
- //#region extensions/msteams/src/file-consent-invoke.ts
371
- /**
372
- * Handle fileConsent/invoke activities for large file uploads.
373
- */
374
- async function handleMSTeamsFileConsentInvoke(context, log) {
375
- const expiredUploadMessage = "The file upload request has expired. Please try sending the file again.";
376
- const activity = context.activity;
377
- if (activity.type !== "invoke" || activity.name !== "fileConsent/invoke") return false;
378
- const consentResponse = parseFileConsentInvoke(activity);
379
- if (!consentResponse) {
380
- log.debug?.("invalid file consent invoke", { value: activity.value });
381
- return false;
382
- }
383
- const uploadId = typeof consentResponse.context?.uploadId === "string" ? consentResponse.context.uploadId : void 0;
384
- const inMemoryFile = getPendingUpload(uploadId);
385
- const fsFile = inMemoryFile ? void 0 : await getPendingUploadFs(uploadId);
386
- const pendingFile = inMemoryFile ?? fsFile;
387
- if (pendingFile) {
388
- const pendingConversationId = normalizeMSTeamsConversationId(pendingFile.conversationId);
389
- const invokeConversationId = normalizeMSTeamsConversationId(activity.conversation?.id ?? "");
390
- if (!invokeConversationId || pendingConversationId !== invokeConversationId) {
391
- log.info("file consent conversation mismatch", {
392
- uploadId,
393
- expectedConversationId: pendingConversationId,
394
- receivedConversationId: invokeConversationId || void 0
395
- });
396
- if (consentResponse.action === "accept") await context.sendActivity(expiredUploadMessage);
397
- return true;
398
- }
399
- }
400
- if (consentResponse.action === "accept" && consentResponse.uploadInfo) if (pendingFile) {
401
- log.debug?.("user accepted file consent, uploading", {
402
- uploadId,
403
- filename: pendingFile.filename,
404
- size: pendingFile.buffer.length
405
- });
406
- try {
407
- await uploadToConsentUrl({
408
- url: consentResponse.uploadInfo.uploadUrl,
409
- buffer: pendingFile.buffer,
410
- contentType: pendingFile.contentType
411
- });
412
- const fileInfoCard = buildFileInfoCard({
413
- filename: consentResponse.uploadInfo.name,
414
- contentUrl: consentResponse.uploadInfo.contentUrl,
415
- uniqueId: consentResponse.uploadInfo.uniqueId,
416
- fileType: consentResponse.uploadInfo.fileType
417
- });
418
- if (!pendingFile.consentCardActivityId) await context.sendActivity({
419
- type: "message",
420
- attachments: [fileInfoCard]
421
- });
422
- if (pendingFile.consentCardActivityId) try {
423
- await context.updateActivity({
424
- id: pendingFile.consentCardActivityId,
425
- type: "message",
426
- attachments: [fileInfoCard]
427
- });
428
- } catch {
429
- await context.sendActivity({
430
- type: "message",
431
- attachments: [fileInfoCard]
432
- });
433
- }
434
- log.info("file upload complete", {
435
- uploadId,
436
- filename: consentResponse.uploadInfo.name,
437
- uniqueId: consentResponse.uploadInfo.uniqueId
438
- });
439
- } catch (err) {
440
- log.error("file upload failed", {
441
- uploadId,
442
- error: formatUnknownError(err)
443
- });
444
- await context.sendActivity("File upload failed. Please try again.");
445
- } finally {
446
- removePendingUpload(uploadId);
447
- await removePendingUploadFs(uploadId);
448
- }
449
- } else {
450
- log.debug?.("pending file not found for consent", { uploadId });
451
- await context.sendActivity(expiredUploadMessage);
452
- }
453
- else {
454
- log.debug?.("user declined file consent", { uploadId });
455
- removePendingUpload(uploadId);
456
- await removePendingUploadFs(uploadId);
457
- }
458
- return true;
459
- }
460
- async function respondToMSTeamsFileConsentInvoke(context, log) {
461
- await context.sendActivity({
462
- type: "invokeResponse",
463
- value: { status: 200 }
464
- });
465
- try {
466
- await withRevokedProxyFallback({
467
- run: async () => await handleMSTeamsFileConsentInvoke(context, log),
468
- onRevoked: async () => true,
469
- onRevokedLog: () => {
470
- log.debug?.("turn context revoked during file consent invoke; skipping delayed response");
471
- }
472
- });
473
- } catch (err) {
474
- log.debug?.("file consent handler error", { error: formatUnknownError(err) });
475
- }
476
- }
477
- //#endregion
478
365
  //#region extensions/msteams/src/monitor-handler/access.ts
479
366
  const msteamsIngressIdentity = {
480
367
  key: "sender-id",
@@ -594,6 +481,16 @@ function isBotFrameworkPersonalChatId(conversationId) {
594
481
  function normalizeServiceUrl(serviceUrl) {
595
482
  return serviceUrl.replace(/\/+$/, "");
596
483
  }
484
+ function buildBotFrameworkAttachmentHeaders(params) {
485
+ const headers = ensureUserAgentHeader();
486
+ applyAuthorizationHeaderForUrl({
487
+ headers,
488
+ url: params.url,
489
+ authAllowHosts: params.policy.authAllowHosts,
490
+ bearerToken: params.accessToken
491
+ });
492
+ return headers;
493
+ }
597
494
  async function fetchBotFrameworkAttachmentInfo(params) {
598
495
  const url = `${normalizeServiceUrl(params.serviceUrl)}/v3/attachments/${encodeURIComponent(params.attachmentId)}`;
599
496
  let response;
@@ -602,14 +499,20 @@ async function fetchBotFrameworkAttachmentInfo(params) {
602
499
  url,
603
500
  policy: params.policy,
604
501
  fetchFn: params.fetchFn,
502
+ fetchFnSupportsDispatcher: params.fetchFnSupportsDispatcher,
605
503
  resolveFn: params.resolveFn,
606
- requestInit: { headers: ensureUserAgentHeader({ Authorization: `Bearer ${params.accessToken}` }) }
504
+ requestInit: { headers: buildBotFrameworkAttachmentHeaders({
505
+ url,
506
+ accessToken: params.accessToken,
507
+ policy: params.policy
508
+ }) }
607
509
  });
608
510
  } catch (err) {
609
511
  params.logger?.warn?.("msteams botFramework attachmentInfo fetch failed", { error: err instanceof Error ? err.message : String(err) });
610
512
  return;
611
513
  }
612
514
  if (!response.ok) {
515
+ await response.body?.cancel();
613
516
  params.logger?.warn?.("msteams botFramework attachmentInfo non-ok", { status: response.status });
614
517
  return;
615
518
  }
@@ -628,19 +531,28 @@ async function saveBotFrameworkAttachmentView(params) {
628
531
  url,
629
532
  policy: params.policy,
630
533
  fetchFn: params.fetchFn,
534
+ fetchFnSupportsDispatcher: params.fetchFnSupportsDispatcher,
631
535
  resolveFn: params.resolveFn,
632
- requestInit: { headers: ensureUserAgentHeader({ Authorization: `Bearer ${params.accessToken}` }) }
536
+ requestInit: { headers: buildBotFrameworkAttachmentHeaders({
537
+ url,
538
+ accessToken: params.accessToken,
539
+ policy: params.policy
540
+ }) }
633
541
  });
634
542
  } catch (err) {
635
543
  params.logger?.warn?.("msteams botFramework attachmentView fetch failed", { error: err instanceof Error ? err.message : String(err) });
636
544
  return;
637
545
  }
638
546
  if (!response.ok) {
547
+ await response.body?.cancel();
639
548
  params.logger?.warn?.("msteams botFramework attachmentView non-ok", { status: response.status });
640
549
  return;
641
550
  }
642
551
  const contentLength = response.headers.get("content-length");
643
- if (contentLength && Number(contentLength) > params.maxBytes) return;
552
+ if (contentLength && Number(contentLength) > params.maxBytes) {
553
+ await response.body?.cancel();
554
+ return;
555
+ }
644
556
  try {
645
557
  return await getMSTeamsRuntime().channel.media.saveResponseMedia(response, {
646
558
  sourceUrl: url,
@@ -682,6 +594,7 @@ async function downloadMSTeamsBotFrameworkAttachment(params) {
682
594
  accessToken,
683
595
  policy,
684
596
  fetchFn: params.fetchFn,
597
+ fetchFnSupportsDispatcher: params.fetchFnSupportsDispatcher,
685
598
  resolveFn: params.resolveFn,
686
599
  logger: params.logger
687
600
  });
@@ -704,6 +617,7 @@ async function downloadMSTeamsBotFrameworkAttachment(params) {
704
617
  preserveFilenames: params.preserveFilenames,
705
618
  policy,
706
619
  fetchFn: params.fetchFn,
620
+ fetchFnSupportsDispatcher: params.fetchFnSupportsDispatcher,
707
621
  resolveFn: params.resolveFn,
708
622
  logger: params.logger
709
623
  });
@@ -747,6 +661,7 @@ async function downloadMSTeamsBotFrameworkAttachments(params) {
747
661
  allowHosts: params.allowHosts,
748
662
  authAllowHosts: params.authAllowHosts,
749
663
  fetchFn: params.fetchFn,
664
+ fetchFnSupportsDispatcher: params.fetchFnSupportsDispatcher,
750
665
  resolveFn: params.resolveFn,
751
666
  fileNameHint: params.fileNameHint,
752
667
  contentTypeHint: params.contentTypeHint,
@@ -768,17 +683,9 @@ async function downloadMSTeamsBotFrameworkAttachments(params) {
768
683
  //#endregion
769
684
  //#region extensions/msteams/src/attachments/remote-media.ts
770
685
  /**
771
- * Direct fetch path used when the caller's `fetchImpl` has already validated
772
- * the URL against a hostname allowlist (for example `safeFetchWithPolicy`).
773
- *
774
- * Bypasses the strict SSRF dispatcher on `readRemoteMediaBuffer` because:
775
- * 1. The pinned undici dispatcher used by `readRemoteMediaBuffer` is incompatible
776
- * with Node 24+'s built-in undici v7 (fails with "invalid onRequestStart
777
- * method"), which silently breaks SharePoint/OneDrive downloads. See
778
- * issue #63396.
779
- * 2. SSRF protection is already enforced by the caller's `fetchImpl`
780
- * (`safeFetch` validates every redirect hop against the hostname
781
- * allowlist before following).
686
+ * Direct save path used when the caller supplies the already-guarded fetch
687
+ * implementation. This lets Teams-specific auth fallback own the request
688
+ * sequence while keeping redirect and DNS pinning inside `safeFetchWithPolicy`.
782
689
  */
783
690
  async function saveRemoteMediaDirect(params) {
784
691
  return await saveResponseMedia(await params.fetchImpl(params.url, { redirect: "follow" }), {
@@ -878,6 +785,7 @@ async function fetchWithAuthFallback(params) {
878
785
  url: params.url,
879
786
  policy: params.policy,
880
787
  fetchFn: params.fetchFn,
788
+ fetchFnSupportsDispatcher: params.fetchFnSupportsDispatcher,
881
789
  requestInit: params.requestInit,
882
790
  resolveFn: params.resolveFn
883
791
  });
@@ -885,6 +793,7 @@ async function fetchWithAuthFallback(params) {
885
793
  if (!params.tokenProvider) return firstAttempt;
886
794
  if (firstAttempt.status !== 401 && firstAttempt.status !== 403) return firstAttempt;
887
795
  if (!isUrlAllowed(params.url, params.policy.authAllowHosts)) return firstAttempt;
796
+ await firstAttempt.body?.cancel();
888
797
  const scopes = scopeCandidatesForUrl(params.url);
889
798
  const fetchFn = params.fetchFn ?? fetch;
890
799
  for (const scope of scopes) try {
@@ -895,6 +804,7 @@ async function fetchWithAuthFallback(params) {
895
804
  url: params.url,
896
805
  policy: params.policy,
897
806
  fetchFn,
807
+ fetchFnSupportsDispatcher: params.fetchFnSupportsDispatcher,
898
808
  requestInit: {
899
809
  ...params.requestInit,
900
810
  headers: authHeaders
@@ -903,7 +813,11 @@ async function fetchWithAuthFallback(params) {
903
813
  });
904
814
  if (authAttempt.ok) return authAttempt;
905
815
  if (isRedirectStatus(authAttempt.status)) return authAttempt;
906
- if (authAttempt.status !== 401 && authAttempt.status !== 403) continue;
816
+ if (authAttempt.status !== 401 && authAttempt.status !== 403) {
817
+ await authAttempt.body?.cancel();
818
+ continue;
819
+ }
820
+ await authAttempt.body?.cancel();
907
821
  } catch {}
908
822
  return firstAttempt;
909
823
  }
@@ -971,6 +885,7 @@ async function downloadMSTeamsAttachments(params) {
971
885
  url: resolveRequestUrl(input),
972
886
  tokenProvider: params.tokenProvider,
973
887
  fetchFn: params.fetchFn,
888
+ fetchFnSupportsDispatcher: params.fetchFnSupportsDispatcher,
974
889
  requestInit: init,
975
890
  resolveFn: params.resolveFn,
976
891
  policy
@@ -978,10 +893,8 @@ async function downloadMSTeamsAttachments(params) {
978
893
  });
979
894
  out.push(media);
980
895
  } catch (err) {
981
- params.logger?.warn?.("msteams attachment download failed", {
982
- error: err instanceof Error ? err.message : String(err),
983
- host: safeHostForLog(candidate.url)
984
- });
896
+ const msg = err instanceof Error ? err.message : String(err);
897
+ params.logger?.warn?.(`msteams attachment download failed host=${safeHostForLog(candidate.url)} error=${msg}`);
985
898
  }
986
899
  }
987
900
  return out;
@@ -1241,6 +1154,7 @@ async function downloadMSTeamsGraphMedia(params) {
1241
1154
  url: requestUrl,
1242
1155
  policy,
1243
1156
  fetchFn,
1157
+ fetchFnSupportsDispatcher: params.fetchFnSupportsDispatcher,
1244
1158
  requestInit: {
1245
1159
  ...init,
1246
1160
  headers
@@ -1297,6 +1211,7 @@ async function downloadMSTeamsGraphMedia(params) {
1297
1211
  allowHosts: policy.allowHosts,
1298
1212
  authAllowHosts: policy.authAllowHosts,
1299
1213
  fetchFn: params.fetchFn,
1214
+ fetchFnSupportsDispatcher: params.fetchFnSupportsDispatcher,
1300
1215
  resolveFn: params.resolveFn,
1301
1216
  preserveFilenames: params.preserveFilenames,
1302
1217
  logger: params.logger
@@ -1568,240 +1483,54 @@ function markParentContextInjected(sessionKey, parentId) {
1568
1483
  touchLru(injectedParents, sessionKey, parentId, INJECTED_MAX);
1569
1484
  }
1570
1485
  //#endregion
1571
- //#region extensions/msteams/src/streaming-message.ts
1486
+ //#region extensions/msteams/src/reply-stream-controller.ts
1487
+ function isStreamCancelledError(err) {
1488
+ return err instanceof Error && err.name === "StreamCancelledError";
1489
+ }
1572
1490
  /**
1573
- * Teams streaming message using the streaminfo entity protocol.
1574
- *
1575
- * Follows the official Teams SDK pattern:
1576
- * 1. First chunk → POST a typing activity with streaminfo entity (streamType: "streaming")
1577
- * 2. Subsequent chunks → POST typing activities with streaminfo + incrementing streamSequence
1578
- * 3. Finalize → POST a message activity with streaminfo (streamType: "final")
1491
+ * Bridges openclaw's reply pipeline callbacks to the SDK's `ctx.stream`.
1492
+ * Streaming is enabled for personal (DM) conversations only; group/channel
1493
+ * messages fall through to block delivery.
1579
1494
  *
1580
- * Uses the shared draft-stream-loop for throttling (avoids rate limits).
1581
- */
1582
- /** Default throttle interval between stream updates (ms).
1583
- * Teams docs recommend buffering tokens for 1.5-2s; limit is 1 req/s. */
1584
- const DEFAULT_THROTTLE_MS = 1500;
1585
- /** Minimum chars before sending the first streaming message. */
1586
- const MIN_INITIAL_CHARS = 20;
1587
- /** Teams message text limit. */
1588
- const TEAMS_MAX_CHARS = 4e3;
1589
- /**
1590
- * Stop streaming before Teams expires the content stream server-side.
1591
- * The exact service limit is opaque, so stay comfortably under it.
1495
+ * Streaming modes (resolved from `cfg.channels.msteams.streaming.preview`):
1496
+ * - "partial" (default): per-token streaming via `stream.emit(text)`. Each
1497
+ * chunk goes onto the live preview card in Teams.
1498
+ * - "progress": no per-token streaming; the preview card carries an
1499
+ * informative status that updates as tools run (e.g. "Looking up the
1500
+ * schema..." "Generating SQL..."). When tool-progress streaming is also
1501
+ * enabled, raw tool names appear as bullets above the label.
1502
+ * - "block": disable native streaming entirely; the reply lands as a regular
1503
+ * block message. We bypass the controller in that case.
1592
1504
  */
1593
- const MAX_STREAM_AGE_MS = 45e3;
1594
- function extractId(response) {
1595
- if (response && typeof response === "object" && "id" in response) return readStringValue(response.id);
1596
- }
1597
- function buildStreamInfoEntity(streamId, streamType, streamSequence) {
1598
- const entity = {
1599
- type: "streaminfo",
1600
- streamType
1601
- };
1602
- if (streamId) entity.streamId = streamId;
1603
- if (streamSequence != null) entity.streamSequence = streamSequence;
1604
- return entity;
1605
- }
1606
- var TeamsHttpStream = class {
1607
- constructor(options) {
1608
- this.accumulatedText = "";
1609
- this.streamId = void 0;
1610
- this.sequenceNumber = 0;
1611
- this.stopped = false;
1612
- this.finalized = false;
1613
- this.streamFailed = false;
1614
- this.lastStreamedText = "";
1615
- this.finalMessageId = void 0;
1616
- this.streamStartedAt = void 0;
1617
- this.sendActivity = options.sendActivity;
1618
- this.feedbackLoopEnabled = options.feedbackLoopEnabled ?? false;
1619
- this.onError = options.onError;
1620
- this.loop = createDraftStreamLoop({
1621
- throttleMs: options.throttleMs ?? DEFAULT_THROTTLE_MS,
1622
- isStopped: () => this.stopped,
1623
- sendOrEditStreamMessage: (text) => this.pushStreamChunk(text)
1624
- });
1625
- }
1626
- /**
1627
- * Send an informative status update (blue progress bar in Teams).
1628
- * Call this immediately when a message is received, before LLM starts generating.
1629
- * Establishes the stream so subsequent chunks continue from this stream ID.
1630
- */
1631
- async sendInformativeUpdate(text) {
1632
- if (this.stopped || this.finalized) return;
1633
- this.sequenceNumber++;
1634
- const activity = {
1635
- type: "typing",
1636
- text,
1637
- entities: [buildStreamInfoEntity(this.streamId, "informative", this.sequenceNumber)]
1638
- };
1639
- try {
1640
- const response = await this.sendActivity(activity);
1641
- if (!this.streamId) this.streamId = extractId(response);
1642
- } catch (err) {
1643
- this.onError?.(err);
1644
- }
1645
- }
1646
- /**
1647
- * Ingest partial text from the LLM token stream.
1648
- * Called by onPartialReply — accumulates text and throttles updates.
1649
- */
1650
- update(text) {
1651
- if (this.stopped || this.finalized) return;
1652
- this.accumulatedText = text;
1653
- if (!this.streamId && this.accumulatedText.length < MIN_INITIAL_CHARS) return;
1654
- if (this.accumulatedText.length > TEAMS_MAX_CHARS) {
1655
- this.streamFailed = true;
1656
- this.finalize();
1657
- return;
1658
- }
1659
- if (this.streamStartedAt && Date.now() - this.streamStartedAt >= MAX_STREAM_AGE_MS) {
1660
- this.streamFailed = true;
1661
- this.finalize();
1662
- return;
1663
- }
1664
- this.loop.update(this.accumulatedText);
1665
- }
1666
- /**
1667
- * Replace an informative progress update with final answer text.
1668
- * Returns false when the stream could not safely carry the final text, so
1669
- * callers can deliver the answer through the normal Teams message path.
1670
- */
1671
- async replaceInformativeWithFinal(text) {
1672
- if (this.stopped || this.finalized) return false;
1673
- this.update(text);
1674
- await this.loop.flush();
1675
- await this.finalize();
1676
- return !this.streamFailed && this.hasContent;
1677
- }
1678
- /**
1679
- * Finalize the stream — send the final message activity.
1680
- */
1681
- async finalize() {
1682
- if (this.finalized) return this.finalMessageId;
1683
- this.finalized = true;
1684
- this.stopped = true;
1685
- this.loop.stop();
1686
- await this.loop.waitForInFlight();
1687
- if (!this.accumulatedText.trim()) return this.finalMessageId;
1688
- if (this.streamFailed) {
1689
- if (this.streamId) try {
1690
- const response = await this.sendActivity({
1691
- type: "message",
1692
- text: this.lastStreamedText || "",
1693
- channelData: { feedbackLoopEnabled: this.feedbackLoopEnabled },
1694
- entities: [AI_GENERATED_ENTITY, buildStreamInfoEntity(this.streamId, "final")]
1695
- });
1696
- this.finalMessageId = extractId(response);
1697
- } catch {}
1698
- return this.finalMessageId;
1699
- }
1700
- try {
1701
- const entities = [AI_GENERATED_ENTITY];
1702
- if (this.streamId) entities.push(buildStreamInfoEntity(this.streamId, "final"));
1703
- const finalActivity = {
1704
- type: "message",
1705
- text: this.accumulatedText,
1706
- channelData: { feedbackLoopEnabled: this.feedbackLoopEnabled },
1707
- entities
1708
- };
1709
- const response = await this.sendActivity(finalActivity);
1710
- this.finalMessageId = extractId(response);
1711
- } catch (err) {
1712
- this.streamFailed = true;
1713
- this.onError?.(err);
1714
- }
1715
- return this.finalMessageId;
1716
- }
1717
- /** Whether streaming successfully delivered content (at least one chunk sent, not failed). */
1718
- get hasContent() {
1719
- return this.accumulatedText.length > 0 && !this.streamFailed;
1720
- }
1721
- /** Whether streaming failed and fallback delivery is needed. */
1722
- get isFailed() {
1723
- return this.streamFailed;
1724
- }
1725
- /** Number of characters successfully streamed before failure. */
1726
- get streamedLength() {
1727
- return this.lastStreamedText.length;
1728
- }
1729
- /** Whether the stream has been finalized. */
1730
- get isFinalized() {
1731
- return this.finalized;
1732
- }
1733
- /** Platform id returned by the final message activity, when available. */
1734
- get messageId() {
1735
- return this.finalMessageId;
1736
- }
1737
- /** Stream id returned by the first streaminfo activity, when available. */
1738
- get previewStreamId() {
1739
- return this.streamId;
1740
- }
1741
- /** Whether streaming fell back (not used in this implementation). */
1742
- get isFallback() {
1743
- return false;
1744
- }
1745
- /**
1746
- * Send a single streaming chunk as a typing activity with streaminfo.
1747
- * Per the Teams REST API spec:
1748
- * - First chunk: no streamId, streamSequence=1 → returns 201 with { id: streamId }
1749
- * - Subsequent chunks: include streamId, increment streamSequence → returns 202
1750
- */
1751
- async pushStreamChunk(text) {
1752
- if (this.stopped && !this.finalized) return false;
1753
- this.sequenceNumber++;
1754
- const activity = {
1755
- type: "typing",
1756
- text,
1757
- entities: [buildStreamInfoEntity(this.streamId, "streaming", this.sequenceNumber)]
1758
- };
1759
- try {
1760
- const response = await this.sendActivity(activity);
1761
- if (!this.streamStartedAt) this.streamStartedAt = Date.now();
1762
- if (!this.streamId) this.streamId = extractId(response);
1763
- this.lastStreamedText = text;
1764
- return true;
1765
- } catch (err) {
1766
- const axiosData = err?.response;
1767
- const statusCode = axiosData?.status ?? err?.statusCode;
1768
- const responseBody = axiosData?.data ? JSON.stringify(axiosData.data).slice(0, 300) : "";
1769
- const msg = formatUnknownError(err);
1770
- this.onError?.(/* @__PURE__ */ new Error(`stream POST failed (HTTP ${statusCode ?? "?"}): ${msg}${responseBody ? ` body=${responseBody}` : ""}`));
1771
- this.streamFailed = true;
1772
- return false;
1773
- }
1774
- }
1775
- };
1776
- //#endregion
1777
- //#region extensions/msteams/src/reply-stream-controller.ts
1778
1505
  function createTeamsReplyStreamController(params) {
1779
1506
  const isPersonal = normalizeOptionalLowercaseString(params.conversationType) === "personal";
1780
1507
  const streamMode = resolveChannelPreviewStreamMode(params.msteamsConfig, "partial");
1781
1508
  const shouldUseNativeStream = isPersonal && (streamMode === "partial" || streamMode === "progress");
1782
- const shouldSuppressDefaultToolProgressMessages = shouldUseNativeStream && streamMode === "progress";
1783
- const shouldStreamPreviewToolProgress = shouldSuppressDefaultToolProgressMessages && resolveChannelStreamingPreviewToolProgress(params.msteamsConfig);
1784
- const stream = shouldUseNativeStream ? new TeamsHttpStream({
1785
- sendActivity: (activity) => params.context.sendActivity(activity),
1786
- feedbackLoopEnabled: params.feedbackLoopEnabled,
1787
- onError: (err) => {
1788
- params.log.debug?.(`stream error: ${formatUnknownError(err)}`);
1789
- }
1790
- }) : void 0;
1791
- let streamReceivedTokens = false;
1792
- let informativeUpdateSent = false;
1793
- let progressLines = [];
1509
+ const shouldStreamPreviewToolProgress = streamMode === "progress" && resolveChannelStreamingPreviewToolProgress(params.msteamsConfig);
1510
+ const stream = shouldUseNativeStream ? params.context.stream : void 0;
1511
+ let tokensEmitted = false;
1512
+ let streamFinalizationPending = false;
1513
+ let canceledLocally = false;
1514
+ let streamFailed = false;
1794
1515
  let lastInformativeText = "";
1795
- let pendingFinalize;
1796
- let liveState = createLiveMessageState({ canFinalizeInPlace: Boolean(stream) });
1797
- const markStreamFinalized = () => {
1798
- if (!stream || stream.isFailed) return;
1799
- const messageId = stream.messageId ?? stream.previewStreamId;
1800
- if (!messageId) return;
1801
- liveState = markLiveMessageFinalized(liveState, createPreviewMessageReceipt({ id: messageId }));
1516
+ let progressLines = [];
1517
+ let pendingFinalPayload;
1518
+ let emittedTextLength = 0;
1519
+ const wasCanceled = () => canceledLocally || Boolean(stream?.canceled);
1520
+ const fallbackPayloadForSuppressedFinal = (payload) => {
1521
+ return Boolean(payload.mediaUrl || payload.mediaUrls?.length) ? {
1522
+ ...payload,
1523
+ mediaUrl: void 0,
1524
+ mediaUrls: void 0
1525
+ } : payload;
1802
1526
  };
1803
- const renderInformativeUpdate = async () => {
1804
- if (!stream) return;
1527
+ /**
1528
+ * Render the current informative status line into the streaming card. Pulls
1529
+ * the rotating "Thinking..." label from msteams config (or the plugin-sdk
1530
+ * default) and prepends collected tool-progress lines when configured.
1531
+ */
1532
+ const renderInformativeUpdate = () => {
1533
+ if (!stream || wasCanceled()) return;
1805
1534
  const informativeText = formatChannelProgressDraftText({
1806
1535
  entry: params.msteamsConfig,
1807
1536
  lines: shouldStreamPreviewToolProgress ? progressLines : [],
@@ -1810,151 +1539,142 @@ function createTeamsReplyStreamController(params) {
1810
1539
  });
1811
1540
  if (!informativeText || informativeText === lastInformativeText) return;
1812
1541
  lastInformativeText = informativeText;
1813
- informativeUpdateSent = true;
1814
- await stream.sendInformativeUpdate(informativeText);
1815
- };
1816
- const progressDraftGate = createChannelProgressDraftGate({ onStart: renderInformativeUpdate });
1817
- const noteProgressWork = async (options) => {
1818
- if (!stream || streamMode !== "progress") return;
1819
- if (options?.toolName !== void 0 && !isChannelProgressDraftWorkToolName(options.toolName)) return;
1820
- const hadStarted = progressDraftGate.hasStarted;
1821
- await progressDraftGate.noteWork();
1822
- if (hadStarted && progressDraftGate.hasStarted) await renderInformativeUpdate();
1823
- };
1824
- const pushProgressLine = async (line, options) => {
1825
- if (!stream || streamMode !== "progress") return;
1826
- if (options?.toolName !== void 0 && !isChannelProgressDraftWorkToolName(options.toolName)) return;
1827
- if (shouldStreamPreviewToolProgress) {
1828
- const normalized = normalizeChannelProgressDraftLineIdentity(line);
1829
- if (normalized) progressLines = mergeChannelProgressDraftLine(progressLines, typeof line === "object" && line !== void 0 ? line : normalized, { maxLines: resolveChannelProgressDraftMaxLines(params.msteamsConfig) });
1542
+ try {
1543
+ stream.update(informativeText);
1544
+ } catch (err) {
1545
+ if (isStreamCancelledError(err)) {
1546
+ canceledLocally = true;
1547
+ return;
1548
+ }
1549
+ params.log?.debug?.(`stream informative update failed: ${err instanceof Error ? err.message : String(err)}`);
1830
1550
  }
1831
- await noteProgressWork();
1832
- };
1833
- const fallbackAfterStreamFailure = (payload, hasMedia) => {
1834
- if (!payload.text) return payload;
1835
- const streamedLength = stream?.streamedLength ?? 0;
1836
- if (streamedLength <= 0) return payload;
1837
- const remainingText = payload.text.slice(streamedLength);
1838
- if (!remainingText) return hasMedia ? {
1839
- ...payload,
1840
- text: void 0
1841
- } : void 0;
1842
- return {
1843
- ...payload,
1844
- text: remainingText
1845
- };
1846
- };
1847
- const finalizeProgressPayload = async (payload, hasMedia) => {
1848
- if (!stream || !payload.text) return payload;
1849
- return (await deliverWithFinalizableLivePreviewAdapter({
1850
- kind: "final",
1851
- payload,
1852
- liveState,
1853
- adapter: defineFinalizableLivePreviewAdapter({
1854
- draft: {
1855
- flush: async () => {},
1856
- clear: async () => {},
1857
- id: () => stream.previewStreamId
1858
- },
1859
- buildFinalEdit: (candidate) => candidate.text ? { text: candidate.text } : void 0,
1860
- editFinal: async (_previewId, edit) => {
1861
- const finalized = await stream.replaceInformativeWithFinal(edit.text);
1862
- informativeUpdateSent = false;
1863
- if (!finalized || stream.isFailed) throw new Error("Teams progress stream finalization failed");
1864
- },
1865
- resolveFinalizedId: (previewId) => stream.messageId ?? stream.previewStreamId ?? previewId,
1866
- createPreviewReceipt: (id) => createPreviewMessageReceipt({ id }),
1867
- onPreviewFinalized: (_id, _receipt, state) => {
1868
- liveState = state;
1869
- },
1870
- logPreviewEditFailure: (err) => {
1871
- params.log.debug?.(`stream finalization failed: ${formatUnknownError(err)}`);
1872
- }
1873
- }),
1874
- deliverNormally: async () => false
1875
- })).kind === "preview-finalized" ? hasMedia ? {
1876
- ...payload,
1877
- text: void 0
1878
- } : void 0 : payload;
1879
1551
  };
1552
+ const progressDraftGate = createChannelProgressDraftGate({ onStart: renderInformativeUpdate });
1880
1553
  return {
1881
1554
  async onReplyStart() {},
1882
- async noteProgressWork(options) {
1883
- await noteProgressWork(options);
1884
- },
1885
1555
  onPartialReply(payload) {
1886
- if (!stream || !payload.text) return;
1887
- if (streamMode === "progress") return;
1888
- streamReceivedTokens = true;
1889
- stream.update(payload.text);
1890
- },
1891
- async pushProgressLine(line, options) {
1892
- await pushProgressLine(line, options);
1556
+ if (!stream || !payload.text || wasCanceled() || streamMode !== "partial" || streamFinalizationPending) return;
1557
+ const fullText = payload.text;
1558
+ if (fullText.length <= emittedTextLength) return;
1559
+ const delta = fullText.slice(emittedTextLength);
1560
+ try {
1561
+ stream.emit(delta);
1562
+ emittedTextLength = fullText.length;
1563
+ tokensEmitted = true;
1564
+ } catch (err) {
1565
+ if (isStreamCancelledError(err)) {
1566
+ canceledLocally = true;
1567
+ return;
1568
+ }
1569
+ streamFailed = true;
1570
+ params.log?.warn?.(`msteams stream emit failed, falling back to block delivery: ${err instanceof Error ? err.message : String(err)}`);
1571
+ }
1893
1572
  },
1894
- shouldSuppressDefaultToolProgressMessages() {
1895
- return shouldSuppressDefaultToolProgressMessages;
1573
+ /**
1574
+ * Note that the agent is working — bumps the progress-draft gate so the
1575
+ * informative status starts (or refreshes) on the next render. Called
1576
+ * from the reply-dispatcher's typing callbacks.
1577
+ */
1578
+ async noteProgressWork(options) {
1579
+ if (!stream || streamMode !== "progress") return;
1580
+ if (options?.toolName !== void 0 && !isChannelProgressDraftWorkToolName(options.toolName)) return;
1581
+ const hadStarted = progressDraftGate.hasStarted;
1582
+ await progressDraftGate.noteWork();
1583
+ if (hadStarted && progressDraftGate.hasStarted) renderInformativeUpdate();
1896
1584
  },
1897
- shouldStreamPreviewToolProgress() {
1898
- return shouldStreamPreviewToolProgress;
1585
+ /**
1586
+ * Append a tool-progress line (e.g. a tool name being invoked) into the
1587
+ * preview card's informative status. Only takes effect in "progress" mode
1588
+ * with `streaming.previewToolProgress` enabled in config.
1589
+ */
1590
+ async pushProgressLine(line, options) {
1591
+ if (!stream || streamMode !== "progress") return;
1592
+ if (options?.toolName !== void 0 && !isChannelProgressDraftWorkToolName(options.toolName)) return;
1593
+ if (shouldStreamPreviewToolProgress) {
1594
+ const normalized = normalizeChannelProgressDraftLineIdentity(line);
1595
+ if (normalized) progressLines = mergeChannelProgressDraftLine(progressLines, typeof line === "object" && line !== void 0 ? line : normalized, { maxLines: resolveChannelProgressDraftMaxLines(params.msteamsConfig) });
1596
+ }
1597
+ const hadStarted = progressDraftGate.hasStarted;
1598
+ await progressDraftGate.noteWork();
1599
+ if (hadStarted && progressDraftGate.hasStarted) renderInformativeUpdate();
1899
1600
  },
1900
- async preparePayload(payload) {
1901
- const hasMedia = Boolean(payload.mediaUrl || payload.mediaUrls?.length);
1902
- if (stream && streamMode === "progress" && informativeUpdateSent && !stream.isFinalized) {
1903
- if (!payload.text) return payload;
1904
- return await finalizeProgressPayload(payload, hasMedia);
1601
+ preparePayload(payload) {
1602
+ if (!stream) return payload;
1603
+ if (wasCanceled()) return;
1604
+ if (tokensEmitted && !streamFailed) {
1605
+ const hasMedia = Boolean(payload.mediaUrl || payload.mediaUrls?.length);
1606
+ pendingFinalPayload = fallbackPayloadForSuppressedFinal(payload);
1607
+ streamFinalizationPending = true;
1608
+ tokensEmitted = false;
1609
+ return hasMedia ? {
1610
+ ...payload,
1611
+ text: void 0
1612
+ } : void 0;
1905
1613
  }
1906
- if (!stream || !streamReceivedTokens) return payload;
1907
- if (stream.isFailed) {
1908
- streamReceivedTokens = false;
1909
- return fallbackAfterStreamFailure(payload, hasMedia);
1614
+ if (streamMode === "progress" && payload.text) try {
1615
+ stream.emit(payload.text);
1616
+ pendingFinalPayload = fallbackPayloadForSuppressedFinal(payload);
1617
+ streamFinalizationPending = true;
1618
+ return Boolean(payload.mediaUrl || payload.mediaUrls?.length) ? {
1619
+ ...payload,
1620
+ text: void 0
1621
+ } : void 0;
1622
+ } catch (err) {
1623
+ if (isStreamCancelledError(err)) {
1624
+ canceledLocally = true;
1625
+ return;
1626
+ }
1627
+ params.log?.debug?.(`progress-mode finalize failed: ${err instanceof Error ? err.message : String(err)}`);
1910
1628
  }
1911
- if (!stream.hasContent || stream.isFinalized) return payload;
1912
- streamReceivedTokens = false;
1913
- pendingFinalize = stream.finalize().then(() => {
1914
- markStreamFinalized();
1915
- });
1916
- if (!hasMedia) return;
1917
- return {
1918
- ...payload,
1919
- text: void 0
1920
- };
1629
+ return payload;
1921
1630
  },
1922
1631
  async finalize() {
1923
- progressDraftGate.cancel();
1924
- await pendingFinalize;
1925
- if (!pendingFinalize) {
1926
- await stream?.finalize();
1927
- markStreamFinalized();
1632
+ if (!stream || !streamFinalizationPending || wasCanceled()) return;
1633
+ const finalEntities = [{
1634
+ type: "https://schema.org/Message",
1635
+ "@type": "Message",
1636
+ "@context": "https://schema.org",
1637
+ "@id": "",
1638
+ additionalType: ["AIGeneratedContent"]
1639
+ }];
1640
+ const finalChannelData = params.feedbackLoopEnabled ? { feedbackLoopEnabled: true } : {};
1641
+ try {
1642
+ stream.emit({
1643
+ type: "message",
1644
+ entities: finalEntities,
1645
+ channelData: finalChannelData
1646
+ });
1647
+ const result = await stream.close();
1648
+ streamFinalizationPending = false;
1649
+ if (!result) {
1650
+ const fallback = pendingFinalPayload;
1651
+ pendingFinalPayload = void 0;
1652
+ return fallback;
1653
+ }
1654
+ pendingFinalPayload = void 0;
1655
+ return;
1656
+ } catch (err) {
1657
+ if (isStreamCancelledError(err)) {
1658
+ canceledLocally = true;
1659
+ pendingFinalPayload = void 0;
1660
+ streamFinalizationPending = false;
1661
+ return;
1662
+ }
1663
+ streamFailed = true;
1664
+ streamFinalizationPending = false;
1665
+ params.log?.warn?.(`msteams stream finalize failed: ${err instanceof Error ? err.message : String(err)}`);
1666
+ const fallback = pendingFinalPayload;
1667
+ pendingFinalPayload = void 0;
1668
+ return fallback;
1928
1669
  }
1929
1670
  },
1930
1671
  hasStream() {
1931
1672
  return Boolean(stream);
1932
1673
  },
1933
- liveState() {
1934
- return liveState;
1935
- },
1936
- /**
1937
- * Whether the Teams streaming card is currently receiving LLM tokens.
1938
- * Used to gate side-channel keepalive activity so we don't overlay plain
1939
- * "typing" indicators on top of a live streaming card.
1940
- *
1941
- * Returns true only while the stream is actively chunking text into the
1942
- * streaming card. The informative update (blue progress bar) is short
1943
- * lived so we intentionally do not count it as "active"; this way the
1944
- * typing keepalive can still fire during the informative window and
1945
- * during tool chains between text segments.
1946
- *
1947
- * Returns false when:
1948
- * - No stream exists (non-personal conversation).
1949
- * - Stream has not yet received any text tokens.
1950
- * - Stream has been finalized (e.g. after the first text segment, while
1951
- * tools run before the next segment).
1952
- */
1953
1674
  isStreamActive() {
1954
- if (!stream) return false;
1955
- if (stream.isFinalized || stream.isFailed) return false;
1956
- return streamReceivedTokens;
1957
- }
1675
+ return Boolean(stream) && tokensEmitted && !wasCanceled() && !streamFailed;
1676
+ },
1677
+ wasCanceled
1958
1678
  };
1959
1679
  }
1960
1680
  //#endregion
@@ -1981,6 +1701,7 @@ function createMSTeamsReplyDispatcher(params) {
1981
1701
  */
1982
1702
  const TYPING_KEEPALIVE_MAX_DURATION_MS = 10 * 6e4;
1983
1703
  const streamActiveRef = { current: () => false };
1704
+ const streamCanceledRef = { current: () => false };
1984
1705
  const rawSendTypingIndicator = async () => {
1985
1706
  await withRevokedProxyFallback({
1986
1707
  run: async () => {
@@ -1988,12 +1709,7 @@ function createMSTeamsReplyDispatcher(params) {
1988
1709
  },
1989
1710
  onRevoked: async () => {
1990
1711
  const baseRef = buildConversationReference(params.conversationRef);
1991
- await params.adapter.continueConversation(params.appId, {
1992
- ...baseRef,
1993
- activityId: void 0
1994
- }, async (ctx) => {
1995
- await ctx.sendActivity({ type: "typing" });
1996
- });
1712
+ await sendMSTeamsActivityWithReference(params.app, baseRef, { type: "typing" }, { serviceUrlBoundary: resolveMSTeamsSdkCloudOptions(msteamsCfg) });
1997
1713
  },
1998
1714
  onRevokedLog: () => {
1999
1715
  params.log.debug?.("turn context revoked, sending typing via proactive messaging");
@@ -2002,6 +1718,7 @@ function createMSTeamsReplyDispatcher(params) {
2002
1718
  };
2003
1719
  const sendTypingIndicator = isTypingSupported ? async () => {
2004
1720
  if (streamActiveRef.current()) return;
1721
+ if (streamCanceledRef.current()) return;
2005
1722
  await rawSendTypingIndicator();
2006
1723
  } : async () => {};
2007
1724
  const { onModelSelected, typingCallbacks, ...replyPipeline } = createChannelMessageReplyPipeline({
@@ -2042,14 +1759,16 @@ function createMSTeamsReplyDispatcher(params) {
2042
1759
  progressSeed: `${params.accountId ?? "default"}:${params.conversationRef.conversation?.id ?? ""}`
2043
1760
  });
2044
1761
  streamActiveRef.current = () => streamController.isStreamActive();
2045
- const resolvedBlockStreamingEnabled = resolveChannelPreviewStreamMode(msteamsCfg, "partial") === "block" ? true : resolveChannelStreamingBlockEnabled(msteamsCfg);
2046
- const blockStreamingEnabled = resolvedBlockStreamingEnabled ?? false;
1762
+ streamCanceledRef.current = () => streamController.wasCanceled();
1763
+ const teamsStreamMode = resolveChannelPreviewStreamMode(msteamsCfg, "partial");
1764
+ const blockStreamingResolved = teamsStreamMode === "block" ? true : resolveChannelStreamingBlockEnabled(msteamsCfg);
1765
+ const blockStreamingEnabled = blockStreamingResolved ?? false;
2047
1766
  const typingIndicatorEnabled = typeof msteamsCfg?.typingIndicator === "boolean" ? msteamsCfg.typingIndicator : true;
2048
1767
  const pendingMessages = [];
2049
1768
  const sendMessages = async (messages) => {
2050
1769
  return sendMSTeamsMessages({
2051
1770
  replyStyle: params.replyStyle,
2052
- adapter: params.adapter,
1771
+ app: params.app,
2053
1772
  appId: params.appId,
2054
1773
  conversationRef: params.conversationRef,
2055
1774
  context: params.context,
@@ -2064,7 +1783,8 @@ function createMSTeamsReplyDispatcher(params) {
2064
1783
  tokenProvider: params.tokenProvider,
2065
1784
  sharePointSiteId: params.sharePointSiteId,
2066
1785
  mediaMaxBytes,
2067
- feedbackLoopEnabled
1786
+ feedbackLoopEnabled,
1787
+ serviceUrlBoundary: resolveMSTeamsSdkCloudOptions(msteamsCfg)
2068
1788
  });
2069
1789
  };
2070
1790
  const queueDeliveryFailureSystemEvent = (failure) => {
@@ -2083,6 +1803,16 @@ function createMSTeamsReplyDispatcher(params) {
2083
1803
  contextKey: `msteams:delivery-failure:${params.conversationRef.conversation?.id ?? "unknown"}`
2084
1804
  });
2085
1805
  };
1806
+ const queueReplyPayload = (payload) => {
1807
+ const messages = renderReplyPayloadsToMessages([payload], {
1808
+ textChunkLimit: params.textLimit,
1809
+ chunkText: true,
1810
+ mediaMode: "split",
1811
+ tableMode,
1812
+ chunkMode
1813
+ });
1814
+ pendingMessages.push(...messages);
1815
+ };
2086
1816
  const flushPendingMessages = async () => {
2087
1817
  if (pendingMessages.length === 0) return;
2088
1818
  const toSend = pendingMessages.splice(0);
@@ -2125,16 +1855,9 @@ function createMSTeamsReplyDispatcher(params) {
2125
1855
  },
2126
1856
  typingCallbacks,
2127
1857
  deliver: async (payload) => {
2128
- const preparedPayload = await streamController.preparePayload(payload);
1858
+ const preparedPayload = streamController.preparePayload(payload);
2129
1859
  if (!preparedPayload) return;
2130
- const messages = renderReplyPayloadsToMessages([preparedPayload], {
2131
- textChunkLimit: params.textLimit,
2132
- chunkText: true,
2133
- mediaMode: "split",
2134
- tableMode,
2135
- chunkMode
2136
- });
2137
- pendingMessages.push(...messages);
1860
+ queueReplyPayload(preparedPayload);
2138
1861
  if (blockStreamingEnabled) await flushPendingMessages();
2139
1862
  },
2140
1863
  onError: (err, info) => {
@@ -2161,110 +1884,114 @@ function createMSTeamsReplyDispatcher(params) {
2161
1884
  classification,
2162
1885
  hint
2163
1886
  });
2164
- }).then(() => {
2165
- return streamController.finalize().catch((err) => {
1887
+ }).then(async () => {
1888
+ const fallbackPayload = await streamController.finalize().catch((err) => {
2166
1889
  params.log.debug?.("stream finalize failed", { error: formatUnknownError(err) });
2167
1890
  });
1891
+ if (fallbackPayload) {
1892
+ queueReplyPayload(fallbackPayload);
1893
+ await flushPendingMessages();
1894
+ }
2168
1895
  }).finally(() => {
2169
1896
  baseMarkDispatchIdle();
2170
1897
  });
2171
1898
  };
1899
+ const previewToolProgressEnabled = resolveChannelStreamingPreviewToolProgress(msteamsCfg);
1900
+ const suppressDefaultToolProgressMessages = resolveChannelStreamingSuppressDefaultToolProgressMessages(msteamsCfg);
1901
+ const shouldSuppressDefaultToolProgressMessages = teamsStreamMode === "progress" && suppressDefaultToolProgressMessages && previewToolProgressEnabled;
1902
+ const progressCallbacks = streamController.hasStream() ? {
1903
+ onReasoningStream: async (payload) => {
1904
+ const text = typeof payload?.text === "string" ? payload.text : void 0;
1905
+ if (!text) return;
1906
+ if (payload?.isReasoningSnapshot !== true) {
1907
+ await streamController.pushProgressLine(text);
1908
+ return;
1909
+ }
1910
+ await streamController.pushProgressLine(buildChannelProgressDraftLine({
1911
+ event: "item",
1912
+ itemId: "reasoning",
1913
+ itemKind: "analysis",
1914
+ title: "Reasoning",
1915
+ progressText: text
1916
+ }));
1917
+ },
1918
+ onToolStart: async (payload) => {
1919
+ const name = typeof payload?.name === "string" ? payload.name : void 0;
1920
+ const detailMode = typeof payload?.detailMode === "string" ? payload.detailMode : void 0;
1921
+ await streamController.pushProgressLine(buildChannelProgressDraftLineForEntry(msteamsCfg, {
1922
+ event: "tool",
1923
+ ...name ? { name } : {},
1924
+ ...typeof payload?.phase === "string" ? { phase: payload.phase } : {},
1925
+ ...payload?.args && typeof payload.args === "object" ? { args: payload.args } : {}
1926
+ }, detailMode === "explain" || detailMode === "raw" ? { detailMode } : void 0), name ? { toolName: name } : void 0);
1927
+ },
1928
+ onItemEvent: async (payload) => {
1929
+ await streamController.pushProgressLine(buildChannelProgressDraftLineForEntry(msteamsCfg, {
1930
+ event: "item",
1931
+ ...typeof payload?.kind === "string" ? { itemKind: payload.kind } : {},
1932
+ ...typeof payload?.title === "string" ? { title: payload.title } : {},
1933
+ ...typeof payload?.name === "string" ? { name: payload.name } : {},
1934
+ ...typeof payload?.phase === "string" ? { phase: payload.phase } : {},
1935
+ ...typeof payload?.status === "string" ? { status: payload.status } : {},
1936
+ ...typeof payload?.summary === "string" ? { summary: payload.summary } : {},
1937
+ ...typeof payload?.progressText === "string" ? { progressText: payload.progressText } : {},
1938
+ ...typeof payload?.meta === "string" ? { meta: payload.meta } : {}
1939
+ }));
1940
+ },
1941
+ onPlanUpdate: async (payload) => {
1942
+ if (payload?.phase !== "update") return;
1943
+ await streamController.pushProgressLine(buildChannelProgressDraftLine({
1944
+ event: "plan",
1945
+ phase: payload.phase,
1946
+ ...typeof payload?.title === "string" ? { title: payload.title } : {},
1947
+ ...typeof payload?.explanation === "string" ? { explanation: payload.explanation } : {},
1948
+ ...Array.isArray(payload?.steps) && payload.steps.every((s) => typeof s === "string") ? { steps: payload.steps } : {}
1949
+ }));
1950
+ },
1951
+ onApprovalEvent: async (payload) => {
1952
+ if (payload?.phase !== "requested") return;
1953
+ await streamController.pushProgressLine(buildChannelProgressDraftLine({
1954
+ event: "approval",
1955
+ phase: payload.phase,
1956
+ ...typeof payload?.title === "string" ? { title: payload.title } : {},
1957
+ ...typeof payload?.command === "string" ? { command: payload.command } : {},
1958
+ ...typeof payload?.reason === "string" ? { reason: payload.reason } : {},
1959
+ ...typeof payload?.message === "string" ? { message: payload.message } : {}
1960
+ }));
1961
+ },
1962
+ onCommandOutput: async (payload) => {
1963
+ if (payload?.phase !== "end") return;
1964
+ await streamController.pushProgressLine(buildChannelProgressDraftLine({
1965
+ event: "command-output",
1966
+ phase: payload.phase,
1967
+ ...typeof payload?.title === "string" ? { title: payload.title } : {},
1968
+ ...typeof payload?.name === "string" ? { name: payload.name } : {},
1969
+ ...typeof payload?.status === "string" ? { status: payload.status } : {},
1970
+ ...typeof payload?.exitCode === "number" ? { exitCode: payload.exitCode } : {}
1971
+ }));
1972
+ },
1973
+ onPatchSummary: async (payload) => {
1974
+ if (payload?.phase !== "end") return;
1975
+ await streamController.pushProgressLine(buildChannelProgressDraftLine({
1976
+ event: "patch",
1977
+ phase: payload.phase,
1978
+ ...typeof payload?.title === "string" ? { title: payload.title } : {},
1979
+ ...typeof payload?.name === "string" ? { name: payload.name } : {},
1980
+ ...Array.isArray(payload?.added) && payload.added.every((s) => typeof s === "string") ? { added: payload.added } : {},
1981
+ ...Array.isArray(payload?.modified) && payload.modified.every((s) => typeof s === "string") ? { modified: payload.modified } : {},
1982
+ ...Array.isArray(payload?.deleted) && payload.deleted.every((s) => typeof s === "string") ? { deleted: payload.deleted } : {},
1983
+ ...typeof payload?.summary === "string" ? { summary: payload.summary } : {}
1984
+ }));
1985
+ }
1986
+ } : {};
2172
1987
  return {
2173
1988
  dispatcher,
2174
1989
  replyOptions: {
2175
1990
  ...replyOptions,
2176
- ...streamController.hasStream() ? {
2177
- onPartialReply: (payload) => streamController.onPartialReply(payload),
2178
- onToolStart: async (payload) => {
2179
- await streamController.noteProgressWork({ toolName: payload.name });
2180
- },
2181
- onItemEvent: async () => {
2182
- await streamController.noteProgressWork();
2183
- },
2184
- onPlanUpdate: async (payload) => {
2185
- if (payload.phase === "update") await streamController.noteProgressWork();
2186
- },
2187
- onApprovalEvent: async (payload) => {
2188
- if (payload.phase === "requested") await streamController.noteProgressWork();
2189
- },
2190
- onCommandOutput: async (payload) => {
2191
- if (payload.phase === "end") await streamController.noteProgressWork();
2192
- },
2193
- onPatchSummary: async (payload) => {
2194
- if (payload.phase === "end") await streamController.noteProgressWork();
2195
- }
2196
- } : {},
2197
- ...streamController.shouldSuppressDefaultToolProgressMessages() ? { suppressDefaultToolProgressMessages: true } : {},
2198
- ...streamController.shouldStreamPreviewToolProgress() ? {
2199
- onToolStart: async (payload) => {
2200
- await streamController.pushProgressLine(buildChannelProgressDraftLineForEntry(msteamsCfg, {
2201
- event: "tool",
2202
- name: payload.name,
2203
- phase: payload.phase,
2204
- args: payload.args
2205
- }, payload.detailMode ? { detailMode: payload.detailMode } : void 0), { toolName: payload.name });
2206
- },
2207
- onItemEvent: async (payload) => {
2208
- await streamController.pushProgressLine(buildChannelProgressDraftLineForEntry(msteamsCfg, {
2209
- event: "item",
2210
- itemId: payload.itemId,
2211
- itemKind: payload.kind,
2212
- title: payload.title,
2213
- name: payload.name,
2214
- phase: payload.phase,
2215
- status: payload.status,
2216
- summary: payload.summary,
2217
- progressText: payload.progressText,
2218
- meta: payload.meta
2219
- }));
2220
- },
2221
- onPlanUpdate: async (payload) => {
2222
- if (payload.phase !== "update") return;
2223
- await streamController.pushProgressLine(buildChannelProgressDraftLine({
2224
- event: "plan",
2225
- phase: payload.phase,
2226
- title: payload.title,
2227
- explanation: payload.explanation,
2228
- steps: payload.steps
2229
- }));
2230
- },
2231
- onApprovalEvent: async (payload) => {
2232
- if (payload.phase !== "requested") return;
2233
- await streamController.pushProgressLine(buildChannelProgressDraftLine({
2234
- event: "approval",
2235
- phase: payload.phase,
2236
- title: payload.title,
2237
- command: payload.command,
2238
- reason: payload.reason,
2239
- message: payload.message
2240
- }));
2241
- },
2242
- onCommandOutput: async (payload) => {
2243
- if (payload.phase !== "end") return;
2244
- await streamController.pushProgressLine(buildChannelProgressDraftLine({
2245
- event: "command-output",
2246
- phase: payload.phase,
2247
- title: payload.title,
2248
- name: payload.name,
2249
- status: payload.status,
2250
- exitCode: payload.exitCode
2251
- }));
2252
- },
2253
- onPatchSummary: async (payload) => {
2254
- if (payload.phase !== "end") return;
2255
- await streamController.pushProgressLine(buildChannelProgressDraftLine({
2256
- event: "patch",
2257
- phase: payload.phase,
2258
- title: payload.title,
2259
- name: payload.name,
2260
- added: payload.added,
2261
- modified: payload.modified,
2262
- deleted: payload.deleted,
2263
- summary: payload.summary
2264
- }));
2265
- }
2266
- } : {},
2267
- disableBlockStreaming: typeof resolvedBlockStreamingEnabled === "boolean" ? !resolvedBlockStreamingEnabled : void 0,
1991
+ ...streamController.hasStream() ? { onPartialReply: (payload) => streamController.onPartialReply(payload) } : {},
1992
+ ...progressCallbacks,
1993
+ ...shouldSuppressDefaultToolProgressMessages ? { suppressDefaultToolProgressMessages: true } : {},
1994
+ disableBlockStreaming: blockStreamingResolved == null ? void 0 : !blockStreamingResolved,
2268
1995
  onModelSelected
2269
1996
  },
2270
1997
  markDispatchIdle
@@ -2545,7 +2272,7 @@ function buildStoredConversationReference(params) {
2545
2272
  };
2546
2273
  }
2547
2274
  function createMSTeamsMessageHandler(deps) {
2548
- const { cfg, runtime, appId, adapter, tokenProvider, textLimit, mediaMaxBytes, conversationStore, pollStore, log } = deps;
2275
+ const { cfg, runtime, appId, app, tokenProvider, textLimit, mediaMaxBytes, conversationStore, pollStore, log } = deps;
2549
2276
  const core = getMSTeamsRuntime();
2550
2277
  const logVerboseMessage = (message) => {
2551
2278
  if (core.logging.shouldLogVerbose()) log.debug?.(message);
@@ -3012,7 +2739,7 @@ function createMSTeamsMessageHandler(deps) {
3012
2739
  accountId: route.accountId,
3013
2740
  runtime,
3014
2741
  log,
3015
- adapter,
2742
+ app,
3016
2743
  appId,
3017
2744
  conversationRef,
3018
2745
  context,
@@ -3243,191 +2970,6 @@ function createMSTeamsReactionHandler(deps) {
3243
2970
  };
3244
2971
  }
3245
2972
  //#endregion
3246
- //#region extensions/msteams/src/sso.ts
3247
- /** Scope used to obtain a Bot Framework service token. */
3248
- const BOT_FRAMEWORK_TOKEN_SCOPE = "https://api.botframework.com/.default";
3249
- /** Bot Framework User Token service base URL. */
3250
- const BOT_FRAMEWORK_USER_TOKEN_BASE_URL = "https://token.botframework.com";
3251
- /**
3252
- * Extract and validate the `signin/tokenExchange` activity value. Teams
3253
- * delivers `{ id, connectionName, token }`; any field may be missing on
3254
- * malformed invocations, so callers should check the parsed result.
3255
- */
3256
- function parseSigninTokenExchangeValue(value) {
3257
- if (!value || typeof value !== "object") return null;
3258
- const obj = value;
3259
- return {
3260
- id: typeof obj.id === "string" ? obj.id : void 0,
3261
- connectionName: typeof obj.connectionName === "string" ? obj.connectionName : void 0,
3262
- token: typeof obj.token === "string" ? obj.token : void 0
3263
- };
3264
- }
3265
- /** Extract the `signin/verifyState` activity value `{ state }`. */
3266
- function parseSigninVerifyStateValue(value) {
3267
- if (!value || typeof value !== "object") return null;
3268
- const obj = value;
3269
- return { state: typeof obj.state === "string" ? obj.state : void 0 };
3270
- }
3271
- async function callUserTokenService(params) {
3272
- const qs = new URLSearchParams(params.query).toString();
3273
- const url = `${params.baseUrl.replace(/\/+$/, "")}${params.path}?${qs}`;
3274
- const headers = {
3275
- Accept: "application/json",
3276
- Authorization: `Bearer ${params.bearerToken}`,
3277
- "User-Agent": buildUserAgent()
3278
- };
3279
- if (params.body !== void 0) headers["Content-Type"] = "application/json";
3280
- const response = await params.fetchImpl(url, {
3281
- method: params.method,
3282
- headers,
3283
- body: params.body === void 0 ? void 0 : JSON.stringify(params.body)
3284
- });
3285
- if (!response.ok) return {
3286
- error: await response.text().catch(() => "") || `HTTP ${response.status}`,
3287
- status: response.status
3288
- };
3289
- let parsed;
3290
- try {
3291
- parsed = await response.json();
3292
- } catch {
3293
- return {
3294
- error: "invalid JSON from User Token service",
3295
- status: response.status
3296
- };
3297
- }
3298
- if (!parsed || typeof parsed !== "object") return {
3299
- error: "empty response from User Token service",
3300
- status: response.status
3301
- };
3302
- const obj = parsed;
3303
- const token = typeof obj.token === "string" ? obj.token : void 0;
3304
- const connectionName = typeof obj.connectionName === "string" ? obj.connectionName : void 0;
3305
- const channelId = typeof obj.channelId === "string" ? obj.channelId : void 0;
3306
- const expiration = typeof obj.expiration === "string" ? obj.expiration : void 0;
3307
- if (!token || !connectionName) return {
3308
- error: "User Token service response missing token/connectionName",
3309
- status: 502
3310
- };
3311
- return {
3312
- channelId,
3313
- connectionName,
3314
- token,
3315
- expiration
3316
- };
3317
- }
3318
- /**
3319
- * Exchange a Teams SSO token for a delegated user token via Bot
3320
- * Framework's User Token service, then persist the result.
3321
- */
3322
- async function handleSigninTokenExchangeInvoke(params) {
3323
- const { value, user, deps } = params;
3324
- if (!user.userId) return {
3325
- ok: false,
3326
- code: "missing_user",
3327
- message: "no user id on invoke activity"
3328
- };
3329
- const connectionName = value.connectionName?.trim() || deps.connectionName;
3330
- if (!connectionName) return {
3331
- ok: false,
3332
- code: "missing_connection",
3333
- message: "no OAuth connection name"
3334
- };
3335
- if (!value.token) return {
3336
- ok: false,
3337
- code: "missing_token",
3338
- message: "no exchangeable token on invoke"
3339
- };
3340
- const bearer = await deps.tokenProvider.getAccessToken(BOT_FRAMEWORK_TOKEN_SCOPE);
3341
- const fetchImpl = deps.fetchImpl ?? globalThis.fetch;
3342
- const result = await callUserTokenService({
3343
- baseUrl: deps.userTokenBaseUrl ?? BOT_FRAMEWORK_USER_TOKEN_BASE_URL,
3344
- path: "/api/usertoken/exchange",
3345
- query: {
3346
- userId: user.userId,
3347
- connectionName,
3348
- channelId: user.channelId ?? "msteams"
3349
- },
3350
- method: "POST",
3351
- body: { token: value.token },
3352
- bearerToken: bearer,
3353
- fetchImpl
3354
- });
3355
- if ("error" in result) return {
3356
- ok: false,
3357
- code: result.status >= 500 ? "service_error" : "unexpected_response",
3358
- message: result.error,
3359
- status: result.status
3360
- };
3361
- await deps.tokenStore.save({
3362
- connectionName,
3363
- userId: user.userId,
3364
- token: result.token,
3365
- expiresAt: result.expiration,
3366
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
3367
- });
3368
- return {
3369
- ok: true,
3370
- token: result.token,
3371
- expiresAt: result.expiration
3372
- };
3373
- }
3374
- /**
3375
- * Finish a magic-code sign-in: look up the user token for the state
3376
- * code via Bot Framework's User Token service, then persist it.
3377
- */
3378
- async function handleSigninVerifyStateInvoke(params) {
3379
- const { value, user, deps } = params;
3380
- if (!user.userId) return {
3381
- ok: false,
3382
- code: "missing_user",
3383
- message: "no user id on invoke activity"
3384
- };
3385
- if (!deps.connectionName) return {
3386
- ok: false,
3387
- code: "missing_connection",
3388
- message: "no OAuth connection name"
3389
- };
3390
- const state = value.state?.trim();
3391
- if (!state) return {
3392
- ok: false,
3393
- code: "missing_state",
3394
- message: "no state code on invoke"
3395
- };
3396
- const bearer = await deps.tokenProvider.getAccessToken(BOT_FRAMEWORK_TOKEN_SCOPE);
3397
- const fetchImpl = deps.fetchImpl ?? globalThis.fetch;
3398
- const result = await callUserTokenService({
3399
- baseUrl: deps.userTokenBaseUrl ?? BOT_FRAMEWORK_USER_TOKEN_BASE_URL,
3400
- path: "/api/usertoken/GetToken",
3401
- query: {
3402
- userId: user.userId,
3403
- connectionName: deps.connectionName,
3404
- channelId: user.channelId ?? "msteams",
3405
- code: state
3406
- },
3407
- method: "GET",
3408
- bearerToken: bearer,
3409
- fetchImpl
3410
- });
3411
- if ("error" in result) return {
3412
- ok: false,
3413
- code: result.status >= 500 ? "service_error" : "unexpected_response",
3414
- message: result.error,
3415
- status: result.status
3416
- };
3417
- await deps.tokenStore.save({
3418
- connectionName: deps.connectionName,
3419
- userId: user.userId,
3420
- token: result.token,
3421
- expiresAt: result.expiration,
3422
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
3423
- });
3424
- return {
3425
- ok: true,
3426
- token: result.token,
3427
- expiresAt: result.expiration
3428
- };
3429
- }
3430
- //#endregion
3431
2973
  //#region extensions/msteams/src/welcome-card.ts
3432
2974
  /**
3433
2975
  * Builds an Adaptive Card for welcoming users when the bot is added to a conversation.
@@ -3546,11 +3088,118 @@ async function isSigninInvokeAuthorized(context, deps) {
3546
3088
  includeInvokeName: true
3547
3089
  });
3548
3090
  }
3091
+ async function isCardActionInvokeAuthorized(context, deps) {
3092
+ return isInvokeAuthorized({
3093
+ context,
3094
+ deps,
3095
+ deniedLogs: {
3096
+ dm: "dropping card action invoke (dm sender not allowlisted)",
3097
+ channel: "dropping card action invoke (not in team/channel allowlist)",
3098
+ group: "dropping card action invoke (group sender not allowlisted)"
3099
+ },
3100
+ includeInvokeName: true
3101
+ });
3102
+ }
3103
+ function registerMSTeamsHandlers(handler, deps) {
3104
+ const handleTeamsMessage = createMSTeamsMessageHandler(deps);
3105
+ const handleReaction = createMSTeamsReactionHandler(deps);
3106
+ const originalRun = handler.run;
3107
+ if (originalRun) handler.run = async (context) => {
3108
+ const ctx = context;
3109
+ if (ctx.activity?.type === "invoke" && ctx.activity?.name === "adaptiveCard/action") {
3110
+ const text = serializeAdaptiveCardActionValue(ctx.activity?.value);
3111
+ if (text) await handleTeamsMessage({
3112
+ ...ctx,
3113
+ activity: {
3114
+ ...ctx.activity,
3115
+ type: "message",
3116
+ text
3117
+ }
3118
+ });
3119
+ return;
3120
+ }
3121
+ return originalRun.call(handler, context);
3122
+ };
3123
+ handler.onMessage(async (context, next) => {
3124
+ try {
3125
+ await handleTeamsMessage(context);
3126
+ } catch (err) {
3127
+ deps.runtime.error(`msteams handler failed: ${formatUnknownError(err)}`);
3128
+ }
3129
+ await next();
3130
+ });
3131
+ handler.onMembersAdded(async (context, next) => {
3132
+ const ctx = context;
3133
+ const membersAdded = ctx.activity?.membersAdded ?? [];
3134
+ const botId = ctx.activity?.recipient?.id;
3135
+ const msteamsCfg = deps.cfg.channels?.msteams;
3136
+ for (const member of membersAdded) if (member.id === botId) {
3137
+ const isPersonal = (normalizeOptionalLowercaseString(ctx.activity?.conversation?.conversationType) ?? "personal") === "personal";
3138
+ if (isPersonal && msteamsCfg?.welcomeCard !== false) {
3139
+ const card = buildWelcomeCard({
3140
+ botName: ctx.activity?.recipient?.name ?? void 0,
3141
+ promptStarters: msteamsCfg?.promptStarters
3142
+ });
3143
+ try {
3144
+ await ctx.sendActivity({
3145
+ type: "message",
3146
+ attachments: [{
3147
+ contentType: "application/vnd.microsoft.card.adaptive",
3148
+ content: card
3149
+ }]
3150
+ });
3151
+ deps.log.info("sent welcome card");
3152
+ } catch (err) {
3153
+ deps.log.debug?.("failed to send welcome card", { error: formatUnknownError(err) });
3154
+ }
3155
+ } else if (!isPersonal && msteamsCfg?.groupWelcomeCard === true) {
3156
+ const botName = ctx.activity?.recipient?.name ?? void 0;
3157
+ try {
3158
+ await ctx.sendActivity(buildGroupWelcomeText(botName));
3159
+ deps.log.info("sent group welcome message");
3160
+ } catch (err) {
3161
+ deps.log.debug?.("failed to send group welcome", { error: formatUnknownError(err) });
3162
+ }
3163
+ } else deps.log.debug?.("skipping welcome (disabled by config or conversation type)");
3164
+ } else deps.log.debug?.("member added", { member: member.id });
3165
+ await next();
3166
+ });
3167
+ handler.onReactionsAdded(async (context, next) => {
3168
+ try {
3169
+ await handleReaction(context, "added");
3170
+ } catch (err) {
3171
+ deps.runtime.error(`msteams reaction handler failed: ${String(err)}`);
3172
+ }
3173
+ await next();
3174
+ });
3175
+ handler.onReactionsRemoved(async (context, next) => {
3176
+ try {
3177
+ await handleReaction(context, "removed");
3178
+ } catch (err) {
3179
+ deps.runtime.error(`msteams reaction handler failed: ${String(err)}`);
3180
+ }
3181
+ await next();
3182
+ });
3183
+ return handler;
3184
+ }
3185
+ //#endregion
3186
+ //#region extensions/msteams/src/feedback-invoke.ts
3549
3187
  /**
3550
- * Parse and handle feedback invoke activities (thumbs up/down).
3551
- * Returns true if the activity was a feedback invoke, false otherwise.
3188
+ * Run the message-submit (feedback) invoke handler.
3189
+ *
3190
+ * Teams delivers feedback (`actionName === "feedback"`) on AI-generated
3191
+ * messages as a `message/submitAction` invoke. The SDK wraps a void return
3192
+ * into the HTTP 200 InvokeResponse, so this function intentionally does
3193
+ * not ack itself — the legacy `ctx.sendActivity({ type: "invokeResponse",
3194
+ * … })` shape is gone (it became an outbound BF activity on the new SDK
3195
+ * instead of the HTTP response).
3196
+ *
3197
+ * Returns `true` if the invoke matched the feedback shape and was
3198
+ * consumed (whether or not it was authorized / written / reflected on),
3199
+ * `false` if the invoke didn't look like feedback at all and the caller
3200
+ * should fall through to other handlers.
3552
3201
  */
3553
- async function handleFeedbackInvoke(context, deps) {
3202
+ async function runMSTeamsFeedbackInvokeHandler(context, deps) {
3554
3203
  const activity = context.activity;
3555
3204
  const value = activity.value;
3556
3205
  if (!value) return false;
@@ -3616,7 +3265,6 @@ async function handleFeedbackInvoke(context, deps) {
3616
3265
  rejectSymlinkParents: true
3617
3266
  }).catch(() => {});
3618
3267
  } catch {}
3619
- const serviceUrl = tryNormalizeBotFrameworkServiceUrl(activity.serviceUrl);
3620
3268
  const conversationRef = {
3621
3269
  activityId: activity.id,
3622
3270
  user: {
@@ -3638,12 +3286,12 @@ async function handleFeedbackInvoke(context, deps) {
3638
3286
  tenantId: activity.conversation?.tenantId
3639
3287
  },
3640
3288
  channelId: activity.channelId ?? "msteams",
3641
- ...serviceUrl ? { serviceUrl } : {},
3289
+ serviceUrl: activity.serviceUrl,
3642
3290
  locale: activity.locale
3643
3291
  };
3644
3292
  if (isNegative && msteamsCfg?.feedbackReflection !== false) runFeedbackReflection({
3645
3293
  cfg: deps.cfg,
3646
- adapter: deps.adapter,
3294
+ app: deps.app,
3647
3295
  appId: deps.appId,
3648
3296
  conversationRef,
3649
3297
  sessionKey: route.sessionKey,
@@ -3657,161 +3305,114 @@ async function handleFeedbackInvoke(context, deps) {
3657
3305
  });
3658
3306
  return true;
3659
3307
  }
3660
- function registerMSTeamsHandlers(handler, deps) {
3661
- const handleTeamsMessage = createMSTeamsMessageHandler(deps);
3662
- const handleReaction = createMSTeamsReactionHandler(deps);
3663
- const originalRun = handler.run;
3664
- if (originalRun) handler.run = async (context) => {
3665
- const ctx = context;
3666
- if (ctx.activity?.type === "invoke" && ctx.activity?.name === "fileConsent/invoke") {
3667
- await respondToMSTeamsFileConsentInvoke(ctx, deps.log);
3668
- return;
3669
- }
3670
- if (ctx.activity?.type === "invoke" && ctx.activity?.name === "message/submitAction") {
3671
- if (await handleFeedbackInvoke(ctx, deps)) return;
3672
- }
3673
- if (ctx.activity?.type === "invoke" && ctx.activity?.name === "adaptiveCard/action") {
3674
- const text = serializeAdaptiveCardActionValue(ctx.activity?.value);
3675
- if (text) {
3676
- await handleTeamsMessage({
3677
- ...ctx,
3678
- activity: {
3679
- ...ctx.activity,
3680
- type: "message",
3681
- text
3682
- }
3683
- });
3684
- return;
3685
- }
3686
- deps.log.debug?.("skipping adaptive card action invoke without value payload");
3308
+ //#endregion
3309
+ //#region extensions/msteams/src/file-consent-invoke.ts
3310
+ /**
3311
+ * Handle fileConsent/invoke activities for large file uploads.
3312
+ */
3313
+ async function handleMSTeamsFileConsentInvoke(context, log) {
3314
+ const expiredUploadMessage = "The file upload request has expired. Please try sending the file again.";
3315
+ const activity = context.activity;
3316
+ if (activity.type !== "invoke" || activity.name !== "fileConsent/invoke") return false;
3317
+ const consentResponse = parseFileConsentInvoke(activity);
3318
+ if (!consentResponse) {
3319
+ log.debug?.("invalid file consent invoke", { value: activity.value });
3320
+ return false;
3321
+ }
3322
+ const uploadId = typeof consentResponse.context?.uploadId === "string" ? consentResponse.context.uploadId : void 0;
3323
+ const inMemoryFile = getPendingUpload(uploadId);
3324
+ const fsFile = inMemoryFile ? void 0 : await getPendingUploadFs(uploadId);
3325
+ const pendingFile = inMemoryFile ?? fsFile;
3326
+ if (pendingFile) {
3327
+ const pendingConversationId = normalizeMSTeamsConversationId(pendingFile.conversationId);
3328
+ const invokeConversationId = normalizeMSTeamsConversationId(activity.conversation?.id ?? "");
3329
+ if (!invokeConversationId || pendingConversationId !== invokeConversationId) {
3330
+ log.info("file consent conversation mismatch", {
3331
+ uploadId,
3332
+ expectedConversationId: pendingConversationId,
3333
+ receivedConversationId: invokeConversationId || void 0
3334
+ });
3335
+ if (consentResponse.action === "accept") await context.sendActivity(expiredUploadMessage);
3336
+ return true;
3687
3337
  }
3688
- if (ctx.activity?.type === "invoke" && (ctx.activity?.name === "signin/tokenExchange" || ctx.activity?.name === "signin/verifyState")) {
3689
- await ctx.sendActivity({
3690
- type: "invokeResponse",
3691
- value: {
3692
- status: 200,
3693
- body: {}
3694
- }
3338
+ }
3339
+ if (consentResponse.action === "accept" && consentResponse.uploadInfo) if (pendingFile) {
3340
+ log.debug?.("user accepted file consent, uploading", {
3341
+ uploadId,
3342
+ filename: pendingFile.filename,
3343
+ size: pendingFile.buffer.length
3344
+ });
3345
+ try {
3346
+ await uploadToConsentUrl({
3347
+ url: consentResponse.uploadInfo.uploadUrl,
3348
+ buffer: pendingFile.buffer,
3349
+ contentType: pendingFile.contentType
3695
3350
  });
3696
- if (!await isSigninInvokeAuthorized(ctx, deps)) return;
3697
- if (!deps.sso) {
3698
- deps.log.debug?.("signin invoke received but msteams.sso is not configured", { name: ctx.activity.name });
3699
- return;
3700
- }
3701
- const user = {
3702
- userId: ctx.activity.from?.aadObjectId ?? ctx.activity.from?.id ?? "",
3703
- channelId: ctx.activity.channelId ?? "msteams"
3704
- };
3705
- try {
3706
- if (ctx.activity.name === "signin/tokenExchange") {
3707
- const parsed = parseSigninTokenExchangeValue(ctx.activity.value);
3708
- if (!parsed) {
3709
- deps.log.debug?.("invalid signin/tokenExchange invoke value");
3710
- return;
3711
- }
3712
- const result = await handleSigninTokenExchangeInvoke({
3713
- value: parsed,
3714
- user,
3715
- deps: deps.sso
3716
- });
3717
- if (result.ok) deps.log.info("msteams sso token exchanged", {
3718
- userId: user.userId,
3719
- hasExpiry: Boolean(result.expiresAt)
3720
- });
3721
- else deps.log.error("msteams sso token exchange failed", {
3722
- code: result.code,
3723
- status: result.status,
3724
- message: result.message
3725
- });
3726
- return;
3727
- }
3728
- const parsed = parseSigninVerifyStateValue(ctx.activity.value);
3729
- if (!parsed) {
3730
- deps.log.debug?.("invalid signin/verifyState invoke value");
3731
- return;
3732
- }
3733
- const result = await handleSigninVerifyStateInvoke({
3734
- value: parsed,
3735
- user,
3736
- deps: deps.sso
3737
- });
3738
- if (result.ok) deps.log.info("msteams sso verifyState succeeded", {
3739
- userId: user.userId,
3740
- hasExpiry: Boolean(result.expiresAt)
3351
+ const fileInfoCard = buildFileInfoCard({
3352
+ filename: consentResponse.uploadInfo.name,
3353
+ contentUrl: consentResponse.uploadInfo.contentUrl,
3354
+ uniqueId: consentResponse.uploadInfo.uniqueId,
3355
+ fileType: consentResponse.uploadInfo.fileType
3356
+ });
3357
+ if (!pendingFile.consentCardActivityId) await context.sendActivity({
3358
+ type: "message",
3359
+ attachments: [fileInfoCard]
3360
+ });
3361
+ if (pendingFile.consentCardActivityId) try {
3362
+ await context.updateActivity({
3363
+ id: pendingFile.consentCardActivityId,
3364
+ type: "message",
3365
+ attachments: [fileInfoCard]
3741
3366
  });
3742
- else deps.log.error("msteams sso verifyState failed", {
3743
- code: result.code,
3744
- status: result.status,
3745
- message: result.message
3367
+ } catch {
3368
+ await context.sendActivity({
3369
+ type: "message",
3370
+ attachments: [fileInfoCard]
3746
3371
  });
3747
- } catch (err) {
3748
- deps.log.error("msteams sso invoke handler error", { error: formatUnknownError(err) });
3749
3372
  }
3750
- return;
3751
- }
3752
- return originalRun.call(handler, context);
3753
- };
3754
- handler.onMessage(async (context, next) => {
3755
- try {
3756
- await handleTeamsMessage(context);
3757
- } catch (err) {
3758
- deps.runtime.error(`msteams handler failed: ${formatUnknownError(err)}`);
3759
- }
3760
- await next();
3761
- });
3762
- handler.onMembersAdded(async (context, next) => {
3763
- const ctx = context;
3764
- const membersAdded = ctx.activity?.membersAdded ?? [];
3765
- const botId = ctx.activity?.recipient?.id;
3766
- const msteamsCfg = deps.cfg.channels?.msteams;
3767
- for (const member of membersAdded) if (member.id === botId) {
3768
- const isPersonal = (normalizeOptionalLowercaseString(ctx.activity?.conversation?.conversationType) ?? "personal") === "personal";
3769
- if (isPersonal && msteamsCfg?.welcomeCard !== false) {
3770
- const card = buildWelcomeCard({
3771
- botName: ctx.activity?.recipient?.name ?? void 0,
3772
- promptStarters: msteamsCfg?.promptStarters
3773
- });
3774
- try {
3775
- await ctx.sendActivity({
3776
- type: "message",
3777
- attachments: [{
3778
- contentType: "application/vnd.microsoft.card.adaptive",
3779
- content: card
3780
- }]
3781
- });
3782
- deps.log.info("sent welcome card");
3783
- } catch (err) {
3784
- deps.log.debug?.("failed to send welcome card", { error: formatUnknownError(err) });
3785
- }
3786
- } else if (!isPersonal && msteamsCfg?.groupWelcomeCard === true) {
3787
- const botName = ctx.activity?.recipient?.name ?? void 0;
3788
- try {
3789
- await ctx.sendActivity(buildGroupWelcomeText(botName));
3790
- deps.log.info("sent group welcome message");
3791
- } catch (err) {
3792
- deps.log.debug?.("failed to send group welcome", { error: formatUnknownError(err) });
3793
- }
3794
- } else deps.log.debug?.("skipping welcome (disabled by config or conversation type)");
3795
- } else deps.log.debug?.("member added", { member: member.id });
3796
- await next();
3797
- });
3798
- handler.onReactionsAdded(async (context, next) => {
3799
- try {
3800
- await handleReaction(context, "added");
3801
- } catch (err) {
3802
- deps.runtime.error(`msteams reaction handler failed: ${String(err)}`);
3803
- }
3804
- await next();
3805
- });
3806
- handler.onReactionsRemoved(async (context, next) => {
3807
- try {
3808
- await handleReaction(context, "removed");
3373
+ log.info("file upload complete", {
3374
+ uploadId,
3375
+ filename: consentResponse.uploadInfo.name,
3376
+ uniqueId: consentResponse.uploadInfo.uniqueId
3377
+ });
3809
3378
  } catch (err) {
3810
- deps.runtime.error(`msteams reaction handler failed: ${String(err)}`);
3379
+ log.error("file upload failed", {
3380
+ uploadId,
3381
+ error: formatUnknownError(err)
3382
+ });
3383
+ await context.sendActivity("File upload failed. Please try again.");
3384
+ } finally {
3385
+ removePendingUpload(uploadId);
3386
+ await removePendingUploadFs(uploadId);
3811
3387
  }
3812
- await next();
3813
- });
3814
- return handler;
3388
+ } else {
3389
+ log.debug?.("pending file not found for consent", { uploadId });
3390
+ await context.sendActivity(expiredUploadMessage);
3391
+ }
3392
+ else {
3393
+ log.debug?.("user declined file consent", { uploadId });
3394
+ removePendingUpload(uploadId);
3395
+ await removePendingUploadFs(uploadId);
3396
+ }
3397
+ return true;
3398
+ }
3399
+ /**
3400
+ * Run the file-consent invoke handler after the SDK route has acknowledged the
3401
+ * invoke. This intentionally does not send its own invokeResponse; it only does
3402
+ * the delayed upload/update work.
3403
+ */
3404
+ async function runMSTeamsFileConsentInvokeHandler(context, log) {
3405
+ try {
3406
+ await withRevokedProxyFallback({
3407
+ run: async () => await handleMSTeamsFileConsentInvoke(context, log),
3408
+ onRevoked: async () => true,
3409
+ onRevokedLog: () => {
3410
+ log.debug?.("turn context revoked during file consent invoke; skipping delayed response");
3411
+ }
3412
+ });
3413
+ } catch (err) {
3414
+ log.debug?.("file consent handler error", { error: formatUnknownError(err) });
3415
+ }
3815
3416
  }
3816
3417
  //#endregion
3817
3418
  //#region extensions/msteams/src/sso-token-store.ts
@@ -3920,7 +3521,6 @@ function applyMSTeamsWebhookTimeouts(httpServer, opts) {
3920
3521
  }
3921
3522
  //#endregion
3922
3523
  //#region extensions/msteams/src/monitor.ts
3923
- const MSTEAMS_WEBHOOK_MAX_BODY_BYTES = DEFAULT_WEBHOOK_MAX_BODY_BYTES;
3924
3524
  async function monitorMSTeamsProvider(opts) {
3925
3525
  const core = getMSTeamsRuntime();
3926
3526
  const log = core.logging.getChildLogger({ name: "msteams" });
@@ -4071,7 +3671,7 @@ async function monitorMSTeamsProvider(opts) {
4071
3671
  }
4072
3672
  }
4073
3673
  } catch (err) {
4074
- runtime?.error(`msteams resolve failed; falling back to raw config entries — allowlist members resolved via Graph may be missing. ${formatUnknownError(err)}`);
3674
+ runtime.error?.(`msteams resolve failed; falling back to raw config entries — allowlist members resolved via Graph may be missing. ${formatUnknownError(err)}`);
4075
3675
  }
4076
3676
  msteamsCfg = {
4077
3677
  ...msteamsCfg,
@@ -4095,9 +3695,42 @@ async function monitorMSTeamsProvider(opts) {
4095
3695
  const pollStore = opts.pollStore ?? createMSTeamsPollStoreFs();
4096
3696
  log.info(`starting provider (port ${port})`);
4097
3697
  const express = await import("express");
4098
- const { sdk, app } = await loadMSTeamsSdkWithAuth(creds);
3698
+ const expressApp = express.default();
3699
+ expressApp.use((req, res, next) => {
3700
+ const auth = req.headers.authorization;
3701
+ if (!auth || !auth.startsWith("Bearer ")) {
3702
+ res.status(401).json({ error: "Unauthorized" });
3703
+ return;
3704
+ }
3705
+ next();
3706
+ });
3707
+ expressApp.use(express.json({ limit: DEFAULT_WEBHOOK_MAX_BODY_BYTES }));
3708
+ expressApp.use((err, _req, res, next) => {
3709
+ if (err && typeof err === "object" && "status" in err && err.status === 413) {
3710
+ res.status(413).json({ error: "Payload too large" });
3711
+ return;
3712
+ }
3713
+ next(err);
3714
+ });
3715
+ const configuredPath = msteamsCfg.webhook?.path ?? "/api/messages";
3716
+ const { app } = await loadMSTeamsSdkWithAuth(creds, {
3717
+ ...resolveMSTeamsSdkCloudOptions(msteamsCfg),
3718
+ httpServerAdapter: await createMSTeamsExpressAdapter(expressApp),
3719
+ messagingEndpoint: configuredPath,
3720
+ ...msteamsCfg.sso?.enabled && msteamsCfg.sso.connectionName ? { oauthDefaultConnectionName: msteamsCfg.sso.connectionName } : {}
3721
+ });
3722
+ if (configuredPath !== "/api/messages") {
3723
+ let warnedLegacyMessagesRoute = false;
3724
+ expressApp.post("/api/messages", (req, res, next) => {
3725
+ if (!warnedLegacyMessagesRoute) {
3726
+ warnedLegacyMessagesRoute = true;
3727
+ log.warn?.(`received request on /api/messages but webhook.path is ${configuredPath}; update your Azure Bot endpoint — this fallback will be removed in a future release`);
3728
+ }
3729
+ req.url = configuredPath;
3730
+ expressApp(req, res, next);
3731
+ });
3732
+ }
4099
3733
  const tokenProvider = createMSTeamsTokenProvider(app);
4100
- const adapter = createMSTeamsAdapter(app, sdk);
4101
3734
  let ssoDeps;
4102
3735
  if (msteamsCfg.sso?.enabled && msteamsCfg.sso.connectionName) {
4103
3736
  ssoDeps = {
@@ -4108,11 +3741,11 @@ async function monitorMSTeamsProvider(opts) {
4108
3741
  log.debug?.("msteams sso enabled", { connectionName: msteamsCfg.sso.connectionName });
4109
3742
  }
4110
3743
  const handler = buildActivityHandler();
4111
- registerMSTeamsHandlers(handler, {
3744
+ const handlerDeps = {
4112
3745
  cfg,
4113
3746
  runtime,
4114
3747
  appId,
4115
- adapter,
3748
+ app,
4116
3749
  tokenProvider,
4117
3750
  textLimit,
4118
3751
  mediaMaxBytes,
@@ -4120,52 +3753,182 @@ async function monitorMSTeamsProvider(opts) {
4120
3753
  pollStore,
4121
3754
  log,
4122
3755
  sso: ssoDeps
4123
- });
4124
- const expressApp = express.default();
4125
- expressApp.use((req, res, next) => {
4126
- const auth = req.headers.authorization;
4127
- if (!auth || !auth.startsWith("Bearer ")) {
4128
- res.status(401).json({ error: "Unauthorized" });
4129
- return;
3756
+ };
3757
+ registerMSTeamsHandlers(handler, handlerDeps);
3758
+ app.on("card.action", async (ctx) => {
3759
+ const adaptedCtx = adaptSdkContext(ctx, app);
3760
+ try {
3761
+ const activity = adaptedCtx.activity;
3762
+ const vote = extractMSTeamsPollVote(activity);
3763
+ if (vote) {
3764
+ const voterId = activity?.from?.aadObjectId ?? activity?.from?.id ?? "unknown";
3765
+ try {
3766
+ if (!await isCardActionInvokeAuthorized(adaptedCtx, handlerDeps)) return {
3767
+ statusCode: 200,
3768
+ type: "application/vnd.microsoft.activity.message",
3769
+ value: "Not authorized."
3770
+ };
3771
+ const existingPoll = await pollStore.getPoll(vote.pollId);
3772
+ if (!existingPoll) {
3773
+ log.debug?.("poll vote ignored (poll not found)", { pollId: vote.pollId });
3774
+ return {
3775
+ statusCode: 200,
3776
+ type: "application/vnd.microsoft.activity.message",
3777
+ value: "Poll not found."
3778
+ };
3779
+ }
3780
+ const pollConversationId = existingPoll.conversationId ? normalizeMSTeamsConversationId(existingPoll.conversationId) : void 0;
3781
+ const activityConversationId = normalizeMSTeamsConversationId(activity?.conversation?.id ?? "");
3782
+ if (pollConversationId && pollConversationId !== activityConversationId) {
3783
+ log.info("poll vote ignored (conversation mismatch)", {
3784
+ pollId: vote.pollId,
3785
+ expectedConversationId: pollConversationId,
3786
+ receivedConversationId: activityConversationId || void 0
3787
+ });
3788
+ return {
3789
+ statusCode: 200,
3790
+ type: "application/vnd.microsoft.activity.message",
3791
+ value: "Poll not found."
3792
+ };
3793
+ }
3794
+ if (await pollStore.recordVote({
3795
+ pollId: vote.pollId,
3796
+ voterId,
3797
+ selections: vote.selections
3798
+ })) {
3799
+ log.info("recorded poll vote", {
3800
+ pollId: vote.pollId,
3801
+ voterId
3802
+ });
3803
+ return {
3804
+ statusCode: 200,
3805
+ type: "application/vnd.microsoft.activity.message",
3806
+ value: "Vote recorded."
3807
+ };
3808
+ }
3809
+ log.debug?.("poll vote ignored (poll not found)", { pollId: vote.pollId });
3810
+ return {
3811
+ statusCode: 200,
3812
+ type: "application/vnd.microsoft.activity.message",
3813
+ value: "Poll not found."
3814
+ };
3815
+ } catch (err) {
3816
+ log.error("failed to record poll vote", {
3817
+ pollId: vote.pollId,
3818
+ error: formatUnknownError(err)
3819
+ });
3820
+ return {
3821
+ statusCode: 500,
3822
+ type: "application/vnd.microsoft.error",
3823
+ value: {
3824
+ code: "RECORD_VOTE_FAILED",
3825
+ message: "Could not record vote.",
3826
+ innerHttpError: {
3827
+ statusCode: 500,
3828
+ body: null
3829
+ }
3830
+ }
3831
+ };
3832
+ }
3833
+ }
3834
+ handler.run(adaptedCtx).catch((err) => {
3835
+ log.error("msteams card.action dispatch failed", { error: formatUnknownError(err) });
3836
+ });
3837
+ return {
3838
+ statusCode: 200,
3839
+ type: "application/vnd.microsoft.activity.message",
3840
+ value: "OK"
3841
+ };
3842
+ } catch (err) {
3843
+ log.error("msteams card.action failed", { error: formatUnknownError(err) });
3844
+ return {
3845
+ statusCode: 500,
3846
+ type: "application/vnd.microsoft.error",
3847
+ value: {
3848
+ code: "CARD_ACTION_FAILED",
3849
+ message: "Card action failed.",
3850
+ innerHttpError: {
3851
+ statusCode: 500,
3852
+ body: null
3853
+ }
3854
+ }
3855
+ };
4130
3856
  }
4131
- next();
4132
3857
  });
4133
- const jwtValidator = await createBotFrameworkJwtValidator(creds);
4134
- expressApp.use((req, res, next) => {
4135
- const authHeader = req.headers.authorization;
4136
- jwtValidator.validate(authHeader).then((valid) => {
4137
- if (!valid) {
4138
- log.debug?.("JWT validation failed");
4139
- res.status(401).json({ error: "Unauthorized" });
3858
+ app.on("file.consent.accept", (ctx) => {
3859
+ runMSTeamsFileConsentInvokeHandler(adaptSdkContext(ctx, app), log);
3860
+ });
3861
+ app.on("file.consent.decline", (ctx) => {
3862
+ runMSTeamsFileConsentInvokeHandler(adaptSdkContext(ctx, app), log);
3863
+ });
3864
+ const handleSdkSigninInvoke = async (ctx, delegateName) => {
3865
+ const adaptedCtx = adaptSdkContext(ctx, app);
3866
+ if (!await isSigninInvokeAuthorized(adaptedCtx, handlerDeps)) return {
3867
+ status: 200,
3868
+ body: {}
3869
+ };
3870
+ if (!ssoDeps) {
3871
+ log.debug?.("signin invoke received but msteams.sso is not configured", { name: adaptedCtx.activity?.name });
3872
+ return {
3873
+ status: 200,
3874
+ body: {}
3875
+ };
3876
+ }
3877
+ const sdkSigninApp = app;
3878
+ const delegate = sdkSigninApp[delegateName];
3879
+ if (typeof delegate !== "function") throw new Error(`Teams SDK ${delegateName} handler is unavailable`);
3880
+ return delegate.call(sdkSigninApp, ctx);
3881
+ };
3882
+ app.on("signin.token-exchange", (ctx) => handleSdkSigninInvoke(ctx, "onTokenExchange"));
3883
+ app.on("signin.verify-state", (ctx) => handleSdkSigninInvoke(ctx, "onVerifyState"));
3884
+ if (ssoDeps) app.event("signin", (ctx) => {
3885
+ (async () => {
3886
+ if (!await isSigninInvokeAuthorized(adaptSdkContext(ctx, app), handlerDeps)) return;
3887
+ const activity = ctx.activity;
3888
+ const userIds = Array.from(new Set([activity.from?.id, activity.from?.aadObjectId].filter((id) => Boolean(id))));
3889
+ const connectionName = ctx.token.connectionName || ssoDeps.connectionName;
3890
+ if (!connectionName || !ctx.token.token || userIds.length === 0) {
3891
+ log.warn?.("msteams sso signin event missing token metadata", {
3892
+ hasConnectionName: Boolean(connectionName),
3893
+ hasToken: Boolean(ctx.token.token),
3894
+ hasUser: userIds.length > 0
3895
+ });
4140
3896
  return;
4141
3897
  }
4142
- next();
4143
- }).catch((err) => {
4144
- if (err instanceof Error && /ECONNREFUSED|ENOTFOUND|EHOSTUNREACH|ETIMEDOUT|ECONNRESET/i.test(err.code ?? err.message)) runtime?.error(`msteams: JWKS key fetch failed — check egress to login.botframework.com:443 (firewall or DNS may be blocking it). Bot will 401 all inbound requests until this is resolved. Error: ${formatUnknownError(err)}`);
4145
- else log.debug?.(`JWT validation error: ${formatUnknownError(err)}`);
4146
- res.status(401).json({ error: "Unauthorized" });
3898
+ await Promise.all(userIds.map((userId) => ssoDeps.tokenStore.save({
3899
+ connectionName,
3900
+ userId,
3901
+ token: ctx.token.token,
3902
+ expiresAt: ctx.token.expiration,
3903
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
3904
+ })));
3905
+ log.info("msteams sso token persisted", {
3906
+ connectionName,
3907
+ userIdCount: userIds.length,
3908
+ hasExpiry: Boolean(ctx.token.expiration)
3909
+ });
3910
+ })().catch((err) => {
3911
+ log.error("msteams sso token persistence failed", { error: formatUnknownError(err) });
4147
3912
  });
4148
3913
  });
4149
- expressApp.use(express.json({ limit: MSTEAMS_WEBHOOK_MAX_BODY_BYTES }));
4150
- expressApp.use((err, _req, res, next) => {
4151
- if (err && typeof err === "object" && "status" in err && err.status === 413) {
4152
- res.status(413).json({ error: "Payload too large" });
4153
- return;
4154
- }
4155
- next(err);
3914
+ app.on("message.submit", async (ctx) => {
3915
+ if (!await runMSTeamsFeedbackInvokeHandler(adaptSdkContext(ctx, app), handlerDeps)) await ctx.next?.call(ctx);
4156
3916
  });
4157
- const configuredPath = msteamsCfg.webhook?.path ?? "/api/messages";
4158
- const messageHandler = (req, res) => {
4159
- adapter.process(req, res, (context) => handler.run(context)).catch((err) => {
3917
+ app.on("activity", async (ctx) => {
3918
+ try {
3919
+ const adaptedCtx = adaptSdkContext(ctx, app);
3920
+ const activity = adaptedCtx.activity;
3921
+ if (activity?.type === "invoke") {
3922
+ if (activity?.name === "adaptiveCard/action") return;
3923
+ if (activity?.name === "fileConsent/invoke") return;
3924
+ if (activity?.name === "signin/tokenExchange" || activity?.name === "signin/verifyState") return;
3925
+ }
3926
+ await handler.run(adaptedCtx);
3927
+ } catch (err) {
4160
3928
  log.error("msteams webhook failed", { error: formatUnknownError(err) });
4161
- });
4162
- };
4163
- expressApp.post(configuredPath, messageHandler);
4164
- if (configuredPath !== "/api/messages") expressApp.post("/api/messages", messageHandler);
4165
- log.debug?.("listening on paths", {
4166
- primary: configuredPath,
4167
- fallback: "/api/messages"
3929
+ }
4168
3930
  });
3931
+ await app.initialize();
4169
3932
  const httpServer = expressApp.listen(port);
4170
3933
  await new Promise((resolve, reject) => {
4171
3934
  const onListening = () => {
@@ -4245,5 +4008,34 @@ function buildActivityHandler() {
4245
4008
  };
4246
4009
  return handler;
4247
4010
  }
4011
+ /**
4012
+ * Adapt a new @microsoft/teams.apps SDK context to the MSTeamsTurnContext interface
4013
+ * our handlers expect. The new SDK uses reply()/send() instead of sendActivity().
4014
+ */
4015
+ function adaptSdkContext(ctx, app) {
4016
+ const sdkCtx = ctx ?? {};
4017
+ if (typeof sdkCtx.reply !== "function" && typeof sdkCtx.send !== "function") return ctx;
4018
+ const conversationId = sdkCtx.activity?.conversation?.id ?? "";
4019
+ const activityApi = sdkCtx.api ?? app.api;
4020
+ const conversationType = (sdkCtx.activity?.conversation?.conversationType ?? "").toLowerCase();
4021
+ const isThreadable = conversationType === "channel" || conversationType === "groupchat";
4022
+ const sendActivity = (activity) => isThreadable ? sdkCtx.reply(activity) : sdkCtx.send(activity);
4023
+ return Object.assign(Object.create(Object.getPrototypeOf(ctx)), ctx, {
4024
+ sendActivity,
4025
+ sendActivities: async (activities) => {
4026
+ const results = [];
4027
+ for (const a of activities) results.push(await sendActivity(a));
4028
+ return results;
4029
+ },
4030
+ updateActivity: async (activity) => {
4031
+ const activityId = activity.id ?? "";
4032
+ return activityApi.conversations.activities(conversationId).update(activityId, activity);
4033
+ },
4034
+ deleteActivity: async (activityId) => {
4035
+ return activityApi.conversations.activities(conversationId).delete(activityId);
4036
+ },
4037
+ stream: sdkCtx.stream
4038
+ });
4039
+ }
4248
4040
  //#endregion
4249
4041
  export { monitorMSTeamsProvider };