Files
MAF1/Plugins/file-city/Program.cs
T
admin777 b631acd42e feat: 将插件 stdin 协议定为 v1,并按声明注入凭据
进程外插件改为只读环境变量和自身配置,避免读宿主 appsettings;宿主按 plugin.json 声明注入 LLM / OpenWeather 等凭据。
2026-09-11 10:46:52 +08:00

14 lines
606 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 进程外 FileCity 插件。宿主启动本 exestdin 给 JSONstdout 只回输出对象。
// 业务逻辑全部复用 MAF1.Core 里的 FileCityAgent,这里只做协议适配。
using MAF1.Agents.FileCity;
using MAF1.PluginContract;
using MAF1.Utils;
PluginRequest request = await PluginStdio.ReadRequestAsync();
PluginStdio.ApplyCredentialsToEnvironment(request.Credentials);
AgentFactory factory = new(AgentFactory.LoadFromEnvironment());
var result = await FileCityAgent.RunAsync(FileCityAgent.Create(factory), request.Inputs);
await PluginStdio.WriteOutputsAsync(result.Outputs);
return 0;