briyah 2.0.1 → 2.0.2

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 (313) hide show
  1. package/README.md +19 -10
  2. package/data/common/config/markup +1 -1
  3. package/data/common/config/model_prices.json +46369 -46361
  4. package/data/common/config/rpg_models.json +60 -0
  5. package/data/common/prompts/narrator/create_chapter.prompt +12 -1
  6. package/data/common/prompts/pdf_converter/convert_pdf_page.prompt +8 -1
  7. package/data/common/prompts/perceive.prompt +287 -291
  8. package/data/packs/acts/agents/character-guide.json +6 -0
  9. package/data/packs/acts/agents/discipleship-mentor.json +6 -0
  10. package/data/packs/acts/agents/mentor-coach.json +6 -0
  11. package/data/packs/acts/agents/student.json +13 -0
  12. package/data/packs/acts/agents/table-moderator.json +6 -0
  13. package/data/packs/acts/artifacts/chapter-01-acts-1.md +405 -0
  14. package/data/packs/acts/artifacts/chapter-02-acts-2.md +443 -0
  15. package/data/packs/acts/artifacts/chapter-03-acts-3.md +409 -0
  16. package/data/packs/acts/artifacts/chapter-04-acts-4.md +438 -0
  17. package/data/packs/acts/artifacts/chapter-05-acts-5.md +434 -0
  18. package/data/packs/acts/artifacts/chapter-06-acts-6.md +441 -0
  19. package/data/packs/acts/artifacts/chapter-07-acts-7.md +472 -0
  20. package/data/packs/acts/artifacts/chapter-08-acts-8.md +512 -0
  21. package/data/packs/acts/artifacts/chapter-09-acts-9.md +346 -0
  22. package/data/packs/acts/artifacts/chapter-10-acts-10.md +367 -0
  23. package/data/packs/acts/artifacts/chapter-11-acts-11.md +391 -0
  24. package/data/packs/acts/artifacts/chapter-12-acts-12.md +390 -0
  25. package/data/packs/acts/artifacts/chapter-13-acts-13.md +388 -0
  26. package/data/packs/acts/artifacts/chapter-14-acts-14.md +466 -0
  27. package/data/packs/acts/artifacts/chapter-15-acts-15.md +413 -0
  28. package/data/packs/acts/artifacts/chapter-16-acts-16.md +585 -0
  29. package/data/packs/acts/artifacts/chapter-17-acts-17.md +428 -0
  30. package/data/packs/acts/artifacts/chapter-18-acts-18.md +486 -0
  31. package/data/packs/acts/artifacts/chapter-19-acts-19.md +461 -0
  32. package/data/packs/acts/artifacts/chapter-20-acts-20.md +389 -0
  33. package/data/packs/acts/artifacts/chapter-21-acts-21.md +452 -0
  34. package/data/packs/acts/artifacts/chapter-22-acts-22.md +424 -0
  35. package/data/packs/acts/artifacts/chapter-23-acts-23.md +395 -0
  36. package/data/packs/acts/artifacts/chapter-24-acts-24.md +446 -0
  37. package/data/packs/acts/artifacts/chapter-25-acts-25.md +391 -0
  38. package/data/packs/acts/artifacts/chapter-26-acts-26.md +431 -0
  39. package/data/packs/acts/artifacts/chapter-27-acts-27.md +530 -0
  40. package/data/packs/acts/artifacts/chapter-28-acts-28.md +1871 -0
  41. package/data/packs/acts/artifacts/chapters.manifest.json +170 -0
  42. package/data/packs/acts/artifacts/character_guide-creation.md +112 -0
  43. package/data/packs/acts/artifacts/discipleship_mentor-procedure.md +154 -0
  44. package/data/packs/acts/artifacts/discipleship_mentor-systems.md +72 -0
  45. package/data/packs/acts/artifacts/manifest.json +197 -0
  46. package/data/packs/acts/artifacts/stage-guide.md +94 -0
  47. package/data/packs/acts/pack.json +6 -0
  48. package/data/packs/acts/prompts/acts_player/defaults_config.json +5 -0
  49. package/data/packs/acts/prompts/acts_player/perceive.json +29 -0
  50. package/data/packs/acts/prompts/acts_player/perceive.prompt +87 -0
  51. package/data/packs/acts/prompts/acts_player/system_instruction.prompt +0 -0
  52. package/data/packs/acts/prompts/acts_room_moderator/defaults_config.json +9 -0
  53. package/data/packs/acts/prompts/acts_room_moderator/moderate.json +34 -0
  54. package/data/packs/acts/prompts/acts_room_moderator/moderate.prompt +70 -0
  55. package/data/packs/acts/prompts/acts_room_moderator/system_instruction.prompt +0 -0
  56. package/data/packs/acts/prompts/character_guide/defaults_config.json +18 -0
  57. package/data/packs/acts/prompts/character_guide/perceive.json +29 -0
  58. package/data/packs/acts/prompts/character_guide/perceive.prompt +140 -0
  59. package/data/packs/acts/prompts/character_guide/system_instruction.prompt +0 -0
  60. package/data/packs/acts/prompts/discipleship_mentor/defaults_config.json +23 -0
  61. package/data/packs/acts/prompts/discipleship_mentor/perceive.json +33 -0
  62. package/data/packs/acts/prompts/discipleship_mentor/perceive.prompt +245 -0
  63. package/data/packs/acts/prompts/discipleship_mentor/system_instruction.prompt +0 -0
  64. package/data/packs/acts/prompts/mentor_coach/defaults_config.json +13 -0
  65. package/data/packs/acts/prompts/mentor_coach/perceive.json +29 -0
  66. package/data/packs/acts/prompts/mentor_coach/perceive.prompt +87 -0
  67. package/data/packs/acts/prompts/mentor_coach/system_instruction.prompt +0 -0
  68. package/data/packs/acts/rooms/session.json +14 -0
  69. package/data/packs/acts/rooms/training.json +58 -0
  70. package/data/packs/dnd5e/artifacts/background-acolyte.md +66 -0
  71. package/data/packs/dnd5e/artifacts/character_creator-basics.md +31 -13
  72. package/data/packs/dnd5e/artifacts/class-barbarian.md +4 -1
  73. package/data/packs/dnd5e/artifacts/class-bard.md +2 -1
  74. package/data/packs/dnd5e/artifacts/class-cleric.md +2 -1
  75. package/data/packs/dnd5e/artifacts/class-druid.md +3 -1
  76. package/data/packs/dnd5e/artifacts/class-fighter.md +3 -1
  77. package/data/packs/dnd5e/artifacts/class-monk.md +2 -1
  78. package/data/packs/dnd5e/artifacts/class-paladin.md +2 -1
  79. package/data/packs/dnd5e/artifacts/class-ranger.md +3 -1
  80. package/data/packs/dnd5e/artifacts/class-rogue.md +3 -1
  81. package/data/packs/dnd5e/artifacts/class-sorcerer.md +2 -1
  82. package/data/packs/dnd5e/artifacts/class-warlock.md +3 -1
  83. package/data/packs/dnd5e/artifacts/class-wizard.md +2 -1
  84. package/data/packs/dnd5e/artifacts/manifest.json +6 -0
  85. package/data/packs/dnd5e/pack.json +1 -1
  86. package/data/packs/dnd5e/prompts/battle_master/perceive.prompt +491 -378
  87. package/data/packs/dnd5e/prompts/campaign_designer/perceive.prompt +24 -7
  88. package/data/packs/dnd5e/prompts/character_creator/defaults_config.json +2 -13
  89. package/data/packs/dnd5e/prompts/character_creator/perceive.prompt +217 -87
  90. package/data/packs/dnd5e/prompts/dnd_player/defaults_config.json +5 -5
  91. package/data/packs/dnd5e/prompts/dnd_player/perceive.prompt +18 -4
  92. package/data/packs/dnd5e/prompts/dnd_room_moderator/defaults_config.json +9 -9
  93. package/data/packs/dnd5e/prompts/dnd_room_moderator/moderate.prompt +13 -10
  94. package/data/packs/dnd5e/prompts/dungeon_master/defaults_config.json +32 -30
  95. package/data/packs/dnd5e/prompts/dungeon_master/perceive.prompt +794 -764
  96. package/data/packs/dnd5e/rooms/campaign.json +15 -0
  97. package/dist-sdk/server/src/ai/LLM/anthropic.service.d.ts +3 -0
  98. package/dist-sdk/server/src/ai/LLM/anthropic.service.js +40 -11
  99. package/dist-sdk/server/src/ai/LLM/base-ai.service.d.ts +1 -0
  100. package/dist-sdk/server/src/ai/LLM/base-ai.service.js +16 -0
  101. package/dist-sdk/server/src/ai/LLM/deepseek.service.js +5 -3
  102. package/dist-sdk/server/src/ai/agent-store.service.js +1 -1
  103. package/dist-sdk/server/src/ai/artifact.service.d.ts +2 -0
  104. package/dist-sdk/server/src/ai/artifact.service.js +6 -0
  105. package/dist-sdk/server/src/ai/pack-artifacts.d.ts +2 -0
  106. package/dist-sdk/server/src/ai/pack-artifacts.js +65 -8
  107. package/dist-sdk/server/src/app/user-service-factory.js +6 -1
  108. package/dist-sdk/server/src/app/user-service-manager.js +1 -1
  109. package/dist-sdk/server/src/app.controller.d.ts +9 -1
  110. package/dist-sdk/server/src/app.controller.js +123 -12
  111. package/dist-sdk/server/src/app.service.d.ts +23 -2
  112. package/dist-sdk/server/src/app.service.js +97 -106
  113. package/dist-sdk/server/src/auth/auth.controller.js +4 -0
  114. package/dist-sdk/server/src/auth/auth.service.d.ts +2 -1
  115. package/dist-sdk/server/src/auth/dto/phone-login.dto.d.ts +2 -1
  116. package/dist-sdk/server/src/documents/pdf-conversion.d.ts +43 -0
  117. package/dist-sdk/server/src/documents/pdf-conversion.js +175 -0
  118. package/dist-sdk/server/src/room/room-store.service.js +5 -1
  119. package/dist-sdk/server/src/room/room.d.ts +15 -2
  120. package/dist-sdk/server/src/room/room.js +82 -23
  121. package/dist-sdk/server/src/rpg/rpg-models.d.ts +9 -0
  122. package/dist-sdk/server/src/rpg/rpg-models.js +128 -0
  123. package/dist-sdk/server/src/rpg/rpg-roster.d.ts +10 -0
  124. package/dist-sdk/server/src/rpg/rpg-roster.js +71 -0
  125. package/dist-sdk/server/src/rpg/rpg.service.d.ts +29 -0
  126. package/dist-sdk/server/src/rpg/rpg.service.js +199 -0
  127. package/dist-sdk/server/src/sdk/index.d.ts +5 -2
  128. package/dist-sdk/server/src/sdk/index.js +8 -1
  129. package/dist-sdk/server/src/story/story.service.d.ts +2 -1
  130. package/dist-sdk/server/src/story/story.service.js +42 -4
  131. package/dist-sdk/server/src/tools/native-tool.types.d.ts +5 -0
  132. package/dist-sdk/server/src/tools/packs/acts/data/cards.d.ts +53 -0
  133. package/dist-sdk/server/src/tools/packs/acts/data/cards.js +54 -0
  134. package/dist-sdk/server/src/tools/packs/acts/data/character-cards.generated.d.ts +2 -0
  135. package/dist-sdk/server/src/tools/packs/acts/data/character-cards.generated.js +185 -0
  136. package/dist-sdk/server/src/tools/packs/acts/data/encounters.d.ts +12 -0
  137. package/dist-sdk/server/src/tools/packs/acts/data/encounters.js +102 -0
  138. package/dist-sdk/server/src/tools/packs/acts/data/event-cards.generated.d.ts +2 -0
  139. package/dist-sdk/server/src/tools/packs/acts/data/event-cards.generated.js +196 -0
  140. package/dist-sdk/server/src/tools/packs/acts/data/item-cards.generated.d.ts +2 -0
  141. package/dist-sdk/server/src/tools/packs/acts/data/item-cards.generated.js +1311 -0
  142. package/dist-sdk/server/src/tools/packs/acts/engine/cards.d.ts +5 -0
  143. package/dist-sdk/server/src/tools/packs/acts/engine/cards.js +27 -0
  144. package/dist-sdk/server/src/tools/packs/acts/engine/challenge.d.ts +37 -0
  145. package/dist-sdk/server/src/tools/packs/acts/engine/challenge.js +120 -0
  146. package/dist-sdk/server/src/tools/packs/acts/engine/dice.d.ts +20 -0
  147. package/dist-sdk/server/src/tools/packs/acts/engine/dice.js +41 -0
  148. package/dist-sdk/server/src/tools/packs/acts/engine/sheet.d.ts +54 -0
  149. package/dist-sdk/server/src/tools/packs/acts/engine/sheet.js +200 -0
  150. package/dist-sdk/server/src/tools/packs/acts/index.d.ts +2 -0
  151. package/dist-sdk/server/src/tools/packs/acts/index.js +24 -0
  152. package/dist-sdk/server/src/tools/packs/acts/tools/award.tool.d.ts +2 -0
  153. package/dist-sdk/server/src/tools/packs/acts/tools/award.tool.js +184 -0
  154. package/dist-sdk/server/src/tools/packs/acts/tools/challenge.tool.d.ts +2 -0
  155. package/dist-sdk/server/src/tools/packs/acts/tools/challenge.tool.js +107 -0
  156. package/dist-sdk/server/src/tools/packs/acts/tools/chapter.tool.d.ts +3 -0
  157. package/dist-sdk/server/src/tools/packs/acts/tools/chapter.tool.js +146 -0
  158. package/dist-sdk/server/src/tools/packs/acts/tools/check.tool.d.ts +4 -0
  159. package/dist-sdk/server/src/tools/packs/acts/tools/check.tool.js +241 -0
  160. package/dist-sdk/server/src/tools/packs/acts/tools/encounter.tool.d.ts +3 -0
  161. package/dist-sdk/server/src/tools/packs/acts/tools/encounter.tool.js +72 -0
  162. package/dist-sdk/server/src/tools/packs/acts/tools/faith.tool.d.ts +2 -0
  163. package/dist-sdk/server/src/tools/packs/acts/tools/faith.tool.js +75 -0
  164. package/dist-sdk/server/src/tools/packs/acts/tools/shared.d.ts +20 -0
  165. package/dist-sdk/server/src/tools/packs/acts/tools/shared.js +70 -0
  166. package/dist-sdk/server/src/tools/packs/acts/tools/sheet.tools.d.ts +4 -0
  167. package/dist-sdk/server/src/tools/packs/acts/tools/sheet.tools.js +215 -0
  168. package/dist-sdk/server/src/tools/packs/dnd5e/data/backgrounds.d.ts +0 -21
  169. package/dist-sdk/server/src/tools/packs/dnd5e/data/backgrounds.js +1 -56
  170. package/dist-sdk/server/src/tools/packs/dnd5e/data/cantrips.d.ts +10 -0
  171. package/dist-sdk/server/src/tools/packs/dnd5e/data/cantrips.js +67 -0
  172. package/dist-sdk/server/src/tools/packs/dnd5e/data/gear.d.ts +5 -0
  173. package/dist-sdk/server/src/tools/packs/dnd5e/data/gear.js +7 -1
  174. package/dist-sdk/server/src/tools/packs/dnd5e/engine/bestiary.js +4 -3
  175. package/dist-sdk/server/src/tools/packs/dnd5e/engine/cantrips.d.ts +6 -0
  176. package/dist-sdk/server/src/tools/packs/dnd5e/engine/cantrips.js +92 -0
  177. package/dist-sdk/server/src/tools/packs/dnd5e/engine/character.d.ts +32 -5
  178. package/dist-sdk/server/src/tools/packs/dnd5e/engine/character.js +177 -28
  179. package/dist-sdk/server/src/tools/packs/dnd5e/engine/coerce.d.ts +1 -13
  180. package/dist-sdk/server/src/tools/packs/dnd5e/engine/coerce.js +15 -145
  181. package/dist-sdk/server/src/tools/packs/dnd5e/engine/dice.d.ts +7 -0
  182. package/dist-sdk/server/src/tools/packs/dnd5e/engine/dice.js +11 -0
  183. package/dist-sdk/server/src/tools/packs/dnd5e/engine/encounter.d.ts +5 -0
  184. package/dist-sdk/server/src/tools/packs/dnd5e/engine/encounter.js +45 -2
  185. package/dist-sdk/server/src/tools/packs/dnd5e/engine/foes.js +3 -0
  186. package/dist-sdk/server/src/tools/packs/dnd5e/engine/guides.d.ts +21 -0
  187. package/dist-sdk/server/src/tools/packs/dnd5e/engine/guides.js +45 -0
  188. package/dist-sdk/server/src/tools/packs/dnd5e/engine/races.js +6 -4
  189. package/dist-sdk/server/src/tools/packs/dnd5e/engine/sheet.d.ts +17 -0
  190. package/dist-sdk/server/src/tools/packs/dnd5e/engine/sheet.js +56 -4
  191. package/dist-sdk/server/src/tools/packs/dnd5e/index.js +3 -0
  192. package/dist-sdk/server/src/tools/packs/dnd5e/tools/check.tool.js +117 -15
  193. package/dist-sdk/server/src/tools/packs/dnd5e/tools/class.tool.d.ts +2 -0
  194. package/dist-sdk/server/src/tools/packs/dnd5e/tools/class.tool.js +96 -0
  195. package/dist-sdk/server/src/tools/packs/dnd5e/tools/dice.tools.js +40 -3
  196. package/dist-sdk/server/src/tools/packs/dnd5e/tools/encounter.tool.js +36 -27
  197. package/dist-sdk/server/src/tools/packs/dnd5e/tools/monster.tool.js +7 -4
  198. package/dist-sdk/server/src/tools/packs/dnd5e/tools/shared.d.ts +15 -1
  199. package/dist-sdk/server/src/tools/packs/dnd5e/tools/shared.js +73 -0
  200. package/dist-sdk/server/src/tools/packs/dnd5e/tools/sheet.tools.js +40 -12
  201. package/dist-sdk/server/src/tools/packs/dnd5e/tools/state.tools.js +68 -2
  202. package/dist-sdk/server/src/tools/packs/dnd5e/tools/world.tools.d.ts +1 -0
  203. package/dist-sdk/server/src/tools/packs/dnd5e/tools/world.tools.js +119 -14
  204. package/dist-sdk/server/src/tools/packs/index.d.ts +2 -1
  205. package/dist-sdk/server/src/tools/packs/index.js +4 -1
  206. package/dist-sdk/server/src/tools/shared/coerce.d.ts +13 -0
  207. package/dist-sdk/server/src/tools/shared/coerce.js +147 -0
  208. package/dist-sdk/server/src/tools/tool-execution.service.d.ts +3 -2
  209. package/dist-sdk/server/src/tools/tool-execution.service.js +4 -1
  210. package/dist-sdk/shared/types/app.types.d.ts +64 -0
  211. package/dist-sdk/shared/types/app.types.js +2 -1
  212. package/docs/assets/hierarchy.js +1 -1
  213. package/docs/assets/navigation.js +1 -1
  214. package/docs/assets/search.js +1 -1
  215. package/docs/classes/Agent.html +73 -73
  216. package/docs/classes/Briyah.html +16 -16
  217. package/docs/classes/BriyahConfigService.html +7 -7
  218. package/docs/classes/NativeToolRegistry.html +10 -10
  219. package/docs/classes/PackInstantiationService.html +7 -7
  220. package/docs/classes/PackService.html +13 -13
  221. package/docs/classes/Room.html +118 -93
  222. package/docs/classes/RoomMessage.html +22 -22
  223. package/docs/enums/MessageAction.html +18 -18
  224. package/docs/functions/actsTools.html +44 -0
  225. package/docs/functions/availableToolPacks.html +4 -4
  226. package/docs/functions/buildMarkdown.html +54 -0
  227. package/docs/functions/dnd5eTools.html +4 -4
  228. package/docs/functions/installToolPacks.html +4 -4
  229. package/docs/functions/pageMarker.html +45 -0
  230. package/docs/functions/registerToolPacks.html +4 -4
  231. package/docs/functions/splitMarkdownIntoPages.html +51 -0
  232. package/docs/functions/stripWrappingFence.html +52 -0
  233. package/docs/hierarchy.html +13 -9
  234. package/docs/index.html +11 -8
  235. package/docs/interfaces/AgentCreationOptions.html +12 -12
  236. package/docs/interfaces/AgentInfo.html +30 -30
  237. package/docs/interfaces/AgentMessagesResponse.html +8 -8
  238. package/docs/interfaces/AppService.html +271 -196
  239. package/docs/interfaces/Artifact.html +9 -9
  240. package/docs/interfaces/ArtifactMetadata.html +13 -13
  241. package/docs/interfaces/ArtifactWriteOptions.html +7 -7
  242. package/docs/interfaces/AttachDocumentResponse.html +6 -6
  243. package/docs/interfaces/BriyahConfigOptions.html +12 -12
  244. package/docs/interfaces/ChapterInfo.html +6 -6
  245. package/docs/interfaces/Character.html +10 -10
  246. package/docs/interfaces/ConversionAgent.html +78 -0
  247. package/docs/interfaces/CreateAgentResponse.html +5 -5
  248. package/docs/interfaces/CreateRoomResponse.html +6 -6
  249. package/docs/interfaces/CreateStoryResponse.html +5 -5
  250. package/docs/interfaces/FileList.html +5 -5
  251. package/docs/interfaces/FileMetadata.html +10 -10
  252. package/docs/interfaces/IConfigService.html +5 -5
  253. package/docs/interfaces/InstantiateModels.html +6 -6
  254. package/docs/interfaces/InstantiateRoomResult.html +7 -7
  255. package/docs/interfaces/LoadedPack.html +16 -16
  256. package/docs/interfaces/LoggingOptions.html +9 -9
  257. package/docs/interfaces/Message.html +9 -9
  258. package/docs/interfaces/ModelChoice.html +7 -7
  259. package/docs/interfaces/ModelInfo.html +8 -8
  260. package/docs/interfaces/NativeToolDefinition.html +10 -10
  261. package/docs/interfaces/PackAgentTemplate.html +9 -9
  262. package/docs/interfaces/PackRoomTemplate.html +11 -11
  263. package/docs/interfaces/PackView.html +20 -20
  264. package/docs/interfaces/PdfConversionOptions.html +102 -0
  265. package/docs/interfaces/PdfConversionResult.html +97 -0
  266. package/docs/interfaces/PdfMarkdownOptions.html +198 -0
  267. package/docs/interfaces/PdfMarkdownResult.html +106 -0
  268. package/docs/interfaces/PdfPageMarkdown.html +94 -0
  269. package/docs/interfaces/PreparedPromptResponse.html +6 -6
  270. package/docs/interfaces/ProcessTextResponse.html +10 -10
  271. package/docs/interfaces/PromptFile.html +7 -7
  272. package/docs/interfaces/PromptFileContent.html +8 -8
  273. package/docs/interfaces/PromptFilesResponse.html +5 -5
  274. package/docs/interfaces/PromptFolder.html +8 -8
  275. package/docs/interfaces/PromptFolderDefaults.html +19 -19
  276. package/docs/interfaces/PromptFolderDefaultsResponse.html +7 -7
  277. package/docs/interfaces/PromptFoldersResponse.html +5 -5
  278. package/docs/interfaces/RoomDetails.html +19 -19
  279. package/docs/interfaces/RoomErrorUpdate.html +8 -8
  280. package/docs/interfaces/RoomInfo.html +10 -10
  281. package/docs/interfaces/RoomMessageUpdate.html +13 -13
  282. package/docs/interfaces/RoomMessagesResponse.html +6 -6
  283. package/docs/interfaces/SendMessageResult.html +6 -6
  284. package/docs/interfaces/StoryErrorEvent.html +8 -8
  285. package/docs/interfaces/StoryIdea.html +8 -8
  286. package/docs/interfaces/StoryInfo.html +28 -28
  287. package/docs/interfaces/StoryIntroduceCharacterEvent.html +7 -7
  288. package/docs/interfaces/StoryProgressChapterEvent.html +6 -6
  289. package/docs/interfaces/StoryState.html +12 -12
  290. package/docs/interfaces/StoryStateEvent.html +7 -7
  291. package/docs/interfaces/ToolArtifact.html +9 -9
  292. package/docs/interfaces/ToolCaller.html +7 -7
  293. package/docs/interfaces/ToolDefinition.html +9 -9
  294. package/docs/interfaces/ToolHelpers.html +17 -8
  295. package/docs/interfaces/ToolPackDocuments.html +100 -0
  296. package/docs/interfaces/ToolParameter.html +8 -8
  297. package/docs/interfaces/ToolRoomAccess.html +14 -14
  298. package/docs/interfaces/ToolSummary.html +8 -8
  299. package/docs/interfaces/ToolsResponse.html +7 -7
  300. package/docs/interfaces/Transaction.html +13 -13
  301. package/docs/interfaces/TransactionHistoryResponse.html +6 -6
  302. package/docs/modules.html +8 -8
  303. package/docs/types/PackOrigin.html +4 -4
  304. package/docs/types/PromptScope.html +4 -4
  305. package/docs/types/RoomTurnMode.html +4 -4
  306. package/docs/types/RoomUpdate.html +4 -4
  307. package/docs/types/RosterOverrides.html +4 -4
  308. package/docs/types/ToolContext.html +4 -4
  309. package/docs/types/ToolRunResult.html +4 -4
  310. package/package.json +1 -1
  311. package/src/tools/packs/dnd5e/README.md +147 -66
  312. package/dist-sdk/server/src/tools/packs/dnd5e/engine/backgrounds.d.ts +0 -20
  313. package/dist-sdk/server/src/tools/packs/dnd5e/engine/backgrounds.js +0 -112
