docs: 为 CLI、网页编排器和插件协议补充学习向注释
在核心类型、图执行器、stdio 插件和前端入口写清职责与对照路径,不改运行行为。
This commit is contained in:
@@ -2,12 +2,14 @@ using MAF1.Decisions;
|
||||
|
||||
namespace MAF1.Web;
|
||||
|
||||
/// <summary>浏览器 POST /api/run 的图:节点 + 连线。和前端 state.nodes / state.edges 一一对应。</summary>
|
||||
public sealed class WorkflowGraph
|
||||
{
|
||||
public List<WorkflowNode> Nodes { get; set; } = [];
|
||||
public List<WorkflowEdge> Edges { get; set; } = [];
|
||||
}
|
||||
|
||||
/// <summary>画布节点。Config 里可写 filePath、credentialId、decisionTimeoutSeconds 等固定输入。</summary>
|
||||
public sealed class WorkflowNode
|
||||
{
|
||||
public string Id { get; set; } = "";
|
||||
@@ -18,6 +20,9 @@ public sealed class WorkflowNode
|
||||
public Dictionary<string, string> Config { get; set; } = new(StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 一条边:FromPort → ToPort 传数据。When 是运行条件(hasValidCities / !hasValidCities / 空=始终)。
|
||||
/// </summary>
|
||||
public sealed class WorkflowEdge
|
||||
{
|
||||
public string Id { get; set; } = "";
|
||||
@@ -28,6 +33,7 @@ public sealed class WorkflowEdge
|
||||
public string? When { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>一次运行的状态机:completed / needsDecision / failed。</summary>
|
||||
public static class WorkflowRunStatus
|
||||
{
|
||||
public const string Completed = "completed";
|
||||
@@ -35,6 +41,7 @@ public static class WorkflowRunStatus
|
||||
public const string Failed = "failed";
|
||||
}
|
||||
|
||||
/// <summary>返回给前端的运行快照。暂停时带 Decision,方便弹出确认框。</summary>
|
||||
public sealed class WorkflowRunResult
|
||||
{
|
||||
public bool Ok { get; set; }
|
||||
@@ -46,6 +53,7 @@ public sealed class WorkflowRunResult
|
||||
public List<NodeRunLog> Steps { get; set; } = [];
|
||||
}
|
||||
|
||||
/// <summary>单个节点的执行日志,显示在页面底部「运行结果」。</summary>
|
||||
public sealed class NodeRunLog
|
||||
{
|
||||
public string NodeId { get; set; } = "";
|
||||
|
||||
Reference in New Issue
Block a user