docs: 为 CLI、网页编排器和插件协议补充学习向注释
在核心类型、图执行器、stdio 插件和前端入口写清职责与对照路径,不改运行行为。
This commit is contained in:
@@ -4,6 +4,7 @@ using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace MAF1.Plugins;
|
||||
|
||||
/// <summary>内存中的完整凭据。只给插件进程用,不要序列化给浏览器。</summary>
|
||||
public sealed class CredentialRecord
|
||||
{
|
||||
public string Id { get; init; } = "";
|
||||
@@ -15,6 +16,7 @@ public sealed class CredentialRecord
|
||||
public Dictionary<string, string> Extra { get; init; } = new(StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
/// <summary>GET /api/credentials 的形状:有没有 Key 用布尔值表示,不返回 Key 本身。</summary>
|
||||
public sealed class CredentialPublicView
|
||||
{
|
||||
public string Id { get; init; } = "";
|
||||
@@ -25,6 +27,9 @@ public sealed class CredentialPublicView
|
||||
public bool HasApiKey { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从 Llm 段和 Credentials 段组装凭据。节点 config.credentialId 默认 llm-default。
|
||||
/// </summary>
|
||||
public sealed class CredentialStore
|
||||
{
|
||||
private readonly IConfiguration _config;
|
||||
@@ -64,6 +69,7 @@ public sealed class CredentialStore
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>给前端的列表。Endpoint 目前未打码(学习项目);ApiKey 绝不会出现在这里。</summary>
|
||||
public IReadOnlyList<CredentialPublicView> ListPublic()
|
||||
=> _named.Values
|
||||
.OrderBy(item => item.Id, StringComparer.OrdinalIgnoreCase)
|
||||
|
||||
Reference in New Issue
Block a user