rpg-engine 0.7.0 → 0.8.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 (393) hide show
  1. package/dist/adventures/index.d.ts +1 -1
  2. package/dist/adventures/index.js +1 -1
  3. package/dist/adventures/source.js +13 -13
  4. package/dist/campaign/create-campaign.js +10 -1
  5. package/dist/campaign/host-files.d.ts +2 -1
  6. package/dist/campaign/host-files.js +11 -11
  7. package/dist/campaign/index.d.ts +1 -1
  8. package/dist/campaign/index.js +1 -1
  9. package/dist/campaign/settings.d.ts +55 -64
  10. package/dist/campaign/settings.js +171 -174
  11. package/dist/{cli.js → cli/cli.js} +3 -3
  12. package/dist/{command-line.d.ts → cli/command-line.d.ts} +1 -1
  13. package/dist/{command-line.js → cli/command-line.js} +21 -20
  14. package/dist/commands/advance.d.ts +1 -1
  15. package/dist/commands/advance.js +7 -7
  16. package/dist/commands/ask.d.ts +1 -8
  17. package/dist/commands/ask.js +16 -29
  18. package/dist/commands/{change.d.ts → change/change.d.ts} +2 -2
  19. package/dist/commands/{change.js → change/change.js} +46 -52
  20. package/dist/commands/{game-damage.d.ts → change/damage.d.ts} +2 -2
  21. package/dist/commands/{game-damage.js → change/damage.js} +3 -3
  22. package/dist/commands/{game-recipe-pace.d.ts → change/recipe-pace.d.ts} +2 -2
  23. package/dist/commands/{game-recipe-pace.js → change/recipe-pace.js} +4 -4
  24. package/dist/commands/config.d.ts +4 -4
  25. package/dist/commands/config.js +142 -138
  26. package/dist/commands/effect.d.ts +1 -1
  27. package/dist/commands/effect.js +11 -12
  28. package/dist/commands/find.d.ts +4 -4
  29. package/dist/commands/find.js +2 -2
  30. package/dist/commands/image.js +6 -6
  31. package/dist/commands/{import.d.ts → import/import.d.ts} +2 -2
  32. package/dist/commands/{import.js → import/import.js} +101 -101
  33. package/dist/commands/{game-import.d.ts → import/run.d.ts} +3 -3
  34. package/dist/commands/{game-import.js → import/run.js} +13 -12
  35. package/dist/commands/index.js +7 -7
  36. package/dist/commands/init.js +3 -3
  37. package/dist/commands/install.js +1 -1
  38. package/dist/commands/instructions.js +6 -6
  39. package/dist/commands/mode.d.ts +2 -2
  40. package/dist/commands/mode.js +8 -8
  41. package/dist/commands/mood.js +4 -4
  42. package/dist/commands/move.js +13 -20
  43. package/dist/commands/package.d.ts +2 -2
  44. package/dist/commands/package.js +138 -93
  45. package/dist/commands/rename.js +3 -3
  46. package/dist/commands/reveal.js +29 -18
  47. package/dist/commands/{roll.d.ts → roll/roll.d.ts} +4 -4
  48. package/dist/commands/{roll.js → roll/roll.js} +69 -69
  49. package/dist/commands/{game-tables.d.ts → roll/tables.d.ts} +2 -2
  50. package/dist/commands/{game-tables.js → roll/tables.js} +4 -4
  51. package/dist/commands/rules.d.ts +2 -2
  52. package/dist/commands/rules.js +3 -3
  53. package/dist/commands/save.d.ts +1 -1
  54. package/dist/commands/save.js +18 -18
  55. package/dist/commands/scene.d.ts +4 -4
  56. package/dist/commands/scene.js +31 -28
  57. package/dist/commands/{game-advance.d.ts → shared/advance.d.ts} +4 -4
  58. package/dist/commands/{game-advance.js → shared/advance.js} +27 -27
  59. package/dist/commands/{game-adventures.d.ts → shared/adventures.d.ts} +3 -3
  60. package/dist/commands/{game-adventures.js → shared/adventures.js} +20 -27
  61. package/dist/commands/{game-bonds.d.ts → shared/bonds.d.ts} +3 -3
  62. package/dist/commands/{game-bonds.js → shared/bonds.js} +2 -2
  63. package/dist/commands/{game-checks.d.ts → shared/checks.d.ts} +3 -3
  64. package/dist/commands/{game-checks.js → shared/checks.js} +7 -7
  65. package/dist/commands/{game-dice-pool.d.ts → shared/dice-pool.d.ts} +3 -3
  66. package/dist/commands/{game-dice-pool.js → shared/dice-pool.js} +19 -12
  67. package/dist/commands/{effect-layer.d.ts → shared/effect-layer.d.ts} +2 -2
  68. package/dist/commands/{effect-layer.js → shared/effect-layer.js} +12 -12
  69. package/dist/commands/{game-effects.d.ts → shared/effects.d.ts} +7 -7
  70. package/dist/commands/{game-effects.js → shared/effects.js} +19 -19
  71. package/dist/commands/{game-environment.d.ts → shared/environment.d.ts} +1 -1
  72. package/dist/commands/{game-environment.js → shared/environment.js} +3 -3
  73. package/dist/commands/{game-events.d.ts → shared/events.d.ts} +5 -5
  74. package/dist/commands/{game-events.js → shared/events.js} +20 -22
  75. package/dist/commands/{game-examples.d.ts → shared/examples.d.ts} +4 -8
  76. package/dist/commands/{game-examples.js → shared/examples.js} +23 -23
  77. package/dist/commands/{game-experience.d.ts → shared/experience.d.ts} +2 -2
  78. package/dist/commands/{game-experience.js → shared/experience.js} +8 -11
  79. package/dist/commands/{game-grid-moves.d.ts → shared/grid-moves.d.ts} +6 -6
  80. package/dist/commands/{game-grid-moves.js → shared/grid-moves.js} +5 -5
  81. package/dist/commands/{game-grids.d.ts → shared/grids.d.ts} +4 -9
  82. package/dist/commands/{game-grids.js → shared/grids.js} +20 -19
  83. package/dist/commands/{game-images.d.ts → shared/images.d.ts} +3 -3
  84. package/dist/commands/{game-images.js → shared/images.js} +7 -6
  85. package/dist/commands/shared/inputs.d.ts +9 -0
  86. package/dist/commands/shared/inputs.js +12 -0
  87. package/dist/commands/{game-journey.d.ts → shared/journey.d.ts} +4 -6
  88. package/dist/commands/{game-journey.js → shared/journey.js} +13 -15
  89. package/dist/commands/{game-knowledge.d.ts → shared/knowledge.d.ts} +15 -8
  90. package/dist/commands/{game-knowledge.js → shared/knowledge.js} +42 -42
  91. package/dist/{library-reader.js → commands/shared/library-reader.js} +4 -4
  92. package/dist/commands/{game-library.d.ts → shared/library.d.ts} +7 -4
  93. package/dist/commands/{game-library.js → shared/library.js} +70 -50
  94. package/dist/commands/{game-limits.d.ts → shared/limits.d.ts} +3 -3
  95. package/dist/commands/{game-limits.js → shared/limits.js} +3 -3
  96. package/dist/commands/{game-loot.d.ts → shared/loot.d.ts} +2 -2
  97. package/dist/commands/{game-loot.js → shared/loot.js} +3 -3
  98. package/dist/commands/{game-master-rolls.d.ts → shared/master-rolls.d.ts} +2 -2
  99. package/dist/commands/{game-master-rolls.js → shared/master-rolls.js} +6 -6
  100. package/dist/commands/{game-mode.d.ts → shared/mode.d.ts} +4 -6
  101. package/dist/commands/{game-mode.js → shared/mode.js} +10 -10
  102. package/dist/commands/{game-money.d.ts → shared/money.d.ts} +3 -3
  103. package/dist/commands/{game-money.js → shared/money.js} +4 -4
  104. package/dist/commands/{game-moods.d.ts → shared/moods.d.ts} +3 -3
  105. package/dist/commands/{game-moods.js → shared/moods.js} +3 -3
  106. package/dist/commands/{game-moves.d.ts → shared/moves.d.ts} +2 -2
  107. package/dist/commands/{game-moves.js → shared/moves.js} +5 -5
  108. package/dist/commands/{game-offers.d.ts → shared/offers.d.ts} +3 -3
  109. package/dist/commands/{game-offers.js → shared/offers.js} +9 -12
  110. package/dist/commands/{game-outside.d.ts → shared/outside.d.ts} +3 -3
  111. package/dist/commands/{game-outside.js → shared/outside.js} +9 -9
  112. package/dist/commands/{game-catalog.d.ts → shared/packages/catalog.d.ts} +1 -3
  113. package/dist/commands/{game-catalog.js → shared/packages/catalog.js} +17 -22
  114. package/dist/commands/{game-package-code.d.ts → shared/packages/code.d.ts} +10 -14
  115. package/dist/commands/{game-package-code.js → shared/packages/code.js} +156 -59
  116. package/dist/commands/{game-extension-list.d.ts → shared/packages/extensions.d.ts} +6 -6
  117. package/dist/commands/{game-extension-list.js → shared/packages/extensions.js} +43 -22
  118. package/dist/commands/{game-package-hooks.d.ts → shared/packages/hooks.d.ts} +3 -3
  119. package/dist/commands/{game-package-hooks.js → shared/packages/hooks.js} +3 -3
  120. package/dist/commands/{game-widgets.d.ts → shared/packages/widgets.d.ts} +6 -10
  121. package/dist/commands/{game-widgets.js → shared/packages/widgets.js} +57 -57
  122. package/dist/commands/{page-counters.d.ts → shared/page-counters.d.ts} +3 -3
  123. package/dist/commands/{page-counters.js → shared/page-counters.js} +5 -5
  124. package/dist/{page-words.d.ts → commands/shared/page-words.d.ts} +2 -2
  125. package/dist/{page-words.js → commands/shared/page-words.js} +5 -4
  126. package/dist/commands/{parts.d.ts → shared/parts.d.ts} +3 -3
  127. package/dist/commands/{parts.js → shared/parts.js} +4 -4
  128. package/dist/commands/{game-positions.d.ts → shared/positions.d.ts} +3 -5
  129. package/dist/commands/{game-positions.js → shared/positions.js} +6 -7
  130. package/dist/commands/{problems.d.ts → shared/problems.d.ts} +3 -3
  131. package/dist/commands/{problems.js → shared/problems.js} +21 -22
  132. package/dist/commands/{progression.d.ts → shared/progression.d.ts} +2 -2
  133. package/dist/commands/{progression.js → shared/progression.js} +4 -4
  134. package/dist/commands/{game-quests.d.ts → shared/quests.d.ts} +4 -4
  135. package/dist/commands/{game-quests.js → shared/quests.js} +6 -6
  136. package/dist/commands/{game-recipes.d.ts → shared/recipes.d.ts} +3 -3
  137. package/dist/commands/{game-recipes.js → shared/recipes.js} +3 -3
  138. package/dist/commands/{game-reminders.d.ts → shared/reminders.d.ts} +4 -4
  139. package/dist/commands/{game-reminders.js → shared/reminders.js} +4 -4
  140. package/dist/commands/{game-roads.d.ts → shared/roads.d.ts} +5 -5
  141. package/dist/commands/{game-roads.js → shared/roads.js} +43 -44
  142. package/dist/commands/{game-rules.d.ts → shared/rules.d.ts} +2 -2
  143. package/dist/commands/{game-rules.js → shared/rules.js} +4 -4
  144. package/dist/commands/{game-saves.d.ts → shared/saves.d.ts} +4 -4
  145. package/dist/commands/{game-saves.js → shared/saves.js} +51 -51
  146. package/dist/commands/{game-scene.d.ts → shared/scene.d.ts} +13 -3
  147. package/dist/commands/{game-scene.js → shared/scene.js} +41 -13
  148. package/dist/commands/{sheet.d.ts → shared/sheet.d.ts} +5 -5
  149. package/dist/commands/{sheet.js → shared/sheet.js} +76 -76
  150. package/dist/commands/{game-stacks.d.ts → shared/stacks.d.ts} +2 -9
  151. package/dist/commands/{game-stacks.js → shared/stacks.js} +22 -22
  152. package/dist/commands/{game-theme.d.ts → shared/theme.d.ts} +3 -3
  153. package/dist/commands/{game-theme.js → shared/theme.js} +2 -2
  154. package/dist/commands/{game-thoughts.d.ts → shared/thoughts.d.ts} +2 -4
  155. package/dist/commands/{game-thoughts.js → shared/thoughts.js} +6 -8
  156. package/dist/commands/{game-thresholds.d.ts → shared/thresholds.d.ts} +1 -1
  157. package/dist/commands/{game-thresholds.js → shared/thresholds.js} +4 -4
  158. package/dist/commands/{game-time.d.ts → shared/time.d.ts} +4 -4
  159. package/dist/commands/{game-time.js → shared/time.js} +6 -6
  160. package/dist/commands/{game-turn-uses.d.ts → shared/turn-uses.d.ts} +3 -3
  161. package/dist/commands/{game-turn-uses.js → shared/turn-uses.js} +12 -15
  162. package/dist/commands/{game-upkeep.d.ts → shared/upkeep.d.ts} +3 -3
  163. package/dist/commands/{game-upkeep.js → shared/upkeep.js} +69 -57
  164. package/dist/commands/{game-voices.d.ts → shared/voices.d.ts} +1 -1
  165. package/dist/commands/{game-voices.js → shared/voices.js} +2 -2
  166. package/dist/commands/{worked-out.d.ts → shared/worked-out.d.ts} +3 -8
  167. package/dist/commands/{worked-out.js → shared/worked-out.js} +238 -238
  168. package/dist/commands/{game-world.d.ts → shared/world.d.ts} +5 -14
  169. package/dist/commands/{game-world.js → shared/world.js} +72 -76
  170. package/dist/commands/show.d.ts +1 -1
  171. package/dist/commands/show.js +32 -17
  172. package/dist/commands/status.d.ts +1 -1
  173. package/dist/commands/status.js +28 -28
  174. package/dist/commands/thoughts.js +3 -3
  175. package/dist/commands/trade.js +9 -10
  176. package/dist/commands/translate.d.ts +1 -1
  177. package/dist/commands/translate.js +3 -3
  178. package/dist/commands/{game-open.d.ts → travel/open.d.ts} +3 -3
  179. package/dist/commands/{game-open.js → travel/open.js} +4 -5
  180. package/dist/commands/{route.d.ts → travel/route.d.ts} +1 -1
  181. package/dist/commands/{route.js → travel/route.js} +9 -10
  182. package/dist/commands/{travel.d.ts → travel/travel.d.ts} +2 -2
  183. package/dist/commands/{travel.js → travel/travel.js} +19 -21
  184. package/dist/commands/validate.js +5 -5
  185. package/dist/commands/{game-view-journal.d.ts → view/journal.d.ts} +5 -5
  186. package/dist/commands/{game-view-journal.js → view/journal.js} +5 -5
  187. package/dist/commands/{game-view-map.d.ts → view/map.d.ts} +3 -3
  188. package/dist/commands/{game-view-map.js → view/map.js} +15 -16
  189. package/dist/commands/{game-view-place.d.ts → view/place.d.ts} +6 -6
  190. package/dist/commands/{game-view-place.js → view/place.js} +108 -108
  191. package/dist/commands/{view.d.ts → view/view.d.ts} +16 -16
  192. package/dist/commands/{view.js → view/view.js} +35 -35
  193. package/dist/commands/{game-view-world.d.ts → view/world.d.ts} +4 -4
  194. package/dist/commands/{game-view-world.js → view/world.js} +7 -7
  195. package/dist/commands/{game-here.d.ts → write/here.d.ts} +5 -3
  196. package/dist/commands/{game-here.js → write/here.js} +18 -12
  197. package/dist/commands/{write.d.ts → write/write.d.ts} +6 -6
  198. package/dist/commands/{write.js → write/write.js} +44 -41
  199. package/dist/confirm/confirm.d.ts +2 -0
  200. package/dist/confirm/confirm.js +15 -5
  201. package/dist/core/consents.d.ts +3 -2
  202. package/dist/core/consents.js +43 -4
  203. package/dist/core/context.d.ts +8 -6
  204. package/dist/core/context.js +4 -2
  205. package/dist/core/download.js +16 -5
  206. package/dist/core/files.d.ts +6 -1
  207. package/dist/core/files.js +47 -21
  208. package/dist/core/formula.d.ts +7 -2
  209. package/dist/core/formula.js +63 -66
  210. package/dist/core/instruction-parts.js +1 -1
  211. package/dist/core/mood.d.ts +0 -1
  212. package/dist/core/mood.js +3 -3
  213. package/dist/core/package-api.d.ts +11 -0
  214. package/dist/core/package-api.js +2 -1
  215. package/dist/core/package-declarations.d.ts +9 -9
  216. package/dist/core/package-declarations.js +3 -3
  217. package/dist/core/process-mark.d.ts +8 -0
  218. package/dist/core/process-mark.js +72 -0
  219. package/dist/core/registry.d.ts +5 -0
  220. package/dist/core/registry.js +10 -0
  221. package/dist/core/session-store.d.ts +0 -1
  222. package/dist/core/session-store.js +11 -14
  223. package/dist/core/store.d.ts +4 -0
  224. package/dist/core/store.js +29 -8
  225. package/dist/core/text.d.ts +4 -0
  226. package/dist/core/text.js +11 -2
  227. package/dist/core/yaml-file.js +2 -2
  228. package/dist/dashboard/{acts.js → acts/acts.js} +2 -2
  229. package/dist/dashboard/{act-names.js → acts/names.js} +1 -1
  230. package/dist/dashboard/{act-sheet.js → acts/sheet.js} +3 -3
  231. package/dist/dashboard/{act-strip.js → acts/strip.js} +2 -2
  232. package/dist/dashboard/app.js +13 -13
  233. package/dist/dashboard/asked.js +1 -1
  234. package/dist/dashboard/dice/burn.js +1 -1
  235. package/dist/dashboard/dice/stage.js +1 -1
  236. package/dist/dashboard/{guide-blocks.js → help/blocks.js} +1 -1
  237. package/dist/dashboard/{help.js → help/help.js} +6 -6
  238. package/dist/dashboard/journal.js +1 -1
  239. package/dist/dashboard/kit.js +6 -5
  240. package/dist/dashboard/labels.js +7 -3
  241. package/dist/dashboard/markdown.js +1 -1
  242. package/dist/dashboard/{ask-card.js → packages/ask-card.js} +6 -6
  243. package/dist/dashboard/{package-page.js → packages/package-page.js} +3 -3
  244. package/dist/dashboard/{packages.js → packages/packages.js} +12 -12
  245. package/dist/dashboard/{page-code.js → packages/page-code.js} +4 -4
  246. package/dist/dashboard/{extension-widgets.js → packages/widgets.js} +5 -5
  247. package/dist/dashboard/party.js +1 -1
  248. package/dist/dashboard/person-panel.js +2 -13
  249. package/dist/dashboard/{map-sheet.js → place/map-sheet.js} +4 -4
  250. package/dist/dashboard/{place-map-view.js → place/map-view.js} +11 -11
  251. package/dist/dashboard/scene.js +4 -4
  252. package/dist/dashboard/settings.js +1 -1
  253. package/dist/dashboard/sheet.js +3 -3
  254. package/dist/dashboard/top.js +2 -2
  255. package/dist/dashboard/turns.js +2 -2
  256. package/dist/dashboard/widgets.js +1 -1
  257. package/dist/dashboard/{world-calendar.js → world/calendar.js} +7 -7
  258. package/dist/dashboard/{lore.js → world/known.js} +1 -1
  259. package/dist/dashboard/{world-lore.js → world/lore.js} +9 -9
  260. package/dist/dashboard/{world-map.js → world/map.js} +1 -1
  261. package/dist/dashboard/{world.js → world/world.js} +14 -14
  262. package/dist/dice/evaluate.js +1 -1
  263. package/dist/dice/index.d.ts +2 -2
  264. package/dist/dice/index.js +2 -2
  265. package/dist/dice/notation.d.ts +2 -0
  266. package/dist/dice/notation.js +22 -4
  267. package/dist/documents/markup.js +2 -2
  268. package/dist/documents/read.js +29 -13
  269. package/dist/effects/effect.js +2 -5
  270. package/dist/extensions/extension.js +6 -8
  271. package/dist/extensions/index.d.ts +1 -4
  272. package/dist/extensions/index.js +1 -4
  273. package/dist/extensions/words.js +2 -1
  274. package/dist/{pictures → helpers}/briefs.js +17 -14
  275. package/dist/{pictures → helpers}/claude.js +8 -18
  276. package/dist/{pictures → helpers}/codex.js +3 -15
  277. package/dist/helpers/index.d.ts +7 -0
  278. package/dist/helpers/index.js +9 -0
  279. package/dist/{pictures/helpers.d.ts → helpers/programs.d.ts} +6 -1
  280. package/dist/{pictures/helpers.js → helpers/programs.js} +16 -2
  281. package/dist/images/images.js +7 -5
  282. package/dist/images/index.d.ts +1 -1
  283. package/dist/images/index.js +1 -1
  284. package/dist/importer/index.d.ts +1 -1
  285. package/dist/importer/index.js +1 -1
  286. package/dist/importer/work.d.ts +0 -2
  287. package/dist/importer/work.js +9 -30
  288. package/dist/instructions/index.d.ts +2 -0
  289. package/dist/instructions/index.js +10 -0
  290. package/dist/languages/index.d.ts +1 -1
  291. package/dist/languages/index.js +1 -1
  292. package/dist/languages/language-pack.js +15 -3
  293. package/dist/library/books.js +29 -83
  294. package/dist/{extensions → packages}/engine.d.ts +1 -1
  295. package/dist/{extensions → packages}/engine.js +1 -1
  296. package/dist/packages/index.d.ts +3 -0
  297. package/dist/packages/index.js +4 -0
  298. package/dist/{extensions/packages.d.ts → packages/npm.d.ts} +2 -0
  299. package/dist/{extensions/packages.js → packages/npm.js} +74 -45
  300. package/dist/page.d.ts +9 -11
  301. package/dist/page.js +1 -2
  302. package/dist/pages/check.js +31 -40
  303. package/dist/pages/containers.js +20 -20
  304. package/dist/pages/environment.js +15 -15
  305. package/dist/pages/index.d.ts +9 -9
  306. package/dist/pages/index.js +9 -9
  307. package/dist/pages/inheritance.d.ts +2 -1
  308. package/dist/pages/inheritance.js +24 -24
  309. package/dist/pages/load.js +7 -7
  310. package/dist/pages/maps.d.ts +20 -0
  311. package/dist/pages/maps.js +51 -1
  312. package/dist/pages/markdown.d.ts +2 -0
  313. package/dist/pages/markdown.js +110 -79
  314. package/dist/pages/page-file.d.ts +2 -1
  315. package/dist/pages/page-file.js +31 -29
  316. package/dist/pages/rename-page.d.ts +4 -1
  317. package/dist/pages/rename-page.js +7 -3
  318. package/dist/pages/{stack-entry.d.ts → stacks/entry.d.ts} +0 -2
  319. package/dist/pages/{stack-entry.js → stacks/entry.js} +2 -6
  320. package/dist/pages/{stacks.d.ts → stacks/kinds.d.ts} +8 -1
  321. package/dist/pages/{stacks.js → stacks/kinds.js} +36 -41
  322. package/dist/pages/{stack-writes.d.ts → stacks/writes.d.ts} +2 -2
  323. package/dist/pages/{stack-writes.js → stacks/writes.js} +32 -32
  324. package/dist/pages/system-pages.js +15 -15
  325. package/dist/pages/world.js +25 -19
  326. package/dist/pages/write-page.js +35 -34
  327. package/dist/player-notes/index.d.ts +1 -1
  328. package/dist/player-notes/index.js +1 -1
  329. package/dist/rules/page-search.js +3 -4
  330. package/dist/rules/rule-book.js +1 -1
  331. package/dist/rules/search.js +21 -21
  332. package/dist/rules/shown.js +1 -3
  333. package/dist/saves/saves.d.ts +2 -2
  334. package/dist/saves/saves.js +15 -3
  335. package/dist/{bell-listener.js → server/bell-listener.js} +3 -3
  336. package/dist/server/dashboard/files.d.ts +59 -0
  337. package/dist/server/dashboard/files.js +326 -0
  338. package/dist/server/dashboard/index.d.ts +114 -0
  339. package/dist/server/dashboard/index.js +419 -0
  340. package/dist/server/dashboard/news.d.ts +39 -0
  341. package/dist/server/dashboard/news.js +390 -0
  342. package/dist/server/dashboard/player.d.ts +48 -0
  343. package/dist/server/dashboard/player.js +242 -0
  344. package/dist/server/dashboard/ports.d.ts +10 -0
  345. package/dist/server/dashboard/ports.js +15 -0
  346. package/dist/server/dashboard/writes.d.ts +58 -0
  347. package/dist/server/dashboard/writes.js +492 -0
  348. package/dist/{mcp-server.d.ts → server/mcp.d.ts} +2 -2
  349. package/dist/{mcp-server.js → server/mcp.js} +57 -42
  350. package/dist/systems/game-system.d.ts +5 -3
  351. package/dist/systems/game-system.js +178 -149
  352. package/dist/systems/index.d.ts +1 -1
  353. package/dist/systems/index.js +1 -1
  354. package/dist/{testing.d.ts → testing/index.d.ts} +6 -6
  355. package/dist/{testing.js → testing/index.js} +32 -18
  356. package/dist/{system-checks.js → testing/system-checks.js} +18 -12
  357. package/dist/themes/theme.d.ts +3 -3
  358. package/dist/themes/theme.js +14 -14
  359. package/dist/time/calendar.js +5 -2
  360. package/dist/triggers/trigger.js +5 -8
  361. package/instructions/dashboard-guide.md +2 -1
  362. package/instructions/play.md +1 -1
  363. package/package.json +5 -5
  364. package/dist/commands/game-maps.d.ts +0 -20
  365. package/dist/commands/game-maps.js +0 -51
  366. package/dist/dashboard-server.d.ts +0 -47
  367. package/dist/dashboard-server.js +0 -1830
  368. package/dist/pictures/index.d.ts +0 -7
  369. package/dist/pictures/index.js +0 -9
  370. /package/dist/{cli.d.ts → cli/cli.d.ts} +0 -0
  371. /package/dist/{library-reader.d.ts → commands/shared/library-reader.d.ts} +0 -0
  372. /package/dist/commands/{notes.d.ts → shared/notes.d.ts} +0 -0
  373. /package/dist/commands/{notes.js → shared/notes.js} +0 -0
  374. /package/dist/dashboard/{guide-markdown.js → help/markdown.js} +0 -0
  375. /package/dist/dashboard/{pack-card.js → packages/card.js} +0 -0
  376. /package/dist/dashboard/{people.js → packages/people.js} +0 -0
  377. /package/dist/dashboard/{place-map.js → place/map.js} +0 -0
  378. /package/dist/dashboard/{calendar.js → world/days.js} +0 -0
  379. /package/dist/{pictures → helpers}/briefs.d.ts +0 -0
  380. /package/dist/{pictures → helpers}/chosen.d.ts +0 -0
  381. /package/dist/{pictures → helpers}/chosen.js +0 -0
  382. /package/dist/{pictures → helpers}/claude.d.ts +0 -0
  383. /package/dist/{pictures → helpers}/codex.d.ts +0 -0
  384. /package/dist/{pictures → helpers}/stop.d.ts +0 -0
  385. /package/dist/{pictures → helpers}/stop.js +0 -0
  386. /package/dist/{pictures → helpers}/svg.d.ts +0 -0
  387. /package/dist/{pictures → helpers}/svg.js +0 -0
  388. /package/dist/{extensions → packages}/tarball.d.ts +0 -0
  389. /package/dist/{extensions → packages}/tarball.js +0 -0
  390. /package/dist/{bell-listener.d.ts → server/bell-listener.d.ts} +0 -0
  391. /package/dist/{player-acts.d.ts → server/player-acts.d.ts} +0 -0
  392. /package/dist/{player-acts.js → server/player-acts.js} +0 -0
  393. /package/dist/{system-checks.d.ts → testing/system-checks.d.ts} +0 -0
