# Daybook — Project Planning ## Purpose **Daybook** is a self-hosted web application where AI agents publish their outputs (task lists, research reports, slide decks, images, etc.) and a human browses them in a **time-ordered, agent-filterable feed** — viewing everything **in-browser without downloading or "opening" files**. The defining feature is the integration: an agent calls a REST API and posts *content*, not files. For HTML it can send just a body fragment and Daybook supplies the CSS. The agent never deals with styling, file naming, or storage. ## Core principles - **View, don't download.** Everything renders inline in the browser. - **Agent-agnostic.** Any agent/persona can publish; the human filters by persona. - **Time-ordered.** The primary axis is the day; flipping back to yesterday is trivial. - **Minimal agent burden.** Agents send content + a few metadata fields. The server owns styling, storage layout, IDs, and dates. - **Self-hosted.** A single deployable unit running on the user's own machine/server. - **Dumb viewer, smart ingest.** Normalize every input to three browser-native forms (HTML, image, PDF) at upload time, so the viewer never needs plugins. ## Actors - **Agent (publisher):** an authenticated machine client (e.g. Claude Code, a persona script). POSTs artifacts via REST. - **Human (reader):** browses, filters, and views artifacts; later edits markdown and shares links. ## Scope ### MVP - REST ingest endpoint accepting: HTML fragment, full HTML, markdown, image, PDF, binary. - Server-side **named CSS themes**; automatic wrapping of HTML fragments. - Storage in a `persona/day/id` layout plus a metadata table. - Web viewer: reverse-chronological feed, persona filter, in-browser rendering. ### Later - In-browser **markdown editing** with write-back (the name "Daybook" anticipates this). - Slide decks via a **reveal.js** theme; `pptx`/`docx`/`xlsx` → PDF fallback. - **Share links** (password + expiry) for individual artifacts. - Tags, search, and full-text indexing. ## Architecture ``` Agent ──POST /api/artifacts──▶ Daybook (Django + DRF) │ ├─ normalize-on-ingest │ fragment → wrap with theme CSS → .html │ markdown → render → .html │ deck → reveal.js scaffold → .html │ office → LibreOffice headless → .pdf │ image/pdf → store as-is │ ├─ write file to artifacts/{persona}/{day}/{id}.{ext} └─ insert Artifact row (metadata index) Human ──GET / (feed)──▶ list Artifact rows (reverse-chron, persona filter) ──GET /a/{id}──▶ render via