jui-tools-mcp-server 2.16.0 → 2.17.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.
Files changed (44) hide show
  1. package/.github/workflows/test.yml +2 -1
  2. package/README.md +16 -1
  3. package/dist/index.js +16 -1
  4. package/dist/tools/infra/infra_check.d.ts +10 -0
  5. package/dist/tools/infra/infra_check.js +43 -0
  6. package/dist/tools/infra/infra_common.d.ts +40 -0
  7. package/dist/tools/infra/infra_common.js +44 -0
  8. package/dist/tools/infra/infra_cost.d.ts +3 -0
  9. package/dist/tools/infra/infra_cost.js +118 -0
  10. package/dist/tools/infra/infra_load_validate.d.ts +8 -0
  11. package/dist/tools/infra/infra_load_validate.js +39 -0
  12. package/dist/tools/infra/infra_prices_validate.d.ts +7 -0
  13. package/dist/tools/infra/infra_prices_validate.js +34 -0
  14. package/dist/tools/infra/infra_seed.d.ts +27 -0
  15. package/dist/tools/infra/infra_seed.js +81 -0
  16. package/dist/tools/infra/infra_validate.d.ts +8 -0
  17. package/dist/tools/infra/infra_validate.js +37 -0
  18. package/package.json +1 -1
  19. package/scripts/record-infra-fixtures.sh +78 -0
  20. package/src/index.ts +17 -1
  21. package/src/tools/infra/infra_check.ts +49 -0
  22. package/src/tools/infra/infra_common.ts +69 -0
  23. package/src/tools/infra/infra_cost.ts +122 -0
  24. package/src/tools/infra/infra_load_validate.ts +46 -0
  25. package/src/tools/infra/infra_prices_validate.ts +41 -0
  26. package/src/tools/infra/infra_seed.ts +88 -0
  27. package/src/tools/infra/infra_validate.ts +44 -0
  28. package/tests/fixtures/infra/RECORDED_FROM +1 -0
  29. package/tests/fixtures/infra/check-infra.json +101 -0
  30. package/tests/fixtures/infra/cost-infra.day.json +10080 -0
  31. package/tests/fixtures/infra/cost-infra.month-by-node.json +484 -0
  32. package/tests/fixtures/infra/cost-infra.month.json +381 -0
  33. package/tests/fixtures/infra/cost-infra.refused.json +5 -0
  34. package/tests/fixtures/infra/seed-infra.draft.json +233 -0
  35. package/tests/fixtures/infra/seed-infra.report.json +46 -0
  36. package/tests/fixtures/infra/validate-infra-load.errors.json +39 -0
  37. package/tests/fixtures/infra/validate-infra-load.ok.json +29 -0
  38. package/tests/fixtures/infra/validate-infra-load.unreadable.json +6 -0
  39. package/tests/fixtures/infra/validate-infra-prices.ok.json +9 -0
  40. package/tests/fixtures/infra/validate-infra.errors.json +39 -0
  41. package/tests/fixtures/infra/validate-infra.ok.json +30 -0
  42. package/tests/fixtures/infra/validate-infra.unreadable.json +6 -0
  43. package/tests/tool_count.test.ts +1 -1
  44. package/tests/tools_infra.test.ts +332 -0