@@ -1,5 +1,5 @@
1
- <!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>RoomUpdate | Briyah SDK - v2.0.1</title><meta name="description" content="Documentation for Briyah SDK"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar">
2
- <div class="tsd-toolbar-contents container"><a href="../index.html" class="title">Briyah SDK - v2.0.1</a>
1
+ <!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>RoomUpdate | Briyah SDK - v2.0.2</title><meta name="description" content="Documentation for Briyah SDK"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar">
2
+ <div class="tsd-toolbar-contents container"><a href="../index.html" class="title">Briyah SDK - v2.0.2</a>
3
3
  <div id="tsd-toolbar-links"><a href="https://github.com/your-org/briyah">GitHub</a><a href="https://www.npmjs.com/package/briyah">npm</a></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/>
4
4
  <ul role="listbox" id="tsd-search-results"></ul>
5
5
  <div id="tsd-search-status" aria-live="polite" aria-atomic="true">
@@ -14,7 +14,7 @@
14
14
  <div class="tsd-comment tsd-typography"><p>Everything a room's <code>'update'</code> event can carry.</p>
15
15
  </div><aside class="tsd-sources">
16
16
  <ul>
17
- <li>Defined in <a href="https://github.com/WilhiteSoftwareLLC/briyah/blob/1a8dc08591eb0354e3644da7a14d27b30625ced5/shared/types/app.types.ts#L311">shared/types/app.types.ts:311</a></li></ul></aside></div>
17
+ <li>Defined in <a href="https://github.com/WilhiteSoftwareLLC/briyah/blob/dfdc570ca693648160e8071102843097cd4c2cbc/shared/types/app.types.ts#L323">shared/types/app.types.ts:323</a></li></ul></aside></div>
18
18
  <div class="col-sidebar">
