MCPcopy
hub / github.com/OpenCoworkAI/open-codesign / findMarkerBlock

Function findMarkerBlock

packages/shared/src/editmode.ts:53–65  ·  view source on GitHub ↗
(source: string, kind: 'EDITMODE' | 'TWEAK-SCHEMA')

Source from the content-addressed store, hash-verified

51}
52
53function findMarkerBlock(source: string, kind: 'EDITMODE' | 'TWEAK-SCHEMA'): MarkerBlock | null {
54 const begin = findMarker(source, `${kind}-BEGIN`);
55 if (begin === null) return null;
56 const end = findMarker(source, `${kind}-END`, begin.end);
57 if (end === null) return null;
58 return {
59 start: begin.start,
60 end: end.end,
61 innerStart: begin.end,
62 innerEnd: end.start,
63 inner: source.slice(begin.end, end.start),
64 };
65}
66
67function replaceMarkerBlock(
68 source: string,

Callers 5

replaceMarkerBlockFunction · 0.85
parseEditmodeBlockFunction · 0.85
parseTweakSchemaFunction · 0.85
replaceTweakSchemaFunction · 0.85

Calls 1

findMarkerFunction · 0.85

Tested by

no test coverage detected