@stofone/dsh-agent-roster 0.6.1 → 0.7.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,124 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/STofone/dsh-agent-roster/blob/main/schema/capabilities.v1.schema.json",
4
+ "title": "DSH agent roster capability requirements",
5
+ "description": "一份档案的能力要求(与 roster.{yaml,json} 同目录的 capabilities.{yaml,json}):只声明「建这支队伍需要什么」,不承载能力本体。校验的权威实现是插件里的 lib/capabilities.js;本文件供编辑器与外部工具做提示,两者由 test/capabilities.test.js 对齐。",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "kind",
10
+ "roster"
11
+ ],
12
+ "properties": {
13
+ "$schema": {
14
+ "type": "string",
15
+ "description": "编辑器用的 schema 地址,插件不读它。"
16
+ },
17
+ "kind": {
18
+ "const": "dsh-agent-roster-capabilities/v1"
19
+ },
20
+ "roster": {
21
+ "$ref": "#/$defs/id",
22
+ "description": "档案 id,必须与同目录的 roster 文件一致。"
23
+ },
24
+ "onMissing": {
25
+ "enum": [
26
+ "refuse",
27
+ "degraded"
28
+ ],
29
+ "description": "证据源明确显示缺项时的行为:refuse(默认)拒绝生成建队参数;degraded 照常生成,但在每次核对里记成 degraded。"
30
+ },
31
+ "asOf": {
32
+ "type": "string",
33
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
34
+ "description": "这份要求是照哪天的部署核对的。只收日期:时分秒会给人「一直新鲜」的错觉。"
35
+ },
36
+ "requires": {
37
+ "type": "object",
38
+ "additionalProperties": false,
39
+ "description": "只收有证据源的两类。模型路由可用性、插件版本、凭据指针、业务前置条件都没有证据源,写在这里只会变成又一份「看起来声明了」的假绿。",
40
+ "properties": {
41
+ "skills": {
42
+ "type": "array",
43
+ "maxItems": 32,
44
+ "items": {
45
+ "$ref": "#/$defs/skillRequirement"
46
+ }
47
+ },
48
+ "toolPolicies": {
49
+ "type": "array",
50
+ "maxItems": 32,
51
+ "items": {
52
+ "$ref": "#/$defs/policyRequirement"
53
+ }
54
+ }
55
+ }
56
+ },
57
+ "notes": {
58
+ "type": "string",
59
+ "maxLength": 500
60
+ }
61
+ },
62
+ "$defs": {
63
+ "id": {
64
+ "type": "string",
65
+ "pattern": "^[a-z0-9][a-z0-9-]{1,63}$"
66
+ },
67
+ "skillName": {
68
+ "type": "string",
69
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$"
70
+ },
71
+ "policyId": {
72
+ "type": "string",
73
+ "pattern": "^[a-z0-9][a-z0-9-]{1,63}$"
74
+ },
75
+ "skillRequirement": {
76
+ "oneOf": [
77
+ {
78
+ "$ref": "#/$defs/skillName"
79
+ },
80
+ {
81
+ "type": "object",
82
+ "additionalProperties": false,
83
+ "required": [
84
+ "name"
85
+ ],
86
+ "properties": {
87
+ "name": {
88
+ "$ref": "#/$defs/skillName"
89
+ },
90
+ "reason": {
91
+ "type": "string",
92
+ "minLength": 1,
93
+ "maxLength": 200
94
+ }
95
+ }
96
+ }
97
+ ]
98
+ },
99
+ "policyRequirement": {
100
+ "oneOf": [
101
+ {
102
+ "$ref": "#/$defs/policyId"
103
+ },
104
+ {
105
+ "type": "object",
106
+ "additionalProperties": false,
107
+ "required": [
108
+ "name"
109
+ ],
110
+ "properties": {
111
+ "name": {
112
+ "$ref": "#/$defs/policyId"
113
+ },
114
+ "reason": {
115
+ "type": "string",
116
+ "minLength": 1,
117
+ "maxLength": 200
118
+ }
119
+ }
120
+ }
121
+ ]
122
+ }
123
+ }
124
+ }