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
@@ -0,0 +1,85 @@
1
+ // What a campaign or an extension adds to its system, merged over it (CAM-1, CAM-2)
2
+ import { comparableText } from "../core/text.js";
3
+ import { isMap, nameIn } from "./maps.js";
4
+ /** What a campaign may add to its game system in campaign.yaml (CAM-1): its own fields, tables, formulas, counters, recipes, line of the player character and travel. */
5
+ export const campaignDataNames = ["fields", "tables", "computed", "counters", "recipes", "status-line", "travel", "values", "condition-icons"];
6
+ /**
7
+ * A system's data with a campaign's additions over it (CAM-2): fields, tables, formulas and counters by name, the campaign's taking the place of the system's
8
+ * with that name; a recipe added to the system's of that name, field by field, with its occasions and rules; the line's fields after the system's; travel key
9
+ * by key, its paces, terrain, vehicles and kinds by name.
10
+ */
11
+ export function withCampaignData(raw, data) {
12
+ const base = isMap(raw) ? raw : {};
13
+ const merged = { ...base };
14
+ for (const key of ["fields", "tables", "computed", "counters", "condition-icons"]) {
15
+ const added = mapOf(data[key], key);
16
+ merged[key] = added === undefined ? base[key] : { ...withoutNames(isMap(base[key]) ? base[key] : {}, Object.keys(added)), ...added };
17
+ }
18
+ const recipes = mapOf(data.recipes, "recipes");
19
+ if (recipes !== undefined) {
20
+ const own = isMap(base.recipes) ? base.recipes : {};
21
+ merged.recipes = { ...own, ...Object.fromEntries(Object.entries(recipes).map(([recipe, added]) => [nameIn(own, recipe) ?? recipe, recipeWith(own[nameIn(own, recipe) ?? ""], added, recipe)])) };
22
+ }
23
+ const travel = mapOf(data.travel, "travel");
24
+ if (travel !== undefined) {
25
+ const own = isMap(base.travel) ? base.travel : {};
26
+ const byName = (key) => (isMap(travel[key]) ? { ...withoutNames(isMap(own[key]) ? own[key] : {}, Object.keys(travel[key])), ...travel[key] } : own[key]);
27
+ merged.travel = Object.fromEntries(Object.entries({ ...own, ...travel, paces: byName("paces"), terrain: byName("terrain"), vehicles: byName("vehicles"), kinds: byName("kinds") }).filter(([, value]) => value !== undefined));
28
+ }
29
+ const names = mapOf(data.values, "values");
30
+ if (names !== undefined) {
31
+ // A campaign's own names, as a language of its world, join the system's list, on the sheet or everywhere (D-435).
32
+ const onSheet = isMap(base["sheet-values"]) ? { ...base["sheet-values"] } : {};
33
+ const everywhere = isMap(base.values) ? { ...base.values } : {};
34
+ for (const [field, added] of Object.entries(names)) {
35
+ if (!Array.isArray(added)) {
36
+ throw new Error(`values.${field}: give the names the campaign adds as a list, such as ${field}: [Lingua dei Guadi].`);
37
+ }
38
+ const target = nameIn(onSheet, field) !== undefined ? onSheet : everywhere;
39
+ const key = nameIn(target, field) ?? field;
40
+ const own = Array.isArray(target[key]) ? target[key].map(String) : [];
41
+ target[key] = [...own, ...added.map(String).filter((name) => !own.some((other) => comparableText(other) === comparableText(name)))];
42
+ }
43
+ merged.values = everywhere;
44
+ merged["sheet-values"] = onSheet;
45
+ }
46
+ const line = data["status-line"];
47
+ if (line !== undefined && line !== null) {
48
+ if (!Array.isArray(line)) {
49
+ throw new Error("status-line: give it as a list of fields, such as [portent?].");
50
+ }
51
+ const own = Array.isArray(base["status-line"]) ? base["status-line"].map(String) : [];
52
+ const plain = (entry) => comparableText(entry.replace(/\?$/, ""));
53
+ const added = line.map(String).filter((entry, index, all) => all.findIndex((other) => plain(other) === plain(entry)) === index);
54
+ merged["status-line"] = [...own, ...added.filter((entry) => !own.some((other) => plain(other) === plain(entry)))];
55
+ }
56
+ return merged;
57
+ }
58
+ /** A system's recipe with a campaign's over it (CAM-2): what both set and regain, the campaign's first, and the occasions and rules of both. */
59
+ function recipeWith(own, added, name) {
60
+ if (!isMap(added)) {
61
+ throw new Error(`recipes.${name}: give it as what it sets, regains, ends and the rules to read, such as {set: {bulwark-dice: max}}.`);
62
+ }
63
+ const base = isMap(own) ? own : {};
64
+ const map = (key) => isMap(base[key]) || isMap(added[key]) ? { ...withoutNames(isMap(base[key]) ? base[key] : {}, Object.keys(isMap(added[key]) ? added[key] : {})), ...(isMap(added[key]) ? added[key] : {}) } : undefined;
65
+ const list = (key) => {
66
+ const items = [...(Array.isArray(base[key]) ? base[key] : []), ...(Array.isArray(added[key]) ? added[key] : [])];
67
+ return items.length === 0 ? undefined : items.filter((item, index) => items.findIndex((other) => comparableText(String(other)) === comparableText(String(item))) === index);
68
+ };
69
+ const merged = { ...base, ...added, set: map("set"), regain: map("regain"), lower: map("lower"), ends: list("ends"), rules: list("rules") };
70
+ return Object.fromEntries(Object.entries(merged).filter(([, value]) => value !== undefined));
71
+ }
72
+ /** An addition that must be a map by name, such as counters; undefined when the campaign gives none. */
73
+ function mapOf(value, key) {
74
+ if (value === undefined || value === null) {
75
+ return undefined;
76
+ }
77
+ if (!isMap(value)) {
78
+ throw new Error(`${key}: give it as a map by name, such as {bulwark-dice: ...}.`);
79
+ }
80
+ return value;
81
+ }
82
+ /** The entries of a map whose names are none of these, as names are compared. */
83
+ function withoutNames(map, names) {
84
+ return Object.fromEntries(Object.entries(map).filter(([name]) => !names.some((other) => comparableText(other) === comparableText(name))));
85
+ }
@@ -1,4 +1,4 @@
1
- import type { PackageCode } from "../core/package-api.ts";
1
+ import type { PackageCode } from "../core/packages/api.ts";
2
2
  /** A system's code as loaded: what it gives, or what kept it from loading; the version of its package, as it was loaded. */
