diff --git a/.github/actions/setup-copilot/action.yml b/.github/actions/setup-copilot/action.yml index 94cc00e88..4b5ef0ef8 100644 --- a/.github/actions/setup-copilot/action.yml +++ b/.github/actions/setup-copilot/action.yml @@ -8,10 +8,15 @@ runs: using: "composite" steps: - uses: actions/setup-node@v6 + if: runner.os != 'Windows' with: cache: "npm" cache-dependency-path: "./nodejs/package-lock.json" node-version: 22 + - uses: actions/setup-node@v6 + if: runner.os == 'Windows' + with: + node-version: 22 - name: Install dependencies run: npm --prefix "$(pwd)/nodejs" ci --ignore-scripts shell: bash diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs index a4cd9abae..a93789c9a 100644 --- a/dotnet/src/Generated/Rpc.cs +++ b/dotnet/src/Generated/Rpc.cs @@ -4996,6 +4996,8 @@ internal ServerRpc(JsonRpc rpc) } /// Calls "ping". + /// Optional message to echo back. + /// The to monitor for cancellation requests. The default is . public async Task PingAsync(string? message = null, CancellationToken cancellationToken = default) { var request = new PingRequest { Message = message }; @@ -5003,6 +5005,8 @@ public async Task PingAsync(string? message = null, CancellationToke } /// Calls "connect". + /// Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN. + /// The to monitor for cancellation requests. The default is . internal async Task ConnectAsync(string? token = null, CancellationToken cancellationToken = default) { var request = new ConnectRequest { Token = token }; @@ -5042,6 +5046,8 @@ internal ServerModelsApi(JsonRpc rpc) } /// Calls "models.list". + /// GitHub token for per-user model listing. When provided, resolves this token to determine the user's Copilot plan and available models instead of using the global auth. + /// The to monitor for cancellation requests. The default is . public async Task ListAsync(string? gitHubToken = null, CancellationToken cancellationToken = default) { var request = new ModelsListRequest { GitHubToken = gitHubToken }; @@ -5060,6 +5066,8 @@ internal ServerToolsApi(JsonRpc rpc) } /// Calls "tools.list". + /// Optional model ID — when provided, the returned tool list reflects model-specific overrides. + /// The to monitor for cancellation requests. The default is . public async Task ListAsync(string? model = null, CancellationToken cancellationToken = default) { var request = new ToolsListRequest { Model = model }; @@ -5078,6 +5086,8 @@ internal ServerAccountApi(JsonRpc rpc) } /// Calls "account.getQuota". + /// GitHub token for per-user quota lookup. When provided, resolves this token to determine the user's quota instead of using the global auth. + /// The to monitor for cancellation requests. The default is . public async Task GetQuotaAsync(string? gitHubToken = null, CancellationToken cancellationToken = default) { var request = new AccountGetQuotaRequest { GitHubToken = gitHubToken }; @@ -5097,6 +5107,8 @@ internal ServerMcpApi(JsonRpc rpc) } /// Calls "mcp.discover". + /// Working directory used as context for discovery (e.g., plugin resolution). + /// The to monitor for cancellation requests. The default is . public async Task DiscoverAsync(string? workingDirectory = null, CancellationToken cancellationToken = default) { var request = new McpDiscoverRequest { WorkingDirectory = workingDirectory }; @@ -5118,12 +5130,16 @@ internal ServerMcpConfigApi(JsonRpc rpc) } /// Calls "mcp.config.list". + /// The to monitor for cancellation requests. The default is . public async Task ListAsync(CancellationToken cancellationToken = default) { return await CopilotClient.InvokeRpcAsync(_rpc, "mcp.config.list", [], cancellationToken); } /// Calls "mcp.config.add". + /// Unique name for the MCP server. + /// MCP server configuration (local/stdio or remote/http). + /// The to monitor for cancellation requests. The default is . public async Task AddAsync(string name, object config, CancellationToken cancellationToken = default) { var request = new McpConfigAddRequest { Name = name, Config = config }; @@ -5131,6 +5147,9 @@ public async Task AddAsync(string name, object config, CancellationToken cancell } /// Calls "mcp.config.update". + /// Name of the MCP server to update. + /// MCP server configuration (local/stdio or remote/http). + /// The to monitor for cancellation requests. The default is . public async Task UpdateAsync(string name, object config, CancellationToken cancellationToken = default) { var request = new McpConfigUpdateRequest { Name = name, Config = config }; @@ -5138,6 +5157,8 @@ public async Task UpdateAsync(string name, object config, CancellationToken canc } /// Calls "mcp.config.remove". + /// Name of the MCP server to remove. + /// The to monitor for cancellation requests. The default is . public async Task RemoveAsync(string name, CancellationToken cancellationToken = default) { var request = new McpConfigRemoveRequest { Name = name }; @@ -5145,6 +5166,8 @@ public async Task RemoveAsync(string name, CancellationToken cancellationToken = } /// Calls "mcp.config.enable". + /// 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. + /// The to monitor for cancellation requests. The default is . public async Task EnableAsync(IList names, CancellationToken cancellationToken = default) { var request = new McpConfigEnableRequest { Names = names }; @@ -5152,6 +5175,8 @@ public async Task EnableAsync(IList names, CancellationToken cancellatio } /// Calls "mcp.config.disable". + /// 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. + /// The to monitor for cancellation requests. The default is . public async Task DisableAsync(IList names, CancellationToken cancellationToken = default) { var request = new McpConfigDisableRequest { Names = names }; @@ -5171,6 +5196,9 @@ internal ServerSkillsApi(JsonRpc rpc) } /// Calls "skills.discover". + /// Optional list of project directory paths to scan for project-scoped skills. + /// Optional list of additional skill directory paths to include. + /// The to monitor for cancellation requests. The default is . public async Task DiscoverAsync(IList? projectPaths = null, IList? skillDirectories = null, CancellationToken cancellationToken = default) { var request = new SkillsDiscoverRequest { ProjectPaths = projectPaths, SkillDirectories = skillDirectories }; @@ -5192,6 +5220,8 @@ internal ServerSkillsConfigApi(JsonRpc rpc) } /// Calls "skills.config.setDisabledSkills". + /// List of skill names to disable. + /// The to monitor for cancellation requests. The default is . public async Task SetDisabledSkillsAsync(IList disabledSkills, CancellationToken cancellationToken = default) { var request = new SkillsConfigSetDisabledSkillsRequest { DisabledSkills = disabledSkills }; @@ -5210,6 +5240,10 @@ internal ServerSessionFsApi(JsonRpc rpc) } /// Calls "sessionFs.setProvider". + /// Initial working directory for sessions. + /// Path within each session's SessionFs where the runtime stores files for that session. + /// Path conventions used by this filesystem. + /// The to monitor for cancellation requests. The default is . public async Task SetProviderAsync(string initialCwd, string sessionStatePath, SessionFsSetProviderConventions conventions, CancellationToken cancellationToken = default) { var request = new SessionFsSetProviderRequest { InitialCwd = initialCwd, SessionStatePath = sessionStatePath, Conventions = conventions }; @@ -5229,6 +5263,10 @@ internal ServerSessionsApi(JsonRpc rpc) } /// Calls "sessions.fork". + /// Source session ID to fork from. + /// Optional event ID boundary. When provided, the fork includes only events before this ID (exclusive). When omitted, all events are included. + /// Optional friendly name to assign to the forked session. + /// The to monitor for cancellation requests. The default is . public async Task ForkAsync(string sessionId, string? toEventId = null, string? name = null, CancellationToken cancellationToken = default) { var request = new SessionsForkRequest { SessionId = sessionId, ToEventId = toEventId, Name = name }; @@ -5337,6 +5375,7 @@ internal SessionRpc(JsonRpc rpc, string sessionId) public RemoteApi Remote { get; } /// Calls "session.suspend". + /// The to monitor for cancellation requests. The default is . public async Task SuspendAsync(CancellationToken cancellationToken = default) { var request = new SessionSuspendRequest { SessionId = _sessionId }; @@ -5344,6 +5383,11 @@ public async Task SuspendAsync(CancellationToken cancellationToken = default) } /// Calls "session.log". + /// Human-readable message. + /// Log severity level. Determines how the message is displayed in the timeline. Defaults to "info". + /// When true, the message is transient and not persisted to the session event log on disk. + /// Optional URL the user can open in their browser for more details. + /// The to monitor for cancellation requests. The default is . public async Task LogAsync(string message, SessionLogLevel? level = null, bool? ephemeral = null, string? url = null, CancellationToken cancellationToken = default) { var request = new LogRequest { SessionId = _sessionId, Message = message, Level = level, Ephemeral = ephemeral, Url = url }; @@ -5364,6 +5408,7 @@ internal AuthApi(JsonRpc rpc, string sessionId) } /// Calls "session.auth.getStatus". + /// The to monitor for cancellation requests. The default is . public async Task GetStatusAsync(CancellationToken cancellationToken = default) { var request = new SessionAuthGetStatusRequest { SessionId = _sessionId }; @@ -5384,6 +5429,7 @@ internal ModelApi(JsonRpc rpc, string sessionId) } /// Calls "session.model.getCurrent". + /// The to monitor for cancellation requests. The default is . public async Task GetCurrentAsync(CancellationToken cancellationToken = default) { var request = new SessionModelGetCurrentRequest { SessionId = _sessionId }; @@ -5391,6 +5437,10 @@ public async Task GetCurrentAsync(CancellationToken cancellationTo } /// Calls "session.model.switchTo". + /// Model identifier to switch to. + /// Reasoning effort level to use for the model. + /// Override individual model capabilities resolved by the runtime. + /// The to monitor for cancellation requests. The default is . public async Task SwitchToAsync(string modelId, string? reasoningEffort = null, ModelCapabilitiesOverride? modelCapabilities = null, CancellationToken cancellationToken = default) { var request = new ModelSwitchToRequest { SessionId = _sessionId, ModelId = modelId, ReasoningEffort = reasoningEffort, ModelCapabilities = modelCapabilities }; @@ -5411,6 +5461,8 @@ internal ModeApi(JsonRpc rpc, string sessionId) } /// Calls "session.mode.get". + /// The to monitor for cancellation requests. The default is . + /// The agent mode. Valid values: "interactive", "plan", "autopilot". public async Task GetAsync(CancellationToken cancellationToken = default) { var request = new SessionModeGetRequest { SessionId = _sessionId }; @@ -5418,6 +5470,8 @@ public async Task GetAsync(CancellationToken cancellationToken = de } /// Calls "session.mode.set". + /// The agent mode. Valid values: "interactive", "plan", "autopilot". + /// The to monitor for cancellation requests. The default is . public async Task SetAsync(SessionMode mode, CancellationToken cancellationToken = default) { var request = new ModeSetRequest { SessionId = _sessionId, Mode = mode }; @@ -5438,6 +5492,7 @@ internal NameApi(JsonRpc rpc, string sessionId) } /// Calls "session.name.get". + /// The to monitor for cancellation requests. The default is . public async Task GetAsync(CancellationToken cancellationToken = default) { var request = new SessionNameGetRequest { SessionId = _sessionId }; @@ -5445,6 +5500,8 @@ public async Task GetAsync(CancellationToken cancellationToken = } /// Calls "session.name.set". + /// New session name (1–100 characters, trimmed of leading/trailing whitespace). + /// The to monitor for cancellation requests. The default is . public async Task SetAsync(string name, CancellationToken cancellationToken = default) { var request = new NameSetRequest { SessionId = _sessionId, Name = name }; @@ -5465,6 +5522,7 @@ internal PlanApi(JsonRpc rpc, string sessionId) } /// Calls "session.plan.read". + /// The to monitor for cancellation requests. The default is . public async Task ReadAsync(CancellationToken cancellationToken = default) { var request = new SessionPlanReadRequest { SessionId = _sessionId }; @@ -5472,6 +5530,8 @@ public async Task ReadAsync(CancellationToken cancellationToken } /// Calls "session.plan.update". + /// The new content for the plan file. + /// The to monitor for cancellation requests. The default is . public async Task UpdateAsync(string content, CancellationToken cancellationToken = default) { var request = new PlanUpdateRequest { SessionId = _sessionId, Content = content }; @@ -5479,6 +5539,7 @@ public async Task UpdateAsync(string content, CancellationToken cancellationToke } /// Calls "session.plan.delete". + /// The to monitor for cancellation requests. The default is . public async Task DeleteAsync(CancellationToken cancellationToken = default) { var request = new SessionPlanDeleteRequest { SessionId = _sessionId }; @@ -5499,6 +5560,7 @@ internal WorkspacesApi(JsonRpc rpc, string sessionId) } /// Calls "session.workspaces.getWorkspace". + /// The to monitor for cancellation requests. The default is . public async Task GetWorkspaceAsync(CancellationToken cancellationToken = default) { var request = new SessionWorkspacesGetWorkspaceRequest { SessionId = _sessionId }; @@ -5506,6 +5568,7 @@ public async Task GetWorkspaceAsync(CancellationTo } /// Calls "session.workspaces.listFiles". + /// The to monitor for cancellation requests. The default is . public async Task ListFilesAsync(CancellationToken cancellationToken = default) { var request = new SessionWorkspacesListFilesRequest { SessionId = _sessionId }; @@ -5513,6 +5576,8 @@ public async Task ListFilesAsync(CancellationToken ca } /// Calls "session.workspaces.readFile". + /// Relative path within the workspace files directory. + /// The to monitor for cancellation requests. The default is . public async Task ReadFileAsync(string path, CancellationToken cancellationToken = default) { var request = new WorkspacesReadFileRequest { SessionId = _sessionId, Path = path }; @@ -5520,6 +5585,9 @@ public async Task ReadFileAsync(string path, Cancellat } /// Calls "session.workspaces.createFile". + /// Relative path within the workspace files directory. + /// File content to write as a UTF-8 string. + /// The to monitor for cancellation requests. The default is . public async Task CreateFileAsync(string path, string content, CancellationToken cancellationToken = default) { var request = new WorkspacesCreateFileRequest { SessionId = _sessionId, Path = path, Content = content }; @@ -5540,6 +5608,7 @@ internal InstructionsApi(JsonRpc rpc, string sessionId) } /// Calls "session.instructions.getSources". + /// The to monitor for cancellation requests. The default is . public async Task GetSourcesAsync(CancellationToken cancellationToken = default) { var request = new SessionInstructionsGetSourcesRequest { SessionId = _sessionId }; @@ -5561,6 +5630,8 @@ internal FleetApi(JsonRpc rpc, string sessionId) } /// Calls "session.fleet.start". + /// Optional user prompt to combine with fleet instructions. + /// The to monitor for cancellation requests. The default is . public async Task StartAsync(string? prompt = null, CancellationToken cancellationToken = default) { var request = new FleetStartRequest { SessionId = _sessionId, Prompt = prompt }; @@ -5582,6 +5653,7 @@ internal AgentApi(JsonRpc rpc, string sessionId) } /// Calls "session.agent.list". + /// The to monitor for cancellation requests. The default is . public async Task ListAsync(CancellationToken cancellationToken = default) { var request = new SessionAgentListRequest { SessionId = _sessionId }; @@ -5589,6 +5661,7 @@ public async Task ListAsync(CancellationToken cancellationToken = def } /// Calls "session.agent.getCurrent". + /// The to monitor for cancellation requests. The default is . public async Task GetCurrentAsync(CancellationToken cancellationToken = default) { var request = new SessionAgentGetCurrentRequest { SessionId = _sessionId }; @@ -5596,6 +5669,8 @@ public async Task GetCurrentAsync(CancellationToken cance } /// Calls "session.agent.select". + /// Name of the custom agent to select. + /// The to monitor for cancellation requests. The default is . public async Task SelectAsync(string name, CancellationToken cancellationToken = default) { var request = new AgentSelectRequest { SessionId = _sessionId, Name = name }; @@ -5603,6 +5678,7 @@ public async Task SelectAsync(string name, CancellationToken } /// Calls "session.agent.deselect". + /// The to monitor for cancellation requests. The default is . public async Task DeselectAsync(CancellationToken cancellationToken = default) { var request = new SessionAgentDeselectRequest { SessionId = _sessionId }; @@ -5610,6 +5686,7 @@ public async Task DeselectAsync(CancellationToken cancellationToken = default) } /// Calls "session.agent.reload". + /// The to monitor for cancellation requests. The default is . public async Task ReloadAsync(CancellationToken cancellationToken = default) { var request = new SessionAgentReloadRequest { SessionId = _sessionId }; @@ -5631,6 +5708,12 @@ internal TasksApi(JsonRpc rpc, string sessionId) } /// Calls "session.tasks.startAgent". + /// Type of agent to start (e.g., 'explore', 'task', 'general-purpose'). + /// Task prompt for the agent. + /// Short name for the agent, used to generate a human-readable ID. + /// Short description of the task. + /// Optional model override. + /// The to monitor for cancellation requests. The default is . public async Task StartAgentAsync(string agentType, string prompt, string name, string? description = null, string? model = null, CancellationToken cancellationToken = default) { var request = new TasksStartAgentRequest { SessionId = _sessionId, AgentType = agentType, Prompt = prompt, Name = name, Description = description, Model = model }; @@ -5638,6 +5721,7 @@ public async Task StartAgentAsync(string agentType, strin } /// Calls "session.tasks.list". + /// The to monitor for cancellation requests. The default is . public async Task ListAsync(CancellationToken cancellationToken = default) { var request = new SessionTasksListRequest { SessionId = _sessionId }; @@ -5645,6 +5729,8 @@ public async Task ListAsync(CancellationToken cancellationToken = defa } /// Calls "session.tasks.promoteToBackground". + /// Task identifier. + /// The to monitor for cancellation requests. The default is . public async Task PromoteToBackgroundAsync(string id, CancellationToken cancellationToken = default) { var request = new TasksPromoteToBackgroundRequest { SessionId = _sessionId, Id = id }; @@ -5652,6 +5738,8 @@ public async Task PromoteToBackgroundAsync(strin } /// Calls "session.tasks.cancel". + /// Task identifier. + /// The to monitor for cancellation requests. The default is . public async Task CancelAsync(string id, CancellationToken cancellationToken = default) { var request = new TasksCancelRequest { SessionId = _sessionId, Id = id }; @@ -5659,6 +5747,8 @@ public async Task CancelAsync(string id, CancellationToken ca } /// Calls "session.tasks.remove". + /// Task identifier. + /// The to monitor for cancellation requests. The default is . public async Task RemoveAsync(string id, CancellationToken cancellationToken = default) { var request = new TasksRemoveRequest { SessionId = _sessionId, Id = id }; @@ -5666,6 +5756,10 @@ public async Task RemoveAsync(string id, CancellationToken ca } /// Calls "session.tasks.sendMessage". + /// Agent task identifier. + /// Message content to send to the agent. + /// Agent ID of the sender, if sent on behalf of another agent. + /// The to monitor for cancellation requests. The default is . public async Task SendMessageAsync(string id, string message, string? fromAgentId = null, CancellationToken cancellationToken = default) { var request = new TasksSendMessageRequest { SessionId = _sessionId, Id = id, Message = message, FromAgentId = fromAgentId }; @@ -5687,6 +5781,7 @@ internal SkillsApi(JsonRpc rpc, string sessionId) } /// Calls "session.skills.list". + /// The to monitor for cancellation requests. The default is . public async Task ListAsync(CancellationToken cancellationToken = default) { var request = new SessionSkillsListRequest { SessionId = _sessionId }; @@ -5694,6 +5789,8 @@ public async Task ListAsync(CancellationToken cancellationToken = def } /// Calls "session.skills.enable". + /// Name of the skill to enable. + /// The to monitor for cancellation requests. The default is . public async Task EnableAsync(string name, CancellationToken cancellationToken = default) { var request = new SkillsEnableRequest { SessionId = _sessionId, Name = name }; @@ -5701,6 +5798,8 @@ public async Task EnableAsync(string name, CancellationToken cancellationToken = } /// Calls "session.skills.disable". + /// Name of the skill to disable. + /// The to monitor for cancellation requests. The default is . public async Task DisableAsync(string name, CancellationToken cancellationToken = default) { var request = new SkillsDisableRequest { SessionId = _sessionId, Name = name }; @@ -5708,6 +5807,7 @@ public async Task DisableAsync(string name, CancellationToken cancellationToken } /// Calls "session.skills.reload". + /// The to monitor for cancellation requests. The default is . public async Task ReloadAsync(CancellationToken cancellationToken = default) { var request = new SessionSkillsReloadRequest { SessionId = _sessionId }; @@ -5730,6 +5830,7 @@ internal McpApi(JsonRpc rpc, string sessionId) } /// Calls "session.mcp.list". + /// The to monitor for cancellation requests. The default is . public async Task ListAsync(CancellationToken cancellationToken = default) { var request = new SessionMcpListRequest { SessionId = _sessionId }; @@ -5737,6 +5838,8 @@ public async Task ListAsync(CancellationToken cancellationToken = } /// Calls "session.mcp.enable". + /// Name of the MCP server to enable. + /// The to monitor for cancellation requests. The default is . public async Task EnableAsync(string serverName, CancellationToken cancellationToken = default) { var request = new McpEnableRequest { SessionId = _sessionId, ServerName = serverName }; @@ -5744,6 +5847,8 @@ public async Task EnableAsync(string serverName, CancellationToken cancellationT } /// Calls "session.mcp.disable". + /// Name of the MCP server to disable. + /// The to monitor for cancellation requests. The default is . public async Task DisableAsync(string serverName, CancellationToken cancellationToken = default) { var request = new McpDisableRequest { SessionId = _sessionId, ServerName = serverName }; @@ -5751,6 +5856,7 @@ public async Task DisableAsync(string serverName, CancellationToken cancellation } /// Calls "session.mcp.reload". + /// The to monitor for cancellation requests. The default is . public async Task ReloadAsync(CancellationToken cancellationToken = default) { var request = new SessionMcpReloadRequest { SessionId = _sessionId }; @@ -5775,6 +5881,11 @@ internal McpOauthApi(JsonRpc rpc, string sessionId) } /// Calls "session.mcp.oauth.login". + /// Name of the remote MCP server to authenticate. + /// When true, clears any cached OAuth token for the server and runs a full new authorization. Use when the user explicitly wants to switch accounts or believes their session is stuck. + /// Optional override for the OAuth client display name shown on the consent screen. Applies to newly registered dynamic clients only — existing registrations keep the name they were created with. When omitted, the runtime applies a neutral fallback; callers driving interactive auth should pass their own surface-specific label so the consent screen matches the product the user sees. + /// 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. + /// The to monitor for cancellation requests. The default is . public async Task LoginAsync(string serverName, bool? forceReauth = null, string? clientName = null, string? callbackSuccessMessage = null, CancellationToken cancellationToken = default) { var request = new McpOauthLoginRequest { SessionId = _sessionId, ServerName = serverName, ForceReauth = forceReauth, ClientName = clientName, CallbackSuccessMessage = callbackSuccessMessage }; @@ -5796,6 +5907,7 @@ internal PluginsApi(JsonRpc rpc, string sessionId) } /// Calls "session.plugins.list". + /// The to monitor for cancellation requests. The default is . public async Task ListAsync(CancellationToken cancellationToken = default) { var request = new SessionPluginsListRequest { SessionId = _sessionId }; @@ -5817,6 +5929,7 @@ internal ExtensionsApi(JsonRpc rpc, string sessionId) } /// Calls "session.extensions.list". + /// The to monitor for cancellation requests. The default is . public async Task ListAsync(CancellationToken cancellationToken = default) { var request = new SessionExtensionsListRequest { SessionId = _sessionId }; @@ -5824,6 +5937,8 @@ public async Task ListAsync(CancellationToken cancellationToken = } /// Calls "session.extensions.enable". + /// Source-qualified extension ID to enable. + /// The to monitor for cancellation requests. The default is . public async Task EnableAsync(string id, CancellationToken cancellationToken = default) { var request = new ExtensionsEnableRequest { SessionId = _sessionId, Id = id }; @@ -5831,6 +5946,8 @@ public async Task EnableAsync(string id, CancellationToken cancellationToken = d } /// Calls "session.extensions.disable". + /// Source-qualified extension ID to disable. + /// The to monitor for cancellation requests. The default is . public async Task DisableAsync(string id, CancellationToken cancellationToken = default) { var request = new ExtensionsDisableRequest { SessionId = _sessionId, Id = id }; @@ -5838,6 +5955,7 @@ public async Task DisableAsync(string id, CancellationToken cancellationToken = } /// Calls "session.extensions.reload". + /// The to monitor for cancellation requests. The default is . public async Task ReloadAsync(CancellationToken cancellationToken = default) { var request = new SessionExtensionsReloadRequest { SessionId = _sessionId }; @@ -5858,6 +5976,10 @@ internal ToolsApi(JsonRpc rpc, string sessionId) } /// Calls "session.tools.handlePendingToolCall". + /// Request ID of the pending tool call. + /// Tool call result (string or expanded result object). + /// Error message if the tool call failed. + /// The to monitor for cancellation requests. The default is . public async Task HandlePendingToolCallAsync(string requestId, object? result = null, string? error = null, CancellationToken cancellationToken = default) { var request = new HandlePendingToolCallRequest { SessionId = _sessionId, RequestId = requestId, Result = result, Error = error }; @@ -5878,6 +6000,8 @@ internal CommandsApi(JsonRpc rpc, string sessionId) } /// Calls "session.commands.list". + /// The request parameters. + /// The to monitor for cancellation requests. The default is . public async Task ListAsync(CommandsListRequest? request = null, CancellationToken cancellationToken = default) { var rpcRequest = new CommandsListRequestWithSession { SessionId = _sessionId, IncludeBuiltins = request?.IncludeBuiltins, IncludeSkills = request?.IncludeSkills, IncludeClientCommands = request?.IncludeClientCommands }; @@ -5885,6 +6009,9 @@ public async Task ListAsync(CommandsListRequest? request = null, Ca } /// Calls "session.commands.invoke". + /// Command name. Leading slashes are stripped and the name is matched case-insensitively. + /// Raw input after the command name. + /// The to monitor for cancellation requests. The default is . public async Task InvokeAsync(string name, string? input = null, CancellationToken cancellationToken = default) { var request = new CommandsInvokeRequest { SessionId = _sessionId, Name = name, Input = input }; @@ -5892,6 +6019,9 @@ public async Task InvokeAsync(string name, string? } /// Calls "session.commands.handlePendingCommand". + /// Request ID from the command invocation event. + /// Error message if the command handler failed. + /// The to monitor for cancellation requests. The default is . public async Task HandlePendingCommandAsync(string requestId, string? error = null, CancellationToken cancellationToken = default) { var request = new CommandsHandlePendingCommandRequest { SessionId = _sessionId, RequestId = requestId, Error = error }; @@ -5899,6 +6029,9 @@ public async Task HandlePendingCommandAsync( } /// Calls "session.commands.respondToQueuedCommand". + /// Request ID from the queued command event. + /// Result of the queued command execution. + /// The to monitor for cancellation requests. The default is . public async Task RespondToQueuedCommandAsync(string requestId, QueuedCommandResult result, CancellationToken cancellationToken = default) { var request = new CommandsRespondToQueuedCommandRequest { SessionId = _sessionId, RequestId = requestId, Result = result }; @@ -5919,6 +6052,10 @@ internal UiApi(JsonRpc rpc, string sessionId) } /// Calls "session.ui.elicitation". + /// Message describing what information is needed from the user. + /// JSON Schema describing the form fields to present to the user. + /// The to monitor for cancellation requests. The default is . + /// The elicitation response (accept with form values, decline, or cancel). public async Task ElicitationAsync(string message, UIElicitationSchema requestedSchema, CancellationToken cancellationToken = default) { var request = new UIElicitationRequest { SessionId = _sessionId, Message = message, RequestedSchema = requestedSchema }; @@ -5926,6 +6063,9 @@ public async Task ElicitationAsync(string message, UIElic } /// Calls "session.ui.handlePendingElicitation". + /// The unique request ID from the elicitation.requested event. + /// The elicitation response (accept with form values, decline, or cancel). + /// The to monitor for cancellation requests. The default is . public async Task HandlePendingElicitationAsync(string requestId, UIElicitationResponse result, CancellationToken cancellationToken = default) { var request = new UIHandlePendingElicitationRequest { SessionId = _sessionId, RequestId = requestId, Result = result }; @@ -5946,6 +6086,9 @@ internal PermissionsApi(JsonRpc rpc, string sessionId) } /// Calls "session.permissions.handlePendingPermissionRequest". + /// Request ID of the pending permission request. + /// The result parameter. + /// The to monitor for cancellation requests. The default is . public async Task HandlePendingPermissionRequestAsync(string requestId, PermissionDecision result, CancellationToken cancellationToken = default) { var request = new PermissionDecisionRequest { SessionId = _sessionId, RequestId = requestId, Result = result }; @@ -5953,6 +6096,8 @@ public async Task HandlePendingPermissionRequestAsync(s } /// Calls "session.permissions.setApproveAll". + /// Whether to auto-approve all tool permission requests. + /// The to monitor for cancellation requests. The default is . public async Task SetApproveAllAsync(bool enabled, CancellationToken cancellationToken = default) { var request = new PermissionsSetApproveAllRequest { SessionId = _sessionId, Enabled = enabled }; @@ -5960,6 +6105,7 @@ public async Task SetApproveAllAsync(bool enable } /// Calls "session.permissions.resetSessionApprovals". + /// The to monitor for cancellation requests. The default is . public async Task ResetSessionApprovalsAsync(CancellationToken cancellationToken = default) { var request = new PermissionsResetSessionApprovalsRequest { SessionId = _sessionId }; @@ -5980,6 +6126,10 @@ internal ShellApi(JsonRpc rpc, string sessionId) } /// Calls "session.shell.exec". + /// Shell command to execute. + /// Working directory (defaults to session working directory). + /// Timeout in milliseconds (default: 30000). + /// The to monitor for cancellation requests. The default is . public async Task ExecAsync(string command, string? cwd = null, TimeSpan? timeout = null, CancellationToken cancellationToken = default) { var request = new ShellExecRequest { SessionId = _sessionId, Command = command, Cwd = cwd, Timeout = timeout }; @@ -5987,6 +6137,9 @@ public async Task ExecAsync(string command, string? cwd = null, } /// Calls "session.shell.kill". + /// Process identifier returned by shell.exec. + /// Signal to send (default: SIGTERM). + /// The to monitor for cancellation requests. The default is . public async Task KillAsync(string processId, ShellKillSignal? signal = null, CancellationToken cancellationToken = default) { var request = new ShellKillRequest { SessionId = _sessionId, ProcessId = processId, Signal = signal }; @@ -6008,6 +6161,7 @@ internal HistoryApi(JsonRpc rpc, string sessionId) } /// Calls "session.history.compact". + /// The to monitor for cancellation requests. The default is . public async Task CompactAsync(CancellationToken cancellationToken = default) { var request = new SessionHistoryCompactRequest { SessionId = _sessionId }; @@ -6015,6 +6169,8 @@ public async Task CompactAsync(CancellationToken cancellat } /// Calls "session.history.truncate". + /// Event ID to truncate to. This event and all events after it are removed from the session. + /// The to monitor for cancellation requests. The default is . public async Task TruncateAsync(string eventId, CancellationToken cancellationToken = default) { var request = new HistoryTruncateRequest { SessionId = _sessionId, EventId = eventId }; @@ -6036,6 +6192,7 @@ internal UsageApi(JsonRpc rpc, string sessionId) } /// Calls "session.usage.getMetrics". + /// The to monitor for cancellation requests. The default is . public async Task GetMetricsAsync(CancellationToken cancellationToken = default) { var request = new SessionUsageGetMetricsRequest { SessionId = _sessionId }; @@ -6057,6 +6214,8 @@ internal RemoteApi(JsonRpc rpc, string sessionId) } /// Calls "session.remote.enable". + /// Per-session remote mode. "off" disables remote, "export" exports session events to Mission Control without enabling remote steering, "on" enables both export and remote steering. + /// The to monitor for cancellation requests. The default is . public async Task EnableAsync(RemoteSessionMode? mode = null, CancellationToken cancellationToken = default) { var request = new RemoteEnableRequest { SessionId = _sessionId, Mode = mode }; @@ -6064,6 +6223,7 @@ public async Task EnableAsync(RemoteSessionMode? mode = null } /// Calls "session.remote.disable". + /// The to monitor for cancellation requests. The default is . public async Task DisableAsync(CancellationToken cancellationToken = default) { var request = new SessionRemoteDisableRequest { SessionId = _sessionId }; @@ -6075,24 +6235,49 @@ public async Task DisableAsync(CancellationToken cancellationToken = default) public interface ISessionFsHandler { /// Handles "sessionFs.readFile". + /// The request parameters. + /// The to monitor for cancellation requests. The default is . Task ReadFileAsync(SessionFsReadFileRequest request, CancellationToken cancellationToken = default); /// Handles "sessionFs.writeFile". + /// The request parameters. + /// The to monitor for cancellation requests. The default is . + /// Describes a filesystem error. Task WriteFileAsync(SessionFsWriteFileRequest request, CancellationToken cancellationToken = default); /// Handles "sessionFs.appendFile". + /// The request parameters. + /// The to monitor for cancellation requests. The default is . + /// Describes a filesystem error. Task AppendFileAsync(SessionFsAppendFileRequest request, CancellationToken cancellationToken = default); /// Handles "sessionFs.exists". + /// The request parameters. + /// The to monitor for cancellation requests. The default is . Task ExistsAsync(SessionFsExistsRequest request, CancellationToken cancellationToken = default); /// Handles "sessionFs.stat". + /// The request parameters. + /// The to monitor for cancellation requests. The default is . Task StatAsync(SessionFsStatRequest request, CancellationToken cancellationToken = default); /// Handles "sessionFs.mkdir". + /// The request parameters. + /// The to monitor for cancellation requests. The default is . + /// Describes a filesystem error. Task MkdirAsync(SessionFsMkdirRequest request, CancellationToken cancellationToken = default); /// Handles "sessionFs.readdir". + /// The request parameters. + /// The to monitor for cancellation requests. The default is . Task ReaddirAsync(SessionFsReaddirRequest request, CancellationToken cancellationToken = default); /// Handles "sessionFs.readdirWithTypes". + /// The request parameters. + /// The to monitor for cancellation requests. The default is . Task ReaddirWithTypesAsync(SessionFsReaddirWithTypesRequest request, CancellationToken cancellationToken = default); /// Handles "sessionFs.rm". + /// The request parameters. + /// The to monitor for cancellation requests. The default is . + /// Describes a filesystem error. Task RmAsync(SessionFsRmRequest request, CancellationToken cancellationToken = default); /// Handles "sessionFs.rename". + /// The request parameters. + /// The to monitor for cancellation requests. The default is . + /// Describes a filesystem error. Task RenameAsync(SessionFsRenameRequest request, CancellationToken cancellationToken = default); } diff --git a/go/rpc/zrpc.go b/go/rpc/zrpc.go index 43940db6c..91481b733 100644 --- a/go/rpc/zrpc.go +++ b/go/rpc/zrpc.go @@ -2642,6 +2642,9 @@ type serverApi struct { type ServerAccountApi serverApi +// GetQuota calls account.getQuota. +// +// RPC method: account.getQuota. func (a *ServerAccountApi) GetQuota(ctx context.Context, params ...*AccountGetQuotaRequest) (*AccountGetQuotaResult, error) { var requestParams *AccountGetQuotaRequest if len(params) > 0 { @@ -2660,6 +2663,9 @@ func (a *ServerAccountApi) GetQuota(ctx context.Context, params ...*AccountGetQu type ServerMcpApi serverApi +// Discover calls mcp.discover. +// +// RPC method: mcp.discover. func (a *ServerMcpApi) Discover(ctx context.Context, params *McpDiscoverRequest) (*McpDiscoverResult, error) { raw, err := a.client.Request("mcp.discover", params) if err != nil { @@ -2674,6 +2680,9 @@ func (a *ServerMcpApi) Discover(ctx context.Context, params *McpDiscoverRequest) type ServerMcpConfigApi serverApi +// Add calls mcp.config.add. +// +// RPC method: mcp.config.add. func (a *ServerMcpConfigApi) Add(ctx context.Context, params *McpConfigAddRequest) (*McpConfigAddResult, error) { raw, err := a.client.Request("mcp.config.add", params) if err != nil { @@ -2686,6 +2695,9 @@ func (a *ServerMcpConfigApi) Add(ctx context.Context, params *McpConfigAddReques return &result, nil } +// Disable calls mcp.config.disable. +// +// RPC method: mcp.config.disable. func (a *ServerMcpConfigApi) Disable(ctx context.Context, params *McpConfigDisableRequest) (*McpConfigDisableResult, error) { raw, err := a.client.Request("mcp.config.disable", params) if err != nil { @@ -2698,6 +2710,9 @@ func (a *ServerMcpConfigApi) Disable(ctx context.Context, params *McpConfigDisab return &result, nil } +// Enable calls mcp.config.enable. +// +// RPC method: mcp.config.enable. func (a *ServerMcpConfigApi) Enable(ctx context.Context, params *McpConfigEnableRequest) (*McpConfigEnableResult, error) { raw, err := a.client.Request("mcp.config.enable", params) if err != nil { @@ -2710,6 +2725,9 @@ func (a *ServerMcpConfigApi) Enable(ctx context.Context, params *McpConfigEnable return &result, nil } +// List calls mcp.config.list. +// +// RPC method: mcp.config.list. func (a *ServerMcpConfigApi) List(ctx context.Context) (*McpConfigList, error) { raw, err := a.client.Request("mcp.config.list", nil) if err != nil { @@ -2722,6 +2740,9 @@ func (a *ServerMcpConfigApi) List(ctx context.Context) (*McpConfigList, error) { return &result, nil } +// Remove calls mcp.config.remove. +// +// RPC method: mcp.config.remove. func (a *ServerMcpConfigApi) Remove(ctx context.Context, params *McpConfigRemoveRequest) (*McpConfigRemoveResult, error) { raw, err := a.client.Request("mcp.config.remove", params) if err != nil { @@ -2734,6 +2755,9 @@ func (a *ServerMcpConfigApi) Remove(ctx context.Context, params *McpConfigRemove return &result, nil } +// Update calls mcp.config.update. +// +// RPC method: mcp.config.update. func (a *ServerMcpConfigApi) Update(ctx context.Context, params *McpConfigUpdateRequest) (*McpConfigUpdateResult, error) { raw, err := a.client.Request("mcp.config.update", params) if err != nil { @@ -2752,6 +2776,9 @@ func (s *ServerMcpApi) Config() *ServerMcpConfigApi { type ServerModelsApi serverApi +// List calls models.list. +// +// RPC method: models.list. func (a *ServerModelsApi) List(ctx context.Context, params ...*ModelsListRequest) (*ModelList, error) { var requestParams *ModelsListRequest if len(params) > 0 { @@ -2770,6 +2797,9 @@ func (a *ServerModelsApi) List(ctx context.Context, params ...*ModelsListRequest type ServerSessionFsApi serverApi +// SetProvider calls sessionFs.setProvider. +// +// RPC method: sessionFs.setProvider. func (a *ServerSessionFsApi) SetProvider(ctx context.Context, params *SessionFsSetProviderRequest) (*SessionFsSetProviderResult, error) { raw, err := a.client.Request("sessionFs.setProvider", params) if err != nil { @@ -2785,6 +2815,9 @@ func (a *ServerSessionFsApi) SetProvider(ctx context.Context, params *SessionFsS // Experimental: ServerSessionsApi contains experimental APIs that may change or be removed. type ServerSessionsApi serverApi +// Fork calls sessions.fork. +// +// RPC method: sessions.fork. func (a *ServerSessionsApi) Fork(ctx context.Context, params *SessionsForkRequest) (*SessionsForkResult, error) { raw, err := a.client.Request("sessions.fork", params) if err != nil { @@ -2799,6 +2832,9 @@ func (a *ServerSessionsApi) Fork(ctx context.Context, params *SessionsForkReques type ServerSkillsApi serverApi +// Discover calls skills.discover. +// +// RPC method: skills.discover. func (a *ServerSkillsApi) Discover(ctx context.Context, params *SkillsDiscoverRequest) (*ServerSkillList, error) { raw, err := a.client.Request("skills.discover", params) if err != nil { @@ -2813,6 +2849,9 @@ func (a *ServerSkillsApi) Discover(ctx context.Context, params *SkillsDiscoverRe type ServerSkillsConfigApi serverApi +// SetDisabledSkills calls skills.config.setDisabledSkills. +// +// RPC method: skills.config.setDisabledSkills. func (a *ServerSkillsConfigApi) SetDisabledSkills(ctx context.Context, params *SkillsConfigSetDisabledSkillsRequest) (*SkillsConfigSetDisabledSkillsResult, error) { raw, err := a.client.Request("skills.config.setDisabledSkills", params) if err != nil { @@ -2831,6 +2870,9 @@ func (s *ServerSkillsApi) Config() *ServerSkillsConfigApi { type ServerToolsApi serverApi +// List calls tools.list. +// +// RPC method: tools.list. func (a *ServerToolsApi) List(ctx context.Context, params *ToolsListRequest) (*ToolList, error) { raw, err := a.client.Request("tools.list", params) if err != nil { @@ -2857,6 +2899,9 @@ type ServerRpc struct { Tools *ServerToolsApi } +// Ping calls ping. +// +// RPC method: ping. func (a *ServerRpc) Ping(ctx context.Context, params *PingRequest) (*PingResult, error) { raw, err := a.common.client.Request("ping", params) if err != nil { @@ -2893,6 +2938,9 @@ type InternalServerRpc struct { common internalServerApi } +// Connect calls connect. +// +// RPC method: connect. // 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) { @@ -2921,6 +2969,9 @@ type sessionApi struct { // Experimental: AgentApi contains experimental APIs that may change or be removed. type AgentApi sessionApi +// Deselect calls session.agent.deselect. +// +// RPC method: session.agent.deselect. func (a *AgentApi) Deselect(ctx context.Context) (*AgentDeselectResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.agent.deselect", req) @@ -2934,6 +2985,9 @@ func (a *AgentApi) Deselect(ctx context.Context) (*AgentDeselectResult, error) { return &result, nil } +// GetCurrent calls session.agent.getCurrent. +// +// RPC method: session.agent.getCurrent. 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) @@ -2947,6 +3001,9 @@ func (a *AgentApi) GetCurrent(ctx context.Context) (*AgentGetCurrentResult, erro return &result, nil } +// List calls session.agent.list. +// +// RPC method: session.agent.list. 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) @@ -2960,6 +3017,9 @@ func (a *AgentApi) List(ctx context.Context) (*AgentList, error) { return &result, nil } +// Reload calls session.agent.reload. +// +// RPC method: session.agent.reload. 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) @@ -2973,6 +3033,9 @@ func (a *AgentApi) Reload(ctx context.Context) (*AgentReloadResult, error) { return &result, nil } +// Select calls session.agent.select. +// +// RPC method: session.agent.select. func (a *AgentApi) Select(ctx context.Context, params *AgentSelectRequest) (*AgentSelectResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -2991,6 +3054,9 @@ func (a *AgentApi) Select(ctx context.Context, params *AgentSelectRequest) (*Age type AuthApi sessionApi +// GetStatus calls session.auth.getStatus. +// +// RPC method: session.auth.getStatus. 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) @@ -3006,6 +3072,9 @@ func (a *AuthApi) GetStatus(ctx context.Context) (*SessionAuthStatus, error) { type CommandsApi sessionApi +// HandlePendingCommand calls session.commands.handlePendingCommand. +// +// RPC method: session.commands.handlePendingCommand. func (a *CommandsApi) HandlePendingCommand(ctx context.Context, params *CommandsHandlePendingCommandRequest) (*CommandsHandlePendingCommandResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3025,6 +3094,9 @@ func (a *CommandsApi) HandlePendingCommand(ctx context.Context, params *Commands return &result, nil } +// Invoke calls session.commands.invoke. +// +// RPC method: session.commands.invoke. func (a *CommandsApi) Invoke(ctx context.Context, params *CommandsInvokeRequest) (SlashCommandInvocationResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3044,6 +3116,9 @@ func (a *CommandsApi) Invoke(ctx context.Context, params *CommandsInvokeRequest) return result, nil } +// List calls session.commands.list. +// +// RPC method: session.commands.list. func (a *CommandsApi) List(ctx context.Context, params ...*CommandsListRequest) (*CommandList, error) { var requestParams *CommandsListRequest if len(params) > 0 { @@ -3072,6 +3147,9 @@ func (a *CommandsApi) List(ctx context.Context, params ...*CommandsListRequest) return &result, nil } +// RespondToQueuedCommand calls session.commands.respondToQueuedCommand. +// +// RPC method: session.commands.respondToQueuedCommand. func (a *CommandsApi) RespondToQueuedCommand(ctx context.Context, params *CommandsRespondToQueuedCommandRequest) (*CommandsRespondToQueuedCommandResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3092,6 +3170,9 @@ func (a *CommandsApi) RespondToQueuedCommand(ctx context.Context, params *Comman // Experimental: ExtensionsApi contains experimental APIs that may change or be removed. type ExtensionsApi sessionApi +// Disable calls session.extensions.disable. +// +// RPC method: session.extensions.disable. func (a *ExtensionsApi) Disable(ctx context.Context, params *ExtensionsDisableRequest) (*ExtensionsDisableResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3108,6 +3189,9 @@ func (a *ExtensionsApi) Disable(ctx context.Context, params *ExtensionsDisableRe return &result, nil } +// Enable calls session.extensions.enable. +// +// RPC method: session.extensions.enable. func (a *ExtensionsApi) Enable(ctx context.Context, params *ExtensionsEnableRequest) (*ExtensionsEnableResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3124,6 +3208,9 @@ func (a *ExtensionsApi) Enable(ctx context.Context, params *ExtensionsEnableRequ return &result, nil } +// List calls session.extensions.list. +// +// RPC method: session.extensions.list. 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) @@ -3137,6 +3224,9 @@ func (a *ExtensionsApi) List(ctx context.Context) (*ExtensionList, error) { return &result, nil } +// Reload calls session.extensions.reload. +// +// RPC method: session.extensions.reload. func (a *ExtensionsApi) Reload(ctx context.Context) (*ExtensionsReloadResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.extensions.reload", req) @@ -3153,6 +3243,9 @@ func (a *ExtensionsApi) Reload(ctx context.Context) (*ExtensionsReloadResult, er // Experimental: FleetApi contains experimental APIs that may change or be removed. type FleetApi sessionApi +// Start calls session.fleet.start. +// +// RPC method: session.fleet.start. func (a *FleetApi) Start(ctx context.Context, params *FleetStartRequest) (*FleetStartResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3174,6 +3267,9 @@ func (a *FleetApi) Start(ctx context.Context, params *FleetStartRequest) (*Fleet // Experimental: HistoryApi contains experimental APIs that may change or be removed. type HistoryApi sessionApi +// Compact calls session.history.compact. +// +// RPC method: session.history.compact. func (a *HistoryApi) Compact(ctx context.Context) (*HistoryCompactResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.history.compact", req) @@ -3187,6 +3283,9 @@ func (a *HistoryApi) Compact(ctx context.Context) (*HistoryCompactResult, error) return &result, nil } +// Truncate calls session.history.truncate. +// +// RPC method: session.history.truncate. func (a *HistoryApi) Truncate(ctx context.Context, params *HistoryTruncateRequest) (*HistoryTruncateResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3205,6 +3304,9 @@ func (a *HistoryApi) Truncate(ctx context.Context, params *HistoryTruncateReques type InstructionsApi sessionApi +// GetSources calls session.instructions.getSources. +// +// RPC method: session.instructions.getSources. 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) @@ -3221,6 +3323,9 @@ func (a *InstructionsApi) GetSources(ctx context.Context) (*InstructionsGetSourc // Experimental: McpApi contains experimental APIs that may change or be removed. type McpApi sessionApi +// Disable calls session.mcp.disable. +// +// RPC method: session.mcp.disable. func (a *McpApi) Disable(ctx context.Context, params *McpDisableRequest) (*McpDisableResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3237,6 +3342,9 @@ func (a *McpApi) Disable(ctx context.Context, params *McpDisableRequest) (*McpDi return &result, nil } +// Enable calls session.mcp.enable. +// +// RPC method: session.mcp.enable. func (a *McpApi) Enable(ctx context.Context, params *McpEnableRequest) (*McpEnableResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3253,6 +3361,9 @@ func (a *McpApi) Enable(ctx context.Context, params *McpEnableRequest) (*McpEnab return &result, nil } +// List calls session.mcp.list. +// +// RPC method: session.mcp.list. 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) @@ -3266,6 +3377,9 @@ func (a *McpApi) List(ctx context.Context) (*McpServerList, error) { return &result, nil } +// Reload calls session.mcp.reload. +// +// RPC method: session.mcp.reload. func (a *McpApi) Reload(ctx context.Context) (*McpReloadResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.mcp.reload", req) @@ -3282,6 +3396,9 @@ func (a *McpApi) Reload(ctx context.Context) (*McpReloadResult, error) { // Experimental: McpOauthApi contains experimental APIs that may change or be removed. type McpOauthApi sessionApi +// Login calls session.mcp.oauth.login. +// +// RPC method: session.mcp.oauth.login. func (a *McpOauthApi) Login(ctx context.Context, params *McpOauthLoginRequest) (*McpOauthLoginResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3314,6 +3431,11 @@ func (s *McpApi) Oauth() *McpOauthApi { type ModeApi sessionApi +// Get calls session.mode.get. +// +// RPC method: session.mode.get. +// +// Returns: The agent mode. Valid values: "interactive", "plan", "autopilot". 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) @@ -3327,6 +3449,9 @@ func (a *ModeApi) Get(ctx context.Context) (*SessionMode, error) { return &result, nil } +// Set calls session.mode.set. +// +// RPC method: session.mode.set. func (a *ModeApi) Set(ctx context.Context, params *ModeSetRequest) (*ModeSetResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3345,6 +3470,9 @@ func (a *ModeApi) Set(ctx context.Context, params *ModeSetRequest) (*ModeSetResu type ModelApi sessionApi +// GetCurrent calls session.model.getCurrent. +// +// RPC method: session.model.getCurrent. 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) @@ -3358,6 +3486,9 @@ func (a *ModelApi) GetCurrent(ctx context.Context) (*CurrentModel, error) { return &result, nil } +// SwitchTo calls session.model.switchTo. +// +// RPC method: session.model.switchTo. func (a *ModelApi) SwitchTo(ctx context.Context, params *ModelSwitchToRequest) (*ModelSwitchToResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3382,6 +3513,9 @@ func (a *ModelApi) SwitchTo(ctx context.Context, params *ModelSwitchToRequest) ( type NameApi sessionApi +// Get calls session.name.get. +// +// RPC method: session.name.get. 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) @@ -3395,6 +3529,9 @@ func (a *NameApi) Get(ctx context.Context) (*NameGetResult, error) { return &result, nil } +// Set calls session.name.set. +// +// RPC method: session.name.set. func (a *NameApi) Set(ctx context.Context, params *NameSetRequest) (*NameSetResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3413,6 +3550,9 @@ func (a *NameApi) Set(ctx context.Context, params *NameSetRequest) (*NameSetResu type PermissionsApi sessionApi +// HandlePendingPermissionRequest calls session.permissions.handlePendingPermissionRequest. +// +// RPC method: session.permissions.handlePendingPermissionRequest. func (a *PermissionsApi) HandlePendingPermissionRequest(ctx context.Context, params *PermissionDecisionRequest) (*PermissionRequestResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3430,6 +3570,9 @@ func (a *PermissionsApi) HandlePendingPermissionRequest(ctx context.Context, par return &result, nil } +// ResetSessionApprovals calls session.permissions.resetSessionApprovals. +// +// RPC method: session.permissions.resetSessionApprovals. 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) @@ -3443,6 +3586,9 @@ func (a *PermissionsApi) ResetSessionApprovals(ctx context.Context) (*Permission return &result, nil } +// SetApproveAll calls session.permissions.setApproveAll. +// +// RPC method: session.permissions.setApproveAll. func (a *PermissionsApi) SetApproveAll(ctx context.Context, params *PermissionsSetApproveAllRequest) (*PermissionsSetApproveAllResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3461,6 +3607,9 @@ func (a *PermissionsApi) SetApproveAll(ctx context.Context, params *PermissionsS type PlanApi sessionApi +// Delete calls session.plan.delete. +// +// RPC method: session.plan.delete. func (a *PlanApi) Delete(ctx context.Context) (*PlanDeleteResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.plan.delete", req) @@ -3474,6 +3623,9 @@ func (a *PlanApi) Delete(ctx context.Context) (*PlanDeleteResult, error) { return &result, nil } +// Read calls session.plan.read. +// +// RPC method: session.plan.read. 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) @@ -3487,6 +3639,9 @@ func (a *PlanApi) Read(ctx context.Context) (*PlanReadResult, error) { return &result, nil } +// Update calls session.plan.update. +// +// RPC method: session.plan.update. func (a *PlanApi) Update(ctx context.Context, params *PlanUpdateRequest) (*PlanUpdateResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3506,6 +3661,9 @@ func (a *PlanApi) Update(ctx context.Context, params *PlanUpdateRequest) (*PlanU // Experimental: PluginsApi contains experimental APIs that may change or be removed. type PluginsApi sessionApi +// List calls session.plugins.list. +// +// RPC method: session.plugins.list. 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) @@ -3522,6 +3680,9 @@ func (a *PluginsApi) List(ctx context.Context) (*PluginList, error) { // Experimental: RemoteApi contains experimental APIs that may change or be removed. type RemoteApi sessionApi +// Disable calls session.remote.disable. +// +// RPC method: session.remote.disable. func (a *RemoteApi) Disable(ctx context.Context) (*RemoteDisableResult, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request("session.remote.disable", req) @@ -3535,6 +3696,9 @@ func (a *RemoteApi) Disable(ctx context.Context) (*RemoteDisableResult, error) { return &result, nil } +// Enable calls session.remote.enable. +// +// RPC method: session.remote.enable. func (a *RemoteApi) Enable(ctx context.Context, params *RemoteEnableRequest) (*RemoteEnableResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3555,6 +3719,9 @@ func (a *RemoteApi) Enable(ctx context.Context, params *RemoteEnableRequest) (*R type ShellApi sessionApi +// Exec calls session.shell.exec. +// +// RPC method: session.shell.exec. func (a *ShellApi) Exec(ctx context.Context, params *ShellExecRequest) (*ShellExecResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3577,6 +3744,9 @@ func (a *ShellApi) Exec(ctx context.Context, params *ShellExecRequest) (*ShellEx return &result, nil } +// Kill calls session.shell.kill. +// +// RPC method: session.shell.kill. func (a *ShellApi) Kill(ctx context.Context, params *ShellKillRequest) (*ShellKillResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3599,6 +3769,9 @@ func (a *ShellApi) Kill(ctx context.Context, params *ShellKillRequest) (*ShellKi // Experimental: SkillsApi contains experimental APIs that may change or be removed. type SkillsApi sessionApi +// Disable calls session.skills.disable. +// +// RPC method: session.skills.disable. func (a *SkillsApi) Disable(ctx context.Context, params *SkillsDisableRequest) (*SkillsDisableResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3615,6 +3788,9 @@ func (a *SkillsApi) Disable(ctx context.Context, params *SkillsDisableRequest) ( return &result, nil } +// Enable calls session.skills.enable. +// +// RPC method: session.skills.enable. func (a *SkillsApi) Enable(ctx context.Context, params *SkillsEnableRequest) (*SkillsEnableResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3631,6 +3807,9 @@ func (a *SkillsApi) Enable(ctx context.Context, params *SkillsEnableRequest) (*S return &result, nil } +// List calls session.skills.list. +// +// RPC method: session.skills.list. 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) @@ -3644,6 +3823,9 @@ func (a *SkillsApi) List(ctx context.Context) (*SkillList, error) { return &result, nil } +// Reload calls session.skills.reload. +// +// RPC method: session.skills.reload. 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) @@ -3660,6 +3842,9 @@ func (a *SkillsApi) Reload(ctx context.Context) (*SkillsLoadDiagnostics, error) // Experimental: TasksApi contains experimental APIs that may change or be removed. type TasksApi sessionApi +// Cancel calls session.tasks.cancel. +// +// RPC method: session.tasks.cancel. func (a *TasksApi) Cancel(ctx context.Context, params *TasksCancelRequest) (*TasksCancelResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3676,6 +3861,9 @@ func (a *TasksApi) Cancel(ctx context.Context, params *TasksCancelRequest) (*Tas return &result, nil } +// List calls session.tasks.list. +// +// RPC method: session.tasks.list. 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) @@ -3689,6 +3877,9 @@ func (a *TasksApi) List(ctx context.Context) (*TaskList, error) { return &result, nil } +// PromoteToBackground calls session.tasks.promoteToBackground. +// +// RPC method: session.tasks.promoteToBackground. func (a *TasksApi) PromoteToBackground(ctx context.Context, params *TasksPromoteToBackgroundRequest) (*TasksPromoteToBackgroundResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3705,6 +3896,9 @@ func (a *TasksApi) PromoteToBackground(ctx context.Context, params *TasksPromote return &result, nil } +// Remove calls session.tasks.remove. +// +// RPC method: session.tasks.remove. func (a *TasksApi) Remove(ctx context.Context, params *TasksRemoveRequest) (*TasksRemoveResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3721,6 +3915,9 @@ func (a *TasksApi) Remove(ctx context.Context, params *TasksRemoveRequest) (*Tas return &result, nil } +// SendMessage calls session.tasks.sendMessage. +// +// RPC method: session.tasks.sendMessage. func (a *TasksApi) SendMessage(ctx context.Context, params *TasksSendMessageRequest) (*TasksSendMessageResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3741,6 +3938,9 @@ func (a *TasksApi) SendMessage(ctx context.Context, params *TasksSendMessageRequ return &result, nil } +// StartAgent calls session.tasks.startAgent. +// +// RPC method: session.tasks.startAgent. func (a *TasksApi) StartAgent(ctx context.Context, params *TasksStartAgentRequest) (*TasksStartAgentResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3767,6 +3967,9 @@ func (a *TasksApi) StartAgent(ctx context.Context, params *TasksStartAgentReques type ToolsApi sessionApi +// HandlePendingToolCall calls session.tools.handlePendingToolCall. +// +// RPC method: session.tools.handlePendingToolCall. func (a *ToolsApi) HandlePendingToolCall(ctx context.Context, params *HandlePendingToolCallRequest) (*HandlePendingToolCallResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3791,6 +3994,11 @@ func (a *ToolsApi) HandlePendingToolCall(ctx context.Context, params *HandlePend type UIApi sessionApi +// Elicitation calls session.ui.elicitation. +// +// RPC method: session.ui.elicitation. +// +// Returns: The elicitation response (accept with form values, decline, or cancel) func (a *UIApi) Elicitation(ctx context.Context, params *UIElicitationRequest) (*UIElicitationResponse, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3808,6 +4016,9 @@ func (a *UIApi) Elicitation(ctx context.Context, params *UIElicitationRequest) ( return &result, nil } +// HandlePendingElicitation calls session.ui.handlePendingElicitation. +// +// RPC method: session.ui.handlePendingElicitation. func (a *UIApi) HandlePendingElicitation(ctx context.Context, params *UIHandlePendingElicitationRequest) (*UIElicitationResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3828,6 +4039,9 @@ func (a *UIApi) HandlePendingElicitation(ctx context.Context, params *UIHandlePe // Experimental: UsageApi contains experimental APIs that may change or be removed. type UsageApi sessionApi +// GetMetrics calls session.usage.getMetrics. +// +// RPC method: session.usage.getMetrics. 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) @@ -3843,6 +4057,9 @@ func (a *UsageApi) GetMetrics(ctx context.Context) (*UsageGetMetricsResult, erro type WorkspacesApi sessionApi +// CreateFile calls session.workspaces.createFile. +// +// RPC method: session.workspaces.createFile. func (a *WorkspacesApi) CreateFile(ctx context.Context, params *WorkspacesCreateFileRequest) (*WorkspacesCreateFileResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3860,6 +4077,9 @@ func (a *WorkspacesApi) CreateFile(ctx context.Context, params *WorkspacesCreate return &result, nil } +// GetWorkspace calls session.workspaces.getWorkspace. +// +// RPC method: session.workspaces.getWorkspace. 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) @@ -3873,6 +4093,9 @@ func (a *WorkspacesApi) GetWorkspace(ctx context.Context) (*WorkspacesGetWorkspa return &result, nil } +// ListFiles calls session.workspaces.listFiles. +// +// RPC method: session.workspaces.listFiles. 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) @@ -3886,6 +4109,9 @@ func (a *WorkspacesApi) ListFiles(ctx context.Context) (*WorkspacesListFilesResu return &result, nil } +// ReadFile calls session.workspaces.readFile. +// +// RPC method: session.workspaces.readFile. func (a *WorkspacesApi) ReadFile(ctx context.Context, params *WorkspacesReadFileRequest) (*WorkspacesReadFileResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -3931,6 +4157,9 @@ type SessionRpc struct { Workspaces *WorkspacesApi } +// Log calls session.log. +// +// RPC method: session.log. func (a *SessionRpc) Log(ctx context.Context, params *LogRequest) (*LogResult, error) { req := map[string]any{"sessionId": a.common.sessionID} if params != nil { @@ -3956,6 +4185,9 @@ func (a *SessionRpc) Log(ctx context.Context, params *LogRequest) (*LogResult, e return &result, nil } +// Suspend calls session.suspend. +// +// RPC method: session.suspend. func (a *SessionRpc) Suspend(ctx context.Context) (*SuspendResult, error) { req := map[string]any{"sessionId": a.common.sessionID} raw, err := a.common.client.Request("session.suspend", req) @@ -3998,15 +4230,55 @@ func NewSessionRpc(client *jsonrpc2.Client, sessionID string) *SessionRpc { } type SessionFsHandler interface { + // AppendFile handles sessionFs.appendFile. + // + // RPC method: sessionFs.appendFile. + // + // Returns: Describes a filesystem error. AppendFile(request *SessionFsAppendFileRequest) (*SessionFsError, error) + // Exists handles sessionFs.exists. + // + // RPC method: sessionFs.exists. Exists(request *SessionFsExistsRequest) (*SessionFsExistsResult, error) + // Mkdir handles sessionFs.mkdir. + // + // RPC method: sessionFs.mkdir. + // + // Returns: Describes a filesystem error. Mkdir(request *SessionFsMkdirRequest) (*SessionFsError, error) + // Readdir handles sessionFs.readdir. + // + // RPC method: sessionFs.readdir. Readdir(request *SessionFsReaddirRequest) (*SessionFsReaddirResult, error) + // ReaddirWithTypes handles sessionFs.readdirWithTypes. + // + // RPC method: sessionFs.readdirWithTypes. ReaddirWithTypes(request *SessionFsReaddirWithTypesRequest) (*SessionFsReaddirWithTypesResult, error) + // ReadFile handles sessionFs.readFile. + // + // RPC method: sessionFs.readFile. ReadFile(request *SessionFsReadFileRequest) (*SessionFsReadFileResult, error) + // Rename handles sessionFs.rename. + // + // RPC method: sessionFs.rename. + // + // Returns: Describes a filesystem error. Rename(request *SessionFsRenameRequest) (*SessionFsError, error) + // Rm handles sessionFs.rm. + // + // RPC method: sessionFs.rm. + // + // Returns: Describes a filesystem error. Rm(request *SessionFsRmRequest) (*SessionFsError, error) + // Stat handles sessionFs.stat. + // + // RPC method: sessionFs.stat. Stat(request *SessionFsStatRequest) (*SessionFsStatResult, error) + // WriteFile handles sessionFs.writeFile. + // + // RPC method: sessionFs.writeFile. + // + // Returns: Describes a filesystem error. WriteFile(request *SessionFsWriteFileRequest) (*SessionFsError, error) } diff --git a/nodejs/src/generated/rpc.ts b/nodejs/src/generated/rpc.ts index 97cd9df0e..7d702af0c 100644 --- a/nodejs/src/generated/rpc.ts +++ b/nodejs/src/generated/rpc.ts @@ -2803,52 +2803,97 @@ export interface WorkspacesReadFileResult { /** Create typed server-scoped RPC methods (no session required). */ export function createServerRpc(connection: MessageConnection) { return { + /** + * Calls `ping`. + */ ping: async (params: PingRequest): Promise => connection.sendRequest("ping", params), models: { + /** + * Calls `models.list`. + */ list: async (params?: ModelsListRequest): Promise => connection.sendRequest("models.list", params), }, tools: { + /** + * Calls `tools.list`. + */ list: async (params: ToolsListRequest): Promise => connection.sendRequest("tools.list", params), }, account: { + /** + * Calls `account.getQuota`. + */ getQuota: async (params?: AccountGetQuotaRequest): Promise => connection.sendRequest("account.getQuota", params), }, mcp: { config: { + /** + * Calls `mcp.config.list`. + */ list: async (): Promise => connection.sendRequest("mcp.config.list", {}), + /** + * Calls `mcp.config.add`. + */ add: async (params: McpConfigAddRequest): Promise => connection.sendRequest("mcp.config.add", params), + /** + * Calls `mcp.config.update`. + */ update: async (params: McpConfigUpdateRequest): Promise => connection.sendRequest("mcp.config.update", params), + /** + * Calls `mcp.config.remove`. + */ remove: async (params: McpConfigRemoveRequest): Promise => connection.sendRequest("mcp.config.remove", params), + /** + * Calls `mcp.config.enable`. + */ enable: async (params: McpConfigEnableRequest): Promise => connection.sendRequest("mcp.config.enable", params), + /** + * Calls `mcp.config.disable`. + */ disable: async (params: McpConfigDisableRequest): Promise => connection.sendRequest("mcp.config.disable", params), }, + /** + * Calls `mcp.discover`. + */ discover: async (params: McpDiscoverRequest): Promise => connection.sendRequest("mcp.discover", params), }, skills: { config: { + /** + * Calls `skills.config.setDisabledSkills`. + */ setDisabledSkills: async (params: SkillsConfigSetDisabledSkillsRequest): Promise => connection.sendRequest("skills.config.setDisabledSkills", params), }, + /** + * Calls `skills.discover`. + */ discover: async (params: SkillsDiscoverRequest): Promise => connection.sendRequest("skills.discover", params), }, sessionFs: { + /** + * Calls `sessionFs.setProvider`. + */ setProvider: async (params: SessionFsSetProviderRequest): Promise => connection.sendRequest("sessionFs.setProvider", params), }, /** @experimental */ sessions: { + /** + * Calls `sessions.fork`. + */ fork: async (params: SessionsForkRequest): Promise => connection.sendRequest("sessions.fork", params), }, @@ -2862,6 +2907,9 @@ export function createServerRpc(connection: MessageConnection) { */ export function createInternalServerRpc(connection: MessageConnection) { return { + /** + * Calls `connect`. + */ connect: async (params: ConnectRequest): Promise => connection.sendRequest("connect", params), }; @@ -2870,180 +2918,364 @@ export function createInternalServerRpc(connection: MessageConnection) { /** Create typed session-scoped RPC methods. */ export function createSessionRpc(connection: MessageConnection, sessionId: string) { return { + /** + * Calls `session.suspend`. + */ suspend: async (): Promise => connection.sendRequest("session.suspend", { sessionId }), auth: { + /** + * Calls `session.auth.getStatus`. + */ getStatus: async (): Promise => connection.sendRequest("session.auth.getStatus", { sessionId }), }, model: { + /** + * Calls `session.model.getCurrent`. + */ getCurrent: async (): Promise => connection.sendRequest("session.model.getCurrent", { sessionId }), + /** + * Calls `session.model.switchTo`. + */ switchTo: async (params: ModelSwitchToRequest): Promise => connection.sendRequest("session.model.switchTo", { sessionId, ...params }), }, mode: { + /** + * Calls `session.mode.get`. + * + * @returns The agent mode. Valid values: "interactive", "plan", "autopilot". + */ get: async (): Promise => connection.sendRequest("session.mode.get", { sessionId }), + /** + * Calls `session.mode.set`. + */ set: async (params: ModeSetRequest): Promise => connection.sendRequest("session.mode.set", { sessionId, ...params }), }, name: { + /** + * Calls `session.name.get`. + */ get: async (): Promise => connection.sendRequest("session.name.get", { sessionId }), + /** + * Calls `session.name.set`. + */ set: async (params: NameSetRequest): Promise => connection.sendRequest("session.name.set", { sessionId, ...params }), }, plan: { + /** + * Calls `session.plan.read`. + */ read: async (): Promise => connection.sendRequest("session.plan.read", { sessionId }), + /** + * Calls `session.plan.update`. + */ update: async (params: PlanUpdateRequest): Promise => connection.sendRequest("session.plan.update", { sessionId, ...params }), + /** + * Calls `session.plan.delete`. + */ delete: async (): Promise => connection.sendRequest("session.plan.delete", { sessionId }), }, workspaces: { + /** + * Calls `session.workspaces.getWorkspace`. + */ getWorkspace: async (): Promise => connection.sendRequest("session.workspaces.getWorkspace", { sessionId }), + /** + * Calls `session.workspaces.listFiles`. + */ listFiles: async (): Promise => connection.sendRequest("session.workspaces.listFiles", { sessionId }), + /** + * Calls `session.workspaces.readFile`. + */ readFile: async (params: WorkspacesReadFileRequest): Promise => connection.sendRequest("session.workspaces.readFile", { sessionId, ...params }), + /** + * Calls `session.workspaces.createFile`. + */ createFile: async (params: WorkspacesCreateFileRequest): Promise => connection.sendRequest("session.workspaces.createFile", { sessionId, ...params }), }, instructions: { + /** + * Calls `session.instructions.getSources`. + */ getSources: async (): Promise => connection.sendRequest("session.instructions.getSources", { sessionId }), }, /** @experimental */ fleet: { + /** + * Calls `session.fleet.start`. + */ start: async (params: FleetStartRequest): Promise => connection.sendRequest("session.fleet.start", { sessionId, ...params }), }, /** @experimental */ agent: { + /** + * Calls `session.agent.list`. + */ list: async (): Promise => connection.sendRequest("session.agent.list", { sessionId }), + /** + * Calls `session.agent.getCurrent`. + */ getCurrent: async (): Promise => connection.sendRequest("session.agent.getCurrent", { sessionId }), + /** + * Calls `session.agent.select`. + */ select: async (params: AgentSelectRequest): Promise => connection.sendRequest("session.agent.select", { sessionId, ...params }), + /** + * Calls `session.agent.deselect`. + */ deselect: async (): Promise => connection.sendRequest("session.agent.deselect", { sessionId }), + /** + * Calls `session.agent.reload`. + */ reload: async (): Promise => connection.sendRequest("session.agent.reload", { sessionId }), }, /** @experimental */ tasks: { + /** + * Calls `session.tasks.startAgent`. + */ startAgent: async (params: TasksStartAgentRequest): Promise => connection.sendRequest("session.tasks.startAgent", { sessionId, ...params }), + /** + * Calls `session.tasks.list`. + */ list: async (): Promise => connection.sendRequest("session.tasks.list", { sessionId }), + /** + * Calls `session.tasks.promoteToBackground`. + */ promoteToBackground: async (params: TasksPromoteToBackgroundRequest): Promise => connection.sendRequest("session.tasks.promoteToBackground", { sessionId, ...params }), + /** + * Calls `session.tasks.cancel`. + */ cancel: async (params: TasksCancelRequest): Promise => connection.sendRequest("session.tasks.cancel", { sessionId, ...params }), + /** + * Calls `session.tasks.remove`. + */ remove: async (params: TasksRemoveRequest): Promise => connection.sendRequest("session.tasks.remove", { sessionId, ...params }), + /** + * Calls `session.tasks.sendMessage`. + */ sendMessage: async (params: TasksSendMessageRequest): Promise => connection.sendRequest("session.tasks.sendMessage", { sessionId, ...params }), }, /** @experimental */ skills: { + /** + * Calls `session.skills.list`. + */ list: async (): Promise => connection.sendRequest("session.skills.list", { sessionId }), + /** + * Calls `session.skills.enable`. + */ enable: async (params: SkillsEnableRequest): Promise => connection.sendRequest("session.skills.enable", { sessionId, ...params }), + /** + * Calls `session.skills.disable`. + */ disable: async (params: SkillsDisableRequest): Promise => connection.sendRequest("session.skills.disable", { sessionId, ...params }), + /** + * Calls `session.skills.reload`. + */ reload: async (): Promise => connection.sendRequest("session.skills.reload", { sessionId }), }, /** @experimental */ mcp: { + /** + * Calls `session.mcp.list`. + */ list: async (): Promise => connection.sendRequest("session.mcp.list", { sessionId }), + /** + * Calls `session.mcp.enable`. + */ enable: async (params: McpEnableRequest): Promise => connection.sendRequest("session.mcp.enable", { sessionId, ...params }), + /** + * Calls `session.mcp.disable`. + */ disable: async (params: McpDisableRequest): Promise => connection.sendRequest("session.mcp.disable", { sessionId, ...params }), + /** + * Calls `session.mcp.reload`. + */ reload: async (): Promise => connection.sendRequest("session.mcp.reload", { sessionId }), /** @experimental */ oauth: { + /** + * Calls `session.mcp.oauth.login`. + */ login: async (params: McpOauthLoginRequest): Promise => connection.sendRequest("session.mcp.oauth.login", { sessionId, ...params }), }, }, /** @experimental */ plugins: { + /** + * Calls `session.plugins.list`. + */ list: async (): Promise => connection.sendRequest("session.plugins.list", { sessionId }), }, /** @experimental */ extensions: { + /** + * Calls `session.extensions.list`. + */ list: async (): Promise => connection.sendRequest("session.extensions.list", { sessionId }), + /** + * Calls `session.extensions.enable`. + */ enable: async (params: ExtensionsEnableRequest): Promise => connection.sendRequest("session.extensions.enable", { sessionId, ...params }), + /** + * Calls `session.extensions.disable`. + */ disable: async (params: ExtensionsDisableRequest): Promise => connection.sendRequest("session.extensions.disable", { sessionId, ...params }), + /** + * Calls `session.extensions.reload`. + */ reload: async (): Promise => connection.sendRequest("session.extensions.reload", { sessionId }), }, tools: { + /** + * Calls `session.tools.handlePendingToolCall`. + */ handlePendingToolCall: async (params: HandlePendingToolCallRequest): Promise => connection.sendRequest("session.tools.handlePendingToolCall", { sessionId, ...params }), }, commands: { + /** + * Calls `session.commands.list`. + */ list: async (params?: CommandsListRequest): Promise => connection.sendRequest("session.commands.list", { sessionId, ...params }), + /** + * Calls `session.commands.invoke`. + */ invoke: async (params: CommandsInvokeRequest): Promise => connection.sendRequest("session.commands.invoke", { sessionId, ...params }), + /** + * Calls `session.commands.handlePendingCommand`. + */ handlePendingCommand: async (params: CommandsHandlePendingCommandRequest): Promise => connection.sendRequest("session.commands.handlePendingCommand", { sessionId, ...params }), + /** + * Calls `session.commands.respondToQueuedCommand`. + */ respondToQueuedCommand: async (params: CommandsRespondToQueuedCommandRequest): Promise => connection.sendRequest("session.commands.respondToQueuedCommand", { sessionId, ...params }), }, ui: { + /** + * Calls `session.ui.elicitation`. + * + * @returns The elicitation response (accept with form values, decline, or cancel) + */ elicitation: async (params: UIElicitationRequest): Promise => connection.sendRequest("session.ui.elicitation", { sessionId, ...params }), + /** + * Calls `session.ui.handlePendingElicitation`. + */ handlePendingElicitation: async (params: UIHandlePendingElicitationRequest): Promise => connection.sendRequest("session.ui.handlePendingElicitation", { sessionId, ...params }), }, permissions: { + /** + * Calls `session.permissions.handlePendingPermissionRequest`. + */ handlePendingPermissionRequest: async (params: PermissionDecisionRequest): Promise => connection.sendRequest("session.permissions.handlePendingPermissionRequest", { sessionId, ...params }), + /** + * Calls `session.permissions.setApproveAll`. + */ setApproveAll: async (params: PermissionsSetApproveAllRequest): Promise => connection.sendRequest("session.permissions.setApproveAll", { sessionId, ...params }), + /** + * Calls `session.permissions.resetSessionApprovals`. + */ resetSessionApprovals: async (): Promise => connection.sendRequest("session.permissions.resetSessionApprovals", { sessionId }), }, + /** + * Calls `session.log`. + */ log: async (params: LogRequest): Promise => connection.sendRequest("session.log", { sessionId, ...params }), shell: { + /** + * Calls `session.shell.exec`. + */ exec: async (params: ShellExecRequest): Promise => connection.sendRequest("session.shell.exec", { sessionId, ...params }), + /** + * Calls `session.shell.kill`. + */ kill: async (params: ShellKillRequest): Promise => connection.sendRequest("session.shell.kill", { sessionId, ...params }), }, /** @experimental */ history: { + /** + * Calls `session.history.compact`. + */ compact: async (): Promise => connection.sendRequest("session.history.compact", { sessionId }), + /** + * Calls `session.history.truncate`. + */ truncate: async (params: HistoryTruncateRequest): Promise => connection.sendRequest("session.history.truncate", { sessionId, ...params }), }, /** @experimental */ usage: { + /** + * Calls `session.usage.getMetrics`. + */ getMetrics: async (): Promise => connection.sendRequest("session.usage.getMetrics", { sessionId }), }, /** @experimental */ remote: { + /** + * Calls `session.remote.enable`. + */ enable: async (params: RemoteEnableRequest): Promise => connection.sendRequest("session.remote.enable", { sessionId, ...params }), + /** + * Calls `session.remote.disable`. + */ disable: async (): Promise => connection.sendRequest("session.remote.disable", { sessionId }), }, @@ -3052,15 +3284,55 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin /** Handler for `sessionFs` client session API methods. */ export interface SessionFsHandler { + /** + * Handles `sessionFs.readFile`. + */ readFile(params: SessionFsReadFileRequest): Promise; + /** + * Handles `sessionFs.writeFile`. + * + * @returns Describes a filesystem error. + */ writeFile(params: SessionFsWriteFileRequest): Promise; + /** + * Handles `sessionFs.appendFile`. + * + * @returns Describes a filesystem error. + */ appendFile(params: SessionFsAppendFileRequest): Promise; + /** + * Handles `sessionFs.exists`. + */ exists(params: SessionFsExistsRequest): Promise; + /** + * Handles `sessionFs.stat`. + */ stat(params: SessionFsStatRequest): Promise; + /** + * Handles `sessionFs.mkdir`. + * + * @returns Describes a filesystem error. + */ mkdir(params: SessionFsMkdirRequest): Promise; + /** + * Handles `sessionFs.readdir`. + */ readdir(params: SessionFsReaddirRequest): Promise; + /** + * Handles `sessionFs.readdirWithTypes`. + */ readdirWithTypes(params: SessionFsReaddirWithTypesRequest): Promise; + /** + * Handles `sessionFs.rm`. + * + * @returns Describes a filesystem error. + */ rm(params: SessionFsRmRequest): Promise; + /** + * Handles `sessionFs.rename`. + * + * @returns Describes a filesystem error. + */ rename(params: SessionFsRenameRequest): Promise; } diff --git a/python/copilot/generated/rpc.py b/python/copilot/generated/rpc.py index 738e92934..eb1a837a2 100644 --- a/python/copilot/generated/rpc.py +++ b/python/copilot/generated/rpc.py @@ -7095,6 +7095,7 @@ def __init__(self, client: "JsonRpcClient"): self._client = client async def list(self, params: ModelsListRequest | None = None, *, timeout: float | None = None) -> ModelList: + "Calls models.list." params_dict = {k: v for k, v in params.to_dict().items() if v is not None} if params is not None else {} return ModelList.from_dict(_patch_model_capabilities(await self._client.request("models.list", params_dict, **_timeout_kwargs(timeout)))) @@ -7104,6 +7105,7 @@ def __init__(self, client: "JsonRpcClient"): self._client = client async def list(self, params: ToolsListRequest, *, timeout: float | None = None) -> ToolList: + "Calls tools.list." params_dict = {k: v for k, v in params.to_dict().items() if v is not None} return ToolList.from_dict(await self._client.request("tools.list", params_dict, **_timeout_kwargs(timeout))) @@ -7113,6 +7115,7 @@ def __init__(self, client: "JsonRpcClient"): self._client = client async def get_quota(self, params: AccountGetQuotaRequest | None = None, *, timeout: float | None = None) -> AccountGetQuotaResult: + "Calls account.getQuota." params_dict = {k: v for k, v in params.to_dict().items() if v is not None} if params is not None else {} return AccountGetQuotaResult.from_dict(await self._client.request("account.getQuota", params_dict, **_timeout_kwargs(timeout))) @@ -7122,25 +7125,31 @@ def __init__(self, client: "JsonRpcClient"): self._client = client async def list(self, *, timeout: float | None = None) -> MCPConfigList: + "Calls mcp.config.list." return MCPConfigList.from_dict(await self._client.request("mcp.config.list", {}, **_timeout_kwargs(timeout))) async def add(self, params: MCPConfigAddRequest, *, timeout: float | None = None) -> None: + "Calls mcp.config.add." params_dict = {k: v for k, v in params.to_dict().items() if v is not None} await self._client.request("mcp.config.add", params_dict, **_timeout_kwargs(timeout)) async def update(self, params: MCPConfigUpdateRequest, *, timeout: float | None = None) -> None: + "Calls mcp.config.update." params_dict = {k: v for k, v in params.to_dict().items() if v is not None} await self._client.request("mcp.config.update", params_dict, **_timeout_kwargs(timeout)) async def remove(self, params: MCPConfigRemoveRequest, *, timeout: float | None = None) -> None: + "Calls mcp.config.remove." params_dict = {k: v for k, v in params.to_dict().items() if v is not None} await self._client.request("mcp.config.remove", params_dict, **_timeout_kwargs(timeout)) async def enable(self, params: MCPConfigEnableRequest, *, timeout: float | None = None) -> None: + "Calls mcp.config.enable." params_dict = {k: v for k, v in params.to_dict().items() if v is not None} await self._client.request("mcp.config.enable", params_dict, **_timeout_kwargs(timeout)) async def disable(self, params: MCPConfigDisableRequest, *, timeout: float | None = None) -> None: + "Calls mcp.config.disable." params_dict = {k: v for k, v in params.to_dict().items() if v is not None} await self._client.request("mcp.config.disable", params_dict, **_timeout_kwargs(timeout)) @@ -7151,6 +7160,7 @@ def __init__(self, client: "JsonRpcClient"): self.config = ServerMcpConfigApi(client) async def discover(self, params: MCPDiscoverRequest, *, timeout: float | None = None) -> MCPDiscoverResult: + "Calls mcp.discover." params_dict = {k: v for k, v in params.to_dict().items() if v is not None} return MCPDiscoverResult.from_dict(await self._client.request("mcp.discover", params_dict, **_timeout_kwargs(timeout))) @@ -7160,6 +7170,7 @@ def __init__(self, client: "JsonRpcClient"): self._client = client async def set_disabled_skills(self, params: SkillsConfigSetDisabledSkillsRequest, *, timeout: float | None = None) -> None: + "Calls skills.config.setDisabledSkills." params_dict = {k: v for k, v in params.to_dict().items() if v is not None} await self._client.request("skills.config.setDisabledSkills", params_dict, **_timeout_kwargs(timeout)) @@ -7170,6 +7181,7 @@ def __init__(self, client: "JsonRpcClient"): self.config = ServerSkillsConfigApi(client) async def discover(self, params: SkillsDiscoverRequest, *, timeout: float | None = None) -> ServerSkillList: + "Calls skills.discover." params_dict = {k: v for k, v in params.to_dict().items() if v is not None} return ServerSkillList.from_dict(await self._client.request("skills.discover", params_dict, **_timeout_kwargs(timeout))) @@ -7179,6 +7191,7 @@ def __init__(self, client: "JsonRpcClient"): self._client = client async def set_provider(self, params: SessionFSSetProviderRequest, *, timeout: float | None = None) -> SessionFSSetProviderResult: + "Calls sessionFs.setProvider." params_dict = {k: v for k, v in params.to_dict().items() if v is not None} return SessionFSSetProviderResult.from_dict(await self._client.request("sessionFs.setProvider", params_dict, **_timeout_kwargs(timeout))) @@ -7189,6 +7202,7 @@ def __init__(self, client: "JsonRpcClient"): self._client = client async def fork(self, params: SessionsForkRequest, *, timeout: float | None = None) -> SessionsForkResult: + "Calls sessions.fork." params_dict = {k: v for k, v in params.to_dict().items() if v is not None} return SessionsForkResult.from_dict(await self._client.request("sessions.fork", params_dict, **_timeout_kwargs(timeout))) @@ -7206,6 +7220,7 @@ def __init__(self, client: "JsonRpcClient"): self.sessions = ServerSessionsApi(client) async def ping(self, params: PingRequest, *, timeout: float | None = None) -> PingResult: + "Calls ping." params_dict = {k: v for k, v in params.to_dict().items() if v is not None} return PingResult.from_dict(await self._client.request("ping", params_dict, **_timeout_kwargs(timeout))) @@ -7216,7 +7231,7 @@ def __init__(self, client: "JsonRpcClient"): self._client = client async def connect(self, params: ConnectRequest, *, timeout: float | None = None) -> ConnectResult: - """:meta private: Internal SDK API; not part of the public surface.""" + "Calls connect.\n\n:meta private:\n\nInternal SDK API; not part of the public surface." params_dict = {k: v for k, v in params.to_dict().items() if v is not None} return ConnectResult.from_dict(await self._client.request("connect", params_dict, **_timeout_kwargs(timeout))) @@ -7227,6 +7242,7 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def get_status(self, *, timeout: float | None = None) -> SessionAuthStatus: + "Calls session.auth.getStatus." return SessionAuthStatus.from_dict(await self._client.request("session.auth.getStatus", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) @@ -7236,9 +7252,11 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def get_current(self, *, timeout: float | None = None) -> CurrentModel: + "Calls session.model.getCurrent." return CurrentModel.from_dict(await self._client.request("session.model.getCurrent", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) async def switch_to(self, params: ModelSwitchToRequest, *, timeout: float | None = None) -> ModelSwitchToResult: + "Calls session.model.switchTo." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return ModelSwitchToResult.from_dict(await self._client.request("session.model.switchTo", params_dict, **_timeout_kwargs(timeout))) @@ -7250,9 +7268,11 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def get(self, *, timeout: float | None = None) -> Mode: + "Calls session.mode.get.\n\nReturns:\n The agent mode. Valid values: \"interactive\", \"plan\", \"autopilot\"." return Mode(await self._client.request("session.mode.get", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) async def set(self, params: ModeSetRequest, *, timeout: float | None = None) -> None: + "Calls session.mode.set." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id await self._client.request("session.mode.set", params_dict, **_timeout_kwargs(timeout)) @@ -7264,9 +7284,11 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def get(self, *, timeout: float | None = None) -> NameGetResult: + "Calls session.name.get." return NameGetResult.from_dict(await self._client.request("session.name.get", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) async def set(self, params: NameSetRequest, *, timeout: float | None = None) -> None: + "Calls session.name.set." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id await self._client.request("session.name.set", params_dict, **_timeout_kwargs(timeout)) @@ -7278,14 +7300,17 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def read(self, *, timeout: float | None = None) -> PlanReadResult: + "Calls session.plan.read." return PlanReadResult.from_dict(await self._client.request("session.plan.read", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) async def update(self, params: PlanUpdateRequest, *, timeout: float | None = None) -> None: + "Calls session.plan.update." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id await self._client.request("session.plan.update", params_dict, **_timeout_kwargs(timeout)) async def delete(self, *, timeout: float | None = None) -> None: + "Calls session.plan.delete." await self._client.request("session.plan.delete", {"sessionId": self._session_id}, **_timeout_kwargs(timeout)) @@ -7295,17 +7320,21 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def get_workspace(self, *, timeout: float | None = None) -> WorkspacesGetWorkspaceResult: + "Calls session.workspaces.getWorkspace." return WorkspacesGetWorkspaceResult.from_dict(await self._client.request("session.workspaces.getWorkspace", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) async def list_files(self, *, timeout: float | None = None) -> WorkspacesListFilesResult: + "Calls session.workspaces.listFiles." return WorkspacesListFilesResult.from_dict(await self._client.request("session.workspaces.listFiles", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) async def read_file(self, params: WorkspacesReadFileRequest, *, timeout: float | None = None) -> WorkspacesReadFileResult: + "Calls session.workspaces.readFile." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return WorkspacesReadFileResult.from_dict(await self._client.request("session.workspaces.readFile", params_dict, **_timeout_kwargs(timeout))) async def create_file(self, params: WorkspacesCreateFileRequest, *, timeout: float | None = None) -> None: + "Calls session.workspaces.createFile." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id await self._client.request("session.workspaces.createFile", params_dict, **_timeout_kwargs(timeout)) @@ -7317,6 +7346,7 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def get_sources(self, *, timeout: float | None = None) -> InstructionsGetSourcesResult: + "Calls session.instructions.getSources." return InstructionsGetSourcesResult.from_dict(await self._client.request("session.instructions.getSources", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) @@ -7327,6 +7357,7 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def start(self, params: FleetStartRequest, *, timeout: float | None = None) -> FleetStartResult: + "Calls session.fleet.start." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return FleetStartResult.from_dict(await self._client.request("session.fleet.start", params_dict, **_timeout_kwargs(timeout))) @@ -7339,20 +7370,25 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def list(self, *, timeout: float | None = None) -> AgentList: + "Calls session.agent.list." return AgentList.from_dict(await self._client.request("session.agent.list", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) async def get_current(self, *, timeout: float | None = None) -> AgentGetCurrentResult: + "Calls session.agent.getCurrent." return AgentGetCurrentResult.from_dict(await self._client.request("session.agent.getCurrent", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) async def select(self, params: AgentSelectRequest, *, timeout: float | None = None) -> AgentSelectResult: + "Calls session.agent.select." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return AgentSelectResult.from_dict(await self._client.request("session.agent.select", params_dict, **_timeout_kwargs(timeout))) async def deselect(self, *, timeout: float | None = None) -> None: + "Calls session.agent.deselect." await self._client.request("session.agent.deselect", {"sessionId": self._session_id}, **_timeout_kwargs(timeout)) async def reload(self, *, timeout: float | None = None) -> AgentReloadResult: + "Calls session.agent.reload." return AgentReloadResult.from_dict(await self._client.request("session.agent.reload", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) @@ -7363,29 +7399,35 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def start_agent(self, params: TasksStartAgentRequest, *, timeout: float | None = None) -> TasksStartAgentResult: + "Calls session.tasks.startAgent." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return TasksStartAgentResult.from_dict(await self._client.request("session.tasks.startAgent", params_dict, **_timeout_kwargs(timeout))) async def list(self, *, timeout: float | None = None) -> TaskList: + "Calls session.tasks.list." return TaskList.from_dict(await self._client.request("session.tasks.list", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) async def promote_to_background(self, params: TasksPromoteToBackgroundRequest, *, timeout: float | None = None) -> TasksPromoteToBackgroundResult: + "Calls session.tasks.promoteToBackground." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return TasksPromoteToBackgroundResult.from_dict(await self._client.request("session.tasks.promoteToBackground", params_dict, **_timeout_kwargs(timeout))) async def cancel(self, params: TasksCancelRequest, *, timeout: float | None = None) -> TasksCancelResult: + "Calls session.tasks.cancel." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return TasksCancelResult.from_dict(await self._client.request("session.tasks.cancel", params_dict, **_timeout_kwargs(timeout))) async def remove(self, params: TasksRemoveRequest, *, timeout: float | None = None) -> TasksRemoveResult: + "Calls session.tasks.remove." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return TasksRemoveResult.from_dict(await self._client.request("session.tasks.remove", params_dict, **_timeout_kwargs(timeout))) async def send_message(self, params: TasksSendMessageRequest, *, timeout: float | None = None) -> TasksSendMessageResult: + "Calls session.tasks.sendMessage." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return TasksSendMessageResult.from_dict(await self._client.request("session.tasks.sendMessage", params_dict, **_timeout_kwargs(timeout))) @@ -7398,19 +7440,23 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def list(self, *, timeout: float | None = None) -> SkillList: + "Calls session.skills.list." return SkillList.from_dict(await self._client.request("session.skills.list", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) async def enable(self, params: SkillsEnableRequest, *, timeout: float | None = None) -> None: + "Calls session.skills.enable." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id await self._client.request("session.skills.enable", params_dict, **_timeout_kwargs(timeout)) async def disable(self, params: SkillsDisableRequest, *, timeout: float | None = None) -> None: + "Calls session.skills.disable." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id await self._client.request("session.skills.disable", params_dict, **_timeout_kwargs(timeout)) async def reload(self, *, timeout: float | None = None) -> SkillsLoadDiagnostics: + "Calls session.skills.reload." return SkillsLoadDiagnostics.from_dict(await self._client.request("session.skills.reload", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) @@ -7421,6 +7467,7 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def login(self, params: MCPOauthLoginRequest, *, timeout: float | None = None) -> MCPOauthLoginResult: + "Calls session.mcp.oauth.login." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return MCPOauthLoginResult.from_dict(await self._client.request("session.mcp.oauth.login", params_dict, **_timeout_kwargs(timeout))) @@ -7434,19 +7481,23 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self.oauth = McpOauthApi(client, session_id) async def list(self, *, timeout: float | None = None) -> MCPServerList: + "Calls session.mcp.list." return MCPServerList.from_dict(await self._client.request("session.mcp.list", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) async def enable(self, params: MCPEnableRequest, *, timeout: float | None = None) -> None: + "Calls session.mcp.enable." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id await self._client.request("session.mcp.enable", params_dict, **_timeout_kwargs(timeout)) async def disable(self, params: MCPDisableRequest, *, timeout: float | None = None) -> None: + "Calls session.mcp.disable." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id await self._client.request("session.mcp.disable", params_dict, **_timeout_kwargs(timeout)) async def reload(self, *, timeout: float | None = None) -> None: + "Calls session.mcp.reload." await self._client.request("session.mcp.reload", {"sessionId": self._session_id}, **_timeout_kwargs(timeout)) @@ -7457,6 +7508,7 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def list(self, *, timeout: float | None = None) -> PluginList: + "Calls session.plugins.list." return PluginList.from_dict(await self._client.request("session.plugins.list", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) @@ -7467,19 +7519,23 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def list(self, *, timeout: float | None = None) -> ExtensionList: + "Calls session.extensions.list." return ExtensionList.from_dict(await self._client.request("session.extensions.list", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) async def enable(self, params: ExtensionsEnableRequest, *, timeout: float | None = None) -> None: + "Calls session.extensions.enable." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id await self._client.request("session.extensions.enable", params_dict, **_timeout_kwargs(timeout)) async def disable(self, params: ExtensionsDisableRequest, *, timeout: float | None = None) -> None: + "Calls session.extensions.disable." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id await self._client.request("session.extensions.disable", params_dict, **_timeout_kwargs(timeout)) async def reload(self, *, timeout: float | None = None) -> None: + "Calls session.extensions.reload." await self._client.request("session.extensions.reload", {"sessionId": self._session_id}, **_timeout_kwargs(timeout)) @@ -7489,6 +7545,7 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def handle_pending_tool_call(self, params: HandlePendingToolCallRequest, *, timeout: float | None = None) -> HandlePendingToolCallResult: + "Calls session.tools.handlePendingToolCall." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return HandlePendingToolCallResult.from_dict(await self._client.request("session.tools.handlePendingToolCall", params_dict, **_timeout_kwargs(timeout))) @@ -7500,21 +7557,25 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def list(self, params: CommandsListRequest | None = None, *, timeout: float | None = None) -> CommandList: + "Calls session.commands.list." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} if params is not None else {} params_dict["sessionId"] = self._session_id return CommandList.from_dict(await self._client.request("session.commands.list", params_dict, **_timeout_kwargs(timeout))) async def invoke(self, params: CommandsInvokeRequest, *, timeout: float | None = None) -> SlashCommandInvocationResult: + "Calls session.commands.invoke." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return SlashCommandInvocationResult.from_dict(await self._client.request("session.commands.invoke", params_dict, **_timeout_kwargs(timeout))) async def handle_pending_command(self, params: CommandsHandlePendingCommandRequest, *, timeout: float | None = None) -> CommandsHandlePendingCommandResult: + "Calls session.commands.handlePendingCommand." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return CommandsHandlePendingCommandResult.from_dict(await self._client.request("session.commands.handlePendingCommand", params_dict, **_timeout_kwargs(timeout))) async def respond_to_queued_command(self, params: CommandsRespondToQueuedCommandRequest, *, timeout: float | None = None) -> CommandsRespondToQueuedCommandResult: + "Calls session.commands.respondToQueuedCommand." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return CommandsRespondToQueuedCommandResult.from_dict(await self._client.request("session.commands.respondToQueuedCommand", params_dict, **_timeout_kwargs(timeout))) @@ -7526,11 +7587,13 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def elicitation(self, params: UIElicitationRequest, *, timeout: float | None = None) -> UIElicitationResponse: + "Calls session.ui.elicitation.\n\nReturns:\n The elicitation response (accept with form values, decline, or cancel)" params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return UIElicitationResponse.from_dict(await self._client.request("session.ui.elicitation", params_dict, **_timeout_kwargs(timeout))) async def handle_pending_elicitation(self, params: UIHandlePendingElicitationRequest, *, timeout: float | None = None) -> UIElicitationResult: + "Calls session.ui.handlePendingElicitation." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return UIElicitationResult.from_dict(await self._client.request("session.ui.handlePendingElicitation", params_dict, **_timeout_kwargs(timeout))) @@ -7542,16 +7605,19 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def handle_pending_permission_request(self, params: PermissionDecisionRequest, *, timeout: float | None = None) -> PermissionRequestResult: + "Calls session.permissions.handlePendingPermissionRequest." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return PermissionRequestResult.from_dict(await self._client.request("session.permissions.handlePendingPermissionRequest", params_dict, **_timeout_kwargs(timeout))) async def set_approve_all(self, params: PermissionsSetApproveAllRequest, *, timeout: float | None = None) -> PermissionsSetApproveAllResult: + "Calls session.permissions.setApproveAll." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return PermissionsSetApproveAllResult.from_dict(await self._client.request("session.permissions.setApproveAll", params_dict, **_timeout_kwargs(timeout))) async def reset_session_approvals(self, *, timeout: float | None = None) -> PermissionsResetSessionApprovalsResult: + "Calls session.permissions.resetSessionApprovals." return PermissionsResetSessionApprovalsResult.from_dict(await self._client.request("session.permissions.resetSessionApprovals", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) @@ -7561,11 +7627,13 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def exec(self, params: ShellExecRequest, *, timeout: float | None = None) -> ShellExecResult: + "Calls session.shell.exec." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return ShellExecResult.from_dict(await self._client.request("session.shell.exec", params_dict, **_timeout_kwargs(timeout))) async def kill(self, params: ShellKillRequest, *, timeout: float | None = None) -> ShellKillResult: + "Calls session.shell.kill." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return ShellKillResult.from_dict(await self._client.request("session.shell.kill", params_dict, **_timeout_kwargs(timeout))) @@ -7578,9 +7646,11 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def compact(self, *, timeout: float | None = None) -> HistoryCompactResult: + "Calls session.history.compact." return HistoryCompactResult.from_dict(await self._client.request("session.history.compact", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) async def truncate(self, params: HistoryTruncateRequest, *, timeout: float | None = None) -> HistoryTruncateResult: + "Calls session.history.truncate." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return HistoryTruncateResult.from_dict(await self._client.request("session.history.truncate", params_dict, **_timeout_kwargs(timeout))) @@ -7593,6 +7663,7 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def get_metrics(self, *, timeout: float | None = None) -> UsageGetMetricsResult: + "Calls session.usage.getMetrics." return UsageGetMetricsResult.from_dict(await self._client.request("session.usage.getMetrics", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) @@ -7603,11 +7674,13 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def enable(self, params: RemoteEnableRequest, *, timeout: float | None = None) -> RemoteEnableResult: + "Calls session.remote.enable." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return RemoteEnableResult.from_dict(await self._client.request("session.remote.enable", params_dict, **_timeout_kwargs(timeout))) async def disable(self, *, timeout: float | None = None) -> None: + "Calls session.remote.disable." await self._client.request("session.remote.disable", {"sessionId": self._session_id}, **_timeout_kwargs(timeout)) @@ -7640,9 +7713,11 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self.remote = RemoteApi(client, session_id) async def suspend(self, *, timeout: float | None = None) -> None: + "Calls session.suspend." await self._client.request("session.suspend", {"sessionId": self._session_id}, **_timeout_kwargs(timeout)) async def log(self, params: LogRequest, *, timeout: float | None = None) -> LogResult: + "Calls session.log." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return LogResult.from_dict(await self._client.request("session.log", params_dict, **_timeout_kwargs(timeout))) @@ -7650,24 +7725,34 @@ async def log(self, params: LogRequest, *, timeout: float | None = None) -> LogR class SessionFsHandler(Protocol): async def read_file(self, params: SessionFSReadFileRequest) -> SessionFSReadFileResult: + "Calls sessionFs.readFile." pass async def write_file(self, params: SessionFSWriteFileRequest) -> SessionFSError | None: + "Calls sessionFs.writeFile.\n\nReturns:\n Describes a filesystem error." pass async def append_file(self, params: SessionFSAppendFileRequest) -> SessionFSError | None: + "Calls sessionFs.appendFile.\n\nReturns:\n Describes a filesystem error." pass async def exists(self, params: SessionFSExistsRequest) -> SessionFSExistsResult: + "Calls sessionFs.exists." pass async def stat(self, params: SessionFSStatRequest) -> SessionFSStatResult: + "Calls sessionFs.stat." pass async def mkdir(self, params: SessionFSMkdirRequest) -> SessionFSError | None: + "Calls sessionFs.mkdir.\n\nReturns:\n Describes a filesystem error." pass async def readdir(self, params: SessionFSReaddirRequest) -> SessionFSReaddirResult: + "Calls sessionFs.readdir." pass async def readdir_with_types(self, params: SessionFSReaddirWithTypesRequest) -> SessionFSReaddirWithTypesResult: + "Calls sessionFs.readdirWithTypes." pass async def rm(self, params: SessionFSRmRequest) -> SessionFSError | None: + "Calls sessionFs.rm.\n\nReturns:\n Describes a filesystem error." pass async def rename(self, params: SessionFSRenameRequest) -> SessionFSError | None: + "Calls sessionFs.rename.\n\nReturns:\n Describes a filesystem error." pass @dataclass diff --git a/rust/src/generated/rpc.rs b/rust/src/generated/rpc.rs index 700aebe44..b55f9d501 100644 --- a/rust/src/generated/rpc.rs +++ b/rust/src/generated/rpc.rs @@ -68,6 +68,8 @@ impl<'a> ClientRpc<'a> { } } + /// Calls `ping`. + /// /// Wire method: `ping`. pub async fn ping(&self, params: PingRequest) -> Result { let wire_params = serde_json::to_value(params)?; @@ -78,6 +80,8 @@ impl<'a> ClientRpc<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `connect`. + /// /// Wire method: `connect`. pub async fn connect(&self, params: ConnectRequest) -> Result { let wire_params = serde_json::to_value(params)?; @@ -96,6 +100,8 @@ pub struct ClientRpcAccount<'a> { } impl<'a> ClientRpcAccount<'a> { + /// Calls `account.getQuota`. + /// /// Wire method: `account.getQuota`. pub async fn get_quota(&self) -> Result { let wire_params = serde_json::json!({}); @@ -106,6 +112,8 @@ impl<'a> ClientRpcAccount<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `account.getQuota`. + /// /// Wire method: `account.getQuota`. pub async fn get_quota_with_params( &self, @@ -134,6 +142,8 @@ impl<'a> ClientRpcMcp<'a> { } } + /// Calls `mcp.discover`. + /// /// Wire method: `mcp.discover`. pub async fn discover(&self, params: McpDiscoverRequest) -> Result { let wire_params = serde_json::to_value(params)?; @@ -152,6 +162,8 @@ pub struct ClientRpcMcpConfig<'a> { } impl<'a> ClientRpcMcpConfig<'a> { + /// Calls `mcp.config.list`. + /// /// Wire method: `mcp.config.list`. pub async fn list(&self) -> Result { let wire_params = serde_json::json!({}); @@ -162,6 +174,8 @@ impl<'a> ClientRpcMcpConfig<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `mcp.config.add`. + /// /// Wire method: `mcp.config.add`. pub async fn add(&self, params: McpConfigAddRequest) -> Result<(), Error> { let wire_params = serde_json::to_value(params)?; @@ -172,6 +186,8 @@ impl<'a> ClientRpcMcpConfig<'a> { Ok(()) } + /// Calls `mcp.config.update`. + /// /// Wire method: `mcp.config.update`. pub async fn update(&self, params: McpConfigUpdateRequest) -> Result<(), Error> { let wire_params = serde_json::to_value(params)?; @@ -182,6 +198,8 @@ impl<'a> ClientRpcMcpConfig<'a> { Ok(()) } + /// Calls `mcp.config.remove`. + /// /// Wire method: `mcp.config.remove`. pub async fn remove(&self, params: McpConfigRemoveRequest) -> Result<(), Error> { let wire_params = serde_json::to_value(params)?; @@ -192,6 +210,8 @@ impl<'a> ClientRpcMcpConfig<'a> { Ok(()) } + /// Calls `mcp.config.enable`. + /// /// Wire method: `mcp.config.enable`. pub async fn enable(&self, params: McpConfigEnableRequest) -> Result<(), Error> { let wire_params = serde_json::to_value(params)?; @@ -202,6 +222,8 @@ impl<'a> ClientRpcMcpConfig<'a> { Ok(()) } + /// Calls `mcp.config.disable`. + /// /// Wire method: `mcp.config.disable`. pub async fn disable(&self, params: McpConfigDisableRequest) -> Result<(), Error> { let wire_params = serde_json::to_value(params)?; @@ -220,6 +242,8 @@ pub struct ClientRpcModels<'a> { } impl<'a> ClientRpcModels<'a> { + /// Calls `models.list`. + /// /// Wire method: `models.list`. pub async fn list(&self) -> Result { let wire_params = serde_json::json!({}); @@ -230,6 +254,8 @@ impl<'a> ClientRpcModels<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `models.list`. + /// /// Wire method: `models.list`. pub async fn list_with_params(&self, params: ModelsListRequest) -> Result { let wire_params = serde_json::to_value(params)?; @@ -248,6 +274,8 @@ pub struct ClientRpcSessionFs<'a> { } impl<'a> ClientRpcSessionFs<'a> { + /// Calls `sessionFs.setProvider`. + /// /// Wire method: `sessionFs.setProvider`. pub async fn set_provider( &self, @@ -269,6 +297,8 @@ pub struct ClientRpcSessions<'a> { } impl<'a> ClientRpcSessions<'a> { + /// Calls `sessions.fork`. + /// /// Wire method: `sessions.fork`. /// ///
@@ -302,6 +332,8 @@ impl<'a> ClientRpcSkills<'a> { } } + /// Calls `skills.discover`. + /// /// Wire method: `skills.discover`. pub async fn discover(&self, params: SkillsDiscoverRequest) -> Result { let wire_params = serde_json::to_value(params)?; @@ -320,6 +352,8 @@ pub struct ClientRpcSkillsConfig<'a> { } impl<'a> ClientRpcSkillsConfig<'a> { + /// Calls `skills.config.setDisabledSkills`. + /// /// Wire method: `skills.config.setDisabledSkills`. pub async fn set_disabled_skills( &self, @@ -344,6 +378,8 @@ pub struct ClientRpcTools<'a> { } impl<'a> ClientRpcTools<'a> { + /// Calls `tools.list`. + /// /// Wire method: `tools.list`. pub async fn list(&self, params: ToolsListRequest) -> Result { let wire_params = serde_json::to_value(params)?; @@ -516,6 +552,8 @@ impl<'a> SessionRpc<'a> { } } + /// Calls `session.suspend`. + /// /// Wire method: `session.suspend`. pub async fn suspend(&self) -> Result<(), Error> { let wire_params = serde_json::json!({ "sessionId": self.session.id() }); @@ -527,6 +565,8 @@ impl<'a> SessionRpc<'a> { Ok(()) } + /// Calls `session.log`. + /// /// Wire method: `session.log`. pub async fn log(&self, params: LogRequest) -> Result { let mut wire_params = serde_json::to_value(params)?; @@ -547,6 +587,8 @@ pub struct SessionRpcAgent<'a> { } impl<'a> SessionRpcAgent<'a> { + /// Calls `session.agent.list`. + /// /// Wire method: `session.agent.list`. /// ///
@@ -566,6 +608,8 @@ impl<'a> SessionRpcAgent<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.agent.getCurrent`. + /// /// Wire method: `session.agent.getCurrent`. /// ///
@@ -585,6 +629,8 @@ impl<'a> SessionRpcAgent<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.agent.select`. + /// /// Wire method: `session.agent.select`. /// ///
@@ -605,6 +651,8 @@ impl<'a> SessionRpcAgent<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.agent.deselect`. + /// /// Wire method: `session.agent.deselect`. /// ///
@@ -624,6 +672,8 @@ impl<'a> SessionRpcAgent<'a> { Ok(()) } + /// Calls `session.agent.reload`. + /// /// Wire method: `session.agent.reload`. /// ///
@@ -651,6 +701,8 @@ pub struct SessionRpcAuth<'a> { } impl<'a> SessionRpcAuth<'a> { + /// Calls `session.auth.getStatus`. + /// /// Wire method: `session.auth.getStatus`. pub async fn get_status(&self) -> Result { let wire_params = serde_json::json!({ "sessionId": self.session.id() }); @@ -670,6 +722,8 @@ pub struct SessionRpcCommands<'a> { } impl<'a> SessionRpcCommands<'a> { + /// Calls `session.commands.list`. + /// /// Wire method: `session.commands.list`. pub async fn list(&self) -> Result { let wire_params = serde_json::json!({ "sessionId": self.session.id() }); @@ -681,6 +735,8 @@ impl<'a> SessionRpcCommands<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.commands.list`. + /// /// Wire method: `session.commands.list`. pub async fn list_with_params( &self, @@ -696,6 +752,8 @@ impl<'a> SessionRpcCommands<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.commands.invoke`. + /// /// Wire method: `session.commands.invoke`. pub async fn invoke( &self, @@ -711,6 +769,8 @@ impl<'a> SessionRpcCommands<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.commands.handlePendingCommand`. + /// /// Wire method: `session.commands.handlePendingCommand`. pub async fn handle_pending_command( &self, @@ -729,6 +789,8 @@ impl<'a> SessionRpcCommands<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.commands.respondToQueuedCommand`. + /// /// Wire method: `session.commands.respondToQueuedCommand`. pub async fn respond_to_queued_command( &self, @@ -755,6 +817,8 @@ pub struct SessionRpcExtensions<'a> { } impl<'a> SessionRpcExtensions<'a> { + /// Calls `session.extensions.list`. + /// /// Wire method: `session.extensions.list`. /// ///
@@ -774,6 +838,8 @@ impl<'a> SessionRpcExtensions<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.extensions.enable`. + /// /// Wire method: `session.extensions.enable`. /// ///
@@ -794,6 +860,8 @@ impl<'a> SessionRpcExtensions<'a> { Ok(()) } + /// Calls `session.extensions.disable`. + /// /// Wire method: `session.extensions.disable`. /// ///
@@ -814,6 +882,8 @@ impl<'a> SessionRpcExtensions<'a> { Ok(()) } + /// Calls `session.extensions.reload`. + /// /// Wire method: `session.extensions.reload`. /// ///
@@ -841,6 +911,8 @@ pub struct SessionRpcFleet<'a> { } impl<'a> SessionRpcFleet<'a> { + /// Calls `session.fleet.start`. + /// /// Wire method: `session.fleet.start`. /// ///
@@ -869,6 +941,8 @@ pub struct SessionRpcHistory<'a> { } impl<'a> SessionRpcHistory<'a> { + /// Calls `session.history.compact`. + /// /// Wire method: `session.history.compact`. /// ///
@@ -888,6 +962,8 @@ impl<'a> SessionRpcHistory<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.history.truncate`. + /// /// Wire method: `session.history.truncate`. /// ///
@@ -919,6 +995,8 @@ pub struct SessionRpcInstructions<'a> { } impl<'a> SessionRpcInstructions<'a> { + /// Calls `session.instructions.getSources`. + /// /// Wire method: `session.instructions.getSources`. pub async fn get_sources(&self) -> Result { let wire_params = serde_json::json!({ "sessionId": self.session.id() }); @@ -948,6 +1026,8 @@ impl<'a> SessionRpcMcp<'a> { } } + /// Calls `session.mcp.list`. + /// /// Wire method: `session.mcp.list`. /// ///
@@ -967,6 +1047,8 @@ impl<'a> SessionRpcMcp<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.mcp.enable`. + /// /// Wire method: `session.mcp.enable`. /// ///
@@ -987,6 +1069,8 @@ impl<'a> SessionRpcMcp<'a> { Ok(()) } + /// Calls `session.mcp.disable`. + /// /// Wire method: `session.mcp.disable`. /// ///
@@ -1007,6 +1091,8 @@ impl<'a> SessionRpcMcp<'a> { Ok(()) } + /// Calls `session.mcp.reload`. + /// /// Wire method: `session.mcp.reload`. /// ///
@@ -1034,6 +1120,8 @@ pub struct SessionRpcMcpOauth<'a> { } impl<'a> SessionRpcMcpOauth<'a> { + /// Calls `session.mcp.oauth.login`. + /// /// Wire method: `session.mcp.oauth.login`. /// ///
@@ -1062,7 +1150,13 @@ pub struct SessionRpcMode<'a> { } impl<'a> SessionRpcMode<'a> { + /// Calls `session.mode.get`. + /// /// Wire method: `session.mode.get`. + /// + /// # Returns + /// + /// The agent mode. Valid values: "interactive", "plan", "autopilot". pub async fn get(&self) -> Result { let wire_params = serde_json::json!({ "sessionId": self.session.id() }); let _value = self @@ -1073,6 +1167,8 @@ impl<'a> SessionRpcMode<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.mode.set`. + /// /// Wire method: `session.mode.set`. pub async fn set(&self, params: ModeSetRequest) -> Result<(), Error> { let mut wire_params = serde_json::to_value(params)?; @@ -1093,6 +1189,8 @@ pub struct SessionRpcModel<'a> { } impl<'a> SessionRpcModel<'a> { + /// Calls `session.model.getCurrent`. + /// /// Wire method: `session.model.getCurrent`. pub async fn get_current(&self) -> Result { let wire_params = serde_json::json!({ "sessionId": self.session.id() }); @@ -1104,6 +1202,8 @@ impl<'a> SessionRpcModel<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.model.switchTo`. + /// /// Wire method: `session.model.switchTo`. pub async fn switch_to( &self, @@ -1127,6 +1227,8 @@ pub struct SessionRpcName<'a> { } impl<'a> SessionRpcName<'a> { + /// Calls `session.name.get`. + /// /// Wire method: `session.name.get`. pub async fn get(&self) -> Result { let wire_params = serde_json::json!({ "sessionId": self.session.id() }); @@ -1138,6 +1240,8 @@ impl<'a> SessionRpcName<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.name.set`. + /// /// Wire method: `session.name.set`. pub async fn set(&self, params: NameSetRequest) -> Result<(), Error> { let mut wire_params = serde_json::to_value(params)?; @@ -1158,6 +1262,8 @@ pub struct SessionRpcPermissions<'a> { } impl<'a> SessionRpcPermissions<'a> { + /// Calls `session.permissions.handlePendingPermissionRequest`. + /// /// Wire method: `session.permissions.handlePendingPermissionRequest`. pub async fn handle_pending_permission_request( &self, @@ -1176,6 +1282,8 @@ impl<'a> SessionRpcPermissions<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.permissions.setApproveAll`. + /// /// Wire method: `session.permissions.setApproveAll`. pub async fn set_approve_all( &self, @@ -1194,6 +1302,8 @@ impl<'a> SessionRpcPermissions<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.permissions.resetSessionApprovals`. + /// /// Wire method: `session.permissions.resetSessionApprovals`. pub async fn reset_session_approvals( &self, @@ -1218,6 +1328,8 @@ pub struct SessionRpcPlan<'a> { } impl<'a> SessionRpcPlan<'a> { + /// Calls `session.plan.read`. + /// /// Wire method: `session.plan.read`. pub async fn read(&self) -> Result { let wire_params = serde_json::json!({ "sessionId": self.session.id() }); @@ -1229,6 +1341,8 @@ impl<'a> SessionRpcPlan<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.plan.update`. + /// /// Wire method: `session.plan.update`. pub async fn update(&self, params: PlanUpdateRequest) -> Result<(), Error> { let mut wire_params = serde_json::to_value(params)?; @@ -1241,6 +1355,8 @@ impl<'a> SessionRpcPlan<'a> { Ok(()) } + /// Calls `session.plan.delete`. + /// /// Wire method: `session.plan.delete`. pub async fn delete(&self) -> Result<(), Error> { let wire_params = serde_json::json!({ "sessionId": self.session.id() }); @@ -1260,6 +1376,8 @@ pub struct SessionRpcPlugins<'a> { } impl<'a> SessionRpcPlugins<'a> { + /// Calls `session.plugins.list`. + /// /// Wire method: `session.plugins.list`. /// ///
@@ -1287,6 +1405,8 @@ pub struct SessionRpcRemote<'a> { } impl<'a> SessionRpcRemote<'a> { + /// Calls `session.remote.enable`. + /// /// Wire method: `session.remote.enable`. /// ///
@@ -1307,6 +1427,8 @@ impl<'a> SessionRpcRemote<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.remote.disable`. + /// /// Wire method: `session.remote.disable`. /// ///
@@ -1334,6 +1456,8 @@ pub struct SessionRpcShell<'a> { } impl<'a> SessionRpcShell<'a> { + /// Calls `session.shell.exec`. + /// /// Wire method: `session.shell.exec`. pub async fn exec(&self, params: ShellExecRequest) -> Result { let mut wire_params = serde_json::to_value(params)?; @@ -1346,6 +1470,8 @@ impl<'a> SessionRpcShell<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.shell.kill`. + /// /// Wire method: `session.shell.kill`. pub async fn kill(&self, params: ShellKillRequest) -> Result { let mut wire_params = serde_json::to_value(params)?; @@ -1366,6 +1492,8 @@ pub struct SessionRpcSkills<'a> { } impl<'a> SessionRpcSkills<'a> { + /// Calls `session.skills.list`. + /// /// Wire method: `session.skills.list`. /// ///
@@ -1385,6 +1513,8 @@ impl<'a> SessionRpcSkills<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.skills.enable`. + /// /// Wire method: `session.skills.enable`. /// ///
@@ -1405,6 +1535,8 @@ impl<'a> SessionRpcSkills<'a> { Ok(()) } + /// Calls `session.skills.disable`. + /// /// Wire method: `session.skills.disable`. /// ///
@@ -1425,6 +1557,8 @@ impl<'a> SessionRpcSkills<'a> { Ok(()) } + /// Calls `session.skills.reload`. + /// /// Wire method: `session.skills.reload`. /// ///
@@ -1452,6 +1586,8 @@ pub struct SessionRpcTasks<'a> { } impl<'a> SessionRpcTasks<'a> { + /// Calls `session.tasks.startAgent`. + /// /// Wire method: `session.tasks.startAgent`. /// ///
@@ -1475,6 +1611,8 @@ impl<'a> SessionRpcTasks<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.tasks.list`. + /// /// Wire method: `session.tasks.list`. /// ///
@@ -1494,6 +1632,8 @@ impl<'a> SessionRpcTasks<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.tasks.promoteToBackground`. + /// /// Wire method: `session.tasks.promoteToBackground`. /// ///
@@ -1520,6 +1660,8 @@ impl<'a> SessionRpcTasks<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.tasks.cancel`. + /// /// Wire method: `session.tasks.cancel`. /// ///
@@ -1540,6 +1682,8 @@ impl<'a> SessionRpcTasks<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.tasks.remove`. + /// /// Wire method: `session.tasks.remove`. /// ///
@@ -1560,6 +1704,8 @@ impl<'a> SessionRpcTasks<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.tasks.sendMessage`. + /// /// Wire method: `session.tasks.sendMessage`. /// ///
@@ -1591,6 +1737,8 @@ pub struct SessionRpcTools<'a> { } impl<'a> SessionRpcTools<'a> { + /// Calls `session.tools.handlePendingToolCall`. + /// /// Wire method: `session.tools.handlePendingToolCall`. pub async fn handle_pending_tool_call( &self, @@ -1617,7 +1765,13 @@ pub struct SessionRpcUi<'a> { } impl<'a> SessionRpcUi<'a> { + /// Calls `session.ui.elicitation`. + /// /// Wire method: `session.ui.elicitation`. + /// + /// # Returns + /// + /// The elicitation response (accept with form values, decline, or cancel) pub async fn elicitation( &self, params: UIElicitationRequest, @@ -1632,6 +1786,8 @@ impl<'a> SessionRpcUi<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.ui.handlePendingElicitation`. + /// /// Wire method: `session.ui.handlePendingElicitation`. pub async fn handle_pending_elicitation( &self, @@ -1658,6 +1814,8 @@ pub struct SessionRpcUsage<'a> { } impl<'a> SessionRpcUsage<'a> { + /// Calls `session.usage.getMetrics`. + /// /// Wire method: `session.usage.getMetrics`. /// ///
@@ -1685,6 +1843,8 @@ pub struct SessionRpcWorkspaces<'a> { } impl<'a> SessionRpcWorkspaces<'a> { + /// Calls `session.workspaces.getWorkspace`. + /// /// Wire method: `session.workspaces.getWorkspace`. pub async fn get_workspace(&self) -> Result { let wire_params = serde_json::json!({ "sessionId": self.session.id() }); @@ -1699,6 +1859,8 @@ impl<'a> SessionRpcWorkspaces<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.workspaces.listFiles`. + /// /// Wire method: `session.workspaces.listFiles`. pub async fn list_files(&self) -> Result { let wire_params = serde_json::json!({ "sessionId": self.session.id() }); @@ -1710,6 +1872,8 @@ impl<'a> SessionRpcWorkspaces<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.workspaces.readFile`. + /// /// Wire method: `session.workspaces.readFile`. pub async fn read_file( &self, @@ -1725,6 +1889,8 @@ impl<'a> SessionRpcWorkspaces<'a> { Ok(serde_json::from_value(_value)?) } + /// Calls `session.workspaces.createFile`. + /// /// Wire method: `session.workspaces.createFile`. pub async fn create_file(&self, params: WorkspacesCreateFileRequest) -> Result<(), Error> { let mut wire_params = serde_json::to_value(params)?; diff --git a/scripts/codegen/csharp.ts b/scripts/codegen/csharp.ts index 3e532bd84..969146871 100644 --- a/scripts/codegen/csharp.ts +++ b/scripts/codegen/csharp.ts @@ -71,6 +71,10 @@ function escapeXml(text: string): string { return text.replace(/&/g, "&").replace(//g, ">"); } +function escapeXmlAttribute(text: string): string { + return escapeXml(text).replace(/"/g, """).replace(/'/g, "'"); +} + /** Ensures text ends with sentence-ending punctuation. */ function ensureTrailingPunctuation(text: string): string { const trimmed = text.trimEnd(); @@ -92,6 +96,80 @@ function xmlDocComment(description: string | undefined, indent: string): string[ ]; } +function xmlDocElement(tagName: string, description: string | undefined, indent: string): string[] { + if (!description) return []; + const escaped = ensureTrailingPunctuation(escapeXml(description.trim())); + const lines = escaped.split(/\r?\n/); + if (lines.length === 1) { + return [`${indent}/// <${tagName}>${lines[0]}`]; + } + return [ + `${indent}/// <${tagName}>`, + ...lines.map((line) => `${indent}/// ${line}`), + `${indent}/// `, + ]; +} + +function xmlDocNamedElement( + tagName: string, + name: string, + description: string | undefined, + indent: string, + escapeDescription = true +): string[] { + if (!description) return []; + const preparedDescription = escapeDescription ? escapeXml(description.trim()) : description.trim(); + const lines = ensureTrailingPunctuation(preparedDescription).split(/\r?\n/); + const escapedName = escapeXmlAttribute(name); + if (lines.length === 1) { + return [`${indent}/// <${tagName} name="${escapedName}">${lines[0]}`]; + } + return [ + `${indent}/// <${tagName} name="${escapedName}">`, + ...lines.map((line) => `${indent}/// ${line}`), + `${indent}/// `, + ]; +} + +function rpcResultDescription(method: RpcMethod, resultSchema: JSONSchema7 | undefined): string | undefined { + if (isVoidSchema(resultSchema)) return undefined; + return method.result?.description ?? resultSchema?.description; +} + +function rpcParamsDescription(method: RpcMethod, effectiveParams: JSONSchema7 | undefined): string | undefined { + return method.params?.description ?? effectiveParams?.description; +} + +function fallbackParameterDescription(name: string): string { + return name === "request" ? "The request parameters." : `The ${name} parameter.`; +} + +function pushRpcMethodXmlDocs( + lines: string[], + method: RpcMethod, + indent: string, + parameterDescriptions: Array<{ name: string; description?: string; escapeDescription?: boolean }>, + resultSchema: JSONSchema7 | undefined, + summaryFallback?: string +): void { + lines.push(...xmlDocComment(method.description ?? summaryFallback ?? `Calls "${method.rpcMethod}".`, indent)); + for (const parameter of parameterDescriptions) { + lines.push( + ...xmlDocNamedElement( + "param", + parameter.name, + parameter.description ?? fallbackParameterDescription(parameter.name), + indent, + parameter.escapeDescription + ) + ); + } + lines.push(...xmlDocElement("returns", rpcResultDescription(method, resultSchema), indent)); +} + +const CANCELLATION_TOKEN_DESCRIPTION = + 'The to monitor for cancellation requests. The default is .'; + /** Like xmlDocComment but skips XML escaping — use only for codegen-controlled strings that already contain valid XML tags. */ function rawXmlDocSummary(text: string, indent: string): string[] { const line = ensureTrailingPunctuation(text.trim()); @@ -1658,17 +1736,9 @@ function emitServerInstanceMethod( if (reqClass) classes.push(reqClass); } - lines.push(""); - lines.push(`${indent}/// Calls "${method.rpcMethod}".`); - if (method.stability === "experimental" && !groupExperimental) { - pushExperimentalAttribute(lines, indent); - } - if (method.deprecated && !groupDeprecated) { - pushObsoleteAttributes(lines, indent); - } - const sigParams: string[] = []; const bodyAssignments: string[] = []; + const parameterDescriptions: Array<{ name: string; description?: string; escapeDescription?: boolean }> = []; for (const [pName, pSchema] of paramEntries) { if (typeof pSchema !== "object") continue; @@ -1679,11 +1749,25 @@ function emitServerInstanceMethod( : schemaTypeToCSharp(jsonSchema, isReq, rpcKnownTypes); sigParams.push(`${csType} ${pName}${isReq ? "" : " = null"}`); bodyAssignments.push(`${toPascalCase(pName)} = ${pName}`); + parameterDescriptions.push({ name: pName, description: jsonSchema.description }); } sigParams.push("CancellationToken cancellationToken = default"); + parameterDescriptions.push({ + name: "cancellationToken", + description: CANCELLATION_TOKEN_DESCRIPTION, + escapeDescription: false, + }); const taskType = !isVoidSchema(resultSchema) ? `Task<${resultClassName}>` : "Task"; const localRequestName = localRequestVariableName(paramEntries); + lines.push(""); + pushRpcMethodXmlDocs(lines, method, indent, parameterDescriptions, resultSchema); + if (method.stability === "experimental" && !groupExperimental) { + pushExperimentalAttribute(lines, indent); + } + if (method.deprecated && !groupDeprecated) { + pushObsoleteAttributes(lines, indent); + } lines.push(`${indent}${methodVisibility} async ${taskType} ${methodName}Async(${sigParams.join(", ")})`); lines.push(`${indent}{`); if (requestClassName && bodyAssignments.length > 0) { @@ -1783,18 +1867,13 @@ function emitSessionMethod(key: string, method: RpcMethod, lines: string[], clas } } - lines.push("", `${indent}/// Calls "${method.rpcMethod}".`); - if (method.stability === "experimental" && !groupExperimental) { - pushExperimentalAttribute(lines, indent); - } - if (method.deprecated && !groupDeprecated) { - pushObsoleteAttributes(lines, indent); - } const sigParams: string[] = []; const bodyAssignments = [`SessionId = _sessionId`]; + const parameterDescriptions: Array<{ name: string; description?: string; escapeDescription?: boolean }> = []; if (useRequestParameter) { sigParams.push(`${requestClassName}? request = null`); + parameterDescriptions.push({ name: "request", description: rpcParamsDescription(method, effectiveParams) }); for (const [pName] of paramEntries) { bodyAssignments.push(`${toPascalCase(pName)} = request?.${toPascalCase(pName)}`); } @@ -1805,12 +1884,26 @@ function emitSessionMethod(key: string, method: RpcMethod, lines: string[], clas const csType = resolveRpcType(pSchema as JSONSchema7, isReq, requestClassName, toPascalCase(pName), classes); sigParams.push(`${csType} ${pName}${isReq ? "" : " = null"}`); bodyAssignments.push(`${toPascalCase(pName)} = ${pName}`); + parameterDescriptions.push({ name: pName, description: (pSchema as JSONSchema7).description }); } } sigParams.push("CancellationToken cancellationToken = default"); + parameterDescriptions.push({ + name: "cancellationToken", + description: CANCELLATION_TOKEN_DESCRIPTION, + escapeDescription: false, + }); const taskType = !isVoidSchema(resultSchema) ? `Task<${resultClassName}>` : "Task"; const localRequestName = localRequestVariableName(paramEntries, useRequestParameter); + lines.push(""); + pushRpcMethodXmlDocs(lines, method, indent, parameterDescriptions, resultSchema); + if (method.stability === "experimental" && !groupExperimental) { + pushExperimentalAttribute(lines, indent); + } + if (method.deprecated && !groupDeprecated) { + pushObsoleteAttributes(lines, indent); + } lines.push(`${indent}${methodVisibility} async ${taskType} ${methodName}Async(${sigParams.join(", ")})`); lines.push(`${indent}{`, `${indent} var ${localRequestName} = new ${wireRequestClassName} { ${bodyAssignments.join(", ")} };`); if (!isVoidSchema(resultSchema)) { @@ -1920,7 +2013,17 @@ function emitClientSessionApiRegistration(clientSchema: Record, const hasParams = !!effectiveParams?.properties && Object.keys(effectiveParams.properties).length > 0; const resultSchema = getMethodResultSchema(method); const taskType = resultTaskType(method); - lines.push(` /// Handles "${method.rpcMethod}".`); + pushRpcMethodXmlDocs( + lines, + method, + " ", + [ + ...(hasParams ? [{ name: "request", description: rpcParamsDescription(method, effectiveParams) }] : []), + { name: "cancellationToken", description: CANCELLATION_TOKEN_DESCRIPTION, escapeDescription: false }, + ], + resultSchema, + `Handles "${method.rpcMethod}".` + ); if (method.stability === "experimental" && !groupExperimental) { pushExperimentalAttribute(lines, " "); } diff --git a/scripts/codegen/go.ts b/scripts/codegen/go.ts index 717e0a82d..59c148112 100644 --- a/scripts/codegen/go.ts +++ b/scripts/codegen/go.ts @@ -163,6 +163,47 @@ function pushGoExperimentalMethodComment(lines: string[], methodName: string, in pushGoComment(lines, `Experimental: ${methodName} is an experimental API and may change or be removed in future versions.`, indent); } +function lowerFirst(value: string): string { + if (value.length === 0) return value; + return value.charAt(0).toLowerCase() + value.slice(1); +} + +function goMethodDocSummary(methodName: string, method: RpcMethod, fallbackVerb = "calls"): string { + const description = method.description?.trim(); + if (!description) return `${methodName} ${fallbackVerb} ${method.rpcMethod}.`; + if (description.startsWith(methodName)) return description; + return `${methodName} ${lowerFirst(description)}`; +} + +function goRpcResultDescription(method: RpcMethod, resultSchema: JSONSchema7 | undefined): string | undefined { + if (isVoidSchema(resultSchema)) return undefined; + return method.result?.description ?? resultSchema?.description; +} + +function goRpcParamsDescription(method: RpcMethod, effectiveParams: JSONSchema7 | undefined): string | undefined { + return method.params?.description ?? effectiveParams?.description; +} + +function pushGoRpcMethodComment( + lines: string[], + methodName: string, + method: RpcMethod, + resultSchema: JSONSchema7 | undefined, + paramsDescription?: string, + indent = "", + fallbackVerb = "calls" +): void { + const paragraphs = [goMethodDocSummary(methodName, method, fallbackVerb), `RPC method: ${method.rpcMethod}.`]; + if (paramsDescription) { + paragraphs.push(`Parameters: ${paramsDescription}`); + } + const resultDescription = goRpcResultDescription(method, resultSchema); + if (resultDescription) { + paragraphs.push(`Returns: ${resultDescription}`); + } + pushGoComment(lines, paragraphs.join("\n\n"), indent); +} + function goCommentLines(text: string, indent = "", wrap = true): string[] { const prefix = `${indent}//`; const lines: string[] = []; @@ -3721,6 +3762,13 @@ function emitMethod(lines: string[], receiver: string, name: string, method: Rpc const clientRef = isWrapper ? "a.common.client" : "a.client"; const sessionIDRef = isWrapper ? "a.common.sessionID" : "a.sessionID"; + pushGoRpcMethodComment( + lines, + methodName, + method, + resultSchema, + hasParams ? goRpcParamsDescription(method, effectiveParams) : undefined + ); if (method.deprecated && !groupDeprecated) { pushGoComment(lines, `Deprecated: ${methodName} is deprecated and will be removed in a future version.`); } @@ -3834,6 +3882,16 @@ function emitClientSessionApiRegistration(lines: string[], clientSchema: Record< } lines.push(`type ${interfaceName} interface {`); for (const method of methods) { + const resultSchema = getMethodResultSchema(method); + pushGoRpcMethodComment( + lines, + clientHandlerMethodName(method.rpcMethod), + method, + resultSchema, + goRpcParamsDescription(method, getMethodParamsSchema(method)), + "\t", + "handles" + ); if (method.deprecated && !groupDeprecated) { pushGoComment(lines, `Deprecated: ${clientHandlerMethodName(method.rpcMethod)} is deprecated and will be removed in a future version.`, "\t"); } @@ -3841,7 +3899,6 @@ function emitClientSessionApiRegistration(lines: string[], clientSchema: Record< pushGoExperimentalMethodComment(lines, clientHandlerMethodName(method.rpcMethod), "\t"); } const paramsType = resolveType(goParamsTypeName(method)); - const resultSchema = getMethodResultSchema(method); const nullableInner = resultSchema ? getNullableInner(resultSchema) : undefined; const resultType = nullableInner ? resolveType(goNullableResultTypeName(method, nullableInner)) diff --git a/scripts/codegen/python.ts b/scripts/codegen/python.ts index ebad322ff..29c68da0d 100644 --- a/scripts/codegen/python.ts +++ b/scripts/codegen/python.ts @@ -277,6 +277,48 @@ function pyDocstringLiteral(text: string): string { return JSON.stringify(normalized); } +function rpcResultDescription(method: RpcMethod, resultSchema: JSONSchema7 | undefined): string | undefined { + if (isVoidSchema(resultSchema)) return undefined; + return method.result?.description ?? resultSchema?.description; +} + +function rpcParamsDescription(method: RpcMethod, effectiveParams: JSONSchema7 | undefined): string | undefined { + return method.params?.description ?? effectiveParams?.description; +} + +function pushPyRpcMethodDocstring( + lines: string[], + indent: string, + method: RpcMethod, + options: { + paramsName?: string; + paramsDescription?: string; + resultDescription?: string; + deprecated?: boolean; + experimental?: boolean; + internal?: boolean; + } = {} +): void { + const sections: string[] = [method.description ?? `Calls ${method.rpcMethod}.`]; + if (options.paramsName && options.paramsDescription) { + sections.push(`Args:\n ${options.paramsName}: ${options.paramsDescription}`); + } + if (options.resultDescription) { + sections.push(`Returns:\n ${options.resultDescription}`); + } + if (options.deprecated) { + sections.push(".. deprecated:: This API is deprecated and will be removed in a future version."); + } + if (options.experimental) { + sections.push(".. warning:: This API is experimental and may change or be removed in future versions."); + } + if (options.internal) { + sections.push(":meta private:\n\nInternal SDK API; not part of the public surface."); + } + + lines.push(`${indent}${pyDocstringLiteral(sections.join("\n\n"))}`); +} + function modernizePython(code: string): string { // Replace Optional[X] with X | None (handles arbitrarily nested brackets) code = replaceBalancedBrackets(code, "Optional", (inner) => `${inner} | None`); @@ -2463,15 +2505,14 @@ function emitMethod(lines: string[], name: string, method: RpcMethod, isSession: lines.push(sig); - if (method.deprecated && !groupDeprecated) { - lines.push(` """.. deprecated:: This API is deprecated and will be removed in a future version."""`); - } - if (method.stability === "experimental" && !groupExperimental) { - lines.push(` """.. warning:: This API is experimental and may change or be removed in future versions."""`); - } - if (method.visibility === "internal") { - lines.push(` """:meta private: Internal SDK API; not part of the public surface."""`); - } + pushPyRpcMethodDocstring(lines, " ", method, { + paramsName: hasParams ? "params" : undefined, + paramsDescription: rpcParamsDescription(method, effectiveParams), + resultDescription: rpcResultDescription(method, resultSchema), + deprecated: method.deprecated && !groupDeprecated, + experimental: method.stability === "experimental" && !groupExperimental, + internal: method.visibility === "internal", + }); // Deserialize helper const innerTypeName = hasNullableResult ? resolveType(pythonResultTypeName(method, nullableInner)) : resultType; @@ -2606,12 +2647,13 @@ function emitClientSessionHandlerMethod( resultType = "None"; } lines.push(` async def ${toSnakeCase(name)}(self, params: ${paramsType}) -> ${resultType}:`); - if (method.deprecated && !groupDeprecated) { - lines.push(` """.. deprecated:: This API is deprecated and will be removed in a future version."""`); - } - if (method.stability === "experimental" && !groupExperimental) { - lines.push(` """.. warning:: This API is experimental and may change or be removed in future versions."""`); - } + pushPyRpcMethodDocstring(lines, " ", method, { + paramsName: "params", + paramsDescription: rpcParamsDescription(method, getMethodParamsSchema(method)), + resultDescription: rpcResultDescription(method, resultSchema), + deprecated: method.deprecated && !groupDeprecated, + experimental: method.stability === "experimental" && !groupExperimental, + }); lines.push(` pass`); } diff --git a/scripts/codegen/rust.ts b/scripts/codegen/rust.ts index c540bbdaa..1a5847033 100644 --- a/scripts/codegen/rust.ts +++ b/scripts/codegen/rust.ts @@ -432,6 +432,58 @@ function pushRustExperimentalDocs( lines.push(`${indent}///
`); } +function pushRustDoc(lines: string[], text: string | undefined, indent = ""): void { + if (!text) return; + for (const paragraph of text.trim().split(/\r?\n/)) { + if (paragraph.trim().length === 0) { + lines.push(`${indent}///`); + } else { + lines.push(`${indent}/// ${paragraph.trim()}`); + } + } +} + +function rustRpcResultDescription( + method: RpcMethod, + resultSchema: JSONSchema7 | undefined, +): string | undefined { + if (isVoidSchema(resultSchema)) return undefined; + return method.result?.description ?? resultSchema?.description; +} + +function rustRpcParamsDescription( + method: RpcMethod, + resolvedParams: JSONSchema7 | undefined, +): string | undefined { + return method.params?.description ?? resolvedParams?.description; +} + +function rustRpcMethodDocs( + method: RpcMethod, + resultSchema: JSONSchema7 | undefined, + paramsDescription: string | undefined, + includeParams: boolean, +): string[] { + const docs: string[] = []; + pushRustDoc(docs, method.description ?? `Calls \`${method.rpcMethod}\`.`, " "); + docs.push(" ///"); + docs.push(` /// Wire method: \`${method.rpcMethod}\`.`); + if (includeParams && paramsDescription) { + docs.push(" ///"); + docs.push(" /// # Parameters"); + docs.push(" ///"); + pushRustDoc(docs, `* \`params\` - ${paramsDescription}`, " "); + } + const resultDescription = rustRpcResultDescription(method, resultSchema); + if (resultDescription) { + docs.push(" ///"); + docs.push(" /// # Returns"); + docs.push(" ///"); + pushRustDoc(docs, resultDescription, " "); + } + return docs; +} + // ── Type resolution ───────────────────────────────────────────────────────── function rustRefTypeName(ref: string, definitions?: DefinitionCollections): string { @@ -1104,13 +1156,23 @@ function collectRpcMethods( return methods; } -function rustParamsTypeName(method: RpcMethod, ctx: RustCodegenCtx): string { - if (method.params?.$ref && parseExternalSchemaRef(method.params.$ref)) { - recordExternalRustTypeRef(method.params.$ref, ctx); - return rustRefTypeName(method.params.$ref); +function rustParamsTypeName( + method: RpcMethod, + context: DefinitionCollections | RustCodegenCtx, +): string { + const ctx = "externalTypeRefs" in context ? context : undefined; + const defCollections = ctx?.definitions ?? context; + const params = method.params as (JSONSchema7 & { $ref?: string }) | undefined; + if (typeof params?.$ref === "string") { + if (ctx) { + recordExternalRustTypeRef(params.$ref, ctx); + } + return rustRefTypeName(params.$ref, defCollections); } + + const resolved = params ? resolveSchema(params, defCollections) : undefined; return getRpcSchemaTypeName( - method.params, + resolved ?? params, `${toPascalCase(method.rpcMethod)}Params`, ); } @@ -1126,6 +1188,66 @@ function rustResultTypeName(method: RpcMethod, ctx: RustCodegenCtx): string { ); } +function asGeneratedObjectSchema( + schema: JSONSchema7, + defCollections: DefinitionCollections, +): JSONSchema7 | undefined { + const resolved = resolveObjectSchema(schema, defCollections); + if (!resolved || !isObjectSchema(resolved)) return undefined; + + return { + ...resolved, + title: resolved.title ?? schema.title, + description: schema.description ?? resolved.description, + }; +} + +function getMethodParamsObjectSchema( + method: RpcMethod, + defCollections: DefinitionCollections, + isSession: boolean, +): JSONSchema7 | undefined { + if (!method.params) return undefined; + + const resolved = asGeneratedObjectSchema(method.params, defCollections); + if (!resolved) return undefined; + + const properties = { ...(resolved.properties ?? {}) }; + if (isSession) { + delete properties.sessionId; + } + + if (Object.keys(properties).length === 0) return undefined; + + const required = (resolved.required ?? []) + .filter((name) => !isSession || name !== "sessionId") + .filter((name) => Object.prototype.hasOwnProperty.call(properties, name)); + + const schema: JSONSchema7 = { + ...resolved, + properties, + description: method.params.description ?? resolved.description, + }; + + if (required.length > 0) { + schema.required = required; + } else { + delete schema.required; + } + + return schema; +} + +function isNullableParamsSchema( + params: JSONSchema7, + defCollections: DefinitionCollections, +): boolean { + if (getNullableInner(params)) return true; + + const resolved = resolveSchema(params, defCollections); + return !!resolved && !!getNullableInner(resolved); +} + function generateApiTypesCode(apiSchema: ApiSchema): string { const definitions = collectDefinitions(apiSchema as Record); const defCollections = collectDefinitionCollections( @@ -1146,24 +1268,35 @@ function generateApiTypesCode(apiSchema: ApiSchema): string { schema.description, isSchemaExperimental(schema), ); + } else if (asGeneratedObjectSchema(schema, defCollections)) { + emitRustStruct( + name, + asGeneratedObjectSchema(schema, defCollections)!, + ctx, + schema.description, + ); } else if (getUnionVariants(schema)) { tryEmitRustUnion(schema, name, "", ctx); - } else if (isObjectSchema(schema)) { - emitRustStruct(name, schema, ctx, schema.description); } } // Collect all RPC methods and generate request/response types - const allMethods: RpcMethod[] = []; - for (const group of [ - apiSchema.server, - apiSchema.session, - apiSchema.clientSession, + const methodEntries: { method: RpcMethod; isSession: boolean }[] = []; + for (const { group, isSession } of [ + { group: apiSchema.server, isSession: false }, + { group: apiSchema.session, isSession: true }, + { group: apiSchema.clientSession, isSession: false }, ]) { if (group) { - allMethods.push(...collectRpcMethods(group as Record)); + methodEntries.push( + ...collectRpcMethods(group as Record).map((method) => ({ + method, + isSession, + })), + ); } } + const allMethods = methodEntries.map(({ method }) => method); // RPC method name constants const methodConstLines: string[] = []; @@ -1180,14 +1313,24 @@ function generateApiTypesCode(apiSchema: ApiSchema): string { methodConstLines.push("}"); // Generate param/result types for each method - for (const method of allMethods) { - if ( - method.params && - isObjectSchema(method.params) && - !isVoidSchema(method.params) - ) { + for (const { method, isSession } of methodEntries) { + const paramsSchema = getMethodParamsObjectSchema( + method, + defCollections, + isSession, + ); + const sessionWireParamsSchema = isSession && !paramsSchema && method.params + ? asGeneratedObjectSchema(method.params, defCollections) + : undefined; + const generatedParamsSchema = paramsSchema ?? sessionWireParamsSchema; + if (generatedParamsSchema) { const paramsName = rustParamsTypeName(method, ctx); - emitRustStruct(paramsName, method.params, ctx, method.params.description); + emitRustStruct( + paramsName, + generatedParamsSchema, + ctx, + generatedParamsSchema.description, + ); } if (method.result && !isVoidSchema(method.result)) { const resultName = rustResultTypeName(method, ctx); @@ -1319,29 +1462,22 @@ function getMethodParamsInfo( isSession: boolean, ): { hasParams: boolean; optional: boolean; typeName: string | null } { if (!method.params) return { hasParams: false, optional: false, typeName: null }; - const inline = method.params as JSONSchema7 & { $ref?: string }; - const resolved = resolveObjectSchema(inline, defCollections) ?? - resolveSchema(inline, defCollections); - if (!resolved) return { hasParams: false, optional: false, typeName: null }; - - let typeName: string | null = null; - if (typeof inline.$ref === "string") { - typeName = refTypeName(inline.$ref, defCollections); - } else if (typeof resolved.title === "string") { - typeName = resolved.title; - } else if (typeof inline.title === "string") { - typeName = inline.title; - } - - const allProps = Object.keys(resolved.properties || {}); - const props = isSession - ? allProps.filter((p) => p !== "sessionId") - : allProps; + const paramsSchema = getMethodParamsObjectSchema( + method, + defCollections, + isSession, + ); + if (!paramsSchema) return { hasParams: false, optional: false, typeName: null }; + + const typeName = rustParamsTypeName(method, defCollections); + + const props = Object.keys(paramsSchema.properties || {}); if (props.length === 0) return { hasParams: false, optional: false, typeName: null }; if (!typeName) return { hasParams: false, optional: false, typeName: null }; - const required = new Set(resolved.required || []); + const required = new Set(paramsSchema.required || []); const hasRequiredParams = props.some((p) => required.has(p)); - const optional = !!getNullableInner(inline) && !hasRequiredParams; + const optional = isNullableParamsSchema(method.params, defCollections) && + !hasRequiredParams; return { hasParams: true, optional, typeName }; } @@ -1489,52 +1625,67 @@ function emitNamespaceMethod( const paramsInfo = getMethodParamsInfo(method, defCollections, isSession); const hasParams = paramsInfo.hasParams; const paramsTypeName = paramsInfo.typeName; + const resolvedParams = method.params + ? (resolveObjectSchema(method.params, defCollections) ?? + resolveSchema(method.params, defCollections) ?? + method.params) + : undefined; const resultTypeName = getResultTypeName(method, defCollections); + const resultSchema = method.result + ? (resolveSchema(method.result, defCollections) ?? method.result) + : undefined; const returnType = resultTypeName ? resultTypeName : "()"; const resultIsVoid = resultTypeName === null; - const docs: string[] = []; - docs.push(` /// Wire method: \`${wireMethod}\`.`); - if (method.deprecated) docs.push(...rustDeprecatedAttributes(" ")); - const stability = method.stability; - if (stability === "experimental") { - docs.push(` ///`); - docs.push( - ` ///
`, - ); - docs.push( - ` ///`, - ); - docs.push( - ` /// **Experimental.** This API is part of an experimental wire-protocol surface`, - ); - docs.push( - ` /// and may change or be removed in future SDK or CLI releases. Pin both the`, - ); - docs.push( - ` /// SDK and CLI versions if your code depends on it.`, - ); - docs.push( - ` ///`, - ); - docs.push( - ` ///
`, + const buildDocs = (includeParams: boolean): string[] => { + const docs = rustRpcMethodDocs( + method, + resultSchema, + rustRpcParamsDescription(method, resolvedParams), + includeParams, ); - } else if (stability && stability !== "stable") { - docs.push(` /// Stability: \`${stability}\`.`); - } + if (method.deprecated) docs.push(...rustDeprecatedAttributes(" ")); + const stability = method.stability; + if (stability === "experimental") { + docs.push(` ///`); + docs.push( + ` ///
`, + ); + docs.push( + ` ///`, + ); + docs.push( + ` /// **Experimental.** This API is part of an experimental wire-protocol surface`, + ); + docs.push( + ` /// and may change or be removed in future SDK or CLI releases. Pin both the`, + ); + docs.push( + ` /// SDK and CLI versions if your code depends on it.`, + ); + docs.push( + ` ///`, + ); + docs.push( + ` ///
`, + ); + } else if (stability && stability !== "stable") { + docs.push(` /// Stability: \`${stability}\`.`); + } + return docs; + }; const paramArg = hasParams ? `, params: ${paramsTypeName}` : ""; - out.push(...docs); if (hasParams && paramsInfo.optional) { + out.push(...buildDocs(false)); out.push( ` pub async fn ${fnName}(&self) -> Result<${returnType}, Error> {`, ); pushNamespaceMethodBody(out, constName, isSession, false, resultIsVoid); out.push(""); - out.push(...docs); + out.push(...buildDocs(true)); out.push( ` pub async fn ${fnName}_with_params(&self, params: ${paramsTypeName}) -> Result<${returnType}, Error> {`, ); @@ -1543,6 +1694,7 @@ function emitNamespaceMethod( return; } + out.push(...buildDocs(hasParams)); out.push( ` pub async fn ${fnName}(&self${paramArg}) -> Result<${returnType}, Error> {`, ); diff --git a/scripts/codegen/typescript.ts b/scripts/codegen/typescript.ts index cd0a0b07a..819d8adf9 100644 --- a/scripts/codegen/typescript.ts +++ b/scripts/codegen/typescript.ts @@ -46,6 +46,66 @@ function tsExperimentalJSDoc(indent = ""): string { return `${indent}${TS_EXPERIMENTAL_JSDOC}`; } +function sanitizeJsDocText(text: string): string { + return text.trim().replace(/\*\//g, "* /"); +} + +function pushTsJsDoc(lines: string[], indent: string, entries: string[]): void { + const cleaned = entries.map(sanitizeJsDocText).filter((entry) => entry.length > 0); + if (cleaned.length === 0) return; + + lines.push(`${indent}/**`); + for (const [index, entry] of cleaned.entries()) { + if (index > 0) { + lines.push(`${indent} *`); + } + for (const line of entry.split(/\r?\n/)) { + lines.push(`${indent} * ${line}`); + } + } + lines.push(`${indent} */`); +} + +function rpcResultDescription(method: RpcMethod): string | undefined { + const resultSchema = getMethodResultSchema(method); + if (isVoidSchema(resultSchema)) return undefined; + return method.result?.description ?? resultSchema?.description; +} + +function rpcParamsDescription(method: RpcMethod, effectiveParams: JSONSchema7 | undefined): string | undefined { + return method.params?.description ?? effectiveParams?.description; +} + +function pushTsRpcMethodJsDoc( + lines: string[], + indent: string, + method: RpcMethod, + options: { + summaryFallback?: string; + paramsName?: string; + paramsDescription?: string; + includeDeprecated?: boolean; + includeExperimental?: boolean; + } = {} +): void { + const entries: string[] = []; + entries.push(method.description ?? options.summaryFallback ?? `Calls \`${method.rpcMethod}\`.`); + if (options.paramsName && options.paramsDescription) { + entries.push(`@param ${options.paramsName} ${options.paramsDescription}`); + } + const resultDescription = rpcResultDescription(method); + if (resultDescription) { + entries.push(`@returns ${resultDescription}`); + } + if (options.includeDeprecated) { + entries.push("@deprecated"); + } + if (options.includeExperimental) { + entries.push("@experimental"); + } + pushTsJsDoc(lines, indent, entries); +} + function toPascalCase(s: string): string { return s.charAt(0).toUpperCase() + s.slice(1); } @@ -635,12 +695,12 @@ function emitGroup( } } - if ((value as RpcMethod).deprecated && !parentDeprecated) { - lines.push(`${indent}/** @deprecated */`); - } - if ((value as RpcMethod).stability === "experimental" && !parentExperimental) { - lines.push(tsExperimentalJSDoc(indent)); - } + pushTsRpcMethodJsDoc(lines, indent, value, { + paramsName: sigParams.length > 0 ? "params" : undefined, + paramsDescription: rpcParamsDescription(value, effectiveParams), + includeDeprecated: (value as RpcMethod).deprecated && !parentDeprecated, + includeExperimental: (value as RpcMethod).stability === "experimental" && !parentExperimental, + }); lines.push(`${indent}${key}: async (${sigParams.join(", ")}): Promise<${resultType}> =>`); lines.push(`${indent} connection.sendRequest("${rpcMethod}", ${bodyArg}),`); } else if (typeof value === "object" && value !== null) { @@ -711,6 +771,7 @@ function emitClientSessionApiRegistration(clientSchema: Record) for (const [groupName, methods] of groups) { const interfaceName = toPascalCase(groupName) + "Handler"; const groupDeprecated = isNodeFullyDeprecated(clientSchema[groupName] as Record); + const groupExperimental = isNodeFullyExperimental(clientSchema[groupName] as Record); if (groupDeprecated) { lines.push(`/** @deprecated Handler for \`${groupName}\` client session API methods. */`); } else { @@ -723,9 +784,13 @@ function emitClientSessionApiRegistration(clientSchema: Record) const pType = hasParams ? paramsTypeName(method) : ""; const rType = tsResultType(method); - if (method.deprecated && !groupDeprecated) { - lines.push(` /** @deprecated */`); - } + pushTsRpcMethodJsDoc(lines, " ", method, { + summaryFallback: `Handles \`${method.rpcMethod}\`.`, + paramsName: hasParams ? "params" : undefined, + paramsDescription: rpcParamsDescription(method, getMethodParamsSchema(method)), + includeDeprecated: method.deprecated && !groupDeprecated, + includeExperimental: method.stability === "experimental" && !groupExperimental, + }); if (hasParams) { lines.push(` ${name}(params: ${pType}): Promise<${rType}>;`); } else { diff --git a/scripts/codegen/utils.ts b/scripts/codegen/utils.ts index f38f005fb..6f06e8670 100644 --- a/scripts/codegen/utils.ts +++ b/scripts/codegen/utils.ts @@ -251,6 +251,7 @@ export async function writeGeneratedFile(relativePath: string, content: string): export interface RpcMethod { rpcMethod: string; + description?: string; params: JSONSchema7 | null; result: JSONSchema7 | null; stability?: string;