Final and largest chunk — has a backend half. Doc chat is text-only today: src/api/complete.ts builds a plain text prompt; apps/desktop/src-tauri/src/sidecar.rs api_complete passes {doc, message, history}.
Scope
- Image paste: pasting an image into the composer attaches it (thumbnail chip above the composer, removable). Send path: image persisted under the draft's dir (
.vanguard/drafts/<id>-assets/), passed to __complete as a file path, and forwarded to the agent SDK as an image content block. If the selected provider/model rejects images, surface a clear inline error before sending — never silently drop the attachment.
- Drag-and-drop: dropping a file on the composer attaches it. Images as in (1); text files (≤64KB) are inlined into the prompt as a fenced block tagged with the filename; other/binary files are rejected with an inline notice.
- File mentions: typing
@ opens an autocomplete over the project repo's tracked files (new sidecar board request that shells git ls-files in the project repo, capped + fuzzy-filtered). A selected mention inserts @path/to/file and the send path inlines that file's content (same 64KB cap) into the prompt context.
Constraints
- The CLI surface is a frozen public contract: extend the
__complete/__sidecar JSON protocols additively only.
- No credentials in the webview or events; asset files live under
.vanguard/ like drafts.
- Attachment/mention payloads bounded: total inlined content ≤ 256KB per send, error above.
Non-goals
Slash-commands (the drawer already has model selection; nothing else to command yet). Live preview.
Verification
Root pnpm lint && pnpm typecheck && pnpm test; desktop tsc --noEmit + vitest; cargo test for sidecar changes. Tests: paste-attach chip lifecycle, oversize rejection, mention autocomplete filtering, prompt assembly inlines mentioned file.
Final and largest chunk — has a backend half. Doc chat is text-only today:
src/api/complete.tsbuilds a plain text prompt;apps/desktop/src-tauri/src/sidecar.rsapi_completepasses{doc, message, history}.Scope
.vanguard/drafts/<id>-assets/), passed to__completeas a file path, and forwarded to the agent SDK as an image content block. If the selected provider/model rejects images, surface a clear inline error before sending — never silently drop the attachment.@opens an autocomplete over the project repo's tracked files (new sidecar board request that shellsgit ls-filesin the project repo, capped + fuzzy-filtered). A selected mention inserts@path/to/fileand the send path inlines that file's content (same 64KB cap) into the prompt context.Constraints
__complete/__sidecarJSON protocols additively only..vanguard/like drafts.Non-goals
Slash-commands (the drawer already has model selection; nothing else to command yet). Live preview.
Verification
Root
pnpm lint && pnpm typecheck && pnpm test; desktoptsc --noEmit+ vitest;cargo testfor sidecar changes. Tests: paste-attach chip lifecycle, oversize rejection, mention autocomplete filtering, prompt assembly inlines mentioned file.