hoi4-agent-tools 0.2.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -118
- package/README.md +38 -124
- package/SECURITY.md +5 -7
- package/dist/bin/http.js +0 -1
- package/dist/bin/setup.js +141 -92
- package/dist/bin/stdio.js +0 -1
- package/dist/hoi4_agent_tools/core/artifacts.js +0 -1
- package/dist/hoi4_agent_tools/core/canonical.js +0 -1
- package/dist/hoi4_agent_tools/core/configuration.js +28 -28
- package/dist/hoi4_agent_tools/core/diagnostic-collector.js +0 -1
- package/dist/hoi4_agent_tools/core/diagnostics.js +0 -1
- package/dist/hoi4_agent_tools/core/diff.js +0 -1
- package/dist/hoi4_agent_tools/core/engine.js +6 -21
- package/dist/hoi4_agent_tools/core/image-diff.js +0 -1
- package/dist/hoi4_agent_tools/core/index.js +0 -1
- package/dist/hoi4_agent_tools/core/render-budget.js +0 -1
- package/dist/hoi4_agent_tools/core/result.js +0 -1
- package/dist/hoi4_agent_tools/core/scanner.js +0 -1
- package/dist/hoi4_agent_tools/core/server-state.js +0 -1
- package/dist/hoi4_agent_tools/core/source/encoding.js +0 -1
- package/dist/hoi4_agent_tools/core/source/index.js +0 -1
- package/dist/hoi4_agent_tools/core/source/lexer.js +0 -1
- package/dist/hoi4_agent_tools/core/source/limits.js +0 -1
- package/dist/hoi4_agent_tools/core/source/localisation.js +0 -1
- package/dist/hoi4_agent_tools/core/source/parser.js +0 -1
- package/dist/hoi4_agent_tools/core/source/rewrite.js +0 -1
- package/dist/hoi4_agent_tools/core/svg-text.js +0 -1
- package/dist/hoi4_agent_tools/core/transaction-limits.js +0 -1
- package/dist/hoi4_agent_tools/core/transactions.js +2 -30
- package/dist/hoi4_agent_tools/core/workspace.js +112 -396
- package/dist/hoi4_agent_tools/focus/compact.js +432 -0
- package/dist/hoi4_agent_tools/focus/compiler.js +1 -8
- package/dist/hoi4_agent_tools/focus/continuous-render.js +0 -1
- package/dist/hoi4_agent_tools/focus/drift.js +0 -1
- package/dist/hoi4_agent_tools/focus/geometry.js +203 -17
- package/dist/hoi4_agent_tools/focus/importer.js +0 -1
- package/dist/hoi4_agent_tools/focus/index.js +1 -1
- package/dist/hoi4_agent_tools/focus/layout.js +1256 -93
- package/dist/hoi4_agent_tools/focus/limits.js +1 -2
- package/dist/hoi4_agent_tools/focus/lint.js +11 -4
- package/dist/hoi4_agent_tools/focus/model.js +0 -1
- package/dist/hoi4_agent_tools/focus/native-effects.js +0 -1
- package/dist/hoi4_agent_tools/focus/planning.js +6 -2
- package/dist/hoi4_agent_tools/focus/presentation.js +0 -1
- package/dist/hoi4_agent_tools/focus/render.js +14 -10
- package/dist/hoi4_agent_tools/focus/service.js +7 -8
- package/dist/hoi4_agent_tools/focus/source-update.js +1 -2
- package/dist/hoi4_agent_tools/gui/animation-manifest.js +0 -1
- package/dist/hoi4_agent_tools/gui/assets.js +0 -1
- package/dist/hoi4_agent_tools/gui/dds.js +0 -1
- package/dist/hoi4_agent_tools/gui/helpers.js +1 -2
- package/dist/hoi4_agent_tools/gui/index.js +0 -1
- package/dist/hoi4_agent_tools/gui/layout.js +0 -1
- package/dist/hoi4_agent_tools/gui/limits.js +0 -1
- package/dist/hoi4_agent_tools/gui/renderer.js +0 -1
- package/dist/hoi4_agent_tools/gui/scenario.js +0 -1
- package/dist/hoi4_agent_tools/gui/source-graph.js +0 -1
- package/dist/hoi4_agent_tools/gui/source-patch.js +1 -2
- package/dist/hoi4_agent_tools/gui/studio.js +247 -104
- package/dist/hoi4_agent_tools/gui/tga.js +0 -1
- package/dist/hoi4_agent_tools/gui/types.js +0 -1
- package/dist/hoi4_agent_tools/gui/validators.js +0 -1
- package/dist/hoi4_agent_tools/map/bmp.js +0 -1
- package/dist/hoi4_agent_tools/map/diagnostic-limit.js +0 -1
- package/dist/hoi4_agent_tools/map/index.js +0 -1
- package/dist/hoi4_agent_tools/map/limits.js +2 -1
- package/dist/hoi4_agent_tools/map/model.js +0 -1
- package/dist/hoi4_agent_tools/map/operations.js +0 -1
- package/dist/hoi4_agent_tools/map/render.js +0 -1
- package/dist/hoi4_agent_tools/map/service.js +171 -33
- package/dist/hoi4_agent_tools/map/validation.js +0 -1
- package/dist/hoi4_agent_tools/mcp/resources/register.js +61 -187
- package/dist/hoi4_agent_tools/mcp/security/auth.js +1 -2
- package/dist/hoi4_agent_tools/mcp/server/base-tools.js +24 -750
- package/dist/hoi4_agent_tools/mcp/server/context-schemas.js +8 -0
- package/dist/hoi4_agent_tools/mcp/server/create.js +2 -12
- package/dist/hoi4_agent_tools/mcp/server/output-schemas.js +0 -71
- package/dist/hoi4_agent_tools/mcp/server/progress.js +0 -1
- package/dist/hoi4_agent_tools/mcp/server/result.js +146 -81
- package/dist/hoi4_agent_tools/mcp/server/transaction-execution.js +10 -14
- package/dist/hoi4_agent_tools/mcp/tools/focus.js +309 -279
- package/dist/hoi4_agent_tools/mcp/tools/gui.js +156 -254
- package/dist/hoi4_agent_tools/mcp/tools/map.js +259 -338
- package/dist/hoi4_agent_tools/mcp/tools/mods.js +54 -0
- package/dist/hoi4_agent_tools/mcp/transports/bounded-stdio.js +0 -1
- package/dist/hoi4_agent_tools/mcp/transports/event-store.js +0 -1
- package/dist/hoi4_agent_tools/mcp/transports/http.js +1 -12
- package/dist/hoi4_agent_tools/mcp/transports/protocol-gate.js +0 -1
- package/dist/hoi4_agent_tools/runtime.js +5 -2
- package/dist/hoi4_agent_tools/schemas/common.js +1 -2
- package/dist/hoi4_agent_tools/schemas/focus.js +64 -9
- package/dist/hoi4_agent_tools/schemas/map.js +0 -1
- package/dist/hoi4_agent_tools/schemas/transaction.js +0 -1
- package/dist/hoi4_agent_tools/version.js +1 -2
- package/docs/README.md +8 -21
- package/docs/development.md +22 -0
- package/docs/focus.md +50 -0
- package/docs/gui.md +37 -0
- package/docs/http.md +53 -0
- package/docs/map.md +39 -0
- package/docs/setup.md +39 -0
- package/package.json +12 -13
- package/server.json +3 -12
- package/dist/bin/http.d.ts +0 -3
- package/dist/bin/http.d.ts.map +0 -1
- package/dist/bin/http.js.map +0 -1
- package/dist/bin/setup.d.ts +0 -3
- package/dist/bin/setup.d.ts.map +0 -1
- package/dist/bin/setup.js.map +0 -1
- package/dist/bin/stdio.d.ts +0 -3
- package/dist/bin/stdio.d.ts.map +0 -1
- package/dist/bin/stdio.js.map +0 -1
- package/dist/hoi4_agent_tools/core/artifacts.d.ts +0 -117
- package/dist/hoi4_agent_tools/core/artifacts.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/core/artifacts.js.map +0 -1
- package/dist/hoi4_agent_tools/core/canonical.d.ts +0 -13
- package/dist/hoi4_agent_tools/core/canonical.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/core/canonical.js.map +0 -1
- package/dist/hoi4_agent_tools/core/configuration.d.ts +0 -138
- package/dist/hoi4_agent_tools/core/configuration.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/core/configuration.js.map +0 -1
- package/dist/hoi4_agent_tools/core/diagnostic-collector.d.ts +0 -18
- package/dist/hoi4_agent_tools/core/diagnostic-collector.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/core/diagnostic-collector.js.map +0 -1
- package/dist/hoi4_agent_tools/core/diagnostics.d.ts +0 -26
- package/dist/hoi4_agent_tools/core/diagnostics.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/core/diagnostics.js.map +0 -1
- package/dist/hoi4_agent_tools/core/diff.d.ts +0 -22
- package/dist/hoi4_agent_tools/core/diff.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/core/diff.js.map +0 -1
- package/dist/hoi4_agent_tools/core/engine.d.ts +0 -57
- package/dist/hoi4_agent_tools/core/engine.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/core/engine.js.map +0 -1
- package/dist/hoi4_agent_tools/core/image-diff.d.ts +0 -14
- package/dist/hoi4_agent_tools/core/image-diff.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/core/image-diff.js.map +0 -1
- package/dist/hoi4_agent_tools/core/index.d.ts +0 -64
- package/dist/hoi4_agent_tools/core/index.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/core/index.js.map +0 -1
- package/dist/hoi4_agent_tools/core/index.public.d.ts +0 -16
- package/dist/hoi4_agent_tools/core/index.public.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/core/index.public.js +0 -16
- package/dist/hoi4_agent_tools/core/index.public.js.map +0 -1
- package/dist/hoi4_agent_tools/core/render-budget.d.ts +0 -51
- package/dist/hoi4_agent_tools/core/render-budget.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/core/render-budget.js.map +0 -1
- package/dist/hoi4_agent_tools/core/result.d.ts +0 -45
- package/dist/hoi4_agent_tools/core/result.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/core/result.js.map +0 -1
- package/dist/hoi4_agent_tools/core/scanner.d.ts +0 -28
- package/dist/hoi4_agent_tools/core/scanner.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/core/scanner.js.map +0 -1
- package/dist/hoi4_agent_tools/core/server-state.d.ts +0 -31
- package/dist/hoi4_agent_tools/core/server-state.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/core/server-state.js.map +0 -1
- package/dist/hoi4_agent_tools/core/source/encoding.d.ts +0 -10
- package/dist/hoi4_agent_tools/core/source/encoding.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/core/source/encoding.js.map +0 -1
- package/dist/hoi4_agent_tools/core/source/index.d.ts +0 -7
- package/dist/hoi4_agent_tools/core/source/index.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/core/source/index.js.map +0 -1
- package/dist/hoi4_agent_tools/core/source/lexer.d.ts +0 -30
- package/dist/hoi4_agent_tools/core/source/lexer.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/core/source/lexer.js.map +0 -1
- package/dist/hoi4_agent_tools/core/source/limits.d.ts +0 -21
- package/dist/hoi4_agent_tools/core/source/limits.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/core/source/limits.js.map +0 -1
- package/dist/hoi4_agent_tools/core/source/localisation.d.ts +0 -20
- package/dist/hoi4_agent_tools/core/source/localisation.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/core/source/localisation.js.map +0 -1
- package/dist/hoi4_agent_tools/core/source/parser.d.ts +0 -44
- package/dist/hoi4_agent_tools/core/source/parser.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/core/source/parser.js.map +0 -1
- package/dist/hoi4_agent_tools/core/source/rewrite.d.ts +0 -10
- package/dist/hoi4_agent_tools/core/source/rewrite.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/core/source/rewrite.js.map +0 -1
- package/dist/hoi4_agent_tools/core/svg-text.d.ts +0 -34
- package/dist/hoi4_agent_tools/core/svg-text.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/core/svg-text.js.map +0 -1
- package/dist/hoi4_agent_tools/core/transaction-limits.d.ts +0 -9
- package/dist/hoi4_agent_tools/core/transaction-limits.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/core/transaction-limits.js.map +0 -1
- package/dist/hoi4_agent_tools/core/transactions.d.ts +0 -164
- package/dist/hoi4_agent_tools/core/transactions.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/core/transactions.js.map +0 -1
- package/dist/hoi4_agent_tools/core/workspace.d.ts +0 -68
- package/dist/hoi4_agent_tools/core/workspace.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/core/workspace.js.map +0 -1
- package/dist/hoi4_agent_tools/focus/compiler.d.ts +0 -10
- package/dist/hoi4_agent_tools/focus/compiler.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/focus/compiler.js.map +0 -1
- package/dist/hoi4_agent_tools/focus/continuous-render.d.ts +0 -32
- package/dist/hoi4_agent_tools/focus/continuous-render.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/focus/continuous-render.js.map +0 -1
- package/dist/hoi4_agent_tools/focus/drift.d.ts +0 -22
- package/dist/hoi4_agent_tools/focus/drift.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/focus/drift.js.map +0 -1
- package/dist/hoi4_agent_tools/focus/geometry.d.ts +0 -17
- package/dist/hoi4_agent_tools/focus/geometry.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/focus/geometry.js.map +0 -1
- package/dist/hoi4_agent_tools/focus/importer.d.ts +0 -9
- package/dist/hoi4_agent_tools/focus/importer.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/focus/importer.js.map +0 -1
- package/dist/hoi4_agent_tools/focus/index.d.ts +0 -14
- package/dist/hoi4_agent_tools/focus/index.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/focus/index.js.map +0 -1
- package/dist/hoi4_agent_tools/focus/layout.d.ts +0 -5
- package/dist/hoi4_agent_tools/focus/layout.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/focus/layout.js.map +0 -1
- package/dist/hoi4_agent_tools/focus/limits.d.ts +0 -9
- package/dist/hoi4_agent_tools/focus/limits.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/focus/limits.js.map +0 -1
- package/dist/hoi4_agent_tools/focus/lint.d.ts +0 -14
- package/dist/hoi4_agent_tools/focus/lint.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/focus/lint.js.map +0 -1
- package/dist/hoi4_agent_tools/focus/model.d.ts +0 -307
- package/dist/hoi4_agent_tools/focus/model.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/focus/model.js.map +0 -1
- package/dist/hoi4_agent_tools/focus/native-effects.d.ts +0 -9
- package/dist/hoi4_agent_tools/focus/native-effects.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/focus/native-effects.js.map +0 -1
- package/dist/hoi4_agent_tools/focus/planning.d.ts +0 -15
- package/dist/hoi4_agent_tools/focus/planning.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/focus/planning.js.map +0 -1
- package/dist/hoi4_agent_tools/focus/presentation.d.ts +0 -24
- package/dist/hoi4_agent_tools/focus/presentation.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/focus/presentation.js.map +0 -1
- package/dist/hoi4_agent_tools/focus/render.d.ts +0 -39
- package/dist/hoi4_agent_tools/focus/render.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/focus/render.js.map +0 -1
- package/dist/hoi4_agent_tools/focus/service.d.ts +0 -82
- package/dist/hoi4_agent_tools/focus/service.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/focus/service.js.map +0 -1
- package/dist/hoi4_agent_tools/focus/source-update.d.ts +0 -6
- package/dist/hoi4_agent_tools/focus/source-update.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/focus/source-update.js.map +0 -1
- package/dist/hoi4_agent_tools/gui/animation-manifest.d.ts +0 -37
- package/dist/hoi4_agent_tools/gui/animation-manifest.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/gui/animation-manifest.js.map +0 -1
- package/dist/hoi4_agent_tools/gui/assets.d.ts +0 -71
- package/dist/hoi4_agent_tools/gui/assets.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/gui/assets.js.map +0 -1
- package/dist/hoi4_agent_tools/gui/dds.d.ts +0 -17
- package/dist/hoi4_agent_tools/gui/dds.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/gui/dds.js.map +0 -1
- package/dist/hoi4_agent_tools/gui/helpers.d.ts +0 -101
- package/dist/hoi4_agent_tools/gui/helpers.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/gui/helpers.js.map +0 -1
- package/dist/hoi4_agent_tools/gui/index.d.ts +0 -15
- package/dist/hoi4_agent_tools/gui/index.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/gui/index.js.map +0 -1
- package/dist/hoi4_agent_tools/gui/layout.d.ts +0 -6
- package/dist/hoi4_agent_tools/gui/layout.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/gui/layout.js.map +0 -1
- package/dist/hoi4_agent_tools/gui/limits.d.ts +0 -25
- package/dist/hoi4_agent_tools/gui/limits.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/gui/limits.js.map +0 -1
- package/dist/hoi4_agent_tools/gui/renderer.d.ts +0 -18
- package/dist/hoi4_agent_tools/gui/renderer.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/gui/renderer.js.map +0 -1
- package/dist/hoi4_agent_tools/gui/scenario.d.ts +0 -66
- package/dist/hoi4_agent_tools/gui/scenario.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/gui/scenario.js.map +0 -1
- package/dist/hoi4_agent_tools/gui/source-graph.d.ts +0 -7
- package/dist/hoi4_agent_tools/gui/source-graph.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/gui/source-graph.js.map +0 -1
- package/dist/hoi4_agent_tools/gui/source-patch.d.ts +0 -13
- package/dist/hoi4_agent_tools/gui/source-patch.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/gui/source-patch.js.map +0 -1
- package/dist/hoi4_agent_tools/gui/studio.d.ts +0 -86
- package/dist/hoi4_agent_tools/gui/studio.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/gui/studio.js.map +0 -1
- package/dist/hoi4_agent_tools/gui/tga.d.ts +0 -16
- package/dist/hoi4_agent_tools/gui/tga.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/gui/tga.js.map +0 -1
- package/dist/hoi4_agent_tools/gui/types.d.ts +0 -322
- package/dist/hoi4_agent_tools/gui/types.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/gui/types.js.map +0 -1
- package/dist/hoi4_agent_tools/gui/validators.d.ts +0 -8
- package/dist/hoi4_agent_tools/gui/validators.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/gui/validators.js.map +0 -1
- package/dist/hoi4_agent_tools/map/bmp.d.ts +0 -62
- package/dist/hoi4_agent_tools/map/bmp.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/map/bmp.js.map +0 -1
- package/dist/hoi4_agent_tools/map/diagnostic-limit.d.ts +0 -5
- package/dist/hoi4_agent_tools/map/diagnostic-limit.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/map/diagnostic-limit.js.map +0 -1
- package/dist/hoi4_agent_tools/map/index.d.ts +0 -8
- package/dist/hoi4_agent_tools/map/index.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/map/index.js.map +0 -1
- package/dist/hoi4_agent_tools/map/limits.d.ts +0 -13
- package/dist/hoi4_agent_tools/map/limits.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/map/limits.js.map +0 -1
- package/dist/hoi4_agent_tools/map/model.d.ts +0 -269
- package/dist/hoi4_agent_tools/map/model.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/map/model.js.map +0 -1
- package/dist/hoi4_agent_tools/map/operations.d.ts +0 -401
- package/dist/hoi4_agent_tools/map/operations.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/map/operations.js.map +0 -1
- package/dist/hoi4_agent_tools/map/render.d.ts +0 -90
- package/dist/hoi4_agent_tools/map/render.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/map/render.js.map +0 -1
- package/dist/hoi4_agent_tools/map/service.d.ts +0 -81
- package/dist/hoi4_agent_tools/map/service.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/map/service.js.map +0 -1
- package/dist/hoi4_agent_tools/map/validation.d.ts +0 -23
- package/dist/hoi4_agent_tools/map/validation.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/map/validation.js.map +0 -1
- package/dist/hoi4_agent_tools/mcp/prompts/register.d.ts +0 -4
- package/dist/hoi4_agent_tools/mcp/prompts/register.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/mcp/prompts/register.js +0 -72
- package/dist/hoi4_agent_tools/mcp/prompts/register.js.map +0 -1
- package/dist/hoi4_agent_tools/mcp/registry/metadata.d.ts +0 -9
- package/dist/hoi4_agent_tools/mcp/registry/metadata.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/mcp/registry/metadata.js +0 -10
- package/dist/hoi4_agent_tools/mcp/registry/metadata.js.map +0 -1
- package/dist/hoi4_agent_tools/mcp/resources/register.d.ts +0 -5
- package/dist/hoi4_agent_tools/mcp/resources/register.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/mcp/resources/register.js.map +0 -1
- package/dist/hoi4_agent_tools/mcp/security/auth.d.ts +0 -24
- package/dist/hoi4_agent_tools/mcp/security/auth.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/mcp/security/auth.js.map +0 -1
- package/dist/hoi4_agent_tools/mcp/server/base-tools.d.ts +0 -47
- package/dist/hoi4_agent_tools/mcp/server/base-tools.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/mcp/server/base-tools.js.map +0 -1
- package/dist/hoi4_agent_tools/mcp/server/create.d.ts +0 -5
- package/dist/hoi4_agent_tools/mcp/server/create.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/mcp/server/create.js.map +0 -1
- package/dist/hoi4_agent_tools/mcp/server/output-schemas.d.ts +0 -138
- package/dist/hoi4_agent_tools/mcp/server/output-schemas.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/mcp/server/output-schemas.js.map +0 -1
- package/dist/hoi4_agent_tools/mcp/server/progress.d.ts +0 -8
- package/dist/hoi4_agent_tools/mcp/server/progress.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/mcp/server/progress.js.map +0 -1
- package/dist/hoi4_agent_tools/mcp/server/result.d.ts +0 -232
- package/dist/hoi4_agent_tools/mcp/server/result.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/mcp/server/result.js.map +0 -1
- package/dist/hoi4_agent_tools/mcp/server/transaction-execution.d.ts +0 -31
- package/dist/hoi4_agent_tools/mcp/server/transaction-execution.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/mcp/server/transaction-execution.js.map +0 -1
- package/dist/hoi4_agent_tools/mcp/tools/focus.d.ts +0 -5
- package/dist/hoi4_agent_tools/mcp/tools/focus.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/mcp/tools/focus.js.map +0 -1
- package/dist/hoi4_agent_tools/mcp/tools/gui.d.ts +0 -117
- package/dist/hoi4_agent_tools/mcp/tools/gui.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/mcp/tools/gui.js.map +0 -1
- package/dist/hoi4_agent_tools/mcp/tools/map.d.ts +0 -5
- package/dist/hoi4_agent_tools/mcp/tools/map.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/mcp/tools/map.js.map +0 -1
- package/dist/hoi4_agent_tools/mcp/transports/bounded-stdio.d.ts +0 -58
- package/dist/hoi4_agent_tools/mcp/transports/bounded-stdio.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/mcp/transports/bounded-stdio.js.map +0 -1
- package/dist/hoi4_agent_tools/mcp/transports/event-store.d.ts +0 -26
- package/dist/hoi4_agent_tools/mcp/transports/event-store.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/mcp/transports/event-store.js.map +0 -1
- package/dist/hoi4_agent_tools/mcp/transports/http.d.ts +0 -28
- package/dist/hoi4_agent_tools/mcp/transports/http.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/mcp/transports/http.js.map +0 -1
- package/dist/hoi4_agent_tools/mcp/transports/protocol-gate.d.ts +0 -15
- package/dist/hoi4_agent_tools/mcp/transports/protocol-gate.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/mcp/transports/protocol-gate.js.map +0 -1
- package/dist/hoi4_agent_tools/runtime.d.ts +0 -4
- package/dist/hoi4_agent_tools/runtime.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/runtime.js.map +0 -1
- package/dist/hoi4_agent_tools/schemas/common.d.ts +0 -74
- package/dist/hoi4_agent_tools/schemas/common.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/schemas/common.js.map +0 -1
- package/dist/hoi4_agent_tools/schemas/focus.d.ts +0 -784
- package/dist/hoi4_agent_tools/schemas/focus.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/schemas/focus.js.map +0 -1
- package/dist/hoi4_agent_tools/schemas/index.d.ts +0 -5
- package/dist/hoi4_agent_tools/schemas/index.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/schemas/index.js +0 -5
- package/dist/hoi4_agent_tools/schemas/index.js.map +0 -1
- package/dist/hoi4_agent_tools/schemas/map.d.ts +0 -654
- package/dist/hoi4_agent_tools/schemas/map.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/schemas/map.js.map +0 -1
- package/dist/hoi4_agent_tools/schemas/transaction.d.ts +0 -259
- package/dist/hoi4_agent_tools/schemas/transaction.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/schemas/transaction.js.map +0 -1
- package/dist/hoi4_agent_tools/version.d.ts +0 -6
- package/dist/hoi4_agent_tools/version.d.ts.map +0 -1
- package/dist/hoi4_agent_tools/version.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +0 -1
- package/docs/adr/0001-runtime-and-language.md +0 -16
- package/docs/adr/0002-lossless-source-model.md +0 -18
- package/docs/adr/0003-image-and-font-codecs.md +0 -18
- package/docs/adr/0004-focus-layout.md +0 -16
- package/docs/adr/0005-offline-rendering.md +0 -18
- package/docs/adr/0006-mcp-sdk-and-protocol.md +0 -16
- package/docs/adr/0007-storage-and-transactions.md +0 -24
- package/docs/adr/0008-test-strategy.md +0 -18
- package/docs/adr/0009-packaging-and-registry.md +0 -16
- package/docs/adr/0010-unsupported-and-refusal-policy.md +0 -18
- package/docs/adr/0011-http-security.md +0 -16
- package/docs/adr/0012-autonomous-rewrites.md +0 -55
- package/docs/adr/README.md +0 -14
- package/docs/agent-integration.md +0 -146
- package/docs/architecture.md +0 -76
- package/docs/artifacts.md +0 -136
- package/docs/compatibility.md +0 -33
- package/docs/completion-report.md +0 -122
- package/docs/configuration.md +0 -305
- package/docs/focus-workflow.md +0 -197
- package/docs/gui-workflow.md +0 -125
- package/docs/limitations.md +0 -32
- package/docs/map-workflow.md +0 -95
- package/docs/performance.md +0 -117
- package/docs/release.md +0 -222
- package/docs/research/mcp-2026-07-10.md +0 -52
- package/docs/research/source-ledger.md +0 -68
- package/docs/security.md +0 -145
- package/docs/self-hosting.md +0 -170
- package/docs/testing.md +0 -43
- package/docs/third-party-notices.md +0 -11
- package/docs/transactions.md +0 -180
- package/docs/troubleshooting.md +0 -54
- package/schemas/configuration.schema.json +0 -795
- package/schemas/continuous-focus-palette.schema.json +0 -325
- package/schemas/focus-plan.schema.json +0 -927
- package/schemas/focus-planning-sidecar.schema.json +0 -379
- package/schemas/gui-animation-source.schema.json +0 -176
- package/schemas/gui-helper.schema.json +0 -301
- package/schemas/gui-scenario.schema.json +0 -298
- package/schemas/map-operation.schema.json +0 -2284
- package/schemas/operation-result.schema.json +0 -344
- package/schemas/transaction-manifest.schema.json +0 -685
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
import { compareCodeUnits } from '../../core/canonical.js';
|
|
3
|
+
import { emptyServiceResult } from '../../core/result.js';
|
|
4
|
+
import { nonNegativeIntegerSchema } from '../server/output-schemas.js';
|
|
5
|
+
import { errorResult, strictOperationResultSchema, toolResult } from '../server/result.js';
|
|
6
|
+
const modsOutputSchema = strictOperationResultSchema(z
|
|
7
|
+
.object({
|
|
8
|
+
count: nonNegativeIntegerSchema,
|
|
9
|
+
mods: z
|
|
10
|
+
.array(z
|
|
11
|
+
.object({
|
|
12
|
+
id: z.string().min(1).max(64),
|
|
13
|
+
name: z.string().min(1).max(256),
|
|
14
|
+
writable: z.boolean(),
|
|
15
|
+
})
|
|
16
|
+
.strict())
|
|
17
|
+
.max(1_000),
|
|
18
|
+
})
|
|
19
|
+
.strict());
|
|
20
|
+
export function registerModsTool(server, engine, context) {
|
|
21
|
+
server.registerTool('hoi4.mods', {
|
|
22
|
+
title: 'List available HOI4 mods',
|
|
23
|
+
description: 'List configured HOI4 mod workspaces, optionally selecting one by ID.',
|
|
24
|
+
inputSchema: z.object({ workspaceId: z.string().min(1).max(64).optional() }).strict(),
|
|
25
|
+
outputSchema: modsOutputSchema,
|
|
26
|
+
annotations: {
|
|
27
|
+
readOnlyHint: true,
|
|
28
|
+
destructiveHint: false,
|
|
29
|
+
idempotentHint: true,
|
|
30
|
+
openWorldHint: false,
|
|
31
|
+
},
|
|
32
|
+
}, ({ workspaceId }) => {
|
|
33
|
+
try {
|
|
34
|
+
const mods = (workspaceId === undefined
|
|
35
|
+
? engine.list(context.principal)
|
|
36
|
+
: [engine.status(workspaceId, context.principal)])
|
|
37
|
+
.filter(({ kind }) => kind === 'mod')
|
|
38
|
+
.sort((left, right) => compareCodeUnits(left.id, right.id));
|
|
39
|
+
const result = emptyServiceResult(workspaceId ?? '', {
|
|
40
|
+
count: mods.length,
|
|
41
|
+
mods: mods.map(({ id, name, writable }) => ({
|
|
42
|
+
id,
|
|
43
|
+
name,
|
|
44
|
+
writable,
|
|
45
|
+
})),
|
|
46
|
+
});
|
|
47
|
+
result.code = 'MODS_LISTED';
|
|
48
|
+
return toolResult(result);
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
return errorResult(error, workspaceId ?? '');
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
@@ -10,17 +10,7 @@ import { MCP_PROTOCOL_VERSION } from '../../version.js';
|
|
|
10
10
|
import { authenticate, bearerChallenge, HttpAuthError, protectedResourceMetadata, validateHttpDeployment, } from '../security/auth.js';
|
|
11
11
|
import { BoundedEventStore, SharedEventStoreBudget } from './event-store.js';
|
|
12
12
|
import { FinalProtocolTransport } from './protocol-gate.js';
|
|
13
|
-
const WRITE_SCOPED_TOOLS = new Set([
|
|
14
|
-
'hoi4.project_register',
|
|
15
|
-
'hoi4.focus_plan_changes',
|
|
16
|
-
'hoi4.focus_rewrite',
|
|
17
|
-
'hoi4.gui_plan_changes',
|
|
18
|
-
'hoi4.gui_rewrite',
|
|
19
|
-
'hoi4.map_plan',
|
|
20
|
-
'hoi4.map_rewrite',
|
|
21
|
-
'hoi4.transaction_apply',
|
|
22
|
-
'hoi4.transaction_rollback',
|
|
23
|
-
]);
|
|
13
|
+
const WRITE_SCOPED_TOOLS = new Set(['hoi4.focus_rewrite', 'hoi4.gui_rewrite', 'hoi4.map_rewrite']);
|
|
24
14
|
const MCP_ALLOWED_METHODS = 'GET, POST, DELETE';
|
|
25
15
|
const SINGLETON_SECURITY_HEADERS = new Set([
|
|
26
16
|
'authorization',
|
|
@@ -744,4 +734,3 @@ export async function startHttpServer(engine, configuration, serverFactory) {
|
|
|
744
734
|
},
|
|
745
735
|
};
|
|
746
736
|
}
|
|
747
|
-
//# sourceMappingURL=http.js.map
|
|
@@ -4,6 +4,10 @@ import { loadConfiguration } from './core/configuration.js';
|
|
|
4
4
|
import { CoreEngine } from './core/engine.js';
|
|
5
5
|
import { ServiceError } from './core/result.js';
|
|
6
6
|
import { WorkspaceResolver } from './core/workspace.js';
|
|
7
|
+
export function defaultConfigurationPath() {
|
|
8
|
+
const configRoot = process.env.APPDATA ?? process.env.XDG_CONFIG_HOME ?? path.join(homedir(), '.config');
|
|
9
|
+
return path.join(configRoot, 'hoi4-agent-tools', 'config.json');
|
|
10
|
+
}
|
|
7
11
|
export function configurationPath(arguments_ = process.argv.slice(2)) {
|
|
8
12
|
const index = arguments_.indexOf('--config');
|
|
9
13
|
if (index >= 0) {
|
|
@@ -15,7 +19,7 @@ export function configurationPath(arguments_ = process.argv.slice(2)) {
|
|
|
15
19
|
}
|
|
16
20
|
if (process.env.HOI4_AGENT_CONFIG !== undefined)
|
|
17
21
|
return path.resolve(process.env.HOI4_AGENT_CONFIG);
|
|
18
|
-
return
|
|
22
|
+
return defaultConfigurationPath();
|
|
19
23
|
}
|
|
20
24
|
export async function createEngine(configPath = configurationPath()) {
|
|
21
25
|
const configuration = await loadConfiguration(configPath);
|
|
@@ -24,4 +28,3 @@ export async function createEngine(configPath = configurationPath()) {
|
|
|
24
28
|
await engine.initialize();
|
|
25
29
|
return engine;
|
|
26
30
|
}
|
|
27
|
-
//# sourceMappingURL=runtime.js.map
|
|
@@ -37,7 +37,7 @@ export const diagnosticSchema = z
|
|
|
37
37
|
'design',
|
|
38
38
|
'rendering',
|
|
39
39
|
'security',
|
|
40
|
-
'
|
|
40
|
+
'validation',
|
|
41
41
|
'map',
|
|
42
42
|
'configuration',
|
|
43
43
|
]),
|
|
@@ -48,4 +48,3 @@ export const diagnosticSchema = z
|
|
|
48
48
|
details: z.record(z.string().max(256), z.unknown()).optional(),
|
|
49
49
|
})
|
|
50
50
|
.strict();
|
|
51
|
-
//# sourceMappingURL=common.js.map
|
|
@@ -32,6 +32,14 @@ const prerequisitesSchema = z
|
|
|
32
32
|
.max(10_000),
|
|
33
33
|
})
|
|
34
34
|
.strict();
|
|
35
|
+
const automaticPositionSchema = z
|
|
36
|
+
.object({
|
|
37
|
+
mode: z.literal('auto'),
|
|
38
|
+
pinned: z.literal(false),
|
|
39
|
+
preferredX: z.number().int().min(-100_000).max(100_000).optional(),
|
|
40
|
+
preferredY: z.number().int().min(-100_000).max(100_000).optional(),
|
|
41
|
+
})
|
|
42
|
+
.strict();
|
|
35
43
|
const positionSchema = z.discriminatedUnion('mode', [
|
|
36
44
|
z
|
|
37
45
|
.object({
|
|
@@ -50,14 +58,7 @@ const positionSchema = z.discriminatedUnion('mode', [
|
|
|
50
58
|
pinned: z.boolean(),
|
|
51
59
|
})
|
|
52
60
|
.strict(),
|
|
53
|
-
|
|
54
|
-
.object({
|
|
55
|
-
mode: z.literal('auto'),
|
|
56
|
-
pinned: z.literal(false),
|
|
57
|
-
preferredX: z.number().int().min(-100_000).max(100_000).optional(),
|
|
58
|
-
preferredY: z.number().int().min(-100_000).max(100_000).optional(),
|
|
59
|
-
})
|
|
60
|
-
.strict(),
|
|
61
|
+
automaticPositionSchema,
|
|
61
62
|
]);
|
|
62
63
|
const routeLockSchema = z
|
|
63
64
|
.object({
|
|
@@ -305,6 +306,7 @@ export const focusPlanningSidecarSchema = z
|
|
|
305
306
|
aiStrategyIds: z.array(z.string()),
|
|
306
307
|
payoff: z.string().optional(),
|
|
307
308
|
terminalKind: focusNodeSchema.shape.terminalKind,
|
|
309
|
+
autoPosition: automaticPositionSchema.optional(),
|
|
308
310
|
})
|
|
309
311
|
.strict()),
|
|
310
312
|
})
|
|
@@ -317,12 +319,65 @@ export const focusLayoutDecisionSchema = z
|
|
|
317
319
|
'relative',
|
|
318
320
|
'placed',
|
|
319
321
|
'moved_for_collision',
|
|
322
|
+
'moved_for_spacing',
|
|
320
323
|
'moved_for_mutual_exclusion',
|
|
324
|
+
'moved_for_parent_order',
|
|
325
|
+
'moved_for_lane_bounds',
|
|
321
326
|
'moved_to_reduce_crossings',
|
|
322
327
|
]),
|
|
323
328
|
message: z.string(),
|
|
324
329
|
})
|
|
325
330
|
.strict();
|
|
331
|
+
export const focusLayoutMetricsSchema = z
|
|
332
|
+
.object({
|
|
333
|
+
bounds: z
|
|
334
|
+
.object({
|
|
335
|
+
minimumX: z.number().int(),
|
|
336
|
+
maximumX: z.number().int(),
|
|
337
|
+
minimumY: z.number().int(),
|
|
338
|
+
maximumY: z.number().int(),
|
|
339
|
+
columnSpan: z.number().int().nonnegative(),
|
|
340
|
+
rowSpan: z.number().int().nonnegative(),
|
|
341
|
+
columnCount: z.number().int().nonnegative(),
|
|
342
|
+
rowCount: z.number().int().nonnegative(),
|
|
343
|
+
})
|
|
344
|
+
.strict(),
|
|
345
|
+
connectors: z
|
|
346
|
+
.object({
|
|
347
|
+
count: z.number().int().nonnegative(),
|
|
348
|
+
crossingCount: z.number().int().nonnegative(),
|
|
349
|
+
nodeIntersectionCount: z.number().int().nonnegative(),
|
|
350
|
+
longConnectorCount: z.number().int().nonnegative(),
|
|
351
|
+
totalHorizontalSpan: z.number().int().nonnegative(),
|
|
352
|
+
maximumHorizontalSpan: z.number().int().nonnegative(),
|
|
353
|
+
totalVerticalSpan: z.number().int().nonnegative(),
|
|
354
|
+
maximumVerticalSpan: z.number().int().nonnegative(),
|
|
355
|
+
totalManhattanSpan: z.number().int().nonnegative(),
|
|
356
|
+
maximumManhattanSpan: z.number().int().nonnegative(),
|
|
357
|
+
})
|
|
358
|
+
.strict(),
|
|
359
|
+
symmetry: z
|
|
360
|
+
.object({
|
|
361
|
+
siblingCohortCount: z.number().int().nonnegative(),
|
|
362
|
+
asymmetricSiblingCohortCount: z.number().int().nonnegative(),
|
|
363
|
+
totalSiblingDeviation: z.number().int().nonnegative(),
|
|
364
|
+
maximumSiblingDeviation: z.number().int().nonnegative(),
|
|
365
|
+
offAnchorSiblingCohortCount: z.number().int().nonnegative(),
|
|
366
|
+
totalSiblingAnchorDeviation: z.number().int().nonnegative(),
|
|
367
|
+
maximumSiblingAnchorDeviation: z.number().int().nonnegative(),
|
|
368
|
+
boundingCenterOffsetTwice: z.number().int().nonnegative(),
|
|
369
|
+
})
|
|
370
|
+
.strict(),
|
|
371
|
+
spacing: z
|
|
372
|
+
.object({
|
|
373
|
+
requiredSameRowSpacing: z.number().int().positive(),
|
|
374
|
+
sameRowPairCount: z.number().int().nonnegative(),
|
|
375
|
+
tooCloseSameRowPairCount: z.number().int().nonnegative(),
|
|
376
|
+
minimumSameRowSpacing: z.number().int().nonnegative(),
|
|
377
|
+
})
|
|
378
|
+
.strict(),
|
|
379
|
+
})
|
|
380
|
+
.strict();
|
|
326
381
|
export const focusLayoutSchema = z
|
|
327
382
|
.object({
|
|
328
383
|
treeId: z.string(),
|
|
@@ -338,7 +393,7 @@ export const focusLayoutSchema = z
|
|
|
338
393
|
.strict()),
|
|
339
394
|
decisions: z.array(focusLayoutDecisionSchema),
|
|
340
395
|
diagnostics: z.array(z.unknown()),
|
|
396
|
+
metrics: focusLayoutMetricsSchema.optional(),
|
|
341
397
|
layoutHash: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
342
398
|
})
|
|
343
399
|
.strict();
|
|
344
|
-
//# sourceMappingURL=focus.js.map
|
|
@@ -1,7 +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 = '
|
|
3
|
+
export const PACKAGE_VERSION = '1.1.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;
|
|
7
|
-
//# sourceMappingURL=version.js.map
|
package/docs/README.md
CHANGED
|
@@ -1,23 +1,10 @@
|
|
|
1
1
|
# Documentation
|
|
2
2
|
|
|
3
|
-
- [
|
|
4
|
-
- [
|
|
5
|
-
- [
|
|
6
|
-
- [
|
|
7
|
-
- [
|
|
8
|
-
- [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- [Agent Nudger map workflow](map-workflow.md)
|
|
12
|
-
- [Artifact resources](artifacts.md)
|
|
13
|
-
- [Self-hosted Streamable HTTP](self-hosting.md)
|
|
14
|
-
- [Testing, fixtures, and local integration](testing.md)
|
|
15
|
-
- [Performance benchmark](performance.md)
|
|
16
|
-
- [Compatibility and versioning](compatibility.md)
|
|
17
|
-
- [Known limitations](limitations.md)
|
|
18
|
-
- [Third-party notices](third-party-notices.md)
|
|
19
|
-
- [Troubleshooting](troubleshooting.md)
|
|
20
|
-
- [0.1.7 completion report](completion-report.md)
|
|
21
|
-
- [Release and MCP Registry publication](release.md)
|
|
22
|
-
- [HOI4 research ledger](research/source-ledger.md)
|
|
23
|
-
- [MCP research review](research/mcp-2026-07-10.md)
|
|
3
|
+
- [Setup](setup.md): install the server, configure HOI4 paths, and connect an MCP client.
|
|
4
|
+
- [Focus trees](focus.md): inspect, create, render, and clean national or continuous focus content.
|
|
5
|
+
- [Scripted GUIs](gui.md): inspect linked UI source, render states, and create or repair GUIs.
|
|
6
|
+
- [Maps](map.md): inspect and edit provinces, states, regions, adjacency, supply, and railways.
|
|
7
|
+
- [HTTP](http.md): run the MCP server for shared or remote access.
|
|
8
|
+
- [Development](development.md): build, test, and contribute.
|
|
9
|
+
|
|
10
|
+
For vulnerability reporting, see the repository [Security Policy](../SECURITY.md).
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Development
|
|
2
|
+
|
|
3
|
+
Install dependencies and run the complete project check:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm ci
|
|
7
|
+
npm run check
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
`npm run check` runs formatting, type checks, tests, fixture checks, schema generation checks, build checks, and package validation. Use narrower commands during iteration:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm run test
|
|
14
|
+
npm run test:coverage
|
|
15
|
+
npm run fixtures:check
|
|
16
|
+
npm run build
|
|
17
|
+
npm run inspector
|
|
18
|
+
```
|
|
19
|
+
|
|
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
|
+
|
|
22
|
+
See the package [Security Policy](../SECURITY.md) for private vulnerability reporting.
|
package/docs/focus.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Focus trees
|
|
2
|
+
|
|
3
|
+
Use `hoi4.focus_inspect`, `hoi4.focus_render`, and `hoi4.focus_rewrite` for national focus trees and continuous focus palettes. Start with `hoi4.mods` when the mod ID is not known.
|
|
4
|
+
|
|
5
|
+
## Create a tree
|
|
6
|
+
|
|
7
|
+
A complete plan should include:
|
|
8
|
+
|
|
9
|
+
- tree ID and country assignment;
|
|
10
|
+
- branch and lane groups;
|
|
11
|
+
- exact prerequisites and mutual exclusions;
|
|
12
|
+
- availability, visibility, bypass, and route locks;
|
|
13
|
+
- rewards and links to decisions, events, ideas, characters, or scripted helpers;
|
|
14
|
+
- focus positions, convergence points, and shared support branches;
|
|
15
|
+
- titles, descriptions, icons, filters, and AI behavior.
|
|
16
|
+
|
|
17
|
+
For a missing target, call `hoi4.focus_rewrite` with `createIfMissing: true`. Review the proposed and final artifacts returned by the rewrite, then inspect and render the result. Do not call a tree complete with placeholder rewards, missing localisation, missing icons, or absent AI choices.
|
|
18
|
+
|
|
19
|
+
## Clean an existing tree
|
|
20
|
+
|
|
21
|
+
For a layout-only cleanup of an existing national tree, call `hoi4.focus_rewrite` without a plan:
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"workspaceId": "my-mod",
|
|
26
|
+
"relativePath": "common/national_focus/my_tree.txt",
|
|
27
|
+
"treeId": "my_tree",
|
|
28
|
+
"layoutMode": "compact"
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Compact mode imports the tree, resets authored presentation coordinates and lane bounds, and performs a deterministic reflow in the same rewrite call. It keeps prerequisites, mutual exclusions, availability, bypasses, rewards, icons, localisation, AI behavior, and route/lane membership unchanged.
|
|
33
|
+
|
|
34
|
+
The rewrite measures canvas bounds, same-row spacing, the same curved connector paths used by the renderer, connector lengths, connector-node intersections, branch balance, and overall centering. A bounded refinement pass moves automatic gateways and blockers only when the measured connector result improves. The rewrite refuses changes with close focuses, rendered crossings, excessive branch imbalance, an off-center canvas, or connector and size metrics outside absolute and source-relative limits.
|
|
35
|
+
|
|
36
|
+
Use the default `layoutMode: "authored"` with a complete plan when deliberately designing coordinates or changing gameplay. Set `layoutMode: "compact"` with a complete plan when creating a large automatically arranged tree. Inspect and render calls remain useful before or after either rewrite mode, but a separate plan is not required for compact cleanup.
|
|
37
|
+
|
|
38
|
+
A cleanup should not change gameplay relationships to improve the picture. One `prerequisite` block containing several focus IDs is an OR group; several prerequisite blocks are AND requirements.
|
|
39
|
+
|
|
40
|
+
## Layout metadata and unsupported script
|
|
41
|
+
|
|
42
|
+
Branch names, lane assignments, working labels, and other planning-only data may be stored in a `.focus-plan.json` file beside the focus source. HOI4 does not load that file.
|
|
43
|
+
|
|
44
|
+
If malformed or unsupported script makes a requested change ambiguous, the rewrite stops and explains the blocker instead of guessing.
|
|
45
|
+
|
|
46
|
+
## What inspection checks
|
|
47
|
+
|
|
48
|
+
Inspection and rendering can report missing references, invalid prerequisite structure, duplicate or overlapping positions, insufficient spacing, long or crossing connectors, branch asymmetry, route conflicts, missing localisation or sprites, weak terminal branches, repeated rewards, and missing AI metadata. Renders are offline review artifacts, not game screenshots.
|
|
49
|
+
|
|
50
|
+
National trees with 200 or more focuses render review PNGs at half scale by default so large agent workflows stay responsive. Pass an explicit `reviewScale` from `0.25` through `1` when a different raster size is needed; HTML, SVG, JSON, layout, and diagnostics remain complete.
|
package/docs/gui.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Scripted GUIs
|
|
2
|
+
|
|
3
|
+
Use `hoi4.gui_inspect`, `hoi4.gui_render`, and `hoi4.gui_rewrite` for `.gui`, `.gfx`, `common/scripted_guis`, localisation, sprites, fonts, and linked decision entry points. Start with `hoi4.mods` when the mod ID is not known.
|
|
4
|
+
|
|
5
|
+
## Create a GUI
|
|
6
|
+
|
|
7
|
+
`hoi4.gui_rewrite` can work from supported source, targeted patches, or structured helpers. Source and helper rewrites may include one bounded text package: the main `.gui` plus additional interface `.gui`/`.gfx`, configured GFX `.gfx`, `common/scripted_guis/*.txt`, and localisation `.yml` files. The package is path-checked, parsed, linked, rendered, validated, and applied together in one rewrite. Existing text encodings are retained, while localisation is always written as UTF-8 with BOM.
|
|
8
|
+
|
|
9
|
+
A package may contain at most 32 text files and 16 MiB of encoded source in total. Paths are compared portably, so aliases that differ only by letter case are rejected.
|
|
10
|
+
|
|
11
|
+
Helpers cover common layouts such as anchors, rows, columns, stacks, grids, cards, tabs, scroll lists, meters, status panels, modals, and overlays. They compile to ordinary HOI4 GUI source; the finished mod has no runtime dependency on this server. Binary textures, fonts, and other art are referenced from `.gfx`/GUI source and must already exist in the workspace; the rewrite input does not upload binary art.
|
|
12
|
+
|
|
13
|
+
Before writing:
|
|
14
|
+
|
|
15
|
+
- define the root window, parent/context, element IDs, and dimensions;
|
|
16
|
+
- register sprites, textures, fonts, and localisation used on screen;
|
|
17
|
+
- provide button triggers, effects, scripted-GUI properties, dynamic-list wiring, and AI behavior where required;
|
|
18
|
+
- render the important states and resolutions;
|
|
19
|
+
- keep click regions aligned with visible controls.
|
|
20
|
+
|
|
21
|
+
Rewrite once, then inspect and render the result.
|
|
22
|
+
|
|
23
|
+
## Clean an existing GUI
|
|
24
|
+
|
|
25
|
+
1. Inspect the root window and its linked GUI, GFX, scripted-GUI, and localisation source.
|
|
26
|
+
2. Render the normal state and the states relevant to the task, such as hover, selected, disabled, warning, empty list, full list, minimum value, maximum value, or long text.
|
|
27
|
+
3. Check common resolutions and UI scales when positioning or clipping can change.
|
|
28
|
+
4. Fix the existing mod-owned file with targeted patches, a complete supported source replacement, or a structured helper replacement.
|
|
29
|
+
5. Rewrite once, then inspect and render the result.
|
|
30
|
+
|
|
31
|
+
Inspection checks missing assets and localisation, invalid sizes, overlap, clipping, overflow, conflicting click regions, invisible blockers, broken parents or contexts, list-row cuts, state conflicts, trigger/effect gaps, and resolution drift.
|
|
32
|
+
|
|
33
|
+
## Offline preview limits
|
|
34
|
+
|
|
35
|
+
The renderer does not run the game engine. Each render includes a fidelity report that separates fields it models from fields it approximates, ignores, cannot resolve, or does not support. Treat that report as part of the review.
|
|
36
|
+
|
|
37
|
+
A rewrite stops if malformed or unsupported GUI script makes the requested change ambiguous. Runtime animation, masking, tiling, hardcoded controls, and dynamic values may require exact game precedents even when a useful offline preview is available.
|
package/docs/http.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# HTTP
|
|
2
|
+
|
|
3
|
+
Local MCP clients should use the default stdio registration. Use `hoi4-agent-tools-http` only when the server must be reached by another process or machine.
|
|
4
|
+
|
|
5
|
+
The HTTP server exposes the MCP endpoint at `/mcp`.
|
|
6
|
+
|
|
7
|
+
JSON request bodies default to and are capped at 64 MiB. This leaves transport-envelope headroom for the bounded 16 MiB GUI text package and a maximum canonical map mask while the two-request concurrency ceiling keeps aggregate body bytes at or below 128 MiB.
|
|
8
|
+
|
|
9
|
+
Resumable event history defaults to 2 MiB per session within the 16 MiB global store, enough to retain one framed 1 MiB artifact-resource chunk.
|
|
10
|
+
|
|
11
|
+
## Loopback
|
|
12
|
+
|
|
13
|
+
Keep the listener on `127.0.0.1`, configure a long random bearer token through an environment variable named by the HTTP config, and allow only the client origins you use. Do not place tokens in the config file or command line.
|
|
14
|
+
|
|
15
|
+
Add an HTTP section to a config created by setup:
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"version": 1,
|
|
20
|
+
"serverStateRoot": "/var/lib/hoi4-agent-tools/state",
|
|
21
|
+
"modRoots": ["/projects/hoi4-mods"],
|
|
22
|
+
"workspaceStorageRoot": "/var/lib/hoi4-agent-tools/workspaces",
|
|
23
|
+
"http": {
|
|
24
|
+
"host": "127.0.0.1",
|
|
25
|
+
"port": 3210,
|
|
26
|
+
"allowedOrigins": ["https://agent.example"],
|
|
27
|
+
"tokens": [
|
|
28
|
+
{
|
|
29
|
+
"principal": "local-agent",
|
|
30
|
+
"tokenEnv": "HOI4_AGENT_HTTP_TOKEN",
|
|
31
|
+
"allowDiscoveredMods": true
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Set `HOI4_AGENT_HTTP_TOKEN` to a random value of at least 32 characters, then run `hoi4-agent-tools-http --config PATH`. `allowDiscoveredMods` grants that principal only the mod IDs created by discovery beneath `modRoots`; it never grants unrelated explicit workspaces. For narrower remote access, define the permitted mods as explicit `workspaces`, list those IDs in `workspaceIds`, and omit `allowDiscoveredMods`.
|
|
39
|
+
|
|
40
|
+
## Shared or remote access
|
|
41
|
+
|
|
42
|
+
A non-loopback deployment needs:
|
|
43
|
+
|
|
44
|
+
- HTTPS at a trusted reverse proxy;
|
|
45
|
+
- OAuth/OIDC token validation;
|
|
46
|
+
- an exact origin allowlist;
|
|
47
|
+
- explicit user-to-mod grants;
|
|
48
|
+
- narrow mounted mod and game paths;
|
|
49
|
+
- request, connection, and session limits.
|
|
50
|
+
|
|
51
|
+
Do not expose a developer home directory or a whole game library. The installed game and dependencies should be mounted read-only. Use separate server instances for teams that should not share operating-system access.
|
|
52
|
+
|
|
53
|
+
The server never launches Hearts of Iron IV and does not need a desktop or Steam session. See the repository [Security Policy](../SECURITY.md) before exposing HTTP beyond loopback.
|
package/docs/map.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Maps
|
|
2
|
+
|
|
3
|
+
Use `hoi4.map_inspect`, `hoi4.map_render`, and `hoi4.map_rewrite` for provinces, states, strategic regions, adjacency, supply nodes, railways, positions, ownership, cores, claims, resources, buildings, and localisation. Start with `hoi4.mods` when the mod ID is not known.
|
|
4
|
+
|
|
5
|
+
## Create or reshape map content
|
|
6
|
+
|
|
7
|
+
Map changes may add, split, merge, remove, or redefine provinces and states; update strategic regions; edit normal or special adjacency; and update supply, railway, building, unit, or weather positions.
|
|
8
|
+
|
|
9
|
+
Geometry must be exact. Use existing province IDs, integer polygon boundaries with the required fill rule, a validated raster mask, or explicit pixels. Natural-language geography can guide an agent, but it is not rewrite geometry.
|
|
10
|
+
|
|
11
|
+
Pass up to 32 `provinceIds` to `hoi4.map_inspect` to receive a linked exact-geometry JSON artifact. It records the active map dimensions, unknown IDs, and each known province as maximal `[y, startX, endXExclusive]` runs sorted in top-left raster order. Derive a bounded pixel subset or mask from those runs before calling `hoi4.map_rewrite`; row runs are inspection evidence, not a rewrite geometry kind.
|
|
12
|
+
|
|
13
|
+
For state or province moves, splits, merges, removals, or type changes, explicitly state what happens to applicable data:
|
|
14
|
+
|
|
15
|
+
- state membership and strategic region membership;
|
|
16
|
+
- manpower, resources, buildings, and victory points;
|
|
17
|
+
- owner, controller, cores, and claims;
|
|
18
|
+
- ports, supply nodes, and railways;
|
|
19
|
+
- building, unit, weather, and entity positions;
|
|
20
|
+
- normal and special adjacency;
|
|
21
|
+
- state localisation.
|
|
22
|
+
|
|
23
|
+
Build one ordered list of exact operations, call `hoi4.map_rewrite`, and review its before, proposed, and changed-area evidence. Then inspect and render the result.
|
|
24
|
+
|
|
25
|
+
## Inspect and clean a map
|
|
26
|
+
|
|
27
|
+
1. Inspect the affected map area and read reference diagnostics.
|
|
28
|
+
2. Render a baseline with the relevant province, state, region, terrain, coastline, supply, railway, ownership, or building overlays.
|
|
29
|
+
3. Build one ordered list of exact repair operations.
|
|
30
|
+
4. Supply every required geometry and data-movement choice.
|
|
31
|
+
5. Rewrite, then inspect and render the result.
|
|
32
|
+
|
|
33
|
+
Common cleanup work includes duplicate IDs or colors, bitmap/definition mismatches, invalid state or region membership, broken adjacency, missing localisation, disconnected province geometry, invalid ports or victory points, and stale supply or railway references.
|
|
34
|
+
|
|
35
|
+
The map tools do not infer a corridor, choose a replacement province, redistribute state data, reconnect a railway, or move a port without an explicit instruction. ID and color allocation checks the configured game, dependencies, and mod before choosing a value.
|
|
36
|
+
|
|
37
|
+
## Review boundary
|
|
38
|
+
|
|
39
|
+
Map renders are offline evidence. Final inspection checks that references remain valid and changes stay within the declared geometry. Unsupported or ambiguous changes stop with a blocker instead of applying a partial substitute.
|
package/docs/setup.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Setup
|
|
2
|
+
|
|
3
|
+
HOI4 Agent Tools requires Node.js 22 or 24.
|
|
4
|
+
|
|
5
|
+
## Install and initialize
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install --global hoi4-agent-tools@1.1.0
|
|
9
|
+
hoi4-agent-tools-setup --init
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The setup command discovers standard HOI4 game and mod locations, creates a separate storage folder for generated workspace data, and writes the default per-user config. Each configured mod root is a parent folder whose immediate child directories are individual mods. Every discovered mod is writable through the three rewrite tools; no per-mod write switch or approval step is required. The installed game remains reference-only.
|
|
13
|
+
|
|
14
|
+
After connecting the MCP server, call `hoi4.mods` to confirm which mods are available.
|
|
15
|
+
|
|
16
|
+
## Override discovered paths
|
|
17
|
+
|
|
18
|
+
Use explicit paths when discovery is incomplete or when you want to expose more than one mod root:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
hoi4-agent-tools-setup --init --mod-root /projects/hoi4-mods --mod-root /workshop/hoi4-mods --game-root "/games/Hearts of Iron IV" --workspace-storage-root /var/lib/hoi4-agent-tools
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
- `--mod-root PATH` adds a parent folder containing mods. Repeat it for additional locations.
|
|
25
|
+
- `--game-root PATH` selects the installed game folder used as a read-only reference.
|
|
26
|
+
- `--workspace-storage-root PATH` selects where indexes, renders, and other generated workspace files are stored.
|
|
27
|
+
- `--config PATH` writes or reads a config at a custom path instead of the default per-user location.
|
|
28
|
+
|
|
29
|
+
The corresponding config fields are `modRoots`, `gameRoot`, and `workspaceStorageRoot`.
|
|
30
|
+
|
|
31
|
+
Linked directory entries are not followed. If a mod folder is a symlink or junction, configure the real parent directory as another `--mod-root`.
|
|
32
|
+
|
|
33
|
+
## MCP client registration
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
hoi4-agent-tools-setup --print-client-config
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Use the printed `globalInstall` or `codexTomlGlobal` entry. It is platform-correct and uses the default config without an environment variable. For a custom config, add `--config PATH` when printing the registration.
|
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": "
|
|
5
|
-
"description": "
|
|
4
|
+
"version": "1.1.0",
|
|
5
|
+
"description": "MCP tools for coding agents to create and clean HOI4 focus trees, scripted GUIs, and maps",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"author": "HOI4 Agent Tools contributors",
|
|
@@ -29,27 +29,26 @@
|
|
|
29
29
|
},
|
|
30
30
|
"files": [
|
|
31
31
|
"dist/",
|
|
32
|
-
"docs/",
|
|
33
|
-
"
|
|
32
|
+
"docs/README.md",
|
|
33
|
+
"docs/setup.md",
|
|
34
|
+
"docs/focus.md",
|
|
35
|
+
"docs/gui.md",
|
|
36
|
+
"docs/map.md",
|
|
37
|
+
"docs/http.md",
|
|
38
|
+
"docs/development.md",
|
|
34
39
|
"server.json",
|
|
35
40
|
"README.md",
|
|
36
41
|
"CHANGELOG.md",
|
|
37
42
|
"LICENSE",
|
|
38
43
|
"SECURITY.md"
|
|
39
44
|
],
|
|
40
|
-
"exports": {
|
|
41
|
-
".": {
|
|
42
|
-
"types": "./dist/index.d.ts",
|
|
43
|
-
"import": "./dist/index.js"
|
|
44
|
-
},
|
|
45
|
-
"./schemas/*": "./schemas/*"
|
|
46
|
-
},
|
|
47
45
|
"bin": {
|
|
48
46
|
"hoi4-agent-tools": "./dist/bin/stdio.js",
|
|
49
47
|
"hoi4-agent-tools-http": "./dist/bin/http.js",
|
|
50
48
|
"hoi4-agent-tools-setup": "./dist/bin/setup.js"
|
|
51
49
|
},
|
|
52
50
|
"scripts": {
|
|
51
|
+
"prebuild": "node --eval \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
53
52
|
"build": "tsc -p tsconfig.build.json",
|
|
54
53
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
55
54
|
"lint": "eslint .",
|
|
@@ -85,7 +84,7 @@
|
|
|
85
84
|
"fast-glob": "3.3.3",
|
|
86
85
|
"fontkit": "2.0.4",
|
|
87
86
|
"iconv-lite": "0.7.3",
|
|
88
|
-
"jose": "6.
|
|
87
|
+
"jose": "6.2.3",
|
|
89
88
|
"sharp": "0.35.3",
|
|
90
89
|
"zod": "4.4.3"
|
|
91
90
|
},
|
|
@@ -99,7 +98,7 @@
|
|
|
99
98
|
"@vitest/coverage-v8": "4.1.10",
|
|
100
99
|
"ajv": "8.20.0",
|
|
101
100
|
"ajv-formats": "3.0.1",
|
|
102
|
-
"eslint": "10.
|
|
101
|
+
"eslint": "10.7.0",
|
|
103
102
|
"fast-check": "4.9.0",
|
|
104
103
|
"pixelmatch": "7.2.0",
|
|
105
104
|
"prettier": "3.9.5",
|
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": "
|
|
6
|
-
"version": "
|
|
5
|
+
"description": "Create and clean HOI4 focus trees, scripted GUIs, and maps with coding agents.",
|
|
6
|
+
"version": "1.1.0",
|
|
7
7
|
"repository": {
|
|
8
8
|
"url": "https://github.com/klimPaskov/hoi4-agent-tools",
|
|
9
9
|
"source": "github"
|
|
@@ -13,16 +13,7 @@
|
|
|
13
13
|
{
|
|
14
14
|
"registryType": "npm",
|
|
15
15
|
"identifier": "hoi4-agent-tools",
|
|
16
|
-
"version": "
|
|
17
|
-
"environmentVariables": [
|
|
18
|
-
{
|
|
19
|
-
"name": "HOI4_AGENT_CONFIG",
|
|
20
|
-
"description": "Absolute path to a persistent allowlisted HOI4 Agent Tools server configuration file.",
|
|
21
|
-
"format": "filepath",
|
|
22
|
-
"isRequired": true,
|
|
23
|
-
"placeholder": "/absolute/path/to/config.json"
|
|
24
|
-
}
|
|
25
|
-
],
|
|
16
|
+
"version": "1.1.0",
|
|
26
17
|
"transport": {
|
|
27
18
|
"type": "stdio"
|
|
28
19
|
}
|
package/dist/bin/http.d.ts
DELETED
package/dist/bin/http.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/bin/http.ts"],"names":[],"mappings":""}
|