@evolutese/connectors
v1.0.0
Published
Built-in connectors for the Evolutese runtime — MongoDB (with in-memory fallback) and SMTP mail
Downloads
254
Readme
@evolutese/connectors
Built-in connectors for the Evolutese runtime — MongoDB and SMTP mail out of the box.
Installation
npm install @evolutese/connectors
@evolutese/runtimemust also be installed (peer dependency).
MongoConnector
Connects agents to MongoDB. Falls back to an in-memory store when no connection string is provided — catalog blueprints work out of the box without any infrastructure.
import { buildMongoConnectorFromConfig } from '@evolutese/connectors';
const mongo = await buildMongoConnectorFromConfig({
connectionString: process.env.MONGO_URI, // omit for in-memory fallback
dbName: 'myapp',
});
await bootstrapRuntime({ connectors: { mongo } });In-memory mode (development / testing)
import { InMemoryMongoConnector } from '@evolutese/connectors';
const mongo = new InMemoryMongoConnector();
// Data lives in memory — resets on process restartReal MongoDB
import { MongoClient } from 'mongodb';
import { MongoConnector } from '@evolutese/connectors';
const client = new MongoClient(process.env.MONGO_URI);
await client.connect();
const mongo = new MongoConnector(client.db('myapp'));Agent YAML usage
actions:
- id: save_invoice
connector: mongo
params:
collection: invoices
insert: { customer: "{{customer}}", amount: "{{amount}}" }
- id: list_invoices
connector: mongo
params:
collection: invoices
find: {}Supported operations: find, insert, update, delete.
MailConnector
Sends transactional email via SMTP. Falls back to simulation mode when no SMTP config is found.
import { MailConnector } from '@evolutese/connectors';
await bootstrapRuntime({
connectors: {
mail: new MailConnector({
host: 'smtp.example.com',
port: 587,
auth: { user: '[email protected]', pass: process.env.SMTP_PASS },
from: '[email protected]',
}),
},
});Environment variables
| Variable | Default |
|----------|---------|
| SMTP_HOST | — (required for real delivery) |
| SMTP_PORT | 587 |
| SMTP_SECURE | false |
| SMTP_USER | — |
| SMTP_PASS | — |
| SMTP_FROM | [email protected] |
Test connectivity
const { success, message } = await new MailConnector().test();License
MIT
