@agenticmail/enterprise 0.5.312 → 0.5.314

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 (208) hide show
  1. package/README.md +752 -544
  2. package/dist/agent-autonomy-PSXQ4MNP.js +766 -0
  3. package/dist/agent-heartbeat-6H3YAQ32.js +510 -0
  4. package/dist/agent-heartbeat-7WS3XILF.js +510 -0
  5. package/dist/agent-heartbeat-BFGKYUUK.js +510 -0
  6. package/dist/agent-heartbeat-SSV65YTX.js +510 -0
  7. package/dist/agent-heartbeat-T5IIHVF4.js +510 -0
  8. package/dist/agent-heartbeat-X3C6FIU2.js +510 -0
  9. package/dist/agent-tools-BW6CLQQ7.js +13897 -0
  10. package/dist/agent-tools-KEA7QEWF.js +13897 -0
  11. package/dist/agent-tools-NU7V3S5N.js +13899 -0
  12. package/dist/agent-tools-WINDYRQ2.js +13897 -0
  13. package/dist/chunk-3ELH5CU6.js +4910 -0
  14. package/dist/chunk-4QYRS3MS.js +1519 -0
  15. package/dist/chunk-52REEVDW.js +1519 -0
  16. package/dist/chunk-5RZJ76YI.js +4977 -0
  17. package/dist/chunk-6L7FQI5Q.js +4909 -0
  18. package/dist/chunk-763OMGFI.js +1519 -0
  19. package/dist/chunk-7ILSXGY6.js +1519 -0
  20. package/dist/chunk-7UCKD25B.js +551 -0
  21. package/dist/chunk-A6MSR7DL.js +4977 -0
  22. package/dist/chunk-ASD2YB6O.js +1519 -0
  23. package/dist/chunk-AZOIHLLX.js +4977 -0
  24. package/dist/chunk-BDCFOP7O.js +537 -0
  25. package/dist/chunk-BSVWPG6I.js +106 -0
  26. package/dist/chunk-C46DNDZB.js +1519 -0
  27. package/dist/chunk-CFVTK4FQ.js +4977 -0
  28. package/dist/chunk-CHJAOKCJ.js +4921 -0
  29. package/dist/chunk-CYEWTXYH.js +4977 -0
  30. package/dist/chunk-D3KFSWLK.js +48 -0
  31. package/dist/chunk-DUVGNAIY.js +4977 -0
  32. package/dist/chunk-DX4XEFVE.js +25229 -0
  33. package/dist/chunk-EX6FQSEV.js +167 -0
  34. package/dist/chunk-F5VZ5EUH.js +1519 -0
  35. package/dist/chunk-FVUDSPOD.js +4977 -0
  36. package/dist/chunk-G6FTZKJX.js +4977 -0
  37. package/dist/chunk-GFEAZN6Y.js +1519 -0
  38. package/dist/chunk-HKV4FQFW.js +1519 -0
  39. package/dist/chunk-ICCPULDT.js +25217 -0
  40. package/dist/chunk-IYEM627Q.js +25216 -0
  41. package/dist/chunk-JHRJ4QJ6.js +1519 -0
  42. package/dist/chunk-K2DAUYHV.js +4977 -0
  43. package/dist/chunk-KDQDSZZQ.js +4973 -0
  44. package/dist/chunk-LDUD6AZY.js +1519 -0
  45. package/dist/chunk-LES5TJ5L.js +4909 -0
  46. package/dist/chunk-MJGGW6MC.js +106 -0
  47. package/dist/chunk-MQKIWAHQ.js +106 -0
  48. package/dist/chunk-NGA7BBPF.js +48 -0
  49. package/dist/chunk-OE3TI4IQ.js +1519 -0
  50. package/dist/chunk-OHSBIYDR.js +4977 -0
  51. package/dist/chunk-OZEYDEPB.js +1519 -0
  52. package/dist/chunk-P4PODSQH.js +1519 -0
  53. package/dist/chunk-P7UOSFIE.js +636 -0
  54. package/dist/chunk-PFN6DODU.js +4921 -0
  55. package/dist/chunk-PKDVM4IY.js +4917 -0
  56. package/dist/chunk-Q5KG3G7U.js +25115 -0
  57. package/dist/chunk-QMVNW4FJ.js +25229 -0
  58. package/dist/chunk-QZ5UPRBE.js +4977 -0
  59. package/dist/chunk-SPP23N42.js +4977 -0
  60. package/dist/chunk-SRGHNFOY.js +4921 -0
  61. package/dist/chunk-TPLVQFXM.js +2594 -0
  62. package/dist/chunk-U3XYF4QP.js +4977 -0
  63. package/dist/chunk-VRRJH2DY.js +4921 -0
  64. package/dist/chunk-WY42BS3F.js +1519 -0
  65. package/dist/chunk-XAA4VHHZ.js +1519 -0
  66. package/dist/chunk-Z5Y5KTPC.js +4977 -0
  67. package/dist/chunk-ZA4QRACH.js +4977 -0
  68. package/dist/chunk-ZHLGSTXF.js +4909 -0
  69. package/dist/cli-agent-26BUULHZ.js +2169 -0
  70. package/dist/cli-agent-2FLJWXOC.js +2169 -0
  71. package/dist/cli-agent-4NNQFLO6.js +2255 -0
  72. package/dist/cli-agent-5WV3EEPW.js +2252 -0
  73. package/dist/cli-agent-65JUT6DU.js +2193 -0
  74. package/dist/cli-agent-6HLL7A5K.js +2255 -0
  75. package/dist/cli-agent-CZ26QWUZ.js +2210 -0
  76. package/dist/cli-agent-HPVSWDNQ.js +2255 -0
  77. package/dist/cli-agent-K4SBVG5X.js +2210 -0
  78. package/dist/cli-agent-K5D424X2.js +2252 -0
  79. package/dist/cli-agent-U4OL5FGK.js +2210 -0
  80. package/dist/cli-agent-WUMPOIKQ.js +2169 -0
  81. package/dist/cli-agent-WWRGGJ2F.js +2255 -0
  82. package/dist/cli-agent-ZDBBTVGU.js +2193 -0
  83. package/dist/cli-agent-ZIZ5JP4O.js +2252 -0
  84. package/dist/cli-recover-I4KNR2OI.js +487 -0
  85. package/dist/cli-recover-IQTUKWR2.js +487 -0
  86. package/dist/cli-recover-OYJHELOR.js +487 -0
  87. package/dist/cli-recover-PVQC7UXB.js +487 -0
  88. package/dist/cli-recover-T32NABFA.js +487 -0
  89. package/dist/cli-serve-FTQJ3RUK.js +143 -0
  90. package/dist/cli-serve-G4PUCASH.js +143 -0
  91. package/dist/cli-serve-HBZYUUQ3.js +143 -0
  92. package/dist/cli-serve-L3NUROMO.js +143 -0
  93. package/dist/cli-serve-LAA5WIZK.js +143 -0
  94. package/dist/cli-serve-LV4TUSJD.js +143 -0
  95. package/dist/cli-serve-MFCTVA2L.js +140 -0
  96. package/dist/cli-serve-QCRUFI5B.js +143 -0
  97. package/dist/cli-serve-S7OGQN4P.js +143 -0
  98. package/dist/cli-serve-SI4BQRXT.js +140 -0
  99. package/dist/cli-serve-UNB7EHN4.js +143 -0
  100. package/dist/cli-serve-UV3GVDRD.js +143 -0
  101. package/dist/cli-serve-V5QICXR5.js +143 -0
  102. package/dist/cli-serve-VG6Z6GIB.js +143 -0
  103. package/dist/cli-serve-XSYHPGZI.js +143 -0
  104. package/dist/cli-serve-Y534FCRV.js +140 -0
  105. package/dist/cli-verify-CZIITRED.js +149 -0
  106. package/dist/cli-verify-N73GOKEF.js +149 -0
  107. package/dist/cli-verify-QEEBZOUZ.js +149 -0
  108. package/dist/cli-verify-RC5HI6DU.js +149 -0
  109. package/dist/cli-verify-VKBNIEAX.js +149 -0
  110. package/dist/cli.js +5 -5
  111. package/dist/dashboard/app.js +8 -2
  112. package/dist/dashboard/components/org-switcher.js +5 -1
  113. package/dist/dashboard/org-switcher.js +156 -0
  114. package/dist/dashboard/pages/login.js +160 -4
  115. package/dist/dashboard/pages/task-pipeline.js +1 -1
  116. package/dist/factory-3IWXVE37.js +9 -0
  117. package/dist/factory-5M6PTMLC.js +11 -0
  118. package/dist/factory-CSSHN7GE.js +11 -0
  119. package/dist/factory-JFWXTAWK.js +11 -0
  120. package/dist/factory-TBGUYM5X.js +9 -0
  121. package/dist/google-W5AYGNUJ.js +33 -0
  122. package/dist/index.js +6 -6
  123. package/dist/meetings-FJ453ENF.js +12 -0
  124. package/dist/postgres-BCHZWRU3.js +832 -0
  125. package/dist/postgres-BI4QVRM6.js +825 -0
  126. package/dist/postgres-BOTHOPDW.js +875 -0
  127. package/dist/postgres-JBUKR3TA.js +873 -0
  128. package/dist/postgres-Z7QYSU6K.js +861 -0
  129. package/dist/routes-7QYAQTWA.js +90 -0
  130. package/dist/routes-JCBVZU54.js +90 -0
  131. package/dist/routes-KEDEJFRE.js +90 -0
  132. package/dist/routes-WI64ADVH.js +90 -0
  133. package/dist/routes-X36OSCID.js +90 -0
  134. package/dist/runtime-75XR6KEW.js +45 -0
  135. package/dist/runtime-BNM7ZNNL.js +45 -0
  136. package/dist/runtime-ES6WCJ7D.js +45 -0
  137. package/dist/runtime-KYJTML2B.js +45 -0
  138. package/dist/runtime-LO67ZHQA.js +45 -0
  139. package/dist/runtime-VIXKKVSZ.js +45 -0
  140. package/dist/runtime-WHWJPCGK.js +45 -0
  141. package/dist/runtime-Z2Q6GUHH.js +45 -0
  142. package/dist/runtime-ZZ6CALSB.js +45 -0
  143. package/dist/server-27A4WEJC.js +28 -0
  144. package/dist/server-2CBXP4WS.js +28 -0
  145. package/dist/server-4JQAB5R4.js +28 -0
  146. package/dist/server-6BOM5U64.js +28 -0
  147. package/dist/server-FLJKNPRD.js +28 -0
  148. package/dist/server-HMIHIQ2N.js +28 -0
  149. package/dist/server-KIXXLR2D.js +28 -0
  150. package/dist/server-KSEIZTXF.js +28 -0
  151. package/dist/server-MPVW7DKZ.js +28 -0
  152. package/dist/server-PRTVRQ2D.js +28 -0
  153. package/dist/server-SYIG6HAX.js +28 -0
  154. package/dist/server-U32KDIXC.js +28 -0
  155. package/dist/server-WFN6CA4T.js +28 -0
  156. package/dist/server-XQUE3FGT.js +28 -0
  157. package/dist/server-XWT2UORK.js +28 -0
  158. package/dist/server-Y3BGNN5Q.js +28 -0
  159. package/dist/setup-352L2TPS.js +20 -0
  160. package/dist/setup-4MM645XK.js +20 -0
  161. package/dist/setup-5JPWW6IP.js +20 -0
  162. package/dist/setup-CUN6LVUV.js +20 -0
  163. package/dist/setup-D3YHPWPY.js +20 -0
  164. package/dist/setup-D4A5I6UM.js +20 -0
  165. package/dist/setup-DOPLXTB3.js +20 -0
  166. package/dist/setup-E3NSIM6B.js +20 -0
  167. package/dist/setup-E3V2D7NL.js +20 -0
  168. package/dist/setup-FSYPGI2C.js +20 -0
  169. package/dist/setup-G3RPKRG3.js +20 -0
  170. package/dist/setup-KJ77HNWK.js +20 -0
  171. package/dist/setup-LPSOY5V5.js +20 -0
  172. package/dist/setup-N3ODDSQE.js +20 -0
  173. package/dist/setup-NLDM3M2P.js +20 -0
  174. package/dist/setup-SWJMNDWF.js +20 -0
  175. package/dist/system-prompts-6OUTAMH6.js +41 -0
  176. package/dist/task-queue-YP2I54IA.js +9 -0
  177. package/dist/telegram-QRNGRT5M.js +17 -0
  178. package/dist/whatsapp-VYVINCGV.js +31 -0
  179. package/god_is_great.html +35 -0
  180. package/package.json +1 -1
  181. package/src/agent-tools/index.ts +4 -1
  182. package/src/agent-tools/tool-resolver.ts +15 -4
  183. package/src/agent-tools/tools/browser.ts +2 -2
  184. package/src/agent-tools/tools/local/dependency-manager.ts +286 -0
  185. package/src/agent-tools/tools/local/index.ts +3 -0
  186. package/src/agent-tools/tools/messaging/telegram.ts +29 -0
  187. package/src/agent-tools/tools/messaging/whatsapp.ts +59 -4
  188. package/src/auth/routes.ts +1 -1
  189. package/src/cli-agent.ts +47 -6
  190. package/src/cli-serve.ts +2 -5
  191. package/src/dashboard/app.js +8 -2
  192. package/src/dashboard/components/org-switcher.js +5 -1
  193. package/src/dashboard/pages/login.js +160 -4
  194. package/src/dashboard/pages/task-pipeline.js +1 -1
  195. package/src/db/adapter.ts +2 -0
  196. package/src/db/factory.ts +78 -0
  197. package/src/db/postgres.ts +57 -12
  198. package/src/engine/agent-autonomy.ts +1 -1
  199. package/src/engine/agent-heartbeat.ts +1 -1
  200. package/src/engine/messaging-poller.ts +146 -11
  201. package/src/engine/oauth-connect-routes.ts +23 -3
  202. package/src/engine/routes.ts +1 -1
  203. package/src/engine/task-poller.ts +54 -3
  204. package/src/engine/task-queue.ts +30 -0
  205. package/src/runtime/index.ts +2 -1
  206. package/src/runtime/types.ts +2 -0
  207. package/src/server.ts +13 -1
  208. package/src/system-prompts/triage.ts +1 -1
