@codebolt/codeboltjs 5.0.7 → 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.
Files changed (154) hide show
  1. package/dist/core/Codebolt.d.ts +331 -303
  2. package/dist/core/Codebolt.js +58 -0
  3. package/dist/core/websocket.js +15 -17
  4. package/dist/index.d.ts +67 -29
  5. package/dist/index.js +124 -9
  6. package/dist/modules/agentDeliberation.d.ts +1 -1
  7. package/dist/modules/agentDeliberation.js +9 -9
  8. package/dist/modules/agentEventQueue.d.ts +3 -3
  9. package/dist/modules/agentEventQueue.js +4 -4
  10. package/dist/modules/autoTesting.d.ts +1 -1
  11. package/dist/modules/autoTesting.js +19 -19
  12. package/dist/modules/backgroundChildThreads.js +22 -4
  13. package/dist/modules/codebaseSearch.d.ts +1 -1
  14. package/dist/modules/codemap.d.ts +1 -1
  15. package/dist/modules/contextAssembly.d.ts +1 -1
  16. package/dist/modules/contextRuleEngine.d.ts +1 -1
  17. package/dist/modules/dynamicPanel.d.ts +106 -0
  18. package/dist/modules/dynamicPanel.js +122 -0
  19. package/dist/modules/eventLog.d.ts +1 -1
  20. package/dist/modules/fileUpdateIntent.d.ts +1 -1
  21. package/dist/modules/groupFeedback.d.ts +2 -2
  22. package/dist/modules/groupFeedback.js +8 -8
  23. package/dist/modules/hook.d.ts +1 -1
  24. package/dist/modules/job.d.ts +1 -1
  25. package/dist/modules/knowledgeGraph.d.ts +1 -1
  26. package/dist/modules/kvStore.d.ts +1 -1
  27. package/dist/modules/mcp.js +6 -3
  28. package/dist/modules/memoryIngestion.d.ts +1 -1
  29. package/dist/modules/orchestrator.js +1 -1
  30. package/dist/modules/persistentMemory.d.ts +1 -1
  31. package/dist/modules/projectStructure.d.ts +1 -1
  32. package/dist/modules/projectStructureUpdateRequest.d.ts +1 -1
  33. package/dist/modules/reviewMergeRequest.d.ts +6 -2
  34. package/dist/modules/roadmap.d.ts +1 -1
  35. package/dist/modules/swarm.d.ts +8 -2
  36. package/dist/modules/swarm.js +14 -0
  37. package/dist/modules/user-message-manager.js +4 -4
  38. package/dist/tools/actionBlock/action-block-start.js +1 -4
  39. package/dist/tools/actionPlan/action-plan-create.js +1 -2
  40. package/dist/tools/completion/attempt-completion.d.ts +25 -0
  41. package/dist/tools/completion/attempt-completion.js +45 -0
  42. package/dist/tools/completion/index.d.ts +3 -0
  43. package/dist/tools/completion/index.js +9 -0
  44. package/dist/tools/index.d.ts +6 -3
  45. package/dist/tools/index.js +59 -57
  46. package/dist/tools/job/index.d.ts +3 -1
  47. package/dist/tools/job/index.js +5 -1
  48. package/dist/tools/job/job-remove-dependency.d.ts +28 -0
  49. package/dist/tools/job/job-remove-dependency.js +86 -0
  50. package/dist/tools/requirementPlan/requirement-plan-add-section.js +1 -1
  51. package/dist/tools/requirementPlan/requirement-plan-review.js +1 -1
  52. package/dist/tools/review/review-create.js +1 -1
  53. package/dist/tools/reviewMergeRequest/rmr-create.js +3 -2
  54. package/dist/tools/thread/thread-create-background.js +1 -1
  55. package/dist/tools/utils/schema-validator.d.ts +1 -0
  56. package/dist/tools/utils/schema-validator.js +13 -1
  57. package/dist/types/job.d.ts +1 -1
  58. package/package.json +2 -2
  59. package/dist/modules/codeboltEvent.d.ts +0 -57
  60. package/dist/modules/codeboltEvent.js +0 -217
  61. package/dist/tools/browser/browser-action.d.ts +0 -56
  62. package/dist/tools/browser/browser-action.js +0 -265
  63. package/dist/tools/codeboltEvent/event-add-running-agent.d.ts +0 -25
  64. package/dist/tools/codeboltEvent/event-add-running-agent.js +0 -69
  65. package/dist/tools/codeboltEvent/event-check-background-agent-completion.d.ts +0 -19
  66. package/dist/tools/codeboltEvent/event-check-background-agent-completion.js +0 -64
  67. package/dist/tools/codeboltEvent/event-get-running-agent-count.d.ts +0 -19
  68. package/dist/tools/codeboltEvent/event-get-running-agent-count.js +0 -55
  69. package/dist/tools/codeboltEvent/event-on-background-agent-completion.d.ts +0 -19
  70. package/dist/tools/codeboltEvent/event-on-background-agent-completion.js +0 -56
  71. package/dist/tools/codeboltEvent/event-wait-for-external-event.d.ts +0 -19
  72. package/dist/tools/codeboltEvent/event-wait-for-external-event.js +0 -55
  73. package/dist/tools/codeboltEvent/index.d.ts +0 -19
  74. package/dist/tools/codeboltEvent/index.js +0 -33
  75. package/dist/tools/event/event-add-running-agent.d.ts +0 -32
  76. package/dist/tools/event/event-add-running-agent.js +0 -77
  77. package/dist/tools/event/event-check-agent-event.d.ts +0 -19
  78. package/dist/tools/event/event-check-agent-event.js +0 -63
  79. package/dist/tools/event/event-check-completion.d.ts +0 -19
  80. package/dist/tools/event/event-check-completion.js +0 -73
  81. package/dist/tools/event/event-check-grouped-completion.d.ts +0 -19
  82. package/dist/tools/event/event-check-grouped-completion.js +0 -63
  83. package/dist/tools/event/event-get-running-count.d.ts +0 -19
  84. package/dist/tools/event/event-get-running-count.js +0 -55
  85. package/dist/tools/event/event-on-agent-event.d.ts +0 -19
  86. package/dist/tools/event/event-on-agent-event.js +0 -63
  87. package/dist/tools/event/event-on-completion.d.ts +0 -19
  88. package/dist/tools/event/event-on-completion.js +0 -73
  89. package/dist/tools/event/event-on-grouped-completion.d.ts +0 -19
  90. package/dist/tools/event/event-on-grouped-completion.js +0 -63
  91. package/dist/tools/event/event-wait-any.d.ts +0 -19
  92. package/dist/tools/event/event-wait-any.js +0 -66
  93. package/dist/tools/event/index.d.ts +0 -25
  94. package/dist/tools/event/index.js +0 -48
  95. package/dist/tools/git/git-action.d.ts +0 -48
  96. package/dist/tools/git/git-action.js +0 -279
  97. package/dist/tools/kvStore/kv-store-create-instance.d.ts +0 -26
  98. package/dist/tools/kvStore/kv-store-create-instance.js +0 -79
  99. package/dist/tools/kvStore/kv-store-get.d.ts +0 -30
  100. package/dist/tools/kvStore/kv-store-get.js +0 -80
  101. package/dist/tools/kvStore/kv-store-set.d.ts +0 -38
  102. package/dist/tools/kvStore/kv-store-set.js +0 -86
  103. package/dist/tools/memoryIngestion/mi-create-pipeline.d.ts +0 -44
  104. package/dist/tools/memoryIngestion/mi-create-pipeline.js +0 -114
  105. package/dist/tools/memoryIngestion/mi-list.d.ts +0 -22
  106. package/dist/tools/memoryIngestion/mi-list.js +0 -66
  107. package/dist/tools/orchestration/agent-details.d.ts +0 -15
  108. package/dist/tools/orchestration/agent-details.js +0 -98
  109. package/dist/tools/orchestration/agent-find.d.ts +0 -18
  110. package/dist/tools/orchestration/agent-find.js +0 -125
  111. package/dist/tools/orchestration/agent-list.d.ts +0 -13
  112. package/dist/tools/orchestration/agent-list.js +0 -106
  113. package/dist/tools/orchestration/agent-management.d.ts +0 -44
  114. package/dist/tools/orchestration/agent-management.js +0 -250
  115. package/dist/tools/orchestration/agent-start.d.ts +0 -18
  116. package/dist/tools/orchestration/agent-start.js +0 -90
  117. package/dist/tools/orchestration/index.d.ts +0 -49
  118. package/dist/tools/orchestration/index.js +0 -102
  119. package/dist/tools/orchestration/task-assign.d.ts +0 -18
  120. package/dist/tools/orchestration/task-assign.js +0 -84
  121. package/dist/tools/orchestration/task-create.d.ts +0 -20
  122. package/dist/tools/orchestration/task-create.js +0 -97
  123. package/dist/tools/orchestration/task-delete.d.ts +0 -16
  124. package/dist/tools/orchestration/task-delete.js +0 -77
  125. package/dist/tools/orchestration/task-execute.d.ts +0 -18
  126. package/dist/tools/orchestration/task-execute.js +0 -84
  127. package/dist/tools/orchestration/task-get.d.ts +0 -16
  128. package/dist/tools/orchestration/task-get.js +0 -89
  129. package/dist/tools/orchestration/task-list.d.ts +0 -13
  130. package/dist/tools/orchestration/task-list.js +0 -74
  131. package/dist/tools/orchestration/task-management.d.ts +0 -52
  132. package/dist/tools/orchestration/task-management.js +0 -231
  133. package/dist/tools/orchestration/task-update.d.ts +0 -22
  134. package/dist/tools/orchestration/task-update.js +0 -96
  135. package/dist/tools/orchestration/thread-create-background.d.ts +0 -18
  136. package/dist/tools/orchestration/thread-create-background.js +0 -94
  137. package/dist/tools/orchestration/thread-create-start.d.ts +0 -16
  138. package/dist/tools/orchestration/thread-create-start.js +0 -85
  139. package/dist/tools/orchestration/thread-create.d.ts +0 -16
  140. package/dist/tools/orchestration/thread-create.js +0 -85
  141. package/dist/tools/orchestration/thread-delete.d.ts +0 -16
  142. package/dist/tools/orchestration/thread-delete.js +0 -77
  143. package/dist/tools/orchestration/thread-get-messages.d.ts +0 -24
  144. package/dist/tools/orchestration/thread-get-messages.js +0 -122
  145. package/dist/tools/orchestration/thread-get.d.ts +0 -16
  146. package/dist/tools/orchestration/thread-get.js +0 -85
  147. package/dist/tools/orchestration/thread-list.d.ts +0 -16
  148. package/dist/tools/orchestration/thread-list.js +0 -85
  149. package/dist/tools/orchestration/thread-start.d.ts +0 -16
  150. package/dist/tools/orchestration/thread-start.js +0 -82
  151. package/dist/tools/orchestration/thread-update-status.d.ts +0 -18
  152. package/dist/tools/orchestration/thread-update-status.js +0 -89
  153. package/dist/tools/orchestration/thread-update.d.ts +0 -18
  154. package/dist/tools/orchestration/thread-update.js +0 -89
