hoi4-agent-tools 2.1.0 → 2.2.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.
@@ -1,6 +1,6 @@
1
1
  import { LATEST_PROTOCOL_VERSION } from '@modelcontextprotocol/sdk/types.js';
2
2
  export const PACKAGE_NAME = 'hoi4-agent-tools';
3
- export const PACKAGE_VERSION = '2.1.0';
3
+ export const PACKAGE_VERSION = '2.2.0';
4
4
  export const MCP_PROTOCOL_VERSION = LATEST_PROTOCOL_VERSION;
5
5
  export const CONFIG_VERSION = 1;
6
6
  export const TRANSACTION_VERSION = 1;
package/docs/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  - [Setup](setup.md): install the server, configure HOI4 paths, and connect an MCP client.
4
4
  - [Event chains](events.md): inspect, trace, lint, render, and compare event chains.
5
+ - [Technology trees](technology.md): inspect, trace, lint, render, and compare technologies and doctrines.
5
6
  - [Focus trees](focus.md): inspect, create, render, and clean national or continuous focus content.
6
7
  - [Scripted GUIs](gui.md): inspect linked UI source, render states, and create or repair GUIs.
7
8
  - [Maps](map.md): inspect and edit provinces, states, regions, adjacency, supply, and railways.
@@ -19,7 +19,11 @@ npm run inspector
19
19
 
20
20
  Keep changes focused and include tests for behavior changes. CI fixtures must be synthetic and project-owned; never commit installed-game or third-party-mod content. Public tool or schema changes require compatibility review and a versioned release.
21
21
 
22
- The event-chain acceptance fixture contains more than 300 project-owned event definitions and exercises routes, options, timing, state flow, scope changes, unresolved dynamic calls, rendering, and comparison. Local opt-in tests can also read an installed game and an external mod without copying their sources:
22
+ The event-chain acceptance fixture contains more than 300 project-owned event definitions and exercises routes, options, timing, state flow, scope changes, unresolved dynamic calls, rendering, and comparison.
23
+
24
+ The technology acceptance fixture contains 1,040 project-owned technologies across 13 folders and exercises classic and current doctrines, prerequisites, exclusive branches, multiple placements, unlocks, bonuses, grants, assets, unresolved references, rendering, and comparison.
25
+
26
+ Local opt-in tests can also read an installed game and an external mod without copying their sources:
23
27
 
