@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,159 @@
1
+ {
2
+ "$id": "authorbot.story-graph/v1",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "schema": {
7
+ "type": "string",
8
+ "const": "authorbot.story-graph/v1"
9
+ },
10
+ "nodes": {
11
+ "type": "array",
12
+ "items": {
13
+ "oneOf": [
14
+ {
15
+ "type": "object",
16
+ "properties": {
17
+ "id": {
18
+ "type": "string",
19
+ "pattern": "^(?:premise|arc|part|chapter|scene|beat|event|character|location|concept|rule):[a-z0-9][a-z0-9-]*$"
20
+ },
21
+ "title": {
22
+ "type": "string",
23
+ "minLength": 1
24
+ },
25
+ "summary": {
26
+ "type": "string"
27
+ },
28
+ "parent": {
29
+ "type": "string",
30
+ "pattern": "^(?:premise|arc|part|chapter|scene|beat|event|character|location|concept|rule):[a-z0-9][a-z0-9-]*$"
31
+ },
32
+ "order": {
33
+ "type": "number"
34
+ },
35
+ "tags": {
36
+ "type": "array",
37
+ "items": {
38
+ "type": "string",
39
+ "minLength": 1
40
+ }
41
+ },
42
+ "type": {
43
+ "type": "string",
44
+ "const": "chapter"
45
+ },
46
+ "chapter_id": {
47
+ "type": "string",
48
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
49
+ },
50
+ "status": {
51
+ "type": "string",
52
+ "enum": [
53
+ "draft",
54
+ "proposed",
55
+ "published",
56
+ "archived"
57
+ ]
58
+ }
59
+ },
60
+ "required": [
61
+ "id",
62
+ "order",
63
+ "type",
64
+ "chapter_id"
65
+ ],
66
+ "additionalProperties": false
67
+ },
68
+ {
69
+ "type": "object",
70
+ "properties": {
71
+ "id": {
72
+ "type": "string",
73
+ "pattern": "^(?:premise|arc|part|chapter|scene|beat|event|character|location|concept|rule):[a-z0-9][a-z0-9-]*$"
74
+ },
75
+ "title": {
76
+ "type": "string",
77
+ "minLength": 1
78
+ },
79
+ "summary": {
80
+ "type": "string"
81
+ },
82
+ "parent": {
83
+ "type": "string",
84
+ "pattern": "^(?:premise|arc|part|chapter|scene|beat|event|character|location|concept|rule):[a-z0-9][a-z0-9-]*$"
85
+ },
86
+ "order": {
87
+ "type": "number"
88
+ },
89
+ "tags": {
90
+ "type": "array",
91
+ "items": {
92
+ "type": "string",
93
+ "minLength": 1
94
+ }
95
+ },
96
+ "type": {
97
+ "type": "string",
98
+ "enum": [
99
+ "premise",
100
+ "arc",
101
+ "part",
102
+ "scene",
103
+ "beat",
104
+ "custom"
105
+ ]
106
+ },
107
+ "goal": {
108
+ "type": "string"
109
+ },
110
+ "conflict": {
111
+ "type": "string"
112
+ },
113
+ "outcome": {
114
+ "type": "string"
115
+ }
116
+ },
117
+ "required": [
118
+ "id",
119
+ "order",
120
+ "type"
121
+ ],
122
+ "additionalProperties": false
123
+ }
124
+ ]
125
+ }
126
+ },
127
+ "links": {
128
+ "type": "array",
129
+ "items": {
130
+ "type": "object",
131
+ "properties": {
132
+ "from": {
133
+ "type": "string",
134
+ "pattern": "^(?:premise|arc|part|chapter|scene|beat|event|character|location|concept|rule):[a-z0-9][a-z0-9-]*$"
135
+ },
136
+ "to": {
137
+ "type": "string",
138
+ "pattern": "^(?:premise|arc|part|chapter|scene|beat|event|character|location|concept|rule):[a-z0-9][a-z0-9-]*$"
139
+ },
140
+ "type": {
141
+ "type": "string",
142
+ "minLength": 1
143
+ }
144
+ },
145
+ "required": [
146
+ "from",
147
+ "to",
148
+ "type"
149
+ ],
150
+ "additionalProperties": false
151
+ }
152
+ }
153
+ },
154
+ "required": [
155
+ "schema",
156
+ "nodes"
157
+ ],
158
+ "additionalProperties": false
159
+ }
@@ -0,0 +1,91 @@
1
+ {
2
+ "$id": "authorbot.timeline/v1",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "schema": {
7
+ "type": "string",
8
+ "const": "authorbot.timeline/v1"
9
+ },
10
+ "calendar": {
11
+ "type": "object",
12
+ "properties": {
13
+ "type": {
14
+ "type": "string",
15
+ "minLength": 1
16
+ },
17
+ "epoch_label": {
18
+ "type": "string",
19
+ "minLength": 1
20
+ }
21
+ },
22
+ "required": [
23
+ "type"
24
+ ],
25
+ "additionalProperties": false
26
+ },
27
+ "events": {
28
+ "type": "array",
29
+ "items": {
30
+ "type": "object",
31
+ "properties": {
32
+ "id": {
33
+ "type": "string",
34
+ "pattern": "^event:[a-z0-9][a-z0-9-]*$"
35
+ },
36
+ "sort_key": {
37
+ "type": "number"
38
+ },
39
+ "display_time": {
40
+ "type": "string",
41
+ "minLength": 1
42
+ },
43
+ "title": {
44
+ "type": "string",
45
+ "minLength": 1
46
+ },
47
+ "participants": {
48
+ "type": "array",
49
+ "items": {
50
+ "type": "string",
51
+ "pattern": "^character:[a-z0-9][a-z0-9-]*$"
52
+ }
53
+ },
54
+ "locations": {
55
+ "type": "array",
56
+ "items": {
57
+ "type": "string",
58
+ "pattern": "^location:[a-z0-9][a-z0-9-]*$"
59
+ }
60
+ },
61
+ "chapter_refs": {
62
+ "type": "array",
63
+ "items": {
64
+ "type": "string",
65
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
66
+ }
67
+ },
68
+ "facts": {
69
+ "type": "array",
70
+ "items": {
71
+ "type": "string",
72
+ "minLength": 1
73
+ }
74
+ }
75
+ },
76
+ "required": [
77
+ "id",
78
+ "sort_key",
79
+ "display_time",
80
+ "title"
81
+ ],
82
+ "additionalProperties": false
83
+ }
84
+ }
85
+ },
86
+ "required": [
87
+ "schema",
88
+ "events"
89
+ ],
90
+ "additionalProperties": false
91
+ }
@@ -0,0 +1,78 @@
1
+ {
2
+ "$id": "authorbot.work-item/v1",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "schema": {
7
+ "type": "string",
8
+ "const": "authorbot.work-item/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
+ "type": {
15
+ "type": "string",
16
+ "enum": [
17
+ "revise_range",
18
+ "revise_block",
19
+ "revise_chapter",
20
+ "write_chapter",
21
+ "resolve_conflict",
22
+ "planning"
23
+ ]
24
+ },
25
+ "status": {
26
+ "type": "string",
27
+ "enum": [
28
+ "ready",
29
+ "leased",
30
+ "submitted",
31
+ "applying",
32
+ "completed",
33
+ "conflict",
34
+ "failed",
35
+ "cancelled"
36
+ ]
37
+ },
38
+ "source_annotation_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
+ "chapter_id": {
43
+ "type": "string",
44
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
45
+ },
46
+ "base_revision": {
47
+ "type": "integer",
48
+ "minimum": 1,
49
+ "maximum": 9007199254740991
50
+ },
51
+ "priority": {
52
+ "type": "string",
53
+ "enum": [
54
+ "low",
55
+ "normal",
56
+ "high"
57
+ ]
58
+ },
59
+ "created_by": {
60
+ "type": "string",
61
+ "pattern": "^(?:github|agent|system):[A-Za-z0-9][A-Za-z0-9._-]*$"
62
+ },
63
+ "created_at": {
64
+ "type": "string",
65
+ "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$"
66
+ }
67
+ },
68
+ "required": [
69
+ "schema",
70
+ "id",
71
+ "type",
72
+ "status",
73
+ "priority",
74
+ "created_by",
75
+ "created_at"
76
+ ],
77
+ "additionalProperties": false
78
+ }
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@authorbot/schemas",
3
+ "version": "0.1.0",
4
+ "description": "Zod v4 schemas, inferred TypeScript types, and generated JSON Schemas for Authorbot book-repository artifacts (Phase 0 contract section 4)",
5
+ "keywords": [
6
+ "authorbot",
7
+ "zod",
8
+ "json-schema",
9
+ "schemas"
10
+ ],
11
+ "license": "MIT",
12
+ "author": "Joe Mattie",
13
+ "homepage": "https://github.com/JoeMattie/authorbot#readme",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/JoeMattie/authorbot.git",
17
+ "directory": "packages/schemas"
18
+ },
19
+ "bugs": {
20
+ "url": "https://github.com/JoeMattie/authorbot/issues"
21
+ },
22
+ "type": "module",
23
+ "publishConfig": {
24
+ "access": "public",
25
+ "provenance": true
26
+ },
27
+ "engines": {
28
+ "node": ">=22"
29
+ },
30
+ "exports": {
31
+ ".": {
32
+ "types": "./dist/index.d.ts",
33
+ "default": "./dist/index.js"
34
+ },
35
+ "./json/*": "./json/*"
36
+ },
37
+ "files": [
38
+ "dist",
39
+ "json",
40
+ "LICENSE",
41
+ "!dist/**/*.map"
42
+ ],
43
+ "dependencies": {
44
+ "zod": "^4.0.0"
45
+ },
46
+ "devDependencies": {
47
+ "@types/node": "^22.0.0",
48
+ "typescript": "^5.6.0",
49
+ "vitest": "^3.0.0"
50
+ },
51
+ "scripts": {
52
+ "build": "tsc -p tsconfig.build.json && node dist/scripts/generate-json-schemas.js",
53
+ "test": "vitest run --testTimeout=30000",
54
+ "typecheck": "tsc --noEmit"
55
+ }
56
+ }