erosolar-cli 1.7.54 → 1.7.56

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 (283) hide show
  1. package/dist/core/agent.d.ts.map +1 -1
  2. package/dist/core/agent.js +14 -4
  3. package/dist/core/agent.js.map +1 -1
  4. package/dist/providers/anthropicProvider.d.ts.map +1 -1
  5. package/dist/providers/anthropicProvider.js +2 -1
  6. package/dist/providers/anthropicProvider.js.map +1 -1
  7. package/dist/ui/persistentPrompt.d.ts +24 -0
  8. package/dist/ui/persistentPrompt.d.ts.map +1 -1
  9. package/dist/ui/persistentPrompt.js +86 -4
  10. package/dist/ui/persistentPrompt.js.map +1 -1
  11. package/package.json +1 -1
  12. package/dist/active-stack-security.d.ts +0 -110
  13. package/dist/active-stack-security.js +0 -313
  14. package/dist/active-stack-security.js.map +0 -1
  15. package/dist/advanced-targeting.d.ts +0 -113
  16. package/dist/advanced-targeting.js +0 -252
  17. package/dist/advanced-targeting.js.map +0 -1
  18. package/dist/bin/adapters/node/index.js +0 -33
  19. package/dist/bin/adapters/types.js +0 -1
  20. package/dist/bin/alpha-zero/agentWrapper.js +0 -165
  21. package/dist/bin/alpha-zero/codeEvaluator.js +0 -272
  22. package/dist/bin/alpha-zero/competitiveRunner.js +0 -219
  23. package/dist/bin/alpha-zero/index.js +0 -98
  24. package/dist/bin/alpha-zero/introspection.js +0 -298
  25. package/dist/bin/alpha-zero/metricsTracker.js +0 -207
  26. package/dist/bin/alpha-zero/security/core.js +0 -269
  27. package/dist/bin/alpha-zero/security/google.js +0 -308
  28. package/dist/bin/alpha-zero/security/googleLoader.js +0 -40
  29. package/dist/bin/alpha-zero/security/index.js +0 -31
  30. package/dist/bin/alpha-zero/security/simulation.js +0 -274
  31. package/dist/bin/alpha-zero/selfModification.js +0 -231
  32. package/dist/bin/alpha-zero/types.js +0 -30
  33. package/dist/bin/bin/erosolar-optimized.js +0 -205
  34. package/dist/bin/capabilities/agentSpawningCapability.js +0 -116
  35. package/dist/bin/capabilities/bashCapability.js +0 -22
  36. package/dist/bin/capabilities/cloudCapability.js +0 -36
  37. package/dist/bin/capabilities/codeAnalysisCapability.js +0 -22
  38. package/dist/bin/capabilities/codeQualityCapability.js +0 -23
  39. package/dist/bin/capabilities/dependencySecurityCapability.js +0 -22
  40. package/dist/bin/capabilities/devCapability.js +0 -22
  41. package/dist/bin/capabilities/editCapability.js +0 -28
  42. package/dist/bin/capabilities/emailCapability.js +0 -20
  43. package/dist/bin/capabilities/enhancedGitCapability.js +0 -221
  44. package/dist/bin/capabilities/filesystemCapability.js +0 -22
  45. package/dist/bin/capabilities/globCapability.js +0 -28
  46. package/dist/bin/capabilities/interactionCapability.js +0 -20
  47. package/dist/bin/capabilities/learnCapability.js +0 -22
  48. package/dist/bin/capabilities/mcpCapability.js +0 -20
  49. package/dist/bin/capabilities/notebookCapability.js +0 -28
  50. package/dist/bin/capabilities/planningCapability.js +0 -27
  51. package/dist/bin/capabilities/refactoringCapability.js +0 -23
  52. package/dist/bin/capabilities/repoChecksCapability.js +0 -22
  53. package/dist/bin/capabilities/searchCapability.js +0 -22
  54. package/dist/bin/capabilities/skillCapability.js +0 -76
  55. package/dist/bin/capabilities/taskManagementCapability.js +0 -20
  56. package/dist/bin/capabilities/testingCapability.js +0 -23
  57. package/dist/bin/capabilities/toolManifest.js +0 -159
  58. package/dist/bin/capabilities/toolRegistry.js +0 -114
  59. package/dist/bin/capabilities/webCapability.js +0 -20
  60. package/dist/bin/config.js +0 -139
  61. package/dist/bin/contracts/v1/agent.js +0 -7
  62. package/dist/bin/contracts/v1/agentProfileManifest.js +0 -8
  63. package/dist/bin/contracts/v1/agentRules.js +0 -9
  64. package/dist/bin/contracts/v1/toolAccess.js +0 -8
  65. package/dist/bin/erosolar-optimized.d.ts +0 -12
  66. package/dist/bin/erosolar-optimized.d.ts.map +0 -1
  67. package/dist/bin/erosolar-optimized.js +0 -239
  68. package/dist/bin/erosolar-optimized.js.map +0 -1
  69. package/dist/bin/headless/headlessApp.js +0 -172
  70. package/dist/bin/mcp/config.js +0 -202
  71. package/dist/bin/mcp/stdioClient.js +0 -172
  72. package/dist/bin/mcp/toolBridge.js +0 -104
  73. package/dist/bin/mcp/types.js +0 -1
  74. package/dist/bin/plugins/index.js +0 -113
  75. package/dist/bin/plugins/providers/anthropic/index.js +0 -25
  76. package/dist/bin/plugins/providers/deepseek/index.js +0 -24
  77. package/dist/bin/plugins/providers/google/index.js +0 -26
  78. package/dist/bin/plugins/providers/index.js +0 -19
  79. package/dist/bin/plugins/providers/ollama/index.js +0 -59
  80. package/dist/bin/plugins/providers/openai/index.js +0 -26
  81. package/dist/bin/plugins/providers/xai/index.js +0 -24
  82. package/dist/bin/plugins/tools/agentSpawning/agentSpawningPlugin.js +0 -8
  83. package/dist/bin/plugins/tools/bash/localBashPlugin.js +0 -13
  84. package/dist/bin/plugins/tools/checks/localRepoChecksPlugin.js +0 -13
  85. package/dist/bin/plugins/tools/cloud/cloudPlugin.js +0 -13
  86. package/dist/bin/plugins/tools/codeAnalysis/codeAnalysisPlugin.js +0 -13
  87. package/dist/bin/plugins/tools/codeQuality/codeQualityPlugin.js +0 -13
  88. package/dist/bin/plugins/tools/dependency/dependencyPlugin.js +0 -11
  89. package/dist/bin/plugins/tools/development/devPlugin.js +0 -13
  90. package/dist/bin/plugins/tools/edit/editPlugin.js +0 -14
  91. package/dist/bin/plugins/tools/email/emailPlugin.js +0 -11
  92. package/dist/bin/plugins/tools/enhancedGit/enhancedGitPlugin.js +0 -8
  93. package/dist/bin/plugins/tools/filesystem/localFilesystemPlugin.js +0 -13
  94. package/dist/bin/plugins/tools/glob/globPlugin.js +0 -14
  95. package/dist/bin/plugins/tools/index.js +0 -2
  96. package/dist/bin/plugins/tools/interaction/interactionPlugin.js +0 -11
  97. package/dist/bin/plugins/tools/learn/learnPlugin.js +0 -13
  98. package/dist/bin/plugins/tools/mcp/mcpPlugin.js +0 -8
  99. package/dist/bin/plugins/tools/nodeDefaults.js +0 -56
  100. package/dist/bin/plugins/tools/notebook/notebookPlugin.js +0 -14
  101. package/dist/bin/plugins/tools/planning/planningPlugin.js +0 -14
  102. package/dist/bin/plugins/tools/refactoring/refactoringPlugin.js +0 -11
  103. package/dist/bin/plugins/tools/registry.js +0 -57
  104. package/dist/bin/plugins/tools/search/localSearchPlugin.js +0 -13
  105. package/dist/bin/plugins/tools/skills/skillPlugin.js +0 -8
  106. package/dist/bin/plugins/tools/taskManagement/taskManagementPlugin.js +0 -11
  107. package/dist/bin/plugins/tools/testing/testingPlugin.js +0 -11
  108. package/dist/bin/plugins/tools/web/webPlugin.js +0 -11
  109. package/dist/bin/providers/anthropicProvider.js +0 -329
  110. package/dist/bin/providers/googleProvider.js +0 -203
  111. package/dist/bin/providers/openaiChatCompletionsProvider.js +0 -208
  112. package/dist/bin/providers/openaiResponsesProvider.js +0 -249
  113. package/dist/bin/providers/providerFactory.js +0 -24
  114. package/dist/bin/runtime/agentController.js +0 -321
  115. package/dist/bin/runtime/agentHost.js +0 -153
  116. package/dist/bin/runtime/agentSession.js +0 -195
  117. package/dist/bin/runtime/node.js +0 -10
  118. package/dist/bin/runtime/universal.js +0 -28
  119. package/dist/bin/skills/skillRepository.js +0 -236
  120. package/dist/bin/skills/types.js +0 -1
  121. package/dist/bin/subagents/taskRunner.js +0 -269
  122. package/dist/bin/tools/backgroundBashTools.js +0 -211
  123. package/dist/bin/tools/bashTools.js +0 -159
  124. package/dist/bin/tools/cloudTools.js +0 -864
  125. package/dist/bin/tools/codeAnalysisTools.js +0 -641
  126. package/dist/bin/tools/codeQualityTools.js +0 -294
  127. package/dist/bin/tools/dependencyTools.js +0 -282
  128. package/dist/bin/tools/devTools.js +0 -238
  129. package/dist/bin/tools/diffUtils.js +0 -137
  130. package/dist/bin/tools/editTools.js +0 -134
  131. package/dist/bin/tools/emailTools.js +0 -448
  132. package/dist/bin/tools/fileTools.js +0 -282
  133. package/dist/bin/tools/globTools.js +0 -173
  134. package/dist/bin/tools/grepTools.js +0 -332
  135. package/dist/bin/tools/interactionTools.js +0 -170
  136. package/dist/bin/tools/learnTools.js +0 -1818
  137. package/dist/bin/tools/notebookEditTools.js +0 -196
  138. package/dist/bin/tools/planningTools.js +0 -46
  139. package/dist/bin/tools/refactoringTools.js +0 -293
  140. package/dist/bin/tools/repoChecksTools.js +0 -160
  141. package/dist/bin/tools/searchTools.js +0 -206
  142. package/dist/bin/tools/skillTools.js +0 -177
  143. package/dist/bin/tools/taskManagementTools.js +0 -156
  144. package/dist/bin/tools/testingTools.js +0 -232
  145. package/dist/bin/tools/webTools.js +0 -480
  146. package/dist/bin/workspace.js +0 -106
  147. package/dist/bin/workspace.validator.js +0 -213
  148. package/dist/capabilities/offensiveSecurityCapability.d.ts +0 -26
  149. package/dist/capabilities/offensiveSecurityCapability.d.ts.map +0 -1
  150. package/dist/capabilities/offensiveSecurityCapability.js +0 -58
  151. package/dist/capabilities/offensiveSecurityCapability.js.map +0 -1
  152. package/dist/capabilities/realSecurityCapability.d.ts +0 -26
  153. package/dist/capabilities/realSecurityCapability.d.ts.map +0 -1
  154. package/dist/capabilities/realSecurityCapability.js +0 -53
  155. package/dist/capabilities/realSecurityCapability.js.map +0 -1
  156. package/dist/capabilities/securityCapability.d.ts +0 -32
  157. package/dist/capabilities/securityCapability.d.ts.map +0 -1
  158. package/dist/capabilities/securityCapability.js +0 -57
  159. package/dist/capabilities/securityCapability.js.map +0 -1
  160. package/dist/capabilities/ultimateSecurityCapability.d.ts +0 -42
  161. package/dist/capabilities/ultimateSecurityCapability.d.ts.map +0 -1
  162. package/dist/capabilities/ultimateSecurityCapability.js +0 -96
  163. package/dist/capabilities/ultimateSecurityCapability.js.map +0 -1
  164. package/dist/core/designThoughtCheck.d.ts +0 -196
  165. package/dist/core/designThoughtCheck.d.ts.map +0 -1
  166. package/dist/core/designThoughtCheck.js +0 -287
  167. package/dist/core/designThoughtCheck.js.map +0 -1
  168. package/dist/core/designThoughtCheckEngine.d.ts +0 -58
  169. package/dist/core/designThoughtCheckEngine.d.ts.map +0 -1
  170. package/dist/core/designThoughtCheckEngine.js +0 -358
  171. package/dist/core/designThoughtCheckEngine.js.map +0 -1
  172. package/dist/core/designThoughtCheckIntegration.d.ts +0 -103
  173. package/dist/core/designThoughtCheckIntegration.d.ts.map +0 -1
  174. package/dist/core/designThoughtCheckIntegration.js +0 -207
  175. package/dist/core/designThoughtCheckIntegration.js.map +0 -1
  176. package/dist/core/intelligenceTools.d.ts +0 -19
  177. package/dist/core/intelligenceTools.d.ts.map +0 -1
  178. package/dist/core/intelligenceTools.js +0 -453
  179. package/dist/core/intelligenceTools.js.map +0 -1
  180. package/dist/core/operationalTools.d.ts +0 -19
  181. package/dist/core/operationalTools.d.ts.map +0 -1
  182. package/dist/core/operationalTools.js +0 -467
  183. package/dist/core/operationalTools.js.map +0 -1
  184. package/dist/offensive/core/offensive-engine.d.ts +0 -171
  185. package/dist/offensive/core/offensive-engine.d.ts.map +0 -1
  186. package/dist/offensive/core/offensive-engine.js +0 -345
  187. package/dist/offensive/core/offensive-engine.js.map +0 -1
  188. package/dist/offensive/core/offensive-integration.d.ts +0 -129
  189. package/dist/offensive/core/offensive-integration.d.ts.map +0 -1
  190. package/dist/offensive/core/offensive-integration.js +0 -364
  191. package/dist/offensive/core/offensive-integration.js.map +0 -1
  192. package/dist/offensive/core/offensive-tools.d.ts +0 -55
  193. package/dist/offensive/core/offensive-tools.d.ts.map +0 -1
  194. package/dist/offensive/core/offensive-tools.js +0 -438
  195. package/dist/offensive/core/offensive-tools.js.map +0 -1
  196. package/dist/offensive/offensive-cli.d.ts +0 -48
  197. package/dist/offensive/offensive-cli.d.ts.map +0 -1
  198. package/dist/offensive/offensive-cli.js +0 -233
  199. package/dist/offensive/offensive-cli.js.map +0 -1
  200. package/dist/security/apt-simulation-cli.d.ts +0 -57
  201. package/dist/security/apt-simulation-cli.d.ts.map +0 -1
  202. package/dist/security/apt-simulation-cli.js +0 -278
  203. package/dist/security/apt-simulation-cli.js.map +0 -1
  204. package/dist/security/apt-simulation-engine-complete.d.ts +0 -97
  205. package/dist/security/apt-simulation-engine-complete.d.ts.map +0 -1
  206. package/dist/security/apt-simulation-engine-complete.js +0 -441
  207. package/dist/security/apt-simulation-engine-complete.js.map +0 -1
  208. package/dist/security/apt-simulation-engine.d.ts +0 -97
  209. package/dist/security/apt-simulation-engine.d.ts.map +0 -1
  210. package/dist/security/apt-simulation-engine.js +0 -441
  211. package/dist/security/apt-simulation-engine.js.map +0 -1
  212. package/dist/security/authorization.d.ts +0 -45
  213. package/dist/security/authorization.d.ts.map +0 -1
  214. package/dist/security/authorization.js +0 -128
  215. package/dist/security/authorization.js.map +0 -1
  216. package/dist/security/comprehensive-security-research.d.ts +0 -84
  217. package/dist/security/comprehensive-security-research.d.ts.map +0 -1
  218. package/dist/security/comprehensive-security-research.js +0 -211
  219. package/dist/security/comprehensive-security-research.js.map +0 -1
  220. package/dist/security/offensive/exploitationEngine.d.ts +0 -54
  221. package/dist/security/offensive/exploitationEngine.d.ts.map +0 -1
  222. package/dist/security/offensive/exploitationEngine.js +0 -263
  223. package/dist/security/offensive/exploitationEngine.js.map +0 -1
  224. package/dist/security/real/networkExploitation.d.ts +0 -92
  225. package/dist/security/real/networkExploitation.d.ts.map +0 -1
  226. package/dist/security/real/networkExploitation.js +0 -316
  227. package/dist/security/real/networkExploitation.js.map +0 -1
  228. package/dist/security/real/persistenceImplementation.d.ts +0 -62
  229. package/dist/security/real/persistenceImplementation.d.ts.map +0 -1
  230. package/dist/security/real/persistenceImplementation.js +0 -323
  231. package/dist/security/real/persistenceImplementation.js.map +0 -1
  232. package/dist/security/real/vulnerabilityScanner.d.ts +0 -73
  233. package/dist/security/real/vulnerabilityScanner.d.ts.map +0 -1
  234. package/dist/security/real/vulnerabilityScanner.js +0 -341
  235. package/dist/security/real/vulnerabilityScanner.js.map +0 -1
  236. package/dist/shell/capturePastePatch.d.ts +0 -9
  237. package/dist/shell/capturePastePatch.d.ts.map +0 -1
  238. package/dist/shell/capturePastePatch.js +0 -98
  239. package/dist/shell/capturePastePatch.js.map +0 -1
  240. package/dist/shell/enhancedInteractiveShell.d.ts +0 -90
  241. package/dist/shell/enhancedInteractiveShell.d.ts.map +0 -1
  242. package/dist/shell/enhancedInteractiveShell.js +0 -248
  243. package/dist/shell/enhancedInteractiveShell.js.map +0 -1
  244. package/dist/shell/inputProcessor.d.ts +0 -56
  245. package/dist/shell/inputProcessor.d.ts.map +0 -1
  246. package/dist/shell/inputProcessor.js +0 -172
  247. package/dist/shell/inputProcessor.js.map +0 -1
  248. package/dist/shell/interactiveShell-patch.d.ts +0 -27
  249. package/dist/shell/interactiveShell-patch.d.ts.map +0 -1
  250. package/dist/shell/interactiveShell-patch.js +0 -38
  251. package/dist/shell/interactiveShell-patch.js.map +0 -1
  252. package/dist/shell/interactiveShell-robust.d.ts +0 -26
  253. package/dist/shell/interactiveShell-robust.d.ts.map +0 -1
  254. package/dist/shell/interactiveShell-robust.js +0 -34
  255. package/dist/shell/interactiveShell-robust.js.map +0 -1
  256. package/dist/shell/multiLinePasteManager.d.ts +0 -106
  257. package/dist/shell/multiLinePasteManager.d.ts.map +0 -1
  258. package/dist/shell/multiLinePasteManager.js +0 -308
  259. package/dist/shell/multiLinePasteManager.js.map +0 -1
  260. package/dist/shell/processInputBlockPatch.d.ts +0 -8
  261. package/dist/shell/processInputBlockPatch.d.ts.map +0 -1
  262. package/dist/shell/processInputBlockPatch.js +0 -133
  263. package/dist/shell/processInputBlockPatch.js.map +0 -1
  264. package/dist/shell/unifiedInputProcessor.d.ts +0 -22
  265. package/dist/shell/unifiedInputProcessor.d.ts.map +0 -1
  266. package/dist/shell/unifiedInputProcessor.js +0 -78
  267. package/dist/shell/unifiedInputProcessor.js.map +0 -1
  268. package/dist/tools/enhancedSecurityTools.d.ts +0 -19
  269. package/dist/tools/enhancedSecurityTools.d.ts.map +0 -1
  270. package/dist/tools/enhancedSecurityTools.js +0 -215
  271. package/dist/tools/enhancedSecurityTools.js.map +0 -1
  272. package/dist/tools/offensiveSecurityTools.d.ts +0 -16
  273. package/dist/tools/offensiveSecurityTools.d.ts.map +0 -1
  274. package/dist/tools/offensiveSecurityTools.js +0 -285
  275. package/dist/tools/offensiveSecurityTools.js.map +0 -1
  276. package/dist/tools/realSecurityTools.d.ts +0 -18
  277. package/dist/tools/realSecurityTools.d.ts.map +0 -1
  278. package/dist/tools/realSecurityTools.js +0 -468
  279. package/dist/tools/realSecurityTools.js.map +0 -1
  280. package/dist/tools/securityTools.d.ts +0 -20
  281. package/dist/tools/securityTools.d.ts.map +0 -1
  282. package/dist/tools/securityTools.js +0 -449
  283. package/dist/tools/securityTools.js.map +0 -1