@@ -1,14 +1,15 @@
1
+ // The campaign's world and game system as the commands read them: the system with the layers over it, the settings it plays with, and the world built from both.
1
2
  import { join, resolve } from "node:path";
2
- import { campaignFileName, readCampaignData, readOneSetting, readTextSetting } from "../campaign/index.js";
3
- import { ourSystems } from "../core/package-declarations.js";
4
- import { files, isInside } from "../core/store.js";
5
- import { comparableText } from "../core/text.js";
6
- import { extensionWords } from "../extensions/index.js";
7
- import { languagePackFor, packSystemFolder } from "../languages/index.js";
8
- import { homeSystemWords } from "../page-words.js";
9
- import { loadWorld, playerCharacters, searchSystemPages, worldFolderName } from "../pages/index.js";
10
- import { engineSettingValue, findCampaignSystem, findSystem, installedSystems, layeredSystemWords, rulesetSetting, systemContentFolders, systemWords, withSettings, } from "../systems/index.js";
11
- import { campaignExtensions, extensionSources, layeredParts } from "./game-extension-list.js";
3
+ import { campaignFileName, readCampaignData, readOneSetting, readTextSetting } from "../../campaign/index.js";
4
+ import { ourSystems } from "../../core/package-declarations.js";
5
+ import { files, isInside } from "../../core/store.js";
6
+ import { comparableText } from "../../core/text.js";
7
+ import { extensionWords } from "../../extensions/index.js";
8
+ import { languagePackFor, packSystemFolder } from "../../languages/index.js";
9
+ import { loadWorld, playerCharacters, searchSystemPages, worldFolderName } from "../../pages/index.js";
10
+ import { engineSettingValue, findCampaignSystem, findSystem, layeredSystemWords, readableSystems, rulesetSetting, systemContentFolders, systemWords, withSettings, } from "../../systems/index.js";
11
+ import { campaignExtensions, extensionSources, layeredParts } from "./packages/extensions.js";
12
+ import { homeSystemWords } from "./page-words.js";
12
13
  /** The world of the campaign in `root`, with the pages of its game system when campaign.yaml names one that is installed (SYS-1, SYS-3). */
