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
package/dist/commands/config.js
CHANGED
|
@@ -9,24 +9,26 @@ import { files, isInside } from "../core/store.js";
|
|
|
9
9
|
import { comparableText } from "../core/text.js";
|
|
10
10
|
import { getVersion } from "../core/version.js";
|
|
11
11
|
import { readYamlValues } from "../core/yaml-file.js";
|
|
12
|
+
import { claudeSays, codexSays } from "../helpers/index.js";
|
|
12
13
|
import { hostInstructions } from "../instructions/index.js";
|
|
13
14
|
import { coinList, readAmount, readCoins } from "../money/index.js";
|
|
14
15
|
import { declaredKind } from "../pages/index.js";
|
|
15
|
-
import {
|
|
16
|
-
import { campaignDataNames, findCampaignSystem, findSystem, installedSystems, rulesetSetting, systemFileName, systemPackage } from "../systems/index.js";
|
|
16
|
+
import { campaignDataNames, findCampaignSystem, findSystem, readableSystems, rulesetSetting, systemFileName, systemPackage } from "../systems/index.js";
|
|
17
17
|
import { readCalendar, readCalendarStart } from "../time/index.js";
|
|
18
|
-
import { libraryAdditions, libraryRemovals, libraryShown, startLibraryReading } from "./
|
|
19
|
-
import { campaignMode, campaignNote } from "./
|
|
20
|
-
import { campaignCoins, coinsShown } from "./
|
|
21
|
-
import { askedBy, heldSystemSettings, isFixedSetting, isLeading, offeredValues, offerRefusal, playedEngineSetting, unofferedLines, valuePart } from "./
|
|
22
|
-
import { loadNewSystemCode } from "./
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
18
|
+
import { checkLibraryRemovals, libraryAdditions, libraryRemovals, libraryShown, startLibraryReading } from "./shared/library.js";
|
|
19
|
+
import { campaignMode, campaignNote } from "./shared/mode.js";
|
|
20
|
+
import { campaignCoins, coinsShown } from "./shared/money.js";
|
|
21
|
+
import { askedBy, heldSystemSettings, isFixedSetting, isLeading, offeredValues, offerRefusal, playedEngineSetting, unofferedLines, valuePart } from "./shared/offers.js";
|
|
22
|
+
import { loadNewSystemCode } from "./shared/packages/code.js";
|
|
23
|
+
import { checkWidgetSpots } from "./shared/packages/widgets.js";
|
|
24
|
+
import { mentorPart, stylePart } from "./shared/parts.js";
|
|
25
|
+
import { readOpenScene } from "./shared/scene.js";
|
|
26
|
+
import { campaignCalendar, newDatedLogEntry } from "./shared/time.js";
|
|
27
|
+
import { campaignSystem, campaignWorld, countedByGame, installedSystemName, playedRules, playedSettingValue, playersOfTheGame, systemLayers, systemSetting, valuesText } from "./shared/world.js";
|
|
28
28
|
// A use whose maximum reads what gives it, in quotes for its commas (CAM-1).
|
|
29
|
-
const counterExample = 'bulwark-dice: {max: "4 * has(features, Bulwark)", refill: rest}';
|
|
29
|
+
const counterExample = 'bulwark-dice: {max: "4 * has(features, Bulwark)", refill: {{rest}}}';
|
|
30
|
+
// The same in a message, which no system's names fill: its maximum alone.
|
|
31
|
+
const counterShape = 'bulwark-dice: {max: "4 * has(features, Bulwark)"}';
|
|
30
32
|
export const config = defineCommand({
|
|
31
33
|
name: "config",
|
|
32
34
|
description: "Show or change the campaign settings. "
|
|
@@ -69,29 +71,147 @@ export const config = defineCommand({
|
|
|
69
71
|
remove: z.array(z.string()).optional().describe(`items to remove from a list setting (${listSettingNames.join(", ")}), repeatable`),
|
|
70
72
|
computer: z.boolean().optional().describe("with library and remove: off this computer too, out of every campaign, its books' text deleted"),
|
|
71
73
|
}),
|
|
72
|
-
run(
|
|
73
|
-
|
|
74
|
+
run(given, context) {
|
|
75
|
+
const input = { ...given, setting: given.setting?.trim() };
|
|
76
|
+
if (input.computer !== undefined && (input.setting !== "library" || input.remove === undefined)) {
|
|
74
77
|
throw new Error("computer goes only with setting library and remove: it takes those folders off this computer. Nothing changed.");
|
|
75
78
|
}
|
|
76
79
|
// What the library holds is checked, and an addition allowed by the player, before it is written (LIB-1).
|
|
77
|
-
if (input.setting
|
|
80
|
+
if (input.setting === "library" && (input.add !== undefined || input.remove !== undefined)) {
|
|
78
81
|
return changeLibrary(input, context);
|
|
79
82
|
}
|
|
80
83
|
const result = configure(input, context);
|
|
81
84
|
// A system installed in this chat, as in the setup, brings its code once the campaign plays it (D-513 (1)).
|
|
82
|
-
return input.setting
|
|
85
|
+
return input.setting === "system" && input.value !== undefined ? loadNewSystemCode(context).then(() => result) : result;
|
|
83
86
|
},
|
|
84
87
|
format(result) {
|
|
85
88
|
const lines = Object.entries(result.settings).map(([name, value]) => `${name}: ${formatValue(value)}`);
|
|
86
89
|
return [[...lines, ...result.replaced].join("\n"), result.note, result.part ?? ""].filter((block) => block !== "").join("\n\n");
|
|
87
90
|
},
|
|
88
91
|
});
|
|
92
|
+
/**
|
|
93
|
+
* The setup's questions as the dashboard asks them (D-370), each with its value or items, if answered, and its values with what each means: the player's
|
|
94
|
+
* settings of the setup, how companions come, the preparation of a world not written, those the game system adds, then the lines and veils.
|
|
95
|
+
*/
|
|
96
|
+
export function setupQuestions(root, context, writtenWorld) {
|
|
97
|
+
const own = playerSettings(root, context);
|
|
98
|
+
const named = (name) => {
|
|
99
|
+
const setting = own.find((one) => one.name === name) ?? setupSettingNamed(root, name);
|
|
100
|
+
return setting === undefined ? [] : [setting];
|
|
101
|
+
};
|
|
102
|
+
const held = heldSystemSettings(root, context);
|
|
103
|
+
const system = held.map((setting) => setting.name);
|
|
104
|
+
const settings = readSettings(root);
|
|
105
|
+
const difficulty = settings.difficulty;
|
|
106
|
+
// The value a system's setting suggests (DAT-17).
|
|
107
|
+
const systemSuggests = Object.fromEntries(held.flatMap((setting) => setting.values.filter((value) => value.suggested === true).map((value) => [setting.name, value.value])));
|
|
108
|
+
const suggested = { ...suggestedValues, ...(difficulty === undefined ? {} : { lethality: suggestedLethality[difficulty] ?? "dice" }), ...systemSuggests };
|
|
109
|
+
// The system's settings others depend on right after the mentor, before what they change (DAT-16, DAT-17).
|
|
110
|
+
const leading = held.filter(isLeading).map((setting) => setting.name);
|
|
111
|
+
const order = setupOrder.filter((name) => name !== "preparation" || !writtenWorld);
|
|
112
|
+
const others = system.filter((name) => !leading.includes(name));
|
|
113
|
+
return [...order.slice(0, 1), ...leading, ...order.slice(1), ...others, "lines", "veils"].flatMap(named).map((question) => {
|
|
114
|
+
const suggestion = suggested[question.name];
|
|
115
|
+
// A suggestion the game does not offer is none (DAT-16).
|
|
116
|
+
const offered = suggestion !== undefined && (question.choices === undefined || question.choices.some((choice) => choice.value === suggestion));
|
|
117
|
+
return { ...(question.name === "mentor" ? mentorQuestion(question) : unsetUnanswered(question, settings)), ...(offered ? { suggested: suggestion } : {}) };
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
/** A setting only the setup lets the dashboard change (D-370): how companions come, the preparation, the name; undefined for any other. */
|
|
121
|
+
export function setupSettingNamed(root, name) {
|
|
122
|
+
const key = Object.keys(setupWords).find((one) => comparableText(one) === comparableText(name));
|
|
123
|
+
if (key === undefined) {
|
|
124
|
+
return undefined;
|
|
125
|
+
}
|
|
126
|
+
const words = setupWords[key];
|
|
127
|
+
const value = readSettings(root)[key];
|
|
128
|
+
return {
|
|
129
|
+
name: key,
|
|
130
|
+
about: words.about,
|
|
131
|
+
...(typeof value === "string" ? { value } : {}),
|
|
132
|
+
...(words.values === undefined ? {} : { choices: words.values.map((one) => ({ value: one, ...(words.means?.[one] === undefined ? {} : { means: words.means[one] }) })) }),
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/** The player's settings as the dashboard shows them (D-341): with what this computer lacks, as pictures without Codex, asked again. */
|
|
136
|
+
export function shownPlayerSettings(root, context) {
|
|
137
|
+
return playerSettings(root, context).map((setting) => (setting.name === "pictures" ? { ...setting, ...picturesReadyNote(context) } : setting));
|
|
138
|
+
}
|
|
139
|
+
/** The player's settings with their values, then those the game system adds (D-341). */
|
|
140
|
+
export function playerSettings(root, context) {
|
|
141
|
+
const settings = readSettings(root);
|
|
142
|
+
const own = heldSystemSettings(root, context).map((setting) => {
|
|
143
|
+
const value = playedSettingValue(root, context, setting);
|
|
144
|
+
const choices = setting.values.map((one) => ({ value: one.value, ...(one.player === undefined ? {} : { means: one.player }) }));
|
|
145
|
+
return { name: setting.name, about: setting.about ?? "a setting of the game system", ...(value === undefined ? {} : { value }), choices };
|
|
146
|
+
});
|
|
147
|
+
return [
|
|
148
|
+
...playerSettingNames.map((name) => {
|
|
149
|
+
const words = playerWords[name];
|
|
150
|
+
const value = settings[name] ?? words.unset;
|
|
151
|
+
const choices = words.values?.map((one) => ({ value: one, ...(words.means?.[one] === undefined ? {} : { means: words.means[one] }) }));
|
|
152
|
+
return {
|
|
153
|
+
name,
|
|
154
|
+
about: words.about,
|
|
155
|
+
...(Array.isArray(value) ? { items: value.map(String) } : value === undefined || value === null ? {} : { value: String(value) }),
|
|
156
|
+
...(choices === undefined ? {} : { choices }),
|
|
157
|
+
...(words.most === undefined ? {} : { most: words.most }),
|
|
158
|
+
};
|
|
159
|
+
}).flatMap((setting) => offeredSetting(root, context, setting)),
|
|
160
|
+
...own,
|
|
161
|
+
];
|
|
162
|
+
}
|
|
163
|
+
/** One of the player's settings by its name, in any case, as the dashboard changes them (D-341); undefined for a setting of the master's or none. */
|
|
164
|
+
export function playerSettingNamed(root, context, name) {
|
|
165
|
+
return playerSettings(root, context).find((setting) => comparableText(setting.name) === comparableText(name));
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* What the master hears, at the head of their next call, of a setting the player changed on the dashboard (D-341): how it is now against how it was before the
|
|
169
|
+
* player's first change since their last call, a value with what it means to the master; nothing for one that came back as it was.
|
|
170
|
+
*/
|
|
171
|
+
export function playerChangeNews(root, context, before, after) {
|
|
172
|
+
if (before.items !== undefined || after.items !== undefined) {
|
|
173
|
+
const added = (after.items ?? []).filter((item) => !(before.items ?? []).includes(item));
|
|
174
|
+
const removed = (before.items ?? []).filter((item) => !(after.items ?? []).includes(item));
|
|
175
|
+
return [
|
|
176
|
+
...(added.length === 0 ? [] : [`The player added ${quotedItems(added)} to ${after.name} on the dashboard: ${addedText(after)}.`]),
|
|
177
|
+
...(removed.length === 0 ? [] : [`The player took ${quotedItems(removed)} off ${after.name} on the dashboard${takenOffText(after.name)}.`]),
|
|
178
|
+
];
|
|
179
|
+
}
|
|
180
|
+
if (after.value === before.value) {
|
|
181
|
+
return [];
|
|
182
|
+
}
|
|
183
|
+
// The master's effort is no rule of play: it changes how the next chat thinks, never this one (D-462).
|
|
184
|
+
if (after.name === "effort") {
|
|
185
|
+
return [`The player set how much you think to ${after.value ?? "their app's own"} on the dashboard: it applies from their next chat; nothing to do now.`];
|
|
186
|
+
}
|
|
187
|
+
// How the master writes comes with its parts as they are now, on a line of their own: the same for each of them the player changed (D-395).
|
|
188
|
+
const style = styleSettingNames.includes(after.name) ? stylePart(root, context) : "";
|
|
189
|
+
if (after.value === undefined) {
|
|
190
|
+
const cleared = wordsOf(after.name)?.cleared;
|
|
191
|
+
return cleared === undefined ? [] : [`The player took ${after.name} away on the dashboard: ${cleared}. Play by it from now on.`, ...(style === "" ? [] : [style])];
|
|
192
|
+
}
|
|
193
|
+
const meaning = settingMeaning(after.name, after.value, countedByGame(campaignSystem(root, context))) ?? systemSetting(root, context, after.name)?.values.find((one) => one.value === after.value)?.means;
|
|
194
|
+
const value = after.most === undefined ? after.value : `"${after.value}"`;
|
|
195
|
+
const author = after.name === "prose" && readSettings(root).author !== undefined ? " An author is written: theirs takes its place until the player takes it away." : "";
|
|
196
|
+
// The mentor's new part comes with it, once in the chat (D-347); in play, a value of the system's with its own part (DAT-18).
|
|
197
|
+
const own = systemSetting(root, context, after.name) === undefined || campaignMode(root, campaignWorld(root, context)) !== "play" ? undefined : valuePart(root, context, after.name, after.value);
|
|
198
|
+
const part = after.name === "mentor" ? mentorPart(root, context, after.value) : (own ?? "");
|
|
199
|
+
return [
|
|
200
|
+
`The player set ${after.name} to ${value} on the dashboard${meaning === undefined ? "" : `: ${meaning}`}. Play by it from now on.${author}${part === "" ? "" : `\n\n${part}`}`,
|
|
201
|
+
...unofferedLines(root, context),
|
|
202
|
+
...(style === "" ? [] : [style]),
|
|
203
|
+
];
|
|
204
|
+
}
|
|
89
205
|
/**
|
|
90
206
|
* The library changed (LIB-1, LIB-3): additions as full paths, added to this computer first, from the chat with the player's yes; removals by any spelling of
|
|
91
207
|
* their path, off this computer too with computer; then the new books read apart.
|
|
92
208
|
*/
|
|
93
209
|
async function changeLibrary(input, context) {
|
|
94
210
|
const root = requireCampaign(context.folder);
|
|
211
|
+
// A removal refused writes nothing: checked before an addition reaches this computer's library.
|
|
212
|
+
if (input.remove !== undefined) {
|
|
213
|
+
checkLibraryRemovals(root, context, input.remove, input.computer === true);
|
|
214
|
+
}
|
|
95
215
|
const add = input.add === undefined ? undefined : await libraryAdditions(root, context, input.add);
|
|
96
216
|
const remove = input.remove === undefined ? undefined : libraryRemovals(root, context, input.remove, input.computer === true);
|
|
97
217
|
// Taken off the computer only: the campaign did not use it.
|
|
@@ -116,7 +236,7 @@ function configure(input, context) {
|
|
|
116
236
|
throw new Error(`There is no setting "${input.setting}". The settings are: ${[...settingNames, ...added].join(", ")}.`);
|
|
117
237
|
}
|
|
118
238
|
if (input.add !== undefined && input.setting !== undefined && entrySettingNames.includes(checkSettingName(input.setting))) {
|
|
119
|
-
throw new Error(`"${input.setting}" takes entries by name as the value, such as setting counters, value '${
|
|
239
|
+
throw new Error(`"${input.setting}" takes entries by name as the value, such as setting counters, value '${counterShape}'; remove takes their names.`);
|
|
120
240
|
}
|
|
121
241
|
if (listChange && (input.setting === undefined || (input.value !== undefined && !entrySettingNames.includes(checkSettingName(input.setting))))) {
|
|
122
242
|
throw new Error('Give add or remove with a list setting and no value, such as setting lines, add "spiders".');
|
|
@@ -181,11 +301,8 @@ function configure(input, context) {
|
|
|
181
301
|
// The effort written where each app reads it in the campaign's folder (D-462).
|
|
182
302
|
if (input.setting?.trim() === "effort" && input.value !== undefined) {
|
|
183
303
|
const unwritten = writeEffortFiles(root, context.platform);
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
"Written for Claude Code and Codex: it applies from the next chat; in Codex only in a folder it trusts; an effort picked in the app for one chat wins there.",
|
|
187
|
-
...unwritten,
|
|
188
|
-
];
|
|
304
|
+
const written = "Written for Claude Code and Codex: it applies from the next chat; in Codex only in a folder it trusts; an effort picked in the app for one chat wins there.";
|
|
305
|
+
replaced = [...replaced, ...(unwritten.length === 0 ? [written] : unwritten)];
|
|
189
306
|
}
|
|
190
307
|
// The character agent written or taken away at once, not when the server starts again (D-490).
|
|
191
308
|
if (input.setting?.trim() === "voices" && input.value !== undefined) {
|
|
@@ -381,34 +498,6 @@ const mentorAnswers = { tutorial: "never played it", hints: "a little", off: "I
|
|
|
381
498
|
const suggestedValues = { saves: "checkpoint", rigor: "smooth", "master-rolls": "behind the screen", preparation: "on the fly" };
|
|
382
499
|
// The lethality the difficulty suggests (D-141).
|
|
383
500
|
const suggestedLethality = { story: "narrative", easy: "epic" };
|
|
384
|
-
/**
|
|
385
|
-
* The setup's questions as the dashboard asks them (D-370), each with its value or items, if answered, and its values with what each means: the player's
|
|
386
|
-
* settings of the setup, how companions come, the preparation of a world not written, those the game system adds, then the lines and veils.
|
|
387
|
-
*/
|
|
388
|
-
export function setupQuestions(root, context, writtenWorld) {
|
|
389
|
-
const own = playerSettings(root, context);
|
|
390
|
-
const named = (name) => {
|
|
391
|
-
const setting = own.find((one) => one.name === name) ?? setupSettingNamed(root, name);
|
|
392
|
-
return setting === undefined ? [] : [setting];
|
|
393
|
-
};
|
|
394
|
-
const held = heldSystemSettings(root, context);
|
|
395
|
-
const system = held.map((setting) => setting.name);
|
|
396
|
-
const settings = readSettings(root);
|
|
397
|
-
const difficulty = settings.difficulty;
|
|
398
|
-
// The value a system's setting suggests (DAT-17).
|
|
399
|
-
const systemSuggests = Object.fromEntries(held.flatMap((setting) => setting.values.filter((value) => value.suggested === true).map((value) => [setting.name, value.value])));
|
|
400
|
-
const suggested = { ...suggestedValues, ...(difficulty === undefined ? {} : { lethality: suggestedLethality[difficulty] ?? "dice" }), ...systemSuggests };
|
|
401
|
-
// The system's settings others depend on right after the mentor, before what they change (DAT-16, DAT-17).
|
|
402
|
-
const leading = held.filter(isLeading).map((setting) => setting.name);
|
|
403
|
-
const order = setupOrder.filter((name) => name !== "preparation" || !writtenWorld);
|
|
404
|
-
const others = system.filter((name) => !leading.includes(name));
|
|
405
|
-
return [...order.slice(0, 1), ...leading, ...order.slice(1), ...others, "lines", "veils"].flatMap(named).map((question) => {
|
|
406
|
-
const suggestion = suggested[question.name];
|
|
407
|
-
// A suggestion the game does not offer is none (DAT-16).
|
|
408
|
-
const offered = suggestion !== undefined && (question.choices === undefined || question.choices.some((choice) => choice.value === suggestion));
|
|
409
|
-
return { ...(question.name === "mentor" ? mentorQuestion(question) : unsetUnanswered(question, settings)), ...(offered ? { suggested: suggestion } : {}) };
|
|
410
|
-
});
|
|
411
|
-
}
|
|
412
501
|
/** A question whose value is only the one shown while it is unset, as master-rolls behind the screen (D-287): still unanswered in the setup. */
|
|
413
502
|
function unsetUnanswered(question, settings) {
|
|
414
503
|
const { value, ...unanswered } = question;
|
|
@@ -420,49 +509,6 @@ function mentorQuestion(question) {
|
|
|
420
509
|
const choices = (question.choices ?? []).map((choice) => ({ ...choice, label: mentorAnswers[choice.value] })).sort((one, other) => order.indexOf(one.value) - order.indexOf(other.value));
|
|
421
510
|
return { ...question, question: "How well do you know this game?", about: "the master teaches it as much as you need", choices };
|
|
422
511
|
}
|
|
423
|
-
/** A setting only the setup lets the dashboard change (D-370): how companions come, the preparation, the name; undefined for any other. */
|
|
424
|
-
export function setupSettingNamed(root, name) {
|
|
425
|
-
const key = Object.keys(setupWords).find((one) => comparableText(one) === comparableText(name));
|
|
426
|
-
if (key === undefined) {
|
|
427
|
-
return undefined;
|
|
428
|
-
}
|
|
429
|
-
const words = setupWords[key];
|
|
430
|
-
const value = readSettings(root)[key];
|
|
431
|
-
return {
|
|
432
|
-
name: key,
|
|
433
|
-
about: words.about,
|
|
434
|
-
...(typeof value === "string" ? { value } : {}),
|
|
435
|
-
...(words.values === undefined ? {} : { choices: words.values.map((one) => ({ value: one, ...(words.means?.[one] === undefined ? {} : { means: words.means[one] }) })) }),
|
|
436
|
-
};
|
|
437
|
-
}
|
|
438
|
-
/** The player's settings as the dashboard shows them (D-341): with what this computer lacks, as pictures without Codex, asked again. */
|
|
439
|
-
export function shownPlayerSettings(root, context) {
|
|
440
|
-
return playerSettings(root, context).map((setting) => (setting.name === "pictures" ? { ...setting, ...picturesReadyNote(context) } : setting));
|
|
441
|
-
}
|
|
442
|
-
/** The player's settings with their values, then those the game system adds (D-341). */
|
|
443
|
-
export function playerSettings(root, context) {
|
|
444
|
-
const settings = readSettings(root);
|
|
445
|
-
const own = heldSystemSettings(root, context).map((setting) => {
|
|
446
|
-
const value = playedSettingValue(root, context, setting);
|
|
447
|
-
const choices = setting.values.map((one) => ({ value: one.value, ...(one.player === undefined ? {} : { means: one.player }) }));
|
|
448
|
-
return { name: setting.name, about: setting.about ?? "a setting of the game system", ...(value === undefined ? {} : { value }), choices };
|
|
449
|
-
});
|
|
450
|
-
return [
|
|
451
|
-
...playerSettingNames.map((name) => {
|
|
452
|
-
const words = playerWords[name];
|
|
453
|
-
const value = settings[name] ?? words.unset;
|
|
454
|
-
const choices = words.values?.map((one) => ({ value: one, ...(words.means?.[one] === undefined ? {} : { means: words.means[one] }) }));
|
|
455
|
-
return {
|
|
456
|
-
name,
|
|
457
|
-
about: words.about,
|
|
458
|
-
...(Array.isArray(value) ? { items: value.map(String) } : value === undefined || value === null ? {} : { value: String(value) }),
|
|
459
|
-
...(choices === undefined ? {} : { choices }),
|
|
460
|
-
...(words.most === undefined ? {} : { most: words.most }),
|
|
461
|
-
};
|
|
462
|
-
}).flatMap((setting) => offeredSetting(root, context, setting)),
|
|
463
|
-
...own,
|
|
464
|
-
];
|
|
465
|
-
}
|
|
466
512
|
/** A player's setting as the game offers it (DAT-16): none where it plays one value alone; only the values it offers, and no value written that it does not. */
|
|
467
513
|
function offeredSetting(root, context, setting) {
|
|
468
514
|
const offered = offeredValues(root, context, setting.name);
|
|
@@ -489,48 +535,6 @@ function picturesReadyNote(context) {
|
|
|
489
535
|
function notReadyText(said) {
|
|
490
536
|
return said.fix ?? `${said.why}.`;
|
|
491
537
|
}
|
|
492
|
-
/** One of the player's settings by its name, in any case, as the dashboard changes them (D-341); undefined for a setting of the master's or none. */
|
|
493
|
-
export function playerSettingNamed(root, context, name) {
|
|
494
|
-
return playerSettings(root, context).find((setting) => comparableText(setting.name) === comparableText(name));
|
|
495
|
-
}
|
|
496
|
-
/**
|
|
497
|
-
* What the master hears, at the head of their next call, of a setting the player changed on the dashboard (D-341): how it is now against how it was before the
|
|
498
|
-
* player's first change since their last call, a value with what it means to the master; nothing for one that came back as it was.
|
|
499
|
-
*/
|
|
500
|
-
export function playerChangeNews(root, context, before, after) {
|
|
501
|
-
if (before.items !== undefined || after.items !== undefined) {
|
|
502
|
-
const added = (after.items ?? []).filter((item) => !(before.items ?? []).includes(item));
|
|
503
|
-
const removed = (before.items ?? []).filter((item) => !(after.items ?? []).includes(item));
|
|
504
|
-
return [
|
|
505
|
-
...(added.length === 0 ? [] : [`The player added ${quotedItems(added)} to ${after.name} on the dashboard: ${addedText(after)}.`]),
|
|
506
|
-
...(removed.length === 0 ? [] : [`The player took ${quotedItems(removed)} off ${after.name} on the dashboard${takenOffText(after.name)}.`]),
|
|
507
|
-
];
|
|
508
|
-
}
|
|
509
|
-
if (after.value === before.value) {
|
|
510
|
-
return [];
|
|
511
|
-
}
|
|
512
|
-
// The master's effort is no rule of play: it changes how the next chat thinks, never this one (D-462).
|
|
513
|
-
if (after.name === "effort") {
|
|
514
|
-
return [`The player set how much you think to ${after.value ?? "their app's own"} on the dashboard: it applies from their next chat; nothing to do now.`];
|
|
515
|
-
}
|
|
516
|
-
// How the master writes comes with its parts as they are now, on a line of their own: the same for each of them the player changed (D-395).
|
|
517
|
-
const style = styleSettingNames.includes(after.name) ? stylePart(root, context) : "";
|
|
518
|
-
if (after.value === undefined) {
|
|
519
|
-
const cleared = wordsOf(after.name)?.cleared;
|
|
520
|
-
return cleared === undefined ? [] : [`The player took ${after.name} away on the dashboard: ${cleared}. Play by it from now on.`, ...(style === "" ? [] : [style])];
|
|
521
|
-
}
|
|
522
|
-
const meaning = settingMeaning(after.name, after.value, countedByGame(campaignSystem(root, context))) ?? systemSetting(root, context, after.name)?.values.find((one) => one.value === after.value)?.means;
|
|
523
|
-
const value = after.most === undefined ? after.value : `"${after.value}"`;
|
|
524
|
-
const author = after.name === "prose" && readSettings(root).author !== undefined ? " An author is written: theirs takes its place until the player takes it away." : "";
|
|
525
|
-
// The mentor's new part comes with it, once in the chat (D-347); in play, a value of the system's with its own part (DAT-18).
|
|
526
|
-
const own = systemSetting(root, context, after.name) === undefined || campaignMode(root, campaignWorld(root, context)) !== "play" ? undefined : valuePart(root, context, after.name, after.value);
|
|
527
|
-
const part = after.name === "mentor" ? mentorPart(root, context, after.value) : (own ?? "");
|
|
528
|
-
return [
|
|
529
|
-
`The player set ${after.name} to ${value} on the dashboard${meaning === undefined ? "" : `: ${meaning}`}. Play by it from now on.${author}${part === "" ? "" : `\n\n${part}`}`,
|
|
530
|
-
...unofferedLines(root, context),
|
|
531
|
-
...(style === "" ? [] : [style]),
|
|
532
|
-
];
|
|
533
|
-
}
|
|
534
538
|
/** What an item the player added to a list means to the master: what the list holds, or what to do, as for learned. */
|
|
535
539
|
function addedText(setting) {
|
|
536
540
|
return wordsOf(setting.name)?.added ?? setting.about;
|
|
@@ -676,7 +680,7 @@ function calendarStartValue(root, context, value) {
|
|
|
676
680
|
* engine for one it ships without a package; missing or not installed, with those that are (D-167).
|
|
677
681
|
*/
|
|
678
682
|
function systemShown(root, system, context) {
|
|
679
|
-
const installed = `installed: ${
|
|
683
|
+
const installed = `installed: ${readableSystems(context.systemFolders).map((installedSystem) => installedSystem.name).join(", ") || "none"}`;
|
|
680
684
|
if (system === undefined) {
|
|
681
685
|
return `(missing; ${installed})`;
|
|
682
686
|
}
|
|
@@ -723,7 +727,7 @@ function formatValue(value) {
|
|
|
723
727
|
function entriesOf(setting, text) {
|
|
724
728
|
const value = yamlValue(text, "the entries", "name: value");
|
|
725
729
|
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
726
|
-
throw new Error(`${setting} takes entries by name, written as in system.yaml, such as ${setting === "counters" ? `'${
|
|
730
|
+
throw new Error(`${setting} takes entries by name, written as in system.yaml, such as ${setting === "counters" ? `'${counterShape}'` : '"name: value"'}. Nothing changed.`);
|
|
727
731
|
}
|
|
728
732
|
return value;
|
|
729
733
|
}
|
|
@@ -13,8 +13,8 @@ interface EffectResult {
|
|
|
13
13
|
}
|
|
14
14
|
export declare const effect: import("../core/registry.ts").Command<z.ZodObject<{
|
|
15
15
|
action: z.ZodEnum<{
|
|
16
|
-
add: "add";
|
|
17
16
|
end: "end";
|
|
17
|
+
add: "add";
|
|
18
18
|
}>;
|
|
19
19
|
page: z.ZodOptional<z.ZodString>;
|
|
20
20
|
name: z.ZodOptional<z.ZodString>;
|
package/dist/commands/effect.js
CHANGED
|
@@ -8,19 +8,18 @@ import { readCounter } from "../counters/index.js";
|
|
|
8
8
|
import { effectNamed, formatEffect, formatEnd, isSceneDuration, readEffect, readRounds, withEffect } from "../effects/index.js";
|
|
9
9
|
import { concernsPlayer, declaredKind, environmentAt, isDeclaredUncounted, isKind, isNeverInherited, isStandardField, parsePageReference, readFieldValue, textsIn } from "../pages/index.js";
|
|
10
10
|
import { addDuration, formatGameDate, readDuration } from "../time/index.js";
|
|
11
|
-
import { effectGiving, effectiveFields, effectsOf, valuesChanged, withEffects } from "./effect-layer.js";
|
|
12
|
-
import { checkEffectsReadable, endEffects, keptBy, saveEffects, systemNamed } from "./
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { aloneNote, computedField, counterLimits, directBonuses, itemSource, maximumSources } from "./worked-out.js";
|
|
11
|
+
import { effectGiving, effectiveFields, effectsOf, valuesChanged, withEffects } from "./shared/effect-layer.js";
|
|
12
|
+
import { checkEffectsReadable, endEffects, keptBy, saveEffects, systemNamed } from "./shared/effects.js";
|
|
13
|
+
import { fieldValues } from "./shared/inputs.js";
|
|
14
|
+
import { allSaid, packagesEffectAdded } from "./shared/packages/hooks.js";
|
|
15
|
+
import { keepingConditionNote, secondKeptNote } from "./shared/reminders.js";
|
|
16
|
+
import { houseRules, ruleBlock, ruleTitled } from "./shared/rules.js";
|
|
17
|
+
import { checkNotSystemPage, pageOrCopy, readOpenScene } from "./shared/scene.js";
|
|
18
|
+
import { newDatedLogEntry, presentDate } from "./shared/time.js";
|
|
19
|
+
import { burning, burnOne } from "./shared/upkeep.js";
|
|
20
|
+
import { aloneNote, computedField, counterLimits, directBonuses, itemSource, maximumSources } from "./shared/worked-out.js";
|
|
21
|
+
import { campaignSystem, campaignWorld, missingSystemHint, occasionsOf } from "./shared/world.js";
|
|
21
22
|
const actions = ["add", "end"];
|
|
22
|
-
// Values arrive as field=value strings from a command line, or as an object through MCP.
|
|
23
|
-
const fieldValues = z.union([z.array(z.string()), z.record(z.string(), z.unknown())]);
|
|
24
23
|
export const effect = defineCommand({
|
|
25
24
|
name: "effect",
|
|
26
25
|
description: "Put a condition or an effect on a character, a place or a copy in the open scene, or end one: frightened, prone, a spell, a form. "
|
package/dist/commands/find.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ export declare const find: import("../core/registry.ts").Command<z.ZodObject<{
|
|
|
5
5
|
place: "place";
|
|
6
6
|
quest: "quest";
|
|
7
7
|
creature: "creature";
|
|
8
|
+
item: "item";
|
|
8
9
|
character: "character";
|
|
9
10
|
faction: "faction";
|
|
10
|
-
item: "item";
|
|
11
11
|
event: "event";
|
|
12
12
|
topic: "topic";
|
|
13
13
|
}>>;
|
|
@@ -18,16 +18,16 @@ export declare const find: import("../core/registry.ts").Command<z.ZodObject<{
|
|
|
18
18
|
system: string | undefined;
|
|
19
19
|
systemMatches: {
|
|
20
20
|
page: string;
|
|
21
|
-
type: "place" | "quest" | "creature" | "
|
|
21
|
+
type: "place" | "quest" | "creature" | "item" | "character" | "faction" | "event" | "topic" | undefined;
|
|
22
22
|
excerpt: string | undefined;
|
|
23
23
|
}[];
|
|
24
24
|
systemMore: number;
|
|
25
25
|
systemMoreByName: number;
|
|
26
26
|
withText: boolean;
|
|
27
|
-
type: "place" | "quest" | "creature" | "
|
|
27
|
+
type: "place" | "quest" | "creature" | "item" | "character" | "faction" | "event" | "topic" | undefined;
|
|
28
28
|
matches: {
|
|
29
29
|
page: string;
|
|
30
|
-
type: "place" | "quest" | "creature" | "
|
|
30
|
+
type: "place" | "quest" | "creature" | "item" | "character" | "faction" | "event" | "topic" | undefined;
|
|
31
31
|
path: string;
|
|
32
32
|
excerpt: string | undefined;
|
|
33
33
|
}[];
|
package/dist/commands/find.js
CHANGED
|
@@ -2,8 +2,8 @@ import { z } from "zod";
|
|
|
2
2
|
import { requireCampaign } from "../campaign/index.js";
|
|
3
3
|
import { defineCommand } from "../core/registry.js";
|
|
4
4
|
import { pageTypeNames, searchPages, searchSystemPages } from "../pages/index.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { skippedPagesNote } from "./shared/notes.js";
|
|
6
|
+
import { campaignWorld, foreignSystemLanguage, systemSearchHint } from "./shared/world.js";
|
|
7
7
|
// The pages of the game system that find lists for one text; the others are counted.
|
|
8
8
|
const listedSystemPages = 10;
|
|
9
9
|
export const find = defineCommand({
|
package/dist/commands/image.js
CHANGED
|
@@ -7,12 +7,12 @@ import { files, isInside } from "../core/store.js";
|
|
|
7
7
|
import { comparableText, withArticle } from "../core/text.js";
|
|
8
8
|
import { imageFileName, imageLink, imagesFolderName, readImage } from "../images/index.js";
|
|
9
9
|
import { baseChain, findPage, isPartyMember, ownField, pageNamed, parsePageReference, writePage } from "../pages/index.js";
|
|
10
|
-
import { imageFile, ownImage } from "./
|
|
11
|
-
import { knowsPage, playerKnowledge } from "./
|
|
12
|
-
import { readOpenScene } from "./
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
10
|
+
import { imageFile, ownImage } from "./shared/images.js";
|
|
11
|
+
import { knowsPage, playerKnowledge } from "./shared/knowledge.js";
|
|
12
|
+
import { readOpenScene } from "./shared/scene.js";
|
|
13
|
+
import { sheetHeadline } from "./shared/sheet.js";
|
|
14
|
+
import { newDatedLogEntry } from "./shared/time.js";
|
|
15
|
+
import { campaignSystem, campaignWorld } from "./shared/world.js";
|
|
16
16
|
export const image = defineCommand({
|
|
17
17
|
name: "image",
|
|
18
18
|
description: "Give a page its picture: a portrait for a character, an image for a creature, an item or a place, as the dashboard will show it in a round token. "
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { type ImportStart, type ImportState } from "
|
|
2
|
+
import { type ImportStart, type ImportState } from "../../importer/index.ts";
|
|
3
3
|
interface ImportResult {
|
|
4
4
|
title: string;
|
|
5
5
|
state: ImportState;
|
|
@@ -24,7 +24,7 @@ interface ImportResult {
|
|
|
24
24
|
/** Begun now by a helper, named when known: the player hears whose plan reads the document, and under whose terms (D-493). */
|
|
25
25
|
helper?: "Claude Code" | "Codex" | "a helper";
|
|
26
26
|
}
|
|
27
|
-
export declare const importCommand: import("
|
|
27
|
+
export declare const importCommand: import("../../core/registry.ts").Command<z.ZodObject<{
|
|
28
28
|
document: z.ZodOptional<z.ZodString>;
|
|
29
29
|
title: z.ZodOptional<z.ZodString>;
|
|
30
30
|
character: z.ZodOptional<z.ZodString>;
|