poker-mcp 1.0.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 (50) hide show
  1. package/README.md +241 -0
  2. package/config/mcp-manifest.json +1713 -0
  3. package/config/package-lock.json +1335 -0
  4. package/config/poker_mcp.code-workspace +8 -0
  5. package/package.json +51 -0
  6. package/src/config/ConfigManager.js +120 -0
  7. package/src/config/default.json +62 -0
  8. package/src/mcp/handlers/bodyHandlers.js +63 -0
  9. package/src/mcp/handlers/buildupFactorHandlers.js +43 -0
  10. package/src/mcp/handlers/calculationHandlers.js +265 -0
  11. package/src/mcp/handlers/detectorHandlers.js +201 -0
  12. package/src/mcp/handlers/index.js +43 -0
  13. package/src/mcp/handlers/sourceHandlers.js +25 -0
  14. package/src/mcp/handlers/transformHandlers.js +26 -0
  15. package/src/mcp/handlers/unitHandlers.js +305 -0
  16. package/src/mcp/handlers/zoneHandlers.js +83 -0
  17. package/src/mcp/middleware/errorHandler.js +49 -0
  18. package/src/mcp/middleware/requestValidator.js +129 -0
  19. package/src/mcp/server.js +76 -0
  20. package/src/mcp/tools/bodyTools.js +185 -0
  21. package/src/mcp/tools/buildupFactorTools.js +82 -0
  22. package/src/mcp/tools/calculationTools.js +58 -0
  23. package/src/mcp/tools/commonTools.js +22 -0
  24. package/src/mcp/tools/detectorTools.js +131 -0
  25. package/src/mcp/tools/index.js +34 -0
  26. package/src/mcp/tools/sourceTools.js +726 -0
  27. package/src/mcp/tools/sourceTools_fixed_part2.js +41 -0
  28. package/src/mcp/tools/transformTools.js +73 -0
  29. package/src/mcp/tools/unitTools.js +137 -0
  30. package/src/mcp/tools/zoneTools.js +65 -0
  31. package/src/mcp_server_stdio_v4.js +45 -0
  32. package/src/routes/restApi.js +184 -0
  33. package/src/services/CalculationService.js +525 -0
  34. package/src/services/DataManager.js +738 -0
  35. package/src/services/TaskManager.js +1622 -0
  36. package/src/utils/MaterialAlternatives.js +189 -0
  37. package/src/utils/errorHandler.js +68 -0
  38. package/src/utils/errors.js +37 -0
  39. package/src/utils/logger.js +24 -0
  40. package/src/utils/logger_no_color.js +28 -0
  41. package/src/utils/mcpErrors.js +225 -0
  42. package/src/validators/CMBValidator.js +191 -0
  43. package/src/validators/DetectorValidator.js +512 -0
  44. package/src/validators/ManifestValidator.js +249 -0
  45. package/src/validators/NuclideValidator.js +171 -0
  46. package/src/validators/PhysicsValidator.js +401 -0
  47. package/src/validators/PhysicsValidatorSimple.js +87 -0
  48. package/src/validators/SourceValidator.js +515 -0
  49. package/src/validators/TransformValidator.js +472 -0
  50. package/src/validators/UnitValidator.js +562 -0
