@coldtea/pr-lens-schema 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/README.md +150 -0
- package/dist/apply.d.ts +42 -0
- package/dist/apply.d.ts.map +1 -0
- package/dist/apply.js +315 -0
- package/dist/apply.js.map +1 -0
- package/dist/config.d.ts +58 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +61 -0
- package/dist/config.js.map +1 -0
- package/dist/errors.d.ts +24 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +12 -0
- package/dist/errors.js.map +1 -0
- package/dist/examples/baseline.d.ts +18 -0
- package/dist/examples/baseline.d.ts.map +1 -0
- package/dist/examples/baseline.js +433 -0
- package/dist/examples/baseline.js.map +1 -0
- package/dist/examples/index.d.ts +1194 -0
- package/dist/examples/index.d.ts.map +1 -0
- package/dist/examples/index.js +20 -0
- package/dist/examples/index.js.map +1 -0
- package/dist/examples/minimal.d.ts +4 -0
- package/dist/examples/minimal.d.ts.map +1 -0
- package/dist/examples/minimal.js +25 -0
- package/dist/examples/minimal.js.map +1 -0
- package/dist/examples/postmark-refactor.d.ts +16 -0
- package/dist/examples/postmark-refactor.d.ts.map +1 -0
- package/dist/examples/postmark-refactor.js +468 -0
- package/dist/examples/postmark-refactor.js.map +1 -0
- package/dist/graph.d.ts +568 -0
- package/dist/graph.d.ts.map +1 -0
- package/dist/graph.js +266 -0
- package/dist/graph.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/integrity.d.ts +20 -0
- package/dist/integrity.d.ts.map +1 -0
- package/dist/integrity.js +167 -0
- package/dist/integrity.js.map +1 -0
- package/dist/manifest.d.ts +65 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +60 -0
- package/dist/manifest.js.map +1 -0
- package/dist/patch.d.ts +824 -0
- package/dist/patch.d.ts.map +1 -0
- package/dist/patch.js +84 -0
- package/dist/patch.js.map +1 -0
- package/dist/primitives.d.ts +92 -0
- package/dist/primitives.d.ts.map +1 -0
- package/dist/primitives.js +120 -0
- package/dist/primitives.js.map +1 -0
- package/dist/utils.d.ts +6 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +8 -0
- package/dist/utils.js.map +1 -0
- package/dist/validate.d.ts +18 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/validate.js +95 -0
- package/dist/validate.js.map +1 -0
- package/dist/version.d.ts +21 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +24 -0
- package/dist/version.js.map +1 -0
- package/examples/broadcast-baseline.graph.json +289 -0
- package/examples/broadcast-baseline.patch.json +321 -0
- package/examples/minimal.graph.json +45 -0
- package/examples/postmark-refactor.graph.json +580 -0
- package/examples/postmark-refactor.render-manifest.json +67 -0
- package/examples/pr-lens.config.json +32 -0
- package/json-schema/config.schema.json +153 -0
- package/json-schema/graph-doc.schema.json +1032 -0
- package/json-schema/patch-doc.schema.json +1383 -0
- package/json-schema/render-manifest.schema.json +183 -0
- package/package.json +66 -0
- package/src/apply.ts +399 -0
- package/src/config.ts +69 -0
- package/src/errors.ts +34 -0
- package/src/examples/baseline.ts +437 -0
- package/src/examples/index.ts +25 -0
- package/src/examples/minimal.ts +26 -0
- package/src/examples/postmark-refactor.ts +480 -0
- package/src/graph.ts +331 -0
- package/src/index.ts +82 -0
- package/src/integrity.ts +216 -0
- package/src/manifest.ts +64 -0
- package/src/patch.ts +100 -0
- package/src/primitives.ts +146 -0
- package/src/utils.ts +7 -0
- package/src/validate.ts +132 -0
- package/src/version.ts +31 -0
package/dist/graph.js
ADDED
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { Delta, FileRef, Id, Label, Lens, SchemaVersionField, Sha, Summary } from "./primitives.js";
|
|
3
|
+
/**
|
|
4
|
+
* Coarse on purpose: this drives the card icon and shape, never analysis.
|
|
5
|
+
* Anything that does not fit is `other`, which still renders.
|
|
6
|
+
*/
|
|
7
|
+
export const NodeKind = z.enum([
|
|
8
|
+
"service",
|
|
9
|
+
"app",
|
|
10
|
+
"module",
|
|
11
|
+
"function",
|
|
12
|
+
"route",
|
|
13
|
+
"job",
|
|
14
|
+
"queue",
|
|
15
|
+
"datastore",
|
|
16
|
+
"cache",
|
|
17
|
+
"external",
|
|
18
|
+
"ui",
|
|
19
|
+
"config",
|
|
20
|
+
"test",
|
|
21
|
+
"package",
|
|
22
|
+
"other",
|
|
23
|
+
]);
|
|
24
|
+
export const Lane = z
|
|
25
|
+
.strictObject({
|
|
26
|
+
id: Id,
|
|
27
|
+
label: Label,
|
|
28
|
+
subtitle: Label.optional().describe("Secondary line in the lane header, e.g. the platform."),
|
|
29
|
+
order: z
|
|
30
|
+
.int()
|
|
31
|
+
.min(0)
|
|
32
|
+
.max(64)
|
|
33
|
+
.optional()
|
|
34
|
+
.describe("Left-to-right placement. Ties fall back to array order."),
|
|
35
|
+
delta: Delta.optional().describe("Set only when the lane itself is new or gone."),
|
|
36
|
+
summary: Summary.optional(),
|
|
37
|
+
})
|
|
38
|
+
.describe("A grouping band of the diagram. Every node belongs to exactly one lane.");
|
|
39
|
+
export const GraphNode = z
|
|
40
|
+
.strictObject({
|
|
41
|
+
id: Id,
|
|
42
|
+
label: Label,
|
|
43
|
+
kind: NodeKind,
|
|
44
|
+
delta: Delta,
|
|
45
|
+
lane: Id.describe("Id of the lane this node sits in."),
|
|
46
|
+
group: Id.optional().describe("Optional sub-cluster within the lane, e.g. a package."),
|
|
47
|
+
subtitle: Label.optional().describe("Secondary line on the card, e.g. a symbol signature."),
|
|
48
|
+
summary: Summary.optional().describe("Body text for this node's drill-down section."),
|
|
49
|
+
files: z
|
|
50
|
+
.array(FileRef)
|
|
51
|
+
.max(64)
|
|
52
|
+
.default([])
|
|
53
|
+
.describe("Backing source locations, used to build diff permalinks."),
|
|
54
|
+
badges: z
|
|
55
|
+
.array(Label)
|
|
56
|
+
.max(6)
|
|
57
|
+
.default([])
|
|
58
|
+
.describe("Extra chips on the card, beyond the delta badge the renderer adds."),
|
|
59
|
+
})
|
|
60
|
+
.describe("A node in the architecture graph.");
|
|
61
|
+
export const EdgeKind = z.enum([
|
|
62
|
+
"call",
|
|
63
|
+
"http",
|
|
64
|
+
"rpc",
|
|
65
|
+
"event",
|
|
66
|
+
"queue",
|
|
67
|
+
"data",
|
|
68
|
+
"dependency",
|
|
69
|
+
"render",
|
|
70
|
+
"other",
|
|
71
|
+
]);
|
|
72
|
+
/**
|
|
73
|
+
* `hero` is the one connection the change is really about. More than a couple
|
|
74
|
+
* per diagram and the emphasis stops meaning anything.
|
|
75
|
+
*/
|
|
76
|
+
export const EdgeEmphasis = z.enum(["normal", "hero", "muted"]);
|
|
77
|
+
export const GraphEdge = z
|
|
78
|
+
.strictObject({
|
|
79
|
+
id: Id,
|
|
80
|
+
from: Id.describe("Source node id."),
|
|
81
|
+
to: Id.describe("Target node id."),
|
|
82
|
+
kind: EdgeKind,
|
|
83
|
+
delta: Delta,
|
|
84
|
+
label: Label.optional().describe("Text on the edge, e.g. a payload size or protocol."),
|
|
85
|
+
emphasis: EdgeEmphasis.default("normal"),
|
|
86
|
+
animated: z
|
|
87
|
+
.boolean()
|
|
88
|
+
.default(false)
|
|
89
|
+
.describe("Render a travelling pulse along this edge in the architecture lens."),
|
|
90
|
+
summary: Summary.optional(),
|
|
91
|
+
files: z.array(FileRef).max(32).default([]),
|
|
92
|
+
})
|
|
93
|
+
.describe("A directed connection between two nodes.");
|
|
94
|
+
/** `async` fires and forgets, `return` carries a result back, `self` never leaves the participant. */
|
|
95
|
+
export const MessageKind = z.enum(["sync", "async", "return", "self"]);
|
|
96
|
+
/**
|
|
97
|
+
* Order is the array position. An explicit step number would let a producer
|
|
98
|
+
* emit a document whose animation order disagrees with its own message list.
|
|
99
|
+
*/
|
|
100
|
+
export const FlowMessage = z
|
|
101
|
+
.strictObject({
|
|
102
|
+
id: Id,
|
|
103
|
+
from: Id.describe("Participant node id the message originates from."),
|
|
104
|
+
to: Id.describe("Participant node id the message arrives at. Equals `from` when kind is self."),
|
|
105
|
+
label: Label,
|
|
106
|
+
kind: MessageKind.default("sync"),
|
|
107
|
+
delta: Delta,
|
|
108
|
+
animated: z.boolean().default(true).describe("Whether the data-flow lens pulses this step."),
|
|
109
|
+
repeat: z
|
|
110
|
+
.int()
|
|
111
|
+
.min(1)
|
|
112
|
+
.max(1_000_000)
|
|
113
|
+
.optional()
|
|
114
|
+
.describe("Times the step occurs per run, e.g. 4 batched requests."),
|
|
115
|
+
note: Summary.optional().describe("Aside rendered beside the step in the drill-down."),
|
|
116
|
+
files: z.array(FileRef).max(32).default([]),
|
|
117
|
+
})
|
|
118
|
+
.refine((message) => (message.kind === "self") === (message.from === message.to), {
|
|
119
|
+
message: "kind 'self' and from === to must agree",
|
|
120
|
+
path: ["kind"],
|
|
121
|
+
})
|
|
122
|
+
.describe("One ordered step in a flow.");
|
|
123
|
+
export const FlowParticipant = z
|
|
124
|
+
.strictObject({
|
|
125
|
+
node: Id.describe("Id of the graph node this column represents."),
|
|
126
|
+
label: Label.optional().describe("Shorter name for the column when the node label is long."),
|
|
127
|
+
})
|
|
128
|
+
.describe("A column in the sequence diagram, ordered by array position.");
|
|
129
|
+
export const Flow = z
|
|
130
|
+
.strictObject({
|
|
131
|
+
id: Id,
|
|
132
|
+
title: Label,
|
|
133
|
+
summary: Summary.optional(),
|
|
134
|
+
delta: Delta.default("modified"),
|
|
135
|
+
participants: z.array(FlowParticipant).min(2).max(12),
|
|
136
|
+
messages: z.array(FlowMessage).min(1).max(64).describe("Ordered by array position."),
|
|
137
|
+
})
|
|
138
|
+
.describe("An ordered message sequence for the data-flow lens.");
|
|
139
|
+
export const StatChip = z
|
|
140
|
+
.strictObject({
|
|
141
|
+
label: Label,
|
|
142
|
+
value: z.string().min(1).max(32),
|
|
143
|
+
tone: z.enum(["neutral", "added", "modified", "removed", "hero"]).default("neutral"),
|
|
144
|
+
})
|
|
145
|
+
.describe("A headline chip above the diagram.");
|
|
146
|
+
/**
|
|
147
|
+
* Counts that cannot be derived from the document, plus free-form chips.
|
|
148
|
+
* Per-delta element counts are deliberately absent: they are derivable, and a
|
|
149
|
+
* stored copy can only ever go stale against the node and edge lists.
|
|
150
|
+
*/
|
|
151
|
+
export const Stats = z
|
|
152
|
+
.strictObject({
|
|
153
|
+
filesChanged: z.int().min(0).optional(),
|
|
154
|
+
additions: z.int().min(0).optional().describe("Lines added across the diff."),
|
|
155
|
+
deletions: z.int().min(0).optional().describe("Lines removed across the diff."),
|
|
156
|
+
chips: z.array(StatChip).max(8).default([]),
|
|
157
|
+
})
|
|
158
|
+
.describe("Headline numbers for the comment header.");
|
|
159
|
+
/**
|
|
160
|
+
* A view either shows the whole document or a named selection. The two are
|
|
161
|
+
* distinct states rather than "a selection that happens to be empty", so
|
|
162
|
+
* removing the last element a view pointed at can never silently turn it into
|
|
163
|
+
* a view of everything.
|
|
164
|
+
*/
|
|
165
|
+
export const ViewScope = z
|
|
166
|
+
.discriminatedUnion("kind", [
|
|
167
|
+
z.strictObject({ kind: z.literal("all") }),
|
|
168
|
+
z
|
|
169
|
+
.strictObject({
|
|
170
|
+
kind: z.literal("selection"),
|
|
171
|
+
lanes: z.array(Id).max(64).default([]),
|
|
172
|
+
nodes: z.array(Id).max(256).default([]),
|
|
173
|
+
edges: z.array(Id).max(512).default([]),
|
|
174
|
+
flows: z.array(Id).max(32).default([]),
|
|
175
|
+
})
|
|
176
|
+
.meta({
|
|
177
|
+
anyOf: [
|
|
178
|
+
{ properties: { lanes: { minItems: 1 } }, required: ["lanes"] },
|
|
179
|
+
{ properties: { nodes: { minItems: 1 } }, required: ["nodes"] },
|
|
180
|
+
{ properties: { edges: { minItems: 1 } }, required: ["edges"] },
|
|
181
|
+
{ properties: { flows: { minItems: 1 } }, required: ["flows"] },
|
|
182
|
+
],
|
|
183
|
+
})
|
|
184
|
+
.refine((scope) => scope.lanes.length + scope.nodes.length + scope.edges.length + scope.flows.length > 0, { message: "a selection must name at least one element" }),
|
|
185
|
+
])
|
|
186
|
+
.describe("What a drill-down section shows.");
|
|
187
|
+
export const View = z.lazy(() => z
|
|
188
|
+
.strictObject({
|
|
189
|
+
id: Id,
|
|
190
|
+
title: Label,
|
|
191
|
+
lens: Lens,
|
|
192
|
+
summary: Summary.optional(),
|
|
193
|
+
scope: ViewScope.default({ kind: "all" }),
|
|
194
|
+
defaultOpen: z.boolean().default(false),
|
|
195
|
+
children: z.array(View).max(32).default([]),
|
|
196
|
+
})
|
|
197
|
+
.describe("A drill-down section; children nest as further <details> blocks."));
|
|
198
|
+
/**
|
|
199
|
+
* Hints, not instructions: the renderer owns final placement so that layout
|
|
200
|
+
* stays deterministic for a given document. A hint is a floor rather than an
|
|
201
|
+
* answer — it can push a node further down the page, never above something
|
|
202
|
+
* that feeds it — so a stale hint can leave a gap but can never invert an
|
|
203
|
+
* edge. Absolute coordinates are intentionally not expressible.
|
|
204
|
+
*/
|
|
205
|
+
export const LayoutHints = z
|
|
206
|
+
.strictObject({
|
|
207
|
+
direction: z.enum(["right", "down"]).default("right").describe("Primary flow direction."),
|
|
208
|
+
laneOrder: z.array(Id).max(64).default([]).describe("Explicit left-to-right lane order."),
|
|
209
|
+
rank: z.record(Id, z.int().min(0).max(256)).optional().describe("Preferred layer index per node id."),
|
|
210
|
+
})
|
|
211
|
+
.describe("Optional, non-binding placement hints.");
|
|
212
|
+
/** Everything needed to rebuild a permalink to any file this document points at. */
|
|
213
|
+
export const Provenance = z
|
|
214
|
+
.strictObject({
|
|
215
|
+
repo: z.strictObject({
|
|
216
|
+
owner: z.string().min(1).max(64),
|
|
217
|
+
name: z.string().min(1).max(128),
|
|
218
|
+
host: z.string().min(1).max(128).default("github.com"),
|
|
219
|
+
}),
|
|
220
|
+
base: z.strictObject({ sha: Sha, ref: z.string().min(1).max(255).optional() }),
|
|
221
|
+
head: z.strictObject({ sha: Sha, ref: z.string().min(1).max(255).optional() }),
|
|
222
|
+
pullRequest: z
|
|
223
|
+
.strictObject({
|
|
224
|
+
number: z.int().min(1),
|
|
225
|
+
title: z.string().min(1).max(512).optional(),
|
|
226
|
+
url: z.url().optional(),
|
|
227
|
+
})
|
|
228
|
+
.optional(),
|
|
229
|
+
generator: z
|
|
230
|
+
.strictObject({
|
|
231
|
+
name: z.string().min(1).max(64),
|
|
232
|
+
version: z.string().min(1).max(32).optional(),
|
|
233
|
+
model: z.string().min(1).max(128).optional().describe("Extraction model, when one was used."),
|
|
234
|
+
})
|
|
235
|
+
.optional(),
|
|
236
|
+
})
|
|
237
|
+
.describe("Where the document came from.");
|
|
238
|
+
/**
|
|
239
|
+
* The document every PR Lens component speaks: extraction emits it, the
|
|
240
|
+
* renderer consumes it, and a baseline map is one of these kept current by
|
|
241
|
+
* patch documents.
|
|
242
|
+
*/
|
|
243
|
+
export const GraphDoc = z
|
|
244
|
+
.strictObject({
|
|
245
|
+
schemaVersion: SchemaVersionField,
|
|
246
|
+
kind: z.literal("graph"),
|
|
247
|
+
id: Id.optional().describe("Stable id when the document is stored, e.g. a baseline map."),
|
|
248
|
+
generatedAt: z.iso.datetime().optional(),
|
|
249
|
+
title: Label,
|
|
250
|
+
summary: Summary.optional().describe("The one-paragraph answer to 'what does this change do?'"),
|
|
251
|
+
lenses: z
|
|
252
|
+
.array(Lens)
|
|
253
|
+
.min(1)
|
|
254
|
+
.max(8)
|
|
255
|
+
.describe("Lenses this document carries enough detail to render."),
|
|
256
|
+
provenance: Provenance,
|
|
257
|
+
lanes: z.array(Lane).min(1).max(16),
|
|
258
|
+
nodes: z.array(GraphNode).min(1).max(256),
|
|
259
|
+
edges: z.array(GraphEdge).max(512).default([]),
|
|
260
|
+
flows: z.array(Flow).max(16).default([]),
|
|
261
|
+
stats: Stats.optional(),
|
|
262
|
+
views: z.array(View).max(32).default([]),
|
|
263
|
+
layout: LayoutHints.optional(),
|
|
264
|
+
})
|
|
265
|
+
.describe("A PR Lens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,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC9C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACxC,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE;IACvB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACxC,MAAM,EAAE,WAAW,CAAC,QAAQ,EAAE;CAC/B,CAAC;KACD,QAAQ,CAAC,2BAA2B,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { SCHEMA_VERSION, type SchemaVersion } from "./version.js";
|
|
2
|
+
export { Delta, DELTAS, FileRef, FullSha, Id, Label, Lens, LENSES, MAX_RENDER_ASSETS, MAX_VIEWS, Theme, THEMES, SchemaVersionField, Sha, Summary, } from "./primitives.js";
|
|
3
|
+
export { EdgeEmphasis, EdgeKind, Flow, FlowMessage, FlowParticipant, GraphDoc, GraphEdge, GraphNode, Lane, LayoutHints, MessageKind, NodeKind, Provenance, StatChip, Stats, View, ViewScope, type GraphDocInput, type ViewInput, } from "./graph.js";
|
|
4
|
+
export { EdgePatch, FlowPatch, LanePatch, NodePatch, PatchDoc, PatchOp, PATCH_OPS, targetDescribesATransition, type PatchDocInput, } from "./patch.js";
|
|
5
|
+
export { Config, MapCorrections, Selector, type ConfigInput } from "./config.js";
|
|
6
|
+
export { RenderAsset, RenderManifest, type RenderManifestInput } from "./manifest.js";
|
|
7
|
+
export { formatIssues, PrLensSchemaError, type Parsed, type SchemaErrorCode, type SchemaIssue, } from "./errors.js";
|
|
8
|
+
export { graphIntegrityIssues, graphSnapshotIssues } from "./integrity.js";
|
|
9
|
+
export { parseConfig, parseGraphDoc, parsePatchDoc, parseRenderManifest, safeParseConfig, safeParseGraphDoc, safeParsePatchDoc, safeParseRenderManifest, } from "./validate.js";
|
|
10
|
+
export { applyPatch, applyPatchDoc } from "./apply.js";
|
|
11
|
+
export { assertNever } from "./utils.js";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAElE,OAAO,EACL,KAAK,EACL,MAAM,EACN,OAAO,EACP,OAAO,EACP,EAAE,EACF,KAAK,EACL,IAAI,EACJ,MAAM,EACN,iBAAiB,EACjB,SAAS,EACT,KAAK,EACL,MAAM,EACN,kBAAkB,EAClB,GAAG,EACH,OAAO,GACR,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,eAAe,EACf,QAAQ,EACR,SAAS,EACT,SAAS,EACT,IAAI,EACJ,WAAW,EACX,WAAW,EACX,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,SAAS,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,QAAQ,EACR,OAAO,EACP,SAAS,EACT,0BAA0B,EAC1B,KAAK,aAAa,GACnB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAEjF,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEtF,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,KAAK,MAAM,EACX,KAAK,eAAe,EACpB,KAAK,WAAW,GACjB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE3E,OAAO,EACL,WAAW,EACX,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { SCHEMA_VERSION } from "./version.js";
|
|
2
|
+
export { Delta, DELTAS, FileRef, FullSha, Id, Label, Lens, LENSES, MAX_RENDER_ASSETS, MAX_VIEWS, Theme, THEMES, SchemaVersionField, Sha, Summary, } from "./primitives.js";
|
|
3
|
+
export { EdgeEmphasis, EdgeKind, Flow, FlowMessage, FlowParticipant, GraphDoc, GraphEdge, GraphNode, Lane, LayoutHints, MessageKind, NodeKind, Provenance, StatChip, Stats, View, ViewScope, } from "./graph.js";
|
|
4
|
+
export { EdgePatch, FlowPatch, LanePatch, NodePatch, PatchDoc, PatchOp, PATCH_OPS, targetDescribesATransition, } from "./patch.js";
|
|
5
|
+
export { Config, MapCorrections, Selector } from "./config.js";
|
|
6
|
+
export { RenderAsset, RenderManifest } from "./manifest.js";
|
|
7
|
+
export { formatIssues, PrLensSchemaError, } from "./errors.js";
|
|
8
|
+
export { graphIntegrityIssues, graphSnapshotIssues } from "./integrity.js";
|
|
9
|
+
export { parseConfig, parseGraphDoc, parsePatchDoc, parseRenderManifest, safeParseConfig, safeParseGraphDoc, safeParsePatchDoc, safeParseRenderManifest, } from "./validate.js";
|
|
10
|
+
export { applyPatch, applyPatchDoc } from "./apply.js";
|
|
11
|
+
export { assertNever } from "./utils.js";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1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
|
+
import type { SchemaIssue } from "./errors.js";
|
|
2
|
+
import type { GraphDoc } from "./graph.js";
|
|
3
|
+
/**
|
|
4
|
+
* Structural validation says a field holds an id; these checks say the id
|
|
5
|
+
* points at something. Extraction models routinely emit an edge to a node
|
|
6
|
+
* they forgot to declare, and a renderer must never be handed that document.
|
|
7
|
+
*/
|
|
8
|
+
export declare const graphIntegrityIssues: (doc: GraphDoc) => SchemaIssue[];
|
|
9
|
+
/**
|
|
10
|
+
* Everything a document must satisfy to be stored as a map, and the check to
|
|
11
|
+
* run before storing one.
|
|
12
|
+
*
|
|
13
|
+
* A map describes a system, not a change to one: it is identified, it names
|
|
14
|
+
* the single commit it reflects in full, and nothing in it is annotated as a
|
|
15
|
+
* change. A map that fails this would hand the next pull request a baseline
|
|
16
|
+
* that already claims to be mid change, and every delta computed against it
|
|
17
|
+
* would inherit the mistake.
|
|
18
|
+
*/
|
|
19
|
+
export declare const graphSnapshotIssues: (doc: GraphDoc) => SchemaIssue[];
|
|
20
|
+
//# sourceMappingURL=integrity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrity.d.ts","sourceRoot":"","sources":["../src/integrity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAQ,MAAM,YAAY,CAAC;AAoBjD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,QAAS,QAAQ,KAAG,WAAW,EAyH/D,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB,QAAS,QAAQ,KAAG,WAAW,EAwD9D,CAAC"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { FullSha, MAX_VIEWS, THEMES } from "./primitives.js";
|
|
2
|
+
import { assertNever } from "./utils.js";
|
|
3
|
+
const duplicates = (ids) => {
|
|
4
|
+
const seen = new Set();
|
|
5
|
+
const repeated = new Set();
|
|
6
|
+
for (const id of ids) {
|
|
7
|
+
if (seen.has(id))
|
|
8
|
+
repeated.add(id);
|
|
9
|
+
seen.add(id);
|
|
10
|
+
}
|
|
11
|
+
return [...repeated];
|
|
12
|
+
};
|
|
13
|
+
const flattenViews = (views, prefix) => views.flatMap((view, index) => {
|
|
14
|
+
const path = `${prefix}[${index}]`;
|
|
15
|
+
return [{ view, path }, ...flattenViews(view.children, `${path}.children`)];
|
|
16
|
+
});
|
|
17
|
+
/**
|
|
18
|
+
* Structural validation says a field holds an id; these checks say the id
|
|
19
|
+
* points at something. Extraction models routinely emit an edge to a node
|
|
20
|
+
* they forgot to declare, and a renderer must never be handed that document.
|
|
21
|
+
*/
|
|
22
|
+
export const graphIntegrityIssues = (doc) => {
|
|
23
|
+
const issues = [];
|
|
24
|
+
const broken = (path, message) => issues.push({ code: "BROKEN_REFERENCE", path, message });
|
|
25
|
+
const duplicate = (path, message) => issues.push({ code: "DUPLICATE_ID", path, message });
|
|
26
|
+
const laneIds = new Set(doc.lanes.map((lane) => lane.id));
|
|
27
|
+
const nodeIds = new Set(doc.nodes.map((node) => node.id));
|
|
28
|
+
const flowIds = new Set(doc.flows.map((flow) => flow.id));
|
|
29
|
+
const edgeIds = new Set(doc.edges.map((edge) => edge.id));
|
|
30
|
+
const lenses = new Set(doc.lenses);
|
|
31
|
+
for (const id of duplicates(doc.lanes.map((lane) => lane.id)))
|
|
32
|
+
duplicate("lanes", `duplicate lane id '${id}'`);
|
|
33
|
+
for (const id of duplicates(doc.nodes.map((node) => node.id)))
|
|
34
|
+
duplicate("nodes", `duplicate node id '${id}'`);
|
|
35
|
+
for (const id of duplicates(doc.edges.map((edge) => edge.id)))
|
|
36
|
+
duplicate("edges", `duplicate edge id '${id}'`);
|
|
37
|
+
for (const id of duplicates(doc.flows.map((flow) => flow.id)))
|
|
38
|
+
duplicate("flows", `duplicate flow id '${id}'`);
|
|
39
|
+
doc.nodes.forEach((node, index) => {
|
|
40
|
+
if (!laneIds.has(node.lane))
|
|
41
|
+
broken(`nodes[${index}].lane`, `node '${node.id}' references unknown lane '${node.lane}'`);
|
|
42
|
+
});
|
|
43
|
+
doc.edges.forEach((edge, index) => {
|
|
44
|
+
if (!nodeIds.has(edge.from))
|
|
45
|
+
broken(`edges[${index}].from`, `edge '${edge.id}' references unknown node '${edge.from}'`);
|
|
46
|
+
if (!nodeIds.has(edge.to))
|
|
47
|
+
broken(`edges[${index}].to`, `edge '${edge.id}' references unknown node '${edge.to}'`);
|
|
48
|
+
});
|
|
49
|
+
doc.flows.forEach((flow, flowIndex) => {
|
|
50
|
+
const participantIds = new Set(flow.participants.map((participant) => participant.node));
|
|
51
|
+
for (const id of duplicates(flow.participants.map((participant) => participant.node)))
|
|
52
|
+
duplicate(`flows[${flowIndex}].participants`, `participant '${id}' listed twice`);
|
|
53
|
+
for (const id of duplicates(flow.messages.map((message) => message.id)))
|
|
54
|
+
duplicate(`flows[${flowIndex}].messages`, `duplicate message id '${id}'`);
|
|
55
|
+
flow.participants.forEach((participant, index) => {
|
|
56
|
+
if (!nodeIds.has(participant.node))
|
|
57
|
+
broken(`flows[${flowIndex}].participants[${index}].node`, `flow '${flow.id}' references unknown node '${participant.node}'`);
|
|
58
|
+
});
|
|
59
|
+
flow.messages.forEach((message, index) => {
|
|
60
|
+
if (!participantIds.has(message.from))
|
|
61
|
+
broken(`flows[${flowIndex}].messages[${index}].from`, `message '${message.id}' sends from '${message.from}', which is not a participant`);
|
|
62
|
+
if (!participantIds.has(message.to))
|
|
63
|
+
broken(`flows[${flowIndex}].messages[${index}].to`, `message '${message.id}' sends to '${message.to}', which is not a participant`);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
if (doc.flows.length > 0 && !lenses.has("data-flow"))
|
|
67
|
+
broken("lenses", "document carries flows but does not declare the 'data-flow' lens");
|
|
68
|
+
const views = flattenViews(doc.views, "views");
|
|
69
|
+
for (const id of duplicates(views.map(({ view }) => view.id)))
|
|
70
|
+
duplicate("views", `duplicate view id '${id}'`);
|
|
71
|
+
// Each array in the tree is capped, but the tree's depth is not, so the
|
|
72
|
+
// total is only bounded here.
|
|
73
|
+
if (views.length > MAX_VIEWS)
|
|
74
|
+
issues.push({
|
|
75
|
+
code: "INVALID_DOCUMENT",
|
|
76
|
+
path: "views",
|
|
77
|
+
message: `drill-down tree carries ${views.length} views; a render is one asset per view per theme, and at ${THEMES.length} themes only ${MAX_VIEWS} fit a render manifest`,
|
|
78
|
+
});
|
|
79
|
+
for (const { view, path } of views) {
|
|
80
|
+
if (!lenses.has(view.lens))
|
|
81
|
+
broken(`${path}.lens`, `view '${view.id}' uses lens '${view.lens}', which the document does not declare`);
|
|
82
|
+
switch (view.scope.kind) {
|
|
83
|
+
case "all":
|
|
84
|
+
break;
|
|
85
|
+
case "selection": {
|
|
86
|
+
const selection = view.scope;
|
|
87
|
+
const scoped = [
|
|
88
|
+
["lanes", "lane", laneIds],
|
|
89
|
+
["nodes", "node", nodeIds],
|
|
90
|
+
["edges", "edge", edgeIds],
|
|
91
|
+
["flows", "flow", flowIds],
|
|
92
|
+
];
|
|
93
|
+
for (const [collection, singular, known] of scoped) {
|
|
94
|
+
selection[collection].forEach((id, index) => {
|
|
95
|
+
if (!known.has(id))
|
|
96
|
+
broken(`${path}.scope.${collection}[${index}]`, `view '${view.id}' scopes unknown ${singular} '${id}'`);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
default:
|
|
102
|
+
assertNever(view.scope, "Unhandled view scope");
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (doc.layout) {
|
|
106
|
+
doc.layout.laneOrder.forEach((id, index) => {
|
|
107
|
+
if (!laneIds.has(id))
|
|
108
|
+
broken(`layout.laneOrder[${index}]`, `unknown lane '${id}'`);
|
|
109
|
+
});
|
|
110
|
+
for (const id of Object.keys(doc.layout.rank ?? {})) {
|
|
111
|
+
if (!nodeIds.has(id))
|
|
112
|
+
broken(`layout.rank.${id}`, `unknown node '${id}'`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return issues;
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Everything a document must satisfy to be stored as a map, and the check to
|
|
119
|
+
* run before storing one.
|
|
120
|
+
*
|
|
121
|
+
* A map describes a system, not a change to one: it is identified, it names
|
|
122
|
+
* the single commit it reflects in full, and nothing in it is annotated as a
|
|
123
|
+
* change. A map that fails this would hand the next pull request a baseline
|
|
124
|
+
* that already claims to be mid change, and every delta computed against it
|
|
125
|
+
* would inherit the mistake.
|
|
126
|
+
*/
|
|
127
|
+
export const graphSnapshotIssues = (doc) => {
|
|
128
|
+
const issues = [];
|
|
129
|
+
if (doc.id === undefined)
|
|
130
|
+
issues.push({
|
|
131
|
+
code: "NOT_A_SNAPSHOT",
|
|
132
|
+
path: "id",
|
|
133
|
+
message: "a stored map needs an id, so a patch can say which map it targets",
|
|
134
|
+
});
|
|
135
|
+
for (const side of ["base", "head"]) {
|
|
136
|
+
if (!FullSha.safeParse(doc.provenance[side].sha).success)
|
|
137
|
+
issues.push({
|
|
138
|
+
code: "NOT_A_SNAPSHOT",
|
|
139
|
+
path: `provenance.${side}.sha`,
|
|
140
|
+
message: `a stored map records the commit it reflects in full, but this one records '${doc.provenance[side].sha}'`,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
const requireUnchanged = (delta, path, subject) => {
|
|
144
|
+
if (delta === undefined || delta === "unchanged")
|
|
145
|
+
return;
|
|
146
|
+
issues.push({
|
|
147
|
+
code: "NOT_A_SNAPSHOT",
|
|
148
|
+
path,
|
|
149
|
+
message: `${subject} is marked '${delta}', but a stored map describes a system rather than a change`,
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
if (doc.provenance.base.sha !== doc.provenance.head.sha)
|
|
153
|
+
issues.push({
|
|
154
|
+
code: "NOT_A_SNAPSHOT",
|
|
155
|
+
path: "provenance",
|
|
156
|
+
message: `a stored map reflects one commit, but base is ${doc.provenance.base.sha} and head is ${doc.provenance.head.sha}`,
|
|
157
|
+
});
|
|
158
|
+
doc.lanes.forEach((lane, index) => requireUnchanged(lane.delta, `lanes[${index}].delta`, `lane '${lane.id}'`));
|
|
159
|
+
doc.nodes.forEach((node, index) => requireUnchanged(node.delta, `nodes[${index}].delta`, `node '${node.id}'`));
|
|
160
|
+
doc.edges.forEach((edge, index) => requireUnchanged(edge.delta, `edges[${index}].delta`, `edge '${edge.id}'`));
|
|
161
|
+
doc.flows.forEach((flow, flowIndex) => {
|
|
162
|
+
requireUnchanged(flow.delta, `flows[${flowIndex}].delta`, `flow '${flow.id}'`);
|
|
163
|
+
flow.messages.forEach((message, index) => requireUnchanged(message.delta, `flows[${flowIndex}].messages[${index}].delta`, `step '${message.id}' of flow '${flow.id}'`));
|
|
164
|
+
});
|
|
165
|
+
return issues;
|
|
166
|
+
};
|
|
167
|
+
//# sourceMappingURL=integrity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrity.js","sourceRoot":"","sources":["../src/integrity.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAc,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,UAAU,GAAG,CAAC,GAAsB,EAAY,EAAE;IACtD,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IACnC,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC;QACrB,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACnC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACf,CAAC;IACD,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC;AACvB,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,KAAsB,E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EAAE,KAAK,EAAE,EAAE,CAChC,gBAAgB,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,KAAK,SAAS,EAAE,SAAS,IAAI,CAAC,EAAE,GAAG,CAAC,CAC3E,CAAC;IACF,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE;QACpC,gBAAgB,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,SAAS,SAAS,EAAE,SAAS,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QAC/E,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CACvC,gBAAgB,CACd,OAAO,CAAC,KAAK,EACb,SAAS,SAAS,cAAc,KAAK,SAAS,EAC9C,SAAS,OAAO,CAAC,EAAE,cAAc,IAAI,CAAC,EAAE,GAAG,CAC5C,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* GitHub serves comment images through a proxy that caches aggressively, so
|
|
4
|
+
* every asset is addressed by the hash of its own bytes and a new render is a
|
|
5
|
+
* new URL rather than an updated one.
|
|
6
|
+
*/
|
|
7
|
+
export declare const RenderAsset: z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
lens: z.ZodEnum<{
|
|
10
|
+
architecture: "architecture";
|
|
11
|
+
"data-flow": "data-flow";
|
|
12
|
+
}>;
|
|
13
|
+
theme: z.ZodEnum<{
|
|
14
|
+
dark: "dark";
|
|
15
|
+
light: "light";
|
|
16
|
+
}>;
|
|
17
|
+
view: z.ZodOptional<z.ZodString>;
|
|
18
|
+
mediaType: z.ZodLiteral<"image/svg+xml">;
|
|
19
|
+
contentHash: z.ZodString;
|
|
20
|
+
bytes: z.ZodInt;
|
|
21
|
+
width: z.ZodInt;
|
|
22
|
+
height: z.ZodInt;
|
|
23
|
+
animated: z.ZodDefault<z.ZodBoolean>;
|
|
24
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
25
|
+
path: z.ZodOptional<z.ZodString>;
|
|
26
|
+
}, z.core.$strict>;
|
|
27
|
+
export type RenderAsset = z.infer<typeof RenderAsset>;
|
|
28
|
+
/** What a render produced: the inventory the comment composer builds from. */
|
|
29
|
+
export declare const RenderManifest: z.ZodObject<{
|
|
30
|
+
schemaVersion: z.ZodString;
|
|
31
|
+
kind: z.ZodLiteral<"render-manifest">;
|
|
32
|
+
generatedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
33
|
+
graph: z.ZodObject<{
|
|
34
|
+
id: z.ZodOptional<z.ZodString>;
|
|
35
|
+
headSha: z.ZodOptional<z.ZodString>;
|
|
36
|
+
contentHash: z.ZodString;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
renderer: z.ZodObject<{
|
|
39
|
+
name: z.ZodString;
|
|
40
|
+
version: z.ZodString;
|
|
41
|
+
}, z.core.$strict>;
|
|
42
|
+
assets: z.ZodArray<z.ZodObject<{
|
|
43
|
+
id: z.ZodString;
|
|
44
|
+
lens: z.ZodEnum<{
|
|
45
|
+
architecture: "architecture";
|
|
46
|
+
"data-flow": "data-flow";
|
|
47
|
+
}>;
|
|
48
|
+
theme: z.ZodEnum<{
|
|
49
|
+
dark: "dark";
|
|
50
|
+
light: "light";
|
|
51
|
+
}>;
|
|
52
|
+
view: z.ZodOptional<z.ZodString>;
|
|
53
|
+
mediaType: z.ZodLiteral<"image/svg+xml">;
|
|
54
|
+
contentHash: z.ZodString;
|
|
55
|
+
bytes: z.ZodInt;
|
|
56
|
+
width: z.ZodInt;
|
|
57
|
+
height: z.ZodInt;
|
|
58
|
+
animated: z.ZodDefault<z.ZodBoolean>;
|
|
59
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
60
|
+
path: z.ZodOptional<z.ZodString>;
|
|
61
|
+
}, z.core.$strict>>;
|
|
62
|
+
}, z.core.$strict>;
|
|
63
|
+
export type RenderManifest = z.infer<typeof RenderManifest>;
|
|
64
|
+
export type RenderManifestInput = z.input<typeof RenderManifest>;
|
|
65
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;GAIG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;kBA4BQ,CAAC;AACjC,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD,8EAA8E;AAC9E,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAqBc,CAAC;AAC1C,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC5D,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
|