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,301 @@
1
+ {
2
+ "$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v2.3.3/schemas/gui-helper.schema.json",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "version": {
7
+ "default": 1,
8
+ "type": "number",
9
+ "const": 1
10
+ },
11
+ "templates": {
12
+ "default": [],
13
+ "maxItems": 1024,
14
+ "type": "array",
15
+ "items": {
16
+ "$ref": "#/$defs/__schema0"
17
+ }
18
+ },
19
+ "root": {
20
+ "$ref": "#/$defs/__schema1"
21
+ }
22
+ },
23
+ "required": [
24
+ "root"
25
+ ],
26
+ "additionalProperties": false,
27
+ "$defs": {
28
+ "__schema0": {
29
+ "type": "object",
30
+ "properties": {
31
+ "id": {
32
+ "type": "string",
33
+ "minLength": 1,
34
+ "maxLength": 256
35
+ },
36
+ "root": {
37
+ "$ref": "#/$defs/__schema1"
38
+ }
39
+ },
40
+ "required": [
41
+ "id",
42
+ "root"
43
+ ],
44
+ "additionalProperties": false
45
+ },
46
+ "__schema1": {
47
+ "type": "object",
48
+ "properties": {
49
+ "id": {
50
+ "type": "string",
51
+ "minLength": 1,
52
+ "maxLength": 256
53
+ },
54
+ "kind": {
55
+ "type": "string",
56
+ "enum": [
57
+ "raw",
58
+ "template",
59
+ "anchor",
60
+ "row",
61
+ "column",
62
+ "stack",
63
+ "grid",
64
+ "card",
65
+ "tabs",
66
+ "scroll-list",
67
+ "target-row",
68
+ "meter",
69
+ "status-panel",
70
+ "modal",
71
+ "overlay",
72
+ "element"
73
+ ]
74
+ },
75
+ "templateId": {
76
+ "type": "string",
77
+ "minLength": 1,
78
+ "maxLength": 256
79
+ },
80
+ "name": {
81
+ "type": "string",
82
+ "minLength": 1,
83
+ "maxLength": 256
84
+ },
85
+ "elementType": {
86
+ "type": "string",
87
+ "minLength": 1,
88
+ "maxLength": 256
89
+ },
90
+ "x": {
91
+ "type": "number"
92
+ },
93
+ "y": {
94
+ "type": "number"
95
+ },
96
+ "width": {
97
+ "type": "number",
98
+ "minimum": 0
99
+ },
100
+ "height": {
101
+ "type": "number",
102
+ "minimum": 0
103
+ },
104
+ "gap": {
105
+ "type": "number",
106
+ "minimum": 0
107
+ },
108
+ "columns": {
109
+ "type": "integer",
110
+ "exclusiveMinimum": 0,
111
+ "maximum": 10000
112
+ },
113
+ "padding": {
114
+ "$ref": "#/$defs/__schema2"
115
+ },
116
+ "margin": {
117
+ "$ref": "#/$defs/__schema2"
118
+ },
119
+ "orientation": {
120
+ "type": "string",
121
+ "minLength": 1,
122
+ "maxLength": 64
123
+ },
124
+ "origo": {
125
+ "type": "string",
126
+ "minLength": 1,
127
+ "maxLength": 64
128
+ },
129
+ "flow": {
130
+ "type": "string",
131
+ "enum": [
132
+ "horizontal",
133
+ "vertical"
134
+ ]
135
+ },
136
+ "sprite": {
137
+ "type": "string",
138
+ "minLength": 1
139
+ },
140
+ "backgroundSprite": {
141
+ "type": "string",
142
+ "minLength": 1
143
+ },
144
+ "scrollbar": {
145
+ "type": "string",
146
+ "minLength": 1
147
+ },
148
+ "text": {
149
+ "type": "string"
150
+ },
151
+ "font": {
152
+ "type": "string",
153
+ "minLength": 1
154
+ },
155
+ "state": {
156
+ "type": "string",
157
+ "minLength": 1,
158
+ "maxLength": 128
159
+ },
160
+ "stateVariants": {
161
+ "default": [],
162
+ "maxItems": 64,
163
+ "type": "array",
164
+ "items": {
165
+ "$ref": "#/$defs/__schema3"
166
+ }
167
+ },
168
+ "minValue": {
169
+ "type": "number"
170
+ },
171
+ "maxValue": {
172
+ "type": "number"
173
+ },
174
+ "value": {
175
+ "type": "number"
176
+ },
177
+ "frames": {
178
+ "type": "integer",
179
+ "minimum": 2,
180
+ "maximum": 10000
181
+ },
182
+ "attributes": {
183
+ "$ref": "#/$defs/__schema9"
184
+ },
185
+ "raw": {
186
+ "type": "string"
187
+ },
188
+ "children": {
189
+ "default": [],
190
+ "type": "array",
191
+ "items": {
192
+ "$ref": "#/$defs/__schema1"
193
+ }
194
+ }
195
+ },
196
+ "required": [
197
+ "id",
198
+ "kind"
199
+ ],
200
+ "additionalProperties": false
201
+ },
202
+ "__schema2": {
203
+ "anyOf": [
204
+ {
205
+ "type": "number"
206
+ },
207
+ {
208
+ "type": "object",
209
+ "properties": {
210
+ "top": {
211
+ "default": 0,
212
+ "type": "number"
213
+ },
214
+ "right": {
215
+ "default": 0,
216
+ "type": "number"
217
+ },
218
+ "bottom": {
219
+ "default": 0,
220
+ "type": "number"
221
+ },
222
+ "left": {
223
+ "default": 0,
224
+ "type": "number"
225
+ }
226
+ },
227
+ "additionalProperties": false
228
+ }
229
+ ]
230
+ },
231
+ "__schema3": {
232
+ "type": "object",
233
+ "properties": {
234
+ "state": {
235
+ "$ref": "#/$defs/__schema4"
236
+ },
237
+ "frame": {
238
+ "$ref": "#/$defs/__schema5"
239
+ },
240
+ "sprite": {
241
+ "$ref": "#/$defs/__schema6"
242
+ },
243
+ "text": {
244
+ "$ref": "#/$defs/__schema7"
245
+ },
246
+ "font": {
247
+ "$ref": "#/$defs/__schema8"
248
+ },
249
+ "attributes": {
250
+ "$ref": "#/$defs/__schema9"
251
+ }
252
+ },
253
+ "required": [
254
+ "state"
255
+ ],
256
+ "additionalProperties": false
257
+ },
258
+ "__schema4": {
259
+ "type": "string",
260
+ "minLength": 1,
261
+ "maxLength": 128
262
+ },
263
+ "__schema5": {
264
+ "type": "integer",
265
+ "minimum": 0,
266
+ "maximum": 9007199254740991
267
+ },
268
+ "__schema6": {
269
+ "type": "string",
270
+ "minLength": 1
271
+ },
272
+ "__schema7": {
273
+ "type": "string"
274
+ },
275
+ "__schema8": {
276
+ "type": "string",
277
+ "minLength": 1
278
+ },
279
+ "__schema9": {
280
+ "default": {},
281
+ "type": "object",
282
+ "propertyNames": {
283
+ "type": "string",
284
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
285
+ },
286
+ "additionalProperties": {
287
+ "anyOf": [
288
+ {
289
+ "type": "string"
290
+ },
291
+ {
292
+ "type": "number"
293
+ },
294
+ {
295
+ "type": "boolean"
296
+ }
297
+ ]
298
+ }
299
+ }
300
+ }
301
+ }
@@ -0,0 +1,298 @@
1
+ {
2
+ "$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v2.3.3/schemas/gui-scenario.schema.json",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "id": {
7
+ "$ref": "#/$defs/__schema0"
8
+ },
9
+ "description": {
10
+ "$ref": "#/$defs/__schema1"
11
+ },
12
+ "resolution": {
13
+ "$ref": "#/$defs/__schema2"
14
+ },
15
+ "uiScale": {
16
+ "$ref": "#/$defs/__schema5"
17
+ },
18
+ "state": {
19
+ "$ref": "#/$defs/__schema6"
20
+ },
21
+ "language": {
22
+ "$ref": "#/$defs/__schema8"
23
+ },
24
+ "animationTimeSeconds": {
25
+ "$ref": "#/$defs/__schema9"
26
+ },
27
+ "visibleTimeSeconds": {
28
+ "$ref": "#/$defs/__schema10"
29
+ },
30
+ "country": {
31
+ "$ref": "#/$defs/__schema11"
32
+ },
33
+ "stateValues": {
34
+ "$ref": "#/$defs/__schema13"
35
+ },
36
+ "variables": {
37
+ "$ref": "#/$defs/__schema14"
38
+ },
39
+ "flags": {
40
+ "$ref": "#/$defs/__schema15"
41
+ },
42
+ "lists": {
43
+ "$ref": "#/$defs/__schema16"
44
+ },
45
+ "localisation": {
46
+ "$ref": "#/$defs/__schema17"
47
+ },
48
+ "scriptedGui": {
49
+ "$ref": "#/$defs/__schema18"
50
+ },
51
+ "visibility": {
52
+ "$ref": "#/$defs/__schema19"
53
+ },
54
+ "elementStates": {
55
+ "$ref": "#/$defs/__schema20"
56
+ },
57
+ "selectedFrames": {
58
+ "$ref": "#/$defs/__schema21"
59
+ },
60
+ "scrollOffsets": {
61
+ "$ref": "#/$defs/__schema22"
62
+ },
63
+ "guiCosts": {
64
+ "$ref": "#/$defs/__schema23"
65
+ },
66
+ "scriptCosts": {
67
+ "$ref": "#/$defs/__schema24"
68
+ }
69
+ },
70
+ "required": [
71
+ "id"
72
+ ],
73
+ "additionalProperties": false,
74
+ "$defs": {
75
+ "__schema0": {
76
+ "type": "string",
77
+ "minLength": 1,
78
+ "maxLength": 128,
79
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
80
+ },
81
+ "__schema1": {
82
+ "type": "string",
83
+ "maxLength": 500
84
+ },
85
+ "__schema2": {
86
+ "default": {
87
+ "width": 1920,
88
+ "height": 1080
89
+ },
90
+ "type": "object",
91
+ "properties": {
92
+ "width": {
93
+ "$ref": "#/$defs/__schema3"
94
+ },
95
+ "height": {
96
+ "$ref": "#/$defs/__schema4"
97
+ }
98
+ },
99
+ "required": [
100
+ "width",
101
+ "height"
102
+ ],
103
+ "additionalProperties": false
104
+ },
105
+ "__schema3": {
106
+ "type": "integer",
107
+ "minimum": 320,
108
+ "maximum": 16384
109
+ },
110
+ "__schema4": {
111
+ "type": "integer",
112
+ "minimum": 200,
113
+ "maximum": 16384
114
+ },
115
+ "__schema5": {
116
+ "default": 1,
117
+ "type": "number",
118
+ "minimum": 0.25,
119
+ "maximum": 4
120
+ },
121
+ "__schema6": {
122
+ "default": "normal",
123
+ "$ref": "#/$defs/__schema7"
124
+ },
125
+ "__schema7": {
126
+ "type": "string",
127
+ "enum": [
128
+ "normal",
129
+ "hover",
130
+ "selected",
131
+ "locked",
132
+ "disabled",
133
+ "warning",
134
+ "active",
135
+ "completed",
136
+ "empty-list",
137
+ "full-list",
138
+ "minimum-value",
139
+ "maximum-value",
140
+ "long-text",
141
+ "missing-localisation"
142
+ ]
143
+ },
144
+ "__schema8": {
145
+ "default": "l_english",
146
+ "type": "string",
147
+ "pattern": "^l_[a-z_]+$"
148
+ },
149
+ "__schema9": {
150
+ "default": 0,
151
+ "type": "number",
152
+ "minimum": 0,
153
+ "maximum": 86400
154
+ },
155
+ "__schema10": {
156
+ "type": "number",
157
+ "minimum": 0,
158
+ "maximum": 86400
159
+ },
160
+ "__schema11": {
161
+ "$ref": "#/$defs/__schema12"
162
+ },
163
+ "__schema12": {
164
+ "type": "object",
165
+ "propertyNames": {
166
+ "type": "string"
167
+ },
168
+ "additionalProperties": {
169
+ "anyOf": [
170
+ {
171
+ "type": "string",
172
+ "maxLength": 16384
173
+ },
174
+ {
175
+ "type": "number"
176
+ },
177
+ {
178
+ "type": "boolean"
179
+ }
180
+ ]
181
+ }
182
+ },
183
+ "__schema13": {
184
+ "$ref": "#/$defs/__schema12"
185
+ },
186
+ "__schema14": {
187
+ "default": {},
188
+ "type": "object",
189
+ "propertyNames": {
190
+ "type": "string"
191
+ },
192
+ "additionalProperties": {
193
+ "type": "number"
194
+ }
195
+ },
196
+ "__schema15": {
197
+ "default": {},
198
+ "type": "object",
199
+ "propertyNames": {
200
+ "type": "string"
201
+ },
202
+ "additionalProperties": {
203
+ "type": "boolean"
204
+ }
205
+ },
206
+ "__schema16": {
207
+ "default": {},
208
+ "type": "object",
209
+ "propertyNames": {
210
+ "type": "string"
211
+ },
212
+ "additionalProperties": {
213
+ "maxItems": 10000,
214
+ "type": "array",
215
+ "items": {
216
+ "$ref": "#/$defs/__schema12"
217
+ }
218
+ }
219
+ },
220
+ "__schema17": {
221
+ "default": {},
222
+ "type": "object",
223
+ "propertyNames": {
224
+ "type": "string"
225
+ },
226
+ "additionalProperties": {
227
+ "type": "string"
228
+ }
229
+ },
230
+ "__schema18": {
231
+ "default": {},
232
+ "$ref": "#/$defs/__schema12"
233
+ },
234
+ "__schema19": {
235
+ "default": {},
236
+ "type": "object",
237
+ "propertyNames": {
238
+ "type": "string"
239
+ },
240
+ "additionalProperties": {
241
+ "type": "boolean"
242
+ }
243
+ },
244
+ "__schema20": {
245
+ "default": {},
246
+ "type": "object",
247
+ "propertyNames": {
248
+ "type": "string"
249
+ },
250
+ "additionalProperties": {
251
+ "$ref": "#/$defs/__schema7"
252
+ }
253
+ },
254
+ "__schema21": {
255
+ "default": {},
256
+ "type": "object",
257
+ "propertyNames": {
258
+ "type": "string"
259
+ },
260
+ "additionalProperties": {
261
+ "type": "integer",
262
+ "minimum": 0,
263
+ "maximum": 9007199254740991
264
+ }
265
+ },
266
+ "__schema22": {
267
+ "default": {},
268
+ "type": "object",
269
+ "propertyNames": {
270
+ "type": "string"
271
+ },
272
+ "additionalProperties": {
273
+ "type": "number",
274
+ "minimum": 0
275
+ }
276
+ },
277
+ "__schema23": {
278
+ "default": {},
279
+ "type": "object",
280
+ "propertyNames": {
281
+ "type": "string"
282
+ },
283
+ "additionalProperties": {
284
+ "type": "number"
285
+ }
286
+ },
287
+ "__schema24": {
288
+ "default": {},
289
+ "type": "object",
290
+ "propertyNames": {
291
+ "type": "string"
292
+ },
293
+ "additionalProperties": {
294
+ "type": "number"
295
+ }
296
+ }
297
+ }
298
+ }