Skip to content

Repository files navigation

Drop

Permanent file hosting for agents, built to showcase ViteHub primitives.

Website · ViteHub · ViteHub docs · ViteHub on GitHub

How it works

  1. Blob stores the original file immediately at its Drop key.
  2. PNG, JPEG, and WebP uploads continue through image optimization; other files are complete as soon as they are stored.
  3. Queue dispatches image optimization to a Cloudflare Sandbox while the original URL is already usable.
  4. Sharp applies EXIF orientation, strips metadata, and resizes images to fit within 2048 × 2048 without upscaling.
  5. Drop replaces the Blob only when the optimized image is smaller. Nitro renders the current stored-file count into the landing page.

The Sandbox is a real npm project in server/sandboxes/image-optimizer. ViteHub materializes that project through Workspace and executes it through the selected Box provider.

Use Drop

Install the public agent skill:

npx skills add https://drop.vitehub.dev

The bundled command uploads and immediately prints the file URL:

node "<skill-directory>/scripts/upload-image.mjs" "/absolute/path/to/file.pdf"

Or use the API directly:

curl --fail-with-body https://drop.vitehub.dev/api/files \
  -F "file=@/absolute/path/to/file.pdf"

Files up to 4 MiB are accepted. PNG, JPEG, and WebP files are optimized when that makes them smaller; PDFs, spreadsheets, documents, archives, and other files are stored unchanged. The public deployment limits uploads to five attempts per source address per minute.

Host it yourself

Drop targets Cloudflare automatically with the deployment name vitehub-drop:

pnpm install
pnpm build

Cloudflare Sandbox requires a Workers Paid plan. Create the R2 bucket and Queue named by .output/server/wrangler.json, then deploy that generated configuration:

pnpm exec wrangler r2 bucket create vitehub-drop
pnpm exec wrangler queues create QUEUE_NAME_FROM_WRANGLER_JSON
pnpm exec wrangler deploy --config .output/server/wrangler.json

ViteHub composes the R2, Queue, Rate Limit, Sandbox, Container, Durable Object, and migration bindings.

Run the deployed smoke test:

pnpm test:e2e:deployed

The test uploads public/og-vitehub-drop.png to the production URL and confirms the returned image is publicly accessible.

The hand mark is Twemoji via Iconify, licensed under CC BY 4.0.

Releases

Packages

Contributors

Languages