rpg-engine 0.15.0 → 0.17.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 (503) hide show
  1. package/dist/adventures/source.d.ts +3 -1
  2. package/dist/adventures/source.js +31 -1
  3. package/dist/campaign/find-campaign.js +8 -4
  4. package/dist/campaign/index.d.ts +1 -1
  5. package/dist/campaign/index.js +1 -1
  6. package/dist/campaign/settings.d.ts +6 -0
  7. package/dist/campaign/settings.js +22 -1
  8. package/dist/cli/cli.js +1 -1
  9. package/dist/cli/command-line.js +1 -1
  10. package/dist/commands/advance.d.ts +1 -1
  11. package/dist/commands/advance.js +6 -6
  12. package/dist/commands/ask.js +7 -7
  13. package/dist/commands/change/amounts.d.ts +32 -0
  14. package/dist/commands/change/amounts.js +150 -0
  15. package/dist/commands/change/change.d.ts +4 -54
  16. package/dist/commands/change/change.js +19 -749
  17. package/dist/commands/change/damage.d.ts +30 -0
  18. package/dist/commands/change/damage.js +73 -2
  19. package/dist/commands/change/dice.d.ts +34 -0
  20. package/dist/commands/change/dice.js +59 -0
  21. package/dist/commands/change/fields.d.ts +37 -0
  22. package/dist/commands/change/fields.js +156 -0
  23. package/dist/commands/change/holder.d.ts +48 -0
  24. package/dist/commands/change/holder.js +162 -0
  25. package/dist/commands/change/recipe-pace.js +1 -1
  26. package/dist/commands/change/recipe.d.ts +58 -0
  27. package/dist/commands/change/recipe.js +179 -0
  28. package/dist/commands/choices.js +3 -3
  29. package/dist/commands/config/config.d.ts +15 -0
  30. package/dist/commands/config/config.js +355 -0
  31. package/dist/commands/config/custom-levels.d.ts +7 -0
  32. package/dist/commands/config/custom-levels.js +32 -0
  33. package/dist/commands/{config.d.ts → config/dashboard.d.ts} +2 -24
  34. package/dist/commands/config/dashboard.js +171 -0
  35. package/dist/commands/config/entries.d.ts +17 -0
  36. package/dist/commands/config/entries.js +76 -0
  37. package/dist/commands/config/news.d.ts +7 -0
  38. package/dist/commands/config/news.js +88 -0
  39. package/dist/commands/config/shown.d.ts +9 -0
  40. package/dist/commands/config/shown.js +80 -0
  41. package/dist/commands/config/words.d.ts +27 -0
  42. package/dist/commands/config/words.js +204 -0
  43. package/dist/commands/effect.js +9 -9
  44. package/dist/commands/find.js +1 -1
  45. package/dist/commands/image.js +6 -6
  46. package/dist/commands/import/import.d.ts +0 -2
  47. package/dist/commands/import/import.js +68 -45
  48. package/dist/commands/import/run.js +1 -1
  49. package/dist/commands/index.js +3 -3
  50. package/dist/commands/init.js +2 -2
  51. package/dist/commands/install.js +1 -1
  52. package/dist/commands/instructions.js +6 -6
  53. package/dist/commands/mode.d.ts +2 -2
  54. package/dist/commands/mode.js +8 -8
  55. package/dist/commands/mood.js +4 -4
  56. package/dist/commands/move.js +10 -10
  57. package/dist/commands/package/consent.d.ts +11 -0
  58. package/dist/commands/package/consent.js +52 -0
  59. package/dist/commands/package/here.d.ts +51 -0
  60. package/dist/commands/package/here.js +128 -0
  61. package/dist/commands/package/install.d.ts +10 -0
  62. package/dist/commands/package/install.js +337 -0
  63. package/dist/commands/package/package.d.ts +18 -0
  64. package/dist/commands/package/package.js +270 -0
  65. package/dist/commands/package/result.d.ts +89 -0
  66. package/dist/commands/package/result.js +1 -0
  67. package/dist/commands/package/uninstall.d.ts +6 -0
  68. package/dist/commands/package/uninstall.js +70 -0
  69. package/dist/commands/rename.js +3 -3
  70. package/dist/commands/reveal.js +5 -5
  71. package/dist/commands/roll/roll.js +11 -9
  72. package/dist/commands/roll/tables.js +1 -1
  73. package/dist/commands/rules.d.ts +2 -2
  74. package/dist/commands/rules.js +3 -3
  75. package/dist/commands/save.d.ts +2 -2
  76. package/dist/commands/save.js +2 -2
  77. package/dist/commands/scene/close.d.ts +18 -0
  78. package/dist/commands/scene/close.js +179 -0
  79. package/dist/commands/scene/members.d.ts +14 -0
  80. package/dist/commands/scene/members.js +32 -0
  81. package/dist/commands/scene/open.d.ts +6 -0
  82. package/dist/commands/scene/open.js +298 -0
  83. package/dist/commands/scene/result.d.ts +98 -0
  84. package/dist/commands/scene/result.js +2 -0
  85. package/dist/commands/{scene.d.ts → scene/scene.d.ts} +10 -36
  86. package/dist/commands/scene/scene.js +210 -0
  87. package/dist/commands/scene/turns.d.ts +18 -0
  88. package/dist/commands/scene/turns.js +229 -0
  89. package/dist/commands/shared/books/adventure-layers.d.ts +89 -0
  90. package/dist/commands/shared/books/adventure-layers.js +201 -0
  91. package/dist/commands/shared/{adventures.d.ts → books/adventures.d.ts} +28 -9
  92. package/dist/commands/shared/{adventures.js → books/adventures.js} +77 -35
  93. package/dist/commands/shared/{library-reader.js → books/library-reader.js} +3 -3
  94. package/dist/commands/shared/{library.d.ts → books/library.d.ts} +2 -2
  95. package/dist/commands/shared/{library.js → books/library.js} +9 -9
  96. package/dist/commands/shared/{rules.d.ts → books/rules.d.ts} +2 -2
  97. package/dist/commands/shared/{rules.js → books/rules.js} +5 -5
  98. package/dist/commands/shared/{system-texts.d.ts → books/system-texts.d.ts} +2 -2
  99. package/dist/commands/shared/{system-texts.js → books/system-texts.js} +9 -8
  100. package/dist/commands/shared/{page-words.d.ts → books/words.d.ts} +2 -2
  101. package/dist/commands/shared/{page-words.js → books/words.js} +4 -4
  102. package/dist/commands/shared/{checks.d.ts → campaign/checks.d.ts} +3 -3
  103. package/dist/commands/shared/{checks.js → campaign/checks.js} +7 -7
  104. package/dist/commands/shared/{images.d.ts → campaign/images.d.ts} +3 -3
  105. package/dist/commands/shared/{images.js → campaign/images.js} +5 -5
  106. package/dist/commands/shared/{mode.d.ts → campaign/mode.d.ts} +4 -4
  107. package/dist/commands/shared/{mode.js → campaign/mode.js} +24 -13
  108. package/dist/commands/shared/{money.d.ts → campaign/money.d.ts} +3 -3
  109. package/dist/commands/shared/{money.js → campaign/money.js} +2 -2
  110. package/dist/commands/shared/{offers.d.ts → campaign/offers.d.ts} +3 -3
  111. package/dist/commands/shared/{offers.js → campaign/offers.js} +3 -3
  112. package/dist/commands/shared/{outside.d.ts → campaign/outside.d.ts} +3 -3
  113. package/dist/commands/shared/{outside.js → campaign/outside.js} +7 -7
  114. package/dist/commands/shared/{parts.d.ts → campaign/parts.d.ts} +3 -3
  115. package/dist/commands/shared/{parts.js → campaign/parts.js} +3 -3
  116. package/dist/commands/shared/{problems.d.ts → campaign/problems.d.ts} +3 -3
  117. package/dist/commands/shared/{problems.js → campaign/problems.js} +17 -17
  118. package/dist/commands/shared/{quests.d.ts → campaign/quests.d.ts} +4 -4
  119. package/dist/commands/shared/{quests.js → campaign/quests.js} +6 -6
  120. package/dist/commands/shared/{saves.d.ts → campaign/saves.d.ts} +4 -4
  121. package/dist/commands/shared/{saves.js → campaign/saves.js} +10 -10
  122. package/dist/commands/shared/{theme.d.ts → campaign/theme.d.ts} +3 -3
  123. package/dist/commands/shared/{theme.js → campaign/theme.js} +1 -1
  124. package/dist/commands/shared/{world.d.ts → campaign/world.d.ts} +5 -5
  125. package/dist/commands/shared/{world.js → campaign/world.js} +17 -14
  126. package/dist/commands/shared/{knowledge.d.ts → characters/knowledge.d.ts} +3 -3
  127. package/dist/commands/shared/{knowledge.js → characters/knowledge.js} +4 -4
  128. package/dist/commands/shared/{moods.d.ts → characters/moods.d.ts} +3 -3
  129. package/dist/commands/shared/{moods.js → characters/moods.js} +3 -3
  130. package/dist/commands/shared/characters/orders.d.ts +4 -0
  131. package/dist/commands/shared/characters/orders.js +10 -0
  132. package/dist/commands/shared/{thoughts.d.ts → characters/thoughts.d.ts} +9 -6
  133. package/dist/commands/shared/{thoughts.js → characters/thoughts.js} +17 -7
  134. package/dist/commands/shared/{voices.d.ts → characters/voices.d.ts} +1 -1
  135. package/dist/commands/shared/{voices.js → characters/voices.js} +2 -2
  136. package/dist/commands/shared/examples.js +2 -2
  137. package/dist/commands/shared/packages/catalog.js +2 -2
  138. package/dist/commands/shared/packages/code.d.ts +1 -1
  139. package/dist/commands/shared/packages/code.js +8 -8
  140. package/dist/commands/shared/packages/extensions.d.ts +1 -1
  141. package/dist/commands/shared/packages/extensions.js +1 -1
  142. package/dist/commands/shared/packages/hooks.d.ts +1 -1
  143. package/dist/commands/shared/packages/hooks.js +1 -1
  144. package/dist/commands/shared/packages/widgets.d.ts +3 -3
  145. package/dist/commands/shared/packages/widgets.js +3 -3
  146. package/dist/commands/shared/{environment.d.ts → places/environment.d.ts} +1 -1
  147. package/dist/commands/shared/{environment.js → places/environment.js} +4 -4
  148. package/dist/commands/shared/{grid-moves.d.ts → places/grid-moves.d.ts} +4 -4
  149. package/dist/commands/shared/{grid-moves.js → places/grid-moves.js} +8 -7
  150. package/dist/commands/shared/{grids.d.ts → places/grids.d.ts} +4 -4
  151. package/dist/commands/shared/{grids.js → places/grids.js} +6 -6
  152. package/dist/commands/shared/{journey.d.ts → places/journey.d.ts} +3 -3
  153. package/dist/commands/shared/{journey.js → places/journey.js} +6 -6
  154. package/dist/commands/shared/{moves.d.ts → places/moves.d.ts} +2 -2
  155. package/dist/commands/shared/{moves.js → places/moves.js} +4 -4
  156. package/dist/commands/shared/{positions.d.ts → places/positions.d.ts} +2 -2
  157. package/dist/commands/shared/{positions.js → places/positions.js} +4 -4
  158. package/dist/commands/shared/{roads.d.ts → places/roads.d.ts} +5 -5
  159. package/dist/commands/shared/{roads.js → places/roads.js} +6 -6
  160. package/dist/commands/shared/{effects.d.ts → scene/effects.d.ts} +7 -7
  161. package/dist/commands/shared/{effects.js → scene/effects.js} +10 -10
  162. package/dist/commands/shared/{loot.d.ts → scene/loot.d.ts} +2 -2
  163. package/dist/commands/shared/{loot.js → scene/loot.js} +3 -3
  164. package/dist/commands/shared/{master-rolls.d.ts → scene/master-rolls.d.ts} +2 -2
  165. package/dist/commands/shared/{master-rolls.js → scene/master-rolls.js} +5 -5
  166. package/dist/commands/shared/{reminders.d.ts → scene/reminders.d.ts} +4 -4
  167. package/dist/commands/shared/{reminders.js → scene/reminders.js} +4 -4
  168. package/dist/commands/shared/{scene.d.ts → scene/scene.d.ts} +3 -3
  169. package/dist/commands/shared/{scene.js → scene/scene.js} +10 -8
  170. package/dist/commands/shared/{bonds.d.ts → sheet/bonds.d.ts} +3 -3
  171. package/dist/commands/shared/{bonds.js → sheet/bonds.js} +2 -2
  172. package/dist/commands/shared/{page-counters.d.ts → sheet/counters.d.ts} +3 -3
  173. package/dist/commands/shared/{page-counters.js → sheet/counters.js} +5 -5
  174. package/dist/commands/shared/{effect-layer.d.ts → sheet/effect-layer.d.ts} +2 -2
  175. package/dist/commands/shared/{effect-layer.js → sheet/effect-layer.js} +9 -6
  176. package/dist/commands/shared/sheet/effect-values.d.ts +9 -0
  177. package/dist/commands/shared/sheet/effect-values.js +69 -0
  178. package/dist/commands/shared/{experience.d.ts → sheet/experience.d.ts} +3 -3
  179. package/dist/commands/shared/{experience.js → sheet/experience.js} +5 -5
  180. package/dist/commands/shared/sheet/formula-problems.d.ts +8 -0
  181. package/dist/commands/shared/sheet/formula-problems.js +140 -0
  182. package/dist/commands/shared/sheet/formula-scope.d.ts +32 -0
  183. package/dist/commands/shared/sheet/formula-scope.js +235 -0
  184. package/dist/commands/shared/{limits.d.ts → sheet/limits.d.ts} +3 -3
  185. package/dist/commands/shared/{limits.js → sheet/limits.js} +5 -4
  186. package/dist/commands/shared/{progression.d.ts → sheet/progression.d.ts} +2 -2
  187. package/dist/commands/shared/{progression.js → sheet/progression.js} +4 -4
  188. package/dist/commands/shared/{sheet.d.ts → sheet/sheet.d.ts} +7 -5
  189. package/dist/commands/shared/{sheet.js → sheet/sheet.js} +11 -7
  190. package/dist/commands/shared/{stacks.d.ts → sheet/stacks.d.ts} +2 -2
  191. package/dist/commands/shared/{stacks.js → sheet/stacks.js} +4 -4
  192. package/dist/commands/shared/sheet/system-fields.d.ts +21 -0
  193. package/dist/commands/shared/sheet/system-fields.js +45 -0
  194. package/dist/commands/shared/{thresholds.d.ts → sheet/thresholds.d.ts} +1 -1
  195. package/dist/commands/shared/{thresholds.js → sheet/thresholds.js} +4 -4
  196. package/dist/commands/shared/{turn-uses.d.ts → sheet/turn-uses.d.ts} +3 -3
  197. package/dist/commands/shared/{turn-uses.js → sheet/turn-uses.js} +4 -3
  198. package/dist/commands/shared/{worked-out.d.ts → sheet/worked-out.d.ts} +11 -46
  199. package/dist/commands/shared/sheet/worked-out.js +291 -0
  200. package/dist/commands/shared/sheet/worked-text.d.ts +14 -0
  201. package/dist/commands/shared/sheet/worked-text.js +55 -0
  202. package/dist/commands/shared/{advance.d.ts → time/advance.d.ts} +3 -3
  203. package/dist/commands/shared/{advance.js → time/advance.js} +11 -11
  204. package/dist/commands/shared/{dice-pool.d.ts → time/dice-pool.d.ts} +3 -3
  205. package/dist/commands/shared/{dice-pool.js → time/dice-pool.js} +11 -11
  206. package/dist/commands/shared/{events.d.ts → time/events.d.ts} +5 -5
  207. package/dist/commands/shared/{events.js → time/events.js} +10 -13
  208. package/dist/commands/shared/{recipes.d.ts → time/recipes.d.ts} +3 -3
  209. package/dist/commands/shared/{recipes.js → time/recipes.js} +6 -5
  210. package/dist/commands/shared/{time.d.ts → time/time.d.ts} +4 -4
  211. package/dist/commands/shared/{time.js → time/time.js} +6 -6
  212. package/dist/commands/shared/{upkeep.d.ts → time/upkeep.d.ts} +3 -3
  213. package/dist/commands/shared/{upkeep.js → time/upkeep.js} +14 -13
  214. package/dist/commands/show.d.ts +9 -0
  215. package/dist/commands/show.js +43 -10
  216. package/dist/commands/status.d.ts +2 -1
  217. package/dist/commands/status.js +28 -22
  218. package/dist/commands/thoughts.d.ts +1 -0
  219. package/dist/commands/thoughts.js +26 -18
  220. package/dist/commands/trade.js +8 -8
  221. package/dist/commands/translate.d.ts +1 -1
  222. package/dist/commands/translate.js +3 -3
  223. package/dist/commands/travel/open.d.ts +1 -1
  224. package/dist/commands/travel/open.js +2 -2
  225. package/dist/commands/travel/route.js +7 -6
  226. package/dist/commands/travel/travel.d.ts +1 -1
  227. package/dist/commands/travel/travel.js +8 -8
  228. package/dist/commands/validate.js +3 -3
  229. package/dist/commands/view/journal.d.ts +2 -2
  230. package/dist/commands/view/journal.js +2 -2
  231. package/dist/commands/view/layers.d.ts +34 -0
  232. package/dist/commands/view/layers.js +44 -0
  233. package/dist/commands/view/map.d.ts +1 -1
  234. package/dist/commands/view/map.js +6 -6
  235. package/dist/commands/view/memory.d.ts +16 -0
  236. package/dist/commands/view/memory.js +96 -0
  237. package/dist/commands/view/page.d.ts +32 -0
  238. package/dist/commands/view/page.js +166 -0
  239. package/dist/commands/view/place.d.ts +7 -2
  240. package/dist/commands/view/place.js +30 -12
  241. package/dist/commands/view/result.d.ts +252 -0
  242. package/dist/commands/view/result.js +1 -0
  243. package/dist/commands/view/saves.d.ts +6 -0
  244. package/dist/commands/view/saves.js +53 -0
  245. package/dist/commands/view/story.d.ts +32 -0
  246. package/dist/commands/view/story.js +227 -0
  247. package/dist/commands/view/view.d.ts +29 -292
  248. package/dist/commands/view/view.js +31 -536
  249. package/dist/commands/view/world.d.ts +1 -1
  250. package/dist/commands/view/world.js +3 -3
  251. package/dist/commands/write/checks.d.ts +42 -0
  252. package/dist/commands/write/checks.js +291 -0
  253. package/dist/commands/write/here.d.ts +1 -1
  254. package/dist/commands/write/here.js +5 -5
  255. package/dist/commands/write/inheritance.d.ts +40 -0
  256. package/dist/commands/write/inheritance.js +185 -0
  257. package/dist/commands/write/input.d.ts +29 -0
  258. package/dist/commands/write/input.js +124 -0
  259. package/dist/commands/write/layer.d.ts +44 -0
  260. package/dist/commands/write/layer.js +68 -0
  261. package/dist/commands/write/notes.d.ts +22 -0
  262. package/dist/commands/write/notes.js +76 -0
  263. package/dist/commands/write/progression.d.ts +27 -0
  264. package/dist/commands/write/progression.js +175 -0
  265. package/dist/commands/write/write.d.ts +2 -0
  266. package/dist/commands/write/write.js +36 -816
  267. package/dist/core/files.d.ts +2 -0
  268. package/dist/core/files.js +7 -0
  269. package/dist/core/{package-declarations.d.ts → packages/declarations.d.ts} +1 -1
  270. package/dist/core/{package-declarations.js → packages/declarations.js} +1 -1
  271. package/dist/core/session-store.js +3 -3
  272. package/dist/core/store.d.ts +2 -2
  273. package/dist/core/store.js +18 -4
  274. package/dist/core/text.d.ts +2 -0
  275. package/dist/core/text.js +4 -0
  276. package/dist/dashboard/acts/acts.js +1 -1
  277. package/dist/dashboard/acts/sending.js +110 -0
  278. package/dist/dashboard/acts/sheet.js +2 -2
  279. package/dist/dashboard/acts/strip.js +1 -1
  280. package/dist/dashboard/address.js +6 -0
  281. package/dist/dashboard/api.js +19 -1
  282. package/dist/dashboard/app.js +51 -171
  283. package/dist/dashboard/dice/roller.js +1 -1
  284. package/dist/dashboard/dice/sets.js +2 -2
  285. package/dist/dashboard/dice/stage.js +1 -1
  286. package/dist/dashboard/dice/tray.js +6 -6
  287. package/dist/dashboard/guide/ar.md +7 -3
  288. package/dist/dashboard/guide/cs.md +9 -5
  289. package/dist/dashboard/guide/da.md +9 -5
  290. package/dist/dashboard/guide/de.md +7 -3
  291. package/dist/dashboard/guide/el.md +9 -5
  292. package/dist/dashboard/guide/en.md +4 -0
  293. package/dist/dashboard/guide/es.md +8 -4
  294. package/dist/dashboard/guide/fi.md +9 -5
  295. package/dist/dashboard/guide/fr.md +8 -4
  296. package/dist/dashboard/guide/he.md +7 -3
  297. package/dist/dashboard/guide/hi.md +10 -6
  298. package/dist/dashboard/guide/hu.md +8 -4
  299. package/dist/dashboard/guide/is.md +9 -5
  300. package/dist/dashboard/guide/it.md +5 -1
  301. package/dist/dashboard/guide/ja.md +9 -5
  302. package/dist/dashboard/guide/ko.md +8 -4
  303. package/dist/dashboard/guide/nb.md +8 -4
  304. package/dist/dashboard/guide/nl.md +8 -4
  305. package/dist/dashboard/guide/pl.md +8 -4
  306. package/dist/dashboard/guide/pt.md +7 -3
  307. package/dist/dashboard/guide/ro.md +9 -5
  308. package/dist/dashboard/guide/ru.md +8 -4
  309. package/dist/dashboard/guide/sv.md +9 -5
  310. package/dist/dashboard/guide/tr.md +9 -5
  311. package/dist/dashboard/guide/uk.md +8 -4
  312. package/dist/dashboard/guide/zh.md +8 -4
  313. package/dist/dashboard/help/help.js +3 -3
  314. package/dist/dashboard/i18n/ar.json +29 -0
  315. package/dist/dashboard/i18n/cs.json +29 -0
  316. package/dist/dashboard/i18n/da.json +29 -0
  317. package/dist/dashboard/i18n/de.json +29 -0
  318. package/dist/dashboard/i18n/el.json +29 -0
  319. package/dist/dashboard/i18n/es.json +29 -0
  320. package/dist/dashboard/i18n/fi.json +29 -0
  321. package/dist/dashboard/i18n/fr.json +29 -0
  322. package/dist/dashboard/i18n/he.json +29 -0
  323. package/dist/dashboard/i18n/hi.json +29 -0
  324. package/dist/dashboard/i18n/hu.json +29 -0
  325. package/dist/dashboard/i18n/is.json +29 -0
  326. package/dist/dashboard/i18n/it.json +29 -0
  327. package/dist/dashboard/i18n/ja.json +30 -1
  328. package/dist/dashboard/i18n/ko.json +29 -0
  329. package/dist/dashboard/i18n/nb.json +29 -0
  330. package/dist/dashboard/i18n/nl.json +29 -0
  331. package/dist/dashboard/i18n/pl.json +29 -0
  332. package/dist/dashboard/i18n/pt.json +29 -0
  333. package/dist/dashboard/i18n/ro.json +29 -0
  334. package/dist/dashboard/i18n/ru.json +29 -0
  335. package/dist/dashboard/i18n/sv.json +29 -0
  336. package/dist/dashboard/i18n/tr.json +29 -0
  337. package/dist/dashboard/i18n/uk.json +29 -0
  338. package/dist/dashboard/i18n/zh.json +29 -0
  339. package/dist/dashboard/{journal.js → journal/journal.js} +16 -16
  340. package/dist/dashboard/{notes.js → journal/notes.js} +4 -4
  341. package/dist/dashboard/kit.js +3 -3
  342. package/dist/dashboard/packages/ask-card.js +3 -3
  343. package/dist/dashboard/packages/catalog.js +196 -0
  344. package/dist/dashboard/packages/changes.js +111 -0
  345. package/dist/dashboard/packages/engine.js +87 -0
  346. package/dist/dashboard/packages/installed.js +53 -0
  347. package/dist/dashboard/packages/library.js +97 -0
  348. package/dist/dashboard/packages/outcomes.js +45 -0
  349. package/dist/dashboard/packages/packages.js +27 -578
  350. package/dist/dashboard/packages/page-code.js +15 -2
  351. package/dist/dashboard/packages/{package-page.js → page.js} +12 -5
  352. package/dist/dashboard/packages/rows.js +84 -0
  353. package/dist/dashboard/packages/share.js +44 -0
  354. package/dist/dashboard/packages/widgets.js +3 -3
  355. package/dist/dashboard/{card.js → parts/card.js} +1 -1
  356. package/dist/dashboard/parts/changed.js +37 -0
  357. package/dist/dashboard/{faces.js → parts/faces.js} +5 -5
  358. package/dist/dashboard/{game-words.js → parts/game-words.js} +1 -1
  359. package/dist/dashboard/{icons.js → parts/icons.js} +1 -1
  360. package/dist/dashboard/{labels.js → parts/labels.js} +2 -1
  361. package/dist/dashboard/{map-symbols.js → parts/map-symbols.js} +1 -1
  362. package/dist/dashboard/{markdown.js → parts/markdown.js} +2 -2
  363. package/dist/dashboard/{mood.js → parts/mood.js} +1 -1
  364. package/dist/dashboard/{refusals.js → parts/refusals.js} +5 -1
  365. package/dist/dashboard/{status.js → parts/status.js} +4 -4
  366. package/dist/dashboard/{widgets.js → parts/widgets.js} +5 -3
  367. package/dist/dashboard/place/key.js +24 -0
  368. package/dist/dashboard/place/paper.js +67 -0
  369. package/dist/dashboard/place/{map-sheet.js → sheet.js} +2 -2
  370. package/dist/dashboard/place/things.js +129 -0
  371. package/dist/dashboard/place/tokens.js +93 -0
  372. package/dist/dashboard/place/view.js +124 -0
  373. package/dist/dashboard/{asked-dice.js → play/asked-dice.js} +3 -3
  374. package/dist/dashboard/{asked.js → play/asked.js} +10 -10
  375. package/dist/dashboard/{choices.js → play/choices.js} +11 -10
  376. package/dist/dashboard/{requested.js → play/requested.js} +1 -1
  377. package/dist/dashboard/{rolls.js → play/rolls.js} +9 -9
  378. package/dist/dashboard/{scene.js → play/scene.js} +14 -14
  379. package/dist/dashboard/{turns.js → play/turns.js} +12 -12
  380. package/dist/dashboard/{language-choice.js → settings/language-choice.js} +1 -1
  381. package/dist/dashboard/{languages.js → settings/languages.js} +1 -1
  382. package/dist/dashboard/{saves.js → settings/saves.js} +8 -8
  383. package/dist/dashboard/{settings.js → settings/settings.js} +17 -15
  384. package/dist/dashboard/{setup.js → settings/setup.js} +5 -5
  385. package/dist/dashboard/{party.js → sheet/party.js} +8 -8
  386. package/dist/dashboard/{person-panel.js → sheet/person-panel.js} +4 -4
  387. package/dist/dashboard/{sheet.js → sheet/sheet.js} +27 -24
  388. package/dist/dashboard/{story.js → sheet/story.js} +3 -3
  389. package/dist/dashboard/{columns.js → shell/columns.js} +1 -1
  390. package/dist/dashboard/{footer.js → shell/footer.js} +3 -3
  391. package/dist/dashboard/{master.js → shell/master.js} +2 -2
  392. package/dist/dashboard/{notices.js → shell/notices.js} +3 -3
  393. package/dist/dashboard/{pages.js → shell/pages.js} +5 -5
  394. package/dist/dashboard/shell/shown.js +38 -0
  395. package/dist/dashboard/{table.js → shell/table.js} +2 -2
  396. package/dist/dashboard/{tabs.js → shell/tabs.js} +2 -2
  397. package/dist/dashboard/{top.js → shell/top.js} +7 -7
  398. package/dist/dashboard/style.css +288 -4
  399. package/dist/dashboard/world/calendar.js +4 -4
  400. package/dist/dashboard/world/drawing.js +92 -0
  401. package/dist/dashboard/world/key.js +21 -0
  402. package/dist/dashboard/world/lore.js +10 -6
  403. package/dist/dashboard/world/map-card.js +186 -0
  404. package/dist/dashboard/world/place-card.js +39 -0
  405. package/dist/dashboard/world/places.js +29 -0
  406. package/dist/dashboard/world/world.js +9 -341
  407. package/dist/extensions/extension.d.ts +1 -1
  408. package/dist/extensions/extension.js +1 -1
  409. package/dist/images/images.js +12 -9
  410. package/dist/index.d.ts +1 -1
  411. package/dist/languages/index.d.ts +1 -1
  412. package/dist/languages/index.js +1 -1
  413. package/dist/packages/npm.js +1 -1
  414. package/dist/page.d.ts +2 -2
  415. package/dist/page.js +1 -1
  416. package/dist/pages/check.js +23 -1
  417. package/dist/pages/containers.d.ts +1 -1
  418. package/dist/pages/containers.js +1 -1
  419. package/dist/pages/index.d.ts +4 -2
  420. package/dist/pages/index.js +4 -2
  421. package/dist/pages/inheritance.d.ts +2 -2
  422. package/dist/pages/layers.d.ts +52 -0
  423. package/dist/pages/layers.js +105 -0
  424. package/dist/pages/markdown.d.ts +5 -1
  425. package/dist/pages/markdown.js +13 -1
  426. package/dist/pages/rename-page.js +1 -1
  427. package/dist/pages/stacks/writes.js +48 -22
  428. package/dist/pages/standard-fields.d.ts +1 -1
  429. package/dist/pages/system-pages.d.ts +5 -3
  430. package/dist/pages/system-pages.js +16 -7
  431. package/dist/pages/world.d.ts +8 -1
  432. package/dist/pages/world.js +16 -4
  433. package/dist/pages/write-layer.d.ts +23 -0
  434. package/dist/pages/write-layer.js +162 -0
  435. package/dist/pages/write-page.d.ts +2 -2
  436. package/dist/pages/write-page.js +2 -2
  437. package/dist/rules/index.d.ts +1 -1
  438. package/dist/rules/index.js +1 -1
  439. package/dist/rules/search.d.ts +1 -1
  440. package/dist/rules/shown.d.ts +1 -1
  441. package/dist/server/dashboard/choices.d.ts +2 -0
  442. package/dist/server/dashboard/choices.js +6 -4
  443. package/dist/server/dashboard/files.js +5 -5
  444. package/dist/server/dashboard/index.d.ts +2 -2
  445. package/dist/server/dashboard/index.js +7 -3
  446. package/dist/server/dashboard/news.js +4 -3
  447. package/dist/server/dashboard/player.js +1 -1
  448. package/dist/server/dashboard/writes.d.ts +7 -0
  449. package/dist/server/dashboard/writes.js +48 -7
  450. package/dist/server/mcp.js +28 -13
  451. package/dist/systems/campaign-data.d.ts +15 -0
  452. package/dist/systems/campaign-data.js +85 -0
  453. package/dist/systems/{system-code.d.ts → code.d.ts} +1 -1
  454. package/dist/systems/{system-code.js → code.js} +2 -2
  455. package/dist/systems/game-system.d.ts +7 -61
  456. package/dist/systems/game-system.js +1 -984
  457. package/dist/systems/index.d.ts +6 -3
  458. package/dist/systems/index.js +6 -3
  459. package/dist/systems/installed.d.ts +31 -0
  460. package/dist/systems/installed.js +89 -0
  461. package/dist/systems/maps.d.ts +3 -0
  462. package/dist/systems/maps.js +9 -0
  463. package/dist/systems/read.d.ts +3 -0
  464. package/dist/systems/read.js +471 -0
  465. package/dist/systems/schema.d.ts +289 -0
  466. package/dist/systems/schema.js +243 -0
  467. package/dist/systems/settings.d.ts +19 -0
  468. package/dist/systems/settings.js +78 -0
  469. package/dist/systems/versions.d.ts +12 -0
  470. package/dist/systems/versions.js +52 -0
  471. package/dist/testing/index.js +1 -1
  472. package/instructions/import.md +1 -1
  473. package/instructions/play.md +1 -1
  474. package/instructions/voices.md +1 -1
  475. package/package.json +1 -1
  476. package/dist/commands/config.js +0 -948
  477. package/dist/commands/package.d.ts +0 -143
  478. package/dist/commands/package.js +0 -785
  479. package/dist/commands/scene.js +0 -894
  480. package/dist/commands/shared/worked-out.js +0 -805
  481. package/dist/dashboard/place/map-view.js +0 -417
  482. /package/dist/commands/shared/{library-reader.d.ts → books/library-reader.d.ts} +0 -0
  483. /package/dist/core/{package-api.d.ts → packages/api.d.ts} +0 -0
  484. /package/dist/core/{package-api.js → packages/api.js} +0 -0
  485. /package/dist/dashboard/{coins.js → parts/coins.js} +0 -0
  486. /package/dist/dashboard/{glass.js → parts/glass.js} +0 -0
  487. /package/dist/dashboard/{layout.js → parts/layout.js} +0 -0
  488. /package/dist/dashboard/{mood-faces.js → parts/mood-faces.js} +0 -0
  489. /package/dist/dashboard/{free-rolls.js → play/free-rolls.js} +0 -0
  490. /package/dist/dashboard/{reactions.js → play/reactions.js} +0 -0
  491. /package/dist/dashboard/{prefs.js → shell/prefs.js} +0 -0
  492. /package/dist/dashboard/{system-style.js → shell/system-style.js} +0 -0
  493. /package/dist/dashboard/{theme.js → shell/theme.js} +0 -0
  494. /package/dist/languages/{language-pack.d.ts → pack.d.ts} +0 -0
  495. /package/dist/languages/{language-pack.js → pack.js} +0 -0
  496. /package/dist/pages/{page-file.d.ts → file.d.ts} +0 -0
  497. /package/dist/pages/{page-file.js → file.js} +0 -0
  498. /package/dist/pages/{page-types.d.ts → types.d.ts} +0 -0
  499. /package/dist/pages/{page-types.js → types.js} +0 -0
  500. /package/dist/rules/{rule-book.d.ts → book.d.ts} +0 -0
  501. /package/dist/rules/{rule-book.js → book.js} +0 -0
  502. /package/dist/systems/{system-folders.d.ts → folders.d.ts} +0 -0
  503. /package/dist/systems/{system-folders.js → folders.js} +0 -0
