repoburg 1.3.250 → 1.3.252
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/agent-host-vscode-view.png +0 -0
- package/agent-pane/frontend/dist/assets/{index-CBTsbWig.js → index-DJs6YBDf.js} +108 -103
- package/agent-pane/frontend/dist/assets/{index-DNe6bagG.css → index-DUnfaPeK.css} +1 -1
- package/agent-pane/frontend/dist/index.html +2 -2
- package/backend/dist/bin/metadata-validate.ts +66 -31
- package/backend/dist/src/bin/metadata-validate.js +49 -26
- package/backend/dist/src/bin/metadata-validate.js.map +1 -1
- package/backend/dist/src/llm-orchestration/llm-orchestration.module.js +1 -37
- package/backend/dist/src/llm-orchestration/llm-orchestration.module.js.map +1 -1
- package/backend/dist/src/mcp/dto/batch-update-mcp-tools.dto.d.ts +1 -1
- package/backend/dist/src/mcp/dto/batch-update-mcp-tools.dto.js +3 -3
- package/backend/dist/src/mcp/dto/batch-update-mcp-tools.dto.js.map +1 -1
- package/backend/dist/src/mcp/mcp-tools.store.d.ts +56 -0
- package/backend/dist/src/mcp/mcp-tools.store.js +280 -0
- package/backend/dist/src/mcp/mcp-tools.store.js.map +1 -0
- package/backend/dist/src/mcp/mcp.controller.js +1 -1
- package/backend/dist/src/mcp/mcp.controller.js.map +1 -1
- package/backend/dist/src/mcp/mcp.module.js +2 -1
- package/backend/dist/src/mcp/mcp.module.js.map +1 -1
- package/backend/dist/src/mcp/mcp.service.d.ts +5 -3
- package/backend/dist/src/mcp/mcp.service.js +30 -73
- package/backend/dist/src/mcp/mcp.service.js.map +1 -1
- package/backend/dist/src/mcp-server/mcp-server.constants.js +0 -9
- package/backend/dist/src/mcp-server/mcp-server.constants.js.map +1 -1
- package/backend/dist/src/mcp-server/mcp-server.controller.js +1 -1
- package/backend/dist/src/mcp-server/mcp-server.controller.js.map +1 -1
- package/backend/dist/src/metadata-store/metadata-migration.d.ts +1 -0
- package/backend/dist/src/metadata-store/metadata-migration.js +54 -1
- package/backend/dist/src/metadata-store/metadata-migration.js.map +1 -1
- package/backend/dist/src/metadata-store/metadata-readme.d.ts +1 -1
- package/backend/dist/src/metadata-store/metadata-readme.js +1 -1
- package/backend/dist/src/metadata-store/metadata-store.module.js +0 -5
- package/backend/dist/src/metadata-store/metadata-store.module.js.map +1 -1
- package/backend/dist/src/metadata-store/schemas/metadata-schemas.d.ts +6 -2
- package/backend/dist/src/metadata-store/schemas/metadata-schemas.js +26 -12
- package/backend/dist/src/metadata-store/schemas/metadata-schemas.js.map +1 -1
- package/backend/dist/src/metadata-store/store-configs.d.ts +1 -2
- package/backend/dist/src/metadata-store/store-configs.js +1 -9
- package/backend/dist/src/metadata-store/store-configs.js.map +1 -1
- package/backend/dist/src/seeding/data/sub-agents/control-repoburg.js +4 -9
- package/backend/dist/src/seeding/data/sub-agents/control-repoburg.js.map +1 -1
- package/backend/dist/src/seeding/data/system-prompts/control-repoburg-agent.d.ts +1 -1
- package/backend/dist/src/seeding/data/system-prompts/control-repoburg-agent.js +45 -74
- package/backend/dist/src/seeding/data/system-prompts/control-repoburg-agent.js.map +1 -1
- package/backend/dist/src/seeding/data/system-prompts/default_native_tool_agent.js +0 -9
- package/backend/dist/src/seeding/data/system-prompts/default_native_tool_agent.js.map +1 -1
- package/backend/dist/src/system-prompts/system-prompts.service.js +0 -9
- 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
- package/vscode-view-check.png +0 -0
- package/backend/dist/src/llm-orchestration/action-handlers/manage-agents.handler.d.ts +0 -20
- package/backend/dist/src/llm-orchestration/action-handlers/manage-agents.handler.js +0 -336
- package/backend/dist/src/llm-orchestration/action-handlers/manage-agents.handler.js.map +0 -1
- package/backend/dist/src/llm-orchestration/action-handlers/manage-context-snippets.handler.d.ts +0 -18
- package/backend/dist/src/llm-orchestration/action-handlers/manage-context-snippets.handler.js +0 -237
- package/backend/dist/src/llm-orchestration/action-handlers/manage-context-snippets.handler.js.map +0 -1
- package/backend/dist/src/llm-orchestration/action-handlers/manage-context-templates.handler.d.ts +0 -20
- package/backend/dist/src/llm-orchestration/action-handlers/manage-context-templates.handler.js +0 -326
- package/backend/dist/src/llm-orchestration/action-handlers/manage-context-templates.handler.js.map +0 -1
- package/backend/dist/src/llm-orchestration/action-handlers/manage-custom-snippets.handler.d.ts +0 -19
- package/backend/dist/src/llm-orchestration/action-handlers/manage-custom-snippets.handler.js +0 -263
- package/backend/dist/src/llm-orchestration/action-handlers/manage-custom-snippets.handler.js.map +0 -1
- package/backend/dist/src/llm-orchestration/action-handlers/manage-custom-variables.handler.d.ts +0 -17
- package/backend/dist/src/llm-orchestration/action-handlers/manage-custom-variables.handler.js +0 -239
- package/backend/dist/src/llm-orchestration/action-handlers/manage-custom-variables.handler.js.map +0 -1
- package/backend/dist/src/llm-orchestration/action-handlers/manage-mcp-servers.handler.d.ts +0 -18
- package/backend/dist/src/llm-orchestration/action-handlers/manage-mcp-servers.handler.js +0 -259
- package/backend/dist/src/llm-orchestration/action-handlers/manage-mcp-servers.handler.js.map +0 -1
- package/backend/dist/src/llm-orchestration/action-handlers/manage-sub-agents.handler.d.ts +0 -19
- package/backend/dist/src/llm-orchestration/action-handlers/manage-sub-agents.handler.js +0 -308
- package/backend/dist/src/llm-orchestration/action-handlers/manage-sub-agents.handler.js.map +0 -1
- package/backend/dist/src/llm-orchestration/action-handlers/manage-system-prompts.handler.d.ts +0 -25
- package/backend/dist/src/llm-orchestration/action-handlers/manage-system-prompts.handler.js +0 -489
- package/backend/dist/src/llm-orchestration/action-handlers/manage-system-prompts.handler.js.map +0 -1
- package/backend/dist/src/llm-orchestration/action-handlers/manage-tool-hooks.handler.d.ts +0 -20
- package/backend/dist/src/llm-orchestration/action-handlers/manage-tool-hooks.handler.js +0 -328
- package/backend/dist/src/llm-orchestration/action-handlers/manage-tool-hooks.handler.js.map +0 -1
package/package.json
CHANGED
|
Binary file
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ActionHandler } from './action-handler.interface';
|
|
2
|
-
import { ActionExecutionResult, PlanExecutionContext, ToolMetadata } from '../llm-orchestration.interfaces';
|
|
3
|
-
import { AgentsService } from '../../agents/agents.service';
|
|
4
|
-
export type AgentAction = 'list' | 'get' | 'create' | 'update' | 'delete' | 'duplicate' | 'set_default';
|
|
5
|
-
export declare class ManageAgentsHandler implements ActionHandler {
|
|
6
|
-
private readonly agentsService;
|
|
7
|
-
readonly toolName = "manage_agents";
|
|
8
|
-
private readonly logger;
|
|
9
|
-
constructor(agentsService: AgentsService);
|
|
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
|
-
private handleSetDefault;
|
|
20
|
-
}
|
|
@@ -1,336 +0,0 @@
|
|
|
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 ManageAgentsHandler_1;
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.ManageAgentsHandler = void 0;
|
|
14
|
-
const common_1 = require("@nestjs/common");
|
|
15
|
-
const agents_service_1 = require("../../agents/agents.service");
|
|
16
|
-
let ManageAgentsHandler = ManageAgentsHandler_1 = class ManageAgentsHandler {
|
|
17
|
-
constructor(agentsService) {
|
|
18
|
-
this.agentsService = agentsService;
|
|
19
|
-
this.toolName = 'manage_agents';
|
|
20
|
-
this.logger = new common_1.Logger(ManageAgentsHandler_1.name);
|
|
21
|
-
}
|
|
22
|
-
getMetadata() {
|
|
23
|
-
return {
|
|
24
|
-
name: this.toolName,
|
|
25
|
-
description: 'Manage RepoBurg agents — presets that group system prompt, context templates, model, and reasoning effort together.',
|
|
26
|
-
arguments: [
|
|
27
|
-
{
|
|
28
|
-
name: 'action',
|
|
29
|
-
type: 'string',
|
|
30
|
-
description: 'Operation: list|get|create|update|delete|duplicate|set_default',
|
|
31
|
-
required: true,
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
name: 'id',
|
|
35
|
-
type: 'string',
|
|
36
|
-
description: 'UUID of the agent (required for get/update/delete/duplicate/set_default)',
|
|
37
|
-
required: false,
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
name: 'data',
|
|
41
|
-
type: 'object',
|
|
42
|
-
description: 'Fields for create/update. Keys: name (required for create), description, system_prompt_id, context_template_id, followup_context_template_id, model_id, reasoning_effort ("low"|"medium"|"high"), is_default, is_active.',
|
|
43
|
-
required: false,
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
getDefinition() {
|
|
49
|
-
return `## manage_agents
|
|
50
|
-
|
|
51
|
-
Manage RepoBurg agents — presets that group system prompt, context templates, model, and reasoning effort together. Selecting an agent applies all its settings to a session at once.
|
|
52
|
-
|
|
53
|
-
### Actions:
|
|
54
|
-
|
|
55
|
-
- **list** — List all agents (returns id, name, description, is_default, is_active, is_builtin, model_id, reasoning_effort, system_prompt_id, context_template_id, followup_context_template_id)
|
|
56
|
-
- **get** — Get full details of an agent by ID
|
|
57
|
-
- **create** — Create a new agent. Provide \`data\` with: name (required), description, system_prompt_id, context_template_id, followup_context_template_id, model_id, reasoning_effort, is_default (default false), is_active (default true)
|
|
58
|
-
- **update** — Update an agent. Provide \`id\` and \`data\` with fields to change. Built-in agents can only change is_active, model_id, and reasoning_effort.
|
|
59
|
-
- **delete** — Delete an agent by ID (cannot delete built-in agents)
|
|
60
|
-
- **duplicate** — Duplicate an agent by ID (works for built-in too). Returns the new copy.
|
|
61
|
-
- **set_default** — Set an agent as the default for new sessions. Provide \`id\`.
|
|
62
|
-
|
|
63
|
-
### Parameters:
|
|
64
|
-
- **action** (required): Operation to perform
|
|
65
|
-
- **id** (optional): UUID of the agent
|
|
66
|
-
- **data** (optional): Object with agent fields
|
|
67
|
-
|
|
68
|
-
### Examples:
|
|
69
|
-
|
|
70
|
-
List all agents:
|
|
71
|
-
\`\`\`typescript
|
|
72
|
-
tool: manage_agents
|
|
73
|
-
args: { action: "list" }
|
|
74
|
-
\`\`\`
|
|
75
|
-
|
|
76
|
-
Create an agent:
|
|
77
|
-
\`\`\`typescript
|
|
78
|
-
tool: manage_agents
|
|
79
|
-
args: { action: "create", data: { name: "Code Reviewer", description: "Specialized in reviewing code", model_id: "ollama/glm-5.1:cloud", reasoning_effort: "high" } }
|
|
80
|
-
\`\`\`
|
|
81
|
-
|
|
82
|
-
Set an agent as default:
|
|
83
|
-
\`\`\`typescript
|
|
84
|
-
tool: manage_agents
|
|
85
|
-
args: { action: "set_default", id: "uuid-here" }
|
|
86
|
-
\`\`\``;
|
|
87
|
-
}
|
|
88
|
-
async execute(args, _context) {
|
|
89
|
-
const { action } = args;
|
|
90
|
-
try {
|
|
91
|
-
let result;
|
|
92
|
-
switch (action) {
|
|
93
|
-
case 'list':
|
|
94
|
-
result = await this.handleList();
|
|
95
|
-
break;
|
|
96
|
-
case 'get':
|
|
97
|
-
result = await this.handleGet(args.id);
|
|
98
|
-
break;
|
|
99
|
-
case 'create':
|
|
100
|
-
result = await this.handleCreate(args.data);
|
|
101
|
-
break;
|
|
102
|
-
case 'update':
|
|
103
|
-
result = await this.handleUpdate(args.id, args.data);
|
|
104
|
-
break;
|
|
105
|
-
case 'delete':
|
|
106
|
-
result = await this.handleDelete(args.id);
|
|
107
|
-
break;
|
|
108
|
-
case 'duplicate':
|
|
109
|
-
result = await this.handleDuplicate(args.id);
|
|
110
|
-
break;
|
|
111
|
-
case 'set_default':
|
|
112
|
-
result = await this.handleSetDefault(args.id);
|
|
113
|
-
break;
|
|
114
|
-
default:
|
|
115
|
-
result = {
|
|
116
|
-
status: 'FAILURE',
|
|
117
|
-
summary: `Unknown action "${action}". Valid actions: list, get, create, update, delete, duplicate, set_default`,
|
|
118
|
-
error_message: `Unknown action: ${action}`,
|
|
119
|
-
execution_log: {
|
|
120
|
-
output: '',
|
|
121
|
-
error_message: `Unknown action: ${action}`,
|
|
122
|
-
},
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
if (!result.persisted_args)
|
|
126
|
-
result.persisted_args = {};
|
|
127
|
-
if (!result.persisted_args.command_string)
|
|
128
|
-
result.persisted_args.command_string = `${action}`;
|
|
129
|
-
if (!result.persisted_args.reason)
|
|
130
|
-
result.persisted_args.reason = result.summary || '';
|
|
131
|
-
return result;
|
|
132
|
-
}
|
|
133
|
-
catch (error) {
|
|
134
|
-
this.logger.error(`manage_agents error: ${error.message}`, error.stack);
|
|
135
|
-
return {
|
|
136
|
-
status: 'FAILURE',
|
|
137
|
-
summary: `Failed to ${action} agent: ${error.message}`,
|
|
138
|
-
error_message: error.message,
|
|
139
|
-
execution_log: { output: '', error_message: error.message },
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
async handleList() {
|
|
144
|
-
const agents = await this.agentsService.findAll();
|
|
145
|
-
const summary = agents.map((a) => ({
|
|
146
|
-
id: a.id,
|
|
147
|
-
name: a.name,
|
|
148
|
-
description: a.description,
|
|
149
|
-
is_default: a.is_default,
|
|
150
|
-
is_active: a.is_active,
|
|
151
|
-
is_builtin: a.is_builtin,
|
|
152
|
-
model_id: a.model_id,
|
|
153
|
-
reasoning_effort: a.reasoning_effort,
|
|
154
|
-
system_prompt_id: a.system_prompt_id,
|
|
155
|
-
context_template_id: a.context_template_id,
|
|
156
|
-
followup_context_template_id: a.followup_context_template_id,
|
|
157
|
-
}));
|
|
158
|
-
return {
|
|
159
|
-
status: 'SUCCESS',
|
|
160
|
-
summary: `Found ${agents.length} agent(s).`,
|
|
161
|
-
execution_log: {
|
|
162
|
-
output: JSON.stringify(summary, null, 2),
|
|
163
|
-
error_message: '',
|
|
164
|
-
},
|
|
165
|
-
persisted_args: {},
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
async handleGet(id) {
|
|
169
|
-
if (!id) {
|
|
170
|
-
return {
|
|
171
|
-
status: 'FAILURE',
|
|
172
|
-
summary: 'id is required for get action',
|
|
173
|
-
error_message: 'Missing id',
|
|
174
|
-
execution_log: { output: '', error_message: 'Missing id' },
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
const agent = await this.agentsService.findOne(id);
|
|
178
|
-
return {
|
|
179
|
-
status: 'SUCCESS',
|
|
180
|
-
summary: `Agent "${agent.name}"`,
|
|
181
|
-
execution_log: {
|
|
182
|
-
output: JSON.stringify(agent, null, 2),
|
|
183
|
-
error_message: '',
|
|
184
|
-
},
|
|
185
|
-
persisted_args: {},
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
async handleCreate(data) {
|
|
189
|
-
if (!data || !data.name) {
|
|
190
|
-
return {
|
|
191
|
-
status: 'FAILURE',
|
|
192
|
-
summary: 'data.name is required for create',
|
|
193
|
-
error_message: 'Missing required field: name',
|
|
194
|
-
execution_log: {
|
|
195
|
-
output: '',
|
|
196
|
-
error_message: 'Missing required field: name',
|
|
197
|
-
},
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
const createDto = {
|
|
201
|
-
name: data.name,
|
|
202
|
-
description: data.description ?? null,
|
|
203
|
-
system_prompt_id: data.system_prompt_id ?? null,
|
|
204
|
-
context_template_id: data.context_template_id ?? null,
|
|
205
|
-
followup_context_template_id: data.followup_context_template_id ?? null,
|
|
206
|
-
model_id: data.model_id ?? null,
|
|
207
|
-
reasoning_effort: data.reasoning_effort ?? null,
|
|
208
|
-
is_default: data.is_default ?? false,
|
|
209
|
-
is_active: data.is_active ?? true,
|
|
210
|
-
};
|
|
211
|
-
const agent = await this.agentsService.create(createDto);
|
|
212
|
-
const result = {
|
|
213
|
-
id: agent.id,
|
|
214
|
-
name: agent.name,
|
|
215
|
-
is_default: agent.is_default,
|
|
216
|
-
is_active: agent.is_active,
|
|
217
|
-
};
|
|
218
|
-
return {
|
|
219
|
-
status: 'SUCCESS',
|
|
220
|
-
summary: `Agent "${agent.name}" created with ID ${agent.id}`,
|
|
221
|
-
execution_log: {
|
|
222
|
-
output: JSON.stringify(result, null, 2),
|
|
223
|
-
error_message: '',
|
|
224
|
-
},
|
|
225
|
-
persisted_args: {},
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
async handleUpdate(id, data) {
|
|
229
|
-
if (!id || !data) {
|
|
230
|
-
return {
|
|
231
|
-
status: 'FAILURE',
|
|
232
|
-
summary: 'id and data are required for update action',
|
|
233
|
-
error_message: 'Missing parameters',
|
|
234
|
-
execution_log: { output: '', error_message: 'Missing parameters' },
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
const updateDto = {};
|
|
238
|
-
const allowedFields = [
|
|
239
|
-
'name',
|
|
240
|
-
'description',
|
|
241
|
-
'system_prompt_id',
|
|
242
|
-
'context_template_id',
|
|
243
|
-
'followup_context_template_id',
|
|
244
|
-
'model_id',
|
|
245
|
-
'reasoning_effort',
|
|
246
|
-
'is_default',
|
|
247
|
-
'is_active',
|
|
248
|
-
];
|
|
249
|
-
for (const key of allowedFields) {
|
|
250
|
-
if (data[key] !== undefined) {
|
|
251
|
-
updateDto[key] = data[key];
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
const agent = await this.agentsService.update(id, updateDto);
|
|
255
|
-
return {
|
|
256
|
-
status: 'SUCCESS',
|
|
257
|
-
summary: `Agent "${agent.name}" updated`,
|
|
258
|
-
execution_log: {
|
|
259
|
-
output: JSON.stringify({
|
|
260
|
-
id: agent.id,
|
|
261
|
-
name: agent.name,
|
|
262
|
-
is_active: agent.is_active,
|
|
263
|
-
is_default: agent.is_default,
|
|
264
|
-
}, null, 2),
|
|
265
|
-
error_message: '',
|
|
266
|
-
},
|
|
267
|
-
persisted_args: {},
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
async handleDelete(id) {
|
|
271
|
-
if (!id) {
|
|
272
|
-
return {
|
|
273
|
-
status: 'FAILURE',
|
|
274
|
-
summary: 'id is required for delete action',
|
|
275
|
-
error_message: 'Missing id',
|
|
276
|
-
execution_log: { output: '', error_message: 'Missing id' },
|
|
277
|
-
};
|
|
278
|
-
}
|
|
279
|
-
await this.agentsService.remove(id);
|
|
280
|
-
return {
|
|
281
|
-
status: 'SUCCESS',
|
|
282
|
-
summary: `Agent ${id} deleted`,
|
|
283
|
-
execution_log: {
|
|
284
|
-
output: JSON.stringify({ deleted: true, id }),
|
|
285
|
-
error_message: '',
|
|
286
|
-
},
|
|
287
|
-
persisted_args: {},
|
|
288
|
-
};
|
|
289
|
-
}
|
|
290
|
-
async handleDuplicate(id) {
|
|
291
|
-
if (!id) {
|
|
292
|
-
return {
|
|
293
|
-
status: 'FAILURE',
|
|
294
|
-
summary: 'id is required for duplicate action',
|
|
295
|
-
error_message: 'Missing id',
|
|
296
|
-
execution_log: { output: '', error_message: 'Missing id' },
|
|
297
|
-
};
|
|
298
|
-
}
|
|
299
|
-
const agent = await this.agentsService.duplicate(id);
|
|
300
|
-
return {
|
|
301
|
-
status: 'SUCCESS',
|
|
302
|
-
summary: `Agent duplicated as "${agent.name}"`,
|
|
303
|
-
execution_log: {
|
|
304
|
-
output: JSON.stringify({ id: agent.id, name: agent.name }, null, 2),
|
|
305
|
-
error_message: '',
|
|
306
|
-
},
|
|
307
|
-
persisted_args: {},
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
async handleSetDefault(id) {
|
|
311
|
-
if (!id) {
|
|
312
|
-
return {
|
|
313
|
-
status: 'FAILURE',
|
|
314
|
-
summary: 'id is required for set_default action',
|
|
315
|
-
error_message: 'Missing id',
|
|
316
|
-
execution_log: { output: '', error_message: 'Missing id' },
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
const agent = await this.agentsService.setDefault(id);
|
|
320
|
-
return {
|
|
321
|
-
status: 'SUCCESS',
|
|
322
|
-
summary: `Agent "${agent.name}" set as default`,
|
|
323
|
-
execution_log: {
|
|
324
|
-
output: JSON.stringify({ id: agent.id, name: agent.name, is_default: true }, null, 2),
|
|
325
|
-
error_message: '',
|
|
326
|
-
},
|
|
327
|
-
persisted_args: {},
|
|
328
|
-
};
|
|
329
|
-
}
|
|
330
|
-
};
|
|
331
|
-
exports.ManageAgentsHandler = ManageAgentsHandler;
|
|
332
|
-
exports.ManageAgentsHandler = ManageAgentsHandler = ManageAgentsHandler_1 = __decorate([
|
|
333
|
-
(0, common_1.Injectable)(),
|
|
334
|
-
__metadata("design:paramtypes", [agents_service_1.AgentsService])
|
|
335
|
-
], ManageAgentsHandler);
|
|
336
|
-
//# sourceMappingURL=manage-agents.handler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"manage-agents.handler.js","sourceRoot":"","sources":["../../../../src/llm-orchestration/action-handlers/manage-agents.handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AAQpD,gEAA4D;AAMrD,IAAM,mBAAmB,2BAAzB,MAAM,mBAAmB;IAI9B,YAA6B,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;QAHhD,aAAQ,GAAG,eAAe,CAAC;QACnB,WAAM,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AAE;qCAKiC,8BAAa;GAJ9C,mBAAmB,CAuV/B"}
|
package/backend/dist/src/llm-orchestration/action-handlers/manage-context-snippets.handler.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ActionHandler } from './action-handler.interface';
|
|
2
|
-
import { ActionExecutionResult, PlanExecutionContext, ToolMetadata } from '../llm-orchestration.interfaces';
|
|
3
|
-
import { ContextSnippetsService } from '../../context-snippets/context-snippets.service';
|
|
4
|
-
export type ContextSnippetAction = 'list' | 'get' | 'create' | 'update' | 'delete';
|
|
5
|
-
export declare class ManageContextSnippetsHandler implements ActionHandler {
|
|
6
|
-
private readonly contextSnippetsService;
|
|
7
|
-
readonly toolName = "manage_context_snippets";
|
|
8
|
-
private readonly logger;
|
|
9
|
-
constructor(contextSnippetsService: ContextSnippetsService);
|
|
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
|
-
}
|
package/backend/dist/src/llm-orchestration/action-handlers/manage-context-snippets.handler.js
DELETED
|
@@ -1,237 +0,0 @@
|
|
|
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 ManageContextSnippetsHandler_1;
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.ManageContextSnippetsHandler = void 0;
|
|
14
|
-
const common_1 = require("@nestjs/common");
|
|
15
|
-
const context_snippets_service_1 = require("../../context-snippets/context-snippets.service");
|
|
16
|
-
let ManageContextSnippetsHandler = ManageContextSnippetsHandler_1 = class ManageContextSnippetsHandler {
|
|
17
|
-
constructor(contextSnippetsService) {
|
|
18
|
-
this.contextSnippetsService = contextSnippetsService;
|
|
19
|
-
this.toolName = 'manage_context_snippets';
|
|
20
|
-
this.logger = new common_1.Logger(ManageContextSnippetsHandler_1.name);
|
|
21
|
-
}
|
|
22
|
-
getMetadata() {
|
|
23
|
-
return {
|
|
24
|
-
name: this.toolName,
|
|
25
|
-
description: 'Manage RepoBurg context snippets — reusable Eta template blocks accessible via it.snippets.handle in context templates.',
|
|
26
|
-
arguments: [
|
|
27
|
-
{
|
|
28
|
-
name: 'action',
|
|
29
|
-
type: 'string',
|
|
30
|
-
description: 'Operation: list|get|create|update|delete',
|
|
31
|
-
required: true,
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
name: 'id',
|
|
35
|
-
type: 'string',
|
|
36
|
-
description: 'UUID of the context snippet (required for get/update/delete)',
|
|
37
|
-
required: false,
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
name: 'data',
|
|
41
|
-
type: 'object',
|
|
42
|
-
description: 'Fields for create/update. Keys: handle (required for create, unique), description, template_content (required for create, Eta syntax).',
|
|
43
|
-
required: false,
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
getDefinition() {
|
|
49
|
-
return `## manage_context_snippets
|
|
50
|
-
|
|
51
|
-
Manage RepoBurg context snippets — reusable Eta template blocks accessible via \`it.snippets.handle\` in context templates. Use snippets for frequently-needed context like git status, package info, etc.
|
|
52
|
-
|
|
53
|
-
### Actions:
|
|
54
|
-
|
|
55
|
-
- **list** — List all context snippets (returns id, handle, description)
|
|
56
|
-
- **get** — Get full details of a snippet by ID
|
|
57
|
-
- **create** — Create a new snippet. Provide \`data\` with: handle (required, unique identifier), description, template_content (required, Eta template)
|
|
58
|
-
- **update** — Update a snippet. Provide \`id\` and \`data\` with fields to change (handle, description, template_content)
|
|
59
|
-
- **delete** — Delete a snippet by ID
|
|
60
|
-
|
|
61
|
-
### Parameters:
|
|
62
|
-
- **action** (required): Operation to perform
|
|
63
|
-
- **id** (optional): UUID of the context snippet
|
|
64
|
-
- **data** (optional): Object with snippet fields
|
|
65
|
-
|
|
66
|
-
### Examples:
|
|
67
|
-
|
|
68
|
-
List all snippets:
|
|
69
|
-
\`\`\`typescript
|
|
70
|
-
tool: manage_context_snippets
|
|
71
|
-
args: { action: "list" }
|
|
72
|
-
\`\`\`
|
|
73
|
-
|
|
74
|
-
Create a snippet:
|
|
75
|
-
\`\`\`typescript
|
|
76
|
-
tool: manage_context_snippets
|
|
77
|
-
args: { action: "create", data: { handle: "git-status", description: "Current git branch and recent commits", template_content: "<%= await it.runCommand('git log --oneline -5') %>" } }
|
|
78
|
-
\`\`\``;
|
|
79
|
-
}
|
|
80
|
-
async execute(args, _context) {
|
|
81
|
-
const { action } = args;
|
|
82
|
-
try {
|
|
83
|
-
let result;
|
|
84
|
-
switch (action) {
|
|
85
|
-
case 'list':
|
|
86
|
-
result = await this.handleList();
|
|
87
|
-
break;
|
|
88
|
-
case 'get':
|
|
89
|
-
result = await this.handleGet(args.id);
|
|
90
|
-
break;
|
|
91
|
-
case 'create':
|
|
92
|
-
result = await this.handleCreate(args.data);
|
|
93
|
-
break;
|
|
94
|
-
case 'update':
|
|
95
|
-
result = await this.handleUpdate(args.id, args.data);
|
|
96
|
-
break;
|
|
97
|
-
case 'delete':
|
|
98
|
-
result = await this.handleDelete(args.id);
|
|
99
|
-
break;
|
|
100
|
-
default:
|
|
101
|
-
result = {
|
|
102
|
-
status: 'FAILURE',
|
|
103
|
-
summary: `Unknown action "${action}". Valid actions: list, get, create, update, delete`,
|
|
104
|
-
error_message: `Unknown action: ${action}`,
|
|
105
|
-
execution_log: {
|
|
106
|
-
output: '',
|
|
107
|
-
error_message: `Unknown action: ${action}`,
|
|
108
|
-
},
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
if (!result.persisted_args)
|
|
112
|
-
result.persisted_args = {};
|
|
113
|
-
if (!result.persisted_args.command_string)
|
|
114
|
-
result.persisted_args.command_string = `${action}`;
|
|
115
|
-
if (!result.persisted_args.reason)
|
|
116
|
-
result.persisted_args.reason = result.summary || '';
|
|
117
|
-
return result;
|
|
118
|
-
}
|
|
119
|
-
catch (error) {
|
|
120
|
-
this.logger.error(`manage_context_snippets error: ${error.message}`, error.stack);
|
|
121
|
-
return {
|
|
122
|
-
status: 'FAILURE',
|
|
123
|
-
summary: `Failed to ${action} context snippet: ${error.message}`,
|
|
124
|
-
error_message: error.message,
|
|
125
|
-
execution_log: { output: '', error_message: error.message },
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
async handleList() {
|
|
130
|
-
const snippets = await this.contextSnippetsService.findAll();
|
|
131
|
-
const summary = snippets.map((s) => ({
|
|
132
|
-
id: s.id,
|
|
133
|
-
handle: s.handle,
|
|
134
|
-
description: s.description,
|
|
135
|
-
}));
|
|
136
|
-
return {
|
|
137
|
-
status: 'SUCCESS',
|
|
138
|
-
summary: `Found ${snippets.length} context snippet(s).`,
|
|
139
|
-
execution_log: {
|
|
140
|
-
output: JSON.stringify(summary, null, 2),
|
|
141
|
-
error_message: '',
|
|
142
|
-
},
|
|
143
|
-
persisted_args: {},
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
async handleGet(id) {
|
|
147
|
-
if (!id) {
|
|
148
|
-
return {
|
|
149
|
-
status: 'FAILURE',
|
|
150
|
-
summary: 'id is required for get action',
|
|
151
|
-
error_message: 'Missing id',
|
|
152
|
-
execution_log: { output: '', error_message: 'Missing id' },
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
const snippet = await this.contextSnippetsService.findOne(id);
|
|
156
|
-
return {
|
|
157
|
-
status: 'SUCCESS',
|
|
158
|
-
summary: `Context snippet "${snippet.handle}"`,
|
|
159
|
-
execution_log: {
|
|
160
|
-
output: JSON.stringify(snippet, null, 2),
|
|
161
|
-
error_message: '',
|
|
162
|
-
},
|
|
163
|
-
persisted_args: {},
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
async handleCreate(data) {
|
|
167
|
-
if (!data || !data.handle || !data.template_content) {
|
|
168
|
-
return {
|
|
169
|
-
status: 'FAILURE',
|
|
170
|
-
summary: 'data.handle and data.template_content are required for create',
|
|
171
|
-
error_message: 'Missing required fields',
|
|
172
|
-
execution_log: { output: '', error_message: 'Missing required fields' },
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
const snippet = await this.contextSnippetsService.create({
|
|
176
|
-
handle: data.handle,
|
|
177
|
-
description: data.description,
|
|
178
|
-
template_content: data.template_content,
|
|
179
|
-
});
|
|
180
|
-
const result = { id: snippet.id, handle: snippet.handle };
|
|
181
|
-
return {
|
|
182
|
-
status: 'SUCCESS',
|
|
183
|
-
summary: `Context snippet "${snippet.handle}" created with ID ${snippet.id}`,
|
|
184
|
-
execution_log: {
|
|
185
|
-
output: JSON.stringify(result, null, 2),
|
|
186
|
-
error_message: '',
|
|
187
|
-
},
|
|
188
|
-
persisted_args: {},
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
async handleUpdate(id, data) {
|
|
192
|
-
if (!id || !data) {
|
|
193
|
-
return {
|
|
194
|
-
status: 'FAILURE',
|
|
195
|
-
summary: 'id and data are required for update action',
|
|
196
|
-
error_message: 'Missing parameters',
|
|
197
|
-
execution_log: { output: '', error_message: 'Missing parameters' },
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
const snippet = await this.contextSnippetsService.update(id, data);
|
|
201
|
-
return {
|
|
202
|
-
status: 'SUCCESS',
|
|
203
|
-
summary: `Context snippet "${snippet.handle}" updated`,
|
|
204
|
-
execution_log: {
|
|
205
|
-
output: JSON.stringify({ id: snippet.id, handle: snippet.handle }, null, 2),
|
|
206
|
-
error_message: '',
|
|
207
|
-
},
|
|
208
|
-
persisted_args: {},
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
async handleDelete(id) {
|
|
212
|
-
if (!id) {
|
|
213
|
-
return {
|
|
214
|
-
status: 'FAILURE',
|
|
215
|
-
summary: 'id is required for delete action',
|
|
216
|
-
error_message: 'Missing id',
|
|
217
|
-
execution_log: { output: '', error_message: 'Missing id' },
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
await this.contextSnippetsService.remove(id);
|
|
221
|
-
return {
|
|
222
|
-
status: 'SUCCESS',
|
|
223
|
-
summary: `Context snippet ${id} deleted`,
|
|
224
|
-
execution_log: {
|
|
225
|
-
output: JSON.stringify({ deleted: true, id }),
|
|
226
|
-
error_message: '',
|
|
227
|
-
},
|
|
228
|
-
persisted_args: {},
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
};
|
|
232
|
-
exports.ManageContextSnippetsHandler = ManageContextSnippetsHandler;
|
|
233
|
-
exports.ManageContextSnippetsHandler = ManageContextSnippetsHandler = ManageContextSnippetsHandler_1 = __decorate([
|
|
234
|
-
(0, common_1.Injectable)(),
|
|
235
|
-
__metadata("design:paramtypes", [context_snippets_service_1.ContextSnippetsService])
|
|
236
|
-
], ManageContextSnippetsHandler);
|
|
237
|
-
//# sourceMappingURL=manage-context-snippets.handler.js.map
|
package/backend/dist/src/llm-orchestration/action-handlers/manage-context-snippets.handler.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"manage-context-snippets.handler.js","sourceRoot":"","sources":["../../../../src/llm-orchestration/action-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ers/manage-context-templates.handler.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ActionHandler } from './action-handler.interface';
|
|
2
|
-
import { ActionExecutionResult, PlanExecutionContext, ToolMetadata } from '../llm-orchestration.interfaces';
|
|
3
|
-
import { ContextTemplatesService } from '../../context-templates/context-templates.service';
|
|
4
|
-
export type ContextTemplateAction = 'list' | 'get' | 'create' | 'update' | 'delete' | 'duplicate' | 'set_default_initial' | 'set_default_followup' | 'set_default_condensed';
|
|
5
|
-
export declare class ManageContextTemplatesHandler implements ActionHandler {
|
|
6
|
-
private readonly contextTemplatesService;
|
|
7
|
-
readonly toolName = "manage_context_templates";
|
|
8
|
-
private readonly logger;
|
|
9
|
-
constructor(contextTemplatesService: ContextTemplatesService);
|
|
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
|
-
private handleSetDefault;
|
|
20
|
-
}
|