19
19
  <div class="page-menu">
20
20
  <div class="tsd-navigation settings">
@@ -29,7 +29,7 @@
29
29
  <div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div>
30
30
  <div class="site-menu">
31
31
  <nav id="tsd-sidebar-links" class="tsd-navigation"><a href="https://github.com/your-org/briyah" class="tsd-nav-link">GitHub</a><a href="https://www.npmjs.com/package/briyah" class="tsd-nav-link">npm</a></nav>
32
- <nav class="tsd-navigation"><a href="../modules.html">Briyah SDK - v2.0.1</a>
32
+ <nav class="tsd-navigation"><a href="../modules.html">Briyah SDK - v2.0.2</a>
33
33
  <ul class="tsd-small-nested-navigation" id="tsd-nav-container">
34
34
  <li>Loading...</li></ul></nav></div></div></div><footer>
35
35
  <p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer>
@@ -1,5 +1,5 @@
1
- <!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>RosterOverrides | Briyah SDK - v2.0.1</title><meta name="description" content="Documentation for Briyah SDK"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar">
2
- <div class="tsd-toolbar-contents container"><a href="../index.html" class="title">Briyah SDK - v2.0.1</a>
1
+ <!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>RosterOverrides | Briyah SDK - v2.0.2</title><meta name="description" content="Documentation for Briyah SDK"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar">
2
+ <div class="tsd-toolbar-contents container"><a href="../index.html" class="title">Briyah SDK - v2.0.2</a>
3
3
  <div id="tsd-toolbar-links"><a href="https://github.com/your-org/briyah">GitHub</a><a href="https://www.npmjs.com/package/briyah">npm</a></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/>
