MEGAINFRA-WEBAPP/src/app/api/chat
DEls 58b625701e feat(ask): serve a real PDF from a stored assistant message
GET /api/ask/messages/[id]/pdf builds a PDF for one stored assistant
row: its structured make_pdf_report document when `parsed.pdf` is set,
otherwise its own markdown (headings/paragraphs/lists/GFM tables, with
[[chart:id]]/[[image:id]] tokens resolved against that message's own
stored charts and any referenced generated-image rows). 404s for a
missing message, a non-assistant row, or a thread owned by someone
else — same "not found, not forbidden" reasoning as the existing
thread routes, since there are no logins yet. Returns
application/pdf with Content-Disposition: attachment; filename="ask-<slug>-<date>.pdf".

The chat stream's "done" event now carries the persisted assistant
row's own id (messageId), which the browser needs to ask this route
for a PDF — see the next commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 09:16:38 +02:00
..
attachments feat(ask): read Excel, CSV, PDF, photos and text attachments 2026-09-26 18:25:45 +02:00
threads fix(ask): migrate created/updated to autodate, sort ties by id 2026-09-27 03:05:23 +02:00
route.test.ts feat(ask): serve a real PDF from a stored assistant message 2026-09-27 09:16:38 +02:00
route.ts feat(ask): serve a real PDF from a stored assistant message 2026-09-27 09:16:38 +02:00