Skip to content

feat: upload images/PDFs for \includegraphics - #3

Merged
lonetis merged 1 commit into
lonetis:mainfrom
Darrow8:feat/upload-images
Oct 20, 2026
Merged

lonetis merged 1 commit into
lonetis:mainfrom
Darrow8:feat/upload-images

Conversation

@Darrow8

@Darrow8 Darrow8 commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds uploadFile (REST → ProjectSession → OverleafClient) using Overleaf's POST /project/<id>/upload?folder_id=… multipart endpoint.
  • New CLI command: claudeleaf upload <project> <localFile> [--folder DIR] [--name NAME].
  • New MCP tool overleaf_upload_file (local path, or base64 + name; non-destructive annotations).
  • Accepts png/jpg/gif/svg/pdf/eps up to 50 MB; a same-named file in the folder is replaced.
  • RestClient.request now supports FormData bodies (no manual Content-Type, so fetch sets the boundary).
  • Docs: CLAUDE.md and README.md updated.

Test plan

  • npx tsc --noEmit / npm run build
  • Unit tests: bytes + local-file upload, replace behavior, validation (type, empty, missing/invalid name)
  • Live integration test (auto-skips without a session): upload, re-upload replaces, delete
  • Manually uploaded a PNG to a real project and confirmed it via a fresh ls --all
  • Note: integration > surfaces LaTeX errors with line numbers already fails on main without this change (live compile test); unrelated.

🤖 Generated with Claude Code

Add uploadFile to RestClient/ProjectSession/OverleafClient, a `claudeleaf
upload` CLI command and an `overleaf_upload_file` MCP tool (local path or
base64). Allows png/jpg/gif/svg/pdf/eps up to 50 MB; a same-named file in
the folder is replaced.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
lonetis added a commit that referenced this pull request Oct 20, 2026
…ning

Land #3 (upload images/PDFs) on top of #1, with an upload hardening fix
@lonetis
lonetis merged commit 6c41150 into lonetis:main Oct 20, 2026
lonetis pushed a commit that referenced this pull request Oct 20, 2026
Releases 0.3.0, which ships the three contributions merged above:

- self-hosted Overleaf session cookies (#2, @bartoszn)
- review-mode track changes and comments (#1, @BerkIGuler)
- uploading images/PDFs for \includegraphics (#3, @Darrow8)

and revamps how the package is published. The Publish workflow now
releases each new version to two registries, each only when it does not
have that version yet:

- npm (`claudeleaf`) via npm trusted publishing (OIDC) instead of a
  long-lived NPM_TOKEN secret, with a provenance attestation. Runs on Node
  24, whose npm (>= 11.5.1) supports trusted publishing.
- GitHub Packages (`@lonetis/claudeleaf`), the same build under the owner
  scope GitHub Packages requires, published with GITHUB_TOKEN so the
  package and its versions show on the repo page.

package.json gains the `repository` field that provenance and the GitHub
Packages link both need, and the exported `version` constant and the MCP
server's reported version now match package.json. CLAUDE.md documents the
new publishing setup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XnPdQXFWDT6FTnQs1d1f1
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.

2 participants