Files
loki/src
Mao NakamotoandClaude Opus 4.8 fb631901ae feat(loki): composer file attach — fold text files into the dispatch (P2.3)
Completes the P2.3 composer affordances. A paperclip button stages text files
(read client-side via FileReader); their content is appended to the prompt the
agent receives AFTER command resolution, so the resolver still classifies on the
user's words, not the file body. No upload, no storage, no binary handling —
the simplest correct transport.

- @/lib/loki/attachments: SSOT for limits (5 files, 100k chars) + prompt render
- messages route: validate + append attachment bodies to dispatch/chat prompt;
  filenames noted on the stored user turn (bodies stay out of the bubble)
- Composer: paperclip + staged-file chips with remove; oversized files skipped
  with a note; ui-loki-attach-chip in globals.css

Loki composer now has the full set: mic, model picker, file attach. P2 complete.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 16:15:07 +02:00
..