@authorbot/schemas 0.1.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.
Files changed (47) hide show
  1. package/LICENSE +21 -0
  2. package/dist/annotation.d.ts +172 -0
  3. package/dist/annotation.js +96 -0
  4. package/dist/attribution.d.ts +25 -0
  5. package/dist/attribution.js +19 -0
  6. package/dist/book.d.ts +104 -0
  7. package/dist/book.js +105 -0
  8. package/dist/build.d.ts +44 -0
  9. package/dist/build.js +28 -0
  10. package/dist/chapter.d.ts +37 -0
  11. package/dist/chapter.js +29 -0
  12. package/dist/character.d.ts +15 -0
  13. package/dist/character.js +16 -0
  14. package/dist/decision.d.ts +34 -0
  15. package/dist/decision.js +31 -0
  16. package/dist/index.d.ts +29 -0
  17. package/dist/index.js +15 -0
  18. package/dist/instance.d.ts +260 -0
  19. package/dist/instance.js +101 -0
  20. package/dist/json-schemas.d.ts +455 -0
  21. package/dist/json-schemas.js +61 -0
  22. package/dist/primitives.d.ts +58 -0
  23. package/dist/primitives.js +101 -0
  24. package/dist/release.d.ts +17 -0
  25. package/dist/release.js +19 -0
  26. package/dist/scripts/generate-json-schemas.d.ts +2 -0
  27. package/dist/scripts/generate-json-schemas.js +14 -0
  28. package/dist/story-graph.d.ts +132 -0
  29. package/dist/story-graph.js +56 -0
  30. package/dist/timeline.d.ts +35 -0
  31. package/dist/timeline.js +28 -0
  32. package/dist/work-item.d.ts +75 -0
  33. package/dist/work-item.js +48 -0
  34. package/json/annotation.schema.json +279 -0
  35. package/json/attribution.schema.json +52 -0
  36. package/json/book.schema.json +270 -0
  37. package/json/build.schema.json +84 -0
  38. package/json/chapter.schema.json +89 -0
  39. package/json/character.schema.json +39 -0
  40. package/json/decision.schema.json +69 -0
  41. package/json/instance.schema.json +273 -0
  42. package/json/release.schema.json +52 -0
  43. package/json/reply.schema.json +43 -0
  44. package/json/story-graph.schema.json +159 -0
  45. package/json/timeline.schema.json +91 -0
  46. package/json/work-item.schema.json +78 -0
  47. package/package.json +56 -0
