@radicaltools/mcp 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.md +7 -5
  2. package/dist/{chunk-Z7THA3L5.js → chunk-KEIZXREX.js} +68 -35
  3. package/dist/{elkLayout-TAUBPPVN.js → elkLayout-MFJXDTJG.js} +1 -1
  4. package/dist/hub-catalogue/concern/concern-api-collections.radical +1136 -0
  5. package/dist/hub-catalogue/concern/concern-api-errors.radical +1180 -0
  6. package/dist/hub-catalogue/concern/concern-api-evolution.radical +449 -210
  7. package/dist/hub-catalogue/concern/concern-api-idempotency.radical +1218 -0
  8. package/dist/hub-catalogue/concern/concern-api-resource-design.radical +1102 -0
  9. package/dist/hub-catalogue/concern/concern-api-style-guide.radical +1210 -0
  10. package/dist/hub-catalogue/concern/concern-architecture-style.radical +287 -131
  11. package/dist/hub-catalogue/concern/concern-audit-trail.radical +1096 -0
  12. package/dist/hub-catalogue/concern/concern-authentication.radical +247 -37
  13. package/dist/hub-catalogue/concern/concern-authorization.radical +311 -89
  14. package/dist/hub-catalogue/concern/concern-availability.radical +287 -63
  15. package/dist/hub-catalogue/concern/concern-backend-stack.radical +300 -381
  16. package/dist/hub-catalogue/concern/concern-backup-recovery.radical +385 -129
  17. package/dist/hub-catalogue/concern/concern-caching.radical +1294 -0
  18. package/dist/hub-catalogue/concern/concern-capacity.radical +194 -81
  19. package/dist/hub-catalogue/concern/concern-code-documentation.radical +1397 -0
  20. package/dist/hub-catalogue/concern/concern-code-quality-gate.radical +1409 -0
  21. package/dist/hub-catalogue/concern/concern-code-review-branching.radical +1416 -0
  22. package/dist/hub-catalogue/concern/concern-code-style.radical +1058 -0
  23. package/dist/hub-catalogue/concern/concern-communication-style.radical +473 -167
  24. package/dist/hub-catalogue/concern/concern-data-classification.radical +970 -0
  25. package/dist/hub-catalogue/concern/concern-data-consistency.radical +339 -308
  26. package/dist/hub-catalogue/concern/concern-data-store.radical +480 -158
  27. package/dist/hub-catalogue/concern/concern-decomposition.radical +260 -85
  28. package/dist/hub-catalogue/concern/concern-definition-of-done.radical +1214 -0
  29. package/dist/hub-catalogue/concern/concern-delivery-metrics.radical +966 -0
  30. package/dist/hub-catalogue/concern/concern-dependency-hygiene.radical +1345 -0
  31. package/dist/hub-catalogue/concern/concern-deployment.radical +343 -92
  32. package/dist/hub-catalogue/concern/concern-encryption.radical +339 -76
  33. package/dist/hub-catalogue/concern/concern-error-handling-logging.radical +1197 -0
  34. package/dist/hub-catalogue/concern/concern-eu-dora.radical +1321 -0
  35. package/dist/hub-catalogue/concern/concern-frontend-stack.radical +467 -160
  36. package/dist/hub-catalogue/concern/concern-incident-management.radical +1204 -0
  37. package/dist/hub-catalogue/concern/concern-infrastructure.radical +1300 -268
  38. package/dist/hub-catalogue/concern/concern-integration-resilience.radical +88 -51
  39. package/dist/hub-catalogue/concern/concern-messaging.radical +173 -140
  40. package/dist/hub-catalogue/concern/concern-module-boundaries.radical +162 -159
  41. package/dist/hub-catalogue/concern/concern-observability.radical +224 -275
  42. package/dist/hub-catalogue/concern/concern-operational-readiness.radical +1249 -0
  43. package/dist/hub-catalogue/concern/concern-personal-data.radical +637 -122
  44. package/dist/hub-catalogue/concern/concern-quality-priorities.radical +1091 -0
  45. package/dist/hub-catalogue/concern/concern-rate-limiting.radical +433 -141
  46. package/dist/hub-catalogue/concern/concern-release-versioning.radical +1358 -0
  47. package/dist/hub-catalogue/concern/concern-retention.radical +1399 -0
  48. package/dist/hub-catalogue/concern/concern-secrets.radical +332 -74
  49. package/dist/hub-catalogue/concern/concern-secure-coding.radical +1379 -0
  50. package/dist/hub-catalogue/concern/concern-secure-development.radical +1245 -0
  51. package/dist/hub-catalogue/concern/concern-security-detection.radical +1153 -0
  52. package/dist/hub-catalogue/concern/concern-supply-chain.radical +257 -183
  53. package/dist/hub-catalogue/concern/concern-technical-debt.radical +1450 -0
  54. package/dist/hub-catalogue/concern/concern-technology-lifecycle.radical +1145 -0
  55. package/dist/hub-catalogue/concern/concern-tenant-isolation.radical +271 -137
  56. package/dist/hub-catalogue/concern/concern-test-strategy.radical +243 -224
  57. package/dist/hub-catalogue/concern/concern-threat-modelling.radical +1143 -0
  58. package/dist/index.js +1893 -468
  59. package/package.json +1 -1
