briyah 1.5.0 → 2.0.1

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.
Files changed (231) hide show
  1. package/README.md +1272 -994
  2. package/data/common/config/markup +1 -1
  3. package/data/common/prompts/character/progress_character.json +5 -5
  4. package/data/common/prompts/illustrator/describe_scene.json +11 -3
  5. package/data/common/prompts/perceive.json +2 -2
  6. package/data/common/prompts/room_moderator/moderate.json +34 -34
  7. package/data/common/prompts/story_moderator/moderate.json +62 -62
  8. package/data/packs/dnd5e/agents/battle-master.json +6 -0
  9. package/data/packs/dnd5e/agents/campaign-designer.json +6 -0
  10. package/data/packs/dnd5e/agents/character-creator.json +6 -0
  11. package/data/packs/dnd5e/agents/dungeon-master.json +6 -0
  12. package/data/packs/dnd5e/agents/player.json +13 -0
  13. package/data/packs/dnd5e/agents/table-moderator.json +6 -0
  14. package/data/{common/artifacts/dnd5e/dungeon_master-procedure.md → packs/dnd5e/artifacts/battle_master-combat.md} +31 -131
  15. package/data/packs/dnd5e/artifacts/dungeon_master-procedure.md +192 -0
  16. package/data/{common/artifacts/dnd5e → packs/dnd5e/artifacts}/manifest.json +8 -2
  17. package/data/packs/dnd5e/pack.json +6 -0
  18. package/data/packs/dnd5e/prompts/battle_master/defaults_config.json +23 -0
  19. package/data/packs/dnd5e/prompts/battle_master/perceive.json +33 -0
  20. package/data/packs/dnd5e/prompts/battle_master/perceive.prompt +378 -0
  21. package/data/{common → packs/dnd5e}/prompts/character_creator/defaults_config.json +1 -1
  22. package/data/{common → packs/dnd5e}/prompts/character_creator/perceive.prompt +29 -0
  23. package/data/{common → packs/dnd5e}/prompts/dnd_player/perceive.prompt +40 -22
  24. package/data/{common → packs/dnd5e}/prompts/dnd_room_moderator/moderate.json +34 -34
  25. package/data/{common → packs/dnd5e}/prompts/dnd_room_moderator/moderate.prompt +14 -3
  26. package/data/{common → packs/dnd5e}/prompts/dungeon_master/defaults_config.json +1 -0
  27. package/data/{common → packs/dnd5e}/prompts/dungeon_master/perceive.prompt +122 -115
  28. package/data/packs/dnd5e/prompts/dungeon_master/system_instruction.prompt +0 -0
  29. package/data/packs/dnd5e/rooms/table.json +16 -0
  30. package/dist-sdk/server/src/ai/LLM/base-ai.service.js +4 -13
  31. package/dist-sdk/server/src/ai/LLM/deepseek.service.d.ts +2 -1
  32. package/dist-sdk/server/src/ai/LLM/deepseek.service.js +65 -77
  33. package/dist-sdk/server/src/ai/agent-config.d.ts +2 -0
  34. package/dist-sdk/server/src/ai/agent-store.service.js +8 -0
  35. package/dist-sdk/server/src/ai/agent.d.ts +6 -0
  36. package/dist-sdk/server/src/ai/agent.js +25 -2
  37. package/dist-sdk/server/src/ai/artifact.service.d.ts +3 -1
  38. package/dist-sdk/server/src/ai/artifact.service.js +12 -5
  39. package/dist-sdk/server/src/ai/pack-artifacts.d.ts +3 -3
  40. package/dist-sdk/server/src/ai/pack-artifacts.js +21 -15
  41. package/dist-sdk/server/src/app/user-service-factory.js +9 -1
  42. package/dist-sdk/server/src/app.controller.d.ts +11 -11
  43. package/dist-sdk/server/src/app.controller.js +179 -89
  44. package/dist-sdk/server/src/app.service.d.ts +30 -7
  45. package/dist-sdk/server/src/app.service.js +146 -95
  46. package/dist-sdk/server/src/common/errors.d.ts +0 -3
  47. package/dist-sdk/server/src/common/errors.js +1 -11
  48. package/dist-sdk/server/src/config/prompt-resolver.d.ts +41 -0
  49. package/dist-sdk/server/src/config/prompt-resolver.js +196 -0
  50. package/dist-sdk/server/src/config/user-config.service.d.ts +17 -0
  51. package/dist-sdk/server/src/config/user-config.service.js +103 -0
  52. package/dist-sdk/server/src/config/user-paths.service.d.ts +4 -4
  53. package/dist-sdk/server/src/config/user-paths.service.js +12 -16
  54. package/dist-sdk/server/src/packs/pack-instantiation.service.d.ts +36 -0
  55. package/dist-sdk/server/src/packs/pack-instantiation.service.js +165 -0
  56. package/dist-sdk/server/src/packs/pack-manifest.d.ts +52 -0
  57. package/dist-sdk/server/src/packs/pack-manifest.js +256 -0
  58. package/dist-sdk/server/src/packs/pack.service.d.ts +24 -0
  59. package/dist-sdk/server/src/packs/pack.service.js +151 -0
  60. package/dist-sdk/server/src/room/room-config.d.ts +5 -0
  61. package/dist-sdk/server/src/room/room-message.service.d.ts +2 -1
  62. package/dist-sdk/server/src/room/room-message.service.js +3 -2
  63. package/dist-sdk/server/src/room/room-store.service.d.ts +3 -0
  64. package/dist-sdk/server/src/room/room-store.service.js +41 -5
  65. package/dist-sdk/server/src/room/room.d.ts +7 -0
  66. package/dist-sdk/server/src/room/room.js +33 -3
  67. package/dist-sdk/server/src/sdk/briyah.d.ts +2 -0
  68. package/dist-sdk/server/src/sdk/briyah.js +45 -8
  69. package/dist-sdk/server/src/sdk/index.d.ts +7 -2
  70. package/dist-sdk/server/src/sdk/index.js +6 -2
  71. package/dist-sdk/server/src/shared/shared.module.js +0 -3
  72. package/dist-sdk/server/src/story/story.service.d.ts +2 -2
  73. package/dist-sdk/server/src/tools/packs/dnd5e/data/kits.d.ts +17 -0
  74. package/dist-sdk/server/src/tools/packs/dnd5e/data/kits.js +54 -0
  75. package/dist-sdk/server/src/tools/packs/dnd5e/data/races.d.ts +3 -0
  76. package/dist-sdk/server/src/tools/packs/dnd5e/data/races.js +6 -0
  77. package/dist-sdk/server/src/tools/packs/dnd5e/data/srd.d.ts +2 -0
  78. package/dist-sdk/server/src/tools/packs/dnd5e/data/srd.js +4 -0
  79. package/dist-sdk/server/src/tools/packs/dnd5e/engine/backgrounds.d.ts +1 -1
  80. package/dist-sdk/server/src/tools/packs/dnd5e/engine/backgrounds.js +6 -3
  81. package/dist-sdk/server/src/tools/packs/dnd5e/engine/character.d.ts +3 -0
  82. package/dist-sdk/server/src/tools/packs/dnd5e/engine/character.js +45 -5
  83. package/dist-sdk/server/src/tools/packs/dnd5e/engine/encounter.d.ts +27 -0
  84. package/dist-sdk/server/src/tools/packs/dnd5e/engine/encounter.js +103 -0
  85. package/dist-sdk/server/src/tools/packs/dnd5e/engine/foes.d.ts +7 -0
  86. package/dist-sdk/server/src/tools/packs/dnd5e/engine/foes.js +83 -0
  87. package/dist-sdk/server/src/tools/packs/dnd5e/engine/kits.d.ts +19 -0
  88. package/dist-sdk/server/src/tools/packs/dnd5e/engine/kits.js +130 -0
  89. package/dist-sdk/server/src/tools/packs/dnd5e/engine/races.d.ts +2 -1
  90. package/dist-sdk/server/src/tools/packs/dnd5e/engine/races.js +13 -2
  91. package/dist-sdk/server/src/tools/packs/dnd5e/engine/rules.d.ts +6 -0
  92. package/dist-sdk/server/src/tools/packs/dnd5e/engine/rules.js +16 -0
  93. package/dist-sdk/server/src/tools/packs/dnd5e/engine/sheet.d.ts +10 -0
  94. package/dist-sdk/server/src/tools/packs/dnd5e/engine/sheet.js +82 -1
  95. package/dist-sdk/server/src/tools/packs/dnd5e/index.js +2 -0
  96. package/dist-sdk/server/src/tools/packs/dnd5e/tools/check.tool.js +51 -6
  97. package/dist-sdk/server/src/tools/packs/dnd5e/tools/dice.tools.js +19 -9
  98. package/dist-sdk/server/src/tools/packs/dnd5e/tools/encounter.tool.d.ts +2 -0
  99. package/dist-sdk/server/src/tools/packs/dnd5e/tools/encounter.tool.js +134 -0
  100. package/dist-sdk/server/src/tools/packs/dnd5e/tools/monster.tool.js +31 -13
  101. package/dist-sdk/server/src/tools/packs/dnd5e/tools/shared.d.ts +2 -0
  102. package/dist-sdk/server/src/tools/packs/dnd5e/tools/shared.js +25 -8
  103. package/dist-sdk/server/src/tools/packs/dnd5e/tools/sheet.tools.js +70 -4
  104. package/dist-sdk/server/src/tools/packs/dnd5e/tools/world.tools.js +27 -0
  105. package/dist-sdk/server/src/tools/packs/index.d.ts +1 -2
  106. package/dist-sdk/server/src/tools/packs/index.js +5 -11
  107. package/dist-sdk/shared/types/app.types.d.ts +81 -13
  108. package/docs/assets/hierarchy.js +1 -1
  109. package/docs/assets/highlight.css +15 -1
  110. package/docs/assets/icons.js +1 -1
  111. package/docs/assets/icons.svg +1 -1
  112. package/docs/assets/main.js +4 -4
  113. package/docs/assets/navigation.js +1 -1
  114. package/docs/assets/search.js +1 -1
  115. package/docs/assets/style.css +18 -3
  116. package/docs/classes/Agent.html +702 -37
  117. package/docs/classes/Briyah.html +250 -33
  118. package/docs/classes/BriyahConfigService.html +117 -10
  119. package/docs/classes/NativeToolRegistry.html +156 -11
  120. package/docs/classes/PackInstantiationService.html +157 -0
  121. package/docs/classes/PackService.html +247 -0
  122. package/docs/classes/Room.html +1190 -77
  123. package/docs/classes/RoomMessage.html +260 -29
  124. package/docs/enums/MessageAction.html +123 -3
  125. package/docs/functions/availableToolPacks.html +41 -2
  126. package/docs/functions/dnd5eTools.html +42 -3
  127. package/docs/functions/installToolPacks.html +48 -0
  128. package/docs/functions/registerToolPacks.html +54 -6
  129. package/docs/hierarchy.html +42 -1
  130. package/docs/index.html +301 -54
  131. package/docs/interfaces/AgentCreationOptions.html +110 -11
  132. package/docs/interfaces/AgentInfo.html +188 -3
  133. package/docs/interfaces/AgentMessagesResponse.html +71 -2
  134. package/docs/interfaces/AppService.html +2806 -474
  135. package/docs/interfaces/Artifact.html +81 -4
  136. package/docs/interfaces/ArtifactMetadata.html +104 -3
  137. package/docs/interfaces/ArtifactWriteOptions.html +75 -6
  138. package/docs/interfaces/AttachDocumentResponse.html +61 -2
  139. package/docs/interfaces/BriyahConfigOptions.html +107 -10
  140. package/docs/interfaces/ChapterInfo.html +61 -2
  141. package/docs/interfaces/Character.html +81 -2
  142. package/docs/interfaces/CreateAgentResponse.html +56 -2
  143. package/docs/interfaces/CreateRoomResponse.html +61 -2
  144. package/docs/interfaces/CreateStoryResponse.html +56 -2
  145. package/docs/interfaces/FileList.html +56 -2
  146. package/docs/interfaces/FileMetadata.html +84 -3
  147. package/docs/interfaces/IConfigService.html +76 -3
  148. package/docs/interfaces/InstantiateModels.html +64 -0
  149. package/docs/interfaces/InstantiateRoomResult.html +70 -0
  150. package/docs/interfaces/LoadedPack.html +131 -0
  151. package/docs/interfaces/LoggingOptions.html +86 -7
  152. package/docs/interfaces/Message.html +80 -2
  153. package/docs/interfaces/ModelChoice.html +73 -0
  154. package/docs/interfaces/ModelInfo.html +71 -2
  155. package/docs/interfaces/NativeToolDefinition.html +96 -9
  156. package/docs/interfaces/PackAgentTemplate.html +101 -0
  157. package/docs/interfaces/PackRoomTemplate.html +108 -0
  158. package/docs/interfaces/PackView.html +172 -0
  159. package/docs/interfaces/PreparedPromptResponse.html +61 -2
  160. package/docs/interfaces/ProcessTextResponse.html +81 -2
  161. package/docs/interfaces/PromptFile.html +69 -2
  162. package/docs/interfaces/PromptFileContent.html +75 -2
  163. package/docs/interfaces/PromptFilesResponse.html +56 -2
  164. package/docs/interfaces/PromptFolder.html +79 -2
  165. package/docs/interfaces/PromptFolderDefaults.html +136 -5
  166. package/docs/interfaces/PromptFolderDefaultsResponse.html +78 -4
  167. package/docs/interfaces/PromptFoldersResponse.html +56 -2
  168. package/docs/interfaces/RoomDetails.html +133 -4
  169. package/docs/interfaces/RoomErrorUpdate.html +82 -0
  170. package/docs/interfaces/RoomInfo.html +84 -2
  171. package/docs/interfaces/RoomMessageUpdate.html +106 -2
  172. package/docs/interfaces/RoomMessagesResponse.html +61 -2
  173. package/docs/interfaces/SendMessageResult.html +61 -2
  174. package/docs/interfaces/StoryErrorEvent.html +76 -4
  175. package/docs/interfaces/StoryIdea.html +71 -2
  176. package/docs/interfaces/StoryInfo.html +173 -3
  177. package/docs/interfaces/StoryIntroduceCharacterEvent.html +71 -4
  178. package/docs/interfaces/StoryProgressChapterEvent.html +64 -3
  179. package/docs/interfaces/StoryState.html +99 -6
  180. package/docs/interfaces/StoryStateEvent.html +69 -3
  181. package/docs/interfaces/ToolArtifact.html +81 -4
  182. package/docs/interfaces/ToolCaller.html +75 -6
  183. package/docs/interfaces/ToolDefinition.html +76 -2
  184. package/docs/interfaces/ToolHelpers.html +91 -6
  185. package/docs/interfaces/ToolParameter.html +71 -2
  186. package/docs/interfaces/ToolRoomAccess.html +200 -24
  187. package/docs/interfaces/ToolSummary.html +71 -2
  188. package/docs/interfaces/ToolsResponse.html +66 -2
  189. package/docs/interfaces/Transaction.html +96 -2
  190. package/docs/interfaces/TransactionHistoryResponse.html +61 -2
  191. package/docs/modules.html +53 -1
  192. package/docs/types/PackOrigin.html +34 -0
  193. package/docs/types/PromptScope.html +34 -1
  194. package/docs/types/RoomTurnMode.html +36 -2
  195. package/docs/types/RoomUpdate.html +36 -0
  196. package/docs/types/RosterOverrides.html +42 -0
  197. package/docs/types/ToolContext.html +36 -2
  198. package/docs/types/ToolRunResult.html +34 -1
  199. package/package.json +139 -139
  200. package/src/tools/packs/dnd5e/README.md +186 -27
  201. package/dist-sdk/server/src/library/library.service.d.ts +0 -14
  202. package/dist-sdk/server/src/library/library.service.js +0 -165
  203. package/docs/functions/enabledToolPacks.html +0 -2
  204. /package/data/{common/artifacts/dnd5e → packs/dnd5e/artifacts}/campaign_designer-setting.md +0 -0
  205. /package/data/{common/artifacts/dnd5e → packs/dnd5e/artifacts}/character_creator-basics.md +0 -0
  206. /package/data/{common/artifacts/dnd5e → packs/dnd5e/artifacts}/class-barbarian.md +0 -0
  207. /package/data/{common/artifacts/dnd5e → packs/dnd5e/artifacts}/class-bard.md +0 -0
  208. /package/data/{common/artifacts/dnd5e → packs/dnd5e/artifacts}/class-cleric.md +0 -0
  209. /package/data/{common/artifacts/dnd5e → packs/dnd5e/artifacts}/class-druid.md +0 -0
  210. /package/data/{common/artifacts/dnd5e → packs/dnd5e/artifacts}/class-fighter.md +0 -0
  211. /package/data/{common/artifacts/dnd5e → packs/dnd5e/artifacts}/class-monk.md +0 -0
  212. /package/data/{common/artifacts/dnd5e → packs/dnd5e/artifacts}/class-paladin.md +0 -0
  213. /package/data/{common/artifacts/dnd5e → packs/dnd5e/artifacts}/class-ranger.md +0 -0
  214. /package/data/{common/artifacts/dnd5e → packs/dnd5e/artifacts}/class-rogue.md +0 -0
  215. /package/data/{common/artifacts/dnd5e → packs/dnd5e/artifacts}/class-sorcerer.md +0 -0
  216. /package/data/{common/artifacts/dnd5e → packs/dnd5e/artifacts}/class-warlock.md +0 -0
  217. /package/data/{common/artifacts/dnd5e → packs/dnd5e/artifacts}/class-wizard.md +0 -0
  218. /package/data/{common/prompts/campaign_designer → packs/dnd5e/prompts/battle_master}/system_instruction.prompt +0 -0
  219. /package/data/{common → packs/dnd5e}/prompts/campaign_designer/defaults_config.json +0 -0
  220. /package/data/{common → packs/dnd5e}/prompts/campaign_designer/perceive.json +0 -0
  221. /package/data/{common → packs/dnd5e}/prompts/campaign_designer/perceive.prompt +0 -0
  222. /package/data/{common/prompts/character_creator → packs/dnd5e/prompts/campaign_designer}/system_instruction.prompt +0 -0
  223. /package/data/{common → packs/dnd5e}/prompts/character_creator/perceive.json +0 -0
  224. /package/data/{common/prompts/dnd_player → packs/dnd5e/prompts/character_creator}/system_instruction.prompt +0 -0
  225. /package/data/{common → packs/dnd5e}/prompts/dnd_player/defaults_config.json +0 -0
  226. /package/data/{common → packs/dnd5e}/prompts/dnd_player/perceive.json +0 -0
  227. /package/data/{common/prompts/dnd_room_moderator → packs/dnd5e/prompts/dnd_player}/system_instruction.prompt +0 -0
  228. /package/data/{common → packs/dnd5e}/prompts/dnd_room_moderator/defaults_config.json +0 -0
  229. /package/data/{common/prompts/dungeon_master → packs/dnd5e/prompts/dnd_room_moderator}/system_instruction.prompt +0 -0
  230. /package/data/{common → packs/dnd5e}/prompts/dungeon_master/compact_agent.prompt +0 -0
  231. /package/data/{common → packs/dnd5e}/prompts/dungeon_master/perceive.json +0 -0
