@senad-d/drawme 0.1.0 → 0.1.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/CHANGELOG.md +38 -0
- package/README.md +21 -19
- package/SECURITY.md +33 -0
- package/assets/data/SHAPE-INDEX-NOTICE.md +2 -2
- package/assets/references/diagram-types.md +7 -7
- package/assets/references/mermaid-authoring.md +50 -39
- package/assets/references/troubleshooting.md +2 -17
- package/assets/references/xml-authoring.md +4 -4
- package/docs/agent-guide.md +518 -0
- package/example/drawme-how-it-works.drawio +118 -0
- package/example/drawme-installation-guide.drawio +101 -0
- package/example/git-graph-example.drawio +209 -0
- package/package.json +31 -11
- package/src/dom.ts +2 -2
- package/src/drawio.ts +64 -8
- package/src/explain.ts +4 -5
- package/src/index.ts +16 -9
- package/src/png.ts +2 -3
- package/src/shapesearch.ts +6 -8
- package/src/validate.ts +3 -4
- package/src/workflow.ts +9 -6
- package/tsconfig.json +17 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<mxfile host="drawio" version="26.0.9">
|
|
3
|
+
<diagram id="drawme-install" name="Install DrawMe">
|
|
4
|
+
<mxGraphModel dx="1800" dy="1300" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1920" pageHeight="1360" math="0" shadow="0" background="#FFFFFF">
|
|
5
|
+
<root>
|
|
6
|
+
<mxCell id="0" />
|
|
7
|
+
<mxCell id="1" parent="0" />
|
|
8
|
+
<mxCell id="2" value="Install DrawMe for Pi" style="text;html=1;align=left;verticalAlign=middle;fontSize=32;fontStyle=1;fontColor=#17365D;" vertex="1" parent="1">
|
|
9
|
+
<mxGeometry x="40" y="20" width="1000" height="50" as="geometry" />
|
|
10
|
+
</mxCell>
|
|
11
|
+
<mxCell id="3" value="From prerequisites to your first editable .drawio diagram" style="text;html=1;align=left;verticalAlign=middle;fontSize=17;fontColor=#4F6475;" vertex="1" parent="1">
|
|
12
|
+
<mxGeometry x="40" y="70" width="1100" height="40" as="geometry" />
|
|
13
|
+
</mxCell>
|
|
14
|
+
<mxCell id="4" value="QUICK SETUP • 3–5 MINUTES • EDITABLE OUTPUTS" style="rounded=1;arcSize=20;whiteSpace=wrap;html=1;align=center;verticalAlign=middle;fontSize=13;fontStyle=1;fontColor=#2D5E36;fillColor=#D5E8D4;strokeColor=#82B366;strokeWidth=2;" vertex="1" parent="1">
|
|
15
|
+
<mxGeometry x="1370" y="35" width="470" height="50" as="geometry" />
|
|
16
|
+
</mxCell>
|
|
17
|
+
<mxCell id="5" value="1 CHECK THE PREREQUISITES" style="swimlane;horizontal=1;startSize=46;rounded=1;arcSize=8;container=1;pointerEvents=0;html=1;fontSize=17;fontStyle=1;fontColor=#FFFFFF;fillColor=#1F4E78;swimlaneFillColor=#F8FBFF;strokeColor=#6C8EBF;strokeWidth=2;" vertex="1" parent="1">
|
|
18
|
+
<mxGeometry x="40" y="130" width="1800" height="230" as="geometry" />
|
|
19
|
+
</mxCell>
|
|
20
|
+
<mxCell id="6" value="<b><font color="#1F4E78">PI CODING AGENT</font></b><br><br>Pi must already be installed<br><font face="Courier New">pi --version</font>" style="rounded=1;arcSize=10;whiteSpace=wrap;html=1;align=center;verticalAlign=middle;spacing=12;fontSize=14;fontColor=#263746;fillColor=#FFFFFF;strokeColor=#6C8EBF;strokeWidth=2;shadow=1;" vertex="1" parent="5">
|
|
21
|
+
<mxGeometry x="40" y="75" width="500" height="120" as="geometry" />
|
|
22
|
+
</mxCell>
|
|
23
|
+
<mxCell id="7" value="<b><font color="#1F4E78">NODE.JS 22.19+</font></b><br><br>Required by DrawMe<br><font face="Courier New">node --version</font>" style="rounded=1;arcSize=10;whiteSpace=wrap;html=1;align=center;verticalAlign=middle;spacing=12;fontSize=14;fontColor=#263746;fillColor=#FFFFFF;strokeColor=#6C8EBF;strokeWidth=2;shadow=1;" vertex="1" parent="5">
|
|
24
|
+
<mxGeometry x="650" y="75" width="500" height="120" as="geometry" />
|
|
25
|
+
</mxCell>
|
|
26
|
+
<mxCell id="8" value="<b><font color="#1F4E78">DRAW.IO DESKTOP</font></b><br><br>macOS: <font face="Courier New">brew install --cask drawio</font><br>Linux / Windows: install the official desktop release" style="rounded=1;arcSize=10;whiteSpace=wrap;html=1;align=center;verticalAlign=middle;spacing=12;fontSize=14;fontColor=#263746;fillColor=#FFFFFF;strokeColor=#6C8EBF;strokeWidth=2;shadow=1;" vertex="1" parent="5">
|
|
27
|
+
<mxGeometry x="1260" y="75" width="500" height="120" as="geometry" />
|
|
28
|
+
</mxCell>
|
|
29
|
+
<mxCell id="9" value="↓" style="text;html=1;align=center;verticalAlign=middle;fontSize=24;fontStyle=1;fontColor=#1F4E78;" vertex="1" parent="1">
|
|
30
|
+
<mxGeometry x="880" y="360" width="120" height="30" as="geometry" />
|
|
31
|
+
</mxCell>
|
|
32
|
+
<mxCell id="10" value="2 INSTALL DRAWME — CHOOSE ONE SCOPE" style="swimlane;horizontal=1;startSize=46;rounded=1;arcSize=8;container=1;pointerEvents=0;html=1;fontSize=17;fontStyle=1;fontColor=#FFFFFF;fillColor=#1F4E78;swimlaneFillColor=#F8FBFF;strokeColor=#6C8EBF;strokeWidth=2;" vertex="1" parent="1">
|
|
33
|
+
<mxGeometry x="40" y="390" width="1800" height="360" as="geometry" />
|
|
34
|
+
</mxCell>
|
|
35
|
+
<mxCell id="11" value="Choose scope" style="rhombus;whiteSpace=wrap;html=1;align=center;verticalAlign=middle;fontSize=16;fontStyle=1;fontColor=#6B5500;fillColor=#FFF2CC;strokeColor=#D6B656;strokeWidth=2;" vertex="1" parent="10">
|
|
36
|
+
<mxGeometry x="760" y="60" width="280" height="90" as="geometry" />
|
|
37
|
+
</mxCell>
|
|
38
|
+
<mxCell id="12" value="<b><font color="#1F4E78">GLOBAL · RECOMMENDED</font></b><br><br>Available in every project<br><font face="Courier New">pi install npm:@senad-d/drawme</font>" style="rounded=1;arcSize=10;whiteSpace=wrap;html=1;align=center;verticalAlign=middle;spacing=12;fontSize=14;fontColor=#263746;fillColor=#EAF2F8;strokeColor=#1F4E78;strokeWidth=3;shadow=1;" vertex="1" parent="10">
|
|
39
|
+
<mxGeometry x="70" y="180" width="500" height="115" as="geometry" />
|
|
40
|
+
</mxCell>
|
|
41
|
+
<mxCell id="13" value="<b><font color="#1F4E78">PROJECT-LOCAL · TEAM</font></b><br><br>Saved in .pi/settings.json<br><font face="Courier New">pi install npm:@senad-d/drawme -l</font>" style="rounded=1;arcSize=10;whiteSpace=wrap;html=1;align=center;verticalAlign=middle;spacing=12;fontSize=14;fontColor=#263746;fillColor=#FFFFFF;strokeColor=#6C8EBF;strokeWidth=2;shadow=1;" vertex="1" parent="10">
|
|
42
|
+
<mxGeometry x="650" y="180" width="500" height="115" as="geometry" />
|
|
43
|
+
</mxCell>
|
|
44
|
+
<mxCell id="14" value="<b><font color="#1F4E78">ONE-TIME TRIAL</font></b><br><br>Temporary for the current run<br><font face="Courier New">pi -e npm:@senad-d/drawme</font>" style="rounded=1;arcSize=10;whiteSpace=wrap;html=1;align=center;verticalAlign=middle;spacing=12;fontSize=14;fontColor=#263746;fillColor=#FFFFFF;strokeColor=#6C8EBF;strokeWidth=2;shadow=1;" vertex="1" parent="10">
|
|
45
|
+
<mxGeometry x="1230" y="180" width="500" height="115" as="geometry" />
|
|
46
|
+
</mxCell>
|
|
47
|
+
<mxCell id="15" value="Source checkout: <font face="Courier New">cd /path/to/DrawMe && pi --no-extensions -e .</font>" style="rounded=1;arcSize=10;whiteSpace=wrap;html=1;align=center;verticalAlign=middle;fontSize=13;fontColor=#405466;fillColor=#F3F6F8;strokeColor=#AAB7C4;dashed=1;" vertex="1" parent="10">
|
|
48
|
+
<mxGeometry x="300" y="310" width="1200" height="35" as="geometry" />
|
|
49
|
+
</mxCell>
|
|
50
|
+
<mxCell id="16" value="↓" style="text;html=1;align=center;verticalAlign=middle;fontSize=24;fontStyle=1;fontColor=#1F4E78;" vertex="1" parent="1">
|
|
51
|
+
<mxGeometry x="880" y="750" width="120" height="30" as="geometry" />
|
|
52
|
+
</mxCell>
|
|
53
|
+
<mxCell id="17" value="3 LOAD, VERIFY, AND CREATE YOUR FIRST DIAGRAM" style="swimlane;horizontal=1;startSize=46;rounded=1;arcSize=8;container=1;pointerEvents=0;html=1;fontSize=17;fontStyle=1;fontColor=#FFFFFF;fillColor=#1F4E78;swimlaneFillColor=#F8FBFF;strokeColor=#6C8EBF;strokeWidth=2;" vertex="1" parent="1">
|
|
54
|
+
<mxGeometry x="40" y="780" width="1800" height="300" as="geometry" />
|
|
55
|
+
</mxCell>
|
|
56
|
+
<mxCell id="18" value="<b><font color="#1F4E78">LOAD</font></b><br><br>Start or restart Pi<br>Already running? Use <font face="Courier New">/reload</font>" style="rounded=1;arcSize=10;whiteSpace=wrap;html=1;align=center;verticalAlign=middle;spacing=12;fontSize=14;fontColor=#263746;fillColor=#FFFFFF;strokeColor=#6C8EBF;strokeWidth=2;shadow=1;" vertex="1" parent="17">
|
|
57
|
+
<mxGeometry x="60" y="85" width="330" height="150" as="geometry" />
|
|
58
|
+
</mxCell>
|
|
59
|
+
<mxCell id="19" value="<b><font color="#1F4E78">VERIFY</font></b><br><br><font face="Courier New">/drawme-check</font><br>Expect a CLI path and version" style="rounded=1;arcSize=10;whiteSpace=wrap;html=1;align=center;verticalAlign=middle;spacing=12;fontSize=14;fontColor=#263746;fillColor=#FFFFFF;strokeColor=#6C8EBF;strokeWidth=2;shadow=1;" vertex="1" parent="17">
|
|
60
|
+
<mxGeometry x="500" y="85" width="330" height="150" as="geometry" />
|
|
61
|
+
</mxCell>
|
|
62
|
+
<mxCell id="20" value="<b><font color="#1F4E78">CREATE</font></b><br><br><font face="Courier New">/drawme Create a login flow</font><br>Describe any diagram in plain language" style="rounded=1;arcSize=10;whiteSpace=wrap;html=1;align=center;verticalAlign=middle;spacing=12;fontSize=14;fontColor=#263746;fillColor=#FFFFFF;strokeColor=#6C8EBF;strokeWidth=2;shadow=1;" vertex="1" parent="17">
|
|
63
|
+
<mxGeometry x="940" y="85" width="330" height="150" as="geometry" />
|
|
64
|
+
</mxCell>
|
|
65
|
+
<mxCell id="21" value="<b><font color="#2D5E36">DONE</font></b><br><br>Receive an editable .drawio source<br>plus PNG by default" style="rounded=1;arcSize=10;whiteSpace=wrap;html=1;align=center;verticalAlign=middle;spacing=12;fontSize=14;fontColor=#263746;fillColor=#EAF4E8;strokeColor=#82B366;strokeWidth=2;shadow=1;" vertex="1" parent="17">
|
|
66
|
+
<mxGeometry x="1380" y="85" width="330" height="150" as="geometry" />
|
|
67
|
+
</mxCell>
|
|
68
|
+
<mxCell id="22" value="TROUBLESHOOTING, TRUST, AND VERSION NOTES" style="swimlane;horizontal=1;startSize=42;rounded=1;arcSize=8;container=1;pointerEvents=0;html=1;fontSize=16;fontStyle=1;fontColor=#FFFFFF;fillColor=#405466;swimlaneFillColor=#F8FAFB;strokeColor=#7E8E9E;strokeWidth=2;" vertex="1" parent="1">
|
|
69
|
+
<mxGeometry x="40" y="1110" width="1800" height="180" as="geometry" />
|
|
70
|
+
</mxCell>
|
|
71
|
+
<mxCell id="23" value="<b>CLI NOT FOUND?</b><br>Install draw.io Desktop, keep its standard install path, then run <font face="Courier New">/drawme-check</font> again. v30+ is needed only for Mermaid and ELK layout." style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;align=left;verticalAlign=middle;spacing=12;fontSize=13;fontColor=#263746;fillColor=#FFFFFF;strokeColor=#AAB7C4;" vertex="1" parent="22">
|
|
72
|
+
<mxGeometry x="30" y="60" width="550" height="95" as="geometry" />
|
|
73
|
+
</mxCell>
|
|
74
|
+
<mxCell id="24" value="<b>EXTENSION NOT VISIBLE?</b><br>Run <font face="Courier New">pi list</font>, check <font face="Courier New">pi config</font>, and use <font face="Courier New">/reload</font>. Project-local packages load only after the project is trusted." style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;align=left;verticalAlign=middle;spacing=12;fontSize=13;fontColor=#263746;fillColor=#FFFFFF;strokeColor=#AAB7C4;" vertex="1" parent="22">
|
|
75
|
+
<mxGeometry x="625" y="60" width="550" height="95" as="geometry" />
|
|
76
|
+
</mxCell>
|
|
77
|
+
<mxCell id="25" value="<b>INSTALL TRUSTED CODE ONLY</b><br>Pi extensions inherit the Pi process permissions, so review sources before installation. DrawMe reads and writes requested diagram files and may launch draw.io or the OS file opener." style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;align=left;verticalAlign=middle;spacing=12;fontSize=13;fontColor=#2D5E36;fillColor=#F3F9F1;strokeColor=#82B366;" vertex="1" parent="22">
|
|
78
|
+
<mxGeometry x="1220" y="60" width="550" height="95" as="geometry" />
|
|
79
|
+
</mxCell>
|
|
80
|
+
<mxCell id="26" value="all projects" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;endArrow=blockThin;endFill=1;strokeColor=#1F4E78;strokeWidth=2;fontSize=11;fontColor=#405466;labelBackgroundColor=#FFFFFF;exitX=0.25;exitY=1;entryX=0.5;entryY=0;" edge="1" parent="1" source="11" target="12">
|
|
81
|
+
<mxGeometry relative="1" as="geometry" />
|
|
82
|
+
</mxCell>
|
|
83
|
+
<mxCell id="27" value="this project" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;endArrow=blockThin;endFill=1;strokeColor=#1F4E78;strokeWidth=2;fontSize=11;fontColor=#405466;labelBackgroundColor=#FFFFFF;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" edge="1" parent="1" source="11" target="13">
|
|
84
|
+
<mxGeometry relative="1" as="geometry" />
|
|
85
|
+
</mxCell>
|
|
86
|
+
<mxCell id="28" value="current run" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;endArrow=blockThin;endFill=1;strokeColor=#1F4E78;strokeWidth=2;fontSize=11;fontColor=#405466;labelBackgroundColor=#FFFFFF;exitX=0.75;exitY=1;entryX=0.5;entryY=0;" edge="1" parent="1" source="11" target="14">
|
|
87
|
+
<mxGeometry relative="1" as="geometry" />
|
|
88
|
+
</mxCell>
|
|
89
|
+
<mxCell id="29" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;endArrow=blockThin;endFill=1;strokeColor=#1F4E78;strokeWidth=2;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" edge="1" parent="1" source="18" target="19">
|
|
90
|
+
<mxGeometry relative="1" as="geometry" />
|
|
91
|
+
</mxCell>
|
|
92
|
+
<mxCell id="30" value="CLI detected" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;endArrow=blockThin;endFill=1;strokeColor=#1F4E78;strokeWidth=2;fontSize=11;fontColor=#405466;labelBackgroundColor=#FFFFFF;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" edge="1" parent="1" source="19" target="20">
|
|
93
|
+
<mxGeometry relative="1" as="geometry" />
|
|
94
|
+
</mxCell>
|
|
95
|
+
<mxCell id="31" value="produces" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;endArrow=blockThin;endFill=1;strokeColor=#2D5E36;strokeWidth=2;fontSize=11;fontColor=#405466;labelBackgroundColor=#FFFFFF;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" edge="1" parent="1" source="20" target="21">
|
|
96
|
+
<mxGeometry relative="1" as="geometry" />
|
|
97
|
+
</mxCell>
|
|
98
|
+
</root>
|
|
99
|
+
</mxGraphModel>
|
|
100
|
+
</diagram>
|
|
101
|
+
</mxfile>
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<mxfile host="drawio" version="26.0.9">
|
|
3
|
+
<diagram id="git-graph-example" name="Git Graph">
|
|
4
|
+
<mxGraphModel dx="1800" dy="920" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1920" pageHeight="940" math="0" shadow="0" background="#FFFFFF">
|
|
5
|
+
<root>
|
|
6
|
+
<mxCell id="0" />
|
|
7
|
+
<mxCell id="1" parent="0" />
|
|
8
|
+
<mxCell id="2" value="Git Graph Example" style="text;html=1;align=left;verticalAlign=middle;fontSize=32;fontStyle=1;fontColor=#172B4D;" vertex="1" parent="1">
|
|
9
|
+
<mxGeometry x="40" y="20" width="900" height="50" as="geometry" />
|
|
10
|
+
</mxCell>
|
|
11
|
+
<mxCell id="3" value="A documentation refresh with focused edits, updated references, and regenerated examples" style="text;html=1;align=left;verticalAlign=middle;fontSize=17;fontColor=#536273;" vertex="1" parent="1">
|
|
12
|
+
<mxGeometry x="40" y="70" width="1250" height="40" as="geometry" />
|
|
13
|
+
</mxCell>
|
|
14
|
+
<mxCell id="4" value="TIME FLOWS LEFT → RIGHT" style="rounded=1;arcSize=20;whiteSpace=wrap;html=1;align=center;verticalAlign=middle;fontSize=13;fontStyle=1;fontColor=#172B4D;fillColor=#F4F1EA;strokeColor=#A8B0BA;strokeWidth=2;" vertex="1" parent="1">
|
|
15
|
+
<mxGeometry x="1450" y="35" width="350" height="50" as="geometry" />
|
|
16
|
+
</mxCell>
|
|
17
|
+
<mxCell id="5" value="" style="rounded=1;arcSize=8;container=1;pointerEvents=0;html=1;fillColor=#FAFAFC;strokeColor=#C7CED6;strokeWidth=2;" vertex="1" parent="1">
|
|
18
|
+
<mxGeometry x="40" y="130" width="1760" height="620" as="geometry" />
|
|
19
|
+
</mxCell>
|
|
20
|
+
<mxCell id="6" value="examples/refresh" style="rounded=1;arcSize=20;whiteSpace=wrap;html=1;align=center;verticalAlign=middle;fontSize=12;fontStyle=1;fontColor=#FFFFFF;fillColor=#E74C3C;strokeColor=#B83227;strokeWidth=2;" vertex="1" parent="5">
|
|
21
|
+
<mxGeometry x="40" y="30" width="180" height="35" as="geometry" />
|
|
22
|
+
</mxCell>
|
|
23
|
+
<mxCell id="7" value="main" style="rounded=1;arcSize=20;whiteSpace=wrap;html=1;align=center;verticalAlign=middle;fontSize=12;fontStyle=1;fontColor=#FFFFFF;fillColor=#172B4D;strokeColor=#0D1A2E;strokeWidth=2;" vertex="1" parent="5">
|
|
24
|
+
<mxGeometry x="40" y="180" width="180" height="35" as="geometry" />
|
|
25
|
+
</mxCell>
|
|
26
|
+
<mxCell id="8" value="docs/cleanup" style="rounded=1;arcSize=20;whiteSpace=wrap;html=1;align=center;verticalAlign=middle;fontSize=12;fontStyle=1;fontColor=#FFFFFF;fillColor=#00A6A6;strokeColor=#007A7A;strokeWidth=2;" vertex="1" parent="5">
|
|
27
|
+
<mxGeometry x="40" y="340" width="180" height="35" as="geometry" />
|
|
28
|
+
</mxCell>
|
|
29
|
+
<mxCell id="9" value="references/tools" style="rounded=1;arcSize=20;whiteSpace=wrap;html=1;align=center;verticalAlign=middle;fontSize=12;fontStyle=1;fontColor=#FFFFFF;fillColor=#8E44AD;strokeColor=#663080;strokeWidth=2;" vertex="1" parent="5">
|
|
30
|
+
<mxGeometry x="40" y="500" width="180" height="35" as="geometry" />
|
|
31
|
+
</mxCell>
|
|
32
|
+
<mxCell id="10" value="" style="edgeStyle=none;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;startArrow=none;strokeColor=#172B4D;strokeWidth=8;" edge="1" parent="5" source="25" target="26">
|
|
33
|
+
<mxGeometry relative="1" as="geometry" />
|
|
34
|
+
</mxCell>
|
|
35
|
+
<mxCell id="11" value="" style="edgeStyle=none;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;startArrow=none;strokeColor=#172B4D;strokeWidth=8;" edge="1" parent="5" source="26" target="27">
|
|
36
|
+
<mxGeometry relative="1" as="geometry" />
|
|
37
|
+
</mxCell>
|
|
38
|
+
<mxCell id="12" value="" style="edgeStyle=none;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;startArrow=none;strokeColor=#172B4D;strokeWidth=8;" edge="1" parent="5" source="27" target="28">
|
|
39
|
+
<mxGeometry relative="1" as="geometry" />
|
|
40
|
+
</mxCell>
|
|
41
|
+
<mxCell id="13" value="" style="edgeStyle=none;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;startArrow=none;strokeColor=#172B4D;strokeWidth=8;" edge="1" parent="5" source="28" target="30">
|
|
42
|
+
<mxGeometry relative="1" as="geometry" />
|
|
43
|
+
</mxCell>
|
|
44
|
+
<mxCell id="14" value="" style="edgeStyle=none;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;startArrow=none;strokeColor=#00A6A6;strokeWidth=8;" edge="1" parent="5" source="26" target="32">
|
|
45
|
+
<mxGeometry relative="1" as="geometry" />
|
|
46
|
+
</mxCell>
|
|
47
|
+
<mxCell id="15" value="" style="edgeStyle=none;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;startArrow=none;strokeColor=#00A6A6;strokeWidth=8;" edge="1" parent="5" source="32" target="33">
|
|
48
|
+
<mxGeometry relative="1" as="geometry" />
|
|
49
|
+
</mxCell>
|
|
50
|
+
<mxCell id="16" value="" style="edgeStyle=none;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;startArrow=none;strokeColor=#00A6A6;strokeWidth=8;" edge="1" parent="5" source="33" target="34">
|
|
51
|
+
<mxGeometry relative="1" as="geometry" />
|
|
52
|
+
</mxCell>
|
|
53
|
+
<mxCell id="17" value="" style="edgeStyle=none;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;startArrow=none;strokeColor=#00A6A6;strokeWidth=8;" edge="1" parent="5" source="34" target="36">
|
|
54
|
+
<mxGeometry relative="1" as="geometry" />
|
|
55
|
+
</mxCell>
|
|
56
|
+
<mxCell id="18" value="" style="edgeStyle=none;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;startArrow=none;strokeColor=#00A6A6;strokeWidth=8;" edge="1" parent="5" source="36" target="30">
|
|
57
|
+
<mxGeometry relative="1" as="geometry" />
|
|
58
|
+
</mxCell>
|
|
59
|
+
<mxCell id="19" value="" style="edgeStyle=none;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;startArrow=none;strokeColor=#8E44AD;strokeWidth=8;" edge="1" parent="5" source="32" target="37">
|
|
60
|
+
<mxGeometry relative="1" as="geometry" />
|
|
61
|
+
</mxCell>
|
|
62
|
+
<mxCell id="20" value="" style="edgeStyle=none;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;startArrow=none;strokeColor=#8E44AD;strokeWidth=8;" edge="1" parent="5" source="37" target="38">
|
|
63
|
+
<mxGeometry relative="1" as="geometry" />
|
|
64
|
+
</mxCell>
|
|
65
|
+
<mxCell id="21" value="" style="edgeStyle=none;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;startArrow=none;strokeColor=#8E44AD;strokeWidth=8;" edge="1" parent="5" source="38" target="39">
|
|
66
|
+
<mxGeometry relative="1" as="geometry" />
|
|
67
|
+
</mxCell>
|
|
68
|
+
<mxCell id="22" value="" style="edgeStyle=none;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;startArrow=none;strokeColor=#8E44AD;strokeWidth=8;" edge="1" parent="5" source="39" target="34">
|
|
69
|
+
<mxGeometry relative="1" as="geometry" />
|
|
70
|
+
</mxCell>
|
|
71
|
+
<mxCell id="23" value="" style="edgeStyle=none;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;startArrow=none;strokeColor=#E74C3C;strokeWidth=8;" edge="1" parent="5" source="27" target="40">
|
|
72
|
+
<mxGeometry relative="1" as="geometry" />
|
|
73
|
+
</mxCell>
|
|
74
|
+
<mxCell id="24" value="" style="edgeStyle=none;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;startArrow=none;strokeColor=#E74C3C;strokeWidth=8;" edge="1" parent="5" source="40" target="28">
|
|
75
|
+
<mxGeometry relative="1" as="geometry" />
|
|
76
|
+
</mxCell>
|
|
77
|
+
<mxCell id="25" value="" style="ellipse;aspect=fixed;html=1;fillColor=#FFFFFF;strokeColor=#172B4D;strokeWidth=5;perimeter=ellipsePerimeter;" vertex="1" parent="5">
|
|
78
|
+
<mxGeometry x="207" y="217" width="26" height="26" as="geometry" />
|
|
79
|
+
</mxCell>
|
|
80
|
+
<mxCell id="26" value="" style="ellipse;aspect=fixed;html=1;fillColor=#FFFFFF;strokeColor=#172B4D;strokeWidth=5;perimeter=ellipsePerimeter;" vertex="1" parent="5">
|
|
81
|
+
<mxGeometry x="427" y="217" width="26" height="26" as="geometry" />
|
|
82
|
+
</mxCell>
|
|
83
|
+
<mxCell id="27" value="" style="ellipse;aspect=fixed;html=1;fillColor=#FFFFFF;strokeColor=#172B4D;strokeWidth=5;perimeter=ellipsePerimeter;" vertex="1" parent="5">
|
|
84
|
+
<mxGeometry x="707" y="217" width="26" height="26" as="geometry" />
|
|
85
|
+
</mxCell>
|
|
86
|
+
<mxCell id="28" value="" style="ellipse;aspect=fixed;html=1;fillColor=#FFFFFF;strokeColor=#172B4D;strokeWidth=5;perimeter=ellipsePerimeter;" vertex="1" parent="5">
|
|
87
|
+
<mxGeometry x="1061" y="211" width="38" height="38" as="geometry" />
|
|
88
|
+
</mxCell>
|
|
89
|
+
<mxCell id="29" value="" style="ellipse;aspect=fixed;html=1;fillColor=#FFFFFF;strokeColor=#172B4D;strokeWidth=3;perimeter=ellipsePerimeter;" vertex="1" parent="28">
|
|
90
|
+
<mxGeometry x="10" y="10" width="18" height="18" as="geometry" />
|
|
91
|
+
</mxCell>
|
|
92
|
+
<mxCell id="30" value="" style="ellipse;aspect=fixed;html=1;fillColor=#FFFFFF;strokeColor=#172B4D;strokeWidth=5;perimeter=ellipsePerimeter;" vertex="1" parent="5">
|
|
93
|
+
<mxGeometry x="1561" y="211" width="38" height="38" as="geometry" />
|
|
94
|
+
</mxCell>
|
|
95
|
+
<mxCell id="31" value="" style="ellipse;aspect=fixed;html=1;fillColor=#FFFFFF;strokeColor=#172B4D;strokeWidth=3;perimeter=ellipsePerimeter;" vertex="1" parent="30">
|
|
96
|
+
<mxGeometry x="10" y="10" width="18" height="18" as="geometry" />
|
|
97
|
+
</mxCell>
|
|
98
|
+
<mxCell id="32" value="" style="ellipse;aspect=fixed;html=1;fillColor=#FFFFFF;strokeColor=#00A6A6;strokeWidth=5;perimeter=ellipsePerimeter;" vertex="1" parent="5">
|
|
99
|
+
<mxGeometry x="587" y="377" width="26" height="26" as="geometry" />
|
|
100
|
+
</mxCell>
|
|
101
|
+
<mxCell id="33" value="" style="ellipse;aspect=fixed;html=1;fillColor=#FFFFFF;strokeColor=#00A6A6;strokeWidth=5;perimeter=ellipsePerimeter;" vertex="1" parent="5">
|
|
102
|
+
<mxGeometry x="767" y="377" width="26" height="26" as="geometry" />
|
|
103
|
+
</mxCell>
|
|
104
|
+
<mxCell id="34" value="" style="ellipse;aspect=fixed;html=1;fillColor=#FFFFFF;strokeColor=#00A6A6;strokeWidth=5;perimeter=ellipsePerimeter;" vertex="1" parent="5">
|
|
105
|
+
<mxGeometry x="1141" y="371" width="38" height="38" as="geometry" />
|
|
106
|
+
</mxCell>
|
|
107
|
+
<mxCell id="35" value="" style="ellipse;aspect=fixed;html=1;fillColor=#FFFFFF;strokeColor=#00A6A6;strokeWidth=3;perimeter=ellipsePerimeter;" vertex="1" parent="34">
|
|
108
|
+
<mxGeometry x="10" y="10" width="18" height="18" as="geometry" />
|
|
109
|
+
</mxCell>
|
|
110
|
+
<mxCell id="36" value="" style="ellipse;aspect=fixed;html=1;fillColor=#FFFFFF;strokeColor=#00A6A6;strokeWidth=5;perimeter=ellipsePerimeter;" vertex="1" parent="5">
|
|
111
|
+
<mxGeometry x="1347" y="377" width="26" height="26" as="geometry" />
|
|
112
|
+
</mxCell>
|
|
113
|
+
<mxCell id="37" value="" style="ellipse;aspect=fixed;html=1;fillColor=#FFFFFF;strokeColor=#8E44AD;strokeWidth=5;perimeter=ellipsePerimeter;" vertex="1" parent="5">
|
|
114
|
+
<mxGeometry x="767" y="537" width="26" height="26" as="geometry" />
|
|
115
|
+
</mxCell>
|
|
116
|
+
<mxCell id="38" value="" style="ellipse;aspect=fixed;html=1;fillColor=#FFFFFF;strokeColor=#8E44AD;strokeWidth=5;perimeter=ellipsePerimeter;" vertex="1" parent="5">
|
|
117
|
+
<mxGeometry x="927" y="537" width="26" height="26" as="geometry" />
|
|
118
|
+
</mxCell>
|
|
119
|
+
<mxCell id="39" value="" style="ellipse;aspect=fixed;html=1;fillColor=#FFFFFF;strokeColor=#8E44AD;strokeWidth=5;perimeter=ellipsePerimeter;" vertex="1" parent="5">
|
|
120
|
+
<mxGeometry x="1067" y="537" width="26" height="26" as="geometry" />
|
|
121
|
+
</mxCell>
|
|
122
|
+
<mxCell id="40" value="" style="ellipse;aspect=fixed;html=1;fillColor=#FFFFFF;strokeColor=#E74C3C;strokeWidth=5;perimeter=ellipsePerimeter;" vertex="1" parent="5">
|
|
123
|
+
<mxGeometry x="887" y="67" width="26" height="26" as="geometry" />
|
|
124
|
+
</mxCell>
|
|
125
|
+
<mxCell id="41" value="<b>a1b2c3</b><br>Baseline docs" style="text;html=1;align=center;verticalAlign=middle;fontSize=12;fontColor=#263746;" vertex="1" parent="5">
|
|
126
|
+
<mxGeometry x="150" y="260" width="140" height="45" as="geometry" />
|
|
127
|
+
</mxCell>
|
|
128
|
+
<mxCell id="42" value="<b>d4e5f6</b><br>Current v0.1.2" style="text;html=1;align=center;verticalAlign=middle;fontSize=12;fontColor=#263746;" vertex="1" parent="5">
|
|
129
|
+
<mxGeometry x="370" y="155" width="140" height="45" as="geometry" />
|
|
130
|
+
</mxCell>
|
|
131
|
+
<mxCell id="43" value="<b>71ac90</b><br>Plan cleanup" style="text;html=1;align=center;verticalAlign=middle;fontSize=12;fontColor=#263746;" vertex="1" parent="5">
|
|
132
|
+
<mxGeometry x="650" y="155" width="140" height="45" as="geometry" />
|
|
133
|
+
</mxCell>
|
|
134
|
+
<mxCell id="44" value="<b>b77c12</b><br>Merge examples" style="text;html=1;align=center;verticalAlign=middle;fontSize=12;fontColor=#263746;" vertex="1" parent="5">
|
|
135
|
+
<mxGeometry x="1000" y="150" width="160" height="45" as="geometry" />
|
|
136
|
+
</mxCell>
|
|
137
|
+
<mxCell id="45" value="<b>c91e44</b><br>Validated docs" style="text;html=1;align=center;verticalAlign=middle;fontSize=12;fontColor=#263746;" vertex="1" parent="5">
|
|
138
|
+
<mxGeometry x="1500" y="150" width="160" height="45" as="geometry" />
|
|
139
|
+
</mxCell>
|
|
140
|
+
<mxCell id="46" value="<b>18ad20</b><br>Refocus README" style="text;html=1;align=center;verticalAlign=middle;fontSize=12;fontColor=#263746;" vertex="1" parent="5">
|
|
141
|
+
<mxGeometry x="530" y="420" width="140" height="45" as="geometry" />
|
|
142
|
+
</mxCell>
|
|
143
|
+
<mxCell id="47" value="<b>42be11</b><br>Update security" style="text;html=1;align=center;verticalAlign=middle;fontSize=12;fontColor=#263746;" vertex="1" parent="5">
|
|
144
|
+
<mxGeometry x="710" y="420" width="140" height="45" as="geometry" />
|
|
145
|
+
</mxCell>
|
|
146
|
+
<mxCell id="48" value="<b>9dd0a8</b><br>Merge references" style="text;html=1;align=center;verticalAlign=middle;fontSize=12;fontColor=#263746;" vertex="1" parent="5">
|
|
147
|
+
<mxGeometry x="1080" y="420" width="160" height="45" as="geometry" />
|
|
148
|
+
</mxCell>
|
|
149
|
+
<mxCell id="49" value="<b>a30f14</b><br>Align metadata" style="text;html=1;align=center;verticalAlign=middle;fontSize=12;fontColor=#263746;" vertex="1" parent="5">
|
|
150
|
+
<mxGeometry x="1290" y="420" width="140" height="45" as="geometry" />
|
|
151
|
+
</mxCell>
|
|
152
|
+
<mxCell id="50" value="<b>33fa80</b><br>Remove old paths" style="text;html=1;align=center;verticalAlign=middle;fontSize=12;fontColor=#263746;" vertex="1" parent="5">
|
|
153
|
+
<mxGeometry x="710" y="570" width="140" height="45" as="geometry" />
|
|
154
|
+
</mxCell>
|
|
155
|
+
<mxCell id="51" value="<b>6cb821</b><br>Use DrawMe tools" style="text;html=1;align=center;verticalAlign=middle;fontSize=12;fontColor=#263746;" vertex="1" parent="5">
|
|
156
|
+
<mxGeometry x="870" y="570" width="140" height="45" as="geometry" />
|
|
157
|
+
</mxCell>
|
|
158
|
+
<mxCell id="52" value="<b>70ee91</b><br>Refresh references" style="text;html=1;align=center;verticalAlign=middle;fontSize=12;fontColor=#263746;" vertex="1" parent="5">
|
|
159
|
+
<mxGeometry x="1010" y="570" width="140" height="45" as="geometry" />
|
|
160
|
+
</mxCell>
|
|
161
|
+
<mxCell id="53" value="<b>f00d42</b><br>Refresh examples" style="text;html=1;align=center;verticalAlign=middle;fontSize=12;fontColor=#263746;" vertex="1" parent="5">
|
|
162
|
+
<mxGeometry x="830" y="100" width="140" height="45" as="geometry" />
|
|
163
|
+
</mxCell>
|
|
164
|
+
<mxCell id="54" value="baseline: v0.1.2" style="rounded=1;arcSize=20;whiteSpace=wrap;html=1;align=center;verticalAlign=middle;fontSize=11;fontStyle=1;fontColor=#2D5E36;fillColor=#D5E8D4;strokeColor=#82B366;" vertex="1" parent="5">
|
|
165
|
+
<mxGeometry x="385" y="100" width="110" height="30" as="geometry" />
|
|
166
|
+
</mxCell>
|
|
167
|
+
<mxCell id="55" value="HEAD → main • docs ready" style="rounded=1;arcSize=20;whiteSpace=wrap;html=1;align=center;verticalAlign=middle;fontSize=11;fontStyle=1;fontColor=#2D5E36;fillColor=#D5E8D4;strokeColor=#82B366;" vertex="1" parent="5">
|
|
168
|
+
<mxGeometry x="1480" y="100" width="200" height="30" as="geometry" />
|
|
169
|
+
</mxCell>
|
|
170
|
+
<mxCell id="56" value="Focused documentation branches reconnect at double-ring merge commits." style="rounded=1;arcSize=10;whiteSpace=wrap;html=1;align=center;verticalAlign=middle;fontSize=13;fontColor=#405466;fillColor=#FFFFFF;strokeColor=#C7CED6;dashed=1;" vertex="1" parent="5">
|
|
171
|
+
<mxGeometry x="1030" y="30" width="570" height="45" as="geometry" />
|
|
172
|
+
</mxCell>
|
|
173
|
+
<mxCell id="57" value="LEGEND" style="rounded=1;arcSize=8;container=1;pointerEvents=0;html=1;verticalAlign=top;align=left;spacingTop=10;spacingLeft=15;fontSize=14;fontStyle=1;fontColor=#172B4D;fillColor=#F7F8FA;strokeColor=#C7CED6;strokeWidth=2;" vertex="1" parent="1">
|
|
174
|
+
<mxGeometry x="40" y="780" width="1760" height="110" as="geometry" />
|
|
175
|
+
</mxCell>
|
|
176
|
+
<mxCell id="58" value="main" style="rounded=1;arcSize=20;whiteSpace=wrap;html=1;align=center;verticalAlign=middle;fontSize=12;fontStyle=1;fontColor=#FFFFFF;fillColor=#172B4D;strokeColor=#0D1A2E;" vertex="1" parent="57">
|
|
177
|
+
<mxGeometry x="80" y="50" width="180" height="35" as="geometry" />
|
|
178
|
+
</mxCell>
|
|
179
|
+
<mxCell id="59" value="docs" style="rounded=1;arcSize=20;whiteSpace=wrap;html=1;align=center;verticalAlign=middle;fontSize=12;fontStyle=1;fontColor=#FFFFFF;fillColor=#00A6A6;strokeColor=#007A7A;" vertex="1" parent="57">
|
|
180
|
+
<mxGeometry x="300" y="50" width="180" height="35" as="geometry" />
|
|
181
|
+
</mxCell>
|
|
182
|
+
<mxCell id="60" value="references" style="rounded=1;arcSize=20;whiteSpace=wrap;html=1;align=center;verticalAlign=middle;fontSize=12;fontStyle=1;fontColor=#FFFFFF;fillColor=#8E44AD;strokeColor=#663080;" vertex="1" parent="57">
|
|
183
|
+
<mxGeometry x="520" y="50" width="180" height="35" as="geometry" />
|
|
184
|
+
</mxCell>
|
|
185
|
+
<mxCell id="61" value="examples" style="rounded=1;arcSize=20;whiteSpace=wrap;html=1;align=center;verticalAlign=middle;fontSize=12;fontStyle=1;fontColor=#FFFFFF;fillColor=#E74C3C;strokeColor=#B83227;" vertex="1" parent="57">
|
|
186
|
+
<mxGeometry x="740" y="50" width="180" height="35" as="geometry" />
|
|
187
|
+
</mxCell>
|
|
188
|
+
<mxCell id="62" value="" style="ellipse;aspect=fixed;html=1;fillColor=#FFFFFF;strokeColor=#172B4D;strokeWidth=5;" vertex="1" parent="57">
|
|
189
|
+
<mxGeometry x="1040" y="54" width="28" height="28" as="geometry" />
|
|
190
|
+
</mxCell>
|
|
191
|
+
<mxCell id="63" value="Commit" style="text;html=1;align=left;verticalAlign=middle;fontSize=13;fontColor=#263746;" vertex="1" parent="57">
|
|
192
|
+
<mxGeometry x="1080" y="50" width="90" height="35" as="geometry" />
|
|
193
|
+
</mxCell>
|
|
194
|
+
<mxCell id="64" value="" style="ellipse;aspect=fixed;html=1;fillColor=#FFFFFF;strokeColor=#172B4D;strokeWidth=5;" vertex="1" parent="57">
|
|
195
|
+
<mxGeometry x="1230" y="48" width="40" height="40" as="geometry" />
|
|
196
|
+
</mxCell>
|
|
197
|
+
<mxCell id="65" value="" style="ellipse;aspect=fixed;html=1;fillColor=#FFFFFF;strokeColor=#172B4D;strokeWidth=3;" vertex="1" parent="64">
|
|
198
|
+
<mxGeometry x="10" y="10" width="20" height="20" as="geometry" />
|
|
199
|
+
</mxCell>
|
|
200
|
+
<mxCell id="66" value="Merge commit" style="text;html=1;align=left;verticalAlign=middle;fontSize=13;fontColor=#263746;" vertex="1" parent="57">
|
|
201
|
+
<mxGeometry x="1285" y="50" width="130" height="35" as="geometry" />
|
|
202
|
+
</mxCell>
|
|
203
|
+
<mxCell id="67" value="Green pills mark the baseline and refreshed main branch." style="text;html=1;align=left;verticalAlign=middle;fontSize=12;fontColor=#667583;fontStyle=2;" vertex="1" parent="57">
|
|
204
|
+
<mxGeometry x="1440" y="45" width="260" height="45" as="geometry" />
|
|
205
|
+
</mxCell>
|
|
206
|
+
</root>
|
|
207
|
+
</mxGraphModel>
|
|
208
|
+
</diagram>
|
|
209
|
+
</mxfile>
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@senad-d/drawme",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Pi extension
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Pi extension for authoring, validating, and exporting editable draw.io diagrams from natural-language descriptions.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"author": "Senad Dizdarević",
|
|
7
|
+
"author": "Senad Dizdarević <112484166+senad-d@users.noreply.github.com>",
|
|
8
8
|
"homepage": "https://github.com/senad-d/DrawMe#readme",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -15,7 +15,13 @@
|
|
|
15
15
|
},
|
|
16
16
|
"keywords": [
|
|
17
17
|
"pi",
|
|
18
|
+
"pi-package",
|
|
18
19
|
"pi-extension",
|
|
20
|
+
"pi-coding-agent",
|
|
21
|
+
"cli",
|
|
22
|
+
"terminal",
|
|
23
|
+
"typescript",
|
|
24
|
+
"coding-agent",
|
|
19
25
|
"drawio",
|
|
20
26
|
"diagram",
|
|
21
27
|
"flowchart",
|
|
@@ -26,16 +32,24 @@
|
|
|
26
32
|
"visualization"
|
|
27
33
|
],
|
|
28
34
|
"engines": {
|
|
29
|
-
"node": ">=22.19"
|
|
35
|
+
"node": ">=22.19.0"
|
|
30
36
|
},
|
|
31
37
|
"pi": {
|
|
32
38
|
"extensions": [
|
|
33
39
|
"./src/index.ts"
|
|
34
|
-
]
|
|
40
|
+
],
|
|
41
|
+
"image": "https://raw.githubusercontent.com/senad-d/DrawMe/main/example/drawme-how-it-works.drawio.png"
|
|
35
42
|
},
|
|
36
43
|
"files": [
|
|
37
|
-
"
|
|
38
|
-
"
|
|
44
|
+
"README.md",
|
|
45
|
+
"LICENSE",
|
|
46
|
+
"SECURITY.md",
|
|
47
|
+
"CHANGELOG.md",
|
|
48
|
+
"docs/**/*.md",
|
|
49
|
+
"assets/**/*",
|
|
50
|
+
"example/**/*.drawio",
|
|
51
|
+
"src/**/*.ts",
|
|
52
|
+
"tsconfig.json"
|
|
39
53
|
],
|
|
40
54
|
"scripts": {
|
|
41
55
|
"typecheck": "tsc --noEmit",
|
|
@@ -43,23 +57,29 @@
|
|
|
43
57
|
"format:check": "node scripts/format-check.mjs",
|
|
44
58
|
"lint": "npm run typecheck && npm run lint:eslint && npm run format:check",
|
|
45
59
|
"check:golden": "node scripts/check-golden.mjs",
|
|
60
|
+
"pack:dry-run": "npm pack --dry-run --json --ignore-scripts",
|
|
61
|
+
"check:pack": "node scripts/check-package-contents.mjs",
|
|
46
62
|
"test": "vitest run",
|
|
47
63
|
"coverage": "vitest run --coverage",
|
|
48
64
|
"test:coverage": "npm run coverage",
|
|
49
|
-
"validate": "npm run check:golden && npm run lint && npm test",
|
|
65
|
+
"validate": "npm run check:golden && npm run lint && npm test && npm run check:pack",
|
|
50
66
|
"dev": "pi --no-extensions -e ."
|
|
51
67
|
},
|
|
52
68
|
"dependencies": {
|
|
53
|
-
"@xmldom/xmldom": "^0.9.8"
|
|
54
|
-
|
|
69
|
+
"@xmldom/xmldom": "^0.9.8"
|
|
70
|
+
},
|
|
71
|
+
"peerDependencies": {
|
|
72
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
73
|
+
"typebox": "*"
|
|
55
74
|
},
|
|
56
75
|
"devDependencies": {
|
|
57
|
-
"@earendil-works/pi-coding-agent": "^0.
|
|
76
|
+
"@earendil-works/pi-coding-agent": "^0.75.3",
|
|
58
77
|
"@eslint/js": "^10.0.1",
|
|
59
78
|
"@types/node": "^26.1.2",
|
|
60
79
|
"@vitest/coverage-v8": "^4.1.10",
|
|
61
80
|
"eslint": "^10.8.0",
|
|
62
81
|
"globals": "^17.8.0",
|
|
82
|
+
"typebox": "1.3.9",
|
|
63
83
|
"typescript": "^5.6.0",
|
|
64
84
|
"typescript-eslint": "^8.10.0",
|
|
65
85
|
"vitest": "^4.1.10"
|
package/src/dom.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Minimal shared helpers over `@xmldom/xmldom` nodes. Typed structurally so the
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* validation and explanation code reads cleanly without fighting xmldom's
|
|
4
|
+
* exported types.
|
|
5
5
|
*/
|
|
6
6
|
export const ELEMENT_NODE = 1;
|
|
7
7
|
export const TEXT_NODE = 3;
|
package/src/drawio.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* draw.io desktop CLI wrapper: binary resolution + export. Encodes the tricky
|
|
3
|
-
* flag knowledge
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* spawns is the draw.io CLI (and, on headless Linux, `xvfb-run`). No network.
|
|
3
|
+
* flag knowledge for preview vs final export, the vision width cap, `-e` PNG
|
|
4
|
+
* IEND repair, page indexing, and headless-Linux handling so callers never
|
|
5
|
+
* hand-build a draw.io command line.
|
|
7
6
|
*/
|
|
8
7
|
import { execFile } from "node:child_process";
|
|
9
|
-
import { existsSync } from "node:fs";
|
|
8
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
10
9
|
import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
11
|
-
import { basename, dirname, extname, join } from "node:path";
|
|
10
|
+
import { basename, dirname, extname, join, resolve } from "node:path";
|
|
12
11
|
import { platform, tmpdir } from "node:os";
|
|
13
12
|
import { repairPng } from "./png";
|
|
14
13
|
|
|
@@ -52,7 +51,7 @@ export interface ExportPlan {
|
|
|
52
51
|
linuxExtra: string[];
|
|
53
52
|
}
|
|
54
53
|
|
|
55
|
-
/** Candidate binary names
|
|
54
|
+
/** Candidate binary names and paths in resolution order. */
|
|
56
55
|
const CANDIDATES = [
|
|
57
56
|
"drawio", // Homebrew cask, jgraph .deb/.rpm, Arch AUR
|
|
58
57
|
"draw.io", // older builds / custom symlinks
|
|
@@ -120,7 +119,7 @@ export function deriveOutput(input: string, format: ExportFormat, embed: boolean
|
|
|
120
119
|
/**
|
|
121
120
|
* Build the full export plan (no side effects) so the argument logic is unit-testable.
|
|
122
121
|
*
|
|
123
|
-
*
|
|
122
|
+
* Export planning rules:
|
|
124
123
|
* - preview → never `-e`, width-capped at 2000px (Claude vision rejects >2576px)
|
|
125
124
|
* - final → `-e` for png/svg/pdf (jpg can't embed), raster scale 2
|
|
126
125
|
* - `--width` and `-s` are never combined; an explicit width/height wins
|
|
@@ -164,9 +163,61 @@ export interface ExportResult {
|
|
|
164
163
|
version?: string;
|
|
165
164
|
/** True if the truncated `-e` PNG IEND chunk was repaired after export. */
|
|
166
165
|
repaired: boolean;
|
|
166
|
+
/** Preview artifacts for this source that were removed after a successful final export. */
|
|
167
|
+
removedPreviews: string[];
|
|
168
|
+
/** Best-effort cleanup failures; the final export itself still succeeded. */
|
|
169
|
+
previewCleanupWarnings: string[];
|
|
167
170
|
command: string;
|
|
168
171
|
}
|
|
169
172
|
|
|
173
|
+
/** Successful preview outputs, grouped by their canonical source path. */
|
|
174
|
+
const previewOutputs = new Map<string, Map<string, string>>();
|
|
175
|
+
|
|
176
|
+
function sourceKey(input: string): string {
|
|
177
|
+
try {
|
|
178
|
+
return realpathSync(input);
|
|
179
|
+
} catch {
|
|
180
|
+
return resolve(input);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function trackPreview(input: string, output: string): void {
|
|
185
|
+
const previews = previewOutputs.get(sourceKey(input)) ?? new Map<string, string>();
|
|
186
|
+
previews.set(resolve(output), output);
|
|
187
|
+
previewOutputs.set(sourceKey(input), previews);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
async function removeTrackedPreviews(
|
|
191
|
+
input: string,
|
|
192
|
+
finalOutput: string,
|
|
193
|
+
): Promise<{ removed: string[]; warnings: string[] }> {
|
|
194
|
+
const key = sourceKey(input);
|
|
195
|
+
const previews = previewOutputs.get(key);
|
|
196
|
+
if (!previews) return { removed: [], warnings: [] };
|
|
197
|
+
|
|
198
|
+
previewOutputs.delete(key);
|
|
199
|
+
const finalPath = resolve(finalOutput);
|
|
200
|
+
const removed: string[] = [];
|
|
201
|
+
const warnings: string[] = [];
|
|
202
|
+
const retry = new Map<string, string>();
|
|
203
|
+
|
|
204
|
+
for (const [path, displayPath] of previews) {
|
|
205
|
+
if (path === finalPath) continue;
|
|
206
|
+
const existed = existsSync(path);
|
|
207
|
+
try {
|
|
208
|
+
await rm(path, { force: true });
|
|
209
|
+
if (existed) removed.push(displayPath);
|
|
210
|
+
} catch (error) {
|
|
211
|
+
retry.set(path, displayPath);
|
|
212
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
213
|
+
warnings.push(`${displayPath}: ${message}`);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
if (retry.size > 0) previewOutputs.set(key, retry);
|
|
218
|
+
return { removed, warnings };
|
|
219
|
+
}
|
|
220
|
+
|
|
170
221
|
function isRootUser(): boolean {
|
|
171
222
|
const getuid = (process as NodeJS.Process & { getuid?: () => number }).getuid;
|
|
172
223
|
return typeof getuid === "function" && getuid() === 0;
|
|
@@ -217,6 +268,9 @@ export async function exportDiagram(opts: ExportOptions): Promise<ExportResult>
|
|
|
217
268
|
}
|
|
218
269
|
|
|
219
270
|
const repaired = plan.embed && plan.format === "png" ? await repairPng(plan.output) : false;
|
|
271
|
+
if (plan.mode === "preview") trackPreview(plan.input, plan.output);
|
|
272
|
+
const cleanup =
|
|
273
|
+
plan.mode === "final" ? await removeTrackedPreviews(plan.input, plan.output) : { removed: [], warnings: [] };
|
|
220
274
|
return {
|
|
221
275
|
output: plan.output,
|
|
222
276
|
format: plan.format,
|
|
@@ -225,6 +279,8 @@ export async function exportDiagram(opts: ExportOptions): Promise<ExportResult>
|
|
|
225
279
|
binary: info.binary,
|
|
226
280
|
version: info.version,
|
|
227
281
|
repaired,
|
|
282
|
+
removedPreviews: cleanup.removed,
|
|
283
|
+
previewCleanupWarnings: cleanup.warnings,
|
|
228
284
|
command,
|
|
229
285
|
};
|
|
230
286
|
}
|
package/src/explain.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Describe a `.drawio` as structured Markdown
|
|
3
|
-
*
|
|
4
|
-
* (
|
|
5
|
-
*
|
|
6
|
-
* Handy for a README/PR summary or a text-only read-back. Local-only, no network.
|
|
2
|
+
* Describe a `.drawio` as structured Markdown. The inverse of authoring: it
|
|
3
|
+
* lists components (grouped by container/swimlane/tier), the relations between
|
|
4
|
+
* them (edge labels become the relation verb), and a per-page breakdown for
|
|
5
|
+
* multi-page files. Handy for a README/PR summary or a text-only read-back.
|
|
7
6
|
*/
|
|
8
7
|
import { readFile } from "node:fs/promises";
|
|
9
8
|
import { basename } from "node:path";
|