mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-17 01:04:42 +00:00
feat: add turn streaming and inspector updates
This commit is contained in:
parent
bf58891edf
commit
34d4f3693e
49 changed files with 4629 additions and 1146 deletions
|
|
@ -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 };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue