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.
- package/.playwright-mcp/console-2026-05-14T23-58-12-858Z.log +28 -0
- package/.playwright-mcp/console-2026-05-15T00-15-00-760Z.log +81 -0
- package/.playwright-mcp/page-2026-05-14T23-58-13-064Z.yml +3 -0
- package/.playwright-mcp/page-2026-05-14T23-58-33-500Z.yml +1561 -0
- package/.playwright-mcp/page-2026-05-15T00-15-00-945Z.yml +3 -0
- package/backend/.env +2 -2
- package/backend/database.sqlite +0 -0
- package/backend/dist/src/core-entities/ai-action.entity.js +2 -1
- package/backend/dist/src/core-entities/ai-action.entity.js.map +1 -1
- package/backend/dist/src/core-entities/execution-log.entity.js +2 -1
- package/backend/dist/src/core-entities/execution-log.entity.js.map +1 -1
- package/backend/dist/src/llm-orchestration/action-handlers/manage-context-snippets.handler.d.ts +18 -0
- package/backend/dist/src/llm-orchestration/action-handlers/manage-context-snippets.handler.js +224 -0
- package/backend/dist/src/llm-orchestration/action-handlers/manage-context-snippets.handler.js.map +1 -0
- package/backend/dist/src/llm-orchestration/action-handlers/manage-context-templates.handler.d.ts +20 -0
- package/backend/dist/src/llm-orchestration/action-handlers/manage-context-templates.handler.js +309 -0
- package/backend/dist/src/llm-orchestration/action-handlers/manage-context-templates.handler.js.map +1 -0
- package/backend/dist/src/llm-orchestration/action-handlers/manage-custom-snippets.handler.d.ts +19 -0
- package/backend/dist/src/llm-orchestration/action-handlers/manage-custom-snippets.handler.js +249 -0
- package/backend/dist/src/llm-orchestration/action-handlers/manage-custom-snippets.handler.js.map +1 -0
- package/backend/dist/src/llm-orchestration/action-handlers/manage-custom-variables.handler.d.ts +17 -0
- package/backend/dist/src/llm-orchestration/action-handlers/manage-custom-variables.handler.js +227 -0
- package/backend/dist/src/llm-orchestration/action-handlers/manage-custom-variables.handler.js.map +1 -0
- package/backend/dist/src/llm-orchestration/action-handlers/manage-mcp-servers.handler.d.ts +18 -0
- package/backend/dist/src/llm-orchestration/action-handlers/manage-mcp-servers.handler.js +246 -0
- package/backend/dist/src/llm-orchestration/action-handlers/manage-mcp-servers.handler.js.map +1 -0
- package/backend/dist/src/llm-orchestration/action-handlers/manage-sub-agents.handler.d.ts +19 -0
- package/backend/dist/src/llm-orchestration/action-handlers/manage-sub-agents.handler.js +297 -0
- package/backend/dist/src/llm-orchestration/action-handlers/manage-sub-agents.handler.js.map +1 -0
- package/backend/dist/src/llm-orchestration/action-handlers/manage-system-prompts.handler.d.ts +27 -0
- package/backend/dist/src/llm-orchestration/action-handlers/manage-system-prompts.handler.js +493 -0
- package/backend/dist/src/llm-orchestration/action-handlers/manage-system-prompts.handler.js.map +1 -0
- package/backend/dist/src/llm-orchestration/action-handlers/manage-tool-hooks.handler.d.ts +20 -0
- package/backend/dist/src/llm-orchestration/action-handlers/manage-tool-hooks.handler.js +313 -0
- package/backend/dist/src/llm-orchestration/action-handlers/manage-tool-hooks.handler.js.map +1 -0
- package/backend/dist/src/llm-orchestration/llm-orchestration.module.js +41 -1
- package/backend/dist/src/llm-orchestration/llm-orchestration.module.js.map +1 -1
- package/backend/dist/src/llm-provider/ollama-llm.provider.js +2 -0
- package/backend/dist/src/llm-provider/ollama-llm.provider.js.map +1 -1
- package/backend/dist/src/seeding/data/sub-agents/config-manager.d.ts +4 -0
- package/backend/dist/src/seeding/data/sub-agents/config-manager.js +25 -0
- package/backend/dist/src/seeding/data/sub-agents/config-manager.js.map +1 -0
- package/backend/dist/src/seeding/data/system-prompts/config-manager-agent.d.ts +3 -0
- package/backend/dist/src/seeding/data/system-prompts/config-manager-agent.js +78 -0
- package/backend/dist/src/seeding/data/system-prompts/config-manager-agent.js.map +1 -0
- package/backend/dist/src/session-inputs/session-inputs.controller.d.ts +1 -0
- package/backend/dist/src/session-inputs/session-inputs.controller.js +22 -0
- package/backend/dist/src/session-inputs/session-inputs.controller.js.map +1 -1
- package/backend/dist/src/system-prompts/system-prompts.service.js +8 -0
- package/backend/dist/src/system-prompts/system-prompts.service.js.map +1 -1
- package/backend/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,493 @@
|
|
|
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 ManageSystemPromptsHandler_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.ManageSystemPromptsHandler = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const core_1 = require("@nestjs/core");
|
|
16
|
+
const system_prompts_service_1 = require("../../system-prompts/system-prompts.service");
|
|
17
|
+
let ManageSystemPromptsHandler = ManageSystemPromptsHandler_1 = class ManageSystemPromptsHandler {
|
|
18
|
+
constructor(moduleRef) {
|
|
19
|
+
this.moduleRef = moduleRef;
|
|
20
|
+
this.toolName = 'manage_system_prompts';
|
|
21
|
+
this.logger = new common_1.Logger(ManageSystemPromptsHandler_1.name);
|
|
22
|
+
}
|
|
23
|
+
getSystemPromptsService() {
|
|
24
|
+
return this.moduleRef.get(system_prompts_service_1.SystemPromptsService, { strict: false });
|
|
25
|
+
}
|
|
26
|
+
getMetadata() {
|
|
27
|
+
return {
|
|
28
|
+
name: this.toolName,
|
|
29
|
+
description: 'Manage RepoBurg system prompts — the AI behavior configurations that define how agents operate.',
|
|
30
|
+
arguments: [
|
|
31
|
+
{
|
|
32
|
+
name: 'action',
|
|
33
|
+
type: 'string',
|
|
34
|
+
description: 'Operation: list|get|get_raw|create|update|delete|duplicate|set_default|set_enabled_tools|set_enabled_mcp_tools|toggle_tool|toggle_mcp_tool|preview',
|
|
35
|
+
required: true,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'id',
|
|
39
|
+
type: 'string',
|
|
40
|
+
description: 'UUID of the system prompt (required for get/get_raw/update/delete/duplicate/set_default/toggle_tool/toggle_mcp_tool/preview)',
|
|
41
|
+
required: false,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'data',
|
|
45
|
+
type: 'object',
|
|
46
|
+
description: 'Fields for create/update. Keys: prompt_name, prompt_content (Eta template), is_default, url, followup_token_limit. For update, only include fields to change.',
|
|
47
|
+
required: false,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'enabled_tools',
|
|
51
|
+
type: 'array',
|
|
52
|
+
description: 'For set_enabled_tools: array of tool names or "all". Example: ["create_file","overwrite_file"] or "all"',
|
|
53
|
+
required: false,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'enabled_mcp_tools',
|
|
57
|
+
type: 'array',
|
|
58
|
+
description: 'For set_enabled_mcp_tools: array of serverName__toolName identifiers or "all". Example: ["playwright__browser_navigate"] or "all"',
|
|
59
|
+
required: false,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: 'tool_name',
|
|
63
|
+
type: 'string',
|
|
64
|
+
description: 'For toggle_tool/toggle_mcp_tool: the single tool name to toggle on/off',
|
|
65
|
+
required: false,
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
getDefinition() {
|
|
71
|
+
return `## manage_system_prompts
|
|
72
|
+
|
|
73
|
+
Manage RepoBurg system prompts — the AI behavior configurations that define how agents operate. Each prompt is an Eta template that gets rendered with tool definitions and variables before being sent to the LLM.
|
|
74
|
+
|
|
75
|
+
### Actions:
|
|
76
|
+
|
|
77
|
+
- **list** — List all system prompts (returns id, name, is_default, is_builtin, url)
|
|
78
|
+
- **get** — Get full details of a prompt by ID (rendered content with tools injected)
|
|
79
|
+
- **get_raw** — Get raw unrendered prompt content by ID
|
|
80
|
+
- **create** — Create a new system prompt. Provide \`data\` with fields: prompt_name (required), prompt_content (required), is_default, url, followup_token_limit
|
|
81
|
+
- **update** — Update an existing prompt. Provide \`id\` and \`data\` with fields to change. Built-in prompts cannot be updated.
|
|
82
|
+
- **delete** — Delete a prompt by ID. Built-in prompts cannot be deleted.
|
|
83
|
+
- **duplicate** — Duplicate a prompt by ID (works for built-in too). Returns the new copy.
|
|
84
|
+
- **set_default** — Set a prompt as the default for new sessions
|
|
85
|
+
- **set_enabled_tools** — Set which native tools a prompt allows. Provide \`id\` and \`enabled_tools\` (array of tool names or "all")
|
|
86
|
+
- **set_enabled_mcp_tools** — Set which MCP tools a prompt allows. Provide \`id\` and \`enabled_mcp_tools\` (array or "all")
|
|
87
|
+
- **toggle_tool** — Toggle a single native tool on/off for a prompt. Provide \`id\` and \`tool_name\`
|
|
88
|
+
- **toggle_mcp_tool** — Toggle a single MCP tool on/off for a prompt. Provide \`id\` and \`tool_name\`
|
|
89
|
+
- **preview** — Render a prompt content string with tools injected (no ID needed, provide \`data.prompt_content\`)
|
|
90
|
+
|
|
91
|
+
### Parameters:
|
|
92
|
+
- **action** (required): Operation to perform
|
|
93
|
+
- **id** (optional): UUID of the system prompt
|
|
94
|
+
- **data** (optional): Object with prompt fields for create/update
|
|
95
|
+
- **enabled_tools** (optional): Tool names array or "all" for set_enabled_tools
|
|
96
|
+
- **enabled_mcp_tools** (optional): MCP tool identifiers or "all" for set_enabled_mcp_tools
|
|
97
|
+
- **tool_name** (optional): Single tool name for toggle operations
|
|
98
|
+
|
|
99
|
+
### Examples:
|
|
100
|
+
|
|
101
|
+
List all prompts:
|
|
102
|
+
\`\`\`typescript
|
|
103
|
+
tool: manage_system_prompts
|
|
104
|
+
args: { action: "list" }
|
|
105
|
+
\`\`\`
|
|
106
|
+
|
|
107
|
+
Create a new prompt:
|
|
108
|
+
\`\`typescript
|
|
109
|
+
tool: manage_system_prompts
|
|
110
|
+
args: { action: "create", data: { prompt_name: "Code Reviewer", prompt_content: "You are a code reviewer...", followup_token_limit: 8000 } }
|
|
111
|
+
\`\`\`
|
|
112
|
+
|
|
113
|
+
Enable specific tools:
|
|
114
|
+
\`\`typescript
|
|
115
|
+
tool: manage_system_prompts
|
|
116
|
+
args: { action: "set_enabled_tools", id: "uuid-here", enabled_tools: ["create_file", "overwrite_file", "delete_file", "request_context"] }
|
|
117
|
+
\`\`\``;
|
|
118
|
+
}
|
|
119
|
+
async execute(args, _context) {
|
|
120
|
+
const { action } = args;
|
|
121
|
+
const systemPromptsService = this.getSystemPromptsService();
|
|
122
|
+
try {
|
|
123
|
+
switch (action) {
|
|
124
|
+
case 'list':
|
|
125
|
+
return await this.handleList(systemPromptsService);
|
|
126
|
+
case 'get':
|
|
127
|
+
return await this.handleGet(systemPromptsService, args.id);
|
|
128
|
+
case 'get_raw':
|
|
129
|
+
return await this.handleGetRaw(systemPromptsService, args.id);
|
|
130
|
+
case 'create':
|
|
131
|
+
return await this.handleCreate(systemPromptsService, args.data);
|
|
132
|
+
case 'update':
|
|
133
|
+
return await this.handleUpdate(systemPromptsService, args.id, args.data);
|
|
134
|
+
case 'delete':
|
|
135
|
+
return await this.handleDelete(systemPromptsService, args.id);
|
|
136
|
+
case 'duplicate':
|
|
137
|
+
return await this.handleDuplicate(systemPromptsService, args.id);
|
|
138
|
+
case 'set_default':
|
|
139
|
+
return await this.handleSetDefault(systemPromptsService, args.id);
|
|
140
|
+
case 'set_enabled_tools':
|
|
141
|
+
return await this.handleSetEnabledTools(systemPromptsService, args.id, args.enabled_tools);
|
|
142
|
+
case 'set_enabled_mcp_tools':
|
|
143
|
+
return await this.handleSetEnabledMcpTools(systemPromptsService, args.id, args.enabled_mcp_tools);
|
|
144
|
+
case 'toggle_tool':
|
|
145
|
+
return await this.handleToggleTool(systemPromptsService, args.id, args.tool_name);
|
|
146
|
+
case 'toggle_mcp_tool':
|
|
147
|
+
return await this.handleToggleMcpTool(systemPromptsService, args.id, args.tool_name);
|
|
148
|
+
case 'preview':
|
|
149
|
+
return await this.handlePreview(systemPromptsService, args.data);
|
|
150
|
+
default:
|
|
151
|
+
return {
|
|
152
|
+
status: 'FAILURE',
|
|
153
|
+
summary: `Unknown action "${action}". Valid actions: list, get, get_raw, create, update, delete, duplicate, set_default, set_enabled_tools, set_enabled_mcp_tools, toggle_tool, toggle_mcp_tool, preview`,
|
|
154
|
+
error_message: `Unknown action: ${action}`,
|
|
155
|
+
execution_log: {
|
|
156
|
+
output: '',
|
|
157
|
+
error_message: `Unknown action: ${action}`,
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
this.logger.error(`manage_system_prompts error: ${error.message}`, error.stack);
|
|
164
|
+
return {
|
|
165
|
+
status: 'FAILURE',
|
|
166
|
+
summary: `Failed to ${action} system prompt: ${error.message}`,
|
|
167
|
+
error_message: error.message,
|
|
168
|
+
execution_log: { output: '', error_message: error.message },
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
async handleList(service) {
|
|
173
|
+
const prompts = await service.findAll();
|
|
174
|
+
const summary = prompts.map((p) => ({
|
|
175
|
+
id: p.id,
|
|
176
|
+
prompt_name: p.prompt_name,
|
|
177
|
+
is_default: p.is_default,
|
|
178
|
+
is_builtin: p.is_builtin,
|
|
179
|
+
builtin_key: p.builtin_key,
|
|
180
|
+
url: p.url,
|
|
181
|
+
followup_token_limit: p.followup_token_limit,
|
|
182
|
+
}));
|
|
183
|
+
return {
|
|
184
|
+
status: 'SUCCESS',
|
|
185
|
+
summary: `Found ${prompts.length} system prompt(s).`,
|
|
186
|
+
execution_log: {
|
|
187
|
+
output: JSON.stringify(summary, null, 2),
|
|
188
|
+
error_message: '',
|
|
189
|
+
},
|
|
190
|
+
persisted_args: {},
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
async handleGetRaw(service, id) {
|
|
194
|
+
if (!id) {
|
|
195
|
+
return {
|
|
196
|
+
status: 'FAILURE',
|
|
197
|
+
summary: 'id is required for get_raw action',
|
|
198
|
+
error_message: 'Missing id',
|
|
199
|
+
execution_log: { output: '', error_message: 'Missing id' },
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
const prompt = await service.findOneRaw(id);
|
|
203
|
+
const result = {
|
|
204
|
+
id: prompt.id,
|
|
205
|
+
prompt_name: prompt.prompt_name,
|
|
206
|
+
prompt_content: prompt.prompt_content,
|
|
207
|
+
is_default: prompt.is_default,
|
|
208
|
+
is_builtin: prompt.is_builtin,
|
|
209
|
+
builtin_key: prompt.builtin_key,
|
|
210
|
+
url: prompt.url,
|
|
211
|
+
enabledTools: prompt.enabledTools,
|
|
212
|
+
enabledMcpTools: prompt.enabledMcpTools,
|
|
213
|
+
followup_token_limit: prompt.followup_token_limit,
|
|
214
|
+
};
|
|
215
|
+
return {
|
|
216
|
+
status: 'SUCCESS',
|
|
217
|
+
summary: `System prompt "${prompt.prompt_name}" (raw)`,
|
|
218
|
+
execution_log: {
|
|
219
|
+
output: JSON.stringify(result, null, 2),
|
|
220
|
+
error_message: '',
|
|
221
|
+
},
|
|
222
|
+
persisted_args: {},
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
async handleGet(service, id) {
|
|
226
|
+
if (!id) {
|
|
227
|
+
return {
|
|
228
|
+
status: 'FAILURE',
|
|
229
|
+
summary: 'id is required for get action',
|
|
230
|
+
error_message: 'Missing id',
|
|
231
|
+
execution_log: { output: '', error_message: 'Missing id' },
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
const prompt = await service.findOne(id);
|
|
235
|
+
const result = {
|
|
236
|
+
id: prompt.id,
|
|
237
|
+
prompt_name: prompt.prompt_name,
|
|
238
|
+
prompt_content: prompt.prompt_content,
|
|
239
|
+
is_default: prompt.is_default,
|
|
240
|
+
is_builtin: prompt.is_builtin,
|
|
241
|
+
builtin_key: prompt.builtin_key,
|
|
242
|
+
url: prompt.url,
|
|
243
|
+
enabledTools: prompt.enabledTools,
|
|
244
|
+
enabledMcpTools: prompt.enabledMcpTools,
|
|
245
|
+
followup_token_limit: prompt.followup_token_limit,
|
|
246
|
+
};
|
|
247
|
+
return {
|
|
248
|
+
status: 'SUCCESS',
|
|
249
|
+
summary: `System prompt "${prompt.prompt_name}"`,
|
|
250
|
+
execution_log: {
|
|
251
|
+
output: JSON.stringify(result, null, 2),
|
|
252
|
+
error_message: '',
|
|
253
|
+
},
|
|
254
|
+
persisted_args: {},
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
async handleCreate(service, data) {
|
|
258
|
+
if (!data || !data.prompt_name || !data.prompt_content) {
|
|
259
|
+
return {
|
|
260
|
+
status: 'FAILURE',
|
|
261
|
+
summary: 'data.prompt_name and data.prompt_content are required for create',
|
|
262
|
+
error_message: 'Missing required fields',
|
|
263
|
+
execution_log: { output: '', error_message: 'Missing required fields' },
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
const createDto = {
|
|
267
|
+
prompt_name: data.prompt_name,
|
|
268
|
+
prompt_content: data.prompt_content,
|
|
269
|
+
url: data.url,
|
|
270
|
+
followup_token_limit: data.followup_token_limit,
|
|
271
|
+
enabledTools: data.enabledTools,
|
|
272
|
+
enabledMcpTools: data.enabledMcpTools,
|
|
273
|
+
};
|
|
274
|
+
Object.keys(createDto).forEach((k) => createDto[k] === undefined && delete createDto[k]);
|
|
275
|
+
const prompt = await service.create(createDto);
|
|
276
|
+
const result = {
|
|
277
|
+
id: prompt.id,
|
|
278
|
+
prompt_name: prompt.prompt_name,
|
|
279
|
+
is_default: prompt.is_default,
|
|
280
|
+
};
|
|
281
|
+
return {
|
|
282
|
+
status: 'SUCCESS',
|
|
283
|
+
summary: `System prompt "${prompt.prompt_name}" created with ID ${prompt.id}`,
|
|
284
|
+
execution_log: {
|
|
285
|
+
output: JSON.stringify(result, null, 2),
|
|
286
|
+
error_message: '',
|
|
287
|
+
},
|
|
288
|
+
persisted_args: {},
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
async handleUpdate(service, id, data) {
|
|
292
|
+
if (!id || !data) {
|
|
293
|
+
return {
|
|
294
|
+
status: 'FAILURE',
|
|
295
|
+
summary: 'id and data are required for update action',
|
|
296
|
+
error_message: 'Missing parameters',
|
|
297
|
+
execution_log: { output: '', error_message: 'Missing parameters' },
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
const prompt = await service.update(id, data);
|
|
301
|
+
const result = {
|
|
302
|
+
id: prompt.id,
|
|
303
|
+
prompt_name: prompt.prompt_name,
|
|
304
|
+
is_default: prompt.is_default,
|
|
305
|
+
};
|
|
306
|
+
return {
|
|
307
|
+
status: 'SUCCESS',
|
|
308
|
+
summary: `System prompt "${prompt.prompt_name}" updated`,
|
|
309
|
+
execution_log: {
|
|
310
|
+
output: JSON.stringify(result, null, 2),
|
|
311
|
+
error_message: '',
|
|
312
|
+
},
|
|
313
|
+
persisted_args: {},
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
async handleDelete(service, id) {
|
|
317
|
+
if (!id) {
|
|
318
|
+
return {
|
|
319
|
+
status: 'FAILURE',
|
|
320
|
+
summary: 'id is required for delete action',
|
|
321
|
+
error_message: 'Missing id',
|
|
322
|
+
execution_log: { output: '', error_message: 'Missing id' },
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
await service.remove(id);
|
|
326
|
+
return {
|
|
327
|
+
status: 'SUCCESS',
|
|
328
|
+
summary: `System prompt ${id} deleted`,
|
|
329
|
+
execution_log: {
|
|
330
|
+
output: JSON.stringify({ deleted: true, id }),
|
|
331
|
+
error_message: '',
|
|
332
|
+
},
|
|
333
|
+
persisted_args: {},
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
async handleDuplicate(service, id) {
|
|
337
|
+
if (!id) {
|
|
338
|
+
return {
|
|
339
|
+
status: 'FAILURE',
|
|
340
|
+
summary: 'id is required for duplicate action',
|
|
341
|
+
error_message: 'Missing id',
|
|
342
|
+
execution_log: { output: '', error_message: 'Missing id' },
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
const prompt = await service.duplicate(id);
|
|
346
|
+
const result = {
|
|
347
|
+
id: prompt.id,
|
|
348
|
+
prompt_name: prompt.prompt_name,
|
|
349
|
+
is_default: prompt.is_default,
|
|
350
|
+
};
|
|
351
|
+
return {
|
|
352
|
+
status: 'SUCCESS',
|
|
353
|
+
summary: `System prompt duplicated as "${prompt.prompt_name}"`,
|
|
354
|
+
execution_log: {
|
|
355
|
+
output: JSON.stringify(result, null, 2),
|
|
356
|
+
error_message: '',
|
|
357
|
+
},
|
|
358
|
+
persisted_args: {},
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
async handleSetDefault(service, id) {
|
|
362
|
+
if (!id) {
|
|
363
|
+
return {
|
|
364
|
+
status: 'FAILURE',
|
|
365
|
+
summary: 'id is required for set_default action',
|
|
366
|
+
error_message: 'Missing id',
|
|
367
|
+
execution_log: { output: '', error_message: 'Missing id' },
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
const prompt = await service.setDefault(id);
|
|
371
|
+
return {
|
|
372
|
+
status: 'SUCCESS',
|
|
373
|
+
summary: `System prompt "${prompt.prompt_name}" set as default`,
|
|
374
|
+
execution_log: {
|
|
375
|
+
output: JSON.stringify({
|
|
376
|
+
id: prompt.id,
|
|
377
|
+
prompt_name: prompt.prompt_name,
|
|
378
|
+
is_default: true,
|
|
379
|
+
}),
|
|
380
|
+
error_message: '',
|
|
381
|
+
},
|
|
382
|
+
persisted_args: {},
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
async handleSetEnabledTools(service, id, enabledTools) {
|
|
386
|
+
if (!id) {
|
|
387
|
+
return {
|
|
388
|
+
status: 'FAILURE',
|
|
389
|
+
summary: 'id is required for set_enabled_tools action',
|
|
390
|
+
error_message: 'Missing id',
|
|
391
|
+
execution_log: { output: '', error_message: 'Missing id' },
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
const result = await service.setEnabledTools(id, enabledTools);
|
|
395
|
+
return {
|
|
396
|
+
status: 'SUCCESS',
|
|
397
|
+
summary: `Enabled tools updated for system prompt ${id}`,
|
|
398
|
+
execution_log: {
|
|
399
|
+
output: JSON.stringify(result, null, 2),
|
|
400
|
+
error_message: '',
|
|
401
|
+
},
|
|
402
|
+
persisted_args: {},
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
async handleSetEnabledMcpTools(service, id, enabledMcpTools) {
|
|
406
|
+
if (!id) {
|
|
407
|
+
return {
|
|
408
|
+
status: 'FAILURE',
|
|
409
|
+
summary: 'id is required for set_enabled_mcp_tools action',
|
|
410
|
+
error_message: 'Missing id',
|
|
411
|
+
execution_log: { output: '', error_message: 'Missing id' },
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
const result = await service.setEnabledMcpTools(id, enabledMcpTools);
|
|
415
|
+
return {
|
|
416
|
+
status: 'SUCCESS',
|
|
417
|
+
summary: `Enabled MCP tools updated for system prompt ${id}`,
|
|
418
|
+
execution_log: {
|
|
419
|
+
output: JSON.stringify(result, null, 2),
|
|
420
|
+
error_message: '',
|
|
421
|
+
},
|
|
422
|
+
persisted_args: {},
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
async handleToggleTool(service, id, toolName) {
|
|
426
|
+
if (!id || !toolName) {
|
|
427
|
+
return {
|
|
428
|
+
status: 'FAILURE',
|
|
429
|
+
summary: 'id and tool_name are required for toggle_tool action',
|
|
430
|
+
error_message: 'Missing parameters',
|
|
431
|
+
execution_log: { output: '', error_message: 'Missing parameters' },
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
const result = await service.toggleTool(id, toolName);
|
|
435
|
+
return {
|
|
436
|
+
status: 'SUCCESS',
|
|
437
|
+
summary: `Tool "${toolName}" toggled for system prompt ${id}`,
|
|
438
|
+
execution_log: {
|
|
439
|
+
output: JSON.stringify(result, null, 2),
|
|
440
|
+
error_message: '',
|
|
441
|
+
},
|
|
442
|
+
persisted_args: {},
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
async handleToggleMcpTool(service, id, mcpToolName) {
|
|
446
|
+
if (!id || !mcpToolName) {
|
|
447
|
+
return {
|
|
448
|
+
status: 'FAILURE',
|
|
449
|
+
summary: 'id and tool_name are required for toggle_mcp_tool action',
|
|
450
|
+
error_message: 'Missing parameters',
|
|
451
|
+
execution_log: { output: '', error_message: 'Missing parameters' },
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
const result = await service.toggleMcpTool(id, mcpToolName);
|
|
455
|
+
return {
|
|
456
|
+
status: 'SUCCESS',
|
|
457
|
+
summary: `MCP tool "${mcpToolName}" toggled for system prompt ${id}`,
|
|
458
|
+
execution_log: {
|
|
459
|
+
output: JSON.stringify(result, null, 2),
|
|
460
|
+
error_message: '',
|
|
461
|
+
},
|
|
462
|
+
persisted_args: {},
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
async handlePreview(service, data) {
|
|
466
|
+
if (!data || !data.prompt_content) {
|
|
467
|
+
return {
|
|
468
|
+
status: 'FAILURE',
|
|
469
|
+
summary: 'data.prompt_content is required for preview action',
|
|
470
|
+
error_message: 'Missing prompt_content',
|
|
471
|
+
execution_log: { output: '', error_message: 'Missing prompt_content' },
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
const result = await service.preview({
|
|
475
|
+
prompt_content: data.prompt_content,
|
|
476
|
+
});
|
|
477
|
+
return {
|
|
478
|
+
status: 'SUCCESS',
|
|
479
|
+
summary: 'Preview rendered successfully',
|
|
480
|
+
execution_log: {
|
|
481
|
+
output: JSON.stringify(result, null, 2),
|
|
482
|
+
error_message: '',
|
|
483
|
+
},
|
|
484
|
+
persisted_args: {},
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
exports.ManageSystemPromptsHandler = ManageSystemPromptsHandler;
|
|
489
|
+
exports.ManageSystemPromptsHandler = ManageSystemPromptsHandler = ManageSystemPromptsHandler_1 = __decorate([
|
|
490
|
+
(0, common_1.Injectable)(),
|
|
491
|
+
__metadata("design:paramtypes", [core_1.ModuleRef])
|
|
492
|
+
], ManageSystemPromptsHandler);
|
|
493
|
+
//# sourceMappingURL=manage-system-prompts.handler.js.map
|
package/backend/dist/src/llm-orchestration/action-handlers/manage-system-prompts.handler.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manage-system-prompts.handler.js","sourceRoot":"","sources":["../../../../src/llm-orchestration/action-handlers/manage-system-prompts.handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,uCAAyC;AAQzC,wFAAmF;AAkB5E,IAAM,0BAA0B,kCAAhC,MAAM,0BAA0B;IAIrC,YAA6B,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;QAHxC,aAAQ,GAAG,uBAAuB,CAAC;QAC3B,WAAM,GAAG,IAAI,eAAM,CAAC,4BAA0B,CAAC,IAAI,CAAC,CAAC;IAElB,CAAC;IAM7C,uBAAuB;QAC7B,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,6CAAoB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,WAAW;QACT,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,QAAQ;YACnB,WAAW,EACT,iGAAiG;YACnG,SAAS,EAAE;gBACT;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,QAAiB;oBACvB,WAAW,EACT,oJAAoJ;oBACtJ,QAAQ,EAAE,IAAI;iBAC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pE,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;IAEO,KAAK,CAAC,aAAa,CACzB,OAA6B,EAC7B,IAAyB;QAEzB,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;YAClC,OAAO;gBACL,MAAM,EAAE,SAAS;gBACjB,OAAO,EAAE,oDAAoD;gBAC7D,aAAa,EAAE,wBAAwB;gBACvC,aAAa,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,aAAa,EAAE,wBAAwB,EAAE;aACvE,CAAC;QACJ,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC;YACnC,cAAc,EAAE,IAAI,CAAC,cAAc;SACpC,CAAC,CAAC;QACH,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,+BAA+B;YACxC,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;AA1jBY,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,mBAAU,GAAE;qCAK6B,gBAAS;GAJtC,0BAA0B,CA0jBtC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ActionHandler } from './action-handler.interface';
|
|
2
|
+
import { ActionExecutionResult, PlanExecutionContext, ToolMetadata } from '../llm-orchestration.interfaces';
|
|
3
|
+
import { ToolHooksService } from '../../tool-hooks/tool-hooks.service';
|
|
4
|
+
export type ToolHookAction = 'list' | 'create' | 'update' | 'delete' | 'list_scripts' | 'create_script' | 'test';
|
|
5
|
+
export declare class ManageToolHooksHandler implements ActionHandler {
|
|
6
|
+
private readonly toolHooksService;
|
|
7
|
+
readonly toolName = "manage_tool_hooks";
|
|
8
|
+
private readonly logger;
|
|
9
|
+
constructor(toolHooksService: ToolHooksService);
|
|
10
|
+
getMetadata(): ToolMetadata;
|
|
11
|
+
getDefinition(): string;
|
|
12
|
+
execute(args: Record<string, any>, _context: PlanExecutionContext): Promise<ActionExecutionResult>;
|
|
13
|
+
private handleList;
|
|
14
|
+
private handleCreate;
|
|
15
|
+
private handleUpdate;
|
|
16
|
+
private handleDelete;
|
|
17
|
+
private handleListScripts;
|
|
18
|
+
private handleCreateScript;
|
|
19
|
+
private handleTest;
|
|
20
|
+
}
|