MCPcopy Create free account
hub / github.com/Fibi66/FeiControl / getPayloadText

Function getPayloadText

src/app/api/cron/route.ts:109–122  ·  view source on GitHub ↗
(job: JsonRecord)

Source from the content-addressed store, hash-verified

107}
108
109function getPayloadText(job: JsonRecord): string {
110 const payload = asRecord(job.payload);
111 if (!payload) return "";
112
113 if (payload.kind === "agentTurn") {
114 return readString(payload.message) || "";
115 }
116
117 if (payload.kind === "systemEvent") {
118 return readString(payload.text) || "";
119 }
120
121 return "";
122}
123
124function summarizeText(text: string): string {
125 const normalized = text.replace(/\s+/g, " ").trim();

Callers 1

GETFunction · 0.85

Calls 2

asRecordFunction · 0.85
readStringFunction · 0.85

Tested by

no test coverage detected