MCPcopy Create free account
hub / github.com/FIND-Lab/AgentWard / asMessage

Function asMessage

layers/decision-alignment.ts:30–37  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

28}
29
30function asMessage(value: unknown): Record<string, unknown> | null {
31 if (!value || typeof value !== "object") return null;
32 if ("role" in value) return value as Record<string, unknown>;
33 if ("message" in value && value.message && typeof value.message === "object") {
34 return value.message as Record<string, unknown>;
35 }
36 return null;
37}
38
39function summarizeMessage(message: Record<string, unknown>): string {
40 const role = typeof message.role === "string" ? message.role : "unknown";

Callers 1

buildJudgeInputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected