MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / extractPlanFromBuffer

Function extractPlanFromBuffer

cli/src/utils/message-block-helpers.ts:30–37  ·  view source on GitHub ↗
(buffer: string)

Source from the content-addressed store, hash-verified

28 * Returns the trimmed content between tags, or null if not found.
29 */
30export const extractPlanFromBuffer = (buffer: string): string | null => {
31 const openIdx = buffer.indexOf('<PLAN>')
32 const closeIdx = buffer.indexOf('</PLAN>')
33 if (openIdx !== -1 && closeIdx !== -1 && closeIdx > openIdx) {
34 return buffer.slice(openIdx + '<PLAN>'.length, closeIdx).trim()
35 }
36 return null
37}
38
39export const scrubPlanTags = (s: string): string => {
40 // Support both the canonical </PLAN> tag and the legacy </cb_plan> tag.

Callers 3

appendRootChunkFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected