@agenticmail/enterprise 0.5.324 → 0.5.326

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 (449) hide show
  1. package/dist/{agent-heartbeat-77N4OOQL.js → agent-heartbeat-ZFKA6GMI.js} +2 -2
  2. package/dist/{agent-tools-BNSTIK4P.js → agent-tools-R6RSBDJQ.js} +25 -25
  3. package/dist/{agenticmail-EDO5XOTP.js → agenticmail-QMWQNUY2.js} +1 -1
  4. package/dist/{browser-tool-JF3LNRGX.js → browser-tool-4KWE37RL.js} +4 -4
  5. package/dist/{chunk-JEGYVXYC.js → chunk-CQV7GGHT.js} +1 -1
  6. package/dist/{chunk-CQYLRIQ3.js → chunk-DWHJYAV6.js} +143 -26
  7. package/dist/{chunk-HKCKMCPY.js → chunk-G4YSECQ4.js} +2 -2
  8. package/dist/{chunk-DM7FTF7W.js → chunk-GNABVGDZ.js} +31 -32
  9. package/dist/{chunk-DMD24UFZ.js → chunk-HTT6LUPP.js} +19 -19
  10. package/dist/{chunk-3FMK32KQ.js → chunk-LHQP7QRX.js} +9 -9
  11. package/dist/{chunk-6C5PKREN.js → chunk-NOAQG5CY.js} +1 -1
  12. package/dist/{chunk-4EKXYIJF.js → chunk-PAHT4ABL.js} +4 -4
  13. package/dist/{chunk-JNMDD7JY.js → chunk-RHO7WRVJ.js} +5 -5
  14. package/dist/{chunk-BQM7MBPS.js → chunk-WYDVMFGJ.js} +5 -5
  15. package/dist/{chunk-TPLVQFXM.js → chunk-X2YL6KSY.js} +13 -13
  16. package/dist/{cli-agent-USMKX7WN.js → cli-agent-2NBPF3GN.js} +11 -11
  17. package/dist/{cli-recover-XEZ2SKPU.js → cli-recover-TTOR7CJR.js} +2 -2
  18. package/dist/{cli-serve-BDGOOOKQ.js → cli-serve-5VFU4GR4.js} +3 -3
  19. package/dist/{cli-verify-CZIITRED.js → cli-verify-WICBVLAM.js} +2 -2
  20. package/dist/cli.js +5 -5
  21. package/dist/{connection-manager-KAWEUWUR.js → connection-manager-Y7CCQK4X.js} +1 -1
  22. package/dist/dashboard/docs/cluster.html +285 -0
  23. package/dist/dashboard/pages/cluster.js +400 -69
  24. package/dist/{deployer-3YK4RPUL.js → deployer-7NG7LCJW.js} +1 -1
  25. package/dist/{factory-JFWXTAWK.js → factory-4V2W4BSV.js} +1 -1
  26. package/dist/index.js +9 -9
  27. package/dist/{integrations-TF4EBCJ7.js → integrations-V2WXFDIV.js} +13 -13
  28. package/dist/{local-6MLIZDKO.js → local-OXFH4V7E.js} +2 -2
  29. package/dist/{meeting-voice-intelligence-CJLR52YV.js → meeting-voice-intelligence-RZZCAD6G.js} +2 -2
  30. package/dist/{meetings-FJ453ENF.js → meetings-SQNTB6GD.js} +1 -1
  31. package/dist/{microsoft-2IIHDLJB.js → microsoft-2PDVV6HX.js} +3 -3
  32. package/dist/{postgres-WGUVC2S7.js → postgres-USXBPTHX.js} +2 -2
  33. package/dist/{pw-ai-IBEF6HBF.js → pw-ai-NK5GKBDG.js} +1 -1
  34. package/dist/{routes-XYR2RNEC.js → routes-T3CDAQTD.js} +4 -4
  35. package/dist/{runtime-6BULDBR3.js → runtime-X4BTVICL.js} +1 -1
  36. package/dist/{server-7NT4LMSQ.js → server-WQ6LLYGB.js} +5 -5
  37. package/dist/{setup-2JBXMUDS.js → setup-6DRKSOMH.js} +2 -2
  38. package/dist/{skills-FR7I5V7H.js → skills-EL4RTJKK.js} +1 -1
  39. package/logs/cloudflared-error.log +14 -0
  40. package/logs/enterprise-out.log +2 -0
  41. package/package.json +1 -1
  42. package/src/admin/routes.ts +1 -1
  43. package/src/agent-tools/tool-resolver.ts +1 -1
  44. package/src/agent-tools/tools/agenticmail.ts +2 -2
  45. package/src/agent-tools/tools/browser.ts +1 -1
  46. package/src/agent-tools/tools/enterprise-code-sandbox.ts +1 -1
  47. package/src/agent-tools/tools/enterprise-diff.ts +1 -1
  48. package/src/agent-tools/tools/enterprise-http.ts +1 -3
  49. package/src/agent-tools/tools/enterprise-security-scan.ts +1 -1
  50. package/src/agent-tools/tools/google/forms.ts +2 -2
  51. package/src/agent-tools/tools/google/gmail.ts +1 -1
  52. package/src/agent-tools/tools/google/maps.ts +2 -2
  53. package/src/agent-tools/tools/google/meeting-voice.ts +1 -1
  54. package/src/agent-tools/tools/google/meetings.ts +1 -1
  55. package/src/agent-tools/tools/google/slides.ts +2 -2
  56. package/src/agent-tools/tools/grep.ts +1 -1
  57. package/src/agent-tools/tools/knowledge-search.ts +1 -1
  58. package/src/agent-tools/tools/local/coding.ts +5 -5
  59. package/src/agent-tools/tools/microsoft/excel-vba.ts +1 -1
  60. package/src/agent-tools/tools/microsoft/excel.ts +1 -1
  61. package/src/agent-tools/tools/microsoft/powerpoint.ts +1 -1
  62. package/src/agent-tools/tools/visual-memory/index.ts +11 -11
  63. package/src/agent-tools/tools/visual-memory/similarity.ts +2 -2
  64. package/src/agent-tools/tools/visual-memory/storage.ts +1 -1
  65. package/src/agenticmail/providers/imap.ts +2 -2
  66. package/src/browser/enterprise-compat.ts +1 -1
  67. package/src/cli-agent.ts +3 -3
  68. package/src/cli-serve.ts +1 -1
  69. package/src/dashboard/docs/cluster.html +285 -0
  70. package/src/dashboard/pages/cluster.js +400 -69
  71. package/src/database-access/connection-manager.ts +6 -6
  72. package/src/database-access/routes.ts +0 -1
  73. package/src/db/dynamodb.ts +1 -1
  74. package/src/db/postgres.ts +2 -2
  75. package/src/deploy/fly.ts +4 -4
  76. package/src/deploy/managed.ts +0 -1
  77. package/src/engine/agent-config.ts +1 -1
  78. package/src/engine/agent-heartbeat.ts +1 -1
  79. package/src/engine/agent-hierarchy.ts +1 -1
  80. package/src/engine/agent-memory.ts +1 -1
  81. package/src/engine/agent-routes.ts +2 -2
  82. package/src/engine/chat-poller.ts +1 -1
  83. package/src/engine/cluster.ts +14 -1
  84. package/src/engine/community-registry.ts +2 -2
  85. package/src/engine/db-adapter.ts +0 -1
  86. package/src/engine/deployer.ts +8 -8
  87. package/src/engine/email-poller.ts +1 -1
  88. package/src/engine/knowledge-contribution.ts +1 -1
  89. package/src/engine/knowledge-import/import-manager.ts +2 -3
  90. package/src/engine/knowledge-import/processors/extract-github.ts +1 -1
  91. package/src/engine/knowledge-import/processors/extract-sharepoint.ts +1 -1
  92. package/src/engine/knowledge-import/processors/validate.ts +1 -1
  93. package/src/engine/lifecycle.ts +1 -1
  94. package/src/engine/meeting-monitor.ts +2 -2
  95. package/src/engine/meeting-voice-intelligence.ts +3 -3
  96. package/src/engine/messaging-poller.ts +2 -2
  97. package/src/engine/org-integration-routes.ts +2 -2
  98. package/src/engine/org-integrations.ts +1 -1
  99. package/src/engine/routes.ts +119 -1
  100. package/src/engine/skills.ts +1 -1
  101. package/src/engine/tool-catalog.ts +1 -1
  102. package/src/engine/vault-routes.ts +1 -1
  103. package/src/engine/vault.ts +1 -1
  104. package/src/mcp/adapters/adp.adapter.ts +1 -1
  105. package/src/mcp/adapters/auth0.adapter.ts +1 -1
  106. package/src/mcp/adapters/clickup.adapter.ts +1 -1
  107. package/src/mcp/adapters/close.adapter.ts +1 -1
  108. package/src/mcp/adapters/firebase.adapter.ts +1 -1
  109. package/src/mcp/adapters/google-ads.adapter.ts +1 -1
  110. package/src/mcp/adapters/kubernetes.adapter.ts +1 -1
  111. package/src/mcp/adapters/mixpanel.adapter.ts +1 -1
  112. package/src/mcp/adapters/recurly.adapter.ts +1 -1
  113. package/src/mcp/adapters/sap.adapter.ts +2 -2
  114. package/src/mcp/adapters/shortcut.adapter.ts +1 -1
  115. package/src/mcp/adapters/snowflake.adapter.ts +1 -1
  116. package/src/mcp/adapters/stripe.adapter.ts +1 -1
  117. package/src/mcp/adapters/supabase.adapter.ts +1 -1
  118. package/src/mcp/adapters/zuora.adapter.ts +1 -1
  119. package/src/middleware/request-limits.ts +1 -1
  120. package/src/runtime/agent-loop.ts +3 -3
  121. package/src/runtime/compaction.ts +2 -2
  122. package/src/runtime/followup.ts +1 -1
  123. package/src/runtime/hooks.ts +3 -3
  124. package/src/runtime/index.ts +5 -6
  125. package/src/runtime/llm-client.ts +1 -1
  126. package/src/runtime/subagent.ts +0 -1
  127. package/src/runtime/types.ts +2 -0
  128. package/src/security/brute-force.ts +1 -1
  129. package/src/security/csp.ts +1 -1
  130. package/src/security/index.ts +3 -3
  131. package/src/security/input-sanitizer.ts +1 -1
  132. package/src/security/threat-logger.ts +2 -2
  133. package/src/server.ts +2 -2
  134. package/src/setup/database.ts +1 -1
  135. package/src/setup/index.ts +1 -2
  136. package/src/setup/provision.ts +1 -1
  137. package/dist/_seed-data-FQR5PY2W.js +0 -4554
  138. package/dist/agent-heartbeat-3FWNHZFX.js +0 -510
  139. package/dist/agent-heartbeat-4RWHZR7H.js +0 -510
  140. package/dist/agent-heartbeat-6ZGB5ILY.js +0 -510
  141. package/dist/agent-heartbeat-BBINFNL4.js +0 -510
  142. package/dist/agent-heartbeat-BIVHLKFM.js +0 -510
  143. package/dist/agent-heartbeat-HGVIAHS5.js +0 -510
  144. package/dist/agent-heartbeat-HRKVFK2T.js +0 -510
  145. package/dist/agent-heartbeat-JC5GWVXD.js +0 -510
  146. package/dist/agent-heartbeat-K6A4HMHB.js +0 -510
  147. package/dist/agent-heartbeat-LCDXWFVB.js +0 -510
  148. package/dist/agent-heartbeat-P7HZCZAQ.js +0 -510
  149. package/dist/agent-heartbeat-PUIRSNIO.js +0 -510
  150. package/dist/agent-heartbeat-SN5ILQ6Y.js +0 -510
  151. package/dist/agent-heartbeat-TW5YTDYC.js +0 -510
  152. package/dist/agent-heartbeat-YCSWP54H.js +0 -510
  153. package/dist/agent-heartbeat-Z2QQXROL.js +0 -510
  154. package/dist/agent-tools-3W7XLUYA.js +0 -13949
  155. package/dist/agent-tools-54VZGT6L.js +0 -9
  156. package/dist/agent-tools-AYYDPO27.js +0 -13949
  157. package/dist/agent-tools-F2X47FKF.js +0 -13949
  158. package/dist/agent-tools-O6W3QAZL.js +0 -13949
  159. package/dist/agent-tools-OAWVZBMW.js +0 -9
  160. package/dist/agent-tools-QCCU74PN.js +0 -13949
  161. package/dist/agent-tools-QGE26U6R.js +0 -9
  162. package/dist/chunk-2LHUARN6.js +0 -4929
  163. package/dist/chunk-2WVCNCYC.js +0 -5087
  164. package/dist/chunk-3FM6YQUK.js +0 -5087
  165. package/dist/chunk-46GOWZT4.js +0 -5087
  166. package/dist/chunk-5KYJAUZV.js +0 -1519
  167. package/dist/chunk-6ZMLNEHB.js +0 -1519
  168. package/dist/chunk-7HBGXW7Z.js +0 -4929
  169. package/dist/chunk-7UCKD25B.js +0 -551
  170. package/dist/chunk-BDCFOP7O.js +0 -537
  171. package/dist/chunk-BPZQT5N5.js +0 -25652
  172. package/dist/chunk-C52OQNNY.js +0 -5087
  173. package/dist/chunk-C7HGQF4Y.js +0 -25652
  174. package/dist/chunk-CAHNZGGK.js +0 -25656
  175. package/dist/chunk-CK7R6UHE.js +0 -4945
  176. package/dist/chunk-D36RPWB7.js +0 -25652
  177. package/dist/chunk-DJK2UPFH.js +0 -4891
  178. package/dist/chunk-DXZGPUAF.js +0 -5087
  179. package/dist/chunk-F46WB5IL.js +0 -5087
  180. package/dist/chunk-F5QG5SQH.js +0 -5087
  181. package/dist/chunk-GYB2WHMN.js +0 -5101
  182. package/dist/chunk-H7GP733U.js +0 -5087
  183. package/dist/chunk-HHBXWB5U.js +0 -25640
  184. package/dist/chunk-HS5YWSGM.js +0 -3206
  185. package/dist/chunk-IMXS4N6W.js +0 -1519
  186. package/dist/chunk-JTV5LA47.js +0 -1519
  187. package/dist/chunk-KN3T3CTD.js +0 -4929
  188. package/dist/chunk-KV6G7NZX.js +0 -1519
  189. package/dist/chunk-M6ZIC5H3.js +0 -1370
  190. package/dist/chunk-MU5MEBIK.js +0 -1519
  191. package/dist/chunk-NLT5MC7X.js +0 -465
  192. package/dist/chunk-NVLYIM4J.js +0 -4945
  193. package/dist/chunk-NZY2BIZH.js +0 -4891
  194. package/dist/chunk-O42L6G67.js +0 -1519
  195. package/dist/chunk-OCNERGGM.js +0 -4891
  196. package/dist/chunk-OJSNHONE.js +0 -1519
  197. package/dist/chunk-OWTLNV4Q.js +0 -25623
  198. package/dist/chunk-PCNYEP6T.js +0 -4891
  199. package/dist/chunk-PI4AQ4Z6.js +0 -25652
  200. package/dist/chunk-PN3EGTCA.js +0 -194
  201. package/dist/chunk-PWWV2U5P.js +0 -195
  202. package/dist/chunk-Q37UKNRC.js +0 -1519
  203. package/dist/chunk-QXTC6J7H.js +0 -5087
  204. package/dist/chunk-RF2LGX3E.js +0 -1519
  205. package/dist/chunk-RH7KPWRQ.js +0 -465
  206. package/dist/chunk-RKERL5LZ.js +0 -4925
  207. package/dist/chunk-RVBK2IOX.js +0 -25652
  208. package/dist/chunk-SAKODCZ5.js +0 -4891
  209. package/dist/chunk-SALGFC5L.js +0 -4945
  210. package/dist/chunk-STGWZ2MS.js +0 -1519
  211. package/dist/chunk-SVSLIQYN.js +0 -1519
  212. package/dist/chunk-UY3ZVQDP.js +0 -25652
  213. package/dist/chunk-V6OSD62M.js +0 -5087
  214. package/dist/chunk-VP6YAHX4.js +0 -1519
  215. package/dist/chunk-WDYJOEAI.js +0 -5087
  216. package/dist/chunk-WEAFQNOS.js +0 -195
  217. package/dist/chunk-XKUSAZGP.js +0 -5087
  218. package/dist/chunk-YCWOCIPH.js +0 -5101
  219. package/dist/chunk-ZGE3XAXY.js +0 -1519
  220. package/dist/cli-agent-33GWIF2D.js +0 -2300
  221. package/dist/cli-agent-4XK6LVQQ.js +0 -2357
  222. package/dist/cli-agent-64EOV3ST.js +0 -2300
  223. package/dist/cli-agent-67WP6KKO.js +0 -2300
  224. package/dist/cli-agent-7RW5Y7C4.js +0 -2294
  225. package/dist/cli-agent-7TB2BWS6.js +0 -2370
  226. package/dist/cli-agent-AKXFFST2.js +0 -2370
  227. package/dist/cli-agent-C3YSECO4.js +0 -2344
  228. package/dist/cli-agent-DZTKLITB.js +0 -2357
  229. package/dist/cli-agent-FNMDJN7T.js +0 -2357
  230. package/dist/cli-agent-FOF7PFEP.js +0 -2357
  231. package/dist/cli-agent-FXZ6DJKP.js +0 -2357
  232. package/dist/cli-agent-H74M2ZYN.js +0 -2357
  233. package/dist/cli-agent-HG4Y657I.js +0 -2300
  234. package/dist/cli-agent-HORWVPHB.js +0 -2370
  235. package/dist/cli-agent-HSZT6SKF.js +0 -2423
  236. package/dist/cli-agent-ION2W5JF.js +0 -2441
  237. package/dist/cli-agent-JLUQ4ZU6.js +0 -2424
  238. package/dist/cli-agent-KBPWY3CB.js +0 -2302
  239. package/dist/cli-agent-MVCDH4HV.js +0 -2370
  240. package/dist/cli-agent-NZXOEPJ2.js +0 -2357
  241. package/dist/cli-agent-OO6H57UQ.js +0 -2300
  242. package/dist/cli-agent-PADN3QRC.js +0 -2357
  243. package/dist/cli-agent-QAYEX3BE.js +0 -2441
  244. package/dist/cli-agent-QT64DT5J.js +0 -2370
  245. package/dist/cli-agent-TCTRKCHN.js +0 -2300
  246. package/dist/cli-agent-TFL2M6UK.js +0 -2424
  247. package/dist/cli-agent-TSOJG7EX.js +0 -2357
  248. package/dist/cli-agent-UIKXATTD.js +0 -2357
  249. package/dist/cli-agent-UJN6FYTO.js +0 -2370
  250. package/dist/cli-agent-VIQAYVY4.js +0 -2357
  251. package/dist/cli-agent-WNWFVOFM.js +0 -2370
  252. package/dist/cli-agent-XBQX67VJ.js +0 -2423
  253. package/dist/cli-agent-ZLSC6FF4.js +0 -2357
  254. package/dist/cli-agent-ZSHUPBBN.js +0 -2357
  255. package/dist/cli-recover-T32NABFA.js +0 -487
  256. package/dist/cli-serve-2IL5DTEY.js +0 -153
  257. package/dist/cli-serve-3NGBX5ER.js +0 -140
  258. package/dist/cli-serve-47N5UKKW.js +0 -153
  259. package/dist/cli-serve-4RS4UDHC.js +0 -140
  260. package/dist/cli-serve-4XGZFUV2.js +0 -140
  261. package/dist/cli-serve-53FVANQK.js +0 -260
  262. package/dist/cli-serve-57225XWV.js +0 -140
  263. package/dist/cli-serve-63BDPSOP.js +0 -140
  264. package/dist/cli-serve-657NRUOX.js +0 -140
  265. package/dist/cli-serve-6ER7QMLR.js +0 -140
  266. package/dist/cli-serve-6OT3UEAN.js +0 -140
  267. package/dist/cli-serve-7JQ4FVUQ.js +0 -260
  268. package/dist/cli-serve-7L6EY5UH.js +0 -153
  269. package/dist/cli-serve-BFNIW2LF.js +0 -153
  270. package/dist/cli-serve-C7MN6U5Q.js +0 -153
  271. package/dist/cli-serve-CQFI3LMK.js +0 -140
  272. package/dist/cli-serve-CR3OY3IM.js +0 -153
  273. package/dist/cli-serve-DAJFRWQ7.js +0 -153
  274. package/dist/cli-serve-DTQLN5UI.js +0 -140
  275. package/dist/cli-serve-EQS2SGT3.js +0 -140
  276. package/dist/cli-serve-FW6FHFW4.js +0 -153
  277. package/dist/cli-serve-GEEOQS77.js +0 -153
  278. package/dist/cli-serve-H562I3ZK.js +0 -153
  279. package/dist/cli-serve-HDQZF4C4.js +0 -153
  280. package/dist/cli-serve-KBJNXWYJ.js +0 -140
  281. package/dist/cli-serve-LICAOMEB.js +0 -140
  282. package/dist/cli-serve-LLGYLWFS.js +0 -153
  283. package/dist/cli-serve-LMZKQ5GX.js +0 -140
  284. package/dist/cli-serve-LNTT73P2.js +0 -140
  285. package/dist/cli-serve-MQKBUZ7X.js +0 -140
  286. package/dist/cli-serve-N3OISDNB.js +0 -153
  287. package/dist/cli-serve-NBFT7B42.js +0 -140
  288. package/dist/cli-serve-RTWO3AWY.js +0 -140
  289. package/dist/cli-serve-SIHTSW5P.js +0 -140
  290. package/dist/cli-serve-SP6TEURE.js +0 -140
  291. package/dist/cli-serve-TDKZA6I5.js +0 -140
  292. package/dist/cli-serve-TF5ZVVXF.js +0 -140
  293. package/dist/cli-serve-TIZ27EVR.js +0 -153
  294. package/dist/cli-serve-TUNI2RCN.js +0 -153
  295. package/dist/cli-serve-WCU66CHX.js +0 -140
  296. package/dist/cli-serve-WNOZMAWD.js +0 -153
  297. package/dist/cli-serve-YCCKRRUY.js +0 -140
  298. package/dist/cli-serve-ZD5V7I6G.js +0 -140
  299. package/dist/cli-validate-6XDDLVVQ.js +0 -150
  300. package/dist/cli-verify-I4WGRQNT.js +0 -149
  301. package/dist/connection-manager-4ZA4XAFA.js +0 -9
  302. package/dist/db-adapter-IK2EDK2N.js +0 -7
  303. package/dist/db-adapter-IRHOUMVC.js +0 -7
  304. package/dist/dependency-manager-G6D2XXNY.js +0 -11
  305. package/dist/dependency-manager-OCUKF72T.js +0 -543
  306. package/dist/dependency-manager-YULUXN34.js +0 -511
  307. package/dist/factory-MQASIPEB.js +0 -11
  308. package/dist/google-W5AYGNUJ.js +0 -33
  309. package/dist/integrations-VWANOHQ4.js +0 -43830
  310. package/dist/local-O2FN57UN.js +0 -1128
  311. package/dist/local-S7SDOQHN.js +0 -1128
  312. package/dist/microsoft-HPLA5ZL5.js +0 -2414
  313. package/dist/microsoft-UFLZBEAC.js +0 -1619
  314. package/dist/microsoft-VREAZ7M2.js +0 -3955
  315. package/dist/microsoft-YUT6EIGP.js +0 -3400
  316. package/dist/postgres-BOTHOPDW.js +0 -875
  317. package/dist/routes-3MMLQTB6.js +0 -90
  318. package/dist/routes-4ZUIJ4HE.js +0 -90
  319. package/dist/routes-5MXHKKH4.js +0 -90
  320. package/dist/routes-64NJFK3B.js +0 -90
  321. package/dist/routes-6AKQ2LBV.js +0 -90
  322. package/dist/routes-CRRBUDO4.js +0 -90
  323. package/dist/routes-D7SMYOLT.js +0 -90
  324. package/dist/routes-DIAF3MC3.js +0 -90
  325. package/dist/routes-KMUNU6CY.js +0 -90
  326. package/dist/routes-LRRLXIZR.js +0 -90
  327. package/dist/routes-N647AJYG.js +0 -90
  328. package/dist/routes-SSSELAAR.js +0 -90
  329. package/dist/routes-STERVGKJ.js +0 -90
  330. package/dist/routes-TZMPYLHJ.js +0 -90
  331. package/dist/routes-XNK2MAVO.js +0 -90
  332. package/dist/routes-ZEZZACZP.js +0 -90
  333. package/dist/runtime-4UVCTFNQ.js +0 -45
  334. package/dist/runtime-5EQN4GFM.js +0 -45
  335. package/dist/runtime-5LP7PUD4.js +0 -45
  336. package/dist/runtime-6YEENDN3.js +0 -45
  337. package/dist/runtime-7LQFRG3B.js +0 -45
  338. package/dist/runtime-AMXJU2MB.js +0 -45
  339. package/dist/runtime-D6WSE7FG.js +0 -45
  340. package/dist/runtime-EYVN7NFJ.js +0 -45
  341. package/dist/runtime-F6RPWQVW.js +0 -45
  342. package/dist/runtime-FYMJURFC.js +0 -45
  343. package/dist/runtime-GGF4P55M.js +0 -45
  344. package/dist/runtime-H3SAMWWF.js +0 -45
  345. package/dist/runtime-H7T4I7I7.js +0 -45
  346. package/dist/runtime-HTIM7GZR.js +0 -45
  347. package/dist/runtime-JRNBL4O4.js +0 -45
  348. package/dist/runtime-K4C7NQLW.js +0 -45
  349. package/dist/runtime-MWWZCPC2.js +0 -45
  350. package/dist/runtime-N7CM2DYA.js +0 -45
  351. package/dist/runtime-OM2NIBMI.js +0 -45
  352. package/dist/runtime-OVGSOTAH.js +0 -45
  353. package/dist/runtime-QQ6LAY4U.js +0 -45
  354. package/dist/runtime-QWPVD7CY.js +0 -45
  355. package/dist/runtime-SX3B5MG3.js +0 -45
  356. package/dist/runtime-YLIIPTE4.js +0 -45
  357. package/dist/runtime-YU6P22CG.js +0 -45
  358. package/dist/runtime-ZOC337DD.js +0 -45
  359. package/dist/server-3AVWBRIF.js +0 -28
  360. package/dist/server-5BKJI5OW.js +0 -28
  361. package/dist/server-6NDO2S52.js +0 -28
  362. package/dist/server-7TD3M2BW.js +0 -28
  363. package/dist/server-AMCSXINC.js +0 -28
  364. package/dist/server-BEJ6RAGL.js +0 -28
  365. package/dist/server-BFPYDHBG.js +0 -28
  366. package/dist/server-BKEWXGVX.js +0 -28
  367. package/dist/server-BMEJZGFG.js +0 -28
  368. package/dist/server-CU6LVQS4.js +0 -28
  369. package/dist/server-DFR7FI3Q.js +0 -28
  370. package/dist/server-DFYGH2CV.js +0 -28
  371. package/dist/server-DURRN3GJ.js +0 -28
  372. package/dist/server-EELWOC3X.js +0 -28
  373. package/dist/server-EN5E2OWQ.js +0 -28
  374. package/dist/server-EXZC3OJO.js +0 -28
  375. package/dist/server-GW2HYJYI.js +0 -28
  376. package/dist/server-J25NCRWJ.js +0 -28
  377. package/dist/server-JDGNOTFV.js +0 -28
  378. package/dist/server-KA6U3YNP.js +0 -28
  379. package/dist/server-L52A2ME4.js +0 -28
  380. package/dist/server-NE5HD5DJ.js +0 -28
  381. package/dist/server-NLQAXPOG.js +0 -28
  382. package/dist/server-NQOT7W77.js +0 -28
  383. package/dist/server-OHHAA34U.js +0 -28
  384. package/dist/server-PWE5PQTR.js +0 -28
  385. package/dist/server-Q2Q32H2B.js +0 -28
  386. package/dist/server-Q77ME7TL.js +0 -28
  387. package/dist/server-QDKO6OVO.js +0 -28
  388. package/dist/server-RR6QJIXM.js +0 -28
  389. package/dist/server-T3R6BO6A.js +0 -28
  390. package/dist/server-TRIBAHDV.js +0 -28
  391. package/dist/server-TXV3ZVVR.js +0 -28
  392. package/dist/server-VHSFJP3I.js +0 -28
  393. package/dist/server-VOJF2XGU.js +0 -28
  394. package/dist/server-W76YHPEC.js +0 -28
  395. package/dist/server-WLLH4WST.js +0 -28
  396. package/dist/server-WTUJ2O3F.js +0 -28
  397. package/dist/server-X4CJTHHF.js +0 -28
  398. package/dist/server-XK3ILCJC.js +0 -28
  399. package/dist/server-ZRD3NDJE.js +0 -28
  400. package/dist/setup-2JYXGTW6.js +0 -20
  401. package/dist/setup-3XOSZEW5.js +0 -20
  402. package/dist/setup-44VBAO4J.js +0 -20
  403. package/dist/setup-4OA7QNJW.js +0 -20
  404. package/dist/setup-4ONNQBWB.js +0 -20
  405. package/dist/setup-4OSBXSCL.js +0 -20
  406. package/dist/setup-4QFGRBLZ.js +0 -20
  407. package/dist/setup-52US54Z4.js +0 -20
  408. package/dist/setup-5CY3CKKT.js +0 -20
  409. package/dist/setup-6766SGAR.js +0 -20
  410. package/dist/setup-6NUSB4XO.js +0 -20
  411. package/dist/setup-7FZJEOD4.js +0 -20
  412. package/dist/setup-7LYYXBUL.js +0 -20
  413. package/dist/setup-ADSKKBGV.js +0 -20
  414. package/dist/setup-AMV2WKVH.js +0 -20
  415. package/dist/setup-AYY24DKM.js +0 -20
  416. package/dist/setup-B34N4HPU.js +0 -20
  417. package/dist/setup-CEF4QY4L.js +0 -20
  418. package/dist/setup-E2YLC2EY.js +0 -20
  419. package/dist/setup-ER6NXTY5.js +0 -20
  420. package/dist/setup-FIOAQJ6C.js +0 -20
  421. package/dist/setup-G76S7X44.js +0 -20
  422. package/dist/setup-H2AGCBW5.js +0 -20
  423. package/dist/setup-H4JZUHH5.js +0 -20
  424. package/dist/setup-ICOZRKCX.js +0 -20
  425. package/dist/setup-JFTJH7UF.js +0 -20
  426. package/dist/setup-JJHOT2ZU.js +0 -20
  427. package/dist/setup-KEAM2BCL.js +0 -20
  428. package/dist/setup-LW4MLU2N.js +0 -20
  429. package/dist/setup-NHAZABW4.js +0 -20
  430. package/dist/setup-PRFNI6YW.js +0 -20
  431. package/dist/setup-RAHBMYHE.js +0 -20
  432. package/dist/setup-T6KYFR7O.js +0 -20
  433. package/dist/setup-TGM6L362.js +0 -20
  434. package/dist/setup-TNANAH7C.js +0 -20
  435. package/dist/setup-TXPR5UQX.js +0 -20
  436. package/dist/setup-UJSNSCLM.js +0 -20
  437. package/dist/setup-XCJMELVU.js +0 -20
  438. package/dist/setup-XIYEIFVK.js +0 -20
  439. package/dist/setup-XP2VGBEU.js +0 -20
  440. package/dist/setup-Z4PZSHBI.js +0 -20
  441. package/dist/skills-HCVBA6PK.js +0 -16
  442. package/dist/skills-HFSW74KZ.js +0 -16
  443. package/dist/system-prompts-6OUTAMH6.js +0 -41
  444. package/dist/task-queue-YP2I54IA.js +0 -9
  445. package/dist/transport-encryption-F2NQYACT.js +0 -25
  446. package/seed-data.mjs +0 -455
  447. package/src/agent-tools/tools/integrations/_seed-data.json +0 -4548
  448. package/src/agent-tools/tools/integrations/_seed-data.ts +0 -4563
  449. package/src/engine/NOTE.MD +0 -52