@@ -1 +1 @@
1
- 16.92596730000004
1
+ 17.18821978000002
@@ -6,21 +6,21 @@
6
6
  "properties": {
7
7
  "no_changes": {
8
8
  "type": "boolean",
9
- "description": "Set true when this character was NOT significantly affected by recent events. When true, omit description, character_profile, and inventory entirely - the existing profile is left unchanged."
9
+ "description": "Set true when this character was NOT significantly affected by recent events. When true, send description, character_profile, and inventory as empty strings - the existing profile is left unchanged."
10
10
  },
11
11
  "description": {
12
12
  "type": "string",
13
- "description": "A brief 1-2 sentence description containing only immediately observable physical characteristics. Omit when no_changes is true."
13
+ "description": "A brief 1-2 sentence description containing only immediately observable physical characteristics. Empty string when no_changes is true."
14
14
  },
15
15
  "character_profile": {
16
16
  "type": "string",
17
- "description": "An updated markdown-formatted character profile reflecting growth and changes from recent story events. Omit when no_changes is true."
17
+ "description": "An updated markdown-formatted character profile reflecting growth and changes from recent story events. Empty string when no_changes is true."
18
18
  },
19
19
  "inventory": {
20
20
  "type": "string",
21
- "description": "An updated concise markdown inventory reflecting items gained, lost, consumed, equipped, or any new/resolved conditions since the last chapter. Use '## Items' and (optionally) '## Conditions' sections. Omit this field if the character was just introduced, had no inventory artifact yet, or no_changes is true."
21
+ "description": "An updated concise markdown inventory reflecting items gained, lost, consumed, equipped, or any new/resolved conditions since the last chapter. Use '## Items' and (optionally) '## Conditions' sections. Empty string if the character was just introduced, had no inventory artifact yet, or no_changes is true."
22
22
  }
23
23
  },