@@ -2,25 +2,27 @@ import { z } from "zod";
2
2
  import { requireCampaign } from "../campaign/index.js";
3
3
  import { appendLogEntry } from "../core/log.js";
4
4
  import { defineCommand } from "../core/registry.js";
5
- import { isInParty, pageNamed } from "../pages/index.js";
6
- import { thoughtsLength, thoughtsType } from "./shared/thoughts.js";
7
- import { newDatedLogEntry } from "./shared/time.js";
8
- import { campaignWorld } from "./shared/world.js";
5
+ import { isPlayerCharacter, pageNamed } from "../pages/index.js";
6
+ import { campaignWorld } from "./shared/campaign/world.js";
7
+ import { thoughtsLength, thoughtsType } from "./shared/characters/thoughts.js";
8
+ import { newDatedLogEntry } from "./shared/time/time.js";
9
9
  export const thoughts = defineCommand({
10
10
  name: "thoughts",
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: "
12
- + "how they took what happened, whom they trust or fear now, what they mean to do; never what happened, which the log keeps, and nothing they hide from the others. "
13
- + "From their agent, its Writes line as it is. The player reads it on the dashboard, and view as gives them their last lines back. "
11
+ description: "Write a few lines in a character's diary, in their voice: a companion's when an output says it is due, or any character's of the campaign after a moment that changed them. "
12
+ + "How they took what happened, whom they trust or fear now, what they mean to do; never what happened, which the log keeps. "
13
+ + "A companion's the player reads on the dashboard: nothing they hide from the others. Another's only you read: what they hide too, never a secret or a plan their page already holds. "
14
+ + "A plan the story must keep goes on their page, as a secret: the diary gives back only its last lines. "
15
+ + "From their agent, its Writes line as it is. view as gives them their last lines back, and show gives them to you. "
14
16
  + 'Example: Mira "I no longer trust Corrado, since he lied to Agata. I will watch him."',
15
17
  group: "game",
16
18
  positionals: ["page", "text"],
17
19
  input: z.object({
18
- page: z.string().describe("the companion's page"),
20
+ page: z.string().describe("the character's page: a companion, or another character of the campaign, never the player's"),
19
21
  text: z.string().describe(`their lines, at most ${thoughtsLength} characters`),
20
22
  }),
21
23
  run(input, context) {
22
24
  const root = requireCampaign(context.folder);
23
- const page = companionPage(campaignWorld(root, context), input.page.trim());
25
+ const page = diaryPage(campaignWorld(root, context), input.page.trim());
24
26
  const text = input.text.trim().replace(/\s*\n\s*/g, " ").normalize("NFC");
25
27
  // Characters as a reader counts them: an emoji is one.
26
28
  const length = [...text].length;
@@ -30,24 +32,30 @@ export const thoughts = defineCommand({
30
32
  if (length > thoughtsLength) {
31
33
  throw new Error(`These lines are ${length} characters, the diary takes ${thoughtsLength}: keep how ${page.name} feels and what they mean to do, leave out what happened. Nothing written.`);
32
34
  }
33
- const entry = newDatedLogEntry(root, context, thoughtsType, "public", { page: page.name, text });
35
+ // A companion's diary the player reads; another character's only the master (DIA-1, DIA-4).
36
+ const hidden = page.fields.role !== "companion";
37
+ const entry = newDatedLogEntry(root, context, thoughtsType, hidden ? "hidden" : "public", { page: page.name, text });
34
38
  appendLogEntry(root, entry);
35
- return { who: page.name, ...(entry.date === undefined ? {} : { date: entry.date }), text };
39
+ return { who: page.name, ...(entry.date === undefined ? {} : { date: entry.date }), text, hidden };
36
40
  },
37
41
  format(result) {
38
- return `${result.who}'s diary${result.date === undefined ? "" : `, ${result.date}`}: ${result.text}`;
42
+ const when = [result.date ?? "", result.hidden ? "hidden from the player" : ""].filter((part) => part !== "").join(", ");
43
+ return `${result.who}'s diary${when === "" ? "" : `, ${when}`}: ${result.text}`;
39
44
  },
40
45
  });
41
- /** The companion whose diary it is (DIA-1); stops the command for any other page. */
42
- function companionPage(world, name) {
46
+ /** The character whose diary it is (DIA-1): a living character of the campaign, not the player's; stops the command for any other page. */
47
+ function diaryPage(world, name) {
43
48
  const page = pageNamed(world, name);
44
49
  if (page === undefined) {
45
- throw new Error(`There is no page ${name}: give a companion's name, or look for it with find. Nothing written.`);
50
+ throw new Error(`There is no page ${name}: give a character's name, or look for it with find. Nothing written.`);
46
51
  }
47
- if (page.type !== "character" || page.fields.role !== "companion" || page.system !== undefined) {
48
- throw new Error(`${page.name} is not a companion of the party: only companions keep a diary. Nothing written.`);
52
+ if (page.type !== "character" || page.system !== undefined) {
53
+ throw new Error(`${page.name} is not a character of the campaign: only they keep a diary. Nothing written.`);
49
54
  }
50
- if (!isInParty(page)) {
55
+ if (isPlayerCharacter(page)) {
56
+ throw new Error(`${page.name} is the player's character: their thoughts are the player's to tell. Nothing written.`);
57
+ }
58
+ if (page.fields.status === "dead") {
51
59
  throw new Error(`${page.name} is dead: the dead keep no diary. Nothing written.`);
52
60
  }
53
61
  return page;
@@ -5,15 +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 { campaignCoins } from "./shared/campaign/money.js";
9
+ import { campaignWorld, missingSystemHint } from "./shared/campaign/world.js";
8
10
  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";
11
+ import { textList, textsOf } from "./shared/inputs.js";
12
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";
13
+ import { afterMoves, pagesPlan } from "./shared/places/moves.js";
14
+ import { copyName, readOpenScene } from "./shared/scene/scene.js";
15
+ import { heldStack, logStackSteps, stackEdits, stackMoveSteps, stackStepText, unequipKinds } from "./shared/sheet/stacks.js";
16
+ import { newDatedLogEntry } from "./shared/time/time.js";
17
17
  export const trade = defineCommand({
18
18
  name: "trade",
19
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. "
@@ -92,7 +92,7 @@ function sideNamed(world, copy, name) {
92
92
  }
93
93
  /** The entries given, as a list or one text, each without quotes around it, as a model may send "\"2 gp\"". */
94
94
  function listOf(value) {
95
- return (value === undefined ? [] : typeof value === "string" ? [value] : value).map((entry) => entry.trim().replace(/^"(.*)"$/s, "$1").trim()).filter((entry) => entry !== "");
95
+ return textsOf(value).map((entry) => entry.trim().replace(/^"(.*)"$/s, "$1").trim()).filter((entry) => entry !== "");
96
96
  }
97
97
  /**
98
98
  * What a side hands over, read entry by entry (STK-7): money in the campaign's coins, a kind with how many, taken from the side's stack (STK-4), or an item with a story
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import type { Context } from "../core/context.ts";
3
- import { type ChatBatch } from "./shared/page-words.ts";
3
+ import { type ChatBatch } from "./shared/books/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 "./shared/page-words.js";
6
- import { newDatedLogEntry } from "./shared/time.js";
7
- import { campaignSystem } from "./shared/world.js";
5
+ import { chatBatch, keepChatAnswer, languageName, shipsLanguage } from "./shared/books/words.js";
6
+ import { campaignSystem } from "./shared/campaign/world.js";
7
+ import { newDatedLogEntry } from "./shared/time/time.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
1
  import { type Page, type Position, type World } from "../../pages/index.ts";
2
2
  import type { GameSystem } from "../../systems/index.ts";
3
- import { type Measures, type Roads } from "../shared/roads.ts";
3
+ import { type Measures, type Roads } from "../shared/places/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,8 +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
2
  import { crossingAlong, distanceBetween, pointAlong } from "../../map/index.js";
3
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";
4
+ import { placedPosition, positionOf, regionAt, relationText } from "../shared/places/positions.js";
5
+ import { lengthText, terrainFactor } from "../shared/places/roads.js";
6
6
  // The line is judged every this many metres: a region smaller than this may be missed, which the master can always say.
7
7
  const sampleMetres = 250;
8
8
  /**
@@ -3,10 +3,10 @@ import { requireCampaign } from "../../campaign/index.js";
3
3
  import { defineCommand } from "../../core/registry.js";
4
4
  import { distanceBetween } from "../../map/index.js";
5
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";
6
+ import { campaignSystem, campaignWorld, missingSystemHint } from "../shared/campaign/world.js";
7
+ import { journeyStart, moversPosition, readJourney } from "../shared/places/journey.js";
8
+ import { pointText, positionOf } from "../shared/places/positions.js";
9
+ import { dayHours, durationText, goingText, lengthText, measuresOf, moversOf, noWayText, paceOf, partyLead, roadsOf, sameSpot, stopOf, travellingParty, unknownOnRoad, wayFor, wayText, } from "../shared/places/roads.js";
10
10
  import { acrossHint, openLegs } from "./open.js";
11
11
  export const route = defineCommand({
12
12
  name: "route",
@@ -29,13 +29,14 @@ export const route = defineCommand({
29
29
  const roads = roadsOf(world);
30
30
  const measures = measuresOf(root, system);
31
31
  const destination = placeNamed(world, input.to, "where to");
32
- const travellers = input.from === undefined ? travellingParty(world, partyLead(world, readJourney(root)?.movers ?? [], "Give from, the place to start from."), readJourney(root)?.movers ?? []) : [];
32
+ // From where the party is, the journey under way counts; from a place given, none does.
33
+ const journey = input.from === undefined ? readJourney(root) : undefined;
34
+ const travellers = input.from === undefined ? travellingParty(world, partyLead(world, journey?.movers ?? [], "Give from, the place to start from."), journey?.movers ?? []) : [];
33
35
  const origin = input.from === undefined ? travellers[0] : placeNamed(world, input.from, "where from", true);
34
36
  if (origin === undefined) {
35
37
  throw new Error("There is no player character to start from: give from, a place.");
36
38
  }
37
39
  const { movers, vehicle } = travellers.length === 0 ? { movers: [origin], vehicle: undefined } : moversOf(world, system, travellers);
38
- const journey = input.from === undefined ? readJourney(root) : undefined;
39
40
  const onRoad = journey === undefined ? undefined : journeyStart(world, roads, journey, movers);
40
41
  const departure = stopOf(world, roads, origin);
41
42
  const arrival = stopOf(world, roads, destination);
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { type TimePassed } from "../shared/advance.ts";
2
+ import { type TimePassed } from "../shared/time/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";
@@ -5,16 +5,16 @@ import { defineCommand } from "../../core/registry.js";
5
5
  import { directionHelp, directionName, distanceBetween, pointAlong, pointFrom, readDirection } from "../../map/index.js";
6
6
  import { environmentAt, locate, mapKey, mapOf, pageNamed, parsePageReference, playerCharacters } from "../../pages/index.js";
7
7
  import { addDuration, formatGameDate, minutesBetween } from "../../time/index.js";
8
- import { aroundLead, passedLines, passTime } from "../shared/advance.js";
8
+ import { campaignSystem, campaignWorld, missingSystemHint } from "../shared/campaign/world.js";
9
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
10
  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";
11
+ import { journeyPoint, journeyStart, moversMap, moversNamed, moversPosition, readJourney, ridersOf, sameMovers, saveJourney, travelledSinceRest } from "../shared/places/journey.js";
12
+ import { movePages } from "../shared/places/moves.js";
13
+ import { nearPlaces, pointText, positionOf, regionAt } from "../shared/places/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/places/roads.js";
15
+ import { readOpenScene } from "../shared/scene/scene.js";
16
+ import { aroundLead, passedLines, passTime } from "../shared/time/advance.js";
17
+ import { presentDate } from "../shared/time/time.js";
18
18
  import { acrossHint, crossedRoads, openLegs } from "./open.js";
19
19
  export const travel = defineCommand({
20
20
  name: "travel",
@@ -1,10 +1,10 @@
1
1
  import { z } from "zod";
2
2
  import { requireCampaign } from "../campaign/index.js";
3
3
  import { defineCommand } from "../core/registry.js";
4
- import { stateCheckProblems } from "./shared/checks.js";
4
+ import { stateCheckProblems } from "./shared/campaign/checks.js";
5
+ import { campaignProblems } from "./shared/campaign/problems.js";
6
+ import { campaignWorld } from "./shared/campaign/world.js";
5
7
  import { packageCodeProblems } from "./shared/packages/code.js";
6
- import { campaignProblems } from "./shared/problems.js";
7
- import { campaignWorld } from "./shared/world.js";
8
8
  export const validate = defineCommand({
9
9
  name: "validate",
10
10
  description: "Check the whole campaign and say how to fix each problem. "
@@ -1,8 +1,8 @@
1
1
  import { type LogEntry } from "../../core/log.ts";
2
2
  import { type World } from "../../pages/index.ts";
3
3
  import type { GameDate } from "../../time/index.ts";
4
- import type { SeenEffect } from "../shared/effects.ts";
5
- import { type Knowledge } from "../shared/knowledge.ts";
4
+ import { type Knowledge } from "../shared/characters/knowledge.ts";
5
+ import type { SeenEffect } from "../shared/scene/effects.ts";
6
6
  /** A quest as the journal shows it (VIEW-8). */
7
7
  export interface ShownQuest {
8
8
  name: string;
@@ -3,8 +3,8 @@
3
3
  import { readLog } from "../../core/log.js";
4
4
  import { comparableText } from "../../core/text.js";
5
5
  import { goalsIn, links, textsIn } from "../../pages/index.js";
6
- import { knownSecretsApart, knownText } from "../shared/knowledge.js";
7
- import { measuresText, questMeasures } from "../shared/quests.js";
6
+ import { measuresText, questMeasures } from "../shared/campaign/quests.js";
7
+ import { knownSecretsApart, knownText } from "../shared/characters/knowledge.js";
8
8
  // The story tells what happened at its hour; time passing is no fact of it, the hours of the facts show it.
9
9
  const storyKinds = ["counter", "moved", "learned", "effect", "effect-ended", "back", "quest"];
10
10
  const statuses = ["open", "done", "failed"];
@@ -0,0 +1,34 @@
1
+ import { type Page, type World } from "../../pages/index.ts";
2
+ import { type Knowledge } from "../shared/characters/knowledge.ts";
3
+ /** A page of the game system the campaign changed with a layer (SYS-11), as the dashboard lists it. */
4
+ export interface ShownLayer {
5
+ /** The page's name, by which its layer is taken off. */
6
+ name: string;
7
+ /** Its name in the campaign's language, when the system's translation gives one (D-542). */
8
+ title?: string;
9
+ /** Its type, of a page the player may read. */
10
+ type?: string;
11
+ /** The fields the layer changes: each as the system gives it, none for one the layer adds, and as the campaign has it; none of a page the player may not read. */
12
+ fields: {
13
+ field: string;
14
+ system?: string;
15
+ campaign: string;
16
+ }[];
17
+ /** The sections the layer writes, by name: never a secret, and none of a page the player may not read. */
18
+ sections: string[];
19
+ /** Whether the layer writes the introduction, of a page the player may read. */
20
+ introduction?: true;
21
+ }
22
+ /**
23
+ * The pages of the game system with a layer of the campaign, by name (SYS-11). One the player may read (VIEW-2) with what the layer changes and the system's
24
+ * value of every field; any other, as a creature the character does not know, by its name alone, never a value nor what changed: a layer is a house rule of
25
+ * the campaign, not a fact of the story (D-565).
26
+ */
27
+ export declare function shownLayers(world: World, knowledge: Knowledge): ShownLayer[];
28
+ /** The page of the game system with a layer, by its name, as the view lists it and the player takes the layer off; undefined for any other. */
29
+ export declare function listedLayer(world: World, name: string): Page | undefined;
30
+ /**
31
+ * Whether what a page shows comes from a page of the game system the campaign changed with a layer (SYS-11): itself, or one it derives from; with `known`, only
32
+ * a base the viewer knows, so that the mark never tells of a creature that is the master's (D-254).
33
+ */
34
+ export declare function isLayered(world: World, page: Page, known?: (base: Page) => boolean): boolean;
@@ -0,0 +1,44 @@
1
+ // The pages of the game system the campaign changed with a layer (SYS-11), as the player may see them: what changed, and what the system gave
2
+ import { comparableText, sameName, valueNamed, valueText } from "../../core/text.js";
3
+ import { baseChain, partContent, systemOriginal } from "../../pages/index.js";
4
+ import { inKnownWords, knowsPage } from "../shared/characters/knowledge.js";
5
+ /**
6
+ * The pages of the game system with a layer of the campaign, by name (SYS-11). One the player may read (VIEW-2) with what the layer changes and the system's
7
+ * value of every field; any other, as a creature the character does not know, by its name alone, never a value nor what changed: a layer is a house rule of
8
+ * the campaign, not a fact of the story (D-565).
9
+ */
10
+ export function shownLayers(world, knowledge) {
11
+ const text = (value) => inKnownWords(world, knowledge, valueText(value));
12
+ return layeredPages(world).map((page) => {
13
+ const named = { name: page.name, ...(page.title === undefined ? {} : { title: page.title }) };
14
+ if (!knowsPage(knowledge, page)) {
15
+ return { ...named, fields: [], sections: [] };
16
+ }
17
+ const system = systemOriginal(page).fields;
18
+ return {
19
+ ...named,
20
+ ...(page.type === undefined ? {} : { type: page.type }),
21
+ fields: (page.layer?.fields ?? []).map((field) => {
22
+ const given = valueNamed(system, field);
23
+ return { field: sameName(Object.keys(system), field) ?? field, ...(given === undefined ? {} : { system: text(given) }), campaign: text(valueNamed(page.fields, field)) };
24
+ }),
25
+ sections: (page.layer?.sections ?? []).filter((section) => partContent(page.body, section)?.secret === false),
26
+ ...(page.layer?.introduction === true ? { introduction: true } : {}),
27
+ };
28
+ }).sort((one, other) => one.name.localeCompare(other.name));
29
+ }
30
+ /** The page of the game system with a layer, by its name, as the view lists it and the player takes the layer off; undefined for any other. */
31
+ export function listedLayer(world, name) {
32
+ return layeredPages(world).find((page) => comparableText(page.name) === comparableText(name));
33
+ }
34
+ /**
35
+ * Whether what a page shows comes from a page of the game system the campaign changed with a layer (SYS-11): itself, or one it derives from; with `known`, only
36
+ * a base the viewer knows, so that the mark never tells of a creature that is the master's (D-254).
37
+ */
38
+ export function isLayered(world, page, known = () => true) {
39
+ return [page, ...baseChain(world, page).filter(known)].some((one) => one.layer !== undefined);
40
+ }
41
+ /** The pages of the game system the campaign changed with a layer. */
42
+ function layeredPages(world) {
43
+ return (world.system?.pages ?? []).filter((page) => page.layer !== undefined);
44
+ }
@@ -1,5 +1,5 @@
1
1
  import { type Page } from "../../pages/index.ts";
2
- import { type Measures } from "../shared/roads.ts";
2
+ import { type Measures } from "../shared/places/roads.ts";
3
3
  import type { PlaceSight } from "./place.ts";
4
4
  /** A point of a map, in km east and north of its centre; with the map it is on, by the place that holds it, none for the main map (POS-8). */
5
5
  export interface MapPoint {
@@ -6,12 +6,12 @@ import { readLog } from "../../core/log.js";
6
6
  import { comparableText } from "../../core/text.js";
7
7
  import { directionName, directionTo, distanceBetween } from "../../map/index.js";
8
8
  import { environmentAt, locate, mapKey, mapOf, pagesWithName, parsePageReference, readStops } from "../../pages/index.js";
9
- import { shownImage } from "../shared/images.js";
10
- import { moversMap, moversNamed, moversPosition, readJourney } from "../shared/journey.js";
11
- import { knowsPage } from "../shared/knowledge.js";
12
- import { placedPosition, positionOf, regionsOf } from "../shared/positions.js";
13
- import { kindOf, roadsOf, travellingParty } from "../shared/roads.js";
14
- import { campaignSystem } from "../shared/world.js";
9
+ import { shownImage } from "../shared/campaign/images.js";
10
+ import { campaignSystem } from "../shared/campaign/world.js";
11
+ import { knowsPage } from "../shared/characters/knowledge.js";
12
+ import { moversMap, moversNamed, moversPosition, readJourney } from "../shared/places/journey.js";
13
+ import { placedPosition, positionOf, regionsOf } from "../shared/places/positions.js";
14
+ import { kindOf, roadsOf, travellingParty } from "../shared/places/roads.js";
15
15
  // How far a road toward a stop the character does not know is drawn, at most: a beginning, never where the stop is.
16
16
  const stubMetres = 3000;
17
17
  // How many places the chat lists.
@@ -0,0 +1,16 @@
1
+ import { type Page, type World } from "../../pages/index.ts";
2
+ import { type PlaceSight } from "./place.ts";
3
+ import type { ViewResult } from "./result.ts";
4
+ /**
5
+ * What a character other than the player's knows and lived, for the character agent voicing them (VIEW-10): their page as they know it, with their sheet; now; the pages they know,
6
+ * each in a line; the secrets of other pages they discovered; the scenes they were in.
7
+ */
8
+ export declare function memoryOf(sight: PlaceSight): Extract<ViewResult, {
9
+ kind: "memory";
10
+ }>;
11
+ /** What a character knows and lived, as the character agent voicing them reads it in the chat (VIEW-10). */
12
+ export declare function memoryText(result: Extract<ViewResult, {
13
+ kind: "memory";
14
+ }>): string;
15
+ /** The character a character agent's view is for (VIEW-10), by name or alias; stops the command for any other page. */
16
+ export declare function characterNamed(world: World, name: string): Page;
@@ -0,0 +1,96 @@
1
+ // Another character's view, for the agent voicing them
2
+ import { firstSentence, withArticle } from "../../core/text.js";
3
+ import { isPlayerCharacter, locate, pagesWithNameOrAlias, parsePageReference, playerCharacters } from "../../pages/index.js";
4
+ import { formatGameDate } from "../../time/index.js";
5
+ import { discoveredSecrets, knownIntroduction, knowsPage, scenesLivedBy } from "../shared/characters/knowledge.js";
6
+ import { quotedOrders, standingOrders } from "../shared/characters/orders.js";
7
+ import { keepsDiary, thoughtsIn, thoughtsRule, thoughtsShown } from "../shared/characters/thoughts.js";
8
+ import { readOpenScene } from "../shared/scene/scene.js";
9
+ import { sheetText } from "../shared/sheet/sheet.js";
10
+ import { readPresent } from "../shared/time/time.js";
11
+ import { shownName, shownPage } from "./page.js";
12
+ import { sceneLine } from "./place.js";
13
+ // How a player character is played while their player is away (D-480 (4)).
14
+ const awayRule = "You play while your player is away: no big decision, nothing precious spent, no needless risk.";
15
+ /**
16
+ * What a character other than the player's knows and lived, for the character agent voicing them (VIEW-10): their page as they know it, with their sheet; now; the pages they know,
17
+ * each in a line; the secrets of other pages they discovered; the scenes they were in.
18
+ */
19
+ export function memoryOf(sight) {
20
+ const { root, context, world, knowledge } = sight;
21
+ const self = knowledge.pc;
22
+ // A lone player character's player is never away.
23
+ const away = isPlayerCharacter(self) && self.fields.status !== "dead" && playerCharacters(world).filter((one) => one.fields.status !== "dead").length > 1;
24
+ // The player's standing orders, for a living companion and a player character played as one (D-563).
25
+ const orders = (away || self.fields.role === "companion") && self.fields.status !== "dead" ? standingOrders(root) : [];
26
+ const own = shownPage(root, context, world, knowledge, self, true);
27
+ const now = readPresent(root).date;
28
+ const { scene } = readOpenScene(root);
29
+ const inScene = scene !== undefined && scene.with.some((link) => pagesWithNameOrAlias(world, parsePageReference(link).name)[0] === self);
30
+ const line = inScene ? sceneLine(sight, (name) => shownName(world, knowledge, name), self) : undefined;
31
+ const known = [...knowledge.pages].filter((page) => page !== self && page.system === undefined).map((page) => {
32
+ const introduction = firstSentence(knownIntroduction(world, knowledge, page).split("\n")[0]);
33
+ return `${page.name} (${page.type ?? "page"})${introduction === "" ? "" : `: ${introduction}`}`;
34
+ });
35
+ return {
36
+ kind: "memory",
37
+ title: own.title,
38
+ sheet: own.sheet,
39
+ text: own.text,
40
+ ...(now === undefined ? {} : { now: formatGameDate(now) }),
41
+ place: locate(world, self).chain.filter((holder) => knowsPage(knowledge, holder)).map((holder) => holder.name),
42
+ ...(line === undefined ? {} : { scene: line }),
43
+ known,
44
+ discovered: discoveredSecrets(world, knowledge).map((secret) => `${secret.page}#${secret.name}: ${secret.text.replace(/\s*\n\s*/g, " ")}`),
45
+ lived: scenesLivedBy(root, world, self).map((one) => `${one.date === undefined ? "" : `${one.date} · `}${one.title}${one.summary === "" ? "" : `: ${one.summary}`}`),
46
+ // Their own last lines, hidden or public alike (DIA-3).
47
+ ...(keepsDiary(self)
48
+ ? {
49
+ thoughts: thoughtsIn(root, world, self).slice(-thoughtsShown).map((one) => `${one.date === undefined ? "" : `${one.date} · `}${one.text}`),
50
+ thoughtsRule: thoughtsRule(self.fields.role === "companion"),
51
+ }
52
+ : {}),
53
+ ...(away ? { away: awayRule } : {}),
54
+ ...(orders.length === 0 ? {} : { orders }),
55
+ };
56
+ }
57
+ /** What a character knows and lived, as the character agent voicing them reads it in the chat (VIEW-10). */
58
+ export function memoryText(result) {
59
+ const list = (title, lines) => (lines.length === 0 ? "" : `${title}:\n${lines.map((line) => `- ${line}`).join("\n")}`);
60
+ const where = result.place.length === 0 ? "" : `in ${result.place.join(" › ")}`;
61
+ const now = [result.now ?? "", where].filter((part) => part !== "").join(", ");
62
+ return [
63
+ result.title,
64
+ sheetText(result.sheet).join("\n"),
65
+ result.text,
66
+ now === "" ? "" : `Now: ${now}`,
67
+ result.scene === undefined ? "" : `Scene: ${result.scene}`,
68
+ list("Known", result.known),
69
+ list("Discovered", result.discovered),
70
+ list("Lived", result.lived),
71
+ result.thoughts === undefined ? "" : thoughtsText(result.thoughts, result.thoughtsRule ?? thoughtsRule(true)),
72
+ result.away ?? "",
73
+ // Last, where it is read just before the character speaks.
74
+ result.orders === undefined
75
+ ? ""
76
+ : `Your party's standing orders: ${quotedOrders(result.orders)}. Keep them; if your character would balk, say so in the open rather than break one silently.`,
77
+ ].filter((block) => block !== "").join("\n\n");
78
+ }
79
+ /** A character's last lines of their diary, and what to write in it (DIA-3). */
80
+ function thoughtsText(lines, whatToWrite) {
81
+ const rule = `When you write in it: ${whatToWrite}.`;
82
+ return lines.length === 0 ? `Your diary: nothing yet. ${rule}` : `Your diary, the last lines:\n${lines.map((line) => `- ${line}`).join("\n")}\n${rule}`;
83
+ }
84
+ /** The character a character agent's view is for (VIEW-10), by name or alias; stops the command for any other page. */
85
+ export function characterNamed(world, name) {
86
+ if (name.trim() === "") {
87
+ throw new Error("Give as the name of a character's page, such as as Varro: whose view it is.");
88
+ }
89
+ const page = pagesWithNameOrAlias(world, parsePageReference(name).name)[0];
90
+ if (page?.type !== "character") {
91
+ throw new Error(page === undefined
92
+ ? `There is no character named ${name.trim()}: give as the name of a character's page, such as as Varro.`
93
+ : `${page.name} is ${withArticle(page.type ?? "free page")}: as takes a character, whose view it is.`);
94
+ }
95
+ return page;
96
+ }
@@ -0,0 +1,32 @@
1
+ import type { Context } from "../../core/context.ts";
2
+ import { type Coin } from "../../money/index.ts";
3
+ import { type Page, type World } from "../../pages/index.ts";
4
+ import type { GameSystem } from "../../systems/index.ts";
5
+ import { type Knowledge } from "../shared/characters/knowledge.ts";
6
+ import { type SheetValue } from "../shared/sheet/sheet.ts";
7
+ import type { ViewResult } from "./result.ts";
8
+ /** A page as the one whose view it is knows it (VIEW-3): its text, and the whole sheet when it is theirs or of their party. */
9
+ export declare function shownPage(root: string, context: Context, world: World, knowledge: Knowledge, page: Page, party: boolean): Extract<ViewResult, {
10
+ kind: "page";
11
+ }>;
12
+ /**
13
+ * The page the player character knows by this name, of the campaign or of the system, or by one of its aliases (VIEW-2): only one it knows, so that neither two
14
+ * pages of one name nor an alias tells that a page it does not know exists.
15
+ */
16
+ export declare function knownPage(world: World, knowledge: Knowledge, name: string): Page | undefined;
17
+ /** A name as the view may write it: one of a page the player character knows; undefined for any other, which the view tells another way (D-254). */
18
+ export declare function shownName(world: World, knowledge: Knowledge, name: unknown): string | undefined;
19
+ /** The page the player character knows by a name the log writes, of the campaign or of the system. */
20
+ export declare function knownNamedPage(world: World, knowledge: Knowledge, name: unknown): Page | undefined;
21
+ /** A place as a chapter of the story shows it (D-384): its kind and its picture, else that of the nearest place that holds it, as the player character knows them. */
22
+ export declare function placeLook(root: string, context: Context, world: World, knowledge: Knowledge, name: unknown): {
23
+ kind?: string;
24
+ picture?: {
25
+ file: string;
26
+ version: number;
27
+ };
28
+ };
29
+ /** The values of someone's line as data (DAT-2): as the line writes them, with a counter's limits, and beside the experience what the next level needs (PRO-6). */
30
+ export declare function lineValues(world: World, page: Page, counters: Record<string, unknown>): SheetValue[];
31
+ /** A value with its coins when it is money (MON-2), from the coin worth most, each with its metal when the game names it; as it was otherwise. */
32
+ export declare function valueCoins(value: SheetValue, coins: Coin[] | undefined, system: GameSystem | undefined): SheetValue;