MCPcopy Index your code
hub / github.com/codeaashu/claude-code / parseXmlReason

Function parseXmlReason

src/utils/permissions/yoloClassifier.ts:590–596  ·  view source on GitHub ↗

* Parse XML reason: ... * Strips thinking content first to avoid matching tags inside reasoning.

(text: string)

Source from the content-addressed store, hash-verified

588 * Strips thinking content first to avoid matching tags inside reasoning.
589 */
590function parseXmlReason(text: string): string | null {
591 const matches = [
592 ...stripThinking(text).matchAll(/<reason>([\s\S]*?)<\/reason>/g),
593 ]
594 if (matches.length === 0) return null
595 return matches[0]![1]!.trim()
596}
597
598/**
599 * Parse XML thinking content: <thinking>...</thinking>

Callers 1

classifyYoloActionXmlFunction · 0.85

Calls 1

stripThinkingFunction · 0.85

Tested by

no test coverage detected