4
4
  <ul role="listbox" id="tsd-search-results"></ul>
5
5
  <div id="tsd-search-status" aria-live="polite" aria-atomic="true">
@@ -20,7 +20,7 @@ giving up the ordering and the rollback this service exists for — or renaming
20
20
  the agent afterwards, once it has already introduced itself.</p>
21
21
  </div><aside class="tsd-sources">
22
22
  <ul>
23
- <li>Defined in <a href="https://github.com/WilhiteSoftwareLLC/briyah/blob/1a8dc08591eb0354e3644da7a14d27b30625ced5/server/src/packs/pack-instantiation.service.ts#L60">server/src/packs/pack-instantiation.service.ts:60</a></li></ul></aside></div>
23
+ <li>Defined in <a href="https://github.com/WilhiteSoftwareLLC/briyah/blob/dfdc570ca693648160e8071102843097cd4c2cbc/server/src/packs/pack-instantiation.service.ts#L60">server/src/packs/pack-instantiation.service.ts:60</a></li></ul></aside></div>
24
24
  <div class="col-sidebar">
25
25
  <div class="page-menu">
26
26
  <div class="tsd-navigation settings">
@@ -35,7 +35,7 @@ the agent afterwards, once it has already introduced itself.</p>
35
35
  <div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div>
36
36
  <div class="site-menu">
37
37
  <nav id="tsd-sidebar-links" class="tsd-navigation"><a href="https://github.com/your-org/briyah" class="tsd-nav-link">GitHub</a><a href="https://www.npmjs.com/package/briyah" class="tsd-nav-link">npm</a></nav>
38
- <nav class="tsd-navigation"><a href="../modules.html">Briyah SDK - v2.0.1</a>
38
+ <nav class="tsd-navigation"><a href="../modules.html">Briyah SDK - v2.0.2</a>
39
39
  <ul class="tsd-small-nested-navigation" id="tsd-nav-container">
