hoi4-agent-tools 0.1.7 → 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.
Files changed (424) hide show
  1. package/CHANGELOG.md +12 -94
  2. package/README.md +35 -121
  3. package/SECURITY.md +5 -5
  4. package/dist/bin/http.js +0 -1
  5. package/dist/bin/setup.js +141 -85
  6. package/dist/bin/stdio.js +0 -1
  7. package/dist/hoi4_agent_tools/core/artifacts.js +0 -1
  8. package/dist/hoi4_agent_tools/core/canonical.js +0 -1
  9. package/dist/hoi4_agent_tools/core/configuration.js +28 -28
  10. package/dist/hoi4_agent_tools/core/diagnostic-collector.js +0 -1
  11. package/dist/hoi4_agent_tools/core/diagnostics.js +0 -1
  12. package/dist/hoi4_agent_tools/core/diff.js +0 -1
  13. package/dist/hoi4_agent_tools/core/engine.js +6 -20
  14. package/dist/hoi4_agent_tools/core/image-diff.js +0 -1
  15. package/dist/hoi4_agent_tools/core/index.js +0 -1
  16. package/dist/hoi4_agent_tools/core/render-budget.js +0 -1
  17. package/dist/hoi4_agent_tools/core/result.js +0 -1
  18. package/dist/hoi4_agent_tools/core/scanner.js +0 -1
  19. package/dist/hoi4_agent_tools/core/server-state.js +0 -1
  20. package/dist/hoi4_agent_tools/core/source/encoding.js +0 -1
  21. package/dist/hoi4_agent_tools/core/source/index.js +0 -1
  22. package/dist/hoi4_agent_tools/core/source/lexer.js +0 -1
  23. package/dist/hoi4_agent_tools/core/source/limits.js +0 -1
  24. package/dist/hoi4_agent_tools/core/source/localisation.js +0 -1
  25. package/dist/hoi4_agent_tools/core/source/parser.js +0 -1
  26. package/dist/hoi4_agent_tools/core/source/rewrite.js +0 -1
  27. package/dist/hoi4_agent_tools/core/svg-text.js +0 -1
  28. package/dist/hoi4_agent_tools/core/transaction-limits.js +0 -1
  29. package/dist/hoi4_agent_tools/core/transactions.js +46 -31
  30. package/dist/hoi4_agent_tools/core/workspace.js +112 -396
  31. package/dist/hoi4_agent_tools/focus/compiler.js +0 -1
  32. package/dist/hoi4_agent_tools/focus/continuous-render.js +0 -1
  33. package/dist/hoi4_agent_tools/focus/drift.js +0 -1
  34. package/dist/hoi4_agent_tools/focus/geometry.js +0 -1
  35. package/dist/hoi4_agent_tools/focus/importer.js +0 -1
  36. package/dist/hoi4_agent_tools/focus/index.js +0 -1
  37. package/dist/hoi4_agent_tools/focus/layout.js +0 -1
  38. package/dist/hoi4_agent_tools/focus/limits.js +0 -1
  39. package/dist/hoi4_agent_tools/focus/lint.js +0 -1
  40. package/dist/hoi4_agent_tools/focus/model.js +0 -1
  41. package/dist/hoi4_agent_tools/focus/native-effects.js +0 -1
  42. package/dist/hoi4_agent_tools/focus/planning.js +0 -1
  43. package/dist/hoi4_agent_tools/focus/presentation.js +0 -1
  44. package/dist/hoi4_agent_tools/focus/render.js +0 -1
  45. package/dist/hoi4_agent_tools/focus/service.js +11 -26
  46. package/dist/hoi4_agent_tools/focus/source-update.js +1 -2
  47. package/dist/hoi4_agent_tools/gui/animation-manifest.js +0 -1
  48. package/dist/hoi4_agent_tools/gui/assets.js +0 -1
  49. package/dist/hoi4_agent_tools/gui/dds.js +0 -1
  50. package/dist/hoi4_agent_tools/gui/helpers.js +1 -2
  51. package/dist/hoi4_agent_tools/gui/index.js +0 -1
  52. package/dist/hoi4_agent_tools/gui/layout.js +0 -1
  53. package/dist/hoi4_agent_tools/gui/limits.js +0 -1
  54. package/dist/hoi4_agent_tools/gui/renderer.js +0 -1
  55. package/dist/hoi4_agent_tools/gui/scenario.js +0 -1
  56. package/dist/hoi4_agent_tools/gui/source-graph.js +0 -1
  57. package/dist/hoi4_agent_tools/gui/source-patch.js +1 -2
  58. package/dist/hoi4_agent_tools/gui/studio.js +247 -103
  59. package/dist/hoi4_agent_tools/gui/tga.js +0 -1
  60. package/dist/hoi4_agent_tools/gui/types.js +0 -1
  61. package/dist/hoi4_agent_tools/gui/validators.js +0 -1
  62. package/dist/hoi4_agent_tools/map/bmp.js +0 -1
  63. package/dist/hoi4_agent_tools/map/diagnostic-limit.js +0 -1
  64. package/dist/hoi4_agent_tools/map/index.js +0 -1
  65. package/dist/hoi4_agent_tools/map/limits.js +2 -1
  66. package/dist/hoi4_agent_tools/map/model.js +0 -1
  67. package/dist/hoi4_agent_tools/map/operations.js +0 -1
  68. package/dist/hoi4_agent_tools/map/render.js +0 -1
  69. package/dist/hoi4_agent_tools/map/service.js +182 -38
  70. package/dist/hoi4_agent_tools/map/validation.js +0 -1
  71. package/dist/hoi4_agent_tools/mcp/resources/register.js +61 -187
  72. package/dist/hoi4_agent_tools/mcp/security/auth.js +1 -5
  73. package/dist/hoi4_agent_tools/mcp/server/base-tools.js +26 -733
  74. package/dist/hoi4_agent_tools/mcp/server/create.js +3 -6
  75. package/dist/hoi4_agent_tools/mcp/server/output-schemas.js +0 -70
  76. package/dist/hoi4_agent_tools/mcp/server/progress.js +0 -1
  77. package/dist/hoi4_agent_tools/mcp/server/result.js +24 -30
  78. package/dist/hoi4_agent_tools/mcp/server/transaction-execution.js +123 -0
  79. package/dist/hoi4_agent_tools/mcp/tools/focus.js +244 -254
  80. package/dist/hoi4_agent_tools/mcp/tools/gui.js +163 -236
  81. package/dist/hoi4_agent_tools/mcp/tools/map.js +269 -323
  82. package/dist/hoi4_agent_tools/mcp/tools/mods.js +54 -0
  83. package/dist/hoi4_agent_tools/mcp/transports/bounded-stdio.js +0 -1
  84. package/dist/hoi4_agent_tools/mcp/transports/event-store.js +0 -1
  85. package/dist/hoi4_agent_tools/mcp/transports/http.js +1 -9
  86. package/dist/hoi4_agent_tools/mcp/transports/protocol-gate.js +0 -1
  87. package/dist/hoi4_agent_tools/runtime.js +5 -2
  88. package/dist/hoi4_agent_tools/schemas/common.js +1 -2
  89. package/dist/hoi4_agent_tools/schemas/focus.js +0 -1
  90. package/dist/hoi4_agent_tools/schemas/map.js +0 -1
  91. package/dist/hoi4_agent_tools/schemas/transaction.js +0 -1
  92. package/dist/hoi4_agent_tools/version.js +1 -2
  93. package/docs/README.md +8 -21
  94. package/docs/development.md +22 -0
  95. package/docs/focus.md +40 -0
  96. package/docs/gui.md +37 -0
  97. package/docs/http.md +53 -0
  98. package/docs/map.md +39 -0
  99. package/docs/setup.md +39 -0
  100. package/package.json +10 -11
  101. package/server.json +3 -12
  102. package/dist/bin/http.d.ts +0 -3
  103. package/dist/bin/http.d.ts.map +0 -1
  104. package/dist/bin/http.js.map +0 -1
  105. package/dist/bin/setup.d.ts +0 -3
  106. package/dist/bin/setup.d.ts.map +0 -1
  107. package/dist/bin/setup.js.map +0 -1
  108. package/dist/bin/stdio.d.ts +0 -3
  109. package/dist/bin/stdio.d.ts.map +0 -1
  110. package/dist/bin/stdio.js.map +0 -1
  111. package/dist/hoi4_agent_tools/core/artifacts.d.ts +0 -117
  112. package/dist/hoi4_agent_tools/core/artifacts.d.ts.map +0 -1
  113. package/dist/hoi4_agent_tools/core/artifacts.js.map +0 -1
  114. package/dist/hoi4_agent_tools/core/canonical.d.ts +0 -13
  115. package/dist/hoi4_agent_tools/core/canonical.d.ts.map +0 -1
  116. package/dist/hoi4_agent_tools/core/canonical.js.map +0 -1
  117. package/dist/hoi4_agent_tools/core/configuration.d.ts +0 -137
  118. package/dist/hoi4_agent_tools/core/configuration.d.ts.map +0 -1
  119. package/dist/hoi4_agent_tools/core/configuration.js.map +0 -1
  120. package/dist/hoi4_agent_tools/core/diagnostic-collector.d.ts +0 -18
  121. package/dist/hoi4_agent_tools/core/diagnostic-collector.d.ts.map +0 -1
  122. package/dist/hoi4_agent_tools/core/diagnostic-collector.js.map +0 -1
  123. package/dist/hoi4_agent_tools/core/diagnostics.d.ts +0 -26
  124. package/dist/hoi4_agent_tools/core/diagnostics.d.ts.map +0 -1
  125. package/dist/hoi4_agent_tools/core/diagnostics.js.map +0 -1
  126. package/dist/hoi4_agent_tools/core/diff.d.ts +0 -22
  127. package/dist/hoi4_agent_tools/core/diff.d.ts.map +0 -1
  128. package/dist/hoi4_agent_tools/core/diff.js.map +0 -1
  129. package/dist/hoi4_agent_tools/core/engine.d.ts +0 -56
  130. package/dist/hoi4_agent_tools/core/engine.d.ts.map +0 -1
  131. package/dist/hoi4_agent_tools/core/engine.js.map +0 -1
  132. package/dist/hoi4_agent_tools/core/image-diff.d.ts +0 -14
  133. package/dist/hoi4_agent_tools/core/image-diff.d.ts.map +0 -1
  134. package/dist/hoi4_agent_tools/core/image-diff.js.map +0 -1
  135. package/dist/hoi4_agent_tools/core/index.d.ts +0 -64
  136. package/dist/hoi4_agent_tools/core/index.d.ts.map +0 -1
  137. package/dist/hoi4_agent_tools/core/index.js.map +0 -1
  138. package/dist/hoi4_agent_tools/core/index.public.d.ts +0 -16
  139. package/dist/hoi4_agent_tools/core/index.public.d.ts.map +0 -1
  140. package/dist/hoi4_agent_tools/core/index.public.js +0 -16
  141. package/dist/hoi4_agent_tools/core/index.public.js.map +0 -1
  142. package/dist/hoi4_agent_tools/core/render-budget.d.ts +0 -51
  143. package/dist/hoi4_agent_tools/core/render-budget.d.ts.map +0 -1
  144. package/dist/hoi4_agent_tools/core/render-budget.js.map +0 -1
  145. package/dist/hoi4_agent_tools/core/result.d.ts +0 -45
  146. package/dist/hoi4_agent_tools/core/result.d.ts.map +0 -1
  147. package/dist/hoi4_agent_tools/core/result.js.map +0 -1
  148. package/dist/hoi4_agent_tools/core/scanner.d.ts +0 -28
  149. package/dist/hoi4_agent_tools/core/scanner.d.ts.map +0 -1
  150. package/dist/hoi4_agent_tools/core/scanner.js.map +0 -1
  151. package/dist/hoi4_agent_tools/core/server-state.d.ts +0 -31
  152. package/dist/hoi4_agent_tools/core/server-state.d.ts.map +0 -1
  153. package/dist/hoi4_agent_tools/core/server-state.js.map +0 -1
  154. package/dist/hoi4_agent_tools/core/source/encoding.d.ts +0 -10
  155. package/dist/hoi4_agent_tools/core/source/encoding.d.ts.map +0 -1
  156. package/dist/hoi4_agent_tools/core/source/encoding.js.map +0 -1
  157. package/dist/hoi4_agent_tools/core/source/index.d.ts +0 -7
  158. package/dist/hoi4_agent_tools/core/source/index.d.ts.map +0 -1
  159. package/dist/hoi4_agent_tools/core/source/index.js.map +0 -1
  160. package/dist/hoi4_agent_tools/core/source/lexer.d.ts +0 -30
  161. package/dist/hoi4_agent_tools/core/source/lexer.d.ts.map +0 -1
  162. package/dist/hoi4_agent_tools/core/source/lexer.js.map +0 -1
  163. package/dist/hoi4_agent_tools/core/source/limits.d.ts +0 -21
  164. package/dist/hoi4_agent_tools/core/source/limits.d.ts.map +0 -1
  165. package/dist/hoi4_agent_tools/core/source/limits.js.map +0 -1
  166. package/dist/hoi4_agent_tools/core/source/localisation.d.ts +0 -20
  167. package/dist/hoi4_agent_tools/core/source/localisation.d.ts.map +0 -1
  168. package/dist/hoi4_agent_tools/core/source/localisation.js.map +0 -1
  169. package/dist/hoi4_agent_tools/core/source/parser.d.ts +0 -44
  170. package/dist/hoi4_agent_tools/core/source/parser.d.ts.map +0 -1
  171. package/dist/hoi4_agent_tools/core/source/parser.js.map +0 -1
  172. package/dist/hoi4_agent_tools/core/source/rewrite.d.ts +0 -10
  173. package/dist/hoi4_agent_tools/core/source/rewrite.d.ts.map +0 -1
  174. package/dist/hoi4_agent_tools/core/source/rewrite.js.map +0 -1
  175. package/dist/hoi4_agent_tools/core/svg-text.d.ts +0 -34
  176. package/dist/hoi4_agent_tools/core/svg-text.d.ts.map +0 -1
  177. package/dist/hoi4_agent_tools/core/svg-text.js.map +0 -1
  178. package/dist/hoi4_agent_tools/core/transaction-limits.d.ts +0 -9
  179. package/dist/hoi4_agent_tools/core/transaction-limits.d.ts.map +0 -1
  180. package/dist/hoi4_agent_tools/core/transaction-limits.js.map +0 -1
  181. package/dist/hoi4_agent_tools/core/transactions.d.ts +0 -162
  182. package/dist/hoi4_agent_tools/core/transactions.d.ts.map +0 -1
  183. package/dist/hoi4_agent_tools/core/transactions.js.map +0 -1
  184. package/dist/hoi4_agent_tools/core/workspace.d.ts +0 -68
  185. package/dist/hoi4_agent_tools/core/workspace.d.ts.map +0 -1
  186. package/dist/hoi4_agent_tools/core/workspace.js.map +0 -1
  187. package/dist/hoi4_agent_tools/focus/compiler.d.ts +0 -10
  188. package/dist/hoi4_agent_tools/focus/compiler.d.ts.map +0 -1
  189. package/dist/hoi4_agent_tools/focus/compiler.js.map +0 -1
  190. package/dist/hoi4_agent_tools/focus/continuous-render.d.ts +0 -32
  191. package/dist/hoi4_agent_tools/focus/continuous-render.d.ts.map +0 -1
  192. package/dist/hoi4_agent_tools/focus/continuous-render.js.map +0 -1
  193. package/dist/hoi4_agent_tools/focus/drift.d.ts +0 -22
  194. package/dist/hoi4_agent_tools/focus/drift.d.ts.map +0 -1
  195. package/dist/hoi4_agent_tools/focus/drift.js.map +0 -1
  196. package/dist/hoi4_agent_tools/focus/geometry.d.ts +0 -17
  197. package/dist/hoi4_agent_tools/focus/geometry.d.ts.map +0 -1
  198. package/dist/hoi4_agent_tools/focus/geometry.js.map +0 -1
  199. package/dist/hoi4_agent_tools/focus/importer.d.ts +0 -9
  200. package/dist/hoi4_agent_tools/focus/importer.d.ts.map +0 -1
  201. package/dist/hoi4_agent_tools/focus/importer.js.map +0 -1
  202. package/dist/hoi4_agent_tools/focus/index.d.ts +0 -14
  203. package/dist/hoi4_agent_tools/focus/index.d.ts.map +0 -1
  204. package/dist/hoi4_agent_tools/focus/index.js.map +0 -1
  205. package/dist/hoi4_agent_tools/focus/layout.d.ts +0 -5
  206. package/dist/hoi4_agent_tools/focus/layout.d.ts.map +0 -1
  207. package/dist/hoi4_agent_tools/focus/layout.js.map +0 -1
  208. package/dist/hoi4_agent_tools/focus/limits.d.ts +0 -9
  209. package/dist/hoi4_agent_tools/focus/limits.d.ts.map +0 -1
  210. package/dist/hoi4_agent_tools/focus/limits.js.map +0 -1
  211. package/dist/hoi4_agent_tools/focus/lint.d.ts +0 -14
  212. package/dist/hoi4_agent_tools/focus/lint.d.ts.map +0 -1
  213. package/dist/hoi4_agent_tools/focus/lint.js.map +0 -1
  214. package/dist/hoi4_agent_tools/focus/model.d.ts +0 -307
  215. package/dist/hoi4_agent_tools/focus/model.d.ts.map +0 -1
  216. package/dist/hoi4_agent_tools/focus/model.js.map +0 -1
  217. package/dist/hoi4_agent_tools/focus/native-effects.d.ts +0 -9
  218. package/dist/hoi4_agent_tools/focus/native-effects.d.ts.map +0 -1
  219. package/dist/hoi4_agent_tools/focus/native-effects.js.map +0 -1
  220. package/dist/hoi4_agent_tools/focus/planning.d.ts +0 -15
  221. package/dist/hoi4_agent_tools/focus/planning.d.ts.map +0 -1
  222. package/dist/hoi4_agent_tools/focus/planning.js.map +0 -1
  223. package/dist/hoi4_agent_tools/focus/presentation.d.ts +0 -24
  224. package/dist/hoi4_agent_tools/focus/presentation.d.ts.map +0 -1
  225. package/dist/hoi4_agent_tools/focus/presentation.js.map +0 -1
  226. package/dist/hoi4_agent_tools/focus/render.d.ts +0 -39
  227. package/dist/hoi4_agent_tools/focus/render.d.ts.map +0 -1
  228. package/dist/hoi4_agent_tools/focus/render.js.map +0 -1
  229. package/dist/hoi4_agent_tools/focus/service.d.ts +0 -82
  230. package/dist/hoi4_agent_tools/focus/service.d.ts.map +0 -1
  231. package/dist/hoi4_agent_tools/focus/service.js.map +0 -1
  232. package/dist/hoi4_agent_tools/focus/source-update.d.ts +0 -6
  233. package/dist/hoi4_agent_tools/focus/source-update.d.ts.map +0 -1
  234. package/dist/hoi4_agent_tools/focus/source-update.js.map +0 -1
  235. package/dist/hoi4_agent_tools/gui/animation-manifest.d.ts +0 -37
  236. package/dist/hoi4_agent_tools/gui/animation-manifest.d.ts.map +0 -1
  237. package/dist/hoi4_agent_tools/gui/animation-manifest.js.map +0 -1
  238. package/dist/hoi4_agent_tools/gui/assets.d.ts +0 -71
  239. package/dist/hoi4_agent_tools/gui/assets.d.ts.map +0 -1
  240. package/dist/hoi4_agent_tools/gui/assets.js.map +0 -1
  241. package/dist/hoi4_agent_tools/gui/dds.d.ts +0 -17
  242. package/dist/hoi4_agent_tools/gui/dds.d.ts.map +0 -1
  243. package/dist/hoi4_agent_tools/gui/dds.js.map +0 -1
  244. package/dist/hoi4_agent_tools/gui/helpers.d.ts +0 -101
  245. package/dist/hoi4_agent_tools/gui/helpers.d.ts.map +0 -1
  246. package/dist/hoi4_agent_tools/gui/helpers.js.map +0 -1
  247. package/dist/hoi4_agent_tools/gui/index.d.ts +0 -15
  248. package/dist/hoi4_agent_tools/gui/index.d.ts.map +0 -1
  249. package/dist/hoi4_agent_tools/gui/index.js.map +0 -1
  250. package/dist/hoi4_agent_tools/gui/layout.d.ts +0 -6
  251. package/dist/hoi4_agent_tools/gui/layout.d.ts.map +0 -1
  252. package/dist/hoi4_agent_tools/gui/layout.js.map +0 -1
  253. package/dist/hoi4_agent_tools/gui/limits.d.ts +0 -25
  254. package/dist/hoi4_agent_tools/gui/limits.d.ts.map +0 -1
  255. package/dist/hoi4_agent_tools/gui/limits.js.map +0 -1
  256. package/dist/hoi4_agent_tools/gui/renderer.d.ts +0 -18
  257. package/dist/hoi4_agent_tools/gui/renderer.d.ts.map +0 -1
  258. package/dist/hoi4_agent_tools/gui/renderer.js.map +0 -1
  259. package/dist/hoi4_agent_tools/gui/scenario.d.ts +0 -66
  260. package/dist/hoi4_agent_tools/gui/scenario.d.ts.map +0 -1
  261. package/dist/hoi4_agent_tools/gui/scenario.js.map +0 -1
  262. package/dist/hoi4_agent_tools/gui/source-graph.d.ts +0 -7
  263. package/dist/hoi4_agent_tools/gui/source-graph.d.ts.map +0 -1
  264. package/dist/hoi4_agent_tools/gui/source-graph.js.map +0 -1
  265. package/dist/hoi4_agent_tools/gui/source-patch.d.ts +0 -13
  266. package/dist/hoi4_agent_tools/gui/source-patch.d.ts.map +0 -1
  267. package/dist/hoi4_agent_tools/gui/source-patch.js.map +0 -1
  268. package/dist/hoi4_agent_tools/gui/studio.d.ts +0 -86
  269. package/dist/hoi4_agent_tools/gui/studio.d.ts.map +0 -1
  270. package/dist/hoi4_agent_tools/gui/studio.js.map +0 -1
  271. package/dist/hoi4_agent_tools/gui/tga.d.ts +0 -16
  272. package/dist/hoi4_agent_tools/gui/tga.d.ts.map +0 -1
  273. package/dist/hoi4_agent_tools/gui/tga.js.map +0 -1
  274. package/dist/hoi4_agent_tools/gui/types.d.ts +0 -322
  275. package/dist/hoi4_agent_tools/gui/types.d.ts.map +0 -1
  276. package/dist/hoi4_agent_tools/gui/types.js.map +0 -1
  277. package/dist/hoi4_agent_tools/gui/validators.d.ts +0 -8
  278. package/dist/hoi4_agent_tools/gui/validators.d.ts.map +0 -1
  279. package/dist/hoi4_agent_tools/gui/validators.js.map +0 -1
  280. package/dist/hoi4_agent_tools/map/bmp.d.ts +0 -62
  281. package/dist/hoi4_agent_tools/map/bmp.d.ts.map +0 -1
  282. package/dist/hoi4_agent_tools/map/bmp.js.map +0 -1
  283. package/dist/hoi4_agent_tools/map/diagnostic-limit.d.ts +0 -5
  284. package/dist/hoi4_agent_tools/map/diagnostic-limit.d.ts.map +0 -1
  285. package/dist/hoi4_agent_tools/map/diagnostic-limit.js.map +0 -1
  286. package/dist/hoi4_agent_tools/map/index.d.ts +0 -8
  287. package/dist/hoi4_agent_tools/map/index.d.ts.map +0 -1
  288. package/dist/hoi4_agent_tools/map/index.js.map +0 -1
  289. package/dist/hoi4_agent_tools/map/limits.d.ts +0 -13
  290. package/dist/hoi4_agent_tools/map/limits.d.ts.map +0 -1
  291. package/dist/hoi4_agent_tools/map/limits.js.map +0 -1
  292. package/dist/hoi4_agent_tools/map/model.d.ts +0 -269
  293. package/dist/hoi4_agent_tools/map/model.d.ts.map +0 -1
  294. package/dist/hoi4_agent_tools/map/model.js.map +0 -1
  295. package/dist/hoi4_agent_tools/map/operations.d.ts +0 -401
  296. package/dist/hoi4_agent_tools/map/operations.d.ts.map +0 -1
  297. package/dist/hoi4_agent_tools/map/operations.js.map +0 -1
  298. package/dist/hoi4_agent_tools/map/render.d.ts +0 -90
  299. package/dist/hoi4_agent_tools/map/render.d.ts.map +0 -1
  300. package/dist/hoi4_agent_tools/map/render.js.map +0 -1
  301. package/dist/hoi4_agent_tools/map/service.d.ts +0 -81
  302. package/dist/hoi4_agent_tools/map/service.d.ts.map +0 -1
  303. package/dist/hoi4_agent_tools/map/service.js.map +0 -1
  304. package/dist/hoi4_agent_tools/map/validation.d.ts +0 -23
  305. package/dist/hoi4_agent_tools/map/validation.d.ts.map +0 -1
  306. package/dist/hoi4_agent_tools/map/validation.js.map +0 -1
  307. package/dist/hoi4_agent_tools/mcp/prompts/register.d.ts +0 -3
  308. package/dist/hoi4_agent_tools/mcp/prompts/register.d.ts.map +0 -1
  309. package/dist/hoi4_agent_tools/mcp/prompts/register.js +0 -50
  310. package/dist/hoi4_agent_tools/mcp/prompts/register.js.map +0 -1
  311. package/dist/hoi4_agent_tools/mcp/registry/metadata.d.ts +0 -9
  312. package/dist/hoi4_agent_tools/mcp/registry/metadata.d.ts.map +0 -1
  313. package/dist/hoi4_agent_tools/mcp/registry/metadata.js +0 -10
  314. package/dist/hoi4_agent_tools/mcp/registry/metadata.js.map +0 -1
  315. package/dist/hoi4_agent_tools/mcp/resources/register.d.ts +0 -5
  316. package/dist/hoi4_agent_tools/mcp/resources/register.d.ts.map +0 -1
  317. package/dist/hoi4_agent_tools/mcp/resources/register.js.map +0 -1
  318. package/dist/hoi4_agent_tools/mcp/security/auth.d.ts +0 -24
  319. package/dist/hoi4_agent_tools/mcp/security/auth.d.ts.map +0 -1
  320. package/dist/hoi4_agent_tools/mcp/security/auth.js.map +0 -1
  321. package/dist/hoi4_agent_tools/mcp/server/base-tools.d.ts +0 -35
  322. package/dist/hoi4_agent_tools/mcp/server/base-tools.d.ts.map +0 -1
  323. package/dist/hoi4_agent_tools/mcp/server/base-tools.js.map +0 -1
  324. package/dist/hoi4_agent_tools/mcp/server/create.d.ts +0 -5
  325. package/dist/hoi4_agent_tools/mcp/server/create.d.ts.map +0 -1
  326. package/dist/hoi4_agent_tools/mcp/server/create.js.map +0 -1
  327. package/dist/hoi4_agent_tools/mcp/server/output-schemas.d.ts +0 -133
  328. package/dist/hoi4_agent_tools/mcp/server/output-schemas.d.ts.map +0 -1
  329. package/dist/hoi4_agent_tools/mcp/server/output-schemas.js.map +0 -1
  330. package/dist/hoi4_agent_tools/mcp/server/progress.d.ts +0 -8
  331. package/dist/hoi4_agent_tools/mcp/server/progress.d.ts.map +0 -1
  332. package/dist/hoi4_agent_tools/mcp/server/progress.js.map +0 -1
  333. package/dist/hoi4_agent_tools/mcp/server/result.d.ts +0 -232
  334. package/dist/hoi4_agent_tools/mcp/server/result.d.ts.map +0 -1
  335. package/dist/hoi4_agent_tools/mcp/server/result.js.map +0 -1
  336. package/dist/hoi4_agent_tools/mcp/tools/focus.d.ts +0 -5
  337. package/dist/hoi4_agent_tools/mcp/tools/focus.d.ts.map +0 -1
  338. package/dist/hoi4_agent_tools/mcp/tools/focus.js.map +0 -1
  339. package/dist/hoi4_agent_tools/mcp/tools/gui.d.ts +0 -111
  340. package/dist/hoi4_agent_tools/mcp/tools/gui.d.ts.map +0 -1
  341. package/dist/hoi4_agent_tools/mcp/tools/gui.js.map +0 -1
  342. package/dist/hoi4_agent_tools/mcp/tools/map.d.ts +0 -5
  343. package/dist/hoi4_agent_tools/mcp/tools/map.d.ts.map +0 -1
  344. package/dist/hoi4_agent_tools/mcp/tools/map.js.map +0 -1
  345. package/dist/hoi4_agent_tools/mcp/transports/bounded-stdio.d.ts +0 -58
  346. package/dist/hoi4_agent_tools/mcp/transports/bounded-stdio.d.ts.map +0 -1
  347. package/dist/hoi4_agent_tools/mcp/transports/bounded-stdio.js.map +0 -1
  348. package/dist/hoi4_agent_tools/mcp/transports/event-store.d.ts +0 -26
  349. package/dist/hoi4_agent_tools/mcp/transports/event-store.d.ts.map +0 -1
  350. package/dist/hoi4_agent_tools/mcp/transports/event-store.js.map +0 -1
  351. package/dist/hoi4_agent_tools/mcp/transports/http.d.ts +0 -28
  352. package/dist/hoi4_agent_tools/mcp/transports/http.d.ts.map +0 -1
  353. package/dist/hoi4_agent_tools/mcp/transports/http.js.map +0 -1
  354. package/dist/hoi4_agent_tools/mcp/transports/protocol-gate.d.ts +0 -15
  355. package/dist/hoi4_agent_tools/mcp/transports/protocol-gate.d.ts.map +0 -1
  356. package/dist/hoi4_agent_tools/mcp/transports/protocol-gate.js.map +0 -1
  357. package/dist/hoi4_agent_tools/runtime.d.ts +0 -4
  358. package/dist/hoi4_agent_tools/runtime.d.ts.map +0 -1
  359. package/dist/hoi4_agent_tools/runtime.js.map +0 -1
  360. package/dist/hoi4_agent_tools/schemas/common.d.ts +0 -74
  361. package/dist/hoi4_agent_tools/schemas/common.d.ts.map +0 -1
  362. package/dist/hoi4_agent_tools/schemas/common.js.map +0 -1
  363. package/dist/hoi4_agent_tools/schemas/focus.d.ts +0 -784
  364. package/dist/hoi4_agent_tools/schemas/focus.d.ts.map +0 -1
  365. package/dist/hoi4_agent_tools/schemas/focus.js.map +0 -1
  366. package/dist/hoi4_agent_tools/schemas/index.d.ts +0 -5
  367. package/dist/hoi4_agent_tools/schemas/index.d.ts.map +0 -1
  368. package/dist/hoi4_agent_tools/schemas/index.js +0 -5
  369. package/dist/hoi4_agent_tools/schemas/index.js.map +0 -1
  370. package/dist/hoi4_agent_tools/schemas/map.d.ts +0 -654
  371. package/dist/hoi4_agent_tools/schemas/map.d.ts.map +0 -1
  372. package/dist/hoi4_agent_tools/schemas/map.js.map +0 -1
  373. package/dist/hoi4_agent_tools/schemas/transaction.d.ts +0 -259
  374. package/dist/hoi4_agent_tools/schemas/transaction.d.ts.map +0 -1
  375. package/dist/hoi4_agent_tools/schemas/transaction.js.map +0 -1
  376. package/dist/hoi4_agent_tools/version.d.ts +0 -6
  377. package/dist/hoi4_agent_tools/version.d.ts.map +0 -1
  378. package/dist/hoi4_agent_tools/version.js.map +0 -1
  379. package/dist/index.d.ts +0 -3
  380. package/dist/index.d.ts.map +0 -1
  381. package/dist/index.js +0 -3
  382. package/dist/index.js.map +0 -1
  383. package/docs/adr/0001-runtime-and-language.md +0 -16
  384. package/docs/adr/0002-lossless-source-model.md +0 -18
  385. package/docs/adr/0003-image-and-font-codecs.md +0 -18
  386. package/docs/adr/0004-focus-layout.md +0 -16
  387. package/docs/adr/0005-offline-rendering.md +0 -18
  388. package/docs/adr/0006-mcp-sdk-and-protocol.md +0 -16
  389. package/docs/adr/0007-storage-and-transactions.md +0 -24
  390. package/docs/adr/0008-test-strategy.md +0 -18
  391. package/docs/adr/0009-packaging-and-registry.md +0 -16
  392. package/docs/adr/0010-unsupported-and-refusal-policy.md +0 -18
  393. package/docs/adr/0011-http-security.md +0 -16
  394. package/docs/adr/README.md +0 -13
  395. package/docs/agent-integration.md +0 -136
  396. package/docs/architecture.md +0 -60
  397. package/docs/artifacts.md +0 -133
  398. package/docs/compatibility.md +0 -33
  399. package/docs/completion-report.md +0 -162
  400. package/docs/configuration.md +0 -289
  401. package/docs/focus-workflow.md +0 -195
  402. package/docs/gui-workflow.md +0 -121
  403. package/docs/limitations.md +0 -31
  404. package/docs/map-workflow.md +0 -89
  405. package/docs/performance.md +0 -117
  406. package/docs/release.md +0 -220
  407. package/docs/research/mcp-2026-07-10.md +0 -46
  408. package/docs/research/source-ledger.md +0 -68
  409. package/docs/security.md +0 -139
  410. package/docs/self-hosting.md +0 -168
  411. package/docs/testing.md +0 -43
  412. package/docs/third-party-notices.md +0 -11
  413. package/docs/transactions.md +0 -168
  414. package/docs/troubleshooting.md +0 -46
  415. package/schemas/configuration.schema.json +0 -794
  416. package/schemas/continuous-focus-palette.schema.json +0 -325
  417. package/schemas/focus-plan.schema.json +0 -927
  418. package/schemas/focus-planning-sidecar.schema.json +0 -379
  419. package/schemas/gui-animation-source.schema.json +0 -176
  420. package/schemas/gui-helper.schema.json +0 -301
  421. package/schemas/gui-scenario.schema.json +0 -298
  422. package/schemas/map-operation.schema.json +0 -2284
  423. package/schemas/operation-result.schema.json +0 -344
  424. package/schemas/transaction-manifest.schema.json +0 -685
@@ -1,289 +0,0 @@
1
- # Configuration and workspaces
2
-
3
- Pass a config with `--config PATH` or `HOI4_AGENT_CONFIG`. Without either override, the server uses
4
- `~/.config/hoi4-agent-tools/config.json` on every platform (for example,
5
- `C:\\Users\\name\\.config\\hoi4-agent-tools\\config.json` on Windows). A different durable absolute
6
- path is equally valid when the client registration sets `HOI4_AGENT_CONFIG`. Unknown fields are
7
- rejected.
8
- The read-only setup discovery command also checks `HOI4_GAME_ROOT` and the path-delimited `HOI4_MOD_ROOTS`; it reports candidates without registering or modifying them.
9
-
10
- The stdio executable accepts newline-delimited JSON-RPC frames up to a fixed 16,777,216-byte
11
- ceiling, excluding the line-feed delimiter. This transport safety limit is deliberately not a
12
- configuration field; malformed UTF-8 and oversized terminated or unterminated frames close the
13
- stdio connection with a stderr diagnostic and no protocol output. Streamable HTTP uses the
14
- separately configured `http.maxBodyBytes`.
15
-
16
- ```json
17
- {
18
- "version": 1,
19
- "writePolicy": "read-only",
20
- "serverStateRoot": "/var/lib/hoi4-agent-tools-state",
21
- "transactionTtlSeconds": 3600,
22
- "transactionMaxJournalBytes": 536870912,
23
- "transactionMaxJournals": 128,
24
- "scanMaxFiles": 20000,
25
- "scanMaxBytes": 134217728,
26
- "scanMaxFileBytes": 67108864,
27
- "artifactMaxBytes": 536870912,
28
- "artifactMaxEntries": 5000,
29
- "artifactMaxSingleBytes": 134217728,
30
- "registrationRoots": ["/srv/hoi4/workspaces", "/srv/hoi4/game", "/srv/hoi4/dependencies"],
31
- "writableRegistrationRoots": ["/srv/hoi4/workspaces"],
32
- "storageRoots": ["/var/lib/hoi4-agent-tools"],
33
- "workspaces": [
34
- {
35
- "id": "example",
36
- "name": "Example Mod",
37
- "kind": "mod",
38
- "root": "/srv/hoi4/workspaces/example",
39
- "gameRoot": "/srv/hoi4/game",
40
- "dependencyRoots": [],
41
- "dependencies": [
42
- {
43
- "root": "/srv/hoi4/dependencies/base",
44
- "replacePaths": ["common/ideas"]
45
- }
46
- ],
47
- "replacePaths": ["common/national_focus"],
48
- "artifactRoot": "/srv/hoi4/workspaces/example/.hoi4-agent/artifacts",
49
- "cacheRoot": "/srv/hoi4/workspaces/example/.hoi4-agent/cache",
50
- "writeEnabled": false
51
- }
52
- ]
53
- }
54
- ```
55
-
56
- ## Server fields
57
-
58
- All byte values are exact bytes. Defaults are applied when a field is omitted.
59
-
60
- | Field | Default | Validation and behavior |
61
- | ---------------------------- | ----------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
62
- | `version` | required | Must equal the current configuration version, `1`. |
63
- | `writePolicy` | `"read-only"` | `"read-only"` or `"transactions"`. |
64
- | `serverStateRoot` | omitted | Required for `"transactions"`; absolute canonical operator state used for the private journal key and replay-protection heads. |
65
- | `transactionTtlSeconds` | `3600` | 60 through 86,400 seconds. |
66
- | `transactionMaxJournalBytes` | `536870912` | At least 1 MiB; aggregate transaction-journal retention ceiling and per-plan work ceiling. |
67
- | `transactionMaxJournals` | `128` | 1 through 10,000 journals per workspace cache. |
68
- | `scanMaxFiles` | `20000` | 1 through 1,000,000 enumerated files per scan. |
69
- | `scanMaxBytes` | `134217728` | At least 1 MiB of file content per scan. |
70
- | `scanMaxFileBytes` | `67108864` | At least 64 KiB and no greater than `scanMaxBytes`. |
71
- | `artifactMaxBytes` | `536870912` | At least 1 MiB across one workspace artifact store; a lower value also bounds logical chunk preparation, which has an independent fixed 536,870,912-byte ceiling. |
72
- | `artifactMaxEntries` | `5000` | 1 through 100,000 provenance manifests. |
73
- | `artifactMaxSingleBytes` | `134217728` | At least 1 MiB and no greater than `artifactMaxBytes`; applies to content. Provenance manifests have a separate fixed 1 MiB ceiling. |
74
- | `registrationRoots` | `[]` | Up to 16 operator-approved source parents for runtime `hoi4.project_register`; this alone never grants writable-mod registration. |
75
- | `writableRegistrationRoots` | `[]` | Up to 16 narrow descendants of `registrationRoots` that may be runtime `kind: "mod"` roots. Empty fails closed. |
76
- | `storageRoots` | `[]` | Up to 16 operator-approved parents for artifact and cache directories; not a source-registration allowlist. |
77
- | `workspaces` | `[]` | Up to 1,000 statically reviewed workspace registrations; configured plus runtime registrations may never exceed 1,000. |
78
- | `http` | loopback defaults below | Streamable HTTP policy. An omitted/default HTTP block has no credentials, so the HTTP executable refuses to start until authentication is configured. Stdio does not require HTTP authentication. |
79
-
80
- The configuration also rejects unsafe combined budgets: `scanMaxBytes` multiplied by
81
- `http.maxConcurrentRequests` must be at most 512 MiB, while `maxBodyBytes` multiplied by
82
- `maxConcurrentRequests` must be at most 16 MiB. HTTP concurrency has a fixed maximum of two so two
83
- simultaneous offline renders cannot exceed the supported process-safety model.
84
-
85
- `serverStateRoot` is mandatory whenever `writePolicy` is `"transactions"`. It must be absolute,
86
- resolve to a canonical directory through components that contain no symbolic links or junctions,
87
- and it must not overlap any configured or runtime source, fixture, artifact, cache, registration,
88
- writable-registration, or storage root. The server stores the native canonical spelling, including
89
- expanding harmless Windows 8.3 names, only after checking every existing component for links.
90
- The server creates one random 32-byte journal HMAC key there with mode `0600`; the surrounding
91
- POSIX directory must exclude group/other access. Windows operators must grant only the dedicated
92
- server account access through the directory DACL. Keep the same state root when restarting or
93
- temporarily changing to read-only mode so existing journals remain verifiable and recoverable. Do
94
- not copy a state root between unrelated deployments or expose it through a workspace mount.
95
- The state filesystem and every runtime artifact filesystem must support same-volume hard links and
96
- atomic rename/replacement. The server does not substitute a weaker ownership-claim or key-creation
97
- protocol when those primitives are unavailable.
98
-
99
- ## Workspace fields
100
-
101
- | Field | Default | Validation and behavior |
102
- | ----------------- | ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
103
- | `id` | required | Lowercase identifier matching `[a-z][a-z0-9_-]{0,63}`; unique in the configuration. |
104
- | `name` | required | Display name, 1 through 200 characters. |
105
- | `root` | required | Primary source root. Its root kind is selected by `kind`. |
106
- | `kind` | `"mod"` | `"mod"`, `"game"`, or `"dependency"`. Only a mod primary root can ever be writable. |
107
- | `gameRoot` | omitted | Optional additional read-only base-game source; it must not overlap another source in the workspace. |
108
- | `dependencyRoots` | `[]` | Up to 16 ordered read-only dependency roots without replacement metadata. |
109
- | `dependencies` | `[]` | Up to 16 ordered objects with required `root` and up to 1,000 `replacePaths`; mutually exclusive with non-empty `dependencyRoots`. |
110
- | `replacePaths` | `[]` | Up to 1,000 safe relative paths owned by the primary source root. |
111
- | `roots` | conventional roots below | Relative source-family search paths. Unknown root-family names are rejected. |
112
- | `artifactRoot` | mod default; otherwise required | A mod defaults to `<root>/.hoi4-agent/artifacts`. A game/dependency primary workspace must name an operator-owned path under `storageRoots`. |
113
- | `cacheRoot` | mod default; otherwise required | A mod defaults to `<root>/.hoi4-agent/cache`. A game/dependency primary workspace must name an operator-owned path under `storageRoots`. |
114
- | `fixtureRoot` | omitted | Optional read-only fixture source. |
115
- | `writeEnabled` | `false` | Effective only for `kind: "mod"` when global `writePolicy` is `"transactions"`. |
116
-
117
- `registrationRoots`, `writableRegistrationRoots`, and `storageRoots` grant different capabilities:
118
-
119
- - `registrationRoots` is consulted for runtime registration. The requested primary root and every
120
- requested game, dependency, and fixture source must pass both lexical and canonical containment
121
- beneath one of these roots. Statically configured `workspaces` come from the operator-reviewed
122
- config file and are not required to be beneath `registrationRoots`.
123
- - `writableRegistrationRoots` is a separate, default-empty capability. Every entry must remain
124
- lexically and canonically beneath `registrationRoots`. A runtime primary root declared as
125
- `kind: "mod"` must remain beneath one of these narrow roots even when `writeEnabled` is false,
126
- because mod registration creates generated artifact/cache storage. A game or dependency root
127
- listed only in `registrationRoots` cannot be relabelled as a writable mod by a caller.
128
- - `storageRoots` permits generated files only. It never makes a directory eligible as a source.
129
- Explicit artifact/cache paths outside a writable mod must canonicalize beneath one of these
130
- roots.
131
- - A mod may use its defaults or another descendant of the corresponding
132
- `<mod>/.hoi4-agent/artifacts` or `<mod>/.hoi4-agent/cache` subtree. It may also use an explicit
133
- path under `storageRoots`. Artifact and cache roots must be distinct, non-overlapping, and must
134
- not overlap source roots.
135
- - A `game` or `dependency` primary workspace is read-only and cannot place generated files in its
136
- source tree. Both generated roots are therefore required and must be explicit operator-owned
137
- descendants of `storageRoots`.
138
-
139
- Read-only source roots may be shared only where the workspace-isolation checks permit it; a
140
- workspace's internal primary/game/dependency/fixture roots must themselves be distinct and
141
- non-overlapping. Writable mod roots and generated roots are protected from overlap with other
142
- workspace-owned roots. The server creates approved artifact/cache directories when needed;
143
- approval comes from containment, not from the directory merely existing.
144
-
145
- For example, a read-only primary game workspace needs separate generated storage:
146
-
147
- ```json
148
- {
149
- "storageRoots": ["/var/lib/hoi4-agent-tools"],
150
- "workspaces": [
151
- {
152
- "id": "game-reference",
153
- "name": "Installed Game Reference",
154
- "kind": "game",
155
- "root": "/srv/hoi4/game",
156
- "artifactRoot": "/var/lib/hoi4-agent-tools/game-reference/artifacts",
157
- "cacheRoot": "/var/lib/hoi4-agent-tools/game-reference/cache"
158
- }
159
- ]
160
- }
161
- ```
162
-
163
- The same explicit-storage requirement applies when the primary `kind` is `"dependency"`.
164
-
165
- `dependencyRoots` remains the concise form when dependencies declare no replacement ownership. Use `dependencies` instead when a dependency owns `replace_path` declarations; entries are ordered from lowest to highest precedence, and each replacement hides that subtree only in lower roots. The active mod's `replacePaths` remains the highest-precedence owner. The two dependency forms are mutually exclusive.
166
-
167
- `hoi4.project_status` returns one authorized workspace per page when no `workspaceId` is supplied;
168
- follow `nextCursor` until absent. Replacement ownership is summarized with exact counts and bounded
169
- path samples, so a workspace with many `replace_path` entries cannot inflate a tool response.
170
-
171
- ## Read and write policy
172
-
173
- `writePolicy` defaults to `read-only`. Source apply/rollback requires `transactions` globally and `writeEnabled: true` on that mod workspace. A dependency or game registration remains read-only even if misconfigured.
174
-
175
- `registrationRoots` controls runtime `hoi4.project_register`. A requested root must canonicalize beneath one of these roots, and a runtime mod additionally requires `writableRegistrationRoots`. HTTP principals also need `allowRegistration`. Granting `allowRegistration` permits that principal to register unclaimed sources beneath the configured capability roots, so use narrow roots or static reviewed workspaces for multi-user deployments. Runtime registration does not edit a client configuration or persist raw paths. It atomically records a hash-only owner/workspace claim in the canonical artifact root; later registrations of that physical store must match it. Reassigning a claimed store is therefore an explicit operator operation: stop the server, review/archive the claim and existing evidence, and choose whether to preserve or separately migrate data. The server never deletes or silently rebinds it.
176
-
177
- Transaction mode does not accept pre-upgrade unauthenticated journal manifests. Preserve their
178
- cache directories for operator review, then explicitly archive or remove them together with the
179
- corresponding protected state decision; the server never guesses a migration or treats a public
180
- integrity hash as authorization.
181
-
182
- ## Conventional roots
183
-
184
- Each workspace can override relative root lists:
185
-
186
- - localisation: `localisation`, `localisation_synced`
187
- - interface: `interface`
188
- - GFX: `gfx`
189
- - map: `map`
190
- - focuses: `common/national_focus`
191
- - scripted GUI: `common/scripted_guis`
192
- - states: `history/states`
193
-
194
- The exact default `roots` object is:
195
-
196
- ```json
197
- {
198
- "localisation": ["localisation", "localisation_synced"],
199
- "interface": ["interface"],
200
- "gfx": ["gfx"],
201
- "map": ["map"],
202
- "focus": ["common/national_focus"],
203
- "scriptedGui": ["common/scripted_guis"],
204
- "states": ["history/states"]
205
- }
206
- ```
207
-
208
- Adapters can change these paths, not the safety model or source semantics.
209
-
210
- ## HTTP configuration
211
-
212
- Loopback static token example:
213
-
214
- ```json
215
- {
216
- "http": {
217
- "host": "127.0.0.1",
218
- "port": 3210,
219
- "allowedOrigins": ["https://agent.example.test"],
220
- "trustedProxyAddresses": [],
221
- "tokens": [
222
- {
223
- "principal": "developer",
224
- "tokenEnv": "HOI4_AGENT_HTTP_TOKEN",
225
- "workspaceIds": ["example"],
226
- "allowRegistration": false
227
- }
228
- ],
229
- "principals": [],
230
- "maxBodyBytes": 1048576,
231
- "headersTimeoutMs": 10000,
232
- "requestTimeoutMs": 30000,
233
- "keepAliveTimeoutMs": 5000,
234
- "maxConnections": 64,
235
- "maxRequestsPerSocket": 100,
236
- "maxConcurrentRequests": 2,
237
- "maxSessions": 128,
238
- "maxSessionsPerPrincipal": 32,
239
- "maxEventStreams": 32,
240
- "maxEventStreamsPerPrincipal": 4,
241
- "maxSessionEventBytes": 1048576,
242
- "maxEventStoreBytes": 16777216,
243
- "requestsPerMinute": 120,
244
- "sessionTtlSeconds": 3600
245
- }
246
- }
247
- ```
248
-
249
- Secrets are read from named environment variables and are not stored in config. A missing static
250
- secret, a value shorter than 32 characters, or duplicate secret values make HTTP startup fail. See
251
- [self-hosting](self-hosting.md) for OAuth configuration.
252
-
253
- Every HTTP field is listed below. URLs are validated absolute URLs.
254
-
255
- | Field | Default | Validation and behavior |
256
- | ----------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
257
- | `host` | `"127.0.0.1"` | Listen address. Static tokens are permitted only on `127.0.0.1`, `localhost`, or `::1`. |
258
- | `port` | `3210` | 0 through 65,535; `0` requests an ephemeral port. |
259
- | `publicUrl` | omitted | Canonical HTTP(S) origin or exact `/mcp` endpoint. Required for OAuth. A non-loopback listener or URL requires HTTPS public OAuth policy, including when a public reverse proxy reaches a loopback listener. Credentials, path prefixes, query, and fragment are forbidden. |
260
- | `allowedOrigins` | `[]` | Exact HTTP(S) origins (`scheme://host[:port]`) without credentials, paths, queries, or fragments; opaque origins such as `null` are rejected. A present `Origin` header must match. Non-loopback deployments require at least one. |
261
- | `trustedProxyAddresses` | `[]` | Exact IPv4/IPv6 socket-peer addresses allowed to supply `X-Forwarded-For` for the pre-auth rate key only; no CIDR, hostname, other forwarded-header trust, or implicit trust. |
262
- | `tokens` | `[]` | Static-token grants. Mutually exclusive with `oauth`. |
263
- | `principals` | `[]` | OAuth subject allowlist and workspace grants. OAuth startup requires at least one entry. |
264
- | `oauth` | omitted | OAuth/OIDC JWT verification settings. |
265
- | `maxBodyBytes` | `1048576` | 1,024 through 16,777,216 JSON bytes. |
266
- | `headersTimeoutMs` | `10000` | 1,000 through 120,000; cannot exceed `requestTimeoutMs`. |
267
- | `requestTimeoutMs` | `30000` | 1,000 through 300,000 to receive the complete request. |
268
- | `keepAliveTimeoutMs` | `5000` | 1,000 through 120,000 and strictly less than `headersTimeoutMs`. |
269
- | `maxConnections` | `64` | 1 through 100,000 accepted server connections. |
270
- | `maxRequestsPerSocket` | `100` | 1 through 100,000 requests before a socket is retired. |
271
- | `maxConcurrentRequests` | `2` | 1 through 2 admitted requests, enforced before JSON parsing and authentication. This fixed ceiling bounds concurrent offline render work. |
272
- | `maxSessions` | `128` | 1 through 10,000 active plus pending MCP sessions globally. |
273
- | `maxSessionsPerPrincipal` | `32` | 1 through 10,000 active plus pending sessions per principal, also capped by `maxSessions`. |
274
- | `maxEventStreams` | `32` | 1 through 10,000 simultaneous resumable GET streams globally. |
275
- | `maxEventStreamsPerPrincipal` | `4` | 1 through 10,000 simultaneous streams per principal. |
276
- | `maxSessionEventBytes` | `1048576` | 64 KiB through 64 MiB of replay history per session; cannot exceed `maxEventStoreBytes`. |
277
- | `maxEventStoreBytes` | `16777216` | 64 KiB through 256 MiB of replay history shared across sessions. |
278
- | `requestsPerMinute` | `120` | 1 through 100,000 in each fixed minute, independently before auth per client address and after auth per principal. |
279
- | `sessionTtlSeconds` | `3600` | 60 through 86,400; renewed by an authorized request. |
280
-
281
- Each `tokens` entry requires `principal`, `tokenEnv`, and at least one configured `workspaceId`;
282
- `allowRegistration` defaults to `false`. Token principals and environment-variable names must be
283
- unique. Each `principals` entry requires `principal`; `workspaceIds` defaults to `[]` and
284
- `allowRegistration` to `false`. OAuth principals must be unique, and static-token/OAuth principal
285
- namespaces must be disjoint. Every granted workspace ID must exist in the static configuration.
286
-
287
- The `oauth` object requires `issuer`, `jwksUri`, `audience`, and at least one
288
- `authorizationServers` URL. `requiredScopes` defaults to `["hoi4:read"]`. `algorithms` defaults to
289
- `["RS256"]` and accepts only `RS256`, `RS384`, `RS512`, `ES256`, `ES384`, `ES512`, or `EdDSA`.
@@ -1,195 +0,0 @@
1
- # Focus Tree Workbench
2
-
3
- The workbench imports existing focus source into a structured plan without normalizing away unsupported fields. It models tree/country assignment, branches and lanes, explicit prerequisite groups, exclusions, route locks, bypass/availability, fixed/relative/pinned/automatic positions, planner-only hidden/crisis/conditional routes, convergence, shared support, icons, localisation, AI/filter metadata, linked content, and raw passthrough.
4
-
5
- Linked reward content is taken from the actual effect grammar. Native effects are distinguished by
6
- the bundled catalog of all 553 identifiers documented for the supported HOI4 1.19.2 build. Direct scripted-effect calls, including calls nested in
7
- `IF`/`ELSE`, iterator scopes, and weighted `random_list` entries, link to the shared scripted-effect
8
- index. Native control/trigger blocks and country, state, character, event-target, or variable scopes
9
- are traversed without becoming helper links. Decision-category tooltips link to indexed top-level
10
- categories; decision targets recognized as formables link to the formable symbol; cosmetic tags do
11
- not masquerade as formables. Missing links retain the exact reward source location.
12
-
13
- Decision categories are additive database fragments: the category definition under
14
- `common/decisions/categories` and one or more decision-member blocks may legitimately share an ID.
15
- The shared index retains those fragments without reporting a duplicate-definition collision while
16
- still honoring same-relative-file shadowing and load-order source ownership.
17
-
18
- National focus `cost` values support finite numbers and safe file-scoped constants such as
19
- `@focus_cost_standard`. Targeted layout updates preserve the exact existing cost lexeme, including
20
- numeric formatting and comments. A cost token outside the typed model is retained unchanged when
21
- the plan does not explicitly replace it; the compiler refuses to generate an arbitrary scalar.
22
-
23
- National focuses and continuous focuses use their actual HOI4 source models. National trees come from the workspace registration's configured `roots.focus` paths. Continuous focuses come from `common/continuous_focus/*.txt` as `continuous_focus_palette = { ... focus = { ... } }`; matching country palettes take precedence over the default palette, and the compiler never emits a `continuous` field inside a national `focus = { ... }` block.
24
-
25
- ## Agent workflow
26
-
27
- 1. `hoi4.project_scan` builds the common workspace/index revision.
28
- 2. `hoi4.focus_scan` imports active national trees, matching continuous-focus palettes, active localisation, sprite definitions, and only the exact texture paths referenced by those sprites.
29
- 3. `hoi4.focus_lint` separates syntax, reference, layout, and design diagnostics. Omit `mode` for national-tree compatibility, or pass `mode: "continuous"` with an optional `paletteId` to lint a palette directly.
30
- 4. `hoi4.focus_layout` calculates stable integer coordinates. Pinned positions and existing coordinates anchor incremental changes.
31
- 5. `hoi4.focus_render` returns deterministic HTML, SVG, PNG, JSON, and generated-source-map resources. National mode also returns the graph layout and hash-bound planning sidecar; a uniform `reviewScale` from `0.25` through `1.0` keeps unusually wide or deep trees within bounded raster limits without changing logical geometry or source coordinates. Continuous mode accepts palette columns and renders the actual continuous-focus source model.
32
- 6. `hoi4.focus_plan_changes` accepts either a national plan (the backward-compatible default) or `mode: "continuous"` with a continuous-palette plan. Both make source-preserving range edits where possible and produce before/proposed/bitmap-diff review artifacts before creating the dry-run transaction. National plans may set `horizontalSpacing`, `verticalSpacing`, `padding`, and a uniform `reviewScale` for both review renders; those pixel-space settings do not alter focus coordinates or compiled HOI4 source. National plans also maintain the adjacent planning sidecar. To create a first tree or palette in a new mod source file, the coding agent must set `createIfMissing: true`; without that explicit flag, missing sources and IDs refuse. Creation never appends a different target to an existing source file, because doing so could repurpose unrelated source or its adjacent planning sidecar. It uses a transparent source-linked before render, never copies a read-only game/dependency file into a shadowing mod path, and rolls back newly created source and sidecar files atomically.
33
- 7. Review drift, diagnostics, source maps, diff artifacts, and plan hash before apply.
34
-
35
- ## Repairing an existing large tree
36
-
37
- Imported authored coordinates are fixed by design. A plain `hoi4.focus_layout` call therefore
38
- audits an existing layout without silently rearranging it. To opt a badly structured tree into a
39
- full cleanup, the coding agent must make the movement policy explicit:
40
-
41
- 1. Scan, lint, and render the baseline, then read the complete imported plan resource. Use the same
42
- national `reviewScale` for baseline, transaction, and final renders when the default canvas is too
43
- large.
44
- 2. Preserve every prerequisite group, exclusion, route lock, reward, raw passthrough entry, source
45
- location, and provenance value.
46
- 3. Model the intended route architecture with `branchGroups`, `laneGroups`, `branchId`, and
47
- `laneId`. Give lanes stable order and, where appropriate, horizontal bounds.
48
- 4. Keep only deliberate trunk or convergence anchors fixed/pinned. Change every movable focus to
49
- `{ "mode": "auto", "pinned": false }`; `preferredX` and `preferredY` may retain the authored
50
- route intent without making those coordinates mandatory.
51
- 5. Submit the complete plan to `hoi4.focus_plan_changes`. The dry run performs layout, compilation,
52
- lint, source-preserving range edits, deterministic before/proposed rendering, and bitmap diffing.
53
- For an unusually wide or deep tree, set a uniform national `reviewScale` between `0.25` and
54
- `1.0`; `0.4` is appropriate for a very large comparison. It scales nodes, text, connectors, and
55
- the viewport together, avoiding artificial overlap. The same scale governs both sides of the
56
- comparison and affects only artifact pixels, never source-grid coordinates. Explicit spacing and
57
- padding remain available when the artifact's logical presentation itself needs adjustment.
58
- 6. Read every `hoi4.transaction_diff` page and all linked review resources. Apply the exact
59
- hash-bound transaction only under the coding-agent host's configured write policy.
60
- 7. Rescan, lint, and render the applied tree. A rejected result can be restored exactly with
61
- `hoi4.transaction_rollback` and the same transaction ID and plan hash.
62
-
63
- This workflow is suitable for hundreds of focuses. The solver keeps parents above children,
64
- rejects visible overlap and duplicate coordinates, separates bounded lanes, validates relative
65
- chains, and minimizes avoidable connector crossings. It never changes gameplay relationships to
66
- make a picture look cleaner.
67
-
68
- ## Authoring a large tree
69
-
70
- For a new tree, translate route requirements into the strict public schema at
71
- `hoi4-agent://schema/focus-plan`. A robust plan uses a centered entry/trunk, bounded political or
72
- strategic lanes, separately modelled shared-support lanes, exact AND/OR prerequisite groups,
73
- reciprocal route exclusions, explicit convergence and capstones, automatic positions, and complete
74
- localisation/icon/AI/link metadata. Unsupported Clausewitz blocks belong in `rawPassthrough` so they
75
- round-trip instead of being approximated.
76
-
77
- This minimal national plan is schema-valid. It intentionally omits an icon and reward; a production
78
- tree should add complete presentation and gameplay data before apply:
79
-
80
- ```json
81
- {
82
- "schemaVersion": 1,
83
- "id": "example_tree",
84
- "default": false,
85
- "branchGroups": [
86
- {
87
- "id": "constitutional",
88
- "label": "Constitutional route",
89
- "family": "politics",
90
- "focusIds": ["example_entry"],
91
- "laneId": "centre",
92
- "major": true,
93
- "hidden": false,
94
- "crisis": false,
95
- "conditional": false,
96
- "aiStrategyIds": []
97
- }
98
- ],
99
- "laneGroups": [
100
- { "id": "left", "label": "Left route", "order": 0, "minimumX": -12, "maximumX": -5 },
101
- { "id": "centre", "label": "Constitutional trunk", "order": 1, "minimumX": -2, "maximumX": 2 },
102
- { "id": "right", "label": "Right route", "order": 2, "minimumX": 5, "maximumX": 12 }
103
- ],
104
- "entryFocusIds": ["example_entry"],
105
- "focuses": [
106
- {
107
- "id": "example_entry",
108
- "label": "Example entry",
109
- "branchId": "constitutional",
110
- "laneId": "centre",
111
- "prerequisites": { "operator": "and", "groups": [] },
112
- "mutuallyExclusive": [],
113
- "routeLocks": [],
114
- "position": { "mode": "auto", "pinned": false, "preferredX": 0, "preferredY": 0 },
115
- "visibility": "normal",
116
- "convergence": false,
117
- "sharedSupport": false,
118
- "icons": [],
119
- "localisation": {
120
- "titleKey": "example_entry",
121
- "descriptionKey": "example_entry_desc",
122
- "workingLabel": "Example entry"
123
- },
124
- "ai": { "majorRoute": true, "strategyIds": [] },
125
- "filters": ["FOCUS_FILTER_POLITICAL"],
126
- "links": [],
127
- "rawPassthrough": []
128
- }
129
- ],
130
- "sharedFocusIds": [],
131
- "continuousFocusPaletteIds": [],
132
- "continuousFocusIds": [],
133
- "rawPassthrough": [],
134
- "provenance": {
135
- "sourcePath": "plan:example_tree",
136
- "sourceHash": "0000000000000000000000000000000000000000000000000000000000000000",
137
- "importedPlanHash": "0000000000000000000000000000000000000000000000000000000000000000"
138
- }
139
- }
140
- ```
141
-
142
- Within each focus, one `prerequisites.groups` entry represents one Clausewitz `prerequisite` block
143
- whose listed focuses are OR alternatives. Multiple group entries are AND requirements. For a new
144
- target, use `sourcePath: "plan:<tree-id>"` and 64 zeroes for both initial hashes, then call
145
- `hoi4.focus_plan_changes` with `createIfMissing: true`. Use that convention only for a missing
146
- target. Existing sources normally use imported, hash-bound provenance; resolving intentional
147
- plan/source drift additionally requires explicit `authority: "plan"`. The server refuses to append
148
- a different tree to an occupied source file and still requires the normal dry-run/apply boundary.
149
-
150
- ## Prerequisite and route semantics
151
-
152
- One `prerequisite` block containing several `focus` entries is an OR group. Several prerequisite blocks are ANDed. The importer preserves that grouping exactly. It never flattens prerequisites into a graph that changes meaning.
153
-
154
- Structured route locks compile only to valid trigger fields: selection conditions use `available`, while branch visibility uses `allow_branch`. `all`, `any`, exclusion, and impossible locks compile to direct conditions, `OR`, `NOT`, and `always = no` respectively. Hidden/crisis labels are design metadata, not Clausewitz keys; re-import enrichment restores them from the sidecar without emitting invalid `hidden =` or `crisis =` markers.
155
-
156
- ## Planning sidecar
157
-
158
- Branch/lane assignment, shared-support status, working labels, planner visibility/reveal intent, terminal/payoff classification, and major-route AI notes are design metadata rather than HOI4 fields. A source file such as `common/national_focus/example.txt` therefore has an adjacent `example.focus-plan.json` sidecar.
159
-
160
- The sidecar records the exact generated source SHA-256. Enrichment is explicit and succeeds only for the matching tree and source hash; stale or mismatched sidecars produce diagnostics and do not silently override source truth. Source-only imports remain valid when no sidecar exists.
161
-
162
- ## Localisation and sprite resolution
163
-
164
- Scan and render select active localisation and sprite symbols through the shared load-order index. Rendered titles use the active language value, and icons use frame zero from the active sprite's real `texturefile` and `noOfFrames` definition. Sprite strips are cropped to the resolved frame rather than displayed as a whole image.
165
-
166
- Raster discovery is deliberately exact: the shared workspace scan does not walk every `gfx/**/*.dds` or `gfx/**/*.png` file. After resolving referenced sprites, the asset catalog scans only their normalized texture paths. Missing localisation, sprite, texture, or unsupported-frame diagnostics retain the originating focus/icon source location.
167
-
168
- ## Layout contract
169
-
170
- Hard constraints keep parents above children, coordinates unique, visible nodes non-overlapping, automatic nodes inside configured lane bounds, pinned nodes fixed, and relative-position chains valid. Automatic preferred coordinates are clamped to their lane; a full lane raises `FOCUS_LAYOUT_LANE_CAPACITY_BLOCKED`. Fixed, relative, or prior-stable coordinates outside their declared lane are preserved as evidence but produce a blocking `FOCUS_LAYOUT_LANE_BOUNDS_VIOLATION`. The solver records every move and unsatisfied constraint. It never changes a prerequisite, silently stacks nodes, or invents a route.
171
-
172
- Mutual-exclusion relationships are also layout constraints: newly placed automatic endpoints must retain at least the configured `nodeSpacing` in horizontal focus-grid columns. Fixed, relative, pinned, and prior-layout coordinates are stability anchors. The solver does not move those anchors to improve mutual-exclusion spacing or connector routing; it emits `FOCUS_LAYOUT_MUTUAL_EXCLUSION_SPACING_UNSATISFIED` with the movable and preserved endpoints when authored constraints make the gap impossible.
173
-
174
- For each new automatic node, the solver evaluates integer candidates in deterministic distance and direction order, rejects visible overlap and mutual-exclusion violations, and chooses the nearest candidate with the fewest connector crossings. A crossing-only move is recorded as `moved_to_reduce_crossings` with its before/after count. Remaining crossings produce `FOCUS_LAYOUT_CONNECTOR_CROSSING_UNSATISFIED` with the preserved endpoints and reason. Supplying a previous layout makes its existing automatic nodes stable anchors, so a small addition cannot reshuffle an accepted tree.
175
-
176
- Weak dangling branches, terminal payoff, missing AI, and repeated generic rewards remain deterministic design warnings. Layout heuristics never become automatic gameplay edits.
177
-
178
- ## Drift and source maps
179
-
180
- The plan records imported source and semantic hashes. If both saved plan and hand-edited script diverge, regeneration is blocked until the coding agent explicitly identifies the authoritative source. Raw fields remain attached to source ranges either way. An explicitly created target reports `target_missing` drift with `requiresAuthority: false`; that status means there is no prior target to reconcile, not that an existing source was overwritten.
181
-
182
- Every compiled or proposed focus block receives a source-map entry containing the focus ID, generated location, planning-node location when available, and imported source location when available. National render artifacts use `<tree>.focus.source-map.json`; continuous renders use `<palette>.continuous.source-map.json`. Dry-run transactions retain the corresponding proposed source map and all review artifacts after apply and rollback.
183
-
184
- ## Artifacts
185
-
186
- Each rendered node includes its ID, resolved title/working label, resolved icon frame or diagnostic, coordinates, prerequisite type, exclusions, branch family, planner visibility/convergence/terminal state, AI metadata, and source-linked diagnostics. HTML search and filters inspect evidence only; they cannot write source.
187
-
188
- National-tree renders store `<tree>.focus.html`, `.svg`, `.png`, `.json`, `.source-map.json`, and `.plan.json`. Continuous-palette renders use the same core artifact store and produce `<palette>.continuous.html`, `.svg`, `.png`, `.json`, and `.source-map.json`. The JSON embeds the same complete generated-source map that is also stored separately, and all formats carry content hashes plus source/render provenance.
189
-
190
- A national focus transaction also stores `<tree>.focus.proposed-validation.json`. It contains every
191
- diagnostic and validation check from re-importing, laying out, and linting the compiled proposal.
192
- When that complete set is larger than the fixed transaction-manifest allowance, the manifest keeps
193
- a blocker-first bounded summary and an explicit resource diagnostic; it never drops findings from
194
- the validation decision. The generic apply boundary uses the same pattern for oversized post-write
195
- diagnostics.