13
14
  export function campaignWorld(root, context) {
14
15
  // The same world until one of its pages or campaign.yaml changes: in a session, across calls (D-137). A game system does not change while the server runs.
@@ -28,11 +29,6 @@ export function campaignWorld(root, context) {
28
29
  });
29
30
  });
30
31
  }
31
- /** The rigor as the game plays it (DAT-16): with the values of the system's settings as campaign.yaml writes them, as the world reads before its players. */
32
- function rigorPlayed(root, system) {
33
- const value = engineSettingValue(system, (setting) => systemSettingValue(root, setting), "rigor", readTextSetting(root, "rigor"));
34
- return typeof value === "string" ? value : undefined;
35
- }
36
32
  /**
37
33
  * The game system's words in the campaign's language (D-403): its own, else those translated on the fly on this computer (D-406); with the names of the
38
34
  * fields the campaign's extensions add, from their words, layered as their additions are (CAM-2, D-505).
@@ -71,43 +67,11 @@ export function campaignSystemWords(root, context) {
71
67
  export function campaignSystem(root, context) {
72
68
  return systemOf(root, context).system;
73
69
  }
74
- /**
75
- * The game system campaign.yaml names, with what its extensions and then the campaign add to it (CAM-2), and the layers left out with why (CAM-3), as its
76
- * settings have it (DAT-10), read once until campaign.yaml changes: a call asks for it many times.
77
- */
78
- function systemOf(root, context) {
79
- // campaign.yaml, and the extensions' packages, whose parts and additions it gives.
80
- return files().remember(`system ${resolve(root)}`, extensionSources(root, context), () => {
81
- const name = readTextSetting(root, "system");
82
- const found = name === undefined ? { refused: [] } : findCampaignSystem(context.systemFolders, name, systemLayers(root, context, readCampaignData(root)), readTextSetting(root, rulesetSetting));
83
- // And the parts of the instructions of its extensions over its own (D-121).
84
- const played = found.system === undefined ? undefined : withSettings(found.system, (setting) => readTextSetting(root, setting));
85
- return played === undefined ? found : { ...found, system: { ...played, parts: layeredParts(played.parts, campaignExtensions(root, context).extensions) } };
86
- });
87
- }
88
70
  /** What the campaign's extensions add to its game system, in the order campaign.yaml lists them, then the campaign's own additions, which win (CAM-2). */
89
71
  export function systemLayers(root, context, campaign) {
90
72
  const extensions = campaignExtensions(root, context).extensions.map((extension) => ({ from: extensionLayer(extension.name), data: extension.adds }));
91
73
  return [...extensions, { from: campaignFileName, data: campaign }];
92
74
  }
93
- /** The layers over the campaign's system that it plays with, in order, and by name those left out because the system would not read with them (CAM-3). */
94
- export function playedLayers(root, context) {
95
- const refused = systemOf(root, context).refused.map((layer) => layer.from);
96
- return { kept: systemLayers(root, context, readCampaignData(root)).filter((layer) => !refused.includes(layer.from)), refused };
97
- }
98
- /** The name of an extension's layer of additions, as messages give it. */
99
- export function extensionLayer(name) {
100
- return `the extension ${name}`;
101
- }
102
- /** The names an extension's words give the fields it adds; none when its words do not read, which validate names. */
103
- function extensionFieldWords(extension, language) {
104
- try {
105
- return extensionWords(extension.folder, language)?.fields ?? {};
106
- }
107
- catch {
108
- return {};
109
- }
110
- }
111
75
  /** A setting the campaign's game system adds to the setup (DAT-10), by its name in any case; undefined when the system has none by that name. */
112
76
  export function systemSetting(root, context, name) {
113
77
  return campaignSystem(root, context)?.settings.find((setting) => comparableText(setting.name) === comparableText(name.trim()));
@@ -124,11 +88,6 @@ export function playedSettingValue(root, context, setting) {
124
88
  export function playersOfTheGame(root, context) {
125
89
  return playerCharacters(campaignWorld(root, context)).map((page) => page.name);
126
90
  }
127
- /** The value campaign.yaml gives a setting of the system, when it is one the system has (DAT-10). */
128
- export function systemSettingValue(root, setting) {
129
- const written = readTextSetting(root, setting.name);
130
- return setting.values.find((value) => written !== undefined && comparableText(value.value) === comparableText(written))?.value;
131
- }
132
91
  /** "xp is not kept with advancement milestones": said when a field the campaign's settings leave out is written or changed (DAT-10); undefined for any other. */
133
92
  export function leftOutNote(root, context, field) {
134
93
  const setting = (campaignSystem(root, context)?.settings ?? []).find((candidate) => {
@@ -148,15 +107,6 @@ export function systemSettingProblems(root, context) {
148
107
  }];
149
108
  });
150
109
  }
151
- /** A setting as campaign.yaml writes it, of any kind; undefined when the file does not read, which validate reports on its own. */
152
- function rawSetting(root, name) {
153
- try {
154
- return readOneSetting(root, name);
155
- }
156
- catch {
157
- return undefined;
158
- }
159
- }
160
110
  /** "xp or milestones": the values of a setting of the system. */
161
111
  export function valuesText(setting) {
162
112
  const values = setting.values.map((value) => value.value);
@@ -194,20 +144,11 @@ export function systemProblems(root, context) {
194
144
  fix: missingSystemFix(name, context),
195
145
  }];
196
146
  }
