repoburg 1.3.134 → 1.3.136

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 (52) hide show
  1. package/.playwright-mcp/console-2026-05-14T23-58-12-858Z.log +28 -0
  2. package/.playwright-mcp/console-2026-05-15T00-15-00-760Z.log +81 -0
  3. package/.playwright-mcp/page-2026-05-14T23-58-13-064Z.yml +3 -0
  4. package/.playwright-mcp/page-2026-05-14T23-58-33-500Z.yml +1561 -0
  5. package/.playwright-mcp/page-2026-05-15T00-15-00-945Z.yml +3 -0
  6. package/backend/.env +2 -2
  7. package/backend/database.sqlite +0 -0
  8. package/backend/dist/src/core-entities/ai-action.entity.js +2 -1
  9. package/backend/dist/src/core-entities/ai-action.entity.js.map +1 -1
  10. package/backend/dist/src/core-entities/execution-log.entity.js +2 -1
  11. package/backend/dist/src/core-entities/execution-log.entity.js.map +1 -1
  12. package/backend/dist/src/llm-orchestration/action-handlers/manage-context-snippets.handler.d.ts +18 -0
  13. package/backend/dist/src/llm-orchestration/action-handlers/manage-context-snippets.handler.js +224 -0
  14. package/backend/dist/src/llm-orchestration/action-handlers/manage-context-snippets.handler.js.map +1 -0
  15. package/backend/dist/src/llm-orchestration/action-handlers/manage-context-templates.handler.d.ts +20 -0
  16. package/backend/dist/src/llm-orchestration/action-handlers/manage-context-templates.handler.js +309 -0
  17. package/backend/dist/src/llm-orchestration/action-handlers/manage-context-templates.handler.js.map +1 -0
  18. package/backend/dist/src/llm-orchestration/action-handlers/manage-custom-snippets.handler.d.ts +19 -0
  19. package/backend/dist/src/llm-orchestration/action-handlers/manage-custom-snippets.handler.js +249 -0
  20. package/backend/dist/src/llm-orchestration/action-handlers/manage-custom-snippets.handler.js.map +1 -0
  21. package/backend/dist/src/llm-orchestration/action-handlers/manage-custom-variables.handler.d.ts +17 -0
  22. package/backend/dist/src/llm-orchestration/action-handlers/manage-custom-variables.handler.js +227 -0
  23. package/backend/dist/src/llm-orchestration/action-handlers/manage-custom-variables.handler.js.map +1 -0
  24. package/backend/dist/src/llm-orchestration/action-handlers/manage-mcp-servers.handler.d.ts +18 -0
  25. package/backend/dist/src/llm-orchestration/action-handlers/manage-mcp-servers.handler.js +246 -0
  26. package/backend/dist/src/llm-orchestration/action-handlers/manage-mcp-servers.handler.js.map +1 -0
  27. package/backend/dist/src/llm-orchestration/action-handlers/manage-sub-agents.handler.d.ts +19 -0
  28. package/backend/dist/src/llm-orchestration/action-handlers/manage-sub-agents.handler.js +297 -0
  29. package/backend/dist/src/llm-orchestration/action-handlers/manage-sub-agents.handler.js.map +1 -0
  30. package/backend/dist/src/llm-orchestration/action-handlers/manage-system-prompts.handler.d.ts +27 -0
  31. package/backend/dist/src/llm-orchestration/action-handlers/manage-system-prompts.handler.js +493 -0
  32. package/backend/dist/src/llm-orchestration/action-handlers/manage-system-prompts.handler.js.map +1 -0
  33. package/backend/dist/src/llm-orchestration/action-handlers/manage-tool-hooks.handler.d.ts +20 -0
  34. package/backend/dist/src/llm-orchestration/action-handlers/manage-tool-hooks.handler.js +313 -0
  35. package/backend/dist/src/llm-orchestration/action-handlers/manage-tool-hooks.handler.js.map +1 -0
  36. package/backend/dist/src/llm-orchestration/llm-orchestration.module.js +41 -1
  37. package/backend/dist/src/llm-orchestration/llm-orchestration.module.js.map +1 -1
  38. package/backend/dist/src/llm-provider/ollama-llm.provider.js +2 -0
  39. package/backend/dist/src/llm-provider/ollama-llm.provider.js.map +1 -1
  40. package/backend/dist/src/seeding/data/sub-agents/config-manager.d.ts +4 -0
  41. package/backend/dist/src/seeding/data/sub-agents/config-manager.js +25 -0
  42. package/backend/dist/src/seeding/data/sub-agents/config-manager.js.map +1 -0
  43. package/backend/dist/src/seeding/data/system-prompts/config-manager-agent.d.ts +3 -0
  44. package/backend/dist/src/seeding/data/system-prompts/config-manager-agent.js +78 -0
  45. package/backend/dist/src/seeding/data/system-prompts/config-manager-agent.js.map +1 -0
  46. package/backend/dist/src/session-inputs/session-inputs.controller.d.ts +1 -0
  47. package/backend/dist/src/session-inputs/session-inputs.controller.js +22 -0
  48. package/backend/dist/src/session-inputs/session-inputs.controller.js.map +1 -1
  49. package/backend/dist/src/system-prompts/system-prompts.service.js +8 -0
  50. package/backend/dist/src/system-prompts/system-prompts.service.js.map +1 -1
  51. package/backend/dist/tsconfig.build.tsbuildinfo +1 -1
  52. package/package.json +1 -1
