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

Function stripSystemReminders

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

Source from the content-addressed store, hash-verified

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

Callers 2

mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected