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,407 @@
1
+ {
2
+ "$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v2.3.3/schemas/focus-planning-sidecar.schema.json",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "schemaVersion": {
7
+ "type": "number",
8
+ "const": 1
9
+ },
10
+ "treeId": {
11
+ "type": "string",
12
+ "minLength": 1
13
+ },
14
+ "sourcePath": {
15
+ "type": "string",
16
+ "minLength": 1
17
+ },
18
+ "sourceHash": {
19
+ "type": "string",
20
+ "pattern": "^[a-f0-9]{64}$"
21
+ },
22
+ "branchGroups": {
23
+ "maxItems": 10000,
24
+ "type": "array",
25
+ "items": {
26
+ "$ref": "#/$defs/__schema0"
27
+ }
28
+ },
29
+ "laneGroups": {
30
+ "maxItems": 10000,
31
+ "type": "array",
32
+ "items": {
33
+ "$ref": "#/$defs/__schema3"
34
+ }
35
+ },
36
+ "entryFocusIds": {
37
+ "type": "array",
38
+ "items": {
39
+ "type": "string"
40
+ }
41
+ },
42
+ "continuousFocusPaletteIds": {
43
+ "type": "array",
44
+ "items": {
45
+ "type": "string"
46
+ }
47
+ },
48
+ "continuousFocusIds": {
49
+ "type": "array",
50
+ "items": {
51
+ "type": "string"
52
+ }
53
+ },
54
+ "runtimeAssignment": {
55
+ "type": "object",
56
+ "properties": {
57
+ "replacesExistingCountryTree": {
58
+ "type": "boolean"
59
+ },
60
+ "eventCreatedGuard": {
61
+ "type": "string"
62
+ }
63
+ },
64
+ "required": [
65
+ "replacesExistingCountryTree"
66
+ ],
67
+ "additionalProperties": false
68
+ },
69
+ "focuses": {
70
+ "type": "array",
71
+ "items": {
72
+ "type": "object",
73
+ "properties": {
74
+ "id": {
75
+ "type": "string",
76
+ "minLength": 1
77
+ },
78
+ "label": {
79
+ "type": "string"
80
+ },
81
+ "branchId": {
82
+ "type": "string"
83
+ },
84
+ "laneId": {
85
+ "type": "string"
86
+ },
87
+ "pinned": {
88
+ "type": "boolean"
89
+ },
90
+ "visibility": {
91
+ "type": "string",
92
+ "enum": [
93
+ "normal",
94
+ "hidden",
95
+ "crisis",
96
+ "conditional"
97
+ ]
98
+ },
99
+ "reveal": {
100
+ "type": "object",
101
+ "properties": {
102
+ "kind": {
103
+ "type": "string",
104
+ "enum": [
105
+ "allow_branch",
106
+ "event",
107
+ "decision",
108
+ "scripted_trigger",
109
+ "manual"
110
+ ]
111
+ },
112
+ "references": {
113
+ "maxItems": 10000,
114
+ "type": "array",
115
+ "items": {
116
+ "$ref": "#/$defs/__schema9"
117
+ }
118
+ },
119
+ "description": {
120
+ "type": "string"
121
+ },
122
+ "trigger": {
123
+ "type": "object",
124
+ "properties": {
125
+ "text": {
126
+ "type": "string"
127
+ },
128
+ "referencedFocusIds": {
129
+ "maxItems": 20000,
130
+ "type": "array",
131
+ "items": {
132
+ "$ref": "#/$defs/__schema10"
133
+ }
134
+ },
135
+ "sourceLocation": {
136
+ "type": "object",
137
+ "properties": {
138
+ "path": {
139
+ "type": "string",
140
+ "minLength": 1,
141
+ "maxLength": 4096
142
+ },
143
+ "start": {
144
+ "$ref": "#/$defs/__schema11"
145
+ },
146
+ "end": {
147
+ "$ref": "#/$defs/__schema11"
148
+ },
149
+ "symbol": {
150
+ "type": "string",
151
+ "maxLength": 1024
152
+ }
153
+ },
154
+ "required": [
155
+ "path",
156
+ "start",
157
+ "end"
158
+ ],
159
+ "additionalProperties": false
160
+ }
161
+ },
162
+ "required": [
163
+ "text",
164
+ "referencedFocusIds"
165
+ ],
166
+ "additionalProperties": false
167
+ }
168
+ },
169
+ "required": [
170
+ "kind",
171
+ "references"
172
+ ],
173
+ "additionalProperties": false
174
+ },
175
+ "convergence": {
176
+ "type": "boolean"
177
+ },
178
+ "sharedSupport": {
179
+ "type": "boolean"
180
+ },
181
+ "workingLabel": {
182
+ "type": "string"
183
+ },
184
+ "aiMajorRoute": {
185
+ "type": "boolean"
186
+ },
187
+ "aiStrategyIds": {
188
+ "type": "array",
189
+ "items": {
190
+ "type": "string"
191
+ }
192
+ },
193
+ "payoff": {
194
+ "type": "string"
195
+ },
196
+ "terminalKind": {
197
+ "type": "string",
198
+ "enum": [
199
+ "capstone",
200
+ "convergence",
201
+ "failure",
202
+ "route_lock",
203
+ "formable",
204
+ "side_payoff"
205
+ ]
206
+ },
207
+ "autoPosition": {
208
+ "type": "object",
209
+ "properties": {
210
+ "mode": {
211
+ "type": "string",
212
+ "const": "auto"
213
+ },
214
+ "pinned": {
215
+ "type": "boolean",
216
+ "const": false
217
+ },
218
+ "preferredX": {
219
+ "type": "integer",
220
+ "minimum": -100000,
221
+ "maximum": 100000
222
+ },
223
+ "preferredY": {
224
+ "type": "integer",
225
+ "minimum": -100000,
226
+ "maximum": 100000
227
+ }
228
+ },
229
+ "required": [
230
+ "mode",
231
+ "pinned"
232
+ ],
233
+ "additionalProperties": false
234
+ }
235
+ },
236
+ "required": [
237
+ "id",
238
+ "label",
239
+ "pinned",
240
+ "visibility",
241
+ "convergence",
242
+ "sharedSupport",
243
+ "aiMajorRoute",
244
+ "aiStrategyIds"
245
+ ],
246
+ "additionalProperties": false
247
+ }
248
+ }
249
+ },
250
+ "required": [
251
+ "schemaVersion",
252
+ "treeId",
253
+ "sourcePath",
254
+ "sourceHash",
255
+ "branchGroups",
256
+ "laneGroups",
257
+ "entryFocusIds",
258
+ "continuousFocusPaletteIds",
259
+ "continuousFocusIds",
260
+ "focuses"
261
+ ],
262
+ "additionalProperties": false,
263
+ "$defs": {
264
+ "__schema0": {
265
+ "type": "object",
266
+ "properties": {
267
+ "id": {
268
+ "type": "string",
269
+ "minLength": 1
270
+ },
271
+ "label": {
272
+ "type": "string"
273
+ },
274
+ "family": {
275
+ "type": "string"
276
+ },
277
+ "focusIds": {
278
+ "maxItems": 10000,
279
+ "type": "array",
280
+ "items": {
281
+ "$ref": "#/$defs/__schema1"
282
+ }
283
+ },
284
+ "laneId": {
285
+ "type": "string"
286
+ },
287
+ "major": {
288
+ "type": "boolean"
289
+ },
290
+ "hidden": {
291
+ "type": "boolean"
292
+ },
293
+ "crisis": {
294
+ "type": "boolean"
295
+ },
296
+ "conditional": {
297
+ "type": "boolean"
298
+ },
299
+ "aiStrategyIds": {
300
+ "maxItems": 10000,
301
+ "type": "array",
302
+ "items": {
303
+ "$ref": "#/$defs/__schema2"
304
+ }
305
+ }
306
+ },
307
+ "required": [
308
+ "id",
309
+ "label",
310
+ "family",
311
+ "focusIds",
312
+ "major",
313
+ "hidden",
314
+ "crisis",
315
+ "conditional",
316
+ "aiStrategyIds"
317
+ ],
318
+ "additionalProperties": false
319
+ },
320
+ "__schema1": {
321
+ "type": "string"
322
+ },
323
+ "__schema2": {
324
+ "type": "string"
325
+ },
326
+ "__schema3": {
327
+ "type": "object",
328
+ "properties": {
329
+ "id": {
330
+ "$ref": "#/$defs/__schema4"
331
+ },
332
+ "label": {
333
+ "$ref": "#/$defs/__schema5"
334
+ },
335
+ "order": {
336
+ "$ref": "#/$defs/__schema6"
337
+ },
338
+ "minimumX": {
339
+ "$ref": "#/$defs/__schema7"
340
+ },
341
+ "maximumX": {
342
+ "$ref": "#/$defs/__schema8"
343
+ }
344
+ },
345
+ "required": [
346
+ "id",
347
+ "label",
348
+ "order"
349
+ ],
350
+ "additionalProperties": false
351
+ },
352
+ "__schema4": {
353
+ "type": "string",
354
+ "minLength": 1
355
+ },
356
+ "__schema5": {
357
+ "type": "string"
358
+ },
359
+ "__schema6": {
360
+ "type": "integer",
361
+ "minimum": -9007199254740991,
362
+ "maximum": 9007199254740991
363
+ },
364
+ "__schema7": {
365
+ "type": "integer",
366
+ "minimum": -9007199254740991,
367
+ "maximum": 9007199254740991
368
+ },
369
+ "__schema8": {
370
+ "type": "integer",
371
+ "minimum": -9007199254740991,
372
+ "maximum": 9007199254740991
373
+ },
374
+ "__schema9": {
375
+ "type": "string"
376
+ },
377
+ "__schema10": {
378
+ "type": "string"
379
+ },
380
+ "__schema11": {
381
+ "type": "object",
382
+ "properties": {
383
+ "line": {
384
+ "type": "integer",
385
+ "minimum": 1,
386
+ "maximum": 9007199254740991
387
+ },
388
+ "column": {
389
+ "type": "integer",
390
+ "minimum": 1,
391
+ "maximum": 9007199254740991
392
+ },
393
+ "offset": {
394
+ "type": "integer",
395
+ "minimum": 0,
396
+ "maximum": 9007199254740991
397
+ }
398
+ },
399
+ "required": [
400
+ "line",
401
+ "column",
402
+ "offset"
403
+ ],
404
+ "additionalProperties": false
405
+ }
406
+ }
407
+ }
@@ -0,0 +1,176 @@
1
+ {
2
+ "$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v2.3.3/schemas/gui-animation-source.schema.json",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "$schema": {
7
+ "type": "string"
8
+ },
9
+ "schemaVersion": {
10
+ "type": "number",
11
+ "const": 1
12
+ },
13
+ "projectOwned": {
14
+ "type": "boolean",
15
+ "const": true
16
+ },
17
+ "sprite": {
18
+ "type": "string",
19
+ "minLength": 1,
20
+ "maxLength": 256
21
+ },
22
+ "sheet": {
23
+ "type": "object",
24
+ "properties": {
25
+ "path": {
26
+ "$ref": "#/$defs/__schema0"
27
+ },
28
+ "sha256": {
29
+ "$ref": "#/$defs/__schema1"
30
+ },
31
+ "frameWidth": {
32
+ "type": "integer",
33
+ "exclusiveMinimum": 0,
34
+ "maximum": 16384
35
+ },
36
+ "frameHeight": {
37
+ "type": "integer",
38
+ "exclusiveMinimum": 0,
39
+ "maximum": 16384
40
+ }
41
+ },
42
+ "required": [
43
+ "path",
44
+ "sha256",
45
+ "frameWidth",
46
+ "frameHeight"
47
+ ],
48
+ "additionalProperties": false
49
+ },
50
+ "sourceFrames": {
51
+ "minItems": 2,
52
+ "maxItems": 1024,
53
+ "type": "array",
54
+ "items": {
55
+ "$ref": "#/$defs/__schema2"
56
+ }
57
+ },
58
+ "animation": {
59
+ "type": "object",
60
+ "properties": {
61
+ "frameCount": {
62
+ "type": "integer",
63
+ "minimum": 2,
64
+ "maximum": 1024
65
+ },
66
+ "rateFps": {
67
+ "type": "number",
68
+ "exclusiveMinimum": 0,
69
+ "maximum": 10000
70
+ },
71
+ "looping": {
72
+ "type": "boolean"
73
+ },
74
+ "playOnShow": {
75
+ "type": "boolean"
76
+ },
77
+ "pauseOnLoop": {
78
+ "type": "number",
79
+ "minimum": 0,
80
+ "maximum": 86400
81
+ }
82
+ },
83
+ "required": [
84
+ "frameCount",
85
+ "rateFps",
86
+ "looping",
87
+ "playOnShow"
88
+ ],
89
+ "additionalProperties": false
90
+ },
91
+ "staticFallback": {
92
+ "type": "object",
93
+ "properties": {
94
+ "sprite": {
95
+ "type": "string",
96
+ "minLength": 1,
97
+ "maxLength": 256
98
+ },
99
+ "path": {
100
+ "$ref": "#/$defs/__schema0"
101
+ },
102
+ "sha256": {
103
+ "$ref": "#/$defs/__schema1"
104
+ },
105
+ "frameIndex": {
106
+ "type": "integer",
107
+ "minimum": 0,
108
+ "maximum": 1023
109
+ }
110
+ },
111
+ "required": [
112
+ "sprite",
113
+ "path",
114
+ "sha256",
115
+ "frameIndex"
116
+ ],
117
+ "additionalProperties": false
118
+ }
119
+ },
120
+ "required": [
121
+ "schemaVersion",
122
+ "projectOwned",
123
+ "sprite",
124
+ "sheet",
125
+ "sourceFrames",
126
+ "animation",
127
+ "staticFallback"
128
+ ],
129
+ "additionalProperties": false,
130
+ "$defs": {
131
+ "__schema0": {
132
+ "type": "string",
133
+ "minLength": 1,
134
+ "maxLength": 1024
135
+ },
136
+ "__schema1": {
137
+ "type": "string",
138
+ "pattern": "^[a-f0-9]{64}$"
139
+ },
140
+ "__schema2": {
141
+ "type": "object",
142
+ "properties": {
143
+ "path": {
144
+ "$ref": "#/$defs/__schema0"
145
+ },
146
+ "sha256": {
147
+ "$ref": "#/$defs/__schema1"
148
+ },
149
+ "anchor": {
150
+ "type": "object",
151
+ "properties": {
152
+ "x": {
153
+ "type": "number",
154
+ "minimum": 0
155
+ },
156
+ "y": {
157
+ "type": "number",
158
+ "minimum": 0
159
+ }
160
+ },
161
+ "required": [
162
+ "x",
163
+ "y"
164
+ ],
165
+ "additionalProperties": false
166
+ }
167
+ },
168
+ "required": [
169
+ "path",
170
+ "sha256",
171
+ "anchor"
172
+ ],
173
+ "additionalProperties": false
174
+ }
175
+ }
176
+ }