| 1 | using System.Text.Json; |
| 2 | using CascadeIDE.Features.Agent.Environment; |
| 3 | using CascadeIDE.Services; |
| 4 | |
| 5 | namespace CascadeIDE.Features.IdeMcp.Execution; |
| 6 | |
| 7 | internal sealed partial class IdeMcpCommandExecutor |
| 8 | { |
| 9 | private void RegisterAgentEnvironment(Action<string, Handler> add) |
| 10 | { |
| 11 | add(IdeCommands.IdeAgentVerify, async (args, ct) => |
| 12 | await _actions.IdeAgentVerifyAsync( |
| 13 | McpCommandJsonArgs.String(args, "policy"), |
| 14 | McpCommandJsonArgs.String(args, "sandbox_profile"), |
| 15 | McpCommandJsonArgs.String(args, "solution_path"), |
| 16 | ct)); |
| 17 | |
| 18 | add(IdeCommands.IdeAgentVerifyBatch, async (args, ct) => |
| 19 | await _actions.IdeAgentVerifyBatchAsync( |
| 20 | McpCommandJsonArgs.String(args, "policy"), |
| 21 | McpCommandJsonArgs.String(args, "sandbox_profile"), |
| 22 | McpCommandJsonArgs.String(args, "solution_path"), |
| 23 | McpCommandJsonArgs.Bool(args, "use_worktree", false), |
| 24 | ct)); |
| 25 | |
| 26 | add(IdeCommands.IdeAgentCancel, async (_, ct) => await _actions.IdeAgentCancelAsync(ct)); |
| 27 | |
| 28 | add(IdeCommands.IdeAgentStatus, async (_, ct) => await _actions.IdeAgentStatusAsync(ct)); |
| 29 | |
| 30 | add(IdeCommands.IdeAgentLast, async (_, ct) => await _actions.IdeAgentLastAsync(ct)); |
| 31 | |
| 32 | add(IdeCommands.IdeAgentSandboxPrepare, async (args, ct) => |
| 33 | await _actions.IdeAgentSandboxPrepareAsync( |
| 34 | McpCommandJsonArgs.String(args, "profile"), |
| 35 | McpCommandJsonArgs.String(args, "workspace_root"), |
| 36 | ct)); |
| 37 | } |
| 38 | } |
| 39 | |