@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.
- package/LICENSE +21 -0
- package/dist/annotation.d.ts +172 -0
- package/dist/annotation.js +96 -0
- package/dist/attribution.d.ts +25 -0
- package/dist/attribution.js +19 -0
- package/dist/book.d.ts +104 -0
- package/dist/book.js +105 -0
- package/dist/build.d.ts +44 -0
- package/dist/build.js +28 -0
- package/dist/chapter.d.ts +37 -0
- package/dist/chapter.js +29 -0
- package/dist/character.d.ts +15 -0
- package/dist/character.js +16 -0
- package/dist/decision.d.ts +34 -0
- package/dist/decision.js +31 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +15 -0
- package/dist/instance.d.ts +260 -0
- package/dist/instance.js +101 -0
- package/dist/json-schemas.d.ts +455 -0
- package/dist/json-schemas.js +61 -0
- package/dist/primitives.d.ts +58 -0
- package/dist/primitives.js +101 -0
- package/dist/release.d.ts +17 -0
- package/dist/release.js +19 -0
- package/dist/scripts/generate-json-schemas.d.ts +2 -0
- package/dist/scripts/generate-json-schemas.js +14 -0
- package/dist/story-graph.d.ts +132 -0
- package/dist/story-graph.js +56 -0
- package/dist/timeline.d.ts +35 -0
- package/dist/timeline.js +28 -0
- package/dist/work-item.d.ts +75 -0
- package/dist/work-item.js +48 -0
- package/json/annotation.schema.json +279 -0
- package/json/attribution.schema.json +52 -0
- package/json/book.schema.json +270 -0
- package/json/build.schema.json +84 -0
- package/json/chapter.schema.json +89 -0
- package/json/character.schema.json +39 -0
- package/json/decision.schema.json +69 -0
- package/json/instance.schema.json +273 -0
- package/json/release.schema.json +52 -0
- package/json/reply.schema.json +43 -0
- package/json/story-graph.schema.json +159 -0
- package/json/timeline.schema.json +91 -0
- package/json/work-item.schema.json +78 -0
- package/package.json +56 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Release manifest `.authorbot/releases/<id>.yml` — `authorbot.release/v1`
|
|
4
|
+
* (contract section 4). A release pins at least one chapter revision.
|
|
5
|
+
*/
|
|
6
|
+
export declare const releaseSchema: z.ZodObject<{
|
|
7
|
+
schema: z.ZodLiteral<"authorbot.release/v1">;
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
created_at: z.ZodString;
|
|
10
|
+
chapters: z.ZodArray<z.ZodObject<{
|
|
11
|
+
chapter_id: z.ZodString;
|
|
12
|
+
revision: z.ZodNumber;
|
|
13
|
+
}, z.core.$strict>>;
|
|
14
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, z.core.$strict>;
|
|
16
|
+
export type Release = z.infer<typeof releaseSchema>;
|
|
17
|
+
//# sourceMappingURL=release.d.ts.map
|
package/dist/release.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { timestampSchema, uuidv7Schema } from "./primitives.js";
|
|
3
|
+
/**
|
|
4
|
+
* Release manifest `.authorbot/releases/<id>.yml` — `authorbot.release/v1`
|
|
5
|
+
* (contract section 4). A release pins at least one chapter revision.
|
|
6
|
+
*/
|
|
7
|
+
export const releaseSchema = z.strictObject({
|
|
8
|
+
schema: z.literal("authorbot.release/v1"),
|
|
9
|
+
id: uuidv7Schema,
|
|
10
|
+
created_at: timestampSchema,
|
|
11
|
+
chapters: z
|
|
12
|
+
.array(z.strictObject({
|
|
13
|
+
chapter_id: uuidv7Schema,
|
|
14
|
+
revision: z.number().int().min(1),
|
|
15
|
+
}))
|
|
16
|
+
.min(1),
|
|
17
|
+
notes: z.string().optional(),
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=release.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build step: write JSON Schemas generated from the Zod schemas to
|
|
3
|
+
* packages/schemas/json/<name>.schema.json. The generated files are checked
|
|
4
|
+
* in (contract section 1); a test asserts they stay in sync.
|
|
5
|
+
*/
|
|
6
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
import { buildJsonSchemas } from "../json-schemas.js";
|
|
9
|
+
const outDir = fileURLToPath(new URL("../../json/", import.meta.url));
|
|
10
|
+
const documents = buildJsonSchemas();
|
|
11
|
+
await mkdir(outDir, { recursive: true });
|
|
12
|
+
await Promise.all(Object.entries(documents).map(([name, document]) => writeFile(`${outDir}${name}.schema.json`, `${JSON.stringify(document, null, 2)}\n`, "utf8")));
|
|
13
|
+
console.log(`generated ${Object.keys(documents).length} JSON Schemas in ${outDir}`);
|
|
14
|
+
//# sourceMappingURL=generate-json-schemas.js.map
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Story graph node types (contract section 4). */
|
|
3
|
+
export declare const STORY_NODE_TYPES: readonly ["premise", "arc", "part", "chapter", "scene", "beat", "custom"];
|
|
4
|
+
export type StoryNodeType = (typeof STORY_NODE_TYPES)[number];
|
|
5
|
+
/** `type: chapter` nodes carry the chapter's UUID (contract section 4). */
|
|
6
|
+
export declare const storyGraphChapterNodeSchema: z.ZodObject<{
|
|
7
|
+
type: z.ZodLiteral<"chapter">;
|
|
8
|
+
chapter_id: z.ZodString;
|
|
9
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
10
|
+
draft: "draft";
|
|
11
|
+
proposed: "proposed";
|
|
12
|
+
published: "published";
|
|
13
|
+
archived: "archived";
|
|
14
|
+
}>>;
|
|
15
|
+
id: z.ZodString;
|
|
16
|
+
title: z.ZodOptional<z.ZodString>;
|
|
17
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
18
|
+
parent: z.ZodOptional<z.ZodString>;
|
|
19
|
+
order: z.ZodNumber;
|
|
20
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
21
|
+
}, z.core.$strict>;
|
|
22
|
+
export type StoryGraphChapterNode = z.infer<typeof storyGraphChapterNodeSchema>;
|
|
23
|
+
/** All non-chapter node types; scene-style fields are optional. */
|
|
24
|
+
export declare const storyGraphStoryNodeSchema: z.ZodObject<{
|
|
25
|
+
type: z.ZodEnum<{
|
|
26
|
+
premise: "premise";
|
|
27
|
+
arc: "arc";
|
|
28
|
+
part: "part";
|
|
29
|
+
scene: "scene";
|
|
30
|
+
beat: "beat";
|
|
31
|
+
custom: "custom";
|
|
32
|
+
}>;
|
|
33
|
+
goal: z.ZodOptional<z.ZodString>;
|
|
34
|
+
conflict: z.ZodOptional<z.ZodString>;
|
|
35
|
+
outcome: z.ZodOptional<z.ZodString>;
|
|
36
|
+
id: z.ZodString;
|
|
37
|
+
title: z.ZodOptional<z.ZodString>;
|
|
38
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
39
|
+
parent: z.ZodOptional<z.ZodString>;
|
|
40
|
+
order: z.ZodNumber;
|
|
41
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
42
|
+
}, z.core.$strict>;
|
|
43
|
+
export type StoryGraphStoryNode = z.infer<typeof storyGraphStoryNodeSchema>;
|
|
44
|
+
export declare const storyGraphNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
45
|
+
type: z.ZodLiteral<"chapter">;
|
|
46
|
+
chapter_id: z.ZodString;
|
|
47
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
48
|
+
draft: "draft";
|
|
49
|
+
proposed: "proposed";
|
|
50
|
+
published: "published";
|
|
51
|
+
archived: "archived";
|
|
52
|
+
}>>;
|
|
53
|
+
id: z.ZodString;
|
|
54
|
+
title: z.ZodOptional<z.ZodString>;
|
|
55
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
56
|
+
parent: z.ZodOptional<z.ZodString>;
|
|
57
|
+
order: z.ZodNumber;
|
|
58
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
59
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
60
|
+
type: z.ZodEnum<{
|
|
61
|
+
premise: "premise";
|
|
62
|
+
arc: "arc";
|
|
63
|
+
part: "part";
|
|
64
|
+
scene: "scene";
|
|
65
|
+
beat: "beat";
|
|
66
|
+
custom: "custom";
|
|
67
|
+
}>;
|
|
68
|
+
goal: z.ZodOptional<z.ZodString>;
|
|
69
|
+
conflict: z.ZodOptional<z.ZodString>;
|
|
70
|
+
outcome: z.ZodOptional<z.ZodString>;
|
|
71
|
+
id: z.ZodString;
|
|
72
|
+
title: z.ZodOptional<z.ZodString>;
|
|
73
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
74
|
+
parent: z.ZodOptional<z.ZodString>;
|
|
75
|
+
order: z.ZodNumber;
|
|
76
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
77
|
+
}, z.core.$strict>], "type">;
|
|
78
|
+
export type StoryGraphNode = z.infer<typeof storyGraphNodeSchema>;
|
|
79
|
+
export declare const storyGraphLinkSchema: z.ZodObject<{
|
|
80
|
+
from: z.ZodString;
|
|
81
|
+
to: z.ZodString;
|
|
82
|
+
type: z.ZodString;
|
|
83
|
+
}, z.core.$strict>;
|
|
84
|
+
export type StoryGraphLink = z.infer<typeof storyGraphLinkSchema>;
|
|
85
|
+
/**
|
|
86
|
+
* Story graph `story/outline.yml` — `authorbot.story-graph/v1`
|
|
87
|
+
* (design section 8.5, contract section 4).
|
|
88
|
+
*/
|
|
89
|
+
export declare const storyGraphSchema: z.ZodObject<{
|
|
90
|
+
schema: z.ZodLiteral<"authorbot.story-graph/v1">;
|
|
91
|
+
nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
92
|
+
type: z.ZodLiteral<"chapter">;
|
|
93
|
+
chapter_id: z.ZodString;
|
|
94
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
95
|
+
draft: "draft";
|
|
96
|
+
proposed: "proposed";
|
|
97
|
+
published: "published";
|
|
98
|
+
archived: "archived";
|
|
99
|
+
}>>;
|
|
100
|
+
id: z.ZodString;
|
|
101
|
+
title: z.ZodOptional<z.ZodString>;
|
|
102
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
103
|
+
parent: z.ZodOptional<z.ZodString>;
|
|
104
|
+
order: z.ZodNumber;
|
|
105
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
106
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
107
|
+
type: z.ZodEnum<{
|
|
108
|
+
premise: "premise";
|
|
109
|
+
arc: "arc";
|
|
110
|
+
part: "part";
|
|
111
|
+
scene: "scene";
|
|
112
|
+
beat: "beat";
|
|
113
|
+
custom: "custom";
|
|
114
|
+
}>;
|
|
115
|
+
goal: z.ZodOptional<z.ZodString>;
|
|
116
|
+
conflict: z.ZodOptional<z.ZodString>;
|
|
117
|
+
outcome: z.ZodOptional<z.ZodString>;
|
|
118
|
+
id: z.ZodString;
|
|
119
|
+
title: z.ZodOptional<z.ZodString>;
|
|
120
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
121
|
+
parent: z.ZodOptional<z.ZodString>;
|
|
122
|
+
order: z.ZodNumber;
|
|
123
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
124
|
+
}, z.core.$strict>], "type">>;
|
|
125
|
+
links: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
126
|
+
from: z.ZodString;
|
|
127
|
+
to: z.ZodString;
|
|
128
|
+
type: z.ZodString;
|
|
129
|
+
}, z.core.$strict>>>;
|
|
130
|
+
}, z.core.$strict>;
|
|
131
|
+
export type StoryGraph = z.infer<typeof storyGraphSchema>;
|
|
132
|
+
//# sourceMappingURL=story-graph.d.ts.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { chapterStatusSchema } from "./chapter.js";
|
|
3
|
+
import { nodeIdSchema, uuidv7Schema } from "./primitives.js";
|
|
4
|
+
/** Story graph node types (contract section 4). */
|
|
5
|
+
export const STORY_NODE_TYPES = [
|
|
6
|
+
"premise",
|
|
7
|
+
"arc",
|
|
8
|
+
"part",
|
|
9
|
+
"chapter",
|
|
10
|
+
"scene",
|
|
11
|
+
"beat",
|
|
12
|
+
"custom",
|
|
13
|
+
];
|
|
14
|
+
const nodeCommonFields = {
|
|
15
|
+
id: nodeIdSchema,
|
|
16
|
+
title: z.string().min(1).optional(),
|
|
17
|
+
summary: z.string().optional(),
|
|
18
|
+
parent: nodeIdSchema.optional(),
|
|
19
|
+
order: z.number(),
|
|
20
|
+
/** Free-form template tags, e.g. for beat-sheet views (design section 8.5). */
|
|
21
|
+
tags: z.array(z.string().min(1)).optional(),
|
|
22
|
+
};
|
|
23
|
+
/** `type: chapter` nodes carry the chapter's UUID (contract section 4). */
|
|
24
|
+
export const storyGraphChapterNodeSchema = z.strictObject({
|
|
25
|
+
...nodeCommonFields,
|
|
26
|
+
type: z.literal("chapter"),
|
|
27
|
+
chapter_id: uuidv7Schema,
|
|
28
|
+
status: chapterStatusSchema.optional(),
|
|
29
|
+
});
|
|
30
|
+
/** All non-chapter node types; scene-style fields are optional. */
|
|
31
|
+
export const storyGraphStoryNodeSchema = z.strictObject({
|
|
32
|
+
...nodeCommonFields,
|
|
33
|
+
type: z.enum(["premise", "arc", "part", "scene", "beat", "custom"]),
|
|
34
|
+
goal: z.string().optional(),
|
|
35
|
+
conflict: z.string().optional(),
|
|
36
|
+
outcome: z.string().optional(),
|
|
37
|
+
});
|
|
38
|
+
export const storyGraphNodeSchema = z.discriminatedUnion("type", [
|
|
39
|
+
storyGraphChapterNodeSchema,
|
|
40
|
+
storyGraphStoryNodeSchema,
|
|
41
|
+
]);
|
|
42
|
+
export const storyGraphLinkSchema = z.strictObject({
|
|
43
|
+
from: nodeIdSchema,
|
|
44
|
+
to: nodeIdSchema,
|
|
45
|
+
type: z.string().min(1),
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* Story graph `story/outline.yml` — `authorbot.story-graph/v1`
|
|
49
|
+
* (design section 8.5, contract section 4).
|
|
50
|
+
*/
|
|
51
|
+
export const storyGraphSchema = z.strictObject({
|
|
52
|
+
schema: z.literal("authorbot.story-graph/v1"),
|
|
53
|
+
nodes: z.array(storyGraphNodeSchema),
|
|
54
|
+
links: z.array(storyGraphLinkSchema).optional(),
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=story-graph.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const timelineEventSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
sort_key: z.ZodNumber;
|
|
5
|
+
display_time: z.ZodString;
|
|
6
|
+
title: z.ZodString;
|
|
7
|
+
participants: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
8
|
+
locations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
9
|
+
chapter_refs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
10
|
+
facts: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
export type TimelineEvent = z.infer<typeof timelineEventSchema>;
|
|
13
|
+
/**
|
|
14
|
+
* Timeline `story/timeline.yml` — `authorbot.timeline/v1`
|
|
15
|
+
* (design section 8.6, contract section 4).
|
|
16
|
+
*/
|
|
17
|
+
export declare const timelineSchema: z.ZodObject<{
|
|
18
|
+
schema: z.ZodLiteral<"authorbot.timeline/v1">;
|
|
19
|
+
calendar: z.ZodOptional<z.ZodObject<{
|
|
20
|
+
type: z.ZodString;
|
|
21
|
+
epoch_label: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.core.$strict>>;
|
|
23
|
+
events: z.ZodArray<z.ZodObject<{
|
|
24
|
+
id: z.ZodString;
|
|
25
|
+
sort_key: z.ZodNumber;
|
|
26
|
+
display_time: z.ZodString;
|
|
27
|
+
title: z.ZodString;
|
|
28
|
+
participants: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
29
|
+
locations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
30
|
+
chapter_refs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
31
|
+
facts: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
32
|
+
}, z.core.$strict>>;
|
|
33
|
+
}, z.core.$strict>;
|
|
34
|
+
export type Timeline = z.infer<typeof timelineSchema>;
|
|
35
|
+
//# sourceMappingURL=timeline.d.ts.map
|
package/dist/timeline.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { nodeIdOf, uuidv7Schema } from "./primitives.js";
|
|
3
|
+
export const timelineEventSchema = z.strictObject({
|
|
4
|
+
id: nodeIdOf("event"),
|
|
5
|
+
sort_key: z.number(),
|
|
6
|
+
display_time: z.string().min(1),
|
|
7
|
+
title: z.string().min(1),
|
|
8
|
+
participants: z.array(nodeIdOf("character")).optional(),
|
|
9
|
+
locations: z.array(nodeIdOf("location")).optional(),
|
|
10
|
+
chapter_refs: z.array(uuidv7Schema).optional(),
|
|
11
|
+
facts: z.array(z.string().min(1)).optional(),
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* Timeline `story/timeline.yml` — `authorbot.timeline/v1`
|
|
15
|
+
* (design section 8.6, contract section 4).
|
|
16
|
+
*/
|
|
17
|
+
export const timelineSchema = z.strictObject({
|
|
18
|
+
schema: z.literal("authorbot.timeline/v1"),
|
|
19
|
+
calendar: z
|
|
20
|
+
.strictObject({
|
|
21
|
+
/** e.g. `absolute`, `relative`, or a custom calendar label. */
|
|
22
|
+
type: z.string().min(1),
|
|
23
|
+
epoch_label: z.string().min(1).optional(),
|
|
24
|
+
})
|
|
25
|
+
.optional(),
|
|
26
|
+
events: z.array(timelineEventSchema),
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=timeline.js.map
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Work item types (contract section 4). */
|
|
3
|
+
export declare const WORK_ITEM_TYPES: readonly ["revise_range", "revise_block", "revise_chapter", "write_chapter", "resolve_conflict", "planning"];
|
|
4
|
+
export declare const workItemTypeSchema: z.ZodEnum<{
|
|
5
|
+
revise_range: "revise_range";
|
|
6
|
+
revise_block: "revise_block";
|
|
7
|
+
revise_chapter: "revise_chapter";
|
|
8
|
+
write_chapter: "write_chapter";
|
|
9
|
+
resolve_conflict: "resolve_conflict";
|
|
10
|
+
planning: "planning";
|
|
11
|
+
}>;
|
|
12
|
+
export type WorkItemType = z.infer<typeof workItemTypeSchema>;
|
|
13
|
+
/** Work item states (contract section 4, design section 9.5). */
|
|
14
|
+
export declare const WORK_ITEM_STATUSES: readonly ["ready", "leased", "submitted", "applying", "completed", "conflict", "failed", "cancelled"];
|
|
15
|
+
export declare const workItemStatusSchema: z.ZodEnum<{
|
|
16
|
+
ready: "ready";
|
|
17
|
+
leased: "leased";
|
|
18
|
+
submitted: "submitted";
|
|
19
|
+
applying: "applying";
|
|
20
|
+
completed: "completed";
|
|
21
|
+
conflict: "conflict";
|
|
22
|
+
failed: "failed";
|
|
23
|
+
cancelled: "cancelled";
|
|
24
|
+
}>;
|
|
25
|
+
export type WorkItemStatus = z.infer<typeof workItemStatusSchema>;
|
|
26
|
+
export declare const WORK_ITEM_PRIORITIES: readonly ["low", "normal", "high"];
|
|
27
|
+
export declare const workItemPrioritySchema: z.ZodEnum<{
|
|
28
|
+
low: "low";
|
|
29
|
+
normal: "normal";
|
|
30
|
+
high: "high";
|
|
31
|
+
}>;
|
|
32
|
+
export type WorkItemPriority = z.infer<typeof workItemPrioritySchema>;
|
|
33
|
+
/**
|
|
34
|
+
* Work item frontmatter `.authorbot/work-items/<id>.md` —
|
|
35
|
+
* `authorbot.work-item/v1` (design section 13, contract section 4).
|
|
36
|
+
* Stable paths with status in frontmatter (contract ADR over design 8.1).
|
|
37
|
+
* `source_annotation_id`, `chapter_id`, and `base_revision` are optional at
|
|
38
|
+
* the schema level because `write_chapter` and `planning` items may lack
|
|
39
|
+
* them; per-type reference requirements are validator concerns
|
|
40
|
+
* (WORK_ITEM_REF_UNRESOLVED). Lease state never appears here (design 13).
|
|
41
|
+
*/
|
|
42
|
+
export declare const workItemSchema: z.ZodObject<{
|
|
43
|
+
schema: z.ZodLiteral<"authorbot.work-item/v1">;
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
type: z.ZodEnum<{
|
|
46
|
+
revise_range: "revise_range";
|
|
47
|
+
revise_block: "revise_block";
|
|
48
|
+
revise_chapter: "revise_chapter";
|
|
49
|
+
write_chapter: "write_chapter";
|
|
50
|
+
resolve_conflict: "resolve_conflict";
|
|
51
|
+
planning: "planning";
|
|
52
|
+
}>;
|
|
53
|
+
status: z.ZodEnum<{
|
|
54
|
+
ready: "ready";
|
|
55
|
+
leased: "leased";
|
|
56
|
+
submitted: "submitted";
|
|
57
|
+
applying: "applying";
|
|
58
|
+
completed: "completed";
|
|
59
|
+
conflict: "conflict";
|
|
60
|
+
failed: "failed";
|
|
61
|
+
cancelled: "cancelled";
|
|
62
|
+
}>;
|
|
63
|
+
source_annotation_id: z.ZodOptional<z.ZodString>;
|
|
64
|
+
chapter_id: z.ZodOptional<z.ZodString>;
|
|
65
|
+
base_revision: z.ZodOptional<z.ZodNumber>;
|
|
66
|
+
priority: z.ZodEnum<{
|
|
67
|
+
low: "low";
|
|
68
|
+
normal: "normal";
|
|
69
|
+
high: "high";
|
|
70
|
+
}>;
|
|
71
|
+
created_by: z.ZodString;
|
|
72
|
+
created_at: z.ZodString;
|
|
73
|
+
}, z.core.$strict>;
|
|
74
|
+
export type WorkItem = z.infer<typeof workItemSchema>;
|
|
75
|
+
//# sourceMappingURL=work-item.d.ts.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { actorRefSchema, timestampSchema, uuidv7Schema } from "./primitives.js";
|
|
3
|
+
/** Work item types (contract section 4). */
|
|
4
|
+
export const WORK_ITEM_TYPES = [
|
|
5
|
+
"revise_range",
|
|
6
|
+
"revise_block",
|
|
7
|
+
"revise_chapter",
|
|
8
|
+
"write_chapter",
|
|
9
|
+
"resolve_conflict",
|
|
10
|
+
"planning",
|
|
11
|
+
];
|
|
12
|
+
export const workItemTypeSchema = z.enum(WORK_ITEM_TYPES);
|
|
13
|
+
/** Work item states (contract section 4, design section 9.5). */
|
|
14
|
+
export const WORK_ITEM_STATUSES = [
|
|
15
|
+
"ready",
|
|
16
|
+
"leased",
|
|
17
|
+
"submitted",
|
|
18
|
+
"applying",
|
|
19
|
+
"completed",
|
|
20
|
+
"conflict",
|
|
21
|
+
"failed",
|
|
22
|
+
"cancelled",
|
|
23
|
+
];
|
|
24
|
+
export const workItemStatusSchema = z.enum(WORK_ITEM_STATUSES);
|
|
25
|
+
export const WORK_ITEM_PRIORITIES = ["low", "normal", "high"];
|
|
26
|
+
export const workItemPrioritySchema = z.enum(WORK_ITEM_PRIORITIES);
|
|
27
|
+
/**
|
|
28
|
+
* Work item frontmatter `.authorbot/work-items/<id>.md` —
|
|
29
|
+
* `authorbot.work-item/v1` (design section 13, contract section 4).
|
|
30
|
+
* Stable paths with status in frontmatter (contract ADR over design 8.1).
|
|
31
|
+
* `source_annotation_id`, `chapter_id`, and `base_revision` are optional at
|
|
32
|
+
* the schema level because `write_chapter` and `planning` items may lack
|
|
33
|
+
* them; per-type reference requirements are validator concerns
|
|
34
|
+
* (WORK_ITEM_REF_UNRESOLVED). Lease state never appears here (design 13).
|
|
35
|
+
*/
|
|
36
|
+
export const workItemSchema = z.strictObject({
|
|
37
|
+
schema: z.literal("authorbot.work-item/v1"),
|
|
38
|
+
id: uuidv7Schema,
|
|
39
|
+
type: workItemTypeSchema,
|
|
40
|
+
status: workItemStatusSchema,
|
|
41
|
+
source_annotation_id: uuidv7Schema.optional(),
|
|
42
|
+
chapter_id: uuidv7Schema.optional(),
|
|
43
|
+
base_revision: z.number().int().min(1).optional(),
|
|
44
|
+
priority: workItemPrioritySchema,
|
|
45
|
+
created_by: actorRefSchema,
|
|
46
|
+
created_at: timestampSchema,
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=work-item.js.map
|