briyah 2.0.2 → 2.0.3

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 (225) hide show
  1. package/LICENSE +216 -0
  2. package/data/common/config/markup +1 -1
  3. package/data/packs/dnd5e/agents/player.json +11 -11
  4. package/data/packs/dnd5e/prompts/character_creator/defaults_config.json +21 -20
  5. package/data/packs/dnd5e/prompts/character_creator/perceive.prompt +19 -12
  6. package/data/packs/dnd5e/prompts/dnd_player/perceive.prompt +10 -6
  7. package/dist-sdk/server/src/app.service.d.ts +1 -0
  8. package/dist-sdk/server/src/app.service.js +26 -3
  9. package/dist-sdk/server/src/room/nickname.d.ts +1 -0
  10. package/dist-sdk/server/src/room/nickname.js +15 -0
  11. package/dist-sdk/server/src/room/room-store.service.d.ts +1 -0
  12. package/dist-sdk/server/src/room/room-store.service.js +4 -0
  13. package/dist-sdk/server/src/room/room.d.ts +28 -1
  14. package/dist-sdk/server/src/room/room.js +235 -12
  15. package/dist-sdk/server/src/rpg/rpg-roster.d.ts +1 -3
  16. package/dist-sdk/server/src/rpg/rpg-roster.js +12 -49
  17. package/dist-sdk/server/src/rpg/rpg.service.js +5 -5
  18. package/dist-sdk/server/src/sdk/index.d.ts +0 -1
  19. package/dist-sdk/server/src/sdk/index.js +1 -3
  20. package/dist-sdk/server/src/tools/core/index.d.ts +3 -0
  21. package/dist-sdk/server/src/tools/core/index.js +9 -0
  22. package/dist-sdk/server/src/tools/core/rename.tool.d.ts +2 -0
  23. package/dist-sdk/server/src/tools/core/rename.tool.js +61 -0
  24. package/dist-sdk/server/src/tools/native-tool.types.d.ts +10 -0
  25. package/dist-sdk/server/src/tools/packs/dnd5e/tools/sheet.tools.js +9 -1
  26. package/dist-sdk/server/src/tools/packs/index.d.ts +3 -2
  27. package/dist-sdk/server/src/tools/packs/index.js +17 -9
  28. package/dist-sdk/shared/types/app.types.d.ts +0 -1
  29. package/docs/assets/hierarchy.js +1 -1
  30. package/docs/assets/navigation.js +1 -1
  31. package/docs/assets/search.js +1 -1
  32. package/docs/classes/Agent.html +73 -73
  33. package/docs/classes/Briyah.html +16 -16
  34. package/docs/classes/BriyahConfigService.html +7 -7
  35. package/docs/classes/NativeToolRegistry.html +10 -10
  36. package/docs/classes/PackInstantiationService.html +7 -7
  37. package/docs/classes/PackService.html +13 -13
  38. package/docs/classes/Room.html +190 -94
  39. package/docs/classes/RoomMessage.html +22 -22
  40. package/docs/enums/MessageAction.html +18 -18
  41. package/docs/functions/availableToolPacks.html +5 -5
  42. package/docs/functions/buildMarkdown.html +4 -4
  43. package/docs/functions/dnd5eTools.html +4 -4
  44. package/docs/functions/installToolPacks.html +8 -5
  45. package/docs/functions/pageMarker.html +4 -4
  46. package/docs/functions/registerToolPacks.html +4 -4
  47. package/docs/functions/splitMarkdownIntoPages.html +4 -4
  48. package/docs/functions/stripWrappingFence.html +4 -4
  49. package/docs/hierarchy.html +11 -11
  50. package/docs/index.html +4 -4
  51. package/docs/interfaces/AgentCreationOptions.html +12 -12
  52. package/docs/interfaces/AgentInfo.html +30 -30
  53. package/docs/interfaces/AgentMessagesResponse.html +8 -8
  54. package/docs/interfaces/AppService.html +140 -137
  55. package/docs/interfaces/Artifact.html +9 -9
  56. package/docs/interfaces/ArtifactMetadata.html +13 -13
  57. package/docs/interfaces/ArtifactWriteOptions.html +7 -7
  58. package/docs/interfaces/AttachDocumentResponse.html +6 -6
  59. package/docs/interfaces/BriyahConfigOptions.html +12 -12
  60. package/docs/interfaces/ChapterInfo.html +6 -6
  61. package/docs/interfaces/Character.html +10 -10
  62. package/docs/interfaces/ConversionAgent.html +6 -6
  63. package/docs/interfaces/CreateAgentResponse.html +5 -5
  64. package/docs/interfaces/CreateRoomResponse.html +6 -6
  65. package/docs/interfaces/CreateStoryResponse.html +5 -5
  66. package/docs/interfaces/FileList.html +5 -5
  67. package/docs/interfaces/FileMetadata.html +10 -10
  68. package/docs/interfaces/IConfigService.html +5 -5
  69. package/docs/interfaces/InstantiateModels.html +6 -6
  70. package/docs/interfaces/InstantiateRoomResult.html +7 -7
  71. package/docs/interfaces/LoadedPack.html +16 -16
  72. package/docs/interfaces/LoggingOptions.html +9 -9
  73. package/docs/interfaces/Message.html +9 -9
  74. package/docs/interfaces/ModelChoice.html +7 -7
  75. package/docs/interfaces/ModelInfo.html +8 -8
  76. package/docs/interfaces/NativeToolDefinition.html +10 -10
  77. package/docs/interfaces/PackAgentTemplate.html +9 -9
  78. package/docs/interfaces/PackRoomTemplate.html +11 -11
  79. package/docs/interfaces/PackView.html +20 -20
  80. package/docs/interfaces/PdfConversionOptions.html +10 -10
  81. package/docs/interfaces/PdfConversionResult.html +10 -10
  82. package/docs/interfaces/PdfMarkdownOptions.html +21 -21
  83. package/docs/interfaces/PdfMarkdownResult.html +11 -11
  84. package/docs/interfaces/PdfPageMarkdown.html +9 -9
  85. package/docs/interfaces/PreparedPromptResponse.html +6 -6
  86. package/docs/interfaces/ProcessTextResponse.html +10 -10
  87. package/docs/interfaces/PromptFile.html +7 -7
  88. package/docs/interfaces/PromptFileContent.html +8 -8
  89. package/docs/interfaces/PromptFilesResponse.html +5 -5
  90. package/docs/interfaces/PromptFolder.html +8 -8
  91. package/docs/interfaces/PromptFolderDefaults.html +19 -19
  92. package/docs/interfaces/PromptFolderDefaultsResponse.html +7 -7
  93. package/docs/interfaces/PromptFoldersResponse.html +5 -5
  94. package/docs/interfaces/RoomDetails.html +19 -19
  95. package/docs/interfaces/RoomErrorUpdate.html +8 -8
  96. package/docs/interfaces/RoomInfo.html +10 -10
  97. package/docs/interfaces/RoomMessageUpdate.html +13 -13
  98. package/docs/interfaces/RoomMessagesResponse.html +6 -6
  99. package/docs/interfaces/SendMessageResult.html +6 -6
  100. package/docs/interfaces/StoryErrorEvent.html +8 -8
  101. package/docs/interfaces/StoryIdea.html +8 -8
  102. package/docs/interfaces/StoryInfo.html +28 -28
  103. package/docs/interfaces/StoryIntroduceCharacterEvent.html +7 -7
  104. package/docs/interfaces/StoryProgressChapterEvent.html +6 -6
  105. package/docs/interfaces/StoryState.html +12 -12
  106. package/docs/interfaces/StoryStateEvent.html +7 -7
  107. package/docs/interfaces/ToolArtifact.html +9 -9
  108. package/docs/interfaces/ToolCaller.html +7 -7
  109. package/docs/interfaces/ToolDefinition.html +9 -9
  110. package/docs/interfaces/ToolHelpers.html +7 -7
  111. package/docs/interfaces/ToolPackDocuments.html +6 -6
  112. package/docs/interfaces/ToolParameter.html +8 -8
  113. package/docs/interfaces/ToolRoomAccess.html +49 -16
  114. package/docs/interfaces/ToolSummary.html +8 -8
  115. package/docs/interfaces/ToolsResponse.html +7 -7
  116. package/docs/interfaces/Transaction.html +13 -13
  117. package/docs/interfaces/TransactionHistoryResponse.html +6 -6
  118. package/docs/modules.html +6 -6
  119. package/docs/types/PackOrigin.html +4 -4
  120. package/docs/types/PromptScope.html +4 -4
  121. package/docs/types/RoomTurnMode.html +4 -4
  122. package/docs/types/RoomUpdate.html +4 -4
  123. package/docs/types/RosterOverrides.html +4 -4
  124. package/docs/types/ToolContext.html +4 -4
  125. package/docs/types/ToolRunResult.html +4 -4
  126. package/package.json +32 -3
  127. package/data/packs/acts/agents/character-guide.json +0 -6
  128. package/data/packs/acts/agents/discipleship-mentor.json +0 -6
  129. package/data/packs/acts/agents/mentor-coach.json +0 -6
  130. package/data/packs/acts/agents/student.json +0 -13
  131. package/data/packs/acts/agents/table-moderator.json +0 -6
  132. package/data/packs/acts/artifacts/chapter-01-acts-1.md +0 -405
  133. package/data/packs/acts/artifacts/chapter-02-acts-2.md +0 -443
  134. package/data/packs/acts/artifacts/chapter-03-acts-3.md +0 -409
  135. package/data/packs/acts/artifacts/chapter-04-acts-4.md +0 -438
  136. package/data/packs/acts/artifacts/chapter-05-acts-5.md +0 -434
  137. package/data/packs/acts/artifacts/chapter-06-acts-6.md +0 -441
  138. package/data/packs/acts/artifacts/chapter-07-acts-7.md +0 -472
  139. package/data/packs/acts/artifacts/chapter-08-acts-8.md +0 -512
  140. package/data/packs/acts/artifacts/chapter-09-acts-9.md +0 -346
  141. package/data/packs/acts/artifacts/chapter-10-acts-10.md +0 -367
  142. package/data/packs/acts/artifacts/chapter-11-acts-11.md +0 -391
  143. package/data/packs/acts/artifacts/chapter-12-acts-12.md +0 -390
  144. package/data/packs/acts/artifacts/chapter-13-acts-13.md +0 -388
  145. package/data/packs/acts/artifacts/chapter-14-acts-14.md +0 -466
  146. package/data/packs/acts/artifacts/chapter-15-acts-15.md +0 -413
  147. package/data/packs/acts/artifacts/chapter-16-acts-16.md +0 -585
  148. package/data/packs/acts/artifacts/chapter-17-acts-17.md +0 -428
  149. package/data/packs/acts/artifacts/chapter-18-acts-18.md +0 -486
  150. package/data/packs/acts/artifacts/chapter-19-acts-19.md +0 -461
  151. package/data/packs/acts/artifacts/chapter-20-acts-20.md +0 -389
  152. package/data/packs/acts/artifacts/chapter-21-acts-21.md +0 -452
  153. package/data/packs/acts/artifacts/chapter-22-acts-22.md +0 -424
  154. package/data/packs/acts/artifacts/chapter-23-acts-23.md +0 -395
  155. package/data/packs/acts/artifacts/chapter-24-acts-24.md +0 -446
  156. package/data/packs/acts/artifacts/chapter-25-acts-25.md +0 -391
  157. package/data/packs/acts/artifacts/chapter-26-acts-26.md +0 -431
  158. package/data/packs/acts/artifacts/chapter-27-acts-27.md +0 -530
  159. package/data/packs/acts/artifacts/chapter-28-acts-28.md +0 -1871
  160. package/data/packs/acts/artifacts/chapters.manifest.json +0 -170
  161. package/data/packs/acts/artifacts/character_guide-creation.md +0 -112
  162. package/data/packs/acts/artifacts/discipleship_mentor-procedure.md +0 -154
  163. package/data/packs/acts/artifacts/discipleship_mentor-systems.md +0 -72
  164. package/data/packs/acts/artifacts/manifest.json +0 -197
  165. package/data/packs/acts/artifacts/stage-guide.md +0 -94
  166. package/data/packs/acts/pack.json +0 -6
  167. package/data/packs/acts/prompts/acts_player/defaults_config.json +0 -5
  168. package/data/packs/acts/prompts/acts_player/perceive.json +0 -29
  169. package/data/packs/acts/prompts/acts_player/perceive.prompt +0 -87
  170. package/data/packs/acts/prompts/acts_player/system_instruction.prompt +0 -0
  171. package/data/packs/acts/prompts/acts_room_moderator/defaults_config.json +0 -9
  172. package/data/packs/acts/prompts/acts_room_moderator/moderate.json +0 -34
  173. package/data/packs/acts/prompts/acts_room_moderator/moderate.prompt +0 -70
  174. package/data/packs/acts/prompts/acts_room_moderator/system_instruction.prompt +0 -0
  175. package/data/packs/acts/prompts/character_guide/defaults_config.json +0 -18
  176. package/data/packs/acts/prompts/character_guide/perceive.json +0 -29
  177. package/data/packs/acts/prompts/character_guide/perceive.prompt +0 -140
  178. package/data/packs/acts/prompts/character_guide/system_instruction.prompt +0 -0
  179. package/data/packs/acts/prompts/discipleship_mentor/defaults_config.json +0 -23
  180. package/data/packs/acts/prompts/discipleship_mentor/perceive.json +0 -33
  181. package/data/packs/acts/prompts/discipleship_mentor/perceive.prompt +0 -245
  182. package/data/packs/acts/prompts/discipleship_mentor/system_instruction.prompt +0 -0
  183. package/data/packs/acts/prompts/mentor_coach/defaults_config.json +0 -13
  184. package/data/packs/acts/prompts/mentor_coach/perceive.json +0 -29
  185. package/data/packs/acts/prompts/mentor_coach/perceive.prompt +0 -87
  186. package/data/packs/acts/prompts/mentor_coach/system_instruction.prompt +0 -0
  187. package/data/packs/acts/rooms/session.json +0 -14
  188. package/data/packs/acts/rooms/training.json +0 -58
  189. package/dist-sdk/server/src/tools/packs/acts/data/cards.d.ts +0 -53
  190. package/dist-sdk/server/src/tools/packs/acts/data/cards.js +0 -54
  191. package/dist-sdk/server/src/tools/packs/acts/data/character-cards.generated.d.ts +0 -2
  192. package/dist-sdk/server/src/tools/packs/acts/data/character-cards.generated.js +0 -185
  193. package/dist-sdk/server/src/tools/packs/acts/data/encounters.d.ts +0 -12
  194. package/dist-sdk/server/src/tools/packs/acts/data/encounters.js +0 -102
  195. package/dist-sdk/server/src/tools/packs/acts/data/event-cards.generated.d.ts +0 -2
  196. package/dist-sdk/server/src/tools/packs/acts/data/event-cards.generated.js +0 -196
  197. package/dist-sdk/server/src/tools/packs/acts/data/item-cards.generated.d.ts +0 -2
  198. package/dist-sdk/server/src/tools/packs/acts/data/item-cards.generated.js +0 -1311
  199. package/dist-sdk/server/src/tools/packs/acts/engine/cards.d.ts +0 -5
  200. package/dist-sdk/server/src/tools/packs/acts/engine/cards.js +0 -27
  201. package/dist-sdk/server/src/tools/packs/acts/engine/challenge.d.ts +0 -37
  202. package/dist-sdk/server/src/tools/packs/acts/engine/challenge.js +0 -120
  203. package/dist-sdk/server/src/tools/packs/acts/engine/dice.d.ts +0 -20
  204. package/dist-sdk/server/src/tools/packs/acts/engine/dice.js +0 -41
  205. package/dist-sdk/server/src/tools/packs/acts/engine/sheet.d.ts +0 -54
  206. package/dist-sdk/server/src/tools/packs/acts/engine/sheet.js +0 -200
  207. package/dist-sdk/server/src/tools/packs/acts/index.d.ts +0 -2
  208. package/dist-sdk/server/src/tools/packs/acts/index.js +0 -24
  209. package/dist-sdk/server/src/tools/packs/acts/tools/award.tool.d.ts +0 -2
  210. package/dist-sdk/server/src/tools/packs/acts/tools/award.tool.js +0 -184
  211. package/dist-sdk/server/src/tools/packs/acts/tools/challenge.tool.d.ts +0 -2
  212. package/dist-sdk/server/src/tools/packs/acts/tools/challenge.tool.js +0 -107
  213. package/dist-sdk/server/src/tools/packs/acts/tools/chapter.tool.d.ts +0 -3
  214. package/dist-sdk/server/src/tools/packs/acts/tools/chapter.tool.js +0 -146
  215. package/dist-sdk/server/src/tools/packs/acts/tools/check.tool.d.ts +0 -4
  216. package/dist-sdk/server/src/tools/packs/acts/tools/check.tool.js +0 -241
  217. package/dist-sdk/server/src/tools/packs/acts/tools/encounter.tool.d.ts +0 -3
  218. package/dist-sdk/server/src/tools/packs/acts/tools/encounter.tool.js +0 -72
  219. package/dist-sdk/server/src/tools/packs/acts/tools/faith.tool.d.ts +0 -2
  220. package/dist-sdk/server/src/tools/packs/acts/tools/faith.tool.js +0 -75
  221. package/dist-sdk/server/src/tools/packs/acts/tools/shared.d.ts +0 -20
  222. package/dist-sdk/server/src/tools/packs/acts/tools/shared.js +0 -70
  223. package/dist-sdk/server/src/tools/packs/acts/tools/sheet.tools.d.ts +0 -4
  224. package/dist-sdk/server/src/tools/packs/acts/tools/sheet.tools.js +0 -215
  225. package/docs/functions/actsTools.html +0 -44
