rpg-engine 0.7.0 → 0.9.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 +17 -9
- 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} +56 -44
- 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} +13 -5
- package/dist/commands/shared/rules.js +66 -0
- 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 +4 -1
- package/dist/commands/show.js +36 -18
- 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} +41 -36
- 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 +8 -1
- package/dist/core/files.js +53 -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/game-words.js +4 -4
- 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 +4 -4
- package/dist/dashboard/text.js +6 -0
- 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.d.ts +4 -0
- package/dist/pages/world.js +52 -20
- 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/commands/game-rules.js +0 -36
- 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,18 +1,18 @@
|
|
|
1
1
|
import { basename, extname, join, relative, resolve, sep } from "node:path";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { adventureFolderName } from "
|
|
4
|
-
import { changeSetting, readSettings, requireCampaign, storyWays } from "
|
|
5
|
-
import { appendLogEntry } from "
|
|
6
|
-
import { defineCommand } from "
|
|
7
|
-
import { documentAt, readDocument } from "
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { installedAdventures } from "
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { newDatedLogEntry } from "
|
|
14
|
-
import { campaignSystem, campaignWorld } from "
|
|
15
|
-
import {
|
|
3
|
+
import { adventureFolderName } from "../../adventures/index.js";
|
|
4
|
+
import { changeSetting, readSettings, requireCampaign, storyWays } from "../../campaign/index.js";
|
|
5
|
+
import { appendLogEntry } from "../../core/log.js";
|
|
6
|
+
import { defineCommand } from "../../core/registry.js";
|
|
7
|
+
import { documentAt, readDocument } from "../../documents/index.js";
|
|
8
|
+
import { stopProcess } from "../../helpers/index.js";
|
|
9
|
+
import { beginOpening, clearOpening, doneImports, dropDocumentText, dropImport, hasImport, importAge, importDate, importedPages, importFile, importFolder, importPiece, importStarts, importStyle, isOwnOpening, markOpening, openImport, openingImport, prepareImport, readImportState, runElsewhere, writeImportState, } from "../../importer/index.js";
|
|
10
|
+
import { installedAdventures } from "../shared/adventures.js";
|
|
11
|
+
import { campaignMode } from "../shared/mode.js";
|
|
12
|
+
import { situationPart } from "../shared/parts.js";
|
|
13
|
+
import { newDatedLogEntry } from "../shared/time.js";
|
|
14
|
+
import { campaignSystem, campaignWorld } from "../shared/world.js";
|
|
15
|
+
import { isImportRunning, runImport, stopImport, writingState } from "./run.js";
|
|
16
16
|
export const importCommand = defineCommand({
|
|
17
17
|
name: "import",
|
|
18
18
|
description: "Make an adventure from the player's own document: a book, a game module or notes, as a PDF, Word, OpenDocument, EPUB, HTML, RTF, text or markdown file, "
|
|
@@ -81,6 +81,94 @@ export const importCommand = defineCommand({
|
|
|
81
81
|
// A document read from its pictures is told first, for the master to tell the player before anything else (LIB-4).
|
|
82
82
|
format: (result) => [recognizedText(result.recognized), helperText(result.helper), importText(result)].filter((part) => part !== "").join("\n\n"),
|
|
83
83
|
});
|
|
84
|
+
/** The import as the master reads it: how far it is, what to tell the player, and what comes next. */
|
|
85
|
+
export function importText(result) {
|
|
86
|
+
const { state } = result;
|
|
87
|
+
const pages = Object.entries(result.pages).map(([type, count]) => `${count} ${type}`).join(", ");
|
|
88
|
+
if (result.cancelled === true) {
|
|
89
|
+
return `The import of ${state.title} is dropped, with what it wrote.`;
|
|
90
|
+
}
|
|
91
|
+
if (result.piece !== undefined) {
|
|
92
|
+
return chatPieceText(state, result.piece);
|
|
93
|
+
}
|
|
94
|
+
if (state.failed !== undefined && !result.running) {
|
|
95
|
+
const said = state.failed.replace(/\.$/, "");
|
|
96
|
+
return `The import of ${state.title} stopped: ${said}.${/call import|cancel/i.test(said) ? "" : " Call import to try again from there."}`;
|
|
97
|
+
}
|
|
98
|
+
if (state.phase === "reading") {
|
|
99
|
+
const minutes = Math.max(1, (state.pieces - state.done) * 4);
|
|
100
|
+
return `Importing ${state.title}: piece ${Math.min(state.done + 1, state.pieces)} of ${state.pieces} being read${result.pictures === undefined ? "" : `, ${result.pictures} pictures found`}; `
|
|
101
|
+
+ `about ${minutes} minutes more, by itself${pages === "" ? "" : `; pages so far: ${pages}`}. Tell the player, then end your turn and go on with them, the setup or the character: never wait for it in your turn; status says when it is ready.`;
|
|
102
|
+
}
|
|
103
|
+
if (state.phase === "choosing") {
|
|
104
|
+
const starts = result.starts.map((start) => `${start.number}. ${start.title}\n${start.text}`).join("\n\n");
|
|
105
|
+
return `${state.title} is read (${pages}). Ask the player whether they have read it; give each start its Back cover lines if not, its Reader line if so, `
|
|
106
|
+
+ `and the character they would play. Then call import with the start they choose and the character they play.\n\n${starts}`;
|
|
107
|
+
}
|
|
108
|
+
if (state.phase === "writing") {
|
|
109
|
+
return `Setting ${state.title} at start ${state.start}: step ${Math.min(state.done + 1, state.steps?.length ?? 1)} of ${state.steps?.length ?? 1}, by itself; `
|
|
110
|
+
+ "status says when it is ready.";
|
|
111
|
+
}
|
|
112
|
+
return `${state.title} is ready: ${pages}, in ${result.adventure}. Install it with package install "${result.adventure}" when the story reaches it, at the setup if it is the start. `
|
|
113
|
+
+ "What its pages say of the world stays so: find before you invent, and invent only where they are silent."
|
|
114
|
+
+ (result.invented === undefined ? "" : `\nTell the player what was invented to fill the gaps:\n${result.invented}`)
|
|
115
|
+
+ followedText(state.followed)
|
|
116
|
+
+ (state.dated === undefined
|
|
117
|
+
? ""
|
|
118
|
+
: state.dated.set
|
|
119
|
+
? `\nThe story starts on ${state.dated.date}, as the book's: calendar-start is set to it.`
|
|
120
|
+
: `\nThe book starts on ${state.dated.date}: ask the player whether the story should, then config calendar-start ${state.dated.date}.`);
|
|
121
|
+
}
|
|
122
|
+
/** The import under way as the dashboard tells it, if one is: from the document being opened to the world being written. */
|
|
123
|
+
export function importShown(root) {
|
|
124
|
+
const opening = openingImport(root);
|
|
125
|
+
if (opening !== undefined) {
|
|
126
|
+
return opening.ocr === undefined ? { title: opening.title, step: "opening" } : { title: opening.title, step: "pictures", done: opening.ocr.done, of: opening.ocr.of };
|
|
127
|
+
}
|
|
128
|
+
const open = openImport(root);
|
|
129
|
+
if (open === undefined) {
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
const { state } = open;
|
|
133
|
+
const running = isImportRunning(open.folder) || runElsewhere(open.folder) !== undefined;
|
|
134
|
+
if (state.failed !== undefined && !running) {
|
|
135
|
+
return { title: state.title, step: "stopped" };
|
|
136
|
+
}
|
|
137
|
+
if (state.phase === "choosing") {
|
|
138
|
+
return { title: state.title, step: "choosing" };
|
|
139
|
+
}
|
|
140
|
+
// Nothing runs it, as after the computer started again, and it has not moved for a while: it waits for the master to call import (a runner about to start
|
|
141
|
+
// is given that while).
|
|
142
|
+
if (!running && state.inChat !== true && (importAge(open.folder) ?? 0) > pausedAfter) {
|
|
143
|
+
return { title: state.title, step: "waiting" };
|
|
144
|
+
}
|
|
145
|
+
return state.phase === "writing"
|
|
146
|
+
? { title: state.title, step: "writing", done: state.done, of: state.steps?.length ?? 1 }
|
|
147
|
+
: { title: state.title, step: state.inChat === true ? "chat" : "reading", done: state.done, of: state.pieces };
|
|
148
|
+
}
|
|
149
|
+
/** The line status gives while an import is under way, waits for the player, or is ready and not installed yet. */
|
|
150
|
+
export function importLine(root) {
|
|
151
|
+
const open = openImport(root);
|
|
152
|
+
if (open === undefined) {
|
|
153
|
+
const installed = new Set(installedAdventures(root).map((adventure) => adventure.title));
|
|
154
|
+
const ready = doneImports(root).filter((title) => !installed.has(title));
|
|
155
|
+
return ready.length === 0 ? "" : `Imported and not installed: ${ready.join(", ")}; import says where, package install adds one.`;
|
|
156
|
+
}
|
|
157
|
+
const { state } = open;
|
|
158
|
+
if (state.inChat === true) {
|
|
159
|
+
return `Import of ${state.title} in the chat: ${state.done} of ${state.pieces} pieces read; call import for the next.`;
|
|
160
|
+
}
|
|
161
|
+
const running = isImportRunning(open.folder) || runElsewhere(open.folder) !== undefined;
|
|
162
|
+
if (state.failed !== undefined && !running) {
|
|
163
|
+
return `Import of ${state.title} stopped: call import to try again.`;
|
|
164
|
+
}
|
|
165
|
+
if (state.phase === "choosing") {
|
|
166
|
+
return `Import of ${state.title}: its starting points are ready, call import to see them.`;
|
|
167
|
+
}
|
|
168
|
+
// After the MCP server started again, nothing runs it until import is called.
|
|
169
|
+
const told = `Import of ${state.title}: ${state.phase}, ${state.done} of ${state.phase === "reading" ? state.pieces : (state.steps?.length ?? 1)} done`;
|
|
170
|
+
return running ? `${told}.` : `${told}; call import to go on.`;
|
|
171
|
+
}
|
|
84
172
|
async function startImport(root, context, document, title) {
|
|
85
173
|
const found = documentAt(document);
|
|
86
174
|
if (found === undefined) {
|
|
@@ -251,44 +339,6 @@ function followDate(root, context, folder) {
|
|
|
251
339
|
}
|
|
252
340
|
return { dated: { date, set: true } };
|
|
253
341
|
}
|
|
254
|
-
/** The import as the master reads it: how far it is, what to tell the player, and what comes next. */
|
|
255
|
-
export function importText(result) {
|
|
256
|
-
const { state } = result;
|
|
257
|
-
const pages = Object.entries(result.pages).map(([type, count]) => `${count} ${type}`).join(", ");
|
|
258
|
-
if (result.cancelled === true) {
|
|
259
|
-
return `The import of ${state.title} is dropped, with what it wrote.`;
|
|
260
|
-
}
|
|
261
|
-
if (result.piece !== undefined) {
|
|
262
|
-
return chatPieceText(state, result.piece);
|
|
263
|
-
}
|
|
264
|
-
if (state.failed !== undefined && !result.running) {
|
|
265
|
-
const said = state.failed.replace(/\.$/, "");
|
|
266
|
-
return `The import of ${state.title} stopped: ${said}.${/call import|cancel/i.test(said) ? "" : " Call import to try again from there."}`;
|
|
267
|
-
}
|
|
268
|
-
if (state.phase === "reading") {
|
|
269
|
-
const minutes = Math.max(1, (state.pieces - state.done) * 4);
|
|
270
|
-
return `Importing ${state.title}: piece ${Math.min(state.done + 1, state.pieces)} of ${state.pieces} being read${result.pictures === undefined ? "" : `, ${result.pictures} pictures found`}; `
|
|
271
|
-
+ `about ${minutes} minutes more, by itself${pages === "" ? "" : `; pages so far: ${pages}`}. Tell the player, then end your turn and go on with them, the setup or the character: never wait for it in your turn; status says when it is ready.`;
|
|
272
|
-
}
|
|
273
|
-
if (state.phase === "choosing") {
|
|
274
|
-
const starts = result.starts.map((start) => `${start.number}. ${start.title}\n${start.text}`).join("\n\n");
|
|
275
|
-
return `${state.title} is read (${pages}). Ask the player whether they have read it; give each start its Back cover lines if not, its Reader line if so, `
|
|
276
|
-
+ `and the character they would play. Then call import with the start they choose and the character they play.\n\n${starts}`;
|
|
277
|
-
}
|
|
278
|
-
if (state.phase === "writing") {
|
|
279
|
-
return `Setting ${state.title} at start ${state.start}: step ${Math.min(state.done + 1, state.steps?.length ?? 1)} of ${state.steps?.length ?? 1}, by itself; `
|
|
280
|
-
+ "status says when it is ready.";
|
|
281
|
-
}
|
|
282
|
-
return `${state.title} is ready: ${pages}, in ${result.adventure}. Install it with package install "${result.adventure}" when the story reaches it, at the setup if it is the start. `
|
|
283
|
-
+ "What its pages say of the world stays so: find before you invent, and invent only where they are silent."
|
|
284
|
-
+ (result.invented === undefined ? "" : `\nTell the player what was invented to fill the gaps:\n${result.invented}`)
|
|
285
|
-
+ followedText(state.followed)
|
|
286
|
-
+ (state.dated === undefined
|
|
287
|
-
? ""
|
|
288
|
-
: state.dated.set
|
|
289
|
-
? `\nThe story starts on ${state.dated.date}, as the book's: calendar-start is set to it.`
|
|
290
|
-
: `\nThe book starts on ${state.dated.date}: ask the player whether the story should, then config calendar-start ${state.dated.date}.`);
|
|
291
|
-
}
|
|
292
342
|
/** What a document read from the pictures of its pages means to the player (LIB-4): slower and with mistakes, so text reads better. */
|
|
293
343
|
function recognizedText(recognized) {
|
|
294
344
|
return recognized === undefined
|
|
@@ -338,53 +388,3 @@ function chatPieceText(state, piece) {
|
|
|
338
388
|
}
|
|
339
389
|
// How long an import that nothing runs may stay still before the dashboard says it waits: a runner just started takes a moment to claim it.
|
|
340
390
|
const pausedAfter = 60_000;
|
|
341
|
-
/** The import under way as the dashboard tells it, if one is: from the document being opened to the world being written. */
|
|
342
|
-
export function importShown(root) {
|
|
343
|
-
const opening = openingImport(root);
|
|
344
|
-
if (opening !== undefined) {
|
|
345
|
-
return opening.ocr === undefined ? { title: opening.title, step: "opening" } : { title: opening.title, step: "pictures", done: opening.ocr.done, of: opening.ocr.of };
|
|
346
|
-
}
|
|
347
|
-
const open = openImport(root);
|
|
348
|
-
if (open === undefined) {
|
|
349
|
-
return undefined;
|
|
350
|
-
}
|
|
351
|
-
const { state } = open;
|
|
352
|
-
const running = isImportRunning(open.folder) || runElsewhere(open.folder) !== undefined;
|
|
353
|
-
if (state.failed !== undefined && !running) {
|
|
354
|
-
return { title: state.title, step: "stopped" };
|
|
355
|
-
}
|
|
356
|
-
if (state.phase === "choosing") {
|
|
357
|
-
return { title: state.title, step: "choosing" };
|
|
358
|
-
}
|
|
359
|
-
// Nothing runs it, as after the computer started again, and it has not moved for a while: it waits for the master to call import (a runner about to start
|
|
360
|
-
// is given that while).
|
|
361
|
-
if (!running && state.inChat !== true && (importAge(open.folder) ?? 0) > pausedAfter) {
|
|
362
|
-
return { title: state.title, step: "waiting" };
|
|
363
|
-
}
|
|
364
|
-
return state.phase === "writing"
|
|
365
|
-
? { title: state.title, step: "writing", done: state.done, of: state.steps?.length ?? 1 }
|
|
366
|
-
: { title: state.title, step: state.inChat === true ? "chat" : "reading", done: state.done, of: state.pieces };
|
|
367
|
-
}
|
|
368
|
-
/** The line status gives while an import is under way, waits for the player, or is ready and not installed yet. */
|
|
369
|
-
export function importLine(root) {
|
|
370
|
-
const open = openImport(root);
|
|
371
|
-
if (open === undefined) {
|
|
372
|
-
const installed = new Set(installedAdventures(root).map((adventure) => adventure.title));
|
|
373
|
-
const ready = doneImports(root).filter((title) => !installed.has(title));
|
|
374
|
-
return ready.length === 0 ? "" : `Imported and not installed: ${ready.join(", ")}; import says where, package install adds one.`;
|
|
375
|
-
}
|
|
376
|
-
const { state } = open;
|
|
377
|
-
if (state.inChat === true) {
|
|
378
|
-
return `Import of ${state.title} in the chat: ${state.done} of ${state.pieces} pieces read; call import for the next.`;
|
|
379
|
-
}
|
|
380
|
-
const running = isImportRunning(open.folder) || runElsewhere(open.folder) !== undefined;
|
|
381
|
-
if (state.failed !== undefined && !running) {
|
|
382
|
-
return `Import of ${state.title} stopped: call import to try again.`;
|
|
383
|
-
}
|
|
384
|
-
if (state.phase === "choosing") {
|
|
385
|
-
return `Import of ${state.title}: its starting points are ready, call import to see them.`;
|
|
386
|
-
}
|
|
387
|
-
// After the MCP server started again, nothing runs it until import is called.
|
|
388
|
-
const told = `Import of ${state.title}: ${state.phase}, ${state.done} of ${state.phase === "reading" ? state.pieces : (state.steps?.length ?? 1)} done`;
|
|
389
|
-
return running ? `${told}.` : `${told}; call import to go on.`;
|
|
390
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { DocumentReader } from "
|
|
2
|
-
import { type ImportState } from "
|
|
3
|
-
import type { GameSystem } from "
|
|
1
|
+
import type { DocumentReader } from "../../core/context.ts";
|
|
2
|
+
import { type ImportState } from "../../importer/index.ts";
|
|
3
|
+
import type { GameSystem } from "../../systems/index.ts";
|
|
4
4
|
/** Whether a run of this import's helper is going on now, in this process. */
|
|
5
5
|
export declare function isImportRunning(folder: string): boolean;
|
|
6
6
|
/** The import's runs, one after the other, until it waits for the player, is done or stops; started once however often it is asked. */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// The importer's work (D-483 (10), D-484, D-489): the helper outside the chat reads the document piece after piece, then sets the world at the starting point
|
|
2
2
|
// the player chose; the engine keeps the mark, so that a run that stops goes on from there.
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
-
import { readAdventureFolder } from "
|
|
5
|
-
import { claimImport, dropDocumentText, finishAdventure, importedPages, importStarts, pieceName, readImportState, releaseImport, writeImportState } from "
|
|
6
|
-
import {
|
|
7
|
-
import { partText } from "
|
|
4
|
+
import { readAdventureFolder } from "../../adventures/index.js";
|
|
5
|
+
import { claimImport, dropDocumentText, finishAdventure, importedPages, importStarts, pieceName, readImportState, releaseImport, writeImportState } from "../../importer/index.js";
|
|
6
|
+
import { coreSection } from "../../instructions/index.js";
|
|
7
|
+
import { partText } from "../shared/parts.js";
|
|
8
8
|
// The imports running in this process, by their folder, each with what stops it: a second call never starts a second reader on the same files.
|
|
9
9
|
const running = new Map();
|
|
10
10
|
/** Whether a run of this import's helper is going on now, in this process. */
|
|
@@ -35,6 +35,12 @@ export async function stopImport(folder) {
|
|
|
35
35
|
going?.stop.abort();
|
|
36
36
|
await going?.work.catch(() => undefined);
|
|
37
37
|
}
|
|
38
|
+
/** The import set to write the world at the start chosen: a step for each folder of pages, then the opening. */
|
|
39
|
+
export function writingState(folder, state, start, character) {
|
|
40
|
+
const steps = [...Object.keys(importedPages(folder)), "opening"];
|
|
41
|
+
const { failed: _, ...kept } = state;
|
|
42
|
+
return { ...kept, phase: "writing", done: 0, start, steps, ...(character === undefined ? {} : { character }) };
|
|
43
|
+
}
|
|
38
44
|
async function steps(folder, reader, system, language, signal) {
|
|
39
45
|
for (;;) {
|
|
40
46
|
const state = readImportState(folder);
|
|
@@ -68,12 +74,6 @@ async function steps(folder, reader, system, language, signal) {
|
|
|
68
74
|
}
|
|
69
75
|
}
|
|
70
76
|
}
|
|
71
|
-
/** The import set to write the world at the start chosen: a step for each folder of pages, then the opening. */
|
|
72
|
-
export function writingState(folder, state, start, character) {
|
|
73
|
-
const steps = [...Object.keys(importedPages(folder)), "opening"];
|
|
74
|
-
const { failed: _, ...kept } = state;
|
|
75
|
-
return { ...kept, phase: "writing", done: 0, start, steps, ...(character === undefined ? {} : { character }) };
|
|
76
|
-
}
|
|
77
77
|
/**
|
|
78
78
|
* The import done: the adventure finished and checked as an install checks it. One that fails the check has its opening written again once, told what was
|
|
79
79
|
* wrong; failing again, it stops, for the master to say.
|
|
@@ -97,8 +97,9 @@ function finishImport(folder, state, language) {
|
|
|
97
97
|
}
|
|
98
98
|
// What the helper reads at each run: the importer's part of the instructions, the pages as the core writes them, and what to do now.
|
|
99
99
|
function brief(folder, state, system, language) {
|
|
100
|
-
|
|
101
|
-
const
|
|
100
|
+
// Filled by parts, never with replaceAll's own marks: a title with $& in it stays as it is.
|
|
101
|
+
const instructions = (partText("import", system) ?? "").split("{title}").join(state.title).split("{language}").join(language);
|
|
102
|
+
const pagesSection = coreSection("The world's pages");
|
|
102
103
|
const written = Object.entries(importedPages(folder)).map(([type, names]) => `- ${type}: ${names.join(", ")}`);
|
|
103
104
|
const pages = written.length === 0 ? "No pages yet." : `The pages written so far (read one before you add to it; never write a page twice):\n${written.join("\n")}`;
|
|
104
105
|
return [instructions, helperFolder, `## Pages\n\n${pagesSection}`, `## Now\n\n${task(folder, state)}`, pages].join("\n\n");
|
package/dist/commands/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { advance } from "./advance.js";
|
|
2
2
|
import { ask } from "./ask.js";
|
|
3
|
-
import { change } from "./change.js";
|
|
3
|
+
import { change } from "./change/change.js";
|
|
4
4
|
import { config } from "./config.js";
|
|
5
5
|
import { effect } from "./effect.js";
|
|
6
6
|
import { find } from "./find.js";
|
|
7
7
|
import { image } from "./image.js";
|
|
8
|
-
import { importCommand } from "./import.js";
|
|
8
|
+
import { importCommand } from "./import/import.js";
|
|
9
9
|
import { init } from "./init.js";
|
|
10
10
|
import { install } from "./install.js";
|
|
11
11
|
import { instructions } from "./instructions.js";
|
|
@@ -15,8 +15,7 @@ import { move } from "./move.js";
|
|
|
15
15
|
import { packageCommand } from "./package.js";
|
|
16
16
|
import { rename } from "./rename.js";
|
|
17
17
|
import { reveal } from "./reveal.js";
|
|
18
|
-
import { roll } from "./roll.js";
|
|
19
|
-
import { route } from "./route.js";
|
|
18
|
+
import { roll } from "./roll/roll.js";
|
|
20
19
|
import { rules } from "./rules.js";
|
|
21
20
|
import { save } from "./save.js";
|
|
22
21
|
import { scene } from "./scene.js";
|
|
@@ -25,10 +24,11 @@ import { status } from "./status.js";
|
|
|
25
24
|
import { thoughts } from "./thoughts.js";
|
|
26
25
|
import { trade } from "./trade.js";
|
|
27
26
|
import { translate } from "./translate.js";
|
|
28
|
-
import {
|
|
27
|
+
import { route } from "./travel/route.js";
|
|
28
|
+
import { travel } from "./travel/travel.js";
|
|
29
29
|
import { validate } from "./validate.js";
|
|
30
|
-
import { view } from "./view.js";
|
|
31
|
-
import { write } from "./write.js";
|
|
30
|
+
import { view } from "./view/view.js";
|
|
31
|
+
import { write } from "./write/write.js";
|
|
32
32
|
/** Every command of rpg-engine. */
|
|
33
33
|
export const commands = [
|
|
34
34
|
init,
|
package/dist/commands/init.js
CHANGED
|
@@ -5,8 +5,8 @@ import { appendLogEntry, newLogEntry } from "../core/log.js";
|
|
|
5
5
|
import { defineCommand } from "../core/registry.js";
|
|
6
6
|
import { hostInstructions } from "../instructions/index.js";
|
|
7
7
|
import { createWorld } from "../pages/index.js";
|
|
8
|
-
import { campaignNote } from "./
|
|
9
|
-
import { installedSystemName } from "./
|
|
8
|
+
import { campaignNote } from "./shared/mode.js";
|
|
9
|
+
import { installedSystemName } from "./shared/world.js";
|
|
10
10
|
export const init = defineCommand({
|
|
11
11
|
name: "init",
|
|
12
12
|
description: "Create a new campaign. "
|
|
@@ -17,7 +17,7 @@ export const init = defineCommand({
|
|
|
17
17
|
positionals: ["folder"],
|
|
18
18
|
input: z.object({
|
|
19
19
|
folder: z.string().optional().describe("folder of the new campaign; the current folder if left out"),
|
|
20
|
-
name: z.string().optional().describe("name of the campaign; the folder's name if left out"),
|
|
20
|
+
name: z.string().trim().min(1, "give the campaign a name, or leave name out for the folder's").optional().describe("name of the campaign; the folder's name if left out"),
|
|
21
21
|
language: z.string().optional().describe("language of the game, as a code such as it or en"),
|
|
22
22
|
system: z.string().optional().describe("game system: one of those installed"),
|
|
23
23
|
difficulty: z.enum(difficulties).optional().describe(`how hard the world plays: ${difficulties.join(", ")}`),
|
package/dist/commands/install.js
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { requireCampaign } from "../campaign/index.js";
|
|
3
3
|
import { appendLogEntry } from "../core/log.js";
|
|
4
4
|
import { defineCommand } from "../core/registry.js";
|
|
5
|
-
import { newDatedLogEntry } from "./
|
|
5
|
+
import { newDatedLogEntry } from "./shared/time.js";
|
|
6
6
|
// What each program is called, and the account its sign-in asks for.
|
|
7
7
|
const programs = {
|
|
8
8
|
codex: { name: "Codex", account: "ChatGPT account", gives: "the dashboard is translated in the background from now on, and pictures are made where their plan allows (Plus and up)" },
|
|
@@ -2,12 +2,12 @@ import { z } from "zod";
|
|
|
2
2
|
import { findCampaign, readSettings } from "../campaign/index.js";
|
|
3
3
|
import { defineCommand } from "../core/registry.js";
|
|
4
4
|
import { buttonsInstructions, dashboardInstructions, masterInstructions } from "../instructions/index.js";
|
|
5
|
-
import { campaignMode, modePart } from "./
|
|
6
|
-
import { valueParts } from "./
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
5
|
+
import { campaignMode, modePart } from "./shared/mode.js";
|
|
6
|
+
import { valueParts } from "./shared/offers.js";
|
|
7
|
+
import { mentorPart, partText, partyPart, situationPart, stylePart } from "./shared/parts.js";
|
|
8
|
+
import { readOpenScene } from "./shared/scene.js";
|
|
9
|
+
import { voicesPart } from "./shared/voices.js";
|
|
10
|
+
import { campaignSystem, campaignWorld } from "./shared/world.js";
|
|
11
11
|
// The parts instructions gives alone, when the master asks for them (D-532): how the player uses the dashboard.
|
|
12
12
|
const onRequestParts = ["dashboard"];
|
|
13
13
|
export const instructions = defineCommand({
|
package/dist/commands/mode.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { type Mode } from "./
|
|
3
|
-
import { type ResetPoint } from "./
|
|
2
|
+
import { type Mode } from "./shared/mode.ts";
|
|
3
|
+
import { type ResetPoint } from "./shared/saves.ts";
|
|
4
4
|
export declare const mode: import("../core/registry.ts").Command<z.ZodObject<{
|
|
5
5
|
to: z.ZodEnum<{
|
|
6
6
|
"session zero": "session zero";
|
package/dist/commands/mode.js
CHANGED
|
@@ -2,14 +2,14 @@ import { z } from "zod";
|
|
|
2
2
|
import { changeState, requireCampaign } from "../campaign/index.js";
|
|
3
3
|
import { appendLogEntry } from "../core/log.js";
|
|
4
4
|
import { defineCommand } from "../core/registry.js";
|
|
5
|
-
import { blockingMode, campaignMode, missingText, modePart, modes } from "./
|
|
6
|
-
import { valueParts } from "./
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
5
|
+
import { blockingMode, campaignMode, missingText, modePart, modes } from "./shared/mode.js";
|
|
6
|
+
import { valueParts } from "./shared/offers.js";
|
|
7
|
+
import { adventurePart, situationPart } from "./shared/parts.js";
|
|
8
|
+
import { adventureUnderWay } from "./shared/quests.js";
|
|
9
|
+
import { campaignSaves, makeSave, savesWhy, saveText } from "./shared/saves.js";
|
|
10
|
+
import { newDatedLogEntry, readPresent } from "./shared/time.js";
|
|
11
|
+
import { voicesPart } from "./shared/voices.js";
|
|
12
|
+
import { campaignSystem, campaignWorld } from "./shared/world.js";
|
|
13
13
|
export const mode = defineCommand({
|
|
14
14
|
name: "mode",
|
|
15
15
|
description: "Move the campaign to another mode: setup (the settings, out of the game), session zero (the player character and the companions, made in play) or play. "
|
package/dist/commands/mood.js
CHANGED
|
@@ -4,10 +4,10 @@ import { appendLogEntry } from "../core/log.js";
|
|
|
4
4
|
import { moods } from "../core/mood.js";
|
|
5
5
|
import { defineCommand } from "../core/registry.js";
|
|
6
6
|
import { isPartyMember, ownField, pageNamed, writePage } from "../pages/index.js";
|
|
7
|
-
import { masterMood, masterMoodKey, moodChanged, moodMoment, pageMood } from "./
|
|
8
|
-
import { readOpenScene } from "./
|
|
9
|
-
import { newDatedLogEntry } from "./
|
|
10
|
-
import { campaignWorld } from "./
|
|
7
|
+
import { masterMood, masterMoodKey, moodChanged, moodMoment, pageMood } from "./shared/moods.js";
|
|
8
|
+
import { readOpenScene } from "./shared/scene.js";
|
|
9
|
+
import { newDatedLogEntry } from "./shared/time.js";
|
|
10
|
+
import { campaignWorld } from "./shared/world.js";
|
|
11
11
|
// What a character's new mood asks of the master, by their role.
|
|
12
12
|
const moodAdvice = {
|
|
13
13
|
pc: "the dashboard shows it on their sheet. It mirrors what the player writes and plays, never what you narrate or what a spell or condition does to them: "
|
package/dist/commands/move.js
CHANGED
|
@@ -4,21 +4,18 @@ import { appendLogEntry } from "../core/log.js";
|
|
|
4
4
|
import { defineCommand } from "../core/registry.js";
|
|
5
5
|
import { closedSquare, featureAt, firstOpenSquare, readSquare, squareName } from "../grid/index.js";
|
|
6
6
|
import { canHold, isInParty, kindNamed, locate, pageNamed, pagesWithName, pageTypeNames, parsePageReference, stackName, writePage } from "../pages/index.js";
|
|
7
|
-
import { surroundings, surroundingsChange } from "./
|
|
8
|
-
import { moveFacts } from "./
|
|
9
|
-
import { atEntries, atEntry, clearCopies, offMapNote, placeGrid, standing } from "./
|
|
10
|
-
import { picturesNote } from "./
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
const textList = z.union([z.string(), z.array(z.string())]);
|
|
20
|
-
// A whole number, as text from a command line or as a number through MCP.
|
|
21
|
-
const wholeNumber = z.preprocess((value) => (typeof value === "string" && /^[+-]?\d+$/.test(value.trim()) ? Number(value) : value), z.number().int());
|
|
7
|
+
import { surroundings, surroundingsChange } from "./shared/environment.js";
|
|
8
|
+
import { moveFacts } from "./shared/grid-moves.js";
|
|
9
|
+
import { atEntries, atEntry, clearCopies, offMapNote, placeGrid, standing } from "./shared/grids.js";
|
|
10
|
+
import { picturesNote } from "./shared/images.js";
|
|
11
|
+
import { textList, textsOf, wholeNumber } from "./shared/inputs.js";
|
|
12
|
+
import { movePages } from "./shared/moves.js";
|
|
13
|
+
import { shortList, skippedPagesNote } from "./shared/notes.js";
|
|
14
|
+
import { measuresOf, roadsOf, sameSpot, stopOf } from "./shared/roads.js";
|
|
15
|
+
import { copyName, readOpenScene, scenePlace, updateScene } from "./shared/scene.js";
|
|
16
|
+
import { heldStack, stackMoveSteps, writeStacks } from "./shared/stacks.js";
|
|
17
|
+
import { newDatedLogEntry } from "./shared/time.js";
|
|
18
|
+
import { campaignSystem, campaignWorld, missingSystemHint } from "./shared/world.js";
|
|
22
19
|
export const move = defineCommand({
|
|
23
20
|
name: "move",
|
|
24
21
|
description: "Move characters, items or places into a place, a character's inventory or an item: whenever someone or something goes somewhere, before you narrate it. "
|
|
@@ -37,7 +34,7 @@ export const move = defineCommand({
|
|
|
37
34
|
const root = requireCampaign(context.folder);
|
|
38
35
|
const world = campaignWorld(root, context);
|
|
39
36
|
const { scene } = readOpenScene(root);
|
|
40
|
-
const names = (
|
|
37
|
+
const names = textsOf(input.page);
|
|
41
38
|
if (names.length === 0) {
|
|
42
39
|
throw new Error("Give what moves, such as page Ettore.");
|
|
43
40
|
}
|
|
@@ -252,10 +249,6 @@ function groundNote(grid, square) {
|
|
|
252
249
|
const marks = [feature?.difficult ? "difficult ground" : "", feature?.hidden ? "hidden: the player does not know it is there" : ""].filter((mark) => mark !== "");
|
|
253
250
|
return feature === undefined || marks.length === 0 ? undefined : `${squareName(square)} is ${feature.name}, ${marks.join(", ")}.`;
|
|
254
251
|
}
|
|
255
|
-
/** The place where the open scene is; none when there is no scene, or it is in no place. */
|
|
256
|
-
function scenePlace(world, scene) {
|
|
257
|
-
return scene?.place === undefined ? undefined : pagesWithName(world, parsePageReference(scene.place).name)[0];
|
|
258
|
-
}
|
|
259
252
|
/**
|
|
260
253
|
* Where those who went into a place with a map stand (GRD-3): on the square they entered by, or, for those whose way in the map does not show, a word that the
|
|
261
254
|
* map wants them on it.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { type Context } from "../core/context.ts";
|
|
3
3
|
import { type Extension } from "../extensions/index.ts";
|
|
4
|
-
import { type AdventureExported, type AdventureInstalled } from "./
|
|
4
|
+
import { type AdventureExported, type AdventureInstalled } from "./shared/adventures.ts";
|
|
5
5
|
type PackageResult = {
|
|
6
6
|
kind: "list";
|
|
7
7
|
installed: Installed[];
|
|
@@ -119,8 +119,8 @@ interface Available {
|
|
|
119
119
|
}
|
|
120
120
|
export declare const packageCommand: import("../core/registry.ts").Command<z.ZodObject<{
|
|
121
121
|
action: z.ZodEnum<{
|
|
122
|
-
remove: "remove";
|
|
123
122
|
list: "list";
|
|
123
|
+
remove: "remove";
|
|
124
124
|
available: "available";
|
|
125
125
|
install: "install";
|
|
126
126
|
uninstall: "uninstall";
|