24
- "required": ["no_changes"],
24
+ "required": ["no_changes", "description", "character_profile", "inventory"],
25
25
  "additionalProperties": false
26
26
  }
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "imageCaption": {
13
13
  "type": "string",
14
- "description": "A single sentence caption for the image describing what is happening"
14
+ "description": "A single sentence caption for the image describing what is happening. Empty string when createImage is false."
15
15
  },
16
16
  "sceneName": {
17
17
  "type": "string",
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "newCharacters": {
32
32
  "type": "array",
33
- "description": "For every name in characterNames that is NOT in the input Characters list, provide a brief visual description grounded in the recent narration so a portrait can be generated. Leave empty if every name in characterNames is already in the Characters list.",
33
+ "description": "For every name in characterNames that is NOT in the input Characters list, provide a brief visual description grounded in the recent narration so a portrait can be generated. Send an empty array if every name in characterNames is already in the Characters list.",
34
34
  "items": {
35
35
  "type": "object",
36
36
  "properties": {
@@ -47,5 +47,13 @@
47
47
  }
48
48
  }
49
49
  },
50
- "required": ["isReference", "sceneName", "sceneDescription", "characterNames"]
50
+ "required": [
51
+ "createImage",
52
+ "isReference",
53
+ "imageCaption",
54
+ "sceneName",
55
+ "sceneDescription",
56
+ "characterNames",
57
+ "newCharacters"
58
+ ]
51
59
  }
