@deskwork/core 0.12.1 → 0.14.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/dist/doctor/repair.d.ts.map +1 -1
- package/dist/doctor/repair.js +91 -4
- package/dist/doctor/repair.js.map +1 -1
- package/dist/doctor/validate.d.ts +1 -1
- package/dist/doctor/validate.d.ts.map +1 -1
- package/dist/doctor/validate.js +43 -0
- package/dist/doctor/validate.js.map +1 -1
- package/dist/entry/annotations.d.ts +42 -0
- package/dist/entry/annotations.d.ts.map +1 -0
- package/dist/entry/annotations.js +121 -0
- package/dist/entry/annotations.js.map +1 -0
- package/dist/iterate/history.d.ts +42 -0
- package/dist/iterate/history.d.ts.map +1 -0
- package/dist/iterate/history.js +64 -0
- package/dist/iterate/history.js.map +1 -0
- package/dist/review/pipeline.d.ts.map +1 -1
- package/dist/review/pipeline.js +11 -1
- package/dist/review/pipeline.js.map +1 -1
- package/dist/schema/draft-annotation.d.ts +171 -0
- package/dist/schema/draft-annotation.d.ts.map +1 -0
- package/dist/schema/draft-annotation.js +87 -0
- package/dist/schema/draft-annotation.js.map +1 -0
- package/dist/schema/entry.d.ts +12 -12
- package/dist/schema/journal-events.d.ts +291 -20
- package/dist/schema/journal-events.d.ts.map +1 -1
- package/dist/schema/journal-events.js +17 -0
- package/dist/schema/journal-events.js.map +1 -1
- package/package.json +9 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../src/review/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG3D,OAAO,EACL,WAAW,EACX,MAAM,GAEP,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,iBAA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M,IAAI,GAAsB,EAAE,CAAC;IACnC,KAAK,MAAM,KAAK,IAAI,WAAW,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,CAAC;QACrD,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY;YAAE,SAAS;QAC1C,MAAM,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC;QAC3B,IAAI,CAAC,CAAC,UAAU,KAAK,UAAU;YAAE,SAAS;QAC1C,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACb,SAAS;QACX,CAAC;QACD,MAAM,cAAc,GAClB,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC;YAC/C,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC;YAC/C,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC;YAC9C,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,CAAC,aAAa,KAAK,OAAO,CAAC,CAAC;QACrD,IAAI,cAAc;YAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,kEAAkE;AAClE,MAAM,UAAU,cAAc,CAE5B,OAAU;IACV,OAAO;QACL,GAAG,OAAO;QACV,EAAE,EAAE,UAAU,EAAE;QAChB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACpC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema mirror of `DraftAnnotation` from `../review/types.ts`.
|
|
3
|
+
*
|
|
4
|
+
* The TS interface union in `review/types.ts` is the source of truth for
|
|
5
|
+
* the *shape*. This file provides a runtime validator for the same shape
|
|
6
|
+
* so journal events carrying a `DraftAnnotation` payload can be parsed
|
|
7
|
+
* via `JournalEventSchema.safeParse` at the read boundary.
|
|
8
|
+
*
|
|
9
|
+
* The union variants here mirror `CommentAnnotation | EditAnnotation |
|
|
10
|
+
* ApproveAnnotation | RejectAnnotation | ResolveAnnotation |
|
|
11
|
+
* AddressAnnotation`. If a new variant is added there, mirror it here.
|
|
12
|
+
*/
|
|
13
|
+
import { z } from 'zod';
|
|
14
|
+
export declare const DraftAnnotationSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
15
|
+
type: z.ZodLiteral<"comment">;
|
|
16
|
+
version: z.ZodNumber;
|
|
17
|
+
range: z.ZodObject<{
|
|
18
|
+
start: z.ZodNumber;
|
|
19
|
+
end: z.ZodNumber;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
start: number;
|
|
22
|
+
end: number;
|
|
23
|
+
}, {
|
|
24
|
+
start: number;
|
|
25
|
+
end: number;
|
|
26
|
+
}>;
|
|
27
|
+
text: z.ZodString;
|
|
28
|
+
category: z.ZodOptional<z.ZodEnum<["voice-drift", "missing-receipt", "tutorial-framing", "saas-vocabulary", "fake-authority", "structural", "other"]>>;
|
|
29
|
+
anchor: z.ZodOptional<z.ZodString>;
|
|
30
|
+
createdAt: z.ZodString;
|
|
31
|
+
workflowId: z.ZodString;
|
|
32
|
+
id: z.ZodString;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
type: "comment";
|
|
35
|
+
version: number;
|
|
36
|
+
range: {
|
|
37
|
+
start: number;
|
|
38
|
+
end: number;
|
|
39
|
+
};
|
|
40
|
+
text: string;
|
|
41
|
+
createdAt: string;
|
|
42
|
+
workflowId: string;
|
|
43
|
+
id: string;
|
|
44
|
+
category?: "voice-drift" | "missing-receipt" | "tutorial-framing" | "saas-vocabulary" | "fake-authority" | "structural" | "other" | undefined;
|
|
45
|
+
anchor?: string | undefined;
|
|
46
|
+
}, {
|
|
47
|
+
type: "comment";
|
|
48
|
+
version: number;
|
|
49
|
+
range: {
|
|
50
|
+
start: number;
|
|
51
|
+
end: number;
|
|
52
|
+
};
|
|
53
|
+
text: string;
|
|
54
|
+
createdAt: string;
|
|
55
|
+
workflowId: string;
|
|
56
|
+
id: string;
|
|
57
|
+
category?: "voice-drift" | "missing-receipt" | "tutorial-framing" | "saas-vocabulary" | "fake-authority" | "structural" | "other" | undefined;
|
|
58
|
+
anchor?: string | undefined;
|
|
59
|
+
}>, z.ZodObject<{
|
|
60
|
+
type: z.ZodLiteral<"edit">;
|
|
61
|
+
beforeVersion: z.ZodNumber;
|
|
62
|
+
afterMarkdown: z.ZodString;
|
|
63
|
+
diff: z.ZodString;
|
|
64
|
+
createdAt: z.ZodString;
|
|
65
|
+
workflowId: z.ZodString;
|
|
66
|
+
id: z.ZodString;
|
|
67
|
+
}, "strip", z.ZodTypeAny, {
|
|
68
|
+
type: "edit";
|
|
69
|
+
createdAt: string;
|
|
70
|
+
workflowId: string;
|
|
71
|
+
id: string;
|
|
72
|
+
beforeVersion: number;
|
|
73
|
+
afterMarkdown: string;
|
|
74
|
+
diff: string;
|
|
75
|
+
}, {
|
|
76
|
+
type: "edit";
|
|
77
|
+
createdAt: string;
|
|
78
|
+
workflowId: string;
|
|
79
|
+
id: string;
|
|
80
|
+
beforeVersion: number;
|
|
81
|
+
afterMarkdown: string;
|
|
82
|
+
diff: string;
|
|
83
|
+
}>, z.ZodObject<{
|
|
84
|
+
type: z.ZodLiteral<"approve">;
|
|
85
|
+
version: z.ZodNumber;
|
|
86
|
+
createdAt: z.ZodString;
|
|
87
|
+
workflowId: z.ZodString;
|
|
88
|
+
id: z.ZodString;
|
|
89
|
+
}, "strip", z.ZodTypeAny, {
|
|
90
|
+
type: "approve";
|
|
91
|
+
version: number;
|
|
92
|
+
createdAt: string;
|
|
93
|
+
workflowId: string;
|
|
94
|
+
id: string;
|
|
95
|
+
}, {
|
|
96
|
+
type: "approve";
|
|
97
|
+
version: number;
|
|
98
|
+
createdAt: string;
|
|
99
|
+
workflowId: string;
|
|
100
|
+
id: string;
|
|
101
|
+
}>, z.ZodObject<{
|
|
102
|
+
type: z.ZodLiteral<"reject">;
|
|
103
|
+
version: z.ZodNumber;
|
|
104
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
105
|
+
createdAt: z.ZodString;
|
|
106
|
+
workflowId: z.ZodString;
|
|
107
|
+
id: z.ZodString;
|
|
108
|
+
}, "strip", z.ZodTypeAny, {
|
|
109
|
+
type: "reject";
|
|
110
|
+
version: number;
|
|
111
|
+
createdAt: string;
|
|
112
|
+
workflowId: string;
|
|
113
|
+
id: string;
|
|
114
|
+
reason?: string | undefined;
|
|
115
|
+
}, {
|
|
116
|
+
type: "reject";
|
|
117
|
+
version: number;
|
|
118
|
+
createdAt: string;
|
|
119
|
+
workflowId: string;
|
|
120
|
+
id: string;
|
|
121
|
+
reason?: string | undefined;
|
|
122
|
+
}>, z.ZodObject<{
|
|
123
|
+
type: z.ZodLiteral<"resolve">;
|
|
124
|
+
commentId: z.ZodString;
|
|
125
|
+
resolved: z.ZodBoolean;
|
|
126
|
+
createdAt: z.ZodString;
|
|
127
|
+
workflowId: z.ZodString;
|
|
128
|
+
id: z.ZodString;
|
|
129
|
+
}, "strip", z.ZodTypeAny, {
|
|
130
|
+
type: "resolve";
|
|
131
|
+
createdAt: string;
|
|
132
|
+
workflowId: string;
|
|
133
|
+
id: string;
|
|
134
|
+
commentId: string;
|
|
135
|
+
resolved: boolean;
|
|
136
|
+
}, {
|
|
137
|
+
type: "resolve";
|
|
138
|
+
createdAt: string;
|
|
139
|
+
workflowId: string;
|
|
140
|
+
id: string;
|
|
141
|
+
commentId: string;
|
|
142
|
+
resolved: boolean;
|
|
143
|
+
}>, z.ZodObject<{
|
|
144
|
+
type: z.ZodLiteral<"address">;
|
|
145
|
+
commentId: z.ZodString;
|
|
146
|
+
version: z.ZodNumber;
|
|
147
|
+
disposition: z.ZodEnum<["addressed", "deferred", "wontfix"]>;
|
|
148
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
149
|
+
createdAt: z.ZodString;
|
|
150
|
+
workflowId: z.ZodString;
|
|
151
|
+
id: z.ZodString;
|
|
152
|
+
}, "strip", z.ZodTypeAny, {
|
|
153
|
+
type: "address";
|
|
154
|
+
version: number;
|
|
155
|
+
createdAt: string;
|
|
156
|
+
workflowId: string;
|
|
157
|
+
id: string;
|
|
158
|
+
commentId: string;
|
|
159
|
+
disposition: "addressed" | "deferred" | "wontfix";
|
|
160
|
+
reason?: string | undefined;
|
|
161
|
+
}, {
|
|
162
|
+
type: "address";
|
|
163
|
+
version: number;
|
|
164
|
+
createdAt: string;
|
|
165
|
+
workflowId: string;
|
|
166
|
+
id: string;
|
|
167
|
+
commentId: string;
|
|
168
|
+
disposition: "addressed" | "deferred" | "wontfix";
|
|
169
|
+
reason?: string | undefined;
|
|
170
|
+
}>]>;
|
|
171
|
+
//# sourceMappingURL=draft-annotation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft-annotation.d.ts","sourceRoot":"","sources":["../../src/schema/draft-annotation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA4ExB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAOhC,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema mirror of `DraftAnnotation` from `../review/types.ts`.
|
|
3
|
+
*
|
|
4
|
+
* The TS interface union in `review/types.ts` is the source of truth for
|
|
5
|
+
* the *shape*. This file provides a runtime validator for the same shape
|
|
6
|
+
* so journal events carrying a `DraftAnnotation` payload can be parsed
|
|
7
|
+
* via `JournalEventSchema.safeParse` at the read boundary.
|
|
8
|
+
*
|
|
9
|
+
* The union variants here mirror `CommentAnnotation | EditAnnotation |
|
|
10
|
+
* ApproveAnnotation | RejectAnnotation | ResolveAnnotation |
|
|
11
|
+
* AddressAnnotation`. If a new variant is added there, mirror it here.
|
|
12
|
+
*/
|
|
13
|
+
import { z } from 'zod';
|
|
14
|
+
const AnnotationCategoryEnum = z.enum([
|
|
15
|
+
'voice-drift',
|
|
16
|
+
'missing-receipt',
|
|
17
|
+
'tutorial-framing',
|
|
18
|
+
'saas-vocabulary',
|
|
19
|
+
'fake-authority',
|
|
20
|
+
'structural',
|
|
21
|
+
'other',
|
|
22
|
+
]);
|
|
23
|
+
const RangeSchema = z.object({
|
|
24
|
+
start: z.number().int().nonnegative(),
|
|
25
|
+
end: z.number().int().nonnegative(),
|
|
26
|
+
});
|
|
27
|
+
const BaseFields = {
|
|
28
|
+
/** ISO-8601 timestamp when the annotation was recorded. */
|
|
29
|
+
createdAt: z.string().datetime(),
|
|
30
|
+
/** Workflow the annotation belongs to (legacy field; entry-keyed
|
|
31
|
+
* annotations still carry it for type compatibility with the
|
|
32
|
+
* workflow-keyed `DraftAnnotation` union, but the entry-store does
|
|
33
|
+
* not key off it). */
|
|
34
|
+
workflowId: z.string(),
|
|
35
|
+
/** Server-assigned id. */
|
|
36
|
+
id: z.string(),
|
|
37
|
+
};
|
|
38
|
+
const CommentAnnotation = z.object({
|
|
39
|
+
...BaseFields,
|
|
40
|
+
type: z.literal('comment'),
|
|
41
|
+
version: z.number().int(),
|
|
42
|
+
range: RangeSchema,
|
|
43
|
+
text: z.string(),
|
|
44
|
+
category: AnnotationCategoryEnum.optional(),
|
|
45
|
+
anchor: z.string().optional(),
|
|
46
|
+
});
|
|
47
|
+
const EditAnnotation = z.object({
|
|
48
|
+
...BaseFields,
|
|
49
|
+
type: z.literal('edit'),
|
|
50
|
+
beforeVersion: z.number().int(),
|
|
51
|
+
afterMarkdown: z.string(),
|
|
52
|
+
diff: z.string(),
|
|
53
|
+
});
|
|
54
|
+
const ApproveAnnotation = z.object({
|
|
55
|
+
...BaseFields,
|
|
56
|
+
type: z.literal('approve'),
|
|
57
|
+
version: z.number().int(),
|
|
58
|
+
});
|
|
59
|
+
const RejectAnnotation = z.object({
|
|
60
|
+
...BaseFields,
|
|
61
|
+
type: z.literal('reject'),
|
|
62
|
+
version: z.number().int(),
|
|
63
|
+
reason: z.string().optional(),
|
|
64
|
+
});
|
|
65
|
+
const ResolveAnnotation = z.object({
|
|
66
|
+
...BaseFields,
|
|
67
|
+
type: z.literal('resolve'),
|
|
68
|
+
commentId: z.string(),
|
|
69
|
+
resolved: z.boolean(),
|
|
70
|
+
});
|
|
71
|
+
const AddressAnnotation = z.object({
|
|
72
|
+
...BaseFields,
|
|
73
|
+
type: z.literal('address'),
|
|
74
|
+
commentId: z.string(),
|
|
75
|
+
version: z.number().int(),
|
|
76
|
+
disposition: z.enum(['addressed', 'deferred', 'wontfix']),
|
|
77
|
+
reason: z.string().optional(),
|
|
78
|
+
});
|
|
79
|
+
export const DraftAnnotationSchema = z.discriminatedUnion('type', [
|
|
80
|
+
CommentAnnotation,
|
|
81
|
+
EditAnnotation,
|
|
82
|
+
ApproveAnnotation,
|
|
83
|
+
RejectAnnotation,
|
|
84
|
+
ResolveAnnotation,
|
|
85
|
+
AddressAnnotation,
|
|
86
|
+
]);
|
|
87
|
+
//# sourceMappingURL=draft-annotation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft-annotation.js","sourceRoot":"","sources":["../../src/schema/draft-annotation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC;IACpC,aAAa;IACb,iBAAiB;IACjB,kBAAkB;IAClB,iBAAiB;IACjB,gBAAgB;IAChB,YAAY;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are const EntrySchema: z.ZodObject<{
|
|
|
22
22
|
createdAt: z.ZodString;
|
|
23
23
|
updatedAt: z.ZodString;
|
|
24
24
|
}, "strip", z.ZodTypeAny, {
|
|
25
|
-
|
|
25
|
+
source: string;
|
|
26
26
|
slug: string;
|
|
27
27
|
title: string;
|
|
28
|
+
uuid: string;
|
|
28
29
|
keywords: string[];
|
|
29
|
-
source: string;
|
|
30
|
-
currentStage: "Ideas" | "Planned" | "Outlining" | "Drafting" | "Final" | "Published" | "Blocked" | "Cancelled";
|
|
31
|
-
iterationByStage: Partial<Record<"Ideas" | "Planned" | "Outlining" | "Drafting" | "Final" | "Published" | "Blocked" | "Cancelled", number>>;
|
|
32
30
|
createdAt: string;
|
|
31
|
+
currentStage: "Ideas" | "Planned" | "Outlining" | "Drafting" | "Published" | "Final" | "Blocked" | "Cancelled";
|
|
32
|
+
iterationByStage: Partial<Record<"Ideas" | "Planned" | "Outlining" | "Drafting" | "Published" | "Final" | "Blocked" | "Cancelled", number>>;
|
|
33
33
|
updatedAt: string;
|
|
34
34
|
description?: string | undefined;
|
|
35
|
-
|
|
35
|
+
datePublished?: string | undefined;
|
|
36
|
+
priorStage?: "Ideas" | "Planned" | "Outlining" | "Drafting" | "Published" | "Final" | "Blocked" | "Cancelled" | undefined;
|
|
36
37
|
reviewState?: "in-review" | "iterating" | "approved" | undefined;
|
|
37
38
|
targetVersion?: string | undefined;
|
|
38
|
-
datePublished?: string | undefined;
|
|
39
39
|
artifactPath?: string | undefined;
|
|
40
40
|
shortformWorkflows?: Record<string, string> | undefined;
|
|
41
41
|
}, {
|
|
42
|
-
|
|
42
|
+
source: string;
|
|
43
43
|
slug: string;
|
|
44
44
|
title: string;
|
|
45
|
+
uuid: string;
|
|
45
46
|
keywords: string[];
|
|
46
|
-
source: string;
|
|
47
|
-
currentStage: "Ideas" | "Planned" | "Outlining" | "Drafting" | "Final" | "Published" | "Blocked" | "Cancelled";
|
|
48
|
-
iterationByStage: Partial<Record<"Ideas" | "Planned" | "Outlining" | "Drafting" | "Final" | "Published" | "Blocked" | "Cancelled", number>>;
|
|
49
47
|
createdAt: string;
|
|
48
|
+
currentStage: "Ideas" | "Planned" | "Outlining" | "Drafting" | "Published" | "Final" | "Blocked" | "Cancelled";
|
|
49
|
+
iterationByStage: Partial<Record<"Ideas" | "Planned" | "Outlining" | "Drafting" | "Published" | "Final" | "Blocked" | "Cancelled", number>>;
|
|
50
50
|
updatedAt: string;
|
|
51
51
|
description?: string | undefined;
|
|
52
|
-
|
|
52
|
+
datePublished?: string | undefined;
|
|
53
|
+
priorStage?: "Ideas" | "Planned" | "Outlining" | "Drafting" | "Published" | "Final" | "Blocked" | "Cancelled" | undefined;
|
|
53
54
|
reviewState?: "in-review" | "iterating" | "approved" | undefined;
|
|
54
55
|
targetVersion?: string | undefined;
|
|
55
|
-
datePublished?: string | undefined;
|
|
56
56
|
artifactPath?: string | undefined;
|
|
57
57
|
shortformWorkflows?: Record<string, string> | undefined;
|
|
58
58
|
}>;
|