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