briyah 2.0.2 → 2.0.4
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/LICENSE +216 -0
- package/README.md +43 -7
- package/data/common/config/LICENSE-model-prices.md +65 -0
- package/data/common/config/markup +1 -1
- package/data/common/config/model_prices.json +47443 -46295
- package/data/common/prompts/narrator/create_story.prompt +2 -0
- package/data/packs/dnd5e/agents/player.json +11 -11
- package/data/packs/dnd5e/prompts/character_creator/defaults_config.json +21 -20
- package/data/packs/dnd5e/prompts/character_creator/perceive.prompt +19 -12
- package/data/packs/dnd5e/prompts/dnd_player/perceive.prompt +10 -6
- package/dist-sdk/server/src/ai/LLM/anthropic.service.d.ts +103 -0
- package/dist-sdk/server/src/ai/LLM/anthropic.service.js +173 -2
- package/dist-sdk/server/src/ai/LLM/base-ai.service.d.ts +172 -3
- package/dist-sdk/server/src/ai/LLM/base-ai.service.js +241 -5
- package/dist-sdk/server/src/ai/LLM/comfyui-client.d.ts +26 -0
- package/dist-sdk/server/src/ai/LLM/comfyui-client.js +25 -0
- package/dist-sdk/server/src/ai/LLM/comfyui-workflow.d.ts +54 -0
- package/dist-sdk/server/src/ai/LLM/comfyui-workflow.js +59 -1
- package/dist-sdk/server/src/ai/LLM/comfyui.service.d.ts +21 -1
- package/dist-sdk/server/src/ai/LLM/comfyui.service.js +25 -1
- package/dist-sdk/server/src/ai/LLM/deepseek.service.d.ts +52 -0
- package/dist-sdk/server/src/ai/LLM/deepseek.service.js +102 -3
- package/dist-sdk/server/src/ai/LLM/fal.service.d.ts +25 -0
- package/dist-sdk/server/src/ai/LLM/fal.service.js +55 -1
- package/dist-sdk/server/src/ai/LLM/googleai.service.d.ts +19 -0
- package/dist-sdk/server/src/ai/LLM/googleai.service.js +42 -1
- package/dist-sdk/server/src/ai/LLM/grok.service.d.ts +22 -0
- package/dist-sdk/server/src/ai/LLM/grok.service.js +54 -2
- package/dist-sdk/server/src/ai/LLM/mock.service.js +31 -4
- package/dist-sdk/server/src/ai/LLM/openai.service.d.ts +30 -0
- package/dist-sdk/server/src/ai/LLM/openai.service.js +80 -2
- package/dist-sdk/server/src/ai/LLM/self-hosted.service.d.ts +21 -0
- package/dist-sdk/server/src/ai/LLM/self-hosted.service.js +44 -2
- package/dist-sdk/server/src/ai/LLM/together.service.d.ts +30 -0
- package/dist-sdk/server/src/ai/LLM/together.service.js +60 -2
- package/dist-sdk/server/src/ai/agent-config.d.ts +15 -0
- package/dist-sdk/server/src/ai/agent-factory.d.ts +16 -0
- package/dist-sdk/server/src/ai/agent-factory.js +20 -0
- package/dist-sdk/server/src/ai/agent-message.service.d.ts +30 -0
- package/dist-sdk/server/src/ai/agent-message.service.js +30 -0
- package/dist-sdk/server/src/ai/agent-store.service.d.ts +80 -0
- package/dist-sdk/server/src/ai/agent-store.service.js +166 -5
- package/dist-sdk/server/src/ai/agent.d.ts +196 -0
- package/dist-sdk/server/src/ai/agent.js +224 -11
- package/dist-sdk/server/src/ai/ai-debug-logger.d.ts +18 -0
- package/dist-sdk/server/src/ai/ai-debug-logger.js +19 -0
- package/dist-sdk/server/src/ai/ai-factory.service.d.ts +9 -0
- package/dist-sdk/server/src/ai/ai-factory.service.js +9 -0
- package/dist-sdk/server/src/ai/artifact.service.d.ts +131 -0
- package/dist-sdk/server/src/ai/artifact.service.js +148 -3
- package/dist-sdk/server/src/ai/attached-file.service.d.ts +87 -0
- package/dist-sdk/server/src/ai/attached-file.service.js +105 -0
- package/dist-sdk/server/src/ai/model_prices.d.ts +30 -0
- package/dist-sdk/server/src/ai/model_prices.js +91 -5
- package/dist-sdk/server/src/ai/pack-artifacts.d.ts +84 -0
- package/dist-sdk/server/src/ai/pack-artifacts.js +168 -0
- package/dist-sdk/server/src/ai/published-agents.service.d.ts +25 -0
- package/dist-sdk/server/src/ai/published-agents.service.js +30 -3
- package/dist-sdk/server/src/app/balance-message.service.d.ts +24 -0
- package/dist-sdk/server/src/app/balance-message.service.js +24 -0
- package/dist-sdk/server/src/app/balance.module.d.ts +4 -0
- package/dist-sdk/server/src/app/balance.module.js +4 -0
- package/dist-sdk/server/src/app/balance.service.d.ts +37 -0
- package/dist-sdk/server/src/app/balance.service.js +54 -0
- package/dist-sdk/server/src/app/stripe.controller.d.ts +21 -0
- package/dist-sdk/server/src/app/stripe.controller.js +35 -0
- package/dist-sdk/server/src/app/stripe.service.d.ts +43 -0
- package/dist-sdk/server/src/app/stripe.service.js +62 -0
- package/dist-sdk/server/src/app/transaction.service.d.ts +27 -0
- package/dist-sdk/server/src/app/transaction.service.js +36 -0
- package/dist-sdk/server/src/app/user-service-factory.d.ts +8 -0
- package/dist-sdk/server/src/app/user-service-factory.js +38 -1
- package/dist-sdk/server/src/app/user-service-manager.d.ts +27 -0
- package/dist-sdk/server/src/app/user-service-manager.js +43 -0
- package/dist-sdk/server/src/app.controller.d.ts +87 -0
- package/dist-sdk/server/src/app.controller.js +272 -12
- package/dist-sdk/server/src/app.module.js +28 -6
- package/dist-sdk/server/src/app.service.d.ts +1662 -0
- package/dist-sdk/server/src/app.service.js +1862 -6
- package/dist-sdk/server/src/auth/agent-access.decorator.d.ts +17 -0
- package/dist-sdk/server/src/auth/agent-access.decorator.js +17 -0
- package/dist-sdk/server/src/auth/auth.controller.js +46 -0
- package/dist-sdk/server/src/auth/auth.module.js +3 -2
- package/dist-sdk/server/src/auth/auth.service.d.ts +33 -0
- package/dist-sdk/server/src/auth/auth.service.js +39 -3
- package/dist-sdk/server/src/auth/jwt-auth.guard.js +18 -0
- package/dist-sdk/server/src/auth/jwt.strategy.js +2 -2
- package/dist-sdk/server/src/auth/owner-only.decorator.d.ts +9 -0
- package/dist-sdk/server/src/auth/owner-only.decorator.js +9 -0
- package/dist-sdk/server/src/auth/phone-validation.service.d.ts +25 -0
- package/dist-sdk/server/src/auth/phone-validation.service.js +30 -0
- package/dist-sdk/server/src/auth/rate-limit.service.d.ts +19 -0
- package/dist-sdk/server/src/auth/rate-limit.service.js +24 -0
- package/dist-sdk/server/src/auth/room-access.decorator.d.ts +8 -0
- package/dist-sdk/server/src/auth/room-access.decorator.js +8 -0
- package/dist-sdk/server/src/auth/scopes.decorator.d.ts +7 -0
- package/dist-sdk/server/src/auth/scopes.decorator.js +7 -0
- package/dist-sdk/server/src/auth/scopes.guard.d.ts +16 -0
- package/dist-sdk/server/src/auth/scopes.guard.js +30 -0
- package/dist-sdk/server/src/auth/session.guard.d.ts +4 -0
- package/dist-sdk/server/src/auth/session.guard.js +8 -0
- package/dist-sdk/server/src/auth/twilio.service.d.ts +27 -0
- package/dist-sdk/server/src/auth/twilio.service.js +30 -4
- package/dist-sdk/server/src/auth/users.service.d.ts +30 -0
- package/dist-sdk/server/src/auth/users.service.js +42 -0
- package/dist-sdk/server/src/common/errors.d.ts +20 -0
- package/dist-sdk/server/src/common/errors.js +21 -0
- package/dist-sdk/server/src/config/env-config.d.ts +7 -0
- package/dist-sdk/server/src/config/prompt-resolver.d.ts +180 -0
- package/dist-sdk/server/src/config/prompt-resolver.js +182 -0
- package/dist-sdk/server/src/config/user-config.service.d.ts +59 -0
- package/dist-sdk/server/src/config/user-config.service.js +57 -0
- package/dist-sdk/server/src/config/user-paths.service.d.ts +61 -0
- package/dist-sdk/server/src/config/user-paths.service.js +67 -0
- package/dist-sdk/server/src/documents/pdf-conversion.d.ts +121 -1
- package/dist-sdk/server/src/documents/pdf-conversion.js +94 -0
- package/dist-sdk/server/src/packs/pack-instantiation.service.d.ts +98 -0
- package/dist-sdk/server/src/packs/pack-instantiation.service.js +99 -0
- package/dist-sdk/server/src/packs/pack-manifest.d.ts +100 -0
- package/dist-sdk/server/src/packs/pack-manifest.js +58 -0
- package/dist-sdk/server/src/packs/pack.service.d.ts +99 -1
- package/dist-sdk/server/src/packs/pack.service.js +98 -1
- package/dist-sdk/server/src/room/artifact-store.service.d.ts +27 -0
- package/dist-sdk/server/src/room/artifact-store.service.js +49 -3
- package/dist-sdk/server/src/room/artifact.d.ts +18 -0
- package/dist-sdk/server/src/room/message.d.ts +64 -0
- package/dist-sdk/server/src/room/message.js +77 -2
- package/dist-sdk/server/src/room/nickname.d.ts +27 -0
- package/dist-sdk/server/src/room/nickname.js +41 -0
- package/dist-sdk/server/src/room/published-rooms.service.js +2 -0
- package/dist-sdk/server/src/room/room-config.d.ts +26 -0
- package/dist-sdk/server/src/room/room-factory.d.ts +12 -0
- package/dist-sdk/server/src/room/room-factory.js +14 -0
- package/dist-sdk/server/src/room/room-message.service.d.ts +28 -0
- package/dist-sdk/server/src/room/room-message.service.js +28 -0
- package/dist-sdk/server/src/room/room-store.service.d.ts +177 -0
- package/dist-sdk/server/src/room/room-store.service.js +242 -5
- package/dist-sdk/server/src/room/room.d.ts +906 -1
- package/dist-sdk/server/src/room/room.js +1525 -34
- package/dist-sdk/server/src/rpg/rpg-models.d.ts +50 -0
- package/dist-sdk/server/src/rpg/rpg-models.js +53 -0
- package/dist-sdk/server/src/rpg/rpg-roster.d.ts +38 -3
- package/dist-sdk/server/src/rpg/rpg-roster.js +49 -49
- package/dist-sdk/server/src/rpg/rpg.service.d.ts +87 -0
- package/dist-sdk/server/src/rpg/rpg.service.js +108 -5
- package/dist-sdk/server/src/sdk/briyah-config.d.ts +57 -0
- package/dist-sdk/server/src/sdk/briyah-config.js +17 -0
- package/dist-sdk/server/src/sdk/briyah.d.ts +228 -0
- package/dist-sdk/server/src/sdk/briyah.js +285 -7
- package/dist-sdk/server/src/sdk/index.d.ts +0 -1
- package/dist-sdk/server/src/sdk/index.js +24 -3
- package/dist-sdk/server/src/shared/shared.module.d.ts +8 -0
- package/dist-sdk/server/src/shared/shared.module.js +13 -5
- package/dist-sdk/server/src/story/story-message.service.d.ts +43 -0
- package/dist-sdk/server/src/story/story-message.service.js +43 -0
- package/dist-sdk/server/src/story/story-progress.service.d.ts +23 -0
- package/dist-sdk/server/src/story/story-progress.service.js +23 -0
- package/dist-sdk/server/src/story/story-store.service.d.ts +92 -0
- package/dist-sdk/server/src/story/story-store.service.js +136 -1
- package/dist-sdk/server/src/story/story.service.d.ts +398 -0
- package/dist-sdk/server/src/story/story.service.js +829 -25
- package/dist-sdk/server/src/tools/core/index.d.ts +25 -0
- package/dist-sdk/server/src/tools/core/index.js +31 -0
- package/dist-sdk/server/src/tools/core/rename.tool.d.ts +10 -0
- package/dist-sdk/server/src/tools/core/rename.tool.js +72 -0
- package/dist-sdk/server/src/tools/native-tool-registry.service.d.ts +22 -0
- package/dist-sdk/server/src/tools/native-tool-registry.service.js +22 -0
- package/dist-sdk/server/src/tools/native-tool.types.d.ts +186 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/backgrounds.d.ts +29 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/backgrounds.js +29 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/cantrips.d.ts +46 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/cantrips.js +40 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/feats.d.ts +33 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/feats.js +19 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/gear.d.ts +37 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/gear.generated.d.ts +17 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/gear.generated.js +17 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/gear.js +27 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/kits.d.ts +36 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/kits.js +32 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/magic-items.d.ts +32 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/magic-items.generated.d.ts +13 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/magic-items.generated.js +13 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/magic-items.js +18 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/monsters.d.ts +54 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/monsters.generated.d.ts +13 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/monsters.generated.js +13 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/monsters.js +20 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/races.d.ts +36 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/races.js +18 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/spells.d.ts +29 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/spells.generated.d.ts +13 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/spells.generated.js +13 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/spells.js +21 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/srd.d.ts +95 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/srd.js +66 -2
- package/dist-sdk/server/src/tools/packs/dnd5e/data/weapons.d.ts +50 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/weapons.js +28 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/bestiary.d.ts +92 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/bestiary.js +152 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/campaign-items.d.ts +28 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/campaign-items.js +29 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/cantrips.d.ts +31 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/cantrips.js +36 -2
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/character.d.ts +261 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/character.js +401 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/coerce.d.ts +11 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/coerce.js +11 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/dice.d.ts +65 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/dice.js +67 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/encounter.d.ts +73 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/encounter.js +63 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/encumbrance.d.ts +66 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/encumbrance.js +59 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/feats.d.ts +54 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/feats.js +49 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/foes.d.ts +42 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/foes.js +59 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/guides.d.ts +72 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/guides.js +63 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/items.d.ts +57 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/items.js +54 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/kits.d.ts +81 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/kits.js +85 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/races.d.ts +60 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/races.js +64 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/rules.d.ts +169 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/rules.js +203 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/sheet.d.ts +192 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/sheet.js +144 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/spells.d.ts +56 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/spells.js +54 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/weapons.d.ts +65 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/weapons.js +73 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/index.d.ts +18 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/index.js +18 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/check.tool.d.ts +4 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/check.tool.js +116 -1
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/class.tool.d.ts +14 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/class.tool.js +17 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/dice.tools.d.ts +1 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/dice.tools.js +35 -1
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/encounter.tool.d.ts +6 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/encounter.tool.js +25 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/item.tool.d.ts +7 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/item.tool.js +13 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/monster.tool.d.ts +8 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/monster.tool.js +55 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/shared.d.ts +164 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/shared.js +188 -1
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/sheet.tools.d.ts +1 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/sheet.tools.js +125 -1
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/spell.tool.d.ts +13 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/spell.tool.js +18 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/state.tools.d.ts +1 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/state.tools.js +23 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/world.tools.d.ts +1 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/world.tools.js +35 -0
- package/dist-sdk/server/src/tools/packs/index.d.ts +52 -2
- package/dist-sdk/server/src/tools/packs/index.js +83 -9
- package/dist-sdk/server/src/tools/shared/coerce.d.ts +95 -0
- package/dist-sdk/server/src/tools/shared/coerce.js +98 -0
- package/dist-sdk/server/src/tools/tool-execution.service.d.ts +73 -0
- package/dist-sdk/server/src/tools/tool-execution.service.js +74 -0
- package/dist-sdk/server/src/tools/tool-store.service.d.ts +11 -0
- package/dist-sdk/server/src/tools/tool-store.service.js +13 -1
- package/dist-sdk/shared/types/app.types.d.ts +285 -14
- package/dist-sdk/shared/types/app.types.js +3 -0
- package/package.json +167 -139
- package/data/common/config/random_words.txt +0 -2241
- package/data/common/story_ideas/biblical.json +0 -122
- package/data/common/story_ideas/fantasy.json +0 -82
- package/data/common/story_ideas/historical_fiction.json +0 -82
- package/data/common/story_ideas/science_fiction.json +0 -82
- package/data/packs/acts/agents/character-guide.json +0 -6
- package/data/packs/acts/agents/discipleship-mentor.json +0 -6
- package/data/packs/acts/agents/mentor-coach.json +0 -6
- package/data/packs/acts/agents/student.json +0 -13
- package/data/packs/acts/agents/table-moderator.json +0 -6
- package/data/packs/acts/artifacts/chapter-01-acts-1.md +0 -405
- package/data/packs/acts/artifacts/chapter-02-acts-2.md +0 -443
- package/data/packs/acts/artifacts/chapter-03-acts-3.md +0 -409
- package/data/packs/acts/artifacts/chapter-04-acts-4.md +0 -438
- package/data/packs/acts/artifacts/chapter-05-acts-5.md +0 -434
- package/data/packs/acts/artifacts/chapter-06-acts-6.md +0 -441
- package/data/packs/acts/artifacts/chapter-07-acts-7.md +0 -472
- package/data/packs/acts/artifacts/chapter-08-acts-8.md +0 -512
- package/data/packs/acts/artifacts/chapter-09-acts-9.md +0 -346
- package/data/packs/acts/artifacts/chapter-10-acts-10.md +0 -367
- package/data/packs/acts/artifacts/chapter-11-acts-11.md +0 -391
- package/data/packs/acts/artifacts/chapter-12-acts-12.md +0 -390
- package/data/packs/acts/artifacts/chapter-13-acts-13.md +0 -388
- package/data/packs/acts/artifacts/chapter-14-acts-14.md +0 -466
- package/data/packs/acts/artifacts/chapter-15-acts-15.md +0 -413
- package/data/packs/acts/artifacts/chapter-16-acts-16.md +0 -585
- package/data/packs/acts/artifacts/chapter-17-acts-17.md +0 -428
- package/data/packs/acts/artifacts/chapter-18-acts-18.md +0 -486
- package/data/packs/acts/artifacts/chapter-19-acts-19.md +0 -461
- package/data/packs/acts/artifacts/chapter-20-acts-20.md +0 -389
- package/data/packs/acts/artifacts/chapter-21-acts-21.md +0 -452
- package/data/packs/acts/artifacts/chapter-22-acts-22.md +0 -424
- package/data/packs/acts/artifacts/chapter-23-acts-23.md +0 -395
- package/data/packs/acts/artifacts/chapter-24-acts-24.md +0 -446
- package/data/packs/acts/artifacts/chapter-25-acts-25.md +0 -391
- package/data/packs/acts/artifacts/chapter-26-acts-26.md +0 -431
- package/data/packs/acts/artifacts/chapter-27-acts-27.md +0 -530
- package/data/packs/acts/artifacts/chapter-28-acts-28.md +0 -1871
- package/data/packs/acts/artifacts/chapters.manifest.json +0 -170
- package/data/packs/acts/artifacts/character_guide-creation.md +0 -112
- package/data/packs/acts/artifacts/discipleship_mentor-procedure.md +0 -154
- package/data/packs/acts/artifacts/discipleship_mentor-systems.md +0 -72
- package/data/packs/acts/artifacts/manifest.json +0 -197
- package/data/packs/acts/artifacts/stage-guide.md +0 -94
- package/data/packs/acts/pack.json +0 -6
- package/data/packs/acts/prompts/acts_player/defaults_config.json +0 -5
- package/data/packs/acts/prompts/acts_player/perceive.json +0 -29
- package/data/packs/acts/prompts/acts_player/perceive.prompt +0 -87
- package/data/packs/acts/prompts/acts_player/system_instruction.prompt +0 -0
- package/data/packs/acts/prompts/acts_room_moderator/defaults_config.json +0 -9
- package/data/packs/acts/prompts/acts_room_moderator/moderate.json +0 -34
- package/data/packs/acts/prompts/acts_room_moderator/moderate.prompt +0 -70
- package/data/packs/acts/prompts/acts_room_moderator/system_instruction.prompt +0 -0
- package/data/packs/acts/prompts/character_guide/defaults_config.json +0 -18
- package/data/packs/acts/prompts/character_guide/perceive.json +0 -29
- package/data/packs/acts/prompts/character_guide/perceive.prompt +0 -140
- package/data/packs/acts/prompts/character_guide/system_instruction.prompt +0 -0
- package/data/packs/acts/prompts/discipleship_mentor/defaults_config.json +0 -23
- package/data/packs/acts/prompts/discipleship_mentor/perceive.json +0 -33
- package/data/packs/acts/prompts/discipleship_mentor/perceive.prompt +0 -245
- package/data/packs/acts/prompts/discipleship_mentor/system_instruction.prompt +0 -0
- package/data/packs/acts/prompts/mentor_coach/defaults_config.json +0 -13
- package/data/packs/acts/prompts/mentor_coach/perceive.json +0 -29
- package/data/packs/acts/prompts/mentor_coach/perceive.prompt +0 -87
- package/data/packs/acts/prompts/mentor_coach/system_instruction.prompt +0 -0
- package/data/packs/acts/rooms/session.json +0 -14
- package/data/packs/acts/rooms/training.json +0 -58
- package/dist-sdk/server/src/tools/packs/acts/data/cards.d.ts +0 -53
- package/dist-sdk/server/src/tools/packs/acts/data/cards.js +0 -54
- package/dist-sdk/server/src/tools/packs/acts/data/character-cards.generated.d.ts +0 -2
- package/dist-sdk/server/src/tools/packs/acts/data/character-cards.generated.js +0 -185
- package/dist-sdk/server/src/tools/packs/acts/data/encounters.d.ts +0 -12
- package/dist-sdk/server/src/tools/packs/acts/data/encounters.js +0 -102
- package/dist-sdk/server/src/tools/packs/acts/data/event-cards.generated.d.ts +0 -2
- package/dist-sdk/server/src/tools/packs/acts/data/event-cards.generated.js +0 -196
- package/dist-sdk/server/src/tools/packs/acts/data/item-cards.generated.d.ts +0 -2
- package/dist-sdk/server/src/tools/packs/acts/data/item-cards.generated.js +0 -1311
- package/dist-sdk/server/src/tools/packs/acts/engine/cards.d.ts +0 -5
- package/dist-sdk/server/src/tools/packs/acts/engine/cards.js +0 -27
- package/dist-sdk/server/src/tools/packs/acts/engine/challenge.d.ts +0 -37
- package/dist-sdk/server/src/tools/packs/acts/engine/challenge.js +0 -120
- package/dist-sdk/server/src/tools/packs/acts/engine/dice.d.ts +0 -20
- package/dist-sdk/server/src/tools/packs/acts/engine/dice.js +0 -41
- package/dist-sdk/server/src/tools/packs/acts/engine/sheet.d.ts +0 -54
- package/dist-sdk/server/src/tools/packs/acts/engine/sheet.js +0 -200
- package/dist-sdk/server/src/tools/packs/acts/index.d.ts +0 -2
- package/dist-sdk/server/src/tools/packs/acts/index.js +0 -24
- package/dist-sdk/server/src/tools/packs/acts/tools/award.tool.d.ts +0 -2
- package/dist-sdk/server/src/tools/packs/acts/tools/award.tool.js +0 -184
- package/dist-sdk/server/src/tools/packs/acts/tools/challenge.tool.d.ts +0 -2
- package/dist-sdk/server/src/tools/packs/acts/tools/challenge.tool.js +0 -107
- package/dist-sdk/server/src/tools/packs/acts/tools/chapter.tool.d.ts +0 -3
- package/dist-sdk/server/src/tools/packs/acts/tools/chapter.tool.js +0 -146
- package/dist-sdk/server/src/tools/packs/acts/tools/check.tool.d.ts +0 -4
- package/dist-sdk/server/src/tools/packs/acts/tools/check.tool.js +0 -241
- package/dist-sdk/server/src/tools/packs/acts/tools/encounter.tool.d.ts +0 -3
- package/dist-sdk/server/src/tools/packs/acts/tools/encounter.tool.js +0 -72
- package/dist-sdk/server/src/tools/packs/acts/tools/faith.tool.d.ts +0 -2
- package/dist-sdk/server/src/tools/packs/acts/tools/faith.tool.js +0 -75
- package/dist-sdk/server/src/tools/packs/acts/tools/shared.d.ts +0 -20
- package/dist-sdk/server/src/tools/packs/acts/tools/shared.js +0 -70
- package/dist-sdk/server/src/tools/packs/acts/tools/sheet.tools.d.ts +0 -4
- package/dist-sdk/server/src/tools/packs/acts/tools/sheet.tools.js +0 -215
- package/docs/.nojekyll +0 -1
- package/docs/assets/hierarchy.js +0 -1
- package/docs/assets/highlight.css +0 -113
- package/docs/assets/icons.js +0 -18
- package/docs/assets/icons.svg +0 -1
- package/docs/assets/main.js +0 -60
- package/docs/assets/navigation.js +0 -1
- package/docs/assets/search.js +0 -1
- package/docs/assets/style.css +0 -1648
- package/docs/classes/Agent.html +0 -801
- package/docs/classes/Briyah.html +0 -296
- package/docs/classes/BriyahConfigService.html +0 -119
- package/docs/classes/NativeToolRegistry.html +0 -166
- package/docs/classes/PackInstantiationService.html +0 -157
- package/docs/classes/PackService.html +0 -247
- package/docs/classes/Room.html +0 -1338
- package/docs/classes/RoomMessage.html +0 -290
- package/docs/enums/MessageAction.html +0 -136
- package/docs/functions/actsTools.html +0 -44
- package/docs/functions/availableToolPacks.html +0 -41
- package/docs/functions/buildMarkdown.html +0 -54
- package/docs/functions/dnd5eTools.html +0 -44
- package/docs/functions/installToolPacks.html +0 -48
- package/docs/functions/pageMarker.html +0 -45
- package/docs/functions/registerToolPacks.html +0 -54
- package/docs/functions/splitMarkdownIntoPages.html +0 -51
- package/docs/functions/stripWrappingFence.html +0 -52
- package/docs/hierarchy.html +0 -46
- package/docs/index.html +0 -595
- package/docs/interfaces/AgentCreationOptions.html +0 -125
- package/docs/interfaces/AgentInfo.html +0 -218
- package/docs/interfaces/AgentMessagesResponse.html +0 -74
- package/docs/interfaces/AppService.html +0 -3337
- package/docs/interfaces/Artifact.html +0 -95
- package/docs/interfaces/ArtifactMetadata.html +0 -112
- package/docs/interfaces/ArtifactWriteOptions.html +0 -90
- package/docs/interfaces/AttachDocumentResponse.html +0 -62
- package/docs/interfaces/BriyahConfigOptions.html +0 -124
- package/docs/interfaces/ChapterInfo.html +0 -62
- package/docs/interfaces/Character.html +0 -86
- package/docs/interfaces/ConversionAgent.html +0 -78
- package/docs/interfaces/CreateAgentResponse.html +0 -56
- package/docs/interfaces/CreateRoomResponse.html +0 -62
- package/docs/interfaces/CreateStoryResponse.html +0 -56
- package/docs/interfaces/FileList.html +0 -56
- package/docs/interfaces/FileMetadata.html +0 -89
- package/docs/interfaces/IConfigService.html +0 -79
- package/docs/interfaces/InstantiateModels.html +0 -64
- package/docs/interfaces/InstantiateRoomResult.html +0 -70
- package/docs/interfaces/LoadedPack.html +0 -131
- package/docs/interfaces/LoggingOptions.html +0 -92
- package/docs/interfaces/Message.html +0 -84
- package/docs/interfaces/ModelChoice.html +0 -73
- package/docs/interfaces/ModelInfo.html +0 -74
- package/docs/interfaces/NativeToolDefinition.html +0 -107
- package/docs/interfaces/PackAgentTemplate.html +0 -101
- package/docs/interfaces/PackRoomTemplate.html +0 -108
- package/docs/interfaces/PackView.html +0 -172
- package/docs/interfaces/PdfConversionOptions.html +0 -102
- package/docs/interfaces/PdfConversionResult.html +0 -97
- package/docs/interfaces/PdfMarkdownOptions.html +0 -198
- package/docs/interfaces/PdfMarkdownResult.html +0 -106
- package/docs/interfaces/PdfPageMarkdown.html +0 -94
- package/docs/interfaces/PreparedPromptResponse.html +0 -62
- package/docs/interfaces/ProcessTextResponse.html +0 -86
- package/docs/interfaces/PromptFile.html +0 -70
- package/docs/interfaces/PromptFileContent.html +0 -76
- package/docs/interfaces/PromptFilesResponse.html +0 -56
- package/docs/interfaces/PromptFolder.html +0 -80
- package/docs/interfaces/PromptFolderDefaults.html +0 -155
- package/docs/interfaces/PromptFolderDefaultsResponse.html +0 -79
- package/docs/interfaces/PromptFoldersResponse.html +0 -56
- package/docs/interfaces/RoomDetails.html +0 -151
- package/docs/interfaces/RoomErrorUpdate.html +0 -82
- package/docs/interfaces/RoomInfo.html +0 -88
- package/docs/interfaces/RoomMessageUpdate.html +0 -113
- package/docs/interfaces/RoomMessagesResponse.html +0 -62
- package/docs/interfaces/SendMessageResult.html +0 -62
- package/docs/interfaces/StoryErrorEvent.html +0 -84
- package/docs/interfaces/StoryIdea.html +0 -74
- package/docs/interfaces/StoryInfo.html +0 -198
- package/docs/interfaces/StoryIntroduceCharacterEvent.html +0 -79
- package/docs/interfaces/StoryProgressChapterEvent.html +0 -72
- package/docs/interfaces/StoryState.html +0 -108
- package/docs/interfaces/StoryStateEvent.html +0 -76
- package/docs/interfaces/ToolArtifact.html +0 -85
- package/docs/interfaces/ToolCaller.html +0 -77
- package/docs/interfaces/ToolDefinition.html +0 -80
- package/docs/interfaces/ToolHelpers.html +0 -105
- package/docs/interfaces/ToolPackDocuments.html +0 -100
- package/docs/interfaces/ToolParameter.html +0 -74
- package/docs/interfaces/ToolRoomAccess.html +0 -227
- package/docs/interfaces/ToolSummary.html +0 -74
- package/docs/interfaces/ToolsResponse.html +0 -68
- package/docs/interfaces/Transaction.html +0 -104
- package/docs/interfaces/TransactionHistoryResponse.html +0 -62
- package/docs/modules.html +0 -53
- package/docs/types/PackOrigin.html +0 -34
- package/docs/types/PromptScope.html +0 -34
- package/docs/types/RoomTurnMode.html +0 -42
- package/docs/types/RoomUpdate.html +0 -36
- package/docs/types/RosterOverrides.html +0 -42
- package/docs/types/ToolContext.html +0 -40
- package/docs/types/ToolRunResult.html +0 -34
- package/src/tools/packs/dnd5e/README.md +0 -867
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { CharacterCard, ItemCard } from '../data/cards';
|
|
2
|
-
import { AbilityEntry, HeldCard } from './sheet';
|
|
3
|
-
export declare function heldFromCard(card: ItemCard): HeldCard;
|
|
4
|
-
export declare function heldFromText(name: string, effect: string): HeldCard;
|
|
5
|
-
export declare function abilityFromCharacterCard(card: CharacterCard): AbilityEntry;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.heldFromCard = heldFromCard;
|
|
4
|
-
exports.heldFromText = heldFromText;
|
|
5
|
-
exports.abilityFromCharacterCard = abilityFromCharacterCard;
|
|
6
|
-
function heldFromCard(card) {
|
|
7
|
-
return {
|
|
8
|
-
n: card.name,
|
|
9
|
-
id: card.id,
|
|
10
|
-
e: card.effect,
|
|
11
|
-
...(card.bonus
|
|
12
|
-
? { b: { a: card.bonus.attribute, v: card.bonus.value, w: card.bonus.when } }
|
|
13
|
-
: {}),
|
|
14
|
-
...(card.limit ? { lim: card.limit } : {}),
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
function heldFromText(name, effect) {
|
|
18
|
-
return { n: name.trim(), e: effect.trim() };
|
|
19
|
-
}
|
|
20
|
-
function abilityFromCharacterCard(card) {
|
|
21
|
-
const oncePerSession = /once per session/i.test(card.ability);
|
|
22
|
-
return {
|
|
23
|
-
n: card.name,
|
|
24
|
-
e: card.ability,
|
|
25
|
-
...(oncePerSession ? { lim: 'session' } : {}),
|
|
26
|
-
};
|
|
27
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { AttrKey } from '../data/cards';
|
|
2
|
-
import { CHALLENGE_ARTIFACT } from './sheet';
|
|
3
|
-
export { CHALLENGE_ARTIFACT };
|
|
4
|
-
export type ChallengeOutcome = 'succeeded' | 'failed' | 'running';
|
|
5
|
-
export interface ChallengeRoll {
|
|
6
|
-
who: string;
|
|
7
|
-
attribute: AttrKey;
|
|
8
|
-
total: number;
|
|
9
|
-
passed: boolean;
|
|
10
|
-
stage?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface ChallengeState {
|
|
13
|
-
name: string;
|
|
14
|
-
dc: number;
|
|
15
|
-
needed: number;
|
|
16
|
-
allowed: number;
|
|
17
|
-
attributes: AttrKey[];
|
|
18
|
-
stages: string[];
|
|
19
|
-
rolls: ChallengeRoll[];
|
|
20
|
-
successes: number;
|
|
21
|
-
failures: number;
|
|
22
|
-
outcome: ChallengeOutcome;
|
|
23
|
-
}
|
|
24
|
-
export interface ChallengeSpec {
|
|
25
|
-
name: string;
|
|
26
|
-
dc: number;
|
|
27
|
-
needed: number;
|
|
28
|
-
allowed?: number;
|
|
29
|
-
attributes?: string[];
|
|
30
|
-
stages?: string[];
|
|
31
|
-
}
|
|
32
|
-
export declare function newChallenge(spec: ChallengeSpec): ChallengeState;
|
|
33
|
-
export declare function recordRoll(state: ChallengeState, roll: ChallengeRoll): ChallengeState;
|
|
34
|
-
export declare function remaining(state: ChallengeState): string;
|
|
35
|
-
export declare function currentStage(state: ChallengeState): string | undefined;
|
|
36
|
-
export declare function renderChallenge(state: ChallengeState): string;
|
|
37
|
-
export declare function parseChallenge(body: string | undefined): ChallengeState | undefined;
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CHALLENGE_ARTIFACT = void 0;
|
|
4
|
-
exports.newChallenge = newChallenge;
|
|
5
|
-
exports.recordRoll = recordRoll;
|
|
6
|
-
exports.remaining = remaining;
|
|
7
|
-
exports.currentStage = currentStage;
|
|
8
|
-
exports.renderChallenge = renderChallenge;
|
|
9
|
-
exports.parseChallenge = parseChallenge;
|
|
10
|
-
const cards_1 = require("../data/cards");
|
|
11
|
-
const sheet_1 = require("./sheet");
|
|
12
|
-
Object.defineProperty(exports, "CHALLENGE_ARTIFACT", { enumerable: true, get: function () { return sheet_1.CHALLENGE_ARTIFACT; } });
|
|
13
|
-
function newChallenge(spec) {
|
|
14
|
-
const needed = Math.trunc(spec.needed);
|
|
15
|
-
if (!Number.isFinite(needed) || needed < 1) {
|
|
16
|
-
throw new Error(`A challenge needs at least one success to be worth rolling; "${spec.name}" asks for ${spec.needed}.`);
|
|
17
|
-
}
|
|
18
|
-
const attributes = (spec.attributes || [])
|
|
19
|
-
.map((name) => String(name).toLowerCase().trim())
|
|
20
|
-
.filter((name) => cards_1.ATTRIBUTES.includes(name));
|
|
21
|
-
return {
|
|
22
|
-
name: spec.name.trim() || 'Challenge',
|
|
23
|
-
dc: Math.trunc(spec.dc),
|
|
24
|
-
needed,
|
|
25
|
-
allowed: Math.max(0, Math.trunc(spec.allowed ?? 0)),
|
|
26
|
-
attributes,
|
|
27
|
-
stages: (spec.stages || []).map((stage) => String(stage).trim()).filter(Boolean),
|
|
28
|
-
rolls: [],
|
|
29
|
-
successes: 0,
|
|
30
|
-
failures: 0,
|
|
31
|
-
outcome: 'running',
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
function recordRoll(state, roll) {
|
|
35
|
-
if (state.outcome !== 'running')
|
|
36
|
-
return state;
|
|
37
|
-
const stage = roll.stage ?? currentStage(state);
|
|
38
|
-
state.rolls.push(stage ? { ...roll, stage } : roll);
|
|
39
|
-
if (roll.passed)
|
|
40
|
-
state.successes++;
|
|
41
|
-
else
|
|
42
|
-
state.failures++;
|
|
43
|
-
if (state.successes >= state.needed) {
|
|
44
|
-
state.outcome = 'succeeded';
|
|
45
|
-
}
|
|
46
|
-
else if (state.allowed > 0 && state.failures >= state.allowed) {
|
|
47
|
-
state.outcome = 'failed';
|
|
48
|
-
}
|
|
49
|
-
else if (state.stages.length > 0 && state.rolls.length >= state.stages.length) {
|
|
50
|
-
state.outcome = state.successes >= state.needed ? 'succeeded' : 'failed';
|
|
51
|
-
}
|
|
52
|
-
return state;
|
|
53
|
-
}
|
|
54
|
-
function remaining(state) {
|
|
55
|
-
if (state.outcome === 'succeeded')
|
|
56
|
-
return 'won';
|
|
57
|
-
if (state.outcome === 'failed')
|
|
58
|
-
return 'lost';
|
|
59
|
-
const successesLeft = state.needed - state.successes;
|
|
60
|
-
const failuresLeft = state.allowed > 0 ? state.allowed - state.failures : 0;
|
|
61
|
-
const parts = [`${successesLeft} more success${successesLeft === 1 ? '' : 'es'}`];
|
|
62
|
-
if (state.allowed > 0) {
|
|
63
|
-
parts.push(`${failuresLeft} failure${failuresLeft === 1 ? '' : 's'} left`);
|
|
64
|
-
}
|
|
65
|
-
if (state.stages.length > 0) {
|
|
66
|
-
const next = state.stages[state.rolls.length];
|
|
67
|
-
if (next)
|
|
68
|
-
parts.push(`next: ${next}`);
|
|
69
|
-
}
|
|
70
|
-
return parts.join(', ');
|
|
71
|
-
}
|
|
72
|
-
function currentStage(state) {
|
|
73
|
-
return state.stages[state.rolls.length];
|
|
74
|
-
}
|
|
75
|
-
const FENCE_TAG = 'briyah-challenge';
|
|
76
|
-
function renderChallenge(state) {
|
|
77
|
-
const lines = [`# ${state.name}`, ''];
|
|
78
|
-
lines.push(`**${state.successes}** success${state.successes === 1 ? '' : 'es'} · ` +
|
|
79
|
-
`**${state.failures}** failure${state.failures === 1 ? '' : 's'} · ` +
|
|
80
|
-
`goal ${state.needed}${state.allowed > 0 ? ` before ${state.allowed}` : ''} · DC ${state.dc}`);
|
|
81
|
-
lines.push('');
|
|
82
|
-
if (state.attributes.length > 0) {
|
|
83
|
-
lines.push(`Allowed attributes: ${state.attributes.map(titleCaseAttr).join(', ')}`);
|
|
84
|
-
lines.push('');
|
|
85
|
-
}
|
|
86
|
-
if (state.rolls.length > 0) {
|
|
87
|
-
lines.push('| # | Who | Attribute | Total | Result |');
|
|
88
|
-
lines.push('|---|---|---|---|---|');
|
|
89
|
-
state.rolls.forEach((roll, index) => {
|
|
90
|
-
lines.push(`| ${index + 1}${roll.stage ? ` ${roll.stage}` : ''} | ${roll.who} | ` +
|
|
91
|
-
`${titleCaseAttr(roll.attribute)} | ${roll.total} | ${roll.passed ? 'success' : 'failure'} |`);
|
|
92
|
-
});
|
|
93
|
-
lines.push('');
|
|
94
|
-
}
|
|
95
|
-
lines.push(state.outcome === 'running'
|
|
96
|
-
? `**Running** — ${remaining(state)}.`
|
|
97
|
-
: `**${state.outcome === 'succeeded' ? 'Succeeded' : 'Failed'}.**`);
|
|
98
|
-
lines.push('');
|
|
99
|
-
lines.push('```' + FENCE_TAG);
|
|
100
|
-
lines.push(JSON.stringify(state, null, 2));
|
|
101
|
-
lines.push('```');
|
|
102
|
-
return lines.join('\n');
|
|
103
|
-
}
|
|
104
|
-
function parseChallenge(body) {
|
|
105
|
-
if (!body)
|
|
106
|
-
return undefined;
|
|
107
|
-
const fence = new RegExp('```' + FENCE_TAG + '\\s*\\n([\\s\\S]*?)\\n```');
|
|
108
|
-
const match = fence.exec(body);
|
|
109
|
-
if (!match)
|
|
110
|
-
return undefined;
|
|
111
|
-
try {
|
|
112
|
-
return JSON.parse(match[1]);
|
|
113
|
-
}
|
|
114
|
-
catch {
|
|
115
|
-
return undefined;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
function titleCaseAttr(attribute) {
|
|
119
|
-
return attribute ? attribute[0].toUpperCase() + attribute.slice(1) : attribute;
|
|
120
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export type Rng = () => number;
|
|
2
|
-
export declare const defaultRng: Rng;
|
|
3
|
-
export declare function rollDie(sides: number, rng?: Rng): number;
|
|
4
|
-
export interface Modifier {
|
|
5
|
-
source: string;
|
|
6
|
-
value: number;
|
|
7
|
-
}
|
|
8
|
-
export interface CheckResult {
|
|
9
|
-
die: number;
|
|
10
|
-
modifiers: Modifier[];
|
|
11
|
-
total: number;
|
|
12
|
-
dc: number;
|
|
13
|
-
passed: boolean;
|
|
14
|
-
natural20: boolean;
|
|
15
|
-
natural1: boolean;
|
|
16
|
-
}
|
|
17
|
-
export declare function rollCheck(dc: number, modifiers: Modifier[], rng?: Rng): CheckResult;
|
|
18
|
-
export declare function describeCheck(result: CheckResult): string;
|
|
19
|
-
export declare const DIFFICULTY_BANDS: Record<string, number>;
|
|
20
|
-
export declare function dcForBand(band: string): number | undefined;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DIFFICULTY_BANDS = exports.defaultRng = void 0;
|
|
4
|
-
exports.rollDie = rollDie;
|
|
5
|
-
exports.rollCheck = rollCheck;
|
|
6
|
-
exports.describeCheck = describeCheck;
|
|
7
|
-
exports.dcForBand = dcForBand;
|
|
8
|
-
exports.defaultRng = Math.random;
|
|
9
|
-
function rollDie(sides, rng = exports.defaultRng) {
|
|
10
|
-
return Math.floor(rng() * sides) + 1;
|
|
11
|
-
}
|
|
12
|
-
function rollCheck(dc, modifiers, rng = exports.defaultRng) {
|
|
13
|
-
const die = rollDie(20, rng);
|
|
14
|
-
const total = modifiers.reduce((sum, modifier) => sum + modifier.value, die);
|
|
15
|
-
return {
|
|
16
|
-
die,
|
|
17
|
-
modifiers,
|
|
18
|
-
total,
|
|
19
|
-
dc,
|
|
20
|
-
passed: total >= dc,
|
|
21
|
-
natural20: die === 20,
|
|
22
|
-
natural1: die === 1,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
function describeCheck(result) {
|
|
26
|
-
const parts = result.modifiers
|
|
27
|
-
.filter((modifier) => modifier.value !== 0)
|
|
28
|
-
.map((modifier) => `${modifier.value >= 0 ? '+' : ''}${modifier.value} ${modifier.source}`);
|
|
29
|
-
const sum = [`d20 ${result.die}`, ...parts].join(' ');
|
|
30
|
-
return `${sum} = ${result.total} vs DC ${result.dc} — ${result.passed ? 'success' : 'failure'}`;
|
|
31
|
-
}
|
|
32
|
-
exports.DIFFICULTY_BANDS = {
|
|
33
|
-
easy: 10,
|
|
34
|
-
normal: 12,
|
|
35
|
-
standard: 12,
|
|
36
|
-
hard: 14,
|
|
37
|
-
very_hard: 16,
|
|
38
|
-
};
|
|
39
|
-
function dcForBand(band) {
|
|
40
|
-
return exports.DIFFICULTY_BANDS[(band || '').toLowerCase().replace(/[\s-]+/g, '_')];
|
|
41
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { AttrKey, CardLimit } from '../data/cards';
|
|
2
|
-
export declare const SHEET_STATE_VERSION = 1;
|
|
3
|
-
export declare const SHEET_NAME_PREFIX = "Sheet: ";
|
|
4
|
-
export declare const PARTY_STATUS_ARTIFACT = "Party Status";
|
|
5
|
-
export declare const CHALLENGE_ARTIFACT = "Challenge";
|
|
6
|
-
export declare const SESSION_PROGRESS_ARTIFACT = "Session Progress";
|
|
7
|
-
export declare const MAX_FAITH_POINTS = 10;
|
|
8
|
-
export declare const ATTRIBUTE_ARRAY: number[];
|
|
9
|
-
export interface AbilityEntry {
|
|
10
|
-
n: string;
|
|
11
|
-
e: string;
|
|
12
|
-
lim?: CardLimit;
|
|
13
|
-
sp?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export interface HeldCard {
|
|
16
|
-
n: string;
|
|
17
|
-
id?: string;
|
|
18
|
-
e: string;
|
|
19
|
-
b?: {
|
|
20
|
-
a: AttrKey;
|
|
21
|
-
v: number;
|
|
22
|
-
w: string;
|
|
23
|
-
};
|
|
24
|
-
lim?: CardLimit;
|
|
25
|
-
sp?: boolean;
|
|
26
|
-
}
|
|
27
|
-
export interface ActsSheetState {
|
|
28
|
-
v: number;
|
|
29
|
-
name: string;
|
|
30
|
-
player?: string;
|
|
31
|
-
background: string;
|
|
32
|
-
attr: Record<AttrKey, number>;
|
|
33
|
-
fp: number;
|
|
34
|
-
abilities: AbilityEntry[];
|
|
35
|
-
items: HeldCard[];
|
|
36
|
-
events: string[];
|
|
37
|
-
allies: string[];
|
|
38
|
-
chapters: number[];
|
|
39
|
-
}
|
|
40
|
-
export declare class SheetError extends Error {
|
|
41
|
-
constructor(message: string);
|
|
42
|
-
}
|
|
43
|
-
export declare function sheetArtifactName(characterName: string): string;
|
|
44
|
-
export declare function characterNameFromArtifact(artifactName: string): string;
|
|
45
|
-
export declare function isSheetArtifact(artifactName: string): boolean;
|
|
46
|
-
export declare function emptyAttributes(): Record<AttrKey, number>;
|
|
47
|
-
export declare function parseSheet(body: string): ActsSheetState;
|
|
48
|
-
export declare function normalizeState(raw: any): ActsSheetState;
|
|
49
|
-
export declare function clamp(value: number, min: number, max: number): number;
|
|
50
|
-
export declare function extractNotes(body: string): string;
|
|
51
|
-
export declare function renderSheet(state: ActsSheetState, notes: string): string;
|
|
52
|
-
export declare function titleCase(text: string): string;
|
|
53
|
-
export declare function partyLine(state: ActsSheetState): string;
|
|
54
|
-
export declare function renderPartyStatus(states: readonly ActsSheetState[]): string;
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SheetError = exports.ATTRIBUTE_ARRAY = exports.MAX_FAITH_POINTS = exports.SESSION_PROGRESS_ARTIFACT = exports.CHALLENGE_ARTIFACT = exports.PARTY_STATUS_ARTIFACT = exports.SHEET_NAME_PREFIX = exports.SHEET_STATE_VERSION = void 0;
|
|
4
|
-
exports.sheetArtifactName = sheetArtifactName;
|
|
5
|
-
exports.characterNameFromArtifact = characterNameFromArtifact;
|
|
6
|
-
exports.isSheetArtifact = isSheetArtifact;
|
|
7
|
-
exports.emptyAttributes = emptyAttributes;
|
|
8
|
-
exports.parseSheet = parseSheet;
|
|
9
|
-
exports.normalizeState = normalizeState;
|
|
10
|
-
exports.clamp = clamp;
|
|
11
|
-
exports.extractNotes = extractNotes;
|
|
12
|
-
exports.renderSheet = renderSheet;
|
|
13
|
-
exports.titleCase = titleCase;
|
|
14
|
-
exports.partyLine = partyLine;
|
|
15
|
-
exports.renderPartyStatus = renderPartyStatus;
|
|
16
|
-
const cards_1 = require("../data/cards");
|
|
17
|
-
exports.SHEET_STATE_VERSION = 1;
|
|
18
|
-
exports.SHEET_NAME_PREFIX = 'Sheet: ';
|
|
19
|
-
exports.PARTY_STATUS_ARTIFACT = 'Party Status';
|
|
20
|
-
exports.CHALLENGE_ARTIFACT = 'Challenge';
|
|
21
|
-
exports.SESSION_PROGRESS_ARTIFACT = 'Session Progress';
|
|
22
|
-
const STATE_FENCE_TAG = 'briyah-state';
|
|
23
|
-
const NOTES_OPEN = '<!-- briyah:notes -->';
|
|
24
|
-
const NOTES_CLOSE = '<!-- /briyah:notes -->';
|
|
25
|
-
const MAX_NOTES_CHARS = 1500;
|
|
26
|
-
exports.MAX_FAITH_POINTS = 10;
|
|
27
|
-
exports.ATTRIBUTE_ARRAY = [3, 2, 2, 1, 1];
|
|
28
|
-
class SheetError extends Error {
|
|
29
|
-
constructor(message) {
|
|
30
|
-
super(message);
|
|
31
|
-
this.name = 'SheetError';
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.SheetError = SheetError;
|
|
35
|
-
function sheetArtifactName(characterName) {
|
|
36
|
-
return `${exports.SHEET_NAME_PREFIX}${characterName.trim()}`;
|
|
37
|
-
}
|
|
38
|
-
function characterNameFromArtifact(artifactName) {
|
|
39
|
-
return artifactName.slice(exports.SHEET_NAME_PREFIX.length).trim();
|
|
40
|
-
}
|
|
41
|
-
function isSheetArtifact(artifactName) {
|
|
42
|
-
return artifactName.startsWith(exports.SHEET_NAME_PREFIX);
|
|
43
|
-
}
|
|
44
|
-
function emptyAttributes() {
|
|
45
|
-
return { faith: 0, compassion: 0, knowledge: 0, wisdom: 0, courage: 0 };
|
|
46
|
-
}
|
|
47
|
-
function parseSheet(body) {
|
|
48
|
-
const fence = new RegExp('```' + STATE_FENCE_TAG + '\\s*\\n([\\s\\S]*?)\\n```');
|
|
49
|
-
const match = fence.exec(body || '');
|
|
50
|
-
if (!match) {
|
|
51
|
-
throw new SheetError(`This sheet has no \`\`\`${STATE_FENCE_TAG} block, so its data cannot be read. ` +
|
|
52
|
-
'Do not overwrite it — the character\'s items and Faith Points are only in that block. ' +
|
|
53
|
-
'Recover the last good copy from the Artifacts tab, or rebuild the character with create_character ' +
|
|
54
|
-
'only if the sheet is genuinely empty.');
|
|
55
|
-
}
|
|
56
|
-
let raw;
|
|
57
|
-
try {
|
|
58
|
-
raw = JSON.parse(match[1]);
|
|
59
|
-
}
|
|
60
|
-
catch (error) {
|
|
61
|
-
throw new SheetError(`This sheet's \`\`\`${STATE_FENCE_TAG} block is not valid JSON (${error.message}), so its data ` +
|
|
62
|
-
'cannot be read. Do not overwrite it — fix the block in the Artifacts tab instead.');
|
|
63
|
-
}
|
|
64
|
-
return normalizeState(raw);
|
|
65
|
-
}
|
|
66
|
-
function normalizeState(raw) {
|
|
67
|
-
const attr = emptyAttributes();
|
|
68
|
-
for (const key of cards_1.ATTRIBUTES) {
|
|
69
|
-
const value = Number(raw?.attr?.[key]);
|
|
70
|
-
attr[key] = Number.isFinite(value) ? Math.trunc(value) : 0;
|
|
71
|
-
}
|
|
72
|
-
return {
|
|
73
|
-
v: Number(raw?.v) || exports.SHEET_STATE_VERSION,
|
|
74
|
-
name: String(raw?.name || '').trim(),
|
|
75
|
-
...(raw?.player ? { player: String(raw.player).trim() } : {}),
|
|
76
|
-
background: String(raw?.background || '').trim(),
|
|
77
|
-
attr,
|
|
78
|
-
fp: clamp(Number(raw?.fp) || 0, 0, exports.MAX_FAITH_POINTS),
|
|
79
|
-
abilities: Array.isArray(raw?.abilities) ? raw.abilities.filter(hasName) : [],
|
|
80
|
-
items: Array.isArray(raw?.items) ? raw.items.filter(hasName) : [],
|
|
81
|
-
events: Array.isArray(raw?.events) ? raw.events.map(String) : [],
|
|
82
|
-
allies: Array.isArray(raw?.allies) ? raw.allies.map(String) : [],
|
|
83
|
-
chapters: Array.isArray(raw?.chapters) ? normalizeChapters(raw.chapters) : [],
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
function hasName(entry) {
|
|
87
|
-
return entry && typeof entry.n === 'string' && entry.n.trim().length > 0;
|
|
88
|
-
}
|
|
89
|
-
function normalizeChapters(raw) {
|
|
90
|
-
const chapters = raw.map((value) => Number(value)).filter((value) => Number.isInteger(value));
|
|
91
|
-
return [...new Set(chapters)].sort((a, b) => a - b);
|
|
92
|
-
}
|
|
93
|
-
function clamp(value, min, max) {
|
|
94
|
-
return Math.max(min, Math.min(max, value));
|
|
95
|
-
}
|
|
96
|
-
function extractNotes(body) {
|
|
97
|
-
const open = (body || '').indexOf(NOTES_OPEN);
|
|
98
|
-
const close = (body || '').indexOf(NOTES_CLOSE);
|
|
99
|
-
if (open === -1 || close === -1 || close < open)
|
|
100
|
-
return '';
|
|
101
|
-
return body.slice(open + NOTES_OPEN.length, close).trim();
|
|
102
|
-
}
|
|
103
|
-
function signed(value) {
|
|
104
|
-
return value >= 0 ? `+${value}` : `${value}`;
|
|
105
|
-
}
|
|
106
|
-
function faithBoxes(points) {
|
|
107
|
-
const held = clamp(points, 0, exports.MAX_FAITH_POINTS);
|
|
108
|
-
return '▣'.repeat(held) + '☐'.repeat(exports.MAX_FAITH_POINTS - held);
|
|
109
|
-
}
|
|
110
|
-
function renderSheet(state, notes) {
|
|
111
|
-
const lines = [];
|
|
112
|
-
lines.push(`# ${state.name || 'Unnamed character'}`);
|
|
113
|
-
const who = [state.background, state.player ? `played by ${state.player}` : '']
|
|
114
|
-
.filter(Boolean)
|
|
115
|
-
.join(' · ');
|
|
116
|
-
if (who)
|
|
117
|
-
lines.push(`*${who}*`);
|
|
118
|
-
lines.push('');
|
|
119
|
-
lines.push('## Attributes');
|
|
120
|
-
lines.push('');
|
|
121
|
-
lines.push(cards_1.ATTRIBUTES.map((key) => `**${titleCase(key)}** ${signed(state.attr[key])}`).join(' · '));
|
|
122
|
-
lines.push('');
|
|
123
|
-
lines.push(`## Faith Points — ${state.fp}/${exports.MAX_FAITH_POINTS}`);
|
|
124
|
-
lines.push('');
|
|
125
|
-
lines.push(faithBoxes(state.fp));
|
|
126
|
-
lines.push('');
|
|
127
|
-
lines.push('*Spend one to reroll a failed roll, or to add +2 to a roll.*');
|
|
128
|
-
lines.push('');
|
|
129
|
-
lines.push('## Abilities');
|
|
130
|
-
lines.push('');
|
|
131
|
-
if (state.abilities.length === 0) {
|
|
132
|
-
lines.push('*None yet.*');
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
for (const ability of state.abilities) {
|
|
136
|
-
const spent = ability.sp ? ' — **used**' : '';
|
|
137
|
-
const limit = ability.lim ? ` *(once per ${ability.lim})*` : '';
|
|
138
|
-
lines.push(`- **${ability.n}**${limit} — ${ability.e}${spent}`);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
lines.push('');
|
|
142
|
-
lines.push('## Inventory');
|
|
143
|
-
lines.push('');
|
|
144
|
-
if (state.items.length === 0) {
|
|
145
|
-
lines.push('*Nothing yet.*');
|
|
146
|
-
}
|
|
147
|
-
else {
|
|
148
|
-
for (const item of state.items) {
|
|
149
|
-
const spent = item.sp ? ' — **used**' : '';
|
|
150
|
-
const limit = item.lim ? ` *(once per ${item.lim})*` : '';
|
|
151
|
-
lines.push(`- **${item.n}**${limit} — ${item.e}${spent}`);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
lines.push('');
|
|
155
|
-
if (state.events.length > 0) {
|
|
156
|
-
lines.push('## Event Cards');
|
|
157
|
-
lines.push('');
|
|
158
|
-
lines.push(state.events.map((name) => `- ${name}`).join('\n'));
|
|
159
|
-
lines.push('');
|
|
160
|
-
}
|
|
161
|
-
if (state.allies.length > 0) {
|
|
162
|
-
lines.push('## Character Cards');
|
|
163
|
-
lines.push('');
|
|
164
|
-
lines.push(state.allies.map((name) => `- ${name}`).join('\n'));
|
|
165
|
-
lines.push('');
|
|
166
|
-
}
|
|
167
|
-
lines.push('## Chapters played');
|
|
168
|
-
lines.push('');
|
|
169
|
-
lines.push(state.chapters.length > 0
|
|
170
|
-
? state.chapters.map((chapter) => `Acts ${chapter}`).join(', ')
|
|
171
|
-
: '*None yet.*');
|
|
172
|
-
lines.push('');
|
|
173
|
-
lines.push('## Notes');
|
|
174
|
-
lines.push('');
|
|
175
|
-
lines.push(NOTES_OPEN);
|
|
176
|
-
lines.push(notes ? notes.slice(0, MAX_NOTES_CHARS) : '');
|
|
177
|
-
lines.push(NOTES_CLOSE);
|
|
178
|
-
lines.push('');
|
|
179
|
-
lines.push('<!-- Canonical state. Do not hand-edit: every tool reads and rewrites this block. -->');
|
|
180
|
-
lines.push('```' + STATE_FENCE_TAG);
|
|
181
|
-
lines.push(JSON.stringify(state, null, 2));
|
|
182
|
-
lines.push('```');
|
|
183
|
-
return lines.join('\n');
|
|
184
|
-
}
|
|
185
|
-
function titleCase(text) {
|
|
186
|
-
return (text || '')
|
|
187
|
-
.split(/\s+/)
|
|
188
|
-
.map((word) => (word ? word[0].toUpperCase() + word.slice(1).toLowerCase() : word))
|
|
189
|
-
.join(' ');
|
|
190
|
-
}
|
|
191
|
-
function partyLine(state) {
|
|
192
|
-
const attrs = cards_1.ATTRIBUTES.map((key) => `${titleCase(key).slice(0, 3)} ${signed(state.attr[key])}`).join(' ');
|
|
193
|
-
const items = state.items.length === 1 ? '1 item' : `${state.items.length} items`;
|
|
194
|
-
return `**${state.name}** — ${state.background || 'role unrecorded'} · ${attrs} · Faith Points ${state.fp}/${exports.MAX_FAITH_POINTS} · ${items}`;
|
|
195
|
-
}
|
|
196
|
-
function renderPartyStatus(states) {
|
|
197
|
-
if (states.length === 0)
|
|
198
|
-
return '# Party Status\n\n*No characters yet.*';
|
|
199
|
-
return ['# Party Status', '', ...states.map((state) => `- ${partyLine(state)}`)].join('\n');
|
|
200
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.actsTools = actsTools;
|
|
4
|
-
const check_tool_1 = require("./tools/check.tool");
|
|
5
|
-
const faith_tool_1 = require("./tools/faith.tool");
|
|
6
|
-
const challenge_tool_1 = require("./tools/challenge.tool");
|
|
7
|
-
const award_tool_1 = require("./tools/award.tool");
|
|
8
|
-
const chapter_tool_1 = require("./tools/chapter.tool");
|
|
9
|
-
const encounter_tool_1 = require("./tools/encounter.tool");
|
|
10
|
-
const sheet_tools_1 = require("./tools/sheet.tools");
|
|
11
|
-
function actsTools() {
|
|
12
|
-
return [
|
|
13
|
-
check_tool_1.checkTool,
|
|
14
|
-
encounter_tool_1.rollDiceTool,
|
|
15
|
-
faith_tool_1.faithPointsTool,
|
|
16
|
-
challenge_tool_1.challengeTool,
|
|
17
|
-
sheet_tools_1.createSheetTool,
|
|
18
|
-
sheet_tools_1.readSheetTool,
|
|
19
|
-
sheet_tools_1.patchSheetTool,
|
|
20
|
-
award_tool_1.awardTool,
|
|
21
|
-
chapter_tool_1.chapterTool,
|
|
22
|
-
encounter_tool_1.encounterTool,
|
|
23
|
-
];
|
|
24
|
-
}
|