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
|
@@ -38,6 +38,11 @@ const fs = __importStar(require("fs"));
|
|
|
38
38
|
const path = __importStar(require("path"));
|
|
39
39
|
const tool_execution_service_1 = require("./tool-execution.service");
|
|
40
40
|
const logger_1 = require("../common/logger");
|
|
41
|
+
/**
|
|
42
|
+
* A per-user service that stores and retrieves ToolDefinition objects by name.
|
|
43
|
+
* Each tool is stored in its own JSON file named by its (sanitized) tool name.
|
|
44
|
+
* Uses lazy loading - tools are loaded from disk on first access.
|
|
45
|
+
*/
|
|
41
46
|
class ToolStoreService {
|
|
42
47
|
userPaths;
|
|
43
48
|
tools = new Map();
|
|
@@ -56,6 +61,12 @@ class ToolStoreService {
|
|
|
56
61
|
await this.ensureLoaded();
|
|
57
62
|
return this.tools.get(name);
|
|
58
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Creates or updates a tool definition.
|
|
66
|
+
* Validates the name and syntax-checks the code so the UI gets immediate feedback.
|
|
67
|
+
* @param tool The tool definition to save
|
|
68
|
+
* @returns The saved tool definition
|
|
69
|
+
*/
|
|
59
70
|
async saveTool(tool) {
|
|
60
71
|
await this.ensureLoaded();
|
|
61
72
|
if (!tool.name || !tool.name.trim()) {
|
|
@@ -67,6 +78,7 @@ class ToolStoreService {
|
|
|
67
78
|
if (!tool.code || !tool.code.trim()) {
|
|
68
79
|
throw new Error('Tool code is required');
|
|
69
80
|
}
|
|
81
|
+
// Syntax-check the code by compiling it
|
|
70
82
|
try {
|
|
71
83
|
tool_execution_service_1.ToolExecutionService.compile(tool);
|
|
72
84
|
}
|
|
@@ -110,7 +122,7 @@ class ToolStoreService {
|
|
|
110
122
|
this.loaded = true;
|
|
111
123
|
})
|
|
112
124
|
.catch((error) => {
|
|
113
|
-
this.loadPromise = null;
|
|
125
|
+
this.loadPromise = null; // Allow retry on error
|
|
114
126
|
throw error;
|
|
115
127
|
});
|
|
116
128
|
}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which surface a session is for. Carried as the `mode` claim in the JWT, mirrored
|
|
3
|
+
* client-side, and also what a dedicated subdomain pins a visitor to.
|
|
4
|
+
*
|
|
5
|
+
* Presentational only. No server endpoint consults it — `ScopesGuard` reads `scope`
|
|
6
|
+
* and `OwnerOnly` reads `type` — so an 'rpg' session still reaches every @OwnerOnly
|
|
7
|
+
* route. `scope` is the field for authorization; do not start gating on this one.
|
|
8
|
+
*/
|
|
1
9
|
export type BriyahMode = 'agents' | 'stories' | 'rpg';
|
|
2
10
|
export declare const BRIYAH_MODES: readonly BriyahMode[];
|
|
3
11
|
export interface AgentInfo {
|
|
@@ -19,6 +27,16 @@ export interface AgentInfo {
|
|
|
19
27
|
beginInstruction: string;
|
|
20
28
|
toolNames: string[];
|
|
21
29
|
useModerator?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Whether this agent could be its room's moderator: it is not human-controlled,
|
|
32
|
+
* and its prompt folder provides a `moderate.prompt`.
|
|
33
|
+
*
|
|
34
|
+
* Derived from the agent's prompt folder rather than stored, and by the same check
|
|
35
|
+
* that refuses a room whose moderator cannot moderate — so a moderator the UI
|
|
36
|
+
* offers is never one the server will reject. Populated where an agent is being
|
|
37
|
+
* looked at on its own or as part of a room's roster; the top-level agent list
|
|
38
|
+
* leaves it absent, because "could moderate" is a question about a room.
|
|
39
|
+
*/
|
|
22
40
|
canModerate?: boolean;
|
|
23
41
|
privateContext?: string;
|
|
24
42
|
promptCacheTTL?: number;
|
|
@@ -26,11 +44,26 @@ export interface AgentInfo {
|
|
|
26
44
|
smallModelName?: string;
|
|
27
45
|
ownerRoomId?: string;
|
|
28
46
|
attachedArtifactIds?: string[];
|
|
47
|
+
/**
|
|
48
|
+
* The pack this agent is filed under, or absent when it is not filed.
|
|
49
|
+
*
|
|
50
|
+
* Drives grouping and filtering in the lists. An agent naming a pack that is not
|
|
51
|
+
* installed stays visible: deleting a pack must not hide the work it produced.
|
|
52
|
+
*/
|
|
29
53
|
pack?: string;
|
|
30
54
|
}
|
|
31
55
|
export interface CreateAgentResponse {
|
|
32
56
|
agentId: string;
|
|
33
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* The body of `POST /api/agents`.
|
|
60
|
+
*
|
|
61
|
+
* Everything an agent needs, so creating one is a single request. It used to carry
|
|
62
|
+
* only the first ten fields, which made every agent holding a tool grant a
|
|
63
|
+
* two-step job: create, then reopen the edit form. The optional fields here are
|
|
64
|
+
* the same ones {@link UpdateAgentRequest} carries, so nothing is settable only
|
|
65
|
+
* after the fact.
|
|
66
|
+
*/
|
|
34
67
|
export interface CreateAgentRequest {
|
|
35
68
|
aiServiceName: string;
|
|
36
69
|
agentName: string;
|
|
@@ -50,6 +83,13 @@ export interface CreateAgentRequest {
|
|
|
50
83
|
maxHistoryMessages?: number;
|
|
51
84
|
smallModelName?: string;
|
|
52
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* The body of `POST /api/rooms/:roomId/agents`.
|
|
88
|
+
*
|
|
89
|
+
* The same shape as {@link CreateAgentRequest}, except that `agentName` is the
|
|
90
|
+
* bare name. The server prefixes it with the room's name and derives the nickname
|
|
91
|
+
* from the bare name, so the prefix never becomes what the agent is addressed as.
|
|
92
|
+
*/
|
|
53
93
|
export type CreateRoomAgentRequest = CreateAgentRequest;
|
|
54
94
|
export interface UpdateAgentRequest {
|
|
55
95
|
agentNickname?: string;
|
|
@@ -66,6 +106,7 @@ export interface UpdateAgentRequest {
|
|
|
66
106
|
promptCacheTTL?: number;
|
|
67
107
|
maxHistoryMessages?: number;
|
|
68
108
|
smallModelName?: string;
|
|
109
|
+
/** Files the agent under a pack. Empty string clears it. See {@link AgentInfo.pack}. */
|
|
69
110
|
pack?: string;
|
|
70
111
|
}
|
|
71
112
|
export interface ToolParameter {
|
|
@@ -107,9 +148,17 @@ export interface RoomInfo {
|
|
|
107
148
|
name: string;
|
|
108
149
|
goal: string;
|
|
109
150
|
agentCount: number;
|
|
151
|
+
/** The pack this room is filed under. See {@link AgentInfo.pack}. */
|
|
110
152
|
pack?: string;
|
|
111
153
|
totalCost?: number;
|
|
112
154
|
}
|
|
155
|
+
/**
|
|
156
|
+
* How a room decides which agents respond to a message.
|
|
157
|
+
* - 'broadcast': every agent responds and one reply is selected. The default.
|
|
158
|
+
* - 'directed': only the message's targets respond (the room leader when there
|
|
159
|
+
* are none). Other agents still hear the message without generating a reply,
|
|
160
|
+
* which is what lets a leader agent control the order of a turn-based room.
|
|
161
|
+
*/
|
|
113
162
|
export type RoomTurnMode = 'broadcast' | 'directed';
|
|
114
163
|
export interface RoomDetails {
|
|
115
164
|
id: string;
|
|
@@ -118,12 +167,24 @@ export interface RoomDetails {
|
|
|
118
167
|
baseRoomDir?: string;
|
|
119
168
|
agentIds: string[];
|
|
120
169
|
agents?: AgentInfo[];
|
|
170
|
+
/** The pack this room is filed under. Editable. See {@link AgentInfo.pack}. */
|
|
121
171
|
pack?: string;
|
|
122
172
|
roomLeader?: string;
|
|
123
173
|
turnMode?: RoomTurnMode;
|
|
174
|
+
/**
|
|
175
|
+
* Nickname of the agent that places messages it cannot route mechanically.
|
|
176
|
+
* Only consulted in 'moderated' mode. Absent falls back to the first agent in
|
|
177
|
+
* the room, which is how story rooms have always chosen their moderator.
|
|
178
|
+
*/
|
|
124
179
|
moderator?: string;
|
|
125
180
|
isPublished?: boolean;
|
|
126
181
|
templateRoomId?: string;
|
|
182
|
+
/**
|
|
183
|
+
* Live turn state, the same fields {@link RoomMessageUpdate} carries over SSE.
|
|
184
|
+
* Without them a client that just loaded the page shows an idle room until the
|
|
185
|
+
* next update arrives, which for a turn-based room means it cannot tell whose
|
|
186
|
+
* turn it is until someone moves.
|
|
187
|
+
*/
|
|
127
188
|
isPaused?: boolean;
|
|
128
189
|
currentSpeaker?: string | null;
|
|
129
190
|
processingInProgress?: boolean;
|
|
@@ -132,20 +193,23 @@ export interface CreateRoomResponse {
|
|
|
132
193
|
roomId: string;
|
|
133
194
|
baseRoomDir?: string;
|
|
134
195
|
}
|
|
196
|
+
/**
|
|
197
|
+
* Represents the action type of a message
|
|
198
|
+
*/
|
|
135
199
|
export declare enum MessageAction {
|
|
136
|
-
THINK = "think",
|
|
137
|
-
WHISPER = "whisper"
|
|
138
|
-
SPEAK = "speak"
|
|
139
|
-
SHOUT = "shout"
|
|
140
|
-
MODERATE = "moderate"
|
|
141
|
-
RELAY = "relay"
|
|
142
|
-
RELAY_SILENT = "relay_silent"
|
|
143
|
-
PUBLISH = "publish"
|
|
144
|
-
EXECUTE = "execute"
|
|
145
|
-
COMMISSION = "commission"
|
|
146
|
-
DELIVER = "deliver",
|
|
147
|
-
TOOL = "tool"
|
|
148
|
-
ADJOURN = "adjourn"
|
|
200
|
+
THINK = "think",// Inaudible message, only stays in the history of the sender
|
|
201
|
+
WHISPER = "whisper",// Only specified targets can hear this message
|
|
202
|
+
SPEAK = "speak",// Every agent hears this message. Multiple agents may speak at once.
|
|
203
|
+
SHOUT = "shout",// Overrides all other conversations
|
|
204
|
+
MODERATE = "moderate",// Sent to moderator for routing (story rooms only)
|
|
205
|
+
RELAY = "relay",// Sent by moderator to the agents who should hear the message (logs to room)
|
|
206
|
+
RELAY_SILENT = "relay_silent",// Sent by moderator to route a message without logging to room
|
|
207
|
+
PUBLISH = "publish",// Publish new room artifact
|
|
208
|
+
EXECUTE = "execute",// Run a granted tool; result returns privately to the caller
|
|
209
|
+
COMMISSION = "commission",// Delegate a task to named agents; sender waits for all DELIVERs
|
|
210
|
+
DELIVER = "deliver",// Terminal response of a commissioned agent, targeted at the commissioner
|
|
211
|
+
TOOL = "tool",// Log-only notice of a tool execution (never perceived by agents)
|
|
212
|
+
ADJOURN = "adjourn",// Expresses an opinion to halt
|
|
149
213
|
SYSTEM = "system"
|
|
150
214
|
}
|
|
151
215
|
export interface Message {
|
|
@@ -178,6 +242,7 @@ export interface AgentMessageUpdate {
|
|
|
178
242
|
totalCost?: number;
|
|
179
243
|
}
|
|
180
244
|
export interface RoomMessageUpdate {
|
|
245
|
+
/** Discriminates this from {@link RoomErrorUpdate} on the same channel. */
|
|
181
246
|
type?: 'state';
|
|
182
247
|
roomId: string;
|
|
183
248
|
latestMessage?: Message;
|
|
@@ -186,14 +251,32 @@ export interface RoomMessageUpdate {
|
|
|
186
251
|
isPaused?: boolean;
|
|
187
252
|
currentSpeaker?: string | null;
|
|
188
253
|
processingInProgress?: boolean;
|
|
254
|
+
/**
|
|
255
|
+
* The room is idle pending the human agent's input.
|
|
256
|
+
*
|
|
257
|
+
* True while a human holds the floor, and *also* true for an idle room with no
|
|
258
|
+
* speaker, nothing queued and nothing in flight — including the moment between
|
|
259
|
+
* a message being accepted and processing starting. So it answers "may the
|
|
260
|
+
* human send something", not "is the human being asked something". For the
|
|
261
|
+
* latter, compare {@link currentSpeaker} against the human's nickname.
|
|
262
|
+
*/
|
|
189
263
|
waitingForHuman?: boolean;
|
|
190
264
|
}
|
|
265
|
+
/**
|
|
266
|
+
* A turn that died, delivered on the room's `'update'` channel.
|
|
267
|
+
*
|
|
268
|
+
* Same event name as {@link RoomMessageUpdate} rather than `'error'`: an
|
|
269
|
+
* EventEmitter throws when an `'error'` event has no listener, which would take
|
|
270
|
+
* down a host that only subscribed to updates.
|
|
271
|
+
*/
|
|
191
272
|
export interface RoomErrorUpdate {
|
|
192
273
|
type: 'error';
|
|
274
|
+
/** Error class name, e.g. `'InsufficientBalanceError'` */
|
|
193
275
|
errorType?: string;
|
|
194
276
|
message: string;
|
|
195
277
|
timestamp: number;
|
|
196
278
|
}
|
|
279
|
+
/** Everything a room's `'update'` event can carry. */
|
|
197
280
|
export type RoomUpdate = RoomMessageUpdate | RoomErrorUpdate;
|
|
198
281
|
export interface ModelInfo {
|
|
199
282
|
name: string;
|
|
@@ -216,7 +299,9 @@ export interface StoryModelEntry {
|
|
|
216
299
|
service: string;
|
|
217
300
|
model: string;
|
|
218
301
|
small_model?: string;
|
|
302
|
+
/** Service used for the moderator and illustrator agents. Falls back to `service` when omitted. */
|
|
219
303
|
moderator_service?: string;
|
|
304
|
+
/** Model used for the moderator and illustrator agents. Falls back to `model` when omitted. */
|
|
220
305
|
moderator_model?: string;
|
|
221
306
|
cost: string;
|
|
222
307
|
}
|
|
@@ -224,14 +309,19 @@ export interface StoryModelConfig {
|
|
|
224
309
|
service: string;
|
|
225
310
|
model: string;
|
|
226
311
|
smallModel?: string;
|
|
312
|
+
/** Service for the moderator/illustrator agents (defaults to `service`). */
|
|
227
313
|
moderatorService: string;
|
|
314
|
+
/** Model for the moderator/illustrator agents (defaults to `model`). */
|
|
228
315
|
moderatorModel: string;
|
|
229
316
|
}
|
|
230
317
|
export type PromptScope = 'common' | 'user';
|
|
231
318
|
export interface PromptFolder {
|
|
319
|
+
/** What to send back: `dungeon_master`, or `dnd5e:dungeon_master` for a pack's. */
|
|
232
320
|
name: string;
|
|
233
321
|
scope: PromptScope;
|
|
322
|
+
/** The pack this folder belongs to; absent for the user's own and common folders. */
|
|
234
323
|
pack?: string;
|
|
324
|
+
/** The folder without its pack prefix. Absent when it equals `name`. */
|
|
235
325
|
folder?: string;
|
|
236
326
|
}
|
|
237
327
|
export interface PromptFoldersResponse {
|
|
@@ -240,6 +330,7 @@ export interface PromptFoldersResponse {
|
|
|
240
330
|
export interface PromptFile {
|
|
241
331
|
name: string;
|
|
242
332
|
scope: PromptScope;
|
|
333
|
+
/** The pack the file came from; absent for a user's own or a common file. */
|
|
243
334
|
pack?: string;
|
|
244
335
|
}
|
|
245
336
|
export interface PromptFilesResponse {
|
|
@@ -248,20 +339,44 @@ export interface PromptFilesResponse {
|
|
|
248
339
|
export interface FileList {
|
|
249
340
|
files: string[];
|
|
250
341
|
}
|
|
342
|
+
/**
|
|
343
|
+
* Which directory tier a prompt file came from.
|
|
344
|
+
*
|
|
345
|
+
* Finer than {@link PromptScope}, which only distinguishes the user's own files
|
|
346
|
+
* from shared ones. A `pack-overlay` file is the user's private copy-on-write
|
|
347
|
+
* edit of a `pack` file, so it reports `scope: 'user'` while being a different
|
|
348
|
+
* thing from a file in the user's own prompts directory.
|
|
349
|
+
*/
|
|
251
350
|
export type PromptTier = 'common' | 'user' | 'pack' | 'pack-overlay';
|
|
252
351
|
export interface PromptFileContent {
|
|
253
352
|
content: string;
|
|
254
353
|
scope?: PromptScope;
|
|
354
|
+
/** The pack the file came from, set even when the folder was referenced bare. */
|
|
255
355
|
pack?: string;
|
|
256
356
|
tier?: PromptTier;
|
|
257
357
|
}
|
|
358
|
+
/**
|
|
359
|
+
* Agent settings a prompt folder declares in its `defaults_config.json`, used to
|
|
360
|
+
* pre-fill the create-agent form when that folder is selected.
|
|
361
|
+
*
|
|
362
|
+
* Every field is optional and mirrors a field on the create-agent form. A folder
|
|
363
|
+
* that ships one spares the user having to know, for instance, which seven of the
|
|
364
|
+
* seventeen 5e tools a character creator needs.
|
|
365
|
+
*/
|
|
258
366
|
export interface PromptFolderDefaults {
|
|
259
367
|
agentName?: string;
|
|
260
368
|
agentNickname?: string;
|
|
261
369
|
description?: string;
|
|
370
|
+
/** Names of the tools to grant. Names with no registered tool are dropped. */
|
|
262
371
|
toolNames?: string[];
|
|
372
|
+
/**
|
|
373
|
+
* Artifact ids to offer as attachments, pre-ticked in the create-agent dialog.
|
|
374
|
+
* Ids that resolve to nothing are dropped. Attaching stays the user's choice:
|
|
375
|
+
* a document sits in the cached prefix of every call the agent makes.
|
|
376
|
+
*/
|
|
263
377
|
documentIds?: string[];
|
|
264
378
|
reasoningEffort?: 'low' | 'medium' | 'high' | null;
|
|
379
|
+
/** Cap on a single response. 0 or absent leaves the provider's default. */
|
|
265
380
|
maxOutputTokens?: number;
|
|
266
381
|
beginInstruction?: string;
|
|
267
382
|
allowSearch?: boolean;
|
|
@@ -273,8 +388,19 @@ export interface PromptFolderDefaults {
|
|
|
273
388
|
smallModelName?: string;
|
|
274
389
|
}
|
|
275
390
|
export interface PromptFolderDefaultsResponse {
|
|
391
|
+
/** Empty when the folder declares no defaults, or its file could not be parsed. */
|
|
276
392
|
defaults: PromptFolderDefaults;
|
|
393
|
+
/** Which directory the file was found in; omitted when there is no file. */
|
|
277
394
|
scope?: PromptScope;
|
|
395
|
+
/**
|
|
396
|
+
* Whether the folder itself exists.
|
|
397
|
+
*
|
|
398
|
+
* Empty `defaults` says nothing on its own: a folder that declares none and a
|
|
399
|
+
* folder that is not there both have none. This is what tells the two apart —
|
|
400
|
+
* false means the reference will fall back to the shared root prompts and
|
|
401
|
+
* produce a generic agent. A bare name for a pack the user has not enabled
|
|
402
|
+
* reports false, because that is how it will behave.
|
|
403
|
+
*/
|
|
278
404
|
exists: boolean;
|
|
279
405
|
}
|
|
280
406
|
export interface CreatePromptFolderRequest {
|
|
@@ -289,8 +415,10 @@ export interface UpdatePromptFileRequest {
|
|
|
289
415
|
content: string;
|
|
290
416
|
fileType: 'prompt' | 'json';
|
|
291
417
|
}
|
|
418
|
+
/** Who installed a pack, which decides whether the user may delete it. */
|
|
292
419
|
export type PackOrigin = 'host' | 'user';
|
|
293
420
|
export interface PackSummary {
|
|
421
|
+
/** Directory name, and the prefix on its prompt folders (`dnd5e:dungeon_master`). */
|
|
294
422
|
pack: string;
|
|
295
423
|
title: string;
|
|
296
424
|
description?: string;
|
|
@@ -303,7 +431,9 @@ export interface PackSummary {
|
|
|
303
431
|
agents: number;
|
|
304
432
|
rooms: number;
|
|
305
433
|
};
|
|
434
|
+
/** Tools the pack grants that the host has not registered. Non-empty means a warning. */
|
|
306
435
|
missingTools: string[];
|
|
436
|
+
/** Packs it declares a dependency on that this user has not enabled. */
|
|
307
437
|
missingPacks: string[];
|
|
308
438
|
}
|
|
309
439
|
export interface PacksResponse {
|
|
@@ -313,6 +443,7 @@ export interface PackAgentTemplateSummary {
|
|
|
313
443
|
key: string;
|
|
314
444
|
label: string;
|
|
315
445
|
promptFolder: string;
|
|
446
|
+
/** Which model tier the template wants; supplied at instantiation. */
|
|
316
447
|
modelRole?: 'primary' | 'economy';
|
|
317
448
|
}
|
|
318
449
|
export interface PackRoomTemplateSummary {
|
|
@@ -326,6 +457,7 @@ export interface PackDetails extends PackSummary {
|
|
|
326
457
|
promptFolders: string[];
|
|
327
458
|
agents: PackAgentTemplateSummary[];
|
|
328
459
|
rooms: PackRoomTemplateSummary[];
|
|
460
|
+
/** Every tool the pack asks for, derived from its grants rather than declared. */
|
|
329
461
|
requiresTools: string[];
|
|
330
462
|
}
|
|
331
463
|
export interface SetPackEnabledRequest {
|
|
@@ -335,19 +467,36 @@ export interface CreatePackRequest {
|
|
|
335
467
|
name: string;
|
|
336
468
|
title?: string;
|
|
337
469
|
}
|
|
470
|
+
/**
|
|
471
|
+
* The models an instantiate request supplies.
|
|
472
|
+
*
|
|
473
|
+
* A pack's template names a *role* rather than a model, because a model id goes
|
|
474
|
+
* stale and assumes the host's provider keys. The caller says what each role means
|
|
475
|
+
* here. `economy` falls back to the primary when omitted, so one model is enough
|
|
476
|
+
* to get a working room — just not a cheap one.
|
|
477
|
+
*/
|
|
338
478
|
export interface InstantiateModelsRequest {
|
|
339
479
|
aiServiceName: string;
|
|
340
480
|
aiModel: string;
|
|
481
|
+
/** Same-service smaller model, used for mechanical prompts like compaction. */
|
|
341
482
|
smallModelName?: string;
|
|
483
|
+
/** Service for `modelRole: 'economy'` agents. Defaults to `aiServiceName`. */
|
|
342
484
|
economyServiceName?: string;
|
|
485
|
+
/** Model for `modelRole: 'economy'` agents. Omit to use the primary for everything. */
|
|
343
486
|
economyModel?: string;
|
|
344
487
|
}
|
|
345
488
|
export interface InstantiatePackRoomRequest extends InstantiateModelsRequest {
|
|
489
|
+
/** Overrides the template's room name. Suffixed if it collides with an existing room. */
|
|
346
490
|
name?: string;
|
|
347
491
|
}
|
|
348
492
|
export interface InstantiatePackRoomResponse {
|
|
349
493
|
roomId: string;
|
|
350
494
|
agentIds: string[];
|
|
495
|
+
/**
|
|
496
|
+
* What did not go as the template asked, without stopping the room — a document
|
|
497
|
+
* that failed to attach, for instance. Surfaced rather than swallowed: a document
|
|
498
|
+
* that silently fails to attach is a capability the agent appears to have.
|
|
499
|
+
*/
|
|
351
500
|
warnings: string[];
|
|
352
501
|
}
|
|
353
502
|
export interface InstantiatePackAgentRequest extends InstantiateModelsRequest {
|
|
@@ -358,52 +507,99 @@ export interface InstantiatePackAgentResponse {
|
|
|
358
507
|
agentId: string;
|
|
359
508
|
warnings: string[];
|
|
360
509
|
}
|
|
510
|
+
/**
|
|
511
|
+
* One entry in `server/data/common/config/rpg_models.json`.
|
|
512
|
+
*
|
|
513
|
+
* The same list serves two dropdowns — the campaign's quality tier and each AI
|
|
514
|
+
* player's model — which is why an entry carries both roles. Host-wide config rather
|
|
515
|
+
* than pack content: it names model ids and assumes the host's provider keys, which a
|
|
516
|
+
* pack may not do.
|
|
517
|
+
*/
|
|
361
518
|
export interface RpgModelEntry {
|
|
519
|
+
/** The friendly name both dropdowns show and the API accepts. Unique in the file. */
|
|
362
520
|
name: string;
|
|
363
521
|
description: string;
|
|
364
522
|
service: string;
|
|
523
|
+
/** An AI player's model, and the crew's `modelRole: 'primary'` — the Dungeon Master. */
|
|
365
524
|
model: string;
|
|
525
|
+
/** Same-service smaller model, for mechanical prompts like compaction. */
|
|
366
526
|
small_model?: string;
|
|
527
|
+
/** The `modelRole: 'economy'` tier: the four cheap crew agents. Falls back to primary. */
|
|
367
528
|
economy_service?: string;
|
|
368
529
|
economy_model?: string;
|
|
530
|
+
/** True for the entry the quality picker preselects. Expected on exactly one. */
|
|
369
531
|
default_quality?: boolean;
|
|
532
|
+
/** Relative cost, as a string. Presentational, as {@link StoryModelEntry.cost} is. */
|
|
370
533
|
cost: string;
|
|
371
534
|
}
|
|
535
|
+
/**
|
|
536
|
+
* A model as the client is offered one.
|
|
537
|
+
*
|
|
538
|
+
* Projected down from {@link RpgModelEntry} rather than served as stored: the service
|
|
539
|
+
* and model id are the host's business, and a browser that never learns them cannot
|
|
540
|
+
* ask for one that is not on the list.
|
|
541
|
+
*/
|
|
372
542
|
export interface RpgModelOption {
|
|
373
543
|
name: string;
|
|
374
544
|
description: string;
|
|
375
545
|
cost?: string;
|
|
546
|
+
/** True for the entry to preselect. */
|
|
376
547
|
isDefault?: boolean;
|
|
377
548
|
}
|
|
378
549
|
export interface RpgPlayerRequest {
|
|
379
|
-
|
|
550
|
+
/**
|
|
551
|
+
* A seat, not a character.
|
|
552
|
+
*
|
|
553
|
+
* Deliberately unnamed: a player is seated as `Player One` and renamed to their
|
|
554
|
+
* character during character creation, once they have chosen one. Naming them
|
|
555
|
+
* here meant choosing a character before the game had told anyone what the
|
|
556
|
+
* choices were.
|
|
557
|
+
*/
|
|
380
558
|
isHuman: boolean;
|
|
559
|
+
/** An {@link RpgModelOption} name. Required when isHuman is false, unused when true. */
|
|
381
560
|
modelName?: string;
|
|
561
|
+
/** How the character behaves, stored as the agent's privateContext. AI players only. */
|
|
382
562
|
personality?: string;
|
|
383
563
|
}
|
|
384
564
|
export interface CreateRpgCampaignRequest {
|
|
385
565
|
name: string;
|
|
566
|
+
/**
|
|
567
|
+
* An {@link RpgModelOption} name. Its model runs the Dungeon Master and its economy
|
|
568
|
+
* tier the other four crew agents. Absent takes the file's default.
|
|
569
|
+
*/
|
|
386
570
|
quality?: string;
|
|
571
|
+
/** In seating order. At least one, at least one of them human. */
|
|
387
572
|
players: RpgPlayerRequest[];
|
|
388
573
|
}
|
|
389
574
|
export interface RpgPlayerInfo {
|
|
390
575
|
agentId: string;
|
|
576
|
+
/** What the room routes by, and what the roster shows. */
|
|
391
577
|
nickname: string;
|
|
392
578
|
isHuman: boolean;
|
|
579
|
+
/** The friendly name, resolved back from the agent's service and model. */
|
|
393
580
|
modelName?: string;
|
|
394
581
|
personality?: string;
|
|
395
582
|
totalCost: number;
|
|
396
583
|
}
|
|
584
|
+
/** One of the hidden agents, so a campaign can say what is running its table. */
|
|
397
585
|
export interface RpgCrewInfo {
|
|
398
586
|
agentId: string;
|
|
399
587
|
nickname: string;
|
|
588
|
+
/** The pack template's key: dungeon_master, battle_master, table_moderator, ... */
|
|
400
589
|
role: string;
|
|
401
590
|
}
|
|
402
591
|
export interface RpgCampaignInfo {
|
|
592
|
+
/** The template room's id: what the campaign is, and what deleting it deletes. */
|
|
403
593
|
campaignId: string;
|
|
404
594
|
name: string;
|
|
595
|
+
/**
|
|
596
|
+
* The published instance's id — the public link, and the room that is actually
|
|
597
|
+
* played. Absent when the campaign has no instance, which only happens if one was
|
|
598
|
+
* deleted by hand.
|
|
599
|
+
*/
|
|
405
600
|
instanceId?: string;
|
|
406
601
|
playerCount: number;
|
|
602
|
+
/** Nicknames in seating order, for a one-line roster in a listing. */
|
|
407
603
|
playerNames: string[];
|
|
408
604
|
totalCost: number;
|
|
409
605
|
createdAt: string;
|
|
@@ -416,8 +612,10 @@ export interface RpgCampaignDetails extends RpgCampaignInfo {
|
|
|
416
612
|
export interface CreateRpgCampaignResponse {
|
|
417
613
|
campaignId: string;
|
|
418
614
|
instanceId: string;
|
|
615
|
+
/** A path, never an absolute URL: the origin is the browser's business. */
|
|
419
616
|
publicPath: string;
|
|
420
617
|
players: RpgPlayerInfo[];
|
|
618
|
+
/** What did not go to plan without stopping the campaign, e.g. an unattached document. */
|
|
421
619
|
warnings: string[];
|
|
422
620
|
}
|
|
423
621
|
export interface ProcessTextResponse {
|
|
@@ -444,7 +642,18 @@ export interface ArtifactMetadata {
|
|
|
444
642
|
size: number;
|
|
445
643
|
mimeType?: string;
|
|
446
644
|
description?: string;
|
|
645
|
+
/**
|
|
646
|
+
* Where the artifact comes from. Absent means `'user'` — only documents shipped
|
|
647
|
+
* by a tool pack are `'common'`, and those are read-only.
|
|
648
|
+
*/
|
|
447
649
|
scope?: PromptScope;
|
|
650
|
+
/**
|
|
651
|
+
* The pack that ships this document, absent for a user's own artifact.
|
|
652
|
+
*
|
|
653
|
+
* Set server-side rather than parsed out of the id in the client: the id's shape
|
|
654
|
+
* is `pack-artifacts.ts`'s business, and a second implementation of the split is
|
|
655
|
+
* how the `.`-versus-`/` confusion spreads.
|
|
656
|
+
*/
|
|
448
657
|
pack?: string;
|
|
449
658
|
}
|
|
450
659
|
export interface Artifact {
|
|
@@ -504,6 +713,11 @@ export interface StoryInfo {
|
|
|
504
713
|
totalOutputTokens: number;
|
|
505
714
|
turnNumber: number;
|
|
506
715
|
declinedCharacters?: string[];
|
|
716
|
+
/**
|
|
717
|
+
* Unacknowledged narrator suggestion. Persisted so clients that connect (or
|
|
718
|
+
* reconnect) after the narrator emits can still see the prompt. Cleared when
|
|
719
|
+
* the player accepts (`introduceCharacter` / `progressStory`) or declines.
|
|
720
|
+
*/
|
|
507
721
|
pendingSuggestion?: StoryIntroduceCharacterEvent | StoryProgressChapterEvent;
|
|
508
722
|
}
|
|
509
723
|
export interface CreateStoryResponse {
|
|
@@ -518,31 +732,78 @@ export interface StoryFrameworkResponse {
|
|
|
518
732
|
}
|
|
519
733
|
export interface StoryState {
|
|
520
734
|
storyId: string;
|
|
735
|
+
/** The most recent message added to the room */
|
|
521
736
|
latestRoomMessage: Message;
|
|
737
|
+
/** Agent name of the human player's character — compare to `currentSpeaker` to detect player turns */
|
|
522
738
|
userAgentName: string;
|
|
739
|
+
/**
|
|
740
|
+
* UI display string for the player prompt, e.g. `"What does Elena do next?"`.
|
|
741
|
+
* Do **not** use this to detect whether it is the player's turn — use
|
|
742
|
+
* `currentSpeaker === userAgentName` instead.
|
|
743
|
+
*/
|
|
523
744
|
humanPrompt: string;
|
|
745
|
+
/** Agent name of whoever is next to act, or `null` if no specific speaker is designated */
|
|
524
746
|
currentSpeaker?: string | null;
|
|
525
747
|
totalCost: number;
|
|
526
748
|
totalInputTokens: number;
|
|
527
749
|
totalOutputTokens: number;
|
|
528
750
|
}
|
|
751
|
+
/**
|
|
752
|
+
* Payload emitted on the `'story-state'` event of the story message emitter.
|
|
753
|
+
*
|
|
754
|
+
* Fires after every room turn with the complete updated game state.
|
|
755
|
+
*
|
|
756
|
+
* **Turn detection:** Use `state.currentSpeaker === state.userAgentName` to check
|
|
757
|
+
* whether it is the human player's turn. Do **not** use `state.humanPrompt` for
|
|
758
|
+
* this — it is a UI display string (e.g. `"What does Elena do next?"`) and is
|
|
759
|
+
* present even when it is not the player's turn.
|
|
760
|
+
*/
|
|
529
761
|
export interface StoryStateEvent {
|
|
530
762
|
type: 'story-state';
|
|
531
763
|
state: StoryState;
|
|
532
764
|
timestamp: number;
|
|
533
765
|
}
|
|
766
|
+
/**
|
|
767
|
+
* Payload emitted on the `'suggest-introduce-character'` event of the story message
|
|
768
|
+
* emitter. Fired when the narrator decides a new character should enter the story.
|
|
769
|
+
*
|
|
770
|
+
* The host app should present this to the player before acting:
|
|
771
|
+
* - **Accept:** call `introduceCharacterToStory({ name: event.characterName, fromNarratorSuggestion: true })`
|
|
772
|
+
* - **Reject:** call `declineCharacter(storyId, event.characterName)`
|
|
773
|
+
*/
|
|
534
774
|
export interface StoryIntroduceCharacterEvent {
|
|
535
775
|
type: 'suggest-introduce-character';
|
|
776
|
+
/** Name of the character the narrator wants to introduce */
|
|
536
777
|
characterName?: string;
|
|
537
778
|
timestamp: number;
|
|
538
779
|
}
|
|
780
|
+
/**
|
|
781
|
+
* Payload emitted on the `'suggest-progress-chapter'` event of the story message
|
|
782
|
+
* emitter. Fired when the narrator decides the story is ready to advance to the
|
|
783
|
+
* next chapter.
|
|
784
|
+
*
|
|
785
|
+
* The host app should present this to the player before acting:
|
|
786
|
+
* - **Accept:** call `progressStory(storyId)`
|
|
787
|
+
* - **Stay in current chapter:** ignore the event (no rejection call needed)
|
|
788
|
+
*/
|
|
539
789
|
export interface StoryProgressChapterEvent {
|
|
540
790
|
type: 'suggest-progress-chapter';
|
|
541
791
|
timestamp: number;
|
|
542
792
|
}
|
|
793
|
+
/**
|
|
794
|
+
* Payload emitted on the `'story-error'` event of the story message emitter.
|
|
795
|
+
*
|
|
796
|
+
* Fired when the story engine encounters a fatal error during room processing.
|
|
797
|
+
* Named `'story-error'` rather than `'error'` to avoid the Node.js behaviour of
|
|
798
|
+
* throwing an uncaught exception when an `'error'` event has no listeners.
|
|
799
|
+
*
|
|
800
|
+
* Check `event.errorType === 'InsufficientBalanceError'` to detect balance failures
|
|
801
|
+
* and prompt the user to add credits.
|
|
802
|
+
*/
|
|
543
803
|
export interface StoryErrorEvent {
|
|
544
804
|
type: 'story-error';
|
|
545
805
|
message: string;
|
|
806
|
+
/** Error class name, e.g. `'InsufficientBalanceError'` */
|
|
546
807
|
errorType?: string;
|
|
547
808
|
timestamp: number;
|
|
548
809
|
}
|
|
@@ -551,8 +812,18 @@ export interface ChaptersResponse {
|
|
|
551
812
|
}
|
|
552
813
|
export interface ProgressCharacterResponse {
|
|
553
814
|
description?: string;
|
|
815
|
+
/**
|
|
816
|
+
* The updated profile body. Omitted by `progress_character` when
|
|
817
|
+
* `no_changes` is true (the existing profile is left untouched).
|
|
818
|
+
*/
|
|
554
819
|
character_profile?: string;
|
|
820
|
+
/** Updated inventory artifact body, if the character's items or conditions changed. */
|
|
555
821
|
inventory?: string;
|
|
822
|
+
/**
|
|
823
|
+
* Set by `progress_character` when the character was not significantly
|
|
824
|
+
* affected by recent events. When true, the caller leaves the existing
|
|
825
|
+
* profile, inventory, and portrait unchanged.
|
|
826
|
+
*/
|
|
556
827
|
no_changes?: boolean;
|
|
557
828
|
}
|
|
558
829
|
export interface CreatePaymentIntentRequest {
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MessageAction = exports.BRIYAH_MODES = void 0;
|
|
4
4
|
exports.BRIYAH_MODES = ['agents', 'stories', 'rpg'];
|
|
5
|
+
/**
|
|
6
|
+
* Represents the action type of a message
|
|
7
|
+
*/
|
|
5
8
|
var MessageAction;
|
|
6
9
|
(function (MessageAction) {
|
|
7
10
|
MessageAction["THINK"] = "think";
|