@spacebar_ai/moldclaw-core 2026.3.41 → 2026.3.44

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 (1144) hide show
  1. package/dist/accounts-5qY-dKca.d.ts +103 -0
  2. package/dist/accounts-SqdHz2ZP.js +114 -0
  3. package/dist/acp-cli-E6bcNqiE.js +2093 -0
  4. package/dist/actions.runtime-BU_XMuLk.js +119 -0
  5. package/dist/actions.runtime-CY5h8lqH.js +133 -0
  6. package/dist/agent-scope-lZlwP1At.js +208 -0
  7. package/dist/agents-C4SkadR1.js +853 -0
  8. package/dist/agents-RfwqGCzE.js +222 -0
  9. package/dist/agents.config-CX9CPNfP.js +17 -0
  10. package/dist/agents.config-DF9Zwn9n.js +121 -0
  11. package/dist/allow-list-3WSjz1zl.js +81 -0
  12. package/dist/allowlist-DNbDjFjw.js +142 -0
  13. package/dist/api-BEOpJ7dR.js +117 -0
  14. package/dist/audit-CpJz_eu6.js +787 -0
  15. package/dist/audit-CpfSjvyo.js +54 -0
  16. package/dist/audit-channel.collect.runtime-BeGotloZ.js +605 -0
  17. package/dist/audit-channel.runtime-BJDZ7ETt.js +121 -0
  18. package/dist/audit-extra.async-C2G0mqmk.js +813 -0
  19. package/dist/audit-membership-runtime-B1FqJsPV.js +162 -0
  20. package/dist/audit.deep.runtime-DyL9O_sU.js +25 -0
  21. package/dist/audit.nondeep.runtime-C6jFgJfH.js +832 -0
  22. package/dist/audit.runtime-Dnlsn23e.js +118 -0
  23. package/dist/auth-Ch3Rchm4.js +101 -0
  24. package/dist/auth-choice-CEFSlnLT.js +122 -0
  25. package/dist/auth-choice-CVCef-eU.js +268 -0
  26. package/dist/auth-choice-Cez-pXrg.js +507 -0
  27. package/dist/auth-choice-options-DO78mvPe.js +123 -0
  28. package/dist/auth-choice-prompt-CUkC7Mmb.js +36 -0
  29. package/dist/auth-choice-prompt-DCuQRiVl.js +115 -0
  30. package/dist/auth-choice.apply-helpers-BhbNIV8X.js +66 -0
  31. package/dist/auth-choice.plugin-providers.runtime-4BhqvEw_.js +119 -0
  32. package/dist/auth-profiles-smABVXzp.js +128040 -0
  33. package/dist/auth-profiles.runtime-Cr-ojtTc.js +116 -0
  34. package/dist/banner-CojBHPWr.js +342 -0
  35. package/dist/bluebubbles-BnLsj2Fy.d.ts +6 -0
  36. package/dist/bluebubbles-CVk7M3Bl.js +64 -0
  37. package/dist/bot-DdyrB2z9.d.ts +478 -0
  38. package/dist/brave-w4Fo8WZ3.js +24 -0
  39. package/dist/browser-cli-DWFs3P_i.js +1494 -0
  40. package/dist/build-info.json +3 -3
  41. package/dist/bundled/boot-md/handler.d.ts +1 -1
  42. package/dist/bundled/boot-md/handler.js +35 -35
  43. package/dist/bundled/bootstrap-extra-files/handler.d.ts +1 -1
  44. package/dist/bundled/bootstrap-extra-files/handler.js +1 -1
  45. package/dist/bundled/command-logger/handler.d.ts +1 -1
  46. package/dist/bundled/session-memory/handler.d.ts +1 -1
  47. package/dist/bundled/session-memory/handler.js +36 -36
  48. package/dist/call-Do7wTSr7.js +39 -0
  49. package/dist/call-gdDAt07d.js +640 -0
  50. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  51. package/dist/channel-B26pkce0.js +214 -0
  52. package/dist/channel-BJHp0AQC.js +352 -0
  53. package/dist/channel-BKFOv51P.js +4681 -0
  54. package/dist/channel-BNgpOY8v.js +538 -0
  55. package/dist/channel-BcQAAo2P.js +226 -0
  56. package/dist/channel-BvNdnhbx.js +1598 -0
  57. package/dist/channel-C1Rda3Jd.js +306 -0
  58. package/dist/channel-C87DG-F7.js +803 -0
  59. package/dist/channel-CIip0kvZ.js +619 -0
  60. package/dist/channel-CTPxoT_E2.js +316 -0
  61. package/dist/channel-CklaCzUG.js +562 -0
  62. package/dist/channel-CoJnAdLs.js +920 -0
  63. package/dist/channel-D3tafL1_.js +949 -0
  64. package/dist/channel-DFMrP2uu.js +542 -0
  65. package/dist/channel-DMd5cJQe.js +397 -0
  66. package/dist/channel-Dm34kxAJ.js +207 -0
  67. package/dist/channel-DmwF9udn.js +1321 -0
  68. package/dist/channel-account-context-Bjur9nlh.js +103 -0
  69. package/dist/channel-bGnST659.js +943 -0
  70. package/dist/channel-hIgbkTZf.js +575 -0
  71. package/dist/channel-m_TGrDKo.js +497 -0
  72. package/dist/channel-options-DoUPBMa8.js +50 -0
  73. package/dist/channel-plugin-ids-TZIY4hFs.js +26 -0
  74. package/dist/channel-summary-qD54bOBO.js +111 -0
  75. package/dist/channel.runtime-B0H04Dkk.js +199 -0
  76. package/dist/channel.runtime-BU1f3NkV.js +418 -0
  77. package/dist/channel.runtime-Bj1sfLep.js +4011 -0
  78. package/dist/channel.runtime-BtPAAJc3.js +870 -0
  79. package/dist/channel.runtime-Bx-10m_j.js +171 -0
  80. package/dist/channel.runtime-CI_TBywQ.js +179 -0
  81. package/dist/channel.runtime-CSLj14-Z.js +182 -0
  82. package/dist/channel.runtime-D-lTSYAd.js +404 -0
  83. package/dist/channel.runtime-DJqIOSji.js +127 -0
  84. package/dist/channel.runtime-Ec8aQ9V2.js +241 -0
  85. package/dist/channel.runtime-ax5a1jBm.js +218 -0
  86. package/dist/channel.setup-B-ncdYLT.js +9 -0
  87. package/dist/channel.setup-BY4bh5dm.js +9 -0
  88. package/dist/channel.setup-BovsdMnL.js +57 -0
  89. package/dist/channel.setup-CXzXA25h.js +6 -0
  90. package/dist/channel.setup-DcZUEufN.js +8 -0
  91. package/dist/channel.setup-E6zceRsE.js +8 -0
  92. package/dist/channel.setup-Pc7nGbdX.js +11 -0
  93. package/dist/channels/plugins/actions/discord.d.ts +2 -2
  94. package/dist/channels/plugins/actions/discord.js +35 -35
  95. package/dist/channels/plugins/actions/signal.d.ts +1 -1
  96. package/dist/channels/plugins/actions/signal.js +35 -35
  97. package/dist/channels/plugins/actions/telegram.d.ts +2 -2
  98. package/dist/channels/plugins/actions/telegram.js +35 -35
  99. package/dist/channels/plugins/agent-tools/whatsapp-login.d.ts +3 -3
  100. package/dist/channels/plugins/agent-tools/whatsapp-login.js +35 -35
  101. package/dist/channels-CPtE5ND6.js +404 -0
  102. package/dist/channels-Cj8ZolHI.js +1118 -0
  103. package/dist/channels-cli-D2sKrntt.js +291 -0
  104. package/dist/channels-status-issues-CzIHODg2.js +16 -0
  105. package/dist/clawbot-cli-BcwEDmUn.js +118 -0
  106. package/dist/cleanup-utils-D0L17RsX.js +96 -0
  107. package/dist/cli/daemon-cli.js +1 -1
  108. package/dist/cli-BvGVPKnD.js +154 -0
  109. package/dist/command-registry-CADQzTAg.js +14 -0
  110. package/dist/command-registry-ktiJNAJd.js +242 -0
  111. package/dist/command-secret-gateway-CXp10RTM.js +111 -0
  112. package/dist/compact.runtime-DyKL-Iar.js +116 -0
  113. package/dist/completion-cli-Bz4STrpt.js +17 -0
  114. package/dist/completion-cli-pVda2OFb.js +445 -0
  115. package/dist/config-BbvDRSYp.js +31 -0
  116. package/dist/config-CwBv71QC.js +44 -0
  117. package/dist/config-cli-Y0uXHbOw.js +678 -0
  118. package/dist/config-guard-BpW5g7JE.js +118 -0
  119. package/dist/config-validation-B-vLIsbo.js +262 -0
  120. package/dist/config-value-DT3-5958.js +132 -0
  121. package/dist/configure-B9U-jCqP.js +1100 -0
  122. package/dist/configure-BJ3Wrs5b.js +243 -0
  123. package/dist/control-ui-assets-C1YDYi82.js +232 -0
  124. package/dist/control-ui-shared-Dm5Dh0Lo.js +29 -0
  125. package/dist/core-BwKq3krw.js +150 -0
  126. package/dist/core-hjBwfDsW.d.ts +87 -0
  127. package/dist/cron-cli-DTDgfoMh.js +639 -0
  128. package/dist/daemon-cli-C-dkAXR1.js +339 -0
  129. package/dist/daemon-install-Oy0Q5pMF.js +180 -0
  130. package/dist/deliver-DNGnDqF9.js +111 -0
  131. package/dist/deliver-runtime-CCNZIhET.js +111 -0
  132. package/dist/device-id-cli-XvwZbIyC.js +52 -0
  133. package/dist/device-identity-IG5DngWM.js +365 -0
  134. package/dist/devices-cli-DIsxj4xp.js +342 -0
  135. package/dist/diagnostic-DTPopFvh.js +310 -0
  136. package/dist/directory-cli-DTSY3Ktr.js +311 -0
  137. package/dist/directory-config-helpers-DpFcAbmo.d.ts +38 -0
  138. package/dist/directory.static-CBRAUwUW.js +44 -0
  139. package/dist/discord-CrgxhEWw.js +114 -0
  140. package/dist/discovery-DrG7wmAR.js +48 -0
  141. package/dist/dm-policy-shared-DKoGdUpY.d.ts +95 -0
  142. package/dist/dns-cli-BJiz6CLK.js +217 -0
  143. package/dist/docs-cli-Dq2Yi5qO.js +174 -0
  144. package/dist/doctor-completion-D3GeVcFP.js +90 -0
  145. package/dist/doctor-config-flow-B1cMjr8h.js +112 -0
  146. package/dist/doctor-config-flow-BUe7JpV3.js +2437 -0
  147. package/dist/enable-Bc8bCuVe.js +24 -0
  148. package/dist/entry.js +4 -4
  149. package/dist/exec-approvals-cli-kLAev6bP.js +421 -0
  150. package/dist/extensions/acpx/index.d.ts +1 -1
  151. package/dist/extensions/amazon-bedrock/index.d.ts +1 -1
  152. package/dist/extensions/amazon-bedrock/index.js +4 -4
  153. package/dist/extensions/anthropic/index.d.ts +1 -1
  154. package/dist/extensions/anthropic/index.js +35 -35
  155. package/dist/extensions/bluebubbles/index.d.ts +1 -1
  156. package/dist/extensions/bluebubbles/index.js +39 -39
  157. package/dist/extensions/bluebubbles/setup-entry.d.ts +2 -2
  158. package/dist/extensions/bluebubbles/setup-entry.js +39 -39
  159. package/dist/extensions/brave/index.d.ts +1 -1
  160. package/dist/extensions/brave/index.js +5 -5
  161. package/dist/extensions/byteplus/index.d.ts +1 -1
  162. package/dist/extensions/byteplus/index.js +35 -35
  163. package/dist/extensions/cloudflare-ai-gateway/index.d.ts +1 -1
  164. package/dist/extensions/cloudflare-ai-gateway/index.js +36 -36
  165. package/dist/extensions/copilot-proxy/index.d.ts +1 -1
  166. package/dist/extensions/copilot-proxy/index.js +4 -4
  167. package/dist/extensions/device-pair/index.d.ts +1 -1
  168. package/dist/extensions/device-pair/index.js +4 -4
  169. package/dist/extensions/diagnostics-otel/index.d.ts +1 -1
  170. package/dist/extensions/diagnostics-otel/index.js +4 -4
  171. package/dist/extensions/diffs/index.d.ts +1 -1
  172. package/dist/extensions/discord/index.d.ts +1 -1
  173. package/dist/extensions/discord/index.js +40 -40
  174. package/dist/extensions/discord/setup-entry.d.ts +1 -1
  175. package/dist/extensions/discord/setup-entry.js +38 -38
  176. package/dist/extensions/elevenlabs/index.d.ts +1 -1
  177. package/dist/extensions/elevenlabs/index.js +35 -35
  178. package/dist/extensions/feishu/index.d.ts +2 -2
  179. package/dist/extensions/feishu/index.js +40 -40
  180. package/dist/extensions/feishu/setup-entry.d.ts +2 -2
  181. package/dist/extensions/feishu/setup-entry.js +37 -37
  182. package/dist/extensions/firecrawl/index.d.ts +1 -1
  183. package/dist/extensions/firecrawl/index.js +35 -35
  184. package/dist/extensions/github-copilot/index.d.ts +1 -1
  185. package/dist/extensions/github-copilot/index.js +35 -35
  186. package/dist/extensions/google/index.d.ts +1 -1
  187. package/dist/extensions/google/index.js +35 -35
  188. package/dist/extensions/googlechat/index.d.ts +1 -1
  189. package/dist/extensions/googlechat/index.js +38 -38
  190. package/dist/extensions/googlechat/setup-entry.d.ts +1 -1
  191. package/dist/extensions/googlechat/setup-entry.js +38 -38
  192. package/dist/extensions/huggingface/index.d.ts +1 -1
  193. package/dist/extensions/huggingface/index.js +35 -35
  194. package/dist/extensions/imessage/index.d.ts +1 -1
  195. package/dist/extensions/imessage/index.js +39 -39
  196. package/dist/extensions/imessage/setup-entry.d.ts +1 -1
  197. package/dist/extensions/imessage/setup-entry.js +39 -39
  198. package/dist/extensions/irc/index.d.ts +1 -1
  199. package/dist/extensions/irc/index.js +38 -38
  200. package/dist/extensions/irc/setup-entry.d.ts +2 -2
  201. package/dist/extensions/irc/setup-entry.js +38 -38
  202. package/dist/extensions/kakao-talkchannel/index.d.ts +1 -1
  203. package/dist/extensions/kakao-talkchannel/index.js +4 -4
  204. package/dist/extensions/kilocode/index.d.ts +1 -1
  205. package/dist/extensions/kilocode/index.js +35 -35
  206. package/dist/extensions/kimi-coding/index.d.ts +1 -1
  207. package/dist/extensions/kimi-coding/index.js +35 -35
  208. package/dist/extensions/line/index.d.ts +1 -1
  209. package/dist/extensions/line/index.js +37 -37
  210. package/dist/extensions/line/setup-entry.d.ts +1 -1
  211. package/dist/extensions/line/setup-entry.js +37 -37
  212. package/dist/extensions/llm-task/index.d.ts +1 -1
  213. package/dist/extensions/llm-task/index.js +35 -35
  214. package/dist/extensions/lobster/index.d.ts +1 -1
  215. package/dist/extensions/lobster/index.js +4 -4
  216. package/dist/extensions/matrix/index.d.ts +1 -1
  217. package/dist/extensions/matrix/index.js +40 -40
  218. package/dist/extensions/matrix/setup-entry.d.ts +2 -2
  219. package/dist/extensions/matrix/setup-entry.js +40 -40
  220. package/dist/extensions/mattermost/index.d.ts +1 -1
  221. package/dist/extensions/mattermost/index.js +37 -37
  222. package/dist/extensions/mattermost/setup-entry.d.ts +2 -2
  223. package/dist/extensions/mattermost/setup-entry.js +37 -37
  224. package/dist/extensions/memory-core/index.d.ts +1 -1
  225. package/dist/extensions/memory-core/index.js +4 -4
  226. package/dist/extensions/memory-lancedb/index.d.ts +1 -1
  227. package/dist/extensions/memory-lancedb/index.js +4 -4
  228. package/dist/extensions/microsoft/index.d.ts +1 -1
  229. package/dist/extensions/microsoft/index.js +35 -35
  230. package/dist/extensions/minimax/index.d.ts +1 -1
  231. package/dist/extensions/minimax/index.js +35 -35
  232. package/dist/extensions/mistral/index.d.ts +1 -1
  233. package/dist/extensions/mistral/index.js +35 -35
  234. package/dist/extensions/modelstudio/index.d.ts +1 -1
  235. package/dist/extensions/modelstudio/index.js +35 -35
  236. package/dist/extensions/moonshot/index.d.ts +1 -1
  237. package/dist/extensions/moonshot/index.js +35 -35
  238. package/dist/extensions/msteams/index.d.ts +1 -1
  239. package/dist/extensions/msteams/index.js +40 -40
  240. package/dist/extensions/msteams/setup-entry.d.ts +1 -1
  241. package/dist/extensions/msteams/setup-entry.js +40 -40
  242. package/dist/extensions/nextcloud-talk/index.d.ts +1 -1
  243. package/dist/extensions/nextcloud-talk/index.js +37 -37
  244. package/dist/extensions/nextcloud-talk/setup-entry.d.ts +2 -2
  245. package/dist/extensions/nextcloud-talk/setup-entry.js +37 -37
  246. package/dist/extensions/nostr/index.d.ts +1 -1
  247. package/dist/extensions/nostr/index.js +37 -37
  248. package/dist/extensions/nostr/setup-entry.d.ts +1 -1
  249. package/dist/extensions/nostr/setup-entry.js +37 -37
  250. package/dist/extensions/nvidia/index.d.ts +1 -1
  251. package/dist/extensions/nvidia/index.js +4 -4
  252. package/dist/extensions/ollama/index.d.ts +1 -1
  253. package/dist/extensions/ollama/index.js +7 -7
  254. package/dist/extensions/open-prose/index.d.ts +1 -1
  255. package/dist/extensions/open-prose/index.js +4 -4
  256. package/dist/extensions/openai/index.d.ts +1 -1
  257. package/dist/extensions/openai/index.js +35 -35
  258. package/dist/extensions/opencode/index.d.ts +1 -1
  259. package/dist/extensions/opencode/index.js +35 -35
  260. package/dist/extensions/opencode-go/index.d.ts +1 -1
  261. package/dist/extensions/opencode-go/index.js +35 -35
  262. package/dist/extensions/openrouter/index.d.ts +1 -1
  263. package/dist/extensions/openrouter/index.js +35 -35
  264. package/dist/extensions/openshell/index.d.ts +1 -1
  265. package/dist/extensions/openshell/index.js +35 -35
  266. package/dist/extensions/perplexity/index.d.ts +1 -1
  267. package/dist/extensions/perplexity/index.js +5 -5
  268. package/dist/extensions/phone-control/index.d.ts +1 -1
  269. package/dist/extensions/phone-control/index.js +4 -4
  270. package/dist/extensions/qianfan/index.d.ts +1 -1
  271. package/dist/extensions/qianfan/index.js +35 -35
  272. package/dist/extensions/qwen-portal-auth/index.d.ts +1 -1
  273. package/dist/extensions/qwen-portal-auth/index.js +35 -35
  274. package/dist/extensions/sglang/index.d.ts +1 -1
  275. package/dist/extensions/sglang/index.js +35 -35
  276. package/dist/extensions/signal/index.d.ts +1 -1
  277. package/dist/extensions/signal/index.js +38 -38
  278. package/dist/extensions/signal/setup-entry.d.ts +1 -1
  279. package/dist/extensions/signal/setup-entry.js +38 -38
  280. package/dist/extensions/slack/index.d.ts +1 -1
  281. package/dist/extensions/slack/index.js +39 -39
  282. package/dist/extensions/slack/setup-entry.d.ts +1 -1
  283. package/dist/extensions/slack/setup-entry.js +38 -38
  284. package/dist/extensions/synology-chat/index.d.ts +1 -1
  285. package/dist/extensions/synology-chat/index.js +37 -37
  286. package/dist/extensions/synology-chat/setup-entry.d.ts +1 -1
  287. package/dist/extensions/synology-chat/setup-entry.js +37 -37
  288. package/dist/extensions/synthetic/index.d.ts +1 -1
  289. package/dist/extensions/synthetic/index.js +35 -35
  290. package/dist/extensions/talk-voice/index.d.ts +1 -1
  291. package/dist/extensions/talk-voice/index.js +35 -35
  292. package/dist/extensions/telegram/index.d.ts +1 -1
  293. package/dist/extensions/telegram/index.js +38 -38
  294. package/dist/extensions/telegram/setup-entry.d.ts +1 -1
  295. package/dist/extensions/telegram/setup-entry.js +37 -37
  296. package/dist/extensions/thread-ownership/index.d.ts +1 -1
  297. package/dist/extensions/thread-ownership/index.js +4 -4
  298. package/dist/extensions/tlon/index.d.ts +1 -1
  299. package/dist/extensions/tlon/index.js +37 -37
  300. package/dist/extensions/tlon/setup-entry.d.ts +1 -1
  301. package/dist/extensions/tlon/setup-entry.js +37 -37
  302. package/dist/extensions/together/index.d.ts +1 -1
  303. package/dist/extensions/together/index.js +35 -35
  304. package/dist/extensions/twitch/index.d.ts +2 -2
  305. package/dist/extensions/twitch/index.js +37 -37
  306. package/dist/extensions/venice/index.d.ts +1 -1
  307. package/dist/extensions/venice/index.js +35 -35
  308. package/dist/extensions/vercel-ai-gateway/index.d.ts +1 -1
  309. package/dist/extensions/vercel-ai-gateway/index.js +36 -36
  310. package/dist/extensions/vllm/index.d.ts +1 -1
  311. package/dist/extensions/vllm/index.js +35 -35
  312. package/dist/extensions/voice-call/index.d.ts +1 -1
  313. package/dist/extensions/voice-call/index.js +35 -35
  314. package/dist/extensions/volcengine/index.d.ts +1 -1
  315. package/dist/extensions/volcengine/index.js +35 -35
  316. package/dist/extensions/whatsapp/index.d.ts +1 -1
  317. package/dist/extensions/whatsapp/index.js +38 -38
  318. package/dist/extensions/whatsapp/setup-entry.d.ts +1 -1
  319. package/dist/extensions/whatsapp/setup-entry.js +38 -38
  320. package/dist/extensions/xai/index.d.ts +1 -1
  321. package/dist/extensions/xai/index.js +35 -35
  322. package/dist/extensions/xiaomi/index.d.ts +1 -1
  323. package/dist/extensions/xiaomi/index.js +35 -35
  324. package/dist/extensions/zai/index.d.ts +1 -1
  325. package/dist/extensions/zai/index.js +35 -35
  326. package/dist/extensions/zalo/index.d.ts +1 -1
  327. package/dist/extensions/zalo/index.js +39 -39
  328. package/dist/extensions/zalo/setup-entry.d.ts +1 -1
  329. package/dist/extensions/zalo/setup-entry.js +39 -39
  330. package/dist/extensions/zalouser/index.d.ts +1 -1
  331. package/dist/extensions/zalouser/index.js +40 -40
  332. package/dist/extensions/zalouser/setup-entry.d.ts +1 -1
  333. package/dist/extensions/zalouser/setup-entry.js +40 -40
  334. package/dist/feishu-fIcnHDTd.d.ts +36 -0
  335. package/dist/gateway-cli-0c-8h93_.js +26437 -0
  336. package/dist/gateway-install-token-1PwJvrBY.js +163 -0
  337. package/dist/gateway-rpc-C0Vk51W7.js +26 -0
  338. package/dist/gateway-runtime-CBm3CCoA.js +69 -0
  339. package/dist/git-commit-BTWXFY41.js +177 -0
  340. package/dist/git-commit-D6GTN5Yt.js +2 -0
  341. package/dist/googlechat-BQr4xgoZ.js +307 -0
  342. package/dist/googlechat-BvwsCVKl.d.ts +12 -0
  343. package/dist/group-access-DpiQnd-G.d.ts +61 -0
  344. package/dist/health-6yZQGADY.js +113 -0
  345. package/dist/health-C9DYGyRe.js +570 -0
  346. package/dist/heartbeat-summary-Dct2lqJj.js +57 -0
  347. package/dist/help-CtwSApfq.js +81 -0
  348. package/dist/hooks-9gokOxZ5.d.ts +6 -0
  349. package/dist/hooks-cli-BegKzHZT.js +1000 -0
  350. package/dist/hooks-status-Bm_pGORf.js +78 -0
  351. package/dist/http-registry-D-S6a1Na.d.ts +20 -0
  352. package/dist/identity-file-Diub2a0t.js +60 -0
  353. package/dist/image-generation-CbIVzmAR.d.ts +9 -0
  354. package/dist/imessage-Bgok9kfl.js +31 -0
  355. package/dist/imessage-VIHePprL.js +115 -0
  356. package/dist/inbound-reply-dispatch-B53GAGWq.js +71 -0
  357. package/dist/inbound-reply-dispatch-n7U3qg15.d.ts +72 -0
  358. package/dist/index.js +2 -2
  359. package/dist/install-target-oz1pjfHH.js +574 -0
  360. package/dist/installs-CUFm5V8a.js +532 -0
  361. package/dist/io-BaBxjB1v.js +9739 -0
  362. package/dist/io-CgHb1Jld.js +29 -0
  363. package/dist/irc-CaRKzGvW.js +672 -0
  364. package/dist/library-C5SNBCMb.js +112 -0
  365. package/dist/lifecycle-core-Dn8PK6nk.js +382 -0
  366. package/dist/line/accounts.d.ts +2 -2
  367. package/dist/line/send.d.ts +1 -1
  368. package/dist/line/send.js +7 -7
  369. package/dist/line/template-messages.d.ts +1 -1
  370. package/dist/line-B5QFpgN_.d.ts +75 -0
  371. package/dist/line-fePrrQOD.js +530 -0
  372. package/dist/llm-slug-generator-hKae3XDA.js +67 -0
  373. package/dist/llm-slug-generator.d.ts +1 -1
  374. package/dist/llm-slug-generator.js +36 -36
  375. package/dist/logging-CdisccbY.js +13 -0
  376. package/dist/logging-LKQSgX1d.js +30 -0
  377. package/dist/login-qr-C1YWh4nE.js +233 -0
  378. package/dist/login-qr-WFluMDMb.js +112 -0
  379. package/dist/logs-cli-CNzOvZ2d.js +256 -0
  380. package/dist/manager-runtime-DgMhLTkR.js +111 -0
  381. package/dist/manager.runtime-hUWgpPt2.js +715 -0
  382. package/dist/manifest-registry-CS_p1OBQ.js +1329 -0
  383. package/dist/matrix-43_RGLZN.d.ts +68 -0
  384. package/dist/matrix-CCFxHfxa.js +1269 -0
  385. package/dist/matrix-DWs_qIkJ.js +1495 -0
  386. package/dist/mcp-cli-Ci2jvv3s.js +87 -0
  387. package/dist/media-understanding.runtime-Cdr6iTW6.js +116 -0
  388. package/dist/memory-cli-LZbyF0Iu.js +111 -0
  389. package/dist/memory-search-BHhETk6u.js +17 -0
  390. package/dist/memory-search-tTD5o_rU.js +204 -0
  391. package/dist/method-scopes-B2ZKSsxQ.js +2452 -0
  392. package/dist/model-auth-markers-LqZ4qhrZ.d.ts +20 -0
  393. package/dist/model-picker-CTR5mo4v.js +112 -0
  394. package/dist/model-picker-DG4z_dBs.js +390 -0
  395. package/dist/model-picker.runtime-DMQ9Pj9_.js +125 -0
  396. package/dist/model-selection-bBBxfXdb.js +653 -0
  397. package/dist/model-suppression.runtime-BVG75tZ7.js +116 -0
  398. package/dist/models-BjkVLfgw.js +2514 -0
  399. package/dist/models-ZO01Q4cx.js +118 -0
  400. package/dist/models-cli-DemdF-bm.js +309 -0
  401. package/dist/models-config-B2Jja8ua.js +111 -0
  402. package/dist/models-config.providers.discovery-puxTsH39.d.ts +18 -0
  403. package/dist/moldclaw-root-Cb6HRlUO.js +92 -0
  404. package/dist/monitor-BP4idxJD.js +782 -0
  405. package/dist/monitor-B_eP8Eim.js +772 -0
  406. package/dist/monitor-CRHYNl5J.js +3468 -0
  407. package/dist/monitor-Ci1Xg4g3.js +113 -0
  408. package/dist/monitor-DEodDl3z.js +6823 -0
  409. package/dist/monitor-DJlNKuMz.js +115 -0
  410. package/dist/monitor-DvFwDS9w.js +3076 -0
  411. package/dist/monitor-shared--cEjSf8s.js +444 -0
  412. package/dist/msteams-CV2a8uE8.js +852 -0
  413. package/dist/node-cli-Of2g7DSd.js +2503 -0
  414. package/dist/node-resolve-BYC2FbO2.js +835 -0
  415. package/dist/nodes-cli-CPHM6Upj.js +1380 -0
  416. package/dist/nostr-BFKRoOlz.d.ts +7 -0
  417. package/dist/nostr-lHpcBzz4.js +8744 -0
  418. package/dist/npm-resolution-kqHN85wB.js +60 -0
  419. package/dist/oauth-env-CLG8KOrz.js +10 -0
  420. package/dist/onboard-BON0C360.js +48 -0
  421. package/dist/onboard-CRkIBgOI.js +589 -0
  422. package/dist/onboard-DsKI17iq.js +25 -0
  423. package/dist/onboard-channels-BY3IbBBf.js +1241 -0
  424. package/dist/onboard-channels-CLKdRxvW.js +205 -0
  425. package/dist/onboard-custom-BjPrMo_R.js +571 -0
  426. package/dist/onboard-custom-DqcPiZBN.js +114 -0
  427. package/dist/onboard-helpers-BkrOY5OE.js +113 -0
  428. package/dist/onboard-helpers-DiSRTpZC.js +335 -0
  429. package/dist/onboard-hooks-pzEPZAvl.js +72 -0
  430. package/dist/onboard-remote-ChyLC6Dk.js +181 -0
  431. package/dist/onboard-remote-DHmK9ntl.js +117 -0
  432. package/dist/onboard-search-BgA3jEMW.js +302 -0
  433. package/dist/onboard-skills-BMo_NvnW.js +133 -0
  434. package/dist/onboard-skills-Bba-Z2p8.js +117 -0
  435. package/dist/outbound-media-BHD4aJEX.d.ts +11 -0
  436. package/dist/outbound-media-DSno0N82.js +11 -0
  437. package/dist/pairing-access-CzHpaM0R.d.ts +21 -0
  438. package/dist/pairing-cli-CmklqK0q.js +217 -0
  439. package/dist/perplexity-CXwMDD3u.js +24 -0
  440. package/dist/persistent-dedupe-B9vrAf8t.d.ts +26 -0
  441. package/dist/pi-model-discovery-runtime-BrK7tcaO.js +111 -0
  442. package/dist/pi-tools.before-tool-call.runtime-C5yLUogH.js +381 -0
  443. package/dist/plugin-install-C4AWJIFP.js +117 -0
  444. package/dist/plugin-install-CB3J1hfV.js +184 -0
  445. package/dist/plugin-install-plan-7itZiegi.js +49 -0
  446. package/dist/plugin-registry-DX_GFoiz.js +113 -0
  447. package/dist/plugin-registry-e3cxTtvb.js +49 -0
  448. package/dist/plugin-sdk/account-resolution.js +35 -35
  449. package/dist/plugin-sdk/acp-runtime.js +35 -35
  450. package/dist/plugin-sdk/agent-runtime.js +35 -35
  451. package/dist/plugin-sdk/bluebubbles.js +37 -37
  452. package/dist/plugin-sdk/channel-config-helpers.js +35 -35
  453. package/dist/plugin-sdk/channel-policy.js +35 -35
  454. package/dist/plugin-sdk/channel-runtime.js +35 -35
  455. package/dist/plugin-sdk/compat.js +36 -36
  456. package/dist/plugin-sdk/config-runtime.js +35 -35
  457. package/dist/plugin-sdk/conversation-runtime.js +35 -35
  458. package/dist/plugin-sdk/copilot-proxy.js +4 -4
  459. package/dist/plugin-sdk/core.js +4 -4
  460. package/dist/plugin-sdk/device-pair.js +4 -4
  461. package/dist/plugin-sdk/discord.js +35 -35
  462. package/dist/plugin-sdk/feishu.js +35 -35
  463. package/dist/plugin-sdk/gateway-runtime.js +10 -10
  464. package/dist/plugin-sdk/googlechat.js +37 -37
  465. package/dist/plugin-sdk/image-generation-runtime.js +35 -35
  466. package/dist/plugin-sdk/image-generation.js +35 -35
  467. package/dist/plugin-sdk/imessage.js +36 -36
  468. package/dist/plugin-sdk/index.js +35 -35
  469. package/dist/plugin-sdk/infra-runtime.js +35 -35
  470. package/dist/plugin-sdk/irc.js +37 -37
  471. package/dist/plugin-sdk/line.js +36 -36
  472. package/dist/plugin-sdk/llm-task.js +35 -35
  473. package/dist/plugin-sdk/lobster.js +4 -4
  474. package/dist/plugin-sdk/matrix.js +37 -37
  475. package/dist/plugin-sdk/mattermost.js +36 -36
  476. package/dist/plugin-sdk/media-runtime.js +35 -35
  477. package/dist/plugin-sdk/media-understanding-runtime.js +35 -35
  478. package/dist/plugin-sdk/media-understanding.js +35 -35
  479. package/dist/plugin-sdk/memory-lancedb.js +4 -4
  480. package/dist/plugin-sdk/minimax-portal-auth.js +4 -4
  481. package/dist/plugin-sdk/msteams.js +38 -38
  482. package/dist/plugin-sdk/nextcloud-talk.js +36 -36
  483. package/dist/plugin-sdk/nostr.js +36 -36
  484. package/dist/plugin-sdk/ollama-setup.js +9 -9
  485. package/dist/plugin-sdk/open-prose.js +4 -4
  486. package/dist/plugin-sdk/phone-control.js +4 -4
  487. package/dist/plugin-sdk/plugin-runtime.js +35 -35
  488. package/dist/plugin-sdk/provider-auth.js +35 -35
  489. package/dist/plugin-sdk/provider-models.js +5 -5
  490. package/dist/plugin-sdk/provider-onboard.js +4 -4
  491. package/dist/plugin-sdk/provider-setup.js +39 -39
  492. package/dist/plugin-sdk/provider-stream.js +4 -4
  493. package/dist/plugin-sdk/provider-usage.js +4 -4
  494. package/dist/plugin-sdk/qwen-portal-auth.js +35 -35
  495. package/dist/plugin-sdk/reply-history.js +35 -35
  496. package/dist/plugin-sdk/reply-runtime.js +35 -35
  497. package/dist/plugin-sdk/routing.js +3 -3
  498. package/dist/plugin-sdk/sandbox.js +35 -35
  499. package/dist/plugin-sdk/security-runtime.js +35 -35
  500. package/dist/plugin-sdk/self-hosted-provider-setup.js +37 -37
  501. package/dist/plugin-sdk/setup.js +35 -35
  502. package/dist/plugin-sdk/signal.js +35 -35
  503. package/dist/plugin-sdk/slack.js +35 -35
  504. package/dist/plugin-sdk/speech-runtime.js +35 -35
  505. package/dist/plugin-sdk/speech.js +35 -35
  506. package/dist/plugin-sdk/src/secrets/secure-file-store.d.ts +26 -0
  507. package/dist/plugin-sdk/src/subscription/provider.d.ts +5 -3
  508. package/dist/plugin-sdk/synology-chat.js +36 -36
  509. package/dist/plugin-sdk/talk-voice.js +4 -4
  510. package/dist/plugin-sdk/telegram.js +35 -35
  511. package/dist/plugin-sdk/text-runtime.js +7 -7
  512. package/dist/plugin-sdk/thread-ownership.js +4 -4
  513. package/dist/plugin-sdk/tlon.js +36 -36
  514. package/dist/plugin-sdk/twitch.js +35 -35
  515. package/dist/plugin-sdk/voice-call.js +35 -35
  516. package/dist/plugin-sdk/whatsapp.js +35 -35
  517. package/dist/plugin-sdk/zalo.js +38 -38
  518. package/dist/plugin-sdk/zalouser.js +38 -38
  519. package/dist/plugins/runtime/index.d.ts +1 -1
  520. package/dist/plugins/runtime/index.js +35 -35
  521. package/dist/plugins-DF5FaTO0.js +111 -0
  522. package/dist/plugins-cli-CvTJemqC.js +917 -0
  523. package/dist/policy-CNXISK_a.js +143 -0
  524. package/dist/preflight-audio.runtime-RP000oxo.js +116 -0
  525. package/dist/probe-BkM5pykD.js +21 -0
  526. package/dist/probe-DKbRTJv5.js +1793 -0
  527. package/dist/probe-DkrfRsjU.js +47 -0
  528. package/dist/probe-DpcJ0WeP.js +129 -0
  529. package/dist/probe-auth-BcNjX8hy.js +40 -0
  530. package/dist/probe-auth-DhuAb8ls.js +48 -0
  531. package/dist/probe-wciBj-aL.js +6329 -0
  532. package/dist/program-C8-p0mW5.js +253 -0
  533. package/dist/prompt-select-styled-DH0pVoc0.js +2673 -0
  534. package/dist/provider-api-key-auth.runtime-CAFeIQ1u.js +121 -0
  535. package/dist/provider-auth-choice-CB_HzdTl.js +126 -0
  536. package/dist/provider-auth-choice-helpers-hzDkh3f1.js +48 -0
  537. package/dist/provider-auth-choice-preference-BHCXvNSE.js +189 -0
  538. package/dist/provider-auth-choice.runtime-Dx4ms2C5.js +123 -0
  539. package/dist/provider-auth-choices-0KaDNPBQ.js +57 -0
  540. package/dist/provider-auth-guidance-BaAUiNr_.js +34 -0
  541. package/dist/provider-auth-result-Bto1bYtS.d.ts +18 -0
  542. package/dist/provider-models-DxOmeToO.d.ts +867 -0
  543. package/dist/provider-models-xnyxy6mO.js +2113 -0
  544. package/dist/provider-ollama-setup-DBYK__ov.d.ts +32 -0
  545. package/dist/provider-ollama-setup-QzgCxj44.js +314 -0
  546. package/dist/provider-onboard-B9ionepI.js +139 -0
  547. package/dist/provider-onboard-CURxJ_UX.d.ts +40 -0
  548. package/dist/provider-runtime.runtime-4xwmsl5L.js +111 -0
  549. package/dist/provider-self-hosted-setup-BHd24EDG.js +182 -0
  550. package/dist/provider-self-hosted-setup-qeY8BYSy.d.ts +61 -0
  551. package/dist/provider-stream-Chz_EFw3.js +512 -0
  552. package/dist/provider-usage-C11Q7UwS.js +111 -0
  553. package/dist/provider-usage-kxemdMp2.js +633 -0
  554. package/dist/provider-wizard-CanJoxNC.js +152 -0
  555. package/dist/push-apns-Dsajnm8C.js +1038 -0
  556. package/dist/pw-ai-DUe4BbH2.js +1867 -0
  557. package/dist/qmd-manager-CAAFp7qK.js +1570 -0
  558. package/dist/qr-cli-Bu2jqTPY.js +113 -0
  559. package/dist/qr-cli-Bu9Z-X48.js +369 -0
  560. package/dist/reactions-Cpfum4iU.js +281 -0
  561. package/dist/read-only-account-inspect.discord.runtime-BK0LaMgC.js +116 -0
  562. package/dist/read-only-account-inspect.slack.runtime-DgKiC5wT.js +116 -0
  563. package/dist/read-only-account-inspect.telegram.runtime-mxfgFVOU.js +116 -0
  564. package/dist/redact-snapshot-DD8A4tdd.js +2663 -0
  565. package/dist/register.agent-DU4FtrU2.js +439 -0
  566. package/dist/register.backup-8nOYtJqg.js +625 -0
  567. package/dist/register.configure-DmtecqIH.js +252 -0
  568. package/dist/register.maintenance-Dir3ulKP.js +574 -0
  569. package/dist/register.message-Cfl-f3Ju.js +709 -0
  570. package/dist/register.onboard-Bv7WVzEi.js +192 -0
  571. package/dist/register.setup-BIyeI8RY.js +212 -0
  572. package/dist/register.status-health-sessions-C69WQcF4.js +498 -0
  573. package/dist/register.subclis-B_4KCgTd.js +315 -0
  574. package/dist/register.subclis-BeXsmgBL.js +13 -0
  575. package/dist/replies-DdcFUmki.js +110 -0
  576. package/dist/resolve-channels-DRZqPV5o.js +226 -0
  577. package/dist/resolve-channels-DxW1kqxA.js +262 -0
  578. package/dist/resolve-route-DdX-HBVt.js +538 -0
  579. package/dist/resolve-users-rgCQvkLs.js +143 -0
  580. package/dist/root-help-QAkoA7GD.js +32 -0
  581. package/dist/routes-CcJNnwTF.js +7097 -0
  582. package/dist/rpc-DDUAlBbH.js +67 -0
  583. package/dist/run-main-D9ci5pn7.js +424 -0
  584. package/dist/runtime-Bitmi8Er.d.ts +26 -0
  585. package/dist/runtime-discord-ops.runtime-T4sf7aRB.js +9078 -0
  586. package/dist/runtime-slack-ops.runtime-BQpP48mC.js +4556 -0
  587. package/dist/runtime-telegram-ops.runtime-cVO5dqOp.js +133 -0
  588. package/dist/runtime-whatsapp-login.runtime-DtNx0dSY.js +114 -0
  589. package/dist/runtime-whatsapp-outbound.runtime-Bw47QbFK.js +117 -0
  590. package/dist/sandbox-cli-DsFwjbjC.js +535 -0
  591. package/dist/search-manager-BRAK8fEe.js +16 -0
  592. package/dist/search-manager-BS5Db0A6.js +386 -0
  593. package/dist/secrets-cli-D3J46TJp.js +2070 -0
  594. package/dist/security-cli-B866M9cB.js +575 -0
  595. package/dist/send-B1pX9_Oc.js +283 -0
  596. package/dist/send-B2RrLg83.js +100 -0
  597. package/dist/send-DFnV__Aq.js +1025 -0
  598. package/dist/send-DZIH6CJt.js +629 -0
  599. package/dist/send-sl9WnKbW.js +631 -0
  600. package/dist/server-node-events-BT6egg20.js +506 -0
  601. package/dist/server-zI_K-D05.js +107 -0
  602. package/dist/sessions-C8kiAcoJ.js +112 -0
  603. package/dist/sessions-DLBpp52_.js +218 -0
  604. package/dist/setup-C7eOzMiC.js +387 -0
  605. package/dist/setup-CFIMq-Pz.d.ts +37 -0
  606. package/dist/setup-binary-CcAv8NXz.js +406 -0
  607. package/dist/setup-browser-C4eRV3h6.js +70 -0
  608. package/dist/setup-core-BnR486P-.js +143 -0
  609. package/dist/setup-core-CIswIiu5.js +166 -0
  610. package/dist/setup-core-CcbcrXXg.js +47 -0
  611. package/dist/setup-core-nZSw5BSv.js +205 -0
  612. package/dist/setup-surface-C5iSpT4M.js +490 -0
  613. package/dist/setup-wizard-helpers-r0J6l8ST.d.ts +203 -0
  614. package/dist/setup.finalize-adiRfo0U.js +522 -0
  615. package/dist/setup.gateway-config-BwFWKDfT.js +343 -0
  616. package/dist/shared-12TimyeF.js +182 -0
  617. package/dist/shared-9EWO34-k.js +298 -0
  618. package/dist/shared-B4vUbaRR.js +75 -0
  619. package/dist/shared-bNWpW3Dd.js +96 -0
  620. package/dist/shared-lU1y5dvS.js +102 -0
  621. package/dist/signal-DBlETRu9.js +114 -0
  622. package/dist/skills-Bio8GwTE.js +20 -0
  623. package/dist/skills-DE_MXFSN.js +853 -0
  624. package/dist/skills-cli-BGuW-tKw.js +292 -0
  625. package/dist/skills-install--rnorIoJ.js +763 -0
  626. package/dist/skills-status-B08PtBc_.js +21 -0
  627. package/dist/skills-status-CzM008aB.js +169 -0
  628. package/dist/slack-C4T53Nc-.js +114 -0
  629. package/dist/slash-commands.runtime-B7fsD8Be.js +128 -0
  630. package/dist/slash-dispatch.runtime-t0PAX4vQ.js +141 -0
  631. package/dist/slash-skill-commands.runtime-DIhPnEfR.js +116 -0
  632. package/dist/src-DrDirlvw.js +1701 -0
  633. package/dist/status-Bld14WSA.js +131 -0
  634. package/dist/status-CgeO4RuH.js +43 -0
  635. package/dist/status-HlvixAOq.js +606 -0
  636. package/dist/status-Rom_Lf3c.js +1599 -0
  637. package/dist/status-TwbMH6Am.js +126 -0
  638. package/dist/status-json-DMW7cmuK.js +288 -0
  639. package/dist/status.link-channel-V4LkB6Gq.js +143 -0
  640. package/dist/status.scan.deps.runtime-BE3X-dcP.js +126 -0
  641. package/dist/status.scan.runtime-BxVY4mty.js +119 -0
  642. package/dist/status.summary-CzLM0vVr.js +592 -0
  643. package/dist/status.summary.runtime-BSBnHZ1Q.js +118 -0
  644. package/dist/status.update-BxblMS7P.js +77 -0
  645. package/dist/subagent-orphan-recovery-BpRPryEj.js +307 -0
  646. package/dist/subagent-registry-runtime-DYYU5p3X.js +111 -0
  647. package/dist/subscription-CpFdxuFS.js +33 -0
  648. package/dist/subscription-DaA1urx-.js +102 -0
  649. package/dist/subscription-cli-Bvto9EmO.js +134 -0
  650. package/dist/synology-chat-3nwk-Nj0.js +297 -0
  651. package/dist/system-cli-BvNps8sl.js +94 -0
  652. package/dist/telegram/audit.d.ts +1 -1
  653. package/dist/telegram/audit.js +1 -1
  654. package/dist/telegram/token.d.ts +1 -1
  655. package/dist/telegram/token.js +35 -35
  656. package/dist/telegram-RtKXoEsF.js +114 -0
  657. package/dist/text-chunking-BD5mQe2R.js +84 -0
  658. package/dist/text-chunking-DDUU_vAF.d.ts +79 -0
  659. package/dist/tlon-z-kYmJE-.js +433 -0
  660. package/dist/tui-cli-CzSK08Rh.js +137 -0
  661. package/dist/tui-wV7R1Tlc.js +3834 -0
  662. package/dist/types-2H_e7eWT.d.ts +45 -0
  663. package/dist/types-ZKnGUchG.d.ts +22692 -0
  664. package/dist/types.base-BFiQZ4J9.d.ts +188 -0
  665. package/dist/ui-BWVHreeR.js +31 -0
  666. package/dist/update-D1Wgh1Tj.js +1036 -0
  667. package/dist/update-cli-CZh99uyY.js +1503 -0
  668. package/dist/update-offset-store-D5xTdUr0.js +112 -0
  669. package/dist/update-runner-GbKfoCHs.js +1496 -0
  670. package/dist/upsert-with-lock-BZU7Le8n.js +33 -0
  671. package/dist/usage-Czgwvg0h.js +115 -0
  672. package/dist/web-CMczmL90.js +112 -0
  673. package/dist/web-shared-B5Q0mIJq.d.ts +45 -0
  674. package/dist/webhook-request-guards-CsKDhZJr.d.ts +76 -0
  675. package/dist/webhook-targets-BSmFtesN.js +181 -0
  676. package/dist/webhook-targets-CjxuEE9C.d.ts +106 -0
  677. package/dist/webhooks-cli-Wl9y6AWW.js +350 -0
  678. package/dist/whatsapp-VzRW8MdR.js +114 -0
  679. package/dist/whatsapp-actions-Cg1Wxv8W.js +167 -0
  680. package/dist/workspace-DJ_S272u.js +484 -0
  681. package/dist/workspace-DbZSqjw0.js +289 -0
  682. package/dist/workspace-cli-D93DLmAh.js +154 -0
  683. package/dist/workspace-dirs-CGeIPpGN.js +2003 -0
  684. package/dist/zalo-CK2dlGmu.d.ts +9 -0
  685. package/dist/zalo-Db7s2boL.js +415 -0
  686. package/dist/zalouser-Jh5YTJX3.js +30911 -0
  687. package/docs/reference/templates/AGENTS.dev.md +83 -0
  688. package/docs/reference/templates/AGENTS.md +219 -0
  689. package/docs/reference/templates/BOOT.md +11 -0
  690. package/docs/reference/templates/BOOTSTRAP.md +62 -0
  691. package/docs/reference/templates/HEARTBEAT.md +12 -0
  692. package/docs/reference/templates/IDENTITY.dev.md +47 -0
  693. package/docs/reference/templates/IDENTITY.md +29 -0
  694. package/docs/reference/templates/SOUL.dev.md +76 -0
  695. package/docs/reference/templates/SOUL.md +43 -0
  696. package/docs/reference/templates/TOOLS.dev.md +24 -0
  697. package/docs/reference/templates/TOOLS.md +47 -0
  698. package/docs/reference/templates/USER.dev.md +18 -0
  699. package/docs/reference/templates/USER.md +23 -0
  700. package/extensions/discord/src/monitor/allow-list.ts +8 -1
  701. package/extensions/discord/src/monitor/message-handler.preflight.ts +4 -1
  702. package/package.json +2 -1
  703. package/dist/accounts-CDr-lDaV.d.ts +0 -103
  704. package/dist/accounts-CS8U4v8C.js +0 -114
  705. package/dist/acp-cli-BGT0jXcC.js +0 -2093
  706. package/dist/actions.runtime-BfckTw6c.js +0 -119
  707. package/dist/actions.runtime-Cl9mBfqH.js +0 -133
  708. package/dist/agent-scope-C-YmLnnb.js +0 -208
  709. package/dist/agents-CydD54p8.js +0 -222
  710. package/dist/agents-DpQsZO6O.js +0 -853
  711. package/dist/agents.config-XU7IsYE-.js +0 -121
  712. package/dist/agents.config-ssoQXuvF.js +0 -17
  713. package/dist/allow-list-Cfn6lmMK.js +0 -81
  714. package/dist/allowlist-CCYXVpM9.js +0 -142
  715. package/dist/api-BoXoFKxy.js +0 -117
  716. package/dist/audit-Bv05N5o9.js +0 -787
  717. package/dist/audit-CIWW1Aqm.js +0 -54
  718. package/dist/audit-channel.collect.runtime-Bi7yrdcO.js +0 -605
  719. package/dist/audit-channel.runtime-C_NDweiW.js +0 -121
  720. package/dist/audit-extra.async-Dp7OKSXg.js +0 -813
  721. package/dist/audit-membership-runtime-B8FQ6VtN.js +0 -162
  722. package/dist/audit.deep.runtime-CXhobL6b.js +0 -25
  723. package/dist/audit.nondeep.runtime-CrEm3T16.js +0 -832
  724. package/dist/audit.runtime-CJPKj1Zg.js +0 -118
  725. package/dist/auth-Byfp0flq.js +0 -101
  726. package/dist/auth-choice-BgOjdeXN.js +0 -507
  727. package/dist/auth-choice-CD1Heq0M.js +0 -122
  728. package/dist/auth-choice-ePNfg0iQ.js +0 -268
  729. package/dist/auth-choice-options-BlewQWI0.js +0 -123
  730. package/dist/auth-choice-prompt-BP2b6aXz.js +0 -36
  731. package/dist/auth-choice-prompt-Cmwl4n97.js +0 -115
  732. package/dist/auth-choice.apply-helpers-Dq-nxuuX.js +0 -66
  733. package/dist/auth-choice.plugin-providers.runtime-B23kOUzQ.js +0 -119
  734. package/dist/auth-profiles-1kPLbBwI.js +0 -127823
  735. package/dist/auth-profiles.runtime-DAfSjku1.js +0 -116
  736. package/dist/banner-DeOsobLO.js +0 -342
  737. package/dist/bluebubbles-BsLGedBM.js +0 -64
  738. package/dist/bluebubbles-CnT9wiS4.d.ts +0 -6
  739. package/dist/bot-CuzVYwa_.d.ts +0 -478
  740. package/dist/brave-BoWimrLe.js +0 -24
  741. package/dist/browser-cli-D_S3wEYE.js +0 -1494
  742. package/dist/call-ByEzDJ1_.js +0 -640
  743. package/dist/call-CHCWVg-O.js +0 -39
  744. package/dist/channel-3VC0oOMu.js +0 -214
  745. package/dist/channel-B9fCBPiS.js +0 -207
  746. package/dist/channel-B9q775cM.js +0 -562
  747. package/dist/channel-BG3UK54j.js +0 -803
  748. package/dist/channel-BRQAdMML.js +0 -352
  749. package/dist/channel-BmlLp933.js +0 -1321
  750. package/dist/channel-By6KvdTG.js +0 -920
  751. package/dist/channel-C8rRsdf6.js +0 -226
  752. package/dist/channel-CLEDBbXE.js +0 -943
  753. package/dist/channel-CMvBAG7o.js +0 -306
  754. package/dist/channel-CmlxxjHY.js +0 -1598
  755. package/dist/channel-CqG6_xN0.js +0 -949
  756. package/dist/channel-DNueHKs92.js +0 -316
  757. package/dist/channel-DUtyN7BX.js +0 -4681
  758. package/dist/channel-DWD6GrfZ.js +0 -538
  759. package/dist/channel-DaRYMYzj.js +0 -619
  760. package/dist/channel-Dj6BgLp8.js +0 -575
  761. package/dist/channel-account-context-Ba3u5D21.js +0 -103
  762. package/dist/channel-crabk6Em.js +0 -542
  763. package/dist/channel-i8uqQaK2.js +0 -497
  764. package/dist/channel-options-xljvwHS2.js +0 -50
  765. package/dist/channel-plugin-ids-DAgknSG4.js +0 -26
  766. package/dist/channel-summary-dHTMCG75.js +0 -111
  767. package/dist/channel-xVWQ96Ni.js +0 -397
  768. package/dist/channel.runtime-B6PoZ4BV.js +0 -182
  769. package/dist/channel.runtime-BPZmo57e.js +0 -404
  770. package/dist/channel.runtime-B_1uGR-U.js +0 -199
  771. package/dist/channel.runtime-BiXnPU0d.js +0 -218
  772. package/dist/channel.runtime-BpvDc9sv.js +0 -870
  773. package/dist/channel.runtime-CUua3W80.js +0 -418
  774. package/dist/channel.runtime-CaCBTd0A.js +0 -179
  775. package/dist/channel.runtime-D0FfYvUj.js +0 -4011
  776. package/dist/channel.runtime-DhoJtpvJ.js +0 -241
  777. package/dist/channel.runtime-Kj9EXNE0.js +0 -127
  778. package/dist/channel.runtime-r4tPuPyh.js +0 -171
  779. package/dist/channel.setup-B7d_grfe.js +0 -6
  780. package/dist/channel.setup-C0vu1fhi.js +0 -9
  781. package/dist/channel.setup-CAI0FNHj.js +0 -11
  782. package/dist/channel.setup-CkDVwv5R.js +0 -57
  783. package/dist/channel.setup-Cpd00YqQ.js +0 -8
  784. package/dist/channel.setup-DbBz1-WT.js +0 -9
  785. package/dist/channel.setup-GZnAvD9g.js +0 -8
  786. package/dist/channels-5H484RSw.js +0 -1118
  787. package/dist/channels-BnPudfyx.js +0 -404
  788. package/dist/channels-cli-WIC-QeH_.js +0 -291
  789. package/dist/channels-status-issues-RDmzovJU.js +0 -16
  790. package/dist/clawbot-cli-BgutNwf8.js +0 -118
  791. package/dist/cleanup-utils-DBl1Aij1.js +0 -96
  792. package/dist/cli-1P7u6zqu.js +0 -154
  793. package/dist/command-registry-B8jovrws.js +0 -232
  794. package/dist/command-registry-DtDl1FVm.js +0 -14
  795. package/dist/command-secret-gateway-BgUo3FxJ.js +0 -111
  796. package/dist/compact.runtime-CXbXM0AU.js +0 -116
  797. package/dist/completion-cli-Cik_owAE.js +0 -17
  798. package/dist/completion-cli-RU3P2RSl.js +0 -445
  799. package/dist/config-5HUpB1L1.js +0 -31
  800. package/dist/config-cli-QHaUHoZI.js +0 -433
  801. package/dist/config-guard-C9Sn3pE-.js +0 -118
  802. package/dist/config-sW57gztj.js +0 -44
  803. package/dist/config-validation-5LkjIKNt.js +0 -262
  804. package/dist/config-value-CtTWALxG.js +0 -132
  805. package/dist/configure-BmR2TPLf.js +0 -243
  806. package/dist/configure-DaLN-5xM.js +0 -1100
  807. package/dist/control-ui-assets-CH3MYmAo.js +0 -232
  808. package/dist/control-ui-shared-CA77PTml.js +0 -29
  809. package/dist/core-CvDzLs7B.js +0 -150
  810. package/dist/core-jm751KJ9.d.ts +0 -87
  811. package/dist/cron-cli-tguLpzyq.js +0 -639
  812. package/dist/daemon-cli-ptosOkL8.js +0 -339
  813. package/dist/daemon-install-DzU4EnVa.js +0 -180
  814. package/dist/deliver-DwxFoHM3.js +0 -111
  815. package/dist/deliver-runtime-DOdDyaPI.js +0 -111
  816. package/dist/device-id-cli-GopvlxxZ.js +0 -52
  817. package/dist/device-identity-CRfhC3_s.js +0 -365
  818. package/dist/devices-cli-ain7ESqU.js +0 -342
  819. package/dist/diagnostic-D96Xaqrj.js +0 -310
  820. package/dist/directory-cli-fh1UxGgY.js +0 -311
  821. package/dist/directory-config-helpers-Coivm0Mt.d.ts +0 -38
  822. package/dist/directory.static-CKjJUNGl.js +0 -44
  823. package/dist/discord-CflhwDEM.js +0 -114
  824. package/dist/discovery-x0ZqY4AB.js +0 -48
  825. package/dist/dm-policy-shared-DKzsSLlO.d.ts +0 -95
  826. package/dist/dns-cli-DCHyKjGf.js +0 -217
  827. package/dist/docs-cli-D3OoqYSP.js +0 -174
  828. package/dist/doctor-completion-Bq2eP87s.js +0 -90
  829. package/dist/doctor-config-flow-D8XRG9Ku.js +0 -2437
  830. package/dist/doctor-config-flow-DGiF1HGc.js +0 -112
  831. package/dist/enable-0QSF4YGH.js +0 -24
  832. package/dist/exec-approvals-cli-Bncym0Gd.js +0 -421
  833. package/dist/feishu-C1dM8pl2.d.ts +0 -36
  834. package/dist/gateway-cli-DYscsmA-.js +0 -26437
  835. package/dist/gateway-install-token-CNv17ac9.js +0 -163
  836. package/dist/gateway-rpc-BGC1Rxvg.js +0 -26
  837. package/dist/gateway-runtime-D89mSQPB.js +0 -69
  838. package/dist/git-commit-CeLH5Ozm.js +0 -2
  839. package/dist/git-commit-DUKRiCP-.js +0 -177
  840. package/dist/googlechat-BgXeXjd1.js +0 -307
  841. package/dist/googlechat-CNZQb1jd.d.ts +0 -12
  842. package/dist/group-access-Deh1tVNr.d.ts +0 -61
  843. package/dist/health-BEjzWwaB.js +0 -570
  844. package/dist/health-FjqrWQL6.js +0 -113
  845. package/dist/heartbeat-summary-CfdSA9M1.js +0 -57
  846. package/dist/help-BZeVprq1.js +0 -81
  847. package/dist/hooks-06OUQvAV.d.ts +0 -6
  848. package/dist/hooks-cli-B7uGJs2O.js +0 -1000
  849. package/dist/hooks-status-CfceaUSg.js +0 -78
  850. package/dist/http-registry-DYskWhOr.d.ts +0 -20
  851. package/dist/identity-file-sshkKKIr.js +0 -60
  852. package/dist/image-generation-D4o3j8o6.d.ts +0 -9
  853. package/dist/imessage-BcV3WGx_.js +0 -31
  854. package/dist/imessage-Dhje7Ty-.js +0 -115
  855. package/dist/inbound-reply-dispatch-C73_7SOl.js +0 -71
  856. package/dist/inbound-reply-dispatch-D6_HNqH8.d.ts +0 -72
  857. package/dist/install-target-D7NRhfzc.js +0 -574
  858. package/dist/installs-Bj6jblqc.js +0 -532
  859. package/dist/io-CMfWWPXQ.js +0 -9738
  860. package/dist/io-CV844hAM.js +0 -29
  861. package/dist/irc-DKi1fDYI.js +0 -672
  862. package/dist/library-rygTG3oA.js +0 -112
  863. package/dist/lifecycle-core-BPlvShWY.js +0 -382
  864. package/dist/line-B8gTtl3Y.d.ts +0 -75
  865. package/dist/line-CGsemKWJ.js +0 -530
  866. package/dist/llm-slug-generator-DlhVyMqT.js +0 -67
  867. package/dist/logging-5wu9k6w4.js +0 -30
  868. package/dist/logging-CxP9suT8.js +0 -13
  869. package/dist/login-qr-BcDsiwHs.js +0 -233
  870. package/dist/login-qr-Y8pJ5yV4.js +0 -112
  871. package/dist/logs-cli-XI9oVXpH.js +0 -256
  872. package/dist/manager-runtime-DkIlXBhD.js +0 -111
  873. package/dist/manager.runtime-Q0q2rJCC.js +0 -715
  874. package/dist/manifest-registry-DAd0SRAP.js +0 -1329
  875. package/dist/matrix-BI0DBBrG.js +0 -1495
  876. package/dist/matrix-D2JoHzb4.d.ts +0 -68
  877. package/dist/matrix-DiABGjJR.js +0 -1269
  878. package/dist/mcp-cli-BOyn_DLL.js +0 -87
  879. package/dist/media-understanding.runtime-DjUa7Dka.js +0 -116
  880. package/dist/memory-cli-CJd_vl-Y.js +0 -111
  881. package/dist/memory-search-CEEItIFR.js +0 -17
  882. package/dist/memory-search-Cv1SBrn7.js +0 -204
  883. package/dist/method-scopes-CQE7-bZ-.js +0 -2452
  884. package/dist/model-auth-markers-BFoM4IPf.d.ts +0 -20
  885. package/dist/model-picker-D6_89XHg.js +0 -112
  886. package/dist/model-picker-Svaw-APs.js +0 -390
  887. package/dist/model-picker.runtime-Chi9nV7A.js +0 -125
  888. package/dist/model-selection-hL8i1Jbs.js +0 -653
  889. package/dist/model-suppression.runtime-DjWJZ0X-.js +0 -116
  890. package/dist/models-7qj1dG_W.js +0 -118
  891. package/dist/models-BPOB_xJF.js +0 -2514
  892. package/dist/models-cli-DdlOVUjS.js +0 -309
  893. package/dist/models-config-CBqUS-jX.js +0 -111
  894. package/dist/models-config.providers.discovery-Dc905FWG.d.ts +0 -18
  895. package/dist/moldclaw-root-D6PbhbZk.js +0 -88
  896. package/dist/monitor-BPYhkEqF.js +0 -782
  897. package/dist/monitor-BuTcQ24j.js +0 -3468
  898. package/dist/monitor-CuXvNhFh.js +0 -113
  899. package/dist/monitor-D-TqSIHF.js +0 -6823
  900. package/dist/monitor-DRSgo9u2.js +0 -3076
  901. package/dist/monitor-DcHch39z.js +0 -772
  902. package/dist/monitor-DsHBMrXp.js +0 -115
  903. package/dist/monitor-shared-CL8T4gt1.js +0 -444
  904. package/dist/msteams-7FMwTvQG.js +0 -852
  905. package/dist/node-cli-BCjaSCZM.js +0 -2503
  906. package/dist/node-resolve-D5Hvcgyx.js +0 -835
  907. package/dist/nodes-cli-Dd_SNbkt.js +0 -1380
  908. package/dist/nostr-DBTFTxKs.js +0 -8744
  909. package/dist/nostr-DLqaIuZx.d.ts +0 -7
  910. package/dist/npm-resolution-CYfb3MHG.js +0 -60
  911. package/dist/oauth-env-zPt5RywA.js +0 -10
  912. package/dist/onboard-BEFQQeig.js +0 -25
  913. package/dist/onboard-CJHNyxJh.js +0 -48
  914. package/dist/onboard-D_3UeLEN.js +0 -589
  915. package/dist/onboard-channels-B_JL0Djc.js +0 -1241
  916. package/dist/onboard-channels-CqZzHt2C.js +0 -205
  917. package/dist/onboard-custom-CER3Ggbq.js +0 -571
  918. package/dist/onboard-custom-bNRdGECb.js +0 -114
  919. package/dist/onboard-helpers-BK0Hsb7Y.js +0 -335
  920. package/dist/onboard-helpers-CXZ5RPoR.js +0 -113
  921. package/dist/onboard-hooks-1NsxEDjH.js +0 -72
  922. package/dist/onboard-remote-DuKhC_7W.js +0 -117
  923. package/dist/onboard-remote-OwRcDuB3.js +0 -181
  924. package/dist/onboard-search-Cy8dOq2W.js +0 -302
  925. package/dist/onboard-skills-D5phRa6r.js +0 -117
  926. package/dist/onboard-skills-c9qWCNe9.js +0 -133
  927. package/dist/outbound-media-CXKqTh2X.d.ts +0 -11
  928. package/dist/outbound-media-DYRO2vTD.js +0 -11
  929. package/dist/pairing-access-BwJu1mkk.d.ts +0 -21
  930. package/dist/pairing-cli-BOnv0TYn.js +0 -217
  931. package/dist/perplexity-EZwC3y2b.js +0 -24
  932. package/dist/persistent-dedupe-hNES5tS1.d.ts +0 -26
  933. package/dist/pi-model-discovery-runtime-BToY3A6K.js +0 -111
  934. package/dist/pi-tools.before-tool-call.runtime-D_acPtld.js +0 -381
  935. package/dist/plugin-install-CgJpSjYd.js +0 -184
  936. package/dist/plugin-install-Cl1A4EF6.js +0 -117
  937. package/dist/plugin-install-plan-Dc2Z4DeU.js +0 -49
  938. package/dist/plugin-registry-B1UaWrQD.js +0 -49
  939. package/dist/plugin-registry-Cy8biwnn.js +0 -113
  940. package/dist/plugins-CXwvg50F.js +0 -111
  941. package/dist/plugins-cli-Uvzp2aYV.js +0 -917
  942. package/dist/policy-DsMBbEe7.js +0 -143
  943. package/dist/preflight-audio.runtime-hWsZIYvc.js +0 -116
  944. package/dist/probe-CNsSf1Uf.js +0 -6329
  945. package/dist/probe-CqOIrPhb.js +0 -47
  946. package/dist/probe-DH6gDw-h.js +0 -129
  947. package/dist/probe-DM16PLf4.js +0 -21
  948. package/dist/probe-DvAEEWYr.js +0 -1793
  949. package/dist/probe-auth-COfgCble.js +0 -48
  950. package/dist/probe-auth-I_5TX1Eh.js +0 -40
  951. package/dist/program-Dz80sgTU.js +0 -253
  952. package/dist/prompt-select-styled-wQehwFxK.js +0 -2673
  953. package/dist/provider-api-key-auth.runtime-BR9GU4ya.js +0 -121
  954. package/dist/provider-auth-choice-CdhA84kr.js +0 -126
  955. package/dist/provider-auth-choice-helpers-kabp_0zA.js +0 -48
  956. package/dist/provider-auth-choice-preference-se3zAM_2.js +0 -189
  957. package/dist/provider-auth-choice.runtime-BMc8-xNQ.js +0 -123
  958. package/dist/provider-auth-choices-CYsCViGi.js +0 -57
  959. package/dist/provider-auth-guidance-CMjUWlNf.js +0 -34
  960. package/dist/provider-auth-result-5xgWoVGi.d.ts +0 -18
  961. package/dist/provider-models-BCId_Lfu.js +0 -2113
  962. package/dist/provider-models-D-eFl9oH.d.ts +0 -867
  963. package/dist/provider-ollama-setup-B6XJZ0So.js +0 -314
  964. package/dist/provider-ollama-setup-BF1vhob8.d.ts +0 -32
  965. package/dist/provider-onboard-BjXHP3IZ.d.ts +0 -40
  966. package/dist/provider-onboard-Ca0TaNud.js +0 -139
  967. package/dist/provider-runtime.runtime-DwwkHw_7.js +0 -111
  968. package/dist/provider-self-hosted-setup-BEKLVGpj.js +0 -182
  969. package/dist/provider-self-hosted-setup-BQ5BIlpi.d.ts +0 -61
  970. package/dist/provider-stream-DrUD69ai.js +0 -512
  971. package/dist/provider-usage-BgKHCnjr.js +0 -111
  972. package/dist/provider-usage-D8EZpFz9.js +0 -633
  973. package/dist/provider-wizard-DMdb-zj_.js +0 -152
  974. package/dist/push-apns-BPH6d4VV.js +0 -1038
  975. package/dist/pw-ai-DttfldtL.js +0 -1867
  976. package/dist/qmd-manager-CybcDUfk.js +0 -1570
  977. package/dist/qr-cli-8NcmJ8Ft.js +0 -369
  978. package/dist/qr-cli-DWe0Our3.js +0 -113
  979. package/dist/reactions-D6N0LR16.js +0 -281
  980. package/dist/read-only-account-inspect.discord.runtime-CqUWTRfl.js +0 -116
  981. package/dist/read-only-account-inspect.slack.runtime-9-jpln3q.js +0 -116
  982. package/dist/read-only-account-inspect.telegram.runtime-EKPI1D7n.js +0 -116
  983. package/dist/redact-snapshot-DwJEIVk9.js +0 -2663
  984. package/dist/register.agent-D3YdDirP.js +0 -439
  985. package/dist/register.backup-dR27qCuo.js +0 -625
  986. package/dist/register.configure-BjFhkkka.js +0 -252
  987. package/dist/register.maintenance-DiMQJIOa.js +0 -574
  988. package/dist/register.message-CdZsKYH1.js +0 -709
  989. package/dist/register.onboard-B0rV1eaO.js +0 -192
  990. package/dist/register.setup-wKMvohzo.js +0 -212
  991. package/dist/register.status-health-sessions-BJ68m6pt.js +0 -498
  992. package/dist/register.subclis-CnnrWt2a.js +0 -315
  993. package/dist/register.subclis-lSvTkC6z.js +0 -13
  994. package/dist/replies-BABt9b48.js +0 -110
  995. package/dist/resolve-channels-BqZFl2Ux.js +0 -262
  996. package/dist/resolve-channels-DjQLXb7B.js +0 -226
  997. package/dist/resolve-route-CSHDsa_m.js +0 -538
  998. package/dist/resolve-users-BG6HaSR5.js +0 -143
  999. package/dist/root-help-ohmaCyC_.js +0 -32
  1000. package/dist/routes-4k2kpvoT.js +0 -7097
  1001. package/dist/rpc-Cnwn4Q6L.js +0 -67
  1002. package/dist/run-main-VYlacKA0.js +0 -424
  1003. package/dist/runtime-Cy8pqYUB.d.ts +0 -26
  1004. package/dist/runtime-discord-ops.runtime-DafrU-rI.js +0 -9078
  1005. package/dist/runtime-slack-ops.runtime-CdXBKXwd.js +0 -4556
  1006. package/dist/runtime-telegram-ops.runtime-B12sF7gE.js +0 -133
  1007. package/dist/runtime-whatsapp-login.runtime-CqEudH37.js +0 -114
  1008. package/dist/runtime-whatsapp-outbound.runtime-D5m2qyn-.js +0 -117
  1009. package/dist/sandbox-cli-CHJiEWXB.js +0 -535
  1010. package/dist/search-manager-BtNC3-i_.js +0 -16
  1011. package/dist/search-manager-C7J7B3_a.js +0 -386
  1012. package/dist/secrets-cli-C6yIWBbN.js +0 -2070
  1013. package/dist/security-cli-BVu9BkjD.js +0 -575
  1014. package/dist/send-BSreC7rr.js +0 -631
  1015. package/dist/send-BsLHQG_B.js +0 -1025
  1016. package/dist/send-BuNhp8PH.js +0 -283
  1017. package/dist/send-DOCswVar.js +0 -100
  1018. package/dist/send-Dl0LLErk.js +0 -629
  1019. package/dist/server-node-events-Bq2067EG.js +0 -506
  1020. package/dist/server-y38L7N5H.js +0 -107
  1021. package/dist/sessions-BV8gXURR.js +0 -112
  1022. package/dist/sessions-dl1Kc-Ci.js +0 -218
  1023. package/dist/setup-DGszQH0_.js +0 -387
  1024. package/dist/setup-DR5rRw9y.d.ts +0 -37
  1025. package/dist/setup-binary-C17YnmA8.js +0 -406
  1026. package/dist/setup-browser-CPx-nEsr.js +0 -70
  1027. package/dist/setup-core-BByHN1ME.js +0 -143
  1028. package/dist/setup-core-C0KPlBmL.js +0 -47
  1029. package/dist/setup-core-Cq37G6of.js +0 -166
  1030. package/dist/setup-core-uO84_Y75.js +0 -205
  1031. package/dist/setup-surface-BEMi7Rmb.js +0 -490
  1032. package/dist/setup-wizard-helpers-BtuGx_gN.d.ts +0 -203
  1033. package/dist/setup.finalize-BzPBa8zW.js +0 -522
  1034. package/dist/setup.gateway-config-DdwkF-8e.js +0 -343
  1035. package/dist/shared-BCw4SKjB.js +0 -96
  1036. package/dist/shared-CjNzsULP.js +0 -75
  1037. package/dist/shared-Cu1BE7ZE.js +0 -298
  1038. package/dist/shared-DSClmyUn.js +0 -182
  1039. package/dist/shared-DyJdGH6y.js +0 -102
  1040. package/dist/signal-Dyv4NZsB.js +0 -114
  1041. package/dist/skills-CbB5b27M.js +0 -853
  1042. package/dist/skills-CnfI7Szw.js +0 -20
  1043. package/dist/skills-cli-CavB1f_3.js +0 -292
  1044. package/dist/skills-install-B1OBdgd0.js +0 -763
  1045. package/dist/skills-status-B3gAmIbW.js +0 -169
  1046. package/dist/skills-status-DrHhFgU9.js +0 -21
  1047. package/dist/slack-BRzqnoAz.js +0 -114
  1048. package/dist/slash-commands.runtime-BK88kgds.js +0 -128
  1049. package/dist/slash-dispatch.runtime-COGywwJE.js +0 -141
  1050. package/dist/slash-skill-commands.runtime-Ti4brxgh.js +0 -116
  1051. package/dist/src-DUR6OQxI.js +0 -1701
  1052. package/dist/status-C6dgQY9a.js +0 -131
  1053. package/dist/status-CNK0Q7QH.js +0 -606
  1054. package/dist/status-DBcX0DSC.js +0 -43
  1055. package/dist/status-DKgFgbwv.js +0 -1599
  1056. package/dist/status-Wn5lhNAc.js +0 -126
  1057. package/dist/status-json-D2EkWqAl.js +0 -288
  1058. package/dist/status.link-channel-D3ULIdEa.js +0 -143
  1059. package/dist/status.scan.deps.runtime-BsjWTAm4.js +0 -126
  1060. package/dist/status.scan.runtime-D4HbzROD.js +0 -119
  1061. package/dist/status.summary-C3YxPrDK.js +0 -592
  1062. package/dist/status.summary.runtime-DAkXPSaK.js +0 -118
  1063. package/dist/status.update-B4NnN9P1.js +0 -77
  1064. package/dist/subagent-orphan-recovery-QiQEBv36.js +0 -307
  1065. package/dist/subagent-registry-runtime-BJatPQFK.js +0 -111
  1066. package/dist/subscription-BhZORXN9.js +0 -100
  1067. package/dist/subscription-QEUjQRMv.js +0 -33
  1068. package/dist/subscription-cli-HrULlAgc.js +0 -134
  1069. package/dist/synology-chat-DB76GWMN.js +0 -297
  1070. package/dist/system-cli-D8jDwWuL.js +0 -94
  1071. package/dist/telegram-BHiiqKkQ.js +0 -114
  1072. package/dist/text-chunking-Baonm9Lu.js +0 -84
  1073. package/dist/text-chunking-Y3dPBOuZ.d.ts +0 -79
  1074. package/dist/tlon-DLESxNgD.js +0 -433
  1075. package/dist/tui-C75zi2Cl.js +0 -3834
  1076. package/dist/tui-cli-DFwx5e6i.js +0 -137
  1077. package/dist/types-BBJ3Qz7j.d.ts +0 -45
  1078. package/dist/types-Ckufs_BY.d.ts +0 -22692
  1079. package/dist/types.base-Cw0-zIvE.d.ts +0 -188
  1080. package/dist/ui-B55NOIB6.js +0 -31
  1081. package/dist/update--ojavYQ4.js +0 -1036
  1082. package/dist/update-cli-Cvj5aWYM.js +0 -1503
  1083. package/dist/update-offset-store-upatuWwX.js +0 -112
  1084. package/dist/update-runner-DHkY_-76.js +0 -1496
  1085. package/dist/upsert-with-lock-C171GLaR.js +0 -33
  1086. package/dist/usage-N3bxnbmt.js +0 -115
  1087. package/dist/web-RdvT7gKa.js +0 -112
  1088. package/dist/web-shared-HSGD3yGt.d.ts +0 -45
  1089. package/dist/webhook-request-guards-CosLyl01.d.ts +0 -76
  1090. package/dist/webhook-targets-Bfnag-du.js +0 -181
  1091. package/dist/webhook-targets-Di17rt8e.d.ts +0 -106
  1092. package/dist/webhooks-cli-ZpnXrq7G.js +0 -350
  1093. package/dist/whatsapp-DNTAyZHt.js +0 -114
  1094. package/dist/whatsapp-actions-o1zKQzKZ.js +0 -167
  1095. package/dist/workspace-CpWi5wPr.js +0 -479
  1096. package/dist/workspace-Ii7aRS7c.js +0 -289
  1097. package/dist/workspace-dirs-x10McA9t.js +0 -2003
  1098. package/dist/zalo-BN3VCrRY.d.ts +0 -9
  1099. package/dist/zalo-zm_bYCKg.js +0 -415
  1100. package/dist/zalouser-CvVEUvc5.js +0 -30911
  1101. /package/dist/{account-id-B3YSn4hl.d.ts → account-id-B8ce6G_4.d.ts} +0 -0
  1102. /package/dist/{acpx-CnNv70m2.d.ts → acpx-Ci50I9T2.d.ts} +0 -0
  1103. /package/dist/{agent-media-payload-DE2pEcsz.d.ts → agent-media-payload-en-gS5p6.d.ts} +0 -0
  1104. /package/dist/{allow-from-DPpHnT2A.d.ts → allow-from-cMeQ47Ot.d.ts} +0 -0
  1105. /package/dist/{allowlist-resolution-CLFiZ6nE.d.ts → allowlist-resolution-DoAWbfXV.d.ts} +0 -0
  1106. /package/dist/{bluebubbles-Duhu-Jer.d.ts → bluebubbles-C6yYmUl0.d.ts} +0 -0
  1107. /package/dist/{boolean-param-BhFjB3gp.d.ts → boolean-param-CdO2TFTk.d.ts} +0 -0
  1108. /package/dist/{channel-config-schema-DnnVMdjR.d.ts → channel-config-schema-Chp38wel.d.ts} +0 -0
  1109. /package/dist/{channel-policy-Baq-Z06b.d.ts → channel-policy-g2h6AbYQ.d.ts} +0 -0
  1110. /package/dist/{chat-type-DpiBgwuG.d.ts → chat-type-BLt59pPT.d.ts} +0 -0
  1111. /package/dist/{command-format-vi4xq8e8.d.ts → command-format-BDJC05Jp.d.ts} +0 -0
  1112. /package/dist/{diffs-DK7fVSDo.d.ts → diffs-D_iNKCyn.d.ts} +0 -0
  1113. /package/dist/{directory-runtime-BTLPaysA.d.ts → directory-runtime-DhMex6HY.d.ts} +0 -0
  1114. /package/dist/{exec-C01wtBHu.d.ts → exec-pjfUY4KM.d.ts} +0 -0
  1115. /package/dist/{gaxios-fetch-compat-wZ38b3w3.js → gaxios-fetch-compat-B_vtINdV.js} +0 -0
  1116. /package/dist/{history-CwXuP2TW.d.ts → history-aqSS5VGQ.d.ts} +0 -0
  1117. /package/dist/{inbound-envelope-SggrBs9m.d.ts → inbound-envelope-C5hWuZod.d.ts} +0 -0
  1118. /package/dist/{index-apAZHsDo.d.ts → index-DXVQFYGX.d.ts} +0 -0
  1119. /package/dist/{json-store-r75IZGk9.d.ts → json-store-UnqQ5aV3.d.ts} +0 -0
  1120. /package/dist/{keyed-async-queue-DHIr7yNe.d.ts → keyed-async-queue-guucpLw3.d.ts} +0 -0
  1121. /package/dist/{links-HeQ3r_L0.d.ts → links-Bar0meEK.d.ts} +0 -0
  1122. /package/dist/{markdown-to-line-CDb4Jy3V.d.ts → markdown-to-line-D8uH_KOj.d.ts} +0 -0
  1123. /package/dist/{mattermost-DtCsxpgg.d.ts → mattermost-xl7jAFJL.d.ts} +0 -0
  1124. /package/dist/{net-BATPDwdQ.d.ts → net-rGOKGds6.d.ts} +0 -0
  1125. /package/dist/{nextcloud-talk-Bb2wHOwp.d.ts → nextcloud-talk-De2CZ9dV.d.ts} +0 -0
  1126. /package/dist/{oauth-utils-u567CLT0.d.ts → oauth-utils-DzN1AlEH.d.ts} +0 -0
  1127. /package/dist/{parse-finite-number-l3tNlrZh.d.ts → parse-finite-number-odgyqhi0.d.ts} +0 -0
  1128. /package/dist/{provider-usage.types-C6061OVN.d.ts → provider-usage.types-EDE9o-H_.d.ts} +0 -0
  1129. /package/dist/{reply-history-BDsFnZFl.d.ts → reply-history-CVuU31xe.d.ts} +0 -0
  1130. /package/dist/{reply-payload-CCvM4W9u.d.ts → reply-payload-CHkpBYwL.d.ts} +0 -0
  1131. /package/dist/{request-url-C54l4-xC.d.ts → request-url-DHisbiHY.d.ts} +0 -0
  1132. /package/dist/{run-command-D3RqWcHu.d.ts → run-command-y0Cndsb1.d.ts} +0 -0
  1133. /package/dist/{secret-input-schema-BLBt-NAP.d.ts → secret-input-schema-b1vpYDQN.d.ts} +0 -0
  1134. /package/dist/{session-key-BQ2-bR-9.d.ts → session-key-DTHQl57f.d.ts} +0 -0
  1135. /package/dist/{ssh-config-C4mcH9Ly.js → ssh-config-hEHBfU2_.js} +0 -0
  1136. /package/dist/{testing-DLkhGsoz.d.ts → testing-DszuZXgK.d.ts} +0 -0
  1137. /package/dist/{thinking-DRkjX18p.d.ts → thinking-IwXTGSeT.d.ts} +0 -0
  1138. /package/dist/{tool-send-CMMD1uDu.d.ts → tool-send-DWHRmKpz.d.ts} +0 -0
  1139. /package/dist/{vllm-defaults-CcGuf4hL.d.ts → vllm-defaults-CrxZgE6-.d.ts} +0 -0
  1140. /package/dist/{wait-Daog8bxM.d.ts → wait-wDWw_MTI.d.ts} +0 -0
  1141. /package/dist/{webhook-memory-guards-C5MrExwT.d.ts → webhook-memory-guards-DreORuJy.d.ts} +0 -0
  1142. /package/dist/{windows-spawn-j2l-dqu8.d.ts → windows-spawn-BIzH92x2.d.ts} +0 -0
  1143. /package/dist/{zod-schema.agent-runtime-krMrBnIn.d.ts → zod-schema.agent-runtime-CP2rmis3.d.ts} +0 -0
  1144. /package/dist/{zod-schema.core-BNDieZDZ.d.ts → zod-schema.core-Foi1tYwi.d.ts} +0 -0
