@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,279 @@
1
+ {
2
+ "$id": "authorbot.annotation/v1",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "oneOf": [
5
+ {
6
+ "type": "object",
7
+ "properties": {
8
+ "schema": {
9
+ "type": "string",
10
+ "const": "authorbot.annotation/v1"
11
+ },
12
+ "id": {
13
+ "type": "string",
14
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
15
+ },
16
+ "kind": {
17
+ "type": "string",
18
+ "enum": [
19
+ "comment",
20
+ "suggestion"
21
+ ]
22
+ },
23
+ "chapter_id": {
24
+ "type": "string",
25
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
26
+ },
27
+ "chapter_revision": {
28
+ "type": "integer",
29
+ "minimum": 1,
30
+ "maximum": 9007199254740991
31
+ },
32
+ "author": {
33
+ "type": "string",
34
+ "pattern": "^(?:github|agent|system):[A-Za-z0-9][A-Za-z0-9._-]*$"
35
+ },
36
+ "status": {
37
+ "type": "string",
38
+ "enum": [
39
+ "open",
40
+ "work_item_created",
41
+ "accepted",
42
+ "resolved",
43
+ "rejected",
44
+ "withdrawn",
45
+ "superseded",
46
+ "orphaned",
47
+ "needs_reanchor"
48
+ ]
49
+ },
50
+ "created_at": {
51
+ "type": "string",
52
+ "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$"
53
+ },
54
+ "scope": {
55
+ "type": "string",
56
+ "const": "range"
57
+ },
58
+ "target": {
59
+ "type": "object",
60
+ "properties": {
61
+ "blockId": {
62
+ "type": "string",
63
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
64
+ },
65
+ "textPosition": {
66
+ "type": "object",
67
+ "properties": {
68
+ "start": {
69
+ "type": "integer",
70
+ "minimum": 0,
71
+ "maximum": 9007199254740991
72
+ },
73
+ "end": {
74
+ "type": "integer",
75
+ "minimum": 0,
76
+ "maximum": 9007199254740991
77
+ }
78
+ },
79
+ "required": [
80
+ "start",
81
+ "end"
82
+ ],
83
+ "additionalProperties": false
84
+ },
85
+ "textQuote": {
86
+ "type": "object",
87
+ "properties": {
88
+ "exact": {
89
+ "type": "string",
90
+ "minLength": 1,
91
+ "maxLength": 8192
92
+ },
93
+ "prefix": {
94
+ "type": "string",
95
+ "maxLength": 32
96
+ },
97
+ "suffix": {
98
+ "type": "string",
99
+ "maxLength": 32
100
+ }
101
+ },
102
+ "required": [
103
+ "exact"
104
+ ],
105
+ "additionalProperties": false
106
+ }
107
+ },
108
+ "required": [
109
+ "blockId",
110
+ "textPosition",
111
+ "textQuote"
112
+ ],
113
+ "additionalProperties": false
114
+ }
115
+ },
116
+ "required": [
117
+ "schema",
118
+ "id",
119
+ "kind",
120
+ "chapter_id",
121
+ "chapter_revision",
122
+ "author",
123
+ "status",
124
+ "created_at",
125
+ "scope",
126
+ "target"
127
+ ],
128
+ "additionalProperties": false
129
+ },
130
+ {
131
+ "type": "object",
132
+ "properties": {
133
+ "schema": {
134
+ "type": "string",
135
+ "const": "authorbot.annotation/v1"
136
+ },
137
+ "id": {
138
+ "type": "string",
139
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
140
+ },
141
+ "kind": {
142
+ "type": "string",
143
+ "enum": [
144
+ "comment",
145
+ "suggestion"
146
+ ]
147
+ },
148
+ "chapter_id": {
149
+ "type": "string",
150
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
151
+ },
152
+ "chapter_revision": {
153
+ "type": "integer",
154
+ "minimum": 1,
155
+ "maximum": 9007199254740991
156
+ },
157
+ "author": {
158
+ "type": "string",
159
+ "pattern": "^(?:github|agent|system):[A-Za-z0-9][A-Za-z0-9._-]*$"
160
+ },
161
+ "status": {
162
+ "type": "string",
163
+ "enum": [
164
+ "open",
165
+ "work_item_created",
166
+ "accepted",
167
+ "resolved",
168
+ "rejected",
169
+ "withdrawn",
170
+ "superseded",
171
+ "orphaned",
172
+ "needs_reanchor"
173
+ ]
174
+ },
175
+ "created_at": {
176
+ "type": "string",
177
+ "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$"
178
+ },
179
+ "scope": {
180
+ "type": "string",
181
+ "const": "block"
182
+ },
183
+ "target": {
184
+ "type": "object",
185
+ "properties": {
186
+ "blockId": {
187
+ "type": "string",
188
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
189
+ }
190
+ },
191
+ "required": [
192
+ "blockId"
193
+ ],
194
+ "additionalProperties": false
195
+ }
196
+ },
197
+ "required": [
198
+ "schema",
199
+ "id",
200
+ "kind",
201
+ "chapter_id",
202
+ "chapter_revision",
203
+ "author",
204
+ "status",
205
+ "created_at",
206
+ "scope",
207
+ "target"
208
+ ],
209
+ "additionalProperties": false
210
+ },
211
+ {
212
+ "type": "object",
213
+ "properties": {
214
+ "schema": {
215
+ "type": "string",
216
+ "const": "authorbot.annotation/v1"
217
+ },
218
+ "id": {
219
+ "type": "string",
220
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
221
+ },
222
+ "kind": {
223
+ "type": "string",
224
+ "enum": [
225
+ "comment",
226
+ "suggestion"
227
+ ]
228
+ },
229
+ "chapter_id": {
230
+ "type": "string",
231
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
232
+ },
233
+ "chapter_revision": {
234
+ "type": "integer",
235
+ "minimum": 1,
236
+ "maximum": 9007199254740991
237
+ },
238
+ "author": {
239
+ "type": "string",
240
+ "pattern": "^(?:github|agent|system):[A-Za-z0-9][A-Za-z0-9._-]*$"
241
+ },
242
+ "status": {
243
+ "type": "string",
244
+ "enum": [
245
+ "open",
246
+ "work_item_created",
247
+ "accepted",
248
+ "resolved",
249
+ "rejected",
250
+ "withdrawn",
251
+ "superseded",
252
+ "orphaned",
253
+ "needs_reanchor"
254
+ ]
255
+ },
256
+ "created_at": {
257
+ "type": "string",
258
+ "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$"
259
+ },
260
+ "scope": {
261
+ "type": "string",
262
+ "const": "chapter"
263
+ }
264
+ },
265
+ "required": [
266
+ "schema",
267
+ "id",
268
+ "kind",
269
+ "chapter_id",
270
+ "chapter_revision",
271
+ "author",
272
+ "status",
273
+ "created_at",
274
+ "scope"
275
+ ],
276
+ "additionalProperties": false
277
+ }
278
+ ]
279
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "$id": "authorbot.attribution/v1",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "schema": {
7
+ "type": "string",
8
+ "const": "authorbot.attribution/v1"
9
+ },
10
+ "chapter_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
+ "entries": {
15
+ "minItems": 1,
16
+ "type": "array",
17
+ "items": {
18
+ "type": "object",
19
+ "properties": {
20
+ "revision": {
21
+ "type": "integer",
22
+ "minimum": 1,
23
+ "maximum": 9007199254740991
24
+ },
25
+ "actor": {
26
+ "type": "string",
27
+ "pattern": "^(?:github|agent|system):[A-Za-z0-9][A-Za-z0-9._-]*$"
28
+ },
29
+ "work_item_id": {
30
+ "type": "string",
31
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
32
+ },
33
+ "commit": {
34
+ "type": "string",
35
+ "pattern": "^[0-9a-f]{7,64}$"
36
+ }
37
+ },
38
+ "required": [
39
+ "revision",
40
+ "actor"
41
+ ],
42
+ "additionalProperties": false
43
+ }
44
+ }
45
+ },
46
+ "required": [
47
+ "schema",
48
+ "chapter_id",
49
+ "entries"
50
+ ],
51
+ "additionalProperties": false
52
+ }
@@ -0,0 +1,270 @@
1
+ {
2
+ "$id": "authorbot.book/v1",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "schema": {
7
+ "type": "string",
8
+ "const": "authorbot.book/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
+ "title": {
15
+ "type": "string",
16
+ "minLength": 1
17
+ },
18
+ "slug": {
19
+ "type": "string",
20
+ "pattern": "^[a-z0-9][a-z0-9-]*$"
21
+ },
22
+ "language": {
23
+ "type": "string",
24
+ "pattern": "^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$"
25
+ },
26
+ "license": {
27
+ "type": "string",
28
+ "minLength": 1
29
+ },
30
+ "repository": {
31
+ "type": "object",
32
+ "properties": {
33
+ "default_branch": {
34
+ "type": "string",
35
+ "minLength": 1
36
+ }
37
+ },
38
+ "additionalProperties": false
39
+ },
40
+ "content": {
41
+ "type": "object",
42
+ "properties": {
43
+ "chapters_glob": {
44
+ "type": "string",
45
+ "minLength": 1
46
+ },
47
+ "raw_html": {
48
+ "type": "boolean"
49
+ }
50
+ },
51
+ "additionalProperties": false
52
+ },
53
+ "planning": {
54
+ "type": "object",
55
+ "properties": {
56
+ "method": {
57
+ "type": "string",
58
+ "minLength": 1
59
+ },
60
+ "outline": {
61
+ "type": "string",
62
+ "minLength": 1
63
+ },
64
+ "timeline": {
65
+ "type": "string",
66
+ "minLength": 1
67
+ },
68
+ "characters_glob": {
69
+ "type": "string",
70
+ "minLength": 1
71
+ }
72
+ },
73
+ "additionalProperties": false
74
+ },
75
+ "publication": {
76
+ "type": "object",
77
+ "properties": {
78
+ "chapter_url": {
79
+ "type": "string",
80
+ "minLength": 1
81
+ },
82
+ "api_url": {
83
+ "type": "string",
84
+ "minLength": 1
85
+ },
86
+ "show_revision": {
87
+ "type": "boolean"
88
+ },
89
+ "show_attribution": {
90
+ "type": "boolean"
91
+ },
92
+ "show_public_annotations": {
93
+ "type": "boolean"
94
+ }
95
+ },
96
+ "additionalProperties": false
97
+ },
98
+ "collaboration": {
99
+ "type": "object",
100
+ "properties": {
101
+ "annotation_policy": {
102
+ "type": "string",
103
+ "enum": [
104
+ "open",
105
+ "approval-gated",
106
+ "collaborators-only",
107
+ "locked"
108
+ ]
109
+ }
110
+ },
111
+ "additionalProperties": false
112
+ },
113
+ "governance": {
114
+ "type": "object",
115
+ "properties": {
116
+ "rules": {
117
+ "type": "object",
118
+ "propertyNames": {
119
+ "type": "string",
120
+ "pattern": "^[a-z][a-z0-9_]*$"
121
+ },
122
+ "additionalProperties": {
123
+ "type": "object",
124
+ "properties": {
125
+ "version": {
126
+ "type": "integer",
127
+ "minimum": 1,
128
+ "maximum": 9007199254740991
129
+ },
130
+ "trigger": {
131
+ "type": "string",
132
+ "enum": [
133
+ "vote_changed"
134
+ ]
135
+ },
136
+ "when": {
137
+ "anyOf": [
138
+ {
139
+ "type": "object",
140
+ "properties": {
141
+ "all": {
142
+ "minItems": 1,
143
+ "type": "array",
144
+ "items": {
145
+ "type": "object",
146
+ "properties": {
147
+ "metric": {
148
+ "type": "string",
149
+ "pattern": "^[a-z][a-z0-9_]*$"
150
+ },
151
+ "operator": {
152
+ "type": "string",
153
+ "enum": [
154
+ "gte",
155
+ "gt",
156
+ "lte",
157
+ "lt",
158
+ "eq",
159
+ "neq"
160
+ ]
161
+ },
162
+ "value": {
163
+ "type": "number"
164
+ }
165
+ },
166
+ "required": [
167
+ "metric",
168
+ "operator",
169
+ "value"
170
+ ],
171
+ "additionalProperties": false
172
+ }
173
+ }
174
+ },
175
+ "required": [
176
+ "all"
177
+ ],
178
+ "additionalProperties": false
179
+ },
180
+ {
181
+ "type": "object",
182
+ "properties": {
183
+ "any": {
184
+ "minItems": 1,
185
+ "type": "array",
186
+ "items": {
187
+ "type": "object",
188
+ "properties": {
189
+ "metric": {
190
+ "type": "string",
191
+ "pattern": "^[a-z][a-z0-9_]*$"
192
+ },
193
+ "operator": {
194
+ "type": "string",
195
+ "enum": [
196
+ "gte",
197
+ "gt",
198
+ "lte",
199
+ "lt",
200
+ "eq",
201
+ "neq"
202
+ ]
203
+ },
204
+ "value": {
205
+ "type": "number"
206
+ }
207
+ },
208
+ "required": [
209
+ "metric",
210
+ "operator",
211
+ "value"
212
+ ],
213
+ "additionalProperties": false
214
+ }
215
+ }
216
+ },
217
+ "required": [
218
+ "any"
219
+ ],
220
+ "additionalProperties": false
221
+ }
222
+ ]
223
+ },
224
+ "action": {
225
+ "type": "object",
226
+ "properties": {
227
+ "type": {
228
+ "type": "string",
229
+ "const": "create_work_item"
230
+ },
231
+ "work_type": {
232
+ "type": "string",
233
+ "enum": [
234
+ "revise_range",
235
+ "revise_block",
236
+ "revise_chapter",
237
+ "write_chapter",
238
+ "resolve_conflict",
239
+ "planning"
240
+ ]
241
+ }
242
+ },
243
+ "required": [
244
+ "type",
245
+ "work_type"
246
+ ],
247
+ "additionalProperties": false
248
+ }
249
+ },
250
+ "required": [
251
+ "version",
252
+ "when",
253
+ "action"
254
+ ],
255
+ "additionalProperties": false
256
+ }
257
+ }
258
+ },
259
+ "additionalProperties": false
260
+ }
261
+ },
262
+ "required": [
263
+ "schema",
264
+ "id",
265
+ "title",
266
+ "slug",
267
+ "language"
268
+ ],
269
+ "additionalProperties": false
270
+ }
@@ -0,0 +1,84 @@
1
+ {
2
+ "$id": "authorbot.build/v1",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "schema": {
7
+ "type": "string",
8
+ "const": "authorbot.build/v1"
9
+ },
10
+ "commit": {
11
+ "anyOf": [
12
+ {
13
+ "type": "string",
14
+ "pattern": "^[0-9a-f]{7,64}$"
15
+ },
16
+ {
17
+ "type": "null"
18
+ }
19
+ ]
20
+ },
21
+ "built_at": {
22
+ "type": "string",
23
+ "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$"
24
+ },
25
+ "publisher_version": {
26
+ "type": "string",
27
+ "minLength": 1
28
+ },
29
+ "base_url": {
30
+ "type": "string",
31
+ "minLength": 1
32
+ },
33
+ "chapters": {
34
+ "type": "array",
35
+ "items": {
36
+ "type": "object",
37
+ "properties": {
38
+ "id": {
39
+ "type": "string",
40
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
41
+ },
42
+ "slug": {
43
+ "type": "string",
44
+ "pattern": "^[a-z0-9][a-z0-9-]*$"
45
+ },
46
+ "revision": {
47
+ "type": "integer",
48
+ "minimum": 1,
49
+ "maximum": 9007199254740991
50
+ },
51
+ "title": {
52
+ "type": "string",
53
+ "minLength": 1
54
+ },
55
+ "status": {
56
+ "type": "string",
57
+ "enum": [
58
+ "draft",
59
+ "proposed",
60
+ "published",
61
+ "archived"
62
+ ]
63
+ }
64
+ },
65
+ "required": [
66
+ "id",
67
+ "slug",
68
+ "revision",
69
+ "title",
70
+ "status"
71
+ ],
72
+ "additionalProperties": false
73
+ }
74
+ }
75
+ },
76
+ "required": [
77
+ "schema",
78
+ "commit",
79
+ "built_at",
80
+ "publisher_version",
81
+ "chapters"
82
+ ],
83
+ "additionalProperties": false
84
+ }