【问题单号 Defect】202608101429

【修改说明 Modification】AIDR Protobuf初始版本提交。
【修改人 Modifier】qiaonaiqiang 00505699
【评审人 Reviewer】micro 00184944
This commit is contained in:
2026-08-10 14:30:00 +08:00
parent b64d5f0a06
commit 559e59ae7b
5 changed files with 170 additions and 170 deletions
+86
View File
@@ -0,0 +1,86 @@
syntax = "proto3";
package AgentActionAudit;
import "AIDR/AgentIdentify.proto";
import "AIDR/MCPRemoteToolType2ID.proto";
import "google/protobuf/timestamp.proto";
// AI Agent 同步服务,AIDR-CLI ---> AAM同步AI Agent动作信息。
service AIAgentActionSyncService {
// 单个新增/删除
rpc AIAgentActionSyncOper(AIAgentActionEventReq) returns (AIAgentActionEventRsp);
// 批量操作
rpc AIAgentSyncOperBatch(AIAgentActionEventReqBatch)returns(AIAgentActionEventRsp);
}
message AIAgentActionEventBase {
//标准时间:UTC时间戳(秒+纳秒)
google.protobuf.Timestamp event_time = 1;
enum AIAgentActionType {
ACTION_TYPE_UNUSE = 0;
ACTION_TYPE_LLM_CALL = 1; // POC不需要支持
ACTION_TYPE_REMOTE_TOOL = 2; // POC当前仅支持这一种
ACTION_TYPE_LOCAL_TOOL = 3; // POC不需要支持
}
AIAgentActionType action_type = 2;
oneof data {
AIAgentActionRemoteTool remote_tool = 3; // POC当前仅支持这一种
AIAgentActionLocalTool local_tool = 4; // POC不需要支持
AIAgentActionLLMCall llm_call = 5; // POC不需要支持
}
}
// AI Agent识别粒度:MAC用户名+终端+AI Agent类别,AIDR-CLI尽力而为,提供终端+AI Agent类型
// 不支持版本信息,例如, Claude Code v1.1和Claude Code v1.2 agent name均为Claude Code
// 不支持多实例信息,例如,不同的安装位置,不同的进程等
message AIAgentActionEventReq {
uint64 msg_id = 1;
AIAgentIdentify.AIAgentKey key = 2;
AIAgentActionEventBase evt = 3;
}
// 操作返回结果
message AIAgentActionEventRsp {
int32 code = 1; // 0成功,非0错误码
string msg = 2; // 提示信息
uint64 msg_id = 3; // 消息ID关联字段
}
message AIAgentActionEventReqBatch {
uint64 msg_id = 1; // 消息;
AIAgentIdentify.AIAgentKey key = 2;
repeated AIAgentActionEventBase evt_list = 3;
}
message AIAgentActionRemoteTool {
string mcp_oper = 1; //MCP协议动作
McpRemoteToolIdentify.MCPServerName ser_name = 2;
McpRemoteToolIdentify.ToolsName tool_name = 3; // 工具访问名称
optional string tool_param = 4; // 工具访问的参数不需要
optional string mcp_result = 5; // MCP协议结果
}
message AIAgentActionLocalTool {
McpRemoteToolIdentify.ToolsName tool_name = 1; // 工具访问名称
optional string tool_param = 2; // 工具访问的参数不需要
}
message AIAgentActionLLMCall {
LLMServerName name = 1; // LLM调用资源
optional string prompt = 2; // 提示词
// 粒度需要继续扩充
}
message LLMServerName {
enum LLMServerNameType{
LLM_SERVER_NAME_TYPE_UNUSE = 0;
LLM_SERVER_NAME_TYPE_IPV4 = 1;
LLM_SERVER_NAME_TYPE_IPV6 = 2;
LLM_SERVER_NAME_TYPE_DNS_NAME = 3;
}
LLMServerNameType name_type = 1; // LLM Server 名字类型
string name_str = 2;
uint32 ser_port = 3; // LLM Server 服务端口
string model_name = 4; // LLM Server 使用的模型名称
// 粒度按需求继续可以继续扩充
}
+84
View File
@@ -0,0 +1,84 @@
syntax = "proto3";
package AIAgentIdentify;
// AI Agent识别粒度:NAC用户名+终端AI Agent类别,AIDR-CLI 尽力而为,提供终端+AI Agent类型
// 不支持版本信息,例如, Claude Code v1.1和Claude Code v1.2 agent name均为Claude Code
// 不支持多实例信息,例如,不同的安装位置,不同的进程等
message AIAgentKey {
string device_id = 1; // key字段,参考 HuaweiSdpGrpc.proto::IamSdpMessageHeader::device_id
//
//
//
//
//
string agent_name = 2; // Key字段,Agent的名字或类别,典型的例如 Claude Code
// 安全产品R26.1对应的变量名称时name,Agent Nac中命名为Agent Type
}
message AIAgent {
AIAgentKey Key = 1; // Key字段
string host_name = 2; // windows on pc参考: Windows主机名 DESKTOP-PRNHF35.china.huawei.com还是DESKTOP-PRNHF35?
//
//
//
string user_name_os = 3; // os用户名;
//
//
//
string IP = 4; // 属性字段 ip地址
string MAC = 5; // 属性字段 MAC地址
//
optional string user_name_iam = 6; // IAM使用的用户名
optional string iam_token = 7; // IAM使用的用户名
optional string user_name_nac = 8; // 终端协议认证使用的用户名
//
//
//
//
optional string nac_token = 9; // IAM使用的用户名
}
// 单个AI Agent同步操作(新增、删除、更新),请求消息结构
message AIAgentSyncReq {
// 操作类型枚举:新增/删除/更新
enum AIAgentSyncOpType {
OPERATE_UNKNOWN = 0;
OPERATE_ADD = 1; // 添加 AI Agent
OPERATE_DELETE = 2; // 删除 AI Agent
OPERATE_UPDATE = 3; // 更新 AI Agent相关信息
}
AIAgentSyncOpType op_type = 1;
AIAgent agent_info = 2;
optional string agent_id = 3; // Agent身份化的ID。
}
// 操作返回操作
message AIAgentSyncRsp {
int32 code = 1; // 0成功,非0错误码
string msg = 2; // 提示成功
AIAgentKey key = 3; // Key字段
int32 agent_type_id = 4; // Agent对应的TypeID
}
//批量AI Agent同步操作(新增/删除/更新),请求消息结构
message AIAgentSyncReqBatch{
repeated AIAgentSyncReq req = 1;
}
//批量操作返回
message AIAgentSyncRspBatch {
repeated AIAgentSyncRsp rsp = 1; // 每一条AI Agent对应的结果
}
//AI Agent同步服务,AIDR-CLI ---> AAM同步AI Agent信息。
service AIAgentSyncService {
// 单个新增/删除
rpc AIAgentSyncOper(AIAgentSyncReq)returns(AIAgentSyncRsp);
// 批量操作
rpc AIAgentSyncOperBatch(AIAgentSyncReqBatch)returns(AIAgentSyncRspBatch);
}
+78
View File
@@ -0,0 +1,78 @@
syntax = "proto3";
package McpRemoteToolIdentify;
// AI Agent 订阅服务, AAM --> AIDR-CLI 同步Tool Name to Tool ID。
service MCPToolInfoSubsService {
// 单个操作
rpc MCPToolsSubs (MCPToolSubReq) returns (MCPToolsSubRsp);
rpc MCPToolsUnSubs (MCPToolsUnSubReq) returns (MCPToolsUnSubRsp);
}
message MCPServerName{
enum McpServerNameType {
NAME_TYPE_UNUSE = 0;
NAME_TYPE_IPV4 = 1;
NAME_TYPE_IPV6 = 2;
NAME_TYPE_DNS_NAME = 3;
}
McpServerNameType name_type = 1; // MCP Remote Server 名字类型
string name_str = 2; // MCP Remote Server 名字, IPv4地址/IPv6地址/DNS域名
uint32 ser_port = 3; // MCP Remote Server 服务端口
}
//单个AI Agent订阅操作
message MCPToolSubReq {
MCPServerName key = 1;
}
message ToolsName2Id{
string tools_name = 1;// MCP 工具名
int32 tools_id = 2; // MCP 工具的ID
}
message ToolsName {
string tools_name = 1; // MCP 工具名
}
message ToolsSyn {
enum McpToolsSyncType {
TOOL_SYN_TYPE_UNUSE = 0;
TOOL_SYN_TYPE_ADD = 1;
TOOL_SYN_TYPE_UPDATE = 2;
TOOL_SYN_TYPE_DELETE =3;
}
McpToolsSyncType sync_type = 1; // 同步类型
oneof data {
ToolsName2Id name2id = 2; // ADD和UPDATE时使用
ToolsName tools_name = 3; // 删除时使用
}
}
message MCPToolsSubRsp {
MCPServerName key = 1; // Key字段
repeated ToolsSyn tools_list = 2; // Tools更新的列表
}
message MCPToolsUnSubReq {
MCPServerName key = 1;
}
message MCPToolsUnSubRsp {
int32 code = 1; // 0成功,非0错误码
string msg = 2; // 提示信息
MCPServerName key = 3; // Key字段
}
message MCPToolsSubReqBatch {
repeated MCPServerName key_list = 1;
}
message MCPToolsUnSubReqBatch {
repeated MCPServerName key_list = 1;
}
message MCPToolsUnSubRspBatch {
repeated MCPToolsUnSubRsp list_rsp = 1;
}