hoi4-agent-tools 3.10.0 → 4.0.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 (150) hide show
  1. package/CHANGELOG.md +109 -0
  2. package/README.md +115 -147
  3. package/dist/bin/http.js +10 -0
  4. package/dist/bin/setup.js +3 -2
  5. package/dist/bin/stdio.js +10 -0
  6. package/dist/hoi4_agent_tools/core/artifacts.js +40 -5
  7. package/dist/hoi4_agent_tools/core/canonical.js +18 -4
  8. package/dist/hoi4_agent_tools/core/configuration.js +7 -0
  9. package/dist/hoi4_agent_tools/core/domain-scan-patterns.js +12 -0
  10. package/dist/hoi4_agent_tools/core/domain-tools.js +65 -0
  11. package/dist/hoi4_agent_tools/core/domain-validation.js +5 -2
  12. package/dist/hoi4_agent_tools/core/engine.js +29 -2
  13. package/dist/hoi4_agent_tools/core/index.js +2 -2
  14. package/dist/hoi4_agent_tools/core/job-executor.js +14 -1
  15. package/dist/hoi4_agent_tools/core/job-operation-registration.js +15 -7
  16. package/dist/hoi4_agent_tools/core/job-store.js +78 -5
  17. package/dist/hoi4_agent_tools/core/job-transactions.js +31 -2
  18. package/dist/hoi4_agent_tools/core/job-worker-host.js +215 -116
  19. package/dist/hoi4_agent_tools/core/job-worker.js +90 -36
  20. package/dist/hoi4_agent_tools/core/operation-result.js +123 -10
  21. package/dist/hoi4_agent_tools/core/operation-tasks.js +49 -89
  22. package/dist/hoi4_agent_tools/core/persistent-analysis-cache.js +25 -21
  23. package/dist/hoi4_agent_tools/core/server-registry.js +22 -5
  24. package/dist/hoi4_agent_tools/core/shared-request-capacity.js +26 -1
  25. package/dist/hoi4_agent_tools/core/source/cache.js +20 -10
  26. package/dist/hoi4_agent_tools/core/source/lexer.js +11 -3
  27. package/dist/hoi4_agent_tools/core/transactions.js +114 -23
  28. package/dist/hoi4_agent_tools/core/workspace.js +84 -8
  29. package/dist/hoi4_agent_tools/decision/ai.js +1 -1
  30. package/dist/hoi4_agent_tools/decision/service.js +28 -0
  31. package/dist/hoi4_agent_tools/decision/source-inventory.js +7 -5
  32. package/dist/hoi4_agent_tools/event/job-operations.js +9 -5
  33. package/dist/hoi4_agent_tools/event/operations.js +14 -1
  34. package/dist/hoi4_agent_tools/focus/job-operations.js +1 -2
  35. package/dist/hoi4_agent_tools/focus/tool-operations.js +1 -1
  36. package/dist/hoi4_agent_tools/gui/validators.js +8 -6
  37. package/dist/hoi4_agent_tools/map/bmp.js +1 -1
  38. package/dist/hoi4_agent_tools/map/derived.js +748 -0
  39. package/dist/hoi4_agent_tools/map/job-operations.js +7 -3
  40. package/dist/hoi4_agent_tools/map/model.js +103 -0
  41. package/dist/hoi4_agent_tools/map/operations.js +427 -58
  42. package/dist/hoi4_agent_tools/map/references.js +483 -0
  43. package/dist/hoi4_agent_tools/map/service.js +136 -61
  44. package/dist/hoi4_agent_tools/map/tool-operations.js +2 -1
  45. package/dist/hoi4_agent_tools/map/validation.js +3 -0
  46. package/dist/hoi4_agent_tools/map/world.js +1280 -0
  47. package/dist/hoi4_agent_tools/mcp/server/argument-errors.js +72 -0
  48. package/dist/hoi4_agent_tools/mcp/server/create-modern-operations.js +23 -5
  49. package/dist/hoi4_agent_tools/mcp/server/create.js +7 -0
  50. package/dist/hoi4_agent_tools/mcp/server/request-lifecycle.js +24 -30
  51. package/dist/hoi4_agent_tools/mcp/server/tool-listing.js +45 -0
  52. package/dist/hoi4_agent_tools/mcp/tools/analysis.js +25 -5
  53. package/dist/hoi4_agent_tools/mcp/tools/event.js +18 -29
  54. package/dist/hoi4_agent_tools/mcp/tools/focus.js +4 -12
  55. package/dist/hoi4_agent_tools/mcp/tools/gui.js +3 -3
  56. package/dist/hoi4_agent_tools/mcp/tools/job.js +2 -2
  57. package/dist/hoi4_agent_tools/mcp/tools/map.js +13 -16
  58. package/dist/hoi4_agent_tools/mcp/tools/probability.js +42 -48
  59. package/dist/hoi4_agent_tools/mcp/tools/reference.js +22 -5
  60. package/dist/hoi4_agent_tools/mcp/tools/technology.js +16 -29
  61. package/dist/hoi4_agent_tools/mcp/transports/http.js +28 -4
  62. package/dist/hoi4_agent_tools/mcp/transports/stdio-lifetime.js +31 -8
  63. package/dist/hoi4_agent_tools/probability/job-operations.js +4 -9
  64. package/dist/hoi4_agent_tools/probability/operations.js +175 -13
  65. package/dist/hoi4_agent_tools/probability/source-analysis.js +24 -1
  66. package/dist/hoi4_agent_tools/reference/error-log.js +359 -0
  67. package/dist/hoi4_agent_tools/reference/known-mistakes.js +307 -0
  68. package/dist/hoi4_agent_tools/reference/known-mistakes.json +154 -0
  69. package/dist/hoi4_agent_tools/reference/mod-index.js +101 -0
  70. package/dist/hoi4_agent_tools/reference/operations.js +88 -19
  71. package/dist/hoi4_agent_tools/reference/player-text.js +4 -3
  72. package/dist/hoi4_agent_tools/reference/script-validation.js +19 -1
  73. package/dist/hoi4_agent_tools/reference/service.js +6 -0
  74. package/dist/hoi4_agent_tools/schemas/event.js +78 -19
  75. package/dist/hoi4_agent_tools/schemas/focus-requests.js +10 -0
  76. package/dist/hoi4_agent_tools/schemas/lenient-arguments.js +266 -0
  77. package/dist/hoi4_agent_tools/schemas/map-requests.js +63 -20
  78. package/dist/hoi4_agent_tools/schemas/map.js +122 -3
  79. package/dist/hoi4_agent_tools/schemas/mod-tools.js +181 -0
  80. package/dist/hoi4_agent_tools/schemas/probability-requests.js +119 -9
  81. package/dist/hoi4_agent_tools/schemas/reference.js +13 -0
  82. package/dist/hoi4_agent_tools/schemas/scenarios.js +1 -3
  83. package/dist/hoi4_agent_tools/schemas/script-validation.js +13 -6
  84. package/dist/hoi4_agent_tools/schemas/technology.js +79 -21
  85. package/dist/hoi4_agent_tools/technology/job-operations.js +3 -4
  86. package/dist/hoi4_agent_tools/technology/operations.js +14 -1
  87. package/dist/hoi4_agent_tools/version.js +1 -1
  88. package/docs/README.md +7 -4
  89. package/docs/analysis.md +13 -0
  90. package/docs/configuration.md +281 -0
  91. package/docs/development.md +24 -2
  92. package/docs/events.md +27 -3
  93. package/docs/examples.md +6 -6
  94. package/docs/focus.md +125 -4
  95. package/docs/gui.md +98 -17
  96. package/docs/helper-expansion.md +8 -8
  97. package/docs/http.md +3 -1
  98. package/docs/jobs.md +19 -13
  99. package/docs/map.md +197 -6
  100. package/docs/mechanics.md +4 -0
  101. package/docs/probability.md +42 -15
  102. package/docs/reference.md +71 -4
  103. package/docs/setup.md +44 -11
  104. package/docs/technology.md +26 -1
  105. package/docs/third-party-notices.md +11 -0
  106. package/docs/tools.md +151 -42
  107. package/docs/troubleshooting.md +61 -0
  108. package/examples/clients/codex-config.toml +5 -2
  109. package/examples/clients/generic.json +2 -2
  110. package/examples/config/config.json +7 -0
  111. package/npm-shrinkwrap.json +151 -156
  112. package/package.json +13 -8
  113. package/schemas/configuration.schema.json +144 -128
  114. package/schemas/continuous-focus-palette.schema.json +1 -1
  115. package/schemas/custom-weighted-pool.schema.json +1 -1
  116. package/schemas/decision-inspect-input.schema.json +1 -1
  117. package/schemas/error-log-input.schema.json +55 -0
  118. package/schemas/event-feature-manifest.schema.json +1 -1
  119. package/schemas/focus-plan.schema.json +1 -1
  120. package/schemas/focus-planning-sidecar.schema.json +1 -1
  121. package/schemas/gui-animation-source.schema.json +1 -1
  122. package/schemas/gui-helper.schema.json +1 -1
  123. package/schemas/gui-scenario.schema.json +1 -1
  124. package/schemas/helper-expansion-request.schema.json +1 -1
  125. package/schemas/helper-expansion-summary.schema.json +1 -1
  126. package/schemas/impact-inspect-input.schema.json +1 -1
  127. package/schemas/map-operation.schema.json +597 -126
  128. package/schemas/mechanic-test-input.schema.json +1 -1
  129. package/schemas/mod-index-input.schema.json +51 -0
  130. package/schemas/operation-result.schema.json +2 -2
  131. package/schemas/package-check-input.schema.json +1 -1
  132. package/schemas/package-manifest.schema.json +1 -1
  133. package/schemas/probability-analysis-result.schema.json +1 -1
  134. package/schemas/probability-compare-input.schema.json +1 -1
  135. package/schemas/probability-evaluate-input.schema.json +1 -1
  136. package/schemas/probability-inspect-input.schema.json +1 -1
  137. package/schemas/probability-render-input.schema.json +1 -1
  138. package/schemas/probability-scenario-set.schema.json +1 -1
  139. package/schemas/probability-sequence-input.schema.json +1 -1
  140. package/schemas/probability-simulate-input.schema.json +1 -1
  141. package/schemas/probability-sweep-input.schema.json +1 -1
  142. package/schemas/reference-context-input.schema.json +1 -1
  143. package/schemas/reference-read-input.schema.json +1 -1
  144. package/schemas/reference-search-input.schema.json +1 -1
  145. package/schemas/scenario-suite.schema.json +3 -5
  146. package/schemas/scenario-test-input.schema.json +3 -5
  147. package/schemas/script-validate-input.schema.json +1 -1
  148. package/schemas/shared-scenario.schema.json +1 -1
  149. package/schemas/source-lookup-input.schema.json +1 -1
  150. package/server.json +3 -3
