Port the legacy server/src/lib/s3.js and mailer.js (eden.md §4/§5) into
packages/integrations behind an adapter/port pattern, isolated from
domain logic per Master Prompt §13.
- s3/client.ts: @aws-sdk/client-s3 wrapper (uploadObject, getObjectStream,
deleteObject, getClient/getBucket for future multipart Backup uploads).
Lazily-initialized singleton client, forcePathStyle from
S3_FORCE_PATH_STYLE (default true). Throws a clear "S3 não configurado
(S3_ENDPOINT ausente)" whenever S3_ENDPOINT is unset — storage failures
must be loud, never a silent no-op.
- smtp/mailer.ts: nodemailer wrapper (sendMail). Lazily-initialized
singleton transporter, secure:true auto-detected on port 465, from
defaults to SMTP_FROM or SMTP_USER. Deliberately fail-soft: if
SMTP_HOST is unset, or if sending fails, logs and returns normally —
no business flow ever fails because of email, matching the legacy's
behavior exactly.
@eden/config's loadEnv()/env-schema is still a placeholder in this
worktree, so both adapters read process.env directly using the exact
var names already reserved in the target schema; @eden/config is added
as a workspace dependency so this can be swapped for a real loadEnv()
call later without touching callers.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>