@@ -21,9 +21,9 @@
21
21
  },
22
22
  "situation": {
23
23
  "type": "string",
24
- "description": "Optional 1-2 sentence summary of the current situation (helps with message routing)"
24
+ "description": "A 1-2 sentence summary of the current situation (helps with message routing). Send an empty string when you have nothing to add — the field must be present."
25
25
  }
26
26
  },
27
- "required": ["action", "targets", "content", "name"],
27
+ "required": ["action", "targets", "content", "name", "situation"],
28
28
  "additionalProperties": false
29
29
  }
@@ -1,34 +1,34 @@
1
- {
2
- "name": "moderate",
3
- "description": "Route messages to appropriate agents",
4
- "type": "object",
5
- "properties": {
6
- "action": {
7
- "type": "string",
8
- "enum": ["relay", "relay_silent"],
9
- "description": "Use 'relay' to pass message and log it to room history. Use 'relay_silent' for internal processing without logging to room (e.g., character actions going to narrator)"
10
- },
11
- "content": {
12
- "type": "string",
13
- "description": "The modified contents of the message to relay. Empty for no modifications"
14
- },
15
- "name": {
16
- "type": "string",
17
- "description": "The name of the agent who should respond next"
18
- },
19
- "targets": {
20
- "type": "array",
21
- "description": "List of agent names who should receive the message",
22
- "items": {
23
- "type": "string"
24
- }
25
- },
26
- "relayAs": {
27
- "type": "string",
28
- "enum": ["speak", "whisper", "shout"],
29
- "description": "The action the relayed message carries in the room. Use 'whisper' when the targets are only some of the agents present, 'speak' when everyone present is a target, and 'shout' only when the message must reach the whole room."
30
- }
31
- },
32
- "required": ["action", "content", "name", "targets", "relayAs"],
33
- "additionalProperties": false
34
- }
1
+ {
2
+ "name": "moderate",
3
+ "description": "Route messages to appropriate agents",
4
+ "type": "object",
5
+ "properties": {
6
+ "action": {
7
+ "type": "string",
8
+ "enum": ["relay", "relay_silent"],
9
+ "description": "Use 'relay' to pass message and log it to room history. Use 'relay_silent' for internal processing without logging to room (e.g., character actions going to narrator)"
10
+ },
11
+ "content": {
12
+ "type": "string",
13
+ "description": "The modified contents of the message to relay. Empty for no modifications"
14
+ },
15
+ "name": {
16
+ "type": "string",
17
+ "description": "The name of the agent who should respond next"
18
+ },
19
+ "targets": {
20
+ "type": "array",
21
+ "description": "List of agent names who should receive the message",
22
+ "items": {
23
+ "type": "string"
24
+ }
25
+ },
26
+ "relayAs": {
27
+ "type": "string",
28
+ "enum": ["speak", "whisper", "shout"],
29
+ "description": "The action the relayed message carries in the room. Use 'whisper' when the targets are only some of the agents present, 'speak' when everyone present is a target, and 'shout' only when the message must reach the whole room."
30
+ }
31
+ },
32
+ "required": ["action", "content", "name", "targets", "relayAs"],
33
+ "additionalProperties": false
34
+ }
@@ -1,62 +1,62 @@
1
- {
2
- "name": "moderate",
3
- "description": "Route messages to appropriate agents",
4
- "type": "object",
5
- "properties": {
6
- "action": {
7
- "type": "string",
8
- "enum": ["relay", "relay_silent"],
9
- "description": "Use 'relay' to pass message and log it to room history. Use 'relay_silent' for internal processing without logging to room (e.g., character actions going to narrator)"
10
- },
11
- "content": {
12
- "type": "string",
13
- "description": "The modified contents of the message to relay. Empty for no modifications"
14
- },
15
- "name": {
16
- "type": "string",
17
- "description": "The name of the agent who should respond next"
18
- },
19
- "targets": {
20
- "type": "array",
21
- "description": "List of agent names who should receive the message",
22
- "items": {
23
- "type": "string"
24
- }
25
- },
26
- "changes": {
27
- "type": "object",
28
- "description": "Optional story state changes triggered by this message",
29
- "properties": {
30
- "update_portrait": {
31
- "type": "array",
32
- "description": "List of agent names whose visible appearance has changed (e.g., new outfit, injury, transformation, visible carried item). Leave empty or omit if no visual changes occurred.",
33
- "items": {
34
- "type": "string"
35
- }
36
- },
37
- "update_inventory": {
38
- "type": "array",
39
- "description": "List of character inventory updates triggered by this message. Each entry replaces the named character's existing stored inventory wholesale. Include an entry only when items have actually been gained, lost, consumed, equipped, or when a notable physical/mental trait or condition has changed (wounded, exhausted, intoxicated, transformed, etc.). Leave empty or omit if nothing changed.",
40
- "items": {
41
- "type": "object",
42
- "properties": {
43
- "characterName": {
44
- "type": "string",
45
- "description": "The exact nickname of the character whose inventory is being updated."
46
- },
47
- "inventory": {
48
- "type": "string",
49
- "description": "The full updated inventory text. Concise markdown. Include an '## Items' section listing things the character has on their person, and a '## Conditions' section listing notable physical or mental traits and states. Omit either section if empty."
50
- }
51
- },
52
- "required": ["characterName", "inventory"],
53
- "additionalProperties": false
54
- }
55
- }
56
- },
57
- "additionalProperties": false
58
- }
59
- },
60
- "required": ["action", "content", "name", "targets", "changes"],
61
- "additionalProperties": false
62
- }
1
+ {
2
+ "name": "moderate",
3
+ "description": "Route messages to appropriate agents",
4
+ "type": "object",
5
+ "properties": {
6
+ "action": {
7
+ "type": "string",
8
+ "enum": ["relay", "relay_silent"],
9
+ "description": "Use 'relay' to pass message and log it to room history. Use 'relay_silent' for internal processing without logging to room (e.g., character actions going to narrator)"
10
+ },
11
+ "content": {
12
+ "type": "string",
13
+ "description": "The modified contents of the message to relay. Empty for no modifications"
14
+ },
15
+ "name": {
16
+ "type": "string",
17
+ "description": "The name of the agent who should respond next"
18
+ },
19
+ "targets": {
20
+ "type": "array",
21
+ "description": "List of agent names who should receive the message",
22
+ "items": {
23
+ "type": "string"
24
+ }
25
+ },
26
+ "changes": {
27
+ "type": "object",
28
+ "description": "Optional story state changes triggered by this message",
29
+ "properties": {
30
+ "update_portrait": {
31
+ "type": "array",
32
+ "description": "List of agent names whose visible appearance has changed (e.g., new outfit, injury, transformation, visible carried item). Leave empty or omit if no visual changes occurred.",
33
+ "items": {
34
+ "type": "string"
35
+ }
36
+ },
37
+ "update_inventory": {
38
+ "type": "array",
39
+ "description": "List of character inventory updates triggered by this message. Each entry replaces the named character's existing stored inventory wholesale. Include an entry only when items have actually been gained, lost, consumed, equipped, or when a notable physical/mental trait or condition has changed (wounded, exhausted, intoxicated, transformed, etc.). Leave empty or omit if nothing changed.",
40
+ "items": {
41
+ "type": "object",
42
+ "properties": {
43
+ "characterName": {
44
+ "type": "string",
45
+ "description": "The exact nickname of the character whose inventory is being updated."
46
+ },
47
+ "inventory": {
48
+ "type": "string",
49
+ "description": "The full updated inventory text. Concise markdown. Include an '## Items' section listing things the character has on their person, and a '## Conditions' section listing notable physical or mental traits and states. Omit either section if empty."
50
+ }
51
+ },
52
+ "required": ["characterName", "inventory"],
53
+ "additionalProperties": false
54
+ }
55
+ }
56
+ },
57
+ "additionalProperties": false
58
+ }
59
+ },
60
+ "required": ["action", "content", "name", "targets", "changes"],
61
+ "additionalProperties": false
62
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "key": "battle_master",
3
+ "promptFolder": "battle_master",
4
+ "label": "Battle Master",
5
+ "modelRole": "economy"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "key": "campaign_designer",
3
+ "promptFolder": "campaign_designer",
4
+ "label": "Campaign Designer",
5
+ "modelRole": "economy"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "key": "character_creator",
3
+ "promptFolder": "character_creator",
4
+ "label": "Character Creator",
5
+ "modelRole": "economy"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "key": "dungeon_master",
3
+ "promptFolder": "dungeon_master",
4
+ "label": "Dungeon Master",
5
+ "modelRole": "primary"
6
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "key": "player",
3
+ "promptFolder": "dnd_player",
4
+ "label": "Player (human)",
5
+ "modelRole": "economy",
6
+ "overrides": {
7
+ "agentName": "Player One",
8
+ "agentNickname": "PlayerOne",
9
+ "description": "A player at the table.",
10
+ "controlledByHuman": true,
11
+ "useModerator": true
12
+ }
13
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "key": "table_moderator",
3
+ "promptFolder": "dnd_room_moderator",
4
+ "label": "Table Moderator",
5
+ "modelRole": "economy"
6
+ }
@@ -1,11 +1,11 @@
1
- # Running the game: combat, exploration and adjudication
1
+ # Running a fight: the combat mechanics
2
2
 
