Roo-Code/packages/types
Roo Code ce12e2f725 feat: add experimental malformed JSON repair for tool calls
This adds support for repairing malformed JSON in LLM tool call responses,
particularly useful for models like Grok that struggle with strict JSON formatting.

Changes:
- Add jsonrepair dependency for JSON repair functionality
- Create json-repair utility module with tryRepairJson, repairJson, parseWithRepair, isValidJson
- Integrate repair logic into NativeToolCallParser.parseToolCall()
- Add malformedJsonRepair experimental setting (disabled by default)
- Wire up experiment toggle in Task.ts

The feature is gated behind an experimental flag and only activates when:
1. The experiment is enabled in settings
2. Standard JSON.parse() fails on tool call arguments

This addresses issue #10481 regarding BAML for parsing LLM output, using
a simpler jsonrepair approach as an initial solution.
2026-01-06 13:39:21 +00:00
..
npm Release: v1.99.0 (#10447) 2026-01-03 15:12:51 -05:00
scripts Fix publish-npm script (#7093) 2025-08-14 03:17:56 -07:00
src feat: add experimental malformed JSON repair for tool calls 2026-01-06 13:39:21 +00:00
.gitignore Task metadata (#7092) 2025-08-14 03:14:17 -07:00
eslint.config.mjs Task metadata (#7092) 2025-08-14 03:14:17 -07:00
package.json Task metadata (#7092) 2025-08-14 03:14:17 -07:00
tsconfig.json Task metadata (#7092) 2025-08-14 03:14:17 -07:00
tsup.config.ts Bump @roo-code/types to v1.42.0 (#6610) 2025-08-02 13:27:59 -07:00
vitest.config.ts Convert jest tests to vitest and disable default watch mode for vitest (#4568) 2025-06-11 14:48:01 -07:00