@bct-app/game-model 0.1.0 → 0.1.1

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.
Files changed (43) hide show
  1. package/README.md +14 -10
  2. package/dist/index.d.ts +1172 -30
  3. package/dist/json-schema/ability-execution-timing.schema.json +8 -0
  4. package/dist/json-schema/ability.schema.json +2268 -0
  5. package/dist/json-schema/alignment-enum.schema.json +8 -0
  6. package/dist/json-schema/base-source.schema.json +64 -0
  7. package/dist/{schemas → json-schema}/character-basic-kind.schema.json +1 -1
  8. package/dist/{schemas → json-schema}/character-kind.schema.json +1 -1
  9. package/dist/json-schema/character.schema.json +123 -0
  10. package/dist/json-schema/chat-message-content.schema.json +65 -0
  11. package/dist/json-schema/chat-message-group.schema.json +37 -0
  12. package/dist/json-schema/chat-message-operation.schema.json +30 -0
  13. package/dist/json-schema/chat-message.schema.json +133 -0
  14. package/dist/json-schema/conversation.schema.json +252 -0
  15. package/dist/{schemas → json-schema}/effect.schema.json +375 -133
  16. package/dist/{schemas → json-schema}/game.schema.json +3 -16
  17. package/dist/json-schema/index.json +36 -0
  18. package/dist/{schemas → json-schema}/input.schema.json +108 -89
  19. package/dist/{schemas → json-schema}/message.schema.json +259 -35
  20. package/dist/json-schema/nomination.schema.json +29 -0
  21. package/dist/json-schema/operation.schema.json +28 -0
  22. package/dist/json-schema/player-display-format.schema.json +13 -0
  23. package/dist/json-schema/player-reminder.schema.json +19 -0
  24. package/dist/json-schema/player.schema.json +104 -0
  25. package/dist/json-schema/populated-character.schema.json +2344 -0
  26. package/dist/json-schema/populated-script.schema.json +2397 -0
  27. package/dist/json-schema/reminder.schema.json +24 -0
  28. package/dist/json-schema/room-create.schema.json +23 -0
  29. package/dist/json-schema/room-defaults.schema.json +72 -0
  30. package/dist/json-schema/room.schema.json +24 -0
  31. package/dist/json-schema/runtime-game.schema.json +162 -0
  32. package/dist/json-schema/script.schema.json +57 -0
  33. package/dist/json-schema/seat-side-enum.schema.json +9 -0
  34. package/dist/json-schema/special-message-kind.schema.json +7 -0
  35. package/dist/json-schema/target.schema.json +305 -0
  36. package/dist/json-schema/timeline.schema.json +87 -0
  37. package/dist/{schemas → json-schema}/view.schema.json +68 -42
  38. package/dist/zod.d.mts +4038 -0
  39. package/dist/zod.d.ts +4038 -0
  40. package/dist/zod.js +1129 -0
  41. package/dist/zod.mjs +1058 -0
  42. package/package.json +30 -15
  43. package/dist/schemas/index.json +0 -9
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "mark": {
6
+ "type": "string",
7
+ "minLength": 1
8
+ },
9
+ "color": {
10
+ "type": "string"
11
+ },
12
+ "description": {
13
+ "type": "string"
14
+ },
15
+ "duration": {
16
+ "type": "number",
17
+ "minimum": 0
18
+ }
19
+ },
20
+ "required": [
21
+ "mark"
22
+ ],
23
+ "additionalProperties": false
24
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "roomId": {
6
+ "type": "string"
7
+ },
8
+ "hostId": {
9
+ "type": "string"
10
+ },
11
+ "createdAt": {
12
+ "default": "2026-04-11T23:19:10.204Z",
13
+ "type": "string",
14
+ "format": "date-time",
15
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
16
+ }
17
+ },
18
+ "required": [
19
+ "roomId",
20
+ "hostId"
21
+ ],
22
+ "additionalProperties": false
23
+ }
@@ -0,0 +1,72 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "defaultScriptId": {
6
+ "default": "",
7
+ "type": "string"
8
+ },
9
+ "defaultCharacterKinds": {
10
+ "default": [
11
+ {
12
+ "kind": "Townsfolk",
13
+ "count": 7
14
+ },
15
+ {
16
+ "kind": "Outsiders",
17
+ "count": 2
18
+ },
19
+ {
20
+ "kind": "Minions",
21
+ "count": 2
22
+ },
23
+ {
24
+ "kind": "Demons",
25
+ "count": 1
26
+ }
27
+ ],
28
+ "type": "array",
29
+ "items": {
30
+ "type": "object",
31
+ "properties": {
32
+ "kind": {
33
+ "$ref": "#/$defs/CharacterBasicKind"
34
+ },
35
+ "count": {
36
+ "default": 0,
37
+ "type": "number"
38
+ }
39
+ },
40
+ "required": [
41
+ "kind",
42
+ "count"
43
+ ],
44
+ "additionalProperties": false
45
+ }
46
+ },
47
+ "defaultNumberOfPlayer": {
48
+ "default": 12,
49
+ "type": "number"
50
+ }
51
+ },
52
+ "required": [
53
+ "defaultScriptId",
54
+ "defaultCharacterKinds",
55
+ "defaultNumberOfPlayer"
56
+ ],
57
+ "additionalProperties": false,
58
+ "$defs": {
59
+ "CharacterBasicKind": {
60
+ "type": "string",
61
+ "enum": [
62
+ "Townsfolk",
63
+ "Outsiders",
64
+ "Minions",
65
+ "Demons"
66
+ ],
67
+ "id": "CharacterBasicKind",
68
+ "title": "角色基本类别",
69
+ "description": "角色基本类别定义了游戏中角色的基本分类,通常用于技能选项中需要指定角色类别的情况"
70
+ }
71
+ }
72
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "roomId": {
6
+ "type": "string"
7
+ },
8
+ "hostId": {
9
+ "type": "string"
10
+ },
11
+ "createdAt": {
12
+ "default": "2026-04-11T23:19:10.204Z",
13
+ "type": "string",
14
+ "format": "date-time",
15
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
16
+ }
17
+ },
18
+ "required": [
19
+ "roomId",
20
+ "hostId",
21
+ "createdAt"
22
+ ],
23
+ "additionalProperties": false
24
+ }
@@ -0,0 +1,162 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "owner": {
6
+ "type": "string",
7
+ "minLength": 1
8
+ },
9
+ "scriptId": {
10
+ "type": "string",
11
+ "minLength": 1
12
+ },
13
+ "numberOfPlayer": {
14
+ "default": 8,
15
+ "type": "integer",
16
+ "exclusiveMinimum": 0,
17
+ "maximum": 9007199254740991
18
+ },
19
+ "characterKinds": {
20
+ "default": [],
21
+ "type": "array",
22
+ "items": {
23
+ "type": "object",
24
+ "properties": {
25
+ "kind": {
26
+ "type": "string"
27
+ },
28
+ "count": {
29
+ "default": 0,
30
+ "type": "integer",
31
+ "minimum": 0,
32
+ "maximum": 9007199254740991
33
+ }
34
+ },
35
+ "required": [
36
+ "kind",
37
+ "count"
38
+ ],
39
+ "additionalProperties": false
40
+ }
41
+ },
42
+ "characters": {
43
+ "default": [],
44
+ "type": "array",
45
+ "items": {
46
+ "type": "string"
47
+ }
48
+ },
49
+ "seats": {
50
+ "default": [],
51
+ "type": "array",
52
+ "items": {
53
+ "anyOf": [
54
+ {
55
+ "type": "object",
56
+ "properties": {
57
+ "userId": {
58
+ "type": "string"
59
+ },
60
+ "ready": {
61
+ "default": false,
62
+ "type": "boolean"
63
+ }
64
+ },
65
+ "required": [
66
+ "userId",
67
+ "ready"
68
+ ],
69
+ "additionalProperties": false
70
+ },
71
+ {
72
+ "type": "null"
73
+ }
74
+ ]
75
+ }
76
+ },
77
+ "result": {
78
+ "type": "string",
79
+ "enum": [
80
+ "goodWin",
81
+ "evilWin",
82
+ "unexpectEnd"
83
+ ]
84
+ },
85
+ "createdAt": {
86
+ "default": "2026-04-11T23:19:10.205Z",
87
+ "type": "string",
88
+ "format": "date-time",
89
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
90
+ },
91
+ "startedAt": {
92
+ "type": "string",
93
+ "format": "date-time",
94
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
95
+ },
96
+ "endedAt": {
97
+ "type": "string",
98
+ "format": "date-time",
99
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
100
+ },
101
+ "status": {
102
+ "default": "prepare",
103
+ "type": "string",
104
+ "enum": [
105
+ "prepare",
106
+ "start",
107
+ "end"
108
+ ]
109
+ },
110
+ "settings": {
111
+ "type": "object",
112
+ "properties": {
113
+ "operations": {
114
+ "default": [],
115
+ "type": "array",
116
+ "items": {
117
+ "type": "object",
118
+ "properties": {
119
+ "abilityId": {
120
+ "type": "string",
121
+ "minLength": 1
122
+ },
123
+ "effector": {
124
+ "type": "number"
125
+ },
126
+ "payloads": {
127
+ "default": [],
128
+ "type": "array",
129
+ "items": {}
130
+ },
131
+ "visible": {
132
+ "default": false,
133
+ "type": "boolean"
134
+ }
135
+ },
136
+ "required": [
137
+ "abilityId",
138
+ "effector",
139
+ "payloads"
140
+ ],
141
+ "additionalProperties": false
142
+ }
143
+ }
144
+ },
145
+ "required": [
146
+ "operations"
147
+ ],
148
+ "additionalProperties": false
149
+ }
150
+ },
151
+ "required": [
152
+ "owner",
153
+ "scriptId",
154
+ "numberOfPlayer",
155
+ "characterKinds",
156
+ "characters",
157
+ "seats",
158
+ "createdAt",
159
+ "status"
160
+ ],
161
+ "additionalProperties": false
162
+ }
@@ -0,0 +1,57 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "id": {
6
+ "type": "string"
7
+ },
8
+ "name": {
9
+ "type": "string"
10
+ },
11
+ "cover": {
12
+ "type": "string"
13
+ },
14
+ "characters": {
15
+ "default": [],
16
+ "type": "array",
17
+ "items": {
18
+ "type": "string"
19
+ }
20
+ },
21
+ "orderInFirstNight": {
22
+ "default": [],
23
+ "type": "array",
24
+ "items": {
25
+ "type": "string"
26
+ }
27
+ },
28
+ "orderInOtherNight": {
29
+ "default": [],
30
+ "type": "array",
31
+ "items": {
32
+ "type": "string"
33
+ }
34
+ },
35
+ "isEnabled": {
36
+ "default": false,
37
+ "type": "boolean"
38
+ },
39
+ "createdAt": {
40
+ "default": "2026-04-11T23:19:10.205Z",
41
+ "type": "string",
42
+ "format": "date-time",
43
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
44
+ }
45
+ },
46
+ "required": [
47
+ "id",
48
+ "name",
49
+ "cover",
50
+ "characters",
51
+ "orderInFirstNight",
52
+ "orderInOtherNight",
53
+ "isEnabled",
54
+ "createdAt"
55
+ ],
56
+ "additionalProperties": false
57
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "string",
4
+ "enum": [
5
+ "BOTH_SIDES",
6
+ "LEFT_SIDE",
7
+ "RIGHT_SIDE"
8
+ ]
9
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "string",
4
+ "enum": [
5
+ "SPY"
6
+ ]
7
+ }
@@ -0,0 +1,305 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "oneOf": [
4
+ {
5
+ "$ref": "#/$defs/__schema0"
6
+ },
7
+ {
8
+ "$ref": "#/$defs/__schema1"
9
+ },
10
+ {
11
+ "$ref": "#/$defs/__schema2"
12
+ },
13
+ {
14
+ "$ref": "#/$defs/__schema4"
15
+ }
16
+ ],
17
+ "id": "TargetModel",
18
+ "title": "目标模型",
19
+ "description": "表示技能效果的目标,包含来自技能载荷、技能施放者和动态规则三种来源",
20
+ "$defs": {
21
+ "__schema0": {
22
+ "type": "object",
23
+ "properties": {
24
+ "from": {
25
+ "type": "string",
26
+ "const": "PAYLOAD"
27
+ },
28
+ "value": {
29
+ "anyOf": [
30
+ {
31
+ "type": "number",
32
+ "minimum": 0
33
+ },
34
+ {
35
+ "type": "array",
36
+ "items": {
37
+ "type": "number",
38
+ "minimum": 0
39
+ }
40
+ }
41
+ ]
42
+ }
43
+ },
44
+ "required": [
45
+ "from",
46
+ "value"
47
+ ],
48
+ "additionalProperties": false
49
+ },
50
+ "__schema1": {
51
+ "type": "object",
52
+ "properties": {
53
+ "from": {
54
+ "type": "string",
55
+ "const": "EFFECTOR"
56
+ }
57
+ },
58
+ "required": [
59
+ "from"
60
+ ],
61
+ "additionalProperties": false
62
+ },
63
+ "__schema2": {
64
+ "type": "object",
65
+ "properties": {
66
+ "from": {
67
+ "type": "string",
68
+ "const": "DYNAMIC"
69
+ },
70
+ "anchor": {
71
+ "oneOf": [
72
+ {
73
+ "type": "object",
74
+ "properties": {
75
+ "from": {
76
+ "type": "string",
77
+ "const": "EFFECTOR"
78
+ }
79
+ },
80
+ "required": [
81
+ "from"
82
+ ],
83
+ "additionalProperties": false
84
+ },
85
+ {
86
+ "type": "object",
87
+ "properties": {
88
+ "from": {
89
+ "type": "string",
90
+ "const": "PAYLOAD"
91
+ },
92
+ "value": {
93
+ "anyOf": [
94
+ {
95
+ "type": "number",
96
+ "minimum": 0
97
+ },
98
+ {
99
+ "type": "array",
100
+ "items": {
101
+ "type": "number",
102
+ "minimum": 0
103
+ }
104
+ }
105
+ ]
106
+ }
107
+ },
108
+ "required": [
109
+ "from",
110
+ "value"
111
+ ],
112
+ "additionalProperties": false
113
+ },
114
+ {
115
+ "type": "object",
116
+ "properties": {
117
+ "from": {
118
+ "type": "string",
119
+ "const": "STATIC"
120
+ },
121
+ "value": {
122
+ "type": "number",
123
+ "minimum": 1
124
+ }
125
+ },
126
+ "required": [
127
+ "from",
128
+ "value"
129
+ ],
130
+ "additionalProperties": false
131
+ }
132
+ ]
133
+ },
134
+ "selector": {
135
+ "type": "object",
136
+ "properties": {
137
+ "scope": {
138
+ "default": "BOTH_SIDES",
139
+ "anyOf": [
140
+ {
141
+ "type": "string",
142
+ "enum": [
143
+ "BOTH_SIDES",
144
+ "LEFT_SIDE",
145
+ "RIGHT_SIDE"
146
+ ]
147
+ },
148
+ {
149
+ "$ref": "#/$defs/__schema3"
150
+ }
151
+ ]
152
+ }
153
+ },
154
+ "required": [
155
+ "scope"
156
+ ],
157
+ "additionalProperties": false
158
+ },
159
+ "where": {
160
+ "type": "object",
161
+ "properties": {
162
+ "mode": {
163
+ "default": "ALL",
164
+ "type": "string",
165
+ "enum": [
166
+ "ALL",
167
+ "ANY"
168
+ ]
169
+ },
170
+ "conditions": {
171
+ "default": [],
172
+ "type": "array",
173
+ "items": {
174
+ "type": "object",
175
+ "properties": {
176
+ "field": {
177
+ "type": "string",
178
+ "enum": [
179
+ "CHARACTER_KIND",
180
+ "IS_DEAD",
181
+ "SEAT"
182
+ ]
183
+ },
184
+ "operator": {
185
+ "default": "EQ",
186
+ "type": "string",
187
+ "enum": [
188
+ "EQ",
189
+ "IN"
190
+ ]
191
+ },
192
+ "value": {
193
+ "anyOf": [
194
+ {
195
+ "anyOf": [
196
+ {
197
+ "type": "string"
198
+ },
199
+ {
200
+ "type": "boolean"
201
+ },
202
+ {
203
+ "type": "number",
204
+ "minimum": 1
205
+ },
206
+ {
207
+ "type": "array",
208
+ "items": {
209
+ "type": "string"
210
+ }
211
+ },
212
+ {
213
+ "type": "array",
214
+ "items": {
215
+ "type": "number",
216
+ "minimum": 1
217
+ }
218
+ }
219
+ ]
220
+ },
221
+ {
222
+ "$ref": "#/$defs/__schema3"
223
+ }
224
+ ]
225
+ }
226
+ },
227
+ "required": [
228
+ "field",
229
+ "operator",
230
+ "value"
231
+ ],
232
+ "additionalProperties": false
233
+ }
234
+ }
235
+ },
236
+ "required": [
237
+ "mode",
238
+ "conditions"
239
+ ],
240
+ "additionalProperties": false
241
+ },
242
+ "limit": {
243
+ "anyOf": [
244
+ {
245
+ "type": "integer",
246
+ "exclusiveMinimum": 0,
247
+ "maximum": 9007199254740991
248
+ },
249
+ {
250
+ "$ref": "#/$defs/__schema3"
251
+ }
252
+ ]
253
+ }
254
+ },
255
+ "required": [
256
+ "from"
257
+ ],
258
+ "additionalProperties": false
259
+ },
260
+ "__schema3": {
261
+ "type": "object",
262
+ "properties": {
263
+ "from": {
264
+ "type": "string",
265
+ "const": "PAYLOAD"
266
+ },
267
+ "value": {
268
+ "anyOf": [
269
+ {
270
+ "type": "number",
271
+ "minimum": 0
272
+ },
273
+ {
274
+ "type": "array",
275
+ "items": {
276
+ "type": "number",
277
+ "minimum": 0
278
+ }
279
+ }
280
+ ]
281
+ }
282
+ },
283
+ "required": [
284
+ "from",
285
+ "value"
286
+ ],
287
+ "additionalProperties": false
288
+ },
289
+ "__schema4": {
290
+ "type": "object",
291
+ "properties": {
292
+ "from": {
293
+ "type": "string",
294
+ "const": "CUSTOM"
295
+ },
296
+ "value": {}
297
+ },
298
+ "required": [
299
+ "from",
300
+ "value"
301
+ ],
302
+ "additionalProperties": false
303
+ }
304
+ }
305
+ }