← Public packages
@kentcdodds/agent-files
Mint short-lived R2 PUT URLs for agent file handoffs; public download via managed r2.dev.
src/get.ts
17 lines · 631 B · TypeScriptimport { getFile } from './lib/files.ts'
import type { GetInput } from './lib/files.ts'
/**
* Look up an agent-files object by storage key.
* Use after createUpload/upload when you need size/contentType or to confirm the object exists.
*
* @param input - `{ key }` from createUpload / upload
* @returns `{ found, key, downloadUrl, size?, contentType?, ... }` — `found: false` when missing
*
* @example
* import get from 'kody:@kentcdodds/agent-files/get'
* const meta = await get({ key: 'handoff/2026-09-22/a1b2c3d4-report.png' })
*/
export default async function getExport(input: GetInput) {
return getFile(input)
}