@@ -0,0 +1,1713 @@
1
+ {
2
+ "name": "poker-mcp",
3
+ "version": "1.0.0",
4
+ "description": "YAML-based input file management tool for radiation shielding calculation code POKER with MCP support",
5
+ "author": "Yoshihiro Hirao",
6
+ "license": "ISC",
7
+ "homepage": "http://localhost:3020",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/Hirao-Y/poker_mcp"
11
+ },
12
+ "mcp_version": "1.0.0",
13
+ "server": {
14
+ "name": "poker-mcp-server",
15
+ "version": "1.0.0",
16
+ "description": "Complete Poker MCP Server v1.0.0 - 24メソッド実装版",
17
+ "port": 3020,
18
+ "features": [
19
+ "24メソッド完全実装",
20
+ "Body操作系: 作成・更新・削除",
21
+ "Zone操作系: 作成・更新・削除",
22
+ "BuildupFactor操作系: 作成・更新・削除・順序変更",
23
+ "Transform操作系: 作成・更新・削除",
24
+ "Source操作系: 作成・更新・削除",
25
+ "Detector操作系: 作成・更新・削除",
26
+ "立体10タイプ完全対応",
27
+ "材料13種類完全対応",
28
+ "Unit操作系: 作成・更新・取得(削除不可)",
29
+ "単位設定4キー完全性保証 (length, angle, density, radioactivity)",
30
+ "単位データ自動修復機能",
31
+ "読み込み時unit整合性チェック",
32
+ "unit セクション一意性強制",
33
+ "物理係数計算機能強化",
34
+ "依存関係チェック機能",
35
+ "実際のYAMLファイル更新",
36
+ "自動バックアップ・ロールバック機能",
37
+ "完全なエラーハンドリング",
38
+ "JSON-RPC 2.0完全準拠"
39
+ ]
40
+ },
41
+ "endpoints": {
42
+ "jsonrpc": "/mcp",
43
+ "root": "/",
44
+ "health": "/health"
45
+ },
46
+ "capabilities": {
47
+ "real_data_update": true,
48
+ "automatic_backup": true,
49
+ "error_handling": "complete",
50
+ "validation": "comprehensive",
51
+ "production_ready": true,
52
+ "parameter_validation": "enhanced",
53
+ "conditional_parameters": true,
54
+ "structured_geometry": true,
55
+ "structured_division": true,
56
+ "body_operations": true,
57
+ "zone_operations": true,
58
+ "buildup_factor_operations": true,
59
+ "transform_operations": true,
60
+ "source_operations": true,
61
+ "detector_operations": true,
62
+ "dependency_checking": true,
63
+ "order_management": true,
64
+ "unit_operations": true,
65
+ "unit_completeness_guarantee": true,
66
+ "unit_auto_repair": true,
67
+ "unit_validation": "comprehensive",
68
+ "unit_uniqueness_enforcement": true,
69
+ "auto_data_repair": true,
70
+ "unit_section_integrity": "guaranteed",
71
+ "default_value_compensation": true,
72
+ "load_time_validation": true,
73
+ "rollback_support": true,
74
+ "atmosphere_zone_management": true,
75
+ "reserved_keyword_validation": true
76
+ },
77
+ "tools": [
78
+ {
79
+ "name": "poker_proposeBody",
80
+ "description": "新しい3D立体を提案します(自動バックアップ付き)",
81
+ "parameters": {
82
+ "type": "object",
83
+ "properties": {
84
+ "name": {
85
+ "$ref": "#/definitions/object_name",
86
+ "description": "立体の一意な名前(ATMOSPHERE は予約語のため使用不可)"
87
+ },
88
+ "type": {
89
+ "type": "string",
90
+ "description": "立体タイプ",
91
+ "enum": ["SPH", "RCC", "RPP", "BOX", "CMB", "TOR", "ELL", "REC", "TRC", "WED"]
92
+ },
93
+ "center": {
94
+ "$ref": "#/definitions/coordinate_string",
95
+ "description": "中心座標 (x y z形式) - SPH,ELL,TOR用"
96
+ },
97
+ "radius": {
98
+ "$ref": "#/definitions/positive_radius",
99
+ "description": "半径 - SPH, RCC用"
100
+ },
101
+ "bottom_center": {
102
+ "$ref": "#/definitions/coordinate_string",
103
+ "description": "底面中心座標 (x y z形式) - RCC,TRC,REC用"
104
+ },
105
+ "height_vector": {
106
+ "$ref": "#/definitions/coordinate_string",
107
+ "description": "高さベクトル (x y z形式) - RCC,TRC,REC用"
108
+ },
109
+ "min": {
110
+ "$ref": "#/definitions/coordinate_string",
111
+ "description": "最小座標 (x y z形式) - RPP用"
112
+ },
113
+ "max": {
114
+ "$ref": "#/definitions/coordinate_string",
115
+ "description": "最大座標 (x y z形式) - RPP用"
116
+ },
117
+ "vertex": {
118
+ "$ref": "#/definitions/coordinate_string",
119
+ "description": "頂点座標 (x y z形式) - BOX,WED用"
120
+ },
121
+ "edge_1": {
122
+ "$ref": "#/definitions/coordinate_string",
123
+ "description": "エッジ1ベクトル (x y z形式) - BOX用"
124
+ },
125
+ "edge_2": {
126
+ "$ref": "#/definitions/coordinate_string",
127
+ "description": "エッジ2ベクトル (x y z形式) - BOX用"
128
+ },
129
+ "edge_3": {
130
+ "$ref": "#/definitions/coordinate_string",
131
+ "description": "エッジ3ベクトル (x y z形式) - BOX用"
132
+ },
133
+ "expression": {
134
+ "type": "string",
135
+ "description": "集合演算式(CMB用)\n構文: 立体名を演算子で結合\n演算子: + (UNION), - (DIFFERENCE), & (INTERSECTION)\n優先順位: 括弧()で指定可能\n⚠️ 制約: 演算式で参照する立体名は事前に定義済みである必要があります\n例: 'cylinder + sphere', 'box1 - (cylinder & sphere)', '(body1 + body2) - body3'",
136
+ "minLength": 3,
137
+ "maxLength": 500,
138
+ "pattern": "^[a-zA-Z0-9_()\\s+\\-&]+$",
139
+ "constraint": "referenced_bodies_must_exist",
140
+ "validation": {
141
+ "body_existence_check": "演算式内の全立体名存在確認",
142
+ "circular_reference_check": "循環参照の検出",
143
+ "error_on_missing": "-32031エラー"
144
+ }
145
+ },
146
+ "normal": {
147
+ "$ref": "#/definitions/coordinate_string",
148
+ "description": "法線ベクトル (x y z形式) - TOR用"
149
+ },
150
+ "major_radius": {
151
+ "$ref": "#/definitions/positive_radius",
152
+ "description": "主半径 - TOR用"
153
+ },
154
+ "minor_radius_horizontal": {
155
+ "$ref": "#/definitions/positive_radius",
156
+ "description": "水平方向副半径 - TOR用"
157
+ },
158
+ "minor_radius_vertical": {
159
+ "$ref": "#/definitions/positive_radius",
160
+ "description": "垂直方向副半径 - TOR用"
161
+ },
162
+ "radius_vector_1": {
163
+ "$ref": "#/definitions/coordinate_string",
164
+ "description": "半径ベクトル1 (x y z形式) - ELL,REC用"
165
+ },
166
+ "radius_vector_2": {
167
+ "$ref": "#/definitions/coordinate_string",
168
+ "description": "半径ベクトル2 (x y z形式) - ELL,REC用"
169
+ },
170
+ "radius_vector_3": {
171
+ "$ref": "#/definitions/coordinate_string",
172
+ "description": "半径ベクトル3 (x y z形式) - ELL用"
173
+ },
174
+ "bottom_radius": {
175
+ "$ref": "#/definitions/positive_radius",
176
+ "description": "底面半径 - TRC用"
177
+ },
178
+ "top_radius": {
179
+ "$ref": "#/definitions/positive_radius",
180
+ "description": "上面半径 - TRC用"
181
+ },
182
+ "width_vector": {
183
+ "$ref": "#/definitions/coordinate_string",
184
+ "description": "幅ベクトル (x y z形式) - WED用"
185
+ },
186
+ "depth_vector": {
187
+ "$ref": "#/definitions/coordinate_string",
188
+ "description": "奥行きベクトル (x y z形式) - WED用"
189
+ },
190
+ "transform": {
191
+ "$ref": "#/definitions/transform_reference",
192
+ "description": "適用する変換名"
193
+ }
194
+ },
195
+ "required": ["name", "type"],
196
+ "additionalProperties": false
197
+ }
198
+ },
199
+ {
200
+ "name": "poker_updateBody",
201
+ "description": "既存立体のパラメータを更新します",
202
+ "parameters": {
203
+ "type": "object",
204
+ "properties": {
205
+ "name": {
206
+ "$ref": "#/definitions/object_name",
207
+ "description": "更新する立体名"
208
+ },
209
+ "center": {
210
+ "$ref": "#/definitions/coordinate_string",
211
+ "description": "新しい中心座標 (x y z形式)"
212
+ },
213
+ "radius": {
214
+ "$ref": "#/definitions/positive_radius",
215
+ "description": "新しい半径"
216
+ },
217
+ "bottom_center": {
218
+ "$ref": "#/definitions/coordinate_string",
219
+ "description": "新しい底面中心座標 (x y z形式)"
220
+ },
221
+ "height_vector": {
222
+ "$ref": "#/definitions/coordinate_string",
223
+ "description": "新しい高さベクトル (x y z形式)"
224
+ },
225
+ "min": {
226
+ "$ref": "#/definitions/coordinate_string",
227
+ "description": "新しい最小座標 (x y z形式)"
228
+ },
229
+ "max": {
230
+ "$ref": "#/definitions/coordinate_string",
231
+ "description": "新しい最大座標 (x y z形式)"
232
+ },
233
+ "normal": {
234
+ "$ref": "#/definitions/coordinate_string",
235
+ "description": "新しい法線ベクトル (x y z形式)"
236
+ },
237
+ "major_radius": {
238
+ "$ref": "#/definitions/positive_radius",
239
+ "description": "新しい主半径"
240
+ },
241
+ "minor_radius_horizontal": {
242
+ "$ref": "#/definitions/positive_radius",
243
+ "description": "新しい水平方向副半径"
244
+ },
245
+ "minor_radius_vertical": {
246
+ "$ref": "#/definitions/positive_radius",
247
+ "description": "新しい垂直方向副半径"
248
+ },
249
+ "radius_vector_1": {
250
+ "$ref": "#/definitions/coordinate_string",
251
+ "description": "新しい半径ベクトル1 (x y z形式)"
252
+ },
253
+ "radius_vector_2": {
254
+ "$ref": "#/definitions/coordinate_string",
255
+ "description": "新しい半径ベクトル2 (x y z形式)"
256
+ },
257
+ "radius_vector_3": {
258
+ "$ref": "#/definitions/coordinate_string",
259
+ "description": "新しい半径ベクトル3 (x y z形式)"
260
+ },
261
+ "bottom_radius": {
262
+ "$ref": "#/definitions/positive_radius",
263
+ "description": "新しい底面半径"
264
+ },
265
+ "top_radius": {
266
+ "$ref": "#/definitions/positive_radius",
267
+ "description": "新しい上面半径"
268
+ },
269
+ "width_vector": {
270
+ "$ref": "#/definitions/coordinate_string",
271
+ "description": "新しい幅ベクトル (x y z形式)"
272
+ },
273
+ "depth_vector": {
274
+ "$ref": "#/definitions/coordinate_string",
275
+ "description": "新しい奥行きベクトル (x y z形式)"
276
+ },
277
+ "transform": {
278
+ "$ref": "#/definitions/transform_reference",
279
+ "description": "適用する変換名"
280
+ }
281
+ },
282
+ "required": ["name"],
283
+ "additionalProperties": false
284
+ }
285
+ },
286
+ {
287
+ "name": "poker_deleteBody",
288
+ "description": "立体を削除します(依存関係チェック付き)",
289
+ "parameters": {
290
+ "type": "object",
291
+ "properties": {
292
+ "name": {
293
+ "type": "string",
294
+ "description": "削除する立体名",
295
+ "pattern": "^[a-zA-Z0-9_]+$",
296
+ "maxLength": 50
297
+ }
298
+ },
299
+ "required": ["name"],
300
+ "additionalProperties": false
301
+ }
302
+ },
303
+ {
304
+ "name": "poker_proposeZone",
305
+ "description": "材料ゾーンを提案します(物理検証付き)",
306
+ "parameters": {
307
+ "type": "object",
308
+ "properties": {
309
+ "body_name": {
310
+ "$ref": "#/definitions/object_name",
311
+ "description": "ゾーンが適用される立体名"
312
+ },
313
+ "material": {
314
+ "$ref": "#/definitions/supported_material",
315
+ "description": "材料名"
316
+ },
317
+ "density": {
318
+ "$ref": "#/definitions/density_value",
319
+ "description": "密度 (g/cm³) - VOID材料では指定禁止、その他材料では必須"
320
+ }
321
+ },
322
+ "required": ["body_name", "material"],
323
+ "additionalProperties": false
324
+ }
325
+ },
326
+ {
327
+ "name": "poker_updateZone",
328
+ "description": "既存ゾーンの材料や密度を更新します",
329
+ "parameters": {
330
+ "type": "object",
331
+ "properties": {
332
+ "body_name": {
333
+ "type": "string",
334
+ "description": "更新するゾーンの立体名",
335
+ "pattern": "^[a-zA-Z0-9_]+$",
336
+ "maxLength": 50
337
+ },
338
+ "material": {
339
+ "$ref": "#/definitions/supported_material",
340
+ "description": "新しい材料名"
341
+ },
342
+ "density": {
343
+ "type": "number",
344
+ "description": "新しい密度 (g/cm³)",
345
+ "minimum": 0.001,
346
+ "maximum": 30.0
347
+ }
348
+ },
349
+ "required": ["body_name"],
350
+ "additionalProperties": false
351
+ }
352
+ },
353
+ {
354
+ "name": "poker_deleteZone",
355
+ "description": "ゾーンを削除します(ATMOSPHERE以外)",
356
+ "parameters": {
357
+ "type": "object",
358
+ "properties": {
359
+ "body_name": {
360
+ "type": "string",
361
+ "description": "削除するゾーンの立体名(ATMOSPHERE は削除不可)",
362
+ "pattern": "^[a-zA-Z0-9_]+$",
363
+ "maxLength": 50
364
+ }
365
+ },
366
+ "required": ["body_name"],
367
+ "additionalProperties": false
368
+ }
369
+ },
370
+ {
371
+ "name": "poker_proposeBuildupFactor",
372
+ "description": "ビルドアップ係数を提案します(物理計算パラメータ付き)",
373
+ "parameters": {
374
+ "type": "object",
375
+ "properties": {
376
+ "material": {
377
+ "$ref": "#/definitions/supported_material",
378
+ "description": "材料名",
379
+ "examples": ["Concrete", "Lead", "Iron"]
380
+ },
381
+ "use_slant_correction": {
382
+ "type": "boolean",
383
+ "description": "スラント補正を使用するか(斜め入射補正)",
384
+ "default": false,
385
+ "note": "高精度計算時に有効"
386
+ },
387
+ "use_finite_medium_correction": {
388
+ "type": "boolean",
389
+ "description": "有限媒体補正を使用するか(境界効果補正)",
390
+ "default": false,
391
+ "note": "薄い遮蔽体での精度向上"
392
+ }
393
+ },
394
+ "required": ["material", "use_slant_correction", "use_finite_medium_correction"],
395
+ "additionalProperties": false
396
+ },
397
+ "validation": {
398
+ "material_uniqueness": "材料の重複チェック",
399
+ "correction_combination": "補正組み合わせの物理妥当性チェック",
400
+ "calculation_impact": "計算コストへの影響評価"
401
+ }
402
+ },
403
+ {
404
+ "name": "poker_updateBuildupFactor",
405
+ "description": "既存ビルドアップ係数の設定を更新します(計算精度パラメータ変更)",
406
+ "parameters": {
407
+ "type": "object",
408
+ "properties": {
409
+ "material": {
410
+ "$ref": "#/definitions/supported_material",
411
+ "description": "更新する材料名",
412
+ "pattern": "^[A-Za-z]+$",
413
+ "maxLength": 20
414
+ },
415
+ "use_slant_correction": {
416
+ "type": "boolean",
417
+ "description": "新しいスラント補正設定(斜め入射時の補正)",
418
+ "note": "変更により計算精度と処理時間が変化"
419
+ },
420
+ "use_finite_medium_correction": {
421
+ "type": "boolean",
422
+ "description": "新しい有限媒体補正設定(境界効果の補正)",
423
+ "note": "薄い遮蔽材での精度向上効果"
424
+ }
425
+ },
426
+ "required": ["material"],
427
+ "additionalProperties": false
428
+ },
429
+ "validation": {
430
+ "existence_check": "材料の存在確認",
431
+ "parameter_combination": "補正パラメータの組み合わせ妥当性",
432
+ "calculation_consistency": "計算設定の一貫性チェック"
433
+ }
434
+ },
435
+ {
436
+ "name": "poker_deleteBuildupFactor",
437
+ "description": "ビルドアップ係数を削除します(計算から除外)",
438
+ "parameters": {
439
+ "type": "object",
440
+ "properties": {
441
+ "material": {
442
+ "$ref": "#/definitions/supported_material",
443
+ "description": "削除する材料名",
444
+ "pattern": "^[A-Za-z]+$",
445
+ "maxLength": 20
446
+ }
447
+ },
448
+ "required": ["material"],
449
+ "additionalProperties": false
450
+ },
451
+ "validation": {
452
+ "existence_check": "ビルドアップ係数の存在確認",
453
+ "usage_dependency": "計算での使用状況チェック",
454
+ "safety_check": "削除の安全性確認"
455
+ }
456
+ },
457
+ {
458
+ "name": "poker_changeOrderBuildupFactor",
459
+ "description": "ビルドアップ係数の計算順序を変更します(物理計算最適化)",
460
+ "parameters": {
461
+ "type": "object",
462
+ "properties": {
463
+ "material": {
464
+ "$ref": "#/definitions/supported_material",
465
+ "description": "順序を変更する材料名",
466
+ "pattern": "^[A-Za-z]+$",
467
+ "maxLength": 20
468
+ },
469
+ "newIndex": {
470
+ "$ref": "#/definitions/buildup_index",
471
+ "description": "新しいインデックス位置(0から開始)",
472
+ "note": "小さい値ほど優先度が高い"
473
+ }
474
+ },
475
+ "required": ["material", "newIndex"],
476
+ "additionalProperties": false
477
+ },
478
+ "validation": {
479
+ "existence_check": "材料の存在確認",
480
+ "index_range": "インデックス範囲の妥当性チェック",
481
+ "order_conflict": "順序変更による影響の評価"
482
+ }
483
+ },
484
+ {
485
+ "name": "poker_proposeTransform",
486
+ "description": "回転・移動変換を提案します(立体の幾何変換)",
487
+ "parameters": {
488
+ "type": "object",
489
+ "properties": {
490
+ "name": {
491
+ "$ref": "#/definitions/object_name",
492
+ "description": "変換の一意な名前"
493
+ },
494
+ "operations": {
495
+ "type": "array",
496
+ "description": "変換操作の配列(順序あり)",
497
+ "minItems": 1,
498
+ "items": {
499
+ "type": "object",
500
+ "properties": {
501
+ "translate": {
502
+ "$ref": "#/definitions/coordinate_string",
503
+ "description": "平行移動ベクトル (x y z形式)"
504
+ },
505
+ "rotate_around_x": {
506
+ "$ref": "#/definitions/rotation_angle",
507
+ "description": "X軸周りの回転角度(度)"
508
+ },
509
+ "rotate_around_y": {
510
+ "$ref": "#/definitions/rotation_angle",
511
+ "description": "Y軸周りの回転角度(度)"
512
+ },
513
+ "rotate_around_z": {
514
+ "$ref": "#/definitions/rotation_angle",
515
+ "description": "Z軸周りの回転角度(度)"
516
+ }
517
+ },
518
+ "note": "各操作は排他的(一つのオブジェクトに一つの操作のみ)"
519
+ }
520
+ }
521
+ },
522
+ "required": ["name", "operations"],
523
+ "additionalProperties": false
524
+ },
525
+ "validation": {
526
+ "name_uniqueness": "変換名の重複チェック",
527
+ "operation_sequence": "操作順序の妥当性チェック",
528
+ "geometric_validity": "幾何学的妥当性の確認"
529
+ }
530
+ },
531
+ {
532
+ "name": "poker_updateTransform",
533
+ "description": "既存変換の操作を更新します(幾何変換の再設定)",
534
+ "parameters": {
535
+ "type": "object",
536
+ "properties": {
537
+ "name": {
538
+ "type": "string",
539
+ "description": "更新する変換名",
540
+ "pattern": "^[a-zA-Z0-9_]+$",
541
+ "maxLength": 50
542
+ },
543
+ "operations": {
544
+ "type": "array",
545
+ "description": "新しい変換操作の配列",
546
+ "minItems": 1,
547
+ "items": {
548
+ "type": "object",
549
+ "properties": {
550
+ "translate": {
551
+ "$ref": "#/definitions/coordinate_string",
552
+ "description": "平行移動ベクトル (x y z形式)"
553
+ },
554
+ "rotate_around_x": {
555
+ "$ref": "#/definitions/rotation_angle",
556
+ "description": "X軸周りの回転角度(度)"
557
+ },
558
+ "rotate_around_y": {
559
+ "$ref": "#/definitions/rotation_angle",
560
+ "description": "Y軸周りの回転角度(度)"
561
+ },
562
+ "rotate_around_z": {
563
+ "$ref": "#/definitions/rotation_angle",
564
+ "description": "Z軸周りの回転角度(度)"
565
+ }
566
+ }
567
+ }
568
+ }
569
+ },
570
+ "required": ["name"],
571
+ "additionalProperties": false
572
+ },
573
+ "validation": {
574
+ "existence_check": "変換の存在確認",
575
+ "operation_validity": "操作パラメータの妥当性チェック",
576
+ "usage_impact": "変換更新の影響範囲確認"
577
+ }
578
+ },
579
+ {
580
+ "name": "poker_deleteTransform",
581
+ "description": "変換を削除します(依存関係チェック付き)",
582
+ "parameters": {
583
+ "type": "object",
584
+ "properties": {
585
+ "name": {
586
+ "type": "string",
587
+ "description": "削除する変換名",
588
+ "pattern": "^[a-zA-Z0-9_]+$",
589
+ "maxLength": 50
590
+ }
591
+ },
592
+ "required": ["name"],
593
+ "additionalProperties": false
594
+ },
595
+ "validation": {
596
+ "existence_check": "変換の存在確認",
597
+ "dependency_check": "依存する立体の確認",
598
+ "safety_validation": "削除の安全性確認"
599
+ },
600
+ "warnings": {
601
+ "dependency_impact": "依存する立体がある場合は削除できません"
602
+ }
603
+ },
604
+ {
605
+ "name": "poker_proposeSource",
606
+ "description": "新しい線源を提案します",
607
+ "parameters": {
608
+ "type": "object",
609
+ "properties": {
610
+ "name": {
611
+ "$ref": "#/definitions/object_name",
612
+ "description": "線源の名前(一意である必要があります)"
613
+ },
614
+ "type": {
615
+ "type": "string",
616
+ "description": "線源タイプ",
617
+ "enum": ["POINT", "SPH", "RCC", "RPP", "BOX"]
618
+ },
619
+ "position": {
620
+ "$ref": "#/definitions/coordinate_string",
621
+ "description": "線源の位置(x y z形式)、typeがPOINTの場合のみ必須"
622
+ },
623
+ "inventory": {
624
+ "type": "array",
625
+ "description": "核種と放射能の組の配列",
626
+ "minItems": 1,
627
+ "items": {
628
+ "type": "object",
629
+ "properties": {
630
+ "nuclide": {
631
+ "type": "string",
632
+ "description": "核種名(元素記号と質量数の連結形式)",
633
+ "pattern": "^[A-Z][a-z]{0,2}[0-9]{1,3}[a-z]?$",
634
+ "examples": ["Cs137", "Co60", "U235", "Tc99m"],
635
+ "note": "末尾のアルファベットは同重体識別子(例:m for metastable)"
636
+ },
637
+ "radioactivity": {
638
+ "$ref": "#/definitions/radioactivity_value",
639
+ "description": "放射能(単位Bq)"
640
+ }
641
+ },
642
+ "required": ["nuclide", "radioactivity"],
643
+ "additionalProperties": false
644
+ }
645
+ },
646
+ "geometry": {
647
+ "type": "object",
648
+ "description": "線源形状パラメータ(typeがPOINT以外の場合に必須)",
649
+ "oneOf": [
650
+ {
651
+ "title": "BOX線源形状",
652
+ "properties": {
653
+ "vertex": {
654
+ "$ref": "#/definitions/coordinate_string",
655
+ "description": "頂点座標(x y z形式)"
656
+ },
657
+ "edge_1": {
658
+ "$ref": "#/definitions/coordinate_string",
659
+ "description": "エッジ1ベクトル(x y z形式)"
660
+ },
661
+ "edge_2": {
662
+ "$ref": "#/definitions/coordinate_string",
663
+ "description": "エッジ2ベクトル(x y z形式)"
664
+ },
665
+ "edge_3": {
666
+ "$ref": "#/definitions/coordinate_string",
667
+ "description": "エッジ3ベクトル(x y z形式)"
668
+ },
669
+ "transform": {
670
+ "$ref": "#/definitions/transform_reference",
671
+ "description": "適用する変換名"
672
+ }
673
+ },
674
+ "required": ["vertex", "edge_1", "edge_2", "edge_3"],
675
+ "additionalProperties": false
676
+ },
677
+ {
678
+ "title": "RPP線源形状",
679
+ "properties": {
680
+ "min": {
681
+ "$ref": "#/definitions/coordinate_string",
682
+ "description": "最小座標(x y z形式)"
683
+ },
684
+ "max": {
685
+ "$ref": "#/definitions/coordinate_string",
686
+ "description": "最大座標(x y z形式)"
687
+ },
688
+ "transform": {
689
+ "$ref": "#/definitions/transform_reference",
690
+ "description": "適用する変換名"
691
+ }
692
+ },
693
+ "required": ["min", "max"],
694
+ "additionalProperties": false
695
+ },
696
+ {
697
+ "title": "SPH線源形状",
698
+ "properties": {
699
+ "center": {
700
+ "$ref": "#/definitions/coordinate_string",
701
+ "description": "中心座標(x y z形式)"
702
+ },
703
+ "radius": {
704
+ "$ref": "#/definitions/positive_radius",
705
+ "description": "半径"
706
+ },
707
+ "transform": {
708
+ "$ref": "#/definitions/transform_reference",
709
+ "description": "適用する変換名"
710
+ }
711
+ },
712
+ "required": ["center", "radius"],
713
+ "additionalProperties": false
714
+ },
715
+ {
716
+ "title": "RCC線源形状",
717
+ "properties": {
718
+ "bottom_center": {
719
+ "$ref": "#/definitions/coordinate_string",
720
+ "description": "底面中心座標(x y z形式)"
721
+ },
722
+ "height_vector": {
723
+ "$ref": "#/definitions/coordinate_string",
724
+ "description": "高さベクトル(x y z形式)"
725
+ },
726
+ "radius": {
727
+ "$ref": "#/definitions/positive_radius",
728
+ "description": "半径"
729
+ },
730
+ "transform": {
731
+ "$ref": "#/definitions/transform_reference",
732
+ "description": "適用する変換名"
733
+ }
734
+ },
735
+ "required": ["bottom_center", "height_vector", "radius"],
736
+ "additionalProperties": false
737
+ }
738
+ ]
739
+ },
740
+ "division": {
741
+ "type": "object",
742
+ "description": "線源の領域分割パラメータ(typeがPOINT以外の場合に必須)",
743
+ "oneOf": [
744
+ {
745
+ "title": "BOX線源分割",
746
+ "properties": {
747
+ "edge_1": {
748
+ "$ref": "#/definitions/division_axis"
749
+ },
750
+ "edge_2": {
751
+ "$ref": "#/definitions/division_axis"
752
+ },
753
+ "edge_3": {
754
+ "$ref": "#/definitions/division_axis"
755
+ }
756
+ },
757
+ "required": ["edge_1", "edge_2", "edge_3"],
758
+ "additionalProperties": false
759
+ },
760
+ {
761
+ "title": "RPP線源分割",
762
+ "properties": {
763
+ "edge_1": {
764
+ "$ref": "#/definitions/division_axis"
765
+ },
766
+ "edge_2": {
767
+ "$ref": "#/definitions/division_axis"
768
+ },
769
+ "edge_3": {
770
+ "$ref": "#/definitions/division_axis"
771
+ }
772
+ },
773
+ "required": ["edge_1", "edge_2", "edge_3"],
774
+ "additionalProperties": false
775
+ },
776
+ {
777
+ "title": "SPH線源分割",
778
+ "properties": {
779
+ "r": {
780
+ "$ref": "#/definitions/division_axis"
781
+ },
782
+ "theta": {
783
+ "$ref": "#/definitions/division_axis"
784
+ },
785
+ "phi": {
786
+ "$ref": "#/definitions/division_axis"
787
+ }
788
+ },
789
+ "required": ["r", "theta", "phi"],
790
+ "additionalProperties": false
791
+ },
792
+ {
793
+ "title": "RCC線源分割",
794
+ "properties": {
795
+ "r": {
796
+ "$ref": "#/definitions/division_axis"
797
+ },
798
+ "phi": {
799
+ "$ref": "#/definitions/division_axis"
800
+ },
801
+ "z": {
802
+ "$ref": "#/definitions/division_axis"
803
+ }
804
+ },
805
+ "required": ["r", "phi", "z"],
806
+ "additionalProperties": false
807
+ }
808
+ ]
809
+ },
810
+ "cutoff_rate": {
811
+ "$ref": "#/definitions/cutoff_rate",
812
+ "description": "放出率カットオフ"
813
+ }
814
+ },
815
+ "required": ["name", "type", "inventory", "cutoff_rate"],
816
+ "additionalProperties": false
817
+ }
818
+ },
819
+ {
820
+ "name": "poker_updateSource",
821
+ "description": "既存線源のパラメータを更新します",
822
+ "parameters": {
823
+ "type": "object",
824
+ "properties": {
825
+ "name": {
826
+ "type": "string",
827
+ "description": "更新する線源の名前",
828
+ "pattern": "^[a-zA-Z0-9_]+$",
829
+ "maxLength": 50
830
+ },
831
+ "position": {
832
+ "$ref": "#/definitions/coordinate_string",
833
+ "description": "新しい線源の位置(x y z形式)"
834
+ },
835
+ "inventory": {
836
+ "type": "array",
837
+ "description": "新しい核種と放射能の組の配列",
838
+ "minItems": 1,
839
+ "items": {
840
+ "type": "object",
841
+ "properties": {
842
+ "nuclide": {
843
+ "type": "string",
844
+ "description": "核種名(元素記号と質量数の連結形式)",
845
+ "pattern": "^[A-Z][a-z]{0,2}[0-9]{1,3}[a-z]?$",
846
+ "examples": ["Cs137", "Co60", "U235", "Tc99m"],
847
+ "note": "末尾のアルファベットは同重体識別子(例:m for metastable)"
848
+ },
849
+ "radioactivity": {
850
+ "$ref": "#/definitions/radioactivity_value",
851
+ "description": "放射能(単位Bq)"
852
+ }
853
+ },
854
+ "required": ["nuclide", "radioactivity"],
855
+ "additionalProperties": false
856
+ }
857
+ },
858
+ "geometry": {
859
+ "type": "object",
860
+ "description": "新しい線源形状パラメータ",
861
+ "oneOf": [
862
+ {
863
+ "title": "BOX線源形状",
864
+ "properties": {
865
+ "vertex": {
866
+ "$ref": "#/definitions/coordinate_string"
867
+ },
868
+ "edge_1": {
869
+ "$ref": "#/definitions/coordinate_string"
870
+ },
871
+ "edge_2": {
872
+ "$ref": "#/definitions/coordinate_string"
873
+ },
874
+ "edge_3": {
875
+ "$ref": "#/definitions/coordinate_string"
876
+ },
877
+ "transform": {
878
+ "$ref": "#/definitions/transform_reference",
879
+ "description": "適用する変換名"
880
+ }
881
+ },
882
+ "required": ["vertex", "edge_1", "edge_2", "edge_3"]
883
+ },
884
+ {
885
+ "title": "RPP線源形状",
886
+ "properties": {
887
+ "min": {
888
+ "$ref": "#/definitions/coordinate_string"
889
+ },
890
+ "max": {
891
+ "$ref": "#/definitions/coordinate_string"
892
+ },
893
+ "transform": {
894
+ "$ref": "#/definitions/transform_reference",
895
+ "description": "適用する変換名"
896
+ }
897
+ },
898
+ "required": ["min", "max"]
899
+ },
900
+ {
901
+ "title": "SPH線源形状",
902
+ "properties": {
903
+ "center": {
904
+ "$ref": "#/definitions/coordinate_string"
905
+ },
906
+ "radius": {
907
+ "$ref": "#/definitions/positive_radius"
908
+ },
909
+ "transform": {
910
+ "$ref": "#/definitions/transform_reference",
911
+ "description": "適用する変換名"
912
+ }
913
+ },
914
+ "required": ["center", "radius"]
915
+ },
916
+ {
917
+ "title": "RCC線源形状",
918
+ "properties": {
919
+ "bottom_center": {
920
+ "$ref": "#/definitions/coordinate_string"
921
+ },
922
+ "height_vector": {
923
+ "$ref": "#/definitions/coordinate_string"
924
+ },
925
+ "radius": {
926
+ "$ref": "#/definitions/positive_radius"
927
+ },
928
+ "transform": {
929
+ "$ref": "#/definitions/transform_reference",
930
+ "description": "適用する変換名"
931
+ }
932
+ },
933
+ "required": ["bottom_center", "height_vector", "radius"]
934
+ }
935
+ ]
936
+ },
937
+ "division": {
938
+ "type": "object",
939
+ "description": "新しい線源の領域分割パラメータ",
940
+ "oneOf": [
941
+ {
942
+ "title": "BOX線源分割",
943
+ "properties": {
944
+ "edge_1": { "$ref": "#/definitions/division_axis" },
945
+ "edge_2": { "$ref": "#/definitions/division_axis" },
946
+ "edge_3": { "$ref": "#/definitions/division_axis" }
947
+ },
948
+ "required": ["edge_1", "edge_2", "edge_3"]
949
+ },
950
+ {
951
+ "title": "RPP線源分割",
952
+ "properties": {
953
+ "edge_1": { "$ref": "#/definitions/division_axis" },
954
+ "edge_2": { "$ref": "#/definitions/division_axis" },
955
+ "edge_3": { "$ref": "#/definitions/division_axis" }
956
+ },
957
+ "required": ["edge_1", "edge_2", "edge_3"]
958
+ },
959
+ {
960
+ "title": "SPH線源分割",
961
+ "properties": {
962
+ "r": { "$ref": "#/definitions/division_axis" },
963
+ "theta": { "$ref": "#/definitions/division_axis" },
964
+ "phi": { "$ref": "#/definitions/division_axis" }
965
+ },
966
+ "required": ["r", "theta", "phi"]
967
+ },
968
+ {
969
+ "title": "RCC線源分割",
970
+ "properties": {
971
+ "r": { "$ref": "#/definitions/division_axis" },
972
+ "phi": { "$ref": "#/definitions/division_axis" },
973
+ "z": { "$ref": "#/definitions/division_axis" }
974
+ },
975
+ "required": ["r", "phi", "z"]
976
+ }
977
+ ]
978
+ },
979
+ "cutoff_rate": {
980
+ "type": "number",
981
+ "description": "新しい放出率カットオフ",
982
+ "minimum": 0.0001,
983
+ "maximum": 1.0
984
+ }
985
+ },
986
+ "required": ["name"],
987
+ "additionalProperties": false
988
+ }
989
+ },
990
+ {
991
+ "name": "poker_deleteSource",
992
+ "description": "線源を削除します",
993
+ "parameters": {
994
+ "type": "object",
995
+ "properties": {
996
+ "name": {
997
+ "type": "string",
998
+ "description": "削除する線源の名前",
999
+ "pattern": "^[a-zA-Z0-9_]+$",
1000
+ "maxLength": 50
1001
+ }
1002
+ },
1003
+ "required": ["name"],
1004
+ "additionalProperties": false
1005
+ }
1006
+ },
1007
+ {
1008
+ "name": "poker_proposeDetector",
1009
+ "description": "新しい検出器を提案します",
1010
+ "parameters": {
1011
+ "type": "object",
1012
+ "properties": {
1013
+ "name": {
1014
+ "$ref": "#/definitions/object_name",
1015
+ "description": "検出器の名前(一意である必要があります)"
1016
+ },
1017
+ "origin": {
1018
+ "$ref": "#/definitions/coordinate_string",
1019
+ "description": "検出器の基準位置(x y z形式)"
1020
+ },
1021
+ "grid": {
1022
+ "type": "array",
1023
+ "description": "エッジベクトルと分割数の組の配列(配列の数が検出器の次元を表す)",
1024
+ "items": {
1025
+ "type": "object",
1026
+ "properties": {
1027
+ "edge": {
1028
+ "$ref": "#/definitions/coordinate_string",
1029
+ "description": "エッジベクトル(x y z形式)"
1030
+ },
1031
+ "number": {
1032
+ "$ref": "#/definitions/grid_division",
1033
+ "description": "分割数"
1034
+ }
1035
+ },
1036
+ "required": ["edge", "number"]
1037
+ }
1038
+ },
1039
+ "transform": {
1040
+ "$ref": "#/definitions/transform_reference",
1041
+ "description": "適用する変換名"
1042
+ },
1043
+ "show_path_trace": {
1044
+ "type": "boolean",
1045
+ "description": "透過線の経路トレースをサマリーに出力するか",
1046
+ "default": false
1047
+ }
1048
+ },
1049
+ "required": ["name", "origin", "show_path_trace"],
1050
+ "additionalProperties": false
1051
+ },
1052
+ "validation": {
1053
+ "name_uniqueness": "検出器名の重複チェック",
1054
+ "grid_dimension": "グリッド次元の妥当性チェック",
1055
+ "coordinate_validity": "座標とベクトルの妥当性確認"
1056
+ }
1057
+ },
1058
+ {
1059
+ "name": "poker_updateDetector",
1060
+ "description": "既存検出器のパラメータを更新します",
1061
+ "parameters": {
1062
+ "type": "object",
1063
+ "properties": {
1064
+ "name": {
1065
+ "type": "string",
1066
+ "description": "更新する検出器の名前",
1067
+ "pattern": "^[a-zA-Z0-9_]+$",
1068
+ "maxLength": 50
1069
+ },
1070
+ "origin": {
1071
+ "$ref": "#/definitions/coordinate_string",
1072
+ "description": "新しい検出器の基準位置(x y z形式)"
1073
+ },
1074
+ "grid": {
1075
+ "type": "array",
1076
+ "description": "新しいエッジベクトルと分割数の組の配列(配列の数が検出器の次元を表す)",
1077
+ "items": {
1078
+ "type": "object",
1079
+ "properties": {
1080
+ "edge": {
1081
+ "$ref": "#/definitions/coordinate_string",
1082
+ "description": "エッジベクトル(x y z形式)"
1083
+ },
1084
+ "number": {
1085
+ "$ref": "#/definitions/grid_division",
1086
+ "description": "分割数"
1087
+ }
1088
+ },
1089
+ "required": ["edge", "number"]
1090
+ }
1091
+ },
1092
+ "transform": {
1093
+ "$ref": "#/definitions/transform_reference",
1094
+ "description": "適用する変換名"
1095
+ },
1096
+ "show_path_trace": {
1097
+ "type": "boolean",
1098
+ "description": "透過線の経路トレースをサマリーに出力するか"
1099
+ }
1100
+ },
1101
+ "required": ["name"],
1102
+ "additionalProperties": false
1103
+ },
1104
+ "validation": {
1105
+ "existence_check": "検出器の存在確認",
1106
+ "parameter_validity": "更新パラメータの妥当性チェック",
1107
+ "grid_consistency": "グリッド設定の一貫性確認"
1108
+ }
1109
+ },
1110
+ {
1111
+ "name": "poker_deleteDetector",
1112
+ "description": "検出器を削除します",
1113
+ "parameters": {
1114
+ "type": "object",
1115
+ "properties": {
1116
+ "name": {
1117
+ "type": "string",
1118
+ "description": "削除する検出器の名前",
1119
+ "pattern": "^[a-zA-Z0-9_]+$",
1120
+ "maxLength": 50
1121
+ }
1122
+ },
1123
+ "required": ["name"],
1124
+ "additionalProperties": false
1125
+ },
1126
+ "validation": {
1127
+ "existence_check": "検出器の存在確認",
1128
+ "safety_validation": "削除の安全性確認"
1129
+ }
1130
+ },
1131
+ {
1132
+ "name": "poker_applyChanges",
1133
+ "description": "全ての保留中の変更を実際のYAMLファイルに適用します。自動的にバックアップが作成されます。",
1134
+ "parameters": {
1135
+ "type": "object",
1136
+ "properties": {
1137
+ "force": {
1138
+ "type": "boolean",
1139
+ "description": "強制適用フラグ(警告を無視)",
1140
+ "default": false
1141
+ },
1142
+ "backup_comment": {
1143
+ "$ref": "#/definitions/comment_length",
1144
+ "description": "バックアップのコメント"
1145
+ }
1146
+ },
1147
+ "additionalProperties": false
1148
+ }
1149
+ },
1150
+ {
1151
+ "name": "poker_proposeUnit",
1152
+ "description": "単位設定セクションを提案します(YAMLファイルに未存在の場合のみ)",
1153
+ "parameters": {
1154
+ "type": "object",
1155
+ "properties": {
1156
+ "length": {
1157
+ "$ref": "#/definitions/supported_length_unit",
1158
+ "description": "長さの単位",
1159
+ "default": "cm"
1160
+ },
1161
+ "angle": {
1162
+ "$ref": "#/definitions/supported_angle_unit",
1163
+ "description": "角度の単位",
1164
+ "default": "radian"
1165
+ },
1166
+ "density": {
1167
+ "$ref": "#/definitions/supported_density_unit",
1168
+ "description": "密度の単位",
1169
+ "default": "g/cm3"
1170
+ },
1171
+ "radioactivity": {
1172
+ "$ref": "#/definitions/supported_radioactivity_unit",
1173
+ "description": "放射能の単位",
1174
+ "default": "Bq"
1175
+ }
1176
+ },
1177
+ "required": ["length", "angle", "density", "radioactivity"],
1178
+ "additionalProperties": false
1179
+ },
1180
+ "validation": {
1181
+ "existence_check": "unit セクションの非存在チェック",
1182
+ "completeness_check": "4つのキー存在確認",
1183
+ "unit_value_validation": "単位選択肢の妥当性チェック"
1184
+ }
1185
+ },
1186
+ {
1187
+ "name": "poker_getUnit",
1188
+ "description": "現在の単位設定を取得します(4つのキーすべてを返却)",
1189
+ "parameters": {
1190
+ "type": "object",
1191
+ "additionalProperties": false
1192
+ },
1193
+ "validation": {
1194
+ "completeness_check": "4つのキー存在確認",
1195
+ "auto_repair": "不完全な場合はデフォルト値で補完"
1196
+ }
1197
+ },
1198
+ {
1199
+ "name": "poker_updateUnit",
1200
+ "description": "既存単位設定を更新します(部分更新だが4つのキーは常に維持)",
1201
+ "parameters": {
1202
+ "type": "object",
1203
+ "properties": {
1204
+ "length": {
1205
+ "$ref": "#/definitions/supported_length_unit",
1206
+ "description": "新しい長さの単位"
1207
+ },
1208
+ "angle": {
1209
+ "$ref": "#/definitions/supported_angle_unit",
1210
+ "description": "新しい角度の単位"
1211
+ },
1212
+ "density": {
1213
+ "$ref": "#/definitions/supported_density_unit",
1214
+ "description": "新しい密度の単位"
1215
+ },
1216
+ "radioactivity": {
1217
+ "$ref": "#/definitions/supported_radioactivity_unit",
1218
+ "description": "新しい放射能の単位"
1219
+ }
1220
+ },
1221
+ "minProperties": 1,
1222
+ "additionalProperties": false
1223
+ },
1224
+ "validation": {
1225
+ "existence_check": "unit セクションの存在チェック",
1226
+ "completeness_maintained": "4つのキー完全性維持",
1227
+ "unit_value_validation": "単位選択肢の妥当性チェック"
1228
+ }
1229
+ },
1230
+ {
1231
+ "name": "poker_executeCalculation",
1232
+ "description": "作成したYAMLファイルを使用してpoker_cuiで放射線遮蔽計算を実行します",
1233
+ "parameters": {
1234
+ "type": "object",
1235
+ "properties": {
1236
+ "yaml_file": {
1237
+ "type": "string",
1238
+ "description": "計算に使用するYAMLファイル名(拡張子.yamlを含む)",
1239
+ "pattern": "^[a-zA-Z0-9_\\-\\.]+\\.(yaml|yml)$",
1240
+ "examples": ["shielding_model.yaml", "hospital_design.yaml", "reactor_shield.yaml"]
1241
+ },
1242
+ "summary_options": {
1243
+ "type": "object",
1244
+ "description": "サマリー出力オプション(注意: show_source_dataとshow_total_doseの少なくとも一方は必須です)",
1245
+ "properties": {
1246
+ "show_parameters": {
1247
+ "type": "boolean",
1248
+ "description": "入力パラメータをサマリーに表示(-pオプション)",
1249
+ "default": false
1250
+ },
1251
+ "show_source_data": {
1252
+ "type": "boolean",
1253
+ "description": "各線源による計算データ及び線量をサマリーに表示(-sオプション)",
1254
+ "default": true
1255
+ },
1256
+ "show_total_dose": {
1257
+ "type": "boolean",
1258
+ "description": "各検出器に対する全線源からの総和線量をサマリーに表示(-tオプション)",
1259
+ "default": true
1260
+ }
1261
+ },
1262
+ "additionalProperties": false
1263
+ },
1264
+ "output_files": {
1265
+ "type": "object",
1266
+ "description": "出力ファイル指定(全てYAML形式)",
1267
+ "properties": {
1268
+ "summary_file": {
1269
+ "type": "string",
1270
+ "description": "出力サマリーファイル名(-oオプション、YAML形式)",
1271
+ "pattern": "^[a-zA-Z0-9_\\-\\.]+\\.(yaml|yml)$",
1272
+ "examples": ["calculation_summary.yaml", "shield_analysis.yml", "result_summary.yaml"]
1273
+ },
1274
+ "dose_file": {
1275
+ "type": "string",
1276
+ "description": "線量ファイル名(-dオプション、YAML形式)",
1277
+ "pattern": "^[a-zA-Z0-9_\\-\\.]+\\.(yaml|yml)$",
1278
+ "examples": ["dose_rates.yaml", "detector_doses.yml", "dose_distribution.yaml"]
1279
+ }
1280
+ },
1281
+ "additionalProperties": false
1282
+ }
1283
+ },
1284
+ "required": ["yaml_file"],
1285
+ "additionalProperties": false
1286
+ },
1287
+ "validation": {
1288
+ "yaml_file_existence": "YAMLファイルの存在確認",
1289
+ "yaml_syntax_check": "YAML構文の妥当性確認",
1290
+ "completeness_check": "必要セクション(body, zone, source等)の存在確認",
1291
+ "poker_cui_availability": "poker_cuiコマンドの利用可能性確認",
1292
+ "summary_options_validation": "show_source_dataまたはshow_total_doseの少なくとも一方が必須。両方がfalseの場合はエラー、またはshow_total_doseを強制的にtrueに設定",
1293
+ "output_directory_check": "出力ディレクトリの作成可能性確認"
1294
+ }
1295
+ }
1296
+ ],
1297
+ "definitions": {
1298
+ "coordinate_string": {
1299
+ "type": "string",
1300
+ "pattern": "^-?\\d+(\\.\\d+)?\\s+-?\\d+(\\.\\d+)?\\s+-?\\d+(\\.\\d+)?$",
1301
+ "description": "x y z形式の座標文字列"
1302
+ },
1303
+ "positive_radius": {
1304
+ "type": "number",
1305
+ "minimum": 0.001,
1306
+ "maximum": 10000,
1307
+ "description": "正の半径値 (cm)"
1308
+ },
1309
+ "density_value": {
1310
+ "type": "number",
1311
+ "minimum": 0.001,
1312
+ "maximum": 30.0,
1313
+ "description": "密度値 (g/cm³)"
1314
+ },
1315
+ "radioactivity_value": {
1316
+ "type": "number",
1317
+ "minimum": 0.001,
1318
+ "maximum": 1e15,
1319
+ "description": "放射能値 (Bq)"
1320
+ },
1321
+ "object_name": {
1322
+ "type": "string",
1323
+ "pattern": "^[a-zA-Z0-9_]+$",
1324
+ "maxLength": 50,
1325
+ "description": "オブジェクト名(英数字とアンダースコアのみ)"
1326
+ },
1327
+ "rotation_angle": {
1328
+ "type": "number",
1329
+ "minimum": -360,
1330
+ "maximum": 360,
1331
+ "description": "回転角度(度)"
1332
+ },
1333
+ "cutoff_rate": {
1334
+ "type": "number",
1335
+ "minimum": 0.0001,
1336
+ "maximum": 1.0,
1337
+ "default": 0.0001,
1338
+ "description": "カットオフ率"
1339
+ },
1340
+ "buildup_index": {
1341
+ "type": "integer",
1342
+ "minimum": 0,
1343
+ "maximum": 100,
1344
+ "description": "ビルドアップ係数インデックス"
1345
+ },
1346
+ "grid_division": {
1347
+ "type": "integer",
1348
+ "minimum": 2,
1349
+ "maximum": 1000,
1350
+ "description": "グリッド分割数"
1351
+ },
1352
+ "comment_length": {
1353
+ "type": "string",
1354
+ "maxLength": 200,
1355
+ "description": "コメント文字列"
1356
+ },
1357
+ "division_axis": {
1358
+ "type": "object",
1359
+ "description": "分割軸の設定",
1360
+ "properties": {
1361
+ "type": {
1362
+ "type": "string",
1363
+ "description": "分割タイプ",
1364
+ "enum": ["UNIFORM", "GAUSS_FIRST", "GAUSS_LAST", "GAUSS_BOTH", "GAUSS_CENTER"],
1365
+ "default": "UNIFORM"
1366
+ },
1367
+ "number": {
1368
+ "$ref": "#/definitions/grid_division",
1369
+ "description": "分割数"
1370
+ },
1371
+ "min": {
1372
+ "type": "number",
1373
+ "description": "分割開始位置(0.0~1.0)",
1374
+ "minimum": 0.0,
1375
+ "maximum": 1.0,
1376
+ "default": 0.0
1377
+ },
1378
+ "max": {
1379
+ "type": "number",
1380
+ "description": "分割終了位置(0.0~1.0)",
1381
+ "minimum": 0.0,
1382
+ "maximum": 1.0,
1383
+ "default": 1.0
1384
+ }
1385
+ },
1386
+ "required": ["type", "number"],
1387
+ "additionalProperties": false
1388
+ },
1389
+ "supported_material": {
1390
+ "type": "string",
1391
+ "enum": ["Carbon", "Concrete", "Iron", "Lead", "Aluminum", "Copper", "Tungsten", "Air", "Water", "PyrexGlass", "AcrylicResin", "Polyethylene", "Soil", "VOID"],
1392
+ "description": "サポートされる材料名"
1393
+ },
1394
+ "supported_length_unit": {
1395
+ "type": "string",
1396
+ "enum": ["m", "cm", "mm"],
1397
+ "description": "サポートされる長さ単位"
1398
+ },
1399
+ "supported_angle_unit": {
1400
+ "type": "string",
1401
+ "enum": ["radian", "degree"],
1402
+ "description": "サポートされる角度単位"
1403
+ },
1404
+ "supported_density_unit": {
1405
+ "type": "string",
1406
+ "enum": ["g/cm3"],
1407
+ "description": "サポートされる密度単位"
1408
+ },
1409
+ "supported_radioactivity_unit": {
1410
+ "type": "string",
1411
+ "enum": ["Bq"],
1412
+ "description": "サポートされる放射能単位"
1413
+ },
1414
+ "transform_reference": {
1415
+ "type": "string",
1416
+ "description": "変換参照名(YAMLデータファイルのtransformセクションで既に定義されたnameからのみ選択可能、英数字とアンダースコアのみ)",
1417
+ "pattern": "^[a-zA-Z0-9_]+$",
1418
+ "maxLength": 50,
1419
+ "constraint": "must_exist_in_yaml_transform_section",
1420
+ "validation": {
1421
+ "existence_check": "YAMLファイルのtransform配列内でのname検索",
1422
+ "error_on_missing": "指定された変換名が存在しない場合は-32017エラー"
1423
+ }
1424
+ }
1425
+ },
1426
+ "validation_enhanced": {
1427
+ "atmosphere_zone_constraints": {
1428
+ "reserved_name": "ATMOSPHERE",
1429
+ "uniqueness": "必須かつ唯一",
1430
+ "role": "complement_zone",
1431
+ "physical_meaning": "他のゾーンで定義されていない全領域を表現",
1432
+ "naming_restrictions": {
1433
+ "forbidden_as_body_name": true,
1434
+ "reserved_keyword": true,
1435
+ "case_sensitive": true
1436
+ },
1437
+ "zone_section_requirements": {
1438
+ "mandatory_presence": true,
1439
+ "quantity": "exactly_one",
1440
+ "deletion": "prohibited",
1441
+ "material_assignment": "required"
1442
+ },
1443
+ "material_constraints": {
1444
+ "VOID": {
1445
+ "density_specification": "prohibited",
1446
+ "reason": "真空は密度を持たないため記載不要"
1447
+ },
1448
+ "non_void_materials": {
1449
+ "density_specification": "mandatory",
1450
+ "reason": "すべての物理材料は密度値が必須"
1451
+ }
1452
+ }
1453
+ },
1454
+ "material_constraints": {
1455
+ "supported_materials": ["Carbon", "Concrete", "Iron", "Lead", "Aluminum", "Copper", "Tungsten", "Air", "Water", "PyrexGlass", "AcrylicResin", "Polyethylene", "Soil", "VOID"],
1456
+ "density_validation": {
1457
+ "VOID": "density パラメータ指定禁止",
1458
+ "other_materials": "density パラメータ必須"
1459
+ }
1460
+ },
1461
+ "nuclide_constraints": {
1462
+ "format": "element_symbol_mass_number_concatenated",
1463
+ "pattern": "^[A-Z][a-z]{0,2}[0-9]{1,3}[a-z]?$",
1464
+ "examples": ["Cs137", "Co60", "U235", "Ra226", "Am241", "Tc99m"],
1465
+ "forbidden": ["Cs-137", "Co-60", "U-235"],
1466
+ "migration_rule": "remove_hyphens_between_element_and_mass",
1467
+ "metastable_suffix": "single_lowercase_letter_allowed"
1468
+ },
1469
+ "buildup_factor_constraints": {
1470
+ "supported_corrections": ["use_slant_correction", "use_finite_medium_correction"]
1471
+ },
1472
+ "detector_constraints": {
1473
+ "supported_types": ["POINT", "GRID_1D", "GRID_2D", "GRID_3D"]
1474
+ },
1475
+ "unit_constraints": {
1476
+ "mandatory_keys": ["length", "angle", "density", "radioactivity"],
1477
+ "supported_values": {
1478
+ "length": ["m", "cm", "mm"],
1479
+ "angle": ["radian", "degree"],
1480
+ "density": ["g/cm3"],
1481
+ "radioactivity": ["Bq"]
1482
+ },
1483
+ "uniqueness": "single_unit_section_only",
1484
+ "completeness": "four_keys_always_required"
1485
+ },
1486
+ "auto_repair_constraints": {
1487
+ "repair_triggers": ["missing_unit_section", "incomplete_keys", "invalid_values"],
1488
+ "default_fallback": {
1489
+ "length": "cm",
1490
+ "angle": "radian",
1491
+ "density": "g/cm3",
1492
+ "radioactivity": "Bq"
1493
+ },
1494
+ "repair_logging": "comprehensive"
1495
+ },
1496
+ "body_type_constraints": {
1497
+ "SPH": {
1498
+ "required_parameters": ["name", "type", "center", "radius"]
1499
+ },
1500
+ "RCC": {
1501
+ "required_parameters": ["name", "type", "bottom_center", "height_vector", "radius"]
1502
+ },
1503
+ "RPP": {
1504
+ "required_parameters": ["name", "type", "min", "max"]
1505
+ },
1506
+ "BOX": {
1507
+ "required_parameters": ["name", "type", "vertex", "edge_1", "edge_2", "edge_3"]
1508
+ },
1509
+ "TOR": {
1510
+ "required_parameters": ["name", "type", "center", "normal", "major_radius", "minor_radius_horizontal", "minor_radius_vertical"]
1511
+ },
1512
+ "ELL": {
1513
+ "required_parameters": ["name", "type", "center", "radius_vector_1", "radius_vector_2", "radius_vector_3"]
1514
+ },
1515
+ "TRC": {
1516
+ "required_parameters": ["name", "type", "bottom_center", "height_vector", "bottom_radius", "top_radius"]
1517
+ },
1518
+ "REC": {
1519
+ "required_parameters": ["name", "type", "bottom_center", "height_vector", "radius_vector_1", "radius_vector_2"]
1520
+ },
1521
+ "WED": {
1522
+ "required_parameters": ["name", "type", "vertex", "width_vector", "height_vector", "depth_vector"]
1523
+ },
1524
+ "CMB": {
1525
+ "required_parameters": ["name", "type", "expression"]
1526
+ }
1527
+ },
1528
+ "cmb_expression_constraints": {
1529
+ "body_reference_validation": {
1530
+ "requirement": "all_referenced_bodies_must_exist",
1531
+ "check_timing": "before_cmb_creation",
1532
+ "error_handling": "detailed_error_with_missing_body_list",
1533
+ "circular_reference_detection": true,
1534
+ "max_reference_depth": 10
1535
+ },
1536
+ "expression_parsing": {
1537
+ "supported_operators": ["+", "-", "&"],
1538
+ "forbidden_operators": ["*", "/", "^", "|"],
1539
+ "bracket_validation": "balanced_parentheses_required",
1540
+ "body_name_extraction": "regex_based_parsing",
1541
+ "operator_precedence": "left_to_right_with_parentheses"
1542
+ },
1543
+ "physical_validation": {
1544
+ "void_material_warning": "VOIDと物理材料の組み合わせ時に警告",
1545
+ "geometric_feasibility": "重複しない立体のINTERSECTION警告",
1546
+ "result_volume_check": "演算結果が空集合の可能性チェック"
1547
+ }
1548
+ }
1549
+ },
1550
+ "error_handling": {
1551
+ "json_rpc_compliant": true,
1552
+ "custom_error_codes": {
1553
+ "-32001": "Body not found",
1554
+ "-32002": "Zone not found",
1555
+ "-32003": "Duplicate name",
1556
+ "-32004": "Invalid body type",
1557
+ "-32005": "Dependency exists",
1558
+ "-32006": "File access error",
1559
+ "-32007": "Validation error",
1560
+ "-32008": "Backup error",
1561
+ "-32009": "Unit already exists",
1562
+ "-32010": "Unit not found",
1563
+ "-32011": "Unit incomplete",
1564
+ "-32012": "Unit key missing",
1565
+ "-32013": "Unit invalid value",
1566
+ "-32014": "Unit delete forbidden",
1567
+ "-32015": "Unit repair failed",
1568
+ "-32016": "Unit validation failed",
1569
+ "-32017": "Transform not found",
1570
+ "-32018": "Invalid transform reference",
1571
+ "-32019": "Invalid name format - hyphens not allowed",
1572
+ "-32020": "Name contains forbidden characters",
1573
+ "-32021": "Invalid nuclide format - use concatenated format (e.g., Cs137)",
1574
+ "-32022": "Nuclide contains forbidden hyphen",
1575
+ "-32023": "ATMOSPHERE is reserved - cannot be used as body name",
1576
+ "-32024": "ATMOSPHERE zone is mandatory and cannot be deleted",
1577
+ "-32025": "Multiple ATMOSPHERE zones not allowed",
1578
+ "-32026": "ATMOSPHERE zone must exist in zone section",
1579
+ "-32027": "ATMOSPHERE zone material assignment required",
1580
+ "-32028": "Density cannot be specified for VOID material",
1581
+ "-32029": "Density must be specified for non-VOID materials",
1582
+ "-32030": "Missing required density parameter for physical material",
1583
+ "-32031": "Referenced body not found in CMB expression",
1584
+ "-32032": "Circular reference detected in CMB expression",
1585
+ "-32033": "Invalid operator in CMB expression",
1586
+ "-32034": "Unbalanced parentheses in CMB expression",
1587
+ "-32035": "Empty CMB expression",
1588
+ "-32036": "CMB expression too complex (max depth exceeded)",
1589
+ "-32040": "YAML file not found",
1590
+ "-32041": "Invalid YAML syntax",
1591
+ "-32042": "poker_cui command not available",
1592
+ "-32043": "Calculation execution failed",
1593
+ "-32044": "Calculation timeout",
1594
+ "-32045": "Insufficient system resources",
1595
+ "-32046": "Output directory access denied",
1596
+ "-32047": "Invalid calculation parameters",
1597
+ "-32048": "Calculation cancelled by user",
1598
+ "-32049": "Results parsing failed",
1599
+ "-32054": "Unsupported material with suggestion"
1600
+ }
1601
+ },
1602
+ "data_files": {
1603
+ "input": "tasks/poker.yaml",
1604
+ "pending_changes": "tasks/pending_changes.json",
1605
+ "backup_directory": "backups/"
1606
+ },
1607
+ "backup_features": {
1608
+ "automatic_backup": true,
1609
+ "timestamp_format": "ISO_8601",
1610
+ "retention_policy": "最新10個のバックアップを保持",
1611
+ "cleanup_automatic": true
1612
+ },
1613
+ "production_features": {
1614
+ "real_yaml_updates": true,
1615
+ "transaction_safety": true,
1616
+ "graceful_shutdown": true,
1617
+ "memory_management": "optimized",
1618
+ "performance": "production_ready"
1619
+ },
1620
+ "material_alternatives": {
1621
+ "description": "一般的な材料名からサポート材料への代替マッピング(放射線遮蔽計算用)",
1622
+ "STEEL": { "substitute": "Iron", "note": "一般的な構造用鋼はIronで代替" },
1623
+ "STAINLESS_STEEL": { "substitute": "Iron", "note": "ステンレス鋼もIronで代替可能" },
1624
+ "BRASS": { "substitute": "Copper", "note": "真鍮はCopperで代替" },
1625
+ "BRONZE": { "substitute": "Copper", "note": "青銅はCopperで代替" },
1626
+ "GLASS": { "substitute": "PyrexGlass", "note": "一般ガラスはPyrexGlassで代替" },
1627
+ "PLASTIC": { "substitute": "AcrylicResin", "note": "一般プラスチックはAcrylicResinで代替" },
1628
+ "EARTH": { "substitute": "Soil", "note": "土壌はSoilで代替" },
1629
+ "VOID_SPACE": { "substitute": "VOID", "note": "真空空間はVOIDで代替" },
1630
+ "ATMOSPHERE": { "substitute": "Air", "note": "大気はAirで代替" }
1631
+ },
1632
+ "material_constraints": {
1633
+ "description": "材料制約と物理的特性情報(放射線遮蔽研究用)",
1634
+ "strict_validation": true,
1635
+ "allow_alternatives": true,
1636
+ "error_with_suggestions": true,
1637
+ "supported_materials": {
1638
+ "Carbon": {
1639
+ "typical_use": "グラファイト、炭素繊維構造材",
1640
+ "shielding_properties": "軽量遮蔽材"
1641
+ },
1642
+ "Concrete": {
1643
+ "typical_use": "建築構造、放射線遮蔽壁",
1644
+ "shielding_properties": "汎用遮蔽材、経済的"
1645
+ },
1646
+ "Iron": {
1647
+ "typical_use": "鉄鋼構造、STEEL代替",
1648
+ "shielding_properties": "中重量遮蔽材、構造材兼用"
1649
+ },
1650
+ "Lead": {
1651
+ "typical_use": "高効率遮蔽材",
1652
+ "shielding_properties": "高密度γ線遮蔽材"
1653
+ },
1654
+ "Aluminum": {
1655
+ "typical_use": "軽量構造材",
1656
+ "shielding_properties": "軽量遮蔽材、耐食性"
1657
+ },
1658
+ "Copper": {
1659
+ "typical_use": "BRASS/BRONZE代替",
1660
+ "shielding_properties": "中重量遮蔽材、導電性"
1661
+ },
1662
+ "Tungsten": {
1663
+ "typical_use": "超高密度遮蔽材",
1664
+ "shielding_properties": "最高密度遮蔽材"
1665
+ },
1666
+ "Air": {
1667
+ "typical_use": "大気、ATMOSPHERE代替",
1668
+ "shielding_properties": "透明媒体"
1669
+ },
1670
+ "Water": {
1671
+ "typical_use": "中性子減速材、冷却材",
1672
+ "shielding_properties": "中性子遮蔽材"
1673
+ },
1674
+ "PyrexGlass": {
1675
+ "typical_use": "GLASS代替、耐熱ガラス",
1676
+ "shielding_properties": "透明遮蔽材"
1677
+ },
1678
+ "AcrylicResin": {
1679
+ "typical_use": "PLASTIC代替、透明樹脂",
1680
+ "shielding_properties": "軽量透明遮蔽材"
1681
+ },
1682
+ "Polyethylene": {
1683
+ "typical_use": "中性子遮蔽樹脂",
1684
+ "shielding_properties": "中性子減速・遮蔽材"
1685
+ },
1686
+ "Soil": {
1687
+ "typical_use": "EARTH代替、土壌遮蔽",
1688
+ "shielding_properties": "天然遮蔽材"
1689
+ },
1690
+ "VOID": {
1691
+ "density_specification": "prohibited",
1692
+ "typical_use": "真空、VOID_SPACE代替",
1693
+ "shielding_properties": "非遮蔽領域"
1694
+ }
1695
+ }
1696
+ },
1697
+ "error_handling_enhancement": {
1698
+ "description": "材料制約エラーの改善されたハンドリング",
1699
+ "unsupported_material_error": {
1700
+ "code": -32054,
1701
+ "message_template": "Unsupported material '{material}'. Did you mean '{suggested_substitute}'? Supported materials: {supported_list}",
1702
+ "suggestion_logic": "fuzzy_match_with_alternatives"
1703
+ },
1704
+ "material_suggestion_examples": {
1705
+ "STEEL": "Use 'Iron' instead of 'STEEL' for structural steel approximation",
1706
+ "STAINLESS": "Use 'Iron' instead of 'STAINLESS' for stainless steel approximation",
1707
+ "BRASS": "Use 'Copper' instead of 'BRASS' for brass alloy approximation",
1708
+ "GLASS": "Use 'PyrexGlass' instead of 'GLASS' for glass material approximation",
1709
+ "PLASTIC": "Use 'AcrylicResin' instead of 'PLASTIC' for plastic material approximation",
1710
+ "EARTH": "Use 'Soil' instead of 'EARTH' for earth material approximation"
1711
+ }
1712
+ }
1713
+ }