rpg-engine 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adventures/index.d.ts +1 -1
- package/dist/adventures/index.js +1 -1
- package/dist/adventures/source.js +13 -13
- package/dist/campaign/create-campaign.js +10 -1
- package/dist/campaign/host-files.d.ts +2 -1
- package/dist/campaign/host-files.js +11 -11
- package/dist/campaign/index.d.ts +1 -1
- package/dist/campaign/index.js +1 -1
- package/dist/campaign/settings.d.ts +55 -64
- package/dist/campaign/settings.js +171 -174
- package/dist/{cli.js → cli/cli.js} +3 -3
- package/dist/{command-line.d.ts → cli/command-line.d.ts} +1 -1
- package/dist/{command-line.js → cli/command-line.js} +21 -20
- package/dist/commands/advance.d.ts +1 -1
- package/dist/commands/advance.js +7 -7
- package/dist/commands/ask.d.ts +1 -8
- package/dist/commands/ask.js +16 -29
- package/dist/commands/{change.d.ts → change/change.d.ts} +2 -2
- package/dist/commands/{change.js → change/change.js} +46 -52
- package/dist/commands/{game-damage.d.ts → change/damage.d.ts} +2 -2
- package/dist/commands/{game-damage.js → change/damage.js} +3 -3
- package/dist/commands/{game-recipe-pace.d.ts → change/recipe-pace.d.ts} +2 -2
- package/dist/commands/{game-recipe-pace.js → change/recipe-pace.js} +4 -4
- package/dist/commands/config.d.ts +4 -4
- package/dist/commands/config.js +142 -138
- package/dist/commands/effect.d.ts +1 -1
- package/dist/commands/effect.js +11 -12
- package/dist/commands/find.d.ts +4 -4
- package/dist/commands/find.js +2 -2
- package/dist/commands/image.js +6 -6
- package/dist/commands/{import.d.ts → import/import.d.ts} +2 -2
- package/dist/commands/{import.js → import/import.js} +101 -101
- package/dist/commands/{game-import.d.ts → import/run.d.ts} +3 -3
- package/dist/commands/{game-import.js → import/run.js} +13 -12
- package/dist/commands/index.js +7 -7
- package/dist/commands/init.js +3 -3
- package/dist/commands/install.js +1 -1
- package/dist/commands/instructions.js +6 -6
- package/dist/commands/mode.d.ts +2 -2
- package/dist/commands/mode.js +8 -8
- package/dist/commands/mood.js +4 -4
- package/dist/commands/move.js +13 -20
- package/dist/commands/package.d.ts +2 -2
- package/dist/commands/package.js +138 -93
- package/dist/commands/rename.js +3 -3
- package/dist/commands/reveal.js +29 -18
- package/dist/commands/{roll.d.ts → roll/roll.d.ts} +4 -4
- package/dist/commands/{roll.js → roll/roll.js} +69 -69
- package/dist/commands/{game-tables.d.ts → roll/tables.d.ts} +2 -2
- package/dist/commands/{game-tables.js → roll/tables.js} +4 -4
- package/dist/commands/rules.d.ts +2 -2
- package/dist/commands/rules.js +3 -3
- package/dist/commands/save.d.ts +1 -1
- package/dist/commands/save.js +18 -18
- package/dist/commands/scene.d.ts +4 -4
- package/dist/commands/scene.js +31 -28
- package/dist/commands/{game-advance.d.ts → shared/advance.d.ts} +4 -4
- package/dist/commands/{game-advance.js → shared/advance.js} +27 -27
- package/dist/commands/{game-adventures.d.ts → shared/adventures.d.ts} +3 -3
- package/dist/commands/{game-adventures.js → shared/adventures.js} +20 -27
- package/dist/commands/{game-bonds.d.ts → shared/bonds.d.ts} +3 -3
- package/dist/commands/{game-bonds.js → shared/bonds.js} +2 -2
- package/dist/commands/{game-checks.d.ts → shared/checks.d.ts} +3 -3
- package/dist/commands/{game-checks.js → shared/checks.js} +7 -7
- package/dist/commands/{game-dice-pool.d.ts → shared/dice-pool.d.ts} +3 -3
- package/dist/commands/{game-dice-pool.js → shared/dice-pool.js} +19 -12
- package/dist/commands/{effect-layer.d.ts → shared/effect-layer.d.ts} +2 -2
- package/dist/commands/{effect-layer.js → shared/effect-layer.js} +12 -12
- package/dist/commands/{game-effects.d.ts → shared/effects.d.ts} +7 -7
- package/dist/commands/{game-effects.js → shared/effects.js} +19 -19
- package/dist/commands/{game-environment.d.ts → shared/environment.d.ts} +1 -1
- package/dist/commands/{game-environment.js → shared/environment.js} +3 -3
- package/dist/commands/{game-events.d.ts → shared/events.d.ts} +5 -5
- package/dist/commands/{game-events.js → shared/events.js} +20 -22
- package/dist/commands/{game-examples.d.ts → shared/examples.d.ts} +4 -8
- package/dist/commands/{game-examples.js → shared/examples.js} +23 -23
- package/dist/commands/{game-experience.d.ts → shared/experience.d.ts} +2 -2
- package/dist/commands/{game-experience.js → shared/experience.js} +8 -11
- package/dist/commands/{game-grid-moves.d.ts → shared/grid-moves.d.ts} +6 -6
- package/dist/commands/{game-grid-moves.js → shared/grid-moves.js} +5 -5
- package/dist/commands/{game-grids.d.ts → shared/grids.d.ts} +4 -9
- package/dist/commands/{game-grids.js → shared/grids.js} +20 -19
- package/dist/commands/{game-images.d.ts → shared/images.d.ts} +3 -3
- package/dist/commands/{game-images.js → shared/images.js} +7 -6
- package/dist/commands/shared/inputs.d.ts +9 -0
- package/dist/commands/shared/inputs.js +12 -0
- package/dist/commands/{game-journey.d.ts → shared/journey.d.ts} +4 -6
- package/dist/commands/{game-journey.js → shared/journey.js} +13 -15
- package/dist/commands/{game-knowledge.d.ts → shared/knowledge.d.ts} +15 -8
- package/dist/commands/{game-knowledge.js → shared/knowledge.js} +42 -42
- package/dist/{library-reader.js → commands/shared/library-reader.js} +4 -4
- package/dist/commands/{game-library.d.ts → shared/library.d.ts} +7 -4
- package/dist/commands/{game-library.js → shared/library.js} +70 -50
- package/dist/commands/{game-limits.d.ts → shared/limits.d.ts} +3 -3
- package/dist/commands/{game-limits.js → shared/limits.js} +3 -3
- package/dist/commands/{game-loot.d.ts → shared/loot.d.ts} +2 -2
- package/dist/commands/{game-loot.js → shared/loot.js} +3 -3
- package/dist/commands/{game-master-rolls.d.ts → shared/master-rolls.d.ts} +2 -2
- package/dist/commands/{game-master-rolls.js → shared/master-rolls.js} +6 -6
- package/dist/commands/{game-mode.d.ts → shared/mode.d.ts} +4 -6
- package/dist/commands/{game-mode.js → shared/mode.js} +10 -10
- package/dist/commands/{game-money.d.ts → shared/money.d.ts} +3 -3
- package/dist/commands/{game-money.js → shared/money.js} +4 -4
- package/dist/commands/{game-moods.d.ts → shared/moods.d.ts} +3 -3
- package/dist/commands/{game-moods.js → shared/moods.js} +3 -3
- package/dist/commands/{game-moves.d.ts → shared/moves.d.ts} +2 -2
- package/dist/commands/{game-moves.js → shared/moves.js} +5 -5
- package/dist/commands/{game-offers.d.ts → shared/offers.d.ts} +3 -3
- package/dist/commands/{game-offers.js → shared/offers.js} +9 -12
- package/dist/commands/{game-outside.d.ts → shared/outside.d.ts} +3 -3
- package/dist/commands/{game-outside.js → shared/outside.js} +9 -9
- package/dist/commands/{game-catalog.d.ts → shared/packages/catalog.d.ts} +1 -3
- package/dist/commands/{game-catalog.js → shared/packages/catalog.js} +17 -22
- package/dist/commands/{game-package-code.d.ts → shared/packages/code.d.ts} +10 -14
- package/dist/commands/{game-package-code.js → shared/packages/code.js} +156 -59
- package/dist/commands/{game-extension-list.d.ts → shared/packages/extensions.d.ts} +6 -6
- package/dist/commands/{game-extension-list.js → shared/packages/extensions.js} +43 -22
- package/dist/commands/{game-package-hooks.d.ts → shared/packages/hooks.d.ts} +3 -3
- package/dist/commands/{game-package-hooks.js → shared/packages/hooks.js} +3 -3
- package/dist/commands/{game-widgets.d.ts → shared/packages/widgets.d.ts} +6 -10
- package/dist/commands/{game-widgets.js → shared/packages/widgets.js} +57 -57
- package/dist/commands/{page-counters.d.ts → shared/page-counters.d.ts} +3 -3
- package/dist/commands/{page-counters.js → shared/page-counters.js} +5 -5
- package/dist/{page-words.d.ts → commands/shared/page-words.d.ts} +2 -2
- package/dist/{page-words.js → commands/shared/page-words.js} +5 -4
- package/dist/commands/{parts.d.ts → shared/parts.d.ts} +3 -3
- package/dist/commands/{parts.js → shared/parts.js} +4 -4
- package/dist/commands/{game-positions.d.ts → shared/positions.d.ts} +3 -5
- package/dist/commands/{game-positions.js → shared/positions.js} +6 -7
- package/dist/commands/{problems.d.ts → shared/problems.d.ts} +3 -3
- package/dist/commands/{problems.js → shared/problems.js} +21 -22
- package/dist/commands/{progression.d.ts → shared/progression.d.ts} +2 -2
- package/dist/commands/{progression.js → shared/progression.js} +4 -4
- package/dist/commands/{game-quests.d.ts → shared/quests.d.ts} +4 -4
- package/dist/commands/{game-quests.js → shared/quests.js} +6 -6
- package/dist/commands/{game-recipes.d.ts → shared/recipes.d.ts} +3 -3
- package/dist/commands/{game-recipes.js → shared/recipes.js} +3 -3
- package/dist/commands/{game-reminders.d.ts → shared/reminders.d.ts} +4 -4
- package/dist/commands/{game-reminders.js → shared/reminders.js} +4 -4
- package/dist/commands/{game-roads.d.ts → shared/roads.d.ts} +5 -5
- package/dist/commands/{game-roads.js → shared/roads.js} +43 -44
- package/dist/commands/{game-rules.d.ts → shared/rules.d.ts} +2 -2
- package/dist/commands/{game-rules.js → shared/rules.js} +4 -4
- package/dist/commands/{game-saves.d.ts → shared/saves.d.ts} +4 -4
- package/dist/commands/{game-saves.js → shared/saves.js} +51 -51
- package/dist/commands/{game-scene.d.ts → shared/scene.d.ts} +13 -3
- package/dist/commands/{game-scene.js → shared/scene.js} +41 -13
- package/dist/commands/{sheet.d.ts → shared/sheet.d.ts} +5 -5
- package/dist/commands/{sheet.js → shared/sheet.js} +76 -76
- package/dist/commands/{game-stacks.d.ts → shared/stacks.d.ts} +2 -9
- package/dist/commands/{game-stacks.js → shared/stacks.js} +22 -22
- package/dist/commands/{game-theme.d.ts → shared/theme.d.ts} +3 -3
- package/dist/commands/{game-theme.js → shared/theme.js} +2 -2
- package/dist/commands/{game-thoughts.d.ts → shared/thoughts.d.ts} +2 -4
- package/dist/commands/{game-thoughts.js → shared/thoughts.js} +6 -8
- package/dist/commands/{game-thresholds.d.ts → shared/thresholds.d.ts} +1 -1
- package/dist/commands/{game-thresholds.js → shared/thresholds.js} +4 -4
- package/dist/commands/{game-time.d.ts → shared/time.d.ts} +4 -4
- package/dist/commands/{game-time.js → shared/time.js} +6 -6
- package/dist/commands/{game-turn-uses.d.ts → shared/turn-uses.d.ts} +3 -3
- package/dist/commands/{game-turn-uses.js → shared/turn-uses.js} +12 -15
- package/dist/commands/{game-upkeep.d.ts → shared/upkeep.d.ts} +3 -3
- package/dist/commands/{game-upkeep.js → shared/upkeep.js} +69 -57
- package/dist/commands/{game-voices.d.ts → shared/voices.d.ts} +1 -1
- package/dist/commands/{game-voices.js → shared/voices.js} +2 -2
- package/dist/commands/{worked-out.d.ts → shared/worked-out.d.ts} +3 -8
- package/dist/commands/{worked-out.js → shared/worked-out.js} +238 -238
- package/dist/commands/{game-world.d.ts → shared/world.d.ts} +5 -14
- package/dist/commands/{game-world.js → shared/world.js} +72 -76
- package/dist/commands/show.d.ts +1 -1
- package/dist/commands/show.js +32 -17
- package/dist/commands/status.d.ts +1 -1
- package/dist/commands/status.js +28 -28
- package/dist/commands/thoughts.js +3 -3
- package/dist/commands/trade.js +9 -10
- package/dist/commands/translate.d.ts +1 -1
- package/dist/commands/translate.js +3 -3
- package/dist/commands/{game-open.d.ts → travel/open.d.ts} +3 -3
- package/dist/commands/{game-open.js → travel/open.js} +4 -5
- package/dist/commands/{route.d.ts → travel/route.d.ts} +1 -1
- package/dist/commands/{route.js → travel/route.js} +9 -10
- package/dist/commands/{travel.d.ts → travel/travel.d.ts} +2 -2
- package/dist/commands/{travel.js → travel/travel.js} +19 -21
- package/dist/commands/validate.js +5 -5
- package/dist/commands/{game-view-journal.d.ts → view/journal.d.ts} +5 -5
- package/dist/commands/{game-view-journal.js → view/journal.js} +5 -5
- package/dist/commands/{game-view-map.d.ts → view/map.d.ts} +3 -3
- package/dist/commands/{game-view-map.js → view/map.js} +15 -16
- package/dist/commands/{game-view-place.d.ts → view/place.d.ts} +6 -6
- package/dist/commands/{game-view-place.js → view/place.js} +108 -108
- package/dist/commands/{view.d.ts → view/view.d.ts} +16 -16
- package/dist/commands/{view.js → view/view.js} +35 -35
- package/dist/commands/{game-view-world.d.ts → view/world.d.ts} +4 -4
- package/dist/commands/{game-view-world.js → view/world.js} +7 -7
- package/dist/commands/{game-here.d.ts → write/here.d.ts} +5 -3
- package/dist/commands/{game-here.js → write/here.js} +18 -12
- package/dist/commands/{write.d.ts → write/write.d.ts} +6 -6
- package/dist/commands/{write.js → write/write.js} +44 -41
- package/dist/confirm/confirm.d.ts +2 -0
- package/dist/confirm/confirm.js +15 -5
- package/dist/core/consents.d.ts +3 -2
- package/dist/core/consents.js +43 -4
- package/dist/core/context.d.ts +8 -6
- package/dist/core/context.js +4 -2
- package/dist/core/download.js +16 -5
- package/dist/core/files.d.ts +6 -1
- package/dist/core/files.js +47 -21
- package/dist/core/formula.d.ts +7 -2
- package/dist/core/formula.js +63 -66
- package/dist/core/instruction-parts.js +1 -1
- package/dist/core/mood.d.ts +0 -1
- package/dist/core/mood.js +3 -3
- package/dist/core/package-api.d.ts +11 -0
- package/dist/core/package-api.js +2 -1
- package/dist/core/package-declarations.d.ts +9 -9
- package/dist/core/package-declarations.js +3 -3
- package/dist/core/process-mark.d.ts +8 -0
- package/dist/core/process-mark.js +72 -0
- package/dist/core/registry.d.ts +5 -0
- package/dist/core/registry.js +10 -0
- package/dist/core/session-store.d.ts +0 -1
- package/dist/core/session-store.js +11 -14
- package/dist/core/store.d.ts +4 -0
- package/dist/core/store.js +29 -8
- package/dist/core/text.d.ts +4 -0
- package/dist/core/text.js +11 -2
- package/dist/core/yaml-file.js +2 -2
- package/dist/dashboard/{acts.js → acts/acts.js} +2 -2
- package/dist/dashboard/{act-names.js → acts/names.js} +1 -1
- package/dist/dashboard/{act-sheet.js → acts/sheet.js} +3 -3
- package/dist/dashboard/{act-strip.js → acts/strip.js} +2 -2
- package/dist/dashboard/app.js +13 -13
- package/dist/dashboard/asked.js +1 -1
- package/dist/dashboard/dice/burn.js +1 -1
- package/dist/dashboard/dice/stage.js +1 -1
- package/dist/dashboard/{guide-blocks.js → help/blocks.js} +1 -1
- package/dist/dashboard/{help.js → help/help.js} +6 -6
- package/dist/dashboard/journal.js +1 -1
- package/dist/dashboard/kit.js +6 -5
- package/dist/dashboard/labels.js +7 -3
- package/dist/dashboard/markdown.js +1 -1
- package/dist/dashboard/{ask-card.js → packages/ask-card.js} +6 -6
- package/dist/dashboard/{package-page.js → packages/package-page.js} +3 -3
- package/dist/dashboard/{packages.js → packages/packages.js} +12 -12
- package/dist/dashboard/{page-code.js → packages/page-code.js} +4 -4
- package/dist/dashboard/{extension-widgets.js → packages/widgets.js} +5 -5
- package/dist/dashboard/party.js +1 -1
- package/dist/dashboard/person-panel.js +2 -13
- package/dist/dashboard/{map-sheet.js → place/map-sheet.js} +4 -4
- package/dist/dashboard/{place-map-view.js → place/map-view.js} +11 -11
- package/dist/dashboard/scene.js +4 -4
- package/dist/dashboard/settings.js +1 -1
- package/dist/dashboard/sheet.js +3 -3
- package/dist/dashboard/top.js +2 -2
- package/dist/dashboard/turns.js +2 -2
- package/dist/dashboard/widgets.js +1 -1
- package/dist/dashboard/{world-calendar.js → world/calendar.js} +7 -7
- package/dist/dashboard/{lore.js → world/known.js} +1 -1
- package/dist/dashboard/{world-lore.js → world/lore.js} +9 -9
- package/dist/dashboard/{world-map.js → world/map.js} +1 -1
- package/dist/dashboard/{world.js → world/world.js} +14 -14
- package/dist/dice/evaluate.js +1 -1
- package/dist/dice/index.d.ts +2 -2
- package/dist/dice/index.js +2 -2
- package/dist/dice/notation.d.ts +2 -0
- package/dist/dice/notation.js +22 -4
- package/dist/documents/markup.js +2 -2
- package/dist/documents/read.js +29 -13
- package/dist/effects/effect.js +2 -5
- package/dist/extensions/extension.js +6 -8
- package/dist/extensions/index.d.ts +1 -4
- package/dist/extensions/index.js +1 -4
- package/dist/extensions/words.js +2 -1
- package/dist/{pictures → helpers}/briefs.js +17 -14
- package/dist/{pictures → helpers}/claude.js +8 -18
- package/dist/{pictures → helpers}/codex.js +3 -15
- package/dist/helpers/index.d.ts +7 -0
- package/dist/helpers/index.js +9 -0
- package/dist/{pictures/helpers.d.ts → helpers/programs.d.ts} +6 -1
- package/dist/{pictures/helpers.js → helpers/programs.js} +16 -2
- package/dist/images/images.js +7 -5
- package/dist/images/index.d.ts +1 -1
- package/dist/images/index.js +1 -1
- package/dist/importer/index.d.ts +1 -1
- package/dist/importer/index.js +1 -1
- package/dist/importer/work.d.ts +0 -2
- package/dist/importer/work.js +9 -30
- package/dist/instructions/index.d.ts +2 -0
- package/dist/instructions/index.js +10 -0
- package/dist/languages/index.d.ts +1 -1
- package/dist/languages/index.js +1 -1
- package/dist/languages/language-pack.js +15 -3
- package/dist/library/books.js +29 -83
- package/dist/{extensions → packages}/engine.d.ts +1 -1
- package/dist/{extensions → packages}/engine.js +1 -1
- package/dist/packages/index.d.ts +3 -0
- package/dist/packages/index.js +4 -0
- package/dist/{extensions/packages.d.ts → packages/npm.d.ts} +2 -0
- package/dist/{extensions/packages.js → packages/npm.js} +74 -45
- package/dist/page.d.ts +9 -11
- package/dist/page.js +1 -2
- package/dist/pages/check.js +31 -40
- package/dist/pages/containers.js +20 -20
- package/dist/pages/environment.js +15 -15
- package/dist/pages/index.d.ts +9 -9
- package/dist/pages/index.js +9 -9
- package/dist/pages/inheritance.d.ts +2 -1
- package/dist/pages/inheritance.js +24 -24
- package/dist/pages/load.js +7 -7
- package/dist/pages/maps.d.ts +20 -0
- package/dist/pages/maps.js +51 -1
- package/dist/pages/markdown.d.ts +2 -0
- package/dist/pages/markdown.js +110 -79
- package/dist/pages/page-file.d.ts +2 -1
- package/dist/pages/page-file.js +31 -29
- package/dist/pages/rename-page.d.ts +4 -1
- package/dist/pages/rename-page.js +7 -3
- package/dist/pages/{stack-entry.d.ts → stacks/entry.d.ts} +0 -2
- package/dist/pages/{stack-entry.js → stacks/entry.js} +2 -6
- package/dist/pages/{stacks.d.ts → stacks/kinds.d.ts} +8 -1
- package/dist/pages/{stacks.js → stacks/kinds.js} +36 -41
- package/dist/pages/{stack-writes.d.ts → stacks/writes.d.ts} +2 -2
- package/dist/pages/{stack-writes.js → stacks/writes.js} +32 -32
- package/dist/pages/system-pages.js +15 -15
- package/dist/pages/world.js +25 -19
- package/dist/pages/write-page.js +35 -34
- package/dist/player-notes/index.d.ts +1 -1
- package/dist/player-notes/index.js +1 -1
- package/dist/rules/page-search.js +3 -4
- package/dist/rules/rule-book.js +1 -1
- package/dist/rules/search.js +21 -21
- package/dist/rules/shown.js +1 -3
- package/dist/saves/saves.d.ts +2 -2
- package/dist/saves/saves.js +15 -3
- package/dist/{bell-listener.js → server/bell-listener.js} +3 -3
- package/dist/server/dashboard/files.d.ts +59 -0
- package/dist/server/dashboard/files.js +326 -0
- package/dist/server/dashboard/index.d.ts +114 -0
- package/dist/server/dashboard/index.js +419 -0
- package/dist/server/dashboard/news.d.ts +39 -0
- package/dist/server/dashboard/news.js +390 -0
- package/dist/server/dashboard/player.d.ts +48 -0
- package/dist/server/dashboard/player.js +242 -0
- package/dist/server/dashboard/ports.d.ts +10 -0
- package/dist/server/dashboard/ports.js +15 -0
- package/dist/server/dashboard/writes.d.ts +58 -0
- package/dist/server/dashboard/writes.js +492 -0
- package/dist/{mcp-server.d.ts → server/mcp.d.ts} +2 -2
- package/dist/{mcp-server.js → server/mcp.js} +57 -42
- package/dist/systems/game-system.d.ts +5 -3
- package/dist/systems/game-system.js +178 -149
- package/dist/systems/index.d.ts +1 -1
- package/dist/systems/index.js +1 -1
- package/dist/{testing.d.ts → testing/index.d.ts} +6 -6
- package/dist/{testing.js → testing/index.js} +32 -18
- package/dist/{system-checks.js → testing/system-checks.js} +18 -12
- package/dist/themes/theme.d.ts +3 -3
- package/dist/themes/theme.js +14 -14
- package/dist/time/calendar.js +5 -2
- package/dist/triggers/trigger.js +5 -8
- package/instructions/dashboard-guide.md +2 -1
- package/instructions/play.md +1 -1
- package/package.json +5 -5
- package/dist/commands/game-maps.d.ts +0 -20
- package/dist/commands/game-maps.js +0 -51
- package/dist/dashboard-server.d.ts +0 -47
- package/dist/dashboard-server.js +0 -1830
- package/dist/pictures/index.d.ts +0 -7
- package/dist/pictures/index.js +0 -9
- /package/dist/{cli.d.ts → cli/cli.d.ts} +0 -0
- /package/dist/{library-reader.d.ts → commands/shared/library-reader.d.ts} +0 -0
- /package/dist/commands/{notes.d.ts → shared/notes.d.ts} +0 -0
- /package/dist/commands/{notes.js → shared/notes.js} +0 -0
- /package/dist/dashboard/{guide-markdown.js → help/markdown.js} +0 -0
- /package/dist/dashboard/{pack-card.js → packages/card.js} +0 -0
- /package/dist/dashboard/{people.js → packages/people.js} +0 -0
- /package/dist/dashboard/{place-map.js → place/map.js} +0 -0
- /package/dist/dashboard/{calendar.js → world/days.js} +0 -0
- /package/dist/{pictures → helpers}/briefs.d.ts +0 -0
- /package/dist/{pictures → helpers}/chosen.d.ts +0 -0
- /package/dist/{pictures → helpers}/chosen.js +0 -0
- /package/dist/{pictures → helpers}/claude.d.ts +0 -0
- /package/dist/{pictures → helpers}/codex.d.ts +0 -0
- /package/dist/{pictures → helpers}/stop.d.ts +0 -0
- /package/dist/{pictures → helpers}/stop.js +0 -0
- /package/dist/{pictures → helpers}/svg.d.ts +0 -0
- /package/dist/{pictures → helpers}/svg.js +0 -0
- /package/dist/{extensions → packages}/tarball.d.ts +0 -0
- /package/dist/{extensions → packages}/tarball.js +0 -0
- /package/dist/{bell-listener.d.ts → server/bell-listener.d.ts} +0 -0
- /package/dist/{player-acts.d.ts → server/player-acts.d.ts} +0 -0
- /package/dist/{player-acts.js → server/player-acts.js} +0 -0
- /package/dist/{system-checks.d.ts → testing/system-checks.d.ts} +0 -0
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
// The extensions a campaign uses (D-27, D-28, D-427): those campaign.yaml lists, as installed, and their parts of the instructions over the system's (D-121).
|
|
2
2
|
import { basename, join, resolve } from "node:path";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import { campaignFileName, readOneSetting, readTextSetting } from "
|
|
5
|
-
import { packageCodeMayRun } from "
|
|
6
|
-
import { updateEngine } from "
|
|
7
|
-
import { files, isInside } from "
|
|
8
|
-
import { comparableText } from "
|
|
9
|
-
import { extensionWords, findExtension, hasConsent
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
4
|
+
import { campaignFileName, readOneSetting, readTextSetting } from "../../../campaign/index.js";
|
|
5
|
+
import { packageCodeMayRun } from "../../../core/consents.js";
|
|
6
|
+
import { updateEngine } from "../../../core/package-declarations.js";
|
|
7
|
+
import { files, isInside } from "../../../core/store.js";
|
|
8
|
+
import { comparableText } from "../../../core/text.js";
|
|
9
|
+
import { extensionWords, findExtension, hasConsent } from "../../../extensions/index.js";
|
|
10
|
+
import { isVerified } from "../../../packages/index.js";
|
|
11
|
+
import { isCoreField } from "../../../pages/index.js";
|
|
12
|
+
import { layeredSystemWords, systemApiProblem, systemContentFolders, systemPageModule, systemWords } from "../../../systems/index.js";
|
|
12
13
|
/**
|
|
13
14
|
* The extensions campaign.yaml lists (D-27), each as installed on this computer, in the order written: the nearest layer last. One not installed, that does not
|
|
14
15
|
* read, that needs another game system or has the name of another is left out, with its problem: the campaign plays without it.
|
|
@@ -26,7 +27,8 @@ export function extensionSources(root, context) {
|
|
|
26
27
|
export function listedExtensions(root) {
|
|
27
28
|
try {
|
|
28
29
|
const listed = readOneSetting(root, "extensions");
|
|
29
|
-
|
|
30
|
+
// A version written as a number, as 1.0, is the version all the same.
|
|
31
|
+
return z.record(z.string(), z.union([z.string(), z.number().transform(String)])).safeParse(listed).data ?? {};
|
|
30
32
|
}
|
|
31
33
|
catch {
|
|
32
34
|
return {};
|
|
@@ -82,19 +84,6 @@ export function campaignPageModules(root, context, system) {
|
|
|
82
84
|
}]);
|
|
83
85
|
return [...systems, ...extensions];
|
|
84
86
|
}
|
|
85
|
-
/** A package's words in the campaign's language, when it is written in another; none when they are not there or do not read, which validate says. */
|
|
86
|
-
function wordsIn(language, own, read) {
|
|
87
|
-
if (language === undefined || language.split("-")[0] === own.split("-")[0]) {
|
|
88
|
-
return {};
|
|
89
|
-
}
|
|
90
|
-
try {
|
|
91
|
-
const words = read();
|
|
92
|
-
return words === undefined || Object.keys(words).length === 0 ? {} : { words };
|
|
93
|
-
}
|
|
94
|
-
catch {
|
|
95
|
-
return {};
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
87
|
/** The address the dashboard serves a package's page module at: by the package's name and version, its folder's files beside it. */
|
|
99
88
|
export function pageAddress(name, version, file) {
|
|
100
89
|
return `/pkg/${encodeURIComponent(name)}/${encodeURIComponent(version)}/${encodeURIComponent(basename(file))}`;
|
|
@@ -121,6 +110,19 @@ export function extensionsLine(root, context) {
|
|
|
121
110
|
const { extensions } = campaignExtensions(root, context);
|
|
122
111
|
return extensions.length === 0 ? "" : `Extensions: ${extensions.map((extension) => `${extension.name} (${extension.about})`).join("; ")}.`;
|
|
123
112
|
}
|
|
113
|
+
/** A package's words in the campaign's language, when it is written in another; none when they are not there or do not read, which validate says. */
|
|
114
|
+
function wordsIn(language, own, read) {
|
|
115
|
+
if (language === undefined || language.split("-")[0] === own.split("-")[0]) {
|
|
116
|
+
return {};
|
|
117
|
+
}
|
|
118
|
+
try {
|
|
119
|
+
const words = read();
|
|
120
|
+
return words === undefined || Object.keys(words).length === 0 ? {} : { words };
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
return {};
|
|
124
|
+
}
|
|
125
|
+
}
|
|
124
126
|
/** The fields of the core an extension declares among its fields or counters, which no extension may declare (D-505). */
|
|
125
127
|
function coreFieldsOf(extension) {
|
|
126
128
|
return [...Object.keys(extension.adds.fields ?? {}), ...Object.keys(extension.adds.counters ?? {})].filter(isCoreField);
|
|
@@ -129,6 +131,14 @@ function readCampaignExtensions(root, context) {
|
|
|
129
131
|
const extensions = [];
|
|
130
132
|
const problems = [];
|
|
131
133
|
const system = readTextSetting(root, "system");
|
|
134
|
+
// A list written by hand, or a map that does not read, would leave the campaign without its extensions in silence.
|
|
135
|
+
if (extensionsUnread(root)) {
|
|
136
|
+
problems.push({
|
|
137
|
+
path: campaignFileName,
|
|
138
|
+
message: 'extensions in campaign.yaml does not read: it is a map of each package and its version, such as "@rpgengine/weather": "0.2.3"; the campaign plays without them.',
|
|
139
|
+
fix: "add each with package install",
|
|
140
|
+
});
|
|
141
|
+
}
|
|
132
142
|
for (const name of Object.keys(listedExtensions(root))) {
|
|
133
143
|
let extension;
|
|
134
144
|
try {
|
|
@@ -178,3 +188,14 @@ function readCampaignExtensions(root, context) {
|
|
|
178
188
|
}
|
|
179
189
|
return { extensions, problems };
|
|
180
190
|
}
|
|
191
|
+
/** Whether campaign.yaml writes extensions that do not read as a map of package and version, as a list. */
|
|
192
|
+
function extensionsUnread(root) {
|
|
193
|
+
try {
|
|
194
|
+
const written = readOneSetting(root, "extensions");
|
|
195
|
+
const none = written === undefined || written === null || (typeof written === "object" && !Array.isArray(written) && Object.keys(written).length === 0);
|
|
196
|
+
return !none && Object.keys(listedExtensions(root)).length === 0;
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
return false;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Context } from "
|
|
2
|
-
import type { CounterChange, Rolled } from "
|
|
3
|
-
import type { Told } from "
|
|
1
|
+
import type { Context } from "../../../core/context.ts";
|
|
2
|
+
import type { CounterChange, Rolled } from "../../../core/package-api.ts";
|
|
3
|
+
import type { Told } from "../../ask.ts";
|
|
4
4
|
/**
|
|
5
5
|
* What the packages' code said after a command's change: the system's lines, which may take the place of the engine's own note, as a death save does; the
|
|
6
6
|
* extensions' lines, which come after it; and apart why some did not run or failed, which the caller adds to its notes, never deciding by it.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { campaignSystemPackage, cappedLines, codeRefused, firstLine, gameOf, gameViewOf, loadedCode, packageLabel, toldOf } from "./
|
|
3
|
-
import {
|
|
1
|
+
import { campaignSystem } from "../world.js";
|
|
2
|
+
import { campaignSystemPackage, cappedLines, codeRefused, firstLine, gameOf, gameViewOf, loadedCode, packageLabel, toldOf } from "./code.js";
|
|
3
|
+
import { campaignExtensions } from "./extensions.js";
|
|
4
4
|
/** All the packages' code said, its problems last. */
|
|
5
5
|
export function allSaid(said) {
|
|
6
6
|
return [...said.lines, ...said.added, ...(said.problem === undefined ? [] : [said.problem])];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Context } from "
|
|
2
|
-
import type { CardTint, Widget, WidgetText, WidgetValue } from "
|
|
3
|
-
import { type
|
|
4
|
-
import type
|
|
5
|
-
import {
|
|
6
|
-
import { type
|
|
1
|
+
import type { Context } from "../../../core/context.ts";
|
|
2
|
+
import type { CardTint, Widget, WidgetText, WidgetValue } from "../../../core/package-api.ts";
|
|
3
|
+
import { type CardPage, type FigureSize } from "../../../core/package-api.ts";
|
|
4
|
+
import { type WidgetPlace } from "../../../core/package-declarations.ts";
|
|
5
|
+
import type { Problem } from "../../../core/problem.ts";
|
|
6
|
+
import { type CodePackage } from "../../../extensions/index.ts";
|
|
7
7
|
/** Where a widget stands: a place of the dashboard, with its page for a card in one, and its order among the cards there; or off. */
|
|
8
8
|
export interface WidgetSpot {
|
|
9
9
|
place: WidgetPlace | "off";
|
|
@@ -72,8 +72,6 @@ export type ShownPart = Exclude<NonNullable<Widget["parts"]>[number], {
|
|
|
72
72
|
};
|
|
73
73
|
alt: WidgetText;
|
|
74
74
|
};
|
|
75
|
-
/** The places a campaign may put a widget in, in campaign.yaml: top, side, a page, which is a card in that page, or off. */
|
|
76
|
-
export declare const widgetSpots: readonly [...("top" | "side" | "person")[], "scene", "sheet", "world", "journal", "off"];
|
|
77
75
|
/**
|
|
78
76
|
* The widgets of the campaign's packages, its game system's first, in the order of the packages and of their widgets, each where it stands and with what its
|
|
79
77
|
* hook shows now. The hooks run together, within one time for all; one that takes longer shows nothing this time, and is not called again while it works.
|
|
@@ -81,8 +79,6 @@ export declare const widgetSpots: readonly [...("top" | "side" | "person")[], "s
|
|
|
81
79
|
export declare function campaignWidgets(root: string, context: Context): Promise<ShownWidget[]>;
|
|
82
80
|
/** What keeps the words of the campaign's extensions from being read in its language, for validate: the file, and how to fix it (D-502). */
|
|
83
81
|
export declare function extensionWordsProblems(root: string, context: Context): Problem[];
|
|
84
|
-
/** The widgets of the campaign's packages by the names campaign.yaml gives them, as weather.today, with where each package puts it. */
|
|
85
|
-
export declare function campaignWidgetNames(root: string, context: Context): Record<string, WidgetSpot>;
|
|
86
82
|
/**
|
|
87
83
|
* Where campaign.yaml would put the widgets it names, checked before it is written: each a widget of the campaign's extensions, each place one of those the
|
|
88
84
|
* dashboard has. It throws what is wrong, and how to write it.
|
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
// never reaches the page: only what its hook gives.
|
|
4
4
|
import { basename } from "node:path";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
-
import { campaignFileName, readOneSetting, readTextSetting } from "
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { isInParty } from "
|
|
14
|
-
import {
|
|
15
|
-
import { campaignPackages, gameViewOf, packageCode } from "./
|
|
16
|
-
import {
|
|
6
|
+
import { campaignFileName, readOneSetting, readTextSetting } from "../../../campaign/index.js";
|
|
7
|
+
import { cardPages } from "../../../core/package-api.js";
|
|
8
|
+
import { widgetPlaces } from "../../../core/package-declarations.js";
|
|
9
|
+
import { files } from "../../../core/store.js";
|
|
10
|
+
import { comparableText } from "../../../core/text.js";
|
|
11
|
+
import { wordIn } from "../../../extensions/index.js";
|
|
12
|
+
import { findImage } from "../../../images/index.js";
|
|
13
|
+
import { isInParty } from "../../../pages/index.js";
|
|
14
|
+
import { campaignWorld } from "../world.js";
|
|
15
|
+
import { campaignPackages, gameViewOf, packageCode } from "./code.js";
|
|
16
|
+
import { campaignExtensions, packageWords, pageAddress, runsCode } from "./extensions.js";
|
|
17
17
|
/** The places a campaign may put a widget in, in campaign.yaml: top, side, a page, which is a card in that page, or off. */
|
|
18
|
-
|
|
18
|
+
const widgetSpots = [...widgetPlaces.filter((place) => place !== "page" && place !== "card"), ...cardPages, "off"];
|
|
19
19
|
// How long the hooks may take, all together, before the page goes on without those still at work, and the most a widget may give, as JSON.
|
|
20
20
|
const hookTime = 2000;
|
|
21
21
|
const mostShown = 12_000;
|
|
@@ -78,6 +78,50 @@ export function extensionWordsProblems(root, context) {
|
|
|
78
78
|
return problem === undefined ? [] : [{ path: campaignFileName, message: problem, fix: `or install it again with package install ${extension.name}` }];
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Where campaign.yaml would put the widgets it names, checked before it is written: each a widget of the campaign's extensions, each place one of those the
|
|
83
|
+
* dashboard has. It throws what is wrong, and how to write it.
|
|
84
|
+
*/
|
|
85
|
+
export function checkWidgetSpots(root, context, entries) {
|
|
86
|
+
const spots = campaignWidgetNames(root, context);
|
|
87
|
+
const known = Object.keys(spots);
|
|
88
|
+
for (const [name, value] of Object.entries(entries)) {
|
|
89
|
+
const own = Object.entries(spots).find(([one]) => comparableText(one) === comparableText(name))?.[1];
|
|
90
|
+
if (own === undefined) {
|
|
91
|
+
const names = known.length === 0 ? "the campaign's packages have none" : `the campaign's are ${known.join(", ")}`;
|
|
92
|
+
throw new Error(`There is no widget ${name}: ${names}. Write one as ${known[0] ?? "weather.today"}: side. Nothing changed.`);
|
|
93
|
+
}
|
|
94
|
+
// A widget made for each of the party shows only there, or nowhere, as its hook needs who (D-514); another may come there too (D-516).
|
|
95
|
+
const place = typeof value === "string" ? value : value !== null && typeof value === "object" && "place" in value ? value.place : undefined;
|
|
96
|
+
if (own.place === "person" && place !== "person" && place !== "off") {
|
|
97
|
+
throw new Error(`${name} stands on each of the party: write ${name}: off, or ${name}: person. Nothing changed.`);
|
|
98
|
+
}
|
|
99
|
+
if (own.place === "card") {
|
|
100
|
+
throw new Error(`${name} shows only in the card its package asks a roll in, so it has no place to choose: take ${name} out of widgets. Nothing changed.`);
|
|
101
|
+
}
|
|
102
|
+
if (!spotSchema.safeParse(value).success) {
|
|
103
|
+
// Of a place written as its parts, what is wrong with them, as an order that is no whole number.
|
|
104
|
+
const issue = value !== null && typeof value === "object" ? spotObject.safeParse(value).error?.issues[0] : undefined;
|
|
105
|
+
const why = issue === undefined ? "" : ` Here ${[...issue.path, ""].join(" ")}${issue.message}.`;
|
|
106
|
+
throw new Error(`${name} takes ${widgetSpots.join(", ")}, or {place, page, order}, such as ${name}: side.${why} Nothing changed.`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* What one widget of a package shows now, for the card of a question (D-507): read as the dashboard reads it, in the campaign's language; nothing when its
|
|
112
|
+
* hook is not there, fails, gives what no part draws, or is late.
|
|
113
|
+
*/
|
|
114
|
+
export async function widgetCard(root, context, extension, name, key, who) {
|
|
115
|
+
return await widgetFor(root, context, extension, name, { key, ...(who === undefined ? {} : { who }) });
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* What one widget of a package shows for a card of its page code, for the character the card shows (D-514): the package by its npm name, the widget declared
|
|
119
|
+
* by it; nothing when either is not the campaign's, or as for a card of a question.
|
|
120
|
+
*/
|
|
121
|
+
export async function packageWidget(root, context, packageName, name, who) {
|
|
122
|
+
const owner = campaignPackages(root, context).find((one) => one.package === packageName);
|
|
123
|
+
return owner === undefined || !owner.widgets.some((widget) => widget.name === name) ? undefined : await widgetFor(root, context, owner, name, who === undefined ? {} : { who });
|
|
124
|
+
}
|
|
81
125
|
/** A widget with what its hook shows now, or why it shows nothing: its code, a hook it lacks, a hook that failed or was late, what it gave. */
|
|
82
126
|
async function widgetNow(root, context, extension, name, base, loaded, words, late, party) {
|
|
83
127
|
const hook = "error" in loaded ? undefined : loaded.loaded?.widgets?.[name];
|
|
@@ -138,38 +182,9 @@ function hookCall(root, extension, widget, call) {
|
|
|
138
182
|
return started;
|
|
139
183
|
}
|
|
140
184
|
/** The widgets of the campaign's packages by the names campaign.yaml gives them, as weather.today, with where each package puts it. */
|
|
141
|
-
|
|
185
|
+
function campaignWidgetNames(root, context) {
|
|
142
186
|
return Object.fromEntries(campaignPackages(root, context).flatMap((extension) => extension.widgets.map((widget) => [`${extension.name}.${widget.name}`, ownSpot(widget)])));
|
|
143
187
|
}
|
|
144
|
-
/**
|
|
145
|
-
* Where campaign.yaml would put the widgets it names, checked before it is written: each a widget of the campaign's extensions, each place one of those the
|
|
146
|
-
* dashboard has. It throws what is wrong, and how to write it.
|
|
147
|
-
*/
|
|
148
|
-
export function checkWidgetSpots(root, context, entries) {
|
|
149
|
-
const spots = campaignWidgetNames(root, context);
|
|
150
|
-
const known = Object.keys(spots);
|
|
151
|
-
for (const [name, value] of Object.entries(entries)) {
|
|
152
|
-
const own = Object.entries(spots).find(([one]) => comparableText(one) === comparableText(name))?.[1];
|
|
153
|
-
if (own === undefined) {
|
|
154
|
-
const names = known.length === 0 ? "the campaign's packages have none" : `the campaign's are ${known.join(", ")}`;
|
|
155
|
-
throw new Error(`There is no widget ${name}: ${names}. Write one as ${known[0] ?? "weather.today"}: side. Nothing changed.`);
|
|
156
|
-
}
|
|
157
|
-
// A widget made for each of the party shows only there, or nowhere, as its hook needs who (D-514); another may come there too (D-516).
|
|
158
|
-
const place = typeof value === "string" ? value : value !== null && typeof value === "object" && "place" in value ? value.place : undefined;
|
|
159
|
-
if (own.place === "person" && place !== "person" && place !== "off") {
|
|
160
|
-
throw new Error(`${name} stands on each of the party: write ${name}: off, or ${name}: person. Nothing changed.`);
|
|
161
|
-
}
|
|
162
|
-
if (own.place === "card") {
|
|
163
|
-
throw new Error(`${name} shows only in the card its package asks a roll in, so it has no place to choose: take ${name} out of widgets. Nothing changed.`);
|
|
164
|
-
}
|
|
165
|
-
if (!spotSchema.safeParse(value).success) {
|
|
166
|
-
// Of a place written as its parts, what is wrong with them, as an order that is no whole number.
|
|
167
|
-
const issue = value !== null && typeof value === "object" ? spotObject.safeParse(value).error?.issues[0] : undefined;
|
|
168
|
-
const why = issue === undefined ? "" : ` Here ${[...issue.path, ""].join(" ")}${issue.message}.`;
|
|
169
|
-
throw new Error(`${name} takes ${widgetSpots.join(", ")}, or {place, page, order}, such as ${name}: side.${why} Nothing changed.`);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
188
|
// The places campaign.yaml may give a widget.
|
|
174
189
|
const spotPlaces = [...widgetPlaces.filter((place) => place !== "card"), "off"];
|
|
175
190
|
// The most and least order of a card among those of its place.
|
|
@@ -369,21 +384,6 @@ function shownTrack(track) {
|
|
|
369
384
|
const [held, marked, coming] = [fit(track.held), fit(track.marked), fit(track.coming)];
|
|
370
385
|
return { ...track, value, ...(held === undefined ? {} : { held }), ...(marked === undefined ? {} : { marked }), ...(coming === undefined ? {} : { coming }) };
|
|
371
386
|
}
|
|
372
|
-
/**
|
|
373
|
-
* What one widget of a package shows now, for the card of a question (D-507): read as the dashboard reads it, in the campaign's language; nothing when its
|
|
374
|
-
* hook is not there, fails, gives what no part draws, or is late.
|
|
375
|
-
*/
|
|
376
|
-
export async function widgetCard(root, context, extension, name, key, who) {
|
|
377
|
-
return await widgetFor(root, context, extension, name, { key, ...(who === undefined ? {} : { who }) });
|
|
378
|
-
}
|
|
379
|
-
/**
|
|
380
|
-
* What one widget of a package shows for a card of its page code, for the character the card shows (D-514): the package by its npm name, the widget declared
|
|
381
|
-
* by it; nothing when either is not the campaign's, or as for a card of a question.
|
|
382
|
-
*/
|
|
383
|
-
export async function packageWidget(root, context, packageName, name, who) {
|
|
384
|
-
const owner = campaignPackages(root, context).find((one) => one.package === packageName);
|
|
385
|
-
return owner === undefined || !owner.widgets.some((widget) => widget.name === name) ? undefined : await widgetFor(root, context, owner, name, who === undefined ? {} : { who });
|
|
386
|
-
}
|
|
387
387
|
/** What a widget shows for a card: for a question, by its key, the attempt; for a card of the page code, by who it shows. */
|
|
388
388
|
async function widgetFor(root, context, extension, name, asked) {
|
|
389
389
|
try {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type Coin } from "
|
|
2
|
-
import { type Page, type World } from "
|
|
3
|
-
import type { GameSystem } from "
|
|
1
|
+
import { type Coin } from "../../money/index.ts";
|
|
2
|
+
import { type Page, type World } from "../../pages/index.ts";
|
|
3
|
+
import type { GameSystem } from "../../systems/index.ts";
|
|
4
4
|
/**
|
|
5
5
|
* The counters of a page as the outputs show them, such as hp 5/12: all those it holds, and those it inherits written as current/max (D-116, as for copies in D-110).
|
|
6
6
|
* A statistic it inherits, such as ac 13, is read from its base. With the campaign's coins, its money too, held or inherited (MON-7).
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { comparableText, sameName } from "
|
|
2
|
-
import { readCounter } from "
|
|
3
|
-
import { formatAmount, readAmount } from "
|
|
4
|
-
import { declaredKind, isDeclaredUncounted, isEmptyField, isStandardField } from "
|
|
1
|
+
import { comparableText, sameName } from "../../core/text.js";
|
|
2
|
+
import { readCounter } from "../../counters/index.js";
|
|
3
|
+
import { formatAmount, readAmount } from "../../money/index.js";
|
|
4
|
+
import { declaredKind, isDeclaredUncounted, isEmptyField, isStandardField } from "../../pages/index.js";
|
|
5
5
|
import { effectiveFields, effectsOf } from "./effect-layer.js";
|
|
6
|
-
import { experienceOf, experienceText } from "./
|
|
6
|
+
import { experienceOf, experienceText } from "./experience.js";
|
|
7
7
|
import { counterOf } from "./sheet.js";
|
|
8
8
|
import { signedText } from "./worked-out.js";
|
|
9
9
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Context } from "
|
|
2
|
-
import { type SystemWords } from "
|
|
1
|
+
import type { Context } from "../../core/context.ts";
|
|
2
|
+
import { type SystemWords } from "../../systems/index.ts";
|
|
3
3
|
/** What the page has of a language: its phrases so far, whether they are being translated, whether this computer can, and how many it still lacks. */
|
|
4
4
|
export interface PageWords {
|
|
5
5
|
phrases: Record<string, string>;
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { dirname, join } from "node:path";
|
|
6
6
|
import { stringify } from "yaml";
|
|
7
|
-
import { files } from "
|
|
8
|
-
import { languagePackFor, packPhrases } from "
|
|
9
|
-
import { layeredSystemWords, systemContentFolders, systemWords } from "
|
|
7
|
+
import { files } from "../../core/store.js";
|
|
8
|
+
import { languagePackFor, packPhrases } from "../../languages/index.js";
|
|
9
|
+
import { layeredSystemWords, systemContentFolders, systemWords } from "../../systems/index.js";
|
|
10
10
|
// How many phrases go in one request.
|
|
11
11
|
const batchSize = 130;
|
|
12
12
|
// How long a language whose translation stopped short waits before it is tried again, so that a writer that fails is not called at every reading.
|
|
@@ -57,7 +57,8 @@ export function pageTranslator(context, page, notify) {
|
|
|
57
57
|
const waiting = context.now().getTime() - (stopped.get(language) ?? -pause) < pause;
|
|
58
58
|
if (can && !waiting && !running.has(language) && (missing > 0 || (system !== undefined && systemMissing(context.home, language, system)))) {
|
|
59
59
|
running.set(language, new Set());
|
|
60
|
-
|
|
60
|
+
// A translation that fails leaves the page in English, never the server down with it.
|
|
61
|
+
void run(language, system).catch(() => undefined).finally(() => {
|
|
61
62
|
running.delete(language);
|
|
62
63
|
stopped.set(language, context.now().getTime());
|
|
63
64
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Context } from "
|
|
2
|
-
import { type World } from "
|
|
3
|
-
import type { GameSystem } from "
|
|
1
|
+
import type { Context } from "../../core/context.ts";
|
|
2
|
+
import { type World } from "../../pages/index.ts";
|
|
3
|
+
import type { GameSystem } from "../../systems/index.ts";
|
|
4
4
|
/** A part of the instructions as the core and the system give it, with no regard to what was told; undefined when neither has it. */
|
|
5
5
|
export declare function partText(name: string, system: GameSystem | undefined): string | undefined;
|
|
6
6
|
/** A part of the instructions for a situation that opens: once in a chat where the MCP server keeps what it told, until instructions; every time elsewhere. Empty when there is none, or it was told. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// The parts of the master's instructions that the tools give when a situation opens, such as a fight or a new day (D-97, D-121).
|
|
2
|
-
import { readSettings } from "
|
|
3
|
-
import { corePart, layeredPart } from "
|
|
4
|
-
import { playerCharacters } from "
|
|
5
|
-
import { campaignSystem } from "./
|
|
2
|
+
import { readSettings } from "../../campaign/index.js";
|
|
3
|
+
import { corePart, layeredPart } from "../../instructions/index.js";
|
|
4
|
+
import { playerCharacters } from "../../pages/index.js";
|
|
5
|
+
import { campaignSystem } from "./world.js";
|
|
6
6
|
/** A part of the instructions as the core and the system give it, with no regard to what was told; undefined when neither has it. */
|
|
7
7
|
export function partText(name, system) {
|
|
8
8
|
const core = corePart(name);
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import type { Problem } from "
|
|
2
|
-
import { type Page, type Position, type World } from "
|
|
3
|
-
import { type Measures } from "./
|
|
1
|
+
import type { Problem } from "../../core/problem.ts";
|
|
2
|
+
import { type Page, type Position, type World } from "../../pages/index.ts";
|
|
3
|
+
import { type Measures } from "./roads.ts";
|
|
4
4
|
/** A region (POS-6): a place with a position and a radius, which covers the circle. */
|
|
5
5
|
export interface Region {
|
|
6
6
|
page: Page;
|
|
7
7
|
centre: Position;
|
|
8
8
|
radius: number;
|
|
9
9
|
}
|
|
10
|
-
/** How to write a relation, for messages. */
|
|
11
|
-
export declare const relationHelp = "a distance, a direction and a place with a position, such as 12 km NE of [[Guadoscuro]]";
|
|
12
10
|
/**
|
|
13
11
|
* Where a page is on the map (POS-4): the first of its chain, itself first, with a position: its own; for a stop, on the line between the nearest stops of its
|
|
14
12
|
* road that have one, by the lengths; undefined when none has one. A character or an item is where the place that holds it is.
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
// Positions in play (D-259, POS-1–POS-8): where a place is, its own position or one worked out; relations turned into a position; regions; what is near a point;
|
|
2
2
|
// each on its map, with the coordinates its map uses (D-320).
|
|
3
|
-
import { lengthHelp, readLength } from "
|
|
4
|
-
import { comparableText } from "
|
|
5
|
-
import { biomes, directionHelp, directionName, directionTo, distanceBetween, meanPoint, placeKinds, pointAlong, pointFrom, readDirection } from "
|
|
6
|
-
import { environmentAt, formatPosition, isEmptyField, locate, pageNamed, pagesWithName, parsePageReference, readPosition, readStops } from "
|
|
7
|
-
import {
|
|
8
|
-
import { lengthText, roadsOf } from "./game-roads.js";
|
|
3
|
+
import { lengthHelp, readLength } from "../../core/length.js";
|
|
4
|
+
import { comparableText } from "../../core/text.js";
|
|
5
|
+
import { biomes, directionHelp, directionName, directionTo, distanceBetween, meanPoint, placeKinds, pointAlong, pointFrom, readDirection } from "../../map/index.js";
|
|
6
|
+
import { environmentAt, formatPosition, isEmptyField, locate, mapKey, mapOf, pageNamed, pagesWithName, parsePageReference, readPosition, readStops, sameFrame } from "../../pages/index.js";
|
|
7
|
+
import { lengthText, roadsOf } from "./roads.js";
|
|
9
8
|
/** How to write a relation, for messages. */
|
|
10
|
-
|
|
9
|
+
const relationHelp = "a distance, a direction and a place with a position, such as 12 km NE of [[Guadoscuro]]";
|
|
11
10
|
/**
|
|
12
11
|
* Where a page is on the map (POS-4): the first of its chain, itself first, with a position: its own; for a stop, on the line between the nearest stops of its
|
|
13
12
|
* road that have one, by the lengths; undefined when none has one. A character or an item is where the place that holds it is.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Context } from "
|
|
2
|
-
import type { Problem } from "
|
|
3
|
-
import { type World } from "
|
|
1
|
+
import type { Context } from "../../core/context.ts";
|
|
2
|
+
import type { Problem } from "../../core/problem.ts";
|
|
3
|
+
import { type World } from "../../pages/index.ts";
|
|
4
4
|
/** Every problem in a campaign: its settings, its game system and coins, its log, its world, its pictures, its roads, its game time, its planned events, its effects and its open scene. */
|
|
5
5
|
export declare function campaignProblems(root: string, world: World, context: Context): Problem[];
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import { checkSettings } from "
|
|
2
|
-
import { checkLog } from "
|
|
3
|
-
import { checkWorld } from "
|
|
4
|
-
import { bondProblems } from "./
|
|
5
|
-
import { effectProblems } from "./
|
|
6
|
-
import { eventProblems } from "./
|
|
7
|
-
import { experienceProblems } from "./
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { shortRoadProblems } from "./
|
|
16
|
-
import { questProblems } from "./
|
|
17
|
-
import { passageProblems, roadProblems } from "./
|
|
18
|
-
import { readOpenScene, sceneProblems } from "./
|
|
19
|
-
import { themeProblems } from "./game-theme.js";
|
|
20
|
-
import { readPresent, timeProblems } from "./game-time.js";
|
|
21
|
-
import { extensionWordsProblems } from "./game-widgets.js";
|
|
22
|
-
import { campaignSystem, systemOccasions, systemProblems, systemSettingProblems } from "./game-world.js";
|
|
1
|
+
import { checkSettings } from "../../campaign/index.js";
|
|
2
|
+
import { checkLog } from "../../core/log.js";
|
|
3
|
+
import { checkWorld, mapProblems } from "../../pages/index.js";
|
|
4
|
+
import { bondProblems } from "./bonds.js";
|
|
5
|
+
import { effectProblems } from "./effects.js";
|
|
6
|
+
import { eventProblems } from "./events.js";
|
|
7
|
+
import { experienceProblems } from "./experience.js";
|
|
8
|
+
import { gridProblems } from "./grids.js";
|
|
9
|
+
import { imageProblems } from "./images.js";
|
|
10
|
+
import { limitProblems } from "./limits.js";
|
|
11
|
+
import { modeProblems } from "./mode.js";
|
|
12
|
+
import { moneyProblems } from "./money.js";
|
|
13
|
+
import { campaignExtensions } from "./packages/extensions.js";
|
|
14
|
+
import { extensionWordsProblems } from "./packages/widgets.js";
|
|
15
|
+
import { shortRoadProblems } from "./positions.js";
|
|
16
|
+
import { questProblems } from "./quests.js";
|
|
17
|
+
import { passageProblems, roadProblems } from "./roads.js";
|
|
18
|
+
import { readOpenScene, sceneProblems } from "./scene.js";
|
|
23
19
|
import { listValueProblems } from "./sheet.js";
|
|
20
|
+
import { themeProblems } from "./theme.js";
|
|
21
|
+
import { readPresent, timeProblems } from "./time.js";
|
|
24
22
|
import { workedOutProblems } from "./worked-out.js";
|
|
23
|
+
import { campaignSystem, systemOccasions, systemProblems, systemSettingProblems } from "./world.js";
|
|
25
24
|
/** Every problem in a campaign: its settings, its game system and coins, its log, its world, its pictures, its roads, its game time, its planned events, its effects and its open scene. */
|
|
26
25
|
export function campaignProblems(root, world, context) {
|
|
27
26
|
const system = systemProblems(root, context);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Problem } from "
|
|
2
|
-
import { type Page, type World } from "
|
|
1
|
+
import type { Problem } from "../../core/problem.ts";
|
|
2
|
+
import { type Page, type World } from "../../pages/index.ts";
|
|
3
3
|
/** A field the rows give, with its value and the items it comes from, such as rage-damage +2 from Barbarian 3 (PRO-2). */
|
|
4
4
|
export interface ProgressionValue {
|
|
5
5
|
field: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// What the classes of a character give (D-201, D-219, PRO-1–PRO-4): the row of each class's table at its level, and the features gained so far, with those its
|
|
2
2
|
// subclasses add. The tables are the pages' own; this is where the system's progression meets the pages of a world.
|
|
3
|
-
import { listItems } from "
|
|
4
|
-
import { comparableText, valueNamed } from "
|
|
5
|
-
import { pagesWithName, sectionTitles, systemPageNamed } from "
|
|
6
|
-
import { featureParts, fieldName, gainedFeatures, levelledFeatures, levelTable, mergedFeatures, rowFields } from "
|
|
3
|
+
import { listItems } from "../../core/formula.js";
|
|
4
|
+
import { comparableText, valueNamed } from "../../core/text.js";
|
|
5
|
+
import { pagesWithName, sectionTitles, systemPageNamed } from "../../pages/index.js";
|
|
6
|
+
import { featureParts, fieldName, gainedFeatures, levelledFeatures, levelTable, mergedFeatures, rowFields } from "../../progression/index.js";
|
|
7
7
|
/** What the classes in these fields give, by the system's progression; undefined when the system has none or the fields name no class (PRO-1). */
|
|
8
8
|
export function progressionOf(world, fields) {
|
|
9
9
|
const rule = world.system?.progression;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Context } from "
|
|
2
|
-
import type { Problem } from "
|
|
3
|
-
import { type Page, type World } from "
|
|
4
|
-
import { type GameDate } from "
|
|
1
|
+
import type { Context } from "../../core/context.ts";
|
|
2
|
+
import type { Problem } from "../../core/problem.ts";
|
|
3
|
+
import { type Page, type World } from "../../pages/index.ts";
|
|
4
|
+
import { type GameDate } from "../../time/index.ts";
|
|
5
5
|
/** What a quest measures (D-367): its counters with a maximum, its clock with its name, its deadline with the game minutes left, and whether it is the main one. */
|
|
6
6
|
export interface QuestMeasures {
|
|
7
7
|
main: boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { appendLogEntry } from "
|
|
2
|
-
import { comparableText } from "
|
|
3
|
-
import { readCounter } from "
|
|
4
|
-
import { everyGoalTicked, isEmptyField } from "
|
|
5
|
-
import { formatDuration, formatGameDate, minutesBetween, readGameDate } from "
|
|
6
|
-
import { newDatedLogEntry } from "./
|
|
1
|
+
import { appendLogEntry } from "../../core/log.js";
|
|
2
|
+
import { comparableText } from "../../core/text.js";
|
|
3
|
+
import { readCounter } from "../../counters/index.js";
|
|
4
|
+
import { everyGoalTicked, isEmptyField } from "../../pages/index.js";
|
|
5
|
+
import { formatDuration, formatGameDate, minutesBetween, readGameDate } from "../../time/index.js";
|
|
6
|
+
import { newDatedLogEntry } from "./time.js";
|
|
7
7
|
// What the master does with such a quest.
|
|
8
8
|
const advice = "if the story has ended it, write status done";
|
|
9
9
|
// The fields of a quest the journal shows apart; any other counter is a bar.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Effect } from "
|
|
2
|
-
import { type Page, type World } from "
|
|
3
|
-
import type { GameSystem, Recipe } from "
|
|
1
|
+
import type { Effect } from "../../effects/index.ts";
|
|
2
|
+
import { type Page, type World } from "../../pages/index.ts";
|
|
3
|
+
import type { GameSystem, Recipe } from "../../systems/index.ts";
|
|
4
4
|
/** The recipe of the game system with this name, with the system; refused, with those it has, when it has none. */
|
|
5
5
|
export declare function recipeNamed(system: GameSystem | undefined, name: string): {
|
|
6
6
|
system: GameSystem;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// The recipes of a game system (D-185, DAT-4): which pages a rest goes to, the effects it ends, the fields it brings back, and what it leaves to the master.
|
|
2
|
-
import { comparableText } from "
|
|
3
|
-
import { readCounter } from "
|
|
4
|
-
import { isDeclaredUncounted, isInParty, locate, playerCharacters } from "
|
|
2
|
+
import { comparableText } from "../../core/text.js";
|
|
3
|
+
import { readCounter } from "../../counters/index.js";
|
|
4
|
+
import { isDeclaredUncounted, isInParty, locate, playerCharacters } from "../../pages/index.js";
|
|
5
5
|
import { effectiveFields, effectsOf } from "./effect-layer.js";
|
|
6
6
|
import { formulaValue, refillAmount } from "./worked-out.js";
|
|
7
7
|
/** The recipe of the game system with this name, with the system; refused, with those it has, when it has none. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type Effect } from "
|
|
2
|
-
import type { Page, World } from "
|
|
3
|
-
import type { Scene } from "
|
|
4
|
-
import type { GameSystem } from "
|
|
1
|
+
import { type Effect } from "../../effects/index.ts";
|
|
2
|
+
import type { Page, World } from "../../pages/index.ts";
|
|
3
|
+
import type { Scene } from "../../scene/index.ts";
|
|
4
|
+
import type { GameSystem } from "../../systems/index.ts";
|
|
5
5
|
/** "Viola keeps Eroismo (Corrado): lost 7 hp. Read rules Concentration.": what someone keeps alive, when the counter the game system names goes down by `lost` (EFF-14). */
|
|
6
6
|
export declare function keepingLossNote(world: World, scene: Scene | undefined, system: GameSystem | undefined, name: string, field: string, lost: number): string;
|
|
7
7
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// What a fight asks the master to keep by hand, said when it happens (D-266): what can break what someone keeps alive (EFF-14), the effects at a turn and at a rest
|
|
2
2
|
// (EFF-15), the counter that shields another (DAT-14). The engine only says it: it ends and changes nothing by itself.
|
|
3
|
-
import { comparableText } from "
|
|
4
|
-
import { readCounter } from "
|
|
5
|
-
import { keeperOf } from "
|
|
3
|
+
import { comparableText } from "../../core/text.js";
|
|
4
|
+
import { readCounter } from "../../counters/index.js";
|
|
5
|
+
import { keeperOf } from "../../effects/index.js";
|
|
6
6
|
import { effectiveFields, effectsOf } from "./effect-layer.js";
|
|
7
|
-
import { effectsOn, keptEffectHolders, keptEffects, systemNamed } from "./
|
|
7
|
+
import { effectsOn, keptEffectHolders, keptEffects, systemNamed } from "./effects.js";
|
|
8
8
|
/** "Viola keeps Eroismo (Corrado): lost 7 hp. Read rules Concentration.": what someone keeps alive, when the counter the game system names goes down by `lost` (EFF-14). */
|
|
9
9
|
export function keepingLossNote(world, scene, system, name, field, lost) {
|
|
10
10
|
const keeping = system?.keeping;
|