3
- Attach to the **Dungeon Master** agent only.
3
+ Attach to the **Battle Master** agent only.
4
4
 
5
- This is the procedural half of the rules the `dnd5e` tool pack does not model. The pack computes
5
+ This is the procedural half of combat that the `dnd5e` tool pack does not model. The pack computes
6
6
  numbers off character sheets and looks up creatures, spells, items and single rules; it does not
7
- tell you how a round is sequenced, what an action can be spent on, how far a party travels in a
8
- day, or how hard a door is to break. That is what is here.
7
+ tell you how a round is sequenced, what an action can be spent on, what movement costs, or how a
8
+ shove is resolved. That is what is here.
9
9
 
10
10
  *This work includes material from the System Reference Document 5.1 by Wizards of the Coast LLC,
11
11
  available under the Creative Commons Attribution 4.0 International License.*
@@ -21,13 +21,11 @@ is authoritative and costs one call.
21
21
  | Opportunity attacks, two-weapon fighting, grappling | `opportunity attack`, `two-weapon fighting`, `grappling` |
22
22
  | Concentration | `concentration` |
23
23
  | Death saves, massive damage, temporary hit points | `death saving throw`, `massive damage`, `temporary hit points` |
24
- | Short and long rest benefits | `short rest`, `long rest` |
25
- | Hiding, passive Perception | `hiding`, `passive perception` |
26
- | Falling | `falling` |
27
- | Any condition, weapon, armour, race, feat, background | the name itself |
24
+ | Any condition, weapon, armour, tool | the name itself |
28
25
 
