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
@@ -0,0 +1,241 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MAX_FAITH_POINTS = exports.checkTool = void 0;
4
+ const coerce_1 = require("../../../shared/coerce");
5
+ const cards_1 = require("../data/cards");
6
+ const dice_1 = require("../engine/dice");
7
+ const challenge_1 = require("../engine/challenge");
8
+ const sheet_1 = require("../engine/sheet");
9
+ Object.defineProperty(exports, "MAX_FAITH_POINTS", { enumerable: true, get: function () { return sheet_1.MAX_FAITH_POINTS; } });
10
+ const shared_1 = require("./shared");
11
+ const FAITH_POINT_BONUS = 2;
12
+ exports.checkTool = {
13
+ name: 'roll_check',
14
+ description: 'Roll a d20 for a character against a difficulty class, adding their attribute. This is how every action in Acts Adventure is resolved. ' +
15
+ 'Give "dc" as a number, or "difficulty" as easy / normal / hard / very_hard (10 / 12 / 14 / 16). ' +
16
+ 'A player may declare ONE item card before rolling — pass its name in "item" and its bonus is added if it has one, or its text is returned for you to rule on if it does not. ' +
17
+ 'Set "spend_faith_point" to add +2 from a Faith Point; bonuses stack. ' +
18
+ 'To reroll a roll that already failed, call again with "reroll": true, which spends a Faith Point and rolls fresh — the rules allow this for ANY failed roll. ' +
19
+ 'Set "challenge": true when the roll is part of a running multi-roll scene (a sermon, a testimony, a trial, the storm), and the tally is kept for you. ' +
20
+ 'Example: {"character": "Miriam", "attribute": "faith", "dc": 11, "reason": "praying with the believers"}',
21
+ parameters: [
22
+ { name: 'character', type: 'string', description: 'The character rolling', required: true },
23
+ {
24
+ name: 'attribute',
25
+ type: 'string',
26
+ description: 'faith, compassion, knowledge, wisdom or courage',
27
+ required: true,
28
+ },
29
+ { name: 'dc', type: 'number', description: 'The difficulty class to meet or beat', required: false },
30
+ {
31
+ name: 'difficulty',
32
+ type: 'string',
33
+ description: 'easy, normal, hard or very_hard — used when no dc is given',
34
+ required: false,
35
+ },
36
+ { name: 'reason', type: 'string', description: 'What the roll is for', required: false },
37
+ {
38
+ name: 'item',
39
+ type: 'string',
40
+ description: 'One item card the player declares before rolling, by name or id',
41
+ required: false,
42
+ },
43
+ {
44
+ name: 'spend_faith_point',
45
+ type: 'boolean',
46
+ description: 'Spend a Faith Point for +2 on this roll',
47
+ required: false,
48
+ },
49
+ {
50
+ name: 'reroll',
51
+ type: 'boolean',
52
+ description: 'Spend a Faith Point to reroll a roll that just failed',
53
+ required: false,
54
+ },
55
+ {
56
+ name: 'challenge',
57
+ type: 'boolean',
58
+ description: 'Count this roll toward the running challenge',
59
+ required: false,
60
+ },
61
+ ],
62
+ async handler(args, helpers) {
63
+ const room = (0, shared_1.requireRoom)(helpers);
64
+ const characterName = (0, coerce_1.str)(args.character, 'character');
65
+ const attribute = readAttribute(args.attribute);
66
+ const reason = args.reason ? (0, coerce_1.str)(args.reason, 'reason') : undefined;
67
+ const spendPoint = (0, coerce_1.bool)(args.spend_faith_point) || (0, coerce_1.bool)(args.reroll);
68
+ const isReroll = (0, coerce_1.bool)(args.reroll);
69
+ const { state, notes } = (0, shared_1.loadSheet)(room, characterName);
70
+ const dc = readDc(args);
71
+ if (dc === undefined) {
72
+ throw new Error('No difficulty given. Pass "dc" as a number, or "difficulty" as easy, normal, hard or very_hard.');
73
+ }
74
+ if (spendPoint && state.fp < 1) {
75
+ return {
76
+ applied: false,
77
+ violation: 'no_faith_points',
78
+ message: `${state.name} has no Faith Points to spend.`,
79
+ rule: 'A player may spend a Faith Point to reroll a failed roll or to add +2. They hold at most 10 and must earn them through play.',
80
+ options: [
81
+ `Roll without it: roll_check with {"character": "${state.name}", "attribute": "${attribute}", "dc": ${dc}}`,
82
+ `Award one first if the moment deserves it: faith_points with {"character": "${state.name}", "action": "award", "amount": 1, "reason": "..."}`,
83
+ ],
84
+ };
85
+ }
86
+ const modifiers = [{ source: titleCase(attribute), value: state.attr[attribute] }];
87
+ let cardNote;
88
+ let heldCard;
89
+ if (args.item) {
90
+ const wanted = (0, coerce_1.str)(args.item, 'item');
91
+ const refusal = resolveCard(state.items, wanted, state.name);
92
+ if ('applied' in refusal)
93
+ return refusal;
94
+ heldCard = refusal.card;
95
+ if (heldCard.b) {
96
+ modifiers.push({ source: heldCard.n, value: heldCard.b.v });
97
+ if (heldCard.b.a !== attribute) {
98
+ cardNote =
99
+ `${heldCard.n} grants +${heldCard.b.v} ${titleCase(heldCard.b.a)} ${heldCard.b.w}, ` +
100
+ `but this is a ${titleCase(attribute)} roll. It was still applied — decide whether it should have been.`;
101
+ }
102
+ }
103
+ else {
104
+ cardNote =
105
+ `${heldCard.n} has no fixed bonus: "${heldCard.e}" — rule on what it does here rather than assuming a number.`;
106
+ }
107
+ }
108
+ if (spendPoint) {
109
+ modifiers.push({ source: 'Faith Point', value: FAITH_POINT_BONUS });
110
+ }
111
+ const result = (0, dice_1.rollCheck)(dc, modifiers);
112
+ let changed = false;
113
+ if (spendPoint) {
114
+ state.fp = Math.max(0, state.fp - 1);
115
+ changed = true;
116
+ }
117
+ if (heldCard?.lim) {
118
+ heldCard.sp = true;
119
+ changed = true;
120
+ }
121
+ if (changed)
122
+ (0, shared_1.saveSheet)(room, state, notes);
123
+ const challenge = (0, coerce_1.bool)(args.challenge) ? advanceChallenge(room, state.name, attribute, result) : undefined;
124
+ return {
125
+ character: state.name,
126
+ attribute,
127
+ reason,
128
+ roll: result.die,
129
+ modifiers: result.modifiers,
130
+ total: result.total,
131
+ dc: result.dc,
132
+ passed: result.passed,
133
+ natural20: result.natural20 || undefined,
134
+ natural1: result.natural1 || undefined,
135
+ summary: (0, dice_1.describeCheck)(result),
136
+ ...(isReroll ? { rerolled: true } : {}),
137
+ faithPointsRemaining: state.fp,
138
+ ...(cardNote ? { cardRuling: cardNote } : {}),
139
+ ...(heldCard?.lim ? { cardSpent: `${heldCard.n} is now used for this ${heldCard.lim}.` } : {}),
140
+ ...(challenge ? { challenge } : {}),
141
+ ...(!result.passed && !spendPoint && state.fp > 0
142
+ ? {
143
+ options: [
144
+ `${state.name} may spend a Faith Point to reroll: roll_check with ` +
145
+ `{"character": "${state.name}", "attribute": "${attribute}", "dc": ${dc}, "reroll": true}`,
146
+ ],
147
+ }
148
+ : {}),
149
+ ...(!result.passed
150
+ ? {
151
+ note: 'Failure never stops the story. Describe what happens next and keep going.',
152
+ }
153
+ : {}),
154
+ };
155
+ },
156
+ };
157
+ function resolveCard(items, wanted, characterName) {
158
+ const key = wanted.toLowerCase().replace(/[^a-z0-9]+/g, ' ').trim();
159
+ const card = items.find((item) => item.n.toLowerCase().replace(/[^a-z0-9]+/g, ' ').trim() === key ||
160
+ (item.id && item.id.toLowerCase() === wanted.toLowerCase().trim()));
161
+ if (!card) {
162
+ const shipped = (0, cards_1.findItemCard)(wanted);
163
+ return {
164
+ applied: false,
165
+ violation: 'card_not_held',
166
+ message: shipped
167
+ ? `${characterName} does not hold ${shipped.name}.`
168
+ : `${characterName} holds no card called "${wanted}".`,
169
+ rule: 'A player may only use an item card they have been given.',
170
+ options: [
171
+ items.length > 0
172
+ ? `Cards ${characterName} holds: ${items.map((item) => item.n).join(', ')}`
173
+ : `${characterName} holds no cards yet.`,
174
+ shipped
175
+ ? `Award it if the story has reached that moment: award with {"character": "${characterName}", "kind": "item", "card": "${shipped.name}"}`
176
+ : 'Roll without a card.',
177
+ ],
178
+ };
179
+ }
180
+ if (card.lim && card.sp) {
181
+ return {
182
+ applied: false,
183
+ violation: 'card_already_used',
184
+ message: `${card.n} has already been used this ${card.lim}.`,
185
+ rule: `${card.n} may be used once per ${card.lim}.`,
186
+ options: [
187
+ 'Roll without it.',
188
+ `A different card ${characterName} holds: ${items
189
+ .filter((item) => item !== card && !(item.lim && item.sp))
190
+ .map((item) => item.n)
191
+ .join(', ') || 'none available'}`,
192
+ ],
193
+ };
194
+ }
195
+ return { card };
196
+ }
197
+ function advanceChallenge(room, who, attribute, result) {
198
+ let summary;
199
+ room.update(challenge_1.CHALLENGE_ARTIFACT, (current) => {
200
+ const state = (0, challenge_1.parseChallenge)(current?.body);
201
+ if (!state)
202
+ return null;
203
+ if (state.outcome !== 'running') {
204
+ summary = { name: state.name, outcome: state.outcome, note: 'This challenge has already ended.' };
205
+ return null;
206
+ }
207
+ (0, challenge_1.recordRoll)(state, { who, attribute, total: result.total, passed: result.passed });
208
+ summary = {
209
+ name: state.name,
210
+ successes: state.successes,
211
+ failures: state.failures,
212
+ outcome: state.outcome,
213
+ remaining: (0, challenge_1.remaining)(state),
214
+ };
215
+ return (0, challenge_1.renderChallenge)(state);
216
+ }, { viewers: room.agentNicknames, transient: true });
217
+ return summary;
218
+ }
219
+ function readAttribute(value) {
220
+ const attribute = (0, coerce_1.str)(value, 'attribute').toLowerCase().trim();
221
+ if (!cards_1.ATTRIBUTES.includes(attribute)) {
222
+ throw new Error(`"${value}" is not an attribute. Use one of: ${cards_1.ATTRIBUTES.join(', ')}.`);
223
+ }
224
+ return attribute;
225
+ }
226
+ function readDc(args) {
227
+ if (args.dc !== undefined && args.dc !== null && args.dc !== '') {
228
+ return (0, coerce_1.int)(args.dc, 'dc');
229
+ }
230
+ if (args.difficulty) {
231
+ const dc = (0, dice_1.dcForBand)((0, coerce_1.str)(args.difficulty, 'difficulty'));
232
+ if (dc === undefined) {
233
+ throw new Error(`"${args.difficulty}" is not a difficulty band. Use easy (10), normal (12), hard (14) or very_hard (16), or give "dc" as a number.`);
234
+ }
235
+ return dc;
236
+ }
237
+ return undefined;
238
+ }
239
+ function titleCase(text) {
240
+ return text ? text[0].toUpperCase() + text.slice(1) : text;
241
+ }
@@ -0,0 +1,3 @@
1
+ import { NativeToolDefinition } from '../../../native-tool.types';
2
+ export declare const encounterTool: NativeToolDefinition;
3
+ export declare const rollDiceTool: NativeToolDefinition;
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rollDiceTool = exports.encounterTool = void 0;
4
+ const coerce_1 = require("../../../shared/coerce");
5
+ const encounters_1 = require("../data/encounters");
6
+ const dice_1 = require("../engine/dice");
7
+ exports.encounterTool = {
8
+ name: 'random_encounter',
9
+ description: 'Roll the DM Encounter Generator for a small unscripted moment: use it when the players travel somewhere new, ask an unexpected question, or the scene needs something to happen. ' +
10
+ 'Rolls 1d6 for a category and 1d6 for the event within it, and returns the attribute and DC to roll against. ' +
11
+ 'Pass "category" (1-6) to pick the kind yourself rather than rolling for it. ' +
12
+ 'Encounters should support the story of Acts, not distract from it.',
13
+ parameters: [
14
+ {
15
+ name: 'category',
16
+ type: 'number',
17
+ description: '1 Miracle Moment, 2 Crowd Encounter, 3 Persecution, 4 Teaching Opportunity, 5 Travel Event, 6 Divine Guidance. Omit to roll.',
18
+ required: false,
19
+ },
20
+ ],
21
+ async handler(args) {
22
+ const chosen = args.category === undefined || args.category === ''
23
+ ? (0, dice_1.rollDie)(6, dice_1.defaultRng)
24
+ : (0, coerce_1.int)(args.category, 'category');
25
+ const category = encounters_1.ENCOUNTER_CATEGORIES.find((entry) => entry.roll === chosen);
26
+ if (!category) {
27
+ throw new Error(`"${args.category}" is not a category. Use 1-6, or omit it to roll: ${encounters_1.ENCOUNTER_CATEGORIES.map((entry) => `${entry.roll} ${entry.name}`).join(', ')}.`);
28
+ }
29
+ const eventRoll = (0, dice_1.rollDie)(6, dice_1.defaultRng);
30
+ const discovery = (0, dice_1.rollDie)(6, dice_1.defaultRng);
31
+ return {
32
+ category: category.name,
33
+ categoryRoll: chosen,
34
+ eventRoll,
35
+ event: category.events[eventRoll - 1],
36
+ roll: `${category.attribute} DC ${category.dc}`,
37
+ attribute: category.attribute,
38
+ dc: category.dc,
39
+ onSuccess: category.success,
40
+ onFailure: category.failure,
41
+ itemDiscovery: discovery >= encounters_1.ITEM_DISCOVERY_THRESHOLD
42
+ ? `On a successful encounter the players may gain an item card (rolled ${discovery}). Award one with the award tool.`
43
+ : undefined,
44
+ note: `Describe "${category.events[eventRoll - 1]}", then ask for the roll with roll_check.`,
45
+ };
46
+ },
47
+ };
48
+ exports.rollDiceTool = {
49
+ name: 'roll_freehand',
50
+ description: 'Roll dice for something that is not a character check — a random table of your own, or a coin-flip decision. ' +
51
+ 'A character attempting something goes through roll_check instead, which reads their attribute off their sheet and compares the total to the DC. ' +
52
+ 'Example: {"sides": 6, "count": 1, "reason": "which road they take"}',
53
+ parameters: [
54
+ { name: 'sides', type: 'number', description: 'Faces on each die, normally 20 or 6', required: true },
55
+ { name: 'count', type: 'number', description: 'How many dice, at most 10', required: false },
56
+ { name: 'reason', type: 'string', description: 'What the roll is for', required: false },
57
+ ],
58
+ async handler(args) {
59
+ const sides = (0, coerce_1.int)(args.sides, 'sides');
60
+ const count = Math.max(1, Math.min(10, (0, coerce_1.int)(args.count ?? 1, 'count', 1)));
61
+ if (sides < 2 || sides > 100) {
62
+ throw new Error(`A die needs between 2 and 100 faces; "${args.sides}" is not usable.`);
63
+ }
64
+ const rolls = Array.from({ length: count }, () => (0, dice_1.rollDie)(sides, dice_1.defaultRng));
65
+ return {
66
+ reason: args.reason ? (0, coerce_1.str)(args.reason, 'reason') : undefined,
67
+ dice: `${count}d${sides}`,
68
+ rolls,
69
+ total: rolls.reduce((sum, roll) => sum + roll, 0),
70
+ };
71
+ },
72
+ };
@@ -0,0 +1,2 @@
1
+ import { NativeToolDefinition } from '../../../native-tool.types';
2
+ export declare const faithPointsTool: NativeToolDefinition;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.faithPointsTool = void 0;
4
+ const coerce_1 = require("../../../shared/coerce");
5
+ const sheet_1 = require("../engine/sheet");
6
+ const shared_1 = require("./shared");
7
+ exports.faithPointsTool = {
8
+ name: 'faith_points',
9
+ description: 'Award or spend a character\'s Faith Points. They hold at most 10. ' +
10
+ 'Award +1 for an ordinary act of faith, courage, compassion or obedience, and +2 for a major story moment; players should gain 2-5 per session. ' +
11
+ 'Spending is normally done through roll_check (a reroll or a +2), so use "spend" here only for an item ability or a story outcome. ' +
12
+ 'Example: {"character": "Miriam", "action": "award", "amount": 1, "reason": "she chose to pray instead of panic"}',
13
+ parameters: [
14
+ { name: 'character', type: 'string', description: 'The character', required: true },
15
+ { name: 'action', type: 'string', description: '"award" or "spend"', required: true },
16
+ { name: 'amount', type: 'number', description: 'How many points, normally 1 or 2', required: false },
17
+ {
18
+ name: 'reason',
19
+ type: 'string',
20
+ description: 'What earned or used the point — read aloud to the player',
21
+ required: true,
22
+ },
23
+ ],
24
+ async handler(args, helpers) {
25
+ const room = (0, shared_1.requireRoom)(helpers);
26
+ const action = (0, coerce_1.str)(args.action, 'action').toLowerCase().trim();
27
+ const reason = (0, coerce_1.str)(args.reason, 'reason').trim();
28
+ const amount = Math.abs((0, coerce_1.int)(args.amount ?? 1, 'amount', 1));
29
+ if (action !== 'award' && action !== 'spend') {
30
+ throw new Error(`"${args.action}" is not an action. Use "award" or "spend".`);
31
+ }
32
+ if (amount === 0) {
33
+ throw new Error('An award or spend of zero Faith Points does nothing.');
34
+ }
35
+ const { state, notes } = (0, shared_1.loadSheet)(room, (0, coerce_1.str)(args.character, 'character'));
36
+ const before = state.fp;
37
+ if (action === 'spend') {
38
+ if (before < amount) {
39
+ return {
40
+ applied: false,
41
+ violation: 'not_enough_faith_points',
42
+ message: `${state.name} has ${before} Faith Point${before === 1 ? '' : 's'} and cannot spend ${amount}.`,
43
+ rule: 'A player may only spend Faith Points they hold.',
44
+ options: [
45
+ before > 0 ? `Spend ${before} instead.` : 'Award one first if the moment deserves it.',
46
+ 'Continue without spending — failure never stops the story.',
47
+ ],
48
+ };
49
+ }
50
+ state.fp = before - amount;
51
+ }
52
+ else {
53
+ state.fp = Math.min(sheet_1.MAX_FAITH_POINTS, before + amount);
54
+ }
55
+ (0, shared_1.saveSheet)(room, state, notes);
56
+ const capped = action === 'award' && before + amount > sheet_1.MAX_FAITH_POINTS;
57
+ return {
58
+ applied: true,
59
+ character: state.name,
60
+ action,
61
+ amount: Math.abs(state.fp - before),
62
+ reason,
63
+ faithPoints: state.fp,
64
+ max: sheet_1.MAX_FAITH_POINTS,
65
+ ...(capped
66
+ ? {
67
+ note: `${state.name} is at the maximum of ${sheet_1.MAX_FAITH_POINTS}. Encourage them to spend some — the cap exists to stop hoarding.`,
68
+ }
69
+ : {}),
70
+ say: action === 'award'
71
+ ? `"${reason}. Gain ${Math.abs(state.fp - before)} Faith Point${Math.abs(state.fp - before) === 1 ? '' : 's'}."`
72
+ : undefined,
73
+ };
74
+ },
75
+ };
@@ -0,0 +1,20 @@
1
+ import { ToolHelpers, ToolRoomAccess } from '../../../native-tool.types';
2
+ import { ActsSheetState, SHEET_NAME_PREFIX } from '../engine/sheet';
3
+ export interface RefusalResult {
4
+ applied: false;
5
+ violation: string;
6
+ message: string;
7
+ rule: string;
8
+ options: string[];
9
+ }
10
+ export declare function requireRoom(helpers: ToolHelpers): ToolRoomAccess;
11
+ export declare function listCharacterNames(room: ToolRoomAccess): string[];
12
+ export interface LoadedSheet {
13
+ state: ActsSheetState;
14
+ artifactName: string;
15
+ notes: string;
16
+ }
17
+ export declare function loadSheet(room: ToolRoomAccess, wanted: string): LoadedSheet;
18
+ export declare function saveSheet(room: ToolRoomAccess, state: ActsSheetState, notes: string, owner?: string): void;
19
+ export declare function refreshPartyStatus(room: ToolRoomAccess): void;
20
+ export { SHEET_NAME_PREFIX };
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SHEET_NAME_PREFIX = void 0;
4
+ exports.requireRoom = requireRoom;
5
+ exports.listCharacterNames = listCharacterNames;
6
+ exports.loadSheet = loadSheet;
7
+ exports.saveSheet = saveSheet;
8
+ exports.refreshPartyStatus = refreshPartyStatus;
9
+ const coerce_1 = require("../../../shared/coerce");
10
+ const sheet_1 = require("../engine/sheet");
11
+ Object.defineProperty(exports, "SHEET_NAME_PREFIX", { enumerable: true, get: function () { return sheet_1.SHEET_NAME_PREFIX; } });
12
+ function requireRoom(helpers) {
13
+ if (!helpers?.room) {
14
+ throw new Error('This tool works on the artifacts of a room and there is no room here. Run it from a room rather than the tool tester.');
15
+ }
16
+ return helpers.room;
17
+ }
18
+ function listCharacterNames(room) {
19
+ return room
20
+ .list()
21
+ .filter(sheet_1.isSheetArtifact)
22
+ .map(sheet_1.characterNameFromArtifact)
23
+ .sort();
24
+ }
25
+ function loadSheet(room, wanted) {
26
+ const known = listCharacterNames(room);
27
+ const matched = (0, coerce_1.matchName)(wanted, known);
28
+ if (!matched) {
29
+ throw new Error(known.length > 0
30
+ ? `No character called "${wanted}". Characters in this room: ${known.join(', ')}.`
31
+ : `No character called "${wanted}", and no character sheets exist yet. The character guide builds one with create_character.`);
32
+ }
33
+ const artifactName = (0, sheet_1.sheetArtifactName)(matched);
34
+ const artifact = room.get(artifactName);
35
+ if (!artifact)
36
+ throw new Error(`The artifact "${artifactName}" disappeared while reading it.`);
37
+ return {
38
+ state: (0, sheet_1.parseSheet)(artifact.body),
39
+ artifactName,
40
+ notes: (0, sheet_1.extractNotes)(artifact.body),
41
+ };
42
+ }
43
+ function saveSheet(room, state, notes, owner) {
44
+ const artifactName = (0, sheet_1.sheetArtifactName)(state.name);
45
+ const existing = room.get(artifactName);
46
+ room.put(artifactName, (0, sheet_1.renderSheet)(state, notes), {
47
+ ...(owner && !existing ? { viewers: [owner], creator: owner } : {}),
48
+ transient: true,
49
+ });
50
+ refreshPartyStatus(room);
51
+ }
52
+ function refreshPartyStatus(room) {
53
+ const states = [];
54
+ for (const name of room.list()) {
55
+ if (!(0, sheet_1.isSheetArtifact)(name))
56
+ continue;
57
+ const artifact = room.get(name);
58
+ if (!artifact)
59
+ continue;
60
+ try {
61
+ states.push((0, sheet_1.parseSheet)(artifact.body));
62
+ }
63
+ catch {
64
+ }
65
+ }
66
+ room.update(sheet_1.PARTY_STATUS_ARTIFACT, () => (0, sheet_1.renderPartyStatus)(states), {
67
+ viewers: room.agentNicknames,
68
+ transient: true,
69
+ });
70
+ }
@@ -0,0 +1,4 @@
1
+ import { NativeToolDefinition } from '../../../native-tool.types';
2
+ export declare const createSheetTool: NativeToolDefinition;
3
+ export declare const readSheetTool: NativeToolDefinition;
4
+ export declare const patchSheetTool: NativeToolDefinition;