@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,8 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "string",
4
+ "enum": [
5
+ "GOOD",
6
+ "EVIL"
7
+ ]
8
+ }
@@ -0,0 +1,64 @@
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
+ "id": "BaseSource",
12
+ "title": "基础来源模型",
13
+ "description": "基础来源模型,包含来自技能载荷和常量两种来源,常量来源包含一个任意值",
14
+ "$defs": {
15
+ "__schema0": {
16
+ "type": "object",
17
+ "properties": {
18
+ "from": {
19
+ "type": "string",
20
+ "const": "PAYLOAD"
21
+ },
22
+ "value": {
23
+ "anyOf": [
24
+ {
25
+ "default": 0,
26
+ "type": "number",
27
+ "minimum": 0
28
+ },
29
+ {
30
+ "default": [
31
+ 0
32
+ ],
33
+ "type": "array",
34
+ "items": {
35
+ "type": "number",
36
+ "minimum": 0
37
+ }
38
+ }
39
+ ]
40
+ }
41
+ },
42
+ "required": [
43
+ "from",
44
+ "value"
45
+ ],
46
+ "additionalProperties": false
47
+ },
48
+ "__schema1": {
49
+ "type": "object",
50
+ "properties": {
51
+ "from": {
52
+ "type": "string",
53
+ "const": "CONSTANT"
54
+ },
55
+ "value": {}
56
+ },
57
+ "required": [
58
+ "from",
59
+ "value"
60
+ ],
61
+ "additionalProperties": false
62
+ }
63
+ }
64
+ }
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "type": "string",
4
4
  "enum": [
5
5
  "Townsfolk",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "type": "string",
4
4
  "enum": [
5
5
  "Townsfolk",
@@ -0,0 +1,123 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "id": {
6
+ "$ref": "#/$defs/__schema0"
7
+ },
8
+ "name": {
9
+ "$ref": "#/$defs/__schema1"
10
+ },
11
+ "key": {
12
+ "$ref": "#/$defs/__schema2"
13
+ },
14
+ "icon": {
15
+ "$ref": "#/$defs/__schema3"
16
+ },
17
+ "kind": {
18
+ "$ref": "#/$defs/__schema4"
19
+ },
20
+ "skill": {
21
+ "$ref": "#/$defs/__schema5"
22
+ },
23
+ "saying": {
24
+ "$ref": "#/$defs/__schema6"
25
+ },
26
+ "tags": {
27
+ "$ref": "#/$defs/__schema7"
28
+ },
29
+ "abilities": {
30
+ "$ref": "#/$defs/__schema8"
31
+ },
32
+ "createdAt": {
33
+ "$ref": "#/$defs/__schema9"
34
+ }
35
+ },
36
+ "required": [
37
+ "id",
38
+ "name",
39
+ "key",
40
+ "kind",
41
+ "abilities",
42
+ "createdAt"
43
+ ],
44
+ "additionalProperties": false,
45
+ "id": "Character",
46
+ "title": "角色",
47
+ "description": "游戏中的角色,包含其基本信息和能力列表",
48
+ "$defs": {
49
+ "__schema0": {
50
+ "type": "string"
51
+ },
52
+ "__schema1": {
53
+ "type": "string"
54
+ },
55
+ "__schema2": {
56
+ "type": "string"
57
+ },
58
+ "__schema3": {
59
+ "type": "string"
60
+ },
61
+ "__schema4": {
62
+ "default": "Townsfolk",
63
+ "$ref": "#/$defs/CharacterBasicKind"
64
+ },
65
+ "CharacterBasicKind": {
66
+ "type": "string",
67
+ "enum": [
68
+ "Townsfolk",
69
+ "Outsiders",
70
+ "Minions",
71
+ "Demons"
72
+ ],
73
+ "id": "CharacterBasicKind",
74
+ "title": "角色基本类别",
75
+ "description": "角色基本类别定义了游戏中角色的基本分类,通常用于技能选项中需要指定角色类别的情况"
76
+ },
77
+ "__schema5": {
78
+ "anyOf": [
79
+ {
80
+ "type": "string"
81
+ },
82
+ {
83
+ "type": "null"
84
+ }
85
+ ]
86
+ },
87
+ "__schema6": {
88
+ "anyOf": [
89
+ {
90
+ "type": "string"
91
+ },
92
+ {
93
+ "type": "null"
94
+ }
95
+ ]
96
+ },
97
+ "__schema7": {
98
+ "anyOf": [
99
+ {
100
+ "type": "array",
101
+ "items": {
102
+ "type": "string"
103
+ }
104
+ },
105
+ {
106
+ "type": "null"
107
+ }
108
+ ]
109
+ },
110
+ "__schema8": {
111
+ "type": "array",
112
+ "items": {
113
+ "type": "string"
114
+ }
115
+ },
116
+ "__schema9": {
117
+ "default": "2026-04-11T23:19:10.184Z",
118
+ "type": "string",
119
+ "format": "date-time",
120
+ "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))$"
121
+ }
122
+ }
123
+ }
@@ -0,0 +1,65 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "anyOf": [
4
+ {
5
+ "type": "object",
6
+ "properties": {
7
+ "type": {
8
+ "type": "string",
9
+ "const": "text"
10
+ },
11
+ "text": {
12
+ "type": "string"
13
+ }
14
+ },
15
+ "required": [
16
+ "type",
17
+ "text"
18
+ ],
19
+ "additionalProperties": false
20
+ },
21
+ {
22
+ "type": "object",
23
+ "properties": {
24
+ "type": {
25
+ "type": "string",
26
+ "const": "operation"
27
+ },
28
+ "operation": {
29
+ "type": "object",
30
+ "properties": {
31
+ "type": {
32
+ "type": "string",
33
+ "minLength": 1
34
+ },
35
+ "payload": {
36
+ "default": {},
37
+ "type": "object",
38
+ "propertyNames": {
39
+ "type": "string"
40
+ },
41
+ "additionalProperties": {}
42
+ },
43
+ "meta": {
44
+ "type": "object",
45
+ "propertyNames": {
46
+ "type": "string"
47
+ },
48
+ "additionalProperties": {}
49
+ }
50
+ },
51
+ "required": [
52
+ "type",
53
+ "payload"
54
+ ],
55
+ "additionalProperties": false
56
+ }
57
+ },
58
+ "required": [
59
+ "type",
60
+ "operation"
61
+ ],
62
+ "additionalProperties": false
63
+ }
64
+ ]
65
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "groupId": {
6
+ "type": "string"
7
+ },
8
+ "name": {
9
+ "type": "string"
10
+ },
11
+ "userIds": {
12
+ "minItems": 2,
13
+ "type": "array",
14
+ "items": {
15
+ "$ref": "#/$defs/__schema0"
16
+ }
17
+ },
18
+ "createdAt": {
19
+ "default": "2026-04-11T23:19:10.186Z",
20
+ "type": "string",
21
+ "format": "date-time",
22
+ "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))$"
23
+ }
24
+ },
25
+ "required": [
26
+ "groupId",
27
+ "name",
28
+ "userIds",
29
+ "createdAt"
30
+ ],
31
+ "additionalProperties": false,
32
+ "$defs": {
33
+ "__schema0": {
34
+ "type": "string"
35
+ }
36
+ }
37
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "type": {
6
+ "type": "string",
7
+ "minLength": 1
8
+ },
9
+ "payload": {
10
+ "default": {},
11
+ "type": "object",
12
+ "propertyNames": {
13
+ "type": "string"
14
+ },
15
+ "additionalProperties": {}
16
+ },
17
+ "meta": {
18
+ "type": "object",
19
+ "propertyNames": {
20
+ "type": "string"
21
+ },
22
+ "additionalProperties": {}
23
+ }
24
+ },
25
+ "required": [
26
+ "type",
27
+ "payload"
28
+ ],
29
+ "additionalProperties": false
30
+ }
@@ -0,0 +1,133 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "id": {
6
+ "type": "string"
7
+ },
8
+ "roomId": {
9
+ "type": "string"
10
+ },
11
+ "sender": {
12
+ "type": "string"
13
+ },
14
+ "target": {
15
+ "type": "object",
16
+ "properties": {
17
+ "type": {
18
+ "type": "string",
19
+ "enum": [
20
+ "DIRECT",
21
+ "GROUP"
22
+ ]
23
+ },
24
+ "id": {
25
+ "type": "string"
26
+ }
27
+ },
28
+ "required": [
29
+ "type",
30
+ "id"
31
+ ],
32
+ "additionalProperties": false
33
+ },
34
+ "content": {
35
+ "anyOf": [
36
+ {
37
+ "type": "object",
38
+ "properties": {
39
+ "type": {
40
+ "type": "string",
41
+ "const": "text"
42
+ },
43
+ "text": {
44
+ "type": "string"
45
+ }
46
+ },
47
+ "required": [
48
+ "type",
49
+ "text"
50
+ ],
51
+ "additionalProperties": false
52
+ },
53
+ {
54
+ "type": "object",
55
+ "properties": {
56
+ "type": {
57
+ "type": "string",
58
+ "const": "operation"
59
+ },
60
+ "operation": {
61
+ "type": "object",
62
+ "properties": {
63
+ "type": {
64
+ "type": "string",
65
+ "minLength": 1
66
+ },
67
+ "payload": {
68
+ "default": {},
69
+ "type": "object",
70
+ "propertyNames": {
71
+ "type": "string"
72
+ },
73
+ "additionalProperties": {}
74
+ },
75
+ "meta": {
76
+ "type": "object",
77
+ "propertyNames": {
78
+ "type": "string"
79
+ },
80
+ "additionalProperties": {}
81
+ }
82
+ },
83
+ "required": [
84
+ "type",
85
+ "payload"
86
+ ],
87
+ "additionalProperties": false
88
+ }
89
+ },
90
+ "required": [
91
+ "type",
92
+ "operation"
93
+ ],
94
+ "additionalProperties": false
95
+ }
96
+ ]
97
+ },
98
+ "createdAt": {
99
+ "default": "2026-04-11T23:19:10.185Z",
100
+ "type": "string",
101
+ "format": "date-time",
102
+ "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))$"
103
+ },
104
+ "updatedAt": {
105
+ "type": "string",
106
+ "format": "date-time",
107
+ "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))$"
108
+ },
109
+ "version": {
110
+ "default": 1,
111
+ "type": "integer",
112
+ "minimum": 1,
113
+ "maximum": 9007199254740991
114
+ },
115
+ "metadata": {
116
+ "type": "object",
117
+ "propertyNames": {
118
+ "type": "string"
119
+ },
120
+ "additionalProperties": {}
121
+ }
122
+ },
123
+ "required": [
124
+ "id",
125
+ "roomId",
126
+ "sender",
127
+ "target",
128
+ "content",
129
+ "createdAt",
130
+ "version"
131
+ ],
132
+ "additionalProperties": false
133
+ }