package/docs/setup.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Setup
2
2
 
3
- You need a coding agent that supports MCP and Node.js 22.19+ in the Node 22 line, or Node.js 24.
3
+ You need a coding agent that supports MCP and Node.js 22 (22.19 or later) or Node.js 24.
4
4
  Keep an installed copy of Hearts of Iron IV available for vanilla references, artwork and fonts.
5
5
 
6
6
  ## 1. Install
@@ -21,13 +21,28 @@ Previews need the assets and fonts referenced by the mod; missing files are repo
21
21
  hoi4-agent-tools-setup --print-client-config
22
22
  ```
23
23
 
24
- Copy the printed `globalInstall` configuration into your MCP client, or use `codexTomlGlobal` for a TOML-based Codex configuration.
25
- The printed command is correct for your platform.
24
+ The command prints four alternatives:
25
+
26
+ | Key | Use it for |
27
+ | ----------------- | ----------------------------------------------------------------------------- |
28
+ | `globalInstall` | JSON clients (Claude Code, Claude Desktop, Cursor and others), global install |
29
+ | `codexTomlGlobal` | Codex `config.toml`, global install |
30
+ | `generic` | JSON clients that should start a pinned version through `npx` |
31
+ | `codexToml` | Codex `config.toml` through `npx` |
32
+
33
+ Copy one of them into your MCP client; the printed command is correct for your platform.
34
+ The Codex entries also set `startup_timeout_sec = 120`, `tool_timeout_sec = 600` and an idle limit, because the first scan of a large mod and long renders exceed Codex's default timeouts.
35
+ The [client examples](../examples/clients) show the same entries without your paths.
26
36
 
27
37
  Open the mod as your agent's workspace.
28
- If your client does not supply workspace roots, set the MCP process working directory to that mod folder.
29
- The server can then select the active mod without a separate configuration file.
30
- It keeps indexes and generated images in your user data directory.
38
+
39
+ ### How the server picks your mod
40
+
41
+ Every tool takes an optional `workspaceId`; the default, `"current"`, means the mod that contains the client's workspace root or, when the client sends no roots, the server's working directory.
42
+ With no configuration file, the server configures itself from that folder, so set the MCP process working directory to the mod if your client does not supply roots.
43
+ After `--init` writes a configuration file, every folder under its mod roots is a workspace, and the current mod is the one that contains the client root or working directory; when that matches no mod and several are configured, pass the mod's `workspaceId`.
44
+ The [configuration reference](configuration.md#how-the-server-picks-your-mod) gives the exact rules, the default file location, every key and the environment variables.
45
+ Indexes are kept in the server's state folder and generated images in workspace storage, both in your user data directory by default.
31
46
 
32
47
  ## 3. Try a small task
33
48
 
@@ -36,7 +51,7 @@ It keeps indexes and generated images in your user data directory.
36
51
  > Find the installed documentation for `save_event_target_as` and read only the relevant section.
37
52
 
38
53
  Continue with the [examples guide](examples.md).
39
- A mod normally has `descriptor.mod` or standard HOI4 content folders; an empty folder needs a descriptor or explicit configuration.
54
+ Without a configuration file, the folder must look like a mod: it needs `descriptor.mod` or standard HOI4 content folders.
40
55
 
41
56
  ## Choose game and mod paths
42
57
 
@@ -53,7 +68,7 @@ It can be repeated for several locations.
53
68
  Use quoted Windows paths on Windows, for example `"C:/Program Files (x86)/Steam/steamapps/common/Hearts of Iron IV"`.
54
69
 
55
70
  For a custom configuration location, add `--config PATH` to both setup commands.
56
- `--workspace-storage-root PATH` chooses where generated indexes and images are saved.
71
+ `--workspace-storage-root PATH` chooses where generated images and rewrite transactions are saved.
57
72
  Linked mod directories are not followed; configure their real parent directory instead.
58
73
 
59
74
  ### How sources are layered
@@ -85,16 +100,34 @@ See [Local references](reference.md) for source selection and missing-source rep
85
100
  | A control's state is unresolved | Supply the scenario's required country, state, controller or variable inputs; do not assume a visible control is available. |
86
101
  | A large query takes several minutes | Start with the specific tree, window or source area you need. Use [background jobs](jobs.md) when supported by your client. |
87
102
  | Idle server processes accumulate | Set an idle limit as described in [Server lifetime](#server-lifetime). |
103
+ | The game reported errors at startup | Ask the agent to read them with `hoi4.error_log`; set `gameUserRoot` if the game's user folder is not found automatically. |
104
+ | Startup or a tool call times out | Raise the client's timeouts; the printed Codex entries allow 120 seconds for startup and 600 seconds per call. |
105
+
106
+ Two setup commands help with path problems:
88
107
 
89
- The supplied Codex registration allows 120 seconds for startup and 600 seconds per tool call.
108
+ ```bash
109
+ hoi4-agent-tools-setup --discover
110
+ hoi4-agent-tools-setup --diagnose
111
+ ```
112
+
113
+ `--discover` prints the mod and game folders the server can detect, without writing anything.
114
+ `--diagnose` checks the configured paths and their permissions, the Node.js version and the image library, and accepts `--config PATH`.
115
+ `--help` lists every option.
90
116
 
91
117
  For remote or shared deployments, use the [HTTP guide](http.md).
92
118
 
119
+ ### A running game
120
+
121
+ This server reads source and never launches, controls or watches the game.
122
+ Pair it with a live-game MCP server, such as the separate HOI4 Live Tools project, for anything that needs the running game: launching and loading saves, the console, firing events, reading popups and the screen, playing time forward, and log deltas during a session.
123
+ Use this server to find and fix the source (`hoi4.error_log` maps last launch's errors to files and says which ones a relaunch removed), and the live server to reproduce and confirm in game.
124
+
93
125
  ### Server lifetime
94
126
 
95
- A stdio server exits when its client closes stdin, and when the process that launched it, such as a `cmd.exe` shim, has exited.
127
+ A stdio server exits when its client closes stdin, and when the process that launched it, such as a `cmd.exe` shim, has exited and no request is still open.
96
128
  Some clients start a server for every subagent and keep each connection open after the subagent finishes, so idle servers accumulate and each holds its own index in memory.
97
- A server with no client traffic and no open request for `stdioIdleExitMinutes` minutes exits.
129
+ A server with no client traffic and no open request for `stdioIdleExitMinutes` minutes (0–10,080) exits.
98
130
  That setting applies to every client sharing the server configuration, so prefer the `HOI4_AGENT_STDIO_IDLE_EXIT_MINUTES` environment variable in the affected client's registration; the Codex registrations printed by `hoi4-agent-tools-setup --print-client-config` set it to 30.
131
+ The variable takes a whole number from 0 to 10,080; an empty value uses the configuration, and any other value stops the server at startup with an error.
99
132
  A client that later calls an exited server reports it as disconnected, so leave the limit at `0` (never) for a single long-lived session.
100
133
  Over stdio, read the `hoi4-agent://server/status` resource to see every server process that shares the server state root, with its transport, memory, last client activity and the execution limits in effect. Records of exited processes are removed on read; a server that has not updated its record for five minutes is listed as stale.
@@ -18,6 +18,24 @@ Use the three technology tools directly from the target mod.
18
18
  - `impact`: find the definitions, placements, edges, grants, bonuses, unlocks, localisation, sprites, and files affected by a proposed removal or rename.
19
19
  - `helper_expansion`: stream source-linked scripted-effect call paths and helper-owned technology references with bounded pages and revision-bound continuation.
20
20
 
21
+ Request fields select the records each mode reads:
22
+
23
+ | Field | Used by | Meaning |
24
+ | ------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- |
25
+ | `technologyId` | `trace`, `explain` (required); `unlocks`, `bonus_coverage`, `lint` | Technology to trace or explain, or a filter for the other modes. |
26
+ | `folderId` | `folders`, `lint` | Folder to inspect, or a lint filter. |
27
+ | `categoryId` | `bonus_coverage` | Technology category whose research-bonus coverage is reported. |
28
+ | `targetKind` | `unlocks` | Unlock target kind: `equipment`, `equipment_module`, `sub_unit`, `building`, `ability`, `tactic`, or `other`. |
29
+ | `targetId` | `unlocks` | Unlock target ID. |
30
+ | `direction` | `trace` | `prerequisites`, `descendants`, or `both` (default). |
31
+ | `maxDepth` | `trace` | Traversal depth, 1 to 256, default 32. |
32
+ | `maxNodes` | `trace` | Traversed nodes, 1 to 25,000, default 2,000. |
33
+ | `includeSubTechnologies` | `trace` | Follow sub-technology edges as well as prerequisites; default `true`. |
34
+ | `classifications` | `lint` | Up to 4 of `confirmed_error`, `probable_defect`, `design_warning`, and `unresolved_analysis`. |
35
+ | `codes` | `lint` | Up to 100 diagnostic codes. |
36
+ | `impact` | `impact` (required) | Removal or rename subject, described below. |
37
+ | `helperExpansion` | `helper_expansion` | Bounded helper-expansion request; see [bounded helper expansion](helper-expansion.md). |
38
+
21
39
  Example trace:
