MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / readAgentEvent

Function readAgentEvent

graph-ui/src/agents/agent-event.ts:187–216  ·  view source on GitHub ↗
(raw: unknown)

Source from the content-addressed store, hash-verified

185 * ein Koerper auf dem Graphen, der niemandem gehoert.
186 */
187export function readAgentEvent(raw: unknown): AgentEvent | undefined {
188 if (!isRecord(raw)) {
189 return undefined;
190 }
191 const ts = numberOf(raw['ts']);
192 const agent = textOf(raw['agent']);
193 const run = textOf(raw['run']);
194 const tool = textOf(raw['tool']);
195 if (ts === undefined || agent.length === 0 || run.length === 0 || tool.length === 0) {
196 return undefined;
197 }
198 const span = readLineSpan(raw['lines']);
199 const intent = textOf(raw['intent']);
200 const recorded = numberOf(raw['ts_recorded']);
201 return {
202 ts,
203 agent,
204 run,
205 seq: numberOf(raw['seq']) ?? 0,
206 phase: raw['phase'] === 'start' ? 'start' : 'end',
207 tool,
208 path: textOf(raw['path']),
209 ...(span === undefined ? {} : { lines: span }),
210 detail: textOf(raw['detail']),
211 ...(intent.length === 0 ? {} : { intent }),
212 source: textOf(raw['source']),
213 replay: raw['replay'] === true,
214 ...(recorded === undefined ? {} : { recordedTs: recorded }),
215 };
216}
217
218/** Die Identitaet eines Ereignisses: sein Lauf und seine Nummer. */
219export function eventKey(event: AgentEvent): string {

Callers 6

eventFunction · 0.90
eventFunction · 0.90
eventFunction · 0.90
eventFunction · 0.90
connectFunction · 0.90

Calls 4

readLineSpanFunction · 0.85
isRecordFunction · 0.70
numberOfFunction · 0.70
textOfFunction · 0.70

Tested by 4

eventFunction · 0.72
eventFunction · 0.72
eventFunction · 0.72
eventFunction · 0.72