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,8 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plumbing shared by every tool in the pack: locating a character's sheet in the
|
|
3
|
+
* room, writing it back, and the two result shapes the tools return.
|
|
4
|
+
*
|
|
5
|
+
* Two distinct failure channels, used consistently across the pack:
|
|
6
|
+
*
|
|
7
|
+
* - **Operational failures** — a bad argument, an unknown character, a corrupt
|
|
8
|
+
* sheet, no room — are thrown. Briyah turns a thrown error into
|
|
9
|
+
* `{ ok: false, error }`, which reads to the model as "the tool malfunctioned".
|
|
10
|
+
* - **Rules refusals** — no spell slots left, already dead — are *returned*, with
|
|
11
|
+
* `applied: false`, the rule that was violated, and legal alternatives. They
|
|
12
|
+
* read as a ruling rather than a malfunction, which is what stops the model
|
|
13
|
+
* retrying the same call.
|
|
14
|
+
*/
|
|
1
15
|
import { ToolHelpers, ToolPackDocuments, ToolRoomAccess } from '../../../native-tool.types';
|
|
2
16
|
import { GuideKind } from '../engine/guides';
|
|
3
17
|
import { MutationResult, Refusal } from '../engine/character';
|
|
4
18
|
import { Combatant, EncounterState } from '../engine/encounter';
|
|
5
19
|
import { SheetError, SheetState } from '../engine/sheet';
|
|
20
|
+
/** The shape a rules refusal takes in a tool result. */
|
|
6
21
|
export interface RefusalResult {
|
|
7
22
|
applied: false;
|
|
8
23
|
violation: string;
|
|
@@ -11,38 +26,187 @@ export interface RefusalResult {
|
|
|
11
26
|
options?: string[];
|
|
12
27
|
state?: Record<string, any>;
|
|
13
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Returns the room a tool is executing in.
|
|
31
|
+
* @param helpers The helpers Briyah passed the handler
|
|
32
|
+
* @returns The room access
|
|
33
|
+
* @throws If there is no room, which today means the tool-test panel
|
|
34
|
+
*/
|
|
14
35
|
export declare function requireRoom(helpers: ToolHelpers): ToolRoomAccess;
|
|
36
|
+
/**
|
|
37
|
+
* Returns read access to the pack's shipped documents.
|
|
38
|
+
* @param helpers The helpers Briyah passed the handler
|
|
39
|
+
* @returns The document access
|
|
40
|
+
* @throws If the host wired none in, which no running server does
|
|
41
|
+
*/
|
|
15
42
|
export declare function requirePackDocuments(helpers: ToolHelpers): ToolPackDocuments;
|
|
43
|
+
/** A character's sheet, as loaded from the room. */
|
|
16
44
|
export interface LoadedSheet {
|
|
17
45
|
artifactName: string;
|
|
18
46
|
characterName: string;
|
|
19
47
|
state: SheetState;
|
|
48
|
+
/** The free-prose region, to be spliced back on write. */
|
|
20
49
|
notes: string;
|
|
50
|
+
/** Values that had to be clamped when reading, for the caller to report. */
|
|
21
51
|
warnings: string[];
|
|
22
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* The character names that have a sheet in this room.
|
|
55
|
+
*
|
|
56
|
+
* Party only. Monsters are filed under their own prefix so that this — and therefore
|
|
57
|
+
* `Party Status`, which every player reads — never includes them.
|
|
58
|
+
*/
|
|
23
59
|
export declare function listCharacterNames(room: ToolRoomAccess): string[];
|
|
60
|
+
/** The monsters currently in the fight. */
|
|
24
61
|
export declare function listFoeNames(room: ToolRoomAccess): string[];
|
|
62
|
+
/**
|
|
63
|
+
* Removes the monsters left over from a previous fight, keeping the ones taking
|
|
64
|
+
* part in this one.
|
|
65
|
+
*
|
|
66
|
+
* Called when a new encounter starts rather than when the last one ends, because a
|
|
67
|
+
* fight finishes with a message rather than a tool call and the end may never be
|
|
68
|
+
* signalled. Clearing on the way in means a leftover costs one unused artifact
|
|
69
|
+
* rather than a monster with stale hit points joining the next fight.
|
|
70
|
+
*
|
|
71
|
+
* `keep` matters more than it looks: a fight is set up by placing the monsters and
|
|
72
|
+
* *then* rolling initiative, so clearing everything would delete the combatants just
|
|
73
|
+
* placed. Anything named in the initiative order is in this fight by definition.
|
|
74
|
+
* @param room The room access
|
|
75
|
+
* @param keep Combatant names that are part of the fight starting now
|
|
76
|
+
* @returns The names removed
|
|
77
|
+
*/
|
|
78
|
+
/**
|
|
79
|
+
* Whether a combatant is out of the fight and should not be given a turn.
|
|
80
|
+
*
|
|
81
|
+
* Only monsters. A character at 0 hit points is dying and still rolls death saving
|
|
82
|
+
* throws on their turn, so skipping them would quietly stop the clock on whether
|
|
83
|
+
* they live — the opposite of what is wanted.
|
|
84
|
+
* @param room The room access
|
|
85
|
+
* @param combatant The combatant to judge
|
|
86
|
+
* @returns True when the fight should pass them over
|
|
87
|
+
*/
|
|
25
88
|
export declare function isDown(room: ToolRoomAccess, combatant: Combatant): boolean;
|
|
89
|
+
/** The monsters currently down, for the render. */
|
|
26
90
|
export declare function downNames(room: ToolRoomAccess, state: EncounterState): string[];
|
|
91
|
+
/**
|
|
92
|
+
* Reads the fight in progress, treating a corrupt artifact as no fight.
|
|
93
|
+
*
|
|
94
|
+
* The swallow is deliberate and narrow. `encounter` itself parses strictly, because
|
|
95
|
+
* it is about to overwrite the thing and a bad parse there would destroy the order.
|
|
96
|
+
* Every other caller only wants to know whose turn it is, and a corrupt artifact
|
|
97
|
+
* must not stop a die being rolled.
|
|
98
|
+
* @param room The room access
|
|
99
|
+
* @returns The encounter, or null when there is none or it cannot be read
|
|
100
|
+
*/
|
|
27
101
|
export declare function readEncounter(room: ToolRoomAccess): EncounterState | null;
|
|
102
|
+
/**
|
|
103
|
+
* Writes the encounter back.
|
|
104
|
+
*
|
|
105
|
+
* **Transient**, like the sheets and `Party Status` and for the same reason: it
|
|
106
|
+
* changes every turn, and cached it would throw away the prompt prefix of every
|
|
107
|
+
* agent that can see it that often. A few lines re-sent to whoever is being prompted
|
|
108
|
+
* is much cheaper.
|
|
109
|
+
*
|
|
110
|
+
* Visible to everyone, because turn order is not secret — the players know what
|
|
111
|
+
* order they act in. Monster hit points are deliberately not here; they live on the
|
|
112
|
+
* creatures, where the party cannot read them.
|
|
113
|
+
* @param room The room access
|
|
114
|
+
* @param state The encounter to store
|
|
115
|
+
*/
|
|
28
116
|
export declare function writeEncounter(room: ToolRoomAccess, state: EncounterState): void;
|
|
29
117
|
export declare function clearFoes(room: ToolRoomAccess, keep?: string[]): string[];
|
|
118
|
+
/**
|
|
119
|
+
* Loads a character's sheet, matching the name loosely.
|
|
120
|
+
* @param room The room access
|
|
121
|
+
* @param name The character name as the model supplied it
|
|
122
|
+
* @returns The loaded sheet
|
|
123
|
+
* @throws With a message naming the closest match and every known sheet, so the
|
|
124
|
+
* model can correct itself in one step
|
|
125
|
+
*/
|
|
30
126
|
export declare function loadSheet(room: ToolRoomAccess, name: string): LoadedSheet;
|
|
127
|
+
/**
|
|
128
|
+
* Reads a sheet, mutates it and writes it back without yielding, so two
|
|
129
|
+
* concurrent tool calls cannot interleave a read-modify-write.
|
|
130
|
+
*
|
|
131
|
+
* The sheet is attributed to the character's owner rather than to the calling
|
|
132
|
+
* agent, and scoped to that owner alone.
|
|
133
|
+
*
|
|
134
|
+
* It is written **transient**, so the owner receives it in the uncached per-turn
|
|
135
|
+
* prompt rather than the cached artifact block. Hit points move every round, and
|
|
136
|
+
* a cached sheet threw away its owner's cached class document on every change.
|
|
137
|
+
* Transient inverts that: the sheet costs full price on each of the owner's turns
|
|
138
|
+
* and nothing on anyone else's, which is the right trade for a page of state that
|
|
139
|
+
* never stops moving.
|
|
140
|
+
*
|
|
141
|
+
* @param room The room access
|
|
142
|
+
* @param name The character name
|
|
143
|
+
* @param mutate Produces the new state, or a refusal. Must not await.
|
|
144
|
+
* @returns The mutation result, with the state as written
|
|
145
|
+
*/
|
|
31
146
|
export declare function mutateSheet(room: ToolRoomAccess, name: string, mutate: (sheet: LoadedSheet) => MutationResult): {
|
|
32
147
|
result: MutationResult;
|
|
33
148
|
sheet: LoadedSheet;
|
|
34
149
|
};
|
|
150
|
+
/**
|
|
151
|
+
* Writes a sheet that may not exist yet.
|
|
152
|
+
* @param room The room access
|
|
153
|
+
* @param state The state to write
|
|
154
|
+
* @param notes The prose region to preserve
|
|
155
|
+
* @param replace When false, refuses to overwrite an existing sheet
|
|
156
|
+
* @returns The artifact name written
|
|
157
|
+
* @throws If a sheet already exists and `replace` is false
|
|
158
|
+
*/
|
|
35
159
|
export declare function writeNewSheet(room: ToolRoomAccess, state: SheetState, notes: string, replace: boolean): string;
|
|
160
|
+
/**
|
|
161
|
+
* Rewrites the shared party summary from every sheet in the room. Always a full
|
|
162
|
+
* re-render rather than an incremental patch, so it is idempotent and the last
|
|
163
|
+
* writer is always correct even if two tool calls overlap.
|
|
164
|
+
* @param room The room access
|
|
165
|
+
* @returns The one-line-per-character summary that was written
|
|
166
|
+
*/
|
|
36
167
|
export declare function refreshPartyStatus(room: ToolRoomAccess): string;
|
|
168
|
+
/** What {@link shareGuide} did, for the calling tool to report. */
|
|
37
169
|
export interface GuideShare {
|
|
170
|
+
/** The room artifact the guide now lives in. */
|
|
38
171
|
artifactName: string;
|
|
172
|
+
/** Every agent that can now read it. */
|
|
39
173
|
viewers: string[];
|
|
174
|
+
/** Agents that were named but are not in this room, so the caller can correct itself. */
|
|
40
175
|
unknown: string[];
|
|
176
|
+
/** True when the artifact did not exist before this call. */
|
|
41
177
|
created: boolean;
|
|
42
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* Puts a class or background document in the room as an artifact the named players
|
|
181
|
+
* can read.
|
|
182
|
+
*
|
|
183
|
+
* One artifact per class or background, shared by everyone who has it, and **cached
|
|
184
|
+
* rather than transient**: these documents never change, which is exactly the case
|
|
185
|
+
* caching is for. The trade is the other way round from a sheet — a sheet moves every
|
|
186
|
+
* round and would throw its viewer's cached prefix away, while this is written once
|
|
187
|
+
* during character creation and then read free on every turn for the rest of the
|
|
188
|
+
* campaign.
|
|
189
|
+
*
|
|
190
|
+
* Viewers accumulate, so a second wizard joining does not evict the first. The
|
|
191
|
+
* calling agent is always one, because the creator builds from the document it is
|
|
192
|
+
* sharing — which also keeps it carrying only what the party actually took rather
|
|
193
|
+
* than every class in the book.
|
|
194
|
+
*
|
|
195
|
+
* @param room The room access
|
|
196
|
+
* @param kind Which kind of document it is, which decides the artifact's name
|
|
197
|
+
* @param name The class or background the document describes
|
|
198
|
+
* @param body The document's text
|
|
199
|
+
* @param players Agent nicknames to share it with, as the model supplied them
|
|
200
|
+
* @returns What was written, and any name that matched no agent here
|
|
201
|
+
*/
|
|
43
202
|
export declare function shareGuide(room: ToolRoomAccess, kind: GuideKind, name: string, body: string, players: readonly string[]): GuideShare;
|
|
203
|
+
/** One compact line describing a character's live state. */
|
|
44
204
|
export declare function partyLine(state: SheetState): string;
|
|
205
|
+
/** Turns an engine refusal into the tool result shape. */
|
|
45
206
|
export declare function toRefusalResult(refusal: Refusal, state?: SheetState): RefusalResult;
|
|
207
|
+
/** The compact live-state block attached to results, for the DM to narrate from. */
|
|
46
208
|
export declare function liveState(state: SheetState): Record<string, any>;
|
|
209
|
+
/** Re-raises a sheet parse failure as a refusal the DM can act on. */
|
|
47
210
|
export declare function sheetErrorToRefusal(error: SheetError, artifactName: string): RefusalResult;
|
|
211
|
+
/** A short header line describing a character, for read results. */
|
|
48
212
|
export declare function sheetHeadline(state: SheetState): string;
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Plumbing shared by every tool in the pack: locating a character's sheet in the
|
|
4
|
+
* room, writing it back, and the two result shapes the tools return.
|
|
5
|
+
*
|
|
6
|
+
* Two distinct failure channels, used consistently across the pack:
|
|
7
|
+
*
|
|
8
|
+
* - **Operational failures** — a bad argument, an unknown character, a corrupt
|
|
9
|
+
* sheet, no room — are thrown. Briyah turns a thrown error into
|
|
10
|
+
* `{ ok: false, error }`, which reads to the model as "the tool malfunctioned".
|
|
11
|
+
* - **Rules refusals** — no spell slots left, already dead — are *returned*, with
|
|
12
|
+
* `applied: false`, the rule that was violated, and legal alternatives. They
|
|
13
|
+
* read as a ruling rather than a malfunction, which is what stops the model
|
|
14
|
+
* retrying the same call.
|
|
15
|
+
*/
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
17
|
exports.requireRoom = requireRoom;
|
|
4
18
|
exports.requirePackDocuments = requirePackDocuments;
|
|
@@ -25,31 +39,77 @@ const character_1 = require("../engine/character");
|
|
|
25
39
|
const encounter_1 = require("../engine/encounter");
|
|
26
40
|
const sheet_1 = require("../engine/sheet");
|
|
27
41
|
const rules_1 = require("../engine/rules");
|
|
42
|
+
/**
|
|
43
|
+
* Returns the room a tool is executing in.
|
|
44
|
+
* @param helpers The helpers Briyah passed the handler
|
|
45
|
+
* @returns The room access
|
|
46
|
+
* @throws If there is no room, which today means the tool-test panel
|
|
47
|
+
*/
|
|
28
48
|
function requireRoom(helpers) {
|
|
29
49
|
if (!helpers.room) {
|
|
30
50
|
throw new Error('This tool needs a room: run it from a room conversation rather than the Tools test panel.');
|
|
31
51
|
}
|
|
32
52
|
return helpers.room;
|
|
33
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Returns read access to the pack's shipped documents.
|
|
56
|
+
* @param helpers The helpers Briyah passed the handler
|
|
57
|
+
* @returns The document access
|
|
58
|
+
* @throws If the host wired none in, which no running server does
|
|
59
|
+
*/
|
|
34
60
|
function requirePackDocuments(helpers) {
|
|
35
61
|
if (!helpers.packDocuments) {
|
|
36
62
|
throw new Error('This tool needs to read the pack\'s documents, and this deployment provides no access to them.');
|
|
37
63
|
}
|
|
38
64
|
return helpers.packDocuments;
|
|
39
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* The character names that have a sheet in this room.
|
|
68
|
+
*
|
|
69
|
+
* Party only. Monsters are filed under their own prefix so that this — and therefore
|
|
70
|
+
* `Party Status`, which every player reads — never includes them.
|
|
71
|
+
*/
|
|
40
72
|
function listCharacterNames(room) {
|
|
41
73
|
return room
|
|
42
74
|
.list()
|
|
43
75
|
.filter(sheet_1.isSheetArtifact)
|
|
44
76
|
.map(sheet_1.characterNameFromArtifact);
|
|
45
77
|
}
|
|
78
|
+
/** The monsters currently in the fight. */
|
|
46
79
|
function listFoeNames(room) {
|
|
47
80
|
return room.list().filter(sheet_1.isFoeArtifact).map(sheet_1.foeNameFromArtifact);
|
|
48
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Removes the monsters left over from a previous fight, keeping the ones taking
|
|
84
|
+
* part in this one.
|
|
85
|
+
*
|
|
86
|
+
* Called when a new encounter starts rather than when the last one ends, because a
|
|
87
|
+
* fight finishes with a message rather than a tool call and the end may never be
|
|
88
|
+
* signalled. Clearing on the way in means a leftover costs one unused artifact
|
|
89
|
+
* rather than a monster with stale hit points joining the next fight.
|
|
90
|
+
*
|
|
91
|
+
* `keep` matters more than it looks: a fight is set up by placing the monsters and
|
|
92
|
+
* *then* rolling initiative, so clearing everything would delete the combatants just
|
|
93
|
+
* placed. Anything named in the initiative order is in this fight by definition.
|
|
94
|
+
* @param room The room access
|
|
95
|
+
* @param keep Combatant names that are part of the fight starting now
|
|
96
|
+
* @returns The names removed
|
|
97
|
+
*/
|
|
98
|
+
/**
|
|
99
|
+
* Whether a combatant is out of the fight and should not be given a turn.
|
|
100
|
+
*
|
|
101
|
+
* Only monsters. A character at 0 hit points is dying and still rolls death saving
|
|
102
|
+
* throws on their turn, so skipping them would quietly stop the clock on whether
|
|
103
|
+
* they live — the opposite of what is wanted.
|
|
104
|
+
* @param room The room access
|
|
105
|
+
* @param combatant The combatant to judge
|
|
106
|
+
* @returns True when the fight should pass them over
|
|
107
|
+
*/
|
|
49
108
|
function isDown(room, combatant) {
|
|
50
109
|
if (!combatant.foe)
|
|
51
110
|
return false;
|
|
52
111
|
const artifact = room.get((0, sheet_1.foeArtifactName)(combatant.name));
|
|
112
|
+
// Gone from the room entirely: cleared, or never placed. Either way it takes no turn.
|
|
53
113
|
if (!artifact)
|
|
54
114
|
return true;
|
|
55
115
|
try {
|
|
@@ -59,9 +119,20 @@ function isDown(room, combatant) {
|
|
|
59
119
|
return false;
|
|
60
120
|
}
|
|
61
121
|
}
|
|
122
|
+
/** The monsters currently down, for the render. */
|
|
62
123
|
function downNames(room, state) {
|
|
63
124
|
return state.order.filter((c) => isDown(room, c)).map((c) => c.name);
|
|
64
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* Reads the fight in progress, treating a corrupt artifact as no fight.
|
|
128
|
+
*
|
|
129
|
+
* The swallow is deliberate and narrow. `encounter` itself parses strictly, because
|
|
130
|
+
* it is about to overwrite the thing and a bad parse there would destroy the order.
|
|
131
|
+
* Every other caller only wants to know whose turn it is, and a corrupt artifact
|
|
132
|
+
* must not stop a die being rolled.
|
|
133
|
+
* @param room The room access
|
|
134
|
+
* @returns The encounter, or null when there is none or it cannot be read
|
|
135
|
+
*/
|
|
65
136
|
function readEncounter(room) {
|
|
66
137
|
try {
|
|
67
138
|
return (0, encounter_1.parseEncounter)(room.get(sheet_1.ENCOUNTER_ARTIFACT)?.body);
|
|
@@ -70,6 +141,20 @@ function readEncounter(room) {
|
|
|
70
141
|
return null;
|
|
71
142
|
}
|
|
72
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* Writes the encounter back.
|
|
146
|
+
*
|
|
147
|
+
* **Transient**, like the sheets and `Party Status` and for the same reason: it
|
|
148
|
+
* changes every turn, and cached it would throw away the prompt prefix of every
|
|
149
|
+
* agent that can see it that often. A few lines re-sent to whoever is being prompted
|
|
150
|
+
* is much cheaper.
|
|
151
|
+
*
|
|
152
|
+
* Visible to everyone, because turn order is not secret — the players know what
|
|
153
|
+
* order they act in. Monster hit points are deliberately not here; they live on the
|
|
154
|
+
* creatures, where the party cannot read them.
|
|
155
|
+
* @param room The room access
|
|
156
|
+
* @param state The encounter to store
|
|
157
|
+
*/
|
|
73
158
|
function writeEncounter(room, state) {
|
|
74
159
|
room.update(sheet_1.ENCOUNTER_ARTIFACT, () => (0, encounter_1.renderEncounter)(state, downNames(room, state)), {
|
|
75
160
|
viewers: room.agentNicknames,
|
|
@@ -83,12 +168,22 @@ function clearFoes(room, keep = []) {
|
|
|
83
168
|
room.remove((0, sheet_1.foeArtifactName)(name));
|
|
84
169
|
return removed;
|
|
85
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* Loads a character's sheet, matching the name loosely.
|
|
173
|
+
* @param room The room access
|
|
174
|
+
* @param name The character name as the model supplied it
|
|
175
|
+
* @returns The loaded sheet
|
|
176
|
+
* @throws With a message naming the closest match and every known sheet, so the
|
|
177
|
+
* model can correct itself in one step
|
|
178
|
+
*/
|
|
86
179
|
function loadSheet(room, name) {
|
|
87
180
|
const characters = listCharacterNames(room);
|
|
88
181
|
const foes = listFoeNames(room);
|
|
89
182
|
if (characters.length === 0 && foes.length === 0) {
|
|
90
183
|
throw new Error('No character sheets exist in this room yet. Create one with create_sheet first.');
|
|
91
184
|
}
|
|
185
|
+
// Characters first: a party member and a monster sharing a name is vanishingly
|
|
186
|
+
// rare, and resolving to the player's own sheet is the safer of the two.
|
|
92
187
|
const matched = (0, coerce_1.matchName)(name, characters);
|
|
93
188
|
const matchedFoe = matched ? undefined : (0, coerce_1.matchName)(name, foes);
|
|
94
189
|
if (!matched && !matchedFoe) {
|
|
@@ -118,6 +213,7 @@ function loadSheet(room, name) {
|
|
|
118
213
|
warnings: (0, sheet_1.collectWarnings)(raw, state),
|
|
119
214
|
};
|
|
120
215
|
}
|
|
216
|
+
/** Pulls the raw state JSON text out of a body, for warning comparison only. */
|
|
121
217
|
function extractStateJson(body) {
|
|
122
218
|
const lines = (body || '').split('\n');
|
|
123
219
|
const open = lines.findIndex((line) => line.trim() === '```briyah-state');
|
|
@@ -128,13 +224,32 @@ function extractStateJson(body) {
|
|
|
128
224
|
return '{}';
|
|
129
225
|
return lines.slice(open + 1, open + 1 + close).join('\n');
|
|
130
226
|
}
|
|
227
|
+
/**
|
|
228
|
+
* Reads a sheet, mutates it and writes it back without yielding, so two
|
|
229
|
+
* concurrent tool calls cannot interleave a read-modify-write.
|
|
230
|
+
*
|
|
231
|
+
* The sheet is attributed to the character's owner rather than to the calling
|
|
232
|
+
* agent, and scoped to that owner alone.
|
|
233
|
+
*
|
|
234
|
+
* It is written **transient**, so the owner receives it in the uncached per-turn
|
|
235
|
+
* prompt rather than the cached artifact block. Hit points move every round, and
|
|
236
|
+
* a cached sheet threw away its owner's cached class document on every change.
|
|
237
|
+
* Transient inverts that: the sheet costs full price on each of the owner's turns
|
|
238
|
+
* and nothing on anyone else's, which is the right trade for a page of state that
|
|
239
|
+
* never stops moving.
|
|
240
|
+
*
|
|
241
|
+
* @param room The room access
|
|
242
|
+
* @param name The character name
|
|
243
|
+
* @param mutate Produces the new state, or a refusal. Must not await.
|
|
244
|
+
* @returns The mutation result, with the state as written
|
|
245
|
+
*/
|
|
131
246
|
function mutateSheet(room, name, mutate) {
|
|
132
247
|
const sheet = loadSheet(room, name);
|
|
133
248
|
let result;
|
|
134
249
|
room.update(sheet.artifactName, () => {
|
|
135
250
|
result = mutate(sheet);
|
|
136
251
|
if ((0, character_1.isRefusal)(result))
|
|
137
|
-
return null;
|
|
252
|
+
return null; // Nothing changed; leave the body alone
|
|
138
253
|
const written = result.state;
|
|
139
254
|
written.rev = (sheet.state.rev || 0) + 1;
|
|
140
255
|
return (0, sheet_1.renderSheet)(written, sheet.notes);
|
|
@@ -143,17 +258,38 @@ function mutateSheet(room, name, mutate) {
|
|
|
143
258
|
creator: sheet.state.owner,
|
|
144
259
|
transient: true,
|
|
145
260
|
});
|
|
261
|
+
// The shared summary is rebuilt here, at the one point every sheet change goes
|
|
262
|
+
// through, rather than by each tool remembering to ask for it. Four tools did
|
|
263
|
+
// remember and the two that move hit points did not, so `Party Status` sat six
|
|
264
|
+
// hours stale in a played campaign — showing a character at full health who was
|
|
265
|
+
// three down — in the one place the players are meant to trust, since a player
|
|
266
|
+
// agent holds no tools and cannot read anybody's sheet but their own.
|
|
267
|
+
//
|
|
268
|
+
// Skipped for a monster, whose sheet is not part of the party, and for a refusal,
|
|
269
|
+
// which changed nothing.
|
|
146
270
|
if (!(0, character_1.isRefusal)(result) && !result.state.foe) {
|
|
147
271
|
refreshPartyStatus(room);
|
|
148
272
|
}
|
|
149
273
|
return { result, sheet };
|
|
150
274
|
}
|
|
275
|
+
/**
|
|
276
|
+
* Writes a sheet that may not exist yet.
|
|
277
|
+
* @param room The room access
|
|
278
|
+
* @param state The state to write
|
|
279
|
+
* @param notes The prose region to preserve
|
|
280
|
+
* @param replace When false, refuses to overwrite an existing sheet
|
|
281
|
+
* @returns The artifact name written
|
|
282
|
+
* @throws If a sheet already exists and `replace` is false
|
|
283
|
+
*/
|
|
151
284
|
function writeNewSheet(room, state, notes, replace) {
|
|
285
|
+
// A foe goes under its own prefix, which is what keeps it out of the party
|
|
286
|
+
// roster and out of `Party Status`.
|
|
152
287
|
const artifactName = (0, sheet_1.combatantArtifactName)(state);
|
|
153
288
|
const existing = room.get(artifactName);
|
|
154
289
|
if (existing && !replace) {
|
|
155
290
|
throw new Error(`A sheet for "${state.name}" already exists. Pass replace=true to overwrite it, or use patch_sheet to change specific fields.`);
|
|
156
291
|
}
|
|
292
|
+
// Owner-only viewers, credited to the owner: see mutateSheet.
|
|
157
293
|
const owner = state.owner || room.caller.nickname;
|
|
158
294
|
room.put(artifactName, (0, sheet_1.renderSheet)(state, notes), {
|
|
159
295
|
viewers: [owner],
|
|
@@ -162,6 +298,13 @@ function writeNewSheet(room, state, notes, replace) {
|
|
|
162
298
|
});
|
|
163
299
|
return artifactName;
|
|
164
300
|
}
|
|
301
|
+
/**
|
|
302
|
+
* Rewrites the shared party summary from every sheet in the room. Always a full
|
|
303
|
+
* re-render rather than an incremental patch, so it is idempotent and the last
|
|
304
|
+
* writer is always correct even if two tool calls overlap.
|
|
305
|
+
* @param room The room access
|
|
306
|
+
* @returns The one-line-per-character summary that was written
|
|
307
|
+
*/
|
|
165
308
|
function refreshPartyStatus(room) {
|
|
166
309
|
const names = listCharacterNames(room);
|
|
167
310
|
if (names.length === 0)
|
|
@@ -179,12 +322,40 @@ function refreshPartyStatus(room) {
|
|
|
179
322
|
}
|
|
180
323
|
}
|
|
181
324
|
const body = ['# Party Status', '', ...lines, ''].join('\n');
|
|
325
|
+
// Every agent needs this for tactical awareness, so it is the one broadly
|
|
326
|
+
// visible artifact. Written transient for the same reason as a sheet, only
|
|
327
|
+
// more so: it is rewritten every round and read by everyone, so cached it
|
|
328
|
+
// threw away the whole party's prompt prefix once per round. A dozen lines
|
|
329
|
+
// re-sent per turn is far cheaper than that.
|
|
182
330
|
room.update(sheet_1.PARTY_STATUS_ARTIFACT, () => body, {
|
|
183
331
|
viewers: room.agentNicknames.filter((n) => n !== room.caller.nickname || !room.caller.isLeader),
|
|
184
332
|
transient: true,
|
|
185
333
|
});
|
|
186
334
|
return body;
|
|
187
335
|
}
|
|
336
|
+
/**
|
|
337
|
+
* Puts a class or background document in the room as an artifact the named players
|
|
338
|
+
* can read.
|
|
339
|
+
*
|
|
340
|
+
* One artifact per class or background, shared by everyone who has it, and **cached
|
|
341
|
+
* rather than transient**: these documents never change, which is exactly the case
|
|
342
|
+
* caching is for. The trade is the other way round from a sheet — a sheet moves every
|
|
343
|
+
* round and would throw its viewer's cached prefix away, while this is written once
|
|
344
|
+
* during character creation and then read free on every turn for the rest of the
|
|
345
|
+
* campaign.
|
|
346
|
+
*
|
|
347
|
+
* Viewers accumulate, so a second wizard joining does not evict the first. The
|
|
348
|
+
* calling agent is always one, because the creator builds from the document it is
|
|
349
|
+
* sharing — which also keeps it carrying only what the party actually took rather
|
|
350
|
+
* than every class in the book.
|
|
351
|
+
*
|
|
352
|
+
* @param room The room access
|
|
353
|
+
* @param kind Which kind of document it is, which decides the artifact's name
|
|
354
|
+
* @param name The class or background the document describes
|
|
355
|
+
* @param body The document's text
|
|
356
|
+
* @param players Agent nicknames to share it with, as the model supplied them
|
|
357
|
+
* @returns What was written, and any name that matched no agent here
|
|
358
|
+
*/
|
|
188
359
|
function shareGuide(room, kind, name, body, players) {
|
|
189
360
|
const artifactName = (0, guides_1.guideArtifactName)(kind, name);
|
|
190
361
|
const unknown = [];
|
|
@@ -196,10 +367,16 @@ function shareGuide(room, kind, name, body, players) {
|
|
|
196
367
|
else
|
|
197
368
|
unknown.push(player);
|
|
198
369
|
}
|
|
370
|
+
// Read the existing viewers and write in one synchronous stretch, so two players
|
|
371
|
+
// whose sheets are built concurrently cannot each drop the other from the list.
|
|
199
372
|
const existing = room.get(artifactName);
|
|
200
373
|
for (const viewer of existing?.viewers || [])
|
|
201
374
|
wanted.add(viewer);
|
|
202
375
|
const viewers = room.agentNicknames.filter((nickname) => wanted.has(nickname));
|
|
376
|
+
// Skip a write that would change nothing. A document is normally shared twice —
|
|
377
|
+
// once when the creator reads it, once when `create_sheet` files the character
|
|
378
|
+
// under it — and this is a *cached* artifact, so a redundant write would throw away
|
|
379
|
+
// the prompt prefix of everybody reading it to store the bytes they already had.
|
|
203
380
|
const unchanged = existing?.body === body &&
|
|
204
381
|
existing.viewers.length === viewers.length &&
|
|
205
382
|
viewers.every((nickname) => existing.viewers.includes(nickname));
|
|
@@ -208,6 +385,7 @@ function shareGuide(room, kind, name, body, players) {
|
|
|
208
385
|
}
|
|
209
386
|
return { artifactName, viewers, unknown, created: !existing };
|
|
210
387
|
}
|
|
388
|
+
/** One compact line describing a character's live state. */
|
|
211
389
|
function partyLine(state) {
|
|
212
390
|
const parts = [`${state.hp.cur}/${(0, rules_1.effectiveMaxHp)(state)} HP`];
|
|
213
391
|
if (state.hp.temp > 0)
|
|
@@ -220,6 +398,11 @@ function partyLine(state) {
|
|
|
220
398
|
parts.push(state.cond.map((c) => c.n).join('/'));
|
|
221
399
|
if (state.exh > 0)
|
|
222
400
|
parts.push(`exhaustion ${state.exh}`);
|
|
401
|
+
// A die somebody else handed over. Here because it is the giver who needs to see
|
|
402
|
+
// it and cannot: sheets are readable only by their owner, and a player agent
|
|
403
|
+
// holds no tools at all. A bard with two dice left had no way to tell whether the
|
|
404
|
+
// first was still unspent, and a Battle Master told a fighter he held nothing
|
|
405
|
+
// while it was sitting on his sheet.
|
|
223
406
|
for (const boon of state.boons || []) {
|
|
224
407
|
parts.push(`holding ${boon.n} ${boon.die}${boon.from ? ` from ${boon.from}` : ''}`);
|
|
225
408
|
}
|
|
@@ -232,6 +415,7 @@ function partyLine(state) {
|
|
|
232
415
|
}
|
|
233
416
|
return `- ${state.name} (level ${(0, rules_1.totalLevel)(state)}): ${parts.join(', ')}`;
|
|
234
417
|
}
|
|
418
|
+
/** Turns an engine refusal into the tool result shape. */
|
|
235
419
|
function toRefusalResult(refusal, state) {
|
|
236
420
|
const result = {
|
|
237
421
|
applied: false,
|
|
@@ -246,6 +430,7 @@ function toRefusalResult(refusal, state) {
|
|
|
246
430
|
result.state = liveState(state);
|
|
247
431
|
return result;
|
|
248
432
|
}
|
|
433
|
+
/** The compact live-state block attached to results, for the DM to narrate from. */
|
|
249
434
|
function liveState(state) {
|
|
250
435
|
const movement = (0, rules_1.effectiveSpeed)(state);
|
|
251
436
|
const block = {
|
|
@@ -274,6 +459,7 @@ function liveState(state) {
|
|
|
274
459
|
block.hitDice = Object.fromEntries(hitDice);
|
|
275
460
|
return block;
|
|
276
461
|
}
|
|
462
|
+
/** Re-raises a sheet parse failure as a refusal the DM can act on. */
|
|
277
463
|
function sheetErrorToRefusal(error, artifactName) {
|
|
278
464
|
return {
|
|
279
465
|
applied: false,
|
|
@@ -287,6 +473,7 @@ function sheetErrorToRefusal(error, artifactName) {
|
|
|
287
473
|
],
|
|
288
474
|
};
|
|
289
475
|
}
|
|
476
|
+
/** A short header line describing a character, for read results. */
|
|
290
477
|
function sheetHeadline(state) {
|
|
291
478
|
const level = (0, rules_1.totalLevel)(state);
|
|
292
479
|
return `${state.name} — level ${level}, ${state.hp.cur}/${(0, rules_1.effectiveMaxHp)(state)} HP, AC ${state.ac}, proficiency ${(0, sheet_1.signed)((0, rules_1.proficiencyBonus)(state))}`;
|