-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathservice.proto
More file actions
188 lines (150 loc) · 6.67 KB
/
Copy pathservice.proto
File metadata and controls
188 lines (150 loc) · 6.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
syntax = "proto3";
package v1;
import "google/protobuf/wrappers.proto";
import "model.proto";
option go_package = "github.com/polarismesh/specification/source/go/api/v1/service_manage";
option java_package = "com.tencent.polaris.specification.api.v1.service.manage";
option java_outer_classname = "ServiceProto";
message Service {
google.protobuf.StringValue name = 1;
google.protobuf.StringValue namespace = 2;
map<string, string> metadata = 3;
google.protobuf.StringValue ports = 4;
google.protobuf.StringValue business = 5;
google.protobuf.StringValue department = 6;
google.protobuf.StringValue cmdb_mod1 = 7 [json_name = "cmdb_mod1"];
google.protobuf.StringValue cmdb_mod2 = 8 [json_name = "cmdb_mod2"];
google.protobuf.StringValue cmdb_mod3 = 9 [json_name = "cmdb_mod3"];
google.protobuf.StringValue comment = 10;
google.protobuf.StringValue owners = 11;
google.protobuf.StringValue token = 12;
google.protobuf.StringValue ctime = 13;
google.protobuf.StringValue mtime = 14;
google.protobuf.StringValue revision = 15;
google.protobuf.StringValue platform_id = 16 [json_name = "platform_id"];
google.protobuf.UInt32Value total_instance_count = 17 [json_name = "total_instance_count"];
google.protobuf.UInt32Value healthy_instance_count = 18 [json_name = "healthy_instance_count"];
repeated google.protobuf.StringValue user_ids = 19 [json_name = "user_ids"];
repeated google.protobuf.StringValue group_ids = 20 [json_name = "group_ids"];
repeated google.protobuf.StringValue remove_user_ids = 22 [json_name = "remove_user_ids"];
repeated google.protobuf.StringValue remove_group_ids = 23 [json_name = "remove_group_ids"];
google.protobuf.StringValue id = 21;
google.protobuf.BoolValue editable = 24;
repeated google.protobuf.StringValue export_to = 25 [ json_name = "export_to" ];
bool sync_to_global_registry = 26 [ json_name = "sync_to_global_registry" ];
google.protobuf.UInt32Value isolate_instance_count = 27 [json_name = "isolate_instance_count"];
ServiceStatus service_status = 28 [json_name = "service_status"];
google.protobuf.BoolValue deleteable = 100;
// 服务类型,例如:微服务、MCP Server、AI Agent等
ServiceType service_type = 101 [json_name = "service_type"];
// 服务扩展元数据,可同时承载多种类型,例如:AI Agent 技能等
repeated ExtendedMetadata extended_metadata = 102 [json_name = "extended_metadata"];
}
// 服务类型枚举
enum ServiceType {
// 微服务(默认值)
SERVICE_TYPE_MICROSERVICE = 0;
// MCP Server,通过 MCP (SSE / Streamable HTTP)提供 AI 工具能力
SERVICE_TYPE_MCP_SERVER = 1;
// AI Agent,具有自主决策能力的智能体服务
SERVICE_TYPE_AI_AGENT = 2;
}
// 扩展元数据
message ExtendedMetadata {
enum ExtendedMetadataType {
EXTENDED_METADATA_UNKNOWN = 0;
EXTENDED_METADATA_SKILL = 1;
}
// 扩展元数据类型,决定下方哪些字段生效。
ExtendedMetadataType type = 1;
// AI Agent 技能,仅当 type = EXTENDED_METADATA_SKILL 时生效。
AgentSkill agent_skill = 2 [json_name = "agent_skill"];
}
// AI Agent 技能定义。
// 字段与 A2A 官方 AgentSkill 保持一致(proto3 JSON 可互相兼容)。
// 参考:https://github.com/a2aproject/A2A/blob/main/specification/a2a.proto
message AgentSkill {
string id = 1;
string name = 2;
string description = 3;
repeated string tags = 4;
repeated string examples = 5;
repeated string input_modes = 6 [json_name = "input_modes"];
repeated string output_modes = 7 [json_name = "output_modes"];
// 字段号 8 预留给 security_requirements(A2A 官方定义为 repeated SecurityRequirement)
reserved 8;
reserved "security_requirements";
}
enum ServiceStatus {
NORMAL = 0; //服务状态正常
ABNORMAL = 1; //服务状态异常
OFFLINE = 2; //服务离线
}
enum AliasType {
DEFAULT = 0;
CL5SID = 1;
}
message ServiceAlias {
google.protobuf.StringValue service = 1;
google.protobuf.StringValue namespace = 2;
google.protobuf.StringValue alias = 3;
google.protobuf.StringValue alias_namespace = 4 [json_name = "alias_namespace"];
AliasType type = 5;
google.protobuf.StringValue owners = 6;
google.protobuf.StringValue comment = 7;
google.protobuf.StringValue service_token = 8 [json_name = "service_token"];
google.protobuf.StringValue ctime = 9;
google.protobuf.StringValue mtime = 10;
google.protobuf.StringValue id = 11;
google.protobuf.BoolValue editable = 12;
google.protobuf.BoolValue deleteable = 13;
repeated google.protobuf.StringValue export_to = 25 [ json_name = "export_to" ];
map<string, string> metadata = 26;
}
message Instance {
google.protobuf.StringValue id = 1;
google.protobuf.StringValue service = 2;
google.protobuf.StringValue namespace = 3;
google.protobuf.StringValue vpc_id = 21 [json_name = "vpc_id"];
google.protobuf.StringValue host = 4;
google.protobuf.UInt32Value port = 5;
// 通信协议类型
// MCP Server 使用以下协议类型:
// - "mcp-sse":基于 Server-Sent Events 的 MCP 传输协议
// - "mcp-streamable-http":基于 Streamable HTTP 的 MCP 传输协议
google.protobuf.StringValue protocol = 6;
// 服务版本
// MCP Server 使用 mcp-server-version,不是 mcp-protocol-version
google.protobuf.StringValue version = 7;
google.protobuf.UInt32Value priority = 8;
google.protobuf.UInt32Value weight = 9;
google.protobuf.BoolValue enable_health_check = 20;
HealthCheck health_check = 10;
google.protobuf.BoolValue healthy = 11;
google.protobuf.BoolValue isolate = 12;
Location location = 13;
// 实例元数据
// AI Agent 使用以下标准键:
// - "ai-agent-name":AI Agent 的名称,等于 service。必填
// MCP Server 使用以下标准键:
// - "mcp-server-name":MCP Server 的名称,等于 service。必填
// - "mcp-protocol-version":MCP 协议版本,例如:"2025-03-26"。可选
// - "mcp-endpoint-path":MCP Server 的服务端点路径,例如:"/mcp"、"/sse"。可选
map<string, string> metadata = 14;
google.protobuf.StringValue logic_set = 15 [json_name = "logic_set"];
google.protobuf.StringValue ctime = 16;
google.protobuf.StringValue mtime = 17;
google.protobuf.StringValue revision = 18;
google.protobuf.StringValue service_token = 19 [json_name = "service_token"];
}
message HealthCheck {
enum HealthCheckType {
UNKNOWN = 0;
HEARTBEAT = 1;
}
HealthCheckType type = 1;
HeartbeatHealthCheck heartbeat = 2;
}
message HeartbeatHealthCheck {
google.protobuf.UInt32Value ttl = 1;
}