hoi4-agent-tools 0.1.6 → 0.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.
- package/CHANGELOG.md +46 -0
- package/README.md +44 -27
- package/SECURITY.md +4 -2
- package/dist/bin/setup.js +43 -6
- package/dist/bin/setup.js.map +1 -1
- package/dist/hoi4_agent_tools/core/configuration.d.ts +1 -0
- package/dist/hoi4_agent_tools/core/configuration.d.ts.map +1 -1
- package/dist/hoi4_agent_tools/core/configuration.js +3 -3
- package/dist/hoi4_agent_tools/core/configuration.js.map +1 -1
- package/dist/hoi4_agent_tools/core/engine.d.ts +1 -0
- package/dist/hoi4_agent_tools/core/engine.d.ts.map +1 -1
- package/dist/hoi4_agent_tools/core/engine.js +1 -0
- package/dist/hoi4_agent_tools/core/engine.js.map +1 -1
- package/dist/hoi4_agent_tools/core/index.d.ts.map +1 -1
- package/dist/hoi4_agent_tools/core/index.js +10 -2
- package/dist/hoi4_agent_tools/core/index.js.map +1 -1
- package/dist/hoi4_agent_tools/core/transactions.d.ts +2 -0
- package/dist/hoi4_agent_tools/core/transactions.d.ts.map +1 -1
- package/dist/hoi4_agent_tools/core/transactions.js +49 -6
- package/dist/hoi4_agent_tools/core/transactions.js.map +1 -1
- package/dist/hoi4_agent_tools/core/workspace.js +1 -1
- package/dist/hoi4_agent_tools/core/workspace.js.map +1 -1
- package/dist/hoi4_agent_tools/focus/compiler.d.ts +2 -1
- package/dist/hoi4_agent_tools/focus/compiler.d.ts.map +1 -1
- package/dist/hoi4_agent_tools/focus/compiler.js +12 -2
- package/dist/hoi4_agent_tools/focus/compiler.js.map +1 -1
- package/dist/hoi4_agent_tools/focus/importer.d.ts.map +1 -1
- package/dist/hoi4_agent_tools/focus/importer.js +13 -2
- package/dist/hoi4_agent_tools/focus/importer.js.map +1 -1
- package/dist/hoi4_agent_tools/focus/layout.d.ts.map +1 -1
- package/dist/hoi4_agent_tools/focus/layout.js +165 -42
- package/dist/hoi4_agent_tools/focus/layout.js.map +1 -1
- package/dist/hoi4_agent_tools/focus/lint.d.ts.map +1 -1
- package/dist/hoi4_agent_tools/focus/lint.js +37 -8
- package/dist/hoi4_agent_tools/focus/lint.js.map +1 -1
- package/dist/hoi4_agent_tools/focus/model.d.ts +5 -1
- package/dist/hoi4_agent_tools/focus/model.d.ts.map +1 -1
- package/dist/hoi4_agent_tools/focus/model.js +2 -0
- package/dist/hoi4_agent_tools/focus/model.js.map +1 -1
- package/dist/hoi4_agent_tools/focus/presentation.d.ts.map +1 -1
- package/dist/hoi4_agent_tools/focus/presentation.js +13 -5
- package/dist/hoi4_agent_tools/focus/presentation.js.map +1 -1
- package/dist/hoi4_agent_tools/focus/render.d.ts +4 -0
- package/dist/hoi4_agent_tools/focus/render.d.ts.map +1 -1
- package/dist/hoi4_agent_tools/focus/render.js +17 -3
- package/dist/hoi4_agent_tools/focus/render.js.map +1 -1
- package/dist/hoi4_agent_tools/focus/service.d.ts.map +1 -1
- package/dist/hoi4_agent_tools/focus/service.js +142 -97
- package/dist/hoi4_agent_tools/focus/service.js.map +1 -1
- package/dist/hoi4_agent_tools/focus/source-update.d.ts.map +1 -1
- package/dist/hoi4_agent_tools/focus/source-update.js +9 -4
- package/dist/hoi4_agent_tools/focus/source-update.js.map +1 -1
- package/dist/hoi4_agent_tools/gui/studio.d.ts.map +1 -1
- package/dist/hoi4_agent_tools/gui/studio.js +3 -2
- package/dist/hoi4_agent_tools/gui/studio.js.map +1 -1
- package/dist/hoi4_agent_tools/map/service.d.ts.map +1 -1
- package/dist/hoi4_agent_tools/map/service.js +11 -5
- package/dist/hoi4_agent_tools/map/service.js.map +1 -1
- package/dist/hoi4_agent_tools/mcp/prompts/register.d.ts +2 -1
- package/dist/hoi4_agent_tools/mcp/prompts/register.d.ts.map +1 -1
- package/dist/hoi4_agent_tools/mcp/prompts/register.js +35 -13
- package/dist/hoi4_agent_tools/mcp/prompts/register.js.map +1 -1
- package/dist/hoi4_agent_tools/mcp/registry/metadata.d.ts +1 -1
- package/dist/hoi4_agent_tools/mcp/resources/register.d.ts.map +1 -1
- package/dist/hoi4_agent_tools/mcp/resources/register.js +1 -0
- package/dist/hoi4_agent_tools/mcp/resources/register.js.map +1 -1
- package/dist/hoi4_agent_tools/mcp/security/auth.d.ts.map +1 -1
- package/dist/hoi4_agent_tools/mcp/security/auth.js +1 -4
- package/dist/hoi4_agent_tools/mcp/security/auth.js.map +1 -1
- package/dist/hoi4_agent_tools/mcp/server/base-tools.d.ts +12 -0
- package/dist/hoi4_agent_tools/mcp/server/base-tools.d.ts.map +1 -1
- package/dist/hoi4_agent_tools/mcp/server/base-tools.js +297 -218
- package/dist/hoi4_agent_tools/mcp/server/base-tools.js.map +1 -1
- package/dist/hoi4_agent_tools/mcp/server/create.d.ts.map +1 -1
- package/dist/hoi4_agent_tools/mcp/server/create.js +8 -2
- package/dist/hoi4_agent_tools/mcp/server/create.js.map +1 -1
- package/dist/hoi4_agent_tools/mcp/server/output-schemas.d.ts +5 -0
- package/dist/hoi4_agent_tools/mcp/server/output-schemas.d.ts.map +1 -1
- package/dist/hoi4_agent_tools/mcp/server/output-schemas.js +1 -0
- package/dist/hoi4_agent_tools/mcp/server/output-schemas.js.map +1 -1
- package/dist/hoi4_agent_tools/mcp/server/result.js +1 -1
- package/dist/hoi4_agent_tools/mcp/server/result.js.map +1 -1
- package/dist/hoi4_agent_tools/mcp/server/transaction-execution.d.ts +31 -0
- package/dist/hoi4_agent_tools/mcp/server/transaction-execution.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/mcp/server/transaction-execution.js +127 -0
- package/dist/hoi4_agent_tools/mcp/server/transaction-execution.js.map +1 -0
- package/dist/hoi4_agent_tools/mcp/tools/focus.d.ts.map +1 -1
- package/dist/hoi4_agent_tools/mcp/tools/focus.js +131 -30
- package/dist/hoi4_agent_tools/mcp/tools/focus.js.map +1 -1
- package/dist/hoi4_agent_tools/mcp/tools/gui.d.ts +6 -0
- package/dist/hoi4_agent_tools/mcp/tools/gui.d.ts.map +1 -1
- package/dist/hoi4_agent_tools/mcp/tools/gui.js +40 -12
- package/dist/hoi4_agent_tools/mcp/tools/gui.js.map +1 -1
- package/dist/hoi4_agent_tools/mcp/tools/map.d.ts.map +1 -1
- package/dist/hoi4_agent_tools/mcp/tools/map.js +39 -12
- package/dist/hoi4_agent_tools/mcp/tools/map.js.map +1 -1
- package/dist/hoi4_agent_tools/mcp/transports/http.d.ts.map +1 -1
- package/dist/hoi4_agent_tools/mcp/transports/http.js +3 -0
- package/dist/hoi4_agent_tools/mcp/transports/http.js.map +1 -1
- package/dist/hoi4_agent_tools/schemas/focus.d.ts +1 -1
- package/dist/hoi4_agent_tools/schemas/focus.d.ts.map +1 -1
- package/dist/hoi4_agent_tools/schemas/focus.js +16 -2
- package/dist/hoi4_agent_tools/schemas/focus.js.map +1 -1
- package/dist/hoi4_agent_tools/version.d.ts +1 -1
- package/dist/hoi4_agent_tools/version.js +1 -1
- package/docs/README.md +3 -2
- package/docs/adr/0012-autonomous-rewrites.md +55 -0
- package/docs/adr/README.md +1 -0
- package/docs/agent-integration.md +146 -0
- package/docs/architecture.md +20 -4
- package/docs/artifacts.md +8 -5
- package/docs/completion-report.md +109 -79
- package/docs/configuration.md +30 -10
- package/docs/focus-workflow.md +134 -5
- package/docs/gui-workflow.md +7 -3
- package/docs/limitations.md +4 -2
- package/docs/map-workflow.md +15 -9
- package/docs/performance.md +1 -1
- package/docs/release.md +12 -7
- package/docs/research/mcp-2026-07-10.md +9 -3
- package/docs/security.md +12 -6
- package/docs/self-hosting.md +8 -6
- package/docs/transactions.md +45 -27
- package/docs/troubleshooting.md +12 -4
- package/package.json +7 -3
- package/schemas/configuration.schema.json +3 -2
- package/schemas/continuous-focus-palette.schema.json +1 -1
- package/schemas/focus-plan.schema.json +74 -49
- package/schemas/focus-planning-sidecar.schema.json +33 -18
- 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/map-operation.schema.json +1 -1
- package/schemas/operation-result.schema.json +1 -1
- package/schemas/transaction-manifest.schema.json +1 -1
- package/server.json +4 -4
package/docs/map-workflow.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Agent Nudger map workflow
|
|
2
2
|
|
|
3
|
-
Agent Nudger is a headless declarative map
|
|
3
|
+
Agent Nudger is a headless declarative map rewrite service for coding agents. HTML/PNG/JSON maps are inspection evidence, not a manual editor.
|
|
4
4
|
|
|
5
5
|
## Indexed sources
|
|
6
6
|
|
|
@@ -8,14 +8,14 @@ The shared scan connects province bitmap and definitions, states, strategic regi
|
|
|
8
8
|
|
|
9
9
|
## Geometry input
|
|
10
10
|
|
|
11
|
-
Province geometry
|
|
11
|
+
Province geometry rewrite requires one exact representation:
|
|
12
12
|
|
|
13
13
|
- selected existing province IDs;
|
|
14
14
|
- polygon with integer raster-boundary coordinates and explicit `fillRule: "even-odd"`;
|
|
15
15
|
- raster mask manifest with dimensions, origin, exact selected-pixel count, SHA-256, and canonical Base64 data;
|
|
16
16
|
- explicit absolute pixel region (`kind: pixels`).
|
|
17
17
|
|
|
18
|
-
Natural-language descriptions can guide a coding agent, but are not accepted as
|
|
18
|
+
Natural-language descriptions can guide a coding agent, but are not accepted as rewrite geometry.
|
|
19
19
|
|
|
20
20
|
Polygon vertices describe raster cell boundaries, not pixel indices. For a raster of `width` by `height`, every vertex must use an integer `x` from `0` through `width` and an integer `y` from `0` through `height`; the right and bottom boundary values `width` and `height` are valid. A greater coordinate is rejected with `MAP_GEOMETRY_OUT_OF_BOUNDS` before bounding-box or raster-work allocation, and polygon geometry is never silently clipped. Rasterization samples each candidate pixel at its center, `(x + 0.5, y + 0.5)`, using the required even-odd fill rule. Every selected center must still belong to the declared source province.
|
|
21
21
|
|
|
@@ -33,7 +33,7 @@ Split/merge/move operations do not guess manpower, resources, buildings, victory
|
|
|
33
33
|
- exact manifest values;
|
|
34
34
|
- block until resolved.
|
|
35
35
|
|
|
36
|
-
Proportional rounding is deterministic and checked for conservation. The
|
|
36
|
+
Proportional rounding is deterministic and checked for conservation. The rewrite remains blocked while any required policy is unresolved.
|
|
37
37
|
|
|
38
38
|
State move, split, and merge manifests also declare `ports`, `supplyNodes`, `railways`, and `positions` as `follow-province`. Those records are keyed by a selected province or its state association, so their source bytes remain unchanged except for the already modelled state-ID field on applicable position rows. The explicit literals make that behavior reviewable and prevent a partial distribution object from silently choosing it.
|
|
39
39
|
|
|
@@ -45,11 +45,11 @@ New states require an explicit name localisation key and a strict `localisation`
|
|
|
45
45
|
|
|
46
46
|
`merge_provinces` and `remove_province` accept arbitrary compatible source IDs; removed IDs do not need to be the highest rows in `definition.csv`. Surviving definitions are compacted deterministically to contiguous IDs from zero in old-ID order. Removed source IDs map to the target's compacted ID, including when the target itself moves downward.
|
|
47
47
|
|
|
48
|
-
The same total old-to-new map is applied
|
|
48
|
+
The same total old-to-new map is applied as one recoverable operation to state membership, victory points, province buildings, strategic regions, special-adjacency endpoints and through-provinces, supply nodes, railways, unit positions, and building-position sea references. Source pixels are repainted with the target color; other province colors and pixels remain unchanged. Reference collisions created by the merge are resolved by the declared sum/deduplicate policy. Definition row order, comments and extra fields, text-file comments, line endings, and source encoding are retained by targeted rewrites. A failed application or post-validation restores every affected file byte-for-byte.
|
|
49
49
|
|
|
50
50
|
Compaction requires an active definition table that is already contiguous from zero and unambiguous by ID and color. The merge also requires every source and target to share province type plus exact state and strategic-region membership; these are refusal cases rather than guessed redistribution.
|
|
51
51
|
|
|
52
|
-
Province split/create manifests explicitly retain existing victory points, province buildings, ports, supply nodes, railways, special adjacencies, positions, and entity locators on the source province while the selected pixels and new ID join the declared state and strategic region. To move connected data to the new province, place the corresponding exact remove/add or update operations after the split in the same ordered
|
|
52
|
+
Province split/create manifests explicitly retain existing victory points, province buildings, ports, supply nodes, railways, special adjacencies, positions, and entity locators on the source province while the selected pixels and new ID join the declared state and strategic region. To move connected data to the new province, place the corresponding exact remove/add or update operations after the split in the same ordered rewrite. Omitting any retention field blocks the split before geometry changes are proposed.
|
|
53
53
|
|
|
54
54
|
## Province type migration
|
|
55
55
|
|
|
@@ -66,7 +66,7 @@ The policy explicitly covers:
|
|
|
66
66
|
- building and unit positions (`retain-if-valid` or `remove`) and entity locators (`retain-at-coordinate`, because type migration does not alter geometry);
|
|
67
67
|
- special adjacency endpoint/through references (`retain-if-valid` or `remove-referencing`).
|
|
68
68
|
|
|
69
|
-
Land-to-water requires removal from the exact indexed state and cannot leave that state without land. Water-to-land requires an explicit existing target state in the same strategic region. Sea targets require `ocean` terrain and continent `0`; lake targets require `lakes` and continent `0`; land targets require a non-water terrain and nonzero continent. Coastal fields and neighboring coastal changes remain exact manifest inputs and are verified by final map validation. Dependency removals and the definition edit share one hash-bound
|
|
69
|
+
Land-to-water requires removal from the exact indexed state and cannot leave that state without land. Water-to-land requires an explicit existing target state in the same strategic region. Sea targets require `ocean` terrain and continent `0`; lake targets require `lakes` and continent `0`; land targets require a non-water terrain and nonzero continent. Coastal fields and neighboring coastal changes remain exact manifest inputs and are verified by final map validation. Dependency removals and the definition edit share one hash-bound journal, so success or automatic failure restoration covers every affected state, definition, network, position, and adjacency file together.
|
|
70
70
|
|
|
71
71
|
When a dependency should move rather than disappear, place the corresponding exact `update_state`, position, supply, railway, or adjacency operation after the type migration in the same ordered manifest. The migration policy removes or retains the old record explicitly; the later operation supplies the new target explicitly.
|
|
72
72
|
|
|
@@ -74,16 +74,22 @@ When a dependency should move rather than disappear, place the corresponding exa
|
|
|
74
74
|
|
|
75
75
|
Special adjacency rows remain declarative `add_adjacency` and `remove_adjacency` operations against the active `default.map` adjacency CSV. Normal topological adjacency is derived only from four-neighbor province bitmap geometry (including horizontal map wrap) and uses separate `add_normal_adjacency` and `remove_normal_adjacency` operations.
|
|
76
76
|
|
|
77
|
-
Every normal-adjacency operation carries unique exact pixel transfers with a coordinate, the province currently owning that pixel, and the destination province. Both requested endpoints and all transfer provinces must exist, every source must match the active raster, and every transfer must involve at least one requested endpoint. Agent Nudger repaints only those 24-bit pixels, rebuilds topology, and
|
|
77
|
+
Every normal-adjacency operation carries unique exact pixel transfers with a coordinate, the province currently owning that pixel, and the destination province. Both requested endpoints and all transfer provinces must exist, every source must match the active raster, and every transfer must involve at least one requested endpoint. Agent Nudger repaints only those 24-bit pixels, rebuilds topology, and restores the operation unless the requested pair is present after an add or absent after a remove. Related coastal-definition changes remain explicit ordered operations in the same rewrite.
|
|
78
78
|
|
|
79
79
|
## Allocation
|
|
80
80
|
|
|
81
81
|
ID/color allocation scans current game, dependencies, and mod sources first, including the definition table selected by each root's own `default.map` even when its filename differs from the active table. It records per-file/root maxima, used ranges, active definition contiguity, collisions, reserved values, selected value/color, and source revision. Explicit values are checked against the same evidence. A lower-root ID/color collision is returned as a named dependency conflict on the manifest operation that requested it. The allocator never assumes the numerically next value is safe.
|
|
82
82
|
|
|
83
|
+
## Autonomous rewrite
|
|
84
|
+
|
|
85
|
+
With `writePolicy: "autonomous"`, submit the complete ordered operation manifest once to `hoi4.map_rewrite`. The tool scans dependencies, resolves exact geometry and policies, renders baseline/proposed/diff evidence, validates, journals exact before-bytes, applies all affected text and binary files under the workspace lock, rescans, and post-validates. `execution: "applied"` means the final hashes and validation passed. A blocked proposal reports `execution: "blocked"` and changes nothing; a valid no-change request reports `execution: "unchanged"`; a failure after replacement begins restores every affected file automatically.
|
|
86
|
+
|
|
87
|
+
No transaction tools are registered in autonomous mode. The optional `"transactions"` compatibility policy exposes `hoi4.map_plan` followed by the separate diff/apply/status/rollback tools, using the same internal journal and recovery engine.
|
|
88
|
+
|
|
83
89
|
## Artifacts and validation
|
|
84
90
|
|
|
85
91
|
Map base layers cover province, state, strategic region, terrain, continent, owner, controller, cores, claims, and coast. Overlays cover coastlines, ports, victory points, resources, state buildings, province buildings, supply nodes, railways, special adjacencies, building positions, unit positions, and weather positions. Resource/building data is present in canonical JSON as exact sorted state/province maps as well as deterministic PNG markers; HTML embeds the same JSON and PNG with pan/zoom controls. Render loops honor cancellation signals.
|
|
86
92
|
|
|
87
|
-
Every map preflight stores three content-addressed PNG/JSON/HTML triplets: baseline (`map-before.*`), proposed (`map-proposed.*`), and changed-pixel/semantic diff (`map-diff.*`). Their links and content hashes are included in the
|
|
93
|
+
Every map preflight stores three content-addressed PNG/JSON/HTML triplets: baseline (`map-before.*`), proposed (`map-proposed.*`), and changed-pixel/semantic diff (`map-diff.*`). Their links and content hashes are included in the internal plan hash. Semantic diff JSON includes definitions, state/region membership, full state values (manpower, category, resources, owner/controller, cores/claims, VPs, state/province buildings, and derived capital), ports, building/unit/weather positions, entity locators, supply, railways, exact special-adjacency records, and exact bitmap-derived normal-adjacency pairs.
|
|
88
94
|
|
|
89
95
|
Validation detects duplicate IDs/colors, bitmap-definition mismatches, invalid references, unassigned/multi-state land, invalid derived capitals/VPs/ports/regions/adjacency/supply/rail/placements, removed references, coast inconsistencies, duplicate state IDs, missing localisation, ownership/control conflicts, lost payload, changes outside declared bounds, and dependency conflicts. Geometry review includes disconnected components, one-pixel corridors, and enclosed province holes. Hole detection uses one bounded digital-topology pass and reports `MAP_PROVINCE_HOLE_REVIEW` as a warning because intentional enclaves can be valid; provinces crossing the horizontally wrapping seam are excluded from planar hole classification. Baseline comparisons diagnose dimensions, file/DIB header, row orientation, pixel offset, bit depth, and palette changes separately. Sea and legitimate lake/island cases are not misclassified as missing state membership.
|
package/docs/performance.md
CHANGED
|
@@ -75,7 +75,7 @@ The benchmark changes only the copied fixture's modification time and confirms t
|
|
|
75
75
|
- metadata-only rescan/cache hit: 5.431 ms;
|
|
76
76
|
- same-size, same-mtime content change/rescan: 20.300 ms.
|
|
77
77
|
|
|
78
|
-
The deterministic unit test in `tests/unit/core-cache.test.ts` continuously checks this correctness property without asserting timing.
|
|
78
|
+
The deterministic unit test in `tests/unit/core-cache.test.ts` continuously checks this correctness property without asserting timing. Autonomous rewrites and reviewed transaction apply/rollback paths all invalidate the workspace cache; the content-derived revision remains the safety backstop for external edits.
|
|
79
79
|
|
|
80
80
|
The Scripted GUI Studio and Agent Nudger benchmark paths currently rebuild their domain scans/indexes on each call. Their warm figures therefore reflect runtime/JIT and operating-system cache effects rather than a domain-level memoization claim. Stored artifacts are content-addressed, but artifact storage is not treated as a parsed-source cache.
|
|
81
81
|
|
package/docs/release.md
CHANGED
|
@@ -59,7 +59,7 @@ stable package is published, the normal strict stable-version monotonic and exac
|
|
|
59
59
|
## Immutable fix-forward history
|
|
60
60
|
|
|
61
61
|
Stable tags and public package versions are never moved, deleted, or overwritten after a failed
|
|
62
|
-
release attempt. The retained history
|
|
62
|
+
release attempt. The retained history is:
|
|
63
63
|
|
|
64
64
|
- `v0.1.0` stopped during prepublication validation, before any public writer ran;
|
|
65
65
|
- `v0.1.1` stopped before npm accepted bytes because npm interpreted a slash-containing relative
|
|
@@ -85,12 +85,17 @@ release attempt. The retained history before `0.1.6` is:
|
|
|
85
85
|
cross-surface verifier rejected the Registry's omission of explicit `isSecret: false`, although
|
|
86
86
|
the pinned official schema defines false as that field's default and every public object passed
|
|
87
87
|
its preceding publication gate. All public objects remain unchanged as audit evidence.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
- `v0.1.6` completed the ordered workflow and independent verification across npm, GHCR, the
|
|
89
|
+
immutable GitHub Release, and the official MCP Registry.
|
|
90
|
+
- `v0.1.7` completed the same ordered workflow with agent-first persistent setup guidance, large
|
|
91
|
+
focus-tree review scaling, symbolic focus-cost preservation, and complete resource-backed focus
|
|
92
|
+
validation. Its exact public evidence is retained in
|
|
93
|
+
[the 0.1.7 completion report](completion-report.md).
|
|
94
|
+
|
|
95
|
+
`0.2.0` is the current strictly monotonic release candidate. The normal stable-version gate treats
|
|
96
|
+
public `0.1.7` as immutable history; only a strictly newer version may be published. Rerunning or fixing a
|
|
97
|
+
release never authorizes rewriting a tag, package version, image tag, release asset, or Registry
|
|
98
|
+
version.
|
|
94
99
|
|
|
95
100
|
## Required pre-tag immutability check
|
|
96
101
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# MCP protocol, SDK, security, and Registry review
|
|
2
2
|
|
|
3
|
-
Verified 2026-07-
|
|
3
|
+
Verified again on 2026-07-12 against official sources.
|
|
4
4
|
|
|
5
5
|
## Selected production baseline
|
|
6
6
|
|
|
@@ -17,10 +17,16 @@ The breaking `2026-07-28` protocol and SDK v2 split packages were release candid
|
|
|
17
17
|
- Stdio uses newline-delimited UTF-8 JSON-RPC, protocol-only stdout, and stderr logging.
|
|
18
18
|
- Streamable HTTP uses one `/mcp` POST/GET endpoint plus DELETE for session termination. It is stateful to support progress, cancellation, server notifications, SSE resumption, and secure random sessions.
|
|
19
19
|
- Sessions are bound to authenticated principals and expire; they are never authentication credentials.
|
|
20
|
-
- Tools use strict schemas and explicit read-only/destructive/idempotent/open-world annotations. Hints do not replace enforcement.
|
|
20
|
+
- Tools use strict schemas and explicit read-only/destructive/idempotent/open-world annotations. Hints do not replace enforcement and do not require a client to show a confirmation prompt for each call.
|
|
21
21
|
- Long work observes `AbortSignal` and sends monotonic progress only when the client supplies a progress token.
|
|
22
22
|
- Large results are content-addressed resources. Binary reads are bounded/chunkable because resource links defer retrieval but are not a byte-stream transport.
|
|
23
|
-
- Prompts describe
|
|
23
|
+
- Prompts describe domain workflows but grant no permission.
|
|
24
|
+
|
|
25
|
+
### Write-policy conclusion
|
|
26
|
+
|
|
27
|
+
MCP separates server-advertised tool metadata from client-host policy. A server can truthfully mark a source-changing tool with `readOnlyHint: false` and `destructiveHint: true`, but it cannot require, suppress, or bypass a host confirmation dialog. The host decides how to present or constrain the call; the server independently enforces its configured workspace, authentication, scope, validation, journaling, and recovery boundaries.
|
|
28
|
+
|
|
29
|
+
For this server, `writePolicy: "autonomous"` therefore exposes one-call `hoi4.focus_rewrite`, `hoi4.gui_rewrite`, and `hoi4.map_rewrite` tools with destructive annotations. The tools internally plan, validate, journal, apply, and post-validate, restoring original bytes on failure. Transaction tools are not registered in that mode. `writePolicy: "transactions"` remains an optional compatibility surface for the older client-driven review/apply sequence, while `read-only` remains the default.
|
|
24
30
|
|
|
25
31
|
## Remote security requirements applied
|
|
26
32
|
|
package/docs/security.md
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
- external mod source and binary map data;
|
|
6
6
|
- installed game and dependency references;
|
|
7
|
-
-
|
|
7
|
+
- configured write authority, authenticated journals, and exact recovery blobs;
|
|
8
8
|
- generated artifacts that may reveal source details;
|
|
9
9
|
- HTTP credentials and principal/workspace grants.
|
|
10
10
|
|
|
11
11
|
## Trust boundaries
|
|
12
12
|
|
|
13
|
-
MCP input, file paths, manifest content, client annotations, session IDs, Origin/Host headers, and remote access tokens are untrusted. Tool annotations are descriptive hints. Prompts are guidance. Server-side
|
|
13
|
+
MCP input, file paths, manifest content, client annotations, session IDs, Origin/Host headers, and remote access tokens are untrusted. Tool annotations are descriptive hints. Prompts are guidance. MCP does not require a confirmation prompt for every destructive tool call. Server-side configuration is authoritative for server access, while the MCP host independently controls its own approval and filesystem policy; neither can override the other.
|
|
14
14
|
|
|
15
15
|
## Filesystem controls
|
|
16
16
|
|
|
@@ -19,7 +19,7 @@ MCP input, file paths, manifest content, client annotations, session IDs, Origin
|
|
|
19
19
|
- Traversal, absolute paths, UNC/device paths, NULs, alternate data streams, ambiguous trailing characters, and device names are rejected.
|
|
20
20
|
- Existing symlinks and junctions are resolved; an escape outside the root is rejected.
|
|
21
21
|
- Artifact shards, transaction journals, blobs, and lock descendants are re-canonicalized before access. A symlink or junction observed in artifact/journal enumeration is rejected.
|
|
22
|
-
-
|
|
22
|
+
- Each write-enabled policy requires an absolute `serverStateRoot` whose existing components are non-linked
|
|
23
23
|
and whose canonical target does not overlap any source, registration capability,
|
|
24
24
|
generated-storage root, or runtime-nominated root. Harmless native path-spelling aliases are
|
|
25
25
|
normalized only after the link check. Its random journal key and protected revision heads are
|
|
@@ -40,7 +40,13 @@ concurrent mutation.
|
|
|
40
40
|
|
|
41
41
|
## Write controls
|
|
42
42
|
|
|
43
|
-
Read-only is the default.
|
|
43
|
+
Read-only is the default. The recommended `"autonomous"` policy exposes only `hoi4.focus_rewrite`, `hoi4.gui_rewrite`, and `hoi4.map_rewrite` for source mutation. Each call computes the complete affected-file set, validates proposed bytes, persists an authenticated journal and exact before-bytes, rechecks the unexpired principal/workspace binding and source hashes under a workspace lock, applies, rebuilds the index, and post-validates. Invalid proposals do not apply; an application, final-hash, or post-validation failure restores original bytes automatically.
|
|
44
|
+
|
|
45
|
+
The optional `"transactions"` compatibility policy exposes the older plan/diff/apply/status/rollback tool sequence. It uses the same core journal and failure-recovery path. Autonomous mode intentionally does not register the transaction tools, so it has no client-callable bypass around the one-call rewrite contract.
|
|
46
|
+
|
|
47
|
+
The autonomous rewrite tools advertise `destructiveHint: true` because a successful call changes mod source. That hint is truthful risk metadata, not a server request to suppress or force a dialog. A client host may prompt for or block the call; the server cannot override it. There is no command-execution field in either mode, and stale or cross-workspace writes fail closed.
|
|
48
|
+
|
|
49
|
+
Git remains the project-history and intentional-revert layer. It is not required for operational recovery: the journal and exact before-bytes prevent a failed multi-file rewrite from remaining partially applied.
|
|
44
50
|
|
|
45
51
|
Runtime registration definitions and raw paths are not persisted. The canonical artifact root does
|
|
46
52
|
retain an atomically created ownership claim containing only domain-separated SHA-256 workspace and
|
|
@@ -63,7 +69,7 @@ valid manifest. A cache-first crash may reconcile only an authenticated exact ne
|
|
|
63
69
|
missing head, revision gap, altered expiry/state/failure/rollback field, or recomputed public hash
|
|
64
70
|
fails closed. No HMAC key is derived from public workspace data.
|
|
65
71
|
|
|
66
|
-
Read-only
|
|
72
|
+
Read-only journal/resource operations never repair protected state. Cache-first successor promotion is
|
|
67
73
|
confined to startup recovery and authorized write paths. Artifact manifests are capped at 1 MiB and
|
|
68
74
|
transaction manifests at 16 MiB before parsing; transaction resource ranges use a bounded verified
|
|
69
75
|
byte cache instead of repeatedly rebuilding the authenticated object.
|
|
@@ -129,7 +135,7 @@ root ACL for the dedicated server account; the server still rejects a linked/non
|
|
|
129
135
|
inherits that operator ACL. A hostile operating-system principal that can read the key or replace
|
|
130
136
|
state-root entries remains outside the documented filesystem trust boundary.
|
|
131
137
|
|
|
132
|
-
Raw installed-game or dependency sprite, font, and bitmap files are never registered as downloadable resources. Structured JSON evidence strips embedded raster and glyph payloads, retaining only source-linked hashes, paths, frame and dimension metadata. Composite SVG/PNG reviews may contain processed frames or glyphs required to inspect the requested render, but remain generated, authorization-checked workspace evidence rather than raw asset-file resources.
|
|
138
|
+
Raw installed-game or dependency sprite, font, and bitmap files are never registered as downloadable resources. Structured JSON evidence strips embedded raster and glyph payloads, retaining only source-linked hashes, paths, frame and dimension metadata. Composite SVG/PNG reviews may contain processed frames or glyphs required to inspect the requested render, but remain generated, authorization-checked workspace evidence rather than raw asset-file resources. Rewrite and reviewed-transaction evidence may contain authorized mod-source before/proposed text and diffs; every artifact remains bound to the workspace principal.
|
|
133
139
|
|
|
134
140
|
The runtime sends no telemetry or analytics. Its only outbound network request is OAuth JWT-key retrieval from the administrator-configured JWKS endpoint; stdio and static-token loopback deployments require no runtime network access.
|
|
135
141
|
|
package/docs/self-hosting.md
CHANGED
|
@@ -51,7 +51,9 @@ Public mode—either a non-loopback listener or a non-loopback `publicUrl` in fr
|
|
|
51
51
|
}
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
The server is an OAuth resource server, not an authorization server. Protected Resource Metadata is served at the standard well-known paths and its endpoint-specific URL is included in 401 and insufficient-scope 403 challenges. Baseline access uses the configured `requiredScopes`;
|
|
54
|
+
The server is an OAuth resource server, not an authorization server. Protected Resource Metadata is served at the standard well-known paths and its endpoint-specific URL is included in 401 and insufficient-scope 403 challenges. Baseline access uses the configured `requiredScopes`; runtime registration and every source-mutation tool additionally require `hoi4:write`. In autonomous mode that means `hoi4.focus_rewrite`, `hoi4.gui_rewrite`, and `hoi4.map_rewrite`; in compatibility mode it includes planning, apply, and rollback. Each MCP session is bound to the exact bearer credential that initialized it, not only to mutable subject/client claims. A refreshed or step-up token must initialize a new MCP session; the previous session remains bound to its original credential and expires no later than that credential's `exp`. The server retains only a SHA-256 credential identifier, never the raw token. Static-token sessions keep the configured sliding inactivity lifetime. Terminate TLS at a trusted reverse proxy, preserve Authorization/Origin/Host headers, and do not make a session ID a bearer credential.
|
|
55
|
+
|
|
56
|
+
`hoi4:write` authorizes the server-side capability; it does not dictate the MCP host's user-interaction policy. Autonomous rewrite tools advertise `destructiveHint: true`, but MCP does not require a prompt for every such call. The server cannot override a host that prompts for or blocks it.
|
|
55
57
|
|
|
56
58
|
### Reverse-proxy boundary
|
|
57
59
|
|
|
@@ -110,7 +112,7 @@ releases the ordinary request-concurrency slot. Each session retains at most 1,0
|
|
|
110
112
|
`sessionTtlSeconds`. Old per-session history is evicted first. A new event that cannot fit the
|
|
111
113
|
shared budget is not retained for replay and does not evict another session's history.
|
|
112
114
|
|
|
113
|
-
Principal grants isolate tool, resource, session, and
|
|
115
|
+
Principal grants isolate tool, resource, session, and journal access within one deployment. Run separate least-privilege server instances or containers for mutually distrustful teams or operating-system trust domains; do not treat application-level grants as an OS sandbox.
|
|
114
116
|
|
|
115
117
|
Runtime registration has two operator capabilities. `registrationRoots` permits read-only source
|
|
116
118
|
selection. A caller-declared mod root additionally must be under the default-empty
|
|
@@ -121,14 +123,14 @@ these capability roots to that principal; prefer static registrations or separat
|
|
|
121
123
|
mutually distrustful users.
|
|
122
124
|
|
|
123
125
|
Runtime artifact storage must support same-volume hard links so the server can create persistent
|
|
124
|
-
owner claims without replacement races.
|
|
126
|
+
owner claims without replacement races. Every write-enabled deployment additionally requires an isolated,
|
|
125
127
|
persistent `serverStateRoot` on a filesystem with hard-link and atomic-replacement support. Do not
|
|
126
128
|
place it beneath any source, capability, artifact, cache, fixture, or `storageRoots` directory.
|
|
127
129
|
|
|
128
130
|
## Container
|
|
129
131
|
|
|
130
132
|
```bash
|
|
131
|
-
docker build -t hoi4-agent-tools:0.
|
|
133
|
+
docker build -t hoi4-agent-tools:0.2.0 .
|
|
132
134
|
docker run --read-only --rm -p 127.0.0.1:3210:3210 \
|
|
133
135
|
-e HOI4_AGENT_CONFIG=/config/config.json \
|
|
134
136
|
-v /srv/hoi4/config:/config:ro \
|
|
@@ -136,7 +138,7 @@ docker run --read-only --rm -p 127.0.0.1:3210:3210 \
|
|
|
136
138
|
-v /srv/hoi4/workspaces:/srv/hoi4/workspaces \
|
|
137
139
|
-v /var/lib/hoi4-agent-tools:/var/lib/hoi4-agent-tools \
|
|
138
140
|
-v /var/lib/hoi4-agent-tools-state:/var/lib/hoi4-agent-tools-state \
|
|
139
|
-
hoi4-agent-tools:0.
|
|
141
|
+
hoi4-agent-tools:0.2.0
|
|
140
142
|
```
|
|
141
143
|
|
|
142
144
|
Port publishing reaches the container through a non-loopback interface. The mounted configuration
|
|
@@ -146,7 +148,7 @@ Terminate TLS at the configured reverse proxy. Mapping the host port only to `12
|
|
|
146
148
|
exposure but does not turn the container-side listener into loopback, so it does not permit static
|
|
147
149
|
bearer tokens.
|
|
148
150
|
|
|
149
|
-
When writes are enabled, set `serverStateRoot` to `/var/lib/hoi4-agent-tools-state` in this example.
|
|
151
|
+
When writes are enabled in either autonomous or reviewed mode, set `serverStateRoot` to `/var/lib/hoi4-agent-tools-state` in this example.
|
|
150
152
|
Keep that mount persistent across restarts and protect it for the dedicated server account. It is a
|
|
151
153
|
separate mount because a state root may not overlap `/var/lib/hoi4-agent-tools` when that path is a
|
|
152
154
|
configured generated-storage capability.
|
package/docs/transactions.md
CHANGED
|
@@ -1,38 +1,55 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Autonomous rewrites, transactions, and recovery
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The recommended `"autonomous"` write policy exposes three source-mutation tools:
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- `hoi4.focus_rewrite`;
|
|
6
|
+
- `hoi4.gui_rewrite`;
|
|
7
|
+
- `hoi4.map_rewrite`.
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
mod root. Transaction calls cannot write the game, a dependency, a fixture, artifact storage,
|
|
9
|
-
cache storage, or the reserved `.hoi4-agent` subtree as mod source.
|
|
9
|
+
One rewrite call calculates every affected source and binary file, validates the proposed bytes in memory, persists an authenticated journal with exact recovery data, applies under the workspace lock, rebuilds the shared index, and post-validates the result. The caller does not receive or invoke separate transaction apply or rollback tools. Those tools are not registered in autonomous mode.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
`"transactions"` remains available as an optional compatibility policy. It exposes the older `hoi4.focus_plan_changes`, `hoi4.gui_plan_changes`, and `hoi4.map_plan` tools, followed by `hoi4.transaction_diff`, `hoi4.transaction_apply`, `hoi4.transaction_status`, and `hoi4.transaction_rollback`. Both modes use the same core transaction engine and safety properties; only the public MCP workflow differs.
|
|
12
|
+
|
|
13
|
+
## Autonomous rewrite pipeline
|
|
14
|
+
|
|
15
|
+
Every autonomous rewrite follows this sequence inside one MCP call:
|
|
16
|
+
|
|
17
|
+
1. resolve targets with write access confined to the canonical mod root;
|
|
18
|
+
2. calculate the complete affected-file set and exact proposed bytes;
|
|
19
|
+
3. run domain-specific in-memory validation and create source, binary, pixel, or rendered evidence as applicable;
|
|
20
|
+
4. persist the plan, before/after blobs, authentication tag, and protected revision head;
|
|
21
|
+
5. recheck principal, workspace, canonical roots, expiry, and every before-hash under the workspace lock;
|
|
22
|
+
6. stage and replace files in deterministic order;
|
|
23
|
+
7. rebuild the shared index, run domain post-write validation, and verify every final hash;
|
|
24
|
+
8. return `execution: "applied"`, changed-file samples, validation, and evidence links only after success.
|
|
25
|
+
|
|
26
|
+
A proposal whose pre-write checks fail returns blocked with `execution: "blocked"` and changes no source bytes. A request whose desired bytes already match every target returns `execution: "unchanged"` as a successful no-op. Any error after replacement begins starts exact restoration before failure is returned. Startup recovery also completes restoration for an interrupted journal before another write is accepted. Autonomous mode therefore removes the client-driven review/apply handshake without weakening validation or recoverability.
|
|
27
|
+
|
|
28
|
+
The rewrite tools truthfully advertise `readOnlyHint: false` and `destructiveHint: true`. MCP does not mandate a confirmation prompt for each tool call. A coding-agent host can still prompt for or block the call under its own policy, and the server cannot override that host decision.
|
|
29
|
+
|
|
30
|
+
Git remains the recommended source-history, collaboration, and intentional-revert system. Internal recovery serves a different purpose: exact before-bytes and the durable journal prevent a failed multi-file rewrite from leaving partial corruption, including outside a Git checkout.
|
|
31
|
+
|
|
32
|
+
Successful autonomous journals are internal recovery data, not user history. They are reclaimed automatically when journal retention reaches its configured count or byte limit; authenticated source-linked evidence remains in the artifact store. Reviewed compatibility mode retains applied journals so its explicit rollback operation remains available.
|
|
33
|
+
|
|
34
|
+
## Planning and evidence
|
|
35
|
+
|
|
36
|
+
Proposed bytes are validated in memory before any source replacement. Every target is restricted to the workspace's canonical mod root; rewrites cannot write the game, a dependency, a fixture, artifact storage, cache storage, or the reserved `.hoi4-agent` subtree as mod source.
|
|
37
|
+
|
|
38
|
+
The transaction core requires both validation phases: planning must return at least one explicit in-memory check, and apply must return at least one explicit post-write check. Missing or empty callbacks fail with `TRANSACTION_DRY_RUN_VALIDATION_REQUIRED` or `TRANSACTION_POST_VALIDATION_REQUIRED`; domain adapters cannot opt out. Diff artifacts are committed as one batch with the journal only after the planning validator returns structurally valid results. A rejected validator or journal admission leaves artifact inventory unchanged. A completed plan whose explicit checks fail remains evidence for the blocked rewrite and cannot be applied.
|
|
12
39
|
|
|
13
40
|
Text diffs use an exact deterministic algorithm with a fixed memory bound and cancellation checks. If an exact diff would exceed the bound, planning stops with `DIFF_COMPLEXITY_LIMIT`; the server does not substitute a truncated, approximate, or misleading diff.
|
|
14
41
|
|
|
15
|
-
|
|
42
|
+
Autonomous rewrite results keep bounded path samples and return the generated evidence resources directly; internal transaction identifiers and plan hashes are not caller inputs or success-result fields. Every applied autonomous rewrite links a sanitized execution-validation JSON resource containing the complete pre-write and post-write checks, source-linked diagnostics, final target hashes, and any overflow diagnostic resources without exposing the internal transaction ID or plan hash. Inline validation remains capped at five checks for wire efficiency. Reviewed compatibility mode additionally exposes the authenticated transaction-manifest resource.
|
|
16
43
|
|
|
17
|
-
|
|
18
|
-
- affected file list;
|
|
19
|
-
- source and visual diff resources;
|
|
20
|
-
- diagnostic locations and validation gates;
|
|
21
|
-
- expiry and plan hash.
|
|
44
|
+
In reviewed compatibility mode, `hoi4.transaction_diff` returns at most 20 files, operation summaries, and artifact links per page. Follow every `nextCursor` until absent before applying. Cursors are bound to the immutable plan hash and fail if reused for a different transaction. A transaction ID is a journal identifier, not approval.
|
|
22
45
|
|
|
23
|
-
|
|
24
|
-
manifest resource. Review artifacts remain listed in that manifest rather than being duplicated as
|
|
25
|
-
hundreds of inline resource links. `hoi4.transaction_diff` returns at most 20 files, operation
|
|
26
|
-
summaries, and artifact links per page; follow every `nextCursor` until it is absent. Cursors are
|
|
27
|
-
bound to the immutable plan hash and fail if reused for a different transaction. Inline validation
|
|
28
|
-
contains at most five checks with an explicit truncation diagnostic; the manifest is the complete
|
|
29
|
-
validation record.
|
|
46
|
+
Focus rewrites include both the edited Clausewitz source and its adjacent `.focus-plan.json` design sidecar in one recoverable operation. The manifest retains the proposed generated-source map and sidecar artifacts after success or restoration so each generated focus range remains traceable to its planning/source node.
|
|
30
47
|
|
|
31
|
-
|
|
48
|
+
Complete focus proposal validation is a linked JSON resource. If proposed or post-write diagnostics exceed the fixed manifest allowance, validation still evaluates the complete set, stores it as a source-linked MCP resource, and retains a blocker-first bounded manifest summary. The plan phase reserves diagnostic capacity for the independent post-write phase, so a warning-heavy large tree does not weaken limits or prevent a valid rewrite.
|
|
32
49
|
|
|
33
|
-
## Apply
|
|
50
|
+
## Apply pipeline and protected state
|
|
34
51
|
|
|
35
|
-
|
|
52
|
+
Autonomous tools pass their internal transaction ID and exact 64-character plan hash directly to the core apply path. In compatibility mode, the caller supplies the same values to `hoi4.transaction_apply`. The server rejects a different principal/workspace, changed roots, failed pre-write validation, expiry, reused state, or any changed before-hash.
|
|
36
53
|
|
|
37
54
|
The persisted immutable plan payload is recomputed against `planHash` whenever a manifest is
|
|
38
55
|
loaded. A recomputable integrity hash remains useful for deterministic diagnostics, but is never an
|
|
@@ -49,8 +66,7 @@ reconcile only an HMAC-valid exact `+1` successor. Missing heads, gaps, conflict
|
|
|
49
66
|
and forged successors fail closed. Successor creation is durable before older revision-head files
|
|
50
67
|
are removed, so an old-head cleanup failure does not break loading.
|
|
51
68
|
|
|
52
|
-
Ordinary
|
|
53
|
-
never promote state. An authenticated cache-first exact successor reports
|
|
69
|
+
Ordinary manifest-resource reads, and status/diff reads when compatibility mode exposes them, are pure: they accept only an exact protected head and never promote state. An authenticated cache-first exact successor reports
|
|
54
70
|
`TRANSACTION_HEAD_RECONCILIATION_REQUIRED` until startup recovery or an authorized write path
|
|
55
71
|
performs the narrowly allowed reconciliation.
|
|
56
72
|
|
|
@@ -135,9 +151,11 @@ check rejects a plan, the artifact store removes only content and provenance fil
|
|
|
135
151
|
attempt; artifact inventory is unchanged and any identical artifact retained by another operation
|
|
136
152
|
remains addressable.
|
|
137
153
|
|
|
138
|
-
## Explicit rollback
|
|
154
|
+
## Explicit rollback in compatibility mode
|
|
155
|
+
|
|
156
|
+
`hoi4.transaction_rollback` is available only in reviewed `"transactions"` mode after successful apply. It first verifies that every current file still has the transaction's after-hash. An external edit makes rollback stale, protecting later work from being overwritten.
|
|
139
157
|
|
|
140
|
-
|
|
158
|
+
Autonomous mode does not expose an explicit rollback tool. Failed application and post-validation restore automatically; an intentional later reversal belongs in Git or a new explicit domain rewrite.
|
|
141
159
|
|
|
142
160
|
Rollback accepts cancellation through its path/hash verification preflight. Once byte restoration
|
|
143
161
|
starts, restore plus authenticated journal advancement is deliberately non-cancellable so a client
|
package/docs/troubleshooting.md
CHANGED
|
@@ -8,18 +8,26 @@ Set `HOI4_AGENT_CONFIG` to an absolute path or add `--config PATH` to the server
|
|
|
8
8
|
|
|
9
9
|
Use a registered workspace-relative path. Confirm the canonical root is beneath `registrationRoots`; runtime mods also require the separate `writableRegistrationRoots` capability. Check for junctions/symlinks, parent segments, device names, trailing dots/spaces, or alternate data streams. Game and dependencies are intentionally read-only.
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Rewrite reports stale
|
|
12
12
|
|
|
13
|
-
The source changed after planning
|
|
13
|
+
The source changed after planning or before the workspace lock completed its recheck. Scan again and submit a new rewrite so evidence matches current files. In reviewed compatibility mode, do not reuse the stale transaction.
|
|
14
|
+
|
|
15
|
+
## Rewrite or transaction tools are missing
|
|
16
|
+
|
|
17
|
+
Check `writePolicy` in `hoi4.project_status`. `"read-only"` authorizes no source mutation, even if compatibility-named planning or transaction tools are listed by the client. `"autonomous"` exposes `hoi4.focus_rewrite`, `hoi4.gui_rewrite`, and `hoi4.map_rewrite` and intentionally hides all transaction tools. `"transactions"` enables the older plan/diff/apply/status/rollback surface instead. Restart the server and initialize a new MCP session after changing configuration.
|
|
14
18
|
|
|
15
19
|
## Transaction state rejected
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
source or generated-storage capability. Run setup with `--
|
|
21
|
+
Each write-enabled policy requires an absolute, persistent `serverStateRoot` that does not overlap any
|
|
22
|
+
source or generated-storage capability. Run setup with `--autonomous-writes --server-state ROOT` for autonomous rewrites, or `--reviewed-writes --server-state ROOT` for compatibility mode, then
|
|
19
23
|
run `--diagnose`. Preserve the same private state root across restarts. A missing key, malformed or
|
|
20
24
|
replayed head, unauthenticated legacy manifest, or cache/head revision conflict fails closed; review
|
|
21
25
|
and archive the affected journal/state evidence instead of regenerating a public hash or tag.
|
|
22
26
|
|
|
27
|
+
## The MCP host still asks for approval
|
|
28
|
+
|
|
29
|
+
The autonomous rewrite tools advertise `destructiveHint: true`. MCP does not require or forbid a prompt; the coding-agent host controls its own approval and filesystem policy, and the server cannot override it. Change the host policy only if that matches your local security requirements.
|
|
30
|
+
|
|
23
31
|
## Runtime registration conflicts after restart
|
|
24
32
|
|
|
25
33
|
The artifact root already has a hash-only runtime owner claim. Register the exact canonical
|
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": "0.
|
|
5
|
-
"description": "Source-preserving HOI4 workbench
|
|
4
|
+
"version": "0.2.0",
|
|
5
|
+
"description": "Source-preserving HOI4 workbench with workspace-authorized autonomous rewrites for coding agents",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"author": "HOI4 Agent Tools contributors",
|
|
@@ -18,7 +18,11 @@
|
|
|
18
18
|
"hearts-of-iron-iv",
|
|
19
19
|
"hoi4",
|
|
20
20
|
"modding",
|
|
21
|
-
"coding-agents"
|
|
21
|
+
"coding-agents",
|
|
22
|
+
"clausewitz",
|
|
23
|
+
"focus-trees",
|
|
24
|
+
"scripted-gui",
|
|
25
|
+
"hoi4-map"
|
|
22
26
|
],
|
|
23
27
|
"engines": {
|
|
24
28
|
"node": "^22.0.0 || ^24.0.0"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v0.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v0.2.0/schemas/configuration.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
@@ -69,7 +69,8 @@
|
|
|
69
69
|
"type": "string",
|
|
70
70
|
"enum": [
|
|
71
71
|
"read-only",
|
|
72
|
-
"transactions"
|
|
72
|
+
"transactions",
|
|
73
|
+
"autonomous"
|
|
73
74
|
]
|
|
74
75
|
},
|
|
75
76
|
"__schema2": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v0.
|
|
2
|
+
"$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v0.2.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": {
|