Attachment sending #11

Open
opened 2026-08-01 22:10:58 -04:00 by lyssieth · 0 comments
Owner

Send attachments from the composer. Attachment / AttachmentKind / AttachmentPayload exist in sermones-core (src/llm/attachment.rs, re-exported from llm/mod.rs:9) and Block::Attachment(Attachment) is a message-block variant (src/llm/message.rs:84) — but nothing constructs one, moves one across IPC, or maps one into a provider request. The blocker (#8, composer) has landed.

Status: not started. Every piece below is still a placeholder; this issue is the work that turns them real.

What exists today

  • Domain typescrates/sermones-core/src/llm/attachment.rs (AttachmentKind, AttachmentPayload, Attachment) and the Block::Attachment variant. No producer: grep finds only the definition, the re-export, and the is_attachment predicate.
  • Composer affordance, visual only — the paperclip button at frontend/src/lib/Composer.svelte:150-152 is title="Attach a file (issue #11)" with no handler; the file-quote at :39 says outright that the attach button and the drag/drop/paste targets are affordances only.
  • Receiving-side renderer, orphanedfrontend/src/lib/AttachmentView.svelte renders an Attachment, but nothing imports it; its own header says "Nothing produces attachments yet (#11)". Its types come from the hand-written frontend/src/lib/attachments.ts, which is marked SPECULATIVE and is to be deleted once this issue registers the real types and codegen emits them (the file explains why registering AttachmentPayload today produces a schema TypeBox rejects — payload-carrying enums at the pinned facet revision).
  • No IPC surfaceAttachment appears nowhere in crates/sermones-core/src/ipc.rs or IPC_TYPES, and AppendUserMessageParams (ipc.rs:118) carries text only.

Checklist

  • Composer attachment affordance wired: file picker, paste, drag-and-drop (button exists at Composer.svelte:150, handler does not)
  • IPC types + bridge slot for sending messages with attachment payloads — extend AppendUserMessageParams, register the attachment types in IPC_TYPES, codegen artefacts follow. Check the payload-enum schema problem noted in attachments.ts before registering AttachmentPayload.
  • Provider request mapping: image vs file payloads into the OpenAI-compatible chat-completions schema. RequestMessage is { role: String, content: String } (crates/sermones-runtime/src/providers/llama.rs:201-205) — a flat string, not the content-part array multimodal requests need. This item means changing that type (and context_messages, which builds them) to a content-parts shape, keeping the plain-string encoding for text-only messages so existing providers are unaffected.
  • Size/kind limits with typed errors surfacing via the error store (#4, landed)
  • Outbound attachment preview in the composer and in the sent message — wire AttachmentView.svelte into MessageView, and delete attachments.ts in favour of generated/types.ts

Refs

  • crates/sermones-core/src/llm/attachment.rs — existing domain types
  • crates/sermones-core/src/llm/message.rs:84Block::Attachment
  • crates/sermones-runtime/src/providers/llama.rs:201-205RequestMessage, the flat-string wire shape to widen
  • frontend/src/lib/Composer.svelte:39,150-152 — the placeholder affordance
  • frontend/src/lib/attachments.ts — speculative hand-written types (delete on landing)
  • docs/architecture/ipc-pipeline.md — adding IPC types
  • #8 — composer (landed, closed)
  • #1 — attachment rendering (receiving side; landed, closed)
Send attachments from the composer. `Attachment` / `AttachmentKind` / `AttachmentPayload` exist in `sermones-core` (`src/llm/attachment.rs`, re-exported from `llm/mod.rs:9`) and `Block::Attachment(Attachment)` is a message-block variant (`src/llm/message.rs:84`) — but nothing constructs one, moves one across IPC, or maps one into a provider request. The blocker (#8, composer) has landed. **Status:** not started. Every piece below is still a placeholder; this issue is the work that turns them real. ## What exists today - **Domain types** — `crates/sermones-core/src/llm/attachment.rs` (`AttachmentKind`, `AttachmentPayload`, `Attachment`) and the `Block::Attachment` variant. No producer: `grep` finds only the definition, the re-export, and the `is_attachment` predicate. - **Composer affordance, visual only** — the paperclip button at `frontend/src/lib/Composer.svelte:150-152` is `title="Attach a file (issue #11)"` with no handler; the file-quote at `:39` says outright that the attach button and the drag/drop/paste targets are affordances only. - **Receiving-side renderer, orphaned** — `frontend/src/lib/AttachmentView.svelte` renders an `Attachment`, but nothing imports it; its own header says "Nothing produces attachments yet (#11)". Its types come from the hand-written `frontend/src/lib/attachments.ts`, which is marked SPECULATIVE and is to be **deleted** once this issue registers the real types and codegen emits them (the file explains why registering `AttachmentPayload` today produces a schema TypeBox rejects — payload-carrying enums at the pinned facet revision). - **No IPC surface** — `Attachment` appears nowhere in `crates/sermones-core/src/ipc.rs` or `IPC_TYPES`, and `AppendUserMessageParams` (`ipc.rs:118`) carries text only. ## Checklist - [ ] Composer attachment affordance wired: file picker, paste, drag-and-drop (button exists at `Composer.svelte:150`, handler does not) - [ ] IPC types + bridge slot for sending messages with attachment payloads — extend `AppendUserMessageParams`, register the attachment types in `IPC_TYPES`, codegen artefacts follow. Check the payload-enum schema problem noted in `attachments.ts` before registering `AttachmentPayload`. - [ ] Provider request mapping: image vs file payloads into the OpenAI-compatible chat-completions schema. **`RequestMessage` is `{ role: String, content: String }`** (`crates/sermones-runtime/src/providers/llama.rs:201-205`) — a flat string, not the content-part array multimodal requests need. This item means changing that type (and `context_messages`, which builds them) to a content-parts shape, keeping the plain-string encoding for text-only messages so existing providers are unaffected. - [ ] Size/kind limits with typed errors surfacing via the error store (#4, landed) - [ ] Outbound attachment preview in the composer and in the sent message — wire `AttachmentView.svelte` into `MessageView`, and delete `attachments.ts` in favour of `generated/types.ts` ## Refs - `crates/sermones-core/src/llm/attachment.rs` — existing domain types - `crates/sermones-core/src/llm/message.rs:84` — `Block::Attachment` - `crates/sermones-runtime/src/providers/llama.rs:201-205` — `RequestMessage`, the flat-string wire shape to widen - `frontend/src/lib/Composer.svelte:39,150-152` — the placeholder affordance - `frontend/src/lib/attachments.ts` — speculative hand-written types (delete on landing) - `docs/architecture/ipc-pipeline.md` — adding IPC types - ~~#8~~ — composer (landed, closed) - ~~#1~~ — attachment rendering (receiving side; landed, closed)
lyssieth added this to the v1 milestone 2026-08-01 22:12:25 -04:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
lyssieth/sermones#11
No description provided.