briyah 1.3.5 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +689 -684
- package/data/common/artifacts/dnd5e/campaign_designer-setting.md +112 -0
- package/data/common/artifacts/dnd5e/character_creator-basics.md +40 -0
- package/data/common/artifacts/dnd5e/class-barbarian.md +64 -0
- package/data/common/artifacts/dnd5e/class-bard.md +63 -0
- package/data/common/artifacts/dnd5e/class-cleric.md +60 -0
- package/data/common/artifacts/dnd5e/class-druid.md +56 -0
- package/data/common/artifacts/dnd5e/class-fighter.md +53 -0
- package/data/common/artifacts/dnd5e/class-monk.md +77 -0
- package/data/common/artifacts/dnd5e/class-paladin.md +66 -0
- package/data/common/artifacts/dnd5e/class-ranger.md +73 -0
- package/data/common/artifacts/dnd5e/class-rogue.md +62 -0
- package/data/common/artifacts/dnd5e/class-sorcerer.md +67 -0
- package/data/common/artifacts/dnd5e/class-warlock.md +83 -0
- package/data/common/artifacts/dnd5e/class-wizard.md +51 -0
- package/data/common/artifacts/dnd5e/dungeon_master-procedure.md +348 -0
- package/data/common/artifacts/dnd5e/manifest.json +95 -0
- package/data/common/config/markup +1 -1
- package/data/common/config/model_prices.json +1250 -237
- package/data/common/prompts/campaign_designer/defaults_config.json +16 -0
- package/data/common/prompts/campaign_designer/perceive.json +29 -0
- package/data/common/prompts/campaign_designer/perceive.prompt +345 -0
- package/data/common/prompts/campaign_designer/system_instruction.prompt +0 -0
- package/data/common/prompts/character_creator/defaults_config.json +31 -0
- package/data/common/prompts/character_creator/perceive.json +29 -0
- package/data/common/prompts/character_creator/perceive.prompt +621 -0
- package/data/common/prompts/character_creator/system_instruction.prompt +0 -0
- package/data/common/prompts/dnd_player/defaults_config.json +5 -0
- package/data/common/prompts/dnd_player/perceive.json +29 -0
- package/data/common/prompts/dnd_player/perceive.prompt +312 -0
- package/data/common/prompts/dnd_player/system_instruction.prompt +0 -0
- package/data/common/prompts/dnd_room_moderator/defaults_config.json +9 -0
- package/data/common/prompts/dnd_room_moderator/moderate.json +34 -0
- package/data/common/prompts/dnd_room_moderator/moderate.prompt +291 -0
- package/data/common/prompts/dnd_room_moderator/system_instruction.prompt +0 -0
- package/data/common/prompts/dungeon_master/compact_agent.prompt +24 -0
- package/data/common/prompts/dungeon_master/defaults_config.json +29 -0
- package/data/common/prompts/dungeon_master/perceive.json +33 -0
- package/data/common/prompts/dungeon_master/perceive.prompt +757 -0
- package/data/common/prompts/dungeon_master/system_instruction.prompt +0 -0
- package/data/common/prompts/room_moderator/moderate.json +34 -29
- package/data/common/prompts/room_moderator/moderate.prompt +230 -210
- package/data/common/prompts/story_moderator/moderate.prompt +5 -2
- package/data/common/prompts/story_moderator/moderate_to_alice.mock +6 -6
- package/data/common/prompts/story_moderator/moderate_to_bob.mock +6 -6
- package/dist-sdk/server/src/ai/LLM/anthropic.service.d.ts +2 -0
- package/dist-sdk/server/src/ai/LLM/anthropic.service.js +34 -22
- package/dist-sdk/server/src/ai/LLM/base-ai.service.d.ts +1 -0
- package/dist-sdk/server/src/ai/LLM/base-ai.service.js +4 -1
- package/dist-sdk/server/src/ai/agent-config.d.ts +1 -0
- package/dist-sdk/server/src/ai/agent-store.service.js +6 -4
- package/dist-sdk/server/src/ai/agent.d.ts +7 -0
- package/dist-sdk/server/src/ai/agent.js +33 -2
- package/dist-sdk/server/src/ai/artifact.service.d.ts +2 -0
- package/dist-sdk/server/src/ai/artifact.service.js +29 -1
- package/dist-sdk/server/src/ai/pack-artifacts.d.ts +7 -0
- package/dist-sdk/server/src/ai/pack-artifacts.js +155 -0
- package/dist-sdk/server/src/app/stripe.controller.js +5 -0
- package/dist-sdk/server/src/app.controller.d.ts +18 -18
- package/dist-sdk/server/src/app.controller.js +249 -25
- package/dist-sdk/server/src/app.service.d.ts +30 -17
- package/dist-sdk/server/src/app.service.js +303 -35
- package/dist-sdk/server/src/auth/auth.controller.js +3 -2
- package/dist-sdk/server/src/auth/owner-only.decorator.d.ts +1 -0
- package/dist-sdk/server/src/auth/owner-only.decorator.js +8 -0
- package/dist-sdk/server/src/auth/twilio.service.d.ts +5 -1
- package/dist-sdk/server/src/auth/twilio.service.js +5 -3
- package/dist-sdk/server/src/config/user-paths.service.d.ts +2 -0
- package/dist-sdk/server/src/config/user-paths.service.js +8 -0
- package/dist-sdk/server/src/room/artifact-store.service.js +10 -2
- package/dist-sdk/server/src/room/artifact.d.ts +1 -0
- package/dist-sdk/server/src/room/message.d.ts +2 -1
- package/dist-sdk/server/src/room/message.js +5 -4
- package/dist-sdk/server/src/room/room-config.d.ts +3 -0
- package/dist-sdk/server/src/room/room-store.service.d.ts +4 -2
- package/dist-sdk/server/src/room/room-store.service.js +46 -12
- package/dist-sdk/server/src/room/room.d.ts +29 -3
- package/dist-sdk/server/src/room/room.js +390 -122
- package/dist-sdk/server/src/sdk/briyah.js +12 -0
- package/dist-sdk/server/src/sdk/index.d.ts +4 -1
- package/dist-sdk/server/src/sdk/index.js +9 -1
- package/dist-sdk/server/src/story/story.service.js +10 -12
- package/dist-sdk/server/src/tools/native-tool.types.d.ts +31 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/backgrounds.d.ts +22 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/backgrounds.js +59 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/feats.d.ts +24 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/feats.js +11 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/gear.d.ts +5 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/gear.generated.d.ts +1 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/gear.generated.js +154 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/gear.js +9 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/magic-items.d.ts +20 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/magic-items.generated.d.ts +2 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/magic-items.generated.js +1824 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/magic-items.js +6 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/monsters.d.ts +44 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/monsters.generated.d.ts +2 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/monsters.generated.js +17293 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/monsters.js +5 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/races.d.ts +41 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/races.js +250 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/spells.d.ts +16 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/spells.generated.d.ts +2 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/spells.generated.js +3760 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/spells.js +12 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/srd.d.ts +63 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/srd.js +449 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/weapons.d.ts +23 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/data/weapons.js +88 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/backgrounds.d.ts +20 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/backgrounds.js +109 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/bestiary.d.ts +30 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/bestiary.js +329 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/campaign-items.d.ts +9 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/campaign-items.js +100 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/character.d.ts +117 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/character.js +1057 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/coerce.d.ts +13 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/coerce.js +147 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/dice.d.ts +27 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/dice.js +263 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/encumbrance.d.ts +26 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/encumbrance.js +129 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/feats.d.ts +22 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/feats.js +127 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/items.d.ts +33 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/items.js +137 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/races.d.ts +26 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/races.js +182 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/rules.d.ts +48 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/rules.js +344 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/sheet.d.ts +98 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/sheet.js +456 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/spells.d.ts +27 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/spells.js +123 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/weapons.d.ts +23 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/engine/weapons.js +201 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/index.d.ts +3 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/index.js +35 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/check.tool.d.ts +2 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/check.tool.js +323 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/dice.tools.d.ts +3 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/dice.tools.js +117 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/item.tool.d.ts +2 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/item.tool.js +122 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/monster.tool.d.ts +2 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/monster.tool.js +157 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/shared.d.ts +32 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/shared.js +203 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/sheet.tools.d.ts +4 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/sheet.tools.js +465 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/spell.tool.d.ts +2 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/spell.tool.js +116 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/state.tools.d.ts +4 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/state.tools.js +234 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/world.tools.d.ts +6 -0
- package/dist-sdk/server/src/tools/packs/dnd5e/tools/world.tools.js +616 -0
- package/dist-sdk/server/src/tools/packs/index.d.ts +7 -0
- package/dist-sdk/server/src/tools/packs/index.js +45 -0
- package/dist-sdk/server/src/tools/tool-execution.service.d.ts +2 -2
- package/dist-sdk/server/src/tools/tool-execution.service.js +7 -6
- package/dist-sdk/shared/types/app.types.d.ts +63 -0
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/Agent.html +51 -15
- package/docs/classes/Briyah.html +14 -14
- package/docs/classes/BriyahConfigService.html +5 -5
- package/docs/classes/NativeToolRegistry.html +21 -0
- package/docs/classes/Room.html +79 -29
- package/docs/classes/RoomMessage.html +32 -15
- package/docs/enums/MessageAction.html +3 -3
- package/docs/functions/availableToolPacks.html +2 -0
- package/docs/functions/dnd5eTools.html +5 -0
- package/docs/functions/enabledToolPacks.html +2 -0
- package/docs/functions/registerToolPacks.html +6 -0
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +3 -3
- package/docs/interfaces/AgentInfo.html +17 -2
- package/docs/interfaces/AgentMessagesResponse.html +2 -2
- package/docs/interfaces/AppService.html +230 -181
- package/docs/interfaces/Artifact.html +15 -3
- package/docs/interfaces/ArtifactMetadata.html +5 -2
- package/docs/interfaces/ArtifactWriteOptions.html +21 -0
- package/docs/interfaces/AttachDocumentResponse.html +2 -2
- package/docs/interfaces/BriyahConfigOptions.html +9 -9
- package/docs/interfaces/ChapterInfo.html +2 -2
- package/docs/interfaces/Character.html +2 -2
- package/docs/interfaces/CreateAgentResponse.html +2 -2
- package/docs/interfaces/CreateRoomResponse.html +2 -2
- package/docs/interfaces/CreateStoryResponse.html +2 -2
- package/docs/interfaces/FileList.html +2 -2
- package/docs/interfaces/FileMetadata.html +3 -3
- package/docs/interfaces/IConfigService.html +3 -3
- package/docs/interfaces/LoggingOptions.html +6 -6
- package/docs/interfaces/Message.html +2 -2
- package/docs/interfaces/ModelInfo.html +2 -2
- package/docs/interfaces/NativeToolDefinition.html +11 -7
- package/docs/interfaces/PreparedPromptResponse.html +2 -2
- package/docs/interfaces/ProcessTextResponse.html +2 -2
- package/docs/interfaces/PromptFile.html +2 -2
- package/docs/interfaces/PromptFileContent.html +2 -2
- package/docs/interfaces/PromptFilesResponse.html +2 -2
- package/docs/interfaces/PromptFolder.html +2 -2
- package/docs/interfaces/PromptFoldersResponse.html +2 -2
- package/docs/interfaces/RoomDetails.html +15 -2
- package/docs/interfaces/RoomInfo.html +3 -2
- package/docs/interfaces/RoomMessageUpdate.html +2 -2
- package/docs/interfaces/RoomMessagesResponse.html +2 -2
- package/docs/interfaces/SendMessageResult.html +2 -2
- package/docs/interfaces/StoryErrorEvent.html +3 -3
- package/docs/interfaces/StoryIdea.html +2 -2
- package/docs/interfaces/StoryInfo.html +3 -3
- package/docs/interfaces/StoryIntroduceCharacterEvent.html +3 -3
- package/docs/interfaces/StoryProgressChapterEvent.html +3 -3
- package/docs/interfaces/StoryState.html +5 -5
- package/docs/interfaces/StoryStateEvent.html +3 -3
- package/docs/interfaces/ToolArtifact.html +8 -0
- package/docs/interfaces/ToolCaller.html +8 -0
- package/docs/interfaces/ToolDefinition.html +2 -2
- package/docs/interfaces/ToolHelpers.html +7 -3
- package/docs/interfaces/ToolParameter.html +2 -2
- package/docs/interfaces/ToolRoomAccess.html +51 -0
- package/docs/interfaces/ToolSummary.html +3 -2
- package/docs/interfaces/ToolsResponse.html +2 -2
- package/docs/interfaces/Transaction.html +2 -2
- package/docs/interfaces/TransactionHistoryResponse.html +2 -2
- package/docs/modules.html +1 -1
- package/docs/types/PromptScope.html +1 -1
- package/docs/types/ToolContext.html +2 -2
- package/docs/types/ToolRunResult.html +1 -1
- package/package.json +6 -4
- package/dist-sdk/server/src/ai/LLM/base-ai.service.spec.d.ts +0 -1
- package/dist-sdk/server/src/ai/LLM/base-ai.service.spec.js +0 -89
- package/dist-sdk/server/src/ai/LLM/comfyui-client.spec.d.ts +0 -1
- package/dist-sdk/server/src/ai/LLM/comfyui-client.spec.js +0 -143
- package/dist-sdk/server/src/ai/LLM/comfyui-workflow.spec.d.ts +0 -1
- package/dist-sdk/server/src/ai/LLM/comfyui-workflow.spec.js +0 -207
|
@@ -44,6 +44,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
44
44
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
45
45
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
46
46
|
};
|
|
47
|
+
var AppController_1;
|
|
47
48
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
49
|
exports.AppController = void 0;
|
|
49
50
|
const common_1 = require("@nestjs/common");
|
|
@@ -53,6 +54,7 @@ const jwt_auth_guard_1 = require("./auth/jwt-auth.guard");
|
|
|
53
54
|
const public_decorator_1 = require("./auth/public.decorator");
|
|
54
55
|
const agent_access_decorator_1 = require("./auth/agent-access.decorator");
|
|
55
56
|
const room_access_decorator_1 = require("./auth/room-access.decorator");
|
|
57
|
+
const owner_only_decorator_1 = require("./auth/owner-only.decorator");
|
|
56
58
|
const user_service_manager_1 = require("./app/user-service-manager");
|
|
57
59
|
const published_agents_service_1 = require("./ai/published-agents.service");
|
|
58
60
|
const published_rooms_service_1 = require("./room/published-rooms.service");
|
|
@@ -60,7 +62,7 @@ const library_service_1 = require("./library/library.service");
|
|
|
60
62
|
const errors_1 = require("./common/errors");
|
|
61
63
|
const path = __importStar(require("path"));
|
|
62
64
|
const logger_1 = require("./common/logger");
|
|
63
|
-
let AppController = class AppController {
|
|
65
|
+
let AppController = AppController_1 = class AppController {
|
|
64
66
|
userServiceManager;
|
|
65
67
|
publishedAgentsService;
|
|
66
68
|
publishedRoomsService;
|
|
@@ -159,7 +161,15 @@ let AppController = class AppController {
|
|
|
159
161
|
throw new common_1.BadRequestException('Agent name too long');
|
|
160
162
|
}
|
|
161
163
|
const appService = this.getAppService(req);
|
|
162
|
-
const agent = appService.createAgent(body.aiServiceName, body.agentName, body.agentNickname, body.description, body.aiModel, body.promptName, body.controlledByHuman, body.reasoningEffort, body.maxOutputTokens, body.beginInstruction
|
|
164
|
+
const agent = appService.createAgent(body.aiServiceName, body.agentName, body.agentNickname, body.description, body.aiModel, body.promptName, body.controlledByHuman, body.reasoningEffort, body.maxOutputTokens, body.beginInstruction, {
|
|
165
|
+
allowSearch: body.allowSearch,
|
|
166
|
+
toolNames: body.toolNames,
|
|
167
|
+
useModerator: body.useModerator,
|
|
168
|
+
privateContext: body.privateContext,
|
|
169
|
+
promptCacheTTL: body.promptCacheTTL,
|
|
170
|
+
maxHistoryMessages: body.maxHistoryMessages || undefined,
|
|
171
|
+
smallModelName: body.smallModelName || undefined,
|
|
172
|
+
});
|
|
163
173
|
if (!agent) {
|
|
164
174
|
throw new common_1.HttpException('Failed to create agent', common_1.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
165
175
|
}
|
|
@@ -295,6 +305,16 @@ let AppController = class AppController {
|
|
|
295
305
|
return { files: [] };
|
|
296
306
|
}
|
|
297
307
|
}
|
|
308
|
+
getPromptFolderDefaults(req, folderName) {
|
|
309
|
+
try {
|
|
310
|
+
const appService = this.getAppService(req);
|
|
311
|
+
return appService.getPromptFolderDefaults(folderName);
|
|
312
|
+
}
|
|
313
|
+
catch (error) {
|
|
314
|
+
logger_1.logger.error(`[${req.user?.sub}] Error reading defaults for prompt folder ${folderName}:`, error);
|
|
315
|
+
return { defaults: {} };
|
|
316
|
+
}
|
|
317
|
+
}
|
|
298
318
|
async getPromptFile(req, folderName, fileName) {
|
|
299
319
|
try {
|
|
300
320
|
const appService = this.getAppService(req);
|
|
@@ -578,58 +598,112 @@ let AppController = class AppController {
|
|
|
578
598
|
throw new common_1.HttpException('Failed to run prepared prompt', common_1.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
579
599
|
}
|
|
580
600
|
}
|
|
581
|
-
async listAgents(req, published) {
|
|
601
|
+
async listAgents(req, published, includeRoomAgents) {
|
|
582
602
|
try {
|
|
583
603
|
const appService = this.getAppService(req);
|
|
584
604
|
if (published === 'true') {
|
|
585
605
|
return await appService.listPublishedAgents();
|
|
586
606
|
}
|
|
587
|
-
return await appService.listAgents();
|
|
607
|
+
return await appService.listAgents(includeRoomAgents === 'true');
|
|
588
608
|
}
|
|
589
609
|
catch (error) {
|
|
590
610
|
logger_1.logger.error(`[${req.user?.sub}] Error listing agents:`, error);
|
|
591
611
|
return [];
|
|
592
612
|
}
|
|
593
613
|
}
|
|
614
|
+
static parseTurnMode(value) {
|
|
615
|
+
if (value === undefined)
|
|
616
|
+
return undefined;
|
|
617
|
+
if (value !== 'broadcast' && value !== 'directed') {
|
|
618
|
+
throw new common_1.BadRequestException(`turnMode must be 'broadcast' or 'directed'`);
|
|
619
|
+
}
|
|
620
|
+
return value;
|
|
621
|
+
}
|
|
594
622
|
async createRoom(req, body) {
|
|
595
623
|
if (!body.roomName) {
|
|
596
624
|
throw new common_1.BadRequestException('Room name is required');
|
|
597
625
|
}
|
|
598
|
-
if (!body.agentIds || body.agentIds.length === 0) {
|
|
599
|
-
throw new common_1.BadRequestException('At least one agent ID is required');
|
|
600
|
-
}
|
|
601
626
|
if (!body.roomName?.trim()) {
|
|
602
627
|
throw new common_1.BadRequestException('Room name cannot be empty');
|
|
603
628
|
}
|
|
604
629
|
if (body.roomName.length > 200) {
|
|
605
630
|
throw new common_1.BadRequestException('Room name too long');
|
|
606
631
|
}
|
|
632
|
+
const turnMode = AppController_1.parseTurnMode(body.turnMode);
|
|
607
633
|
try {
|
|
608
634
|
const appService = this.getAppService(req);
|
|
609
|
-
return await appService.createRoom(body.roomName, body.roomGoal, body.agentIds);
|
|
635
|
+
return await appService.createRoom(body.roomName, body.roomGoal, body.agentIds ?? [], body.roomLeader, turnMode, body.moderator);
|
|
610
636
|
}
|
|
611
637
|
catch (error) {
|
|
612
638
|
logger_1.logger.error(`[${req.user?.sub}] Error creating room ${body.roomName}:`, error);
|
|
639
|
+
if (error instanceof errors_1.ValidationError) {
|
|
640
|
+
throw new common_1.BadRequestException(error.message);
|
|
641
|
+
}
|
|
613
642
|
throw new common_1.HttpException(error.message || 'Failed to create room', common_1.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
614
643
|
}
|
|
615
644
|
}
|
|
616
645
|
async editRoom(req, roomId, body) {
|
|
646
|
+
const turnMode = AppController_1.parseTurnMode(body.turnMode);
|
|
617
647
|
try {
|
|
618
648
|
const appService = this.getAppService(req);
|
|
619
|
-
await appService.editRoom(roomId, body.roomName, body.roomGoal, body.baseRoomDir, body.agentIds);
|
|
649
|
+
await appService.editRoom(roomId, body.roomName, body.roomGoal, body.baseRoomDir, body.agentIds, body.roomLeader, turnMode, body.moderator);
|
|
620
650
|
}
|
|
621
651
|
catch (error) {
|
|
622
652
|
logger_1.logger.error(`[${req.user?.sub}] Error editing room ${roomId}:`, error);
|
|
623
653
|
if (error instanceof errors_1.NotFoundError) {
|
|
624
654
|
throw new common_1.NotFoundException(error.message);
|
|
625
655
|
}
|
|
656
|
+
if (error instanceof errors_1.ValidationError) {
|
|
657
|
+
throw new common_1.BadRequestException(error.message);
|
|
658
|
+
}
|
|
626
659
|
throw new common_1.HttpException('Failed to edit room', common_1.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
627
660
|
}
|
|
628
661
|
}
|
|
629
|
-
|
|
662
|
+
async createRoomAgent(req, roomId, body) {
|
|
663
|
+
if (!body.aiServiceName || !body.aiModel || !body.agentName?.trim()) {
|
|
664
|
+
throw new common_1.BadRequestException('AI service name, AI Model, and agent name are required');
|
|
665
|
+
}
|
|
666
|
+
if (body.agentName.length > 200) {
|
|
667
|
+
throw new common_1.BadRequestException('Agent name too long');
|
|
668
|
+
}
|
|
669
|
+
try {
|
|
670
|
+
const appService = this.getAppService(req);
|
|
671
|
+
return await appService.createRoomAgent(roomId, body);
|
|
672
|
+
}
|
|
673
|
+
catch (error) {
|
|
674
|
+
logger_1.logger.error(`[${req.user?.sub}] Error adding agent to room ${roomId}:`, error);
|
|
675
|
+
if (error instanceof errors_1.NotFoundError) {
|
|
676
|
+
throw new common_1.NotFoundException(error.message);
|
|
677
|
+
}
|
|
678
|
+
if (error instanceof errors_1.OperationFailedError || error instanceof errors_1.ValidationError) {
|
|
679
|
+
throw new common_1.BadRequestException(error.message);
|
|
680
|
+
}
|
|
681
|
+
throw new common_1.HttpException('Failed to add agent to room', common_1.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
async removeRoomAgent(req, roomId, agentId) {
|
|
630
685
|
try {
|
|
631
686
|
const appService = this.getAppService(req);
|
|
632
|
-
|
|
687
|
+
await appService.removeRoomAgent(roomId, agentId);
|
|
688
|
+
}
|
|
689
|
+
catch (error) {
|
|
690
|
+
logger_1.logger.error(`[${req.user?.sub}] Error removing agent ${agentId} from room ${roomId}:`, error);
|
|
691
|
+
if (error instanceof errors_1.NotFoundError) {
|
|
692
|
+
throw new common_1.NotFoundException(error.message);
|
|
693
|
+
}
|
|
694
|
+
if (error instanceof errors_1.OperationFailedError || error instanceof errors_1.ValidationError) {
|
|
695
|
+
throw new common_1.BadRequestException(error.message);
|
|
696
|
+
}
|
|
697
|
+
throw new common_1.HttpException('Failed to remove agent from room', common_1.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
async listRooms(req, published) {
|
|
701
|
+
try {
|
|
702
|
+
const appService = this.getAppService(req);
|
|
703
|
+
if (published === 'true') {
|
|
704
|
+
return await appService.listPublishedRooms();
|
|
705
|
+
}
|
|
706
|
+
return await appService.listRooms();
|
|
633
707
|
}
|
|
634
708
|
catch (error) {
|
|
635
709
|
logger_1.logger.error(`[${req.user?.sub}] Error listing rooms:`, error);
|
|
@@ -823,7 +897,7 @@ let AppController = class AppController {
|
|
|
823
897
|
}
|
|
824
898
|
try {
|
|
825
899
|
const appService = this.getAppService(req, undefined, roomId);
|
|
826
|
-
await appService.sendRoomMessage(roomId, body.content, body.sender, body.action, body.targets, body.clearQueue || false);
|
|
900
|
+
return await appService.sendRoomMessage(roomId, body.content, body.sender, body.action, body.targets, body.clearQueue || false);
|
|
827
901
|
}
|
|
828
902
|
catch (error) {
|
|
829
903
|
logger_1.logger.error(`[${req.user?.sub}] Error sending room message to ${roomId}:`, error);
|
|
@@ -965,6 +1039,9 @@ let AppController = class AppController {
|
|
|
965
1039
|
if (error instanceof errors_1.NotFoundError) {
|
|
966
1040
|
throw new common_1.NotFoundException(error.message);
|
|
967
1041
|
}
|
|
1042
|
+
if (error instanceof errors_1.ValidationError) {
|
|
1043
|
+
throw new common_1.BadRequestException(error.message);
|
|
1044
|
+
}
|
|
968
1045
|
if (error instanceof errors_1.OperationFailedError) {
|
|
969
1046
|
throw new common_1.HttpException(error.message, common_1.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
970
1047
|
}
|
|
@@ -1054,7 +1131,7 @@ let AppController = class AppController {
|
|
|
1054
1131
|
throw new common_1.BadRequestException('Room ID is required');
|
|
1055
1132
|
}
|
|
1056
1133
|
try {
|
|
1057
|
-
const appService = this.getAppService(req);
|
|
1134
|
+
const appService = this.getAppService(req, undefined, roomId);
|
|
1058
1135
|
await appService.resetRoom(roomId);
|
|
1059
1136
|
}
|
|
1060
1137
|
catch (error) {
|
|
@@ -1810,21 +1887,38 @@ let AppController = class AppController {
|
|
|
1810
1887
|
}
|
|
1811
1888
|
}
|
|
1812
1889
|
async createArtifact(req, body, file) {
|
|
1890
|
+
const MAX_MARKDOWN_SIZE = 10 * 1024 * 1024;
|
|
1891
|
+
if (!body.name || !body.name.trim()) {
|
|
1892
|
+
throw new common_1.BadRequestException('Artifact name is required');
|
|
1893
|
+
}
|
|
1894
|
+
if (body.name.length > 200) {
|
|
1895
|
+
throw new common_1.BadRequestException('Artifact name too long (max 200 characters)');
|
|
1896
|
+
}
|
|
1897
|
+
if (!file) {
|
|
1898
|
+
if (typeof body.content !== 'string' || !body.content.trim()) {
|
|
1899
|
+
throw new common_1.BadRequestException('Provide either a .md/.pdf file or a non-empty "content" string');
|
|
1900
|
+
}
|
|
1901
|
+
if (Buffer.byteLength(body.content, 'utf8') > MAX_MARKDOWN_SIZE) {
|
|
1902
|
+
throw new common_1.HttpException('Content too large (max 10MB)', common_1.HttpStatus.PAYLOAD_TOO_LARGE);
|
|
1903
|
+
}
|
|
1904
|
+
try {
|
|
1905
|
+
const appService = this.getAppService(req);
|
|
1906
|
+
return { artifactId: appService.createUserArtifact(body.name.trim(), body.content) };
|
|
1907
|
+
}
|
|
1908
|
+
catch (error) {
|
|
1909
|
+
logger_1.logger.error(`Error creating artifact from text:`, error);
|
|
1910
|
+
throw new common_1.HttpException('Failed to create artifact', common_1.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
1911
|
+
}
|
|
1912
|
+
}
|
|
1813
1913
|
const extension = file.originalname.toLowerCase().split('.').pop();
|
|
1814
1914
|
if (!['md', 'pdf'].includes(extension)) {
|
|
1815
1915
|
throw new common_1.BadRequestException('Only .md and .pdf files are allowed');
|
|
1816
1916
|
}
|
|
1817
|
-
const MAX_FILE_SIZE = extension === 'pdf' ? 50 * 1024 * 1024 :
|
|
1917
|
+
const MAX_FILE_SIZE = extension === 'pdf' ? 50 * 1024 * 1024 : MAX_MARKDOWN_SIZE;
|
|
1818
1918
|
if (file.size > MAX_FILE_SIZE) {
|
|
1819
1919
|
const maxSizeMB = extension === 'pdf' ? '50MB' : '10MB';
|
|
1820
1920
|
throw new common_1.HttpException(`File too large (max ${maxSizeMB})`, common_1.HttpStatus.PAYLOAD_TOO_LARGE);
|
|
1821
1921
|
}
|
|
1822
|
-
if (!body.name || !body.name.trim()) {
|
|
1823
|
-
throw new common_1.BadRequestException('Artifact name is required');
|
|
1824
|
-
}
|
|
1825
|
-
if (body.name.length > 200) {
|
|
1826
|
-
throw new common_1.BadRequestException('Artifact name too long (max 200 characters)');
|
|
1827
|
-
}
|
|
1828
1922
|
try {
|
|
1829
1923
|
const appService = this.getAppService(req);
|
|
1830
1924
|
let artifactId;
|
|
@@ -1944,6 +2038,7 @@ let AppController = class AppController {
|
|
|
1944
2038
|
};
|
|
1945
2039
|
exports.AppController = AppController;
|
|
1946
2040
|
__decorate([
|
|
2041
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
1947
2042
|
(0, common_1.Get)('list-services'),
|
|
1948
2043
|
__param(0, (0, common_1.Request)()),
|
|
1949
2044
|
__metadata("design:type", Function),
|
|
@@ -1951,6 +2046,7 @@ __decorate([
|
|
|
1951
2046
|
__metadata("design:returntype", Array)
|
|
1952
2047
|
], AppController.prototype, "listServices", null);
|
|
1953
2048
|
__decorate([
|
|
2049
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
1954
2050
|
(0, common_1.Get)('list-models/:aiServiceName'),
|
|
1955
2051
|
__param(0, (0, common_1.Request)()),
|
|
1956
2052
|
__param(1, (0, common_1.Param)('aiServiceName')),
|
|
@@ -1959,6 +2055,7 @@ __decorate([
|
|
|
1959
2055
|
__metadata("design:returntype", Promise)
|
|
1960
2056
|
], AppController.prototype, "listModels", null);
|
|
1961
2057
|
__decorate([
|
|
2058
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
1962
2059
|
(0, common_1.Get)('list-image-models'),
|
|
1963
2060
|
__param(0, (0, common_1.Request)()),
|
|
1964
2061
|
__metadata("design:type", Function),
|
|
@@ -1966,6 +2063,7 @@ __decorate([
|
|
|
1966
2063
|
__metadata("design:returntype", Promise)
|
|
1967
2064
|
], AppController.prototype, "listImageModels", null);
|
|
1968
2065
|
__decorate([
|
|
2066
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
1969
2067
|
(0, common_1.Get)('list-story-models'),
|
|
1970
2068
|
__param(0, (0, common_1.Request)()),
|
|
1971
2069
|
__metadata("design:type", Function),
|
|
@@ -1973,6 +2071,7 @@ __decorate([
|
|
|
1973
2071
|
__metadata("design:returntype", Promise)
|
|
1974
2072
|
], AppController.prototype, "listStoryModels", null);
|
|
1975
2073
|
__decorate([
|
|
2074
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
1976
2075
|
(0, common_1.Get)('list-story-model-defaults'),
|
|
1977
2076
|
__param(0, (0, common_1.Request)()),
|
|
1978
2077
|
__metadata("design:type", Function),
|
|
@@ -1980,6 +2079,7 @@ __decorate([
|
|
|
1980
2079
|
__metadata("design:returntype", Promise)
|
|
1981
2080
|
], AppController.prototype, "listStoryModelDefaults", null);
|
|
1982
2081
|
__decorate([
|
|
2082
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
1983
2083
|
(0, common_1.Post)('agents'),
|
|
1984
2084
|
(0, common_1.HttpCode)(common_1.HttpStatus.CREATED),
|
|
1985
2085
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2000,6 +2100,7 @@ __decorate([
|
|
|
2000
2100
|
__metadata("design:returntype", Promise)
|
|
2001
2101
|
], AppController.prototype, "processText", null);
|
|
2002
2102
|
__decorate([
|
|
2103
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2003
2104
|
(0, common_1.Post)('agents/:agentId/files'),
|
|
2004
2105
|
(0, common_1.UseInterceptors)((0, platform_express_1.FileInterceptor)('file')),
|
|
2005
2106
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2011,6 +2112,7 @@ __decorate([
|
|
|
2011
2112
|
__metadata("design:returntype", Promise)
|
|
2012
2113
|
], AppController.prototype, "attachDocument", null);
|
|
2013
2114
|
__decorate([
|
|
2115
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2014
2116
|
(0, common_1.Get)('agents/:agentId/files'),
|
|
2015
2117
|
__param(0, (0, common_1.Request)()),
|
|
2016
2118
|
__param(1, (0, common_1.Param)('agentId')),
|
|
@@ -2019,6 +2121,7 @@ __decorate([
|
|
|
2019
2121
|
__metadata("design:returntype", Promise)
|
|
2020
2122
|
], AppController.prototype, "listAttachedFiles", null);
|
|
2021
2123
|
__decorate([
|
|
2124
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2022
2125
|
(0, common_1.Get)('prompts'),
|
|
2023
2126
|
__param(0, (0, common_1.Request)()),
|
|
2024
2127
|
__param(1, (0, common_1.Query)('scope')),
|
|
@@ -2027,6 +2130,7 @@ __decorate([
|
|
|
2027
2130
|
__metadata("design:returntype", Object)
|
|
2028
2131
|
], AppController.prototype, "getPrompts", null);
|
|
2029
2132
|
__decorate([
|
|
2133
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2030
2134
|
(0, common_1.Post)('prompts'),
|
|
2031
2135
|
(0, common_1.HttpCode)(common_1.HttpStatus.CREATED),
|
|
2032
2136
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2036,6 +2140,7 @@ __decorate([
|
|
|
2036
2140
|
__metadata("design:returntype", Promise)
|
|
2037
2141
|
], AppController.prototype, "createPromptFolder", null);
|
|
2038
2142
|
__decorate([
|
|
2143
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2039
2144
|
(0, common_1.Delete)('prompts/:folderName'),
|
|
2040
2145
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2041
2146
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2045,6 +2150,7 @@ __decorate([
|
|
|
2045
2150
|
__metadata("design:returntype", Promise)
|
|
2046
2151
|
], AppController.prototype, "deletePromptFolder", null);
|
|
2047
2152
|
__decorate([
|
|
2153
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2048
2154
|
(0, common_1.Get)('prompts/:folderName/files'),
|
|
2049
2155
|
__param(0, (0, common_1.Request)()),
|
|
2050
2156
|
__param(1, (0, common_1.Param)('folderName')),
|
|
@@ -2053,6 +2159,16 @@ __decorate([
|
|
|
2053
2159
|
__metadata("design:returntype", Promise)
|
|
2054
2160
|
], AppController.prototype, "getPromptFiles", null);
|
|
2055
2161
|
__decorate([
|
|
2162
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2163
|
+
(0, common_1.Get)('prompts/:folderName/defaults'),
|
|
2164
|
+
__param(0, (0, common_1.Request)()),
|
|
2165
|
+
__param(1, (0, common_1.Param)('folderName')),
|
|
2166
|
+
__metadata("design:type", Function),
|
|
2167
|
+
__metadata("design:paramtypes", [Object, String]),
|
|
2168
|
+
__metadata("design:returntype", Object)
|
|
2169
|
+
], AppController.prototype, "getPromptFolderDefaults", null);
|
|
2170
|
+
__decorate([
|
|
2171
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2056
2172
|
(0, common_1.Get)('prompts/:folderName/files/:fileName'),
|
|
2057
2173
|
__param(0, (0, common_1.Request)()),
|
|
2058
2174
|
__param(1, (0, common_1.Param)('folderName')),
|
|
@@ -2062,6 +2178,7 @@ __decorate([
|
|
|
2062
2178
|
__metadata("design:returntype", Promise)
|
|
2063
2179
|
], AppController.prototype, "getPromptFile", null);
|
|
2064
2180
|
__decorate([
|
|
2181
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2065
2182
|
(0, common_1.Post)('prompts/:folderName/files'),
|
|
2066
2183
|
(0, common_1.HttpCode)(common_1.HttpStatus.CREATED),
|
|
2067
2184
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2072,6 +2189,7 @@ __decorate([
|
|
|
2072
2189
|
__metadata("design:returntype", Promise)
|
|
2073
2190
|
], AppController.prototype, "createPromptFile", null);
|
|
2074
2191
|
__decorate([
|
|
2192
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2075
2193
|
(0, common_1.Put)('prompts/:folderName/files/:fileName'),
|
|
2076
2194
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2077
2195
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2083,6 +2201,7 @@ __decorate([
|
|
|
2083
2201
|
__metadata("design:returntype", Promise)
|
|
2084
2202
|
], AppController.prototype, "updatePromptFile", null);
|
|
2085
2203
|
__decorate([
|
|
2204
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2086
2205
|
(0, common_1.Delete)('prompts/:folderName/files/:fileName'),
|
|
2087
2206
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2088
2207
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2093,6 +2212,7 @@ __decorate([
|
|
|
2093
2212
|
__metadata("design:returntype", Promise)
|
|
2094
2213
|
], AppController.prototype, "deletePromptFile", null);
|
|
2095
2214
|
__decorate([
|
|
2215
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2096
2216
|
(0, common_1.Get)('tools'),
|
|
2097
2217
|
__param(0, (0, common_1.Request)()),
|
|
2098
2218
|
__metadata("design:type", Function),
|
|
@@ -2100,6 +2220,7 @@ __decorate([
|
|
|
2100
2220
|
__metadata("design:returntype", Promise)
|
|
2101
2221
|
], AppController.prototype, "getTools", null);
|
|
2102
2222
|
__decorate([
|
|
2223
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2103
2224
|
(0, common_1.Post)('tools'),
|
|
2104
2225
|
(0, common_1.HttpCode)(common_1.HttpStatus.CREATED),
|
|
2105
2226
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2109,6 +2230,7 @@ __decorate([
|
|
|
2109
2230
|
__metadata("design:returntype", Promise)
|
|
2110
2231
|
], AppController.prototype, "createTool", null);
|
|
2111
2232
|
__decorate([
|
|
2233
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2112
2234
|
(0, common_1.Put)('tools/:name'),
|
|
2113
2235
|
__param(0, (0, common_1.Request)()),
|
|
2114
2236
|
__param(1, (0, common_1.Param)('name')),
|
|
@@ -2118,6 +2240,7 @@ __decorate([
|
|
|
2118
2240
|
__metadata("design:returntype", Promise)
|
|
2119
2241
|
], AppController.prototype, "updateTool", null);
|
|
2120
2242
|
__decorate([
|
|
2243
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2121
2244
|
(0, common_1.Delete)('tools/:name'),
|
|
2122
2245
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2123
2246
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2127,6 +2250,7 @@ __decorate([
|
|
|
2127
2250
|
__metadata("design:returntype", Promise)
|
|
2128
2251
|
], AppController.prototype, "deleteTool", null);
|
|
2129
2252
|
__decorate([
|
|
2253
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2130
2254
|
(0, common_1.Post)('tools/:name/test'),
|
|
2131
2255
|
__param(0, (0, common_1.Request)()),
|
|
2132
2256
|
__param(1, (0, common_1.Param)('name')),
|
|
@@ -2160,12 +2284,14 @@ __decorate([
|
|
|
2160
2284
|
__metadata("design:returntype", Object)
|
|
2161
2285
|
], AppController.prototype, "getLibraryFile", null);
|
|
2162
2286
|
__decorate([
|
|
2287
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2163
2288
|
(0, common_1.Get)('library/default-url'),
|
|
2164
2289
|
__metadata("design:type", Function),
|
|
2165
2290
|
__metadata("design:paramtypes", []),
|
|
2166
2291
|
__metadata("design:returntype", Object)
|
|
2167
2292
|
], AppController.prototype, "getLibraryDefaultUrl", null);
|
|
2168
2293
|
__decorate([
|
|
2294
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2169
2295
|
(0, common_1.Get)('library/proxy/prompts'),
|
|
2170
2296
|
__param(0, (0, common_1.Query)('url')),
|
|
2171
2297
|
__metadata("design:type", Function),
|
|
@@ -2173,6 +2299,7 @@ __decorate([
|
|
|
2173
2299
|
__metadata("design:returntype", Promise)
|
|
2174
2300
|
], AppController.prototype, "proxyListRemote", null);
|
|
2175
2301
|
__decorate([
|
|
2302
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2176
2303
|
(0, common_1.Get)('library/proxy/prompts/:folder/preview'),
|
|
2177
2304
|
__param(0, (0, common_1.Query)('url')),
|
|
2178
2305
|
__param(1, (0, common_1.Param)('folder')),
|
|
@@ -2181,6 +2308,7 @@ __decorate([
|
|
|
2181
2308
|
__metadata("design:returntype", Promise)
|
|
2182
2309
|
], AppController.prototype, "proxyPreviewRemote", null);
|
|
2183
2310
|
__decorate([
|
|
2311
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2184
2312
|
(0, common_1.Post)('prompts/from-library'),
|
|
2185
2313
|
(0, common_1.HttpCode)(common_1.HttpStatus.CREATED),
|
|
2186
2314
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2190,6 +2318,7 @@ __decorate([
|
|
|
2190
2318
|
__metadata("design:returntype", Promise)
|
|
2191
2319
|
], AppController.prototype, "copyPromptFromLibrary", null);
|
|
2192
2320
|
__decorate([
|
|
2321
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2193
2322
|
(0, common_1.Get)('list-prompt-folders'),
|
|
2194
2323
|
__param(0, (0, common_1.Request)()),
|
|
2195
2324
|
__metadata("design:type", Function),
|
|
@@ -2197,6 +2326,7 @@ __decorate([
|
|
|
2197
2326
|
__metadata("design:returntype", Array)
|
|
2198
2327
|
], AppController.prototype, "listPromptFolders", null);
|
|
2199
2328
|
__decorate([
|
|
2329
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2200
2330
|
(0, common_1.Get)('agents/:agentId/prompts'),
|
|
2201
2331
|
__param(0, (0, common_1.Request)()),
|
|
2202
2332
|
__param(1, (0, common_1.Param)('agentId')),
|
|
@@ -2205,6 +2335,7 @@ __decorate([
|
|
|
2205
2335
|
__metadata("design:returntype", Array)
|
|
2206
2336
|
], AppController.prototype, "listPrompts", null);
|
|
2207
2337
|
__decorate([
|
|
2338
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2208
2339
|
(0, common_1.Post)('agents/:agentId/prompts/:promptName'),
|
|
2209
2340
|
__param(0, (0, common_1.Request)()),
|
|
2210
2341
|
__param(1, (0, common_1.Param)('agentId')),
|
|
@@ -2215,14 +2346,17 @@ __decorate([
|
|
|
2215
2346
|
__metadata("design:returntype", Promise)
|
|
2216
2347
|
], AppController.prototype, "runPreparedPrompt", null);
|
|
2217
2348
|
__decorate([
|
|
2349
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2218
2350
|
(0, common_1.Get)('agents'),
|
|
2219
2351
|
__param(0, (0, common_1.Request)()),
|
|
2220
2352
|
__param(1, (0, common_1.Query)('published')),
|
|
2353
|
+
__param(2, (0, common_1.Query)('includeRoomAgents')),
|
|
2221
2354
|
__metadata("design:type", Function),
|
|
2222
|
-
__metadata("design:paramtypes", [Object, String]),
|
|
2355
|
+
__metadata("design:paramtypes", [Object, String, String]),
|
|
2223
2356
|
__metadata("design:returntype", Promise)
|
|
2224
2357
|
], AppController.prototype, "listAgents", null);
|
|
2225
2358
|
__decorate([
|
|
2359
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2226
2360
|
(0, common_1.Post)('rooms'),
|
|
2227
2361
|
(0, common_1.HttpCode)(common_1.HttpStatus.CREATED),
|
|
2228
2362
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2232,6 +2366,7 @@ __decorate([
|
|
|
2232
2366
|
__metadata("design:returntype", Promise)
|
|
2233
2367
|
], AppController.prototype, "createRoom", null);
|
|
2234
2368
|
__decorate([
|
|
2369
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2235
2370
|
(0, common_1.Put)('rooms/:roomId'),
|
|
2236
2371
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2237
2372
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2242,11 +2377,35 @@ __decorate([
|
|
|
2242
2377
|
__metadata("design:returntype", Promise)
|
|
2243
2378
|
], AppController.prototype, "editRoom", null);
|
|
2244
2379
|
__decorate([
|
|
2380
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2381
|
+
(0, common_1.Post)('rooms/:roomId/agents'),
|
|
2382
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.CREATED),
|
|
2383
|
+
__param(0, (0, common_1.Request)()),
|
|
2384
|
+
__param(1, (0, common_1.Param)('roomId')),
|
|
2385
|
+
__param(2, (0, common_1.Body)()),
|
|
2386
|
+
__metadata("design:type", Function),
|
|
2387
|
+
__metadata("design:paramtypes", [Object, String, Object]),
|
|
2388
|
+
__metadata("design:returntype", Promise)
|
|
2389
|
+
], AppController.prototype, "createRoomAgent", null);
|
|
2390
|
+
__decorate([
|
|
2391
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2392
|
+
(0, common_1.Delete)('rooms/:roomId/agents/:agentId'),
|
|
2393
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2394
|
+
__param(0, (0, common_1.Request)()),
|
|
2395
|
+
__param(1, (0, common_1.Param)('roomId')),
|
|
2396
|
+
__param(2, (0, common_1.Param)('agentId')),
|
|
2397
|
+
__metadata("design:type", Function),
|
|
2398
|
+
__metadata("design:paramtypes", [Object, String, String]),
|
|
2399
|
+
__metadata("design:returntype", Promise)
|
|
2400
|
+
], AppController.prototype, "removeRoomAgent", null);
|
|
2401
|
+
__decorate([
|
|
2402
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2245
2403
|
(0, common_1.Get)('rooms'),
|
|
2246
2404
|
__param(0, (0, common_1.Request)()),
|
|
2405
|
+
__param(1, (0, common_1.Query)('published')),
|
|
2247
2406
|
__metadata("design:type", Function),
|
|
2248
|
-
__metadata("design:paramtypes", [Object]),
|
|
2249
|
-
__metadata("design:returntype",
|
|
2407
|
+
__metadata("design:paramtypes", [Object, String]),
|
|
2408
|
+
__metadata("design:returntype", Promise)
|
|
2250
2409
|
], AppController.prototype, "listRooms", null);
|
|
2251
2410
|
__decorate([
|
|
2252
2411
|
(0, room_access_decorator_1.RoomReadAccess)(),
|
|
@@ -2288,6 +2447,7 @@ __decorate([
|
|
|
2288
2447
|
__metadata("design:returntype", Promise)
|
|
2289
2448
|
], AppController.prototype, "getAgentMessages", null);
|
|
2290
2449
|
__decorate([
|
|
2450
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2291
2451
|
(0, common_1.Get)('stories/:storyId/messages/:fromIndex'),
|
|
2292
2452
|
__param(0, (0, common_1.Request)()),
|
|
2293
2453
|
__param(1, (0, common_1.Param)('storyId')),
|
|
@@ -2297,6 +2457,7 @@ __decorate([
|
|
|
2297
2457
|
__metadata("design:returntype", Object)
|
|
2298
2458
|
], AppController.prototype, "getStoryMessages", null);
|
|
2299
2459
|
__decorate([
|
|
2460
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2300
2461
|
(0, common_1.Delete)('agents/:agentId'),
|
|
2301
2462
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2302
2463
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2306,6 +2467,7 @@ __decorate([
|
|
|
2306
2467
|
__metadata("design:returntype", Promise)
|
|
2307
2468
|
], AppController.prototype, "deleteAgent", null);
|
|
2308
2469
|
__decorate([
|
|
2470
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2309
2471
|
(0, common_1.Post)('agents/:agentId/publish-instance'),
|
|
2310
2472
|
__param(0, (0, common_1.Request)()),
|
|
2311
2473
|
__param(1, (0, common_1.Param)('agentId')),
|
|
@@ -2315,6 +2477,7 @@ __decorate([
|
|
|
2315
2477
|
__metadata("design:returntype", Promise)
|
|
2316
2478
|
], AppController.prototype, "publishAgentInstance", null);
|
|
2317
2479
|
__decorate([
|
|
2480
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2318
2481
|
(0, common_1.Get)('agents/:agentId/published-instances'),
|
|
2319
2482
|
__param(0, (0, common_1.Request)()),
|
|
2320
2483
|
__param(1, (0, common_1.Param)('agentId')),
|
|
@@ -2323,6 +2486,7 @@ __decorate([
|
|
|
2323
2486
|
__metadata("design:returntype", Promise)
|
|
2324
2487
|
], AppController.prototype, "getPublishedInstances", null);
|
|
2325
2488
|
__decorate([
|
|
2489
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2326
2490
|
(0, common_1.Put)('agents/:instanceId/reset-from-template'),
|
|
2327
2491
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2328
2492
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2332,6 +2496,7 @@ __decorate([
|
|
|
2332
2496
|
__metadata("design:returntype", Promise)
|
|
2333
2497
|
], AppController.prototype, "resetPublishedInstance", null);
|
|
2334
2498
|
__decorate([
|
|
2499
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2335
2500
|
(0, common_1.Delete)('rooms/:roomId'),
|
|
2336
2501
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2337
2502
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2372,6 +2537,7 @@ __decorate([
|
|
|
2372
2537
|
__metadata("design:returntype", Promise)
|
|
2373
2538
|
], AppController.prototype, "resumeRoom", null);
|
|
2374
2539
|
__decorate([
|
|
2540
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2375
2541
|
(0, common_1.Get)('user-preferences'),
|
|
2376
2542
|
__param(0, (0, common_1.Request)()),
|
|
2377
2543
|
__metadata("design:type", Function),
|
|
@@ -2379,6 +2545,7 @@ __decorate([
|
|
|
2379
2545
|
__metadata("design:returntype", Promise)
|
|
2380
2546
|
], AppController.prototype, "getUserPreferences", null);
|
|
2381
2547
|
__decorate([
|
|
2548
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2382
2549
|
(0, common_1.Post)('save-preferences'),
|
|
2383
2550
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2384
2551
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2388,6 +2555,7 @@ __decorate([
|
|
|
2388
2555
|
__metadata("design:returntype", Promise)
|
|
2389
2556
|
], AppController.prototype, "saveUserPreferences", null);
|
|
2390
2557
|
__decorate([
|
|
2558
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2391
2559
|
(0, common_1.Get)('list-prompt-files/:folderName'),
|
|
2392
2560
|
__param(0, (0, common_1.Request)()),
|
|
2393
2561
|
__param(1, (0, common_1.Param)('folderName')),
|
|
@@ -2396,6 +2564,7 @@ __decorate([
|
|
|
2396
2564
|
__metadata("design:returntype", Promise)
|
|
2397
2565
|
], AppController.prototype, "listPromptFilesDeprecated", null);
|
|
2398
2566
|
__decorate([
|
|
2567
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2399
2568
|
(0, common_1.Get)('get-prompt-file/:folderName/:fileName'),
|
|
2400
2569
|
__param(0, (0, common_1.Request)()),
|
|
2401
2570
|
__param(1, (0, common_1.Param)('folderName')),
|
|
@@ -2405,6 +2574,7 @@ __decorate([
|
|
|
2405
2574
|
__metadata("design:returntype", Promise)
|
|
2406
2575
|
], AppController.prototype, "getPromptFileDeprecated", null);
|
|
2407
2576
|
__decorate([
|
|
2577
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2408
2578
|
(0, common_1.Post)('save-prompt-file'),
|
|
2409
2579
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2410
2580
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2414,6 +2584,7 @@ __decorate([
|
|
|
2414
2584
|
__metadata("design:returntype", Promise)
|
|
2415
2585
|
], AppController.prototype, "savePromptFileDeprecated", null);
|
|
2416
2586
|
__decorate([
|
|
2587
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2417
2588
|
(0, common_1.Post)('delete-prompt-file'),
|
|
2418
2589
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2419
2590
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2423,6 +2594,7 @@ __decorate([
|
|
|
2423
2594
|
__metadata("design:returntype", Promise)
|
|
2424
2595
|
], AppController.prototype, "deletePromptFileDeprecated", null);
|
|
2425
2596
|
__decorate([
|
|
2597
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2426
2598
|
(0, common_1.Post)('delete-prompt-folder'),
|
|
2427
2599
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2428
2600
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2432,7 +2604,7 @@ __decorate([
|
|
|
2432
2604
|
__metadata("design:returntype", Promise)
|
|
2433
2605
|
], AppController.prototype, "deletePromptFolderDeprecated", null);
|
|
2434
2606
|
__decorate([
|
|
2435
|
-
(0,
|
|
2607
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2436
2608
|
(0, common_1.Put)('agents/:agentId'),
|
|
2437
2609
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2438
2610
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2443,6 +2615,7 @@ __decorate([
|
|
|
2443
2615
|
__metadata("design:returntype", Promise)
|
|
2444
2616
|
], AppController.prototype, "updateAgent", null);
|
|
2445
2617
|
__decorate([
|
|
2618
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2446
2619
|
(0, common_1.Delete)('agents/:agentId/files/:documentId'),
|
|
2447
2620
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2448
2621
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2473,6 +2646,7 @@ __decorate([
|
|
|
2473
2646
|
__metadata("design:returntype", Promise)
|
|
2474
2647
|
], AppController.prototype, "compactAgentConversation", null);
|
|
2475
2648
|
__decorate([
|
|
2649
|
+
(0, room_access_decorator_1.RoomAccess)(),
|
|
2476
2650
|
(0, common_1.Post)('rooms/:roomId/reset'),
|
|
2477
2651
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2478
2652
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2482,6 +2656,7 @@ __decorate([
|
|
|
2482
2656
|
__metadata("design:returntype", Promise)
|
|
2483
2657
|
], AppController.prototype, "resetRoom", null);
|
|
2484
2658
|
__decorate([
|
|
2659
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2485
2660
|
(0, common_1.Post)('rooms/:templateId/publish'),
|
|
2486
2661
|
(0, common_1.HttpCode)(common_1.HttpStatus.CREATED),
|
|
2487
2662
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2492,6 +2667,7 @@ __decorate([
|
|
|
2492
2667
|
__metadata("design:returntype", Promise)
|
|
2493
2668
|
], AppController.prototype, "publishRoom", null);
|
|
2494
2669
|
__decorate([
|
|
2670
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2495
2671
|
(0, common_1.Get)('rooms/:templateId/published-instances'),
|
|
2496
2672
|
__param(0, (0, common_1.Request)()),
|
|
2497
2673
|
__param(1, (0, common_1.Param)('templateId')),
|
|
@@ -2500,6 +2676,7 @@ __decorate([
|
|
|
2500
2676
|
__metadata("design:returntype", Promise)
|
|
2501
2677
|
], AppController.prototype, "getPublishedRoomInstances", null);
|
|
2502
2678
|
__decorate([
|
|
2679
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2503
2680
|
(0, common_1.Put)('rooms/:instanceId/reset-from-template'),
|
|
2504
2681
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2505
2682
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2509,6 +2686,7 @@ __decorate([
|
|
|
2509
2686
|
__metadata("design:returntype", Promise)
|
|
2510
2687
|
], AppController.prototype, "resetPublishedRoomInstance", null);
|
|
2511
2688
|
__decorate([
|
|
2689
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2512
2690
|
(0, common_1.Post)('stories/:storyId/reset'),
|
|
2513
2691
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2514
2692
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2518,6 +2696,7 @@ __decorate([
|
|
|
2518
2696
|
__metadata("design:returntype", Promise)
|
|
2519
2697
|
], AppController.prototype, "resetStory", null);
|
|
2520
2698
|
__decorate([
|
|
2699
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2521
2700
|
(0, common_1.Post)('stories/:storyId/revert'),
|
|
2522
2701
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2523
2702
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2547,6 +2726,7 @@ __decorate([
|
|
|
2547
2726
|
__metadata("design:returntype", Promise)
|
|
2548
2727
|
], AppController.prototype, "publishArtifact", null);
|
|
2549
2728
|
__decorate([
|
|
2729
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2550
2730
|
(0, common_1.Post)('create-prompt-folder'),
|
|
2551
2731
|
(0, common_1.HttpCode)(common_1.HttpStatus.CREATED),
|
|
2552
2732
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2556,6 +2736,7 @@ __decorate([
|
|
|
2556
2736
|
__metadata("design:returntype", Promise)
|
|
2557
2737
|
], AppController.prototype, "createPromptFolderDeprecated", null);
|
|
2558
2738
|
__decorate([
|
|
2739
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2559
2740
|
(0, common_1.Get)('stories'),
|
|
2560
2741
|
__param(0, (0, common_1.Request)()),
|
|
2561
2742
|
__metadata("design:type", Function),
|
|
@@ -2563,6 +2744,7 @@ __decorate([
|
|
|
2563
2744
|
__metadata("design:returntype", Array)
|
|
2564
2745
|
], AppController.prototype, "listStories", null);
|
|
2565
2746
|
__decorate([
|
|
2747
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2566
2748
|
(0, common_1.Get)('stories/genres'),
|
|
2567
2749
|
__param(0, (0, common_1.Request)()),
|
|
2568
2750
|
__metadata("design:type", Function),
|
|
@@ -2570,6 +2752,7 @@ __decorate([
|
|
|
2570
2752
|
__metadata("design:returntype", Array)
|
|
2571
2753
|
], AppController.prototype, "listStoryGenres", null);
|
|
2572
2754
|
__decorate([
|
|
2755
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2573
2756
|
(0, common_1.Get)('stories/genres/random'),
|
|
2574
2757
|
__param(0, (0, common_1.Request)()),
|
|
2575
2758
|
__metadata("design:type", Function),
|
|
@@ -2577,6 +2760,7 @@ __decorate([
|
|
|
2577
2760
|
__metadata("design:returntype", Promise)
|
|
2578
2761
|
], AppController.prototype, "getRandomStoryIdea", null);
|
|
2579
2762
|
__decorate([
|
|
2763
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2580
2764
|
(0, common_1.Get)('stories/genres/:genreName'),
|
|
2581
2765
|
__param(0, (0, common_1.Request)()),
|
|
2582
2766
|
__param(1, (0, common_1.Param)('genreName')),
|
|
@@ -2585,6 +2769,7 @@ __decorate([
|
|
|
2585
2769
|
__metadata("design:returntype", Promise)
|
|
2586
2770
|
], AppController.prototype, "getStoryIdeasByGenre", null);
|
|
2587
2771
|
__decorate([
|
|
2772
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2588
2773
|
(0, common_1.Post)('stories/new'),
|
|
2589
2774
|
(0, common_1.HttpCode)(common_1.HttpStatus.CREATED),
|
|
2590
2775
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2594,6 +2779,7 @@ __decorate([
|
|
|
2594
2779
|
__metadata("design:returntype", Promise)
|
|
2595
2780
|
], AppController.prototype, "createStory", null);
|
|
2596
2781
|
__decorate([
|
|
2782
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2597
2783
|
(0, common_1.Post)('stories/import'),
|
|
2598
2784
|
(0, common_1.UseInterceptors)((0, platform_express_1.FileInterceptor)('file', {
|
|
2599
2785
|
limits: {
|
|
@@ -2608,6 +2794,7 @@ __decorate([
|
|
|
2608
2794
|
__metadata("design:returntype", Promise)
|
|
2609
2795
|
], AppController.prototype, "importStoryZip", null);
|
|
2610
2796
|
__decorate([
|
|
2797
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2611
2798
|
(0, common_1.Delete)('stories/:storyId'),
|
|
2612
2799
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2613
2800
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2617,6 +2804,7 @@ __decorate([
|
|
|
2617
2804
|
__metadata("design:returntype", Promise)
|
|
2618
2805
|
], AppController.prototype, "deleteStory", null);
|
|
2619
2806
|
__decorate([
|
|
2807
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2620
2808
|
(0, common_1.Post)('stories/:storyId/compact'),
|
|
2621
2809
|
__param(0, (0, common_1.Request)()),
|
|
2622
2810
|
__param(1, (0, common_1.Param)('storyId')),
|
|
@@ -2625,6 +2813,7 @@ __decorate([
|
|
|
2625
2813
|
__metadata("design:returntype", Promise)
|
|
2626
2814
|
], AppController.prototype, "compactStory", null);
|
|
2627
2815
|
__decorate([
|
|
2816
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2628
2817
|
(0, common_1.Post)('stories/:storyId/progress'),
|
|
2629
2818
|
__param(0, (0, common_1.Request)()),
|
|
2630
2819
|
__param(1, (0, common_1.Param)('storyId')),
|
|
@@ -2633,6 +2822,7 @@ __decorate([
|
|
|
2633
2822
|
__metadata("design:returntype", Promise)
|
|
2634
2823
|
], AppController.prototype, "progressStory", null);
|
|
2635
2824
|
__decorate([
|
|
2825
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2636
2826
|
(0, common_1.Get)('stories/:storyId/state'),
|
|
2637
2827
|
__param(0, (0, common_1.Request)()),
|
|
2638
2828
|
__param(1, (0, common_1.Param)('storyId')),
|
|
@@ -2641,6 +2831,7 @@ __decorate([
|
|
|
2641
2831
|
__metadata("design:returntype", Promise)
|
|
2642
2832
|
], AppController.prototype, "getStoryState", null);
|
|
2643
2833
|
__decorate([
|
|
2834
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2644
2835
|
(0, common_1.Post)('stories/:storyId/respond'),
|
|
2645
2836
|
__param(0, (0, common_1.Request)()),
|
|
2646
2837
|
__param(1, (0, common_1.Param)('storyId')),
|
|
@@ -2650,6 +2841,7 @@ __decorate([
|
|
|
2650
2841
|
__metadata("design:returntype", Promise)
|
|
2651
2842
|
], AppController.prototype, "respondToStory", null);
|
|
2652
2843
|
__decorate([
|
|
2844
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2653
2845
|
(0, common_1.Post)('stories/:storyId/interrupt'),
|
|
2654
2846
|
__param(0, (0, common_1.Request)()),
|
|
2655
2847
|
__param(1, (0, common_1.Param)('storyId')),
|
|
@@ -2658,6 +2850,7 @@ __decorate([
|
|
|
2658
2850
|
__metadata("design:returntype", Promise)
|
|
2659
2851
|
], AppController.prototype, "interruptStory", null);
|
|
2660
2852
|
__decorate([
|
|
2853
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2661
2854
|
(0, common_1.Post)('stories/:storyId/characters'),
|
|
2662
2855
|
(0, common_1.HttpCode)(common_1.HttpStatus.CREATED),
|
|
2663
2856
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2668,6 +2861,7 @@ __decorate([
|
|
|
2668
2861
|
__metadata("design:returntype", Promise)
|
|
2669
2862
|
], AppController.prototype, "introduceCharacter", null);
|
|
2670
2863
|
__decorate([
|
|
2864
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2671
2865
|
(0, common_1.Post)('stories/:storyId/characters/:characterName/decline'),
|
|
2672
2866
|
__param(0, (0, common_1.Request)()),
|
|
2673
2867
|
__param(1, (0, common_1.Param)('storyId')),
|
|
@@ -2677,6 +2871,7 @@ __decorate([
|
|
|
2677
2871
|
__metadata("design:returntype", Promise)
|
|
2678
2872
|
], AppController.prototype, "declineCharacter", null);
|
|
2679
2873
|
__decorate([
|
|
2874
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2680
2875
|
(0, common_1.Delete)('stories/:storyId/characters/:characterName'),
|
|
2681
2876
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2682
2877
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2687,6 +2882,7 @@ __decorate([
|
|
|
2687
2882
|
__metadata("design:returntype", Promise)
|
|
2688
2883
|
], AppController.prototype, "deleteCharacter", null);
|
|
2689
2884
|
__decorate([
|
|
2885
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2690
2886
|
(0, common_1.Get)('stories/:storyId/chapters'),
|
|
2691
2887
|
__param(0, (0, common_1.Request)()),
|
|
2692
2888
|
__param(1, (0, common_1.Param)('storyId')),
|
|
@@ -2695,6 +2891,7 @@ __decorate([
|
|
|
2695
2891
|
__metadata("design:returntype", Object)
|
|
2696
2892
|
], AppController.prototype, "listChapters", null);
|
|
2697
2893
|
__decorate([
|
|
2894
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2698
2895
|
(0, common_1.Get)('stories/:storyId/chapters/:chapterIndex'),
|
|
2699
2896
|
__param(0, (0, common_1.Request)()),
|
|
2700
2897
|
__param(1, (0, common_1.Param)('storyId')),
|
|
@@ -2704,6 +2901,7 @@ __decorate([
|
|
|
2704
2901
|
__metadata("design:returntype", Promise)
|
|
2705
2902
|
], AppController.prototype, "getChapter", null);
|
|
2706
2903
|
__decorate([
|
|
2904
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2707
2905
|
(0, common_1.Put)('stories/:storyId/chapters/:chapterIndex'),
|
|
2708
2906
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2709
2907
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2715,6 +2913,7 @@ __decorate([
|
|
|
2715
2913
|
__metadata("design:returntype", void 0)
|
|
2716
2914
|
], AppController.prototype, "saveChapter", null);
|
|
2717
2915
|
__decorate([
|
|
2916
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2718
2917
|
(0, common_1.Delete)('stories/:storyId/chapters/:chapterIndex'),
|
|
2719
2918
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2720
2919
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2725,6 +2924,7 @@ __decorate([
|
|
|
2725
2924
|
__metadata("design:returntype", void 0)
|
|
2726
2925
|
], AppController.prototype, "deleteChapter", null);
|
|
2727
2926
|
__decorate([
|
|
2927
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2728
2928
|
(0, common_1.Get)('stories/:storyId/export/md'),
|
|
2729
2929
|
__param(0, (0, common_1.Request)()),
|
|
2730
2930
|
__param(1, (0, common_1.Param)('storyId')),
|
|
@@ -2734,6 +2934,7 @@ __decorate([
|
|
|
2734
2934
|
__metadata("design:returntype", Promise)
|
|
2735
2935
|
], AppController.prototype, "exportStoryMarkdown", null);
|
|
2736
2936
|
__decorate([
|
|
2937
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2737
2938
|
(0, common_1.Get)('stories/:storyId/export/zip'),
|
|
2738
2939
|
__param(0, (0, common_1.Request)()),
|
|
2739
2940
|
__param(1, (0, common_1.Param)('storyId')),
|
|
@@ -2743,6 +2944,7 @@ __decorate([
|
|
|
2743
2944
|
__metadata("design:returntype", Promise)
|
|
2744
2945
|
], AppController.prototype, "exportStoryZip", null);
|
|
2745
2946
|
__decorate([
|
|
2947
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2746
2948
|
(0, common_1.Get)('stories/:storyId/characters'),
|
|
2747
2949
|
__param(0, (0, common_1.Request)()),
|
|
2748
2950
|
__param(1, (0, common_1.Param)('storyId')),
|
|
@@ -2751,6 +2953,7 @@ __decorate([
|
|
|
2751
2953
|
__metadata("design:returntype", Promise)
|
|
2752
2954
|
], AppController.prototype, "listCharacters", null);
|
|
2753
2955
|
__decorate([
|
|
2956
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2754
2957
|
(0, common_1.Get)('stories/:storyId/characters/:characterName'),
|
|
2755
2958
|
__param(0, (0, common_1.Request)()),
|
|
2756
2959
|
__param(1, (0, common_1.Param)('storyId')),
|
|
@@ -2760,6 +2963,7 @@ __decorate([
|
|
|
2760
2963
|
__metadata("design:returntype", Promise)
|
|
2761
2964
|
], AppController.prototype, "getCharacter", null);
|
|
2762
2965
|
__decorate([
|
|
2966
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2763
2967
|
(0, common_1.Put)('stories/:storyId/characters/:characterName'),
|
|
2764
2968
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2765
2969
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2771,6 +2975,7 @@ __decorate([
|
|
|
2771
2975
|
__metadata("design:returntype", Promise)
|
|
2772
2976
|
], AppController.prototype, "saveCharacter", null);
|
|
2773
2977
|
__decorate([
|
|
2978
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2774
2979
|
(0, common_1.Get)('stories/:storyId/characters/:characterName/inventory'),
|
|
2775
2980
|
__param(0, (0, common_1.Request)()),
|
|
2776
2981
|
__param(1, (0, common_1.Param)('storyId')),
|
|
@@ -2780,6 +2985,7 @@ __decorate([
|
|
|
2780
2985
|
__metadata("design:returntype", Promise)
|
|
2781
2986
|
], AppController.prototype, "getCharacterInventory", null);
|
|
2782
2987
|
__decorate([
|
|
2988
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2783
2989
|
(0, common_1.Put)('stories/:storyId/characters/:characterName/inventory'),
|
|
2784
2990
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2785
2991
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2791,6 +2997,7 @@ __decorate([
|
|
|
2791
2997
|
__metadata("design:returntype", Promise)
|
|
2792
2998
|
], AppController.prototype, "saveCharacterInventory", null);
|
|
2793
2999
|
__decorate([
|
|
3000
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2794
3001
|
(0, common_1.Get)('stories/:storyId/plot-plan'),
|
|
2795
3002
|
__param(0, (0, common_1.Request)()),
|
|
2796
3003
|
__param(1, (0, common_1.Param)('storyId')),
|
|
@@ -2799,6 +3006,7 @@ __decorate([
|
|
|
2799
3006
|
__metadata("design:returntype", Promise)
|
|
2800
3007
|
], AppController.prototype, "getPlotPlan", null);
|
|
2801
3008
|
__decorate([
|
|
3009
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2802
3010
|
(0, common_1.Get)('stories/:storyId/agent-history/:agentId'),
|
|
2803
3011
|
__param(0, (0, common_1.Request)()),
|
|
2804
3012
|
__param(1, (0, common_1.Param)('storyId')),
|
|
@@ -2808,6 +3016,7 @@ __decorate([
|
|
|
2808
3016
|
__metadata("design:returntype", Promise)
|
|
2809
3017
|
], AppController.prototype, "getAgentHistory", null);
|
|
2810
3018
|
__decorate([
|
|
3019
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2811
3020
|
(0, common_1.Put)('stories/:storyId/plot-plan'),
|
|
2812
3021
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2813
3022
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2818,6 +3027,7 @@ __decorate([
|
|
|
2818
3027
|
__metadata("design:returntype", Promise)
|
|
2819
3028
|
], AppController.prototype, "savePlotPlan", null);
|
|
2820
3029
|
__decorate([
|
|
3030
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2821
3031
|
(0, common_1.Get)('stories/:storyId/artifacts'),
|
|
2822
3032
|
__param(0, (0, common_1.Request)()),
|
|
2823
3033
|
__param(1, (0, common_1.Param)('storyId')),
|
|
@@ -2826,6 +3036,7 @@ __decorate([
|
|
|
2826
3036
|
__metadata("design:returntype", Promise)
|
|
2827
3037
|
], AppController.prototype, "listStoryArtifacts", null);
|
|
2828
3038
|
__decorate([
|
|
3039
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2829
3040
|
(0, common_1.Get)('stories/:storyId/artifacts/:artifactId'),
|
|
2830
3041
|
__param(0, (0, common_1.Request)()),
|
|
2831
3042
|
__param(1, (0, common_1.Param)('storyId')),
|
|
@@ -2836,6 +3047,7 @@ __decorate([
|
|
|
2836
3047
|
__metadata("design:returntype", Promise)
|
|
2837
3048
|
], AppController.prototype, "getStoryArtifact", null);
|
|
2838
3049
|
__decorate([
|
|
3050
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2839
3051
|
(0, common_1.Sse)('stories/:storyId/progress'),
|
|
2840
3052
|
__param(0, (0, common_1.Request)()),
|
|
2841
3053
|
__param(1, (0, common_1.Param)('storyId')),
|
|
@@ -2844,6 +3056,7 @@ __decorate([
|
|
|
2844
3056
|
__metadata("design:returntype", rxjs_1.Observable)
|
|
2845
3057
|
], AppController.prototype, "storyProgress", null);
|
|
2846
3058
|
__decorate([
|
|
3059
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2847
3060
|
(0, common_1.Sse)('stories/:storyId/messages'),
|
|
2848
3061
|
__param(0, (0, common_1.Request)()),
|
|
2849
3062
|
__param(1, (0, common_1.Param)('storyId')),
|
|
@@ -2870,6 +3083,7 @@ __decorate([
|
|
|
2870
3083
|
__metadata("design:returntype", Promise)
|
|
2871
3084
|
], AppController.prototype, "roomMessages", null);
|
|
2872
3085
|
__decorate([
|
|
3086
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2873
3087
|
(0, common_1.Sse)('balance/updates'),
|
|
2874
3088
|
__param(0, (0, common_1.Request)()),
|
|
2875
3089
|
__metadata("design:type", Function),
|
|
@@ -2877,6 +3091,7 @@ __decorate([
|
|
|
2877
3091
|
__metadata("design:returntype", rxjs_1.Observable)
|
|
2878
3092
|
], AppController.prototype, "balanceUpdates", null);
|
|
2879
3093
|
__decorate([
|
|
3094
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2880
3095
|
(0, common_1.Get)('balance'),
|
|
2881
3096
|
__param(0, (0, common_1.Request)()),
|
|
2882
3097
|
__metadata("design:type", Function),
|
|
@@ -2884,6 +3099,7 @@ __decorate([
|
|
|
2884
3099
|
__metadata("design:returntype", Promise)
|
|
2885
3100
|
], AppController.prototype, "getBalance", null);
|
|
2886
3101
|
__decorate([
|
|
3102
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2887
3103
|
(0, common_1.Get)('artifacts'),
|
|
2888
3104
|
__param(0, (0, common_1.Request)()),
|
|
2889
3105
|
__metadata("design:type", Function),
|
|
@@ -2891,6 +3107,7 @@ __decorate([
|
|
|
2891
3107
|
__metadata("design:returntype", Promise)
|
|
2892
3108
|
], AppController.prototype, "listArtifacts", null);
|
|
2893
3109
|
__decorate([
|
|
3110
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2894
3111
|
(0, common_1.Get)('artifacts/:artifactId'),
|
|
2895
3112
|
__param(0, (0, common_1.Request)()),
|
|
2896
3113
|
__param(1, (0, common_1.Param)('artifactId')),
|
|
@@ -2899,6 +3116,7 @@ __decorate([
|
|
|
2899
3116
|
__metadata("design:returntype", Promise)
|
|
2900
3117
|
], AppController.prototype, "getArtifact", null);
|
|
2901
3118
|
__decorate([
|
|
3119
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2902
3120
|
(0, common_1.Post)('artifacts'),
|
|
2903
3121
|
(0, common_1.UseInterceptors)((0, platform_express_1.FileInterceptor)('file')),
|
|
2904
3122
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2909,6 +3127,7 @@ __decorate([
|
|
|
2909
3127
|
__metadata("design:returntype", Promise)
|
|
2910
3128
|
], AppController.prototype, "createArtifact", null);
|
|
2911
3129
|
__decorate([
|
|
3130
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2912
3131
|
(0, common_1.Put)('artifacts/:artifactId'),
|
|
2913
3132
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2914
3133
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2919,6 +3138,7 @@ __decorate([
|
|
|
2919
3138
|
__metadata("design:returntype", Promise)
|
|
2920
3139
|
], AppController.prototype, "updateArtifact", null);
|
|
2921
3140
|
__decorate([
|
|
3141
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2922
3142
|
(0, common_1.Put)('artifacts/:artifactId/rename'),
|
|
2923
3143
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2924
3144
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2929,6 +3149,7 @@ __decorate([
|
|
|
2929
3149
|
__metadata("design:returntype", Promise)
|
|
2930
3150
|
], AppController.prototype, "renameArtifact", null);
|
|
2931
3151
|
__decorate([
|
|
3152
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2932
3153
|
(0, common_1.Delete)('artifacts/:artifactId'),
|
|
2933
3154
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2934
3155
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2938,6 +3159,7 @@ __decorate([
|
|
|
2938
3159
|
__metadata("design:returntype", Promise)
|
|
2939
3160
|
], AppController.prototype, "deleteArtifact", null);
|
|
2940
3161
|
__decorate([
|
|
3162
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2941
3163
|
(0, common_1.Get)('agents/:agentId/artifacts'),
|
|
2942
3164
|
__param(0, (0, common_1.Request)()),
|
|
2943
3165
|
__param(1, (0, common_1.Param)('agentId')),
|
|
@@ -2946,6 +3168,7 @@ __decorate([
|
|
|
2946
3168
|
__metadata("design:returntype", Promise)
|
|
2947
3169
|
], AppController.prototype, "listAgentArtifacts", null);
|
|
2948
3170
|
__decorate([
|
|
3171
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2949
3172
|
(0, common_1.Post)('agents/:agentId/artifacts'),
|
|
2950
3173
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2951
3174
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2956,6 +3179,7 @@ __decorate([
|
|
|
2956
3179
|
__metadata("design:returntype", Promise)
|
|
2957
3180
|
], AppController.prototype, "attachArtifactToAgent", null);
|
|
2958
3181
|
__decorate([
|
|
3182
|
+
(0, owner_only_decorator_1.OwnerOnly)(),
|
|
2959
3183
|
(0, common_1.Delete)('agents/:agentId/artifacts/:artifactId'),
|
|
2960
3184
|
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
2961
3185
|
__param(0, (0, common_1.Request)()),
|
|
@@ -2965,7 +3189,7 @@ __decorate([
|
|
|
2965
3189
|
__metadata("design:paramtypes", [Object, String, String]),
|
|
2966
3190
|
__metadata("design:returntype", Promise)
|
|
2967
3191
|
], AppController.prototype, "detachArtifactFromAgent", null);
|
|
2968
|
-
exports.AppController = AppController = __decorate([
|
|
3192
|
+
exports.AppController = AppController = AppController_1 = __decorate([
|
|
2969
3193
|
(0, common_1.Controller)('api'),
|
|
2970
3194
|
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
|
|
2971
3195
|
__metadata("design:paramtypes", [user_service_manager_1.UserServiceManager,
|