hoi4-agent-tools 2.2.0 → 2.3.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 (62) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +30 -21
  3. package/dist/bin/stdio.js +0 -4
  4. package/dist/hoi4_agent_tools/core/clausewitz-evaluation.js +90 -0
  5. package/dist/hoi4_agent_tools/core/engine.js +5 -0
  6. package/dist/hoi4_agent_tools/core/index.js +57 -1
  7. package/dist/hoi4_agent_tools/core/source/ast-path.js +41 -0
  8. package/dist/hoi4_agent_tools/core/source/index.js +1 -0
  9. package/dist/hoi4_agent_tools/event/limits.js +1 -1
  10. package/dist/hoi4_agent_tools/mcp/server/create.js +3 -1
  11. package/dist/hoi4_agent_tools/mcp/tools/probability.js +413 -0
  12. package/dist/hoi4_agent_tools/probability/adapters.js +344 -0
  13. package/dist/hoi4_agent_tools/probability/compare.js +178 -0
  14. package/dist/hoi4_agent_tools/probability/evaluation.js +649 -0
  15. package/dist/hoi4_agent_tools/probability/index.js +13 -0
  16. package/dist/hoi4_agent_tools/probability/model.js +5 -0
  17. package/dist/hoi4_agent_tools/probability/rational.js +145 -0
  18. package/dist/hoi4_agent_tools/probability/render.js +307 -0
  19. package/dist/hoi4_agent_tools/probability/sequence.js +858 -0
  20. package/dist/hoi4_agent_tools/probability/service.js +1168 -0
  21. package/dist/hoi4_agent_tools/probability/simulation.js +545 -0
  22. package/dist/hoi4_agent_tools/probability/source-analysis.js +458 -0
  23. package/dist/hoi4_agent_tools/probability/sweep.js +265 -0
  24. package/dist/hoi4_agent_tools/probability/trigger-evaluator.js +280 -0
  25. package/dist/hoi4_agent_tools/probability/value-evaluator.js +357 -0
  26. package/dist/hoi4_agent_tools/schemas/probability.js +930 -0
  27. package/dist/hoi4_agent_tools/version.js +1 -1
  28. package/docs/README.md +1 -0
  29. package/docs/development.md +2 -0
  30. package/docs/probability.md +80 -0
  31. package/docs/research/probability-adapter-evidence.md +64 -0
  32. package/examples/clients/codex-config.toml +3 -0
  33. package/examples/clients/generic.json +8 -0
  34. package/examples/probability/adaptive-event-pool.json +92 -0
  35. package/examples/probability/adaptive-event-sequence-input.json +57 -0
  36. package/examples/probability/event-mtth-scenarios.json +57 -0
  37. package/examples/probability/event-mtth-simulate-input.json +37 -0
  38. package/examples/probability/focus-route-scenarios.json +61 -0
  39. package/examples/probability/focus-route-sweep-input.json +36 -0
  40. package/package.json +17 -8
  41. package/schemas/configuration.schema.json +747 -0
  42. package/schemas/continuous-focus-palette.schema.json +325 -0
  43. package/schemas/custom-weighted-pool.schema.json +298 -0
  44. package/schemas/event-feature-manifest.schema.json +63 -0
  45. package/schemas/focus-plan.schema.json +927 -0
  46. package/schemas/focus-planning-sidecar.schema.json +407 -0
  47. package/schemas/gui-animation-source.schema.json +176 -0
  48. package/schemas/gui-helper.schema.json +301 -0
  49. package/schemas/gui-scenario.schema.json +298 -0
  50. package/schemas/map-operation.schema.json +2284 -0
  51. package/schemas/operation-result.schema.json +327 -0
  52. package/schemas/probability-analysis-result.schema.json +2211 -0
  53. package/schemas/probability-compare-input.schema.json +664 -0
  54. package/schemas/probability-evaluate-input.schema.json +665 -0
  55. package/schemas/probability-inspect-input.schema.json +97 -0
  56. package/schemas/probability-render-input.schema.json +141 -0
  57. package/schemas/probability-scenario-set.schema.json +430 -0
  58. package/schemas/probability-sequence-input.schema.json +886 -0
  59. package/schemas/probability-simulate-input.schema.json +691 -0
  60. package/schemas/probability-sweep-input.schema.json +702 -0
  61. package/server.json +3 -3
  62. package/dist/hoi4_agent_tools/mcp/tools/chaosx.js +0 -530
