MCPcopy Create free account
hub / github.com/0xSero/open-queue / createChatPayload

Function createChatPayload

test/queue.test.mjs:44–67  ·  view source on GitHub ↗
(sessionID, messageID, text)

Source from the content-addressed store, hash-verified

42}
43
44function createChatPayload(sessionID, messageID, text) {
45 const message = {
46 id: messageID,
47 sessionID,
48 role: "user",
49 time: { created: Date.now() },
50 agent: "user",
51 model: { providerID: "test", modelID: "test" },
52 }
53 const parts = [
54 {
55 id: `${messageID}-part`,
56 sessionID,
57 messageID,
58 type: "text",
59 text,
60 },
61 ]
62
63 return {
64 input: { sessionID, messageID, agent: "user", model: { providerID: "test", modelID: "test" } },
65 output: { message, parts },
66 }
67}
68
69test("queues messages while busy and replaces UI parts", async () => {
70 const { client, promptCalls, toastCalls } = createFakeClient()

Callers 1

queue.test.mjsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected