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,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
+ }
@@ -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,40 @@
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
+ "short": "docs/infra/load/broken.json: 1 行目の JSON が壊れています"
18
+ }
19
+ ],
20
+ "scenarios": [
21
+ {
22
+ "id": "ordinary",
23
+ "file": "ordinary.json",
24
+ "environment": "production",
25
+ "month": "2026-11",
26
+ "hours": 720,
27
+ "loads": 6,
28
+ "edges": 1
29
+ },
30
+ {
31
+ "id": "sale",
32
+ "file": "sale.json",
33
+ "environment": "production",
34
+ "month": "2026-11",
35
+ "hours": 720,
36
+ "loads": 3,
37
+ "edges": 0
38
+ }
39
+ ]
40
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "ok": true,
3
+ "dir": "docs/infra/load",
4
+ "files": [
5
+ "ordinary.json",
6
+ "sale.json"
7
+ ],
8
+ "problems": [],
9
+ "scenarios": [
10
+ {
11
+ "id": "ordinary",
12
+ "file": "ordinary.json",
13
+ "environment": "production",
14
+ "month": "2026-11",
15
+ "hours": 720,
16
+ "loads": 6,
17
+ "edges": 1
18
+ },
19
+ {
20
+ "id": "sale",
21
+ "file": "sale.json",
22
+ "environment": "production",
23
+ "month": "2026-11",
24
+ "hours": 720,
25
+ "loads": 3,
26
+ "edges": 0
27
+ }
28
+ ]
29
+ }