package/README.md CHANGED
@@ -48,10 +48,12 @@ Launch Studio with `npm run dev:web` from the repository root, open it in Chromi
48
48
  The server binds to one folder at launch, then reads it afresh for every tool call. Its tools are the shared AI tool catalogue from `@radical/common/ai/tools`, the one Studio's AI chat and Radical Forge use, minus the canvas-only `set_active_view` and `focus_node` and the destructive `reset_diagram`. It provides:
49
49
 
50
50
  - `get_model_summary` (counts, views, sequences, milestones, presentations, the modelling rules Studio's chat and Forge follow, and the metamodel rules) and `search_model` (a small query language, including `LIST SEQUENCES` and `GET SEQUENCE`);
51
- - the `forge_*` tools: a Radical Forge run with the agent's model, ending with a Review stage over the whole model. Each stage may fill gaps in earlier stages, but only by asking: `forge_propose_refinement` checks a proposal and returns exactly what it would write, for the agent to show the user, and `forge_answer_refinement` writes it only if the user accepts (while a stage is open the server refuses direct writes to earlier stages, and every write while a proposal waits for its answer). `forge_complete_stage` lists what the stage refined, with the gaps the completeness rules still find. In a folder with no base from git, `forge_start` saves the model as it was before the run to `.radical/base.json`, so Studio's Changes on branch shows the run. After every step the server writes where the run stands to `.radical/forge-run.json` (next to the selection, also out of git), and marks it closed when the client goes away, so Studio open on the folder can show it on its Forge button;
51
+ - the `forge_*` tools: a Radical Forge run with the agent's model, ending with a Review stage over the whole model. Each stage may fill gaps in earlier stages, but only by asking: `forge_propose_refinement` checks a proposal and returns exactly what it would write, for the agent to show the user, and `forge_answer_refinement` writes it only if the user accepts (while a stage is open the server refuses direct writes to earlier stages, and every write while a proposal waits for its answer). `forge_complete_stage` lists what the stage refined, with the gaps the completeness rules still find. In a folder with no base from git, `forge_start` saves the model as it was before the run to `.state/base.json`, so Studio's Changes on branch shows the run. After every step the server writes where the run stands to `.state/forge-run.json` (next to the selection, also out of git), and marks it closed when the client goes away, so Studio open on the folder can show it on its Forge button;
52
52
  - `get_issues`: every rule the model breaks now, as the Validation list in Studio's metamodel editor shows it. A write is refused when it brings in a new error; the warnings it brings in (a state machine without an initial state, a reference to no node, …) come back with its result, since a model is often incomplete while it is being built;
53
- - `get_selection`: what is selected on Studio's canvas for this folder (the view on screen, each selected node in full, selected relations), so you can say "fix the selected mockup" instead of naming it. Studio writes it to `.radical/selection.json` in the model folder whenever the selection or the view changes, and clears it when you switch to another model; `.radical/` carries its own `.gitignore`, and the file is not part of the model, so writing it never conflicts with model edits;
54
- - `get_changes`: what changed in the model since its version in git, for an agent asked to implement a change made in the model. It lists the elements and relations added, removed and changed (uncommitted edits included), each changed field with its old and new value, and each element with its place and its relations, such as the component that satisfies a requirement and the scenarios that verify it. Views, positions, sizes and folding are left out. `since` names the branch, tag or commit to compare with; by default it is the merge base with the default branch (`origin/main`), so every model change on the branch counts. `radical diff` prints the same list. Without `since` it also saves that base to `.radical/base.json`, for Studio to show the same changes (Changes on branch);
53
+ - `get_selection`: what is selected on Studio's canvas for this folder (the view on screen, each selected node in full, selected relations), so you can say "fix the selected mockup" instead of naming it. Studio writes it to `.state/selection.json` in the model folder whenever the selection or the view changes, and clears it when you switch to another model; `.state/` carries its own `.gitignore`, and the file is not part of the model, so writing it never conflicts with model edits;
54
+ - `get_changes`: what changed in the model since its version in git, for an agent asked to implement a change made in the model. It lists the elements and relations added, removed and changed (uncommitted edits included), each changed field with its old and new value, and each element with its place and its relations, such as the component that satisfies a requirement and the scenarios that verify it. Views, positions, sizes and folding are left out. `since` names the branch, tag or commit to compare with; by default it is the merge base with the default branch (`origin/main`), so every model change on the branch counts. `radical diff` prints the same list. Without `since` it also saves that base to `.state/base.json`, for Studio to show the same changes (Changes on branch);
55
+ - `get_verification` and `set_verification`: which tests check the model's scenarios and fitness functions, in the repository's `.radical/radical.json` ("verifies"; the model names no test). `get_verification` with an `id` lists the tests bound to it; without one, every entry and the scenarios this repository must verify that have nothing checking them. `set_verification` replaces a scenario's or fitness function's tests, or takes it out with `remove: true`, as `radical verify` does; call it for each test you write. It changes no model file;
56
+ - `get_implementation` and `set_implementation`: where the repository builds the model's elements, in its `.radical/radical.json` (folders from the repository's root). `get_implementation` with an `id` gives the element's folders, its own or its nearest mapped parent's; without one, every entry and the C4 elements built nowhere the file says. `set_implementation` replaces an element's folders, or takes it out with `remove: true`, as `radical implement` does; it changes no model file. The repository's sensors, `radical check` and Studio's element card read the same file;
55
57
  - `add_`, `update_` and `delete_` tools for nodes and relations, and `move_node` to change a node's parent (the node keeps its canvas position where it lies inside the new parent and clear of its new siblings, else it is placed beside them and what lies round the grown parent makes room; it enforces the metamodel's `allowedParents`). A reference property (a transition's `event` and `raises`) takes node ids or tempIds from the same connection and refuses a node of the wrong type;
56
58
  - `create_view`, `update_view` (name, folder in the list of views, line style, kind, linked sequence, hidden relations, elements shown open or folded, filter chain, or `viewpoint`: one of the metamodel's viewpoints, whose kind and chain the view then follows, with `subject` the element it draws for a viewpoint that draws one, such as a state machine or a system's containers; `null` keeps them for the view alone), `set_view_nodes`, `order_views` (the order of views, and so of their folders) and `delete_view`;
57
59
  - `create_sequence`, `update_sequence` and `delete_sequence`: ordered relation flows that a `dynamic` view plays;
@@ -71,8 +73,8 @@ Writes preserve unrelated files and the existing `radical.md` text. A tool repor
71
73
  You can keep editing in Studio while an agent writes the same folder. Neither side overwrites the other:
72
74
 
73
75
  - **Merged, not refused.** If a file changed between a call's read and its write (Studio saved, you edited a file, git pulled), the server merges its change with that edit, element by element and field by field, and says so in the result (`Merged with edits made in the folder while the call ran …`). Where both changed the same value, the folder's is kept and the result names it, so the agent can check it with `search_model`. Studio merges its own saves the same way. A change only to positions or sizes merges silently. A file that no longer reads as a model (git conflict markers, a half-written file) is not merged over: the call writes nothing and names the file.
74
- - **Two writers at once.** Two servers on one folder (Claude Desktop and Claude Code), or a server and the desktop app, write it one at a time: each takes the folder's turn in `.radical/write.lock` for its check and its write, so the second finds the first one's change and merges with it. A turn left by a process that is gone, or held for 15 seconds, is taken over. Studio in a browser does not take turns; it merges as above.
75
- - **Taking turns.** After each write the server marks the folder as being written by an agent in `.radical/agent-activity.json` (out of git, like the selection) for 15 seconds. Meanwhile Studio holds its saves: it says so once, takes in each change of the agent as it reloads, keeping your edits on top, and saves them when the agent pauses.
76
+ - **Two writers at once.** Two servers on one folder (Claude Desktop and Claude Code), or a server and the desktop app, write it one at a time: each takes the folder's turn in `.state/write.lock` for its check and its write, so the second finds the first one's change and merges with it. A turn left by a process that is gone, or held for 15 seconds, is taken over. Studio in a browser does not take turns; it merges as above.
77
+ - **Taking turns.** After each write the server marks the folder as being written by an agent in `.state/agent-activity.json` (out of git, like the selection) for 15 seconds. Meanwhile Studio holds its saves: it says so once, takes in each change of the agent as it reloads, keeping your edits on top, and saves them when the agent pauses.
76
78
 
77
79
  Single `.radical` JSON files, loading a milestone over the current model (the milestone tools save, list, rename, delete and compare them), commands that drive Studio's canvas, and remote HTTP MCP are not supported by this server.
78
80
 
@@ -31,7 +31,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
31
31
  var define_RADICAL_BUILD_default;
32
32
  var init_define_RADICAL_BUILD = __esm({
33
33
  "<define:__RADICAL_BUILD__>"() {
34
- define_RADICAL_BUILD_default = { version: "0.3.0", commit: "f76cbf9", date: "2026-10-27", release: true };
34
+ define_RADICAL_BUILD_default = { version: "0.3.2", commit: "9628fbe", date: "2026-11-02", release: true };
35
35
  }
36
36
  });
37
37
 
@@ -133,8 +133,8 @@ function canAddMoreOfType(metamodel, typeId, currentCount) {
133
133
  return currentCount < def.cardinality.max;
134
134
  }
135
135
  var RESERVED_PROPERTY_KEYS = {
136
- node: /* @__PURE__ */ new Set(["id", "type", "parentId", "x", "y", "width", "height", "collapsed"]),
137
- relation: /* @__PURE__ */ new Set(["id", "sourceId", "targetId", "relationType"])
136
+ node: /* @__PURE__ */ new Set(["id", "type", "parentId", "x", "y", "width", "height", "collapsed", "origin"]),
137
+ relation: /* @__PURE__ */ new Set(["id", "sourceId", "targetId", "relationType", "origin"])
138
138
  };
139
139
  function isReservedPropertyKey(key, of) {
140
140
  return RESERVED_PROPERTY_KEYS[of].has(key);
@@ -991,14 +991,14 @@ function radicalViewpoints() {
991
991
  id: "fitness-functions",
992
992
  label: "Fitness functions",
993
993
  group: "Decisions",
994
- description: "A table of the fitness functions by category, each with the decisions it checks and the elements it constrains.",
994
+ description: "A table of the fitness functions by characteristic, each with the decisions it checks and the elements it constrains.",
995
995
  kind: "table",
996
996
  pipeline: {
997
997
  levels: [
998
998
  { ways: [{ types: ["fitness-fn"] }] },
999
999
  { ways: [{ via: { relationType: "implements", direction: "out" }, types: ["adr"] }, { via: { relationType: "constrains", direction: "out" } }] }
1000
1000
  ],
1001
- sort: { by: "property", key: "category" }
1001
+ sort: { by: "property", key: "characteristic" }
1002
1002
  }
1003
1003
  },
1004
1004
  {
@@ -1465,11 +1465,33 @@ function builtInDddC4Metamodel() {
1465
1465
 
1466
1466
  // ../../packages/common/src/metamodel/presets/governance.ts
1467
1467
  var RADICAL_METAMODEL_NAME = "Radical";
1468
- var TESTS_PROPERTY = {
1469
- key: "tests",
1470
- label: "Tests (one per line: file \u203A title)",
1471
- type: "textarea"
1472
- };
1468
+ var METRICS_PROPERTIES = [
1469
+ { key: "metrics", label: "Metrics (one per line: metric{labels} <= value unit; tests are bound in .radical/radical.json)", type: "textarea" },
1470
+ { key: "combine", label: "Combine (all, any, at least N)", type: "text" },
1471
+ { key: "max_age", label: "Max age of a measurement (e.g. 7d)", type: "text" }
1472
+ ];
1473
+ var FITNESS_CHARACTERISTICS = [
1474
+ "functional-suitability",
1475
+ "performance-efficiency",
1476
+ "compatibility",
1477
+ "interaction-capability",
1478
+ "reliability",
1479
+ "security",
1480
+ "maintainability",
1481
+ "flexibility",
1482
+ "safety",
1483
+ "other"
1484
+ ];
1485
+ var FITNESS_TRIGGERS = ["pull-request", "nightly", "weekly", "release", "deploy"];
1486
+ var FITNESS_CLASSIFICATION_PROPERTIES = [
1487
+ { key: "characteristic", label: "Characteristic (ISO/IEC 25010)", type: "enum", options: [...FITNESS_CHARACTERISTICS] },
1488
+ { key: "scope", label: "Scope", type: "enum", options: ["atomic", "holistic"] },
1489
+ { key: "cadence", label: "Cadence", type: "enum", options: ["triggered", "continual", "temporal"] },
1490
+ { key: "trigger", label: "Runs on", type: "enum", options: [...FITNESS_TRIGGERS], visibleWhen: { key: "cadence", values: ["triggered"] } },
1491
+ { key: "every", label: "Every (e.g. 90d)", type: "text", visibleWhen: { key: "cadence", values: ["temporal"] } },
1492
+ { key: "invocation", label: "Invocation", type: "enum", options: ["automated", "manual"] },
1493
+ { key: "measure", label: "Measure (one per line: a sensor and its arguments)", type: "textarea", visibleWhen: { key: "invocation", values: ["automated"] } }
1494
+ ];
1473
1495
  function builtInGovernanceMetamodel() {
1474
1496
  const base = builtInDddC4Metamodel();
1475
1497
  const adrProps = [
@@ -1559,15 +1581,8 @@ function builtInGovernanceMetamodel() {
1559
1581
  };
1560
1582
  const fitnessFnProps = [
1561
1583
  { key: "description", label: "Description", type: "textarea" },
1562
- {
1563
- key: "category",
1564
- label: "Category",
1565
- type: "enum",
1566
- options: ["structural", "operational", "process", "holistic"],
1567
- default: "structural"
1568
- },
1569
- { key: "threshold", label: "Threshold / Success criteria", type: "text" },
1570
- TESTS_PROPERTY
1584
+ ...FITNESS_CLASSIFICATION_PROPERTIES,
1585
+ ...METRICS_PROPERTIES
1571
1586
  ];
1572
1587
  const fitnessFn = {
1573
1588
  id: "fitness-fn",
@@ -1591,21 +1606,27 @@ function builtInGovernanceMetamodel() {
1591
1606
  steps: [
1592
1607
  {
1593
1608
  kind: "fields",
1594
- title: "Name & category",
1595
- fields: ["label", "category"],
1596
- help: 'Name the architectural characteristic this function protects, e.g. "Checkout p95 latency".'
1609
+ title: "Name & characteristic",
1610
+ fields: ["label", "characteristic", "scope"],
1611
+ help: 'Name what this function protects, e.g. "Checkout p95 latency", and the ISO/IEC 25010 characteristic it is part of. Atomic checks one part in one context (a unit test, a linter rule); holistic checks how several parts behave together (latency under load).'
1612
+ },
1613
+ {
1614
+ kind: "fields",
1615
+ title: "When it runs",
1616
+ fields: ["cadence", "trigger", "every", "invocation"],
1617
+ help: "Triggered runs on an event (a pull request, every night, a release); continual runs all the time (monitoring in production); temporal falls due after a time (every 90 days). Manual means a person reviews it and records the result with radical sense review."
1597
1618
  },
1598
1619
  {
1599
1620
  kind: "fields",
1600
1621
  title: "What it measures",
1601
- fields: ["description"],
1602
- help: "How is the characteristic measured \u2014 a test, a metric, a static check?"
1622
+ fields: ["description", "measure"],
1623
+ help: 'How is the characteristic measured? Measure names a sensor and its arguments, one per line, e.g. "playwright tests/load.spec.ts --label env=staging"; leave it empty for tests the pull-request gate already runs.'
1603
1624
  },
1604
1625
  {
1605
1626
  kind: "fields",
1606
1627
  title: "Success criteria",
1607
- fields: ["threshold"],
1608
- help: 'When does it pass? Give a concrete threshold, e.g. "p95 < 300 ms".'
1628
+ fields: ["metrics"],
1629
+ help: `When does it pass? One condition per line: a measured value and its threshold, e.g. "checkout.latency.p95{env=prod} <= 300 ms". The tests that check it are bound in the repository's .radical/radical.json (radical verify), not here.`
1609
1630
  },
1610
1631
  {
1611
1632
  kind: "relations",
@@ -1867,7 +1888,7 @@ function builtInGovernanceMetamodel() {
1867
1888
  { key: "when", label: "When", type: "textarea" },
1868
1889
  { key: "then", label: "Then", type: "textarea" },
1869
1890
  { key: "gherkin", label: "Extra steps (And/But, raw Gherkin)", type: "textarea" },
1870
- TESTS_PROPERTY
1891
+ ...METRICS_PROPERTIES
1871
1892
  ];
1872
1893
  const scenario = {
1873
1894
  id: "scenario",
@@ -2469,6 +2490,7 @@ function viewFolderPaths(views) {
2469
2490
  }
2470
2491
  return [...paths].sort((a, b) => a.localeCompare(b, void 0, { numeric: true, sensitivity: "base" }));
2471
2492
  }
2493
+ var CANVAS_MAX_ELEMENTS = 1e3;
2472
2494
  var WIKI_DEPTH_MIN = 1;
2473
2495
  var WIKI_DEPTH_MAX = 5;
2474
2496
  function wikiDepthOf(view) {
@@ -2503,6 +2525,7 @@ function viewCanvasPositions(view, nodes, positions, drawn) {
2503
2525
  if (cur in positions) kept[cur] = positions[cur];
2504
2526
  }
2505
2527
  }
2528
+ for (const id of view.nodeIds) if (!nodes[id] && view.positions && id in view.positions) kept[id] = view.positions[id];
2506
2529
  return kept;
2507
2530
  }
2508
2531
  function withCanvasPositions(views, nodes, drawnOf) {
@@ -2541,6 +2564,11 @@ var ELK_CHILD_SPACING = {
2541
2564
 
2542
2565
  // ../../packages/layout/src/geometry.ts
2543
2566
  init_define_RADICAL_BUILD();
2567
+ var placing = null;
2568
+ function childrenOf(nodes, parentId) {
2569
+ if (placing?.nodes === nodes) return placing.children.get(parentId ?? void 0) ?? [];
2570
+ return Object.values(nodes).filter((n) => (n.parentId ?? void 0) === (parentId ?? void 0));
2571
+ }
2544
2572
  function effectiveWidth(n) {
2545
2573
  if (isContainerType(n.type) && n.collapsed) return COLLAPSED_WIDTH[n.type];
2546
2574
  return n.width ?? NODE_SIZES[n.type].width;
@@ -2583,7 +2611,7 @@ function fittedParentSize(parent, children) {
2583
2611
  }
2584
2612
  function placeNewNode(nodes, parentId) {
2585
2613
  const parent = parentId ? nodes[parentId] : void 0;
2586
- const siblings = Object.values(nodes).filter((n) => (n.parentId ?? void 0) === (parent?.id ?? void 0));
2614
+ const siblings = childrenOf(nodes, parent?.id);
2587
2615
  const right = Math.max(...siblings.map((n) => n.x + effectiveWidth(n)));
2588
2616
  if (!parent) return { x: siblings.length ? right + 80 : 0, y: 0 };
2589
2617
  const pad = compoundPadding(parent.type);
@@ -2591,7 +2619,7 @@ function placeNewNode(nodes, parentId) {
2591
2619
  }
2592
2620
  function placeBesideSiblings(nodes, parentId, counts = () => true) {
2593
2621
  const parent = parentId ? nodes[parentId] : void 0;
2594
- const siblings = Object.values(nodes).filter((s) => (s.parentId ?? void 0) === (parent?.id ?? void 0) && counts(s));
2622
+ const siblings = childrenOf(nodes, parent?.id).filter((s) => counts(s));
2595
2623
  if (siblings.length === 0) {
2596
2624
  const pad = parent ? compoundPadding(parent.type) : { top: 0, side: 0 };
2597
2625
  return { x: pad.side, y: pad.top };
@@ -2611,7 +2639,7 @@ var GRID_GAP = 60;
2611
2639
  function gridSlotIn(nodes, parentId, size, counts = () => true, frame) {
2612
2640
  const parent = nodes[parentId];
2613
2641
  const pad = compoundPadding(parent?.type ?? "system");
2614
- const kids = Object.values(nodes).filter((c) => c.parentId === parentId && counts(c));
2642
+ const kids = childrenOf(nodes, parentId).filter((c) => counts(c));
2615
2643
  if (!kids.length) return centredIn(frame ?? { width: parent?.width ?? 0, height: parent?.height ?? 0 }, size, pad);
2616
2644
  const cellW = Math.max(size.width, ...kids.map(effectiveWidth));
2617
2645
  const cellH = Math.max(size.height, ...kids.map(effectiveHeight));
@@ -2642,12 +2670,12 @@ function liesClearInParent(node, nodes, canvas, ignore = () => false) {
2642
2670
  const frame = canvas.boxOf(parent);
2643
2671
  if (box.x < 0 || box.y < 0 || box.x + box.w > frame.w || box.y + box.h > frame.h) return false;
2644
2672
  }
2645
- return !Object.values(nodes).some((s) => s.id !== node.id && (s.parentId ?? void 0) === (node.parentId ?? void 0) && canvas.shown(s) && !ignore(s) && drawnBoxesOf(s, nodes, canvas, (c) => c.id !== node.id && !ignore(c)).some((b) => boxesOverlap(box, b)));
2673
+ return !childrenOf(nodes, node.parentId).some((s) => s.id !== node.id && canvas.shown(s) && !ignore(s) && drawnBoxesOf(s, nodes, canvas, (c) => c.id !== node.id && !ignore(c)).some((b) => boxesOverlap(box, b)));
2646
2674
  }
2647
2675
  function drawnBoxesOf(node, nodes, canvas, keep = () => true) {
2648
2676
  const box = canvas.boxOf(node);
2649
2677
  if (!canvas.frame?.(node)) return [box];
2650
- return Object.values(nodes).filter((c) => c.parentId === node.id && canvas.shown(c) && keep(c)).flatMap((c) => drawnBoxesOf(c, nodes, canvas, keep).map((b) => ({ ...b, x: b.x + box.x, y: b.y + box.y })));
2678
+ return childrenOf(nodes, node.id).filter((c) => canvas.shown(c) && keep(c)).flatMap((c) => drawnBoxesOf(c, nodes, canvas, keep).map((b) => ({ ...b, x: b.x + box.x, y: b.y + box.y })));
2651
2679
  }
2652
2680
  function settleMovedNodes(nodes, ids, canvas, fit = (parentId) => fitShown(nodes, parentId, canvas), opened) {
2653
2681
  const touched = [];
@@ -2707,7 +2735,7 @@ var CHILD_TOP_MIN = 50;
2707
2735
  function growFrameLeftUp(nodes, parentId, shown = () => true) {
2708
2736
  const parent = nodes[parentId];
2709
2737
  if (!parent) return;
2710
- const kids = Object.values(nodes).filter((c) => c.parentId === parentId && shown(c));
2738
+ const kids = childrenOf(nodes, parentId).filter((c) => shown(c));
2711
2739
  if (!kids.length) return;
2712
2740
  const pad = compoundPadding(parent.type);
2713
2741
  const minX = Math.min(...kids.map((c) => c.x));
@@ -2725,7 +2753,7 @@ function growFrameLeftUp(nodes, parentId, shown = () => true) {
2725
2753
  function fitShown(nodes, parentId, canvas) {
2726
2754
  const parent = nodes[parentId];
2727
2755
  if (!parent || !isContainerType(parent.type) || parent.collapsed) return;
2728
- const children = Object.values(nodes).filter((c) => c.parentId === parentId && canvas.shown(c));
2756
+ const children = childrenOf(nodes, parentId).filter((c) => canvas.shown(c));
2729
2757
  if (!children.length) return;
2730
2758
  const size = fittedParentSize(parent, children.map((c) => ({ x: c.x, y: c.y, width: effectiveWidth(c), height: effectiveHeight(c) })));
2731
2759
  parent.width = size.width;
@@ -2737,7 +2765,7 @@ function makeRoomAround(grownId, nodes, canvas) {
2737
2765
  const grown = nodes[grownId];
2738
2766
  if (!grown) return {};
2739
2767
  const { shown, boxOf } = canvas;
2740
- const siblings = Object.values(nodes).filter((n) => (n.parentId ?? void 0) === (grown.parentId ?? void 0) && shown(n));
2768
+ const siblings = childrenOf(nodes, grown.parentId).filter((n) => shown(n));
2741
2769
  if (siblings.length < 2) return {};
2742
2770
  const box = new Map(siblings.map((n) => [n.id, boxOf(n)]));
2743
2771
  const before = new Map(siblings.map((n) => [n.id, boxOf(n)]));
@@ -3149,6 +3177,10 @@ export {
3149
3177
  composeEarsSentence,
3150
3178
  builtInC4Metamodel,
3151
3179
  RADICAL_METAMODEL_NAME,
3180
+ METRICS_PROPERTIES,
3181
+ FITNESS_CHARACTERISTICS,
3182
+ FITNESS_TRIGGERS,
3183
+ FITNESS_CLASSIFICATION_PROPERTIES,
3152
3184
  builtInGovernanceMetamodel,
3153
3185
  layoutRoleOf,
3154
3186
  relationLayoutHint,
@@ -3170,6 +3202,7 @@ export {
3170
3202
  COLLAPSED_WIDTH,
3171
3203
  normalizeViewFolder,
3172
3204
  viewFolderPaths,
3205
+ CANVAS_MAX_ELEMENTS,
3173
3206
  WIKI_DEPTH_MAX,
3174
3207
  wikiDepthOf,
3175
3208
  holderOf,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  applyElkLayout,
3
3
  applyTreeLayout
4
- } from "./chunk-Z7THA3L5.js";
4
+ } from "./chunk-KEIZXREX.js";
5
5
  export {
6
6
  applyElkLayout,
7
7
  applyTreeLayout