3
3
  export type LoadedSystemCode = ({
4
4
  code: PackageCode;
@@ -14,9 +14,9 @@ import { pathToFileURL } from "node:url";
14
14
  import { z } from "zod";
15
15
  import { packageCodeMayRun } from "../core/consents.js";
16
16
  import { realPath } from "../core/files.js";
17
- import { apiProblem } from "../core/package-declarations.js";
17
+ import { apiProblem } from "../core/packages/declarations.js";
18
18
  import { isInside } from "../core/store.js";
19
- import { systemFolders } from "./system-folders.js";
19
+ import { systemFolders } from "./folders.js";
20
20
  /** A system's package.json of kind system; undefined for a folder without one, which is data alone. */
21
21
  export function systemPackage(folder) {
22
22
  const path = join(folder, "package.json");
@@ -1,8 +1,8 @@
1
- import { type FieldKind } from "../core/field-kind.ts";
2
- import { type Formula, type SystemFormulas } from "../core/formula.ts";
3
- import { type InstructionPart } from "../core/instruction-parts.ts";
4
- import { type ImperialUnits } from "../core/length.ts";
5
- import { type DeclaredWidget, type FigureSize } from "../core/package-declarations.ts";
1
+ import type { FieldKind } from "../core/field-kind.ts";
2
+ import type { Formula, SystemFormulas } from "../core/formula.ts";
3
+ import type { InstructionPart } from "../core/instruction-parts.ts";
4
+ import type { ImperialUnits } from "../core/length.ts";
5
+ import type { DeclaredWidget, FigureSize } from "../core/packages/declarations.ts";
6
6
  import type { ProgressionRule } from "../core/progression-rule.ts";
7
7
  /** The file that makes a folder a game system and says what it is. */
8
8
  export declare const systemFileName = "system.yaml";
@@ -388,64 +388,10 @@ export interface GameSystem {
388
388
  */
389
389
  parts: Record<string, InstructionPart>;
390
390
  }
391
- /** The settings of a system that hold, in its order (DAT-17): those no value asks, and those a value played asks; `valueOf` gives the value played. */
392
- export declare function heldSettings(system: GameSystem, valueOf: (setting: SystemSetting) => string | undefined): SystemSetting[];
393
- /** The value of a system's setting played, with what it offers and asks; undefined while it is to be chosen. */
394
- export declare function playedValueOf(setting: SystemSetting, valueOf: (setting: SystemSetting) => string | undefined): SystemSetting["values"][number] | undefined;
395
- /** What narrows the engine's settings (DAT-16): the system, then each value played, with whom to name. */
396
- export declare function engineOfferings(system: GameSystem, valueOf: (setting: SystemSetting) => string | undefined): {
397
- from: string;
398
- offers: Record<string, string[]>;
399
- }[];
400
- /** The values a game offers of an engine's setting (DAT-16): those the system and the values played share; undefined when none of them narrows it. */
401
- export declare function offeredEngineValues(system: GameSystem | undefined, valueOf: (setting: SystemSetting) => string | undefined, name: string): string[] | undefined;
402
- /** An engine's setting as a game plays it (DAT-16): the one value it offers, else the written one when it offers it; undefined while it is to be asked. */
403
- export declare function engineSettingValue(system: GameSystem | undefined, valueOf: (setting: SystemSetting) => string | undefined, name: string, written: unknown): unknown;
404
- /**
405
- * The system as a campaign plays it, with the values its settings have (DAT-10): the fields a value leaves out are gone from the sheet, the line, the experience
406
- * and the rewards. A setting without a value, or with one the system lacks, leaves out nothing.
407
- */
408
- export declare function withSettings(system: GameSystem, valueOf: (setting: string) => string | undefined): GameSystem;
409
391
  /**
410
392
  * The name the game gives a roll of these dice, in the language asked, else in the system's (D-399): 2d20kh1, or 2d20dl1, is "with advantage" in 5e; undefined
411
393
  * when the game names it not, or the dice are more than one kind.
412
394
  */
413
395
  export declare function rollName(system: GameSystem, dice: string, language: string): string | undefined;
414
- /** The systems installed in these folders, nearest folder first: each folder in them with a system.yaml. A name found twice is the nearest one. */
415
- export declare function installedSystems(folders: string[]): GameSystem[];
416
- /** The installed game systems that read, for a list of them: one whose system.yaml does not read stops no list, and the campaign that plays it hears why. */
417
- export declare function readableSystems(folders: string[]): GameSystem[];
418
- /** What campaign.yaml adds to the game system, as it writes it: checked when the system is read with it (CAM-3). */
419
- export type CampaignData = Partial<Record<(typeof campaignDataNames)[number], unknown>>;
420
- /** What an extension or the campaign adds to the game system (CAM-1, CAM-2): from where, as messages name it, and what. */
421
- export interface SystemLayer {
422
- from: string;
423
- data: CampaignData;
424
- }
425
- /**
426
- * The installed system with the layers over it, in order, the nearest to the campaign last and winning (CAM-2); a layer with which it does not read is left out,
427
- * with why, and the others stay (CAM-3). Undefined as a system when none is installed by that name.
428
- */
429
- export declare function findCampaignSystem(folders: string[], name: string, layers: SystemLayer[], ruleset?: string): {
430
- system?: GameSystem;
431
- refused: {
432
- from: string;
433
- problem: string;
434
- }[];
435
- };
436
- /**
437
- * The installed system with this name, ignoring case, from the nearest folder that has it, with the version of its rules asked, else its first (VER-2); undefined
438
- * when none is. Only its own system.yaml is read, and its version's.
439
- */
440
- export declare function findSystem(folders: string[], name: string, ruleset?: string): GameSystem | undefined;
441
- /** The game system in this folder by the name a campaign gives it, as installed, without a version of its rules; it throws when its system.yaml does not read. */
442
- export declare function systemInFolder(folder: string, name: string): GameSystem;
443
- /** The folders a system's pages, rules, words, pictures and instructions come from, in order: its own, then its version's, which wins by name (VER-3). */
444
- export declare function systemContentFolders(system: {
445
- folder: string;
446
- version?: {
447
- folder: string;
448
- };
449
- }): string[];
450
- /** What a campaign may add to its game system in campaign.yaml (CAM-1): its own fields, tables, formulas, counters, recipes, line of the player character and travel. */
451
- export declare const campaignDataNames: readonly ["fields", "tables", "computed", "counters", "recipes", "status-line", "travel", "values", "condition-icons"];
396
+ /** A roll's dice as a name reads them: in lower case, the highest or the lowest kept one when one of two is dropped, as 2d20dl1 is 2d20kh1. */
397
+ export declare function plainRoll(dice: string): string;