wabachi 0.2.0 → 0.3.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 (55) hide show
  1. package/.codex-plugin/plugin.json +6 -0
  2. package/LICENSE +1 -1
  3. package/README.md +17 -21
  4. package/dist/architecture/cli.js +51 -36
  5. package/dist/architecture/cli.js.map +1 -1
  6. package/dist/architecture/documentation/react-flow.d.ts +23 -0
  7. package/dist/architecture/documentation/react-flow.js +436 -0
  8. package/dist/architecture/documentation/react-flow.js.map +1 -0
  9. package/dist/architecture/documentation/site.d.ts +10 -13
  10. package/dist/architecture/documentation/site.js +58 -24
  11. package/dist/architecture/documentation/site.js.map +1 -1
  12. package/dist/architecture/projection/react-flow.d.ts +96 -0
  13. package/dist/architecture/projection/react-flow.js +388 -0
  14. package/dist/architecture/projection/react-flow.js.map +1 -0
  15. package/dist/cli.js +53 -14
  16. package/dist/cli.js.map +1 -1
  17. package/dist/command-contract.d.ts +78 -0
  18. package/dist/command-contract.js +194 -0
  19. package/dist/command-contract.js.map +1 -0
  20. package/dist/index.d.ts +1 -1
  21. package/dist/index.js +1 -0
  22. package/dist/index.js.map +1 -1
  23. package/dist/runtime/repository.d.ts +3 -0
  24. package/dist/runtime/repository.js +140 -16
  25. package/dist/runtime/repository.js.map +1 -1
  26. package/dist/runtime/run.js +3 -1
  27. package/dist/runtime/run.js.map +1 -1
  28. package/dist/skill.d.ts +47 -0
  29. package/dist/skill.js +160 -0
  30. package/dist/skill.js.map +1 -0
  31. package/dist/working-set/codec.d.ts +7 -0
  32. package/dist/working-set/codec.js +53 -0
  33. package/dist/working-set/codec.js.map +1 -0
  34. package/dist/working-set/conflicts.d.ts +46 -0
  35. package/dist/working-set/conflicts.js +97 -0
  36. package/dist/working-set/conflicts.js.map +1 -0
  37. package/dist/working-set/derive.d.ts +34 -0
  38. package/dist/working-set/derive.js +634 -0
  39. package/dist/working-set/derive.js.map +1 -0
  40. package/dist/working-set/index.d.ts +3 -0
  41. package/dist/working-set/index.js +3 -0
  42. package/dist/working-set/index.js.map +1 -0
  43. package/dist/working-set/model.d.ts +93 -0
  44. package/dist/working-set/model.js +204 -0
  45. package/dist/working-set/model.js.map +1 -0
  46. package/dist/working-set/quality.d.ts +201 -0
  47. package/dist/working-set/quality.js +447 -0
  48. package/dist/working-set/quality.js.map +1 -0
  49. package/dist/working-set/seeds.d.ts +135 -0
  50. package/dist/working-set/seeds.js +433 -0
  51. package/dist/working-set/seeds.js.map +1 -0
  52. package/docs/USAGE.md +118 -0
  53. package/docs/examples/minimal-canon.json +24 -0
  54. package/package.json +14 -4
  55. package/skills/wabachi/SKILL.md +39 -0