@@ -0,0 +1,702 @@
1
+ {
2
+ "$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v2.3.0/schemas/probability-sweep-input.schema.json",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "workspaceId": {
7
+ "default": "current",
8
+ "type": "string",
9
+ "pattern": "^[a-z][a-z0-9_-]{0,63}$"
10
+ },
11
+ "adapter": {
12
+ "$ref": "#/$defs/__schema0"
13
+ },
14
+ "source": {
15
+ "type": "object",
16
+ "properties": {
17
+ "identifier": {
18
+ "$ref": "#/$defs/__schema1"
19
+ },
20
+ "path": {
21
+ "$ref": "#/$defs/__schema2"
22
+ },
23
+ "line": {
24
+ "$ref": "#/$defs/__schema3"
25
+ },
26
+ "inlineClausewitz": {
27
+ "$ref": "#/$defs/__schema4"
28
+ },
29
+ "virtualPatch": {
30
+ "$ref": "#/$defs/__schema5"
31
+ },
32
+ "expectedSourceHash": {
33
+ "$ref": "#/$defs/__schema6"
34
+ }
35
+ },
36
+ "additionalProperties": false
37
+ },
38
+ "scenarioSet": {
39
+ "type": "object",
40
+ "properties": {
41
+ "schemaVersion": {
42
+ "default": "1.0",
43
+ "type": "string",
44
+ "const": "1.0"
45
+ },
46
+ "id": {
47
+ "type": "string",
48
+ "minLength": 1,
49
+ "maxLength": 512
50
+ },
51
+ "workspaceId": {
52
+ "type": "string",
53
+ "pattern": "^[a-z][a-z0-9_-]{0,63}$"
54
+ },
55
+ "description": {
56
+ "type": "string",
57
+ "maxLength": 8192
58
+ },
59
+ "surfaceHint": {
60
+ "$ref": "#/$defs/__schema0"
61
+ },
62
+ "scenarios": {
63
+ "minItems": 1,
64
+ "maxItems": 10000,
65
+ "type": "array",
66
+ "items": {
67
+ "$ref": "#/$defs/__schema7"
68
+ }
69
+ }
70
+ },
71
+ "required": [
72
+ "id",
73
+ "scenarios"
74
+ ],
75
+ "additionalProperties": false
76
+ },
77
+ "candidatePool": {
78
+ "maxItems": 100000,
79
+ "type": "array",
80
+ "items": {
81
+ "$ref": "#/$defs/__schema42"
82
+ }
83
+ },
84
+ "horizonDays": {
85
+ "type": "number",
86
+ "exclusiveMinimum": 0,
87
+ "maximum": 1000000
88
+ },
89
+ "metrics": {
90
+ "minItems": 1,
91
+ "maxItems": 4,
92
+ "type": "array",
93
+ "items": {
94
+ "$ref": "#/$defs/__schema43"
95
+ }
96
+ },
97
+ "acceptanceBands": {
98
+ "maxItems": 100000,
99
+ "type": "array",
100
+ "items": {
101
+ "$ref": "#/$defs/__schema44"
102
+ }
103
+ },
104
+ "diagnosticThresholds": {
105
+ "type": "object",
106
+ "properties": {
107
+ "dominantProbability": {
108
+ "type": "number",
109
+ "minimum": 0,
110
+ "maximum": 1
111
+ },
112
+ "dominantScenarioPrevalence": {
113
+ "type": "number",
114
+ "minimum": 0,
115
+ "maximum": 1
116
+ },
117
+ "starvedProbability": {
118
+ "type": "number",
119
+ "minimum": 0,
120
+ "maximum": 1
121
+ },
122
+ "negligibleCumulativeChance": {
123
+ "type": "number",
124
+ "minimum": 0,
125
+ "maximum": 1
126
+ },
127
+ "extremeGrowthRatio": {
128
+ "type": "number",
129
+ "exclusiveMinimum": 0
130
+ },
131
+ "thresholdCliffDelta": {
132
+ "type": "number",
133
+ "exclusiveMinimum": 0
134
+ },
135
+ "rareOutcomeMinimumObservations": {
136
+ "type": "integer",
137
+ "exclusiveMinimum": 0,
138
+ "maximum": 9007199254740991
139
+ }
140
+ },
141
+ "additionalProperties": false
142
+ },
143
+ "outputs": {
144
+ "maxItems": 10,
145
+ "type": "array",
146
+ "items": {
147
+ "$ref": "#/$defs/__schema51"
148
+ }
149
+ },
150
+ "refresh": {
151
+ "type": "boolean"
152
+ },
153
+ "sweep": {
154
+ "type": "object",
155
+ "properties": {
156
+ "paths": {
157
+ "minItems": 1,
158
+ "maxItems": 32,
159
+ "type": "array",
160
+ "items": {
161
+ "$ref": "#/$defs/__schema52"
162
+ }
163
+ },
164
+ "steps": {
165
+ "default": 25,
166
+ "type": "integer",
167
+ "minimum": 2,
168
+ "maximum": 10000
169
+ },
170
+ "pairwise": {
171
+ "default": false,
172
+ "type": "boolean"
173
+ },
174
+ "findRankReversals": {
175
+ "default": true,
176
+ "type": "boolean"
177
+ }
178
+ },
179
+ "required": [
180
+ "paths"
181
+ ],
182
+ "additionalProperties": false
183
+ }
184
+ },
185
+ "required": [
186
+ "adapter",
187
+ "source",
188
+ "scenarioSet",
189
+ "sweep"
190
+ ],
191
+ "additionalProperties": false,
192
+ "$defs": {
193
+ "__schema0": {
194
+ "type": "string",
195
+ "enum": [
196
+ "event_mean_time_to_happen",
197
+ "event_option_ai_chance",
198
+ "decision_ai_will_do",
199
+ "mission_ai_will_do",
200
+ "national_focus_ai_will_do",
201
+ "technology_ai_will_do",
202
+ "doctrine_ai_will_do",
203
+ "direct_random",
204
+ "random_list",
205
+ "ai_strategy_factor",
206
+ "custom_weighted_pool"
207
+ ]
208
+ },
209
+ "__schema1": {
210
+ "type": "string",
211
+ "minLength": 1,
212
+ "maxLength": 1024
213
+ },
214
+ "__schema2": {
215
+ "type": "string",
216
+ "minLength": 1,
217
+ "maxLength": 1024
218
+ },
219
+ "__schema3": {
220
+ "type": "integer",
221
+ "minimum": 1,
222
+ "maximum": 9007199254740991
223
+ },
224
+ "__schema4": {
225
+ "type": "string",
226
+ "maxLength": 16777216
227
+ },
228
+ "__schema5": {
229
+ "type": "string",
230
+ "maxLength": 16777216
231
+ },
232
+ "__schema6": {
233
+ "type": "string",
234
+ "pattern": "^[a-f0-9]{64}$"
235
+ },
236
+ "__schema7": {
237
+ "type": "object",
238
+ "properties": {
239
+ "id": {
240
+ "$ref": "#/$defs/__schema8"
241
+ },
242
+ "label": {
243
+ "$ref": "#/$defs/__schema9"
244
+ },
245
+ "prevalence": {
246
+ "$ref": "#/$defs/__schema10"
247
+ },
248
+ "actor": {
249
+ "$ref": "#/$defs/__schema11"
250
+ },
251
+ "date": {
252
+ "$ref": "#/$defs/__schema12"
253
+ },
254
+ "state": {
255
+ "$ref": "#/$defs/__schema13"
256
+ },
257
+ "flags": {
258
+ "$ref": "#/$defs/__schema16"
259
+ },
260
+ "eventTargets": {
261
+ "$ref": "#/$defs/__schema18"
262
+ },
263
+ "candidateOverrides": {
264
+ "$ref": "#/$defs/__schema19"
265
+ },
266
+ "uncertainInputs": {
267
+ "$ref": "#/$defs/__schema20"
268
+ },
269
+ "correlations": {
270
+ "$ref": "#/$defs/__schema36"
271
+ },
272
+ "schedule": {
273
+ "$ref": "#/$defs/__schema38"
274
+ }
275
+ },
276
+ "required": [
277
+ "id",
278
+ "state"
279
+ ],
280
+ "additionalProperties": false
281
+ },
282
+ "__schema8": {
283
+ "type": "string",
284
+ "minLength": 1,
285
+ "maxLength": 512
286
+ },
287
+ "__schema9": {
288
+ "type": "string",
289
+ "maxLength": 4096
290
+ },
291
+ "__schema10": {
292
+ "type": "number",
293
+ "minimum": 0,
294
+ "maximum": 1
295
+ },
296
+ "__schema11": {
297
+ "type": "string",
298
+ "maxLength": 256
299
+ },
300
+ "__schema12": {
301
+ "type": "string",
302
+ "maxLength": 64
303
+ },
304
+ "__schema13": {
305
+ "type": "object",
306
+ "propertyNames": {
307
+ "type": "string",
308
+ "minLength": 1,
309
+ "maxLength": 1024
310
+ },
311
+ "additionalProperties": {
312
+ "$ref": "#/$defs/__schema14"
313
+ }
314
+ },
315
+ "__schema14": {
316
+ "anyOf": [
317
+ {
318
+ "$ref": "#/$defs/__schema15"
319
+ },
320
+ {
321
+ "maxItems": 100000,
322
+ "type": "array",
323
+ "items": {
324
+ "$ref": "#/$defs/__schema15"
325
+ }
326
+ }
327
+ ]
328
+ },
329
+ "__schema15": {
330
+ "anyOf": [
331
+ {
332
+ "type": "string",
333
+ "maxLength": 4096
334
+ },
335
+ {
336
+ "type": "number"
337
+ },
338
+ {
339
+ "type": "boolean"
340
+ },
341
+ {
342
+ "type": "null"
343
+ }
344
+ ]
345
+ },
346
+ "__schema16": {
347
+ "maxItems": 100000,
348
+ "type": "array",
349
+ "items": {
350
+ "$ref": "#/$defs/__schema17"
351
+ }
352
+ },
353
+ "__schema17": {
354
+ "type": "string",
355
+ "minLength": 1,
356
+ "maxLength": 512
357
+ },
358
+ "__schema18": {
359
+ "type": "object",
360
+ "propertyNames": {
361
+ "type": "string",
362
+ "maxLength": 512
363
+ },
364
+ "additionalProperties": {
365
+ "type": "string",
366
+ "maxLength": 512
367
+ }
368
+ },
369
+ "__schema19": {
370
+ "type": "object",
371
+ "propertyNames": {
372
+ "type": "string",
373
+ "maxLength": 512
374
+ },
375
+ "additionalProperties": {
376
+ "type": "boolean"
377
+ }
378
+ },
379
+ "__schema20": {
380
+ "maxItems": 10000,
381
+ "type": "array",
382
+ "items": {
383
+ "$ref": "#/$defs/__schema21"
384
+ }
385
+ },
386
+ "__schema21": {
387
+ "type": "object",
388
+ "properties": {
389
+ "path": {
390
+ "$ref": "#/$defs/__schema22"
391
+ },
392
+ "range": {
393
+ "$ref": "#/$defs/__schema23"
394
+ },
395
+ "alternatives": {
396
+ "$ref": "#/$defs/__schema24"
397
+ },
398
+ "distribution": {
399
+ "$ref": "#/$defs/__schema25"
400
+ },
401
+ "unresolved": {
402
+ "$ref": "#/$defs/__schema35"
403
+ }
404
+ },
405
+ "required": [
406
+ "path"
407
+ ],
408
+ "additionalProperties": false
409
+ },
410
+ "__schema22": {
411
+ "type": "string",
412
+ "minLength": 1,
413
+ "maxLength": 1024
414
+ },
415
+ "__schema23": {
416
+ "type": "object",
417
+ "properties": {
418
+ "min": {
419
+ "type": "number"
420
+ },
421
+ "max": {
422
+ "type": "number"
423
+ }
424
+ },
425
+ "required": [
426
+ "min",
427
+ "max"
428
+ ],
429
+ "additionalProperties": false
430
+ },
431
+ "__schema24": {
432
+ "minItems": 1,
433
+ "maxItems": 100000,
434
+ "type": "array",
435
+ "items": {
436
+ "$ref": "#/$defs/__schema15"
437
+ }
438
+ },
439
+ "__schema25": {
440
+ "type": "object",
441
+ "properties": {
442
+ "kind": {
443
+ "$ref": "#/$defs/__schema26"
444
+ },
445
+ "min": {
446
+ "$ref": "#/$defs/__schema27"
447
+ },
448
+ "max": {
449
+ "$ref": "#/$defs/__schema28"
450
+ },
451
+ "mode": {
452
+ "$ref": "#/$defs/__schema29"
453
+ },
454
+ "mean": {
455
+ "$ref": "#/$defs/__schema30"
456
+ },
457
+ "stddev": {
458
+ "$ref": "#/$defs/__schema31"
459
+ },
460
+ "values": {
461
+ "$ref": "#/$defs/__schema32"
462
+ },
463
+ "probabilities": {
464
+ "$ref": "#/$defs/__schema33"
465
+ }
466
+ },
467
+ "required": [
468
+ "kind"
469
+ ],
470
+ "additionalProperties": false
471
+ },
472
+ "__schema26": {
473
+ "type": "string",
474
+ "enum": [
475
+ "uniform",
476
+ "triangular",
477
+ "normal",
478
+ "lognormal",
479
+ "categorical",
480
+ "empirical"
481
+ ]
482
+ },
483
+ "__schema27": {
484
+ "type": "number"
485
+ },
486
+ "__schema28": {
487
+ "type": "number"
488
+ },
489
+ "__schema29": {
490
+ "type": "number"
491
+ },
492
+ "__schema30": {
493
+ "type": "number"
494
+ },
495
+ "__schema31": {
496
+ "type": "number",
497
+ "exclusiveMinimum": 0
498
+ },
499
+ "__schema32": {
500
+ "minItems": 1,
501
+ "maxItems": 100000,
502
+ "type": "array",
503
+ "items": {
504
+ "$ref": "#/$defs/__schema15"
505
+ }
506
+ },
507
+ "__schema33": {
508
+ "minItems": 1,
509
+ "maxItems": 100000,
510
+ "type": "array",
511
+ "items": {
512
+ "$ref": "#/$defs/__schema34"
513
+ }
514
+ },
515
+ "__schema34": {
516
+ "type": "number",
517
+ "minimum": 0,
518
+ "maximum": 1
519
+ },
520
+ "__schema35": {
521
+ "type": "boolean",
522
+ "const": true
523
+ },
524
+ "__schema36": {
525
+ "maxItems": 10000,
526
+ "type": "array",
527
+ "items": {
528
+ "$ref": "#/$defs/__schema37"
529
+ }
530
+ },
531
+ "__schema37": {
532
+ "type": "object",
533
+ "properties": {
534
+ "left": {
535
+ "type": "string",
536
+ "minLength": 1,
537
+ "maxLength": 1024
538
+ },
539
+ "right": {
540
+ "type": "string",
541
+ "minLength": 1,
542
+ "maxLength": 1024
543
+ },
544
+ "coefficient": {
545
+ "type": "number",
546
+ "minimum": -1,
547
+ "maximum": 1
548
+ }
549
+ },
550
+ "required": [
551
+ "left",
552
+ "right",
553
+ "coefficient"
554
+ ],
555
+ "additionalProperties": false
556
+ },
557
+ "__schema38": {
558
+ "maxItems": 100000,
559
+ "type": "array",
560
+ "items": {
561
+ "$ref": "#/$defs/__schema39"
562
+ }
563
+ },
564
+ "__schema39": {
565
+ "type": "object",
566
+ "properties": {
567
+ "atDay": {
568
+ "type": "number",
569
+ "minimum": 0
570
+ },
571
+ "set": {
572
+ "type": "object",
573
+ "propertyNames": {
574
+ "type": "string",
575
+ "maxLength": 1024
576
+ },
577
+ "additionalProperties": {
578
+ "$ref": "#/$defs/__schema14"
579
+ }
580
+ },
581
+ "clearFlags": {
582
+ "maxItems": 100000,
583
+ "type": "array",
584
+ "items": {
585
+ "$ref": "#/$defs/__schema40"
586
+ }
587
+ },
588
+ "addFlags": {
589
+ "maxItems": 100000,
590
+ "type": "array",
591
+ "items": {
592
+ "$ref": "#/$defs/__schema41"
593
+ }
594
+ }
595
+ },
596
+ "required": [
597
+ "atDay",
598
+ "set"
599
+ ],
600
+ "additionalProperties": false
601
+ },
602
+ "__schema40": {
603
+ "type": "string",
604
+ "maxLength": 512
605
+ },
606
+ "__schema41": {
607
+ "type": "string",
608
+ "maxLength": 512
609
+ },
610
+ "__schema42": {
611
+ "type": "string",
612
+ "minLength": 1,
613
+ "maxLength": 512
614
+ },
615
+ "__schema43": {
616
+ "type": "string",
617
+ "enum": [
618
+ "conditional_probability",
619
+ "raw_value",
620
+ "cumulative_chance",
621
+ "effective_mtth_days"
622
+ ]
623
+ },
624
+ "__schema44": {
625
+ "type": "object",
626
+ "properties": {
627
+ "id": {
628
+ "$ref": "#/$defs/__schema45"
629
+ },
630
+ "label": {
631
+ "$ref": "#/$defs/__schema46"
632
+ },
633
+ "scenarioId": {
634
+ "$ref": "#/$defs/__schema47"
635
+ },
636
+ "candidateId": {
637
+ "$ref": "#/$defs/__schema48"
638
+ },
639
+ "metric": {
640
+ "$ref": "#/$defs/__schema43"
641
+ },
642
+ "min": {
643
+ "$ref": "#/$defs/__schema49"
644
+ },
645
+ "max": {
646
+ "$ref": "#/$defs/__schema50"
647
+ }
648
+ },
649
+ "required": [
650
+ "id",
651
+ "candidateId",
652
+ "metric"
653
+ ],
654
+ "additionalProperties": false
655
+ },
656
+ "__schema45": {
657
+ "type": "string",
658
+ "minLength": 1,
659
+ "maxLength": 512
660
+ },
661
+ "__schema46": {
662
+ "type": "string",
663
+ "maxLength": 4096
664
+ },
665
+ "__schema47": {
666
+ "type": "string",
667
+ "minLength": 1,
668
+ "maxLength": 512
669
+ },
670
+ "__schema48": {
671
+ "type": "string",
672
+ "minLength": 1,
673
+ "maxLength": 512
674
+ },
675
+ "__schema49": {
676
+ "type": "number"
677
+ },
678
+ "__schema50": {
679
+ "type": "number"
680
+ },
681
+ "__schema51": {
682
+ "type": "string",
683
+ "enum": [
684
+ "json",
685
+ "ranking",
686
+ "matrix",
687
+ "waterfall",
688
+ "timing",
689
+ "sensitivity",
690
+ "threshold",
691
+ "sequence",
692
+ "comparison",
693
+ "unresolved"
694
+ ]
695
+ },
696
+ "__schema52": {
697
+ "type": "string",
698
+ "minLength": 1,
699
+ "maxLength": 1024
700
+ }
701
+ }
702
+ }
package/server.json CHANGED
@@ -2,8 +2,8 @@
2
2
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
3
  "name": "io.github.klimPaskov/hoi4-agent-tools",
4
4
  "title": "HOI4 Agent Tools",
5
- "description": "Analyze HOI4 events and technology trees; create and clean focus trees, GUIs, and maps.",
6
- "version": "2.2.0",
5
+ "description": "Analyze HOI4 events, tech trees, AI weights, and MTTH; build focus trees, GUIs, and maps.",
6
+ "version": "2.3.0",
7
7
  "repository": {
8
8
  "url": "https://github.com/klimPaskov/hoi4-agent-tools",
9
9
  "source": "github"
@@ -13,7 +13,7 @@
13
13
  {
14
14
  "registryType": "npm",
15
15
  "identifier": "hoi4-agent-tools",
16
- "version": "2.2.0",
16
+ "version": "2.3.0",
17
17
  "transport": {
18
18
  "type": "stdio"
19
19
  }