@hanfani/integrations
v0.1.0
Published
External-service integrations (Gmail) for the Hanfani agent framework.
Downloads
23
Maintainers
Readme
@hanfani/integrations
External-service integrations for the Hanfani agent
framework. Each integration is a set of pure, importable effects: read tools return a
ReadResult, mutations return a BatchActionResult or { ok, ... }, and a checkCredentials
health probe reports whether a usable credential reaches the integration. No fs, no
process.env — the framework resolves and injects the credential via deps.credential.
Install
pnpm add @hanfani/integrations @hanfani/coregoogleapis is an optional peer — lazily imported only when a Gmail client is actually built, so
importing the effects never pulls it in.
Gmail
Each function is its own subpath so an app pulls in only what it uses.
| Import | Signature | Kind |
|--------|-----------|------|
| @hanfani/integrations/gmail/list-unread | listUnread({ sinceHours? }, deps) → ReadResult<{ emails }> | read |
| @hanfani/integrations/gmail/get-email | getEmail({ messageId }, deps) → ReadResult<ParsedEmail> | read |
| @hanfani/integrations/gmail/get-latest-email | getLatestEmail(args, deps) → ReadResult<ParsedEmail> | read |
| @hanfani/integrations/gmail/create-draft | createDraft({ threadId, body }, deps) → { ok, draftId } \| { error } | mutation |
| @hanfani/integrations/gmail/modify | markRead \| trash \| star({ messageIds }, deps) → BatchActionResult | mutation |
| @hanfani/integrations/gmail/check-credentials | checkCredentials(deps) → HealthCheck | health |
| @hanfani/integrations/gmail/auth | auth — the Gmail AuthSpec | oauth |
import { listUnread } from '@hanfani/integrations/gmail/list-unread'
import { createDraft } from '@hanfani/integrations/gmail/create-draft'A Gmail skill for agents ships under skills/gmail.
