jui-tools-mcp-server 2.17.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 (33) hide show
  1. package/README.md +2 -2
  2. package/dist/tools/infra/infra_cost.js +65 -2
  3. package/dist/tools/infra/infra_validate.d.ts +0 -5
  4. package/dist/tools/infra/infra_validate.js +41 -4
  5. package/package.json +1 -1
  6. package/scripts/record-infra-fixtures.sh +65 -0
  7. package/src/tools/infra/infra_cost.ts +57 -2
  8. package/src/tools/infra/infra_validate.ts +39 -4
  9. package/tests/fixtures/infra/RECORDED_FROM +1 -1
  10. package/tests/fixtures/infra/answers-without-plan.json +9 -0
  11. package/tests/fixtures/infra/check-infra.json +8 -6
  12. package/tests/fixtures/infra/cost-infra.day.json +2 -2
  13. package/tests/fixtures/infra/cost-infra.month-by-node.json +10 -2
  14. package/tests/fixtures/infra/cost-infra.month.json +21 -4
  15. package/tests/fixtures/infra/cost-infra.plan-bad.json +16 -0
  16. package/tests/fixtures/infra/cost-infra.plan-move-account.json +167 -0
  17. package/tests/fixtures/infra/cost-infra.plan-move.json +174 -0
  18. package/tests/fixtures/infra/cost-infra.plan-none.json +16 -0
  19. package/tests/fixtures/infra/cost-infra.plan-shrink.json +162 -0
  20. package/tests/fixtures/infra/validate-infra-load.errors.json +2 -1
  21. package/tests/fixtures/infra/validate-infra-load.unreadable.json +1 -0
  22. package/tests/fixtures/infra/validate-infra.errors.json +6 -2
  23. package/tests/fixtures/infra/validate-infra.ok.json +1 -1
  24. package/tests/fixtures/infra/validate-infra.plan-both.json +504 -0
  25. package/tests/fixtures/infra/validate-infra.plan-duplicate.json +539 -0
  26. package/tests/fixtures/infra/validate-infra.plan-edge-end.json +539 -0
  27. package/tests/fixtures/infra/validate-infra.plan-half.json +49 -0
  28. package/tests/fixtures/infra/validate-infra.plan-move.json +506 -0
  29. package/tests/fixtures/infra/validate-infra.plan-none.json +49 -0
  30. package/tests/fixtures/infra/validate-infra.plan-order-unknown.json +539 -0
  31. package/tests/fixtures/infra/validate-infra.plan-remove-missing.json +539 -0
  32. package/tests/fixtures/infra/validate-infra.plans.json +506 -0
  33. package/tests/tools_infra.test.ts +208 -0
@@ -329,25 +329,42 @@
329
329
  }
330
330
  ],
331
331
  "noRule": [
332
- "stripe",
333
332
  "api-role"
334
333
  ],
335
- "loadUndefined": [],
334
+ "loadUndefined": [
335
+ "stripe"
336
+ ],
336
337
  "overflowHours": {},
337
338
  "warnings": [
338
339
  {
339
340
  "fn": "price_meter",
340
341
  "message": "no price for (no service) emails (email) in ap-northeast-1",
342
+ "detail": {
343
+ "keyword": "cost.no_price",
344
+ "service": "",
345
+ "sku": "emails",
346
+ "unit": "email",
347
+ "region": "ap-northeast-1"
348
+ },
341
349
  "node": "mailer",
342
350
  "hour": "2026-11-01T00",
343
- "meter": "emails"
351
+ "meter": "emails",
352
+ "short": "(service 無し) emails(email)の価格が、ap-northeast-1 にありません"
344
353
  },
345
354
  {
346
355
  "fn": "price_meter",
347
356
  "message": "no price for cloudwatch.alarm alarm (month) in no region",
357
+ "detail": {
358
+ "keyword": "cost.no_price",
359
+ "service": "cloudwatch.alarm",
360
+ "sku": "alarm",
361
+ "unit": "month",
362
+ "region": ""
363
+ },
348
364
  "node": "api-5xx",
349
365
  "hour": "2026-11-01T00",
350
- "meter": "alarm"
366
+ "meter": "alarm",
367
+ "short": "cloudwatch.alarm alarm(month)の価格が、(region 無し) にありません"
351
368
  }
352
369
  ],
