From 6e29fe607fc00d7f04c4bd0472e71a325575387f Mon Sep 17 00:00:00 2001 From: Ben Davis <45952064+bmdavis419@users.noreply.github.com> Date: Mon, 27 Jul 2026 15:34:56 -0700 Subject: [PATCH] =?UTF-8?q?docs:=20plan=20Hermes=20media=20support=20?= =?UTF-8?q?=E2=80=94=20send=20and=20render=20files=20both=20directions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Finalized after a product interview: outbound-first, inline base64 on a protocol v4 lockstep bump (matching the v2->v3 precedent), media as standalone assistant messages with optional captions, no mime allowlist with an SVG inline-render guard, proactive turnless delivery into Home with full NotificationHeader provenance, and native rendering for images/video/PDF with download cards for the rest. Reuses the existing attachment store, asset-token serving, and message-attachment plumbing end to end; chunking, transcoding, thumbnails, and CDN are explicitly out of scope. Co-Authored-By: Claude Fable 5 --- docs/project/hermes-media-plan.md | 160 ++++++++++++++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 docs/project/hermes-media-plan.md 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 `