github / github/copilot-sdk

Feature request for file changes event

未关闭
#902 2 条评论 47 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Java
星标
10.5k
派生
1.5k
平均合并
1 天 11 小时
30 天内合并 PR
128

描述

This is a feature request.

Currently it seems that we don't receive any events for changed files with their diff, which makes it difficult with the SDK to report nicely what GitHub Copilot has changed during a prompt iteration.

An example of such API in C# could be:

```csharp
public partial class AssistantFileChangesEvent : SessionEvent
{
[JsonIgnore]
public override string Type => "assistant.file_changes";

[JsonPropertyName("changes")]
public required List Changes { get; set; }
}

public partial class AssistantFileChangeData
{
[JsonPropertyName("diff")]
public string Diff { get; set; } = string.Empty;
[JsonPropertyName("kind")]
public AssistantFileChangeKind Kind { get; set; } = default!;
[JsonPropertyName("path")]
public string Path { get; set; } = string.Empty;
[JsonPropertyName("move_path")]
public string MovePath { get; set; } = string.Empty; // When kind == "update"
}

[JsonConverter(typeof(JsonStringEnumConverter))]
public enum AssistantFileChangeKind
{
[JsonStringEnumMemberName("add")]
Add,
[JsonStringEnumMemberName("delete")]
Delete,
[JsonStringEnumMemberName("update")]
Update, // Use "move_path"
}
```

It would allow to display more nicely during a user/assistant iteration the files that were modified.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。