// Long-running service (optional public URL via `port`)
const svc = await naive.compute.create({
name: "bot",
type: "service",
image: "ghcr.io/me/bot:latest",
port: 8080,
});
// Run-to-completion job + cron-for-code schedule
await naive.compute.create({ name: "ingest", type: "job", image: "me/etl:latest", command: ["python", "ingest.py"] });
await naive.compute.create({ name: "nightly", type: "schedule", image: "me/etl:latest", schedule_expr: "cron(0 9 * * ? *)" });
await naive.compute.list();
await naive.compute.get(svc.id);
await naive.compute.run(jobId); // trigger a job/schedule now
await naive.compute.runs(jobId);
await naive.compute.logs(id, { limit: 200 });
await naive.compute.start(svc.id); // wake a scaled-to-zero service
await naive.compute.stop(svc.id); // scale to zero (stops billing)
await naive.compute.scale(svc.id, 3);
// Encrypted env vars (auto-redeploys the workload)
await naive.compute.setSecret(id, "OPENAI_API_KEY", "sk-...");
await naive.compute.listSecrets(id);
// One-off command, or an interactive shell session (ECS Exec / SSM)
await naive.compute.exec(id, "ls -la");
const session = await naive.compute.shell(id); // { sessionId, streamUrl, tokenValue }
await naive.compute.destroy(id);