summaryrefslogtreecommitdiff
path: root/src/Agent.App/Cli
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/Cli
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/Cli')
-rw-r--r--src/Agent.App/Cli/CommandLine.cs39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/Agent.App/Cli/CommandLine.cs b/src/Agent.App/Cli/CommandLine.cs
new file mode 100644
index 0000000..df65080
--- /dev/null
+++ b/src/Agent.App/Cli/CommandLine.cs
@@ -0,0 +1,39 @@
+namespace Agent.App.Cli;
+
+public enum AppCommand { Serve, Check }
+
+public sealed record CommandLine(AppCommand Command, string? ConfigPath, string? Language, string? Transport)
+{
+ public static CommandLine Parse(string[] args)
+ {
+ if (args.Length == 0) throw new CommandLineException("Expected 'serve' or 'check'.");
+ AppCommand command = args[0] switch
+ {
+ "serve" => AppCommand.Serve,
+ "check" => AppCommand.Check,
+ _ => throw new CommandLineException("Expected 'serve' or 'check'.")
+ };
+
+ string? config = null;
+ string? language = null;
+ string? transport = null;
+ for (int i = 1; i < args.Length; i++)
+ {
+ string option = args[i];
+ if (i + 1 >= args.Length) throw new CommandLineException($"Missing value for '{option}'.");
+ string value = args[++i];
+ switch (option)
+ {
+ case "--config" when config is null: config = value; break;
+ case "--lang" when language is null: language = value; break;
+ case "--transport" when command == AppCommand.Serve && transport is null && value is "stdio" or "http": transport = value; break;
+ case "--transport" when command == AppCommand.Check: throw new CommandLineException("--transport is only valid for serve.");
+ case "--transport": throw new CommandLineException("Transport must be stdio or http.");
+ default: throw new CommandLineException($"Unknown or duplicate option '{option}'.");
+ }
+ }
+ return new CommandLine(command, config, language, transport);
+ }
+}
+
+public sealed class CommandLineException(string message) : Exception(message);