197
- /** How a campaign gets the system it names that is not installed: one of ours with package install (D-513), else another of those installed, asked of the player. */
198
- function missingSystemFix(name, context) {
199
- const ours = ourSystems.find((one) => comparableText(one.name) === comparableText(name.trim()));
200
- if (ours !== undefined) {
201
- return `install it, one of RPG Engine's own, with package install ${ours.name}; until then, play on without its pages`;
202
- }
203
- const [first] = installedSystems(context.systemFolders);
204
- return first === undefined ? "install the game system" : `ask the player which game you play, then config, setting system, value ${first.name}`;
205
- }
206
147
  /** The name of an installed game system, as it is installed; refused, with those that are, when none has it (D-167). */
207
148
  export function installedSystemName(name, context, how) {
208
149
  const system = findSystem(context.systemFolders, name);
209
150
  if (system === undefined) {
210
- const [first] = installedSystems(context.systemFolders);
151
+ const [first] = readableSystems(context.systemFolders);
211
152
  const ours = ourSystems.find((one) => comparableText(one.name) === comparableText(name.trim()));
212
153
  // One of ours is installed first, once the player wants it (D-513 (1)).
213
154
  const example = ours !== undefined
@@ -219,11 +160,6 @@ export function installedSystemName(name, context, how) {
219
160
  }
220
161
  return system.name;
221
162
  }
222
- /** "Installed: 5e (the fifth edition, from the SRD 5.1)." */
223
- function installedText(context) {
224
- const systems = installedSystems(context.systemFolders);
225
- return systems.length === 0 ? "No system is installed." : `Installed: ${systems.map((system) => `${system.name} (${system.title})`).join(", ")}.`;
226
- }
227
163
  /** " The campaign's system, Quinta edizione, is not installed, so none of its pages can be found: validate says how to fix it.": for a name not found (SYS-1). Empty otherwise. */
228
164
  export function missingSystemHint(world) {
229
165
  if (world.noSystem === true) {
@@ -311,3 +247,63 @@ export function countedByGame(system) {
311
247
  const burning = Object.keys(system?.burning ?? {})[0];
312
248
  return { upkeep: system?.upkeep !== undefined, ...(burning === undefined ? {} : { burning }) };
313
249
  }
250
+ /** The rigor as the game plays it (DAT-16): with the values of the system's settings as campaign.yaml writes them, as the world reads before its players. */
251
+ function rigorPlayed(root, system) {
252
+ const value = engineSettingValue(system, (setting) => systemSettingValue(root, setting), "rigor", readTextSetting(root, "rigor"));
253
+ return typeof value === "string" ? value : undefined;
254
+ }
255
+ /**
256
+ * The game system campaign.yaml names, with what its extensions and then the campaign add to it (CAM-2), and the layers left out with why (CAM-3), as its
257
+ * settings have it (DAT-10), read once until campaign.yaml changes: a call asks for it many times.
258
+ */
259
+ function systemOf(root, context) {
260
+ // campaign.yaml, and the extensions' packages, whose parts and additions it gives.
261
+ return files().remember(`system ${resolve(root)}`, extensionSources(root, context), () => {
262
+ const name = readTextSetting(root, "system");
263
+ const found = name === undefined ? { refused: [] } : findCampaignSystem(context.systemFolders, name, systemLayers(root, context, readCampaignData(root)), readTextSetting(root, rulesetSetting));
264
+ // And the parts of the instructions of its extensions over its own (D-121).
265
+ const played = found.system === undefined ? undefined : withSettings(found.system, (setting) => readTextSetting(root, setting));
266
+ return played === undefined ? found : { ...found, system: { ...played, parts: layeredParts(played.parts, campaignExtensions(root, context).extensions) } };
267
+ });
268
+ }
269
+ /** The name of an extension's layer of additions, as messages give it. */
270
+ function extensionLayer(name) {
271
+ return `the extension ${name}`;
272
+ }
273
+ /** The names an extension's words give the fields it adds; none when its words do not read, which validate names. */
274
+ function extensionFieldWords(extension, language) {
275
+ try {
276
+ return extensionWords(extension.folder, language)?.fields ?? {};
277
+ }
278
+ catch {
279
+ return {};
280
+ }
281
+ }
282
+ /** The value campaign.yaml gives a setting of the system, when it is one the system has (DAT-10). */
283
+ function systemSettingValue(root, setting) {
284
+ const written = readTextSetting(root, setting.name);
285
+ return setting.values.find((value) => written !== undefined && comparableText(value.value) === comparableText(written))?.value;
286
+ }
287
+ /** A setting as campaign.yaml writes it, of any kind; undefined when the file does not read, which validate reports on its own. */
288
+ function rawSetting(root, name) {
289
+ try {
290
+ return readOneSetting(root, name);
291
+ }
292
+ catch {
293
+ return undefined;
294
+ }
295
+ }
296
+ /** How a campaign gets the system it names that is not installed: one of ours with package install (D-513), else another of those installed, asked of the player. */
297
+ function missingSystemFix(name, context) {
298
+ const ours = ourSystems.find((one) => comparableText(one.name) === comparableText(name.trim()));
299
+ if (ours !== undefined) {
300
+ return `install it, one of RPG Engine's own, with package install ${ours.name}; until then, play on without its pages`;
301
+ }
302
+ const [first] = readableSystems(context.systemFolders);
303
+ return first === undefined ? "install the game system" : `ask the player which game you play, then config, setting system, value ${first.name}`;
304
+ }
305
+ /** "Installed: 5e (the fifth edition, from the SRD 5.1)." */
306
+ function installedText(context) {
307
+ const systems = readableSystems(context.systemFolders);
308
+ return systems.length === 0 ? "No system is installed." : `Installed: ${systems.map((system) => `${system.name} (${system.title})`).join(", ")}.`;
309
+ }
@@ -69,7 +69,7 @@ export declare const show: import("../core/registry.ts").Command<z.ZodObject<{
69
69
  knows?: undefined;
70
70
  } | {
71
71
  page: string;
72
- type: "place" | "quest" | "creature" | "character" | "faction" | "item" | "event" | "topic" | undefined;
72
+ type: "place" | "quest" | "creature" | "item" | "character" | "faction" | "event" | "topic" | undefined;
73
73
  path: string;
74
74
  system: string | undefined;
75
75
  hides: string | undefined;
@@ -2,18 +2,18 @@ import { z } from "zod";
2
2
  import { requireCampaign } from "../campaign/index.js";
3
3
  import { defineCommand } from "../core/registry.js";
4
4
  import { comparableText, sameName, valueNamed, withArticle } from "../core/text.js";
5
- import { backlinks, baseChain, findPage, formatFields, inheritedByBase, inheritedFields, isPartyMember, locate, namesakes, pageNamed, pagesWithName, parsePageReference, readSection, secretNames, sectionTitles, systemLabel, systemPageNamed, textParts, } from "../pages/index.js";
5
+ import { backlinks, baseChain, findPage, formatFields, inheritedByBase, inheritedFields, isPartyMember, locate, namesakes, pageNamed, parsePageReference, playerCharacters, readSection, secretNames, sectionTitles, systemLabel, systemPageNamed, textParts, } from "../pages/index.js";
6
6
  import { featureParts } from "../progression/index.js";
7
- import { effectiveFields, effectsOf } from "./effect-layer.js";
8
- import { surroundings, surroundingsText } from "./game-environment.js";
9
- import { holdsItems, isFallen, lootAdvice } from "./game-loot.js";
10
- import { closedScenes, copyLink, copyPage, openSceneLog, readOpenScene } from "./game-scene.js";
11
- import { campaignSystem, campaignWorld, missingSystemHint } from "./game-world.js";
12
- import { skippedPagesNote } from "./notes.js";
13
- import { firstInChat } from "./parts.js";
14
- import { featureSource, progressionOf } from "./progression.js";
15
- import { sheetFieldNames, sheetGroup, sheetGroupNames, sheetLines } from "./sheet.js";
16
- import { signedText, workedFields, workedLine, workedParts } from "./worked-out.js";
7
+ import { effectiveFields, effectsOf } from "./shared/effect-layer.js";
8
+ import { surroundings, surroundingsText } from "./shared/environment.js";
9
+ import { holdsItems, isFallen, lootAdvice } from "./shared/loot.js";
10
+ import { skippedPagesNote } from "./shared/notes.js";
11
+ import { firstInChat } from "./shared/parts.js";
12
+ import { featureSource, progressionOf } from "./shared/progression.js";
13
+ import { closedScenes, copyLink, copyPage, lastClosedCopies, openSceneLog, readOpenScene, scenePlace } from "./shared/scene.js";
14
+ import { sheetFieldNames, sheetGroup, sheetGroupNames, sheetLines } from "./shared/sheet.js";
15
+ import { signedText, workedFields, workedLine, workedParts } from "./shared/worked-out.js";
16
+ import { campaignSystem, campaignWorld, missingSystemHint } from "./shared/world.js";
17
17
  // A list longer than this shows its first items only (D-468).
18
18
  const listedItems = 8;
19
19
  export const show = defineCommand({
@@ -86,7 +86,7 @@ export const show = defineCommand({
86
86
  alsoCopy: !isCopy && copy !== undefined,
87
87
  isIn: chain.map((holder) => holder.name),
88
88
  alsoIn: alsoIn.map((holder) => holder.name),
89
- around: page.type === "place" || page.type === "character" || isCopy ? surroundingsText(surroundings(world, isCopy ? scenePlace(world, scene.place) : page)) : "",
89
+ around: page.type === "place" || page.type === "character" || isCopy ? surroundingsText(surroundings(world, isCopy ? scenePlace(world, scene) : page)) : "",
90
90
  sheet,
91
91
  featureHint: sheet.length === 0 || group !== undefined ? undefined : featureHint(world, page),
92
92
  onSheet: sheetFieldNames(world, system, page),
@@ -110,7 +110,7 @@ export const show = defineCommand({
110
110
  text: group === undefined ? (part?.text ?? page.body) : "",
111
111
  linkedFrom: isCopy ? [] : backlinks(world, page).map((link) => ({ page: link.page.name, places: link.places })),
112
112
  problems: world.problems,
113
- loot: reference.section === undefined ? lootNote(world, system, page, chain) : undefined,
113
+ loot: reference.section === undefined ? (lootNote(world, system, page, chain) ?? fallenCopiesNote(root, world, system, page)) : undefined,
114
114
  // What the character knows is view's, once in a chat (D-530): show holds what they have not found out.
115
115
  knows: firstInChat(context, "show-knows") ? knowsNote : undefined,
116
116
  };
@@ -181,6 +181,25 @@ function lootNote(world, system, page, chain) {
181
181
  }
182
182
  return isFallen(world, system, page) || holdsItems(world, page) ? `What is on or in ${page.name} is there to be found: ${lootAdvice}` : undefined;
183
183
  }
184
+ /**
185
+ * The copies of a creature that fell in the last scene closed, gone with it, so that its page, which the master reads for what they carried, says so (D-530):
186
+ * while a player character is where that scene was, not in a fight elsewhere with another of its kind (Elena's loot3).
187
+ */
188
+ function fallenCopiesNote(root, world, system, page) {
189
+ const last = lastClosedCopies(root);
190
+ if (page.type !== "creature" || !isThere(world, last.place)) {
191
+ return undefined;
192
+ }
193
+ const fallen = Object.entries(last.copies)
194
+ .filter(([name, copy]) => sameName([parsePageReference(copy.creature).name], page.name) !== undefined && isFallen(world, system, copyPage(name, copy)))
195
+ .map(([name]) => name);
196
+ return fallen.length === 0 ? undefined : `Fallen in the last scene, copies of ${page.name} that ended with it: ${fallen.join(", ")}. What they carried, as this page says, lies where they fell: ${lootAdvice}`;
197
+ }
198
+ /** Whether a player character is in the place named, or the place is not known: a scene in no place, or player characters in none. */
199
+ function isThere(world, place) {
200
+ const placesOfPlayers = playerCharacters(world).map((pc) => [pc, ...locate(world, pc).chain].find((holder) => holder.type === "place")).filter((found) => found !== undefined);
201
+ return place === undefined || placesOfPlayers.length === 0 || placesOfPlayers.some((found) => sameName([found.name], place) !== undefined);
202
+ }
184
203
  /** The fields with a list longer than `listedItems` cut to its first ones and how to see them all, as knows of a well-travelled character (D-468). */
185
204
  function cutLists(fields, page) {
186
205
  return Object.fromEntries(Object.entries(fields).map(([field, value]) => [
@@ -197,10 +216,6 @@ function repeatsRead(world, worked) {
197
216
  function nameWithSystem(page) {
198
217
  return page.system === undefined ? page.name : `${page.name} (${page.system})`;
199
218
  }
200
- /** The place of the open scene, where its copies are (ENV-2); undefined when it has none, or none that exists. */
201
- function scenePlace(world, place) {
202
- return place === undefined ? undefined : pagesWithName(world, parsePageReference(place).name)[0];
203
- }
204
219
  /** "ac 15 (13 without)": the values the page's effects give, each with the one it reads without them (EFF-10). */
205
220
  function coveredValues(world, page) {
206
221
  const without = inheritedFields(world, page);
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { type SheetSummary } from "./sheet.ts";
2
+ import { type SheetSummary } from "./shared/sheet.ts";
3
3
  /** A member of the player's party as the status shows them. */
4
4
  interface Member {
5
5
  name: string;
@@ -6,32 +6,32 @@ import { isInParty, isPartyMember, isPlayerCharacter, locate, pagesWithName, par
6
6
  import { bookTitles, readRuleBook } from "../rules/index.js";
7
7
  import { sceneTypes } from "../scene/index.js";
8
8
  import { rulesetSetting } from "../systems/index.js";
9
- import { effectiveFields, effectsOf } from "./effect-layer.js";
10
- import { installableSystems } from "./game-catalog.js";
11
- import { allStateChecks, markStateChecksTold } from "./game-checks.js";
12
- import { effectShown, keptEffects } from "./game-effects.js";
13
- import { surroundings, surroundingsText } from "./game-environment.js";
14
- import { clocksToMove, dueAdvice, dueText, isDated, isDue, plannedEvents, plannedText, worldFacts } from "./game-events.js";
15
- import { experienceOf, levelDueNote } from "./game-experience.js";
16
- import { extensionsLine } from "./game-extension-list.js";
17
- import { picturesNote } from "./game-images.js";
18
- import { journeyText, readJourney } from "./game-journey.js";
19
- import { campaignMode, campaignNote } from "./game-mode.js";
20
- import { campaignCoins } from "./game-money.js";
21
- import { livingMood, masterMood } from "./game-moods.js";
22
- import { heldSystemSettings, isFixedSetting, playedEngineSetting } from "./game-offers.js";
23
- import { packageCodeProblems } from "./game-package-code.js";
24
- import { adventureUnderWay, isTickedOpenQuest, openQuestText } from "./game-quests.js";
25
- import { measuresOf, roadsOf } from "./game-roads.js";
26
- import { interruptedLoad } from "./game-saves.js";
27
- import { closedScenes, copyCounters, copyPage, partyAwayText, readOpenScene } from "./game-scene.js";
28
- import { datedText, problemText, readPresent } from "./game-time.js";
29
- import { campaignSystem, campaignWorld, countedByGame, playedSettingValue, systemInStatus } from "./game-world.js";
30
- import { importLine } from "./import.js";
31
- import { countersText, pageCounters, partyCounters } from "./page-counters.js";
32
- import { adventurePart, firstInChat, situationPart } from "./parts.js";
33
- import { campaignProblems } from "./problems.js";
34
- import { missingSheetFields, overLoad, sheetSummary } from "./sheet.js";
9
+ import { importLine } from "./import/import.js";
10
+ import { allStateChecks, markStateChecksTold } from "./shared/checks.js";
11
+ import { effectiveFields, effectsOf } from "./shared/effect-layer.js";
12
+ import { effectShown, keptEffects } from "./shared/effects.js";
13
+ import { surroundings, surroundingsText } from "./shared/environment.js";
14
+ import { clocksToMove, dueAdvice, dueText, isDated, isDue, plannedEvents, plannedText, worldFacts } from "./shared/events.js";
15
+ import { experienceOf, levelDueNote } from "./shared/experience.js";
16
+ import { picturesNote } from "./shared/images.js";
17
+ import { journeyText, readJourney } from "./shared/journey.js";
18
+ import { campaignMode, campaignNote } from "./shared/mode.js";
19
+ import { campaignCoins } from "./shared/money.js";
20
+ import { livingMood, masterMood } from "./shared/moods.js";
21
+ import { heldSystemSettings, isFixedSetting, playedEngineSetting } from "./shared/offers.js";
22
+ import { installableSystems } from "./shared/packages/catalog.js";
23
+ import { packageCodeProblems } from "./shared/packages/code.js";
24
+ import { extensionsLine } from "./shared/packages/extensions.js";
25
+ import { countersText, pageCounters, partyCounters } from "./shared/page-counters.js";
26
+ import { adventurePart, firstInChat, situationPart } from "./shared/parts.js";
27
+ import { campaignProblems } from "./shared/problems.js";
28
+ import { adventureUnderWay, isTickedOpenQuest, openQuestText } from "./shared/quests.js";
29
+ import { measuresOf, roadsOf } from "./shared/roads.js";
30
+ import { interruptedLoad } from "./shared/saves.js";
31
+ import { closedScenes, copyCounters, copyPage, partyAwayText, readOpenScene } from "./shared/scene.js";
32
+ import { missingSheetFields, overLoad, sheetSummary } from "./shared/sheet.js";
33
+ import { datedText, problemText, readPresent } from "./shared/time.js";
34
+ import { campaignSystem, campaignWorld, countedByGame, playedSettingValue, systemInStatus } from "./shared/world.js";
35
35
  import { translationOffer } from "./translate.js";
36
36
  // Lists in the status show this many names, then say how many more there are and how to find them.
37
37
  const shownNames = 3;
@@ -48,7 +48,7 @@ export const status = defineCommand({
48
48
  input: z.object({}),
49
49
  async run(input, context) {
50
50
  const root = requireCampaign(context.folder);
51
- const codeProblems = await packageCodeProblems(root, context, []);
51
+ const codeProblems = await packageCodeProblems(root, context);
52
52
  const settings = readSettings(root);
53
53
  // An engine's setting as the game plays it, none where it plays one value alone, which is no choice to show (DAT-16).
54
54
  const played = (name) => {
@@ -221,7 +221,7 @@ export const status = defineCommand({
221
221
  result.mood === "neutral" ? "" : `Your mood is ${result.mood}: let your voice follow it.`,
222
222
  ...result.incompleteSheets,
223
223
  ...result.levelsDue,
224
- namesLine("Also there", result.alsoThere, `show ${result.place}`),
224
+ namesLine("Also there", result.alsoThere, result.place === undefined ? "find" : `show ${result.place}`),
225
225
  result.scene === undefined ? "" : `Scene: ${result.scene}`,
226
226
  result.journey === undefined ? "" : `Journey: ${result.journey}`,
227
227
  result.lastScenes.length === 0 ? "" : `Last scenes: ${result.lastScenes.join(" · ")}`,
@@ -3,9 +3,9 @@ import { requireCampaign } from "../campaign/index.js";
3
3
  import { appendLogEntry } from "../core/log.js";
4
4
  import { defineCommand } from "../core/registry.js";
5
5
  import { isInParty, pageNamed } from "../pages/index.js";
6
- import { thoughtsLength, thoughtsType } from "./game-thoughts.js";
7
- import { newDatedLogEntry } from "./game-time.js";
8
- import { campaignWorld } from "./game-world.js";
6
+ import { thoughtsLength, thoughtsType } from "./shared/thoughts.js";
7
+ import { newDatedLogEntry } from "./shared/time.js";
8
+ import { campaignWorld } from "./shared/world.js";
9
9
  export const thoughts = defineCommand({
10
10
  name: "thoughts",
11
11
  description: "Write a few lines in a companion's diary, when an output says it is due or after a moment that changed them, in their voice: "
@@ -5,16 +5,15 @@ import { defineCommand } from "../core/registry.js";
5
5
  import { comparableText } from "../core/text.js";
6
6
  import { addCoins, changeFrom, formatAmount, isSafePurse, payCoins, readAmount, takeCoins, totalOf } from "../money/index.js";
7
7
  import { applyMove, canHold, concernsPlayer, countedText, declaredKind, inheritedFields, isPartyMember, kindNamed, locate, MoveStopped, ownField, pageNamed, parsePageReference, readEntry, stackName, } from "../pages/index.js";
8
- import { coinExamples } from "./game-examples.js";
9
- import { campaignCoins } from "./game-money.js";
10
- import { afterMoves, pagesPlan } from "./game-moves.js";
11
- import { copyName, readOpenScene } from "./game-scene.js";
12
- import { heldStack, logStackSteps, stackEdits, stackMoveSteps, stackStepText, unequipKinds } from "./game-stacks.js";
13
- import { newDatedLogEntry } from "./game-time.js";
14
- import { campaignWorld, missingSystemHint } from "./game-world.js";
15
- import { skippedPagesNote } from "./notes.js";
16
- // A list, or one text, as an MCP client may send it.
17
- const textList = z.union([z.string(), z.array(z.string())]);
8
+ import { coinExamples } from "./shared/examples.js";
9
+ import { textList } from "./shared/inputs.js";
10
+ import { campaignCoins } from "./shared/money.js";
11
+ import { afterMoves, pagesPlan } from "./shared/moves.js";
12
+ import { skippedPagesNote } from "./shared/notes.js";
13
+ import { copyName, readOpenScene } from "./shared/scene.js";
14
+ import { heldStack, logStackSteps, stackEdits, stackMoveSteps, stackStepText, unequipKinds } from "./shared/stacks.js";
15
+ import { newDatedLogEntry } from "./shared/time.js";
16
+ import { campaignWorld, missingSystemHint } from "./shared/world.js";
18
17
  export const trade = defineCommand({
19
18
  name: "trade",
20
19
  description: "Buy, sell or barter in one go: what page gives and what it gets, items and money both ways, with the change in coins. "
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import type { Context } from "../core/context.ts";
3
- import { type ChatBatch } from "../page-words.ts";
3
+ import { type ChatBatch } from "./shared/page-words.ts";
4
4
  export declare const translate: import("../core/registry.ts").Command<z.ZodObject<{
5
5
  phrases: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodString]>>;
6
6
  }, z.core.$strip>, {
@@ -2,9 +2,9 @@ import { z } from "zod";
2
2
  import { readSettings, requireCampaign } from "../campaign/index.js";
3
3
  import { appendLogEntry } from "../core/log.js";
4
4
  import { defineCommand } from "../core/registry.js";
5
- import { chatBatch, keepChatAnswer, languageName, shipsLanguage } from "../page-words.js";
6
- import { newDatedLogEntry } from "./game-time.js";
7
- import { campaignSystem } from "./game-world.js";
5
+ import { chatBatch, keepChatAnswer, languageName, shipsLanguage } from "./shared/page-words.js";
6
+ import { newDatedLogEntry } from "./shared/time.js";
7
+ import { campaignSystem } from "./shared/world.js";
8
8
  export const translate = defineCommand({
9
9
  name: "translate",
10
10
  description: "Translate the player's dashboard into the campaign's language yourself, in the chat. "
@@ -1,6 +1,6 @@
1
- import { type Page, type Position, type World } from "../pages/index.ts";
2
- import type { GameSystem } from "../systems/index.ts";
3
- import { type Measures, type Roads } from "./game-roads.ts";
1
+ import { type Page, type Position, type World } from "../../pages/index.ts";
2
+ import type { GameSystem } from "../../systems/index.ts";
3
+ import { type Measures, type Roads } from "../shared/roads.ts";
4
4
  /** A leg of a straight line across country: the region it runs in, none in the open, its length in metres and the metres a minute at the pace there. */
5
5
  export interface OpenLeg {
6
6
  region?: Page;
@@ -1,9 +1,8 @@
1
1
  // Travel off the roads (D-259, TRV-12, TRV-13): a straight line across the regions of the map, each with its terrain, and the roads it crosses.
2
- import { crossingAlong, distanceBetween, pointAlong } from "../map/index.js";
3
- import { pagesWithName } from "../pages/index.js";
4
- import { mapKey } from "./game-maps.js";
5
- import { placedPosition, positionOf, regionAt, relationText } from "./game-positions.js";
6
- import { lengthText, terrainFactor } from "./game-roads.js";
2
+ import { crossingAlong, distanceBetween, pointAlong } from "../../map/index.js";
3
+ import { mapKey, pagesWithName } from "../../pages/index.js";
4
+ import { placedPosition, positionOf, regionAt, relationText } from "../shared/positions.js";
5
+ import { lengthText, terrainFactor } from "../shared/roads.js";
7
6
  // The line is judged every this many metres: a region smaller than this may be missed, which the master can always say.
8
7
  const sampleMetres = 250;
9
8
  /**
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- export declare const route: import("../core/registry.ts").Command<z.ZodObject<{
2
+ export declare const route: import("../../core/registry.ts").Command<z.ZodObject<{
3
3
  to: z.ZodString;
4
4
  from: z.ZodOptional<z.ZodString>;
5
5
  pace: z.ZodOptional<z.ZodString>;
@@ -1,14 +1,13 @@
1
1
  import { z } from "zod";
2
- import { requireCampaign } from "../campaign/index.js";
3
- import { defineCommand } from "../core/registry.js";
4
- import { distanceBetween } from "../map/index.js";
5
- import { locate, pageNamed, parsePageReference } from "../pages/index.js";
6
- import { journeyStart, moversPosition, readJourney } from "./game-journey.js";
7
- import { mapKey } from "./game-maps.js";
8
- import { acrossHint, openLegs } from "./game-open.js";
9
- import { pointText, positionOf } from "./game-positions.js";
10
- import { dayHours, durationText, goingText, lengthText, measuresOf, moversOf, noWayText, paceOf, partyLead, roadsOf, sameSpot, stopOf, travellingParty, unknownOnRoad, wayFor, wayText } from "./game-roads.js";
11
- import { campaignSystem, campaignWorld, missingSystemHint } from "./game-world.js";
2
+ import { requireCampaign } from "../../campaign/index.js";
3
+ import { defineCommand } from "../../core/registry.js";
4
+ import { distanceBetween } from "../../map/index.js";
5
+ import { locate, mapKey, pageNamed, parsePageReference } from "../../pages/index.js";
6
+ import { journeyStart, moversPosition, readJourney } from "../shared/journey.js";
7
+ import { pointText, positionOf } from "../shared/positions.js";
8
+ import { dayHours, durationText, goingText, lengthText, measuresOf, moversOf, noWayText, paceOf, partyLead, roadsOf, sameSpot, stopOf, travellingParty, unknownOnRoad, wayFor, wayText } from "../shared/roads.js";
9
+ import { campaignSystem, campaignWorld, missingSystemHint } from "../shared/world.js";
10
+ import { acrossHint, openLegs } from "./open.js";
12
11
  export const route = defineCommand({
13
12
  name: "route",
14
13
  description: "How far a place is by road, and how long the journey takes: the stops and roads of the quickest way, the distance and the days, at the party's pace or another. "
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { type TimePassed } from "./game-advance.ts";
2
+ import { type TimePassed } from "../shared/advance.ts";
3
3
  /** How a travel ended (TRV-7, TRV-12): at a place, at the end of a distance in the open, at an event, at the end of the day's travel, or before it began. */
4
4
  type Ending = {
5
5
  kind: "arrived";
@@ -37,7 +37,7 @@ interface TravelResult {
37
37
  time?: TimePassed;
38
38
  notes: string[];
39
39
  }
40
- export declare const travel: import("../core/registry.ts").Command<z.ZodObject<{
40
+ export declare const travel: import("../../core/registry.ts").Command<z.ZodObject<{
41
41
  to: z.ZodOptional<z.ZodString>;
42
42
  across: z.ZodOptional<z.ZodBoolean>;
43
43
  toward: z.ZodOptional<z.ZodString>;
@@ -1,23 +1,21 @@
1
1
  import { z } from "zod";
2
- import { requireCampaign } from "../campaign/index.js";
3
- import { readLength } from "../core/length.js";
4
- import { defineCommand } from "../core/registry.js";
5
- import { directionHelp, directionName, distanceBetween, pointAlong, pointFrom, readDirection } from "../map/index.js";
6
- import { environmentAt, locate, pageNamed, parsePageReference, playerCharacters } from "../pages/index.js";
7
- import { addDuration, formatGameDate, minutesBetween } from "../time/index.js";
8
- import { aroundLead, passedLines, passTime } from "./game-advance.js";
9
- import { journeyPoint, journeyStart, moversMap, moversNamed, moversPosition, readJourney, ridersOf, sameMovers, saveJourney, travelledSinceRest } from "./game-journey.js";
10
- import { mapKey, mapOf } from "./game-maps.js";
11
- import { movePages } from "./game-moves.js";
12
- import { acrossHint, crossedRoads, openLegs } from "./game-open.js";
13
- import { timePassedLines } from "./game-package-code.js";
14
- import { nearPlaces, pointText, positionOf, regionAt } from "./game-positions.js";
15
- import { dayHours, durationText, goingText, hoursText, isVehicleOnly, kindOf, lengthText, measuresOf, moversOf, noWayText, paceOf, partyLead, roadsOf, sameSpot, speedOf, stepEnd, stopOf, travellingParty, unknownOnRoad, wayFor, wayText, } from "./game-roads.js";
16
- import { readOpenScene } from "./game-scene.js";
17
- import { presentDate } from "./game-time.js";
18
- import { campaignSystem, campaignWorld, missingSystemHint } from "./game-world.js";
19
- // A list, or one text, as an MCP client may send it.
20
- const textList = z.union([z.string(), z.array(z.string())]);
2
+ import { requireCampaign } from "../../campaign/index.js";
3
+ import { readLength } from "../../core/length.js";
4
+ import { defineCommand } from "../../core/registry.js";
5
+ import { directionHelp, directionName, distanceBetween, pointAlong, pointFrom, readDirection } from "../../map/index.js";
6
+ import { environmentAt, locate, mapKey, mapOf, pageNamed, parsePageReference, playerCharacters } from "../../pages/index.js";
7
+ import { addDuration, formatGameDate, minutesBetween } from "../../time/index.js";
8
+ import { aroundLead, passedLines, passTime } from "../shared/advance.js";
9
+ import { textList, textsOf } from "../shared/inputs.js";
10
+ import { journeyPoint, journeyStart, moversMap, moversNamed, moversPosition, readJourney, ridersOf, sameMovers, saveJourney, travelledSinceRest } from "../shared/journey.js";
11
+ import { movePages } from "../shared/moves.js";
12
+ import { timePassedLines } from "../shared/packages/code.js";
13
+ import { nearPlaces, pointText, positionOf, regionAt } from "../shared/positions.js";
14
+ import { dayHours, durationText, goingText, hoursText, isVehicleOnly, kindOf, lengthText, measuresOf, moversOf, noWayText, paceOf, partyLead, roadsOf, sameSpot, speedOf, stepEnd, stopOf, travellingParty, unknownOnRoad, wayFor, wayText, } from "../shared/roads.js";
15
+ import { readOpenScene } from "../shared/scene.js";
16
+ import { presentDate } from "../shared/time.js";
17
+ import { campaignSystem, campaignWorld, missingSystemHint } from "../shared/world.js";
18
+ import { acrossHint, crossedRoads, openLegs } from "./open.js";
21
19
  export const travel = defineCommand({
22
20
  name: "travel",
23
21
  description: "Make a journey: whenever the party goes somewhere, use it instead of advance and move. "
@@ -343,7 +341,6 @@ function aroundLines(world, roads, from, point, measures, map = "") {
343
341
  "No place is written here: to make it one, such as a camp, write <name>, type place, here.",
344
342
  ].filter((line) => line !== "");
345
343
  }
346
- /** The travellers (TRV-6): the characters named, or the party where the player character is; in the open, those of its journey. */
347
344
  /** "Corrado stays in Roccalba: …": who travels leaves out the player character where they start, which who may not have meant (playtest 05). */
348
345
  function stayingNote(world, travellers) {
349
346
  const placeOf = (page) => locate(world, page).chain.find((holder) => holder.type === "place");
@@ -357,8 +354,9 @@ function stayingNote(world, travellers) {
357
354
  }
358
355
  return `${staying.map((pc) => pc.name).join(" and ")} ${staying.length === 1 ? "stays" : "stay"} in ${start.name}: who replaces the party; to go together, leave who out, or name the party too.`;
359
356
  }
357
+ /** The travellers (TRV-6): the characters named, or the party where the player character is; in the open, those of its journey. */
360
358
  function travellersOf(world, who, journey) {
361
- const names = (typeof who === "string" ? [who] : (who ?? [])).filter((name) => name.trim() !== "");
359
+ const names = textsOf(who);
362
360
  if (names.length === 0) {
363
361
  const party = travellingParty(world, partyLead(world, journey?.movers ?? [], "Give who, the characters who travel."), journey?.movers ?? []);
364
362
  if (party.length === 0) {