github / github/copilot-sdk

Feature request for file changes event

Đang mở
#902 2 bình luận 47 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Java
Star
10.5k
Fork
1.5k
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
127

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.