@codebolt/codeboltjs 5.0.8 → 5.0.9
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/dist/core/Codebolt.d.ts +29 -5
- package/dist/core/Codebolt.js +58 -0
- package/dist/core/websocket.js +15 -17
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -3
- package/dist/modules/dynamicPanel.d.ts +106 -0
- package/dist/modules/dynamicPanel.js +122 -0
- package/dist/modules/mcp.js +3 -0
- package/dist/modules/swarm.d.ts +8 -2
- package/dist/modules/swarm.js +14 -0
- package/dist/tools/actionBlock/action-block-start.js +1 -4
- package/dist/tools/actionPlan/action-plan-create.js +1 -2
- package/dist/tools/completion/attempt-completion.d.ts +25 -0
- package/dist/tools/completion/attempt-completion.js +45 -0
- package/dist/tools/completion/index.d.ts +3 -0
- package/dist/tools/completion/index.js +9 -0
- package/dist/tools/index.d.ts +6 -3
- package/dist/tools/index.js +11 -4
- package/dist/tools/job/index.d.ts +3 -1
- package/dist/tools/job/index.js +5 -1
- package/dist/tools/job/job-remove-dependency.d.ts +28 -0
- package/dist/tools/job/job-remove-dependency.js +86 -0
- package/dist/tools/requirementPlan/requirement-plan-review.js +1 -1
- package/dist/tools/thread/thread-create-background.js +1 -1
- package/dist/tools/utils/schema-validator.d.ts +1 -0
- package/dist/tools/utils/schema-validator.js +13 -1
- package/dist/types/job.d.ts +1 -1
- package/package.json +2 -2
- package/dist/modules/codeboltEvent.d.ts +0 -57
- package/dist/modules/codeboltEvent.js +0 -217
- package/dist/tools/browser/browser-action.d.ts +0 -56
- package/dist/tools/browser/browser-action.js +0 -265
- package/dist/tools/codeboltEvent/event-add-running-agent.d.ts +0 -25
- package/dist/tools/codeboltEvent/event-add-running-agent.js +0 -69
- package/dist/tools/codeboltEvent/event-check-background-agent-completion.d.ts +0 -19
- package/dist/tools/codeboltEvent/event-check-background-agent-completion.js +0 -64
- package/dist/tools/codeboltEvent/event-get-running-agent-count.d.ts +0 -19
- package/dist/tools/codeboltEvent/event-get-running-agent-count.js +0 -55
- package/dist/tools/codeboltEvent/event-on-background-agent-completion.d.ts +0 -19
- package/dist/tools/codeboltEvent/event-on-background-agent-completion.js +0 -56
- package/dist/tools/codeboltEvent/event-wait-for-external-event.d.ts +0 -19
- package/dist/tools/codeboltEvent/event-wait-for-external-event.js +0 -55
- package/dist/tools/codeboltEvent/index.d.ts +0 -19
- package/dist/tools/codeboltEvent/index.js +0 -33
- package/dist/tools/event/event-add-running-agent.d.ts +0 -32
- package/dist/tools/event/event-add-running-agent.js +0 -77
- package/dist/tools/event/event-check-agent-event.d.ts +0 -19
- package/dist/tools/event/event-check-agent-event.js +0 -63
- package/dist/tools/event/event-check-completion.d.ts +0 -19
- package/dist/tools/event/event-check-completion.js +0 -73
- package/dist/tools/event/event-check-grouped-completion.d.ts +0 -19
- package/dist/tools/event/event-check-grouped-completion.js +0 -63
- package/dist/tools/event/event-get-running-count.d.ts +0 -19
- package/dist/tools/event/event-get-running-count.js +0 -55
- package/dist/tools/event/event-on-agent-event.d.ts +0 -19
- package/dist/tools/event/event-on-agent-event.js +0 -63
- package/dist/tools/event/event-on-completion.d.ts +0 -19
- package/dist/tools/event/event-on-completion.js +0 -73
- package/dist/tools/event/event-on-grouped-completion.d.ts +0 -19
- package/dist/tools/event/event-on-grouped-completion.js +0 -63
- package/dist/tools/event/event-wait-any.d.ts +0 -19
- package/dist/tools/event/event-wait-any.js +0 -66
- package/dist/tools/event/index.d.ts +0 -25
- package/dist/tools/event/index.js +0 -48
- package/dist/tools/git/git-action.d.ts +0 -48
- package/dist/tools/git/git-action.js +0 -279
- package/dist/tools/kvStore/kv-store-create-instance.d.ts +0 -26
- package/dist/tools/kvStore/kv-store-create-instance.js +0 -79
- package/dist/tools/kvStore/kv-store-get.d.ts +0 -30
- package/dist/tools/kvStore/kv-store-get.js +0 -80
- package/dist/tools/kvStore/kv-store-set.d.ts +0 -38
- package/dist/tools/kvStore/kv-store-set.js +0 -86
- package/dist/tools/memoryIngestion/mi-create-pipeline.d.ts +0 -44
- package/dist/tools/memoryIngestion/mi-create-pipeline.js +0 -114
- package/dist/tools/memoryIngestion/mi-list.d.ts +0 -22
- package/dist/tools/memoryIngestion/mi-list.js +0 -66
- package/dist/tools/orchestration/agent-details.d.ts +0 -15
- package/dist/tools/orchestration/agent-details.js +0 -98
- package/dist/tools/orchestration/agent-find.d.ts +0 -18
- package/dist/tools/orchestration/agent-find.js +0 -125
- package/dist/tools/orchestration/agent-list.d.ts +0 -13
- package/dist/tools/orchestration/agent-list.js +0 -106
- package/dist/tools/orchestration/agent-management.d.ts +0 -44
- package/dist/tools/orchestration/agent-management.js +0 -250
- package/dist/tools/orchestration/agent-start.d.ts +0 -18
- package/dist/tools/orchestration/agent-start.js +0 -90
- package/dist/tools/orchestration/index.d.ts +0 -49
- package/dist/tools/orchestration/index.js +0 -102
- package/dist/tools/orchestration/task-assign.d.ts +0 -18
- package/dist/tools/orchestration/task-assign.js +0 -84
- package/dist/tools/orchestration/task-create.d.ts +0 -20
- package/dist/tools/orchestration/task-create.js +0 -97
- package/dist/tools/orchestration/task-delete.d.ts +0 -16
- package/dist/tools/orchestration/task-delete.js +0 -77
- package/dist/tools/orchestration/task-execute.d.ts +0 -18
- package/dist/tools/orchestration/task-execute.js +0 -84
- package/dist/tools/orchestration/task-get.d.ts +0 -16
- package/dist/tools/orchestration/task-get.js +0 -89
- package/dist/tools/orchestration/task-list.d.ts +0 -13
- package/dist/tools/orchestration/task-list.js +0 -74
- package/dist/tools/orchestration/task-management.d.ts +0 -52
- package/dist/tools/orchestration/task-management.js +0 -231
- package/dist/tools/orchestration/task-update.d.ts +0 -22
- package/dist/tools/orchestration/task-update.js +0 -96
- package/dist/tools/orchestration/thread-create-background.d.ts +0 -18
- package/dist/tools/orchestration/thread-create-background.js +0 -94
- package/dist/tools/orchestration/thread-create-start.d.ts +0 -16
- package/dist/tools/orchestration/thread-create-start.js +0 -85
- package/dist/tools/orchestration/thread-create.d.ts +0 -16
- package/dist/tools/orchestration/thread-create.js +0 -85
- package/dist/tools/orchestration/thread-delete.d.ts +0 -16
- package/dist/tools/orchestration/thread-delete.js +0 -77
- package/dist/tools/orchestration/thread-get-messages.d.ts +0 -24
- package/dist/tools/orchestration/thread-get-messages.js +0 -122
- package/dist/tools/orchestration/thread-get.d.ts +0 -16
- package/dist/tools/orchestration/thread-get.js +0 -85
- package/dist/tools/orchestration/thread-list.d.ts +0 -16
- package/dist/tools/orchestration/thread-list.js +0 -85
- package/dist/tools/orchestration/thread-start.d.ts +0 -16
- package/dist/tools/orchestration/thread-start.js +0 -82
- package/dist/tools/orchestration/thread-update-status.d.ts +0 -18
- package/dist/tools/orchestration/thread-update-status.js +0 -89
- package/dist/tools/orchestration/thread-update.d.ts +0 -18
- package/dist/tools/orchestration/thread-update.js +0 -89
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Git Action Tool - Performs various Git operations
|
|
4
|
-
* Wraps the SDK's gitService methods
|
|
5
|
-
*/
|
|
6
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
-
};
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.GitActionTool = void 0;
|
|
11
|
-
const types_1 = require("../types");
|
|
12
|
-
const base_tool_1 = require("../base-tool");
|
|
13
|
-
const git_1 = __importDefault(require("../../modules/git"));
|
|
14
|
-
class GitActionToolInvocation extends base_tool_1.BaseToolInvocation {
|
|
15
|
-
constructor(params) {
|
|
16
|
-
super(params);
|
|
17
|
-
}
|
|
18
|
-
async execute() {
|
|
19
|
-
var _a;
|
|
20
|
-
try {
|
|
21
|
-
const action = this.params.action;
|
|
22
|
-
let response;
|
|
23
|
-
let successMessage;
|
|
24
|
-
switch (action) {
|
|
25
|
-
case 'init':
|
|
26
|
-
if (!this.params.path) {
|
|
27
|
-
return this.createError("'path' is required for init action");
|
|
28
|
-
}
|
|
29
|
-
response = await git_1.default.init(this.params.path);
|
|
30
|
-
successMessage = `Initialized Git repository at ${this.params.path}`;
|
|
31
|
-
break;
|
|
32
|
-
case 'status':
|
|
33
|
-
response = await git_1.default.status();
|
|
34
|
-
successMessage = 'Git status retrieved';
|
|
35
|
-
break;
|
|
36
|
-
case 'add':
|
|
37
|
-
response = await git_1.default.addAll();
|
|
38
|
-
successMessage = 'Added all changes to staging';
|
|
39
|
-
break;
|
|
40
|
-
case 'commit':
|
|
41
|
-
if (!this.params.message) {
|
|
42
|
-
return this.createError("'message' is required for commit action");
|
|
43
|
-
}
|
|
44
|
-
response = await git_1.default.commit(this.params.message);
|
|
45
|
-
successMessage = `Committed with message: "${this.params.message}"`;
|
|
46
|
-
break;
|
|
47
|
-
case 'push':
|
|
48
|
-
response = await git_1.default.push();
|
|
49
|
-
successMessage = 'Pushed changes to remote';
|
|
50
|
-
break;
|
|
51
|
-
case 'pull':
|
|
52
|
-
response = await git_1.default.pull();
|
|
53
|
-
successMessage = 'Pulled changes from remote';
|
|
54
|
-
break;
|
|
55
|
-
case 'checkout':
|
|
56
|
-
if (!this.params.branch) {
|
|
57
|
-
return this.createError("'branch' is required for checkout action");
|
|
58
|
-
}
|
|
59
|
-
response = await git_1.default.checkout(this.params.branch);
|
|
60
|
-
successMessage = `Checked out branch: ${this.params.branch}`;
|
|
61
|
-
break;
|
|
62
|
-
case 'branch':
|
|
63
|
-
if (!this.params.branch) {
|
|
64
|
-
return this.createError("'branch' is required for branch action");
|
|
65
|
-
}
|
|
66
|
-
response = await git_1.default.branch(this.params.branch);
|
|
67
|
-
successMessage = `Created branch: ${this.params.branch}`;
|
|
68
|
-
break;
|
|
69
|
-
case 'logs':
|
|
70
|
-
if (!this.params.path) {
|
|
71
|
-
return this.createError("'path' is required for logs action");
|
|
72
|
-
}
|
|
73
|
-
response = await git_1.default.logs(this.params.path);
|
|
74
|
-
successMessage = 'Git logs retrieved';
|
|
75
|
-
break;
|
|
76
|
-
case 'diff':
|
|
77
|
-
if (!this.params.commit_hash) {
|
|
78
|
-
return this.createError("'commit_hash' is required for diff action");
|
|
79
|
-
}
|
|
80
|
-
response = await git_1.default.diff(this.params.commit_hash);
|
|
81
|
-
successMessage = `Diff for commit: ${this.params.commit_hash}`;
|
|
82
|
-
break;
|
|
83
|
-
case 'clone':
|
|
84
|
-
if (!this.params.url) {
|
|
85
|
-
return this.createError("'url' is required for clone action");
|
|
86
|
-
}
|
|
87
|
-
response = await git_1.default.clone(this.params.url, this.params.path);
|
|
88
|
-
successMessage = `Cloned repository from ${this.params.url}`;
|
|
89
|
-
break;
|
|
90
|
-
default:
|
|
91
|
-
return this.createError(`Unknown action: ${action}`);
|
|
92
|
-
}
|
|
93
|
-
// Check for errors
|
|
94
|
-
if (!response.success && response.success !== undefined) {
|
|
95
|
-
const errorMsg = typeof response.error === 'string'
|
|
96
|
-
? response.error
|
|
97
|
-
: ((_a = response.error) === null || _a === void 0 ? void 0 : _a.message) || 'Git operation failed';
|
|
98
|
-
return {
|
|
99
|
-
llmContent: `Git ${action} failed: ${errorMsg}`,
|
|
100
|
-
returnDisplay: `Error: ${errorMsg}`,
|
|
101
|
-
error: {
|
|
102
|
-
message: errorMsg,
|
|
103
|
-
type: types_1.ToolErrorType.GIT_EXECUTION_ERROR,
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
// Format output based on action
|
|
108
|
-
let output = successMessage;
|
|
109
|
-
if (action === 'status' && response.status) {
|
|
110
|
-
output += '\n\n' + this.formatStatus(response.status);
|
|
111
|
-
}
|
|
112
|
-
else if (action === 'logs' && response.logs) {
|
|
113
|
-
output += '\n\n' + this.formatLogs(response.logs);
|
|
114
|
-
}
|
|
115
|
-
else if (action === 'diff' && response.diff) {
|
|
116
|
-
output += '\n\n' + response.diff;
|
|
117
|
-
}
|
|
118
|
-
else if (response.message) {
|
|
119
|
-
output += '\n\n' + response.message;
|
|
120
|
-
}
|
|
121
|
-
else if (response.result) {
|
|
122
|
-
output += '\n\n' + (typeof response.result === 'string' ? response.result : JSON.stringify(response.result, null, 2));
|
|
123
|
-
}
|
|
124
|
-
return {
|
|
125
|
-
llmContent: output,
|
|
126
|
-
returnDisplay: successMessage,
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
catch (error) {
|
|
130
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
131
|
-
return {
|
|
132
|
-
llmContent: `Error executing git ${this.params.action}: ${errorMessage}`,
|
|
133
|
-
returnDisplay: `Error: ${errorMessage}`,
|
|
134
|
-
error: {
|
|
135
|
-
message: errorMessage,
|
|
136
|
-
type: types_1.ToolErrorType.EXECUTION_FAILED,
|
|
137
|
-
},
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
createError(message) {
|
|
142
|
-
return {
|
|
143
|
-
llmContent: `Error: ${message}`,
|
|
144
|
-
returnDisplay: `Error: ${message}`,
|
|
145
|
-
error: {
|
|
146
|
-
message,
|
|
147
|
-
type: types_1.ToolErrorType.INVALID_TOOL_PARAMS,
|
|
148
|
-
},
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
formatStatus(status) {
|
|
152
|
-
var _a, _b, _c;
|
|
153
|
-
if (typeof status === 'string')
|
|
154
|
-
return status;
|
|
155
|
-
let output = '';
|
|
156
|
-
if (status.current)
|
|
157
|
-
output += `Current branch: ${status.current}\n`;
|
|
158
|
-
if (status.tracking)
|
|
159
|
-
output += `Tracking: ${status.tracking}\n`;
|
|
160
|
-
if (status.files && status.files.length > 0) {
|
|
161
|
-
output += '\nChanges:\n';
|
|
162
|
-
for (const file of status.files) {
|
|
163
|
-
const path = file.path || file;
|
|
164
|
-
const index = file.index || '?';
|
|
165
|
-
const working_dir = file.working_dir || '?';
|
|
166
|
-
output += ` ${index}${working_dir} ${path}\n`;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
else if (status.modified || status.created || status.deleted) {
|
|
170
|
-
if ((_a = status.modified) === null || _a === void 0 ? void 0 : _a.length) {
|
|
171
|
-
output += '\nModified:\n';
|
|
172
|
-
status.modified.forEach((f) => output += ` M ${f}\n`);
|
|
173
|
-
}
|
|
174
|
-
if ((_b = status.created) === null || _b === void 0 ? void 0 : _b.length) {
|
|
175
|
-
output += '\nNew files:\n';
|
|
176
|
-
status.created.forEach((f) => output += ` A ${f}\n`);
|
|
177
|
-
}
|
|
178
|
-
if ((_c = status.deleted) === null || _c === void 0 ? void 0 : _c.length) {
|
|
179
|
-
output += '\nDeleted:\n';
|
|
180
|
-
status.deleted.forEach((f) => output += ` D ${f}\n`);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
else {
|
|
184
|
-
output += '\nNo changes detected.';
|
|
185
|
-
}
|
|
186
|
-
return output;
|
|
187
|
-
}
|
|
188
|
-
formatLogs(logs) {
|
|
189
|
-
if (!Array.isArray(logs))
|
|
190
|
-
return String(logs);
|
|
191
|
-
return logs.slice(0, 10).map(log => {
|
|
192
|
-
const hash = (log.hash || log.commit || '').substring(0, 7);
|
|
193
|
-
const message = log.message || log.subject || '';
|
|
194
|
-
const author = log.author_name || log.author || '';
|
|
195
|
-
const date = log.date || '';
|
|
196
|
-
return `${hash} - ${message} (${author}, ${date})`;
|
|
197
|
-
}).join('\n');
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Implementation of the GitAction tool logic
|
|
202
|
-
*/
|
|
203
|
-
class GitActionTool extends base_tool_1.BaseDeclarativeTool {
|
|
204
|
-
constructor() {
|
|
205
|
-
super(GitActionTool.Name, 'GitAction', `Performs Git operations like init, status, add, commit, push, pull, checkout, branch, logs, diff, and clone. Use this for version control operations.`, types_1.Kind.Execute, {
|
|
206
|
-
properties: {
|
|
207
|
-
action: {
|
|
208
|
-
description: "The Git action to perform: 'init', 'status', 'add', 'commit', 'push', 'pull', 'checkout', 'branch', 'logs', 'diff', or 'clone'.",
|
|
209
|
-
type: 'string',
|
|
210
|
-
enum: ['init', 'status', 'add', 'commit', 'push', 'pull', 'checkout', 'branch', 'logs', 'diff', 'clone'],
|
|
211
|
-
},
|
|
212
|
-
path: {
|
|
213
|
-
description: "Path for init/logs/clone operations.",
|
|
214
|
-
type: 'string',
|
|
215
|
-
},
|
|
216
|
-
message: {
|
|
217
|
-
description: "Commit message (required for 'commit' action).",
|
|
218
|
-
type: 'string',
|
|
219
|
-
},
|
|
220
|
-
branch: {
|
|
221
|
-
description: "Branch name (required for 'checkout' and 'branch' actions).",
|
|
222
|
-
type: 'string',
|
|
223
|
-
},
|
|
224
|
-
commit_hash: {
|
|
225
|
-
description: "Commit hash (required for 'diff' action).",
|
|
226
|
-
type: 'string',
|
|
227
|
-
},
|
|
228
|
-
url: {
|
|
229
|
-
description: "Repository URL (required for 'clone' action).",
|
|
230
|
-
type: 'string',
|
|
231
|
-
},
|
|
232
|
-
},
|
|
233
|
-
required: ['action'],
|
|
234
|
-
type: 'object',
|
|
235
|
-
});
|
|
236
|
-
}
|
|
237
|
-
validateToolParamValues(params) {
|
|
238
|
-
const validActions = ['init', 'status', 'add', 'commit', 'push', 'pull', 'checkout', 'branch', 'logs', 'diff', 'clone'];
|
|
239
|
-
if (!validActions.includes(params.action)) {
|
|
240
|
-
return `Invalid action: ${params.action}. Must be one of: ${validActions.join(', ')}`;
|
|
241
|
-
}
|
|
242
|
-
// Action-specific validation
|
|
243
|
-
switch (params.action) {
|
|
244
|
-
case 'init':
|
|
245
|
-
case 'logs':
|
|
246
|
-
if (!params.path) {
|
|
247
|
-
return `'path' is required for ${params.action} action`;
|
|
248
|
-
}
|
|
249
|
-
break;
|
|
250
|
-
case 'commit':
|
|
251
|
-
if (!params.message) {
|
|
252
|
-
return "'message' is required for commit action";
|
|
253
|
-
}
|
|
254
|
-
break;
|
|
255
|
-
case 'checkout':
|
|
256
|
-
case 'branch':
|
|
257
|
-
if (!params.branch) {
|
|
258
|
-
return `'branch' is required for ${params.action} action`;
|
|
259
|
-
}
|
|
260
|
-
break;
|
|
261
|
-
case 'diff':
|
|
262
|
-
if (!params.commit_hash) {
|
|
263
|
-
return "'commit_hash' is required for diff action";
|
|
264
|
-
}
|
|
265
|
-
break;
|
|
266
|
-
case 'clone':
|
|
267
|
-
if (!params.url) {
|
|
268
|
-
return "'url' is required for clone action";
|
|
269
|
-
}
|
|
270
|
-
break;
|
|
271
|
-
}
|
|
272
|
-
return null;
|
|
273
|
-
}
|
|
274
|
-
createInvocation(params) {
|
|
275
|
-
return new GitActionToolInvocation(params);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
exports.GitActionTool = GitActionTool;
|
|
279
|
-
GitActionTool.Name = 'git_action';
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create KV Store Instance Tool - Creates a new key-value store instance
|
|
3
|
-
*/
|
|
4
|
-
import type { ToolInvocation, ToolResult } from '../types';
|
|
5
|
-
import { BaseDeclarativeTool } from '../base-tool';
|
|
6
|
-
/**
|
|
7
|
-
* Parameters for the CreateKVInstance tool
|
|
8
|
-
*/
|
|
9
|
-
export interface CreateKVInstanceParams {
|
|
10
|
-
/**
|
|
11
|
-
* Instance name
|
|
12
|
-
*/
|
|
13
|
-
name: string;
|
|
14
|
-
/**
|
|
15
|
-
* Optional description
|
|
16
|
-
*/
|
|
17
|
-
description?: string;
|
|
18
|
-
/**
|
|
19
|
-
* One sentence explanation of why this tool is being used
|
|
20
|
-
*/
|
|
21
|
-
explanation?: string;
|
|
22
|
-
}
|
|
23
|
-
export declare class CreateKVInstanceTool extends BaseDeclarativeTool<CreateKVInstanceParams, ToolResult> {
|
|
24
|
-
constructor();
|
|
25
|
-
createInvocation(params: CreateKVInstanceParams, invocationId: string): ToolInvocation;
|
|
26
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Create KV Store Instance Tool - Creates a new key-value store instance
|
|
4
|
-
*/
|
|
5
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.CreateKVInstanceTool = void 0;
|
|
10
|
-
const base_tool_1 = require("../base-tool");
|
|
11
|
-
const kvStore_1 = __importDefault(require("../../modules/kvStore"));
|
|
12
|
-
class CreateKVInstanceInvocation extends base_tool_1.BaseToolInvocation {
|
|
13
|
-
constructor(params) {
|
|
14
|
-
super(params);
|
|
15
|
-
}
|
|
16
|
-
toolLocations() {
|
|
17
|
-
return [];
|
|
18
|
-
}
|
|
19
|
-
async execute() {
|
|
20
|
-
try {
|
|
21
|
-
const response = await kvStore_1.default.createInstance(this.params.name, this.params.description);
|
|
22
|
-
if (!response.success || !response.instance) {
|
|
23
|
-
return {
|
|
24
|
-
llmContent: `Error creating KV store instance: ${response.error || 'Unknown error'}`,
|
|
25
|
-
returnDisplay: `Error creating KV store instance: ${response.error || 'Unknown error'}`,
|
|
26
|
-
error: {
|
|
27
|
-
message: response.error || 'Unknown error',
|
|
28
|
-
type: 'unknown',
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
const instance = response.instance;
|
|
33
|
-
const content = `KV store instance created successfully:\n` +
|
|
34
|
-
`ID: ${instance.id}\n` +
|
|
35
|
-
`Name: ${instance.name}\n` +
|
|
36
|
-
`Description: ${instance.description || 'N/A'}`;
|
|
37
|
-
return {
|
|
38
|
-
llmContent: content,
|
|
39
|
-
returnDisplay: content,
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
catch (error) {
|
|
43
|
-
return {
|
|
44
|
-
llmContent: `Error creating KV store instance: ${error}`,
|
|
45
|
-
returnDisplay: `Error creating KV store instance: ${error}`,
|
|
46
|
-
error: {
|
|
47
|
-
message: String(error),
|
|
48
|
-
type: 'unknown',
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
class CreateKVInstanceTool extends base_tool_1.BaseDeclarativeTool {
|
|
55
|
-
constructor() {
|
|
56
|
-
super('kvStore_createInstance', 'Create a new key-value store instance for agent state persistence', {
|
|
57
|
-
type: 'object',
|
|
58
|
-
properties: {
|
|
59
|
-
name: {
|
|
60
|
-
type: 'string',
|
|
61
|
-
description: 'Instance name',
|
|
62
|
-
},
|
|
63
|
-
description: {
|
|
64
|
-
type: 'string',
|
|
65
|
-
description: 'Optional description',
|
|
66
|
-
},
|
|
67
|
-
explanation: {
|
|
68
|
-
type: 'string',
|
|
69
|
-
description: 'One sentence explanation of why this tool is being used',
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
required: ['name'],
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
createInvocation(params, invocationId) {
|
|
76
|
-
return new CreateKVInstanceInvocation(params);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
exports.CreateKVInstanceTool = CreateKVInstanceTool;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* KV Store Get Tool - Gets a value from the key-value store
|
|
3
|
-
*/
|
|
4
|
-
import type { ToolInvocation, ToolResult } from '../types';
|
|
5
|
-
import { BaseDeclarativeTool } from '../base-tool';
|
|
6
|
-
/**
|
|
7
|
-
* Parameters for the KVGet tool
|
|
8
|
-
*/
|
|
9
|
-
export interface KVGetParams {
|
|
10
|
-
/**
|
|
11
|
-
* Instance ID
|
|
12
|
-
*/
|
|
13
|
-
instanceId: string;
|
|
14
|
-
/**
|
|
15
|
-
* Key to retrieve
|
|
16
|
-
*/
|
|
17
|
-
key: string;
|
|
18
|
-
/**
|
|
19
|
-
* Optional namespace
|
|
20
|
-
*/
|
|
21
|
-
namespace?: string;
|
|
22
|
-
/**
|
|
23
|
-
* One sentence explanation of why this tool is being used
|
|
24
|
-
*/
|
|
25
|
-
explanation?: string;
|
|
26
|
-
}
|
|
27
|
-
export declare class KVGetTool extends BaseDeclarativeTool<KVGetParams, ToolResult> {
|
|
28
|
-
constructor();
|
|
29
|
-
createInvocation(params: KVGetParams, invocationId: string): ToolInvocation;
|
|
30
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* KV Store Get Tool - Gets a value from the key-value store
|
|
4
|
-
*/
|
|
5
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.KVGetTool = void 0;
|
|
10
|
-
const base_tool_1 = require("../base-tool");
|
|
11
|
-
const kvStore_1 = __importDefault(require("../../modules/kvStore"));
|
|
12
|
-
class KVGetInvocation extends base_tool_1.BaseToolInvocation {
|
|
13
|
-
constructor(params) {
|
|
14
|
-
super(params);
|
|
15
|
-
}
|
|
16
|
-
toolLocations() {
|
|
17
|
-
return [];
|
|
18
|
-
}
|
|
19
|
-
async execute() {
|
|
20
|
-
try {
|
|
21
|
-
const response = await kvStore_1.default.get(this.params.instanceId, this.params.key, this.params.namespace);
|
|
22
|
-
if (!response.success) {
|
|
23
|
-
return {
|
|
24
|
-
llmContent: `Error getting value from KV store: ${response.error || 'Unknown error'}`,
|
|
25
|
-
returnDisplay: `Error getting value from KV store: ${response.error || 'Unknown error'}`,
|
|
26
|
-
error: {
|
|
27
|
-
message: response.error || 'Unknown error',
|
|
28
|
-
type: 'unknown',
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
const value = response.value !== undefined ? JSON.stringify(response.value, null, 2) : 'undefined';
|
|
33
|
-
const content = `Retrieved value for key "${this.params.key}":\n${value}`;
|
|
34
|
-
return {
|
|
35
|
-
llmContent: content,
|
|
36
|
-
returnDisplay: content,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
catch (error) {
|
|
40
|
-
return {
|
|
41
|
-
llmContent: `Error getting value from KV store: ${error}`,
|
|
42
|
-
returnDisplay: `Error getting value from KV store: ${error}`,
|
|
43
|
-
error: {
|
|
44
|
-
message: String(error),
|
|
45
|
-
type: 'unknown',
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
class KVGetTool extends base_tool_1.BaseDeclarativeTool {
|
|
52
|
-
constructor() {
|
|
53
|
-
super('kvStore_get', 'Get a value from the key-value store by key', {
|
|
54
|
-
type: 'object',
|
|
55
|
-
properties: {
|
|
56
|
-
instanceId: {
|
|
57
|
-
type: 'string',
|
|
58
|
-
description: 'Instance ID',
|
|
59
|
-
},
|
|
60
|
-
key: {
|
|
61
|
-
type: 'string',
|
|
62
|
-
description: 'Key to retrieve',
|
|
63
|
-
},
|
|
64
|
-
namespace: {
|
|
65
|
-
type: 'string',
|
|
66
|
-
description: 'Optional namespace',
|
|
67
|
-
},
|
|
68
|
-
explanation: {
|
|
69
|
-
type: 'string',
|
|
70
|
-
description: 'One sentence explanation of why this tool is being used',
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
required: ['instanceId', 'key'],
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
createInvocation(params, invocationId) {
|
|
77
|
-
return new KVGetInvocation(params);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
exports.KVGetTool = KVGetTool;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* KV Store Set Tool - Sets a value in the key-value store
|
|
3
|
-
*/
|
|
4
|
-
import type { ToolInvocation, ToolResult } from '../types';
|
|
5
|
-
import { BaseDeclarativeTool } from '../base-tool';
|
|
6
|
-
/**
|
|
7
|
-
* Parameters for the KVSet tool
|
|
8
|
-
*/
|
|
9
|
-
export interface KVSetParams {
|
|
10
|
-
/**
|
|
11
|
-
* Instance ID
|
|
12
|
-
*/
|
|
13
|
-
instanceId: string;
|
|
14
|
-
/**
|
|
15
|
-
* Key to set
|
|
16
|
-
*/
|
|
17
|
-
key: string;
|
|
18
|
-
/**
|
|
19
|
-
* Value to set (will be JSON stringified)
|
|
20
|
-
*/
|
|
21
|
-
value: any;
|
|
22
|
-
/**
|
|
23
|
-
* Optional namespace
|
|
24
|
-
*/
|
|
25
|
-
namespace?: string;
|
|
26
|
-
/**
|
|
27
|
-
* Optional TTL in seconds
|
|
28
|
-
*/
|
|
29
|
-
ttl?: number;
|
|
30
|
-
/**
|
|
31
|
-
* One sentence explanation of why this tool is being used
|
|
32
|
-
*/
|
|
33
|
-
explanation?: string;
|
|
34
|
-
}
|
|
35
|
-
export declare class KVSetTool extends BaseDeclarativeTool<KVSetParams, ToolResult> {
|
|
36
|
-
constructor();
|
|
37
|
-
createInvocation(params: KVSetParams, invocationId: string): ToolInvocation;
|
|
38
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* KV Store Set Tool - Sets a value in the key-value store
|
|
4
|
-
*/
|
|
5
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.KVSetTool = void 0;
|
|
10
|
-
const base_tool_1 = require("../base-tool");
|
|
11
|
-
const kvStore_1 = __importDefault(require("../../modules/kvStore"));
|
|
12
|
-
class KVSetInvocation extends base_tool_1.BaseToolInvocation {
|
|
13
|
-
constructor(params) {
|
|
14
|
-
super(params);
|
|
15
|
-
}
|
|
16
|
-
toolLocations() {
|
|
17
|
-
return [];
|
|
18
|
-
}
|
|
19
|
-
async execute() {
|
|
20
|
-
try {
|
|
21
|
-
const response = await kvStore_1.default.set(this.params.instanceId, this.params.key, this.params.value, this.params.namespace, this.params.ttl);
|
|
22
|
-
if (!response.success) {
|
|
23
|
-
return {
|
|
24
|
-
llmContent: `Error setting value in KV store: ${response.error || 'Unknown error'}`,
|
|
25
|
-
returnDisplay: `Error setting value in KV store: ${response.error || 'Unknown error'}`,
|
|
26
|
-
error: {
|
|
27
|
-
message: response.error || 'Unknown error',
|
|
28
|
-
type: 'unknown',
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
const content = `Value set successfully for key "${this.params.key}" in instance "${this.params.instanceId}"`;
|
|
33
|
-
return {
|
|
34
|
-
llmContent: content,
|
|
35
|
-
returnDisplay: content,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
catch (error) {
|
|
39
|
-
return {
|
|
40
|
-
llmContent: `Error setting value in KV store: ${error}`,
|
|
41
|
-
returnDisplay: `Error setting value in KV store: ${error}`,
|
|
42
|
-
error: {
|
|
43
|
-
message: String(error),
|
|
44
|
-
type: 'unknown',
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
class KVSetTool extends base_tool_1.BaseDeclarativeTool {
|
|
51
|
-
constructor() {
|
|
52
|
-
super('kvStore_set', 'Set a value in the key-value store by key', {
|
|
53
|
-
type: 'object',
|
|
54
|
-
properties: {
|
|
55
|
-
instanceId: {
|
|
56
|
-
type: 'string',
|
|
57
|
-
description: 'Instance ID',
|
|
58
|
-
},
|
|
59
|
-
key: {
|
|
60
|
-
type: 'string',
|
|
61
|
-
description: 'Key to set',
|
|
62
|
-
},
|
|
63
|
-
value: {
|
|
64
|
-
description: 'Value to set (will be JSON stringified)',
|
|
65
|
-
},
|
|
66
|
-
namespace: {
|
|
67
|
-
type: 'string',
|
|
68
|
-
description: 'Optional namespace',
|
|
69
|
-
},
|
|
70
|
-
ttl: {
|
|
71
|
-
type: 'number',
|
|
72
|
-
description: 'Optional TTL in seconds',
|
|
73
|
-
},
|
|
74
|
-
explanation: {
|
|
75
|
-
type: 'string',
|
|
76
|
-
description: 'One sentence explanation of why this tool is being used',
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
required: ['instanceId', 'key', 'value'],
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
createInvocation(params, invocationId) {
|
|
83
|
-
return new KVSetInvocation(params);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
exports.KVSetTool = KVSetTool;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create Memory Ingestion Pipeline Tool - Creates a new memory ingestion pipeline
|
|
3
|
-
*/
|
|
4
|
-
import type { ToolInvocation, ToolResult } from '../types';
|
|
5
|
-
import { BaseDeclarativeTool } from '../base-tool';
|
|
6
|
-
/**
|
|
7
|
-
* Parameters for the CreateMemoryIngestionPipeline tool
|
|
8
|
-
*/
|
|
9
|
-
export interface CreateMemoryIngestionPipelineParams {
|
|
10
|
-
/**
|
|
11
|
-
* Pipeline ID
|
|
12
|
-
*/
|
|
13
|
-
pipelineId: string;
|
|
14
|
-
/**
|
|
15
|
-
* Pipeline label/name
|
|
16
|
-
*/
|
|
17
|
-
label: string;
|
|
18
|
-
/**
|
|
19
|
-
* Pipeline description
|
|
20
|
-
*/
|
|
21
|
-
description?: string;
|
|
22
|
-
/**
|
|
23
|
-
* Source configuration
|
|
24
|
-
*/
|
|
25
|
-
source: {
|
|
26
|
-
type: string;
|
|
27
|
-
[key: string]: any;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Processors configuration
|
|
31
|
-
*/
|
|
32
|
-
processors: Array<{
|
|
33
|
-
type: string;
|
|
34
|
-
[key: string]: any;
|
|
35
|
-
}>;
|
|
36
|
-
/**
|
|
37
|
-
* One sentence explanation of why this tool is being used
|
|
38
|
-
*/
|
|
39
|
-
explanation?: string;
|
|
40
|
-
}
|
|
41
|
-
export declare class CreateMemoryIngestionPipelineTool extends BaseDeclarativeTool<CreateMemoryIngestionPipelineParams, ToolResult> {
|
|
42
|
-
constructor();
|
|
43
|
-
createInvocation(params: CreateMemoryIngestionPipelineParams, invocationId: string): ToolInvocation;
|
|
44
|
-
}
|