MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / matchOpen

Method matchOpen

src/llm/thinking.ts:206–214  ·  view source on GitHub ↗
(rest: string, lower: string)

Source from the content-addressed store, hash-verified

204 }
205
206 private matchOpen(rest: string, lower: string): { close: string; len: number } | 'partial' | null {
207 const fn = rest.match(FUNCTION_OPEN_RE);
208 if (fn) return { close: '</function>', len: fn[0].length };
209 for (const b of SUPPRESS_BLOCKS) {
210 if (lower.startsWith(b.open)) return { close: b.close, len: b.open.length };
211 }
212 if (FUNCTION_OPEN_PARTIAL_RE.test(rest) || isProperPrefixOfAny(lower, OPEN_PREFIXES)) return 'partial';
213 return null;
214 }
215
216 private matchStrayClose(lower: string): number | 'partial' | null {
217 for (const cl of STRAY_CLOSERS) {

Callers 1

pushMethod · 0.95

Calls 1

isProperPrefixOfAnyFunction · 0.85

Tested by

no test coverage detected