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

Function readTraceAnswer

graph-ui/src/traces/trace-schemas.ts:125–150  ·  view source on GitHub ↗
(raw: unknown)

Source from the content-addressed store, hash-verified

123}
124
125export function readTraceAnswer(raw: unknown): TraceAnswer {
126 const record = isRecord(raw) ? raw : {};
127 const path = Array.isArray(record['path']) ? record['path'].map(readNode) : [];
128 const answer: TraceAnswer = {
129 mode: text(record['mode']),
130 reachable: record['reachable'] === true,
131 path,
132 };
133 const maxDepth = num(record['max_depth']);
134 if (maxDepth !== undefined) {
135 answer.maxDepth = maxDepth;
136 }
137 const explored = num(record['explored']);
138 if (explored !== undefined) {
139 answer.explored = explored;
140 }
141 const hops = num(record['hops']);
142 if (hops !== undefined) {
143 answer.hops = hops;
144 }
145 const error = text(record['error']);
146 if (error.length > 0) {
147 answer.error = error;
148 }
149 return answer;
150}
151
152export function readFlowSummaries(raw: unknown): FlowSummary[] {
153 const record = isRecord(raw) ? raw : {};

Callers 1

traceMethod · 0.90

Calls 3

isRecordFunction · 0.70
textFunction · 0.70
numFunction · 0.70

Tested by

no test coverage detected