24
28
  ```bash
25
29
  HOI4_GAME_ROOT="/games/Hearts of Iron IV" \
package/docs/setup.md CHANGED
@@ -10,7 +10,7 @@ npm install --global hoi4-agent-tools
10
10
 
11
11
  Set the MCP process working directory to the mod being edited. The server creates its local workspace in memory, keeps generated artifacts in the per-user data directory, and starts without a config file. The installed game is detected when available for vanilla references; it is not required for source inspection or offline rendering.
12
12
 
13
- When the MCP server starts with its working directory inside a mod, every focus, GUI, map, and event call uses that mod automatically. Configured multi-mod or remote deployments can use explicit workspace selection.
13
+ When the MCP server starts with its working directory inside a mod, every focus, GUI, map, event, and technology call uses that mod automatically. Configured multi-mod or remote deployments can use explicit workspace selection.
14
14
 
15
15
  ## Optional persistent configuration
16
16
 
@@ -0,0 +1,90 @@
1
+ # Technology trees
2
+
3
+ The Technology Tree Viewer reconstructs classic technologies, legacy doctrine technologies, and current doctrine definitions across the active mod, configured dependencies, and vanilla sources. It links prerequisites, folder placements, exclusive choices, categories, tags, unlocks, bonuses, grants, localisation, icons, and AI metadata without launching the game.
4
+
5
+ Use the three technology tools directly from the target mod.
6
+
7
+ ## Inspect
8
+
9
+ `hoi4.tech_inspect` provides eight focused modes:
10
+
11
+ - `scan`: build the complete technology graph and report its inventory, diagnostics, analysis limits, and revision.
12
+ - `folders`: list folder roots and source placements, or inspect one `folderId`.
13
+ - `trace`: follow prerequisites, descendants, or both from a `technologyId` with bounded depth and node limits.
14
+ - `explain`: collect one technology's definition, placements, paths, exclusivity, metadata, effects, unlocks, grants, bonuses, and unresolved references.
15
+ - `unlocks`: filter unlock relationships by technology, target kind, or target ID.
16
+ - `bonus_coverage`: show which technologies or categories are covered by discovered research bonuses.
17
+ - `lint`: filter source-linked findings by classification, diagnostic code, folder, or technology.
18
+ - `impact`: find the definitions, placements, edges, grants, bonuses, unlocks, localisation, sprites, and files affected by a proposed removal or rename.
19
+
20
+ Example trace:
21
+
22
+ ```json
23
+ {
24
+ "mode": "trace",
25
+ "technologyId": "infantry_weapons",
26
+ "direction": "both",
27
+ "maxDepth": 12,
28
+ "maxNodes": 2000
29
+ }
30
+ ```
31
+
32
+ Impact mode takes a subject with `kind` set to `technology`, `category`, `folder`, or `unlock_target`. A rename also requires `replacementId`:
33
+
34
+ ```json
35
+ {
36
+ "mode": "impact",
37
+ "impact": {
38
+ "kind": "technology",
39
+ "id": "old_technology",
40
+ "operation": "rename",
41
+ "replacementId": "new_technology"
42
+ }
43
+ }
44
+ ```
45
+
46
+ Findings are separated into confirmed errors, probable defects, design warnings, and unresolved analysis. Roots, grant-only technologies, early dates, zero AI weights, repeated effects, and routing nodes are evaluated in context instead of being treated as automatic defects.
47
+
48
+ ## Render
49
+
50
+ `hoi4.tech_render` returns authoritative JSON with deterministic SVG and PNG resources; set `includeHtml` when a bundled static report is useful. Available views are `summary`, `folder`, `dependencies`, `technology`, `doctrine`, `exclusive`, `memberships`, `bonuses`, `grants`, `unlocks`, `metadata`, `assets`, and `unresolved`.
51
+
52
+ Folder renders use the actual folder assignments, gridbox geometry, and technology coordinates found in source. Dependency and other semantic views are explicitly labelled as generated analysis layouts. Missing sprites, textures, or localisation remain identifiable from JSON and vector output even when no icon raster is decoded.
53
+
54
+ Example folder render:
55
+
56
+ ```json
57
+ {
58
+ "view": "folder",
59
+ "folderId": "infantry_folder",
60
+ "maxNodes": 1000,
61
+ "includeHtml": false
62
+ }
63
+ ```
64
+
65
+ Large dependency requests return a bounded overview plus focused folder resources and a coverage manifest. The graph itself is not truncated: use the manifest and linked `hoi4-agent://` resources to inspect the relevant folder or branch without loading the entire system into the prompt.
66
+
67
+ ## Compare
68
+
69
+ `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.
70
+
71
+ `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.
72
+
73
+ ```json
74
+ {
75
+ "proposedSources": [
76
+ {
77
+ "relativePath": "common/technologies/example.txt",
78
+ "source": "technologies = { example_tech = { start_year = 1936 } }\n"
79
+ }
80
+ ],
81
+ "render": true,
82
+ "maxRenderNodes": 500
83
+ }
84
+ ```
85
+
86
+ ## Agent workflow
87
+
88
+ For an unfamiliar technology system, an agent can scan it, discover folders, trace or explain the relevant path, render only the needed views, edit Clausewitz source through its normal repository workflow, and compare the result. The same graph and revision back every query and artifact, so folder placement, dependency structure, unlock impact, and cross-file references stay aligned.
89
+
90
+ This is static analysis. Exact runtime research time, AI choices, balance, arbitrary dynamic grants, and unsupported visibility behavior are not inferred. Dynamic expressions remain in the results with their confidence and blockers, and no destination is invented.
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "hoi4-agent-tools",
3
3
  "mcpName": "io.github.klimPaskov/hoi4-agent-tools",
