jui-tools-mcp-server 2.16.0 → 2.18.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 (59) 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 +181 -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 +3 -0
  17. package/dist/tools/infra/infra_validate.js +74 -0
  18. package/package.json +1 -1
  19. package/scripts/record-infra-fixtures.sh +143 -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 +177 -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 +79 -0
  28. package/tests/fixtures/infra/RECORDED_FROM +1 -0
  29. package/tests/fixtures/infra/answers-without-plan.json +9 -0
  30. package/tests/fixtures/infra/check-infra.json +103 -0
  31. package/tests/fixtures/infra/cost-infra.day.json +10080 -0
  32. package/tests/fixtures/infra/cost-infra.month-by-node.json +492 -0
  33. package/tests/fixtures/infra/cost-infra.month.json +398 -0
  34. package/tests/fixtures/infra/cost-infra.plan-bad.json +16 -0
  35. package/tests/fixtures/infra/cost-infra.plan-move-account.json +167 -0
  36. package/tests/fixtures/infra/cost-infra.plan-move.json +174 -0
  37. package/tests/fixtures/infra/cost-infra.plan-none.json +16 -0
  38. package/tests/fixtures/infra/cost-infra.plan-shrink.json +162 -0
  39. package/tests/fixtures/infra/cost-infra.refused.json +5 -0
  40. package/tests/fixtures/infra/seed-infra.draft.json +233 -0
  41. package/tests/fixtures/infra/seed-infra.report.json +46 -0
  42. package/tests/fixtures/infra/validate-infra-load.errors.json +40 -0
  43. package/tests/fixtures/infra/validate-infra-load.ok.json +29 -0
  44. package/tests/fixtures/infra/validate-infra-load.unreadable.json +7 -0
  45. package/tests/fixtures/infra/validate-infra-prices.ok.json +9 -0
  46. package/tests/fixtures/infra/validate-infra.errors.json +43 -0
  47. package/tests/fixtures/infra/validate-infra.ok.json +30 -0
  48. package/tests/fixtures/infra/validate-infra.plan-both.json +504 -0
  49. package/tests/fixtures/infra/validate-infra.plan-duplicate.json +539 -0
  50. package/tests/fixtures/infra/validate-infra.plan-edge-end.json +539 -0
  51. package/tests/fixtures/infra/validate-infra.plan-half.json +49 -0
  52. package/tests/fixtures/infra/validate-infra.plan-move.json +506 -0
  53. package/tests/fixtures/infra/validate-infra.plan-none.json +49 -0
  54. package/tests/fixtures/infra/validate-infra.plan-order-unknown.json +539 -0
  55. package/tests/fixtures/infra/validate-infra.plan-remove-missing.json +539 -0
  56. package/tests/fixtures/infra/validate-infra.plans.json +506 -0
  57. package/tests/fixtures/infra/validate-infra.unreadable.json +6 -0
  58. package/tests/tool_count.test.ts +1 -1
  59. package/tests/tools_infra.test.ts +540 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "ok": false,