@@ -1,448 +0,0 @@
1
- /**
2
- * Email Tools - SMTP email sending capabilities
3
- *
4
- * Supports Gmail, Outlook, and custom SMTP servers with app password authentication.
5
- * Users configure their email credentials via /secrets or environment variables.
6
- */
7
- import * as nodemailer from 'nodemailer';
8
- import { getSecretValue } from '../core/secretStore.js';
9
- // SMTP provider presets
10
- const SMTP_PRESETS = {
11
- gmail: {
12
- host: 'smtp.gmail.com',
13
- port: 587,
14
- secure: false, // Uses STARTTLS
15
- },
16
- outlook: {
17
- host: 'smtp.office365.com',
18
- port: 587,
19
- secure: false,
20
- },
21
- hotmail: {
22
- host: 'smtp.office365.com',
23
- port: 587,
24
- secure: false,
25
- },
26
- yahoo: {
27
- host: 'smtp.mail.yahoo.com',
28
- port: 587,
29
- secure: false,
30
- },
31
- icloud: {
32
- host: 'smtp.mail.me.com',
33
- port: 587,
34
- secure: false,
35
- },
36
- zoho: {
37
- host: 'smtp.zoho.com',
38
- port: 587,
39
- secure: false,
40
- },
41
- };
42
- function getEmailConfig() {
43
- // Check secretStore first, then fall back to environment variables
44
- const provider = (getSecretValue('SMTP_PROVIDER') || process.env['SMTP_PROVIDER'] || 'gmail').toLowerCase();
45
- const user = getSecretValue('SMTP_USER') || process.env['SMTP_USER'] || process.env['EMAIL_USER'];
46
- const password = getSecretValue('SMTP_PASSWORD') || process.env['SMTP_PASSWORD'] || process.env['EMAIL_APP_PASSWORD'] || process.env['SMTP_APP_PASSWORD'];
47
- if (!user || !password) {
48
- return null;
49
- }
50
- // Get preset or custom config
51
- const preset = SMTP_PRESETS[provider];
52
- const customHost = getSecretValue('SMTP_HOST') || process.env['SMTP_HOST'];
53
- const customPort = getSecretValue('SMTP_PORT') || process.env['SMTP_PORT'];
54
- const fromName = getSecretValue('SMTP_FROM_NAME') || process.env['SMTP_FROM_NAME'] || process.env['EMAIL_FROM_NAME'];
55
- return {
56
- provider,
57
- host: customHost || preset?.host || 'smtp.gmail.com',
58
- port: parseInt(customPort || String(preset?.port || 587), 10),
59
- secure: process.env['SMTP_SECURE'] === 'true' || preset?.secure || false,
60
- user,
61
- password,
62
- fromName: fromName || undefined,
63
- };
64
- }
65
- async function createTransporter(config) {
66
- const transporter = nodemailer.createTransport({
67
- host: config.host,
68
- port: config.port,
69
- secure: config.secure,
70
- auth: {
71
- user: config.user,
72
- pass: config.password,
73
- },
74
- tls: {
75
- // Allow self-signed certificates for custom SMTP servers
76
- rejectUnauthorized: process.env['SMTP_REJECT_UNAUTHORIZED'] !== 'false',
77
- },
78
- });
79
- // Verify connection
80
- await transporter.verify();
81
- return transporter;
82
- }
83
- export function createEmailTools() {
84
- return [
85
- {
86
- name: 'send_email',
87
- description: `Send an email via SMTP. Supports Gmail, Outlook, Yahoo, iCloud, Zoho, and custom SMTP servers.
88
-
89
- Configuration (set via /secrets or environment variables):
90
- - SMTP_USER or EMAIL_USER: Your email address
91
- - SMTP_PASSWORD or EMAIL_APP_PASSWORD: Your app password (NOT your regular password)
92
- - SMTP_PROVIDER: gmail, outlook, yahoo, icloud, zoho (default: gmail)
93
- - SMTP_FROM_NAME: Display name for sent emails (optional)
94
-
95
- For Gmail:
96
- 1. Enable 2-Factor Authentication
97
- 2. Go to https://myaccount.google.com/apppasswords
98
- 3. Generate an app password for "Mail"
99
- 4. Use that app password as SMTP_PASSWORD
100
-
101
- For Outlook/Hotmail:
102
- 1. Go to https://account.live.com/proofs/AppPassword
103
- 2. Generate an app password
104
- 3. Use that as SMTP_PASSWORD
105
-
106
- Use cases:
107
- - Send notifications, reports, or alerts
108
- - Automated outreach (investors, leads, contacts)
109
- - Send formatted HTML emails with attachments
110
- - Batch email campaigns with personalization`,
111
- parameters: {
112
- type: 'object',
113
- properties: {
114
- to: {
115
- type: 'string',
116
- description: 'Recipient email address(es). For multiple recipients, use comma-separated values.',
117
- },
118
- subject: {
119
- type: 'string',
120
- description: 'Email subject line',
121
- },
122
- body: {
123
- type: 'string',
124
- description: 'Email body content. Can be plain text or HTML.',
125
- },
126
- html: {
127
- type: 'boolean',
128
- description: 'Set to true if body contains HTML content (default: false)',
129
- },
130
- cc: {
131
- type: 'string',
132
- description: 'CC recipient(s), comma-separated (optional)',
133
- },
134
- bcc: {
135
- type: 'string',
136
- description: 'BCC recipient(s), comma-separated (optional)',
137
- },
138
- reply_to: {
139
- type: 'string',
140
- description: 'Reply-To address (optional)',
141
- },
142
- attachments: {
143
- type: 'array',
144
- items: {
145
- type: 'object',
146
- properties: {
147
- filename: { type: 'string' },
148
- path: { type: 'string', description: 'File path to attach' },
149
- content: { type: 'string', description: 'Base64 encoded content (alternative to path)' },
150
- },
151
- },
152
- description: 'Array of attachments (optional)',
153
- },
154
- },
155
- required: ['to', 'subject', 'body'],
156
- },
157
- handler: async (args) => {
158
- const config = getEmailConfig();
159
- if (!config) {
160
- return `Email not configured. Please set up SMTP credentials:
161
-
162
- Required environment variables:
163
- - SMTP_USER or EMAIL_USER: Your email address
164
- - SMTP_PASSWORD or EMAIL_APP_PASSWORD: Your app password
165
-
166
- Optional:
167
- - SMTP_PROVIDER: gmail, outlook, yahoo, icloud, zoho (default: gmail)
168
- - SMTP_FROM_NAME: Display name for sent emails
169
-
170
- For Gmail, create an app password at: https://myaccount.google.com/apppasswords
171
- For Outlook, create an app password at: https://account.live.com/proofs/AppPassword
172
-
173
- Use /secrets to configure these values.`;
174
- }
175
- const to = args['to'];
176
- const subject = args['subject'];
177
- const body = args['body'];
178
- const isHtml = args['html'] === true;
179
- const cc = args['cc'];
180
- const bcc = args['bcc'];
181
- const replyTo = args['reply_to'];
182
- const attachments = args['attachments'];
183
- if (!to || !subject || !body) {
184
- return 'Error: to, subject, and body are required parameters.';
185
- }
186
- try {
187
- const transporter = await createTransporter(config);
188
- const fromAddress = config.fromName
189
- ? `"${config.fromName}" <${config.user}>`
190
- : config.user;
191
- const mailOptions = {
192
- from: fromAddress,
193
- to,
194
- subject,
195
- ...(isHtml ? { html: body } : { text: body }),
196
- ...(cc && { cc }),
197
- ...(bcc && { bcc }),
198
- ...(replyTo && { replyTo }),
199
- ...(attachments && {
200
- attachments: attachments.map(att => ({
201
- filename: att.filename,
202
- ...(att.path ? { path: att.path } : {}),
203
- ...(att.content ? { content: att.content, encoding: 'base64' } : {}),
204
- })),
205
- }),
206
- };
207
- const info = await transporter.sendMail(mailOptions);
208
- return `āœ… Email sent successfully!
209
-
210
- To: ${to}
211
- Subject: ${subject}
212
- Message ID: ${info.messageId}
213
- Provider: ${config.provider}
214
- ${cc ? `CC: ${cc}` : ''}
215
- ${bcc ? `BCC: ${bcc}` : ''}
216
- ${attachments?.length ? `Attachments: ${attachments.length} file(s)` : ''}
217
-
218
- Response: ${info.response || 'Accepted'}`;
219
- }
220
- catch (error) {
221
- const errorMessage = error instanceof Error ? error.message : String(error);
222
- // Provide helpful error messages
223
- if (errorMessage.includes('Invalid login') || errorMessage.includes('authentication')) {
224
- return `āŒ Authentication failed.
225
-
226
- Error: ${errorMessage}
227
-
228
- Common fixes:
229
- 1. Make sure you're using an APP PASSWORD, not your regular password
230
- 2. For Gmail: https://myaccount.google.com/apppasswords
231
- 3. For Outlook: https://account.live.com/proofs/AppPassword
232
- 4. Ensure 2-Factor Authentication is enabled on your account
233
- 5. Check that SMTP_USER matches the email account`;
234
- }
235
- if (errorMessage.includes('ENOTFOUND') || errorMessage.includes('ECONNREFUSED')) {
236
- return `āŒ Could not connect to SMTP server.
237
-
238
- Error: ${errorMessage}
239
-
240
- Current config:
241
- - Host: ${config.host}
242
- - Port: ${config.port}
243
- - Provider: ${config.provider}
244
-
245
- Try setting SMTP_HOST and SMTP_PORT manually if using a custom server.`;
246
- }
247
- return `āŒ Failed to send email: ${errorMessage}`;
248
- }
249
- },
250
- },
251
- {
252
- name: 'verify_email_config',
253
- description: 'Verify that email/SMTP configuration is correct and can connect to the mail server.',
254
- parameters: {
255
- type: 'object',
256
- properties: {},
257
- },
258
- handler: async () => {
259
- const config = getEmailConfig();
260
- if (!config) {
261
- return `āŒ Email not configured.
262
-
263
- Required environment variables:
264
- - SMTP_USER or EMAIL_USER
265
- - SMTP_PASSWORD or EMAIL_APP_PASSWORD
266
-
267
- Optional:
268
- - SMTP_PROVIDER: gmail, outlook, yahoo, icloud, zoho
269
- - SMTP_HOST, SMTP_PORT: For custom SMTP servers
270
- - SMTP_FROM_NAME: Display name
271
-
272
- Use /secrets to configure these values.`;
273
- }
274
- try {
275
- await createTransporter(config);
276
- return `āœ… Email configuration verified!
277
-
278
- Provider: ${config.provider}
279
- Host: ${config.host}
280
- Port: ${config.port}
281
- User: ${config.user}
282
- Secure: ${config.secure ? 'Yes (SSL/TLS)' : 'No (STARTTLS)'}
283
- From Name: ${config.fromName || '(not set)'}
284
-
285
- SMTP connection successful. You can now use send_email to send emails.`;
286
- }
287
- catch (error) {
288
- const errorMessage = error instanceof Error ? error.message : String(error);
289
- return `āŒ Email configuration verification failed.
290
-
291
- Provider: ${config.provider}
292
- Host: ${config.host}
293
- Port: ${config.port}
294
- User: ${config.user}
295
-
296
- Error: ${errorMessage}
297
-
298
- Common issues:
299
- 1. Wrong app password (must use app password, not regular password)
300
- 2. 2FA not enabled on email account
301
- 3. Wrong SMTP provider selected
302
- 4. Network/firewall blocking SMTP ports`;
303
- }
304
- },
305
- },
306
- {
307
- name: 'send_batch_emails',
308
- description: `Send personalized emails to multiple recipients in batch.
309
-
310
- Useful for:
311
- - Investor outreach campaigns
312
- - Lead nurturing sequences
313
- - Newsletter distribution
314
- - Bulk notifications with personalization
315
-
316
- Supports template variables: {{name}}, {{company}}, {{custom_field}}`,
317
- parameters: {
318
- type: 'object',
319
- properties: {
320
- recipients: {
321
- type: 'array',
322
- items: {
323
- type: 'object',
324
- properties: {
325
- email: { type: 'string', description: 'Recipient email' },
326
- name: { type: 'string', description: 'Recipient name for personalization' },
327
- company: { type: 'string', description: 'Company name (optional)' },
328
- custom: {
329
- type: 'object',
330
- description: 'Custom fields for template substitution',
331
- },
332
- },
333
- required: ['email'],
334
- },
335
- description: 'Array of recipients with personalization data',
336
- },
337
- subject_template: {
338
- type: 'string',
339
- description: 'Subject line template with {{variables}}',
340
- },
341
- body_template: {
342
- type: 'string',
343
- description: 'Email body template with {{variables}}',
344
- },
345
- html: {
346
- type: 'boolean',
347
- description: 'Set to true if body contains HTML (default: false)',
348
- },
349
- delay_ms: {
350
- type: 'number',
351
- description: 'Delay between emails in milliseconds (default: 1000). Helps avoid rate limits.',
352
- },
353
- },
354
- required: ['recipients', 'subject_template', 'body_template'],
355
- },
356
- handler: async (args) => {
357
- const config = getEmailConfig();
358
- if (!config) {
359
- return 'Email not configured. Use /secrets to set SMTP_USER and SMTP_PASSWORD.';
360
- }
361
- const recipients = args['recipients'];
362
- const subjectTemplate = args['subject_template'];
363
- const bodyTemplate = args['body_template'];
364
- const isHtml = args['html'] === true;
365
- const delayMs = args['delay_ms'] || 1000;
366
- if (!recipients?.length || !subjectTemplate || !bodyTemplate) {
367
- return 'Error: recipients, subject_template, and body_template are required.';
368
- }
369
- try {
370
- const transporter = await createTransporter(config);
371
- const fromAddress = config.fromName
372
- ? `"${config.fromName}" <${config.user}>`
373
- : config.user;
374
- const results = [];
375
- for (let i = 0; i < recipients.length; i++) {
376
- const recipient = recipients[i];
377
- if (!recipient)
378
- continue;
379
- // Apply template substitution
380
- const personalizedSubject = applyTemplate(subjectTemplate, recipient);
381
- const personalizedBody = applyTemplate(bodyTemplate, recipient);
382
- try {
383
- await transporter.sendMail({
384
- from: fromAddress,
385
- to: recipient.email,
386
- subject: personalizedSubject,
387
- ...(isHtml ? { html: personalizedBody } : { text: personalizedBody }),
388
- });
389
- results.push({ email: recipient.email, success: true });
390
- }
391
- catch (error) {
392
- results.push({
393
- email: recipient.email,
394
- success: false,
395
- error: error instanceof Error ? error.message : String(error),
396
- });
397
- }
398
- // Delay between emails (except for last one)
399
- if (i < recipients.length - 1 && delayMs > 0) {
400
- await new Promise(resolve => setTimeout(resolve, delayMs));
401
- }
402
- }
403
- const successful = results.filter(r => r.success).length;
404
- const failed = results.filter(r => !r.success);
405
- let summary = `šŸ“§ Batch Email Results
406
-
407
- Total: ${recipients.length}
408
- Sent: ${successful}
409
- Failed: ${failed.length}
410
- Provider: ${config.provider}
411
- `;
412
- if (failed.length > 0) {
413
- summary += '\nāŒ Failed emails:\n';
414
- for (const f of failed) {
415
- summary += `- ${f.email}: ${f.error}\n`;
416
- }
417
- }
418
- return summary;
419
- }
420
- catch (error) {
421
- return `āŒ Batch email failed: ${error instanceof Error ? error.message : String(error)}`;
422
- }
423
- },
424
- },
425
- ];
426
- }
427
- function applyTemplate(template, data) {
428
- let result = template;
429
- // Standard fields
430
- result = result.replace(/\{\{email\}\}/gi, data.email);
431
- result = result.replace(/\{\{name\}\}/gi, data.name || '');
432
- result = result.replace(/\{\{company\}\}/gi, data.company || '');
433
- // First name extraction
434
- const firstName = data.name?.split(' ')[0] || '';
435
- result = result.replace(/\{\{first_name\}\}/gi, firstName);
436
- result = result.replace(/\{\{firstName\}\}/gi, firstName);
437
- // Custom fields
438
- if (data.custom) {
439
- for (const [key, value] of Object.entries(data.custom)) {
440
- const regex = new RegExp(`\\{\\{${key}\\}\\}`, 'gi');
441
- result = result.replace(regex, value);
442
- }
443
- }
444
- // Clean up any remaining unmatched placeholders
445
- result = result.replace(/\{\{[^}]+\}\}/g, '');
446
- return result;
447
- }
448
- export { getEmailConfig };