refactor: remove heuristic parsing, use pure type-based tool rendering

- Remove all heuristic parsing code from message.tsx (hasCommandDetails,
  commandSection, editSections, readSections, hasStructuredContent, etc.)
- Replace with simple raw JSON fallback for tools without structured results
- Fix server-side support for Claude SDK's old_string/new_string params
  (in addition to old_str/new_str)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Mohamed Boudra
2025-11-28 19:38:42 +00:00
co-authored by Claude
parent 38b08fec0c
commit 4001b7dc0a
2 changed files with 62 additions and 198 deletions
@@ -1122,12 +1122,15 @@ class ClaudeAgentSession implements AgentSession {
normalizedTool === "apply_diff"
) {
if (input && typeof input.file_path === "string") {
// Support both old_str/new_str and old_string/new_string parameter names
const oldContent = typeof input.old_str === "string" ? input.old_str : typeof input.old_string === "string" ? input.old_string : undefined;
const newContent = typeof input.new_str === "string" ? input.new_str : typeof input.new_string === "string" ? input.new_string : undefined;
return {
type: "file_edit",
filePath: input.file_path,
diff: typeof input.patch === "string" ? input.patch : typeof input.diff === "string" ? input.diff : undefined,
oldContent: typeof input.old_str === "string" ? input.old_str : undefined,
newContent: typeof input.new_str === "string" ? input.new_str : undefined,
oldContent,
newContent,
};
}
}