hoi4-agent-tools 4.9.0 → 4.11.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.
- package/CHANGELOG.md +20 -0
- package/dist/hoi4_agent_tools/core/operation-result.js +51 -11
- package/dist/hoi4_agent_tools/core/workspace.js +22 -7
- package/dist/hoi4_agent_tools/decision/service.js +13 -1
- package/dist/hoi4_agent_tools/event/graph.js +16 -2
- package/dist/hoi4_agent_tools/event/source-analysis.js +35 -16
- package/dist/hoi4_agent_tools/impact/service.js +4 -1
- package/dist/hoi4_agent_tools/map/gameplay/reachability.js +81 -0
- package/dist/hoi4_agent_tools/map/geography/resolve.js +3 -0
- package/dist/hoi4_agent_tools/map/operations.js +8 -0
- package/dist/hoi4_agent_tools/map/partition-tuning.js +2 -1
- package/dist/hoi4_agent_tools/map/reference-world.js +17 -3
- package/dist/hoi4_agent_tools/map/relief/painted-relief.js +143 -0
- package/dist/hoi4_agent_tools/map/relief/terrain-synthesis.js +13 -0
- package/dist/hoi4_agent_tools/map/world.js +108 -23
- package/dist/hoi4_agent_tools/mcp/resources/register-modern.js +11 -4
- package/dist/hoi4_agent_tools/mcp/resources/register.js +7 -0
- package/dist/hoi4_agent_tools/mcp/server/argument-errors.js +1 -0
- package/dist/hoi4_agent_tools/mcp/tools/analysis.js +12 -0
- package/dist/hoi4_agent_tools/mcp/tools/reference.js +12 -3
- package/dist/hoi4_agent_tools/package-check/service.js +14 -1
- package/dist/hoi4_agent_tools/probability/model.js +4 -4
- package/dist/hoi4_agent_tools/probability/operations.js +6 -0
- package/dist/hoi4_agent_tools/probability/service.js +23 -0
- package/dist/hoi4_agent_tools/reference/operations.js +35 -6
- package/dist/hoi4_agent_tools/reference/service.js +118 -14
- package/dist/hoi4_agent_tools/reference/skill-resource.js +74 -0
- package/dist/hoi4_agent_tools/reference/skills.js +278 -0
- package/dist/hoi4_agent_tools/schemas/geography.js +5 -0
- package/dist/hoi4_agent_tools/schemas/map.js +29 -0
- package/dist/hoi4_agent_tools/schemas/reference.js +34 -2
- package/dist/hoi4_agent_tools/schemas/skill.js +72 -0
- package/dist/hoi4_agent_tools/version.js +1 -1
- package/docs/configuration.md +3 -3
- package/docs/map.md +12 -9
- package/docs/probability.md +1 -1
- package/docs/reference.md +27 -1
- package/docs/research/probability-adapter-evidence.md +15 -2
- package/docs/tools.md +101 -86
- package/engine/bin/manifest.json +1 -1
- package/engine/bin/win32-x64/hoi4-engine.exe +0 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -1
- package/schemas/configuration.schema.json +1 -1
- package/schemas/continuous-focus-palette.schema.json +1 -1
- package/schemas/custom-weighted-pool.schema.json +1 -1
- package/schemas/decision-inspect-input.schema.json +1 -1
- package/schemas/error-log-input.schema.json +1 -1
- package/schemas/event-feature-manifest.schema.json +1 -1
- package/schemas/focus-plan.schema.json +1 -1
- package/schemas/focus-planning-sidecar.schema.json +1 -1
- package/schemas/geography-model.schema.json +4 -1
- package/schemas/gui-animation-source.schema.json +1 -1
- package/schemas/gui-helper.schema.json +1 -1
- package/schemas/gui-scenario.schema.json +1 -1
- package/schemas/helper-expansion-request.schema.json +1 -1
- package/schemas/helper-expansion-summary.schema.json +1 -1
- package/schemas/impact-inspect-input.schema.json +1 -1
- package/schemas/map-operation.schema.json +177 -118
- package/schemas/mechanic-test-input.schema.json +1 -1
- package/schemas/mod-index-input.schema.json +1 -1
- package/schemas/operation-result.schema.json +1 -1
- package/schemas/package-check-input.schema.json +1 -1
- package/schemas/package-manifest.schema.json +1 -1
- package/schemas/probability-analysis-result.schema.json +1 -1
- package/schemas/probability-compare-input.schema.json +1 -1
- package/schemas/probability-evaluate-input.schema.json +1 -1
- package/schemas/probability-inspect-input.schema.json +1 -1
- package/schemas/probability-render-input.schema.json +1 -1
- package/schemas/probability-scenario-set.schema.json +1 -1
- package/schemas/probability-sequence-input.schema.json +1 -1
- package/schemas/probability-simulate-input.schema.json +1 -1
- package/schemas/probability-sweep-input.schema.json +1 -1
- package/schemas/reference-context-input.schema.json +1 -1
- package/schemas/reference-read-input.schema.json +3 -3
- package/schemas/reference-search-input.schema.json +1 -1
- package/schemas/reference-sheets.schema.json +1 -1
- package/schemas/scenario-suite.schema.json +1 -1
- package/schemas/scenario-test-input.schema.json +1 -1
- package/schemas/script-validate-input.schema.json +1 -1
- package/schemas/shared-scenario.schema.json +1 -1
- package/schemas/source-lookup-input.schema.json +1 -1
- package/server.json +2 -2
package/docs/reference.md
CHANGED
|
@@ -17,7 +17,7 @@ Markdown headings and recognizable standalone names in generated `.log` files fo
|
|
|
17
17
|
|
|
18
18
|
- `hoi4.reference_context`: request one surface: `general`, `event`, `decision`, `idea`, `focus`, `technology`, `gui`, `map`, `localisation`, or `ai`. The default limit is 16 citations and the maximum is 24. It reserves citations for available installed documentation and offline wiki sources before adding further question matches. Supply `question` to select the best matching section within each required source. At a limit of two or more, both source kinds are represented when available; a one-result limit prioritizes installed documentation. `omittedSources` names required sources excluded by the result limit, while `missing` names sources absent from the configured roots. Increase the limit or search an omitted source directly before treating the bundle as sufficient. Citations are pointers and excerpts; read the pertinent sections before changing code.
|
|
19
19
|
- `hoi4.reference_search`: search with plain words or exact script tokens. Ranking weighs headings above body text and rare words above common ones, and it matches identifiers both whole and by their words, so "check if a state is controlled by a country" can find `is_controlled_by`. A query that names an identifier only matches sections containing it, an exact heading ranks first, and installed documentation precedes the wiki when they rank equally. Each result's `matchLine` is the cited line that best matches the query; pass it as `startLine` to `hoi4.reference_read` to land on the answer inside a long section. When several sources document the same name, the first copy keeps its place and later copies follow other distinct answers. The default limit is six results and the maximum is twelve. Filter `sources` to `game_doc`, `wiki`, or `script_doc` when appropriate. Only selected authorities are scanned; `coverage.included = false` means that an authority was excluded from this query, not that it is missing.
|
|
20
|
-
- `hoi4.reference_read`: provide a search/context result's `id` and `revision`. Optionally pass its `source` for a focused authority read; resident citations provide this hint automatically. Read 40 lines by default, set `maxLines` up to 80, and at most 8,000 UTF-8 bytes, with JSON escaping also bounded. Continue with the returned `nextLine`, `nextColumn` as `startColumn`, and the same revision. Long source lines continue without losing characters. A changed source returns `REFERENCE_REVISION_STALE`.
|
|
20
|
+
- `hoi4.reference_read`: provide a search/context result's `id` and `revision`. A hit carries a 16-character id and a 12-character revision, the leading characters of the section's and file's SHA-256, and `reference_read` also accepts the full 64-character forms. A hit's `path` is the file under its source's folder, such as `event_modding.md` for `wiki` or `documentation/effects_documentation.md` for `game_doc`. Optionally pass its `source` for a focused authority read; resident citations provide this hint automatically. Read 40 lines by default, set `maxLines` up to 80, and at most 8,000 UTF-8 bytes, with JSON escaping also bounded. Continue with the returned `nextLine`, `nextColumn` as `startColumn`, and the same revision. Long source lines continue without losing characters. A changed source returns `REFERENCE_REVISION_STALE`.
|
|
21
21
|
- `hoi4.source_lookup`: find exact definitions and indexed usages in the installed game and configured mod source. The response includes load order, override status, up to three source blocks bounded to 2,000 bytes each, a scan revision, and explicit reference counts and truncation. Follow `nextLine` and `nextColumn` as `fromLine` and `fromColumn`, with `expectedRevision`, to read more of the active definition.
|
|
22
22
|
- When `hoi4.source_lookup` finds no definition, `suggestions` lists up to five indexed identifiers within three edits of the requested symbol, nearest first, which catches typos and near-miss names.
|
|
23
23
|
- `hoi4.source_lookup` with `path` and `line` instead of `symbol` locates a source position, such as a diagnostic or a changed line in a diff. `path` may be a result path such as `mod:events/example.txt`, a path relative to a source root, or an absolute path inside one. The result names the file's layer and whether a later layer shadows it, the indexed definitions that contain the line, innermost first, and the chain of enclosing assignments with zero-based occurrences for repeated keys. Its `keyPath` starts inside the innermost definition: pass that definition's `id` as `symbol`, its `kind`, and the `keyPath` to read or list that exact block. Without `column`, the first non-blank character of the line is used. A file with parse errors returns its definitions but no structural chain. Only the requested file's folder is scanned, in every layer.
|
|
@@ -168,6 +168,32 @@ The result gives `nextId` after the highest used number, and `firstGapId` when a
|
|
|
168
168
|
{ "mode": "next_id", "kind": "event", "namespace": "my_mod" }
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
+
## Read the mod's skills
|
|
172
|
+
|
|
173
|
+
`hoi4.skill` serves the modding skills HOI4 Mod Setup installed in the mod, so every client reads the same text.
|
|
174
|
+
Without `name` it lists them, with the description from each `SKILL.md`, the number of files, and a state.
|
|
175
|
+
With `name` it loads that skill's `SKILL.md`, or another file of the skill named in `file`, such as `references/events.md`.
|
|
176
|
+
|
|
177
|
+
The served text is the kit version the mod pins.
|
|
178
|
+
Setup's lock, `.hoi4-mod-setup/install.lock.json`, records the kit repository, revision, release and manifest hash, and the SHA-256 of every installed file.
|
|
179
|
+
Each result returns the kit identity, the file's `sha256` and the `pinnedSha256` from the lock, and its state:
|
|
180
|
+
|
|
181
|
+
- `pinned`: the installed bytes match the lock.
|
|
182
|
+
- `edited`: the bytes differ. Loading the file fails with `SKILL_TEXT_DRIFTED` unless `acceptLocalEdits` is true, and the result's validation fails either way. Rerun HOI4 Mod Setup to restore the pinned text.
|
|
183
|
+
- `missing`: the lock names a file the mod no longer has (`SKILL_FILE_MISSING`).
|
|
184
|
+
- `unpinned`: the mod has no Setup lock, so its installed skills are served with their hashes but no kit version can be checked. `kit` is `null`.
|
|
185
|
+
|
|
186
|
+
Setup installs a copy for each client. The `.agents/skills` copy is served when it exists, otherwise the `.claude/skills` copy.
|
|
187
|
+
Only files named in the lock are served, and a file that resolves outside the mod is refused.
|
|
188
|
+
A call returns at most 20,000 bytes of text, cut after a line break. Continue from `nextOffset` until it is `null`.
|
|
189
|
+
|
|
190
|
+
The same `SKILL.md` text is the MCP resource `hoi4-agent://workspace/{workspaceId}/skill/{name}`, listed for the client's mod as `hoi4-agent://workspace/current/skill/<name>`.
|
|
191
|
+
Its `_meta` carries `sha256`, `state`, `kitRevision` and `kitRelease`, and an edited file is refused there too.
|
|
192
|
+
|
|
193
|
+
```json
|
|
194
|
+
{ "name": "hoi4-events" }
|
|
195
|
+
```
|
|
196
|
+
|
|
171
197
|
## Example
|
|
172
198
|
|
|
173
199
|
```json
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
# Probability adapter evidence
|
|
2
2
|
|
|
3
|
-
The AI and MTTH Scenario Analyzer targets Hearts of Iron IV **Operation Postern 1.19.
|
|
3
|
+
The AI and MTTH Scenario Analyzer targets Hearts of Iron IV **Operation Postern 1.19.4.1 (checksum f584)**. Adapter behavior is versioned as `hoi4-1.19.4.1.v1`. Results always include that adapter version and game build. When the installed build differs, results carry the warning `PROBABILITY_GAME_BUILD_UNVERIFIED`, and the nightly game-update watcher lists the adapters under "Checked against another build" on every run until the pin moves.
|
|
4
|
+
|
|
5
|
+
## Re-check for 1.19.4.1 (2026-11-06)
|
|
6
|
+
|
|
7
|
+
The adapters were first reviewed on 1.19.2.0 (`hoi4-1.19.2.v1`, sections below). For 1.19.4.1 every reviewed file was hashed again on the installed game:
|
|
8
|
+
|
|
9
|
+
- **Unchanged:** `common/decisions/_documentation.md`, `common/doctrines/_documentation.md`, `common/script_constants/documentation.md`, `documentation/script_concept_documentation.md` and `documentation/effects_documentation.md` are byte-identical to the hashes below.
|
|
10
|
+
- **Changed:** `common/ai_strategy/_documentation.md` is now `cd19fa144b47345a01632f38c5fb4a5cff7beece962f6640ca74fb83de3dc715`. Its `research_tech` section still forces research for any positive value. Its `research_weight_factor` section still describes a percentage factor on the technology's `ai_will_do`. Both are what `ai_strategy_factor` implements.
|
|
11
|
+
- **Examples:** `events/Yugoslavia.txt:49`, `common/national_focus/austria.txt:122` and `common/doctrines/grand_doctrines/land_grand_doctrines.txt:14` changed but keep their construct at the same line. `events/BBA_Switzerland.txt` has its `random` at line 1205 (was 1197). `common/ai_strategy/ENG.txt` has its `research_weight_factor` strategy at line 3202 (was 3206). The other examples are byte-identical.
|
|
12
|
+
- **Installed build:** `launcher-settings.json` reads `Operation Postern v1.19.4.1.99a5 (f584)`, raw version `1.19.4.1`.
|
|
13
|
+
|
|
14
|
+
No adapter rule changed, so only the version pin moved.
|
|
15
|
+
|
|
16
|
+
## Review on 1.19.2.0
|
|
4
17
|
|
|
5
18
|
This review used the installed game's documentation, vanilla source examples, and an offline Paradox wiki snapshot. Paths below are relative to a Hearts of Iron IV installation or to the offline snapshot. SHA-256 values identify the exact files reviewed on 2026-07-22.
|
|
6
19
|
|
|
@@ -50,7 +63,7 @@ The installed vanilla inventory contained 71 event files with MTTH, 101 with `ai
|
|
|
50
63
|
|
|
51
64
|
## Unsupported constructs
|
|
52
65
|
|
|
53
|
-
When a game root is configured, adapter execution
|
|
66
|
+
When a game root is configured, adapter execution reads `launcher-settings.json` and compares it with the supported raw version and checksum. A matching build is `workspace_verified`. A different build is still analyzed with the documented rules, recorded as `workspace_observed` and reported with the warning `PROBABILITY_GAME_BUILD_UNVERIFIED`. A missing or unreadable file is `version_unknown`. Without a configured game root, results identify the adapter target without claiming that an installed build was verified.
|
|
54
67
|
|
|
55
68
|
The analyzer reports, but does not guess or execute:
|
|
56
69
|
|
package/docs/tools.md
CHANGED
|
@@ -13,89 +13,99 @@ The **Writes** column says what a call can change:
|
|
|
13
13
|
MCP clients may ask for approval to create review files.
|
|
14
14
|
`hoi4.job_cancel` is marked destructive because it stops work in progress; it never edits source.
|
|
15
15
|
|
|
16
|
+
The tables below and the example calls are generated from the server's `tools/list` by `npm run docs:tools`: each purpose is the tool description up to its example, and the Writes column comes from the tool annotations.
|
|
17
|
+
A test fails when this page differs from `tools/list`, so edit the tool description, not the table.
|
|
18
|
+
|
|
19
|
+
<!-- generated:tool-tables:start -->
|
|
20
|
+
|
|
16
21
|
## References and source
|
|
17
22
|
|
|
18
|
-
| Tool | Purpose
|
|
19
|
-
| --------------------------- |
|
|
20
|
-
| `hoi4.reference_context` |
|
|
21
|
-
| `hoi4.reference_search` |
|
|
22
|
-
| `hoi4.reference_read` | Read
|
|
23
|
-
| `hoi4.source_lookup` | Find
|
|
24
|
-
| `hoi4.script_validate` |
|
|
25
|
-
| `hoi4.error_log` |
|
|
26
|
-
| `hoi4.mod_index` | Summarize the
|
|
27
|
-
| `hoi4.localisation_inspect` | Read localisation in every language: one key per language with file, line and layer,
|
|
28
|
-
| `hoi4.idea_inspect` | Read an idea
|
|
29
|
-
| `hoi4.system_inspect` | Read one definition of a newer system
|
|
30
|
-
| `hoi4.unit_inspect` | Read
|
|
31
|
-
| `hoi4.asset_inspect` | Read
|
|
23
|
+
| Tool | Purpose | Writes |
|
|
24
|
+
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ |
|
|
25
|
+
| `hoi4.reference_context` | Find documentation for the content you are building: events, decisions, ideas, focuses, technology, GUI, maps, localisation or AI. | — |
|
|
26
|
+
| `hoi4.reference_search` | Find the right modding rule in the offline wiki and installed game docs using ordinary words or script names. Each hit includes its file, lines, revision and answering line. | — |
|
|
27
|
+
| `hoi4.reference_read` | Read a documentation section returned by reference_search or reference_context. Pass its id and revision. | — |
|
|
28
|
+
| `hoi4.source_lookup` | Find where a script symbol is defined and used across the game, DLC and mod. Pass a symbol, or a file path and line. | — |
|
|
29
|
+
| `hoi4.script_validate` | Find broken syntax, commands and scopes in an effect, trigger or mod file using the installed docs. Unknown helpers and native argument blocks stay unresolved. | — |
|
|
30
|
+
| `hoi4.error_log` | Find errors from the last game launch and group them by category, with source files, lines and fix hints. Show which files changed since the log and which errors appeared after a relaunch; mod entries come first. | — |
|
|
31
|
+
| `hoi4.mod_index` | Summarize the content in a mod or find a free event ID across the mod, game and dependencies. Use overview for descriptors, folders and definitions, or next_id with a namespace or prefix. | — |
|
|
32
|
+
| `hoi4.localisation_inspect` | Read localisation in every language the game and mod ship. key: one key per language with file, line and layer, the languages lacking it and the files mentioning it. audit: keys the mod uses that no language defines, keys missing from a supported language, keys defined twice in one language, and file problems. coverage: keys per language. | — |
|
|
33
|
+
| `hoi4.idea_inspect` | Read an idea or character across the game, DLC and mod. idea: category, picture sprite and texture, modifiers checked against the game docs, conditions, name in every language, the advisor it belongs to, and files mentioning it. character: name, roles with traits checked, portraits checked. audit: true checks every idea or character of the mod. | — |
|
|
34
|
+
| `hoi4.system_inspect` | Read one definition of a newer system, or audit every one the mod makes: on_actions hooks, MIOs and policies, balance of power, special projects, operations and raids. Returns its parts, each reference with whether it exists, pictures, names in every language and problems. | — |
|
|
35
|
+
| `hoi4.unit_inspect` | Read one order of battle (history/units), sub-unit, equipment or module, or equipment variant, or audit every one the mod makes. Checks template grids, divisions, fleets, air wings, equipment slots and modules, and each name they use. | — |
|
|
36
|
+
| `hoi4.asset_inspect` | Read one sprite (texture size, format and frames), sound, sound effect or music track (audio file, sounds it plays), or flag (all three sizes), or audit every one the mod defines. Flags BC7 textures, missing files and wrong flag sizes. | — |
|
|
37
|
+
| `hoi4.skill` | List the modding skills installed in the mod, or load one by name, at the kit version HOI4 Mod Setup pinned, with its hash. A file edited since Setup installed it is refused unless acceptLocalEdits. | — |
|
|
32
38
|
|
|
33
39
|
## Focus trees
|
|
34
40
|
|
|
35
|
-
| Tool | Purpose
|
|
36
|
-
| -------------------- |
|
|
37
|
-
| `hoi4.focus_inspect` |
|
|
38
|
-
| `hoi4.focus_render` |
|
|
39
|
-
| `hoi4.focus_rewrite` | Create a focus tree or palette
|
|
41
|
+
| Tool | Purpose | Writes |
|
|
42
|
+
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------ |
|
|
43
|
+
| `hoi4.focus_inspect` | Check a focus tree's structure and layout. Returns blocking errors, a layout verdict (pass, review, revise, blocked) with the metrics behind it, a fix for each failing metric and next actions. Revise or blocked means the tree is not finished, however clean its structure; review is advisory, so look at hoi4.focus_render. | review files |
|
|
44
|
+
| `hoi4.focus_render` | Render a focus tree in the in-game style (right-angle connectors) and return it inline, with close-ups of the worst places; cropBranchIds and cropFocusIds add more. Look before you judge a layout: metrics cannot see composition. Also exports PNG with icons, HTML, SVG and JSON as linked artifacts. | review files |
|
|
45
|
+
| `hoi4.focus_rewrite` | Create or repair a focus tree or palette. New trees: lanes and position mode auto; x/y only for exact anchors. layoutMode compact repairs a layout (compactFocusIds picks a branch, pinnedFocusIds keeps neighbours); engine lays out with the Rust engine; placement adds focuses, moving no others; both need hoi4-engine. Keeps prerequisites and rewards. Returns files, layout verdict and delta. | mod files |
|
|
40
46
|
|
|
41
47
|
## Scripted GUIs
|
|
42
48
|
|
|
43
|
-
| Tool | Purpose
|
|
44
|
-
| ------------------ |
|
|
45
|
-
| `hoi4.gui_inspect` |
|
|
46
|
-
| `hoi4.gui_render` |
|
|
47
|
-
| `hoi4.gui_rewrite` | Create or edit a
|
|
49
|
+
| Tool | Purpose | Writes |
|
|
50
|
+
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
|
51
|
+
| `hoi4.gui_inspect` | Find the elements, assets and script behind a window, including layout problems, localisation and fonts. | review files |
|
|
52
|
+
| `hoi4.gui_render` | Preview a window at different resolutions and states. Shows control regions, element hierarchy and layout problems; unknown visibility stays unresolved. | review files |
|
|
53
|
+
| `hoi4.gui_rewrite` | Create or edit a window from complete source, structured helpers or exact patches. Add related text files in additionalFiles; binary art must already be in the mod. | mod files |
|
|
48
54
|
|
|
49
55
|
## Maps
|
|
50
56
|
|
|
51
|
-
| Tool | Purpose
|
|
52
|
-
| ------------------ |
|
|
53
|
-
| `hoi4.map_inspect` |
|
|
54
|
-
| `hoi4.map_rewrite` |
|
|
57
|
+
| Tool | Purpose | Writes |
|
|
58
|
+
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
|
59
|
+
| `hoi4.map_inspect` | Explore and preview the map. Find provinces, states and regions by name, ID or coordinates, inspect map problems and script references, or render a layer, tile or area. Use lookupOnly for a quick lookup and references:true for script references. | review files |
|
|
60
|
+
| `hoi4.map_rewrite` | Build a world from a reference image or a geography model (geography, geographyPath), or edit provinces, states, regions and supply. | mod files |
|
|
55
61
|
|
|
56
62
|
## Events
|
|
57
63
|
|
|
58
|
-
| Tool | Purpose
|
|
59
|
-
| -------------------- |
|
|
60
|
-
| `hoi4.event_inspect` |
|
|
61
|
-
| `hoi4.event_render` |
|
|
64
|
+
| Tool | Purpose | Writes |
|
|
65
|
+
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ |
|
|
66
|
+
| `hoi4.event_inspect` | Follow event chains and explain their options, conditions, timing and state changes. Find broken calls, inspect affected events or compare revisions with mode compare. | — |
|
|
67
|
+
| `hoi4.event_render` | Preview event routes, options, timing, state and scope as JSON, SVG and PNG. | — |
|
|
62
68
|
|
|
63
69
|
## Technology and doctrines
|
|
64
70
|
|
|
65
|
-
| Tool | Purpose
|
|
66
|
-
| ------------------- |
|
|
67
|
-
| `hoi4.tech_inspect` |
|
|
68
|
-
| `hoi4.tech_render` |
|
|
71
|
+
| Tool | Purpose | Writes |
|
|
72
|
+
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ |
|
|
73
|
+
| `hoi4.tech_inspect` | Explain technology and doctrine paths, unlocks, bonuses and dependencies. Find layout or reference problems and compare revisions with mode compare. | — |
|
|
74
|
+
| `hoi4.tech_render` | Preview technology folders and doctrines with their icons, item sizes and year guides. Show dependencies, bonuses, grants, unlocks or unresolved references as JSON, SVG and PNG. | — |
|
|
69
75
|
|
|
70
76
|
## AI weights and timing
|
|
71
77
|
|
|
72
|
-
| Tool | Purpose
|
|
73
|
-
| -------------------------- |
|
|
74
|
-
| `hoi4.probability_inspect` | Find
|
|
75
|
-
| `hoi4.probability_analyze` | Compare
|
|
78
|
+
| Tool | Purpose | Writes |
|
|
79
|
+
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ |
|
|
80
|
+
| `hoi4.probability_inspect` | Explain why the AI favours an option, decision, focus or technology. Find ai_will_do, ai_chance, MTTH, random_list or strategy factors by path, ID or candidate IDs and evaluate them under declared scenarios. Show weights, supported probabilities and missing facts. | — |
|
|
81
|
+
| `hoi4.probability_analyze` | Compare AI weights before and after an edit, find where a choice changes, or explore uncertain inputs and choices over time. Select compare, sweep, simulate, sequence or render with analysis. | — |
|
|
76
82
|
|
|
77
83
|
## Decisions, impact and tests
|
|
78
84
|
|
|
79
|
-
| Tool | Purpose
|
|
80
|
-
| ----------------------- |
|
|
81
|
-
| `hoi4.impact_inspect` |
|
|
82
|
-
| `hoi4.decision_inspect` |
|
|
83
|
-
| `hoi4.mechanic_test` |
|
|
84
|
-
| `hoi4.package_check` |
|
|
85
|
-
| `hoi4.scenario_test` | Run named
|
|
85
|
+
| Tool | Purpose | Writes |
|
|
86
|
+
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ |
|
|
87
|
+
| `hoi4.impact_inspect` | Find what a script change affects across focuses, events, decisions, ideas, windows and helpers. Trace definitions and their uses, including proposed source. | — |
|
|
88
|
+
| `hoi4.decision_inspect` | Explain why a decision or mission is hidden, unavailable or unaffordable. Inspect conditions, costs and lifecycle for declared actors and targets, or compare proposed source. | — |
|
|
89
|
+
| `hoi4.mechanic_test` | Test what an effect, option, decision or focus reward does to a declared state (docs/mechanics.md). | — |
|
|
90
|
+
| `hoi4.package_check` | Find missing pieces of a feature by checking its package manifest against definitions, calls, registrations, localisation, assets and required test cases. | — |
|
|
91
|
+
| `hoi4.scenario_test` | Run named mechanic, package or inspection cases from a suite or workspace file. Continue unfinished batches and report failures and unresolved cases. | — |
|
|
86
92
|
|
|
87
93
|
## Background jobs
|
|
88
94
|
|
|
89
|
-
| Tool | Purpose
|
|
90
|
-
| ------------------ |
|
|
91
|
-
| `hoi4.job_inspect` | Check background
|
|
92
|
-
| `hoi4.job_cancel` | Stop a background task.
|
|
95
|
+
| Tool | Purpose | Writes |
|
|
96
|
+
| ------------------ | ------------------------------------------------------------------------------------------------------ | --------- |
|
|
97
|
+
| `hoi4.job_inspect` | Check progress on a background task or retrieve its completed result. Pass jobId from the task handle. | — |
|
|
98
|
+
| `hoi4.job_cancel` | Stop a background task by jobId. A result that has already completed stays available. | job state |
|
|
99
|
+
|
|
100
|
+
<!-- generated:tool-tables:end -->
|
|
93
101
|
|
|
94
102
|
## Prompts and resources
|
|
95
103
|
|
|
96
104
|
The server offers one MCP prompt, `hoi4.probability_analysis`.
|
|
97
105
|
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.
|
|
98
106
|
|
|
107
|
+
The skills `hoi4.skill` serves are also resources, `hoi4-agent://workspace/{workspaceId}/skill/{name}`; see [Read the mod's skills](reference.md#read-the-mods-skills).
|
|
108
|
+
|
|
99
109
|
Large results are returned as links to the resource template `hoi4-agent://workspace/{workspaceId}/artifact/{sha256}/{provenanceHash}/{name}`.
|
|
100
110
|
Clients can read a byte range with `?offset=<bytes>&length=<bytes>`.
|
|
101
111
|
|
|
@@ -115,41 +125,46 @@ Every tool description in `tools/list` ends with a call like these, and an inval
|
|
|
115
125
|
Fields not shown take their defaults; `workspaceId` is `"current"` unless you pass one.
|
|
116
126
|
The CI stdio smoke suite sends each of these shapes to a real server process.
|
|
117
127
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
|
121
|
-
|
|
|
122
|
-
| `hoi4.
|
|
123
|
-
| `hoi4.
|
|
124
|
-
| `hoi4.
|
|
125
|
-
| `hoi4.
|
|
126
|
-
| `hoi4.
|
|
127
|
-
| `hoi4.
|
|
128
|
-
| `hoi4.
|
|
129
|
-
| `hoi4.
|
|
130
|
-
| `hoi4.
|
|
131
|
-
| `hoi4.
|
|
132
|
-
| `hoi4.
|
|
133
|
-
| `hoi4.
|
|
134
|
-
| `hoi4.
|
|
135
|
-
| `hoi4.
|
|
136
|
-
| `hoi4.
|
|
137
|
-
| `hoi4.
|
|
138
|
-
| `hoi4.
|
|
139
|
-
| `hoi4.
|
|
140
|
-
| `hoi4.
|
|
141
|
-
| `hoi4.
|
|
142
|
-
| `hoi4.
|
|
143
|
-
| `hoi4.
|
|
144
|
-
| `hoi4.
|
|
145
|
-
| `hoi4.
|
|
146
|
-
| `hoi4.
|
|
147
|
-
| `hoi4.
|
|
148
|
-
| `hoi4.
|
|
149
|
-
| `hoi4.
|
|
150
|
-
| `hoi4.
|
|
151
|
-
| `hoi4.
|
|
152
|
-
| `hoi4.
|
|
128
|
+
<!-- generated:tool-examples:start -->
|
|
129
|
+
|
|
130
|
+
| Tool | Example arguments |
|
|
131
|
+
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
132
|
+
| `hoi4.reference_context` | `{"surface":"event","question":"fire an event after a delay"}` |
|
|
133
|
+
| `hoi4.reference_search` | `{"query":"add_timed_idea"}` |
|
|
134
|
+
| `hoi4.reference_read` | `{"id":"<hit id>","revision":"<hit revision>"}` |
|
|
135
|
+
| `hoi4.source_lookup` | `{"symbol":"my_scripted_effect"}` |
|
|
136
|
+
| `hoi4.script_validate` | `{"source":"add_political_power = 10","kind":"effect","scope":"country"}` or `{"path":"events/a.txt"}` |
|
|
137
|
+
| `hoi4.error_log` | `{"scope":"mod","category":"effect"}` |
|
|
138
|
+
| `hoi4.mod_index` | `{"mode":"next_id","kind":"event","namespace":"my_mod"}` |
|
|
139
|
+
| `hoi4.localisation_inspect` | `{"mode":"key","key":"my_event.1.t"}` or `{"mode":"audit"}` |
|
|
140
|
+
| `hoi4.idea_inspect` | `{"kind":"idea","id":"GER_mefo_bills_1"}` or `{"kind":"character","audit":true}` |
|
|
141
|
+
| `hoi4.system_inspect` | `{"kind":"mio","id":"my_organization"}` or `{"kind":"on_actions","audit":true}` |
|
|
142
|
+
| `hoi4.unit_inspect` | `{"kind":"oob","id":"GER_1936"}` or `{"kind":"variant","audit":true}` |
|
|
143
|
+
| `hoi4.asset_inspect` | `{"kind":"sprite","id":"GFX_my_icon"}` or `{"kind":"flag","audit":true}` |
|
|
144
|
+
| `hoi4.skill` | `{"name":"hoi4-events"}` |
|
|
145
|
+
| `hoi4.focus_inspect` | `{"treeId":"my_focus_tree"}` |
|
|
146
|
+
| `hoi4.focus_render` | `{"relativePath":"common/national_focus/my_tree.txt","treeId":"my_focus_tree"}` |
|
|
147
|
+
| `hoi4.focus_rewrite` | `{"relativePath":"common/national_focus/my_tree.txt","treeId":"my_focus_tree","layoutMode":"compact"}` |
|
|
148
|
+
| `hoi4.gui_inspect` | `{"windowName":"my_window"}` |
|
|
149
|
+
| `hoi4.gui_render` | `{"windowName":"my_window","scenario":{"id":"normal","flags":{"my_flag":true}}}` |
|
|
150
|
+
| `hoi4.gui_rewrite` | `{"mode":"helpers","relativePath":"interface/my_window.gui","windowName":"my_window","scenario":{"id":"normal"},"helper":{"root":{"id":"w","kind":"column","name":"my_window"}}}` |
|
|
151
|
+
| `hoi4.map_inspect` | `{"query":"Brandenburg","lookupOnly":true}` |
|
|
152
|
+
| `hoi4.map_rewrite` | `{"preview":true,"operations":[{"kind":"create_world","reference":{"imagePath":"references/world.png"}}]}` |
|
|
153
|
+
| `hoi4.event_inspect` | `{"mode":"trace","selector":"my_mod.1","direction":"downstream"}` |
|
|
154
|
+
| `hoi4.event_render` | `{"view":"overview","selector":"my_mod"}` |
|
|
155
|
+
| `hoi4.tech_inspect` | `{"mode":"explain","technologyId":"my_tech"}` |
|
|
156
|
+
| `hoi4.tech_render` | `{"view":"folder","folderId":"my_folder"}` |
|
|
157
|
+
| `hoi4.probability_inspect` | `{"candidatePool":["my_decision"],"scenarioSet":[{"actor":"GER","state":{"has_war":false}}]}` |
|
|
158
|
+
| `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}}` |
|
|
159
|
+
| `hoi4.impact_inspect` | `{"symbols":[{"kind":"scripted_effect","id":"my_effect"}]}` |
|
|
160
|
+
| `hoi4.decision_inspect` | `{"mode":"inspect","id":"my_decision","scenarios":[{"id":"base","actor":"GER","state":{}}]}` |
|
|
161
|
+
| `hoi4.mechanic_test` | `{"test":{"id":"t","scenario":{"schemaVersion":"1.0","id":"t","state":{}},"steps":[{"kind":"effect","source":{"kind":"scripted_effect","id":"e"}}],"assertions":[{"id":"a","kind":"conservation","paths":[{"key":"x"},{"key":"y"}]}]}}` |
|
|
162
|
+
| `hoi4.package_check` | `{"manifest":{"schemaVersion":"1.0","id":"my_package","definitions":[{"kind":"scripted_effect","id":"my_effect"}]}}` |
|
|
163
|
+
| `hoi4.scenario_test` | `{"suitePath":"tests/my_suite.json","maxCases":20}` |
|
|
164
|
+
| `hoi4.job_inspect` | `{"jobId":"job_<64 hex characters>"}` |
|
|
165
|
+
| `hoi4.job_cancel` | `{"jobId":"job_<64 hex characters>"}` |
|
|
166
|
+
|
|
167
|
+
<!-- generated:tool-examples:end -->
|
|
153
168
|
|
|
154
169
|
## Result sizes
|
|
155
170
|
|
package/engine/bin/manifest.json
CHANGED
|
Binary file
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hoi4-agent-tools",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.11.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "hoi4-agent-tools",
|
|
9
|
-
"version": "4.
|
|
9
|
+
"version": "4.11.0",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@fontsource-variable/roboto": "5.3.0",
|
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": "4.
|
|
4
|
+
"version": "4.11.0",
|
|
5
5
|
"description": "Build HOI4 mods: focus trees, events, decisions, worlds, GUI previews, docs and AI balance.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -94,6 +94,7 @@
|
|
|
94
94
|
"benchmark": "node --expose-gc --import tsx scripts/benchmark.ts",
|
|
95
95
|
"benchmark:cold": "tsx scripts/benchmark-cold-paths.ts",
|
|
96
96
|
"bench": "tsx scripts/bench/cli.ts",
|
|
97
|
+
"docs:tools": "tsx scripts/generate-tool-docs.ts",
|
|
97
98
|
"docs:examples": "tsx scripts/generate-readme-examples.ts",
|
|
98
99
|
"docs:comparison-examples": "tsx scripts/generate-real-visual-comparisons.ts",
|
|
99
100
|
"fixtures:generate": "npm run fixtures:generate:focus && npm run fixtures:generate:gui && npm run fixtures:generate:map && npm run fixtures:generate:event && npm run fixtures:generate:technology && npm run fixtures:generate:probability",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.11.0/schemas/configuration.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.11.0/schemas/continuous-focus-palette.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.11.0/schemas/custom-weighted-pool.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.11.0/schemas/decision-inspect-input.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.11.0/schemas/error-log-input.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.11.0/schemas/event-feature-manifest.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.11.0/schemas/focus-plan.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.11.0/schemas/focus-planning-sidecar.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.11.0/schemas/geography-model.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -387,6 +387,9 @@
|
|
|
387
387
|
}
|
|
388
388
|
},
|
|
389
389
|
"additionalProperties": false
|
|
390
|
+
},
|
|
391
|
+
"impassable": {
|
|
392
|
+
"type": "boolean"
|
|
390
393
|
}
|
|
391
394
|
},
|
|
392
395
|
"required": [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.11.0/schemas/gui-animation-source.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.11.0/schemas/gui-helper.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.11.0/schemas/gui-scenario.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.11.0/schemas/helper-expansion-request.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v4.11.0/schemas/helper-expansion-summary.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|