4
- "version": "2.1.0",
5
- "description": "Analyze HOI4 event chains; create and clean focus trees, scripted GUIs, and maps with coding agents.",
4
+ "version": "2.2.0",
5
+ "description": "Analyze HOI4 events and technology trees; create and clean focus trees, GUIs, and maps.",
6
6
  "type": "module",
7
7
  "license": "Apache-2.0",
8
8
  "author": "HOI4 Agent Tools contributors",
@@ -22,6 +22,8 @@
22
22
  "clausewitz",
23
23
  "focus-trees",
24
24
  "event-chains",
25
+ "technology-trees",
26
+ "doctrines",
25
27
  "hoi4-events",
26
28
  "scripted-gui",
27
29
  "hoi4-map"
@@ -34,6 +36,7 @@
34
36
  "docs/README.md",
35
37
  "docs/setup.md",
36
38
  "docs/events.md",
39
+ "docs/technology.md",
37
40
  "docs/focus.md",
38
41
  "docs/gui.md",
39
42
  "docs/map.md",
@@ -63,11 +66,12 @@
63
66
  "test:local": "tsx scripts/run-local-tests.ts",
64
67
  "test:coverage": "vitest run --coverage",
65
68
  "benchmark": "node --expose-gc --import tsx scripts/benchmark.ts",
66
- "fixtures:generate": "npm run fixtures:generate:focus && npm run fixtures:generate:gui && npm run fixtures:generate:map && npm run fixtures:generate:event",
69
+ "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",
67
70
  "fixtures:generate:focus": "tsx scripts/generate-fixtures.ts",
68
71
  "fixtures:generate:gui": "tsx scripts/generate-gui-fixture.ts",
69
72
  "fixtures:generate:map": "tsx scripts/generate-map-fixture.ts",
70
73
  "fixtures:generate:event": "tsx scripts/generate-event-fixture.ts",
74
+ "fixtures:generate:technology": "tsx scripts/generate-technology-fixture.ts",
71
75
  "fixtures:check": "npm run fixtures:generate && tsx scripts/check-generated.ts fixtures",
72
76
  "schemas:generate": "tsx scripts/generate-schemas.ts",
73
77
  "schemas:check": "tsx scripts/generate-schemas.ts && tsx scripts/check-generated.ts schemas",
@@ -111,6 +115,11 @@
111
115
  "typescript-eslint": "8.63.0",
112
116
  "vitest": "4.1.10"
113
117
  },
118
+ "overrides": {
119
+ "@hono/node-server": "2.0.11",
120
+ "fast-uri": "3.1.4",
121
+ "shell-quote": "1.10.0"
122
+ },
114
123
  "publishConfig": {
115
124
  "access": "public",
116
125
  "provenance": true
package/server.json CHANGED
@@ -2,8 +2,8 @@
2
2
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
3
  "name": "io.github.klimPaskov/hoi4-agent-tools",
4
4
  "title": "HOI4 Agent Tools",
5
- "description": "Analyze HOI4 event chains; create and clean focus trees, scripted GUIs, and maps with coding agents.",
6
- "version": "2.1.0",
5
+ "description": "Analyze HOI4 events and technology trees; create and clean focus trees, GUIs, and maps.",
6
+ "version": "2.2.0",
7
7
  "repository": {
8
8
  "url": "https://github.com/klimPaskov/hoi4-agent-tools",
9
9
  "source": "github"
@@ -13,7 +13,7 @@
13
13
  {
14
14
  "registryType": "npm",
15
15
  "identifier": "hoi4-agent-tools",
16
- "version": "2.1.0",
16
+ "version": "2.2.0",
17
17
  "transport": {
18
18
  "type": "stdio"
19
19
  }