summaryrefslogtreecommitdiff
path: root/src/Agent.App/Configuration/AgentConfiguration.cs
diff options
context:
space:
mode:
authortanaka takashi <isazaka@gmail.com>2026-08-09 21:08:20 +0900
committertanaka takashi <isazaka@gmail.com>2026-08-09 21:08:20 +0900
commitb07b41cd435991cd254957af79055080c85b346e (patch)
tree27720d3ce14e4d0b84670a55ac26a2f877ce3a20 /src/Agent.App/Configuration/AgentConfiguration.cs
parent2fefd29e86c3b926d0cf4a362251d3f119688612 (diff)
feat: AI Agent Sandbox MCP Server v1を実装
Specifications、Design、ImplementationPlanの優先順位を整理し、単一Task実行モデル、typed option優先、設定可能なresource上限、local Ollamaを必須とするRelease Gateを文書化。 .NET 10/C# 14の5 production project、3 test project、E2E Clientを構築。typed YAML、en/ja locale、fixed/user prompt、stdioおよびloopback限定Streamable HTTP、agent_run/agent_status、Session、Ollama text/tool/Vision、TaskGraphとtoken accountingを実装。 Windows sandboxとしてfixed AppContainer、canonical/reparse検査、能力別ACL、path+SHA-256 executable approval、child-process restriction、Job Object、task journal、atomic file transaction、crash recoveryを実装。WFPのIPv4/IPv6 default denyとexact allow、dynamic session、temporary loopback exemption、管理者/BFE診断を追加。 Security/Recovery test、MCP/Ollama integration test、stdio/HTTP Operational E2E、Release Bundle生成・checksum・manifest・fresh extraction検査を追加。Requirement TraceabilityとPhase 0〜11の進捗、初回セットアップ可能なREADMEを整備。 Debug/Release/publish/objをrepository rootのbuild/へ集約し、旧project-local bin/objへの依存を除去。artifacts/とbuild/をGit管理外に設定し、clean checkoutでもsolution buildからE2E Clientまで生成可能にした。
Diffstat (limited to 'src/Agent.App/Configuration/AgentConfiguration.cs')
-rw-r--r--src/Agent.App/Configuration/AgentConfiguration.cs76
1 files changed, 76 insertions, 0 deletions
diff --git a/src/Agent.App/Configuration/AgentConfiguration.cs b/src/Agent.App/Configuration/AgentConfiguration.cs
new file mode 100644
index 0000000..800286b
--- /dev/null
+++ b/src/Agent.App/Configuration/AgentConfiguration.cs
@@ -0,0 +1,76 @@
+namespace Agent.App.Configuration;
+
+public sealed class AgentConfiguration
+{
+ public int SchemaVersion { get; set; }
+ public ApplicationOptions Application { get; set; } = new();
+ public McpOptions Mcp { get; set; } = new();
+ public RuntimeOptions Agent { get; set; } = new();
+ public OllamaConfiguration Ollama { get; set; } = new();
+ public PlannerOptions Planner { get; set; } = new();
+ public SandboxOptions Sandbox { get; set; } = new();
+ public FileEditOptions FileEdit { get; set; } = new();
+ public LimitOptions Limits { get; set; } = new();
+ public LocalizationOptions Localization { get; set; } = new();
+ public SkillOptions Skills { get; set; } = new();
+ public LoggingOptions Logging { get; set; } = new();
+}
+
+public sealed class ApplicationOptions { public string Language { get; set; } = "en"; }
+
+public sealed class McpOptions
+{
+ public string Transport { get; set; } = "stdio";
+ public HttpOptions Http { get; set; } = new();
+ public ImageOptions Images { get; set; } = new();
+}
+
+public sealed class HttpOptions { public string Host { get; set; } = "127.0.0.1"; public int Port { get; set; } = 8080; }
+public sealed class ImageOptions { public int MaxCount { get; set; } = 4; public long MaxBytesEach { get; set; } = 10 * 1024 * 1024; public long MaxTotalBytes { get; set; } = 20 * 1024 * 1024; }
+public sealed class RuntimeOptions { public string UserSystemPrompt { get; set; } = "prompts/user-system.md"; public int MaxIterations { get; set; } = 128; public int SameFailureLimit { get; set; } = 5; }
+
+public sealed class OllamaConfiguration
+{
+ public string Endpoint { get; set; } = "http://127.0.0.1:11434";
+ public string Model { get; set; } = string.Empty;
+ public bool Think { get; set; } = true;
+ public string KeepAlive { get; set; } = "5m";
+ public OllamaGenerationOptions Options { get; set; } = new();
+ public Dictionary<string, object?> ExtraOptions { get; set; } = new(StringComparer.Ordinal);
+}
+
+public sealed class OllamaGenerationOptions
+{
+ public int? NumCtx { get; set; }
+ public int? NumKeep { get; set; }
+ public int? NumPredict { get; set; }
+ public double? Temperature { get; set; }
+ public int? Seed { get; set; }
+ public int? TopK { get; set; }
+ public double? TopP { get; set; }
+ public double? MinP { get; set; }
+ public double? TypicalP { get; set; }
+ public double? TfsZ { get; set; }
+ public int? RepeatLastN { get; set; }
+ public double? RepeatPenalty { get; set; }
+ public double? PresencePenalty { get; set; }
+ public double? FrequencyPenalty { get; set; }
+ public int? Mirostat { get; set; }
+ public double? MirostatTau { get; set; }
+ public double? MirostatEta { get; set; }
+ public List<string> Stop { get; set; } = [];
+}
+
+public sealed class PlannerOptions { public int MaxTasks { get; set; } = 32; }
+public sealed class SandboxOptions { public FilesystemOptions Filesystem { get; set; } = new(); public ProcessOptions Process { get; set; } = new(); public NetworkOptions Network { get; set; } = new(); public ResourceOptions Resources { get; set; } = new(); }
+public sealed class FilesystemOptions { public List<string> Read { get; set; } = []; public List<string> Write { get; set; } = []; public List<string> Execute { get; set; } = []; public List<string> Delete { get; set; } = []; }
+public sealed class ProcessOptions { public bool AllowShell { get; set; } = true; public List<ExecutableApproval> Approvals { get; set; } = []; public int MaxProcesses { get; set; } = 16; }
+public sealed class ExecutableApproval { public string Path { get; set; } = string.Empty; public string Sha256 { get; set; } = string.Empty; }
+public sealed class NetworkOptions { public string Mode { get; set; } = "deny"; public List<NetworkAllowance> Allow { get; set; } = []; }
+public sealed class NetworkAllowance { public string Host { get; set; } = string.Empty; public List<int> Ports { get; set; } = []; }
+public sealed class ResourceOptions { public int MemoryMb { get; set; } = 4096; public int ProcessTimeoutSeconds { get; set; } = 1800; }
+public sealed class FileEditOptions { public int MemoryBackupLimitMb { get; set; } = 16; }
+public sealed class LimitOptions { public long WholeReadBytes { get; set; } = 1024 * 1024; public int SearchMaxResults { get; set; } = 1000; public int TailMaxLines { get; set; } = 10000; public double ContextSummaryRatio { get; set; } = 0.8; }
+public sealed class LocalizationOptions { public string Directory { get; set; } = "config/locales"; public string Fallback { get; set; } = "en"; }
+public sealed class SkillOptions { public string Directory { get; set; } = "skills"; }
+public sealed class LoggingOptions { public string Directory { get; set; } = "logs"; public long MaxFileBytes { get; set; } = 10 * 1024 * 1024; public int RetainedFiles { get; set; } = 5; }