MCPcopy
hub / github.com/coder/mux / getMessageText

Function getMessageText

tests/ui/chat/forkFromResponse.test.ts:20–28  ·  view source on GitHub ↗
(messages: Array<{ parts: MuxMessage["parts"] }>)

Source from the content-addressed store, hash-verified

18}
19
20function getMessageText(messages: Array<{ parts: MuxMessage["parts"] }>): string {
21 return messages
22 .flatMap((message) =>
23 message.parts
24 .filter((part) => part.type === "text")
25 .map((part) => (part.type === "text" ? part.text : ""))
26 )
27 .join("\n");
28}
29
30describe("Fork from assistant response (mock AI router)", () => {
31 beforeAll(async () => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected