hoi4-agent-tools 2.0.0 → 2.1.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 (37) hide show
  1. package/CHANGELOG.md +14 -1
  2. package/README.md +4 -3
  3. package/dist/hoi4_agent_tools/core/artifacts.js +109 -4
  4. package/dist/hoi4_agent_tools/core/diagnostic-collector.js +28 -8
  5. package/dist/hoi4_agent_tools/core/diff.js +162 -4
  6. package/dist/hoi4_agent_tools/core/engine.js +2 -0
  7. package/dist/hoi4_agent_tools/core/index.js +17 -6
  8. package/dist/hoi4_agent_tools/core/render-budget.js +5 -3
  9. package/dist/hoi4_agent_tools/core/scanner.js +3 -2
  10. package/dist/hoi4_agent_tools/core/source/limits.js +4 -1
  11. package/dist/hoi4_agent_tools/event/graph.js +28 -6
  12. package/dist/hoi4_agent_tools/event/limits.js +1 -1
  13. package/dist/hoi4_agent_tools/event/service.js +103 -7
  14. package/dist/hoi4_agent_tools/focus/continuous-render.js +17 -8
  15. package/dist/hoi4_agent_tools/focus/presentation.js +96 -41
  16. package/dist/hoi4_agent_tools/focus/render.js +27 -16
  17. package/dist/hoi4_agent_tools/gui/assets.js +9 -2
  18. package/dist/hoi4_agent_tools/gui/inspection-artifact.js +99 -0
  19. package/dist/hoi4_agent_tools/gui/layout.js +7 -3
  20. package/dist/hoi4_agent_tools/gui/source-graph.js +61 -28
  21. package/dist/hoi4_agent_tools/gui/studio.js +23 -8
  22. package/dist/hoi4_agent_tools/map/diagnostic-limit.js +90 -9
  23. package/dist/hoi4_agent_tools/map/model.js +22 -4
  24. package/dist/hoi4_agent_tools/map/service.js +4 -3
  25. package/dist/hoi4_agent_tools/map/validation.js +3 -2
  26. package/dist/hoi4_agent_tools/mcp/server/create.js +1 -1
  27. package/dist/hoi4_agent_tools/mcp/server/output-schemas.js +1 -1
  28. package/dist/hoi4_agent_tools/mcp/tools/focus.js +145 -223
  29. package/dist/hoi4_agent_tools/mcp/tools/gui.js +29 -22
  30. package/dist/hoi4_agent_tools/version.js +1 -1
  31. package/docs/events.md +4 -5
  32. package/docs/focus.md +5 -4
  33. package/docs/gui.md +4 -2
  34. package/docs/map.md +1 -1
  35. package/docs/setup.md +1 -1
  36. package/package.json +1 -1
  37. package/server.json +2 -2
package/docs/focus.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Focus trees
2
2
 
3
- Use `hoi4.focus_inspect`, `hoi4.focus_render`, and `hoi4.focus_rewrite` for national focus trees and continuous focus palettes. Omit `workspaceId` when the MCP working directory is inside the target mod.
3
+ Use `hoi4.focus_inspect`, `hoi4.focus_render`, `hoi4.focus_raster`, and `hoi4.focus_rewrite` for national focus trees and continuous focus palettes.
4
4
 
5
5
  ## Create a tree
6
6
 
@@ -14,7 +14,7 @@ A complete plan should include:
14
14
  - focus positions, convergence points, and shared support branches;
15
15
  - titles, descriptions, icons, filters, and AI behavior.
16
16
 
17
- For a missing target, call `hoi4.focus_rewrite` with `createIfMissing: true`. Review the proposed and final artifacts returned by the rewrite, then inspect and render the result. Do not call a tree complete with placeholder rewards, missing localisation, missing icons, or absent AI choices.
17
+ For a missing target, call `hoi4.focus_rewrite` with `createIfMissing: true`. Review the proposed and final artifacts returned by the rewrite, then inspect and render the result. Call `hoi4.focus_raster` when the review needs decoded source icons and a deterministic PNG. Do not call a tree complete with placeholder rewards, missing localisation, missing icons, or absent AI choices.
18
18
 
19
19
  ## Clean an existing tree
20
20
 
@@ -22,7 +22,6 @@ For a layout-only cleanup of an existing national tree, call `hoi4.focus_rewrite
22
22
 
23
23
  ```json