@@ -0,0 +1,246 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var ManageMcpServersHandler_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.ManageMcpServersHandler = void 0;
14
+ const common_1 = require("@nestjs/common");
15
+ const mcp_service_1 = require("../../mcp/mcp.service");
16
+ let ManageMcpServersHandler = ManageMcpServersHandler_1 = class ManageMcpServersHandler {
17
+ constructor(mcpService) {
18
+ this.mcpService = mcpService;
19
+ this.toolName = 'manage_mcp_servers';
20
+ this.logger = new common_1.Logger(ManageMcpServersHandler_1.name);
21
+ }
22
+ getMetadata() {
23
+ return {
24
+ name: this.toolName,
25
+ description: 'Manage RepoBurg MCP (Model Context Protocol) servers — external tool servers that provide additional capabilities to the AI.',
26
+ arguments: [
27
+ {
28
+ name: 'action',
29
+ type: 'string',
30
+ description: 'Operation: list|create|toggle_active|delete|toggle_tools',
31
+ required: true,
32
+ },
33
+ {
34
+ name: 'server_name',
35
+ type: 'string',
36
+ description: 'Name of the MCP server (required for toggle_active, delete)',
37
+ required: false,
38
+ },
39
+ {
40
+ name: 'config_json',
41
+ type: 'string',
42
+ description: 'JSON configuration for create action. Format: {"serverName": {"command": "...", "args": [...], "env": {...}}}',
43
+ required: false,
44
+ },
45
+ {
46
+ name: 'is_active',
47
+ type: 'boolean',
48
+ description: 'For toggle_active: true to activate, false to deactivate',
49
+ required: false,
50
+ },
51
+ {
52
+ name: 'tool_ids',
53
+ type: 'array',
54
+ description: 'For toggle_tools: array of MCP tool UUIDs to toggle',
55
+ required: false,
56
+ },
57
+ {
58
+ name: 'tools_active',
59
+ type: 'boolean',
60
+ description: 'For toggle_tools: whether to activate (true) or deactivate (false) the specified tools',
61
+ required: false,
62
+ },
63
+ ],
64
+ };
65
+ }
66
+ getDefinition() {
67
+ return `## manage_mcp_servers
68
+
69
+ Manage RepoBurg MCP (Model Context Protocol) servers — external tool servers that provide additional capabilities to the AI. Each MCP server exposes tools that become available as native tool definitions with the naming pattern \`serverName__toolName\`.
70
+
71
+ ### Actions:
72
+
73
+ - **list** — List all MCP servers with their tools and status
74
+ - **create** — Add a new MCP server. Provide \`config_json\` with the server configuration. Format: \`{"serverName": {"command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path"], "env": {}}}\`
75
+ - **toggle_active** — Activate or deactivate an MCP server. Provide \`server_name\` and \`is_active\` (boolean). Deactivating disconnects the server.
76
+ - **delete** — Remove an MCP server configuration. Provide \`server_name\`. Disconnects and removes the server and all its tools.
77
+ - **toggle_tools** — Batch enable/disable specific MCP tools. Provide \`tool_ids\` (array of tool UUIDs) and \`tools_active\` (boolean).
78
+
79
+ ### Parameters:
80
+ - **action** (required): Operation to perform
81
+ - **server_name** (optional): Name of the MCP server
82
+ - **config_json** (optional): JSON config string for create
83
+ - **is_active** (optional): Boolean for toggle_active
84
+ - **tool_ids** (optional): Array of tool UUIDs for toggle_tools
85
+ - **tools_active** (optional): Boolean for toggle_tools
86
+
87
+ ### Examples:
88
+
89
+ List all servers:
90
+ \`\`\`typescript
91
+ tool: manage_mcp_servers
92
+ args: { action: "list" }
93
+ \`\`\`
94
+
95
+ Add a filesystem server:
96
+ \`\`\`typescript
97
+ tool: manage_mcp_servers
98
+ args: { action: "create", config_json: '{"filesystem": {"command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/user/projects"], "env": {}}}' }
99
+ \`\`\`
100
+
101
+ Deactivate a server:
102
+ \`\`\`typescript
103
+ tool: manage_mcp_servers
104
+ args: { action: "toggle_active", server_name: "filesystem", is_active: false }
105
+ \`\`\``;
106
+ }
107
+ async execute(args, _context) {
108
+ const { action } = args;
109
+ try {
110
+ switch (action) {
111
+ case 'list':
112
+ return await this.handleList();
113
+ case 'create':
114
+ return await this.handleCreate(args.config_json);
115
+ case 'toggle_active':
116
+ return await this.handleToggleActive(args.server_name, args.is_active);
117
+ case 'delete':
118
+ return await this.handleDelete(args.server_name);
119
+ case 'toggle_tools':
120
+ return await this.handleToggleTools(args.tool_ids, args.tools_active);
121
+ default:
122
+ return {
123
+ status: 'FAILURE',
124
+ summary: `Unknown action "${action}". Valid actions: list, create, toggle_active, delete, toggle_tools`,
125
+ error_message: `Unknown action: ${action}`,
126
+ execution_log: {
127
+ output: '',
128
+ error_message: `Unknown action: ${action}`,
129
+ },
130
+ };
131
+ }
132
+ }
133
+ catch (error) {
134
+ this.logger.error(`manage_mcp_servers error: ${error.message}`, error.stack);
135
+ return {
136
+ status: 'FAILURE',
137
+ summary: `Failed to ${action} MCP server: ${error.message}`,
138
+ error_message: error.message,
139
+ execution_log: { output: '', error_message: error.message },
140
+ };
141
+ }
142
+ }
143
+ async handleList() {
144
+ const servers = await this.mcpService.getMcpServers();
145
+ return {
146
+ status: 'SUCCESS',
147
+ summary: `Found ${servers.length} MCP server(s).`,
148
+ execution_log: {
149
+ output: JSON.stringify(servers, null, 2),
150
+ error_message: '',
151
+ },
152
+ persisted_args: {},
153
+ };
154
+ }
155
+ async handleCreate(configJson) {
156
+ if (!configJson) {
157
+ return {
158
+ status: 'FAILURE',
159
+ summary: 'config_json is required for create action',
160
+ error_message: 'Missing config_json',
161
+ execution_log: { output: '', error_message: 'Missing config_json' },
162
+ };
163
+ }
164
+ const config = await this.mcpService.createMcpConfig(configJson);
165
+ const result = {
166
+ server_name: config.server_name,
167
+ command: config.command,
168
+ is_active: config.is_active,
169
+ };
170
+ return {
171
+ status: 'SUCCESS',
172
+ summary: `MCP server "${config.server_name}" created and connected`,
173
+ execution_log: {
174
+ output: JSON.stringify(result, null, 2),
175
+ error_message: '',
176
+ },
177
+ persisted_args: {},
178
+ };
179
+ }
180
+ async handleToggleActive(serverName, isActive) {
181
+ if (!serverName || isActive === undefined || isActive === null) {
182
+ return {
183
+ status: 'FAILURE',
184
+ summary: 'server_name and is_active are required for toggle_active action',
185
+ error_message: 'Missing parameters',
186
+ execution_log: { output: '', error_message: 'Missing parameters' },
187
+ };
188
+ }
189
+ const config = await this.mcpService.updateMcpConfigStatus(serverName, isActive);
190
+ return {
191
+ status: 'SUCCESS',
192
+ summary: `MCP server "${serverName}" ${isActive ? 'activated' : 'deactivated'}`,
193
+ execution_log: {
194
+ output: JSON.stringify({ server_name: config.server_name, is_active: config.is_active }, null, 2),
195
+ error_message: '',
196
+ },
197
+ persisted_args: {},
198
+ };
199
+ }
200
+ async handleDelete(serverName) {
201
+ if (!serverName) {
202
+ return {
203
+ status: 'FAILURE',
204
+ summary: 'server_name is required for delete action',
205
+ error_message: 'Missing server_name',
206
+ execution_log: { output: '', error_message: 'Missing server_name' },
207
+ };
208
+ }
209
+ await this.mcpService.deleteMcpConfig(serverName);
210
+ return {
211
+ status: 'SUCCESS',
212
+ summary: `MCP server "${serverName}" deleted`,
213
+ execution_log: {
214
+ output: JSON.stringify({ deleted: true, server_name: serverName }),
215
+ error_message: '',
216
+ },
217
+ persisted_args: {},
218
+ };
219
+ }
220
+ async handleToggleTools(toolIds, toolsActive) {
221
+ if (!toolIds || !Array.isArray(toolIds) || toolIds.length === 0) {
222
+ return {
223
+ status: 'FAILURE',
224
+ summary: 'tool_ids (non-empty array) and tools_active are required for toggle_tools action',
225
+ error_message: 'Missing parameters',
226
+ execution_log: { output: '', error_message: 'Missing parameters' },
227
+ };
228
+ }
229
+ const result = await this.mcpService.batchUpdateToolStatus(toolIds, toolsActive);
230
+ return {
231
+ status: 'SUCCESS',
232
+ summary: `${toolsActive ? 'Activated' : 'Deactivated'} ${result.affected} MCP tool(s)`,
233
+ execution_log: {
234
+ output: JSON.stringify(result, null, 2),
235
+ error_message: '',
236
+ },
237
+ persisted_args: {},
238
+ };
239
+ }
240
+ };
241
+ exports.ManageMcpServersHandler = ManageMcpServersHandler;
242
+ exports.ManageMcpServersHandler = ManageMcpServersHandler = ManageMcpServersHandler_1 = __decorate([
243
+ (0, common_1.Injectable)(),
244
+ __metadata("design:paramtypes", [mcp_service_1.McpService])
245
+ ], ManageMcpServersHandler);
246
+ //# sourceMappingURL=manage-mcp-servers.handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manage-mcp-servers.handler.js","sourceRoot":"","sources":["../../../../src/llm-orchestration/action-handlers/manage-mcp-servers.handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AAQpD,uDAAmD;AAU5C,IAAM,uBAAuB,+BAA7B,MAAM,uBAAuB;IAIlC,YAA6B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;QAH1C,aAAQ,GAAG,oBAAoB,CAAC;QACxB,WAAM,GAAG,IAAI,eAAM,CAAC,yBAAuB,CAAC,IAAI,CAAC,CAAC;IAEb,CAAC;IAEvD,WAAW;QACT,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,QAAQ;YACnB,WAAW,EACT,8HAA8H;YAChI,SAAS,EAAE;gBACT;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,QAAiB;oBACvB,WAAW,EACT,0DAA0D;oBAC5D,QAAQ,EAAE,IAAI;iBACf;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C,qBAAqB,CACxD,OAAO,EACP,WAAW,CACZ,CAAC;QACF,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,IAAI,MAAM,CAAC,QAAQ,cAAc;YACtF,aAAa,EAAE;gBACb,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;gBACvC,aAAa,EAAE,EAAE;aAClB;YACD,cAAc,EAAE,EAAE;SACnB,CAAC;IACJ,CAAC;CACF,CAAA;AA5QY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,mBAAU,GAAE;qCAK8B,wBAAU;GAJxC,uBAAuB,CA4QnC"}
@@ -0,0 +1,19 @@
1
+ import { ActionHandler } from './action-handler.interface';
2
+ import { ActionExecutionResult, PlanExecutionContext, ToolMetadata } from '../llm-orchestration.interfaces';
3
+ import { SubAgentsService } from '../../sub-agents/sub-agents.service';
4
+ export type SubAgentAction = 'list' | 'get' | 'create' | 'update' | 'delete' | 'duplicate';
5
+ export declare class ManageSubAgentsHandler implements ActionHandler {
6
+ private readonly subAgentsService;
7
+ readonly toolName = "manage_sub_agents";
8
+ private readonly logger;
9
+ constructor(subAgentsService: SubAgentsService);
10
+ getMetadata(): ToolMetadata;
11
+ getDefinition(): string;
12
+ execute(args: Record<string, any>, _context: PlanExecutionContext): Promise<ActionExecutionResult>;
13
+ private handleList;
14
+ private handleGet;
15
+ private handleCreate;
16
+ private handleUpdate;
17
+ private handleDelete;
18
+ private handleDuplicate;
19
+ }
@@ -0,0 +1,297 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var ManageSubAgentsHandler_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.ManageSubAgentsHandler = void 0;
14
+ const common_1 = require("@nestjs/common");
15
+ const sub_agents_service_1 = require("../../sub-agents/sub-agents.service");
16
+ let ManageSubAgentsHandler = ManageSubAgentsHandler_1 = class ManageSubAgentsHandler {
17
+ constructor(subAgentsService) {
18
+ this.subAgentsService = subAgentsService;
19
+ this.toolName = 'manage_sub_agents';
20
+ this.logger = new common_1.Logger(ManageSubAgentsHandler_1.name);
21
+ }
22
+ getMetadata() {
23
+ return {
24
+ name: this.toolName,
25
+ description: 'Manage RepoBurg sub-agents — specialized agent configurations with their own system prompt, context templates, and enabled tools.',
26
+ arguments: [
27
+ {
28
+ name: 'action',
29
+ type: 'string',
30
+ description: 'Operation: list|get|create|update|delete|duplicate',
31
+ required: true,
32
+ },
33
+ {
34
+ name: 'id',
35
+ type: 'string',
36
+ description: 'UUID of the sub-agent (required for get/update/delete/duplicate)',
37
+ required: false,
38
+ },
39
+ {
40
+ name: 'data',
41
+ type: 'object',
42
+ description: 'Fields for create/update. Keys: name (required), description, system_prompt_id, context_template_id, followup_context_template_id, enabled_tools (array|null|"all"), enabled_mcp_tools (array|"all"|null), is_active, model_id.',
43
+ required: false,
44
+ },
45
+ ],
46
+ };
47
+ }
48
+ getDefinition() {
49
+ return `## manage_sub_agents
50
+
51
+ Manage RepoBurg sub-agents — specialized agent configurations with their own system prompt, context templates, and enabled tools. Sub-agents are used by the invoke_subagent tool to delegate specialized tasks.
52
+
53
+ ### Actions:
54
+
55
+ - **list** — List all sub-agents (returns id, name, description, is_active, model_id, is_builtin)
56
+ - **get** — Get full details of a sub-agent by ID
57
+ - **create** — Create a new sub-agent. Provide \`data\` with: name (required), description, system_prompt_id, context_template_id, followup_context_template_id, enabled_tools (array of tool names, null for all), enabled_mcp_tools (array of serverName__toolName, "all", or null), is_active (default true), model_id
58
+ - **update** — Update a sub-agent. Provide \`id\` and \`data\` with fields to change. Built-in sub-agents can only change is_active and model_id.
59
+ - **delete** — Delete a sub-agent by ID
60
+ - **duplicate** — Duplicate a sub-agent by ID (works for built-in too). Returns the new copy.
61
+
62
+ ### Parameters:
63
+ - **action** (required): Operation to perform
64
+ - **id** (optional): UUID of the sub-agent
65
+ - **data** (optional): Object with sub-agent fields
66
+
67
+ ### Examples:
68
+
69
+ List all sub-agents:
70
+ \`\`\`typescript
71
+ tool: manage_sub_agents
72
+ args: { action: "list" }
73
+ \`\`\`
74
+
75
+ Create a sub-agent:
76
+ \`\`\`typescript
77
+ tool: manage_sub_agents
78
+ args: { action: "create", data: { name: "Bug Fixer", description: "Specialized in fixing bugs", enabled_tools: ["create_file", "overwrite_file", "delete_file", "request_context", "run_command"], model_id: "gemini-2.0-flash" } }
79
+ \`\`\`
80
+
81
+ Update a sub-agent's active status:
82
+ \`\`\`typescript
83
+ tool: manage_sub_agents
84
+ args: { action: "update", id: "uuid-here", data: { is_active: false } }
85
+ \`\`\``;
86
+ }
87
+ async execute(args, _context) {
88
+ const { action } = args;
89
+ try {
90
+ switch (action) {
91
+ case 'list':
92
+ return await this.handleList();
93
+ case 'get':
94
+ return await this.handleGet(args.id);
95
+ case 'create':
96
+ return await this.handleCreate(args.data);
97
+ case 'update':
98
+ return await this.handleUpdate(args.id, args.data);
99
+ case 'delete':
100
+ return await this.handleDelete(args.id);
101
+ case 'duplicate':
102
+ return await this.handleDuplicate(args.id);
103
+ default:
104
+ return {
105
+ status: 'FAILURE',
106
+ summary: `Unknown action "${action}". Valid actions: list, get, create, update, delete, duplicate`,
107
+ error_message: `Unknown action: ${action}`,
108
+ execution_log: {
109
+ output: '',
110
+ error_message: `Unknown action: ${action}`,
111
+ },
112
+ };
113
+ }
114
+ }
115
+ catch (error) {
116
+ this.logger.error(`manage_sub_agents error: ${error.message}`, error.stack);
117
+ return {
118
+ status: 'FAILURE',
119
+ summary: `Failed to ${action} sub-agent: ${error.message}`,
120
+ error_message: error.message,
121
+ execution_log: { output: '', error_message: error.message },
122
+ };
123
+ }
124
+ }
125
+ async handleList() {
126
+ const subAgents = await this.subAgentsService.findAll();
127
+ const summary = subAgents.map((a) => ({
128
+ id: a.id,
129
+ name: a.name,
130
+ description: a.description,
131
+ is_active: a.is_active,
132
+ model_id: a.model_id,
133
+ is_builtin: a.is_builtin,
134
+ builtin_key: a.builtin_key,
135
+ system_prompt_id: a.system_prompt_id,
136
+ context_template_id: a.context_template_id,
137
+ followup_context_template_id: a.followup_context_template_id,
138
+ enabled_tools: a.enabled_tools,
139
+ enabled_mcp_tools: a.enabled_mcp_tools,
140
+ }));
141
+ return {
142
+ status: 'SUCCESS',
143
+ summary: `Found ${subAgents.length} sub-agent(s).`,
144
+ execution_log: {
145
+ output: JSON.stringify(summary, null, 2),
146
+ error_message: '',
147
+ },
148
+ persisted_args: {},
149
+ };
150
+ }
151
+ async handleGet(id) {
152
+ if (!id) {
153
+ return {
154
+ status: 'FAILURE',
155
+ summary: 'id is required for get action',
156
+ error_message: 'Missing id',
157
+ execution_log: { output: '', error_message: 'Missing id' },
158
+ };
159
+ }
160
+ const subAgent = await this.subAgentsService.findOne(id);
161
+ return {
162
+ status: 'SUCCESS',
163
+ summary: `Sub-agent "${subAgent.name}"`,
164
+ execution_log: {
165
+ output: JSON.stringify(subAgent, null, 2),
166
+ error_message: '',
167
+ },
168
+ persisted_args: {},
169
+ };
170
+ }
171
+ async handleCreate(data) {
172
+ if (!data || !data.name) {
173
+ return {
174
+ status: 'FAILURE',
175
+ summary: 'data.name is required for create',
176
+ error_message: 'Missing required field: name',
177
+ execution_log: {
178
+ output: '',
179
+ error_message: 'Missing required field: name',
180
+ },
181
+ };
182
+ }
183
+ const createDto = {
184
+ name: data.name,
185
+ description: data.description ?? null,
186
+ system_prompt_id: data.system_prompt_id ?? null,
187
+ context_template_id: data.context_template_id ?? null,
188
+ followup_context_template_id: data.followup_context_template_id ?? null,
189
+ enabled_tools: data.enabled_tools ?? null,
190
+ enabled_mcp_tools: data.enabled_mcp_tools ?? null,
191
+ is_active: data.is_active ?? true,
192
+ model_id: data.model_id ?? null,
193
+ };
194
+ const subAgent = await this.subAgentsService.create(createDto);
195
+ const result = {
196
+ id: subAgent.id,
197
+ name: subAgent.name,
198
+ is_active: subAgent.is_active,
199
+ };
200
+ return {
201
+ status: 'SUCCESS',
202
+ summary: `Sub-agent "${subAgent.name}" created with ID ${subAgent.id}`,
203
+ execution_log: {
204
+ output: JSON.stringify(result, null, 2),
205
+ error_message: '',
206
+ },
207
+ persisted_args: {},
208
+ };
209
+ }
210
+ async handleUpdate(id, data) {
211
+ if (!id || !data) {
212
+ return {
213
+ status: 'FAILURE',
214
+ summary: 'id and data are required for update action',
215
+ error_message: 'Missing parameters',
216
+ execution_log: { output: '', error_message: 'Missing parameters' },
217
+ };
218
+ }
219
+ const updateDto = {};
220
+ const allowedFields = [
221
+ 'name',
222
+ 'description',
223
+ 'system_prompt_id',
224
+ 'context_template_id',
225
+ 'followup_context_template_id',
226
+ 'enabled_tools',
227
+ 'enabled_mcp_tools',
228
+ 'is_active',
229
+ 'model_id',
230
+ ];
231
+ for (const key of allowedFields) {
232
+ if (data[key] !== undefined) {
233
+ updateDto[key] = data[key];
234
+ }
235
+ }
236
+ const subAgent = await this.subAgentsService.update(id, updateDto);
237
+ return {
238
+ status: 'SUCCESS',
239
+ summary: `Sub-agent "${subAgent.name}" updated`,
240
+ execution_log: {
241
+ output: JSON.stringify({
242
+ id: subAgent.id,
243
+ name: subAgent.name,
244
+ is_active: subAgent.is_active,
245
+ }, null, 2),
246
+ error_message: '',
247
+ },
248
+ persisted_args: {},
249
+ };
250
+ }
251
+ async handleDelete(id) {
252
+ if (!id) {
253
+ return {
254
+ status: 'FAILURE',
255
+ summary: 'id is required for delete action',
256
+ error_message: 'Missing id',
257
+ execution_log: { output: '', error_message: 'Missing id' },
258
+ };
259
+ }
260
+ await this.subAgentsService.remove(id);
261
+ return {
262
+ status: 'SUCCESS',
263
+ summary: `Sub-agent ${id} deleted`,
264
+ execution_log: {
265
+ output: JSON.stringify({ deleted: true, id }),
266
+ error_message: '',
267
+ },
268
+ persisted_args: {},
269
+ };
270
+ }
271
+ async handleDuplicate(id) {
272
+ if (!id) {
273
+ return {
274
+ status: 'FAILURE',
275
+ summary: 'id is required for duplicate action',
276
+ error_message: 'Missing id',
277
+ execution_log: { output: '', error_message: 'Missing id' },
278
+ };
279
+ }
280
+ const subAgent = await this.subAgentsService.duplicate(id);
281
+ return {
282
+ status: 'SUCCESS',
283
+ summary: `Sub-agent duplicated as "${subAgent.name}"`,
284
+ execution_log: {
285
+ output: JSON.stringify({ id: subAgent.id, name: subAgent.name }, null, 2),
286
+ error_message: '',
287
+ },
288
+ persisted_args: {},
289
+ };
290
+ }
291
+ };
292
+ exports.ManageSubAgentsHandler = ManageSubAgentsHandler;
293
+ exports.ManageSubAgentsHandler = ManageSubAgentsHandler = ManageSubAgentsHandler_1 = __decorate([
294
+ (0, common_1.Injectable)(),
295
+ __metadata("design:paramtypes", [sub_agents_service_1.SubAgentsService])
296
+ ], ManageSubAgentsHandler);
297
+ //# sourceMappingURL=manage-sub-agents.handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manage-sub-agents.handler.js","sourceRoot":"","sources":["../../../../src/llm-orchestration/action-handlers/manage-sub-agents.handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AAQpD,4EAAuE;AAWhE,IAAM,sBAAsB,8BAA5B,MAAM,sBAAsB;IAIjC,YAA6B,gBAAkC;QAAlC,qBAAgB,GAAhB,gBAAgB,CAAkB;QAHtD,aAAQ,GAAG,mBAAmB,CAAC;QACvB,WAAM,G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js/core';
2
+ import { ActionHandler } from './action-handler.interface';
3
+ import { ActionExecutionResult, PlanExecutionContext, ToolMetadata } from '../llm-orchestration.interfaces';
4
+ export type SystemPromptAction = 'list' | 'get' | 'get_raw' | 'create' | 'update' | 'delete' | 'duplicate' | 'set_default' | 'set_enabled_tools' | 'set_enabled_mcp_tools' | 'toggle_tool' | 'toggle_mcp_tool' | 'preview';
5
+ export declare class ManageSystemPromptsHandler implements ActionHandler {
6
+ private readonly moduleRef;
7
+ readonly toolName = "manage_system_prompts";
8
+ private readonly logger;
9
+ constructor(moduleRef: ModuleRef);
10
+ private getSystemPromptsService;
11
+ getMetadata(): ToolMetadata;
12
+ getDefinition(): string;
13
+ execute(args: Record<string, any>, _context: PlanExecutionContext): Promise<ActionExecutionResult>;
14
+ private handleList;
15
+ private handleGetRaw;
16
+ private handleGet;
17
+ private handleCreate;
18
+ private handleUpdate;
19
+ private handleDelete;
20
+ private handleDuplicate;
21
+ private handleSetDefault;
22
+ private handleSetEnabledTools;
23
+ private handleSetEnabledMcpTools;
24
+ private handleToggleTool;
25
+ private handleToggleMcpTool;
26
+ private handlePreview;
27
+ }