import { Agent, Box } from "@upstash/box"
import { z } from "zod"
const box = await Box.create({
runtime: "node",
agent: { harness: Agent.ClaudeCode, model: "anthropic/claude-opus-4-6", apiKey: process.env.ANTHROPIC_API_KEY },
})
await box.files.upload([
{ path: "./resumes/candidate.pdf", destination: "/work/resume.pdf" },
])
const run = await box.agent.run({
prompt: "Read /work/resume.pdf. Extract the candidate's name, email, and skills.",
responseSchema: z.object({
name: z.string(),
email: z.string(),
skills: z.array(z.string()),
}),
})
console.log(run.result)
// { name: "Jane Doe", email: "jane@example.com", skills: ["TypeScript", "PostgreSQL"] }
await box.delete()