353
370
  "warningCount": 2
@@ -0,0 +1,16 @@
1
+ {
2
+ "ok": false,
3
+ "reason": "bad_plan",
4
+ "message": "the plan 'both' has errors: jsonui-doc validate infra --migration both",
5
+ "problems": [
6
+ {
7
+ "file": "both/removals.json",
8
+ "path": "/nodes/0",
9
+ "code": "migration.both",
10
+ "message": "node 'db-prod' is in changes too: it is replaced, not removed",
11
+ "short": "docs/infra/migrations/both/removals.json: /nodes/0 のものが、changes にも書かれています(消さずに差し替えます)(migration.both)",
12
+ "severity": "error",
13
+ "node": null
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,167 @@
1
+ {
2
+ "ok": true,
3
+ "dir": "docs/infra/load",
4
+ "migration": "move",
5
+ "scenario": "sale",
6
+ "scenarios": [
7
+ {
8
+ "id": "ordinary",
9
+ "label": "ふだんの月",
10
+ "file": "ordinary.json",
11
+ "month": "2026-11",
12
+ "environment": "production"
13
+ },
14
+ {
15
+ "id": "sale",
16
+ "label": "セールの月",
17
+ "file": "sale.json",
18
+ "month": "2026-11",
19
+ "environment": "production"
20
+ },
21
+ {
22
+ "id": "staging",
23
+ "label": "staging",
24
+ "file": "staging.json",
25
+ "month": "2026-11",
26
+ "environment": "staging"
27
+ }
28
+ ],
29
+ "old": {
30
+ "usd": 2679.3521999999975,
31
+ "noRule": [
32
+ "api-role"
33
+ ],
34
+ "loadUndefined": [
35
+ "stripe",
36
+ "mailer",
37
+ "assets"
38
+ ],
39
+ "noPrice": [
40
+ "api-5xx"
41
+ ]
42
+ },
43
+ "new": {
44
+ "usd": 2798.7781999999993,
45
+ "noRule": [
46
+ "api-role"
47
+ ],
48
+ "loadUndefined": [
49
+ "stripe",
50
+ "mailer",
51
+ "assets"
52
+ ],
53
+ "noPrice": [
54
+ "api-5xx"
55
+ ]
56
+ },
57
+ "diff": {
58
+ "usd": 119.42600000000175
59
+ },
60
+ "unpricedChanged": [],
61
+ "byNode": [
62
+ {
63
+ "node": "worker-prod",
64
+ "change": "added",
65
+ "unpriced": false,
66
+ "old": 0.0,
67
+ "new": 88.13999999999996,
68
+ "diff": 88.13999999999996
69
+ },
70
+ {
71
+ "node": "db-prod",
72
+ "change": "replaced",
73
+ "unpriced": false,
74
+ "old": 598.2749999999991,
75
+ "new": 629.5609999999991,
76
+ "diff": 31.286000000000058
77
+ },
78
+ {
79
+ "node": "alb-prod",
80
+ "change": "same",
81
+ "unpriced": false,
82
+ "old": 17.496,
83
+ "new": 17.496,
84
+ "diff": 0.0
85
+ },
86
+ {
87
+ "node": "api-prod",
88
+ "change": "same",
89
+ "unpriced": false,
90
+ "old": 88.13999999999996,
91
+ "new": 88.13999999999996,
92
+ "diff": 0.0
93
+ },
94
+ {
95
+ "node": "api-stg",
96
+ "change": "removed",
97
+ "unpriced": false,
98
+ "old": 0.0,
99
+ "new": 0.0,
100
+ "diff": 0.0
101
+ },
102
+ {
103
+ "node": "cdn",
104
+ "change": "same",
105
+ "unpriced": false,
106
+ "old": 1975.4412000000011,
107
+ "new": 1975.4412000000011,
108
+ "diff": 0.0
109
+ }
110
+ ],
111
+ "byProvider": [
112
+ {
113
+ "provider": "aws",
114
+ "old": 2679.352199999997,
115
+ "new": 2798.778199999999,
116
+ "diff": 119.42600000000175
117
+ }
118
+ ],
119
+ "steps": [
120
+ {
121
+ "index": 1,
122
+ "node": "db-prod",
123
+ "usd": 2710.6381999999967,
124
+ "diff": 31.28599999999915,
125
+ "moved": [
126
+ {
127
+ "node": "db-prod",
128
+ "diff": 31.286000000000058
129
+ }
130
+ ]
131
+ },
132
+ {
133
+ "index": 2,
134
+ "node": "worker-prod",
135
+ "usd": 2798.7781999999993,
136
+ "diff": 88.1400000000026,
137
+ "moved": [
138
+ {
139
+ "node": "worker-prod",
140
+ "diff": 88.13999999999996
141
+ }
142
+ ]
143
+ },
144
+ {
145
+ "index": 3,
146
+ "node": "api-stg",
147
+ "usd": 2798.7781999999993,
148
+ "diff": 0.0,
149
+ "moved": []
150
+ }
151
+ ],
152
+ "account": {
153
+ "on": true,
154
+ "old": 2788.8881999999976,
155
+ "new": 2897.514199999999,
156
+ "diff": 108.62600000000157
157
+ },
158
+ "problems": {
159
+ "count": 0,
160
+ "errors": 0,
161
+ "first": []
162
+ },
163
+ "prices": {
164
+ "warnings": [],
165
+ "warningCount": 0
166
+ }
167
+ }
@@ -0,0 +1,174 @@
1
+ {
2
+ "ok": true,
3
+ "dir": "docs/infra/load",
4
+ "migration": "move",
5
+ "scenario": "ordinary",
6
+ "scenarios": [
7
+ {
8
+ "id": "ordinary",
9
+ "label": "ふだんの月",
10
+ "file": "ordinary.json",
11
+ "month": "2026-11",
12
+ "environment": "production"
13
+ },
14
+ {
15
+ "id": "sale",
16
+ "label": "セールの月",
17
+ "file": "sale.json",
18
+ "month": "2026-11",
19
+ "environment": "production"
20
+ },
21
+ {
22
+ "id": "staging",
23
+ "label": "staging",
24
+ "file": "staging.json",
25
+ "month": "2026-11",
26
+ "environment": "staging"
27
+ }
28
+ ],
29
+ "old": {
30
+ "usd": 1018.5974779999989,
31
+ "noRule": [
32
+ "api-role"
33
+ ],
34
+ "loadUndefined": [
35
+ "stripe"
36
+ ],
37
+ "noPrice": [
38
+ "api-5xx",
39
+ "mailer"
40
+ ]
41
+ },
42
+ "new": {
43
+ "usd": 1040.1974779999987,
44
+ "noRule": [
45
+ "api-role"
46
+ ],
47
+ "loadUndefined": [
48
+ "stripe"
49
+ ],
50
+ "noPrice": [
51
+ "api-5xx",
52
+ "mailer",
53
+ "worker-prod"
54
+ ]
55
+ },
56
+ "diff": {
57
+ "usd": 21.599999999999795
58
+ },
59
+ "unpricedChanged": [
60
+ "worker-prod"
61
+ ],
62
+ "byNode": [
63
+ {
64
+ "node": "db-prod",
65
+ "change": "replaced",
66
+ "unpriced": false,
67
+ "old": 422.3999999999987,
68
+ "new": 443.99999999999915,
69
+ "diff": 21.60000000000042
70
+ },
71
+ {
72
+ "node": "alb-prod",
73
+ "change": "same",
74
+ "unpriced": false,
75
+ "old": 29.015999999999977,
76
+ "new": 29.015999999999977,
77
+ "diff": 0.0
78
+ },
79
+ {
80
+ "node": "api-prod",
81
+ "change": "same",
82
+ "unpriced": false,
83
+ "old": 64.80000000000005,
84
+ "new": 64.80000000000005,
85
+ "diff": 0.0
86
+ },
87
+ {
88
+ "node": "api-prod>db-prod",
89
+ "change": "same",
90
+ "unpriced": false,
91
+ "old": 2.3447999999999984,
92
+ "new": 2.3447999999999984,
93
+ "diff": 0.0
94
+ },
95
+ {
96
+ "node": "api-stg",
97
+ "change": "removed",
98
+ "unpriced": false,
99
+ "old": 0.0,
100
+ "new": 0.0,
101
+ "diff": 0.0
102
+ },
103
+ {
104
+ "node": "assets",
105
+ "change": "same",
106
+ "unpriced": false,
107
+ "old": 44.55927800000017,
108
+ "new": 44.55927800000017,
109
+ "diff": 0.0
110
+ },
111
+ {
112
+ "node": "cdn",
113
+ "change": "same",
114
+ "unpriced": false,
115
+ "old": 455.4774000000002,
116
+ "new": 455.4774000000002,
117
+ "diff": 0.0
118
+ },
119
+ {
120
+ "node": "worker-prod",
121
+ "change": "added",
122
+ "unpriced": true,
123
+ "old": 0.0,
124
+ "new": 0.0,
125
+ "diff": 0.0
126
+ }
127
+ ],
128
+ "byProvider": [
129
+ {
130
+ "provider": "aws",
131
+ "old": 1018.5974779999992,
132
+ "new": 1040.1974779999987,
133
+ "diff": 21.599999999999454
134
+ }
135
+ ],
136
+ "steps": [
137
+ {
138
+ "index": 1,
139
+ "node": "db-prod",
140
+ "usd": 1040.1974779999987,
141
+ "diff": 21.599999999999795,
142
+ "moved": [
143
+ {
144
+ "node": "db-prod",
145
+ "diff": 21.60000000000042
146
+ }
147
+ ]
148
+ },
149
+ {
150
+ "index": 2,
151
+ "node": "worker-prod",
152
+ "usd": 1040.1974779999987,
153
+ "diff": 0.0,
154
+ "moved": []
155
+ },
156
+ {
157
+ "index": 3,
158
+ "node": "api-stg",
159
+ "usd": 1040.1974779999987,
160
+ "diff": 0.0,
161
+ "moved": []
162
+ }
163
+ ],
164
+ "account": null,
165
+ "problems": {
166
+ "count": 0,
167
+ "errors": 0,
168
+ "first": []
169
+ },
170
+ "prices": {
171
+ "warnings": [],
172
+ "warningCount": 0
173
+ }
174
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "ok": false,
3
+ "reason": "no_plan",
4
+ "message": "no plan 'nope'",
5
+ "problems": [
6
+ {
7
+ "file": "nope",
8
+ "path": "/",
9
+ "code": "migration.no_plan",
10
+ "message": "no plan 'nope' in docs/infra/migrations",
11
+ "short": "docs/infra/migrations/nope: / という計画がありません(migration.no_plan)",
12
+ "severity": "error",
13
+ "node": null
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,162 @@
1
+ {
2
+ "ok": true,
3
+ "dir": "docs/infra/load",
4
+ "migration": "shrink",
5
+ "scenario": "ordinary",
6
+ "scenarios": [
7
+ {
8
+ "id": "ordinary",
9
+ "label": "ふだんの月",
10
+ "file": "ordinary.json",
11
+ "month": "2026-11",
12
+ "environment": "production"
13
+ },
14
+ {
15
+ "id": "sale",
16
+ "label": "セールの月",
17
+ "file": "sale.json",
18
+ "month": "2026-11",
19
+ "environment": "production"
20
+ }
21
+ ],
22
+ "old": {
23
+ "usd": 1033.0335079999993,
24
+ "noRule": [
25
+ "api-role"
26
+ ],
27
+ "loadUndefined": [
28
+ "stripe"
29
+ ],
30
+ "noPrice": [
31
+ "api-5xx",
32
+ "mailer"
33
+ ]
34
+ },
35
+ "new": {
36
+ "usd": 783.4526779999998,
37
+ "noRule": [
38
+ "api-role"
39
+ ],
40
+ "loadUndefined": [
41
+ "stripe"
42
+ ],
43
+ "noPrice": [
44
+ "api-5xx",
45
+ "mailer"
46
+ ]
47
+ },
48
+ "diff": {
49
+ "usd": -249.58082999999954
50
+ },
51
+ "unpricedChanged": [],
52
+ "byNode": [
53
+ {
54
+ "node": "db-prod",
55
+ "change": "replaced",
56
+ "unpriced": false,
57
+ "old": 422.3999999999987,
58
+ "new": 243.59999999999954,
59
+ "diff": -178.7999999999992
60
+ },
61
+ {
62
+ "node": "api-prod",
63
+ "change": "removed",
64
+ "unpriced": false,
65
+ "old": 64.80000000000005,
66
+ "new": 0.0,
67
+ "diff": -64.80000000000005
68
+ },
69
+ {
70
+ "node": "batch-prod",
71
+ "change": "same",
72
+ "unpriced": false,
73
+ "old": 14.436030000000027,
74
+ "new": 10.800000000000002,
75
+ "diff": -3.6360300000000247
76
+ },
77
+ {
78
+ "node": "api-prod>db-prod",
79
+ "change": "same",
80
+ "unpriced": false,
81
+ "old": 2.3447999999999984,
82
+ "new": 0.0,
83
+ "diff": -2.3447999999999984
84
+ },
85
+ {
86
+ "node": "alb-prod",
87
+ "change": "same",
88
+ "unpriced": false,
89
+ "old": 29.015999999999977,
90
+ "new": 29.015999999999977,
91
+ "diff": 0.0
92
+ },
93
+ {
94
+ "node": "assets",
95
+ "change": "same",
96
+ "unpriced": false,
97
+ "old": 44.55927800000017,
98
+ "new": 44.55927800000017,
99
+ "diff": 0.0
100
+ },
101
+ {
102
+ "node": "cdn",
103
+ "change": "same",
104
+ "unpriced": false,
105
+ "old": 455.4774000000002,
106
+ "new": 455.4774000000002,
107
+ "diff": 0.0
108
+ }
109
+ ],
110
+ "byProvider": [
111
+ {
112
+ "provider": "aws",
113
+ "old": 1033.0335079999993,
114
+ "new": 783.4526780000001,
115
+ "diff": -249.5808299999992
116
+ }
117
+ ],
118
+ "steps": [
119
+ {
120
+ "index": 1,
121
+ "node": "db-prod",
122
+ "usd": 854.2335079999995,
123
+ "diff": -178.79999999999984,
124
+ "moved": [
125
+ {
126
+ "node": "db-prod",
127
+ "diff": -178.7999999999992
128
+ }
129
+ ]
130
+ },
131
+ {
132
+ "index": 2,
133
+ "node": "api-prod",
134
+ "usd": 783.4526779999998,
135
+ "diff": -70.7808299999997,
136
+ "moved": [
137
+ {
138
+ "node": "api-prod",
139
+ "diff": -64.80000000000005
140
+ },
141
+ {
142
+ "node": "batch-prod",
143
+ "diff": -3.6360300000000247
144
+ },
145
+ {
146
+ "node": "api-prod>db-prod",
147
+ "diff": -2.3447999999999984
148
+ }
149
+ ]
150
+ }
151
+ ],
152
+ "account": null,
153
+ "problems": {
154
+ "count": 0,
155
+ "errors": 0,
156
+ "first": []
157
+ },
158
+ "prices": {
159
+ "warnings": [],
160
+ "warningCount": 0
161
+ }
162
+ }
@@ -13,7 +13,8 @@
13
13
  "message": "not JSON (line 1, column 2)",
14
14
  "severity": "error",
15
15
  "fn": "read_file",
16
- "line": 1
16
+ "line": 1,
17
+ "short": "docs/infra/load/broken.json: 1 行目の JSON が壊れています"
17
18
  }
18
19
  ],
19
20
  "scenarios": [
@@ -2,5 +2,6 @@
2
2
  "ok": false,
3
3
  "reason": "no_infra",
4
4
  "message": "the infra model cannot be read: no model files in docs/infra (*.json)",
5
+ "short": "docs/infra に infra のファイル(*.json)がありません",
5
6
  "problems": []
6
7
  }
@@ -26,11 +26,15 @@
26
26
  "code": "schema",
27
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
28
  "severity": "error",
29
- "short": "docs/infra/bad.json: /nodes/0/category がスキーマに合いません"
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 のどれかです"
30
34
  }
31
35
  ],
32
36
  "icons": {},
33
- "readMs": 2,
37
+ "readMs": 5,
34
38
  "counts": {
35
39
  "groups": 8,
36
40
  "nodes": 12,
@@ -21,7 +21,7 @@
21
21
  "flows": [],
22
22
  "problems": [],
23
23
  "icons": {},
24
- "readMs": 2,
24
+ "readMs": 5,
25
25
  "counts": {
26
26
  "groups": 8,
27
27
  "nodes": 12,