Skip to content

Commit 6d6e3e1

Browse files
Update codegen output
1 parent fcd6746 commit 6d6e3e1

File tree

4 files changed

+663
-18
lines changed

4 files changed

+663
-18
lines changed

dotnet/src/Generated/Rpc.cs

Lines changed: 81 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,30 @@ public class AccountGetQuotaResult
219219
public Dictionary<string, AccountGetQuotaResultQuotaSnapshotsValue> QuotaSnapshots { get => field ??= []; set; }
220220
}
221221

222+
/// <summary>RPC data type for SessionFsSetProvider operations.</summary>
223+
public class SessionFsSetProviderResult
224+
{
225+
/// <summary>Whether the provider was set successfully.</summary>
226+
[JsonPropertyName("success")]
227+
public bool Success { get; set; }
228+
}
229+
230+
/// <summary>RPC data type for SessionFsSetProvider operations.</summary>
231+
internal class SessionFsSetProviderRequest
232+
{
233+
/// <summary>Initial working directory for sessions.</summary>
234+
[JsonPropertyName("initialCwd")]
235+
public string InitialCwd { get; set; } = string.Empty;
236+
237+
/// <summary>Path within each session's SessionFs where the runtime stores files for that session.</summary>
238+
[JsonPropertyName("sessionStatePath")]
239+
public string SessionStatePath { get; set; } = string.Empty;
240+
241+
/// <summary>Path conventions used by this filesystem.</summary>
242+
[JsonPropertyName("conventions")]
243+
public SessionFsSetProviderRequestConventions Conventions { get; set; }
244+
}
245+
222246
/// <summary>RPC data type for SessionLog operations.</summary>
223247
public class SessionLogResult
224248
{
@@ -705,7 +729,7 @@ public class Server
705729
[JsonPropertyName("name")]
706730
public string Name { get; set; } = string.Empty;
707731

708-
/// <summary>Connection status: connected, failed, pending, disabled, or not_configured.</summary>
732+
/// <summary>Connection status: connected, failed, needs-auth, pending, disabled, or not_configured.</summary>
709733
[JsonPropertyName("status")]
710734
public ServerStatus Status { get; set; }
711735

@@ -1156,6 +1180,19 @@ internal class SessionShellKillRequest
11561180
public SessionShellKillRequestSignal? Signal { get; set; }
11571181
}
11581182

1183+
/// <summary>Path conventions used by this filesystem.</summary>
1184+
[JsonConverter(typeof(JsonStringEnumConverter<SessionFsSetProviderRequestConventions>))]
1185+
public enum SessionFsSetProviderRequestConventions
1186+
{
1187+
/// <summary>The <c>windows</c> variant.</summary>
1188+
[JsonStringEnumMemberName("windows")]
1189+
Windows,
1190+
/// <summary>The <c>posix</c> variant.</summary>
1191+
[JsonStringEnumMemberName("posix")]
1192+
Posix,
1193+
}
1194+
1195+
11591196
/// <summary>Log severity level. Determines how the message is displayed in the timeline. Defaults to "info".</summary>
11601197
[JsonConverter(typeof(JsonStringEnumConverter<SessionLogRequestLevel>))]
11611198
public enum SessionLogRequestLevel
@@ -1188,7 +1225,7 @@ public enum SessionModeGetResultMode
11881225
}
11891226

11901227

1191-
/// <summary>Connection status: connected, failed, pending, disabled, or not_configured.</summary>
1228+
/// <summary>Connection status: connected, failed, needs-auth, pending, disabled, or not_configured.</summary>
11921229
[JsonConverter(typeof(JsonStringEnumConverter<ServerStatus>))]
11931230
public enum ServerStatus
11941231
{
@@ -1198,6 +1235,9 @@ public enum ServerStatus
11981235
/// <summary>The <c>failed</c> variant.</summary>
11991236
[JsonStringEnumMemberName("failed")]
12001237
Failed,
1238+
/// <summary>The <c>needs-auth</c> variant.</summary>
1239+
[JsonStringEnumMemberName("needs-auth")]
1240+
NeedsAuth,
12011241
/// <summary>The <c>pending</c> variant.</summary>
12021242
[JsonStringEnumMemberName("pending")]
12031243
Pending,
@@ -1285,6 +1325,8 @@ internal ServerRpc(JsonRpc rpc)
12851325
Models = new ServerModelsApi(rpc);
12861326
Tools = new ServerToolsApi(rpc);
12871327
Account = new ServerAccountApi(rpc);
1328+
Mcp = new ServerMcpApi(rpc);
1329+
SessionFs = new ServerSessionFsApi(rpc);
12881330
}
12891331

