my harness for niri
1import type { UserMessage } from "../types.js"
2
3export function fromChat(body: unknown): UserMessage {
4 const b = body as Record<string, unknown>
5 return {
6 source: "chat",
7 triggeredAt: new Date().toISOString(),
8 content: String(b.content ?? ""),
9 raw: body,
10 clientId: typeof b.clientId === "string" ? b.clientId : undefined,
11 }
12}