hoi4-agent-tools 0.0.0-bootstrap.1 → 0.1.3
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 +50 -0
- package/LICENSE +201 -0
- package/README.md +140 -2
- package/SECURITY.md +17 -0
- package/dist/bin/http.d.ts +3 -0
- package/dist/bin/http.d.ts.map +1 -0
- package/dist/bin/http.js +27 -0
- package/dist/bin/http.js.map +1 -0
- package/dist/bin/setup.d.ts +3 -0
- package/dist/bin/setup.d.ts.map +1 -0
- package/dist/bin/setup.js +188 -0
- package/dist/bin/setup.js.map +1 -0
- package/dist/bin/stdio.d.ts +3 -0
- package/dist/bin/stdio.d.ts.map +1 -0
- package/dist/bin/stdio.js +36 -0
- package/dist/bin/stdio.js.map +1 -0
- package/dist/hoi4_agent_tools/core/artifacts.d.ts +117 -0
- package/dist/hoi4_agent_tools/core/artifacts.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/core/artifacts.js +1047 -0
- package/dist/hoi4_agent_tools/core/artifacts.js.map +1 -0
- package/dist/hoi4_agent_tools/core/canonical.d.ts +13 -0
- package/dist/hoi4_agent_tools/core/canonical.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/core/canonical.js +41 -0
- package/dist/hoi4_agent_tools/core/canonical.js.map +1 -0
- package/dist/hoi4_agent_tools/core/configuration.d.ts +137 -0
- package/dist/hoi4_agent_tools/core/configuration.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/core/configuration.js +383 -0
- package/dist/hoi4_agent_tools/core/configuration.js.map +1 -0
- package/dist/hoi4_agent_tools/core/diagnostic-collector.d.ts +18 -0
- package/dist/hoi4_agent_tools/core/diagnostic-collector.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/core/diagnostic-collector.js +45 -0
- package/dist/hoi4_agent_tools/core/diagnostic-collector.js.map +1 -0
- package/dist/hoi4_agent_tools/core/diagnostics.d.ts +26 -0
- package/dist/hoi4_agent_tools/core/diagnostics.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/core/diagnostics.js +25 -0
- package/dist/hoi4_agent_tools/core/diagnostics.js.map +1 -0
- package/dist/hoi4_agent_tools/core/diff.d.ts +22 -0
- package/dist/hoi4_agent_tools/core/diff.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/core/diff.js +93 -0
- package/dist/hoi4_agent_tools/core/diff.js.map +1 -0
- package/dist/hoi4_agent_tools/core/engine.d.ts +56 -0
- package/dist/hoi4_agent_tools/core/engine.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/core/engine.js +319 -0
- package/dist/hoi4_agent_tools/core/engine.js.map +1 -0
- package/dist/hoi4_agent_tools/core/image-diff.d.ts +14 -0
- package/dist/hoi4_agent_tools/core/image-diff.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/core/image-diff.js +121 -0
- package/dist/hoi4_agent_tools/core/image-diff.js.map +1 -0
- package/dist/hoi4_agent_tools/core/index.d.ts +64 -0
- package/dist/hoi4_agent_tools/core/index.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/core/index.js +963 -0
- package/dist/hoi4_agent_tools/core/index.js.map +1 -0
- package/dist/hoi4_agent_tools/core/index.public.d.ts +16 -0
- package/dist/hoi4_agent_tools/core/index.public.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/core/index.public.js +16 -0
- package/dist/hoi4_agent_tools/core/index.public.js.map +1 -0
- package/dist/hoi4_agent_tools/core/render-budget.d.ts +51 -0
- package/dist/hoi4_agent_tools/core/render-budget.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/core/render-budget.js +109 -0
- package/dist/hoi4_agent_tools/core/render-budget.js.map +1 -0
- package/dist/hoi4_agent_tools/core/result.d.ts +45 -0
- package/dist/hoi4_agent_tools/core/result.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/core/result.js +26 -0
- package/dist/hoi4_agent_tools/core/result.js.map +1 -0
- package/dist/hoi4_agent_tools/core/scanner.d.ts +28 -0
- package/dist/hoi4_agent_tools/core/scanner.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/core/scanner.js +136 -0
- package/dist/hoi4_agent_tools/core/scanner.js.map +1 -0
- package/dist/hoi4_agent_tools/core/server-state.d.ts +31 -0
- package/dist/hoi4_agent_tools/core/server-state.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/core/server-state.js +413 -0
- package/dist/hoi4_agent_tools/core/server-state.js.map +1 -0
- package/dist/hoi4_agent_tools/core/source/encoding.d.ts +10 -0
- package/dist/hoi4_agent_tools/core/source/encoding.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/core/source/encoding.js +54 -0
- package/dist/hoi4_agent_tools/core/source/encoding.js.map +1 -0
- package/dist/hoi4_agent_tools/core/source/index.d.ts +7 -0
- package/dist/hoi4_agent_tools/core/source/index.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/core/source/index.js +7 -0
- package/dist/hoi4_agent_tools/core/source/index.js.map +1 -0
- package/dist/hoi4_agent_tools/core/source/lexer.d.ts +30 -0
- package/dist/hoi4_agent_tools/core/source/lexer.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/core/source/lexer.js +266 -0
- package/dist/hoi4_agent_tools/core/source/lexer.js.map +1 -0
- package/dist/hoi4_agent_tools/core/source/limits.d.ts +21 -0
- package/dist/hoi4_agent_tools/core/source/limits.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/core/source/limits.js +49 -0
- package/dist/hoi4_agent_tools/core/source/limits.js.map +1 -0
- package/dist/hoi4_agent_tools/core/source/localisation.d.ts +20 -0
- package/dist/hoi4_agent_tools/core/source/localisation.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/core/source/localisation.js +163 -0
- package/dist/hoi4_agent_tools/core/source/localisation.js.map +1 -0
- package/dist/hoi4_agent_tools/core/source/parser.d.ts +44 -0
- package/dist/hoi4_agent_tools/core/source/parser.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/core/source/parser.js +334 -0
- package/dist/hoi4_agent_tools/core/source/parser.js.map +1 -0
- package/dist/hoi4_agent_tools/core/source/rewrite.d.ts +10 -0
- package/dist/hoi4_agent_tools/core/source/rewrite.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/core/source/rewrite.js +28 -0
- package/dist/hoi4_agent_tools/core/source/rewrite.js.map +1 -0
- package/dist/hoi4_agent_tools/core/svg-text.d.ts +34 -0
- package/dist/hoi4_agent_tools/core/svg-text.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/core/svg-text.js +127 -0
- package/dist/hoi4_agent_tools/core/svg-text.js.map +1 -0
- package/dist/hoi4_agent_tools/core/transaction-limits.d.ts +9 -0
- package/dist/hoi4_agent_tools/core/transaction-limits.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/core/transaction-limits.js +9 -0
- package/dist/hoi4_agent_tools/core/transaction-limits.js.map +1 -0
- package/dist/hoi4_agent_tools/core/transactions.d.ts +162 -0
- package/dist/hoi4_agent_tools/core/transactions.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/core/transactions.js +1181 -0
- package/dist/hoi4_agent_tools/core/transactions.js.map +1 -0
- package/dist/hoi4_agent_tools/core/workspace.d.ts +68 -0
- package/dist/hoi4_agent_tools/core/workspace.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/core/workspace.js +794 -0
- package/dist/hoi4_agent_tools/core/workspace.js.map +1 -0
- package/dist/hoi4_agent_tools/focus/compiler.d.ts +9 -0
- package/dist/hoi4_agent_tools/focus/compiler.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/focus/compiler.js +273 -0
- package/dist/hoi4_agent_tools/focus/compiler.js.map +1 -0
- package/dist/hoi4_agent_tools/focus/continuous-render.d.ts +32 -0
- package/dist/hoi4_agent_tools/focus/continuous-render.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/focus/continuous-render.js +179 -0
- package/dist/hoi4_agent_tools/focus/continuous-render.js.map +1 -0
- package/dist/hoi4_agent_tools/focus/drift.d.ts +22 -0
- package/dist/hoi4_agent_tools/focus/drift.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/focus/drift.js +124 -0
- package/dist/hoi4_agent_tools/focus/drift.js.map +1 -0
- package/dist/hoi4_agent_tools/focus/geometry.d.ts +17 -0
- package/dist/hoi4_agent_tools/focus/geometry.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/focus/geometry.js +35 -0
- package/dist/hoi4_agent_tools/focus/geometry.js.map +1 -0
- package/dist/hoi4_agent_tools/focus/importer.d.ts +9 -0
- package/dist/hoi4_agent_tools/focus/importer.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/focus/importer.js +732 -0
- package/dist/hoi4_agent_tools/focus/importer.js.map +1 -0
- package/dist/hoi4_agent_tools/focus/index.d.ts +14 -0
- package/dist/hoi4_agent_tools/focus/index.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/focus/index.js +14 -0
- package/dist/hoi4_agent_tools/focus/index.js.map +1 -0
- package/dist/hoi4_agent_tools/focus/layout.d.ts +5 -0
- package/dist/hoi4_agent_tools/focus/layout.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/focus/layout.js +653 -0
- package/dist/hoi4_agent_tools/focus/layout.js.map +1 -0
- package/dist/hoi4_agent_tools/focus/limits.d.ts +9 -0
- package/dist/hoi4_agent_tools/focus/limits.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/focus/limits.js +9 -0
- package/dist/hoi4_agent_tools/focus/limits.js.map +1 -0
- package/dist/hoi4_agent_tools/focus/lint.d.ts +14 -0
- package/dist/hoi4_agent_tools/focus/lint.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/focus/lint.js +839 -0
- package/dist/hoi4_agent_tools/focus/lint.js.map +1 -0
- package/dist/hoi4_agent_tools/focus/model.d.ts +303 -0
- package/dist/hoi4_agent_tools/focus/model.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/focus/model.js +20 -0
- package/dist/hoi4_agent_tools/focus/model.js.map +1 -0
- package/dist/hoi4_agent_tools/focus/native-effects.d.ts +9 -0
- package/dist/hoi4_agent_tools/focus/native-effects.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/focus/native-effects.js +563 -0
- package/dist/hoi4_agent_tools/focus/native-effects.js.map +1 -0
- package/dist/hoi4_agent_tools/focus/planning.d.ts +15 -0
- package/dist/hoi4_agent_tools/focus/planning.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/focus/planning.js +241 -0
- package/dist/hoi4_agent_tools/focus/planning.js.map +1 -0
- package/dist/hoi4_agent_tools/focus/presentation.d.ts +24 -0
- package/dist/hoi4_agent_tools/focus/presentation.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/focus/presentation.js +204 -0
- package/dist/hoi4_agent_tools/focus/presentation.js.map +1 -0
- package/dist/hoi4_agent_tools/focus/render.d.ts +35 -0
- package/dist/hoi4_agent_tools/focus/render.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/focus/render.js +491 -0
- package/dist/hoi4_agent_tools/focus/render.js.map +1 -0
- package/dist/hoi4_agent_tools/focus/service.d.ts +82 -0
- package/dist/hoi4_agent_tools/focus/service.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/focus/service.js +492 -0
- package/dist/hoi4_agent_tools/focus/service.js.map +1 -0
- package/dist/hoi4_agent_tools/focus/source-update.d.ts +6 -0
- package/dist/hoi4_agent_tools/focus/source-update.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/focus/source-update.js +328 -0
- package/dist/hoi4_agent_tools/focus/source-update.js.map +1 -0
- package/dist/hoi4_agent_tools/gui/animation-manifest.d.ts +37 -0
- package/dist/hoi4_agent_tools/gui/animation-manifest.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/gui/animation-manifest.js +66 -0
- package/dist/hoi4_agent_tools/gui/animation-manifest.js.map +1 -0
- package/dist/hoi4_agent_tools/gui/assets.d.ts +71 -0
- package/dist/hoi4_agent_tools/gui/assets.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/gui/assets.js +629 -0
- package/dist/hoi4_agent_tools/gui/assets.js.map +1 -0
- package/dist/hoi4_agent_tools/gui/dds.d.ts +17 -0
- package/dist/hoi4_agent_tools/gui/dds.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/gui/dds.js +245 -0
- package/dist/hoi4_agent_tools/gui/dds.js.map +1 -0
- package/dist/hoi4_agent_tools/gui/helpers.d.ts +101 -0
- package/dist/hoi4_agent_tools/gui/helpers.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/gui/helpers.js +1072 -0
- package/dist/hoi4_agent_tools/gui/helpers.js.map +1 -0
- package/dist/hoi4_agent_tools/gui/index.d.ts +15 -0
- package/dist/hoi4_agent_tools/gui/index.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/gui/index.js +15 -0
- package/dist/hoi4_agent_tools/gui/index.js.map +1 -0
- package/dist/hoi4_agent_tools/gui/layout.d.ts +6 -0
- package/dist/hoi4_agent_tools/gui/layout.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/gui/layout.js +753 -0
- package/dist/hoi4_agent_tools/gui/layout.js.map +1 -0
- package/dist/hoi4_agent_tools/gui/limits.d.ts +25 -0
- package/dist/hoi4_agent_tools/gui/limits.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/gui/limits.js +27 -0
- package/dist/hoi4_agent_tools/gui/limits.js.map +1 -0
- package/dist/hoi4_agent_tools/gui/renderer.d.ts +18 -0
- package/dist/hoi4_agent_tools/gui/renderer.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/gui/renderer.js +388 -0
- package/dist/hoi4_agent_tools/gui/renderer.js.map +1 -0
- package/dist/hoi4_agent_tools/gui/scenario.d.ts +66 -0
- package/dist/hoi4_agent_tools/gui/scenario.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/gui/scenario.js +191 -0
- package/dist/hoi4_agent_tools/gui/scenario.js.map +1 -0
- package/dist/hoi4_agent_tools/gui/source-graph.d.ts +7 -0
- package/dist/hoi4_agent_tools/gui/source-graph.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/gui/source-graph.js +1074 -0
- package/dist/hoi4_agent_tools/gui/source-graph.js.map +1 -0
- package/dist/hoi4_agent_tools/gui/source-patch.d.ts +13 -0
- package/dist/hoi4_agent_tools/gui/source-patch.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/gui/source-patch.js +90 -0
- package/dist/hoi4_agent_tools/gui/source-patch.js.map +1 -0
- package/dist/hoi4_agent_tools/gui/studio.d.ts +86 -0
- package/dist/hoi4_agent_tools/gui/studio.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/gui/studio.js +830 -0
- package/dist/hoi4_agent_tools/gui/studio.js.map +1 -0
- package/dist/hoi4_agent_tools/gui/tga.d.ts +16 -0
- package/dist/hoi4_agent_tools/gui/tga.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/gui/tga.js +157 -0
- package/dist/hoi4_agent_tools/gui/tga.js.map +1 -0
- package/dist/hoi4_agent_tools/gui/types.d.ts +322 -0
- package/dist/hoi4_agent_tools/gui/types.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/gui/types.js +19 -0
- package/dist/hoi4_agent_tools/gui/types.js.map +1 -0
- package/dist/hoi4_agent_tools/gui/validators.d.ts +8 -0
- package/dist/hoi4_agent_tools/gui/validators.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/gui/validators.js +951 -0
- package/dist/hoi4_agent_tools/gui/validators.js.map +1 -0
- package/dist/hoi4_agent_tools/map/bmp.d.ts +62 -0
- package/dist/hoi4_agent_tools/map/bmp.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/map/bmp.js +363 -0
- package/dist/hoi4_agent_tools/map/bmp.js.map +1 -0
- package/dist/hoi4_agent_tools/map/diagnostic-limit.d.ts +5 -0
- package/dist/hoi4_agent_tools/map/diagnostic-limit.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/map/diagnostic-limit.js +21 -0
- package/dist/hoi4_agent_tools/map/diagnostic-limit.js.map +1 -0
- package/dist/hoi4_agent_tools/map/index.d.ts +8 -0
- package/dist/hoi4_agent_tools/map/index.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/map/index.js +8 -0
- package/dist/hoi4_agent_tools/map/index.js.map +1 -0
- package/dist/hoi4_agent_tools/map/limits.d.ts +13 -0
- package/dist/hoi4_agent_tools/map/limits.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/map/limits.js +13 -0
- package/dist/hoi4_agent_tools/map/limits.js.map +1 -0
- package/dist/hoi4_agent_tools/map/model.d.ts +269 -0
- package/dist/hoi4_agent_tools/map/model.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/map/model.js +1114 -0
- package/dist/hoi4_agent_tools/map/model.js.map +1 -0
- package/dist/hoi4_agent_tools/map/operations.d.ts +401 -0
- package/dist/hoi4_agent_tools/map/operations.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/map/operations.js +2717 -0
- package/dist/hoi4_agent_tools/map/operations.js.map +1 -0
- package/dist/hoi4_agent_tools/map/render.d.ts +90 -0
- package/dist/hoi4_agent_tools/map/render.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/map/render.js +759 -0
- package/dist/hoi4_agent_tools/map/render.js.map +1 -0
- package/dist/hoi4_agent_tools/map/service.d.ts +81 -0
- package/dist/hoi4_agent_tools/map/service.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/map/service.js +695 -0
- package/dist/hoi4_agent_tools/map/service.js.map +1 -0
- package/dist/hoi4_agent_tools/map/validation.d.ts +23 -0
- package/dist/hoi4_agent_tools/map/validation.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/map/validation.js +1177 -0
- package/dist/hoi4_agent_tools/map/validation.js.map +1 -0
- package/dist/hoi4_agent_tools/mcp/prompts/register.d.ts +3 -0
- package/dist/hoi4_agent_tools/mcp/prompts/register.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/mcp/prompts/register.js +50 -0
- package/dist/hoi4_agent_tools/mcp/prompts/register.js.map +1 -0
- package/dist/hoi4_agent_tools/mcp/registry/metadata.d.ts +9 -0
- package/dist/hoi4_agent_tools/mcp/registry/metadata.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/mcp/registry/metadata.js +10 -0
- package/dist/hoi4_agent_tools/mcp/registry/metadata.js.map +1 -0
- package/dist/hoi4_agent_tools/mcp/resources/register.d.ts +5 -0
- package/dist/hoi4_agent_tools/mcp/resources/register.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/mcp/resources/register.js +278 -0
- package/dist/hoi4_agent_tools/mcp/resources/register.js.map +1 -0
- package/dist/hoi4_agent_tools/mcp/security/auth.d.ts +24 -0
- package/dist/hoi4_agent_tools/mcp/security/auth.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/mcp/security/auth.js +234 -0
- package/dist/hoi4_agent_tools/mcp/security/auth.js.map +1 -0
- package/dist/hoi4_agent_tools/mcp/server/base-tools.d.ts +35 -0
- package/dist/hoi4_agent_tools/mcp/server/base-tools.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/mcp/server/base-tools.js +835 -0
- package/dist/hoi4_agent_tools/mcp/server/base-tools.js.map +1 -0
- package/dist/hoi4_agent_tools/mcp/server/create.d.ts +5 -0
- package/dist/hoi4_agent_tools/mcp/server/create.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/mcp/server/create.js +26 -0
- package/dist/hoi4_agent_tools/mcp/server/create.js.map +1 -0
- package/dist/hoi4_agent_tools/mcp/server/output-schemas.d.ts +133 -0
- package/dist/hoi4_agent_tools/mcp/server/output-schemas.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/mcp/server/output-schemas.js +127 -0
- package/dist/hoi4_agent_tools/mcp/server/output-schemas.js.map +1 -0
- package/dist/hoi4_agent_tools/mcp/server/progress.d.ts +8 -0
- package/dist/hoi4_agent_tools/mcp/server/progress.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/mcp/server/progress.js +21 -0
- package/dist/hoi4_agent_tools/mcp/server/progress.js.map +1 -0
- package/dist/hoi4_agent_tools/mcp/server/result.d.ts +232 -0
- package/dist/hoi4_agent_tools/mcp/server/result.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/mcp/server/result.js +353 -0
- package/dist/hoi4_agent_tools/mcp/server/result.js.map +1 -0
- package/dist/hoi4_agent_tools/mcp/tools/focus.d.ts +5 -0
- package/dist/hoi4_agent_tools/mcp/tools/focus.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/mcp/tools/focus.js +1059 -0
- package/dist/hoi4_agent_tools/mcp/tools/focus.js.map +1 -0
- package/dist/hoi4_agent_tools/mcp/tools/gui.d.ts +111 -0
- package/dist/hoi4_agent_tools/mcp/tools/gui.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/mcp/tools/gui.js +598 -0
- package/dist/hoi4_agent_tools/mcp/tools/gui.js.map +1 -0
- package/dist/hoi4_agent_tools/mcp/tools/map.d.ts +5 -0
- package/dist/hoi4_agent_tools/mcp/tools/map.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/mcp/tools/map.js +685 -0
- package/dist/hoi4_agent_tools/mcp/tools/map.js.map +1 -0
- package/dist/hoi4_agent_tools/mcp/transports/bounded-stdio.d.ts +58 -0
- package/dist/hoi4_agent_tools/mcp/transports/bounded-stdio.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/mcp/transports/bounded-stdio.js +181 -0
- package/dist/hoi4_agent_tools/mcp/transports/bounded-stdio.js.map +1 -0
- package/dist/hoi4_agent_tools/mcp/transports/event-store.d.ts +26 -0
- package/dist/hoi4_agent_tools/mcp/transports/event-store.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/mcp/transports/event-store.js +86 -0
- package/dist/hoi4_agent_tools/mcp/transports/event-store.js.map +1 -0
- package/dist/hoi4_agent_tools/mcp/transports/http.d.ts +28 -0
- package/dist/hoi4_agent_tools/mcp/transports/http.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/mcp/transports/http.js +744 -0
- package/dist/hoi4_agent_tools/mcp/transports/http.js.map +1 -0
- package/dist/hoi4_agent_tools/mcp/transports/protocol-gate.d.ts +15 -0
- package/dist/hoi4_agent_tools/mcp/transports/protocol-gate.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/mcp/transports/protocol-gate.js +51 -0
- package/dist/hoi4_agent_tools/mcp/transports/protocol-gate.js.map +1 -0
- package/dist/hoi4_agent_tools/runtime.d.ts +4 -0
- package/dist/hoi4_agent_tools/runtime.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/runtime.js +27 -0
- package/dist/hoi4_agent_tools/runtime.js.map +1 -0
- package/dist/hoi4_agent_tools/schemas/common.d.ts +74 -0
- package/dist/hoi4_agent_tools/schemas/common.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/schemas/common.js +51 -0
- package/dist/hoi4_agent_tools/schemas/common.js.map +1 -0
- package/dist/hoi4_agent_tools/schemas/focus.d.ts +784 -0
- package/dist/hoi4_agent_tools/schemas/focus.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/schemas/focus.js +330 -0
- package/dist/hoi4_agent_tools/schemas/focus.js.map +1 -0
- package/dist/hoi4_agent_tools/schemas/index.d.ts +5 -0
- package/dist/hoi4_agent_tools/schemas/index.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/schemas/index.js +5 -0
- package/dist/hoi4_agent_tools/schemas/index.js.map +1 -0
- package/dist/hoi4_agent_tools/schemas/map.d.ts +654 -0
- package/dist/hoi4_agent_tools/schemas/map.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/schemas/map.js +570 -0
- package/dist/hoi4_agent_tools/schemas/map.js.map +1 -0
- package/dist/hoi4_agent_tools/schemas/transaction.d.ts +259 -0
- package/dist/hoi4_agent_tools/schemas/transaction.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/schemas/transaction.js +104 -0
- package/dist/hoi4_agent_tools/schemas/transaction.js.map +1 -0
- package/dist/hoi4_agent_tools/version.d.ts +6 -0
- package/dist/hoi4_agent_tools/version.d.ts.map +1 -0
- package/dist/hoi4_agent_tools/version.js +7 -0
- package/dist/hoi4_agent_tools/version.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/docs/README.md +22 -0
- package/docs/adr/0001-runtime-and-language.md +16 -0
- package/docs/adr/0002-lossless-source-model.md +18 -0
- package/docs/adr/0003-image-and-font-codecs.md +18 -0
- package/docs/adr/0004-focus-layout.md +16 -0
- package/docs/adr/0005-offline-rendering.md +18 -0
- package/docs/adr/0006-mcp-sdk-and-protocol.md +16 -0
- package/docs/adr/0007-storage-and-transactions.md +24 -0
- package/docs/adr/0008-test-strategy.md +18 -0
- package/docs/adr/0009-packaging-and-registry.md +16 -0
- package/docs/adr/0010-unsupported-and-refusal-policy.md +18 -0
- package/docs/adr/0011-http-security.md +16 -0
- package/docs/adr/README.md +13 -0
- package/docs/architecture.md +60 -0
- package/docs/artifacts.md +133 -0
- package/docs/compatibility.md +33 -0
- package/docs/completion-report.md +69 -0
- package/docs/configuration.md +285 -0
- package/docs/focus-workflow.md +68 -0
- package/docs/gui-workflow.md +121 -0
- package/docs/limitations.md +30 -0
- package/docs/map-workflow.md +89 -0
- package/docs/performance.md +117 -0
- package/docs/release.md +200 -0
- package/docs/research/mcp-2026-07-10.md +46 -0
- package/docs/research/source-ledger.md +68 -0
- package/docs/security.md +139 -0
- package/docs/self-hosting.md +168 -0
- package/docs/testing.md +43 -0
- package/docs/third-party-notices.md +11 -0
- package/docs/transactions.md +162 -0
- package/docs/troubleshooting.md +46 -0
- package/package.json +98 -5
- package/schemas/configuration.schema.json +794 -0
- package/schemas/continuous-focus-palette.schema.json +325 -0
- package/schemas/focus-plan.schema.json +902 -0
- package/schemas/focus-planning-sidecar.schema.json +364 -0
- package/schemas/gui-animation-source.schema.json +176 -0
- package/schemas/gui-helper.schema.json +301 -0
- package/schemas/gui-scenario.schema.json +298 -0
- package/schemas/map-operation.schema.json +2284 -0
- package/schemas/operation-result.schema.json +344 -0
- package/schemas/transaction-manifest.schema.json +685 -0
- package/server.json +32 -0
|
@@ -0,0 +1,839 @@
|
|
|
1
|
+
import { compareCodeUnits } from '../core/canonical.js';
|
|
2
|
+
import { sortDiagnostics } from '../core/diagnostics.js';
|
|
3
|
+
import { DiagnosticCollector } from '../core/diagnostic-collector.js';
|
|
4
|
+
import { ServiceError } from '../core/result.js';
|
|
5
|
+
import { focusConnectorSegmentsProperlyCross, focusNodesVisiblyOverlap } from './geometry.js';
|
|
6
|
+
import { layoutFocusTree } from './layout.js';
|
|
7
|
+
import { FOCUS_CYCLE_SAMPLE_MAX, FOCUS_DIAGNOSTIC_MAX, FOCUS_GRAPH_MAX_DEPTH, FOCUS_GRAPH_MAX_EDGES, FOCUS_GRAPH_MAX_NODES, FOCUS_LINT_WORK_MAX, FOCUS_PAIR_COMPARISON_MAX, } from './limits.js';
|
|
8
|
+
import { layoutNodeMap, } from './model.js';
|
|
9
|
+
export function lintContinuousFocusPalette(plan) {
|
|
10
|
+
if (plan.focuses.length > FOCUS_GRAPH_MAX_NODES) {
|
|
11
|
+
return [
|
|
12
|
+
{
|
|
13
|
+
code: 'FOCUS_GRAPH_NODE_BUDGET_BLOCKED',
|
|
14
|
+
severity: 'blocker',
|
|
15
|
+
category: 'layout',
|
|
16
|
+
message: 'Continuous focus palette exceeds the fixed traversal node ceiling',
|
|
17
|
+
details: { nodes: plan.focuses.length, maximumNodes: FOCUS_GRAPH_MAX_NODES },
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
}
|
|
21
|
+
const diagnostics = new DiagnosticCollector(FOCUS_DIAGNOSTIC_MAX, {
|
|
22
|
+
code: 'FOCUS_LINT_DIAGNOSTICS_TRUNCATED',
|
|
23
|
+
category: 'layout',
|
|
24
|
+
message: 'Focus lint diagnostics exceeded the fixed global result ceiling',
|
|
25
|
+
});
|
|
26
|
+
const seen = new Set();
|
|
27
|
+
for (const focus of plan.focuses) {
|
|
28
|
+
if (seen.has(focus.id))
|
|
29
|
+
diagnostics.push({
|
|
30
|
+
code: 'CONTINUOUS_FOCUS_DUPLICATE_ID',
|
|
31
|
+
severity: 'error',
|
|
32
|
+
category: 'syntax',
|
|
33
|
+
message: `Continuous focus ${focus.id} is defined more than once in ${plan.id}`,
|
|
34
|
+
...(focus.sourceLocation === undefined ? {} : { location: focus.sourceLocation }),
|
|
35
|
+
});
|
|
36
|
+
seen.add(focus.id);
|
|
37
|
+
if (focus.icons.length === 0)
|
|
38
|
+
diagnostics.push({
|
|
39
|
+
code: 'CONTINUOUS_FOCUS_ICON_MISSING',
|
|
40
|
+
severity: 'warning',
|
|
41
|
+
category: 'reference',
|
|
42
|
+
message: `Continuous focus ${focus.id} has no icon`,
|
|
43
|
+
...(focus.sourceLocation === undefined ? {} : { location: focus.sourceLocation }),
|
|
44
|
+
});
|
|
45
|
+
if (focus.localisation.titleKey.length === 0 || focus.localisation.descriptionKey.length === 0)
|
|
46
|
+
diagnostics.push({
|
|
47
|
+
code: 'CONTINUOUS_FOCUS_LOCALISATION_MISSING',
|
|
48
|
+
severity: 'warning',
|
|
49
|
+
category: 'reference',
|
|
50
|
+
message: `Continuous focus ${focus.id} has incomplete localisation keys`,
|
|
51
|
+
...(focus.sourceLocation === undefined ? {} : { location: focus.sourceLocation }),
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
if (!plan.default && plan.countryAssignment === undefined)
|
|
55
|
+
diagnostics.push({
|
|
56
|
+
code: 'CONTINUOUS_FOCUS_PALETTE_UNASSIGNED',
|
|
57
|
+
severity: 'warning',
|
|
58
|
+
category: 'design',
|
|
59
|
+
message: `Continuous focus palette ${plan.id} is neither default nor country-assigned`,
|
|
60
|
+
...(plan.sourceLocation === undefined ? {} : { location: plan.sourceLocation }),
|
|
61
|
+
});
|
|
62
|
+
return sortDiagnostics(diagnostics.values());
|
|
63
|
+
}
|
|
64
|
+
export { FOCUS_GRAPH_MAX_DEPTH, FOCUS_GRAPH_MAX_EDGES, FOCUS_GRAPH_MAX_NODES, FOCUS_PAIR_COMPARISON_MAX, } from './limits.js';
|
|
65
|
+
function withFocusLocation(focus) {
|
|
66
|
+
return focus.sourceLocation === undefined ? {} : { location: focus.sourceLocation };
|
|
67
|
+
}
|
|
68
|
+
function prerequisiteIds(focus) {
|
|
69
|
+
return focus.prerequisites.groups.flatMap(({ focusIds }) => focusIds);
|
|
70
|
+
}
|
|
71
|
+
function referenceSet(catalog, kind) {
|
|
72
|
+
const values = catalog?.[kind];
|
|
73
|
+
if (values === undefined)
|
|
74
|
+
return undefined;
|
|
75
|
+
return values instanceof Set ? values : new Set(values);
|
|
76
|
+
}
|
|
77
|
+
function graphCycles(focuses, edges, work) {
|
|
78
|
+
const state = new Map();
|
|
79
|
+
const path = [];
|
|
80
|
+
const cycles = [];
|
|
81
|
+
const seenCycles = new Set();
|
|
82
|
+
let samplesTruncated = false;
|
|
83
|
+
const recordCycle = (id) => {
|
|
84
|
+
if (cycles.length >= FOCUS_CYCLE_SAMPLE_MAX) {
|
|
85
|
+
samplesTruncated = true;
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
work.spend('cycle path selection', path.length);
|
|
89
|
+
const start = path.indexOf(id);
|
|
90
|
+
const body = path.slice(start);
|
|
91
|
+
const length = body.length;
|
|
92
|
+
let left = 0;
|
|
93
|
+
let right = 1;
|
|
94
|
+
let offset = 0;
|
|
95
|
+
while (left < length && right < length && offset < length) {
|
|
96
|
+
work.spend('cycle minimal-rotation comparison');
|
|
97
|
+
const leftValue = body[(left + offset) % length];
|
|
98
|
+
const rightValue = body[(right + offset) % length];
|
|
99
|
+
const comparison = compareCodeUnits(leftValue, rightValue);
|
|
100
|
+
if (comparison === 0) {
|
|
101
|
+
offset += 1;
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
if (comparison > 0) {
|
|
105
|
+
left += offset + 1;
|
|
106
|
+
if (left === right)
|
|
107
|
+
left += 1;
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
right += offset + 1;
|
|
111
|
+
if (left === right)
|
|
112
|
+
right += 1;
|
|
113
|
+
}
|
|
114
|
+
offset = 0;
|
|
115
|
+
}
|
|
116
|
+
const rotation = Math.min(left, right);
|
|
117
|
+
const canonical = [];
|
|
118
|
+
for (let index = 0; index < length; index += 1) {
|
|
119
|
+
work.spend('cycle canonical key construction');
|
|
120
|
+
canonical.push(body[(rotation + index) % length]);
|
|
121
|
+
}
|
|
122
|
+
const key = canonical.join('\0');
|
|
123
|
+
if (!seenCycles.has(key)) {
|
|
124
|
+
seenCycles.add(key);
|
|
125
|
+
cycles.push([...body, id]);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
for (const start of [...focuses.keys()].sort((left, right) => compareCodeUnits(left, right))) {
|
|
129
|
+
if ((state.get(start) ?? 0) !== 0)
|
|
130
|
+
continue;
|
|
131
|
+
const focus = focuses.get(start);
|
|
132
|
+
if (focus === undefined)
|
|
133
|
+
continue;
|
|
134
|
+
const frames = [
|
|
135
|
+
{
|
|
136
|
+
id: start,
|
|
137
|
+
targets: [...edges(focus)].sort((left, right) => compareCodeUnits(left, right)),
|
|
138
|
+
next: 0,
|
|
139
|
+
},
|
|
140
|
+
];
|
|
141
|
+
state.set(start, 1);
|
|
142
|
+
path.push(start);
|
|
143
|
+
while (frames.length > 0) {
|
|
144
|
+
const frame = frames[frames.length - 1];
|
|
145
|
+
const target = frame.targets[frame.next];
|
|
146
|
+
if (target === undefined) {
|
|
147
|
+
frames.pop();
|
|
148
|
+
path.pop();
|
|
149
|
+
state.set(frame.id, 2);
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
frame.next += 1;
|
|
153
|
+
if (!focuses.has(target))
|
|
154
|
+
continue;
|
|
155
|
+
const targetState = state.get(target) ?? 0;
|
|
156
|
+
if (targetState === 1) {
|
|
157
|
+
recordCycle(target);
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
if (targetState === 2)
|
|
161
|
+
continue;
|
|
162
|
+
if (frames.length >= FOCUS_GRAPH_MAX_DEPTH)
|
|
163
|
+
return { cycles, depthBlocked: true, samplesTruncated };
|
|
164
|
+
const targetFocus = focuses.get(target);
|
|
165
|
+
state.set(target, 1);
|
|
166
|
+
path.push(target);
|
|
167
|
+
frames.push({
|
|
168
|
+
id: target,
|
|
169
|
+
targets: [...edges(targetFocus)].sort((left, right) => compareCodeUnits(left, right)),
|
|
170
|
+
next: 0,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return { cycles, depthBlocked: false, samplesTruncated };
|
|
175
|
+
}
|
|
176
|
+
function ancestorSet(focusId, focuses, memo, work) {
|
|
177
|
+
const cached = memo.get(focusId);
|
|
178
|
+
if (cached !== undefined)
|
|
179
|
+
return new Set(cached);
|
|
180
|
+
const seen = new Set();
|
|
181
|
+
const pending = [focusId];
|
|
182
|
+
while (pending.length > 0) {
|
|
183
|
+
const current = pending.pop();
|
|
184
|
+
const focus = focuses.get(current);
|
|
185
|
+
if (focus === undefined)
|
|
186
|
+
continue;
|
|
187
|
+
for (const parent of prerequisiteIds(focus)) {
|
|
188
|
+
work.spend('ancestor traversal');
|
|
189
|
+
if (seen.has(parent))
|
|
190
|
+
continue;
|
|
191
|
+
seen.add(parent);
|
|
192
|
+
const parentAncestors = memo.get(parent);
|
|
193
|
+
if (parentAncestors === undefined)
|
|
194
|
+
pending.push(parent);
|
|
195
|
+
else {
|
|
196
|
+
for (const ancestor of parentAncestors) {
|
|
197
|
+
work.spend('memoized ancestor union');
|
|
198
|
+
seen.add(ancestor);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
memo.set(focusId, new Set(seen));
|
|
204
|
+
return seen;
|
|
205
|
+
}
|
|
206
|
+
class FocusLintWorkBudget {
|
|
207
|
+
used = 0;
|
|
208
|
+
spend(phase, amount = 1) {
|
|
209
|
+
if (!Number.isSafeInteger(amount) || amount < 0 || amount > FOCUS_LINT_WORK_MAX - this.used) {
|
|
210
|
+
throw new ServiceError('FOCUS_LINT_WORK_BUDGET_BLOCKED', 'Focus lint exceeds the fixed transitive and route-analysis work ceiling', { phase, used: this.used, requested: amount, maximumWork: FOCUS_LINT_WORK_MAX });
|
|
211
|
+
}
|
|
212
|
+
this.used += amount;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
function normalizedReward(focus) {
|
|
216
|
+
const text = focus.completionReward?.text;
|
|
217
|
+
return text === undefined
|
|
218
|
+
? undefined
|
|
219
|
+
: text
|
|
220
|
+
.replace(/#[^\r\n]*/gu, '')
|
|
221
|
+
.replace(/\s+/gu, ' ')
|
|
222
|
+
.trim();
|
|
223
|
+
}
|
|
224
|
+
export function lintFocusTree(plan, options = {}) {
|
|
225
|
+
const diagnostics = new DiagnosticCollector(FOCUS_DIAGNOSTIC_MAX, {
|
|
226
|
+
code: 'FOCUS_LINT_DIAGNOSTICS_TRUNCATED',
|
|
227
|
+
category: 'layout',
|
|
228
|
+
message: 'Focus lint diagnostics exceeded the fixed global result ceiling',
|
|
229
|
+
});
|
|
230
|
+
const work = new FocusLintWorkBudget();
|
|
231
|
+
if (plan.focuses.length > FOCUS_GRAPH_MAX_NODES) {
|
|
232
|
+
return [
|
|
233
|
+
{
|
|
234
|
+
code: 'FOCUS_GRAPH_NODE_BUDGET_BLOCKED',
|
|
235
|
+
severity: 'blocker',
|
|
236
|
+
category: 'layout',
|
|
237
|
+
message: 'Focus graph exceeds the fixed traversal node ceiling',
|
|
238
|
+
details: { nodes: plan.focuses.length, maximumNodes: FOCUS_GRAPH_MAX_NODES },
|
|
239
|
+
},
|
|
240
|
+
];
|
|
241
|
+
}
|
|
242
|
+
let prerequisiteEdgeCount = 0;
|
|
243
|
+
for (const focus of plan.focuses) {
|
|
244
|
+
for (const group of focus.prerequisites.groups) {
|
|
245
|
+
prerequisiteEdgeCount += group.focusIds.length;
|
|
246
|
+
if (prerequisiteEdgeCount > FOCUS_GRAPH_MAX_EDGES) {
|
|
247
|
+
return [
|
|
248
|
+
{
|
|
249
|
+
code: 'FOCUS_GRAPH_EDGE_BUDGET_BLOCKED',
|
|
250
|
+
severity: 'blocker',
|
|
251
|
+
category: 'layout',
|
|
252
|
+
message: 'Focus graph exceeds the fixed traversal edge ceiling',
|
|
253
|
+
details: { edges: prerequisiteEdgeCount, maximumEdges: FOCUS_GRAPH_MAX_EDGES },
|
|
254
|
+
},
|
|
255
|
+
];
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
const focuses = new Map();
|
|
260
|
+
const duplicates = new Map();
|
|
261
|
+
for (const focus of plan.focuses) {
|
|
262
|
+
const group = duplicates.get(focus.id) ?? [];
|
|
263
|
+
group.push(focus);
|
|
264
|
+
duplicates.set(focus.id, group);
|
|
265
|
+
if (!focuses.has(focus.id))
|
|
266
|
+
focuses.set(focus.id, focus);
|
|
267
|
+
}
|
|
268
|
+
for (const [id, group] of duplicates) {
|
|
269
|
+
if (group.length < 2)
|
|
270
|
+
continue;
|
|
271
|
+
const first = group[0];
|
|
272
|
+
if (first === undefined)
|
|
273
|
+
continue;
|
|
274
|
+
diagnostics.push({
|
|
275
|
+
code: 'FOCUS_DUPLICATE_ID',
|
|
276
|
+
severity: 'error',
|
|
277
|
+
category: 'reference',
|
|
278
|
+
message: `Focus ID ${id} is defined ${group.length} times`,
|
|
279
|
+
...withFocusLocation(first),
|
|
280
|
+
related: group
|
|
281
|
+
.slice(1)
|
|
282
|
+
.flatMap(({ sourceLocation }) => (sourceLocation === undefined ? [] : [sourceLocation])),
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
for (const focus of focuses.values()) {
|
|
286
|
+
if (focus.prerequisites.operator !== 'and') {
|
|
287
|
+
diagnostics.push({
|
|
288
|
+
code: 'FOCUS_PREREQUISITE_OUTER_MALFORMED',
|
|
289
|
+
severity: 'error',
|
|
290
|
+
category: 'syntax',
|
|
291
|
+
message: `Focus ${focus.id} prerequisite expression must use an outer AND`,
|
|
292
|
+
...withFocusLocation(focus),
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
for (const group of focus.prerequisites.groups) {
|
|
296
|
+
if (group.operator !== 'or' || group.focusIds.length === 0) {
|
|
297
|
+
diagnostics.push({
|
|
298
|
+
code: 'FOCUS_PREREQUISITE_GROUP_MALFORMED',
|
|
299
|
+
severity: 'error',
|
|
300
|
+
category: 'syntax',
|
|
301
|
+
message: `Focus ${focus.id} contains an empty or non-OR prerequisite group`,
|
|
302
|
+
...(group.sourceLocation === undefined
|
|
303
|
+
? withFocusLocation(focus)
|
|
304
|
+
: { location: group.sourceLocation }),
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
if (new Set(group.focusIds).size !== group.focusIds.length) {
|
|
308
|
+
diagnostics.push({
|
|
309
|
+
code: 'FOCUS_PREREQUISITE_GROUP_DUPLICATE',
|
|
310
|
+
severity: 'warning',
|
|
311
|
+
category: 'syntax',
|
|
312
|
+
message: `Focus ${focus.id} repeats a target inside one OR group`,
|
|
313
|
+
...(group.sourceLocation === undefined
|
|
314
|
+
? withFocusLocation(focus)
|
|
315
|
+
: { location: group.sourceLocation }),
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
for (const parent of prerequisiteIds(focus)) {
|
|
320
|
+
if (focuses.has(parent) || options.index?.find('focus', parent) !== undefined)
|
|
321
|
+
continue;
|
|
322
|
+
diagnostics.push({
|
|
323
|
+
code: 'FOCUS_PREREQUISITE_MISSING',
|
|
324
|
+
severity: 'error',
|
|
325
|
+
category: 'reference',
|
|
326
|
+
message: `Focus ${focus.id} references missing prerequisite ${parent}`,
|
|
327
|
+
...withFocusLocation(focus),
|
|
328
|
+
details: { focusId: focus.id, target: parent },
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
const prerequisiteCycles = graphCycles(focuses, prerequisiteIds, work);
|
|
333
|
+
if (prerequisiteCycles.depthBlocked) {
|
|
334
|
+
diagnostics.push({
|
|
335
|
+
code: 'FOCUS_GRAPH_DEPTH_BUDGET_BLOCKED',
|
|
336
|
+
severity: 'blocker',
|
|
337
|
+
category: 'layout',
|
|
338
|
+
message: 'Focus prerequisite graph exceeds the fixed traversal depth ceiling',
|
|
339
|
+
details: { graph: 'prerequisite', maximumDepth: FOCUS_GRAPH_MAX_DEPTH },
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
if (prerequisiteCycles.samplesTruncated) {
|
|
343
|
+
diagnostics.push({
|
|
344
|
+
code: 'FOCUS_CYCLE_SAMPLES_TRUNCATED',
|
|
345
|
+
severity: 'blocker',
|
|
346
|
+
category: 'layout',
|
|
347
|
+
message: 'Focus prerequisite cycle samples exceed the fixed result ceiling',
|
|
348
|
+
details: { graph: 'prerequisite', maximumSamples: FOCUS_CYCLE_SAMPLE_MAX },
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
for (const cycle of prerequisiteCycles.cycles) {
|
|
352
|
+
const firstId = cycle[0];
|
|
353
|
+
const focus = firstId === undefined ? undefined : focuses.get(firstId);
|
|
354
|
+
diagnostics.push({
|
|
355
|
+
code: 'FOCUS_PREREQUISITE_CYCLE',
|
|
356
|
+
severity: 'error',
|
|
357
|
+
category: 'reference',
|
|
358
|
+
message: `Focus prerequisite cycle: ${cycle.join(' -> ')}`,
|
|
359
|
+
...(focus === undefined ? {} : withFocusLocation(focus)),
|
|
360
|
+
details: { cycle },
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
if (prerequisiteCycles.depthBlocked)
|
|
364
|
+
return sortDiagnostics(diagnostics.values());
|
|
365
|
+
const children = new Map();
|
|
366
|
+
for (const focus of focuses.values()) {
|
|
367
|
+
for (const parent of prerequisiteIds(focus)) {
|
|
368
|
+
const set = children.get(parent) ?? new Set();
|
|
369
|
+
set.add(focus.id);
|
|
370
|
+
children.set(parent, set);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
for (const focus of focuses.values()) {
|
|
374
|
+
const parents = prerequisiteIds(focus).filter((id) => focuses.has(id));
|
|
375
|
+
const childCount = children.get(focus.id)?.size ?? 0;
|
|
376
|
+
if (parents.length === 0 && childCount === 0 && focuses.size > 1) {
|
|
377
|
+
diagnostics.push({
|
|
378
|
+
code: 'FOCUS_ISOLATED',
|
|
379
|
+
severity: 'warning',
|
|
380
|
+
category: 'design',
|
|
381
|
+
message: `Focus ${focus.id} is isolated from the rest of the tree`,
|
|
382
|
+
...withFocusLocation(focus),
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
if (plan.entryFocusIds.length > 0) {
|
|
387
|
+
const reachable = new Set();
|
|
388
|
+
const queue = [...plan.entryFocusIds].filter((id) => focuses.has(id));
|
|
389
|
+
let cursor = 0;
|
|
390
|
+
while (cursor < queue.length) {
|
|
391
|
+
const id = queue[cursor];
|
|
392
|
+
cursor += 1;
|
|
393
|
+
if (id === undefined)
|
|
394
|
+
break;
|
|
395
|
+
work.spend('entry reachability traversal');
|
|
396
|
+
if (reachable.has(id))
|
|
397
|
+
continue;
|
|
398
|
+
reachable.add(id);
|
|
399
|
+
for (const child of children.get(id) ?? [])
|
|
400
|
+
queue.push(child);
|
|
401
|
+
}
|
|
402
|
+
for (const focus of focuses.values()) {
|
|
403
|
+
if (reachable.has(focus.id))
|
|
404
|
+
continue;
|
|
405
|
+
diagnostics.push({
|
|
406
|
+
code: 'FOCUS_UNREACHABLE',
|
|
407
|
+
severity: 'warning',
|
|
408
|
+
category: 'design',
|
|
409
|
+
message: `Focus ${focus.id} is unreachable from the declared entry focuses`,
|
|
410
|
+
...withFocusLocation(focus),
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
const ancestorMemo = new Map();
|
|
415
|
+
for (const focus of focuses.values()) {
|
|
416
|
+
const ancestors = focus.mutuallyExclusive.length === 0
|
|
417
|
+
? new Set()
|
|
418
|
+
: ancestorSet(focus.id, focuses, ancestorMemo, work);
|
|
419
|
+
for (const excluded of focus.mutuallyExclusive) {
|
|
420
|
+
if (excluded === focus.id || ancestors.has(excluded)) {
|
|
421
|
+
diagnostics.push({
|
|
422
|
+
code: 'FOCUS_MUTUAL_EXCLUSION_CONTRADICTS_PATH',
|
|
423
|
+
severity: 'error',
|
|
424
|
+
category: 'reference',
|
|
425
|
+
message: excluded === focus.id
|
|
426
|
+
? `Focus ${focus.id} excludes itself`
|
|
427
|
+
: `Focus ${focus.id} excludes prerequisite ancestor ${excluded}`,
|
|
428
|
+
...withFocusLocation(focus),
|
|
429
|
+
details: { focusId: focus.id, excluded },
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
if (!focuses.has(excluded) && options.index?.find('focus', excluded) === undefined) {
|
|
433
|
+
diagnostics.push({
|
|
434
|
+
code: 'FOCUS_MUTUAL_EXCLUSION_MISSING',
|
|
435
|
+
severity: 'error',
|
|
436
|
+
category: 'reference',
|
|
437
|
+
message: `Focus ${focus.id} excludes missing focus ${excluded}`,
|
|
438
|
+
...withFocusLocation(focus),
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
const relativeEdges = (focus) => focus.position.mode === 'relative' ? [focus.position.relativeTo] : [];
|
|
444
|
+
for (const focus of focuses.values()) {
|
|
445
|
+
if (focus.position.mode === 'relative' &&
|
|
446
|
+
!focuses.has(focus.position.relativeTo) &&
|
|
447
|
+
options.index?.find('focus', focus.position.relativeTo) === undefined) {
|
|
448
|
+
diagnostics.push({
|
|
449
|
+
code: 'FOCUS_RELATIVE_TARGET_MISSING',
|
|
450
|
+
severity: 'error',
|
|
451
|
+
category: 'layout',
|
|
452
|
+
message: `Focus ${focus.id} has missing relative target ${focus.position.relativeTo}`,
|
|
453
|
+
...withFocusLocation(focus),
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
const relativeCycles = graphCycles(focuses, relativeEdges, work);
|
|
458
|
+
if (relativeCycles.depthBlocked) {
|
|
459
|
+
diagnostics.push({
|
|
460
|
+
code: 'FOCUS_GRAPH_DEPTH_BUDGET_BLOCKED',
|
|
461
|
+
severity: 'blocker',
|
|
462
|
+
category: 'layout',
|
|
463
|
+
message: 'Focus relative-position graph exceeds the fixed traversal depth ceiling',
|
|
464
|
+
details: { graph: 'relative-position', maximumDepth: FOCUS_GRAPH_MAX_DEPTH },
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
if (relativeCycles.samplesTruncated) {
|
|
468
|
+
diagnostics.push({
|
|
469
|
+
code: 'FOCUS_CYCLE_SAMPLES_TRUNCATED',
|
|
470
|
+
severity: 'blocker',
|
|
471
|
+
category: 'layout',
|
|
472
|
+
message: 'Focus relative-position cycle samples exceed the fixed result ceiling',
|
|
473
|
+
details: { graph: 'relative-position', maximumSamples: FOCUS_CYCLE_SAMPLE_MAX },
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
for (const cycle of relativeCycles.cycles) {
|
|
477
|
+
const firstId = cycle[0];
|
|
478
|
+
const focus = firstId === undefined ? undefined : focuses.get(firstId);
|
|
479
|
+
diagnostics.push({
|
|
480
|
+
code: 'FOCUS_RELATIVE_POSITION_CYCLE',
|
|
481
|
+
severity: 'error',
|
|
482
|
+
category: 'layout',
|
|
483
|
+
message: `Relative-position cycle: ${cycle.join(' -> ')}`,
|
|
484
|
+
...(focus === undefined ? {} : withFocusLocation(focus)),
|
|
485
|
+
details: { cycle },
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
if (relativeCycles.depthBlocked)
|
|
489
|
+
return sortDiagnostics(diagnostics.values());
|
|
490
|
+
const exclusionPairs = new Set();
|
|
491
|
+
for (const focus of focuses.values()) {
|
|
492
|
+
for (const excluded of focus.mutuallyExclusive) {
|
|
493
|
+
work.spend('mutual-exclusion pair indexing');
|
|
494
|
+
exclusionPairs.add([focus.id, excluded].sort((left, right) => compareCodeUnits(left, right)).join('\0'));
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
for (const focus of focuses.values()) {
|
|
498
|
+
for (const lock of focus.routeLocks) {
|
|
499
|
+
const excludedSet = new Set(lock.excludedFocusIds);
|
|
500
|
+
const same = [];
|
|
501
|
+
for (const id of lock.requiredFocusIds) {
|
|
502
|
+
work.spend('route-lock required/excluded comparison');
|
|
503
|
+
if (excludedSet.has(id))
|
|
504
|
+
same.push(id);
|
|
505
|
+
}
|
|
506
|
+
let incompatible = false;
|
|
507
|
+
if (lock.mode === 'all') {
|
|
508
|
+
for (let leftIndex = 0; leftIndex < lock.requiredFocusIds.length && !incompatible; leftIndex += 1) {
|
|
509
|
+
const left = lock.requiredFocusIds[leftIndex];
|
|
510
|
+
if (left === undefined)
|
|
511
|
+
continue;
|
|
512
|
+
for (let rightIndex = leftIndex + 1; rightIndex < lock.requiredFocusIds.length; rightIndex += 1) {
|
|
513
|
+
work.spend('route-lock incompatibility pair comparison');
|
|
514
|
+
const right = lock.requiredFocusIds[rightIndex];
|
|
515
|
+
if (right === undefined)
|
|
516
|
+
continue;
|
|
517
|
+
const pair = compareCodeUnits(left, right) <= 0 ? `${left}\0${right}` : `${right}\0${left}`;
|
|
518
|
+
if (exclusionPairs.has(pair)) {
|
|
519
|
+
incompatible = true;
|
|
520
|
+
break;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
if (lock.alwaysImpossible === true || same.length > 0 || incompatible) {
|
|
526
|
+
diagnostics.push({
|
|
527
|
+
code: 'FOCUS_ROUTE_LOCK_IMPOSSIBLE',
|
|
528
|
+
severity: 'error',
|
|
529
|
+
category: 'design',
|
|
530
|
+
message: `Route lock ${lock.id} on ${focus.id} cannot be satisfied`,
|
|
531
|
+
...(lock.sourceLocation === undefined
|
|
532
|
+
? withFocusLocation(focus)
|
|
533
|
+
: { location: lock.sourceLocation }),
|
|
534
|
+
details: { requiredAndExcluded: same, incompatibleRequirements: incompatible },
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
for (const targets of [lock.requiredFocusIds, lock.excludedFocusIds]) {
|
|
538
|
+
for (const target of targets) {
|
|
539
|
+
work.spend('route-lock reference membership');
|
|
540
|
+
if (focuses.has(target) || options.index?.find('focus', target) !== undefined)
|
|
541
|
+
continue;
|
|
542
|
+
diagnostics.push({
|
|
543
|
+
code: 'FOCUS_ROUTE_LOCK_REFERENCE_MISSING',
|
|
544
|
+
severity: 'error',
|
|
545
|
+
category: 'reference',
|
|
546
|
+
message: `Route lock ${lock.id} references missing focus ${target}`,
|
|
547
|
+
...(lock.sourceLocation === undefined
|
|
548
|
+
? withFocusLocation(focus)
|
|
549
|
+
: { location: lock.sourceLocation }),
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
if (focus.visibility !== 'normal' &&
|
|
555
|
+
focus.reveal === undefined &&
|
|
556
|
+
focus.allowBranch === undefined) {
|
|
557
|
+
diagnostics.push({
|
|
558
|
+
code: 'FOCUS_HIDDEN_WITHOUT_REVEAL',
|
|
559
|
+
severity: 'warning',
|
|
560
|
+
category: 'design',
|
|
561
|
+
message: `${focus.visibility} focus ${focus.id} has no reveal path`,
|
|
562
|
+
...withFocusLocation(focus),
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
const layout = options.layout ?? layoutFocusTree(plan);
|
|
567
|
+
diagnostics.pushMany(layout.diagnostics);
|
|
568
|
+
const positions = layoutNodeMap(layout);
|
|
569
|
+
const coordinateOwners = new Map();
|
|
570
|
+
for (const node of layout.nodes) {
|
|
571
|
+
const key = `${node.x},${node.y}`;
|
|
572
|
+
const owner = coordinateOwners.get(key);
|
|
573
|
+
if (owner !== undefined && owner !== node.id) {
|
|
574
|
+
const focus = focuses.get(node.id);
|
|
575
|
+
diagnostics.push({
|
|
576
|
+
code: 'FOCUS_DUPLICATE_COORDINATE',
|
|
577
|
+
severity: 'error',
|
|
578
|
+
category: 'layout',
|
|
579
|
+
message: `Focuses ${owner} and ${node.id} share coordinate (${node.x}, ${node.y})`,
|
|
580
|
+
...(focus === undefined ? {} : withFocusLocation(focus)),
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
else
|
|
584
|
+
coordinateOwners.set(key, node.id);
|
|
585
|
+
}
|
|
586
|
+
const layoutPairCount = (layout.nodes.length * (layout.nodes.length - 1)) / 2;
|
|
587
|
+
if (layoutPairCount > FOCUS_PAIR_COMPARISON_MAX) {
|
|
588
|
+
diagnostics.push({
|
|
589
|
+
code: 'FOCUS_LAYOUT_COMPARISON_BUDGET_BLOCKED',
|
|
590
|
+
severity: 'blocker',
|
|
591
|
+
category: 'layout',
|
|
592
|
+
message: 'Focus overlap analysis exceeds the fixed pair-comparison ceiling',
|
|
593
|
+
details: { comparisons: layoutPairCount, maximumComparisons: FOCUS_PAIR_COMPARISON_MAX },
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
else {
|
|
597
|
+
for (let leftIndex = 0; leftIndex < layout.nodes.length; leftIndex += 1) {
|
|
598
|
+
const left = layout.nodes[leftIndex];
|
|
599
|
+
if (left === undefined)
|
|
600
|
+
continue;
|
|
601
|
+
for (let rightIndex = leftIndex + 1; rightIndex < layout.nodes.length; rightIndex += 1) {
|
|
602
|
+
const right = layout.nodes[rightIndex];
|
|
603
|
+
if (right === undefined || !focusNodesVisiblyOverlap(left, right))
|
|
604
|
+
continue;
|
|
605
|
+
const focus = focuses.get(right.id);
|
|
606
|
+
diagnostics.push({
|
|
607
|
+
code: 'FOCUS_VISIBLE_OVERLAP',
|
|
608
|
+
severity: 'error',
|
|
609
|
+
category: 'layout',
|
|
610
|
+
message: `Focuses ${left.id} and ${right.id} visibly overlap`,
|
|
611
|
+
...(focus === undefined ? {} : withFocusLocation(focus)),
|
|
612
|
+
details: {
|
|
613
|
+
focusIds: [left.id, right.id],
|
|
614
|
+
left: { x: left.x, y: left.y },
|
|
615
|
+
right: { x: right.x, y: right.y },
|
|
616
|
+
},
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
const connectors = [...focuses.values()].flatMap((focus) => prerequisiteIds(focus).flatMap((parentId) => {
|
|
622
|
+
const parent = positions.get(parentId);
|
|
623
|
+
const child = positions.get(focus.id);
|
|
624
|
+
return parent === undefined || child === undefined
|
|
625
|
+
? []
|
|
626
|
+
: [{ parentId, childId: focus.id, parent, child }];
|
|
627
|
+
}));
|
|
628
|
+
const connectorPairCount = (connectors.length * (connectors.length - 1)) / 2;
|
|
629
|
+
if (connectorPairCount > FOCUS_PAIR_COMPARISON_MAX) {
|
|
630
|
+
diagnostics.push({
|
|
631
|
+
code: 'FOCUS_CONNECTOR_COMPARISON_BUDGET_BLOCKED',
|
|
632
|
+
severity: 'blocker',
|
|
633
|
+
category: 'layout',
|
|
634
|
+
message: 'Focus connector analysis exceeds the fixed pair-comparison ceiling',
|
|
635
|
+
details: { comparisons: connectorPairCount, maximumComparisons: FOCUS_PAIR_COMPARISON_MAX },
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
else {
|
|
639
|
+
for (let firstIndex = 0; firstIndex < connectors.length; firstIndex += 1) {
|
|
640
|
+
const first = connectors[firstIndex];
|
|
641
|
+
if (first === undefined)
|
|
642
|
+
continue;
|
|
643
|
+
for (let secondIndex = firstIndex + 1; secondIndex < connectors.length; secondIndex += 1) {
|
|
644
|
+
const second = connectors[secondIndex];
|
|
645
|
+
if (second === undefined)
|
|
646
|
+
continue;
|
|
647
|
+
if (first.parentId === second.parentId ||
|
|
648
|
+
first.parentId === second.childId ||
|
|
649
|
+
first.childId === second.parentId ||
|
|
650
|
+
first.childId === second.childId) {
|
|
651
|
+
continue;
|
|
652
|
+
}
|
|
653
|
+
if (!focusConnectorSegmentsProperlyCross(first.parent, first.child, second.parent, second.child))
|
|
654
|
+
continue;
|
|
655
|
+
const focus = focuses.get(second.childId);
|
|
656
|
+
if (focus === undefined)
|
|
657
|
+
continue;
|
|
658
|
+
diagnostics.push({
|
|
659
|
+
code: 'FOCUS_AVOIDABLE_CONNECTOR_CROSSING',
|
|
660
|
+
severity: 'warning',
|
|
661
|
+
category: 'layout',
|
|
662
|
+
message: `Connectors ${first.parentId} -> ${first.childId} and ${second.parentId} -> ${second.childId} cross`,
|
|
663
|
+
...withFocusLocation(focus),
|
|
664
|
+
details: {
|
|
665
|
+
first: [first.parentId, first.childId],
|
|
666
|
+
second: [second.parentId, second.childId],
|
|
667
|
+
},
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
for (const focus of focuses.values()) {
|
|
673
|
+
const terminal = (children.get(focus.id)?.size ?? 0) === 0;
|
|
674
|
+
const meaningful = focus.terminalKind !== undefined ||
|
|
675
|
+
focus.payoff !== undefined ||
|
|
676
|
+
focus.completionReward !== undefined ||
|
|
677
|
+
focus.links.length > 0;
|
|
678
|
+
if (terminal && !meaningful) {
|
|
679
|
+
diagnostics.push({
|
|
680
|
+
code: 'FOCUS_TERMINAL_WITHOUT_PAYOFF',
|
|
681
|
+
severity: 'warning',
|
|
682
|
+
category: 'design',
|
|
683
|
+
message: `Terminal focus ${focus.id} has no payoff metadata, effect, or linked gameplay`,
|
|
684
|
+
...withFocusLocation(focus),
|
|
685
|
+
});
|
|
686
|
+
if (prerequisiteIds(focus).length === 1) {
|
|
687
|
+
diagnostics.push({
|
|
688
|
+
code: 'FOCUS_WEAK_DANGLING_BRANCH',
|
|
689
|
+
severity: 'warning',
|
|
690
|
+
category: 'design',
|
|
691
|
+
message: `Focus ${focus.id} ends a one-parent branch without a meaningful payoff`,
|
|
692
|
+
...withFocusLocation(focus),
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
if (focus.icons.length === 0) {
|
|
697
|
+
diagnostics.push({
|
|
698
|
+
code: 'FOCUS_ICON_MISSING',
|
|
699
|
+
severity: 'warning',
|
|
700
|
+
category: 'design',
|
|
701
|
+
message: `Focus ${focus.id} has no icon`,
|
|
702
|
+
...withFocusLocation(focus),
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
for (const icon of focus.icons) {
|
|
706
|
+
if (options.index === undefined || options.index.find('sprite', icon.sprite) !== undefined)
|
|
707
|
+
continue;
|
|
708
|
+
diagnostics.push({
|
|
709
|
+
code: 'FOCUS_ICON_REFERENCE_MISSING',
|
|
710
|
+
severity: 'error',
|
|
711
|
+
category: 'reference',
|
|
712
|
+
message: `Focus ${focus.id} references missing sprite ${icon.sprite}`,
|
|
713
|
+
...(icon.sourceLocation === undefined
|
|
714
|
+
? withFocusLocation(focus)
|
|
715
|
+
: { location: icon.sourceLocation }),
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
if (focus.localisation.titleKey.length === 0 ||
|
|
719
|
+
focus.localisation.descriptionKey.length === 0) {
|
|
720
|
+
diagnostics.push({
|
|
721
|
+
code: 'FOCUS_LOCALISATION_KEY_MISSING',
|
|
722
|
+
severity: 'warning',
|
|
723
|
+
category: 'design',
|
|
724
|
+
message: `Focus ${focus.id} lacks title or description localisation metadata`,
|
|
725
|
+
...withFocusLocation(focus),
|
|
726
|
+
});
|
|
727
|
+
}
|
|
728
|
+
else if (options.index !== undefined) {
|
|
729
|
+
const language = options.localisationLanguage ?? 'l_english';
|
|
730
|
+
for (const key of [focus.localisation.titleKey, focus.localisation.descriptionKey]) {
|
|
731
|
+
if (options.index.find('localisation', `${language}:${key}`) !== undefined)
|
|
732
|
+
continue;
|
|
733
|
+
diagnostics.push({
|
|
734
|
+
code: 'FOCUS_LOCALISATION_REFERENCE_MISSING',
|
|
735
|
+
severity: 'warning',
|
|
736
|
+
category: 'reference',
|
|
737
|
+
message: `Focus ${focus.id} has no ${language} localisation for ${key}`,
|
|
738
|
+
...withFocusLocation(focus),
|
|
739
|
+
details: { language, key },
|
|
740
|
+
});
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
if (focus.filters.length === 0) {
|
|
744
|
+
diagnostics.push({
|
|
745
|
+
code: 'FOCUS_FILTER_MISSING',
|
|
746
|
+
severity: 'warning',
|
|
747
|
+
category: 'design',
|
|
748
|
+
message: `Focus ${focus.id} has no search filter metadata`,
|
|
749
|
+
...withFocusLocation(focus),
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
const branch = plan.branchGroups.find(({ id }) => id === focus.branchId);
|
|
753
|
+
if ((focus.ai.majorRoute || branch?.major === true) &&
|
|
754
|
+
focus.ai.raw === undefined &&
|
|
755
|
+
focus.ai.strategyIds.length === 0) {
|
|
756
|
+
diagnostics.push({
|
|
757
|
+
code: 'FOCUS_MAJOR_ROUTE_AI_MISSING',
|
|
758
|
+
severity: 'warning',
|
|
759
|
+
category: 'design',
|
|
760
|
+
message: `Major-route focus ${focus.id} has no AI weight or strategy metadata`,
|
|
761
|
+
...withFocusLocation(focus),
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
for (const link of focus.links) {
|
|
765
|
+
const available = referenceSet(options.references, link.kind);
|
|
766
|
+
if (available === undefined || available.has(link.target))
|
|
767
|
+
continue;
|
|
768
|
+
diagnostics.push({
|
|
769
|
+
code: 'FOCUS_GAMEPLAY_REFERENCE_MISSING',
|
|
770
|
+
severity: 'error',
|
|
771
|
+
category: 'reference',
|
|
772
|
+
message: `Focus ${focus.id} references missing ${link.kind} ${link.target}`,
|
|
773
|
+
...(link.sourceLocation === undefined
|
|
774
|
+
? withFocusLocation(focus)
|
|
775
|
+
: { location: link.sourceLocation }),
|
|
776
|
+
details: { kind: link.kind, target: link.target },
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
for (const branch of plan.branchGroups) {
|
|
781
|
+
for (const focusId of branch.focusIds) {
|
|
782
|
+
if (focuses.has(focusId))
|
|
783
|
+
continue;
|
|
784
|
+
diagnostics.push({
|
|
785
|
+
code: 'FOCUS_BRANCH_MEMBER_MISSING',
|
|
786
|
+
severity: 'error',
|
|
787
|
+
category: 'reference',
|
|
788
|
+
message: `Branch ${branch.id} references missing focus ${focusId}`,
|
|
789
|
+
...(plan.sourceLocation === undefined ? {} : { location: plan.sourceLocation }),
|
|
790
|
+
});
|
|
791
|
+
}
|
|
792
|
+
if (branch.major &&
|
|
793
|
+
branch.aiStrategyIds.length === 0 &&
|
|
794
|
+
!branch.focusIds.some((id) => focuses.get(id)?.ai.raw !== undefined)) {
|
|
795
|
+
diagnostics.push({
|
|
796
|
+
code: 'FOCUS_MAJOR_ROUTE_AI_MISSING',
|
|
797
|
+
severity: 'warning',
|
|
798
|
+
category: 'design',
|
|
799
|
+
message: `Major branch ${branch.id} has no route-specific AI metadata`,
|
|
800
|
+
...(plan.sourceLocation === undefined ? {} : { location: plan.sourceLocation }),
|
|
801
|
+
});
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
if (plan.runtimeAssignment?.replacesExistingCountryTree === true &&
|
|
805
|
+
plan.runtimeAssignment.eventCreatedGuard === undefined) {
|
|
806
|
+
diagnostics.push({
|
|
807
|
+
code: 'FOCUS_RUNTIME_REPLACEMENT_UNSAFE',
|
|
808
|
+
severity: 'error',
|
|
809
|
+
category: 'design',
|
|
810
|
+
message: `Tree ${plan.id} replaces an existing country's runtime tree without an event-created guard`,
|
|
811
|
+
...(plan.sourceLocation === undefined ? {} : { location: plan.sourceLocation }),
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
const rewards = new Map();
|
|
815
|
+
for (const focus of focuses.values()) {
|
|
816
|
+
const reward = normalizedReward(focus);
|
|
817
|
+
if (reward === undefined || reward === '{}')
|
|
818
|
+
continue;
|
|
819
|
+
const group = rewards.get(reward) ?? [];
|
|
820
|
+
group.push(focus);
|
|
821
|
+
rewards.set(reward, group);
|
|
822
|
+
}
|
|
823
|
+
for (const group of rewards.values()) {
|
|
824
|
+
if (group.length < (options.genericRewardThreshold ?? 3))
|
|
825
|
+
continue;
|
|
826
|
+
for (const focus of group) {
|
|
827
|
+
diagnostics.push({
|
|
828
|
+
code: 'FOCUS_REPEATED_GENERIC_REWARD',
|
|
829
|
+
severity: 'warning',
|
|
830
|
+
category: 'design',
|
|
831
|
+
message: `Focus ${focus.id} repeats the same reward pattern across ${group.length} focuses`,
|
|
832
|
+
...withFocusLocation(focus),
|
|
833
|
+
details: { focusIds: group.map(({ id }) => id) },
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
return sortDiagnostics(diagnostics.values());
|
|
838
|
+
}
|
|
839
|
+
//# sourceMappingURL=lint.js.map
|