24
24
  {
25
- "workspaceId": "my-mod",
26
25
  "relativePath": "common/national_focus/my_tree.txt",
27
26
  "treeId": "my_tree",
28
27
  "layoutMode": "compact"
@@ -47,4 +46,6 @@ If malformed or unsupported script makes a requested change ambiguous, the rewri
47
46
 
48
47
  Inspection and rendering can report missing references, invalid prerequisite structure, duplicate or overlapping positions, insufficient spacing, long or crossing connectors, branch asymmetry, route conflicts, missing localisation or sprites, weak terminal branches, repeated rewards, and missing AI metadata. Renders are offline review artifacts, not game screenshots.
49
48
 
50
- National trees with 200 or more focuses render review PNGs at half scale by default so large agent workflows stay responsive. Pass an explicit `reviewScale` from `0.25` through `1` when a different raster size is needed; HTML, SVG, JSON, layout, and diagnostics remain complete.
49
+ `hoi4.focus_render` is the normal structural view and writes complete HTML, SVG, JSON, and source-map artifacts without decoding every icon or creating a PNG. `hoi4.focus_raster` adds decoded icons and the high-fidelity PNG. National trees with 200 or more focuses raster at half scale by default; pass `reviewScale` from `0.25` through `1` when a different PNG size is needed.
50
+
51
+ The public workflow is regression-tested with 1,024-focus creation, compact rewrites, deterministic repeat runs, inspection, vector rendering, and raster rendering. A separate 1,024-icon test decodes a distinct texture for every focus. Large source diffs use the same deterministic review-artifact path instead of blocking at the quadratic matrix size.
package/docs/gui.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Scripted GUIs
2
2
 
3
- Use `hoi4.gui_inspect`, `hoi4.gui_render`, and `hoi4.gui_rewrite` for `.gui`, `.gfx`, `common/scripted_guis`, localisation, sprites, fonts, and linked decision entry points. Omit `workspaceId` when the MCP working directory is inside the target mod.
3
+ Use `hoi4.gui_inspect`, `hoi4.gui_render`, and `hoi4.gui_rewrite` for `.gui`, `.gfx`, `common/scripted_guis`, localisation, sprites, fonts, and linked decision entry points.
4
4
 
5
5
  ## Create a GUI
6
6
 
@@ -30,10 +30,12 @@ Rewrite once, then inspect and render the result.
30
30
 
31
31
  Inspection checks missing assets and localisation, invalid sizes, overlap, clipping, overflow, conflicting click regions, invisible blockers, broken parents or contexts, list-row cuts, state conflicts, trigger/effect gaps, and resolution drift.
32
32
 
33
+ Broad inspection indexes localisation actually referenced by GUI source and returns a connected workspace projection when the complete source graph is very large. The resource records full and returned node and edge counts, so an agent can identify the relevant window without loading unrelated vanilla UI into its prompt. Rendering remains targeted to the selected root, state, and resolution.
34
+
33
35
  ## Offline preview limits
34
36
 
35
37
  The renderer does not run the game engine. Each render includes a fidelity report that separates fields it models from fields it approximates, ignores, cannot resolve, or does not support. Treat that report as part of the review.
36
38
 
37
- Unresolved runtime localisation expressions such as `[GetValue]` and `[?variable|format]` render as the compact placeholder `[X]`; provide scenario values when the exact text matters. Supported HOI4 `§` localisation colour controls are applied to preview text and `§!` restores the default colour.
39
+ Unresolved numeric runtime values such as `[?variable|format]` render as `[X]`. Unresolved text-returning scripted or scoped localisation such as `[GetStatusText]`, `[FROM.GetName]`, and `[?leader_scope.GetName]` renders as `[dynamic_loc]`. Provide scenario values when the exact value matters. Supported HOI4 `§` localisation colour controls are applied to preview text and `§!` restores the default colour.
38
40
 
39
41
  A rewrite stops if malformed or unsupported GUI script makes the requested change ambiguous. Runtime animation, masking, tiling, hardcoded controls, and dynamic values may require exact game precedents even when a useful offline preview is available.
package/docs/map.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Maps
2
2
 
3
- Use `hoi4.map_inspect`, `hoi4.map_render`, and `hoi4.map_rewrite` for provinces, states, strategic regions, adjacency, supply nodes, railways, positions, ownership, cores, claims, resources, buildings, and localisation. Omit `workspaceId` when the MCP working directory is inside the target mod.
3
+ Use `hoi4.map_inspect`, `hoi4.map_render`, and `hoi4.map_rewrite` for provinces, states, strategic regions, adjacency, supply nodes, railways, positions, ownership, cores, claims, resources, buildings, and localisation.
4
4
 
5
5
  ## Create or reshape map content
6
6
 
package/docs/setup.md CHANGED
@@ -10,7 +10,7 @@ npm install --global hoi4-agent-tools
10
10
 
11
11
  Set the MCP process working directory to the mod being edited. The server creates its local workspace in memory, keeps generated artifacts in the per-user data directory, and starts without a config file. The installed game is detected when available for vanilla references; it is not required for source inspection or offline rendering.
12
12
 
13
- When the MCP server starts with its working directory inside a mod, every focus, GUI, map, and event call uses that mod automatically. Omit `workspaceId`. Explicit `workspaceId` values remain available for configured multi-mod or remote deployments.
13
+ When the MCP server starts with its working directory inside a mod, every focus, GUI, map, and event call uses that mod automatically. Configured multi-mod or remote deployments can use explicit workspace selection.
14
14
 
15
15
  ## Optional persistent configuration
16
16
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hoi4-agent-tools",
3
3
  "mcpName": "io.github.klimPaskov/hoi4-agent-tools",
4
- "version": "2.0.0",
4
+ "version": "2.1.0",
5
5
  "description": "Analyze HOI4 event chains; create and clean focus trees, scripted GUIs, and maps with coding agents.",
6
6
  "type": "module",
7
7
  "license": "Apache-2.0",
package/server.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "io.github.klimPaskov/hoi4-agent-tools",
4
4
  "title": "HOI4 Agent Tools",
5
5
  "description": "Analyze HOI4 event chains; create and clean focus trees, scripted GUIs, and maps with coding agents.",
6
- "version": "2.0.0",
6
+ "version": "2.1.0",
7
7
  "repository": {
8
8
  "url": "https://github.com/klimPaskov/hoi4-agent-tools",
9
9
  "source": "github"
@@ -13,7 +13,7 @@
13
13
  {
14
14
  "registryType": "npm",
15
15
  "identifier": "hoi4-agent-tools",
16
- "version": "2.0.0",
16
+ "version": "2.1.0",
17
17
  "transport": {
18
18
  "type": "stdio"
19
19
  }