diff --git a/docs/project/hermes-media-plan.md b/docs/project/hermes-media-plan.md new file mode 100644 index 0000000000..69ac3f4d55 --- /dev/null +++ b/docs/project/hermes-media-plan.md @@ -0,0 +1,160 @@ +# Hermes Media Support — Implementation Plan + +Send images, videos, PDFs, and arbitrary files to the Hermes agent through T3 +Code, and render media the agent sends back natively in the web UI. Guiding +principle: the smallest coherent design — reuse the existing attachment store, +asset-token pipeline, and message-attachment plumbing built for images. No new +storage system, no transcoding, no thumbnails, no chunking, no CDN. + +Decisions below were settled in a product interview (2026-07-27); they are +recorded as **Decision:** lines rather than open questions. + +## What already exists (verified) + +- **Inbound image pipeline, end to end:** composer paste/drag → + `readFileAsDataUrl` base64 → `thread.turn.start` `message.attachments` → + `Normalizer.ts` decodes/validates and writes to + `/attachments/` (`attachmentStore.ts`) → message rows + persist `attachments_json` → signed 1-hour asset URLs + (`assets/AssetAccess.ts`, `/api/assets//`) → web resolves via + `useAssetUrls`. `ChatView.tsx` already resolves attachment ids for **all** + message roles. +- **Hermes gateway protocol v3** (`packages/contracts/src/hermesGateway.ts`): + strict lockstep version check in `HermesGatewayBroker`; turn input is + text-only; `home.deliver` (text ≤ 120k) with durable-write-then-ack; + capabilities currently pin `attachments: false`. +- **`HermesAdapter.sendTurn` hard-rejects attachments** (line ~729). +- **Rendering:** user rows show image grids from `message.attachments`; + assistant rows render markdown only. No `