MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / extractFilePathsFromPatch

Function extractFilePathsFromPatch

src/core/tools/validateToolUse.ts:87–104  ·  view source on GitHub ↗

* Extract file paths from apply_patch content. * The patch format uses markers like "*** Add File: path", "*** Delete File: path", "*** Update File: path" * @param patchContent The patch content string * @returns Array of file paths found in the patch

(patchContent: string)

Source from the content-addressed store, hash-verified

85 * @returns Array of file paths found in the patch
86 */
87function extractFilePathsFromPatch(patchContent: string): string[] {
88 const filePaths: string[] = []
89 const lines = patchContent.split("\n")
90
91 for (const line of lines) {
92 for (const marker of PATCH_FILE_MARKERS) {
93 if (line.startsWith(marker)) {
94 const path = line.substring(marker.length).trim()
95 if (path) {
96 filePaths.push(path)
97 }
98 break
99 }
100 }
101 }
102
103 return filePaths
104}
105
106function getGroupOptions(group: GroupEntry): GroupOptions | undefined {
107 return Array.isArray(group) ? group[1] : undefined

Callers 1

isToolAllowedForModeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected