2026-08-28 11:51:48 +08:00
|
|
|
|
// 进程外 FileCity 插件。宿主启动本 exe,stdin 给 JSON,stdout 只回输出对象。
|
|
|
|
|
|
// 业务逻辑全部复用 MAF1.Core 里的 FileCityAgent,这里只做协议适配。
|
2026-08-26 18:06:02 +08:00
|
|
|
|
using MAF1.Agents.FileCity;
|
|
|
|
|
|
using MAF1.PluginContract;
|
|
|
|
|
|
using MAF1.Utils;
|
|
|
|
|
|
|
|
|
|
|
|
PluginRequest request = await PluginStdio.ReadRequestAsync();
|
|
|
|
|
|
PluginStdio.ApplyCredentialsToEnvironment(request.Credentials);
|
|
|
|
|
|
|
|
|
|
|
|
AgentFactory factory = new(AgentFactory.Load(PluginStdio.LoadHostConfiguration()));
|
|
|
|
|
|
var result = await FileCityAgent.RunAsync(FileCityAgent.Create(factory), request.Inputs);
|
|
|
|
|
|
await PluginStdio.WriteOutputsAsync(result.Outputs);
|
|
|
|
|
|
return 0;
|