@@ -1,215 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.patchSheetTool = exports.readSheetTool = exports.createSheetTool = void 0;
4
- const coerce_1 = require("../../../shared/coerce");
5
- const cards_1 = require("../data/cards");
6
- const sheet_1 = require("../engine/sheet");
7
- const shared_1 = require("./shared");
8
- const STARTING_ABILITY = {
9
- n: 'Faithful Witness',
10
- e: 'Once per session: reroll one failed Faith roll when sharing the Gospel.',
11
- lim: 'session',
12
- };
13
- exports.createSheetTool = {
14
- name: 'create_character',
15
- description: 'Build a character sheet for a player. "attributes" is a JSON object distributing exactly +3, +2, +2, +1, +1 across faith, compassion, knowledge, wisdom and courage — no other spread is legal. ' +
16
- 'Every character starts with the Faithful Witness ability, which is added for you. ' +
17
- 'Set "owner" to the nickname of the agent playing this character, so the sheet is theirs to read and their description is set from it. ' +
18
- 'Example: {"character": "Miriam", "background": "a widow of Joppa", "owner": "Miriam", "attributes": "{\\"faith\\":3,\\"compassion\\":2,\\"knowledge\\":2,\\"wisdom\\":1,\\"courage\\":1}"}',
19
- parameters: [
20
- { name: 'character', type: 'string', description: "The character's name", required: true },
21
- {
22
- name: 'background',
23
- type: 'string',
24
- description: 'Their role in the world of Acts, e.g. "a fisherman from Galilee"',
25
- required: true,
26
- },
27
- {
28
- name: 'attributes',
29
- type: 'string',
30
- description: 'JSON object of the five attributes; must use +3, +2, +2, +1, +1',
31
- required: true,
32
- },
33
- {
34
- name: 'owner',
35
- type: 'string',
36
- description: 'Nickname of the agent playing this character',
37
- required: false,
38
- },
39
- { name: 'player', type: 'string', description: 'The student behind the character', required: false },
40
- ],
41
- async handler(args, helpers) {
42
- const room = (0, shared_1.requireRoom)(helpers);
43
- const name = (0, coerce_1.str)(args.character, 'character').trim();
44
- const background = (0, coerce_1.str)(args.background, 'background').trim();
45
- const owner = args.owner ? (0, coerce_1.str)(args.owner, 'owner').trim() : undefined;
46
- if (room.get((0, sheet_1.sheetArtifactName)(name))) {
47
- throw new Error(`${name} already has a sheet. Rebuilding it would discard their items, Faith Points and notes — ` +
48
- 'use update_character to change something, or read_character to see what they have.');
49
- }
50
- const raw = (0, coerce_1.jsonObject)(args.attributes, 'attributes', '{"faith":3,"compassion":2,"knowledge":2,"wisdom":1,"courage":1}');
51
- const attr = (0, sheet_1.emptyAttributes)();
52
- for (const key of cards_1.ATTRIBUTES) {
53
- attr[key] = Math.trunc(Number(raw[key]) || 0);
54
- }
55
- const spread = cards_1.ATTRIBUTES.map((key) => attr[key]).sort((a, b) => b - a);
56
- if (spread.join(',') !== sheet_1.ATTRIBUTE_ARRAY.join(',')) {
57
- return {
58
- applied: false,
59
- violation: 'bad_attribute_spread',
60
- message: `Those scores are ${spread.join(', ')}. Session Zero distributes exactly +3, +2, +2, +1, +1.`,
61
- rule: 'Players distribute +3, +2, +2, +1, +1 among the five attributes.',
62
- options: [
63
- 'Ask the player which attribute their character is best at (that gets +3), which two they are good at (+2 each), and the remaining two take +1.',
64
- ],
65
- };
66
- }
67
- const state = {
68
- v: sheet_1.SHEET_STATE_VERSION,
69
- name,
70
- ...(args.player ? { player: (0, coerce_1.str)(args.player, 'player').trim() } : {}),
71
- background,
72
- attr,
73
- fp: 0,
74
- abilities: [{ ...STARTING_ABILITY }],
75
- items: [],
76
- events: [],
77
- allies: [],
78
- chapters: [],
79
- };
80
- (0, shared_1.saveSheet)(room, state, '', owner);
81
- let described = false;
82
- if (owner) {
83
- described = room.setDescription(owner, `${name} — ${background}`);
84
- }
85
- return {
86
- character: name,
87
- background,
88
- attributes: attr,
89
- abilities: state.abilities.map((ability) => ability.n),
90
- faithPoints: `0/${sheet_1.MAX_FAITH_POINTS}`,
91
- sheet: (0, sheet_1.sheetArtifactName)(name),
92
- ownerDescriptionSet: described || undefined,
93
- note: `${name} starts with Faithful Witness. Award Faith Points during play with faith_points, and items with award.` +
94
- (owner && !described
95
- ? ` No agent called "${owner}" is in this room, so no description was set.`
96
- : ''),
97
- };
98
- },
99
- };
100
- exports.readSheetTool = {
101
- name: 'read_character',
102
- description: 'Read a character sheet, or the whole party at a glance. Pass "character" as a name, or "party" for one line per character. ' +
103
- 'The Disciple Mentor is deliberately not a viewer of the sheets — read them here rather than carrying them.',
104
- parameters: [
105
- {
106
- name: 'character',
107
- type: 'string',
108
- description: 'A character name, or "party" for everyone',
109
- required: true,
110
- },
111
- ],
112
- async handler(args, helpers) {
113
- const room = (0, shared_1.requireRoom)(helpers);
114
- const wanted = (0, coerce_1.str)(args.character, 'character').trim();
115
- if (wanted.toLowerCase() === 'party' || wanted.toLowerCase() === 'all') {
116
- const names = (0, shared_1.listCharacterNames)(room);
117
- return {
118
- characters: names.length,
119
- party: names.map((name) => (0, sheet_1.partyLine)((0, shared_1.loadSheet)(room, name).state)),
120
- };
121
- }
122
- const { state } = (0, shared_1.loadSheet)(room, wanted);
123
- return {
124
- character: state.name,
125
- player: state.player,
126
- background: state.background,
127
- attributes: state.attr,
128
- faithPoints: state.fp,
129
- faithPointsMax: sheet_1.MAX_FAITH_POINTS,
130
- abilities: state.abilities,
131
- items: state.items,
132
- eventCards: state.events,
133
- characterCards: state.allies,
134
- chaptersPlayed: state.chapters,
135
- };
136
- },
137
- };
138
- exports.patchSheetTool = {
139
- name: 'update_character',
140
- description: 'Change a sheet directly when no other tool fits: record a chapter as played, add a hand-written ability, refresh once-per-session cards, or append a note. ' +
141
- 'Use faith_points for Faith Points and award for cards — this is the escape hatch, not the usual route. ' +
142
- 'Example: {"character": "Miriam", "chapter_played": 3, "new_session": true}',
143
- parameters: [
144
- { name: 'character', type: 'string', description: 'The character to change', required: true },
145
- {
146
- name: 'chapter_played',
147
- type: 'number',
148
- description: 'Record a chapter of Acts as completed',
149
- required: false,
150
- },
151
- {
152
- name: 'new_session',
153
- type: 'boolean',
154
- description: 'Refresh every once-per-session ability and card',
155
- required: false,
156
- },
157
- {
158
- name: 'ability',
159
- type: 'string',
160
- description: 'Add an ability as "Name: what it does"',
161
- required: false,
162
- },
163
- { name: 'background', type: 'string', description: 'Correct the character\'s role', required: false },
164
- { name: 'note', type: 'string', description: 'Append a line to their notes', required: false },
165
- ],
166
- async handler(args, helpers) {
167
- const room = (0, shared_1.requireRoom)(helpers);
168
- const { state, notes } = (0, shared_1.loadSheet)(room, (0, coerce_1.str)(args.character, 'character'));
169
- const changes = [];
170
- if (args.chapter_played !== undefined && args.chapter_played !== '') {
171
- const chapter = Math.trunc(Number(args.chapter_played));
172
- if (!Number.isInteger(chapter) || chapter < 1 || chapter > 28) {
173
- throw new Error(`"${args.chapter_played}" is not a chapter of Acts — the book has 28.`);
174
- }
175
- if (!state.chapters.includes(chapter)) {
176
- state.chapters = [...state.chapters, chapter].sort((a, b) => a - b);
177
- changes.push(`Acts ${chapter} recorded as played`);
178
- }
179
- }
180
- if (args.new_session) {
181
- let refreshed = 0;
182
- for (const entry of [...state.abilities, ...state.items]) {
183
- if (entry.lim === 'session' && entry.sp) {
184
- entry.sp = false;
185
- refreshed++;
186
- }
187
- }
188
- changes.push(`${refreshed} once-per-session ${refreshed === 1 ? 'card or ability' : 'cards and abilities'} refreshed`);
189
- }
190
- if (args.ability) {
191
- const raw = (0, coerce_1.str)(args.ability, 'ability');
192
- const [abilityName, ...rest] = raw.split(':');
193
- if (rest.length === 0) {
194
- throw new Error('Write an ability as "Name: what it does", e.g. "Bold Speech: +2 Courage before a crowd".');
195
- }
196
- state.abilities.push({ n: abilityName.trim(), e: rest.join(':').trim() });
197
- changes.push(`ability "${abilityName.trim()}" added`);
198
- }
199
- if (args.background) {
200
- state.background = (0, coerce_1.str)(args.background, 'background').trim();
201
- changes.push('background updated');
202
- }
203
- let newNotes = notes;
204
- if (args.note) {
205
- const note = (0, coerce_1.str)(args.note, 'note').trim();
206
- newNotes = notes ? `${notes}\n- ${note}` : `- ${note}`;
207
- changes.push('note appended');
208
- }
209
- if (changes.length === 0) {
210
- throw new Error('Nothing to change. Pass chapter_played, new_session, ability, background or note.');
211
- }
212
- (0, shared_1.saveSheet)(room, (0, sheet_1.normalizeState)(state), newNotes);
213
- return { character: state.name, changes, chaptersPlayed: state.chapters };
214
- },
215
- };
@@ -1,44 +0,0 @@
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>actsTools | 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
- <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
- <ul role="listbox" id="tsd-search-results"></ul>
5
- <div id="tsd-search-status" aria-live="polite" aria-atomic="true">
6
- <div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header>
7
- <div class="container container-main">
8
- <div class="col-content">
9
- <div class="tsd-page-title">
10
- <ul class="tsd-breadcrumb" aria-label="Breadcrumb">
11
- <li><a href="" aria-current="page">actsTools</a></li></ul>
12
- <h1>Function actsTools</h1></div>
13
- <section class="tsd-panel">
14
- <ul class="tsd-signatures">
15
- <li class="">
16
- <div class="tsd-signature tsd-anchor-link" id="actstools"><span class="tsd-kind-call-signature">actsTools</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/NativeToolDefinition.html" class="tsd-signature-type tsd-kind-interface">NativeToolDefinition</a><span class="tsd-signature-symbol">[]</span><a href="#actstools" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div>
17
- <div class="tsd-description">
18
- <div class="tsd-comment tsd-typography"><p>Every tool in the pack.</p>
19
- <p>Returned as a plain array rather than registered directly so it can be unit
20
- tested without a registry, and so an SDK host can register a subset.</p>
21
- </div>
22
- <h4 class="tsd-returns-title">Returns <a href="../interfaces/NativeToolDefinition.html" class="tsd-signature-type tsd-kind-interface">NativeToolDefinition</a><span class="tsd-signature-symbol">[]</span></h4><p>The tool definitions</p>
23
- <aside class="tsd-sources">
24
- <ul>
25
- <li>Defined in <a href="https://github.com/WilhiteSoftwareLLC/briyah/blob/dfdc570ca693648160e8071102843097cd4c2cbc/server/src/tools/packs/acts/index.ts#L30">server/src/tools/packs/acts/index.ts:30</a></li></ul></aside></div></li></ul></section></div>
26
- <div class="col-sidebar">
27
- <div class="page-menu">
28
- <div class="tsd-navigation settings">
29
- <details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>
30
- <h3>Settings</h3></summary>
31
- <div class="tsd-accordion-details">
32
- <div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span>
33
- <ul id="tsd-filter-options">
34
- <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li>
35
- <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li>
36
- <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div>
37
- <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>
38
- <div class="site-menu">
39
- <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>
40
- <nav class="tsd-navigation"><a href="../modules.html">Briyah SDK - v2.0.2</a>
41
- <ul class="tsd-small-nested-navigation" id="tsd-nav-container">
42
- <li>Loading...</li></ul></nav></div></div></div><footer>
43
- <p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer>
44
- <div class="overlay"></div></body></html>