12901332
/// <summary>Calls "ping".</summary>
@@ -1302,6 +1344,12 @@ public async Task<PingResult> PingAsync(string? message = null, CancellationToke
13021344

13031345
/// <summary>Account APIs.</summary>
13041346
public ServerAccountApi Account { get; }
1347+
1348+
/// <summary>Mcp APIs.</summary>
1349+
public ServerMcpApi Mcp { get; }
1350+
1351+
/// <summary>SessionFs APIs.</summary>
1352+
public ServerSessionFsApi SessionFs { get; }
13051353
}
13061354

13071355
/// <summary>Provides server-scoped Models APIs.</summary>
@@ -1356,6 +1404,35 @@ public async Task<AccountGetQuotaResult> GetQuotaAsync(CancellationToken cancell
13561404
}
13571405
}
13581406

1407+
/// <summary>Provides server-scoped Mcp APIs.</summary>
1408+
public class ServerMcpApi
1409+
{
1410+
private readonly JsonRpc _rpc;
1411+
1412+
internal ServerMcpApi(JsonRpc rpc)
1413+
{
1414+
_rpc = rpc;
1415+
}
1416+
}
1417+
1418+
/// <summary>Provides server-scoped SessionFs APIs.</summary>
1419+
public class ServerSessionFsApi
1420+
{
1421+
private readonly JsonRpc _rpc;
1422+
1423+
internal ServerSessionFsApi(JsonRpc rpc)
1424+
{
1425+
_rpc = rpc;
1426+
}
1427+
1428+
/// <summary>Calls "sessionFs.setProvider".</summary>
1429+
public async Task<SessionFsSetProviderResult> SetProviderAsync(string initialCwd, string sessionStatePath, SessionFsSetProviderRequestConventions conventions, CancellationToken cancellationToken = default)
1430+
{
1431+
var request = new SessionFsSetProviderRequest { InitialCwd = initialCwd, SessionStatePath = sessionStatePath, Conventions = conventions };
1432+
return await CopilotClient.InvokeRpcAsync<SessionFsSetProviderResult>(_rpc, "sessionFs.setProvider", [request], cancellationToken);
1433+
}
1434+
}
1435+
13591436
/// <summary>Provides typed session-scoped RPC methods.</summary>
13601437
public class SessionRpc
13611438
{
@@ -1959,6 +2036,8 @@ public async Task<SessionShellKillResult> KillAsync(string processId, SessionShe
19592036
[JsonSerializable(typeof(SessionExtensionsReloadResult))]
19602037
[JsonSerializable(typeof(SessionFleetStartRequest))]
19612038
[JsonSerializable(typeof(SessionFleetStartResult))]
2039+
[JsonSerializable(typeof(SessionFsSetProviderRequest))]
2040+
[JsonSerializable(typeof(SessionFsSetProviderResult))]
19622041
[JsonSerializable(typeof(SessionLogRequest))]
19632042
[JsonSerializable(typeof(SessionLogResult))]
19642043
[JsonSerializable(typeof(SessionMcpDisableRequest))]

go/rpc/generated_rpc.go

Lines changed: 150 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,98 @@ type QuotaSnapshot struct {
131131
UsedRequests float64 `json:"usedRequests"`
132132
}
133133

134+
type MCPConfigListResult struct {
135+
// All MCP servers from user config, keyed by name
136+
Servers map[string]ServerValue `json:"servers"`
137+
}
138+
139+
// MCP server configuration (local/stdio or remote/http)
140+
type ServerValue struct {
141+
Args []string `json:"args,omitempty"`
142+
Command *string `json:"command,omitempty"`
143+
Cwd *string `json:"cwd,omitempty"`
144+
Env map[string]string `json:"env,omitempty"`
145+
FilterMapping *FilterMappingUnion `json:"filterMapping"`
146+
IsDefaultServer *bool `json:"isDefaultServer,omitempty"`
147+
Timeout *float64 `json:"timeout,omitempty"`
148+
// Tools to include. Defaults to all tools if not specified.
149+
Tools []string `json:"tools,omitempty"`
150+
Type *ServerType `json:"type,omitempty"`
151+
Headers map[string]string `json:"headers,omitempty"`
152+
OauthClientID *string `json:"oauthClientId,omitempty"`
153+
OauthPublicClient *bool `json:"oauthPublicClient,omitempty"`
154+
URL *string `json:"url,omitempty"`
155+
}
156+
157+
type MCPConfigAddParams struct {
158+
// MCP server configuration (local/stdio or remote/http)
159+
Config MCPConfigAddParamsConfig `json:"config"`
160+
// Unique name for the MCP server
161+
Name string `json:"name"`
162+
}
163+
164+
// MCP server configuration (local/stdio or remote/http)
165+
type MCPConfigAddParamsConfig struct {
166+
Args []string `json:"args,omitempty"`
167+
Command *string `json:"command,omitempty"`
168+
Cwd *string `json:"cwd,omitempty"`
169+
Env map[string]string `json:"env,omitempty"`
170+
FilterMapping *FilterMappingUnion `json:"filterMapping"`
171+
IsDefaultServer *bool `json:"isDefaultServer,omitempty"`
172+
Timeout *float64 `json:"timeout,omitempty"`
173+
// Tools to include. Defaults to all tools if not specified.
174+
Tools []string `json:"tools,omitempty"`
175+
Type *ServerType `json:"type,omitempty"`
176+
Headers map[string]string `json:"headers,omitempty"`
177+
OauthClientID *string `json:"oauthClientId,omitempty"`
178+
OauthPublicClient *bool `json:"oauthPublicClient,omitempty"`
179+
URL *string `json:"url,omitempty"`
180+
}
181+
182+
type MCPConfigUpdateParams struct {
183+
// MCP server configuration (local/stdio or remote/http)
184+
Config MCPConfigUpdateParamsConfig `json:"config"`
185+
// Name of the MCP server to update
186+
Name string `json:"name"`
187+
}
188+
189+
// MCP server configuration (local/stdio or remote/http)
190+
type MCPConfigUpdateParamsConfig struct {
191+
Args []string `json:"args,omitempty"`
192+
Command *string `json:"command,omitempty"`
193+
Cwd *string `json:"cwd,omitempty"`
194+
Env map[string]string `json:"env,omitempty"`
195+
FilterMapping *FilterMappingUnion `json:"filterMapping"`
196+
IsDefaultServer *bool `json:"isDefaultServer,omitempty"`
197+
Timeout *float64 `json:"timeout,omitempty"`
198+
// Tools to include. Defaults to all tools if not specified.
199+
Tools []string `json:"tools,omitempty"`
200+
Type *ServerType `json:"type,omitempty"`
201+
Headers map[string]string `json:"headers,omitempty"`
202+
OauthClientID *string `json:"oauthClientId,omitempty"`
203+
OauthPublicClient *bool `json:"oauthPublicClient,omitempty"`
204+
URL *string `json:"url,omitempty"`
205+
}
206+
207+
type MCPConfigRemoveParams struct {
208+
// Name of the MCP server to remove
209+
Name string `json:"name"`
210+
}
211+
212+
type SessionFSSetProviderResult struct {
213+
// Whether the provider was set successfully
214+
Success bool `json:"success"`
215+
}
216+
217+
type SessionFSSetProviderParams struct {
218+
// Path conventions used by this filesystem
219+
Conventions Conventions `json:"conventions"`
220+
// Initial working directory for sessions
221+
InitialCwd string `json:"initialCwd"`
222+
// Path within each session's SessionFs where the runtime stores files for that session
223+
SessionStatePath string `json:"sessionStatePath"`
224+
}
225+
134226
type SessionModelGetCurrentResult struct {
135227
// Currently active model identifier
136228
ModelID *string `json:"modelId,omitempty"`
@@ -338,17 +430,17 @@ type SessionSkillsReloadResult struct {
338430

339431
type SessionMCPListResult struct {
340432
// Configured MCP servers
341-
Servers []Server `json:"servers"`
433+
Servers []ServerElement `json:"servers"`
342434
}
343435

344-
type Server struct {
436+
type ServerElement struct {
345437
// Error message if the server failed to connect
346438
Error *string `json:"error,omitempty"`
347439
// Server name (config key)
348440
Name string `json:"name"`
349441
// Configuration source: user, workspace, plugin, or builtin
350442
Source *string `json:"source,omitempty"`
351-
// Connection status: connected, failed, pending, disabled, or not_configured
443+
// Connection status: connected, failed, needs-auth, pending, disabled, or not_configured
352444
Status ServerStatus `json:"status"`
353445
}
354446

@@ -610,6 +702,31 @@ type SessionShellKillParams struct {
610702
Signal *Signal `json:"signal,omitempty"`
611703
}
612704

705+
type FilterMappingEnum string
706+
707+
const (
708+
FilterMappingEnumHiddenCharacters FilterMappingEnum = "hidden_characters"
709+
FilterMappingEnumMarkdown FilterMappingEnum = "markdown"
710+
FilterMappingEnumNone FilterMappingEnum = "none"
711+
)
712+
713+
type ServerType string
714+
715+
const (
716+
ServerTypeHTTP ServerType = "http"
717+
ServerTypeLocal ServerType = "local"
718+
ServerTypeSse ServerType = "sse"
719+
ServerTypeStdio ServerType = "stdio"
720+
)
721+
722+
// Path conventions used by this filesystem
723+
type Conventions string
724+
725+
const (
726+
ConventionsPosix Conventions = "posix"
727+
ConventionsWindows Conventions = "windows"
728+
)
729+
613730
// The current agent mode.
614731
//
615732
// The agent mode after switching.
@@ -623,11 +740,12 @@ const (
623740
ModePlan Mode = "plan"
624741
)
625742

626-
// Connection status: connected, failed, pending, disabled, or not_configured
743+
// Connection status: connected, failed, needs-auth, pending, disabled, or not_configured
627744
type ServerStatus string
628745

629746
const (
630747
ServerStatusConnected ServerStatus = "connected"
748+
ServerStatusNeedsAuth ServerStatus = "needs-auth"
631749
ServerStatusNotConfigured ServerStatus = "not_configured"
632750
ServerStatusPending ServerStatus = "pending"
633751
ServerStatusDisabled ServerStatus = "disabled"
@@ -721,6 +839,11 @@ const (
721839
SignalSIGTERM Signal = "SIGTERM"
722840
)
723841

842+
type FilterMappingUnion struct {
843+
Enum *FilterMappingEnum
844+
EnumMap map[string]FilterMappingEnum
845+
}
846+
724847
type ResultUnion struct {
725848
ResultResult *ResultResult
726849
String *string
@@ -779,13 +902,31 @@ func (a *ServerAccountApi) GetQuota(ctx context.Context) (*AccountGetQuotaResult
779902
return &result, nil
780903
}
781904

905+
type ServerMcpApi serverApi
906+
907+
type ServerSessionFsApi serverApi
908+
909+
func (a *ServerSessionFsApi) SetProvider(ctx context.Context, params *SessionFSSetProviderParams) (*SessionFSSetProviderResult, error) {
910+
raw, err := a.client.Request("sessionFs.setProvider", params)
911+
if err != nil {
912+
return nil, err
913+
}
914+
var result SessionFSSetProviderResult
915+
if err := json.Unmarshal(raw, &result); err != nil {
916+
return nil, err
917+
}
918+
return &result, nil
919+
}
920+
782921
// ServerRpc provides typed server-scoped RPC methods.
783922
type ServerRpc struct {
784923
common serverApi // Reuse a single struct instead of allocating one for each service on the heap.
785924

786-
Models *ServerModelsApi
787-
Tools *ServerToolsApi
788-
Account *ServerAccountApi
925+
Models *ServerModelsApi
926+
Tools *ServerToolsApi
927+
Account *ServerAccountApi
928+
Mcp *ServerMcpApi
929+
SessionFs *ServerSessionFsApi
789930
}
790931

791932
func (a *ServerRpc) Ping(ctx context.Context, params *PingParams) (*PingResult, error) {
@@ -806,6 +947,8 @@ func NewServerRpc(client *jsonrpc2.Client) *ServerRpc {
806947
r.Models = (*ServerModelsApi)(&r.common)
807948
r.Tools = (*ServerToolsApi)(&r.common)
808949
r.Account = (*ServerAccountApi)(&r.common)
950+
r.Mcp = (*ServerMcpApi)(&r.common)
951+
r.SessionFs = (*ServerSessionFsApi)(&r.common)
809952
return r
810953
}
811954

0 commit comments

Comments
 (0)