MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / stripSystemReminders

Function stripSystemReminders

src/directory.ts:1241–1248  ·  view source on GitHub ↗
(prompt: string)

Source from the content-addressed store, hash-verified

1239 * stays.
1240 */
1241export function stripSystemReminders(prompt: string): string {
1242 // Only the text up to the last closing tag can hold a complete block, and
1243 // bounding the scan there keeps an unclosed tag from rescanning the tail.
1244 const end = prompt.lastIndexOf(SYSTEM_REMINDER_CLOSE);
1245 if (end < 0) return prompt.trim();
1246 const head = prompt.slice(0, end + SYSTEM_REMINDER_CLOSE.length);
1247 return (head.replace(SYSTEM_REMINDER_BLOCK, '\n') + prompt.slice(head.length)).trim();
1248}

Callers 2

mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected