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
package/dist/bin/setup.js
CHANGED
|
@@ -9,35 +9,75 @@ import { compareCodeUnits, canonicalJson } from '../hoi4_agent_tools/core/canoni
|
|
|
9
9
|
import { loadConfiguration } from '../hoi4_agent_tools/core/configuration.js';
|
|
10
10
|
import { CoreEngine } from '../hoi4_agent_tools/core/engine.js';
|
|
11
11
|
import { WorkspaceResolver } from '../hoi4_agent_tools/core/workspace.js';
|
|
12
|
-
import { configurationPath } from '../hoi4_agent_tools/runtime.js';
|
|
12
|
+
import { configurationPath, defaultConfigurationPath } from '../hoi4_agent_tools/runtime.js';
|
|
13
13
|
import { PACKAGE_VERSION } from '../hoi4_agent_tools/version.js';
|
|
14
14
|
function argument(name) {
|
|
15
15
|
const index = process.argv.indexOf(name);
|
|
16
16
|
return index < 0 ? undefined : process.argv[index + 1];
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
function argumentsFor(name) {
|
|
19
|
+
const values = [];
|
|
20
|
+
for (let index = 2; index < process.argv.length; index += 1) {
|
|
21
|
+
if (process.argv[index] !== name)
|
|
22
|
+
continue;
|
|
23
|
+
const value = process.argv[index + 1];
|
|
24
|
+
if (value === undefined || value.startsWith('--'))
|
|
25
|
+
throw new Error(`${name} requires a path`);
|
|
26
|
+
values.push(value);
|
|
27
|
+
index += 1;
|
|
28
|
+
}
|
|
29
|
+
return values;
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
function assertKnownArguments(flags, valueFlags) {
|
|
32
|
+
const known = new Set([...flags, ...valueFlags]);
|
|
33
|
+
for (let index = 2; index < process.argv.length; index += 1) {
|
|
34
|
+
const value = process.argv[index];
|
|
35
|
+
if (!known.has(value))
|
|
36
|
+
throw new Error(`Unknown setup option: ${value}`);
|
|
37
|
+
if (valueFlags.includes(value)) {
|
|
38
|
+
const argumentValue = process.argv[index + 1];
|
|
39
|
+
if (argumentValue === undefined || argumentValue.startsWith('--')) {
|
|
40
|
+
throw new Error(`${value} requires a path`);
|
|
41
|
+
}
|
|
42
|
+
index += 1;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function persistentRoots() {
|
|
32
47
|
const home = homedir();
|
|
33
|
-
const
|
|
34
|
-
|
|
48
|
+
const dataRoot = process.env.XDG_DATA_HOME ?? process.env.LOCALAPPDATA ?? path.join(home, '.local', 'share');
|
|
49
|
+
const stateRoot = process.env.XDG_STATE_HOME ?? process.env.LOCALAPPDATA ?? path.join(home, '.local', 'state');
|
|
50
|
+
return {
|
|
51
|
+
serverStateRoot: path.join(stateRoot, 'hoi4-agent-tools', 'state'),
|
|
52
|
+
workspaceStorageRoot: path.join(dataRoot, 'hoi4-agent-tools', 'workspaces'),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function standardModRootCandidates() {
|
|
56
|
+
const home = homedir();
|
|
57
|
+
const oneDriveRoots = [
|
|
58
|
+
process.env.OneDrive,
|
|
59
|
+
process.env.OneDriveConsumer,
|
|
60
|
+
process.env.OneDriveCommercial,
|
|
61
|
+
path.join(home, 'OneDrive'),
|
|
62
|
+
].filter((value) => value !== undefined);
|
|
63
|
+
return [
|
|
35
64
|
...(process.env.HOI4_MOD_ROOTS ?? '').split(path.delimiter).filter(Boolean),
|
|
65
|
+
...oneDriveRoots.map((root) => path.join(root, 'Documents', 'Paradox Interactive', 'Hearts of Iron IV', 'mod')),
|
|
66
|
+
path.join(home, 'Documents', 'Paradox Interactive', 'Hearts of Iron IV', 'mod'),
|
|
67
|
+
path.join(home, '.local', 'share', 'Paradox Interactive', 'Hearts of Iron IV', 'mod'),
|
|
68
|
+
];
|
|
69
|
+
}
|
|
70
|
+
function standardGameRootCandidates() {
|
|
71
|
+
const home = homedir();
|
|
72
|
+
return [
|
|
73
|
+
...(process.env.HOI4_GAME_ROOT === undefined ? [] : [process.env.HOI4_GAME_ROOT]),
|
|
36
74
|
path.join(process.env['ProgramFiles(x86)'] ?? 'C:\\Program Files (x86)', 'Steam', 'steamapps', 'common', 'Hearts of Iron IV'),
|
|
37
75
|
path.join(home, '.local', 'share', 'Steam', 'steamapps', 'common', 'Hearts of Iron IV'),
|
|
38
76
|
path.join(home, '.steam', 'steam', 'steamapps', 'common', 'Hearts of Iron IV'),
|
|
39
77
|
path.join(home, 'Library', 'Application Support', 'Steam', 'steamapps', 'common', 'Hearts of Iron IV'),
|
|
40
|
-
]
|
|
78
|
+
];
|
|
79
|
+
}
|
|
80
|
+
async function existingDirectories(candidates) {
|
|
41
81
|
const existing = new Set();
|
|
42
82
|
for (const candidate of candidates) {
|
|
43
83
|
try {
|
|
@@ -46,84 +86,87 @@ async function discover() {
|
|
|
46
86
|
existing.add(await realpath(candidate));
|
|
47
87
|
}
|
|
48
88
|
catch {
|
|
49
|
-
//
|
|
89
|
+
// Setup discovery is read-only and reports only verified directories.
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return [...existing].sort((left, right) => compareCodeUnits(left, right));
|
|
93
|
+
}
|
|
94
|
+
async function firstExistingDirectory(candidates) {
|
|
95
|
+
for (const candidate of candidates) {
|
|
96
|
+
try {
|
|
97
|
+
if (!(await stat(candidate)).isDirectory())
|
|
98
|
+
continue;
|
|
99
|
+
return await realpath(candidate);
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
// Continue through the ordered setup candidates.
|
|
50
103
|
}
|
|
51
104
|
}
|
|
105
|
+
return undefined;
|
|
106
|
+
}
|
|
107
|
+
function usage() {
|
|
108
|
+
return `HOI4 Agent Tools setup utility
|
|
109
|
+
|
|
110
|
+
Usage:
|
|
111
|
+
hoi4-agent-tools-setup --init [--config PATH] [--mod-root PATH ...] [--game-root PATH] [--workspace-storage-root PATH]
|
|
112
|
+
hoi4-agent-tools-setup --discover
|
|
113
|
+
hoi4-agent-tools-setup --diagnose [--config PATH]
|
|
114
|
+
hoi4-agent-tools-setup --print-client-config [--config PATH]
|
|
115
|
+
|
|
116
|
+
This utility writes only the explicitly requested server config. It never edits an MCP client's settings.`;
|
|
117
|
+
}
|
|
118
|
+
async function discover() {
|
|
119
|
+
const [modRoots, gameRoots] = await Promise.all([
|
|
120
|
+
existingDirectories(standardModRootCandidates()),
|
|
121
|
+
existingDirectories(standardGameRootCandidates()),
|
|
122
|
+
]);
|
|
52
123
|
process.stdout.write(`${JSON.stringify({
|
|
53
124
|
status: 'ok',
|
|
54
|
-
|
|
55
|
-
|
|
125
|
+
modRoots,
|
|
126
|
+
gameRoots,
|
|
56
127
|
}, null, 2)}\n`);
|
|
57
128
|
}
|
|
58
129
|
async function initializeConfig(target) {
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
const writeEnabled = autonomousWrites || reviewedWrites;
|
|
69
|
-
const requestedServerStateRoot = argument('--server-state');
|
|
70
|
-
if (process.argv.includes('--server-state') &&
|
|
71
|
-
(requestedServerStateRoot === undefined || requestedServerStateRoot.startsWith('--'))) {
|
|
72
|
-
throw new Error('--server-state requires a directory path');
|
|
73
|
-
}
|
|
74
|
-
if (writeEnabled && requestedServerStateRoot === undefined) {
|
|
75
|
-
throw new Error('Write-enabled setup requires an explicit --server-state ROOT');
|
|
76
|
-
}
|
|
77
|
-
for (const [flag, value] of [
|
|
78
|
-
['--workspace-id', requestedWorkspaceId],
|
|
79
|
-
['--workspace-name', requestedWorkspaceName],
|
|
80
|
-
]) {
|
|
81
|
-
if (process.argv.includes(flag) && (value === undefined || value.startsWith('--'))) {
|
|
82
|
-
throw new Error(`${flag} requires a value`);
|
|
83
|
-
}
|
|
130
|
+
const absolute = path.resolve(target);
|
|
131
|
+
try {
|
|
132
|
+
await stat(absolute);
|
|
133
|
+
throw new Error(`Configuration already exists: ${absolute}`);
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
if (error.code !== 'ENOENT')
|
|
137
|
+
throw error;
|
|
84
138
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
throw new Error('
|
|
92
|
-
}
|
|
93
|
-
const
|
|
94
|
-
if (
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
?
|
|
100
|
-
: [
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
139
|
+
const explicitModRoots = argumentsFor('--mod-root');
|
|
140
|
+
const modRoots = explicitModRoots.length === 0
|
|
141
|
+
? await existingDirectories(standardModRootCandidates())
|
|
142
|
+
: await existingDirectories(explicitModRoots.map((root) => path.resolve(root)));
|
|
143
|
+
if (modRoots.length === 0 ||
|
|
144
|
+
(modRoots.length !== explicitModRoots.length && explicitModRoots.length > 0)) {
|
|
145
|
+
throw new Error('Setup requires at least one existing mod-root directory');
|
|
146
|
+
}
|
|
147
|
+
const requestedGameRoot = argument('--game-root');
|
|
148
|
+
if (process.argv.includes('--game-root') &&
|
|
149
|
+
(requestedGameRoot === undefined || requestedGameRoot.startsWith('--'))) {
|
|
150
|
+
throw new Error('--game-root requires a path');
|
|
151
|
+
}
|
|
152
|
+
const gameRoot = await firstExistingDirectory(requestedGameRoot === undefined
|
|
153
|
+
? standardGameRootCandidates()
|
|
154
|
+
: [path.resolve(requestedGameRoot)]);
|
|
155
|
+
if (requestedGameRoot !== undefined && gameRoot === undefined) {
|
|
156
|
+
throw new Error('--game-root must be an existing directory');
|
|
157
|
+
}
|
|
158
|
+
const persistent = persistentRoots();
|
|
159
|
+
const requestedStorageRoot = argument('--workspace-storage-root');
|
|
160
|
+
const storageRoot = path.resolve(requestedStorageRoot ?? persistent.workspaceStorageRoot);
|
|
161
|
+
await mkdir(storageRoot, { recursive: true });
|
|
162
|
+
const workspaceStorageRoot = await realpath(storageRoot);
|
|
109
163
|
const config = {
|
|
110
164
|
version: 1,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
registrationRoots,
|
|
116
|
-
writableRegistrationRoots: [],
|
|
117
|
-
workspaces,
|
|
118
|
-
http: {
|
|
119
|
-
host: '127.0.0.1',
|
|
120
|
-
port: 3210,
|
|
121
|
-
allowedOrigins: [],
|
|
122
|
-
tokens: [],
|
|
123
|
-
principals: [],
|
|
124
|
-
},
|
|
165
|
+
serverStateRoot: persistent.serverStateRoot,
|
|
166
|
+
modRoots,
|
|
167
|
+
...(gameRoot === undefined ? {} : { gameRoot }),
|
|
168
|
+
workspaceStorageRoot,
|
|
125
169
|
};
|
|
126
|
-
const absolute = path.resolve(target);
|
|
127
170
|
await mkdir(path.dirname(absolute), { recursive: true });
|
|
128
171
|
await writeFile(absolute, `${JSON.stringify(config, null, 2)}\n`, { flag: 'wx', mode: 0o600 });
|
|
129
172
|
process.stdout.write(`${absolute}\n`);
|
|
@@ -168,25 +211,28 @@ async function diagnose(configPath) {
|
|
|
168
211
|
}
|
|
169
212
|
function printClientConfig(configPath) {
|
|
170
213
|
const absolute = path.resolve(configPath);
|
|
214
|
+
const useDefaultConfiguration = absolute === path.resolve(defaultConfigurationPath());
|
|
171
215
|
const windows = process.platform === 'win32';
|
|
172
216
|
const command = windows ? 'npx.cmd' : 'npx';
|
|
173
217
|
const common = {
|
|
174
218
|
command,
|
|
175
219
|
args: ['-y', `hoi4-agent-tools@${PACKAGE_VERSION}`],
|
|
176
|
-
env: { HOI4_AGENT_CONFIG: absolute },
|
|
220
|
+
...(useDefaultConfiguration ? {} : { env: { HOI4_AGENT_CONFIG: absolute } }),
|
|
177
221
|
};
|
|
178
222
|
const installedCommand = windows ? 'hoi4-agent-tools.cmd' : 'hoi4-agent-tools';
|
|
179
223
|
const installed = {
|
|
180
224
|
command: installedCommand,
|
|
181
225
|
args: [],
|
|
182
|
-
env: { HOI4_AGENT_CONFIG: absolute },
|
|
226
|
+
...(useDefaultConfiguration ? {} : { env: { HOI4_AGENT_CONFIG: absolute } }),
|
|
183
227
|
};
|
|
228
|
+
const npxToml = `[mcp_servers.hoi4_agent_tools]\ncommand = "${command}"\nargs = ["-y", "hoi4-agent-tools@${PACKAGE_VERSION}"]${useDefaultConfiguration ? '' : `\nenv = { HOI4_AGENT_CONFIG = ${JSON.stringify(absolute)} }`}`;
|
|
229
|
+
const globalToml = `[mcp_servers.hoi4_agent_tools]\ncommand = "${installedCommand}"${useDefaultConfiguration ? '' : `\nenv = { HOI4_AGENT_CONFIG = ${JSON.stringify(absolute)} }`}`;
|
|
184
230
|
process.stdout.write(`${JSON.stringify({
|
|
185
231
|
note: 'Review and paste one example into your MCP client; this utility does not edit client settings.',
|
|
186
232
|
generic: { mcpServers: { hoi4_agent_tools: common } },
|
|
187
233
|
globalInstall: { mcpServers: { hoi4_agent_tools: installed } },
|
|
188
|
-
codexToml:
|
|
189
|
-
codexTomlGlobal:
|
|
234
|
+
codexToml: npxToml,
|
|
235
|
+
codexTomlGlobal: globalToml,
|
|
190
236
|
}, null, 2)}\n`);
|
|
191
237
|
}
|
|
192
238
|
async function main() {
|
|
@@ -194,21 +240,25 @@ async function main() {
|
|
|
194
240
|
process.stdout.write(`${usage()}\n`);
|
|
195
241
|
return;
|
|
196
242
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
243
|
+
if (process.argv.includes('--init')) {
|
|
244
|
+
assertKnownArguments(['--init'], ['--config', '--mod-root', '--game-root', '--workspace-storage-root']);
|
|
245
|
+
const target = argument('--config') ?? defaultConfigurationPath();
|
|
246
|
+
await initializeConfig(target);
|
|
200
247
|
return;
|
|
201
248
|
}
|
|
202
249
|
if (process.argv.includes('--discover')) {
|
|
250
|
+
assertKnownArguments(['--discover'], []);
|
|
203
251
|
await discover();
|
|
204
252
|
return;
|
|
205
253
|
}
|
|
206
254
|
const config = configurationPath(process.argv.slice(2));
|
|
207
255
|
if (process.argv.includes('--diagnose')) {
|
|
256
|
+
assertKnownArguments(['--diagnose'], ['--config']);
|
|
208
257
|
await diagnose(config);
|
|
209
258
|
return;
|
|
210
259
|
}
|
|
211
260
|
if (process.argv.includes('--print-client-config')) {
|
|
261
|
+
assertKnownArguments(['--print-client-config'], ['--config']);
|
|
212
262
|
printClientConfig(config);
|
|
213
263
|
return;
|
|
214
264
|
}
|
|
@@ -222,4 +272,3 @@ main().catch((error) => {
|
|
|
222
272
|
})}\n`);
|
|
223
273
|
process.exitCode = 1;
|
|
224
274
|
});
|
|
225
|
-
//# sourceMappingURL=setup.js.map
|
package/dist/bin/stdio.js
CHANGED
|
@@ -4,7 +4,9 @@ import { z } from 'zod/v4';
|
|
|
4
4
|
import { CONFIG_VERSION } from '../version.js';
|
|
5
5
|
import { ServiceError } from './result.js';
|
|
6
6
|
export const HTTP_MAX_SAFE_CONCURRENT_REQUESTS = 2;
|
|
7
|
-
export const
|
|
7
|
+
export const HTTP_MAX_BODY_BYTES = 67_108_864;
|
|
8
|
+
export const HTTP_MAX_AGGREGATE_BODY_BYTES = 134_217_728;
|
|
9
|
+
export const HTTP_DEFAULT_SESSION_EVENT_BYTES = 2_097_152;
|
|
8
10
|
export const WORKSPACE_MAX_REGISTRATIONS = 1_000;
|
|
9
11
|
const WORKSPACE_MAX_SOURCE_ROOTS = 16;
|
|
10
12
|
const WORKSPACE_MAX_PATHS = 1_000;
|
|
@@ -90,7 +92,6 @@ export const workspaceRegistrationSchema = z
|
|
|
90
92
|
artifactRoot: z.string().min(1).optional(),
|
|
91
93
|
cacheRoot: z.string().min(1).optional(),
|
|
92
94
|
fixtureRoot: z.string().min(1).optional(),
|
|
93
|
-
writeEnabled: z.boolean().default(false),
|
|
94
95
|
})
|
|
95
96
|
.strict()
|
|
96
97
|
.superRefine((value, context) => {
|
|
@@ -106,36 +107,27 @@ const tokenSchema = z
|
|
|
106
107
|
.object({
|
|
107
108
|
principal: z.string().regex(/^[A-Za-z0-9._@-]{1,128}$/),
|
|
108
109
|
tokenEnv: z.string().regex(/^[A-Z][A-Z0-9_]{1,127}$/),
|
|
109
|
-
workspaceIds: z.array(z.string()).
|
|
110
|
-
|
|
110
|
+
workspaceIds: z.array(z.string()).max(WORKSPACE_MAX_REGISTRATIONS).default([]),
|
|
111
|
+
allowDiscoveredMods: z.boolean().default(false),
|
|
111
112
|
})
|
|
112
113
|
.strict();
|
|
113
114
|
const principalSchema = z
|
|
114
115
|
.object({
|
|
115
116
|
principal: z.string().regex(/^[A-Za-z0-9._@:-]{1,256}$/),
|
|
116
117
|
workspaceIds: z.array(z.string()).max(WORKSPACE_MAX_REGISTRATIONS).default([]),
|
|
117
|
-
|
|
118
|
+
allowDiscoveredMods: z.boolean().default(false),
|
|
118
119
|
})
|
|
119
120
|
.strict();
|
|
120
121
|
export const serverConfigurationSchema = z
|
|
121
122
|
.object({
|
|
122
123
|
version: z.literal(CONFIG_VERSION),
|
|
123
|
-
writePolicy: z.enum(['read-only', 'transactions', 'autonomous']).default('read-only'),
|
|
124
124
|
serverStateRoot: z
|
|
125
125
|
.string()
|
|
126
126
|
.min(1)
|
|
127
127
|
.refine((value) => path.isAbsolute(value), {
|
|
128
|
-
message: 'Server state root must be an absolute
|
|
128
|
+
message: 'Server state root must be an absolute private path',
|
|
129
129
|
})
|
|
130
130
|
.optional(),
|
|
131
|
-
transactionTtlSeconds: z.number().int().min(60).max(86_400).default(3600),
|
|
132
|
-
transactionMaxJournalBytes: z
|
|
133
|
-
.number()
|
|
134
|
-
.int()
|
|
135
|
-
.min(1_048_576)
|
|
136
|
-
.max(Number.MAX_SAFE_INTEGER)
|
|
137
|
-
.default(536_870_912),
|
|
138
|
-
transactionMaxJournals: z.number().int().min(1).max(10_000).default(128),
|
|
139
131
|
scanMaxFiles: z.number().int().min(1).max(1_000_000).default(20_000),
|
|
140
132
|
scanMaxBytes: z.number().int().min(1_048_576).max(Number.MAX_SAFE_INTEGER).default(134_217_728),
|
|
141
133
|
scanMaxFileBytes: z.number().int().min(65_536).max(Number.MAX_SAFE_INTEGER).default(67_108_864),
|
|
@@ -152,11 +144,9 @@ export const serverConfigurationSchema = z
|
|
|
152
144
|
.min(1_048_576)
|
|
153
145
|
.max(Number.MAX_SAFE_INTEGER)
|
|
154
146
|
.default(134_217_728),
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
.max(WORKSPACE_MAX_SOURCE_ROOTS)
|
|
159
|
-
.default([]),
|
|
147
|
+
modRoots: z.array(z.string().min(1)).max(WORKSPACE_MAX_SOURCE_ROOTS).default([]),
|
|
148
|
+
gameRoot: z.string().min(1).optional(),
|
|
149
|
+
workspaceStorageRoot: z.string().min(1).optional(),
|
|
160
150
|
storageRoots: z.array(z.string().min(1)).max(WORKSPACE_MAX_SOURCE_ROOTS).default([]),
|
|
161
151
|
workspaces: z.array(workspaceRegistrationSchema).max(WORKSPACE_MAX_REGISTRATIONS).default([]),
|
|
162
152
|
http: z
|
|
@@ -181,7 +171,12 @@ export const serverConfigurationSchema = z
|
|
|
181
171
|
})
|
|
182
172
|
.strict()
|
|
183
173
|
.optional(),
|
|
184
|
-
maxBodyBytes: z
|
|
174
|
+
maxBodyBytes: z
|
|
175
|
+
.number()
|
|
176
|
+
.int()
|
|
177
|
+
.min(1024)
|
|
178
|
+
.max(HTTP_MAX_BODY_BYTES)
|
|
179
|
+
.default(HTTP_MAX_BODY_BYTES),
|
|
185
180
|
headersTimeoutMs: z.number().int().min(1_000).max(120_000).default(10_000),
|
|
186
181
|
requestTimeoutMs: z.number().int().min(1_000).max(300_000).default(30_000),
|
|
187
182
|
keepAliveTimeoutMs: z.number().int().min(1_000).max(120_000).default(5_000),
|
|
@@ -197,7 +192,12 @@ export const serverConfigurationSchema = z
|
|
|
197
192
|
maxSessionsPerPrincipal: z.number().int().min(1).max(10_000).default(32),
|
|
198
193
|
maxEventStreams: z.number().int().min(1).max(10_000).default(32),
|
|
199
194
|
maxEventStreamsPerPrincipal: z.number().int().min(1).max(10_000).default(4),
|
|
200
|
-
maxSessionEventBytes: z
|
|
195
|
+
maxSessionEventBytes: z
|
|
196
|
+
.number()
|
|
197
|
+
.int()
|
|
198
|
+
.min(65_536)
|
|
199
|
+
.max(67_108_864)
|
|
200
|
+
.default(HTTP_DEFAULT_SESSION_EVENT_BYTES),
|
|
201
201
|
maxEventStoreBytes: z.number().int().min(65_536).max(268_435_456).default(16_777_216),
|
|
202
202
|
requestsPerMinute: z.number().int().min(1).max(100_000).default(120),
|
|
203
203
|
sessionTtlSeconds: z.number().int().min(60).max(86_400).default(3600),
|
|
@@ -257,7 +257,7 @@ export const serverConfigurationSchema = z
|
|
|
257
257
|
trustedProxyAddresses: [],
|
|
258
258
|
tokens: [],
|
|
259
259
|
principals: [],
|
|
260
|
-
maxBodyBytes:
|
|
260
|
+
maxBodyBytes: HTTP_MAX_BODY_BYTES,
|
|
261
261
|
headersTimeoutMs: 10_000,
|
|
262
262
|
requestTimeoutMs: 30_000,
|
|
263
263
|
keepAliveTimeoutMs: 5_000,
|
|
@@ -268,7 +268,7 @@ export const serverConfigurationSchema = z
|
|
|
268
268
|
maxSessionsPerPrincipal: 32,
|
|
269
269
|
maxEventStreams: 32,
|
|
270
270
|
maxEventStreamsPerPrincipal: 4,
|
|
271
|
-
maxSessionEventBytes:
|
|
271
|
+
maxSessionEventBytes: HTTP_DEFAULT_SESSION_EVENT_BYTES,
|
|
272
272
|
maxEventStoreBytes: 16_777_216,
|
|
273
273
|
requestsPerMinute: 120,
|
|
274
274
|
sessionTtlSeconds: 3600,
|
|
@@ -276,11 +276,12 @@ export const serverConfigurationSchema = z
|
|
|
276
276
|
})
|
|
277
277
|
.strict()
|
|
278
278
|
.superRefine((value, context) => {
|
|
279
|
-
|
|
279
|
+
const hasModWorkspace = value.workspaces.some(({ kind }) => kind === 'mod');
|
|
280
|
+
if ((value.modRoots.length > 0 || hasModWorkspace) && value.serverStateRoot === undefined) {
|
|
280
281
|
context.addIssue({
|
|
281
282
|
code: 'custom',
|
|
282
283
|
path: ['serverStateRoot'],
|
|
283
|
-
message: '
|
|
284
|
+
message: 'Writable mod workspaces require a separate private server state root',
|
|
284
285
|
});
|
|
285
286
|
}
|
|
286
287
|
if (value.scanMaxFileBytes > value.scanMaxBytes) {
|
|
@@ -332,7 +333,7 @@ export const serverConfigurationSchema = z
|
|
|
332
333
|
context.addIssue({
|
|
333
334
|
code: 'custom',
|
|
334
335
|
path: ['http', 'maxBodyBytes'],
|
|
335
|
-
message: 'HTTP body-byte ceiling multiplied by concurrency must not exceed
|
|
336
|
+
message: 'HTTP body-byte ceiling multiplied by concurrency must not exceed 128 MiB',
|
|
336
337
|
});
|
|
337
338
|
}
|
|
338
339
|
});
|
|
@@ -380,4 +381,3 @@ export async function loadConfiguration(filePath) {
|
|
|
380
381
|
}
|
|
381
382
|
return result.data;
|
|
382
383
|
}
|
|
383
|
-
//# sourceMappingURL=configuration.js.map
|
|
@@ -3,6 +3,9 @@ import { SymbolIndex } from './index.js';
|
|
|
3
3
|
import { WorkspaceScanner } from './scanner.js';
|
|
4
4
|
import { ArtifactStore } from './artifacts.js';
|
|
5
5
|
import { TransactionManager } from './transactions.js';
|
|
6
|
+
const RECOVERY_TTL_SECONDS = 3_600;
|
|
7
|
+
const RECOVERY_MAX_BYTES = 536_870_912;
|
|
8
|
+
const RECOVERY_MAX_RECORDS = 128;
|
|
6
9
|
function abortReason(signal) {
|
|
7
10
|
return signal.reason instanceof Error
|
|
8
11
|
? signal.reason
|
|
@@ -67,38 +70,21 @@ export class CoreEngine {
|
|
|
67
70
|
new ArtifactStore(resolver.config().artifactMaxBytes, resolver.config().artifactMaxEntries, resolver.config().artifactMaxSingleBytes);
|
|
68
71
|
this.transactions =
|
|
69
72
|
services.transactions ??
|
|
70
|
-
new TransactionManager(resolver, this.artifacts,
|
|
73
|
+
new TransactionManager(resolver, this.artifacts, RECOVERY_TTL_SECONDS, RECOVERY_MAX_BYTES, RECOVERY_MAX_RECORDS, resolver.serverState());
|
|
71
74
|
}
|
|
72
75
|
async initialize() {
|
|
73
76
|
for (const workspace of this.resolver.list()) {
|
|
74
|
-
// Recovery
|
|
75
|
-
// transaction must be restored even if the operator restarts read-only.
|
|
77
|
+
// Recovery repairs an interrupted internal rewrite before the workspace is exposed.
|
|
76
78
|
await this.transactions.recover(workspace.id);
|
|
77
79
|
}
|
|
78
80
|
}
|
|
79
|
-
async register(registration, principal, signal) {
|
|
80
|
-
signal?.throwIfAborted();
|
|
81
|
-
const workspace = await this.resolver.register(registration, principal, signal);
|
|
82
|
-
// Runtime registrations are intentionally not persisted, so startup could not
|
|
83
|
-
// discover an interrupted journal for this root. Recover it before exposing the
|
|
84
|
-
// workspace or allowing another write transaction.
|
|
85
|
-
try {
|
|
86
|
-
await this.transactions.recover(workspace.id, principal, signal);
|
|
87
|
-
}
|
|
88
|
-
catch (error) {
|
|
89
|
-
this.resolver.unregisterRuntime(workspace.id, principal);
|
|
90
|
-
throw error;
|
|
91
|
-
}
|
|
92
|
-
return this.status(workspace.id, principal);
|
|
93
|
-
}
|
|
94
81
|
status(workspaceId, principal) {
|
|
95
82
|
const workspace = this.resolver.get(workspaceId, principal);
|
|
96
83
|
return {
|
|
97
84
|
id: workspace.id,
|
|
98
85
|
name: workspace.name,
|
|
99
86
|
kind: workspace.registration.kind,
|
|
100
|
-
|
|
101
|
-
writePolicy: this.resolver.config().writePolicy,
|
|
87
|
+
writable: workspace.writeEnabled,
|
|
102
88
|
rootKinds: [...new Set(workspace.roots.map(({ kind }) => kind))].sort((a, b) => compareCodeUnits(a, b)),
|
|
103
89
|
dependencyCount: workspace.dependencyRoots.length,
|
|
104
90
|
replacePaths: [...workspace.registration.replacePaths].sort((a, b) => compareCodeUnits(a, b)),
|
|
@@ -317,4 +303,3 @@ export class CoreEngine {
|
|
|
317
303
|
return SymbolIndex.build(files);
|
|
318
304
|
}
|
|
319
305
|
}
|
|
320
|
-
//# sourceMappingURL=engine.js.map
|