@@ -1,1793 +0,0 @@
1
- import { C as sleep } from "./utils-C7ykRPCQ.js";
2
- import { w as withFileLock$1 } from "./setup-binary-C17YnmA8.js";
3
- import { Wy as loadWebMedia, nh as resolveChannelMediaMaxBytes } from "./auth-profiles-1kPLbBwI.js";
4
- import { r as normalizeStringEntries } from "./string-normalization-28MhO2sd.js";
5
- import { M as extractOriginalFilename } from "./routes-4k2kpvoT.js";
6
- import { n as extensionForMime, r as getFileExtension, t as detectMime } from "./mime-DGFQe4XX.js";
7
- import { g as isSilentReplyText } from "./lazy-runtime-BoGB4usD.js";
8
- import { n as writeJsonFileAtomically, t as readJsonFileWithFallback } from "./json-store--7cBPxTG.js";
9
- import { t as loadOutboundMediaFromUrl } from "./outbound-media-DYRO2vTD.js";
10
- import { _ as loadMSTeamsSdkWithAuth, g as createMSTeamsAdapter, h as readAccessToken, m as resolveMSTeamsCredentials } from "./msteams-7FMwTvQG.js";
11
- import { t as getMSTeamsRuntime } from "./runtime-ChDf4nkp.js";
12
- import fs from "node:fs";
13
- import path from "node:path";
14
- import crypto from "node:crypto";
15
- //#region extensions/msteams/src/storage.ts
16
- function resolveMSTeamsStorePath(params) {
17
- if (params.storePath) return params.storePath;
18
- if (params.stateDir) return path.join(params.stateDir, params.filename);
19
- const env = params.env ?? process.env;
20
- const stateDir = params.homedir ? getMSTeamsRuntime().state.resolveStateDir(env, params.homedir) : getMSTeamsRuntime().state.resolveStateDir(env);
21
- return path.join(stateDir, params.filename);
22
- }
23
- //#endregion
24
- //#region extensions/msteams/src/store-fs.ts
25
- const STORE_LOCK_OPTIONS = {
26
- retries: {
27
- retries: 10,
28
- factor: 2,
29
- minTimeout: 100,
30
- maxTimeout: 1e4,
31
- randomize: true
32
- },
33
- stale: 3e4
34
- };
35
- async function readJsonFile(filePath, fallback) {
36
- return await readJsonFileWithFallback(filePath, fallback);
37
- }
38
- async function writeJsonFile(filePath, value) {
39
- await writeJsonFileAtomically(filePath, value);
40
- }
41
- async function ensureJsonFile(filePath, fallback) {
42
- try {
43
- await fs.promises.access(filePath);
44
- } catch {
45
- await writeJsonFile(filePath, fallback);
46
- }
47
- }
48
- async function withFileLock(filePath, fallback, fn) {
49
- await ensureJsonFile(filePath, fallback);
50
- return await withFileLock$1(filePath, STORE_LOCK_OPTIONS, async () => {
51
- return await fn();
52
- });
53
- }
54
- //#endregion
55
- //#region extensions/msteams/src/polls.ts
56
- const STORE_FILENAME$1 = "msteams-polls.json";
57
- const MAX_POLLS = 1e3;
58
- const POLL_TTL_MS = 720 * 60 * 60 * 1e3;
59
- function isRecord$1(value) {
60
- return Boolean(value) && typeof value === "object" && !Array.isArray(value);
61
- }
62
- function normalizeChoiceValue(value) {
63
- if (typeof value === "string") {
64
- const trimmed = value.trim();
65
- return trimmed ? trimmed : null;
66
- }
67
- if (typeof value === "number" && Number.isFinite(value)) return String(value);
68
- return null;
69
- }
70
- function extractSelections(value) {
71
- if (Array.isArray(value)) return value.map(normalizeChoiceValue).filter((entry) => Boolean(entry));
72
- const normalized = normalizeChoiceValue(value);
73
- if (!normalized) return [];
74
- if (normalized.includes(",")) return normalized.split(",").map((entry) => entry.trim()).filter(Boolean);
75
- return [normalized];
76
- }
77
- function readNestedValue(value, keys) {
78
- let current = value;
79
- for (const key of keys) {
80
- if (!isRecord$1(current)) return;
81
- current = current[key];
82
- }
83
- return current;
84
- }
85
- function readNestedString(value, keys) {
86
- const found = readNestedValue(value, keys);
87
- return typeof found === "string" && found.trim() ? found.trim() : void 0;
88
- }
89
- function extractMSTeamsPollVote(activity) {
90
- const value = activity?.value;
91
- if (!value || !isRecord$1(value)) return null;
92
- const pollId = readNestedString(value, ["moldclawPollId"]) ?? readNestedString(value, ["pollId"]) ?? readNestedString(value, ["moldclaw", "pollId"]) ?? readNestedString(value, [
93
- "moldclaw",
94
- "poll",
95
- "id"
96
- ]) ?? readNestedString(value, ["data", "moldclawPollId"]) ?? readNestedString(value, ["data", "pollId"]) ?? readNestedString(value, [
97
- "data",
98
- "moldclaw",
99
- "pollId"
100
- ]);
101
- if (!pollId) return null;
102
- const directSelections = extractSelections(value.choices);
103
- const nestedSelections = extractSelections(readNestedValue(value, ["choices"]));
104
- const dataSelections = extractSelections(readNestedValue(value, ["data", "choices"]));
105
- const selections = directSelections.length > 0 ? directSelections : nestedSelections.length > 0 ? nestedSelections : dataSelections;
106
- if (selections.length === 0) return null;
107
- return {
108
- pollId,
109
- selections
110
- };
111
- }
112
- function buildMSTeamsPollCard(params) {
113
- const pollId = params.pollId ?? crypto.randomUUID();
114
- const maxSelections = typeof params.maxSelections === "number" && params.maxSelections > 1 ? Math.floor(params.maxSelections) : 1;
115
- const cappedMaxSelections = Math.min(Math.max(1, maxSelections), params.options.length);
116
- const choices = params.options.map((option, index) => ({
117
- title: option,
118
- value: String(index)
119
- }));
120
- const hint = cappedMaxSelections > 1 ? `Select up to ${cappedMaxSelections} option${cappedMaxSelections === 1 ? "" : "s"}.` : "Select one option.";
121
- const card = {
122
- type: "AdaptiveCard",
123
- version: "1.5",
124
- body: [
125
- {
126
- type: "TextBlock",
127
- text: params.question,
128
- wrap: true,
129
- weight: "Bolder",
130
- size: "Medium"
131
- },
132
- {
133
- type: "Input.ChoiceSet",
134
- id: "choices",
135
- isMultiSelect: cappedMaxSelections > 1,
136
- style: "expanded",
137
- choices
138
- },
139
- {
140
- type: "TextBlock",
141
- text: hint,
142
- wrap: true,
143
- isSubtle: true,
144
- spacing: "Small"
145
- }
146
- ],
147
- actions: [{
148
- type: "Action.Submit",
149
- title: "Vote",
150
- data: {
151
- moldclawPollId: pollId,
152
- pollId
153
- },
154
- msteams: {
155
- type: "messageBack",
156
- text: "moldclaw poll vote",
157
- displayText: "Vote recorded",
158
- value: {
159
- moldclawPollId: pollId,
160
- pollId
161
- }
162
- }
163
- }]
164
- };
165
- const fallbackLines = [`Poll: ${params.question}`, ...params.options.map((option, index) => `${index + 1}. ${option}`)];
166
- return {
167
- pollId,
168
- question: params.question,
169
- options: params.options,
170
- maxSelections: cappedMaxSelections,
171
- card,
172
- fallbackText: fallbackLines.join("\n")
173
- };
174
- }
175
- function parseTimestamp$1(value) {
176
- if (!value) return null;
177
- const parsed = Date.parse(value);
178
- return Number.isFinite(parsed) ? parsed : null;
179
- }
180
- function pruneExpired$1(polls) {
181
- const cutoff = Date.now() - POLL_TTL_MS;
182
- const entries = Object.entries(polls).filter(([, poll]) => {
183
- return (parseTimestamp$1(poll.updatedAt ?? poll.createdAt) ?? 0) >= cutoff;
184
- });
185
- return Object.fromEntries(entries);
186
- }
187
- function pruneToLimit$1(polls) {
188
- const entries = Object.entries(polls);
189
- if (entries.length <= MAX_POLLS) return polls;
190
- entries.sort((a, b) => {
191
- return (parseTimestamp$1(a[1].updatedAt ?? a[1].createdAt) ?? 0) - (parseTimestamp$1(b[1].updatedAt ?? b[1].createdAt) ?? 0);
192
- });
193
- const keep = entries.slice(entries.length - MAX_POLLS);
194
- return Object.fromEntries(keep);
195
- }
196
- function normalizeMSTeamsPollSelections(poll, selections) {
197
- const maxSelections = Math.max(1, poll.maxSelections);
198
- const mapped = selections.map((entry) => Number.parseInt(entry, 10)).filter((value) => Number.isFinite(value)).filter((value) => value >= 0 && value < poll.options.length).map((value) => String(value));
199
- const limited = maxSelections > 1 ? mapped.slice(0, maxSelections) : mapped.slice(0, 1);
200
- return Array.from(new Set(limited));
201
- }
202
- function createMSTeamsPollStoreFs(params) {
203
- const filePath = resolveMSTeamsStorePath({
204
- filename: STORE_FILENAME$1,
205
- env: params?.env,
206
- homedir: params?.homedir,
207
- stateDir: params?.stateDir,
208
- storePath: params?.storePath
209
- });
210
- const empty = {
211
- version: 1,
212
- polls: {}
213
- };
214
- const readStore = async () => {
215
- const { value } = await readJsonFile(filePath, empty);
216
- return {
217
- version: 1,
218
- polls: pruneToLimit$1(pruneExpired$1(value.polls ?? {}))
219
- };
220
- };
221
- const writeStore = async (data) => {
222
- await writeJsonFile(filePath, data);
223
- };
224
- const createPoll = async (poll) => {
225
- await withFileLock(filePath, empty, async () => {
226
- const data = await readStore();
227
- data.polls[poll.id] = poll;
228
- await writeStore({
229
- version: 1,
230
- polls: pruneToLimit$1(data.polls)
231
- });
232
- });
233
- };
234
- const getPoll = async (pollId) => await withFileLock(filePath, empty, async () => {
235
- return (await readStore()).polls[pollId] ?? null;
236
- });
237
- const recordVote = async (params) => await withFileLock(filePath, empty, async () => {
238
- const data = await readStore();
239
- const poll = data.polls[params.pollId];
240
- if (!poll) return null;
241
- const normalized = normalizeMSTeamsPollSelections(poll, params.selections);
242
- poll.votes[params.voterId] = normalized;
243
- poll.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
244
- data.polls[poll.id] = poll;
245
- await writeStore({
246
- version: 1,
247
- polls: pruneToLimit$1(data.polls)
248
- });
249
- return poll;
250
- });
251
- return {
252
- createPoll,
253
- getPoll,
254
- recordVote
255
- };
256
- }
257
- //#endregion
258
- //#region extensions/msteams/src/conversation-store-fs.ts
259
- const STORE_FILENAME = "msteams-conversations.json";
260
- const MAX_CONVERSATIONS = 1e3;
261
- const CONVERSATION_TTL_MS = 365 * 24 * 60 * 60 * 1e3;
262
- function parseTimestamp(value) {
263
- if (!value) return null;
264
- const parsed = Date.parse(value);
265
- if (!Number.isFinite(parsed)) return null;
266
- return parsed;
267
- }
268
- function pruneToLimit(conversations) {
269
- const entries = Object.entries(conversations);
270
- if (entries.length <= MAX_CONVERSATIONS) return conversations;
271
- entries.sort((a, b) => {
272
- return (parseTimestamp(a[1].lastSeenAt) ?? 0) - (parseTimestamp(b[1].lastSeenAt) ?? 0);
273
- });
274
- const keep = entries.slice(entries.length - MAX_CONVERSATIONS);
275
- return Object.fromEntries(keep);
276
- }
277
- function pruneExpired(conversations, nowMs, ttlMs) {
278
- let removed = false;
279
- const kept = {};
280
- for (const [conversationId, reference] of Object.entries(conversations)) {
281
- const lastSeenAt = parseTimestamp(reference.lastSeenAt);
282
- if (lastSeenAt != null && nowMs - lastSeenAt > ttlMs) {
283
- removed = true;
284
- continue;
285
- }
286
- kept[conversationId] = reference;
287
- }
288
- return {
289
- conversations: kept,
290
- removed
291
- };
292
- }
293
- function normalizeConversationId$1(raw) {
294
- return raw.split(";")[0] ?? raw;
295
- }
296
- function createMSTeamsConversationStoreFs(params) {
297
- const ttlMs = params?.ttlMs ?? CONVERSATION_TTL_MS;
298
- const filePath = resolveMSTeamsStorePath({
299
- filename: STORE_FILENAME,
300
- env: params?.env,
301
- homedir: params?.homedir,
302
- stateDir: params?.stateDir,
303
- storePath: params?.storePath
304
- });
305
- const empty = {
306
- version: 1,
307
- conversations: {}
308
- };
309
- const readStore = async () => {
310
- const { value } = await readJsonFile(filePath, empty);
311
- if (value.version !== 1 || !value.conversations || typeof value.conversations !== "object" || Array.isArray(value.conversations)) return empty;
312
- const nowMs = Date.now();
313
- const pruned = pruneExpired(value.conversations, nowMs, ttlMs).conversations;
314
- return {
315
- version: 1,
316
- conversations: pruneToLimit(pruned)
317
- };
318
- };
319
- const list = async () => {
320
- const store = await readStore();
321
- return Object.entries(store.conversations).map(([conversationId, reference]) => ({
322
- conversationId,
323
- reference
324
- }));
325
- };
326
- const get = async (conversationId) => {
327
- return (await readStore()).conversations[normalizeConversationId$1(conversationId)] ?? null;
328
- };
329
- const findByUserId = async (id) => {
330
- const target = id.trim();
331
- if (!target) return null;
332
- for (const entry of await list()) {
333
- const { conversationId, reference } = entry;
334
- if (reference.user?.aadObjectId === target) return {
335
- conversationId,
336
- reference
337
- };
338
- if (reference.user?.id === target) return {
339
- conversationId,
340
- reference
341
- };
342
- }
343
- return null;
344
- };
345
- const upsert = async (conversationId, reference) => {
346
- const normalizedId = normalizeConversationId$1(conversationId);
347
- await withFileLock(filePath, empty, async () => {
348
- const store = await readStore();
349
- store.conversations[normalizedId] = {
350
- ...reference,
351
- lastSeenAt: (/* @__PURE__ */ new Date()).toISOString()
352
- };
353
- const nowMs = Date.now();
354
- store.conversations = pruneExpired(store.conversations, nowMs, ttlMs).conversations;
355
- store.conversations = pruneToLimit(store.conversations);
356
- await writeJsonFile(filePath, store);
357
- });
358
- };
359
- const remove = async (conversationId) => {
360
- const normalizedId = normalizeConversationId$1(conversationId);
361
- return await withFileLock(filePath, empty, async () => {
362
- const store = await readStore();
363
- if (!(normalizedId in store.conversations)) return false;
364
- delete store.conversations[normalizedId];
365
- await writeJsonFile(filePath, store);
366
- return true;
367
- });
368
- };
369
- return {
370
- upsert,
371
- get,
372
- list,
373
- remove,
374
- findByUserId
375
- };
376
- }
377
- //#endregion
378
- //#region extensions/msteams/src/errors.ts
379
- function formatUnknownError(err) {
380
- if (err instanceof Error) return err.message;
381
- if (typeof err === "string") return err;
382
- if (err === null) return "null";
383
- if (err === void 0) return "undefined";
384
- if (typeof err === "number" || typeof err === "boolean" || typeof err === "bigint") return String(err);
385
- if (typeof err === "symbol") return err.description ?? err.toString();
386
- if (typeof err === "function") return err.name ? `[function ${err.name}]` : "[function]";
387
- try {
388
- return JSON.stringify(err) ?? "unknown error";
389
- } catch {
390
- return "unknown error";
391
- }
392
- }
393
- function isRecord(value) {
394
- return typeof value === "object" && value !== null && !Array.isArray(value);
395
- }
396
- function extractStatusCode(err) {
397
- if (!isRecord(err)) return null;
398
- const direct = err.statusCode ?? err.status;
399
- if (typeof direct === "number" && Number.isFinite(direct)) return direct;
400
- if (typeof direct === "string") {
401
- const parsed = Number.parseInt(direct, 10);
402
- if (Number.isFinite(parsed)) return parsed;
403
- }
404
- const response = err.response;
405
- if (isRecord(response)) {
406
- const status = response.status;
407
- if (typeof status === "number" && Number.isFinite(status)) return status;
408
- if (typeof status === "string") {
409
- const parsed = Number.parseInt(status, 10);
410
- if (Number.isFinite(parsed)) return parsed;
411
- }
412
- }
413
- return null;
414
- }
415
- function extractRetryAfterMs(err) {
416
- if (!isRecord(err)) return null;
417
- const direct = err.retryAfterMs ?? err.retry_after_ms;
418
- if (typeof direct === "number" && Number.isFinite(direct) && direct >= 0) return direct;
419
- const retryAfter = err.retryAfter ?? err.retry_after;
420
- if (typeof retryAfter === "number" && Number.isFinite(retryAfter)) return retryAfter >= 0 ? retryAfter * 1e3 : null;
421
- if (typeof retryAfter === "string") {
422
- const parsed = Number.parseFloat(retryAfter);
423
- if (Number.isFinite(parsed) && parsed >= 0) return parsed * 1e3;
424
- }
425
- const response = err.response;
426
- if (!isRecord(response)) return null;
427
- const headers = response.headers;
428
- if (!headers) return null;
429
- if (isRecord(headers)) {
430
- const raw = headers["retry-after"] ?? headers["Retry-After"];
431
- if (typeof raw === "string") {
432
- const parsed = Number.parseFloat(raw);
433
- if (Number.isFinite(parsed) && parsed >= 0) return parsed * 1e3;
434
- }
435
- }
436
- if (typeof headers === "object" && headers !== null && "get" in headers && typeof headers.get === "function") {
437
- const raw = headers.get("retry-after");
438
- if (raw) {
439
- const parsed = Number.parseFloat(raw);
440
- if (Number.isFinite(parsed) && parsed >= 0) return parsed * 1e3;
441
- }
442
- }
443
- return null;
444
- }
445
- /**
446
- * Classify outbound send errors for safe retries and actionable logs.
447
- *
448
- * Important: We only mark errors as retryable when we have an explicit HTTP
449
- * status code that indicates the message was not accepted (e.g. 429, 5xx).
450
- * For transport-level errors where delivery is ambiguous, we prefer to avoid
451
- * retries to reduce the chance of duplicate posts.
452
- */
453
- function classifyMSTeamsSendError(err) {
454
- const statusCode = extractStatusCode(err);
455
- const retryAfterMs = extractRetryAfterMs(err);
456
- if (statusCode === 401 || statusCode === 403) return {
457
- kind: "auth",
458
- statusCode
459
- };
460
- if (statusCode === 429) return {
461
- kind: "throttled",
462
- statusCode,
463
- retryAfterMs: retryAfterMs ?? void 0
464
- };
465
- if (statusCode === 408 || statusCode != null && statusCode >= 500) return {
466
- kind: "transient",
467
- statusCode,
468
- retryAfterMs: retryAfterMs ?? void 0
469
- };
470
- if (statusCode != null && statusCode >= 400) return {
471
- kind: "permanent",
472
- statusCode
473
- };
474
- return {
475
- kind: "unknown",
476
- statusCode: statusCode ?? void 0,
477
- retryAfterMs: retryAfterMs ?? void 0
478
- };
479
- }
480
- /**
481
- * Detect whether an error is caused by a revoked Proxy.
482
- *
483
- * The Bot Framework SDK wraps TurnContext in a Proxy that is revoked once the
484
- * turn handler returns. Any later access (e.g. from a debounced callback)
485
- * throws a TypeError whose message contains the distinctive "proxy that has
486
- * been revoked" string.
487
- */
488
- function isRevokedProxyError(err) {
489
- if (!(err instanceof TypeError)) return false;
490
- return /proxy that has been revoked/i.test(err.message);
491
- }
492
- function formatMSTeamsSendErrorHint(classification) {
493
- if (classification.kind === "auth") return "check msteams appId/appPassword/tenantId (or env vars MSTEAMS_APP_ID/MSTEAMS_APP_PASSWORD/MSTEAMS_TENANT_ID)";
494
- if (classification.kind === "throttled") return "Teams throttled the bot; backing off may help";
495
- if (classification.kind === "transient") return "transient Teams/Bot Framework error; retry may succeed";
496
- }
497
- //#endregion
498
- //#region extensions/msteams/src/file-consent.ts
499
- /**
500
- * Build a FileConsentCard attachment for requesting upload permission.
501
- * Use this for files >= 4MB in personal (1:1) chats.
502
- */
503
- function buildFileConsentCard(params) {
504
- return {
505
- contentType: "application/vnd.microsoft.teams.card.file.consent",
506
- name: params.filename,
507
- content: {
508
- description: params.description ?? `File: ${params.filename}`,
509
- sizeInBytes: params.sizeInBytes,
510
- acceptContext: {
511
- filename: params.filename,
512
- ...params.context
513
- },
514
- declineContext: {
515
- filename: params.filename,
516
- ...params.context
517
- }
518
- }
519
- };
520
- }
521
- /**
522
- * Build a FileInfoCard attachment for confirming upload completion.
523
- * Send this after successfully uploading the file to the consent URL.
524
- */
525
- function buildFileInfoCard(params) {
526
- return {
527
- contentType: "application/vnd.microsoft.teams.card.file.info",
528
- contentUrl: params.contentUrl,
529
- name: params.filename,
530
- content: {
531
- uniqueId: params.uniqueId,
532
- fileType: params.fileType
533
- }
534
- };
535
- }
536
- /**
537
- * Parse a fileConsent/invoke activity.
538
- * Returns null if the activity is not a file consent invoke.
539
- */
540
- function parseFileConsentInvoke(activity) {
541
- if (activity.name !== "fileConsent/invoke") return null;
542
- const value = activity.value;
543
- if (value?.type !== "fileUpload") return null;
544
- return {
545
- action: value.action === "accept" ? "accept" : "decline",
546
- uploadInfo: value.uploadInfo,
547
- context: value.context
548
- };
549
- }
550
- /**
551
- * Upload a file to the consent URL provided by Teams.
552
- * The URL is provided in the fileConsent/invoke response after user accepts.
553
- */
554
- async function uploadToConsentUrl(params) {
555
- const res = await (params.fetchFn ?? fetch)(params.url, {
556
- method: "PUT",
557
- headers: {
558
- "Content-Type": params.contentType ?? "application/octet-stream",
559
- "Content-Range": `bytes 0-${params.buffer.length - 1}/${params.buffer.length}`
560
- },
561
- body: new Uint8Array(params.buffer)
562
- });
563
- if (!res.ok) throw new Error(`File upload to consent URL failed: ${res.status} ${res.statusText}`);
564
- }
565
- //#endregion
566
- //#region extensions/msteams/src/pending-uploads.ts
567
- /**
568
- * In-memory storage for files awaiting user consent in the FileConsentCard flow.
569
- *
570
- * When sending large files (>=4MB) in personal chats, Teams requires user consent
571
- * before upload. This module stores the file data temporarily until the user
572
- * accepts or declines, or until the TTL expires.
573
- */
574
- const pendingUploads = /* @__PURE__ */ new Map();
575
- /** TTL for pending uploads: 5 minutes */
576
- const PENDING_UPLOAD_TTL_MS = 300 * 1e3;
577
- /**
578
- * Store a file pending user consent.
579
- * Returns the upload ID to include in the FileConsentCard context.
580
- */
581
- function storePendingUpload(upload) {
582
- const id = crypto.randomUUID();
583
- const entry = {
584
- ...upload,
585
- id,
586
- createdAt: Date.now()
587
- };
588
- pendingUploads.set(id, entry);
589
- setTimeout(() => {
590
- pendingUploads.delete(id);
591
- }, PENDING_UPLOAD_TTL_MS);
592
- return id;
593
- }
594
- /**
595
- * Retrieve a pending upload by ID.
596
- * Returns undefined if not found or expired.
597
- */
598
- function getPendingUpload(id) {
599
- if (!id) return;
600
- const entry = pendingUploads.get(id);
601
- if (!entry) return;
602
- if (Date.now() - entry.createdAt > PENDING_UPLOAD_TTL_MS) {
603
- pendingUploads.delete(id);
604
- return;
605
- }
606
- return entry;
607
- }
608
- /**
609
- * Remove a pending upload (after successful upload or user decline).
610
- */
611
- function removePendingUpload(id) {
612
- if (id) pendingUploads.delete(id);
613
- }
614
- //#endregion
615
- //#region extensions/msteams/src/file-consent-helpers.ts
616
- /**
617
- * Shared helpers for FileConsentCard flow in MSTeams.
618
- *
619
- * FileConsentCard is required for:
620
- * - Personal (1:1) chats with large files (>=4MB)
621
- * - Personal chats with non-image files (PDFs, documents, etc.)
622
- *
623
- * This module consolidates the logic used by both send.ts (proactive sends)
624
- * and messenger.ts (reply path) to avoid duplication.
625
- */
626
- /**
627
- * Prepare a FileConsentCard activity for large files or non-images in personal chats.
628
- * Returns the activity object and uploadId - caller is responsible for sending.
629
- */
630
- function prepareFileConsentActivity(params) {
631
- const { media, conversationId, description } = params;
632
- const uploadId = storePendingUpload({
633
- buffer: media.buffer,
634
- filename: media.filename,
635
- contentType: media.contentType,
636
- conversationId
637
- });
638
- return {
639
- activity: {
640
- type: "message",
641
- attachments: [buildFileConsentCard({
642
- filename: media.filename,
643
- description: description || `File: ${media.filename}`,
644
- sizeInBytes: media.buffer.length,
645
- context: { uploadId }
646
- })]
647
- },
648
- uploadId
649
- };
650
- }
651
- /**
652
- * Check if a file requires FileConsentCard flow.
653
- * True for: personal chat AND (large file OR non-image)
654
- */
655
- function requiresFileConsent(params) {
656
- const isPersonal = params.conversationType?.toLowerCase() === "personal";
657
- const isImage = params.contentType?.startsWith("image/") ?? false;
658
- const isLargeFile = params.bufferSize >= params.thresholdBytes;
659
- return isPersonal && (isLargeFile || !isImage);
660
- }
661
- //#endregion
662
- //#region extensions/msteams/src/graph-chat.ts
663
- /**
664
- * Build a native Teams file card attachment for Bot Framework.
665
- *
666
- * This uses the `application/vnd.microsoft.teams.card.file.info` content type
667
- * which is supported by Bot Framework and produces native Teams file cards
668
- * (the same display as when a user manually shares a file).
669
- *
670
- * @param file - DriveItem properties from getDriveItemProperties()
671
- * @returns Attachment object for Bot Framework sendActivity()
672
- */
673
- function buildTeamsFileInfoCard(file) {
674
- const rawETag = file.eTag;
675
- const uniqueId = rawETag.replace(/^["']|["']$/g, "").replace(/[{}]/g, "").split(",")[0] ?? rawETag;
676
- const lastDot = file.name.lastIndexOf(".");
677
- const fileType = lastDot >= 0 ? file.name.slice(lastDot + 1).toLowerCase() : "";
678
- return {
679
- contentType: "application/vnd.microsoft.teams.card.file.info",
680
- contentUrl: file.webDavUrl,
681
- name: file.name,
682
- content: {
683
- uniqueId,
684
- fileType
685
- }
686
- };
687
- }
688
- //#endregion
689
- //#region extensions/msteams/src/graph-upload.ts
690
- const GRAPH_ROOT = "https://graph.microsoft.com/v1.0";
691
- const GRAPH_BETA = "https://graph.microsoft.com/beta";
692
- const GRAPH_SCOPE = "https://graph.microsoft.com";
693
- function parseUploadedDriveItem(data, label) {
694
- if (!data.id || !data.webUrl || !data.name) throw new Error(`${label} upload response missing required fields`);
695
- return {
696
- id: data.id,
697
- webUrl: data.webUrl,
698
- name: data.name
699
- };
700
- }
701
- async function uploadDriveItem(params) {
702
- const fetchFn = params.fetchFn ?? fetch;
703
- const token = await params.tokenProvider.getAccessToken(GRAPH_SCOPE);
704
- const res = await fetchFn(params.url, {
705
- method: "PUT",
706
- headers: {
707
- Authorization: `Bearer ${token}`,
708
- "Content-Type": params.contentType ?? "application/octet-stream"
709
- },
710
- body: new Uint8Array(params.buffer)
711
- });
712
- if (!res.ok) {
713
- const body = await res.text().catch(() => "");
714
- throw new Error(`${params.label} upload failed: ${res.status} ${res.statusText} - ${body}`);
715
- }
716
- return parseUploadedDriveItem(await res.json(), params.label);
717
- }
718
- /**
719
- * Upload a file to the user's OneDrive root folder.
720
- * For larger files, this uses the simple upload endpoint (up to 4MB).
721
- */
722
- async function uploadToOneDrive(params) {
723
- const uploadPath = `/MoldClawShared/${encodeURIComponent(params.filename)}`;
724
- return await uploadDriveItem({
725
- ...params,
726
- url: `${GRAPH_ROOT}/me/drive/root:${uploadPath}:/content`,
727
- label: "OneDrive"
728
- });
729
- }
730
- /**
731
- * Create a sharing link for a OneDrive file.
732
- * The link allows organization members to view the file.
733
- */
734
- async function createSharingLink(params) {
735
- const fetchFn = params.fetchFn ?? fetch;
736
- const token = await params.tokenProvider.getAccessToken(GRAPH_SCOPE);
737
- const res = await fetchFn(`${GRAPH_ROOT}/me/drive/items/${params.itemId}/createLink`, {
738
- method: "POST",
739
- headers: {
740
- Authorization: `Bearer ${token}`,
741
- "Content-Type": "application/json"
742
- },
743
- body: JSON.stringify({
744
- type: "view",
745
- scope: params.scope ?? "organization"
746
- })
747
- });
748
- if (!res.ok) {
749
- const body = await res.text().catch(() => "");
750
- throw new Error(`Create sharing link failed: ${res.status} ${res.statusText} - ${body}`);
751
- }
752
- const data = await res.json();
753
- if (!data.link?.webUrl) throw new Error("Create sharing link response missing webUrl");
754
- return { webUrl: data.link.webUrl };
755
- }
756
- /**
757
- * Upload a file to OneDrive and create a sharing link.
758
- * Convenience function for the common case.
759
- */
760
- async function uploadAndShareOneDrive(params) {
761
- const uploaded = await uploadToOneDrive({
762
- buffer: params.buffer,
763
- filename: params.filename,
764
- contentType: params.contentType,
765
- tokenProvider: params.tokenProvider,
766
- fetchFn: params.fetchFn
767
- });
768
- const shareLink = await createSharingLink({
769
- itemId: uploaded.id,
770
- tokenProvider: params.tokenProvider,
771
- scope: params.scope,
772
- fetchFn: params.fetchFn
773
- });
774
- return {
775
- itemId: uploaded.id,
776
- webUrl: uploaded.webUrl,
777
- shareUrl: shareLink.webUrl,
778
- name: uploaded.name
779
- };
780
- }
781
- /**
782
- * Upload a file to a SharePoint site.
783
- * This is used for group chats and channels where /me/drive doesn't work for bots.
784
- *
785
- * @param params.siteId - SharePoint site ID (e.g., "contoso.sharepoint.com,guid1,guid2")
786
- */
787
- async function uploadToSharePoint(params) {
788
- const uploadPath = `/MoldClawShared/${encodeURIComponent(params.filename)}`;
789
- return await uploadDriveItem({
790
- ...params,
791
- url: `${GRAPH_ROOT}/sites/${params.siteId}/drive/root:${uploadPath}:/content`,
792
- label: "SharePoint"
793
- });
794
- }
795
- /**
796
- * Get driveItem properties needed for native Teams file card attachments.
797
- * This fetches the eTag and webDavUrl which are required for "reference" type attachments.
798
- *
799
- * @param params.siteId - SharePoint site ID
800
- * @param params.itemId - The driveItem ID (returned from upload)
801
- */
802
- async function getDriveItemProperties(params) {
803
- const fetchFn = params.fetchFn ?? fetch;
804
- const token = await params.tokenProvider.getAccessToken(GRAPH_SCOPE);
805
- const res = await fetchFn(`${GRAPH_ROOT}/sites/${params.siteId}/drive/items/${params.itemId}?$select=eTag,webDavUrl,name`, { headers: { Authorization: `Bearer ${token}` } });
806
- if (!res.ok) {
807
- const body = await res.text().catch(() => "");
808
- throw new Error(`Get driveItem properties failed: ${res.status} ${res.statusText} - ${body}`);
809
- }
810
- const data = await res.json();
811
- if (!data.eTag || !data.webDavUrl || !data.name) throw new Error("DriveItem response missing required properties (eTag, webDavUrl, or name)");
812
- return {
813
- eTag: data.eTag,
814
- webDavUrl: data.webDavUrl,
815
- name: data.name
816
- };
817
- }
818
- /**
819
- * Get members of a Teams chat for per-user sharing.
820
- * Used to create sharing links scoped to only the chat participants.
821
- */
822
- async function getChatMembers(params) {
823
- const fetchFn = params.fetchFn ?? fetch;
824
- const token = await params.tokenProvider.getAccessToken(GRAPH_SCOPE);
825
- const res = await fetchFn(`${GRAPH_ROOT}/chats/${params.chatId}/members`, { headers: { Authorization: `Bearer ${token}` } });
826
- if (!res.ok) {
827
- const body = await res.text().catch(() => "");
828
- throw new Error(`Get chat members failed: ${res.status} ${res.statusText} - ${body}`);
829
- }
830
- return ((await res.json()).value ?? []).map((m) => ({
831
- aadObjectId: m.userId ?? "",
832
- displayName: m.displayName
833
- })).filter((m) => m.aadObjectId);
834
- }
835
- /**
836
- * Create a sharing link for a SharePoint drive item.
837
- * For organization scope (default), uses v1.0 API.
838
- * For per-user scope, uses beta API with recipients.
839
- */
840
- async function createSharePointSharingLink(params) {
841
- const fetchFn = params.fetchFn ?? fetch;
842
- const token = await params.tokenProvider.getAccessToken(GRAPH_SCOPE);
843
- const scope = params.scope ?? "organization";
844
- const apiRoot = scope === "users" ? GRAPH_BETA : GRAPH_ROOT;
845
- const body = {
846
- type: "view",
847
- scope: scope === "users" ? "users" : "organization"
848
- };
849
- if (scope === "users" && params.recipientObjectIds?.length) body.recipients = params.recipientObjectIds.map((id) => ({ objectId: id }));
850
- const res = await fetchFn(`${apiRoot}/sites/${params.siteId}/drive/items/${params.itemId}/createLink`, {
851
- method: "POST",
852
- headers: {
853
- Authorization: `Bearer ${token}`,
854
- "Content-Type": "application/json"
855
- },
856
- body: JSON.stringify(body)
857
- });
858
- if (!res.ok) {
859
- const respBody = await res.text().catch(() => "");
860
- throw new Error(`Create SharePoint sharing link failed: ${res.status} ${res.statusText} - ${respBody}`);
861
- }
862
- const data = await res.json();
863
- if (!data.link?.webUrl) throw new Error("Create SharePoint sharing link response missing webUrl");
864
- return { webUrl: data.link.webUrl };
865
- }
866
- /**
867
- * Upload a file to SharePoint and create a sharing link.
868
- *
869
- * For group chats, this creates a per-user sharing link scoped to chat members.
870
- * For channels, this creates an organization-wide sharing link.
871
- *
872
- * @param params.siteId - SharePoint site ID
873
- * @param params.chatId - Optional chat ID for per-user sharing (group chats)
874
- * @param params.usePerUserSharing - Whether to use per-user sharing (requires beta API + Chat.Read.All)
875
- */
876
- async function uploadAndShareSharePoint(params) {
877
- const uploaded = await uploadToSharePoint({
878
- buffer: params.buffer,
879
- filename: params.filename,
880
- contentType: params.contentType,
881
- tokenProvider: params.tokenProvider,
882
- siteId: params.siteId,
883
- fetchFn: params.fetchFn
884
- });
885
- let scope = "organization";
886
- let recipientObjectIds;
887
- if (params.usePerUserSharing && params.chatId) try {
888
- const members = await getChatMembers({
889
- chatId: params.chatId,
890
- tokenProvider: params.tokenProvider,
891
- fetchFn: params.fetchFn
892
- });
893
- if (members.length > 0) {
894
- scope = "users";
895
- recipientObjectIds = members.map((m) => m.aadObjectId);
896
- }
897
- } catch {}
898
- const shareLink = await createSharePointSharingLink({
899
- siteId: params.siteId,
900
- itemId: uploaded.id,
901
- tokenProvider: params.tokenProvider,
902
- scope,
903
- recipientObjectIds,
904
- fetchFn: params.fetchFn
905
- });
906
- return {
907
- itemId: uploaded.id,
908
- webUrl: uploaded.webUrl,
909
- shareUrl: shareLink.webUrl,
910
- name: uploaded.name
911
- };
912
- }
913
- //#endregion
914
- //#region extensions/msteams/src/media-helpers.ts
915
- /**
916
- * MIME type detection and filename extraction for MSTeams media attachments.
917
- */
918
- /**
919
- * Detect MIME type from URL extension or data URL.
920
- * Uses shared MIME detection for consistency with core handling.
921
- */
922
- async function getMimeType(url) {
923
- if (url.startsWith("data:")) {
924
- const match = url.match(/^data:([^;,]+)/);
925
- if (match?.[1]) return match[1];
926
- }
927
- return await detectMime({ filePath: url }) ?? "application/octet-stream";
928
- }
929
- /**
930
- * Extract filename from URL or local path.
931
- * For local paths, extracts original filename if stored with embedded name pattern.
932
- * Falls back to deriving the extension from MIME type when no extension present.
933
- */
934
- async function extractFilename(url) {
935
- if (url.startsWith("data:")) {
936
- const mime = await getMimeType(url);
937
- const ext = extensionForMime(mime) ?? ".bin";
938
- return `${mime.startsWith("image/") ? "image" : "file"}${ext}`;
939
- }
940
- try {
941
- const pathname = new URL(url).pathname;
942
- const basename = path.basename(pathname);
943
- const existingExt = getFileExtension(pathname);
944
- if (basename && existingExt) return basename;
945
- const mime = await getMimeType(url);
946
- const ext = extensionForMime(mime) ?? ".bin";
947
- const prefix = mime.startsWith("image/") ? "image" : "file";
948
- return basename ? `${basename}${ext}` : `${prefix}${ext}`;
949
- } catch {
950
- return extractOriginalFilename(url);
951
- }
952
- }
953
- /**
954
- * Check if a URL refers to a local file path.
955
- */
956
- function isLocalPath(url) {
957
- if (url.startsWith("file://") || url.startsWith("/") || url.startsWith("~")) return true;
958
- if (url.startsWith("\\") && !url.startsWith("\\\\")) return true;
959
- if (/^[a-zA-Z]:[\\/]/.test(url)) return true;
960
- if (url.startsWith("\\\\")) return true;
961
- return false;
962
- }
963
- /**
964
- * Extract the message ID from a Bot Framework response.
965
- */
966
- function extractMessageId(response) {
967
- if (!response || typeof response !== "object") return null;
968
- if (!("id" in response)) return null;
969
- const { id } = response;
970
- if (typeof id !== "string" || !id) return null;
971
- return id;
972
- }
973
- //#endregion
974
- //#region extensions/msteams/src/mentions.ts
975
- /**
976
- * Check whether an ID looks like a valid Teams user/bot identifier.
977
- * Accepts:
978
- * - Bot Framework IDs: "28:xxx..." / "29:xxx..." / "8:orgid:..."
979
- * - AAD object IDs (UUIDs): "d5318c29-33ac-4e6b-bd42-57b8b793908f"
980
- *
981
- * Keep this permissive enough for real Teams IDs while still rejecting
982
- * documentation placeholders like `@[表示名](ユーザーID)`.
983
- */
984
- const TEAMS_BOT_ID_PATTERN = /^\d+:[a-z0-9._=-]+(?::[a-z0-9._=-]+)*$/i;
985
- const AAD_OBJECT_ID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i;
986
- function isValidTeamsId(id) {
987
- return TEAMS_BOT_ID_PATTERN.test(id) || AAD_OBJECT_ID_PATTERN.test(id);
988
- }
989
- /**
990
- * Parse mentions from text in the format @[Name](id).
991
- * Example: "Hello @[John Doe](28:xxx-yyy-zzz)!"
992
- *
993
- * Only matches where the id looks like a real Teams user/bot ID are treated
994
- * as mentions. This avoids false positives from documentation or code samples
995
- * embedded in the message (e.g. `@[表示名](ユーザーID)` in backticks).
996
- *
997
- * Returns both the formatted text with <at> tags and the entities array.
998
- */
999
- function parseMentions(text) {
1000
- const mentionPattern = /@\[([^\]]+)\]\(([^)]+)\)/g;
1001
- const entities = [];
1002
- return {
1003
- text: text.replace(mentionPattern, (match, name, id) => {
1004
- const trimmedId = id.trim();
1005
- if (!isValidTeamsId(trimmedId)) return match;
1006
- const trimmedName = name.trim();
1007
- const mentionTag = `<at>${trimmedName}</at>`;
1008
- entities.push({
1009
- type: "mention",
1010
- text: mentionTag,
1011
- mentioned: {
1012
- id: trimmedId,
1013
- name: trimmedName
1014
- }
1015
- });
1016
- return mentionTag;
1017
- }),
1018
- entities
1019
- };
1020
- }
1021
- //#endregion
1022
- //#region extensions/msteams/src/revoked-context.ts
1023
- async function withRevokedProxyFallback(params) {
1024
- try {
1025
- return await params.run();
1026
- } catch (err) {
1027
- if (!isRevokedProxyError(err)) throw err;
1028
- params.onRevokedLog?.();
1029
- return await params.onRevoked();
1030
- }
1031
- }
1032
- //#endregion
1033
- //#region extensions/msteams/src/messenger.ts
1034
- /**
1035
- * MSTeams-specific media size limit (100MB).
1036
- * Higher than the default because OneDrive upload handles large files well.
1037
- */
1038
- const MSTEAMS_MAX_MEDIA_BYTES$1 = 100 * 1024 * 1024;
1039
- /**
1040
- * Threshold for large files that require FileConsentCard flow in personal chats.
1041
- * Files >= 4MB use consent flow; smaller images can use inline base64.
1042
- */
1043
- const FILE_CONSENT_THRESHOLD_BYTES$1 = 4 * 1024 * 1024;
1044
- function normalizeConversationId(rawId) {
1045
- return rawId.split(";")[0] ?? rawId;
1046
- }
1047
- function buildConversationReference(ref) {
1048
- const conversationId = ref.conversation?.id?.trim();
1049
- if (!conversationId) throw new Error("Invalid stored reference: missing conversation.id");
1050
- const agent = ref.agent ?? ref.bot ?? void 0;
1051
- if (agent == null || !agent.id) throw new Error("Invalid stored reference: missing agent.id");
1052
- const user = ref.user;
1053
- if (!user?.id) throw new Error("Invalid stored reference: missing user.id");
1054
- return {
1055
- activityId: ref.activityId,
1056
- user,
1057
- agent,
1058
- conversation: {
1059
- id: normalizeConversationId(conversationId),
1060
- conversationType: ref.conversation?.conversationType,
1061
- tenantId: ref.conversation?.tenantId
1062
- },
1063
- channelId: ref.channelId ?? "msteams",
1064
- serviceUrl: ref.serviceUrl,
1065
- locale: ref.locale
1066
- };
1067
- }
1068
- function pushTextMessages(out, text, opts) {
1069
- if (!text) return;
1070
- if (opts.chunkText) {
1071
- for (const chunk of getMSTeamsRuntime().channel.text.chunkMarkdownTextWithMode(text, opts.chunkLimit, opts.chunkMode)) {
1072
- const trimmed = chunk.trim();
1073
- if (!trimmed || isSilentReplyText(trimmed, "NO_REPLY")) continue;
1074
- out.push({ text: trimmed });
1075
- }
1076
- return;
1077
- }
1078
- const trimmed = text.trim();
1079
- if (!trimmed || isSilentReplyText(trimmed, "NO_REPLY")) return;
1080
- out.push({ text: trimmed });
1081
- }
1082
- function clampMs(value, maxMs) {
1083
- if (!Number.isFinite(value) || value < 0) return 0;
1084
- return Math.min(value, maxMs);
1085
- }
1086
- function resolveRetryOptions(retry) {
1087
- if (!retry) return {
1088
- enabled: false,
1089
- maxAttempts: 1,
1090
- baseDelayMs: 0,
1091
- maxDelayMs: 0
1092
- };
1093
- return {
1094
- enabled: true,
1095
- maxAttempts: Math.max(1, retry?.maxAttempts ?? 3),
1096
- baseDelayMs: Math.max(0, retry?.baseDelayMs ?? 250),
1097
- maxDelayMs: Math.max(0, retry?.maxDelayMs ?? 1e4)
1098
- };
1099
- }
1100
- function computeRetryDelayMs(attempt, classification, opts) {
1101
- if (classification.retryAfterMs != null) return clampMs(classification.retryAfterMs, opts.maxDelayMs);
1102
- return clampMs(opts.baseDelayMs * 2 ** Math.max(0, attempt - 1), opts.maxDelayMs);
1103
- }
1104
- function shouldRetry(classification) {
1105
- return classification.kind === "throttled" || classification.kind === "transient";
1106
- }
1107
- function renderReplyPayloadsToMessages(replies, options) {
1108
- const out = [];
1109
- const chunkLimit = Math.min(options.textChunkLimit, 4e3);
1110
- const chunkText = options.chunkText !== false;
1111
- const chunkMode = options.chunkMode ?? "length";
1112
- const mediaMode = options.mediaMode ?? "split";
1113
- const tableMode = options.tableMode ?? getMSTeamsRuntime().channel.text.resolveMarkdownTableMode({
1114
- cfg: getMSTeamsRuntime().config.loadConfig(),
1115
- channel: "msteams"
1116
- });
1117
- for (const payload of replies) {
1118
- const mediaList = payload.mediaUrls ?? (payload.mediaUrl ? [payload.mediaUrl] : []);
1119
- const text = getMSTeamsRuntime().channel.text.convertMarkdownTables(payload.text ?? "", tableMode);
1120
- if (!text && mediaList.length === 0) continue;
1121
- if (mediaList.length === 0) {
1122
- pushTextMessages(out, text, {
1123
- chunkText,
1124
- chunkLimit,
1125
- chunkMode
1126
- });
1127
- continue;
1128
- }
1129
- if (mediaMode === "inline") {
1130
- const firstMedia = mediaList[0];
1131
- if (firstMedia) {
1132
- out.push({
1133
- text: text || void 0,
1134
- mediaUrl: firstMedia
1135
- });
1136
- for (let i = 1; i < mediaList.length; i++) if (mediaList[i]) out.push({ mediaUrl: mediaList[i] });
1137
- } else pushTextMessages(out, text, {
1138
- chunkText,
1139
- chunkLimit,
1140
- chunkMode
1141
- });
1142
- continue;
1143
- }
1144
- pushTextMessages(out, text, {
1145
- chunkText,
1146
- chunkLimit,
1147
- chunkMode
1148
- });
1149
- for (const mediaUrl of mediaList) {
1150
- if (!mediaUrl) continue;
1151
- out.push({ mediaUrl });
1152
- }
1153
- }
1154
- return out;
1155
- }
1156
- async function buildActivity(msg, conversationRef, tokenProvider, sharePointSiteId, mediaMaxBytes) {
1157
- const activity = { type: "message" };
1158
- if (msg.text) {
1159
- const { text: formattedText, entities } = parseMentions(msg.text);
1160
- activity.text = formattedText;
1161
- if (entities.length > 0) activity.entities = entities;
1162
- }
1163
- if (msg.mediaUrl) {
1164
- let contentUrl = msg.mediaUrl;
1165
- let contentType = await getMimeType(msg.mediaUrl);
1166
- let fileName = await extractFilename(msg.mediaUrl);
1167
- if (isLocalPath(msg.mediaUrl)) {
1168
- const maxBytes = mediaMaxBytes ?? MSTEAMS_MAX_MEDIA_BYTES$1;
1169
- const media = await loadWebMedia(msg.mediaUrl, maxBytes);
1170
- contentType = media.contentType ?? contentType;
1171
- fileName = media.fileName ?? fileName;
1172
- const conversationType = conversationRef.conversation?.conversationType?.toLowerCase();
1173
- const isPersonal = conversationType === "personal";
1174
- const isImage = media.kind === "image";
1175
- if (requiresFileConsent({
1176
- conversationType,
1177
- contentType,
1178
- bufferSize: media.buffer.length,
1179
- thresholdBytes: FILE_CONSENT_THRESHOLD_BYTES$1
1180
- })) {
1181
- const conversationId = conversationRef.conversation?.id ?? "unknown";
1182
- const { activity: consentActivity } = prepareFileConsentActivity({
1183
- media: {
1184
- buffer: media.buffer,
1185
- filename: fileName,
1186
- contentType
1187
- },
1188
- conversationId,
1189
- description: msg.text || void 0
1190
- });
1191
- return consentActivity;
1192
- }
1193
- if (!isPersonal && !isImage && tokenProvider && sharePointSiteId) {
1194
- const chatId = conversationRef.conversation?.id;
1195
- activity.attachments = [buildTeamsFileInfoCard(await getDriveItemProperties({
1196
- siteId: sharePointSiteId,
1197
- itemId: (await uploadAndShareSharePoint({
1198
- buffer: media.buffer,
1199
- filename: fileName,
1200
- contentType,
1201
- tokenProvider,
1202
- siteId: sharePointSiteId,
1203
- chatId: chatId ?? void 0,
1204
- usePerUserSharing: conversationType === "groupchat"
1205
- })).itemId,
1206
- tokenProvider
1207
- }))];
1208
- return activity;
1209
- }
1210
- if (!isPersonal && media.kind !== "image" && tokenProvider) {
1211
- const uploaded = await uploadAndShareOneDrive({
1212
- buffer: media.buffer,
1213
- filename: fileName,
1214
- contentType,
1215
- tokenProvider
1216
- });
1217
- const fileLink = `📎 [${uploaded.name}](${uploaded.shareUrl})`;
1218
- const existingText = typeof activity.text === "string" ? activity.text : void 0;
1219
- activity.text = existingText ? `${existingText}\n\n${fileLink}` : fileLink;
1220
- return activity;
1221
- }
1222
- const base64 = media.buffer.toString("base64");
1223
- contentUrl = `data:${media.contentType};base64,${base64}`;
1224
- }
1225
- activity.attachments = [{
1226
- name: fileName,
1227
- contentType,
1228
- contentUrl
1229
- }];
1230
- }
1231
- return activity;
1232
- }
1233
- async function sendMSTeamsMessages(params) {
1234
- const messages = params.messages.filter((m) => m.text && m.text.trim().length > 0 || m.mediaUrl);
1235
- if (messages.length === 0) return [];
1236
- const retryOptions = resolveRetryOptions(params.retry);
1237
- const sendWithRetry = async (sendOnce, meta) => {
1238
- if (!retryOptions.enabled) return await sendOnce();
1239
- let attempt = 1;
1240
- while (true) try {
1241
- return await sendOnce();
1242
- } catch (err) {
1243
- const classification = classifyMSTeamsSendError(err);
1244
- if (!(attempt < retryOptions.maxAttempts && shouldRetry(classification))) throw err;
1245
- const delayMs = computeRetryDelayMs(attempt, classification, retryOptions);
1246
- const nextAttempt = attempt + 1;
1247
- params.onRetry?.({
1248
- messageIndex: meta.messageIndex,
1249
- messageCount: meta.messageCount,
1250
- nextAttempt,
1251
- maxAttempts: retryOptions.maxAttempts,
1252
- delayMs,
1253
- classification
1254
- });
1255
- await sleep(delayMs);
1256
- attempt = nextAttempt;
1257
- }
1258
- };
1259
- const sendMessageInContext = async (ctx, message, messageIndex) => {
1260
- return extractMessageId(await sendWithRetry(async () => await ctx.sendActivity(await buildActivity(message, params.conversationRef, params.tokenProvider, params.sharePointSiteId, params.mediaMaxBytes)), {
1261
- messageIndex,
1262
- messageCount: messages.length
1263
- })) ?? "unknown";
1264
- };
1265
- const sendMessageBatchInContext = async (ctx, batch, startIndex) => {
1266
- const messageIds = [];
1267
- for (const [idx, message] of batch.entries()) messageIds.push(await sendMessageInContext(ctx, message, startIndex + idx));
1268
- return messageIds;
1269
- };
1270
- const sendProactively = async (batch, startIndex) => {
1271
- const proactiveRef = {
1272
- ...buildConversationReference(params.conversationRef),
1273
- activityId: void 0
1274
- };
1275
- const messageIds = [];
1276
- await params.adapter.continueConversation(params.appId, proactiveRef, async (ctx) => {
1277
- messageIds.push(...await sendMessageBatchInContext(ctx, batch, startIndex));
1278
- });
1279
- return messageIds;
1280
- };
1281
- if (params.replyStyle === "thread") {
1282
- const ctx = params.context;
1283
- if (!ctx) throw new Error("Missing context for replyStyle=thread");
1284
- const messageIds = [];
1285
- for (const [idx, message] of messages.entries()) {
1286
- const result = await withRevokedProxyFallback({
1287
- run: async () => ({
1288
- ids: [await sendMessageInContext(ctx, message, idx)],
1289
- fellBack: false
1290
- }),
1291
- onRevoked: async () => {
1292
- const remaining = messages.slice(idx);
1293
- return {
1294
- ids: remaining.length > 0 ? await sendProactively(remaining, idx) : [],
1295
- fellBack: true
1296
- };
1297
- }
1298
- });
1299
- messageIds.push(...result.ids);
1300
- if (result.fellBack) return messageIds;
1301
- }
1302
- return messageIds;
1303
- }
1304
- return await sendProactively(messages, 0);
1305
- }
1306
- //#endregion
1307
- //#region extensions/msteams/src/send-context.ts
1308
- /**
1309
- * Parse the target value into a conversation reference lookup key.
1310
- * Supported formats:
1311
- * - conversation:19:abc@thread.tacv2 → lookup by conversation ID
1312
- * - user:aad-object-id → lookup by user AAD object ID
1313
- * - 19:abc@thread.tacv2 → direct conversation ID
1314
- */
1315
- function parseRecipient(to) {
1316
- const trimmed = to.trim();
1317
- const finalize = (type, id) => {
1318
- const normalized = id.trim();
1319
- if (!normalized) throw new Error(`Invalid target value: missing ${type} id`);
1320
- return {
1321
- type,
1322
- id: normalized
1323
- };
1324
- };
1325
- if (trimmed.startsWith("conversation:")) return finalize("conversation", trimmed.slice(13));
1326
- if (trimmed.startsWith("user:")) return finalize("user", trimmed.slice(5));
1327
- if (trimmed.startsWith("19:") || trimmed.includes("@thread")) return finalize("conversation", trimmed);
1328
- return finalize("user", trimmed);
1329
- }
1330
- /**
1331
- * Find a stored conversation reference for the given recipient.
1332
- */
1333
- async function findConversationReference(recipient) {
1334
- if (recipient.type === "conversation") {
1335
- const ref = await recipient.store.get(recipient.id);
1336
- if (ref) return {
1337
- conversationId: recipient.id,
1338
- ref
1339
- };
1340
- return null;
1341
- }
1342
- const found = await recipient.store.findByUserId(recipient.id);
1343
- if (!found) return null;
1344
- return {
1345
- conversationId: found.conversationId,
1346
- ref: found.reference
1347
- };
1348
- }
1349
- async function resolveMSTeamsSendContext(params) {
1350
- const msteamsCfg = params.cfg.channels?.msteams;
1351
- if (!msteamsCfg?.enabled) throw new Error("msteams provider is not enabled");
1352
- const creds = resolveMSTeamsCredentials(msteamsCfg);
1353
- if (!creds) throw new Error("msteams credentials not configured");
1354
- const store = createMSTeamsConversationStoreFs();
1355
- const recipient = parseRecipient(params.to);
1356
- const found = await findConversationReference({
1357
- ...recipient,
1358
- store
1359
- });
1360
- if (!found) throw new Error(`No conversation reference found for ${recipient.type}:${recipient.id}. The bot must receive a message from this conversation before it can send proactively.`);
1361
- const { conversationId, ref } = found;
1362
- const log = getMSTeamsRuntime().logging.getChildLogger({ name: "msteams:send" });
1363
- const { sdk, authConfig } = await loadMSTeamsSdkWithAuth(creds);
1364
- const adapter = createMSTeamsAdapter(authConfig, sdk);
1365
- const tokenProvider = new sdk.MsalTokenProvider(authConfig);
1366
- const storedConversationType = ref.conversation?.conversationType?.toLowerCase() ?? "";
1367
- let conversationType;
1368
- if (storedConversationType === "personal") conversationType = "personal";
1369
- else if (storedConversationType === "channel") conversationType = "channel";
1370
- else conversationType = "groupChat";
1371
- const sharePointSiteId = msteamsCfg.sharePointSiteId;
1372
- const mediaMaxBytes = resolveChannelMediaMaxBytes({
1373
- cfg: params.cfg,
1374
- resolveChannelLimitMb: ({ cfg }) => cfg.channels?.msteams?.mediaMaxMb
1375
- });
1376
- return {
1377
- appId: creds.appId,
1378
- conversationId,
1379
- ref,
1380
- adapter,
1381
- log,
1382
- conversationType,
1383
- tokenProvider,
1384
- sharePointSiteId,
1385
- mediaMaxBytes
1386
- };
1387
- }
1388
- //#endregion
1389
- //#region extensions/msteams/src/send.ts
1390
- /** Threshold for large files that require FileConsentCard flow in personal chats */
1391
- const FILE_CONSENT_THRESHOLD_BYTES = 4 * 1024 * 1024;
1392
- /**
1393
- * MSTeams-specific media size limit (100MB).
1394
- * Higher than the default because OneDrive upload handles large files well.
1395
- */
1396
- const MSTEAMS_MAX_MEDIA_BYTES = 100 * 1024 * 1024;
1397
- /**
1398
- * Send a message to a Teams conversation or user.
1399
- *
1400
- * Uses the stored ConversationReference from previous interactions.
1401
- * The bot must have received at least one message from the conversation
1402
- * before proactive messaging works.
1403
- *
1404
- * File handling by conversation type:
1405
- * - Personal (1:1) chats: small images (<4MB) use base64, large files and non-images use FileConsentCard
1406
- * - Group chats / channels: files are uploaded to OneDrive and shared via link
1407
- */
1408
- async function sendMessageMSTeams(params) {
1409
- const { cfg, to, text, mediaUrl, mediaLocalRoots } = params;
1410
- const tableMode = getMSTeamsRuntime().channel.text.resolveMarkdownTableMode({
1411
- cfg,
1412
- channel: "msteams"
1413
- });
1414
- const messageText = getMSTeamsRuntime().channel.text.convertMarkdownTables(text ?? "", tableMode);
1415
- const ctx = await resolveMSTeamsSendContext({
1416
- cfg,
1417
- to
1418
- });
1419
- const { adapter, appId, conversationId, ref, log, conversationType, tokenProvider, sharePointSiteId } = ctx;
1420
- log.debug?.("sending proactive message", {
1421
- conversationId,
1422
- conversationType,
1423
- textLength: messageText.length,
1424
- hasMedia: Boolean(mediaUrl)
1425
- });
1426
- if (mediaUrl) {
1427
- const media = await loadOutboundMediaFromUrl(mediaUrl, {
1428
- maxBytes: ctx.mediaMaxBytes ?? MSTEAMS_MAX_MEDIA_BYTES,
1429
- mediaLocalRoots
1430
- });
1431
- const isLargeFile = media.buffer.length >= FILE_CONSENT_THRESHOLD_BYTES;
1432
- const isImage = media.contentType?.startsWith("image/") ?? false;
1433
- const fallbackFileName = await extractFilename(mediaUrl);
1434
- const fileName = media.fileName ?? fallbackFileName;
1435
- log.debug?.("processing media", {
1436
- fileName,
1437
- contentType: media.contentType,
1438
- size: media.buffer.length,
1439
- isLargeFile,
1440
- isImage,
1441
- conversationType
1442
- });
1443
- if (requiresFileConsent({
1444
- conversationType,
1445
- contentType: media.contentType,
1446
- bufferSize: media.buffer.length,
1447
- thresholdBytes: FILE_CONSENT_THRESHOLD_BYTES
1448
- })) {
1449
- const { activity, uploadId } = prepareFileConsentActivity({
1450
- media: {
1451
- buffer: media.buffer,
1452
- filename: fileName,
1453
- contentType: media.contentType
1454
- },
1455
- conversationId,
1456
- description: messageText || void 0
1457
- });
1458
- log.debug?.("sending file consent card", {
1459
- uploadId,
1460
- fileName,
1461
- size: media.buffer.length
1462
- });
1463
- const messageId = await sendProactiveActivity({
1464
- adapter,
1465
- appId,
1466
- ref,
1467
- activity,
1468
- errorPrefix: "msteams consent card send"
1469
- });
1470
- log.info("sent file consent card", {
1471
- conversationId,
1472
- messageId,
1473
- uploadId
1474
- });
1475
- return {
1476
- messageId,
1477
- conversationId,
1478
- pendingUploadId: uploadId
1479
- };
1480
- }
1481
- if (conversationType === "personal") {
1482
- const base64 = media.buffer.toString("base64");
1483
- return sendTextWithMedia(ctx, messageText, `data:${media.contentType};base64,${base64}`);
1484
- }
1485
- if (isImage && !sharePointSiteId) {
1486
- const base64 = media.buffer.toString("base64");
1487
- return sendTextWithMedia(ctx, messageText, `data:${media.contentType};base64,${base64}`);
1488
- }
1489
- try {
1490
- if (sharePointSiteId) {
1491
- log.debug?.("uploading to SharePoint for native file card", {
1492
- fileName,
1493
- conversationType,
1494
- siteId: sharePointSiteId
1495
- });
1496
- const uploaded = await uploadAndShareSharePoint({
1497
- buffer: media.buffer,
1498
- filename: fileName,
1499
- contentType: media.contentType,
1500
- tokenProvider,
1501
- siteId: sharePointSiteId,
1502
- chatId: conversationId,
1503
- usePerUserSharing: conversationType === "groupChat"
1504
- });
1505
- log.debug?.("SharePoint upload complete", {
1506
- itemId: uploaded.itemId,
1507
- shareUrl: uploaded.shareUrl
1508
- });
1509
- const driveItem = await getDriveItemProperties({
1510
- siteId: sharePointSiteId,
1511
- itemId: uploaded.itemId,
1512
- tokenProvider
1513
- });
1514
- log.debug?.("driveItem properties retrieved", {
1515
- eTag: driveItem.eTag,
1516
- webDavUrl: driveItem.webDavUrl
1517
- });
1518
- const fileCardAttachment = buildTeamsFileInfoCard(driveItem);
1519
- const messageId = await sendProactiveActivityRaw({
1520
- adapter,
1521
- appId,
1522
- ref,
1523
- activity: {
1524
- type: "message",
1525
- text: messageText || void 0,
1526
- attachments: [fileCardAttachment]
1527
- }
1528
- });
1529
- log.info("sent native file card", {
1530
- conversationId,
1531
- messageId,
1532
- fileName: driveItem.name
1533
- });
1534
- return {
1535
- messageId,
1536
- conversationId
1537
- };
1538
- }
1539
- log.debug?.("uploading to OneDrive (no SharePoint site configured)", {
1540
- fileName,
1541
- conversationType
1542
- });
1543
- const uploaded = await uploadAndShareOneDrive({
1544
- buffer: media.buffer,
1545
- filename: fileName,
1546
- contentType: media.contentType,
1547
- tokenProvider
1548
- });
1549
- log.debug?.("OneDrive upload complete", {
1550
- itemId: uploaded.itemId,
1551
- shareUrl: uploaded.shareUrl
1552
- });
1553
- const fileLink = `📎 [${uploaded.name}](${uploaded.shareUrl})`;
1554
- const messageId = await sendProactiveActivityRaw({
1555
- adapter,
1556
- appId,
1557
- ref,
1558
- activity: {
1559
- type: "message",
1560
- text: messageText ? `${messageText}\n\n${fileLink}` : fileLink
1561
- }
1562
- });
1563
- log.info("sent message with OneDrive file link", {
1564
- conversationId,
1565
- messageId,
1566
- shareUrl: uploaded.shareUrl
1567
- });
1568
- return {
1569
- messageId,
1570
- conversationId
1571
- };
1572
- } catch (err) {
1573
- const classification = classifyMSTeamsSendError(err);
1574
- const hint = formatMSTeamsSendErrorHint(classification);
1575
- const status = classification.statusCode ? ` (HTTP ${classification.statusCode})` : "";
1576
- throw new Error(`msteams file send failed${status}: ${formatUnknownError(err)}${hint ? ` (${hint})` : ""}`, { cause: err });
1577
- }
1578
- }
1579
- return sendTextWithMedia(ctx, messageText, void 0);
1580
- }
1581
- /**
1582
- * Send a text message with optional base64 media URL.
1583
- */
1584
- async function sendTextWithMedia(ctx, text, mediaUrl) {
1585
- const { adapter, appId, conversationId, ref, log, tokenProvider, sharePointSiteId, mediaMaxBytes } = ctx;
1586
- let messageIds;
1587
- try {
1588
- messageIds = await sendMSTeamsMessages({
1589
- replyStyle: "top-level",
1590
- adapter,
1591
- appId,
1592
- conversationRef: ref,
1593
- messages: [{
1594
- text: text || void 0,
1595
- mediaUrl
1596
- }],
1597
- retry: {},
1598
- onRetry: (event) => {
1599
- log.debug?.("retrying send", {
1600
- conversationId,
1601
- ...event
1602
- });
1603
- },
1604
- tokenProvider,
1605
- sharePointSiteId,
1606
- mediaMaxBytes
1607
- });
1608
- } catch (err) {
1609
- const classification = classifyMSTeamsSendError(err);
1610
- const hint = formatMSTeamsSendErrorHint(classification);
1611
- const status = classification.statusCode ? ` (HTTP ${classification.statusCode})` : "";
1612
- throw new Error(`msteams send failed${status}: ${formatUnknownError(err)}${hint ? ` (${hint})` : ""}`, { cause: err });
1613
- }
1614
- const messageId = messageIds[0] ?? "unknown";
1615
- log.info("sent proactive message", {
1616
- conversationId,
1617
- messageId
1618
- });
1619
- return {
1620
- messageId,
1621
- conversationId
1622
- };
1623
- }
1624
- async function sendProactiveActivityRaw({ adapter, appId, ref, activity }) {
1625
- const proactiveRef = {
1626
- ...buildConversationReference(ref),
1627
- activityId: void 0
1628
- };
1629
- let messageId = "unknown";
1630
- await adapter.continueConversation(appId, proactiveRef, async (ctx) => {
1631
- messageId = extractMessageId(await ctx.sendActivity(activity)) ?? "unknown";
1632
- });
1633
- return messageId;
1634
- }
1635
- async function sendProactiveActivity({ adapter, appId, ref, activity, errorPrefix }) {
1636
- try {
1637
- return await sendProactiveActivityRaw({
1638
- adapter,
1639
- appId,
1640
- ref,
1641
- activity
1642
- });
1643
- } catch (err) {
1644
- const classification = classifyMSTeamsSendError(err);
1645
- const hint = formatMSTeamsSendErrorHint(classification);
1646
- const status = classification.statusCode ? ` (HTTP ${classification.statusCode})` : "";
1647
- throw new Error(`${errorPrefix} failed${status}: ${formatUnknownError(err)}${hint ? ` (${hint})` : ""}`, { cause: err });
1648
- }
1649
- }
1650
- /**
1651
- * Send a poll (Adaptive Card) to a Teams conversation or user.
1652
- */
1653
- async function sendPollMSTeams(params) {
1654
- const { cfg, to, question, options, maxSelections } = params;
1655
- const { adapter, appId, conversationId, ref, log } = await resolveMSTeamsSendContext({
1656
- cfg,
1657
- to
1658
- });
1659
- const pollCard = buildMSTeamsPollCard({
1660
- question,
1661
- options,
1662
- maxSelections
1663
- });
1664
- log.debug?.("sending poll", {
1665
- conversationId,
1666
- pollId: pollCard.pollId,
1667
- optionCount: pollCard.options.length
1668
- });
1669
- const messageId = await sendProactiveActivity({
1670
- adapter,
1671
- appId,
1672
- ref,
1673
- activity: {
1674
- type: "message",
1675
- attachments: [{
1676
- contentType: "application/vnd.microsoft.card.adaptive",
1677
- content: pollCard.card
1678
- }]
1679
- },
1680
- errorPrefix: "msteams poll send"
1681
- });
1682
- log.info("sent poll", {
1683
- conversationId,
1684
- pollId: pollCard.pollId,
1685
- messageId
1686
- });
1687
- return {
1688
- pollId: pollCard.pollId,
1689
- messageId,
1690
- conversationId
1691
- };
1692
- }
1693
- /**
1694
- * Send an arbitrary Adaptive Card to a Teams conversation or user.
1695
- */
1696
- async function sendAdaptiveCardMSTeams(params) {
1697
- const { cfg, to, card } = params;
1698
- const { adapter, appId, conversationId, ref, log } = await resolveMSTeamsSendContext({
1699
- cfg,
1700
- to
1701
- });
1702
- log.debug?.("sending adaptive card", {
1703
- conversationId,
1704
- cardType: card.type,
1705
- cardVersion: card.version
1706
- });
1707
- const messageId = await sendProactiveActivity({
1708
- adapter,
1709
- appId,
1710
- ref,
1711
- activity: {
1712
- type: "message",
1713
- attachments: [{
1714
- contentType: "application/vnd.microsoft.card.adaptive",
1715
- content: card
1716
- }]
1717
- },
1718
- errorPrefix: "msteams card send"
1719
- });
1720
- log.info("sent adaptive card", {
1721
- conversationId,
1722
- messageId
1723
- });
1724
- return {
1725
- messageId,
1726
- conversationId
1727
- };
1728
- }
1729
- //#endregion
1730
- //#region extensions/msteams/src/probe.ts
1731
- function decodeJwtPayload(token) {
1732
- const parts = token.split(".");
1733
- if (parts.length < 2) return null;
1734
- const payload = parts[1] ?? "";
1735
- const normalized = payload.padEnd(payload.length + (4 - payload.length % 4) % 4, "=").replace(/-/g, "+").replace(/_/g, "/");
1736
- try {
1737
- const decoded = Buffer.from(normalized, "base64").toString("utf8");
1738
- const parsed = JSON.parse(decoded);
1739
- return parsed && typeof parsed === "object" ? parsed : null;
1740
- } catch {
1741
- return null;
1742
- }
1743
- }
1744
- function readStringArray(value) {
1745
- if (!Array.isArray(value)) return;
1746
- const out = normalizeStringEntries(value);
1747
- return out.length > 0 ? out : void 0;
1748
- }
1749
- function readScopes(value) {
1750
- if (typeof value !== "string") return;
1751
- const out = value.split(/\s+/).map((entry) => entry.trim()).filter(Boolean);
1752
- return out.length > 0 ? out : void 0;
1753
- }
1754
- async function probeMSTeams(cfg) {
1755
- const creds = resolveMSTeamsCredentials(cfg);
1756
- if (!creds) return {
1757
- ok: false,
1758
- error: "missing credentials (appId, appPassword, tenantId)"
1759
- };
1760
- try {
1761
- const { sdk, authConfig } = await loadMSTeamsSdkWithAuth(creds);
1762
- const tokenProvider = new sdk.MsalTokenProvider(authConfig);
1763
- await tokenProvider.getAccessToken("https://api.botframework.com");
1764
- let graph;
1765
- try {
1766
- const accessToken = readAccessToken(await tokenProvider.getAccessToken("https://graph.microsoft.com"));
1767
- const payload = accessToken ? decodeJwtPayload(accessToken) : null;
1768
- graph = {
1769
- ok: true,
1770
- roles: readStringArray(payload?.roles),
1771
- scopes: readScopes(payload?.scp)
1772
- };
1773
- } catch (err) {
1774
- graph = {
1775
- ok: false,
1776
- error: formatUnknownError(err)
1777
- };
1778
- }
1779
- return {
1780
- ok: true,
1781
- appId: creds.appId,
1782
- ...graph ? { graph } : {}
1783
- };
1784
- } catch (err) {
1785
- return {
1786
- ok: false,
1787
- appId: creds.appId,
1788
- error: formatUnknownError(err)
1789
- };
1790
- }
1791
- }
1792
- //#endregion
1793
- export { createMSTeamsConversationStoreFs as _, buildConversationReference as a, withRevokedProxyFallback as c, buildFileInfoCard as d, parseFileConsentInvoke as f, formatUnknownError as g, formatMSTeamsSendErrorHint as h, sendPollMSTeams as i, getPendingUpload as l, classifyMSTeamsSendError as m, sendAdaptiveCardMSTeams as n, renderReplyPayloadsToMessages as o, uploadToConsentUrl as p, sendMessageMSTeams as r, sendMSTeamsMessages as s, probeMSTeams as t, removePendingUpload as u, createMSTeamsPollStoreFs as v, extractMSTeamsPollVote as y };