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