Skip to content

feat(upload): file upload from Mac into agent session (#146) - #148

Merged
iret77 merged 1 commit into
mainfrom
feat/issue-146-file-upload
Jul 31, 2026
Merged

feat(upload): file upload from Mac into agent session (#146)#148
iret77 merged 1 commit into
mainfrom
feat/issue-146-file-upload

Conversation

@iret77

@iret77 iret77 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Neues upload-MCP-Tool + /aiui:upload-Slash-Command: zieht eine Datei vom Mac in die Agent-Session (nativer Picker → Bytes über den :7777-Kanal, Gegenrichtung zu /media → deterministischer Write nach target_dir/<filename>). No-clobber, 512 MB-Cap, Rust- + Python-Bridge konsistent.

Build: Rust 137✓, Python 42✓. Mac-E2E offen: Picker-Foreground (LSUIElement), echter Byte-Durchlauf lokal+remote, Slash-Command-Rendering.

Closes #146


Batch-Kontext: Teil eines 6-PR-Sets (#141, #146, #23, #24, #25, #17) aus parallelen Sub-Sessions, das zusammen einen Release ergibt.

  • Kein Versions-Bump in diesem PR — die Version wird gesammelt beim Release gebumpt (keine Rapid Releases).
  • Empfohlene Merge-Reihenfolge: 2/6. Spätere PRs werden nach vorherigen Merges auf main rebased (Hotspots: mcp.rs, http.rs, skill.md, CHANGELOG.md, server.py).
  • Kein Push auf main; Merge via PR (AGENTS.md). CI baut/testet; interaktives Dialog-E2E nur am Mac verifizierbar.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Introduce the `upload` MCP tool and `/aiui:upload` slash-command — the
first aiui data flow that runs Mac → agent-host instead of the reverse.

Calling `upload` opens a native file picker on the Mac (Tauri dialog
plugin); the chosen file streams back over the existing authenticated
:7777 channel (the reverse direction of POST /media) and is written to
`target_dir/<filename>` on the host the agent runs on. Replaces the
"please scp me that file" round-trip.

- Companion: new authenticated `POST /upload` endpoint (http.rs) that
  runs the picker and returns the file bytes + percent-encoded filename
  header, with 204 (cancel), 413 (>512 MB cap), and 500 (read error)
  paths.
- Rust bridge (mcp.rs): `upload` tool + `do_upload` — resolves/validates
  target_dir, decodes the filename, sanitises to a base name, and does a
  no-clobber atomic write. Deterministic destination, never overwrites.
- Python bridge (server.py): mirror implementation for remote SSH hosts
  via uvx, incl. a progress heartbeat so the held picker call keeps the
  client alive.
- Prompt `upload` + INSTRUCTIONS trigger on both servers; docs/skill.md,
  python skill.md, and CHANGELOG updated.
- Tests: filename percent-encode round-trip (Rust) and base-name /
  target-dir / no-clobber write (Python).
@iret77
iret77 force-pushed the feat/issue-146-file-upload branch from 72d4354 to 1cd728c Compare July 31, 2026 21:27
@iret77
iret77 merged commit 7fa7fc0 into main Jul 31, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Datei-Upload vom Mac in die Agent-Session (Picker-Widget + Slash-Command)

1 participant