Skip to content

Commit ca5a268

Browse files
Fix code formatting (github#90)
1 parent 4e7319e commit ca5a268

File tree

3 files changed

+72
-48
lines changed

3 files changed

+72
-48
lines changed

dotnet/src/Client.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,16 +1052,16 @@ private sealed class LoggerTraceListener(ILogger logger) : TraceListener
10521052
public override void TraceEvent(TraceEventCache? eventCache, string source, TraceEventType eventType, int id, string? message) =>
10531053
logger.Log(MapLevel(eventType), "[{Source}] {Message}", source, message);
10541054

1055-
public override void TraceEvent(TraceEventCache? eventCache, string source, TraceEventType eventType, int id, string? format, params object?[]? args) =>
1055+
public override void TraceEvent(TraceEventCache? eventCache, string source, TraceEventType eventType, int id, string? format, params object?[]? args) =>
10561056
logger.Log(MapLevel(eventType), "[{Source}] {Message}", source, args is null || args.Length == 0 ? format : string.Format(format ?? "", args));
10571057

1058-
public override void TraceData(TraceEventCache? eventCache, string source, TraceEventType eventType, int id, object? data) =>
1058+
public override void TraceData(TraceEventCache? eventCache, string source, TraceEventType eventType, int id, object? data) =>
10591059
logger.Log(MapLevel(eventType), "[{Source}] {Data}", source, data);
10601060

1061-
public override void TraceData(TraceEventCache? eventCache, string source, TraceEventType eventType, int id, params object?[]? data) =>
1061+
public override void TraceData(TraceEventCache? eventCache, string source, TraceEventType eventType, int id, params object?[]? data) =>
10621062
logger.Log(MapLevel(eventType), "[{Source}] {Data}", source, data is null ? null : string.Join(", ", data));
10631063

1064-
public override void Write(string? message) =>
1064+
public override void Write(string? message) =>
10651065
logger.LogTrace("{Message}", message);
10661066

10671067
public override void WriteLine(string? message) =>

dotnet/src/Generated/SessionEvents.cs

Lines changed: 61 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
// Generated from: @github/copilot/session-events.schema.json
88
// Generated by: scripts/generate-session-types.ts
9-
// Generated at: 2026-01-22T13:45:56.468Z
9+
// Generated at: 2026-01-22T14:30:57.371Z
1010
//
1111
// To update these types:
1212
// 1. Update the schema in copilot-agent-runtime
@@ -21,7 +21,7 @@ namespace GitHub.Copilot.SDK;
2121
/// Base class for all session events with polymorphic JSON serialization.
2222
/// </summary>
2323
[JsonPolymorphic(
24-
TypeDiscriminatorPropertyName = "type",
24+
TypeDiscriminatorPropertyName = "type",
2525
UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FailSerialization)]
2626
[JsonDerivedType(typeof(AbortEvent), "abort")]
2727
[JsonDerivedType(typeof(AssistantIntentEvent), "assistant.intent")]
@@ -53,6 +53,7 @@ namespace GitHub.Copilot.SDK;
5353
[JsonDerivedType(typeof(SystemMessageEvent), "system.message")]
5454
[JsonDerivedType(typeof(ToolExecutionCompleteEvent), "tool.execution_complete")]
5555
[JsonDerivedType(typeof(ToolExecutionPartialResultEvent), "tool.execution_partial_result")]
56+
[JsonDerivedType(typeof(ToolExecutionProgressEvent), "tool.execution_progress")]
5657
[JsonDerivedType(typeof(ToolExecutionStartEvent), "tool.execution_start")]
5758
[JsonDerivedType(typeof(ToolUserRequestedEvent), "tool.user_requested")]
5859
[JsonDerivedType(typeof(UserMessageEvent), "user.message")]
@@ -384,6 +385,18 @@ public partial class ToolExecutionPartialResultEvent : SessionEvent
384385
public required ToolExecutionPartialResultData Data { get; set; }
385386
}
386387

388+
/// <summary>
389+
/// Event: tool.execution_progress
390+
/// </summary>
391+
public partial class ToolExecutionProgressEvent : SessionEvent
392+
{
393+
[JsonIgnore]
394+
public override string Type => "tool.execution_progress";
395+
396+
[JsonPropertyName("data")]
397+
public required ToolExecutionProgressData Data { get; set; }
398+
}
399+
387400
/// <summary>
388401
/// Event: tool.execution_complete
389402
/// </summary>
@@ -845,6 +858,15 @@ public partial class ToolExecutionPartialResultData
845858
public required string PartialOutput { get; set; }
846859
}
847860

861+
public partial class ToolExecutionProgressData
862+
{
863+
[JsonPropertyName("toolCallId")]
864+
public required string ToolCallId { get; set; }
865+
866+
[JsonPropertyName("progressMessage")]
867+
public required string ProgressMessage { get; set; }
868+
}
869+
848870
public partial class ToolExecutionCompleteData
849871
{
850872
[JsonPropertyName("toolCallId")]
@@ -1099,41 +1121,41 @@ public partial class SystemMessageDataMetadata
10991121
public Dictionary<string, object>? Variables { get; set; }
11001122
}
11011123

