hoi4-agent-tools 0.2.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -118
- package/README.md +35 -127
- 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/compiler.js +0 -1
- 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 +0 -1
- package/dist/hoi4_agent_tools/focus/importer.js +0 -1
- package/dist/hoi4_agent_tools/focus/index.js +0 -1
- package/dist/hoi4_agent_tools/focus/layout.js +0 -1
- package/dist/hoi4_agent_tools/focus/limits.js +0 -1
- package/dist/hoi4_agent_tools/focus/lint.js +0 -1
- 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 +0 -1
- package/dist/hoi4_agent_tools/focus/presentation.js +0 -1
- package/dist/hoi4_agent_tools/focus/render.js +0 -1
- 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/create.js +3 -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 +24 -30
- package/dist/hoi4_agent_tools/mcp/server/transaction-execution.js +10 -14
- package/dist/hoi4_agent_tools/mcp/tools/focus.js +219 -275
- package/dist/hoi4_agent_tools/mcp/tools/gui.js +149 -250
- package/dist/hoi4_agent_tools/mcp/tools/map.js +256 -337
- 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 +0 -1
- 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 +40 -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 +10 -11
- 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
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { z } from 'zod/v4';
|
|
2
2
|
import { boundedSourceHashEvidence, publicArtifactLink } from '../../core/artifacts.js';
|
|
3
|
-
import { canonicalJson } from '../../core/canonical.js';
|
|
3
|
+
import { canonicalJson, compareCodeUnits } from '../../core/canonical.js';
|
|
4
4
|
import { renderDimensionViolation, RenderBudget, RENDER_MAX_DIMENSION, } from '../../core/render-budget.js';
|
|
5
5
|
import { emptyServiceResult, ServiceError } from '../../core/result.js';
|
|
6
|
-
import {
|
|
6
|
+
import { SOURCE_MAX_BYTES } from '../../core/source/index.js';
|
|
7
|
+
import { GuiHelperDocumentSchema, GuiPreviewScenarioSchema, GUI_TEXT_PACKAGE_MAX_FILES, ScriptedGuiStudio, compileGuiHelpers, } from '../../gui/index.js';
|
|
7
8
|
import { workspaceIdSchema, workspaceRelativePathSchema } from '../../schemas/common.js';
|
|
8
9
|
import { PACKAGE_VERSION } from '../../version.js';
|
|
9
|
-
import { requireServerScope
|
|
10
|
-
import { autonomousFailureContext, autonomousResultArtifacts,
|
|
10
|
+
import { requireServerScope } from '../server/base-tools.js';
|
|
11
|
+
import { autonomousFailureContext, autonomousResultArtifacts, executePlannedTransaction, } from '../server/transaction-execution.js';
|
|
11
12
|
import { indexSkippedSourceSchema, nonNegativeIntegerSchema, sha256Schema, } from '../server/output-schemas.js';
|
|
12
13
|
import { progressReporter } from '../server/progress.js';
|
|
13
14
|
import { errorResult, setInlineFilesScanned, strictOperationResultSchema, toolResult, } from '../server/result.js';
|
|
@@ -24,15 +25,10 @@ const guiScanOutputSchema = strictOperationResultSchema(z
|
|
|
24
25
|
sprites: nonNegativeIntegerSchema,
|
|
25
26
|
fonts: nonNegativeIntegerSchema,
|
|
26
27
|
scriptedGuis: nonNegativeIntegerSchema,
|
|
27
|
-
|
|
28
|
-
.
|
|
29
|
-
|
|
30
|
-
.
|
|
31
|
-
windowName: z.string().max(256),
|
|
32
|
-
scenarioId: z.string().max(256),
|
|
33
|
-
sourceRevision: sha256Schema,
|
|
34
|
-
elementCount: nonNegativeIntegerSchema,
|
|
35
|
-
fidelityCounts: countRecordSchema,
|
|
28
|
+
windowName: z.string().max(256).optional(),
|
|
29
|
+
scenarioId: z.string().max(256).optional(),
|
|
30
|
+
inspectedElementCount: nonNegativeIntegerSchema.optional(),
|
|
31
|
+
fidelityCounts: countRecordSchema.optional(),
|
|
36
32
|
})
|
|
37
33
|
.strict());
|
|
38
34
|
const guiRenderOutputSchema = strictOperationResultSchema(z
|
|
@@ -59,26 +55,15 @@ const guiRenderOutputSchema = strictOperationResultSchema(z
|
|
|
59
55
|
offlineRepresentation: z.literal(true),
|
|
60
56
|
})
|
|
61
57
|
.strict());
|
|
62
|
-
const guiCompareOutputSchema = strictOperationResultSchema(z
|
|
63
|
-
.object({
|
|
64
|
-
windowName: z.string().max(256),
|
|
65
|
-
beforeScenario: z.string().max(256),
|
|
66
|
-
afterScenario: z.string().max(256),
|
|
67
|
-
changedPixels: nonNegativeIntegerSchema,
|
|
68
|
-
changedRatio: z.number().min(0).max(1),
|
|
69
|
-
offlineRepresentation: z.literal(true),
|
|
70
|
-
})
|
|
71
|
-
.strict());
|
|
72
58
|
export const guiPlanOutputSchema = strictOperationResultSchema(z
|
|
73
59
|
.object({
|
|
74
60
|
mode: z.enum(['source', 'helpers', 'patches']),
|
|
75
|
-
execution: z.enum(['
|
|
76
|
-
expiresAt: z.iso.datetime(),
|
|
61
|
+
execution: z.enum(['applied', 'blocked', 'unchanged']),
|
|
77
62
|
nodeCount: nonNegativeIntegerSchema.optional(),
|
|
78
63
|
templateInstanceCount: nonNegativeIntegerSchema.optional(),
|
|
79
64
|
rawEscapeCount: nonNegativeIntegerSchema.optional(),
|
|
80
|
-
|
|
81
|
-
|
|
65
|
+
fileCount: nonNegativeIntegerSchema,
|
|
66
|
+
artifactCount: nonNegativeIntegerSchema,
|
|
82
67
|
})
|
|
83
68
|
.strict());
|
|
84
69
|
const artifactProducing = {
|
|
@@ -110,6 +95,29 @@ const guiBaseInput = z
|
|
|
110
95
|
scenario: GuiPreviewScenarioSchema,
|
|
111
96
|
})
|
|
112
97
|
.strict();
|
|
98
|
+
const guiInspectInput = z
|
|
99
|
+
.object({
|
|
100
|
+
workspaceId: workspaceIdSchema,
|
|
101
|
+
windowName: z.string().min(1).max(256).optional(),
|
|
102
|
+
scenario: GuiPreviewScenarioSchema.optional(),
|
|
103
|
+
relatedScenarios: z.array(GuiPreviewScenarioSchema).max(32).optional(),
|
|
104
|
+
})
|
|
105
|
+
.strict()
|
|
106
|
+
.superRefine((value, context) => {
|
|
107
|
+
if ((value.windowName === undefined) !== (value.scenario === undefined)) {
|
|
108
|
+
context.addIssue({
|
|
109
|
+
code: 'custom',
|
|
110
|
+
message: 'windowName and scenario must be provided together',
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
if (value.relatedScenarios !== undefined && value.scenario === undefined) {
|
|
114
|
+
context.addIssue({
|
|
115
|
+
code: 'custom',
|
|
116
|
+
path: ['relatedScenarios'],
|
|
117
|
+
message: 'relatedScenarios requires a window scenario',
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
});
|
|
113
121
|
const resolutionSchema = z
|
|
114
122
|
.object({
|
|
115
123
|
width: z.number().int().min(320).max(RENDER_MAX_DIMENSION),
|
|
@@ -130,148 +138,111 @@ function validationSummary(validation) {
|
|
|
130
138
|
checks: validation.checks,
|
|
131
139
|
};
|
|
132
140
|
}
|
|
133
|
-
function safeSlug(value) {
|
|
134
|
-
return (value
|
|
135
|
-
.replace(/[^A-Za-z0-9._-]+/gu, '-')
|
|
136
|
-
.replace(/^-+|-+$/gu, '')
|
|
137
|
-
.slice(0, 48) || 'gui');
|
|
138
|
-
}
|
|
139
141
|
export function registerGuiTools(server, engine, context) {
|
|
140
|
-
const autonomous = autonomousWrites(engine);
|
|
141
142
|
const studio = new ScriptedGuiStudio(engine);
|
|
142
|
-
server.registerTool('hoi4.
|
|
143
|
-
title: '
|
|
144
|
-
description: '
|
|
145
|
-
inputSchema:
|
|
143
|
+
server.registerTool('hoi4.gui_inspect', {
|
|
144
|
+
title: 'Inspect scripted GUI',
|
|
145
|
+
description: 'Inspect GUI, GFX, scripted logic, localisation, sprites, fonts, interactions, and animation sources for creation and cleanup. Provide a window scenario to include visual, state, click, AI, and cost diagnostics.',
|
|
146
|
+
inputSchema: guiInspectInput,
|
|
146
147
|
outputSchema: guiScanOutputSchema,
|
|
147
148
|
annotations: artifactProducing,
|
|
148
|
-
}, async ({ workspaceId }, extra) => {
|
|
149
|
-
try {
|
|
150
|
-
const progress = progressReporter(extra);
|
|
151
|
-
await progress.report(0, 3, 'Building shared index and GUI source graph');
|
|
152
|
-
const [shared, scanned] = await Promise.all([
|
|
153
|
-
engine.scan(workspaceId, {}, context.principal, progress.signal),
|
|
154
|
-
studio.scan(workspaceId, context.principal, progress.signal),
|
|
155
|
-
]);
|
|
156
|
-
const workspace = engine.resolver.get(workspaceId, context.principal);
|
|
157
|
-
const sourceEvidence = boundedSourceHashEvidence(scanned.graph.sourceHashes);
|
|
158
|
-
const artifact = await engine.artifacts.putChunked(workspace, `gui-source-graph.${shared.revision.slice(0, 16)}.json`, 'application/json', `${canonicalJson({
|
|
159
|
-
schemaVersion: 1,
|
|
160
|
-
sharedRevision: shared.revision,
|
|
161
|
-
offline: true,
|
|
162
|
-
graph: scanned.graph,
|
|
163
|
-
})}\n`, {
|
|
164
|
-
kind: 'gui-source-graph',
|
|
165
|
-
toolVersion: PACKAGE_VERSION,
|
|
166
|
-
schemaVersion: 'gui-source-graph.v1',
|
|
167
|
-
sourceHashes: sourceEvidence.sourceHashes,
|
|
168
|
-
metadata: {
|
|
169
|
-
sharedRevision: shared.revision,
|
|
170
|
-
offline: true,
|
|
171
|
-
complete: scanned.graph.complete,
|
|
172
|
-
skippedSourceCount: scanned.graph.skippedSourceCount,
|
|
173
|
-
sourceHashInventory: sourceEvidence.inventory,
|
|
174
|
-
},
|
|
175
|
-
}, 'Offline scripted-GUI source graph with bounded inventory completeness metadata', progress.signal);
|
|
176
|
-
const diagnostics = [...shared.diagnostics, ...scanned.graph.diagnostics];
|
|
177
|
-
const result = emptyServiceResult(workspaceId, {
|
|
178
|
-
sharedRevision: shared.revision,
|
|
179
|
-
complete: scanned.graph.complete,
|
|
180
|
-
skippedSourceCount: scanned.graph.skippedSourceCount,
|
|
181
|
-
skippedSources: scanned.graph.skippedSources,
|
|
182
|
-
nodes: scanned.graph.nodes.length,
|
|
183
|
-
edges: scanned.graph.edges.length,
|
|
184
|
-
elements: scanned.graph.elements.length,
|
|
185
|
-
sprites: scanned.graph.sprites.length,
|
|
186
|
-
fonts: scanned.graph.fonts.length,
|
|
187
|
-
scriptedGuis: scanned.graph.scriptedGuis.length,
|
|
188
|
-
});
|
|
189
|
-
result.code = scanned.graph.complete ? 'GUI_SCANNED' : 'GUI_SCANNED_PARTIAL';
|
|
190
|
-
setInlineFilesScanned(result, scanned.graph.filesScanned);
|
|
191
|
-
result.diagnostics = diagnostics.slice(0, 100);
|
|
192
|
-
result.artifacts = [publicArtifactLink(artifact)];
|
|
193
|
-
result.validation = {
|
|
194
|
-
passed: !diagnostics.some(({ severity }) => severity === 'error' || severity === 'blocker'),
|
|
195
|
-
checks: [
|
|
196
|
-
{
|
|
197
|
-
id: 'gui-source-graph',
|
|
198
|
-
passed: true,
|
|
199
|
-
message: scanned.graph.complete
|
|
200
|
-
? `${scanned.graph.nodes.length} GUI graph nodes connected from a complete inventory`
|
|
201
|
-
: `${scanned.graph.nodes.length} GUI graph nodes connected; ${scanned.graph.skippedSourceCount} over-limit source(s) were skipped`,
|
|
202
|
-
},
|
|
203
|
-
],
|
|
204
|
-
};
|
|
205
|
-
await progress.report(3, 3, 'GUI scan complete');
|
|
206
|
-
return toolResult(result);
|
|
207
|
-
}
|
|
208
|
-
catch (error) {
|
|
209
|
-
return errorResult(error, workspaceId);
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
server.registerTool('hoi4.gui_lint', {
|
|
213
|
-
title: 'Lint scripted GUI scene',
|
|
214
|
-
description: 'Validate source references, visual bounds, text, clicks, animation, states, resolutions, AI, and costs for an offline preview scenario.',
|
|
215
|
-
inputSchema: guiBaseInput
|
|
216
|
-
.extend({ relatedScenarios: z.array(GuiPreviewScenarioSchema).max(32).optional() })
|
|
217
|
-
.strict(),
|
|
218
|
-
outputSchema: guiLintOutputSchema,
|
|
219
|
-
annotations: artifactProducing,
|
|
220
149
|
}, async ({ workspaceId, windowName, scenario, relatedScenarios }, extra) => {
|
|
221
150
|
try {
|
|
222
151
|
const progress = progressReporter(extra);
|
|
223
|
-
await progress.report(0, 3, 'Building shared index and GUI
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
|
|
152
|
+
await progress.report(0, 3, 'Building shared index and GUI inspection');
|
|
153
|
+
const inspection = windowName === undefined || scenario === undefined
|
|
154
|
+
? studio
|
|
155
|
+
.scan(workspaceId, context.principal, progress.signal)
|
|
156
|
+
.then(({ graph }) => ({ graph, linted: undefined }))
|
|
157
|
+
: studio
|
|
158
|
+
.lint({
|
|
227
159
|
workspaceId,
|
|
228
160
|
windowName,
|
|
229
161
|
scenario,
|
|
230
162
|
...(relatedScenarios === undefined ? {} : { relatedScenarios }),
|
|
231
163
|
...(context.principal === undefined ? {} : { principal: context.principal }),
|
|
232
164
|
signal: progress.signal,
|
|
233
|
-
})
|
|
165
|
+
})
|
|
166
|
+
.then((linted) => ({ graph: linted.graph, linted }));
|
|
167
|
+
const [shared, inspected] = await Promise.all([
|
|
168
|
+
engine.scan(workspaceId, {}, context.principal, progress.signal),
|
|
169
|
+
inspection,
|
|
234
170
|
]);
|
|
171
|
+
const { graph, linted } = inspected;
|
|
235
172
|
const workspace = engine.resolver.get(workspaceId, context.principal);
|
|
236
|
-
const sourceEvidence = boundedSourceHashEvidence(
|
|
237
|
-
const artifact = await engine.artifacts.
|
|
173
|
+
const sourceEvidence = boundedSourceHashEvidence(graph.sourceHashes);
|
|
174
|
+
const artifact = await engine.artifacts.putChunked(workspace, `gui-inspect.${shared.revision.slice(0, 16)}.json`, 'application/json', `${canonicalJson({
|
|
238
175
|
schemaVersion: 1,
|
|
176
|
+
sharedRevision: shared.revision,
|
|
239
177
|
offline: true,
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
178
|
+
graph,
|
|
179
|
+
...(linted === undefined
|
|
180
|
+
? {}
|
|
181
|
+
: {
|
|
182
|
+
scenario: linted.scene.scenario,
|
|
183
|
+
fidelity: linted.scene.fidelity,
|
|
184
|
+
validation: linted.validation,
|
|
185
|
+
}),
|
|
243
186
|
})}\n`, {
|
|
244
|
-
kind: 'gui-
|
|
187
|
+
kind: 'gui-inspect',
|
|
245
188
|
toolVersion: PACKAGE_VERSION,
|
|
246
|
-
schemaVersion: 'gui-
|
|
189
|
+
schemaVersion: 'gui-inspect.v1',
|
|
247
190
|
sourceHashes: sourceEvidence.sourceHashes,
|
|
248
|
-
renderProfile: {
|
|
249
|
-
offline: true,
|
|
250
|
-
resolution: linted.scene.resolution,
|
|
251
|
-
state: linted.scene.scenario.state,
|
|
252
|
-
},
|
|
253
191
|
metadata: {
|
|
254
192
|
sharedRevision: shared.revision,
|
|
193
|
+
offline: true,
|
|
194
|
+
complete: graph.complete,
|
|
195
|
+
skippedSourceCount: graph.skippedSourceCount,
|
|
255
196
|
sourceHashInventory: sourceEvidence.inventory,
|
|
256
197
|
},
|
|
257
|
-
}, '
|
|
258
|
-
const diagnostics = [
|
|
198
|
+
}, 'Scripted GUI graph, diagnostics, and optional scenario fidelity inspection', progress.signal);
|
|
199
|
+
const diagnostics = [
|
|
200
|
+
...shared.diagnostics,
|
|
201
|
+
...(linted === undefined ? graph.diagnostics : linted.validation.diagnostics),
|
|
202
|
+
];
|
|
259
203
|
const result = emptyServiceResult(workspaceId, {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
204
|
+
sharedRevision: shared.revision,
|
|
205
|
+
complete: graph.complete,
|
|
206
|
+
skippedSourceCount: graph.skippedSourceCount,
|
|
207
|
+
skippedSources: graph.skippedSources,
|
|
208
|
+
nodes: graph.nodes.length,
|
|
209
|
+
edges: graph.edges.length,
|
|
210
|
+
elements: graph.elements.length,
|
|
211
|
+
sprites: graph.sprites.length,
|
|
212
|
+
fonts: graph.fonts.length,
|
|
213
|
+
scriptedGuis: graph.scriptedGuis.length,
|
|
214
|
+
...(linted === undefined
|
|
215
|
+
? {}
|
|
216
|
+
: {
|
|
217
|
+
windowName,
|
|
218
|
+
scenarioId: linted.scene.scenario.id,
|
|
219
|
+
inspectedElementCount: linted.scene.elements.length,
|
|
220
|
+
fidelityCounts: Object.fromEntries(Object.entries(linted.scene.fidelity).map(([key, values]) => [
|
|
221
|
+
key,
|
|
222
|
+
values.length,
|
|
223
|
+
])),
|
|
224
|
+
}),
|
|
265
225
|
});
|
|
266
|
-
result.code = '
|
|
267
|
-
setInlineFilesScanned(result,
|
|
226
|
+
result.code = graph.complete ? 'GUI_INSPECTED' : 'GUI_INSPECTED_PARTIAL';
|
|
227
|
+
setInlineFilesScanned(result, graph.filesScanned);
|
|
268
228
|
result.diagnostics = diagnostics.slice(0, 100);
|
|
269
229
|
result.artifacts = [publicArtifactLink(artifact)];
|
|
270
|
-
result.validation =
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
230
|
+
result.validation =
|
|
231
|
+
linted === undefined
|
|
232
|
+
? {
|
|
233
|
+
passed: !diagnostics.some(({ severity }) => severity === 'error' || severity === 'blocker'),
|
|
234
|
+
checks: [
|
|
235
|
+
{
|
|
236
|
+
id: 'gui-inspection',
|
|
237
|
+
passed: true,
|
|
238
|
+
message: graph.complete
|
|
239
|
+
? `${graph.nodes.length} GUI graph nodes connected from a complete inventory`
|
|
240
|
+
: `${graph.nodes.length} GUI graph nodes connected; ${graph.skippedSourceCount} over-limit source(s) were skipped`,
|
|
241
|
+
},
|
|
242
|
+
],
|
|
243
|
+
}
|
|
244
|
+
: validationSummary({ diagnostics, checks: linted.validation.checks });
|
|
245
|
+
await progress.report(3, 3, 'GUI inspection complete');
|
|
275
246
|
return toolResult(result);
|
|
276
247
|
}
|
|
277
248
|
catch (error) {
|
|
@@ -380,91 +351,14 @@ export function registerGuiTools(server, engine, context) {
|
|
|
380
351
|
});
|
|
381
352
|
server.registerTool('hoi4.gui_render', {
|
|
382
353
|
title: 'Render scripted GUI artifacts',
|
|
383
|
-
description: 'Render deterministic full, cropped, annotated, click,
|
|
354
|
+
description: 'Render deterministic full, cropped, annotated, click, hierarchy, state, resolution, comparison, and fidelity artifacts for GUI creation and cleanup review.',
|
|
384
355
|
inputSchema: renderInput,
|
|
385
356
|
outputSchema: guiRenderOutputSchema,
|
|
386
357
|
annotations: artifactProducing,
|
|
387
358
|
}, (input, extra) => render(input, extra, 'GUI_RENDERED'));
|
|
388
|
-
server.registerTool('hoi4.
|
|
389
|
-
title: '
|
|
390
|
-
description: '
|
|
391
|
-
inputSchema: renderInput,
|
|
392
|
-
outputSchema: guiRenderOutputSchema,
|
|
393
|
-
annotations: artifactProducing,
|
|
394
|
-
}, (input, extra) => render(input, extra, 'GUI_STATES_RENDERED'));
|
|
395
|
-
server.registerTool('hoi4.gui_compare', {
|
|
396
|
-
title: 'Compare GUI scenarios',
|
|
397
|
-
description: 'Render two offline scenarios and return a deterministic bitmap diff as content-addressed resources.',
|
|
398
|
-
inputSchema: z
|
|
399
|
-
.object({
|
|
400
|
-
workspaceId: workspaceIdSchema,
|
|
401
|
-
windowName: z.string().min(1).max(256),
|
|
402
|
-
before: GuiPreviewScenarioSchema,
|
|
403
|
-
after: GuiPreviewScenarioSchema,
|
|
404
|
-
})
|
|
405
|
-
.strict(),
|
|
406
|
-
outputSchema: guiCompareOutputSchema,
|
|
407
|
-
annotations: artifactProducing,
|
|
408
|
-
}, async ({ workspaceId, windowName, before, after }, extra) => {
|
|
409
|
-
try {
|
|
410
|
-
const progress = progressReporter(extra);
|
|
411
|
-
await progress.report(0, 4, 'Scanning and rendering both GUI scenarios');
|
|
412
|
-
const compared = await studio.compare({
|
|
413
|
-
workspaceId,
|
|
414
|
-
windowName,
|
|
415
|
-
before,
|
|
416
|
-
after,
|
|
417
|
-
...(context.principal === undefined ? {} : { principal: context.principal }),
|
|
418
|
-
signal: progress.signal,
|
|
419
|
-
});
|
|
420
|
-
await progress.report(2, 4, 'Bitmap comparison and fidelity evidence complete');
|
|
421
|
-
const workspace = engine.resolver.get(workspaceId, context.principal);
|
|
422
|
-
const slug = safeSlug(windowName);
|
|
423
|
-
const provenance = guiArtifactProvenance(compared.graph, 'gui-scenario-comparison', compared.before, [compared.before, compared.after], {
|
|
424
|
-
comparison: {
|
|
425
|
-
changedPixels: compared.comparison.changedPixels,
|
|
426
|
-
changedRatio: compared.comparison.changedRatio,
|
|
427
|
-
},
|
|
428
|
-
});
|
|
429
|
-
await progress.report(3, 4, 'Storing comparison resources');
|
|
430
|
-
const comparisonArtifacts = await engine.artifacts.withAtomicChunkedWrites(workspace, [
|
|
431
|
-
{
|
|
432
|
-
name: `${slug}-comparison.png`,
|
|
433
|
-
mimeType: 'image/png',
|
|
434
|
-
content: compared.comparison.png,
|
|
435
|
-
provenance: { ...provenance, kind: 'gui-comparison-png' },
|
|
436
|
-
},
|
|
437
|
-
{
|
|
438
|
-
name: `${slug}-comparison.json`,
|
|
439
|
-
mimeType: 'application/json',
|
|
440
|
-
content: compared.evidenceJson,
|
|
441
|
-
provenance: { ...provenance, kind: 'gui-comparison-json' },
|
|
442
|
-
},
|
|
443
|
-
], (stored) => Promise.resolve([...stored]), progress.signal);
|
|
444
|
-
const result = emptyServiceResult(workspaceId, {
|
|
445
|
-
windowName,
|
|
446
|
-
beforeScenario: compared.before.scenario.id,
|
|
447
|
-
afterScenario: compared.after.scenario.id,
|
|
448
|
-
changedPixels: compared.comparison.changedPixels,
|
|
449
|
-
changedRatio: compared.comparison.changedRatio,
|
|
450
|
-
offlineRepresentation: true,
|
|
451
|
-
});
|
|
452
|
-
result.code = 'GUI_COMPARED';
|
|
453
|
-
setInlineFilesScanned(result, compared.graph.filesScanned);
|
|
454
|
-
result.diagnostics = [...compared.before.diagnostics, ...compared.after.diagnostics].slice(0, 100);
|
|
455
|
-
result.artifacts = comparisonArtifacts.map(publicArtifactLink);
|
|
456
|
-
await progress.report(4, 4, 'GUI comparison complete');
|
|
457
|
-
return toolResult(result);
|
|
458
|
-
}
|
|
459
|
-
catch (error) {
|
|
460
|
-
return errorResult(error, workspaceId);
|
|
461
|
-
}
|
|
462
|
-
});
|
|
463
|
-
server.registerTool(autonomous ? 'hoi4.gui_rewrite' : 'hoi4.gui_plan_changes', {
|
|
464
|
-
title: autonomous ? 'Rewrite scripted GUI source' : 'Dry-run scripted GUI source changes',
|
|
465
|
-
description: autonomous
|
|
466
|
-
? 'Validate, journal, and immediately apply source-preserving GUI source, patch, or declarative helper changes in one call; no follow-up apply call is required.'
|
|
467
|
-
: 'Create a source-preserving hash-bound reviewed transaction from explicit GUI source or declarative build-time helpers; it does not apply the transaction.',
|
|
359
|
+
server.registerTool('hoi4.gui_rewrite', {
|
|
360
|
+
title: 'Create or clean up scripted GUI',
|
|
361
|
+
description: 'Create or replace a bounded scripted-GUI text package, or clean up one mod-owned .gui with exact patches. Source/helper mode accepts a main .gui plus additional .gui, .gfx, common/scripted_guis .txt, and localisation .yml source; binary art is referenced by those files, not uploaded. The complete package is validated, rendered, and applied in one call.',
|
|
468
362
|
inputSchema: z
|
|
469
363
|
.object({
|
|
470
364
|
mode: z.enum(['source', 'helpers', 'patches']),
|
|
@@ -472,8 +366,17 @@ export function registerGuiTools(server, engine, context) {
|
|
|
472
366
|
relativePath: workspaceRelativePathSchema,
|
|
473
367
|
windowName: z.string().min(1).max(256),
|
|
474
368
|
scenario: GuiPreviewScenarioSchema,
|
|
475
|
-
source: z.string().max(
|
|
369
|
+
source: z.string().max(SOURCE_MAX_BYTES).optional(),
|
|
476
370
|
helper: GuiHelperDocumentSchema.optional(),
|
|
371
|
+
additionalFiles: z
|
|
372
|
+
.array(z
|
|
373
|
+
.object({
|
|
374
|
+
relativePath: workspaceRelativePathSchema,
|
|
375
|
+
source: z.string().max(SOURCE_MAX_BYTES),
|
|
376
|
+
})
|
|
377
|
+
.strict())
|
|
378
|
+
.max(GUI_TEXT_PACKAGE_MAX_FILES - 1)
|
|
379
|
+
.optional(),
|
|
477
380
|
expectedSourceHash: z
|
|
478
381
|
.string()
|
|
479
382
|
.regex(/^[a-f0-9]{64}$/u)
|
|
@@ -521,17 +424,19 @@ export function registerGuiTools(server, engine, context) {
|
|
|
521
424
|
});
|
|
522
425
|
}
|
|
523
426
|
if (value.mode === 'patches' &&
|
|
524
|
-
(value.source !== undefined ||
|
|
427
|
+
(value.source !== undefined ||
|
|
428
|
+
value.helper !== undefined ||
|
|
429
|
+
value.additionalFiles !== undefined)) {
|
|
525
430
|
context.addIssue({
|
|
526
431
|
code: 'custom',
|
|
527
|
-
message: 'source and
|
|
432
|
+
message: 'source, helper, and additionalFiles are forbidden in patches mode',
|
|
528
433
|
});
|
|
529
434
|
}
|
|
530
435
|
}),
|
|
531
436
|
outputSchema: guiPlanOutputSchema,
|
|
532
437
|
annotations: {
|
|
533
438
|
readOnlyHint: false,
|
|
534
|
-
destructiveHint:
|
|
439
|
+
destructiveHint: true,
|
|
535
440
|
idempotentHint: false,
|
|
536
441
|
openWorldHint: false,
|
|
537
442
|
},
|
|
@@ -540,7 +445,7 @@ export function registerGuiTools(server, engine, context) {
|
|
|
540
445
|
try {
|
|
541
446
|
requireServerScope(context, 'hoi4:write');
|
|
542
447
|
const progress = progressReporter(extra);
|
|
543
|
-
await progress.report(0, 3, 'Validating GUI
|
|
448
|
+
await progress.report(0, 3, 'Validating the requested GUI result');
|
|
544
449
|
const compilation = input.mode === 'helpers' ? compileGuiHelpers(input.helper) : undefined;
|
|
545
450
|
const plannedTransaction = await studio.planSource({
|
|
546
451
|
workspaceId,
|
|
@@ -550,15 +455,18 @@ export function registerGuiTools(server, engine, context) {
|
|
|
550
455
|
expectedSourceHash: input.expectedSourceHash,
|
|
551
456
|
patches: input.patches,
|
|
552
457
|
}
|
|
553
|
-
: {
|
|
458
|
+
: {
|
|
459
|
+
source: input.mode === 'source' ? input.source : compilation.source,
|
|
460
|
+
...(input.additionalFiles === undefined
|
|
461
|
+
? {}
|
|
462
|
+
: { additionalFiles: input.additionalFiles }),
|
|
463
|
+
}),
|
|
554
464
|
windowName,
|
|
555
465
|
scenario,
|
|
556
466
|
...(context.principal === undefined ? {} : { principal: context.principal }),
|
|
557
467
|
signal: progress.signal,
|
|
558
468
|
});
|
|
559
|
-
await progress.report(2, 3,
|
|
560
|
-
? 'Applying and post-validating GUI rewrite'
|
|
561
|
-
: 'Finalizing reviewed transaction');
|
|
469
|
+
await progress.report(2, 3, 'Applying and validating the GUI rewrite');
|
|
562
470
|
const execution = await executePlannedTransaction(engine, plannedTransaction, context.principal, progress.signal);
|
|
563
471
|
const transaction = execution.transaction;
|
|
564
472
|
const planned = {
|
|
@@ -568,9 +476,8 @@ export function registerGuiTools(server, engine, context) {
|
|
|
568
476
|
const result = emptyServiceResult(workspaceId, {
|
|
569
477
|
mode: input.mode,
|
|
570
478
|
execution: execution.outcome,
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
transactionArtifactCount: transaction.artifacts.length,
|
|
479
|
+
fileCount: transaction.files.length,
|
|
480
|
+
artifactCount: transaction.artifacts.length,
|
|
574
481
|
...(planned.compilation === undefined
|
|
575
482
|
? {}
|
|
576
483
|
: {
|
|
@@ -585,24 +492,17 @@ export function registerGuiTools(server, engine, context) {
|
|
|
585
492
|
? 'GUI_CHANGES_APPLIED'
|
|
586
493
|
: execution.outcome === 'unchanged'
|
|
587
494
|
? 'GUI_CHANGES_UNCHANGED'
|
|
588
|
-
:
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
495
|
+
: 'GUI_CHANGES_BLOCKED';
|
|
496
|
+
setInlineFilesScanned(result, [
|
|
497
|
+
relativePath,
|
|
498
|
+
...(input.additionalFiles ?? []).map(({ relativePath: file }) => file),
|
|
499
|
+
].sort((left, right) => compareCodeUnits(left, right)));
|
|
592
500
|
result.proposedFiles = transaction.files
|
|
593
501
|
.slice(0, 100)
|
|
594
502
|
.map(({ relativePath: file }) => file);
|
|
595
503
|
result.changedFiles = transaction.appliedFiles.slice(0, 100);
|
|
596
504
|
result.diagnostics = transaction.diagnostics.slice(0, 100);
|
|
597
|
-
|
|
598
|
-
result.artifacts = autonomousResultArtifacts(execution);
|
|
599
|
-
}
|
|
600
|
-
else {
|
|
601
|
-
result.transactionId = transaction.transactionId;
|
|
602
|
-
result.planHash = transaction.planHash;
|
|
603
|
-
result.artifacts = [transactionResourceLink(transaction)];
|
|
604
|
-
result.rollbackStatus = transaction.rollbackStatus;
|
|
605
|
-
}
|
|
505
|
+
result.artifacts = autonomousResultArtifacts(execution);
|
|
606
506
|
result.validation = transaction.validation;
|
|
607
507
|
result.blockers = transaction.diagnostics
|
|
608
508
|
.filter(({ severity }) => severity === 'error' || severity === 'blocker')
|
|
@@ -614,8 +514,8 @@ export function registerGuiTools(server, engine, context) {
|
|
|
614
514
|
await progress.report(3, 3, execution.outcome === 'applied'
|
|
615
515
|
? 'GUI rewrite complete'
|
|
616
516
|
: execution.outcome === 'unchanged'
|
|
617
|
-
? 'GUI
|
|
618
|
-
: 'GUI
|
|
517
|
+
? 'GUI content already satisfied the rewrite'
|
|
518
|
+
: 'GUI rewrite blocked');
|
|
619
519
|
return toolResult(result);
|
|
620
520
|
}
|
|
621
521
|
catch (error) {
|
|
@@ -623,4 +523,3 @@ export function registerGuiTools(server, engine, context) {
|
|
|
623
523
|
}
|
|
624
524
|
});
|
|
625
525
|
}
|
|
626
|
-
//# sourceMappingURL=gui.js.map
|