integrate-agent-email

Integrates the @amd-gaia/agent-email npm package into Node, TypeScript, or Electron applications.

1.6k|168|Updated Dec 16, 2024
One-click install
npx skills add https://github.com/amd/gaia --skill integrate-agent-email-amd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: integrate-agent-email
Source: https://github.com/amd/gaia/tree/main/hub/agents/email/npm
Command: npx skills add https://github.com/amd/gaia --skill integrate-agent-email-amd

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @amd-gaia/agent-email.

What problem does it solve? Embedding a local email triage, drafting, and sending agent into a JavaScript or TypeScript app involves many failure-prone details: fetching and verifying the sidecar binary, spawning it with a session token, handling SSE event streams, and avoiding common integration mistakes like CORS blocks or missing auth tokens. This Skill provides a step-by-step playbook that gets the integration right the first time. ## Core Features & Use Cases - Sidecar Lifecycle Management: Download and SHA-256-verify the platform binary with fetchBinary, spawn it with startSidecar, and rely on automatic cleanup on process exit. - Typed Client Calls: Triage single messages or batches, search and prescan a connected Gmail/Outlook mailbox, draft and send with confirmation tokens, archive/quarantine with undo, and manage calendar events. - Streaming Agent Loop: Drive natural-language requests through query() with typed SSE events (status, tool_call, needs_input, final), mid-run user questions, and cancellation via cancelQuery. - Use Case: An Electron mail client spawns the sidecar in its main process, forwards the session token to the renderer over IPC, and lets users ask "find today's urgent mail and archive the promotions" with streamed progress. ## Quick Start Ask the assistant to integrate the @amd-gaia/agent-email package into your Node or Electron app, starting with fetchBinary and startSidecar and ending with a working triage call.

Frequently Asked Questions about integrate-agent-email

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate the GAIA email agent into a Node.js app?

Install @amd-gaia/agent-email, call fetchBinary once to download and verify the sidecar binary, then startSidecar to spawn it and get a typed client. Use sidecar.client.triage, draft, and send for email operations, and shutdown for a graceful stop.

How do I use @amd-gaia/agent-email in an Electron renderer?

The sidecar serves same-origin only with no CORS, so a renderer cannot fetch it directly. Spawn the sidecar in the Electron main process and expose triage or draft to the renderer over your own IPC, forwarding the session authToken.

Why does triage return HTTP 502 with the email sidecar?

A 502 from triage means the local Lemonade Server is not running or the model is not pulled, not a bug in the package. Run gaia init to install Lemonade and download the default model, then verify readiness with client.init().

Does @amd-gaia/agent-email work in CommonJS projects?

The package is ESM-only, so require() fails. Use a static import in ESM code or await import("@amd-gaia/agent-email") from a CommonJS file.

Why do my direct fetch calls to the sidecar return 401?

Every /v1/email/* request requires the per-session bearer token minted at spawn. The built-in sidecar.client attaches it automatically; a hand-built client must pass authToken from sidecar.authToken or every call returns 401.

Can the email agent permanently delete messages?

No. Permanent deletion requires a Gmail scope GAIA deliberately never requests, so the agent only moves mail to Trash, which stays recoverable. Archive and quarantine actions are also reversible within a 30-second undo window.