40
40
  <li>Loading...</li></ul></nav></div></div></div><footer>
41
41
  <p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer>
@@ -1,5 +1,5 @@
1
- <!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ToolContext | Briyah SDK - v2.0.1</title><meta name="description" content="Documentation for Briyah SDK"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar">
2
- <div class="tsd-toolbar-contents container"><a href="../index.html" class="title">Briyah SDK - v2.0.1</a>
1
+ <!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ToolContext | Briyah SDK - v2.0.2</title><meta name="description" content="Documentation for Briyah SDK"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar">
2
+ <div class="tsd-toolbar-contents container"><a href="../index.html" class="title">Briyah SDK - v2.0.2</a>
3
3
  <div id="tsd-toolbar-links"><a href="https://github.com/your-org/briyah">GitHub</a><a href="https://www.npmjs.com/package/briyah">npm</a></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/>
4
4
  <ul role="listbox" id="tsd-search-results"></ul>
5
5
  <div id="tsd-search-status" aria-live="polite" aria-atomic="true">
@@ -18,7 +18,7 @@ to trusted data the LLM cannot influence (e.g. a database handle and the
18
18
  record the user currently has selected).</p>
19
19
  </div><aside class="tsd-sources">
20
20
  <ul>
21
- <li>Defined in <a href="https://github.com/WilhiteSoftwareLLC/briyah/blob/1a8dc08591eb0354e3644da7a14d27b30625ced5/server/src/tools/native-tool.types.ts#L145">server/src/tools/native-tool.types.ts:145</a></li></ul></aside></div>
21
+ <li>Defined in <a href="https://github.com/WilhiteSoftwareLLC/briyah/blob/dfdc570ca693648160e8071102843097cd4c2cbc/server/src/tools/native-tool.types.ts#L177">server/src/tools/native-tool.types.ts:177</a></li></ul></aside></div>
22
22
  <div class="col-sidebar">
23
23
  <div class="page-menu">
24
24
  <div class="tsd-navigation settings">
@@ -33,7 +33,7 @@ record the user currently has selected).</p>
33
33
  <div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div>
34
34
  <div class="site-menu">
35
35
  <nav id="tsd-sidebar-links" class="tsd-navigation"><a href="https://github.com/your-org/briyah" class="tsd-nav-link">GitHub</a><a href="https://www.npmjs.com/package/briyah" class="tsd-nav-link">npm</a></nav>
36
- <nav class="tsd-navigation"><a href="../modules.html">Briyah SDK - v2.0.1</a>
36
+ <nav class="tsd-navigation"><a href="../modules.html">Briyah SDK - v2.0.2</a>
37
37
  <ul class="tsd-small-nested-navigation" id="tsd-nav-container">
38
38
  <li>Loading...</li></ul></nav></div></div></div><footer>
39
39
  <p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer>
@@ -1,5 +1,5 @@
1
- <!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ToolRunResult | Briyah SDK - v2.0.1</title><meta name="description" content="Documentation for Briyah SDK"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar">
2
- <div class="tsd-toolbar-contents container"><a href="../index.html" class="title">Briyah SDK - v2.0.1</a>
1
+ <!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ToolRunResult | Briyah SDK - v2.0.2</title><meta name="description" content="Documentation for Briyah SDK"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar">
2
+ <div class="tsd-toolbar-contents container"><a href="../index.html" class="title">Briyah SDK - v2.0.2</a>
3
3
  <div id="tsd-toolbar-links"><a href="https://github.com/your-org/briyah">GitHub</a><a href="https://www.npmjs.com/package/briyah">npm</a></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/>
4
4
  <ul role="listbox" id="tsd-search-results"></ul>
5
5
  <div id="tsd-search-status" aria-live="polite" aria-atomic="true">
@@ -12,7 +12,7 @@
12
12
  <h1>Type Alias ToolRunResult</h1></div>
13
13
  <div class="tsd-signature"><span class="tsd-kind-type-alias">ToolRunResult</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">ok</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">result</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span> <span class="tsd-signature-symbol">}</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">error</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">ok</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">false</span> <span class="tsd-signature-symbol">}</span></div><aside class="tsd-sources">
14
14
  <ul>
15
- <li>Defined in <a href="https://github.com/WilhiteSoftwareLLC/briyah/blob/1a8dc08591eb0354e3644da7a14d27b30625ced5/shared/types/app.types.ts#L151">shared/types/app.types.ts:151</a></li></ul></aside></div>
15
+ <li>Defined in <a href="https://github.com/WilhiteSoftwareLLC/briyah/blob/dfdc570ca693648160e8071102843097cd4c2cbc/shared/types/app.types.ts#L163">shared/types/app.types.ts:163</a></li></ul></aside></div>
16
16
  <div class="col-sidebar">
17
17
  <div class="page-menu">
18
18
  <div class="tsd-navigation settings">
@@ -27,7 +27,7 @@
27
27
  <div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div>
28
28
  <div class="site-menu">
29
29
  <nav id="tsd-sidebar-links" class="tsd-navigation"><a href="https://github.com/your-org/briyah" class="tsd-nav-link">GitHub</a><a href="https://www.npmjs.com/package/briyah" class="tsd-nav-link">npm</a></nav>
30
- <nav class="tsd-navigation"><a href="../modules.html">Briyah SDK - v2.0.1</a>
30
+ <nav class="tsd-navigation"><a href="../modules.html">Briyah SDK - v2.0.2</a>
31
31
  <ul class="tsd-small-nested-navigation" id="tsd-nav-container">
32
32
  <li>Loading...</li></ul></nav></div></div></div><footer>
33
33
  <p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "briyah",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Multi-agent AI SDK with interactive storytelling and D&D 5e support.",
5
5
  "private": false,
6
6
  "main": "dist-sdk/server/src/sdk/index.js",
@@ -1,20 +1,26 @@
1
1
  # The 5e pack
2
2
 
3
- Everything a Briyah room needs to run a fifth-edition tabletop game. There is no D&D
4
- feature in Briyah: a game is an ordinary room, assembled from agents, prompt folders,
5
- tool grants and a room leader. This directory holds the *code* — the dice and the
6
- arithmetic — and the rest of the pack's content sits in `server/data/packs/dnd5e/`:
3
+ Everything a Briyah room needs to run a fifth-edition tabletop game. A game is an
4
+ ordinary room, assembled from agents, prompt folders, tool grants and a room leader —
5
+ there is no D&D domain model, no room subclass, no message action. This directory holds
6
+ the *code* — the dice and the arithmetic — and the rest of the pack's content sits in
7
+ `server/data/packs/dnd5e/`:
7
8
 
8
9
  ```
9
10
  server/data/packs/dnd5e/
10
11
  ├── pack.json
11
12
  ├── prompts/ dungeon_master, dnd_player, character_creator,
12
13
  │ campaign_designer, battle_master, dnd_room_moderator
13
- ├── artifacts/ 16 documents: combat procedure, the planes, twelve classes
14
+ ├── artifacts/ 17 documents: combat procedure, the planes, twelve classes, one background
14
15
  ├── agents/ six agent templates
15
- └── rooms/ table.json — the whole table in one action
16
+ └── rooms/ table.json — the whole table in one action, one player seat
17
+ campaign.json — the crew and no seats, for a caller seating its own party
16
18
  ```
17
19
 
20
+ The **Briyah RPG** page (`server/src/rpg/`) is a convenience layer over `campaign.json`: it
21
+ builds one of these rooms, seats the party the user described and publishes it. It holds no
22
+ state — a campaign *is* the room — and nothing in this pack knows it exists. Keep it that way.
23
+
18
24
  The two `packs` directories are different things and it is worth keeping them
19
25
  straight: `server/src/tools/packs/dnd5e/` is this pack's tool code, compiled into the
