// GENERATED CODE! DO NOT MODIFY BY HAND!

// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { ApplyPatchApprovalParams } from "./ApplyPatchApprovalParams.js";
import type { ExecCommandApprovalParams } from "./ExecCommandApprovalParams.js";
import type { RequestId } from "./RequestId.js";
import type { ChatgptAuthTokensRefreshParams } from "./v2/ChatgptAuthTokensRefreshParams.js";
import type { CommandExecutionRequestApprovalParams } from "./v2/CommandExecutionRequestApprovalParams.js";
import type { DynamicToolCallParams } from "./v2/DynamicToolCallParams.js";
import type { FileChangeRequestApprovalParams } from "./v2/FileChangeRequestApprovalParams.js";
import type { McpServerElicitationRequestParams } from "./v2/McpServerElicitationRequestParams.js";
import type { PermissionsRequestApprovalParams } from "./v2/PermissionsRequestApprovalParams.js";
import type { ToolRequestUserInputParams } from "./v2/ToolRequestUserInputParams.js";

/**
 * Request initiated from the server and sent to the client.
 */
export type ServerRequest =
  | {
      method: "item/commandExecution/requestApproval";
      id: RequestId;
      params: CommandExecutionRequestApprovalParams;
    }
  | {
      method: "item/fileChange/requestApproval";
      id: RequestId;
      params: FileChangeRequestApprovalParams;
    }
  | { method: "item/tool/requestUserInput"; id: RequestId; params: ToolRequestUserInputParams }
  | {
      method: "mcpServer/elicitation/request";
      id: RequestId;
      params: McpServerElicitationRequestParams;
    }
  | {
      method: "item/permissions/requestApproval";
      id: RequestId;
      params: PermissionsRequestApprovalParams;
    }
  | { method: "item/tool/call"; id: RequestId; params: DynamicToolCallParams }
  | {
      method: "account/chatgptAuthTokens/refresh";
      id: RequestId;
      params: ChatgptAuthTokensRefreshParams;
    }
  | { method: "applyPatchApproval"; id: RequestId; params: ApplyPatchApprovalParams }
  | { method: "execCommandApproval"; id: RequestId; params: ExecCommandApprovalParams };