@@ -0,0 +1,436 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { createRequire } from "node:module";
3
+ import React from "react";
4
+ import { renderToStaticMarkup } from "react-dom/server";
5
+ import { BaseEdge, Handle, MarkerType, Position, ReactFlow, ReactFlowProvider, } from "@xyflow/react";
6
+ export class ReactFlowStaticRenderError extends Error {
7
+ code = "invalid-projection";
8
+ constructor(message) {
9
+ super(message);
10
+ this.name = "ReactFlowStaticRenderError";
11
+ }
12
+ }
13
+ const require = createRequire(import.meta.url);
14
+ function reactFlowStylesheet() {
15
+ try {
16
+ return readFileSync(require.resolve("@xyflow/react/dist/style.css"), "utf8");
17
+ }
18
+ catch (error) {
19
+ const detail = error instanceof Error ? `: ${error.message}` : "";
20
+ throw new ReactFlowStaticRenderError(`React Flow stylesheet is unavailable${detail}`);
21
+ }
22
+ }
23
+ const WABACHI_REACT_FLOW_CSS = `.wabachi-react-flow-diagrams {
24
+ --wabachi-flow-ink: #202124;
25
+ --wabachi-flow-muted: #5f6368;
26
+ --wabachi-flow-border: #aeb7c4;
27
+ --wabachi-flow-edge: #53657a;
28
+ --wabachi-flow-surface: #ffffff;
29
+ --wabachi-flow-canvas: #f8fafc;
30
+ display: grid;
31
+ gap: 2rem;
32
+ color: var(--wabachi-flow-ink);
33
+ font-family: system-ui, sans-serif;
34
+ }
35
+
36
+ .wabachi-react-flow-diagram {
37
+ min-inline-size: 0;
38
+ }
39
+
40
+ .wabachi-react-flow-diagram > header {
41
+ margin-block-end: 1rem;
42
+ }
43
+
44
+ .wabachi-react-flow-diagram > header h2,
45
+ .wabachi-react-flow-diagram > header p {
46
+ margin-block: 0.25rem;
47
+ }
48
+
49
+ .wabachi-react-flow-diagram > header p,
50
+ .wabachi-react-flow-losses {
51
+ color: var(--wabachi-flow-muted);
52
+ }
53
+
54
+ .wabachi-react-flow-canvas {
55
+ display: block;
56
+ inline-size: 100%;
57
+ min-block-size: 12rem;
58
+ overflow: hidden;
59
+ background: var(--wabachi-flow-canvas);
60
+ border: 1px solid var(--wabachi-flow-border);
61
+ border-radius: 0.5rem;
62
+ }
63
+
64
+ .wabachi-react-flow-surface {
65
+ color: var(--wabachi-flow-ink);
66
+ background: var(--wabachi-flow-canvas);
67
+ }
68
+
69
+ .wabachi-react-flow-node {
70
+ display: grid;
71
+ place-items: center;
72
+ box-sizing: border-box;
73
+ inline-size: 100%;
74
+ block-size: 100%;
75
+ padding: 0.75rem;
76
+ color: var(--wabachi-flow-ink);
77
+ background: var(--wabachi-flow-surface);
78
+ border: 2px solid var(--wabachi-flow-border);
79
+ border-radius: 0.5rem;
80
+ font-size: 14px;
81
+ font-weight: 600;
82
+ text-align: center;
83
+ }
84
+
85
+ .wabachi-react-flow-node--parent {
86
+ border-style: dashed;
87
+ }
88
+
89
+ .wabachi-react-flow-node[data-kind="service"],
90
+ .wabachi-react-flow-node[data-kind="system"] {
91
+ background: #eef6ff;
92
+ }
93
+
94
+ .wabachi-react-flow-node[data-kind="component"] {
95
+ background: #f4f0ff;
96
+ }
97
+
98
+ .wabachi-react-flow-node[data-kind="actor"] {
99
+ background: #fff7e6;
100
+ }
101
+
102
+ .wabachi-react-flow-node > .react-flow__handle {
103
+ opacity: 0;
104
+ }
105
+
106
+ .wabachi-react-flow-edge .react-flow__edge-path {
107
+ stroke: var(--wabachi-flow-edge);
108
+ stroke-width: 2;
109
+ }
110
+
111
+ .wabachi-react-flow-edge .react-flow__edge-text {
112
+ fill: var(--wabachi-flow-ink);
113
+ font-size: 12px;
114
+ }
115
+
116
+ .wabachi-react-flow-edge .react-flow__edge-textbg {
117
+ fill: var(--wabachi-flow-canvas);
118
+ opacity: 0.95;
119
+ }
120
+ `;
121
+ export const REACT_FLOW_DIAGRAM_CSS = `${reactFlowStylesheet()}\n${WABACHI_REACT_FLOW_CSS}`;
122
+ export const REACT_FLOW_STATIC_ASSETS = Object.freeze([
123
+ Object.freeze({
124
+ path: "wabachi-react-flow.css",
125
+ contentType: "text/css",
126
+ content: REACT_FLOW_DIAGRAM_CSS,
127
+ }),
128
+ ]);
129
+ const HTML_ESCAPE_PATTERN = /[&<>"']/g;
130
+ const HTML_ESCAPES = {
131
+ "&": "&amp;",
132
+ "<": "&lt;",
133
+ ">": "&gt;",
134
+ '"': "&quot;",
135
+ "'": "&#39;",
136
+ };
137
+ function escapeHtml(value) {
138
+ return value.replace(HTML_ESCAPE_PATTERN, (character) => HTML_ESCAPES[character] ?? character);
139
+ }
140
+ function identityToken(value) {
141
+ const token = Array.from(value, (character) => {
142
+ if (/^[A-Za-z0-9]$/u.test(character))
143
+ return character;
144
+ return `_u${character.codePointAt(0)?.toString(16) ?? "0"}_`;
145
+ }).join("");
146
+ return token.length === 0 ? "empty" : token;
147
+ }
148
+ function compareStrings(left, right) {
149
+ if (left < right)
150
+ return -1;
151
+ if (left > right)
152
+ return 1;
153
+ return 0;
154
+ }
155
+ function finiteNumber(value, path) {
156
+ if (typeof value !== "number" || !Number.isFinite(value)) {
157
+ throw new ReactFlowStaticRenderError(`${path} must be a finite number`);
158
+ }
159
+ return Object.is(value, -0) ? 0 : value;
160
+ }
161
+ function formatNumber(value) {
162
+ return String(Object.is(value, -0) ? 0 : value);
163
+ }
164
+ function nodePosition(node, path) {
165
+ return Object.freeze({
166
+ x: finiteNumber(node.position.x, `${path}.position.x`),
167
+ y: finiteNumber(node.position.y, `${path}.position.y`),
168
+ });
169
+ }
170
+ function nodeSize(node, path) {
171
+ const width = finiteNumber(node.width, `${path}.width`);
172
+ const height = finiteNumber(node.height, `${path}.height`);
173
+ if (width <= 0 || height <= 0) {
174
+ throw new ReactFlowStaticRenderError(`${path} dimensions must be positive`);
175
+ }
176
+ return Object.freeze({ width, height });
177
+ }
178
+ function sectionPoints(section, path) {
179
+ const points = [section.startPoint, ...section.bendPoints, section.endPoint];
180
+ return Object.freeze(points.map((point, index) => ({
181
+ x: finiteNumber(point.x, `${path}[${index}].x`),
182
+ y: finiteNumber(point.y, `${path}[${index}].y`),
183
+ })));
184
+ }
185
+ function edgePath(edge) {
186
+ if (edge.data.sections.length === 0) {
187
+ throw new ReactFlowStaticRenderError(`view ${edge.data.viewKey} edge ${edge.id} has no routed sections`);
188
+ }
189
+ const paths = [];
190
+ let labelPoint;
191
+ edge.data.sections.forEach((section, sectionIndex) => {
192
+ const points = sectionPoints(section, `views[${edge.data.viewKey}].edges[${edge.id}].sections[${sectionIndex}]`);
193
+ if (points.length < 2) {
194
+ throw new ReactFlowStaticRenderError(`view ${edge.data.viewKey} edge ${edge.id} has an incomplete routed section`);
195
+ }
196
+ const [first, ...rest] = points;
197
+ paths.push(`M ${formatNumber(first.x)} ${formatNumber(first.y)} ${rest.map((point) => `L ${formatNumber(point.x)} ${formatNumber(point.y)}`).join(" ")}`);
198
+ if (labelPoint === undefined) {
199
+ const midpoint = Math.floor((points.length - 1) / 2);
200
+ const start = points[midpoint];
201
+ const end = points[midpoint + 1];
202
+ labelPoint = Object.freeze({ x: (start.x + end.x) / 2, y: (start.y + end.y) / 2 });
203
+ }
204
+ });
205
+ return Object.freeze({ path: paths.join(" "), labelPoint: labelPoint });
206
+ }
207
+ function includePoint(bounds, x, y) {
208
+ bounds.minX = Math.min(bounds.minX, x);
209
+ bounds.minY = Math.min(bounds.minY, y);
210
+ bounds.maxX = Math.max(bounds.maxX, x);
211
+ bounds.maxY = Math.max(bounds.maxY, y);
212
+ }
213
+ function addNodeBounds(bounds, node, absolute, path) {
214
+ const size = nodeSize(node, path);
215
+ includePoint(bounds, absolute.x, absolute.y);
216
+ includePoint(bounds, absolute.x + size.width, absolute.y + size.height);
217
+ }
218
+ function validateProjection(projection) {
219
+ if (projection === null || typeof projection !== "object" || !Array.isArray(projection.views)) {
220
+ throw new ReactFlowStaticRenderError("React Flow renderer requires a projection with views");
221
+ }
222
+ const viewKeys = new Set();
223
+ for (const [viewIndex, view] of projection.views.entries()) {
224
+ if (typeof view.key !== "string" || view.key.length === 0) {
225
+ throw new ReactFlowStaticRenderError(`views[${viewIndex}].key must be a non-empty string`);
226
+ }
227
+ if (viewKeys.has(view.key)) {
228
+ throw new ReactFlowStaticRenderError(`projection contains duplicate view key: ${view.key}`);
229
+ }
230
+ viewKeys.add(view.key);
231
+ const nodeIds = new Set();
232
+ for (const [nodeIndex, node] of view.nodes.entries()) {
233
+ const path = `views[${viewIndex}].nodes[${nodeIndex}]`;
234
+ if (typeof node.id !== "string" || node.id.length === 0) {
235
+ throw new ReactFlowStaticRenderError(`${path}.id must be a non-empty string`);
236
+ }
237
+ if (nodeIds.has(node.id)) {
238
+ throw new ReactFlowStaticRenderError(`view ${view.key} contains duplicate node id: ${node.id}`);
239
+ }
240
+ nodeIds.add(node.id);
241
+ if (node.data.viewKey !== view.key) {
242
+ throw new ReactFlowStaticRenderError(`${path}.data.viewKey does not match view key ${view.key}`);
243
+ }
244
+ nodePosition(node, path);
245
+ nodeSize(node, path);
246
+ }
247
+ for (const node of view.nodes) {
248
+ if (node.parentId !== undefined && !nodeIds.has(node.parentId)) {
249
+ throw new ReactFlowStaticRenderError(`view ${view.key} node ${node.id} refers to missing parent ${node.parentId}`);
250
+ }
251
+ }
252
+ for (const [edgeIndex, edge] of view.edges.entries()) {
253
+ const path = `views[${viewIndex}].edges[${edgeIndex}]`;
254
+ if (typeof edge.id !== "string" || edge.id.length === 0) {
255
+ throw new ReactFlowStaticRenderError(`${path}.id must be a non-empty string`);
256
+ }
257
+ if (!nodeIds.has(edge.source) || !nodeIds.has(edge.target)) {
258
+ throw new ReactFlowStaticRenderError(`view ${view.key} edge ${edge.id} refers to a missing endpoint`);
259
+ }
260
+ if (edge.data.viewKey !== view.key) {
261
+ throw new ReactFlowStaticRenderError(`${path}.data.viewKey does not match view key ${view.key}`);
262
+ }
263
+ edgePath(edge);
264
+ }
265
+ }
266
+ }
267
+ function absoluteNodePosition(node, nodesById, cache, visiting) {
268
+ const cached = cache.get(node.id);
269
+ if (cached !== undefined)
270
+ return cached;
271
+ if (visiting.has(node.id))
272
+ throw new ReactFlowStaticRenderError(`view contains a parent cycle at node ${node.id}`);
273
+ visiting.add(node.id);
274
+ const position = nodePosition(node, `node ${node.id}`);
275
+ const parent = node.parentId === undefined ? undefined : nodesById.get(node.parentId);
276
+ const parentPosition = parent === undefined ? { x: 0, y: 0 } : absoluteNodePosition(parent, nodesById, cache, visiting);
277
+ const result = Object.freeze({ x: position.x + parentPosition.x, y: position.y + parentPosition.y });
278
+ visiting.delete(node.id);
279
+ cache.set(node.id, result);
280
+ return result;
281
+ }
282
+ function viewBounds(view, absolutePositions) {
283
+ const bounds = { minX: 0, minY: 0, maxX: 320, maxY: 160 };
284
+ for (const node of view.nodes) {
285
+ const position = absolutePositions.get(node.id);
286
+ addNodeBounds(bounds, node, position, `node ${node.id}`);
287
+ }
288
+ for (const edge of view.edges) {
289
+ edge.data.sections.forEach((section, sectionIndex) => {
290
+ for (const point of sectionPoints(section, `edge ${edge.id}.sections[${sectionIndex}]`)) {
291
+ includePoint(bounds, point.x, point.y);
292
+ }
293
+ });
294
+ }
295
+ const padding = 32;
296
+ return Object.freeze({
297
+ width: Math.max(320, bounds.maxX - bounds.minX + padding * 2),
298
+ height: Math.max(160, bounds.maxY - bounds.minY + padding * 2),
299
+ defaultViewport: Object.freeze({ x: padding - bounds.minX, y: padding - bounds.minY, zoom: 1 }),
300
+ });
301
+ }
302
+ function ArchitectureNode({ data, parentId }) {
303
+ const className = data.isParent
304
+ ? "wabachi-react-flow-node wabachi-react-flow-node--parent"
305
+ : "wabachi-react-flow-node";
306
+ return React.createElement(React.Fragment, null, React.createElement(Handle, { type: "target", position: Position.Left, "aria-hidden": true }), React.createElement("div", {
307
+ className,
308
+ "data-canon-id": data.canonId,
309
+ "data-view-key": data.viewKey,
310
+ "data-kind": data.kind,
311
+ ...(parentId === undefined ? {} : { "data-parent-id": parentId }),
312
+ role: "group",
313
+ }, data.label), React.createElement(Handle, { type: "source", position: Position.Right, "aria-hidden": true }));
314
+ }
315
+ function RoutedEdge({ id, data, label, markerEnd }) {
316
+ if (data === undefined) {
317
+ throw new ReactFlowStaticRenderError(`React Flow edge ${id} has no projection data`);
318
+ }
319
+ const routed = edgePath({ id, data });
320
+ return React.createElement("g", {
321
+ "data-view-key": data.viewKey,
322
+ "data-canon-source-id": data.canonSourceId,
323
+ "data-canon-target-id": data.canonTargetId,
324
+ ...(data.canonRelationshipId === undefined ? {} : { "data-canon-relationship-id": data.canonRelationshipId }),
325
+ "data-section-count": String(data.sections.length),
326
+ }, React.createElement(BaseEdge, {
327
+ id,
328
+ path: routed.path,
329
+ label,
330
+ labelX: routed.labelPoint.x,
331
+ labelY: routed.labelPoint.y,
332
+ markerEnd,
333
+ className: "wabachi-react-flow-edge",
334
+ }));
335
+ }
336
+ const NODE_TYPES = Object.freeze({ architecture: ArchitectureNode });
337
+ const EDGE_TYPES = Object.freeze({ routed: RoutedEdge });
338
+ function flowNodes(view) {
339
+ const nodes = [...view.nodes].sort((left, right) => compareStrings(left.id, right.id));
340
+ const parentIds = new Set(nodes.flatMap((node) => (node.parentId === undefined ? [] : [node.parentId])));
341
+ return Object.freeze(nodes
342
+ .map((node) => ({
343
+ id: node.id,
344
+ type: "architecture",
345
+ data: { ...node.data, isParent: parentIds.has(node.id) },
346
+ position: { ...node.position },
347
+ width: node.width,
348
+ height: node.height,
349
+ handles: [
350
+ { type: "target", position: Position.Left, x: 0, y: node.height / 2 },
351
+ { type: "source", position: Position.Right, x: node.width, y: node.height / 2 },
352
+ ],
353
+ ...(node.parentId === undefined ? {} : { parentId: node.parentId, extent: "parent" }),
354
+ }))
355
+ .map((node) => ({
356
+ ...node,
357
+ data: node.data,
358
+ })));
359
+ }
360
+ function flowEdges(view) {
361
+ const edges = [...view.edges].sort((left, right) => compareStrings(left.id, right.id));
362
+ return Object.freeze(edges
363
+ .map((edge) => ({
364
+ id: edge.id,
365
+ type: "routed",
366
+ source: edge.source,
367
+ target: edge.target,
368
+ label: edge.label,
369
+ markerEnd: { type: MarkerType.ArrowClosed },
370
+ data: edge.data,
371
+ }))
372
+ .map((edge) => edge));
373
+ }
374
+ function renderView(projection, view) {
375
+ const nodes = [...flowNodes(view)];
376
+ const edges = [...flowEdges(view)];
377
+ const nodesById = new Map(view.nodes.map((node) => [node.id, node]));
378
+ const absolutePositions = new Map();
379
+ for (const node of view.nodes)
380
+ absoluteNodePosition(node, nodesById, absolutePositions, new Set());
381
+ const bounds = viewBounds(view, absolutePositions);
382
+ const viewToken = identityToken(view.key);
383
+ const titleId = `react-flow-title-${viewToken}`;
384
+ const title = view.title ?? view.key;
385
+ const description = view.description === undefined ? "" : `<p>${escapeHtml(view.description)}</p>`;
386
+ const losses = view.losses.length === 0
387
+ ? ""
388
+ : `<p class="wabachi-react-flow-losses" data-loss-count="${String(view.losses.length)}">Projection losses: ${String(view.losses.length)}</p>`;
389
+ const flowMarkup = renderToStaticMarkup(React.createElement(ReactFlowProvider, {
390
+ initialNodes: nodes,
391
+ initialEdges: edges,
392
+ children: React.createElement(ReactFlow, {
393
+ id: `react-flow-${viewToken}`,
394
+ nodes,
395
+ edges,
396
+ nodeTypes: NODE_TYPES,
397
+ edgeTypes: EDGE_TYPES,
398
+ defaultViewport: bounds.defaultViewport,
399
+ nodesDraggable: false,
400
+ nodesConnectable: false,
401
+ elementsSelectable: false,
402
+ panOnDrag: false,
403
+ zoomOnScroll: false,
404
+ zoomOnPinch: false,
405
+ zoomOnDoubleClick: false,
406
+ proOptions: { hideAttribution: true },
407
+ className: "wabachi-react-flow-surface",
408
+ style: { width: "100%", height: `${formatNumber(bounds.height)}px` },
409
+ "aria-label": `${title} architecture diagram`,
410
+ }),
411
+ }));
412
+ return `<section id="react-flow-view-${escapeHtml(viewToken)}" class="wabachi-react-flow-diagram" data-view-key="${escapeHtml(view.key)}" data-canon-document-id="${escapeHtml(projection.documentId)}" data-canon-version="${escapeHtml(String(projection.canonVersion))}" data-projection-loss-count="${String(view.losses.length)}">
413
+ <header>
414
+ <h2 id="${escapeHtml(titleId)}">${escapeHtml(title)}</h2>
415
+ ${description}${losses}
416
+ </header>
417
+ <div class="wabachi-react-flow-canvas" data-view-key="${escapeHtml(view.key)}" data-canon-document-id="${escapeHtml(projection.documentId)}" data-canon-version="${escapeHtml(String(projection.canonVersion))}" style="height: ${formatNumber(bounds.height)}px" role="img" aria-labelledby="${escapeHtml(titleId)}">
418
+ ${flowMarkup}
419
+ </div>
420
+ </section>`;
421
+ }
422
+ /** Render the React Flow projection with @xyflow/react's ReactFlow component and local assets. */
423
+ export function renderReactFlowStatic(projection) {
424
+ validateProjection(projection);
425
+ const views = [...projection.views].sort((left, right) => compareStrings(left.key, right.key));
426
+ const markup = `<div class="wabachi-react-flow-diagrams" data-canon-document-id="${escapeHtml(projection.documentId)}" data-canon-version="${escapeHtml(String(projection.canonVersion))}">
427
+ ${views.map((view) => renderView(projection, view)).join("\n")}
428
+ </div>`;
429
+ return Object.freeze({ markup, assets: REACT_FLOW_STATIC_ASSETS });
430
+ }
431
+ /** Convenience form for callers that only need the composable HTML fragment. */
432
+ export function renderReactFlowHtml(projection) {
433
+ return renderReactFlowStatic(projection).markup;
434
+ }
435
+ export const renderReactFlowProjection = renderReactFlowStatic;
436
+ //# sourceMappingURL=react-flow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-flow.js","sourceRoot":"","sources":["../../../src/architecture/documentation/react-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MA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,mBAAmB,CAAC,UAA+B;IACjE,OAAO,qBAAqB,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC;AAClD,CAAC;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAG,qBAAqB,CAAC"}
@@ -1,43 +1,40 @@
1
1
  import type { DocumentationModel } from "./model.js";
2
- import { type StructurizrLauncher, type StructurizrStaticExportRequest, type StructurizrStaticExportResult } from "../projection/structurizr-export.js";
3
- import type { ProjectionLoss, StructurizrProjection } from "../projection/structurizr.js";
2
+ import type { ReactFlowProjection, ReactFlowProjectionLoss } from "../projection/react-flow.js";
4
3
  export declare const ARCHITECTURE_SITE_LAYOUT: Readonly<{
5
4
  indexHtml: "index.html";
6
- workspaceDsl: "workspace.dsl";
7
5
  projectionLosses: "projection-losses.json";
8
6
  diagramsDirectory: "diagrams";
7
+ diagramsIndexHtml: "diagrams/index.html";
8
+ diagramsStylesheet: "diagrams/wabachi-react-flow.css";
9
9
  }>;
10
- export type StructurizrStaticExportAdapter = (request: StructurizrStaticExportRequest) => Promise<StructurizrStaticExportResult>;
11
10
  export interface ArchitectureSiteRequest {
12
11
  /** An absolute, caller-owned directory for all site artifacts. */
13
12
  readonly outputRoot: string;
14
13
  readonly documentation: DocumentationModel;
15
- readonly structurizr: StructurizrProjection;
16
- readonly launcher: StructurizrLauncher;
17
- readonly exportAdapter?: StructurizrStaticExportAdapter;
14
+ readonly reactFlow: ReactFlowProjection;
18
15
  }
19
16
  export interface ArchitectureSiteArtifacts {
20
17
  readonly root: string;
21
18
  readonly indexHtml: string;
22
- readonly workspaceDsl: string;
23
19
  readonly projectionLosses: string;
24
20
  readonly diagramsDirectory: string;
21
+ readonly diagramsIndexHtml: string;
22
+ readonly diagramsStylesheet: string;
25
23
  }
26
24
  export interface ArchitectureSiteResult {
27
- readonly status: "ok" | "export-failed";
28
- readonly complete: boolean;
25
+ readonly status: "ok";
26
+ readonly complete: true;
29
27
  readonly outputRoot: string;
30
28
  readonly canonVersion: DocumentationModel["canonVersion"];
31
29
  readonly documentId: DocumentationModel["documentId"];
32
- readonly losses: readonly ProjectionLoss[];
30
+ readonly losses: readonly ReactFlowProjectionLoss[];
33
31
  readonly artifacts: ArchitectureSiteArtifacts;
34
- readonly export: StructurizrStaticExportResult;
35
32
  }
36
33
  export type ArchitectureSiteErrorCode = "invalid-input" | "generation-mismatch" | "unsafe-path" | "unsafe-overwrite";
37
34
  export declare class ArchitectureSiteError extends Error {
38
35
  readonly code: ArchitectureSiteErrorCode;
39
36
  constructor(code: ArchitectureSiteErrorCode, message: string);
40
37
  }
41
- /** Assemble the independent documentation and Structurizr projections at one filesystem edge. */
38
+ /** Assemble documentation and the first-party React Flow projection at one filesystem edge. */
42
39
  export declare function buildArchitectureSite(request: ArchitectureSiteRequest): Promise<ArchitectureSiteResult>;
43
40
  export declare const assembleArchitectureSite: typeof buildArchitectureSite;