@@ -1,265 +0,0 @@
1
- "use strict";
2
- /**
3
- * Browser Action Tool - Performs browser automation actions
4
- * Wraps the SDK's cbbrowser 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.BrowserActionTool = void 0;
11
- const types_1 = require("../types");
12
- const base_tool_1 = require("../base-tool");
13
- const browser_1 = __importDefault(require("../../modules/browser"));
14
- class BrowserActionToolInvocation 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
- const options = this.params.instance_id ? { instanceId: this.params.instance_id } : undefined;
23
- let response;
24
- let successMessage;
25
- switch (action) {
26
- case 'navigate':
27
- if (!this.params.url) {
28
- return this.createError("'url' is required for navigate action");
29
- }
30
- response = await browser_1.default.goToPage(this.params.url, options);
31
- successMessage = `Navigated to ${this.params.url}`;
32
- break;
33
- case 'screenshot':
34
- response = await browser_1.default.screenshot(options);
35
- successMessage = 'Screenshot taken';
36
- break;
37
- case 'click':
38
- if (!this.params.element_id) {
39
- return this.createError("'element_id' is required for click action");
40
- }
41
- response = await browser_1.default.click(this.params.element_id, options);
42
- successMessage = `Clicked element: ${this.params.element_id}`;
43
- break;
44
- case 'type':
45
- if (!this.params.element_id) {
46
- return this.createError("'element_id' is required for type action");
47
- }
48
- if (!this.params.text) {
49
- return this.createError("'text' is required for type action");
50
- }
51
- response = await browser_1.default.type(this.params.element_id, this.params.text, options);
52
- successMessage = `Typed text into element: ${this.params.element_id}`;
53
- break;
54
- case 'scroll':
55
- if (!this.params.direction) {
56
- return this.createError("'direction' is required for scroll action");
57
- }
58
- if (!this.params.pixels) {
59
- return this.createError("'pixels' is required for scroll action");
60
- }
61
- response = await browser_1.default.scroll(this.params.direction, this.params.pixels, options);
62
- successMessage = `Scrolled ${this.params.direction} by ${this.params.pixels} pixels`;
63
- break;
64
- case 'get_content':
65
- response = await browser_1.default.getContent(options);
66
- successMessage = 'Retrieved page content';
67
- break;
68
- case 'get_html':
69
- response = await browser_1.default.getHTML(options);
70
- successMessage = 'Retrieved page HTML';
71
- break;
72
- case 'get_markdown':
73
- response = await browser_1.default.getMarkdown(options);
74
- successMessage = 'Retrieved page as Markdown';
75
- break;
76
- case 'get_url':
77
- response = await browser_1.default.getUrl(options);
78
- successMessage = 'Retrieved current URL';
79
- break;
80
- case 'close':
81
- await browser_1.default.close(options);
82
- return {
83
- llmContent: 'Browser closed successfully',
84
- returnDisplay: 'Browser closed',
85
- };
86
- case 'enter':
87
- response = await browser_1.default.enter(options);
88
- successMessage = 'Pressed Enter';
89
- break;
90
- case 'search':
91
- if (!this.params.element_id) {
92
- return this.createError("'element_id' is required for search action");
93
- }
94
- if (!this.params.query) {
95
- return this.createError("'query' is required for search action");
96
- }
97
- response = await browser_1.default.search(this.params.element_id, this.params.query, options);
98
- successMessage = `Searched for: ${this.params.query}`;
99
- break;
100
- default:
101
- return this.createError(`Unknown action: ${action}`);
102
- }
103
- // Check for errors
104
- if (response && !response.success && response.success !== undefined) {
105
- const errorMsg = typeof response.error === 'string'
106
- ? response.error
107
- : ((_a = response.error) === null || _a === void 0 ? void 0 : _a.message) || 'Browser operation failed';
108
- return {
109
- llmContent: `Browser ${action} failed: ${errorMsg}`,
110
- returnDisplay: `Error: ${errorMsg}`,
111
- error: {
112
- message: errorMsg,
113
- type: types_1.ToolErrorType.BROWSER_EXECUTION_ERROR,
114
- },
115
- };
116
- }
117
- // Format output based on action
118
- let output = successMessage;
119
- if (action === 'get_url' && response.url) {
120
- output = `Current URL: ${response.url}`;
121
- }
122
- else if (action === 'get_content' && response.content) {
123
- output = `Page content:\n\n${this.truncate(response.content, 5000)}`;
124
- }
125
- else if (action === 'get_html' && response.html) {
126
- output = `HTML content:\n\n${this.truncate(response.html, 5000)}`;
127
- }
128
- else if (action === 'get_markdown' && response.markdown) {
129
- output = `Markdown content:\n\n${response.markdown}`;
130
- }
131
- else if (action === 'screenshot' && response.screenshot) {
132
- output = 'Screenshot captured successfully.\n\n[Screenshot data available]';
133
- }
134
- else if (response && response.result) {
135
- output += '\n\n' + (typeof response.result === 'string' ? response.result : JSON.stringify(response.result, null, 2));
136
- }
137
- return {
138
- llmContent: output,
139
- returnDisplay: successMessage,
140
- };
141
- }
142
- catch (error) {
143
- const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
144
- return {
145
- llmContent: `Error executing browser ${this.params.action}: ${errorMessage}`,
146
- returnDisplay: `Error: ${errorMessage}`,
147
- error: {
148
- message: errorMessage,
149
- type: types_1.ToolErrorType.EXECUTION_FAILED,
150
- },
151
- };
152
- }
153
- }
154
- createError(message) {
155
- return {
156
- llmContent: `Error: ${message}`,
157
- returnDisplay: `Error: ${message}`,
158
- error: {
159
- message,
160
- type: types_1.ToolErrorType.INVALID_TOOL_PARAMS,
161
- },
162
- };
163
- }
164
- truncate(text, maxLength) {
165
- if (text.length <= maxLength)
166
- return text;
167
- return text.substring(0, maxLength) + '\n\n... (content truncated)';
168
- }
169
- }
170
- /**
171
- * Implementation of the BrowserAction tool logic
172
- */
173
- class BrowserActionTool extends base_tool_1.BaseDeclarativeTool {
174
- constructor() {
175
- super(BrowserActionTool.Name, 'BrowserAction', `Performs browser automation actions like navigating to URLs, taking screenshots, clicking elements, typing text, scrolling, and extracting page content. Use this for web automation and scraping tasks.`, types_1.Kind.Execute, {
176
- properties: {
177
- action: {
178
- description: "The browser action to perform: 'navigate', 'screenshot', 'click', 'type', 'scroll', 'get_content', 'get_html', 'get_markdown', 'get_url', 'close', 'enter', or 'search'.",
179
- type: 'string',
180
- enum: ['navigate', 'screenshot', 'click', 'type', 'scroll', 'get_content', 'get_html', 'get_markdown', 'get_url', 'close', 'enter', 'search'],
181
- },
182
- url: {
183
- description: "URL to navigate to (required for 'navigate' action).",
184
- type: 'string',
185
- },
186
- element_id: {
187
- description: "Element ID to interact with (required for 'click', 'type', 'search' actions).",
188
- type: 'string',
189
- },
190
- text: {
191
- description: "Text to type (required for 'type' action).",
192
- type: 'string',
193
- },
194
- query: {
195
- description: "Search query (required for 'search' action).",
196
- type: 'string',
197
- },
198
- direction: {
199
- description: "Scroll direction: 'up', 'down', 'left', 'right' (required for 'scroll' action).",
200
- type: 'string',
201
- enum: ['up', 'down', 'left', 'right'],
202
- },
203
- pixels: {
204
- description: "Number of pixels to scroll (required for 'scroll' action).",
205
- type: 'string',
206
- },
207
- instance_id: {
208
- description: 'Optional browser instance ID for multi-instance support.',
209
- type: 'string',
210
- },
211
- },
212
- required: ['action'],
213
- type: 'object',
214
- });
215
- }
216
- validateToolParamValues(params) {
217
- const validActions = ['navigate', 'screenshot', 'click', 'type', 'scroll', 'get_content', 'get_html', 'get_markdown', 'get_url', 'close', 'enter', 'search'];
218
- if (!validActions.includes(params.action)) {
219
- return `Invalid action: ${params.action}. Must be one of: ${validActions.join(', ')}`;
220
- }
221
- // Action-specific validation
222
- switch (params.action) {
223
- case 'navigate':
224
- if (!params.url) {
225
- return "'url' is required for navigate action";
226
- }
227
- break;
228
- case 'click':
229
- if (!params.element_id) {
230
- return "'element_id' is required for click action";
231
- }
232
- break;
233
- case 'type':
234
- if (!params.element_id) {
235
- return "'element_id' is required for type action";
236
- }
237
- if (!params.text) {
238
- return "'text' is required for type action";
239
- }
240
- break;
241
- case 'scroll':
242
- if (!params.direction) {
243
- return "'direction' is required for scroll action";
244
- }
245
- if (!params.pixels) {
246
- return "'pixels' is required for scroll action";
247
- }
248
- break;
249
- case 'search':
250
- if (!params.element_id) {
251
- return "'element_id' is required for search action";
252
- }
253
- if (!params.query) {
254
- return "'query' is required for search action";
255
- }
256
- break;
257
- }
258
- return null;
259
- }
260
- createInvocation(params) {
261
- return new BrowserActionToolInvocation(params);
262
- }
263
- }
264
- exports.BrowserActionTool = BrowserActionTool;
265
- BrowserActionTool.Name = 'browser_action';
@@ -1,25 +0,0 @@
1
- /**
2
- * Event Add Running Agent Tool
3
- *
4
- * Adds a running background agent to tracking.
5
- */
6
- import type { ToolInvocation, ToolResult } from '../types';
7
- import { BaseDeclarativeTool } from '../base-tool';
8
- /**
9
- * Parameters for adding a running agent
10
- */
11
- export interface EventAddRunningAgentParams {
12
- /** The thread ID */
13
- threadId: string;
14
- /** The agent data */
15
- data: any;
16
- /** Optional group ID */
17
- groupId?: string;
18
- }
19
- /**
20
- * Tool for adding a running agent
21
- */
22
- export declare class EventAddRunningAgentTool extends BaseDeclarativeTool<EventAddRunningAgentParams, ToolResult> {
23
- constructor();
24
- protected createInvocation(params: EventAddRunningAgentParams): ToolInvocation<EventAddRunningAgentParams, ToolResult>;
25
- }
@@ -1,69 +0,0 @@
1
- "use strict";
2
- /**
3
- * Event Add Running Agent Tool
4
- *
5
- * Adds a running background agent to tracking.
6
- */
7
- var __importDefault = (this && this.__importDefault) || function (mod) {
8
- return (mod && mod.__esModule) ? mod : { "default": mod };
9
- };
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.EventAddRunningAgentTool = void 0;
12
- const types_1 = require("../types");
13
- const base_tool_1 = require("../base-tool");
14
- const codeboltEvent_1 = __importDefault(require("../../modules/codeboltEvent"));
15
- class EventAddRunningAgentInvocation extends base_tool_1.BaseToolInvocation {
16
- constructor(params) {
17
- super(params);
18
- }
19
- async execute(_signal) {
20
- try {
21
- codeboltEvent_1.default.addRunningAgent(this.params.threadId, this.params.data, this.params.groupId);
22
- const groupInfo = this.params.groupId ? ` to group ${this.params.groupId}` : '';
23
- return {
24
- llmContent: `Successfully added running agent ${this.params.threadId}${groupInfo}`,
25
- returnDisplay: `Added running agent ${this.params.threadId}`,
26
- };
27
- }
28
- catch (error) {
29
- const errorMessage = error instanceof Error ? error.message : String(error);
30
- return {
31
- llmContent: `Error: ${errorMessage}`,
32
- returnDisplay: `Error: ${errorMessage}`,
33
- error: {
34
- message: errorMessage,
35
- type: types_1.ToolErrorType.EXECUTION_FAILED,
36
- },
37
- };
38
- }
39
- }
40
- }
41
- /**
42
- * Tool for adding a running agent
43
- */
44
- class EventAddRunningAgentTool extends base_tool_1.BaseDeclarativeTool {
45
- constructor() {
46
- super('event_add_running_agent', 'Add Running Agent', 'Adds a running background agent to tracking with optional group ID.', types_1.Kind.Other, {
47
- type: 'object',
48
- properties: {
49
- threadId: {
50
- type: 'string',
51
- description: 'The thread ID',
52
- },
53
- data: {
54
- type: 'object',
55
- description: 'The agent data',
56
- },
57
- groupId: {
58
- type: 'string',
59
- description: 'Optional group ID',
60
- },
61
- },
62
- required: ['threadId', 'data'],
63
- });
64
- }
65
- createInvocation(params) {
66
- return new EventAddRunningAgentInvocation(params);
67
- }
68
- }
69
- exports.EventAddRunningAgentTool = EventAddRunningAgentTool;
@@ -1,19 +0,0 @@
1
- /**
2
- * Event Check Background Agent Completion Tool
3
- *
4
- * Checks if any background agent has completed (non-blocking).
5
- */
6
- import type { ToolInvocation, ToolResult } from '../types';
7
- import { BaseDeclarativeTool } from '../base-tool';
8
- /**
9
- * Parameters for checking background agent completion (none required)
10
- */
11
- export interface EventCheckBackgroundAgentCompletionParams {
12
- }
13
- /**
14
- * Tool for checking background agent completion
15
- */
16
- export declare class EventCheckBackgroundAgentCompletionTool extends BaseDeclarativeTool<EventCheckBackgroundAgentCompletionParams, ToolResult> {
17
- constructor();
18
- protected createInvocation(params: EventCheckBackgroundAgentCompletionParams): ToolInvocation<EventCheckBackgroundAgentCompletionParams, ToolResult>;
19
- }
@@ -1,64 +0,0 @@
1
- "use strict";
2
- /**
3
- * Event Check Background Agent Completion Tool
4
- *
5
- * Checks if any background agent has completed (non-blocking).
6
- */
7
- var __importDefault = (this && this.__importDefault) || function (mod) {
8
- return (mod && mod.__esModule) ? mod : { "default": mod };
9
- };
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.EventCheckBackgroundAgentCompletionTool = void 0;
12
- const types_1 = require("../types");
13
- const base_tool_1 = require("../base-tool");
14
- const codeboltEvent_1 = __importDefault(require("../../modules/codeboltEvent"));
15
- class EventCheckBackgroundAgentCompletionInvocation extends base_tool_1.BaseToolInvocation {
16
- constructor(params) {
17
- super(params);
18
- }
19
- async execute(_signal) {
20
- try {
21
- const completion = codeboltEvent_1.default.checkForBackgroundAgentCompletion();
22
- if (completion) {
23
- const count = Array.isArray(completion) ? completion.length : 1;
24
- return {
25
- llmContent: `Found ${count} completed background agent(s)`,
26
- returnDisplay: `Found ${count} completed agent(s)`,
27
- };
28
- }
29
- else {
30
- return {
31
- llmContent: 'No completed background agents found',
32
- returnDisplay: 'No completed agents',
33
- };
34
- }
35
- }
36
- catch (error) {
37
- const errorMessage = error instanceof Error ? error.message : String(error);
38
- return {
39
- llmContent: `Error: ${errorMessage}`,
40
- returnDisplay: `Error: ${errorMessage}`,
41
- error: {
42
- message: errorMessage,
43
- type: types_1.ToolErrorType.EXECUTION_FAILED,
44
- },
45
- };
46
- }
47
- }
48
- }
49
- /**
50
- * Tool for checking background agent completion
51
- */
52
- class EventCheckBackgroundAgentCompletionTool extends base_tool_1.BaseDeclarativeTool {
53
- constructor() {
54
- super('event_check_background_agent_completion', 'Check Background Agent Completion', 'Checks if any background agent has completed (non-blocking). Returns completion data if available, or null.', types_1.Kind.Other, {
55
- type: 'object',
56
- properties: {},
57
- required: [],
58
- });
59
- }
60
- createInvocation(params) {
61
- return new EventCheckBackgroundAgentCompletionInvocation(params);
62
- }
63
- }
64
- exports.EventCheckBackgroundAgentCompletionTool = EventCheckBackgroundAgentCompletionTool;
@@ -1,19 +0,0 @@
1
- /**
2
- * Event Get Running Agent Count Tool
3
- *
4
- * Gets the number of currently running background agents.
5
- */
6
- import type { ToolInvocation, ToolResult } from '../types';
7
- import { BaseDeclarativeTool } from '../base-tool';
8
- /**
9
- * Parameters for getting running agent count (none required)
10
- */
11
- export interface EventGetRunningAgentCountParams {
12
- }
13
- /**
14
- * Tool for getting running agent count
15
- */
16
- export declare class EventGetRunningAgentCountTool extends BaseDeclarativeTool<EventGetRunningAgentCountParams, ToolResult> {
17
- constructor();
18
- protected createInvocation(params: EventGetRunningAgentCountParams): ToolInvocation<EventGetRunningAgentCountParams, ToolResult>;
19
- }
@@ -1,55 +0,0 @@
1
- "use strict";
2
- /**
3
- * Event Get Running Agent Count Tool
4
- *
5
- * Gets the number of currently running background agents.
6
- */
7
- var __importDefault = (this && this.__importDefault) || function (mod) {
8
- return (mod && mod.__esModule) ? mod : { "default": mod };
9
- };
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.EventGetRunningAgentCountTool = void 0;
12
- const types_1 = require("../types");
13
- const base_tool_1 = require("../base-tool");
14
- const codeboltEvent_1 = __importDefault(require("../../modules/codeboltEvent"));
15
- class EventGetRunningAgentCountInvocation extends base_tool_1.BaseToolInvocation {
16
- constructor(params) {
17
- super(params);
18
- }
19
- async execute(_signal) {
20
- try {
21
- const count = codeboltEvent_1.default.getRunningAgentCount();
22
- return {
23
- llmContent: `Currently ${count} running background agents`,
24
- returnDisplay: `${count} running agents`,
25
- };
26
- }
27
- catch (error) {
28
- const errorMessage = error instanceof Error ? error.message : String(error);
29
- return {
30
- llmContent: `Error: ${errorMessage}`,
31
- returnDisplay: `Error: ${errorMessage}`,
32
- error: {
33
- message: errorMessage,
34
- type: types_1.ToolErrorType.EXECUTION_FAILED,
35
- },
36
- };
37
- }
38
- }
39
- }
40
- /**
41
- * Tool for getting running agent count
42
- */
43
- class EventGetRunningAgentCountTool extends base_tool_1.BaseDeclarativeTool {
44
- constructor() {
45
- super('event_get_running_agent_count', 'Get Running Agent Count', 'Gets the number of currently running background agents.', types_1.Kind.Other, {
46
- type: 'object',
47
- properties: {},
48
- required: [],
49
- });
50
- }
51
- createInvocation(params) {
52
- return new EventGetRunningAgentCountInvocation(params);
53
- }
54
- }
55
- exports.EventGetRunningAgentCountTool = EventGetRunningAgentCountTool;
@@ -1,19 +0,0 @@
1
- /**
2
- * Event On Background Agent Completion Tool
3
- *
4
- * Waits for background agent completion (blocking).
5
- */
6
- import type { ToolInvocation, ToolResult } from '../types';
7
- import { BaseDeclarativeTool } from '../base-tool';
8
- /**
9
- * Parameters for waiting for background agent completion (none required)
10
- */
11
- export interface EventOnBackgroundAgentCompletionParams {
12
- }
13
- /**
14
- * Tool for waiting for background agent completion
15
- */
16
- export declare class EventOnBackgroundAgentCompletionTool extends BaseDeclarativeTool<EventOnBackgroundAgentCompletionParams, ToolResult> {
17
- constructor();
18
- protected createInvocation(params: EventOnBackgroundAgentCompletionParams): ToolInvocation<EventOnBackgroundAgentCompletionParams, ToolResult>;
19
- }
@@ -1,56 +0,0 @@
1
- "use strict";
2
- /**
3
- * Event On Background Agent Completion Tool
4
- *
5
- * Waits for background agent completion (blocking).
6
- */
7
- var __importDefault = (this && this.__importDefault) || function (mod) {
8
- return (mod && mod.__esModule) ? mod : { "default": mod };
9
- };
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.EventOnBackgroundAgentCompletionTool = void 0;
12
- const types_1 = require("../types");
13
- const base_tool_1 = require("../base-tool");
14
- const codeboltEvent_1 = __importDefault(require("../../modules/codeboltEvent"));
15
- class EventOnBackgroundAgentCompletionInvocation extends base_tool_1.BaseToolInvocation {
16
- constructor(params) {
17
- super(params);
18
- }
19
- async execute(_signal) {
20
- try {
21
- const completion = await codeboltEvent_1.default.onBackgroundAgentCompletion();
22
- const count = Array.isArray(completion) ? completion.length : 1;
23
- return {
24
- llmContent: `Background agent(s) completed: ${count} agent(s)`,
25
- returnDisplay: `${count} agent(s) completed`,
26
- };
27
- }
28
- catch (error) {
29
- const errorMessage = error instanceof Error ? error.message : String(error);
30
- return {
31
- llmContent: `Error: ${errorMessage}`,
32
- returnDisplay: `Error: ${errorMessage}`,
33
- error: {
34
- message: errorMessage,
35
- type: types_1.ToolErrorType.EXECUTION_FAILED,
36
- },
37
- };
38
- }
39
- }
40
- }
41
- /**
42
- * Tool for waiting for background agent completion
43
- */
44
- class EventOnBackgroundAgentCompletionTool extends base_tool_1.BaseDeclarativeTool {
45
- constructor() {
46
- super('event_on_background_agent_completion', 'Wait for Background Agent Completion', 'Waits for background agent completion (blocking). Returns when an agent completes.', types_1.Kind.Other, {
47
- type: 'object',
48
- properties: {},
49
- required: [],
50
- });
51
- }
52
- createInvocation(params) {
53
- return new EventOnBackgroundAgentCompletionInvocation(params);
54
- }
55
- }
56
- exports.EventOnBackgroundAgentCompletionTool = EventOnBackgroundAgentCompletionTool;
@@ -1,19 +0,0 @@
1
- /**
2
- * Event Wait For External Event Tool
3
- *
4
- * Waits for any external event (Background Completion, Group Completion, Agent Event).
5
- */
6
- import type { ToolInvocation, ToolResult } from '../types';
7
- import { BaseDeclarativeTool } from '../base-tool';
8
- /**
9
- * Parameters for waiting for external event (none required)
10
- */
11
- export interface EventWaitForExternalEventParams {
12
- }
13
- /**
14
- * Tool for waiting for any external event
15
- */
16
- export declare class EventWaitForExternalEventTool extends BaseDeclarativeTool<EventWaitForExternalEventParams, ToolResult> {
17
- constructor();
18
- protected createInvocation(params: EventWaitForExternalEventParams): ToolInvocation<EventWaitForExternalEventParams, ToolResult>;
19
- }
@@ -1,55 +0,0 @@
1
- "use strict";
2
- /**
3
- * Event Wait For External Event Tool
4
- *
5
- * Waits for any external event (Background Completion, Group Completion, Agent Event).
6
- */
7
- var __importDefault = (this && this.__importDefault) || function (mod) {
8
- return (mod && mod.__esModule) ? mod : { "default": mod };
9
- };
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.EventWaitForExternalEventTool = void 0;
12
- const types_1 = require("../types");
13
- const base_tool_1 = require("../base-tool");
14
- const codeboltEvent_1 = __importDefault(require("../../modules/codeboltEvent"));
15
- class EventWaitForExternalEventInvocation extends base_tool_1.BaseToolInvocation {
16
- constructor(params) {
17
- super(params);
18
- }
19
- async execute(_signal) {
20
- try {
21
- const event = await codeboltEvent_1.default.waitForAnyExternalEvent();
22
- return {
23
- llmContent: `External event received: ${event.type}`,
24
- returnDisplay: `Event: ${event.type}`,
25
- };
26
- }
27
- catch (error) {
28
- const errorMessage = error instanceof Error ? error.message : String(error);
29
- return {
30
- llmContent: `Error: ${errorMessage}`,
31
- returnDisplay: `Error: ${errorMessage}`,
32
- error: {
33
- message: errorMessage,
34
- type: types_1.ToolErrorType.EXECUTION_FAILED,
35
- },
36
- };
37
- }
38
- }
39
- }
40
- /**
41
- * Tool for waiting for any external event
42
- */
43
- class EventWaitForExternalEventTool extends base_tool_1.BaseDeclarativeTool {
44
- constructor() {
45
- super('event_wait_for_external_event', 'Wait for External Event', 'Waits for any external event (Background Completion, Group Completion, or Agent Event). Returns the event type and data.', types_1.Kind.Other, {
46
- type: 'object',
47
- properties: {},
48
- required: [],
49
- });
50
- }
51
- createInvocation(params) {
52
- return new EventWaitForExternalEventInvocation(params);
53
- }
54
- }
55
- exports.EventWaitForExternalEventTool = EventWaitForExternalEventTool;