@casys/mcp-sysml-toolkit 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +74 -2
- package/mcp-sysml-toolkit.mjs +58570 -0
- package/package.json +10 -4
- package/ui-dist/architecture-tree/index.html +541 -0
- package/ui-dist/impact-graph/index.html +541 -0
- package/ui-dist/sysml-verdict/index.html +541 -0
- package/ui-dist/z3-constraints/index.html +541 -0
package/package.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@casys/mcp-sysml-toolkit",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
}
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Casys MCP server: deterministic SysML v2 compiler, Z3 constraint verifier, parameter evaluator, and change-impact engine wrapping sysml-toolkit with @mcpview Code Mode snippets and 4 native widgets",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": { "mcp-sysml-toolkit": "mcp-sysml-toolkit.mjs" },
|
|
7
|
+
"files": ["mcp-sysml-toolkit.mjs","LICENSE","README.md","ui-dist/architecture-tree/index.html","ui-dist/impact-graph/index.html","ui-dist/sysml-verdict/index.html","ui-dist/z3-constraints/index.html"],
|
|
8
|
+
"engines": { "node": ">=20.0.0" },
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": { "type": "git", "url": "git+https://github.com/superWorldSavior/mcp-sysml-toolkit.git" },
|
|
11
|
+
"keywords": ["mcp", "model-context-protocol", "casys", "mcpview", "sysml", "sysmlv2", "z3", "mbse"]
|
|
12
|
+
}
|
|
@@ -0,0 +1,541 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<title>SysML Architecture tree</title>
|
|
7
|
+
<style>
|
|
8
|
+
:root {
|
|
9
|
+
--bg: #ffffff;
|
|
10
|
+
--surface: #f8fafc;
|
|
11
|
+
--surface-2: #f1f5f9;
|
|
12
|
+
--border: #dbe3ea;
|
|
13
|
+
--grid: #e8eef3;
|
|
14
|
+
--text: #0f172a;
|
|
15
|
+
--muted: #64748b;
|
|
16
|
+
--accent: #0d7c8a;
|
|
17
|
+
--accent-soft: rgba(13, 124, 138, 0.12);
|
|
18
|
+
--ok: #059669;
|
|
19
|
+
--ok-bg: rgba(5, 150, 105, 0.13);
|
|
20
|
+
--fail: #dc2626;
|
|
21
|
+
--fail-bg: rgba(220, 38, 38, 0.13);
|
|
22
|
+
--warn: #d97706;
|
|
23
|
+
--warn-bg: rgba(217, 119, 6, 0.14);
|
|
24
|
+
--info: #2563eb;
|
|
25
|
+
--info-bg: rgba(37, 99, 235, 0.12);
|
|
26
|
+
--domain: #7c3aed;
|
|
27
|
+
--domain-bg: rgba(124, 58, 237, 0.12);
|
|
28
|
+
--block-bg: #ffffff;
|
|
29
|
+
--block-hdr: #eef6f7;
|
|
30
|
+
--block-border: #94b2bc;
|
|
31
|
+
--font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
32
|
+
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:root[data-theme="dark"] {
|
|
36
|
+
--bg: #0f172a;
|
|
37
|
+
--surface: #172033;
|
|
38
|
+
--surface-2: #0b1220;
|
|
39
|
+
--border: #2a3950;
|
|
40
|
+
--grid: #1c2940;
|
|
41
|
+
--text: #f1f5f9;
|
|
42
|
+
--muted: #94a3b8;
|
|
43
|
+
--accent: #38bdf8;
|
|
44
|
+
--accent-soft: rgba(56, 189, 248, 0.16);
|
|
45
|
+
--ok: #34d399;
|
|
46
|
+
--ok-bg: rgba(52, 211, 153, 0.16);
|
|
47
|
+
--fail: #f87171;
|
|
48
|
+
--fail-bg: rgba(248, 113, 113, 0.17);
|
|
49
|
+
--warn: #fbbf24;
|
|
50
|
+
--warn-bg: rgba(251, 191, 36, 0.17);
|
|
51
|
+
--info: #60a5fa;
|
|
52
|
+
--info-bg: rgba(96, 165, 250, 0.16);
|
|
53
|
+
--domain: #c084fc;
|
|
54
|
+
--domain-bg: rgba(192, 132, 252, 0.16);
|
|
55
|
+
--block-bg: #141e30;
|
|
56
|
+
--block-hdr: #1a2d42;
|
|
57
|
+
--block-border: #3d5673;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
* {
|
|
61
|
+
box-sizing: border-box;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
html,
|
|
65
|
+
body {
|
|
66
|
+
margin: 0;
|
|
67
|
+
padding: 0;
|
|
68
|
+
background: var(--bg);
|
|
69
|
+
color: var(--text);
|
|
70
|
+
font-family: var(--font-sans);
|
|
71
|
+
font-size: 13px;
|
|
72
|
+
line-height: 1.4;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.sysml-shell {
|
|
76
|
+
padding: 12px;
|
|
77
|
+
display: flex;
|
|
78
|
+
flex-direction: column;
|
|
79
|
+
gap: 10px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.sysml-header {
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: flex-start;
|
|
85
|
+
justify-content: space-between;
|
|
86
|
+
gap: 8px;
|
|
87
|
+
flex-wrap: wrap;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.sysml-title {
|
|
91
|
+
font-weight: 650;
|
|
92
|
+
font-size: 14px;
|
|
93
|
+
margin: 0;
|
|
94
|
+
display: flex;
|
|
95
|
+
align-items: center;
|
|
96
|
+
gap: 6px;
|
|
97
|
+
flex-wrap: wrap;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.sysml-sub {
|
|
101
|
+
font-size: 11px;
|
|
102
|
+
color: var(--muted);
|
|
103
|
+
font-family: var(--font-mono);
|
|
104
|
+
margin-top: 2px;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.pills {
|
|
108
|
+
display: flex;
|
|
109
|
+
gap: 5px;
|
|
110
|
+
flex-wrap: wrap;
|
|
111
|
+
align-items: center;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.pill {
|
|
115
|
+
display: inline-flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
gap: 4px;
|
|
118
|
+
padding: 2px 7px;
|
|
119
|
+
border-radius: 999px;
|
|
120
|
+
font-size: 11px;
|
|
121
|
+
font-weight: 600;
|
|
122
|
+
background: var(--accent-soft);
|
|
123
|
+
color: var(--accent);
|
|
124
|
+
white-space: nowrap;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.pill--ok {
|
|
128
|
+
background: var(--ok-bg);
|
|
129
|
+
color: var(--ok);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.pill--fail {
|
|
133
|
+
background: var(--fail-bg);
|
|
134
|
+
color: var(--fail);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.pill--warn {
|
|
138
|
+
background: var(--warn-bg);
|
|
139
|
+
color: var(--warn);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.pill--info {
|
|
143
|
+
background: var(--info-bg);
|
|
144
|
+
color: var(--info);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.pill--domain {
|
|
148
|
+
background: var(--domain-bg);
|
|
149
|
+
color: var(--domain);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.pill--muted {
|
|
153
|
+
background: var(--surface-2);
|
|
154
|
+
color: var(--muted);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.pill--mono {
|
|
158
|
+
font-family: var(--font-mono);
|
|
159
|
+
font-weight: 500;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.kind-tag {
|
|
163
|
+
display: inline-flex;
|
|
164
|
+
align-items: center;
|
|
165
|
+
padding: 1px 5px;
|
|
166
|
+
border-radius: 4px;
|
|
167
|
+
font-size: 10px;
|
|
168
|
+
font-weight: 700;
|
|
169
|
+
letter-spacing: 0.03em;
|
|
170
|
+
font-family: var(--font-mono);
|
|
171
|
+
border: 1px solid var(--border);
|
|
172
|
+
background: var(--surface);
|
|
173
|
+
color: var(--muted);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.kind-tag--part {
|
|
177
|
+
border-color: var(--accent);
|
|
178
|
+
color: var(--accent);
|
|
179
|
+
background: var(--accent-soft);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.kind-tag--req {
|
|
183
|
+
border-color: var(--domain);
|
|
184
|
+
color: var(--domain);
|
|
185
|
+
background: var(--domain-bg);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.verdict-banner {
|
|
189
|
+
display: flex;
|
|
190
|
+
align-items: center;
|
|
191
|
+
justify-content: space-between;
|
|
192
|
+
gap: 10px;
|
|
193
|
+
flex-wrap: wrap;
|
|
194
|
+
padding: 10px 12px;
|
|
195
|
+
border-radius: 8px;
|
|
196
|
+
border: 1px solid var(--border);
|
|
197
|
+
background: var(--surface);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.verdict-banner--valid {
|
|
201
|
+
border-color: var(--ok);
|
|
202
|
+
background: var(--ok-bg);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.verdict-banner--invalid {
|
|
206
|
+
border-color: var(--fail);
|
|
207
|
+
background: var(--fail-bg);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.verdict-banner--unavailable {
|
|
211
|
+
border-color: var(--warn);
|
|
212
|
+
background: var(--warn-bg);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.verdict-status {
|
|
216
|
+
font-size: 15px;
|
|
217
|
+
font-weight: 750;
|
|
218
|
+
letter-spacing: 0.04em;
|
|
219
|
+
font-family: var(--font-mono);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.kpi-grid {
|
|
223
|
+
display: grid;
|
|
224
|
+
grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
|
|
225
|
+
gap: 8px;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.kpi-card {
|
|
229
|
+
background: var(--surface);
|
|
230
|
+
border: 1px solid var(--border);
|
|
231
|
+
border-radius: 8px;
|
|
232
|
+
padding: 8px 10px;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.kpi-label {
|
|
236
|
+
font-size: 11px;
|
|
237
|
+
color: var(--muted);
|
|
238
|
+
margin-bottom: 2px;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.kpi-val {
|
|
242
|
+
font-size: 18px;
|
|
243
|
+
font-weight: 700;
|
|
244
|
+
font-family: var(--font-mono);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.kpi-val--ok {
|
|
248
|
+
color: var(--ok);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.kpi-val--fail {
|
|
252
|
+
color: var(--fail);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.kpi-val--warn {
|
|
256
|
+
color: var(--warn);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.bar-track {
|
|
260
|
+
height: 8px;
|
|
261
|
+
border-radius: 999px;
|
|
262
|
+
background: var(--surface-2);
|
|
263
|
+
overflow: hidden;
|
|
264
|
+
display: flex;
|
|
265
|
+
border: 1px solid var(--border);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.bar-seg--ok {
|
|
269
|
+
background: var(--ok);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.bar-seg--fail {
|
|
273
|
+
background: var(--fail);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.bar-seg--warn {
|
|
277
|
+
background: var(--warn);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.toolbar {
|
|
281
|
+
display: flex;
|
|
282
|
+
align-items: center;
|
|
283
|
+
justify-content: space-between;
|
|
284
|
+
gap: 8px;
|
|
285
|
+
flex-wrap: wrap;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.toolbar-group {
|
|
289
|
+
display: flex;
|
|
290
|
+
align-items: center;
|
|
291
|
+
gap: 5px;
|
|
292
|
+
flex-wrap: wrap;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.btn {
|
|
296
|
+
appearance: none;
|
|
297
|
+
background: var(--surface);
|
|
298
|
+
color: var(--text);
|
|
299
|
+
border: 1px solid var(--border);
|
|
300
|
+
border-radius: 6px;
|
|
301
|
+
padding: 4px 8px;
|
|
302
|
+
font-size: 11px;
|
|
303
|
+
font-weight: 600;
|
|
304
|
+
font-family: var(--font-sans);
|
|
305
|
+
cursor: pointer;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.btn:hover {
|
|
309
|
+
border-color: var(--accent);
|
|
310
|
+
color: var(--accent);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.btn--active {
|
|
314
|
+
background: var(--accent-soft);
|
|
315
|
+
border-color: var(--accent);
|
|
316
|
+
color: var(--accent);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.search-input {
|
|
320
|
+
background: var(--surface);
|
|
321
|
+
color: var(--text);
|
|
322
|
+
border: 1px solid var(--border);
|
|
323
|
+
border-radius: 6px;
|
|
324
|
+
padding: 4px 8px;
|
|
325
|
+
font-size: 12px;
|
|
326
|
+
min-width: 150px;
|
|
327
|
+
outline: none;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.search-input:focus {
|
|
331
|
+
border-color: var(--accent);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.diagram-wrap {
|
|
335
|
+
background-color: var(--surface);
|
|
336
|
+
background-image:
|
|
337
|
+
linear-gradient(var(--grid) 1px, transparent 1px),
|
|
338
|
+
linear-gradient(90deg, var(--grid) 1px, transparent 1px);
|
|
339
|
+
background-size: 20px 20px;
|
|
340
|
+
border: 1px solid var(--border);
|
|
341
|
+
border-radius: 8px;
|
|
342
|
+
overflow: auto;
|
|
343
|
+
padding: 8px;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
svg.sysml-svg {
|
|
347
|
+
display: block;
|
|
348
|
+
max-width: none;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.detail-card {
|
|
352
|
+
background: var(--surface);
|
|
353
|
+
border: 1px solid var(--border);
|
|
354
|
+
border-radius: 8px;
|
|
355
|
+
padding: 10px 12px;
|
|
356
|
+
display: flex;
|
|
357
|
+
flex-direction: column;
|
|
358
|
+
gap: 8px;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.detail-title {
|
|
362
|
+
font-weight: 650;
|
|
363
|
+
font-size: 13px;
|
|
364
|
+
display: flex;
|
|
365
|
+
align-items: center;
|
|
366
|
+
justify-content: space-between;
|
|
367
|
+
gap: 8px;
|
|
368
|
+
flex-wrap: wrap;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.detail-grid {
|
|
372
|
+
display: grid;
|
|
373
|
+
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
|
|
374
|
+
gap: 6px;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.kv {
|
|
378
|
+
background: var(--surface-2);
|
|
379
|
+
border: 1px solid var(--border);
|
|
380
|
+
border-radius: 6px;
|
|
381
|
+
padding: 5px 7px;
|
|
382
|
+
display: flex;
|
|
383
|
+
flex-direction: column;
|
|
384
|
+
gap: 2px;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.kv-k {
|
|
388
|
+
font-size: 10px;
|
|
389
|
+
color: var(--muted);
|
|
390
|
+
font-family: var(--font-mono);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
.kv-v {
|
|
394
|
+
font-size: 12px;
|
|
395
|
+
font-weight: 650;
|
|
396
|
+
font-family: var(--font-mono);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.table-wrap {
|
|
400
|
+
overflow-x: auto;
|
|
401
|
+
border: 1px solid var(--border);
|
|
402
|
+
border-radius: 8px;
|
|
403
|
+
background: var(--bg);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
table.sysml-table {
|
|
407
|
+
width: 100%;
|
|
408
|
+
border-collapse: collapse;
|
|
409
|
+
font-size: 12px;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
table.sysml-table th,
|
|
413
|
+
table.sysml-table td {
|
|
414
|
+
padding: 6px 8px;
|
|
415
|
+
border-bottom: 1px solid var(--border);
|
|
416
|
+
text-align: left;
|
|
417
|
+
vertical-align: middle;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
table.sysml-table th {
|
|
421
|
+
background: var(--surface);
|
|
422
|
+
color: var(--muted);
|
|
423
|
+
font-weight: 600;
|
|
424
|
+
font-size: 11px;
|
|
425
|
+
white-space: nowrap;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
table.sysml-table tbody tr {
|
|
429
|
+
cursor: pointer;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
table.sysml-table tbody tr:hover td {
|
|
433
|
+
background: var(--surface);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
table.sysml-table tbody tr.is-selected td {
|
|
437
|
+
background: var(--accent-soft);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
table.sysml-table tbody tr.is-violated td:first-child {
|
|
441
|
+
box-shadow: inset 3px 0 0 var(--fail);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.mono {
|
|
445
|
+
font-family: var(--font-mono);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.expr-code {
|
|
449
|
+
font-family: var(--font-mono);
|
|
450
|
+
font-size: 11px;
|
|
451
|
+
background: var(--surface-2);
|
|
452
|
+
padding: 2px 5px;
|
|
453
|
+
border-radius: 4px;
|
|
454
|
+
word-break: break-word;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
.diag-list {
|
|
458
|
+
display: flex;
|
|
459
|
+
flex-direction: column;
|
|
460
|
+
gap: 5px;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
.diag-item {
|
|
464
|
+
font-family: var(--font-mono);
|
|
465
|
+
font-size: 11px;
|
|
466
|
+
padding: 6px 8px;
|
|
467
|
+
border-radius: 6px;
|
|
468
|
+
border: 1px solid var(--border);
|
|
469
|
+
background: var(--surface);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
.diag-item--error {
|
|
473
|
+
border-color: var(--fail);
|
|
474
|
+
background: var(--fail-bg);
|
|
475
|
+
color: var(--fail);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
.diag-item--warning {
|
|
479
|
+
border-color: var(--warn);
|
|
480
|
+
background: var(--warn-bg);
|
|
481
|
+
color: var(--warn);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
.chip-row {
|
|
485
|
+
display: flex;
|
|
486
|
+
flex-wrap: wrap;
|
|
487
|
+
gap: 5px;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.attr-chip {
|
|
491
|
+
appearance: none;
|
|
492
|
+
border: 1px solid var(--border);
|
|
493
|
+
background: var(--surface);
|
|
494
|
+
color: var(--text);
|
|
495
|
+
border-radius: 6px;
|
|
496
|
+
padding: 3px 7px;
|
|
497
|
+
font-size: 11px;
|
|
498
|
+
font-family: var(--font-mono);
|
|
499
|
+
cursor: pointer;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
.attr-chip:hover {
|
|
503
|
+
border-color: var(--accent);
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
.attr-chip--active {
|
|
507
|
+
background: var(--warn-bg);
|
|
508
|
+
border-color: var(--warn);
|
|
509
|
+
color: var(--warn);
|
|
510
|
+
font-weight: 650;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
.notice {
|
|
514
|
+
padding: 12px;
|
|
515
|
+
border-radius: 8px;
|
|
516
|
+
background: var(--surface);
|
|
517
|
+
border: 1px solid var(--border);
|
|
518
|
+
color: var(--muted);
|
|
519
|
+
font-size: 12px;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
.footer-meta {
|
|
523
|
+
font-size: 10px;
|
|
524
|
+
color: var(--muted);
|
|
525
|
+
font-family: var(--font-mono);
|
|
526
|
+
display: flex;
|
|
527
|
+
justify-content: space-between;
|
|
528
|
+
flex-wrap: wrap;
|
|
529
|
+
gap: 6px;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
</style>
|
|
533
|
+
</head>
|
|
534
|
+
<body>
|
|
535
|
+
<div id="root" aria-busy="true"></div>
|
|
536
|
+
<script type="module">
|
|
537
|
+
var $t="http://www.w3.org/2000/svg";function v(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function ut(){return{packages:[],parts:[],compositionLinks:[],requirements:[],constraints:[],attributes:[],elementCount:0}}function ft(){return{mode:"baseline-graph",changedAttributes:[],impactedAttributes:[],impactedConstraints:[],impactedParts:[],downstreamDomains:[],paths:[],edges:[]}}function wt(e){if(e.kind==="sysml-verification"&&v(e.architecture)&&Array.isArray(e.verdicts))return e;if(e.kind==="sysml-params"&&v(e.architecture)){let t=e;return{kind:"sysml-verification",modelName:t.modelName,status:t.status,provenance:t.provenance,engine:t.engine,solverUsed:"none",z3Available:!1,stdlibLoaded:!1,sourceSha256:t.sourceSha256,snapshotSha256:t.snapshotSha256,durationMs:t.durationMs,diagnostics:t.diagnostics??[],counts:{total:0,satisfied:0,violated:0,undecided:0,error:0},verdicts:[],architecture:t.architecture??ut(),impact:ft()}}if(e.kind==="sysml-eval"&&v(e.architecture)){let t=e;return{kind:"sysml-verification",modelName:t.modelName,status:t.status,provenance:t.provenance,engine:t.engine,solverUsed:"none",z3Available:!1,stdlibLoaded:!1,sourceSha256:t.sourceSha256,snapshotSha256:t.snapshotSha256,durationMs:t.durationMs,diagnostics:t.diagnostics??[],counts:{total:0,satisfied:0,violated:0,undecided:0,error:0},verdicts:[],architecture:t.architecture??ut(),impact:ft(),evaluatedFeatures:t.features}}return null}function Ct(e){if(!v(e)||e.isError===!0)return null;let t=[];if(v(e.structuredContent)&&(t.push(e.structuredContent),v(e.structuredContent.value)&&t.push(e.structuredContent.value)),t.push(e),Array.isArray(e.content)){for(let a of e.content)if(v(a)&&a.type==="text"&&typeof a.text=="string")try{let s=JSON.parse(a.text);v(s)&&(t.push(s),v(s.value)&&t.push(s.value))}catch{}}for(let a of t){if(!v(a))continue;let s=wt(a);if(s)return s}return null}function c(e,t,a){let s=document.createElement(e);return t&&(s.className=t),a!==void 0&&(s.textContent=a),s}function u(e,t,a){let s=document.createElementNS($t,e);for(let[$,C]of Object.entries(t))s.setAttribute($,String(C));return a!==void 0&&(s.textContent=a),s}function it(e,t){if(e==null)return"\u2014";let a;return typeof e=="number"?a=Number.isInteger(e)?String(e):Number(e.toPrecision(6)).toString():a=String(e),t?`${a} [${t}]`:a}function ht(e,t=10){return e?e.slice(0,t):"\u2014"}function vt(e,t,a){let s=document.getElementById("root");if(!s)return;let $=null,C=1,S={theme:globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",width:globalThis.innerWidth||540,emitComposeEvent(g,r){globalThis.parent?.postMessage({jsonrpc:"2.0",id:`sysml-ev-${C++}`,method:"ui/compose/event",params:{event:g,data:r}},"*")}};function T(g){S.theme=g,document.documentElement.dataset.theme=g}function P(){let g=Math.ceil(s.scrollHeight||document.body.scrollHeight||220);globalThis.parent?.postMessage({jsonrpc:"2.0",method:"ui/notifications/size-changed",params:{height:Math.max(120,g)}},"*")}function M(){if(!$){let g=c("div","sysml-shell");g.append(c("div","notice",`Waiting for SysML v2 verification data (${e})\u2026`)),s.replaceChildren(g),s.setAttribute("aria-busy","false"),P();return}t(s,$,S),s.setAttribute("aria-busy","false"),requestAnimationFrame(P)}T(S.theme),M(),typeof ResizeObserver<"u"&&new ResizeObserver(()=>P()).observe(s),globalThis.addEventListener("message",g=>{let r=g.data;if(!(!v(r)||r.jsonrpc!=="2.0")){if(r.id==="sysml-init"&&v(r.result)){let y=v(r.result.hostContext)?r.result.hostContext:void 0;(y?.theme==="dark"||y?.theme==="light")&&T(y.theme),v(y?.containerDimensions)&&typeof y.containerDimensions.width=="number"&&(S.width=y.containerDimensions.width),globalThis.parent?.postMessage({jsonrpc:"2.0",method:"ui/notifications/initialized",params:{}},"*");return}if(r.method==="ui/notifications/host-context-changed"&&v(r.params)){(r.params.theme==="dark"||r.params.theme==="light")&&T(r.params.theme),v(r.params.containerDimensions)&&typeof r.params.containerDimensions.width=="number"&&(S.width=r.params.containerDimensions.width),M();return}if(r.method==="ui/compose/event"&&v(r.params)){let y=typeof r.params.action=="string"?r.params.action:typeof r.params.event=="string"?r.params.event:"",L=v(r.params.data)?r.params.data:{};y&&a&&a(y,L,M);return}if(r.method==="ui/notifications/tool-result"){let y=Ct(r.params);if(y)$=y,M();else if(v(r.params)&&r.params.isError===!0){let L=c("div","sysml-shell");L.append(c("div","notice","SysML v2 engine returned an error.")),s.replaceChildren(L),P()}}}}),globalThis.parent?.postMessage({jsonrpc:"2.0",id:"sysml-init",method:"ui/initialize",params:{protocolVersion:"2026-01-26",appInfo:{name:`mcp-sysml-toolkit/${e}`,version:"0.1.0"},appCapabilities:{}}},"*")}var w=null,q=null,N=1,st="";function _(e,t){let a=t.trim().toLowerCase();return a?e.name.toLowerCase()===a||e.qualifiedName.toLowerCase()===a||e.id.toLowerCase()===a||e.qualifiedName.toLowerCase().endsWith(`::${a}`):!1}function W(e,t,a){let s=c("div","sysml-shell"),$=t.architecture.parts.filter(o=>o.kind==="PartDefinition"),C=$.length>0?$:t.architecture.parts,S=c("div","sysml-header"),T=c("div"),P=c("h3","sysml-title");P.append(c("span","kind-tag kind-tag--part","BDD"),document.createTextNode(`${t.modelName} \u2014 Block Definition & Part Hierarchy`)),T.append(P,c("div","sysml-sub",`${C.length} blocks \xB7 ${t.architecture.compositionLinks.length} compositions \xB7 ${t.architecture.attributes.length} attributes`));let M=c("div","pills");q&&M.append(c("span","pill pill--info",`sync focus: ${q}`)),M.append(c("span","pill pill--mono",`sha256:${ht(t.sourceSha256,8)}`)),S.append(T,M),s.append(S);let g=c("div","toolbar"),r=document.createElement("input");r.type="search",r.className="search-input",r.placeholder="Filter parts or attributes\u2026",r.value=st,r.addEventListener("input",()=>{st=r.value,W(e,t,a)});let y=c("div","toolbar-group"),L=(o,i)=>{let n=c("button","btn",o);return n.type="button",n.addEventListener("click",()=>{i(),W(e,t,a)}),n};if(y.append(L("\u2212",()=>{N=Math.max(.65,Number((N-.15).toFixed(2)))}),L(`${Math.round(N*100)}%`,()=>{N=1}),L("+",()=>{N=Math.min(1.6,Number((N+.15).toFixed(2)))})),g.append(r,y),s.append(g),C.length===0){s.append(c("div","notice","No PartDefinition blocks found in this SysML model.")),e.replaceChildren(s);return}let j=new Map;for(let o of t.verdicts){let i=j.get(o.ownerPart)??{sat:0,viol:0,und:0};o.status==="satisfied"?i.sat++:o.status==="violated"||o.status==="error"?i.viol++:i.und++,j.set(o.ownerPart,i)}let gt=new Set(t.architecture.compositionLinks.map(o=>o.toPart)),yt=new Set(t.architecture.compositionLinks.map(o=>o.fromPart)),I=[],U=[],X=[];for(let o of C){let i=yt.has(o.name),n=gt.has(o.name);i&&!n?I.push(o):n?U.push(o):X.push(o)}let D=[];I.length>0&&D.push(I),U.length>0&&D.push(U),X.length>0&&D.push(X);let B=212,G=24,ot=58,F=20,A=42,Y=17,at=6,Q=22,rt=[],R=new Map,lt=Math.max(1,...D.map(o=>Math.min(o.length,4))),Z=Math.max(520,F*2+lt*B+(lt-1)*G),J=F;for(let o of D){let i=[];for(let n=0;n<o.length;n+=4)i.push(o.slice(n,n+4));for(let n of i){let l=n.length*B+(n.length-1)*G,p=Math.max(F,Math.floor((Z-l)/2)),m=0;n.forEach((d,b)=>{let k=Math.min(d.attributes.length,at),f=d.attributes.length>at?1:0,H=Math.max(1,k+f)*Y+12,E=A+H+Q,h={part:d,x:p+b*(B+G),y:J,w:B,h:E,visibleAttrs:k};rt.push(h),R.set(d.name,h),E>m&&(m=E)}),J+=m+ot}}let ct=Math.max(220,J-ot+F),bt=Math.round(Z*N),kt=Math.round(ct*N),dt=c("div","diagram-wrap"),K=u("svg",{class:"sysml-svg",width:bt,height:kt,viewBox:`0 0 ${Z} ${ct}`,role:"img","aria-label":`${t.modelName} SysML Block Definition Diagram`}),O=u("g",{class:"bdd-edges"});for(let o of t.architecture.compositionLinks){let i=R.get(o.fromPart),n=R.get(o.toPart);if(!i||!n)continue;let l=i.x+i.w/2,p=i.y+i.h,m=n.x+n.w/2,d=n.y,b=p+(d-p)*.5,k=w!==null&&(_(i.part,w)||_(n.part,w)),f=k?"var(--accent)":"var(--block-border)";O.append(u("path",{d:`M ${l} ${p+10} L ${l} ${b} L ${m} ${b} L ${m} ${d}`,fill:"none",stroke:f,"stroke-width":k?2.2:1.4})),O.append(u("polygon",{points:`${l},${p} ${l+5},${p+6} ${l},${p+12} ${l-5},${p+6}`,fill:f,stroke:f,"stroke-width":1}));let H=m+6,E=d-7;O.append(u("text",{x:H,y:E,fill:k?"var(--accent)":"var(--muted)","font-size":10.5,"font-family":"var(--font-mono)","font-weight":k?700:500},o.usageName))}K.append(O);let tt=st.trim().toLowerCase(),pt=u("g",{class:"bdd-blocks"});for(let o of rt){let{part:i,x:n,y:l,w:p,h:m,visibleAttrs:d}=o,b=w!==null&&_(i,w),k=!tt||i.name.toLowerCase().includes(tt)||i.attributes.some(x=>x.name.toLowerCase().includes(tt)),f=j.get(i.name),H=(f?.viol??0)>0,E=b?"var(--accent)":H?"var(--fail)":"var(--block-border)",h=u("g",{style:`cursor: pointer; opacity: ${k?1:.28};`,role:"button",tabindex:"0","aria-label":`Part ${i.name}`});if(b&&h.append(u("rect",{x:n-3,y:l-3,width:p+6,height:m+6,rx:10,fill:"none",stroke:"var(--accent)","stroke-width":2.5,"stroke-opacity":.45})),h.append(u("rect",{x:n,y:l,width:p,height:m,rx:7,fill:"var(--block-bg)",stroke:E,"stroke-width":b?2:1.25})),h.append(u("path",{d:`M ${n+7} ${l} H ${n+p-7} Q ${n+p} ${l} ${n+p} ${l+7} V ${l+A} H ${n} V ${l+7} Q ${n} ${l} ${n+7} ${l} Z`,fill:"var(--block-hdr)"})),h.append(u("line",{x1:n,y1:l+A,x2:n+p,y2:l+A,stroke:"var(--border)","stroke-width":1})),h.append(u("text",{x:n+10,y:l+15,fill:"var(--accent)","font-size":9.5,"font-family":"var(--font-mono)","font-weight":600},i.kind==="PartDefinition"?"\xABpart def\xBB":"\xABpart\xBB")),h.append(u("text",{x:n+10,y:l+32,fill:"var(--text)","font-size":12.5,"font-weight":700,"font-family":"var(--font-sans)"},i.name.length>23?`${i.name.slice(0,22)}\u2026`:i.name)),f&&f.sat+f.viol+f.und>0){let x=f.sat+f.viol+f.und,et=f.viol>0?"var(--fail)":f.und>0?"var(--warn)":"var(--ok)",V=f.viol>0?`${f.viol} \u2717`:`${f.sat}/${x} \u2713`;h.append(u("text",{x:n+p-10,y:l+16,"text-anchor":"end",fill:et,"font-size":10,"font-family":"var(--font-mono)","font-weight":700},V))}i.attributes.length===0?h.append(u("text",{x:n+10,y:l+A+17,fill:"var(--muted)","font-size":10.5,"font-style":"italic"},"(no owned attributes)")):(i.attributes.slice(0,d).forEach((x,et)=>{let V=l+A+16+et*Y,nt=it(x.value,x.unit),xt=x.name.length>17?`${x.name.slice(0,16)}\u2026`:x.name;h.append(u("text",{x:n+10,y:V,fill:"var(--muted)","font-size":10.5,"font-family":"var(--font-mono)"},xt)),h.append(u("text",{x:n+p-10,y:V,"text-anchor":"end",fill:"var(--text)","font-size":10.5,"font-family":"var(--font-mono)","font-weight":600},nt.length>13?`${nt.slice(0,12)}\u2026`:nt))}),i.attributes.length>d&&h.append(u("text",{x:n+10,y:l+A+16+d*Y,fill:"var(--accent)","font-size":10,"font-family":"var(--font-mono)"},`+${i.attributes.length-d} more attributes\u2026`))),h.append(u("line",{x1:n,y1:l+m-Q,x2:n+p,y2:l+m-Q,stroke:"var(--border)","stroke-width":1})),h.append(u("text",{x:n+10,y:l+m-7,fill:"var(--muted)","font-size":10,"font-family":"var(--font-mono)"},`${i.attributes.length} attr \xB7 ${i.constraintCount} cstr${i.childUsages.length>0?` \xB7 ${i.childUsages.length} sub`:""}`));let mt=()=>{w=i.name,q=null,a.emitComposeEvent("part.selected",{partName:i.name,qualifiedName:i.qualifiedName,elementId:i.id,kind:i.kind}),W(e,t,a)};h.addEventListener("click",mt),h.addEventListener("keydown",x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),mt())}),pt.append(h)}K.append(pt),dt.append(K),s.append(dt);let z=w?C.find(o=>_(o,w)):void 0;if(z){let o=c("div","detail-card"),i=c("div","detail-title"),n=c("div","pills");n.append(c("span","kind-tag kind-tag--part","PART DEF"),c("span",void 0,z.name),c("span","sysml-sub",z.qualifiedName));let l=c("button","btn","Close");if(l.type="button",l.addEventListener("click",()=>{w=null,q=null,W(e,t,a)}),i.append(n,l),o.append(i),z.attributes.length>0){let m=c("div","detail-grid");for(let d of z.attributes){let b=c("div","kv");b.append(c("span","kv-k",`${d.name}${d.typeName?` : ${d.typeName}`:""}`),c("span","kv-v",d.unbound?"<unbound>":it(d.value,d.unit))),m.append(b)}o.append(m)}let p=t.verdicts.filter(m=>m.ownerPart===z.name);if(p.length>0){let m=c("div","chip-row");for(let d of p){let b=d.status==="satisfied"?"pill pill--ok pill--mono":d.status==="violated"||d.status==="error"?"pill pill--fail pill--mono":"pill pill--warn pill--mono",k=c("span",b,`${d.name}: ${d.status.toUpperCase()}`);k.style.cursor="pointer",k.addEventListener("click",()=>{a.emitComposeEvent("requirement.selected",{requirementName:d.name,qualifiedName:d.qualifiedName,ownerPart:d.ownerPart,status:d.status,kind:d.kind})}),m.append(k)}o.append(m)}s.append(o)}else s.append(c("div","footer-meta","Click any SysML block to inspect attributes & emit part.selected to synchronized Compose panels."));e.replaceChildren(s)}vt("architecture-tree",W,(e,t,a)=>{if(e!=="part.focus")return;let s=[t.partName,t.name,t.qualifiedName,t.part].find($=>typeof $=="string"&&$.trim().length>0);s&&(w=s,q=s,a())});
|
|
538
|
+
|
|
539
|
+
</script>
|
|
540
|
+
</body>
|
|
541
|
+
</html>
|