feat: move api cli commands under api subcommand

This commit is contained in:
Nathan Flurry 2026-01-28 01:11:57 -08:00
parent 0ef3b998bb
commit 8a91b8e9aa
22 changed files with 351 additions and 246 deletions

View file

@ -0,0 +1,28 @@
import { describe, it, expect } from "vitest";
import { buildHeaders } from "../shared/sandbox-agent-client.ts";
import { setupE2BSandboxAgent } from "./e2b.ts";
const shouldRun = Boolean(process.env.E2B_API_KEY);
const timeoutMs = Number.parseInt(process.env.SANDBOX_TEST_TIMEOUT_MS || "", 10) || 300_000;
const testFn = shouldRun ? it : it.skip;
describe("e2b example", () => {
testFn(
"starts sandbox-agent and responds to /v1/health",
async () => {
const { baseUrl, token, cleanup } = await setupE2BSandboxAgent();
try {
const response = await fetch(`${baseUrl}/v1/health`, {
headers: buildHeaders({ token }),
});
expect(response.ok).toBe(true);
const data = await response.json();
expect(data.status).toBe("ok");
} finally {
await cleanup();
}
},
timeoutMs
);
});