umlimator 0.21.0 → 0.22.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/README.md CHANGED
@@ -65,8 +65,8 @@ drill-down, a data pipeline, an AI agent's skills, and host pages for embedding,
65
65
  [what it covers](docs/conformance/uml-communication.md)). Messages are inserted, moved in time, wrapped in a frame and
66
66
  deleted on the canvas, by pointer and by key, each gesture an `edit` event; checked by the types' rules; a sequence
67
67
  diagram is read from and written to Mermaid's `sequenceDiagram`, and an OpenTelemetry trace becomes one
68
- (`umlimator.py trace --diagram uml.sequence`). The MCP server, the `map-repo` skill and the diff Action learn these
69
- types in one package after 0.20.0; until then a reorder of a view's messages shows in a diff as changed, not moved.
68
+ (`umlimator.py trace --diagram uml.sequence`). A diff says "moves" for a reordered message, and `paths()` on a
69
+ sequence view runs in time order (0.22.0).
70
70
  - **UML use case, activity, state machine and interaction overview diagrams** (0.21.0): actors as stick figures, use
71
71
  cases as ellipses with their extension points, a subject as a box holding its use cases, include, extend and
72
72
  generalization ([`examples/shopping-use-cases.json`](examples/shopping-use-cases.json),
@@ -82,6 +82,20 @@ drill-down, a data pipeline, an AI agent's skills, and host pages for embedding,
82
82
  bar or an ellipse. F2 edits a transition's or a flow's label through its parts; a drop changes a node's lane or a
83
83
  state's region. A state machine is read from and written to Mermaid's `stateDiagram`. The MCP server's read tools and
84
84
  the diff Action are tested on all four.
85
+ - **UML component, deployment and composite structure diagrams** (0.22.0): components nested in components and
86
+ packages, ports on their borders, provided and required interfaces as a ball and socket or as a rectangle, assembly
87
+ and delegation connectors (a delegation runs from a box's port inward to the port of what it holds), artifacts and
88
+ their manifestations ([`examples/bookshop-components.json`](examples/bookshop-components.json),
89
+ [what it covers](docs/conformance/uml-component.md)); nodes, devices and execution environments drawn as cubes and
90
+ nested to any depth, artifacts deployed in them or by a «deploy» line, deployment specifications and communication
91
+ paths ([`examples/bookshop-deployment.json`](examples/bookshop-deployment.json),
92
+ [what it covers](docs/conformance/uml-deployment.md)); a class's parts and ports, each part showing its type's ports,
93
+ connectors through parts, open collaborations as dashed ellipses and collaboration uses with their role bindings
94
+ ([`examples/order-service-structure.json`](examples/order-service-structure.json),
95
+ [what it covers](docs/conformance/uml-composite-structure.md)). A port's side is chosen from where its lines go, or
96
+ pinned by a drag or Alt + arrows; `B` turns an interface into a ball and back; a port or a part is added as a row of
97
+ its owner. The MCP server's read tools and the diff Action are tested on all three, and the Bookshop atlas opens them
98
+ from the map's Hosts.
85
99
  - **Export**: any view as a stand-alone SVG or PNG, in the browser or from the CLI; the whole map as one PDF to hand in
86
100
  for a review: a cover with the contents, each view with its legend and tables of its cards, lines and boxes, then the
87
101
  rules (`umlimator.py pdf`).
@@ -104,7 +118,7 @@ drill-down, a data pipeline, an AI agent's skills, and host pages for embedding,
104
118
  npm install umlimator
105
119
  ```
106
120
 
107
- Or from GitHub, at a tag or any commit: `"umlimator": "github:zintaen/umlimator#v0.21.0"`. npm 12 refuses git
121
+ Or from GitHub, at a tag or any commit: `"umlimator": "github:zintaen/umlimator#v0.22.0"`. npm 12 refuses git
108
122
  dependencies unless the project opts in, so that also needs `allow-git=root` in the `.npmrc` next to `package.json`.
109
123
 
110
124
  ## Embed
@@ -150,13 +164,14 @@ function MapView({ model, onSelect }) {
150
164
  or costliest path, `whatIf(model, view, { remove })` what loses its way when cards go down, and
151
165
  `sequenceFromTrace(model, spans, { view, match })` keeps a trace as a numbered view; all three in Node too.
152
166
  - `editable: true` turns on editing gestures ([docs/editing.md](docs/editing.md); `examples/edit.html` is a working host).
153
- - `import { render, apply, history } from 'umlimator/all'` draws diagram types too: a class, object, package, sequence, communication, use case, activity, state machine or interaction overview diagram, whose gestures emit
167
+ - `import { render, apply, history } from 'umlimator/all'` draws diagram types too: a class, object, package, sequence, communication, use case, activity, state machine, interaction overview, component, deployment or composite structure diagram, whose gestures emit
154
168
  `edit` transactions that `apply(model, e.commands)` turns into the next model (`examples/class-editor.html` is a
155
169
  working host). `umlimator` alone draws maps, and a typed view as plain cards with a warning.
156
170
  - `diff(before, after)` returns `after` with each card and line marked added, changed or removed, what changed in words,
157
- and the views that show it; `drift(model, observed)` marks the lines traffic ran on that nobody drew, and the drawn ones
158
- that carried nothing. Both are models to draw, in Node too. `update()` eases into the next model (`examples/timelapse.html`);
159
- the option `ease: false` draws it at once.
171
+ and the views that show it (on a typed diagram, a reordered member or message reads "moves");
172
+ `drift(model, observed)` marks the lines traffic ran on that nobody drew, and the drawn ones that carried nothing. Both
173
+ are models to draw, in Node too. `update()` eases into the next model (`examples/timelapse.html`); the option
174
+ `ease: false` draws it at once.
160
175
  - `mountPage` is the whole standalone viewer that the CLI writes. `render()` can draw its pieces too, each on its own or
161
176
  any mix, inside the map's element; the host keeps its own header:
162
177
 
@@ -229,8 +244,9 @@ A model file that starts with `"$schema": "<path to>/umlimator.schema.json"` (ex
229
244
  gets completion and checks in editors, and `validate(model)` lists its errors and warnings, each with where it is.
230
245
  `"schemaVersion": 2` marks a model that may hold typed elements and typed views (`docs/diagrams/model.md`). A view whose
231
246
  `diagram` is `"uml.class"`, `"uml.object"`, `"uml.package"`, `"uml.sequence"`, `"uml.communication"`, `"uml.use-case"`,
232
- `"uml.activity"`, `"uml.state-machine"` or `"uml.interaction-overview"` is a UML class, object, package, sequence,
233
- communication, use case, activity, state machine or interaction overview diagram, drawn by `umlimator/all` and the CLI; a type not drawn yet shows its
247
+ `"uml.activity"`, `"uml.state-machine"`, `"uml.interaction-overview"`, `"uml.component"`, `"uml.deployment"` or
248
+ `"uml.composite-structure"` is a UML class, object, package, sequence, communication, use case, activity, state machine,
249
+ interaction overview, component, deployment or composite structure diagram, drawn by `umlimator/all` and the CLI; a type not drawn yet shows its
234
250
  nodes as plain cards, with a warning. A model with no `schemaVersion` is a map, as always, and a version newer than the
235
251
  module reads is an error.
236
252
 
@@ -313,6 +329,22 @@ type's note in [`docs/conformance/`](docs/conformance/)), from 0.21.0:
313
329
  | edge, member | `props` | an extend's `extensionPoints` (ids) and `condition`; a flow's `guard` (its `label` is its name); a transition's or internal transition's `trigger`, `guard` and `effect`, drawn `trigger [guard] / effect` |
314
330
  | view | `diagram` | `"uml.use-case"`, `"uml.activity"`, `"uml.state-machine"` or `"uml.interaction-overview"` |
315
331
 
332
+ A component diagram, a deployment diagram and a composite structure diagram (`examples/bookshop-components.json`,
333
+ `bookshop-deployment.json` and `order-service-structure.json`; each type's note in
334
+ [`docs/conformance/`](docs/conformance/)), from 0.22.0:
335
+
336
+ | On | Field | What it does |
337
+ |---|---|---|
338
+ | node, member, edge | `type` | component: `uml.Component` (members `uml.Port`), `uml.Interface`, `uml.Artifact`, `uml.Package`; lines `uml.InterfaceRealization`, `uml.Usage`, `uml.ComponentRealization`, `uml.Connector`, `uml.Dependency`, `uml.Manifestation` |
339
+ | node, edge | `type` | deployment: `uml.Node`, `uml.Device`, `uml.ExecutionEnvironment`, `uml.Artifact`, `uml.DeploymentSpecification`, `uml.Component`; lines `uml.Deployment`, `uml.Manifestation`, `uml.CommunicationPath`, `uml.Dependency` |
340
+ | node, member, edge | `type` | composite structure: the subject (`uml.Class`, `uml.Component` or `uml.Collaboration`) with its parts (`uml.Property`) and ports (`uml.Port`), `uml.Collaboration` (its roles `uml.Property`), `uml.CollaborationUse`; lines `uml.Connector`, `uml.RoleBinding` (its `label` the role) |
341
+ | node | `parent` | a component's component or package; an artifact's target (deployed by nesting); a target's target (any depth); a collaboration use's subject |
342
+ | node, member | `props` | a port's `valueType`; a part's `valueType` (the class or component whose ports it shows, by label), `multiplicity` and `aggregation` (`shared` is dashed); a collaboration use's `collaboration` |
343
+ | edge | `props` | a connector's `kind` (`assembly`, `delegation`); an end through a part, `ends.from.part` or `ends.to.part` (UML's `partWithPort`) |
344
+ | view | `subject` | a composite structure view's class, component or collaboration, listed in `nodeIds` |
345
+ | view | `present` | an interface drawn as a ball (`{ "as": "ball" }`); a port's side (`{ "side": "left" }`); on a part, `{ "ports": { "<port>": { "side": "top" } } }` |
346
+ | view | `diagram` | `"uml.component"`, `"uml.deployment"` or `"uml.composite-structure"` |
347
+
316
348
  ## Command line
317
349
 
318
350
  ```bash
@@ -382,9 +414,9 @@ ffmpeg -f apng -i ride.png -vf "split[a][b];[a]palettegen[p];[b][p]paletteuse" r
382
414
  ffmpeg -f apng -i ride.png -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -pix_fmt yuv420p ride.mp4
383
415
  ```
384
416
 
385
- On pull requests, the diff Action posts what they change in your maps: one comment with the summary and a sketch, and
386
- the pictures as the run's artifact. The comment names the commit it describes, only the run for the pull request's
387
- latest commit writes it, and it says so when the diff fails.
417
+ On pull requests, the diff Action posts what they change in your maps and UML diagrams (every type above): one comment
418
+ with the summary and a sketch, and the pictures as the run's artifact. The comment names the commit it describes, only
419
+ the run for the pull request's latest commit writes it, and it says so when the diff fails.
388
420
 
389
421
  ```yaml
390
422
  on: pull_request
@@ -395,7 +427,7 @@ jobs:
395
427
  runs-on: ubuntu-latest
396
428
  steps:
397
429
  - uses: actions/checkout@v4
398
- - uses: zintaen/umlimator@v0.21.0
430
+ - uses: zintaen/umlimator@v0.22.0
399
431
  with:
400
432
  models: "docs/*.json" # optional: where the models are (default: every .json that is a map model)
401
433
  ```
@@ -413,7 +445,7 @@ claude mcp add umlimator -- python3 /path/to/umlimator.py mcp /path/to/model.jso
413
445
  |---|---|
414
446
  | `list_views()` | the views (id, title, parent, number of cards) and the stories |
415
447
  | `describe_view(view)` | the view in sentences (`describe()`), then each card's id |
416
- | `paths(view, from, to)` | every card and line on a path from one card to another (`paths()`), as Refs for `highlight` |
448
+ | `paths(view, from, to)` | every card and line on a path from one card to another (`paths()`; on a sequence view, in time order), as Refs for `highlight` |
417
449
  | `reach(view, card, backward?, depth?)` | what a card leads to, or what leads to it, with the distance of each (`reach()`) |
418
450
  | `broken_rules()`, `validate()` | each break of the model's `rules` (`rules()`), and its own problems (`validate()`) |
419
451
  | `diff(other_model_path)` | what changed from another model file to this one, in words, and the views that show it (`diff()`) |