hoi4-agent-tools 2.2.0 → 2.3.3

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