diff --git a/docs/rfds/file-delete.mdx b/docs/rfds/file-delete.mdx new file mode 100644 index 00000000..efc76a91 --- /dev/null +++ b/docs/rfds/file-delete.mdx @@ -0,0 +1,80 @@ +--- +title: "Diff event for the case of deleted file" +--- + +Author(s): [anna239](https://github.com/benbrandt) + +## Elevator pitch + +> What are you proposing to change? + +Add flag `deleted` to [Diff](https://agentclientprotocol.com/protocol/tool-calls#diffs) entity type for the case of a deleted file. + +## Status quo + +> How do things work today and what problems does this cause? Why would we change things? + +Currently, in Diff entity type `newText` is not nullable, so it's not possible to distinguish between a deleted file and empty file. + +## What we propose to do about it + +> What are you proposing to improve the situation? + +Add flag `deleted` to [Diff](https://agentclientprotocol.com/protocol/tool-calls#diffs) entity type for the case of a deleted file. + +**Current structure (cannot distinguish deleted file from empty file):** + +```json +{ + "type": "diff", + "path": "/home/user/project/src/config.json", + "oldText": "{\n \"debug\": false\n}", + "newText": "" +} +``` + +**Proposed structure with `deleted` flag:** + +```json +{ + "type": "diff", + "path": "/home/user/project/src/config.json", + "oldText": "{\n \"debug\": false\n}", + "newText": "", + "deleted": true +} +``` + +Note: we would ideally make newText nullable, but that would break existing clients. + +## Shiny future + +> How will things will play out once this feature exists? + +It is possible for the agent to distinguish between a deleted file and an empty file. + +## Implementation details and plan + +> Tell me more about your implementation. What is your detailed implementation plan? + + + +## Frequently asked questions + +> What questions have arisen over the course of authoring this document or during subsequent discussions? + + + +### What alternative approaches did you consider, and why did you settle on this one? + +We considered making newText nullable, but that would break existing clients. + +## Revision history + +