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