@codebolt/codeboltjs 5.1.10 → 6.0.0
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 +1 -20
- package/dist/core/Codebolt.js +16 -18
- package/dist/core/websocket.js +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +3 -6
- package/dist/modules/agentDeliberation.js +1 -3
- package/dist/modules/swarm.d.ts +8 -2
- package/dist/modules/swarm.js +14 -0
- package/dist/tools/index.d.ts +2 -16
- package/dist/tools/index.js +5 -45
- package/dist/tools/registry.d.ts +0 -21
- package/dist/tools/registry.js +1 -38
- package/dist/types/agentDeliberation.d.ts +1 -15
- package/dist/types/agentDeliberation.js +0 -2
- package/dist/types/job.d.ts +1 -1
- package/package.json +19 -20
- package/dist/modules/environment.d.ts +0 -24
- package/dist/modules/environment.js +0 -51
- package/dist/tools/environment/environment-create.d.ts +0 -23
- package/dist/tools/environment/environment-create.js +0 -90
- package/dist/tools/environment/environment-delete.d.ts +0 -17
- package/dist/tools/environment/environment-delete.js +0 -70
- package/dist/tools/environment/environment-get.d.ts +0 -17
- package/dist/tools/environment/environment-get.js +0 -73
- package/dist/tools/environment/environment-list.d.ts +0 -15
- package/dist/tools/environment/environment-list.js +0 -72
- package/dist/tools/environment/environment-providers.d.ts +0 -24
- package/dist/tools/environment/environment-providers.js +0 -130
- package/dist/tools/environment/environment-restart.d.ts +0 -17
- package/dist/tools/environment/environment-restart.js +0 -70
- package/dist/tools/environment/environment-send-message.d.ts +0 -19
- package/dist/tools/environment/environment-send-message.js +0 -74
- package/dist/tools/environment/environment-start.d.ts +0 -17
- package/dist/tools/environment/environment-start.js +0 -70
- package/dist/tools/environment/environment-statistics.d.ts +0 -15
- package/dist/tools/environment/environment-statistics.js +0 -69
- package/dist/tools/environment/environment-status.d.ts +0 -17
- package/dist/tools/environment/environment-status.js +0 -72
- package/dist/tools/environment/environment-stop.d.ts +0 -17
- package/dist/tools/environment/environment-stop.js +0 -70
- package/dist/tools/environment/environment-update.d.ts +0 -19
- package/dist/tools/environment/environment-update.js +0 -74
- package/dist/tools/environment/index.d.ts +0 -31
- package/dist/tools/environment/index.js +0 -61
- package/dist/tools/tool-search.d.ts +0 -49
- package/dist/tools/tool-search.js +0 -140
- package/dist/tools/toolSearch/index.d.ts +0 -9
- package/dist/tools/toolSearch/index.js +0 -15
- package/dist/tools/toolSearch/tool-search-tool.d.ts +0 -32
- package/dist/tools/toolSearch/tool-search-tool.js +0 -110
package/dist/tools/registry.js
CHANGED
|
@@ -5,15 +5,12 @@
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.defaultRegistry = exports.ToolRegistry = void 0;
|
|
7
7
|
const types_1 = require("./types");
|
|
8
|
-
const tool_search_1 = require("./tool-search");
|
|
9
8
|
/**
|
|
10
9
|
* Registry for managing tools
|
|
11
10
|
*/
|
|
12
11
|
class ToolRegistry {
|
|
13
12
|
constructor() {
|
|
14
13
|
this.tools = new Map();
|
|
15
|
-
this.searchEngine = new tool_search_1.ToolSearchEngine();
|
|
16
|
-
this.searchIndexDirty = true;
|
|
17
14
|
}
|
|
18
15
|
/**
|
|
19
16
|
* Register a tool with the registry
|
|
@@ -24,7 +21,6 @@ class ToolRegistry {
|
|
|
24
21
|
console.warn(`Tool "${tool.name}" is already registered. Overwriting.`);
|
|
25
22
|
}
|
|
26
23
|
this.tools.set(tool.name, tool);
|
|
27
|
-
this.searchIndexDirty = true;
|
|
28
24
|
}
|
|
29
25
|
/**
|
|
30
26
|
* Register multiple tools at once
|
|
@@ -41,10 +37,7 @@ class ToolRegistry {
|
|
|
41
37
|
* @returns true if the tool was found and removed
|
|
42
38
|
*/
|
|
43
39
|
unregisterTool(name) {
|
|
44
|
-
|
|
45
|
-
if (result)
|
|
46
|
-
this.searchIndexDirty = true;
|
|
47
|
-
return result;
|
|
40
|
+
return this.tools.delete(name);
|
|
48
41
|
}
|
|
49
42
|
/**
|
|
50
43
|
* Get a tool by name
|
|
@@ -196,36 +189,6 @@ class ToolRegistry {
|
|
|
196
189
|
*/
|
|
197
190
|
clear() {
|
|
198
191
|
this.tools.clear();
|
|
199
|
-
this.searchIndexDirty = true;
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Ensure the search index is up to date
|
|
203
|
-
*/
|
|
204
|
-
ensureSearchIndex() {
|
|
205
|
-
if (this.searchIndexDirty) {
|
|
206
|
-
this.searchEngine.buildIndex(this.tools);
|
|
207
|
-
this.searchIndexDirty = false;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Search for tools matching a query using full-text search
|
|
212
|
-
* @param query - The search query (e.g. "create environment", "file read", "git commit")
|
|
213
|
-
* @param options - Search options (limit, fuzzy, prefix, kind filter, boost)
|
|
214
|
-
* @returns Array of matching tools sorted by relevance
|
|
215
|
-
*/
|
|
216
|
-
searchTools(query, options) {
|
|
217
|
-
this.ensureSearchIndex();
|
|
218
|
-
return this.searchEngine.search(query, options);
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Get auto-complete suggestions for a partial query
|
|
222
|
-
* @param query - The partial query to get suggestions for
|
|
223
|
-
* @param options - Search options (limit, fuzzy, kind filter)
|
|
224
|
-
* @returns Array of suggested tool matches
|
|
225
|
-
*/
|
|
226
|
-
suggestTools(query, options) {
|
|
227
|
-
this.ensureSearchIndex();
|
|
228
|
-
return this.searchEngine.suggest(query, options);
|
|
229
192
|
}
|
|
230
193
|
}
|
|
231
194
|
exports.ToolRegistry = ToolRegistry;
|
|
@@ -5,7 +5,6 @@ export declare enum AgentDeliberationAction {
|
|
|
5
5
|
UPDATE = "agentdeliberation.update",
|
|
6
6
|
RESPOND = "agentdeliberation.respond",
|
|
7
7
|
VOTE = "agentdeliberation.vote",
|
|
8
|
-
VOTE_OPTION = "agentdeliberation.vote-option",
|
|
9
8
|
WINNER = "agentdeliberation.winner",
|
|
10
9
|
SUMMARY = "agentdeliberation.summary"
|
|
11
10
|
}
|
|
@@ -16,17 +15,10 @@ export declare enum AgentDeliberationResponseType {
|
|
|
16
15
|
UPDATE_RESPONSE = "agentdeliberation.update.response",
|
|
17
16
|
RESPOND_RESPONSE = "agentdeliberation.respond.response",
|
|
18
17
|
VOTE_RESPONSE = "agentdeliberation.vote.response",
|
|
19
|
-
VOTE_OPTION_RESPONSE = "agentdeliberation.vote-option.response",
|
|
20
18
|
WINNER_RESPONSE = "agentdeliberation.winner.response",
|
|
21
19
|
SUMMARY_RESPONSE = "agentdeliberation.summary.response"
|
|
22
20
|
}
|
|
23
21
|
export type DeliberationStatus = 'draft' | 'collecting-responses' | 'voting' | 'completed' | 'closed';
|
|
24
|
-
export interface DeliberationOption {
|
|
25
|
-
id: string;
|
|
26
|
-
text: string;
|
|
27
|
-
proposedBy: string;
|
|
28
|
-
voteCount: number;
|
|
29
|
-
}
|
|
30
22
|
export interface Deliberation {
|
|
31
23
|
id: string;
|
|
32
24
|
type: DeliberationType;
|
|
@@ -44,7 +36,6 @@ export interface Deliberation {
|
|
|
44
36
|
summary?: string;
|
|
45
37
|
summaryAuthorId?: string;
|
|
46
38
|
summaryAuthorName?: string;
|
|
47
|
-
options?: DeliberationOption[];
|
|
48
39
|
createdAt: string;
|
|
49
40
|
updatedAt: string;
|
|
50
41
|
deletedAt?: string;
|
|
@@ -74,10 +65,6 @@ export interface ICreateDeliberationParams {
|
|
|
74
65
|
creatorName: string;
|
|
75
66
|
participants?: string[];
|
|
76
67
|
status?: DeliberationStatus;
|
|
77
|
-
options?: {
|
|
78
|
-
text: string;
|
|
79
|
-
proposedBy: string;
|
|
80
|
-
}[];
|
|
81
68
|
}
|
|
82
69
|
export interface IGetDeliberationParams {
|
|
83
70
|
id: string;
|
|
@@ -105,8 +92,7 @@ export interface IRespondParams {
|
|
|
105
92
|
}
|
|
106
93
|
export interface IVoteParams {
|
|
107
94
|
deliberationId: string;
|
|
108
|
-
responseId
|
|
109
|
-
optionId?: string;
|
|
95
|
+
responseId: string;
|
|
110
96
|
voterId: string;
|
|
111
97
|
voterName: string;
|
|
112
98
|
}
|
|
@@ -9,7 +9,6 @@ var AgentDeliberationAction;
|
|
|
9
9
|
AgentDeliberationAction["UPDATE"] = "agentdeliberation.update";
|
|
10
10
|
AgentDeliberationAction["RESPOND"] = "agentdeliberation.respond";
|
|
11
11
|
AgentDeliberationAction["VOTE"] = "agentdeliberation.vote";
|
|
12
|
-
AgentDeliberationAction["VOTE_OPTION"] = "agentdeliberation.vote-option";
|
|
13
12
|
AgentDeliberationAction["WINNER"] = "agentdeliberation.winner";
|
|
14
13
|
AgentDeliberationAction["SUMMARY"] = "agentdeliberation.summary";
|
|
15
14
|
})(AgentDeliberationAction || (exports.AgentDeliberationAction = AgentDeliberationAction = {}));
|
|
@@ -21,7 +20,6 @@ var AgentDeliberationResponseType;
|
|
|
21
20
|
AgentDeliberationResponseType["UPDATE_RESPONSE"] = "agentdeliberation.update.response";
|
|
22
21
|
AgentDeliberationResponseType["RESPOND_RESPONSE"] = "agentdeliberation.respond.response";
|
|
23
22
|
AgentDeliberationResponseType["VOTE_RESPONSE"] = "agentdeliberation.vote.response";
|
|
24
|
-
AgentDeliberationResponseType["VOTE_OPTION_RESPONSE"] = "agentdeliberation.vote-option.response";
|
|
25
23
|
AgentDeliberationResponseType["WINNER_RESPONSE"] = "agentdeliberation.winner.response";
|
|
26
24
|
AgentDeliberationResponseType["SUMMARY_RESPONSE"] = "agentdeliberation.summary.response";
|
|
27
25
|
})(AgentDeliberationResponseType || (exports.AgentDeliberationResponseType = AgentDeliberationResponseType = {}));
|
package/dist/types/job.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export interface JobGroup {
|
|
|
6
6
|
createdAt: string;
|
|
7
7
|
updatedAt: string;
|
|
8
8
|
}
|
|
9
|
-
export type JobStatus = 'open' | 'working' | 'hold' | 'closed';
|
|
9
|
+
export type JobStatus = 'open' | 'working' | 'hold' | 'review' | 'closed';
|
|
10
10
|
export type JobType = 'bug' | 'feature' | 'task' | 'epic' | 'chore';
|
|
11
11
|
export type JobPriority = 1 | 2 | 3 | 4;
|
|
12
12
|
export type DependencyType = 'blocks' | 'related' | 'parent-child' | 'discovered-from';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codebolt/codeboltjs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "",
|
|
@@ -12,21 +12,6 @@
|
|
|
12
12
|
"LICENSE",
|
|
13
13
|
"package.json"
|
|
14
14
|
],
|
|
15
|
-
"scripts": {
|
|
16
|
-
"build": "tsc -p tsconfig.build.json && node script/copy-wasm.js",
|
|
17
|
-
"build:webpack": "webpack",
|
|
18
|
-
"build:all": "npm run build && npm run build:webpack",
|
|
19
|
-
"build:docs": "typedoc --plugin typedoc-plugin-missing-exports",
|
|
20
|
-
"build:docs:md": "node script/gen-docusaurus-types.js --clean",
|
|
21
|
-
"build:jsondocs": "typedoc --plugin typedoc-plugin-missing-exports --json out.json --pretty",
|
|
22
|
-
"test": "jest",
|
|
23
|
-
"test:watch": "jest --watch",
|
|
24
|
-
"test:coverage": "jest --coverage",
|
|
25
|
-
"test:verbose": "jest --verbose",
|
|
26
|
-
"test:debug": "DEBUG_TESTS=true jest",
|
|
27
|
-
"clean": "powershell -Command \"Remove-Item -Path 'dist' -Recurse -Force -ErrorAction SilentlyContinue; Remove-Item -Path 'build' -Recurse -Force -ErrorAction SilentlyContinue\"",
|
|
28
|
-
"lint": "eslint src/**/*.ts && tsc -p tsconfig.json --noEmit"
|
|
29
|
-
},
|
|
30
15
|
"repository": {
|
|
31
16
|
"type": "git",
|
|
32
17
|
"url": "git+https://github.com/codeboltai/codeboltjs.git",
|
|
@@ -38,12 +23,10 @@
|
|
|
38
23
|
"access": "public"
|
|
39
24
|
},
|
|
40
25
|
"dependencies": {
|
|
41
|
-
"@codebolt/types": "5.1.10",
|
|
42
26
|
"@types/uuid": "^10.0.0",
|
|
43
27
|
"buffer": "^6.0.3",
|
|
44
28
|
"execa": "^9.5.2",
|
|
45
29
|
"js-yaml": "^4.1.0",
|
|
46
|
-
"minisearch": "^7.2.0",
|
|
47
30
|
"os-browserify": "^0.3.0",
|
|
48
31
|
"path-browserify": "^1.0.1",
|
|
49
32
|
"stream-browserify": "^3.0.0",
|
|
@@ -51,7 +34,8 @@
|
|
|
51
34
|
"util": "^0.12.5",
|
|
52
35
|
"uuid": "^11.1.0",
|
|
53
36
|
"ws": "^8.18.3",
|
|
54
|
-
"yargs": "^17.7.2"
|
|
37
|
+
"yargs": "^17.7.2",
|
|
38
|
+
"@codebolt/types": "6.0.0"
|
|
55
39
|
},
|
|
56
40
|
"devDependencies": {
|
|
57
41
|
"@types/events": "^3.0.3",
|
|
@@ -77,5 +61,20 @@
|
|
|
77
61
|
"types": "./dist/index.d.ts",
|
|
78
62
|
"default": "./dist/index.js"
|
|
79
63
|
}
|
|
64
|
+
},
|
|
65
|
+
"scripts": {
|
|
66
|
+
"build": "tsc -p tsconfig.build.json && node script/copy-wasm.js",
|
|
67
|
+
"build:webpack": "webpack",
|
|
68
|
+
"build:all": "npm run build && npm run build:webpack",
|
|
69
|
+
"build:docs": "typedoc --plugin typedoc-plugin-missing-exports",
|
|
70
|
+
"build:docs:md": "node script/gen-docusaurus-types.js --clean",
|
|
71
|
+
"build:jsondocs": "typedoc --plugin typedoc-plugin-missing-exports --json out.json --pretty",
|
|
72
|
+
"test": "jest",
|
|
73
|
+
"test:watch": "jest --watch",
|
|
74
|
+
"test:coverage": "jest --coverage",
|
|
75
|
+
"test:verbose": "jest --verbose",
|
|
76
|
+
"test:debug": "DEBUG_TESTS=true jest",
|
|
77
|
+
"clean": "powershell -Command \"Remove-Item -Path 'dist' -Recurse -Force -ErrorAction SilentlyContinue; Remove-Item -Path 'build' -Recurse -Force -ErrorAction SilentlyContinue\"",
|
|
78
|
+
"lint": "eslint src/**/*.ts && tsc -p tsconfig.json --noEmit"
|
|
80
79
|
}
|
|
81
|
-
}
|
|
80
|
+
}
|
|
@@ -1,24 +0,0 @@
|
|
|
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;
|
|
@@ -1,51 +0,0 @@
|
|
|
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;
|
|
@@ -1,23 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
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';
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
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';
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
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';
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
}
|