@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
@@ -299,7 +299,7 @@ export function createExcelAdvancedTools(config: MicrosoftToolsConfig, _options?
299
299
  const rangePath = `${base}/workbook/worksheets/${encodeURIComponent(ws)}/range(address='${params.range}')`;
300
300
 
301
301
  // Build format object
302
- const format: any = {};
302
+ const _format: any = {};
303
303
  if (params.numberFormat) {
304
304
  // numberFormat needs to be an array matching the range dimensions
305
305
  await graph(token, `${rangePath}/format`, { method: 'PATCH', body: { columnWidth: null } }); // ensure format exists
@@ -68,7 +68,7 @@ export function createExcelTools(config: MicrosoftToolsConfig, _options?: ToolCr
68
68
  const base = itemPath(params);
69
69
  let rangePath: string;
70
70
  if (params.range) {
71
- const ws = params.worksheet ? `/worksheets/${encodeURIComponent(params.worksheet)}` : '/worksheets';
71
+ const _ws = params.worksheet ? `/worksheets/${encodeURIComponent(params.worksheet)}` : '/worksheets';
72
72
  // If range contains !, it has sheet name embedded
73
73
  if (params.range.includes('!')) {
74
74
  rangePath = `${base}/workbook/worksheets/${encodeURIComponent(params.range.split('!')[0])}/range(address='${params.range.split('!')[1]}')`;
@@ -44,7 +44,7 @@ export function createPowerPointTools(config: MicrosoftToolsConfig, _options?: T
44
44
  // Get slide count via preview
45
45
  let slideCount: number | null = null;
46
46
  try {
47
- const preview = await graph(token, `${base}/preview`, { method: 'POST', body: {} });
47
+ const _preview = await graph(token, `${base}/preview`, { method: 'POST', body: {} });
48
48
  // Preview doesn't directly give count, but we can try thumbnails
49
49
  const thumbs = await graph(token, `${base}/thumbnails`);
50
50
  if (thumbs.value?.[0]) slideCount = Object.keys(thumbs.value[0]).filter((k: string) => k !== 'id').length;
@@ -14,7 +14,7 @@ import { calculateSimilarity as _calcSim } from './phash.js';
14
14
  import * as diff from './diff.js';
15
15
 
16
16
  // Session management
17
- let currentSessionId: number = 0;
17
+ let _currentSessionId: number = 0;
18
18
  const activeSessions = new Map<string, number>();
19
19
 
20
20
  /**
@@ -53,7 +53,7 @@ export function createVisualMemoryTools(options: ToolCreationOptions): AnyAgentT
53
53
  },
54
54
  required: ['source'],
55
55
  },
56
- async execute(toolCallId: string, params: any) {
56
+ async execute(_toolCallId: string, params: any) {
57
57
  try {
58
58
  let result: Awaited<ReturnType<typeof capture.captureFromScreenshot>>;
59
59
 
@@ -150,7 +150,7 @@ export function createVisualMemoryTools(options: ToolCreationOptions): AnyAgentT
150
150
  },
151
151
  required: [],
152
152
  },
153
- async execute(toolCallId: string, params: any) {
153
+ async execute(_toolCallId: string, params: any) {
154
154
  try {
155
155
  const observations = await storage.queryObservations(agentId, {
156
156
  sessionId: params.sessionId,
@@ -197,7 +197,7 @@ export function createVisualMemoryTools(options: ToolCreationOptions): AnyAgentT
197
197
  },
198
198
  required: ['id1', 'id2'],
199
199
  },
200
- async execute(toolCallId: string, params: any) {
200
+ async execute(_toolCallId: string, params: any) {
201
201
  try {
202
202
  const obs1 = await storage.getObservation(agentId, params.id1);
203
203
  const obs2 = await storage.getObservation(agentId, params.id2);
@@ -256,7 +256,7 @@ export function createVisualMemoryTools(options: ToolCreationOptions): AnyAgentT
256
256
  },
257
257
  required: ['beforeId', 'afterId'],
258
258
  },
259
- async execute(toolCallId: string, params: any) {
259
+ async execute(_toolCallId: string, params: any) {
260
260
  try {
261
261
  const beforeObs = await storage.getObservation(agentId, params.beforeId);
262
262
  const afterObs = await storage.getObservation(agentId, params.afterId);
@@ -320,7 +320,7 @@ export function createVisualMemoryTools(options: ToolCreationOptions): AnyAgentT
320
320
  },
321
321
  required: ['targetId'],
322
322
  },
323
- async execute(toolCallId: string, params: any) {
323
+ async execute(_toolCallId: string, params: any) {
324
324
  try {
325
325
  const targetObs = await storage.getObservation(agentId, params.targetId);
326
326
  if (!targetObs) {
@@ -384,7 +384,7 @@ export function createVisualMemoryTools(options: ToolCreationOptions): AnyAgentT
384
384
  },
385
385
  required: ['baselineId'],
386
386
  },
387
- async execute(toolCallId: string, params: any) {
387
+ async execute(_toolCallId: string, params: any) {
388
388
  try {
389
389
  const baseline = await storage.getObservation(agentId, params.baselineId);
390
390
  if (!baseline) {
@@ -495,7 +495,7 @@ export function createVisualMemoryTools(options: ToolCreationOptions): AnyAgentT
495
495
  },
496
496
  required: ['observationId'],
497
497
  },
498
- async execute(toolCallId: string, params: any) {
498
+ async execute(_toolCallId: string, params: any) {
499
499
  try {
500
500
  const observation = await storage.getObservation(agentId, params.observationId);
501
501
  if (!observation) {
@@ -550,7 +550,7 @@ export function createVisualMemoryTools(options: ToolCreationOptions): AnyAgentT
550
550
  properties: {},
551
551
  required: [],
552
552
  },
553
- async execute(toolCallId: string, params: any) {
553
+ async execute(_toolCallId: string, _params: any) {
554
554
  try {
555
555
  const stats = await storage.getStoreStats(agentId);
556
556
 
@@ -608,7 +608,7 @@ export function createVisualMemoryTools(options: ToolCreationOptions): AnyAgentT
608
608
  },
609
609
  required: [],
610
610
  },
611
- async execute(toolCallId: string, params: any) {
611
+ async execute(_toolCallId: string, params: any) {
612
612
  try {
613
613
  const store = await storage.loadStore(agentId);
614
614
  const sessionId = ++store.sessionCount;
@@ -647,7 +647,7 @@ export function createVisualMemoryTools(options: ToolCreationOptions): AnyAgentT
647
647
  },
648
648
  required: [],
649
649
  },
650
- async execute(toolCallId: string, params: any) {
650
+ async execute(_toolCallId: string, params: any) {
651
651
  try {
652
652
  const sessionKey = `${agentId}-session`;
653
653
  const sessionId = params.sessionId || activeSessions.get(sessionKey) || 0;
@@ -4,8 +4,8 @@
4
4
  * Implements fast similarity search using perceptual hashes and filtering.
5
5
  */
6
6
 
7
- import { VisualObservation, SimilarityMatch, VisualQuery } from './types.js';
8
- import { calculateSimilarity, hammingDistance } from './phash.js';
7
+ import { VisualObservation, SimilarityMatch } from './types.js';
8
+ import { calculateSimilarity } from './phash.js';
9
9
  import { queryObservations } from './storage.js';
10
10
 
11
11
  /**
@@ -486,7 +486,7 @@ export async function loadStore(agentId: string): Promise<VisualMemoryStore> {
486
486
  /**
487
487
  * Save store — no-op in enterprise (DB handles persistence).
488
488
  */
489
- export async function saveStore(_agentId: string, store: VisualMemoryStore): Promise<void> {
489
+ export async function saveStore(_agentId: string, _store: VisualMemoryStore): Promise<void> {
490
490
  // DB-backed: no-op
491
491
  }
492
492
 
@@ -62,7 +62,7 @@ export function detectImapSettings(email: string): { imapHost: string; imapPort:
62
62
  if (!domain) return null;
63
63
 
64
64
  // Check presets
65
- for (const [key, preset] of Object.entries(IMAP_PRESETS)) {
65
+ for (const [key, _preset] of Object.entries(IMAP_PRESETS)) {
66
66
  if (domain.includes(key) || domain === 'gmail.com' || domain === 'outlook.com' || domain === 'hotmail.com') {
67
67
  if (domain === 'gmail.com' || domain.endsWith('.google.com')) return IMAP_PRESETS.gmail;
68
68
  if (domain === 'outlook.com' || domain === 'hotmail.com' || domain.endsWith('.onmicrosoft.com')) return IMAP_PRESETS.microsoft365;
@@ -83,7 +83,7 @@ export class ImapEmailProvider implements IEmailProvider {
83
83
 
84
84
  // IMAP connection (lazy-loaded to avoid bundling the dep if not used)
85
85
  private imapClient: any = null;
86
- private smtpClient: any = null;
86
+ private _smtpClient: any = null;
87
87
 
88
88
  private getIdentity(): ImapEmailIdentity {
89
89
  if (!this.identity) throw new Error('Not connected — call connect() first');
@@ -267,7 +267,7 @@ export function createSubsystemLogger(name: string): SubsystemLogger {
267
267
  info: (...args: any[]) => console.log(prefix, ...args),
268
268
  warn: (...args: any[]) => console.warn(prefix, ...args),
269
269
  error: (...args: any[]) => console.error(prefix, ...args),
270
- debug: (...args: any[]) => { /* silent in production */ },
270
+ debug: (..._args: any[]) => { /* silent in production */ },
271
271
  child: (sub: string) => createSubsystemLogger(`${name}:${sub}`),
272
272
  };
273
273
  return logger;
package/src/cli-agent.ts CHANGED
@@ -2081,7 +2081,7 @@ Available tools: gmail_send (to, subject, body) or agenticmail_send (to, subject
2081
2081
  (global as any).__autonomyManager = autonomy;
2082
2082
 
2083
2083
  // Store autonomy ref for shutdown
2084
- const origShutdown = process.listeners('SIGTERM');
2084
+ const _origShutdown = process.listeners('SIGTERM');
2085
2085
  process.on('SIGTERM', () => autonomy.stop());
2086
2086
  process.on('SIGINT', () => autonomy.stop());
2087
2087
  } catch (autoErr: any) {
@@ -2166,7 +2166,7 @@ Available tools: gmail_send (to, subject, body) or agenticmail_send (to, subject
2166
2166
 
2167
2167
  async function startCalendarPolling(
2168
2168
  agentId: string, config: any, runtime: any,
2169
- engineDb: any, memoryManager: any,
2169
+ _engineDb: any, _memoryManager: any,
2170
2170
  sessionRouter?: any,
2171
2171
  ) {
2172
2172
  const emailConfig = config.emailConfig;
@@ -2341,7 +2341,7 @@ async function startCalendarPolling(
2341
2341
  // ─── Email System Prompt Builder ──────────────────────
2342
2342
 
2343
2343
  /** Build a schedule awareness block for system prompts */
2344
- function buildScheduleContext(schedule?: { start: string; end: string; days: number[] }, timezone?: string): string {
2344
+ function _buildScheduleContext(schedule?: { start: string; end: string; days: number[] }, timezone?: string): string {
2345
2345
  if (!schedule) return '';
2346
2346
  const dayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
2347
2347
  const workDays = schedule.days.map(d => dayNames[d]).join(', ');
package/src/cli-serve.ts CHANGED
@@ -106,7 +106,7 @@ export async function runServe(_args: string[]) {
106
106
  await ensureSecrets();
107
107
 
108
108
  const JWT_SECRET = process.env.JWT_SECRET!;
109
- const VAULT_KEY = process.env.AGENTICMAIL_VAULT_KEY!;
109
+ const _VAULT_KEY = process.env.AGENTICMAIL_VAULT_KEY!;
110
110
 
111
111
  if (!DATABASE_URL) {
112
112
  console.error('ERROR: DATABASE_URL is required.');
@@ -0,0 +1,285 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>Cluster Management — AgenticMail Enterprise Docs</title>
6
+ <link rel="stylesheet" href="docs.css">
7
+ </head>
8
+ <body>
9
+ <div class="docs-container">
10
+ <nav class="docs-nav"><a href="/dashboard">&larr; Back to Dashboard</a></nav>
11
+
12
+ <h1>Cluster Management</h1>
13
+ <p class="docs-subtitle">Scale your AI workforce across multiple machines — Mac Minis, VPS, cloud instances, or any combination.</p>
14
+
15
+ <div class="docs-toc">
16
+ <h4>Contents</h4>
17
+ <ul>
18
+ <li><a href="#overview">Overview</a></li>
19
+ <li><a href="#architecture">Architecture</a></li>
20
+ <li><a href="#adding-nodes">Adding Worker Nodes</a></li>
21
+ <li><a href="#manual">Method 1: Manual Registration</a></li>
22
+ <li><a href="#ssh">Method 2: SSH Deploy</a></li>
23
+ <li><a href="#script">Method 3: Setup Script</a></li>
24
+ <li><a href="#env-vars">Environment Variables</a></li>
25
+ <li><a href="#monitoring">Monitoring & Health</a></li>
26
+ <li><a href="#node-detail">Node Detail & Actions</a></li>
27
+ <li><a href="#load-balancing">Load Balancing</a></li>
28
+ <li><a href="#database">Database Sharing</a></li>
29
+ <li><a href="#networking">Networking Requirements</a></li>
30
+ <li><a href="#security">Security Considerations</a></li>
31
+ <li><a href="#edge-cases">Edge Cases & Troubleshooting</a></li>
32
+ <li><a href="#api">API Reference</a></li>
33
+ </ul>
34
+ </div>
35
+
36
+ <h2 id="overview">Overview</h2>
37
+ <p>The Cluster system enables <strong>horizontal scaling</strong> of your AI agent workforce. Instead of running all agents on a single machine, you can distribute them across multiple worker nodes — each running one or more agents that report back to a central dashboard.</p>
38
+ <p>This is useful when:</p>
39
+ <ul>
40
+ <li>You have more agents than a single machine can handle</li>
41
+ <li>You want geographic distribution (agents closer to users)</li>
42
+ <li>You need hardware isolation (GPU nodes for voice, separate machines for browser automation)</li>
43
+ <li>You want fault tolerance (agents survive if one machine goes down)</li>
44
+ <li>You're scaling from a single Mac Mini to a fleet of machines</li>
45
+ </ul>
46
+
47
+ <h2 id="architecture">Architecture</h2>
48
+ <div class="docs-diagram">
49
+ <pre>
50
+ ┌─────────────────────────────────────┐
51
+ │ Control Plane │
52
+ │ (Enterprise Dashboard Server) │
53
+ │ │
54
+ │ ┌──────────┐ ┌────────────────┐ │
55
+ │ │ Dashboard │ │ Cluster API │ │
56
+ │ │ (UI) │ │ (REST + SSE) │ │
57
+ │ └──────────┘ └────────────────┘ │
58
+ │ │ │ │
59
+ │ ┌──────────────────────────┐ │
60
+ │ │ Shared Database │ │
61
+ │ │ (Postgres / Supabase) │ │
62
+ │ └──────────────────────────┘ │
63
+ └─────────────┬───────────────────────┘
64
+ │ HTTP (heartbeat, status)
65
+ ┌────────┼────────┐
66
+ │ │ │
67
+ ┌────┴───┐ ┌──┴───┐ ┌──┴───┐
68
+ │Worker 1│ │Worker│ │Worker│
69
+ │Mac Mini│ │ VPS │ │ AWS │
70
+ │Agent A │ │AgentB│ │AgentC│
71
+ │Agent D │ │AgentE│ │AgentF│
72
+ └────────┘ └──────┘ └──────┘
73
+ </pre>
74
+ </div>
75
+
76
+ <h3>Key Concepts</h3>
77
+ <table>
78
+ <tr><th>Term</th><th>Description</th></tr>
79
+ <tr><td><strong>Control Plane</strong></td><td>The central enterprise server running the dashboard, API, and database. One per deployment.</td></tr>
80
+ <tr><td><strong>Worker Node</strong></td><td>Any machine running one or more agent processes. Reports to the control plane via HTTP.</td></tr>
81
+ <tr><td><strong>Node ID</strong></td><td>Unique identifier for each worker node (e.g., "mac-mini-office", "aws-us-east-1").</td></tr>
82
+ <tr><td><strong>Heartbeat</strong></td><td>Periodic HTTP POST from worker to control plane (every 30 seconds). Proves the node is alive.</td></tr>
83
+ <tr><td><strong>Stale Threshold</strong></td><td>If no heartbeat received for 90 seconds, node is marked offline.</td></tr>
84
+ <tr><td><strong>Capabilities</strong></td><td>Tags describing what the node can do: "browser", "voice", "gpu", "docker".</td></tr>
85
+ </table>
86
+
87
+ <h2 id="adding-nodes">Adding Worker Nodes</h2>
88
+ <p>There are <strong>3 ways</strong> to add a worker node, all from the dashboard UI:</p>
89
+
90
+ <h3 id="manual">Method 1: Manual Registration</h3>
91
+ <p>Best for: Machines that already have AgenticMail installed and running.</p>
92
+ <ol>
93
+ <li>Go to <strong>Operations &gt; Cluster</strong> in the sidebar</li>
94
+ <li>Click <strong>Add Worker Node</strong></li>
95
+ <li>Select the <strong>Manual Registration</strong> tab</li>
96
+ <li>Enter the node name, host IP/hostname, and port</li>
97
+ <li>Click <strong>Test Connection</strong> to verify reachability</li>
98
+ <li>Click <strong>Add Node</strong></li>
99
+ </ol>
100
+ <p>The node will appear in the cluster and start receiving heartbeats when the agent process has <code>WORKER_NODE_ID</code> set.</p>
101
+
102
+ <h3 id="ssh">Method 2: SSH Deploy</h3>
103
+ <p>Best for: Fresh machines where you want the dashboard to handle everything.</p>
104
+ <ol>
105
+ <li>Click <strong>Add Worker Node</strong> &gt; <strong>Deploy via SSH</strong> tab</li>
106
+ <li>Enter the SSH host, username, and optionally paste a private key</li>
107
+ <li>Optionally specify which agent IDs to deploy</li>
108
+ <li>Click <strong>Deploy Worker</strong></li>
109
+ </ol>
110
+ <p>The dashboard will SSH into the machine, install Node.js, PM2, and AgenticMail, write the environment file, and start the agent processes. The node auto-registers on startup.</p>
111
+
112
+ <div class="docs-note">
113
+ <strong>Note:</strong> SSH deploy requires the dashboard server to have network access to the target machine on port 22. For cloud instances, make sure the security group allows SSH from the dashboard's IP.
114
+ </div>
115
+
116
+ <h3 id="script">Method 3: Setup Script</h3>
117
+ <p>Best for: Machines you can't SSH into from the dashboard (firewalled, air-gapped, or you prefer manual control).</p>
118
+ <ol>
119
+ <li>Click <strong>Add Worker Node</strong> &gt; <strong>Setup Script</strong> tab</li>
120
+ <li>Enter a name and port</li>
121
+ <li>Click <strong>Generate Setup Script</strong></li>
122
+ <li>Copy the script</li>
123
+ <li>SSH into the target machine yourself and paste/run the script</li>
124
+ <li>Edit <code>~/.agenticmail/worker.env</code> to set your <code>DATABASE_URL</code></li>
125
+ <li>Start agents with <code>pm2 start "agenticmail-enterprise agent --id &lt;ID&gt;"</code></li>
126
+ </ol>
127
+
128
+ <h2 id="env-vars">Environment Variables</h2>
129
+ <p>These environment variables control worker node behavior:</p>
130
+ <table>
131
+ <tr><th>Variable</th><th>Required</th><th>Description</th></tr>
132
+ <tr><td><code>ENTERPRISE_URL</code></td><td>Yes</td><td>Full URL of the control plane (e.g., <code>https://acme.agenticmail.io</code>)</td></tr>
133
+ <tr><td><code>WORKER_NODE_ID</code></td><td>Yes*</td><td>Unique node identifier. Triggers auto-registration on startup. <em>*Required for cluster mode.</em></td></tr>
134
+ <tr><td><code>WORKER_NAME</code></td><td>No</td><td>Human-readable name shown in dashboard. Defaults to system hostname.</td></tr>
135
+ <tr><td><code>WORKER_HOST</code></td><td>No</td><td>IP/hostname the control plane should use to reach this node. Defaults to "localhost".</td></tr>
136
+ <tr><td><code>WORKER_CAPABILITIES</code></td><td>No</td><td>Comma-separated capabilities: "browser,voice,gpu,docker"</td></tr>
137
+ <tr><td><code>DATABASE_URL</code></td><td>Yes</td><td>Same database as the control plane (shared Postgres)</td></tr>
138
+ <tr><td><code>PORT</code></td><td>No</td><td>Agent API port (default: 3101)</td></tr>
139
+ <tr><td><code>LOG_LEVEL</code></td><td>No</td><td>Set to "warn" for production noise suppression</td></tr>
140
+ </table>
141
+
142
+ <h2 id="monitoring">Monitoring & Health</h2>
143
+ <h3>Real-Time Status</h3>
144
+ <p>The Cluster page shows live status for every node via Server-Sent Events (SSE). No polling — updates appear instantly when:</p>
145
+ <ul>
146
+ <li>A node registers or re-registers</li>
147
+ <li>A heartbeat is received (every 30s)</li>
148
+ <li>A node goes offline (no heartbeat for 90s)</li>
149
+ <li>Node agent list changes</li>
150
+ </ul>
151
+
152
+ <h3>Node Statuses</h3>
153
+ <table>
154
+ <tr><th>Status</th><th>Color</th><th>Meaning</th></tr>
155
+ <tr><td>online</td><td style="color: #22c55e;">Green</td><td>Node is reachable and heartbeating normally</td></tr>
156
+ <tr><td>degraded</td><td style="color: #f59e0b;">Orange</td><td>Node is reachable but reporting issues</td></tr>
157
+ <tr><td>offline</td><td style="color: #6b7280;">Gray</td><td>No heartbeat for 90+ seconds</td></tr>
158
+ </table>
159
+
160
+ <h3>Stats Cards</h3>
161
+ <p>The top of the Cluster page shows aggregate stats:</p>
162
+ <ul>
163
+ <li><strong>Total Nodes</strong> — All registered nodes (online + offline)</li>
164
+ <li><strong>Online</strong> — Currently heartbeating nodes</li>
165
+ <li><strong>Running Agents</strong> — Total agents across all online nodes</li>
166
+ <li><strong>Total CPUs</strong> — Aggregate CPU cores across online nodes</li>
167
+ <li><strong>Total Memory</strong> — Aggregate RAM across online nodes</li>
168
+ </ul>
169
+
170
+ <h2 id="node-detail">Node Detail & Actions</h2>
171
+ <p>Click any node card to see full details:</p>
172
+ <ul>
173
+ <li><strong>Platform info</strong> — OS, architecture, CPU count, memory</li>
174
+ <li><strong>Agent list</strong> — All agents running on this node with names and roles</li>
175
+ <li><strong>Capabilities</strong> — What the node supports (browser, voice, etc.)</li>
176
+ <li><strong>Ping</strong> — Test connection from dashboard to node (shows latency)</li>
177
+ <li><strong>Restart Agents</strong> — Send restart signal to all agents on this node</li>
178
+ </ul>
179
+
180
+ <h2 id="load-balancing">Load Balancing</h2>
181
+ <p>When deploying a new agent, the system can automatically select the best node:</p>
182
+ <ul>
183
+ <li><strong>Least-loaded</strong> — Node with fewest running agents</li>
184
+ <li><strong>Capability-matching</strong> — If the agent needs "voice" or "browser", only nodes with those capabilities are considered</li>
185
+ <li><strong>API endpoint</strong>: <code>GET /api/engine/cluster/best-node?capabilities=voice,browser</code></li>
186
+ </ul>
187
+
188
+ <h2 id="database">Database Sharing</h2>
189
+ <p>All worker nodes <strong>must connect to the same database</strong> as the control plane. This is how agents share state, memory, tasks, and configuration.</p>
190
+ <div class="docs-note">
191
+ <strong>Recommended:</strong> Use a cloud-hosted PostgreSQL (Supabase, Neon, AWS RDS) accessible from all nodes. SQLite does NOT work for multi-node clusters.
192
+ </div>
193
+ <p>Connection pool settings are auto-optimized per node via the <code>smartDbConfig()</code> helper. Each node maintains its own small connection pool (3 connections max).</p>
194
+
195
+ <h2 id="networking">Networking Requirements</h2>
196
+ <table>
197
+ <tr><th>Direction</th><th>From</th><th>To</th><th>Port</th><th>Purpose</th></tr>
198
+ <tr><td>Outbound</td><td>Worker Node</td><td>Control Plane</td><td>3100 (or custom)</td><td>Heartbeats, status updates, task webhooks</td></tr>
199
+ <tr><td>Outbound</td><td>Worker Node</td><td>Database</td><td>5432 (Postgres)</td><td>Shared database connection</td></tr>
200
+ <tr><td>Inbound</td><td>Control Plane</td><td>Worker Node</td><td>3101 (or custom)</td><td>Health checks, ping, restart commands</td></tr>
201
+ <tr><td>Outbound</td><td>Control Plane</td><td>Worker Node</td><td>22 (SSH)</td><td>Only for SSH deploy method</td></tr>
202
+ </table>
203
+ <p>If nodes are behind NAT or firewalls, only outbound from worker to control plane is strictly required. The test-connection and restart features need inbound access.</p>
204
+
205
+ <h2 id="security">Security Considerations</h2>
206
+ <ul>
207
+ <li><strong>No authentication on cluster API (yet)</strong> — The heartbeat and status endpoints are unauthenticated for simplicity. Only expose the control plane's API behind a reverse proxy with authentication, or restrict by IP.</li>
208
+ <li><strong>SSH keys</strong> — For SSH deploy, keys are used once and not persisted. Prefer SSH agent forwarding or temporary keys.</li>
209
+ <li><strong>Database credentials</strong> — Each worker node needs <code>DATABASE_URL</code>. Use environment variables, never commit credentials.</li>
210
+ <li><strong>TLS</strong> — Use HTTPS between workers and control plane in production. Set <code>ENTERPRISE_URL=https://...</code>.</li>
211
+ <li><strong>Network segmentation</strong> — Place worker nodes and control plane on the same VPN/VPC for internal traffic.</li>
212
+ </ul>
213
+
214
+ <h2 id="edge-cases">Edge Cases & Troubleshooting</h2>
215
+
216
+ <h3>Node keeps showing "offline"</h3>
217
+ <ul>
218
+ <li>Check <code>ENTERPRISE_URL</code> is correct and reachable from the worker</li>
219
+ <li>Check <code>WORKER_NODE_ID</code> is set in the agent's environment</li>
220
+ <li>Check firewall rules — worker must be able to POST to <code>ENTERPRISE_URL/api/engine/cluster/heartbeat/...</code></li>
221
+ <li>Check agent logs: <code>pm2 logs agent-name</code></li>
222
+ </ul>
223
+
224
+ <h3>Duplicate node IDs</h3>
225
+ <p>If two machines use the same <code>WORKER_NODE_ID</code>, they'll overwrite each other's registration. Use unique IDs per machine.</p>
226
+
227
+ <h3>Agent appears on wrong node</h3>
228
+ <p>Each agent process reports its <code>WORKER_NODE_ID</code> on startup. If you move an agent between machines, restart it on the new machine — it will re-register under the new node.</p>
229
+
230
+ <h3>Control plane restarts</h3>
231
+ <p>All node data is persisted in the <code>cluster_nodes</code> database table. On restart, nodes load from DB as "offline" and transition to "online" when the next heartbeat arrives (within 30s).</p>
232
+
233
+ <h3>Worker restarts</h3>
234
+ <p>PM2 auto-restarts crashed agent processes. On restart, the agent re-registers with the control plane within seconds.</p>
235
+
236
+ <h3>Network partition</h3>
237
+ <p>If a worker loses connectivity to the control plane, it continues running agents normally. It just stops reporting status. When connectivity resumes, the next heartbeat restores the "online" status.</p>
238
+
239
+ <h3>Database failover</h3>
240
+ <p>All nodes connect to the same database. If the database goes down, all nodes are affected. Use a cloud provider with automatic failover (Supabase, Neon, RDS Multi-AZ).</p>
241
+
242
+ <h2 id="api">API Reference</h2>
243
+ <table>
244
+ <tr><th>Method</th><th>Endpoint</th><th>Description</th></tr>
245
+ <tr><td>GET</td><td><code>/api/engine/cluster/nodes</code></td><td>List all nodes + cluster stats</td></tr>
246
+ <tr><td>GET</td><td><code>/api/engine/cluster/nodes/:nodeId</code></td><td>Get specific node</td></tr>
247
+ <tr><td>POST</td><td><code>/api/engine/cluster/register</code></td><td>Register a worker node</td></tr>
248
+ <tr><td>POST</td><td><code>/api/engine/cluster/heartbeat/:nodeId</code></td><td>Worker heartbeat</td></tr>
249
+ <tr><td>DELETE</td><td><code>/api/engine/cluster/nodes/:nodeId</code></td><td>Remove a node</td></tr>
250
+ <tr><td>GET</td><td><code>/api/engine/cluster/best-node</code></td><td>Find best node for deployment</td></tr>
251
+ <tr><td>POST</td><td><code>/api/engine/cluster/test-connection</code></td><td>Test connectivity to a node</td></tr>
252
+ <tr><td>POST</td><td><code>/api/engine/cluster/deploy-via-ssh</code></td><td>Deploy worker via SSH</td></tr>
253
+ <tr><td>POST</td><td><code>/api/engine/cluster/nodes/:nodeId/restart</code></td><td>Restart agents on a node</td></tr>
254
+ <tr><td>GET</td><td><code>/api/engine/cluster/stream</code></td><td>SSE stream of cluster events</td></tr>
255
+ </table>
256
+
257
+ <h3>Register Node (POST /api/engine/cluster/register)</h3>
258
+ <pre>
259
+ {
260
+ "nodeId": "mac-mini-office", // Required, unique, 2-64 chars, alphanumeric + .-_
261
+ "name": "Office Mac Mini", // Optional display name
262
+ "host": "192.168.1.50", // Required, IP or hostname
263
+ "port": 3101, // Required, 1-65535
264
+ "platform": "darwin", // Optional, auto-detected
265
+ "arch": "arm64", // Optional, auto-detected
266
+ "cpuCount": 10, // Optional, auto-detected
267
+ "memoryMb": 16384, // Optional, auto-detected
268
+ "version": "0.5.324", // Optional
269
+ "agents": ["agent-uuid-1"], // Optional, list of agent IDs
270
+ "capabilities": ["browser", "voice"] // Optional
271
+ }
272
+ </pre>
273
+
274
+ <h3>Heartbeat (POST /api/engine/cluster/heartbeat/:nodeId)</h3>
275
+ <pre>
276
+ {
277
+ "agents": ["agent-uuid-1"], // Current agent list
278
+ "cpuUsage": 0.45, // Optional, 0-1
279
+ "memoryUsage": 0.62 // Optional, 0-1
280
+ }
281
+ </pre>
282
+
283
+ </div>
284
+ </body>
285
+ </html>