22
40
 
23
41
  ```json
@@ -64,6 +82,11 @@ Render validation is scoped to the requested view: folder source placement, omit
64
82
 
65
83
  Subtechnology cards use the sprite declared by their source GUI slot before any technology-id fallback. Slot-declared textures are included in the bounded asset scan even when no ordinary technology icon references the same file.
66
84
 
85
+ `hoi4.tech_render` accepts `folderId` (required for the `folder` view), `technologyId`, `categoryId`, and `targetId`.
86
+ `technologyId` selects the traced neighbourhood in the `dependencies` and `technology` views and filters the `bonuses`, `grants`, and `unlocks` views.
87
+ `categoryId` filters the `memberships`, `bonuses`, and `grants` views, and `targetId` filters the `unlocks` view.
88
+ `maxNodes` ranges from 1 to 2,000 and defaults to 1,000.
89
+
67
90
  Example folder render:
68
91
 
69
92
  ```json
@@ -81,9 +104,11 @@ Large dependency requests return a bounded overview plus focused folder resource
81
104
 
82
105
  ## Compare
83
106
 
84
- `hoi4.tech_compare` compares cached revisions, graph resources, current source, or proposed in-memory source overlays. It reports added, removed, renamed, or moved technologies; graph and placement changes; metadata, category, tag, unlock, grant, bonus, localisation, and icon changes; introduced and resolved findings; and newly reachable or disconnected content.
107
+ `hoi4.tech_inspect` with `mode: compare` compares cached revisions, graph resources, current source, or proposed in-memory source overlays. It reports added, removed, renamed, or moved technologies; graph and placement changes; metadata, category, tag, unlock, grant, bonus, localisation, and icon changes; introduced and resolved findings; and newly reachable or disconnected content.
85
108
 
86
109
  `before` and `after` each accept `{ "revision": "<sha256>" }` or `{ "artifactUri": "hoi4-agent://..." }`. Proposed overlays take `{ relativePath, source, expectedSourceHash? }`; use `source: null` to model deletion. Overlays are analyzed without writing them.
110
+ A request takes between 1 and 128 overlays, and `after` and `proposedSources` are mutually exclusive.
111
+ The comparison render is produced unless `render` is `false`; `maxRenderNodes` ranges from 1 to 2,000 and defaults to 500.
87
112
 
