render_draft (scripts/email_modes.py)

hermes-agent · optional-skills/security/unbroker/scripts/email_modes.py · python · MIT
email

Helpers to render opt‑out email drafts and extract verification links.

# Source: https://github.com/NousResearch/hermes-agent | License: MIT | Copyright 2025 Nous Research
# Provided via justclaw.it.com; keep this notice with the code.
"""Email modes A/B/C helpers + anti-phishing verification-link extraction.

Mode A (default): render a ready-to-send draft to disk; the operator sends it.
Mode B/C: the agent SENDS via a Hermes email mechanism (IMAP/SMTP gateway,
`himalaya`, AgentMail, or Gmail via `google-workspace`) and READS the reply to
resolve the verification link with `extract_verification_link`. Those transports
are driven by the agent through native tools; this module stays network-free so
the hermetic tests pass.
"""
from __future__ import annotations

import re
from pathlib import Path

import legal
import paths

_LINK_RE = re.compile(r"https?://[^\s

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key