29
26
  `stat_block`, `spell` and `magic_item` cover every SRD creature, spell and item. `check`,
30
- `apply_hp`, `rest`, `spend`, `conditions` and `inventory` do the arithmetic on sheets.
27
+ `apply_hp`, `spend` and `conditions` do the arithmetic — on monsters too, once they have been
28
+ placed in the fight, so nothing in a fight has to be tracked in your head.
31
29
 
32
30
  ## The combat round
33
31
 
@@ -147,7 +145,10 @@ knock it prone **or** push it 5 feet. Grappling works the same way; `rules_looku
147
145
 
148
146
  ## Damage and healing
149
147
 
150
- `apply_hp` handles the arithmetic, the dying sequence and death saves. These are the rulings around it.
148
+ `apply_hp` handles the arithmetic, the dying sequence and death saves — **for monsters as well as
149
+ characters**, once the monsters have been placed with `stat_block`'s `place` parameter. A placed
150
+ creature takes damage by name, applies its own resistances, and dies outright at 0 without
151
+ rolling death saves. These are the rulings around it.
151
152
 
152
153
  - **Damage rolls**: add the same ability modifier used for the attack roll. Roll area damage
153
154
  **once** for every creature caught in it. Damage can be reduced to 0 but never below.
@@ -189,6 +190,22 @@ reaction to dismount and land on your feet.
189
190
  it unless the weapon is a crossbow, a net, or thrown like a javelin, spear, trident or dart.
190
191
  - Fully immersed creatures and objects have **resistance to fire**.
191
192
 
193
+ ## Vision and light
194
+
195
+ **Lightly obscured** (dim light, patchy fog, moderate foliage): disadvantage on sight-based Wisdom
196
+ (Perception) checks. **Heavily obscured** (darkness, opaque fog, dense foliage): treat a creature
197
+ trying to see into it as blinded.
198
+
199
+ Bright light is normal sight. Dim light is lightly obscured, and covers twilight, dawn, the edge of
200
+ a torch's radius, and a brilliant full moon. Darkness is heavily obscured, and covers night
201
+ outdoors, an unlit dungeon and magical darkness.
202
+
203
+ - **Blindsight**: perceives without sight within a radius.
204
+ - **Darkvision**: darkness within the radius is only lightly obscured, in shades of grey.
205
+ - **Truesight**: sees in any darkness, sees invisible creatures and objects, automatically detects
206
+ and saves against visual illusions, sees a shapechanger's or transformed creature's true form,
207
+ and sees into the Ethereal Plane.
208
+
192
209
  ## Setting a difficulty
193
210
 
194
211
  | Task | DC |
@@ -224,125 +241,8 @@ character makes no progress, or progress with a setback you choose.
224
241
  | Wisdom | Animal Handling, Insight, Medicine, Perception, Survival |
225
242
  | Charisma | Deception, Intimidation, Performance, Persuasion |
226
243
 
227
- ## Exploration
228
-
229
- Track time on the scale the scene needs: **rounds** in combat, **minutes** in a dungeon (a minute
230
- to creep down a hall, ten to search a chamber), **hours** in a city or wilderness, **days** on a
231
- journey. Summarize movement between encounters unless the exact time matters.
232
-
233
- | Pace | Per minute | Per hour | Per day | Effect |
234
- |---|---|---|---|---|
235
- | Fast | 400 ft | 4 miles | 30 miles | −5 to passive Wisdom (Perception) |
236
- | Normal | 300 ft | 3 miles | 18 miles | — |
237
- | Slow | 200 ft | 2 miles | 24 miles | May use stealth |
238
-
239
- Difficult terrain halves all of these. The table assumes 8 hours of travel. For each hour beyond
240
- that, the party covers the hourly distance and each character makes a Constitution save at DC
241
- 10 + 1 per hour past 8, taking one level of exhaustion on a failure. A mount can gallop for about
242
- an hour at twice the fast-pace distance. Waterborne travel is limited to the vessel's speed,
243
- neither penalized for a fast pace nor helped by a slow one, and can run up to 24 hours a day.
244
-
245
- ### Vision and light
246
-
247
- **Lightly obscured** (dim light, patchy fog, moderate foliage): disadvantage on sight-based Wisdom
248
- (Perception) checks. **Heavily obscured** (darkness, opaque fog, dense foliage): treat a creature
249
- trying to see into it as blinded.
250
-
251
- Bright light is normal sight. Dim light is lightly obscured, and covers twilight, dawn, the edge of
252
- a torch's radius, and a brilliant full moon. Darkness is heavily obscured, and covers night
253
- outdoors, an unlit dungeon and magical darkness.
254
-
255
- - **Blindsight**: perceives without sight within a radius.
256
- - **Darkvision**: darkness within the radius is only lightly obscured, in shades of grey.
257
- - **Truesight**: sees in any darkness, sees invisible creatures and objects, automatically detects
258
- and saves against visual illusions, sees a shapechanger's or transformed creature's true form,
259
- and sees into the Ethereal Plane.
260
-
261
- ### Air, food and water
262
-
263
- A creature holds its breath for 1 + its Constitution modifier minutes, minimum 30 seconds. Out of
264
- breath or choking, it survives its Constitution modifier in rounds, minimum 1; at the start of its
265
- next turn it drops to 0 hit points and is dying, and cannot regain hit points or be stabilized
266
- until it can breathe.
267
-
268
- A character needs 1 lb of food and 1 gallon of water a day, or 2 gallons in hot weather. Half
269
- rations count as half a day without food; a character can go 3 + Constitution modifier days without
270
- food, minimum 1, then takes a level of exhaustion each day. Half water needs a DC 15 Constitution
271
- save to avoid a level of exhaustion; less than half is automatic. Either becomes two levels if the
272
- character is already exhausted. Exhaustion from hunger or thirst cannot be removed until the full
273
- amount is eaten and drunk.
274
-
275
- ### Breaking things
276
-
277
- Objects are **immune to poison and psychic damage**, always fail Strength and Dexterity saves, and
278
- are immune to effects requiring any other save. An object at 0 hit points breaks. A **damage
279
- threshold** makes an object immune to any single hit below that number, which is how castle walls
280
- work. Give a Huge or Gargantuan object no hit point total; divide it into Large sections instead.
281
-
282
- | Substance | AC | | Size | Fragile | Resilient |
283
- |---|---|---|---|---|---|
284
- | Cloth, paper, rope | 11 | | Tiny (bottle, lock) | 2 (1d4) | 5 (2d4) |
285
- | Crystal, glass, ice | 13 | | Small (chest, lute) | 3 (1d6) | 10 (3d6) |
286
- | Wood, bone | 15 | | Medium (barrel, chandelier) | 4 (1d8) | 18 (4d8) |
287
- | Stone | 17 | | Large (cart, 10-ft window) | 5 (1d10) | 27 (5d10) |
288
- | Iron, steel | 19 | | | | |
289
- | Mithral | 21 | | | | |
290
- | Adamantine | 23 | | | | |
291
-
292
- A Strength check can force or break something; set the DC yourself. Use judgment over the table:
293
- a sword does not cut a stone wall, and bludgeoning does not sever a rope.
294
-
295
- ### Traps
296
-
297
- A trap needs a trigger, an effect, a DC to detect and a way to disable or avoid it. A character
298
- actively looking rolls Wisdom (Perception) against the trap's DC; otherwise compare passive Wisdom
299
- (Perception). Disabling is usually Intelligence (Investigation) to work out what to do, then a
300
- Dexterity check with thieves' tools. Intelligence (Arcana) detects or disarms a magic trap, and
301
- *dispel magic* often works on one.
302
-
303
- Let clever play win without a roll. If a character lifts the rug and finds the pressure plate, it
304
- is found. If they push the chest open from behind a propped shield, the needles fire into the shield.
305
-
306
- | Danger | Save DC | Attack bonus | | Level | Setback | Dangerous | Deadly |
307
- |---|---|---|---|---|---|---|---|
308
- | Setback | 10–11 | +3 to +5 | | 1st–4th | 1d10 | 2d10 | 4d10 |
309
- | Dangerous | 12–15 | +6 to +8 | | 5th–10th | 2d10 | 4d10 | 10d10 |
310
- | Deadly | 16–20 | +9 to +12 | | 11th–16th | 4d10 | 10d10 | 18d10 |
311
- | | | | | 17th–20th | 10d10 | 18d10 | 24d10 |
312
-
313
- A **complex trap** rolls initiative and acts every round, turning the trap into an encounter. Use
314
- it for a room that floods a little each round.
315
-
316
- ### Resting
317
-
318
- A **short rest** is at least 1 hour of nothing more strenuous than eating, drinking, reading and
319
- tending wounds; a character may then spend Hit Dice. A **long rest** is at least 8 hours with at
320
- least 6 asleep and no more than 2 hours of light activity, and is interrupted by an hour or more of
321
- walking, fighting or spellcasting, which restarts it. One long rest per 24 hours, and a character
322
- must have at least 1 hit point to benefit. `rest` applies both.
323
-
324
- ### Inspiration
325
-
326
- Award inspiration for playing a personality trait, ideal, bond or flaw in a way that costs the
327
- character something. It is binary, not stockpiled: spend it for advantage on one attack roll,
328
- saving throw or ability check, or hand it to another player who earned it.
329
-
330
- ## Between adventures
331
-
332
- Downtime activities take whole days, at least 8 hours each, not necessarily consecutive.
333
-
334
- - **Crafting**: 5 gp of market value per day, expending half that in materials, with the right
335
- tools. Several characters may combine days.
336
- - **Practising a profession**: covers a modest lifestyle, or comfortable with an organization
337
- behind you, or wealthy with Performance proficiency.
338
- - **Recuperating**: after 3 days, a DC 15 Constitution save ends one effect preventing hit point
339
- recovery, or grants a day's advantage on saves against one disease or poison.
340
- - **Researching**: 1 gp a day. You decide whether the information exists, how long it takes, and
341
- what checks it needs.
342
- - **Training**: 250 days and 1 gp a day for a language or a tool proficiency, and an instructor.
343
-
344
244
  ## Not covered here
345
245
 
346
- Diseases, poisons and madness are optional subsystems the SRD prints in full; improvise them or
347
- read them from the source when a campaign actually needs one. They are left out on purpose so this
348
- document stays in your cached prompt cheaply.
246
+ Everything outside a fight — travel, exploration, resting, traps, downtime — belongs to the
247
+ Dungeon Master and is in their document, not yours. When a fight ends, hand back rather than
248
+ carrying on into the aftermath.