@stofone/dsh-agent-roster 0.0.0-stage → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,193 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/STofone/dsh-agent-roster/blob/main/schema/roster.v1.schema.json",
4
+ "title": "DSH agent roster document",
5
+ "description": "一份成员档案:描述一个多 Agent 团队里每个成员是谁、用什么模型、受哪些工具约束,以及队长应该是什么样。校验的权威实现是插件里的 lib/validate.js;本文件供编辑器与外部工具做提示,两者由 test/schema.test.js 对齐。",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["kind", "roster", "version", "members"],
9
+ "properties": {
10
+ "$schema": {
11
+ "type": "string",
12
+ "description": "编辑器用的 schema 地址,插件不读它。"
13
+ },
14
+ "kind": {
15
+ "const": "dsh-agent-roster/v1"
16
+ },
17
+ "roster": {
18
+ "$ref": "#/$defs/id",
19
+ "description": "档案 id,同时是所在目录名。"
20
+ },
21
+ "version": {
22
+ "type": "string",
23
+ "pattern": "^(?:0|[1-9][0-9]*)\\.(?:0|[1-9][0-9]*)\\.(?:0|[1-9][0-9]*)(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$"
24
+ },
25
+ "title": {
26
+ "type": "string",
27
+ "maxLength": 120
28
+ },
29
+ "description": {
30
+ "type": "string",
31
+ "maxLength": 500
32
+ },
33
+ "license": {
34
+ "type": "string",
35
+ "maxLength": 120
36
+ },
37
+ "maintainers": {
38
+ "type": "array",
39
+ "maxItems": 16,
40
+ "items": { "type": "string", "minLength": 1, "maxLength": 120 }
41
+ },
42
+ "tags": {
43
+ "type": "array",
44
+ "maxItems": 16,
45
+ "items": { "$ref": "#/$defs/tag" }
46
+ },
47
+ "defaults": {
48
+ "type": "object",
49
+ "additionalProperties": false,
50
+ "description": "成员没写这些字段时继承;只放真正参与桥接的字段。",
51
+ "properties": {
52
+ "provider": { "$ref": "#/$defs/provider" },
53
+ "model": { "$ref": "#/$defs/model" },
54
+ "reasoningEffort": { "$ref": "#/$defs/effort" },
55
+ "toolPolicy": { "$ref": "#/$defs/id" },
56
+ "toolScope": { "$ref": "#/$defs/toolScope" },
57
+ "fallback": { "$ref": "#/$defs/route" }
58
+ }
59
+ },
60
+ "members": {
61
+ "type": "array",
62
+ "minItems": 1,
63
+ "maxItems": 32,
64
+ "items": { "$ref": "#/$defs/member" }
65
+ },
66
+ "captain": {
67
+ "type": "object",
68
+ "additionalProperties": false,
69
+ "description": "队长就是创建团队的那个会话,不是成员。这里只记录它应该是什么样,并给出落地提示。",
70
+ "required": ["name"],
71
+ "properties": {
72
+ "name": { "$ref": "#/$defs/id" },
73
+ "description": { "type": "string", "maxLength": 500 },
74
+ "systemPrompt": { "type": "string", "maxLength": 8000 },
75
+ "personaPrefix": { "type": "string", "maxLength": 4000 },
76
+ "provider": { "$ref": "#/$defs/provider" },
77
+ "model": { "$ref": "#/$defs/model" },
78
+ "reasoningEffort": { "$ref": "#/$defs/effort" }
79
+ },
80
+ "dependentRequired": {
81
+ "provider": ["model"],
82
+ "model": ["provider"]
83
+ }
84
+ }
85
+ },
86
+ "$defs": {
87
+ "id": {
88
+ "type": "string",
89
+ "pattern": "^[a-z0-9][a-z0-9-]{1,63}$"
90
+ },
91
+ "tag": {
92
+ "type": "string",
93
+ "pattern": "^[a-z0-9][a-z0-9-]{0,31}$"
94
+ },
95
+ "skill": {
96
+ "type": "string",
97
+ "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$",
98
+ "description": "与 DSH 技能目录同名。声明层:运行时不会据此加载技能。"
99
+ },
100
+ "provider": {
101
+ "type": "string",
102
+ "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
103
+ },
104
+ "model": {
105
+ "type": "string",
106
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,119}$"
107
+ },
108
+ "effort": {
109
+ "type": "string",
110
+ "enum": ["low", "medium", "high", "default"]
111
+ },
112
+ "toolName": {
113
+ "type": "string",
114
+ "pattern": "^[A-Za-z0-9_][A-Za-z0-9_.:-]{0,127}$"
115
+ },
116
+ "toolPattern": {
117
+ "type": "string",
118
+ "pattern": "^[A-Za-z0-9_][A-Za-z0-9_.:-]{0,126}\\*?$"
119
+ },
120
+ "toolScope": {
121
+ "type": "object",
122
+ "additionalProperties": false,
123
+ "description": "声明层:agent-teams 没有对应的建员参数。",
124
+ "properties": {
125
+ "allow": { "type": "array", "maxItems": 64, "items": { "$ref": "#/$defs/toolPattern" } },
126
+ "deny": { "type": "array", "maxItems": 64, "items": { "$ref": "#/$defs/toolPattern" } }
127
+ }
128
+ },
129
+ "route": {
130
+ "type": "object",
131
+ "additionalProperties": false,
132
+ "required": ["provider", "model"],
133
+ "description": "需落部署配置的备用路由:运行时没有工具参数。",
134
+ "properties": {
135
+ "provider": { "$ref": "#/$defs/provider" },
136
+ "model": { "$ref": "#/$defs/model" }
137
+ }
138
+ },
139
+ "member": {
140
+ "type": "object",
141
+ "additionalProperties": false,
142
+ "required": ["name", "role", "systemPrompt"],
143
+ "properties": {
144
+ "name": {
145
+ "$ref": "#/$defs/id",
146
+ "description": "成员名;改名时把旧名写进 aliases,核对时仍认作同一成员。"
147
+ },
148
+ "role": { "type": "string", "minLength": 1, "maxLength": 120 },
149
+ "systemPrompt": { "type": "string", "minLength": 1, "maxLength": 8000 },
150
+ "title": { "type": "string", "maxLength": 120 },
151
+ "description": {
152
+ "type": "string",
153
+ "maxLength": 500,
154
+ "description": "一句话说明这个成员负责什么;供派活与团队列表使用,运行时不强制。"
155
+ },
156
+ "provider": { "$ref": "#/$defs/provider" },
157
+ "model": { "$ref": "#/$defs/model" },
158
+ "reasoningEffort": { "$ref": "#/$defs/effort" },
159
+ "toolPolicy": {
160
+ "$ref": "#/$defs/id",
161
+ "description": "必须是部署已声明的工具策略 id;插件只能校验形态。"
162
+ },
163
+ "aliases": {
164
+ "type": "array",
165
+ "maxItems": 8,
166
+ "items": { "$ref": "#/$defs/id" },
167
+ "description": "曾用名:核对时旧名仍映射到这名成员。"
168
+ },
169
+ "skills": {
170
+ "type": "array",
171
+ "maxItems": 16,
172
+ "items": { "$ref": "#/$defs/skill" },
173
+ "description": "声明层:期望这个成员用到的技能;插件只核对是否已安装。"
174
+ },
175
+ "examples": {
176
+ "type": "array",
177
+ "maxItems": 5,
178
+ "items": { "type": "string", "minLength": 1, "maxLength": 200 },
179
+ "description": "典型请求示例,供派活时参考;永远不会被当作指令执行。"
180
+ },
181
+ "fallback": { "$ref": "#/$defs/route" },
182
+ "toolScope": { "$ref": "#/$defs/toolScope" },
183
+ "maxTokens": { "type": "integer", "minimum": 1, "maximum": 1000000 },
184
+ "notes": { "type": "string", "maxLength": 500 },
185
+ "tags": {
186
+ "type": "array",
187
+ "maxItems": 16,
188
+ "items": { "$ref": "#/$defs/tag" }
189
+ }
190
+ }
191
+ }
192
+ }
193
+ }