structured-context-map-views 0.1.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.
- package/dist/ParameterControls-BsdG5GDk.js +1047 -0
- package/dist/ParameterControls-BsdG5GDk.js.map +1 -0
- package/dist/artifact.html +601 -0
- package/dist/artifact.js +237 -0
- package/dist/artifact.js.map +1 -0
- package/dist/cli.js +114 -0
- package/dist/cli.js.map +1 -0
- package/dist/{definition-KuPoA1mO.js → definition-Cft28YUA.js} +41 -7
- package/dist/definition-Cft28YUA.js.map +1 -0
- package/dist/index.js +3 -889
- package/dist/node-BceB0Wzc.js +106 -0
- package/dist/node-BceB0Wzc.js.map +1 -0
- package/dist/node.js +1 -105
- package/dist/styles.css +31 -0
- package/dist/types/artifact/load.d.ts +13 -0
- package/dist/types/artifact/main.d.ts +1 -0
- package/dist/types/core/annotations.d.ts +47 -0
- package/dist/types/core/definition.d.ts +6 -1
- package/dist/types/core/{schemas/definition.d.ts → format/definition-schema.d.ts} +18 -0
- package/dist/types/core/{schemas → format}/index.d.ts +33 -1
- package/dist/types/core/{schemas → format}/settings.d.ts +14 -0
- package/dist/types/index.d.ts +4 -1
- package/dist/types/layouts/EdgeOverlay.d.ts +1 -1
- package/dist/types/layouts/LandscapeLayout.d.ts +1 -1
- package/dist/types/layouts/MapView.d.ts +8 -2
- package/dist/types/layouts/NodeCard.d.ts +1 -1
- package/dist/types/layouts/ParameterControls.d.ts +3 -3
- package/dist/types/layouts/ParameterInputs.d.ts +21 -0
- package/dist/types/layouts/TreeLayout.d.ts +1 -1
- package/dist/types/layouts/XYLayout.d.ts +1 -1
- package/dist/types/layouts/annotations-context.d.ts +4 -0
- package/dist/types/layouts/useParameterControls.d.ts +13 -0
- package/dist/types/node/cli.d.ts +2 -0
- package/dist/types/node/index.d.ts +1 -1
- package/dist/types/node/snapshot.d.ts +20 -0
- package/package.json +8 -4
- package/dist/definition-KuPoA1mO.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/node.js.map +0 -1
- package/dist/types/core/index.d.ts +0 -6
- /package/dist/types/core/{schemas → format}/landscape-layout.d.ts +0 -0
- /package/dist/types/core/{schemas → format}/param-ref.d.ts +0 -0
- /package/dist/types/core/{schemas → format}/schema-url.d.ts +0 -0
- /package/dist/types/core/{schemas → format}/tree-layout.d.ts +0 -0
- /package/dist/types/core/{schemas → format}/xy-layout.d.ts +0 -0
package/dist/artifact.js
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { c as annotationsFrom, s as MapView, t as ParameterControls } from "./ParameterControls-BsdG5GDk.js";
|
|
2
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { createRoot } from "react-dom/client";
|
|
5
|
+
import { spaceGraphFrom } from "structured-context/browser";
|
|
6
|
+
//#region src/artifact/load.ts
|
|
7
|
+
var SPACES = "spaces";
|
|
8
|
+
var TIMEOUT_MS = 1e4;
|
|
9
|
+
/** Every space written to the artifact's `spaces` collection. Rejects with a message fit to show the viewer. */
|
|
10
|
+
async function loadSpaces() {
|
|
11
|
+
const claude = window.claude;
|
|
12
|
+
const db = claude ? await claude.use("db") : null;
|
|
13
|
+
if (!db) throw new Error("This page needs the artifact database, which is not available to this viewer.");
|
|
14
|
+
let timer;
|
|
15
|
+
const timeout = new Promise((_, reject) => {
|
|
16
|
+
timer = setTimeout(() => reject(/* @__PURE__ */ new Error("Reading the artifact database timed out.")), TIMEOUT_MS);
|
|
17
|
+
});
|
|
18
|
+
const spaces = (await Promise.race([db.collection(SPACES).get(), timeout]).finally(() => clearTimeout(timer))).docs.flatMap((doc) => {
|
|
19
|
+
const data = doc.data();
|
|
20
|
+
return data ? [toSpace(doc.id, data)] : [];
|
|
21
|
+
});
|
|
22
|
+
if (spaces.length === 0) throw new Error(`Nothing to show yet: no space has been written to "${SPACES}" in the artifact database.`);
|
|
23
|
+
return spaces;
|
|
24
|
+
}
|
|
25
|
+
function toSpace(name, data) {
|
|
26
|
+
const json = (field) => {
|
|
27
|
+
const value = data[field];
|
|
28
|
+
if (typeof value !== "string") throw new Error(`Space "${name}": missing "${field}" in the artifact database.`);
|
|
29
|
+
return JSON.parse(value);
|
|
30
|
+
};
|
|
31
|
+
return {
|
|
32
|
+
name,
|
|
33
|
+
schemaId: typeof data.schemaId === "string" ? data.schemaId : void 0,
|
|
34
|
+
graph: json("graph"),
|
|
35
|
+
validation: json("validation"),
|
|
36
|
+
definitions: json("definitions")
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/artifact/main.tsx
|
|
41
|
+
function App() {
|
|
42
|
+
const [state, setState] = useState({ status: "loading" });
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
loadSpaces().then((spaces) => setState({
|
|
45
|
+
status: "ready",
|
|
46
|
+
spaces
|
|
47
|
+
}), (err) => setState({
|
|
48
|
+
status: "error",
|
|
49
|
+
message: err instanceof Error ? err.message : String(err)
|
|
50
|
+
}));
|
|
51
|
+
}, []);
|
|
52
|
+
if (state.status === "loading") return /* @__PURE__ */ jsx("p", {
|
|
53
|
+
className: "art-message",
|
|
54
|
+
children: "Loading from the artifact database…"
|
|
55
|
+
});
|
|
56
|
+
if (state.status === "error") return /* @__PURE__ */ jsx("p", {
|
|
57
|
+
className: "art-message",
|
|
58
|
+
children: state.message
|
|
59
|
+
});
|
|
60
|
+
return /* @__PURE__ */ jsx(Viewer, { spaces: state.spaces });
|
|
61
|
+
}
|
|
62
|
+
function Viewer({ spaces }) {
|
|
63
|
+
const [spaceName, setSpaceName] = useState(spaces[0].name);
|
|
64
|
+
const space = spaces.find((s) => s.name === spaceName);
|
|
65
|
+
const [viewId, setViewId] = useState(space.definitions[0]?.id);
|
|
66
|
+
const definition = space.definitions.find((d) => d.id === viewId) ?? space.definitions[0];
|
|
67
|
+
const [values, setValues] = useState({});
|
|
68
|
+
const [selectedId, setSelectedId] = useState();
|
|
69
|
+
const graph = useMemo(() => spaceGraphFrom(space.graph), [space]);
|
|
70
|
+
const annotated = useMemo(() => annotationsFrom(space.validation, graph), [space, graph]);
|
|
71
|
+
const mapRef = useNodeLabels(graph, definition);
|
|
72
|
+
if (!definition) return /* @__PURE__ */ jsxs("p", {
|
|
73
|
+
className: "art-message",
|
|
74
|
+
children: [
|
|
75
|
+
"No map views apply to the schema of \"",
|
|
76
|
+
space.name,
|
|
77
|
+
"\"."
|
|
78
|
+
]
|
|
79
|
+
});
|
|
80
|
+
const selected = selectedId ? graph.nodes.get(selectedId) : void 0;
|
|
81
|
+
const results = selected ? annotated.annotations.get(selected.id) ?? [] : [];
|
|
82
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
83
|
+
className: "art-root",
|
|
84
|
+
children: [/* @__PURE__ */ jsxs("header", {
|
|
85
|
+
className: "art-bar",
|
|
86
|
+
children: [
|
|
87
|
+
spaces.length > 1 && /* @__PURE__ */ jsx("select", {
|
|
88
|
+
"aria-label": "Space",
|
|
89
|
+
value: spaceName,
|
|
90
|
+
onChange: (e) => {
|
|
91
|
+
const next = spaces.find((s) => s.name === e.target.value);
|
|
92
|
+
setSpaceName(next.name);
|
|
93
|
+
setViewId(next.definitions[0]?.id);
|
|
94
|
+
setValues({});
|
|
95
|
+
setSelectedId(void 0);
|
|
96
|
+
},
|
|
97
|
+
children: spaces.map((s) => /* @__PURE__ */ jsx("option", {
|
|
98
|
+
value: s.name,
|
|
99
|
+
children: s.name
|
|
100
|
+
}, s.name))
|
|
101
|
+
}),
|
|
102
|
+
space.definitions.length > 1 && /* @__PURE__ */ jsx("select", {
|
|
103
|
+
"aria-label": "Map view",
|
|
104
|
+
value: definition.id,
|
|
105
|
+
onChange: (e) => {
|
|
106
|
+
setViewId(e.target.value);
|
|
107
|
+
setValues({});
|
|
108
|
+
},
|
|
109
|
+
children: space.definitions.map((d) => /* @__PURE__ */ jsx("option", {
|
|
110
|
+
value: d.id,
|
|
111
|
+
children: d.title
|
|
112
|
+
}, d.id))
|
|
113
|
+
}),
|
|
114
|
+
/* @__PURE__ */ jsx(ParameterControls, {
|
|
115
|
+
definition,
|
|
116
|
+
values,
|
|
117
|
+
onChange: (name, value) => setValues((prev) => ({
|
|
118
|
+
...prev,
|
|
119
|
+
[name]: value
|
|
120
|
+
}))
|
|
121
|
+
})
|
|
122
|
+
]
|
|
123
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
124
|
+
className: "art-body",
|
|
125
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
126
|
+
className: "art-map",
|
|
127
|
+
ref: mapRef,
|
|
128
|
+
children: /* @__PURE__ */ jsx(MapView, {
|
|
129
|
+
definition,
|
|
130
|
+
graph,
|
|
131
|
+
values,
|
|
132
|
+
annotations: annotated.annotations,
|
|
133
|
+
onNodeSelect: (node) => setSelectedId(node.id)
|
|
134
|
+
})
|
|
135
|
+
}), (selected || annotated.unattached.length > 0) && /* @__PURE__ */ jsxs("aside", {
|
|
136
|
+
className: "art-panel",
|
|
137
|
+
"aria-label": "Validation results",
|
|
138
|
+
children: [selected && /* @__PURE__ */ jsxs("section", { children: [
|
|
139
|
+
/* @__PURE__ */ jsx("button", {
|
|
140
|
+
type: "button",
|
|
141
|
+
className: "art-close",
|
|
142
|
+
"aria-label": "Close",
|
|
143
|
+
onClick: () => setSelectedId(void 0),
|
|
144
|
+
children: "×"
|
|
145
|
+
}),
|
|
146
|
+
/* @__PURE__ */ jsx("p", {
|
|
147
|
+
className: "art-type",
|
|
148
|
+
children: selected.resolvedType
|
|
149
|
+
}),
|
|
150
|
+
/* @__PURE__ */ jsx("h2", { children: selected.title }),
|
|
151
|
+
results.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("h3", { children: "Validation" }), /* @__PURE__ */ jsx(Results, { items: results })] }),
|
|
152
|
+
/* @__PURE__ */ jsx(Fields, { data: selected.schemaData }),
|
|
153
|
+
selected.content && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("h3", { children: "Content" }), /* @__PURE__ */ jsx("p", {
|
|
154
|
+
className: "art-content",
|
|
155
|
+
children: selected.content
|
|
156
|
+
})] }),
|
|
157
|
+
selected.source && /* @__PURE__ */ jsx("p", {
|
|
158
|
+
className: "art-muted",
|
|
159
|
+
children: selected.source.file
|
|
160
|
+
})
|
|
161
|
+
] }), annotated.unattached.length > 0 && /* @__PURE__ */ jsxs("section", { children: [/* @__PURE__ */ jsxs("h3", { children: [
|
|
162
|
+
"Not on a node (",
|
|
163
|
+
annotated.unattached.length,
|
|
164
|
+
")"
|
|
165
|
+
] }), /* @__PURE__ */ jsx(Results, { items: annotated.unattached })] })]
|
|
166
|
+
})]
|
|
167
|
+
})]
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
var SKIPPED_FIELDS = /* @__PURE__ */ new Set([
|
|
171
|
+
"title",
|
|
172
|
+
"type",
|
|
173
|
+
"content"
|
|
174
|
+
]);
|
|
175
|
+
var isEmpty = (v) => v === void 0 || v === null || v === "" || Array.isArray(v) && v.length === 0;
|
|
176
|
+
var asText = (v) => Array.isArray(v) ? v.map(asText).join(", ") : v !== null && typeof v === "object" ? JSON.stringify(v) : String(v);
|
|
177
|
+
/** The node's fields as a list; the title, type and body are shown elsewhere. */
|
|
178
|
+
function Fields({ data }) {
|
|
179
|
+
const fields = Object.entries(data).filter(([name, value]) => !SKIPPED_FIELDS.has(name) && !isEmpty(value));
|
|
180
|
+
if (fields.length === 0) return null;
|
|
181
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("h3", { children: "Fields" }), /* @__PURE__ */ jsx("dl", {
|
|
182
|
+
className: "art-fields",
|
|
183
|
+
children: fields.map(([name, value]) => /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", { children: name }), /* @__PURE__ */ jsx("dd", { children: asText(value) })] }, name))
|
|
184
|
+
})] });
|
|
185
|
+
}
|
|
186
|
+
function Results({ items }) {
|
|
187
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
188
|
+
className: "art-results",
|
|
189
|
+
children: items.map((a, i) => /* @__PURE__ */ jsxs("li", { children: [
|
|
190
|
+
/* @__PURE__ */ jsx("span", {
|
|
191
|
+
className: `art-severity art-${a.severity}`,
|
|
192
|
+
children: a.severity
|
|
193
|
+
}),
|
|
194
|
+
" ",
|
|
195
|
+
/* @__PURE__ */ jsx("span", {
|
|
196
|
+
className: "art-muted",
|
|
197
|
+
children: a.ruleId ? `${a.source} · ${a.ruleId}` : a.source
|
|
198
|
+
}),
|
|
199
|
+
a.nodeId && /* @__PURE__ */ jsxs("span", {
|
|
200
|
+
className: "art-muted",
|
|
201
|
+
children: [" · ", a.nodeId]
|
|
202
|
+
}),
|
|
203
|
+
/* @__PURE__ */ jsx("div", { children: a.message })
|
|
204
|
+
] }, i))
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Names each card for the viewer's comment mode, which reads the location of a comment from the
|
|
209
|
+
* element's accessible name. The name leads with the map view and node id so it survives the
|
|
210
|
+
* viewer's truncation, then gives the type and title: `<view>/<nodeId>: <type> <title>`. An agent
|
|
211
|
+
* reading the comment resolves the id back to the node from the db.
|
|
212
|
+
*/
|
|
213
|
+
function useNodeLabels(graph, definition) {
|
|
214
|
+
const ref = useRef(null);
|
|
215
|
+
useEffect(() => {
|
|
216
|
+
const root = ref.current;
|
|
217
|
+
if (!root || !definition) return;
|
|
218
|
+
const stamp = () => {
|
|
219
|
+
for (const card of root.querySelectorAll("[data-node-id]")) {
|
|
220
|
+
const node = graph.nodes.get(card.dataset.nodeId);
|
|
221
|
+
if (node) card.setAttribute("aria-label", `${definition.id}/${node.id}: ${node.resolvedType} ${node.title}`);
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
stamp();
|
|
225
|
+
const observer = new MutationObserver(stamp);
|
|
226
|
+
observer.observe(root, {
|
|
227
|
+
childList: true,
|
|
228
|
+
subtree: true
|
|
229
|
+
});
|
|
230
|
+
return () => observer.disconnect();
|
|
231
|
+
}, [graph, definition]);
|
|
232
|
+
return ref;
|
|
233
|
+
}
|
|
234
|
+
createRoot(document.getElementById("root")).render(/* @__PURE__ */ jsx(App, {}));
|
|
235
|
+
//#endregion
|
|
236
|
+
|
|
237
|
+
//# sourceMappingURL=artifact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact.js","names":["_Fragment"],"sources":["../src/artifact/load.ts","../src/artifact/main.tsx"],"sourcesContent":["import type { spaceGraphFrom } from 'structured-context/browser';\nimport type { ValidationInput } from '../core/annotations';\nimport type { MapViewDefinition } from '../core/definition';\n\n/** A space as the artifact's db holds it: the `export` command's document with its parts as JSON strings. */\nexport type LoadedSpace = {\n name: string;\n schemaId: string | undefined;\n graph: Parameters<typeof spaceGraphFrom>[0];\n validation: ValidationInput;\n definitions: MapViewDefinition[];\n};\n\nconst SPACES = 'spaces';\nconst TIMEOUT_MS = 10_000;\n\ntype Db = {\n collection(path: string): { get(): Promise<{ docs: { id: string; data(): Record<string, unknown> | undefined }[] }> };\n};\n\n/** Every space written to the artifact's `spaces` collection. Rejects with a message fit to show the viewer. */\nexport async function loadSpaces(): Promise<LoadedSpace[]> {\n const claude = (window as unknown as { claude?: { use(name: string): Promise<unknown> } }).claude;\n const db = (claude ? await claude.use('db') : null) as Db | null;\n if (!db) throw new Error('This page needs the artifact database, which is not available to this viewer.');\n\n let timer: ReturnType<typeof setTimeout> | undefined;\n const timeout = new Promise<never>((_, reject) => {\n timer = setTimeout(() => reject(new Error('Reading the artifact database timed out.')), TIMEOUT_MS);\n });\n const snapshot = await Promise.race([db.collection(SPACES).get(), timeout]).finally(() => clearTimeout(timer));\n const spaces = snapshot.docs.flatMap((doc) => {\n const data = doc.data();\n return data ? [toSpace(doc.id, data)] : [];\n });\n if (spaces.length === 0)\n throw new Error(`Nothing to show yet: no space has been written to \"${SPACES}\" in the artifact database.`);\n return spaces;\n}\n\nfunction toSpace(name: string, data: Record<string, unknown>): LoadedSpace {\n const json = (field: string) => {\n const value = data[field];\n if (typeof value !== 'string') throw new Error(`Space \"${name}\": missing \"${field}\" in the artifact database.`);\n return JSON.parse(value);\n };\n return {\n name,\n schemaId: typeof data.schemaId === 'string' ? data.schemaId : undefined,\n graph: json('graph'),\n validation: json('validation'),\n definitions: json('definitions'),\n };\n}\n","import { useEffect, useMemo, useRef, useState } from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { spaceGraphFrom } from 'structured-context/browser';\nimport { annotationsFrom } from '../core/annotations';\nimport type { MapViewDefinition, ParameterValues } from '../core/definition';\nimport { MapView } from '../layouts/MapView';\nimport { ParameterControls } from '../layouts/ParameterControls';\nimport { type LoadedSpace, loadSpaces } from './load';\n\n/**\n * The host for a Claude artifact: renders the spaces the publishing agent wrote to the artifact's\n * db (the `export` command's document, one per space) with the parameter controls and a panel of\n * validation messages. It reads nothing else and ships as `dist/artifact.js`; `dist/artifact.html`\n * is the page that loads it. See docs/architecture.md.\n */\n\ntype State = { status: 'loading' } | { status: 'error'; message: string } | { status: 'ready'; spaces: LoadedSpace[] };\n\nfunction App() {\n const [state, setState] = useState<State>({ status: 'loading' });\n useEffect(() => {\n loadSpaces().then(\n (spaces) => setState({ status: 'ready', spaces }),\n (err) => setState({ status: 'error', message: err instanceof Error ? err.message : String(err) }),\n );\n }, []);\n if (state.status === 'loading') return <p className=\"art-message\">Loading from the artifact database…</p>;\n if (state.status === 'error') return <p className=\"art-message\">{state.message}</p>;\n return <Viewer spaces={state.spaces} />;\n}\n\nfunction Viewer({ spaces }: { spaces: LoadedSpace[] }) {\n const [spaceName, setSpaceName] = useState(spaces[0]!.name);\n const space = spaces.find((s) => s.name === spaceName)!;\n const [viewId, setViewId] = useState(space.definitions[0]?.id);\n const definition = space.definitions.find((d) => d.id === viewId) ?? space.definitions[0];\n const [values, setValues] = useState<ParameterValues>({});\n const [selectedId, setSelectedId] = useState<string>();\n\n const graph = useMemo(() => spaceGraphFrom(space.graph), [space]);\n const annotated = useMemo(() => annotationsFrom(space.validation, graph), [space, graph]);\n const mapRef = useNodeLabels(graph, definition);\n\n if (!definition) return <p className=\"art-message\">No map views apply to the schema of \"{space.name}\".</p>;\n const selected = selectedId ? graph.nodes.get(selectedId as never) : undefined;\n const results = selected ? (annotated.annotations.get(selected.id as never) ?? []) : [];\n\n return (\n <div className=\"art-root\">\n <header className=\"art-bar\">\n {spaces.length > 1 && (\n <select\n aria-label=\"Space\"\n value={spaceName}\n onChange={(e) => {\n const next = spaces.find((s) => s.name === e.target.value)!;\n setSpaceName(next.name);\n setViewId(next.definitions[0]?.id);\n setValues({});\n setSelectedId(undefined);\n }}\n >\n {spaces.map((s) => (\n <option key={s.name} value={s.name}>\n {s.name}\n </option>\n ))}\n </select>\n )}\n {space.definitions.length > 1 && (\n <select\n aria-label=\"Map view\"\n value={definition.id}\n onChange={(e) => {\n setViewId(e.target.value);\n setValues({});\n }}\n >\n {space.definitions.map((d) => (\n <option key={d.id} value={d.id}>\n {d.title}\n </option>\n ))}\n </select>\n )}\n <ParameterControls\n definition={definition}\n values={values}\n onChange={(name, value) => setValues((prev) => ({ ...prev, [name]: value }))}\n />\n </header>\n <div className=\"art-body\">\n <div className=\"art-map\" ref={mapRef}>\n <MapView\n definition={definition}\n graph={graph}\n values={values}\n annotations={annotated.annotations}\n onNodeSelect={(node) => setSelectedId(node.id)}\n />\n </div>\n {(selected || annotated.unattached.length > 0) && (\n <aside className=\"art-panel\" aria-label=\"Validation results\">\n {selected && (\n <section>\n <button type=\"button\" className=\"art-close\" aria-label=\"Close\" onClick={() => setSelectedId(undefined)}>\n ×\n </button>\n <p className=\"art-type\">{selected.resolvedType}</p>\n <h2>{selected.title}</h2>\n {results.length > 0 && (\n <>\n <h3>Validation</h3>\n <Results items={results} />\n </>\n )}\n <Fields data={selected.schemaData} />\n {selected.content && (\n <>\n <h3>Content</h3>\n <p className=\"art-content\">{selected.content}</p>\n </>\n )}\n {selected.source && <p className=\"art-muted\">{selected.source.file}</p>}\n </section>\n )}\n {annotated.unattached.length > 0 && (\n <section>\n <h3>Not on a node ({annotated.unattached.length})</h3>\n <Results items={annotated.unattached} />\n </section>\n )}\n </aside>\n )}\n </div>\n </div>\n );\n}\n\nconst SKIPPED_FIELDS = new Set(['title', 'type', 'content']);\nconst isEmpty = (v: unknown) => v === undefined || v === null || v === '' || (Array.isArray(v) && v.length === 0);\nconst asText = (v: unknown): string =>\n Array.isArray(v) ? v.map(asText).join(', ') : v !== null && typeof v === 'object' ? JSON.stringify(v) : String(v);\n\n/** The node's fields as a list; the title, type and body are shown elsewhere. */\nfunction Fields({ data }: { data: Record<string, unknown> }) {\n const fields = Object.entries(data).filter(([name, value]) => !SKIPPED_FIELDS.has(name) && !isEmpty(value));\n if (fields.length === 0) return null;\n return (\n <>\n <h3>Fields</h3>\n <dl className=\"art-fields\">\n {fields.map(([name, value]) => (\n <div key={name}>\n <dt>{name}</dt>\n <dd>{asText(value)}</dd>\n </div>\n ))}\n </dl>\n </>\n );\n}\n\nfunction Results({\n items,\n}: {\n items: readonly { severity: string; source: string; ruleId?: string; message: string; nodeId?: string }[];\n}) {\n return (\n <ul className=\"art-results\">\n {items.map((a, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a static list with no stable identity beyond position.\n <li key={i}>\n <span className={`art-severity art-${a.severity}`}>{a.severity}</span>{' '}\n <span className=\"art-muted\">{a.ruleId ? `${a.source} · ${a.ruleId}` : a.source}</span>\n {a.nodeId && <span className=\"art-muted\"> · {a.nodeId}</span>}\n <div>{a.message}</div>\n </li>\n ))}\n </ul>\n );\n}\n\n/**\n * Names each card for the viewer's comment mode, which reads the location of a comment from the\n * element's accessible name. The name leads with the map view and node id so it survives the\n * viewer's truncation, then gives the type and title: `<view>/<nodeId>: <type> <title>`. An agent\n * reading the comment resolves the id back to the node from the db.\n */\nfunction useNodeLabels(graph: ReturnType<typeof spaceGraphFrom>, definition: MapViewDefinition | undefined) {\n const ref = useRef<HTMLDivElement>(null);\n useEffect(() => {\n const root = ref.current;\n if (!root || !definition) return;\n const stamp = () => {\n for (const card of root.querySelectorAll<HTMLElement>('[data-node-id]')) {\n const node = graph.nodes.get(card.dataset.nodeId as never);\n if (node) card.setAttribute('aria-label', `${definition.id}/${node.id}: ${node.resolvedType} ${node.title}`);\n }\n };\n stamp();\n const observer = new MutationObserver(stamp);\n observer.observe(root, { childList: true, subtree: true });\n return () => observer.disconnect();\n }, [graph, definition]);\n return ref;\n}\n\ncreateRoot(document.getElementById('root')!).render(<App />);\n"],"mappings":";;;;;;AAaA,IAAM,SAAS;AACf,IAAM,aAAa;;AAOnB,eAAsB,aAAqC;CACzD,MAAM,SAAU,OAA2E;CAC3F,MAAM,KAAM,SAAS,MAAM,OAAO,IAAI,IAAI,IAAI;CAC9C,IAAI,CAAC,IAAI,MAAM,IAAI,MAAM,+EAA+E;CAExG,IAAI;CACJ,MAAM,UAAU,IAAI,SAAgB,GAAG,WAAW;EAChD,QAAQ,iBAAiB,uBAAO,IAAI,MAAM,0CAA0C,CAAC,GAAG,UAAU;CACpG,CAAC;CAED,MAAM,UAAS,MADQ,QAAQ,KAAK,CAAC,GAAG,WAAW,MAAM,CAAC,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,cAAc,aAAa,KAAK,CAAC,EAAA,CACrF,KAAK,SAAS,QAAQ;EAC5C,MAAM,OAAO,IAAI,KAAK;EACtB,OAAO,OAAO,CAAC,QAAQ,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC;CAC3C,CAAC;CACD,IAAI,OAAO,WAAW,GACpB,MAAM,IAAI,MAAM,sDAAsD,OAAO,4BAA4B;CAC3G,OAAO;AACT;AAEA,SAAS,QAAQ,MAAc,MAA4C;CACzE,MAAM,QAAQ,UAAkB;EAC9B,MAAM,QAAQ,KAAK;EACnB,IAAI,OAAO,UAAU,UAAU,MAAM,IAAI,MAAM,UAAU,KAAK,cAAc,MAAM,4BAA4B;EAC9G,OAAO,KAAK,MAAM,KAAK;CAC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BAAC,OAAD,EAAA,UAAM,EAAE,QAAa,CAAA;EACnB,EAAA,GALK,CAKL,CACL;CACC,CAAA;AAER;;;;;;;AAQA,SAAS,cAAc,OAA0C,YAA2C;CAC1G,MAAM,MAAM,OAAuB,IAAI;CACvC,gBAAgB;EACd,MAAM,OAAO,IAAI;EACjB,IAAI,CAAC,QAAQ,CAAC,YAAY;EAC1B,MAAM,cAAc;GAClB,KAAK,MAAM,QAAQ,KAAK,iBAA8B,gBAAgB,GAAG;IACvE,MAAM,OAAO,MAAM,MAAM,IAAI,KAAK,QAAQ,MAAe;IACzD,IAAI,MAAM,KAAK,aAAa,cAAc,GAAG,WAAW,GAAG,GAAG,KAAK,GAAG,IAAI,KAAK,aAAa,GAAG,KAAK,OAAO;GAC7G;EACF;EACA,MAAM;EACN,MAAM,WAAW,IAAI,iBAAiB,KAAK;EAC3C,SAAS,QAAQ,MAAM;GAAE,WAAW;GAAM,SAAS;EAAK,CAAC;EACzD,aAAa,SAAS,WAAW;CACnC,GAAG,CAAC,OAAO,UAAU,CAAC;CACtB,OAAO;AACT;AAEA,WAAW,SAAS,eAAe,MAAM,CAAE,CAAC,CAAC,OAAO,oBAAC,KAAD,CAAM,CAAA,CAAC"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
import { n as mapViewsForSchema } from "./definition-Cft28YUA.js";
|
|
3
|
+
import { t as loadMapViewDefinitions } from "./node-BceB0Wzc.js";
|
|
4
|
+
import { dirname, resolve } from "node:path";
|
|
5
|
+
import { SctxError, assembleSpaceGraph, createSpaceContext, exportSpaceGraph, loadConfig, resolveConfigPath, setConfigPath, validateSpace } from "structured-context/api";
|
|
6
|
+
import { Command } from "commander";
|
|
7
|
+
var package_default = {
|
|
8
|
+
name: "structured-context-map-views",
|
|
9
|
+
version: "0.3.0",
|
|
10
|
+
description: "Declarative map views of structured-context spaces: render a space as a tree, nested containers or an XY plot from a short definition.",
|
|
11
|
+
license: "MIT",
|
|
12
|
+
type: "module",
|
|
13
|
+
repository: {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/mindsocket/structured-context-map-views.git",
|
|
16
|
+
"directory": "packages/map-views"
|
|
17
|
+
},
|
|
18
|
+
homepage: "https://github.com/mindsocket/structured-context-map-views#readme",
|
|
19
|
+
bugs: "https://github.com/mindsocket/structured-context-map-views/issues",
|
|
20
|
+
keywords: [
|
|
21
|
+
"structured-context",
|
|
22
|
+
"visualisation",
|
|
23
|
+
"map-view",
|
|
24
|
+
"react"
|
|
25
|
+
],
|
|
26
|
+
files: ["dist/"],
|
|
27
|
+
sideEffects: false,
|
|
28
|
+
bin: { "structured-context-map-views": "dist/cli.js" },
|
|
29
|
+
exports: {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./dist/types/index.d.ts",
|
|
32
|
+
"default": "./dist/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./node": {
|
|
35
|
+
"types": "./dist/types/node/index.d.ts",
|
|
36
|
+
"default": "./dist/node.js"
|
|
37
|
+
},
|
|
38
|
+
"./styles.css": "./dist/styles.css"
|
|
39
|
+
},
|
|
40
|
+
scripts: {
|
|
41
|
+
"clean": "rm -rf dist",
|
|
42
|
+
"generate": "bun run generate:schemas && bun run generate:definitions",
|
|
43
|
+
"generate:schemas": "bun scripts/generate-schemas.ts",
|
|
44
|
+
"generate:definitions": "bun scripts/generate-definitions.ts",
|
|
45
|
+
"build": "bun run clean && bun run generate && bun --bun vite build && tsc -p tsconfig.build.json && tailwindcss -i src/layouts/styles.css -o dist/styles.css && bun scripts/build-artifact-page.ts",
|
|
46
|
+
"typecheck": "tsc --noEmit",
|
|
47
|
+
"capture-fixtures": "bun scripts/capture-fixtures.ts",
|
|
48
|
+
"test": "bun test",
|
|
49
|
+
"test:package": "bash scripts/test-package.sh",
|
|
50
|
+
"prepublishOnly": "bun run build",
|
|
51
|
+
"preversion": "bun run generate && bun run --cwd ../.. lint:fix && bun run --cwd ../.. test && bun run test:package",
|
|
52
|
+
"version": "bun run generate:schemas --release && git add -A"
|
|
53
|
+
},
|
|
54
|
+
peerDependencies: {
|
|
55
|
+
"react": "^19.3.0",
|
|
56
|
+
"react-dom": "^19.3.0",
|
|
57
|
+
"structured-context": "^0.21.0"
|
|
58
|
+
},
|
|
59
|
+
dependencies: {
|
|
60
|
+
"ajv": "^8.20.0",
|
|
61
|
+
"commander": "^15.0.0",
|
|
62
|
+
"json-schema-to-ts": "^3.1.1",
|
|
63
|
+
"json5": "^2.2.3"
|
|
64
|
+
},
|
|
65
|
+
devDependencies: {
|
|
66
|
+
"@tailwindcss/cli": "^4.3.3",
|
|
67
|
+
"@types/node": "^22.20.5",
|
|
68
|
+
"@types/react": "^19.3.0",
|
|
69
|
+
"@types/react-dom": "^19.3.0",
|
|
70
|
+
"@vitejs/plugin-react": "^6.1.1",
|
|
71
|
+
"react": "^19.3.0",
|
|
72
|
+
"react-dom": "^19.3.0",
|
|
73
|
+
"structured-context": "^0.21.0",
|
|
74
|
+
"tailwindcss": "^4.3.3",
|
|
75
|
+
"vite": "^8.3.2"
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/node/snapshot.ts
|
|
80
|
+
/**
|
|
81
|
+
* Node-only: snapshot a space for a browser-only host. Validation is structured-context's own
|
|
82
|
+
* `validateSpace`, which also decides whether a judge runs.
|
|
83
|
+
*/
|
|
84
|
+
async function exportSnapshot(spaceName, config, configDir, validateOptions = {}) {
|
|
85
|
+
const context = createSpaceContext(spaceName, config);
|
|
86
|
+
const graph = await assembleSpaceGraph(context, {});
|
|
87
|
+
const schemaId = context.schema.$id;
|
|
88
|
+
return {
|
|
89
|
+
space: spaceName,
|
|
90
|
+
schemaId,
|
|
91
|
+
graph: exportSpaceGraph(graph.nodes.values(), context.schema.metadata),
|
|
92
|
+
validation: await validateSpace(context, validateOptions),
|
|
93
|
+
definitions: mapViewsForSchema(loadMapViewDefinitions(config, { configDir }), schemaId)
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/node/cli.ts
|
|
98
|
+
var program = new Command();
|
|
99
|
+
program.name("structured-context-map-views").description("Map view tools for structured-context spaces").version(package_default.version).option("--config <path>", "Path to config file (overrides config discovery)");
|
|
100
|
+
program.command("export").description("Print a JSON snapshot of a space: its graph, validation results and map view definitions").argument("<space-name>", "Space name").option("--depth <n>", "Validate only hierarchy nodes within N levels from the top", (v) => parseInt(v, 10)).option("--include-gated", "Evaluate rules even on nodes gated by an upstream failure").option("--rule-filter <dimension=values>", "Evaluate only matching rules; dimensions: category, severity, type, id (repeatable, e.g. severity=error)", (v, prev = []) => [...prev, v]).option("--semantic [provider]", "Evaluate semantic rules, with the configured model provider or the one named").action(async (spaceName, options) => {
|
|
101
|
+
setConfigPath(program.opts().config);
|
|
102
|
+
try {
|
|
103
|
+
const result = await exportSnapshot(spaceName, loadConfig(), dirname(resolve(resolveConfigPath().path)), options);
|
|
104
|
+
process.stdout.write(`${JSON.stringify(result)}\n`);
|
|
105
|
+
} catch (err) {
|
|
106
|
+
if (!(err instanceof SctxError)) throw err;
|
|
107
|
+
console.error(`${err.code}: ${err.message}`);
|
|
108
|
+
process.exitCode = 1;
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
await program.parseAsync();
|
|
112
|
+
//#endregion
|
|
113
|
+
|
|
114
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","names":["packageJson"],"sources":["../package.json","../src/node/snapshot.ts","../src/node/cli.ts"],"sourcesContent":["{\n \"name\": \"structured-context-map-views\",\n \"version\": \"0.3.0\",\n \"description\": \"Declarative map views of structured-context spaces: render a space as a tree, nested containers or an XY plot from a short definition.\",\n \"license\": \"MIT\",\n \"type\": \"module\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/mindsocket/structured-context-map-views.git\",\n \"directory\": \"packages/map-views\"\n },\n \"homepage\": \"https://github.com/mindsocket/structured-context-map-views#readme\",\n \"bugs\": \"https://github.com/mindsocket/structured-context-map-views/issues\",\n \"keywords\": [\n \"structured-context\",\n \"visualisation\",\n \"map-view\",\n \"react\"\n ],\n \"files\": [\n \"dist/\"\n ],\n \"sideEffects\": false,\n \"bin\": {\n \"structured-context-map-views\": \"dist/cli.js\"\n },\n \"exports\": {\n \".\": {\n \"types\": \"./dist/types/index.d.ts\",\n \"default\": \"./dist/index.js\"\n },\n \"./node\": {\n \"types\": \"./dist/types/node/index.d.ts\",\n \"default\": \"./dist/node.js\"\n },\n \"./styles.css\": \"./dist/styles.css\"\n },\n \"scripts\": {\n \"clean\": \"rm -rf dist\",\n \"generate\": \"bun run generate:schemas && bun run generate:definitions\",\n \"generate:schemas\": \"bun scripts/generate-schemas.ts\",\n \"generate:definitions\": \"bun scripts/generate-definitions.ts\",\n \"build\": \"bun run clean && bun run generate && bun --bun vite build && tsc -p tsconfig.build.json && tailwindcss -i src/layouts/styles.css -o dist/styles.css && bun scripts/build-artifact-page.ts\",\n \"typecheck\": \"tsc --noEmit\",\n \"capture-fixtures\": \"bun scripts/capture-fixtures.ts\",\n \"test\": \"bun test\",\n \"test:package\": \"bash scripts/test-package.sh\",\n \"prepublishOnly\": \"bun run build\",\n \"preversion\": \"bun run generate && bun run --cwd ../.. lint:fix && bun run --cwd ../.. test && bun run test:package\",\n \"version\": \"bun run generate:schemas --release && git add -A\"\n },\n \"peerDependencies\": {\n \"react\": \"^19.3.0\",\n \"react-dom\": \"^19.3.0\",\n \"structured-context\": \"^0.21.0\"\n },\n \"dependencies\": {\n \"ajv\": \"^8.20.0\",\n \"commander\": \"^15.0.0\",\n \"json-schema-to-ts\": \"^3.1.1\",\n \"json5\": \"^2.2.3\"\n },\n \"devDependencies\": {\n \"@tailwindcss/cli\": \"^4.3.3\",\n \"@types/node\": \"^22.20.5\",\n \"@types/react\": \"^19.3.0\",\n \"@types/react-dom\": \"^19.3.0\",\n \"@vitejs/plugin-react\": \"^6.1.1\",\n \"react\": \"^19.3.0\",\n \"react-dom\": \"^19.3.0\",\n \"structured-context\": \"^0.21.0\",\n \"tailwindcss\": \"^4.3.3\",\n \"vite\": \"^8.3.2\"\n }\n}\n","import {\n assembleSpaceGraph,\n type Config,\n createSpaceContext,\n exportSpaceGraph,\n validateSpace,\n} from 'structured-context/api';\nimport { type MapViewDefinition, mapViewsForSchema } from '../core/definition';\nimport { loadMapViewDefinitions } from './index';\n\n/**\n * Everything a host without filesystem access needs to render a space: its graph, the validation\n * results that attach to nodes, and the map view definitions that apply to its schema. Plain JSON.\n */\nexport type SpaceSnapshot = {\n space: string;\n schemaId: string | undefined;\n graph: ReturnType<typeof exportSpaceGraph>;\n validation: Awaited<ReturnType<typeof validateSpace>>;\n definitions: MapViewDefinition[];\n};\n\n/** The `validateSpace` options `export` passes through unchanged. */\nexport type ExportValidateOptions = Pick<\n NonNullable<Parameters<typeof validateSpace>[1]>,\n 'depth' | 'includeGated' | 'semantic' | 'ruleFilter'\n>;\n\n/**\n * Node-only: snapshot a space for a browser-only host. Validation is structured-context's own\n * `validateSpace`, which also decides whether a judge runs.\n */\nexport async function exportSnapshot(\n spaceName: string,\n config: Config,\n configDir?: string,\n validateOptions: ExportValidateOptions = {},\n): Promise<SpaceSnapshot> {\n const context = createSpaceContext(spaceName, config);\n const graph = await assembleSpaceGraph(context, {});\n const schemaId = context.schema.$id;\n return {\n space: spaceName,\n schemaId,\n graph: exportSpaceGraph(graph.nodes.values(), context.schema.metadata),\n validation: await validateSpace(context, validateOptions),\n definitions: mapViewsForSchema(loadMapViewDefinitions(config, { configDir }), schemaId),\n };\n}\n","#!/usr/bin/env bun\nimport { dirname, resolve } from 'node:path';\nimport { Command } from 'commander';\nimport { loadConfig, resolveConfigPath, SctxError, setConfigPath } from 'structured-context/api';\nimport packageJson from '../../package.json' with { type: 'json' };\nimport { type ExportValidateOptions, exportSnapshot } from './snapshot';\n\nconst program = new Command();\n\nprogram\n .name('structured-context-map-views')\n .description('Map view tools for structured-context spaces')\n .version(packageJson.version)\n .option('--config <path>', 'Path to config file (overrides config discovery)');\n\nprogram\n .command('export')\n .description('Print a JSON snapshot of a space: its graph, validation results and map view definitions')\n .argument('<space-name>', 'Space name')\n .option('--depth <n>', 'Validate only hierarchy nodes within N levels from the top', (v) => parseInt(v, 10))\n .option('--include-gated', 'Evaluate rules even on nodes gated by an upstream failure')\n .option(\n '--rule-filter <dimension=values>',\n 'Evaluate only matching rules; dimensions: category, severity, type, id (repeatable, e.g. severity=error)',\n (v: string, prev: string[] = []) => [...prev, v],\n )\n .option('--semantic [provider]', 'Evaluate semantic rules, with the configured model provider or the one named')\n .action(async (spaceName: string, options: ExportValidateOptions) => {\n setConfigPath(program.opts().config);\n try {\n const config = loadConfig();\n const configDir = dirname(resolve(resolveConfigPath().path));\n const result = await exportSnapshot(spaceName, config, configDir, options);\n process.stdout.write(`${JSON.stringify(result)}\\n`);\n } catch (err) {\n if (!(err instanceof SctxError)) throw err;\n console.error(`${err.code}: ${err.message}`);\n process.exitCode = 1;\n }\n });\n\nawait program.parseAsync();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACgCA,eAAsB,eACpB,WACA,QACA,WACA,kBAAyC,CAAC,GAClB;CACxB,MAAM,UAAU,mBAAmB,WAAW,MAAM;CACpD,MAAM,QAAQ,MAAM,mBAAmB,SAAS,CAAC,CAAC;CAClD,MAAM,WAAW,QAAQ,OAAO;CAChC,OAAO;EACL,OAAO;EACP;EACA,OAAO,iBAAiB,MAAM,MAAM,OAAO,GAAG,QAAQ,OAAO,QAAQ;EACrE,YAAY,MAAM,cAAc,SAAS,eAAe;EACxD,aAAa,kBAAkB,uBAAuB,QAAQ,EAAE,UAAU,CAAC,GAAG,QAAQ;CACxF;AACF;;;ACzCA,IAAM,UAAU,IAAI,QAAQ;AAE5B,QACG,KAAK,8BAA8B,CAAC,CACpC,YAAY,8CAA8C,CAAC,CAC3D,QAAQA,gBAAY,OAAO,CAAC,CAC5B,OAAO,mBAAmB,kDAAkD;AAE/E,QACG,QAAQ,QAAQ,CAAC,CACjB,YAAY,0FAA0F,CAAC,CACvG,SAAS,gBAAgB,YAAY,CAAC,CACtC,OAAO,eAAe,+DAA+D,MAAM,SAAS,GAAG,EAAE,CAAC,CAAC,CAC3G,OAAO,mBAAmB,2DAA2D,CAAC,CACtF,OACC,oCACA,6GACC,GAAW,OAAiB,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CACjD,CAAC,CACA,OAAO,yBAAyB,8EAA8E,CAAC,CAC/G,OAAO,OAAO,WAAmB,YAAmC;CACnE,cAAc,QAAQ,KAAK,CAAC,CAAC,MAAM;CACnC,IAAI;EAGF,MAAM,SAAS,MAAM,eAAe,WAFrB,WAEgC,GAD7B,QAAQ,QAAQ,kBAAkB,CAAC,CAAC,IAAI,CACH,GAAW,OAAO;EACzE,QAAQ,OAAO,MAAM,GAAG,KAAK,UAAU,MAAM,EAAE,GAAG;CACpD,SAAS,KAAK;EACZ,IAAI,EAAE,eAAe,YAAY,MAAM;EACvC,QAAQ,MAAM,GAAG,IAAI,KAAK,IAAI,IAAI,SAAS;EAC3C,QAAQ,WAAW;CACrB;AACF,CAAC;AAEH,MAAM,QAAQ,WAAW"}
|
|
@@ -3,7 +3,7 @@ import JSON5 from "json5";
|
|
|
3
3
|
/** Base of the `$id`s the sources use: the `latest` folder. */
|
|
4
4
|
var SCHEMA_URL = `https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest`;
|
|
5
5
|
//#endregion
|
|
6
|
-
//#region src/core/
|
|
6
|
+
//#region src/core/format/param-ref.ts
|
|
7
7
|
/** `$ref` target for a setting whose value comes from a declared parameter. */
|
|
8
8
|
var PARAM_REF = `${SCHEMA_URL}/definition.json#/$defs/paramRef`;
|
|
9
9
|
/** A setting that takes either a fixed value matching `valueSchema` or a `{ $param }` binding. */
|
|
@@ -15,7 +15,7 @@ function parameterisable(valueSchema, defaultValue, description) {
|
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
//#endregion
|
|
18
|
-
//#region src/core/
|
|
18
|
+
//#region src/core/format/definition-schema.ts
|
|
19
19
|
/**
|
|
20
20
|
* The map view definition format: shared parameters, and the regions a map view is composed of.
|
|
21
21
|
*
|
|
@@ -122,7 +122,13 @@ var definitionSchema = {
|
|
|
122
122
|
default: {},
|
|
123
123
|
properties: {
|
|
124
124
|
style: parameterisable({ $ref: `${SCHEMA_URL}/settings.json#/$defs/nodeStyle` }, "card", "How nodes are drawn."),
|
|
125
|
-
fields: parameterisable({ $ref: `${SCHEMA_URL}/settings.json#/$defs/fieldList` }, [], "Schema fields shown on cards.")
|
|
125
|
+
fields: parameterisable({ $ref: `${SCHEMA_URL}/settings.json#/$defs/fieldList` }, [], "Schema fields shown on cards."),
|
|
126
|
+
validation: parameterisable({ $ref: `${SCHEMA_URL}/settings.json#/$defs/validationLevel` }, "off", "The lowest severity of validation result shown on nodes, or off. Needs the host to supply results."),
|
|
127
|
+
validationSources: parameterisable({ $ref: `${SCHEMA_URL}/settings.json#/$defs/validationSources` }, [
|
|
128
|
+
"schema",
|
|
129
|
+
"hierarchy",
|
|
130
|
+
"rule"
|
|
131
|
+
], "Which kinds of validation result are shown.")
|
|
126
132
|
}
|
|
127
133
|
},
|
|
128
134
|
edges: {
|
|
@@ -136,7 +142,7 @@ var definitionSchema = {
|
|
|
136
142
|
}
|
|
137
143
|
};
|
|
138
144
|
//#endregion
|
|
139
|
-
//#region src/core/
|
|
145
|
+
//#region src/core/format/landscape-layout.ts
|
|
140
146
|
/** Settings of the landscape layout: nested containers following an authored grouping. */
|
|
141
147
|
var landscapeLayoutSchema = {
|
|
142
148
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
@@ -214,7 +220,7 @@ var landscapeLayoutSchema = {
|
|
|
214
220
|
} }
|
|
215
221
|
};
|
|
216
222
|
//#endregion
|
|
217
|
-
//#region src/core/
|
|
223
|
+
//#region src/core/format/index.ts
|
|
218
224
|
/** The bundled schemas describing the map view definition format. */
|
|
219
225
|
var MAP_VIEW_SCHEMAS = [
|
|
220
226
|
definitionSchema,
|
|
@@ -233,6 +239,27 @@ var MAP_VIEW_SCHEMAS = [
|
|
|
233
239
|
description: "card: a box with the title and selected fields. shape: a compact marker with a tooltip.",
|
|
234
240
|
enum: ["card", "shape"]
|
|
235
241
|
},
|
|
242
|
+
validationLevel: {
|
|
243
|
+
title: "Validation overlay",
|
|
244
|
+
description: "The lowest severity of validation result shown on nodes, or off. error: only errors. warning: errors and warnings. info: everything.",
|
|
245
|
+
enum: [
|
|
246
|
+
"off",
|
|
247
|
+
"error",
|
|
248
|
+
"warning",
|
|
249
|
+
"info"
|
|
250
|
+
]
|
|
251
|
+
},
|
|
252
|
+
validationSources: {
|
|
253
|
+
title: "Validation sources",
|
|
254
|
+
description: "Which kinds of validation result are shown. schema: a node failing its schema. hierarchy: a node under a parent type it is not allowed under. rule: a schema rule violation.",
|
|
255
|
+
type: "array",
|
|
256
|
+
items: { enum: [
|
|
257
|
+
"schema",
|
|
258
|
+
"hierarchy",
|
|
259
|
+
"rule"
|
|
260
|
+
] },
|
|
261
|
+
uniqueItems: true
|
|
262
|
+
},
|
|
236
263
|
fieldList: {
|
|
237
264
|
title: "Fields",
|
|
238
265
|
type: "array",
|
|
@@ -419,6 +446,13 @@ function resolveRegions(definition, values = {}) {
|
|
|
419
446
|
function selectionFilter(definition, values = {}) {
|
|
420
447
|
return resolveRegions(definition, values)[0]?.select?.filter;
|
|
421
448
|
}
|
|
449
|
+
/**
|
|
450
|
+
* The lowest severity of validation result the map view shows on nodes, or `off`. Hosts check it to
|
|
451
|
+
* decide whether to run validation at all, since results are only drawn when this isn't `off`.
|
|
452
|
+
*/
|
|
453
|
+
function viewValidationLevel(definition, values = {}) {
|
|
454
|
+
return resolveRegions(definition, values)[0]?.nodes.validation ?? "off";
|
|
455
|
+
}
|
|
422
456
|
/** Map view definitions that apply to a space with the given schema. */
|
|
423
457
|
function mapViewsForSchema(definitions, schemaId) {
|
|
424
458
|
return schemaId === void 0 ? [] : definitions.filter((d) => d.schema === schemaId);
|
|
@@ -577,6 +611,6 @@ function detail(error) {
|
|
|
577
611
|
return "";
|
|
578
612
|
}
|
|
579
613
|
//#endregion
|
|
580
|
-
export { resolveRegions as a, resolveParameterValues as i, mapViewsForSchema as n, selectionFilter as o, parseMapViewDefinition as r,
|
|
614
|
+
export { resolveRegions as a, MAP_VIEW_SCHEMAS as c, resolveParameterValues as i, mapViewsForSchema as n, selectionFilter as o, parseMapViewDefinition as r, viewValidationLevel as s, MapViewDefinitionError as t };
|
|
581
615
|
|
|
582
|
-
//# sourceMappingURL=definition-
|
|
616
|
+
//# sourceMappingURL=definition-Cft28YUA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definition-Cft28YUA.js","names":[],"sources":["../src/core/format/schema-url.ts","../src/core/format/param-ref.ts","../src/core/format/definition-schema.ts","../src/core/format/landscape-layout.ts","../src/core/format/settings.ts","../src/core/format/tree-layout.ts","../src/core/format/xy-layout.ts","../src/core/format/index.ts","../src/core/definition.ts"],"sourcesContent":["/**\n * Where the format schemas are published. `latest` follows the newest format; a release that changes it\n * freezes a copy under its own version folder (`bun run generate:schemas --release`).\n */\nexport const SCHEMA_BASE_URL =\n 'https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated';\n\n/** Base of the `$id`s the sources use: the `latest` folder. */\nexport const SCHEMA_URL = `${SCHEMA_BASE_URL}/latest` as const;\n","import { SCHEMA_URL } from './schema-url';\n/** `$ref` target for a setting whose value comes from a declared parameter. */\nexport const PARAM_REF = `${SCHEMA_URL}/definition.json#/$defs/paramRef` as const;\n\n/** A setting that takes either a fixed value matching `valueSchema` or a `{ $param }` binding. */\nexport function parameterisable<const S extends object, const D>(valueSchema: S, defaultValue: D, description: string) {\n return { description, default: defaultValue, anyOf: [valueSchema, { $ref: PARAM_REF }] } as const;\n}\n","import { PARAM_REF, parameterisable } from './param-ref';\nimport { SCHEMA_URL } from './schema-url';\n\n/**\n * The map view definition format: shared parameters, and the regions a map view is composed of.\n *\n * Written as TypeScript so the definition types derive from it (`FromSchema`); the JSON files\n * for `$schema` references and editors are generated (`bun run generate:schemas`).\n */\nexport const definitionSchema = {\n $schema: 'https://json-schema.org/draft/2020-12/schema',\n $id: `${SCHEMA_URL}/definition.json`,\n title: 'Map view definition',\n description:\n 'Declares how spaces of one schema are projected into a map view: shared parameters, and the regions the map view is composed of.',\n type: 'object',\n required: ['$id', 'schema', 'regions'],\n additionalProperties: false,\n properties: {\n $schema: { type: 'string' },\n $id: {\n type: 'string',\n pattern: '^sctx-map-view://[^/]+(/[^/]+)?$',\n description:\n 'Identifier, namespaced by where the definition is found: \"sctx-map-view://core/<name>\" (bundled), \"sctx-map-view://<plugin>/<name>\" (a plugin) or \"sctx-map-view://<name>\" (the config folder).',\n },\n title: { type: 'string', minLength: 1, description: 'Display name. Defaults to the last segment of the `$id`.' },\n description: { type: 'string' },\n schema: {\n type: 'string',\n minLength: 1,\n description: '`$id` of the structured-context schema whose spaces this map view applies to.',\n },\n parameters: {\n type: 'object',\n description:\n 'Settings the reader can change. Each is a JSON Schema with a default, bound to settings anywhere in the definition with { \"$param\": \"<name>\" }.',\n additionalProperties: { $ref: '#/$defs/parameter' },\n },\n regions: {\n type: 'array',\n minItems: 1,\n description:\n 'Parts of the map view, each with its own layout, nodes and edges. Only the first region is rendered for now.',\n items: { $ref: '#/$defs/region' },\n },\n },\n $defs: {\n parameter: {\n type: 'object',\n description:\n \"A JSON Schema for the parameter's values (it can $ref, narrow or extend the bundled setting definitions), plus a title for its control.\",\n required: ['default'],\n properties: {\n title: { type: 'string' },\n description: { type: 'string' },\n default: {},\n },\n },\n paramRef: {\n type: 'object',\n description: \"Takes this setting's value from a declared parameter.\",\n required: ['$param'],\n additionalProperties: false,\n properties: { $param: { type: 'string', minLength: 1 } },\n },\n region: {\n type: 'object',\n required: ['id', 'layout'],\n additionalProperties: false,\n properties: {\n id: {\n type: 'string',\n minLength: 1,\n description: 'Unique within the map view; part of every occurrence id in the region.',\n },\n select: {\n type: 'object',\n description: 'Which nodes of the space the region shows. By default, all of them.',\n additionalProperties: false,\n properties: {\n filter: {\n type: 'string',\n minLength: 1,\n description:\n \"A structured-context filter: a view name from the space's config, or an expression such as `WHERE …` or `SELECT … WHERE …`.\",\n },\n },\n },\n layout: {\n description: 'How the region is arranged, chosen by `type`.',\n type: 'object',\n required: ['type'],\n // Ajv validates only the branch `type` selects, so errors name that layout's settings.\n discriminator: { propertyName: 'type' },\n oneOf: [\n { $ref: `${SCHEMA_URL}/layouts/tree.json` },\n { $ref: `${SCHEMA_URL}/layouts/landscape.json` },\n { $ref: `${SCHEMA_URL}/layouts/xy.json` },\n ],\n },\n nodes: {\n type: 'object',\n additionalProperties: false,\n default: {},\n properties: {\n style: parameterisable(\n { $ref: `${SCHEMA_URL}/settings.json#/$defs/nodeStyle` },\n 'card',\n 'How nodes are drawn.',\n ),\n fields: parameterisable(\n { $ref: `${SCHEMA_URL}/settings.json#/$defs/fieldList` },\n [],\n 'Schema fields shown on cards.',\n ),\n validation: parameterisable(\n { $ref: `${SCHEMA_URL}/settings.json#/$defs/validationLevel` },\n 'off',\n 'The lowest severity of validation result shown on nodes, or off. Needs the host to supply results.',\n ),\n validationSources: parameterisable(\n { $ref: `${SCHEMA_URL}/settings.json#/$defs/validationSources` },\n ['schema', 'hierarchy', 'rule'],\n 'Which kinds of validation result are shown.',\n ),\n },\n },\n edges: {\n type: 'object',\n additionalProperties: false,\n default: {},\n properties: {\n show: parameterisable({ type: 'boolean' }, true, 'Whether connectors are drawn.'),\n },\n },\n },\n },\n },\n} as const;\n\nexport { PARAM_REF };\n","import { PARAM_REF, parameterisable } from './param-ref';\nimport { SCHEMA_URL } from './schema-url';\n\n/** Settings of the landscape layout: nested containers following an authored grouping. */\nexport const landscapeLayoutSchema = {\n $schema: 'https://json-schema.org/draft/2020-12/schema',\n $id: `${SCHEMA_URL}/layouts/landscape.json`,\n title: 'Landscape layout',\n description:\n 'Nested containers: each grouping level becomes containers inside the level above, and the last level is drawn as nodes.',\n type: 'object',\n required: ['type', 'group'],\n additionalProperties: false,\n properties: {\n type: { const: 'landscape' },\n orientation: parameterisable(\n { $ref: `${SCHEMA_URL}/settings.json#/$defs/orientation` },\n 'horizontal',\n 'horizontal: top-level containers side by side, as columns. vertical: stacked, as rows.',\n ),\n group: {\n type: 'array',\n minItems: 1,\n description:\n 'Grouping levels, outermost first. The last level is drawn as nodes; the others as containers. Adjacent node levels are joined by any edge between their types, in either direction.',\n // Dispatch on `field`, so errors come from the kind of level written, not both.\n items: {\n type: 'object',\n if: { type: 'object', required: ['field'] },\n // biome-ignore lint/suspicious/noThenProperty: JSON Schema's `then` keyword.\n then: {\n type: 'object',\n description:\n \"Containers labelled by the values of a field of the next node level's nodes. A node with several values appears under each.\",\n required: ['field'],\n additionalProperties: false,\n properties: { field: { type: 'string', minLength: 1 } },\n },\n else: {\n type: 'object',\n description: 'A level of nodes of one type.',\n required: ['type'],\n additionalProperties: false,\n properties: {\n type: {\n description: 'Node type at this level.',\n anyOf: [{ type: 'string', minLength: 1 }, { $ref: PARAM_REF }],\n },\n edge: {\n type: 'object',\n description:\n 'Which edges join this level to the node level above (or to the last `via` type). By default, any edge between the two types.',\n required: ['field'],\n additionalProperties: false,\n properties: { field: { type: 'string', minLength: 1 } },\n },\n via: {\n type: 'array',\n minItems: 1,\n description:\n 'Types skipped between the node level above and this one, in order. Nodes are joined through a chain of edges across them. Ignored on the first level, which has no level above.',\n items: { type: 'string', minLength: 1 },\n },\n intermediate: parameterisable(\n { $ref: `${SCHEMA_URL}/layouts/landscape.json#/$defs/intermediate` },\n 'hidden',\n 'How the skipped nodes of a `via` chain are shown.',\n ),\n },\n },\n },\n },\n },\n $defs: {\n intermediate: {\n title: 'Skipped levels',\n description: 'hidden: not shown. breadcrumb: listed on each node reached through them.',\n enum: ['hidden', 'breadcrumb'],\n },\n },\n} as const;\n","import { SCHEMA_URL } from './schema-url';\n/** Reusable setting definitions. Parameters can `$ref` these and narrow them, e.g. with `allOf` and `enum`. */\nexport const settingsSchema = {\n $schema: 'https://json-schema.org/draft/2020-12/schema',\n $id: `${SCHEMA_URL}/settings.json`,\n title: 'Shared map view settings',\n description: 'Reusable setting definitions. Parameters can $ref these and narrow them, e.g. with allOf and enum.',\n $defs: {\n orientation: {\n title: 'Orientation',\n enum: ['vertical', 'horizontal'],\n },\n nodeStyle: {\n title: 'Node style',\n description: 'card: a box with the title and selected fields. shape: a compact marker with a tooltip.',\n enum: ['card', 'shape'],\n },\n validationLevel: {\n title: 'Validation overlay',\n description:\n 'The lowest severity of validation result shown on nodes, or off. error: only errors. warning: errors and warnings. info: everything.',\n enum: ['off', 'error', 'warning', 'info'],\n },\n validationSources: {\n title: 'Validation sources',\n description:\n 'Which kinds of validation result are shown. schema: a node failing its schema. hierarchy: a node under a parent type it is not allowed under. rule: a schema rule violation.',\n type: 'array',\n items: { enum: ['schema', 'hierarchy', 'rule'] },\n uniqueItems: true,\n },\n fieldList: {\n title: 'Fields',\n type: 'array',\n items: { type: 'string', minLength: 1 },\n uniqueItems: true,\n },\n },\n} as const;\n","import { parameterisable } from './param-ref';\nimport { SCHEMA_URL } from './schema-url';\n\n/** Settings of the tree layout: a tree over the schema's hierarchy. */\nexport const treeLayoutSchema = {\n $schema: 'https://json-schema.org/draft/2020-12/schema',\n $id: `${SCHEMA_URL}/layouts/tree.json`,\n title: 'Tree layout',\n description: \"A tree over the schema's hierarchy: root-type nodes at the top, children via hierarchy edges.\",\n type: 'object',\n required: ['type'],\n additionalProperties: false,\n properties: {\n type: { const: 'tree' },\n orientation: parameterisable(\n { $ref: `${SCHEMA_URL}/settings.json#/$defs/orientation` },\n 'vertical',\n 'Direction the tree grows.',\n ),\n dag: parameterisable(\n { $ref: `${SCHEMA_URL}/layouts/tree.json#/$defs/dag` },\n 'repeat',\n 'How a node with several parents is shown.',\n ),\n },\n $defs: {\n dag: {\n title: 'Nodes with several parents',\n description:\n 'repeat: the node appears under each parent, its subtree shown once. cross-edge: the node appears under its first parent, with extra connectors from the others.',\n enum: ['repeat', 'cross-edge'],\n },\n },\n} as const;\n","import { PARAM_REF, parameterisable } from './param-ref';\nimport { SCHEMA_URL } from './schema-url';\n\n/** Settings of the XY layout: nodes positioned by two numeric fields. */\nexport const xyLayoutSchema = {\n $schema: 'https://json-schema.org/draft/2020-12/schema',\n $id: `${SCHEMA_URL}/layouts/xy.json`,\n title: 'XY layout',\n description:\n 'Nodes positioned on two axes by numeric fields. Nodes of the plotted types without a usable value on both axes are listed beside the plot, not dropped.',\n type: 'object',\n required: ['type', 'x', 'y'],\n additionalProperties: false,\n properties: {\n type: { const: 'xy' },\n x: { $ref: `${SCHEMA_URL}/layouts/xy.json#/$defs/axis` },\n y: { $ref: `${SCHEMA_URL}/layouts/xy.json#/$defs/axis` },\n types: parameterisable(\n { type: 'array', items: { type: 'string', minLength: 1 }, uniqueItems: true },\n [],\n 'Node types to plot. Empty: every type with a value on either axis.',\n ),\n edgeFields: parameterisable(\n { $ref: `${SCHEMA_URL}/settings.json#/$defs/fieldList` },\n [],\n 'Fields whose edges are drawn between plotted nodes. Empty: all edges.',\n ),\n },\n $defs: {\n axis: {\n title: 'Axis',\n type: 'object',\n required: ['field'],\n additionalProperties: false,\n properties: {\n field: {\n description: 'Numeric field giving the position.',\n anyOf: [{ type: 'string', minLength: 1 }, { $ref: PARAM_REF }],\n },\n domain: {\n description:\n 'Values at the two ends of the axis: [min, max], or \"data\" for the smallest and largest plotted values. Nodes outside a fixed domain are listed as unplaced.',\n default: 'data',\n anyOf: [{ const: 'data' }, { type: 'array', items: { type: 'number' }, minItems: 2, maxItems: 2 }],\n },\n direction: parameterisable(\n { $ref: `${SCHEMA_URL}/layouts/xy.json#/$defs/direction` },\n 'ascending',\n 'ascending: values grow rightwards (x) or upwards (y). descending: the reverse.',\n ),\n label: { type: 'string', description: 'Axis title. Defaults to the field name.' },\n },\n },\n direction: {\n title: 'Axis direction',\n enum: ['ascending', 'descending'],\n },\n },\n} as const;\n","import { definitionSchema } from './definition-schema';\nimport { landscapeLayoutSchema } from './landscape-layout';\nimport { settingsSchema } from './settings';\nimport { treeLayoutSchema } from './tree-layout';\nimport { xyLayoutSchema } from './xy-layout';\n\nexport { PARAM_REF } from './param-ref';\nexport { definitionSchema, landscapeLayoutSchema, settingsSchema, treeLayoutSchema, xyLayoutSchema };\n\n/** The bundled schemas describing the map view definition format. */\nexport const MAP_VIEW_SCHEMAS = [\n definitionSchema,\n settingsSchema,\n treeLayoutSchema,\n landscapeLayoutSchema,\n xyLayoutSchema,\n] as const;\n","import Ajv2020, { type AnySchemaObject, type ErrorObject } from 'ajv/dist/2020';\nimport type { FromSchema } from 'json-schema-to-ts';\nimport JSON5 from 'json5';\nimport {\n definitionSchema,\n type landscapeLayoutSchema,\n MAP_VIEW_SCHEMAS,\n type settingsSchema,\n type treeLayoutSchema,\n type xyLayoutSchema,\n} from './format';\nimport { SCHEMA_URL } from './format/schema-url';\n\nexport { MAP_VIEW_SCHEMAS };\n\ntype References = {\n references: [\n typeof settingsSchema,\n typeof treeLayoutSchema,\n typeof landscapeLayoutSchema,\n typeof xyLayoutSchema,\n typeof definitionSchema,\n ];\n // Grouping levels dispatch with if/then/else (see the landscape layout schema).\n parseIfThenElseKeywords: true;\n};\ntype ParamRef = { $param: string };\n/** Drop `{ $param }` bindings from every setting's type: what remains after resolution. */\ntype Resolved<T> = T extends ParamRef\n ? never\n : T extends readonly (infer U)[]\n ? Resolved<U>[]\n : T extends object\n ? { [K in keyof T]: Resolved<T[K]> }\n : T;\n\n/** A definition as authored: settings may be `{ $param }` bindings, defaulted properties may be absent. */\nexport type AuthoredDefinition = FromSchema<\n typeof definitionSchema,\n References & { keepDefaultedPropertiesOptional: true }\n>;\ntype FilledDefinition = FromSchema<typeof definitionSchema, References>;\n\n/** A region with parameters applied and defaults filled in: what layouts receive. */\nexport type Region = Resolved<FilledDefinition['regions'][number]>;\nexport type LayoutConfig = Region['layout'];\nexport type TreeLayoutConfig = Extract<LayoutConfig, { type: 'tree' }>;\nexport type LandscapeLayoutConfig = Extract<LayoutConfig, { type: 'landscape' }>;\nexport type XYLayoutConfig = Extract<LayoutConfig, { type: 'xy' }>;\nexport type AxisConfig = XYLayoutConfig['x'];\nexport type GroupLevel = LandscapeLayoutConfig['group'][number];\nexport type IntermediateDisplay = Extract<GroupLevel, { type: string }>['intermediate'];\nexport type NodesConfig = Region['nodes'];\nexport type EdgesConfig = Region['edges'];\nexport type Orientation = TreeLayoutConfig['orientation'];\nexport type DagMode = TreeLayoutConfig['dag'];\nexport type NodeStyle = NodesConfig['style'];\n\n/**\n * A validated map view definition. Plain data, so hosts can pass it across a server/browser\n * boundary. Settings in `source` may still be `{ $param }` bindings; {@link resolveRegions}\n * replaces them with parameter values.\n */\nexport type MapViewDefinition = {\n /** The definition's `$id`. */\n id: string;\n title: string;\n description?: string;\n /** `$id` of the schema whose spaces this map view applies to. */\n schema: string;\n parameters: Parameter[];\n /** The definition as authored. */\n source: AuthoredDefinition;\n};\n\n/** A setting the reader can change, with the control generated from its schema. */\nexport type Parameter = {\n name: string;\n title: string;\n description?: string;\n default: unknown;\n control: ParameterControl;\n};\n\n/** Options are JSON primitives, so they can be labelled and compared directly. */\nexport type ParameterControl =\n | { kind: 'select'; options: readonly Primitive[] }\n | { kind: 'multiselect'; options: readonly Primitive[] }\n | { kind: 'toggle' };\n\ntype Primitive = string | number | boolean | null;\n\nexport type ParameterValues = Readonly<Record<string, unknown>>;\n\nexport class MapViewDefinitionError extends Error {\n constructor(name: string, message: string) {\n super(`Map view \"${name}\": ${message}`);\n this.name = 'MapViewDefinitionError';\n }\n}\n\nconst newAjv = (options: { useDefaults?: boolean } = {}) =>\n new Ajv2020({\n allErrors: true,\n discriminator: true,\n ...options,\n schemas: MAP_VIEW_SCHEMAS.map((s) => structuredClone(s) as AnySchemaObject),\n });\n\n/** Validates definitions as authored. */\nconst ajv = newAjv();\nconst validateDefinition = ajv.getSchema(definitionSchema.$id)!;\n/** Validates resolved definitions, filling in setting defaults from the schemas. */\nconst fillDefaults = newAjv({ useDefaults: true }).getSchema(definitionSchema.$id)!;\n\n/**\n * Parse a JSON5 map view definition and check it against the bundled schemas. `name` labels\n * error messages (hosts pass where the definition came from).\n *\n * Beyond schema validation: every parameter needs a control derivable from its schema, and\n * every value that control can produce must satisfy the parameter's schema; every `$param`\n * must name a declared parameter; and each parameter's values must be valid wherever it's\n * bound, checked by substituting them and re-validating.\n */\nexport function parseMapViewDefinition(name: string, text: string): MapViewDefinition {\n const fail = (message: string): never => {\n throw new MapViewDefinitionError(name, message);\n };\n\n let raw: unknown;\n try {\n raw = JSON5.parse(text);\n } catch (err) {\n return fail(`invalid JSON5: ${err instanceof Error ? err.message : String(err)}`);\n }\n if (!validateDefinition(raw)) return fail(formatErrors(validateDefinition.errors, raw));\n const source = raw as AuthoredDefinition;\n\n // A fresh instance per parse, so compiled parameter schemas aren't cached indefinitely.\n const parameterAjv = newAjv();\n const declared = (source.parameters ?? {}) as Record<string, AnySchemaObject>;\n const parameters = Object.entries(declared).map(([paramName, schema]) =>\n parseParameter(paramName, schema, parameterAjv, (message) => fail(`parameter \"${paramName}\": ${message}`)),\n );\n\n for (const bound of paramNames(source.regions)) {\n if (!(bound in declared)) fail(`\"$param\": \"${bound}\" is not a declared parameter`);\n }\n checkBindings(source, parameters, fail);\n\n const regionIds = new Set<string>();\n for (const region of source.regions) {\n if (regionIds.has(region.id)) fail(`duplicate region id \"${region.id}\"`);\n regionIds.add(region.id);\n // A field level labels the nodes of a later level, so a node level must come last.\n if (region.layout.type === 'landscape' && !('type' in region.layout.group.at(-1)!)) {\n fail(`region \"${region.id}\": the last grouping level must be a node type, not a field`);\n }\n if (region.layout.type === 'xy') {\n for (const axis of ['x', 'y'] as const) {\n const { domain } = region.layout[axis];\n if (Array.isArray(domain) && !(domain[0]! < domain[1]!)) {\n fail(`region \"${region.id}\": ${axis} domain must be [min, max] with min < max`);\n }\n }\n }\n }\n\n return {\n id: source.$id,\n title: source.title ?? source.$id.slice(source.$id.lastIndexOf('/') + 1),\n ...(source.description !== undefined && { description: source.description }),\n schema: source.schema,\n parameters,\n source,\n };\n}\n\n/**\n * The value each parameter takes: the given value if its control could produce it, otherwise\n * (missing, or stale saved state) the default. Hosts' controls and rendering both use this.\n */\nexport function resolveParameterValues(definition: MapViewDefinition, values: ParameterValues = {}): ParameterValues {\n return Object.fromEntries(\n definition.parameters.map((param) => {\n const value = values[param.name];\n const chosen = value !== undefined && isProducible(param.control, value) ? value : param.default;\n return [param.name, structuredClone(chosen)];\n }),\n );\n}\n\n/** Apply parameter values to a definition's regions and fill in setting defaults. */\nexport function resolveRegions(definition: MapViewDefinition, values: ParameterValues = {}): Region[] {\n const resolved = resolveParameterValues(definition, values);\n const filled = substitute(definition.source, (paramName) => resolved[paramName]);\n if (!fillDefaults(filled)) {\n // parseMapViewDefinition checked every producible value, so this means a bug, not bad input.\n throw new MapViewDefinitionError(\n definition.id,\n `resolved definition is invalid: ${formatErrors(fillDefaults.errors, filled)}`,\n );\n }\n return (filled as FilledDefinition).regions as Region[];\n}\n\n/**\n * The filter selecting the nodes a map view shows, if any. Hosts apply it when loading the space.\n * PROTOTYPE: filters are evaluated by the host, not per region in the browser, because\n * structured-context's filter evaluator can't yet be bundled for a browser (its only entry point,\n * `structured-context/api`, imports Node built-ins). That's fine while only the first region renders.\n */\nexport function selectionFilter(definition: MapViewDefinition, values: ParameterValues = {}): string | undefined {\n return resolveRegions(definition, values)[0]?.select?.filter;\n}\n\n/**\n * The lowest severity of validation result the map view shows on nodes, or `off`. Hosts check it to\n * decide whether to run validation at all, since results are only drawn when this isn't `off`.\n */\nexport function viewValidationLevel(\n definition: MapViewDefinition,\n values: ParameterValues = {},\n): NodesConfig['validation'] {\n return resolveRegions(definition, values)[0]?.nodes.validation ?? 'off';\n}\n\n/** Map view definitions that apply to a space with the given schema. */\nexport function mapViewsForSchema(\n definitions: readonly MapViewDefinition[],\n schemaId: string | undefined,\n): MapViewDefinition[] {\n return schemaId === undefined ? [] : definitions.filter((d) => d.schema === schemaId);\n}\n\n/** Resolve `$ref`s relative to the format schemas, so parameters can write `settings.json#/$defs/orientation`. */\nfunction absoluteRefs(node: unknown): unknown {\n if (Array.isArray(node)) return node.map(absoluteRefs);\n if (typeof node !== 'object' || node === null) return node;\n return Object.fromEntries(\n Object.entries(node).map(([key, value]) => [\n key,\n key === '$ref' && typeof value === 'string' ? new URL(value, `${SCHEMA_URL}/`).href : absoluteRefs(value),\n ]),\n );\n}\n\nfunction parseParameter(\n name: string,\n schema: AnySchemaObject,\n parameterAjv: Ajv2020,\n fail: (message: string) => never,\n): Parameter {\n const { title, description, default: defaultValue, ...authored } = schema;\n const valueSchema = absoluteRefs(authored) as AnySchemaObject;\n let validate: (value: unknown) => boolean;\n try {\n validate = parameterAjv.compile(valueSchema);\n } catch (err) {\n return fail(`invalid schema: ${err instanceof Error ? err.message : String(err)}`);\n }\n if (!validate(defaultValue)) return fail(`default ${JSON.stringify(defaultValue)} doesn't match its schema`);\n\n const control = controlFor(valueSchema, fail);\n const invalid = producibleValues(control).filter((value) => !validate(value));\n if (invalid.length > 0) {\n fail(\n `its ${control.kind} control can produce ${invalid.map((v) => JSON.stringify(v)).join(', ')}, which its schema rejects; remove constraints the control can't enforce`,\n );\n }\n\n return {\n name,\n title: typeof title === 'string' ? title : (titleFromRef(valueSchema) ?? name),\n ...(typeof description === 'string' && { description }),\n default: defaultValue,\n control,\n };\n}\n\n/**\n * Values a control can produce, as checked against schemas. For a multi-select that's none,\n * each option alone, and all of them. PROTOTYPE: other subsets are assumed valid if these are,\n * which holds for the constraints in use (enum items, uniqueItems) but not, say, `contains`.\n */\nfunction producibleValues(control: ParameterControl): unknown[] {\n switch (control.kind) {\n case 'toggle':\n return [true, false];\n case 'select':\n return [...control.options];\n case 'multiselect':\n return [[], ...control.options.map((option) => [option]), [...control.options]];\n }\n}\n\n/**\n * Every `$param` binding must accept each value the parameter's control can produce.\n * PROTOTYPE: parameters are checked one at a time, with the others at their defaults, which\n * assumes their bindings don't constrain each other.\n */\nfunction checkBindings(source: AuthoredDefinition, parameters: Parameter[], fail: (message: string) => never) {\n const defaults = new Map(parameters.map((p) => [p.name, p.default]));\n for (const param of parameters) {\n for (const candidate of producibleValues(param.control)) {\n const substituted = substitute(source, (n) => (n === param.name ? candidate : defaults.get(n)));\n if (!validateDefinition(substituted)) {\n fail(\n `parameter \"${param.name}\" value ${JSON.stringify(candidate)} isn't valid where it's used: ${formatErrors(validateDefinition.errors, substituted)}`,\n );\n }\n }\n }\n}\n\n/**\n * Derive a control from a parameter's value schema: `enum` (directly, via `$ref`, or narrowed\n * with `allOf`) gives a select, an array of such items a multi-select, `boolean` a toggle.\n */\nfunction controlFor(schema: AnySchemaObject, fail: (message: string) => never): ParameterControl {\n if (typeOf(schema) === 'boolean') return { kind: 'toggle' };\n const isArray = typeOf(schema) === 'array';\n const options = isArray ? intersect(itemSchemas(schema).map(enumOf)) : enumOf(schema);\n if (!options) {\n return fail(\n 'no control can be generated: give it enum options (directly, or via $ref/allOf), array items with enum options, or type boolean',\n );\n }\n if (options.length === 0) return fail('its options narrow to nothing');\n if (!options.every(isPrimitive)) return fail('options must be strings, numbers, booleans or null');\n return { kind: isArray ? 'multiselect' : 'select', options };\n}\n\n/** Schemas linked from this one through `$ref` and `allOf`. */\nfunction linked(schema: AnySchemaObject): AnySchemaObject[] {\n const ref = typeof schema.$ref === 'string' ? ajv.getSchema(schema.$ref)?.schema : undefined;\n return [...(typeof ref === 'object' ? [ref] : []), ...((schema.allOf as AnySchemaObject[] | undefined) ?? [])];\n}\n\n/** Allowed values, intersecting `enum`/`const` with those reached through `$ref` and `allOf`. */\nfunction enumOf(schema: AnySchemaObject): unknown[] | undefined {\n return intersect([\n Array.isArray(schema.enum) ? schema.enum : undefined,\n 'const' in schema ? [schema.const] : undefined,\n ...linked(schema).map(enumOf),\n ]);\n}\n\nfunction typeOf(schema: AnySchemaObject): unknown {\n if (schema.type !== undefined) return schema.type;\n return linked(schema)\n .map(typeOf)\n .find((type) => type !== undefined);\n}\n\n/** Every `items` schema applying to an array, so their constraints can be intersected. */\nfunction itemSchemas(schema: AnySchemaObject): AnySchemaObject[] {\n return [...(typeof schema.items === 'object' ? [schema.items] : []), ...linked(schema).flatMap(itemSchemas)];\n}\n\nfunction intersect(sets: (unknown[] | undefined)[]): unknown[] | undefined {\n const defined = sets.filter((set): set is unknown[] => set !== undefined);\n if (defined.length === 0) return undefined;\n const key = (v: unknown) => JSON.stringify(v);\n return defined.reduce((acc, set) => acc.filter((v) => set.some((w) => key(w) === key(v))));\n}\n\nfunction titleFromRef(schema: AnySchemaObject): string | undefined {\n const title = linked(schema)[0]?.title;\n return typeof title === 'string' ? title : undefined;\n}\n\nfunction isPrimitive(value: unknown): value is Primitive {\n return value === null || ['string', 'number', 'boolean'].includes(typeof value);\n}\n\nfunction isProducible(control: ParameterControl, value: unknown): boolean {\n switch (control.kind) {\n case 'toggle':\n return typeof value === 'boolean';\n case 'select':\n return control.options.includes(value as Primitive);\n case 'multiselect':\n return Array.isArray(value) && value.every((v) => control.options.includes(v));\n }\n}\n\nfunction isParamRef(value: unknown): value is ParamRef {\n return typeof value === 'object' && value !== null && typeof (value as { $param?: unknown }).$param === 'string';\n}\n\n/** Copy a JSON value, replacing each `{ $param }` binding with its value. */\nfunction substitute(value: unknown, valueFor: (paramName: string) => unknown): unknown {\n if (isParamRef(value)) return structuredClone(valueFor(value.$param));\n if (Array.isArray(value)) return value.map((v) => substitute(v, valueFor));\n if (typeof value === 'object' && value !== null) {\n return Object.fromEntries(Object.entries(value).map(([k, v]) => [k, substitute(v, valueFor)]));\n }\n return value;\n}\n\nfunction paramNames(value: unknown): string[] {\n if (isParamRef(value)) return [value.$param];\n if (Array.isArray(value)) return value.flatMap(paramNames);\n if (typeof value === 'object' && value !== null) return Object.values(value).flatMap(paramNames);\n return [];\n}\n\n/**\n * Readable Ajv errors. A setting accepts a value or a `{ $param }` binding (`anyOf`), so a bad\n * value also fails the binding branch; those errors, and the bare anyOf summary, are dropped\n * unless the value actually is a binding. An `if` failure only repeats its branch's errors.\n */\nfunction formatErrors(errors: ErrorObject[] | null | undefined, instance: unknown): string {\n const relevant = (errors ?? []).filter(\n (e) =>\n e.keyword !== 'anyOf' &&\n e.keyword !== 'if' &&\n !(e.schemaPath.includes('/$defs/paramRef') && !isParamRef(at(instance, e.instancePath))),\n );\n return relevant.map((e) => `${e.instancePath || '/'} ${message(e)}${detail(e)}`).join('; ');\n}\n\n/** The value at a JSON pointer. */\nfunction at(value: unknown, pointer: string): unknown {\n return pointer\n .split('/')\n .slice(1)\n .map((segment) => segment.replaceAll('~1', '/').replaceAll('~0', '~'))\n .reduce<unknown>(\n (node, key) => (typeof node === 'object' && node !== null ? (node as Record<string, unknown>)[key] : undefined),\n value,\n );\n}\n\nfunction message(error: ErrorObject): string | undefined {\n if (error.keyword === 'discriminator' && error.params.error === 'mapping') {\n return `has unknown ${error.params.tag} ${JSON.stringify(error.params.tagValue)}`;\n }\n return error.message;\n}\n\nfunction detail(error: ErrorObject): string {\n if (error.keyword === 'additionalProperties') return ` (\"${error.params.additionalProperty}\")`;\n if (error.keyword === 'enum') {\n return ` (${(error.params.allowedValues as unknown[]).map((v) => JSON.stringify(v)).join(', ')})`;\n }\n return '';\n}\n"],"mappings":";;;AAQA,IAAa,aAAa;;;;ACN1B,IAAa,YAAY,GAAG,WAAW;;AAGvC,SAAgB,gBAAiD,aAAgB,cAAiB,aAAqB;CACrH,OAAO;EAAE;EAAa,SAAS;EAAc,OAAO,CAAC,aAAa,EAAE,MAAM,UAAU,CAAC;CAAE;AACzF;;;;;;;;;ACEA,IAAa,mBAAmB;CAC9B,SAAS;CACT,KAAK,GAAG,WAAW;CACnB,OAAO;CACP,aACE;CACF,MAAM;CACN,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