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

Function unfence

graph-ui/src/pseudocode/refine.ts:68–78  ·  view source on GitHub ↗
(answer: string)

Source from the content-addressed store, hash-verified

66 * file quietly doing the model's job.
67 */
68export function unfence(answer: string): string {
69 const trimmed = answer.trim();
70 if (!trimmed.startsWith('```')) {
71 return trimmed;
72 }
73 const lines = trimmed.split('\n');
74 const body = lines.slice(1, lines[lines.length - 1].trim().startsWith('```')
75 ? lines.length - 1
76 : lines.length);
77 return body.join('\n').trim();
78}
79
80/**
81 * Say exactly why a rewrite was refused.

Callers 4

applyReaderRewriteFunction · 0.90
refine.test.tsFile · 0.90
refusalReasonFunction · 0.85
applyRefinementFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected