Forge
csharp3407750f
1namespace AgentForge.Models;
2
3public enum DriveMode
4{
5 HumanDriven,
6 AgentDriven,
7}
8
9public static class DriveModeExtensions
10{
11 public static string ToSlug(this DriveMode mode) =>
12 mode == DriveMode.AgentDriven ? "agent-driven" : "human-driven";
13
14 public static bool TryParseSlug(string? slug, out DriveMode mode)
15 {
16 if (string.Equals(slug, "agent-driven", StringComparison.OrdinalIgnoreCase))
17 {
18 mode = DriveMode.AgentDriven;
19 return true;
20 }
21
22 if (string.Equals(slug, "human-driven", StringComparison.OrdinalIgnoreCase))
23 {
24 mode = DriveMode.HumanDriven;
25 return true;
26 }
27
28 mode = DriveMode.HumanDriven;
29 return false;
30 }
31
32 public static DriveMode ParseSlugOrDefault(string? slug) =>
33 TryParseSlug(slug, out var mode) ? mode : DriveMode.HumanDriven;
34}
35
View only · write via MCP/CIDE