3
+ "reason": "no_infra",
4
+ "message": "the infra model cannot be read: no model files in docs/infra (*.json)",
5
+ "short": "docs/infra に infra のファイル(*.json)がありません",
6
+ "problems": []
7
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "ok": true,
3
+ "dir": "docs/infra/prices",
4
+ "files": [
5
+ "example.json"
6
+ ],
7
+ "problems": [],
8
+ "count": 5
9
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "ok": true,
3
+ "dir": "docs/infra",
4
+ "version": 0,
5
+ "files": [
6
+ "external.json",
7
+ "main.json"
8
+ ],
9
+ "environments": [
10
+ {
11
+ "id": "production",
12
+ "label": "本番",
13
+ "kind": "production"
14
+ },
15
+ {
16
+ "id": "staging",
17
+ "label": "ステージング",
18
+ "kind": "staging"
19
+ }
20
+ ],
21
+ "flows": [],
22
+ "problems": [
23
+ {
24
+ "file": "bad.json",
25
+ "path": "/nodes/0/category",
26
+ "code": "schema",
27
+ "message": "must be one of client, compute.vm, compute.container, compute.function, compute.k8s, compute.paas, edge.cdn, edge.dns, edge.waf, load_balancer, gateway.api, gateway.nat, network.ip, database.relational, database.document, database.kv, database.search, cache, storage.object, storage.file, storage.block, queue, stream, scheduler, mail, auth, secrets, monitoring, ci, external.saas, security.iam, security.policy, monitoring.alarm",
28
+ "severity": "error",
29
+ "detail": {
30
+ "keyword": "enum",
31
+ "allowed": "client, compute.vm, compute.container, compute.function, compute.k8s, compute.paas, edge.cdn, edge.dns, edge.waf, load_balancer, gateway.api, gateway.nat, network.ip, database.relational, database.document, database.kv, database.search, cache, storage.object, storage.file, storage.block, queue, stream, scheduler, mail, auth, secrets, monitoring, ci, external.saas, security.iam, security.policy, monitoring.alarm"
32
+ },
33
+ "short": "docs/infra/bad.json: /nodes/0/category は client, compute.vm, compute.container, compute.function, compute.k8s, compute.paas, edge.cdn, edge.dns, edge.waf, load_balancer, gateway.api, gateway.nat, network.ip, database.relational, database.document, database.kv, database.search, cache, storage.object, storage.file, storage.block, queue, stream, scheduler, mail, auth, secrets, monitoring, ci, external.saas, security.iam, security.policy, monitoring.alarm のどれかです"
34
+ }
35
+ ],
36
+ "icons": {},
37
+ "readMs": 5,
38
+ "counts": {
39
+ "groups": 8,
40
+ "nodes": 12,
41
+ "edges": 10
42
+ }
43
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "ok": true,
3
+ "dir": "docs/infra",
4
+ "version": 0,
5
+ "files": [
6
+ "external.json",
7
+ "main.json"
8
+ ],
9
+ "environments": [
10
+ {
11
+ "id": "production",
12
+ "label": "本番",
13
+ "kind": "production"
14
+ },
15
+ {
16
+ "id": "staging",
17
+ "label": "ステージング",
18
+ "kind": "staging"
19
+ }
20
+ ],
21
+ "flows": [],
22
+ "problems": [],
23
+ "icons": {},
24
+ "readMs": 5,
25
+ "counts": {
26
+ "groups": 8,
27
+ "nodes": 12,
28
+ "edges": 10
29
+ }
30
+ }
@@ -0,0 +1,504 @@
1
+ {
2
+ "ok": true,
3
+ "dir": "docs/infra",
4
+ "version": 0,
5
+ "files": [
6
+ "external.json",
7
+ "main.json"
8
+ ],
9
+ "environments": [
10
+ {
11
+ "id": "production",
12
+ "label": "本番",
13
+ "kind": "production"
14
+ },
15
+ {
16
+ "id": "staging",
17
+ "label": "ステージング",
18
+ "kind": "staging"
19
+ }
20
+ ],
21
+ "flows": [],
22
+ "problems": [],
23
+ "icons": {},
24
+ "migrations": [
25
+ {
26
+ "name": "both",
27
+ "dir": "docs/infra/migrations/both",
28
+ "steps": [
29
+ {
30
+ "index": 1,
31
+ "node": "db-prod",
32
+ "kind": "replace",
33
+ "edgesRemoved": [],
34
+ "edgesAdded": []
35
+ }
36
+ ],
37
+ "counts": {
38
+ "added": 0,
39
+ "replaced": 1,
40
+ "removed": 0,
41
+ "edgesAdded": 0,
42
+ "edgesRemoved": 0
43
+ },
44
+ "model": {
45
+ "version": 0,
46
+ "files": [
47
+ "external.json",
48
+ "main.json",
49
+ "both/changes.json"
50
+ ],
51
+ "environments": [
52
+ {
53
+ "id": "production",
54
+ "label": "本番",
55
+ "kind": "production"
56
+ },
57
+ {
58
+ "id": "staging",
59
+ "label": "ステージング",
60
+ "kind": "staging"
61
+ }
62
+ ],
63
+ "groups": [
64
+ {
65
+ "id": "aws-prod",
66
+ "kind": "account",
67
+ "provider": "aws",
68
+ "label": "本番アカウント",
69
+ "environments": [
70
+ "production"
71
+ ],
72
+ "providerResolved": "aws"
73
+ },
74
+ {
75
+ "id": "aws-stg",
76
+ "kind": "account",
77
+ "provider": "aws",
78
+ "label": "ステージングアカウント",
79
+ "environments": [
80
+ "staging"
81
+ ],
82
+ "providerResolved": "aws"
83
+ },
84
+ {
85
+ "id": "apne1-prod",
86
+ "kind": "region",
87
+ "region": "ap-northeast-1",
88
+ "parent": "aws-prod",
89
+ "environments": [
90
+ "production"
91
+ ],
92
+ "label": "apne1-prod",
93
+ "providerResolved": "aws"
94
+ },
95
+ {
96
+ "id": "apne1-stg",
97
+ "kind": "region",
98
+ "region": "ap-northeast-1",
99
+ "parent": "aws-stg",
100
+ "environments": [
101
+ "staging"
102
+ ],
103
+ "label": "apne1-stg",
104
+ "providerResolved": "aws"
105
+ },
106
+ {
107
+ "id": "vpc-prod",
108
+ "kind": "network",
109
+ "parent": "apne1-prod",
110
+ "label": "VPC (2 AZ)",
111
+ "environments": [
112
+ "production"
113
+ ],
114
+ "providerResolved": "aws"
115
+ },
116
+ {
117
+ "id": "vpc-stg",
118
+ "kind": "network",
119
+ "parent": "apne1-stg",
120
+ "label": "VPC (1 AZ)",
121
+ "environments": [
122
+ "staging"
123
+ ],
124
+ "providerResolved": "aws"
125
+ },
126
+ {
127
+ "id": "private-prod",
128
+ "kind": "subnet",
129
+ "parent": "vpc-prod",
130
+ "visibility": "private",
131
+ "environments": [
132
+ "production"
133
+ ],
134
+ "label": "private-prod",
135
+ "providerResolved": "aws"
136
+ },
137
+ {
138
+ "id": "private-stg",
139
+ "kind": "subnet",
140
+ "parent": "vpc-stg",
141
+ "visibility": "private",
142
+ "environments": [
143
+ "staging"
144
+ ],
145
+ "label": "private-stg",
146
+ "providerResolved": "aws"
147
+ }
148
+ ],
149
+ "nodes": [
150
+ {
151
+ "id": "stripe",
152
+ "category": "external.saas",
153
+ "provider": "stripe",
154
+ "label": "Stripe",
155
+ "managed_by": "external",
156
+ "evidence": [
157
+ {
158
+ "file": "backend/app/config.py",
159
+ "pattern": "stripe_"
160
+ }
161
+ ],
162
+ "count": 1,
163
+ "providerResolved": "stripe",
164
+ "regionResolved": "",
165
+ "fold": false,
166
+ "environments": [
167
+ "production",
168
+ "staging"
169
+ ]
170
+ },
171
+ {
172
+ "id": "mailer",
173
+ "category": "mail",
174
+ "provider": "sendgrid",
175
+ "label": "メール配信",
176
+ "managed_by": "external",
177
+ "count": 1,
178
+ "providerResolved": "sendgrid",
179
+ "regionResolved": "",
180
+ "fold": false,
181
+ "environments": [
182
+ "production",
183
+ "staging"
184
+ ]
185
+ },
186
+ {
187
+ "id": "cdn",
188
+ "category": "edge.cdn",
189
+ "service": "cloudfront",
190
+ "provider": "aws",
191
+ "label": "CloudFront",
192
+ "count": 1,
193
+ "providerResolved": "aws",
194
+ "regionResolved": "",
195
+ "managed_by": "iac",
196
+ "fold": false,
197
+ "environments": [
198
+ "production",
199
+ "staging"
200
+ ]
201
+ },
202
+ {
203
+ "id": "alb-prod",
204
+ "category": "load_balancer",
205
+ "service": "elb.alb",
206
+ "group": "vpc-prod",
207
+ "environments": [
208
+ "production"
209
+ ],
210
+ "label": "alb-prod",
211
+ "count": 1,
212
+ "providerResolved": "aws",
213
+ "regionResolved": "ap-northeast-1",
214
+ "managed_by": "iac",
215
+ "fold": false
216
+ },
217
+ {
218
+ "id": "alb-stg",
219
+ "category": "load_balancer",
220
+ "service": "elb.alb",
221
+ "group": "vpc-stg",
222
+ "environments": [
223
+ "staging"
224
+ ],
225
+ "label": "alb-stg",
226
+ "count": 1,
227
+ "providerResolved": "aws",
228
+ "regionResolved": "ap-northeast-1",
229
+ "managed_by": "iac",
230
+ "fold": false
231
+ },
232
+ {
233
+ "id": "api-prod",
234
+ "category": "compute.container",
235
+ "service": "ecs.fargate",
236
+ "group": "private-prod",
237
+ "count": 3,
238
+ "app": "backend",
239
+ "iac": [
240
+ "module.api.aws_ecs_service.this"
241
+ ],
242
+ "environments": [
243
+ "production"
244
+ ],
245
+ "spec": [
246
+ {
247
+ "key": "cpu",
248
+ "value": "1024"
249
+ },
250
+ {
251
+ "key": "memory",
252
+ "value": "2048"
253
+ },
254
+ {
255
+ "key": "tasks",
256
+ "value": "3"
257
+ }
258
+ ],
259
+ "label": "api-prod",
260
+ "providerResolved": "aws",
261
+ "regionResolved": "ap-northeast-1",
262
+ "managed_by": "iac",
263
+ "fold": false
264
+ },
265
+ {
266
+ "id": "api-stg",
267
+ "category": "compute.container",
268
+ "service": "ecs.fargate",
269
+ "group": "private-stg",
270
+ "app": "backend",
271
+ "environments": [
272
+ "staging"
273
+ ],
274
+ "label": "api-stg",
275
+ "count": 1,
276
+ "providerResolved": "aws",
277
+ "regionResolved": "ap-northeast-1",
278
+ "managed_by": "iac",
279
+ "fold": false
280
+ },
281
+ {
282
+ "id": "db-stg",
283
+ "category": "database.relational",
284
+ "service": "rds.mysql",
285
+ "group": "private-stg",
286
+ "engine": "mysql 8.4",
287
+ "data_doc": "docs/db",
288
+ "environments": [
289
+ "staging"
290
+ ],
291
+ "label": "db-stg",
292
+ "count": 1,
293
+ "providerResolved": "aws",
294
+ "regionResolved": "ap-northeast-1",
295
+ "managed_by": "iac",
296
+ "fold": false
297
+ },
298
+ {
299
+ "id": "assets",
300
+ "category": "storage.object",
301
+ "service": "s3",
302
+ "provider": "aws",
303
+ "region": "ap-northeast-1",
304
+ "label": "アセットのバケツ",
305
+ "count": 1,
306
+ "providerResolved": "aws",
307
+ "regionResolved": "ap-northeast-1",
308
+ "managed_by": "iac",
309
+ "fold": false,
310
+ "environments": [
311
+ "production",
312
+ "staging"
313
+ ]
314
+ },
315
+ {
316
+ "id": "api-role",
317
+ "category": "security.iam",
318
+ "service": "iam.role",
319
+ "provider": "aws",
320
+ "label": "API の実行ロール",
321
+ "count": 1,
322
+ "providerResolved": "aws",
323
+ "regionResolved": "",
324
+ "managed_by": "iac",
325
+ "fold": true,
326
+ "environments": [
327
+ "production",
328
+ "staging"
329
+ ]
330
+ },
331
+ {
332
+ "id": "api-5xx",
333
+ "category": "monitoring.alarm",
334
+ "service": "cloudwatch.alarm",
335
+ "provider": "aws",
336
+ "label": "API の 5xx",
337
+ "environments": [
338
+ "production"
339
+ ],
340
+ "count": 1,
341
+ "providerResolved": "aws",
342
+ "regionResolved": "",
343
+ "managed_by": "iac",
344
+ "fold": true
345
+ },
346
+ {
347
+ "id": "db-prod",
348
+ "category": "database.relational",
349
+ "service": "rds.postgres",
350
+ "group": "private-prod",
351
+ "ha": "multi-az",
352
+ "environments": [
353
+ "production"
354
+ ],
355
+ "spec": [
356
+ {
357
+ "key": "instance_class",
358
+ "value": "db.r6g.large"
359
+ },
360
+ {
361
+ "key": "storage_gb",
362
+ "value": "200"
363
+ }
364
+ ],
365
+ "label": "db-prod",
366
+ "count": 1,
367
+ "providerResolved": "aws",
368
+ "regionResolved": "ap-northeast-1",
369
+ "managed_by": "iac",
370
+ "fold": false
371
+ }
372
+ ],
373
+ "edges": [
374
+ {
375
+ "from": "api-prod",
376
+ "to": "stripe",
377
+ "protocol": "https",
378
+ "direction": "out",
379
+ "environments": [
380
+ "production"
381
+ ],
382
+ "crossProvider": true
383
+ },
384
+ {
385
+ "from": "api-prod",
386
+ "to": "mailer",
387
+ "protocol": "https",
388
+ "direction": "out",
389
+ "environments": [
390
+ "production"
391
+ ],
392
+ "crossProvider": true
393
+ },
394
+ {
395
+ "from": "api-stg",
396
+ "to": "stripe",
397
+ "protocol": "https",
398
+ "label": "テストモード",
399
+ "environments": [
400
+ "staging"
401
+ ],
402
+ "direction": "out",
403
+ "crossProvider": true
404
+ },
405
+ {
406
+ "from": "cdn",
407
+ "to": "alb-prod",
408
+ "protocol": "https",
409
+ "port": 443,
410
+ "environments": [
411
+ "production"
412
+ ],
413
+ "direction": "out",
414
+ "crossProvider": false
415
+ },
416
+ {
417
+ "from": "cdn",
418
+ "to": "alb-stg",
419
+ "protocol": "https",
420
+ "port": 443,
421
+ "environments": [
422
+ "staging"
423
+ ],
424
+ "direction": "out",
425
+ "crossProvider": false
426
+ },
427
+ {
428
+ "from": "alb-prod",
429
+ "to": "api-prod",
430
+ "protocol": "http",
431
+ "port": 8000,
432
+ "direction": "out",
433
+ "environments": [
434
+ "production"
435
+ ],
436
+ "crossProvider": false
437
+ },
438
+ {
439
+ "from": "alb-stg",
440
+ "to": "api-stg",
441
+ "protocol": "http",
442
+ "port": 8000,
443
+ "direction": "out",
444
+ "environments": [
445
+ "staging"
446
+ ],
447
+ "crossProvider": false
448
+ },
449
+ {
450
+ "from": "api-prod",
451
+ "to": "db-prod",
452
+ "protocol": "mysql",
453
+ "port": 3306,
454
+ "direction": "out",
455
+ "environments": [
456
+ "production"
457
+ ],
458
+ "crossProvider": false
459
+ },
460
+ {
461
+ "from": "api-stg",
462
+ "to": "db-stg",
463
+ "protocol": "mysql",
464
+ "port": 3306,
465
+ "direction": "out",
466
+ "environments": [
467
+ "staging"
468
+ ],
469
+ "crossProvider": false
470
+ },
471
+ {
472
+ "from": "cdn",
473
+ "to": "assets",
474
+ "protocol": "https",
475
+ "direction": "out",
476
+ "environments": [
477
+ "production",
478
+ "staging"
479
+ ],
480
+ "crossProvider": false
481
+ }
482
+ ],
483
+ "flows": []
484
+ },
485
+ "problems": [
486
+ {
487
+ "file": "both/removals.json",
488
+ "path": "/nodes/0",
489
+ "code": "migration.both",
490
+ "message": "node 'db-prod' is in changes too: it is replaced, not removed",
491
+ "severity": "error",
492
+ "short": "docs/infra/migrations/both/removals.json: /nodes/0 のものが、changes にも書かれています(消さずに差し替えます)(migration.both)"
493
+ }
494
+ ],
495
+ "ok": false
496
+ }
497
+ ],
498
+ "readMs": 6,
499
+ "counts": {
500
+ "groups": 8,
501
+ "nodes": 12,
502
+ "edges": 10
503
+ }
504
+ }