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
|
@@ -9,12 +9,11 @@ import { CoreEngine } from '../core/engine.js';
|
|
|
9
9
|
import { assertRenderDimensions, RenderBudget, RENDER_MAX_PIXELS } from '../core/render-budget.js';
|
|
10
10
|
import { ServiceError } from '../core/result.js';
|
|
11
11
|
import { WorkspaceScanner } from '../core/scanner.js';
|
|
12
|
-
import { applyReplacements, parseClausewitz, sourcePartialLimitDiagnostics, } from '../core/source/index.js';
|
|
12
|
+
import { applyReplacements, decodeSource, encodeSource, parseClausewitz, parseLocalisation, SOURCE_MAX_BYTES, sourcePartialLimitDiagnostics, } from '../core/source/index.js';
|
|
13
13
|
import { readDependenciesFromScannedFiles, } from '../core/transactions.js';
|
|
14
14
|
import { PACKAGE_VERSION } from '../version.js';
|
|
15
15
|
import { isSafeAnimationSourcePath } from './animation-manifest.js';
|
|
16
16
|
import { GuiAssetCatalog, parseBmFont } from './assets.js';
|
|
17
|
-
import { planGuiHelperCompilation } from './helpers.js';
|
|
18
17
|
import { buildGuiScene } from './layout.js';
|
|
19
18
|
import { GUI_VALIDATION_MAX_DIAGNOSTICS } from './limits.js';
|
|
20
19
|
import { compareGuiImages, galleryDimensions, renderGallerySvg, renderGuiScene, } from './renderer.js';
|
|
@@ -29,6 +28,8 @@ const staticGuiDefinitionPatterns = [
|
|
|
29
28
|
'fonts/**/*.{gfx,txt}',
|
|
30
29
|
'hoi4_agent/animation_sources/**/*.json',
|
|
31
30
|
];
|
|
31
|
+
export const GUI_TEXT_PACKAGE_MAX_FILES = 32;
|
|
32
|
+
export const GUI_TEXT_PACKAGE_MAX_BYTES = 16_777_216;
|
|
32
33
|
function normalizeConfiguredRoot(value) {
|
|
33
34
|
const normalized = value.replaceAll('\\', '/').replace(/^\.\//u, '').replace(/\/$/u, '');
|
|
34
35
|
if (!isSafeAnimationSourcePath(normalized)) {
|
|
@@ -36,6 +37,88 @@ function normalizeConfiguredRoot(value) {
|
|
|
36
37
|
}
|
|
37
38
|
return normalized;
|
|
38
39
|
}
|
|
40
|
+
function portableSourcePathKey(value) {
|
|
41
|
+
return value.toLocaleLowerCase('en-US');
|
|
42
|
+
}
|
|
43
|
+
function pathIsUnder(relativePath, roots) {
|
|
44
|
+
const candidate = portableSourcePathKey(relativePath);
|
|
45
|
+
return roots.some((root) => {
|
|
46
|
+
const normalizedRoot = portableSourcePathKey(normalizeConfiguredRoot(root));
|
|
47
|
+
return candidate.startsWith(`${normalizedRoot}/`);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function guiTextPackageFileKind(workspace, relativePath, main) {
|
|
51
|
+
if (!isSafeAnimationSourcePath(relativePath) ||
|
|
52
|
+
relativePath.split('/').some((segment) => segment === '.')) {
|
|
53
|
+
throw new ServiceError('GUI_TEXT_PACKAGE_PATH_INVALID', 'GUI text-package paths must be safe workspace-relative paths using forward slashes', { relativePath });
|
|
54
|
+
}
|
|
55
|
+
const lower = relativePath.toLocaleLowerCase('en-US');
|
|
56
|
+
const roots = workspace.registration.roots;
|
|
57
|
+
const kind = lower.endsWith('.gui') && pathIsUnder(relativePath, roots.interface)
|
|
58
|
+
? 'gui'
|
|
59
|
+
: lower.endsWith('.gfx') && pathIsUnder(relativePath, [...roots.interface, ...roots.gfx])
|
|
60
|
+
? 'gfx'
|
|
61
|
+
: lower.endsWith('.txt') && pathIsUnder(relativePath, roots.scriptedGui)
|
|
62
|
+
? 'scripted-gui'
|
|
63
|
+
: lower.endsWith('.yml') && pathIsUnder(relativePath, roots.localisation)
|
|
64
|
+
? 'localisation'
|
|
65
|
+
: undefined;
|
|
66
|
+
if (kind === undefined || (main && kind !== 'gui')) {
|
|
67
|
+
throw new ServiceError('GUI_TEXT_PACKAGE_PATH_UNSUPPORTED', main
|
|
68
|
+
? 'The main GUI text-package file must be a .gui file under a configured interface root'
|
|
69
|
+
: 'Additional GUI text-package files must be interface .gui/.gfx, configured GFX .gfx, common/scripted_guis .txt, or localisation .yml files', { relativePath });
|
|
70
|
+
}
|
|
71
|
+
return kind;
|
|
72
|
+
}
|
|
73
|
+
function parseGuiTextPackageFile(file) {
|
|
74
|
+
const sourcePath = `mod:${file.relativePath}`;
|
|
75
|
+
return file.kind === 'localisation'
|
|
76
|
+
? parseLocalisation(file.bytes, sourcePath)
|
|
77
|
+
: parseClausewitz(file.bytes, sourcePath);
|
|
78
|
+
}
|
|
79
|
+
function overlayGuiTextPackageFiles(files, prepared) {
|
|
80
|
+
const replacements = new Map(prepared.map((file) => [portableSourcePathKey(file.relativePath), file]));
|
|
81
|
+
const replaced = new Set();
|
|
82
|
+
const proposed = files.map((file) => {
|
|
83
|
+
const key = portableSourcePathKey(file.relativePath);
|
|
84
|
+
const replacement = replacements.get(key);
|
|
85
|
+
if (replacement === undefined)
|
|
86
|
+
return file;
|
|
87
|
+
const displayPath = `mod:${replacement.relativePath}`;
|
|
88
|
+
if (file.rootKind !== 'mod')
|
|
89
|
+
return { ...file, shadowedBy: displayPath };
|
|
90
|
+
replaced.add(key);
|
|
91
|
+
const { shadowedBy: _shadowedBy, ...activeFile } = file;
|
|
92
|
+
void _shadowedBy;
|
|
93
|
+
return {
|
|
94
|
+
...activeFile,
|
|
95
|
+
absolutePath: replacement.absolutePath,
|
|
96
|
+
displayPath,
|
|
97
|
+
relativePath: replacement.relativePath,
|
|
98
|
+
bytes: replacement.bytes,
|
|
99
|
+
size: replacement.bytes.length,
|
|
100
|
+
modifiedMs: 0,
|
|
101
|
+
sha256: sha256Bytes(replacement.bytes),
|
|
102
|
+
};
|
|
103
|
+
});
|
|
104
|
+
for (const replacement of prepared) {
|
|
105
|
+
const key = portableSourcePathKey(replacement.relativePath);
|
|
106
|
+
if (replaced.has(key))
|
|
107
|
+
continue;
|
|
108
|
+
proposed.push({
|
|
109
|
+
absolutePath: replacement.absolutePath,
|
|
110
|
+
displayPath: `mod:${replacement.relativePath}`,
|
|
111
|
+
relativePath: replacement.relativePath,
|
|
112
|
+
rootKind: 'mod',
|
|
113
|
+
loadOrder: replacement.loadOrder,
|
|
114
|
+
size: replacement.bytes.length,
|
|
115
|
+
modifiedMs: 0,
|
|
116
|
+
sha256: sha256Bytes(replacement.bytes),
|
|
117
|
+
bytes: replacement.bytes,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
return mergeScannedFiles(proposed);
|
|
121
|
+
}
|
|
39
122
|
function under(roots, suffixes) {
|
|
40
123
|
return roots.flatMap((root) => {
|
|
41
124
|
const normalized = normalizeConfiguredRoot(root);
|
|
@@ -523,16 +606,16 @@ export class ScriptedGuiStudio {
|
|
|
523
606
|
validation: completeValidation,
|
|
524
607
|
};
|
|
525
608
|
}
|
|
526
|
-
planHelpers(input) {
|
|
527
|
-
return planGuiHelperCompilation(this.transactions, input);
|
|
528
|
-
}
|
|
529
609
|
async planSource(input) {
|
|
530
610
|
input.signal?.throwIfAborted();
|
|
531
|
-
|
|
532
|
-
|
|
611
|
+
const workspace = this.resolver.get(input.workspaceId, input.principal);
|
|
612
|
+
guiTextPackageFileKind(workspace, input.relativePath, true);
|
|
533
613
|
if ((input.source === undefined) === (input.patches === undefined))
|
|
534
614
|
throw new ServiceError('GUI_SOURCE_MODE_INVALID', 'Provide either a new source file or targeted source patches');
|
|
535
|
-
|
|
615
|
+
if (input.patches !== undefined && (input.additionalFiles?.length ?? 0) > 0) {
|
|
616
|
+
throw new ServiceError('GUI_TEXT_PACKAGE_PATCH_MODE_INVALID', 'Additional GUI text-package files are accepted only with whole-source or helper rewrites');
|
|
617
|
+
}
|
|
618
|
+
let prepared;
|
|
536
619
|
if (input.patches !== undefined) {
|
|
537
620
|
if (input.expectedSourceHash === undefined ||
|
|
538
621
|
!/^[a-f0-9]{64}$/u.test(input.expectedSourceHash))
|
|
@@ -555,70 +638,110 @@ export class ScriptedGuiStudio {
|
|
|
555
638
|
}
|
|
556
639
|
}
|
|
557
640
|
assertGuiSourcePatchesSafe(document, input.patches);
|
|
558
|
-
proposedBytes = applyReplacements(document, input.patches);
|
|
641
|
+
const proposedBytes = applyReplacements(document, input.patches);
|
|
642
|
+
prepared = [
|
|
643
|
+
{
|
|
644
|
+
relativePath: input.relativePath,
|
|
645
|
+
kind: 'gui',
|
|
646
|
+
bytes: proposedBytes,
|
|
647
|
+
absolutePath: existing.path,
|
|
648
|
+
loadOrder: existing.root.loadOrder,
|
|
649
|
+
},
|
|
650
|
+
];
|
|
559
651
|
}
|
|
560
652
|
else {
|
|
561
|
-
try {
|
|
562
|
-
await this.resolver.resolvePath(input.workspaceId, input.relativePath, 'read', ['mod'], input.principal);
|
|
563
|
-
throw new ServiceError('GUI_UNSAFE_WHOLE_FILE_REWRITE', 'Existing GUI files may be changed only with source-linked targeted patches');
|
|
564
|
-
}
|
|
565
|
-
catch (error) {
|
|
566
|
-
if (error instanceof ServiceError && error.code !== 'PATH_NOT_FOUND_IN_ROOTS')
|
|
567
|
-
throw error;
|
|
568
|
-
}
|
|
569
653
|
if (input.source === undefined)
|
|
570
654
|
throw new ServiceError('GUI_SOURCE_REQUIRED', 'A new GUI source file requires source text');
|
|
571
|
-
|
|
655
|
+
const requests = [
|
|
656
|
+
{ relativePath: input.relativePath, source: input.source, main: true },
|
|
657
|
+
...(input.additionalFiles ?? []).map((file) => ({ ...file, main: false })),
|
|
658
|
+
];
|
|
659
|
+
if (requests.length > GUI_TEXT_PACKAGE_MAX_FILES) {
|
|
660
|
+
throw new ServiceError('GUI_TEXT_PACKAGE_FILE_BUDGET_BLOCKED', 'GUI text package exceeds the fixed file-count ceiling', { files: requests.length, maximumFiles: GUI_TEXT_PACKAGE_MAX_FILES });
|
|
661
|
+
}
|
|
662
|
+
const seen = new Map();
|
|
663
|
+
const classified = requests.map((request) => {
|
|
664
|
+
const key = portableSourcePathKey(request.relativePath);
|
|
665
|
+
const duplicate = seen.get(key);
|
|
666
|
+
if (duplicate !== undefined) {
|
|
667
|
+
throw new ServiceError('GUI_TEXT_PACKAGE_DUPLICATE_PATH', 'GUI text-package paths must be unique under portable path comparison', { first: duplicate, duplicate: request.relativePath });
|
|
668
|
+
}
|
|
669
|
+
seen.set(key, request.relativePath);
|
|
670
|
+
return {
|
|
671
|
+
...request,
|
|
672
|
+
kind: guiTextPackageFileKind(workspace, request.relativePath, request.main),
|
|
673
|
+
};
|
|
674
|
+
});
|
|
675
|
+
classified.sort((left, right) => compareCodeUnits(left.relativePath, right.relativePath));
|
|
676
|
+
prepared = [];
|
|
677
|
+
let totalBytes = 0;
|
|
678
|
+
for (const request of classified) {
|
|
679
|
+
input.signal?.throwIfAborted();
|
|
680
|
+
const resolved = await this.resolver.resolvePath(input.workspaceId, request.relativePath, 'write', ['mod'], input.principal);
|
|
681
|
+
let existingBytes;
|
|
682
|
+
try {
|
|
683
|
+
existingBytes = await readFile(resolved.path);
|
|
684
|
+
}
|
|
685
|
+
catch (error) {
|
|
686
|
+
if (error.code !== 'ENOENT')
|
|
687
|
+
throw error;
|
|
688
|
+
}
|
|
689
|
+
const encoding = request.kind === 'localisation'
|
|
690
|
+
? 'utf8-bom'
|
|
691
|
+
: existingBytes === undefined
|
|
692
|
+
? 'utf8'
|
|
693
|
+
: decodeSource(existingBytes).encoding;
|
|
694
|
+
const source = request.source.startsWith('\ufeff')
|
|
695
|
+
? request.source.slice(1)
|
|
696
|
+
: request.source;
|
|
697
|
+
const bytes = encodeSource(source, encoding);
|
|
698
|
+
if (bytes.length > SOURCE_MAX_BYTES) {
|
|
699
|
+
throw new ServiceError('GUI_TEXT_PACKAGE_FILE_BYTE_BUDGET_BLOCKED', 'A GUI text-package file exceeds the Clausewitz parser byte ceiling', {
|
|
700
|
+
relativePath: request.relativePath,
|
|
701
|
+
bytes: bytes.length,
|
|
702
|
+
maximumBytes: SOURCE_MAX_BYTES,
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
totalBytes += bytes.length;
|
|
706
|
+
if (!Number.isSafeInteger(totalBytes) || totalBytes > GUI_TEXT_PACKAGE_MAX_BYTES) {
|
|
707
|
+
throw new ServiceError('GUI_TEXT_PACKAGE_BYTE_BUDGET_BLOCKED', 'GUI text package exceeds the fixed aggregate byte ceiling', { bytes: totalBytes, maximumBytes: GUI_TEXT_PACKAGE_MAX_BYTES });
|
|
708
|
+
}
|
|
709
|
+
prepared.push({
|
|
710
|
+
relativePath: request.relativePath,
|
|
711
|
+
kind: request.kind,
|
|
712
|
+
bytes,
|
|
713
|
+
absolutePath: resolved.path,
|
|
714
|
+
loadOrder: resolved.root.loadOrder,
|
|
715
|
+
});
|
|
716
|
+
}
|
|
572
717
|
}
|
|
573
|
-
const
|
|
574
|
-
|
|
575
|
-
|
|
718
|
+
const proposedSourceDiagnostics = prepared.flatMap((file) => parseGuiTextPackageFile(file).diagnostics);
|
|
719
|
+
const blockingProposedSourceDiagnostics = proposedSourceDiagnostics.filter(({ severity }) => severity === 'error' || severity === 'blocker');
|
|
720
|
+
if (blockingProposedSourceDiagnostics.length > 0)
|
|
721
|
+
throw new ServiceError('GUI_PROPOSED_SOURCE_INVALID', 'Proposed GUI text package contains blocking parser diagnostics', {
|
|
722
|
+
diagnostics: blockingProposedSourceDiagnostics.slice(0, 100),
|
|
723
|
+
diagnosticCount: blockingProposedSourceDiagnostics.length,
|
|
724
|
+
});
|
|
576
725
|
if ((input.windowName === undefined) !== (input.scenario === undefined))
|
|
577
726
|
throw new Error('GUI visual preflight requires both windowName and scenario.');
|
|
578
|
-
const
|
|
579
|
-
const scanned = input.windowName === undefined
|
|
727
|
+
const initiallyScanned = input.windowName === undefined
|
|
580
728
|
? await this.scan(input.workspaceId, input.principal, input.signal)
|
|
581
729
|
: await this.scanWindow(input.workspaceId, input.windowName, input.principal, input.signal, [parsePreviewScenario(input.scenario).language]);
|
|
582
|
-
const
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
730
|
+
const exactTargets = await this.scanner.scan(workspace, {
|
|
731
|
+
patterns: prepared.map(({ relativePath }) => relativePath),
|
|
732
|
+
...(input.signal === undefined ? {} : { signal: input.signal }),
|
|
733
|
+
});
|
|
734
|
+
const baselineFiles = mergeScannedFiles(initiallyScanned.files, exactTargets);
|
|
735
|
+
const baseline = {
|
|
736
|
+
files: baselineFiles,
|
|
737
|
+
graph: buildGuiSourceGraph(baselineFiles, this.engine.indexFiles(baselineFiles)),
|
|
738
|
+
};
|
|
587
739
|
const preflightDiagnostics = [];
|
|
588
740
|
const preflightChecks = [];
|
|
589
741
|
const preflightArtifacts = [];
|
|
590
|
-
let dependencyFiles =
|
|
742
|
+
let dependencyFiles = baseline.files;
|
|
591
743
|
if (input.windowName !== undefined && input.scenario !== undefined) {
|
|
592
|
-
|
|
593
|
-
const displayPath = `mod:${normalizedPath}`;
|
|
594
|
-
const replacesModFile = scanned.files.some(({ rootKind, relativePath }) => rootKind === 'mod' && relativePath === normalizedPath);
|
|
595
|
-
let proposedFiles = scanned.files.map((file) => {
|
|
596
|
-
if (file.rootKind === 'mod' && file.relativePath === normalizedPath) {
|
|
597
|
-
return {
|
|
598
|
-
...file,
|
|
599
|
-
bytes: proposedBytes,
|
|
600
|
-
size: proposedBytes.length,
|
|
601
|
-
modifiedMs: 0,
|
|
602
|
-
sha256: sha256Bytes(proposedBytes),
|
|
603
|
-
};
|
|
604
|
-
}
|
|
605
|
-
if (file.relativePath === normalizedPath)
|
|
606
|
-
return { ...file, shadowedBy: displayPath };
|
|
607
|
-
return file;
|
|
608
|
-
});
|
|
609
|
-
if (!replacesModFile) {
|
|
610
|
-
proposedFiles.push({
|
|
611
|
-
absolutePath: resolved.path,
|
|
612
|
-
displayPath,
|
|
613
|
-
relativePath: normalizedPath,
|
|
614
|
-
rootKind: 'mod',
|
|
615
|
-
loadOrder: workspace.dependencyRoots.length + 1,
|
|
616
|
-
size: proposedBytes.length,
|
|
617
|
-
modifiedMs: 0,
|
|
618
|
-
sha256: sha256Bytes(proposedBytes),
|
|
619
|
-
bytes: proposedBytes,
|
|
620
|
-
});
|
|
621
|
-
}
|
|
744
|
+
let proposedFiles = overlayGuiTextPackageFiles(baseline.files, prepared);
|
|
622
745
|
const scenario = parsePreviewScenario(input.scenario);
|
|
623
746
|
const renderBudget = new RenderBudget();
|
|
624
747
|
let proposedGraph = buildGuiSourceGraph(proposedFiles, this.engine.indexFiles(proposedFiles));
|
|
@@ -653,7 +776,7 @@ export class ScriptedGuiStudio {
|
|
|
653
776
|
});
|
|
654
777
|
const proposedFontPages = mergeScannedFiles(exactProposedFontPages, fallbackProposedFontPages);
|
|
655
778
|
input.signal?.throwIfAborted();
|
|
656
|
-
dependencyFiles = mergeScannedFiles(
|
|
779
|
+
dependencyFiles = mergeScannedFiles(baseline.files, proposedAssets, proposedFontPages);
|
|
657
780
|
proposedFiles = mergeScannedFiles(proposedFiles, proposedAssets, proposedFontPages);
|
|
658
781
|
proposedGraph = buildGuiSourceGraph(proposedFiles, this.engine.indexFiles(proposedFiles));
|
|
659
782
|
const proposedCatalog = new GuiAssetCatalog(proposedGraph, proposedFiles, renderBudget);
|
|
@@ -671,9 +794,9 @@ export class ScriptedGuiStudio {
|
|
|
671
794
|
? 'Proposed GUI renders and validates offline'
|
|
672
795
|
: 'Proposed GUI has blocking offline render or validation findings',
|
|
673
796
|
});
|
|
674
|
-
const baselineScene = await buildGuiScene(
|
|
797
|
+
const baselineScene = await buildGuiScene(baseline.graph, baseline.files, input.windowName, scenario, new GuiAssetCatalog(baseline.graph, baseline.files, renderBudget));
|
|
675
798
|
let baselinePng;
|
|
676
|
-
if (
|
|
799
|
+
if (baseline.graph.elements.some(({ name }) => name === input.windowName)) {
|
|
677
800
|
baselinePng = fullImage(await renderGuiScene(baselineScene, ['full'], input.signal, renderBudget)).png;
|
|
678
801
|
}
|
|
679
802
|
else {
|
|
@@ -699,13 +822,16 @@ export class ScriptedGuiStudio {
|
|
|
699
822
|
}
|
|
700
823
|
const comparison = await compareGuiImages(baselinePng, proposedImage.png, renderBudget, input.signal);
|
|
701
824
|
const slug = safeSlug(input.windowName);
|
|
702
|
-
const metadata = {
|
|
825
|
+
const metadata = {
|
|
826
|
+
relativePath: input.relativePath,
|
|
827
|
+
packageFiles: prepared.map(({ relativePath }) => relativePath),
|
|
828
|
+
};
|
|
703
829
|
const writes = [
|
|
704
830
|
{
|
|
705
831
|
name: `${slug}-before.png`,
|
|
706
832
|
mimeType: 'image/png',
|
|
707
833
|
content: baselinePng,
|
|
708
|
-
provenance: guiArtifactProvenance(
|
|
834
|
+
provenance: guiArtifactProvenance(baseline.graph, 'gui-before-render', baselineScene, [baselineScene], metadata),
|
|
709
835
|
},
|
|
710
836
|
{
|
|
711
837
|
name: `${slug}-proposed.png`,
|
|
@@ -742,7 +868,10 @@ export class ScriptedGuiStudio {
|
|
|
742
868
|
}
|
|
743
869
|
const operationId = deterministicId('gui_source_change', {
|
|
744
870
|
relativePath: input.relativePath,
|
|
745
|
-
|
|
871
|
+
files: prepared.map(({ relativePath, bytes }) => ({
|
|
872
|
+
relativePath,
|
|
873
|
+
sourceHash: sha256Bytes(bytes),
|
|
874
|
+
})),
|
|
746
875
|
patchCount: input.patches?.length ?? 0,
|
|
747
876
|
});
|
|
748
877
|
return this.transactions.plan({
|
|
@@ -752,52 +881,67 @@ export class ScriptedGuiStudio {
|
|
|
752
881
|
operations: [
|
|
753
882
|
{
|
|
754
883
|
id: operationId,
|
|
755
|
-
kind: 'replace-gui-source',
|
|
756
|
-
summary:
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
operationIds: [operationId],
|
|
765
|
-
mediaType: 'text/plain',
|
|
884
|
+
kind: prepared.length === 1 ? 'replace-gui-source' : 'replace-gui-text-package',
|
|
885
|
+
summary: prepared.length === 1
|
|
886
|
+
? `Plan GUI source ${input.relativePath}`
|
|
887
|
+
: `Plan ${prepared.length}-file GUI text package rooted at ${input.relativePath}`,
|
|
888
|
+
data: {
|
|
889
|
+
relativePath: input.relativePath,
|
|
890
|
+
fileCount: prepared.length,
|
|
891
|
+
files: prepared.map(({ relativePath, kind }) => ({ relativePath, kind })),
|
|
892
|
+
},
|
|
766
893
|
},
|
|
767
894
|
],
|
|
895
|
+
changes: prepared.map((file) => ({
|
|
896
|
+
relativePath: file.relativePath,
|
|
897
|
+
content: file.bytes,
|
|
898
|
+
operationIds: [operationId],
|
|
899
|
+
mediaType: 'text/plain',
|
|
900
|
+
})),
|
|
768
901
|
readDependencies: readDependenciesFromScannedFiles(dependencyFiles),
|
|
769
902
|
artifacts: preflightArtifacts,
|
|
770
903
|
diagnostics: preflightDiagnostics,
|
|
771
|
-
validate: (proposed) => {
|
|
772
|
-
const
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
{
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
});
|
|
794
|
-
|
|
795
|
-
|
|
904
|
+
validate: (proposed, signal) => {
|
|
905
|
+
const diagnostics = [];
|
|
906
|
+
let present = true;
|
|
907
|
+
let syntaxPassed = true;
|
|
908
|
+
for (const file of prepared) {
|
|
909
|
+
signal?.throwIfAborted();
|
|
910
|
+
const proposedSource = proposed.has(file.relativePath)
|
|
911
|
+
? proposed.get(file.relativePath)
|
|
912
|
+
: file.bytes;
|
|
913
|
+
if (proposedSource === null || proposedSource === undefined) {
|
|
914
|
+
present = false;
|
|
915
|
+
syntaxPassed = false;
|
|
916
|
+
diagnostics.push({
|
|
917
|
+
code: 'GUI_PROPOSED_SOURCE_MISSING',
|
|
918
|
+
severity: 'blocker',
|
|
919
|
+
category: 'validation',
|
|
920
|
+
message: `Proposed source is missing ${file.relativePath}`,
|
|
921
|
+
operationId,
|
|
922
|
+
});
|
|
923
|
+
continue;
|
|
924
|
+
}
|
|
925
|
+
const document = parseGuiTextPackageFile({ ...file, bytes: proposedSource });
|
|
926
|
+
const blocking = document.diagnostics.filter(({ severity }) => severity === 'error' || severity === 'blocker');
|
|
927
|
+
if (blocking.length > 0)
|
|
928
|
+
syntaxPassed = false;
|
|
929
|
+
diagnostics.push(...blocking.map((diagnostic) => ({ ...diagnostic, operationId })));
|
|
930
|
+
}
|
|
796
931
|
return Promise.resolve({
|
|
797
|
-
diagnostics
|
|
932
|
+
diagnostics,
|
|
798
933
|
checks: [
|
|
799
934
|
...preflightChecks,
|
|
800
|
-
{
|
|
935
|
+
{
|
|
936
|
+
id: 'gui-package-files-present',
|
|
937
|
+
passed: present,
|
|
938
|
+
message: 'Every requested GUI text-package file is present.',
|
|
939
|
+
},
|
|
940
|
+
{
|
|
941
|
+
id: 'gui-package-source-syntax',
|
|
942
|
+
passed: syntaxPassed,
|
|
943
|
+
message: 'Every requested GUI text-package file parses safely for its source type.',
|
|
944
|
+
},
|
|
801
945
|
],
|
|
802
946
|
});
|
|
803
947
|
},
|
|
@@ -828,4 +972,3 @@ export class ScriptedGuiStudio {
|
|
|
828
972
|
});
|
|
829
973
|
}
|
|
830
974
|
}
|
|
831
|
-
//# sourceMappingURL=studio.js.map
|
|
@@ -7,7 +7,8 @@ export const MAP_MASK_CELL_LIMIT = 20_000_000;
|
|
|
7
7
|
* below 4 MiB instead of allocating millions of coordinate/color objects.
|
|
8
8
|
*/
|
|
9
9
|
export const MAP_SELECTED_PIXEL_LIMIT = 1_000_000;
|
|
10
|
+
/** Maximum provinces one exact row-run inspection may export in one request. */
|
|
11
|
+
export const MAP_PROVINCE_GEOMETRY_SELECTOR_LIMIT = 32;
|
|
10
12
|
/** Maximum polygon cell/edge comparisons before rasterization is refused. */
|
|
11
13
|
export const MAP_POLYGON_WORK_LIMIT = 50_000_000;
|
|
12
14
|
export const MAP_SELECTED_OFFSET_BYTES = Uint32Array.BYTES_PER_ELEMENT;
|
|
13
|
-
//# sourceMappingURL=limits.js.map
|