88
113
  ```json
89
114
  {
@@ -0,0 +1,11 @@
1
+ # Third-party notices
2
+
3
+ ## Roboto
4
+
5
+ HOI4 Agent Tools depends on `@fontsource-variable/roboto` version 5.3.0 for deterministic, host-independent artifact labels and the project-owned synthetic BMFont fixture.
6
+
7
+ Copyright 2011 The Roboto Project Authors (<https://github.com/googlefonts/roboto-classic>). Roboto-Italic[wdth,wght].ttf: Copyright 2011 The Roboto Project Authors (<https://github.com/googlefonts/roboto-classic>).
8
+
9
+ Roboto is licensed under the SIL Open Font License, Version 1.1 (`OFL-1.1`). The complete license text is distributed as `LICENSE` in the installed `@fontsource-variable/roboto` package. The font package is pinned in `package.json` and the published `npm-shrinkwrap.json`; generated SVG/PNG documents may contain derived glyph outlines or pixels as permitted by the OFL.
10
+
11
+ The application source remains licensed under Apache-2.0 as stated in the repository [LICENSE](../LICENSE). Third-party components retain their respective licenses.
package/docs/tools.md CHANGED
@@ -4,43 +4,152 @@ Most users can ask their agent in ordinary language; the [examples guide](exampl
4
4
  This page lists exact tool names for agents and integrations.
5
5
  Use the connected server's live schema for the fields accepted by each call.
6
6
 
7
- | Tool | Purpose |
8
- | --------------------------- | ---------------------------------------------------------------------------------------------------------------- |
9
- | `hoi4.focus_inspect` | Read focus trees, continuous-focus placement, and structural or reference problems. |
10
- | `hoi4.focus_render` | Produce fast HTML, SVG, JSON, and source-linked layout artifacts. |
11
- | `hoi4.focus_raster` | Produce a PNG preview with decoded source icons. |
12
- | `hoi4.focus_rewrite` | Create or update a focus tree. |
13
- | `hoi4.gui_inspect` | Read a scripted GUI and its linked assets and logic. |
14
- | `hoi4.gui_render` | Render generated and explicit GUI scenarios, states, resolutions, and layout diagnostics. |
15
- | `hoi4.gui_rewrite` | Create or update a GUI source package. |
16
- | `hoi4.map_inspect` | Search, click, navigate, and inspect the complete rendered map and its linked data. |
17
- | `hoi4.map_render` | Render full-map layers, overlays, names, IDs, coordinates, and source-linked catalogs. |
18
- | `hoi4.map_rewrite` | Create or update states, provinces, IDs, networks, positions, and connected map data. |
19
- | `hoi4.reference_context` | Get compact, cited wiki and installed documentation pointers for a modding surface. |
20
- | `hoi4.reference_search` | Search local documentation in plain words or script names; each result names its answering line. |
21
- | `hoi4.reference_read` | Read one revision-bound section, with line continuation. |
22
- | `hoi4.source_lookup` | Find exact definitions, overrides and usages across game, DLC and mod, or the definition containing a file line. |
23
- | `hoi4.script_validate` | Check a snippet or a whole mod file for syntax, command kinds, and scopes against local documentation. |
24
- | `hoi4.event_inspect` | Scan, trace, explain, lint, or assess event chains and their state flow. |
25
- | `hoi4.event_render` | Render source-linked event routes, options, timing, state, scope, and unresolved edges. |
26
- | `hoi4.event_compare` | Compare event-chain topology and diagnostics between revisions. |
27
- | `hoi4.impact_inspect` | Trace symbol and changed-file consumers across source systems and compare proposals. |
28
- | `hoi4.decision_inspect` | Inventory and evaluate decisions or missions under declared scenarios and source changes. |
29
- | `hoi4.mechanic_test` | Execute bounded source effects on a copied declared scenario and check assertions. |
30
- | `hoi4.package_check` | Check declarative package definitions, calls, registrations, assets, and case links. |
31
- | `hoi4.scenario_test` | Run named source and domain cases in resumable, revision-bound batches. |
32
- | `hoi4.job_inspect` | Inspect durable background work or retrieve its completed tool result. |
33
- | `hoi4.job_cancel` | Durably request cancellation of authorized background work. |
34
- | `hoi4.tech_inspect` | Scan, trace, explain, lint, and assess technology and doctrine systems. |
35
- | `hoi4.tech_render` | Render source layouts with real item sizes and year guides, plus dependencies and assets. |
36
- | `hoi4.tech_compare` | Compare technology graphs, placements, references, diagnostics, and source overlays. |
37
- | `hoi4.probability_inspect` | Locate weighted logic and discover compatible adapters, candidates, and required inputs. |
38
- | `hoi4.probability_evaluate` | Evaluate supported weights, probability and timing models, and missing inputs. |
39
- | `hoi4.probability_sweep` | Find sensitivity, breakpoints, cliffs, and rank reversals across declared ranges. |
40
- | `hoi4.probability_simulate` | Run deterministic sampled analysis with confidence and convergence data. |
41
- | `hoi4.probability_sequence` | Analyze declared recovery, caps, cooldowns, resets, timers, and terminal states. |
42
- | `hoi4.probability_compare` | Attribute AI-weight and MTTH changes between real or proposed source. |
43
- | `hoi4.probability_render` | Render cached rankings, matrices, timing, sensitivity, sequence, and comparisons. |
7
+ The default server exposes 28 tools in nine areas.
8
+ The **Writes** column says what a call can change:
9
+
10
+ - **—** reads source and returns a result.
11
+ - **review files** writes images and reports to the server's own workspace storage, never to the mod.
12
+ - **mod files** changes mod source after validating the edit, with a recorded transaction that can be rolled back.
13
+
14
+ MCP clients see the review-file tools as not read-only, because they store artifacts, and may ask for approval before running them.
15
+ `hoi4.job_cancel` is marked destructive because it stops work in progress; it never edits source.
16
+
17
+ ## References and source
18
+
19
+ | Tool | Purpose | Writes |
20
+ | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- | ------ |
21
+ | `hoi4.reference_context` | Get compact, cited wiki and installed documentation pointers for a modding surface. | — |
22
+ | `hoi4.reference_search` | Search local documentation in plain words or script names; each result names its answering line. | — |
23
+ | `hoi4.reference_read` | Read one revision-bound section: up to 80 lines (40 by default) and 8,000 bytes, with line continuation. | — |
24
+ | `hoi4.source_lookup` | Find exact definitions, overrides and usages across game, DLC and mod, or the definition containing a file line. | — |
25
+ | `hoi4.script_validate` | Check a snippet or a whole mod file for syntax, command kinds, and scopes against local documentation. | — |
26
+ | `hoi4.error_log` | Group the game's `error.log` from its last launch by category, with the source file, line and layer, and whether that file changed since. | — |
27
+ | `hoi4.mod_index` | Summarize the mod's descriptor and definitions, or find the next free numbered ID for an event namespace or prefix across every layer. | — |
28
+
29
+ ## Focus trees
30
+
31
+ | Tool | Purpose | Writes |
32
+ | -------------------- | -------------------------------------------------------------------------------------------------------------------------- | ------------ |
33
+ | `hoi4.focus_inspect` | Read focus trees, continuous-focus placement, and structural or reference problems. | review files |
34
+ | `hoi4.focus_render` | Render a tree or palette as a PNG with decoded icons plus HTML, SVG, JSON and source maps; `png: false` for vector only. | review files |
35
+ | `hoi4.focus_rewrite` | Create a focus tree or continuous-focus palette from a complete plan, or compact an existing tree's layout without a plan. | mod files |
36
+
37
+ ## Scripted GUIs
38
+
39
+ | Tool | Purpose | Writes |
40
+ | ------------------ | ----------------------------------------------------------------------------------------------------------- | ------------ |
41
+ | `hoi4.gui_inspect` | Read a scripted GUI and its linked assets and logic. | review files |
42
+ | `hoi4.gui_render` | Render generated and explicit GUI scenarios, states, resolutions, and layout diagnostics. | review files |
43
+ | `hoi4.gui_rewrite` | Apply one validated GUI change as full source, structured helpers, or exact patches, with extra text files. | mod files |
44
+
45
+ ## Maps
46
+
47
+ | Tool | Purpose | Writes |
48
+ | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
49
+ | `hoi4.map_inspect` | Validate, search and look up the map; render a layer, overlays, tile or area; check script references to map entities. | review files |
50
+ | `hoi4.map_rewrite` | Create a new world, or create, split, merge and renumber states and provinces, regenerate positions and supply, and remap script references. | mod files |
51
+
52
+ ## Events
53
+
54
+ | Tool | Purpose | Writes |
55
+ | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ------ |
56
+ | `hoi4.event_inspect` | Scan, trace, explain, lint, or assess event chains and their state flow; `mode: compare` diffs cached, artifact or proposed graphs. | — |
57
+ | `hoi4.event_render` | Render source-linked event routes, options, timing, state, scope, and unresolved edges. | — |
58
+
59
+ ## Technology and doctrines
60
+
61
+ | Tool | Purpose | Writes |
62
+ | ------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------ |
63
+ | `hoi4.tech_inspect` | Scan, trace, explain, lint, and assess technology and doctrine systems; `mode: compare` diffs graphs and source overlays. | — |
64
+ | `hoi4.tech_render` | Render source layouts with real item sizes and year guides, plus dependencies and assets. | — |
65
+
66
+ ## AI weights and timing
67
+
68
+ | Tool | Purpose | Writes |
69
+ | -------------------------- | ------------------------------------------------------------------------------------------------------------------------ | ------ |
70
+ | `hoi4.probability_inspect` | Find weighted logic by path, ID or candidate IDs and evaluate it: weights, probabilities and the facts still missing. | — |
71
+ | `hoi4.probability_analyze` | Compare a proposed source, sweep ranges, simulate uncertainty, analyze a declared pool over time, or render an analysis. | — |
72
+
73
+ ## Decisions, impact and tests
74
+
75
+ | Tool | Purpose | Writes |
76
+ | ----------------------- | ----------------------------------------------------------------------------------------- | ------ |
77
+ | `hoi4.impact_inspect` | Trace symbol and changed-file consumers across source systems and compare proposals. | — |
78
+ | `hoi4.decision_inspect` | Inventory and evaluate decisions or missions under declared scenarios and source changes. | — |
79
+ | `hoi4.mechanic_test` | Interpret declared effect steps on a copied scenario state and check assertions. | — |
80
+ | `hoi4.package_check` | Check declarative package definitions, calls, registrations, assets, and case links. | — |
81
+ | `hoi4.scenario_test` | Run named source and domain cases in resumable, revision-bound batches. | — |
82
+
83
+ ## Background jobs
84
+
85
+ | Tool | Purpose | Writes |
86
+ | ------------------ | ---------------------------------------------------------------------- | --------- |
87
+ | `hoi4.job_inspect` | Inspect durable background work or retrieve its completed tool result. | — |
88
+ | `hoi4.job_cancel` | Durably request cancellation of authorized background work. | job state |
89
+
90
+ ## Prompts and resources
91
+
92
+ The server offers one MCP prompt, `hoi4.probability_analysis`.
93
+ It takes an `objective` and an optional `sourceHint` and returns a plan for one source-linked AI-weight, MTTH, random or declared-pool analysis; it does not run the analysis itself.
94
+
95
+ Large results are returned as links to the resource template `hoi4-agent://workspace/{workspaceId}/artifact/{sha256}/{provenanceHash}/{name}`.
96
+ Clients can read a byte range with `?offset=<bytes>&length=<bytes>`.
97
+
98
+ Local stdio clients also see the fixed resource `hoi4-agent://server/status`, which lists the server processes sharing this server state, with memory use, last client activity and execution limits; see [server lifetime](setup.md#server-lifetime).
99
+ Authenticated HTTP sessions never see it.
100
+
101
+ ## Arguments
102
+
103
+ Tools accept the shorthands agents most often send and read them as the canonical form: an event selector as a plain string, a namespace wildcard such as `chaosx.nr14.*`, or an object without `kind` or with `id` for its own field; a trace's event as `from`, `eventId` or `namespace`; a GUI scenario without `id`, or none for a window inspection; a decision inspection by `id` or `decisionId` without a scenario; a probability scenario set as a bare list or without ids and `state`; a script file check that also names a kind and scope, which the file already fixes, and a snippet check without a `kind`, which is read as the effect or trigger with fewer errors. A `limit`, `maxDepth`, `maxNodes` or `maxEdges` above its maximum is lowered to the maximum.
104
+ Anything still invalid comes back as a tool error, code `INVALID_ARGUMENTS`, that names each failing field with what it expected and shows a working call.
105
+ It is a tool error rather than a protocol error because clients show a tool error's text to the model, while some reduce a protocol error to a generic message.
106
+ Every error and blocked result also carries its blockers in the text content, so a client that shows only text still explains the failure.
107
+
108
+ ## Example calls
109
+
110
+ Every tool description in `tools/list` ends with a call like these, and an invalid call returns the same example for its tool.
111
+ Fields not shown take their defaults; `workspaceId` is `"current"` unless you pass one.
112
+ The CI stdio smoke suite sends each of these shapes to a real server process.
113
+
114
+ | Tool | Example arguments |
115
+ | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
116
+ | `hoi4.reference_context` | `{"surface":"event","question":"fire an event after a delay"}` |
117
+ | `hoi4.reference_search` | `{"query":"add_timed_idea"}` |
118
+ | `hoi4.reference_read` | `{"id":"<hit id>","revision":"<hit revision>"}` from a search or context hit |
119
+ | `hoi4.source_lookup` | `{"symbol":"my_scripted_effect"}` or `{"path":"events/my_events.txt","line":42}` |
120
+ | `hoi4.script_validate` | `{"source":"add_political_power = 10","kind":"effect","scope":"country"}` or `{"path":"events/my_events.txt"}` |
121
+ | `hoi4.error_log` | `{"scope":"mod","category":"effect"}` |
122
+ | `hoi4.mod_index` | `{"mode":"overview"}` or `{"mode":"next_id","kind":"event","namespace":"my_mod"}` |
123
+ | `hoi4.focus_inspect` | `{"treeId":"my_focus_tree"}` |
124
+ | `hoi4.focus_render` | `{"relativePath":"common/national_focus/my_tree.txt","treeId":"my_focus_tree"}` |
125
+ | `hoi4.focus_rewrite` | `{"relativePath":"common/national_focus/my_tree.txt","treeId":"my_focus_tree","layoutMode":"compact"}` |
126
+ | `hoi4.gui_inspect` | `{"windowName":"my_window"}` |
127
+ | `hoi4.gui_render` | `{"windowName":"my_window","scenario":{"id":"normal"}}` |
128
+ | `hoi4.gui_rewrite` | `{"mode":"helpers","relativePath":"interface/my_window.gui","windowName":"my_window","scenario":{"id":"normal"},"helper":{…}}` |
129
+ | `hoi4.map_inspect` | `{"query":"Brandenburg","lookupOnly":true}` or `{"layer":"state","tile":{"x":2600,"y":500,"width":256,"height":256}}` |
130
+ | `hoi4.map_rewrite` | `{"operations":[{"id":"s1","kind":"create_state","provinceIds":[120,121],"displayName":"New State"}]}` |
131
+ | `hoi4.event_inspect` | `{"mode":"trace","selector":"my_mod.1","direction":"downstream"}` |
132
+ | `hoi4.event_render` | `{"view":"overview","selector":"my_mod"}` |
133
+ | `hoi4.tech_inspect` | `{"mode":"explain","technologyId":"my_tech"}` |
134
+ | `hoi4.tech_render` | `{"view":"folder","folderId":"my_folder"}` |
135
+ | `hoi4.probability_inspect` | `{"candidatePool":["my_decision"],"scenarioSet":[{"actor":"GER","state":{"has_war":false}}]}` |
136
+ | `hoi4.probability_analyze` | `{"analysis":"sweep","source":"common/decisions/my_decisions.txt","candidatePool":["my_decision"],"scenarioSet":[{"actor":"GER","state":{"variable.pressure":10}}],"sweep":{"paths":["variable.pressure"],"steps":10}}` |
137
+ | `hoi4.impact_inspect` | `{"symbols":[{"kind":"scripted_effect","id":"my_effect"}]}` |
138
+ | `hoi4.decision_inspect` | `{"mode":"inspect","id":"my_decision","scenarios":[{"id":"base","actor":"GER","state":{}}]}` |
139
+ | `hoi4.mechanic_test` | `{"test":{"id":"t","scenario":{…},"steps":[…],"assertions":[…]}}`, see [Mechanic tests](mechanics.md) |
140
+ | `hoi4.package_check` | `{"manifest":{"schemaVersion":"1.0","id":"my_package","definitions":[{"kind":"scripted_effect","id":"my_effect"}]}}` |
141
+ | `hoi4.scenario_test` | `{"suitePath":"tests/my_suite.json","maxCases":20}` |
142
+ | `hoi4.job_inspect` | `{"jobId":"job_<64 hex characters>"}` from a native task id |
143
+ | `hoi4.job_cancel` | `{"jobId":"job_<64 hex characters>"}` |
144
+
145
+ ## Result sizes
146
+
147
+ An inline result never exceeds 32 KB of structured content.
148
+ Typical answers are 1 to 5 KB: counts, the main findings, the strongest candidates and links.
149
+ Focus, GUI and map results are larger, up to about 24 KB, because they list trees, scenes or matches.
150
+ The text content of a successful call is a short JSON summary (status, code, workspace and artifact count), so a client that shows only text still sees how the call ended; an error or blocked result puts its blockers in the text.
151
+ Pictures are never inlined: renders, galleries, full graphs and per-candidate traces are linked artifacts that you read in ranges, and every inline list says how many items it omitted.
152
+ A reference read is limited to 80 lines and 8,000 bytes; a source lookup returns at most 3 definitions and 10 usages.
44
153
 
45
154
  ## Reading results
46
155
 
@@ -48,18 +157,18 @@ Inspect findings and missing inputs along with the image or result.
48
157
  A rendered control does not by itself prove native availability, and a source simulation is not a game-engine receipt.
49
158
  For reference searches, retain the cited file, lines and revision so you can reopen the same section.
50
159
 
51
- Large results are returned as linked `hoi4-agent://` resources.
52
- Follow `continuationUri` until it is `null`; clients can also request byte ranges with `?offset=<bytes>&length=<bytes>`.
160
+ Follow `continuationUri` until it is `null` to read a long result in pages.
53
161
  Archive images you need to keep rather than relying on temporary server storage.
54
162
 
55
163
  ## Longer operations
56
164
 
57
- Clients that negotiate MCP tasks can retrieve a long operation after reconnecting.
165
+ All 19 domain tools accept negotiated MCP tasks, so a client that supports tasks can retrieve a long operation after reconnecting.
166
+ The 7 reference tools and the 2 job tools always answer in the foreground.
58
167
  Other clients receive the ordinary synchronous result.
59
168
  Use `hoi4.job_inspect` to inspect an authorized job or retrieve its result, and `hoi4.job_cancel` to request cancellation.
60
169
  See [Background jobs](jobs.md) for request keys, cancellation and recovery.
61
170
 
62
171
  ## Optional ChaosX tools
63
172
 
64
- Setting `HOI4_AGENT_TOOLS_CHAOSX=1` on the server process exposes `chaosx.focus_country_assets` and `chaosx.visual_revision`.
65
- These workflow-specific tools are absent from the default public list.
173
+ On the stdio server (`hoi4-agent-tools`), setting `HOI4_AGENT_TOOLS_CHAOSX=1` exposes `chaosx.focus_country_assets` and `chaosx.visual_revision`.
174
+ These workflow-specific tools are absent from the default list, and the HTTP server never exposes them.
@@ -0,0 +1,61 @@
1
+ # Troubleshooting
2
+
3
+ Start with the message: every failed call returns a tool error whose text names the code, what went wrong and what to do next.
4
+ This page lists the codes you are most likely to meet, then the checks for problems that have no code.
5
+
6
+ ## Setup and connection
7
+
8
+ | Symptom | Cause and fix |
9
+ | ----------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
10
+ | The client lists no `hoi4.*` tools | The server did not start. Run `hoi4-agent-tools-setup --diagnose`, which checks the Node.js version (22.19 or newer, or 24), the image library and the configured paths. Then restart the client. |
11
+ | `WORKSPACE_CONTEXT_NOT_FOUND` | The server does not know which mod you mean. Open the mod folder as the client's working directory, or configure it with `--mod-root` or a workspace in the [configuration file](configuration.md). |
12
+ | `WORKSPACE_CONTEXT_AMBIGUOUS` | The working directory is inside more than one configured mod. Pass `workspaceId`, or open the one folder you mean. |
13
+ | `WORKSPACE_NOT_REGISTERED` | The `workspaceId` is not in the configuration. Use `"current"`, or a workspace id from the configuration file. |
14
+ | Renders lack icons or fonts, native commands are unresolved | The game folder is not configured. Set `--game-root` (or `gameRoot`) to the Hearts of Iron IV folder; `hoi4-agent-tools-setup --discover` prints the folders it can find. |
15
+ | `ERROR_LOG_NOT_FOUND` | Launch the game once, or set `gameUserRoot` to the folder that holds `logs/`, `mod/` and `save games/` (with OneDrive that is often under `OneDrive\Documents`). |
16
+ | `AUTH_INVALID` over HTTP | The bearer token is missing, expired or for another server. See the [HTTP guide](http.md). |
17
+ | Startup or a call times out in the client | A cold scan of a large mod takes minutes. Raise the client's startup and tool timeouts (the printed Codex entries use 120 and 600 seconds), or use [background jobs](jobs.md). |
18
+ | Many idle `node` processes | Some clients keep a server per subagent. Set `HOI4_AGENT_STDIO_IDLE_EXIT_MINUTES`; see [Server lifetime](setup.md#server-lifetime). |
19
+
20
+ ## Arguments and results
21
+
22
+ | Code or symptom | Cause and fix |
23
+ | --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
24
+ | `INVALID_ARGUMENTS` | The call does not match the tool's schema. The error names each failing field, what it expected and a working call; copy that example, or see [Example calls](tools.md#example-calls). |
25
+ | `valid: null` from `script_validate` | Nothing is wrong that the checker could prove, but some commands, argument blocks or scopes were not checked. Read `unresolvedCount` and the unresolved findings; `null` is not a pass. |
26
+ | `MCP_RESPONSE_TRUNCATED` | The inline result exceeded its 32 KB budget. The omitted detail is in the linked artifacts (see `artifacts` in the structured content); narrow the selector for a smaller answer. |
27
+ | `SCAN_SOURCE_CHANGED` | A file changed while it was being read. Repeat the call; if it keeps happening, stop the tool or editor that is rewriting the file. |
28
+ | `SCAN_BYTE_LIMIT`, `SCAN_PATTERN_LIMIT` | The request reads more source than the configured limits allow. Ask for the specific tree, window or folder, or raise the limits in [Scan and storage limits](configuration.md#scan-and-storage-limits). |
29
+ | `REFERENCE_REVISION_STALE` | A documentation file changed after the search. Search again and read with the new `id` and `revision`. |
30
+ | `REFERENCE_RESPONSE_TOO_LARGE` | The citation bundle is too large for one reply. Lower `limit` or search a specific source. |
31
+ | `ARTIFACT_NOT_FOUND` | The artifact left the server's bounded store. Run the tool again; archive images you need to keep. |
32
+ | `JOB_DEADLINE_EXCEEDED` | A long job ran past `jobDeadlineSeconds` and was stopped. Narrow it, or raise the limit in the configuration. |
33
+ | `JOB_STORE_BUSY` | A crashed server process still holds the job store lock. Wait for the lease to expire (ten minutes) or stop the stale `node` process. |
34
+ | `JOB_NOT_FOUND` | The finished result expired. Start the operation again. |
35
+
36
+ ## Rewrites
37
+
38
+ Rewrite tools (`focus_rewrite`, `gui_rewrite`, `map_rewrite`) validate the whole candidate and write nothing when it fails.
39
+
40
+ | Code | Cause and fix |
41
+ | ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
42
+ | `TRANSACTION_STALE` | A source file changed after the review was made. Inspect again and repeat the rewrite on the current source. |
43
+ | `TRANSACTION_RECOVERY_REQUIRED` | An earlier rewrite was interrupted and its journal could not be recovered yet. Reads still work; the message names the reason. Restart the server, and repair the named file if it persists. |
44
+ | `TRANSACTION_ROLLBACK_STALE` | A file changed since the rewrite, so it cannot be rolled back safely. Restore the file from version control. |
45
+ | `MAP_STATE_DISTRIBUTION_REQUIRED` | A state operation was given an incomplete explicit policy. Omit `distribution` for the automatic land-share policy, or send every field (see [Maps](map.md)). |
46
+ | `MAP_STATE_REGION_DISTRIBUTION_CONFLICT` | Moved or merged provinces lie in different strategic regions. Use `strategicRegion: "move-to-target-region"`, or move the provinces between regions first. |
47
+ | `MAP_EXTERNAL_REFERENCE_READ_ONLY` | Base-game or dependency scripts name a changed state. Repeat with `remapReferences` or `readOnlySources` set to `override` to copy them into the mod with the numbers changed. |
48
+ | `MAP_DATED_STATE_HISTORY_CONFLICT` | A dated block (`1939.1.1 = { ... }`) overrides the value you are changing. Edit that block, or change the later date's value deliberately. |
49
+ | `MAP_SCRIPT_REFERENCE_MISSING` (error) | A script names a state, province or region the map does not define. Remap it with `remap_map_references`, or correct the script. |
50
+ | `MAP_REFERENCE_NEEDS_REVIEW` (info) | A single-valued argument such as `capital = 64` had no single successor and was left as it was. Choose its new target by hand. |
51
+
52
+ ## Game and live testing
53
+
54
+ This server reads source and never starts the game.
55
+ To reproduce a problem in game, read what the game logged with `hoi4.error_log` (the last launch only, with the file and line where the message names one), then fix the file and ask `hoi4.script_validate` with `path` to check it before relaunching.
56
+ For launching, loading a save and watching a campaign, pair it with the separate HOI4 Live Tools server (see [A running game](setup.md#a-running-game)).
57
+
58
+ ## Still stuck
59
+
60
+ Run `hoi4-agent-tools-setup --diagnose`, then open an issue at <https://github.com/klimPaskov/hoi4-agent-tools/issues> with the tool name, the arguments (without private paths), the error code and message, and the output of `hoi4-agent-tools-setup --diagnose`, which includes the server and Node.js versions.
61
+ For a security problem use the [Security Policy](../SECURITY.md) instead of a public issue.
@@ -1,5 +1,8 @@
1
+ # Codex registration for a global install (npm install --global hoi4-agent-tools).
2
+ # On Windows, set command = "hoi4-agent-tools.cmd".
3
+ # hoi4-agent-tools-setup --print-client-config prints this entry with your paths filled in.
1
4
  [mcp_servers.hoi4_agent_tools]
2
- command = "npx"
3
- args = ["-y", "hoi4-agent-tools@latest"]
5
+ command = "hoi4-agent-tools"
4
6
  startup_timeout_sec = 120
5
7
  tool_timeout_sec = 600
8
+ env = { HOI4_AGENT_STDIO_IDLE_EXIT_MINUTES = "30" }
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "mcpServers": {
3
3
  "hoi4_agent_tools": {
4
- "command": "npx",
5
- "args": ["-y", "hoi4-agent-tools@latest"]
4
+ "command": "hoi4-agent-tools",
5
+ "args": []
6
6
  }
7
7
  }
8
8
  }
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 1,
3
+ "serverStateRoot": "/var/lib/hoi4-agent-tools-state",
4
+ "modRoots": ["/projects/hoi4-mods"],
5
+ "gameRoot": "/games/Hearts of Iron IV",
6
+ "workspaceStorageRoot": "/var/lib/hoi4-agent-tools"
7
+ }