MCPcopy Create free account
hub / github.com/code-with-antonio/nightcode / ChatMessage

Function ChatMessage

packages/cli/src/screens/session.tsx:34–57  ·  view source on GitHub ↗
(
  { msg }: {
    msg: Message
  }
)

Source from the content-addressed store, hash-verified

32});
33
34function ChatMessage(
35 { msg }: {
36 msg: Message
37 }
38) {
39 if (msg.role === "user") {
40 const text = msg.parts
41 .filter((p) => p.type === "text")
42 .map((p) => p.text)
43 .join("");
44
45 return <UserMessage message={text} mode={msg.metadata?.mode ?? "BUILD"} />;
46 }
47
48 return (
49 <BotMessage
50 parts={msg.parts}
51 model={msg.metadata?.model ?? "unknown"}
52 mode={msg.metadata?.mode ?? "BUILD"}
53 durationMs={msg.metadata?.durationMs}
54 streaming={false}
55 />
56 );
57};
58
59function SessionChat({
60 session,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected