@openclaw/msteams 2026.5.27 → 2026.5.28-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (701) hide show
  1. package/dist/api.js +2 -2
  2. package/dist/{channel-c7nnGfMx.js → channel-C4ifQ0RF.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-Cl_OVKBH.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-BevpsEsu.js} +301 -626
  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-C9cvgEV9.js} +221 -120
  11. package/dist/setup-plugin-api.js +3 -3
  12. package/dist/{setup-surface-evwYex71.js → setup-surface-Byk8kgPH.js} +2 -2
  13. package/dist/{src-ui0zJEZI.js → src-W5GVJcCN.js} +761 -981
  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-BevpsEsu.js";
3
+ import { d as resolveMSTeamsUserAllowlist, u as resolveMSTeamsChannelAllowlist } from "./setup-surface-Byk8kgPH.js";
4
+ import { a as resolveMSTeamsReplyPolicy, i as resolveMSTeamsAllowlistMatch, o as resolveMSTeamsRouteConfig } from "./channel-C4ifQ0RF.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-C9cvgEV9.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;
@@ -603,7 +500,11 @@ async function fetchBotFrameworkAttachmentInfo(params) {
603
500
  policy: params.policy,
604
501
  fetchFn: params.fetchFn,
605
502
  resolveFn: params.resolveFn,
606
- requestInit: { headers: ensureUserAgentHeader({ Authorization: `Bearer ${params.accessToken}` }) }
503
+ requestInit: { headers: buildBotFrameworkAttachmentHeaders({
504
+ url,
505
+ accessToken: params.accessToken,
506
+ policy: params.policy
507
+ }) }
607
508
  });
608
509
  } catch (err) {
609
510
  params.logger?.warn?.("msteams botFramework attachmentInfo fetch failed", { error: err instanceof Error ? err.message : String(err) });
@@ -629,7 +530,11 @@ async function saveBotFrameworkAttachmentView(params) {
629
530
  policy: params.policy,
630
531
  fetchFn: params.fetchFn,
631
532
  resolveFn: params.resolveFn,
632
- requestInit: { headers: ensureUserAgentHeader({ Authorization: `Bearer ${params.accessToken}` }) }
533
+ requestInit: { headers: buildBotFrameworkAttachmentHeaders({
534
+ url,
535
+ accessToken: params.accessToken,
536
+ policy: params.policy
537
+ }) }
633
538
  });
634
539
  } catch (err) {
635
540
  params.logger?.warn?.("msteams botFramework attachmentView fetch failed", { error: err instanceof Error ? err.message : String(err) });
@@ -978,10 +883,8 @@ async function downloadMSTeamsAttachments(params) {
978
883
  });
979
884
  out.push(media);
980
885
  } 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
- });
886
+ const msg = err instanceof Error ? err.message : String(err);
887
+ params.logger?.warn?.(`msteams attachment download failed host=${safeHostForLog(candidate.url)} error=${msg}`);
985
888
  }
986
889
  }
987
890
  return out;
@@ -1568,240 +1471,54 @@ function markParentContextInjected(sessionKey, parentId) {
1568
1471
  touchLru(injectedParents, sessionKey, parentId, INJECTED_MAX);
1569
1472
  }
1570
1473
  //#endregion
1571
- //#region extensions/msteams/src/streaming-message.ts
1474
+ //#region extensions/msteams/src/reply-stream-controller.ts
1475
+ function isStreamCancelledError(err) {
1476
+ return err instanceof Error && err.name === "StreamCancelledError";
1477
+ }
1572
1478
  /**
1573
- * Teams streaming message using the streaminfo entity protocol.
1479
+ * Bridges openclaw's reply pipeline callbacks to the SDK's `ctx.stream`.
1480
+ * Streaming is enabled for personal (DM) conversations only; group/channel
1481
+ * messages fall through to block delivery.
1574
1482
  *
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")
1579
- *
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.
1483
+ * Streaming modes (resolved from `cfg.channels.msteams.streaming.preview`):
1484
+ * - "partial" (default): per-token streaming via `stream.emit(text)`. Each
1485
+ * chunk goes onto the live preview card in Teams.
1486
+ * - "progress": no per-token streaming; the preview card carries an
1487
+ * informative status that updates as tools run (e.g. "Looking up the
1488
+ * schema..." "Generating SQL..."). When tool-progress streaming is also
1489
+ * enabled, raw tool names appear as bullets above the label.
1490
+ * - "block": disable native streaming entirely; the reply lands as a regular
1491
+ * block message. We bypass the controller in that case.
1592
1492
  */
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
1493
  function createTeamsReplyStreamController(params) {
1779
1494
  const isPersonal = normalizeOptionalLowercaseString(params.conversationType) === "personal";
1780
1495
  const streamMode = resolveChannelPreviewStreamMode(params.msteamsConfig, "partial");
1781
1496
  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 = [];
1497
+ const shouldStreamPreviewToolProgress = streamMode === "progress" && resolveChannelStreamingPreviewToolProgress(params.msteamsConfig);
1498
+ const stream = shouldUseNativeStream ? params.context.stream : void 0;
1499
+ let tokensEmitted = false;
1500
+ let streamFinalizationPending = false;
1501
+ let canceledLocally = false;
1502
+ let streamFailed = false;
1794
1503
  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 }));
1504
+ let progressLines = [];
1505
+ let pendingFinalPayload;
1506
+ let emittedTextLength = 0;
1507
+ const wasCanceled = () => canceledLocally || Boolean(stream?.canceled);
1508
+ const fallbackPayloadForSuppressedFinal = (payload) => {
1509
+ return Boolean(payload.mediaUrl || payload.mediaUrls?.length) ? {
1510
+ ...payload,
1511
+ mediaUrl: void 0,
1512
+ mediaUrls: void 0
1513
+ } : payload;
1802
1514
  };
1803
- const renderInformativeUpdate = async () => {
1804
- if (!stream) return;
1515
+ /**
1516
+ * Render the current informative status line into the streaming card. Pulls
1517
+ * the rotating "Thinking..." label from msteams config (or the plugin-sdk
1518
+ * default) and prepends collected tool-progress lines when configured.
1519
+ */
1520
+ const renderInformativeUpdate = () => {
1521
+ if (!stream || wasCanceled()) return;
1805
1522
  const informativeText = formatChannelProgressDraftText({
1806
1523
  entry: params.msteamsConfig,
1807
1524
  lines: shouldStreamPreviewToolProgress ? progressLines : [],
@@ -1810,151 +1527,142 @@ function createTeamsReplyStreamController(params) {
1810
1527
  });
1811
1528
  if (!informativeText || informativeText === lastInformativeText) return;
1812
1529
  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) });
1530
+ try {
1531
+ stream.update(informativeText);
1532
+ } catch (err) {
1533
+ if (isStreamCancelledError(err)) {
1534
+ canceledLocally = true;
1535
+ return;
1536
+ }
1537
+ params.log?.debug?.(`stream informative update failed: ${err instanceof Error ? err.message : String(err)}`);
1830
1538
  }
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
1539
  };
1540
+ const progressDraftGate = createChannelProgressDraftGate({ onStart: renderInformativeUpdate });
1880
1541
  return {
1881
1542
  async onReplyStart() {},
1882
- async noteProgressWork(options) {
1883
- await noteProgressWork(options);
1884
- },
1885
1543
  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);
1544
+ if (!stream || !payload.text || wasCanceled() || streamMode !== "partial" || streamFinalizationPending) return;
1545
+ const fullText = payload.text;
1546
+ if (fullText.length <= emittedTextLength) return;
1547
+ const delta = fullText.slice(emittedTextLength);
1548
+ try {
1549
+ stream.emit(delta);
1550
+ emittedTextLength = fullText.length;
1551
+ tokensEmitted = true;
1552
+ } catch (err) {
1553
+ if (isStreamCancelledError(err)) {
1554
+ canceledLocally = true;
1555
+ return;
1556
+ }
1557
+ streamFailed = true;
1558
+ params.log?.warn?.(`msteams stream emit failed, falling back to block delivery: ${err instanceof Error ? err.message : String(err)}`);
1559
+ }
1893
1560
  },
1894
- shouldSuppressDefaultToolProgressMessages() {
1895
- return shouldSuppressDefaultToolProgressMessages;
1561
+ /**
1562
+ * Note that the agent is working — bumps the progress-draft gate so the
1563
+ * informative status starts (or refreshes) on the next render. Called
1564
+ * from the reply-dispatcher's typing callbacks.
1565
+ */
1566
+ async noteProgressWork(options) {
1567
+ if (!stream || streamMode !== "progress") return;
1568
+ if (options?.toolName !== void 0 && !isChannelProgressDraftWorkToolName(options.toolName)) return;
1569
+ const hadStarted = progressDraftGate.hasStarted;
1570
+ await progressDraftGate.noteWork();
1571
+ if (hadStarted && progressDraftGate.hasStarted) renderInformativeUpdate();
1896
1572
  },
1897
- shouldStreamPreviewToolProgress() {
1898
- return shouldStreamPreviewToolProgress;
1573
+ /**
1574
+ * Append a tool-progress line (e.g. a tool name being invoked) into the
1575
+ * preview card's informative status. Only takes effect in "progress" mode
1576
+ * with `streaming.previewToolProgress` enabled in config.
1577
+ */
1578
+ async pushProgressLine(line, options) {
1579
+ if (!stream || streamMode !== "progress") return;
1580
+ if (options?.toolName !== void 0 && !isChannelProgressDraftWorkToolName(options.toolName)) return;
1581
+ if (shouldStreamPreviewToolProgress) {
1582
+ const normalized = normalizeChannelProgressDraftLineIdentity(line);
1583
+ if (normalized) progressLines = mergeChannelProgressDraftLine(progressLines, typeof line === "object" && line !== void 0 ? line : normalized, { maxLines: resolveChannelProgressDraftMaxLines(params.msteamsConfig) });
1584
+ }
1585
+ const hadStarted = progressDraftGate.hasStarted;
1586
+ await progressDraftGate.noteWork();
1587
+ if (hadStarted && progressDraftGate.hasStarted) renderInformativeUpdate();
1899
1588
  },
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);
1589
+ preparePayload(payload) {
1590
+ if (!stream) return payload;
1591
+ if (wasCanceled()) return;
1592
+ if (tokensEmitted && !streamFailed) {
1593
+ const hasMedia = Boolean(payload.mediaUrl || payload.mediaUrls?.length);
1594
+ pendingFinalPayload = fallbackPayloadForSuppressedFinal(payload);
1595
+ streamFinalizationPending = true;
1596
+ tokensEmitted = false;
1597
+ return hasMedia ? {
1598
+ ...payload,
1599
+ text: void 0
1600
+ } : void 0;
1905
1601
  }
1906
- if (!stream || !streamReceivedTokens) return payload;
1907
- if (stream.isFailed) {
1908
- streamReceivedTokens = false;
1909
- return fallbackAfterStreamFailure(payload, hasMedia);
1602
+ if (streamMode === "progress" && payload.text) try {
1603
+ stream.emit(payload.text);
1604
+ pendingFinalPayload = fallbackPayloadForSuppressedFinal(payload);
1605
+ streamFinalizationPending = true;
1606
+ return Boolean(payload.mediaUrl || payload.mediaUrls?.length) ? {
1607
+ ...payload,
1608
+ text: void 0
1609
+ } : void 0;
1610
+ } catch (err) {
1611
+ if (isStreamCancelledError(err)) {
1612
+ canceledLocally = true;
1613
+ return;
1614
+ }
1615
+ params.log?.debug?.(`progress-mode finalize failed: ${err instanceof Error ? err.message : String(err)}`);
1910
1616
  }
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
- };
1617
+ return payload;
1921
1618
  },
1922
1619
  async finalize() {
1923
- progressDraftGate.cancel();
1924
- await pendingFinalize;
1925
- if (!pendingFinalize) {
1926
- await stream?.finalize();
1927
- markStreamFinalized();
1620
+ if (!stream || !streamFinalizationPending || wasCanceled()) return;
1621
+ const finalEntities = [{
1622
+ type: "https://schema.org/Message",
1623
+ "@type": "Message",
1624
+ "@context": "https://schema.org",
1625
+ "@id": "",
1626
+ additionalType: ["AIGeneratedContent"]
1627
+ }];
1628
+ const finalChannelData = params.feedbackLoopEnabled ? { feedbackLoopEnabled: true } : {};
1629
+ try {
1630
+ stream.emit({
1631
+ type: "message",
1632
+ entities: finalEntities,
1633
+ channelData: finalChannelData
1634
+ });
1635
+ const result = await stream.close();
1636
+ streamFinalizationPending = false;
1637
+ if (!result) {
1638
+ const fallback = pendingFinalPayload;
1639
+ pendingFinalPayload = void 0;
1640
+ return fallback;
1641
+ }
1642
+ pendingFinalPayload = void 0;
1643
+ return;
1644
+ } catch (err) {
1645
+ if (isStreamCancelledError(err)) {
1646
+ canceledLocally = true;
1647
+ pendingFinalPayload = void 0;
1648
+ streamFinalizationPending = false;
1649
+ return;
1650
+ }
1651
+ streamFailed = true;
1652
+ streamFinalizationPending = false;
1653
+ params.log?.warn?.(`msteams stream finalize failed: ${err instanceof Error ? err.message : String(err)}`);
1654
+ const fallback = pendingFinalPayload;
1655
+ pendingFinalPayload = void 0;
1656
+ return fallback;
1928
1657
  }
1929
1658
  },
1930
1659
  hasStream() {
1931
1660
  return Boolean(stream);
1932
1661
  },
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
1662
  isStreamActive() {
1954
- if (!stream) return false;
1955
- if (stream.isFinalized || stream.isFailed) return false;
1956
- return streamReceivedTokens;
1957
- }
1663
+ return Boolean(stream) && tokensEmitted && !wasCanceled() && !streamFailed;
1664
+ },
1665
+ wasCanceled
1958
1666
  };