package/README.md CHANGED
@@ -1,66 +1,143 @@
1
1
  # @agenticmail/enterprise
2
2
 
3
- **AI Agent Identity, Email & Workforce Platform for Organizations**
3
+ **The Complete AI Agent Workforce Platform**
4
4
 
5
- Deploy, manage, and govern AI agents as first-class employees — each with their own email address, skills, permissions, memory, and lifecycle. Built on [AgenticMail](https://agenticmail.io) + [AgenticMail](https://agenticmail.ai).
5
+ Deploy, manage, and govern AI agents as first-class employees — each with their own email, phone number, calendar, browser, tools, memory, and identity. Enterprise-grade security, compliance, and multi-tenant isolation built in.
6
6
 
7
7
  ```bash
8
8
  npx @agenticmail/enterprise
9
9
  ```
10
10
 
11
- One command. Interactive setup wizard. Dashboard URL in under 2 minutes.
11
+ One command. Interactive setup wizard. Full platform in under 2 minutes.
12
+
13
+ ---
14
+
15
+ ## Getting Started (5 Minutes)
16
+
17
+ ### What You Need
18
+
19
+ | Requirement | Details |
20
+ |------------|---------|
21
+ | **Node.js** | v18 or higher ([download](https://nodejs.org)) |
22
+ | **Database** | SQLite (built-in, zero config) or Postgres (recommended for production) |
23
+ | **LLM API Key** | At least one: [Anthropic](https://console.anthropic.com), [OpenAI](https://platform.openai.com), or [xAI](https://console.x.ai) |
24
+
25
+ ### Step 1: Run the Setup Wizard
26
+
27
+ ```bash
28
+ npx @agenticmail/enterprise
29
+ ```
30
+
31
+ This launches an interactive wizard that walks you through everything. No config files to edit manually.
32
+
33
+ ### Step 2: Choose Your Database
34
+
35
+ **Option A: SQLite (Easiest — great for trying it out)**
36
+ - Select "SQLite" in the wizard
37
+ - Data stored locally in a file — zero configuration
38
+ - Perfect for development, demos, and small deployments
39
+
40
+ **Option B: Free Supabase Postgres (Recommended for production)**
41
+ 1. Go to [supabase.com](https://supabase.com) and create a free account
42
+ 2. Create a new project (free tier gives you a full Postgres database)
43
+ 3. Go to **Settings → Database → Connection string → URI**
44
+ 4. Select **"Transaction mode"** (port 6543) — this is important!
45
+ 5. Copy the connection string and paste it in the wizard
46
+
47
+ > **The wizard auto-optimizes your connection string** — it detects Supabase URLs, switches to the right pooler mode, adds the correct parameters, and generates a direct URL for migrations. You don't need to configure anything manually.
48
+
49
+ **Option C: Any Postgres, MySQL, MongoDB, or other database**
50
+ - We support 10 database backends — see [Database Backends](#database-backends)
51
+ - Just paste your connection string and the wizard handles the rest
52
+
53
+ ### Step 3: Create Your Admin Account
54
+
55
+ - Enter your name, email, and password
56
+ - This becomes the owner account with full access
57
+
58
+ ### Step 4: Open the Dashboard
59
+
60
+ The wizard gives you a URL (default: `http://localhost:3000`). Open it and you'll see:
61
+ - **Setup Checklist** — guided steps to configure email, create agents, etc.
62
+ - **Create Agent** — pick from 51 personality templates or build your own
63
+ - **Full Admin Dashboard** — 28 pages covering every aspect of agent management
64
+
65
+ ### Step 5: Create Your First Agent
66
+
67
+ 1. Click **"Create Agent"** in the dashboard
68
+ 2. Choose a soul template (e.g., "Executive Assistant", "Sales Rep", "Developer")
69
+ 3. Add your LLM API key in **Settings → API Keys** (or in the agent's config)
70
+ 4. Start the agent — it'll get its own email, tools, and identity
71
+
72
+ ### What's Next?
73
+
74
+ - **Connect Gmail** — Give your agent real email access via OAuth (Agent Detail → Email tab)
75
+ - **Add Telegram/WhatsApp** — Connect messaging channels (Agent Detail → Channels tab)
76
+ - **Set up DLP** — Apply pre-built rule packs to protect sensitive data (DLP page → Rule Packs)
77
+ - **Configure Shifts** — Set work hours and on-call schedules (Workforce page)
78
+ - **Run Standalone** — For production, run each agent as its own process:
79
+ ```bash
80
+ node dist/cli.js agent --env-file=.env.my-agent
81
+ ```
12
82
 
13
83
  ---
14
84
 
15
85
  ## Table of Contents
16
86
 
17
- - [Overview](#overview)
87
+ - [Why AgenticMail Enterprise](#why-agenticmail-enterprise)
18
88
  - [Quick Start](#quick-start)
19
- - [Setup Wizard](#setup-wizard)
20
89
  - [Architecture](#architecture)
21
- - [Database Backends](#database-backends)
22
- - [Engine Modules](#engine-modules)
90
+ - [Dashboard](#dashboard)
23
91
  - [Agent Runtime](#agent-runtime)
24
- - [MCP Integration Adapters](#mcp-integration-adapters)
25
92
  - [Agent Tools](#agent-tools)
93
+ - [Google Workspace Integration](#google-workspace-integration)
94
+ - [145 SaaS Integration Adapters](#145-saas-integration-adapters)
26
95
  - [Enterprise Skills](#enterprise-skills)
27
- - [Dashboard](#dashboard)
28
- - [API Reference](#api-reference)
96
+ - [Database Backends](#database-backends)
97
+ - [Security & Compliance](#security--compliance)
98
+ - [Data Loss Prevention (DLP)](#data-loss-prevention-dlp)
99
+ - [Multi-Tenant & Organizations](#multi-tenant--organizations)
100
+ - [Workforce Management](#workforce-management)
101
+ - [Knowledge Base & RAG](#knowledge-base--rag)
102
+ - [Communication & Task Pipeline](#communication--task-pipeline)
103
+ - [Agent Autonomy System](#agent-autonomy-system)
104
+ - [Meeting & Voice Intelligence](#meeting--voice-intelligence)
105
+ - [Multimodal Support](#multimodal-support)
29
106
  - [Deployment](#deployment)
30
107
  - [CLI Commands](#cli-commands)
31
- - [Security](#security)
32
- - [Community Skills](#community-skills)
33
- - [Configuration](#configuration)
108
+ - [Environment Variables](#environment-variables)
109
+ - [Community Skills Marketplace](#community-skills-marketplace)
110
+ - [API Reference](#api-reference)
34
111
  - [License](#license)
35
112
 
36
113
  ---
37
114
 
38
- ## Overview
115
+ ## Why AgenticMail Enterprise
39
116
 
40
- AgenticMail Enterprise turns your organization's AI agents into managed employees:
117
+ Most AI agent platforms give you a chatbot. We give you a **workforce**.
41
118
 
42
- - **Identity** — Each agent gets a real email address, phone number, and digital identity
43
- - **Skills** — 47 enterprise skill definitions (Google Workspace, Microsoft 365, custom) + 147 SaaS integration adapters
44
- - **Permissions** — Fine-grained tool-level access control with 5 preset profiles
45
- - **Governance** — DLP scanning, guardrails, anomaly detection, compliance reporting, action journaling with rollback
46
- - **Workforce** — Shifts, schedules, on-call rotations, capacity planning, birthday automation
47
- - **Runtime** — Full agent execution loop with LLM streaming, session management, sub-agents, budget gates
48
- - **Dashboard** — Admin UI with dark/light themes, real-time activity tracking, agent creation wizard
119
+ - **Real Identity** — Each agent gets a real email address, phone number (Google Voice), Google Workspace access, and digital presence
120
+ - **Real Autonomy** — Agents clock in/out, check email, respond to messages, attend meetings, and work independently
121
+ - **Real Governance** — DLP scanning, guardrails, approval workflows, compliance reporting, action journaling with rollback
122
+ - **Real Scale** — Multi-tenant isolation, org-scoped everything, role-based access control, budget gates
123
+ - **Real Integration** — 145 SaaS adapters, 13 Google Workspace tools, full browser automation, shell access, filesystem tools
49
124
 
50
125
  ### By the Numbers
51
126
 
52
127
  | Metric | Count |
53
128
  |--------|-------|
54
- | Source files | 342 |
55
- | Engine modules | 25+ |
56
- | API routes | 328 |
129
+ | Source files | 770+ |
130
+ | Engine modules | 82 |
131
+ | Dashboard pages | 28 + 23 agent detail tabs |
132
+ | Documentation pages | 49 |
57
133
  | Database backends | 10 |
58
- | SaaS integration adapters | 147 |
59
- | Enterprise skill definitions | 47 |
60
- | Agent tools | 28 |
61
- | Route sub-apps | 22 |
134
+ | SaaS integration adapters | 145 |
135
+ | Enterprise skill definitions | 52 |
136
+ | Google Workspace tools | 13 services |
137
+ | Agent tools | 270+ |
62
138
  | Soul templates | 51 (14 categories) |
63
- | Community skill marketplace | Built-in |
139
+ | DLP rule packs | 7 (53 pre-built rules) |
140
+ | Compliance report types | 5 (SOC 2, GDPR, SOX, Incident, Access Review) |
64
141
 
65
142
  ---
66
143
 
@@ -73,538 +150,689 @@ npx @agenticmail/enterprise
73
150
  ```
74
151
 
75
152
  The wizard walks you through:
76
- 1. **Company Info** — Name, admin email, password, subdomain selection
77
- 2. **Database** — Pick from 10 backends (SQLite for dev, Postgres/MySQL/MongoDB/DynamoDB/Turso for production)
78
- 3. **Deployment** — AgenticMail Cloud, Fly.io, Railway, Docker, or Local
79
- 4. **Custom Domain** — Optional: point your own domain at the dashboard
80
- 5. **Domain Registration** — Optional: register with AgenticMail registry for domain protection
153
+ 1. **Database** — Pick from 10 backends with smart auto-configuration (auto-detects Supabase/Neon pooler mode, generates direct URLs for migrations, adds `?pgbouncer=true` automatically)
154
+ 2. **Admin Account** — Name, email, password, company name
155
+ 3. **Email Delivery** — Optional SMTP/OAuth setup
156
+ 4. **Custom Domain** — Optional: point your own domain via Cloudflare tunnel
157
+ 5. **First Agent** — Create your first AI agent with a soul template
81
158
 
82
159
  ### Option B: Programmatic
83
160
 
84
161
  ```typescript
85
- import { createServer } from '@agenticmail/enterprise';
86
- import { createAdapter } from '@agenticmail/enterprise/db';
162
+ import { createServer, createAdapter, smartDbConfig } from '@agenticmail/enterprise';
87
163
 
88
- const db = await createAdapter({
89
- type: 'postgres',
90
- connectionString: process.env.DATABASE_URL,
91
- });
164
+ const db = await createAdapter(smartDbConfig(process.env.DATABASE_URL));
92
165
  await db.migrate();
93
166
 
94
167
  const server = createServer({
95
168
  port: 3000,
96
169
  db,
97
170
  jwtSecret: process.env.JWT_SECRET,
171
+ runtime: {
172
+ enabled: true,
173
+ apiKeys: { anthropic: process.env.ANTHROPIC_API_KEY },
174
+ },
98
175
  });
99
176
 
100
177
  await server.start();
101
178
  ```
102
179
 
103
- ---
104
-
105
- ## Setup Wizard
180
+ ### Option C: Standalone Agent
106
181
 
107
- The interactive setup wizard (`npx @agenticmail/enterprise` or `npx @agenticmail/enterprise setup`) guides you through every step with sensible defaults.
182
+ Run an agent as its own process (recommended for production):
108
183
 
109
- ### Step 1: Company Info
184
+ ```bash
185
+ node dist/cli.js agent --env-file=.env.fola
186
+ ```
110
187
 
111
- - Company name
112
- - Admin email + password (min 8 chars, requires uppercase or number)
113
- - Subdomain selection with auto-generated suggestions (slug from company name, abbreviations, variants)
114
- - "Generate more" option for random suffix suggestions
115
- - Custom subdomain input with validation
188
+ Each agent runs independently with its own port, connects to the shared database, and registers with the main server for health checks and lifecycle management.
116
189
 
117
- ### Step 2: Database
190
+ ---
118
191
 
119
- Choose from 10 backends organized by category:
192
+ ## Architecture
120
193
 
121
- | Category | Options |
122
- |----------|---------|
123
- | **SQL** | PostgreSQL, MySQL/MariaDB, SQLite |
124
- | **NoSQL** | MongoDB |
125
- | **Edge** | Turso (LibSQL) |
126
- | **Cloud** | DynamoDB (AWS), Supabase, Neon, PlanetScale, CockroachDB |
194
+ ```
195
+ ┌──────────────────────────────────────────────────────────────┐
196
+ │ Admin Dashboard (28 pages) │
197
+ │ React · Dark/Light themes · Real-time updates │
198
+ │ Agents · Workforce · DLP · Compliance · Vault · Knowledge │
199
+ │ Activity · Journal · Guardrails · Task Pipeline · Audit │
200
+ ├──────────────────────────────────────────────────────────────┤
201
+ │ Hono API Server │
202
+ │ Auth · Admin · Engine (82 modules) · Middleware (9 layers) │
203
+ ├──────────────────────────────────────────────────────────────┤
204
+ │ Engine Core │
205
+ │ Lifecycle · Permissions · DLP · Guardrails · Compliance │
206
+ │ Journal · Approvals · Policies · Knowledge · Memory │
207
+ │ Communication · Workforce · Vault · Storage · Autonomy │
208
+ │ Onboarding · Soul Library · Tool Catalog · OAuth Connect │
209
+ │ Meeting Monitor · Voice Intelligence · Activity Tracking │
210
+ ├──────────────────────────────────────────────────────────────┤
211
+ │ Agent Runtime │
212
+ │ LLM Client (multi-provider) · Session Manager │
213
+ │ Tool Executor (270+ tools) · Sub-Agent Spawning │
214
+ │ Budget Gates · Model Fallback · Streaming │
215
+ ├──────────────────────────────────────────────────────────────┤
216
+ │ Messaging & Channels │
217
+ │ Email (Gmail/Outlook) · Telegram · WhatsApp │
218
+ │ Google Chat · Browser Automation · Voice/Meetings │
219
+ ├──────────────────────────────────────────────────────────────┤
220
+ │ Integration Layer │
221
+ │ 145 SaaS Adapters · 13 Google Workspace Services │
222
+ │ MCP Framework · OAuth Connect · Dependency Manager │
223
+ ├──────────────────────────────────────────────────────────────┤
224
+ │ Database Adapter Layer │
225
+ │ Postgres · MySQL · SQLite · MongoDB · DynamoDB · Turso │
226
+ │ Supabase · Neon · PlanetScale · CockroachDB │
227
+ │ Smart pooler detection · Auto-optimized connections │
228
+ └──────────────────────────────────────────────────────────────┘
229
+ ```
127
230
 
128
- Each option collects the right credentials:
129
- - **SQLite**: File path (default: `./agenticmail-enterprise.db`)
130
- - **DynamoDB**: AWS Region + Access Key ID + Secret Access Key
131
- - **Turso**: Database URL + Auth Token
132
- - **All others**: Connection string with format hints
231
+ ### Middleware Stack
133
232
 
134
- ### Step 3: Deployment
233
+ | Layer | Purpose |
234
+ |-------|---------|
235
+ | Request ID | UUID per request for distributed tracing |
236
+ | Transport Encryption | Optional AES-GCM encryption for all API responses |
237
+ | Security Headers | CSP, HSTS, X-Frame-Options, X-Content-Type-Options |
238
+ | CORS | Configurable origins |
239
+ | Rate Limiting | Per-IP, configurable RPM (default: 120) |
240
+ | IP Firewall | CIDR-based access control |
241
+ | Audit Logging | Every mutating action logged with actor, org, timestamp |
242
+ | RBAC | Role-based access (owner, admin, member, viewer) |
243
+ | Org Scoping | Automatic data isolation for multi-tenant deployments |
135
244
 
136
- | Target | Description |
137
- |--------|-------------|
138
- | **AgenticMail Cloud** | Managed hosting, instant URL (`subdomain.agenticmail.io`) |
139
- | **Fly.io** | Your Fly.io account, generates `fly.toml` |
140
- | **Railway** | Your Railway account, generates `railway.toml` |
141
- | **Docker** | Self-hosted, generates `docker-compose.yml` + `.env` |
142
- | **Local** | Dev/testing, starts server immediately on port 3000 |
245
+ ---
143
246
 
144
- ### Step 4: Custom Domain (Optional)
247
+ ## Dashboard
145
248
 
146
- For non-local deployments, optionally configure a custom domain. The wizard shows DNS instructions specific to your deployment target (CNAME for cloud/Fly, reverse proxy for Docker, Railway settings).
249
+ 28 full pages + 23 agent detail tabs, served directly from the enterprise server:
147
250
 
148
- ### Step 5: Domain Registration (Optional)
251
+ ### Platform Pages
149
252
 
150
- Registers your domain with the AgenticMail central registry:
151
- - Generates a 256-bit deployment key (shown once, must be saved)
152
- - Creates a DNS TXT verification challenge
153
- - Optional immediate DNS verification (retries 5x with 10s intervals)
154
- - Recovery via `agenticmail-enterprise recover` if key is available
253
+ | Page | Description |
254
+ |------|-------------|
255
+ | **Dashboard** | Setup checklist, quick stats, getting started guide |
256
+ | **Agents** | Create, configure, start/stop, monitor all agents |
257
+ | **Users** | User management, roles, org assignment, impersonation |
258
+ | **Organizations** | Client org management, billing, access control |
259
+ | **Org Chart** | Visual organizational hierarchy |
260
+ | **Workforce** | Shifts, schedules, on-call, capacity, clock records |
261
+ | **Task Pipeline** | Visual task flow, node-based pipeline editor |
262
+ | **Messages** | Agent-to-agent communication hub |
263
+ | **Knowledge** | Document upload, chunking, RAG search |
264
+ | **Knowledge Contributions** | Agent-contributed knowledge review |
265
+ | **Knowledge Import** | Bulk import from external sources |
266
+ | **Skills** | Enterprise skill management and assignment |
267
+ | **Community Skills** | Marketplace: browse, install, configure, update |
268
+ | **Skill Connections** | OAuth and credential management for skills |
269
+ | **DLP** | Rules, rule packs (7 enterprise packs), violations, scanning |
270
+ | **Guardrails** | Intervention rules, anomaly detection, agent safety |
271
+ | **Compliance** | SOC 2, GDPR, SOX, Incident, Access Review reports |
272
+ | **Journal** | Action journal with detail modal and rollback |
273
+ | **Audit Log** | Complete audit trail with org filtering |
274
+ | **Activity** | Real-time tool calls, conversations, cost tracking |
275
+ | **Approvals** | Human-in-the-loop approval queue |
276
+ | **Vault** | Encrypted credential storage, API keys, OAuth tokens |
277
+ | **Database Access** | Agent database connection management |
278
+ | **Memory Transfer** | Cross-agent memory sharing |
279
+ | **Roles** | Custom agent role template management (51 built-in) |
280
+ | **Settings** | Company, security, SSO, 2FA, branding, email config |
281
+ | **Domain Status** | Cloudflare tunnel, DNS, deployment health |
282
+ | **Login** | Setup wizard (first run) / login with 2FA support |
283
+
284
+ ### Agent Detail Tabs (per agent)
285
+
286
+ | Tab | Description |
287
+ |-----|-------------|
288
+ | Overview | Status, health, metrics, quick actions |
289
+ | Personal Details | Name, email, phone, avatar, identity |
290
+ | Configuration | Model, temperature, system prompt, soul |
291
+ | Permissions | Tool-level allow/deny, preset profiles |
292
+ | Skills | Assigned skills with risk levels |
293
+ | Tools | Available tools with security policies |
294
+ | Tool Security | Per-tool DLP and guardrail overrides |
295
+ | Email | Gmail OAuth, signature, email config |
296
+ | Channels | Telegram, WhatsApp, Google Chat setup |
297
+ | WhatsApp | WhatsApp Business integration |
298
+ | Communication | Agent messaging preferences |
299
+ | Memory | Long-term memory viewer/editor |
300
+ | Autonomy | Clock, daily catchup, goals, knowledge schedules |
301
+ | Budget | Token limits, cost caps, alerts |
302
+ | Workforce | Shift assignments, availability |
303
+ | Guardrails | Agent-specific intervention rules |
304
+ | Activity | Agent-specific activity feed |
305
+ | Security | API keys, access controls |
306
+ | Deployment | Runtime config, health endpoint |
307
+ | Manager | Supervisor/manager assignment |
308
+ | Meeting Browser | Meeting attendance and voice config |
309
+ | Personal Details | Birthday, timezone, language |
310
+
311
+ ### Features
312
+
313
+ - **Dark/Light themes** with CSS custom properties
314
+ - **Dynamic brand color** from company settings
315
+ - **Org switcher** on every page for multi-tenant filtering
316
+ - **Real-time SSE streaming** for live updates
317
+ - **49 built-in documentation pages** accessible from the dashboard
318
+ - **Transport encryption** — Optional AES-GCM encryption for all API traffic
155
319
 
156
320
  ---
157
321
 
158
- ## Architecture
322
+ ## Agent Runtime
159
323
 
160
- ```
161
- ┌─────────────────────────────────────────────────────────┐
162
- │ Admin Dashboard │
163
- │ (React, dark/light themes) │
164
- ├─────────────────────────────────────────────────────────┤
165
- │ Hono API Server │
166
- │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
167
- │ │ Auth │ │ Admin │ │ Engine │ │
168
- │ │ Routes │ │ Routes │ │ Routes │ │
169
- │ └──────────┘ └──────────┘ └──────────┘ │
170
- ├─────────────────────────────────────────────────────────┤
171
- │ Engine Modules (25+) │
172
- │ Skills · Permissions · Lifecycle · Knowledge Base │
173
- │ DLP · Guardrails · Journal · Compliance · Activity │
174
- │ Communication · Workforce · Vault · Storage · Onboarding│
175
- │ Policies · Memory · Approvals · Tenants · Deployer │
176
- │ Community Registry · Soul Library · Tool Catalog │
177
- ├─────────────────────────────────────────────────────────┤
178
- │ Agent Runtime │
179
- │ LLM Client · Session Manager · Tool Executor │
180
- │ Sub-Agent Manager · Email Channel · Follow-Up Scheduler │
181
- ├─────────────────────────────────────────────────────────┤
182
- │ MCP Integration Framework │
183
- │ 147 SaaS Adapters · OAuth Connect │
184
- ├─────────────────────────────────────────────────────────┤
185
- │ Database Adapter Layer │
186
- │ Postgres · MySQL · SQLite · MongoDB · DynamoDB · Turso │
187
- │ Supabase · Neon · PlanetScale · CockroachDB │
188
- └─────────────────────────────────────────────────────────┘
189
- ```
324
+ Full standalone agent execution — agents run as independent processes with their own port, tools, memory, and messaging channels.
190
325
 
191
- ### Middleware Stack
326
+ ### Runtime Features
192
327
 
193
- - **Request ID** UUID per request for tracing
194
- - **Security Headers** — CSP, HSTS, XSS protection
195
- - **CORS**Configurable origins
196
- - **Rate Limiting** Per-IP, configurable RPM (default: 120)
197
- - **IP Access Control** CIDR-based firewall
198
- - **Audit Logging** Every mutating action logged
199
- - **RBAC** Role-based access control (owner, admin, member, viewer)
200
- - **Error Handling** Structured error responses
201
- - **Circuit Breaker** Database connectivity protection
202
- - **Health Monitor** Periodic health checks with unhealthy threshold
328
+ | Feature | Description |
329
+ |---------|-------------|
330
+ | **Multi-Provider LLM** | Anthropic, OpenAI, xAI (Grok), Google with automatic model fallback |
331
+ | **Session Manager** | Incremental message persistence, crash recovery, session resume |
332
+ | **Tool Executor** | 270+ tools with permission checking and DLP scanning |
333
+ | **Sub-Agent Spawning** | Spawn child agents for parallel work |
334
+ | **Budget Gates** | Cost check before every LLM call, hard limits with alerts |
335
+ | **Streaming** | SSE streaming for real-time dashboard updates |
336
+ | **Multimodal** | Process images, videos, documents from Telegram/WhatsApp |
337
+ | **Dependency Manager** | Auto-detect, install, and clean up system dependencies |
338
+ | **Email Channel** | Bi-directional Gmail/Outlook with OAuth |
339
+ | **Messaging** | Telegram long-polling, WhatsApp webhook |
340
+ | **Browser** | Full Playwright-based web automation |
341
+ | **Voice** | ElevenLabs TTS, meeting voice intelligence |
342
+ | **Memory** | DB-backed long-term memory with semantic search |
343
+ | **Heartbeat** | Configurable periodic checks (email, calendar, health) |
344
+ | **Autonomy** | Clock in/out, morning triage, daily catchup, goal tracking |
345
+
346
+ ### Standalone Agent Mode
347
+
348
+ ```bash
349
+ # .env.fola
350
+ DATABASE_URL=postgresql://... # Shared DB (auto-optimized for pooler)
351
+ AGENT_ID=3eecd57d-03ae-440d-8945-5b35f43a8d90
352
+ PORT=3102
353
+ ANTHROPIC_API_KEY=sk-ant-...
354
+
355
+ # Start
356
+ node dist/cli.js agent --env-file=.env.fola
357
+ ```
358
+
359
+ The agent automatically:
360
+ - Connects to the shared database (with smart pooler detection)
361
+ - Loads its configuration, permissions, and soul from DB
362
+ - Starts messaging channels (Telegram, WhatsApp, email)
363
+ - Begins autonomy features (clock in, morning triage)
364
+ - Registers health endpoint for dashboard monitoring
203
365
 
204
366
  ---
205
367
 
206
- ## Database Backends
368
+ ## Agent Tools
207
369
 
208
- All 10 backends implement the same `DatabaseAdapter` interface with full feature parity:
370
+ 270+ tools organized by category:
209
371
 
210
- ```typescript
211
- import { createAdapter, type DatabaseType } from '@agenticmail/enterprise/db';
372
+ ### Core Tools
212
373
 
213
- const db = await createAdapter({
214
- type: 'postgres', // or mysql, sqlite, mongodb, dynamodb, turso, supabase, neon, planetscale, cockroachdb
215
- connectionString: '...',
216
- });
374
+ | Tool | Description |
375
+ |------|-------------|
376
+ | `bash` / `shell` | Shell command execution |
377
+ | `browser` | Full Playwright web automation (screenshots, navigation, interaction) |
378
+ | `edit` | Precise file editing with search/replace |
379
+ | `read` / `write` | File I/O |
380
+ | `glob` / `grep` | File discovery and text search |
381
+ | `web_fetch` | HTTP requests with content extraction |
382
+ | `web_search` | Web search (Brave API) |
217
383
 
218
- await db.migrate(); // Run schema migrations
219
- await db.getStats(); // Health check
220
- await db.createUser({...}); // CRUD operations
221
- await db.logEvent({...}); // Audit logging
222
- ```
384
+ ### Google Workspace Tools
223
385
 
224
- ### Adapter Details
386
+ | Tool | Description |
387
+ |------|-------------|
388
+ | `gmail_search` / `gmail_read` / `gmail_send` / `gmail_reply` | Full Gmail access |
389
+ | `gmail_forward` / `gmail_trash` / `gmail_modify` / `gmail_labels` | Gmail management |
390
+ | `gmail_drafts` / `gmail_thread` / `gmail_attachment` / `gmail_profile` | Advanced Gmail |
391
+ | `gmail_get_signature` / `gmail_set_signature` | Signature management |
392
+ | `calendar_list` / `calendar_create` / `calendar_update` / `calendar_delete` | Calendar CRUD |
393
+ | `calendar_find_free` / `calendar_rsvp` | Scheduling |
394
+ | `drive_list` / `drive_search` / `drive_read` / `drive_upload` | Google Drive |
395
+ | `drive_create_folder` / `drive_share` / `drive_export` | Drive management |
396
+ | `contacts_list` / `contacts_search` / `contacts_create` | Google Contacts |
397
+ | `google_chat_send_message` / `google_chat_list_spaces` | Google Chat |
398
+ | `google_docs_*` / `google_sheets_*` / `google_slides_*` | Document editing |
399
+ | `google_forms_*` / `google_tasks_*` | Forms and Tasks |
400
+ | `google_meetings_*` | Meet integration |
401
+
402
+ ### Enterprise Tools
225
403
 
226
- | Backend | Module | Notes |
227
- |---------|--------|-------|
228
- | PostgreSQL | `postgres.ts` | Full SQL, migrations, engine DB |
229
- | MySQL/MariaDB | `mysql.ts` | Full SQL, auto-converted DDL |
230
- | SQLite | `sqlite.ts` | Embedded, `better-sqlite3` |
231
- | MongoDB | `mongodb.ts` | Uses `_id` = `randomUUID()` |
232
- | DynamoDB | `dynamodb.ts` | Single-table design, GSI1 |
233
- | Turso | `turso.ts` | LibSQL edge database |
234
- | Supabase | `postgres.ts` | Managed Postgres (same adapter) |
235
- | Neon | `postgres.ts` | Serverless Postgres (same adapter) |
236
- | PlanetScale | `mysql.ts` | Managed MySQL (same adapter) |
237
- | CockroachDB | `postgres.ts` | Distributed (same adapter) |
404
+ | Tool | Description |
405
+ |------|-------------|
406
+ | `enterprise-code-sandbox` | Isolated code execution |
407
+ | `enterprise-database` | Database queries |
408
+ | `enterprise-documents` | Document processing |
409
+ | `enterprise-http` | Advanced HTTP client |
410
+ | `enterprise-security-scan` | Vulnerability scanning |
411
+ | `enterprise-spreadsheet` | Spreadsheet operations |
412
+ | `knowledge-search` | RAG search across knowledge bases |
238
413
 
239
- ### Engine Database
414
+ ### Agent Management Tools
240
415
 
241
- SQL-backed deployments also get the `EngineDatabase` layer for engine module persistence:
416
+ | Tool | Description |
417
+ |------|-------------|
418
+ | `management_escalate` | Escalate to supervisor |
419
+ | `management_delegate` | Delegate task to another agent |
420
+ | `management_status_update` | Report status to manager |
242
421
 
243
- ```typescript
244
- const engineDbInterface = db.getEngineDB();
245
- const engineDb = new EngineDatabase(engineDbInterface, 'postgres');
246
- await engineDb.migrate(); // Versioned migration system
247
- ```
422
+ ### Messaging Tools
423
+
424
+ | Tool | Description |
425
+ |------|-------------|
426
+ | `msg_telegram` / `msg_whatsapp` | Send messages via channels |
427
+ | `telegram_download_file` | Download media from Telegram |
248
428
 
249
- Features: DDL auto-conversion (`sqliteToPostgres()`, `sqliteToMySQL()`), dynamic table creation with `ext_` prefix, agent storage tables with `agt_`/`shared_` prefixes.
429
+ ### Dependency Management
430
+
431
+ | Tool | Description |
432
+ |------|-------------|
433
+ | `check_dependency` | Check if system tool is installed |
434
+ | `install_dependency` | Auto-install missing dependencies |
435
+ | `list_dependencies` | List all agent-installed packages |
436
+ | `cleanup_dependencies` | Remove session-installed packages |
250
437
 
251
438
  ---
252
439
 
253
- ## Engine Modules
254
-
255
- The engine is the core of Enterprise — 25+ modules that power agent governance:
256
-
257
- ### 1. Skill Registry & Permission Engine
258
- - 47 built-in enterprise skill definitions (Google Workspace, Microsoft 365, custom)
259
- - Fine-grained tool-level permissions (allow/deny per tool)
260
- - 5 preset profiles: Research Assistant, Customer Support, Developer, Full Access, Sandbox
261
- - Skill suites for bulk assignment
262
- - Risk level classification (low, medium, high, critical)
263
- - Side effect tracking (read, write, delete, external, financial)
264
-
265
- ### 2. Agent Config Generator
266
- - Generates workspace files (SOUL.md, AGENTS.md, etc.)
267
- - Gateway configuration
268
- - Channel configs (email, Slack, Teams, etc.)
269
- - Deployment scripts per target
270
-
271
- ### 3. Deployment Engine
272
- - Docker, VPS, Fly.io, Railway provisioning
273
- - Deployment event tracking
274
- - Live agent status monitoring
275
-
276
- ### 4. Approval Workflows
277
- - Human-in-the-loop approval policies
278
- - Escalation chains with multi-level escalation
279
- - Time-based auto-escalation
280
- - Approval/rejection with audit trail
281
-
282
- ### 5. Agent Lifecycle Manager
283
- - State machine: `provisioning` → `active` → `paused` → `stopped` → `decommissioned`
284
- - Health checks and auto-recovery
285
- - Budget controls with alerts and hard limits
286
- - Usage tracking (tokens, cost, API calls)
287
- - Birthday automation (sends birthday emails to agents on their DOB)
288
-
289
- ### 6. Knowledge Base
290
- - Document ingestion and chunking
291
- - BM25F text search (extracted to shared library)
292
- - RAG retrieval for agent context
293
- - Multi-knowledge-base support per org
294
-
295
- ### 7. Multi-Tenant Isolation
296
- - Organization management with plan enforcement
297
- - 4 plan tiers: Free (3 agents), Team (25), Enterprise (unlimited), Self-Hosted (unlimited)
298
- - Feature gates per plan
299
- - SSO configuration (Google, Microsoft, GitHub, Okta, SAML, LDAP)
300
- - Usage quotas and billing
301
-
302
- ### 8. Real-Time Activity Tracking
303
- - Live tool call recording
304
- - Conversation logging
305
- - Agent timelines
306
- - Cost tracking per agent/org
307
-
308
- ### 9. Tool Catalog
309
- - 86+ cataloged tool IDs across all AgenticMail packages
310
- - Tool-to-skill mapping
311
- - Dynamic tool policy generation
312
-
313
- ### 10. Data Loss Prevention (DLP)
314
- - Content scanning rules (PII, credentials, sensitive data)
315
- - Violation tracking and alerting
316
- - Configurable rule sets per org
317
-
318
- ### 11. Agent-to-Agent Communication
319
- - Message bus (direct, broadcast, topic-based)
320
- - Task assignment and delegation
321
- - Priority levels (normal, high, urgent)
322
- - Agent email registry integration
323
-
324
- ### 12. Guardrails & Anomaly Detection
325
- - Real-time intervention system
326
- - Configurable anomaly rules (rate limits, cost thresholds, pattern matching)
327
- - Auto-stop agents on violation
328
- - Onboarding gate checks
329
- - Workforce off-duty enforcement
330
-
331
- ### 13. Action Journal & Rollback
332
- - Every agent action journaled with before/after state
333
- - Rollback capability for reversible actions
334
- - Audit trail with timestamps and actor
335
-
336
- ### 14. Compliance Reporting
337
- - SOC2, GDPR, HIPAA report generation
338
- - Data retention policies
339
- - Access audit reports
340
-
341
- ### 15. Community Skill Registry (Marketplace)
342
- - Install community skills from the marketplace
343
- - Automatic periodic sync from GitHub (every 6 hours)
344
- - Skill reviews and ratings
345
- - Local directory loading for development
346
- - Validation CLI for skill authors
347
-
348
- ### 16. Workforce Management
349
- - Shift schedules and on-call rotations
350
- - Capacity planning
351
- - Off-duty enforcement via guardrails
352
- - Work-life balance rules
353
-
354
- ### 17. Organization Policies
355
- - Global and per-org policy configuration
356
- - Policy import/export
357
- - Compliance policy templates
358
-
359
- ### 18. Agent Memory
360
- - Long-term memory persistence
361
- - Memory queries and search
362
- - Cross-session continuity
363
-
364
- ### 19. Onboarding Manager
365
- - Agent onboarding workflows
366
- - Onboarding gates (must complete before agent goes live)
367
- - Policy acknowledgment tracking
368
-
369
- ### 20. Secure Vault
370
- - Encrypted credential storage
371
- - API key management
372
- - OAuth token management
373
- - DLP-integrated access control
374
-
375
- ### 21. Storage Manager
376
- - Dynamic table management for agents
377
- - Agent-scoped tables (`agt_` prefix)
378
- - Shared tables (`shared_` prefix)
379
- - 28 storage actions (create, query, aggregate, import/export, raw SQL, etc.)
380
-
381
- ### 22. Soul Library
382
- - 51 personality templates across 14 categories
383
- - Search and browse templates
384
- - Custom soul creation
385
-
386
- ### 23. Knowledge Contribution Manager
387
- - Agents contribute learned knowledge back to org knowledge bases
388
- - Scheduled aggregation
389
-
390
- ### 24. Skill Auto-Updater
391
- - Monitors community skill registry for updates
392
- - Auto-applies compatible updates
393
- - Scheduled update checks
394
-
395
- ### 25. OAuth Connect
396
- - OAuth flow management for SaaS integrations
397
- - Token storage in vault
398
- - Refresh token rotation
440
+ ## Google Workspace Integration
441
+
442
+ Deep, native integration with 13 Google Workspace services:
443
+
444
+ | Service | Tools | OAuth Scopes |
445
+ |---------|-------|-------------|
446
+ | **Gmail** | 16 tools | `gmail.modify`, `gmail.send` |
447
+ | **Calendar** | 6 tools | `calendar`, `calendar.events` |
448
+ | **Drive** | 7 tools | `drive` |
449
+ | **Docs** | CRUD + formatting | `documents` |
450
+ | **Sheets** | CRUD + formulas | `spreadsheets` |
451
+ | **Slides** | CRUD + layout | `presentations` |
452
+ | **Forms** | Create + responses | `forms` |
453
+ | **Tasks** | List + manage | `tasks` |
454
+ | **Contacts** | Search + manage | `contacts` |
455
+ | **Chat** | Send + spaces | `chat.messages`, `chat.spaces` |
456
+ | **Meet** | Schedule + join | `calendar` |
457
+ | **Maps** | Places API | API key |
458
+ | **Meeting Voice** | TTS + transcription | ElevenLabs + virtual audio |
459
+
460
+ Agents can:
461
+ - Read and respond to emails
462
+ - Create and manage calendar events
463
+ - Upload and share Drive files
464
+ - Edit Google Docs, Sheets, and Slides
465
+ - Join Google Meet calls with voice (ElevenLabs TTS + virtual audio device)
399
466
 
400
467
  ---
401
468
 
402
- ## Agent Runtime
469
+ ## 145 SaaS Integration Adapters
403
470
 
404
- Full standalone agent execution runtime — run agents entirely in-process without AgenticMail:
471
+ Pre-built MCP adapters for connecting agents to any SaaS tool:
405
472
 
406
- ```typescript
407
- import { createAgentRuntime } from '@agenticmail/enterprise';
473
+ <details>
474
+ <summary><b>Full adapter list (145)</b></summary>
408
475
 
409
- const runtime = createAgentRuntime({
410
- engineDb: db,
411
- apiKeys: { anthropic: process.env.ANTHROPIC_API_KEY },
412
- });
476
+ ActiveCampaign · Adobe Sign · ADP · Airtable · Apollo · Asana · Auth0 · AWS · Azure DevOps · BambooHR · Basecamp · BigCommerce · Bitbucket · Box · Brex · Buffer · Calendly · Canva · Chargebee · CircleCI · ClickUp · Close · Cloudflare · Confluence · Contentful · Copper · Crisp · CrowdStrike · Datadog · DigitalOcean · Discord · Docker · DocuSign · Drift · Dropbox · Figma · Firebase · Fly.io · FreshBooks · Freshdesk · Freshsales · Freshservice · Front · GitHub · GitHub Actions · GitLab · Gong · Google Ads · Google Analytics · Google Cloud · Google Drive · GoToMeeting · Grafana · Greenhouse · Gusto · HashiCorp Vault · Heroku · HiBob · Hootsuite · HubSpot · Hugging Face · Intercom · Jira · Klaviyo · Kubernetes · Lattice · LaunchDarkly · Lever · Linear · LinkedIn · LiveChat · Loom · Mailchimp · Mailgun · Microsoft Teams · Miro · Mixpanel · Monday · MongoDB Atlas · Neon · Netlify · NetSuite · New Relic · Notion · Okta · OpenAI · OpsGenie · Outreach · Paddle · PagerDuty · PandaDoc · PayPal · Personio · Pinecone · Pipedrive · Plaid · Postmark · Power Automate · QuickBooks · Recurly · Reddit · Render · RingCentral · Rippling · Salesforce · SalesLoft · Sanity · SAP · Segment · SendGrid · Sentry · ServiceNow · Shopify · Shortcut · Slack · Smartsheet · Snowflake · Snyk · Splunk · Square · Statuspage · Stripe · Supabase · Teamwork · Telegram · Terraform · Todoist · Trello · Twilio · Twitter/X · Vercel · Weaviate · Webex · Webflow · WhatsApp · Whereby · WooCommerce · WordPress · Workday · Wrike · Xero · YouTube · Zendesk · Zoho CRM · Zoom · Zuora
413
477
 
414
- await runtime.start();
478
+ </details>
415
479
 
416
- const session = await runtime.spawnSession({
417
- agentId: 'agent-1',
418
- message: 'Research Q3 revenue trends and draft a summary email',
419
- });
420
- ```
480
+ Each adapter provides:
481
+ - Tool definitions with parameter schemas
482
+ - API executor with credential resolution from Vault
483
+ - OAuth flow configuration
484
+ - Rate limit handling and pagination
421
485
 
422
- ### Runtime Features
486
+ ---
423
487
 
424
- - **LLM Client** — Multi-provider (Anthropic, OpenAI, custom), streaming, retry with exponential backoff
425
- - **Session Manager** — Incremental message persistence, crash recovery, session resume on startup
426
- - **Tool Executor** — 28 built-in tools with security sandboxing
427
- - **Sub-Agent Manager** — Spawn child agents for parallel work
428
- - **Email Channel** — Bi-directional email communication
429
- - **Follow-Up Scheduler** — Schedule agent follow-ups and reminders
430
- - **Budget Gates** — Cost check before every LLM call
431
- - **Gateway Integration** — Register as AgenticMail plugin for hybrid deployments
432
- - **Heartbeat** — Stale session detection and cleanup
433
- - **SSE Streaming** — Real-time event streaming for dashboard
488
+ ## Enterprise Skills
434
489
 
435
- ### Supported LLM Providers
490
+ 52 pre-built skill definitions:
436
491
 
437
- ```typescript
438
- import { listAllProviders } from '@agenticmail/enterprise';
492
+ ### Google Workspace Suite (14)
493
+ Gmail · Calendar · Drive · Docs · Sheets · Slides · Forms · Meet · Chat · Keep · Sites · Groups · Admin · Vault
439
494
 
440
- // Built-in: anthropic, openai
441
- // Custom providers can be registered via PROVIDER_REGISTRY
442
- ```
495
+ ### Microsoft 365 Suite (17)
496
+ Outlook · Teams · OneDrive · Word · Excel · PowerPoint · SharePoint · Planner · Todo · OneNote · Forms · Bookings · Power BI · Power Automate · Whiteboard · Copilot · Admin
497
+
498
+ ### Enterprise Custom Suite (16+)
499
+ Calendar · Code Sandbox · Database · Diff · Documents · Finance · HTTP · Knowledge Search · Logs · Notifications · Security Scan · Spreadsheet · Translation · Vision · Web Research · Workflow
500
+
501
+ ### Soul Templates (51)
502
+
503
+ 14 categories of agent personality templates:
504
+
505
+ | Category | Examples |
506
+ |----------|---------|
507
+ | Engineering | Full-Stack Developer, DevOps Engineer, QA Engineer |
508
+ | Data | Data Analyst, ML Engineer, BI Analyst |
509
+ | Support | Customer Support, IT Help Desk, Onboarding Specialist |
510
+ | Marketing | Content Creator, SEO Specialist, Social Media Manager |
511
+ | Sales | Sales Rep, Account Executive, BDR |
512
+ | Finance | Financial Analyst, Accountant, Revenue Operations |
513
+ | HR | Recruiter, HR Coordinator, People Operations |
514
+ | Legal | Legal Assistant, Compliance Officer |
515
+ | Operations | Project Manager, Executive Assistant, Office Manager |
516
+ | Security | Security Analyst, GRC Specialist |
517
+ | Design | UX Designer, Brand Designer |
518
+ | Product | Product Manager, Technical Writer |
519
+ | Research | Research Analyst, Competitive Intelligence |
520
+ | Custom | Build your own from scratch |
521
+
522
+ Custom role templates can be created and managed via the **Roles** dashboard page.
443
523
 
444
524
  ---
445
525
 
446
- ## MCP Integration Adapters
526
+ ## Database Backends
447
527
 
448
- 147 pre-built adapters for connecting agents to SaaS tools via [Model Context Protocol](https://modelcontextprotocol.io):
528
+ 10 backends, all implementing the same adapter interface with full feature parity:
449
529
 
450
- <details>
451
- <summary><b>Full adapter list (147)</b></summary>
530
+ | Backend | Type | Best For |
531
+ |---------|------|----------|
532
+ | **PostgreSQL** | SQL | Production (recommended) |
533
+ | **Supabase** | Managed Postgres | Quick setup, free tier available |
534
+ | **Neon** | Serverless Postgres | Serverless deployments |
535
+ | **CockroachDB** | Distributed Postgres | Global scale |
536
+ | **MySQL / MariaDB** | SQL | Existing MySQL infrastructure |
537
+ | **PlanetScale** | Managed MySQL | Serverless MySQL |
538
+ | **SQLite** | Embedded | Development, small deployments |
539
+ | **Turso** | LibSQL (edge) | Edge deployments |
540
+ | **MongoDB** | NoSQL | Document-oriented workloads |
541
+ | **DynamoDB** | AWS NoSQL | AWS-native deployments |
452
542
 
453
- ActiveCampaign, Adobe Sign, ADP, Airtable, Apollo, Asana, Auth0, AWS, Azure DevOps, BambooHR, Basecamp, BigCommerce, Bitbucket, Box, Brex, Buffer, Calendly, Canva, Chargebee, CircleCI, ClickUp, Close, Cloudflare, Confluence, Contentful, Copper, Crisp, CrowdStrike, Datadog, DigitalOcean, Discord, Docker, DocuSign, Drift, Dropbox, Figma, Firebase, Fly.io, FreshBooks, Freshdesk, Freshsales, Freshservice, Front, GitHub, GitHub Actions, GitLab, Gong, Google Ads, Google Analytics, Google Cloud, Google Drive, GoToMeeting, Grafana, Greenhouse, Gusto, HashiCorp Vault, Heroku, HiBob, Hootsuite, HubSpot, Hugging Face, Intercom, Jira, Klaviyo, Kubernetes, Lattice, LaunchDarkly, Lever, Linear, LinkedIn, LiveChat, Loom, Mailchimp, Mailgun, Microsoft Teams, Miro, Mixpanel, Monday, MongoDB Atlas, Neon, Netlify, NetSuite, New Relic, Notion, Okta, OpenAI, OpsGenie, Outreach, Paddle, PagerDuty, PandaDoc, PayPal, Personio, Pinecone, Pipedrive, Plaid, Postmark, Power Automate, QuickBooks, Recurly, Reddit, Render, RingCentral, Rippling, Salesforce, SalesLoft, Sanity, SAP, Segment, SendGrid, Sentry, ServiceNow, Shopify, Shortcut, Slack, Smartsheet, Snowflake, Snyk, Splunk, Square, Statuspage, Stripe, Supabase, Teamwork, Telegram, Terraform, Todoist, Trello, Twilio, Twitter/X, Vercel, Weaviate, Webex, Webflow, WhatsApp, Whereby, WooCommerce, WordPress, Workday, Wrike, Xero, YouTube, Zendesk, Zoho CRM, Zoom, Zuora
543
+ ### Smart Connection Auto-Configuration
454
544
 
455
- </details>
545
+ When you provide a `DATABASE_URL`, the system automatically:
456
546
 
457
- ### MCP Framework
547
+ 1. **Detects your provider** — Supabase, Neon, or generic Postgres from the hostname
548
+ 2. **Optimizes the connection** — Switches Supabase session mode (port 5432) to transaction mode (port 6543), adds `?pgbouncer=true`
549
+ 3. **Generates a direct URL** — For migrations and DDL operations that need real transactions (bypasses PgBouncer)
550
+ 4. **Configures pool sizing** — Conservative pool limits for shared PgBouncer setups (max 3 per process), generous for direct connections (max 10)
551
+ 5. **Sets idle timeouts** — 2s for PgBouncer (fast release), 30s for direct connections
552
+ 6. **Handles connection errors gracefully** — Automatic retry with ROLLBACK recovery for aborted transactions
458
553
 
459
554
  ```typescript
460
- import { SkillMCPFramework } from '@agenticmail/enterprise/mcp';
555
+ import { smartDbConfig, createAdapter } from '@agenticmail/enterprise';
461
556
 
462
- // Each adapter provides:
463
- // - Tool definitions (name, description, parameters, schema)
464
- // - API executor with credential resolution
465
- // - OAuth flow configuration
466
- // - Rate limit handling
557
+ // Automatically optimized — no manual config needed
558
+ const db = await createAdapter(smartDbConfig('postgresql://postgres.ref:pass@pooler.supabase.com:5432/postgres'));
559
+ // Switches to port 6543, adds ?pgbouncer=true, generates direct URL for migrations
467
560
  ```
468
561
 
469
- The framework includes:
470
- - **API Executor** HTTP client with retry, rate limiting, pagination
471
- - **Credential Resolver** Pulls secrets from Vault, env, or OAuth tokens
472
- - **AWS SigV4** Native AWS request signing for DynamoDB, S3, etc.
562
+ The setup wizard shows all auto-configurations in the UI:
563
+ - 🟢 Provider detection (Supabase, Neon)
564
+ - Auto-configured optimizations (pooler mode, pgbouncer param)
565
+ - 🔗 Pooler URL and Direct URL (for migrations)
473
566
 
474
567
  ---
475
568
 
476
- ## Agent Tools
569
+ ## Security & Compliance
477
570
 
478
- 28 built-in tools available to agents running in the Enterprise runtime:
571
+ ### Authentication
479
572
 
480
- | Tool | Description |
481
- |------|-------------|
482
- | `bash` | Shell command execution (sandboxed) |
483
- | `browser` | Web browser automation |
484
- | `edit` | File editing with diff |
485
- | `glob` | File pattern matching |
486
- | `grep` | Text search across files |
487
- | `memory` | Agent memory read/write |
488
- | `read` | File reading |
489
- | `write` | File writing |
490
- | `web-fetch` | HTTP requests |
491
- | `web-search` | Web search (Brave API) |
492
- | `enterprise-calendar` | Calendar management |
493
- | `enterprise-code-sandbox` | Isolated code execution |
494
- | `enterprise-database` | Database queries |
495
- | `enterprise-diff` | File/text diff generation |
496
- | `enterprise-documents` | Document processing |
497
- | `enterprise-finance` | Financial calculations |
498
- | `enterprise-http` | Advanced HTTP client |
499
- | `enterprise-knowledge-search` | RAG search across knowledge bases |
500
- | `enterprise-logs` | Log analysis |
501
- | `enterprise-notifications` | Send notifications |
502
- | `enterprise-security-scan` | Security vulnerability scanning |
503
- | `enterprise-spreadsheet` | Spreadsheet operations |
504
- | `enterprise-translation` | Multi-language translation |
505
- | `enterprise-vision` | Image analysis |
506
- | `enterprise-web-research` | Deep web research |
507
- | `enterprise-workflow` | Workflow orchestration |
573
+ | Feature | Details |
574
+ |---------|---------|
575
+ | **Session cookies** | `httpOnly` cookies (`em_session`, `em_refresh`, `em_csrf`) — not localStorage |
576
+ | **CSRF protection** | Double-submit cookie pattern |
577
+ | **2FA / TOTP** | Time-based one-time passwords with backup codes |
578
+ | **SSO** | Google, Microsoft, GitHub, Okta, SAML 2.0, LDAP |
579
+ | **Password hashing** | bcrypt with cost factor 12 |
580
+ | **JWT** | Short-lived access + long-lived refresh tokens |
581
+ | **Impersonation** | Admin can impersonate users with full audit trail |
582
+
583
+ ### Authorization
584
+
585
+ | Feature | Details |
586
+ |---------|---------|
587
+ | **RBAC** | 4 roles: owner, admin, member, viewer |
588
+ | **Per-tool permissions** | Allow/deny at individual tool level |
589
+ | **5 preset profiles** | Research Assistant, Customer Support, Developer, Full Access, Sandbox |
590
+ | **Approval workflows** | Human-in-the-loop for sensitive operations |
591
+ | **Escalation chains** | Multi-level escalation with time-based auto-escalation |
592
+ | **Budget gates** | Hard cost limits per agent with warning thresholds |
593
+ | **Org-bound access** | External client users see only their org's data |
594
+
595
+ ### Transport Encryption
596
+
597
+ Optional AES-GCM encryption for all API responses:
598
+ - Dashboard derives encryption key from user password
599
+ - All API responses wrapped in `{"_enc":"..."}` in the network tab
600
+ - SSE streams excluded (EventSource can't send custom headers)
601
+ - Protects against network-level MITM even without HTTPS
602
+
603
+ ### Compliance Reporting
604
+
605
+ 5 report types with full HTML export for auditors:
606
+
607
+ | Report | Standard | Content |
608
+ |--------|----------|---------|
609
+ | **SOC 2 Type II** | Trust Service Criteria CC1-CC9 | Executive summary, risk score (A-F), control effectiveness, findings |
610
+ | **GDPR DSAR** | EU Data Protection | Data subject access request processing |
611
+ | **SOX Audit Trail** | Sarbanes-Oxley | Financial controls and audit trail |
612
+ | **Incident Report** | Custom | Security incident documentation |
613
+ | **Access Review** | Custom | User and agent access audit |
614
+
615
+ Reports include:
616
+ - Agent names resolved (not raw UUIDs)
617
+ - Organization/company name
618
+ - Generator identity
619
+ - Both positive (controls in place) and negative (gaps) findings
620
+ - Professional HTML export with enterprise styling
621
+
622
+ ### Action Journal & Rollback
623
+
624
+ Every agent action is journaled with:
625
+ - Before/after state snapshots
626
+ - Actor identity and timestamp
627
+ - Rollback capability for reversible actions
628
+ - Detail modal with full context
629
+ - Org-scoped filtering
630
+
631
+ ### Audit Logging
508
632
 
509
- Tools include a security middleware layer for permission checking and DLP scanning.
633
+ Every mutating API call is logged with:
634
+ - Actor (user or agent)
635
+ - Organization scope
636
+ - Action type and details
637
+ - IP address and request ID
638
+ - Org-scoped filtering in dashboard
510
639
 
511
640
  ---
512
641
 
513
- ## Enterprise Skills
642
+ ## Data Loss Prevention (DLP)
514
643
 
515
- 47 pre-built skill definitions organized into 3 suites:
644
+ Enterprise-grade DLP with real-time content scanning:
516
645
 
517
- ### Google Workspace (14 skills)
518
- Gmail, Calendar, Drive, Docs, Sheets, Slides, Forms, Meet, Chat, Keep, Sites, Groups, Admin, Vault
646
+ ### 7 Pre-Built Rule Packs (53 rules)
519
647
 
520
- ### Microsoft 365 (17 skills)
521
- Outlook, Teams, OneDrive, Word, Excel, PowerPoint, SharePoint, Planner, Todo, OneNote, Forms, Bookings, Power BI, Power Automate, Whiteboard, Copilot, Admin
648
+ | Pack | Rules | Examples |
649
+ |------|-------|---------|
650
+ | **PII Protection** | 8 | SSN, email, phone, address, DOB, passport, driver's license |
651
+ | **Credentials & Secrets** | 8 | API keys, passwords, private keys, tokens, connection strings |
652
+ | **Financial Data** | 8 | Credit cards, bank accounts, tax IDs, financial statements |
653
+ | **Healthcare (HIPAA)** | 7 | Medical records, diagnoses, prescriptions, insurance IDs |
654
+ | **GDPR Compliance** | 7 | EU personal data, consent records, genetic data, biometrics |
655
+ | **Intellectual Property** | 8 | Source code, trade secrets, patents, M&A, board minutes |
656
+ | **Agent Safety** | 7 | Prompt injection, jailbreak, unauthorized escalation, data exfil |
522
657
 
523
- ### Enterprise Custom (16 skills)
524
- Calendar, Code Sandbox, Database, Diff, Documents, Finance, HTTP, Knowledge Search, Logs, Notifications, Security Scan, Spreadsheet, Translation, Vision, Web Research, Workflow
658
+ ### DLP Features
525
659
 
526
- Each skill definition includes:
527
- - Tool list with parameter schemas
528
- - Required configuration fields
529
- - Risk level and side effect classification
530
- - Category and description
660
+ - **One-click rule pack deployment** — Apply entire packs from the dashboard
661
+ - **Per-rule enable/disable** Toggle rules without deleting them
662
+ - **Rule editing** — Full modal editor for pattern, action, severity
663
+ - **Detail modal** Click any rule to see full configuration
664
+ - **Violation tracking** — Real-time scanning with severity levels
665
+ - **Org-scoped** — Rules and violations filtered by organization
531
666
 
532
667
  ---
533
668
 
534
- ## Dashboard
669
+ ## Multi-Tenant & Organizations
670
+
671
+ ### Internal Organizations
672
+
673
+ - Multiple organizations within one deployment
674
+ - Org switcher on every dashboard page
675
+ - Org-scoped data: agents, users, audit logs, vault, DLP, compliance, workforce, activity
676
+ - 4 plan tiers: Free (3 agents), Team (25), Enterprise (unlimited), Self-Hosted (unlimited)
677
+
678
+ ### External Client Organizations
679
+
680
+ - Create client organizations for external customers
681
+ - Bind users to a client org with "full access"
682
+ - **Strict data isolation** — org-bound users only see their client org's data
683
+ - Impersonation respects org boundaries
684
+ - Billing records per client org per agent per month
535
685
 
536
- React-based admin dashboard served from the enterprise server:
686
+ ### SSO Configuration
537
687
 
538
- - **Dark/Light themes** Professional design with CSS custom properties
539
- - **Dynamic brand color** — Uses `settings.primaryColor` throughout
540
- - **Agent management** Create, configure, start/stop, monitor
541
- - **Real-time activity** Live tool calls, conversations, cost
542
- - **Knowledge bases** Upload, manage, search documents
543
- - **Approval workflows** Review and approve/reject pending requests
544
- - **Compliance** View reports, DLP violations, audit logs
545
- - **Settings** Company info, SSO, security, billing
546
- - **Onboarding** — Agent creation wizard with soul template selection
688
+ | Provider | Protocol |
689
+ |----------|----------|
690
+ | Google | OAuth 2.0 |
691
+ | Microsoft | OAuth 2.0 |
692
+ | GitHub | OAuth 2.0 |
693
+ | Okta | OAuth 2.0 / SAML |
694
+ | SAML 2.0 | Generic |
695
+ | LDAP | LDAP/LDAPS |
547
696
 
548
697
  ---
549
698
 
550
- ## API Reference
699
+ ## Workforce Management
551
700
 
552
- The API is organized into 3 major sections:
701
+ Manage agents like employees:
553
702
 
554
- ### Auth Routes (`/api/auth/*`)
555
- - `POST /api/auth/login` — Login with email/password
556
- - `POST /api/auth/refresh` Refresh JWT tokens
557
- - `POST /api/auth/logout` Logout (invalidate cookies)
558
- - SSO callback routes for Google, Microsoft, GitHub, Okta
703
+ | Feature | Description |
704
+ |---------|-------------|
705
+ | **Shift Schedules** | Define work hours per agent, per day |
706
+ | **On-Call Rotations** | Automatic rotation schedules |
707
+ | **Capacity Planning** | Track agent utilization and availability |
708
+ | **Clock Records** | Automatic clock in/out with timestamp logging |
709
+ | **Off-Duty Enforcement** | Guardrails prevent agents from working outside shifts |
710
+ | **Vacation Auto-Responder** | Automatic responses when agent is "on vacation" |
711
+ | **Birthday Automation** | Sends birthday emails on agent DOB |
712
+ | **Org-Scoped** | Workforce data filtered by organization |
559
713
 
560
- ### Admin Routes (`/api/admin/*`)
561
- - Agent CRUD, user management, settings, audit log
562
- - Bridge API for unified agent management (`/api/admin/bridge/agents`)
714
+ ---
563
715
 
564
- ### Engine Routes (`/api/engine/*`)
565
- 328 routes across 22 sub-apps:
716
+ ## Knowledge Base & RAG
566
717
 
567
- | Sub-App | Prefix | Description |
568
- |---------|--------|-------------|
569
- | DLP | `/dlp/*` | Data loss prevention rules & scans |
570
- | Guardrails | `/guardrails/*`, `/anomaly-rules/*` | Intervention rules & anomaly detection |
571
- | Journal | `/journal/*` | Action journal & rollback |
572
- | Communication | `/messages/*`, `/tasks/*` | Agent messaging & task delegation |
573
- | Compliance | `/compliance/*` | Reports & data retention |
574
- | Catalog | `/skills/*`, `/souls/*`, `/profiles/*`, `/permissions/*`, `/config/*` | Skill registry, soul library, permission profiles |
575
- | Agents | `/agents/*`, `/usage/*`, `/budget/*`, `/bridge/*` | Agent lifecycle, usage, budgets |
576
- | Knowledge | `/knowledge-bases/*` | Document ingestion & RAG |
577
- | Org/Approvals | `/orgs/*`, `/approvals/*`, `/escalation-chains/*` | Multi-tenant & approval workflows |
578
- | Activity | `/activity/*`, `/stats/*` | Real-time tracking & analytics |
579
- | Deploy/Schema | `/deploy-credentials/*`, `/schema/*` | Deployment & DB schema |
580
- | Community | `/community/*` | Skill marketplace |
581
- | Workforce | `/workforce/*` | Shifts, schedules, capacity |
582
- | Policies | `/policies/*` | Org policies & import |
583
- | Memory | `/memory/*` | Agent memory management |
584
- | Onboarding | `/onboarding/*` | Agent onboarding flows |
585
- | Vault | `/vault/*` | Encrypted credential storage |
586
- | Storage | `/storage/*` | Dynamic agent databases |
587
- | OAuth | `/oauth/*` | SaaS OAuth connect flows |
588
- | Knowledge Contrib | `/knowledge-contribution/*` | Agent-contributed knowledge |
589
- | Skill Updates | `/skill-updates/*` | Auto-update management |
718
+ | Feature | Description |
719
+ |---------|-------------|
720
+ | **Document Ingestion** | Upload documents for chunking and indexing |
721
+ | **BM25F Search** | Full-text search across knowledge bases |
722
+ | **RAG Retrieval** | Automatic context injection into agent prompts |
723
+ | **Multi-KB Support** | Multiple knowledge bases per org |
724
+ | **Agent Access Control** | Per-agent knowledge base permissions |
725
+ | **Contribution System** | Agents contribute learned knowledge back |
726
+ | **Bulk Import** | Import from external sources |
727
+
728
+ ---
729
+
730
+ ## Communication & Task Pipeline
731
+
732
+ ### Agent-to-Agent Messaging
733
+
734
+ - Direct messages between agents
735
+ - Broadcast messages to all agents
736
+ - Topic-based channels
737
+ - Priority levels: normal, high, urgent
738
+ - Email-based delivery via agent addresses
739
+
740
+ ### Task Pipeline
741
+
742
+ - Visual node-based task flow editor
743
+ - Task assignment and delegation
744
+ - Status tracking (pending → claimed → in_progress → completed)
745
+ - Org-scoped pipeline views
746
+ - SSE streaming for real-time updates
747
+
748
+ ### External Channels
749
+
750
+ | Channel | Mode | Features |
751
+ |---------|------|----------|
752
+ | **Email (Gmail)** | OAuth | Full CRUD, attachments, signatures |
753
+ | **Email (Outlook)** | OAuth | Full CRUD, attachments |
754
+ | **Telegram** | Long-polling | Text, media (images/video/docs), inline buttons |
755
+ | **WhatsApp** | Webhook | Text, media, templates |
756
+ | **Google Chat** | Webhook + API | Messages, spaces, reactions |
757
+
758
+ ---
759
+
760
+ ## Agent Autonomy System
761
+
762
+ Agents operate independently with configurable autonomy features:
763
+
764
+ | Feature | Description |
765
+ |---------|-------------|
766
+ | **Clock In/Out** | Agents clock in at shift start, out at end |
767
+ | **Morning Triage** | Scan overnight accumulation on first clock-in |
768
+ | **Daily Catchup** | Scheduled daily summary and planning |
769
+ | **Weekly Catchup** | Monday morning weekly review |
770
+ | **Goal Tracking** | Check goal progress at configured times |
771
+ | **Knowledge Updates** | Weekly knowledge base contribution |
772
+ | **Heartbeat** | Periodic health checks with configurable intervals |
773
+
774
+ ---
775
+
776
+ ## Meeting & Voice Intelligence
777
+
778
+ Agents can attend and participate in meetings:
779
+
780
+ | Feature | Description |
781
+ |---------|-------------|
782
+ | **Meeting Voice** | ElevenLabs TTS through virtual audio device |
783
+ | **Meeting Monitor** | Track Google Meet attendance |
784
+ | **Voice Intelligence** | Real-time transcription and analysis |
785
+ | **Browser-Based** | Joins via Playwright browser automation |
786
+ | **sox + Virtual Audio** | Audio routing for meeting participation |
787
+
788
+ ---
789
+
790
+ ## Multimodal Support
791
+
792
+ Agents can process media sent via messaging channels:
793
+
794
+ | Media Type | Support |
795
+ |------------|---------|
796
+ | **Images** | Received as base64, sent to LLM as vision content blocks |
797
+ | **Videos** | Downloaded and processed locally |
798
+ | **Documents** | Downloaded for analysis |
799
+ | **Voice Notes** | Transcription via Whisper |
800
+
801
+ Media handling includes:
802
+ - Automatic download from Telegram/WhatsApp
803
+ - Base64 encoding for LLM vision models
804
+ - Temporary file cleanup
805
+ - Dependency auto-installation (ffmpeg, etc.)
590
806
 
591
807
  ---
592
808
 
593
809
  ## Deployment
594
810
 
811
+ ### Production (Recommended)
812
+
813
+ ```bash
814
+ # Main server
815
+ pm2 start dist/cli.js --name enterprise -- start
816
+
817
+ # Standalone agents (one per agent)
818
+ pm2 start dist/cli.js --name fola-agent -- agent --env-file=.env.fola
819
+ pm2 start dist/cli.js --name john-agent -- agent --env-file=.env.john
820
+
821
+ # Cloudflare tunnel (optional, for public access)
822
+ pm2 start cloudflared -- tunnel run --token $TUNNEL_TOKEN
823
+ ```
824
+
595
825
  ### Docker
596
826
 
597
827
  ```bash
598
- npx @agenticmail/enterprise # Select "Docker" in Step 3
828
+ npx @agenticmail/enterprise # Select "Docker"
599
829
  docker compose up -d
600
830
  ```
601
831
 
602
- Generates `docker-compose.yml` + `.env` with all secrets.
603
-
604
832
  ### Fly.io
605
833
 
606
834
  ```bash
607
- npx @agenticmail/enterprise # Select "Fly.io" in Step 3
835
+ npx @agenticmail/enterprise # Select "Fly.io"
608
836
  fly launch --copy-config
609
837
  fly secrets set DATABASE_URL="..." JWT_SECRET="..."
610
838
  fly deploy
@@ -613,28 +841,16 @@ fly deploy
613
841
  ### Railway
614
842
 
615
843
  ```bash
616
- npx @agenticmail/enterprise # Select "Railway" in Step 3
844
+ npx @agenticmail/enterprise # Select "Railway"
617
845
  railway init && railway link && railway up
618
846
  ```
619
847
 
620
- ### AgenticMail Cloud
621
-
622
- ```bash
623
- npx @agenticmail/enterprise # Select "AgenticMail Cloud" in Step 3
624
- # Instant URL: subdomain.agenticmail.io
625
- ```
626
-
627
848
  ### Local / Development
628
849
 
629
850
  ```bash
630
- npx @agenticmail/enterprise # Select "Local" in Step 3
631
- # Server starts on http://localhost:3000
632
- ```
633
-
634
- Or with pm2 for production:
635
-
636
- ```bash
637
- pm2 start dist/cli.js --name agenticmail-enterprise --watch
851
+ npx @agenticmail/enterprise # Select "Local"
852
+ # or
853
+ npm run dev # Build + watch mode
638
854
  ```
639
855
 
640
856
  ---
@@ -645,10 +861,15 @@ pm2 start dist/cli.js --name agenticmail-enterprise --watch
645
861
  # Interactive setup wizard (default)
646
862
  npx @agenticmail/enterprise
647
863
 
648
- # Validate a community skill manifest
864
+ # Start the server
865
+ npx @agenticmail/enterprise start
866
+
867
+ # Run a standalone agent
868
+ npx @agenticmail/enterprise agent --env-file=.env.fola
869
+
870
+ # Validate a community skill
649
871
  npx @agenticmail/enterprise validate ./community-skills/my-skill/
650
- npx @agenticmail/enterprise validate --all
651
- npx @agenticmail/enterprise validate --json
872
+ npx @agenticmail/enterprise validate --all --json
652
873
 
653
874
  # AI-assisted skill scaffolding
654
875
  npx @agenticmail/enterprise build-skill
@@ -656,49 +877,43 @@ npx @agenticmail/enterprise build-skill
656
877
  # Submit a skill to the marketplace
657
878
  npx @agenticmail/enterprise submit-skill ./community-skills/my-skill/
658
879
 
659
- # Recover a domain registration on a new machine
880
+ # Domain recovery
660
881
  npx @agenticmail/enterprise recover --domain agents.agenticmail.io --key <hex>
661
882
 
662
- # Check DNS verification status
883
+ # DNS verification
663
884
  npx @agenticmail/enterprise verify-domain
664
- npx @agenticmail/enterprise verify-domain --domain agents.agenticmail.io
665
885
  ```
666
886
 
667
887
  ---
668
888
 
669
- ## Security
889
+ ## Environment Variables
670
890
 
671
- ### Authentication
672
- - **httpOnly cookies** — `em_session`, `em_refresh`, `em_csrf` (not localStorage JWT)
673
- - **CSRF protection** Double-submit cookie pattern
674
- - **SSO** Google, Microsoft, GitHub, Okta, SAML 2.0, LDAP
675
- - **Password hashing** bcrypt with cost factor 12
676
- - **JWT** Short-lived access tokens + long-lived refresh tokens
677
-
678
- ### Authorization
679
- - **RBAC** 4 roles: owner, admin, member, viewer
680
- - **Per-tool permissions** Allow/deny at individual tool level
681
- - **Approval workflows** Human-in-the-loop for sensitive operations
682
- - **Budget gates** Hard cost limits per agent
683
-
684
- ### Data Protection
685
- - **DLP Engine** Content scanning for PII, credentials, sensitive data
686
- - **Secure Vault** Encrypted credential storage with access control
687
- - **Egress Filter** Outbound request filtering
688
- - **IP Firewall** CIDR-based access control
689
- - **Audit Logging** Every mutating action logged with actor, timestamp, details
690
-
691
- ### Infrastructure
692
- - **Rate Limiting** — Per-IP, configurable
693
- - **Circuit Breaker** — Database connectivity protection
694
- - **Security Headers** — CSP, HSTS, X-Frame-Options, X-Content-Type-Options
695
- - **Domain Lock** — Cryptographic domain registration to prevent unauthorized duplication
891
+ | Variable | Description | Default |
892
+ |----------|-------------|---------|
893
+ | `DATABASE_URL` | Database connection string (auto-optimized for poolers) | — |
894
+ | `JWT_SECRET` | JWT signing secret | |
895
+ | `ENCRYPTION_KEY` | Vault encryption key | |
896
+ | `MASTER_KEY` | Admin master key (first-run setup) | — |
897
+ | `TRANSPORT_DECRYPT_KEY` | Transport encryption key for API responses | — |
898
+ | `PORT` | Server port | `3000` |
899
+ | `CORS_ORIGINS` | Allowed CORS origins (comma-separated) | `*` |
900
+ | `RATE_LIMIT` | Requests per minute per IP | `120` |
901
+ | `DB_POOL_MAX` | Override database connection pool size | Auto (3 for pooler, 10 for direct) |
902
+ | `AGENT_ID` | Agent ID (standalone agent mode) | — |
903
+ | `ANTHROPIC_API_KEY` | Anthropic API key | — |
904
+ | `OPENAI_API_KEY` | OpenAI API key | — |
905
+ | `XAI_API_KEY` | xAI (Grok) API key | |
906
+ | `GOOGLE_API_KEY` | Google AI API key | |
907
+ | `ELEVENLABS_API_KEY` | ElevenLabs TTS API key | — |
908
+ | `BRAVE_API_KEY` | Brave Search API key | — |
909
+ | `TELEGRAM_BOT_TOKEN` | Telegram bot token | |
910
+ | `CLOUDFLARE_TUNNEL_TOKEN` | Cloudflare tunnel token | — |
696
911
 
697
912
  ---
698
913
 
699
- ## Community Skills
914
+ ## Community Skills Marketplace
700
915
 
701
- Build and share skills through the community marketplace:
916
+ Build and share skills:
702
917
 
703
918
  ### Creating a Skill
704
919
 
@@ -706,12 +921,7 @@ Build and share skills through the community marketplace:
706
921
  npx @agenticmail/enterprise build-skill
707
922
  ```
708
923
 
709
- The AI-assisted scaffolding tool generates:
710
- - `manifest.json` — Skill metadata, tools, permissions, config fields
711
- - Tool implementations
712
- - README with usage instructions
713
-
714
- ### Skill Manifest Format
924
+ ### Skill Manifest
715
925
 
716
926
  ```json
717
927
  {
@@ -719,13 +929,12 @@ The AI-assisted scaffolding tool generates:
719
929
  "version": "1.0.0",
720
930
  "description": "What this skill does",
721
931
  "author": "your-name",
722
- "license": "MIT",
723
932
  "category": "productivity",
724
933
  "tools": [
725
934
  {
726
935
  "name": "my_tool",
727
- "description": "What this tool does",
728
- "parameters": { ... },
936
+ "description": "Tool description",
937
+ "parameters": { "type": "object", "properties": {} },
729
938
  "riskLevel": "low",
730
939
  "sideEffects": ["read"]
731
940
  }
@@ -736,63 +945,62 @@ The AI-assisted scaffolding tool generates:
736
945
  }
737
946
  ```
738
947
 
739
- ### Validating
948
+ ### Validation & Submission
740
949
 
741
950
  ```bash
742
- npx @agenticmail/enterprise validate ./community-skills/my-skill/
743
- ```
744
-
745
- ### Submitting
746
-
747
- ```bash
748
- npx @agenticmail/enterprise submit-skill ./community-skills/my-skill/
951
+ npx @agenticmail/enterprise validate ./my-skill/
952
+ npx @agenticmail/enterprise submit-skill ./my-skill/
749
953
  ```
750
954
 
751
- Skills are synced from the GitHub repository every 6 hours to all deployments.
955
+ Skills are synced from the GitHub registry every 6 hours to all deployments.
752
956
 
753
957
  ---
754
958
 
755
- ## Configuration
959
+ ## API Reference
756
960
 
757
- ### Environment Variables
961
+ The API is organized into 3 major route groups:
758
962
 
759
- | Variable | Description | Default |
760
- |----------|-------------|---------|
761
- | `DATABASE_URL` | Database connection string | — |
762
- | `JWT_SECRET` | JWT signing secret | — |
763
- | `PORT` | Server port | `3000` |
764
- | `CORS_ORIGINS` | Allowed CORS origins (comma-separated) | `*` |
765
- | `RATE_LIMIT` | Requests per minute per IP | `120` |
766
- | `AGENTICMAIL_REGISTRY_URL` | Central registry URL | `https://registry.agenticmail.com/v1` |
767
- | `ANTHROPIC_API_KEY` | For agent runtime | — |
768
- | `OPENAI_API_KEY` | For agent runtime | — |
963
+ ### Auth (`/api/auth/*`)
964
+ Login, refresh, logout, SSO callbacks, bootstrap, 2FA, impersonation
769
965
 
770
- ### Server Config (Programmatic)
966
+ ### Admin (`/api/admin/*`)
967
+ Agent CRUD, user management, settings, audit log, bridge API
771
968
 
772
- ```typescript
773
- createServer({
774
- port: 3000,
775
- db: adapter,
776
- jwtSecret: 'your-secret',
777
- corsOrigins: ['https://your-domain.com'],
778
- rateLimit: 120,
779
- trustedProxies: ['10.0.0.0/8'],
780
- logging: true,
781
- runtime: {
782
- enabled: true,
783
- defaultModel: { provider: 'anthropic', modelId: 'claude-sonnet-4-20250514' },
784
- apiKeys: { anthropic: '...' },
785
- },
786
- });
787
- ```
969
+ ### Engine (`/api/engine/*`)
970
+ 82 modules exposed across 22+ route sub-apps:
971
+
972
+ | Sub-App | Routes | Description |
973
+ |---------|--------|-------------|
974
+ | Agents & Lifecycle | `/agents/*`, `/usage/*`, `/budget/*` | Agent management, health, budgets |
975
+ | DLP | `/dlp/*` | Rules, rule packs, violations, scanning |
976
+ | Guardrails | `/guardrails/*`, `/anomaly-rules/*` | Intervention rules, anomaly detection |
977
+ | Journal | `/journal/*` | Action journal, rollback, detail |
978
+ | Compliance | `/compliance/*` | 5 report types, HTML export |
979
+ | Knowledge | `/knowledge-bases/*` | Documents, RAG, search |
980
+ | Communication | `/messages/*`, `/tasks/*` | Messaging, task pipeline |
981
+ | Workforce | `/workforce/*` | Schedules, shifts, capacity, clock records |
982
+ | Catalog | `/skills/*`, `/souls/*`, `/profiles/*`, `/permissions/*` | Registry |
983
+ | Approvals | `/approvals/*`, `/escalation-chains/*` | Approval workflows |
984
+ | Activity | `/activity/*`, `/stats/*` | Real-time tracking |
985
+ | Vault | `/vault/*` | Encrypted credentials |
986
+ | Storage | `/storage/*` | Dynamic agent databases |
987
+ | OAuth | `/oauth/*` | SaaS OAuth connect |
988
+ | Policies | `/policies/*` | Org policies |
989
+ | Memory | `/memory/*` | Agent memory |
990
+ | Onboarding | `/onboarding/*` | Agent onboarding |
991
+ | Community | `/community/*` | Skill marketplace |
992
+ | Roles | `/roles/*` | Custom role templates |
993
+ | Organizations | `/orgs/*` | Multi-tenant management |
994
+ | Skill Updates | `/skill-updates/*` | Auto-update management |
995
+ | Knowledge Contrib | `/knowledge-contribution/*` | Agent contributions |
788
996
 
789
997
  ---
790
998
 
791
999
  ## Requirements
792
1000
 
793
- - **Node.js** 18+
1001
+ - **Node.js** 18+ (22+ recommended)
794
1002
  - **Database** — Any of the 10 supported backends
795
- - **LLM API Key** — Anthropic or OpenAI (for agent runtime)
1003
+ - **LLM API Key** — Anthropic, OpenAI, xAI, or Google (at least one)
796
1004
 
797
1005
  ---
798
1006
 
@@ -802,4 +1010,4 @@ MIT — See [LICENSE](./LICENSE)
802
1010
 
803
1011
  ---
804
1012
 
805
- Built by [AgenticMail](https://agenticmail.io) · [GitHub](https://github.com/agenticmail/enterprise) · [AgenticMail](https://agenticmail.ai)
1013
+ Built with [AgenticMail](https://agenticmail.io) · [Docs](https://docs.agenticmail.io) · [Discord](https://discord.gg/agenticmail)