From c4fcea76155eed40c964825befbccaa8bb5bd20f Mon Sep 17 00:00:00 2001 From: qmuntal Date: Mon, 1 Jun 2026 11:52:04 +0200 Subject: [PATCH 1/5] Consolidate Go initialism casing --- docs/setup/multi-tenancy.md | 2 +- go/README.md | 4 +- go/canvas_test.go | 22 +- go/client.go | 116 +- go/client_test.go | 38 +- go/definetool.go | 4 +- go/definetool_test.go | 4 +- .../e2e/agent_and_compact_rpc_e2e_test.go | 4 +- go/internal/e2e/client_api_e2e_test.go | 2 +- .../e2e/commands_and_elicitation_e2e_test.go | 2 +- go/internal/e2e/mcp_and_agents_e2e_test.go | 12 +- go/internal/e2e/mcp_server_helpers_test.go | 4 +- .../e2e/pending_work_resume_e2e_test.go | 2 +- go/internal/e2e/permissions_e2e_test.go | 14 +- .../e2e/pre_mcp_tool_call_hook_e2e_test.go | 20 +- go/internal/e2e/rpc_e2e_test.go | 4 +- go/internal/e2e/rpc_event_log_e2e_test.go | 2 +- .../e2e/rpc_event_side_effects_e2e_test.go | 2 +- .../e2e/rpc_mcp_and_skills_e2e_test.go | 154 +- go/internal/e2e/rpc_mcp_config_e2e_test.go | 92 +- go/internal/e2e/rpc_queue_e2e_test.go | 2 +- go/internal/e2e/rpc_remote_e2e_test.go | 2 +- go/internal/e2e/rpc_schedule_e2e_test.go | 2 +- go/internal/e2e/rpc_server_e2e_test.go | 26 +- go/internal/e2e/rpc_session_state_e2e_test.go | 8 +- .../e2e/rpc_shell_and_fleet_e2e_test.go | 2 +- .../e2e/rpc_tasks_and_handlers_e2e_test.go | 2 +- .../e2e/rpc_workspace_checkpoints_e2e_test.go | 2 +- go/internal/e2e/session_e2e_test.go | 8 +- go/internal/e2e/session_fs_e2e_test.go | 82 +- go/internal/e2e/session_fs_sqlite_e2e_test.go | 54 +- go/mode_empty.go | 10 +- go/rpc/generated_rpc_api_shape_test.go | 16 +- go/rpc/generated_rpc_union_test.go | 22 +- go/rpc/zrpc.go | 1754 ++++++++--------- go/rpc/zrpc_encoding.go | 174 +- go/rpc/zsession_encoding.go | 36 +- go/rpc/zsession_events.go | 130 +- go/sdk_protocol_version.go | 10 +- go/session.go | 18 +- go/session_fs_provider.go | 120 +- go/session_test.go | 2 +- go/toolset.go | 4 +- go/toolset_test.go | 6 +- go/types.go | 102 +- go/zsession_events.go | 98 +- scripts/codegen/go.ts | 88 +- 47 files changed, 1641 insertions(+), 1643 deletions(-) diff --git a/docs/setup/multi-tenancy.md b/docs/setup/multi-tenancy.md index 6f08ecddf..1cc1c5f16 100644 --- a/docs/setup/multi-tenancy.md +++ b/docs/setup/multi-tenancy.md @@ -338,7 +338,7 @@ Verified public SDK surfaces: |----------|---------------------|----------------------| | TypeScript | `sessionFs` | `createSessionFsAdapter` / provider callbacks | | Python | `session_fs` | `create_session_fs_handler` | -| Go | `SessionFs` | `CreateSessionFsProvider` | +| Go | `SessionFS` | `CreateSessionFSProvider` | | .NET | `SessionFs` | `CreateSessionFsProvider` | | Rust | `with_session_fs(...)` | `with_session_fs_provider(...)` | diff --git a/go/README.md b/go/README.md index d67647808..2ff4404a3 100644 --- a/go/README.md +++ b/go/README.md @@ -495,7 +495,7 @@ The SDK supports custom OpenAI-compatible API providers (BYOK - Bring Your Own K - `BaseURL` (string): API endpoint URL (required) - `APIKey` (string): API key (optional for local providers like Ollama) - `BearerToken` (string): Bearer token for authentication (takes precedence over APIKey) -- `WireApi` (string): API format for OpenAI/Azure - "completions" or "responses" (default: "completions") +- `WireAPI` (string): API format for OpenAI/Azure - "completions" or "responses" (default: "completions") - `Azure.APIVersion` (string): Azure API version (default: "2024-10-21") **Example with Ollama:** @@ -802,7 +802,7 @@ confirmed, err := ui.Confirm(ctx, "Deploy to production?") choice, ok, err := ui.Select(ctx, "Pick an environment", []string{"staging", "production"}) // Text input — returns (text, ok bool, error) -name, ok, err := ui.Input(ctx, "Enter the release name", &copilot.UiInputOptions{ +name, ok, err := ui.Input(ctx, "Enter the release name", &copilot.UIInputOptions{ Title: "Release Name", Description: "A short name for the release", MinLength: copilot.Int(1), diff --git a/go/canvas_test.go b/go/canvas_test.go index c6f74772a..b7ced02bf 100644 --- a/go/canvas_test.go +++ b/go/canvas_test.go @@ -136,7 +136,7 @@ func TestCanvasAdapter_DispatchesToHandler(t *testing.T) { session := newTestCanvasSession("s1") session.registerCanvasHandler(handler) - openResp, err := session.clientSessionApis.Canvas.Open(&rpc.CanvasProviderOpenRequest{ + openResp, err := session.clientSessionAPIs.Canvas.Open(&rpc.CanvasProviderOpenRequest{ SessionID: "s1", ExtensionID: "project:echo", CanvasID: "echo", @@ -156,7 +156,7 @@ func TestCanvasAdapter_DispatchesToHandler(t *testing.T) { t.Fatalf("response URL not propagated: %+v", openResp) } - actionResp, err := session.clientSessionApis.Canvas.Invoke(&rpc.CanvasProviderInvokeActionRequest{ + actionResp, err := session.clientSessionAPIs.Canvas.Invoke(&rpc.CanvasProviderInvokeActionRequest{ SessionID: "s1", ExtensionID: "project:echo", CanvasID: "echo", @@ -178,7 +178,7 @@ func TestCanvasAdapter_DispatchesToHandler(t *testing.T) { t.Fatalf("unexpected action result: %#v", actionResp) } - closeResp, err := session.clientSessionApis.Canvas.Close(&rpc.CanvasProviderCloseRequest{ + closeResp, err := session.clientSessionAPIs.Canvas.Close(&rpc.CanvasProviderCloseRequest{ SessionID: "s1", ExtensionID: "project:echo", CanvasID: "echo", @@ -198,7 +198,7 @@ func TestCanvasAdapter_DispatchesToHandler(t *testing.T) { func TestCanvasAdapter_NoHandler_ReturnsUnsetError(t *testing.T) { session := newTestCanvasSession("s1") - _, err := session.clientSessionApis.Canvas.Open(&rpc.CanvasProviderOpenRequest{SessionID: "s1"}) + _, err := session.clientSessionAPIs.Canvas.Open(&rpc.CanvasProviderOpenRequest{SessionID: "s1"}) assertCanvasJSONRPCError(t, err, "canvas_handler_unset", "") } @@ -208,7 +208,7 @@ func TestCanvasAdapter_HandlerCanvasError_Wired(t *testing.T) { openErr: NewCanvasError("permission_denied", "nope"), }) - _, err := session.clientSessionApis.Canvas.Open(&rpc.CanvasProviderOpenRequest{SessionID: "s1"}) + _, err := session.clientSessionAPIs.Canvas.Open(&rpc.CanvasProviderOpenRequest{SessionID: "s1"}) assertCanvasJSONRPCError(t, err, "permission_denied", "nope") } @@ -218,11 +218,11 @@ func TestCanvasAdapter_HandlerGenericError_WrappedAsCanvasHandlerError(t *testin openErr: errors.New("boom"), }) - _, err := session.clientSessionApis.Canvas.Open(&rpc.CanvasProviderOpenRequest{SessionID: "s1"}) + _, err := session.clientSessionAPIs.Canvas.Open(&rpc.CanvasProviderOpenRequest{SessionID: "s1"}) assertCanvasJSONRPCError(t, err, "canvas_handler_error", "boom") } -func TestCanvasRegisterClientSessionApiHandlers_RawJSONRoundTrip(t *testing.T) { +func TestCanvasRegisterClientSessionAPIHandlers_RawJSONRoundTrip(t *testing.T) { clientToServerReader, clientToServerWriter := io.Pipe() serverToClientReader, serverToClientWriter := io.Pipe() @@ -233,9 +233,9 @@ func TestCanvasRegisterClientSessionApiHandlers_RawJSONRoundTrip(t *testing.T) { openResult: rpc.CanvasProviderOpenResult{Status: strPtr("ready")}, actionResult: map[string]any{"count": float64(2)}, }) - rpc.RegisterClientSessionApiHandlers(server, func(sessionID string) *rpc.ClientSessionApiHandlers { + rpc.RegisterClientSessionAPIHandlers(server, func(sessionID string) *rpc.ClientSessionAPIHandlers { if sessionID == "s1" { - return session.clientSessionApis + return session.clientSessionAPIs } return nil }) @@ -417,9 +417,9 @@ func assertCanvasJSONRPCError(t *testing.T, err error, wantCode, wantMessage str func newTestCanvasSession(sessionID string) *Session { session := &Session{ SessionID: sessionID, - clientSessionApis: &rpc.ClientSessionApiHandlers{}, + clientSessionAPIs: &rpc.ClientSessionAPIHandlers{}, } - session.clientSessionApis.Canvas = newCanvasClientSessionAdapter(session) + session.clientSessionAPIs.Canvas = newCanvasClientSessionAdapter(session) return session } diff --git a/go/client.go b/go/client.go index 3ccee2896..ca26dcbc0 100644 --- a/go/client.go +++ b/go/client.go @@ -52,18 +52,18 @@ import ( "github.com/github/copilot-sdk/go/rpc" ) -func validateSessionFsConfig(config *SessionFsConfig) error { +func validateSessionFSConfig(config *SessionFSConfig) error { if config == nil { return nil } if config.InitialWorkingDirectory == "" { - return errors.New("SessionFs.InitialWorkingDirectory is required") + return errors.New("SessionFS.InitialWorkingDirectory is required") } if config.SessionStatePath == "" { - return errors.New("SessionFs.SessionStatePath is required") + return errors.New("SessionFS.SessionStatePath is required") } - if config.Conventions != rpc.SessionFsSetProviderConventionsPosix && config.Conventions != rpc.SessionFsSetProviderConventionsWindows { - return errors.New("SessionFs.Conventions must be either 'posix' or 'windows'") + if config.Conventions != rpc.SessionFSSetProviderConventionsPosix && config.Conventions != rpc.SessionFSSetProviderConventionsWindows { + return errors.New("SessionFS.Conventions must be either 'posix' or 'windows'") } return nil } @@ -80,7 +80,7 @@ func validateSessionFsConfig(config *SessionFsConfig) error { // // // Or connect to an existing server // client := copilot.NewClient(&copilot.ClientOptions{ -// CLIUrl: "localhost:3000", +// Connection: copilot.UriConnection{URL: "localhost:3000"}, // }) // // if err := client.Start(); err != nil { @@ -123,11 +123,11 @@ type Client struct { // RPC provides typed server-scoped RPC methods. // This field is nil until the client is connected via Start(). - RPC *rpc.ServerRpc + RPC *rpc.ServerRPC // internalRPC provides SDK-internal RPC methods (handshake helpers etc.). // Lowercase = not exported; external callers cannot reach it. - internalRPC *rpc.InternalServerRpc + internalRPC *rpc.InternalServerRPC } // NewClient creates a new Copilot runtime client with the given options. @@ -192,7 +192,7 @@ func NewClient(options *ClientOptions) *Client { if conn.URL == "" { panic("UriConnection requires a non-empty URL") } - host, port := parseCliUrl(conn.URL) + host, port := parseCLIURL(conn.URL) client.actualHost = host client.actualPort = port client.isExternalServer = true @@ -230,8 +230,8 @@ func NewClient(options *ClientOptions) *Client { if opts.OnListModels != nil { client.onListModels = opts.OnListModels } - if opts.SessionFs != nil { - if err := validateSessionFsConfig(opts.SessionFs); err != nil { + if opts.SessionFS != nil { + if err := validateSessionFSConfig(opts.SessionFS); err != nil { panic(err.Error()) } } @@ -266,19 +266,19 @@ func setEnvValue(env []string, key string, value string) []string { return append(filtered, key+"="+value) } -// parseCliUrl parses a CLI URL into host and port components. +// parseCLIURL parses a CLI URL into host and port components. // // Supports formats: "host:port", "http://host:port", "https://host:port", or just "port". // Panics if the URL format is invalid or the port is out of range. -func parseCliUrl(url string) (string, int) { +func parseCLIURL(url string) (string, int) { // Remove protocol if present - cleanUrl, _ := strings.CutPrefix(url, "https://") - cleanUrl, _ = strings.CutPrefix(cleanUrl, "http://") + cleanURL, _ := strings.CutPrefix(url, "https://") + cleanURL, _ = strings.CutPrefix(cleanURL, "http://") // Parse host:port or port format var host string var portStr string - if before, after, found := strings.Cut(cleanUrl, ":"); found { + if before, after, found := strings.Cut(cleanURL, ":"); found { host = before portStr = after } else { @@ -293,7 +293,7 @@ func parseCliUrl(url string) (string, int) { // Validate port port, err := strconv.Atoi(portStr) if err != nil || port <= 0 || port > 65535 { - panic(fmt.Sprintf("Invalid port in CLIUrl: %s", url)) + panic(fmt.Sprintf("Invalid port in CLI URL: %s", url)) } return host, port @@ -302,7 +302,7 @@ func parseCliUrl(url string) (string, int) { // Start starts the CLI server (if not using an external server) and establishes // a connection. // -// If connecting to an external server (via CLIUrl), only establishes the connection. +// If connecting to an external server (via UriConnection), only establishes the connection. // Otherwise, spawns the CLI server process and then connects. // // This method is called automatically when creating a session if AutoStart is true (default). @@ -350,19 +350,19 @@ func (c *Client) Start(ctx context.Context) error { } // If a session filesystem provider was configured, register it. - if c.options.SessionFs != nil { - req := &rpc.SessionFsSetProviderRequest{ - InitialCwd: c.options.SessionFs.InitialWorkingDirectory, - SessionStatePath: c.options.SessionFs.SessionStatePath, - Conventions: c.options.SessionFs.Conventions, + if c.options.SessionFS != nil { + req := &rpc.SessionFSSetProviderRequest{ + InitialCwd: c.options.SessionFS.InitialWorkingDirectory, + SessionStatePath: c.options.SessionFS.SessionStatePath, + Conventions: c.options.SessionFS.Conventions, } - if c.options.SessionFs.Capabilities != nil { - sqlite := c.options.SessionFs.Capabilities.Sqlite - req.Capabilities = &rpc.SessionFsSetProviderCapabilities{ + if c.options.SessionFS.Capabilities != nil { + sqlite := c.options.SessionFS.Capabilities.Sqlite + req.Capabilities = &rpc.SessionFSSetProviderCapabilities{ Sqlite: &sqlite, } } - _, err := c.RPC.SessionFs.SetProvider(ctx, req) + _, err := c.RPC.SessionFS.SetProvider(ctx, req) if err != nil { killErr := c.killProcess() c.state = stateError @@ -655,7 +655,7 @@ func (c *Client) CreateSession(ctx context.Context, config *SessionConfig) (*Ses req.Canvases = config.Canvases req.RequestCanvasRenderer = config.RequestCanvasRenderer req.RequestExtensions = config.RequestExtensions - req.ExtensionSdkPath = config.ExtensionSdkPath + req.ExtensionSDKPath = config.ExtensionSDKPath if len(config.Commands) > 0 { cmds := make([]wireCommand, 0, len(config.Commands)) @@ -673,8 +673,8 @@ func (c *Client) CreateSession(ctx context.Context, config *SessionConfig) (*Ses if config.OnAutoModeSwitchRequest != nil { req.RequestAutoModeSwitch = Bool(true) } - if config.EnableMcpApps { - req.RequestMcpApps = Bool(true) + if config.EnableMCPApps { + req.RequestMCPApps = Bool(true) } if config.Streaming != nil { @@ -689,7 +689,7 @@ func (c *Client) CreateSession(ctx context.Context, config *SessionConfig) (*Ses req.RequestUserInput = Bool(true) } if config.Hooks != nil && (config.Hooks.OnPreToolUse != nil || - config.Hooks.OnPreMcpToolCall != nil || + config.Hooks.OnPreMCPToolCall != nil || config.Hooks.OnPostToolUse != nil || config.Hooks.OnPostToolUseFailure != nil || config.Hooks.OnUserPromptSubmitted != nil || @@ -766,23 +766,23 @@ func (c *Client) CreateSession(ctx context.Context, config *SessionConfig) (*Ses c.sessions[sessionID] = s c.sessionsMux.Unlock() - if c.options.SessionFs != nil { - if config.CreateSessionFsProvider == nil { + if c.options.SessionFS != nil { + if config.CreateSessionFSProvider == nil { c.sessionsMux.Lock() delete(c.sessions, sessionID) c.sessionsMux.Unlock() - return nil, fmt.Errorf("CreateSessionFsProvider is required in session config when SessionFs is enabled in client options") + return nil, fmt.Errorf("CreateSessionFSProvider is required in session config when SessionFS is enabled in client options") } - provider := config.CreateSessionFsProvider(s) - if c.options.SessionFs.Capabilities != nil && c.options.SessionFs.Capabilities.Sqlite { - if _, ok := provider.(SessionFsSqliteProvider); !ok { + provider := config.CreateSessionFSProvider(s) + if c.options.SessionFS.Capabilities != nil && c.options.SessionFS.Capabilities.Sqlite { + if _, ok := provider.(SessionFSSqliteProvider); !ok { c.sessionsMux.Lock() delete(c.sessions, sessionID) c.sessionsMux.Unlock() - return nil, fmt.Errorf("SessionFs capabilities declare SQLite support but the provider does not implement SessionFsSqliteProvider") + return nil, fmt.Errorf("SessionFS capabilities declare SQLite support but the provider does not implement SessionFSSqliteProvider") } } - s.clientSessionApis.SessionFs = newSessionFsAdapter(provider) + s.clientSessionAPIs.SessionFS = newSessionFSAdapter(provider) } return s, nil } @@ -949,7 +949,7 @@ func (c *Client) ResumeSessionWithOptions(ctx context.Context, sessionID string, req.RequestUserInput = Bool(true) } if config.Hooks != nil && (config.Hooks.OnPreToolUse != nil || - config.Hooks.OnPreMcpToolCall != nil || + config.Hooks.OnPreMCPToolCall != nil || config.Hooks.OnPostToolUse != nil || config.Hooks.OnPostToolUseFailure != nil || config.Hooks.OnUserPromptSubmitted != nil || @@ -995,7 +995,7 @@ func (c *Client) ResumeSessionWithOptions(ctx context.Context, sessionID string, req.OpenCanvases = config.OpenCanvases req.RequestCanvasRenderer = config.RequestCanvasRenderer req.RequestExtensions = config.RequestExtensions - req.ExtensionSdkPath = config.ExtensionSdkPath + req.ExtensionSDKPath = config.ExtensionSDKPath if config.OnPermissionRequest != nil { req.RequestPermission = Bool(true) } @@ -1016,8 +1016,8 @@ func (c *Client) ResumeSessionWithOptions(ctx context.Context, sessionID string, if config.OnAutoModeSwitchRequest != nil { req.RequestAutoModeSwitch = Bool(true) } - if config.EnableMcpApps { - req.RequestMcpApps = Bool(true) + if config.EnableMCPApps { + req.RequestMCPApps = Bool(true) } traceparent, tracestate := getTraceContext(ctx) @@ -1062,23 +1062,23 @@ func (c *Client) ResumeSessionWithOptions(ctx context.Context, sessionID string, c.sessions[sessionID] = session c.sessionsMux.Unlock() - if c.options.SessionFs != nil { - if config.CreateSessionFsProvider == nil { + if c.options.SessionFS != nil { + if config.CreateSessionFSProvider == nil { c.sessionsMux.Lock() delete(c.sessions, sessionID) c.sessionsMux.Unlock() - return nil, fmt.Errorf("CreateSessionFsProvider is required in session config when SessionFs is enabled in client options") + return nil, fmt.Errorf("CreateSessionFSProvider is required in session config when SessionFS is enabled in client options") } - provider := config.CreateSessionFsProvider(session) - if c.options.SessionFs.Capabilities != nil && c.options.SessionFs.Capabilities.Sqlite { - if _, ok := provider.(SessionFsSqliteProvider); !ok { + provider := config.CreateSessionFSProvider(session) + if c.options.SessionFS.Capabilities != nil && c.options.SessionFS.Capabilities.Sqlite { + if _, ok := provider.(SessionFSSqliteProvider); !ok { c.sessionsMux.Lock() delete(c.sessions, sessionID) c.sessionsMux.Unlock() - return nil, fmt.Errorf("SessionFs capabilities declare SQLite support but the provider does not implement SessionFsSqliteProvider") + return nil, fmt.Errorf("SessionFS capabilities declare SQLite support but the provider does not implement SessionFSSqliteProvider") } } - session.clientSessionApis.SessionFs = newSessionFsAdapter(provider) + session.clientSessionAPIs.SessionFS = newSessionFSAdapter(provider) } result, err := c.client.Request("session.resume", req) @@ -1562,7 +1562,7 @@ func (c *Client) verifyProtocolVersion(ctx context.Context) error { if c.client == nil { return fmt.Errorf("client not connected") } - maxVersion := GetSdkProtocolVersion() + maxVersion := GetSDKProtocolVersion() var serverVersion *int tokenPtr := (*string)(nil) @@ -1751,8 +1751,8 @@ func (c *Client) startCLIServer(ctx context.Context) error { c.state = stateDisconnected }() }) - c.RPC = rpc.NewServerRpc(c.client) - c.internalRPC = rpc.NewInternalServerRpc(c.client) + c.RPC = rpc.NewServerRPC(c.client) + c.internalRPC = rpc.NewInternalServerRPC(c.client) c.setupNotificationHandler() c.client.Start() @@ -1904,8 +1904,8 @@ func (c *Client) connectViaTcp(ctx context.Context) error { c.state = stateDisconnected }() }) - c.RPC = rpc.NewServerRpc(c.client) - c.internalRPC = rpc.NewInternalServerRpc(c.client) + c.RPC = rpc.NewServerRPC(c.client) + c.internalRPC = rpc.NewInternalServerRPC(c.client) c.setupNotificationHandler() c.client.Start() @@ -1921,14 +1921,14 @@ func (c *Client) setupNotificationHandler() { c.client.SetRequestHandler("autoModeSwitch.request", jsonrpc2.RequestHandlerFor(c.handleAutoModeSwitchRequest)) c.client.SetRequestHandler("hooks.invoke", jsonrpc2.RequestHandlerFor(c.handleHooksInvoke)) c.client.SetRequestHandler("systemMessage.transform", jsonrpc2.RequestHandlerFor(c.handleSystemMessageTransform)) - rpc.RegisterClientSessionApiHandlers(c.client, func(sessionID string) *rpc.ClientSessionApiHandlers { + rpc.RegisterClientSessionAPIHandlers(c.client, func(sessionID string) *rpc.ClientSessionAPIHandlers { c.sessionsMux.Lock() defer c.sessionsMux.Unlock() session := c.sessions[sessionID] if session == nil { return nil } - return session.clientSessionApis + return session.clientSessionAPIs }) } diff --git a/go/client_test.go b/go/client_test.go index 3f3ca64ea..74f36b9ee 100644 --- a/go/client_test.go +++ b/go/client_test.go @@ -134,23 +134,23 @@ func TestClient_URLParsing(t *testing.T) { }) } -func TestClient_SessionFsConfig(t *testing.T) { +func TestClient_SessionFSConfig(t *testing.T) { t.Run("should throw error when InitialWorkingDirectory is missing", func(t *testing.T) { defer func() { if r := recover(); r == nil { - t.Error("Expected panic for missing SessionFs.InitialWorkingDirectory") + t.Error("Expected panic for missing SessionFS.InitialWorkingDirectory") } else { - matched, _ := regexp.MatchString("SessionFs.InitialWorkingDirectory is required", r.(string)) + matched, _ := regexp.MatchString("SessionFS.InitialWorkingDirectory is required", r.(string)) if !matched { - t.Errorf("Expected panic message to contain 'SessionFs.InitialWorkingDirectory is required', got: %v", r) + t.Errorf("Expected panic message to contain 'SessionFS.InitialWorkingDirectory is required', got: %v", r) } } }() NewClient(&ClientOptions{ - SessionFs: &SessionFsConfig{ + SessionFS: &SessionFSConfig{ SessionStatePath: "/session-state", - Conventions: rpc.SessionFsSetProviderConventionsPosix, + Conventions: rpc.SessionFSSetProviderConventionsPosix, }, }) }) @@ -158,19 +158,19 @@ func TestClient_SessionFsConfig(t *testing.T) { t.Run("should throw error when SessionStatePath is missing", func(t *testing.T) { defer func() { if r := recover(); r == nil { - t.Error("Expected panic for missing SessionFs.SessionStatePath") + t.Error("Expected panic for missing SessionFS.SessionStatePath") } else { - matched, _ := regexp.MatchString("SessionFs.SessionStatePath is required", r.(string)) + matched, _ := regexp.MatchString("SessionFS.SessionStatePath is required", r.(string)) if !matched { - t.Errorf("Expected panic message to contain 'SessionFs.SessionStatePath is required', got: %v", r) + t.Errorf("Expected panic message to contain 'SessionFS.SessionStatePath is required', got: %v", r) } } }() NewClient(&ClientOptions{ - SessionFs: &SessionFsConfig{ + SessionFS: &SessionFSConfig{ InitialWorkingDirectory: "/", - Conventions: rpc.SessionFsSetProviderConventionsPosix, + Conventions: rpc.SessionFSSetProviderConventionsPosix, }, }) }) @@ -1146,10 +1146,10 @@ func TestResumeSessionRequest_RequestElicitation(t *testing.T) { }) } -func TestCreateSessionRequest_RequestMcpApps(t *testing.T) { - t.Run("sends requestMcpApps flag when EnableMcpApps is set", func(t *testing.T) { +func TestCreateSessionRequest_RequestMCPApps(t *testing.T) { + t.Run("sends requestMCPApps flag when EnableMCPpApps is set", func(t *testing.T) { req := createSessionRequest{ - RequestMcpApps: Bool(true), + RequestMCPApps: Bool(true), } data, err := json.Marshal(req) if err != nil { @@ -1164,7 +1164,7 @@ func TestCreateSessionRequest_RequestMcpApps(t *testing.T) { } }) - t.Run("does not send requestMcpApps when EnableMcpApps is unset", func(t *testing.T) { + t.Run("does not send requestMcpApps when EnableMCPApps is unset", func(t *testing.T) { req := createSessionRequest{} data, _ := json.Marshal(req) var m map[string]any @@ -1175,11 +1175,11 @@ func TestCreateSessionRequest_RequestMcpApps(t *testing.T) { }) } -func TestResumeSessionRequest_RequestMcpApps(t *testing.T) { - t.Run("sends requestMcpApps flag when EnableMcpApps is set", func(t *testing.T) { +func TestResumeSessionRequest_RequestMCPApps(t *testing.T) { + t.Run("sends requestMcpApps flag when EnableMCPApps is set", func(t *testing.T) { req := resumeSessionRequest{ SessionID: "s1", - RequestMcpApps: Bool(true), + RequestMCPApps: Bool(true), } data, err := json.Marshal(req) if err != nil { @@ -1194,7 +1194,7 @@ func TestResumeSessionRequest_RequestMcpApps(t *testing.T) { } }) - t.Run("does not send requestMcpApps when EnableMcpApps is unset", func(t *testing.T) { + t.Run("does not send requestMcpApps when RequestMCPApps is unset", func(t *testing.T) { req := resumeSessionRequest{SessionID: "s1"} data, _ := json.Marshal(req) var m map[string]any diff --git a/go/definetool.go b/go/definetool.go index ccaa69a58..bc223dc10 100644 --- a/go/definetool.go +++ b/go/definetool.go @@ -159,7 +159,7 @@ func ConvertMCPCallToolResult(value any) (ToolResult, bool) { } binaryResults = append(binaryResults, ToolBinaryResult{ Data: data, - MimeType: mimeType, + MIMEType: mimeType, Type: "image", }) case "resource": @@ -175,7 +175,7 @@ func ConvertMCPCallToolResult(value any) (ToolResult, bool) { uri, _ := resRaw["uri"].(string) binaryResults = append(binaryResults, ToolBinaryResult{ Data: blob, - MimeType: mimeType, + MIMEType: mimeType, Type: "resource", Description: uri, }) diff --git a/go/definetool_test.go b/go/definetool_test.go index cc9fecb2c..f7161fb94 100644 --- a/go/definetool_test.go +++ b/go/definetool_test.go @@ -358,8 +358,8 @@ func TestConvertMCPCallToolResult(t *testing.T) { if result.BinaryResultsForLLM[0].Data != "base64data" { t.Errorf("Expected data 'base64data', got %q", result.BinaryResultsForLLM[0].Data) } - if result.BinaryResultsForLLM[0].MimeType != "image/png" { - t.Errorf("Expected mimeType 'image/png', got %q", result.BinaryResultsForLLM[0].MimeType) + if result.BinaryResultsForLLM[0].MIMEType != "image/png" { + t.Errorf("Expected mimeType 'image/png', got %q", result.BinaryResultsForLLM[0].MIMEType) } }) diff --git a/go/internal/e2e/agent_and_compact_rpc_e2e_test.go b/go/internal/e2e/agent_and_compact_rpc_e2e_test.go index cfb879917..c02a8571d 100644 --- a/go/internal/e2e/agent_and_compact_rpc_e2e_test.go +++ b/go/internal/e2e/agent_and_compact_rpc_e2e_test.go @@ -11,7 +11,7 @@ import ( "github.com/github/copilot-sdk/go/rpc" ) -func TestAgentSelectionRpcE2E(t *testing.T) { +func TestAgentSelectionRPCE2E(t *testing.T) { cliPath := testharness.CLIPath() if cliPath == "" { t.Fatal("CLI not found. Run 'npm install' in the nodejs directory first.") @@ -333,7 +333,7 @@ func agentSummaries(agents []rpc.AgentInfo) []string { return summaries } -func TestSessionCompactionRpcE2E(t *testing.T) { +func TestSessionCompactionRPCE2E(t *testing.T) { ctx := testharness.NewTestContext(t) client := ctx.NewClient() t.Cleanup(func() { client.ForceStop() }) diff --git a/go/internal/e2e/client_api_e2e_test.go b/go/internal/e2e/client_api_e2e_test.go index 15e97b5a7..3b0c88845 100644 --- a/go/internal/e2e/client_api_e2e_test.go +++ b/go/internal/e2e/client_api_e2e_test.go @@ -9,7 +9,7 @@ import ( ) // Mirrors dotnet/test/ClientSessionManagementTests.cs (snapshot category "client_api"). -func TestClientApiE2E(t *testing.T) { +func TestClientAPIE2E(t *testing.T) { ctx := testharness.NewTestContext(t) client := ctx.NewClient() t.Cleanup(func() { client.ForceStop() }) diff --git a/go/internal/e2e/commands_and_elicitation_e2e_test.go b/go/internal/e2e/commands_and_elicitation_e2e_test.go index 68b9badd1..d7706e436 100644 --- a/go/internal/e2e/commands_and_elicitation_e2e_test.go +++ b/go/internal/e2e/commands_and_elicitation_e2e_test.go @@ -579,7 +579,7 @@ func TestUIElicitationCallbackE2E(t *testing.T) { minLen := 1 maxLen := 20 - value, ok, err := session.UI().Input(t.Context(), "Enter value", &copilot.UiInputOptions{ + value, ok, err := session.UI().Input(t.Context(), "Enter value", &copilot.UIInputOptions{ Title: "Value", Description: "A value to test", MinLength: &minLen, diff --git a/go/internal/e2e/mcp_and_agents_e2e_test.go b/go/internal/e2e/mcp_and_agents_e2e_test.go index 4c7f29bc8..dd2ff228b 100644 --- a/go/internal/e2e/mcp_and_agents_e2e_test.go +++ b/go/internal/e2e/mcp_and_agents_e2e_test.go @@ -31,7 +31,7 @@ func TestMCPServersE2E(t *testing.T) { if session.SessionID == "" { t.Error("Expected non-empty session ID") } - waitForMCPServerStatus(t, session, "test-server", rpc.McpServerStatusConnected) + waitForMCPServerStatus(t, session, "test-server", rpc.MCPServerStatusConnected) // Simple interaction to verify session works _, err = session.Send(t.Context(), copilot.MessageOptions{ @@ -107,7 +107,7 @@ func TestMCPServersE2E(t *testing.T) { if session2.SessionID != sessionID { t.Errorf("Expected session ID %s, got %s", sessionID, session2.SessionID) } - waitForMCPServerStatus(t, session2, "test-server", rpc.McpServerStatusConnected) + waitForMCPServerStatus(t, session2, "test-server", rpc.MCPServerStatusConnected) session2.Disconnect() }) @@ -142,7 +142,7 @@ func TestMCPServersE2E(t *testing.T) { if session.SessionID == "" { t.Error("Expected non-empty session ID") } - waitForMCPServerStatus(t, session, "env-echo", rpc.McpServerStatusConnected) + waitForMCPServerStatus(t, session, "env-echo", rpc.MCPServerStatusConnected) message, err := session.SendAndWait(t.Context(), copilot.MessageOptions{ Prompt: "Use the env-echo/get_env tool to read the TEST_SECRET environment variable. Reply with just the value, nothing else.", @@ -174,8 +174,8 @@ func TestMCPServersE2E(t *testing.T) { if session.SessionID == "" { t.Error("Expected non-empty session ID") } - waitForMCPServerStatus(t, session, "server1", rpc.McpServerStatusConnected) - waitForMCPServerStatus(t, session, "server2", rpc.McpServerStatusConnected) + waitForMCPServerStatus(t, session, "server1", rpc.MCPServerStatusConnected) + waitForMCPServerStatus(t, session, "server2", rpc.MCPServerStatusConnected) session.Disconnect() }) @@ -408,7 +408,7 @@ func TestCombinedConfigurationE2E(t *testing.T) { if session.SessionID == "" { t.Error("Expected non-empty session ID") } - waitForMCPServerStatus(t, session, "shared-server", rpc.McpServerStatusConnected) + waitForMCPServerStatus(t, session, "shared-server", rpc.MCPServerStatusConnected) session.Disconnect() }) diff --git a/go/internal/e2e/mcp_server_helpers_test.go b/go/internal/e2e/mcp_server_helpers_test.go index f6cf2ad6b..54c75e08c 100644 --- a/go/internal/e2e/mcp_server_helpers_test.go +++ b/go/internal/e2e/mcp_server_helpers_test.go @@ -30,13 +30,13 @@ func testMCPServers(t *testing.T, serverNames ...string) map[string]copilot.MCPS return mcpServers } -func waitForMCPServerStatus(t *testing.T, session *copilot.Session, serverName string, expectedStatus rpc.McpServerStatus) { +func waitForMCPServerStatus(t *testing.T, session *copilot.Session, serverName string, expectedStatus rpc.MCPServerStatus) { t.Helper() var lastStatus string deadline := time.Now().Add(60 * time.Second) for time.Now().Before(deadline) { - result, err := session.RPC.Mcp.List(t.Context()) + result, err := session.RPC.MCP.List(t.Context()) if err != nil { lastStatus = err.Error() } else { diff --git a/go/internal/e2e/pending_work_resume_e2e_test.go b/go/internal/e2e/pending_work_resume_e2e_test.go index 62357c03e..6830b669c 100644 --- a/go/internal/e2e/pending_work_resume_e2e_test.go +++ b/go/internal/e2e/pending_work_resume_e2e_test.go @@ -17,7 +17,7 @@ const pendingWorkTimeout = 60 * time.Second // Mirrors dotnet/test/PendingWorkResumeTests.cs (snapshot category "pending_work_resume"). // -// Most subtests spawn a TCP server client, connect a "suspended" client through CLIUrl, +// Most subtests spawn a TCP server client, connect a "suspended" client through URIConnection // trigger pending work, then ForceStop the suspended client (preserving session state) // and resume from a fresh client with ContinuePendingWork=true. Warm-join coverage keeps // the original client connected while a second client resumes the same session. diff --git a/go/internal/e2e/permissions_e2e_test.go b/go/internal/e2e/permissions_e2e_test.go index 9d3b11da8..60a0e65f3 100644 --- a/go/internal/e2e/permissions_e2e_test.go +++ b/go/internal/e2e/permissions_e2e_test.go @@ -843,7 +843,7 @@ func TestPermissionsE2E(t *testing.T) { IncludeTempDirectory: &includeTemp, Unrestricted: &unrestricted, }, - Urls: &rpc.PermissionUrlsConfig{ + URLs: &rpc.PermissionURLsConfig{ InitialAllowed: []string{"https://example.invalid/permissions-configure"}, Unrestricted: &unrestricted, }, @@ -971,18 +971,18 @@ func TestPermissionsE2E(t *testing.T) { t.Fatalf("Expected ModifyRules(remove) Success=true") } - enableUrls, err := session.RPC.Permissions.Urls().SetUnrestrictedMode(t.Context(), &rpc.PermissionUrlsSetUnrestrictedModeParams{Enabled: true}) + enableURLs, err := session.RPC.Permissions.URLs().SetUnrestrictedMode(t.Context(), &rpc.PermissionURLsSetUnrestrictedModeParams{Enabled: true}) if err != nil { - t.Fatalf("Permissions.Urls.SetUnrestrictedMode(true) failed: %v", err) + t.Fatalf("Permissions.URLs.SetUnrestrictedMode(true) failed: %v", err) } - if !enableUrls.Success { + if !enableURLs.Success { t.Fatalf("Expected SetUnrestrictedMode(true) Success=true") } - disableUrls, err := session.RPC.Permissions.Urls().SetUnrestrictedMode(t.Context(), &rpc.PermissionUrlsSetUnrestrictedModeParams{Enabled: false}) + disableURLs, err := session.RPC.Permissions.URLs().SetUnrestrictedMode(t.Context(), &rpc.PermissionURLsSetUnrestrictedModeParams{Enabled: false}) if err != nil { - t.Fatalf("Permissions.Urls.SetUnrestrictedMode(false) failed: %v", err) + t.Fatalf("Permissions.URLs.SetUnrestrictedMode(false) failed: %v", err) } - if !disableUrls.Success { + if !disableURLs.Success { t.Fatalf("Expected SetUnrestrictedMode(false) Success=true") } }) diff --git a/go/internal/e2e/pre_mcp_tool_call_hook_e2e_test.go b/go/internal/e2e/pre_mcp_tool_call_hook_e2e_test.go index 2253f3825..6dfb5b1b7 100644 --- a/go/internal/e2e/pre_mcp_tool_call_hook_e2e_test.go +++ b/go/internal/e2e/pre_mcp_tool_call_hook_e2e_test.go @@ -10,7 +10,7 @@ import ( "github.com/github/copilot-sdk/go/internal/e2e/testharness" ) -func TestPreMcpToolCallHookE2E(t *testing.T) { +func TestPreMCPToolCallHookE2E(t *testing.T) { ctx := testharness.NewTestContext(t) client := ctx.NewClient() t.Cleanup(func() { client.ForceStop() }) @@ -35,18 +35,18 @@ func TestPreMcpToolCallHookE2E(t *testing.T) { var ( mu sync.Mutex - inputs []copilot.PreMcpToolCallHookInput + inputs []copilot.PreMCPToolCallHookInput ) session, err := client.CreateSession(t.Context(), &copilot.SessionConfig{ OnPermissionRequest: copilot.PermissionHandler.ApproveAll, MCPServers: metaEchoConfig(), Hooks: &copilot.SessionHooks{ - OnPreMcpToolCall: func(input copilot.PreMcpToolCallHookInput, invocation copilot.HookInvocation) (*copilot.PreMcpToolCallHookOutput, error) { + OnPreMCPToolCall: func(input copilot.PreMCPToolCallHookInput, invocation copilot.HookInvocation) (*copilot.PreMCPToolCallHookOutput, error) { mu.Lock() inputs = append(inputs, input) mu.Unlock() - return &copilot.PreMcpToolCallHookOutput{ + return &copilot.PreMCPToolCallHookOutput{ MetaToUse: map[string]any{ "injected": "by-hook", "source": "test", @@ -98,18 +98,18 @@ func TestPreMcpToolCallHookE2E(t *testing.T) { var ( mu sync.Mutex - inputs []copilot.PreMcpToolCallHookInput + inputs []copilot.PreMCPToolCallHookInput ) session, err := client.CreateSession(t.Context(), &copilot.SessionConfig{ OnPermissionRequest: copilot.PermissionHandler.ApproveAll, MCPServers: metaEchoConfig(), Hooks: &copilot.SessionHooks{ - OnPreMcpToolCall: func(input copilot.PreMcpToolCallHookInput, invocation copilot.HookInvocation) (*copilot.PreMcpToolCallHookOutput, error) { + OnPreMCPToolCall: func(input copilot.PreMCPToolCallHookInput, invocation copilot.HookInvocation) (*copilot.PreMCPToolCallHookOutput, error) { mu.Lock() inputs = append(inputs, input) mu.Unlock() - return &copilot.PreMcpToolCallHookOutput{ + return &copilot.PreMCPToolCallHookOutput{ MetaToUse: map[string]any{ "completely": "replaced", }, @@ -154,18 +154,18 @@ func TestPreMcpToolCallHookE2E(t *testing.T) { var ( mu sync.Mutex - inputs []copilot.PreMcpToolCallHookInput + inputs []copilot.PreMCPToolCallHookInput ) session, err := client.CreateSession(t.Context(), &copilot.SessionConfig{ OnPermissionRequest: copilot.PermissionHandler.ApproveAll, MCPServers: metaEchoConfig(), Hooks: &copilot.SessionHooks{ - OnPreMcpToolCall: func(input copilot.PreMcpToolCallHookInput, invocation copilot.HookInvocation) (*copilot.PreMcpToolCallHookOutput, error) { + OnPreMCPToolCall: func(input copilot.PreMCPToolCallHookInput, invocation copilot.HookInvocation) (*copilot.PreMCPToolCallHookOutput, error) { mu.Lock() inputs = append(inputs, input) mu.Unlock() - return &copilot.PreMcpToolCallHookOutput{ + return &copilot.PreMCPToolCallHookOutput{ MetaToUse: nil, }, nil }, diff --git a/go/internal/e2e/rpc_e2e_test.go b/go/internal/e2e/rpc_e2e_test.go index ccbf26d1d..fcf843814 100644 --- a/go/internal/e2e/rpc_e2e_test.go +++ b/go/internal/e2e/rpc_e2e_test.go @@ -9,7 +9,7 @@ import ( "github.com/github/copilot-sdk/go/rpc" ) -func TestRpcE2E(t *testing.T) { +func TestRPCE2E(t *testing.T) { cliPath := testharness.CLIPath() if cliPath == "" { t.Fatal("CLI not found. Run 'npm install' in the nodejs directory first.") @@ -113,7 +113,7 @@ func TestRpcE2E(t *testing.T) { }) } -func TestSessionRpcE2E(t *testing.T) { +func TestSessionRPCE2E(t *testing.T) { ctx := testharness.NewTestContext(t) client := ctx.NewClient() t.Cleanup(func() { client.ForceStop() }) diff --git a/go/internal/e2e/rpc_event_log_e2e_test.go b/go/internal/e2e/rpc_event_log_e2e_test.go index 998aac366..4e491026c 100644 --- a/go/internal/e2e/rpc_event_log_e2e_test.go +++ b/go/internal/e2e/rpc_event_log_e2e_test.go @@ -12,7 +12,7 @@ import ( const rpcEventLogTimeout = 30 * time.Second // Mirrors dotnet/test/E2E/RpcEventLogE2ETests.cs (snapshot category "rpc_event_log"). -func TestRpcEventLogE2E(t *testing.T) { +func TestRPCEventLogE2E(t *testing.T) { ctx := testharness.NewTestContext(t) client := ctx.NewClient() t.Cleanup(func() { client.ForceStop() }) diff --git a/go/internal/e2e/rpc_event_side_effects_e2e_test.go b/go/internal/e2e/rpc_event_side_effects_e2e_test.go index 765a570a2..ef66ec83e 100644 --- a/go/internal/e2e/rpc_event_side_effects_e2e_test.go +++ b/go/internal/e2e/rpc_event_side_effects_e2e_test.go @@ -14,7 +14,7 @@ import ( const rpcEventSideEffectsTimeout = 30 * time.Second // Mirrors dotnet/test/RpcEventSideEffectsE2ETests.cs (snapshot category "rpc_event_side_effects"). -func TestRpcEventSideEffectsE2E(t *testing.T) { +func TestRPCEventSideEffectsE2E(t *testing.T) { ctx := testharness.NewTestContext(t) client := ctx.NewClient() t.Cleanup(func() { client.ForceStop() }) diff --git a/go/internal/e2e/rpc_mcp_and_skills_e2e_test.go b/go/internal/e2e/rpc_mcp_and_skills_e2e_test.go index 9f358644b..22f53c48a 100644 --- a/go/internal/e2e/rpc_mcp_and_skills_e2e_test.go +++ b/go/internal/e2e/rpc_mcp_and_skills_e2e_test.go @@ -14,7 +14,7 @@ import ( // Mirrors dotnet/test/RpcMcpAndSkillsTests.cs (snapshot category "rpc_mcp_and_skills"). // Tests session-scoped MCP, skills, plugins, and extensions RPCs. -func TestRpcMcpAndSkillsE2E(t *testing.T) { +func TestRPCMCPAndSkillsE2E(t *testing.T) { ctx := testharness.NewTestContext(t) // --yolo auto-approves extension permission gates at the CLI level, // preventing breakage from new gates (e.g., extension-permission-access). @@ -27,7 +27,7 @@ func TestRpcMcpAndSkillsE2E(t *testing.T) { t.Run("should list and toggle session skills", func(t *testing.T) { skillName := fmt.Sprintf("session-rpc-skill-%s", randomHex(t)) - skillsDir := createMcpSkillsRpcDirectory(t, ctx.WorkDir, "session-rpc-skills", skillName, "Session skill controlled by RPC.") + skillsDir := createMCPSkillsRPCDirectory(t, ctx.WorkDir, "session-rpc-skills", skillName, "Session skill controlled by RPC.") session, err := client.CreateSession(t.Context(), &copilot.SessionConfig{ OnPermissionRequest: copilot.PermissionHandler.ApproveAll, @@ -65,7 +65,7 @@ func TestRpcMcpAndSkillsE2E(t *testing.T) { t.Run("should ensure skills are loaded and list invoked skills", func(t *testing.T) { skillName := fmt.Sprintf("ensure-rpc-skill-%s", randomHex(t)) - skillsDir := createMcpSkillsRpcDirectory(t, ctx.WorkDir, "session-rpc-skills", skillName, "Skill loaded explicitly by RPC.") + skillsDir := createMCPSkillsRPCDirectory(t, ctx.WorkDir, "session-rpc-skills", skillName, "Skill loaded explicitly by RPC.") session, err := client.CreateSession(t.Context(), &copilot.SessionConfig{ OnPermissionRequest: copilot.PermissionHandler.ApproveAll, @@ -150,10 +150,10 @@ func TestRpcMcpAndSkillsE2E(t *testing.T) { t.Fatalf("CreateSession failed: %v", err) } - waitForMCPServerStatus(t, session, serverName, rpc.McpServerStatusConnected) - result, err := session.RPC.Mcp.List(t.Context()) + waitForMCPServerStatus(t, session, serverName, rpc.MCPServerStatusConnected) + result, err := session.RPC.MCP.List(t.Context()) if err != nil { - t.Fatalf("Mcp.List failed: %v", err) + t.Fatalf("MCP.List failed: %v", err) } var found bool for _, server := range result.Servers { @@ -180,36 +180,36 @@ func TestRpcMcpAndSkillsE2E(t *testing.T) { t.Fatalf("CreateSession failed: %v", err) } - waitForMCPServerStatus(t, session, serverName, rpc.McpServerStatusConnected) - direct, err := session.RPC.Mcp.SetEnvValueMode(t.Context(), &rpc.McpSetEnvValueModeParams{Mode: rpc.McpSetEnvValueModeDetailsDirect}) + waitForMCPServerStatus(t, session, serverName, rpc.MCPServerStatusConnected) + direct, err := session.RPC.MCP.SetEnvValueMode(t.Context(), &rpc.MCPSetEnvValueModeParams{Mode: rpc.MCPSetEnvValueModeDetailsDirect}) if err != nil { - t.Fatalf("Mcp.SetEnvValueMode(direct) failed: %v", err) + t.Fatalf("MCP.SetEnvValueMode(direct) failed: %v", err) } - if direct.Mode != rpc.McpSetEnvValueModeDetailsDirect { + if direct.Mode != rpc.MCPSetEnvValueModeDetailsDirect { t.Fatalf("Expected direct env value mode, got %+v", direct) } - indirect, err := session.RPC.Mcp.SetEnvValueMode(t.Context(), &rpc.McpSetEnvValueModeParams{Mode: rpc.McpSetEnvValueModeDetailsIndirect}) + indirect, err := session.RPC.MCP.SetEnvValueMode(t.Context(), &rpc.MCPSetEnvValueModeParams{Mode: rpc.MCPSetEnvValueModeDetailsIndirect}) if err != nil { - t.Fatalf("Mcp.SetEnvValueMode(indirect) failed: %v", err) + t.Fatalf("MCP.SetEnvValueMode(indirect) failed: %v", err) } - if indirect.Mode != rpc.McpSetEnvValueModeDetailsIndirect { + if indirect.Mode != rpc.MCPSetEnvValueModeDetailsIndirect { t.Fatalf("Expected indirect env value mode, got %+v", indirect) } - removeGitHub, err := session.RPC.Mcp.RemoveGitHub(t.Context()) + removeGitHub, err := session.RPC.MCP.RemoveGitHub(t.Context()) if err != nil { - t.Fatalf("Mcp.RemoveGitHub failed: %v", err) + t.Fatalf("MCP.RemoveGitHub failed: %v", err) } if removeGitHub.Removed { t.Fatalf("Expected RemoveGitHub=false for explicitly configured server, got %+v", removeGitHub) } - servers, err := session.RPC.Mcp.List(t.Context()) + servers, err := session.RPC.MCP.List(t.Context()) if err != nil { - t.Fatalf("Mcp.List failed: %v", err) + t.Fatalf("MCP.List failed: %v", err) } var stillConnected bool for _, server := range servers.Servers { - if server.Name == serverName && server.Status == rpc.McpServerStatusConnected { + if server.Name == serverName && server.Status == rpc.MCPServerStatusConnected { stillConnected = true break } @@ -228,27 +228,27 @@ func TestRpcMcpAndSkillsE2E(t *testing.T) { if err != nil { t.Fatalf("CreateSession failed: %v", err) } - waitForMCPServerStatus(t, session, serverName, rpc.McpServerStatusConnected) + waitForMCPServerStatus(t, session, serverName, rpc.MCPServerStatusConnected) - cancelMissing, err := session.RPC.Mcp.CancelSamplingExecution(t.Context(), &rpc.McpCancelSamplingExecutionParams{RequestID: "missing-" + randomHex(t)}) + cancelMissing, err := session.RPC.MCP.CancelSamplingExecution(t.Context(), &rpc.MCPCancelSamplingExecutionParams{RequestID: "missing-" + randomHex(t)}) if err != nil { - t.Fatalf("Mcp.CancelSamplingExecution failed: %v", err) + t.Fatalf("MCP.CancelSamplingExecution failed: %v", err) } if cancelMissing.Cancelled { t.Fatal("Expected cancelling missing sampling execution to report Cancelled=false") } - result, err := session.RPC.Mcp.ExecuteSampling(t.Context(), &rpc.McpExecuteSamplingParams{ + result, err := session.RPC.MCP.ExecuteSampling(t.Context(), &rpc.MCPExecuteSamplingParams{ RequestID: "sampling-" + randomHex(t), ServerName: "missing-sampling-server", - McpRequestID: "mcp-request-" + randomHex(t), - Request: rpc.McpExecuteSamplingRequest{}, + MCPRequestID: "mcp-request-" + randomHex(t), + Request: rpc.MCPExecuteSamplingRequest{}, }) if err != nil { - assertRpcError(t, "Mcp.ExecuteSampling", func() error { return err }, "sampling") + assertRPCError(t, "MCP.ExecuteSampling", func() error { return err }, "sampling") return } - if result.Action != rpc.McpSamplingExecutionActionFailure { + if result.Action != rpc.MCPSamplingExecutionActionFailure { t.Fatalf("Expected sampling failure action, got %+v", result) } if result.Result != nil || result.Error == nil || strings.TrimSpace(*result.Error) == "" { @@ -306,8 +306,8 @@ func TestRpcMcpAndSkillsE2E(t *testing.T) { } }) - t.Run("should round trip mcp app host context", func(t *testing.T) { - mcpAppsClient := createMcpAppsClient(ctx) + t.Run("should round trip MCP app host context", func(t *testing.T) { + mcpAppsClient := createMCPAppsClient(ctx) t.Cleanup(func() { mcpAppsClient.ForceStop() }) session, err := mcpAppsClient.CreateSession(t.Context(), &copilot.SessionConfig{ OnPermissionRequest: copilot.PermissionHandler.ApproveAll, @@ -316,14 +316,14 @@ func TestRpcMcpAndSkillsE2E(t *testing.T) { t.Fatalf("CreateSession failed: %v", err) } - displayMode := rpc.McpAppsSetHostContextDetailsDisplayModeInline - platform := rpc.McpAppsSetHostContextDetailsPlatformDesktop - theme := rpc.McpAppsSetHostContextDetailsThemeDark - if _, err := session.RPC.Mcp.Apps().SetHostContext(t.Context(), &rpc.McpAppsSetHostContextRequest{ - Context: rpc.McpAppsSetHostContextDetails{ - AvailableDisplayModes: []rpc.McpAppsSetHostContextDetailsAvailableDisplayMode{ - rpc.McpAppsSetHostContextDetailsAvailableDisplayModeInline, - rpc.McpAppsSetHostContextDetailsAvailableDisplayModeFullscreen, + displayMode := rpc.MCPAppsSetHostContextDetailsDisplayModeInline + platform := rpc.MCPAppsSetHostContextDetailsPlatformDesktop + theme := rpc.MCPAppsSetHostContextDetailsThemeDark + if _, err := session.RPC.MCP.Apps().SetHostContext(t.Context(), &rpc.MCPAppsSetHostContextRequest{ + Context: rpc.MCPAppsSetHostContextDetails{ + AvailableDisplayModes: []rpc.MCPAppsSetHostContextDetailsAvailableDisplayMode{ + rpc.MCPAppsSetHostContextDetailsAvailableDisplayModeInline, + rpc.MCPAppsSetHostContextDetailsAvailableDisplayModeFullscreen, }, DisplayMode: &displayMode, Locale: rpcPtr("en-GB"), @@ -333,12 +333,12 @@ func TestRpcMcpAndSkillsE2E(t *testing.T) { UserAgent: rpcPtr("go-sdk-e2e"), }, }); err != nil { - t.Fatalf("Mcp.Apps.SetHostContext failed: %v", err) + t.Fatalf("MCP.Apps.SetHostContext failed: %v", err) } - result, err := session.RPC.Mcp.Apps().GetHostContext(t.Context()) + result, err := session.RPC.MCP.Apps().GetHostContext(t.Context()) if err != nil { - t.Fatalf("Mcp.Apps.GetHostContext failed: %v", err) + t.Fatalf("MCP.Apps.GetHostContext failed: %v", err) } if result.Context.DisplayMode == nil || string(*result.Context.DisplayMode) != "inline" || result.Context.Locale == nil || *result.Context.Locale != "en-GB" || @@ -362,7 +362,7 @@ func TestRpcMcpAndSkillsE2E(t *testing.T) { servers[serverName] = stdio } - mcpAppsClient := createMcpAppsClient(ctx) + mcpAppsClient := createMCPAppsClient(ctx) t.Cleanup(func() { mcpAppsClient.ForceStop() }) session, err := mcpAppsClient.CreateSession(t.Context(), &copilot.SessionConfig{ OnPermissionRequest: copilot.PermissionHandler.ApproveAll, @@ -371,31 +371,31 @@ func TestRpcMcpAndSkillsE2E(t *testing.T) { if err != nil { t.Fatalf("CreateSession failed: %v", err) } - waitForMCPServerStatus(t, session, serverName, rpc.McpServerStatusConnected) - waitForMCPServerStatus(t, session, otherServerName, rpc.McpServerStatusConnected) + waitForMCPServerStatus(t, session, serverName, rpc.MCPServerStatusConnected) + waitForMCPServerStatus(t, session, otherServerName, rpc.MCPServerStatusConnected) - diagnose, err := session.RPC.Mcp.Apps().Diagnose(t.Context(), &rpc.McpAppsDiagnoseRequest{ServerName: serverName}) + diagnose, err := session.RPC.MCP.Apps().Diagnose(t.Context(), &rpc.MCPAppsDiagnoseRequest{ServerName: serverName}) if err != nil { - t.Fatalf("Mcp.Apps.Diagnose failed: %v", err) + t.Fatalf("MCP.Apps.Diagnose failed: %v", err) } if !diagnose.Server.Connected || diagnose.Server.ToolCount < 1 { t.Fatalf("Expected connected MCP app diagnose result with tools, got %+v", diagnose) } - assertMcpAppsResultOrImplementedError(t, "Mcp.Apps.ListTools(self)", func() (any, error) { - return session.RPC.Mcp.Apps().ListTools(t.Context(), &rpc.McpAppsListToolsRequest{ + assertMCPAppsResultOrImplementedError(t, "MCP.Apps.ListTools(self)", func() (any, error) { + return session.RPC.MCP.Apps().ListTools(t.Context(), &rpc.MCPAppsListToolsRequest{ ServerName: serverName, OriginServerName: serverName, }) }) - assertMcpAppsResultOrImplementedError(t, "Mcp.Apps.ListTools(other)", func() (any, error) { - return session.RPC.Mcp.Apps().ListTools(t.Context(), &rpc.McpAppsListToolsRequest{ + assertMCPAppsResultOrImplementedError(t, "MCP.Apps.ListTools(other)", func() (any, error) { + return session.RPC.MCP.Apps().ListTools(t.Context(), &rpc.MCPAppsListToolsRequest{ ServerName: serverName, OriginServerName: otherServerName, }) }) - assertMcpAppsResultOrImplementedError(t, "Mcp.Apps.CallTool", func() (any, error) { - return session.RPC.Mcp.Apps().CallTool(t.Context(), &rpc.McpAppsCallToolRequest{ + assertMCPAppsResultOrImplementedError(t, "MCP.Apps.CallTool", func() (any, error) { + return session.RPC.MCP.Apps().CallTool(t.Context(), &rpc.MCPAppsCallToolRequest{ ServerName: serverName, OriginServerName: serverName, ToolName: "get_env", @@ -406,7 +406,7 @@ func TestRpcMcpAndSkillsE2E(t *testing.T) { t.Run("should report error when mcp app resource is not available", func(t *testing.T) { const serverName = "rpc-apps-resource-server" - mcpAppsClient := createMcpAppsClient(ctx) + mcpAppsClient := createMCPAppsClient(ctx) t.Cleanup(func() { mcpAppsClient.ForceStop() }) session, err := mcpAppsClient.CreateSession(t.Context(), &copilot.SessionConfig{ OnPermissionRequest: copilot.PermissionHandler.ApproveAll, @@ -415,9 +415,9 @@ func TestRpcMcpAndSkillsE2E(t *testing.T) { if err != nil { t.Fatalf("CreateSession failed: %v", err) } - waitForMCPServerStatus(t, session, serverName, rpc.McpServerStatusConnected) + waitForMCPServerStatus(t, session, serverName, rpc.MCPServerStatusConnected) - _, err = session.RPC.Mcp.Apps().ReadResource(t.Context(), &rpc.McpAppsReadResourceRequest{ + _, err = session.RPC.MCP.Apps().ReadResource(t.Context(), &rpc.MCPAppsReadResourceRequest{ ServerName: serverName, URI: "ui://missing-resource", }) @@ -439,20 +439,20 @@ func TestRpcMcpAndSkillsE2E(t *testing.T) { t.Fatalf("CreateSession failed: %v", err) } - assertRpcError(t, "Mcp.Enable", func() error { - _, e := session.RPC.Mcp.Enable(t.Context(), &rpc.McpEnableRequest{ServerName: "missing-server"}) + assertRPCError(t, "MCP.Enable", func() error { + _, e := session.RPC.MCP.Enable(t.Context(), &rpc.MCPEnableRequest{ServerName: "missing-server"}) return e }, "no mcp host initialized") - assertRpcError(t, "Mcp.Disable", func() error { - _, e := session.RPC.Mcp.Disable(t.Context(), &rpc.McpDisableRequest{ServerName: "missing-server"}) + assertRPCError(t, "MCP.Disable", func() error { + _, e := session.RPC.MCP.Disable(t.Context(), &rpc.MCPDisableRequest{ServerName: "missing-server"}) return e }, "no mcp host initialized") - assertRpcError(t, "Mcp.Reload", func() error { - _, e := session.RPC.Mcp.Reload(t.Context()) + assertRPCError(t, "MCP.Reload", func() error { + _, e := session.RPC.MCP.Reload(t.Context()) return e }, "mcp config reload not available") - assertRpcError(t, "Mcp.Oauth.Login", func() error { - _, e := session.RPC.Mcp.Oauth().Login(t.Context(), &rpc.McpOauthLoginRequest{ServerName: "missing-server"}) + assertRPCError(t, "MCP.Oauth.Login", func() error { + _, e := session.RPC.MCP.Oauth().Login(t.Context(), &rpc.MCPOauthLoginRequest{ServerName: "missing-server"}) return e }, "mcp host is not available") }) @@ -466,10 +466,10 @@ func TestRpcMcpAndSkillsE2E(t *testing.T) { if err != nil { t.Fatalf("CreateSession failed: %v", err) } - waitForMCPServerStatus(t, session, serverName, rpc.McpServerStatusConnected) + waitForMCPServerStatus(t, session, serverName, rpc.MCPServerStatusConnected) - assertRpcError(t, "Mcp.Oauth.Login", func() error { - _, e := session.RPC.Mcp.Oauth().Login(t.Context(), &rpc.McpOauthLoginRequest{ServerName: "missing-server"}) + assertRPCError(t, "MCP.Oauth.Login", func() error { + _, e := session.RPC.MCP.Oauth().Login(t.Context(), &rpc.MCPOauthLoginRequest{ServerName: "missing-server"}) return e }, "is not configured") }) @@ -483,13 +483,13 @@ func TestRpcMcpAndSkillsE2E(t *testing.T) { if err != nil { t.Fatalf("CreateSession failed: %v", err) } - waitForMCPServerStatus(t, session, serverName, rpc.McpServerStatusConnected) + waitForMCPServerStatus(t, session, serverName, rpc.MCPServerStatusConnected) force := true clientName := "SDK E2E" callback := "Done" - assertRpcError(t, "Mcp.Oauth.Login", func() error { - _, e := session.RPC.Mcp.Oauth().Login(t.Context(), &rpc.McpOauthLoginRequest{ + assertRPCError(t, "MCP.Oauth.Login", func() error { + _, e := session.RPC.MCP.Oauth().Login(t.Context(), &rpc.MCPOauthLoginRequest{ ServerName: serverName, ForceReauth: &force, ClientName: &clientName, @@ -507,24 +507,24 @@ func TestRpcMcpAndSkillsE2E(t *testing.T) { t.Fatalf("CreateSession failed: %v", err) } - assertRpcError(t, "Extensions.Enable", func() error { + assertRPCError(t, "Extensions.Enable", func() error { _, e := session.RPC.Extensions.Enable(t.Context(), &rpc.ExtensionsEnableRequest{ID: "missing-extension"}) return e }, "extensions not available") - assertRpcError(t, "Extensions.Disable", func() error { + assertRPCError(t, "Extensions.Disable", func() error { _, e := session.RPC.Extensions.Disable(t.Context(), &rpc.ExtensionsDisableRequest{ID: "missing-extension"}) return e }, "extensions not available") - assertRpcError(t, "Extensions.Reload", func() error { + assertRPCError(t, "Extensions.Reload", func() error { _, e := session.RPC.Extensions.Reload(t.Context()) return e }, "extensions not available") }) } -// createMcpSkillsRpcDirectory creates a unique skills directory containing a single +// createMCPSkillsRPCDirectory creates a unique skills directory containing a single // SKILL.md and returns the parent directory suitable for SkillDirectories. -func createMcpSkillsRpcDirectory(t *testing.T, workDir, baseName, skillName, description string) string { +func createMCPSkillsRPCDirectory(t *testing.T, workDir, baseName, skillName, description string) string { t.Helper() skillsDir := filepath.Join(workDir, baseName, randomHex(t)) if err := os.MkdirAll(skillsDir, 0755); err != nil { @@ -570,13 +570,13 @@ func assertSkillState(t *testing.T, list *rpc.SkillList, name string, enabled bo return matched } -func createMcpAppsClient(ctx *testharness.TestContext) *copilot.Client { +func createMCPAppsClient(ctx *testharness.TestContext) *copilot.Client { return ctx.NewClient(func(opts *copilot.ClientOptions) { opts.Env = append(opts.Env, "COPILOT_MCP_APPS=true", "MCP_APPS=true") }) } -func assertMcpAppsResultOrImplementedError(t *testing.T, name string, action func() (any, error)) { +func assertMCPAppsResultOrImplementedError(t *testing.T, name string, action func() (any, error)) { t.Helper() result, err := action() if err == nil { @@ -584,11 +584,11 @@ func assertMcpAppsResultOrImplementedError(t *testing.T, name string, action fun t.Fatalf("%s returned nil result", name) } switch value := result.(type) { - case *rpc.McpAppsListToolsResult: + case *rpc.MCPAppsListToolsResult: if value.Tools == nil { t.Fatalf("%s returned nil Tools", name) } - case *rpc.SessionMcpAppsCallToolResult: + case *rpc.SessionMCPAppsCallToolResult: if value == nil { t.Fatalf("%s returned nil CallTool result", name) } @@ -603,7 +603,7 @@ func assertMcpAppsResultOrImplementedError(t *testing.T, name string, action fun } } -func assertRpcError(t *testing.T, name string, action func() error, expectedSubstring string) { +func assertRPCError(t *testing.T, name string, action func() error, expectedSubstring string) { t.Helper() err := action() if err == nil { diff --git a/go/internal/e2e/rpc_mcp_config_e2e_test.go b/go/internal/e2e/rpc_mcp_config_e2e_test.go index 528c92080..4e950fa3c 100644 --- a/go/internal/e2e/rpc_mcp_config_e2e_test.go +++ b/go/internal/e2e/rpc_mcp_config_e2e_test.go @@ -9,9 +9,9 @@ import ( ) // Mirrors dotnet/test/RpcMcpConfigTests.cs (snapshot category "rpc_mcp_config"). -// Tests server-scoped MCP configuration management via mcp.config.* RPCs. -func TestRpcMcpConfigE2E(t *testing.T) { - t.Run("should call server mcp config rpcs", func(t *testing.T) { +// Tests server-scoped MCP configuration management via MCP.Config.* RPCs. +func TestRPCMCPConfigE2E(t *testing.T) { + t.Run("should call server MCP config rpcs", func(t *testing.T) { ctx := testharness.NewTestContext(t) client := ctx.NewClient() t.Cleanup(func() { client.ForceStop() }) @@ -21,18 +21,18 @@ func TestRpcMcpConfigE2E(t *testing.T) { serverName := fmt.Sprintf("sdk-test-%s", randomHex(t)) - baseConfig := &rpc.McpServerConfigStdio{ + baseConfig := &rpc.MCPServerConfigStdio{ Command: "node", Args: []string{"-v"}, } - updatedConfig := &rpc.McpServerConfigStdio{ + updatedConfig := &rpc.MCPServerConfigStdio{ Command: "node", Args: []string{"--version"}, } - initial, err := client.RPC.Mcp.Config().List(t.Context()) + initial, err := client.RPC.MCP.Config().List(t.Context()) if err != nil { - t.Fatalf("Mcp.Config.List (initial) failed: %v", err) + t.Fatalf("MCP.Config.List (initial) failed: %v", err) } if _, present := initial.Servers[serverName]; present { t.Fatalf("Did not expect %q to be present initially", serverName) @@ -40,40 +40,40 @@ func TestRpcMcpConfigE2E(t *testing.T) { // Best-effort cleanup if a subtest assertion fails mid-flight. t.Cleanup(func() { - _, _ = client.RPC.Mcp.Config().Remove(t.Context(), &rpc.McpConfigRemoveRequest{Name: serverName}) + _, _ = client.RPC.MCP.Config().Remove(t.Context(), &rpc.MCPConfigRemoveRequest{Name: serverName}) }) - if _, err := client.RPC.Mcp.Config().Add(t.Context(), &rpc.McpConfigAddRequest{ + if _, err := client.RPC.MCP.Config().Add(t.Context(), &rpc.MCPConfigAddRequest{ Name: serverName, Config: baseConfig, }); err != nil { - t.Fatalf("Mcp.Config.Add failed: %v", err) + t.Fatalf("MCP.Config.Add failed: %v", err) } - afterAdd, err := client.RPC.Mcp.Config().List(t.Context()) + afterAdd, err := client.RPC.MCP.Config().List(t.Context()) if err != nil { - t.Fatalf("Mcp.Config.List (after add) failed: %v", err) + t.Fatalf("MCP.Config.List (after add) failed: %v", err) } if _, present := afterAdd.Servers[serverName]; !present { t.Fatalf("Expected %q to be present after Add", serverName) } - if _, err := client.RPC.Mcp.Config().Update(t.Context(), &rpc.McpConfigUpdateRequest{ + if _, err := client.RPC.MCP.Config().Update(t.Context(), &rpc.MCPConfigUpdateRequest{ Name: serverName, Config: updatedConfig, }); err != nil { - t.Fatalf("Mcp.Config.Update failed: %v", err) + t.Fatalf("MCP.Config.Update failed: %v", err) } - afterUpdate, err := client.RPC.Mcp.Config().List(t.Context()) + afterUpdate, err := client.RPC.MCP.Config().List(t.Context()) if err != nil { - t.Fatalf("Mcp.Config.List (after update) failed: %v", err) + t.Fatalf("MCP.Config.List (after update) failed: %v", err) } updated, present := afterUpdate.Servers[serverName] if !present { t.Fatalf("Expected %q to still be present after Update", serverName) } - updatedLocal, ok := updated.(*rpc.McpServerConfigStdio) + updatedLocal, ok := updated.(*rpc.MCPServerConfigStdio) if !ok { t.Fatalf("Expected local MCP config, got %T", updated) } @@ -84,27 +84,27 @@ func TestRpcMcpConfigE2E(t *testing.T) { t.Errorf("Expected args[0]='--version', got %v", updatedLocal.Args) } - if _, err := client.RPC.Mcp.Config().Disable(t.Context(), &rpc.McpConfigDisableRequest{Names: []string{serverName}}); err != nil { - t.Fatalf("Mcp.Config.Disable failed: %v", err) + if _, err := client.RPC.MCP.Config().Disable(t.Context(), &rpc.MCPConfigDisableRequest{Names: []string{serverName}}); err != nil { + t.Fatalf("MCP.Config.Disable failed: %v", err) } - if _, err := client.RPC.Mcp.Config().Enable(t.Context(), &rpc.McpConfigEnableRequest{Names: []string{serverName}}); err != nil { - t.Fatalf("Mcp.Config.Enable failed: %v", err) + if _, err := client.RPC.MCP.Config().Enable(t.Context(), &rpc.MCPConfigEnableRequest{Names: []string{serverName}}); err != nil { + t.Fatalf("MCP.Config.Enable failed: %v", err) } - if _, err := client.RPC.Mcp.Config().Remove(t.Context(), &rpc.McpConfigRemoveRequest{Name: serverName}); err != nil { - t.Fatalf("Mcp.Config.Remove failed: %v", err) + if _, err := client.RPC.MCP.Config().Remove(t.Context(), &rpc.MCPConfigRemoveRequest{Name: serverName}); err != nil { + t.Fatalf("MCP.Config.Remove failed: %v", err) } - afterRemove, err := client.RPC.Mcp.Config().List(t.Context()) + afterRemove, err := client.RPC.MCP.Config().List(t.Context()) if err != nil { - t.Fatalf("Mcp.Config.List (after remove) failed: %v", err) + t.Fatalf("MCP.Config.List (after remove) failed: %v", err) } if _, present := afterRemove.Servers[serverName]; present { t.Errorf("Expected %q to be removed", serverName) } }) - t.Run("should round trip http mcp oauth config rpc", func(t *testing.T) { + t.Run("should round trip http MCP oauth config rpc", func(t *testing.T) { ctx := testharness.NewTestContext(t) client := ctx.NewClient() t.Cleanup(func() { client.ForceStop() }) @@ -114,19 +114,19 @@ func TestRpcMcpConfigE2E(t *testing.T) { serverName := fmt.Sprintf("sdk-http-oauth-%s", randomHex(t)) - httpType := rpc.McpServerConfigHTTPTypeHTTP + httpType := rpc.MCPServerConfigHTTPTypeHTTP urlBase := "https://example.com/mcp" urlUpdated := "https://example.com/updated-mcp" clientID := "client-id" clientIDUpdated := "updated-client-id" - grantClientCreds := rpc.McpServerConfigHTTPOauthGrantTypeClientCredentials - grantAuthCode := rpc.McpServerConfigHTTPOauthGrantTypeAuthorizationCode + grantClientCreds := rpc.MCPServerConfigHTTPOauthGrantTypeClientCredentials + grantAuthCode := rpc.MCPServerConfigHTTPOauthGrantTypeAuthorizationCode var publicFalse = false var publicTrue = true var timeoutBase int64 = 3000 var timeoutUpdated int64 = 4000 - baseConfig := &rpc.McpServerConfigHTTP{ + baseConfig := &rpc.MCPServerConfigHTTP{ Type: &httpType, URL: urlBase, Headers: map[string]string{"Authorization": "Bearer token"}, @@ -136,7 +136,7 @@ func TestRpcMcpConfigE2E(t *testing.T) { Tools: []string{"*"}, Timeout: &timeoutBase, } - updatedConfig := &rpc.McpServerConfigHTTP{ + updatedConfig := &rpc.MCPServerConfigHTTP{ Type: &httpType, URL: urlUpdated, OauthClientID: &clientIDUpdated, @@ -147,25 +147,25 @@ func TestRpcMcpConfigE2E(t *testing.T) { } t.Cleanup(func() { - _, _ = client.RPC.Mcp.Config().Remove(t.Context(), &rpc.McpConfigRemoveRequest{Name: serverName}) + _, _ = client.RPC.MCP.Config().Remove(t.Context(), &rpc.MCPConfigRemoveRequest{Name: serverName}) }) - if _, err := client.RPC.Mcp.Config().Add(t.Context(), &rpc.McpConfigAddRequest{ + if _, err := client.RPC.MCP.Config().Add(t.Context(), &rpc.MCPConfigAddRequest{ Name: serverName, Config: baseConfig, }); err != nil { - t.Fatalf("Mcp.Config.Add failed: %v", err) + t.Fatalf("MCP.Config.Add failed: %v", err) } - afterAdd, err := client.RPC.Mcp.Config().List(t.Context()) + afterAdd, err := client.RPC.MCP.Config().List(t.Context()) if err != nil { - t.Fatalf("Mcp.Config.List (after add) failed: %v", err) + t.Fatalf("MCP.Config.List (after add) failed: %v", err) } added, present := afterAdd.Servers[serverName] if !present { t.Fatalf("Expected %q to be present after Add", serverName) } - addedHTTP, ok := added.(*rpc.McpServerConfigHTTP) + addedHTTP, ok := added.(*rpc.MCPServerConfigHTTP) if !ok { t.Fatalf("Expected HTTP MCP config, got %T", added) } @@ -188,21 +188,21 @@ func TestRpcMcpConfigE2E(t *testing.T) { t.Errorf("Expected oauthGrantType='client_credentials', got %v", addedHTTP.OauthGrantType) } - if _, err := client.RPC.Mcp.Config().Update(t.Context(), &rpc.McpConfigUpdateRequest{ + if _, err := client.RPC.MCP.Config().Update(t.Context(), &rpc.MCPConfigUpdateRequest{ Name: serverName, Config: updatedConfig, }); err != nil { - t.Fatalf("Mcp.Config.Update failed: %v", err) + t.Fatalf("MCP.Config.Update failed: %v", err) } - afterUpdate, err := client.RPC.Mcp.Config().List(t.Context()) + afterUpdate, err := client.RPC.MCP.Config().List(t.Context()) if err != nil { - t.Fatalf("Mcp.Config.List (after update) failed: %v", err) + t.Fatalf("MCP.Config.List (after update) failed: %v", err) } updated, present := afterUpdate.Servers[serverName] if !present { t.Fatalf("Expected %q to still be present after Update", serverName) } - updatedHTTP, ok := updated.(*rpc.McpServerConfigHTTP) + updatedHTTP, ok := updated.(*rpc.MCPServerConfigHTTP) if !ok { t.Fatalf("Expected HTTP MCP config, got %T", updated) } @@ -225,13 +225,13 @@ func TestRpcMcpConfigE2E(t *testing.T) { t.Errorf("Expected timeout=4000, got %v", updatedHTTP.Timeout) } - if _, err := client.RPC.Mcp.Config().Remove(t.Context(), &rpc.McpConfigRemoveRequest{Name: serverName}); err != nil { - t.Fatalf("Mcp.Config.Remove failed: %v", err) + if _, err := client.RPC.MCP.Config().Remove(t.Context(), &rpc.MCPConfigRemoveRequest{Name: serverName}); err != nil { + t.Fatalf("MCP.Config.Remove failed: %v", err) } - afterRemove, err := client.RPC.Mcp.Config().List(t.Context()) + afterRemove, err := client.RPC.MCP.Config().List(t.Context()) if err != nil { - t.Fatalf("Mcp.Config.List (after remove) failed: %v", err) + t.Fatalf("MCP.Config.List (after remove) failed: %v", err) } if _, present := afterRemove.Servers[serverName]; present { t.Errorf("Expected %q to be removed", serverName) diff --git a/go/internal/e2e/rpc_queue_e2e_test.go b/go/internal/e2e/rpc_queue_e2e_test.go index ff567fab1..7ab0b1793 100644 --- a/go/internal/e2e/rpc_queue_e2e_test.go +++ b/go/internal/e2e/rpc_queue_e2e_test.go @@ -11,7 +11,7 @@ import ( ) // Mirrors dotnet/test/E2E/RpcQueueE2ETests.cs (snapshot category "rpc_queue"). -func TestRpcQueueE2E(t *testing.T) { +func TestRPCQueueE2E(t *testing.T) { ctx := testharness.NewTestContext(t) client := ctx.NewClient() t.Cleanup(func() { client.ForceStop() }) diff --git a/go/internal/e2e/rpc_remote_e2e_test.go b/go/internal/e2e/rpc_remote_e2e_test.go index b1243526b..52b8beeda 100644 --- a/go/internal/e2e/rpc_remote_e2e_test.go +++ b/go/internal/e2e/rpc_remote_e2e_test.go @@ -11,7 +11,7 @@ import ( ) // Mirrors dotnet/test/E2E/RpcRemoteE2ETests.cs (snapshot category "rpc_remote"). -func TestRpcRemoteE2E(t *testing.T) { +func TestRPCRemoteE2E(t *testing.T) { ctx := testharness.NewTestContext(t) client := ctx.NewClient() t.Cleanup(func() { client.ForceStop() }) diff --git a/go/internal/e2e/rpc_schedule_e2e_test.go b/go/internal/e2e/rpc_schedule_e2e_test.go index 359cd20e1..a20d48174 100644 --- a/go/internal/e2e/rpc_schedule_e2e_test.go +++ b/go/internal/e2e/rpc_schedule_e2e_test.go @@ -10,7 +10,7 @@ import ( ) // Mirrors dotnet/test/E2E/RpcScheduleE2ETests.cs (snapshot category "rpc_schedule"). -func TestRpcScheduleE2E(t *testing.T) { +func TestRPCScheduleE2E(t *testing.T) { ctx := testharness.NewTestContext(t) client := ctx.NewClient() t.Cleanup(func() { client.ForceStop() }) diff --git a/go/internal/e2e/rpc_server_e2e_test.go b/go/internal/e2e/rpc_server_e2e_test.go index 66288aa0e..1b5a2407e 100644 --- a/go/internal/e2e/rpc_server_e2e_test.go +++ b/go/internal/e2e/rpc_server_e2e_test.go @@ -15,7 +15,7 @@ import ( // Mirrors dotnet/test/RpcServerTests.cs (snapshot category "rpc_server"). // Tests server-scoped (non-session) RPCs. -func TestRpcServerE2E(t *testing.T) { +func TestRPCServerE2E(t *testing.T) { t.Run("should call rpc ping with typed params and result", func(t *testing.T) { ctx := testharness.NewTestContext(t) ctx.ConfigureForTest(t) @@ -161,17 +161,17 @@ func TestRpcServerE2E(t *testing.T) { t.Fatalf("Start failed: %v", err) } - result, err := client.RPC.SessionFs.SetProvider(t.Context(), &rpc.SessionFsSetProviderRequest{ + result, err := client.RPC.SessionFS.SetProvider(t.Context(), &rpc.SessionFSSetProviderRequest{ InitialCwd: "/", SessionStatePath: "/session-state", - Conventions: rpc.SessionFsSetProviderConventionsPosix, - Capabilities: &rpc.SessionFsSetProviderCapabilities{Sqlite: rpcPtr(true)}, + Conventions: rpc.SessionFSSetProviderConventionsPosix, + Capabilities: &rpc.SessionFSSetProviderCapabilities{Sqlite: rpcPtr(true)}, }) if err != nil { - t.Fatalf("SessionFs.SetProvider failed: %v", err) + t.Fatalf("SessionFS.SetProvider failed: %v", err) } if !result.Success { - t.Fatalf("Expected SessionFs.SetProvider Success=true, got %+v", result) + t.Fatalf("Expected SessionFS.SetProvider Success=true, got %+v", result) } }) @@ -281,7 +281,7 @@ func TestRpcServerE2E(t *testing.T) { t.Fatalf("Expected non-negative size for %q, got %d", sessionID, size) } - inUse, err := client.RPC.Sessions.CheckInUse(t.Context(), &rpc.SessionsCheckInUseRequest{SessionIds: []string{sessionID, missingSessionID}}) + inUse, err := client.RPC.Sessions.CheckInUse(t.Context(), &rpc.SessionsCheckInUseRequest{SessionIDs: []string{sessionID, missingSessionID}}) if err != nil { t.Fatalf("Sessions.CheckInUse failed: %v", err) } @@ -379,7 +379,7 @@ func TestRpcServerE2E(t *testing.T) { if _, err := client.RPC.Sessions.ReleaseLock(t.Context(), &rpc.SessionsReleaseLockRequest{SessionID: sessionID}); err != nil { t.Fatalf("Sessions.ReleaseLock failed: %v", err) } - inUse, err := client.RPC.Sessions.CheckInUse(t.Context(), &rpc.SessionsCheckInUseRequest{SessionIds: []string{sessionID}}) + inUse, err := client.RPC.Sessions.CheckInUse(t.Context(), &rpc.SessionsCheckInUseRequest{SessionIDs: []string{sessionID}}) if err != nil { t.Fatalf("Sessions.CheckInUse failed: %v", err) } @@ -419,7 +419,7 @@ func TestRpcServerE2E(t *testing.T) { OlderThanDays: 0, DryRun: rpcPtr(true), IncludeNamed: rpcPtr(true), - ExcludeSessionIds: []string{}, + ExcludeSessionIDs: []string{}, }) if err != nil { t.Fatalf("Sessions.PruneOld failed: %v", err) @@ -435,7 +435,7 @@ func TestRpcServerE2E(t *testing.T) { } deleted, err := client.RPC.Sessions.BulkDelete(t.Context(), &rpc.SessionsBulkDeleteRequest{ - SessionIds: []string{sessionID, missingSessionID}, + SessionIDs: []string{sessionID, missingSessionID}, }) if err != nil { t.Fatalf("Sessions.BulkDelete failed: %v", err) @@ -532,12 +532,12 @@ func TestRpcServerE2E(t *testing.T) { } skillName := fmt.Sprintf("server-rpc-skill-%s", randomHex(t)) - skillsDir := createMcpSkillsRpcDirectory(t, ctx.WorkDir, "server-rpc-skills", skillName, "Skill discovered by server-scoped RPC tests.") + skillsDir := createMCPSkillsRPCDirectory(t, ctx.WorkDir, "server-rpc-skills", skillName, "Skill discovered by server-scoped RPC tests.") workingDir := ctx.WorkDir - mcp, err := client.RPC.Mcp.Discover(t.Context(), &rpc.McpDiscoverRequest{WorkingDirectory: &workingDir}) + mcp, err := client.RPC.MCP.Discover(t.Context(), &rpc.MCPDiscoverRequest{WorkingDirectory: &workingDir}) if err != nil { - t.Fatalf("Mcp.Discover failed: %v", err) + t.Fatalf("MCP.Discover failed: %v", err) } if mcp.Servers == nil { t.Errorf("Expected non-nil Servers") diff --git a/go/internal/e2e/rpc_session_state_e2e_test.go b/go/internal/e2e/rpc_session_state_e2e_test.go index 1744cb10f..f6698f082 100644 --- a/go/internal/e2e/rpc_session_state_e2e_test.go +++ b/go/internal/e2e/rpc_session_state_e2e_test.go @@ -15,7 +15,7 @@ import ( // // Reuses snapshot files in test/snapshots/rpc_session_state/. Tests that don't issue // LLM calls don't need snapshots. -func TestRpcSessionStateE2E(t *testing.T) { +func TestRPCSessionStateE2E(t *testing.T) { ctx := testharness.NewTestContext(t) client := ctx.NewClient() t.Cleanup(func() { client.ForceStop() }) @@ -515,7 +515,7 @@ func TestRpcSessionStateE2E(t *testing.T) { repo := "github/copilot-sdk-e2e" repoHost := "github.com" - hostType := rpc.SessionWorkingDirectoryContextHostTypeGithub + hostType := rpc.SessionWorkingDirectoryContextHostTypeGitHub baseCommit := "0000000000000000000000000000000000000000" headCommit := "1111111111111111111111111111111111111111" if _, err := session.RPC.Metadata.RecordContextChange(t.Context(), &rpc.MetadataRecordContextChangeRequest{ @@ -1097,9 +1097,9 @@ func TestRpcSessionStateE2E(t *testing.T) { t.Errorf("session.history.truncate should be implemented; error suggests it isn't: %v", err) } - _, err = session.RPC.Mcp.Oauth().Login(t.Context(), &rpc.McpOauthLoginRequest{ServerName: "missing-server"}) + _, err = session.RPC.MCP.Oauth().Login(t.Context(), &rpc.MCPOauthLoginRequest{ServerName: "missing-server"}) if err == nil { - t.Fatal("Expected Mcp.Oauth.Login with unknown server to fail") + t.Fatal("Expected MCP.Oauth.Login with unknown server to fail") } if strings.Contains(strings.ToLower(err.Error()), "unhandled method session.mcp.oauth.login") { t.Errorf("session.mcp.oauth.login should be implemented; error suggests it isn't: %v", err) diff --git a/go/internal/e2e/rpc_shell_and_fleet_e2e_test.go b/go/internal/e2e/rpc_shell_and_fleet_e2e_test.go index 7655d179e..d7ffd725d 100644 --- a/go/internal/e2e/rpc_shell_and_fleet_e2e_test.go +++ b/go/internal/e2e/rpc_shell_and_fleet_e2e_test.go @@ -17,7 +17,7 @@ import ( ) // Mirrors dotnet/test/RpcShellAndFleetTests.cs (snapshot category "rpc_shell_and_fleet"). -func TestRpcShellAndFleetE2E(t *testing.T) { +func TestRPCShellAndFleetE2E(t *testing.T) { ctx := testharness.NewTestContext(t) client := ctx.NewClient() t.Cleanup(func() { client.ForceStop() }) diff --git a/go/internal/e2e/rpc_tasks_and_handlers_e2e_test.go b/go/internal/e2e/rpc_tasks_and_handlers_e2e_test.go index bda0f2ad3..cbaa92f9e 100644 --- a/go/internal/e2e/rpc_tasks_and_handlers_e2e_test.go +++ b/go/internal/e2e/rpc_tasks_and_handlers_e2e_test.go @@ -11,7 +11,7 @@ import ( ) // Mirrors dotnet/test/RpcTasksAndHandlersTests.cs (snapshot category "rpc_tasks_and_handlers"). -func TestRpcTasksAndHandlersE2E(t *testing.T) { +func TestRPCTasksAndHandlersE2E(t *testing.T) { ctx := testharness.NewTestContext(t) client := ctx.NewClient() t.Cleanup(func() { client.ForceStop() }) diff --git a/go/internal/e2e/rpc_workspace_checkpoints_e2e_test.go b/go/internal/e2e/rpc_workspace_checkpoints_e2e_test.go index a11a2fef2..87c3c8da8 100644 --- a/go/internal/e2e/rpc_workspace_checkpoints_e2e_test.go +++ b/go/internal/e2e/rpc_workspace_checkpoints_e2e_test.go @@ -11,7 +11,7 @@ import ( ) // Mirrors dotnet/test/E2E/RpcWorkspaceCheckpointsE2ETests.cs (snapshot category "rpc_workspace_checkpoints"). -func TestRpcWorkspaceCheckpointsE2E(t *testing.T) { +func TestRPCWorkspaceCheckpointsE2E(t *testing.T) { ctx := testharness.NewTestContext(t) client := ctx.NewClient() t.Cleanup(func() { client.ForceStop() }) diff --git a/go/internal/e2e/session_e2e_test.go b/go/internal/e2e/session_e2e_test.go index 26707bdb3..dc2d54ca8 100644 --- a/go/internal/e2e/session_e2e_test.go +++ b/go/internal/e2e/session_e2e_test.go @@ -1420,13 +1420,13 @@ func TestSessionAttachmentsE2E(t *testing.T) { } number := int64(1234) - referenceType := copilot.AttachmentGithubReferenceTypeIssue + referenceType := copilot.AttachmentGitHubReferenceTypeIssue state := "open" title := "Add E2E attachment coverage" url := "https://github.com/github/copilot-sdk/issues/1234" _, err = session.SendAndWait(t.Context(), copilot.MessageOptions{ Prompt: "Using only the GitHub reference metadata in this message, summarize the reference. Do not call any tools.", - Attachments: []copilot.Attachment{&copilot.AttachmentGithubReference{ + Attachments: []copilot.Attachment{&copilot.AttachmentGitHubReference{ Number: number, ReferenceType: referenceType, State: state, @@ -1438,14 +1438,14 @@ func TestSessionAttachmentsE2E(t *testing.T) { t.Fatalf("SendAndWait failed: %v", err) } - attachment, ok := lastUserAttachment(t, session).(*copilot.AttachmentGithubReference) + attachment, ok := lastUserAttachment(t, session).(*copilot.AttachmentGitHubReference) if !ok { t.Fatalf("Expected GitHub reference attachment, got %T", lastUserAttachment(t, session)) } if attachment.Number != 1234 { t.Errorf("Expected Number=1234, got %v", attachment.Number) } - if attachment.ReferenceType != copilot.AttachmentGithubReferenceTypeIssue { + if attachment.ReferenceType != copilot.AttachmentGitHubReferenceTypeIssue { t.Errorf("Expected ReferenceType=Issue, got %v", attachment.ReferenceType) } if attachment.State != "open" { diff --git a/go/internal/e2e/session_fs_e2e_test.go b/go/internal/e2e/session_fs_e2e_test.go index ef392ebbc..bdf2c5260 100644 --- a/go/internal/e2e/session_fs_e2e_test.go +++ b/go/internal/e2e/session_fs_e2e_test.go @@ -15,17 +15,17 @@ import ( "github.com/github/copilot-sdk/go/rpc" ) -func TestSessionFsE2E(t *testing.T) { +func TestSessionFSE2E(t *testing.T) { ctx := testharness.NewTestContext(t) providerRoot := t.TempDir() sessionStatePath := createSessionStatePath(t) - sessionFsConfig := &copilot.SessionFsConfig{ + sessionFSConfig := &copilot.SessionFSConfig{ InitialWorkingDirectory: "/", SessionStatePath: sessionStatePath, - Conventions: rpc.SessionFsSetProviderConventionsPosix, + Conventions: rpc.SessionFSSetProviderConventionsPosix, } - createSessionFsHandler := func(session *copilot.Session) copilot.SessionFsProvider { - return &testSessionFsHandler{ + createSessionFSHandler := func(session *copilot.Session) copilot.SessionFSProvider { + return &testSessionFSHandler{ root: providerRoot, sessionID: session.SessionID, } @@ -35,7 +35,7 @@ func TestSessionFsE2E(t *testing.T) { } client := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.SessionFs = sessionFsConfig + opts.SessionFS = sessionFSConfig }) t.Cleanup(func() { client.ForceStop() }) @@ -44,7 +44,7 @@ func TestSessionFsE2E(t *testing.T) { session, err := client.CreateSession(t.Context(), &copilot.SessionConfig{ OnPermissionRequest: copilot.PermissionHandler.ApproveAll, - CreateSessionFsProvider: createSessionFsHandler, + CreateSessionFSProvider: createSessionFSHandler, }) if err != nil { t.Fatalf("Failed to create session: %v", err) @@ -81,7 +81,7 @@ func TestSessionFsE2E(t *testing.T) { session1, err := client.CreateSession(t.Context(), &copilot.SessionConfig{ OnPermissionRequest: copilot.PermissionHandler.ApproveAll, - CreateSessionFsProvider: createSessionFsHandler, + CreateSessionFSProvider: createSessionFSHandler, }) if err != nil { t.Fatalf("Failed to create session: %v", err) @@ -111,7 +111,7 @@ func TestSessionFsE2E(t *testing.T) { session2, err := client.ResumeSession(t.Context(), sessionID, &copilot.ResumeSessionConfig{ OnPermissionRequest: copilot.PermissionHandler.ApproveAll, - CreateSessionFsProvider: createSessionFsHandler, + CreateSessionFSProvider: createSessionFSHandler, }) if err != nil { t.Fatalf("Failed to resume session: %v", err) @@ -158,22 +158,22 @@ func TestSessionFsE2E(t *testing.T) { Connection: copilot.UriConnection{URL: fmt.Sprintf("localhost:%d", runtimePort)}, LogLevel: "error", Env: ctx.Env(), - SessionFs: sessionFsConfig, + SessionFS: sessionFSConfig, }) t.Cleanup(func() { client2.ForceStop() }) if err := client2.Start(t.Context()); err == nil { - t.Fatal("Expected Start to fail when SessionFs provider is set after sessions already exist") + t.Fatal("Expected Start to fail when SessionFS provider is set after sessions already exist") } }) - t.Run("should map large output handling into SessionFs", func(t *testing.T) { + t.Run("should map large output handling into SessionFS", func(t *testing.T) { ctx.ConfigureForTest(t) suppliedFileContent := strings.Repeat("x", 100_000) session, err := client.CreateSession(t.Context(), &copilot.SessionConfig{ OnPermissionRequest: copilot.PermissionHandler.ApproveAll, - CreateSessionFsProvider: createSessionFsHandler, + CreateSessionFSProvider: createSessionFSHandler, Tools: []copilot.Tool{ copilot.DefineTool("get_big_string", "Returns a large string", func(_ struct{}, inv copilot.ToolInvocation) (string, error) { @@ -213,12 +213,12 @@ func TestSessionFsE2E(t *testing.T) { } }) - t.Run("should succeed with compaction while using SessionFs", func(t *testing.T) { + t.Run("should succeed with compaction while using SessionFS", func(t *testing.T) { ctx.ConfigureForTest(t) session, err := client.CreateSession(t.Context(), &copilot.SessionConfig{ OnPermissionRequest: copilot.PermissionHandler.ApproveAll, - CreateSessionFsProvider: createSessionFsHandler, + CreateSessionFSProvider: createSessionFSHandler, }) if err != nil { t.Fatalf("Failed to create session: %v", err) @@ -252,12 +252,12 @@ func TestSessionFsE2E(t *testing.T) { t.Fatalf("Timed out waiting for checkpoint rewrite: %v", err) } }) - t.Run("should write workspace metadata via SessionFs", func(t *testing.T) { + t.Run("should write workspace metadata via SessionFS", func(t *testing.T) { ctx.ConfigureForTest(t) session, err := client.CreateSession(t.Context(), &copilot.SessionConfig{ OnPermissionRequest: copilot.PermissionHandler.ApproveAll, - CreateSessionFsProvider: createSessionFsHandler, + CreateSessionFSProvider: createSessionFSHandler, }) if err != nil { t.Fatalf("Failed to create session: %v", err) @@ -277,7 +277,7 @@ func TestSessionFsE2E(t *testing.T) { t.Fatalf("Expected response to contain 56, got %q", content) } - // WorkspaceManager should have created workspace.yaml via SessionFs + // WorkspaceManager should have created workspace.yaml via SessionFS workspaceYamlPath := p(session.SessionID, sessionStatePath+"/workspace.yaml") if err := waitForFileContent(workspaceYamlPath, "id:", 5*time.Second); err != nil { t.Fatalf("Timed out waiting for workspace.yaml content: %v", err) @@ -294,12 +294,12 @@ func TestSessionFsE2E(t *testing.T) { } }) - t.Run("should persist plan.md via SessionFs", func(t *testing.T) { + t.Run("should persist plan.md via SessionFS", func(t *testing.T) { ctx.ConfigureForTest(t) session, err := client.CreateSession(t.Context(), &copilot.SessionConfig{ OnPermissionRequest: copilot.PermissionHandler.ApproveAll, - CreateSessionFsProvider: createSessionFsHandler, + CreateSessionFSProvider: createSessionFSHandler, }) if err != nil { t.Fatalf("Failed to create session: %v", err) @@ -339,12 +339,12 @@ func createSessionStatePath(t *testing.T) string { return filepath.ToSlash(filepath.Join(t.TempDir(), "session-state")) } -type testSessionFsHandler struct { +type testSessionFSHandler struct { root string sessionID string } -func (h *testSessionFsHandler) ReadFile(path string) (string, error) { +func (h *testSessionFSHandler) ReadFile(path string) (string, error) { content, err := os.ReadFile(providerPath(h.root, h.sessionID, path)) if err != nil { return "", err @@ -352,7 +352,7 @@ func (h *testSessionFsHandler) ReadFile(path string) (string, error) { return string(content), nil } -func (h *testSessionFsHandler) WriteFile(path string, content string, mode *int) error { +func (h *testSessionFSHandler) WriteFile(path string, content string, mode *int) error { fullPath := providerPath(h.root, h.sessionID, path) if err := os.MkdirAll(filepath.Dir(fullPath), 0o755); err != nil { return err @@ -364,7 +364,7 @@ func (h *testSessionFsHandler) WriteFile(path string, content string, mode *int) return os.WriteFile(fullPath, []byte(content), perm) } -func (h *testSessionFsHandler) AppendFile(path string, content string, mode *int) error { +func (h *testSessionFSHandler) AppendFile(path string, content string, mode *int) error { fullPath := providerPath(h.root, h.sessionID, path) if err := os.MkdirAll(filepath.Dir(fullPath), 0o755); err != nil { return err @@ -382,7 +382,7 @@ func (h *testSessionFsHandler) AppendFile(path string, content string, mode *int return err } -func (h *testSessionFsHandler) Exists(path string) (bool, error) { +func (h *testSessionFSHandler) Exists(path string) (bool, error) { _, err := os.Stat(providerPath(h.root, h.sessionID, path)) if err == nil { return true, nil @@ -393,13 +393,13 @@ func (h *testSessionFsHandler) Exists(path string) (bool, error) { return false, err } -func (h *testSessionFsHandler) Stat(path string) (*copilot.SessionFsFileInfo, error) { +func (h *testSessionFSHandler) Stat(path string) (*copilot.SessionFSFileInfo, error) { info, err := os.Stat(providerPath(h.root, h.sessionID, path)) if err != nil { return nil, err } ts := info.ModTime().UTC() - return &copilot.SessionFsFileInfo{ + return &copilot.SessionFSFileInfo{ IsFile: !info.IsDir(), IsDirectory: info.IsDir(), Size: info.Size(), @@ -408,7 +408,7 @@ func (h *testSessionFsHandler) Stat(path string) (*copilot.SessionFsFileInfo, er }, nil } -func (h *testSessionFsHandler) MakeDirectory(path string, recursive bool, mode *int) error { +func (h *testSessionFSHandler) MakeDirectory(path string, recursive bool, mode *int) error { fullPath := providerPath(h.root, h.sessionID, path) perm := os.FileMode(0o777) if mode != nil { @@ -420,7 +420,7 @@ func (h *testSessionFsHandler) MakeDirectory(path string, recursive bool, mode * return os.Mkdir(fullPath, perm) } -func (h *testSessionFsHandler) ReadDirectory(path string) ([]string, error) { +func (h *testSessionFSHandler) ReadDirectory(path string) ([]string, error) { entries, err := os.ReadDir(providerPath(h.root, h.sessionID, path)) if err != nil { return nil, err @@ -432,18 +432,18 @@ func (h *testSessionFsHandler) ReadDirectory(path string) ([]string, error) { return names, nil } -func (h *testSessionFsHandler) ReadDirectoryWithTypes(path string) ([]rpc.SessionFsReaddirWithTypesEntry, error) { +func (h *testSessionFSHandler) ReadDirectoryWithTypes(path string) ([]rpc.SessionFSReaddirWithTypesEntry, error) { entries, err := os.ReadDir(providerPath(h.root, h.sessionID, path)) if err != nil { return nil, err } - result := make([]rpc.SessionFsReaddirWithTypesEntry, 0, len(entries)) + result := make([]rpc.SessionFSReaddirWithTypesEntry, 0, len(entries)) for _, entry := range entries { - entryType := rpc.SessionFsReaddirWithTypesEntryTypeFile + entryType := rpc.SessionFSReaddirWithTypesEntryTypeFile if entry.IsDir() { - entryType = rpc.SessionFsReaddirWithTypesEntryTypeDirectory + entryType = rpc.SessionFSReaddirWithTypesEntryTypeDirectory } - result = append(result, rpc.SessionFsReaddirWithTypesEntry{ + result = append(result, rpc.SessionFSReaddirWithTypesEntry{ Name: entry.Name(), Type: entryType, }) @@ -451,7 +451,7 @@ func (h *testSessionFsHandler) ReadDirectoryWithTypes(path string) ([]rpc.Sessio return result, nil } -func (h *testSessionFsHandler) Remove(path string, recursive bool, force bool) error { +func (h *testSessionFSHandler) Remove(path string, recursive bool, force bool) error { fullPath := providerPath(h.root, h.sessionID, path) var err error if recursive { @@ -465,7 +465,7 @@ func (h *testSessionFsHandler) Remove(path string, recursive bool, force bool) e return err } -func (h *testSessionFsHandler) Rename(src string, dest string) error { +func (h *testSessionFSHandler) Rename(src string, dest string) error { destPath := providerPath(h.root, h.sessionID, dest) if err := os.MkdirAll(filepath.Dir(destPath), 0o755); err != nil { return err @@ -525,13 +525,13 @@ func waitForFileContent(path string, needle string, timeout time.Duration) error return fmt.Errorf("file %s did not contain %q", path, needle) } -// TestSessionFsHandlerOperations mirrors the C# Should_Map_All_SessionFs_Handler_Operations test. -// It exercises every operation on testSessionFsHandler directly to ensure the test helper +// TestSessionFSHandlerOperations mirrors the C# Should_Map_All_SessionFS_Handler_Operations test. +// It exercises every operation on testSessionFSHandler directly to ensure the test helper // implementation routes file operations correctly to the per-session provider root. -func TestSessionFsHandlerOperationsE2E(t *testing.T) { +func TestSessionFSHandlerOperationsE2E(t *testing.T) { providerRoot := t.TempDir() sessionID := "handler-session" - handler := &testSessionFsHandler{root: providerRoot, sessionID: sessionID} + handler := &testSessionFSHandler{root: providerRoot, sessionID: sessionID} if err := handler.MakeDirectory("/workspace/nested", true, nil); err != nil { t.Fatalf("Mkdir failed: %v", err) @@ -589,7 +589,7 @@ func TestSessionFsHandlerOperationsE2E(t *testing.T) { } var found bool for _, entry := range typedEntries { - if entry.Name == "file.txt" && entry.Type == rpc.SessionFsReaddirWithTypesEntryTypeFile { + if entry.Name == "file.txt" && entry.Type == rpc.SessionFSReaddirWithTypesEntryTypeFile { found = true break } diff --git a/go/internal/e2e/session_fs_sqlite_e2e_test.go b/go/internal/e2e/session_fs_sqlite_e2e_test.go index f7e849f56..fa3b49e48 100644 --- a/go/internal/e2e/session_fs_sqlite_e2e_test.go +++ b/go/internal/e2e/session_fs_sqlite_e2e_test.go @@ -20,7 +20,7 @@ type sqliteCall struct { Query string } -// inMemorySqliteProvider is a SessionFsProvider backed by in-memory maps with a stub SQLite handler. +// inMemorySqliteProvider is a SessionFSProvider backed by in-memory maps with a stub SQLite handler. // The stub returns plausible canned responses based on query type rather than executing real SQL. // This avoids pulling in a real SQLite dependency (which would force a go directive bump across // all scenario go.mod files). @@ -83,17 +83,17 @@ func (p *inMemorySqliteProvider) Exists(path string) (bool, error) { return isFile || isDir, nil } -func (p *inMemorySqliteProvider) Stat(path string) (*copilot.SessionFsFileInfo, error) { +func (p *inMemorySqliteProvider) Stat(path string) (*copilot.SessionFSFileInfo, error) { p.mu.Lock() defer p.mu.Unlock() now := time.Now().UTC() if p.dirs[path] { - return &copilot.SessionFsFileInfo{ + return &copilot.SessionFSFileInfo{ IsFile: false, IsDirectory: true, Size: 0, Mtime: now, Birthtime: now, }, nil } if content, ok := p.files[path]; ok { - return &copilot.SessionFsFileInfo{ + return &copilot.SessionFSFileInfo{ IsFile: true, IsDirectory: false, Size: int64(len(content)), Mtime: now, Birthtime: now, }, nil } @@ -143,17 +143,17 @@ func (p *inMemorySqliteProvider) ReadDirectory(path string) ([]string, error) { return result, nil } -func (p *inMemorySqliteProvider) ReadDirectoryWithTypes(path string) ([]rpc.SessionFsReaddirWithTypesEntry, error) { +func (p *inMemorySqliteProvider) ReadDirectoryWithTypes(path string) ([]rpc.SessionFSReaddirWithTypesEntry, error) { p.mu.Lock() defer p.mu.Unlock() prefix := strings.TrimRight(path, "/") + "/" - entries := map[string]rpc.SessionFsReaddirWithTypesEntryType{} + entries := map[string]rpc.SessionFSReaddirWithTypesEntryType{} for d := range p.dirs { if strings.HasPrefix(d, prefix) { rest := d[len(prefix):] if rest != "" { name := strings.SplitN(rest, "/", 2)[0] - entries[name] = rpc.SessionFsReaddirWithTypesEntryTypeDirectory + entries[name] = rpc.SessionFSReaddirWithTypesEntryTypeDirectory } } } @@ -163,14 +163,14 @@ func (p *inMemorySqliteProvider) ReadDirectoryWithTypes(path string) ([]rpc.Sess if rest != "" { name := strings.SplitN(rest, "/", 2)[0] if _, exists := entries[name]; !exists { - entries[name] = rpc.SessionFsReaddirWithTypesEntryTypeFile + entries[name] = rpc.SessionFSReaddirWithTypesEntryTypeFile } } } } - result := make([]rpc.SessionFsReaddirWithTypesEntry, 0, len(entries)) + result := make([]rpc.SessionFSReaddirWithTypesEntry, 0, len(entries)) for name, typ := range entries { - result = append(result, rpc.SessionFsReaddirWithTypesEntry{Name: name, Type: typ}) + result = append(result, rpc.SessionFSReaddirWithTypesEntry{Name: name, Type: typ}) } sort.Slice(result, func(i, j int) bool { return result[i].Name < result[j].Name }) return result, nil @@ -195,7 +195,7 @@ func (p *inMemorySqliteProvider) Rename(src string, dest string) error { return nil } -func (p *inMemorySqliteProvider) SqliteQuery(queryType rpc.SessionFsSqliteQueryType, query string, params map[string]any) (*copilot.SessionFsSqliteQueryResult, error) { +func (p *inMemorySqliteProvider) SqliteQuery(queryType rpc.SessionFSSqliteQueryType, query string, params map[string]any) (*copilot.SessionFSSqliteQueryResult, error) { p.mu.Lock() defer p.mu.Unlock() p.hadQuery = true @@ -211,26 +211,26 @@ func (p *inMemorySqliteProvider) SqliteQuery(queryType rpc.SessionFsSqliteQueryT // normally without pulling in a real SQLite dependency. upper := strings.ToUpper(strings.TrimSpace(query)) switch queryType { - case rpc.SessionFsSqliteQueryTypeExec: - return &copilot.SessionFsSqliteQueryResult{Columns: []string{}, Rows: []map[string]any{}}, nil - case rpc.SessionFsSqliteQueryTypeRun: + case rpc.SessionFSSqliteQueryTypeExec: + return &copilot.SessionFSSqliteQueryResult{Columns: []string{}, Rows: []map[string]any{}}, nil + case rpc.SessionFSSqliteQueryTypeRun: lastID := int64(1) - return &copilot.SessionFsSqliteQueryResult{ + return &copilot.SessionFSSqliteQueryResult{ Columns: []string{}, Rows: []map[string]any{}, RowsAffected: 1, LastInsertRowid: &lastID, }, nil - case rpc.SessionFsSqliteQueryTypeQuery: + case rpc.SessionFSSqliteQueryTypeQuery: if strings.Contains(upper, "SELECT") { - return &copilot.SessionFsSqliteQueryResult{ + return &copilot.SessionFSSqliteQueryResult{ Columns: []string{"id", "name"}, Rows: []map[string]any{{"id": "a1", "name": "Widget"}}, }, nil } - return &copilot.SessionFsSqliteQueryResult{Columns: []string{}, Rows: []map[string]any{}}, nil + return &copilot.SessionFSSqliteQueryResult{Columns: []string{}, Rows: []map[string]any{}}, nil } - return &copilot.SessionFsSqliteQueryResult{Columns: []string{}, Rows: []map[string]any{}}, nil + return &copilot.SessionFSSqliteQueryResult{Columns: []string{}, Rows: []map[string]any{}}, nil } func (p *inMemorySqliteProvider) SqliteExists() (bool, error) { @@ -239,27 +239,27 @@ func (p *inMemorySqliteProvider) SqliteExists() (bool, error) { return p.hadQuery, nil } -func TestSessionFsSqliteE2E(t *testing.T) { +func TestSessionFSSqliteE2E(t *testing.T) { ctx := testharness.NewTestContext(t) sessionStatePath := createSessionStatePath(t) - sessionFsConfig := &copilot.SessionFsConfig{ + sessionFSConfig := &copilot.SessionFSConfig{ InitialWorkingDirectory: "/", SessionStatePath: sessionStatePath, - Conventions: rpc.SessionFsSetProviderConventionsPosix, - Capabilities: &copilot.SessionFsCapabilities{Sqlite: true}, + Conventions: rpc.SessionFSSetProviderConventionsPosix, + Capabilities: &copilot.SessionFSCapabilities{Sqlite: true}, } var sqliteCalls []sqliteCall var providers sync.Map - createSessionFsHandler := func(session *copilot.Session) copilot.SessionFsProvider { + createSessionFSHandler := func(session *copilot.Session) copilot.SessionFSProvider { p := newInMemorySqliteProvider(session.SessionID, &sqliteCalls) providers.Store(session.SessionID, p) return p } client := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.SessionFs = sessionFsConfig + opts.SessionFS = sessionFSConfig }) t.Cleanup(func() { client.ForceStop() }) @@ -269,7 +269,7 @@ func TestSessionFsSqliteE2E(t *testing.T) { session, err := client.CreateSession(t.Context(), &copilot.SessionConfig{ OnPermissionRequest: copilot.PermissionHandler.ApproveAll, - CreateSessionFsProvider: createSessionFsHandler, + CreateSessionFSProvider: createSessionFSHandler, }) if err != nil { t.Fatalf("Failed to create session: %v", err) @@ -307,7 +307,7 @@ func TestSessionFsSqliteE2E(t *testing.T) { session, err := client.CreateSession(t.Context(), &copilot.SessionConfig{ OnPermissionRequest: copilot.PermissionHandler.ApproveAll, - CreateSessionFsProvider: createSessionFsHandler, + CreateSessionFSProvider: createSessionFSHandler, }) if err != nil { t.Fatalf("Failed to create session: %v", err) diff --git a/go/mode_empty.go b/go/mode_empty.go index a3e58ad9c..c048c7e7b 100644 --- a/go/mode_empty.go +++ b/go/mode_empty.go @@ -20,20 +20,20 @@ func validateNewClientForMode(opts *ClientOptions) { } // Empty mode requires durable, app-owned storage. Either: // - the app supplied a BaseDirectory the runtime can write to, - // - the app supplied a SessionFs implementation, + // - the app supplied a SessionFS implementation, // - or the app is connecting to an externally-managed runtime via // UriConnection (in which case the host owns storage). if opts.BaseDirectory != "" { return } - if opts.SessionFs != nil { + if opts.SessionFS != nil { return } if _, ok := opts.Connection.(UriConnection); ok { return } - panic("Client is in Mode=ModeEmpty but neither BaseDirectory, SessionFs, nor a UriConnection was supplied. " + - "Empty mode requires explicit, per-tenant storage; set ClientOptions.BaseDirectory or .SessionFs, " + + panic("Client is in Mode=ModeEmpty but neither BaseDirectory, SessionFS, nor a UriConnection was supplied. " + + "Empty mode requires explicit, per-tenant storage; set ClientOptions.BaseDirectory or .SessionFS, " + "or connect to an externally-managed runtime via UriConnection.") } @@ -45,7 +45,7 @@ func validateToolFilterList(field string, list []string) error { if entry == "*" { return fmt.Errorf( "invalid %s entry %q: there is no bare wildcard. "+ - "Use one or more of NewToolSet().AddBuiltIn(\"*\"), .AddMcp(\"*\"), or .AddCustom(\"*\") "+ + "Use one or more of NewToolSet().AddBuiltIn(\"*\"), .AddMCP(\"*\"), or .AddCustom(\"*\") "+ "to target a specific source", field, entry) } diff --git a/go/rpc/generated_rpc_api_shape_test.go b/go/rpc/generated_rpc_api_shape_test.go index bddbb263d..a6b357d54 100644 --- a/go/rpc/generated_rpc_api_shape_test.go +++ b/go/rpc/generated_rpc_api_shape_test.go @@ -16,8 +16,8 @@ var ( _ ExternalToolResult = (*ExternalToolTextResultForLlm)(nil) _ FilterMapping = FilterMappingEnumMap{} _ FilterMapping = ContentFilterModeMarkdown - _ McpServerConfig = (*McpServerConfigHTTP)(nil) - _ McpServerConfig = (*McpServerConfigStdio)(nil) + _ MCPServerConfig = (*MCPServerConfigHTTP)(nil) + _ MCPServerConfig = (*MCPServerConfigStdio)(nil) _ UIElicitationFieldValue = UIElicitationStringValue("") _ UIElicitationFieldValue = UIElicitationStringArrayValue(nil) _ UIElicitationFieldValue = UIElicitationBooleanValue(false) @@ -34,12 +34,12 @@ func TestGeneratedRPCAPIShape(t *testing.T) { assertInterfaceType(t, file, "FilterMapping") assertTypeExpr(t, fileSet, findTypeSpec(t, file, "FilterMappingEnumMap").Type, "map[string]ContentFilterMode") - assertInterfaceType(t, file, "McpServerConfig") - assertStructFieldType(t, file, fileSet, "McpConfigAddRequest", "Config", "McpServerConfig") - assertStructFieldType(t, file, fileSet, "McpConfigList", "Servers", "map[string]McpServerConfig") - assertStructFieldType(t, file, fileSet, "McpConfigUpdateRequest", "Config", "McpServerConfig") - assertStructFieldType(t, file, fileSet, "McpServerConfigHTTP", "FilterMapping", "FilterMapping") - assertStructFieldType(t, file, fileSet, "McpServerConfigStdio", "FilterMapping", "FilterMapping") + assertInterfaceType(t, file, "MCPServerConfig") + assertStructFieldType(t, file, fileSet, "MCPConfigAddRequest", "Config", "MCPServerConfig") + assertStructFieldType(t, file, fileSet, "MCPConfigList", "Servers", "map[string]MCPServerConfig") + assertStructFieldType(t, file, fileSet, "MCPConfigUpdateRequest", "Config", "MCPServerConfig") + assertStructFieldType(t, file, fileSet, "MCPServerConfigHTTP", "FilterMapping", "FilterMapping") + assertStructFieldType(t, file, fileSet, "MCPServerConfigStdio", "FilterMapping", "FilterMapping") assertInterfaceType(t, file, "UIElicitationFieldValue") assertTypeExpr(t, fileSet, findTypeSpec(t, file, "UIElicitationStringArrayValue").Type, "[]string") diff --git a/go/rpc/generated_rpc_union_test.go b/go/rpc/generated_rpc_union_test.go index c6f4c3b79..131409f04 100644 --- a/go/rpc/generated_rpc_union_test.go +++ b/go/rpc/generated_rpc_union_test.go @@ -84,8 +84,8 @@ func TestFilterMappingJSONUnion(t *testing.T) { } } -func TestMcpServerConfigJSONUnion(t *testing.T) { - var localConfig McpServerConfig = &McpServerConfigStdio{ +func TestMCPServerConfigJSONUnion(t *testing.T) { + var localConfig MCPServerConfig = &MCPServerConfigStdio{ Args: []string{"-v"}, Command: "node", } @@ -97,16 +97,16 @@ func TestMcpServerConfigJSONUnion(t *testing.T) { t.Fatalf("marshal local config = %s", raw) } - decodedLocal, err := unmarshalMcpServerConfig([]byte(`{"args":["-v"],"command":"node"}`)) + decodedLocal, err := unmarshalMCPServerConfig([]byte(`{"args":["-v"],"command":"node"}`)) if err != nil { t.Fatalf("unmarshal local config: %v", err) } - decodedLocalValue, ok := decodedLocal.(*McpServerConfigStdio) + decodedLocalValue, ok := decodedLocal.(*MCPServerConfigStdio) if !ok || decodedLocalValue.Command != "node" || len(decodedLocalValue.Args) != 1 || decodedLocalValue.Args[0] != "-v" { t.Fatalf("unmarshal local config = %#v", decodedLocal) } - var httpConfig McpServerConfig = &McpServerConfigHTTP{URL: "https://example.com/mcp"} + var httpConfig MCPServerConfig = &MCPServerConfigHTTP{URL: "https://example.com/mcp"} raw, err = json.Marshal(httpConfig) if err != nil { t.Fatalf("marshal HTTP config: %v", err) @@ -115,21 +115,21 @@ func TestMcpServerConfigJSONUnion(t *testing.T) { t.Fatalf("marshal HTTP config = %s", raw) } - decodedHTTP, err := unmarshalMcpServerConfig([]byte(`{"url":"https://example.com/mcp"}`)) + decodedHTTP, err := unmarshalMCPServerConfig([]byte(`{"url":"https://example.com/mcp"}`)) if err != nil { t.Fatalf("unmarshal HTTP config: %v", err) } - decodedHTTPValue, ok := decodedHTTP.(*McpServerConfigHTTP) + decodedHTTPValue, ok := decodedHTTP.(*MCPServerConfigHTTP) if !ok || decodedHTTPValue.URL != "https://example.com/mcp" { t.Fatalf("unmarshal HTTP config = %#v", decodedHTTP) } - decodedRaw, err := unmarshalMcpServerConfig([]byte(`{"name":"future"}`)) + decodedRaw, err := unmarshalMCPServerConfig([]byte(`{"name":"future"}`)) if err != nil { t.Fatalf("unmarshal raw config: %v", err) } - if _, ok := decodedRaw.(*RawMcpServerConfigData); !ok { - t.Fatalf("unmarshal raw config = %T, want *RawMcpServerConfigData", decodedRaw) + if _, ok := decodedRaw.(*RawMCPServerConfigData); !ok { + t.Fatalf("unmarshal raw config = %T, want *RawMCPServerConfigData", decodedRaw) } } @@ -195,7 +195,7 @@ func TestCommandsInvokeUnmarshalsSlashCommandInvocationResult(t *testing.T) { }) input := "details" - result, err := NewSessionRpc(client, "session-1").Commands.Invoke(t.Context(), &CommandsInvokeRequest{ + result, err := NewSessionRPC(client, "session-1").Commands.Invoke(t.Context(), &CommandsInvokeRequest{ Input: &input, Name: "help", }) diff --git a/go/rpc/zrpc.go b/go/rpc/zrpc.go index a760a715b..a93813a2d 100644 --- a/go/rpc/zrpc.go +++ b/go/rpc/zrpc.go @@ -81,8 +81,8 @@ type AgentInfo struct { ID string `json:"id"` // MCP server configurations attached to this agent, keyed by server name. Server config // shape mirrors the MCP `mcpServers` schema. - // Experimental: McpServers is part of an experimental API and may change or be removed. - McpServers map[string]any `json:"mcpServers,omitempty"` + // Experimental: MCPServers is part of an experimental API and may change or be removed. + MCPServers map[string]any `json:"mcpServers,omitempty"` // Preferred model id for this agent. When omitted, inherits the outer agent's model. Model *string `json:"model,omitempty"` // Unique identifier of the custom agent @@ -421,13 +421,13 @@ func (AttachmentFile) Type() AttachmentType { } // GitHub issue, pull request, or discussion reference -// Experimental: AttachmentGithubReference is part of an experimental API and may change or +// Experimental: AttachmentGitHubReference is part of an experimental API and may change or // be removed. -type AttachmentGithubReference struct { +type AttachmentGitHubReference struct { // Issue, pull request, or discussion number Number int64 `json:"number"` // Type of GitHub reference - ReferenceType AttachmentGithubReferenceType `json:"referenceType"` + ReferenceType AttachmentGitHubReferenceType `json:"referenceType"` // Current state of the referenced item (e.g., open, closed, merged) State string `json:"state"` // Title of the referenced item @@ -436,9 +436,9 @@ type AttachmentGithubReference struct { URL string `json:"url"` } -func (AttachmentGithubReference) attachment() {} -func (AttachmentGithubReference) Type() AttachmentType { - return AttachmentTypeGithubReference +func (AttachmentGitHubReference) attachment() {} +func (AttachmentGitHubReference) Type() AttachmentType { + return AttachmentTypeGitHubReference } // Code selection attachment from an editor @@ -580,8 +580,8 @@ func (EnvAuthInfo) Type() AuthInfoType { } // Schema for the `GhCliAuthInfo` type. -// Experimental: GhCliAuthInfo is part of an experimental API and may change or be removed. -type GhCliAuthInfo struct { +// Experimental: GHCLIAuthInfo is part of an experimental API and may change or be removed. +type GHCLIAuthInfo struct { // Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the // GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this // verbatim and does not re-fetch when set. @@ -594,9 +594,9 @@ type GhCliAuthInfo struct { Token string `json:"token"` } -func (GhCliAuthInfo) authInfo() {} -func (GhCliAuthInfo) Type() AuthInfoType { - return AuthInfoTypeGhCli +func (GHCLIAuthInfo) authInfo() {} +func (GHCLIAuthInfo) Type() AuthInfoType { + return AuthInfoTypeGHCLI } // Schema for the `HMACAuthInfo` type. @@ -607,14 +607,14 @@ type HMACAuthInfo struct { // verbatim and does not re-fetch when set. CopilotUser *CopilotUserResponse `json:"copilotUser,omitempty"` // HMAC secret used to sign requests. - Hmac string `json:"hmac"` + HMAC string `json:"hmac"` // Authentication host. HMAC auth always targets the public GitHub host. Host HMACAuthInfoHost `json:"host"` } func (HMACAuthInfo) authInfo() {} func (HMACAuthInfo) Type() AuthInfoType { - return AuthInfoTypeHmac + return AuthInfoTypeHMAC } // Schema for the `TokenAuthInfo` type. @@ -973,14 +973,14 @@ type CopilotUserResponse struct { AssignedDate *string `json:"assigned_date,omitempty"` CanSignupForLimited *bool `json:"can_signup_for_limited,omitempty"` ChatEnabled *bool `json:"chat_enabled,omitempty"` - CliRemoteControlEnabled *bool `json:"cli_remote_control_enabled,omitempty"` + CLIRemoteControlEnabled *bool `json:"cli_remote_control_enabled,omitempty"` CloudSessionStorageEnabled *bool `json:"cloud_session_storage_enabled,omitempty"` CodexAgentEnabled *bool `json:"codex_agent_enabled,omitempty"` CopilotignoreEnabled *bool `json:"copilotignore_enabled,omitempty"` CopilotPlan *string `json:"copilot_plan,omitempty"` // Schema for the `CopilotUserResponseEndpoints` type. Endpoints *CopilotUserResponseEndpoints `json:"endpoints,omitempty"` - IsMcpEnabled *bool `json:"is_mcp_enabled,omitempty"` + IsMCPEnabled *bool `json:"is_mcp_enabled,omitempty"` LimitedUserQuotas map[string]float64 `json:"limited_user_quotas,omitempty"` LimitedUserResetDate *string `json:"limited_user_reset_date,omitempty"` Login *string `json:"login,omitempty"` @@ -988,7 +988,7 @@ type CopilotUserResponse struct { OrganizationList []CopilotUserResponseOrganizationListItem `json:"organization_list,omitempty"` OrganizationLoginList []string `json:"organization_login_list,omitempty"` QuotaResetDate *string `json:"quota_reset_date,omitempty"` - QuotaResetDateUtc *string `json:"quota_reset_date_utc,omitempty"` + QuotaResetDateUTC *string `json:"quota_reset_date_utc,omitempty"` // Schema for the `CopilotUserResponseQuotaSnapshots` type. QuotaSnapshots *CopilotUserResponseQuotaSnapshots `json:"quota_snapshots,omitempty"` RestrictedTelemetry *bool `json:"restricted_telemetry,omitempty"` @@ -1035,7 +1035,7 @@ type CopilotUserResponseQuotaSnapshotsChat struct { QuotaRemaining *float64 `json:"quota_remaining,omitempty"` QuotaResetAt *float64 `json:"quota_reset_at,omitempty"` Remaining *float64 `json:"remaining,omitempty"` - TimestampUtc *string `json:"timestamp_utc,omitempty"` + TimestampUTC *string `json:"timestamp_utc,omitempty"` TokenBasedBilling *bool `json:"token_based_billing,omitempty"` Unlimited *bool `json:"unlimited,omitempty"` } @@ -1053,7 +1053,7 @@ type CopilotUserResponseQuotaSnapshotsCompletions struct { QuotaRemaining *float64 `json:"quota_remaining,omitempty"` QuotaResetAt *float64 `json:"quota_reset_at,omitempty"` Remaining *float64 `json:"remaining,omitempty"` - TimestampUtc *string `json:"timestamp_utc,omitempty"` + TimestampUTC *string `json:"timestamp_utc,omitempty"` TokenBasedBilling *bool `json:"token_based_billing,omitempty"` Unlimited *bool `json:"unlimited,omitempty"` } @@ -1071,7 +1071,7 @@ type CopilotUserResponseQuotaSnapshotsPremiumInteractions struct { QuotaRemaining *float64 `json:"quota_remaining,omitempty"` QuotaResetAt *float64 `json:"quota_reset_at,omitempty"` Remaining *float64 `json:"remaining,omitempty"` - TimestampUtc *string `json:"timestamp_utc,omitempty"` + TimestampUTC *string `json:"timestamp_utc,omitempty"` TokenBasedBilling *bool `json:"token_based_billing,omitempty"` Unlimited *bool `json:"unlimited,omitempty"` } @@ -1102,9 +1102,9 @@ type CurrentToolMetadata struct { // JSON Schema for tool input InputSchema map[string]any `json:"input_schema,omitempty"` // MCP server name for MCP-backed tools - McpServerName *string `json:"mcpServerName,omitempty"` + MCPServerName *string `json:"mcpServerName,omitempty"` // Raw MCP tool name for MCP-backed tools - McpToolName *string `json:"mcpToolName,omitempty"` + MCPToolName *string `json:"mcpToolName,omitempty"` // Model-facing tool name Name string `json:"name"` // Optional MCP/config namespaced tool name @@ -1132,15 +1132,15 @@ type DiscoveredCanvas struct { } // Schema for the `DiscoveredMcpServer` type. -type DiscoveredMcpServer struct { +type DiscoveredMCPServer struct { // Whether the server is enabled (not in the disabled list) Enabled bool `json:"enabled"` // Server name (config key) Name string `json:"name"` // Configuration source: user, workspace, plugin, or builtin - Source McpServerSource `json:"source"` + Source MCPServerSource `json:"source"` // Server transport type: stdio, http, sse (deprecated), or memory - Type *DiscoveredMcpServerType `json:"type,omitempty"` + Type *DiscoveredMCPServerType `json:"type,omitempty"` } // Slash-prefixed command string to enqueue for FIFO processing. @@ -1700,21 +1700,21 @@ type InstalledPlugin struct { // Experimental: InstalledPluginSource is part of an experimental API and may change or be // removed. type InstalledPluginSource struct { - InstalledPluginSourceGithub *InstalledPluginSourceGithub + InstalledPluginSourceGitHub *InstalledPluginSourceGitHub InstalledPluginSourceLocal *InstalledPluginSourceLocal InstalledPluginSourceURL *InstalledPluginSourceURL String *string } // Schema for the `InstalledPluginSourceGithub` type. -// Experimental: InstalledPluginSourceGithub is part of an experimental API and may change +// Experimental: InstalledPluginSourceGitHub is part of an experimental API and may change // or be removed. -type InstalledPluginSourceGithub struct { +type InstalledPluginSourceGitHub struct { Path *string `json:"path,omitempty"` Ref *string `json:"ref,omitempty"` Repo string `json:"repo"` // Constant value. Always "github". - Source InstalledPluginSourceGithubSource `json:"source"` + Source InstalledPluginSourceGitHubSource `json:"source"` } // Schema for the `InstalledPluginSourceLocal` type. @@ -1813,9 +1813,9 @@ type LspInitializeRequest struct { } // MCP server, tool name, and arguments to invoke from an MCP App view. -// Experimental: McpAppsCallToolRequest is part of an experimental API and may change or be +// Experimental: MCPAppsCallToolRequest is part of an experimental API and may change or be // removed. -type McpAppsCallToolRequest struct { +type MCPAppsCallToolRequest struct { // Tool arguments Arguments map[string]any `json:"arguments,omitempty"` // **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the @@ -1829,39 +1829,39 @@ type McpAppsCallToolRequest struct { } // Capability negotiation snapshot -// Experimental: McpAppsDiagnoseCapability is part of an experimental API and may change or +// Experimental: MCPAppsDiagnoseCapability is part of an experimental API and may change or // be removed. -type McpAppsDiagnoseCapability struct { +type MCPAppsDiagnoseCapability struct { // Whether the runtime advertises `extensions.io.modelcontextprotocol/ui` to MCP servers Advertised bool `json:"advertised"` // Whether the MCP_APPS feature flag (or COPILOT_MCP_APPS env override) is on FeatureFlagEnabled bool `json:"featureFlagEnabled"` // Whether the session has the `mcp-apps` capability - SessionHasMcpApps bool `json:"sessionHasMcpApps"` + SessionHasMCPApps bool `json:"sessionHasMcpApps"` } // MCP server to diagnose MCP Apps wiring for. -// Experimental: McpAppsDiagnoseRequest is part of an experimental API and may change or be +// Experimental: MCPAppsDiagnoseRequest is part of an experimental API and may change or be // removed. -type McpAppsDiagnoseRequest struct { +type MCPAppsDiagnoseRequest struct { // MCP server to probe ServerName string `json:"serverName"` } // Diagnostic snapshot of MCP Apps wiring for the named server. -// Experimental: McpAppsDiagnoseResult is part of an experimental API and may change or be +// Experimental: MCPAppsDiagnoseResult is part of an experimental API and may change or be // removed. -type McpAppsDiagnoseResult struct { +type MCPAppsDiagnoseResult struct { // Capability negotiation snapshot - Capability McpAppsDiagnoseCapability `json:"capability"` + Capability MCPAppsDiagnoseCapability `json:"capability"` // What the server returned for this session - Server McpAppsDiagnoseServer `json:"server"` + Server MCPAppsDiagnoseServer `json:"server"` } // What the server returned for this session -// Experimental: McpAppsDiagnoseServer is part of an experimental API and may change or be +// Experimental: MCPAppsDiagnoseServer is part of an experimental API and may change or be // removed. -type McpAppsDiagnoseServer struct { +type MCPAppsDiagnoseServer struct { // Whether the named server is currently connected Connected bool `json:"connected"` // Up to 5 tool names with `_meta.ui` for quick inspection @@ -1873,27 +1873,27 @@ type McpAppsDiagnoseServer struct { } // Current host context advertised to MCP App guests. -// Experimental: McpAppsHostContext is part of an experimental API and may change or be +// Experimental: MCPAppsHostContext is part of an experimental API and may change or be // removed. -type McpAppsHostContext struct { +type MCPAppsHostContext struct { // Current host context - Context McpAppsHostContextDetails `json:"context"` + Context MCPAppsHostContextDetails `json:"context"` } // Current host context -// Experimental: McpAppsHostContextDetails is part of an experimental API and may change or +// Experimental: MCPAppsHostContextDetails is part of an experimental API and may change or // be removed. -type McpAppsHostContextDetails struct { +type MCPAppsHostContextDetails struct { // Display modes the host supports - AvailableDisplayModes []McpAppsHostContextDetailsAvailableDisplayMode `json:"availableDisplayModes,omitempty"` + AvailableDisplayModes []MCPAppsHostContextDetailsAvailableDisplayMode `json:"availableDisplayModes,omitempty"` // Current display mode (SEP-1865) - DisplayMode *McpAppsHostContextDetailsDisplayMode `json:"displayMode,omitempty"` + DisplayMode *MCPAppsHostContextDetailsDisplayMode `json:"displayMode,omitempty"` // BCP-47 locale, e.g. 'en-US' Locale *string `json:"locale,omitempty"` // Platform type for responsive design - Platform *McpAppsHostContextDetailsPlatform `json:"platform,omitempty"` + Platform *MCPAppsHostContextDetailsPlatform `json:"platform,omitempty"` // UI theme preference per SEP-1865 - Theme *McpAppsHostContextDetailsTheme `json:"theme,omitempty"` + Theme *MCPAppsHostContextDetailsTheme `json:"theme,omitempty"` // IANA timezone, e.g. 'America/New_York' TimeZone *string `json:"timeZone,omitempty"` // Host application identifier @@ -1901,9 +1901,9 @@ type McpAppsHostContextDetails struct { } // MCP server to list app-callable tools for. -// Experimental: McpAppsListToolsRequest is part of an experimental API and may change or be +// Experimental: MCPAppsListToolsRequest is part of an experimental API and may change or be // removed. -type McpAppsListToolsRequest struct { +type MCPAppsListToolsRequest struct { // **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the // app from this server only'), the call is rejected when this differs from `serverName`, // and rejected outright when missing. @@ -1913,17 +1913,17 @@ type McpAppsListToolsRequest struct { } // App-callable tools from the named MCP server. -// Experimental: McpAppsListToolsResult is part of an experimental API and may change or be +// Experimental: MCPAppsListToolsResult is part of an experimental API and may change or be // removed. -type McpAppsListToolsResult struct { +type MCPAppsListToolsResult struct { // App-callable tools from the server Tools []map[string]any `json:"tools"` } // MCP server and resource URI to fetch. -// Experimental: McpAppsReadResourceRequest is part of an experimental API and may change or +// Experimental: MCPAppsReadResourceRequest is part of an experimental API and may change or // be removed. -type McpAppsReadResourceRequest struct { +type MCPAppsReadResourceRequest struct { // Name of the MCP server hosting the resource ServerName string `json:"serverName"` // Resource URI (typically ui://...) @@ -1931,17 +1931,17 @@ type McpAppsReadResourceRequest struct { } // Resource contents returned by the MCP server. -// Experimental: McpAppsReadResourceResult is part of an experimental API and may change or +// Experimental: MCPAppsReadResourceResult is part of an experimental API and may change or // be removed. -type McpAppsReadResourceResult struct { +type MCPAppsReadResourceResult struct { // Resource contents returned by the server - Contents []McpAppsResourceContent `json:"contents"` + Contents []MCPAppsResourceContent `json:"contents"` } // Schema for the `McpAppsResourceContent` type. -// Experimental: McpAppsResourceContent is part of an experimental API and may change or be +// Experimental: MCPAppsResourceContent is part of an experimental API and may change or be // removed. -type McpAppsResourceContent struct { +type MCPAppsResourceContent struct { // Base64-encoded binary content Blob *string `json:"blob,omitempty"` // Resource-level metadata (CSP, permissions, etc.) @@ -1955,19 +1955,19 @@ type McpAppsResourceContent struct { } // Host context advertised to MCP App guests -// Experimental: McpAppsSetHostContextDetails is part of an experimental API and may change +// Experimental: MCPAppsSetHostContextDetails is part of an experimental API and may change // or be removed. -type McpAppsSetHostContextDetails struct { +type MCPAppsSetHostContextDetails struct { // Display modes the host supports - AvailableDisplayModes []McpAppsSetHostContextDetailsAvailableDisplayMode `json:"availableDisplayModes,omitempty"` + AvailableDisplayModes []MCPAppsSetHostContextDetailsAvailableDisplayMode `json:"availableDisplayModes,omitempty"` // Current display mode (SEP-1865) - DisplayMode *McpAppsSetHostContextDetailsDisplayMode `json:"displayMode,omitempty"` + DisplayMode *MCPAppsSetHostContextDetailsDisplayMode `json:"displayMode,omitempty"` // BCP-47 locale, e.g. 'en-US' Locale *string `json:"locale,omitempty"` // Platform type for responsive design - Platform *McpAppsSetHostContextDetailsPlatform `json:"platform,omitempty"` + Platform *MCPAppsSetHostContextDetailsPlatform `json:"platform,omitempty"` // UI theme preference per SEP-1865 - Theme *McpAppsSetHostContextDetailsTheme `json:"theme,omitempty"` + Theme *MCPAppsSetHostContextDetailsTheme `json:"theme,omitempty"` // IANA timezone, e.g. 'America/New_York' TimeZone *string `json:"timeZone,omitempty"` // Host application identifier @@ -1975,26 +1975,26 @@ type McpAppsSetHostContextDetails struct { } // Host context to advertise to MCP App guests. -// Experimental: McpAppsSetHostContextRequest is part of an experimental API and may change +// Experimental: MCPAppsSetHostContextRequest is part of an experimental API and may change // or be removed. -type McpAppsSetHostContextRequest struct { +type MCPAppsSetHostContextRequest struct { // Host context advertised to MCP App guests - Context McpAppsSetHostContextDetails `json:"context"` + Context MCPAppsSetHostContextDetails `json:"context"` } // The requestId previously passed to executeSampling that should be cancelled. -// Experimental: McpCancelSamplingExecutionParams is part of an experimental API and may +// Experimental: MCPCancelSamplingExecutionParams is part of an experimental API and may // change or be removed. -type McpCancelSamplingExecutionParams struct { +type MCPCancelSamplingExecutionParams struct { // The requestId previously passed to executeSampling that should be cancelled RequestID string `json:"requestId"` } // Indicates whether an in-flight sampling execution with the given requestId was found and // cancelled. -// Experimental: McpCancelSamplingExecutionResult is part of an experimental API and may +// Experimental: MCPCancelSamplingExecutionResult is part of an experimental API and may // change or be removed. -type McpCancelSamplingExecutionResult struct { +type MCPCancelSamplingExecutionResult struct { // True if an in-flight execution with the given requestId was found and signalled to // cancel. False when no such execution is in flight (already completed, never started, or // cancelled by another caller). @@ -2002,106 +2002,106 @@ type McpCancelSamplingExecutionResult struct { } // MCP server name and configuration to add to user configuration. -type McpConfigAddRequest struct { +type MCPConfigAddRequest struct { // MCP server configuration (stdio process or remote HTTP/SSE) - Config McpServerConfig `json:"config"` + Config MCPServerConfig `json:"config"` // Unique name for the MCP server Name string `json:"name"` } -type McpConfigAddResult struct { +type MCPConfigAddResult struct { } // MCP server names to disable for new sessions. -type McpConfigDisableRequest struct { +type MCPConfigDisableRequest struct { // Names of MCP servers to disable. Each server is added to the persisted disabled list so // new sessions skip it. Already-disabled names are ignored. Active sessions keep their // current connections until they end. Names []string `json:"names"` } -type McpConfigDisableResult struct { +type MCPConfigDisableResult struct { } // MCP server names to enable for new sessions. -type McpConfigEnableRequest struct { +type MCPConfigEnableRequest struct { // Names of MCP servers to enable. Each server is removed from the persisted disabled list // so new sessions spawn it. Unknown or already-enabled names are ignored. Names []string `json:"names"` } -type McpConfigEnableResult struct { +type MCPConfigEnableResult struct { } // User-configured MCP servers, keyed by server name. -type McpConfigList struct { +type MCPConfigList struct { // All MCP servers from user config, keyed by name - Servers map[string]McpServerConfig `json:"servers"` + Servers map[string]MCPServerConfig `json:"servers"` } -type McpConfigReloadResult struct { +type MCPConfigReloadResult struct { } // MCP server name to remove from user configuration. -type McpConfigRemoveRequest struct { +type MCPConfigRemoveRequest struct { // Name of the MCP server to remove Name string `json:"name"` } -type McpConfigRemoveResult struct { +type MCPConfigRemoveResult struct { } // MCP server name and replacement configuration to write to user configuration. -type McpConfigUpdateRequest struct { +type MCPConfigUpdateRequest struct { // MCP server configuration (stdio process or remote HTTP/SSE) - Config McpServerConfig `json:"config"` + Config MCPServerConfig `json:"config"` // Name of the MCP server to update Name string `json:"name"` } -type McpConfigUpdateResult struct { +type MCPConfigUpdateResult struct { } // Name of the MCP server to disable for the session. -// Experimental: McpDisableRequest is part of an experimental API and may change or be +// Experimental: MCPDisableRequest is part of an experimental API and may change or be // removed. -type McpDisableRequest struct { +type MCPDisableRequest struct { // Name of the MCP server to disable ServerName string `json:"serverName"` } // Optional working directory used as context for MCP server discovery. -type McpDiscoverRequest struct { +type MCPDiscoverRequest struct { // Working directory used as context for discovery (e.g., plugin resolution) WorkingDirectory *string `json:"workingDirectory,omitempty"` } // MCP servers discovered from user, workspace, plugin, and built-in sources. -type McpDiscoverResult struct { +type MCPDiscoverResult struct { // MCP servers discovered from all sources - Servers []DiscoveredMcpServer `json:"servers"` + Servers []DiscoveredMCPServer `json:"servers"` } // Name of the MCP server to enable for the session. -// Experimental: McpEnableRequest is part of an experimental API and may change or be +// Experimental: MCPEnableRequest is part of an experimental API and may change or be // removed. -type McpEnableRequest struct { +type MCPEnableRequest struct { // Name of the MCP server to enable ServerName string `json:"serverName"` } // Identifiers and raw MCP CreateMessageRequest params used to run a sampling inference. -// Experimental: McpExecuteSamplingParams is part of an experimental API and may change or +// Experimental: MCPExecuteSamplingParams is part of an experimental API and may change or // be removed. -type McpExecuteSamplingParams struct { +type MCPExecuteSamplingParams struct { // The original MCP JSON-RPC request ID (string or number). Used by the runtime to correlate // the inference with the originating MCP request for telemetry; this is distinct from // `requestId` (which is the schema-level cancellation handle). - McpRequestID any `json:"mcpRequestId"` + MCPRequestID any `json:"mcpRequestId"` // Raw MCP CreateMessageRequest params, as received in the `sampling.requested` event. // Treated as opaque at the schema layer; the runtime converts the embedded MCP messages // into the OpenAI chat-completion shape internally. - Request McpExecuteSamplingRequest `json:"request"` + Request MCPExecuteSamplingRequest `json:"request"` // Caller-provided unique identifier for this sampling execution. Use this same ID with // cancelSamplingExecution to cancel the in-flight call. Must be unique within the session // for the lifetime of the call. @@ -2113,24 +2113,24 @@ type McpExecuteSamplingParams struct { // Raw MCP CreateMessageRequest params, as received in the `sampling.requested` event. // Treated as opaque at the schema layer; the runtime converts the embedded MCP messages // into the OpenAI chat-completion shape internally. -// Experimental: McpExecuteSamplingRequest is part of an experimental API and may change or +// Experimental: MCPExecuteSamplingRequest is part of an experimental API and may change or // be removed. -type McpExecuteSamplingRequest struct { +type MCPExecuteSamplingRequest struct { } // MCP CreateMessageResult payload (with optional 'tools' extension), present when // action='success'. Treated as opaque at the schema layer; consumers should // construct/consume it per the MCP CreateMessageResult shape. -// Experimental: McpExecuteSamplingResult is part of an experimental API and may change or +// Experimental: MCPExecuteSamplingResult is part of an experimental API and may change or // be removed. -type McpExecuteSamplingResult struct { +type MCPExecuteSamplingResult struct { } // Remote MCP server name and optional overrides controlling reauthentication, OAuth client // display name, and the callback success-page copy. -// Experimental: McpOauthLoginRequest is part of an experimental API and may change or be +// Experimental: MCPOauthLoginRequest is part of an experimental API and may change or be // removed. -type McpOauthLoginRequest struct { +type MCPOauthLoginRequest struct { // Optional override for the body text shown on the OAuth loopback callback success page. // When omitted, the runtime applies a neutral fallback; callers driving interactive auth // should pass surface-specific copy telling the user where to return. @@ -2151,9 +2151,9 @@ type McpOauthLoginRequest struct { // OAuth authorization URL the caller should open, or empty when cached tokens already // authenticated the server. -// Experimental: McpOauthLoginResult is part of an experimental API and may change or be +// Experimental: MCPOauthLoginResult is part of an experimental API and may change or be // removed. -type McpOauthLoginResult struct { +type MCPOauthLoginResult struct { // URL the caller should open in a browser to complete OAuth. Omitted when cached tokens // were still valid and no browser interaction was needed — the server is already // reconnected in that case. When present, the runtime starts the callback listener before @@ -2164,9 +2164,9 @@ type McpOauthLoginResult struct { // Indicates whether the auto-managed `github` MCP server was removed (false when nothing to // remove). -// Experimental: McpRemoveGitHubResult is part of an experimental API and may change or be +// Experimental: MCPRemoveGitHubResult is part of an experimental API and may change or be // removed. -type McpRemoveGitHubResult struct { +type MCPRemoveGitHubResult struct { // True when the auto-managed `github` MCP server was removed; false when no removal // happened (e.g. user has explicitly configured a `github` server, or the server was not // registered). @@ -2174,66 +2174,66 @@ type McpRemoveGitHubResult struct { } // Outcome of an MCP sampling execution: success result, failure error, or cancellation. -// Experimental: McpSamplingExecutionResult is part of an experimental API and may change or +// Experimental: MCPSamplingExecutionResult is part of an experimental API and may change or // be removed. -type McpSamplingExecutionResult struct { +type MCPSamplingExecutionResult struct { // Outcome of the sampling inference. 'success' produced a response; 'failure' encountered // an error (including agent-side rejection by content filter or criteria); 'cancelled' the // caller cancelled this execution via cancelSamplingExecution. - Action McpSamplingExecutionAction `json:"action"` + Action MCPSamplingExecutionAction `json:"action"` // Error description, present when action='failure'. Error *string `json:"error,omitempty"` // MCP CreateMessageResult payload (with optional 'tools' extension), present when // action='success'. Treated as opaque at the schema layer; consumers should // construct/consume it per the MCP CreateMessageResult shape. - Result *McpExecuteSamplingResult `json:"result,omitempty"` + Result *MCPExecuteSamplingResult `json:"result,omitempty"` } // Schema for the `McpServer` type. -// Experimental: McpServer is part of an experimental API and may change or be removed. -type McpServer struct { +// Experimental: MCPServer is part of an experimental API and may change or be removed. +type MCPServer struct { // Error message if the server failed to connect Error *string `json:"error,omitempty"` // Server name (config key) Name string `json:"name"` // Configuration source: user, workspace, plugin, or builtin - Source *McpServerSource `json:"source,omitempty"` + Source *MCPServerSource `json:"source,omitempty"` // Connection status: connected, failed, needs-auth, pending, disabled, or not_configured - Status McpServerStatus `json:"status"` + Status MCPServerStatus `json:"status"` } // Set to `true` to use defaults, or provide an object with additional auth or OIDC settings. -type McpServerAuthConfig interface { - mcpServerAuthConfig() +type MCPServerAuthConfig interface { + mCPServerAuthConfig() } -type McpServerAuthConfigBoolean bool +type MCPServerAuthConfigBoolean bool -func (McpServerAuthConfigBoolean) mcpServerAuthConfig() {} +func (MCPServerAuthConfigBoolean) mCPServerAuthConfig() {} -func (McpServerAuthConfigRedirectPort) mcpServerAuthConfig() {} +func (MCPServerAuthConfigRedirectPort) mCPServerAuthConfig() {} // Authentication settings with optional redirect port configuration. -type McpServerAuthConfigRedirectPort struct { +type MCPServerAuthConfigRedirectPort struct { // Fixed port for the OAuth redirect callback server. RedirectPort *int32 `json:"redirectPort,omitempty"` } // MCP server configuration (stdio process or remote HTTP/SSE) -type McpServerConfig interface { - mcpServerConfig() +type MCPServerConfig interface { + mCPServerConfig() } -type RawMcpServerConfigData struct { +type RawMCPServerConfigData struct { Raw json.RawMessage } -func (RawMcpServerConfigData) mcpServerConfig() {} +func (RawMCPServerConfigData) mCPServerConfig() {} // Remote MCP server configuration accessed over HTTP or SSE. -type McpServerConfigHTTP struct { +type MCPServerConfigHTTP struct { // Set to `true` to use defaults, or provide an object with additional auth or OIDC settings. - Auth McpServerAuthConfig `json:"auth,omitempty"` + Auth MCPServerAuthConfig `json:"auth,omitempty"` // Content filtering mode to apply to all tools, or a map of tool name to content filtering // mode. FilterMapping FilterMapping `json:"filterMapping,omitempty"` @@ -2245,29 +2245,29 @@ type McpServerConfigHTTP struct { // OAuth client ID for a pre-registered remote MCP OAuth client. OauthClientID *string `json:"oauthClientId,omitempty"` // OAuth grant type to use when authenticating to the remote MCP server. - OauthGrantType *McpServerConfigHTTPOauthGrantType `json:"oauthGrantType,omitempty"` + OauthGrantType *MCPServerConfigHTTPOauthGrantType `json:"oauthGrantType,omitempty"` // Whether the configured OAuth client is public and does not require a client secret. OauthPublicClient *bool `json:"oauthPublicClient,omitempty"` // Set to `true` to use defaults, or provide an object with additional auth or OIDC settings. - Oidc McpServerAuthConfig `json:"oidc,omitempty"` + Oidc MCPServerAuthConfig `json:"oidc,omitempty"` // Timeout in milliseconds for tool calls to this server. Timeout *int64 `json:"timeout,omitempty"` // Tools to include. Defaults to all tools if not specified. Tools []string `json:"tools,omitempty"` // Remote transport type. Defaults to "http" when omitted. - Type *McpServerConfigHTTPType `json:"type,omitempty"` + Type *MCPServerConfigHTTPType `json:"type,omitempty"` // URL of the remote MCP server endpoint. URL string `json:"url"` } -func (McpServerConfigHTTP) mcpServerConfig() {} +func (MCPServerConfigHTTP) mCPServerConfig() {} // Stdio MCP server configuration launched as a child process. -type McpServerConfigStdio struct { +type MCPServerConfigStdio struct { // Command-line arguments passed to the Stdio MCP server process. Args []string `json:"args,omitempty"` // Set to `true` to use defaults, or provide an object with additional auth or OIDC settings. - Auth McpServerAuthConfig `json:"auth,omitempty"` + Auth MCPServerAuthConfig `json:"auth,omitempty"` // Executable command used to start the Stdio MCP server process. Command string `json:"command"` // Working directory for the Stdio MCP server process. @@ -2281,40 +2281,40 @@ type McpServerConfigStdio struct { // own server. IsDefaultServer *bool `json:"isDefaultServer,omitempty"` // Set to `true` to use defaults, or provide an object with additional auth or OIDC settings. - Oidc McpServerAuthConfig `json:"oidc,omitempty"` + Oidc MCPServerAuthConfig `json:"oidc,omitempty"` // Timeout in milliseconds for tool calls to this server. Timeout *int64 `json:"timeout,omitempty"` // Tools to include. Defaults to all tools if not specified. Tools []string `json:"tools,omitempty"` } -func (McpServerConfigStdio) mcpServerConfig() {} +func (MCPServerConfigStdio) mCPServerConfig() {} // MCP servers configured for the session, with their connection status. -// Experimental: McpServerList is part of an experimental API and may change or be removed. -type McpServerList struct { +// Experimental: MCPServerList is part of an experimental API and may change or be removed. +type MCPServerList struct { // Configured MCP servers - Servers []McpServer `json:"servers"` + Servers []MCPServer `json:"servers"` } // Mode controlling how MCP server env values are resolved (`direct` or `indirect`). -// Experimental: McpSetEnvValueModeParams is part of an experimental API and may change or +// Experimental: MCPSetEnvValueModeParams is part of an experimental API and may change or // be removed. -type McpSetEnvValueModeParams struct { +type MCPSetEnvValueModeParams struct { // How environment-variable values supplied to MCP servers are resolved. "direct" passes // literal string values; "indirect" treats values as references (e.g. names of environment // variables on the host) that the runtime resolves before launch. Defaults to the runtime's // startup mode; clients that intentionally launch MCP servers with literal values (e.g. CLI // prompt mode and ACP) set this to "direct". - Mode McpSetEnvValueModeDetails `json:"mode"` + Mode MCPSetEnvValueModeDetails `json:"mode"` } // Env-value mode recorded on the session after the update. -// Experimental: McpSetEnvValueModeResult is part of an experimental API and may change or +// Experimental: MCPSetEnvValueModeResult is part of an experimental API and may change or // be removed. -type McpSetEnvValueModeResult struct { +type MCPSetEnvValueModeResult struct { // Mode recorded on the session after the update - Mode McpSetEnvValueModeDetails `json:"mode"` + Mode MCPSetEnvValueModeDetails `json:"mode"` } // Model identifier and token limits used to compute the context-info breakdown. @@ -3044,33 +3044,33 @@ func (PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess) Kin } // Schema for the `PermissionDecisionApproveForLocationApprovalMcp` type. -// Experimental: PermissionDecisionApproveForLocationApprovalMcp is part of an experimental +// Experimental: PermissionDecisionApproveForLocationApprovalMCP is part of an experimental // API and may change or be removed. -type PermissionDecisionApproveForLocationApprovalMcp struct { +type PermissionDecisionApproveForLocationApprovalMCP struct { // MCP server name. ServerName string `json:"serverName"` // MCP tool name, or null to cover every tool on the server. ToolName *string `json:"toolName"` } -func (PermissionDecisionApproveForLocationApprovalMcp) permissionDecisionApproveForLocationApproval() { +func (PermissionDecisionApproveForLocationApprovalMCP) permissionDecisionApproveForLocationApproval() { } -func (PermissionDecisionApproveForLocationApprovalMcp) Kind() PermissionDecisionApproveForLocationApprovalKind { - return PermissionDecisionApproveForLocationApprovalKindMcp +func (PermissionDecisionApproveForLocationApprovalMCP) Kind() PermissionDecisionApproveForLocationApprovalKind { + return PermissionDecisionApproveForLocationApprovalKindMCP } // Schema for the `PermissionDecisionApproveForLocationApprovalMcpSampling` type. -// Experimental: PermissionDecisionApproveForLocationApprovalMcpSampling is part of an +// Experimental: PermissionDecisionApproveForLocationApprovalMCPSampling is part of an // experimental API and may change or be removed. -type PermissionDecisionApproveForLocationApprovalMcpSampling struct { +type PermissionDecisionApproveForLocationApprovalMCPSampling struct { // MCP server name. ServerName string `json:"serverName"` } -func (PermissionDecisionApproveForLocationApprovalMcpSampling) permissionDecisionApproveForLocationApproval() { +func (PermissionDecisionApproveForLocationApprovalMCPSampling) permissionDecisionApproveForLocationApproval() { } -func (PermissionDecisionApproveForLocationApprovalMcpSampling) Kind() PermissionDecisionApproveForLocationApprovalKind { - return PermissionDecisionApproveForLocationApprovalKindMcpSampling +func (PermissionDecisionApproveForLocationApprovalMCPSampling) Kind() PermissionDecisionApproveForLocationApprovalKind { + return PermissionDecisionApproveForLocationApprovalKindMCPSampling } // Schema for the `PermissionDecisionApproveForLocationApprovalMemory` type. @@ -3187,32 +3187,32 @@ func (PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess) Kind } // Schema for the `PermissionDecisionApproveForSessionApprovalMcp` type. -// Experimental: PermissionDecisionApproveForSessionApprovalMcp is part of an experimental +// Experimental: PermissionDecisionApproveForSessionApprovalMCP is part of an experimental // API and may change or be removed. -type PermissionDecisionApproveForSessionApprovalMcp struct { +type PermissionDecisionApproveForSessionApprovalMCP struct { // MCP server name. ServerName string `json:"serverName"` // MCP tool name, or null to cover every tool on the server. ToolName *string `json:"toolName"` } -func (PermissionDecisionApproveForSessionApprovalMcp) permissionDecisionApproveForSessionApproval() {} -func (PermissionDecisionApproveForSessionApprovalMcp) Kind() PermissionDecisionApproveForSessionApprovalKind { - return PermissionDecisionApproveForSessionApprovalKindMcp +func (PermissionDecisionApproveForSessionApprovalMCP) permissionDecisionApproveForSessionApproval() {} +func (PermissionDecisionApproveForSessionApprovalMCP) Kind() PermissionDecisionApproveForSessionApprovalKind { + return PermissionDecisionApproveForSessionApprovalKindMCP } // Schema for the `PermissionDecisionApproveForSessionApprovalMcpSampling` type. -// Experimental: PermissionDecisionApproveForSessionApprovalMcpSampling is part of an +// Experimental: PermissionDecisionApproveForSessionApprovalMCPSampling is part of an // experimental API and may change or be removed. -type PermissionDecisionApproveForSessionApprovalMcpSampling struct { +type PermissionDecisionApproveForSessionApprovalMCPSampling struct { // MCP server name. ServerName string `json:"serverName"` } -func (PermissionDecisionApproveForSessionApprovalMcpSampling) permissionDecisionApproveForSessionApproval() { +func (PermissionDecisionApproveForSessionApprovalMCPSampling) permissionDecisionApproveForSessionApproval() { } -func (PermissionDecisionApproveForSessionApprovalMcpSampling) Kind() PermissionDecisionApproveForSessionApprovalKind { - return PermissionDecisionApproveForSessionApprovalKindMcpSampling +func (PermissionDecisionApproveForSessionApprovalMCPSampling) Kind() PermissionDecisionApproveForSessionApprovalKind { + return PermissionDecisionApproveForSessionApprovalKindMCPSampling } // Schema for the `PermissionDecisionApproveForSessionApprovalMemory` type. @@ -3490,7 +3490,7 @@ type PermissionsConfigureParams struct { // If specified, replaces the session's URL-permission policy. The runtime constructs a // fresh DefaultUrlManager based on these inputs. Omit to leave the current URL policy // unchanged. - Urls *PermissionUrlsConfig `json:"urls,omitempty"` + URLs *PermissionURLsConfig `json:"urls,omitempty"` } // Indicates whether the operation succeeded. @@ -3592,32 +3592,32 @@ func (PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess) Kind( } // Schema for the `PermissionsLocationsAddToolApprovalDetailsMcp` type. -// Experimental: PermissionsLocationsAddToolApprovalDetailsMcp is part of an experimental +// Experimental: PermissionsLocationsAddToolApprovalDetailsMCP is part of an experimental // API and may change or be removed. -type PermissionsLocationsAddToolApprovalDetailsMcp struct { +type PermissionsLocationsAddToolApprovalDetailsMCP struct { // MCP server name. ServerName string `json:"serverName"` // MCP tool name, or null to cover every tool on the server. ToolName *string `json:"toolName"` } -func (PermissionsLocationsAddToolApprovalDetailsMcp) permissionsLocationsAddToolApprovalDetails() {} -func (PermissionsLocationsAddToolApprovalDetailsMcp) Kind() PermissionsLocationsAddToolApprovalDetailsKind { - return PermissionsLocationsAddToolApprovalDetailsKindMcp +func (PermissionsLocationsAddToolApprovalDetailsMCP) permissionsLocationsAddToolApprovalDetails() {} +func (PermissionsLocationsAddToolApprovalDetailsMCP) Kind() PermissionsLocationsAddToolApprovalDetailsKind { + return PermissionsLocationsAddToolApprovalDetailsKindMCP } // Schema for the `PermissionsLocationsAddToolApprovalDetailsMcpSampling` type. -// Experimental: PermissionsLocationsAddToolApprovalDetailsMcpSampling is part of an +// Experimental: PermissionsLocationsAddToolApprovalDetailsMCPSampling is part of an // experimental API and may change or be removed. -type PermissionsLocationsAddToolApprovalDetailsMcpSampling struct { +type PermissionsLocationsAddToolApprovalDetailsMCPSampling struct { // MCP server name. ServerName string `json:"serverName"` } -func (PermissionsLocationsAddToolApprovalDetailsMcpSampling) permissionsLocationsAddToolApprovalDetails() { +func (PermissionsLocationsAddToolApprovalDetailsMCPSampling) permissionsLocationsAddToolApprovalDetails() { } -func (PermissionsLocationsAddToolApprovalDetailsMcpSampling) Kind() PermissionsLocationsAddToolApprovalDetailsKind { - return PermissionsLocationsAddToolApprovalDetailsKindMcpSampling +func (PermissionsLocationsAddToolApprovalDetailsMCPSampling) Kind() PermissionsLocationsAddToolApprovalDetailsKind { + return PermissionsLocationsAddToolApprovalDetailsKindMCPSampling } // Schema for the `PermissionsLocationsAddToolApprovalDetailsMemory` type. @@ -3784,9 +3784,9 @@ type PermissionsSetRequiredResult struct { } // Indicates whether the operation succeeded. -// Experimental: PermissionsUrlsSetUnrestrictedModeResult is part of an experimental API and +// Experimental: PermissionsURLsSetUnrestrictedModeResult is part of an experimental API and // may change or be removed. -type PermissionsUrlsSetUnrestrictedModeResult struct { +type PermissionsURLsSetUnrestrictedModeResult struct { // Whether the operation succeeded Success bool `json:"success"` } @@ -3794,9 +3794,9 @@ type PermissionsUrlsSetUnrestrictedModeResult struct { // If specified, replaces the session's URL-permission policy. The runtime constructs a // fresh DefaultUrlManager based on these inputs. Omit to leave the current URL policy // unchanged. -// Experimental: PermissionUrlsConfig is part of an experimental API and may change or be +// Experimental: PermissionURLsConfig is part of an experimental API and may change or be // removed. -type PermissionUrlsConfig struct { +type PermissionURLsConfig struct { // Initial list of allowed URL/domain patterns. Patterns may include path components. // Ignored when `unrestricted` is true. InitialAllowed []string `json:"initialAllowed,omitempty"` @@ -3806,9 +3806,9 @@ type PermissionUrlsConfig struct { } // Whether the URL-permission policy should run in unrestricted mode. -// Experimental: PermissionUrlsSetUnrestrictedModeParams is part of an experimental API and +// Experimental: PermissionURLsSetUnrestrictedModeParams is part of an experimental API and // may change or be removed. -type PermissionUrlsSetUnrestrictedModeParams struct { +type PermissionURLsSetUnrestrictedModeParams struct { // Whether to allow access to all URLs without prompting. Toggles the runtime's // URL-permission policy in place. Enabled bool `json:"enabled"` @@ -3952,13 +3952,13 @@ func (PushAttachmentFile) Type() PushAttachmentType { } // GitHub issue, pull request, or discussion reference -// Experimental: PushAttachmentGithubReference is part of an experimental API and may change +// Experimental: PushAttachmentGitHubReference is part of an experimental API and may change // or be removed. -type PushAttachmentGithubReference struct { +type PushAttachmentGitHubReference struct { // Issue, pull request, or discussion number Number int64 `json:"number"` // Type of GitHub reference - ReferenceType PushAttachmentGithubReferenceType `json:"referenceType"` + ReferenceType PushAttachmentGitHubReferenceType `json:"referenceType"` // Current state of the referenced item (e.g., open, closed, merged) State string `json:"state"` // Title of the referenced item @@ -3967,9 +3967,9 @@ type PushAttachmentGithubReference struct { URL string `json:"url"` } -func (PushAttachmentGithubReference) pushAttachment() {} -func (PushAttachmentGithubReference) Type() PushAttachmentType { - return PushAttachmentTypeGithubReference +func (PushAttachmentGitHubReference) pushAttachment() {} +func (PushAttachmentGitHubReference) Type() PushAttachmentType { + return PushAttachmentTypeGitHubReference } // Code selection attachment from an editor @@ -4398,7 +4398,7 @@ type SessionContextInfo struct { Limit int64 `json:"limit"` // Tokens consumed by MCP tool definitions (subset of toolDefinitionsTokens, excludes // deferred tools) - McpToolsTokens int64 `json:"mcpToolsTokens"` + MCPToolsTokens int64 `json:"mcpToolsTokens"` // The model used for token counting ModelName string `json:"modelName"` // Maximum prompt tokens allowed by the model (or DEFAULT_TOKEN_LIMIT if unspecified) @@ -4443,9 +4443,9 @@ type SessionExtensionsSendAttachmentsToMessageResult struct { // File path, content to append, and optional mode for the client-provided session // filesystem. -// Experimental: SessionFsAppendFileRequest is part of an experimental API and may change or +// Experimental: SessionFSAppendFileRequest is part of an experimental API and may change or // be removed. -type SessionFsAppendFileRequest struct { +type SessionFSAppendFileRequest struct { // Content to append Content string `json:"content"` // Optional POSIX-style mode for newly created files @@ -4457,18 +4457,18 @@ type SessionFsAppendFileRequest struct { } // Describes a filesystem error. -// Experimental: SessionFsError is part of an experimental API and may change or be removed. -type SessionFsError struct { +// Experimental: SessionFSError is part of an experimental API and may change or be removed. +type SessionFSError struct { // Error classification - Code SessionFsErrorCode `json:"code"` + Code SessionFSErrorCode `json:"code"` // Free-form detail about the error, for logging/diagnostics Message *string `json:"message,omitempty"` } // Path to test for existence in the client-provided session filesystem. -// Experimental: SessionFsExistsRequest is part of an experimental API and may change or be +// Experimental: SessionFSExistsRequest is part of an experimental API and may change or be // removed. -type SessionFsExistsRequest struct { +type SessionFSExistsRequest struct { // Path using SessionFs conventions Path string `json:"path"` // Target session identifier @@ -4476,18 +4476,18 @@ type SessionFsExistsRequest struct { } // Indicates whether the requested path exists in the client-provided session filesystem. -// Experimental: SessionFsExistsResult is part of an experimental API and may change or be +// Experimental: SessionFSExistsResult is part of an experimental API and may change or be // removed. -type SessionFsExistsResult struct { +type SessionFSExistsResult struct { // Whether the path exists Exists bool `json:"exists"` } // Directory path to create in the client-provided session filesystem, with options for // recursive creation and POSIX mode. -// Experimental: SessionFsMkdirRequest is part of an experimental API and may change or be +// Experimental: SessionFSMkdirRequest is part of an experimental API and may change or be // removed. -type SessionFsMkdirRequest struct { +type SessionFSMkdirRequest struct { // Optional POSIX-style mode for newly created directories Mode *int64 `json:"mode,omitempty"` // Path using SessionFs conventions @@ -4499,9 +4499,9 @@ type SessionFsMkdirRequest struct { } // Directory path whose entries should be listed from the client-provided session filesystem. -// Experimental: SessionFsReaddirRequest is part of an experimental API and may change or be +// Experimental: SessionFSReaddirRequest is part of an experimental API and may change or be // removed. -type SessionFsReaddirRequest struct { +type SessionFSReaddirRequest struct { // Path using SessionFs conventions Path string `json:"path"` // Target session identifier @@ -4509,30 +4509,30 @@ type SessionFsReaddirRequest struct { } // Names of entries in the requested directory, or a filesystem error if the read failed. -// Experimental: SessionFsReaddirResult is part of an experimental API and may change or be +// Experimental: SessionFSReaddirResult is part of an experimental API and may change or be // removed. -type SessionFsReaddirResult struct { +type SessionFSReaddirResult struct { // Entry names in the directory Entries []string `json:"entries"` // Describes a filesystem error. - Error *SessionFsError `json:"error,omitempty"` + Error *SessionFSError `json:"error,omitempty"` } // Schema for the `SessionFsReaddirWithTypesEntry` type. -// Experimental: SessionFsReaddirWithTypesEntry is part of an experimental API and may +// Experimental: SessionFSReaddirWithTypesEntry is part of an experimental API and may // change or be removed. -type SessionFsReaddirWithTypesEntry struct { +type SessionFSReaddirWithTypesEntry struct { // Entry name Name string `json:"name"` // Entry type - Type SessionFsReaddirWithTypesEntryType `json:"type"` + Type SessionFSReaddirWithTypesEntryType `json:"type"` } // Directory path whose entries (with type information) should be listed from the // client-provided session filesystem. -// Experimental: SessionFsReaddirWithTypesRequest is part of an experimental API and may +// Experimental: SessionFSReaddirWithTypesRequest is part of an experimental API and may // change or be removed. -type SessionFsReaddirWithTypesRequest struct { +type SessionFSReaddirWithTypesRequest struct { // Path using SessionFs conventions Path string `json:"path"` // Target session identifier @@ -4541,19 +4541,19 @@ type SessionFsReaddirWithTypesRequest struct { // Entries in the requested directory paired with file/directory type information, or a // filesystem error if the read failed. -// Experimental: SessionFsReaddirWithTypesResult is part of an experimental API and may +// Experimental: SessionFSReaddirWithTypesResult is part of an experimental API and may // change or be removed. -type SessionFsReaddirWithTypesResult struct { +type SessionFSReaddirWithTypesResult struct { // Directory entries with type information - Entries []SessionFsReaddirWithTypesEntry `json:"entries"` + Entries []SessionFSReaddirWithTypesEntry `json:"entries"` // Describes a filesystem error. - Error *SessionFsError `json:"error,omitempty"` + Error *SessionFSError `json:"error,omitempty"` } // Path of the file to read from the client-provided session filesystem. -// Experimental: SessionFsReadFileRequest is part of an experimental API and may change or +// Experimental: SessionFSReadFileRequest is part of an experimental API and may change or // be removed. -type SessionFsReadFileRequest struct { +type SessionFSReadFileRequest struct { // Path using SessionFs conventions Path string `json:"path"` // Target session identifier @@ -4561,20 +4561,20 @@ type SessionFsReadFileRequest struct { } // File content as a UTF-8 string, or a filesystem error if the read failed. -// Experimental: SessionFsReadFileResult is part of an experimental API and may change or be +// Experimental: SessionFSReadFileResult is part of an experimental API and may change or be // removed. -type SessionFsReadFileResult struct { +type SessionFSReadFileResult struct { // File content as UTF-8 string Content string `json:"content"` // Describes a filesystem error. - Error *SessionFsError `json:"error,omitempty"` + Error *SessionFSError `json:"error,omitempty"` } // Source and destination paths for renaming or moving an entry in the client-provided // session filesystem. -// Experimental: SessionFsRenameRequest is part of an experimental API and may change or be +// Experimental: SessionFSRenameRequest is part of an experimental API and may change or be // removed. -type SessionFsRenameRequest struct { +type SessionFSRenameRequest struct { // Destination path using SessionFs conventions Dest string `json:"dest"` // Target session identifier @@ -4585,9 +4585,9 @@ type SessionFsRenameRequest struct { // Path to remove from the client-provided session filesystem, with options for recursive // removal and force. -// Experimental: SessionFsRmRequest is part of an experimental API and may change or be +// Experimental: SessionFSRmRequest is part of an experimental API and may change or be // removed. -type SessionFsRmRequest struct { +type SessionFSRmRequest struct { // Ignore errors if the path does not exist Force *bool `json:"force,omitempty"` // Path using SessionFs conventions @@ -4599,18 +4599,18 @@ type SessionFsRmRequest struct { } // Optional capabilities declared by the provider -type SessionFsSetProviderCapabilities struct { +type SessionFSSetProviderCapabilities struct { // Whether the provider supports SQLite query/exists operations Sqlite *bool `json:"sqlite,omitempty"` } // Initial working directory, session-state path layout, and path conventions used to // register the calling SDK client as the session filesystem provider. -type SessionFsSetProviderRequest struct { +type SessionFSSetProviderRequest struct { // Optional capabilities declared by the provider - Capabilities *SessionFsSetProviderCapabilities `json:"capabilities,omitempty"` + Capabilities *SessionFSSetProviderCapabilities `json:"capabilities,omitempty"` // Path conventions used by this filesystem - Conventions SessionFsSetProviderConventions `json:"conventions"` + Conventions SessionFSSetProviderConventions `json:"conventions"` // Initial working directory for sessions InitialCwd string `json:"initialCwd"` // Path within each session's SessionFs where the runtime stores files for that session @@ -4618,52 +4618,52 @@ type SessionFsSetProviderRequest struct { } // Indicates whether the calling client was registered as the session filesystem provider. -type SessionFsSetProviderResult struct { +type SessionFSSetProviderResult struct { // Whether the provider was set successfully Success bool `json:"success"` } // Identifies the target session. -// Experimental: SessionFsSqliteExistsRequest is part of an experimental API and may change +// Experimental: SessionFSSqliteExistsRequest is part of an experimental API and may change // or be removed. -type SessionFsSqliteExistsRequest struct { +type SessionFSSqliteExistsRequest struct { // Target session identifier SessionID string `json:"sessionId"` } // Indicates whether the per-session SQLite database already exists. -// Experimental: SessionFsSqliteExistsResult is part of an experimental API and may change +// Experimental: SessionFSSqliteExistsResult is part of an experimental API and may change // or be removed. -type SessionFsSqliteExistsResult struct { +type SessionFSSqliteExistsResult struct { // Whether the session database already exists Exists bool `json:"exists"` } // SQL query, query type, and optional bind parameters for executing a SQLite query against // the per-session database. -// Experimental: SessionFsSqliteQueryRequest is part of an experimental API and may change +// Experimental: SessionFSSqliteQueryRequest is part of an experimental API and may change // or be removed. -type SessionFsSqliteQueryRequest struct { +type SessionFSSqliteQueryRequest struct { // Optional named bind parameters Params map[string]any `json:"params,omitempty"` // SQL query to execute Query string `json:"query"` // How to execute the query: 'exec' for DDL/multi-statement (no results), 'query' for SELECT // (returns rows), 'run' for INSERT/UPDATE/DELETE (returns rowsAffected) - QueryType SessionFsSqliteQueryType `json:"queryType"` + QueryType SessionFSSqliteQueryType `json:"queryType"` // Target session identifier SessionID string `json:"sessionId"` } // Query results including rows, columns, and rows affected, or a filesystem error if // execution failed. -// Experimental: SessionFsSqliteQueryResult is part of an experimental API and may change or +// Experimental: SessionFSSqliteQueryResult is part of an experimental API and may change or // be removed. -type SessionFsSqliteQueryResult struct { +type SessionFSSqliteQueryResult struct { // Column names from the result set Columns []string `json:"columns"` // Describes a filesystem error. - Error *SessionFsError `json:"error,omitempty"` + Error *SessionFSError `json:"error,omitempty"` // SQLite last_insert_rowid() value for INSERT. LastInsertRowid *int64 `json:"lastInsertRowid,omitempty"` // For SELECT: array of row objects. For others: empty array. @@ -4673,9 +4673,9 @@ type SessionFsSqliteQueryResult struct { } // Path whose metadata should be returned from the client-provided session filesystem. -// Experimental: SessionFsStatRequest is part of an experimental API and may change or be +// Experimental: SessionFSStatRequest is part of an experimental API and may change or be // removed. -type SessionFsStatRequest struct { +type SessionFSStatRequest struct { // Path using SessionFs conventions Path string `json:"path"` // Target session identifier @@ -4683,13 +4683,13 @@ type SessionFsStatRequest struct { } // Filesystem metadata for the requested path, or a filesystem error if the stat failed. -// Experimental: SessionFsStatResult is part of an experimental API and may change or be +// Experimental: SessionFSStatResult is part of an experimental API and may change or be // removed. -type SessionFsStatResult struct { +type SessionFSStatResult struct { // ISO 8601 timestamp of creation Birthtime time.Time `json:"birthtime"` // Describes a filesystem error. - Error *SessionFsError `json:"error,omitempty"` + Error *SessionFSError `json:"error,omitempty"` // Whether the path is a directory IsDirectory bool `json:"isDirectory"` // Whether the path is a file @@ -4701,9 +4701,9 @@ type SessionFsStatResult struct { } // File path, content to write, and optional mode for the client-provided session filesystem. -// Experimental: SessionFsWriteFileRequest is part of an experimental API and may change or +// Experimental: SessionFSWriteFileRequest is part of an experimental API and may change or // be removed. -type SessionFsWriteFileRequest struct { +type SessionFSWriteFileRequest struct { // Content to write Content string `json:"content"` // Optional POSIX-style mode for newly created files @@ -4738,21 +4738,21 @@ type SessionInstalledPlugin struct { // Experimental: SessionInstalledPluginSource is part of an experimental API and may change // or be removed. type SessionInstalledPluginSource struct { - SessionInstalledPluginSourceGithub *SessionInstalledPluginSourceGithub + SessionInstalledPluginSourceGitHub *SessionInstalledPluginSourceGitHub SessionInstalledPluginSourceLocal *SessionInstalledPluginSourceLocal SessionInstalledPluginSourceURL *SessionInstalledPluginSourceURL String *string } // Schema for the `SessionInstalledPluginSourceGithub` type. -// Experimental: SessionInstalledPluginSourceGithub is part of an experimental API and may +// Experimental: SessionInstalledPluginSourceGitHub is part of an experimental API and may // change or be removed. -type SessionInstalledPluginSourceGithub struct { +type SessionInstalledPluginSourceGitHub struct { Path *string `json:"path,omitempty"` Ref *string `json:"ref,omitempty"` Repo string `json:"repo"` // Constant value. Always "github". - Source SessionInstalledPluginSourceGithubSource `json:"source"` + Source SessionInstalledPluginSourceGitHubSource `json:"source"` } // Schema for the `SessionInstalledPluginSourceLocal` type. @@ -4814,28 +4814,28 @@ type SessionLspInitializeResult struct { } // Standard MCP CallToolResult -// Experimental: SessionMcpAppsCallToolResult is part of an experimental API and may change +// Experimental: SessionMCPAppsCallToolResult is part of an experimental API and may change // or be removed. -type SessionMcpAppsCallToolResult map[string]any +type SessionMCPAppsCallToolResult map[string]any -// Experimental: SessionMcpAppsSetHostContextResult is part of an experimental API and may +// Experimental: SessionMCPAppsSetHostContextResult is part of an experimental API and may // change or be removed. -type SessionMcpAppsSetHostContextResult struct { +type SessionMCPAppsSetHostContextResult struct { } -// Experimental: SessionMcpDisableResult is part of an experimental API and may change or be +// Experimental: SessionMCPDisableResult is part of an experimental API and may change or be // removed. -type SessionMcpDisableResult struct { +type SessionMCPDisableResult struct { } -// Experimental: SessionMcpEnableResult is part of an experimental API and may change or be +// Experimental: SessionMCPEnableResult is part of an experimental API and may change or be // removed. -type SessionMcpEnableResult struct { +type SessionMCPEnableResult struct { } -// Experimental: SessionMcpReloadResult is part of an experimental API and may change or be +// Experimental: SessionMCPReloadResult is part of an experimental API and may change or be // removed. -type SessionMcpReloadResult struct { +type SessionMCPReloadResult struct { } // Schema for the `SessionMetadata` type. @@ -4971,7 +4971,7 @@ type SessionRemoteDisableResult struct { // be removed. type SessionsBulkDeleteRequest struct { // Session IDs to close, deactivate, and delete from disk - SessionIds []string `json:"sessionIds"` + SessionIDs []string `json:"sessionIds"` } // Session IDs to test for live in-use locks. @@ -4979,7 +4979,7 @@ type SessionsBulkDeleteRequest struct { // be removed. type SessionsCheckInUseRequest struct { // Session IDs to test for live in-use locks - SessionIds []string `json:"sessionIds"` + SessionIDs []string `json:"sessionIds"` } // Session IDs from the input set that are currently in use by another process. @@ -5202,7 +5202,7 @@ type SessionsPruneOldRequest struct { // When true, only report what would be deleted without performing any deletion DryRun *bool `json:"dryRun,omitempty"` // Session IDs that should never be considered for pruning - ExcludeSessionIds []string `json:"excludeSessionIds,omitempty"` + ExcludeSessionIDs []string `json:"excludeSessionIds,omitempty"` // When true, named sessions (set via /rename) are also eligible for pruning IncludeNamed *bool `json:"includeNamed,omitempty"` // Delete sessions whose modifiedTime is at least this many days old @@ -6658,18 +6658,18 @@ func (UserToolSessionApprovalExtensionPermissionAccess) Kind() UserToolSessionAp } // Schema for the `UserToolSessionApprovalMcp` type. -// Experimental: UserToolSessionApprovalMcp is part of an experimental API and may change or +// Experimental: UserToolSessionApprovalMCP is part of an experimental API and may change or // be removed. -type UserToolSessionApprovalMcp struct { +type UserToolSessionApprovalMCP struct { // MCP server name ServerName string `json:"serverName"` // Optional MCP tool name, or null for all tools on the server ToolName *string `json:"toolName"` } -func (UserToolSessionApprovalMcp) userToolSessionApproval() {} -func (UserToolSessionApprovalMcp) Kind() UserToolSessionApprovalKind { - return UserToolSessionApprovalKindMcp +func (UserToolSessionApprovalMCP) userToolSessionApproval() {} +func (UserToolSessionApprovalMCP) Kind() UserToolSessionApprovalKind { + return UserToolSessionApprovalKindMCP } // Schema for the `UserToolSessionApprovalMemory` type. @@ -7068,17 +7068,17 @@ const ( ) // Type of GitHub reference -// Experimental: AttachmentGithubReferenceType is part of an experimental API and may change +// Experimental: AttachmentGitHubReferenceType is part of an experimental API and may change // or be removed. -type AttachmentGithubReferenceType string +type AttachmentGitHubReferenceType string const ( // GitHub discussion reference. - AttachmentGithubReferenceTypeDiscussion AttachmentGithubReferenceType = "discussion" + AttachmentGitHubReferenceTypeDiscussion AttachmentGitHubReferenceType = "discussion" // GitHub issue reference. - AttachmentGithubReferenceTypeIssue AttachmentGithubReferenceType = "issue" + AttachmentGitHubReferenceTypeIssue AttachmentGitHubReferenceType = "issue" // GitHub pull request reference. - AttachmentGithubReferenceTypePr AttachmentGithubReferenceType = "pr" + AttachmentGitHubReferenceTypePr AttachmentGitHubReferenceType = "pr" ) // Type discriminator for Attachment. @@ -7089,7 +7089,7 @@ const ( AttachmentTypeDirectory AttachmentType = "directory" AttachmentTypeExtensionContext AttachmentType = "extension_context" AttachmentTypeFile AttachmentType = "file" - AttachmentTypeGithubReference AttachmentType = "github_reference" + AttachmentTypeGitHubReference AttachmentType = "github_reference" AttachmentTypeSelection AttachmentType = "selection" ) @@ -7101,8 +7101,8 @@ const ( AuthInfoTypeAPIKey AuthInfoType = "api-key" AuthInfoTypeCopilotAPIToken AuthInfoType = "copilot-api-token" AuthInfoTypeEnv AuthInfoType = "env" - AuthInfoTypeGhCli AuthInfoType = "gh-cli" - AuthInfoTypeHmac AuthInfoType = "hmac" + AuthInfoTypeGHCLI AuthInfoType = "gh-cli" + AuthInfoTypeHMAC AuthInfoType = "hmac" AuthInfoTypeToken AuthInfoType = "token" AuthInfoTypeUser AuthInfoType = "user" ) @@ -7162,21 +7162,21 @@ const ( type CopilotAPITokenAuthInfoHost string const ( - CopilotAPITokenAuthInfoHostHTTPSGithubCom CopilotAPITokenAuthInfoHost = "https://github.com" + CopilotAPITokenAuthInfoHostHTTPSGitHubCom CopilotAPITokenAuthInfoHost = "https://github.com" ) // Server transport type: stdio, http, sse (deprecated), or memory -type DiscoveredMcpServerType string +type DiscoveredMCPServerType string const ( // Server communicates over streamable HTTP. - DiscoveredMcpServerTypeHTTP DiscoveredMcpServerType = "http" + DiscoveredMCPServerTypeHTTP DiscoveredMCPServerType = "http" // Server is backed by an in-memory runtime implementation. - DiscoveredMcpServerTypeMemory DiscoveredMcpServerType = "memory" + DiscoveredMCPServerTypeMemory DiscoveredMCPServerType = "memory" // Server communicates over Server-Sent Events (deprecated). - DiscoveredMcpServerTypeSse DiscoveredMcpServerType = "sse" + DiscoveredMCPServerTypeSSE DiscoveredMCPServerType = "sse" // Server communicates over stdio with a local child process. - DiscoveredMcpServerTypeStdio DiscoveredMcpServerType = "stdio" + DiscoveredMCPServerTypeStdio DiscoveredMCPServerType = "stdio" ) type EventLogTypesString string @@ -7281,14 +7281,14 @@ const ( type HMACAuthInfoHost string const ( - HMACAuthInfoHostHTTPSGithubCom HMACAuthInfoHost = "https://github.com" + HMACAuthInfoHostHTTPSGitHubCom HMACAuthInfoHost = "https://github.com" ) // Constant value. Always "github". -type InstalledPluginSourceGithubSource string +type InstalledPluginSourceGitHubSource string const ( - InstalledPluginSourceGithubSourceGithub InstalledPluginSourceGithubSource = "github" + InstalledPluginSourceGitHubSourceGitHub InstalledPluginSourceGitHubSource = "github" ) // Constant value. Always "local". @@ -7344,180 +7344,180 @@ const ( ) // Allowed values for the `McpAppsHostContextDetailsAvailableDisplayMode` enumeration. -// Experimental: McpAppsHostContextDetailsAvailableDisplayMode is part of an experimental +// Experimental: MCPAppsHostContextDetailsAvailableDisplayMode is part of an experimental // API and may change or be removed. -type McpAppsHostContextDetailsAvailableDisplayMode string +type MCPAppsHostContextDetailsAvailableDisplayMode string const ( // Rendered as a fullscreen overlay - McpAppsHostContextDetailsAvailableDisplayModeFullscreen McpAppsHostContextDetailsAvailableDisplayMode = "fullscreen" + MCPAppsHostContextDetailsAvailableDisplayModeFullscreen MCPAppsHostContextDetailsAvailableDisplayMode = "fullscreen" // Rendered inline within the host conversation surface - McpAppsHostContextDetailsAvailableDisplayModeInline McpAppsHostContextDetailsAvailableDisplayMode = "inline" + MCPAppsHostContextDetailsAvailableDisplayModeInline MCPAppsHostContextDetailsAvailableDisplayMode = "inline" // Rendered as a picture-in-picture floating panel - McpAppsHostContextDetailsAvailableDisplayModePip McpAppsHostContextDetailsAvailableDisplayMode = "pip" + MCPAppsHostContextDetailsAvailableDisplayModePip MCPAppsHostContextDetailsAvailableDisplayMode = "pip" ) // Current display mode (SEP-1865) -// Experimental: McpAppsHostContextDetailsDisplayMode is part of an experimental API and may +// Experimental: MCPAppsHostContextDetailsDisplayMode is part of an experimental API and may // change or be removed. -type McpAppsHostContextDetailsDisplayMode string +type MCPAppsHostContextDetailsDisplayMode string const ( // Rendered as a fullscreen overlay - McpAppsHostContextDetailsDisplayModeFullscreen McpAppsHostContextDetailsDisplayMode = "fullscreen" + MCPAppsHostContextDetailsDisplayModeFullscreen MCPAppsHostContextDetailsDisplayMode = "fullscreen" // Rendered inline within the host conversation surface - McpAppsHostContextDetailsDisplayModeInline McpAppsHostContextDetailsDisplayMode = "inline" + MCPAppsHostContextDetailsDisplayModeInline MCPAppsHostContextDetailsDisplayMode = "inline" // Rendered as a picture-in-picture floating panel - McpAppsHostContextDetailsDisplayModePip McpAppsHostContextDetailsDisplayMode = "pip" + MCPAppsHostContextDetailsDisplayModePip MCPAppsHostContextDetailsDisplayMode = "pip" ) // Platform type for responsive design -// Experimental: McpAppsHostContextDetailsPlatform is part of an experimental API and may +// Experimental: MCPAppsHostContextDetailsPlatform is part of an experimental API and may // change or be removed. -type McpAppsHostContextDetailsPlatform string +type MCPAppsHostContextDetailsPlatform string const ( // Host runs as a desktop application - McpAppsHostContextDetailsPlatformDesktop McpAppsHostContextDetailsPlatform = "desktop" + MCPAppsHostContextDetailsPlatformDesktop MCPAppsHostContextDetailsPlatform = "desktop" // Host runs on a mobile device - McpAppsHostContextDetailsPlatformMobile McpAppsHostContextDetailsPlatform = "mobile" + MCPAppsHostContextDetailsPlatformMobile MCPAppsHostContextDetailsPlatform = "mobile" // Host runs in a web browser - McpAppsHostContextDetailsPlatformWeb McpAppsHostContextDetailsPlatform = "web" + MCPAppsHostContextDetailsPlatformWeb MCPAppsHostContextDetailsPlatform = "web" ) // UI theme preference per SEP-1865 -// Experimental: McpAppsHostContextDetailsTheme is part of an experimental API and may +// Experimental: MCPAppsHostContextDetailsTheme is part of an experimental API and may // change or be removed. -type McpAppsHostContextDetailsTheme string +type MCPAppsHostContextDetailsTheme string const ( // Dark UI theme - McpAppsHostContextDetailsThemeDark McpAppsHostContextDetailsTheme = "dark" + MCPAppsHostContextDetailsThemeDark MCPAppsHostContextDetailsTheme = "dark" // Light UI theme - McpAppsHostContextDetailsThemeLight McpAppsHostContextDetailsTheme = "light" + MCPAppsHostContextDetailsThemeLight MCPAppsHostContextDetailsTheme = "light" ) // Allowed values for the `McpAppsSetHostContextDetailsAvailableDisplayMode` enumeration. -// Experimental: McpAppsSetHostContextDetailsAvailableDisplayMode is part of an experimental +// Experimental: MCPAppsSetHostContextDetailsAvailableDisplayMode is part of an experimental // API and may change or be removed. -type McpAppsSetHostContextDetailsAvailableDisplayMode string +type MCPAppsSetHostContextDetailsAvailableDisplayMode string const ( // Rendered as a fullscreen overlay - McpAppsSetHostContextDetailsAvailableDisplayModeFullscreen McpAppsSetHostContextDetailsAvailableDisplayMode = "fullscreen" + MCPAppsSetHostContextDetailsAvailableDisplayModeFullscreen MCPAppsSetHostContextDetailsAvailableDisplayMode = "fullscreen" // Rendered inline within the host conversation surface - McpAppsSetHostContextDetailsAvailableDisplayModeInline McpAppsSetHostContextDetailsAvailableDisplayMode = "inline" + MCPAppsSetHostContextDetailsAvailableDisplayModeInline MCPAppsSetHostContextDetailsAvailableDisplayMode = "inline" // Rendered as a picture-in-picture floating panel - McpAppsSetHostContextDetailsAvailableDisplayModePip McpAppsSetHostContextDetailsAvailableDisplayMode = "pip" + MCPAppsSetHostContextDetailsAvailableDisplayModePip MCPAppsSetHostContextDetailsAvailableDisplayMode = "pip" ) // Current display mode (SEP-1865) -// Experimental: McpAppsSetHostContextDetailsDisplayMode is part of an experimental API and +// Experimental: MCPAppsSetHostContextDetailsDisplayMode is part of an experimental API and // may change or be removed. -type McpAppsSetHostContextDetailsDisplayMode string +type MCPAppsSetHostContextDetailsDisplayMode string const ( // Rendered as a fullscreen overlay - McpAppsSetHostContextDetailsDisplayModeFullscreen McpAppsSetHostContextDetailsDisplayMode = "fullscreen" + MCPAppsSetHostContextDetailsDisplayModeFullscreen MCPAppsSetHostContextDetailsDisplayMode = "fullscreen" // Rendered inline within the host conversation surface - McpAppsSetHostContextDetailsDisplayModeInline McpAppsSetHostContextDetailsDisplayMode = "inline" + MCPAppsSetHostContextDetailsDisplayModeInline MCPAppsSetHostContextDetailsDisplayMode = "inline" // Rendered as a picture-in-picture floating panel - McpAppsSetHostContextDetailsDisplayModePip McpAppsSetHostContextDetailsDisplayMode = "pip" + MCPAppsSetHostContextDetailsDisplayModePip MCPAppsSetHostContextDetailsDisplayMode = "pip" ) // Platform type for responsive design -// Experimental: McpAppsSetHostContextDetailsPlatform is part of an experimental API and may +// Experimental: MCPAppsSetHostContextDetailsPlatform is part of an experimental API and may // change or be removed. -type McpAppsSetHostContextDetailsPlatform string +type MCPAppsSetHostContextDetailsPlatform string const ( // Host runs as a desktop application - McpAppsSetHostContextDetailsPlatformDesktop McpAppsSetHostContextDetailsPlatform = "desktop" + MCPAppsSetHostContextDetailsPlatformDesktop MCPAppsSetHostContextDetailsPlatform = "desktop" // Host runs on a mobile device - McpAppsSetHostContextDetailsPlatformMobile McpAppsSetHostContextDetailsPlatform = "mobile" + MCPAppsSetHostContextDetailsPlatformMobile MCPAppsSetHostContextDetailsPlatform = "mobile" // Host runs in a web browser - McpAppsSetHostContextDetailsPlatformWeb McpAppsSetHostContextDetailsPlatform = "web" + MCPAppsSetHostContextDetailsPlatformWeb MCPAppsSetHostContextDetailsPlatform = "web" ) // UI theme preference per SEP-1865 -// Experimental: McpAppsSetHostContextDetailsTheme is part of an experimental API and may +// Experimental: MCPAppsSetHostContextDetailsTheme is part of an experimental API and may // change or be removed. -type McpAppsSetHostContextDetailsTheme string +type MCPAppsSetHostContextDetailsTheme string const ( // Dark UI theme - McpAppsSetHostContextDetailsThemeDark McpAppsSetHostContextDetailsTheme = "dark" + MCPAppsSetHostContextDetailsThemeDark MCPAppsSetHostContextDetailsTheme = "dark" // Light UI theme - McpAppsSetHostContextDetailsThemeLight McpAppsSetHostContextDetailsTheme = "light" + MCPAppsSetHostContextDetailsThemeLight MCPAppsSetHostContextDetailsTheme = "light" ) // Outcome of the sampling inference. 'success' produced a response; 'failure' encountered // an error (including agent-side rejection by content filter or criteria); 'cancelled' the // caller cancelled this execution via cancelSamplingExecution. -// Experimental: McpSamplingExecutionAction is part of an experimental API and may change or +// Experimental: MCPSamplingExecutionAction is part of an experimental API and may change or // be removed. -type McpSamplingExecutionAction string +type MCPSamplingExecutionAction string const ( // The sampling inference was cancelled before completion. - McpSamplingExecutionActionCancelled McpSamplingExecutionAction = "cancelled" + MCPSamplingExecutionActionCancelled MCPSamplingExecutionAction = "cancelled" // The sampling inference failed or was rejected. - McpSamplingExecutionActionFailure McpSamplingExecutionAction = "failure" + MCPSamplingExecutionActionFailure MCPSamplingExecutionAction = "failure" // The sampling inference completed and produced a result. - McpSamplingExecutionActionSuccess McpSamplingExecutionAction = "success" + MCPSamplingExecutionActionSuccess MCPSamplingExecutionAction = "success" ) // OAuth grant type to use when authenticating to the remote MCP server. -type McpServerConfigHTTPOauthGrantType string +type MCPServerConfigHTTPOauthGrantType string const ( // Interactive browser-based authorization code flow with PKCE. - McpServerConfigHTTPOauthGrantTypeAuthorizationCode McpServerConfigHTTPOauthGrantType = "authorization_code" + MCPServerConfigHTTPOauthGrantTypeAuthorizationCode MCPServerConfigHTTPOauthGrantType = "authorization_code" // Headless client credentials flow using the configured OAuth client. - McpServerConfigHTTPOauthGrantTypeClientCredentials McpServerConfigHTTPOauthGrantType = "client_credentials" + MCPServerConfigHTTPOauthGrantTypeClientCredentials MCPServerConfigHTTPOauthGrantType = "client_credentials" ) // Remote transport type. Defaults to "http" when omitted. -type McpServerConfigHTTPType string +type MCPServerConfigHTTPType string const ( // Streamable HTTP transport. - McpServerConfigHTTPTypeHTTP McpServerConfigHTTPType = "http" + MCPServerConfigHTTPTypeHTTP MCPServerConfigHTTPType = "http" // Server-Sent Events transport. - McpServerConfigHTTPTypeSse McpServerConfigHTTPType = "sse" + MCPServerConfigHTTPTypeSSE MCPServerConfigHTTPType = "sse" ) // Configuration source: user, workspace, plugin, or builtin -type McpServerSource string +type MCPServerSource string const ( // Server bundled with the runtime. - McpServerSourceBuiltin McpServerSource = "builtin" + MCPServerSourceBuiltin MCPServerSource = "builtin" // Server contributed by an installed plugin. - McpServerSourcePlugin McpServerSource = "plugin" + MCPServerSourcePlugin MCPServerSource = "plugin" // Server configured in the user's global MCP configuration. - McpServerSourceUser McpServerSource = "user" + MCPServerSourceUser MCPServerSource = "user" // Server configured by the current workspace. - McpServerSourceWorkspace McpServerSource = "workspace" + MCPServerSourceWorkspace MCPServerSource = "workspace" ) // Connection status: connected, failed, needs-auth, pending, disabled, or not_configured -// Experimental: McpServerStatus is part of an experimental API and may change or be removed. -type McpServerStatus string +// Experimental: MCPServerStatus is part of an experimental API and may change or be removed. +type MCPServerStatus string const ( // The server is connected and available. - McpServerStatusConnected McpServerStatus = "connected" + MCPServerStatusConnected MCPServerStatus = "connected" // The server is configured but disabled. - McpServerStatusDisabled McpServerStatus = "disabled" + MCPServerStatusDisabled MCPServerStatus = "disabled" // The server failed to connect or initialize. - McpServerStatusFailed McpServerStatus = "failed" + MCPServerStatusFailed MCPServerStatus = "failed" // The server requires authentication before it can connect. - McpServerStatusNeedsAuth McpServerStatus = "needs-auth" + MCPServerStatusNeedsAuth MCPServerStatus = "needs-auth" // The server is not configured for this session. - McpServerStatusNotConfigured McpServerStatus = "not_configured" + MCPServerStatusNotConfigured MCPServerStatus = "not_configured" // The server connection is still being established. - McpServerStatusPending McpServerStatus = "pending" + MCPServerStatusPending MCPServerStatus = "pending" ) // How environment-variable values supplied to MCP servers are resolved. "direct" passes @@ -7525,15 +7525,15 @@ const ( // variables on the host) that the runtime resolves before launch. Defaults to the runtime's // startup mode; clients that intentionally launch MCP servers with literal values (e.g. CLI // prompt mode and ACP) set this to "direct". -// Experimental: McpSetEnvValueModeDetails is part of an experimental API and may change or +// Experimental: MCPSetEnvValueModeDetails is part of an experimental API and may change or // be removed. -type McpSetEnvValueModeDetails string +type MCPSetEnvValueModeDetails string const ( // Treat MCP server environment values as literal strings. - McpSetEnvValueModeDetailsDirect McpSetEnvValueModeDetails = "direct" + MCPSetEnvValueModeDetailsDirect MCPSetEnvValueModeDetails = "direct" // Treat MCP server environment values as host-side references to resolve before launch. - McpSetEnvValueModeDetailsIndirect McpSetEnvValueModeDetails = "indirect" + MCPSetEnvValueModeDetailsIndirect MCPSetEnvValueModeDetails = "indirect" ) // The current agent mode for this session (e.g., 'interactive', 'plan', 'autopilot') @@ -7560,7 +7560,7 @@ const ( // Remote task originated from Copilot Coding Agent. MetadataSnapshotRemoteMetadataTaskTypeCca MetadataSnapshotRemoteMetadataTaskType = "cca" // Remote task originated from a CLI remote-session invocation. - MetadataSnapshotRemoteMetadataTaskTypeCli MetadataSnapshotRemoteMetadataTaskType = "cli" + MetadataSnapshotRemoteMetadataTaskTypeCLI MetadataSnapshotRemoteMetadataTaskType = "cli" ) // Model capability category for grouping in the model picker @@ -7638,8 +7638,8 @@ const ( PermissionDecisionApproveForLocationApprovalKindCustomTool PermissionDecisionApproveForLocationApprovalKind = "custom-tool" PermissionDecisionApproveForLocationApprovalKindExtensionManagement PermissionDecisionApproveForLocationApprovalKind = "extension-management" PermissionDecisionApproveForLocationApprovalKindExtensionPermissionAccess PermissionDecisionApproveForLocationApprovalKind = "extension-permission-access" - PermissionDecisionApproveForLocationApprovalKindMcp PermissionDecisionApproveForLocationApprovalKind = "mcp" - PermissionDecisionApproveForLocationApprovalKindMcpSampling PermissionDecisionApproveForLocationApprovalKind = "mcp-sampling" + PermissionDecisionApproveForLocationApprovalKindMCP PermissionDecisionApproveForLocationApprovalKind = "mcp" + PermissionDecisionApproveForLocationApprovalKindMCPSampling PermissionDecisionApproveForLocationApprovalKind = "mcp-sampling" PermissionDecisionApproveForLocationApprovalKindMemory PermissionDecisionApproveForLocationApprovalKind = "memory" PermissionDecisionApproveForLocationApprovalKindRead PermissionDecisionApproveForLocationApprovalKind = "read" PermissionDecisionApproveForLocationApprovalKindWrite PermissionDecisionApproveForLocationApprovalKind = "write" @@ -7653,8 +7653,8 @@ const ( PermissionDecisionApproveForSessionApprovalKindCustomTool PermissionDecisionApproveForSessionApprovalKind = "custom-tool" PermissionDecisionApproveForSessionApprovalKindExtensionManagement PermissionDecisionApproveForSessionApprovalKind = "extension-management" PermissionDecisionApproveForSessionApprovalKindExtensionPermissionAccess PermissionDecisionApproveForSessionApprovalKind = "extension-permission-access" - PermissionDecisionApproveForSessionApprovalKindMcp PermissionDecisionApproveForSessionApprovalKind = "mcp" - PermissionDecisionApproveForSessionApprovalKindMcpSampling PermissionDecisionApproveForSessionApprovalKind = "mcp-sampling" + PermissionDecisionApproveForSessionApprovalKindMCP PermissionDecisionApproveForSessionApprovalKind = "mcp" + PermissionDecisionApproveForSessionApprovalKindMCPSampling PermissionDecisionApproveForSessionApprovalKind = "mcp-sampling" PermissionDecisionApproveForSessionApprovalKindMemory PermissionDecisionApproveForSessionApprovalKind = "memory" PermissionDecisionApproveForSessionApprovalKindRead PermissionDecisionApproveForSessionApprovalKind = "read" PermissionDecisionApproveForSessionApprovalKindWrite PermissionDecisionApproveForSessionApprovalKind = "write" @@ -7714,8 +7714,8 @@ const ( PermissionsLocationsAddToolApprovalDetailsKindCustomTool PermissionsLocationsAddToolApprovalDetailsKind = "custom-tool" PermissionsLocationsAddToolApprovalDetailsKindExtensionManagement PermissionsLocationsAddToolApprovalDetailsKind = "extension-management" PermissionsLocationsAddToolApprovalDetailsKindExtensionPermissionAccess PermissionsLocationsAddToolApprovalDetailsKind = "extension-permission-access" - PermissionsLocationsAddToolApprovalDetailsKindMcp PermissionsLocationsAddToolApprovalDetailsKind = "mcp" - PermissionsLocationsAddToolApprovalDetailsKindMcpSampling PermissionsLocationsAddToolApprovalDetailsKind = "mcp-sampling" + PermissionsLocationsAddToolApprovalDetailsKindMCP PermissionsLocationsAddToolApprovalDetailsKind = "mcp" + PermissionsLocationsAddToolApprovalDetailsKindMCPSampling PermissionsLocationsAddToolApprovalDetailsKind = "mcp-sampling" PermissionsLocationsAddToolApprovalDetailsKindMemory PermissionsLocationsAddToolApprovalDetailsKind = "memory" PermissionsLocationsAddToolApprovalDetailsKindRead PermissionsLocationsAddToolApprovalDetailsKind = "read" PermissionsLocationsAddToolApprovalDetailsKindWrite PermissionsLocationsAddToolApprovalDetailsKind = "write" @@ -7743,7 +7743,7 @@ const ( // Allow-all was enabled by confirming autopilot behavior. PermissionsSetAllowAllSourceAutopilotConfirmation PermissionsSetAllowAllSource = "autopilot_confirmation" // Allow-all was enabled from a CLI command-line flag. - PermissionsSetAllowAllSourceCliFlag PermissionsSetAllowAllSource = "cli_flag" + PermissionsSetAllowAllSourceCLIFlag PermissionsSetAllowAllSource = "cli_flag" // Allow-all was enabled through an RPC caller. PermissionsSetAllowAllSourceRPC PermissionsSetAllowAllSource = "rpc" // Allow-all was enabled by a slash command. @@ -7759,7 +7759,7 @@ const ( // Allow-all was enabled by confirming autopilot behavior. PermissionsSetApproveAllSourceAutopilotConfirmation PermissionsSetApproveAllSource = "autopilot_confirmation" // Allow-all was enabled from a CLI command-line flag. - PermissionsSetApproveAllSourceCliFlag PermissionsSetApproveAllSource = "cli_flag" + PermissionsSetApproveAllSourceCLIFlag PermissionsSetApproveAllSource = "cli_flag" // Allow-all was enabled through an RPC caller. PermissionsSetApproveAllSourceRPC PermissionsSetApproveAllSource = "rpc" // Allow-all was enabled by a slash command. @@ -7767,17 +7767,17 @@ const ( ) // Type of GitHub reference -// Experimental: PushAttachmentGithubReferenceType is part of an experimental API and may +// Experimental: PushAttachmentGitHubReferenceType is part of an experimental API and may // change or be removed. -type PushAttachmentGithubReferenceType string +type PushAttachmentGitHubReferenceType string const ( // GitHub discussion reference. - PushAttachmentGithubReferenceTypeDiscussion PushAttachmentGithubReferenceType = "discussion" + PushAttachmentGitHubReferenceTypeDiscussion PushAttachmentGitHubReferenceType = "discussion" // GitHub issue reference. - PushAttachmentGithubReferenceTypeIssue PushAttachmentGithubReferenceType = "issue" + PushAttachmentGitHubReferenceTypeIssue PushAttachmentGitHubReferenceType = "issue" // GitHub pull request reference. - PushAttachmentGithubReferenceTypePr PushAttachmentGithubReferenceType = "pr" + PushAttachmentGitHubReferenceTypePr PushAttachmentGitHubReferenceType = "pr" ) // Type discriminator for PushAttachment. @@ -7788,7 +7788,7 @@ const ( PushAttachmentTypeDirectory PushAttachmentType = "directory" PushAttachmentTypeExtensionContext PushAttachmentType = "extension_context" PushAttachmentTypeFile PushAttachmentType = "file" - PushAttachmentTypeGithubReference PushAttachmentType = "github_reference" + PushAttachmentTypeGitHubReference PushAttachmentType = "github_reference" PushAttachmentTypeSelection PushAttachmentType = "selection" ) @@ -7868,65 +7868,65 @@ type SessionContextHostType string const ( // Session repository is hosted on Azure DevOps. - SessionContextHostTypeAdo SessionContextHostType = "ado" + SessionContextHostTypeADO SessionContextHostType = "ado" // Session repository is hosted on GitHub. - SessionContextHostTypeGithub SessionContextHostType = "github" + SessionContextHostTypeGitHub SessionContextHostType = "github" ) // Error classification -// Experimental: SessionFsErrorCode is part of an experimental API and may change or be +// Experimental: SessionFSErrorCode is part of an experimental API and may change or be // removed. -type SessionFsErrorCode string +type SessionFSErrorCode string const ( // The requested path does not exist. - SessionFsErrorCodeENOENT SessionFsErrorCode = "ENOENT" + SessionFSErrorCodeENOENT SessionFSErrorCode = "ENOENT" // The filesystem operation failed for an unspecified reason. - SessionFsErrorCodeUNKNOWN SessionFsErrorCode = "UNKNOWN" + SessionFSErrorCodeUNKNOWN SessionFSErrorCode = "UNKNOWN" ) // Entry type -// Experimental: SessionFsReaddirWithTypesEntryType is part of an experimental API and may +// Experimental: SessionFSReaddirWithTypesEntryType is part of an experimental API and may // change or be removed. -type SessionFsReaddirWithTypesEntryType string +type SessionFSReaddirWithTypesEntryType string const ( // The entry is a directory. - SessionFsReaddirWithTypesEntryTypeDirectory SessionFsReaddirWithTypesEntryType = "directory" + SessionFSReaddirWithTypesEntryTypeDirectory SessionFSReaddirWithTypesEntryType = "directory" // The entry is a file. - SessionFsReaddirWithTypesEntryTypeFile SessionFsReaddirWithTypesEntryType = "file" + SessionFSReaddirWithTypesEntryTypeFile SessionFSReaddirWithTypesEntryType = "file" ) // Path conventions used by this filesystem -type SessionFsSetProviderConventions string +type SessionFSSetProviderConventions string const ( // Paths use POSIX path conventions. - SessionFsSetProviderConventionsPosix SessionFsSetProviderConventions = "posix" + SessionFSSetProviderConventionsPosix SessionFSSetProviderConventions = "posix" // Paths use Windows path conventions. - SessionFsSetProviderConventionsWindows SessionFsSetProviderConventions = "windows" + SessionFSSetProviderConventionsWindows SessionFSSetProviderConventions = "windows" ) // How to execute the query: 'exec' for DDL/multi-statement (no results), 'query' for SELECT // (returns rows), 'run' for INSERT/UPDATE/DELETE (returns rowsAffected) -// Experimental: SessionFsSqliteQueryType is part of an experimental API and may change or +// Experimental: SessionFSSqliteQueryType is part of an experimental API and may change or // be removed. -type SessionFsSqliteQueryType string +type SessionFSSqliteQueryType string const ( // Execute DDL or multi-statement SQL without returning rows. - SessionFsSqliteQueryTypeExec SessionFsSqliteQueryType = "exec" + SessionFSSqliteQueryTypeExec SessionFSSqliteQueryType = "exec" // Execute a SELECT-style query and return rows. - SessionFsSqliteQueryTypeQuery SessionFsSqliteQueryType = "query" + SessionFSSqliteQueryTypeQuery SessionFSSqliteQueryType = "query" // Execute INSERT, UPDATE, or DELETE SQL and return affected-row metadata. - SessionFsSqliteQueryTypeRun SessionFsSqliteQueryType = "run" + SessionFSSqliteQueryTypeRun SessionFSSqliteQueryType = "run" ) // Constant value. Always "github". -type SessionInstalledPluginSourceGithubSource string +type SessionInstalledPluginSourceGitHubSource string const ( - SessionInstalledPluginSourceGithubSourceGithub SessionInstalledPluginSourceGithubSource = "github" + SessionInstalledPluginSourceGitHubSourceGitHub SessionInstalledPluginSourceGitHubSource = "github" ) // Constant value. Always "local". @@ -7977,9 +7977,9 @@ type SessionWorkingDirectoryContextHostType string const ( // The working directory repository is hosted on Azure DevOps. - SessionWorkingDirectoryContextHostTypeAdo SessionWorkingDirectoryContextHostType = "ado" + SessionWorkingDirectoryContextHostTypeADO SessionWorkingDirectoryContextHostType = "ado" // The working directory repository is hosted on GitHub. - SessionWorkingDirectoryContextHostTypeGithub SessionWorkingDirectoryContextHostType = "github" + SessionWorkingDirectoryContextHostTypeGitHub SessionWorkingDirectoryContextHostType = "github" ) // Signal to send (default: SIGTERM) @@ -8226,7 +8226,7 @@ const ( UserToolSessionApprovalKindCustomTool UserToolSessionApprovalKind = "custom-tool" UserToolSessionApprovalKindExtensionManagement UserToolSessionApprovalKind = "extension-management" UserToolSessionApprovalKindExtensionPermissionAccess UserToolSessionApprovalKind = "extension-permission-access" - UserToolSessionApprovalKindMcp UserToolSessionApprovalKind = "mcp" + UserToolSessionApprovalKindMCP UserToolSessionApprovalKind = "mcp" UserToolSessionApprovalKindMemory UserToolSessionApprovalKind = "memory" UserToolSessionApprovalKindRead UserToolSessionApprovalKind = "read" UserToolSessionApprovalKindWrite UserToolSessionApprovalKind = "write" @@ -8267,9 +8267,9 @@ type WorkspaceSummaryHostType string const ( // Workspace summary repository is hosted on Azure DevOps. - WorkspaceSummaryHostTypeAdo WorkspaceSummaryHostType = "ado" + WorkspaceSummaryHostTypeADO WorkspaceSummaryHostType = "ado" // Workspace summary repository is hosted on GitHub. - WorkspaceSummaryHostTypeGithub WorkspaceSummaryHostType = "github" + WorkspaceSummaryHostTypeGitHub WorkspaceSummaryHostType = "github" ) // Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration. @@ -8279,16 +8279,16 @@ type WorkspacesWorkspaceDetailsHostType string const ( // Workspace repository is hosted on Azure DevOps. - WorkspacesWorkspaceDetailsHostTypeAdo WorkspacesWorkspaceDetailsHostType = "ado" + WorkspacesWorkspaceDetailsHostTypeADO WorkspacesWorkspaceDetailsHostType = "ado" // Workspace repository is hosted on GitHub. - WorkspacesWorkspaceDetailsHostTypeGithub WorkspacesWorkspaceDetailsHostType = "github" + WorkspacesWorkspaceDetailsHostTypeGitHub WorkspacesWorkspaceDetailsHostType = "github" ) -type serverApi struct { +type serverAPI struct { client *jsonrpc2.Client } -type ServerAccountApi serverApi +type ServerAccountAPI serverAPI // GetQuota gets Copilot quota usage for the authenticated user or supplied GitHub token. // @@ -8298,7 +8298,7 @@ type ServerAccountApi serverApi // the global auth context. // // Returns: Quota usage snapshots for the resolved user, keyed by quota type. -func (a *ServerAccountApi) GetQuota(ctx context.Context, params *AccountGetQuotaRequest) (*AccountGetQuotaResult, error) { +func (a *ServerAccountAPI) GetQuota(ctx context.Context, params *AccountGetQuotaRequest) (*AccountGetQuotaResult, error) { raw, err := a.client.Request("account.getQuota", params) if err != nil { return nil, err @@ -8310,9 +8310,9 @@ func (a *ServerAccountApi) GetQuota(ctx context.Context, params *AccountGetQuota return &result, nil } -// Experimental: ServerAgentRegistryApi contains experimental APIs that may change or be +// Experimental: ServerAgentRegistryAPI contains experimental APIs that may change or be // removed. -type ServerAgentRegistryApi serverApi +type ServerAgentRegistryAPI serverAPI // Spawns a managed-server child with the supplied configuration and returns a // discriminated-union result. The caller (typically the CLI controller) is responsible for @@ -8324,7 +8324,7 @@ type ServerAgentRegistryApi serverApi // Parameters: Inputs to spawn a managed-server child via the controller's spawn delegate. // // Returns: Outcome of an agentRegistry.spawn call. -func (a *ServerAgentRegistryApi) Spawn(ctx context.Context, params *AgentRegistrySpawnRequest) (AgentRegistrySpawnResult, error) { +func (a *ServerAgentRegistryAPI) Spawn(ctx context.Context, params *AgentRegistrySpawnRequest) (AgentRegistrySpawnResult, error) { raw, err := a.client.Request("agentRegistry.spawn", params) if err != nil { return nil, err @@ -8336,7 +8336,7 @@ func (a *ServerAgentRegistryApi) Spawn(ctx context.Context, params *AgentRegistr return result, nil } -type ServerMcpApi serverApi +type ServerMCPAPI serverAPI // Discovers MCP servers from user, workspace, plugin, and builtin sources. // @@ -8345,31 +8345,31 @@ type ServerMcpApi serverApi // Parameters: Optional working directory used as context for MCP server discovery. // // Returns: MCP servers discovered from user, workspace, plugin, and built-in sources. -func (a *ServerMcpApi) Discover(ctx context.Context, params *McpDiscoverRequest) (*McpDiscoverResult, error) { +func (a *ServerMCPAPI) Discover(ctx context.Context, params *MCPDiscoverRequest) (*MCPDiscoverResult, error) { raw, err := a.client.Request("mcp.discover", params) if err != nil { return nil, err } - var result McpDiscoverResult + var result MCPDiscoverResult if err := json.Unmarshal(raw, &result); err != nil { return nil, err } return &result, nil } -type ServerMcpConfigApi serverApi +type ServerMCPConfigAPI serverAPI // Adds an MCP server to user configuration. // // RPC method: mcp.config.add. // // Parameters: MCP server name and configuration to add to user configuration. -func (a *ServerMcpConfigApi) Add(ctx context.Context, params *McpConfigAddRequest) (*McpConfigAddResult, error) { +func (a *ServerMCPConfigAPI) Add(ctx context.Context, params *MCPConfigAddRequest) (*MCPConfigAddResult, error) { raw, err := a.client.Request("mcp.config.add", params) if err != nil { return nil, err } - var result McpConfigAddResult + var result MCPConfigAddResult if err := json.Unmarshal(raw, &result); err != nil { return nil, err } @@ -8381,12 +8381,12 @@ func (a *ServerMcpConfigApi) Add(ctx context.Context, params *McpConfigAddReques // RPC method: mcp.config.disable. // // Parameters: MCP server names to disable for new sessions. -func (a *ServerMcpConfigApi) Disable(ctx context.Context, params *McpConfigDisableRequest) (*McpConfigDisableResult, error) { +func (a *ServerMCPConfigAPI) Disable(ctx context.Context, params *MCPConfigDisableRequest) (*MCPConfigDisableResult, error) { raw, err := a.client.Request("mcp.config.disable", params) if err != nil { return nil, err } - var result McpConfigDisableResult + var result MCPConfigDisableResult if err := json.Unmarshal(raw, &result); err != nil { return nil, err } @@ -8398,12 +8398,12 @@ func (a *ServerMcpConfigApi) Disable(ctx context.Context, params *McpConfigDisab // RPC method: mcp.config.enable. // // Parameters: MCP server names to enable for new sessions. -func (a *ServerMcpConfigApi) Enable(ctx context.Context, params *McpConfigEnableRequest) (*McpConfigEnableResult, error) { +func (a *ServerMCPConfigAPI) Enable(ctx context.Context, params *MCPConfigEnableRequest) (*MCPConfigEnableResult, error) { raw, err := a.client.Request("mcp.config.enable", params) if err != nil { return nil, err } - var result McpConfigEnableResult + var result MCPConfigEnableResult if err := json.Unmarshal(raw, &result); err != nil { return nil, err } @@ -8415,12 +8415,12 @@ func (a *ServerMcpConfigApi) Enable(ctx context.Context, params *McpConfigEnable // RPC method: mcp.config.list. // // Returns: User-configured MCP servers, keyed by server name. -func (a *ServerMcpConfigApi) List(ctx context.Context) (*McpConfigList, error) { +func (a *ServerMCPConfigAPI) List(ctx context.Context) (*MCPConfigList, error) { raw, err := a.client.Request("mcp.config.list", nil) if err != nil { return nil, err } - var result McpConfigList + var result MCPConfigList if err := json.Unmarshal(raw, &result); err != nil { return nil, err } @@ -8431,12 +8431,12 @@ func (a *ServerMcpConfigApi) List(ctx context.Context) (*McpConfigList, error) { // config read observes disk. // // RPC method: mcp.config.reload. -func (a *ServerMcpConfigApi) Reload(ctx context.Context) (*McpConfigReloadResult, error) { +func (a *ServerMCPConfigAPI) Reload(ctx context.Context) (*MCPConfigReloadResult, error) { raw, err := a.client.Request("mcp.config.reload", nil) if err != nil { return nil, err } - var result McpConfigReloadResult + var result MCPConfigReloadResult if err := json.Unmarshal(raw, &result); err != nil { return nil, err } @@ -8448,12 +8448,12 @@ func (a *ServerMcpConfigApi) Reload(ctx context.Context) (*McpConfigReloadResult // RPC method: mcp.config.remove. // // Parameters: MCP server name to remove from user configuration. -func (a *ServerMcpConfigApi) Remove(ctx context.Context, params *McpConfigRemoveRequest) (*McpConfigRemoveResult, error) { +func (a *ServerMCPConfigAPI) Remove(ctx context.Context, params *MCPConfigRemoveRequest) (*MCPConfigRemoveResult, error) { raw, err := a.client.Request("mcp.config.remove", params) if err != nil { return nil, err } - var result McpConfigRemoveResult + var result MCPConfigRemoveResult if err := json.Unmarshal(raw, &result); err != nil { return nil, err } @@ -8465,23 +8465,23 @@ func (a *ServerMcpConfigApi) Remove(ctx context.Context, params *McpConfigRemove // RPC method: mcp.config.update. // // Parameters: MCP server name and replacement configuration to write to user configuration. -func (a *ServerMcpConfigApi) Update(ctx context.Context, params *McpConfigUpdateRequest) (*McpConfigUpdateResult, error) { +func (a *ServerMCPConfigAPI) Update(ctx context.Context, params *MCPConfigUpdateRequest) (*MCPConfigUpdateResult, error) { raw, err := a.client.Request("mcp.config.update", params) if err != nil { return nil, err } - var result McpConfigUpdateResult + var result MCPConfigUpdateResult if err := json.Unmarshal(raw, &result); err != nil { return nil, err } return &result, nil } -func (s *ServerMcpApi) Config() *ServerMcpConfigApi { - return (*ServerMcpConfigApi)(s) +func (s *ServerMCPAPI) Config() *ServerMCPConfigAPI { + return (*ServerMCPConfigAPI)(s) } -type ServerModelsApi serverApi +type ServerModelsAPI serverAPI // Lists Copilot models available to the authenticated user. // @@ -8492,7 +8492,7 @@ type ServerModelsApi serverApi // // Returns: List of Copilot models available to the resolved user, including capabilities // and billing metadata. -func (a *ServerModelsApi) List(ctx context.Context, params *ModelsListRequest) (*ModelList, error) { +func (a *ServerModelsAPI) List(ctx context.Context, params *ModelsListRequest) (*ModelList, error) { raw, err := a.client.Request("models.list", params) if err != nil { return nil, err @@ -8504,13 +8504,13 @@ func (a *ServerModelsApi) List(ctx context.Context, params *ModelsListRequest) ( return &result, nil } -type ServerRuntimeApi serverApi +type ServerRuntimeAPI serverAPI // Shutdown gracefully shuts down an SDK-owned runtime. The response is sent only after // cleanup completes; callers may then terminate the owned runtime process. // // RPC method: runtime.shutdown. -func (a *ServerRuntimeApi) Shutdown(ctx context.Context) (*RuntimeShutdownResult, error) { +func (a *ServerRuntimeAPI) Shutdown(ctx context.Context) (*RuntimeShutdownResult, error) { raw, err := a.client.Request("runtime.shutdown", nil) if err != nil { return nil, err @@ -8522,7 +8522,7 @@ func (a *ServerRuntimeApi) Shutdown(ctx context.Context) (*RuntimeShutdownResult return &result, nil } -type ServerSecretsApi serverApi +type ServerSecretsAPI serverAPI // AddFilterValues registers secret values for redaction in session logs and exports. The // SDK calls this to inject dynamically generated secret values (e.g., OIDC tokens). @@ -8532,7 +8532,7 @@ type ServerSecretsApi serverApi // Parameters: Secret values to add to the redaction filter. // // Returns: Confirmation that the secret values were registered. -func (a *ServerSecretsApi) AddFilterValues(ctx context.Context, params *SecretsAddFilterValuesRequest) (*SecretsAddFilterValuesResult, error) { +func (a *ServerSecretsAPI) AddFilterValues(ctx context.Context, params *SecretsAddFilterValuesRequest) (*SecretsAddFilterValuesResult, error) { raw, err := a.client.Request("secrets.addFilterValues", params) if err != nil { return nil, err @@ -8544,7 +8544,7 @@ func (a *ServerSecretsApi) AddFilterValues(ctx context.Context, params *SecretsA return &result, nil } -type ServerSessionFsApi serverApi +type ServerSessionFSAPI serverAPI // SetProvider registers an SDK client as the session filesystem provider. // @@ -8555,20 +8555,20 @@ type ServerSessionFsApi serverApi // // Returns: Indicates whether the calling client was registered as the session filesystem // provider. -func (a *ServerSessionFsApi) SetProvider(ctx context.Context, params *SessionFsSetProviderRequest) (*SessionFsSetProviderResult, error) { +func (a *ServerSessionFSAPI) SetProvider(ctx context.Context, params *SessionFSSetProviderRequest) (*SessionFSSetProviderResult, error) { raw, err := a.client.Request("sessionFs.setProvider", params) if err != nil { return nil, err } - var result SessionFsSetProviderResult + var result SessionFSSetProviderResult if err := json.Unmarshal(raw, &result); err != nil { return nil, err } return &result, nil } -// Experimental: ServerSessionsApi contains experimental APIs that may change or be removed. -type ServerSessionsApi serverApi +// Experimental: ServerSessionsAPI contains experimental APIs that may change or be removed. +type ServerSessionsAPI serverAPI // BulkDelete closes, deactivates, and deletes a set of sessions, returning the bytes freed // per session. @@ -8578,7 +8578,7 @@ type ServerSessionsApi serverApi // Parameters: Session IDs to close, deactivate, and delete from disk. // // Returns: Map of sessionId -> bytes freed by removing the session's workspace directory. -func (a *ServerSessionsApi) BulkDelete(ctx context.Context, params *SessionsBulkDeleteRequest) (*SessionBulkDeleteResult, error) { +func (a *ServerSessionsAPI) BulkDelete(ctx context.Context, params *SessionsBulkDeleteRequest) (*SessionBulkDeleteResult, error) { raw, err := a.client.Request("sessions.bulkDelete", params) if err != nil { return nil, err @@ -8598,7 +8598,7 @@ func (a *ServerSessionsApi) BulkDelete(ctx context.Context, params *SessionsBulk // Parameters: Session IDs to test for live in-use locks. // // Returns: Session IDs from the input set that are currently in use by another process. -func (a *ServerSessionsApi) CheckInUse(ctx context.Context, params *SessionsCheckInUseRequest) (*SessionsCheckInUseResult, error) { +func (a *ServerSessionsAPI) CheckInUse(ctx context.Context, params *SessionsCheckInUseRequest) (*SessionsCheckInUseResult, error) { raw, err := a.client.Request("sessions.checkInUse", params) if err != nil { return nil, err @@ -8620,7 +8620,7 @@ func (a *ServerSessionsApi) CheckInUse(ctx context.Context, params *SessionsChec // Returns: Closes a session: emits shutdown, flushes pending events to disk, releases the // in-use lock, disposes the active session. Idempotent: succeeds even if the session is not // currently active. -func (a *ServerSessionsApi) Close(ctx context.Context, params *SessionsCloseRequest) (*SessionsCloseResult, error) { +func (a *ServerSessionsAPI) Close(ctx context.Context, params *SessionsCloseRequest) (*SessionsCloseResult, error) { raw, err := a.client.Request("sessions.close", params) if err != nil { return nil, err @@ -8639,7 +8639,7 @@ func (a *ServerSessionsApi) Close(ctx context.Context, params *SessionsCloseRequ // Parameters: Remote session connection parameters. // // Returns: Remote session connection result. -func (a *ServerSessionsApi) Connect(ctx context.Context, params *ConnectRemoteSessionParams) (*RemoteSessionConnectionResult, error) { +func (a *ServerSessionsAPI) Connect(ctx context.Context, params *ConnectRemoteSessionParams) (*RemoteSessionConnectionResult, error) { raw, err := a.client.Request("sessions.connect", params) if err != nil { return nil, err @@ -8660,7 +8660,7 @@ func (a *ServerSessionsApi) Connect(ctx context.Context, params *ConnectRemoteSe // // Returns: The enriched metadata records, with summary and context fields backfilled where // available. Sessions confirmed empty and unnamed are omitted. -func (a *ServerSessionsApi) EnrichMetadata(ctx context.Context, params *SessionsEnrichMetadataRequest) (*SessionEnrichMetadataResult, error) { +func (a *ServerSessionsAPI) EnrichMetadata(ctx context.Context, params *SessionsEnrichMetadataRequest) (*SessionEnrichMetadataResult, error) { raw, err := a.client.Request("sessions.enrichMetadata", params) if err != nil { return nil, err @@ -8680,7 +8680,7 @@ func (a *ServerSessionsApi) EnrichMetadata(ctx context.Context, params *Sessions // Parameters: UUID prefix to resolve to a unique session ID. // // Returns: Session ID matching the prefix, omitted when no unique match exists. -func (a *ServerSessionsApi) FindByPrefix(ctx context.Context, params *SessionsFindByPrefixRequest) (*SessionsFindByPrefixResult, error) { +func (a *ServerSessionsAPI) FindByPrefix(ctx context.Context, params *SessionsFindByPrefixRequest) (*SessionsFindByPrefixResult, error) { raw, err := a.client.Request("sessions.findByPrefix", params) if err != nil { return nil, err @@ -8699,7 +8699,7 @@ func (a *ServerSessionsApi) FindByPrefix(ctx context.Context, params *SessionsFi // Parameters: GitHub task ID to look up. // // Returns: ID of the local session bound to the given GitHub task, or omitted when none. -func (a *ServerSessionsApi) FindByTaskId(ctx context.Context, params *SessionsFindByTaskIDRequest) (*SessionsFindByTaskIDResult, error) { +func (a *ServerSessionsAPI) FindByTaskId(ctx context.Context, params *SessionsFindByTaskIDRequest) (*SessionsFindByTaskIDResult, error) { raw, err := a.client.Request("sessions.findByTaskId", params) if err != nil { return nil, err @@ -8719,7 +8719,7 @@ func (a *ServerSessionsApi) FindByTaskId(ctx context.Context, params *SessionsFi // optional friendly name for the new session. // // Returns: Identifier and optional friendly name assigned to the newly forked session. -func (a *ServerSessionsApi) Fork(ctx context.Context, params *SessionsForkRequest) (*SessionsForkResult, error) { +func (a *ServerSessionsAPI) Fork(ctx context.Context, params *SessionsForkRequest) (*SessionsForkResult, error) { raw, err := a.client.Request("sessions.fork", params) if err != nil { return nil, err @@ -8738,7 +8738,7 @@ func (a *ServerSessionsApi) Fork(ctx context.Context, params *SessionsForkReques // Parameters: Session ID whose event-log file path to compute. // // Returns: Absolute path to the session's events.jsonl file on disk. -func (a *ServerSessionsApi) GetEventFilePath(ctx context.Context, params *SessionsGetEventFilePathRequest) (*SessionsGetEventFilePathResult, error) { +func (a *ServerSessionsAPI) GetEventFilePath(ctx context.Context, params *SessionsGetEventFilePathRequest) (*SessionsGetEventFilePathResult, error) { raw, err := a.client.Request("sessions.getEventFilePath", params) if err != nil { return nil, err @@ -8759,7 +8759,7 @@ func (a *ServerSessionsApi) GetEventFilePath(ctx context.Context, params *Sessio // // Returns: Most-relevant session ID for the supplied context, or omitted when no sessions // exist. -func (a *ServerSessionsApi) GetLastForContext(ctx context.Context, params *SessionsGetLastForContextRequest) (*SessionsGetLastForContextResult, error) { +func (a *ServerSessionsAPI) GetLastForContext(ctx context.Context, params *SessionsGetLastForContextRequest) (*SessionsGetLastForContextResult, error) { raw, err := a.client.Request("sessions.getLastForContext", params) if err != nil { return nil, err @@ -8780,7 +8780,7 @@ func (a *ServerSessionsApi) GetLastForContext(ctx context.Context, params *Sessi // // Returns: The session's persisted remote-steerable flag, or omitted when no value has been // persisted. -func (a *ServerSessionsApi) GetPersistedRemoteSteerable(ctx context.Context, params *SessionsGetPersistedRemoteSteerableRequest) (*SessionsGetPersistedRemoteSteerableResult, error) { +func (a *ServerSessionsAPI) GetPersistedRemoteSteerable(ctx context.Context, params *SessionsGetPersistedRemoteSteerableRequest) (*SessionsGetPersistedRemoteSteerableResult, error) { raw, err := a.client.Request("sessions.getPersistedRemoteSteerable", params) if err != nil { return nil, err @@ -8797,7 +8797,7 @@ func (a *ServerSessionsApi) GetPersistedRemoteSteerable(ctx context.Context, par // RPC method: sessions.getSizes. // // Returns: Map of sessionId -> on-disk size in bytes for each session's workspace directory. -func (a *ServerSessionsApi) GetSizes(ctx context.Context) (*SessionSizes, error) { +func (a *ServerSessionsAPI) GetSizes(ctx context.Context) (*SessionSizes, error) { raw, err := a.client.Request("sessions.getSizes", nil) if err != nil { return nil, err @@ -8816,7 +8816,7 @@ func (a *ServerSessionsApi) GetSizes(ctx context.Context) (*SessionSizes, error) // Parameters: Optional metadata-load limit and filters applied to the returned sessions. // // Returns: Persisted sessions matching the filter, ordered most-recently-modified first. -func (a *ServerSessionsApi) List(ctx context.Context, params *SessionsListRequest) (*SessionList, error) { +func (a *ServerSessionsAPI) List(ctx context.Context, params *SessionsListRequest) (*SessionList, error) { raw, err := a.client.Request("sessions.list", params) if err != nil { return nil, err @@ -8836,7 +8836,7 @@ func (a *ServerSessionsApi) List(ctx context.Context, params *SessionsListReques // Parameters: Active session ID whose deferred repo-level hooks should be loaded. // // Returns: Queued repo-level startup prompts and the total hook command count after loading. -func (a *ServerSessionsApi) LoadDeferredRepoHooks(ctx context.Context, params *SessionsLoadDeferredRepoHooksRequest) (*SessionLoadDeferredRepoHooksResult, error) { +func (a *ServerSessionsAPI) LoadDeferredRepoHooks(ctx context.Context, params *SessionsLoadDeferredRepoHooksRequest) (*SessionLoadDeferredRepoHooksResult, error) { raw, err := a.client.Request("sessions.loadDeferredRepoHooks", params) if err != nil { return nil, err @@ -8858,7 +8858,7 @@ func (a *ServerSessionsApi) LoadDeferredRepoHooks(ctx context.Context, params *S // // Returns: Outcome of the prune operation: deleted IDs, dry-run candidates, skipped IDs, // total bytes freed, and the dry-run flag. -func (a *ServerSessionsApi) PruneOld(ctx context.Context, params *SessionsPruneOldRequest) (*SessionPruneResult, error) { +func (a *ServerSessionsAPI) PruneOld(ctx context.Context, params *SessionsPruneOldRequest) (*SessionPruneResult, error) { raw, err := a.client.Request("sessions.pruneOld", params) if err != nil { return nil, err @@ -8878,7 +8878,7 @@ func (a *ServerSessionsApi) PruneOld(ctx context.Context, params *SessionsPruneO // // Returns: Release the in-use lock held by this process for the given session. No-op when // this process does not currently hold a lock for the session. -func (a *ServerSessionsApi) ReleaseLock(ctx context.Context, params *SessionsReleaseLockRequest) (*SessionsReleaseLockResult, error) { +func (a *ServerSessionsAPI) ReleaseLock(ctx context.Context, params *SessionsReleaseLockRequest) (*SessionsReleaseLockResult, error) { raw, err := a.client.Request("sessions.releaseLock", params) if err != nil { return nil, err @@ -8900,7 +8900,7 @@ func (a *ServerSessionsApi) ReleaseLock(ctx context.Context, params *SessionsRel // Returns: Reload all hooks (user, plugin, optionally repo) and apply them to the active // session. Call after installing or removing plugins so their hooks take effect // immediately. No-op when no active session matches the given sessionId. -func (a *ServerSessionsApi) ReloadPluginHooks(ctx context.Context, params *SessionsReloadPluginHooksRequest) (*SessionsReloadPluginHooksResult, error) { +func (a *ServerSessionsAPI) ReloadPluginHooks(ctx context.Context, params *SessionsReloadPluginHooksRequest) (*SessionsReloadPluginHooksResult, error) { raw, err := a.client.Request("sessions.reloadPluginHooks", params) if err != nil { return nil, err @@ -8920,7 +8920,7 @@ func (a *ServerSessionsApi) ReloadPluginHooks(ctx context.Context, params *Sessi // // Returns: Flush a session's pending events to disk. No-op when no writer exists for the // session (e.g., already closed). -func (a *ServerSessionsApi) Save(ctx context.Context, params *SessionsSaveRequest) (*SessionsSaveResult, error) { +func (a *ServerSessionsAPI) Save(ctx context.Context, params *SessionsSaveRequest) (*SessionsSaveResult, error) { raw, err := a.client.Request("sessions.save", params) if err != nil { return nil, err @@ -8943,7 +8943,7 @@ func (a *ServerSessionsApi) Save(ctx context.Context, params *SessionsSaveReques // Returns: Replace the manager-wide additional plugins. New session creations and // subsequent hook reloads see the new set; already-running sessions keep their existing // hook installation until the next reload. -func (a *ServerSessionsApi) SetAdditionalPlugins(ctx context.Context, params *SessionsSetAdditionalPluginsRequest) (*SessionsSetAdditionalPluginsResult, error) { +func (a *ServerSessionsAPI) SetAdditionalPlugins(ctx context.Context, params *SessionsSetAdditionalPluginsRequest) (*SessionsSetAdditionalPluginsResult, error) { raw, err := a.client.Request("sessions.setAdditionalPlugins", params) if err != nil { return nil, err @@ -8955,7 +8955,7 @@ func (a *ServerSessionsApi) SetAdditionalPlugins(ctx context.Context, params *Se return &result, nil } -type ServerSkillsApi serverApi +type ServerSkillsAPI serverAPI // Discovers skills across global and project sources. // @@ -8965,7 +8965,7 @@ type ServerSkillsApi serverApi // discovery. // // Returns: Skills discovered across global and project sources. -func (a *ServerSkillsApi) Discover(ctx context.Context, params *SkillsDiscoverRequest) (*ServerSkillList, error) { +func (a *ServerSkillsAPI) Discover(ctx context.Context, params *SkillsDiscoverRequest) (*ServerSkillList, error) { raw, err := a.client.Request("skills.discover", params) if err != nil { return nil, err @@ -8977,7 +8977,7 @@ func (a *ServerSkillsApi) Discover(ctx context.Context, params *SkillsDiscoverRe return &result, nil } -type ServerSkillsConfigApi serverApi +type ServerSkillsConfigAPI serverAPI // SetDisabledSkills replaces the global list of disabled skills. // @@ -8985,7 +8985,7 @@ type ServerSkillsConfigApi serverApi // // Parameters: Skill names to mark as disabled in global configuration, replacing any // previous list. -func (a *ServerSkillsConfigApi) SetDisabledSkills(ctx context.Context, params *SkillsConfigSetDisabledSkillsRequest) (*SkillsConfigSetDisabledSkillsResult, error) { +func (a *ServerSkillsConfigAPI) SetDisabledSkills(ctx context.Context, params *SkillsConfigSetDisabledSkillsRequest) (*SkillsConfigSetDisabledSkillsResult, error) { raw, err := a.client.Request("skills.config.setDisabledSkills", params) if err != nil { return nil, err @@ -8997,11 +8997,11 @@ func (a *ServerSkillsConfigApi) SetDisabledSkills(ctx context.Context, params *S return &result, nil } -func (s *ServerSkillsApi) Config() *ServerSkillsConfigApi { - return (*ServerSkillsConfigApi)(s) +func (s *ServerSkillsAPI) Config() *ServerSkillsConfigAPI { + return (*ServerSkillsConfigAPI)(s) } -type ServerToolsApi serverApi +type ServerToolsAPI serverAPI // Lists built-in tools available for a model. // @@ -9012,7 +9012,7 @@ type ServerToolsApi serverApi // // Returns: Built-in tools available for the requested model, with their parameters and // instructions. -func (a *ServerToolsApi) List(ctx context.Context, params *ToolsListRequest) (*ToolList, error) { +func (a *ServerToolsAPI) List(ctx context.Context, params *ToolsListRequest) (*ToolList, error) { raw, err := a.client.Request("tools.list", params) if err != nil { return nil, err @@ -9024,15 +9024,15 @@ func (a *ServerToolsApi) List(ctx context.Context, params *ToolsListRequest) (*T return &result, nil } -type ServerUserApi serverApi +type ServerUserAPI serverAPI -type ServerUserSettingsApi serverApi +type ServerUserSettingsAPI serverAPI // Reload drops this runtime process's in-memory user settings cache so the next settings // read observes disk. // // RPC method: user.settings.reload. -func (a *ServerUserSettingsApi) Reload(ctx context.Context) (*UserSettingsReloadResult, error) { +func (a *ServerUserSettingsAPI) Reload(ctx context.Context) (*UserSettingsReloadResult, error) { raw, err := a.client.Request("user.settings.reload", nil) if err != nil { return nil, err @@ -9044,26 +9044,26 @@ func (a *ServerUserSettingsApi) Reload(ctx context.Context) (*UserSettingsReload return &result, nil } -func (s *ServerUserApi) Settings() *ServerUserSettingsApi { - return (*ServerUserSettingsApi)(s) +func (s *ServerUserAPI) Settings() *ServerUserSettingsAPI { + return (*ServerUserSettingsAPI)(s) } -// ServerRpc provides typed server-scoped RPC methods. -type ServerRpc struct { +// ServerRPC provides typed server-scoped RPC methods. +type ServerRPC struct { // Reuse a single struct instead of allocating one for each service on the heap. - common serverApi + common serverAPI - Account *ServerAccountApi - AgentRegistry *ServerAgentRegistryApi - Mcp *ServerMcpApi - Models *ServerModelsApi - Runtime *ServerRuntimeApi - Secrets *ServerSecretsApi - SessionFs *ServerSessionFsApi - Sessions *ServerSessionsApi - Skills *ServerSkillsApi - Tools *ServerToolsApi - User *ServerUserApi + Account *ServerAccountAPI + AgentRegistry *ServerAgentRegistryAPI + MCP *ServerMCPAPI + Models *ServerModelsAPI + Runtime *ServerRuntimeAPI + Secrets *ServerSecretsAPI + SessionFS *ServerSessionFSAPI + Sessions *ServerSessionsAPI + Skills *ServerSkillsAPI + Tools *ServerToolsAPI + User *ServerUserAPI } // Ping checks server responsiveness and returns protocol information. @@ -9074,7 +9074,7 @@ type ServerRpc struct { // // Returns: Server liveness response, including the echoed message, current server // timestamp, and protocol version. -func (a *ServerRpc) Ping(ctx context.Context, params *PingRequest) (*PingResult, error) { +func (a *ServerRPC) Ping(ctx context.Context, params *PingRequest) (*PingResult, error) { raw, err := a.common.client.Request("ping", params) if err != nil { return nil, err @@ -9086,32 +9086,32 @@ func (a *ServerRpc) Ping(ctx context.Context, params *PingRequest) (*PingResult, return &result, nil } -func NewServerRpc(client *jsonrpc2.Client) *ServerRpc { - r := &ServerRpc{} - r.common = serverApi{client: client} - r.Account = (*ServerAccountApi)(&r.common) - r.AgentRegistry = (*ServerAgentRegistryApi)(&r.common) - r.Mcp = (*ServerMcpApi)(&r.common) - r.Models = (*ServerModelsApi)(&r.common) - r.Runtime = (*ServerRuntimeApi)(&r.common) - r.Secrets = (*ServerSecretsApi)(&r.common) - r.SessionFs = (*ServerSessionFsApi)(&r.common) - r.Sessions = (*ServerSessionsApi)(&r.common) - r.Skills = (*ServerSkillsApi)(&r.common) - r.Tools = (*ServerToolsApi)(&r.common) - r.User = (*ServerUserApi)(&r.common) +func NewServerRPC(client *jsonrpc2.Client) *ServerRPC { + r := &ServerRPC{} + r.common = serverAPI{client: client} + r.Account = (*ServerAccountAPI)(&r.common) + r.AgentRegistry = (*ServerAgentRegistryAPI)(&r.common) + r.MCP = (*ServerMCPAPI)(&r.common) + r.Models = (*ServerModelsAPI)(&r.common) + r.Runtime = (*ServerRuntimeAPI)(&r.common) + r.Secrets = (*ServerSecretsAPI)(&r.common) + r.SessionFS = (*ServerSessionFSAPI)(&r.common) + r.Sessions = (*ServerSessionsAPI)(&r.common) + r.Skills = (*ServerSkillsAPI)(&r.common) + r.Tools = (*ServerToolsAPI)(&r.common) + r.User = (*ServerUserAPI)(&r.common) return r } -type internalServerApi struct { +type internalServerAPI struct { client *jsonrpc2.Client } -// InternalServerRpc provides internal SDK server-scoped RPC methods (handshake helpers +// InternalServerRPC provides internal SDK server-scoped RPC methods (handshake helpers // etc.). Not part of the public API. -type InternalServerRpc struct { +type InternalServerRPC struct { // Reuse a single struct instead of allocating one for each service on the heap. - common internalServerApi + common internalServerAPI } // Connect performs the SDK server connection handshake and validates the optional @@ -9125,7 +9125,7 @@ type InternalServerRpc struct { // success. // Internal: Connect is part of the SDK's internal handshake/plumbing; external callers // should not use it. -func (a *InternalServerRpc) Connect(ctx context.Context, params *ConnectRequest) (*ConnectResult, error) { +func (a *InternalServerRPC) Connect(ctx context.Context, params *ConnectRequest) (*ConnectResult, error) { raw, err := a.common.client.Request("connect", params) if err != nil { return nil, err @@ -9137,24 +9137,24 @@ func (a *InternalServerRpc) Connect(ctx context.Context, params *ConnectRequest) return &result, nil } -func NewInternalServerRpc(client *jsonrpc2.Client) *InternalServerRpc { - r := &InternalServerRpc{} - r.common = internalServerApi{client: client} +func NewInternalServerRPC(client *jsonrpc2.Client) *InternalServerRPC { + r := &InternalServerRPC{} + r.common = internalServerAPI{client: client} return r } -type sessionApi struct { +type sessionAPI struct { client *jsonrpc2.Client sessionID string } -// Experimental: AgentApi contains experimental APIs that may change or be removed. -type AgentApi sessionApi +// Experimental: AgentAPI contains experimental APIs that may change or be removed. +type AgentAPI sessionAPI // Deselect clears the selected custom agent and returns the session to the default agent. // // RPC method: session.agent.deselect. -func (a *AgentApi) Deselect(ctx context.Context) (*SessionAgentDeselectResult, error) { +func (a *AgentAPI) Deselect(ctx context.Context) (*SessionAgentDeselectResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.agent.deselect", req) if err != nil { @@ -9172,7 +9172,7 @@ func (a *AgentApi) Deselect(ctx context.Context) (*SessionAgentDeselectResult, e // RPC method: session.agent.getCurrent. // // Returns: The currently selected custom agent, or null when using the default agent. -func (a *AgentApi) GetCurrent(ctx context.Context) (*AgentGetCurrentResult, error) { +func (a *AgentAPI) GetCurrent(ctx context.Context) (*AgentGetCurrentResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.agent.getCurrent", req) if err != nil { @@ -9190,7 +9190,7 @@ func (a *AgentApi) GetCurrent(ctx context.Context) (*AgentGetCurrentResult, erro // RPC method: session.agent.list. // // Returns: Custom agents available to the session. -func (a *AgentApi) List(ctx context.Context) (*AgentList, error) { +func (a *AgentAPI) List(ctx context.Context) (*AgentList, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.agent.list", req) if err != nil { @@ -9208,7 +9208,7 @@ func (a *AgentApi) List(ctx context.Context) (*AgentList, error) { // RPC method: session.agent.reload. // // Returns: Custom agents available to the session after reloading definitions from disk. -func (a *AgentApi) Reload(ctx context.Context) (*AgentReloadResult, error) { +func (a *AgentAPI) Reload(ctx context.Context) (*AgentReloadResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.agent.reload", req) if err != nil { @@ -9228,7 +9228,7 @@ func (a *AgentApi) Reload(ctx context.Context) (*AgentReloadResult, error) { // Parameters: Name of the custom agent to select for subsequent turns. // // Returns: The newly selected custom agent. -func (a *AgentApi) Select(ctx context.Context, params *AgentSelectRequest) (*AgentSelectResult, error) { +func (a *AgentAPI) Select(ctx context.Context, params *AgentSelectRequest) (*AgentSelectResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["name"] = params.Name @@ -9244,15 +9244,15 @@ func (a *AgentApi) Select(ctx context.Context, params *AgentSelectRequest) (*Age return &result, nil } -// Experimental: AuthApi contains experimental APIs that may change or be removed. -type AuthApi sessionApi +// Experimental: AuthAPI contains experimental APIs that may change or be removed. +type AuthAPI sessionAPI // GetStatus gets authentication status and account metadata for the session. // // RPC method: session.auth.getStatus. // // Returns: Authentication status and account metadata for the session. -func (a *AuthApi) GetStatus(ctx context.Context) (*SessionAuthStatus, error) { +func (a *AuthAPI) GetStatus(ctx context.Context) (*SessionAuthStatus, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.auth.getStatus", req) if err != nil { @@ -9274,7 +9274,7 @@ func (a *AuthApi) GetStatus(ctx context.Context) (*SessionAuthStatus, error) { // unchanged. // // Returns: Indicates whether the credential update succeeded. -func (a *AuthApi) SetCredentials(ctx context.Context, params *SessionSetCredentialsParams) (*SessionSetCredentialsResult, error) { +func (a *AuthAPI) SetCredentials(ctx context.Context, params *SessionSetCredentialsParams) (*SessionSetCredentialsResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { if params.Credentials != nil { @@ -9292,15 +9292,15 @@ func (a *AuthApi) SetCredentials(ctx context.Context, params *SessionSetCredenti return &result, nil } -// Experimental: CanvasApi contains experimental APIs that may change or be removed. -type CanvasApi sessionApi +// Experimental: CanvasAPI contains experimental APIs that may change or be removed. +type CanvasAPI sessionAPI // Closes an open canvas instance. // // RPC method: session.canvas.close. // // Parameters: Canvas close parameters. -func (a *CanvasApi) Close(ctx context.Context, params *CanvasCloseRequest) (*SessionCanvasCloseResult, error) { +func (a *CanvasAPI) Close(ctx context.Context, params *CanvasCloseRequest) (*SessionCanvasCloseResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["instanceId"] = params.InstanceID @@ -9321,7 +9321,7 @@ func (a *CanvasApi) Close(ctx context.Context, params *CanvasCloseRequest) (*Ses // RPC method: session.canvas.list. // // Returns: Declared canvases available in this session. -func (a *CanvasApi) List(ctx context.Context) (*CanvasList, error) { +func (a *CanvasAPI) List(ctx context.Context) (*CanvasList, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.canvas.list", req) if err != nil { @@ -9339,7 +9339,7 @@ func (a *CanvasApi) List(ctx context.Context) (*CanvasList, error) { // RPC method: session.canvas.listOpen. // // Returns: Live open-canvas snapshot. -func (a *CanvasApi) ListOpen(ctx context.Context) (*CanvasListOpenResult, error) { +func (a *CanvasAPI) ListOpen(ctx context.Context) (*CanvasListOpenResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.canvas.listOpen", req) if err != nil { @@ -9359,7 +9359,7 @@ func (a *CanvasApi) ListOpen(ctx context.Context) (*CanvasListOpenResult, error) // Parameters: Canvas open parameters. // // Returns: Open canvas instance snapshot. -func (a *CanvasApi) Open(ctx context.Context, params *CanvasOpenRequest) (*OpenCanvasInstance, error) { +func (a *CanvasAPI) Open(ctx context.Context, params *CanvasOpenRequest) (*OpenCanvasInstance, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["canvasId"] = params.CanvasID @@ -9382,8 +9382,8 @@ func (a *CanvasApi) Open(ctx context.Context, params *CanvasOpenRequest) (*OpenC return &result, nil } -// Experimental: CanvasActionApi contains experimental APIs that may change or be removed. -type CanvasActionApi sessionApi +// Experimental: CanvasActionAPI contains experimental APIs that may change or be removed. +type CanvasActionAPI sessionAPI // Invokes an action on an open canvas instance. // @@ -9392,7 +9392,7 @@ type CanvasActionApi sessionApi // Parameters: Canvas action invocation parameters. // // Returns: Canvas action invocation result. -func (a *CanvasActionApi) Invoke(ctx context.Context, params *CanvasActionInvokeRequest) (*CanvasActionInvokeResult, error) { +func (a *CanvasActionAPI) Invoke(ctx context.Context, params *CanvasActionInvokeRequest) (*CanvasActionInvokeResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["actionName"] = params.ActionName @@ -9413,12 +9413,12 @@ func (a *CanvasActionApi) Invoke(ctx context.Context, params *CanvasActionInvoke } // Experimental: Action returns experimental APIs that may change or be removed. -func (s *CanvasApi) Action() *CanvasActionApi { - return (*CanvasActionApi)(s) +func (s *CanvasAPI) Action() *CanvasActionAPI { + return (*CanvasActionAPI)(s) } -// Experimental: CommandsApi contains experimental APIs that may change or be removed. -type CommandsApi sessionApi +// Experimental: CommandsAPI contains experimental APIs that may change or be removed. +type CommandsAPI sessionAPI // Enqueues a slash command for FIFO processing on the local session. // @@ -9427,7 +9427,7 @@ type CommandsApi sessionApi // Parameters: Slash-prefixed command string to enqueue for FIFO processing. // // Returns: Indicates whether the command was accepted into the local execution queue. -func (a *CommandsApi) Enqueue(ctx context.Context, params *EnqueueCommandParams) (*EnqueueCommandResult, error) { +func (a *CommandsAPI) Enqueue(ctx context.Context, params *EnqueueCommandParams) (*EnqueueCommandResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["command"] = params.Command @@ -9450,7 +9450,7 @@ func (a *CommandsApi) Enqueue(ctx context.Context, params *EnqueueCommandParams) // Parameters: Slash command name and argument string to execute synchronously. // // Returns: Error message produced while executing the command, if any. -func (a *CommandsApi) Execute(ctx context.Context, params *ExecuteCommandParams) (*ExecuteCommandResult, error) { +func (a *CommandsAPI) Execute(ctx context.Context, params *ExecuteCommandParams) (*ExecuteCommandResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["args"] = params.Args @@ -9474,7 +9474,7 @@ func (a *CommandsApi) Execute(ctx context.Context, params *ExecuteCommandParams) // Parameters: Pending command request ID and an optional error if the client handler failed. // // Returns: Indicates whether the pending client-handled command was completed successfully. -func (a *CommandsApi) HandlePendingCommand(ctx context.Context, params *CommandsHandlePendingCommandRequest) (*CommandsHandlePendingCommandResult, error) { +func (a *CommandsAPI) HandlePendingCommand(ctx context.Context, params *CommandsHandlePendingCommandRequest) (*CommandsHandlePendingCommandResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { if params.Error != nil { @@ -9501,7 +9501,7 @@ func (a *CommandsApi) HandlePendingCommand(ctx context.Context, params *Commands // // Returns: Result of invoking the slash command (text output, prompt to send to the agent, // or completion). -func (a *CommandsApi) Invoke(ctx context.Context, params *CommandsInvokeRequest) (SlashCommandInvocationResult, error) { +func (a *CommandsAPI) Invoke(ctx context.Context, params *CommandsInvokeRequest) (SlashCommandInvocationResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { if params.Input != nil { @@ -9528,7 +9528,7 @@ func (a *CommandsApi) Invoke(ctx context.Context, params *CommandsInvokeRequest) // // Returns: Slash commands available in the session, after applying any include/exclude // filters. -func (a *CommandsApi) List(ctx context.Context, params ...*CommandsListRequest) (*CommandList, error) { +func (a *CommandsAPI) List(ctx context.Context, params ...*CommandsListRequest) (*CommandList, error) { var requestParams *CommandsListRequest if len(params) > 0 { requestParams = params[0] @@ -9565,7 +9565,7 @@ func (a *CommandsApi) List(ctx context.Context, params ...*CommandsListRequest) // it (and whether to stop processing further queued commands). // // Returns: Indicates whether the queued-command response was matched to a pending request. -func (a *CommandsApi) RespondToQueuedCommand(ctx context.Context, params *CommandsRespondToQueuedCommandRequest) (*CommandsRespondToQueuedCommandResult, error) { +func (a *CommandsAPI) RespondToQueuedCommand(ctx context.Context, params *CommandsRespondToQueuedCommandRequest) (*CommandsRespondToQueuedCommandResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["requestId"] = params.RequestID @@ -9582,8 +9582,8 @@ func (a *CommandsApi) RespondToQueuedCommand(ctx context.Context, params *Comman return &result, nil } -// Experimental: EventLogApi contains experimental APIs that may change or be removed. -type EventLogApi sessionApi +// Experimental: EventLogAPI contains experimental APIs that may change or be removed. +type EventLogAPI sessionAPI // Reads a batch of session events from a cursor, optionally waiting for new events. // @@ -9594,7 +9594,7 @@ type EventLogApi sessionApi // // Returns: Batch of session events returned by a read, with cursor and continuation // metadata. -func (a *EventLogApi) Read(ctx context.Context, params *EventLogReadRequest) (*EventsReadResult, error) { +func (a *EventLogAPI) Read(ctx context.Context, params *EventLogReadRequest) (*EventsReadResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { if params.AgentScope != nil { @@ -9631,7 +9631,7 @@ func (a *EventLogApi) Read(ctx context.Context, params *EventLogReadRequest) (*E // Parameters: Event type to register consumer interest for, used by runtime gating logic. // // Returns: Opaque handle representing an event-type interest registration. -func (a *EventLogApi) RegisterInterest(ctx context.Context, params *RegisterEventInterestParams) (*RegisterEventInterestResult, error) { +func (a *EventLogAPI) RegisterInterest(ctx context.Context, params *RegisterEventInterestParams) (*RegisterEventInterestResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["eventType"] = params.EventType @@ -9654,7 +9654,7 @@ func (a *EventLogApi) RegisterInterest(ctx context.Context, params *RegisterEven // Parameters: Opaque handle previously returned by `registerInterest` to release. // // Returns: Indicates whether the operation succeeded. -func (a *EventLogApi) ReleaseInterest(ctx context.Context, params *ReleaseEventInterestParams) (*EventLogReleaseInterestResult, error) { +func (a *EventLogAPI) ReleaseInterest(ctx context.Context, params *ReleaseEventInterestParams) (*EventLogReleaseInterestResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["handle"] = params.Handle @@ -9678,7 +9678,7 @@ func (a *EventLogApi) ReleaseInterest(ctx context.Context, params *ReleaseEventI // a consumer wants to subscribe to live events going forward without first paginating // through the entire persisted history (which would happen if `read` were called without a // cursor on a long-lived session). -func (a *EventLogApi) Tail(ctx context.Context) (*EventLogTailResult, error) { +func (a *EventLogAPI) Tail(ctx context.Context) (*EventLogTailResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.eventLog.tail", req) if err != nil { @@ -9691,15 +9691,15 @@ func (a *EventLogApi) Tail(ctx context.Context) (*EventLogTailResult, error) { return &result, nil } -// Experimental: ExtensionsApi contains experimental APIs that may change or be removed. -type ExtensionsApi sessionApi +// Experimental: ExtensionsAPI contains experimental APIs that may change or be removed. +type ExtensionsAPI sessionAPI // Disables an extension for the session. // // RPC method: session.extensions.disable. // // Parameters: Source-qualified extension identifier to disable for the session. -func (a *ExtensionsApi) Disable(ctx context.Context, params *ExtensionsDisableRequest) (*SessionExtensionsDisableResult, error) { +func (a *ExtensionsAPI) Disable(ctx context.Context, params *ExtensionsDisableRequest) (*SessionExtensionsDisableResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["id"] = params.ID @@ -9720,7 +9720,7 @@ func (a *ExtensionsApi) Disable(ctx context.Context, params *ExtensionsDisableRe // RPC method: session.extensions.enable. // // Parameters: Source-qualified extension identifier to enable for the session. -func (a *ExtensionsApi) Enable(ctx context.Context, params *ExtensionsEnableRequest) (*SessionExtensionsEnableResult, error) { +func (a *ExtensionsAPI) Enable(ctx context.Context, params *ExtensionsEnableRequest) (*SessionExtensionsEnableResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["id"] = params.ID @@ -9741,7 +9741,7 @@ func (a *ExtensionsApi) Enable(ctx context.Context, params *ExtensionsEnableRequ // RPC method: session.extensions.list. // // Returns: Extensions discovered for the session, with their current status. -func (a *ExtensionsApi) List(ctx context.Context) (*ExtensionList, error) { +func (a *ExtensionsAPI) List(ctx context.Context) (*ExtensionList, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.extensions.list", req) if err != nil { @@ -9757,7 +9757,7 @@ func (a *ExtensionsApi) List(ctx context.Context) (*ExtensionList, error) { // Reloads extension definitions and processes for the session. // // RPC method: session.extensions.reload. -func (a *ExtensionsApi) Reload(ctx context.Context) (*SessionExtensionsReloadResult, error) { +func (a *ExtensionsAPI) Reload(ctx context.Context) (*SessionExtensionsReloadResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.extensions.reload", req) if err != nil { @@ -9777,7 +9777,7 @@ func (a *ExtensionsApi) Reload(ctx context.Context) (*SessionExtensionsReloadRes // RPC method: session.extensions.sendAttachmentsToMessage. // // Parameters: Parameters for session.extensions.sendAttachmentsToMessage. -func (a *ExtensionsApi) SendAttachmentsToMessage(ctx context.Context, params *SendAttachmentsToMessageParams) (*SessionExtensionsSendAttachmentsToMessageResult, error) { +func (a *ExtensionsAPI) SendAttachmentsToMessage(ctx context.Context, params *SendAttachmentsToMessageParams) (*SessionExtensionsSendAttachmentsToMessageResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["attachments"] = params.Attachments @@ -9796,8 +9796,8 @@ func (a *ExtensionsApi) SendAttachmentsToMessage(ctx context.Context, params *Se return &result, nil } -// Experimental: FleetApi contains experimental APIs that may change or be removed. -type FleetApi sessionApi +// Experimental: FleetAPI contains experimental APIs that may change or be removed. +type FleetAPI sessionAPI // Starts fleet mode by submitting the fleet orchestration prompt to the session. // @@ -9806,7 +9806,7 @@ type FleetApi sessionApi // Parameters: Optional user prompt to combine with the fleet orchestration instructions. // // Returns: Indicates whether fleet mode was successfully activated. -func (a *FleetApi) Start(ctx context.Context, params *FleetStartRequest) (*FleetStartResult, error) { +func (a *FleetAPI) Start(ctx context.Context, params *FleetStartRequest) (*FleetStartResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { if params.Prompt != nil { @@ -9824,15 +9824,15 @@ func (a *FleetApi) Start(ctx context.Context, params *FleetStartRequest) (*Fleet return &result, nil } -// Experimental: HistoryApi contains experimental APIs that may change or be removed. -type HistoryApi sessionApi +// Experimental: HistoryAPI contains experimental APIs that may change or be removed. +type HistoryAPI sessionAPI // AbortManualCompaction aborts any in-progress manual compaction on a local session. // // RPC method: session.history.abortManualCompaction. // // Returns: Indicates whether an in-progress manual compaction was aborted. -func (a *HistoryApi) AbortManualCompaction(ctx context.Context) (*HistoryAbortManualCompactionResult, error) { +func (a *HistoryAPI) AbortManualCompaction(ctx context.Context) (*HistoryAbortManualCompactionResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.history.abortManualCompaction", req) if err != nil { @@ -9851,7 +9851,7 @@ func (a *HistoryApi) AbortManualCompaction(ctx context.Context) (*HistoryAbortMa // RPC method: session.history.cancelBackgroundCompaction. // // Returns: Indicates whether an in-progress background compaction was cancelled. -func (a *HistoryApi) CancelBackgroundCompaction(ctx context.Context) (*HistoryCancelBackgroundCompactionResult, error) { +func (a *HistoryAPI) CancelBackgroundCompaction(ctx context.Context) (*HistoryCancelBackgroundCompactionResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.history.cancelBackgroundCompaction", req) if err != nil { @@ -9872,7 +9872,7 @@ func (a *HistoryApi) CancelBackgroundCompaction(ctx context.Context) (*HistoryCa // // Returns: Compaction outcome with the number of tokens and messages removed, summary text, // and the resulting context window breakdown. -func (a *HistoryApi) Compact(ctx context.Context, params ...*HistoryCompactRequest) (*HistoryCompactResult, error) { +func (a *HistoryAPI) Compact(ctx context.Context, params ...*HistoryCompactRequest) (*HistoryCompactResult, error) { var requestParams *HistoryCompactRequest if len(params) > 0 { requestParams = params[0] @@ -9900,7 +9900,7 @@ func (a *HistoryApi) Compact(ctx context.Context, params ...*HistoryCompactReque // RPC method: session.history.summarizeForHandoff. // // Returns: Markdown summary of the conversation context (empty when not available). -func (a *HistoryApi) SummarizeForHandoff(ctx context.Context) (*HistorySummarizeForHandoffResult, error) { +func (a *HistoryAPI) SummarizeForHandoff(ctx context.Context) (*HistorySummarizeForHandoffResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.history.summarizeForHandoff", req) if err != nil { @@ -9921,7 +9921,7 @@ func (a *HistoryApi) SummarizeForHandoff(ctx context.Context) (*HistorySummarize // removed. // // Returns: Number of events that were removed by the truncation. -func (a *HistoryApi) Truncate(ctx context.Context, params *HistoryTruncateRequest) (*HistoryTruncateResult, error) { +func (a *HistoryAPI) Truncate(ctx context.Context, params *HistoryTruncateRequest) (*HistoryTruncateResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["eventId"] = params.EventID @@ -9937,15 +9937,15 @@ func (a *HistoryApi) Truncate(ctx context.Context, params *HistoryTruncateReques return &result, nil } -// Experimental: InstructionsApi contains experimental APIs that may change or be removed. -type InstructionsApi sessionApi +// Experimental: InstructionsAPI contains experimental APIs that may change or be removed. +type InstructionsAPI sessionAPI // GetSources gets instruction sources loaded for the session. // // RPC method: session.instructions.getSources. // // Returns: Instruction sources loaded for the session, in merge order. -func (a *InstructionsApi) GetSources(ctx context.Context) (*InstructionsGetSourcesResult, error) { +func (a *InstructionsAPI) GetSources(ctx context.Context) (*InstructionsGetSourcesResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.instructions.getSources", req) if err != nil { @@ -9958,15 +9958,15 @@ func (a *InstructionsApi) GetSources(ctx context.Context) (*InstructionsGetSourc return &result, nil } -// Experimental: LspApi contains experimental APIs that may change or be removed. -type LspApi sessionApi +// Experimental: LspAPI contains experimental APIs that may change or be removed. +type LspAPI sessionAPI // Initialize loads the merged LSP configuration set for the session's working directory. // // RPC method: session.lsp.initialize. // // Parameters: Parameters for (re)loading the merged LSP configuration set. -func (a *LspApi) Initialize(ctx context.Context, params *LspInitializeRequest) (*SessionLspInitializeResult, error) { +func (a *LspAPI) Initialize(ctx context.Context, params *LspInitializeRequest) (*SessionLspInitializeResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { if params.Force != nil { @@ -9990,8 +9990,8 @@ func (a *LspApi) Initialize(ctx context.Context, params *LspInitializeRequest) ( return &result, nil } -// Experimental: McpApi contains experimental APIs that may change or be removed. -type McpApi sessionApi +// Experimental: MCPAPI contains experimental APIs that may change or be removed. +type MCPAPI sessionAPI // CancelSamplingExecution cancels an in-flight MCP sampling execution by request ID. // @@ -10001,7 +10001,7 @@ type McpApi sessionApi // // Returns: Indicates whether an in-flight sampling execution with the given requestId was // found and cancelled. -func (a *McpApi) CancelSamplingExecution(ctx context.Context, params *McpCancelSamplingExecutionParams) (*McpCancelSamplingExecutionResult, error) { +func (a *MCPAPI) CancelSamplingExecution(ctx context.Context, params *MCPCancelSamplingExecutionParams) (*MCPCancelSamplingExecutionResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["requestId"] = params.RequestID @@ -10010,7 +10010,7 @@ func (a *McpApi) CancelSamplingExecution(ctx context.Context, params *McpCancelS if err != nil { return nil, err } - var result McpCancelSamplingExecutionResult + var result MCPCancelSamplingExecutionResult if err := json.Unmarshal(raw, &result); err != nil { return nil, err } @@ -10022,7 +10022,7 @@ func (a *McpApi) CancelSamplingExecution(ctx context.Context, params *McpCancelS // RPC method: session.mcp.disable. // // Parameters: Name of the MCP server to disable for the session. -func (a *McpApi) Disable(ctx context.Context, params *McpDisableRequest) (*SessionMcpDisableResult, error) { +func (a *MCPAPI) Disable(ctx context.Context, params *MCPDisableRequest) (*SessionMCPDisableResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["serverName"] = params.ServerName @@ -10031,7 +10031,7 @@ func (a *McpApi) Disable(ctx context.Context, params *McpDisableRequest) (*Sessi if err != nil { return nil, err } - var result SessionMcpDisableResult + var result SessionMCPDisableResult if err := json.Unmarshal(raw, &result); err != nil { return nil, err } @@ -10043,7 +10043,7 @@ func (a *McpApi) Disable(ctx context.Context, params *McpDisableRequest) (*Sessi // RPC method: session.mcp.enable. // // Parameters: Name of the MCP server to enable for the session. -func (a *McpApi) Enable(ctx context.Context, params *McpEnableRequest) (*SessionMcpEnableResult, error) { +func (a *MCPAPI) Enable(ctx context.Context, params *MCPEnableRequest) (*SessionMCPEnableResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["serverName"] = params.ServerName @@ -10052,7 +10052,7 @@ func (a *McpApi) Enable(ctx context.Context, params *McpEnableRequest) (*Session if err != nil { return nil, err } - var result SessionMcpEnableResult + var result SessionMCPEnableResult if err := json.Unmarshal(raw, &result); err != nil { return nil, err } @@ -10068,10 +10068,10 @@ func (a *McpApi) Enable(ctx context.Context, params *McpEnableRequest) (*Session // // Returns: Outcome of an MCP sampling execution: success result, failure error, or // cancellation. -func (a *McpApi) ExecuteSampling(ctx context.Context, params *McpExecuteSamplingParams) (*McpSamplingExecutionResult, error) { +func (a *MCPAPI) ExecuteSampling(ctx context.Context, params *MCPExecuteSamplingParams) (*MCPSamplingExecutionResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { - req["mcpRequestId"] = params.McpRequestID + req["mcpRequestId"] = params.MCPRequestID req["request"] = params.Request req["requestId"] = params.RequestID req["serverName"] = params.ServerName @@ -10080,7 +10080,7 @@ func (a *McpApi) ExecuteSampling(ctx context.Context, params *McpExecuteSampling if err != nil { return nil, err } - var result McpSamplingExecutionResult + var result MCPSamplingExecutionResult if err := json.Unmarshal(raw, &result); err != nil { return nil, err } @@ -10092,13 +10092,13 @@ func (a *McpApi) ExecuteSampling(ctx context.Context, params *McpExecuteSampling // RPC method: session.mcp.list. // // Returns: MCP servers configured for the session, with their connection status. -func (a *McpApi) List(ctx context.Context) (*McpServerList, error) { +func (a *MCPAPI) List(ctx context.Context) (*MCPServerList, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.mcp.list", req) if err != nil { return nil, err } - var result McpServerList + var result MCPServerList if err := json.Unmarshal(raw, &result); err != nil { return nil, err } @@ -10108,13 +10108,13 @@ func (a *McpApi) List(ctx context.Context) (*McpServerList, error) { // Reloads MCP server connections for the session. // // RPC method: session.mcp.reload. -func (a *McpApi) Reload(ctx context.Context) (*SessionMcpReloadResult, error) { +func (a *MCPAPI) Reload(ctx context.Context) (*SessionMCPReloadResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.mcp.reload", req) if err != nil { return nil, err } - var result SessionMcpReloadResult + var result SessionMCPReloadResult if err := json.Unmarshal(raw, &result); err != nil { return nil, err } @@ -10127,13 +10127,13 @@ func (a *McpApi) Reload(ctx context.Context) (*SessionMcpReloadResult, error) { // // Returns: Indicates whether the auto-managed `github` MCP server was removed (false when // nothing to remove). -func (a *McpApi) RemoveGitHub(ctx context.Context) (*McpRemoveGitHubResult, error) { +func (a *MCPAPI) RemoveGitHub(ctx context.Context) (*MCPRemoveGitHubResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.mcp.removeGitHub", req) if err != nil { return nil, err } - var result McpRemoveGitHubResult + var result MCPRemoveGitHubResult if err := json.Unmarshal(raw, &result); err != nil { return nil, err } @@ -10149,7 +10149,7 @@ func (a *McpApi) RemoveGitHub(ctx context.Context) (*McpRemoveGitHubResult, erro // `indirect`). // // Returns: Env-value mode recorded on the session after the update. -func (a *McpApi) SetEnvValueMode(ctx context.Context, params *McpSetEnvValueModeParams) (*McpSetEnvValueModeResult, error) { +func (a *MCPAPI) SetEnvValueMode(ctx context.Context, params *MCPSetEnvValueModeParams) (*MCPSetEnvValueModeResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["mode"] = params.Mode @@ -10158,15 +10158,15 @@ func (a *McpApi) SetEnvValueMode(ctx context.Context, params *McpSetEnvValueMode if err != nil { return nil, err } - var result McpSetEnvValueModeResult + var result MCPSetEnvValueModeResult if err := json.Unmarshal(raw, &result); err != nil { return nil, err } return &result, nil } -// Experimental: McpAppsApi contains experimental APIs that may change or be removed. -type McpAppsApi sessionApi +// Experimental: MCPAppsAPI contains experimental APIs that may change or be removed. +type MCPAppsAPI sessionAPI // CallTool call an MCP tool from an MCP App view (SEP-1865). Enforces the visibility check // that prevents an app iframe from invoking model-only tools. Returns the standard MCP @@ -10177,7 +10177,7 @@ type McpAppsApi sessionApi // Parameters: MCP server, tool name, and arguments to invoke from an MCP App view. // // Returns: Standard MCP CallToolResult -func (a *McpAppsApi) CallTool(ctx context.Context, params *McpAppsCallToolRequest) (*SessionMcpAppsCallToolResult, error) { +func (a *MCPAppsAPI) CallTool(ctx context.Context, params *MCPAppsCallToolRequest) (*SessionMCPAppsCallToolResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { if params.Arguments != nil { @@ -10191,7 +10191,7 @@ func (a *McpAppsApi) CallTool(ctx context.Context, params *McpAppsCallToolReques if err != nil { return nil, err } - var result SessionMcpAppsCallToolResult + var result SessionMCPAppsCallToolResult if err := json.Unmarshal(raw, &result); err != nil { return nil, err } @@ -10206,7 +10206,7 @@ func (a *McpAppsApi) CallTool(ctx context.Context, params *McpAppsCallToolReques // Parameters: MCP server to diagnose MCP Apps wiring for. // // Returns: Diagnostic snapshot of MCP Apps wiring for the named server. -func (a *McpAppsApi) Diagnose(ctx context.Context, params *McpAppsDiagnoseRequest) (*McpAppsDiagnoseResult, error) { +func (a *MCPAppsAPI) Diagnose(ctx context.Context, params *MCPAppsDiagnoseRequest) (*MCPAppsDiagnoseResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["serverName"] = params.ServerName @@ -10215,7 +10215,7 @@ func (a *McpAppsApi) Diagnose(ctx context.Context, params *McpAppsDiagnoseReques if err != nil { return nil, err } - var result McpAppsDiagnoseResult + var result MCPAppsDiagnoseResult if err := json.Unmarshal(raw, &result); err != nil { return nil, err } @@ -10227,13 +10227,13 @@ func (a *McpAppsApi) Diagnose(ctx context.Context, params *McpAppsDiagnoseReques // RPC method: session.mcp.apps.getHostContext. // // Returns: Current host context advertised to MCP App guests. -func (a *McpAppsApi) GetHostContext(ctx context.Context) (*McpAppsHostContext, error) { +func (a *MCPAppsAPI) GetHostContext(ctx context.Context) (*MCPAppsHostContext, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.mcp.apps.getHostContext", req) if err != nil { return nil, err } - var result McpAppsHostContext + var result MCPAppsHostContext if err := json.Unmarshal(raw, &result); err != nil { return nil, err } @@ -10249,7 +10249,7 @@ func (a *McpAppsApi) GetHostContext(ctx context.Context) (*McpAppsHostContext, e // Parameters: MCP server to list app-callable tools for. // // Returns: App-callable tools from the named MCP server. -func (a *McpAppsApi) ListTools(ctx context.Context, params *McpAppsListToolsRequest) (*McpAppsListToolsResult, error) { +func (a *MCPAppsAPI) ListTools(ctx context.Context, params *MCPAppsListToolsRequest) (*MCPAppsListToolsResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["originServerName"] = params.OriginServerName @@ -10259,7 +10259,7 @@ func (a *McpAppsApi) ListTools(ctx context.Context, params *McpAppsListToolsRequ if err != nil { return nil, err } - var result McpAppsListToolsResult + var result MCPAppsListToolsResult if err := json.Unmarshal(raw, &result); err != nil { return nil, err } @@ -10274,7 +10274,7 @@ func (a *McpAppsApi) ListTools(ctx context.Context, params *McpAppsListToolsRequ // Parameters: MCP server and resource URI to fetch. // // Returns: Resource contents returned by the MCP server. -func (a *McpAppsApi) ReadResource(ctx context.Context, params *McpAppsReadResourceRequest) (*McpAppsReadResourceResult, error) { +func (a *MCPAppsAPI) ReadResource(ctx context.Context, params *MCPAppsReadResourceRequest) (*MCPAppsReadResourceResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["serverName"] = params.ServerName @@ -10284,7 +10284,7 @@ func (a *McpAppsApi) ReadResource(ctx context.Context, params *McpAppsReadResour if err != nil { return nil, err } - var result McpAppsReadResourceResult + var result MCPAppsReadResourceResult if err := json.Unmarshal(raw, &result); err != nil { return nil, err } @@ -10297,7 +10297,7 @@ func (a *McpAppsApi) ReadResource(ctx context.Context, params *McpAppsReadResour // RPC method: session.mcp.apps.setHostContext. // // Parameters: Host context to advertise to MCP App guests. -func (a *McpAppsApi) SetHostContext(ctx context.Context, params *McpAppsSetHostContextRequest) (*SessionMcpAppsSetHostContextResult, error) { +func (a *MCPAppsAPI) SetHostContext(ctx context.Context, params *MCPAppsSetHostContextRequest) (*SessionMCPAppsSetHostContextResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["context"] = params.Context @@ -10306,7 +10306,7 @@ func (a *McpAppsApi) SetHostContext(ctx context.Context, params *McpAppsSetHostC if err != nil { return nil, err } - var result SessionMcpAppsSetHostContextResult + var result SessionMCPAppsSetHostContextResult if err := json.Unmarshal(raw, &result); err != nil { return nil, err } @@ -10314,12 +10314,12 @@ func (a *McpAppsApi) SetHostContext(ctx context.Context, params *McpAppsSetHostC } // Experimental: Apps returns experimental APIs that may change or be removed. -func (s *McpApi) Apps() *McpAppsApi { - return (*McpAppsApi)(s) +func (s *MCPAPI) Apps() *MCPAppsAPI { + return (*MCPAppsAPI)(s) } -// Experimental: McpOauthApi contains experimental APIs that may change or be removed. -type McpOauthApi sessionApi +// Experimental: MCPOauthAPI contains experimental APIs that may change or be removed. +type MCPOauthAPI sessionAPI // Login starts OAuth authentication for a remote MCP server. // @@ -10330,7 +10330,7 @@ type McpOauthApi sessionApi // // Returns: OAuth authorization URL the caller should open, or empty when cached tokens // already authenticated the server. -func (a *McpOauthApi) Login(ctx context.Context, params *McpOauthLoginRequest) (*McpOauthLoginResult, error) { +func (a *MCPOauthAPI) Login(ctx context.Context, params *MCPOauthLoginRequest) (*MCPOauthLoginResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { if params.CallbackSuccessMessage != nil { @@ -10348,7 +10348,7 @@ func (a *McpOauthApi) Login(ctx context.Context, params *McpOauthLoginRequest) ( if err != nil { return nil, err } - var result McpOauthLoginResult + var result MCPOauthLoginResult if err := json.Unmarshal(raw, &result); err != nil { return nil, err } @@ -10356,12 +10356,12 @@ func (a *McpOauthApi) Login(ctx context.Context, params *McpOauthLoginRequest) ( } // Experimental: Oauth returns experimental APIs that may change or be removed. -func (s *McpApi) Oauth() *McpOauthApi { - return (*McpOauthApi)(s) +func (s *MCPAPI) Oauth() *MCPOauthAPI { + return (*MCPOauthAPI)(s) } -// Experimental: MetadataApi contains experimental APIs that may change or be removed. -type MetadataApi sessionApi +// Experimental: MetadataAPI contains experimental APIs that may change or be removed. +type MetadataAPI sessionAPI // ContextInfo returns the token breakdown for the session's current context window for a // given model. @@ -10372,7 +10372,7 @@ type MetadataApi sessionApi // // Returns: Token breakdown for the session's current context window, or null if // uninitialized. -func (a *MetadataApi) ContextInfo(ctx context.Context, params *MetadataContextInfoRequest) (*MetadataContextInfoResult, error) { +func (a *MetadataAPI) ContextInfo(ctx context.Context, params *MetadataContextInfoRequest) (*MetadataContextInfoResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["outputTokenLimit"] = params.OutputTokenLimit @@ -10399,7 +10399,7 @@ func (a *MetadataApi) ContextInfo(ctx context.Context, params *MetadataContextIn // // Returns: Indicates whether the local session is currently processing a turn or background // continuation. -func (a *MetadataApi) IsProcessing(ctx context.Context) (*MetadataIsProcessingResult, error) { +func (a *MetadataAPI) IsProcessing(ctx context.Context) (*MetadataIsProcessingResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.metadata.isProcessing", req) if err != nil { @@ -10423,7 +10423,7 @@ func (a *MetadataApi) IsProcessing(ctx context.Context) (*MetadataIsProcessingRe // token totals. Useful for hosts that want an initial estimate of context usage on session // resume, before the next agent turn fires `session.context_info_changed` events. Returns // zeros for an empty session. -func (a *MetadataApi) RecomputeContextTokens(ctx context.Context, params *MetadataRecomputeContextTokensRequest) (*MetadataRecomputeContextTokensResult, error) { +func (a *MetadataAPI) RecomputeContextTokens(ctx context.Context, params *MetadataRecomputeContextTokensRequest) (*MetadataRecomputeContextTokensResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["modelId"] = params.ModelID @@ -10450,7 +10450,7 @@ func (a *MetadataApi) RecomputeContextTokens(ctx context.Context, params *Metada // `session.context_changed` event so consumers (telemetry, OTel tracker, ACP, the timeline // UI) can react. Use this when the host has detected a cwd/branch/repo change outside the // session's normal lifecycle (e.g., after a shell command in interactive mode). -func (a *MetadataApi) RecordContextChange(ctx context.Context, params *MetadataRecordContextChangeRequest) (*MetadataRecordContextChangeResult, error) { +func (a *MetadataAPI) RecordContextChange(ctx context.Context, params *MetadataRecordContextChangeRequest) (*MetadataRecordContextChangeResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["context"] = params.Context @@ -10476,7 +10476,7 @@ func (a *MetadataApi) RecordContextChange(ctx context.Context, params *MetadataR // explicitly changes cwd (e.g., the `/cd` slash command). The host is responsible for // `process.chdir` and any related side-effects (file index, etc.); this method only updates // the session's own recorded path. -func (a *MetadataApi) SetWorkingDirectory(ctx context.Context, params *MetadataSetWorkingDirectoryRequest) (*MetadataSetWorkingDirectoryResult, error) { +func (a *MetadataAPI) SetWorkingDirectory(ctx context.Context, params *MetadataSetWorkingDirectoryRequest) (*MetadataSetWorkingDirectoryResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["workingDirectory"] = params.WorkingDirectory @@ -10498,7 +10498,7 @@ func (a *MetadataApi) SetWorkingDirectory(ctx context.Context, params *MetadataS // RPC method: session.metadata.snapshot. // // Returns: Point-in-time snapshot of slow-changing session identifier and state fields -func (a *MetadataApi) Snapshot(ctx context.Context) (*SessionMetadataSnapshot, error) { +func (a *MetadataAPI) Snapshot(ctx context.Context) (*SessionMetadataSnapshot, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.metadata.snapshot", req) if err != nil { @@ -10511,15 +10511,15 @@ func (a *MetadataApi) Snapshot(ctx context.Context) (*SessionMetadataSnapshot, e return &result, nil } -// Experimental: ModeApi contains experimental APIs that may change or be removed. -type ModeApi sessionApi +// Experimental: ModeAPI contains experimental APIs that may change or be removed. +type ModeAPI sessionAPI // Gets the current agent interaction mode. // // RPC method: session.mode.get. // // Returns: The session mode the agent is operating in -func (a *ModeApi) Get(ctx context.Context) (*SessionMode, error) { +func (a *ModeAPI) Get(ctx context.Context) (*SessionMode, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.mode.get", req) if err != nil { @@ -10537,7 +10537,7 @@ func (a *ModeApi) Get(ctx context.Context) (*SessionMode, error) { // RPC method: session.mode.set. // // Parameters: Agent interaction mode to apply to the session. -func (a *ModeApi) Set(ctx context.Context, params *ModeSetRequest) (*SessionModeSetResult, error) { +func (a *ModeAPI) Set(ctx context.Context, params *ModeSetRequest) (*SessionModeSetResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["mode"] = params.Mode @@ -10553,8 +10553,8 @@ func (a *ModeApi) Set(ctx context.Context, params *ModeSetRequest) (*SessionMode return &result, nil } -// Experimental: ModelApi contains experimental APIs that may change or be removed. -type ModelApi sessionApi +// Experimental: ModelAPI contains experimental APIs that may change or be removed. +type ModelAPI sessionAPI // GetCurrent gets the currently selected model for the session. // @@ -10563,7 +10563,7 @@ type ModelApi sessionApi // Returns: The currently selected model, reasoning effort, and context tier for the // session. The context tier reflects `Session.getContextTier()`, restored from the session // journal on resume. -func (a *ModelApi) GetCurrent(ctx context.Context) (*CurrentModel, error) { +func (a *ModelAPI) GetCurrent(ctx context.Context) (*CurrentModel, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.model.getCurrent", req) if err != nil { @@ -10585,7 +10585,7 @@ func (a *ModelApi) GetCurrent(ctx context.Context) (*CurrentModel, error) { // Parameters: Optional listing options. // // Returns: The list of models available to this session. -func (a *ModelApi) List(ctx context.Context, params ...*ModelListRequest) (*SessionModelList, error) { +func (a *ModelAPI) List(ctx context.Context, params ...*ModelListRequest) (*SessionModelList, error) { var requestParams *ModelListRequest if len(params) > 0 { requestParams = params[0] @@ -10617,7 +10617,7 @@ func (a *ModelApi) List(ctx context.Context, params ...*ModelListRequest) (*Sess // Returns: Update the session's reasoning effort without changing the selected model. Use // `switchTo` instead when you also need to change the model. The runtime stores the effort // on the session and applies it to subsequent turns. -func (a *ModelApi) SetReasoningEffort(ctx context.Context, params *ModelSetReasoningEffortRequest) (*ModelSetReasoningEffortResult, error) { +func (a *ModelAPI) SetReasoningEffort(ctx context.Context, params *ModelSetReasoningEffortRequest) (*ModelSetReasoningEffortResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["reasoningEffort"] = params.ReasoningEffort @@ -10641,7 +10641,7 @@ func (a *ModelApi) SetReasoningEffort(ctx context.Context, params *ModelSetReaso // overrides, and context tier. // // Returns: The model identifier active on the session after the switch. -func (a *ModelApi) SwitchTo(ctx context.Context, params *ModelSwitchToRequest) (*ModelSwitchToResult, error) { +func (a *ModelAPI) SwitchTo(ctx context.Context, params *ModelSwitchToRequest) (*ModelSwitchToResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { if params.ContextTier != nil { @@ -10669,15 +10669,15 @@ func (a *ModelApi) SwitchTo(ctx context.Context, params *ModelSwitchToRequest) ( return &result, nil } -// Experimental: NameApi contains experimental APIs that may change or be removed. -type NameApi sessionApi +// Experimental: NameAPI contains experimental APIs that may change or be removed. +type NameAPI sessionAPI // Gets the session's friendly name. // // RPC method: session.name.get. // // Returns: The session's friendly name, or null when not yet set. -func (a *NameApi) Get(ctx context.Context) (*NameGetResult, error) { +func (a *NameAPI) Get(ctx context.Context) (*NameGetResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.name.get", req) if err != nil { @@ -10695,7 +10695,7 @@ func (a *NameApi) Get(ctx context.Context) (*NameGetResult, error) { // RPC method: session.name.set. // // Parameters: New friendly name to apply to the session. -func (a *NameApi) Set(ctx context.Context, params *NameSetRequest) (*SessionNameSetResult, error) { +func (a *NameAPI) Set(ctx context.Context, params *NameSetRequest) (*SessionNameSetResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["name"] = params.Name @@ -10720,7 +10720,7 @@ func (a *NameApi) Set(ctx context.Context, params *NameSetRequest) (*SessionName // user-set name exists. // // Returns: Indicates whether the auto-generated summary was applied as the session's name. -func (a *NameApi) SetAuto(ctx context.Context, params *NameSetAutoRequest) (*NameSetAutoResult, error) { +func (a *NameAPI) SetAuto(ctx context.Context, params *NameSetAutoRequest) (*NameSetAutoResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["summary"] = params.Summary @@ -10736,8 +10736,8 @@ func (a *NameApi) SetAuto(ctx context.Context, params *NameSetAutoRequest) (*Nam return &result, nil } -// Experimental: OptionsApi contains experimental APIs that may change or be removed. -type OptionsApi sessionApi +// Experimental: OptionsAPI contains experimental APIs that may change or be removed. +type OptionsAPI sessionAPI // Update patches the genuinely-mutable subset of session options. // @@ -10746,7 +10746,7 @@ type OptionsApi sessionApi // Parameters: Patch of mutable session options to apply to the running session. // // Returns: Indicates whether the session options patch was applied successfully. -func (a *OptionsApi) Update(ctx context.Context, params *SessionUpdateOptionsParams) (*SessionUpdateOptionsResult, error) { +func (a *OptionsAPI) Update(ctx context.Context, params *SessionUpdateOptionsParams) (*SessionUpdateOptionsResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { if params.AdditionalContentExclusionPolicies != nil { @@ -10890,8 +10890,8 @@ func (a *OptionsApi) Update(ctx context.Context, params *SessionUpdateOptionsPar return &result, nil } -// Experimental: PermissionsApi contains experimental APIs that may change or be removed. -type PermissionsApi sessionApi +// Experimental: PermissionsAPI contains experimental APIs that may change or be removed. +type PermissionsAPI sessionAPI // Configure replaces selected permission policy fields (rules, paths, URLs, exclusions, // allow-all flags) on the session. @@ -10902,7 +10902,7 @@ type PermissionsApi sessionApi // unchanged). // // Returns: Indicates whether the operation succeeded. -func (a *PermissionsApi) Configure(ctx context.Context, params *PermissionsConfigureParams) (*PermissionsConfigureResult, error) { +func (a *PermissionsAPI) Configure(ctx context.Context, params *PermissionsConfigureParams) (*PermissionsConfigureResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { if params.AdditionalContentExclusionPolicies != nil { @@ -10920,8 +10920,8 @@ func (a *PermissionsApi) Configure(ctx context.Context, params *PermissionsConfi if params.Rules != nil { req["rules"] = *params.Rules } - if params.Urls != nil { - req["urls"] = *params.Urls + if params.URLs != nil { + req["urls"] = *params.URLs } } raw, err := a.client.Request("session.permissions.configure", req) @@ -10941,7 +10941,7 @@ func (a *PermissionsApi) Configure(ctx context.Context, params *PermissionsConfi // RPC method: session.permissions.getAllowAll. // // Returns: Current full allow-all permission state. -func (a *PermissionsApi) GetAllowAll(ctx context.Context) (*AllowAllPermissionState, error) { +func (a *PermissionsAPI) GetAllowAll(ctx context.Context) (*AllowAllPermissionState, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.permissions.getAllowAll", req) if err != nil { @@ -10963,7 +10963,7 @@ func (a *PermissionsApi) GetAllowAll(ctx context.Context) (*AllowAllPermissionSt // // Returns: Indicates whether the permission decision was applied; false when the request // was already resolved. -func (a *PermissionsApi) HandlePendingPermissionRequest(ctx context.Context, params *PermissionDecisionRequest) (*PermissionRequestResult, error) { +func (a *PermissionsAPI) HandlePendingPermissionRequest(ctx context.Context, params *PermissionDecisionRequest) (*PermissionRequestResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["requestId"] = params.RequestID @@ -10988,7 +10988,7 @@ func (a *PermissionsApi) HandlePendingPermissionRequest(ctx context.Context, par // permission rules. // // Returns: Indicates whether the operation succeeded. -func (a *PermissionsApi) ModifyRules(ctx context.Context, params *PermissionsModifyRulesParams) (*PermissionsModifyRulesResult, error) { +func (a *PermissionsAPI) ModifyRules(ctx context.Context, params *PermissionsModifyRulesParams) (*PermissionsModifyRulesResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { if params.Add != nil { @@ -11022,7 +11022,7 @@ func (a *PermissionsApi) ModifyRules(ctx context.Context, params *PermissionsMod // rendered. // // Returns: Indicates whether the operation succeeded. -func (a *PermissionsApi) NotifyPromptShown(ctx context.Context, params *PermissionPromptShownNotification) (*PermissionsNotifyPromptShownResult, error) { +func (a *PermissionsAPI) NotifyPromptShown(ctx context.Context, params *PermissionPromptShownNotification) (*PermissionsNotifyPromptShownResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["message"] = params.Message @@ -11044,7 +11044,7 @@ func (a *PermissionsApi) NotifyPromptShown(ctx context.Context, params *Permissi // RPC method: session.permissions.pendingRequests. // // Returns: List of pending permission requests reconstructed from event history. -func (a *PermissionsApi) PendingRequests(ctx context.Context) (*PendingPermissionRequestList, error) { +func (a *PermissionsAPI) PendingRequests(ctx context.Context) (*PendingPermissionRequestList, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.permissions.pendingRequests", req) if err != nil { @@ -11062,7 +11062,7 @@ func (a *PermissionsApi) PendingRequests(ctx context.Context) (*PendingPermissio // RPC method: session.permissions.resetSessionApprovals. // // Returns: Indicates whether the operation succeeded. -func (a *PermissionsApi) ResetSessionApprovals(ctx context.Context) (*PermissionsResetSessionApprovalsResult, error) { +func (a *PermissionsAPI) ResetSessionApprovals(ctx context.Context) (*PermissionsResetSessionApprovalsResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.permissions.resetSessionApprovals", req) if err != nil { @@ -11088,7 +11088,7 @@ func (a *PermissionsApi) ResetSessionApprovals(ctx context.Context) (*Permission // Parameters: Whether to enable full allow-all permissions for the session. // // Returns: Indicates whether the operation succeeded and reports the post-mutation state. -func (a *PermissionsApi) SetAllowAll(ctx context.Context, params *PermissionsSetAllowAllRequest) (*AllowAllPermissionSetResult, error) { +func (a *PermissionsAPI) SetAllowAll(ctx context.Context, params *PermissionsSetAllowAllRequest) (*AllowAllPermissionSetResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["enabled"] = params.Enabled @@ -11116,7 +11116,7 @@ func (a *PermissionsApi) SetAllowAll(ctx context.Context, params *PermissionsSet // source. // // Returns: Indicates whether the operation succeeded. -func (a *PermissionsApi) SetApproveAll(ctx context.Context, params *PermissionsSetApproveAllRequest) (*PermissionsSetApproveAllResult, error) { +func (a *PermissionsAPI) SetApproveAll(ctx context.Context, params *PermissionsSetApproveAllRequest) (*PermissionsSetApproveAllResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["enabled"] = params.Enabled @@ -11143,7 +11143,7 @@ func (a *PermissionsApi) SetApproveAll(ctx context.Context, params *PermissionsS // this client. // // Returns: Indicates whether the operation succeeded. -func (a *PermissionsApi) SetRequired(ctx context.Context, params *PermissionsSetRequiredRequest) (*PermissionsSetRequiredResult, error) { +func (a *PermissionsAPI) SetRequired(ctx context.Context, params *PermissionsSetRequiredRequest) (*PermissionsSetRequiredResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["required"] = params.Required @@ -11159,9 +11159,9 @@ func (a *PermissionsApi) SetRequired(ctx context.Context, params *PermissionsSet return &result, nil } -// Experimental: PermissionsFolderTrustApi contains experimental APIs that may change or be +// Experimental: PermissionsFolderTrustAPI contains experimental APIs that may change or be // removed. -type PermissionsFolderTrustApi sessionApi +type PermissionsFolderTrustAPI sessionAPI // AddTrusted adds a folder to the user's trusted folders list. // @@ -11170,7 +11170,7 @@ type PermissionsFolderTrustApi sessionApi // Parameters: Folder path to add to trusted folders. // // Returns: Indicates whether the operation succeeded. -func (a *PermissionsFolderTrustApi) AddTrusted(ctx context.Context, params *FolderTrustAddParams) (*PermissionsFolderTrustAddTrustedResult, error) { +func (a *PermissionsFolderTrustAPI) AddTrusted(ctx context.Context, params *FolderTrustAddParams) (*PermissionsFolderTrustAddTrustedResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["path"] = params.Path @@ -11193,7 +11193,7 @@ func (a *PermissionsFolderTrustApi) AddTrusted(ctx context.Context, params *Fold // Parameters: Folder path to check for trust. // // Returns: Folder trust check result. -func (a *PermissionsFolderTrustApi) IsTrusted(ctx context.Context, params *FolderTrustCheckParams) (*FolderTrustCheckResult, error) { +func (a *PermissionsFolderTrustAPI) IsTrusted(ctx context.Context, params *FolderTrustCheckParams) (*FolderTrustCheckResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["path"] = params.Path @@ -11210,13 +11210,13 @@ func (a *PermissionsFolderTrustApi) IsTrusted(ctx context.Context, params *Folde } // Experimental: FolderTrust returns experimental APIs that may change or be removed. -func (s *PermissionsApi) FolderTrust() *PermissionsFolderTrustApi { - return (*PermissionsFolderTrustApi)(s) +func (s *PermissionsAPI) FolderTrust() *PermissionsFolderTrustAPI { + return (*PermissionsFolderTrustAPI)(s) } -// Experimental: PermissionsLocationsApi contains experimental APIs that may change or be +// Experimental: PermissionsLocationsAPI contains experimental APIs that may change or be // removed. -type PermissionsLocationsApi sessionApi +type PermissionsLocationsAPI sessionAPI // AddToolApproval persists a tool approval for a permission location and applies its rules // to this session's live permission service. @@ -11226,7 +11226,7 @@ type PermissionsLocationsApi sessionApi // Parameters: Location-scoped tool approval to persist. // // Returns: Indicates whether the operation succeeded. -func (a *PermissionsLocationsApi) AddToolApproval(ctx context.Context, params *PermissionLocationAddToolApprovalParams) (*PermissionsLocationsAddToolApprovalResult, error) { +func (a *PermissionsLocationsAPI) AddToolApproval(ctx context.Context, params *PermissionLocationAddToolApprovalParams) (*PermissionsLocationsAddToolApprovalResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["approval"] = params.Approval @@ -11251,7 +11251,7 @@ func (a *PermissionsLocationsApi) AddToolApproval(ctx context.Context, params *P // Parameters: Working directory to load persisted location permissions for. // // Returns: Summary of persisted location permissions applied to the session. -func (a *PermissionsLocationsApi) Apply(ctx context.Context, params *PermissionLocationApplyParams) (*PermissionLocationApplyResult, error) { +func (a *PermissionsLocationsAPI) Apply(ctx context.Context, params *PermissionLocationApplyParams) (*PermissionLocationApplyResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["workingDirectory"] = params.WorkingDirectory @@ -11274,7 +11274,7 @@ func (a *PermissionsLocationsApi) Apply(ctx context.Context, params *PermissionL // Parameters: Working directory to resolve into a location-permissions key. // // Returns: Resolved location-permissions key and type. -func (a *PermissionsLocationsApi) Resolve(ctx context.Context, params *PermissionLocationResolveParams) (*PermissionLocationResolveResult, error) { +func (a *PermissionsLocationsAPI) Resolve(ctx context.Context, params *PermissionLocationResolveParams) (*PermissionLocationResolveResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["workingDirectory"] = params.WorkingDirectory @@ -11291,13 +11291,13 @@ func (a *PermissionsLocationsApi) Resolve(ctx context.Context, params *Permissio } // Experimental: Locations returns experimental APIs that may change or be removed. -func (s *PermissionsApi) Locations() *PermissionsLocationsApi { - return (*PermissionsLocationsApi)(s) +func (s *PermissionsAPI) Locations() *PermissionsLocationsAPI { + return (*PermissionsLocationsAPI)(s) } -// Experimental: PermissionsPathsApi contains experimental APIs that may change or be +// Experimental: PermissionsPathsAPI contains experimental APIs that may change or be // removed. -type PermissionsPathsApi sessionApi +type PermissionsPathsAPI sessionAPI // Adds a directory to the session's allow-list. // @@ -11306,7 +11306,7 @@ type PermissionsPathsApi sessionApi // Parameters: Directory path to add to the session's allowed directories. // // Returns: Indicates whether the operation succeeded. -func (a *PermissionsPathsApi) Add(ctx context.Context, params *PermissionPathsAddParams) (*PermissionsPathsAddResult, error) { +func (a *PermissionsPathsAPI) Add(ctx context.Context, params *PermissionPathsAddParams) (*PermissionsPathsAddResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["path"] = params.Path @@ -11330,7 +11330,7 @@ func (a *PermissionsPathsApi) Add(ctx context.Context, params *PermissionPathsAd // Parameters: Path to evaluate against the session's allowed directories. // // Returns: Indicates whether the supplied path is within the session's allowed directories. -func (a *PermissionsPathsApi) IsPathWithinAllowedDirectories(ctx context.Context, params *PermissionPathsAllowedCheckParams) (*PermissionPathsAllowedCheckResult, error) { +func (a *PermissionsPathsAPI) IsPathWithinAllowedDirectories(ctx context.Context, params *PermissionPathsAllowedCheckParams) (*PermissionPathsAllowedCheckResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["path"] = params.Path @@ -11354,7 +11354,7 @@ func (a *PermissionsPathsApi) IsPathWithinAllowedDirectories(ctx context.Context // Parameters: Path to evaluate against the session's workspace (primary) directory. // // Returns: Indicates whether the supplied path is within the session's workspace directory. -func (a *PermissionsPathsApi) IsPathWithinWorkspace(ctx context.Context, params *PermissionPathsWorkspaceCheckParams) (*PermissionPathsWorkspaceCheckResult, error) { +func (a *PermissionsPathsAPI) IsPathWithinWorkspace(ctx context.Context, params *PermissionPathsWorkspaceCheckParams) (*PermissionPathsWorkspaceCheckResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["path"] = params.Path @@ -11375,7 +11375,7 @@ func (a *PermissionsPathsApi) IsPathWithinWorkspace(ctx context.Context, params // RPC method: session.permissions.paths.list. // // Returns: Snapshot of the session's allow-listed directories and primary working directory. -func (a *PermissionsPathsApi) List(ctx context.Context) (*PermissionPathsList, error) { +func (a *PermissionsPathsAPI) List(ctx context.Context) (*PermissionPathsList, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.permissions.paths.list", req) if err != nil { @@ -11396,7 +11396,7 @@ func (a *PermissionsPathsApi) List(ctx context.Context) (*PermissionPathsList, e // Parameters: Directory path to set as the session's new primary working directory. // // Returns: Indicates whether the operation succeeded. -func (a *PermissionsPathsApi) UpdatePrimary(ctx context.Context, params *PermissionPathsUpdatePrimaryParams) (*PermissionsPathsUpdatePrimaryResult, error) { +func (a *PermissionsPathsAPI) UpdatePrimary(ctx context.Context, params *PermissionPathsUpdatePrimaryParams) (*PermissionsPathsUpdatePrimaryResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["path"] = params.Path @@ -11413,12 +11413,12 @@ func (a *PermissionsPathsApi) UpdatePrimary(ctx context.Context, params *Permiss } // Experimental: Paths returns experimental APIs that may change or be removed. -func (s *PermissionsApi) Paths() *PermissionsPathsApi { - return (*PermissionsPathsApi)(s) +func (s *PermissionsAPI) Paths() *PermissionsPathsAPI { + return (*PermissionsPathsAPI)(s) } -// Experimental: PermissionsUrlsApi contains experimental APIs that may change or be removed. -type PermissionsUrlsApi sessionApi +// Experimental: PermissionsURLsAPI contains experimental APIs that may change or be removed. +type PermissionsURLsAPI sessionAPI // SetUnrestrictedMode toggles the runtime's URL-permission policy between unrestricted and // restricted modes. @@ -11428,7 +11428,7 @@ type PermissionsUrlsApi sessionApi // Parameters: Whether the URL-permission policy should run in unrestricted mode. // // Returns: Indicates whether the operation succeeded. -func (a *PermissionsUrlsApi) SetUnrestrictedMode(ctx context.Context, params *PermissionUrlsSetUnrestrictedModeParams) (*PermissionsUrlsSetUnrestrictedModeResult, error) { +func (a *PermissionsURLsAPI) SetUnrestrictedMode(ctx context.Context, params *PermissionURLsSetUnrestrictedModeParams) (*PermissionsURLsSetUnrestrictedModeResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["enabled"] = params.Enabled @@ -11437,25 +11437,25 @@ func (a *PermissionsUrlsApi) SetUnrestrictedMode(ctx context.Context, params *Pe if err != nil { return nil, err } - var result PermissionsUrlsSetUnrestrictedModeResult + var result PermissionsURLsSetUnrestrictedModeResult if err := json.Unmarshal(raw, &result); err != nil { return nil, err } return &result, nil } -// Experimental: Urls returns experimental APIs that may change or be removed. -func (s *PermissionsApi) Urls() *PermissionsUrlsApi { - return (*PermissionsUrlsApi)(s) +// Experimental: URLs returns experimental APIs that may change or be removed. +func (s *PermissionsAPI) URLs() *PermissionsURLsAPI { + return (*PermissionsURLsAPI)(s) } -// Experimental: PlanApi contains experimental APIs that may change or be removed. -type PlanApi sessionApi +// Experimental: PlanAPI contains experimental APIs that may change or be removed. +type PlanAPI sessionAPI // Deletes the session plan file from the workspace. // // RPC method: session.plan.delete. -func (a *PlanApi) Delete(ctx context.Context) (*SessionPlanDeleteResult, error) { +func (a *PlanAPI) Delete(ctx context.Context) (*SessionPlanDeleteResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.plan.delete", req) if err != nil { @@ -11473,7 +11473,7 @@ func (a *PlanApi) Delete(ctx context.Context) (*SessionPlanDeleteResult, error) // RPC method: session.plan.read. // // Returns: Existence, contents, and resolved path of the session plan file. -func (a *PlanApi) Read(ctx context.Context) (*PlanReadResult, error) { +func (a *PlanAPI) Read(ctx context.Context) (*PlanReadResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.plan.read", req) if err != nil { @@ -11491,7 +11491,7 @@ func (a *PlanApi) Read(ctx context.Context) (*PlanReadResult, error) { // RPC method: session.plan.update. // // Parameters: Replacement contents to write to the session plan file. -func (a *PlanApi) Update(ctx context.Context, params *PlanUpdateRequest) (*SessionPlanUpdateResult, error) { +func (a *PlanAPI) Update(ctx context.Context, params *PlanUpdateRequest) (*SessionPlanUpdateResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["content"] = params.Content @@ -11507,15 +11507,15 @@ func (a *PlanApi) Update(ctx context.Context, params *PlanUpdateRequest) (*Sessi return &result, nil } -// Experimental: PluginsApi contains experimental APIs that may change or be removed. -type PluginsApi sessionApi +// Experimental: PluginsAPI contains experimental APIs that may change or be removed. +type PluginsAPI sessionAPI // Lists plugins installed for the session. // // RPC method: session.plugins.list. // // Returns: Plugins installed for the session, with their enabled state and version metadata. -func (a *PluginsApi) List(ctx context.Context) (*PluginList, error) { +func (a *PluginsAPI) List(ctx context.Context) (*PluginList, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.plugins.list", req) if err != nil { @@ -11528,13 +11528,13 @@ func (a *PluginsApi) List(ctx context.Context) (*PluginList, error) { return &result, nil } -// Experimental: QueueApi contains experimental APIs that may change or be removed. -type QueueApi sessionApi +// Experimental: QueueAPI contains experimental APIs that may change or be removed. +type QueueAPI sessionAPI // Clears all pending queued items on the local session. // // RPC method: session.queue.clear. -func (a *QueueApi) Clear(ctx context.Context) (*SessionQueueClearResult, error) { +func (a *QueueAPI) Clear(ctx context.Context) (*SessionQueueClearResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.queue.clear", req) if err != nil { @@ -11553,7 +11553,7 @@ func (a *QueueApi) Clear(ctx context.Context) (*SessionQueueClearResult, error) // RPC method: session.queue.pendingItems. // // Returns: Snapshot of the session's pending queued items and immediate-steering messages. -func (a *QueueApi) PendingItems(ctx context.Context) (*QueuePendingItemsResult, error) { +func (a *QueueAPI) PendingItems(ctx context.Context) (*QueuePendingItemsResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.queue.pendingItems", req) if err != nil { @@ -11571,7 +11571,7 @@ func (a *QueueApi) PendingItems(ctx context.Context) (*QueuePendingItemsResult, // RPC method: session.queue.removeMostRecent. // // Returns: Indicates whether a user-facing pending item was removed. -func (a *QueueApi) RemoveMostRecent(ctx context.Context) (*QueueRemoveMostRecentResult, error) { +func (a *QueueAPI) RemoveMostRecent(ctx context.Context) (*QueueRemoveMostRecentResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.queue.removeMostRecent", req) if err != nil { @@ -11584,13 +11584,13 @@ func (a *QueueApi) RemoveMostRecent(ctx context.Context) (*QueueRemoveMostRecent return &result, nil } -// Experimental: RemoteApi contains experimental APIs that may change or be removed. -type RemoteApi sessionApi +// Experimental: RemoteAPI contains experimental APIs that may change or be removed. +type RemoteAPI sessionAPI // Disables remote session export and steering. // // RPC method: session.remote.disable. -func (a *RemoteApi) Disable(ctx context.Context) (*SessionRemoteDisableResult, error) { +func (a *RemoteAPI) Disable(ctx context.Context) (*SessionRemoteDisableResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.remote.disable", req) if err != nil { @@ -11612,7 +11612,7 @@ func (a *RemoteApi) Disable(ctx context.Context) (*SessionRemoteDisableResult, e // // Returns: GitHub URL for the session and a flag indicating whether remote steering is // enabled. -func (a *RemoteApi) Enable(ctx context.Context, params *RemoteEnableRequest) (*RemoteEnableResult, error) { +func (a *RemoteAPI) Enable(ctx context.Context, params *RemoteEnableRequest) (*RemoteEnableResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { if params.Mode != nil { @@ -11641,7 +11641,7 @@ func (a *RemoteApi) Enable(ctx context.Context, params *RemoteEnableRequest) (*R // Returns: Persist a steerability change as a `session.remote_steerable_changed` event. // Used by the host (CLI / SDK consumer) when it has just finished enabling or disabling // steering on a remote exporter that the runtime does not directly own. -func (a *RemoteApi) NotifySteerableChanged(ctx context.Context, params *RemoteNotifySteerableChangedRequest) (*RemoteNotifySteerableChangedResult, error) { +func (a *RemoteAPI) NotifySteerableChanged(ctx context.Context, params *RemoteNotifySteerableChangedRequest) (*RemoteNotifySteerableChangedResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["remoteSteerable"] = params.RemoteSteerable @@ -11657,15 +11657,15 @@ func (a *RemoteApi) NotifySteerableChanged(ctx context.Context, params *RemoteNo return &result, nil } -// Experimental: ScheduleApi contains experimental APIs that may change or be removed. -type ScheduleApi sessionApi +// Experimental: ScheduleAPI contains experimental APIs that may change or be removed. +type ScheduleAPI sessionAPI // Lists the session's currently active scheduled prompts. // // RPC method: session.schedule.list. // // Returns: Snapshot of the currently active recurring prompts for this session. -func (a *ScheduleApi) List(ctx context.Context) (*ScheduleList, error) { +func (a *ScheduleAPI) List(ctx context.Context) (*ScheduleList, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.schedule.list", req) if err != nil { @@ -11686,7 +11686,7 @@ func (a *ScheduleApi) List(ctx context.Context) (*ScheduleList, error) { // // Returns: Remove a scheduled prompt by id. The result entry is omitted if the id was // unknown. -func (a *ScheduleApi) Stop(ctx context.Context, params *ScheduleStopRequest) (*ScheduleStopResult, error) { +func (a *ScheduleAPI) Stop(ctx context.Context, params *ScheduleStopRequest) (*ScheduleStopResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["id"] = params.ID @@ -11702,8 +11702,8 @@ func (a *ScheduleApi) Stop(ctx context.Context, params *ScheduleStopRequest) (*S return &result, nil } -// Experimental: ShellApi contains experimental APIs that may change or be removed. -type ShellApi sessionApi +// Experimental: ShellAPI contains experimental APIs that may change or be removed. +type ShellAPI sessionAPI // Exec starts a shell command and streams output through session notifications. // @@ -11714,7 +11714,7 @@ type ShellApi sessionApi // // Returns: Identifier of the spawned process, used to correlate streamed output and exit // notifications. -func (a *ShellApi) Exec(ctx context.Context, params *ShellExecRequest) (*ShellExecResult, error) { +func (a *ShellAPI) Exec(ctx context.Context, params *ShellExecRequest) (*ShellExecResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["command"] = params.Command @@ -11745,7 +11745,7 @@ func (a *ShellApi) Exec(ctx context.Context, params *ShellExecRequest) (*ShellEx // // Returns: Indicates whether the signal was delivered; false if the process was unknown or // already exited. -func (a *ShellApi) Kill(ctx context.Context, params *ShellKillRequest) (*ShellKillResult, error) { +func (a *ShellAPI) Kill(ctx context.Context, params *ShellKillRequest) (*ShellKillResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["processId"] = params.ProcessID @@ -11764,15 +11764,15 @@ func (a *ShellApi) Kill(ctx context.Context, params *ShellKillRequest) (*ShellKi return &result, nil } -// Experimental: SkillsApi contains experimental APIs that may change or be removed. -type SkillsApi sessionApi +// Experimental: SkillsAPI contains experimental APIs that may change or be removed. +type SkillsAPI sessionAPI // Disables a skill for the session. // // RPC method: session.skills.disable. // // Parameters: Name of the skill to disable for the session. -func (a *SkillsApi) Disable(ctx context.Context, params *SkillsDisableRequest) (*SessionSkillsDisableResult, error) { +func (a *SkillsAPI) Disable(ctx context.Context, params *SkillsDisableRequest) (*SessionSkillsDisableResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["name"] = params.Name @@ -11793,7 +11793,7 @@ func (a *SkillsApi) Disable(ctx context.Context, params *SkillsDisableRequest) ( // RPC method: session.skills.enable. // // Parameters: Name of the skill to enable for the session. -func (a *SkillsApi) Enable(ctx context.Context, params *SkillsEnableRequest) (*SessionSkillsEnableResult, error) { +func (a *SkillsAPI) Enable(ctx context.Context, params *SkillsEnableRequest) (*SessionSkillsEnableResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["name"] = params.Name @@ -11812,7 +11812,7 @@ func (a *SkillsApi) Enable(ctx context.Context, params *SkillsEnableRequest) (*S // EnsureLoaded ensures the session's skill definitions have been loaded from disk. // // RPC method: session.skills.ensureLoaded. -func (a *SkillsApi) EnsureLoaded(ctx context.Context) (*SessionSkillsEnsureLoadedResult, error) { +func (a *SkillsAPI) EnsureLoaded(ctx context.Context) (*SessionSkillsEnsureLoadedResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.skills.ensureLoaded", req) if err != nil { @@ -11831,7 +11831,7 @@ func (a *SkillsApi) EnsureLoaded(ctx context.Context) (*SessionSkillsEnsureLoade // // Returns: Skills invoked during this session, ordered by invocation time (most recent // last). -func (a *SkillsApi) GetInvoked(ctx context.Context) (*SkillsGetInvokedResult, error) { +func (a *SkillsAPI) GetInvoked(ctx context.Context) (*SkillsGetInvokedResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.skills.getInvoked", req) if err != nil { @@ -11849,7 +11849,7 @@ func (a *SkillsApi) GetInvoked(ctx context.Context) (*SkillsGetInvokedResult, er // RPC method: session.skills.list. // // Returns: Skills available to the session, with their enabled state. -func (a *SkillsApi) List(ctx context.Context) (*SkillList, error) { +func (a *SkillsAPI) List(ctx context.Context) (*SkillList, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.skills.list", req) if err != nil { @@ -11868,7 +11868,7 @@ func (a *SkillsApi) List(ctx context.Context) (*SkillList, error) { // // Returns: Diagnostics from reloading skill definitions, with warnings and errors as // separate lists. -func (a *SkillsApi) Reload(ctx context.Context) (*SkillsLoadDiagnostics, error) { +func (a *SkillsAPI) Reload(ctx context.Context) (*SkillsLoadDiagnostics, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.skills.reload", req) if err != nil { @@ -11881,8 +11881,8 @@ func (a *SkillsApi) Reload(ctx context.Context) (*SkillsLoadDiagnostics, error) return &result, nil } -// Experimental: TasksApi contains experimental APIs that may change or be removed. -type TasksApi sessionApi +// Experimental: TasksAPI contains experimental APIs that may change or be removed. +type TasksAPI sessionAPI // Cancels a background task. // @@ -11891,7 +11891,7 @@ type TasksApi sessionApi // Parameters: Identifier of the background task to cancel. // // Returns: Indicates whether the background task was successfully cancelled. -func (a *TasksApi) Cancel(ctx context.Context, params *TasksCancelRequest) (*TasksCancelResult, error) { +func (a *TasksAPI) Cancel(ctx context.Context, params *TasksCancelRequest) (*TasksCancelResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["id"] = params.ID @@ -11913,7 +11913,7 @@ func (a *TasksApi) Cancel(ctx context.Context, params *TasksCancelRequest) (*Tas // RPC method: session.tasks.getCurrentPromotable. // // Returns: The first sync-waiting task that can currently be promoted to background mode. -func (a *TasksApi) GetCurrentPromotable(ctx context.Context) (*TasksGetCurrentPromotableResult, error) { +func (a *TasksAPI) GetCurrentPromotable(ctx context.Context) (*TasksGetCurrentPromotableResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.tasks.getCurrentPromotable", req) if err != nil { @@ -11933,7 +11933,7 @@ func (a *TasksApi) GetCurrentPromotable(ctx context.Context) (*TasksGetCurrentPr // Parameters: Identifier of the background task to fetch progress for. // // Returns: Progress information for the task, or null when no task with that ID is tracked. -func (a *TasksApi) GetProgress(ctx context.Context, params *TasksGetProgressRequest) (*TasksGetProgressResult, error) { +func (a *TasksAPI) GetProgress(ctx context.Context, params *TasksGetProgressRequest) (*TasksGetProgressResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["id"] = params.ID @@ -11954,7 +11954,7 @@ func (a *TasksApi) GetProgress(ctx context.Context, params *TasksGetProgressRequ // RPC method: session.tasks.list. // // Returns: Background tasks currently tracked by the session. -func (a *TasksApi) List(ctx context.Context) (*TaskList, error) { +func (a *TasksAPI) List(ctx context.Context) (*TaskList, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.tasks.list", req) if err != nil { @@ -11974,7 +11974,7 @@ func (a *TasksApi) List(ctx context.Context) (*TaskList, error) { // // Returns: The promoted task as it now exists in background mode, omitted if no promotable // task was waiting. -func (a *TasksApi) PromoteCurrentToBackground(ctx context.Context) (*TasksPromoteCurrentToBackgroundResult, error) { +func (a *TasksAPI) PromoteCurrentToBackground(ctx context.Context) (*TasksPromoteCurrentToBackgroundResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.tasks.promoteCurrentToBackground", req) if err != nil { @@ -11995,7 +11995,7 @@ func (a *TasksApi) PromoteCurrentToBackground(ctx context.Context) (*TasksPromot // Parameters: Identifier of the task to promote to background mode. // // Returns: Indicates whether the task was successfully promoted to background mode. -func (a *TasksApi) PromoteToBackground(ctx context.Context, params *TasksPromoteToBackgroundRequest) (*TasksPromoteToBackgroundResult, error) { +func (a *TasksAPI) PromoteToBackground(ctx context.Context, params *TasksPromoteToBackgroundRequest) (*TasksPromoteToBackgroundResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["id"] = params.ID @@ -12017,7 +12017,7 @@ func (a *TasksApi) PromoteToBackground(ctx context.Context, params *TasksPromote // // Returns: Refresh metadata for any detached background shells the runtime knows about. Use // after a long pause to pick up exit/output state for shells running outside the agent loop. -func (a *TasksApi) Refresh(ctx context.Context) (*TasksRefreshResult, error) { +func (a *TasksAPI) Refresh(ctx context.Context) (*TasksRefreshResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.tasks.refresh", req) if err != nil { @@ -12038,7 +12038,7 @@ func (a *TasksApi) Refresh(ctx context.Context) (*TasksRefreshResult, error) { // // Returns: Indicates whether the task was removed. False when the task does not exist or is // still running/idle. -func (a *TasksApi) Remove(ctx context.Context, params *TasksRemoveRequest) (*TasksRemoveResult, error) { +func (a *TasksAPI) Remove(ctx context.Context, params *TasksRemoveRequest) (*TasksRemoveResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["id"] = params.ID @@ -12063,7 +12063,7 @@ func (a *TasksApi) Remove(ctx context.Context, params *TasksRemoveRequest) (*Tas // // Returns: Indicates whether the message was delivered, with an error message when delivery // failed. -func (a *TasksApi) SendMessage(ctx context.Context, params *TasksSendMessageRequest) (*TasksSendMessageResult, error) { +func (a *TasksAPI) SendMessage(ctx context.Context, params *TasksSendMessageRequest) (*TasksSendMessageResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { if params.FromAgentID != nil { @@ -12091,7 +12091,7 @@ func (a *TasksApi) SendMessage(ctx context.Context, params *TasksSendMessageRequ // new task. // // Returns: Identifier assigned to the newly started background agent task. -func (a *TasksApi) StartAgent(ctx context.Context, params *TasksStartAgentRequest) (*TasksStartAgentResult, error) { +func (a *TasksAPI) StartAgent(ctx context.Context, params *TasksStartAgentRequest) (*TasksStartAgentResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["agentType"] = params.AgentType @@ -12123,7 +12123,7 @@ func (a *TasksApi) StartAgent(ctx context.Context, params *TasksStartAgentReques // turns scheduled by their completions have settled. Returns when the runtime is fully // drained or after an internal timeout (default 10 minutes; configurable via // COPILOT_TASK_WAIT_TIMEOUT_SECONDS). -func (a *TasksApi) WaitForPending(ctx context.Context) (*TasksWaitForPendingResult, error) { +func (a *TasksAPI) WaitForPending(ctx context.Context) (*TasksWaitForPendingResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.tasks.waitForPending", req) if err != nil { @@ -12136,8 +12136,8 @@ func (a *TasksApi) WaitForPending(ctx context.Context) (*TasksWaitForPendingResu return &result, nil } -// Experimental: TelemetryApi contains experimental APIs that may change or be removed. -type TelemetryApi sessionApi +// Experimental: TelemetryAPI contains experimental APIs that may change or be removed. +type TelemetryAPI sessionAPI // SetFeatureOverrides sets feature override key/value pairs to attach to subsequent // telemetry events for the session. @@ -12146,7 +12146,7 @@ type TelemetryApi sessionApi // // Parameters: Feature override key/value pairs to attach to subsequent telemetry events // from this session. -func (a *TelemetryApi) SetFeatureOverrides(ctx context.Context, params *TelemetrySetFeatureOverridesRequest) (*SessionTelemetrySetFeatureOverridesResult, error) { +func (a *TelemetryAPI) SetFeatureOverrides(ctx context.Context, params *TelemetrySetFeatureOverridesRequest) (*SessionTelemetrySetFeatureOverridesResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["features"] = params.Features @@ -12162,8 +12162,8 @@ func (a *TelemetryApi) SetFeatureOverrides(ctx context.Context, params *Telemetr return &result, nil } -// Experimental: ToolsApi contains experimental APIs that may change or be removed. -type ToolsApi sessionApi +// Experimental: ToolsAPI contains experimental APIs that may change or be removed. +type ToolsAPI sessionAPI // GetCurrentMetadata returns lightweight metadata for the session's currently initialized // tools. @@ -12171,7 +12171,7 @@ type ToolsApi sessionApi // RPC method: session.tools.getCurrentMetadata. // // Returns: Current lightweight tool metadata snapshot for the session. -func (a *ToolsApi) GetCurrentMetadata(ctx context.Context) (*ToolsGetCurrentMetadataResult, error) { +func (a *ToolsAPI) GetCurrentMetadata(ctx context.Context) (*ToolsGetCurrentMetadataResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.tools.getCurrentMetadata", req) if err != nil { @@ -12192,7 +12192,7 @@ func (a *ToolsApi) GetCurrentMetadata(ctx context.Context) (*ToolsGetCurrentMeta // describing why it failed. // // Returns: Indicates whether the external tool call result was handled successfully. -func (a *ToolsApi) HandlePendingToolCall(ctx context.Context, params *HandlePendingToolCallRequest) (*HandlePendingToolCallResult, error) { +func (a *ToolsAPI) HandlePendingToolCall(ctx context.Context, params *HandlePendingToolCallRequest) (*HandlePendingToolCallResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { if params.Error != nil { @@ -12223,7 +12223,7 @@ func (a *ToolsApi) HandlePendingToolCall(ctx context.Context, params *HandlePend // sessions and consumer flows that need an initialized tool set before `send` invoke this. // Default base-class implementation is a no-op for sessions that don't support tool // validation. -func (a *ToolsApi) InitializeAndValidate(ctx context.Context) (*ToolsInitializeAndValidateResult, error) { +func (a *ToolsAPI) InitializeAndValidate(ctx context.Context) (*ToolsInitializeAndValidateResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.tools.initializeAndValidate", req) if err != nil { @@ -12236,8 +12236,8 @@ func (a *ToolsApi) InitializeAndValidate(ctx context.Context) (*ToolsInitializeA return &result, nil } -// Experimental: UIApi contains experimental APIs that may change or be removed. -type UIApi sessionApi +// Experimental: UIAPI contains experimental APIs that may change or be removed. +type UIAPI sessionAPI // Elicitation requests structured input from a UI-capable client. // @@ -12247,7 +12247,7 @@ type UIApi sessionApi // user. // // Returns: The elicitation response (accept with form values, decline, or cancel) -func (a *UIApi) Elicitation(ctx context.Context, params *UIElicitationRequest) (*UIElicitationResponse, error) { +func (a *UIAPI) Elicitation(ctx context.Context, params *UIElicitationRequest) (*UIElicitationResponse, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["message"] = params.Message @@ -12273,7 +12273,7 @@ func (a *UIApi) Elicitation(ctx context.Context, params *UIElicitationRequest) ( // response. // // Returns: Indicates whether the pending UI request was resolved by this call. -func (a *UIApi) HandlePendingAutoModeSwitch(ctx context.Context, params *UIHandlePendingAutoModeSwitchRequest) (*UIHandlePendingResult, error) { +func (a *UIAPI) HandlePendingAutoModeSwitch(ctx context.Context, params *UIHandlePendingAutoModeSwitchRequest) (*UIHandlePendingResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["requestId"] = params.RequestID @@ -12299,7 +12299,7 @@ func (a *UIApi) HandlePendingAutoModeSwitch(ctx context.Context, params *UIHandl // // Returns: Indicates whether the elicitation response was accepted; false if it was already // resolved by another client. -func (a *UIApi) HandlePendingElicitation(ctx context.Context, params *UIHandlePendingElicitationRequest) (*UIElicitationResult, error) { +func (a *UIAPI) HandlePendingElicitation(ctx context.Context, params *UIHandlePendingElicitationRequest) (*UIElicitationResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["requestId"] = params.RequestID @@ -12325,7 +12325,7 @@ func (a *UIApi) HandlePendingElicitation(ctx context.Context, params *UIHandlePe // response. // // Returns: Indicates whether the pending UI request was resolved by this call. -func (a *UIApi) HandlePendingExitPlanMode(ctx context.Context, params *UIHandlePendingExitPlanModeRequest) (*UIHandlePendingResult, error) { +func (a *UIAPI) HandlePendingExitPlanMode(ctx context.Context, params *UIHandlePendingExitPlanModeRequest) (*UIHandlePendingResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["requestId"] = params.RequestID @@ -12351,7 +12351,7 @@ func (a *UIApi) HandlePendingExitPlanMode(ctx context.Context, params *UIHandleP // result payload (omit to reject). // // Returns: Indicates whether the pending UI request was resolved by this call. -func (a *UIApi) HandlePendingSampling(ctx context.Context, params *UIHandlePendingSamplingRequest) (*UIHandlePendingResult, error) { +func (a *UIAPI) HandlePendingSampling(ctx context.Context, params *UIHandlePendingSamplingRequest) (*UIHandlePendingResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["requestId"] = params.RequestID @@ -12378,7 +12378,7 @@ func (a *UIApi) HandlePendingSampling(ctx context.Context, params *UIHandlePendi // Parameters: Request ID of a pending `user_input.requested` event and the user's response. // // Returns: Indicates whether the pending UI request was resolved by this call. -func (a *UIApi) HandlePendingUserInput(ctx context.Context, params *UIHandlePendingUserInputRequest) (*UIHandlePendingResult, error) { +func (a *UIAPI) HandlePendingUserInput(ctx context.Context, params *UIHandlePendingUserInputRequest) (*UIHandlePendingResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["requestId"] = params.RequestID @@ -12404,7 +12404,7 @@ func (a *UIApi) HandlePendingUserInput(ctx context.Context, params *UIHandlePend // caller still attaches the actual listener via the standard event-subscription mechanism; // this registration solely tells the server bridge to skip its own dispatch (so a remote // client doesn't race the in-process handler for the same requestId). -func (a *UIApi) RegisterDirectAutoModeSwitchHandler(ctx context.Context) (*UIRegisterDirectAutoModeSwitchHandlerResult, error) { +func (a *UIAPI) RegisterDirectAutoModeSwitchHandler(ctx context.Context) (*UIRegisterDirectAutoModeSwitchHandlerResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.ui.registerDirectAutoModeSwitchHandler", req) if err != nil { @@ -12427,7 +12427,7 @@ func (a *UIApi) RegisterDirectAutoModeSwitchHandler(ctx context.Context) (*UIReg // // Returns: Indicates whether the handle was active and the registration count was // decremented. -func (a *UIApi) UnregisterDirectAutoModeSwitchHandler(ctx context.Context, params *UIUnregisterDirectAutoModeSwitchHandlerRequest) (*UIUnregisterDirectAutoModeSwitchHandlerResult, error) { +func (a *UIAPI) UnregisterDirectAutoModeSwitchHandler(ctx context.Context, params *UIUnregisterDirectAutoModeSwitchHandlerRequest) (*UIUnregisterDirectAutoModeSwitchHandlerResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["handle"] = params.Handle @@ -12443,8 +12443,8 @@ func (a *UIApi) UnregisterDirectAutoModeSwitchHandler(ctx context.Context, param return &result, nil } -// Experimental: UsageApi contains experimental APIs that may change or be removed. -type UsageApi sessionApi +// Experimental: UsageAPI contains experimental APIs that may change or be removed. +type UsageAPI sessionAPI // GetMetrics gets accumulated usage metrics for the session. // @@ -12452,7 +12452,7 @@ type UsageApi sessionApi // // Returns: Accumulated session usage metrics, including premium request cost, token counts, // model breakdown, and code-change totals. -func (a *UsageApi) GetMetrics(ctx context.Context) (*UsageGetMetricsResult, error) { +func (a *UsageAPI) GetMetrics(ctx context.Context) (*UsageGetMetricsResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.usage.getMetrics", req) if err != nil { @@ -12465,15 +12465,15 @@ func (a *UsageApi) GetMetrics(ctx context.Context) (*UsageGetMetricsResult, erro return &result, nil } -// Experimental: WorkspacesApi contains experimental APIs that may change or be removed. -type WorkspacesApi sessionApi +// Experimental: WorkspacesAPI contains experimental APIs that may change or be removed. +type WorkspacesAPI sessionAPI // CreateFile creates or overwrites a file in the session workspace files directory. // // RPC method: session.workspaces.createFile. // // Parameters: Relative path and UTF-8 content for the workspace file to create or overwrite. -func (a *WorkspacesApi) CreateFile(ctx context.Context, params *WorkspacesCreateFileRequest) (*SessionWorkspacesCreateFileResult, error) { +func (a *WorkspacesAPI) CreateFile(ctx context.Context, params *WorkspacesCreateFileRequest) (*SessionWorkspacesCreateFileResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["content"] = params.Content @@ -12497,7 +12497,7 @@ func (a *WorkspacesApi) CreateFile(ctx context.Context, params *WorkspacesCreate // Parameters: Parameters for computing a workspace diff. // // Returns: Workspace diff result for the requested mode. -func (a *WorkspacesApi) Diff(ctx context.Context, params *WorkspacesDiffRequest) (*WorkspaceDiffResult, error) { +func (a *WorkspacesAPI) Diff(ctx context.Context, params *WorkspacesDiffRequest) (*WorkspaceDiffResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["mode"] = params.Mode @@ -12519,7 +12519,7 @@ func (a *WorkspacesApi) Diff(ctx context.Context, params *WorkspacesDiffRequest) // // Returns: Current workspace metadata for the session, including its absolute filesystem // path when available. -func (a *WorkspacesApi) GetWorkspace(ctx context.Context) (*WorkspacesGetWorkspaceResult, error) { +func (a *WorkspacesAPI) GetWorkspace(ctx context.Context) (*WorkspacesGetWorkspaceResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.workspaces.getWorkspace", req) if err != nil { @@ -12538,7 +12538,7 @@ func (a *WorkspacesApi) GetWorkspace(ctx context.Context) (*WorkspacesGetWorkspa // // Returns: Workspace checkpoints in chronological order; empty when the workspace is not // enabled. -func (a *WorkspacesApi) ListCheckpoints(ctx context.Context) (*WorkspacesListCheckpointsResult, error) { +func (a *WorkspacesAPI) ListCheckpoints(ctx context.Context) (*WorkspacesListCheckpointsResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.workspaces.listCheckpoints", req) if err != nil { @@ -12556,7 +12556,7 @@ func (a *WorkspacesApi) ListCheckpoints(ctx context.Context) (*WorkspacesListChe // RPC method: session.workspaces.listFiles. // // Returns: Relative paths of files stored in the session workspace files directory. -func (a *WorkspacesApi) ListFiles(ctx context.Context) (*WorkspacesListFilesResult, error) { +func (a *WorkspacesAPI) ListFiles(ctx context.Context) (*WorkspacesListFilesResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.workspaces.listFiles", req) if err != nil { @@ -12577,7 +12577,7 @@ func (a *WorkspacesApi) ListFiles(ctx context.Context) (*WorkspacesListFilesResu // // Returns: Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace // is missing. -func (a *WorkspacesApi) ReadCheckpoint(ctx context.Context, params *WorkspacesReadCheckpointRequest) (*WorkspacesReadCheckpointResult, error) { +func (a *WorkspacesAPI) ReadCheckpoint(ctx context.Context, params *WorkspacesReadCheckpointRequest) (*WorkspacesReadCheckpointResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["number"] = params.Number @@ -12600,7 +12600,7 @@ func (a *WorkspacesApi) ReadCheckpoint(ctx context.Context, params *WorkspacesRe // Parameters: Relative path of the workspace file to read. // // Returns: Contents of the requested workspace file as a UTF-8 string. -func (a *WorkspacesApi) ReadFile(ctx context.Context, params *WorkspacesReadFileRequest) (*WorkspacesReadFileResult, error) { +func (a *WorkspacesAPI) ReadFile(ctx context.Context, params *WorkspacesReadFileRequest) (*WorkspacesReadFileResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["path"] = params.Path @@ -12623,7 +12623,7 @@ func (a *WorkspacesApi) ReadFile(ctx context.Context, params *WorkspacesReadFile // Parameters: Pasted content to save as a UTF-8 file in the session workspace. // // Returns: Descriptor for the saved paste file, or null when the workspace is unavailable. -func (a *WorkspacesApi) SaveLargePaste(ctx context.Context, params *WorkspacesSaveLargePasteRequest) (*WorkspacesSaveLargePasteResult, error) { +func (a *WorkspacesAPI) SaveLargePaste(ctx context.Context, params *WorkspacesSaveLargePasteRequest) (*WorkspacesSaveLargePasteResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { req["content"] = params.Content @@ -12639,41 +12639,41 @@ func (a *WorkspacesApi) SaveLargePaste(ctx context.Context, params *WorkspacesSa return &result, nil } -// SessionRpc provides typed session-scoped RPC methods. -type SessionRpc struct { +// SessionRPC provides typed session-scoped RPC methods. +type SessionRPC struct { // Reuse a single struct instead of allocating one for each service on the heap. - common sessionApi - - Agent *AgentApi - Auth *AuthApi - Canvas *CanvasApi - Commands *CommandsApi - EventLog *EventLogApi - Extensions *ExtensionsApi - Fleet *FleetApi - History *HistoryApi - Instructions *InstructionsApi - Lsp *LspApi - Mcp *McpApi - Metadata *MetadataApi - Mode *ModeApi - Model *ModelApi - Name *NameApi - Options *OptionsApi - Permissions *PermissionsApi - Plan *PlanApi - Plugins *PluginsApi - Queue *QueueApi - Remote *RemoteApi - Schedule *ScheduleApi - Shell *ShellApi - Skills *SkillsApi - Tasks *TasksApi - Telemetry *TelemetryApi - Tools *ToolsApi - UI *UIApi - Usage *UsageApi - Workspaces *WorkspacesApi + common sessionAPI + + Agent *AgentAPI + Auth *AuthAPI + Canvas *CanvasAPI + Commands *CommandsAPI + EventLog *EventLogAPI + Extensions *ExtensionsAPI + Fleet *FleetAPI + History *HistoryAPI + Instructions *InstructionsAPI + Lsp *LspAPI + MCP *MCPAPI + Metadata *MetadataAPI + Mode *ModeAPI + Model *ModelAPI + Name *NameAPI + Options *OptionsAPI + Permissions *PermissionsAPI + Plan *PlanAPI + Plugins *PluginsAPI + Queue *QueueAPI + Remote *RemoteAPI + Schedule *ScheduleAPI + Shell *ShellAPI + Skills *SkillsAPI + Tasks *TasksAPI + Telemetry *TelemetryAPI + Tools *ToolsAPI + UI *UIAPI + Usage *UsageAPI + Workspaces *WorkspacesAPI } // Aborts the current agent turn. @@ -12685,7 +12685,7 @@ type SessionRpc struct { // Returns: Result of aborting the current turn // Experimental: Abort is an experimental API and may change or be removed in future // versions. -func (a *SessionRpc) Abort(ctx context.Context, params *AbortRequest) (*AbortResult, error) { +func (a *SessionRPC) Abort(ctx context.Context, params *AbortRequest) (*AbortResult, error) { req := map[string]any{"sessionId": a.common.sessionID} if params != nil { if params.Reason != nil { @@ -12712,7 +12712,7 @@ func (a *SessionRpc) Abort(ctx context.Context, params *AbortRequest) (*AbortRes // // Returns: Identifier of the session event that was emitted for the log message. // Experimental: Log is an experimental API and may change or be removed in future versions. -func (a *SessionRpc) Log(ctx context.Context, params *LogRequest) (*LogResult, error) { +func (a *SessionRPC) Log(ctx context.Context, params *LogRequest) (*LogResult, error) { req := map[string]any{"sessionId": a.common.sessionID} if params != nil { if params.Ephemeral != nil { @@ -12751,7 +12751,7 @@ func (a *SessionRpc) Log(ctx context.Context, params *LogRequest) (*LogResult, e // // Returns: Result of sending a user message // Experimental: Send is an experimental API and may change or be removed in future versions. -func (a *SessionRpc) Send(ctx context.Context, params *SendRequest) (*SendResult, error) { +func (a *SessionRPC) Send(ctx context.Context, params *SendRequest) (*SendResult, error) { req := map[string]any{"sessionId": a.common.sessionID} if params != nil { if params.AgentMode != nil { @@ -12812,7 +12812,7 @@ func (a *SessionRpc) Send(ctx context.Context, params *SendRequest) (*SendResult // Parameters: Parameters for shutting down the session // Experimental: Shutdown is an experimental API and may change or be removed in future // versions. -func (a *SessionRpc) Shutdown(ctx context.Context, params *ShutdownRequest) (*SessionShutdownResult, error) { +func (a *SessionRPC) Shutdown(ctx context.Context, params *ShutdownRequest) (*SessionShutdownResult, error) { req := map[string]any{"sessionId": a.common.sessionID} if params != nil { if params.Reason != nil { @@ -12838,7 +12838,7 @@ func (a *SessionRpc) Shutdown(ctx context.Context, params *ShutdownRequest) (*Se // RPC method: session.suspend. // Experimental: Suspend is an experimental API and may change or be removed in future // versions. -func (a *SessionRpc) Suspend(ctx context.Context) (*SessionSuspendResult, error) { +func (a *SessionRPC) Suspend(ctx context.Context) (*SessionSuspendResult, error) { req := map[string]any{"sessionId": a.common.sessionID} raw, err := a.common.client.Request("session.suspend", req) if err != nil { @@ -12851,39 +12851,39 @@ func (a *SessionRpc) Suspend(ctx context.Context) (*SessionSuspendResult, error) return &result, nil } -func NewSessionRpc(client *jsonrpc2.Client, sessionID string) *SessionRpc { - r := &SessionRpc{} - r.common = sessionApi{client: client, sessionID: sessionID} - r.Agent = (*AgentApi)(&r.common) - r.Auth = (*AuthApi)(&r.common) - r.Canvas = (*CanvasApi)(&r.common) - r.Commands = (*CommandsApi)(&r.common) - r.EventLog = (*EventLogApi)(&r.common) - r.Extensions = (*ExtensionsApi)(&r.common) - r.Fleet = (*FleetApi)(&r.common) - r.History = (*HistoryApi)(&r.common) - r.Instructions = (*InstructionsApi)(&r.common) - r.Lsp = (*LspApi)(&r.common) - r.Mcp = (*McpApi)(&r.common) - r.Metadata = (*MetadataApi)(&r.common) - r.Mode = (*ModeApi)(&r.common) - r.Model = (*ModelApi)(&r.common) - r.Name = (*NameApi)(&r.common) - r.Options = (*OptionsApi)(&r.common) - r.Permissions = (*PermissionsApi)(&r.common) - r.Plan = (*PlanApi)(&r.common) - r.Plugins = (*PluginsApi)(&r.common) - r.Queue = (*QueueApi)(&r.common) - r.Remote = (*RemoteApi)(&r.common) - r.Schedule = (*ScheduleApi)(&r.common) - r.Shell = (*ShellApi)(&r.common) - r.Skills = (*SkillsApi)(&r.common) - r.Tasks = (*TasksApi)(&r.common) - r.Telemetry = (*TelemetryApi)(&r.common) - r.Tools = (*ToolsApi)(&r.common) - r.UI = (*UIApi)(&r.common) - r.Usage = (*UsageApi)(&r.common) - r.Workspaces = (*WorkspacesApi)(&r.common) +func NewSessionRPC(client *jsonrpc2.Client, sessionID string) *SessionRPC { + r := &SessionRPC{} + r.common = sessionAPI{client: client, sessionID: sessionID} + r.Agent = (*AgentAPI)(&r.common) + r.Auth = (*AuthAPI)(&r.common) + r.Canvas = (*CanvasAPI)(&r.common) + r.Commands = (*CommandsAPI)(&r.common) + r.EventLog = (*EventLogAPI)(&r.common) + r.Extensions = (*ExtensionsAPI)(&r.common) + r.Fleet = (*FleetAPI)(&r.common) + r.History = (*HistoryAPI)(&r.common) + r.Instructions = (*InstructionsAPI)(&r.common) + r.Lsp = (*LspAPI)(&r.common) + r.MCP = (*MCPAPI)(&r.common) + r.Metadata = (*MetadataAPI)(&r.common) + r.Mode = (*ModeAPI)(&r.common) + r.Model = (*ModelAPI)(&r.common) + r.Name = (*NameAPI)(&r.common) + r.Options = (*OptionsAPI)(&r.common) + r.Permissions = (*PermissionsAPI)(&r.common) + r.Plan = (*PlanAPI)(&r.common) + r.Plugins = (*PluginsAPI)(&r.common) + r.Queue = (*QueueAPI)(&r.common) + r.Remote = (*RemoteAPI)(&r.common) + r.Schedule = (*ScheduleAPI)(&r.common) + r.Shell = (*ShellAPI)(&r.common) + r.Skills = (*SkillsAPI)(&r.common) + r.Tasks = (*TasksAPI)(&r.common) + r.Telemetry = (*TelemetryAPI)(&r.common) + r.Tools = (*ToolsAPI)(&r.common) + r.UI = (*UIAPI)(&r.common) + r.Usage = (*UsageAPI)(&r.common) + r.Workspaces = (*WorkspacesAPI)(&r.common) return r } @@ -12913,8 +12913,8 @@ type CanvasHandler interface { Open(request *CanvasProviderOpenRequest) (*CanvasProviderOpenResult, error) } -// Experimental: SessionFsHandler contains experimental APIs that may change or be removed. -type SessionFsHandler interface { +// Experimental: SessionFSHandler contains experimental APIs that may change or be removed. +type SessionFSHandler interface { // AppendFile appends content to a file in the client-provided session filesystem. // // RPC method: sessionFs.appendFile. @@ -12923,7 +12923,7 @@ type SessionFsHandler interface { // session filesystem. // // Returns: Describes a filesystem error. - AppendFile(request *SessionFsAppendFileRequest) (*SessionFsError, error) + AppendFile(request *SessionFSAppendFileRequest) (*SessionFSError, error) // Exists checks whether a path exists in the client-provided session filesystem. // // RPC method: sessionFs.exists. @@ -12932,7 +12932,7 @@ type SessionFsHandler interface { // // Returns: Indicates whether the requested path exists in the client-provided session // filesystem. - Exists(request *SessionFsExistsRequest) (*SessionFsExistsResult, error) + Exists(request *SessionFSExistsRequest) (*SessionFSExistsResult, error) // Mkdir creates a directory in the client-provided session filesystem. // // RPC method: sessionFs.mkdir. @@ -12941,7 +12941,7 @@ type SessionFsHandler interface { // options for recursive creation and POSIX mode. // // Returns: Describes a filesystem error. - Mkdir(request *SessionFsMkdirRequest) (*SessionFsError, error) + Mkdir(request *SessionFSMkdirRequest) (*SessionFSError, error) // Readdir lists entry names in a directory from the client-provided session filesystem. // // RPC method: sessionFs.readdir. @@ -12951,7 +12951,7 @@ type SessionFsHandler interface { // // Returns: Names of entries in the requested directory, or a filesystem error if the read // failed. - Readdir(request *SessionFsReaddirRequest) (*SessionFsReaddirResult, error) + Readdir(request *SessionFSReaddirRequest) (*SessionFSReaddirResult, error) // ReaddirWithTypes lists directory entries with type information from the client-provided // session filesystem. // @@ -12962,7 +12962,7 @@ type SessionFsHandler interface { // // Returns: Entries in the requested directory paired with file/directory type information, // or a filesystem error if the read failed. - ReaddirWithTypes(request *SessionFsReaddirWithTypesRequest) (*SessionFsReaddirWithTypesResult, error) + ReaddirWithTypes(request *SessionFSReaddirWithTypesRequest) (*SessionFSReaddirWithTypesResult, error) // ReadFile reads a file from the client-provided session filesystem. // // RPC method: sessionFs.readFile. @@ -12970,7 +12970,7 @@ type SessionFsHandler interface { // Parameters: Path of the file to read from the client-provided session filesystem. // // Returns: File content as a UTF-8 string, or a filesystem error if the read failed. - ReadFile(request *SessionFsReadFileRequest) (*SessionFsReadFileResult, error) + ReadFile(request *SessionFSReadFileRequest) (*SessionFSReadFileResult, error) // Renames or moves a path in the client-provided session filesystem. // // RPC method: sessionFs.rename. @@ -12979,7 +12979,7 @@ type SessionFsHandler interface { // client-provided session filesystem. // // Returns: Describes a filesystem error. - Rename(request *SessionFsRenameRequest) (*SessionFsError, error) + Rename(request *SessionFSRenameRequest) (*SessionFSError, error) // Rm removes a file or directory from the client-provided session filesystem. // // RPC method: sessionFs.rm. @@ -12988,7 +12988,7 @@ type SessionFsHandler interface { // recursive removal and force. // // Returns: Describes a filesystem error. - Rm(request *SessionFsRmRequest) (*SessionFsError, error) + Rm(request *SessionFSRmRequest) (*SessionFSError, error) // SqliteExists checks whether the per-session SQLite database already exists, without // creating it. // @@ -12997,7 +12997,7 @@ type SessionFsHandler interface { // Parameters: Identifies the target session. // // Returns: Indicates whether the per-session SQLite database already exists. - SqliteExists(request *SessionFsSqliteExistsRequest) (*SessionFsSqliteExistsResult, error) + SqliteExists(request *SessionFSSqliteExistsRequest) (*SessionFSSqliteExistsResult, error) // SqliteQuery executes a SQLite query against the per-session database. // // RPC method: sessionFs.sqliteQuery. @@ -13007,7 +13007,7 @@ type SessionFsHandler interface { // // Returns: Query results including rows, columns, and rows affected, or a filesystem error // if execution failed. - SqliteQuery(request *SessionFsSqliteQueryRequest) (*SessionFsSqliteQueryResult, error) + SqliteQuery(request *SessionFSSqliteQueryRequest) (*SessionFSSqliteQueryResult, error) // Stat gets metadata for a path in the client-provided session filesystem. // // RPC method: sessionFs.stat. @@ -13017,7 +13017,7 @@ type SessionFsHandler interface { // // Returns: Filesystem metadata for the requested path, or a filesystem error if the stat // failed. - Stat(request *SessionFsStatRequest) (*SessionFsStatResult, error) + Stat(request *SessionFSStatRequest) (*SessionFSStatResult, error) // WriteFile writes a file in the client-provided session filesystem. // // RPC method: sessionFs.writeFile. @@ -13026,13 +13026,13 @@ type SessionFsHandler interface { // session filesystem. // // Returns: Describes a filesystem error. - WriteFile(request *SessionFsWriteFileRequest) (*SessionFsError, error) + WriteFile(request *SessionFSWriteFileRequest) (*SessionFSError, error) } -// ClientSessionApiHandlers provides all client session API handler groups for a session. -type ClientSessionApiHandlers struct { +// ClientSessionAPIHandlers provides all client session API handler groups for a session. +type ClientSessionAPIHandlers struct { Canvas CanvasHandler - SessionFs SessionFsHandler + SessionFS SessionFSHandler } func clientSessionHandlerError(err error) *jsonrpc2.Error { @@ -13046,9 +13046,9 @@ func clientSessionHandlerError(err error) *jsonrpc2.Error { return &jsonrpc2.Error{Code: -32603, Message: err.Error()} } -// RegisterClientSessionApiHandlers registers handlers for server-to-client session API +// RegisterClientSessionAPIHandlers registers handlers for server-to-client session API // calls. -func RegisterClientSessionApiHandlers(client *jsonrpc2.Client, getHandlers func(sessionID string) *ClientSessionApiHandlers) { +func RegisterClientSessionAPIHandlers(client *jsonrpc2.Client, getHandlers func(sessionID string) *ClientSessionAPIHandlers) { client.SetRequestHandler("canvas.close", func(params json.RawMessage) (json.RawMessage, *jsonrpc2.Error) { var request CanvasProviderCloseRequest if err := json.Unmarshal(params, &request); err != nil { @@ -13107,15 +13107,15 @@ func RegisterClientSessionApiHandlers(client *jsonrpc2.Client, getHandlers func( return raw, nil }) client.SetRequestHandler("sessionFs.appendFile", func(params json.RawMessage) (json.RawMessage, *jsonrpc2.Error) { - var request SessionFsAppendFileRequest + var request SessionFSAppendFileRequest if err := json.Unmarshal(params, &request); err != nil { return nil, &jsonrpc2.Error{Code: -32602, Message: fmt.Sprintf("Invalid params: %v", err)} } handlers := getHandlers(request.SessionID) - if handlers == nil || handlers.SessionFs == nil { + if handlers == nil || handlers.SessionFS == nil { return nil, &jsonrpc2.Error{Code: -32603, Message: fmt.Sprintf("No sessionFs handler registered for session: %s", request.SessionID)} } - result, err := handlers.SessionFs.AppendFile(&request) + result, err := handlers.SessionFS.AppendFile(&request) if err != nil { return nil, clientSessionHandlerError(err) } @@ -13126,15 +13126,15 @@ func RegisterClientSessionApiHandlers(client *jsonrpc2.Client, getHandlers func( return raw, nil }) client.SetRequestHandler("sessionFs.exists", func(params json.RawMessage) (json.RawMessage, *jsonrpc2.Error) { - var request SessionFsExistsRequest + var request SessionFSExistsRequest if err := json.Unmarshal(params, &request); err != nil { return nil, &jsonrpc2.Error{Code: -32602, Message: fmt.Sprintf("Invalid params: %v", err)} } handlers := getHandlers(request.SessionID) - if handlers == nil || handlers.SessionFs == nil { + if handlers == nil || handlers.SessionFS == nil { return nil, &jsonrpc2.Error{Code: -32603, Message: fmt.Sprintf("No sessionFs handler registered for session: %s", request.SessionID)} } - result, err := handlers.SessionFs.Exists(&request) + result, err := handlers.SessionFS.Exists(&request) if err != nil { return nil, clientSessionHandlerError(err) } @@ -13145,15 +13145,15 @@ func RegisterClientSessionApiHandlers(client *jsonrpc2.Client, getHandlers func( return raw, nil }) client.SetRequestHandler("sessionFs.mkdir", func(params json.RawMessage) (json.RawMessage, *jsonrpc2.Error) { - var request SessionFsMkdirRequest + var request SessionFSMkdirRequest if err := json.Unmarshal(params, &request); err != nil { return nil, &jsonrpc2.Error{Code: -32602, Message: fmt.Sprintf("Invalid params: %v", err)} } handlers := getHandlers(request.SessionID) - if handlers == nil || handlers.SessionFs == nil { + if handlers == nil || handlers.SessionFS == nil { return nil, &jsonrpc2.Error{Code: -32603, Message: fmt.Sprintf("No sessionFs handler registered for session: %s", request.SessionID)} } - result, err := handlers.SessionFs.Mkdir(&request) + result, err := handlers.SessionFS.Mkdir(&request) if err != nil { return nil, clientSessionHandlerError(err) } @@ -13164,15 +13164,15 @@ func RegisterClientSessionApiHandlers(client *jsonrpc2.Client, getHandlers func( return raw, nil }) client.SetRequestHandler("sessionFs.readdir", func(params json.RawMessage) (json.RawMessage, *jsonrpc2.Error) { - var request SessionFsReaddirRequest + var request SessionFSReaddirRequest if err := json.Unmarshal(params, &request); err != nil { return nil, &jsonrpc2.Error{Code: -32602, Message: fmt.Sprintf("Invalid params: %v", err)} } handlers := getHandlers(request.SessionID) - if handlers == nil || handlers.SessionFs == nil { + if handlers == nil || handlers.SessionFS == nil { return nil, &jsonrpc2.Error{Code: -32603, Message: fmt.Sprintf("No sessionFs handler registered for session: %s", request.SessionID)} } - result, err := handlers.SessionFs.Readdir(&request) + result, err := handlers.SessionFS.Readdir(&request) if err != nil { return nil, clientSessionHandlerError(err) } @@ -13183,15 +13183,15 @@ func RegisterClientSessionApiHandlers(client *jsonrpc2.Client, getHandlers func( return raw, nil }) client.SetRequestHandler("sessionFs.readdirWithTypes", func(params json.RawMessage) (json.RawMessage, *jsonrpc2.Error) { - var request SessionFsReaddirWithTypesRequest + var request SessionFSReaddirWithTypesRequest if err := json.Unmarshal(params, &request); err != nil { return nil, &jsonrpc2.Error{Code: -32602, Message: fmt.Sprintf("Invalid params: %v", err)} } handlers := getHandlers(request.SessionID) - if handlers == nil || handlers.SessionFs == nil { + if handlers == nil || handlers.SessionFS == nil { return nil, &jsonrpc2.Error{Code: -32603, Message: fmt.Sprintf("No sessionFs handler registered for session: %s", request.SessionID)} } - result, err := handlers.SessionFs.ReaddirWithTypes(&request) + result, err := handlers.SessionFS.ReaddirWithTypes(&request) if err != nil { return nil, clientSessionHandlerError(err) } @@ -13202,15 +13202,15 @@ func RegisterClientSessionApiHandlers(client *jsonrpc2.Client, getHandlers func( return raw, nil }) client.SetRequestHandler("sessionFs.readFile", func(params json.RawMessage) (json.RawMessage, *jsonrpc2.Error) { - var request SessionFsReadFileRequest + var request SessionFSReadFileRequest if err := json.Unmarshal(params, &request); err != nil { return nil, &jsonrpc2.Error{Code: -32602, Message: fmt.Sprintf("Invalid params: %v", err)} } handlers := getHandlers(request.SessionID) - if handlers == nil || handlers.SessionFs == nil { + if handlers == nil || handlers.SessionFS == nil { return nil, &jsonrpc2.Error{Code: -32603, Message: fmt.Sprintf("No sessionFs handler registered for session: %s", request.SessionID)} } - result, err := handlers.SessionFs.ReadFile(&request) + result, err := handlers.SessionFS.ReadFile(&request) if err != nil { return nil, clientSessionHandlerError(err) } @@ -13221,15 +13221,15 @@ func RegisterClientSessionApiHandlers(client *jsonrpc2.Client, getHandlers func( return raw, nil }) client.SetRequestHandler("sessionFs.rename", func(params json.RawMessage) (json.RawMessage, *jsonrpc2.Error) { - var request SessionFsRenameRequest + var request SessionFSRenameRequest if err := json.Unmarshal(params, &request); err != nil { return nil, &jsonrpc2.Error{Code: -32602, Message: fmt.Sprintf("Invalid params: %v", err)} } handlers := getHandlers(request.SessionID) - if handlers == nil || handlers.SessionFs == nil { + if handlers == nil || handlers.SessionFS == nil { return nil, &jsonrpc2.Error{Code: -32603, Message: fmt.Sprintf("No sessionFs handler registered for session: %s", request.SessionID)} } - result, err := handlers.SessionFs.Rename(&request) + result, err := handlers.SessionFS.Rename(&request) if err != nil { return nil, clientSessionHandlerError(err) } @@ -13240,15 +13240,15 @@ func RegisterClientSessionApiHandlers(client *jsonrpc2.Client, getHandlers func( return raw, nil }) client.SetRequestHandler("sessionFs.rm", func(params json.RawMessage) (json.RawMessage, *jsonrpc2.Error) { - var request SessionFsRmRequest + var request SessionFSRmRequest if err := json.Unmarshal(params, &request); err != nil { return nil, &jsonrpc2.Error{Code: -32602, Message: fmt.Sprintf("Invalid params: %v", err)} } handlers := getHandlers(request.SessionID) - if handlers == nil || handlers.SessionFs == nil { + if handlers == nil || handlers.SessionFS == nil { return nil, &jsonrpc2.Error{Code: -32603, Message: fmt.Sprintf("No sessionFs handler registered for session: %s", request.SessionID)} } - result, err := handlers.SessionFs.Rm(&request) + result, err := handlers.SessionFS.Rm(&request) if err != nil { return nil, clientSessionHandlerError(err) } @@ -13259,15 +13259,15 @@ func RegisterClientSessionApiHandlers(client *jsonrpc2.Client, getHandlers func( return raw, nil }) client.SetRequestHandler("sessionFs.sqliteExists", func(params json.RawMessage) (json.RawMessage, *jsonrpc2.Error) { - var request SessionFsSqliteExistsRequest + var request SessionFSSqliteExistsRequest if err := json.Unmarshal(params, &request); err != nil { return nil, &jsonrpc2.Error{Code: -32602, Message: fmt.Sprintf("Invalid params: %v", err)} } handlers := getHandlers(request.SessionID) - if handlers == nil || handlers.SessionFs == nil { + if handlers == nil || handlers.SessionFS == nil { return nil, &jsonrpc2.Error{Code: -32603, Message: fmt.Sprintf("No sessionFs handler registered for session: %s", request.SessionID)} } - result, err := handlers.SessionFs.SqliteExists(&request) + result, err := handlers.SessionFS.SqliteExists(&request) if err != nil { return nil, clientSessionHandlerError(err) } @@ -13278,15 +13278,15 @@ func RegisterClientSessionApiHandlers(client *jsonrpc2.Client, getHandlers func( return raw, nil }) client.SetRequestHandler("sessionFs.sqliteQuery", func(params json.RawMessage) (json.RawMessage, *jsonrpc2.Error) { - var request SessionFsSqliteQueryRequest + var request SessionFSSqliteQueryRequest if err := json.Unmarshal(params, &request); err != nil { return nil, &jsonrpc2.Error{Code: -32602, Message: fmt.Sprintf("Invalid params: %v", err)} } handlers := getHandlers(request.SessionID) - if handlers == nil || handlers.SessionFs == nil { + if handlers == nil || handlers.SessionFS == nil { return nil, &jsonrpc2.Error{Code: -32603, Message: fmt.Sprintf("No sessionFs handler registered for session: %s", request.SessionID)} } - result, err := handlers.SessionFs.SqliteQuery(&request) + result, err := handlers.SessionFS.SqliteQuery(&request) if err != nil { return nil, clientSessionHandlerError(err) } @@ -13297,15 +13297,15 @@ func RegisterClientSessionApiHandlers(client *jsonrpc2.Client, getHandlers func( return raw, nil }) client.SetRequestHandler("sessionFs.stat", func(params json.RawMessage) (json.RawMessage, *jsonrpc2.Error) { - var request SessionFsStatRequest + var request SessionFSStatRequest if err := json.Unmarshal(params, &request); err != nil { return nil, &jsonrpc2.Error{Code: -32602, Message: fmt.Sprintf("Invalid params: %v", err)} } handlers := getHandlers(request.SessionID) - if handlers == nil || handlers.SessionFs == nil { + if handlers == nil || handlers.SessionFS == nil { return nil, &jsonrpc2.Error{Code: -32603, Message: fmt.Sprintf("No sessionFs handler registered for session: %s", request.SessionID)} } - result, err := handlers.SessionFs.Stat(&request) + result, err := handlers.SessionFS.Stat(&request) if err != nil { return nil, clientSessionHandlerError(err) } @@ -13316,15 +13316,15 @@ func RegisterClientSessionApiHandlers(client *jsonrpc2.Client, getHandlers func( return raw, nil }) client.SetRequestHandler("sessionFs.writeFile", func(params json.RawMessage) (json.RawMessage, *jsonrpc2.Error) { - var request SessionFsWriteFileRequest + var request SessionFSWriteFileRequest if err := json.Unmarshal(params, &request); err != nil { return nil, &jsonrpc2.Error{Code: -32602, Message: fmt.Sprintf("Invalid params: %v", err)} } handlers := getHandlers(request.SessionID) - if handlers == nil || handlers.SessionFs == nil { + if handlers == nil || handlers.SessionFS == nil { return nil, &jsonrpc2.Error{Code: -32603, Message: fmt.Sprintf("No sessionFs handler registered for session: %s", request.SessionID)} } - result, err := handlers.SessionFs.WriteFile(&request) + result, err := handlers.SessionFS.WriteFile(&request) if err != nil { return nil, clientSessionHandlerError(err) } diff --git a/go/rpc/zrpc_encoding.go b/go/rpc/zrpc_encoding.go index b44a1d622..5c56fd951 100644 --- a/go/rpc/zrpc_encoding.go +++ b/go/rpc/zrpc_encoding.go @@ -142,8 +142,8 @@ func unmarshalAttachment(data []byte) (Attachment, error) { return nil, err } return &d, nil - case AttachmentTypeGithubReference: - var d AttachmentGithubReference + case AttachmentTypeGitHubReference: + var d AttachmentGitHubReference if err := json.Unmarshal(data, &d); err != nil { return nil, err } @@ -214,8 +214,8 @@ func (r AttachmentFile) MarshalJSON() ([]byte, error) { }) } -func (r AttachmentGithubReference) MarshalJSON() ([]byte, error) { - type alias AttachmentGithubReference +func (r AttachmentGitHubReference) MarshalJSON() ([]byte, error) { + type alias AttachmentGitHubReference return json.Marshal(struct { Type AttachmentType `json:"type"` alias @@ -267,13 +267,13 @@ func unmarshalAuthInfo(data []byte) (AuthInfo, error) { return nil, err } return &d, nil - case AuthInfoTypeGhCli: - var d GhCliAuthInfo + case AuthInfoTypeGHCLI: + var d GHCLIAuthInfo if err := json.Unmarshal(data, &d); err != nil { return nil, err } return &d, nil - case AuthInfoTypeHmac: + case AuthInfoTypeHMAC: var d HMACAuthInfo if err := json.Unmarshal(data, &d); err != nil { return nil, err @@ -340,8 +340,8 @@ func (r EnvAuthInfo) MarshalJSON() ([]byte, error) { }) } -func (r GhCliAuthInfo) MarshalJSON() ([]byte, error) { - type alias GhCliAuthInfo +func (r GHCLIAuthInfo) MarshalJSON() ([]byte, error) { + type alias GHCLIAuthInfo return json.Marshal(struct { Type AuthInfoType `json:"type"` alias @@ -789,8 +789,8 @@ func (r *HandlePendingToolCallRequest) UnmarshalJSON(data []byte) error { } func (r InstalledPluginSource) MarshalJSON() ([]byte, error) { - if r.InstalledPluginSourceGithub != nil { - return json.Marshal(r.InstalledPluginSourceGithub) + if r.InstalledPluginSourceGitHub != nil { + return json.Marshal(r.InstalledPluginSourceGitHub) } if r.InstalledPluginSourceLocal != nil { return json.Marshal(r.InstalledPluginSourceLocal) @@ -810,9 +810,9 @@ func (r *InstalledPluginSource) UnmarshalJSON(data []byte) error { return nil } { - var value InstalledPluginSourceGithub + var value InstalledPluginSourceGitHub if err := json.Unmarshal(data, &value); err == nil { - *r = InstalledPluginSource{InstalledPluginSourceGithub: &value} + *r = InstalledPluginSource{InstalledPluginSourceGitHub: &value} return nil } } @@ -840,7 +840,7 @@ func (r *InstalledPluginSource) UnmarshalJSON(data []byte) error { return errors.New("data did not match any union variant for InstalledPluginSource") } -func matchesMcpServerConfigHTTP(data []byte) bool { +func matchesMCPServerConfigHTTP(data []byte) bool { var rawGroup0 struct { Command json.RawMessage `json:"command"` URL json.RawMessage `json:"url"` @@ -854,7 +854,7 @@ func matchesMcpServerConfigHTTP(data []byte) bool { return rawGroup0.Command == nil } -func matchesMcpServerConfigStdio(data []byte) bool { +func matchesMCPServerConfigStdio(data []byte) bool { var rawGroup0 struct { Command json.RawMessage `json:"command"` URL json.RawMessage `json:"url"` @@ -868,74 +868,74 @@ func matchesMcpServerConfigStdio(data []byte) bool { return rawGroup0.URL == nil } -func unmarshalMcpServerConfig(data []byte) (McpServerConfig, error) { +func unmarshalMCPServerConfig(data []byte) (MCPServerConfig, error) { if string(data) == "null" { return nil, nil } - if matchesMcpServerConfigHTTP(data) { - var d McpServerConfigHTTP + if matchesMCPServerConfigHTTP(data) { + var d MCPServerConfigHTTP if err := json.Unmarshal(data, &d); err != nil { return nil, err } return &d, nil } - if matchesMcpServerConfigStdio(data) { - var d McpServerConfigStdio + if matchesMCPServerConfigStdio(data) { + var d MCPServerConfigStdio if err := json.Unmarshal(data, &d); err != nil { return nil, err } return &d, nil } - return &RawMcpServerConfigData{Raw: data}, nil + return &RawMCPServerConfigData{Raw: data}, nil } -func (r RawMcpServerConfigData) MarshalJSON() ([]byte, error) { +func (r RawMCPServerConfigData) MarshalJSON() ([]byte, error) { if r.Raw != nil { return r.Raw, nil } return []byte("null"), nil } -func unmarshalMcpServerAuthConfig(data []byte) (McpServerAuthConfig, error) { +func unmarshalMCPServerAuthConfig(data []byte) (MCPServerAuthConfig, error) { if string(data) == "null" { return nil, nil } { var value bool if err := json.Unmarshal(data, &value); err == nil { - return McpServerAuthConfigBoolean(value), nil + return MCPServerAuthConfigBoolean(value), nil } } { - var value McpServerAuthConfigRedirectPort + var value MCPServerAuthConfigRedirectPort if err := json.Unmarshal(data, &value); err == nil { return &value, nil } } - return nil, errors.New("data did not match any union variant for McpServerAuthConfig") + return nil, errors.New("data did not match any union variant for MCPServerAuthConfig") } -func (r *McpServerConfigHTTP) UnmarshalJSON(data []byte) error { - type rawMcpServerConfigHTTP struct { +func (r *MCPServerConfigHTTP) UnmarshalJSON(data []byte) error { + type rawMCPServerConfigHTTP struct { Auth json.RawMessage `json:"auth,omitempty"` FilterMapping json.RawMessage `json:"filterMapping,omitempty"` Headers map[string]string `json:"headers,omitempty"` IsDefaultServer *bool `json:"isDefaultServer,omitempty"` OauthClientID *string `json:"oauthClientId,omitempty"` - OauthGrantType *McpServerConfigHTTPOauthGrantType `json:"oauthGrantType,omitempty"` + OauthGrantType *MCPServerConfigHTTPOauthGrantType `json:"oauthGrantType,omitempty"` OauthPublicClient *bool `json:"oauthPublicClient,omitempty"` Oidc json.RawMessage `json:"oidc,omitempty"` Timeout *int64 `json:"timeout,omitempty"` Tools []string `json:"tools,omitempty"` - Type *McpServerConfigHTTPType `json:"type,omitempty"` + Type *MCPServerConfigHTTPType `json:"type,omitempty"` URL string `json:"url"` } - var raw rawMcpServerConfigHTTP + var raw rawMCPServerConfigHTTP if err := json.Unmarshal(data, &raw); err != nil { return err } if raw.Auth != nil { - value, err := unmarshalMcpServerAuthConfig(raw.Auth) + value, err := unmarshalMCPServerAuthConfig(raw.Auth) if err != nil { return err } @@ -954,7 +954,7 @@ func (r *McpServerConfigHTTP) UnmarshalJSON(data []byte) error { r.OauthGrantType = raw.OauthGrantType r.OauthPublicClient = raw.OauthPublicClient if raw.Oidc != nil { - value, err := unmarshalMcpServerAuthConfig(raw.Oidc) + value, err := unmarshalMCPServerAuthConfig(raw.Oidc) if err != nil { return err } @@ -967,8 +967,8 @@ func (r *McpServerConfigHTTP) UnmarshalJSON(data []byte) error { return nil } -func (r *McpServerConfigStdio) UnmarshalJSON(data []byte) error { - type rawMcpServerConfigStdio struct { +func (r *MCPServerConfigStdio) UnmarshalJSON(data []byte) error { + type rawMCPServerConfigStdio struct { Args []string `json:"args,omitempty"` Auth json.RawMessage `json:"auth,omitempty"` Command string `json:"command"` @@ -980,13 +980,13 @@ func (r *McpServerConfigStdio) UnmarshalJSON(data []byte) error { Timeout *int64 `json:"timeout,omitempty"` Tools []string `json:"tools,omitempty"` } - var raw rawMcpServerConfigStdio + var raw rawMCPServerConfigStdio if err := json.Unmarshal(data, &raw); err != nil { return err } r.Args = raw.Args if raw.Auth != nil { - value, err := unmarshalMcpServerAuthConfig(raw.Auth) + value, err := unmarshalMCPServerAuthConfig(raw.Auth) if err != nil { return err } @@ -1004,7 +1004,7 @@ func (r *McpServerConfigStdio) UnmarshalJSON(data []byte) error { } r.IsDefaultServer = raw.IsDefaultServer if raw.Oidc != nil { - value, err := unmarshalMcpServerAuthConfig(raw.Oidc) + value, err := unmarshalMCPServerAuthConfig(raw.Oidc) if err != nil { return err } @@ -1015,17 +1015,17 @@ func (r *McpServerConfigStdio) UnmarshalJSON(data []byte) error { return nil } -func (r *McpConfigAddRequest) UnmarshalJSON(data []byte) error { - type rawMcpConfigAddRequest struct { +func (r *MCPConfigAddRequest) UnmarshalJSON(data []byte) error { + type rawMCPConfigAddRequest struct { Config json.RawMessage `json:"config"` Name string `json:"name"` } - var raw rawMcpConfigAddRequest + var raw rawMCPConfigAddRequest if err := json.Unmarshal(data, &raw); err != nil { return err } if raw.Config != nil { - value, err := unmarshalMcpServerConfig(raw.Config) + value, err := unmarshalMCPServerConfig(raw.Config) if err != nil { return err } @@ -1035,18 +1035,18 @@ func (r *McpConfigAddRequest) UnmarshalJSON(data []byte) error { return nil } -func (r *McpConfigList) UnmarshalJSON(data []byte) error { - type rawMcpConfigList struct { +func (r *MCPConfigList) UnmarshalJSON(data []byte) error { + type rawMCPConfigList struct { Servers map[string]json.RawMessage `json:"servers"` } - var raw rawMcpConfigList + var raw rawMCPConfigList if err := json.Unmarshal(data, &raw); err != nil { return err } if raw.Servers != nil { - r.Servers = make(map[string]McpServerConfig, len(raw.Servers)) + r.Servers = make(map[string]MCPServerConfig, len(raw.Servers)) for key, rawValue := range raw.Servers { - value, err := unmarshalMcpServerConfig(rawValue) + value, err := unmarshalMCPServerConfig(rawValue) if err != nil { return err } @@ -1056,17 +1056,17 @@ func (r *McpConfigList) UnmarshalJSON(data []byte) error { return nil } -func (r *McpConfigUpdateRequest) UnmarshalJSON(data []byte) error { - type rawMcpConfigUpdateRequest struct { +func (r *MCPConfigUpdateRequest) UnmarshalJSON(data []byte) error { + type rawMCPConfigUpdateRequest struct { Config json.RawMessage `json:"config"` Name string `json:"name"` } - var raw rawMcpConfigUpdateRequest + var raw rawMCPConfigUpdateRequest if err := json.Unmarshal(data, &raw); err != nil { return err } if raw.Config != nil { - value, err := unmarshalMcpServerConfig(raw.Config) + value, err := unmarshalMCPServerConfig(raw.Config) if err != nil { return err } @@ -1243,8 +1243,8 @@ func unmarshalUserToolSessionApproval(data []byte) (UserToolSessionApproval, err return nil, err } return &d, nil - case UserToolSessionApprovalKindMcp: - var d UserToolSessionApprovalMcp + case UserToolSessionApprovalKindMCP: + var d UserToolSessionApprovalMCP if err := json.Unmarshal(data, &d); err != nil { return nil, err } @@ -1327,8 +1327,8 @@ func (r UserToolSessionApprovalExtensionPermissionAccess) MarshalJSON() ([]byte, }) } -func (r UserToolSessionApprovalMcp) MarshalJSON() ([]byte, error) { - type alias UserToolSessionApprovalMcp +func (r UserToolSessionApprovalMCP) MarshalJSON() ([]byte, error) { + type alias UserToolSessionApprovalMCP return json.Marshal(struct { Kind UserToolSessionApprovalKind `json:"kind"` alias @@ -1468,14 +1468,14 @@ func unmarshalPermissionDecisionApproveForLocationApproval(data []byte) (Permiss return nil, err } return &d, nil - case PermissionDecisionApproveForLocationApprovalKindMcp: - var d PermissionDecisionApproveForLocationApprovalMcp + case PermissionDecisionApproveForLocationApprovalKindMCP: + var d PermissionDecisionApproveForLocationApprovalMCP if err := json.Unmarshal(data, &d); err != nil { return nil, err } return &d, nil - case PermissionDecisionApproveForLocationApprovalKindMcpSampling: - var d PermissionDecisionApproveForLocationApprovalMcpSampling + case PermissionDecisionApproveForLocationApprovalKindMCPSampling: + var d PermissionDecisionApproveForLocationApprovalMCPSampling if err := json.Unmarshal(data, &d); err != nil { return nil, err } @@ -1558,8 +1558,8 @@ func (r PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess) M }) } -func (r PermissionDecisionApproveForLocationApprovalMcp) MarshalJSON() ([]byte, error) { - type alias PermissionDecisionApproveForLocationApprovalMcp +func (r PermissionDecisionApproveForLocationApprovalMCP) MarshalJSON() ([]byte, error) { + type alias PermissionDecisionApproveForLocationApprovalMCP return json.Marshal(struct { Kind PermissionDecisionApproveForLocationApprovalKind `json:"kind"` alias @@ -1569,8 +1569,8 @@ func (r PermissionDecisionApproveForLocationApprovalMcp) MarshalJSON() ([]byte, }) } -func (r PermissionDecisionApproveForLocationApprovalMcpSampling) MarshalJSON() ([]byte, error) { - type alias PermissionDecisionApproveForLocationApprovalMcpSampling +func (r PermissionDecisionApproveForLocationApprovalMCPSampling) MarshalJSON() ([]byte, error) { + type alias PermissionDecisionApproveForLocationApprovalMCPSampling return json.Marshal(struct { Kind PermissionDecisionApproveForLocationApprovalKind `json:"kind"` alias @@ -1681,14 +1681,14 @@ func unmarshalPermissionDecisionApproveForSessionApproval(data []byte) (Permissi return nil, err } return &d, nil - case PermissionDecisionApproveForSessionApprovalKindMcp: - var d PermissionDecisionApproveForSessionApprovalMcp + case PermissionDecisionApproveForSessionApprovalKindMCP: + var d PermissionDecisionApproveForSessionApprovalMCP if err := json.Unmarshal(data, &d); err != nil { return nil, err } return &d, nil - case PermissionDecisionApproveForSessionApprovalKindMcpSampling: - var d PermissionDecisionApproveForSessionApprovalMcpSampling + case PermissionDecisionApproveForSessionApprovalKindMCPSampling: + var d PermissionDecisionApproveForSessionApprovalMCPSampling if err := json.Unmarshal(data, &d); err != nil { return nil, err } @@ -1771,8 +1771,8 @@ func (r PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess) Ma }) } -func (r PermissionDecisionApproveForSessionApprovalMcp) MarshalJSON() ([]byte, error) { - type alias PermissionDecisionApproveForSessionApprovalMcp +func (r PermissionDecisionApproveForSessionApprovalMCP) MarshalJSON() ([]byte, error) { + type alias PermissionDecisionApproveForSessionApprovalMCP return json.Marshal(struct { Kind PermissionDecisionApproveForSessionApprovalKind `json:"kind"` alias @@ -1782,8 +1782,8 @@ func (r PermissionDecisionApproveForSessionApprovalMcp) MarshalJSON() ([]byte, e }) } -func (r PermissionDecisionApproveForSessionApprovalMcpSampling) MarshalJSON() ([]byte, error) { - type alias PermissionDecisionApproveForSessionApprovalMcpSampling +func (r PermissionDecisionApproveForSessionApprovalMCPSampling) MarshalJSON() ([]byte, error) { + type alias PermissionDecisionApproveForSessionApprovalMCPSampling return json.Marshal(struct { Kind PermissionDecisionApproveForSessionApprovalKind `json:"kind"` alias @@ -2024,14 +2024,14 @@ func unmarshalPermissionsLocationsAddToolApprovalDetails(data []byte) (Permissio return nil, err } return &d, nil - case PermissionsLocationsAddToolApprovalDetailsKindMcp: - var d PermissionsLocationsAddToolApprovalDetailsMcp + case PermissionsLocationsAddToolApprovalDetailsKindMCP: + var d PermissionsLocationsAddToolApprovalDetailsMCP if err := json.Unmarshal(data, &d); err != nil { return nil, err } return &d, nil - case PermissionsLocationsAddToolApprovalDetailsKindMcpSampling: - var d PermissionsLocationsAddToolApprovalDetailsMcpSampling + case PermissionsLocationsAddToolApprovalDetailsKindMCPSampling: + var d PermissionsLocationsAddToolApprovalDetailsMCPSampling if err := json.Unmarshal(data, &d); err != nil { return nil, err } @@ -2114,8 +2114,8 @@ func (r PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess) Mar }) } -func (r PermissionsLocationsAddToolApprovalDetailsMcp) MarshalJSON() ([]byte, error) { - type alias PermissionsLocationsAddToolApprovalDetailsMcp +func (r PermissionsLocationsAddToolApprovalDetailsMCP) MarshalJSON() ([]byte, error) { + type alias PermissionsLocationsAddToolApprovalDetailsMCP return json.Marshal(struct { Kind PermissionsLocationsAddToolApprovalDetailsKind `json:"kind"` alias @@ -2125,8 +2125,8 @@ func (r PermissionsLocationsAddToolApprovalDetailsMcp) MarshalJSON() ([]byte, er }) } -func (r PermissionsLocationsAddToolApprovalDetailsMcpSampling) MarshalJSON() ([]byte, error) { - type alias PermissionsLocationsAddToolApprovalDetailsMcpSampling +func (r PermissionsLocationsAddToolApprovalDetailsMCPSampling) MarshalJSON() ([]byte, error) { + type alias PermissionsLocationsAddToolApprovalDetailsMCPSampling return json.Marshal(struct { Kind PermissionsLocationsAddToolApprovalDetailsKind `json:"kind"` alias @@ -2226,8 +2226,8 @@ func unmarshalPushAttachment(data []byte) (PushAttachment, error) { return nil, err } return &d, nil - case PushAttachmentTypeGithubReference: - var d PushAttachmentGithubReference + case PushAttachmentTypeGitHubReference: + var d PushAttachmentGitHubReference if err := json.Unmarshal(data, &d); err != nil { return nil, err } @@ -2298,8 +2298,8 @@ func (r PushAttachmentFile) MarshalJSON() ([]byte, error) { }) } -func (r PushAttachmentGithubReference) MarshalJSON() ([]byte, error) { - type alias PushAttachmentGithubReference +func (r PushAttachmentGitHubReference) MarshalJSON() ([]byte, error) { + type alias PushAttachmentGitHubReference return json.Marshal(struct { Type PushAttachmentType `json:"type"` alias @@ -2389,8 +2389,8 @@ func (r *SendRequest) UnmarshalJSON(data []byte) error { } func (r SessionInstalledPluginSource) MarshalJSON() ([]byte, error) { - if r.SessionInstalledPluginSourceGithub != nil { - return json.Marshal(r.SessionInstalledPluginSourceGithub) + if r.SessionInstalledPluginSourceGitHub != nil { + return json.Marshal(r.SessionInstalledPluginSourceGitHub) } if r.SessionInstalledPluginSourceLocal != nil { return json.Marshal(r.SessionInstalledPluginSourceLocal) @@ -2410,9 +2410,9 @@ func (r *SessionInstalledPluginSource) UnmarshalJSON(data []byte) error { return nil } { - var value SessionInstalledPluginSourceGithub + var value SessionInstalledPluginSourceGitHub if err := json.Unmarshal(data, &value); err == nil { - *r = SessionInstalledPluginSource{SessionInstalledPluginSourceGithub: &value} + *r = SessionInstalledPluginSource{SessionInstalledPluginSourceGitHub: &value} return nil } } diff --git a/go/rpc/zsession_encoding.go b/go/rpc/zsession_encoding.go index cd83ab0f9..e91aa9b8a 100644 --- a/go/rpc/zsession_encoding.go +++ b/go/rpc/zsession_encoding.go @@ -197,20 +197,20 @@ func (e *SessionEvent) UnmarshalJSON(data []byte) error { return err } e.Data = &d - case SessionEventTypeMcpAppToolCallComplete: - var d McpAppToolCallCompleteData + case SessionEventTypeMCPAppToolCallComplete: + var d MCPAppToolCallCompleteData if err := json.Unmarshal(raw.Data, &d); err != nil { return err } e.Data = &d - case SessionEventTypeMcpOauthCompleted: - var d McpOauthCompletedData + case SessionEventTypeMCPOauthCompleted: + var d MCPOauthCompletedData if err := json.Unmarshal(raw.Data, &d); err != nil { return err } e.Data = &d - case SessionEventTypeMcpOauthRequired: - var d McpOauthRequiredData + case SessionEventTypeMCPOauthRequired: + var d MCPOauthRequiredData if err := json.Unmarshal(raw.Data, &d); err != nil { return err } @@ -341,14 +341,14 @@ func (e *SessionEvent) UnmarshalJSON(data []byte) error { return err } e.Data = &d - case SessionEventTypeSessionMcpServersLoaded: - var d SessionMcpServersLoadedData + case SessionEventTypeSessionMCPServersLoaded: + var d SessionMCPServersLoadedData if err := json.Unmarshal(raw.Data, &d); err != nil { return err } e.Data = &d - case SessionEventTypeSessionMcpServerStatusChanged: - var d SessionMcpServerStatusChangedData + case SessionEventTypeSessionMCPServerStatusChanged: + var d SessionMCPServerStatusChangedData if err := json.Unmarshal(raw.Data, &d); err != nil { return err } @@ -1045,8 +1045,8 @@ func unmarshalPermissionRequest(data []byte) (PermissionRequest, error) { return nil, err } return &d, nil - case PermissionRequestKindMcp: - var d PermissionRequestMcp + case PermissionRequestKindMCP: + var d PermissionRequestMCP if err := json.Unmarshal(data, &d); err != nil { return nil, err } @@ -1141,8 +1141,8 @@ func (r PermissionRequestHook) MarshalJSON() ([]byte, error) { }) } -func (r PermissionRequestMcp) MarshalJSON() ([]byte, error) { - type alias PermissionRequestMcp +func (r PermissionRequestMCP) MarshalJSON() ([]byte, error) { + type alias PermissionRequestMCP return json.Marshal(struct { Kind PermissionRequestKind `json:"kind"` alias @@ -1250,8 +1250,8 @@ func unmarshalPermissionPromptRequest(data []byte) (PermissionPromptRequest, err return nil, err } return &d, nil - case PermissionPromptRequestKindMcp: - var d PermissionPromptRequestMcp + case PermissionPromptRequestKindMCP: + var d PermissionPromptRequestMCP if err := json.Unmarshal(data, &d); err != nil { return nil, err } @@ -1357,8 +1357,8 @@ func (r PermissionPromptRequestHook) MarshalJSON() ([]byte, error) { }) } -func (r PermissionPromptRequestMcp) MarshalJSON() ([]byte, error) { - type alias PermissionPromptRequestMcp +func (r PermissionPromptRequestMCP) MarshalJSON() ([]byte, error) { + type alias PermissionPromptRequestMCP return json.Marshal(struct { Kind PermissionPromptRequestKind `json:"kind"` alias diff --git a/go/rpc/zsession_events.go b/go/rpc/zsession_events.go index 2be84f643..5f877a7b7 100644 --- a/go/rpc/zsession_events.go +++ b/go/rpc/zsession_events.go @@ -80,9 +80,9 @@ const ( SessionEventTypeHookEnd SessionEventType = "hook.end" SessionEventTypeHookProgress SessionEventType = "hook.progress" SessionEventTypeHookStart SessionEventType = "hook.start" - SessionEventTypeMcpAppToolCallComplete SessionEventType = "mcp_app.tool_call_complete" - SessionEventTypeMcpOauthCompleted SessionEventType = "mcp.oauth_completed" - SessionEventTypeMcpOauthRequired SessionEventType = "mcp.oauth_required" + SessionEventTypeMCPAppToolCallComplete SessionEventType = "mcp_app.tool_call_complete" + SessionEventTypeMCPOauthCompleted SessionEventType = "mcp.oauth_completed" + SessionEventTypeMCPOauthRequired SessionEventType = "mcp.oauth_required" SessionEventTypeModelCallFailure SessionEventType = "model.call_failure" SessionEventTypePendingMessagesModified SessionEventType = "pending_messages.modified" SessionEventTypePermissionCompleted SessionEventType = "permission.completed" @@ -104,8 +104,8 @@ const ( SessionEventTypeSessionHandoff SessionEventType = "session.handoff" SessionEventTypeSessionIdle SessionEventType = "session.idle" SessionEventTypeSessionInfo SessionEventType = "session.info" - SessionEventTypeSessionMcpServersLoaded SessionEventType = "session.mcp_servers_loaded" - SessionEventTypeSessionMcpServerStatusChanged SessionEventType = "session.mcp_server_status_changed" + SessionEventTypeSessionMCPServersLoaded SessionEventType = "session.mcp_servers_loaded" + SessionEventTypeSessionMCPServerStatusChanged SessionEventType = "session.mcp_server_status_changed" SessionEventTypeSessionModeChanged SessionEventType = "session.mode_changed" SessionEventTypeSessionModelChange SessionEventType = "session.model_change" SessionEventTypeSessionPermissionsChanged SessionEventType = "session.permissions_changed" @@ -614,13 +614,13 @@ func (*AssistantUsageData) sessionEventData() {} func (*AssistantUsageData) Type() SessionEventType { return SessionEventTypeAssistantUsage } // MCP App view called a tool on a connected MCP server (SEP-1865) -type McpAppToolCallCompleteData struct { +type MCPAppToolCallCompleteData struct { // Arguments passed to the tool by the app view, if any Arguments map[string]any `json:"arguments,omitempty"` // Wall-clock duration of the underlying tools/call in milliseconds DurationMs float64 `json:"durationMs"` // Set when the underlying tools/call threw an error before returning a CallToolResult - Error *McpAppToolCallCompleteError `json:"error,omitempty"` + Error *MCPAppToolCallCompleteError `json:"error,omitempty"` // Standard MCP CallToolResult returned by the server. Present whether or not the call set isError. Result map[string]any `json:"result,omitempty"` // Name of the MCP server hosting the tool @@ -628,24 +628,24 @@ type McpAppToolCallCompleteData struct { // True when the call completed without throwing AND the MCP CallToolResult did not set isError Success bool `json:"success"` // The tool's `_meta.ui` block at the time of the call, so consumers can decide whether to forward the result to the model without re-listing tools. - ToolMeta *McpAppToolCallCompleteToolMeta `json:"toolMeta,omitempty"` + ToolMeta *MCPAppToolCallCompleteToolMeta `json:"toolMeta,omitempty"` // MCP tool name that was invoked ToolName string `json:"toolName"` } -func (*McpAppToolCallCompleteData) sessionEventData() {} -func (*McpAppToolCallCompleteData) Type() SessionEventType { - return SessionEventTypeMcpAppToolCallComplete +func (*MCPAppToolCallCompleteData) sessionEventData() {} +func (*MCPAppToolCallCompleteData) Type() SessionEventType { + return SessionEventTypeMCPAppToolCallComplete } // MCP OAuth request completion notification -type McpOauthCompletedData struct { +type MCPOauthCompletedData struct { // Request ID of the resolved OAuth request RequestID string `json:"requestId"` } -func (*McpOauthCompletedData) sessionEventData() {} -func (*McpOauthCompletedData) Type() SessionEventType { return SessionEventTypeMcpOauthCompleted } +func (*MCPOauthCompletedData) sessionEventData() {} +func (*MCPOauthCompletedData) Type() SessionEventType { return SessionEventTypeMCPOauthCompleted } // Model change details including previous and new model identifiers type SessionModelChangeData struct { @@ -682,7 +682,7 @@ func (*SessionRemoteSteerableChangedData) Type() SessionEventType { } // OAuth authentication request for an MCP server -type McpOauthRequiredData struct { +type MCPOauthRequiredData struct { // Unique identifier for this OAuth request; used to respond via session.respondToMcpOAuth() RequestID string `json:"requestId"` // Display name of the MCP server that requires OAuth @@ -690,11 +690,11 @@ type McpOauthRequiredData struct { // URL of the MCP server that requires OAuth ServerURL string `json:"serverUrl"` // Static OAuth client configuration, if the server specifies one - StaticClientConfig *McpOauthRequiredStaticClientConfig `json:"staticClientConfig,omitempty"` + StaticClientConfig *MCPOauthRequiredStaticClientConfig `json:"staticClientConfig,omitempty"` } -func (*McpOauthRequiredData) sessionEventData() {} -func (*McpOauthRequiredData) Type() SessionEventType { return SessionEventTypeMcpOauthRequired } +func (*MCPOauthRequiredData) sessionEventData() {} +func (*MCPOauthRequiredData) Type() SessionEventType { return SessionEventTypeMCPOauthRequired } // Opaque custom notification data. Consumers may branch on source and name, but payload semantics are source-defined. type SessionCustomNotificationData struct { @@ -868,7 +868,7 @@ func (*SamplingCompletedData) Type() SessionEventType { return SessionEventTypeS // Sampling request from an MCP server; contains the server name and a requestId for correlation type SamplingRequestedData struct { // The JSON-RPC request ID from the MCP protocol - McpRequestID any `json:"mcpRequestId"` + MCPRequestID any `json:"mcpRequestId"` // Unique identifier for this sampling request; used to respond via session.respondToSampling() RequestID string `json:"requestId"` // Name of the MCP server that initiated the sampling request @@ -993,29 +993,29 @@ func (*SessionExtensionsLoadedData) Type() SessionEventType { } // Schema for the `McpServerStatusChangedData` type. -type SessionMcpServerStatusChangedData struct { +type SessionMCPServerStatusChangedData struct { // Error message if the server entered a failed state Error *string `json:"error,omitempty"` // Name of the MCP server whose status changed ServerName string `json:"serverName"` // Connection status: connected, failed, needs-auth, pending, disabled, or not_configured - Status McpServerStatus `json:"status"` + Status MCPServerStatus `json:"status"` } -func (*SessionMcpServerStatusChangedData) sessionEventData() {} -func (*SessionMcpServerStatusChangedData) Type() SessionEventType { - return SessionEventTypeSessionMcpServerStatusChanged +func (*SessionMCPServerStatusChangedData) sessionEventData() {} +func (*SessionMCPServerStatusChangedData) Type() SessionEventType { + return SessionEventTypeSessionMCPServerStatusChanged } // Schema for the `McpServersLoadedData` type. -type SessionMcpServersLoadedData struct { +type SessionMCPServersLoadedData struct { // Array of MCP server status summaries - Servers []McpServersLoadedServer `json:"servers"` + Servers []MCPServersLoadedServer `json:"servers"` } -func (*SessionMcpServersLoadedData) sessionEventData() {} -func (*SessionMcpServersLoadedData) Type() SessionEventType { - return SessionEventTypeSessionMcpServersLoaded +func (*SessionMCPServersLoadedData) sessionEventData() {} +func (*SessionMCPServersLoadedData) Type() SessionEventType { + return SessionEventTypeSessionMCPServersLoaded } // Schema for the `SkillsLoadedData` type. @@ -1457,9 +1457,9 @@ type ToolExecutionStartData struct { // When true, the tool output should be displayed expanded (verbatim) in the CLI timeline DisplayVerbatim *bool `json:"displayVerbatim,omitempty"` // Name of the MCP server hosting this tool, when the tool is an MCP tool - McpServerName *string `json:"mcpServerName,omitempty"` + MCPServerName *string `json:"mcpServerName,omitempty"` // Original tool name on the MCP server, when the tool is an MCP tool - McpToolName *string `json:"mcpToolName,omitempty"` + MCPToolName *string `json:"mcpToolName,omitempty"` // Tool call ID of the parent tool invocation when this event originates from a sub-agent // Deprecated: ParentToolCallID is deprecated. ParentToolCallID *string `json:"parentToolCallId,omitempty"` @@ -1604,9 +1604,9 @@ type AssistantMessageToolRequest struct { // Resolved intention summary describing what this specific call does IntentionSummary *string `json:"intentionSummary,omitempty"` // Name of the MCP server hosting this tool, when the tool is an MCP tool - McpServerName *string `json:"mcpServerName,omitempty"` + MCPServerName *string `json:"mcpServerName,omitempty"` // Original tool name on the MCP server, when the tool is an MCP tool - McpToolName *string `json:"mcpToolName,omitempty"` + MCPToolName *string `json:"mcpToolName,omitempty"` // Name of the tool being invoked Name string `json:"name"` // Unique identifier for this tool call @@ -1702,7 +1702,7 @@ type CapabilitiesChangedUI struct { // Whether elicitation is now supported Elicitation *bool `json:"elicitation,omitempty"` // Whether MCP Apps (SEP-1865) UI passthrough is now supported - McpApps *bool `json:"mcpApps,omitempty"` + MCPApps *bool `json:"mcpApps,omitempty"` } // Schema for the `CommandsChangedCommand` type. @@ -1844,19 +1844,19 @@ type HookEndError struct { } // Set when the underlying tools/call threw an error before returning a CallToolResult -type McpAppToolCallCompleteError struct { +type MCPAppToolCallCompleteError struct { // Human-readable error message Message string `json:"message"` } // The tool's `_meta.ui` block at the time of the call, so consumers can decide whether to forward the result to the model without re-listing tools. -type McpAppToolCallCompleteToolMeta struct { +type MCPAppToolCallCompleteToolMeta struct { // Schema for the `McpAppToolCallCompleteToolMetaUI` type. - UI *McpAppToolCallCompleteToolMetaUI `json:"ui,omitempty"` + UI *MCPAppToolCallCompleteToolMetaUI `json:"ui,omitempty"` } // Schema for the `McpAppToolCallCompleteToolMetaUI` type. -type McpAppToolCallCompleteToolMetaUI struct { +type MCPAppToolCallCompleteToolMetaUI struct { // `ui://` URI declared by the tool's `_meta.ui.resourceUri` ResourceURI *string `json:"resourceUri,omitempty"` // Tool visibility per SEP-1865 (typically a subset of `["model","app"]`) @@ -1864,17 +1864,17 @@ type McpAppToolCallCompleteToolMetaUI struct { } // Static OAuth client configuration, if the server specifies one -type McpOauthRequiredStaticClientConfig struct { +type MCPOauthRequiredStaticClientConfig struct { // OAuth client ID for the server ClientID string `json:"clientId"` // Optional non-default OAuth grant type. When set to 'client_credentials', the OAuth flow runs headlessly using the client_id + keychain-stored secret (no browser, no callback server). - GrantType *McpOauthRequiredStaticClientConfigGrantType `json:"grantType,omitempty"` + GrantType *MCPOauthRequiredStaticClientConfigGrantType `json:"grantType,omitempty"` // Whether this is a public OAuth client PublicClient *bool `json:"publicClient,omitempty"` } // Schema for the `McpServersLoadedServer` type. -type McpServersLoadedServer struct { +type MCPServersLoadedServer struct { // Error message if the server failed to connect Error *string `json:"error,omitempty"` // Server name (config key) @@ -1884,11 +1884,11 @@ type McpServersLoadedServer struct { // Version of the plugin that supplied the effective MCP server config, only when source is plugin PluginVersion *string `json:"pluginVersion,omitempty"` // Configuration source: user, workspace, plugin, or builtin - Source *McpServerSource `json:"source,omitempty"` + Source *MCPServerSource `json:"source,omitempty"` // Connection status: connected, failed, needs-auth, pending, disabled, or not_configured - Status McpServerStatus `json:"status"` + Status MCPServerStatus `json:"status"` // Transport mechanism: stdio, http, sse (deprecated), or memory (in-process MCP server) - Transport *McpServerTransport `json:"transport,omitempty"` + Transport *MCPServerTransport `json:"transport,omitempty"` } // Derived user-facing permission prompt details for UI consumers @@ -1993,7 +1993,7 @@ func (PermissionPromptRequestHook) Kind() PermissionPromptRequestKind { } // MCP tool invocation permission prompt -type PermissionPromptRequestMcp struct { +type PermissionPromptRequestMCP struct { // Arguments to pass to the MCP tool Args *any `json:"args,omitempty"` // Name of the MCP server providing the tool @@ -2006,9 +2006,9 @@ type PermissionPromptRequestMcp struct { ToolTitle string `json:"toolTitle"` } -func (PermissionPromptRequestMcp) permissionPromptRequest() {} -func (PermissionPromptRequestMcp) Kind() PermissionPromptRequestKind { - return PermissionPromptRequestKindMcp +func (PermissionPromptRequestMCP) permissionPromptRequest() {} +func (PermissionPromptRequestMCP) Kind() PermissionPromptRequestKind { + return PermissionPromptRequestKindMCP } // Memory operation permission prompt @@ -2181,7 +2181,7 @@ func (PermissionRequestHook) Kind() PermissionRequestKind { } // MCP tool invocation permission request -type PermissionRequestMcp struct { +type PermissionRequestMCP struct { // Arguments to pass to the MCP tool Args any `json:"args,omitempty"` // Whether this MCP tool is read-only (no side effects) @@ -2196,9 +2196,9 @@ type PermissionRequestMcp struct { ToolTitle string `json:"toolTitle"` } -func (PermissionRequestMcp) permissionRequest() {} -func (PermissionRequestMcp) Kind() PermissionRequestKind { - return PermissionRequestKindMcp +func (PermissionRequestMCP) permissionRequest() {} +func (PermissionRequestMCP) Kind() PermissionRequestKind { + return PermissionRequestKindMCP } // Memory operation permission request @@ -2254,7 +2254,7 @@ type PermissionRequestShell struct { // File paths that may be read or written by the command PossiblePaths []string `json:"possiblePaths"` // URLs that may be accessed by the command - PossibleUrls []PermissionRequestShellPossibleURL `json:"possibleUrls"` + PossibleURLs []PermissionRequestShellPossibleURL `json:"possibleUrls"` // Tool call ID that triggered this permission request ToolCallID *string `json:"toolCallId,omitempty"` // Optional warning message about risks of running this command @@ -3030,24 +3030,24 @@ const ( ) // Optional non-default OAuth grant type. When set to 'client_credentials', the OAuth flow runs headlessly using the client_id + keychain-stored secret (no browser, no callback server). -type McpOauthRequiredStaticClientConfigGrantType string +type MCPOauthRequiredStaticClientConfigGrantType string const ( - McpOauthRequiredStaticClientConfigGrantTypeClientCredentials McpOauthRequiredStaticClientConfigGrantType = "client_credentials" + MCPOauthRequiredStaticClientConfigGrantTypeClientCredentials MCPOauthRequiredStaticClientConfigGrantType = "client_credentials" ) // Transport mechanism: stdio, http, sse (deprecated), or memory (in-process MCP server) -type McpServerTransport string +type MCPServerTransport string const ( // Server communicates over streamable HTTP. - McpServerTransportHTTP McpServerTransport = "http" + MCPServerTransportHTTP MCPServerTransport = "http" // Server is backed by an in-memory runtime implementation. - McpServerTransportMemory McpServerTransport = "memory" + MCPServerTransportMemory MCPServerTransport = "memory" // Server communicates over Server-Sent Events (deprecated). - McpServerTransportSse McpServerTransport = "sse" + MCPServerTransportSSE MCPServerTransport = "sse" // Server communicates over stdio with a local child process. - McpServerTransportStdio McpServerTransport = "stdio" + MCPServerTransportStdio MCPServerTransport = "stdio" ) // Where the failed model call originated @@ -3055,7 +3055,7 @@ type ModelCallFailureSource string const ( // Model call from MCP sampling. - ModelCallFailureSourceMcpSampling ModelCallFailureSource = "mcp_sampling" + ModelCallFailureSourceMCPSampling ModelCallFailureSource = "mcp_sampling" // Model call from a sub-agent. ModelCallFailureSourceSubagent ModelCallFailureSource = "subagent" // Model call from the top-level agent. @@ -3071,7 +3071,7 @@ const ( PermissionPromptRequestKindExtensionManagement PermissionPromptRequestKind = "extension-management" PermissionPromptRequestKindExtensionPermissionAccess PermissionPromptRequestKind = "extension-permission-access" PermissionPromptRequestKindHook PermissionPromptRequestKind = "hook" - PermissionPromptRequestKindMcp PermissionPromptRequestKind = "mcp" + PermissionPromptRequestKindMCP PermissionPromptRequestKind = "mcp" PermissionPromptRequestKindMemory PermissionPromptRequestKind = "memory" PermissionPromptRequestKindPath PermissionPromptRequestKind = "path" PermissionPromptRequestKindRead PermissionPromptRequestKind = "read" @@ -3099,7 +3099,7 @@ const ( PermissionRequestKindExtensionManagement PermissionRequestKind = "extension-management" PermissionRequestKindExtensionPermissionAccess PermissionRequestKind = "extension-permission-access" PermissionRequestKindHook PermissionRequestKind = "hook" - PermissionRequestKindMcp PermissionRequestKind = "mcp" + PermissionRequestKindMCP PermissionRequestKind = "mcp" PermissionRequestKindMemory PermissionRequestKind = "memory" PermissionRequestKindRead PermissionRequestKind = "read" PermissionRequestKindShell PermissionRequestKind = "shell" @@ -3249,9 +3249,9 @@ type WorkingDirectoryContextHostType string const ( // Repository is hosted on Azure DevOps. - WorkingDirectoryContextHostTypeAdo WorkingDirectoryContextHostType = "ado" + WorkingDirectoryContextHostTypeADO WorkingDirectoryContextHostType = "ado" // Repository is hosted on GitHub. - WorkingDirectoryContextHostTypeGithub WorkingDirectoryContextHostType = "github" + WorkingDirectoryContextHostTypeGitHub WorkingDirectoryContextHostType = "github" ) // Whether the file was newly created or updated diff --git a/go/sdk_protocol_version.go b/go/sdk_protocol_version.go index 95249568b..eb17c7bbd 100644 --- a/go/sdk_protocol_version.go +++ b/go/sdk_protocol_version.go @@ -2,11 +2,11 @@ package copilot -// SdkProtocolVersion is the SDK protocol version. +// SDKProtocolVersion is the SDK protocol version. // This must match the version expected by the copilot-agent-runtime server. -const SdkProtocolVersion = 3 +const SDKProtocolVersion = 3 -// GetSdkProtocolVersion returns the SDK protocol version. -func GetSdkProtocolVersion() int { - return SdkProtocolVersion +// GetSDKProtocolVersion returns the SDK protocol version. +func GetSDKProtocolVersion() int { + return SDKProtocolVersion } diff --git a/go/session.go b/go/session.go index 6e68631eb..fadf338b7 100644 --- a/go/session.go +++ b/go/session.go @@ -53,7 +53,7 @@ type Session struct { SessionID string workspacePath string client *jsonrpc2.Client - clientSessionApis *rpc.ClientSessionApiHandlers + clientSessionAPIs *rpc.ClientSessionAPIHandlers handlers []sessionHandler nextHandlerID uint64 handlerMutex sync.RWMutex @@ -88,7 +88,7 @@ type Session struct { closeOnce sync.Once // guards eventCh close so Disconnect is safe to call more than once // RPC provides typed session-scoped RPC methods. - RPC *rpc.SessionRpc + RPC *rpc.SessionRPC } // WorkspacePath returns the path to the session workspace directory when infinite @@ -283,14 +283,14 @@ func newSession(sessionID string, client *jsonrpc2.Client, workspacePath string) SessionID: sessionID, workspacePath: workspacePath, client: client, - clientSessionApis: &rpc.ClientSessionApiHandlers{}, + clientSessionAPIs: &rpc.ClientSessionAPIHandlers{}, handlers: make([]sessionHandler, 0), toolHandlers: make(map[string]ToolHandler), commandHandlers: make(map[string]CommandHandler), eventCh: make(chan SessionEvent, 128), - RPC: rpc.NewSessionRpc(client, sessionID), + RPC: rpc.NewSessionRPC(client, sessionID), } - s.clientSessionApis.Canvas = newCanvasClientSessionAdapter(s) + s.clientSessionAPIs.Canvas = newCanvasClientSessionAdapter(s) go s.processEvents() return s } @@ -652,14 +652,14 @@ func (s *Session) handleHooksInvoke(hookType string, rawInput json.RawMessage) ( return hooks.OnPreToolUse(input, invocation) case "preMcpToolCall": - if hooks.OnPreMcpToolCall == nil { + if hooks.OnPreMCPToolCall == nil { return nil, nil } - var input PreMcpToolCallHookInput + var input PreMCPToolCallHookInput if err := json.Unmarshal(rawInput, &input); err != nil { return nil, fmt.Errorf("invalid hook input: %w", err) } - return hooks.OnPreMcpToolCall(input, invocation) + return hooks.OnPreMCPToolCall(input, invocation) case "postToolUse": if hooks.OnPostToolUse == nil { @@ -1057,7 +1057,7 @@ func (ui *SessionUI) Select(ctx context.Context, message string, options []strin // Input shows a text input dialog. Returns the entered text, or empty string and // false if the user declines/cancels. -func (ui *SessionUI) Input(ctx context.Context, message string, opts *UiInputOptions) (string, bool, error) { +func (ui *SessionUI) Input(ctx context.Context, message string, opts *UIInputOptions) (string, bool, error) { if err := ui.session.assertElicitation(); err != nil { return "", false, err } diff --git a/go/session_fs_provider.go b/go/session_fs_provider.go index 50922d7bc..d2227d629 100644 --- a/go/session_fs_provider.go +++ b/go/session_fs_provider.go @@ -12,12 +12,12 @@ import ( "github.com/github/copilot-sdk/go/rpc" ) -// SessionFsProvider is the interface that SDK users implement to provide +// SessionFSProvider is the interface that SDK users implement to provide // a session filesystem. Methods use idiomatic Go error handling: return an // error for failures (the adapter maps os.ErrNotExist → ENOENT automatically). // -// To add SQLite support, also implement [SessionFsSqliteProvider] on the same type. -type SessionFsProvider interface { +// To add SQLite support, also implement [SessionFSSqliteProvider] on the same type. +type SessionFSProvider interface { // ReadFile reads the full content of a file. Return os.ErrNotExist (or wrap it) // if the file does not exist. ReadFile(path string) (string, error) @@ -31,7 +31,7 @@ type SessionFsProvider interface { Exists(path string) (bool, error) // Stat returns metadata about a file or directory. // Return os.ErrNotExist if the path does not exist. - Stat(path string) (*SessionFsFileInfo, error) + Stat(path string) (*SessionFSFileInfo, error) // Mkdir creates a directory. If recursive is true, create parent directories as needed. // mode is an optional POSIX-style permission mode (e.g., 0o755). Pass nil to use the OS default. MakeDirectory(path string, recursive bool, mode *int) error @@ -40,7 +40,7 @@ type SessionFsProvider interface { ReadDirectory(path string) ([]string, error) // ReaddirWithTypes lists entries with type information. // Return os.ErrNotExist if the directory does not exist. - ReadDirectoryWithTypes(path string) ([]rpc.SessionFsReaddirWithTypesEntry, error) + ReadDirectoryWithTypes(path string) ([]rpc.SessionFSReaddirWithTypesEntry, error) // Rm removes a file or directory. If recursive is true, remove contents too. // If force is true, do not return an error when the path does not exist. Remove(path string, recursive bool, force bool) error @@ -48,32 +48,32 @@ type SessionFsProvider interface { Rename(src string, dest string) error } -// SessionFsSqliteProvider is an optional interface that a [SessionFsProvider] +// SessionFSSqliteProvider is an optional interface that a [SessionFSProvider] // may also implement to support per-session SQLite databases. The adapter // checks for this interface at runtime using a type assertion. If the // provider does not implement it, SQLite requests return an "unsupported" error. // // Providers are already session-scoped (created per session by the factory), // so these methods do not take a session ID parameter. -type SessionFsSqliteProvider interface { +type SessionFSSqliteProvider interface { // SqliteQuery executes a SQLite query against the provider's per-session database. - SqliteQuery(queryType rpc.SessionFsSqliteQueryType, query string, params map[string]any) (*SessionFsSqliteQueryResult, error) + SqliteQuery(queryType rpc.SessionFSSqliteQueryType, query string, params map[string]any) (*SessionFSSqliteQueryResult, error) // SqliteExists checks whether the provider has a SQLite database for the session. SqliteExists() (bool, error) } -// SessionFsSqliteQueryResult holds the result of a SQLite query execution. +// SessionFSSqliteQueryResult holds the result of a SQLite query execution. // Same shape as the generated RPC type but without the Error field, // since providers signal errors by returning a Go error. -type SessionFsSqliteQueryResult struct { +type SessionFSSqliteQueryResult struct { Columns []string `json:"columns"` Rows []map[string]any `json:"rows"` RowsAffected int64 `json:"rowsAffected"` LastInsertRowid *int64 `json:"lastInsertRowid,omitempty"` } -// SessionFsFileInfo holds file metadata returned by SessionFsProvider.Stat. -type SessionFsFileInfo struct { +// SessionFSFileInfo holds file metadata returned by SessionFSProvider.Stat. +type SessionFSFileInfo struct { IsFile bool IsDirectory bool Size int64 @@ -81,62 +81,62 @@ type SessionFsFileInfo struct { Birthtime time.Time } -// sessionFsAdapter wraps a SessionFsProvider to implement rpc.SessionFsHandler, -// converting idiomatic Go errors into SessionFsError results. -type sessionFsAdapter struct { - provider SessionFsProvider +// sessionFSAdapter wraps a SessionFSProvider to implement rpc.SessionFSHandler, +// converting idiomatic Go errors into SessionFSError results. +type sessionFSAdapter struct { + provider SessionFSProvider } -func newSessionFsAdapter(provider SessionFsProvider) rpc.SessionFsHandler { - return &sessionFsAdapter{provider: provider} +func newSessionFSAdapter(provider SessionFSProvider) rpc.SessionFSHandler { + return &sessionFSAdapter{provider: provider} } -func (a *sessionFsAdapter) ReadFile(request *rpc.SessionFsReadFileRequest) (*rpc.SessionFsReadFileResult, error) { +func (a *sessionFSAdapter) ReadFile(request *rpc.SessionFSReadFileRequest) (*rpc.SessionFSReadFileResult, error) { content, err := a.provider.ReadFile(request.Path) if err != nil { - return &rpc.SessionFsReadFileResult{Error: toSessionFsError(err)}, nil + return &rpc.SessionFSReadFileResult{Error: toSessionFSError(err)}, nil } - return &rpc.SessionFsReadFileResult{Content: content}, nil + return &rpc.SessionFSReadFileResult{Content: content}, nil } -func (a *sessionFsAdapter) WriteFile(request *rpc.SessionFsWriteFileRequest) (*rpc.SessionFsError, error) { +func (a *sessionFSAdapter) WriteFile(request *rpc.SessionFSWriteFileRequest) (*rpc.SessionFSError, error) { var mode *int if request.Mode != nil { m := int(*request.Mode) mode = &m } if err := a.provider.WriteFile(request.Path, request.Content, mode); err != nil { - return toSessionFsError(err), nil + return toSessionFSError(err), nil } return nil, nil } -func (a *sessionFsAdapter) AppendFile(request *rpc.SessionFsAppendFileRequest) (*rpc.SessionFsError, error) { +func (a *sessionFSAdapter) AppendFile(request *rpc.SessionFSAppendFileRequest) (*rpc.SessionFSError, error) { var mode *int if request.Mode != nil { m := int(*request.Mode) mode = &m } if err := a.provider.AppendFile(request.Path, request.Content, mode); err != nil { - return toSessionFsError(err), nil + return toSessionFSError(err), nil } return nil, nil } -func (a *sessionFsAdapter) Exists(request *rpc.SessionFsExistsRequest) (*rpc.SessionFsExistsResult, error) { +func (a *sessionFSAdapter) Exists(request *rpc.SessionFSExistsRequest) (*rpc.SessionFSExistsResult, error) { exists, err := a.provider.Exists(request.Path) if err != nil { - return &rpc.SessionFsExistsResult{Exists: false}, nil + return &rpc.SessionFSExistsResult{Exists: false}, nil } - return &rpc.SessionFsExistsResult{Exists: exists}, nil + return &rpc.SessionFSExistsResult{Exists: exists}, nil } -func (a *sessionFsAdapter) Stat(request *rpc.SessionFsStatRequest) (*rpc.SessionFsStatResult, error) { +func (a *sessionFSAdapter) Stat(request *rpc.SessionFSStatRequest) (*rpc.SessionFSStatResult, error) { info, err := a.provider.Stat(request.Path) if err != nil { - return &rpc.SessionFsStatResult{Error: toSessionFsError(err)}, nil + return &rpc.SessionFSStatResult{Error: toSessionFSError(err)}, nil } - return &rpc.SessionFsStatResult{ + return &rpc.SessionFSStatResult{ IsFile: info.IsFile, IsDirectory: info.IsDirectory, Size: info.Size, @@ -145,7 +145,7 @@ func (a *sessionFsAdapter) Stat(request *rpc.SessionFsStatRequest) (*rpc.Session }, nil } -func (a *sessionFsAdapter) Mkdir(request *rpc.SessionFsMkdirRequest) (*rpc.SessionFsError, error) { +func (a *sessionFSAdapter) Mkdir(request *rpc.SessionFSMkdirRequest) (*rpc.SessionFSError, error) { recursive := request.Recursive != nil && *request.Recursive var mode *int if request.Mode != nil { @@ -153,65 +153,65 @@ func (a *sessionFsAdapter) Mkdir(request *rpc.SessionFsMkdirRequest) (*rpc.Sessi mode = &m } if err := a.provider.MakeDirectory(request.Path, recursive, mode); err != nil { - return toSessionFsError(err), nil + return toSessionFSError(err), nil } return nil, nil } -func (a *sessionFsAdapter) Readdir(request *rpc.SessionFsReaddirRequest) (*rpc.SessionFsReaddirResult, error) { +func (a *sessionFSAdapter) Readdir(request *rpc.SessionFSReaddirRequest) (*rpc.SessionFSReaddirResult, error) { entries, err := a.provider.ReadDirectory(request.Path) if err != nil { - return &rpc.SessionFsReaddirResult{Error: toSessionFsError(err)}, nil + return &rpc.SessionFSReaddirResult{Error: toSessionFSError(err)}, nil } - return &rpc.SessionFsReaddirResult{Entries: entries}, nil + return &rpc.SessionFSReaddirResult{Entries: entries}, nil } -func (a *sessionFsAdapter) ReaddirWithTypes(request *rpc.SessionFsReaddirWithTypesRequest) (*rpc.SessionFsReaddirWithTypesResult, error) { +func (a *sessionFSAdapter) ReaddirWithTypes(request *rpc.SessionFSReaddirWithTypesRequest) (*rpc.SessionFSReaddirWithTypesResult, error) { entries, err := a.provider.ReadDirectoryWithTypes(request.Path) if err != nil { - return &rpc.SessionFsReaddirWithTypesResult{Error: toSessionFsError(err)}, nil + return &rpc.SessionFSReaddirWithTypesResult{Error: toSessionFSError(err)}, nil } - return &rpc.SessionFsReaddirWithTypesResult{Entries: entries}, nil + return &rpc.SessionFSReaddirWithTypesResult{Entries: entries}, nil } -func (a *sessionFsAdapter) Rm(request *rpc.SessionFsRmRequest) (*rpc.SessionFsError, error) { +func (a *sessionFSAdapter) Rm(request *rpc.SessionFSRmRequest) (*rpc.SessionFSError, error) { recursive := request.Recursive != nil && *request.Recursive force := request.Force != nil && *request.Force if err := a.provider.Remove(request.Path, recursive, force); err != nil { - return toSessionFsError(err), nil + return toSessionFSError(err), nil } return nil, nil } -func (a *sessionFsAdapter) Rename(request *rpc.SessionFsRenameRequest) (*rpc.SessionFsError, error) { +func (a *sessionFSAdapter) Rename(request *rpc.SessionFSRenameRequest) (*rpc.SessionFSError, error) { if err := a.provider.Rename(request.Src, request.Dest); err != nil { - return toSessionFsError(err), nil + return toSessionFSError(err), nil } return nil, nil } -func (a *sessionFsAdapter) SqliteQuery(request *rpc.SessionFsSqliteQueryRequest) (*rpc.SessionFsSqliteQueryResult, error) { - sp, ok := a.provider.(SessionFsSqliteProvider) +func (a *sessionFSAdapter) SqliteQuery(request *rpc.SessionFSSqliteQueryRequest) (*rpc.SessionFSSqliteQueryResult, error) { + sp, ok := a.provider.(SessionFSSqliteProvider) if !ok { msg := "SQLite is not supported by this session filesystem provider" - return &rpc.SessionFsSqliteQueryResult{ + return &rpc.SessionFSSqliteQueryResult{ Columns: []string{}, Rows: []map[string]any{}, RowsAffected: 0, - Error: &rpc.SessionFsError{Code: rpc.SessionFsErrorCodeUNKNOWN, Message: &msg}, + Error: &rpc.SessionFSError{Code: rpc.SessionFSErrorCodeUNKNOWN, Message: &msg}, }, nil } result, err := sp.SqliteQuery(request.QueryType, request.Query, request.Params) if err != nil { - return &rpc.SessionFsSqliteQueryResult{ + return &rpc.SessionFSSqliteQueryResult{ Columns: []string{}, Rows: []map[string]any{}, RowsAffected: 0, - Error: toSessionFsError(err), + Error: toSessionFSError(err), }, nil } if result == nil { - return &rpc.SessionFsSqliteQueryResult{ + return &rpc.SessionFSSqliteQueryResult{ Columns: []string{}, Rows: []map[string]any{}, RowsAffected: 0, @@ -222,7 +222,7 @@ func (a *sessionFsAdapter) SqliteQuery(request *rpc.SessionFsSqliteQueryRequest) rowid := *result.LastInsertRowid wireRowid = &rowid } - return &rpc.SessionFsSqliteQueryResult{ + return &rpc.SessionFSSqliteQueryResult{ Columns: result.Columns, Rows: result.Rows, RowsAffected: result.RowsAffected, @@ -230,23 +230,23 @@ func (a *sessionFsAdapter) SqliteQuery(request *rpc.SessionFsSqliteQueryRequest) }, nil } -func (a *sessionFsAdapter) SqliteExists(request *rpc.SessionFsSqliteExistsRequest) (*rpc.SessionFsSqliteExistsResult, error) { - sp, ok := a.provider.(SessionFsSqliteProvider) +func (a *sessionFSAdapter) SqliteExists(request *rpc.SessionFSSqliteExistsRequest) (*rpc.SessionFSSqliteExistsResult, error) { + sp, ok := a.provider.(SessionFSSqliteProvider) if !ok { - return &rpc.SessionFsSqliteExistsResult{Exists: false}, nil + return &rpc.SessionFSSqliteExistsResult{Exists: false}, nil } exists, err := sp.SqliteExists() if err != nil { - return &rpc.SessionFsSqliteExistsResult{Exists: false}, nil + return &rpc.SessionFSSqliteExistsResult{Exists: false}, nil } - return &rpc.SessionFsSqliteExistsResult{Exists: exists}, nil + return &rpc.SessionFSSqliteExistsResult{Exists: exists}, nil } -func toSessionFsError(err error) *rpc.SessionFsError { - code := rpc.SessionFsErrorCodeUNKNOWN +func toSessionFSError(err error) *rpc.SessionFSError { + code := rpc.SessionFSErrorCodeUNKNOWN if errors.Is(err, os.ErrNotExist) { - code = rpc.SessionFsErrorCodeENOENT + code = rpc.SessionFSErrorCodeENOENT } msg := err.Error() - return &rpc.SessionFsError{Code: code, Message: &msg} + return &rpc.SessionFSError{Code: code, Message: &msg} } diff --git a/go/session_test.go b/go/session_test.go index b1c36d175..9e95e9a50 100644 --- a/go/session_test.go +++ b/go/session_test.go @@ -119,7 +119,7 @@ func captureSetModelRequest(t *testing.T, opts *SetModelOptions) map[string]any session := &Session{ SessionID: "session-1", client: client, - RPC: rpc.NewSessionRpc(client, "session-1"), + RPC: rpc.NewSessionRPC(client, "session-1"), } if err := session.SetModel(context.Background(), "gpt-4.1", opts); err != nil { t.Fatalf("SetModel failed: %v", err) diff --git a/go/toolset.go b/go/toolset.go index c64e8b7fd..f9b60eccf 100644 --- a/go/toolset.go +++ b/go/toolset.go @@ -69,9 +69,9 @@ func (s *ToolSet) AddCustom(name string) *ToolSet { return s } -// AddMcp adds an MCP tool pattern. Matches tools advertised by any configured +// AddMCP adds an MCP tool pattern. Matches tools advertised by any configured // MCP server. -func (s *ToolSet) AddMcp(toolName string) *ToolSet { +func (s *ToolSet) AddMCP(toolName string) *ToolSet { validateToolName("mcp", toolName) s.items = append(s.items, "mcp:"+toolName) return s diff --git a/go/toolset_test.go b/go/toolset_test.go index babe63502..a865efaa9 100644 --- a/go/toolset_test.go +++ b/go/toolset_test.go @@ -17,8 +17,8 @@ func TestToolSet_emitsSourceQualifiedStrings(t *testing.T) { AddBuiltIn("*"). AddCustom("my_tool"). AddCustom("*"). - AddMcp("github-list_issues"). - AddMcp("*"). + AddMCP("github-list_issues"). + AddMCP("*"). ToSlice() want := []string{ "builtin:bash", @@ -56,7 +56,7 @@ func TestToolSet_rejectsInvalidNames(t *testing.T) { fn func() }{ {"colon in builtin", func() { NewToolSet().AddBuiltIn("has:colon") }}, - {"space in mcp", func() { NewToolSet().AddMcp("has space") }}, + {"space in mcp", func() { NewToolSet().AddMCP("has space") }}, {"empty custom", func() { NewToolSet().AddCustom("") }}, } for _, c := range cases { diff --git a/go/types.go b/go/types.go index 9637ffb08..8da2baa60 100644 --- a/go/types.go +++ b/go/types.go @@ -111,11 +111,11 @@ type ClientOptions struct { // querying the runtime. Useful in BYOK mode to return models available // from your custom provider. OnListModels func(ctx context.Context) ([]ModelInfo, error) - // SessionFs configures a custom session filesystem provider. + // SessionFS configures a custom session filesystem provider. // When provided, the client registers as the session filesystem provider // on connection, routing session-scoped file I/O through per-session // handlers. - SessionFs *SessionFsConfig + SessionFS *SessionFSConfig // Telemetry configures OpenTelemetry integration for the runtime. // When non-nil, COPILOT_OTEL_ENABLED=true is set and any populated // fields are mapped to the corresponding environment variables. @@ -136,7 +136,7 @@ type ClientOptions struct { // multi-tenant safe defaults — see [ClientMode] for details. // // When Mode is [ModeEmpty], NewClient requires either BaseDirectory, - // SessionFs, or a [UriConnection] so the runtime has persistent storage + // SessionFS, or a [UriConnection] so the runtime has persistent storage // for session state. Mode ClientMode } @@ -673,8 +673,8 @@ type ErrorOccurredHookOutput struct { // ErrorOccurredHandler handles error-occurred hook invocations type ErrorOccurredHandler func(input ErrorOccurredHookInput, invocation HookInvocation) (*ErrorOccurredHookOutput, error) -// PreMcpToolCallHookInput is the input for a pre-mcp-tool-call hook -type PreMcpToolCallHookInput struct { +// PreMCPToolCallHookInput is the input for a pre-mcp-tool-call hook +type PreMCPToolCallHookInput struct { SessionID string `json:"sessionId"` Timestamp time.Time `json:"-"` WorkingDirectory string `json:"cwd"` @@ -686,8 +686,8 @@ type PreMcpToolCallHookInput struct { } // MarshalJSON implements json.Marshaler, emitting Timestamp as Unix milliseconds. -func (h PreMcpToolCallHookInput) MarshalJSON() ([]byte, error) { - type alias PreMcpToolCallHookInput +func (h PreMCPToolCallHookInput) MarshalJSON() ([]byte, error) { + type alias PreMCPToolCallHookInput return json.Marshal(&struct { Timestamp int64 `json:"timestamp"` alias @@ -695,8 +695,8 @@ func (h PreMcpToolCallHookInput) MarshalJSON() ([]byte, error) { } // UnmarshalJSON implements json.Unmarshaler, parsing Timestamp from Unix milliseconds. -func (h *PreMcpToolCallHookInput) UnmarshalJSON(data []byte) error { - type alias PreMcpToolCallHookInput +func (h *PreMCPToolCallHookInput) UnmarshalJSON(data []byte) error { + type alias PreMCPToolCallHookInput aux := &struct { Timestamp int64 `json:"timestamp"` *alias @@ -708,13 +708,13 @@ func (h *PreMcpToolCallHookInput) UnmarshalJSON(data []byte) error { return nil } -// PreMcpToolCallHookOutput is the output for a pre-mcp-tool-call hook -type PreMcpToolCallHookOutput struct { +// PreMCPToolCallHookOutput is the output for a pre-mcp-tool-call hook +type PreMCPToolCallHookOutput struct { MetaToUse any `json:"metaToUse"` } -// PreMcpToolCallHandler handles pre-mcp-tool-call hook invocations -type PreMcpToolCallHandler func(input PreMcpToolCallHookInput, invocation HookInvocation) (*PreMcpToolCallHookOutput, error) +// PreMCPToolCallHandler handles pre-mcp-tool-call hook invocations +type PreMCPToolCallHandler func(input PreMCPToolCallHookInput, invocation HookInvocation) (*PreMCPToolCallHookOutput, error) // HookInvocation provides context about a hook invocation type HookInvocation struct { @@ -730,7 +730,7 @@ type SessionHooks struct { OnSessionStart SessionStartHandler OnSessionEnd SessionEndHandler OnErrorOccurred ErrorOccurredHandler - OnPreMcpToolCall PreMcpToolCallHandler + OnPreMCPToolCall PreMCPToolCallHandler } // MCPServerConfig is implemented by MCP server configuration types. @@ -859,23 +859,23 @@ type LargeToolOutputConfig struct { OutputDirectory string `json:"outputDir,omitempty"` } -// SessionFsCapabilities declares optional provider capabilities. -type SessionFsCapabilities struct { +// SessionFSCapabilities declares optional provider capabilities. +type SessionFSCapabilities struct { // Sqlite indicates whether the provider supports SQLite query/exists operations. Sqlite bool } -// SessionFsConfig configures a custom session filesystem provider. -type SessionFsConfig struct { +// SessionFSConfig configures a custom session filesystem provider. +type SessionFSConfig struct { // InitialWorkingDirectory is the initial working directory for sessions. InitialWorkingDirectory string // SessionStatePath is the path within each session's filesystem where the runtime stores // session-scoped files such as events, checkpoints, and temp files. SessionStatePath string // Conventions identifies the path conventions used by this filesystem provider. - Conventions rpc.SessionFsSetProviderConventions + Conventions rpc.SessionFSSetProviderConventions // Capabilities declares optional provider capabilities such as SQLite support. - Capabilities *SessionFsCapabilities + Capabilities *SessionFSCapabilities } // SessionConfig configures a new session @@ -1036,9 +1036,9 @@ type SessionConfig struct { // handler. Equivalent to calling session.On(handler) immediately after creation, // but executes earlier in the lifecycle so no events are missed. OnEvent SessionEventHandler - // CreateSessionFsProvider supplies a handler for session filesystem operations. - // This takes effect only when ClientOptions.SessionFs is configured. - CreateSessionFsProvider func(session *Session) SessionFsProvider + // CreateSessionFSProvider supplies a handler for session filesystem operations. + // This takes effect only when ClientOptions.SessionFS is configured. + CreateSessionFSProvider func(session *Session) SessionFSProvider // Commands registers slash-commands for this session. Each command appears as // /name in the CLI TUI for the user to invoke. The Handler is called when the // command is executed. @@ -1053,9 +1053,9 @@ type SessionConfig struct { // OnAutoModeSwitchRequest is a handler for auto-mode-switch requests from the server. // When provided, enables autoModeSwitch.request callbacks for the session. OnAutoModeSwitchRequest AutoModeSwitchRequestHandler - // EnableMcpApps enables MCP Apps (SEP-1865) UI passthrough on this session. + // EnableMCPApps enables MCP Apps (SEP-1865) UI passthrough on this session. // - // Experimental: EnableMcpApps is part of an experimental wire-protocol + // Experimental: EnableMCPApps is part of an experimental wire-protocol // surface (SEP-1865) and may change or be removed in a future release. // // When true AND the runtime has MCP Apps enabled (via the MCP_APPS feature @@ -1075,7 +1075,7 @@ type SessionConfig struct { // that can display ui:// MCP App bundles. Setting it without a renderer will // cause MCP servers to register UI-enabled tool variants the consumer cannot // display. - EnableMcpApps bool + EnableMCPApps bool // GitHubToken is an optional per-session GitHub token used for authentication. // When provided, the session authenticates as the token's owner instead of // using the global client-level auth. @@ -1097,12 +1097,12 @@ type SessionConfig struct { RequestCanvasRenderer *bool // RequestExtensions asks the host to surface declared canvases as agent-visible extensions. RequestExtensions *bool - // ExtensionSdkPath optionally overrides the bundled `@github/copilot-sdk` drop + // ExtensionSDKPath optionally overrides the bundled `@github/copilot-sdk` drop // injected into extension subprocesses. When set to an absolute path containing // a valid `copilot-sdk/` folder (with `index.js` and `extension.js` at the // root), the host injects the override into every forked extension; invalid or // missing paths fall back to the bundled SDK silently. - ExtensionSdkPath *string + ExtensionSDKPath *string // CanvasHandler receives inbound canvas.open / canvas.close / canvas.action.invoke // requests for this session. The SDK does not maintain a per-canvas registry; // the handler must dispatch on CanvasProviderOpenRequest.CanvasID itself. @@ -1184,15 +1184,15 @@ type SessionCapabilities struct { type UICapabilities struct { // Elicitation indicates whether the host supports interactive elicitation dialogs. Elicitation bool `json:"elicitation,omitempty"` - // McpApps indicates whether the runtime has accepted the session's MCP Apps - // (SEP-1865) opt-in. True when the consumer set EnableMcpApps=true on + // MCPApps indicates whether the runtime has accepted the session's MCP Apps + // (SEP-1865) opt-in. True when the consumer set EnableMCPApps=true on // create/resume AND the runtime's MCP_APPS feature flag (or // COPILOT_MCP_APPS=true env override) is on. Otherwise false, indicating // the runtime silently dropped the opt-in. // - // Experimental: McpApps is part of an experimental wire-protocol surface + // Experimental: MCPApps is part of an experimental wire-protocol surface // (SEP-1865) and may change or be removed in a future release. - McpApps bool `json:"mcpApps,omitempty"` + MCPApps bool `json:"mcpApps,omitempty"` } // ElicitationResult is the user's response to an elicitation dialog. @@ -1226,8 +1226,8 @@ type ElicitationContext struct { // If the handler returns an error the SDK auto-cancels the request. type ElicitationHandler func(ctx ElicitationContext) (ElicitationResult, error) -// UiInputOptions configures a text input field for the Input convenience method. -type UiInputOptions struct { +// UIInputOptions configures a text input field for the Input convenience method. +type UIInputOptions struct { // Title label for the input field. Title string // Description text shown below the field. @@ -1410,9 +1410,9 @@ type ResumeSessionConfig struct { // OnEvent is an optional event handler registered before the session.resume RPC // is issued, ensuring early events are delivered. See SessionConfig.OnEvent. OnEvent SessionEventHandler - // CreateSessionFsProvider supplies a handler for session filesystem operations. - // This takes effect only when ClientOptions.SessionFs is configured. - CreateSessionFsProvider func(session *Session) SessionFsProvider + // CreateSessionFSProvider supplies a handler for session filesystem operations. + // This takes effect only when ClientOptions.SessionFS is configured. + CreateSessionFSProvider func(session *Session) SessionFSProvider // Commands registers slash-commands for this session. See SessionConfig.Commands. Commands []CommandDefinition // OnElicitationRequest is a handler for elicitation requests from the server. @@ -1424,12 +1424,12 @@ type ResumeSessionConfig struct { // OnAutoModeSwitchRequest is a handler for auto-mode-switch requests from the server. // See SessionConfig.OnAutoModeSwitchRequest. OnAutoModeSwitchRequest AutoModeSwitchRequestHandler - // EnableMcpApps enables MCP Apps (SEP-1865) UI passthrough on resume. - // See SessionConfig.EnableMcpApps. + // EnableMCPApps enables MCP Apps (SEP-1865) UI passthrough on resume. + // See SessionConfig.EnableMCPApps. // - // Experimental: EnableMcpApps is part of an experimental wire-protocol + // Experimental: EnableMCPApps is part of an experimental wire-protocol // surface (SEP-1865) and may change or be removed in a future release. - EnableMcpApps bool + EnableMCPApps bool // Canvases declares canvases this session provides. Sent over the wire on // `session.resume`. See SessionConfig.Canvases. Canvases []CanvasDeclaration @@ -1441,9 +1441,9 @@ type ResumeSessionConfig struct { RequestCanvasRenderer *bool // RequestExtensions asks the host to surface declared canvases as agent-visible extensions. RequestExtensions *bool - // ExtensionSdkPath optionally overrides the bundled `@github/copilot-sdk` drop - // injected into extension subprocesses. See SessionConfig.ExtensionSdkPath. - ExtensionSdkPath *string + // ExtensionSDKPath optionally overrides the bundled `@github/copilot-sdk` drop + // injected into extension subprocesses. See SessionConfig.ExtensionSDKPath. + ExtensionSDKPath *string // CanvasHandler receives inbound canvas.* requests for this session. See SessionConfig.CanvasHandler. CanvasHandler CanvasHandler `json:"-"` // ExtensionInfo identifies the stable extension providing this session's canvases. @@ -1452,8 +1452,8 @@ type ResumeSessionConfig struct { type ProviderConfig struct { // Type is the provider type: "openai", "azure", or "anthropic". Defaults to "openai". Type string `json:"type,omitempty"` - // WireApi is the API format (openai/azure only): "completions" or "responses". Defaults to "completions". - WireApi string `json:"wireApi,omitempty"` + // WireAPI is the API format (openai/azure only): "completions" or "responses". Defaults to "completions". + WireAPI string `json:"wireApi,omitempty"` // BaseURL is the API endpoint URL BaseURL string `json:"baseUrl"` // APIKey is the API key. Optional for local providers like Ollama. @@ -1496,7 +1496,7 @@ type AzureProviderOptions struct { // ToolBinaryResult represents binary payloads returned by tools. type ToolBinaryResult struct { Data string `json:"data"` - MimeType string `json:"mimeType"` + MIMEType string `json:"mimeType"` Type string `json:"type"` Description string `json:"description,omitempty"` } @@ -1705,14 +1705,14 @@ type createSessionRequest struct { LargeOutput *LargeToolOutputConfig `json:"largeOutput,omitempty"` Commands []wireCommand `json:"commands,omitempty"` RequestElicitation *bool `json:"requestElicitation,omitempty"` - RequestMcpApps *bool `json:"requestMcpApps,omitempty"` + RequestMCPApps *bool `json:"requestMcpApps,omitempty"` GitHubToken string `json:"gitHubToken,omitempty"` RemoteSession rpc.RemoteSessionMode `json:"remoteSession,omitempty"` Cloud *CloudSessionOptions `json:"cloud,omitempty"` Canvases []CanvasDeclaration `json:"canvases,omitempty"` RequestCanvasRenderer *bool `json:"requestCanvasRenderer,omitempty"` RequestExtensions *bool `json:"requestExtensions,omitempty"` - ExtensionSdkPath *string `json:"extensionSdkPath,omitempty"` + ExtensionSDKPath *string `json:"extensionSdkPath,omitempty"` ExtensionInfo *ExtensionInfo `json:"extensionInfo,omitempty"` Traceparent string `json:"traceparent,omitempty"` Tracestate string `json:"tracestate,omitempty"` @@ -1785,14 +1785,14 @@ type resumeSessionRequest struct { LargeOutput *LargeToolOutputConfig `json:"largeOutput,omitempty"` Commands []wireCommand `json:"commands,omitempty"` RequestElicitation *bool `json:"requestElicitation,omitempty"` - RequestMcpApps *bool `json:"requestMcpApps,omitempty"` + RequestMCPApps *bool `json:"requestMcpApps,omitempty"` GitHubToken string `json:"gitHubToken,omitempty"` RemoteSession rpc.RemoteSessionMode `json:"remoteSession,omitempty"` Canvases []CanvasDeclaration `json:"canvases,omitempty"` OpenCanvases []rpc.OpenCanvasInstance `json:"openCanvases,omitempty"` RequestCanvasRenderer *bool `json:"requestCanvasRenderer,omitempty"` RequestExtensions *bool `json:"requestExtensions,omitempty"` - ExtensionSdkPath *string `json:"extensionSdkPath,omitempty"` + ExtensionSDKPath *string `json:"extensionSdkPath,omitempty"` ExtensionInfo *ExtensionInfo `json:"extensionInfo,omitempty"` Traceparent string `json:"traceparent,omitempty"` Tracestate string `json:"tracestate,omitempty"` diff --git a/go/zsession_events.go b/go/zsession_events.go index bfa9f0120..70ce3e6d5 100644 --- a/go/zsession_events.go +++ b/go/zsession_events.go @@ -29,8 +29,8 @@ type ( AttachmentExtensionContext = rpc.AttachmentExtensionContext AttachmentFile = rpc.AttachmentFile AttachmentFileLineRange = rpc.AttachmentFileLineRange - AttachmentGithubReference = rpc.AttachmentGithubReference - AttachmentGithubReferenceType = rpc.AttachmentGithubReferenceType + AttachmentGitHubReference = rpc.AttachmentGitHubReference + AttachmentGitHubReferenceType = rpc.AttachmentGitHubReferenceType AttachmentSelection = rpc.AttachmentSelection AttachmentSelectionDetails = rpc.AttachmentSelectionDetails AttachmentSelectionDetailsEnd = rpc.AttachmentSelectionDetailsEnd @@ -83,18 +83,18 @@ type ( HookEndError = rpc.HookEndError HookProgressData = rpc.HookProgressData HookStartData = rpc.HookStartData - McpAppToolCallCompleteData = rpc.McpAppToolCallCompleteData - McpAppToolCallCompleteError = rpc.McpAppToolCallCompleteError - McpAppToolCallCompleteToolMeta = rpc.McpAppToolCallCompleteToolMeta - McpAppToolCallCompleteToolMetaUI = rpc.McpAppToolCallCompleteToolMetaUI - McpOauthCompletedData = rpc.McpOauthCompletedData - McpOauthRequiredData = rpc.McpOauthRequiredData - McpOauthRequiredStaticClientConfig = rpc.McpOauthRequiredStaticClientConfig - McpOauthRequiredStaticClientConfigGrantType = rpc.McpOauthRequiredStaticClientConfigGrantType - McpServersLoadedServer = rpc.McpServersLoadedServer - McpServerSource = rpc.McpServerSource - McpServerStatus = rpc.McpServerStatus - McpServerTransport = rpc.McpServerTransport + MCPAppToolCallCompleteData = rpc.MCPAppToolCallCompleteData + MCPAppToolCallCompleteError = rpc.MCPAppToolCallCompleteError + MCPAppToolCallCompleteToolMeta = rpc.MCPAppToolCallCompleteToolMeta + MCPAppToolCallCompleteToolMetaUI = rpc.MCPAppToolCallCompleteToolMetaUI + MCPOauthCompletedData = rpc.MCPOauthCompletedData + MCPOauthRequiredData = rpc.MCPOauthRequiredData + MCPOauthRequiredStaticClientConfig = rpc.MCPOauthRequiredStaticClientConfig + MCPOauthRequiredStaticClientConfigGrantType = rpc.MCPOauthRequiredStaticClientConfigGrantType + MCPServersLoadedServer = rpc.MCPServersLoadedServer + MCPServerSource = rpc.MCPServerSource + MCPServerStatus = rpc.MCPServerStatus + MCPServerTransport = rpc.MCPServerTransport ModelCallFailureData = rpc.ModelCallFailureData ModelCallFailureSource = rpc.ModelCallFailureSource PendingMessagesModifiedData = rpc.PendingMessagesModifiedData @@ -115,7 +115,7 @@ type ( PermissionPromptRequestExtensionPermissionAccess = rpc.PermissionPromptRequestExtensionPermissionAccess PermissionPromptRequestHook = rpc.PermissionPromptRequestHook PermissionPromptRequestKind = rpc.PermissionPromptRequestKind - PermissionPromptRequestMcp = rpc.PermissionPromptRequestMcp + PermissionPromptRequestMCP = rpc.PermissionPromptRequestMCP PermissionPromptRequestMemory = rpc.PermissionPromptRequestMemory PermissionPromptRequestPath = rpc.PermissionPromptRequestPath PermissionPromptRequestPathAccessKind = rpc.PermissionPromptRequestPathAccessKind @@ -130,7 +130,7 @@ type ( PermissionRequestExtensionPermissionAccess = rpc.PermissionRequestExtensionPermissionAccess PermissionRequestHook = rpc.PermissionRequestHook PermissionRequestKind = rpc.PermissionRequestKind - PermissionRequestMcp = rpc.PermissionRequestMcp + PermissionRequestMCP = rpc.PermissionRequestMCP PermissionRequestMemory = rpc.PermissionRequestMemory PermissionRequestMemoryAction = rpc.PermissionRequestMemoryAction PermissionRequestMemoryDirection = rpc.PermissionRequestMemoryDirection @@ -172,8 +172,8 @@ type ( SessionHandoffData = rpc.SessionHandoffData SessionIdleData = rpc.SessionIdleData SessionInfoData = rpc.SessionInfoData - SessionMcpServersLoadedData = rpc.SessionMcpServersLoadedData - SessionMcpServerStatusChangedData = rpc.SessionMcpServerStatusChangedData + SessionMCPServersLoadedData = rpc.SessionMCPServersLoadedData + SessionMCPServerStatusChangedData = rpc.SessionMCPServerStatusChangedData SessionMode = rpc.SessionMode SessionModeChangedData = rpc.SessionModeChangedData SessionModelChangeData = rpc.SessionModelChangeData @@ -264,7 +264,7 @@ type ( UserToolSessionApprovalExtensionManagement = rpc.UserToolSessionApprovalExtensionManagement UserToolSessionApprovalExtensionPermissionAccess = rpc.UserToolSessionApprovalExtensionPermissionAccess UserToolSessionApprovalKind = rpc.UserToolSessionApprovalKind - UserToolSessionApprovalMcp = rpc.UserToolSessionApprovalMcp + UserToolSessionApprovalMCP = rpc.UserToolSessionApprovalMCP UserToolSessionApprovalMemory = rpc.UserToolSessionApprovalMemory UserToolSessionApprovalRead = rpc.UserToolSessionApprovalRead UserToolSessionApprovalWrite = rpc.UserToolSessionApprovalWrite @@ -284,14 +284,14 @@ const ( AssistantUsageAPIEndpointResponses = rpc.AssistantUsageAPIEndpointResponses AssistantUsageAPIEndpointV1Messages = rpc.AssistantUsageAPIEndpointV1Messages AssistantUsageAPIEndpointWsResponses = rpc.AssistantUsageAPIEndpointWsResponses - AttachmentGithubReferenceTypeDiscussion = rpc.AttachmentGithubReferenceTypeDiscussion - AttachmentGithubReferenceTypeIssue = rpc.AttachmentGithubReferenceTypeIssue - AttachmentGithubReferenceTypePr = rpc.AttachmentGithubReferenceTypePr + AttachmentGitHubReferenceTypeDiscussion = rpc.AttachmentGitHubReferenceTypeDiscussion + AttachmentGitHubReferenceTypeIssue = rpc.AttachmentGitHubReferenceTypeIssue + AttachmentGitHubReferenceTypePr = rpc.AttachmentGitHubReferenceTypePr AttachmentTypeBlob = rpc.AttachmentTypeBlob AttachmentTypeDirectory = rpc.AttachmentTypeDirectory AttachmentTypeExtensionContext = rpc.AttachmentTypeExtensionContext AttachmentTypeFile = rpc.AttachmentTypeFile - AttachmentTypeGithubReference = rpc.AttachmentTypeGithubReference + AttachmentTypeGitHubReference = rpc.AttachmentTypeGitHubReference AttachmentTypeSelection = rpc.AttachmentTypeSelection AutoModeSwitchResponseNo = rpc.AutoModeSwitchResponseNo AutoModeSwitchResponseYes = rpc.AutoModeSwitchResponseYes @@ -325,22 +325,22 @@ const ( ExtensionsLoadedExtensionStatusStarting = rpc.ExtensionsLoadedExtensionStatusStarting HandoffSourceTypeLocal = rpc.HandoffSourceTypeLocal HandoffSourceTypeRemote = rpc.HandoffSourceTypeRemote - McpOauthRequiredStaticClientConfigGrantTypeClientCredentials = rpc.McpOauthRequiredStaticClientConfigGrantTypeClientCredentials - McpServerSourceBuiltin = rpc.McpServerSourceBuiltin - McpServerSourcePlugin = rpc.McpServerSourcePlugin - McpServerSourceUser = rpc.McpServerSourceUser - McpServerSourceWorkspace = rpc.McpServerSourceWorkspace - McpServerStatusConnected = rpc.McpServerStatusConnected - McpServerStatusDisabled = rpc.McpServerStatusDisabled - McpServerStatusFailed = rpc.McpServerStatusFailed - McpServerStatusNeedsAuth = rpc.McpServerStatusNeedsAuth - McpServerStatusNotConfigured = rpc.McpServerStatusNotConfigured - McpServerStatusPending = rpc.McpServerStatusPending - McpServerTransportHTTP = rpc.McpServerTransportHTTP - McpServerTransportMemory = rpc.McpServerTransportMemory - McpServerTransportSse = rpc.McpServerTransportSse - McpServerTransportStdio = rpc.McpServerTransportStdio - ModelCallFailureSourceMcpSampling = rpc.ModelCallFailureSourceMcpSampling + MCPOauthRequiredStaticClientConfigGrantTypeClientCredentials = rpc.MCPOauthRequiredStaticClientConfigGrantTypeClientCredentials + MCPServerSourceBuiltin = rpc.MCPServerSourceBuiltin + MCPServerSourcePlugin = rpc.MCPServerSourcePlugin + MCPServerSourceUser = rpc.MCPServerSourceUser + MCPServerSourceWorkspace = rpc.MCPServerSourceWorkspace + MCPServerStatusConnected = rpc.MCPServerStatusConnected + MCPServerStatusDisabled = rpc.MCPServerStatusDisabled + MCPServerStatusFailed = rpc.MCPServerStatusFailed + MCPServerStatusNeedsAuth = rpc.MCPServerStatusNeedsAuth + MCPServerStatusNotConfigured = rpc.MCPServerStatusNotConfigured + MCPServerStatusPending = rpc.MCPServerStatusPending + MCPServerTransportHTTP = rpc.MCPServerTransportHTTP + MCPServerTransportMemory = rpc.MCPServerTransportMemory + MCPServerTransportSSE = rpc.MCPServerTransportSSE + MCPServerTransportStdio = rpc.MCPServerTransportStdio + ModelCallFailureSourceMCPSampling = rpc.ModelCallFailureSourceMCPSampling ModelCallFailureSourceSubagent = rpc.ModelCallFailureSourceSubagent ModelCallFailureSourceTopLevel = rpc.ModelCallFailureSourceTopLevel PermissionPromptRequestKindCommands = rpc.PermissionPromptRequestKindCommands @@ -348,7 +348,7 @@ const ( PermissionPromptRequestKindExtensionManagement = rpc.PermissionPromptRequestKindExtensionManagement PermissionPromptRequestKindExtensionPermissionAccess = rpc.PermissionPromptRequestKindExtensionPermissionAccess PermissionPromptRequestKindHook = rpc.PermissionPromptRequestKindHook - PermissionPromptRequestKindMcp = rpc.PermissionPromptRequestKindMcp + PermissionPromptRequestKindMCP = rpc.PermissionPromptRequestKindMCP PermissionPromptRequestKindMemory = rpc.PermissionPromptRequestKindMemory PermissionPromptRequestKindPath = rpc.PermissionPromptRequestKindPath PermissionPromptRequestKindRead = rpc.PermissionPromptRequestKindRead @@ -361,7 +361,7 @@ const ( PermissionRequestKindExtensionManagement = rpc.PermissionRequestKindExtensionManagement PermissionRequestKindExtensionPermissionAccess = rpc.PermissionRequestKindExtensionPermissionAccess PermissionRequestKindHook = rpc.PermissionRequestKindHook - PermissionRequestKindMcp = rpc.PermissionRequestKindMcp + PermissionRequestKindMCP = rpc.PermissionRequestKindMCP PermissionRequestKindMemory = rpc.PermissionRequestKindMemory PermissionRequestKindRead = rpc.PermissionRequestKindRead PermissionRequestKindShell = rpc.PermissionRequestKindShell @@ -413,9 +413,9 @@ const ( SessionEventTypeHookEnd = rpc.SessionEventTypeHookEnd SessionEventTypeHookProgress = rpc.SessionEventTypeHookProgress SessionEventTypeHookStart = rpc.SessionEventTypeHookStart - SessionEventTypeMcpAppToolCallComplete = rpc.SessionEventTypeMcpAppToolCallComplete - SessionEventTypeMcpOauthCompleted = rpc.SessionEventTypeMcpOauthCompleted - SessionEventTypeMcpOauthRequired = rpc.SessionEventTypeMcpOauthRequired + SessionEventTypeMCPAppToolCallComplete = rpc.SessionEventTypeMCPAppToolCallComplete + SessionEventTypeMCPOauthCompleted = rpc.SessionEventTypeMCPOauthCompleted + SessionEventTypeMCPOauthRequired = rpc.SessionEventTypeMCPOauthRequired SessionEventTypeModelCallFailure = rpc.SessionEventTypeModelCallFailure SessionEventTypePendingMessagesModified = rpc.SessionEventTypePendingMessagesModified SessionEventTypePermissionCompleted = rpc.SessionEventTypePermissionCompleted @@ -437,8 +437,8 @@ const ( SessionEventTypeSessionHandoff = rpc.SessionEventTypeSessionHandoff SessionEventTypeSessionIdle = rpc.SessionEventTypeSessionIdle SessionEventTypeSessionInfo = rpc.SessionEventTypeSessionInfo - SessionEventTypeSessionMcpServersLoaded = rpc.SessionEventTypeSessionMcpServersLoaded - SessionEventTypeSessionMcpServerStatusChanged = rpc.SessionEventTypeSessionMcpServerStatusChanged + SessionEventTypeSessionMCPServersLoaded = rpc.SessionEventTypeSessionMCPServersLoaded + SessionEventTypeSessionMCPServerStatusChanged = rpc.SessionEventTypeSessionMCPServerStatusChanged SessionEventTypeSessionModeChanged = rpc.SessionEventTypeSessionModeChanged SessionEventTypeSessionModelChange = rpc.SessionEventTypeSessionModelChange SessionEventTypeSessionPermissionsChanged = rpc.SessionEventTypeSessionPermissionsChanged @@ -517,12 +517,12 @@ const ( UserToolSessionApprovalKindCustomTool = rpc.UserToolSessionApprovalKindCustomTool UserToolSessionApprovalKindExtensionManagement = rpc.UserToolSessionApprovalKindExtensionManagement UserToolSessionApprovalKindExtensionPermissionAccess = rpc.UserToolSessionApprovalKindExtensionPermissionAccess - UserToolSessionApprovalKindMcp = rpc.UserToolSessionApprovalKindMcp + UserToolSessionApprovalKindMCP = rpc.UserToolSessionApprovalKindMCP UserToolSessionApprovalKindMemory = rpc.UserToolSessionApprovalKindMemory UserToolSessionApprovalKindRead = rpc.UserToolSessionApprovalKindRead UserToolSessionApprovalKindWrite = rpc.UserToolSessionApprovalKindWrite - WorkingDirectoryContextHostTypeAdo = rpc.WorkingDirectoryContextHostTypeAdo - WorkingDirectoryContextHostTypeGithub = rpc.WorkingDirectoryContextHostTypeGithub + WorkingDirectoryContextHostTypeADO = rpc.WorkingDirectoryContextHostTypeADO + WorkingDirectoryContextHostTypeGitHub = rpc.WorkingDirectoryContextHostTypeGitHub WorkspaceFileChangedOperationCreate = rpc.WorkspaceFileChangedOperationCreate WorkspaceFileChangedOperationUpdate = rpc.WorkspaceFileChangedOperationUpdate ) diff --git a/scripts/codegen/go.ts b/scripts/codegen/go.ts index 7b253f21c..42a37b8bd 100644 --- a/scripts/codegen/go.ts +++ b/scripts/codegen/go.ts @@ -15,17 +15,17 @@ import { promisify } from "util"; import wordwrap from "wordwrap"; import { cloneSchemaForCodegen, - collectExternalSchemaRefNames, collectDefinitionCollections, collectExperimentalOnlyRpcReferencedDefinitionNames, + collectExternalSchemaRefNames, collectReachableDefinitionNames, collectRpcMethodReferencedDefinitionNames, filterNodeByVisibility, - fixNullableRequiredRefsInApiSchema, findSharedSchemaDefinitions, + fixNullableRequiredRefsInApiSchema, getApiSchemaPath, - getNullableInner, getEnumValueDescriptions, + getNullableInner, getRpcSchemaTypeName, getSessionEventsSchemaPath, getSessionEventVariantSchemas, @@ -44,10 +44,10 @@ import { postProcessSchema, propagateInternalVisibility, refTypeName, + REPO_ROOT, resolveObjectSchema, resolveRef, resolveSchema, - REPO_ROOT, rewriteSharedDefinitionReferences, writeGeneratedFile, type ApiSchema, @@ -73,15 +73,29 @@ const EXTERNAL_SCHEMA_GO_IMPORT: Record = { // ── Utilities ─────────────────────────────────────────────────────────────── // Go initialisms that should be all-caps -const goInitialisms = new Set(["id", "ui", "uri", "url", "api", "http", "https", "json", "xml", "html", "css", "sql", "ssh", "tcp", "udp", "ip", "rpc", "mime"]); +const goInitialisms = new Set(["id", "ui", "uri", "url", "api", "http", "https", "json", "xml", "html", "css", "sql", "ssh", "tcp", "udp", "ip", "rpc", "mime", "mcp", "sse", "ado", "cli", "gh", "hmac", "fs", "utc", "sdk"]); +const goIdentifierCasingOverrides = new Map([ + ["github", "GitHub"], + ["urls", "URLs"], + ["uris", "URIs"], + ["ids", "IDs"], +]); const goCommentTextWrapLength = 90; const wrapGoCommentText = wordwrap(goCommentTextWrapLength); +function goIdentifierWord(word: string, normalizeRest = false): string { + const lower = word.toLowerCase(); + const override = goIdentifierCasingOverrides.get(lower); + if (override) return override; + if (goInitialisms.has(lower)) return word.toUpperCase(); + return word.charAt(0).toUpperCase() + (normalizeRest ? word.slice(1).toLowerCase() : word.slice(1)); +} + function toPascalCase(s: string): string { return s .split(/[^A-Za-z0-9]+/) .filter((word) => word.length > 0) - .map((w) => goInitialisms.has(w.toLowerCase()) ? w.toUpperCase() : w.charAt(0).toUpperCase() + w.slice(1)) + .map((w) => goIdentifierWord(w)) .join(""); } @@ -96,7 +110,7 @@ function toGoSchemaTypeName(s: string): string { function toGoFieldName(jsonName: string): string { // Handle camelCase field names like "modelId" -> "ModelID" return splitGoIdentifierWords(jsonName) - .map((w) => goInitialisms.has(w.toLowerCase()) ? w.toUpperCase() : w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()) + .map((w) => goIdentifierWord(w, true)) .join(""); } @@ -738,11 +752,7 @@ function getOrCreateGoEnum( function goEnumConstSuffix(value: string): string { const suffix = splitGoIdentifierWords(value) - .map((word) => - goInitialisms.has(word.toLowerCase()) - ? word.toUpperCase() - : word.charAt(0).toUpperCase() + word.slice(1) - ) + .map((word) => goIdentifierWord(word)) .join(""); return suffix || "Value"; } @@ -3133,11 +3143,7 @@ export function generateGoSessionEventsCode( lines.push(``); const constName = "SessionEventType" + variant.typeName .split(/[._]/) - .map((w) => - goInitialisms.has(w.toLowerCase()) - ? w.toUpperCase() - : w.charAt(0).toUpperCase() + w.slice(1) - ) + .map((w) => goIdentifierWord(w)) .join(""); lines.push(`func (*${variant.dataClassName}) sessionEventData() {}`); lines.push(`func (*${variant.dataClassName}) Type() SessionEventType { return ${constName} }`); @@ -3155,11 +3161,7 @@ export function generateGoSessionEventsCode( .map((variant) => ({ constName: "SessionEventType" + variant.typeName .split(/[._]/) - .map((w) => - goInitialisms.has(w.toLowerCase()) - ? w.toUpperCase() - : w.charAt(0).toUpperCase() + w.slice(1) - ) + .map((w) => goIdentifierWord(w)) .join(""), typeName: variant.typeName, })) @@ -3226,11 +3228,7 @@ export function generateGoSessionEventsCode( .map((variant) => ({ constName: "SessionEventType" + variant.typeName .split(/[._]/) - .map((w) => - goInitialisms.has(w.toLowerCase()) - ? w.toUpperCase() - : w.charAt(0).toUpperCase() + w.slice(1) - ) + .map((w) => goIdentifierWord(w)) .join(""), dataClassName: variant.dataClassName, })) @@ -3978,15 +3976,15 @@ function emitApiGroup( } for (const [subGroupName, subGroupNode] of subGroups) { - const subApiName = apiName.replace(/Api$/, "") + toPascalCase(subGroupName) + "Api"; + const subApiName = apiName.replace(/API$/, "") + toGoFieldName(subGroupName) + "API"; const subGroupExperimental = isNodeFullyExperimental(subGroupNode as Record); const subGroupDeprecated = isNodeFullyDeprecated(subGroupNode as Record); emitApiGroup(lines, subApiName, subGroupNode as Record, isSession, serviceName, resolveType, fields, unionInfos, subGroupExperimental, subGroupDeprecated); if (subGroupExperimental) { - pushGoExperimentalSubApiComment(lines, toPascalCase(subGroupName)); + pushGoExperimentalSubApiComment(lines, toGoFieldName(subGroupName)); } - lines.push(`func (s *${apiName}) ${toPascalCase(subGroupName)}() *${subApiName} {`); + lines.push(`func (s *${apiName}) ${toGoFieldName(subGroupName)}() *${subApiName} {`); lines.push(`\treturn (*${subApiName})(s)`); lines.push(`}`); lines.push(``); @@ -3997,13 +3995,13 @@ function emitRpcWrapper(lines: string[], node: Record, isSessio const groups = sortByPascalName(Object.entries(node).filter(([, v]) => typeof v === "object" && v !== null && !isRpcMethod(v))); const topLevelMethods = sortByPascalName(Object.entries(node).filter(([, v]) => isRpcMethod(v))); - const wrapperName = classPrefix + (isSession ? "SessionRpc" : "ServerRpc"); - const apiSuffix = "Api"; + const wrapperName = classPrefix + (isSession ? "SessionRPC" : "ServerRPC"); + const apiSuffix = "API"; // Lowercase the prefix so the unexported service struct stays unexported in Go. const prefixLower = classPrefix ? classPrefix.charAt(0).toLowerCase() + classPrefix.slice(1) : ""; const serviceName = prefixLower - ? prefixLower + (isSession ? "SessionApi" : "ServerApi") - : (isSession ? "sessionApi" : "serverApi"); + ? prefixLower + (isSession ? "SessionAPI" : "ServerAPI") + : (isSession ? "sessionAPI" : "serverAPI"); // Emit the common service struct (unexported, shared by all API groups via type cast) lines.push(`type ${serviceName} struct {`); @@ -4015,14 +4013,14 @@ function emitRpcWrapper(lines: string[], node: Record, isSessio // Emit API types for groups for (const [groupName, groupNode] of groups) { const prefix = classPrefix + (isSession ? "" : "Server"); - const apiName = prefix + toPascalCase(groupName) + apiSuffix; + const apiName = prefix + toGoFieldName(groupName) + apiSuffix; const groupExperimental = isNodeFullyExperimental(groupNode as Record); const groupDeprecated = isNodeFullyDeprecated(groupNode as Record); emitApiGroup(lines, apiName, groupNode as Record, isSession, serviceName, resolveType, fields, unionInfos, groupExperimental, groupDeprecated); } // Compute field name lengths for gofmt-compatible column alignment - const groupPascalNames = groups.map(([g]) => toPascalCase(g)); + const groupPascalNames = groups.map(([g]) => toGoFieldName(g)); const allFieldNames = ["common", ...groupPascalNames]; const maxFieldLen = Math.max(...allFieldNames.map((n) => n.length)); const pad = (name: string) => name.padEnd(maxFieldLen); @@ -4040,7 +4038,7 @@ function emitRpcWrapper(lines: string[], node: Record, isSessio lines.push(``); for (const [groupName] of groups) { const prefix = classPrefix + (isSession ? "" : "Server"); - lines.push(`\t${pad(toPascalCase(groupName))} *${prefix}${toPascalCase(groupName)}${apiSuffix}`); + lines.push(`\t${pad(toGoFieldName(groupName))} *${prefix}${toGoFieldName(groupName)}${apiSuffix}`); } lines.push(`}`); lines.push(``); @@ -4062,7 +4060,7 @@ function emitRpcWrapper(lines: string[], node: Record, isSessio } for (const [groupName] of groups) { const prefix = classPrefix + (isSession ? "" : "Server"); - lines.push(`\tr.${toPascalCase(groupName)} = (*${prefix}${toPascalCase(groupName)}${apiSuffix})(&r.common)`); + lines.push(`\tr.${toGoFieldName(groupName)} = (*${prefix}${toGoFieldName(groupName)}${apiSuffix})(&r.common)`); } lines.push(`\treturn r`); lines.push(`}`); @@ -4192,7 +4190,7 @@ function collectClientGroups(node: Record): ClientGroup[] { } function clientHandlerInterfaceName(groupName: string): string { - return `${toPascalCase(groupName)}Handler`; + return `${toGoFieldName(groupName)}Handler`; } function clientHandlerMethodName(rpcMethod: string): string { @@ -4247,10 +4245,10 @@ function emitClientSessionApiRegistration(lines: string[], clientSchema: Record< lines.push(``); } - lines.push(`// ClientSessionApiHandlers provides all client session API handler groups for a session.`); - lines.push(`type ClientSessionApiHandlers struct {`); + lines.push(`// ClientSessionAPIHandlers provides all client session API handler groups for a session.`); + lines.push(`type ClientSessionAPIHandlers struct {`); for (const { groupName } of groups) { - lines.push(`\t${toPascalCase(groupName)} ${clientHandlerInterfaceName(groupName)}`); + lines.push(`\t${toGoFieldName(groupName)} ${clientHandlerInterfaceName(groupName)}`); } lines.push(`}`); lines.push(``); @@ -4267,10 +4265,10 @@ function emitClientSessionApiRegistration(lines: string[], clientSchema: Record< lines.push(`}`); lines.push(``); - lines.push(`// RegisterClientSessionApiHandlers registers handlers for server-to-client session API calls.`); - lines.push(`func RegisterClientSessionApiHandlers(client *jsonrpc2.Client, getHandlers func(sessionID string) *ClientSessionApiHandlers) {`); + lines.push(`// RegisterClientSessionAPIHandlers registers handlers for server-to-client session API calls.`); + lines.push(`func RegisterClientSessionAPIHandlers(client *jsonrpc2.Client, getHandlers func(sessionID string) *ClientSessionAPIHandlers) {`); for (const { groupName, methods } of groups) { - const handlerField = toPascalCase(groupName); + const handlerField = toGoFieldName(groupName); for (const method of methods) { const paramsType = resolveType(goParamsTypeName(method)); lines.push(`\tclient.SetRequestHandler("${method.rpcMethod}", func(params json.RawMessage) (json.RawMessage, *jsonrpc2.Error) {`); From 1fd8ebb67b839e595e6aefcf34451fab0f5452e1 Mon Sep 17 00:00:00 2001 From: qmuntal Date: Mon, 1 Jun 2026 11:58:14 +0200 Subject: [PATCH 2/5] replace UriConnection for URIConnection --- go/README.md | 8 ++-- go/client.go | 16 ++++---- go/client_test.go | 40 +++++++++---------- go/internal/e2e/client_options_e2e_test.go | 8 ++-- .../e2e/commands_and_elicitation_e2e_test.go | 6 +-- go/internal/e2e/connection_token_test.go | 4 +- go/internal/e2e/multi_client_e2e_test.go | 4 +- .../e2e/pending_work_resume_e2e_test.go | 24 +++++------ go/internal/e2e/session_fs_e2e_test.go | 2 +- go/internal/e2e/suspend_e2e_test.go | 4 +- go/internal/e2e/testharness/context.go | 2 +- go/mode_empty.go | 8 ++-- go/toolset_test.go | 4 +- go/types.go | 16 ++++---- 14 files changed, 73 insertions(+), 73 deletions(-) diff --git a/go/README.md b/go/README.md index 2ff4404a3..64eefe437 100644 --- a/go/README.md +++ b/go/README.md @@ -137,16 +137,16 @@ Event types: `SessionLifecycleCreated`, `SessionLifecycleDeleted`, `SessionLifec - `Connection` (RuntimeConnection): How the SDK connects to the runtime. Construct via one of: - `StdioConnection{Path, Args}` — spawn a runtime over stdio (the default if `Connection` is nil) - `TcpConnection{Port, ConnectionToken, Path, Args}` — spawn a runtime that listens on TCP - - `UriConnection{URL, ConnectionToken}` — connect to an already-running runtime (no process spawned) + - `URIConnection{URL, ConnectionToken}` — connect to an already-running runtime (no process spawned) When `Path` is empty for stdio/tcp, the SDK uses the bundled CLI (or `COPILOT_CLI_PATH` env var). - `WorkingDirectory` (string): Working directory for the runtime process -- `BaseDirectory` (string): Base directory for Copilot data (session state, config, etc.). Sets `COPILOT_HOME` on the spawned runtime. When empty, the runtime defaults to `~/.copilot`. Ignored with `UriConnection`. This does **not** affect where the Go SDK extracts the embedded CLI binary; use `embeddedcli.Config.Dir` for the extraction/cache location. +- `BaseDirectory` (string): Base directory for Copilot data (session state, config, etc.). Sets `COPILOT_HOME` on the spawned runtime. When empty, the runtime defaults to `~/.copilot`. Ignored with `URIConnection`. This does **not** affect where the Go SDK extracts the embedded CLI binary; use `embeddedcli.Config.Dir` for the extraction/cache location. - `LogLevel` (string): Log level. When empty (default), the runtime uses its own default level (the SDK does not pass `--log-level`). - `Env` ([]string): Environment variables for the runtime process (default: inherits from current process) - `GitHubToken` (string): GitHub token for authentication. When provided, takes priority over other auth methods. -- `UseLoggedInUser` (\*bool): Whether to use logged-in user for authentication (default: true, but false when `GitHubToken` is provided). Cannot be used with `UriConnection`. -- `EnableRemoteSessions` (bool): Enable remote session support (Mission Control integration). Ignored with `UriConnection`. +- `UseLoggedInUser` (\*bool): Whether to use logged-in user for authentication (default: true, but false when `GitHubToken` is provided). Cannot be used with `URIConnection`. +- `EnableRemoteSessions` (bool): Enable remote session support (Mission Control integration). Ignored with `URIConnection`. - `Telemetry` (\*TelemetryConfig): OpenTelemetry configuration for the runtime. Providing this enables telemetry — no separate flag needed. See [Telemetry](#telemetry) below. **SessionConfig:** diff --git a/go/client.go b/go/client.go index ca26dcbc0..7c0ce0481 100644 --- a/go/client.go +++ b/go/client.go @@ -80,7 +80,7 @@ func validateSessionFSConfig(config *SessionFSConfig) error { // // // Or connect to an existing server // client := copilot.NewClient(&copilot.ClientOptions{ -// Connection: copilot.UriConnection{URL: "localhost:3000"}, +// Connection: copilot.URIConnection{URL: "localhost:3000"}, // }) // // if err := client.Start(); err != nil { @@ -99,7 +99,7 @@ type Client struct { isExternalServer bool conn net.Conn // stores net.Conn for external TCP connections useStdio bool // resolved value from options - // resolved process options for the spawned runtime (zero values for UriConnection) + // resolved process options for the spawned runtime (zero values for URIConnection) cliPath string cliArgs []string port int @@ -150,7 +150,7 @@ type Client struct { // // // Connect to an already-running runtime // client := copilot.NewClient(&copilot.ClientOptions{ -// Connection: copilot.UriConnection{URL: "localhost:8080"}, +// Connection: copilot.URIConnection{URL: "localhost:8080"}, // }) func NewClient(options *ClientOptions) *Client { opts := ClientOptions{} @@ -188,9 +188,9 @@ func NewClient(options *ClientOptions) *Client { } client.port = conn.Port client.tcpConnectionToken = conn.ConnectionToken - case UriConnection: + case URIConnection: if conn.URL == "" { - panic("UriConnection requires a non-empty URL") + panic("URIConnection requires a non-empty URL") } host, port := parseCLIURL(conn.URL) client.actualHost = host @@ -204,7 +204,7 @@ func NewClient(options *ClientOptions) *Client { // Validate auth options when connecting to an external runtime. if client.isExternalServer && (opts.GitHubToken != "" || opts.UseLoggedInUser != nil) { - panic("GitHubToken and UseLoggedInUser cannot be used with UriConnection (external runtime manages its own auth)") + panic("GitHubToken and UseLoggedInUser cannot be used with URIConnection (external runtime manages its own auth)") } // Default Env to current environment if not set @@ -293,7 +293,7 @@ func parseCLIURL(url string) (string, int) { // Validate port port, err := strconv.Atoi(portStr) if err != nil || port <= 0 || port > 65535 { - panic(fmt.Sprintf("Invalid port in CLI URL: %s", url)) + panic(fmt.Sprintf("Invalid port in URIConnection: %s", url)) } return host, port @@ -302,7 +302,7 @@ func parseCLIURL(url string) (string, int) { // Start starts the CLI server (if not using an external server) and establishes // a connection. // -// If connecting to an external server (via UriConnection), only establishes the connection. +// If connecting to an external server (via URIConnection), only establishes the connection. // Otherwise, spawns the CLI server process and then connects. // // This method is called automatically when creating a session if AutoStart is true (default). diff --git a/go/client_test.go b/go/client_test.go index 74f36b9ee..1335783df 100644 --- a/go/client_test.go +++ b/go/client_test.go @@ -22,7 +22,7 @@ import ( func TestClient_URLParsing(t *testing.T) { t.Run("should parse port-only URL format", func(t *testing.T) { client := NewClient(&ClientOptions{ - Connection: UriConnection{URL: "8080"}, + Connection: URIConnection{URL: "8080"}, }) if client.actualPort != 8080 { t.Errorf("Expected port 8080, got %d", client.actualPort) @@ -37,7 +37,7 @@ func TestClient_URLParsing(t *testing.T) { t.Run("should parse host:port URL format", func(t *testing.T) { client := NewClient(&ClientOptions{ - Connection: UriConnection{URL: "127.0.0.1:9000"}, + Connection: URIConnection{URL: "127.0.0.1:9000"}, }) if client.actualPort != 9000 || client.actualHost != "127.0.0.1" { t.Errorf("Expected 127.0.0.1:9000, got %s:%d", client.actualHost, client.actualPort) @@ -46,7 +46,7 @@ func TestClient_URLParsing(t *testing.T) { t.Run("should parse http://host:port URL format", func(t *testing.T) { client := NewClient(&ClientOptions{ - Connection: UriConnection{URL: "http://localhost:7000"}, + Connection: URIConnection{URL: "http://localhost:7000"}, }) if client.actualPort != 7000 || client.actualHost != "localhost" { t.Errorf("Expected localhost:7000, got %s:%d", client.actualHost, client.actualPort) @@ -55,7 +55,7 @@ func TestClient_URLParsing(t *testing.T) { t.Run("should parse https://host:port URL format", func(t *testing.T) { client := NewClient(&ClientOptions{ - Connection: UriConnection{URL: "https://example.com:443"}, + Connection: URIConnection{URL: "https://example.com:443"}, }) if client.actualPort != 443 || client.actualHost != "example.com" { t.Errorf("Expected example.com:443, got %s:%d", client.actualHost, client.actualPort) @@ -68,7 +68,7 @@ func TestClient_URLParsing(t *testing.T) { t.Error("Expected panic for invalid URL format") } }() - NewClient(&ClientOptions{Connection: UriConnection{URL: "invalid-url"}}) + NewClient(&ClientOptions{Connection: URIConnection{URL: "invalid-url"}}) }) t.Run("should panic for invalid port - too high", func(t *testing.T) { @@ -77,7 +77,7 @@ func TestClient_URLParsing(t *testing.T) { t.Error("Expected panic") } }() - NewClient(&ClientOptions{Connection: UriConnection{URL: "localhost:99999"}}) + NewClient(&ClientOptions{Connection: URIConnection{URL: "localhost:99999"}}) }) t.Run("should panic for invalid port - zero", func(t *testing.T) { @@ -86,7 +86,7 @@ func TestClient_URLParsing(t *testing.T) { t.Error("Expected panic") } }() - NewClient(&ClientOptions{Connection: UriConnection{URL: "localhost:0"}}) + NewClient(&ClientOptions{Connection: URIConnection{URL: "localhost:0"}}) }) t.Run("should panic for invalid port - negative", func(t *testing.T) { @@ -95,16 +95,16 @@ func TestClient_URLParsing(t *testing.T) { t.Error("Expected panic") } }() - NewClient(&ClientOptions{Connection: UriConnection{URL: "localhost:-1"}}) + NewClient(&ClientOptions{Connection: URIConnection{URL: "localhost:-1"}}) }) - t.Run("should panic when UriConnection has empty URL", func(t *testing.T) { + t.Run("should panic when URIConnection has empty URL", func(t *testing.T) { defer func() { if r := recover(); r == nil { t.Error("Expected panic for empty URL") } }() - NewClient(&ClientOptions{Connection: UriConnection{}}) + NewClient(&ClientOptions{Connection: URIConnection{}}) }) t.Run("stdio connection uses stdio transport", func(t *testing.T) { @@ -126,10 +126,10 @@ func TestClient_URLParsing(t *testing.T) { t.Run("uri connection is treated as external server", func(t *testing.T) { client := NewClient(&ClientOptions{ - Connection: UriConnection{URL: "localhost:8080"}, + Connection: URIConnection{URL: "localhost:8080"}, }) if !client.isExternalServer { - t.Error("Expected isExternalServer=true for UriConnection") + t.Error("Expected isExternalServer=true for URIConnection") } }) } @@ -216,12 +216,12 @@ func TestClient_AuthOptions(t *testing.T) { } }) - t.Run("should panic when GitHubToken is used with UriConnection", func(t *testing.T) { + t.Run("should panic when GitHubToken is used with URIConnection", func(t *testing.T) { defer func() { if r := recover(); r == nil { - t.Error("Expected panic for auth options with UriConnection") + t.Error("Expected panic for auth options with URIConnection") } else { - matched, _ := regexp.MatchString("GitHubToken and UseLoggedInUser cannot be used with UriConnection", r.(string)) + matched, _ := regexp.MatchString("GitHubToken and UseLoggedInUser cannot be used with URIConnection", r.(string)) if !matched { t.Errorf("Expected panic message about auth options, got: %v", r) } @@ -229,20 +229,20 @@ func TestClient_AuthOptions(t *testing.T) { }() NewClient(&ClientOptions{ - Connection: UriConnection{URL: "localhost:8080"}, + Connection: URIConnection{URL: "localhost:8080"}, GitHubToken: "gho_test_token", }) }) - t.Run("should panic when UseLoggedInUser is used with UriConnection", func(t *testing.T) { + t.Run("should panic when UseLoggedInUser is used with URIConnection", func(t *testing.T) { defer func() { if r := recover(); r == nil { - t.Error("Expected panic for auth options with UriConnection") + t.Error("Expected panic for auth options with URIConnection") } }() NewClient(&ClientOptions{ - Connection: UriConnection{URL: "localhost:8080"}, + Connection: URIConnection{URL: "localhost:8080"}, UseLoggedInUser: Bool(false), }) }) @@ -1147,7 +1147,7 @@ func TestResumeSessionRequest_RequestElicitation(t *testing.T) { } func TestCreateSessionRequest_RequestMCPApps(t *testing.T) { - t.Run("sends requestMCPApps flag when EnableMCPpApps is set", func(t *testing.T) { + t.Run("sends requestMCPApps flag when EnableMCPApps is set", func(t *testing.T) { req := createSessionRequest{ RequestMCPApps: Bool(true), } diff --git a/go/internal/e2e/client_options_e2e_test.go b/go/internal/e2e/client_options_e2e_test.go index 205714f34..e83cbf963 100644 --- a/go/internal/e2e/client_options_e2e_test.go +++ b/go/internal/e2e/client_options_e2e_test.go @@ -241,19 +241,19 @@ func TestClientOptionsUnit(t *testing.T) { } }) - t.Run("should panic when GitHubToken used with UriConnection", func(t *testing.T) { + t.Run("should panic when GitHubToken used with URIConnection", func(t *testing.T) { assertPanics(t, func() { _ = copilot.NewClient(&copilot.ClientOptions{ - Connection: copilot.UriConnection{URL: "localhost:8080"}, + Connection: copilot.URIConnection{URL: "localhost:8080"}, GitHubToken: "gho_test_token", }) }) }) - t.Run("should panic when UseLoggedInUser used with UriConnection", func(t *testing.T) { + t.Run("should panic when UseLoggedInUser used with URIConnection", func(t *testing.T) { assertPanics(t, func() { _ = copilot.NewClient(&copilot.ClientOptions{ - Connection: copilot.UriConnection{URL: "localhost:8080"}, + Connection: copilot.URIConnection{URL: "localhost:8080"}, UseLoggedInUser: copilot.Bool(false), }) }) diff --git a/go/internal/e2e/commands_and_elicitation_e2e_test.go b/go/internal/e2e/commands_and_elicitation_e2e_test.go index d7706e436..5a2ea9602 100644 --- a/go/internal/e2e/commands_and_elicitation_e2e_test.go +++ b/go/internal/e2e/commands_and_elicitation_e2e_test.go @@ -33,7 +33,7 @@ func TestCommandsE2E(t *testing.T) { } client2 := copilot.NewClient(&copilot.ClientOptions{ - Connection: copilot.UriConnection{URL: fmt.Sprintf("localhost:%d", runtimePort), ConnectionToken: sharedTcpToken}, + Connection: copilot.URIConnection{URL: fmt.Sprintf("localhost:%d", runtimePort), ConnectionToken: sharedTcpToken}, }) t.Cleanup(func() { client2.ForceStop() }) @@ -770,7 +770,7 @@ func TestUIElicitationMultiClientE2E(t *testing.T) { // Client2 joins with elicitation handler — should trigger capabilities.changed client2 := copilot.NewClient(&copilot.ClientOptions{ - Connection: copilot.UriConnection{URL: fmt.Sprintf("localhost:%d", runtimePort), ConnectionToken: sharedTcpToken}, + Connection: copilot.URIConnection{URL: fmt.Sprintf("localhost:%d", runtimePort), ConnectionToken: sharedTcpToken}, }) session2, err := client2.ResumeSession(t.Context(), session1.SessionID, &copilot.ResumeSessionConfig{ OnPermissionRequest: copilot.PermissionHandler.ApproveAll, @@ -830,7 +830,7 @@ func TestUIElicitationMultiClientE2E(t *testing.T) { // Client3 (dedicated for this test) joins with elicitation handler client3 := copilot.NewClient(&copilot.ClientOptions{ - Connection: copilot.UriConnection{URL: fmt.Sprintf("localhost:%d", runtimePort), ConnectionToken: sharedTcpToken}, + Connection: copilot.URIConnection{URL: fmt.Sprintf("localhost:%d", runtimePort), ConnectionToken: sharedTcpToken}, }) _, err = client3.ResumeSession(t.Context(), session1.SessionID, &copilot.ResumeSessionConfig{ OnPermissionRequest: copilot.PermissionHandler.ApproveAll, diff --git a/go/internal/e2e/connection_token_test.go b/go/internal/e2e/connection_token_test.go index f68bb0bf8..c4b3c6463 100644 --- a/go/internal/e2e/connection_token_test.go +++ b/go/internal/e2e/connection_token_test.go @@ -72,7 +72,7 @@ func TestConnectionToken(t *testing.T) { } bad := copilot.NewClient(&copilot.ClientOptions{ - Connection: copilot.UriConnection{ + Connection: copilot.URIConnection{ URL: fmt.Sprintf("localhost:%d", port), ConnectionToken: "wrong", }, @@ -107,7 +107,7 @@ func TestConnectionToken(t *testing.T) { } none := copilot.NewClient(&copilot.ClientOptions{ - Connection: copilot.UriConnection{URL: fmt.Sprintf("localhost:%d", port)}, + Connection: copilot.URIConnection{URL: fmt.Sprintf("localhost:%d", port)}, }) t.Cleanup(func() { none.ForceStop() }) diff --git a/go/internal/e2e/multi_client_e2e_test.go b/go/internal/e2e/multi_client_e2e_test.go index a5c852bc8..30e305378 100644 --- a/go/internal/e2e/multi_client_e2e_test.go +++ b/go/internal/e2e/multi_client_e2e_test.go @@ -37,7 +37,7 @@ func TestMultiClientE2E(t *testing.T) { } client2 := copilot.NewClient(&copilot.ClientOptions{ - Connection: copilot.UriConnection{URL: fmt.Sprintf("localhost:%d", runtimePort), ConnectionToken: sharedTcpToken}, + Connection: copilot.URIConnection{URL: fmt.Sprintf("localhost:%d", runtimePort), ConnectionToken: sharedTcpToken}, }) t.Cleanup(func() { client2.ForceStop() }) @@ -487,7 +487,7 @@ func TestMultiClientE2E(t *testing.T) { // Recreate client2 for cleanup (but don't rejoin the session) client2 = copilot.NewClient(&copilot.ClientOptions{ - Connection: copilot.UriConnection{URL: fmt.Sprintf("localhost:%d", runtimePort), ConnectionToken: sharedTcpToken}, + Connection: copilot.URIConnection{URL: fmt.Sprintf("localhost:%d", runtimePort), ConnectionToken: sharedTcpToken}, }) // Now only stable_tool should be available diff --git a/go/internal/e2e/pending_work_resume_e2e_test.go b/go/internal/e2e/pending_work_resume_e2e_test.go index 6830b669c..4ccb08027 100644 --- a/go/internal/e2e/pending_work_resume_e2e_test.go +++ b/go/internal/e2e/pending_work_resume_e2e_test.go @@ -42,7 +42,7 @@ func TestPendingWorkResumeE2E(t *testing.T) { releasePermission := make(chan rpc.PermissionDecision, 1) suspendedClient := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.UriConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} }) session1, err := suspendedClient.CreateSession(t.Context(), &copilot.SessionConfig{ Tools: []copilot.Tool{originalTool}, @@ -102,7 +102,7 @@ func TestPendingWorkResumeE2E(t *testing.T) { }) resumedClient := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.UriConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} }) t.Cleanup(func() { resumedClient.ForceStop() }) @@ -159,7 +159,7 @@ func TestPendingWorkResumeE2E(t *testing.T) { }) suspendedClient := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.UriConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} }) session1, err := suspendedClient.CreateSession(t.Context(), &copilot.SessionConfig{ Tools: []copilot.Tool{originalTool}, @@ -195,7 +195,7 @@ func TestPendingWorkResumeE2E(t *testing.T) { suspendedClient.ForceStop() resumedClient := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.UriConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} }) t.Cleanup(func() { resumedClient.ForceStop() }) @@ -257,7 +257,7 @@ func TestPendingWorkResumeE2E(t *testing.T) { }) suspendedClient := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.UriConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} }) session1, err := suspendedClient.CreateSession(t.Context(), &copilot.SessionConfig{ Tools: []copilot.Tool{originalA, originalB}, @@ -300,7 +300,7 @@ func TestPendingWorkResumeE2E(t *testing.T) { suspendedClient.ForceStop() resumedClient := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.UriConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} }) t.Cleanup(func() { resumedClient.ForceStop() }) @@ -348,7 +348,7 @@ func TestPendingWorkResumeE2E(t *testing.T) { var sessionID string func() { firstClient := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.UriConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} }) defer firstClient.ForceStop() @@ -374,7 +374,7 @@ func TestPendingWorkResumeE2E(t *testing.T) { }() resumedClient := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.UriConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} }) t.Cleanup(func() { resumedClient.ForceStop() }) @@ -430,7 +430,7 @@ func TestPendingWorkResumeE2E(t *testing.T) { }) suspendedClient := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.UriConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} }) if !scenario.disconnectOriginalClient { defer suspendedClient.ForceStop() @@ -472,7 +472,7 @@ func TestPendingWorkResumeE2E(t *testing.T) { } resumedClient := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.UriConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} }) t.Cleanup(func() { resumedClient.ForceStop() }) @@ -569,7 +569,7 @@ func TestPendingWorkResumeE2E(t *testing.T) { var sessionID string func() { firstClient := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.UriConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} }) defer firstClient.ForceStop() @@ -595,7 +595,7 @@ func TestPendingWorkResumeE2E(t *testing.T) { }() resumedClient := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.UriConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} }) t.Cleanup(func() { resumedClient.ForceStop() }) diff --git a/go/internal/e2e/session_fs_e2e_test.go b/go/internal/e2e/session_fs_e2e_test.go index bdf2c5260..80ef57227 100644 --- a/go/internal/e2e/session_fs_e2e_test.go +++ b/go/internal/e2e/session_fs_e2e_test.go @@ -155,7 +155,7 @@ func TestSessionFSE2E(t *testing.T) { } client2 := copilot.NewClient(&copilot.ClientOptions{ - Connection: copilot.UriConnection{URL: fmt.Sprintf("localhost:%d", runtimePort)}, + Connection: copilot.URIConnection{URL: fmt.Sprintf("localhost:%d", runtimePort)}, LogLevel: "error", Env: ctx.Env(), SessionFS: sessionFSConfig, diff --git a/go/internal/e2e/suspend_e2e_test.go b/go/internal/e2e/suspend_e2e_test.go index 672481a4f..09dc79540 100644 --- a/go/internal/e2e/suspend_e2e_test.go +++ b/go/internal/e2e/suspend_e2e_test.go @@ -51,7 +51,7 @@ func TestSuspendE2E(t *testing.T) { _, cliURL := startTcpServer(t, ctx) client1 := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.UriConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} }) t.Cleanup(func() { client1.ForceStop() }) @@ -75,7 +75,7 @@ func TestSuspendE2E(t *testing.T) { client1.ForceStop() client2 := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.UriConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} }) t.Cleanup(func() { client2.ForceStop() }) diff --git a/go/internal/e2e/testharness/context.go b/go/internal/e2e/testharness/context.go index cae966667..fae5623aa 100644 --- a/go/internal/e2e/testharness/context.go +++ b/go/internal/e2e/testharness/context.go @@ -231,7 +231,7 @@ func (c *TestContext) NewClient(opts ...func(*copilot.ClientOptions)) *copilot.C opt(options) } - _, externalRuntime := options.Connection.(copilot.UriConnection) + _, externalRuntime := options.Connection.(copilot.URIConnection) if options.GitHubToken == "" && !externalRuntime { options.GitHubToken = defaultGitHubToken } diff --git a/go/mode_empty.go b/go/mode_empty.go index c048c7e7b..05b7e28bb 100644 --- a/go/mode_empty.go +++ b/go/mode_empty.go @@ -22,19 +22,19 @@ func validateNewClientForMode(opts *ClientOptions) { // - the app supplied a BaseDirectory the runtime can write to, // - the app supplied a SessionFS implementation, // - or the app is connecting to an externally-managed runtime via - // UriConnection (in which case the host owns storage). + // URIConnection (in which case the host owns storage). if opts.BaseDirectory != "" { return } if opts.SessionFS != nil { return } - if _, ok := opts.Connection.(UriConnection); ok { + if _, ok := opts.Connection.(URIConnection); ok { return } - panic("Client is in Mode=ModeEmpty but neither BaseDirectory, SessionFS, nor a UriConnection was supplied. " + + panic("Client is in Mode=ModeEmpty but neither BaseDirectory, SessionFS, nor a URIConnection was supplied. " + "Empty mode requires explicit, per-tenant storage; set ClientOptions.BaseDirectory or .SessionFS, " + - "or connect to an externally-managed runtime via UriConnection.") + "or connect to an externally-managed runtime via URIConnection.") } // validateToolFilterList rejects bare "*" entries with an actionable error diff --git a/go/toolset_test.go b/go/toolset_test.go index a865efaa9..96d90f1d1 100644 --- a/go/toolset_test.go +++ b/go/toolset_test.go @@ -111,10 +111,10 @@ func TestNewClient_modeEmptyAcceptsBaseDirectory(t *testing.T) { } } -func TestNewClient_modeEmptyAcceptsUriConnection(t *testing.T) { +func TestNewClient_modeEmptyAcceptsURIConnection(t *testing.T) { c := NewClient(&ClientOptions{ Mode: ModeEmpty, - Connection: UriConnection{URL: "8080"}, + Connection: URIConnection{URL: "8080"}, }) if c.options.Mode != ModeEmpty { t.Errorf("expected ModeEmpty, got %q", c.options.Mode) diff --git a/go/types.go b/go/types.go index 8da2baa60..a31cd69ca 100644 --- a/go/types.go +++ b/go/types.go @@ -20,7 +20,7 @@ const ( // RuntimeConnection describes how a [Client] connects to the Copilot runtime. // -// Construct one with a [StdioConnection], [TcpConnection], or [UriConnection] +// Construct one with a [StdioConnection], [TcpConnection], or [URIConnection] // literal and pass it via [ClientOptions.Connection]. When [ClientOptions.Connection] // is nil, the default is an empty [StdioConnection] (the SDK spawns the bundled // runtime and communicates over stdin/stdout). @@ -58,9 +58,9 @@ type TcpConnection struct { func (TcpConnection) runtimeConnection() {} -// UriConnection connects to an already-running runtime at the given URL. +// URIConnection connects to an already-running runtime at the given URL. // The SDK does not spawn a process in this mode. -type UriConnection struct { +type URIConnection struct { // URL of the runtime. Accepts "port", "host:port", or a full URL such // as "http://host:port". URL string @@ -69,7 +69,7 @@ type UriConnection struct { ConnectionToken string } -func (UriConnection) runtimeConnection() {} +func (URIConnection) runtimeConnection() {} // ClientOptions configures the [Client]. type ClientOptions struct { @@ -86,7 +86,7 @@ type ClientOptions struct { // This does not affect where the Go SDK extracts the embedded CLI // binary; use embeddedcli.Config.Dir to control that install/cache // location. - // Ignored when connecting to an existing runtime via [UriConnection]. + // Ignored when connecting to an existing runtime via [URIConnection]. BaseDirectory string // LogLevel for the runtime. When empty (the default), the runtime // uses its own default level; the SDK does not pass --log-level. @@ -123,12 +123,12 @@ type ClientOptions struct { // SessionIdleTimeoutSeconds configures the server-wide session idle // timeout in seconds. Sessions without activity for this duration are // automatically cleaned up. Set to 0 or leave unset to disable. - // Ignored when connecting to an existing runtime via [UriConnection]. + // Ignored when connecting to an existing runtime via [URIConnection]. SessionIdleTimeoutSeconds int // EnableRemoteSessions enables remote session support (Mission Control // integration). When true, sessions in a GitHub repository working // directory are accessible from GitHub web and mobile. - // Ignored when connecting to an existing runtime via [UriConnection]. + // Ignored when connecting to an existing runtime via [URIConnection]. EnableRemoteSessions bool // Mode controls the default tool surface and feature flags presented to // sessions created by this client. The zero value ([ModeCopilotCli]) @@ -136,7 +136,7 @@ type ClientOptions struct { // multi-tenant safe defaults — see [ClientMode] for details. // // When Mode is [ModeEmpty], NewClient requires either BaseDirectory, - // SessionFS, or a [UriConnection] so the runtime has persistent storage + // SessionFS, or a [URIConnection] so the runtime has persistent storage // for session state. Mode ClientMode } From a3c03a6f83b1ae6f707bd0980a4d378d8e7026c6 Mon Sep 17 00:00:00 2001 From: qmuntal Date: Mon, 1 Jun 2026 12:00:01 +0200 Subject: [PATCH 3/5] replace TcpConnection for TCPConnection --- go/README.md | 2 +- go/client.go | 8 ++-- go/client_test.go | 4 +- go/internal/e2e/client_e2e_test.go | 2 +- go/internal/e2e/client_options_e2e_test.go | 8 ++-- .../e2e/commands_and_elicitation_e2e_test.go | 10 ++-- go/internal/e2e/connection_token_test.go | 8 ++-- go/internal/e2e/multi_client_e2e_test.go | 6 +-- .../e2e/pending_work_resume_e2e_test.go | 46 +++++++++---------- go/internal/e2e/session_fs_e2e_test.go | 2 +- go/internal/e2e/suspend_e2e_test.go | 6 +-- go/types.go | 8 ++-- 12 files changed, 55 insertions(+), 55 deletions(-) diff --git a/go/README.md b/go/README.md index 64eefe437..92e7cad0f 100644 --- a/go/README.md +++ b/go/README.md @@ -136,7 +136,7 @@ Event types: `SessionLifecycleCreated`, `SessionLifecycleDeleted`, `SessionLifec - `Connection` (RuntimeConnection): How the SDK connects to the runtime. Construct via one of: - `StdioConnection{Path, Args}` — spawn a runtime over stdio (the default if `Connection` is nil) - - `TcpConnection{Port, ConnectionToken, Path, Args}` — spawn a runtime that listens on TCP + - `TCPConnection{Port, ConnectionToken, Path, Args}` — spawn a runtime that listens on TCP - `URIConnection{URL, ConnectionToken}` — connect to an already-running runtime (no process spawned) When `Path` is empty for stdio/tcp, the SDK uses the bundled CLI (or `COPILOT_CLI_PATH` env var). diff --git a/go/client.go b/go/client.go index 7c0ce0481..0673b9971 100644 --- a/go/client.go +++ b/go/client.go @@ -180,7 +180,7 @@ func NewClient(options *ClientOptions) *Client { if len(conn.Args) > 0 { client.cliArgs = append([]string{}, conn.Args...) } - case TcpConnection: + case TCPConnection: client.useStdio = false client.cliPath = conn.Path if len(conn.Args) > 0 { @@ -1870,11 +1870,11 @@ func (c *Client) connectToServer(ctx context.Context) error { } // Connect via TCP - return c.connectViaTcp(ctx) + return c.connectViaTCP(ctx) } -// connectViaTcp connects to the CLI server via TCP socket. -func (c *Client) connectViaTcp(ctx context.Context) error { +// connectViaTCP connects to the CLI server via TCP socket. +func (c *Client) connectViaTCP(ctx context.Context) error { if c.actualPort == 0 { return fmt.Errorf("server port not available") } diff --git a/go/client_test.go b/go/client_test.go index 1335783df..99b6fcb3b 100644 --- a/go/client_test.go +++ b/go/client_test.go @@ -115,9 +115,9 @@ func TestClient_URLParsing(t *testing.T) { }) t.Run("tcp connection uses tcp transport", func(t *testing.T) { - client := NewClient(&ClientOptions{Connection: TcpConnection{Port: 8080}}) + client := NewClient(&ClientOptions{Connection: TCPConnection{Port: 8080}}) if client.useStdio { - t.Error("Expected useStdio=false for TcpConnection") + t.Error("Expected useStdio=false for TCPConnection") } if client.port != 8080 { t.Errorf("Expected port=8080, got %d", client.port) diff --git a/go/internal/e2e/client_e2e_test.go b/go/internal/e2e/client_e2e_test.go index e4dfed2d4..d7fc3f06a 100644 --- a/go/internal/e2e/client_e2e_test.go +++ b/go/internal/e2e/client_e2e_test.go @@ -44,7 +44,7 @@ func TestClientE2E(t *testing.T) { t.Run("should start and connect to server using tcp", func(t *testing.T) { client := copilot.NewClient(&copilot.ClientOptions{ - Connection: copilot.TcpConnection{Path: cliPath}, + Connection: copilot.TCPConnection{Path: cliPath}, }) t.Cleanup(func() { client.ForceStop() }) diff --git a/go/internal/e2e/client_options_e2e_test.go b/go/internal/e2e/client_options_e2e_test.go index e83cbf963..90e29eee5 100644 --- a/go/internal/e2e/client_options_e2e_test.go +++ b/go/internal/e2e/client_options_e2e_test.go @@ -17,12 +17,12 @@ import ( // Go's ClientOptions is a plain struct with no setter validation; equivalent behavior is covered // in package-level unit tests. func TestClientOptionsE2E(t *testing.T) { - t.Run("should listen on configured tcp port", func(t *testing.T) { + t.Run("should listen on configured TCP port", func(t *testing.T) { ctx := testharness.NewTestContext(t) - port := getAvailableTcpPort(t) + port := getAvailableTCPPort(t) client := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.TcpConnection{Path: ctx.CLIPath, Port: port} + opts.Connection = copilot.TCPConnection{Path: ctx.CLIPath, Port: port} }) t.Cleanup(func() { client.ForceStop() }) @@ -278,7 +278,7 @@ func TestClientOptionsUnit(t *testing.T) { }) } -func getAvailableTcpPort(t *testing.T) int { +func getAvailableTCPPort(t *testing.T) int { t.Helper() listener, err := net.Listen("tcp", "127.0.0.1:0") if err != nil { diff --git a/go/internal/e2e/commands_and_elicitation_e2e_test.go b/go/internal/e2e/commands_and_elicitation_e2e_test.go index 5a2ea9602..45d54dde9 100644 --- a/go/internal/e2e/commands_and_elicitation_e2e_test.go +++ b/go/internal/e2e/commands_and_elicitation_e2e_test.go @@ -14,7 +14,7 @@ import ( func TestCommandsE2E(t *testing.T) { ctx := testharness.NewTestContext(t) client1 := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.TcpConnection{Path: opts.Connection.(copilot.StdioConnection).Path, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.TCPConnection{Path: opts.Connection.(copilot.StdioConnection).Path, ConnectionToken: sharedTCPToken} }) t.Cleanup(func() { client1.ForceStop() }) @@ -33,7 +33,7 @@ func TestCommandsE2E(t *testing.T) { } client2 := copilot.NewClient(&copilot.ClientOptions{ - Connection: copilot.URIConnection{URL: fmt.Sprintf("localhost:%d", runtimePort), ConnectionToken: sharedTcpToken}, + Connection: copilot.URIConnection{URL: fmt.Sprintf("localhost:%d", runtimePort), ConnectionToken: sharedTCPToken}, }) t.Cleanup(func() { client2.ForceStop() }) @@ -722,7 +722,7 @@ func schemaHasProperty(schema map[string]any, name string) bool { func TestUIElicitationMultiClientE2E(t *testing.T) { ctx := testharness.NewTestContext(t) client1 := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.TcpConnection{Path: opts.Connection.(copilot.StdioConnection).Path, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.TCPConnection{Path: opts.Connection.(copilot.StdioConnection).Path, ConnectionToken: sharedTCPToken} }) t.Cleanup(func() { client1.ForceStop() }) @@ -770,7 +770,7 @@ func TestUIElicitationMultiClientE2E(t *testing.T) { // Client2 joins with elicitation handler — should trigger capabilities.changed client2 := copilot.NewClient(&copilot.ClientOptions{ - Connection: copilot.URIConnection{URL: fmt.Sprintf("localhost:%d", runtimePort), ConnectionToken: sharedTcpToken}, + Connection: copilot.URIConnection{URL: fmt.Sprintf("localhost:%d", runtimePort), ConnectionToken: sharedTCPToken}, }) session2, err := client2.ResumeSession(t.Context(), session1.SessionID, &copilot.ResumeSessionConfig{ OnPermissionRequest: copilot.PermissionHandler.ApproveAll, @@ -830,7 +830,7 @@ func TestUIElicitationMultiClientE2E(t *testing.T) { // Client3 (dedicated for this test) joins with elicitation handler client3 := copilot.NewClient(&copilot.ClientOptions{ - Connection: copilot.URIConnection{URL: fmt.Sprintf("localhost:%d", runtimePort), ConnectionToken: sharedTcpToken}, + Connection: copilot.URIConnection{URL: fmt.Sprintf("localhost:%d", runtimePort), ConnectionToken: sharedTCPToken}, }) _, err = client3.ResumeSession(t.Context(), session1.SessionID, &copilot.ResumeSessionConfig{ OnPermissionRequest: copilot.PermissionHandler.ApproveAll, diff --git a/go/internal/e2e/connection_token_test.go b/go/internal/e2e/connection_token_test.go index c4b3c6463..6d36000b3 100644 --- a/go/internal/e2e/connection_token_test.go +++ b/go/internal/e2e/connection_token_test.go @@ -13,7 +13,7 @@ func TestConnectionToken(t *testing.T) { t.Run("explicit token round-trips successfully", func(t *testing.T) { ctx := testharness.NewTestContext(t) client := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.TcpConnection{ + opts.Connection = copilot.TCPConnection{ Path: ctx.CLIPath, ConnectionToken: "right-token", } @@ -36,7 +36,7 @@ func TestConnectionToken(t *testing.T) { t.Run("auto-generated token round-trips successfully", func(t *testing.T) { ctx := testharness.NewTestContext(t) client := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.TcpConnection{Path: ctx.CLIPath} + opts.Connection = copilot.TCPConnection{Path: ctx.CLIPath} }) t.Cleanup(func() { client.ForceStop() }) @@ -56,7 +56,7 @@ func TestConnectionToken(t *testing.T) { t.Run("sibling client with wrong token is rejected", func(t *testing.T) { ctx := testharness.NewTestContext(t) good := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.TcpConnection{ + opts.Connection = copilot.TCPConnection{ Path: ctx.CLIPath, ConnectionToken: "right-token", } @@ -91,7 +91,7 @@ func TestConnectionToken(t *testing.T) { t.Run("sibling client with no token is rejected", func(t *testing.T) { ctx := testharness.NewTestContext(t) good := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.TcpConnection{ + opts.Connection = copilot.TCPConnection{ Path: ctx.CLIPath, ConnectionToken: "right-token", } diff --git a/go/internal/e2e/multi_client_e2e_test.go b/go/internal/e2e/multi_client_e2e_test.go index 30e305378..742145536 100644 --- a/go/internal/e2e/multi_client_e2e_test.go +++ b/go/internal/e2e/multi_client_e2e_test.go @@ -18,7 +18,7 @@ func TestMultiClientE2E(t *testing.T) { // Use TCP mode so a second client can connect to the same CLI process ctx := testharness.NewTestContext(t) client1 := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.TcpConnection{Path: opts.Connection.(copilot.StdioConnection).Path, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.TCPConnection{Path: opts.Connection.(copilot.StdioConnection).Path, ConnectionToken: sharedTCPToken} }) t.Cleanup(func() { client1.ForceStop() }) @@ -37,7 +37,7 @@ func TestMultiClientE2E(t *testing.T) { } client2 := copilot.NewClient(&copilot.ClientOptions{ - Connection: copilot.URIConnection{URL: fmt.Sprintf("localhost:%d", runtimePort), ConnectionToken: sharedTcpToken}, + Connection: copilot.URIConnection{URL: fmt.Sprintf("localhost:%d", runtimePort), ConnectionToken: sharedTCPToken}, }) t.Cleanup(func() { client2.ForceStop() }) @@ -487,7 +487,7 @@ func TestMultiClientE2E(t *testing.T) { // Recreate client2 for cleanup (but don't rejoin the session) client2 = copilot.NewClient(&copilot.ClientOptions{ - Connection: copilot.URIConnection{URL: fmt.Sprintf("localhost:%d", runtimePort), ConnectionToken: sharedTcpToken}, + Connection: copilot.URIConnection{URL: fmt.Sprintf("localhost:%d", runtimePort), ConnectionToken: sharedTCPToken}, }) // Now only stable_tool should be available diff --git a/go/internal/e2e/pending_work_resume_e2e_test.go b/go/internal/e2e/pending_work_resume_e2e_test.go index 4ccb08027..03fcbd3fb 100644 --- a/go/internal/e2e/pending_work_resume_e2e_test.go +++ b/go/internal/e2e/pending_work_resume_e2e_test.go @@ -27,7 +27,7 @@ func TestPendingWorkResumeE2E(t *testing.T) { t.Run("should continue pending permission request after resume", func(t *testing.T) { ctx.ConfigureForTest(t) - _, cliURL := startTcpServer(t, ctx) + _, cliURL := startTCPServer(t, ctx) type ValueParams struct { Value string `json:"value" jsonschema:"Value to transform"` @@ -42,7 +42,7 @@ func TestPendingWorkResumeE2E(t *testing.T) { releasePermission := make(chan rpc.PermissionDecision, 1) suspendedClient := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTCPToken} }) session1, err := suspendedClient.CreateSession(t.Context(), &copilot.SessionConfig{ Tools: []copilot.Tool{originalTool}, @@ -102,7 +102,7 @@ func TestPendingWorkResumeE2E(t *testing.T) { }) resumedClient := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTCPToken} }) t.Cleanup(func() { resumedClient.ForceStop() }) @@ -140,7 +140,7 @@ func TestPendingWorkResumeE2E(t *testing.T) { t.Run("should continue pending external tool request after resume", func(t *testing.T) { ctx.ConfigureForTest(t) - _, cliURL := startTcpServer(t, ctx) + _, cliURL := startTCPServer(t, ctx) type ValueParams struct { Value string `json:"value" jsonschema:"Value to look up"` @@ -159,7 +159,7 @@ func TestPendingWorkResumeE2E(t *testing.T) { }) suspendedClient := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTCPToken} }) session1, err := suspendedClient.CreateSession(t.Context(), &copilot.SessionConfig{ Tools: []copilot.Tool{originalTool}, @@ -195,7 +195,7 @@ func TestPendingWorkResumeE2E(t *testing.T) { suspendedClient.ForceStop() resumedClient := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTCPToken} }) t.Cleanup(func() { resumedClient.ForceStop() }) @@ -229,7 +229,7 @@ func TestPendingWorkResumeE2E(t *testing.T) { t.Run("should continue parallel pending external tool requests after resume", func(t *testing.T) { ctx.ConfigureForTest(t) - _, cliURL := startTcpServer(t, ctx) + _, cliURL := startTCPServer(t, ctx) type ValueParams struct { Value string `json:"value" jsonschema:"Value to look up"` @@ -257,7 +257,7 @@ func TestPendingWorkResumeE2E(t *testing.T) { }) suspendedClient := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTCPToken} }) session1, err := suspendedClient.CreateSession(t.Context(), &copilot.SessionConfig{ Tools: []copilot.Tool{originalA, originalB}, @@ -300,7 +300,7 @@ func TestPendingWorkResumeE2E(t *testing.T) { suspendedClient.ForceStop() resumedClient := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTCPToken} }) t.Cleanup(func() { resumedClient.ForceStop() }) @@ -343,12 +343,12 @@ func TestPendingWorkResumeE2E(t *testing.T) { t.Run("should resume successfully when no pending work exists", func(t *testing.T) { ctx.ConfigureForTest(t) - _, cliURL := startTcpServer(t, ctx) + _, cliURL := startTCPServer(t, ctx) var sessionID string func() { firstClient := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTCPToken} }) defer firstClient.ForceStop() @@ -374,7 +374,7 @@ func TestPendingWorkResumeE2E(t *testing.T) { }() resumedClient := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTCPToken} }) t.Cleanup(func() { resumedClient.ForceStop() }) @@ -412,7 +412,7 @@ func TestPendingWorkResumeE2E(t *testing.T) { t.Run(fmt.Sprintf("should keep pending external tool handleable on %s resume when continuependingwork is false", scenario.name), func(t *testing.T) { ctx.ConfigureForTest(t) - _, cliURL := startTcpServer(t, ctx) + _, cliURL := startTCPServer(t, ctx) type ValueParams struct { Value string `json:"value" jsonschema:"Value to look up"` @@ -430,7 +430,7 @@ func TestPendingWorkResumeE2E(t *testing.T) { }) suspendedClient := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTCPToken} }) if !scenario.disconnectOriginalClient { defer suspendedClient.ForceStop() @@ -472,7 +472,7 @@ func TestPendingWorkResumeE2E(t *testing.T) { } resumedClient := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTCPToken} }) t.Cleanup(func() { resumedClient.ForceStop() }) @@ -564,12 +564,12 @@ func TestPendingWorkResumeE2E(t *testing.T) { t.Run("should report continuependingwork true in resume event", func(t *testing.T) { ctx.ConfigureForTest(t) - _, cliURL := startTcpServer(t, ctx) + _, cliURL := startTCPServer(t, ctx) var sessionID string func() { firstClient := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTCPToken} }) defer firstClient.ForceStop() @@ -595,7 +595,7 @@ func TestPendingWorkResumeE2E(t *testing.T) { }() resumedClient := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTCPToken} }) t.Cleanup(func() { resumedClient.ForceStop() }) @@ -658,18 +658,18 @@ func serverCliURL(t *testing.T, server *copilot.Client) string { return fmt.Sprintf("localhost:%d", port) } -// sharedTcpToken is the connection token used by startTcpServer and any sibling +// sharedTCPToken is the connection token used by startTCPServer and any sibling // client that connects via the resulting CLI URL. Tests use a fixed token rather // than the auto-generated one because the second client is constructed without // access to the first client's internal state. -const sharedTcpToken = "tcp-shared-test-token" +const sharedTCPToken = "tcp-shared-test-token" -// startTcpServer starts a TCP-mode server client and returns its CLI URL. +// startTCPServer starts a TCP-mode server client and returns its CLI URL. // It triggers an initial connection so RuntimePort is populated. -func startTcpServer(t *testing.T, ctx *testharness.TestContext) (*copilot.Client, string) { +func startTCPServer(t *testing.T, ctx *testharness.TestContext) (*copilot.Client, string) { t.Helper() server := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.TcpConnection{Path: opts.Connection.(copilot.StdioConnection).Path, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.TCPConnection{Path: opts.Connection.(copilot.StdioConnection).Path, ConnectionToken: sharedTCPToken} }) t.Cleanup(func() { server.ForceStop() }) // Trigger connection so we can read the port. CreateSession+Disconnect is the diff --git a/go/internal/e2e/session_fs_e2e_test.go b/go/internal/e2e/session_fs_e2e_test.go index 80ef57227..3ba91c799 100644 --- a/go/internal/e2e/session_fs_e2e_test.go +++ b/go/internal/e2e/session_fs_e2e_test.go @@ -139,7 +139,7 @@ func TestSessionFSE2E(t *testing.T) { ctx.ConfigureForTest(t) client1 := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.TcpConnection{Path: ctx.CLIPath} + opts.Connection = copilot.TCPConnection{Path: ctx.CLIPath} }) t.Cleanup(func() { client1.ForceStop() }) diff --git a/go/internal/e2e/suspend_e2e_test.go b/go/internal/e2e/suspend_e2e_test.go index 09dc79540..8909193e2 100644 --- a/go/internal/e2e/suspend_e2e_test.go +++ b/go/internal/e2e/suspend_e2e_test.go @@ -48,10 +48,10 @@ func TestSuspendE2E(t *testing.T) { t.Run("should allow resume and continue conversation after suspend", func(t *testing.T) { ctx.ConfigureForTest(t) - _, cliURL := startTcpServer(t, ctx) + _, cliURL := startTCPServer(t, ctx) client1 := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTCPToken} }) t.Cleanup(func() { client1.ForceStop() }) @@ -75,7 +75,7 @@ func TestSuspendE2E(t *testing.T) { client1.ForceStop() client2 := ctx.NewClient(func(opts *copilot.ClientOptions) { - opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTcpToken} + opts.Connection = copilot.URIConnection{URL: cliURL, ConnectionToken: sharedTCPToken} }) t.Cleanup(func() { client2.ForceStop() }) diff --git a/go/types.go b/go/types.go index a31cd69ca..90bef777b 100644 --- a/go/types.go +++ b/go/types.go @@ -20,7 +20,7 @@ const ( // RuntimeConnection describes how a [Client] connects to the Copilot runtime. // -// Construct one with a [StdioConnection], [TcpConnection], or [URIConnection] +// Construct one with a [StdioConnection], [TCPConnection], or [URIConnection] // literal and pass it via [ClientOptions.Connection]. When [ClientOptions.Connection] // is nil, the default is an empty [StdioConnection] (the SDK spawns the bundled // runtime and communicates over stdin/stdout). @@ -39,9 +39,9 @@ type StdioConnection struct { func (StdioConnection) runtimeConnection() {} -// TcpConnection spawns a runtime child process that listens on a TCP socket +// TCPConnection spawns a runtime child process that listens on a TCP socket // and connects to it. -type TcpConnection struct { +type TCPConnection struct { // Port is the TCP port the runtime listens on. 0 (the default) lets the // runtime pick a free port; the chosen port is then available via // [Client.RuntimePort] after [Client.Start] returns. @@ -56,7 +56,7 @@ type TcpConnection struct { Args []string } -func (TcpConnection) runtimeConnection() {} +func (TCPConnection) runtimeConnection() {} // URIConnection connects to an already-running runtime at the given URL. // The SDK does not spawn a process in this mode. From f86b5bcb304844294b55f3a4b2fb4ba82f46438c Mon Sep 17 00:00:00 2001 From: qmuntal Date: Mon, 1 Jun 2026 12:09:57 +0200 Subject: [PATCH 4/5] Update docs for Go initialism casing --- docs/auth/byok.md | 2 +- docs/getting-started.md | 10 +++++----- docs/setup/backend-services.md | 10 +++++----- docs/setup/multi-tenancy.md | 16 ++++++++-------- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/auth/byok.md b/docs/auth/byok.md index 9a6adfe77..504602fd3 100644 --- a/docs/auth/byok.md +++ b/docs/auth/byok.md @@ -115,7 +115,7 @@ func main() { Provider: &copilot.ProviderConfig{ Type: "openai", BaseURL: "https://your-resource.openai.azure.com/openai/v1/", - WireApi: "responses", // Use "completions" for older models + WireAPI: "responses", // Use "completions" for older models APIKey: os.Getenv("FOUNDRY_API_KEY"), }, }) diff --git a/docs/getting-started.md b/docs/getting-started.md index 260267e82..cbe5a9839 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -2000,9 +2000,9 @@ import ( func main() { ctx := context.Background() - client := copilot.NewClient(&copilot.ClientOptions{ - Connection: copilot.UriConnection{URL: "localhost:4321"}, - }) + client := copilot.NewClient(&copilot.ClientOptions{ + Connection: copilot.URIConnection{URL: "localhost:4321"}, + }) if err := client.Start(ctx); err != nil { log.Fatal(err) @@ -2021,7 +2021,7 @@ func main() { import copilot "github.com/github/copilot-sdk/go" client := copilot.NewClient(&copilot.ClientOptions{ - Connection: copilot.UriConnection{URL: "localhost:4321"}, + Connection: copilot.URIConnection{URL: "localhost:4321"}, }) if err := client.Start(ctx); err != nil { @@ -2105,7 +2105,7 @@ var session = client.createSession( -**Note:** When `cli_url` / `cliUrl` / Go's `UriConnection` is provided, or Rust uses `Transport::External`, the SDK will not spawn or manage a CLI process - it will only connect to the existing server at the specified URL. +**Note:** When `cli_url` / `cliUrl` / Go's `URIConnection` is provided, or Rust uses `Transport::External`, the SDK will not spawn or manage a CLI process - it will only connect to the existing server at the specified URL. ## Telemetry and observability diff --git a/docs/setup/backend-services.md b/docs/setup/backend-services.md index a50a64cef..ca4a310b6 100644 --- a/docs/setup/backend-services.md +++ b/docs/setup/backend-services.md @@ -6,7 +6,7 @@ Run the Copilot SDK in server-side applications—APIs, web backends, microservi ## How it works -Instead of the SDK spawning a CLI child process, you run the CLI independently in **headless server mode**. Your backend connects to it over TCP using the `Connection` option (`UriConnection`). +Instead of the SDK spawning a CLI child process, you run the CLI independently in **headless server mode**. Your backend connects to it over TCP using the `Connection` option (`URIConnection`). ```mermaid flowchart TB @@ -183,9 +183,9 @@ func main() { userID := "user1" message := "Hello" - client := copilot.NewClient(&copilot.ClientOptions{ - Connection: copilot.UriConnection{URL: "localhost:4321"}, - }) + client := copilot.NewClient(&copilot.ClientOptions{ + Connection: copilot.URIConnection{URL: "localhost:4321"}, + }) client.Start(ctx) defer client.Stop() @@ -202,7 +202,7 @@ func main() { ```go client := copilot.NewClient(&copilot.ClientOptions{ - Connection: copilot.UriConnection{URL: "localhost:4321"}, + Connection: copilot.URIConnection{URL: "localhost:4321"}, }) client.Start(ctx) defer client.Stop() diff --git a/docs/setup/multi-tenancy.md b/docs/setup/multi-tenancy.md index 1cc1c5f16..74e828ba7 100644 --- a/docs/setup/multi-tenancy.md +++ b/docs/setup/multi-tenancy.md @@ -108,12 +108,12 @@ func main() { requestID := "req-1" user := appUser{ID: "alice", GitHubToken: "gho_xxx"} - client := copilot.NewClient(&copilot.ClientOptions{ - Mode: copilot.ModeEmpty, - BaseDirectory: fmt.Sprintf("/var/lib/my-app/copilot/%s", runtimeInstanceID), - SessionIdleTimeoutSeconds: 900, - Connection: copilot.UriConnection{URL: runtimeURL}, - }) + client := copilot.NewClient(&copilot.ClientOptions{ + Mode: copilot.ModeEmpty, + BaseDirectory: fmt.Sprintf("/var/lib/my-app/copilot/%s", runtimeInstanceID), + SessionIdleTimeoutSeconds: 900, + Connection: copilot.URIConnection{URL: runtimeURL}, + }) session, err := client.CreateSession(ctx, &copilot.SessionConfig{ SessionID: fmt.Sprintf("user-%s-%s", user.ID, requestID), @@ -132,7 +132,7 @@ client := copilot.NewClient(&copilot.ClientOptions{ Mode: copilot.ModeEmpty, BaseDirectory: fmt.Sprintf("/var/lib/my-app/copilot/%s", runtimeInstanceID), SessionIdleTimeoutSeconds: 900, - Connection: copilot.UriConnection{URL: runtimeURL}, + Connection: copilot.URIConnection{URL: runtimeURL}, }) session, err := client.CreateSession(ctx, &copilot.SessionConfig{ @@ -352,7 +352,7 @@ Use an external runtime connection when multiple SDK clients should share one al |----------|-----------------------------| | TypeScript | `RuntimeConnection.forUri(url)` | | Python | `RuntimeConnection.for_uri(url)` | -| Go | `copilot.UriConnection{URL: url}` | +| Go | `copilot.URIConnection{URL: url}` | | .NET | `RuntimeConnection.ForUri(url)` | | Java | `setCliUrl(url)` | | Rust | `Transport::External { host, port, connection_token }` | From 322253f00142143b5b83b376c3eee883a119093d Mon Sep 17 00:00:00 2001 From: qmuntal Date: Mon, 1 Jun 2026 12:17:58 +0200 Subject: [PATCH 5/5] Remove Go GitHub casing overrides --- go/internal/e2e/rpc_session_state_e2e_test.go | 2 +- go/internal/e2e/session_e2e_test.go | 8 +- go/rpc/zrpc.go | 96 +++++++++---------- go/rpc/zrpc_encoding.go | 40 ++++---- go/rpc/zsession_events.go | 2 +- go/zsession_events.go | 14 +-- scripts/codegen/go.ts | 3 +- 7 files changed, 82 insertions(+), 83 deletions(-) diff --git a/go/internal/e2e/rpc_session_state_e2e_test.go b/go/internal/e2e/rpc_session_state_e2e_test.go index f6698f082..b7bb51106 100644 --- a/go/internal/e2e/rpc_session_state_e2e_test.go +++ b/go/internal/e2e/rpc_session_state_e2e_test.go @@ -515,7 +515,7 @@ func TestRPCSessionStateE2E(t *testing.T) { repo := "github/copilot-sdk-e2e" repoHost := "github.com" - hostType := rpc.SessionWorkingDirectoryContextHostTypeGitHub + hostType := rpc.SessionWorkingDirectoryContextHostTypeGithub baseCommit := "0000000000000000000000000000000000000000" headCommit := "1111111111111111111111111111111111111111" if _, err := session.RPC.Metadata.RecordContextChange(t.Context(), &rpc.MetadataRecordContextChangeRequest{ diff --git a/go/internal/e2e/session_e2e_test.go b/go/internal/e2e/session_e2e_test.go index dc2d54ca8..26707bdb3 100644 --- a/go/internal/e2e/session_e2e_test.go +++ b/go/internal/e2e/session_e2e_test.go @@ -1420,13 +1420,13 @@ func TestSessionAttachmentsE2E(t *testing.T) { } number := int64(1234) - referenceType := copilot.AttachmentGitHubReferenceTypeIssue + referenceType := copilot.AttachmentGithubReferenceTypeIssue state := "open" title := "Add E2E attachment coverage" url := "https://github.com/github/copilot-sdk/issues/1234" _, err = session.SendAndWait(t.Context(), copilot.MessageOptions{ Prompt: "Using only the GitHub reference metadata in this message, summarize the reference. Do not call any tools.", - Attachments: []copilot.Attachment{&copilot.AttachmentGitHubReference{ + Attachments: []copilot.Attachment{&copilot.AttachmentGithubReference{ Number: number, ReferenceType: referenceType, State: state, @@ -1438,14 +1438,14 @@ func TestSessionAttachmentsE2E(t *testing.T) { t.Fatalf("SendAndWait failed: %v", err) } - attachment, ok := lastUserAttachment(t, session).(*copilot.AttachmentGitHubReference) + attachment, ok := lastUserAttachment(t, session).(*copilot.AttachmentGithubReference) if !ok { t.Fatalf("Expected GitHub reference attachment, got %T", lastUserAttachment(t, session)) } if attachment.Number != 1234 { t.Errorf("Expected Number=1234, got %v", attachment.Number) } - if attachment.ReferenceType != copilot.AttachmentGitHubReferenceTypeIssue { + if attachment.ReferenceType != copilot.AttachmentGithubReferenceTypeIssue { t.Errorf("Expected ReferenceType=Issue, got %v", attachment.ReferenceType) } if attachment.State != "open" { diff --git a/go/rpc/zrpc.go b/go/rpc/zrpc.go index a93813a2d..2f7058c02 100644 --- a/go/rpc/zrpc.go +++ b/go/rpc/zrpc.go @@ -421,13 +421,13 @@ func (AttachmentFile) Type() AttachmentType { } // GitHub issue, pull request, or discussion reference -// Experimental: AttachmentGitHubReference is part of an experimental API and may change or +// Experimental: AttachmentGithubReference is part of an experimental API and may change or // be removed. -type AttachmentGitHubReference struct { +type AttachmentGithubReference struct { // Issue, pull request, or discussion number Number int64 `json:"number"` // Type of GitHub reference - ReferenceType AttachmentGitHubReferenceType `json:"referenceType"` + ReferenceType AttachmentGithubReferenceType `json:"referenceType"` // Current state of the referenced item (e.g., open, closed, merged) State string `json:"state"` // Title of the referenced item @@ -436,9 +436,9 @@ type AttachmentGitHubReference struct { URL string `json:"url"` } -func (AttachmentGitHubReference) attachment() {} -func (AttachmentGitHubReference) Type() AttachmentType { - return AttachmentTypeGitHubReference +func (AttachmentGithubReference) attachment() {} +func (AttachmentGithubReference) Type() AttachmentType { + return AttachmentTypeGithubReference } // Code selection attachment from an editor @@ -580,8 +580,8 @@ func (EnvAuthInfo) Type() AuthInfoType { } // Schema for the `GhCliAuthInfo` type. -// Experimental: GHCLIAuthInfo is part of an experimental API and may change or be removed. -type GHCLIAuthInfo struct { +// Experimental: GhCLIAuthInfo is part of an experimental API and may change or be removed. +type GhCLIAuthInfo struct { // Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the // GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this // verbatim and does not re-fetch when set. @@ -594,9 +594,9 @@ type GHCLIAuthInfo struct { Token string `json:"token"` } -func (GHCLIAuthInfo) authInfo() {} -func (GHCLIAuthInfo) Type() AuthInfoType { - return AuthInfoTypeGHCLI +func (GhCLIAuthInfo) authInfo() {} +func (GhCLIAuthInfo) Type() AuthInfoType { + return AuthInfoTypeGhCLI } // Schema for the `HMACAuthInfo` type. @@ -1700,21 +1700,21 @@ type InstalledPlugin struct { // Experimental: InstalledPluginSource is part of an experimental API and may change or be // removed. type InstalledPluginSource struct { - InstalledPluginSourceGitHub *InstalledPluginSourceGitHub + InstalledPluginSourceGithub *InstalledPluginSourceGithub InstalledPluginSourceLocal *InstalledPluginSourceLocal InstalledPluginSourceURL *InstalledPluginSourceURL String *string } // Schema for the `InstalledPluginSourceGithub` type. -// Experimental: InstalledPluginSourceGitHub is part of an experimental API and may change +// Experimental: InstalledPluginSourceGithub is part of an experimental API and may change // or be removed. -type InstalledPluginSourceGitHub struct { +type InstalledPluginSourceGithub struct { Path *string `json:"path,omitempty"` Ref *string `json:"ref,omitempty"` Repo string `json:"repo"` // Constant value. Always "github". - Source InstalledPluginSourceGitHubSource `json:"source"` + Source InstalledPluginSourceGithubSource `json:"source"` } // Schema for the `InstalledPluginSourceLocal` type. @@ -3952,13 +3952,13 @@ func (PushAttachmentFile) Type() PushAttachmentType { } // GitHub issue, pull request, or discussion reference -// Experimental: PushAttachmentGitHubReference is part of an experimental API and may change +// Experimental: PushAttachmentGithubReference is part of an experimental API and may change // or be removed. -type PushAttachmentGitHubReference struct { +type PushAttachmentGithubReference struct { // Issue, pull request, or discussion number Number int64 `json:"number"` // Type of GitHub reference - ReferenceType PushAttachmentGitHubReferenceType `json:"referenceType"` + ReferenceType PushAttachmentGithubReferenceType `json:"referenceType"` // Current state of the referenced item (e.g., open, closed, merged) State string `json:"state"` // Title of the referenced item @@ -3967,9 +3967,9 @@ type PushAttachmentGitHubReference struct { URL string `json:"url"` } -func (PushAttachmentGitHubReference) pushAttachment() {} -func (PushAttachmentGitHubReference) Type() PushAttachmentType { - return PushAttachmentTypeGitHubReference +func (PushAttachmentGithubReference) pushAttachment() {} +func (PushAttachmentGithubReference) Type() PushAttachmentType { + return PushAttachmentTypeGithubReference } // Code selection attachment from an editor @@ -4738,21 +4738,21 @@ type SessionInstalledPlugin struct { // Experimental: SessionInstalledPluginSource is part of an experimental API and may change // or be removed. type SessionInstalledPluginSource struct { - SessionInstalledPluginSourceGitHub *SessionInstalledPluginSourceGitHub + SessionInstalledPluginSourceGithub *SessionInstalledPluginSourceGithub SessionInstalledPluginSourceLocal *SessionInstalledPluginSourceLocal SessionInstalledPluginSourceURL *SessionInstalledPluginSourceURL String *string } // Schema for the `SessionInstalledPluginSourceGithub` type. -// Experimental: SessionInstalledPluginSourceGitHub is part of an experimental API and may +// Experimental: SessionInstalledPluginSourceGithub is part of an experimental API and may // change or be removed. -type SessionInstalledPluginSourceGitHub struct { +type SessionInstalledPluginSourceGithub struct { Path *string `json:"path,omitempty"` Ref *string `json:"ref,omitempty"` Repo string `json:"repo"` // Constant value. Always "github". - Source SessionInstalledPluginSourceGitHubSource `json:"source"` + Source SessionInstalledPluginSourceGithubSource `json:"source"` } // Schema for the `SessionInstalledPluginSourceLocal` type. @@ -7068,17 +7068,17 @@ const ( ) // Type of GitHub reference -// Experimental: AttachmentGitHubReferenceType is part of an experimental API and may change +// Experimental: AttachmentGithubReferenceType is part of an experimental API and may change // or be removed. -type AttachmentGitHubReferenceType string +type AttachmentGithubReferenceType string const ( // GitHub discussion reference. - AttachmentGitHubReferenceTypeDiscussion AttachmentGitHubReferenceType = "discussion" + AttachmentGithubReferenceTypeDiscussion AttachmentGithubReferenceType = "discussion" // GitHub issue reference. - AttachmentGitHubReferenceTypeIssue AttachmentGitHubReferenceType = "issue" + AttachmentGithubReferenceTypeIssue AttachmentGithubReferenceType = "issue" // GitHub pull request reference. - AttachmentGitHubReferenceTypePr AttachmentGitHubReferenceType = "pr" + AttachmentGithubReferenceTypePr AttachmentGithubReferenceType = "pr" ) // Type discriminator for Attachment. @@ -7089,7 +7089,7 @@ const ( AttachmentTypeDirectory AttachmentType = "directory" AttachmentTypeExtensionContext AttachmentType = "extension_context" AttachmentTypeFile AttachmentType = "file" - AttachmentTypeGitHubReference AttachmentType = "github_reference" + AttachmentTypeGithubReference AttachmentType = "github_reference" AttachmentTypeSelection AttachmentType = "selection" ) @@ -7101,7 +7101,7 @@ const ( AuthInfoTypeAPIKey AuthInfoType = "api-key" AuthInfoTypeCopilotAPIToken AuthInfoType = "copilot-api-token" AuthInfoTypeEnv AuthInfoType = "env" - AuthInfoTypeGHCLI AuthInfoType = "gh-cli" + AuthInfoTypeGhCLI AuthInfoType = "gh-cli" AuthInfoTypeHMAC AuthInfoType = "hmac" AuthInfoTypeToken AuthInfoType = "token" AuthInfoTypeUser AuthInfoType = "user" @@ -7162,7 +7162,7 @@ const ( type CopilotAPITokenAuthInfoHost string const ( - CopilotAPITokenAuthInfoHostHTTPSGitHubCom CopilotAPITokenAuthInfoHost = "https://github.com" + CopilotAPITokenAuthInfoHostHTTPSGithubCom CopilotAPITokenAuthInfoHost = "https://github.com" ) // Server transport type: stdio, http, sse (deprecated), or memory @@ -7281,14 +7281,14 @@ const ( type HMACAuthInfoHost string const ( - HMACAuthInfoHostHTTPSGitHubCom HMACAuthInfoHost = "https://github.com" + HMACAuthInfoHostHTTPSGithubCom HMACAuthInfoHost = "https://github.com" ) // Constant value. Always "github". -type InstalledPluginSourceGitHubSource string +type InstalledPluginSourceGithubSource string const ( - InstalledPluginSourceGitHubSourceGitHub InstalledPluginSourceGitHubSource = "github" + InstalledPluginSourceGithubSourceGithub InstalledPluginSourceGithubSource = "github" ) // Constant value. Always "local". @@ -7767,17 +7767,17 @@ const ( ) // Type of GitHub reference -// Experimental: PushAttachmentGitHubReferenceType is part of an experimental API and may +// Experimental: PushAttachmentGithubReferenceType is part of an experimental API and may // change or be removed. -type PushAttachmentGitHubReferenceType string +type PushAttachmentGithubReferenceType string const ( // GitHub discussion reference. - PushAttachmentGitHubReferenceTypeDiscussion PushAttachmentGitHubReferenceType = "discussion" + PushAttachmentGithubReferenceTypeDiscussion PushAttachmentGithubReferenceType = "discussion" // GitHub issue reference. - PushAttachmentGitHubReferenceTypeIssue PushAttachmentGitHubReferenceType = "issue" + PushAttachmentGithubReferenceTypeIssue PushAttachmentGithubReferenceType = "issue" // GitHub pull request reference. - PushAttachmentGitHubReferenceTypePr PushAttachmentGitHubReferenceType = "pr" + PushAttachmentGithubReferenceTypePr PushAttachmentGithubReferenceType = "pr" ) // Type discriminator for PushAttachment. @@ -7788,7 +7788,7 @@ const ( PushAttachmentTypeDirectory PushAttachmentType = "directory" PushAttachmentTypeExtensionContext PushAttachmentType = "extension_context" PushAttachmentTypeFile PushAttachmentType = "file" - PushAttachmentTypeGitHubReference PushAttachmentType = "github_reference" + PushAttachmentTypeGithubReference PushAttachmentType = "github_reference" PushAttachmentTypeSelection PushAttachmentType = "selection" ) @@ -7870,7 +7870,7 @@ const ( // Session repository is hosted on Azure DevOps. SessionContextHostTypeADO SessionContextHostType = "ado" // Session repository is hosted on GitHub. - SessionContextHostTypeGitHub SessionContextHostType = "github" + SessionContextHostTypeGithub SessionContextHostType = "github" ) // Error classification @@ -7923,10 +7923,10 @@ const ( ) // Constant value. Always "github". -type SessionInstalledPluginSourceGitHubSource string +type SessionInstalledPluginSourceGithubSource string const ( - SessionInstalledPluginSourceGitHubSourceGitHub SessionInstalledPluginSourceGitHubSource = "github" + SessionInstalledPluginSourceGithubSourceGithub SessionInstalledPluginSourceGithubSource = "github" ) // Constant value. Always "local". @@ -7979,7 +7979,7 @@ const ( // The working directory repository is hosted on Azure DevOps. SessionWorkingDirectoryContextHostTypeADO SessionWorkingDirectoryContextHostType = "ado" // The working directory repository is hosted on GitHub. - SessionWorkingDirectoryContextHostTypeGitHub SessionWorkingDirectoryContextHostType = "github" + SessionWorkingDirectoryContextHostTypeGithub SessionWorkingDirectoryContextHostType = "github" ) // Signal to send (default: SIGTERM) @@ -8269,7 +8269,7 @@ const ( // Workspace summary repository is hosted on Azure DevOps. WorkspaceSummaryHostTypeADO WorkspaceSummaryHostType = "ado" // Workspace summary repository is hosted on GitHub. - WorkspaceSummaryHostTypeGitHub WorkspaceSummaryHostType = "github" + WorkspaceSummaryHostTypeGithub WorkspaceSummaryHostType = "github" ) // Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration. @@ -8281,7 +8281,7 @@ const ( // Workspace repository is hosted on Azure DevOps. WorkspacesWorkspaceDetailsHostTypeADO WorkspacesWorkspaceDetailsHostType = "ado" // Workspace repository is hosted on GitHub. - WorkspacesWorkspaceDetailsHostTypeGitHub WorkspacesWorkspaceDetailsHostType = "github" + WorkspacesWorkspaceDetailsHostTypeGithub WorkspacesWorkspaceDetailsHostType = "github" ) type serverAPI struct { diff --git a/go/rpc/zrpc_encoding.go b/go/rpc/zrpc_encoding.go index 5c56fd951..fb74c808b 100644 --- a/go/rpc/zrpc_encoding.go +++ b/go/rpc/zrpc_encoding.go @@ -142,8 +142,8 @@ func unmarshalAttachment(data []byte) (Attachment, error) { return nil, err } return &d, nil - case AttachmentTypeGitHubReference: - var d AttachmentGitHubReference + case AttachmentTypeGithubReference: + var d AttachmentGithubReference if err := json.Unmarshal(data, &d); err != nil { return nil, err } @@ -214,8 +214,8 @@ func (r AttachmentFile) MarshalJSON() ([]byte, error) { }) } -func (r AttachmentGitHubReference) MarshalJSON() ([]byte, error) { - type alias AttachmentGitHubReference +func (r AttachmentGithubReference) MarshalJSON() ([]byte, error) { + type alias AttachmentGithubReference return json.Marshal(struct { Type AttachmentType `json:"type"` alias @@ -267,8 +267,8 @@ func unmarshalAuthInfo(data []byte) (AuthInfo, error) { return nil, err } return &d, nil - case AuthInfoTypeGHCLI: - var d GHCLIAuthInfo + case AuthInfoTypeGhCLI: + var d GhCLIAuthInfo if err := json.Unmarshal(data, &d); err != nil { return nil, err } @@ -340,8 +340,8 @@ func (r EnvAuthInfo) MarshalJSON() ([]byte, error) { }) } -func (r GHCLIAuthInfo) MarshalJSON() ([]byte, error) { - type alias GHCLIAuthInfo +func (r GhCLIAuthInfo) MarshalJSON() ([]byte, error) { + type alias GhCLIAuthInfo return json.Marshal(struct { Type AuthInfoType `json:"type"` alias @@ -789,8 +789,8 @@ func (r *HandlePendingToolCallRequest) UnmarshalJSON(data []byte) error { } func (r InstalledPluginSource) MarshalJSON() ([]byte, error) { - if r.InstalledPluginSourceGitHub != nil { - return json.Marshal(r.InstalledPluginSourceGitHub) + if r.InstalledPluginSourceGithub != nil { + return json.Marshal(r.InstalledPluginSourceGithub) } if r.InstalledPluginSourceLocal != nil { return json.Marshal(r.InstalledPluginSourceLocal) @@ -810,9 +810,9 @@ func (r *InstalledPluginSource) UnmarshalJSON(data []byte) error { return nil } { - var value InstalledPluginSourceGitHub + var value InstalledPluginSourceGithub if err := json.Unmarshal(data, &value); err == nil { - *r = InstalledPluginSource{InstalledPluginSourceGitHub: &value} + *r = InstalledPluginSource{InstalledPluginSourceGithub: &value} return nil } } @@ -2226,8 +2226,8 @@ func unmarshalPushAttachment(data []byte) (PushAttachment, error) { return nil, err } return &d, nil - case PushAttachmentTypeGitHubReference: - var d PushAttachmentGitHubReference + case PushAttachmentTypeGithubReference: + var d PushAttachmentGithubReference if err := json.Unmarshal(data, &d); err != nil { return nil, err } @@ -2298,8 +2298,8 @@ func (r PushAttachmentFile) MarshalJSON() ([]byte, error) { }) } -func (r PushAttachmentGitHubReference) MarshalJSON() ([]byte, error) { - type alias PushAttachmentGitHubReference +func (r PushAttachmentGithubReference) MarshalJSON() ([]byte, error) { + type alias PushAttachmentGithubReference return json.Marshal(struct { Type PushAttachmentType `json:"type"` alias @@ -2389,8 +2389,8 @@ func (r *SendRequest) UnmarshalJSON(data []byte) error { } func (r SessionInstalledPluginSource) MarshalJSON() ([]byte, error) { - if r.SessionInstalledPluginSourceGitHub != nil { - return json.Marshal(r.SessionInstalledPluginSourceGitHub) + if r.SessionInstalledPluginSourceGithub != nil { + return json.Marshal(r.SessionInstalledPluginSourceGithub) } if r.SessionInstalledPluginSourceLocal != nil { return json.Marshal(r.SessionInstalledPluginSourceLocal) @@ -2410,9 +2410,9 @@ func (r *SessionInstalledPluginSource) UnmarshalJSON(data []byte) error { return nil } { - var value SessionInstalledPluginSourceGitHub + var value SessionInstalledPluginSourceGithub if err := json.Unmarshal(data, &value); err == nil { - *r = SessionInstalledPluginSource{SessionInstalledPluginSourceGitHub: &value} + *r = SessionInstalledPluginSource{SessionInstalledPluginSourceGithub: &value} return nil } } diff --git a/go/rpc/zsession_events.go b/go/rpc/zsession_events.go index 5f877a7b7..7f0337b9d 100644 --- a/go/rpc/zsession_events.go +++ b/go/rpc/zsession_events.go @@ -3251,7 +3251,7 @@ const ( // Repository is hosted on Azure DevOps. WorkingDirectoryContextHostTypeADO WorkingDirectoryContextHostType = "ado" // Repository is hosted on GitHub. - WorkingDirectoryContextHostTypeGitHub WorkingDirectoryContextHostType = "github" + WorkingDirectoryContextHostTypeGithub WorkingDirectoryContextHostType = "github" ) // Whether the file was newly created or updated diff --git a/go/zsession_events.go b/go/zsession_events.go index 70ce3e6d5..a4331308c 100644 --- a/go/zsession_events.go +++ b/go/zsession_events.go @@ -29,8 +29,8 @@ type ( AttachmentExtensionContext = rpc.AttachmentExtensionContext AttachmentFile = rpc.AttachmentFile AttachmentFileLineRange = rpc.AttachmentFileLineRange - AttachmentGitHubReference = rpc.AttachmentGitHubReference - AttachmentGitHubReferenceType = rpc.AttachmentGitHubReferenceType + AttachmentGithubReference = rpc.AttachmentGithubReference + AttachmentGithubReferenceType = rpc.AttachmentGithubReferenceType AttachmentSelection = rpc.AttachmentSelection AttachmentSelectionDetails = rpc.AttachmentSelectionDetails AttachmentSelectionDetailsEnd = rpc.AttachmentSelectionDetailsEnd @@ -284,14 +284,14 @@ const ( AssistantUsageAPIEndpointResponses = rpc.AssistantUsageAPIEndpointResponses AssistantUsageAPIEndpointV1Messages = rpc.AssistantUsageAPIEndpointV1Messages AssistantUsageAPIEndpointWsResponses = rpc.AssistantUsageAPIEndpointWsResponses - AttachmentGitHubReferenceTypeDiscussion = rpc.AttachmentGitHubReferenceTypeDiscussion - AttachmentGitHubReferenceTypeIssue = rpc.AttachmentGitHubReferenceTypeIssue - AttachmentGitHubReferenceTypePr = rpc.AttachmentGitHubReferenceTypePr + AttachmentGithubReferenceTypeDiscussion = rpc.AttachmentGithubReferenceTypeDiscussion + AttachmentGithubReferenceTypeIssue = rpc.AttachmentGithubReferenceTypeIssue + AttachmentGithubReferenceTypePr = rpc.AttachmentGithubReferenceTypePr AttachmentTypeBlob = rpc.AttachmentTypeBlob AttachmentTypeDirectory = rpc.AttachmentTypeDirectory AttachmentTypeExtensionContext = rpc.AttachmentTypeExtensionContext AttachmentTypeFile = rpc.AttachmentTypeFile - AttachmentTypeGitHubReference = rpc.AttachmentTypeGitHubReference + AttachmentTypeGithubReference = rpc.AttachmentTypeGithubReference AttachmentTypeSelection = rpc.AttachmentTypeSelection AutoModeSwitchResponseNo = rpc.AutoModeSwitchResponseNo AutoModeSwitchResponseYes = rpc.AutoModeSwitchResponseYes @@ -522,7 +522,7 @@ const ( UserToolSessionApprovalKindRead = rpc.UserToolSessionApprovalKindRead UserToolSessionApprovalKindWrite = rpc.UserToolSessionApprovalKindWrite WorkingDirectoryContextHostTypeADO = rpc.WorkingDirectoryContextHostTypeADO - WorkingDirectoryContextHostTypeGitHub = rpc.WorkingDirectoryContextHostTypeGitHub + WorkingDirectoryContextHostTypeGithub = rpc.WorkingDirectoryContextHostTypeGithub WorkspaceFileChangedOperationCreate = rpc.WorkspaceFileChangedOperationCreate WorkspaceFileChangedOperationUpdate = rpc.WorkspaceFileChangedOperationUpdate ) diff --git a/scripts/codegen/go.ts b/scripts/codegen/go.ts index 42a37b8bd..4c0a7a204 100644 --- a/scripts/codegen/go.ts +++ b/scripts/codegen/go.ts @@ -73,9 +73,8 @@ const EXTERNAL_SCHEMA_GO_IMPORT: Record = { // ── Utilities ─────────────────────────────────────────────────────────────── // Go initialisms that should be all-caps -const goInitialisms = new Set(["id", "ui", "uri", "url", "api", "http", "https", "json", "xml", "html", "css", "sql", "ssh", "tcp", "udp", "ip", "rpc", "mime", "mcp", "sse", "ado", "cli", "gh", "hmac", "fs", "utc", "sdk"]); +const goInitialisms = new Set(["id", "ui", "uri", "url", "api", "http", "https", "json", "xml", "html", "css", "sql", "ssh", "tcp", "udp", "ip", "rpc", "mime", "mcp", "sse", "ado", "cli", "hmac", "fs", "utc", "sdk"]); const goIdentifierCasingOverrides = new Map([ - ["github", "GitHub"], ["urls", "URLs"], ["uris", "URIs"], ["ids", "IDs"],