20
26
  build; `server/data/packs/dnd5e/` is its content, which a user can override per-file.
@@ -30,9 +36,9 @@ otherwise show up mid-session as an agent that cannot roll.
30
36
 
31
37
  | Agent | Prompt folder | Tools it is granted |
32
38
  |---|---|---|
33
- | Dungeon Master | `dungeon_master` | all eighteen |
39
+ | Dungeon Master | `dungeon_master` | all twenty |
34
40
  | Player | `dnd_player` | none — see [Why players get no tools](#why-players-get-no-tools) |
35
- | Character creator | `character_creator` | `create_sheet`, `read_sheet`, `patch_sheet`, `level_up`, `roll_dice`, `rules_lookup`, `spell` |
41
+ | Character creator | `character_creator` | `class_guide`, `create_sheet`, `read_sheet`, `patch_sheet`, `level_up`, `roll_dice`, `rules_lookup`, `spell` |
36
42
  | Campaign designer | `campaign_designer` | `stat_block`, `magic_item`, `rules_lookup` |
37
43
  | Battle Master | `battle_master` | `roll_initiative`, `encounter`, `roll_dice`, `check`, `apply_hp`, `conditions`, `spend`, `read_sheet`, `stat_block`, `spell`, `magic_item`, `rules_lookup` |
38
44
 
@@ -88,7 +94,7 @@ Two invariants worth keeping:
88
94
  matters just as much: a fight is set up by placing and *then* rolling, so clearing everything
89
95
  would delete the combatants placed seconds earlier.
90
96
 
91
- This is additive. The DM still grants all eighteen tools, so a table with no Battle Master runs
97
+ This is additive. The DM still grants all twenty tools, so a table with no Battle Master runs
92
98
  exactly as it did before — but its procedure document no longer carries the combat rules, so
93
99
  attach `5e · battle_master — combat mechanics` to the DM as well if you run it that way.
94
100
 
@@ -112,45 +118,71 @@ result rather than on every cached call:
112
118
  | `stat_block` | 317 creatures |
113
119
  | `magic_item` | 239 magic items |
114
120
  | `spell` | 319 spells, and each class's list |
115
- | `rules_lookup` | Conditions, rules, tables, 37 weapons, armour, 9 races, the SRD feat, the SRD background, carrying capacity |
121
+ | `rules_lookup` | Conditions, rules, tables, 37 weapons, armour, 9 races, the SRD feat, the backgrounds the table has written up, carrying capacity |
116
122
 
117
123
  **The one real gap is class features by level.** The pack knows a class's hit die, saving
118
124
  throws, skill list, casting progression, subclass level and ASI levels — but not what Rage or
119
125
  Sneak Attack or Channel Divinity do. That, deeper combat procedure, and anything your table
120
126
  plays with from outside the SRD are what a rule document is still for.
121
127
 
122
- The pack ships sixteen documents distilled from the SRD for exactly those gaps, in
123
- `server/data/common/artifacts/dnd5e/` beside a `manifest.json`. **They need no upload**: they appear
128
+ The pack ships seventeen documents distilled from the SRD for exactly those gaps, in
129
+ `server/data/packs/dnd5e/artifacts/` beside a `manifest.json`. **They need no upload**: they appear
124
130
  on the Artifacts page as read-only artifacts whenever the pack is enabled, and the create-agent
125
131
  dialog pre-ticks the right one as soon as a prompt folder is selected.
126
132
 
127
- | Document | For |
128
- |---|---|
129
- | `dungeon_master-procedure.md` | The Dungeon Master — DCs, travel, light, objects, traps, resting, downtime |
130
- | `battle_master-combat.md` | The Battle Master — the round, actions, movement, attacks, damage rulings |
131
- | `character_creator-basics.md` | The character creator — what the tools answer, and languages |
132
- | `class-<name>.md` ×12 | Whoever needs that class: the creator building one, the agent playing one |
133
- | `campaign_designer-setting.md` | The campaign designer — the planes and the SRD pantheons |
133
+ | Document | For | How it gets there |
134
+ |---|---|---|
135
+ | `dungeon_master-procedure.md` | The Dungeon Master — DCs, travel, light, objects, traps, resting, downtime | Pre-ticked on the folder |
136
+ | `battle_master-combat.md` | The Battle Master — the round, actions, movement, attacks, damage rulings | Pre-ticked on the folder |
137
+ | `character_creator-basics.md` | The character creator — what the tools answer, and languages | Pre-ticked on the folder |
138
+ | `campaign_designer-setting.md` | The campaign designer — the planes and the SRD pantheons | Pre-ticked on the folder |
139
+ | `class-<name>.md` ×12 | The creator building that class, and the agent playing it | `class_guide`, during creation |
140
+ | `background-<name>.md` ×1 | The creator building that background, and the agent playing it | `rules_lookup` and `create_sheet`, during creation |
134
141
 
135
142
  The DC table and the vision rules are deliberately in **both** procedure documents. They are
136
143
  cheap, and each agent hits a wall without them: the Battle Master sets DCs for improvised actions
137
144
  and resolves a shove as a contest, and the Dungeon Master needs the same table out of combat.
138
145
 
139
- All twelve class documents are pre-ticked on the **character creator**, and nowhere else. It is
140
- handed players one at a time and cannot know in advance what any of them will pick, so the twelve
141
- travel together or the build is guessed: a played campaign whose creator carried none of them
142
- produced a fighter with neither Second Wind nor the fighting style he had chosen, and two casters
143
- with spell slots and no spells. That is ~11.4k tokens in the creator's cached prefix — on Haiku, for
144
- an agent used a few dozen times per campaign, against every sheet in the campaign being wrong.
145
-
146
- A **player's** class document is still ticked nowhere, because nobody knows the party when the
147
- agents are created. Tick the one class each player is actually playing.
148
-
149
- Attach any document to **exactly one** agent. `attachedArtifacts` is per-agent and each provider
150
- injects it as a `Document:` message into only that agent's requests, so the DM carries neither the
151
- creation chapters nor whatever the designer is reading. That is the reason these are separate agents
152
- rather than modes of the DM — and the reason class features are twelve files rather than one: a
153
- wizard player carries the wizard, not eleven classes it will never be.
146
+ ### Class and background documents attach themselves
147
+
148
+ The class documents are the one group nobody ticks, because the tick could never be in the right
149
+ place. A player's class is chosen *after* their agent exists, so at creation time there is nothing
150
+ to tick; and the creator, handed players one at a time, cannot know what any of them will pick. It
151
+ carried all twelve for a while — ~11.4k cached tokens for the two or three the party actually
152
+ played — and before that carried none, which produced a fighter with neither Second Wind nor the
153
+ fighting style he had chosen and two casters with spell slots and no spells.
154
+
155
+ So `class_guide` does it:
156
+
157
+ - **The files are the list of playable classes.** `class_guide` with `class: "list"` reads
158
+ `class-*.md` out of the pack's `artifacts/` directory, so a table adds a class by dropping in a
159
+ file — no manifest entry, no code, no re-tick. Removing one removes it from what a creator may
160
+ offer.
161
+ - **Reading is free of standing cost.** `class_guide` with a class name returns the document in a
162
+ tool result, which is what the creator wants while a player is still choosing between two
163
+ classes.
164
+ - **Sharing is one artifact per class.** Add `players` and the document becomes `Class: Wizard`,
165
+ viewable by the creator and the agents playing that class and nobody else. Cached rather than
166
+ transient, which is the right way round here: a class document never changes, so it is paid for
167
+ once and read free every turn after.
168
+ - **`create_sheet` shares it too**, for the sheet's owner, because that is the moment a class stops
169
+ being a choice and becomes a fact. A class the creator forgot to share still reaches its player,
170
+ and a multiclass character gets one document per class. A class the pack has no document for is
171
+ reported in `classesWithoutRules` rather than failing the sheet.
172
+
173
+ The result is that the creator ends up holding the classes being played rather than all twelve, and
174
+ each player holds their own — which is what the twelve separate files were always for.
175
+
176
+ **Backgrounds work the same way**, with `rules_lookup` in place of `class_guide` — it already
177
+ answered a background name and needed no new tool, no new grant and no extra prompt text. The one
178
+ difference is what the file has to carry: a class document is prose nothing computes from, so
179
+ handing it over is the whole job, while a background *would* be computed from if there were a table
180
+ to compute from. There is not, deliberately — see [Backgrounds](#backgrounds).
181
+
182
+ Everything else is attached to **exactly one** agent. `attachedArtifacts` is per-agent and each
183
+ provider injects it as a `Document:` message into only that agent's requests, so the DM carries
184
+ neither the creation chapters nor whatever the designer is reading. That is the reason these are
185
+ separate agents rather than modes of the DM.
154
186
 
155
187
  `docs/dnd5e-rule-documents/README.md` records what was left out of the distillation and why.
156
188
 
@@ -202,6 +234,12 @@ things do scale, and both are handled:
202
234
  which was meant, rather than silently picking the first. With a large table `"giant"` matches
203
235
  a dozen creatures, and a wrong monster in a real fight is worse than a failed lookup. An exact
204
236
  name still wins outright, so `"bandit"` resolves cleanly even though `"bandit captain"` exists.
237
+ - **Narrowing.** `filter` matches a creature's **kind and size as well as its name**, because
238
+ those are the terms a person narrows by — `"fey"`, `"undead"`, `"devil"`, `"huge"`. A name-only
239
+ filter answered "fey" with an empty list and a note that anything unlisted needs defining, which
240
+ reads as "this table has no fey creatures" rather than "ask a different way"; `magic_item`'s
241
+ filter had spanned name, type and rarity all along. A filtered listing now says so, so an empty
242
+ one is not read as absence.
205
243
  - **Result size.** `list` is capped at 60 names per source and reports totals plus a `truncated`
206
244
  flag, and takes a `filter`. A failed lookup returns at most eight near matches and a count,
207
245
  never the whole table. This matters because `truncateResult` replaces an over-16 KB result with
@@ -249,11 +287,13 @@ Tool proficiency is the one proficiency that is **stored** on the sheet, in `too
249
287
  than derived from the class and race the way weapon proficiency is. It has to be: most of it is
250
288
  *chosen*. A bard picks three instruments out of ten and a dwarf picks one artisan's tool out of
251
289
  three, and there is nothing to derive that from. So `create_sheet` takes the player's picks in
252
- `spec.tools`, adds what the class, race and background grant outright, and reports the choices
253
- still owed — a bard who named no instruments is told they owe three. A tool outside the table is
254
- accepted as written, since the SRD's own background customization rule invites inventing one.
290
+ `spec.tools`, adds what the class and race grant outright, and reports the choices still owed — a
291
+ bard who named no instruments is told they owe three. A background's tools arrive in `spec.tools`
292
+ too, since a background is a document rather than a table. A tool outside the table is accepted as
293
+ written, since the SRD's own background customization rule invites inventing one.
255
294
 
256
- The three sources share one *consumed* set, which is the part that is easy to break. Without it a
295
+ The two derived sources share one *consumed* set with the player's own picks, which is the part
296
+ that is easy to break. Without it a
257
297
  dwarf monk — offered an artisan's tool by each — has both choices settled by a single pick and
258
298
  quietly loses a proficiency. The race is applied before the class for the same reason: a race
259
299
  offers a shortlist and a class offers a whole category, so settling the narrow one first leaves
@@ -315,6 +355,19 @@ Applied **once**, at creation. The increases land in `abil`, which then holds th
315
355
  real scores — there is no separate base — so `recomputeDerived` reads the race for hit points and
316
356
  speed but never touches ability scores. That is what makes levelling up safe.
317
357
 
358
+ **Languages** are the one racial grant that arrives from two directions, and they follow the same
359
+ shape as tool proficiencies: stored rather than derived, because most of them are *chosen*. A race
360
+ carries the ones it speaks natively and, for a half-elf or a human, a count of extras the player
361
+ picks; a background grants more, and a background is a document rather than a table, so nothing
362
+ here can know how many. Both go in `spec.languages`, and what the race speaks is added on top.
363
+
364
+ The spec field is passed onto the sheet **before** `applyRace` runs, for the same reason
365
+ `spec.tools` is: it is what lets the race see a choice already covered and ask only for the
366
+ shortfall. `create_sheet` reports the finished list, which matters precisely because that
367
+ suppression makes a partial answer quiet — a half-elf acolyte owes three and the pack can only
368
+ count one of them, so the list is the check. Before the field existed there was nowhere for any of
369
+ them to go, and that character finished speaking only Common and Elvish.
370
+
318
371
  Three racial rules are genuinely derived rather than stored, so they stay right as a character
319
372
  changes:
320
373
 
@@ -406,30 +459,42 @@ Coin counts at fifty pieces to the pound.
406
459
 
407
460
  ## Backgrounds
408
461
 
409
- SRD 5.1 carries **one**: Acolyte. Same licence situation as the feats, and the same shape of
410
- answer — except that here the SRD hands over the extensibility itself. Its *Customizing a
411
- Background* rule says in as many words that you may replace the feature, choose any two skills,
412
- and choose any two tool proficiencies or languages. A table inventing "Sailor" is playing by the
413
- book, not houseruling.
414
-
415
- So `create_sheet` applies a background it knows — two skills, the equipment package, the coin, and
416
- a feature that shows on the sheet — and **accepts one it does not**, granting nothing and saying
417
- so, with the two skills and the gear coming from the spec as they always did. `rules_lookup`
418
- answers a background name, and `"backgrounds"` returns the customization rule itself.
419
-
420
- Two details that are rules rather than conveniences:
421
-
422
- - **A skill collision is a choice, not a silent skip.** "If a character would gain the same
423
- proficiency from two different sources, he or she can choose a different proficiency of the same
424
- kind instead" — so a cleric who already took Religion is *told* the background owes them another
425
- skill rather than having one picked for them.
426
- - **`backgroundEquipment: false`** skips the package and the coin, which is the SRD's own option
427
- for a character who spends coin on gear instead. The skills and the feature still apply.
462
+ **There is no background table.** A background is a `background-<name>.md` document in
463
+ `server/data/packs/dnd5e/artifacts/`, exactly like a class document, and a table adds one by
464
+ dropping in a file. The SRD's Acolyte ships as one of those files and is not special: nothing in
465
+ the code knows its name.
428
466
 
429
- The suggested traits, ideals, bonds and flaws are in the table because they are the answer to a
430
- player who says "I don't know what they're like" — the creator can read one out instead of
431
- inventing a personality on their behalf. Tool proficiencies are **reported, never stored**: the
432
- pack does not model tools, and a field implying it tracked them would be a lie.
467
+ That is not a shortcut — it is what the licence and the rules together point at. SRD 5.1 carries
468
+ **one** background, and the other twelve everybody actually plays are outside CC-BY-4.0 and must
469
+ not live in `data/`. Meanwhile the SRD hands over the extensibility itself: its *Customizing a
470
+ Background* rule says in as many words that you may replace the feature, choose any two skills,
471
+ and choose any two tool proficiencies or languages. So a table inventing "Sailor" is playing by
472
+ the book, and a one-entry table of grants only made the *licensed* background behave unlike every
473
+ background at a real table.
474
+
475
+ So:
476
+
477
+ - `rules_lookup` with `topic: "backgrounds"` returns the customization rule **and** the names the
478
+ table has written up. `rules_lookup` with a background's name returns its document — skills,
479
+ languages, equipment, feature, and the suggested traits, ideals, bonds and flaws a creator reads
480
+ out to a player who says "I don't know what they're like".
481
+ - **Nothing about a background is applied automatically.** The two skills go in `skills`, the
482
+ languages in `languages`, the gear in `equipment`, the coin in `coin`, and the tool proficiencies
483
+ in `tools` — read off the document by whoever is building the character, exactly as a class's
484
+ starting equipment always has been. `create_sheet` records the name and says so in
485
+ `background.stillToChoose` on every build, since a background whose skills were never passed
486
+ leaves no trace on the finished sheet.
487
+ - `create_sheet` **shares the document** with the character's owner as `Background: <name>`, the
488
+ same way it shares their class. A background nobody wrote up shares nothing and is not reported
489
+ as a problem: it is ordinary legal play.
490
+
491
+ The sheet render carries the background's **name** and not its prose, for the same reason it
492
+ carries racial trait names only: that block is in its owner's prompt on every turn, and the player
493
+ already holds the document. A background's feature is prose no field models — put it in `note` if
494
+ the table wants it on the sheet.
495
+
496
+ `BACKGROUNDS_RULE` in `data/backgrounds.ts` is all that is left in code, because a rule is not a
497
+ background.
433
498
 
434
499
  ## Feats
435
500
 
@@ -464,7 +529,9 @@ about advantage rather than a number. The structure is there for the feats a cam
464
529
  `Campaign`. The designer asks about tone, setting, what the player wants to spend time
465
530
  doing, lethality and anything to avoid — one question per message — then writes the world.
466
531
  2. The DM whispers the **character creator** one player's name at a time; the creator
467
- interviews that player and whispers back as each sheet lands.
532
+ interviews that player and whispers back as each sheet lands. Each class the party picks
533
+ arrives as a `Class: <Class>` artifact the creator and that player can read — nothing to
534
+ attach by hand, and nothing to remember before play.
468
535
  3. Play begins.
469
536
 
470
537
  Every handover is a whisper, so uninvited players are neither prompted nor told anything —
@@ -530,6 +597,11 @@ primary one runs the Dungeon Master, and the economy one runs everybody else —
530
597
  [Why combat is a separate agent](#why-combat-is-a-separate-agent) for why that split is the
531
598
  point.
532
599
 
600
+ If you only want to *play*, the **RPG page** does all of the above and publishes the room, and
601
+ enables this pack for you on the way — so a player never sees the Packs page. Come here instead
602
+ when you are working on the pack: the RPG page hides every choice, which is the wrong shape for
603
+ testing a prompt folder or a grant.
604
+
533
605
  Disabling the pack later hides its prompts, documents, tools, agents and rooms from your
534
606
  pages. It does not stop a room that already exists from working.
535
607
 
@@ -590,7 +662,9 @@ console loop that goes with this, and the by-hand version.
590
662
  | `conditions` | Conditions and exhaustion, returning the mechanical effects they impose |
591
663
  | `inventory` | Items, currency, transfers between characters, equipping armour |
592
664
  | `award_xp` | Awards experience and reports available level-ups without applying them |
665
+ | `award_coin` | Divides money across the whole party in one call |
593
666
  | `level_up` | Applies a level and recalculates everything downstream |
667
+ | `class_guide` | Lists the classes this table allows, and hands a class's rules to whoever plays it |
594
668
  | `create_sheet` | Builds a character sheet, computing everything the rules determine |
595
669
  | `read_sheet` | Reads a sheet or a one-line party summary, optionally narrowed to a section |
596
670
  | `patch_sheet` | Sets fields directly, validated — the escape hatch when no other tool fits |
@@ -616,10 +690,10 @@ Suggested grants:
616
690
 
617
691
  | Agent | Prompt folder | Tools |
618
692
  |---|---|---|
619
- | Dungeon Master | `dungeon_master` | all eighteen |
693
+ | Dungeon Master | `dungeon_master` | all twenty |
620
694
  | AI player | `dnd_player` | **none** — see below |
621
695
  | Human player | `dnd_player` | none |
622
- | Character creator | `character_creator` | `create_sheet`, `read_sheet`, `patch_sheet`, `level_up`, `roll_dice`, `rules_lookup`, `spell` |
696
+ | Character creator | `character_creator` | `class_guide`, `create_sheet`, `read_sheet`, `patch_sheet`, `level_up`, `roll_dice`, `rules_lookup`, `spell` |
623
697
  | Campaign designer | `campaign_designer` | `stat_block`, `magic_item`, `rules_lookup` |
624
698
 
625
699
  The designer writes the `Campaign` document with the `publish` action rather than a tool. Its two
@@ -646,8 +720,9 @@ That leaves rolling and state changes, and both belong to the DM:
646
720
 
647
721
  - **Rolling.** `runAgentTurn` lets an agent chain up to five private `EXECUTE`s and only its
648
722
  final audible message reaches the room. `MessageAction.TOOL` notices are visible to no
649
- agent at all (`canHear` returns false for them) and are filtered out of the room log
650
- unless `showThoughts` is on. So a player with dice could roll five times and report the
723
+ agent at all (`canHear` returns false for them) and are not rendered in the room log
724
+ unless the reader has turned on "Show Hidden Messages". So a player with dice could roll
725
+ five times and report the
651
726
  best, and no other agent — including the DM — could tell. One roller means one source of
652
727
  truth.
653
728
  - **State.** `spend` accepts a negative amount to *restore* a resource, so a player holding
@@ -671,9 +746,14 @@ decided and waits for `level_up`.
671
746
  | `Sheet: <Character>` | that character's agent | The full sheet |
672
747
  | `Party Status` | every agent | One line per character: level, hit points, armour class, conditions |
673
748
  | `Encounter` | every agent | The round and the initiative order, transient; no monster hit points |
749
+ | `Class: <Class>` | the character creator, and every agent playing that class | The class's proficiencies, equipment, features by level and resource counts |
674
750
  | `Campaign` | the Dungeon Master (and its author) | The world: factions, places, people, hooks |
675
751
  | `Bestiary` | its author only | Creature statistics particular to this campaign |
676
752
 
753
+ `Class: <Class>` is the one artifact that is written **once and then read forever**, so it is the
754
+ one where caching is straightforwardly right. Sheets, `Party Status` and `Encounter` are transient
755
+ because they change every round; a class document never changes at all.
756
+
677
757
  `Bestiary` is scoped to whoever wrote it because everything reads it through `stat_block`, so
678
758
  nobody needs it in a cached prompt — the same reasoning as the character sheets. You can still
679
759
  read and hand-edit it in the Artifacts tab.
@@ -770,6 +850,7 @@ engine/ pure logic, no room access
770
850
  sheet.ts the character sheet artifact: parse and render
771
851
  character.ts construction and the rules-aware mutations
772
852
  bestiary.ts the Bestiary artifact: parse, render, resolve creature lookups
853
+ guides.ts which classes and backgrounds the shipped files define, and where a shared one lives
773
854
  data/ SRD 5.1 tables and monsters, and the licence
774
855
  tools/ one file per group of tools; thin wrappers over the engine
775
856
  prompt-folders.spec.ts structural guards on the four prompt folders and their defaults
@@ -1,20 +0,0 @@
1
- import { BackgroundRules } from '../data/backgrounds';
2
- import type { SheetState } from './sheet';
3
- export interface BackgroundLookup {
4
- background?: BackgroundRules;
5
- ambiguous?: string[];
6
- }
7
- export declare function resetBackgroundIndex(): void;
8
- export declare function resolveBackground(name: string): BackgroundLookup;
9
- export declare function backgroundNames(): string[];
10
- export interface BackgroundApplication {
11
- background?: string;
12
- known: boolean;
13
- changes: string[];
14
- outstanding: string[];
15
- equipment: string[];
16
- coin: string[];
17
- }
18
- export declare function applyBackground(state: SheetState, withEquipment?: boolean, consumedTools?: Set<string>): BackgroundApplication;
19
- export declare function backgroundFeature(state: SheetState): BackgroundRules['feature'] | undefined;
20
- export declare function describeBackground(background: BackgroundRules): string;