Skip to content

feat: add agent-pdf skill and API#26

Merged
bendersej merged 42 commits intomainfrom
agent-pdf
Mar 19, 2026
Merged

feat: add agent-pdf skill and API#26
bendersej merged 42 commits intomainfrom
agent-pdf

Conversation

@bendersej
Copy link
Member

@bendersej bendersej commented Mar 19, 2026

Background

Add agent-pdf/ - a lightweight Rust microservice that lets AI agents edit and fill PDFs through SimplePDF. Hosted at agent.simplepdf.com.

Changes

  • Add Rust API service (GET /?url= for URL passthrough, POST / for file upload and JSON URL)
  • GET / without params serves SKILL.md as text/markdown for agent discovery
  • ?companyIdentifier routes to custom SimplePDF portals
  • Default editor host: ai.simplepdf.com
  • S3-compatible storage for file uploads (1hr expiry)
  • Proxy-aware rate limiting with bounded bucket eviction
  • Input validation (subdomain pattern, URL scheme) and HTML escaping in snippets
  • Dockerfile for DO App Platform deployment
  • GitHub Actions CI workflow (fmt, clippy, build)

Notes

Companion PR on simple-pdf: https://github.com/SimplePDF/simple-pdf/pull/157 (plan + submodule ref)

- Remove fetch_pdf / reqwest (URL passthrough instead of re-upload)
- Fix ConnectInfo extraction (into_make_service_with_connect_info)
- Remove dead cleanup method from RateLimiter
- Add Content-Disposition: attachment to S3 uploads
- Remove unused aws-config and reqwest dependencies
- Pin all dependencies to latest versions
- Extract AgentResponse::new to deduplicate response building
- Bump JSON body limit from 64KB to 1MB
…point

- GET / serves SKILL.md as text/markdown for agent discovery
- POST /agents accepts ?companyIdentifier to route to custom portals
- Default editor: embed.simplepdf.com, with identifier: <id>.simplepdf.com
- Rename SIMPLEPDF_URL env to DEFAULT_EDITOR_HOST
- Enable axum multipart feature (required for Multipart extractor)
- Make rate limiter proxy-aware via X-Forwarded-For header
- URL-encode the open parameter to handle signed URLs correctly
- Fix react snippet to use EmbedPDF with documentURL prop
- Enable axum multipart feature (build fix)
- Fix tracing_subscriber::fmt::init() (build fix)
- Proxy-aware rate limiting with TRUST_PROXY env + bounded bucket eviction
- Validate companyIdentifier (subdomain pattern) and url (http/https only)
- HTML-escape all values in iframe/react snippets
- Include companyIdentifier in react snippet when present
- Correct privacy statement: file uploads stored temporarily (1hr)
- URL case is now GET /?url=... (no POST needed for URL passthrough)
- POST / reserved for file uploads only
- Rename agents.simplepdf.com -> agent.simplepdf.com
- Add Cargo.lock for reproducible builds
- Add .gitignore for target/
- Add GitHub Actions workflow (fmt, clippy, build)
Paketo Rust buildpack does not find Cargo.toml with source_dir.
Dockerfile gives full control over the build.
… hosts

- POST with JSON body for signed/sensitive URLs (keeps them out of logs)
- Default TRUST_PROXY to false, explicitly enable in production
- Use rightmost X-Forwarded-For hop instead of leftmost
- Remove agent.simplepdf.com from response example (implementation detail)
- Document GET vs POST URL choice in SKILL.md
- Add TRUST_PROXY to app.yaml reference config
- DEFAULT_EDITOR_HOST now ai.simplepdf.com (was embed.simplepdf.com)
- React snippet always includes companyIdentifier ("ai" as default)
- All response fields (url, iframe, react) point to same host
@bendersej bendersej changed the title Agent pdf feat: add agent-pdf skill and API Mar 19, 2026
@bendersej bendersej marked this pull request as ready for review March 19, 2026 16:26
- Upload without public-read ACL (private by default)
- Generate 24h presigned GET URL after upload
- Remove S3_PUBLIC_URL env var (no longer needed)
…/ URLs

- Replace TRUST_PROXY bool with TRUSTED_IP_HEADER string (set to
  do-connecting-ip for DO App Platform, empty to disable)
- Only accept https:// URLs (http:// causes mixed-content in the editor)
@bendersej bendersej merged commit 62e668f into main Mar 19, 2026
1 check passed
@bendersej bendersej deleted the agent-pdf branch March 19, 2026 17:23
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.

1 participant