diff --git a/AGENTS.md b/AGENTS.md index 23824bb..8ff776d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -65,6 +65,19 @@ repo is in PLAN.md's "Backend layout" section. refuse to resume onto a partial from a different revision, and are checked against HuggingFace's published sha256 before the file gets its real name. +- **Attachments** are one list on a user message (`attachments`, the + ref the files route serves), in two shapes. An image is `.` + and goes to the model as an image block. Anything else is + `-` -- the name it was shared or picked under, cleaned by + `safe_file_name` -- and the Claude driver appends `Attached file: + /abs/path` to the message text, since the CLI reads files by path and + a model cannot be shown a trace. `media::media_type_for` on the server + and `isImageRef` on the phone tell the two apart; keep those lists + level. The phone attaches from the photo picker, the file chooser and + Android's share sheet (`Share.kt`; the manifest's SEND filter), all + through one `attach` path in `SessionScreen`. Files exist only on the + server's machine -- see PLAN.md's "Transport" for what that means for + remote sessions. - `server/` — Rust backend (`ai-server`). `main.rs` bootstraps (TLS, the auth layer, token/QR enrollment, wg0 binding), `routes.rs` has the HTTP table in its module doc comment, `auth.rs` the bearer-token middleware, diff --git a/PLAN.md b/PLAN.md index bbb68ca..2ded77a 100644 --- a/PLAN.md +++ b/PLAN.md @@ -713,11 +713,18 @@ host) and **hosts**. The manager runs at most one llama-server per forwarded port (`ssh -L`) as well as a spawned process. A transport is therefore "run this" plus "reach this port", and the second operation is a no-op locally. -- Attachments need no file transfer, contrary to what this section said +- Images need no file transfer, contrary to what this section said before: `attachment_block` base64s an uploaded image into the stream-json message itself, and produced images come back the same way for the translator to write out locally. Nothing has to exist on the remote filesystem, so there is no `scp` step to get wrong. +- **Any other file is told to the session by path** (2026-09-03: a trace, + a log, a zip -- things a model cannot be shown and the CLI can read). + The upload stays under the session's `attachments/` and the message + ends with `Attached file: /abs/path`. That directory exists only on the + machine running this server, so a file attached to a remote (ssh) + session names a path that is not there. Shipping it is not built; the + one host in use runs its sessions locally. Images are unaffected. ### Usage limits (Claude) @@ -1094,9 +1101,11 @@ window just fills. with port forward, attachment shipping. *Host config and remote spawn done 2026-08-25* (any session of any provider can name a host; the command is the identical one wrapped in `ssh -T`, with every argument - shell-quoted). Attachment shipping turned out to be unnecessary for the - Claude driver — images ride the stdio JSONL as base64 in both - directions, so nothing needs `scp`. Still outstanding: remote + shell-quoted). Attachment shipping turned out to be unnecessary for + images — they ride the stdio JSONL as base64 in both directions, so + nothing needs `scp` — and became necessary again on 2026-09-03 for + files, which are attached by path (see "Transport" above). Still + outstanding: file shipping for remote sessions, and remote llama-server with its port forward, which comes with phase 4. Two things learned doing it: a remote session inherits ssh's non-login PATH, which is narrower than an interactive shell's (point `command` at diff --git a/app/androidApp/src/main/AndroidManifest.xml b/app/androidApp/src/main/AndroidManifest.xml index ec5afd0..2958fb5 100644 --- a/app/androidApp/src/main/AndroidManifest.xml +++ b/app/androidApp/src/main/AndroidManifest.xml @@ -61,6 +61,16 @@ + + + + + + +