@@ -0,0 +1,89 @@
1
+ {
2
+ "$id": "authorbot.chapter/v1",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "schema": {
7
+ "type": "string",
8
+ "const": "authorbot.chapter/v1"
9
+ },
10
+ "id": {
11
+ "type": "string",
12
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
13
+ },
14
+ "slug": {
15
+ "type": "string",
16
+ "pattern": "^[a-z0-9][a-z0-9-]*$"
17
+ },
18
+ "title": {
19
+ "type": "string",
20
+ "minLength": 1
21
+ },
22
+ "order": {
23
+ "type": "number"
24
+ },
25
+ "status": {
26
+ "type": "string",
27
+ "enum": [
28
+ "draft",
29
+ "proposed",
30
+ "published",
31
+ "archived"
32
+ ]
33
+ },
34
+ "revision": {
35
+ "type": "integer",
36
+ "minimum": 1,
37
+ "maximum": 9007199254740991
38
+ },
39
+ "published_at": {
40
+ "type": "string",
41
+ "pattern": "^\\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\\d|3[01])T(?:[01]\\d|2[0-3]):[0-5]\\d:(?:[0-5]\\d|60)(?:\\.\\d{1,9})?Z$"
42
+ },
43
+ "authors": {
44
+ "minItems": 1,
45
+ "type": "array",
46
+ "items": {
47
+ "type": "object",
48
+ "properties": {
49
+ "actor": {
50
+ "type": "string",
51
+ "pattern": "^(?:github|agent|system):[A-Za-z0-9][A-Za-z0-9._-]*$"
52
+ }
53
+ },
54
+ "required": [
55
+ "actor"
56
+ ],
57
+ "additionalProperties": false
58
+ }
59
+ },
60
+ "summary": {
61
+ "type": "string"
62
+ },
63
+ "timeline_refs": {
64
+ "type": "array",
65
+ "items": {
66
+ "type": "string",
67
+ "pattern": "^event:[a-z0-9][a-z0-9-]*$"
68
+ }
69
+ },
70
+ "character_refs": {
71
+ "type": "array",
72
+ "items": {
73
+ "type": "string",
74
+ "pattern": "^character:[a-z0-9][a-z0-9-]*$"
75
+ }
76
+ }
77
+ },
78
+ "required": [
79
+ "schema",
80
+ "id",
81
+ "slug",
82
+ "title",
83
+ "order",
84
+ "status",
85
+ "revision",
86
+ "authors"
87
+ ],
88
+ "additionalProperties": false
89
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "$id": "authorbot.character/v1",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "schema": {
7
+ "type": "string",
8
+ "const": "authorbot.character/v1"
9
+ },
10
+ "id": {
11
+ "type": "string",
12
+ "pattern": "^character:[a-z0-9][a-z0-9-]*$"
13
+ },
14
+ "name": {
15
+ "type": "string",
16
+ "minLength": 1
17
+ },
18
+ "aliases": {
19
+ "type": "array",
20
+ "items": {
21
+ "type": "string",
22
+ "minLength": 1
23
+ }
24
+ },
25
+ "summary": {
26
+ "type": "string"
27
+ },
28
+ "status": {
29
+ "type": "string",
30
+ "minLength": 1
31
+ }
32
+ },
33
+ "required": [
34
+ "schema",
35
+ "id",
36
+ "name"
37
+ ],
38
+ "additionalProperties": false
39
+ }
@@ -0,0 +1,69 @@
1
+ {
2
+ "$id": "authorbot.decision/v1",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "schema": {
7
+ "type": "string",
8
+ "const": "authorbot.decision/v1"
9
+ },
10
+ "id": {
11
+ "type": "string",
12
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
13
+ },
14
+ "source_annotation_id": {
15
+ "type": "string",
16
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
17
+ },
18
+ "rule": {
19
+ "type": "string",
20
+ "minLength": 1
21
+ },
22
+ "rule_version": {
23
+ "type": "integer",
24
+ "minimum": 0,
25
+ "maximum": 9007199254740991
26
+ },
27
+ "metrics": {
28
+ "type": "object",
29
+ "propertyNames": {
30
+ "type": "string"
31
+ },
32
+ "additionalProperties": {
33
+ "type": "number"
34
+ }
35
+ },
36
+ "result": {
37
+ "type": "string",
38
+ "enum": [
39
+ "create_work_item",
40
+ "rejected",
41
+ "support_changed",
42
+ "overridden"
43
+ ]
44
+ },
45
+ "work_item_id": {
46
+ "type": "string",
47
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
48
+ },
49
+ "effective_at": {
50
+ "type": "string",
51
+ "pattern": "^\\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\\d|3[01])T(?:[01]\\d|2[0-3]):[0-5]\\d:(?:[0-5]\\d|60)(?:\\.\\d{1,9})?Z$"
52
+ },
53
+ "override_reason": {
54
+ "type": "string",
55
+ "minLength": 1
56
+ }
57
+ },
58
+ "required": [
59
+ "schema",
60
+ "id",
61
+ "source_annotation_id",
62
+ "rule",
63
+ "rule_version",
64
+ "metrics",
65
+ "result",
66
+ "effective_at"
67
+ ],
68
+ "additionalProperties": false
69
+ }
@@ -0,0 +1,273 @@
1
+ {
2
+ "$id": "authorbot.instance/v1",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "schema": {
7
+ "type": "string",
8
+ "const": "authorbot.instance/v1"
9
+ },
10
+ "project": {
11
+ "type": "object",
12
+ "properties": {
13
+ "book_config_path": {
14
+ "type": "string",
15
+ "minLength": 1
16
+ },
17
+ "default_branch": {
18
+ "type": "string",
19
+ "minLength": 1
20
+ }
21
+ },
22
+ "additionalProperties": false
23
+ },
24
+ "access": {
25
+ "type": "object",
26
+ "properties": {
27
+ "public_read": {
28
+ "type": "boolean"
29
+ },
30
+ "public_annotations": {
31
+ "type": "boolean"
32
+ },
33
+ "writes_require_membership": {
34
+ "type": "boolean"
35
+ }
36
+ },
37
+ "additionalProperties": false
38
+ },
39
+ "annotations": {
40
+ "type": "object",
41
+ "properties": {
42
+ "context_characters": {
43
+ "type": "integer",
44
+ "minimum": 0,
45
+ "maximum": 9007199254740991
46
+ },
47
+ "range_scope": {
48
+ "type": "string",
49
+ "enum": [
50
+ "single_block"
51
+ ]
52
+ },
53
+ "allow_range_comments": {
54
+ "type": "boolean"
55
+ },
56
+ "allow_chapter_comments": {
57
+ "type": "boolean"
58
+ }
59
+ },
60
+ "additionalProperties": false
61
+ },
62
+ "votes": {
63
+ "type": "object",
64
+ "properties": {
65
+ "values": {
66
+ "minItems": 1,
67
+ "type": "array",
68
+ "items": {
69
+ "type": "string",
70
+ "enum": [
71
+ "approve",
72
+ "reject",
73
+ "abstain"
74
+ ]
75
+ }
76
+ },
77
+ "export": {
78
+ "type": "string",
79
+ "enum": [
80
+ "aggregate",
81
+ "named",
82
+ "pseudonymous"
83
+ ]
84
+ }
85
+ },
86
+ "additionalProperties": false
87
+ },
88
+ "rules": {
89
+ "type": "object",
90
+ "propertyNames": {
91
+ "type": "string",
92
+ "pattern": "^[a-z][a-z0-9_]*$"
93
+ },
94
+ "additionalProperties": {
95
+ "type": "object",
96
+ "properties": {
97
+ "version": {
98
+ "type": "integer",
99
+ "minimum": 1,
100
+ "maximum": 9007199254740991
101
+ },
102
+ "trigger": {
103
+ "type": "string",
104
+ "enum": [
105
+ "vote_changed"
106
+ ]
107
+ },
108
+ "when": {
109
+ "anyOf": [
110
+ {
111
+ "type": "object",
112
+ "properties": {
113
+ "all": {
114
+ "minItems": 1,
115
+ "type": "array",
116
+ "items": {
117
+ "type": "object",
118
+ "properties": {
119
+ "metric": {
120
+ "type": "string",
121
+ "pattern": "^[a-z][a-z0-9_]*$"
122
+ },
123
+ "operator": {
124
+ "type": "string",
125
+ "enum": [
126
+ "gte",
127
+ "gt",
128
+ "lte",
129
+ "lt",
130
+ "eq",
131
+ "neq"
132
+ ]
133
+ },
134
+ "value": {
135
+ "type": "number"
136
+ }
137
+ },
138
+ "required": [
139
+ "metric",
140
+ "operator",
141
+ "value"
142
+ ],
143
+ "additionalProperties": false
144
+ }
145
+ }
146
+ },
147
+ "required": [
148
+ "all"
149
+ ],
150
+ "additionalProperties": false
151
+ },
152
+ {
153
+ "type": "object",
154
+ "properties": {
155
+ "any": {
156
+ "minItems": 1,
157
+ "type": "array",
158
+ "items": {
159
+ "type": "object",
160
+ "properties": {
161
+ "metric": {
162
+ "type": "string",
163
+ "pattern": "^[a-z][a-z0-9_]*$"
164
+ },
165
+ "operator": {
166
+ "type": "string",
167
+ "enum": [
168
+ "gte",
169
+ "gt",
170
+ "lte",
171
+ "lt",
172
+ "eq",
173
+ "neq"
174
+ ]
175
+ },
176
+ "value": {
177
+ "type": "number"
178
+ }
179
+ },
180
+ "required": [
181
+ "metric",
182
+ "operator",
183
+ "value"
184
+ ],
185
+ "additionalProperties": false
186
+ }
187
+ }
188
+ },
189
+ "required": [
190
+ "any"
191
+ ],
192
+ "additionalProperties": false
193
+ }
194
+ ]
195
+ },
196
+ "action": {
197
+ "type": "object",
198
+ "properties": {
199
+ "type": {
200
+ "type": "string",
201
+ "const": "create_work_item"
202
+ },
203
+ "work_type": {
204
+ "type": "string",
205
+ "enum": [
206
+ "revise_range",
207
+ "revise_block",
208
+ "revise_chapter",
209
+ "write_chapter",
210
+ "resolve_conflict",
211
+ "planning"
212
+ ]
213
+ }
214
+ },
215
+ "required": [
216
+ "type",
217
+ "work_type"
218
+ ],
219
+ "additionalProperties": false
220
+ }
221
+ },
222
+ "required": [
223
+ "version",
224
+ "when",
225
+ "action"
226
+ ],
227
+ "additionalProperties": false
228
+ }
229
+ },
230
+ "leases": {
231
+ "type": "object",
232
+ "properties": {
233
+ "duration": {
234
+ "type": "string",
235
+ "pattern": "^P(?!$)(?:\\d+Y)?(?:\\d+M)?(?:\\d+W)?(?:\\d+D)?(?:T(?=\\d)(?:\\d+H)?(?:\\d+M)?(?:\\d+(?:\\.\\d+)?S)?)?$"
236
+ },
237
+ "renewal_prompt_before": {
238
+ "type": "string",
239
+ "pattern": "^P(?!$)(?:\\d+Y)?(?:\\d+M)?(?:\\d+W)?(?:\\d+D)?(?:T(?=\\d)(?:\\d+H)?(?:\\d+M)?(?:\\d+(?:\\.\\d+)?S)?)?$"
240
+ },
241
+ "renewal_duration": {
242
+ "type": "string",
243
+ "pattern": "^P(?!$)(?:\\d+Y)?(?:\\d+M)?(?:\\d+W)?(?:\\d+D)?(?:T(?=\\d)(?:\\d+H)?(?:\\d+M)?(?:\\d+(?:\\.\\d+)?S)?)?$"
244
+ },
245
+ "maximum_total_duration": {
246
+ "type": "string",
247
+ "pattern": "^P(?!$)(?:\\d+Y)?(?:\\d+M)?(?:\\d+W)?(?:\\d+D)?(?:T(?=\\d)(?:\\d+H)?(?:\\d+M)?(?:\\d+(?:\\.\\d+)?S)?)?$"
248
+ }
249
+ },
250
+ "additionalProperties": false
251
+ },
252
+ "publishing": {
253
+ "type": "object",
254
+ "properties": {
255
+ "collaboration_data": {
256
+ "type": "string",
257
+ "enum": [
258
+ "dynamic",
259
+ "static"
260
+ ]
261
+ },
262
+ "static_snapshot_on_release": {
263
+ "type": "boolean"
264
+ }
265
+ },
266
+ "additionalProperties": false
267
+ }
268
+ },
269
+ "required": [
270
+ "schema"
271
+ ],
272
+ "additionalProperties": false
273
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "$id": "authorbot.release/v1",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "schema": {
7
+ "type": "string",
8
+ "const": "authorbot.release/v1"
9
+ },
10
+ "id": {
11
+ "type": "string",
12
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
13
+ },
14
+ "created_at": {
15
+ "type": "string",
16
+ "pattern": "^\\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\\d|3[01])T(?:[01]\\d|2[0-3]):[0-5]\\d:(?:[0-5]\\d|60)(?:\\.\\d{1,9})?Z$"
17
+ },
18
+ "chapters": {
19
+ "minItems": 1,
20
+ "type": "array",
21
+ "items": {
22
+ "type": "object",
23
+ "properties": {
24
+ "chapter_id": {
25
+ "type": "string",
26
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
27
+ },
28
+ "revision": {
29
+ "type": "integer",
30
+ "minimum": 1,
31
+ "maximum": 9007199254740991
32
+ }
33
+ },
34
+ "required": [
35
+ "chapter_id",
36
+ "revision"
37
+ ],
38
+ "additionalProperties": false
39
+ }
40
+ },
41
+ "notes": {
42
+ "type": "string"
43
+ }
44
+ },
45
+ "required": [
46
+ "schema",
47
+ "id",
48
+ "created_at",
49
+ "chapters"
50
+ ],
51
+ "additionalProperties": false
52
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "$id": "authorbot.reply/v1",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "schema": {
7
+ "type": "string",
8
+ "const": "authorbot.reply/v1"
9
+ },
10
+ "id": {
11
+ "type": "string",
12
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
13
+ },
14
+ "annotation_id": {
15
+ "type": "string",
16
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
17
+ },
18
+ "parent_reply_id": {
19
+ "type": "string",
20
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
21
+ },
22
+ "author": {
23
+ "type": "string",
24
+ "pattern": "^(?:github|agent|system):[A-Za-z0-9][A-Za-z0-9._-]*$"
25
+ },
26
+ "created_at": {
27
+ "type": "string",
28
+ "pattern": "^\\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\\d|3[01])T(?:[01]\\d|2[0-3]):[0-5]\\d:(?:[0-5]\\d|60)(?:\\.\\d{1,9})?Z$"
29
+ },
30
+ "updated_at": {
31
+ "type": "string",
32
+ "pattern": "^\\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\\d|3[01])T(?:[01]\\d|2[0-3]):[0-5]\\d:(?:[0-5]\\d|60)(?:\\.\\d{1,9})?Z$"
33
+ }
34
+ },
35
+ "required": [
36
+ "schema",
37
+ "id",
38
+ "annotation_id",
39
+ "author",
40
+ "created_at"
41
+ ],
42
+ "additionalProperties": false
43
+ }