This commit is contained in:
Saoud Rizwan
2024-10-04 07:50:21 -04:00
parent ab3d987f0c
commit 3ea474795a

View File

@@ -1569,21 +1569,21 @@ export class ClaudeDev {
// Try to match a parameter tag with content, even if the closing tag is missing or partial // Try to match a parameter tag with content, even if the closing tag is missing or partial
// matches <paramName> and rest of line as paramContent // matches <paramName> and rest of line as paramContent
const paramMatch = trimmed.match(/^<(\w+)>(.*)$/) // const paramMatch = trimmed.match(/^<(\w+)>(.*)$/)
if (paramMatch) { // if (paramMatch) {
const paramName = paramMatch[1] as ToolParamName // const paramName = paramMatch[1] as ToolParamName
let paramContent = paramMatch[2] // let paramContent = paramMatch[2]
// Remove any closing tag or partial closing tag from paramContent // // Remove any closing tag or partial closing tag from paramContent
// replaces any sequence that starts with </ (a closing tag) to the end of the line with an empty string // // replaces any sequence that starts with </ (a closing tag) to the end of the line with an empty string
paramContent = paramContent?.replace(/<\/.*$/, "").trim() // paramContent = paramContent?.replace(/<\/.*$/, "").trim()
if (paramName && paramContent && toolParamNames.includes(paramName)) { // if (paramName && paramContent && toolParamNames.includes(paramName)) {
currentToolUse.params[paramName] = paramContent // currentToolUse.params[paramName] = paramContent
} // }
// Assuming the entire parameter is on this line, we don't need to set currentParamName // // Assuming the entire parameter is on this line, we don't need to set currentParamName
} // }
// If no param name, assume it's a partial and wait for more output // If no param name, assume it's a partial and wait for more output
continue continue