mirror of
https://github.com/kennethnym/freya
synced 2026-07-06 07:51:13 +01:00
feat: add agent websocket endpoint (#142)
This commit is contained in:
20
packages/freya-agent-protocol/src/index.test.ts
Normal file
20
packages/freya-agent-protocol/src/index.test.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { describe, expect, test } from "bun:test"
|
||||
|
||||
import type { AgentEvent, AgentServerApi } from "./index"
|
||||
|
||||
describe("agent protocol", () => {
|
||||
test("defines server methods and agent events", () => {
|
||||
const server: AgentServerApi = {
|
||||
async sendMessage(message) {
|
||||
return { message, conversationId: "conversation-1" }
|
||||
},
|
||||
ping() {
|
||||
return "pong"
|
||||
},
|
||||
}
|
||||
const event: AgentEvent = { type: "message_finished" }
|
||||
|
||||
expect(server.ping()).toBe("pong")
|
||||
expect(event.type).toBe("message_finished")
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user