| 1 | namespace CascadeIDE.Features.Agent.Environment; |
| 2 | |
| 3 | /// <summary>Batch native AEE tools (ADR 0148 W6).</summary> |
| 4 | public static class AgentEnvironmentNativeTools |
| 5 | { |
| 6 | public static IReadOnlyList<string> ToolIds { get; } = |
| 7 | [ |
| 8 | "ide_agent_verify", |
| 9 | "ide_agent_verify_batch", |
| 10 | "ide_agent_cancel", |
| 11 | "ide_agent_status", |
| 12 | "ide_agent_last", |
| 13 | "ide_agent_sandbox_prepare", |
| 14 | ]; |
| 15 | |
| 16 | public static AgentVerifyBatchRequest ParseBatchVerify(IReadOnlyDictionary<string, string?> args) |
| 17 | { |
| 18 | var policy = AgentVerifyPolicy.Standard; |
| 19 | if (args.TryGetValue("policy", out var p) && AgentVerifyPolicyParser.TryParse(p, out var parsed)) |
| 20 | policy = parsed; |
| 21 | |
| 22 | AgentSandboxProfile sandbox = AgentSandboxProfile.AgentEphemeral; |
| 23 | if (args.TryGetValue("sandbox_profile", out var s) && AgentSandboxProfileParser.TryParse(s, out var sp)) |
| 24 | sandbox = sp; |
| 25 | |
| 26 | var useWorktree = string.Equals(args.GetValueOrDefault("use_worktree"), "true", StringComparison.OrdinalIgnoreCase) |
| 27 | || string.Equals(args.GetValueOrDefault("use_worktree"), "1", StringComparison.OrdinalIgnoreCase); |
| 28 | |
| 29 | return new AgentVerifyBatchRequest(policy, sandbox, args.GetValueOrDefault("solution_path"), useWorktree); |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | public sealed record AgentVerifyBatchRequest( |
| 34 | AgentVerifyPolicy Policy, |
| 35 | AgentSandboxProfile SandboxProfile, |
| 36 | string? SolutionPath, |
| 37 | bool UseWorktree = false); |
| 38 | |