@codebolt/codeboltjs 5.0.8 → 5.1.10
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 +48 -5
- package/dist/core/Codebolt.js +76 -16
- package/dist/core/websocket.js +16 -18
- package/dist/index.d.ts +3 -0
- package/dist/index.js +9 -3
- package/dist/modules/agentDeliberation.js +3 -1
- package/dist/modules/dynamicPanel.d.ts +106 -0
- package/dist/modules/dynamicPanel.js +122 -0
- package/dist/modules/environment.d.ts +24 -0
- package/dist/modules/environment.js +51 -0
- package/dist/modules/mcp.js +3 -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/environment/environment-create.d.ts +23 -0
- package/dist/tools/environment/environment-create.js +90 -0
- package/dist/tools/environment/environment-delete.d.ts +17 -0
- package/dist/tools/environment/environment-delete.js +70 -0
- package/dist/tools/environment/environment-get.d.ts +17 -0
- package/dist/tools/environment/environment-get.js +73 -0
- package/dist/tools/environment/environment-list.d.ts +15 -0
- package/dist/tools/environment/environment-list.js +72 -0
- package/dist/tools/environment/environment-providers.d.ts +24 -0
- package/dist/tools/environment/environment-providers.js +130 -0
- package/dist/tools/environment/environment-restart.d.ts +17 -0
- package/dist/tools/environment/environment-restart.js +70 -0
- package/dist/tools/environment/environment-send-message.d.ts +19 -0
- package/dist/tools/environment/environment-send-message.js +74 -0
- package/dist/tools/environment/environment-start.d.ts +17 -0
- package/dist/tools/environment/environment-start.js +70 -0
- package/dist/tools/environment/environment-statistics.d.ts +15 -0
- package/dist/tools/environment/environment-statistics.js +69 -0
- package/dist/tools/environment/environment-status.d.ts +17 -0
- package/dist/tools/environment/environment-status.js +72 -0
- package/dist/tools/environment/environment-stop.d.ts +17 -0
- package/dist/tools/environment/environment-stop.js +70 -0
- package/dist/tools/environment/environment-update.d.ts +19 -0
- package/dist/tools/environment/environment-update.js +74 -0
- package/dist/tools/environment/index.d.ts +31 -0
- package/dist/tools/environment/index.js +61 -0
- package/dist/tools/index.d.ts +20 -3
- package/dist/tools/index.js +55 -8
- 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/registry.d.ts +21 -0
- package/dist/tools/registry.js +38 -1
- package/dist/tools/requirementPlan/requirement-plan-review.js +1 -1
- package/dist/tools/thread/thread-create-background.js +1 -1
- package/dist/tools/tool-search.d.ts +49 -0
- package/dist/tools/tool-search.js +140 -0
- package/dist/tools/toolSearch/index.d.ts +9 -0
- package/dist/tools/toolSearch/index.js +15 -0
- package/dist/tools/toolSearch/tool-search-tool.d.ts +32 -0
- package/dist/tools/toolSearch/tool-search-tool.js +110 -0
- package/dist/tools/utils/schema-validator.d.ts +1 -0
- package/dist/tools/utils/schema-validator.js +13 -1
- package/dist/types/agentDeliberation.d.ts +15 -1
- package/dist/types/agentDeliberation.js +2 -0
- package/package.json +20 -19
- 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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A module for managing environments (create, start, stop, restart, etc.)
|
|
3
|
+
*/
|
|
4
|
+
declare const cbenvironment: {
|
|
5
|
+
listEnvironments: () => Promise<any>;
|
|
6
|
+
getEnvironment: (environmentId: string) => Promise<any>;
|
|
7
|
+
createEnvironment: (environmentData: {
|
|
8
|
+
name: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
provider: any;
|
|
11
|
+
config?: any;
|
|
12
|
+
}) => Promise<any>;
|
|
13
|
+
updateEnvironment: (environmentId: string, updateData: any) => Promise<any>;
|
|
14
|
+
deleteEnvironment: (environmentId: string) => Promise<any>;
|
|
15
|
+
startEnvironment: (environmentId: string) => Promise<any>;
|
|
16
|
+
stopEnvironment: (environmentId: string) => Promise<any>;
|
|
17
|
+
restartEnvironment: (environmentId: string) => Promise<any>;
|
|
18
|
+
getEnvironmentStatus: (environmentId: string) => Promise<any>;
|
|
19
|
+
getRunningProviders: () => Promise<any>;
|
|
20
|
+
getLocalProviders: () => Promise<any>;
|
|
21
|
+
getEnvironmentStatistics: () => Promise<any>;
|
|
22
|
+
sendMessageToEnvironment: (environmentId: string, message: any) => Promise<any>;
|
|
23
|
+
};
|
|
24
|
+
export default cbenvironment;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const websocket_1 = __importDefault(require("../core/websocket"));
|
|
7
|
+
/**
|
|
8
|
+
* A module for managing environments (create, start, stop, restart, etc.)
|
|
9
|
+
*/
|
|
10
|
+
const cbenvironment = {
|
|
11
|
+
listEnvironments: () => {
|
|
12
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({ "type": "environment.listEnvironments" }, "listEnvironmentsResponse");
|
|
13
|
+
},
|
|
14
|
+
getEnvironment: (environmentId) => {
|
|
15
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({ "type": "environment.getEnvironment", "params": { id: environmentId } }, "getEnvironmentResponse");
|
|
16
|
+
},
|
|
17
|
+
createEnvironment: (environmentData) => {
|
|
18
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({ "type": "environment.createEnvironment", "params": { environmentData } }, "createEnvironmentResponse");
|
|
19
|
+
},
|
|
20
|
+
updateEnvironment: (environmentId, updateData) => {
|
|
21
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({ "type": "environment.updateEnvironment", "params": { id: environmentId, updateData } }, "updateEnvironmentResponse");
|
|
22
|
+
},
|
|
23
|
+
deleteEnvironment: (environmentId) => {
|
|
24
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({ "type": "environment.deleteEnvironment", "params": { id: environmentId } }, "deleteEnvironmentResponse");
|
|
25
|
+
},
|
|
26
|
+
startEnvironment: (environmentId) => {
|
|
27
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({ "type": "environment.startEnvironment", "params": { id: environmentId } }, "startEnvironmentResponse");
|
|
28
|
+
},
|
|
29
|
+
stopEnvironment: (environmentId) => {
|
|
30
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({ "type": "environment.stopEnvironment", "params": { id: environmentId } }, "stopEnvironmentResponse");
|
|
31
|
+
},
|
|
32
|
+
restartEnvironment: (environmentId) => {
|
|
33
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({ "type": "environment.restartEnvironment", "params": { id: environmentId } }, "restartEnvironmentResponse");
|
|
34
|
+
},
|
|
35
|
+
getEnvironmentStatus: (environmentId) => {
|
|
36
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({ "type": "environment.getEnvironmentStatus", "params": { id: environmentId } }, "getEnvironmentStatusResponse");
|
|
37
|
+
},
|
|
38
|
+
getRunningProviders: () => {
|
|
39
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({ "type": "environment.getRunningProviders" }, "getRunningProvidersResponse");
|
|
40
|
+
},
|
|
41
|
+
getLocalProviders: () => {
|
|
42
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({ "type": "environment.getLocalProviders" }, "getLocalProvidersResponse");
|
|
43
|
+
},
|
|
44
|
+
getEnvironmentStatistics: () => {
|
|
45
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({ "type": "environment.getEnvironmentStatistics" }, "getEnvironmentStatisticsResponse");
|
|
46
|
+
},
|
|
47
|
+
sendMessageToEnvironment: (environmentId, message) => {
|
|
48
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({ "type": "environment.sendMessageToEnvironment", "params": { id: environmentId, message } }, "sendMessageToEnvironmentResponse");
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
exports.default = cbenvironment;
|
package/dist/modules/mcp.js
CHANGED
|
@@ -183,6 +183,9 @@ const codeboltMCP = {
|
|
|
183
183
|
*/
|
|
184
184
|
executeTool: async (toolbox, toolName, params) => {
|
|
185
185
|
// Handle local codebolt tools
|
|
186
|
+
if (toolbox == undefined) {
|
|
187
|
+
toolbox = "codebolt";
|
|
188
|
+
}
|
|
186
189
|
if (isCodeboltToolbox(toolbox)) {
|
|
187
190
|
// Extract actual tool name (in case it comes prefixed)
|
|
188
191
|
const actualToolName = extractToolName(toolName);
|
|
@@ -24,10 +24,7 @@ class StartActionBlockInvocation extends base_tool_1.BaseToolInvocation {
|
|
|
24
24
|
error: { message: response.error || 'Unknown error', type: types_1.ToolErrorType.EXECUTION_FAILED },
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
? `ActionBlock "${this.params.actionBlockName}" started. ID: ${response.sideExecutionId}`
|
|
29
|
-
: `ActionBlock "${this.params.actionBlockName}" started`;
|
|
30
|
-
return { llmContent: content, returnDisplay: content };
|
|
27
|
+
return { llmContent: JSON.stringify(response), returnDisplay: JSON.stringify(response) };
|
|
31
28
|
}
|
|
32
29
|
catch (error) {
|
|
33
30
|
return {
|
|
@@ -12,7 +12,6 @@ class CreateActionPlanInvocation extends base_tool_1.BaseToolInvocation {
|
|
|
12
12
|
super(params);
|
|
13
13
|
}
|
|
14
14
|
async execute(_signal) {
|
|
15
|
-
var _a;
|
|
16
15
|
try {
|
|
17
16
|
const { name, description, agentId, agentName, status, planId } = this.params;
|
|
18
17
|
const response = await actionPlan_1.default.createActionPlan({ name, description, agentId, agentName, status, planId });
|
|
@@ -23,7 +22,7 @@ class CreateActionPlanInvocation extends base_tool_1.BaseToolInvocation {
|
|
|
23
22
|
error: { message: response.error || 'Unknown error', type: types_1.ToolErrorType.EXECUTION_FAILED },
|
|
24
23
|
};
|
|
25
24
|
}
|
|
26
|
-
const content =
|
|
25
|
+
const content = JSON.stringify(response, null, 2);
|
|
27
26
|
return { llmContent: content, returnDisplay: content };
|
|
28
27
|
}
|
|
29
28
|
catch (error) {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attempt Completion Tool - Signals the completion of a task
|
|
3
|
+
*/
|
|
4
|
+
import { BaseDeclarativeTool, ToolInvocation, ToolResult } from '../base-tool';
|
|
5
|
+
/**
|
|
6
|
+
* Parameters for the AttemptCompletion tool
|
|
7
|
+
*/
|
|
8
|
+
export interface AttemptCompletionToolParams {
|
|
9
|
+
/**
|
|
10
|
+
* The final result of the task
|
|
11
|
+
*/
|
|
12
|
+
result: Record<string, any>;
|
|
13
|
+
/**
|
|
14
|
+
* Optional explanation of the completion
|
|
15
|
+
*/
|
|
16
|
+
explanation?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Implementation of the AttemptCompletion tool
|
|
20
|
+
*/
|
|
21
|
+
export declare class AttemptCompletionTool extends BaseDeclarativeTool<AttemptCompletionToolParams, ToolResult> {
|
|
22
|
+
static readonly Name: string;
|
|
23
|
+
constructor();
|
|
24
|
+
protected createInvocation(params: AttemptCompletionToolParams): ToolInvocation<AttemptCompletionToolParams, ToolResult>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Attempt Completion Tool - Signals the completion of a task
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AttemptCompletionTool = void 0;
|
|
7
|
+
const base_tool_1 = require("../base-tool");
|
|
8
|
+
class AttemptCompletionToolInvocation extends base_tool_1.BaseToolInvocation {
|
|
9
|
+
constructor(params) {
|
|
10
|
+
super(params);
|
|
11
|
+
}
|
|
12
|
+
async execute() {
|
|
13
|
+
return {
|
|
14
|
+
llmContent: JSON.stringify(this.params.result, null, 2),
|
|
15
|
+
returnDisplay: `Task Completed.\n\nResult:\n\`\`\`json\n${JSON.stringify(this.params.result, null, 2)}\n\`\`\``,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Implementation of the AttemptCompletion tool
|
|
21
|
+
*/
|
|
22
|
+
class AttemptCompletionTool extends base_tool_1.BaseDeclarativeTool {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(AttemptCompletionTool.Name, 'AttemptCompletion', 'Signals the completion of the task and returns the final result.', base_tool_1.Kind.Other, {
|
|
25
|
+
type: 'object',
|
|
26
|
+
properties: {
|
|
27
|
+
result: {
|
|
28
|
+
type: 'object',
|
|
29
|
+
description: 'The final result of the task. The structure of this object should match the format specified in the system prompt.',
|
|
30
|
+
additionalProperties: true,
|
|
31
|
+
},
|
|
32
|
+
explanation: {
|
|
33
|
+
type: 'string',
|
|
34
|
+
description: 'Optional explanation of why the task is receiving this result.',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
required: ['result'],
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
createInvocation(params) {
|
|
41
|
+
return new AttemptCompletionToolInvocation(params);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.AttemptCompletionTool = AttemptCompletionTool;
|
|
45
|
+
AttemptCompletionTool.Name = 'attempt_completion';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.completionTools = exports.AttemptCompletionTool = void 0;
|
|
4
|
+
const attempt_completion_1 = require("./attempt-completion");
|
|
5
|
+
var attempt_completion_2 = require("./attempt-completion");
|
|
6
|
+
Object.defineProperty(exports, "AttemptCompletionTool", { enumerable: true, get: function () { return attempt_completion_2.AttemptCompletionTool; } });
|
|
7
|
+
exports.completionTools = [
|
|
8
|
+
new attempt_completion_1.AttemptCompletionTool(),
|
|
9
|
+
];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment Create Tool - Creates a new environment
|
|
3
|
+
* Wraps the SDK's cbenvironment.createEnvironment() method
|
|
4
|
+
*/
|
|
5
|
+
import type { ToolInvocation, ToolResult } from '../types';
|
|
6
|
+
import { BaseDeclarativeTool } from '../base-tool';
|
|
7
|
+
export interface EnvironmentCreateParams {
|
|
8
|
+
/** One sentence explanation of why this tool is being used */
|
|
9
|
+
explanation?: string;
|
|
10
|
+
/** The name of the environment */
|
|
11
|
+
name: string;
|
|
12
|
+
/** Optional description */
|
|
13
|
+
description?: string;
|
|
14
|
+
/** Provider configuration (must match an available local provider) */
|
|
15
|
+
provider: any;
|
|
16
|
+
/** Optional additional configuration */
|
|
17
|
+
config?: any;
|
|
18
|
+
}
|
|
19
|
+
export declare class EnvironmentCreateTool extends BaseDeclarativeTool<EnvironmentCreateParams, ToolResult> {
|
|
20
|
+
static readonly Name: string;
|
|
21
|
+
constructor();
|
|
22
|
+
protected createInvocation(params: EnvironmentCreateParams): ToolInvocation<EnvironmentCreateParams, ToolResult>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Environment Create Tool - Creates a new environment
|
|
4
|
+
* Wraps the SDK's cbenvironment.createEnvironment() method
|
|
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.EnvironmentCreateTool = void 0;
|
|
11
|
+
const types_1 = require("../types");
|
|
12
|
+
const base_tool_1 = require("../base-tool");
|
|
13
|
+
const environment_1 = __importDefault(require("../../modules/environment"));
|
|
14
|
+
const chat_1 = __importDefault(require("../../modules/chat"));
|
|
15
|
+
class EnvironmentCreateInvocation extends base_tool_1.BaseToolInvocation {
|
|
16
|
+
constructor(params) {
|
|
17
|
+
super(params);
|
|
18
|
+
}
|
|
19
|
+
async execute() {
|
|
20
|
+
var _a;
|
|
21
|
+
try {
|
|
22
|
+
if (this.params.explanation) {
|
|
23
|
+
chat_1.default.sendMessage(this.params.explanation);
|
|
24
|
+
}
|
|
25
|
+
const response = await environment_1.default.createEnvironment({
|
|
26
|
+
name: this.params.name,
|
|
27
|
+
description: this.params.description,
|
|
28
|
+
provider: this.params.provider,
|
|
29
|
+
config: this.params.config,
|
|
30
|
+
});
|
|
31
|
+
if (response && response.success === false) {
|
|
32
|
+
const errorMsg = response.error || 'Failed to create environment';
|
|
33
|
+
return {
|
|
34
|
+
llmContent: `Failed to create environment: ${errorMsg}`,
|
|
35
|
+
returnDisplay: `Error: ${errorMsg}`,
|
|
36
|
+
error: { message: errorMsg, type: types_1.ToolErrorType.EXECUTION_FAILED },
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
const env = (_a = response.data) === null || _a === void 0 ? void 0 : _a.environment;
|
|
40
|
+
const output = `Environment created successfully.\nName: ${(env === null || env === void 0 ? void 0 : env.name) || this.params.name}\nID: ${(env === null || env === void 0 ? void 0 : env.id) || 'N/A'}\n${response.message || ''}`;
|
|
41
|
+
return {
|
|
42
|
+
llmContent: output,
|
|
43
|
+
returnDisplay: `Created environment: ${(env === null || env === void 0 ? void 0 : env.name) || this.params.name}`,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
48
|
+
return {
|
|
49
|
+
llmContent: `Error creating environment: ${errorMessage}`,
|
|
50
|
+
returnDisplay: `Error: ${errorMessage}`,
|
|
51
|
+
error: { message: errorMessage, type: types_1.ToolErrorType.EXECUTION_FAILED },
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
class EnvironmentCreateTool extends base_tool_1.BaseDeclarativeTool {
|
|
57
|
+
constructor() {
|
|
58
|
+
super(EnvironmentCreateTool.Name, 'EnvironmentCreate', 'Creates a new environment with the specified name and provider. The provider must be from the available local providers list.', types_1.Kind.Execute, {
|
|
59
|
+
properties: {
|
|
60
|
+
explanation: {
|
|
61
|
+
description: "One sentence explanation as to why this tool is being used, and how it contributes to the goal.",
|
|
62
|
+
type: 'string',
|
|
63
|
+
},
|
|
64
|
+
name: {
|
|
65
|
+
description: 'The name of the environment to create.',
|
|
66
|
+
type: 'string',
|
|
67
|
+
},
|
|
68
|
+
description: {
|
|
69
|
+
description: 'Optional description of the environment.',
|
|
70
|
+
type: 'string',
|
|
71
|
+
},
|
|
72
|
+
provider: {
|
|
73
|
+
description: 'Provider configuration object. Must include at least a name or unique_id matching an available local provider.',
|
|
74
|
+
type: 'object',
|
|
75
|
+
},
|
|
76
|
+
config: {
|
|
77
|
+
description: 'Optional additional configuration.',
|
|
78
|
+
type: 'object',
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
required: ['name', 'provider'],
|
|
82
|
+
type: 'object',
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
createInvocation(params) {
|
|
86
|
+
return new EnvironmentCreateInvocation(params);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.EnvironmentCreateTool = EnvironmentCreateTool;
|
|
90
|
+
EnvironmentCreateTool.Name = 'environment_create';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment Delete Tool - Deletes an environment
|
|
3
|
+
* Wraps the SDK's cbenvironment.deleteEnvironment() method
|
|
4
|
+
*/
|
|
5
|
+
import type { ToolInvocation, ToolResult } from '../types';
|
|
6
|
+
import { BaseDeclarativeTool } from '../base-tool';
|
|
7
|
+
export interface EnvironmentDeleteParams {
|
|
8
|
+
/** One sentence explanation of why this tool is being used */
|
|
9
|
+
explanation?: string;
|
|
10
|
+
/** The ID of the environment to delete */
|
|
11
|
+
environmentId: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class EnvironmentDeleteTool extends BaseDeclarativeTool<EnvironmentDeleteParams, ToolResult> {
|
|
14
|
+
static readonly Name: string;
|
|
15
|
+
constructor();
|
|
16
|
+
protected createInvocation(params: EnvironmentDeleteParams): ToolInvocation<EnvironmentDeleteParams, ToolResult>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Environment Delete Tool - Deletes an environment
|
|
4
|
+
* Wraps the SDK's cbenvironment.deleteEnvironment() method
|
|
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.EnvironmentDeleteTool = void 0;
|
|
11
|
+
const types_1 = require("../types");
|
|
12
|
+
const base_tool_1 = require("../base-tool");
|
|
13
|
+
const environment_1 = __importDefault(require("../../modules/environment"));
|
|
14
|
+
const chat_1 = __importDefault(require("../../modules/chat"));
|
|
15
|
+
class EnvironmentDeleteInvocation extends base_tool_1.BaseToolInvocation {
|
|
16
|
+
constructor(params) {
|
|
17
|
+
super(params);
|
|
18
|
+
}
|
|
19
|
+
async execute() {
|
|
20
|
+
try {
|
|
21
|
+
if (this.params.explanation) {
|
|
22
|
+
chat_1.default.sendMessage(this.params.explanation);
|
|
23
|
+
}
|
|
24
|
+
const response = await environment_1.default.deleteEnvironment(this.params.environmentId);
|
|
25
|
+
if (response && response.success === false) {
|
|
26
|
+
const errorMsg = response.error || response.message || 'Failed to delete environment';
|
|
27
|
+
return {
|
|
28
|
+
llmContent: `Failed to delete environment: ${errorMsg}`,
|
|
29
|
+
returnDisplay: `Error: ${errorMsg}`,
|
|
30
|
+
error: { message: errorMsg, type: types_1.ToolErrorType.EXECUTION_FAILED },
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
llmContent: `Environment ${this.params.environmentId} deleted successfully.`,
|
|
35
|
+
returnDisplay: `Deleted environment: ${this.params.environmentId}`,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
40
|
+
return {
|
|
41
|
+
llmContent: `Error deleting environment: ${errorMessage}`,
|
|
42
|
+
returnDisplay: `Error: ${errorMessage}`,
|
|
43
|
+
error: { message: errorMessage, type: types_1.ToolErrorType.EXECUTION_FAILED },
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
class EnvironmentDeleteTool extends base_tool_1.BaseDeclarativeTool {
|
|
49
|
+
constructor() {
|
|
50
|
+
super(EnvironmentDeleteTool.Name, 'EnvironmentDelete', 'Deletes an environment by ID.', types_1.Kind.Delete, {
|
|
51
|
+
properties: {
|
|
52
|
+
explanation: {
|
|
53
|
+
description: "One sentence explanation as to why this tool is being used, and how it contributes to the goal.",
|
|
54
|
+
type: 'string',
|
|
55
|
+
},
|
|
56
|
+
environmentId: {
|
|
57
|
+
description: 'The ID of the environment to delete.',
|
|
58
|
+
type: 'string',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
required: ['environmentId'],
|
|
62
|
+
type: 'object',
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
createInvocation(params) {
|
|
66
|
+
return new EnvironmentDeleteInvocation(params);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.EnvironmentDeleteTool = EnvironmentDeleteTool;
|
|
70
|
+
EnvironmentDeleteTool.Name = 'environment_delete';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment Get Tool - Gets an environment by ID
|
|
3
|
+
* Wraps the SDK's cbenvironment.getEnvironment() method
|
|
4
|
+
*/
|
|
5
|
+
import type { ToolInvocation, ToolResult } from '../types';
|
|
6
|
+
import { BaseDeclarativeTool } from '../base-tool';
|
|
7
|
+
export interface EnvironmentGetParams {
|
|
8
|
+
/** One sentence explanation of why this tool is being used */
|
|
9
|
+
explanation?: string;
|
|
10
|
+
/** The ID of the environment to retrieve */
|
|
11
|
+
environmentId: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class EnvironmentGetTool extends BaseDeclarativeTool<EnvironmentGetParams, ToolResult> {
|
|
14
|
+
static readonly Name: string;
|
|
15
|
+
constructor();
|
|
16
|
+
protected createInvocation(params: EnvironmentGetParams): ToolInvocation<EnvironmentGetParams, ToolResult>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Environment Get Tool - Gets an environment by ID
|
|
4
|
+
* Wraps the SDK's cbenvironment.getEnvironment() method
|
|
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.EnvironmentGetTool = void 0;
|
|
11
|
+
const types_1 = require("../types");
|
|
12
|
+
const base_tool_1 = require("../base-tool");
|
|
13
|
+
const environment_1 = __importDefault(require("../../modules/environment"));
|
|
14
|
+
const chat_1 = __importDefault(require("../../modules/chat"));
|
|
15
|
+
class EnvironmentGetInvocation extends base_tool_1.BaseToolInvocation {
|
|
16
|
+
constructor(params) {
|
|
17
|
+
super(params);
|
|
18
|
+
}
|
|
19
|
+
async execute() {
|
|
20
|
+
var _a, _b;
|
|
21
|
+
try {
|
|
22
|
+
if (this.params.explanation) {
|
|
23
|
+
chat_1.default.sendMessage(this.params.explanation);
|
|
24
|
+
}
|
|
25
|
+
const response = await environment_1.default.getEnvironment(this.params.environmentId);
|
|
26
|
+
if (response && response.success === false) {
|
|
27
|
+
const errorMsg = response.error || 'Environment not found';
|
|
28
|
+
return {
|
|
29
|
+
llmContent: `Failed to get environment: ${errorMsg}`,
|
|
30
|
+
returnDisplay: `Error: ${errorMsg}`,
|
|
31
|
+
error: { message: errorMsg, type: types_1.ToolErrorType.EXECUTION_FAILED },
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
const env = (_a = response.data) === null || _a === void 0 ? void 0 : _a.environment;
|
|
35
|
+
const output = `Environment: ${(env === null || env === void 0 ? void 0 : env.name) || 'N/A'} (ID: ${(env === null || env === void 0 ? void 0 : env.id) || this.params.environmentId})\nProvider: ${((_b = env === null || env === void 0 ? void 0 : env.provider) === null || _b === void 0 ? void 0 : _b.name) || 'N/A'}\n${JSON.stringify(env, null, 2)}`;
|
|
36
|
+
return {
|
|
37
|
+
llmContent: output,
|
|
38
|
+
returnDisplay: `Retrieved environment: ${(env === null || env === void 0 ? void 0 : env.name) || this.params.environmentId}`,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
43
|
+
return {
|
|
44
|
+
llmContent: `Error getting environment: ${errorMessage}`,
|
|
45
|
+
returnDisplay: `Error: ${errorMessage}`,
|
|
46
|
+
error: { message: errorMessage, type: types_1.ToolErrorType.EXECUTION_FAILED },
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
class EnvironmentGetTool extends base_tool_1.BaseDeclarativeTool {
|
|
52
|
+
constructor() {
|
|
53
|
+
super(EnvironmentGetTool.Name, 'EnvironmentGet', 'Gets an environment by its ID.', types_1.Kind.Read, {
|
|
54
|
+
properties: {
|
|
55
|
+
explanation: {
|
|
56
|
+
description: "One sentence explanation as to why this tool is being used, and how it contributes to the goal.",
|
|
57
|
+
type: 'string',
|
|
58
|
+
},
|
|
59
|
+
environmentId: {
|
|
60
|
+
description: 'The ID of the environment to retrieve.',
|
|
61
|
+
type: 'string',
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
required: ['environmentId'],
|
|
65
|
+
type: 'object',
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
createInvocation(params) {
|
|
69
|
+
return new EnvironmentGetInvocation(params);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.EnvironmentGetTool = EnvironmentGetTool;
|
|
73
|
+
EnvironmentGetTool.Name = 'environment_get';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment List Tool - Lists all environments
|
|
3
|
+
* Wraps the SDK's cbenvironment.listEnvironments() method
|
|
4
|
+
*/
|
|
5
|
+
import type { ToolInvocation, ToolResult } from '../types';
|
|
6
|
+
import { BaseDeclarativeTool } from '../base-tool';
|
|
7
|
+
export interface EnvironmentListParams {
|
|
8
|
+
/** One sentence explanation of why this tool is being used */
|
|
9
|
+
explanation?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class EnvironmentListTool extends BaseDeclarativeTool<EnvironmentListParams, ToolResult> {
|
|
12
|
+
static readonly Name: string;
|
|
13
|
+
constructor();
|
|
14
|
+
protected createInvocation(params: EnvironmentListParams): ToolInvocation<EnvironmentListParams, ToolResult>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Environment List Tool - Lists all environments
|
|
4
|
+
* Wraps the SDK's cbenvironment.listEnvironments() method
|
|
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.EnvironmentListTool = void 0;
|
|
11
|
+
const types_1 = require("../types");
|
|
12
|
+
const base_tool_1 = require("../base-tool");
|
|
13
|
+
const environment_1 = __importDefault(require("../../modules/environment"));
|
|
14
|
+
const chat_1 = __importDefault(require("../../modules/chat"));
|
|
15
|
+
class EnvironmentListInvocation extends base_tool_1.BaseToolInvocation {
|
|
16
|
+
constructor(params) {
|
|
17
|
+
super(params);
|
|
18
|
+
}
|
|
19
|
+
async execute() {
|
|
20
|
+
var _a, _b;
|
|
21
|
+
try {
|
|
22
|
+
if (this.params.explanation) {
|
|
23
|
+
chat_1.default.sendMessage(this.params.explanation);
|
|
24
|
+
}
|
|
25
|
+
const response = await environment_1.default.listEnvironments();
|
|
26
|
+
if (response && response.success === false) {
|
|
27
|
+
const errorMsg = response.error || 'Failed to list environments';
|
|
28
|
+
return {
|
|
29
|
+
llmContent: `Failed to list environments: ${errorMsg}`,
|
|
30
|
+
returnDisplay: `Error: ${errorMsg}`,
|
|
31
|
+
error: { message: errorMsg, type: types_1.ToolErrorType.EXECUTION_FAILED },
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
const environments = ((_a = response.data) === null || _a === void 0 ? void 0 : _a.environments) || [];
|
|
35
|
+
let output = `Retrieved ${environments.length} environment(s):\n`;
|
|
36
|
+
for (const env of environments) {
|
|
37
|
+
output += `- ${env.id}: ${env.name} (provider: ${((_b = env.provider) === null || _b === void 0 ? void 0 : _b.name) || 'N/A'})\n`;
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
llmContent: output,
|
|
41
|
+
returnDisplay: `Listed ${environments.length} environment(s)`,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
46
|
+
return {
|
|
47
|
+
llmContent: `Error listing environments: ${errorMessage}`,
|
|
48
|
+
returnDisplay: `Error: ${errorMessage}`,
|
|
49
|
+
error: { message: errorMessage, type: types_1.ToolErrorType.EXECUTION_FAILED },
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
class EnvironmentListTool extends base_tool_1.BaseDeclarativeTool {
|
|
55
|
+
constructor() {
|
|
56
|
+
super(EnvironmentListTool.Name, 'EnvironmentList', 'Lists all environments.', types_1.Kind.Read, {
|
|
57
|
+
properties: {
|
|
58
|
+
explanation: {
|
|
59
|
+
description: "One sentence explanation as to why this tool is being used, and how it contributes to the goal.",
|
|
60
|
+
type: 'string',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
required: [],
|
|
64
|
+
type: 'object',
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
createInvocation(params) {
|
|
68
|
+
return new EnvironmentListInvocation(params);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.EnvironmentListTool = EnvironmentListTool;
|
|
72
|
+
EnvironmentListTool.Name = 'environment_list';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment Provider Tools - Get local and running providers
|
|
3
|
+
* Wraps the SDK's cbenvironment.getLocalProviders() and getRunningProviders() methods
|
|
4
|
+
*/
|
|
5
|
+
import type { ToolInvocation, ToolResult } from '../types';
|
|
6
|
+
import { BaseDeclarativeTool } from '../base-tool';
|
|
7
|
+
export interface EnvironmentGetLocalProvidersParams {
|
|
8
|
+
/** One sentence explanation of why this tool is being used */
|
|
9
|
+
explanation?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class EnvironmentGetLocalProvidersTool extends BaseDeclarativeTool<EnvironmentGetLocalProvidersParams, ToolResult> {
|
|
12
|
+
static readonly Name: string;
|
|
13
|
+
constructor();
|
|
14
|
+
protected createInvocation(params: EnvironmentGetLocalProvidersParams): ToolInvocation<EnvironmentGetLocalProvidersParams, ToolResult>;
|
|
15
|
+
}
|
|
16
|
+
export interface EnvironmentGetRunningProvidersParams {
|
|
17
|
+
/** One sentence explanation of why this tool is being used */
|
|
18
|
+
explanation?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare class EnvironmentGetRunningProvidersTool extends BaseDeclarativeTool<EnvironmentGetRunningProvidersParams, ToolResult> {
|
|
21
|
+
static readonly Name: string;
|
|
22
|
+
constructor();
|
|
23
|
+
protected createInvocation(params: EnvironmentGetRunningProvidersParams): ToolInvocation<EnvironmentGetRunningProvidersParams, ToolResult>;
|
|
24
|
+
}
|