1102-
[JsonConverter(typeof(JsonStringEnumConverter<SessionHandoffDataSourceType>))]
1103-
public enum SessionHandoffDataSourceType
1104-
{
1105-
[JsonStringEnumMemberName("remote")]
1106-
Remote,
1107-
[JsonStringEnumMemberName("local")]
1108-
Local,
1109-
}
1110-
1111-
[JsonConverter(typeof(JsonStringEnumConverter<UserMessageDataAttachmentsItemType>))]
1112-
public enum UserMessageDataAttachmentsItemType
1113-
{
1114-
[JsonStringEnumMemberName("file")]
1115-
File,
1116-
[JsonStringEnumMemberName("directory")]
1117-
Directory,
1118-
}
1119-
1120-
[JsonConverter(typeof(JsonStringEnumConverter<AssistantMessageDataToolRequestsItemType>))]
1121-
public enum AssistantMessageDataToolRequestsItemType
1122-
{
1123-
[JsonStringEnumMemberName("function")]
1124-
Function,
1125-
[JsonStringEnumMemberName("custom")]
1126-
Custom,
1127-
}
1128-
1129-
[JsonConverter(typeof(JsonStringEnumConverter<SystemMessageDataRole>))]
1130-
public enum SystemMessageDataRole
1131-
{
1132-
[JsonStringEnumMemberName("system")]
1133-
System,
1134-
[JsonStringEnumMemberName("developer")]
1135-
Developer,
1136-
}
1124+
[JsonConverter(typeof(JsonStringEnumConverter<SessionHandoffDataSourceType>))]
1125+
public enum SessionHandoffDataSourceType
1126+
{
1127+
[JsonStringEnumMemberName("remote")]
1128+
Remote,
1129+
[JsonStringEnumMemberName("local")]
1130+
Local,
1131+
}
1132+
1133+
[JsonConverter(typeof(JsonStringEnumConverter<UserMessageDataAttachmentsItemType>))]
1134+
public enum UserMessageDataAttachmentsItemType
1135+
{
1136+
[JsonStringEnumMemberName("file")]
1137+
File,
1138+
[JsonStringEnumMemberName("directory")]
1139+
Directory,
1140+
}
1141+
1142+
[JsonConverter(typeof(JsonStringEnumConverter<AssistantMessageDataToolRequestsItemType>))]
1143+
public enum AssistantMessageDataToolRequestsItemType
1144+
{
1145+
[JsonStringEnumMemberName("function")]
1146+
Function,
1147+
[JsonStringEnumMemberName("custom")]
1148+
Custom,
1149+
}
1150+
1151+
[JsonConverter(typeof(JsonStringEnumConverter<SystemMessageDataRole>))]
1152+
public enum SystemMessageDataRole
1153+
{
1154+
[JsonStringEnumMemberName("system")]
1155+
System,
1156+
[JsonStringEnumMemberName("developer")]
1157+
Developer,
1158+
}
11371159

11381160
[JsonSourceGenerationOptions(
11391161
JsonSerializerDefaults.Web,
@@ -1210,6 +1232,8 @@ public enum SystemMessageDataRole
12101232
[JsonSerializable(typeof(ToolExecutionCompleteEvent))]
12111233
[JsonSerializable(typeof(ToolExecutionPartialResultData))]
12121234
[JsonSerializable(typeof(ToolExecutionPartialResultEvent))]
1235+
[JsonSerializable(typeof(ToolExecutionProgressData))]
1236+
[JsonSerializable(typeof(ToolExecutionProgressEvent))]
12131237
[JsonSerializable(typeof(ToolExecutionStartData))]
12141238
[JsonSerializable(typeof(ToolExecutionStartEvent))]
12151239
[JsonSerializable(typeof(ToolUserRequestedData))]

nodejs/scripts/generate-csharp-session-types.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,15 @@ function getOrCreateEnum(
169169

170170
// Generate the enum code with JsonConverter and JsonStringEnumMemberName attributes
171171
const lines: string[] = [];
172-
lines.push(` [JsonConverter(typeof(JsonStringEnumConverter<${enumName}>))]`);
173-
lines.push(` public enum ${enumName}`);
174-
lines.push(` {`);
172+
lines.push(`[JsonConverter(typeof(JsonStringEnumConverter<${enumName}>))]`);
173+
lines.push(`public enum ${enumName}`);
174+
lines.push(`{`);
175175
for (const value of values) {
176176
const memberName = toPascalCaseEnumMember(value);
177-
lines.push(` [JsonStringEnumMemberName("${value}")]`);
178-
lines.push(` ${memberName},`);
177+
lines.push(` [JsonStringEnumMemberName("${value}")]`);
178+
lines.push(` ${memberName},`);
179179
}
180-
lines.push(` }`);
180+
lines.push(`}`);
181181
lines.push("");
182182

183183
enumOutput.push(lines.join("\n"));
@@ -501,7 +501,7 @@ namespace GitHub.Copilot.SDK;
501501
);
502502
lines.push(`/// </summary>`);
503503
lines.push(`[JsonPolymorphic(`);
504-
lines.push(` TypeDiscriminatorPropertyName = "type", `);
504+
lines.push(` TypeDiscriminatorPropertyName = "type",`);
505505
lines.push(
506506
` UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FailSerialization)]`
507507
);

0 commit comments

Comments
 (0)