@genvidtech/c3-domain-manager 0.0.1 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +18 -0
- package/README.md +195 -29
- package/dist/adapters/locations.d.ts +22 -0
- package/dist/adapters/locations.d.ts.map +1 -0
- package/dist/adapters/locations.js +42 -0
- package/dist/adapters/locations.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +99 -0
- package/dist/cli.js.map +1 -0
- package/dist/domain/classification.d.ts +8 -0
- package/dist/domain/classification.d.ts.map +1 -0
- package/dist/domain/classification.js +66 -0
- package/dist/domain/classification.js.map +1 -0
- package/dist/domain/contextMap.d.ts +8 -0
- package/dist/domain/contextMap.d.ts.map +1 -0
- package/dist/domain/contextMap.js +168 -0
- package/dist/domain/contextMap.js.map +1 -0
- package/dist/domain/domainAnalysis.d.ts +25 -0
- package/dist/domain/domainAnalysis.d.ts.map +1 -0
- package/dist/domain/domainAnalysis.js +136 -0
- package/dist/domain/domainAnalysis.js.map +1 -0
- package/dist/domain/domainGenerator.d.ts +33 -0
- package/dist/domain/domainGenerator.d.ts.map +1 -0
- package/dist/domain/domainGenerator.js +307 -0
- package/dist/domain/domainGenerator.js.map +1 -0
- package/dist/domain/editorValidation.d.ts +19 -0
- package/dist/domain/editorValidation.d.ts.map +1 -0
- package/dist/domain/editorValidation.js +40 -0
- package/dist/domain/editorValidation.js.map +1 -0
- package/dist/domain/formatting.d.ts +16 -0
- package/dist/domain/formatting.d.ts.map +1 -0
- package/dist/domain/formatting.js +414 -0
- package/dist/domain/formatting.js.map +1 -0
- package/dist/domain/glossary.d.ts +20 -0
- package/dist/domain/glossary.d.ts.map +1 -0
- package/dist/domain/glossary.js +62 -0
- package/dist/domain/glossary.js.map +1 -0
- package/dist/domain/health.d.ts +14 -0
- package/dist/domain/health.d.ts.map +1 -0
- package/dist/domain/health.js +21 -0
- package/dist/domain/health.js.map +1 -0
- package/dist/domain/relationships.d.ts +13 -0
- package/dist/domain/relationships.d.ts.map +1 -0
- package/dist/domain/relationships.js +74 -0
- package/dist/domain/relationships.js.map +1 -0
- package/dist/domain/types.d.ts +290 -0
- package/dist/domain/types.d.ts.map +1 -0
- package/dist/domain/types.js +29 -0
- package/dist/domain/types.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/server.d.ts +3 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +519 -0
- package/dist/mcp/server.js.map +1 -0
- package/docs/TOC.md +27 -0
- package/docs/decisions/0001-adopt-c3source-extractors.md +67 -0
- package/docs/decisions/0002-configurable-locations-adapters-seam.md +72 -0
- package/docs/decisions/0003-adopt-loadprojectconfig-schema-first.md +73 -0
- package/docs/decisions/0004-adopt-mcp-utils-0.4.0-helpers.md +74 -0
- package/docs/decisions/0005-validateforeditor-read-side-diagnostic.md +65 -0
- package/docs/decisions/0006-event-variable-reference-coupling.md +77 -0
- package/docs/decisions/0007-project-dir-resolverootfolder.md +72 -0
- package/docs/decisions/0008-adopt-openproject-option-a.md +74 -0
- package/docs/domain-architecture.md +242 -0
- package/docs/releasing.md +122 -0
- package/package.json +79 -8
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { openProject, extractFunctions, extractIncludes, visitEvents, hasConditions, hasActions, getEventVarReferenceName, } from "@genvidtech/c3source";
|
|
4
|
+
import { classifyFile } from "./classification.js";
|
|
5
|
+
import { formatDomainIndex as formatDomainIndexPage, formatDomainPage } from "./formatting.js";
|
|
6
|
+
import { DomainConfigSchema } from "./types.js";
|
|
7
|
+
import { loadProjectConfig, isMcpError } from "@genvidtech/mcp-utils";
|
|
8
|
+
/** Format function parameters as "name: type, name2: type2". */
|
|
9
|
+
function formatParams(params) {
|
|
10
|
+
return params.map((p) => `${p.name}: ${p.type}`).join(", ");
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Map c3source's typed `ExtractedFunction` list for a sheet onto our `FunctionDef`
|
|
14
|
+
* shape: format params to a string, stamp the source sheet, and surface the
|
|
15
|
+
* custom-ACE `objectClass`/`aceName` that `formatting.ts` renders.
|
|
16
|
+
*/
|
|
17
|
+
export function extractFunctionDefs(sheet, sheetName) {
|
|
18
|
+
return extractFunctions(sheet).map((f) => ({
|
|
19
|
+
name: f.name,
|
|
20
|
+
params: formatParams(f.params),
|
|
21
|
+
returnType: f.returnType,
|
|
22
|
+
sourceSheet: sheetName,
|
|
23
|
+
objectClass: f.objectClass,
|
|
24
|
+
aceName: f.kind === "custom-ace" ? f.name : undefined,
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Top-level (sheet-root ≈ global-scope) event-variable declaration names for a sheet.
|
|
29
|
+
* Only root-level `variable` events are indexed — cross-sheet references in C3 require
|
|
30
|
+
* global variables, so root-level declarations are the global-scope approximation.
|
|
31
|
+
*/
|
|
32
|
+
export function extractEventVarDecls(sheet) {
|
|
33
|
+
return sheet.events
|
|
34
|
+
.filter((e) => e.eventType === "variable")
|
|
35
|
+
.map((e) => e.name);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Deduped event-variable names referenced by System ACEs anywhere in a sheet's event tree.
|
|
39
|
+
* Walks every condition and action via `visitEvents`, applying c3source's
|
|
40
|
+
* `getEventVarReferenceName` (which gates on `objectClass === "System"`).
|
|
41
|
+
*/
|
|
42
|
+
export function extractEventVarRefs(sheet) {
|
|
43
|
+
const names = new Set();
|
|
44
|
+
visitEvents(sheet.events, (event) => {
|
|
45
|
+
if (hasConditions(event)) {
|
|
46
|
+
for (const cond of event.conditions) {
|
|
47
|
+
const name = getEventVarReferenceName(cond);
|
|
48
|
+
if (name !== null)
|
|
49
|
+
names.add(name);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (hasActions(event)) {
|
|
53
|
+
for (const action of event.actions) {
|
|
54
|
+
const name = getEventVarReferenceName(action);
|
|
55
|
+
if (name !== null)
|
|
56
|
+
names.add(name);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
return [...names];
|
|
61
|
+
}
|
|
62
|
+
export async function loadConfig(projectRoot, fileName) {
|
|
63
|
+
const cfg = await loadProjectConfig(projectRoot, fileName, DomainConfigSchema);
|
|
64
|
+
if (isMcpError(cfg)) {
|
|
65
|
+
const text = cfg.content?.map((c) => ("text" in c ? c.text : "")).join("\n") ?? "config load failed";
|
|
66
|
+
throw new Error(text);
|
|
67
|
+
}
|
|
68
|
+
return cfg;
|
|
69
|
+
}
|
|
70
|
+
/** Directories that are structural layers, not domain-relevant. Recurse into them. */
|
|
71
|
+
const LAYER_DIRS = ["shared", "c3-runtime"];
|
|
72
|
+
export function findScriptEntries(scriptsDir) {
|
|
73
|
+
const entries = [];
|
|
74
|
+
function scanDir(dir, prefix) {
|
|
75
|
+
const names = fs.readdirSync(dir).sort();
|
|
76
|
+
for (const name of names) {
|
|
77
|
+
const fullPath = path.join(dir, name);
|
|
78
|
+
const stats = fs.statSync(fullPath);
|
|
79
|
+
if (stats.isDirectory()) {
|
|
80
|
+
if (LAYER_DIRS.includes(name)) {
|
|
81
|
+
// Recurse into layer dirs — enumerate their children instead
|
|
82
|
+
scanDir(fullPath, `${prefix}${name}/`);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
entries.push({ relativePath: `scripts/${prefix}${name}/`, isDirectory: true });
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
else if (stats.isFile() && name.endsWith(".ts")) {
|
|
89
|
+
entries.push({ relativePath: `scripts/${prefix}${name}`, isDirectory: false });
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
scanDir(scriptsDir, "");
|
|
94
|
+
return entries;
|
|
95
|
+
}
|
|
96
|
+
export function computeDomainData(rootDir, config, log = () => { }) {
|
|
97
|
+
// Find all files
|
|
98
|
+
const project = openProject(rootDir);
|
|
99
|
+
const eventSheetPaths = project.findAllEventSheets();
|
|
100
|
+
const layoutPaths = project.findAllLayouts();
|
|
101
|
+
const scriptEntries = findScriptEntries(project.scriptsDir);
|
|
102
|
+
log(`Found ${eventSheetPaths.length} eventSheets, ${layoutPaths.length} layouts, ${scriptEntries.length} script entries.`);
|
|
103
|
+
// Classify all files
|
|
104
|
+
const domainDataMap = new Map();
|
|
105
|
+
const unclassified = [];
|
|
106
|
+
// Initialize domain data for all configured domains
|
|
107
|
+
for (const [name, def] of Object.entries(config.domains)) {
|
|
108
|
+
domainDataMap.set(name, {
|
|
109
|
+
name,
|
|
110
|
+
description: def.description,
|
|
111
|
+
eventSheets: [],
|
|
112
|
+
layouts: [],
|
|
113
|
+
scripts: [],
|
|
114
|
+
functions: [],
|
|
115
|
+
includesFrom: new Map(),
|
|
116
|
+
includedBy: new Map(),
|
|
117
|
+
referencesFrom: new Map(),
|
|
118
|
+
referencedBy: new Map(),
|
|
119
|
+
strategy: def.strategy,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
// Initialize domain data for shared subdomains
|
|
123
|
+
if (config.sharedSubdomains) {
|
|
124
|
+
for (const [name, def] of Object.entries(config.sharedSubdomains)) {
|
|
125
|
+
domainDataMap.set(name, {
|
|
126
|
+
name,
|
|
127
|
+
description: def.description,
|
|
128
|
+
eventSheets: [],
|
|
129
|
+
layouts: [],
|
|
130
|
+
scripts: [],
|
|
131
|
+
functions: [],
|
|
132
|
+
includesFrom: new Map(),
|
|
133
|
+
includedBy: new Map(),
|
|
134
|
+
referencesFrom: new Map(),
|
|
135
|
+
referencedBy: new Map(),
|
|
136
|
+
isSharedSubdomain: true,
|
|
137
|
+
strategy: def.strategy,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
// Classify and parse eventSheets
|
|
142
|
+
const sheetDomainLookup = new Map(); // sheetName → domainName
|
|
143
|
+
const rawIncludes = new Map(); // domainName → raw include sheet names
|
|
144
|
+
const varDeclIndex = new Map(); // variable name → set of declaring domains
|
|
145
|
+
const rawRefs = new Map(); // domainName → referenced variable names (raw)
|
|
146
|
+
for (const sheetPath of eventSheetPaths) {
|
|
147
|
+
const relPath = path.relative(rootDir, sheetPath).replace(/\\/g, "/");
|
|
148
|
+
const domain = classifyFile(relPath, "eventSheet", config);
|
|
149
|
+
if (!domain) {
|
|
150
|
+
unclassified.push(relPath);
|
|
151
|
+
log(` Unclassified: ${relPath}`);
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
const domainData = domainDataMap.get(domain);
|
|
155
|
+
// Determine directory within eventSheets/
|
|
156
|
+
const innerPath = relPath.replace(/^eventSheets\//, "");
|
|
157
|
+
const dirParts = innerPath.split("/");
|
|
158
|
+
const directory = dirParts.length > 1 ? dirParts.slice(0, -1).join("/") : "";
|
|
159
|
+
domainData.eventSheets.push({ path: relPath, directory });
|
|
160
|
+
// Parse eventSheet for includes and functions
|
|
161
|
+
const content = fs.readFileSync(sheetPath, "utf-8");
|
|
162
|
+
const sheet = JSON.parse(content);
|
|
163
|
+
const sheetName = innerPath.replace(/\.json$/, "");
|
|
164
|
+
sheetDomainLookup.set(sheet.name, domain);
|
|
165
|
+
// Extract functions
|
|
166
|
+
const funcs = extractFunctionDefs(sheet, sheetName);
|
|
167
|
+
domainData.functions.push(...funcs);
|
|
168
|
+
// Extract includes (will be resolved to cross-domain deps later)
|
|
169
|
+
const includes = extractIncludes(sheet).map((r) => r.includeSheet);
|
|
170
|
+
if (includes.length > 0) {
|
|
171
|
+
const existing = rawIncludes.get(domain) ?? [];
|
|
172
|
+
existing.push(...includes);
|
|
173
|
+
rawIncludes.set(domain, existing);
|
|
174
|
+
}
|
|
175
|
+
// Index top-level variable declarations: variable name → declaring domains
|
|
176
|
+
for (const varName of extractEventVarDecls(sheet)) {
|
|
177
|
+
if (!varDeclIndex.has(varName))
|
|
178
|
+
varDeclIndex.set(varName, new Set());
|
|
179
|
+
varDeclIndex.get(varName).add(domain);
|
|
180
|
+
}
|
|
181
|
+
// Accumulate event-variable references for cross-domain resolution later
|
|
182
|
+
const refs = extractEventVarRefs(sheet);
|
|
183
|
+
if (refs.length > 0) {
|
|
184
|
+
const existing = rawRefs.get(domain) ?? [];
|
|
185
|
+
existing.push(...refs);
|
|
186
|
+
rawRefs.set(domain, existing);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// Classify layouts
|
|
190
|
+
for (const layoutPath of layoutPaths) {
|
|
191
|
+
const relPath = path.relative(rootDir, layoutPath).replace(/\\/g, "/");
|
|
192
|
+
const domain = classifyFile(relPath, "layout", config);
|
|
193
|
+
if (!domain) {
|
|
194
|
+
unclassified.push(relPath);
|
|
195
|
+
log(` Unclassified: ${relPath}`);
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
const domainData = domainDataMap.get(domain);
|
|
199
|
+
// Read layout to get eventSheet reference
|
|
200
|
+
const content = fs.readFileSync(layoutPath, "utf-8");
|
|
201
|
+
const layout = JSON.parse(content);
|
|
202
|
+
const eventSheet = layout.eventSheet || "";
|
|
203
|
+
const eventSheetDomain = eventSheet ? (sheetDomainLookup.get(eventSheet) ?? "") : "";
|
|
204
|
+
domainData.layouts.push({ path: relPath, eventSheet, eventSheetDomain });
|
|
205
|
+
}
|
|
206
|
+
// Classify scripts
|
|
207
|
+
for (const entry of scriptEntries) {
|
|
208
|
+
const lookupPath = entry.isDirectory
|
|
209
|
+
? entry.relativePath.replace(/\/$/, "")
|
|
210
|
+
: entry.relativePath;
|
|
211
|
+
const domain = classifyFile(lookupPath, "script", config);
|
|
212
|
+
if (domain) {
|
|
213
|
+
domainDataMap.get(domain).scripts.push({ path: entry.relativePath, isDirectory: entry.isDirectory });
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
unclassified.push(entry.relativePath);
|
|
217
|
+
log(` Unclassified: ${entry.relativePath}`);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
// Resolve cross-domain dependencies from includes
|
|
221
|
+
for (const [domainName, domainData] of domainDataMap) {
|
|
222
|
+
const raw = rawIncludes.get(domainName) ?? [];
|
|
223
|
+
for (const includedSheetName of raw) {
|
|
224
|
+
const targetDomain = sheetDomainLookup.get(includedSheetName);
|
|
225
|
+
if (targetDomain && targetDomain !== domainName) {
|
|
226
|
+
// Add to includesFrom
|
|
227
|
+
if (!domainData.includesFrom.has(targetDomain)) {
|
|
228
|
+
domainData.includesFrom.set(targetDomain, []);
|
|
229
|
+
}
|
|
230
|
+
const list = domainData.includesFrom.get(targetDomain);
|
|
231
|
+
if (!list.includes(includedSheetName)) {
|
|
232
|
+
list.push(includedSheetName);
|
|
233
|
+
}
|
|
234
|
+
// Add to target's includedBy
|
|
235
|
+
const targetData = domainDataMap.get(targetDomain);
|
|
236
|
+
if (targetData) {
|
|
237
|
+
if (!targetData.includedBy.has(domainName)) {
|
|
238
|
+
targetData.includedBy.set(domainName, []);
|
|
239
|
+
}
|
|
240
|
+
const targetList = targetData.includedBy.get(domainName);
|
|
241
|
+
if (!targetList.includes(includedSheetName)) {
|
|
242
|
+
targetList.push(includedSheetName);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
// Resolve cross-domain dependencies from event-variable references.
|
|
249
|
+
// A reference resolves to EVERY domain that declares a top-level variable of that
|
|
250
|
+
// name (attribute-to-all on collision); same-domain and unresolved names are skipped.
|
|
251
|
+
for (const [domainName, domainData] of domainDataMap) {
|
|
252
|
+
const refs = rawRefs.get(domainName) ?? [];
|
|
253
|
+
for (const varName of refs) {
|
|
254
|
+
const declaringDomains = varDeclIndex.get(varName);
|
|
255
|
+
if (!declaringDomains)
|
|
256
|
+
continue; // unresolved — no global declaration
|
|
257
|
+
for (const targetDomain of declaringDomains) {
|
|
258
|
+
if (targetDomain === domainName)
|
|
259
|
+
continue; // same-domain — not cross-domain
|
|
260
|
+
// referencesFrom: domainName → targetDomain (var names)
|
|
261
|
+
if (!domainData.referencesFrom.has(targetDomain))
|
|
262
|
+
domainData.referencesFrom.set(targetDomain, []);
|
|
263
|
+
const out = domainData.referencesFrom.get(targetDomain);
|
|
264
|
+
if (!out.includes(varName))
|
|
265
|
+
out.push(varName);
|
|
266
|
+
// referencedBy on the target
|
|
267
|
+
const targetData = domainDataMap.get(targetDomain);
|
|
268
|
+
if (targetData) {
|
|
269
|
+
if (!targetData.referencedBy.has(domainName))
|
|
270
|
+
targetData.referencedBy.set(domainName, []);
|
|
271
|
+
const inc = targetData.referencedBy.get(domainName);
|
|
272
|
+
if (!inc.includes(varName))
|
|
273
|
+
inc.push(varName);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
// Sort domains by name for consistent output
|
|
279
|
+
const domains = Array.from(domainDataMap.values()).sort((a, b) => a.name.localeCompare(b.name));
|
|
280
|
+
return { domains, unclassified };
|
|
281
|
+
}
|
|
282
|
+
export async function generateDomainIndex(rootDir, outDir, projectRoot, fileName, log = console.log) {
|
|
283
|
+
const config = await loadConfig(projectRoot, fileName);
|
|
284
|
+
const domainIndexDir = path.join(outDir, "domain-index");
|
|
285
|
+
const { domains, unclassified } = computeDomainData(rootDir, config, log);
|
|
286
|
+
// Clean domain-index/ directory
|
|
287
|
+
fs.rmSync(domainIndexDir, { recursive: true, force: true });
|
|
288
|
+
fs.mkdirSync(domainIndexDir, { recursive: true });
|
|
289
|
+
// Generate master index
|
|
290
|
+
const indexContent = formatDomainIndexPage(domains, unclassified);
|
|
291
|
+
fs.writeFileSync(path.join(domainIndexDir, "index.md"), indexContent);
|
|
292
|
+
// Generate per-domain pages
|
|
293
|
+
for (const domain of domains) {
|
|
294
|
+
const pageContent = formatDomainPage(domain);
|
|
295
|
+
// Sanitize domain name for filename (e.g., "Watch/Story" → "Watch-Story")
|
|
296
|
+
const safeFileName = domain.name.replace(/\//g, "-");
|
|
297
|
+
fs.writeFileSync(path.join(domainIndexDir, `${safeFileName}.md`), pageContent);
|
|
298
|
+
}
|
|
299
|
+
log(`Generated domain index with ${domains.length} domains in ${domainIndexDir}`);
|
|
300
|
+
if (unclassified.length > 0) {
|
|
301
|
+
log(` ${unclassified.length} unclassified files!`);
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
log(" All files classified.");
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
//# sourceMappingURL=domainGenerator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domainGenerator.js","sourceRoot":"","sources":["../../src/domain/domainGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,aAAa,EACb,UAAU,EACV,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE/F,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGtE,gEAAgE;AAChE,SAAS,YAAY,CAAC,MAA2B;IAC/C,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC9D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAiB,EAAE,SAAiB;IACtE,OAAO,gBAAgB,CAAC,KAAK,CAAC,C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source";
|
|
2
|
+
import type { Logger } from "@genvidtech/mcp-utils";
|
|
3
|
+
import type { DomainConfig } from "./types.js";
|
|
4
|
+
export interface EditorStrictnessSheetReport {
|
|
5
|
+
/** Relative POSIX path, e.g. "eventSheets/Login/LoginEvents.json". */
|
|
6
|
+
sheet: string;
|
|
7
|
+
/** Owning domain name from classifyFile, or "(unclassified)". */
|
|
8
|
+
domain: string;
|
|
9
|
+
/** Issues from c3source's validateForEditor for this sheet. */
|
|
10
|
+
issues: EditorValidationIssue[];
|
|
11
|
+
}
|
|
12
|
+
export interface EditorStrictnessReport {
|
|
13
|
+
/** Only sheets that HAVE at least one issue, sorted by sheet path. */
|
|
14
|
+
sheets: EditorStrictnessSheetReport[];
|
|
15
|
+
totalIssues: number;
|
|
16
|
+
}
|
|
17
|
+
export declare function validateEditorStrictness(rootDir: string, config: DomainConfig, log?: Logger): EditorStrictnessReport;
|
|
18
|
+
export declare function formatEditorStrictnessReport(report: EditorStrictnessReport): string;
|
|
19
|
+
//# sourceMappingURL=editorValidation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editorValidation.d.ts","sourceRoot":"","sources":["../../src/domain/editorValidation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAc,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,WAAW,2BAA2B;IAC1C,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,MAAM,EAAE,qBAAqB,EAAE,CAAC;CACjC;AAED,MAAM,WAAW,sBAAsB;IACrC,sEAAsE;IACtE,MAAM,EAAE,2BAA2B,EAAE,CAAC;IACtC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,YAAY,EACpB,GAAG,GAAE,MAAiB,GACrB,sBAAsB,CA4BxB;AAED,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,CAenF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import { openProject, validateForEditor } from "@genvidtech/c3source";
|
|
4
|
+
import { classifyFile } from "./classification.js";
|
|
5
|
+
export function validateEditorStrictness(rootDir, config, log = () => { }) {
|
|
6
|
+
const project = openProject(rootDir);
|
|
7
|
+
if (!project.hasEventSheets()) {
|
|
8
|
+
log(`editorValidation: eventSheets/ dir not found at ${project.eventSheetsDir}, skipping.`);
|
|
9
|
+
return { sheets: [], totalIssues: 0 };
|
|
10
|
+
}
|
|
11
|
+
const sheetPaths = project.findAllEventSheets();
|
|
12
|
+
const results = [];
|
|
13
|
+
for (const sheetPath of sheetPaths) {
|
|
14
|
+
const relPath = path.relative(rootDir, sheetPath).replace(/\\/g, "/");
|
|
15
|
+
const domainName = classifyFile(relPath, "eventSheet", config) ?? "(unclassified)";
|
|
16
|
+
const content = fs.readFileSync(sheetPath, "utf-8");
|
|
17
|
+
const sheet = JSON.parse(content);
|
|
18
|
+
const issues = validateForEditor(sheet);
|
|
19
|
+
if (issues.length > 0) {
|
|
20
|
+
results.push({ sheet: relPath, domain: domainName, issues });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
results.sort((a, b) => a.sheet.localeCompare(b.sheet));
|
|
24
|
+
const totalIssues = results.reduce((sum, r) => sum + r.issues.length, 0);
|
|
25
|
+
return { sheets: results, totalIssues };
|
|
26
|
+
}
|
|
27
|
+
export function formatEditorStrictnessReport(report) {
|
|
28
|
+
if (report.totalIssues === 0) {
|
|
29
|
+
return "No editor-strictness issues found.";
|
|
30
|
+
}
|
|
31
|
+
const lines = [`${report.totalIssues} editor-strictness issue(s) found:`, ""];
|
|
32
|
+
for (const sheetReport of report.sheets) {
|
|
33
|
+
lines.push(`${sheetReport.sheet} [${sheetReport.domain}]`);
|
|
34
|
+
for (const issue of sheetReport.issues) {
|
|
35
|
+
lines.push(` [${issue.rule}] ${issue.path}: ${issue.message}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return lines.join("\n");
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=editorValidation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editorValidation.js","sourceRoot":"","sources":["../../src/domain/editorValidation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGtE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAkBnD,MAAM,UAAU,wBAAwB,CACtC,OAAe,EACf,MAAoB,EACpB,MAAc,GAAG,EAAE,GAAE,CAAC;IAEtB,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IACrC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;QAC9B,GAAG,CAAC,mDAAmD,OAAO,CAAC,cAAc,aAAa,CAAC,CAAC;QAC5F,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC;IACxC,CAAC;IACD,MAAM,UAAU,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAEhD,MAAM,OAAO,GAAkC,EAAE,CAAC;IAElD,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACtE,MAAM,UAAU,GA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KAAK,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;YACvC,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAClE,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { DomainConfig, DomainData } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Format the domain index page (master overview of all domains).
|
|
4
|
+
*/
|
|
5
|
+
export declare function formatDomainIndex(domains: DomainData[], unclassified: string[]): string;
|
|
6
|
+
/**
|
|
7
|
+
* Format a single domain's detail page.
|
|
8
|
+
*/
|
|
9
|
+
export declare function formatDomainPage(domain: DomainData): string;
|
|
10
|
+
export type DomainConfigSection = "domains" | "sharedSubdomains" | "overrides" | "all";
|
|
11
|
+
/**
|
|
12
|
+
* Format a DomainConfig into human-readable text.
|
|
13
|
+
* When section is "all", all three sections are concatenated with blank line separators.
|
|
14
|
+
*/
|
|
15
|
+
export declare function formatDomainConfig(config: DomainConfig, section?: DomainConfigSection): string;
|
|
16
|
+
//# sourceMappingURL=formatting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../src/domain/formatting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAe,MAAM,YAAY,CAAC;AAIxE;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,MAAM,CAmHvF;AA6DD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CA8B3D;AA8GD,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,kBAAkB,GAAG,WAAW,GAAG,KAAK,CAAC;AAEvF;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,GAAE,mBAA2B,GAAG,MAAM,CAYrG"}
|