1959
1667
  }
1960
1668
  //#endregion
@@ -1981,6 +1689,7 @@ function createMSTeamsReplyDispatcher(params) {
1981
1689
  */
1982
1690
  const TYPING_KEEPALIVE_MAX_DURATION_MS = 10 * 6e4;
1983
1691
  const streamActiveRef = { current: () => false };
1692
+ const streamCanceledRef = { current: () => false };
1984
1693
  const rawSendTypingIndicator = async () => {
1985
1694
  await withRevokedProxyFallback({
1986
1695
  run: async () => {
@@ -1988,12 +1697,7 @@ function createMSTeamsReplyDispatcher(params) {
1988
1697
  },
1989
1698
  onRevoked: async () => {
1990
1699
  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
- });
1700
+ await sendMSTeamsActivityWithReference(params.app, baseRef, { type: "typing" }, { serviceUrlBoundary: resolveMSTeamsSdkCloudOptions(msteamsCfg) });
1997
1701
  },
1998
1702
  onRevokedLog: () => {
1999
1703
  params.log.debug?.("turn context revoked, sending typing via proactive messaging");
@@ -2002,6 +1706,7 @@ function createMSTeamsReplyDispatcher(params) {
2002
1706
  };
2003
1707
  const sendTypingIndicator = isTypingSupported ? async () => {
2004
1708
  if (streamActiveRef.current()) return;
1709
+ if (streamCanceledRef.current()) return;
2005
1710
  await rawSendTypingIndicator();
2006
1711
  } : async () => {};
2007
1712
  const { onModelSelected, typingCallbacks, ...replyPipeline } = createChannelMessageReplyPipeline({
@@ -2042,14 +1747,16 @@ function createMSTeamsReplyDispatcher(params) {
2042
1747
  progressSeed: `${params.accountId ?? "default"}:${params.conversationRef.conversation?.id ?? ""}`
2043
1748
  });
2044
1749
  streamActiveRef.current = () => streamController.isStreamActive();
2045
- const resolvedBlockStreamingEnabled = resolveChannelPreviewStreamMode(msteamsCfg, "partial") === "block" ? true : resolveChannelStreamingBlockEnabled(msteamsCfg);
2046
- const blockStreamingEnabled = resolvedBlockStreamingEnabled ?? false;
1750
+ streamCanceledRef.current = () => streamController.wasCanceled();
1751
+ const teamsStreamMode = resolveChannelPreviewStreamMode(msteamsCfg, "partial");
1752
+ const blockStreamingResolved = teamsStreamMode === "block" ? true : resolveChannelStreamingBlockEnabled(msteamsCfg);
1753
+ const blockStreamingEnabled = blockStreamingResolved ?? false;
2047
1754
  const typingIndicatorEnabled = typeof msteamsCfg?.typingIndicator === "boolean" ? msteamsCfg.typingIndicator : true;
2048
1755
  const pendingMessages = [];
2049
1756
  const sendMessages = async (messages) => {
2050
1757
  return sendMSTeamsMessages({
2051
1758
  replyStyle: params.replyStyle,
2052
- adapter: params.adapter,
1759
+ app: params.app,
2053
1760
  appId: params.appId,
2054
1761
  conversationRef: params.conversationRef,
2055
1762
  context: params.context,
@@ -2064,7 +1771,8 @@ function createMSTeamsReplyDispatcher(params) {
2064
1771
  tokenProvider: params.tokenProvider,
2065
1772
  sharePointSiteId: params.sharePointSiteId,
2066
1773
  mediaMaxBytes,
2067
- feedbackLoopEnabled
1774
+ feedbackLoopEnabled,
1775
+ serviceUrlBoundary: resolveMSTeamsSdkCloudOptions(msteamsCfg)
2068
1776
  });
2069
1777
  };
2070
1778
  const queueDeliveryFailureSystemEvent = (failure) => {
@@ -2083,6 +1791,16 @@ function createMSTeamsReplyDispatcher(params) {
2083
1791
  contextKey: `msteams:delivery-failure:${params.conversationRef.conversation?.id ?? "unknown"}`
2084
1792
  });
2085
1793
  };
1794
+ const queueReplyPayload = (payload) => {
1795
+ const messages = renderReplyPayloadsToMessages([payload], {
1796
+ textChunkLimit: params.textLimit,
1797
+ chunkText: true,
1798
+ mediaMode: "split",
1799
+ tableMode,
1800
+ chunkMode
1801
+ });
1802
+ pendingMessages.push(...messages);
1803
+ };
2086
1804
  const flushPendingMessages = async () => {
2087
1805
  if (pendingMessages.length === 0) return;
2088
1806
  const toSend = pendingMessages.splice(0);
@@ -2125,16 +1843,9 @@ function createMSTeamsReplyDispatcher(params) {
2125
1843
  },
2126
1844
  typingCallbacks,
2127
1845
  deliver: async (payload) => {
2128
- const preparedPayload = await streamController.preparePayload(payload);
1846
+ const preparedPayload = streamController.preparePayload(payload);
2129
1847
  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);
1848
+ queueReplyPayload(preparedPayload);
2138
1849
  if (blockStreamingEnabled) await flushPendingMessages();
2139
1850
  },
2140
1851
  onError: (err, info) => {
@@ -2161,110 +1872,114 @@ function createMSTeamsReplyDispatcher(params) {
2161
1872
  classification,
2162
1873
  hint
2163
1874
  });
2164
- }).then(() => {
2165
- return streamController.finalize().catch((err) => {
1875
+ }).then(async () => {
1876
+ const fallbackPayload = await streamController.finalize().catch((err) => {
2166
1877
  params.log.debug?.("stream finalize failed", { error: formatUnknownError(err) });
2167
1878
  });
1879
+ if (fallbackPayload) {
1880
+ queueReplyPayload(fallbackPayload);
1881
+ await flushPendingMessages();
1882
+ }
2168
1883
  }).finally(() => {
2169
1884
  baseMarkDispatchIdle();
2170
1885
  });
2171
1886
  };
1887
+ const previewToolProgressEnabled = resolveChannelStreamingPreviewToolProgress(msteamsCfg);
1888
+ const suppressDefaultToolProgressMessages = resolveChannelStreamingSuppressDefaultToolProgressMessages(msteamsCfg);
1889
+ const shouldSuppressDefaultToolProgressMessages = teamsStreamMode === "progress" && suppressDefaultToolProgressMessages && previewToolProgressEnabled;
1890
+ const progressCallbacks = streamController.hasStream() ? {
1891
+ onReasoningStream: async (payload) => {
1892
+ const text = typeof payload?.text === "string" ? payload.text : void 0;
1893
+ if (!text) return;
1894
+ if (payload?.isReasoningSnapshot !== true) {
1895
+ await streamController.pushProgressLine(text);
1896
+ return;
1897
+ }
1898
+ await streamController.pushProgressLine(buildChannelProgressDraftLine({
1899
+ event: "item",
1900
+ itemId: "reasoning",
1901
+ itemKind: "analysis",
1902
+ title: "Reasoning",
1903
+ progressText: text
1904
+ }));
1905
+ },
1906
+ onToolStart: async (payload) => {
1907
+ const name = typeof payload?.name === "string" ? payload.name : void 0;
1908
+ const detailMode = typeof payload?.detailMode === "string" ? payload.detailMode : void 0;
1909
+ await streamController.pushProgressLine(buildChannelProgressDraftLineForEntry(msteamsCfg, {
1910
+ event: "tool",
1911
+ ...name ? { name } : {},
1912
+ ...typeof payload?.phase === "string" ? { phase: payload.phase } : {},
1913
+ ...payload?.args && typeof payload.args === "object" ? { args: payload.args } : {}
1914
+ }, detailMode === "explain" || detailMode === "raw" ? { detailMode } : void 0), name ? { toolName: name } : void 0);
1915
+ },
1916
+ onItemEvent: async (payload) => {
1917
+ await streamController.pushProgressLine(buildChannelProgressDraftLineForEntry(msteamsCfg, {
1918
+ event: "item",
1919
+ ...typeof payload?.kind === "string" ? { itemKind: payload.kind } : {},
1920
+ ...typeof payload?.title === "string" ? { title: payload.title } : {},
1921
+ ...typeof payload?.name === "string" ? { name: payload.name } : {},
1922
+ ...typeof payload?.phase === "string" ? { phase: payload.phase } : {},
1923
+ ...typeof payload?.status === "string" ? { status: payload.status } : {},
1924
+ ...typeof payload?.summary === "string" ? { summary: payload.summary } : {},
1925
+ ...typeof payload?.progressText === "string" ? { progressText: payload.progressText } : {},
1926
+ ...typeof payload?.meta === "string" ? { meta: payload.meta } : {}
1927
+ }));
1928
+ },
1929
+ onPlanUpdate: async (payload) => {
1930
+ if (payload?.phase !== "update") return;
1931
+ await streamController.pushProgressLine(buildChannelProgressDraftLine({
1932
+ event: "plan",
1933
+ phase: payload.phase,
1934
+ ...typeof payload?.title === "string" ? { title: payload.title } : {},
1935
+ ...typeof payload?.explanation === "string" ? { explanation: payload.explanation } : {},
1936
+ ...Array.isArray(payload?.steps) && payload.steps.every((s) => typeof s === "string") ? { steps: payload.steps } : {}
1937
+ }));
1938
+ },
1939
+ onApprovalEvent: async (payload) => {
1940
+ if (payload?.phase !== "requested") return;
1941
+ await streamController.pushProgressLine(buildChannelProgressDraftLine({
1942
+ event: "approval",
1943
+ phase: payload.phase,
1944
+ ...typeof payload?.title === "string" ? { title: payload.title } : {},
1945
+ ...typeof payload?.command === "string" ? { command: payload.command } : {},
1946
+ ...typeof payload?.reason === "string" ? { reason: payload.reason } : {},
1947
+ ...typeof payload?.message === "string" ? { message: payload.message } : {}
1948
+ }));
1949
+ },
1950
+ onCommandOutput: async (payload) => {
1951
+ if (payload?.phase !== "end") return;
1952
+ await streamController.pushProgressLine(buildChannelProgressDraftLine({
1953
+ event: "command-output",
1954
+ phase: payload.phase,
1955
+ ...typeof payload?.title === "string" ? { title: payload.title } : {},
1956
+ ...typeof payload?.name === "string" ? { name: payload.name } : {},
1957
+ ...typeof payload?.status === "string" ? { status: payload.status } : {},
1958
+ ...typeof payload?.exitCode === "number" ? { exitCode: payload.exitCode } : {}
1959
+ }));
1960
+ },
1961
+ onPatchSummary: async (payload) => {
1962
+ if (payload?.phase !== "end") return;
1963
+ await streamController.pushProgressLine(buildChannelProgressDraftLine({
1964
+ event: "patch",
1965
+ phase: payload.phase,
1966
+ ...typeof payload?.title === "string" ? { title: payload.title } : {},
1967
+ ...typeof payload?.name === "string" ? { name: payload.name } : {},
1968
+ ...Array.isArray(payload?.added) && payload.added.every((s) => typeof s === "string") ? { added: payload.added } : {},
1969
+ ...Array.isArray(payload?.modified) && payload.modified.every((s) => typeof s === "string") ? { modified: payload.modified } : {},
1970
+ ...Array.isArray(payload?.deleted) && payload.deleted.every((s) => typeof s === "string") ? { deleted: payload.deleted } : {},
1971
+ ...typeof payload?.summary === "string" ? { summary: payload.summary } : {}
1972
+ }));
1973
+ }
1974
+ } : {};
2172
1975
  return {
2173
1976
  dispatcher,
2174
1977
  replyOptions: {
2175
1978
  ...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,
1979
+ ...streamController.hasStream() ? { onPartialReply: (payload) => streamController.onPartialReply(payload) } : {},
1980
+ ...progressCallbacks,
1981
+ ...shouldSuppressDefaultToolProgressMessages ? { suppressDefaultToolProgressMessages: true } : {},
1982
+ disableBlockStreaming: blockStreamingResolved == null ? void 0 : !blockStreamingResolved,
2268
1983
  onModelSelected
2269
1984
  },
2270
1985
  markDispatchIdle
@@ -2545,7 +2260,7 @@ function buildStoredConversationReference(params) {
2545
2260
  };
2546
2261
  }
2547
2262
  function createMSTeamsMessageHandler(deps) {
2548
- const { cfg, runtime, appId, adapter, tokenProvider, textLimit, mediaMaxBytes, conversationStore, pollStore, log } = deps;
2263
+ const { cfg, runtime, appId, app, tokenProvider, textLimit, mediaMaxBytes, conversationStore, pollStore, log } = deps;
2549
2264
  const core = getMSTeamsRuntime();
2550
2265
  const logVerboseMessage = (message) => {
2551
2266
  if (core.logging.shouldLogVerbose()) log.debug?.(message);
@@ -3012,7 +2727,7 @@ function createMSTeamsMessageHandler(deps) {
3012
2727
  accountId: route.accountId,
3013
2728
  runtime,
3014
2729
  log,
3015
- adapter,
2730
+ app,
3016
2731
  appId,
3017
2732
  conversationRef,
3018
2733
  context,
@@ -3243,191 +2958,6 @@ function createMSTeamsReactionHandler(deps) {
3243
2958
  };
3244
2959
  }
3245
2960
  //#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
2961
  //#region extensions/msteams/src/welcome-card.ts
3432
2962
  /**
3433
2963
  * Builds an Adaptive Card for welcoming users when the bot is added to a conversation.
@@ -3546,11 +3076,118 @@ async function isSigninInvokeAuthorized(context, deps) {
3546
3076
  includeInvokeName: true
3547
3077
  });
3548
3078
  }
3079
+ async function isCardActionInvokeAuthorized(context, deps) {
3080
+ return isInvokeAuthorized({
3081
+ context,
3082
+ deps,
3083
+ deniedLogs: {
3084
+ dm: "dropping card action invoke (dm sender not allowlisted)",
3085
+ channel: "dropping card action invoke (not in team/channel allowlist)",
3086
+ group: "dropping card action invoke (group sender not allowlisted)"
3087
+ },
3088
+ includeInvokeName: true
3089
+ });
3090
+ }
3091
+ function registerMSTeamsHandlers(handler, deps) {
3092
+ const handleTeamsMessage = createMSTeamsMessageHandler(deps);
3093
+ const handleReaction = createMSTeamsReactionHandler(deps);
3094
+ const originalRun = handler.run;
3095
+ if (originalRun) handler.run = async (context) => {
3096
+ const ctx = context;
3097
+ if (ctx.activity?.type === "invoke" && ctx.activity?.name === "adaptiveCard/action") {
3098
+ const text = serializeAdaptiveCardActionValue(ctx.activity?.value);
3099
+ if (text) await handleTeamsMessage({
3100
+ ...ctx,
3101
+ activity: {
3102
+ ...ctx.activity,
3103
+ type: "message",
3104
+ text
3105
+ }
3106
+ });
3107
+ return;
3108
+ }
3109
+ return originalRun.call(handler, context);
3110
+ };
3111
+ handler.onMessage(async (context, next) => {
3112
+ try {
3113
+ await handleTeamsMessage(context);
3114
+ } catch (err) {
3115
+ deps.runtime.error(`msteams handler failed: ${formatUnknownError(err)}`);
3116
+ }
3117
+ await next();
3118
+ });
3119
+ handler.onMembersAdded(async (context, next) => {
3120
+ const ctx = context;
3121
+ const membersAdded = ctx.activity?.membersAdded ?? [];
3122
+ const botId = ctx.activity?.recipient?.id;
3123
+ const msteamsCfg = deps.cfg.channels?.msteams;
3124
+ for (const member of membersAdded) if (member.id === botId) {
3125
+ const isPersonal = (normalizeOptionalLowercaseString(ctx.activity?.conversation?.conversationType) ?? "personal") === "personal";
3126
+ if (isPersonal && msteamsCfg?.welcomeCard !== false) {
3127
+ const card = buildWelcomeCard({
3128
+ botName: ctx.activity?.recipient?.name ?? void 0,
3129
+ promptStarters: msteamsCfg?.promptStarters
3130
+ });
3131
+ try {
3132
+ await ctx.sendActivity({
3133
+ type: "message",
3134
+ attachments: [{
3135
+ contentType: "application/vnd.microsoft.card.adaptive",
3136
+ content: card
3137
+ }]
3138
+ });
3139
+ deps.log.info("sent welcome card");
3140
+ } catch (err) {
3141
+ deps.log.debug?.("failed to send welcome card", { error: formatUnknownError(err) });
3142
+ }
3143
+ } else if (!isPersonal && msteamsCfg?.groupWelcomeCard === true) {
3144
+ const botName = ctx.activity?.recipient?.name ?? void 0;
3145
+ try {
3146
+ await ctx.sendActivity(buildGroupWelcomeText(botName));
3147
+ deps.log.info("sent group welcome message");
3148
+ } catch (err) {
3149
+ deps.log.debug?.("failed to send group welcome", { error: formatUnknownError(err) });
3150
+ }
3151
+ } else deps.log.debug?.("skipping welcome (disabled by config or conversation type)");
3152
+ } else deps.log.debug?.("member added", { member: member.id });
3153
+ await next();
3154
+ });
3155
+ handler.onReactionsAdded(async (context, next) => {
3156
+ try {
3157
+ await handleReaction(context, "added");
3158
+ } catch (err) {
3159
+ deps.runtime.error(`msteams reaction handler failed: ${String(err)}`);
3160
+ }
3161
+ await next();
3162
+ });
3163
+ handler.onReactionsRemoved(async (context, next) => {
3164
+ try {
3165
+ await handleReaction(context, "removed");
3166
+ } catch (err) {
3167
+ deps.runtime.error(`msteams reaction handler failed: ${String(err)}`);
3168
+ }
3169
+ await next();
3170
+ });
3171
+ return handler;
3172
+ }
3173
+ //#endregion
3174
+ //#region extensions/msteams/src/feedback-invoke.ts
3549
3175
  /**
3550
- * Parse and handle feedback invoke activities (thumbs up/down).
3551
- * Returns true if the activity was a feedback invoke, false otherwise.
3176
+ * Run the message-submit (feedback) invoke handler.
3177
+ *
3178
+ * Teams delivers feedback (`actionName === "feedback"`) on AI-generated
3179
+ * messages as a `message/submitAction` invoke. The SDK wraps a void return
3180
+ * into the HTTP 200 InvokeResponse, so this function intentionally does
3181
+ * not ack itself — the legacy `ctx.sendActivity({ type: "invokeResponse",
3182
+ * … })` shape is gone (it became an outbound BF activity on the new SDK
3183
+ * instead of the HTTP response).
3184
+ *
3185
+ * Returns `true` if the invoke matched the feedback shape and was
3186
+ * consumed (whether or not it was authorized / written / reflected on),
3187
+ * `false` if the invoke didn't look like feedback at all and the caller
3188
+ * should fall through to other handlers.
3552
3189
  */
3553
- async function handleFeedbackInvoke(context, deps) {
3190
+ async function runMSTeamsFeedbackInvokeHandler(context, deps) {
3554
3191
  const activity = context.activity;
3555
3192
  const value = activity.value;
3556
3193
  if (!value) return false;
@@ -3616,7 +3253,6 @@ async function handleFeedbackInvoke(context, deps) {
3616
3253
  rejectSymlinkParents: true
3617
3254
  }).catch(() => {});
3618
3255
  } catch {}
3619
- const serviceUrl = tryNormalizeBotFrameworkServiceUrl(activity.serviceUrl);
3620
3256
  const conversationRef = {
3621
3257
  activityId: activity.id,
3622
3258
  user: {
@@ -3638,12 +3274,12 @@ async function handleFeedbackInvoke(context, deps) {
3638
3274
  tenantId: activity.conversation?.tenantId
3639
3275
  },
3640
3276
  channelId: activity.channelId ?? "msteams",
3641
- ...serviceUrl ? { serviceUrl } : {},
3277
+ serviceUrl: activity.serviceUrl,
3642
3278
  locale: activity.locale
3643
3279
  };
3644
3280
  if (isNegative && msteamsCfg?.feedbackReflection !== false) runFeedbackReflection({
3645
3281
  cfg: deps.cfg,
3646
- adapter: deps.adapter,
3282
+ app: deps.app,
3647
3283
  appId: deps.appId,
3648
3284
  conversationRef,
3649
3285
  sessionKey: route.sessionKey,
@@ -3657,161 +3293,114 @@ async function handleFeedbackInvoke(context, deps) {
3657
3293
  });
3658
3294
  return true;
3659
3295
  }
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");
3296
+ //#endregion
3297
+ //#region extensions/msteams/src/file-consent-invoke.ts
3298
+ /**
3299
+ * Handle fileConsent/invoke activities for large file uploads.
3300
+ */
3301
+ async function handleMSTeamsFileConsentInvoke(context, log) {
3302
+ const expiredUploadMessage = "The file upload request has expired. Please try sending the file again.";
3303
+ const activity = context.activity;
3304
+ if (activity.type !== "invoke" || activity.name !== "fileConsent/invoke") return false;
3305
+ const consentResponse = parseFileConsentInvoke(activity);
3306
+ if (!consentResponse) {
3307
+ log.debug?.("invalid file consent invoke", { value: activity.value });
3308
+ return false;
3309
+ }
3310
+ const uploadId = typeof consentResponse.context?.uploadId === "string" ? consentResponse.context.uploadId : void 0;
3311
+ const inMemoryFile = getPendingUpload(uploadId);
3312
+ const fsFile = inMemoryFile ? void 0 : await getPendingUploadFs(uploadId);
3313
+ const pendingFile = inMemoryFile ?? fsFile;
3314
+ if (pendingFile) {
3315
+ const pendingConversationId = normalizeMSTeamsConversationId(pendingFile.conversationId);
3316
+ const invokeConversationId = normalizeMSTeamsConversationId(activity.conversation?.id ?? "");
3317
+ if (!invokeConversationId || pendingConversationId !== invokeConversationId) {
3318
+ log.info("file consent conversation mismatch", {
3319
+ uploadId,
3320
+ expectedConversationId: pendingConversationId,
3321
+ receivedConversationId: invokeConversationId || void 0
3322
+ });
3323
+ if (consentResponse.action === "accept") await context.sendActivity(expiredUploadMessage);
3324
+ return true;
3687
3325
  }
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
- }
3326
+ }
3327
+ if (consentResponse.action === "accept" && consentResponse.uploadInfo) if (pendingFile) {
3328
+ log.debug?.("user accepted file consent, uploading", {
3329
+ uploadId,
3330
+ filename: pendingFile.filename,
3331
+ size: pendingFile.buffer.length
3332
+ });
3333
+ try {
3334
+ await uploadToConsentUrl({
3335
+ url: consentResponse.uploadInfo.uploadUrl,
3336
+ buffer: pendingFile.buffer,
3337
+ contentType: pendingFile.contentType
3695
3338
  });
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)
3339
+ const fileInfoCard = buildFileInfoCard({
3340
+ filename: consentResponse.uploadInfo.name,
3341
+ contentUrl: consentResponse.uploadInfo.contentUrl,
3342
+ uniqueId: consentResponse.uploadInfo.uniqueId,
3343
+ fileType: consentResponse.uploadInfo.fileType
3344
+ });
3345
+ if (!pendingFile.consentCardActivityId) await context.sendActivity({
3346
+ type: "message",
3347
+ attachments: [fileInfoCard]
3348
+ });
3349
+ if (pendingFile.consentCardActivityId) try {
3350
+ await context.updateActivity({
3351
+ id: pendingFile.consentCardActivityId,
3352
+ type: "message",
3353
+ attachments: [fileInfoCard]
3741
3354
  });
3742
- else deps.log.error("msteams sso verifyState failed", {
3743
- code: result.code,
3744
- status: result.status,
3745
- message: result.message
3355
+ } catch {
3356
+ await context.sendActivity({
3357
+ type: "message",
3358
+ attachments: [fileInfoCard]
3746
3359
  });
3747
- } catch (err) {
3748
- deps.log.error("msteams sso invoke handler error", { error: formatUnknownError(err) });
3749
3360
  }
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");
3361
+ log.info("file upload complete", {
3362
+ uploadId,
3363
+ filename: consentResponse.uploadInfo.name,
3364
+ uniqueId: consentResponse.uploadInfo.uniqueId
3365
+ });
3809
3366
  } catch (err) {
3810
- deps.runtime.error(`msteams reaction handler failed: ${String(err)}`);
3367
+ log.error("file upload failed", {
3368
+ uploadId,
3369
+ error: formatUnknownError(err)
3370
+ });
3371
+ await context.sendActivity("File upload failed. Please try again.");
3372
+ } finally {
3373
+ removePendingUpload(uploadId);
3374
+ await removePendingUploadFs(uploadId);
3811
3375
  }
3812
- await next();
3813
- });
3814
- return handler;
3376
+ } else {
3377
+ log.debug?.("pending file not found for consent", { uploadId });
3378
+ await context.sendActivity(expiredUploadMessage);
3379
+ }
3380
+ else {
3381
+ log.debug?.("user declined file consent", { uploadId });
3382
+ removePendingUpload(uploadId);
3383
+ await removePendingUploadFs(uploadId);
3384
+ }
3385
+ return true;
3386
+ }
3387
+ /**
3388
+ * Run the file-consent invoke handler after the SDK route has acknowledged the
3389
+ * invoke. This intentionally does not send its own invokeResponse; it only does
3390
+ * the delayed upload/update work.
3391
+ */
3392
+ async function runMSTeamsFileConsentInvokeHandler(context, log) {
3393
+ try {
3394
+ await withRevokedProxyFallback({
3395
+ run: async () => await handleMSTeamsFileConsentInvoke(context, log),
3396
+ onRevoked: async () => true,
3397
+ onRevokedLog: () => {
3398
+ log.debug?.("turn context revoked during file consent invoke; skipping delayed response");
3399
+ }
3400
+ });
3401
+ } catch (err) {
3402
+ log.debug?.("file consent handler error", { error: formatUnknownError(err) });
3403
+ }
3815
3404
  }
3816
3405
  //#endregion
3817
3406
  //#region extensions/msteams/src/sso-token-store.ts
@@ -3920,7 +3509,6 @@ function applyMSTeamsWebhookTimeouts(httpServer, opts) {
3920
3509
  }
3921
3510
  //#endregion
3922
3511
  //#region extensions/msteams/src/monitor.ts
3923
- const MSTEAMS_WEBHOOK_MAX_BODY_BYTES = DEFAULT_WEBHOOK_MAX_BODY_BYTES;
3924
3512
  async function monitorMSTeamsProvider(opts) {
3925
3513
  const core = getMSTeamsRuntime();
3926
3514
  const log = core.logging.getChildLogger({ name: "msteams" });
@@ -4071,7 +3659,7 @@ async function monitorMSTeamsProvider(opts) {
4071
3659
  }
4072
3660
  }
4073
3661
  } catch (err) {
4074
- runtime?.error(`msteams resolve failed; falling back to raw config entries — allowlist members resolved via Graph may be missing. ${formatUnknownError(err)}`);
3662
+ runtime.error?.(`msteams resolve failed; falling back to raw config entries — allowlist members resolved via Graph may be missing. ${formatUnknownError(err)}`);
4075
3663
  }
4076
3664
  msteamsCfg = {
4077
3665
  ...msteamsCfg,
@@ -4095,9 +3683,42 @@ async function monitorMSTeamsProvider(opts) {
4095
3683
  const pollStore = opts.pollStore ?? createMSTeamsPollStoreFs();
4096
3684
  log.info(`starting provider (port ${port})`);
4097
3685
  const express = await import("express");
4098
- const { sdk, app } = await loadMSTeamsSdkWithAuth(creds);
3686
+ const expressApp = express.default();
3687
+ expressApp.use((req, res, next) => {
3688
+ const auth = req.headers.authorization;
3689
+ if (!auth || !auth.startsWith("Bearer ")) {
3690
+ res.status(401).json({ error: "Unauthorized" });
3691
+ return;
3692
+ }
3693
+ next();
3694
+ });
3695
+ expressApp.use(express.json({ limit: DEFAULT_WEBHOOK_MAX_BODY_BYTES }));
3696
+ expressApp.use((err, _req, res, next) => {
3697
+ if (err && typeof err === "object" && "status" in err && err.status === 413) {
3698
+ res.status(413).json({ error: "Payload too large" });
3699
+ return;
3700
+ }
3701
+ next(err);
3702
+ });
3703
+ const configuredPath = msteamsCfg.webhook?.path ?? "/api/messages";
3704
+ const { app } = await loadMSTeamsSdkWithAuth(creds, {
3705
+ ...resolveMSTeamsSdkCloudOptions(msteamsCfg),
3706
+ httpServerAdapter: await createMSTeamsExpressAdapter(expressApp),
3707
+ messagingEndpoint: configuredPath,
3708
+ ...msteamsCfg.sso?.enabled && msteamsCfg.sso.connectionName ? { oauthDefaultConnectionName: msteamsCfg.sso.connectionName } : {}
3709
+ });
3710
+ if (configuredPath !== "/api/messages") {
3711
+ let warnedLegacyMessagesRoute = false;
3712
+ expressApp.post("/api/messages", (req, res, next) => {
3713
+ if (!warnedLegacyMessagesRoute) {
3714
+ warnedLegacyMessagesRoute = true;
3715
+ 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`);
3716
+ }
3717
+ req.url = configuredPath;
3718
+ expressApp(req, res, next);
3719
+ });
3720
+ }
4099
3721
  const tokenProvider = createMSTeamsTokenProvider(app);
4100
- const adapter = createMSTeamsAdapter(app, sdk);
4101
3722
  let ssoDeps;
4102
3723
  if (msteamsCfg.sso?.enabled && msteamsCfg.sso.connectionName) {
4103
3724
  ssoDeps = {
@@ -4108,11 +3729,11 @@ async function monitorMSTeamsProvider(opts) {
4108
3729
  log.debug?.("msteams sso enabled", { connectionName: msteamsCfg.sso.connectionName });
4109
3730
  }
4110
3731
  const handler = buildActivityHandler();
4111
- registerMSTeamsHandlers(handler, {
3732
+ const handlerDeps = {
4112
3733
  cfg,
4113
3734
  runtime,
4114
3735
  appId,
4115
- adapter,
3736
+ app,
4116
3737
  tokenProvider,
4117
3738
  textLimit,
4118
3739
  mediaMaxBytes,
@@ -4120,52 +3741,182 @@ async function monitorMSTeamsProvider(opts) {
4120
3741
  pollStore,
4121
3742
  log,
4122
3743
  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;
3744
+ };
3745
+ registerMSTeamsHandlers(handler, handlerDeps);
3746
+ app.on("card.action", async (ctx) => {
3747
+ const adaptedCtx = adaptSdkContext(ctx, app);
3748
+ try {
3749
+ const activity = adaptedCtx.activity;
3750
+ const vote = extractMSTeamsPollVote(activity);
3751
+ if (vote) {
3752
+ const voterId = activity?.from?.aadObjectId ?? activity?.from?.id ?? "unknown";
3753
+ try {
3754
+ if (!await isCardActionInvokeAuthorized(adaptedCtx, handlerDeps)) return {
3755
+ statusCode: 200,
3756
+ type: "application/vnd.microsoft.activity.message",
3757
+ value: "Not authorized."
3758
+ };
3759
+ const existingPoll = await pollStore.getPoll(vote.pollId);
3760
+ if (!existingPoll) {
3761
+ log.debug?.("poll vote ignored (poll not found)", { pollId: vote.pollId });
3762
+ return {
3763
+ statusCode: 200,
3764
+ type: "application/vnd.microsoft.activity.message",
3765
+ value: "Poll not found."
3766
+ };
3767
+ }
3768
+ const pollConversationId = existingPoll.conversationId ? normalizeMSTeamsConversationId(existingPoll.conversationId) : void 0;
3769
+ const activityConversationId = normalizeMSTeamsConversationId(activity?.conversation?.id ?? "");
3770
+ if (pollConversationId && pollConversationId !== activityConversationId) {
3771
+ log.info("poll vote ignored (conversation mismatch)", {
3772
+ pollId: vote.pollId,
3773
+ expectedConversationId: pollConversationId,
3774
+ receivedConversationId: activityConversationId || void 0
3775
+ });
3776
+ return {
3777
+ statusCode: 200,
3778
+ type: "application/vnd.microsoft.activity.message",
3779
+ value: "Poll not found."
3780
+ };
3781
+ }
3782
+ if (await pollStore.recordVote({
3783
+ pollId: vote.pollId,
3784
+ voterId,
3785
+ selections: vote.selections
3786
+ })) {
3787
+ log.info("recorded poll vote", {
3788
+ pollId: vote.pollId,
3789
+ voterId
3790
+ });
3791
+ return {
3792
+ statusCode: 200,
3793
+ type: "application/vnd.microsoft.activity.message",
3794
+ value: "Vote recorded."
3795
+ };
3796
+ }
3797
+ log.debug?.("poll vote ignored (poll not found)", { pollId: vote.pollId });
3798
+ return {
3799
+ statusCode: 200,
3800
+ type: "application/vnd.microsoft.activity.message",
3801
+ value: "Poll not found."
3802
+ };
3803
+ } catch (err) {
3804
+ log.error("failed to record poll vote", {
3805
+ pollId: vote.pollId,
3806
+ error: formatUnknownError(err)
3807
+ });
3808
+ return {
3809
+ statusCode: 500,
3810
+ type: "application/vnd.microsoft.error",
3811
+ value: {
3812
+ code: "RECORD_VOTE_FAILED",
3813
+ message: "Could not record vote.",
3814
+ innerHttpError: {
3815
+ statusCode: 500,
3816
+ body: null
3817
+ }
3818
+ }
3819
+ };
3820
+ }
3821
+ }
3822
+ handler.run(adaptedCtx).catch((err) => {
3823
+ log.error("msteams card.action dispatch failed", { error: formatUnknownError(err) });
3824
+ });
3825
+ return {
3826
+ statusCode: 200,
3827
+ type: "application/vnd.microsoft.activity.message",
3828
+ value: "OK"
3829
+ };
3830
+ } catch (err) {
3831
+ log.error("msteams card.action failed", { error: formatUnknownError(err) });
3832
+ return {
3833
+ statusCode: 500,
3834
+ type: "application/vnd.microsoft.error",
3835
+ value: {
3836
+ code: "CARD_ACTION_FAILED",
3837
+ message: "Card action failed.",
3838
+ innerHttpError: {
3839
+ statusCode: 500,
3840
+ body: null
3841
+ }
3842
+ }
3843
+ };
4130
3844
  }
4131
- next();
4132
3845
  });
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" });
3846
+ app.on("file.consent.accept", (ctx) => {
3847
+ runMSTeamsFileConsentInvokeHandler(adaptSdkContext(ctx, app), log);
3848
+ });
3849
+ app.on("file.consent.decline", (ctx) => {
3850
+ runMSTeamsFileConsentInvokeHandler(adaptSdkContext(ctx, app), log);
3851
+ });
3852
+ const handleSdkSigninInvoke = async (ctx, delegateName) => {
3853
+ const adaptedCtx = adaptSdkContext(ctx, app);
3854
+ if (!await isSigninInvokeAuthorized(adaptedCtx, handlerDeps)) return {
3855
+ status: 200,
3856
+ body: {}
3857
+ };
3858
+ if (!ssoDeps) {
3859
+ log.debug?.("signin invoke received but msteams.sso is not configured", { name: adaptedCtx.activity?.name });
3860
+ return {
3861
+ status: 200,
3862
+ body: {}
3863
+ };
3864
+ }
3865
+ const sdkSigninApp = app;
3866
+ const delegate = sdkSigninApp[delegateName];
3867
+ if (typeof delegate !== "function") throw new Error(`Teams SDK ${delegateName} handler is unavailable`);
3868
+ return delegate.call(sdkSigninApp, ctx);
3869
+ };
3870
+ app.on("signin.token-exchange", (ctx) => handleSdkSigninInvoke(ctx, "onTokenExchange"));
3871
+ app.on("signin.verify-state", (ctx) => handleSdkSigninInvoke(ctx, "onVerifyState"));
3872
+ if (ssoDeps) app.event("signin", (ctx) => {
3873
+ (async () => {
3874
+ if (!await isSigninInvokeAuthorized(adaptSdkContext(ctx, app), handlerDeps)) return;
3875
+ const activity = ctx.activity;
3876
+ const userIds = Array.from(new Set([activity.from?.id, activity.from?.aadObjectId].filter((id) => Boolean(id))));
3877
+ const connectionName = ctx.token.connectionName || ssoDeps.connectionName;
3878
+ if (!connectionName || !ctx.token.token || userIds.length === 0) {
3879
+ log.warn?.("msteams sso signin event missing token metadata", {
3880
+ hasConnectionName: Boolean(connectionName),
3881
+ hasToken: Boolean(ctx.token.token),
3882
+ hasUser: userIds.length > 0
3883
+ });
4140
3884
  return;
4141
3885
  }
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" });
3886
+ await Promise.all(userIds.map((userId) => ssoDeps.tokenStore.save({
3887
+ connectionName,
3888
+ userId,
3889
+ token: ctx.token.token,
3890
+ expiresAt: ctx.token.expiration,
3891
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
3892
+ })));
3893
+ log.info("msteams sso token persisted", {
3894
+ connectionName,
3895
+ userIdCount: userIds.length,
3896
+ hasExpiry: Boolean(ctx.token.expiration)
3897
+ });
3898
+ })().catch((err) => {
3899
+ log.error("msteams sso token persistence failed", { error: formatUnknownError(err) });
4147
3900
  });
4148
3901
  });
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);
3902
+ app.on("message.submit", async (ctx) => {
3903
+ if (!await runMSTeamsFeedbackInvokeHandler(adaptSdkContext(ctx, app), handlerDeps)) await ctx.next?.call(ctx);
4156
3904
  });
4157
- const configuredPath = msteamsCfg.webhook?.path ?? "/api/messages";
4158
- const messageHandler = (req, res) => {
4159
- adapter.process(req, res, (context) => handler.run(context)).catch((err) => {
3905
+ app.on("activity", async (ctx) => {
3906
+ try {
3907
+ const adaptedCtx = adaptSdkContext(ctx, app);
3908
+ const activity = adaptedCtx.activity;
3909
+ if (activity?.type === "invoke") {
3910
+ if (activity?.name === "adaptiveCard/action") return;
3911
+ if (activity?.name === "fileConsent/invoke") return;
3912
+ if (activity?.name === "signin/tokenExchange" || activity?.name === "signin/verifyState") return;
3913
+ }
3914
+ await handler.run(adaptedCtx);
3915
+ } catch (err) {
4160
3916
  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"
3917
+ }
4168
3918
  });
3919
+ await app.initialize();
4169
3920
  const httpServer = expressApp.listen(port);
4170
3921
  await new Promise((resolve, reject) => {
4171
3922
  const onListening = () => {
@@ -4245,5 +3996,34 @@ function buildActivityHandler() {
4245
3996
  };
4246
3997
  return handler;
4247
3998
  }
3999
+ /**
4000
+ * Adapt a new @microsoft/teams.apps SDK context to the MSTeamsTurnContext interface
4001
+ * our handlers expect. The new SDK uses reply()/send() instead of sendActivity().
4002
+ */
4003
+ function adaptSdkContext(ctx, app) {
4004
+ const sdkCtx = ctx ?? {};
4005
+ if (typeof sdkCtx.reply !== "function" && typeof sdkCtx.send !== "function") return ctx;
4006
+ const conversationId = sdkCtx.activity?.conversation?.id ?? "";
4007
+ const activityApi = sdkCtx.api ?? app.api;
4008
+ const conversationType = (sdkCtx.activity?.conversation?.conversationType ?? "").toLowerCase();
4009
+ const isThreadable = conversationType === "channel" || conversationType === "groupchat";
4010
+ const sendActivity = (activity) => isThreadable ? sdkCtx.reply(activity) : sdkCtx.send(activity);
4011
+ return Object.assign(Object.create(Object.getPrototypeOf(ctx)), ctx, {
4012
+ sendActivity,
4013
+ sendActivities: async (activities) => {
4014
+ const results = [];
4015
+ for (const a of activities) results.push(await sendActivity(a));
4016
+ return results;
4017
+ },
4018
+ updateActivity: async (activity) => {
4019
+ const activityId = activity.id ?? "";
4020
+ return activityApi.conversations.activities(conversationId).update(activityId, activity);
4021
+ },
4022
+ deleteActivity: async (activityId) => {
4023
+ return activityApi.conversations.activities(conversationId).delete(activityId);
4024
+ },
4025
+ stream: sdkCtx.stream
4026
+ });
4027
+ }
4248
4028
  //#endregion
4249
4029
  export { monitorMSTeamsProvider };