@@ -1,1619 +0,0 @@
1
- import {
2
- errorResult,
3
- jsonResult
4
- } from "./chunk-ZB3VC2MR.js";
5
- import "./chunk-KFQGP6VL.js";
6
-
7
- // src/agent-tools/tools/microsoft/graph-api.ts
8
- var GRAPH_BASE = "https://graph.microsoft.com/v1.0";
9
- async function graph(token, path, opts) {
10
- const method = opts?.method || "GET";
11
- const base = opts?.beta ? "https://graph.microsoft.com/beta" : GRAPH_BASE;
12
- const url = new URL(base + path);
13
- if (opts?.query) {
14
- for (const [k, v] of Object.entries(opts.query)) {
15
- if (v !== void 0 && v !== "") url.searchParams.set(k, v);
16
- }
17
- }
18
- const headers = {
19
- Authorization: `Bearer ${token}`,
20
- ...opts?.headers
21
- };
22
- if (!opts?.rawBody && !opts?.headers?.["Content-Type"]) {
23
- headers["Content-Type"] = "application/json";
24
- }
25
- const res = await fetch(url.toString(), {
26
- method,
27
- headers,
28
- body: opts?.rawBody || (opts?.body ? JSON.stringify(opts.body) : void 0)
29
- });
30
- if (!res.ok) {
31
- const err = await res.text();
32
- throw new Error(`Microsoft Graph ${res.status}: ${err}`);
33
- }
34
- if (res.status === 204) return {};
35
- const ct = res.headers.get("content-type") || "";
36
- if (ct.includes("application/json")) return res.json();
37
- return { content: await res.text() };
38
- }
39
-
40
- // src/agent-tools/tools/microsoft/outlook-mail.ts
41
- function createOutlookMailTools(config, _options) {
42
- const tp = config.tokenProvider;
43
- return [
44
- {
45
- name: "outlook_mail_list",
46
- description: "List messages from Outlook mailbox. Returns recent emails from inbox or specified folder.",
47
- category: "utility",
48
- parameters: {
49
- type: "object",
50
- properties: {
51
- folder: { type: "string", description: "Folder: inbox, sentitems, drafts, deleteditems, junkemail, or folder ID (default: inbox)" },
52
- maxResults: { type: "number", description: "Max messages to return (default: 20, max: 50)" },
53
- filter: { type: "string", description: `OData $filter expression (e.g., "isRead eq false", "from/emailAddress/address eq 'user@example.com'")` },
54
- search: { type: "string", description: "Search query (searches subject, body, sender)" }
55
- },
56
- required: []
57
- },
58
- async execute(_id, params) {
59
- try {
60
- const token = await tp.getAccessToken();
61
- const folder = params.folder || "inbox";
62
- const top = Math.min(params.maxResults || 20, 50);
63
- const query = {
64
- "$top": String(top),
65
- "$orderby": "receivedDateTime desc",
66
- "$select": "id,subject,from,toRecipients,ccRecipients,receivedDateTime,isRead,hasAttachments,importance,bodyPreview,flag,conversationId"
67
- };
68
- if (params.filter) query["$filter"] = params.filter;
69
- if (params.search) query["$search"] = `"${params.search}"`;
70
- const data = await graph(token, `/me/mailFolders/${folder}/messages`, { query });
71
- const messages = (data.value || []).map((m) => ({
72
- id: m.id,
73
- subject: m.subject,
74
- from: m.from?.emailAddress?.address,
75
- fromName: m.from?.emailAddress?.name,
76
- to: m.toRecipients?.map((r) => r.emailAddress?.address),
77
- cc: m.ccRecipients?.map((r) => r.emailAddress?.address),
78
- date: m.receivedDateTime,
79
- isRead: m.isRead,
80
- hasAttachments: m.hasAttachments,
81
- importance: m.importance,
82
- preview: m.bodyPreview,
83
- flagged: m.flag?.flagStatus === "flagged",
84
- conversationId: m.conversationId
85
- }));
86
- return jsonResult({ messages, count: messages.length });
87
- } catch (e) {
88
- return errorResult(e.message);
89
- }
90
- }
91
- },
92
- {
93
- name: "outlook_mail_read",
94
- description: "Read a specific email message by ID. Returns full body, headers, and attachment list.",
95
- category: "utility",
96
- parameters: {
97
- type: "object",
98
- properties: {
99
- messageId: { type: "string", description: "Message ID to read" },
100
- markAsRead: { type: "boolean", description: "Mark as read when opening (default: true)" }
101
- },
102
- required: ["messageId"]
103
- },
104
- async execute(_id, params) {
105
- try {
106
- const token = await tp.getAccessToken();
107
- const msg = await graph(token, `/me/messages/${params.messageId}`, {
108
- query: { "$select": "id,subject,from,toRecipients,ccRecipients,bccRecipients,replyTo,receivedDateTime,sentDateTime,isRead,hasAttachments,importance,body,flag,conversationId,internetMessageId,parentFolderId" }
109
- });
110
- if (params.markAsRead !== false && !msg.isRead) {
111
- graph(token, `/me/messages/${params.messageId}`, { method: "PATCH", body: { isRead: true } }).catch(() => {
112
- });
113
- }
114
- let attachments = [];
115
- if (msg.hasAttachments) {
116
- const att = await graph(token, `/me/messages/${params.messageId}/attachments`, {
117
- query: { "$select": "id,name,contentType,size,isInline" }
118
- });
119
- attachments = (att.value || []).map((a) => ({
120
- id: a.id,
121
- name: a.name,
122
- contentType: a.contentType,
123
- size: a.size,
124
- isInline: a.isInline
125
- }));
126
- }
127
- return jsonResult({
128
- id: msg.id,
129
- subject: msg.subject,
130
- from: msg.from?.emailAddress?.address,
131
- fromName: msg.from?.emailAddress?.name,
132
- to: msg.toRecipients?.map((r) => ({ email: r.emailAddress?.address, name: r.emailAddress?.name })),
133
- cc: msg.ccRecipients?.map((r) => ({ email: r.emailAddress?.address, name: r.emailAddress?.name })),
134
- bcc: msg.bccRecipients?.map((r) => ({ email: r.emailAddress?.address, name: r.emailAddress?.name })),
135
- replyTo: msg.replyTo?.map((r) => r.emailAddress?.address),
136
- date: msg.receivedDateTime,
137
- sentDate: msg.sentDateTime,
138
- body: msg.body?.content,
139
- bodyType: msg.body?.contentType,
140
- isRead: msg.isRead,
141
- importance: msg.importance,
142
- attachments,
143
- conversationId: msg.conversationId,
144
- internetMessageId: msg.internetMessageId
145
- });
146
- } catch (e) {
147
- return errorResult(e.message);
148
- }
149
- }
150
- },
151
- {
152
- name: "outlook_mail_send",
153
- description: "Send an email via Outlook. Supports to, cc, bcc, HTML body, importance, and reply-to.",
154
- category: "utility",
155
- parameters: {
156
- type: "object",
157
- properties: {
158
- to: { type: "string", description: "Recipient email(s), comma-separated" },
159
- subject: { type: "string", description: "Email subject" },
160
- body: { type: "string", description: "Email body (HTML or plain text)" },
161
- cc: { type: "string", description: "CC recipients, comma-separated" },
162
- bcc: { type: "string", description: "BCC recipients, comma-separated" },
163
- importance: { type: "string", description: "low, normal, or high (default: normal)" },
164
- isHtml: { type: "boolean", description: "Whether body is HTML (default: false)" },
165
- replyTo: { type: "string", description: "Reply-to address" },
166
- saveToSent: { type: "boolean", description: "Save to Sent Items (default: true)" }
167
- },
168
- required: ["to", "subject", "body"]
169
- },
170
- async execute(_id, params) {
171
- try {
172
- const token = await tp.getAccessToken();
173
- const toRecipients = params.to.split(",").map((e) => ({
174
- emailAddress: { address: e.trim() }
175
- }));
176
- const message = {
177
- subject: params.subject,
178
- body: { contentType: params.isHtml ? "HTML" : "Text", content: params.body },
179
- toRecipients
180
- };
181
- if (params.cc) message.ccRecipients = params.cc.split(",").map((e) => ({ emailAddress: { address: e.trim() } }));
182
- if (params.bcc) message.bccRecipients = params.bcc.split(",").map((e) => ({ emailAddress: { address: e.trim() } }));
183
- if (params.importance) message.importance = params.importance;
184
- if (params.replyTo) message.replyTo = [{ emailAddress: { address: params.replyTo } }];
185
- await graph(token, "/me/sendMail", {
186
- method: "POST",
187
- body: { message, saveToSentItems: params.saveToSent !== false }
188
- });
189
- return jsonResult({ sent: true, to: params.to, subject: params.subject });
190
- } catch (e) {
191
- return errorResult(e.message);
192
- }
193
- }
194
- },
195
- {
196
- name: "outlook_mail_reply",
197
- description: "Reply to an email message. Can reply to sender only or reply-all.",
198
- category: "utility",
199
- parameters: {
200
- type: "object",
201
- properties: {
202
- messageId: { type: "string", description: "Message ID to reply to" },
203
- body: { type: "string", description: "Reply body text" },
204
- replyAll: { type: "boolean", description: "Reply to all recipients (default: false)" },
205
- isHtml: { type: "boolean", description: "Whether body is HTML (default: false)" }
206
- },
207
- required: ["messageId", "body"]
208
- },
209
- async execute(_id, params) {
210
- try {
211
- const token = await tp.getAccessToken();
212
- const action = params.replyAll ? "replyAll" : "reply";
213
- await graph(token, `/me/messages/${params.messageId}/${action}`, {
214
- method: "POST",
215
- body: { comment: params.body }
216
- });
217
- return jsonResult({ replied: true, messageId: params.messageId, replyAll: !!params.replyAll });
218
- } catch (e) {
219
- return errorResult(e.message);
220
- }
221
- }
222
- },
223
- {
224
- name: "outlook_mail_forward",
225
- description: "Forward an email message to another recipient.",
226
- category: "utility",
227
- parameters: {
228
- type: "object",
229
- properties: {
230
- messageId: { type: "string", description: "Message ID to forward" },
231
- to: { type: "string", description: "Forward recipient email(s), comma-separated" },
232
- comment: { type: "string", description: "Optional comment to add above the forwarded message" }
233
- },
234
- required: ["messageId", "to"]
235
- },
236
- async execute(_id, params) {
237
- try {
238
- const token = await tp.getAccessToken();
239
- const toRecipients = params.to.split(",").map((e) => ({ emailAddress: { address: e.trim() } }));
240
- await graph(token, `/me/messages/${params.messageId}/forward`, {
241
- method: "POST",
242
- body: { comment: params.comment || "", toRecipients }
243
- });
244
- return jsonResult({ forwarded: true, messageId: params.messageId, to: params.to });
245
- } catch (e) {
246
- return errorResult(e.message);
247
- }
248
- }
249
- },
250
- {
251
- name: "outlook_mail_move",
252
- description: "Move a message to another folder.",
253
- category: "utility",
254
- parameters: {
255
- type: "object",
256
- properties: {
257
- messageId: { type: "string", description: "Message ID to move" },
258
- folder: { type: "string", description: "Destination folder: inbox, archive, deleteditems, junkemail, or folder ID" }
259
- },
260
- required: ["messageId", "folder"]
261
- },
262
- async execute(_id, params) {
263
- try {
264
- const token = await tp.getAccessToken();
265
- const folderMap = {
266
- inbox: "inbox",
267
- archive: "archive",
268
- trash: "deleteditems",
269
- deleteditems: "deleteditems",
270
- junk: "junkemail",
271
- junkemail: "junkemail",
272
- sent: "sentitems",
273
- sentitems: "sentitems",
274
- drafts: "drafts"
275
- };
276
- const destId = folderMap[params.folder.toLowerCase()] || params.folder;
277
- const result = await graph(token, `/me/messages/${params.messageId}/move`, {
278
- method: "POST",
279
- body: { destinationId: destId }
280
- });
281
- return jsonResult({ moved: true, newId: result.id, folder: params.folder });
282
- } catch (e) {
283
- return errorResult(e.message);
284
- }
285
- }
286
- },
287
- {
288
- name: "outlook_mail_delete",
289
- description: "Delete an email message (moves to Deleted Items).",
290
- category: "utility",
291
- parameters: {
292
- type: "object",
293
- properties: {
294
- messageId: { type: "string", description: "Message ID to delete" }
295
- },
296
- required: ["messageId"]
297
- },
298
- async execute(_id, params) {
299
- try {
300
- const token = await tp.getAccessToken();
301
- await graph(token, `/me/messages/${params.messageId}`, { method: "DELETE" });
302
- return jsonResult({ deleted: true, messageId: params.messageId });
303
- } catch (e) {
304
- return errorResult(e.message);
305
- }
306
- }
307
- },
308
- {
309
- name: "outlook_mail_update",
310
- description: "Update message properties: mark as read/unread, flag, change importance, add categories.",
311
- category: "utility",
312
- parameters: {
313
- type: "object",
314
- properties: {
315
- messageId: { type: "string", description: "Message ID to update" },
316
- isRead: { type: "boolean", description: "Mark as read or unread" },
317
- importance: { type: "string", description: "low, normal, or high" },
318
- flag: { type: "string", description: "notFlagged, flagged, or complete" },
319
- categories: { type: "array", items: { type: "string" }, description: "Category labels to apply" }
320
- },
321
- required: ["messageId"]
322
- },
323
- async execute(_id, params) {
324
- try {
325
- const token = await tp.getAccessToken();
326
- const body = {};
327
- if (params.isRead !== void 0) body.isRead = params.isRead;
328
- if (params.importance) body.importance = params.importance;
329
- if (params.flag) body.flag = { flagStatus: params.flag };
330
- if (params.categories) body.categories = params.categories;
331
- await graph(token, `/me/messages/${params.messageId}`, { method: "PATCH", body });
332
- return jsonResult({ updated: true, messageId: params.messageId });
333
- } catch (e) {
334
- return errorResult(e.message);
335
- }
336
- }
337
- },
338
- {
339
- name: "outlook_mail_search",
340
- description: "Search emails across all folders using Microsoft Search. Supports natural language queries.",
341
- category: "utility",
342
- parameters: {
343
- type: "object",
344
- properties: {
345
- query: { type: "string", description: 'Search query (natural language or KQL: "from:user@example.com subject:report")' },
346
- maxResults: { type: "number", description: "Max results (default: 10, max: 25)" }
347
- },
348
- required: ["query"]
349
- },
350
- async execute(_id, params) {
351
- try {
352
- const token = await tp.getAccessToken();
353
- const top = Math.min(params.maxResults || 10, 25);
354
- const data = await graph(token, "/me/messages", {
355
- query: {
356
- "$search": `"${params.query}"`,
357
- "$top": String(top),
358
- "$select": "id,subject,from,receivedDateTime,bodyPreview,isRead,hasAttachments,importance"
359
- }
360
- });
361
- const messages = (data.value || []).map((m) => ({
362
- id: m.id,
363
- subject: m.subject,
364
- from: m.from?.emailAddress?.address,
365
- fromName: m.from?.emailAddress?.name,
366
- date: m.receivedDateTime,
367
- preview: m.bodyPreview,
368
- isRead: m.isRead,
369
- hasAttachments: m.hasAttachments
370
- }));
371
- return jsonResult({ messages, count: messages.length, query: params.query });
372
- } catch (e) {
373
- return errorResult(e.message);
374
- }
375
- }
376
- },
377
- {
378
- name: "outlook_mail_draft",
379
- description: "Create a draft email in Outlook. Can be edited and sent later.",
380
- category: "utility",
381
- parameters: {
382
- type: "object",
383
- properties: {
384
- to: { type: "string", description: "Recipient email(s), comma-separated" },
385
- subject: { type: "string", description: "Email subject" },
386
- body: { type: "string", description: "Email body" },
387
- cc: { type: "string", description: "CC recipients" },
388
- isHtml: { type: "boolean", description: "Whether body is HTML" }
389
- },
390
- required: ["to", "subject", "body"]
391
- },
392
- async execute(_id, params) {
393
- try {
394
- const token = await tp.getAccessToken();
395
- const message = {
396
- subject: params.subject,
397
- body: { contentType: params.isHtml ? "HTML" : "Text", content: params.body },
398
- toRecipients: params.to.split(",").map((e) => ({ emailAddress: { address: e.trim() } }))
399
- };
400
- if (params.cc) message.ccRecipients = params.cc.split(",").map((e) => ({ emailAddress: { address: e.trim() } }));
401
- const draft = await graph(token, "/me/messages", { method: "POST", body: message });
402
- return jsonResult({ draftId: draft.id, subject: params.subject, status: "draft_created" });
403
- } catch (e) {
404
- return errorResult(e.message);
405
- }
406
- }
407
- },
408
- {
409
- name: "outlook_mail_send_draft",
410
- description: "Send an existing draft email.",
411
- category: "utility",
412
- parameters: {
413
- type: "object",
414
- properties: {
415
- messageId: { type: "string", description: "Draft message ID to send" }
416
- },
417
- required: ["messageId"]
418
- },
419
- async execute(_id, params) {
420
- try {
421
- const token = await tp.getAccessToken();
422
- await graph(token, `/me/messages/${params.messageId}/send`, { method: "POST" });
423
- return jsonResult({ sent: true, messageId: params.messageId });
424
- } catch (e) {
425
- return errorResult(e.message);
426
- }
427
- }
428
- },
429
- {
430
- name: "outlook_mail_folders",
431
- description: "List mail folders in the mailbox.",
432
- category: "utility",
433
- parameters: { type: "object", properties: {}, required: [] },
434
- async execute(_id) {
435
- try {
436
- const token = await tp.getAccessToken();
437
- const data = await graph(token, "/me/mailFolders", {
438
- query: { "$top": "50", "$select": "id,displayName,totalItemCount,unreadItemCount,parentFolderId" }
439
- });
440
- const folders = (data.value || []).map((f) => ({
441
- id: f.id,
442
- name: f.displayName,
443
- totalItems: f.totalItemCount,
444
- unreadItems: f.unreadItemCount
445
- }));
446
- return jsonResult({ folders, count: folders.length });
447
- } catch (e) {
448
- return errorResult(e.message);
449
- }
450
- }
451
- },
452
- {
453
- name: "outlook_mail_attachment_download",
454
- description: "Download an attachment from an email. Returns the attachment content as base64.",
455
- category: "utility",
456
- parameters: {
457
- type: "object",
458
- properties: {
459
- messageId: { type: "string", description: "Message ID containing the attachment" },
460
- attachmentId: { type: "string", description: "Attachment ID to download" }
461
- },
462
- required: ["messageId", "attachmentId"]
463
- },
464
- async execute(_id, params) {
465
- try {
466
- const token = await tp.getAccessToken();
467
- const att = await graph(token, `/me/messages/${params.messageId}/attachments/${params.attachmentId}`);
468
- return jsonResult({
469
- name: att.name,
470
- contentType: att.contentType,
471
- size: att.size,
472
- content: att.contentBytes
473
- // base64 encoded
474
- });
475
- } catch (e) {
476
- return errorResult(e.message);
477
- }
478
- }
479
- }
480
- ];
481
- }
482
-
483
- // src/agent-tools/tools/microsoft/outlook-calendar.ts
484
- function createOutlookCalendarTools(config, _options) {
485
- const tp = config.tokenProvider;
486
- return [
487
- {
488
- name: "outlook_calendar_list",
489
- description: "List all calendars the agent has access to.",
490
- category: "utility",
491
- parameters: { type: "object", properties: {}, required: [] },
492
- async execute(_id) {
493
- try {
494
- const token = await tp.getAccessToken();
495
- const data = await graph(token, "/me/calendars");
496
- const cals = (data.value || []).map((c) => ({
497
- id: c.id,
498
- name: c.name,
499
- color: c.color,
500
- isDefaultCalendar: c.isDefaultCalendar,
501
- canEdit: c.canEdit,
502
- owner: c.owner?.address
503
- }));
504
- return jsonResult({ calendars: cals, count: cals.length });
505
- } catch (e) {
506
- return errorResult(e.message);
507
- }
508
- }
509
- },
510
- {
511
- name: "outlook_calendar_events",
512
- description: "List upcoming events from a calendar. Defaults to the primary calendar.",
513
- category: "utility",
514
- parameters: {
515
- type: "object",
516
- properties: {
517
- calendarId: { type: "string", description: "Calendar ID (omit for default calendar)" },
518
- timeMin: { type: "string", description: "Start of time range (ISO 8601, default: now)" },
519
- timeMax: { type: "string", description: "End of time range (ISO 8601, default: +7 days)" },
520
- maxResults: { type: "number", description: "Max events (default: 20)" }
521
- },
522
- required: []
523
- },
524
- async execute(_id, params) {
525
- try {
526
- const token = await tp.getAccessToken();
527
- const now = /* @__PURE__ */ new Date();
528
- const timeMin = params.timeMin || now.toISOString();
529
- const weekLater = new Date(now.getTime() + 7 * 864e5);
530
- const timeMax = params.timeMax || weekLater.toISOString();
531
- const top = params.maxResults || 20;
532
- const basePath = params.calendarId ? `/me/calendars/${params.calendarId}/calendarView` : "/me/calendarView";
533
- const data = await graph(token, basePath, {
534
- query: {
535
- startDateTime: timeMin,
536
- endDateTime: timeMax,
537
- "$top": String(top),
538
- "$orderby": "start/dateTime",
539
- "$select": "id,subject,start,end,location,organizer,attendees,isAllDay,isCancelled,showAs,importance,bodyPreview,onlineMeeting,webLink"
540
- }
541
- });
542
- const events = (data.value || []).map((e) => ({
543
- id: e.id,
544
- subject: e.subject,
545
- start: e.start?.dateTime,
546
- startTimeZone: e.start?.timeZone,
547
- end: e.end?.dateTime,
548
- endTimeZone: e.end?.timeZone,
549
- isAllDay: e.isAllDay,
550
- location: e.location?.displayName,
551
- organizer: e.organizer?.emailAddress?.address,
552
- attendees: e.attendees?.map((a) => ({
553
- email: a.emailAddress?.address,
554
- name: a.emailAddress?.name,
555
- status: a.status?.response,
556
- type: a.type
557
- })),
558
- showAs: e.showAs,
559
- isCancelled: e.isCancelled,
560
- preview: e.bodyPreview,
561
- meetingUrl: e.onlineMeeting?.joinUrl,
562
- webLink: e.webLink
563
- }));
564
- return jsonResult({ events, count: events.length });
565
- } catch (e) {
566
- return errorResult(e.message);
567
- }
568
- }
569
- },
570
- {
571
- name: "outlook_calendar_create",
572
- description: "Create a new calendar event. Supports attendees, location, online meeting (Teams), and recurrence.",
573
- category: "utility",
574
- parameters: {
575
- type: "object",
576
- properties: {
577
- subject: { type: "string", description: "Event subject/title" },
578
- start: { type: "string", description: "Start time (ISO 8601)" },
579
- end: { type: "string", description: "End time (ISO 8601)" },
580
- timeZone: { type: "string", description: "Time zone (default: UTC)" },
581
- location: { type: "string", description: "Location name" },
582
- body: { type: "string", description: "Event body/description" },
583
- attendees: { type: "string", description: "Attendee emails, comma-separated" },
584
- isOnlineMeeting: { type: "boolean", description: "Create a Teams meeting link (default: false)" },
585
- isAllDay: { type: "boolean", description: "All-day event" },
586
- importance: { type: "string", description: "low, normal, or high" },
587
- reminderMinutes: { type: "number", description: "Reminder before event in minutes (default: 15)" },
588
- calendarId: { type: "string", description: "Calendar ID (omit for default)" }
589
- },
590
- required: ["subject", "start", "end"]
591
- },
592
- async execute(_id, params) {
593
- try {
594
- const token = await tp.getAccessToken();
595
- const tz = params.timeZone || "UTC";
596
- const event = {
597
- subject: params.subject,
598
- start: { dateTime: params.start, timeZone: tz },
599
- end: { dateTime: params.end, timeZone: tz }
600
- };
601
- if (params.location) event.location = { displayName: params.location };
602
- if (params.body) event.body = { contentType: "HTML", content: params.body };
603
- if (params.attendees) {
604
- event.attendees = params.attendees.split(",").map((e) => ({
605
- emailAddress: { address: e.trim() },
606
- type: "required"
607
- }));
608
- }
609
- if (params.isOnlineMeeting) {
610
- event.isOnlineMeeting = true;
611
- event.onlineMeetingProvider = "teamsForBusiness";
612
- }
613
- if (params.isAllDay) event.isAllDay = true;
614
- if (params.importance) event.importance = params.importance;
615
- if (params.reminderMinutes !== void 0) {
616
- event.isReminderOn = true;
617
- event.reminderMinutesBefore = params.reminderMinutes;
618
- }
619
- const basePath = params.calendarId ? `/me/calendars/${params.calendarId}/events` : "/me/events";
620
- const created = await graph(token, basePath, { method: "POST", body: event });
621
- return jsonResult({
622
- id: created.id,
623
- subject: created.subject,
624
- start: created.start?.dateTime,
625
- end: created.end?.dateTime,
626
- meetingUrl: created.onlineMeeting?.joinUrl,
627
- webLink: created.webLink
628
- });
629
- } catch (e) {
630
- return errorResult(e.message);
631
- }
632
- }
633
- },
634
- {
635
- name: "outlook_calendar_update",
636
- description: "Update an existing calendar event.",
637
- category: "utility",
638
- parameters: {
639
- type: "object",
640
- properties: {
641
- eventId: { type: "string", description: "Event ID to update" },
642
- subject: { type: "string", description: "New subject" },
643
- start: { type: "string", description: "New start time (ISO 8601)" },
644
- end: { type: "string", description: "New end time (ISO 8601)" },
645
- timeZone: { type: "string", description: "Time zone" },
646
- location: { type: "string", description: "New location" },
647
- body: { type: "string", description: "New body content" }
648
- },
649
- required: ["eventId"]
650
- },
651
- async execute(_id, params) {
652
- try {
653
- const token = await tp.getAccessToken();
654
- const update = {};
655
- if (params.subject) update.subject = params.subject;
656
- if (params.start) update.start = { dateTime: params.start, timeZone: params.timeZone || "UTC" };
657
- if (params.end) update.end = { dateTime: params.end, timeZone: params.timeZone || "UTC" };
658
- if (params.location) update.location = { displayName: params.location };
659
- if (params.body) update.body = { contentType: "HTML", content: params.body };
660
- const updated = await graph(token, `/me/events/${params.eventId}`, { method: "PATCH", body: update });
661
- return jsonResult({ id: updated.id, subject: updated.subject, updated: true });
662
- } catch (e) {
663
- return errorResult(e.message);
664
- }
665
- }
666
- },
667
- {
668
- name: "outlook_calendar_delete",
669
- description: "Delete a calendar event.",
670
- category: "utility",
671
- parameters: {
672
- type: "object",
673
- properties: {
674
- eventId: { type: "string", description: "Event ID to delete" }
675
- },
676
- required: ["eventId"]
677
- },
678
- async execute(_id, params) {
679
- try {
680
- const token = await tp.getAccessToken();
681
- await graph(token, `/me/events/${params.eventId}`, { method: "DELETE" });
682
- return jsonResult({ deleted: true, eventId: params.eventId });
683
- } catch (e) {
684
- return errorResult(e.message);
685
- }
686
- }
687
- },
688
- {
689
- name: "outlook_calendar_respond",
690
- description: "Respond to a calendar event invitation (accept, tentatively accept, or decline).",
691
- category: "utility",
692
- parameters: {
693
- type: "object",
694
- properties: {
695
- eventId: { type: "string", description: "Event ID to respond to" },
696
- response: { type: "string", description: "accept, tentativelyAccept, or decline" },
697
- comment: { type: "string", description: "Optional response message" },
698
- sendResponse: { type: "boolean", description: "Send response to organizer (default: true)" }
699
- },
700
- required: ["eventId", "response"]
701
- },
702
- async execute(_id, params) {
703
- try {
704
- const token = await tp.getAccessToken();
705
- const body = { sendResponse: params.sendResponse !== false };
706
- if (params.comment) body.comment = params.comment;
707
- await graph(token, `/me/events/${params.eventId}/${params.response}`, { method: "POST", body });
708
- return jsonResult({ responded: true, eventId: params.eventId, response: params.response });
709
- } catch (e) {
710
- return errorResult(e.message);
711
- }
712
- }
713
- },
714
- {
715
- name: "outlook_calendar_freebusy",
716
- description: "Check free/busy availability for one or more users.",
717
- category: "utility",
718
- parameters: {
719
- type: "object",
720
- properties: {
721
- emails: { type: "string", description: "Email addresses to check, comma-separated" },
722
- start: { type: "string", description: "Start of range (ISO 8601)" },
723
- end: { type: "string", description: "End of range (ISO 8601)" },
724
- timeZone: { type: "string", description: "Time zone (default: UTC)" }
725
- },
726
- required: ["emails", "start", "end"]
727
- },
728
- async execute(_id, params) {
729
- try {
730
- const token = await tp.getAccessToken();
731
- const schedules = params.emails.split(",").map((e) => e.trim());
732
- const data = await graph(token, "/me/calendar/getSchedule", {
733
- method: "POST",
734
- body: {
735
- schedules,
736
- startTime: { dateTime: params.start, timeZone: params.timeZone || "UTC" },
737
- endTime: { dateTime: params.end, timeZone: params.timeZone || "UTC" },
738
- availabilityViewInterval: 30
739
- }
740
- });
741
- const results = (data.value || []).map((s) => ({
742
- email: s.scheduleId,
743
- availability: s.availabilityView,
744
- items: s.scheduleItems?.map((i) => ({
745
- status: i.status,
746
- subject: i.subject,
747
- start: i.start?.dateTime,
748
- end: i.end?.dateTime
749
- }))
750
- }));
751
- return jsonResult({ schedules: results });
752
- } catch (e) {
753
- return errorResult(e.message);
754
- }
755
- }
756
- }
757
- ];
758
- }
759
-
760
- // src/agent-tools/tools/microsoft/onedrive.ts
761
- function createOneDriveTools(config, _options) {
762
- const tp = config.tokenProvider;
763
- return [
764
- {
765
- name: "onedrive_list",
766
- description: "List files and folders in OneDrive. Defaults to root folder.",
767
- category: "utility",
768
- parameters: {
769
- type: "object",
770
- properties: {
771
- path: { type: "string", description: 'Folder path (e.g., "/Documents/Reports") or item ID. Default: root' },
772
- maxResults: { type: "number", description: "Max items to return (default: 50)" }
773
- },
774
- required: []
775
- },
776
- async execute(_id, params) {
777
- try {
778
- const token = await tp.getAccessToken();
779
- const top = params.maxResults || 50;
780
- const basePath = params.path ? `/me/drive/root:${params.path}:/children` : "/me/drive/root/children";
781
- const data = await graph(token, basePath, {
782
- query: { "$top": String(top), "$select": "id,name,size,createdDateTime,lastModifiedDateTime,webUrl,folder,file,parentReference" }
783
- });
784
- const items = (data.value || []).map((i) => ({
785
- id: i.id,
786
- name: i.name,
787
- size: i.size,
788
- type: i.folder ? "folder" : "file",
789
- mimeType: i.file?.mimeType,
790
- childCount: i.folder?.childCount,
791
- created: i.createdDateTime,
792
- modified: i.lastModifiedDateTime,
793
- webUrl: i.webUrl,
794
- path: i.parentReference?.path
795
- }));
796
- return jsonResult({ items, count: items.length });
797
- } catch (e) {
798
- return errorResult(e.message);
799
- }
800
- }
801
- },
802
- {
803
- name: "onedrive_search",
804
- description: "Search for files in OneDrive by name or content.",
805
- category: "utility",
806
- parameters: {
807
- type: "object",
808
- properties: {
809
- query: { type: "string", description: "Search query" },
810
- maxResults: { type: "number", description: "Max results (default: 20)" }
811
- },
812
- required: ["query"]
813
- },
814
- async execute(_id, params) {
815
- try {
816
- const token = await tp.getAccessToken();
817
- const top = params.maxResults || 20;
818
- const data = await graph(token, `/me/drive/root/search(q='${encodeURIComponent(params.query)}')`, {
819
- query: { "$top": String(top), "$select": "id,name,size,webUrl,file,folder,lastModifiedDateTime,parentReference" }
820
- });
821
- const items = (data.value || []).map((i) => ({
822
- id: i.id,
823
- name: i.name,
824
- size: i.size,
825
- type: i.folder ? "folder" : "file",
826
- mimeType: i.file?.mimeType,
827
- modified: i.lastModifiedDateTime,
828
- webUrl: i.webUrl,
829
- path: i.parentReference?.path
830
- }));
831
- return jsonResult({ items, count: items.length, query: params.query });
832
- } catch (e) {
833
- return errorResult(e.message);
834
- }
835
- }
836
- },
837
- {
838
- name: "onedrive_read",
839
- description: "Read/download a file from OneDrive. For text files returns content; for binary returns download URL.",
840
- category: "utility",
841
- parameters: {
842
- type: "object",
843
- properties: {
844
- itemId: { type: "string", description: "File item ID" },
845
- path: { type: "string", description: 'File path (alternative to itemId, e.g., "/Documents/report.txt")' }
846
- },
847
- required: []
848
- },
849
- async execute(_id, params) {
850
- try {
851
- const token = await tp.getAccessToken();
852
- const itemPath = params.itemId ? `/me/drive/items/${params.itemId}` : `/me/drive/root:${params.path}:`;
853
- const meta = await graph(token, itemPath, {
854
- query: { "$select": "id,name,size,file,webUrl,@microsoft.graph.downloadUrl" }
855
- });
856
- const isText = meta.file?.mimeType?.startsWith("text/") || /\.(txt|md|csv|json|xml|html|css|js|ts|py|rb|go|rs|yaml|yml|toml|ini|cfg|log|sh|bat|ps1|sql)$/i.test(meta.name || "");
857
- if (isText && meta.size < 1048576) {
858
- const contentRes = await fetch(meta["@microsoft.graph.downloadUrl"] || `https://graph.microsoft.com/v1.0${itemPath}/content`, {
859
- headers: { Authorization: `Bearer ${token}` }
860
- });
861
- const content = await contentRes.text();
862
- return jsonResult({ id: meta.id, name: meta.name, size: meta.size, content });
863
- }
864
- return jsonResult({
865
- id: meta.id,
866
- name: meta.name,
867
- size: meta.size,
868
- mimeType: meta.file?.mimeType,
869
- downloadUrl: meta["@microsoft.graph.downloadUrl"],
870
- webUrl: meta.webUrl
871
- });
872
- } catch (e) {
873
- return errorResult(e.message);
874
- }
875
- }
876
- },
877
- {
878
- name: "onedrive_upload",
879
- description: "Upload a text file to OneDrive. For small files (< 4MB).",
880
- category: "utility",
881
- parameters: {
882
- type: "object",
883
- properties: {
884
- path: { type: "string", description: 'Destination path (e.g., "/Documents/report.md")' },
885
- content: { type: "string", description: "File content (text)" },
886
- conflictBehavior: { type: "string", description: "rename, replace, or fail (default: replace)" }
887
- },
888
- required: ["path", "content"]
889
- },
890
- async execute(_id, params) {
891
- try {
892
- const token = await tp.getAccessToken();
893
- const conflict = params.conflictBehavior || "replace";
894
- const res = await fetch(`https://graph.microsoft.com/v1.0/me/drive/root:${params.path}:/content?@microsoft.graph.conflictBehavior=${conflict}`, {
895
- method: "PUT",
896
- headers: { Authorization: `Bearer ${token}`, "Content-Type": "text/plain" },
897
- body: params.content
898
- });
899
- if (!res.ok) throw new Error(`Upload failed: ${res.status} ${await res.text()}`);
900
- const data = await res.json();
901
- return jsonResult({ id: data.id, name: data.name, size: data.size, webUrl: data.webUrl });
902
- } catch (e) {
903
- return errorResult(e.message);
904
- }
905
- }
906
- },
907
- {
908
- name: "onedrive_create_folder",
909
- description: "Create a new folder in OneDrive.",
910
- category: "utility",
911
- parameters: {
912
- type: "object",
913
- properties: {
914
- name: { type: "string", description: "Folder name" },
915
- parentPath: { type: "string", description: "Parent folder path (default: root)" }
916
- },
917
- required: ["name"]
918
- },
919
- async execute(_id, params) {
920
- try {
921
- const token = await tp.getAccessToken();
922
- const parentPath = params.parentPath ? `/me/drive/root:${params.parentPath}:/children` : "/me/drive/root/children";
923
- const folder = await graph(token, parentPath, {
924
- method: "POST",
925
- body: { name: params.name, folder: {}, "@microsoft.graph.conflictBehavior": "rename" }
926
- });
927
- return jsonResult({ id: folder.id, name: folder.name, webUrl: folder.webUrl });
928
- } catch (e) {
929
- return errorResult(e.message);
930
- }
931
- }
932
- },
933
- {
934
- name: "onedrive_delete",
935
- description: "Delete a file or folder from OneDrive.",
936
- category: "utility",
937
- parameters: {
938
- type: "object",
939
- properties: {
940
- itemId: { type: "string", description: "Item ID to delete" }
941
- },
942
- required: ["itemId"]
943
- },
944
- async execute(_id, params) {
945
- try {
946
- const token = await tp.getAccessToken();
947
- await graph(token, `/me/drive/items/${params.itemId}`, { method: "DELETE" });
948
- return jsonResult({ deleted: true, itemId: params.itemId });
949
- } catch (e) {
950
- return errorResult(e.message);
951
- }
952
- }
953
- },
954
- {
955
- name: "onedrive_share",
956
- description: "Create a sharing link for a file or folder.",
957
- category: "utility",
958
- parameters: {
959
- type: "object",
960
- properties: {
961
- itemId: { type: "string", description: "Item ID to share" },
962
- type: { type: "string", description: "view or edit (default: view)" },
963
- scope: { type: "string", description: "anonymous (anyone) or organization (default: organization)" }
964
- },
965
- required: ["itemId"]
966
- },
967
- async execute(_id, params) {
968
- try {
969
- const token = await tp.getAccessToken();
970
- const link = await graph(token, `/me/drive/items/${params.itemId}/createLink`, {
971
- method: "POST",
972
- body: { type: params.type || "view", scope: params.scope || "organization" }
973
- });
974
- return jsonResult({ url: link.link?.webUrl, type: link.link?.type, scope: link.link?.scope });
975
- } catch (e) {
976
- return errorResult(e.message);
977
- }
978
- }
979
- }
980
- ];
981
- }
982
-
983
- // src/agent-tools/tools/microsoft/teams.ts
984
- function createTeamsTools(config, _options) {
985
- const tp = config.tokenProvider;
986
- return [
987
- {
988
- name: "teams_list_teams",
989
- description: "List all Teams the agent is a member of.",
990
- category: "utility",
991
- parameters: { type: "object", properties: {}, required: [] },
992
- async execute(_id) {
993
- try {
994
- const token = await tp.getAccessToken();
995
- const data = await graph(token, "/me/joinedTeams", {
996
- query: { "$select": "id,displayName,description" }
997
- });
998
- const teams = (data.value || []).map((t) => ({
999
- id: t.id,
1000
- name: t.displayName,
1001
- description: t.description
1002
- }));
1003
- return jsonResult({ teams, count: teams.length });
1004
- } catch (e) {
1005
- return errorResult(e.message);
1006
- }
1007
- }
1008
- },
1009
- {
1010
- name: "teams_list_channels",
1011
- description: "List channels in a Team.",
1012
- category: "utility",
1013
- parameters: {
1014
- type: "object",
1015
- properties: {
1016
- teamId: { type: "string", description: "Team ID" }
1017
- },
1018
- required: ["teamId"]
1019
- },
1020
- async execute(_id, params) {
1021
- try {
1022
- const token = await tp.getAccessToken();
1023
- const data = await graph(token, `/teams/${params.teamId}/channels`, {
1024
- query: { "$select": "id,displayName,description,membershipType" }
1025
- });
1026
- const channels = (data.value || []).map((c) => ({
1027
- id: c.id,
1028
- name: c.displayName,
1029
- description: c.description,
1030
- membershipType: c.membershipType
1031
- }));
1032
- return jsonResult({ channels, count: channels.length });
1033
- } catch (e) {
1034
- return errorResult(e.message);
1035
- }
1036
- }
1037
- },
1038
- {
1039
- name: "teams_send_channel_message",
1040
- description: "Send a message to a Teams channel.",
1041
- category: "utility",
1042
- parameters: {
1043
- type: "object",
1044
- properties: {
1045
- teamId: { type: "string", description: "Team ID" },
1046
- channelId: { type: "string", description: "Channel ID" },
1047
- message: { type: "string", description: "Message content (supports HTML)" },
1048
- isHtml: { type: "boolean", description: "Whether message is HTML (default: false)" }
1049
- },
1050
- required: ["teamId", "channelId", "message"]
1051
- },
1052
- async execute(_id, params) {
1053
- try {
1054
- const token = await tp.getAccessToken();
1055
- const msg = await graph(token, `/teams/${params.teamId}/channels/${params.channelId}/messages`, {
1056
- method: "POST",
1057
- body: {
1058
- body: {
1059
- contentType: params.isHtml ? "html" : "text",
1060
- content: params.message
1061
- }
1062
- }
1063
- });
1064
- return jsonResult({ id: msg.id, sent: true });
1065
- } catch (e) {
1066
- return errorResult(e.message);
1067
- }
1068
- }
1069
- },
1070
- {
1071
- name: "teams_read_channel_messages",
1072
- description: "Read recent messages from a Teams channel.",
1073
- category: "utility",
1074
- parameters: {
1075
- type: "object",
1076
- properties: {
1077
- teamId: { type: "string", description: "Team ID" },
1078
- channelId: { type: "string", description: "Channel ID" },
1079
- maxResults: { type: "number", description: "Max messages (default: 20)" }
1080
- },
1081
- required: ["teamId", "channelId"]
1082
- },
1083
- async execute(_id, params) {
1084
- try {
1085
- const token = await tp.getAccessToken();
1086
- const data = await graph(token, `/teams/${params.teamId}/channels/${params.channelId}/messages`, {
1087
- query: { "$top": String(params.maxResults || 20) }
1088
- });
1089
- const messages = (data.value || []).map((m) => ({
1090
- id: m.id,
1091
- from: m.from?.user?.displayName || m.from?.application?.displayName,
1092
- fromEmail: m.from?.user?.email,
1093
- body: m.body?.content,
1094
- bodyType: m.body?.contentType,
1095
- date: m.createdDateTime,
1096
- importance: m.importance,
1097
- replyCount: m.replies?.length
1098
- }));
1099
- return jsonResult({ messages, count: messages.length });
1100
- } catch (e) {
1101
- return errorResult(e.message);
1102
- }
1103
- }
1104
- },
1105
- {
1106
- name: "teams_list_chats",
1107
- description: "List the agent's 1:1 and group chats in Teams.",
1108
- category: "utility",
1109
- parameters: {
1110
- type: "object",
1111
- properties: {
1112
- maxResults: { type: "number", description: "Max chats to return (default: 20)" }
1113
- },
1114
- required: []
1115
- },
1116
- async execute(_id, params) {
1117
- try {
1118
- const token = await tp.getAccessToken();
1119
- const data = await graph(token, "/me/chats", {
1120
- query: {
1121
- "$top": String(params.maxResults || 20),
1122
- "$select": "id,topic,chatType,createdDateTime,lastUpdatedDateTime",
1123
- "$orderby": "lastUpdatedDateTime desc"
1124
- }
1125
- });
1126
- const chats = (data.value || []).map((c) => ({
1127
- id: c.id,
1128
- topic: c.topic,
1129
- type: c.chatType,
1130
- created: c.createdDateTime,
1131
- lastUpdated: c.lastUpdatedDateTime
1132
- }));
1133
- return jsonResult({ chats, count: chats.length });
1134
- } catch (e) {
1135
- return errorResult(e.message);
1136
- }
1137
- }
1138
- },
1139
- {
1140
- name: "teams_send_chat_message",
1141
- description: "Send a message in a Teams 1:1 or group chat.",
1142
- category: "utility",
1143
- parameters: {
1144
- type: "object",
1145
- properties: {
1146
- chatId: { type: "string", description: "Chat ID" },
1147
- message: { type: "string", description: "Message content" },
1148
- isHtml: { type: "boolean", description: "Whether message is HTML (default: false)" }
1149
- },
1150
- required: ["chatId", "message"]
1151
- },
1152
- async execute(_id, params) {
1153
- try {
1154
- const token = await tp.getAccessToken();
1155
- const msg = await graph(token, `/chats/${params.chatId}/messages`, {
1156
- method: "POST",
1157
- body: {
1158
- body: { contentType: params.isHtml ? "html" : "text", content: params.message }
1159
- }
1160
- });
1161
- return jsonResult({ id: msg.id, sent: true });
1162
- } catch (e) {
1163
- return errorResult(e.message);
1164
- }
1165
- }
1166
- },
1167
- {
1168
- name: "teams_read_chat_messages",
1169
- description: "Read recent messages from a Teams chat.",
1170
- category: "utility",
1171
- parameters: {
1172
- type: "object",
1173
- properties: {
1174
- chatId: { type: "string", description: "Chat ID" },
1175
- maxResults: { type: "number", description: "Max messages (default: 20)" }
1176
- },
1177
- required: ["chatId"]
1178
- },
1179
- async execute(_id, params) {
1180
- try {
1181
- const token = await tp.getAccessToken();
1182
- const data = await graph(token, `/chats/${params.chatId}/messages`, {
1183
- query: { "$top": String(params.maxResults || 20), "$orderby": "createdDateTime desc" }
1184
- });
1185
- const messages = (data.value || []).map((m) => ({
1186
- id: m.id,
1187
- from: m.from?.user?.displayName,
1188
- body: m.body?.content,
1189
- bodyType: m.body?.contentType,
1190
- date: m.createdDateTime
1191
- }));
1192
- return jsonResult({ messages, count: messages.length });
1193
- } catch (e) {
1194
- return errorResult(e.message);
1195
- }
1196
- }
1197
- },
1198
- {
1199
- name: "teams_presence",
1200
- description: "Get presence/availability status for users.",
1201
- category: "utility",
1202
- parameters: {
1203
- type: "object",
1204
- properties: {
1205
- userIds: { type: "string", description: 'User IDs, comma-separated (use "me" for self)' }
1206
- },
1207
- required: ["userIds"]
1208
- },
1209
- async execute(_id, params) {
1210
- try {
1211
- const token = await tp.getAccessToken();
1212
- if (params.userIds === "me") {
1213
- const p = await graph(token, "/me/presence");
1214
- return jsonResult({ presence: [{ availability: p.availability, activity: p.activity }] });
1215
- }
1216
- const ids = params.userIds.split(",").map((s) => s.trim());
1217
- const data = await graph(token, "/communications/getPresencesByUserId", {
1218
- method: "POST",
1219
- body: { ids }
1220
- });
1221
- const presence = (data.value || []).map((p) => ({
1222
- userId: p.id,
1223
- availability: p.availability,
1224
- activity: p.activity
1225
- }));
1226
- return jsonResult({ presence });
1227
- } catch (e) {
1228
- return errorResult(e.message);
1229
- }
1230
- }
1231
- }
1232
- ];
1233
- }
1234
-
1235
- // src/agent-tools/tools/microsoft/todo.ts
1236
- function createTodoTools(config, _options) {
1237
- const tp = config.tokenProvider;
1238
- return [
1239
- {
1240
- name: "todo_list_lists",
1241
- description: "List all To Do task lists.",
1242
- category: "utility",
1243
- parameters: { type: "object", properties: {}, required: [] },
1244
- async execute(_id) {
1245
- try {
1246
- const token = await tp.getAccessToken();
1247
- const data = await graph(token, "/me/todo/lists");
1248
- const lists = (data.value || []).map((l) => ({
1249
- id: l.id,
1250
- name: l.displayName,
1251
- isOwner: l.isOwner,
1252
- wellknownName: l.wellknownListName
1253
- }));
1254
- return jsonResult({ lists, count: lists.length });
1255
- } catch (e) {
1256
- return errorResult(e.message);
1257
- }
1258
- }
1259
- },
1260
- {
1261
- name: "todo_list_tasks",
1262
- description: "List tasks in a To Do list.",
1263
- category: "utility",
1264
- parameters: {
1265
- type: "object",
1266
- properties: {
1267
- listId: { type: "string", description: "Task list ID" },
1268
- includeCompleted: { type: "boolean", description: "Include completed tasks (default: false)" },
1269
- maxResults: { type: "number", description: "Max tasks (default: 50)" }
1270
- },
1271
- required: ["listId"]
1272
- },
1273
- async execute(_id, params) {
1274
- try {
1275
- const token = await tp.getAccessToken();
1276
- const query = {
1277
- "$top": String(params.maxResults || 50),
1278
- "$orderby": "importance desc,createdDateTime desc",
1279
- "$select": "id,title,body,status,importance,createdDateTime,lastModifiedDateTime,dueDateTime,completedDateTime,isReminderOn,reminderDateTime"
1280
- };
1281
- if (!params.includeCompleted) query["$filter"] = "status ne 'completed'";
1282
- const data = await graph(token, `/me/todo/lists/${params.listId}/tasks`, { query });
1283
- const tasks = (data.value || []).map((t) => ({
1284
- id: t.id,
1285
- title: t.title,
1286
- body: t.body?.content,
1287
- bodyType: t.body?.contentType,
1288
- status: t.status,
1289
- importance: t.importance,
1290
- created: t.createdDateTime,
1291
- modified: t.lastModifiedDateTime,
1292
- dueDate: t.dueDateTime?.dateTime,
1293
- dueTimeZone: t.dueDateTime?.timeZone,
1294
- completedDate: t.completedDateTime?.dateTime,
1295
- hasReminder: t.isReminderOn
1296
- }));
1297
- return jsonResult({ tasks, count: tasks.length });
1298
- } catch (e) {
1299
- return errorResult(e.message);
1300
- }
1301
- }
1302
- },
1303
- {
1304
- name: "todo_create_task",
1305
- description: "Create a new task in a To Do list.",
1306
- category: "utility",
1307
- parameters: {
1308
- type: "object",
1309
- properties: {
1310
- listId: { type: "string", description: "Task list ID" },
1311
- title: { type: "string", description: "Task title" },
1312
- body: { type: "string", description: "Task notes/description" },
1313
- dueDate: { type: "string", description: 'Due date (ISO 8601 date, e.g., "2026-03-15")' },
1314
- importance: { type: "string", description: "low, normal, or high (default: normal)" },
1315
- reminderDateTime: { type: "string", description: "Reminder date/time (ISO 8601)" }
1316
- },
1317
- required: ["listId", "title"]
1318
- },
1319
- async execute(_id, params) {
1320
- try {
1321
- const token = await tp.getAccessToken();
1322
- const task = { title: params.title };
1323
- if (params.body) task.body = { contentType: "text", content: params.body };
1324
- if (params.dueDate) task.dueDateTime = { dateTime: params.dueDate + "T00:00:00", timeZone: "UTC" };
1325
- if (params.importance) task.importance = params.importance;
1326
- if (params.reminderDateTime) {
1327
- task.isReminderOn = true;
1328
- task.reminderDateTime = { dateTime: params.reminderDateTime, timeZone: "UTC" };
1329
- }
1330
- const created = await graph(token, `/me/todo/lists/${params.listId}/tasks`, { method: "POST", body: task });
1331
- return jsonResult({ id: created.id, title: created.title, status: created.status });
1332
- } catch (e) {
1333
- return errorResult(e.message);
1334
- }
1335
- }
1336
- },
1337
- {
1338
- name: "todo_update_task",
1339
- description: "Update an existing To Do task (title, status, due date, importance).",
1340
- category: "utility",
1341
- parameters: {
1342
- type: "object",
1343
- properties: {
1344
- listId: { type: "string", description: "Task list ID" },
1345
- taskId: { type: "string", description: "Task ID" },
1346
- title: { type: "string", description: "New title" },
1347
- status: { type: "string", description: "notStarted, inProgress, completed, waitingOnOthers, deferred" },
1348
- importance: { type: "string", description: "low, normal, or high" },
1349
- dueDate: { type: "string", description: "New due date (ISO 8601 date)" },
1350
- body: { type: "string", description: "New task notes" }
1351
- },
1352
- required: ["listId", "taskId"]
1353
- },
1354
- async execute(_id, params) {
1355
- try {
1356
- const token = await tp.getAccessToken();
1357
- const update = {};
1358
- if (params.title) update.title = params.title;
1359
- if (params.status) update.status = params.status;
1360
- if (params.importance) update.importance = params.importance;
1361
- if (params.dueDate) update.dueDateTime = { dateTime: params.dueDate + "T00:00:00", timeZone: "UTC" };
1362
- if (params.body) update.body = { contentType: "text", content: params.body };
1363
- const updated = await graph(token, `/me/todo/lists/${params.listId}/tasks/${params.taskId}`, {
1364
- method: "PATCH",
1365
- body: update
1366
- });
1367
- return jsonResult({ id: updated.id, title: updated.title, status: updated.status, updated: true });
1368
- } catch (e) {
1369
- return errorResult(e.message);
1370
- }
1371
- }
1372
- },
1373
- {
1374
- name: "todo_delete_task",
1375
- description: "Delete a To Do task.",
1376
- category: "utility",
1377
- parameters: {
1378
- type: "object",
1379
- properties: {
1380
- listId: { type: "string", description: "Task list ID" },
1381
- taskId: { type: "string", description: "Task ID to delete" }
1382
- },
1383
- required: ["listId", "taskId"]
1384
- },
1385
- async execute(_id, params) {
1386
- try {
1387
- const token = await tp.getAccessToken();
1388
- await graph(token, `/me/todo/lists/${params.listId}/tasks/${params.taskId}`, { method: "DELETE" });
1389
- return jsonResult({ deleted: true, taskId: params.taskId });
1390
- } catch (e) {
1391
- return errorResult(e.message);
1392
- }
1393
- }
1394
- },
1395
- {
1396
- name: "todo_create_list",
1397
- description: "Create a new To Do task list.",
1398
- category: "utility",
1399
- parameters: {
1400
- type: "object",
1401
- properties: {
1402
- name: { type: "string", description: "List name" }
1403
- },
1404
- required: ["name"]
1405
- },
1406
- async execute(_id, params) {
1407
- try {
1408
- const token = await tp.getAccessToken();
1409
- const list = await graph(token, "/me/todo/lists", {
1410
- method: "POST",
1411
- body: { displayName: params.name }
1412
- });
1413
- return jsonResult({ id: list.id, name: list.displayName });
1414
- } catch (e) {
1415
- return errorResult(e.message);
1416
- }
1417
- }
1418
- }
1419
- ];
1420
- }
1421
-
1422
- // src/agent-tools/tools/microsoft/contacts.ts
1423
- function createOutlookContactsTools(config, _options) {
1424
- const tp = config.tokenProvider;
1425
- return [
1426
- {
1427
- name: "outlook_contacts_list",
1428
- description: "List contacts from the Outlook address book.",
1429
- category: "utility",
1430
- parameters: {
1431
- type: "object",
1432
- properties: {
1433
- maxResults: { type: "number", description: "Max contacts (default: 50)" },
1434
- search: { type: "string", description: "Search by name or email" }
1435
- },
1436
- required: []
1437
- },
1438
- async execute(_id, params) {
1439
- try {
1440
- const token = await tp.getAccessToken();
1441
- const query = {
1442
- "$top": String(params.maxResults || 50),
1443
- "$select": "id,displayName,givenName,surname,emailAddresses,mobilePhone,businessPhones,companyName,jobTitle",
1444
- "$orderby": "displayName"
1445
- };
1446
- if (params.search) query["$filter"] = `startswith(displayName,'${params.search}') or startswith(givenName,'${params.search}') or startswith(surname,'${params.search}')`;
1447
- const data = await graph(token, "/me/contacts", { query });
1448
- const contacts = (data.value || []).map((c) => ({
1449
- id: c.id,
1450
- name: c.displayName,
1451
- firstName: c.givenName,
1452
- lastName: c.surname,
1453
- emails: c.emailAddresses?.map((e) => e.address),
1454
- mobile: c.mobilePhone,
1455
- phones: c.businessPhones,
1456
- company: c.companyName,
1457
- jobTitle: c.jobTitle
1458
- }));
1459
- return jsonResult({ contacts, count: contacts.length });
1460
- } catch (e) {
1461
- return errorResult(e.message);
1462
- }
1463
- }
1464
- },
1465
- {
1466
- name: "outlook_contacts_create",
1467
- description: "Create a new contact in Outlook.",
1468
- category: "utility",
1469
- parameters: {
1470
- type: "object",
1471
- properties: {
1472
- firstName: { type: "string", description: "First name" },
1473
- lastName: { type: "string", description: "Last name" },
1474
- email: { type: "string", description: "Email address" },
1475
- mobile: { type: "string", description: "Mobile phone number" },
1476
- company: { type: "string", description: "Company name" },
1477
- jobTitle: { type: "string", description: "Job title" },
1478
- notes: { type: "string", description: "Personal notes" }
1479
- },
1480
- required: ["firstName", "email"]
1481
- },
1482
- async execute(_id, params) {
1483
- try {
1484
- const token = await tp.getAccessToken();
1485
- const contact = {
1486
- givenName: params.firstName,
1487
- emailAddresses: [{ address: params.email, name: `${params.firstName} ${params.lastName || ""}`.trim() }]
1488
- };
1489
- if (params.lastName) contact.surname = params.lastName;
1490
- if (params.mobile) contact.mobilePhone = params.mobile;
1491
- if (params.company) contact.companyName = params.company;
1492
- if (params.jobTitle) contact.jobTitle = params.jobTitle;
1493
- if (params.notes) contact.personalNotes = params.notes;
1494
- const created = await graph(token, "/me/contacts", { method: "POST", body: contact });
1495
- return jsonResult({ id: created.id, name: created.displayName, email: params.email });
1496
- } catch (e) {
1497
- return errorResult(e.message);
1498
- }
1499
- }
1500
- },
1501
- {
1502
- name: "outlook_contacts_update",
1503
- description: "Update an existing contact.",
1504
- category: "utility",
1505
- parameters: {
1506
- type: "object",
1507
- properties: {
1508
- contactId: { type: "string", description: "Contact ID" },
1509
- firstName: { type: "string", description: "First name" },
1510
- lastName: { type: "string", description: "Last name" },
1511
- email: { type: "string", description: "Email address" },
1512
- mobile: { type: "string", description: "Mobile phone" },
1513
- company: { type: "string", description: "Company name" },
1514
- jobTitle: { type: "string", description: "Job title" }
1515
- },
1516
- required: ["contactId"]
1517
- },
1518
- async execute(_id, params) {
1519
- try {
1520
- const token = await tp.getAccessToken();
1521
- const update = {};
1522
- if (params.firstName) update.givenName = params.firstName;
1523
- if (params.lastName) update.surname = params.lastName;
1524
- if (params.email) update.emailAddresses = [{ address: params.email }];
1525
- if (params.mobile) update.mobilePhone = params.mobile;
1526
- if (params.company) update.companyName = params.company;
1527
- if (params.jobTitle) update.jobTitle = params.jobTitle;
1528
- await graph(token, `/me/contacts/${params.contactId}`, { method: "PATCH", body: update });
1529
- return jsonResult({ updated: true, contactId: params.contactId });
1530
- } catch (e) {
1531
- return errorResult(e.message);
1532
- }
1533
- }
1534
- },
1535
- {
1536
- name: "outlook_contacts_delete",
1537
- description: "Delete a contact from Outlook.",
1538
- category: "utility",
1539
- parameters: {
1540
- type: "object",
1541
- properties: {
1542
- contactId: { type: "string", description: "Contact ID to delete" }
1543
- },
1544
- required: ["contactId"]
1545
- },
1546
- async execute(_id, params) {
1547
- try {
1548
- const token = await tp.getAccessToken();
1549
- await graph(token, `/me/contacts/${params.contactId}`, { method: "DELETE" });
1550
- return jsonResult({ deleted: true, contactId: params.contactId });
1551
- } catch (e) {
1552
- return errorResult(e.message);
1553
- }
1554
- }
1555
- },
1556
- {
1557
- name: "outlook_people_search",
1558
- description: "Search for people relevant to the user (contacts, colleagues, recent correspondents).",
1559
- category: "utility",
1560
- parameters: {
1561
- type: "object",
1562
- properties: {
1563
- query: { type: "string", description: "Search query (name or email)" },
1564
- maxResults: { type: "number", description: "Max results (default: 10)" }
1565
- },
1566
- required: ["query"]
1567
- },
1568
- async execute(_id, params) {
1569
- try {
1570
- const token = await tp.getAccessToken();
1571
- const data = await graph(token, "/me/people", {
1572
- query: {
1573
- "$search": `"${params.query}"`,
1574
- "$top": String(params.maxResults || 10),
1575
- "$select": "id,displayName,givenName,surname,emailAddresses,companyName,jobTitle,department"
1576
- }
1577
- });
1578
- const people = (data.value || []).map((p) => ({
1579
- id: p.id,
1580
- name: p.displayName,
1581
- firstName: p.givenName,
1582
- lastName: p.surname,
1583
- emails: p.emailAddresses?.map((e) => e.address),
1584
- company: p.companyName,
1585
- jobTitle: p.jobTitle,
1586
- department: p.department
1587
- }));
1588
- return jsonResult({ people, count: people.length });
1589
- } catch (e) {
1590
- return errorResult(e.message);
1591
- }
1592
- }
1593
- }
1594
- ];
1595
- }
1596
-
1597
- // src/agent-tools/tools/microsoft/index.ts
1598
- function createAllMicrosoftTools(config, options) {
1599
- const enabled = options?.enabledMicrosoftServices;
1600
- const has = (s) => enabled ? enabled.includes(s) : false;
1601
- const core = !enabled;
1602
- const tools = [];
1603
- if (core || has("mail")) tools.push(...createOutlookMailTools(config, options));
1604
- if (core || has("calendar")) tools.push(...createOutlookCalendarTools(config, options));
1605
- if (core || has("onedrive")) tools.push(...createOneDriveTools(config, options));
1606
- if (core || has("tasks")) tools.push(...createTodoTools(config, options));
1607
- if (has("teams")) tools.push(...createTeamsTools(config, options));
1608
- if (has("contacts")) tools.push(...createOutlookContactsTools(config, options));
1609
- return tools;
1610
- }
1611
- export {
1612
- createAllMicrosoftTools,
1613
- createOneDriveTools,
1614
- createOutlookCalendarTools,
1615
- createOutlookContactsTools,
1616
- createOutlookMailTools,
1617
- createTeamsTools,
1618
- createTodoTools
1619
- };