dsh-knowhub 0.9.0 → 0.10.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/README.md +11 -2
- package/cordis.patch.yml +10 -0
- package/lib/host/model.js +1 -1
- package/lib/host/pipeline/incremental.js +3 -3
- package/lib/host/pipeline/initialize.js +144 -27
- package/lib/host/pipeline/model-output.js +2 -2
- package/package.json +3 -2
- package/skills/archify/LICENSE +202 -0
- package/skills/archify/LICENSE-MIT +22 -0
- package/skills/archify/NOTICE +26 -0
- package/skills/archify/SKILL.md +137 -0
- package/skills/archify/THIRD_PARTY_NOTICES.md +78 -0
- package/skills/archify/assets/JetBrainsMono-OFL.txt +93 -0
- package/skills/archify/assets/template.html +14768 -0
- package/skills/archify/bin/archify.mjs +7289 -0
- package/skills/archify/bin/delivery-update.mjs +92 -0
- package/skills/archify/bin/finalize.mjs +1055 -0
- package/skills/archify/bin/open-artifact.mjs +146 -0
- package/skills/archify/bin/preview.mjs +970 -0
- package/skills/archify/bin/recover-output.mjs +41 -0
- package/skills/archify/bin/visual-check.mjs +2780 -0
- package/skills/archify/brand-marks/README.md +31 -0
- package/skills/archify/brand-marks/catalog.json +131 -0
- package/skills/archify/delta/architecture-delta.mjs +1318 -0
- package/skills/archify/examples/agent-run.lifecycle.json +55 -0
- package/skills/archify/examples/agent-tool-call.workflow.json +74 -0
- package/skills/archify/examples/archify-dev-activity.timeline.json +176 -0
- package/skills/archify/examples/archify-repository.tree.json +197 -0
- package/skills/archify/examples/async-job-roundtrip.sequence.json +56 -0
- package/skills/archify/examples/brand-aware-delivery.architecture.json +34 -0
- package/skills/archify/examples/cache-miss-request.sequence.json +77 -0
- package/skills/archify/examples/checkout-platform.base.architecture.json +32 -0
- package/skills/archify/examples/checkout-platform.head.architecture.json +32 -0
- package/skills/archify/examples/checkout-request.waterfall.json +20 -0
- package/skills/archify/examples/delivery.explainer.json +155 -0
- package/skills/archify/examples/deployment-release.lifecycle.json +72 -0
- package/skills/archify/examples/event-stream.dataflow.json +52 -0
- package/skills/archify/examples/example-rebuild.waterfall.json +212 -0
- package/skills/archify/examples/holiday-planning.workflow.json +143 -0
- package/skills/archify/examples/incident-response.workflow.json +59 -0
- package/skills/archify/examples/locales/de.json +463 -0
- package/skills/archify/examples/locales/fr.json +463 -0
- package/skills/archify/examples/locales/fr.partial.json +22 -0
- package/skills/archify/examples/locales/it.json +463 -0
- package/skills/archify/examples/locales/ja.json +463 -0
- package/skills/archify/examples/locales/pt.json +463 -0
- package/skills/archify/examples/locales/ru.json +463 -0
- package/skills/archify/examples/orders.erd.json +337 -0
- package/skills/archify/examples/payment-incident.timeline.json +24 -0
- package/skills/archify/examples/payment-platform.tree.json +22 -0
- package/skills/archify/examples/payment-processors.class.json +177 -0
- package/skills/archify/examples/payments.class.json +85 -0
- package/skills/archify/examples/product-analytics.dataflow.json +71 -0
- package/skills/archify/examples/production-deployment.architecture.json +51 -0
- package/skills/archify/examples/release-delivery.workflow.json +57 -0
- package/skills/archify/examples/subscription-billing.erd.json +548 -0
- package/skills/archify/examples/web-app.architecture.json +41 -0
- package/skills/archify/explainer/browser-check.mjs +208 -0
- package/skills/archify/explainer/charts.mjs +70 -0
- package/skills/archify/explainer/check.mjs +167 -0
- package/skills/archify/explainer/diagrams.mjs +517 -0
- package/skills/archify/explainer/diff.mjs +124 -0
- package/skills/archify/explainer/inline.mjs +155 -0
- package/skills/archify/explainer/layout.mjs +35 -0
- package/skills/archify/explainer/page-bundle.mjs +16 -0
- package/skills/archify/explainer/parse.mjs +300 -0
- package/skills/archify/explainer/patch.mjs +117 -0
- package/skills/archify/explainer/prepare.mjs +131 -0
- package/skills/archify/explainer/reader.css +472 -0
- package/skills/archify/explainer/reader.js +666 -0
- package/skills/archify/explainer/render.mjs +224 -0
- package/skills/archify/explainer/revision.mjs +20 -0
- package/skills/archify/explainer/sources.mjs +318 -0
- package/skills/archify/explainer/validate.mjs +138 -0
- package/skills/archify/explainer/vendor/pele/LICENSE +40 -0
- package/skills/archify/explainer/vendor/pele/README.md +5 -0
- package/skills/archify/explainer/vendor/pele/chunks/3DKXF73K.js +4 -0
- package/skills/archify/explainer/vendor/pele/chunks/42UTT654.js +3 -0
- package/skills/archify/explainer/vendor/pele/chunks/DKTLEL5E.js +1 -0
- package/skills/archify/explainer/vendor/pele/chunks/EEIX5ZYH.js +2 -0
- package/skills/archify/explainer/vendor/pele/chunks/EJ5KOXYD.js +25 -0
- package/skills/archify/explainer/vendor/pele/chunks/GUJTEFZK.js +1 -0
- package/skills/archify/explainer/vendor/pele/chunks/IZOKQ2GT.js +4 -0
- package/skills/archify/explainer/vendor/pele/chunks/L4LY553T.js +3 -0
- package/skills/archify/explainer/vendor/pele/chunks/MSKIJHB2.js +2 -0
- package/skills/archify/explainer/vendor/pele/chunks/RVARI57O.js +1 -0
- package/skills/archify/explainer/vendor/pele/chunks/UKSIWDDN.js +2 -0
- package/skills/archify/explainer/vendor/pele/chunks/UPTXNAXN.js +2 -0
- package/skills/archify/explainer/vendor/pele/chunks/XTDUIGUI.js +9 -0
- package/skills/archify/explainer/vendor/pele/chunks/YAYTP6L5.js +9 -0
- package/skills/archify/explainer/vendor/pele/core.js +1 -0
- package/skills/archify/explainer/vendor/pele/diagrams/pie.js +1 -0
- package/skills/archify/explainer/vendor/pele/diagrams/quadrantChart.js +1 -0
- package/skills/archify/explainer/vendor/pele/diagrams/radar.js +1 -0
- package/skills/archify/explainer/vendor/pele/diagrams/sankey.js +1 -0
- package/skills/archify/explainer/vendor/pele/diagrams/venn.js +1 -0
- package/skills/archify/explainer/vendor/pele/diagrams/xychart.js +1 -0
- package/skills/archify/explainer/writing.mjs +139 -0
- package/skills/archify/locales/README.md +40 -0
- package/skills/archify/locales/ar.json +488 -0
- package/skills/archify/locales/en.json +488 -0
- package/skills/archify/locales/es.json +488 -0
- package/skills/archify/locales/ko.json +488 -0
- package/skills/archify/locales/manifest.json +10 -0
- package/skills/archify/locales/zh-CN.json +488 -0
- package/skills/archify/locales/zh-TW.json +488 -0
- package/skills/archify/migrations/workflow-v2.mjs +280 -0
- package/skills/archify/package.json +17 -0
- package/skills/archify/recipes/scenarios.mjs +455 -0
- package/skills/archify/references/architecture-layout-repair.md +18 -0
- package/skills/archify/references/authoring-contract.md +645 -0
- package/skills/archify/references/authoring-defaults.md +57 -0
- package/skills/archify/references/brand-marks.md +119 -0
- package/skills/archify/references/delivery-contract.md +665 -0
- package/skills/archify/references/explainer-authoring.md +274 -0
- package/skills/archify/references/repository-authoring.md +126 -0
- package/skills/archify/references/update-awareness.md +13 -0
- package/skills/archify/references/viewer-runtime.md +52 -0
- package/skills/archify/renderers/architecture/grid.mjs +62 -0
- package/skills/archify/renderers/architecture/labels.mjs +2 -0
- package/skills/archify/renderers/architecture/render-architecture.mjs +1204 -0
- package/skills/archify/renderers/architecture/routing.mjs +1469 -0
- package/skills/archify/renderers/class/README.md +130 -0
- package/skills/archify/renderers/class/render-class.mjs +1095 -0
- package/skills/archify/renderers/dataflow/README.md +176 -0
- package/skills/archify/renderers/dataflow/dataflow-compiler.mjs +1605 -0
- package/skills/archify/renderers/dataflow/joint-label-routing.mjs +165 -0
- package/skills/archify/renderers/dataflow/label-capacity.mjs +81 -0
- package/skills/archify/renderers/dataflow/render-dataflow.mjs +23 -0
- package/skills/archify/renderers/erd/README.md +246 -0
- package/skills/archify/renderers/erd/grid.mjs +150 -0
- package/skills/archify/renderers/erd/render-erd.mjs +1588 -0
- package/skills/archify/renderers/explainer/render-explainer.mjs +42 -0
- package/skills/archify/renderers/lifecycle/README.md +104 -0
- package/skills/archify/renderers/lifecycle/render-lifecycle.mjs +1134 -0
- package/skills/archify/renderers/sequence/README.md +146 -0
- package/skills/archify/renderers/sequence/render-sequence.mjs +1105 -0
- package/skills/archify/renderers/shared/atomic-output.mjs +1982 -0
- package/skills/archify/renderers/shared/automatic-labels.mjs +290 -0
- package/skills/archify/renderers/shared/brand-marks.mjs +706 -0
- package/skills/archify/renderers/shared/cli.mjs +430 -0
- package/skills/archify/renderers/shared/desktop-readability.mjs +132 -0
- package/skills/archify/renderers/shared/diagnostics.mjs +0 -0
- package/skills/archify/renderers/shared/engineering-profiles.mjs +157 -0
- package/skills/archify/renderers/shared/generated-brand-marks.mjs +2003 -0
- package/skills/archify/renderers/shared/generated-validators.mjs +279 -0
- package/skills/archify/renderers/shared/geometry.mjs +2073 -0
- package/skills/archify/renderers/shared/i18n.mjs +328 -0
- package/skills/archify/renderers/shared/layout-report.mjs +57 -0
- package/skills/archify/renderers/shared/legend.mjs +227 -0
- package/skills/archify/renderers/shared/node-card-style.mjs +32 -0
- package/skills/archify/renderers/shared/output-path.mjs +440 -0
- package/skills/archify/renderers/shared/owned-temp-directory.mjs +82 -0
- package/skills/archify/renderers/shared/path-semantics.mjs +1017 -0
- package/skills/archify/renderers/shared/portable-path.mjs +408 -0
- package/skills/archify/renderers/shared/repository-evidence.mjs +394 -0
- package/skills/archify/renderers/shared/repository-location.mjs +71 -0
- package/skills/archify/renderers/shared/route-quality.mjs +670 -0
- package/skills/archify/renderers/shared/sidecar-path.mjs +38 -0
- package/skills/archify/renderers/shared/software-notices.mjs +6 -0
- package/skills/archify/renderers/shared/spatial-grid.mjs +66 -0
- package/skills/archify/renderers/shared/svg-path-analysis.mjs +135 -0
- package/skills/archify/renderers/shared/text-fit.mjs +105 -0
- package/skills/archify/renderers/shared/utils.mjs +260 -0
- package/skills/archify/renderers/shared/validator.mjs +83 -0
- package/skills/archify/renderers/timeline/README.md +76 -0
- package/skills/archify/renderers/timeline/render-timeline.mjs +576 -0
- package/skills/archify/renderers/tree/README.md +96 -0
- package/skills/archify/renderers/tree/render-tree.mjs +573 -0
- package/skills/archify/renderers/waterfall/README.md +73 -0
- package/skills/archify/renderers/waterfall/render-waterfall.mjs +413 -0
- package/skills/archify/renderers/workflow/README.md +337 -0
- package/skills/archify/renderers/workflow/render-workflow.mjs +47 -0
- package/skills/archify/renderers/workflow/workflow-compiler.mjs +5920 -0
- package/skills/archify/renderers/workflow/workflow-migration-geometry.mjs +161 -0
- package/skills/archify/renderers/workflow/workflow-placement-repair.mjs +94 -0
- package/skills/archify/schemas/README.md +258 -0
- package/skills/archify/schemas/architecture.schema.json +152 -0
- package/skills/archify/schemas/class.schema.json +345 -0
- package/skills/archify/schemas/common.schema.json +181 -0
- package/skills/archify/schemas/dataflow.schema.json +254 -0
- package/skills/archify/schemas/erd.schema.json +381 -0
- package/skills/archify/schemas/explainer.schema.json +927 -0
- package/skills/archify/schemas/lifecycle.schema.json +179 -0
- package/skills/archify/schemas/sequence.schema.json +234 -0
- package/skills/archify/schemas/timeline.schema.json +160 -0
- package/skills/archify/schemas/tree.schema.json +141 -0
- package/skills/archify/schemas/waterfall.schema.json +147 -0
- package/skills/archify/schemas/workflow.schema.json +439 -0
- package/skills/archify/scripts/check-render-output.mjs +1469 -0
- package/skills/archify/scripts/check-update.mjs +1717 -0
- package/skills/archify/scripts/delivery-update-child.mjs +26 -0
- package/skills/archify/scripts/render-examples.mjs +36 -0
- package/skills/archify/scripts/update-contract.mjs +187 -0
- package/skills/archify/skill-release.json +10 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/** Banded grid placement for the ER IR. Not auto-layout: column widths and row
|
|
2
|
+
* band heights are measured from the boxes the author declares, so the same
|
|
3
|
+
* spec always produces the same coordinates. */
|
|
4
|
+
|
|
5
|
+
export const DEFAULT_ER_GRID = {
|
|
6
|
+
mode: 'grid',
|
|
7
|
+
// The top origin leaves room for a domain caption above the first band, and
|
|
8
|
+
// the left origin starts the first column inside the page margin so the
|
|
9
|
+
// canvas is not edge-to-edge. Row bands are taller than the generic rhythm
|
|
10
|
+
// because a table row is text a reader has to scan, not a node label.
|
|
11
|
+
origin: [32, 40],
|
|
12
|
+
gapX: 56,
|
|
13
|
+
gapY: 44,
|
|
14
|
+
// Wide enough for a long field name plus its SQL type at the legibility
|
|
15
|
+
// sizes below (a 20-character name and a numeric(12,2) type).
|
|
16
|
+
entityW: 240,
|
|
17
|
+
// Header and row bands are sized for the field type legibility the reader
|
|
18
|
+
// asked for: an 11-unit field name and a 10.5-unit type sit on a 20-unit
|
|
19
|
+
// row, and the table name leads them on a 30-unit header.
|
|
20
|
+
headerH: 30,
|
|
21
|
+
rowH: 20,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export function erGridLayout(er) {
|
|
25
|
+
const raw = er.layout;
|
|
26
|
+
// Grid cells without a layout block mean the default grid, not absolute
|
|
27
|
+
// coordinates that were never supplied.
|
|
28
|
+
if (!raw) {
|
|
29
|
+
const gridPlaced = (er.entities || []).some((entity) => Number.isFinite(entity?.row) && Number.isFinite(entity?.col));
|
|
30
|
+
return gridPlaced ? { ...DEFAULT_ER_GRID } : null;
|
|
31
|
+
}
|
|
32
|
+
if (raw.mode !== 'grid') return null;
|
|
33
|
+
return { ...DEFAULT_ER_GRID, ...raw };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// An entity may omit `width` and inherit the grid's default. Both the layout and
|
|
37
|
+
// the placement validator must resolve that the same way: reading `entity.width`
|
|
38
|
+
// directly turned the documented default into NaN and reported a placement
|
|
39
|
+
// failure for a box the schema accepts.
|
|
40
|
+
export function resolvedEntityWidth(entity, grid) {
|
|
41
|
+
return Number.isFinite(entity?.width) ? entity.width : (grid?.entityW ?? DEFAULT_ER_GRID.entityW);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// One header band plus one band per declared column. An entity with no columns
|
|
45
|
+
// still needs a readable body, so the minimum is a single row.
|
|
46
|
+
export function entityHeight(entity, grid) {
|
|
47
|
+
const rows = Math.max(1, Array.isArray(entity.attributes) ? entity.attributes.length : 0);
|
|
48
|
+
return grid.headerH + rows * grid.rowH + 6;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Every raw column index owns the widest box placed in it and every raw row
|
|
52
|
+
// index owns the tallest, so boxes in one band share a baseline without anyone
|
|
53
|
+
// measuring by hand. Indices with no box still contribute their gap, which is
|
|
54
|
+
// how an author asks for a routing channel between two bands. A box on a half
|
|
55
|
+
// column (a class grid's `col: 1.5`) is centred between two columns: it sizes
|
|
56
|
+
// its row but neither column.
|
|
57
|
+
const gridColumn = (col) => Number.isInteger(col * 2) && col >= 0;
|
|
58
|
+
// `columnGaps` raises the gap after a column to a measured floor (see the
|
|
59
|
+
// renderer's relationship-label demand); the authored or default gapX stays
|
|
60
|
+
// the minimum everywhere, so an absent map reproduces the plain grid.
|
|
61
|
+
export function bandedLayout(entities, grid, { columnGaps = null } = {}) {
|
|
62
|
+
const widths = new Map();
|
|
63
|
+
const heights = new Map();
|
|
64
|
+
let maxCol = -1;
|
|
65
|
+
for (const entity of entities) {
|
|
66
|
+
if (!Number.isInteger(entity.row) || !gridColumn(entity.col)) continue;
|
|
67
|
+
maxCol = Math.max(maxCol, Math.ceil(entity.col));
|
|
68
|
+
if (Number.isInteger(entity.col)) widths.set(entity.col, Math.max(widths.get(entity.col) || 0, resolvedEntityWidth(entity, grid)));
|
|
69
|
+
heights.set(entity.row, Math.max(heights.get(entity.row) || 0, entity.height));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const columnX = new Map();
|
|
73
|
+
const rowY = new Map();
|
|
74
|
+
let x = grid.origin[0];
|
|
75
|
+
for (let col = 0; col <= maxCol; col += 1) {
|
|
76
|
+
columnX.set(col, x);
|
|
77
|
+
x += (widths.get(col) || 0) + Math.max(grid.gapX, columnGaps?.get(col) || 0);
|
|
78
|
+
}
|
|
79
|
+
// A half-column box may be wider than its empty neighbouring bands. Keep
|
|
80
|
+
// every grid box inside the left margin without changing integer-only grids.
|
|
81
|
+
let leftInset = 0;
|
|
82
|
+
for (const entity of entities) {
|
|
83
|
+
if (!Number.isInteger(entity.row) || !gridColumn(entity.col) || Number.isInteger(entity.col)) continue;
|
|
84
|
+
const centre = (col) => columnX.get(col) + (widths.get(col) || 0) / 2;
|
|
85
|
+
const midpoint = (centre(Math.floor(entity.col)) + centre(Math.ceil(entity.col))) / 2;
|
|
86
|
+
leftInset = Math.max(leftInset, grid.origin[0] - midpoint + resolvedEntityWidth(entity, grid) / 2);
|
|
87
|
+
}
|
|
88
|
+
if (leftInset > 0) {
|
|
89
|
+
for (const [col, column] of columnX) columnX.set(col, column + leftInset);
|
|
90
|
+
x += leftInset;
|
|
91
|
+
}
|
|
92
|
+
let y = grid.origin[1];
|
|
93
|
+
const maxRow = Math.max(-1, ...heights.keys());
|
|
94
|
+
for (let row = 0; row <= maxRow; row += 1) {
|
|
95
|
+
rowY.set(row, y);
|
|
96
|
+
y += (heights.get(row) || 0) + grid.gapY;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return { columnX, rowY, widths, heights, totalWidth: x, totalHeight: y };
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export function resolveEntityPos(entity, grid, bands) {
|
|
103
|
+
if (Array.isArray(entity.pos) && entity.pos.length === 2) return entity.pos;
|
|
104
|
+
if (!grid || !bands) return [NaN, NaN];
|
|
105
|
+
if (!Number.isInteger(entity.row) || !gridColumn(entity.col)) return [NaN, NaN];
|
|
106
|
+
const width = resolvedEntityWidth(entity, grid);
|
|
107
|
+
const rowY = bands.rowY.get(entity.row);
|
|
108
|
+
if (!Number.isInteger(entity.col)) {
|
|
109
|
+
const centre = (col) => bands.columnX.get(col) + (bands.widths.get(col) || 0) / 2;
|
|
110
|
+
const [left, right] = [Math.floor(entity.col), Math.ceil(entity.col)];
|
|
111
|
+
if (![bands.columnX.get(left), bands.columnX.get(right), rowY].every(Number.isFinite)) return [NaN, NaN];
|
|
112
|
+
return [(centre(left) + centre(right)) / 2 - width / 2, rowY];
|
|
113
|
+
}
|
|
114
|
+
const columnX = bands.columnX.get(entity.col);
|
|
115
|
+
if (!Number.isFinite(columnX) || !Number.isFinite(rowY)) return [NaN, NaN];
|
|
116
|
+
// Centre each box in its column so the gaps on both sides stay equal; the
|
|
117
|
+
// router reads those gaps as corridors.
|
|
118
|
+
const columnWidth = bands.widths.get(entity.col) || width;
|
|
119
|
+
return [columnX + (columnWidth - width) / 2, rowY];
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function validateErGridPlacement(er, grid, bands, problems) {
|
|
123
|
+
const seen = new Map();
|
|
124
|
+
for (const entity of er.entities ?? []) {
|
|
125
|
+
const hasPos = Array.isArray(entity.pos) && entity.pos.length === 2;
|
|
126
|
+
if (!hasPos && !grid) {
|
|
127
|
+
problems.push(`Entity "${entity.id}" needs pos [x,y] or a grid layout with row/col.`);
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
if (hasPos) continue;
|
|
131
|
+
if (!Number.isInteger(entity.row) || !Number.isInteger(entity.col)) {
|
|
132
|
+
problems.push(`Entity "${entity.id}" needs pos [x,y] or grid row/col when layout.mode is "grid".`);
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
if (entity.row < 0 || entity.col < 0) {
|
|
136
|
+
problems.push(`Entity "${entity.id}" row/col must be non-negative integers.`);
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
const key = `${entity.row},${entity.col}`;
|
|
140
|
+
if (seen.has(key)) {
|
|
141
|
+
problems.push(`Entities "${seen.get(key)}" and "${entity.id}" share grid cell row ${entity.row} col ${entity.col}.`);
|
|
142
|
+
} else {
|
|
143
|
+
seen.set(key, entity.id);
|
|
144
|
+
}
|
|
145
|
+
const [x, y] = resolveEntityPos(entity, grid, bands);
|
|
146
|
+
if (!Number.isFinite(x) || !Number.isFinite(y)) {
|
|
147
|
+
problems.push(`Entity "${entity.id}" could not be placed from row ${entity.row} col ${entity.col}.`);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|