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.
Files changed (416) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/LICENSE +201 -0
  3. package/README.md +140 -2
  4. package/SECURITY.md +17 -0
  5. package/dist/bin/http.d.ts +3 -0
  6. package/dist/bin/http.d.ts.map +1 -0
  7. package/dist/bin/http.js +27 -0
  8. package/dist/bin/http.js.map +1 -0
  9. package/dist/bin/setup.d.ts +3 -0
  10. package/dist/bin/setup.d.ts.map +1 -0
  11. package/dist/bin/setup.js +188 -0
  12. package/dist/bin/setup.js.map +1 -0
  13. package/dist/bin/stdio.d.ts +3 -0
  14. package/dist/bin/stdio.d.ts.map +1 -0
  15. package/dist/bin/stdio.js +36 -0
  16. package/dist/bin/stdio.js.map +1 -0
  17. package/dist/hoi4_agent_tools/core/artifacts.d.ts +117 -0
  18. package/dist/hoi4_agent_tools/core/artifacts.d.ts.map +1 -0
  19. package/dist/hoi4_agent_tools/core/artifacts.js +1047 -0
  20. package/dist/hoi4_agent_tools/core/artifacts.js.map +1 -0
  21. package/dist/hoi4_agent_tools/core/canonical.d.ts +13 -0
  22. package/dist/hoi4_agent_tools/core/canonical.d.ts.map +1 -0
  23. package/dist/hoi4_agent_tools/core/canonical.js +41 -0
  24. package/dist/hoi4_agent_tools/core/canonical.js.map +1 -0
  25. package/dist/hoi4_agent_tools/core/configuration.d.ts +137 -0
  26. package/dist/hoi4_agent_tools/core/configuration.d.ts.map +1 -0
  27. package/dist/hoi4_agent_tools/core/configuration.js +383 -0
  28. package/dist/hoi4_agent_tools/core/configuration.js.map +1 -0
  29. package/dist/hoi4_agent_tools/core/diagnostic-collector.d.ts +18 -0
  30. package/dist/hoi4_agent_tools/core/diagnostic-collector.d.ts.map +1 -0
  31. package/dist/hoi4_agent_tools/core/diagnostic-collector.js +45 -0
  32. package/dist/hoi4_agent_tools/core/diagnostic-collector.js.map +1 -0
  33. package/dist/hoi4_agent_tools/core/diagnostics.d.ts +26 -0
  34. package/dist/hoi4_agent_tools/core/diagnostics.d.ts.map +1 -0
  35. package/dist/hoi4_agent_tools/core/diagnostics.js +25 -0
  36. package/dist/hoi4_agent_tools/core/diagnostics.js.map +1 -0
  37. package/dist/hoi4_agent_tools/core/diff.d.ts +22 -0
  38. package/dist/hoi4_agent_tools/core/diff.d.ts.map +1 -0
  39. package/dist/hoi4_agent_tools/core/diff.js +93 -0
  40. package/dist/hoi4_agent_tools/core/diff.js.map +1 -0
  41. package/dist/hoi4_agent_tools/core/engine.d.ts +56 -0
  42. package/dist/hoi4_agent_tools/core/engine.d.ts.map +1 -0
  43. package/dist/hoi4_agent_tools/core/engine.js +319 -0
  44. package/dist/hoi4_agent_tools/core/engine.js.map +1 -0
  45. package/dist/hoi4_agent_tools/core/image-diff.d.ts +14 -0
  46. package/dist/hoi4_agent_tools/core/image-diff.d.ts.map +1 -0
  47. package/dist/hoi4_agent_tools/core/image-diff.js +121 -0
  48. package/dist/hoi4_agent_tools/core/image-diff.js.map +1 -0
  49. package/dist/hoi4_agent_tools/core/index.d.ts +64 -0
  50. package/dist/hoi4_agent_tools/core/index.d.ts.map +1 -0
  51. package/dist/hoi4_agent_tools/core/index.js +963 -0
  52. package/dist/hoi4_agent_tools/core/index.js.map +1 -0
  53. package/dist/hoi4_agent_tools/core/index.public.d.ts +16 -0
  54. package/dist/hoi4_agent_tools/core/index.public.d.ts.map +1 -0
  55. package/dist/hoi4_agent_tools/core/index.public.js +16 -0
  56. package/dist/hoi4_agent_tools/core/index.public.js.map +1 -0
  57. package/dist/hoi4_agent_tools/core/render-budget.d.ts +51 -0
  58. package/dist/hoi4_agent_tools/core/render-budget.d.ts.map +1 -0
  59. package/dist/hoi4_agent_tools/core/render-budget.js +109 -0
  60. package/dist/hoi4_agent_tools/core/render-budget.js.map +1 -0
  61. package/dist/hoi4_agent_tools/core/result.d.ts +45 -0
  62. package/dist/hoi4_agent_tools/core/result.d.ts.map +1 -0
  63. package/dist/hoi4_agent_tools/core/result.js +26 -0
  64. package/dist/hoi4_agent_tools/core/result.js.map +1 -0
  65. package/dist/hoi4_agent_tools/core/scanner.d.ts +28 -0
  66. package/dist/hoi4_agent_tools/core/scanner.d.ts.map +1 -0
  67. package/dist/hoi4_agent_tools/core/scanner.js +136 -0
  68. package/dist/hoi4_agent_tools/core/scanner.js.map +1 -0
  69. package/dist/hoi4_agent_tools/core/server-state.d.ts +31 -0
  70. package/dist/hoi4_agent_tools/core/server-state.d.ts.map +1 -0
  71. package/dist/hoi4_agent_tools/core/server-state.js +413 -0
  72. package/dist/hoi4_agent_tools/core/server-state.js.map +1 -0
  73. package/dist/hoi4_agent_tools/core/source/encoding.d.ts +10 -0
  74. package/dist/hoi4_agent_tools/core/source/encoding.d.ts.map +1 -0
  75. package/dist/hoi4_agent_tools/core/source/encoding.js +54 -0
  76. package/dist/hoi4_agent_tools/core/source/encoding.js.map +1 -0
  77. package/dist/hoi4_agent_tools/core/source/index.d.ts +7 -0
  78. package/dist/hoi4_agent_tools/core/source/index.d.ts.map +1 -0
  79. package/dist/hoi4_agent_tools/core/source/index.js +7 -0
  80. package/dist/hoi4_agent_tools/core/source/index.js.map +1 -0
  81. package/dist/hoi4_agent_tools/core/source/lexer.d.ts +30 -0
  82. package/dist/hoi4_agent_tools/core/source/lexer.d.ts.map +1 -0
  83. package/dist/hoi4_agent_tools/core/source/lexer.js +266 -0
  84. package/dist/hoi4_agent_tools/core/source/lexer.js.map +1 -0
  85. package/dist/hoi4_agent_tools/core/source/limits.d.ts +21 -0
  86. package/dist/hoi4_agent_tools/core/source/limits.d.ts.map +1 -0
  87. package/dist/hoi4_agent_tools/core/source/limits.js +49 -0
  88. package/dist/hoi4_agent_tools/core/source/limits.js.map +1 -0
  89. package/dist/hoi4_agent_tools/core/source/localisation.d.ts +20 -0
  90. package/dist/hoi4_agent_tools/core/source/localisation.d.ts.map +1 -0
  91. package/dist/hoi4_agent_tools/core/source/localisation.js +163 -0
  92. package/dist/hoi4_agent_tools/core/source/localisation.js.map +1 -0
  93. package/dist/hoi4_agent_tools/core/source/parser.d.ts +44 -0
  94. package/dist/hoi4_agent_tools/core/source/parser.d.ts.map +1 -0
  95. package/dist/hoi4_agent_tools/core/source/parser.js +334 -0
  96. package/dist/hoi4_agent_tools/core/source/parser.js.map +1 -0
  97. package/dist/hoi4_agent_tools/core/source/rewrite.d.ts +10 -0
  98. package/dist/hoi4_agent_tools/core/source/rewrite.d.ts.map +1 -0
  99. package/dist/hoi4_agent_tools/core/source/rewrite.js +28 -0
  100. package/dist/hoi4_agent_tools/core/source/rewrite.js.map +1 -0
  101. package/dist/hoi4_agent_tools/core/svg-text.d.ts +34 -0
  102. package/dist/hoi4_agent_tools/core/svg-text.d.ts.map +1 -0
  103. package/dist/hoi4_agent_tools/core/svg-text.js +127 -0
  104. package/dist/hoi4_agent_tools/core/svg-text.js.map +1 -0
  105. package/dist/hoi4_agent_tools/core/transaction-limits.d.ts +9 -0
  106. package/dist/hoi4_agent_tools/core/transaction-limits.d.ts.map +1 -0
  107. package/dist/hoi4_agent_tools/core/transaction-limits.js +9 -0
  108. package/dist/hoi4_agent_tools/core/transaction-limits.js.map +1 -0
  109. package/dist/hoi4_agent_tools/core/transactions.d.ts +162 -0
  110. package/dist/hoi4_agent_tools/core/transactions.d.ts.map +1 -0
  111. package/dist/hoi4_agent_tools/core/transactions.js +1181 -0
  112. package/dist/hoi4_agent_tools/core/transactions.js.map +1 -0
  113. package/dist/hoi4_agent_tools/core/workspace.d.ts +68 -0
  114. package/dist/hoi4_agent_tools/core/workspace.d.ts.map +1 -0
  115. package/dist/hoi4_agent_tools/core/workspace.js +794 -0
  116. package/dist/hoi4_agent_tools/core/workspace.js.map +1 -0
  117. package/dist/hoi4_agent_tools/focus/compiler.d.ts +9 -0
  118. package/dist/hoi4_agent_tools/focus/compiler.d.ts.map +1 -0
  119. package/dist/hoi4_agent_tools/focus/compiler.js +273 -0
  120. package/dist/hoi4_agent_tools/focus/compiler.js.map +1 -0
  121. package/dist/hoi4_agent_tools/focus/continuous-render.d.ts +32 -0
  122. package/dist/hoi4_agent_tools/focus/continuous-render.d.ts.map +1 -0
  123. package/dist/hoi4_agent_tools/focus/continuous-render.js +179 -0
  124. package/dist/hoi4_agent_tools/focus/continuous-render.js.map +1 -0
  125. package/dist/hoi4_agent_tools/focus/drift.d.ts +22 -0
  126. package/dist/hoi4_agent_tools/focus/drift.d.ts.map +1 -0
  127. package/dist/hoi4_agent_tools/focus/drift.js +124 -0
  128. package/dist/hoi4_agent_tools/focus/drift.js.map +1 -0
  129. package/dist/hoi4_agent_tools/focus/geometry.d.ts +17 -0
  130. package/dist/hoi4_agent_tools/focus/geometry.d.ts.map +1 -0
  131. package/dist/hoi4_agent_tools/focus/geometry.js +35 -0
  132. package/dist/hoi4_agent_tools/focus/geometry.js.map +1 -0
  133. package/dist/hoi4_agent_tools/focus/importer.d.ts +9 -0
  134. package/dist/hoi4_agent_tools/focus/importer.d.ts.map +1 -0
  135. package/dist/hoi4_agent_tools/focus/importer.js +732 -0
  136. package/dist/hoi4_agent_tools/focus/importer.js.map +1 -0
  137. package/dist/hoi4_agent_tools/focus/index.d.ts +14 -0
  138. package/dist/hoi4_agent_tools/focus/index.d.ts.map +1 -0
  139. package/dist/hoi4_agent_tools/focus/index.js +14 -0
  140. package/dist/hoi4_agent_tools/focus/index.js.map +1 -0
  141. package/dist/hoi4_agent_tools/focus/layout.d.ts +5 -0
  142. package/dist/hoi4_agent_tools/focus/layout.d.ts.map +1 -0
  143. package/dist/hoi4_agent_tools/focus/layout.js +653 -0
  144. package/dist/hoi4_agent_tools/focus/layout.js.map +1 -0
  145. package/dist/hoi4_agent_tools/focus/limits.d.ts +9 -0
  146. package/dist/hoi4_agent_tools/focus/limits.d.ts.map +1 -0
  147. package/dist/hoi4_agent_tools/focus/limits.js +9 -0
  148. package/dist/hoi4_agent_tools/focus/limits.js.map +1 -0
  149. package/dist/hoi4_agent_tools/focus/lint.d.ts +14 -0
  150. package/dist/hoi4_agent_tools/focus/lint.d.ts.map +1 -0
  151. package/dist/hoi4_agent_tools/focus/lint.js +839 -0
  152. package/dist/hoi4_agent_tools/focus/lint.js.map +1 -0
  153. package/dist/hoi4_agent_tools/focus/model.d.ts +303 -0
  154. package/dist/hoi4_agent_tools/focus/model.d.ts.map +1 -0
  155. package/dist/hoi4_agent_tools/focus/model.js +20 -0
  156. package/dist/hoi4_agent_tools/focus/model.js.map +1 -0
  157. package/dist/hoi4_agent_tools/focus/native-effects.d.ts +9 -0
  158. package/dist/hoi4_agent_tools/focus/native-effects.d.ts.map +1 -0
  159. package/dist/hoi4_agent_tools/focus/native-effects.js +563 -0
  160. package/dist/hoi4_agent_tools/focus/native-effects.js.map +1 -0
  161. package/dist/hoi4_agent_tools/focus/planning.d.ts +15 -0
  162. package/dist/hoi4_agent_tools/focus/planning.d.ts.map +1 -0
  163. package/dist/hoi4_agent_tools/focus/planning.js +241 -0
  164. package/dist/hoi4_agent_tools/focus/planning.js.map +1 -0
  165. package/dist/hoi4_agent_tools/focus/presentation.d.ts +24 -0
  166. package/dist/hoi4_agent_tools/focus/presentation.d.ts.map +1 -0
  167. package/dist/hoi4_agent_tools/focus/presentation.js +204 -0
  168. package/dist/hoi4_agent_tools/focus/presentation.js.map +1 -0
  169. package/dist/hoi4_agent_tools/focus/render.d.ts +35 -0
  170. package/dist/hoi4_agent_tools/focus/render.d.ts.map +1 -0
  171. package/dist/hoi4_agent_tools/focus/render.js +491 -0
  172. package/dist/hoi4_agent_tools/focus/render.js.map +1 -0
  173. package/dist/hoi4_agent_tools/focus/service.d.ts +82 -0
  174. package/dist/hoi4_agent_tools/focus/service.d.ts.map +1 -0
  175. package/dist/hoi4_agent_tools/focus/service.js +492 -0
  176. package/dist/hoi4_agent_tools/focus/service.js.map +1 -0
  177. package/dist/hoi4_agent_tools/focus/source-update.d.ts +6 -0
  178. package/dist/hoi4_agent_tools/focus/source-update.d.ts.map +1 -0
  179. package/dist/hoi4_agent_tools/focus/source-update.js +328 -0
  180. package/dist/hoi4_agent_tools/focus/source-update.js.map +1 -0
  181. package/dist/hoi4_agent_tools/gui/animation-manifest.d.ts +37 -0
  182. package/dist/hoi4_agent_tools/gui/animation-manifest.d.ts.map +1 -0
  183. package/dist/hoi4_agent_tools/gui/animation-manifest.js +66 -0
  184. package/dist/hoi4_agent_tools/gui/animation-manifest.js.map +1 -0
  185. package/dist/hoi4_agent_tools/gui/assets.d.ts +71 -0
  186. package/dist/hoi4_agent_tools/gui/assets.d.ts.map +1 -0
  187. package/dist/hoi4_agent_tools/gui/assets.js +629 -0
  188. package/dist/hoi4_agent_tools/gui/assets.js.map +1 -0
  189. package/dist/hoi4_agent_tools/gui/dds.d.ts +17 -0
  190. package/dist/hoi4_agent_tools/gui/dds.d.ts.map +1 -0
  191. package/dist/hoi4_agent_tools/gui/dds.js +245 -0
  192. package/dist/hoi4_agent_tools/gui/dds.js.map +1 -0
  193. package/dist/hoi4_agent_tools/gui/helpers.d.ts +101 -0
  194. package/dist/hoi4_agent_tools/gui/helpers.d.ts.map +1 -0
  195. package/dist/hoi4_agent_tools/gui/helpers.js +1072 -0
  196. package/dist/hoi4_agent_tools/gui/helpers.js.map +1 -0
  197. package/dist/hoi4_agent_tools/gui/index.d.ts +15 -0
  198. package/dist/hoi4_agent_tools/gui/index.d.ts.map +1 -0
  199. package/dist/hoi4_agent_tools/gui/index.js +15 -0
  200. package/dist/hoi4_agent_tools/gui/index.js.map +1 -0
  201. package/dist/hoi4_agent_tools/gui/layout.d.ts +6 -0
  202. package/dist/hoi4_agent_tools/gui/layout.d.ts.map +1 -0
  203. package/dist/hoi4_agent_tools/gui/layout.js +753 -0
  204. package/dist/hoi4_agent_tools/gui/layout.js.map +1 -0
  205. package/dist/hoi4_agent_tools/gui/limits.d.ts +25 -0
  206. package/dist/hoi4_agent_tools/gui/limits.d.ts.map +1 -0
  207. package/dist/hoi4_agent_tools/gui/limits.js +27 -0
  208. package/dist/hoi4_agent_tools/gui/limits.js.map +1 -0
  209. package/dist/hoi4_agent_tools/gui/renderer.d.ts +18 -0
  210. package/dist/hoi4_agent_tools/gui/renderer.d.ts.map +1 -0
  211. package/dist/hoi4_agent_tools/gui/renderer.js +388 -0
  212. package/dist/hoi4_agent_tools/gui/renderer.js.map +1 -0
  213. package/dist/hoi4_agent_tools/gui/scenario.d.ts +66 -0
  214. package/dist/hoi4_agent_tools/gui/scenario.d.ts.map +1 -0
  215. package/dist/hoi4_agent_tools/gui/scenario.js +191 -0
  216. package/dist/hoi4_agent_tools/gui/scenario.js.map +1 -0
  217. package/dist/hoi4_agent_tools/gui/source-graph.d.ts +7 -0
  218. package/dist/hoi4_agent_tools/gui/source-graph.d.ts.map +1 -0
  219. package/dist/hoi4_agent_tools/gui/source-graph.js +1074 -0
  220. package/dist/hoi4_agent_tools/gui/source-graph.js.map +1 -0
  221. package/dist/hoi4_agent_tools/gui/source-patch.d.ts +13 -0
  222. package/dist/hoi4_agent_tools/gui/source-patch.d.ts.map +1 -0
  223. package/dist/hoi4_agent_tools/gui/source-patch.js +90 -0
  224. package/dist/hoi4_agent_tools/gui/source-patch.js.map +1 -0
  225. package/dist/hoi4_agent_tools/gui/studio.d.ts +86 -0
  226. package/dist/hoi4_agent_tools/gui/studio.d.ts.map +1 -0
  227. package/dist/hoi4_agent_tools/gui/studio.js +830 -0
  228. package/dist/hoi4_agent_tools/gui/studio.js.map +1 -0
  229. package/dist/hoi4_agent_tools/gui/tga.d.ts +16 -0
  230. package/dist/hoi4_agent_tools/gui/tga.d.ts.map +1 -0
  231. package/dist/hoi4_agent_tools/gui/tga.js +157 -0
  232. package/dist/hoi4_agent_tools/gui/tga.js.map +1 -0
  233. package/dist/hoi4_agent_tools/gui/types.d.ts +322 -0
  234. package/dist/hoi4_agent_tools/gui/types.d.ts.map +1 -0
  235. package/dist/hoi4_agent_tools/gui/types.js +19 -0
  236. package/dist/hoi4_agent_tools/gui/types.js.map +1 -0
  237. package/dist/hoi4_agent_tools/gui/validators.d.ts +8 -0
  238. package/dist/hoi4_agent_tools/gui/validators.d.ts.map +1 -0
  239. package/dist/hoi4_agent_tools/gui/validators.js +951 -0
  240. package/dist/hoi4_agent_tools/gui/validators.js.map +1 -0
  241. package/dist/hoi4_agent_tools/map/bmp.d.ts +62 -0
  242. package/dist/hoi4_agent_tools/map/bmp.d.ts.map +1 -0
  243. package/dist/hoi4_agent_tools/map/bmp.js +363 -0
  244. package/dist/hoi4_agent_tools/map/bmp.js.map +1 -0
  245. package/dist/hoi4_agent_tools/map/diagnostic-limit.d.ts +5 -0
  246. package/dist/hoi4_agent_tools/map/diagnostic-limit.d.ts.map +1 -0
  247. package/dist/hoi4_agent_tools/map/diagnostic-limit.js +21 -0
  248. package/dist/hoi4_agent_tools/map/diagnostic-limit.js.map +1 -0
  249. package/dist/hoi4_agent_tools/map/index.d.ts +8 -0
  250. package/dist/hoi4_agent_tools/map/index.d.ts.map +1 -0
  251. package/dist/hoi4_agent_tools/map/index.js +8 -0
  252. package/dist/hoi4_agent_tools/map/index.js.map +1 -0
  253. package/dist/hoi4_agent_tools/map/limits.d.ts +13 -0
  254. package/dist/hoi4_agent_tools/map/limits.d.ts.map +1 -0
  255. package/dist/hoi4_agent_tools/map/limits.js +13 -0
  256. package/dist/hoi4_agent_tools/map/limits.js.map +1 -0
  257. package/dist/hoi4_agent_tools/map/model.d.ts +269 -0
  258. package/dist/hoi4_agent_tools/map/model.d.ts.map +1 -0
  259. package/dist/hoi4_agent_tools/map/model.js +1114 -0
  260. package/dist/hoi4_agent_tools/map/model.js.map +1 -0
  261. package/dist/hoi4_agent_tools/map/operations.d.ts +401 -0
  262. package/dist/hoi4_agent_tools/map/operations.d.ts.map +1 -0
  263. package/dist/hoi4_agent_tools/map/operations.js +2717 -0
  264. package/dist/hoi4_agent_tools/map/operations.js.map +1 -0
  265. package/dist/hoi4_agent_tools/map/render.d.ts +90 -0
  266. package/dist/hoi4_agent_tools/map/render.d.ts.map +1 -0
  267. package/dist/hoi4_agent_tools/map/render.js +759 -0
  268. package/dist/hoi4_agent_tools/map/render.js.map +1 -0
  269. package/dist/hoi4_agent_tools/map/service.d.ts +81 -0
  270. package/dist/hoi4_agent_tools/map/service.d.ts.map +1 -0
  271. package/dist/hoi4_agent_tools/map/service.js +695 -0
  272. package/dist/hoi4_agent_tools/map/service.js.map +1 -0
  273. package/dist/hoi4_agent_tools/map/validation.d.ts +23 -0
  274. package/dist/hoi4_agent_tools/map/validation.d.ts.map +1 -0
  275. package/dist/hoi4_agent_tools/map/validation.js +1177 -0
  276. package/dist/hoi4_agent_tools/map/validation.js.map +1 -0
  277. package/dist/hoi4_agent_tools/mcp/prompts/register.d.ts +3 -0
  278. package/dist/hoi4_agent_tools/mcp/prompts/register.d.ts.map +1 -0
  279. package/dist/hoi4_agent_tools/mcp/prompts/register.js +50 -0
  280. package/dist/hoi4_agent_tools/mcp/prompts/register.js.map +1 -0
  281. package/dist/hoi4_agent_tools/mcp/registry/metadata.d.ts +9 -0
  282. package/dist/hoi4_agent_tools/mcp/registry/metadata.d.ts.map +1 -0
  283. package/dist/hoi4_agent_tools/mcp/registry/metadata.js +10 -0
  284. package/dist/hoi4_agent_tools/mcp/registry/metadata.js.map +1 -0
  285. package/dist/hoi4_agent_tools/mcp/resources/register.d.ts +5 -0
  286. package/dist/hoi4_agent_tools/mcp/resources/register.d.ts.map +1 -0
  287. package/dist/hoi4_agent_tools/mcp/resources/register.js +278 -0
  288. package/dist/hoi4_agent_tools/mcp/resources/register.js.map +1 -0
  289. package/dist/hoi4_agent_tools/mcp/security/auth.d.ts +24 -0
  290. package/dist/hoi4_agent_tools/mcp/security/auth.d.ts.map +1 -0
  291. package/dist/hoi4_agent_tools/mcp/security/auth.js +234 -0
  292. package/dist/hoi4_agent_tools/mcp/security/auth.js.map +1 -0
  293. package/dist/hoi4_agent_tools/mcp/server/base-tools.d.ts +35 -0
  294. package/dist/hoi4_agent_tools/mcp/server/base-tools.d.ts.map +1 -0
  295. package/dist/hoi4_agent_tools/mcp/server/base-tools.js +835 -0
  296. package/dist/hoi4_agent_tools/mcp/server/base-tools.js.map +1 -0
  297. package/dist/hoi4_agent_tools/mcp/server/create.d.ts +5 -0
  298. package/dist/hoi4_agent_tools/mcp/server/create.d.ts.map +1 -0
  299. package/dist/hoi4_agent_tools/mcp/server/create.js +26 -0
  300. package/dist/hoi4_agent_tools/mcp/server/create.js.map +1 -0
  301. package/dist/hoi4_agent_tools/mcp/server/output-schemas.d.ts +133 -0
  302. package/dist/hoi4_agent_tools/mcp/server/output-schemas.d.ts.map +1 -0
  303. package/dist/hoi4_agent_tools/mcp/server/output-schemas.js +127 -0
  304. package/dist/hoi4_agent_tools/mcp/server/output-schemas.js.map +1 -0
  305. package/dist/hoi4_agent_tools/mcp/server/progress.d.ts +8 -0
  306. package/dist/hoi4_agent_tools/mcp/server/progress.d.ts.map +1 -0
  307. package/dist/hoi4_agent_tools/mcp/server/progress.js +21 -0
  308. package/dist/hoi4_agent_tools/mcp/server/progress.js.map +1 -0
  309. package/dist/hoi4_agent_tools/mcp/server/result.d.ts +232 -0
  310. package/dist/hoi4_agent_tools/mcp/server/result.d.ts.map +1 -0
  311. package/dist/hoi4_agent_tools/mcp/server/result.js +353 -0
  312. package/dist/hoi4_agent_tools/mcp/server/result.js.map +1 -0
  313. package/dist/hoi4_agent_tools/mcp/tools/focus.d.ts +5 -0
  314. package/dist/hoi4_agent_tools/mcp/tools/focus.d.ts.map +1 -0
  315. package/dist/hoi4_agent_tools/mcp/tools/focus.js +1059 -0
  316. package/dist/hoi4_agent_tools/mcp/tools/focus.js.map +1 -0
  317. package/dist/hoi4_agent_tools/mcp/tools/gui.d.ts +111 -0
  318. package/dist/hoi4_agent_tools/mcp/tools/gui.d.ts.map +1 -0
  319. package/dist/hoi4_agent_tools/mcp/tools/gui.js +598 -0
  320. package/dist/hoi4_agent_tools/mcp/tools/gui.js.map +1 -0
  321. package/dist/hoi4_agent_tools/mcp/tools/map.d.ts +5 -0
  322. package/dist/hoi4_agent_tools/mcp/tools/map.d.ts.map +1 -0
  323. package/dist/hoi4_agent_tools/mcp/tools/map.js +685 -0
  324. package/dist/hoi4_agent_tools/mcp/tools/map.js.map +1 -0
  325. package/dist/hoi4_agent_tools/mcp/transports/bounded-stdio.d.ts +58 -0
  326. package/dist/hoi4_agent_tools/mcp/transports/bounded-stdio.d.ts.map +1 -0
  327. package/dist/hoi4_agent_tools/mcp/transports/bounded-stdio.js +181 -0
  328. package/dist/hoi4_agent_tools/mcp/transports/bounded-stdio.js.map +1 -0
  329. package/dist/hoi4_agent_tools/mcp/transports/event-store.d.ts +26 -0
  330. package/dist/hoi4_agent_tools/mcp/transports/event-store.d.ts.map +1 -0
  331. package/dist/hoi4_agent_tools/mcp/transports/event-store.js +86 -0
  332. package/dist/hoi4_agent_tools/mcp/transports/event-store.js.map +1 -0
  333. package/dist/hoi4_agent_tools/mcp/transports/http.d.ts +28 -0
  334. package/dist/hoi4_agent_tools/mcp/transports/http.d.ts.map +1 -0
  335. package/dist/hoi4_agent_tools/mcp/transports/http.js +744 -0
  336. package/dist/hoi4_agent_tools/mcp/transports/http.js.map +1 -0
  337. package/dist/hoi4_agent_tools/mcp/transports/protocol-gate.d.ts +15 -0
  338. package/dist/hoi4_agent_tools/mcp/transports/protocol-gate.d.ts.map +1 -0
  339. package/dist/hoi4_agent_tools/mcp/transports/protocol-gate.js +51 -0
  340. package/dist/hoi4_agent_tools/mcp/transports/protocol-gate.js.map +1 -0
  341. package/dist/hoi4_agent_tools/runtime.d.ts +4 -0
  342. package/dist/hoi4_agent_tools/runtime.d.ts.map +1 -0
  343. package/dist/hoi4_agent_tools/runtime.js +27 -0
  344. package/dist/hoi4_agent_tools/runtime.js.map +1 -0
  345. package/dist/hoi4_agent_tools/schemas/common.d.ts +74 -0
  346. package/dist/hoi4_agent_tools/schemas/common.d.ts.map +1 -0
  347. package/dist/hoi4_agent_tools/schemas/common.js +51 -0
  348. package/dist/hoi4_agent_tools/schemas/common.js.map +1 -0
  349. package/dist/hoi4_agent_tools/schemas/focus.d.ts +784 -0
  350. package/dist/hoi4_agent_tools/schemas/focus.d.ts.map +1 -0
  351. package/dist/hoi4_agent_tools/schemas/focus.js +330 -0
  352. package/dist/hoi4_agent_tools/schemas/focus.js.map +1 -0
  353. package/dist/hoi4_agent_tools/schemas/index.d.ts +5 -0
  354. package/dist/hoi4_agent_tools/schemas/index.d.ts.map +1 -0
  355. package/dist/hoi4_agent_tools/schemas/index.js +5 -0
  356. package/dist/hoi4_agent_tools/schemas/index.js.map +1 -0
  357. package/dist/hoi4_agent_tools/schemas/map.d.ts +654 -0
  358. package/dist/hoi4_agent_tools/schemas/map.d.ts.map +1 -0
  359. package/dist/hoi4_agent_tools/schemas/map.js +570 -0
  360. package/dist/hoi4_agent_tools/schemas/map.js.map +1 -0
  361. package/dist/hoi4_agent_tools/schemas/transaction.d.ts +259 -0
  362. package/dist/hoi4_agent_tools/schemas/transaction.d.ts.map +1 -0
  363. package/dist/hoi4_agent_tools/schemas/transaction.js +104 -0
  364. package/dist/hoi4_agent_tools/schemas/transaction.js.map +1 -0
  365. package/dist/hoi4_agent_tools/version.d.ts +6 -0
  366. package/dist/hoi4_agent_tools/version.d.ts.map +1 -0
  367. package/dist/hoi4_agent_tools/version.js +7 -0
  368. package/dist/hoi4_agent_tools/version.js.map +1 -0
  369. package/dist/index.d.ts +3 -0
  370. package/dist/index.d.ts.map +1 -0
  371. package/dist/index.js +3 -0
  372. package/dist/index.js.map +1 -0
  373. package/docs/README.md +22 -0
  374. package/docs/adr/0001-runtime-and-language.md +16 -0
  375. package/docs/adr/0002-lossless-source-model.md +18 -0
  376. package/docs/adr/0003-image-and-font-codecs.md +18 -0
  377. package/docs/adr/0004-focus-layout.md +16 -0
  378. package/docs/adr/0005-offline-rendering.md +18 -0
  379. package/docs/adr/0006-mcp-sdk-and-protocol.md +16 -0
  380. package/docs/adr/0007-storage-and-transactions.md +24 -0
  381. package/docs/adr/0008-test-strategy.md +18 -0
  382. package/docs/adr/0009-packaging-and-registry.md +16 -0
  383. package/docs/adr/0010-unsupported-and-refusal-policy.md +18 -0
  384. package/docs/adr/0011-http-security.md +16 -0
  385. package/docs/adr/README.md +13 -0
  386. package/docs/architecture.md +60 -0
  387. package/docs/artifacts.md +133 -0
  388. package/docs/compatibility.md +33 -0
  389. package/docs/completion-report.md +69 -0
  390. package/docs/configuration.md +285 -0
  391. package/docs/focus-workflow.md +68 -0
  392. package/docs/gui-workflow.md +121 -0
  393. package/docs/limitations.md +30 -0
  394. package/docs/map-workflow.md +89 -0
  395. package/docs/performance.md +117 -0
  396. package/docs/release.md +200 -0
  397. package/docs/research/mcp-2026-07-10.md +46 -0
  398. package/docs/research/source-ledger.md +68 -0
  399. package/docs/security.md +139 -0
  400. package/docs/self-hosting.md +168 -0
  401. package/docs/testing.md +43 -0
  402. package/docs/third-party-notices.md +11 -0
  403. package/docs/transactions.md +162 -0
  404. package/docs/troubleshooting.md +46 -0
  405. package/package.json +98 -5
  406. package/schemas/configuration.schema.json +794 -0
  407. package/schemas/continuous-focus-palette.schema.json +325 -0
  408. package/schemas/focus-plan.schema.json +902 -0
  409. package/schemas/focus-planning-sidecar.schema.json +364 -0
  410. package/schemas/gui-animation-source.schema.json +176 -0
  411. package/schemas/gui-helper.schema.json +301 -0
  412. package/schemas/gui-scenario.schema.json +298 -0
  413. package/schemas/map-operation.schema.json +2284 -0
  414. package/schemas/operation-result.schema.json +344 -0
  415. package/schemas/transaction-manifest.schema.json +685 -0
  416. 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