@@ -0,0 +1,381 @@
1
+ {
2
+ "ok": true,
3
+ "dir": "docs/infra/load",
4
+ "scenario": "ordinary",
5
+ "scenarios": [
6
+ {
7
+ "id": "ordinary",
8
+ "label": "ふだんの月",
9
+ "file": "ordinary.json",
10
+ "month": "2026-11",
11
+ "environment": "production"
12
+ },
13
+ {
14
+ "id": "sale",
15
+ "label": "セールの月",
16
+ "file": "sale.json",
17
+ "month": "2026-11",
18
+ "environment": "production"
19
+ }
20
+ ],
21
+ "problems": {
22
+ "count": 0,
23
+ "errors": 0,
24
+ "first": []
25
+ },
26
+ "prices": {
27
+ "warnings": [],
28
+ "warningCount": 0
29
+ },
30
+ "month": {
31
+ "scenario": "ordinary",
32
+ "month": "2026-11",
33
+ "usd": 1018.5974779999989,
34
+ "by": "provider",
35
+ "keys": [
36
+ {
37
+ "key": "aws",
38
+ "label": "aws"
39
+ },
40
+ {
41
+ "key": "sendgrid",
42
+ "label": "sendgrid"
43
+ }
44
+ ],
45
+ "days": [
46
+ {
47
+ "date": "2026-11-01",
48
+ "usd": 33.25126966666666,
49
+ "stack": {
50
+ "aws": 33.251269666666666
51
+ },
52
+ "overflowHours": 0,
53
+ "atMaxHours": 0
54
+ },
55
+ {
56
+ "date": "2026-11-02",
57
+ "usd": 34.25409766666661,
58
+ "stack": {
59
+ "aws": 34.254097666666674
60
+ },
61
+ "overflowHours": 0,
62
+ "atMaxHours": 0
63
+ },
64
+ {
65
+ "date": "2026-11-03",
66
+ "usd": 34.25409766666661,
67
+ "stack": {
68
+ "aws": 34.254097666666674
69
+ },
70
+ "overflowHours": 0,
71
+ "atMaxHours": 0
72
+ },
73
+ {
74
+ "date": "2026-11-04",
75
+ "usd": 34.25409766666661,
76
+ "stack": {
77
+ "aws": 34.254097666666674
78
+ },
79
+ "overflowHours": 0,
80
+ "atMaxHours": 0
81
+ },
82
+ {
83
+ "date": "2026-11-05",
84
+ "usd": 34.25409766666661,
85
+ "stack": {
86
+ "aws": 34.25409766666667
87
+ },
88
+ "overflowHours": 0,
89
+ "atMaxHours": 0
90
+ },
91
+ {
92
+ "date": "2026-11-06",
93
+ "usd": 34.25409766666661,
94
+ "stack": {
95
+ "aws": 34.25409766666667
96
+ },
97
+ "overflowHours": 0,
98
+ "atMaxHours": 0
99
+ },
100
+ {
101
+ "date": "2026-11-07",
102
+ "usd": 33.25126966666666,
103
+ "stack": {
104
+ "aws": 33.25126966666667
105
+ },
106
+ "overflowHours": 0,
107
+ "atMaxHours": 0
108
+ },
109
+ {
110
+ "date": "2026-11-08",
111
+ "usd": 33.25126966666666,
112
+ "stack": {
113
+ "aws": 33.25126966666667
114
+ },
115
+ "overflowHours": 0,
116
+ "atMaxHours": 0
117
+ },
118
+ {
119
+ "date": "2026-11-09",
120
+ "usd": 34.25409766666661,
121
+ "stack": {
122
+ "aws": 34.254097666666674
123
+ },
124
+ "overflowHours": 0,
125
+ "atMaxHours": 0
126
+ },
127
+ {
128
+ "date": "2026-11-10",
129
+ "usd": 34.25409766666661,
130
+ "stack": {
131
+ "aws": 34.25409766666666
132
+ },
133
+ "overflowHours": 0,
134
+ "atMaxHours": 0
135
+ },
136
+ {
137
+ "date": "2026-11-11",
138
+ "usd": 34.25409766666661,
139
+ "stack": {
140
+ "aws": 34.25409766666663
141
+ },
142
+ "overflowHours": 0,
143
+ "atMaxHours": 0
144
+ },
145
+ {
146
+ "date": "2026-11-12",
147
+ "usd": 34.25409766666661,
148
+ "stack": {
149
+ "aws": 34.25409766666663
150
+ },
151
+ "overflowHours": 0,
152
+ "atMaxHours": 0
153
+ },
154
+ {
155
+ "date": "2026-11-13",
156
+ "usd": 34.25409766666661,
157
+ "stack": {
158
+ "aws": 34.25409766666663
159
+ },
160
+ "overflowHours": 0,
161
+ "atMaxHours": 0
162
+ },
163
+ {
164
+ "date": "2026-11-14",
165
+ "usd": 33.251269666666666,
166
+ "stack": {
167
+ "aws": 33.25126966666663
168
+ },
169
+ "overflowHours": 0,
170
+ "atMaxHours": 0
171
+ },
172
+ {
173
+ "date": "2026-11-15",
174
+ "usd": 33.25126966666667,
175
+ "stack": {
176
+ "aws": 33.25126966666664
177
+ },
178
+ "overflowHours": 0,
179
+ "atMaxHours": 0
180
+ },
181
+ {
182
+ "date": "2026-11-16",
183
+ "usd": 34.25409766666662,
184
+ "stack": {
185
+ "aws": 34.25409766666664
186
+ },
187
+ "overflowHours": 0,
188
+ "atMaxHours": 0
189
+ },
190
+ {
191
+ "date": "2026-11-17",
192
+ "usd": 34.25409766666662,
193
+ "stack": {
194
+ "aws": 34.25409766666664
195
+ },
196
+ "overflowHours": 0,
197
+ "atMaxHours": 0
198
+ },
199
+ {
200
+ "date": "2026-11-18",
201
+ "usd": 34.25409766666662,
202
+ "stack": {
203
+ "aws": 34.25409766666664
204
+ },
205
+ "overflowHours": 0,
206
+ "atMaxHours": 0
207
+ },
208
+ {
209
+ "date": "2026-11-19",
210
+ "usd": 34.25409766666662,
211
+ "stack": {
212
+ "aws": 34.25409766666664
213
+ },
214
+ "overflowHours": 0,
215
+ "atMaxHours": 0
216
+ },
217
+ {
218
+ "date": "2026-11-20",
219
+ "usd": 34.25409766666662,
220
+ "stack": {
221
+ "aws": 34.25409766666664
222
+ },
223
+ "overflowHours": 0,
224
+ "atMaxHours": 0
225
+ },
226
+ {
227
+ "date": "2026-11-21",
228
+ "usd": 33.25126966666667,
229
+ "stack": {
230
+ "aws": 33.25126966666663
231
+ },
232
+ "overflowHours": 0,
233
+ "atMaxHours": 0
234
+ },
235
+ {
236
+ "date": "2026-11-22",
237
+ "usd": 33.25126966666667,
238
+ "stack": {
239
+ "aws": 33.25126966666663
240
+ },
241
+ "overflowHours": 0,
242
+ "atMaxHours": 0
243
+ },
244
+ {
245
+ "date": "2026-11-23",
246
+ "usd": 34.25409766666662,
247
+ "stack": {
248
+ "aws": 34.25409766666664
249
+ },
250
+ "overflowHours": 0,
251
+ "atMaxHours": 0
252
+ },
253
+ {
254
+ "date": "2026-11-24",
255
+ "usd": 34.25409766666662,
256
+ "stack": {
257
+ "aws": 34.25409766666664
258
+ },
259
+ "overflowHours": 0,
260
+ "atMaxHours": 0
261
+ },
262
+ {
263
+ "date": "2026-11-25",
264
+ "usd": 34.25409766666662,
265
+ "stack": {
266
+ "aws": 34.25409766666664
267
+ },
268
+ "overflowHours": 0,
269
+ "atMaxHours": 0
270
+ },
271
+ {
272
+ "date": "2026-11-26",
273
+ "usd": 34.25409766666662,
274
+ "stack": {
275
+ "aws": 34.25409766666664
276
+ },
277
+ "overflowHours": 0,
278
+ "atMaxHours": 0
279
+ },
280
+ {
281
+ "date": "2026-11-27",
282
+ "usd": 34.25409766666662,
283
+ "stack": {
284
+ "aws": 34.25409766666664
285
+ },
286
+ "overflowHours": 0,
287
+ "atMaxHours": 0
288
+ },
289
+ {
290
+ "date": "2026-11-28",
291
+ "usd": 33.25126966666668,
292
+ "stack": {
293
+ "aws": 33.251269666666644
294
+ },
295
+ "overflowHours": 0,
296
+ "atMaxHours": 0
297
+ },
298
+ {
299
+ "date": "2026-11-29",
300
+ "usd": 33.25126966666668,
301
+ "stack": {
302
+ "aws": 33.251269666666644
303
+ },
304
+ "overflowHours": 0,
305
+ "atMaxHours": 0
306
+ },
307
+ {
308
+ "date": "2026-11-30",
309
+ "usd": 34.254097666666624,
310
+ "stack": {
311
+ "aws": 34.254097666666645
312
+ },
313
+ "overflowHours": 0,
314
+ "atMaxHours": 0
315
+ }
316
+ ],
317
+ "noPrice": [
318
+ {
319
+ "node": "mailer",
320
+ "meter": "emails",
321
+ "sku": "emails",
322
+ "unit": "email"
323
+ },
324
+ {
325
+ "node": "api-5xx",
326
+ "meter": "alarm",
327
+ "sku": "alarm",
328
+ "unit": "month"
329
+ }
330
+ ],
331
+ "noRule": [
332
+ "stripe",
333
+ "api-role"
334
+ ],
335
+ "loadUndefined": [],
336
+ "overflowHours": {},
337
+ "warnings": [
338
+ {
339
+ "fn": "price_meter",
340
+ "message": "no price for (no service) emails (email) in ap-northeast-1",
341
+ "node": "mailer",
342
+ "hour": "2026-11-01T00",
343
+ "meter": "emails"
344
+ },
345
+ {
346
+ "fn": "price_meter",
347
+ "message": "no price for cloudwatch.alarm alarm (month) in no region",
348
+ "node": "api-5xx",
349
+ "hour": "2026-11-01T00",
350
+ "meter": "alarm"
351
+ }
352
+ ],
353
+ "warningCount": 2
354
+ },
355
+ "topNodes": [
356
+ {
357
+ "node": "cdn",
358
+ "usd": 455.4774000000002
359
+ },
360
+ {
361
+ "node": "db-prod",
362
+ "usd": 422.3999999999987
363
+ },
364
+ {
365
+ "node": "api-prod",
366
+ "usd": 64.80000000000005
367
+ },
368
+ {
369
+ "node": "assets",
370
+ "usd": 44.55927800000017
371
+ },
372
+ {
373
+ "node": "alb-prod",
374
+ "usd": 29.015999999999977
375
+ },
376
+ {
377
+ "node": "api-prod>db-prod",
378
+ "usd": 2.3447999999999984
379
+ }
380
+ ]
381
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "ok": false,
3
+ "reason": "no_scenario",
4
+ "message": "no scenario 'nope'; there are: ordinary, sale"
5
+ }
@@ -0,0 +1,233 @@
1
+ {
2
+ "$schema": "https://jsonui.dev/schemas/infra-model/v0.json",
3
+ "version": 0,
4
+ "description": "Draft by jsonui-doc seed infra: not the display source. Review it, then move what you keep into the model's folder.",
5
+ "environments": [
6
+ {
7
+ "id": "local",
8
+ "label": "local (Docker Compose)",
9
+ "kind": "local"
10
+ },
11
+ {
12
+ "id": "deployed",
13
+ "label": "deployed (seed: split into the real environments)",
14
+ "kind": "other"
15
+ }
16
+ ],
17
+ "groups": [
18
+ {
19
+ "id": "compose",
20
+ "kind": "host",
21
+ "label": "Docker Compose",
22
+ "provider": "docker",
23
+ "environments": [
24
+ "local"
25
+ ]
26
+ },
27
+ {
28
+ "id": "aws-account",
29
+ "kind": "account",
30
+ "provider": "aws",
31
+ "label": "aws (account)",
32
+ "environments": [
33
+ "deployed"
34
+ ]
35
+ },
36
+ {
37
+ "id": "aws-ap-northeast-1",
38
+ "kind": "region",
39
+ "label": "aws ap-northeast-1",
40
+ "provider": "aws",
41
+ "parent": "aws-account",
42
+ "region": "ap-northeast-1",
43
+ "environments": [
44
+ "deployed"
45
+ ]
46
+ },
47
+ {
48
+ "id": "external",
49
+ "kind": "logical",
50
+ "label": "External services"
51
+ }
52
+ ],
53
+ "nodes": [
54
+ {
55
+ "id": "compose-web",
56
+ "category": "compute.container",
57
+ "label": "web",
58
+ "provider": "docker",
59
+ "service": "compose.container",
60
+ "group": "compose",
61
+ "iac": [
62
+ "docker-compose.yml#services.web"
63
+ ],
64
+ "evidence": [
65
+ {
66
+ "file": "docker-compose.yml",
67
+ "pattern": "web",
68
+ "line": 1
69
+ }
70
+ ],
71
+ "environments": [
72
+ "local"
73
+ ]
74
+ },
75
+ {
76
+ "id": "compose-db",
77
+ "category": "database.relational",
78
+ "label": "db",
79
+ "provider": "docker",
80
+ "service": "compose.postgres",
81
+ "group": "compose",
82
+ "engine": "postgres 16",
83
+ "iac": [
84
+ "docker-compose.yml#services.db"
85
+ ],
86
+ "evidence": [
87
+ {
88
+ "file": "docker-compose.yml",
89
+ "pattern": "db",
90
+ "line": 4
91
+ }
92
+ ],
93
+ "environments": [
94
+ "local"
95
+ ]
96
+ },
97
+ {
98
+ "id": "compose-cache",
99
+ "category": "cache",
100
+ "label": "cache",
101
+ "provider": "docker",
102
+ "service": "compose.redis",
103
+ "group": "compose",
104
+ "engine": "redis 7",
105
+ "iac": [
106
+ "docker-compose.yml#services.cache"
107
+ ],
108
+ "evidence": [
109
+ {
110
+ "file": "docker-compose.yml",
111
+ "pattern": "cache",
112
+ "line": 6
113
+ }
114
+ ],
115
+ "environments": [
116
+ "local"
117
+ ]
118
+ },
119
+ {
120
+ "id": "rds-main",
121
+ "category": "database.relational",
122
+ "label": "main (rds.postgres)",
123
+ "provider": "aws",
124
+ "service": "rds.postgres",
125
+ "group": "aws-ap-northeast-1",
126
+ "engine": "postgres",
127
+ "iac": [
128
+ "aws_db_instance.main"
129
+ ],
130
+ "evidence": [
131
+ {
132
+ "file": "main.tf",
133
+ "pattern": "resource \"aws_db_instance\" \"main\"",
134
+ "line": 2
135
+ }
136
+ ],
137
+ "environments": [
138
+ "deployed"
139
+ ]
140
+ },
141
+ {
142
+ "id": "elb-web",
143
+ "category": "load_balancer",
144
+ "label": "web (elb.alb)",
145
+ "provider": "aws",
146
+ "service": "elb.alb",
147
+ "group": "aws-ap-northeast-1",
148
+ "iac": [
149
+ "aws_lb.web"
150
+ ],
151
+ "evidence": [
152
+ {
153
+ "file": "main.tf",
154
+ "pattern": "resource \"aws_lb\" \"web\"",
155
+ "line": 3
156
+ }
157
+ ],
158
+ "environments": [
159
+ "deployed"
160
+ ]
161
+ },
162
+ {
163
+ "id": "s3-assets",
164
+ "category": "storage.object",
165
+ "label": "assets (s3)",
166
+ "provider": "aws",
167
+ "service": "s3",
168
+ "group": "aws-ap-northeast-1",
169
+ "iac": [
170
+ "aws_s3_bucket.assets"
171
+ ],
172
+ "evidence": [
173
+ {
174
+ "file": "main.tf",
175
+ "pattern": "resource \"aws_s3_bucket\" \"assets\"",
176
+ "line": 4
177
+ }
178
+ ],
179
+ "environments": [
180
+ "deployed"
181
+ ]
182
+ },
183
+ {
184
+ "id": "app-app",
185
+ "category": "compute.container",
186
+ "label": "app (app: where it runs is not known)",
187
+ "evidence": [
188
+ {
189
+ "file": "app/main.py"
190
+ }
191
+ ]
192
+ },
193
+ {
194
+ "id": "stripe-payments",
195
+ "category": "external.saas",
196
+ "label": "stripe payments",
197
+ "provider": "stripe",
198
+ "service": "payments",
199
+ "group": "external",
200
+ "managed_by": "external",
201
+ "evidence": [
202
+ {
203
+ "file": "app/main.py",
204
+ "pattern": "stripe",
205
+ "line": 2
206
+ }
207
+ ]
208
+ }
209
+ ],
210
+ "edges": [
211
+ {
212
+ "from": "compose-web",
213
+ "to": "compose-db",
214
+ "label": "depends_on",
215
+ "environments": [
216
+ "local"
217
+ ]
218
+ },
219
+ {
220
+ "from": "compose-web",
221
+ "to": "compose-cache",
222
+ "label": "depends_on",
223
+ "environments": [
224
+ "local"
225
+ ]
226
+ },
227
+ {
228
+ "from": "app-app",
229
+ "to": "stripe-payments",
230
+ "label": "uses (code)"
231
+ }
232
+ ]
233
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "version": 0,
3
+ "inputs": {
4
+ "code": [
5
+ "1 file(s)"
6
+ ],
7
+ "compose": [
8
+ "docker-compose.yml"
9
+ ],
10
+ "terraform": [
11
+ "main.tf"
12
+ ],
13
+ "terraform_providers": [
14
+ "aws"
15
+ ]
16
+ },
17
+ "unmatched": {
18
+ "aws": {
19
+ "count": 2,
20
+ "items": [
21
+ {
22
+ "file": "main.tf",
23
+ "what": "aws_glue_job.etl",
24
+ "why": "no category for this resource type"
25
+ },
26
+ {
27
+ "file": "app/main.py",
28
+ "what": "boto3",
29
+ "why": "SDK import: which service is not clear from the import alone"
30
+ }
31
+ ]
32
+ }
33
+ },
34
+ "notDrawn": {},
35
+ "skipped": [],
36
+ "skippedCount": 0,
37
+ "notes": [
38
+ "compose service web (docker-compose.yml): the image is not one seed knows; drawn as a container",
39
+ "nodes from code: an app node per code root (where it runs is not known), and what it talks to; a node with no provider needs one, and a node may be the same as one from IaC — merge them"
40
+ ],
41
+ "specValues": 0,
42
+ "flows": 0,
43
+ "withheld": 0,
44
+ "withheldFrom": [],
45
+ "withheldFromCount": 0
46
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "ok": true,
3
+ "dir": "docs/infra/load",
4
+ "files": [
5
+ "ordinary.json",
6
+ "sale.json"
7
+ ],
8
+ "problems": [
9
+ {
10
+ "file": "broken.json",
11
+ "path": "/",
12
+ "code": "json",
13
+ "message": "not JSON (line 1, column 2)",
14
+ "severity": "error",
15
+ "fn": "read_file",
16
+ "line": 1
17
+ }
18
+ ],
19
+ "scenarios": [
20
+ {
21
+ "id": "ordinary",
22
+ "file": "ordinary.json",
23
+ "environment": "production",
24
+ "month": "2026-11",
25
+ "hours": 720,
26
+ "loads": 6,
27
+ "edges": 1
28
+ },
29
+ {
30
+ "id": "sale",
31
+ "file": "sale.json",
32
+ "environment": "production",
33
+ "month": "2026-11",
34
+ "hours": 720,
35
+ "loads": 3,
36
+ "edges": 0
37
+ }
38
+ ]
39
+ }