@codebolt/codeboltjs 5.0.9 → 5.1.12
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 +21 -1
- package/dist/core/Codebolt.js +18 -16
- package/dist/core/websocket.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -3
- package/dist/modules/agentDeliberation.js +3 -1
- package/dist/modules/environment.d.ts +25 -0
- package/dist/modules/environment.js +54 -0
- package/dist/modules/swarm.d.ts +2 -8
- package/dist/modules/swarm.js +0 -14
- package/dist/modules/thread.d.ts +6 -0
- package/dist/modules/thread.js +6 -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-agent.d.ts +23 -0
- package/dist/tools/environment/environment-start-agent.js +83 -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 +33 -0
- package/dist/tools/environment/index.js +65 -0
- package/dist/tools/index.d.ts +16 -2
- package/dist/tools/index.js +45 -5
- package/dist/tools/registry.d.ts +21 -0
- package/dist/tools/registry.js +38 -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/types/agentDeliberation.d.ts +15 -1
- package/dist/types/agentDeliberation.js +2 -0
- package/dist/types/job.d.ts +1 -1
- package/package.json +20 -19
package/dist/core/Codebolt.d.ts
CHANGED
|
@@ -547,7 +547,6 @@ declare class Codebolt {
|
|
|
547
547
|
updateAgentStatus: (swarmId: string, agentId: string, data: import("@codebolt/types/sdk").AgentStatusUpdate) => Promise<import("@codebolt/types/sdk").UpdateStatusResponse>;
|
|
548
548
|
getSwarmStatusSummary: (swarmId: string) => Promise<import("@codebolt/types/sdk").GetStatusSummaryResponse>;
|
|
549
549
|
getDefaultJobGroup: (swarmId: string) => Promise<import("@codebolt/types/sdk").GetDefaultJobGroupResponse>;
|
|
550
|
-
getSwarmConfig: (swarmId: string) => Promise<import("@codebolt/types/sdk").GetSwarmConfigResponse>;
|
|
551
550
|
};
|
|
552
551
|
calendar: {
|
|
553
552
|
createEvent: (params: import("../modules/calendar").ICreateEventParams) => Promise<import("../modules/calendar").ICreateEventResponse>;
|
|
@@ -907,6 +906,27 @@ declare class Codebolt {
|
|
|
907
906
|
onMessage: (panelId: string, handler: (data: any) => void) => void;
|
|
908
907
|
offMessage: (panelId: string) => void;
|
|
909
908
|
};
|
|
909
|
+
environment: {
|
|
910
|
+
listEnvironments: () => Promise<any>;
|
|
911
|
+
getEnvironment: (environmentId: string) => Promise<any>;
|
|
912
|
+
createEnvironment: (environmentData: {
|
|
913
|
+
name: string;
|
|
914
|
+
description?: string;
|
|
915
|
+
provider: any;
|
|
916
|
+
config?: any;
|
|
917
|
+
}) => Promise<any>;
|
|
918
|
+
updateEnvironment: (environmentId: string, updateData: any) => Promise<any>;
|
|
919
|
+
deleteEnvironment: (environmentId: string) => Promise<any>;
|
|
920
|
+
startEnvironment: (environmentId: string) => Promise<any>;
|
|
921
|
+
stopEnvironment: (environmentId: string) => Promise<any>;
|
|
922
|
+
restartEnvironment: (environmentId: string) => Promise<any>;
|
|
923
|
+
getEnvironmentStatus: (environmentId: string) => Promise<any>;
|
|
924
|
+
getRunningProviders: () => Promise<any>;
|
|
925
|
+
getLocalProviders: () => Promise<any>;
|
|
926
|
+
getEnvironmentStatistics: () => Promise<any>;
|
|
927
|
+
sendMessageToEnvironment: (environmentId: string, message: any) => Promise<any>;
|
|
928
|
+
startAgentInEnvironment: (environmentId: string, task: string, agentId?: string, threadId?: string) => Promise<any>;
|
|
929
|
+
};
|
|
910
930
|
/**
|
|
911
931
|
* User message utilities for accessing current user message and context
|
|
912
932
|
*/
|
package/dist/core/Codebolt.js
CHANGED
|
@@ -66,6 +66,7 @@ const orchestrator_1 = __importDefault(require("../modules/orchestrator"));
|
|
|
66
66
|
const backgroundChildThreads_1 = __importDefault(require("../modules/backgroundChildThreads"));
|
|
67
67
|
const agentEventQueue_1 = __importDefault(require("../modules/agentEventQueue"));
|
|
68
68
|
const dynamicPanel_1 = __importDefault(require("../modules/dynamicPanel"));
|
|
69
|
+
const environment_1 = __importDefault(require("../modules/environment"));
|
|
69
70
|
/**
|
|
70
71
|
* @class Codebolt
|
|
71
72
|
* @description This class provides a unified interface to interact with various modules.
|
|
@@ -141,6 +142,7 @@ class Codebolt {
|
|
|
141
142
|
this.backgroundChildThreads = backgroundChildThreads_1.default;
|
|
142
143
|
this.agentEventQueue = agentEventQueue_1.default;
|
|
143
144
|
this.dynamicPanel = dynamicPanel_1.default;
|
|
145
|
+
this.environment = environment_1.default;
|
|
144
146
|
/**
|
|
145
147
|
* User message utilities for accessing current user message and context
|
|
146
148
|
*/
|
|
@@ -612,7 +614,7 @@ class Codebolt {
|
|
|
612
614
|
onGetDiffFiles(handler) {
|
|
613
615
|
this.waitForReady().then(() => {
|
|
614
616
|
const handleGetDiffFiles = async (response) => {
|
|
615
|
-
console.log("Get diff files event received");
|
|
617
|
+
// console.log("Get diff files event received");
|
|
616
618
|
if (response.type === "providerGetDiffFiles") {
|
|
617
619
|
try {
|
|
618
620
|
const result = await handler();
|
|
@@ -647,7 +649,7 @@ class Codebolt {
|
|
|
647
649
|
onReadFile(handler) {
|
|
648
650
|
this.waitForReady().then(() => {
|
|
649
651
|
const handleReadFile = async (response) => {
|
|
650
|
-
console.log("Read file event received");
|
|
652
|
+
// console.log("Read file event received");
|
|
651
653
|
if (response.type === "providerReadFile") {
|
|
652
654
|
try {
|
|
653
655
|
const result = await handler(response.path);
|
|
@@ -683,7 +685,7 @@ class Codebolt {
|
|
|
683
685
|
onWriteFile(handler) {
|
|
684
686
|
this.waitForReady().then(() => {
|
|
685
687
|
const handleWriteFile = async (response) => {
|
|
686
|
-
console.log("Write file event received");
|
|
688
|
+
// console.log("Write file event received");
|
|
687
689
|
if (response.type === "providerWriteFile") {
|
|
688
690
|
try {
|
|
689
691
|
const result = await handler(response.path, response.content);
|
|
@@ -719,7 +721,7 @@ class Codebolt {
|
|
|
719
721
|
onDeleteFile(handler) {
|
|
720
722
|
this.waitForReady().then(() => {
|
|
721
723
|
const handleDeleteFile = async (response) => {
|
|
722
|
-
console.log("Delete file event received");
|
|
724
|
+
// console.log("Delete file event received");
|
|
723
725
|
if (response.type === "providerDeleteFile") {
|
|
724
726
|
try {
|
|
725
727
|
const result = await handler(response.path);
|
|
@@ -755,7 +757,7 @@ class Codebolt {
|
|
|
755
757
|
onDeleteFolder(handler) {
|
|
756
758
|
this.waitForReady().then(() => {
|
|
757
759
|
const handleDeleteFolder = async (response) => {
|
|
758
|
-
console.log("Delete folder event received");
|
|
760
|
+
// console.log("Delete folder event received");
|
|
759
761
|
if (response.type === "providerDeleteFolder") {
|
|
760
762
|
try {
|
|
761
763
|
const result = await handler(response.path);
|
|
@@ -791,7 +793,7 @@ class Codebolt {
|
|
|
791
793
|
onRenameItem(handler) {
|
|
792
794
|
this.waitForReady().then(() => {
|
|
793
795
|
const handleRenameItem = async (response) => {
|
|
794
|
-
console.log("Rename item event received");
|
|
796
|
+
// console.log("Rename item event received");
|
|
795
797
|
if (response.type === "providerRenameItem") {
|
|
796
798
|
try {
|
|
797
799
|
const result = await handler(response.oldPath, response.newPath);
|
|
@@ -827,7 +829,7 @@ class Codebolt {
|
|
|
827
829
|
onCreateFolder(handler) {
|
|
828
830
|
this.waitForReady().then(() => {
|
|
829
831
|
const handleCreateFolder = async (response) => {
|
|
830
|
-
console.log("Create folder event received");
|
|
832
|
+
// console.log("Create folder event received");
|
|
831
833
|
if (response.type === "providerCreateFolder") {
|
|
832
834
|
try {
|
|
833
835
|
const result = await handler(response.path);
|
|
@@ -863,7 +865,7 @@ class Codebolt {
|
|
|
863
865
|
onCopyFile(handler) {
|
|
864
866
|
this.waitForReady().then(() => {
|
|
865
867
|
const handleCopyFile = async (response) => {
|
|
866
|
-
console.log("Copy file event received");
|
|
868
|
+
// console.log("Copy file event received");
|
|
867
869
|
if (response.type === "providerCopyFile") {
|
|
868
870
|
try {
|
|
869
871
|
const result = await handler(response.sourcePath, response.destinationPath);
|
|
@@ -899,7 +901,7 @@ class Codebolt {
|
|
|
899
901
|
onCopyFolder(handler) {
|
|
900
902
|
this.waitForReady().then(() => {
|
|
901
903
|
const handleCopyFolder = async (response) => {
|
|
902
|
-
console.log("Copy folder event received");
|
|
904
|
+
// console.log("Copy folder event received");
|
|
903
905
|
if (response.type === "providerCopyFolder") {
|
|
904
906
|
try {
|
|
905
907
|
const result = await handler(response.sourcePath, response.destinationPath);
|
|
@@ -935,7 +937,7 @@ class Codebolt {
|
|
|
935
937
|
onGetFullProject(handler) {
|
|
936
938
|
this.waitForReady().then(() => {
|
|
937
939
|
const handleGetFullProject = async (response) => {
|
|
938
|
-
console.log("Get full project event received");
|
|
940
|
+
// console.log("Get full project event received");
|
|
939
941
|
if (response.type === "providerGetFullProject") {
|
|
940
942
|
try {
|
|
941
943
|
const result = await handler();
|
|
@@ -971,7 +973,7 @@ class Codebolt {
|
|
|
971
973
|
onCloseSignal(handler) {
|
|
972
974
|
this.waitForReady().then(() => {
|
|
973
975
|
const handleCloseSignal = async (response) => {
|
|
974
|
-
console.log("Close signal event received");
|
|
976
|
+
// console.log("Close signal event received");
|
|
975
977
|
if (response.type === "closeSignal") {
|
|
976
978
|
try {
|
|
977
979
|
const result = await handler();
|
|
@@ -1005,7 +1007,7 @@ class Codebolt {
|
|
|
1005
1007
|
onCreatePatchRequest(handler) {
|
|
1006
1008
|
this.waitForReady().then(() => {
|
|
1007
1009
|
const handleCreatePatchRequest = async (response) => {
|
|
1008
|
-
console.log("Create patch request event received");
|
|
1010
|
+
// console.log("Create patch request event received");
|
|
1009
1011
|
if (response.type === "createPatchRequest") {
|
|
1010
1012
|
try {
|
|
1011
1013
|
const result = await handler();
|
|
@@ -1039,7 +1041,7 @@ class Codebolt {
|
|
|
1039
1041
|
onCreatePullRequestRequest(handler) {
|
|
1040
1042
|
this.waitForReady().then(() => {
|
|
1041
1043
|
const handleCreatePullRequestRequest = async (response) => {
|
|
1042
|
-
console.log("Create pull request event received");
|
|
1044
|
+
// console.log("Create pull request event received");
|
|
1043
1045
|
if (response.type === "createPullRequestRequest") {
|
|
1044
1046
|
try {
|
|
1045
1047
|
const result = await handler();
|
|
@@ -1073,7 +1075,7 @@ class Codebolt {
|
|
|
1073
1075
|
onMergeAsPatch(handler) {
|
|
1074
1076
|
this.waitForReady().then(() => {
|
|
1075
1077
|
const handleMergeAsPatch = async (response) => {
|
|
1076
|
-
console.log("Merge as patch event received");
|
|
1078
|
+
// console.log("Merge as patch event received");
|
|
1077
1079
|
if (response.type === "providerMergeAsPatch") {
|
|
1078
1080
|
try {
|
|
1079
1081
|
const result = await handler();
|
|
@@ -1109,7 +1111,7 @@ class Codebolt {
|
|
|
1109
1111
|
onSendPR(handler) {
|
|
1110
1112
|
this.waitForReady().then(() => {
|
|
1111
1113
|
const handleSendPR = async (response) => {
|
|
1112
|
-
console.log("Send PR event received");
|
|
1114
|
+
// console.log("Send PR event received");
|
|
1113
1115
|
if (response.type === "providerSendPR") {
|
|
1114
1116
|
try {
|
|
1115
1117
|
const result = await handler();
|
|
@@ -1145,7 +1147,7 @@ class Codebolt {
|
|
|
1145
1147
|
onGetTreeChildren(handler) {
|
|
1146
1148
|
this.waitForReady().then(() => {
|
|
1147
1149
|
const handleGetTreeChildren = async (response) => {
|
|
1148
|
-
console.log("Get tree children event received");
|
|
1150
|
+
// console.log("Get tree children event received");
|
|
1149
1151
|
if (response.type === "providerGetTreeChildren") {
|
|
1150
1152
|
try {
|
|
1151
1153
|
const result = await handler(response.path);
|
package/dist/core/websocket.js
CHANGED
|
@@ -186,7 +186,7 @@ class cbws {
|
|
|
186
186
|
*/
|
|
187
187
|
get messageManager() {
|
|
188
188
|
if (!this.initialized) {
|
|
189
|
-
console.log('[WebSocket] Accessing message manager (not yet initialized)');
|
|
189
|
+
// console.log('[WebSocket] Accessing message manager (not yet initialized)');
|
|
190
190
|
}
|
|
191
191
|
return messageManager_1.default;
|
|
192
192
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -126,6 +126,7 @@ export { default as projectStructure } from './modules/projectStructure';
|
|
|
126
126
|
export { default as codebaseSearch } from './modules/codebaseSearch';
|
|
127
127
|
export { default as backgroundChildThreads } from './modules/backgroundChildThreads';
|
|
128
128
|
export { default as dynamicPanel } from './modules/dynamicPanel';
|
|
129
|
+
export { default as environment } from './modules/environment';
|
|
129
130
|
export type { DynamicPanelOpenOptions, DynamicPanelOpenResponse, DynamicPanelResponse, DynamicPanelInfo, DynamicPanelListResponse, DynamicPanelMessageEvent, } from './modules/dynamicPanel';
|
|
130
131
|
export { default as tools } from './tools';
|
|
131
132
|
export { Kind, ToolErrorType, ToolConfirmationOutcome, type ToolResult as ToolFrameworkResult, type ToolLocation, type ToolInvocation, type ToolBuilder, type OpenAIToolSchema, type OpenAIFunctionCall, type ToolCallConfirmationDetails, type AnyDeclarativeTool, type AnyToolInvocation, BaseToolInvocation, DeclarativeTool, BaseDeclarativeTool, ToolRegistry, defaultRegistry, allTools, fileTools, searchTools, terminalTools, gitTools, browserTools, agentTools, threadTools, taskTools, orchestratorTools, ReadFileTool, WriteFileTool, EditTool, ListDirectoryTool, ReadManyFilesTool, GlobTool, GrepTool, SearchFilesTool, CodebaseSearchTool, SearchMcpToolTool, ListCodeDefinitionNamesTool, ExecuteCommandTool, GitInitTool, GitStatusTool, GitAddTool, GitCommitTool, GitPushTool, GitPullTool, GitCheckoutTool, GitBranchTool, GitLogsTool, GitDiffTool, GitCloneTool, BrowserNavigateTool, BrowserScreenshotTool, BrowserClickTool, BrowserTypeTool, BrowserScrollTool, BrowserGetContentTool, BrowserGetHtmlTool, BrowserGetMarkdownTool, BrowserGetUrlTool, BrowserCloseTool, BrowserEnterTool, BrowserSearchTool, TaskCreateTool, TaskUpdateTool, TaskDeleteTool, TaskListTool, TaskGetTool, TaskAssignTool, TaskExecuteTool, AgentFindTool, AgentStartTool, AgentListTool, AgentDetailsTool, ThreadCreateTool, ThreadCreateStartTool, ThreadCreateBackgroundTool, ThreadListTool, ThreadGetTool, ThreadStartTool, ThreadUpdateTool, ThreadDeleteTool, ThreadGetMessagesTool, ThreadUpdateStatusTool, OrchestratorListTool, OrchestratorGetTool, OrchestratorGetSettingsTool, OrchestratorCreateTool, OrchestratorUpdateTool, OrchestratorUpdateSettingsTool, OrchestratorDeleteTool, OrchestratorUpdateStatusTool, } from './tools';
|
package/dist/index.js
CHANGED
|
@@ -5,9 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.AgentCompletionNotify = exports.AgentInitNotify = exports.SubagentTaskCompletedNotify = exports.StartSubagentTaskResponseNotify = exports.StartSubagentTaskRequestNotify = exports.notificationFunctions = exports.todoNotifications = exports.terminalNotifications = exports.systemNotifications = exports.searchNotifications = exports.mcpNotifications = exports.llmNotifications = exports.historyNotifications = exports.gitNotifications = exports.fsNotifications = exports.dbmemoryNotifications = exports.crawlerNotifications = exports.codeutilsNotifications = exports.chatNotifications = exports.browserNotifications = exports.agentNotifications = exports.executeOnInstance = exports.closeBrowserInstance = exports.openNewBrowserInstance = exports.setActiveBrowserInstance = exports.getBrowserInstance = exports.listBrowserInstances = exports.editFileAndApplyDiff = exports.queryVectorItems = exports.queryVectorItem = exports.addVectorItem = exports.getVector = exports.utils = exports.getMessageId = exports.getUserMessageTimestamp = exports.getUserSessionData = exports.setUserSessionData = exports.getUploadedImages = exports.getRemixPrompt = exports.getSelection = exports.getCurrentFile = exports.getMentionedMCPs = exports.getMentionedFiles = exports.clearUserMessage = exports.hasCurrentUserMessage = exports.getUserMessageText = exports.getCurrentUserMessage = exports.userMessageUtilities = exports.logType = exports.Codebolt = void 0;
|
|
7
7
|
exports.knowledge = exports.search = exports.crawler = exports.codeutils = exports.terminal = exports.chat = exports.browser = exports.agentDeliberation = exports.groupFeedback = exports.mail = exports.llm = exports.git = exports.fs = exports.agentEventQueue = exports.AgentEventPriority = exports.AgentEventStatus = exports.AgentEventType = exports.agentPortfolio = exports.contextRuleEngine = exports.contextAssembly = exports.memoryIngestion = exports.hook = exports.knowledgeGraph = exports.eventLog = exports.orchestrator = exports.persistentMemory = exports.kvStore = exports.reviewMergeRequest = exports.projectStructureUpdateRequest = exports.fileUpdateIntent = exports.episodicMemory = exports.calendar = exports.swarm = exports.requirementPlan = exports.actionBlock = exports.capability = exports.sideExecution = exports.GitStatusRequestNotify = exports.GitRemoteAddRequestNotify = exports.GitPushRequestNotify = exports.GitPullRequestNotify = exports.GitLogsRequestNotify = exports.GitInitRequestNotify = exports.GitDiffRequestNotify = exports.GitCommitRequestNotify = exports.GitCloneRequestNotify = exports.GitCheckoutRequestNotify = exports.GitBranchRequestNotify = exports.GitAddRequestNotify = exports.CommandExecutionRequestNotify = void 0;
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
10
|
-
exports.OrchestratorUpdateStatusTool = exports.OrchestratorDeleteTool = exports.OrchestratorUpdateSettingsTool = exports.OrchestratorUpdateTool = exports.OrchestratorCreateTool = exports.OrchestratorGetSettingsTool = exports.OrchestratorGetTool = void 0;
|
|
8
|
+
exports.GlobTool = exports.ReadManyFilesTool = exports.ListDirectoryTool = exports.EditTool = exports.WriteFileTool = exports.ReadFileTool = exports.orchestratorTools = exports.taskTools = exports.threadTools = exports.agentTools = exports.browserTools = exports.gitTools = exports.terminalTools = exports.searchTools = exports.fileTools = exports.allTools = exports.defaultRegistry = exports.ToolRegistry = exports.BaseDeclarativeTool = exports.DeclarativeTool = exports.BaseToolInvocation = exports.ToolConfirmationOutcome = exports.ToolErrorType = exports.Kind = exports.tools = exports.environment = exports.dynamicPanel = exports.backgroundChildThreads = exports.codebaseSearch = exports.projectStructure = exports.codemap = exports.roadmap = exports.autoTesting = exports.job = exports.todo = exports.actionPlan = exports.memory = exports.agent = exports.mcp = exports.chatSummary = exports.tokenizer = exports.debug = exports.vectordb = exports.thread = exports.task = exports.state = exports.dbmemory = exports.project = exports.outputparsers = exports.rag = void 0;
|
|
9
|
+
exports.ThreadUpdateStatusTool = exports.ThreadGetMessagesTool = exports.ThreadDeleteTool = exports.ThreadUpdateTool = exports.ThreadStartTool = exports.ThreadGetTool = exports.ThreadListTool = exports.ThreadCreateBackgroundTool = exports.ThreadCreateStartTool = exports.ThreadCreateTool = exports.AgentDetailsTool = exports.AgentListTool = exports.AgentStartTool = exports.AgentFindTool = exports.TaskExecuteTool = exports.TaskAssignTool = exports.TaskGetTool = exports.TaskListTool = exports.TaskDeleteTool = exports.TaskUpdateTool = exports.TaskCreateTool = exports.BrowserSearchTool = exports.BrowserEnterTool = exports.BrowserCloseTool = exports.BrowserGetUrlTool = exports.BrowserGetMarkdownTool = exports.BrowserGetHtmlTool = exports.BrowserGetContentTool = exports.BrowserScrollTool = exports.BrowserTypeTool = exports.BrowserClickTool = exports.BrowserScreenshotTool = exports.BrowserNavigateTool = exports.GitCloneTool = exports.GitDiffTool = exports.GitLogsTool = exports.GitBranchTool = exports.GitCheckoutTool = exports.GitPullTool = exports.GitPushTool = exports.GitCommitTool = exports.GitAddTool = exports.GitStatusTool = exports.GitInitTool = exports.ExecuteCommandTool = exports.ListCodeDefinitionNamesTool = exports.SearchMcpToolTool = exports.CodebaseSearchTool = exports.SearchFilesTool = exports.GrepTool = void 0;
|
|
10
|
+
exports.OrchestratorUpdateStatusTool = exports.OrchestratorDeleteTool = exports.OrchestratorUpdateSettingsTool = exports.OrchestratorUpdateTool = exports.OrchestratorCreateTool = exports.OrchestratorGetSettingsTool = exports.OrchestratorGetTool = exports.OrchestratorListTool = void 0;
|
|
11
11
|
const Codebolt_1 = __importDefault(require("./core/Codebolt"));
|
|
12
12
|
exports.Codebolt = Codebolt_1.default;
|
|
13
13
|
// ================================
|
|
@@ -315,6 +315,9 @@ Object.defineProperty(exports, "backgroundChildThreads", { enumerable: true, get
|
|
|
315
315
|
// DynamicPanel module
|
|
316
316
|
var dynamicPanel_1 = require("./modules/dynamicPanel");
|
|
317
317
|
Object.defineProperty(exports, "dynamicPanel", { enumerable: true, get: function () { return __importDefault(dynamicPanel_1).default; } });
|
|
318
|
+
// Environment module
|
|
319
|
+
var environment_1 = require("./modules/environment");
|
|
320
|
+
Object.defineProperty(exports, "environment", { enumerable: true, get: function () { return __importDefault(environment_1).default; } });
|
|
318
321
|
// ================================
|
|
319
322
|
// Tools Module - LLM-ready tool definitions
|
|
320
323
|
// ================================
|
|
@@ -22,7 +22,9 @@ const cbagentDeliberation = {
|
|
|
22
22
|
return websocket_1.default.messageManager.sendAndWaitForResponse({ type: lib_1.AgentDeliberationAction.RESPOND, ...params }, lib_1.AgentDeliberationResponseType.RESPOND_RESPONSE);
|
|
23
23
|
},
|
|
24
24
|
vote: async (params) => {
|
|
25
|
-
|
|
25
|
+
const action = params.optionId ? lib_1.AgentDeliberationAction.VOTE_OPTION : lib_1.AgentDeliberationAction.VOTE;
|
|
26
|
+
const responseType = params.optionId ? lib_1.AgentDeliberationResponseType.VOTE_OPTION_RESPONSE : lib_1.AgentDeliberationResponseType.VOTE_RESPONSE;
|
|
27
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({ type: action, ...params }, responseType);
|
|
26
28
|
},
|
|
27
29
|
getWinner: async (params) => {
|
|
28
30
|
return websocket_1.default.messageManager.sendAndWaitForResponse({ type: lib_1.AgentDeliberationAction.WINNER, ...params }, lib_1.AgentDeliberationResponseType.WINNER_RESPONSE);
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
startAgentInEnvironment: (environmentId: string, task: string, agentId?: string, threadId?: string) => Promise<any>;
|
|
24
|
+
};
|
|
25
|
+
export default cbenvironment;
|
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
startAgentInEnvironment: (environmentId, task, agentId, threadId) => {
|
|
51
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({ "type": "environment.startAgentInEnvironment", "params": { environmentId, agentId, task, threadId } }, "startAgentInEnvironmentResponse");
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
exports.default = cbenvironment;
|
package/dist/modules/swarm.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CreateSwarmRequest, AgentRegistration, CreateTeamRequest, CreateRoleRequest, CreateVacancyRequest, AgentStatusUpdate, CreateSwarmResponse, ListSwarmsResponse, GetSwarmResponse, GetSwarmAgentsResponse, RegisterAgentResponse, UnregisterAgentResponse, CreateTeamResponse, ListTeamsResponse, GetTeamResponse, JoinTeamResponse, LeaveTeamResponse, DeleteTeamResponse, CreateRoleResponse, ListRolesResponse, GetRoleResponse, AssignRoleResponse, UnassignRoleResponse, GetAgentsByRoleResponse, DeleteRoleResponse, CreateVacancyResponse, ListVacanciesResponse, ApplyForVacancyResponse, CloseVacancyResponse, UpdateStatusResponse, GetStatusSummaryResponse, GetDefaultJobGroupResponse
|
|
2
|
-
export type { CreateSwarmRequest, AgentRegistration, CreateTeamRequest, CreateRoleRequest, CreateVacancyRequest, AgentStatusUpdate, Swarm, SwarmAgent, Team, Role, Vacancy, StatusSummary, SwarmResponse, CreateSwarmResponse, ListSwarmsResponse, GetSwarmResponse, GetSwarmAgentsResponse, RegisterAgentResponse, UnregisterAgentResponse, CreateTeamResponse, ListTeamsResponse, GetTeamResponse, JoinTeamResponse, LeaveTeamResponse, DeleteTeamResponse, CreateRoleResponse, ListRolesResponse, GetRoleResponse, AssignRoleResponse, UnassignRoleResponse, GetAgentsByRoleResponse, DeleteRoleResponse, CreateVacancyResponse, ListVacanciesResponse, ApplyForVacancyResponse, CloseVacancyResponse, UpdateStatusResponse, GetStatusSummaryResponse, GetDefaultJobGroupResponse
|
|
1
|
+
import type { CreateSwarmRequest, AgentRegistration, CreateTeamRequest, CreateRoleRequest, CreateVacancyRequest, AgentStatusUpdate, CreateSwarmResponse, ListSwarmsResponse, GetSwarmResponse, GetSwarmAgentsResponse, RegisterAgentResponse, UnregisterAgentResponse, CreateTeamResponse, ListTeamsResponse, GetTeamResponse, JoinTeamResponse, LeaveTeamResponse, DeleteTeamResponse, CreateRoleResponse, ListRolesResponse, GetRoleResponse, AssignRoleResponse, UnassignRoleResponse, GetAgentsByRoleResponse, DeleteRoleResponse, CreateVacancyResponse, ListVacanciesResponse, ApplyForVacancyResponse, CloseVacancyResponse, UpdateStatusResponse, GetStatusSummaryResponse, GetDefaultJobGroupResponse } from '@codebolt/types/lib';
|
|
2
|
+
export type { CreateSwarmRequest, AgentRegistration, CreateTeamRequest, CreateRoleRequest, CreateVacancyRequest, AgentStatusUpdate, Swarm, SwarmAgent, Team, Role, Vacancy, StatusSummary, SwarmResponse, CreateSwarmResponse, ListSwarmsResponse, GetSwarmResponse, GetSwarmAgentsResponse, RegisterAgentResponse, UnregisterAgentResponse, CreateTeamResponse, ListTeamsResponse, GetTeamResponse, JoinTeamResponse, LeaveTeamResponse, DeleteTeamResponse, CreateRoleResponse, ListRolesResponse, GetRoleResponse, AssignRoleResponse, UnassignRoleResponse, GetAgentsByRoleResponse, DeleteRoleResponse, CreateVacancyResponse, ListVacanciesResponse, ApplyForVacancyResponse, CloseVacancyResponse, UpdateStatusResponse, GetStatusSummaryResponse, GetDefaultJobGroupResponse } from '@codebolt/types/lib';
|
|
3
3
|
/**
|
|
4
4
|
* Swarm Module
|
|
5
5
|
* Provides functionality for managing swarms, agents, teams, roles, and vacancies
|
|
@@ -185,11 +185,5 @@ declare const codeboltSwarm: {
|
|
|
185
185
|
* @returns Promise resolving to the default job group ID
|
|
186
186
|
*/
|
|
187
187
|
getDefaultJobGroup: (swarmId: string) => Promise<GetDefaultJobGroupResponse>;
|
|
188
|
-
/**
|
|
189
|
-
* Get the configuration for a specific swarm
|
|
190
|
-
* @param swarmId - ID of the swarm
|
|
191
|
-
* @returns Promise resolving to swarm configuration
|
|
192
|
-
*/
|
|
193
|
-
getSwarmConfig: (swarmId: string) => Promise<GetSwarmConfigResponse>;
|
|
194
188
|
};
|
|
195
189
|
export default codeboltSwarm;
|
package/dist/modules/swarm.js
CHANGED
|
@@ -442,20 +442,6 @@ const codeboltSwarm = {
|
|
|
442
442
|
requestId,
|
|
443
443
|
swarmId
|
|
444
444
|
}, 'swarmResponse');
|
|
445
|
-
},
|
|
446
|
-
/**
|
|
447
|
-
* Get the configuration for a specific swarm
|
|
448
|
-
* @param swarmId - ID of the swarm
|
|
449
|
-
* @returns Promise resolving to swarm configuration
|
|
450
|
-
*/
|
|
451
|
-
getSwarmConfig: (swarmId) => {
|
|
452
|
-
const requestId = (0, crypto_1.randomUUID)();
|
|
453
|
-
return websocket_1.default.messageManager.sendAndWaitForResponse({
|
|
454
|
-
type: 'swarmEvent',
|
|
455
|
-
action: 'getConfig',
|
|
456
|
-
requestId,
|
|
457
|
-
swarmId
|
|
458
|
-
}, 'swarmResponse');
|
|
459
445
|
}
|
|
460
446
|
};
|
|
461
447
|
exports.default = codeboltSwarm;
|
package/dist/modules/thread.d.ts
CHANGED
|
@@ -16,12 +16,18 @@ declare const threadService: {
|
|
|
16
16
|
/**
|
|
17
17
|
* Creates and immediately starts a new thread.
|
|
18
18
|
* @param {CreateAndStartThreadOptions} options - The thread creation and start parameters
|
|
19
|
+
* @param {boolean} [options.remoteEnv] - If true, creates a remote environment and starts the agent there. If false/undefined, runs locally.
|
|
20
|
+
* @param {Object} [options.environmentProvider] - The environment provider to use when remoteEnv is true. If not specified, the first available provider is used.
|
|
21
|
+
* @param {string} [options.environmentName] - Optional custom name for the remote environment.
|
|
19
22
|
* @returns {Promise<StartThreadResponse>} A promise that resolves with the thread start response
|
|
20
23
|
*/
|
|
21
24
|
createAndStartThread: (options: CreateAndStartThreadOptions) => Promise<StartThreadResponse>;
|
|
22
25
|
/**
|
|
23
26
|
* Creates a thread in the background and resolves when the agent starts or fails.
|
|
24
27
|
* @param {CreateAndStartThreadOptions} options - The thread creation and start parameters
|
|
28
|
+
* @param {boolean} [options.remoteEnv] - If true, creates a remote environment and starts the agent there. If false/undefined, runs locally.
|
|
29
|
+
* @param {Object} [options.environmentProvider] - The environment provider to use when remoteEnv is true.
|
|
30
|
+
* @param {string} [options.environmentName] - Optional custom name for the remote environment.
|
|
25
31
|
* @returns {Promise<ThreadAgentStartedResponse | ThreadAgentStartFailedResponse>} A promise that resolves with ThreadAgentStarted or ThreadAgentStartFailed response
|
|
26
32
|
*/
|
|
27
33
|
createThreadInBackground: (options: CreateAndStartThreadOptions) => Promise<ThreadAgentStartedResponse | ThreadAgentStartFailedResponse>;
|
package/dist/modules/thread.js
CHANGED
|
@@ -29,6 +29,9 @@ const threadService = {
|
|
|
29
29
|
/**
|
|
30
30
|
* Creates and immediately starts a new thread.
|
|
31
31
|
* @param {CreateAndStartThreadOptions} options - The thread creation and start parameters
|
|
32
|
+
* @param {boolean} [options.remoteEnv] - If true, creates a remote environment and starts the agent there. If false/undefined, runs locally.
|
|
33
|
+
* @param {Object} [options.environmentProvider] - The environment provider to use when remoteEnv is true. If not specified, the first available provider is used.
|
|
34
|
+
* @param {string} [options.environmentName] - Optional custom name for the remote environment.
|
|
32
35
|
* @returns {Promise<StartThreadResponse>} A promise that resolves with the thread start response
|
|
33
36
|
*/
|
|
34
37
|
createAndStartThread: async (options) => {
|
|
@@ -48,6 +51,9 @@ const threadService = {
|
|
|
48
51
|
/**
|
|
49
52
|
* Creates a thread in the background and resolves when the agent starts or fails.
|
|
50
53
|
* @param {CreateAndStartThreadOptions} options - The thread creation and start parameters
|
|
54
|
+
* @param {boolean} [options.remoteEnv] - If true, creates a remote environment and starts the agent there. If false/undefined, runs locally.
|
|
55
|
+
* @param {Object} [options.environmentProvider] - The environment provider to use when remoteEnv is true.
|
|
56
|
+
* @param {string} [options.environmentName] - Optional custom name for the remote environment.
|
|
51
57
|
* @returns {Promise<ThreadAgentStartedResponse | ThreadAgentStartFailedResponse>} A promise that resolves with ThreadAgentStarted or ThreadAgentStartFailed response
|
|
52
58
|
*/
|
|
53
59
|
createThreadInBackground: async (options) => {
|
|
@@ -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';
|