feat: add turn streaming and inspector updates

This commit is contained in:
Nathan Flurry 2026-01-27 06:18:43 -08:00
parent bf58891edf
commit 34d4f3693e
49 changed files with 4629 additions and 1146 deletions

View file

@ -164,6 +164,31 @@ describe("SandboxAgent", () => {
});
});
describe("postMessageStream", () => {
it("posts message and requests SSE", async () => {
const mockFetch = vi.fn().mockResolvedValue(
new Response("", {
status: 200,
headers: { "Content-Type": "text/event-stream" },
})
);
const client = await SandboxAgent.connect({
baseUrl: "http://localhost:8080",
fetch: mockFetch,
});
await client.postMessageStream("test-session", { message: "Hello" }, { includeRaw: true });
expect(mockFetch).toHaveBeenCalledWith(
"http://localhost:8080/v1/sessions/test-session/messages/stream?includeRaw=true",
expect.objectContaining({
method: "POST",
body: JSON.stringify({ message: "Hello" }),
})
);
});
});
describe("getEvents", () => {
it("returns events", async () => {
const events = { events: [], hasMore: false };