@voidaliot/swaml-cli 0.15.0 → 0.16.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/bin/diagram.mjs +0 -0
- package/bin/validate.mjs +0 -0
- package/dist/cli.mjs +74 -64
- package/dist/validate.mjs +6 -2
- package/package.json +1 -1
package/bin/diagram.mjs
CHANGED
|
File without changes
|
package/bin/validate.mjs
CHANGED
|
File without changes
|
package/dist/cli.mjs
CHANGED
|
@@ -169329,12 +169329,26 @@ function depthInside(outer, all2) {
|
|
|
169329
169329
|
}
|
|
169330
169330
|
|
|
169331
169331
|
// packages/diagram-protocol/out/overlay.js
|
|
169332
|
-
|
|
169333
|
-
if (!
|
|
169334
|
-
return
|
|
169335
|
-
const
|
|
169336
|
-
|
|
169337
|
-
|
|
169332
|
+
function withoutDecoration(value2, kind2) {
|
|
169333
|
+
if (!value2 || kind2 === void 0)
|
|
169334
|
+
return void 0;
|
|
169335
|
+
const previous3 = value2.previous && withoutDecoration(value2.previous, kind2);
|
|
169336
|
+
if (value2.kind === kind2)
|
|
169337
|
+
return previous3;
|
|
169338
|
+
if (previous3 === value2.previous)
|
|
169339
|
+
return value2;
|
|
169340
|
+
const { previous: _previous, ...rest } = value2;
|
|
169341
|
+
return previous3 ? { ...rest, previous: previous3 } : rest;
|
|
169342
|
+
}
|
|
169343
|
+
function clearDecoration(item, kind2) {
|
|
169344
|
+
if (!("overlay" in item))
|
|
169345
|
+
return item;
|
|
169346
|
+
const overlay = withoutDecoration(item.overlay, kind2);
|
|
169347
|
+
if (overlay === item.overlay)
|
|
169348
|
+
return item;
|
|
169349
|
+
const { overlay: _overlay, ...rest } = item;
|
|
169350
|
+
return overlay ? { ...rest, overlay } : rest;
|
|
169351
|
+
}
|
|
169338
169352
|
function overlayDecoration(item) {
|
|
169339
169353
|
const value2 = item?.overlay ?? item?.meta?.overlay;
|
|
169340
169354
|
return value2 && typeof value2 === "object" ? value2 : void 0;
|
|
@@ -169344,20 +169358,12 @@ function diagramOverlays(model) {
|
|
|
169344
169358
|
}
|
|
169345
169359
|
function clearDiagramOverlay(model, kind2) {
|
|
169346
169360
|
const kept = diagramOverlays(model).filter((item) => kind2 !== void 0 && item.kind !== kind2);
|
|
169347
|
-
const
|
|
169348
|
-
|
|
169349
|
-
|
|
169350
|
-
|
|
169351
|
-
|
|
169352
|
-
|
|
169353
|
-
return rest;
|
|
169354
|
-
}) } : meta;
|
|
169355
|
-
const fragments = Array.isArray(model.meta?.fragments) ? model.meta.fragments.map((fragment2) => {
|
|
169356
|
-
if (!("overlay" in fragment2) || kind2 && fragment2.overlay.kind !== kind2)
|
|
169357
|
-
return fragment2;
|
|
169358
|
-
const { overlay: _overlay, ...rest } = fragment2;
|
|
169359
|
-
return rest;
|
|
169360
|
-
}) : model.meta?.fragments;
|
|
169361
|
+
const clean2 = (item) => {
|
|
169362
|
+
const meta = item.meta && clearDecoration(item.meta, kind2);
|
|
169363
|
+
return meta === item.meta ? item : { ...item, meta };
|
|
169364
|
+
};
|
|
169365
|
+
const markers = (meta) => Array.isArray(meta?.markers) ? { ...meta, markers: meta.markers.map((marker) => clearDecoration(marker, kind2)) } : meta;
|
|
169366
|
+
const fragments = Array.isArray(model.meta?.fragments) ? model.meta.fragments.map((fragment2) => clearDecoration(fragment2, kind2)) : model.meta?.fragments;
|
|
169361
169367
|
return {
|
|
169362
169368
|
...model,
|
|
169363
169369
|
nodes: model.nodes.map((node2) => {
|
|
@@ -169373,18 +169379,18 @@ function applyDiagramOverlay(model, overlay) {
|
|
|
169373
169379
|
const base2 = clearDiagramOverlay(model, overlay.kind);
|
|
169374
169380
|
const decorations = overlay.stale ? {} : overlay.elements, markers = overlay.stale ? {} : overlay.markers ?? {};
|
|
169375
169381
|
let decorated = 0;
|
|
169376
|
-
const tag = (value2) => {
|
|
169382
|
+
const tag = (value2, previous3) => {
|
|
169377
169383
|
decorated++;
|
|
169378
|
-
return { ...value2, kind: overlay.kind };
|
|
169384
|
+
return { ...value2, kind: overlay.kind, ...previous3 ? { previous: previous3 } : {} };
|
|
169379
169385
|
};
|
|
169380
|
-
const decorate = (item) => decorations[item.id] ? { ...item, meta: { ...item.meta, overlay: tag(decorations[item.id]) } } : item;
|
|
169386
|
+
const decorate = (item) => decorations[item.id] ? { ...item, meta: { ...item.meta, overlay: tag(decorations[item.id], item.meta?.overlay) } } : item;
|
|
169381
169387
|
const nodes2 = base2.nodes.map((node2) => {
|
|
169382
169388
|
const next = decorate(node2);
|
|
169383
169389
|
if (!Array.isArray(next.meta?.markers))
|
|
169384
169390
|
return next;
|
|
169385
|
-
return { ...next, meta: { ...next.meta, markers: next.meta.markers.map((marker) => typeof marker.statement === "string" && markers[marker.statement] ? { ...marker, overlay: tag(markers[marker.statement]) } : marker) } };
|
|
169391
|
+
return { ...next, meta: { ...next.meta, markers: next.meta.markers.map((marker) => typeof marker.statement === "string" && markers[marker.statement] ? { ...marker, overlay: tag(markers[marker.statement], marker.overlay) } : marker) } };
|
|
169386
169392
|
});
|
|
169387
|
-
const fragments = Array.isArray(base2.meta?.fragments) ? base2.meta.fragments.map((fragment2) => typeof fragment2.id === "string" && decorations[fragment2.id] ? { ...fragment2, overlay: tag(decorations[fragment2.id]) } : fragment2) : base2.meta?.fragments;
|
|
169393
|
+
const fragments = Array.isArray(base2.meta?.fragments) ? base2.meta.fragments.map((fragment2) => typeof fragment2.id === "string" && decorations[fragment2.id] ? { ...fragment2, overlay: tag(decorations[fragment2.id], fragment2.overlay) } : fragment2) : base2.meta?.fragments;
|
|
169388
169394
|
const edges = base2.edges.map(decorate), frames = base2.frames?.map(decorate);
|
|
169389
169395
|
const { elements: _elements, markers: _markers, ...summary } = overlay;
|
|
169390
169396
|
return {
|
|
@@ -170314,14 +170320,14 @@ function siteAt(document4, position3, sites) {
|
|
|
170314
170320
|
}
|
|
170315
170321
|
|
|
170316
170322
|
// packages/language-server/src/run-evidence.ts
|
|
170317
|
-
init_lib2();
|
|
170318
170323
|
init_ast2();
|
|
170319
170324
|
init_semantic();
|
|
170320
170325
|
var store = /* @__PURE__ */ new Map();
|
|
170321
|
-
var
|
|
170326
|
+
var sourceKeys = (revisions2) => Object.fromEntries(Object.entries(revisions2).map(([uri, value2]) => [sourceUriKey(uri), value2]));
|
|
170327
|
+
var currentEvidence = (evidence2, revisions2) => runEvidenceCurrent({ sourceRevisions: sourceKeys(evidence2.sourceRevisions) }, revisions2);
|
|
170322
170328
|
function storedRunEvidence(revisions2) {
|
|
170323
|
-
const current =
|
|
170324
|
-
return [...store.values()].reverse().map((item) =>
|
|
170329
|
+
const current = sourceKeys(revisions2);
|
|
170330
|
+
return [...store.values()].reverse().filter((item) => Object.hasOwn(current, sourceUriKey(item.caseUri))).map((item) => currentEvidence(item, current) ? item : { ...item, stale: true });
|
|
170325
170331
|
}
|
|
170326
170332
|
|
|
170327
170333
|
// packages/language-server/src/inlay-hints.ts
|
|
@@ -174210,12 +174216,12 @@ async function effectiveConfiguration(services, key, uri) {
|
|
|
174210
174216
|
init_lib2();
|
|
174211
174217
|
init_formatter2();
|
|
174212
174218
|
function configuredFormat(document4, services, settings, editor) {
|
|
174213
|
-
const
|
|
174219
|
+
const canonical4 = formatDocument(document4), lexer = services.parser.Lexer;
|
|
174214
174220
|
const tokenize3 = (text8) => {
|
|
174215
174221
|
const result = lexer.tokenize(text8);
|
|
174216
174222
|
return [...result.tokens, ...result.hidden].filter((token) => token.tokenType.name !== "WS").sort((left, right) => left.startOffset - right.startOffset);
|
|
174217
174223
|
};
|
|
174218
|
-
const originalText = document4.textDocument.getText(), original2 = tokenize3(originalText), tokens = tokenize3(
|
|
174224
|
+
const originalText = document4.textDocument.getText(), original2 = tokenize3(originalText), tokens = tokenize3(canonical4);
|
|
174219
174225
|
if (original2.length !== tokens.length || tokens.some((token, index3) => token.image !== original2[index3].image)) throw Error("Formatting would change a source token.");
|
|
174220
174226
|
const size = Number.isInteger(settings.indentSize) && settings.indentSize > 0 ? Math.min(16, settings.indentSize) : Math.max(1, Math.min(16, editor.tabSize || 2));
|
|
174221
174227
|
const tabs = settings.indentStyle === "tabs" || settings.indentStyle !== "spaces" && !editor.insertSpaces;
|
|
@@ -174230,14 +174236,14 @@ function configuredFormat(document4, services, settings, editor) {
|
|
|
174230
174236
|
}
|
|
174231
174237
|
let output = "", previousEnd = 0, originalEnd = 0, column2 = 0, continuationIndent = "";
|
|
174232
174238
|
tokens.forEach((token, index3) => {
|
|
174233
|
-
let gap =
|
|
174239
|
+
let gap = canonical4.slice(previousEnd, token.startOffset);
|
|
174234
174240
|
const originalGap = originalText.slice(originalEnd, original2[index3].startOffset);
|
|
174235
|
-
const lineStart =
|
|
174236
|
-
const canonicalIndent = /^ */u.exec(
|
|
174241
|
+
const lineStart = canonical4.lastIndexOf("\n", token.startOffset - 1) + 1;
|
|
174242
|
+
const canonicalIndent = /^ */u.exec(canonical4.slice(lineStart))[0].length / 2;
|
|
174237
174243
|
const indentation = unit2.repeat(canonicalIndent);
|
|
174238
174244
|
let chunkEnd = token.endOffset + 1;
|
|
174239
174245
|
for (let next = index3 + 1; next < tokens.length && tokens[next].startOffset === chunkEnd; next++) chunkEnd = tokens[next].endOffset + 1;
|
|
174240
|
-
const chunkWidth =
|
|
174246
|
+
const chunkWidth = canonical4.slice(token.startOffset, chunkEnd).length;
|
|
174241
174247
|
if (gap.includes("\n")) {
|
|
174242
174248
|
gap = "\n".repeat(separated.has(original2[index3].startOffset) ? blankLines + 1 : 1) + indentation;
|
|
174243
174249
|
continuationIndent = indentation + unit2;
|
|
@@ -174404,9 +174410,9 @@ function validationModels(documents) {
|
|
|
174404
174410
|
return [...new Set(documents.flatMap((d2) => isModel(d2.parseResult.value) ? workspaceModels.get(d2.parseResult.value) ?? [d2.parseResult.value] : []))];
|
|
174405
174411
|
}
|
|
174406
174412
|
function proposedErrors(before, candidates) {
|
|
174407
|
-
const
|
|
174413
|
+
const canonical4 = (value2) => Array.isArray(value2) ? value2.map(canonical4) : value2 && typeof value2 === "object" ? Object.fromEntries(Object.entries(value2).sort(([a3], [b10]) => a3.localeCompare(b10)).map(([key2, value3]) => [key2, canonical4(value3)])) : value2;
|
|
174408
174414
|
const errors = (document4) => (document4.diagnostics ?? []).filter((d2) => d2.severity === 1);
|
|
174409
|
-
const key = (diagnostics) => JSON.stringify(diagnostics.map((d2) => JSON.stringify(
|
|
174415
|
+
const key = (diagnostics) => JSON.stringify(diagnostics.map((d2) => JSON.stringify(canonical4(d2))).sort());
|
|
174410
174416
|
return candidates.flatMap((document4) => {
|
|
174411
174417
|
const uri = document4.uri.toString(), previous3 = before.find((source3) => source3.uri === uri), diagnostics = errors(document4);
|
|
174412
174418
|
if (previous3 && previous3.text === document4.textDocument.getText()) {
|
|
@@ -174578,11 +174584,11 @@ function providerModule() {
|
|
|
174578
174584
|
// packages/language-server/src/timing-evidence.ts
|
|
174579
174585
|
init_lib2();
|
|
174580
174586
|
init_edition();
|
|
174581
|
-
var
|
|
174582
|
-
var revisions = (values) => Object.fromEntries(Object.entries(values).map(([uri, value2]) => [
|
|
174587
|
+
var canonical = (uri) => URI2.parse(uri).toString();
|
|
174588
|
+
var revisions = (values) => Object.fromEntries(Object.entries(values).map(([uri, value2]) => [canonical(uri), value2]));
|
|
174583
174589
|
var evidence = /* @__PURE__ */ new Map();
|
|
174584
174590
|
function getTimingEvidence(uri, sourceRevisions) {
|
|
174585
|
-
const run = evidence.get(
|
|
174591
|
+
const run = evidence.get(canonical(uri));
|
|
174586
174592
|
sourceRevisions = revisions(sourceRevisions);
|
|
174587
174593
|
if (!run) return void 0;
|
|
174588
174594
|
const keys3 = Object.keys(run.sourceRevisions).sort(), current = Object.keys(sourceRevisions).sort();
|
|
@@ -174657,6 +174663,7 @@ init_semantic();
|
|
|
174657
174663
|
// packages/language-server/src/test-inspection.ts
|
|
174658
174664
|
init_ast2();
|
|
174659
174665
|
init_semantic();
|
|
174666
|
+
init_names();
|
|
174660
174667
|
|
|
174661
174668
|
// packages/language-server/src/run-cases.ts
|
|
174662
174669
|
init_ast2();
|
|
@@ -175081,7 +175088,7 @@ var named = (label2, value2) => ({ label: label2, cell: (entry) => {
|
|
|
175081
175088
|
return display(paths.map(elementName).join("\n"), paths.join("\n"));
|
|
175082
175089
|
} });
|
|
175083
175090
|
var typed = (label2, value2) => ({ label: label2, cell: (entry) => display(value2(entry, shortType), value2(entry, typeKey)) });
|
|
175084
|
-
var
|
|
175091
|
+
var canonical2 = (path7) => formatPath(parsePathInput(path7));
|
|
175085
175092
|
var attributes = (entry) => isRequirement(entry.ast) ? entry.ast.attributes : isComponentDef(entry.ast) || isComponentUsage(entry.ast) ? members(entry.ast).filter(isAttribute) : [];
|
|
175086
175093
|
function valueText(value2, type) {
|
|
175087
175094
|
if (isLiteral(value2)) {
|
|
@@ -175227,7 +175234,7 @@ function gridCategoryTables(entries2, models, source3) {
|
|
|
175227
175234
|
case "interface":
|
|
175228
175235
|
columns = [
|
|
175229
175236
|
...start3,
|
|
175230
|
-
column("Endpoints", (entry) => isConnect(entry.ast) ?
|
|
175237
|
+
column("Endpoints", (entry) => isConnect(entry.ast) ? canonical2(entry.ast.source) + " \u2194 " + canonical2(entry.ast.target) : ""),
|
|
175231
175238
|
named("Policy", (entry) => isConnect(entry.ast) && entry.ast.policy?.ref ? [formatPath(identity2(entry.ast.policy.ref))] : []),
|
|
175232
175239
|
column("Settings", (entry) => isQosPolicy(entry.ast) ? entry.ast.settings.map((setting) => formatName(setting.name) + " = " + (setting.duration ?? setting.value)?.$cstNode?.text).join("\n") : ""),
|
|
175233
175240
|
named("Root", (entry) => isDeployment(entry.ast) && entry.ast.root.ref ? [formatPath(identity2(entry.ast.root.ref))] : []),
|
|
@@ -175240,7 +175247,7 @@ function gridCategoryTables(entries2, models, source3) {
|
|
|
175240
175247
|
columns = [
|
|
175241
175248
|
...start3,
|
|
175242
175249
|
type,
|
|
175243
|
-
named("Subjects", (entry) => isView(entry.ast) ? entry.ast.subject ? [
|
|
175250
|
+
named("Subjects", (entry) => isView(entry.ast) ? entry.ast.subject ? [canonical2(entry.ast.subject)] : entry.ast.selections.map((selection2) => canonical2(selection2.subject)) : []),
|
|
175244
175251
|
column("Selections", (entry) => isView(entry.ast) ? entry.ast.selections.map((selection2) => selection2.$cstNode.text).join("\n") : ""),
|
|
175245
175252
|
...end
|
|
175246
175253
|
];
|
|
@@ -175248,7 +175255,7 @@ function gridCategoryTables(entries2, models, source3) {
|
|
|
175248
175255
|
case "package":
|
|
175249
175256
|
columns = [
|
|
175250
175257
|
...start3,
|
|
175251
|
-
column("Imports", (entry) => isPackage(entry.ast) ? entry.ast.imports.map((item) =>
|
|
175258
|
+
column("Imports", (entry) => isPackage(entry.ast) ? entry.ast.imports.map((item) => canonical2(item.namespace)).join("\n") : ""),
|
|
175252
175259
|
...end
|
|
175253
175260
|
];
|
|
175254
175261
|
break;
|
|
@@ -175636,7 +175643,7 @@ async function buildCurrentDiagram(services, params) {
|
|
|
175636
175643
|
}
|
|
175637
175644
|
if (node2 && isState(ast)) {
|
|
175638
175645
|
if (ast.final) node2.shape = "final";
|
|
175639
|
-
node2.meta = { ...node2.meta, stateOwnerId: node2.parent };
|
|
175646
|
+
node2.meta = { ...node2.meta, stateOwnerId: node2.parent, statement: statementIdentity(ast) };
|
|
175640
175647
|
}
|
|
175641
175648
|
if (isExecutable(ast)) for (const state2 of body(ast)?.states ?? []) state2.transitions.forEach((transition2, index3) => {
|
|
175642
175649
|
const from = diagramId(entry.id + "." + state2.name), to = diagramId(entry.id + "." + transition2.target);
|
|
@@ -175652,7 +175659,7 @@ async function buildCurrentDiagram(services, params) {
|
|
|
175652
175659
|
label: triggerGuard + (transition2.effect.statements.length ? " / " + effectText : ""),
|
|
175653
175660
|
source: source(transition2),
|
|
175654
175661
|
effect: transition2.effect.statements.length ? { id: effectId, role: "effect", declarationId: diagramId(identity2(ast)) + "::" + state2.name + "::$transition:" + index3 + "::$effect", ownerId: from, summary: effectText, text: effectText, source: source(transition2), bodySource: source(transition2.effect), provenance: diagramId(identity2(ast)) === diagramId(entry.id) ? "local" : "inherited", status: "available" } : void 0,
|
|
175655
|
-
meta: { semanticKind: "transition", sourceOrder: index3, guardText: guard2 ?? "", transitionTriggerGuard: triggerGuard, effectText }
|
|
175662
|
+
meta: { semanticKind: "transition", sourceOrder: index3, guardText: guard2 ?? "", transitionTriggerGuard: triggerGuard, effectText, statement: statementIdentity(transition2) }
|
|
175656
175663
|
});
|
|
175657
175664
|
});
|
|
175658
175665
|
if ((isExecutable(ast) || isScenario(ast) && ast.statements.length) && kind2 === "fv") addOperationFlow(model, entry, ast);
|
|
@@ -175788,7 +175795,7 @@ async function buildCurrentDiagram(services, params) {
|
|
|
175788
175795
|
const candidateEvidence = getTimingEvidence(params.uri, revisions2), runPrefixes = (result) => result.target.kind === "package" ? ctx.models.flatMap((m2) => m2.packages).filter((p2) => p2.name === result.target.identity).flatMap((p2) => p2.elements.filter(isComponentUsage).map((root6) => p2.name + "::" + root6.name + ".")) : [result.target.identity + "."];
|
|
175789
175796
|
const evidence2 = candidateEvidence && contracts.some((c2) => runPrefixes(candidateEvidence.result).some((prefix) => c2.functionPath.startsWith(prefix))) ? candidateEvidence : void 0;
|
|
175790
175797
|
const runPackage = evidence2 && (evidence2.result.target.kind === "package" ? evidence2.result.target.identity : evidence2.result.target.identity.slice(0, evidence2.result.target.identity.lastIndexOf("::")));
|
|
175791
|
-
const
|
|
175798
|
+
const canonical4 = (path7) => path7.includes("::") ? path7 : runPackage + "::" + path7;
|
|
175792
175799
|
const selectedSubjects = new Set(contracts.map((c2) => c2.functionPath));
|
|
175793
175800
|
const endNs = evidence2 ? evidence2.result.status === "horizon" ? evidence2.result.options.untilNs : evidence2.result.timeNs : 0;
|
|
175794
175801
|
const timing = evidence2 && projectOperationTiming(evidence2.result), requestActivations = /* @__PURE__ */ new Map();
|
|
@@ -175798,7 +175805,7 @@ async function buildCurrentDiagram(services, params) {
|
|
|
175798
175805
|
const markers = timing.markers.filter((m2) => (m2.activation ?? (m2.kind === "timeout" && typeof m2.correlation === "string" ? requestActivations.get(m2.correlation) : void 0)) === id2);
|
|
175799
175806
|
return {
|
|
175800
175807
|
id: id2,
|
|
175801
|
-
functionPath:
|
|
175808
|
+
functionPath: canonical4(values[0].subject),
|
|
175802
175809
|
outcome: timing.markers.find((m2) => m2.activation === id2)?.kind ?? "open",
|
|
175803
175810
|
intervals: values.map((i2) => ({ state: i2.phase, start: { timeNs: i2.startNs }, end: { timeNs: i2.endNs ?? endNs }, open: i2.endNs === void 0 })),
|
|
175804
175811
|
markers: markers.map((m2) => ({ kind: m2.kind, point: { timeNs: m2.timeNs, ordinal: m2.ordinal }, correlation: typeof m2.correlation === "string" ? m2.correlation : void 0, detail: m2.subject }))
|
|
@@ -176514,13 +176521,13 @@ ${JSON.stringify(source3.range)}` : void 0;
|
|
|
176514
176521
|
allocation: "allocations"
|
|
176515
176522
|
};
|
|
176516
176523
|
for (const child of children2) {
|
|
176517
|
-
const
|
|
176524
|
+
const canonical4 = canonicalById.get(child.id) ?? canonicalBySource.get(sourceKey5(child.source) ?? "");
|
|
176518
176525
|
const kind2 = child.keyword.replace(/^ref\s+/, "").replace(/\s+def$/, "");
|
|
176519
176526
|
const wiringFeature = !child.isDef && /^(?:connection|interface|connector)$/.test(kind2);
|
|
176520
|
-
const title = wiringFeature && node2.shape !== "package" ? "features" : node2.shape === "package" ? "members" :
|
|
176527
|
+
const title = wiringFeature && node2.shape !== "package" ? "features" : node2.shape === "package" ? "members" : canonical4?.compartment.title ?? (child.isDef ? "definitions" : titles[kind2] ?? "members");
|
|
176521
176528
|
const definition3 = index3.byId.get(index3.definition.get(child.id) ?? "");
|
|
176522
176529
|
const type = child.type ?? definition3?.name;
|
|
176523
|
-
const text8 = node2.shape === "package" || child.isDef ? `\xAB${child.keyword}\xBB ${child.name}` :
|
|
176530
|
+
const text8 = node2.shape === "package" || child.isDef ? `\xAB${child.keyword}\xBB ${child.name}` : canonical4?.item.text ?? (kind2 === "doc" ? child.type ?? child.name : `${child.name}${type ? ` : ${type}` : ""}${child.multiplicity ? ` ${child.multiplicity}` : ""}${child.value !== void 0 ? ` = ${child.value}` : ""}`);
|
|
176524
176531
|
const group = groups.get(title) ?? { title, items: [], expandable: false, expanded: false };
|
|
176525
176532
|
group.items.push({ text: text8, source: child.source, membership: child.membership, node: child });
|
|
176526
176533
|
groups.set(title, group);
|
|
@@ -177377,10 +177384,10 @@ function projectGvStructureRelationships(input) {
|
|
|
177377
177384
|
...record2.body.nodes.map((node2) => node2.id)
|
|
177378
177385
|
]));
|
|
177379
177386
|
for (const node2 of model.nodes) if (node2.meta?.gvRelationshipId || node2.meta?.gvRelationshipBodyOf) omitted.add(node2.id);
|
|
177380
|
-
const
|
|
177387
|
+
const sourceKeys2 = new Set(records.map((record2) => sourceKey4(record2.declaration)).filter(Boolean));
|
|
177381
177388
|
const primaryIds = new Set(records.flatMap((record2) => record2.edges.map((edge) => edge.id)));
|
|
177382
177389
|
const nodes2 = model.nodes.filter((node2) => !omitted.has(node2.id));
|
|
177383
|
-
const edges = model.edges.filter((edge) => edge.meta?.connectionDefinitionGraphical !== true && !primaryIds.has(edge.id) && !omitted.has(edge.from) && !omitted.has(edge.to) && !(
|
|
177390
|
+
const edges = model.edges.filter((edge) => edge.meta?.connectionDefinitionGraphical !== true && !primaryIds.has(edge.id) && !omitted.has(edge.from) && !omitted.has(edge.to) && !(sourceKeys2.has(sourceKey4(edge)) && !["composition", "owningMembership", "definedBy", "reference"].includes(edge.kind)));
|
|
177384
177391
|
for (const record2 of records) {
|
|
177385
177392
|
if (!canDisclose(record2) || !gvElementIsExpanded(record2.declaration, expanded2)) continue;
|
|
177386
177393
|
let displayOwner = record2.ownerId;
|
|
@@ -190343,7 +190350,7 @@ var xy = (p2) => `${fmt(p2.x)},${fmt(p2.y)}`;
|
|
|
190343
190350
|
function cleanPolyline(points) {
|
|
190344
190351
|
return clean(points);
|
|
190345
190352
|
}
|
|
190346
|
-
function
|
|
190353
|
+
function canonical3(points) {
|
|
190347
190354
|
return clean(points.map(rounded));
|
|
190348
190355
|
}
|
|
190349
190356
|
function clean(points) {
|
|
@@ -190647,7 +190654,7 @@ var OrthogonalRouteIndex = class _OrthogonalRouteIndex {
|
|
|
190647
190654
|
}
|
|
190648
190655
|
/** Add one settled route. Input is compared on the rounded grid, never mutated. */
|
|
190649
190656
|
add(points, tags) {
|
|
190650
|
-
const route =
|
|
190657
|
+
const route = canonical3([...points]);
|
|
190651
190658
|
const horizontals = [];
|
|
190652
190659
|
const verticals = [];
|
|
190653
190660
|
for (let i2 = 1; i2 < route.length; i2 += 1) {
|
|
@@ -190680,7 +190687,7 @@ var OrthogonalRouteIndex = class _OrthogonalRouteIndex {
|
|
|
190680
190687
|
/** Count strict perpendicular intersections. Endpoint contacts and parallel
|
|
190681
190688
|
* overlaps are joins/continuations, not route crossings. */
|
|
190682
190689
|
crossingCount(points) {
|
|
190683
|
-
const route =
|
|
190690
|
+
const route = canonical3([...points]);
|
|
190684
190691
|
let count = 0;
|
|
190685
190692
|
for (let i2 = 1; i2 < route.length; i2 += 1) {
|
|
190686
190693
|
const a3 = route[i2 - 1], b10 = route[i2];
|
|
@@ -190710,7 +190717,7 @@ var OrthogonalRouteIndex = class _OrthogonalRouteIndex {
|
|
|
190710
190717
|
* geometry is indexed once by {@link add}, so a shared structural bus has
|
|
190711
190718
|
* one occupancy cost rather than one per semantic member. */
|
|
190712
190719
|
overlapCount(points) {
|
|
190713
|
-
const route =
|
|
190720
|
+
const route = canonical3([...points]);
|
|
190714
190721
|
let count = 0;
|
|
190715
190722
|
for (let i2 = 1; i2 < route.length; i2 += 1) {
|
|
190716
190723
|
const a3 = route[i2 - 1], b10 = route[i2];
|
|
@@ -197403,10 +197410,10 @@ function registerEdgeSideHandles(nodes2, edges) {
|
|
|
197403
197410
|
const node2 = byId.get(id2);
|
|
197404
197411
|
const parsed = parseSideAnchorHandleId(handle2);
|
|
197405
197412
|
if (!node2 || !parsed) continue;
|
|
197406
|
-
const
|
|
197407
|
-
if (
|
|
197408
|
-
if (end === "source") edge.sourceHandle =
|
|
197409
|
-
else edge.targetHandle =
|
|
197413
|
+
const canonical4 = sideAnchorHandleId(parsed.side, parsed.offset);
|
|
197414
|
+
if (canonical4 !== handle2) {
|
|
197415
|
+
if (end === "source") edge.sourceHandle = canonical4;
|
|
197416
|
+
else edge.targetHandle = canonical4;
|
|
197410
197417
|
if (edge.data?.settledGeometry) edge.data = { ...edge.data, settledGeometry: void 0 };
|
|
197411
197418
|
}
|
|
197412
197419
|
const current = node2.data.edgeSideAnchors?.[parsed.side] ?? [];
|
|
@@ -224746,6 +224753,9 @@ function configuredDiagnostics(diagnostics, settings) {
|
|
|
224746
224753
|
return [{ ...diagnostic, severity }];
|
|
224747
224754
|
});
|
|
224748
224755
|
}
|
|
224756
|
+
function diagnosticsFailPolicy(loaded, strict = false) {
|
|
224757
|
+
return loaded.diagnostics.some((item) => item.severity === 1 || (strict || loaded.settings.get(item.uri)?.["swaml.lint.profile"] === "strict") && item.severity === 2) || configuredDiagnostics(loaded.diagnostics, loaded.settings).some((item) => item.severity === 1);
|
|
224758
|
+
}
|
|
224749
224759
|
function parseArguments(args2, flags) {
|
|
224750
224760
|
const values = {}, switches = /* @__PURE__ */ new Set(), inputs = [];
|
|
224751
224761
|
for (let index3 = 0; index3 < args2.length; index3++) {
|
|
@@ -224768,7 +224778,7 @@ function parseArguments(args2, flags) {
|
|
|
224768
224778
|
// packages/cli/package.json
|
|
224769
224779
|
var package_default = {
|
|
224770
224780
|
name: "swaml-diagram",
|
|
224771
|
-
version: "0.
|
|
224781
|
+
version: "0.16.0",
|
|
224772
224782
|
private: true,
|
|
224773
224783
|
type: "module",
|
|
224774
224784
|
scripts: {
|
|
@@ -224806,7 +224816,7 @@ async function validateMain(args2) {
|
|
|
224806
224816
|
for (const item of diagnostics) console.log(`${item.file}:${item.line}:${item.column}: ${item.severity === 1 ? "error" : item.severity === 2 ? "warning" : "info"} ${item.code ?? ""}: ${item.message}`);
|
|
224807
224817
|
if (!diagnostics.length) console.log(loaded.diagnostics.some((item) => item.severity === 1) ? `swa.ml source is invalid; ${loaded.diagnostics.length} diagnostic(s) hidden by display settings. Use --no-config to inspect them.` : `Validated ${documents.length} swa.ml file(s), swa.ml 2.1 (implementation 3.0.0).`);
|
|
224808
224818
|
}
|
|
224809
|
-
return loaded
|
|
224819
|
+
return diagnosticsFailPolicy(loaded, switches.has("strict")) ? 1 : 0;
|
|
224810
224820
|
}
|
|
224811
224821
|
|
|
224812
224822
|
// packages/cli/src/main.ts
|
|
@@ -224835,7 +224845,7 @@ async function diagramMain(args2) {
|
|
|
224835
224845
|
const sidecar = switches.has("no-config") ? void 0 : readSideCar(root6, file);
|
|
224836
224846
|
const settings = switches.has("no-config") ? diagramSettingsFor(void 0) : diagramSettingsFor(readProjectConfig(root6), readWorkspaceSettings(root6));
|
|
224837
224847
|
const loaded = await loadWorkspace([file, ...values.workspace ? [values.workspace] : []], { languageVersion: values["language-version"], noConfig: switches.has("no-config") });
|
|
224838
|
-
if (loaded
|
|
224848
|
+
if (diagnosticsFailPolicy(loaded, switches.has("strict"))) {
|
|
224839
224849
|
for (const item of loaded.diagnostics) console.error(`${item.file}:${item.line}:${item.column}: ${item.code ?? ""} ${item.message}`);
|
|
224840
224850
|
return 1;
|
|
224841
224851
|
}
|
package/dist/validate.mjs
CHANGED
|
@@ -43725,7 +43725,7 @@ var init_swaml_module = __esm({
|
|
|
43725
43725
|
// packages/cli/package.json
|
|
43726
43726
|
var package_default = {
|
|
43727
43727
|
name: "swaml-diagram",
|
|
43728
|
-
version: "0.
|
|
43728
|
+
version: "0.16.0",
|
|
43729
43729
|
private: true,
|
|
43730
43730
|
type: "module",
|
|
43731
43731
|
scripts: {
|
|
@@ -48663,6 +48663,7 @@ init_semantic();
|
|
|
48663
48663
|
// packages/language-server/src/test-inspection.ts
|
|
48664
48664
|
init_ast2();
|
|
48665
48665
|
init_semantic();
|
|
48666
|
+
init_names();
|
|
48666
48667
|
|
|
48667
48668
|
// packages/language-server/src/run-cases.ts
|
|
48668
48669
|
init_ast2();
|
|
@@ -49013,6 +49014,9 @@ function configuredDiagnostics(diagnostics, settings) {
|
|
|
49013
49014
|
return [{ ...diagnostic, severity }];
|
|
49014
49015
|
});
|
|
49015
49016
|
}
|
|
49017
|
+
function diagnosticsFailPolicy(loaded, strict = false) {
|
|
49018
|
+
return loaded.diagnostics.some((item) => item.severity === 1 || (strict || loaded.settings.get(item.uri)?.["swaml.lint.profile"] === "strict") && item.severity === 2) || configuredDiagnostics(loaded.diagnostics, loaded.settings).some((item) => item.severity === 1);
|
|
49019
|
+
}
|
|
49016
49020
|
function parseArguments(args, flags) {
|
|
49017
49021
|
const values = {}, switches = /* @__PURE__ */ new Set(), inputs = [];
|
|
49018
49022
|
for (let index = 0; index < args.length; index++) {
|
|
@@ -49058,7 +49062,7 @@ async function validateMain(args) {
|
|
|
49058
49062
|
for (const item of diagnostics) console.log(`${item.file}:${item.line}:${item.column}: ${item.severity === 1 ? "error" : item.severity === 2 ? "warning" : "info"} ${item.code ?? ""}: ${item.message}`);
|
|
49059
49063
|
if (!diagnostics.length) console.log(loaded.diagnostics.some((item) => item.severity === 1) ? `swa.ml source is invalid; ${loaded.diagnostics.length} diagnostic(s) hidden by display settings. Use --no-config to inspect them.` : `Validated ${documents.length} swa.ml file(s), swa.ml 2.1 (implementation 3.0.0).`);
|
|
49060
49064
|
}
|
|
49061
|
-
return loaded
|
|
49065
|
+
return diagnosticsFailPolicy(loaded, switches.has("strict")) ? 1 : 0;
|
|
49062
49066
|
}
|
|
49063
49067
|
|
|
49064
49068
|
// packages/cli/src/validate-main.ts
|