import_arch_diagram
Imports an architecture diagram from Mermaid C4 or PlantUML C4 and materializes it as kind='arch' blocks + arch-* dependencies. Mode 'replace' (default) deletes the whole existing arch slice before import. 'merge' adds the new nodes by name without touching the old ones. Blocks of other kinds (org, entity, ...) are never touched. In Mermaid, subgraphs become trust zones (trustBoundary) and the C4 notation of the labels gives archType + technology. Returns warnings for whatever fell back to a default (unknown C4 notation, nested subgraphs) — empty when there is nothing to report.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | 'replace' (default) deletes all kind='arch' blocks and their arch-* dependencies, then adds the payload. 'merge' keeps the existing arch blocks (by name) and only adds the new ones. | |
| format | Yes | Payload format — same parsers as for the export. A file PRODUCED BY export_arch_diagram and fed back in keeps ids, archTypes and edge subtypes. A hand-written file keeps only what its syntax declares: in Mermaid, the C4 annotation of the label ([Container: Node.js], [ContainerDb: PostgreSQL], [System_Ext]), subgraphs (→ trust zone) and the `class <id> <archType>` directive — otherwise a node falls back to archType 'service'. The exact syntax of a hand-written file is described by get_playbook('arch'). | |
| payload | Yes | Text content of the diagram to import (the whole source file). | |
| expectedProjectId | No | UUID of the project targeted by THIS call. ACTUALLY targets this project instead of the session project. Refused without changing anything if access is not granted. |