@radicaltools/mcp 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
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 `.
|
|
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 `.
|
|
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 `.
|
|
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 `.
|
|
75
|
-
- **Taking turns.** After each write the server marks the folder as being written by an agent in `.
|
|
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.
|
|
34
|
+
define_RADICAL_BUILD_default = { version: "0.3.3", commit: "b56a895", date: "2026-11-03", 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);
|
|
@@ -1466,7 +1466,7 @@ function builtInDddC4Metamodel() {
|
|
|
1466
1466
|
// ../../packages/common/src/metamodel/presets/governance.ts
|
|
1467
1467
|
var RADICAL_METAMODEL_NAME = "Radical";
|
|
1468
1468
|
var METRICS_PROPERTIES = [
|
|
1469
|
-
{ key: "metrics", label: "Metrics (one per line:
|
|
1469
|
+
{ key: "metrics", label: "Metrics (one per line: metric{labels} <= value unit; tests are bound in .radical/radical.json)", type: "textarea" },
|
|
1470
1470
|
{ key: "combine", label: "Combine (all, any, at least N)", type: "text" },
|
|
1471
1471
|
{ key: "max_age", label: "Max age of a measurement (e.g. 7d)", type: "text" }
|
|
1472
1472
|
];
|
|
@@ -1626,7 +1626,7 @@ function builtInGovernanceMetamodel() {
|
|
|
1626
1626
|
kind: "fields",
|
|
1627
1627
|
title: "Success criteria",
|
|
1628
1628
|
fields: ["metrics"],
|
|
1629
|
-
help:
|
|
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.`
|
|
1630
1630
|
},
|
|
1631
1631
|
{
|
|
1632
1632
|
kind: "relations",
|
|
@@ -2525,6 +2525,7 @@ function viewCanvasPositions(view, nodes, positions, drawn) {
|
|
|
2525
2525
|
if (cur in positions) kept[cur] = positions[cur];
|
|
2526
2526
|
}
|
|
2527
2527
|
}
|
|
2528
|
+
for (const id of view.nodeIds) if (!nodes[id] && view.positions && id in view.positions) kept[id] = view.positions[id];
|
|
2528
2529
|
return kept;
|
|
2529
2530
|
}
|
|
2530
2531
|
function withCanvasPositions(views, nodes, drawnOf) {
|