Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dotnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Ping the server to check connectivity.

Get current connection state.

##### `ListSessionsAsync(): Task<List<SessionMetadata>>`
##### `ListSessionsAsync(): Task<IList<SessionMetadata>>`

List all available sessions.

Expand Down
42 changes: 21 additions & 21 deletions dotnet/src/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public sealed partial class CopilotClient : IDisposable, IAsyncDisposable
private int? _negotiatedProtocolVersion;
private List<ModelInfo>? _modelsCache;
private readonly SemaphoreSlim _modelsCacheLock = new(1, 1);
private readonly Func<CancellationToken, Task<List<ModelInfo>>>? _onListModels;
private readonly Func<CancellationToken, Task<IList<ModelInfo>>>? _onListModels;
private readonly List<Action<SessionLifecycleEvent>> _lifecycleHandlers = [];
private readonly Dictionary<string, List<Action<SessionLifecycleEvent>>> _typedLifecycleHandlers = [];
private readonly object _lifecycleHandlersLock = new();
Expand Down Expand Up @@ -735,7 +735,7 @@ public async Task<GetAuthStatusResponse> GetAuthStatusAsync(CancellationToken ca
/// The cache is cleared when the client disconnects.
/// </remarks>
/// <exception cref="InvalidOperationException">Thrown when the client is not connected or not authenticated.</exception>
public async Task<List<ModelInfo>> ListModelsAsync(CancellationToken cancellationToken = default)
public async Task<IList<ModelInfo>> ListModelsAsync(CancellationToken cancellationToken = default)
{
await _modelsCacheLock.WaitAsync(cancellationToken);
try
Expand All @@ -746,7 +746,7 @@ public async Task<List<ModelInfo>> ListModelsAsync(CancellationToken cancellatio
return [.. _modelsCache]; // Return a copy to prevent cache mutation
}

List<ModelInfo> models;
IList<ModelInfo> models;
if (_onListModels is not null)
{
// Use custom handler instead of CLI RPC
Expand Down Expand Up @@ -847,7 +847,7 @@ public async Task DeleteSessionAsync(string sessionId, CancellationToken cancell
/// }
/// </code>
/// </example>
public async Task<List<SessionMetadata>> ListSessionsAsync(SessionListFilter? filter = null, CancellationToken cancellationToken = default)
public async Task<IList<SessionMetadata>> ListSessionsAsync(SessionListFilter? filter = null, CancellationToken cancellationToken = default)
{
var connection = await EnsureConnectedAsync(cancellationToken);

Expand Down Expand Up @@ -1467,7 +1467,7 @@ public void OnSessionLifecycle(string type, string sessionId, JsonElement? metad
client.DispatchLifecycleEvent(evt);
}

public async Task<UserInputRequestResponse> OnUserInputRequest(string sessionId, string question, List<string>? choices = null, bool? allowFreeform = null)
public async Task<UserInputRequestResponse> OnUserInputRequest(string sessionId, string question, IList<string>? choices = null, bool? allowFreeform = null)
{
var session = client.GetSession(sessionId) ?? throw new ArgumentException($"Unknown session {sessionId}");
var request = new UserInputRequest
Expand Down Expand Up @@ -1621,26 +1621,26 @@ internal record CreateSessionRequest(
string? SessionId,
string? ClientName,
string? ReasoningEffort,
List<ToolDefinition>? Tools,
IList<ToolDefinition>? Tools,
SystemMessageConfig? SystemMessage,
List<string>? AvailableTools,
List<string>? ExcludedTools,
IList<string>? AvailableTools,
IList<string>? ExcludedTools,
ProviderConfig? Provider,
bool? RequestPermission,
bool? RequestUserInput,
bool? Hooks,
string? WorkingDirectory,
bool? Streaming,
Dictionary<string, McpServerConfig>? McpServers,
IDictionary<string, McpServerConfig>? McpServers,
string? EnvValueMode,
List<CustomAgentConfig>? CustomAgents,
IList<CustomAgentConfig>? CustomAgents,
string? Agent,
string? ConfigDir,
bool? EnableConfigDiscovery,
List<string>? SkillDirectories,
List<string>? DisabledSkills,
IList<string>? SkillDirectories,
IList<string>? DisabledSkills,
InfiniteSessionConfig? InfiniteSessions,
List<CommandWireDefinition>? Commands = null,
IList<CommandWireDefinition>? Commands = null,
bool? RequestElicitation = null,
string? Traceparent = null,
string? Tracestate = null,
Expand Down Expand Up @@ -1673,10 +1673,10 @@ internal record ResumeSessionRequest(
string? ClientName,
string? Model,
string? ReasoningEffort,
List<ToolDefinition>? Tools,
IList<ToolDefinition>? Tools,
SystemMessageConfig? SystemMessage,
List<string>? AvailableTools,
List<string>? ExcludedTools,
IList<string>? AvailableTools,
IList<string>? ExcludedTools,
ProviderConfig? Provider,
bool? RequestPermission,
bool? RequestUserInput,
Expand All @@ -1686,14 +1686,14 @@ internal record ResumeSessionRequest(
bool? EnableConfigDiscovery,
bool? DisableResume,
bool? Streaming,
Dictionary<string, McpServerConfig>? McpServers,
IDictionary<string, McpServerConfig>? McpServers,
string? EnvValueMode,
List<CustomAgentConfig>? CustomAgents,
IList<CustomAgentConfig>? CustomAgents,
string? Agent,
List<string>? SkillDirectories,
List<string>? DisabledSkills,
IList<string>? SkillDirectories,
IList<string>? DisabledSkills,
InfiniteSessionConfig? InfiniteSessions,
List<CommandWireDefinition>? Commands = null,
IList<CommandWireDefinition>? Commands = null,
bool? RequestElicitation = null,
string? Traceparent = null,
string? Tracestate = null,
Expand Down
45 changes: 24 additions & 21 deletions dotnet/src/Generated/Rpc.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading