Retention: 7d only for explicitly temporary/throwaway artifacts; 1y default, including PR artifacts and demos; keep only after asking the user and passing --confirm-keep.
Never upload directories, secrets, private data, or unrequested files; prefer self-contained HTML.
Node's standard library is sufficient; no Wrangler, npm package, or global tool is needed.
Require GATEBRIDGE_R2_ACCESS_KEY_ID, GATEBRIDGE_R2_SECRET_ACCESS_KEY, and GATEBRIDGE_R2_ENDPOINT; credentials need write access to bucket agent-artifacts; never print values.
On success, print only the returned public URL; uploads above 315 MiB are rejected.
Missing Node: instruct the user to install Node.js with the host package manager, then stop.
Missing credentials: instruct the user to configure each missing bucket-scoped credential or endpoint, then stop; do not install or configure them.
---
name: file-upload
env:
all: [GATEBRIDGE_R2_ACCESS_KEY_ID, GATEBRIDGE_R2_SECRET_ACCESS_KEY, GATEBRIDGE_R2_ENDPOINT]
description: "Upload/share human artifacts (HTML/spec/review/mockup/video/screenshot/PDF/audio/asciinema). Only on explicit upload/publish/share request."
---
# File upload
- Public uploads go to `https://gatebridge.link` from Cloudflare R2 bucket `agent-artifacts`.
- Use only this helper; never create another prefix or upload through another client:
```sh
node scripts/upload.mjs <file> [7d|1y|keep] [--confirm-keep]
```
- Retention: `7d` only for explicitly temporary/throwaway artifacts; `1y` default, including PR artifacts and demos; `keep` only after asking the user and passing `--confirm-keep`.
- Never upload directories, secrets, private data, or unrequested files; prefer self-contained HTML.
- Node's standard library is sufficient; no Wrangler, npm package, or global tool is needed.
- Require `GATEBRIDGE_R2_ACCESS_KEY_ID`, `GATEBRIDGE_R2_SECRET_ACCESS_KEY`, and `GATEBRIDGE_R2_ENDPOINT`; credentials need write access to bucket `agent-artifacts`; never print values.
- On success, print only the returned public URL; uploads above 315 MiB are rejected.
- Missing Node: instruct the user to install Node.js with the host package manager, then stop.
- Missing credentials: instruct the user to configure each missing bucket-scoped credential or endpoint, then stop; do not install or configure them.