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,97 @@
1
+ {
2
+ "$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v2.3.0/schemas/probability-inspect-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
+ "type": "string",
13
+ "enum": [
14
+ "event_mean_time_to_happen",
15
+ "event_option_ai_chance",
16
+ "decision_ai_will_do",
17
+ "mission_ai_will_do",
18
+ "national_focus_ai_will_do",
19
+ "technology_ai_will_do",
20
+ "doctrine_ai_will_do",
21
+ "direct_random",
22
+ "random_list",
23
+ "ai_strategy_factor",
24
+ "custom_weighted_pool"
25
+ ]
26
+ },
27
+ "source": {
28
+ "type": "object",
29
+ "properties": {
30
+ "identifier": {
31
+ "$ref": "#/$defs/__schema0"
32
+ },
33
+ "path": {
34
+ "$ref": "#/$defs/__schema1"
35
+ },
36
+ "line": {
37
+ "$ref": "#/$defs/__schema2"
38
+ },
39
+ "inlineClausewitz": {
40
+ "$ref": "#/$defs/__schema3"
41
+ },
42
+ "virtualPatch": {
43
+ "$ref": "#/$defs/__schema4"
44
+ },
45
+ "expectedSourceHash": {
46
+ "$ref": "#/$defs/__schema5"
47
+ }
48
+ },
49
+ "additionalProperties": false
50
+ },
51
+ "candidatePool": {
52
+ "maxItems": 100000,
53
+ "type": "array",
54
+ "items": {
55
+ "$ref": "#/$defs/__schema6"
56
+ }
57
+ },
58
+ "refresh": {
59
+ "type": "boolean"
60
+ }
61
+ },
62
+ "additionalProperties": false,
63
+ "$defs": {
64
+ "__schema0": {
65
+ "type": "string",
66
+ "minLength": 1,
67
+ "maxLength": 1024
68
+ },
69
+ "__schema1": {
70
+ "type": "string",
71
+ "minLength": 1,
72
+ "maxLength": 1024
73
+ },
74
+ "__schema2": {
75
+ "type": "integer",
76
+ "minimum": 1,
77
+ "maximum": 9007199254740991
78
+ },
79
+ "__schema3": {
80
+ "type": "string",
81
+ "maxLength": 16777216
82
+ },
83
+ "__schema4": {
84
+ "type": "string",
85
+ "maxLength": 16777216
86
+ },
87
+ "__schema5": {
88
+ "type": "string",
89
+ "pattern": "^[a-f0-9]{64}$"
90
+ },
91
+ "__schema6": {
92
+ "type": "string",
93
+ "minLength": 1,
94
+ "maxLength": 512
95
+ }
96
+ }
97
+ }
@@ -0,0 +1,141 @@
1
+ {
2
+ "$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v2.3.0/schemas/probability-render-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
+ "analysisId": {
12
+ "type": "string",
13
+ "minLength": 1,
14
+ "maxLength": 256
15
+ },
16
+ "expectedScenarioHash": {
17
+ "type": "string",
18
+ "pattern": "^[a-f0-9]{64}$"
19
+ },
20
+ "outputs": {
21
+ "minItems": 1,
22
+ "maxItems": 10,
23
+ "type": "array",
24
+ "items": {
25
+ "$ref": "#/$defs/__schema0"
26
+ }
27
+ },
28
+ "includeHtml": {
29
+ "default": false,
30
+ "type": "boolean"
31
+ },
32
+ "filter": {
33
+ "type": "object",
34
+ "properties": {
35
+ "scenarioIds": {
36
+ "maxItems": 10000,
37
+ "type": "array",
38
+ "items": {
39
+ "$ref": "#/$defs/__schema1"
40
+ }
41
+ },
42
+ "candidateIds": {
43
+ "maxItems": 100000,
44
+ "type": "array",
45
+ "items": {
46
+ "$ref": "#/$defs/__schema2"
47
+ }
48
+ },
49
+ "diagnosticSeverities": {
50
+ "maxItems": 4,
51
+ "type": "array",
52
+ "items": {
53
+ "$ref": "#/$defs/__schema3"
54
+ }
55
+ },
56
+ "sourcePaths": {
57
+ "maxItems": 10000,
58
+ "type": "array",
59
+ "items": {
60
+ "$ref": "#/$defs/__schema4"
61
+ }
62
+ },
63
+ "metrics": {
64
+ "maxItems": 4,
65
+ "type": "array",
66
+ "items": {
67
+ "$ref": "#/$defs/__schema5"
68
+ }
69
+ },
70
+ "offset": {
71
+ "default": 0,
72
+ "type": "integer",
73
+ "minimum": 0,
74
+ "maximum": 9007199254740991
75
+ },
76
+ "limit": {
77
+ "default": 10000,
78
+ "type": "integer",
79
+ "minimum": 1,
80
+ "maximum": 100000
81
+ }
82
+ },
83
+ "additionalProperties": false
84
+ }
85
+ },
86
+ "required": [
87
+ "analysisId",
88
+ "outputs"
89
+ ],
90
+ "additionalProperties": false,
91
+ "$defs": {
92
+ "__schema0": {
93
+ "type": "string",
94
+ "enum": [
95
+ "json",
96
+ "ranking",
97
+ "matrix",
98
+ "waterfall",
99
+ "timing",
100
+ "sensitivity",
101
+ "threshold",
102
+ "sequence",
103
+ "comparison",
104
+ "unresolved"
105
+ ]
106
+ },
107
+ "__schema1": {
108
+ "type": "string",
109
+ "minLength": 1,
110
+ "maxLength": 512
111
+ },
112
+ "__schema2": {
113
+ "type": "string",
114
+ "minLength": 1,
115
+ "maxLength": 512
116
+ },
117
+ "__schema3": {
118
+ "type": "string",
119
+ "enum": [
120
+ "info",
121
+ "warning",
122
+ "error",
123
+ "blocker"
124
+ ]
125
+ },
126
+ "__schema4": {
127
+ "type": "string",
128
+ "minLength": 1,
129
+ "maxLength": 4096
130
+ },
131
+ "__schema5": {
132
+ "type": "string",
133
+ "enum": [
134
+ "conditional_probability",
135
+ "raw_value",
136
+ "cumulative_chance",
137
+ "effective_mtth_days"
138
+ ]
139
+ }
140
+ }
141
+ }
@@ -0,0 +1,430 @@
1
+ {
2
+ "$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v2.3.0/schemas/probability-scenario-set.schema.json",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "schemaVersion": {
7
+ "default": "1.0",
8
+ "type": "string",
9
+ "const": "1.0"
10
+ },
11
+ "id": {
12
+ "type": "string",
13
+ "minLength": 1,
14
+ "maxLength": 512
15
+ },
16
+ "workspaceId": {
17
+ "type": "string",
18
+ "pattern": "^[a-z][a-z0-9_-]{0,63}$"
19
+ },
20
+ "description": {
21
+ "type": "string",
22
+ "maxLength": 8192
23
+ },
24
+ "surfaceHint": {
25
+ "type": "string",
26
+ "enum": [
27
+ "event_mean_time_to_happen",
28
+ "event_option_ai_chance",
29
+ "decision_ai_will_do",
30
+ "mission_ai_will_do",
31
+ "national_focus_ai_will_do",
32
+ "technology_ai_will_do",
33
+ "doctrine_ai_will_do",
34
+ "direct_random",
35
+ "random_list",
36
+ "ai_strategy_factor",
37
+ "custom_weighted_pool"
38
+ ]
39
+ },
40
+ "scenarios": {
41
+ "minItems": 1,
42
+ "maxItems": 10000,
43
+ "type": "array",
44
+ "items": {
45
+ "$ref": "#/$defs/__schema0"
46
+ }
47
+ }
48
+ },
49
+ "required": [
50
+ "id",
51
+ "scenarios"
52
+ ],
53
+ "additionalProperties": false,
54
+ "$defs": {
55
+ "__schema0": {
56
+ "type": "object",
57
+ "properties": {
58
+ "id": {
59
+ "$ref": "#/$defs/__schema1"
60
+ },
61
+ "label": {
62
+ "$ref": "#/$defs/__schema2"
63
+ },
64
+ "prevalence": {
65
+ "$ref": "#/$defs/__schema3"
66
+ },
67
+ "actor": {
68
+ "$ref": "#/$defs/__schema4"
69
+ },
70
+ "date": {
71
+ "$ref": "#/$defs/__schema5"
72
+ },
73
+ "state": {
74
+ "$ref": "#/$defs/__schema6"
75
+ },
76
+ "flags": {
77
+ "$ref": "#/$defs/__schema9"
78
+ },
79
+ "eventTargets": {
80
+ "$ref": "#/$defs/__schema11"
81
+ },
82
+ "candidateOverrides": {
83
+ "$ref": "#/$defs/__schema12"
84
+ },
85
+ "uncertainInputs": {
86
+ "$ref": "#/$defs/__schema13"
87
+ },
88
+ "correlations": {
89
+ "$ref": "#/$defs/__schema29"
90
+ },
91
+ "schedule": {
92
+ "$ref": "#/$defs/__schema31"
93
+ }
94
+ },
95
+ "required": [
96
+ "id",
97
+ "state"
98
+ ],
99
+ "additionalProperties": false
100
+ },
101
+ "__schema1": {
102
+ "type": "string",
103
+ "minLength": 1,
104
+ "maxLength": 512
105
+ },
106
+ "__schema2": {
107
+ "type": "string",
108
+ "maxLength": 4096
109
+ },
110
+ "__schema3": {
111
+ "type": "number",
112
+ "minimum": 0,
113
+ "maximum": 1
114
+ },
115
+ "__schema4": {
116
+ "type": "string",
117
+ "maxLength": 256
118
+ },
119
+ "__schema5": {
120
+ "type": "string",
121
+ "maxLength": 64
122
+ },
123
+ "__schema6": {
124
+ "type": "object",
125
+ "propertyNames": {
126
+ "type": "string",
127
+ "minLength": 1,
128
+ "maxLength": 1024
129
+ },
130
+ "additionalProperties": {
131
+ "$ref": "#/$defs/__schema7"
132
+ }
133
+ },
134
+ "__schema7": {
135
+ "anyOf": [
136
+ {
137
+ "$ref": "#/$defs/__schema8"
138
+ },
139
+ {
140
+ "maxItems": 100000,
141
+ "type": "array",
142
+ "items": {
143
+ "$ref": "#/$defs/__schema8"
144
+ }
145
+ }
146
+ ]
147
+ },
148
+ "__schema8": {
149
+ "anyOf": [
150
+ {
151
+ "type": "string",
152
+ "maxLength": 4096
153
+ },
154
+ {
155
+ "type": "number"
156
+ },
157
+ {
158
+ "type": "boolean"
159
+ },
160
+ {
161
+ "type": "null"
162
+ }
163
+ ]
164
+ },
165
+ "__schema9": {
166
+ "maxItems": 100000,
167
+ "type": "array",
168
+ "items": {
169
+ "$ref": "#/$defs/__schema10"
170
+ }
171
+ },
172
+ "__schema10": {
173
+ "type": "string",
174
+ "minLength": 1,
175
+ "maxLength": 512
176
+ },
177
+ "__schema11": {
178
+ "type": "object",
179
+ "propertyNames": {
180
+ "type": "string",
181
+ "maxLength": 512
182
+ },
183
+ "additionalProperties": {
184
+ "type": "string",
185
+ "maxLength": 512
186
+ }
187
+ },
188
+ "__schema12": {
189
+ "type": "object",
190
+ "propertyNames": {
191
+ "type": "string",
192
+ "maxLength": 512
193
+ },
194
+ "additionalProperties": {
195
+ "type": "boolean"
196
+ }
197
+ },
198
+ "__schema13": {
199
+ "maxItems": 10000,
200
+ "type": "array",
201
+ "items": {
202
+ "$ref": "#/$defs/__schema14"
203
+ }
204
+ },
205
+ "__schema14": {
206
+ "type": "object",
207
+ "properties": {
208
+ "path": {
209
+ "$ref": "#/$defs/__schema15"
210
+ },
211
+ "range": {
212
+ "$ref": "#/$defs/__schema16"
213
+ },
214
+ "alternatives": {
215
+ "$ref": "#/$defs/__schema17"
216
+ },
217
+ "distribution": {
218
+ "$ref": "#/$defs/__schema18"
219
+ },
220
+ "unresolved": {
221
+ "$ref": "#/$defs/__schema28"
222
+ }
223
+ },
224
+ "required": [
225
+ "path"
226
+ ],
227
+ "additionalProperties": false
228
+ },
229
+ "__schema15": {
230
+ "type": "string",
231
+ "minLength": 1,
232
+ "maxLength": 1024
233
+ },
234
+ "__schema16": {
235
+ "type": "object",
236
+ "properties": {
237
+ "min": {
238
+ "type": "number"
239
+ },
240
+ "max": {
241
+ "type": "number"
242
+ }
243
+ },
244
+ "required": [
245
+ "min",
246
+ "max"
247
+ ],
248
+ "additionalProperties": false
249
+ },
250
+ "__schema17": {
251
+ "minItems": 1,
252
+ "maxItems": 100000,
253
+ "type": "array",
254
+ "items": {
255
+ "$ref": "#/$defs/__schema8"
256
+ }
257
+ },
258
+ "__schema18": {
259
+ "type": "object",
260
+ "properties": {
261
+ "kind": {
262
+ "$ref": "#/$defs/__schema19"
263
+ },
264
+ "min": {
265
+ "$ref": "#/$defs/__schema20"
266
+ },
267
+ "max": {
268
+ "$ref": "#/$defs/__schema21"
269
+ },
270
+ "mode": {
271
+ "$ref": "#/$defs/__schema22"
272
+ },
273
+ "mean": {
274
+ "$ref": "#/$defs/__schema23"
275
+ },
276
+ "stddev": {
277
+ "$ref": "#/$defs/__schema24"
278
+ },
279
+ "values": {
280
+ "$ref": "#/$defs/__schema25"
281
+ },
282
+ "probabilities": {
283
+ "$ref": "#/$defs/__schema26"
284
+ }
285
+ },
286
+ "required": [
287
+ "kind"
288
+ ],
289
+ "additionalProperties": false
290
+ },
291
+ "__schema19": {
292
+ "type": "string",
293
+ "enum": [
294
+ "uniform",
295
+ "triangular",
296
+ "normal",
297
+ "lognormal",
298
+ "categorical",
299
+ "empirical"
300
+ ]
301
+ },
302
+ "__schema20": {
303
+ "type": "number"
304
+ },
305
+ "__schema21": {
306
+ "type": "number"
307
+ },
308
+ "__schema22": {
309
+ "type": "number"
310
+ },
311
+ "__schema23": {
312
+ "type": "number"
313
+ },
314
+ "__schema24": {
315
+ "type": "number",
316
+ "exclusiveMinimum": 0
317
+ },
318
+ "__schema25": {
319
+ "minItems": 1,
320
+ "maxItems": 100000,
321
+ "type": "array",
322
+ "items": {
323
+ "$ref": "#/$defs/__schema8"
324
+ }
325
+ },
326
+ "__schema26": {
327
+ "minItems": 1,
328
+ "maxItems": 100000,
329
+ "type": "array",
330
+ "items": {
331
+ "$ref": "#/$defs/__schema27"
332
+ }
333
+ },
334
+ "__schema27": {
335
+ "type": "number",
336
+ "minimum": 0,
337
+ "maximum": 1
338
+ },
339
+ "__schema28": {
340
+ "type": "boolean",
341
+ "const": true
342
+ },
343
+ "__schema29": {
344
+ "maxItems": 10000,
345
+ "type": "array",
346
+ "items": {
347
+ "$ref": "#/$defs/__schema30"
348
+ }
349
+ },
350
+ "__schema30": {
351
+ "type": "object",
352
+ "properties": {
353
+ "left": {
354
+ "type": "string",
355
+ "minLength": 1,
356
+ "maxLength": 1024
357
+ },
358
+ "right": {
359
+ "type": "string",
360
+ "minLength": 1,
361
+ "maxLength": 1024
362
+ },
363
+ "coefficient": {
364
+ "type": "number",
365
+ "minimum": -1,
366
+ "maximum": 1
367
+ }
368
+ },
369
+ "required": [
370
+ "left",
371
+ "right",
372
+ "coefficient"
373
+ ],
374
+ "additionalProperties": false
375
+ },
376
+ "__schema31": {
377
+ "maxItems": 100000,
378
+ "type": "array",
379
+ "items": {
380
+ "$ref": "#/$defs/__schema32"
381
+ }
382
+ },
383
+ "__schema32": {
384
+ "type": "object",
385
+ "properties": {
386
+ "atDay": {
387
+ "type": "number",
388
+ "minimum": 0
389
+ },
390
+ "set": {
391
+ "type": "object",
392
+ "propertyNames": {
393
+ "type": "string",
394
+ "maxLength": 1024
395
+ },
396
+ "additionalProperties": {
397
+ "$ref": "#/$defs/__schema7"
398
+ }
399
+ },
400
+ "clearFlags": {
401
+ "maxItems": 100000,
402
+ "type": "array",
403
+ "items": {
404
+ "$ref": "#/$defs/__schema33"
405
+ }
406
+ },
407
+ "addFlags": {
408
+ "maxItems": 100000,
409
+ "type": "array",
410
+ "items": {
411
+ "$ref": "#/$defs/__schema34"
412
+ }
413
+ }
414
+ },
415
+ "required": [
416
+ "atDay",
417
+ "set"
418
+ ],
419
+ "additionalProperties": false
420
+ },
421
+ "__schema33": {
422
+ "type": "string",
423
+ "maxLength": 512
424
+ },
425
+ "__schema34": {
426
+ "type": "string",
427
+ "maxLength": 512
428
+ }
429
+ }
430
+ }