@codebolt/codeboltjs 5.0.8 → 5.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/Codebolt.d.ts +29 -5
- package/dist/core/Codebolt.js +58 -0
- package/dist/core/websocket.js +15 -17
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -3
- package/dist/modules/dynamicPanel.d.ts +106 -0
- package/dist/modules/dynamicPanel.js +122 -0
- package/dist/modules/mcp.js +3 -0
- package/dist/modules/swarm.d.ts +8 -2
- package/dist/modules/swarm.js +14 -0
- package/dist/tools/actionBlock/action-block-start.js +1 -4
- package/dist/tools/actionPlan/action-plan-create.js +1 -2
- package/dist/tools/completion/attempt-completion.d.ts +25 -0
- package/dist/tools/completion/attempt-completion.js +45 -0
- package/dist/tools/completion/index.d.ts +3 -0
- package/dist/tools/completion/index.js +9 -0
- package/dist/tools/index.d.ts +6 -3
- package/dist/tools/index.js +11 -4
- package/dist/tools/job/index.d.ts +3 -1
- package/dist/tools/job/index.js +5 -1
- package/dist/tools/job/job-remove-dependency.d.ts +28 -0
- package/dist/tools/job/job-remove-dependency.js +86 -0
- package/dist/tools/requirementPlan/requirement-plan-review.js +1 -1
- package/dist/tools/thread/thread-create-background.js +1 -1
- package/dist/tools/utils/schema-validator.d.ts +1 -0
- package/dist/tools/utils/schema-validator.js +13 -1
- package/dist/types/job.d.ts +1 -1
- package/package.json +2 -2
- package/dist/modules/codeboltEvent.d.ts +0 -57
- package/dist/modules/codeboltEvent.js +0 -217
- package/dist/tools/browser/browser-action.d.ts +0 -56
- package/dist/tools/browser/browser-action.js +0 -265
- package/dist/tools/codeboltEvent/event-add-running-agent.d.ts +0 -25
- package/dist/tools/codeboltEvent/event-add-running-agent.js +0 -69
- package/dist/tools/codeboltEvent/event-check-background-agent-completion.d.ts +0 -19
- package/dist/tools/codeboltEvent/event-check-background-agent-completion.js +0 -64
- package/dist/tools/codeboltEvent/event-get-running-agent-count.d.ts +0 -19
- package/dist/tools/codeboltEvent/event-get-running-agent-count.js +0 -55
- package/dist/tools/codeboltEvent/event-on-background-agent-completion.d.ts +0 -19
- package/dist/tools/codeboltEvent/event-on-background-agent-completion.js +0 -56
- package/dist/tools/codeboltEvent/event-wait-for-external-event.d.ts +0 -19
- package/dist/tools/codeboltEvent/event-wait-for-external-event.js +0 -55
- package/dist/tools/codeboltEvent/index.d.ts +0 -19
- package/dist/tools/codeboltEvent/index.js +0 -33
- package/dist/tools/event/event-add-running-agent.d.ts +0 -32
- package/dist/tools/event/event-add-running-agent.js +0 -77
- package/dist/tools/event/event-check-agent-event.d.ts +0 -19
- package/dist/tools/event/event-check-agent-event.js +0 -63
- package/dist/tools/event/event-check-completion.d.ts +0 -19
- package/dist/tools/event/event-check-completion.js +0 -73
- package/dist/tools/event/event-check-grouped-completion.d.ts +0 -19
- package/dist/tools/event/event-check-grouped-completion.js +0 -63
- package/dist/tools/event/event-get-running-count.d.ts +0 -19
- package/dist/tools/event/event-get-running-count.js +0 -55
- package/dist/tools/event/event-on-agent-event.d.ts +0 -19
- package/dist/tools/event/event-on-agent-event.js +0 -63
- package/dist/tools/event/event-on-completion.d.ts +0 -19
- package/dist/tools/event/event-on-completion.js +0 -73
- package/dist/tools/event/event-on-grouped-completion.d.ts +0 -19
- package/dist/tools/event/event-on-grouped-completion.js +0 -63
- package/dist/tools/event/event-wait-any.d.ts +0 -19
- package/dist/tools/event/event-wait-any.js +0 -66
- package/dist/tools/event/index.d.ts +0 -25
- package/dist/tools/event/index.js +0 -48
- package/dist/tools/git/git-action.d.ts +0 -48
- package/dist/tools/git/git-action.js +0 -279
- package/dist/tools/kvStore/kv-store-create-instance.d.ts +0 -26
- package/dist/tools/kvStore/kv-store-create-instance.js +0 -79
- package/dist/tools/kvStore/kv-store-get.d.ts +0 -30
- package/dist/tools/kvStore/kv-store-get.js +0 -80
- package/dist/tools/kvStore/kv-store-set.d.ts +0 -38
- package/dist/tools/kvStore/kv-store-set.js +0 -86
- package/dist/tools/memoryIngestion/mi-create-pipeline.d.ts +0 -44
- package/dist/tools/memoryIngestion/mi-create-pipeline.js +0 -114
- package/dist/tools/memoryIngestion/mi-list.d.ts +0 -22
- package/dist/tools/memoryIngestion/mi-list.js +0 -66
- package/dist/tools/orchestration/agent-details.d.ts +0 -15
- package/dist/tools/orchestration/agent-details.js +0 -98
- package/dist/tools/orchestration/agent-find.d.ts +0 -18
- package/dist/tools/orchestration/agent-find.js +0 -125
- package/dist/tools/orchestration/agent-list.d.ts +0 -13
- package/dist/tools/orchestration/agent-list.js +0 -106
- package/dist/tools/orchestration/agent-management.d.ts +0 -44
- package/dist/tools/orchestration/agent-management.js +0 -250
- package/dist/tools/orchestration/agent-start.d.ts +0 -18
- package/dist/tools/orchestration/agent-start.js +0 -90
- package/dist/tools/orchestration/index.d.ts +0 -49
- package/dist/tools/orchestration/index.js +0 -102
- package/dist/tools/orchestration/task-assign.d.ts +0 -18
- package/dist/tools/orchestration/task-assign.js +0 -84
- package/dist/tools/orchestration/task-create.d.ts +0 -20
- package/dist/tools/orchestration/task-create.js +0 -97
- package/dist/tools/orchestration/task-delete.d.ts +0 -16
- package/dist/tools/orchestration/task-delete.js +0 -77
- package/dist/tools/orchestration/task-execute.d.ts +0 -18
- package/dist/tools/orchestration/task-execute.js +0 -84
- package/dist/tools/orchestration/task-get.d.ts +0 -16
- package/dist/tools/orchestration/task-get.js +0 -89
- package/dist/tools/orchestration/task-list.d.ts +0 -13
- package/dist/tools/orchestration/task-list.js +0 -74
- package/dist/tools/orchestration/task-management.d.ts +0 -52
- package/dist/tools/orchestration/task-management.js +0 -231
- package/dist/tools/orchestration/task-update.d.ts +0 -22
- package/dist/tools/orchestration/task-update.js +0 -96
- package/dist/tools/orchestration/thread-create-background.d.ts +0 -18
- package/dist/tools/orchestration/thread-create-background.js +0 -94
- package/dist/tools/orchestration/thread-create-start.d.ts +0 -16
- package/dist/tools/orchestration/thread-create-start.js +0 -85
- package/dist/tools/orchestration/thread-create.d.ts +0 -16
- package/dist/tools/orchestration/thread-create.js +0 -85
- package/dist/tools/orchestration/thread-delete.d.ts +0 -16
- package/dist/tools/orchestration/thread-delete.js +0 -77
- package/dist/tools/orchestration/thread-get-messages.d.ts +0 -24
- package/dist/tools/orchestration/thread-get-messages.js +0 -122
- package/dist/tools/orchestration/thread-get.d.ts +0 -16
- package/dist/tools/orchestration/thread-get.js +0 -85
- package/dist/tools/orchestration/thread-list.d.ts +0 -16
- package/dist/tools/orchestration/thread-list.js +0 -85
- package/dist/tools/orchestration/thread-start.d.ts +0 -16
- package/dist/tools/orchestration/thread-start.js +0 -82
- package/dist/tools/orchestration/thread-update-status.d.ts +0 -18
- package/dist/tools/orchestration/thread-update-status.js +0 -89
- package/dist/tools/orchestration/thread-update.d.ts +0 -18
- package/dist/tools/orchestration/thread-update.js +0 -89
package/dist/core/Codebolt.d.ts
CHANGED
|
@@ -413,11 +413,7 @@ declare class Codebolt {
|
|
|
413
413
|
importTodos: (params: {
|
|
414
414
|
data: string;
|
|
415
415
|
format?: "json" | "markdown";
|
|
416
|
-
mergeStrategy
|
|
417
|
-
* @method isReady
|
|
418
|
-
* @description Checks if the Codebolt instance is ready for use.
|
|
419
|
-
* @returns {boolean} True if the instance is ready, false otherwise.
|
|
420
|
-
*/: "replace" | "merge";
|
|
416
|
+
mergeStrategy?: "replace" | "merge";
|
|
421
417
|
listId?: string;
|
|
422
418
|
}) => Promise<import("@codebolt/types/sdk").ImportTodosResponse>;
|
|
423
419
|
};
|
|
@@ -551,6 +547,7 @@ declare class Codebolt {
|
|
|
551
547
|
updateAgentStatus: (swarmId: string, agentId: string, data: import("@codebolt/types/sdk").AgentStatusUpdate) => Promise<import("@codebolt/types/sdk").UpdateStatusResponse>;
|
|
552
548
|
getSwarmStatusSummary: (swarmId: string) => Promise<import("@codebolt/types/sdk").GetStatusSummaryResponse>;
|
|
553
549
|
getDefaultJobGroup: (swarmId: string) => Promise<import("@codebolt/types/sdk").GetDefaultJobGroupResponse>;
|
|
550
|
+
getSwarmConfig: (swarmId: string) => Promise<import("@codebolt/types/sdk").GetSwarmConfigResponse>;
|
|
554
551
|
};
|
|
555
552
|
calendar: {
|
|
556
553
|
createEvent: (params: import("../modules/calendar").ICreateEventParams) => Promise<import("../modules/calendar").ICreateEventResponse>;
|
|
@@ -901,6 +898,15 @@ declare class Codebolt {
|
|
|
901
898
|
getPendingExternalEventCount: () => number;
|
|
902
899
|
waitForAnyExternalEvent: () => Promise<import("../modules/agentEventQueue").UnifiedExternalEvent>;
|
|
903
900
|
};
|
|
901
|
+
dynamicPanel: {
|
|
902
|
+
open: (panelId: string, title: string, html: string, opts?: import("../modules/dynamicPanel").DynamicPanelOpenOptions) => Promise<import("../modules/dynamicPanel").DynamicPanelOpenResponse>;
|
|
903
|
+
update: (panelId: string, html: string) => Promise<import("../modules/dynamicPanel").DynamicPanelResponse>;
|
|
904
|
+
close: (panelId: string) => Promise<import("../modules/dynamicPanel").DynamicPanelResponse>;
|
|
905
|
+
send: (panelId: string, data: any) => Promise<import("../modules/dynamicPanel").DynamicPanelResponse>;
|
|
906
|
+
list: () => Promise<import("../modules/dynamicPanel").DynamicPanelListResponse>;
|
|
907
|
+
onMessage: (panelId: string, handler: (data: any) => void) => void;
|
|
908
|
+
offMessage: (panelId: string) => void;
|
|
909
|
+
};
|
|
904
910
|
/**
|
|
905
911
|
* User message utilities for accessing current user message and context
|
|
906
912
|
*/
|
|
@@ -989,6 +995,24 @@ declare class Codebolt {
|
|
|
989
995
|
* @returns {void}
|
|
990
996
|
*/
|
|
991
997
|
onProviderStart(handler: (initvars: ProviderInitVars) => void | Promise<void> | any | Promise<any>): void;
|
|
998
|
+
/**
|
|
999
|
+
* Sets up a listener for plugin start events.
|
|
1000
|
+
* Called when a plugin process connects and receives its context from the server.
|
|
1001
|
+
* @param {Function} handler - The handler function to call when the plugin receives its start message.
|
|
1002
|
+
* @returns {void}
|
|
1003
|
+
*/
|
|
1004
|
+
onPluginStart(handler: (context: {
|
|
1005
|
+
pluginId: string;
|
|
1006
|
+
pluginDir: string;
|
|
1007
|
+
manifest: any;
|
|
1008
|
+
}) => void | Promise<void> | any | Promise<any>): void;
|
|
1009
|
+
/**
|
|
1010
|
+
* Sets up a listener for graceful plugin stop requests from the server.
|
|
1011
|
+
* The handler should perform cleanup (close panels, unsubscribe events, etc.)
|
|
1012
|
+
* @param {Function} handler - The handler function to call when the server requests plugin stop.
|
|
1013
|
+
* @returns {void}
|
|
1014
|
+
*/
|
|
1015
|
+
onPluginStop(handler: () => void | Promise<void>): void;
|
|
992
1016
|
/**
|
|
993
1017
|
* Sets up a listener for provider agent start events.
|
|
994
1018
|
* @param {Function} handler - The handler function to call when provider agent starts.
|
package/dist/core/Codebolt.js
CHANGED
|
@@ -65,6 +65,7 @@ const agentPortfolio_1 = __importDefault(require("../modules/agentPortfolio"));
|
|
|
65
65
|
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
|
+
const dynamicPanel_1 = __importDefault(require("../modules/dynamicPanel"));
|
|
68
69
|
/**
|
|
69
70
|
* @class Codebolt
|
|
70
71
|
* @description This class provides a unified interface to interact with various modules.
|
|
@@ -139,6 +140,7 @@ class Codebolt {
|
|
|
139
140
|
this.orchestrator = orchestrator_1.default;
|
|
140
141
|
this.backgroundChildThreads = backgroundChildThreads_1.default;
|
|
141
142
|
this.agentEventQueue = agentEventQueue_1.default;
|
|
143
|
+
this.dynamicPanel = dynamicPanel_1.default;
|
|
142
144
|
/**
|
|
143
145
|
* User message utilities for accessing current user message and context
|
|
144
146
|
*/
|
|
@@ -475,6 +477,62 @@ class Codebolt {
|
|
|
475
477
|
console.error('Failed to set up provider start handler:', error);
|
|
476
478
|
});
|
|
477
479
|
}
|
|
480
|
+
/**
|
|
481
|
+
* Sets up a listener for plugin start events.
|
|
482
|
+
* Called when a plugin process connects and receives its context from the server.
|
|
483
|
+
* @param {Function} handler - The handler function to call when the plugin receives its start message.
|
|
484
|
+
* @returns {void}
|
|
485
|
+
*/
|
|
486
|
+
onPluginStart(handler) {
|
|
487
|
+
this.waitForReady().then(() => {
|
|
488
|
+
const handlePluginStart = async (response) => {
|
|
489
|
+
if (response.type === "pluginStartMessage") {
|
|
490
|
+
try {
|
|
491
|
+
await handler({
|
|
492
|
+
pluginId: response.pluginId,
|
|
493
|
+
pluginDir: response.pluginDir,
|
|
494
|
+
manifest: response.manifest,
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
catch (error) {
|
|
498
|
+
console.error('Error in plugin start handler:', error);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
websocket_1.default.messageManager.on('message', handlePluginStart);
|
|
503
|
+
}).catch(error => {
|
|
504
|
+
console.error('Failed to set up plugin start handler:', error);
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* Sets up a listener for graceful plugin stop requests from the server.
|
|
509
|
+
* The handler should perform cleanup (close panels, unsubscribe events, etc.)
|
|
510
|
+
* @param {Function} handler - The handler function to call when the server requests plugin stop.
|
|
511
|
+
* @returns {void}
|
|
512
|
+
*/
|
|
513
|
+
onPluginStop(handler) {
|
|
514
|
+
this.waitForReady().then(() => {
|
|
515
|
+
const handlePluginStop = async (response) => {
|
|
516
|
+
if (response.type === "pluginStopMessage") {
|
|
517
|
+
try {
|
|
518
|
+
await handler();
|
|
519
|
+
websocket_1.default.messageManager.send({ type: 'pluginStopResponse', success: true });
|
|
520
|
+
}
|
|
521
|
+
catch (error) {
|
|
522
|
+
console.error('Error in plugin stop handler:', error);
|
|
523
|
+
websocket_1.default.messageManager.send({
|
|
524
|
+
type: 'pluginStopResponse',
|
|
525
|
+
success: false,
|
|
526
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
};
|
|
531
|
+
websocket_1.default.messageManager.on('message', handlePluginStop);
|
|
532
|
+
}).catch(error => {
|
|
533
|
+
console.error('Failed to set up plugin stop handler:', error);
|
|
534
|
+
});
|
|
535
|
+
}
|
|
478
536
|
/**
|
|
479
537
|
* Sets up a listener for provider agent start events.
|
|
480
538
|
* @param {Function} handler - The handler function to call when provider agent starts.
|
package/dist/core/websocket.js
CHANGED
|
@@ -65,31 +65,29 @@ class cbws {
|
|
|
65
65
|
const socketPort = process.env.SOCKET_PORT || '12345';
|
|
66
66
|
const serverUrl = process.env.CODEBOLT_SERVER_URL || 'localhost';
|
|
67
67
|
const threadToken = process.env.threadToken || null;
|
|
68
|
-
//
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
// console.log('parentIdParam:', parentIdParam);
|
|
73
|
-
// console.log('parentAgentInstanceIdParam:', parentAgentInstanceIdParam);
|
|
74
|
-
// console.log('agentTask:', agentTask);
|
|
75
|
-
// console.log('socketPort:', socketPort);
|
|
76
|
-
// console.log('serverUrl:', serverUrl);
|
|
77
|
-
// console.log('threadToken:', threadToken);
|
|
78
|
-
// console.log('[WebSocket] Environment variables check:');
|
|
79
|
-
// console.log('process.env.agentId:', process.env.agentId);
|
|
80
|
-
// console.log('process.env.threadToken:', process.env.threadToken);
|
|
81
|
-
// console.log('process.env.parentId:', process.env.parentId);
|
|
82
|
-
// console.log('process.env.agentTask:', process.env.agentTask);
|
|
68
|
+
// Plugin mode detection
|
|
69
|
+
const isPlugin = process.env.IS_PLUGIN === 'true';
|
|
70
|
+
const pluginId = process.env.pluginId || '';
|
|
71
|
+
const pluginToken = process.env.pluginToken || '';
|
|
83
72
|
const threadTokenParam = threadToken ? `&threadToken=${encodeURIComponent(threadToken)}` : '';
|
|
84
73
|
// Add all custom environment variables as URL parameters
|
|
85
|
-
const knownEnvVars = ['SOCKET_PORT', 'CODEBOLT_SERVER_URL', 'agentId', 'parentId', 'parentAgentInstanceId', 'agentTask', 'threadToken', 'Is_Dev', 'PATH', 'NODE_ENV', 'HOME', 'USER', 'SHELL'];
|
|
74
|
+
const knownEnvVars = ['SOCKET_PORT', 'CODEBOLT_SERVER_URL', 'agentId', 'parentId', 'parentAgentInstanceId', 'agentTask', 'threadToken', 'Is_Dev', 'PATH', 'NODE_ENV', 'HOME', 'USER', 'SHELL', 'IS_PLUGIN', 'pluginId', 'pluginToken', 'PLUGIN_DIR', 'instanceId'];
|
|
86
75
|
let customParams = '';
|
|
87
76
|
for (const [key, value] of Object.entries(process.env)) {
|
|
88
77
|
if (!knownEnvVars.includes(key) && value && !key.startsWith('npm_') && !key.startsWith('_')) {
|
|
89
78
|
customParams += `&${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
|
|
90
79
|
}
|
|
91
80
|
}
|
|
92
|
-
|
|
81
|
+
let wsUrl;
|
|
82
|
+
if (isPlugin) {
|
|
83
|
+
// Plugins connect to /plugin endpoint with pluginId/pluginToken
|
|
84
|
+
wsUrl = `ws://${serverUrl}:${socketPort}/plugin?id=${uniqueConnectionId}&pluginId=${encodeURIComponent(pluginId)}&pluginToken=${encodeURIComponent(pluginToken)}${customParams}`;
|
|
85
|
+
console.log('[WebSocket] Plugin mode detected, connecting to /plugin endpoint');
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
// Agents connect to /codebolt endpoint (existing behavior)
|
|
89
|
+
wsUrl = `ws://${serverUrl}:${socketPort}/codebolt?id=${uniqueConnectionId}${agentIdParam}${parentIdParam}${parentAgentInstanceIdParam}${agentTask}${threadTokenParam}${customParams}${process.env.Is_Dev ? '&dev=true' : ''}`;
|
|
90
|
+
}
|
|
93
91
|
console.log('[WebSocket] Connecting to:', serverUrl);
|
|
94
92
|
this.websocket = new ws_1.default(wsUrl);
|
|
95
93
|
return new Promise((resolve, reject) => {
|
package/dist/index.d.ts
CHANGED
|
@@ -125,5 +125,7 @@ export { default as codemap } from './modules/codemap';
|
|
|
125
125
|
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
|
+
export { default as dynamicPanel } from './modules/dynamicPanel';
|
|
129
|
+
export type { DynamicPanelOpenOptions, DynamicPanelOpenResponse, DynamicPanelResponse, DynamicPanelInfo, DynamicPanelListResponse, DynamicPanelMessageEvent, } from './modules/dynamicPanel';
|
|
128
130
|
export { default as tools } from './tools';
|
|
129
131
|
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 = void 0;
|
|
8
|
+
exports.GrepTool = 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.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.OrchestratorListTool = 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 = void 0;
|
|
10
|
+
exports.OrchestratorUpdateStatusTool = exports.OrchestratorDeleteTool = exports.OrchestratorUpdateSettingsTool = exports.OrchestratorUpdateTool = exports.OrchestratorCreateTool = exports.OrchestratorGetSettingsTool = exports.OrchestratorGetTool = void 0;
|
|
11
11
|
const Codebolt_1 = __importDefault(require("./core/Codebolt"));
|
|
12
12
|
exports.Codebolt = Codebolt_1.default;
|
|
13
13
|
// ================================
|
|
@@ -312,6 +312,9 @@ Object.defineProperty(exports, "codebaseSearch", { enumerable: true, get: functi
|
|
|
312
312
|
// Background Child Threads module
|
|
313
313
|
var backgroundChildThreads_1 = require("./modules/backgroundChildThreads");
|
|
314
314
|
Object.defineProperty(exports, "backgroundChildThreads", { enumerable: true, get: function () { return __importDefault(backgroundChildThreads_1).default; } });
|
|
315
|
+
// DynamicPanel module
|
|
316
|
+
var dynamicPanel_1 = require("./modules/dynamicPanel");
|
|
317
|
+
Object.defineProperty(exports, "dynamicPanel", { enumerable: true, get: function () { return __importDefault(dynamicPanel_1).default; } });
|
|
315
318
|
// ================================
|
|
316
319
|
// Tools Module - LLM-ready tool definitions
|
|
317
320
|
// ================================
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
export interface DynamicPanelOpenOptions {
|
|
2
|
+
/** If true, the open() call blocks until the panel sends a { type: 'submit' } message */
|
|
3
|
+
waitForResponse?: boolean;
|
|
4
|
+
/** Timeout in milliseconds for waitForResponse mode (default: 300000 = 5 min) */
|
|
5
|
+
timeout?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface DynamicPanelOpenResponse {
|
|
8
|
+
type: string;
|
|
9
|
+
success: boolean;
|
|
10
|
+
data?: {
|
|
11
|
+
success: boolean;
|
|
12
|
+
panelId: string;
|
|
13
|
+
data?: any;
|
|
14
|
+
};
|
|
15
|
+
error?: string;
|
|
16
|
+
requestId?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface DynamicPanelResponse {
|
|
19
|
+
type: string;
|
|
20
|
+
success: boolean;
|
|
21
|
+
data?: any;
|
|
22
|
+
error?: string;
|
|
23
|
+
requestId?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface DynamicPanelInfo {
|
|
26
|
+
panelId: string;
|
|
27
|
+
title: string;
|
|
28
|
+
html: string;
|
|
29
|
+
pluginId?: string;
|
|
30
|
+
createdAt: string;
|
|
31
|
+
}
|
|
32
|
+
export interface DynamicPanelListResponse {
|
|
33
|
+
type: string;
|
|
34
|
+
success: boolean;
|
|
35
|
+
data?: {
|
|
36
|
+
panels: DynamicPanelInfo[];
|
|
37
|
+
};
|
|
38
|
+
error?: string;
|
|
39
|
+
requestId?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface DynamicPanelMessageEvent {
|
|
42
|
+
type: 'dynamicPanel.message';
|
|
43
|
+
panelId: string;
|
|
44
|
+
data: any;
|
|
45
|
+
messageId?: string;
|
|
46
|
+
threadId?: string;
|
|
47
|
+
}
|
|
48
|
+
declare const cbdynamicPanel: {
|
|
49
|
+
/**
|
|
50
|
+
* Opens a new DynamicPanel with the given HTML content.
|
|
51
|
+
*
|
|
52
|
+
* When `opts.waitForResponse` is true the call **blocks** until the panel
|
|
53
|
+
* iframe sends a `{ type: 'submit', data: {...} }` message via
|
|
54
|
+
* `window.parent.postMessage()`. The resolved value then contains the
|
|
55
|
+
* submitted data.
|
|
56
|
+
*
|
|
57
|
+
* @param panelId Unique identifier for the panel
|
|
58
|
+
* @param title Human-readable panel title shown in the tab
|
|
59
|
+
* @param html Full HTML document rendered inside the panel iframe
|
|
60
|
+
* @param opts Optional: `waitForResponse`, `timeout`
|
|
61
|
+
*/
|
|
62
|
+
open: (panelId: string, title: string, html: string, opts?: DynamicPanelOpenOptions) => Promise<DynamicPanelOpenResponse>;
|
|
63
|
+
/**
|
|
64
|
+
* Replaces the HTML content of an existing DynamicPanel.
|
|
65
|
+
*
|
|
66
|
+
* @param panelId The panel to update
|
|
67
|
+
* @param html New HTML content
|
|
68
|
+
*/
|
|
69
|
+
update: (panelId: string, html: string) => Promise<DynamicPanelResponse>;
|
|
70
|
+
/**
|
|
71
|
+
* Closes a DynamicPanel and removes it from the UI.
|
|
72
|
+
*
|
|
73
|
+
* @param panelId The panel to close
|
|
74
|
+
*/
|
|
75
|
+
close: (panelId: string) => Promise<DynamicPanelResponse>;
|
|
76
|
+
/**
|
|
77
|
+
* Pushes arbitrary data into the panel's iframe via `postMessage`.
|
|
78
|
+
* The iframe receives this in its `window.addEventListener('message', ...)` handler.
|
|
79
|
+
*
|
|
80
|
+
* @param panelId The target panel
|
|
81
|
+
* @param data Any JSON-serializable payload
|
|
82
|
+
*/
|
|
83
|
+
send: (panelId: string, data: any) => Promise<DynamicPanelResponse>;
|
|
84
|
+
/**
|
|
85
|
+
* Lists all currently active DynamicPanels.
|
|
86
|
+
*/
|
|
87
|
+
list: () => Promise<DynamicPanelListResponse>;
|
|
88
|
+
/**
|
|
89
|
+
* Registers a handler for messages coming **from** a specific panel's iframe.
|
|
90
|
+
* The iframe sends messages via `window.parent.postMessage({ type: '...', data: {...} }, '*')`.
|
|
91
|
+
*
|
|
92
|
+
* Only one handler per panelId is supported. Calling this again for the
|
|
93
|
+
* same panelId replaces the previous handler.
|
|
94
|
+
*
|
|
95
|
+
* @param panelId The panel to listen to
|
|
96
|
+
* @param handler Callback receiving the message data
|
|
97
|
+
*/
|
|
98
|
+
onMessage: (panelId: string, handler: (data: any) => void) => void;
|
|
99
|
+
/**
|
|
100
|
+
* Removes the message handler for a specific panel.
|
|
101
|
+
*
|
|
102
|
+
* @param panelId The panel to stop listening to
|
|
103
|
+
*/
|
|
104
|
+
offMessage: (panelId: string) => void;
|
|
105
|
+
};
|
|
106
|
+
export default cbdynamicPanel;
|
|
@@ -0,0 +1,122 @@
|
|
|
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
|
+
// Message handler tracking
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
const panelMessageHandlers = new Map();
|
|
11
|
+
let messageRouteCleanup = null;
|
|
12
|
+
/**
|
|
13
|
+
* Ensures the global message route for dynamicPanel.message is registered.
|
|
14
|
+
* Incoming messages are dispatched to per-panel handlers.
|
|
15
|
+
*/
|
|
16
|
+
function ensureMessageRoute() {
|
|
17
|
+
if (messageRouteCleanup)
|
|
18
|
+
return;
|
|
19
|
+
messageRouteCleanup = websocket_1.default.messageManager.registerRoute({
|
|
20
|
+
messageTypes: ['dynamicPanel.message'],
|
|
21
|
+
handler: (message) => {
|
|
22
|
+
const handler = panelMessageHandlers.get(message.panelId);
|
|
23
|
+
if (handler) {
|
|
24
|
+
handler(message.data);
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
// DynamicPanel SDK module
|
|
31
|
+
// ---------------------------------------------------------------------------
|
|
32
|
+
const cbdynamicPanel = {
|
|
33
|
+
/**
|
|
34
|
+
* Opens a new DynamicPanel with the given HTML content.
|
|
35
|
+
*
|
|
36
|
+
* When `opts.waitForResponse` is true the call **blocks** until the panel
|
|
37
|
+
* iframe sends a `{ type: 'submit', data: {...} }` message via
|
|
38
|
+
* `window.parent.postMessage()`. The resolved value then contains the
|
|
39
|
+
* submitted data.
|
|
40
|
+
*
|
|
41
|
+
* @param panelId Unique identifier for the panel
|
|
42
|
+
* @param title Human-readable panel title shown in the tab
|
|
43
|
+
* @param html Full HTML document rendered inside the panel iframe
|
|
44
|
+
* @param opts Optional: `waitForResponse`, `timeout`
|
|
45
|
+
*/
|
|
46
|
+
open: async (panelId, title, html, opts) => {
|
|
47
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({
|
|
48
|
+
type: 'dynamicPanel.open',
|
|
49
|
+
params: { panelId, title, html, ...opts },
|
|
50
|
+
}, 'dynamicPanelOpenResponse', (opts === null || opts === void 0 ? void 0 : opts.waitForResponse) ? (opts.timeout || 300000) : 0);
|
|
51
|
+
},
|
|
52
|
+
/**
|
|
53
|
+
* Replaces the HTML content of an existing DynamicPanel.
|
|
54
|
+
*
|
|
55
|
+
* @param panelId The panel to update
|
|
56
|
+
* @param html New HTML content
|
|
57
|
+
*/
|
|
58
|
+
update: async (panelId, html) => {
|
|
59
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({
|
|
60
|
+
type: 'dynamicPanel.update',
|
|
61
|
+
params: { panelId, html },
|
|
62
|
+
}, 'dynamicPanelUpdateResponse');
|
|
63
|
+
},
|
|
64
|
+
/**
|
|
65
|
+
* Closes a DynamicPanel and removes it from the UI.
|
|
66
|
+
*
|
|
67
|
+
* @param panelId The panel to close
|
|
68
|
+
*/
|
|
69
|
+
close: async (panelId) => {
|
|
70
|
+
// Unregister any local message handler for this panel
|
|
71
|
+
panelMessageHandlers.delete(panelId);
|
|
72
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({
|
|
73
|
+
type: 'dynamicPanel.close',
|
|
74
|
+
params: { panelId },
|
|
75
|
+
}, 'dynamicPanelCloseResponse');
|
|
76
|
+
},
|
|
77
|
+
/**
|
|
78
|
+
* Pushes arbitrary data into the panel's iframe via `postMessage`.
|
|
79
|
+
* The iframe receives this in its `window.addEventListener('message', ...)` handler.
|
|
80
|
+
*
|
|
81
|
+
* @param panelId The target panel
|
|
82
|
+
* @param data Any JSON-serializable payload
|
|
83
|
+
*/
|
|
84
|
+
send: async (panelId, data) => {
|
|
85
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({
|
|
86
|
+
type: 'dynamicPanel.send',
|
|
87
|
+
params: { panelId, data },
|
|
88
|
+
}, 'dynamicPanelSendResponse');
|
|
89
|
+
},
|
|
90
|
+
/**
|
|
91
|
+
* Lists all currently active DynamicPanels.
|
|
92
|
+
*/
|
|
93
|
+
list: async () => {
|
|
94
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({
|
|
95
|
+
type: 'dynamicPanel.list',
|
|
96
|
+
params: {},
|
|
97
|
+
}, 'dynamicPanelListResponse');
|
|
98
|
+
},
|
|
99
|
+
/**
|
|
100
|
+
* Registers a handler for messages coming **from** a specific panel's iframe.
|
|
101
|
+
* The iframe sends messages via `window.parent.postMessage({ type: '...', data: {...} }, '*')`.
|
|
102
|
+
*
|
|
103
|
+
* Only one handler per panelId is supported. Calling this again for the
|
|
104
|
+
* same panelId replaces the previous handler.
|
|
105
|
+
*
|
|
106
|
+
* @param panelId The panel to listen to
|
|
107
|
+
* @param handler Callback receiving the message data
|
|
108
|
+
*/
|
|
109
|
+
onMessage: (panelId, handler) => {
|
|
110
|
+
ensureMessageRoute();
|
|
111
|
+
panelMessageHandlers.set(panelId, handler);
|
|
112
|
+
},
|
|
113
|
+
/**
|
|
114
|
+
* Removes the message handler for a specific panel.
|
|
115
|
+
*
|
|
116
|
+
* @param panelId The panel to stop listening to
|
|
117
|
+
*/
|
|
118
|
+
offMessage: (panelId) => {
|
|
119
|
+
panelMessageHandlers.delete(panelId);
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
exports.default = cbdynamicPanel;
|
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);
|
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 } 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';
|
|
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, GetSwarmConfigResponse } 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, GetSwarmConfigResponse } from '@codebolt/types/lib';
|
|
3
3
|
/**
|
|
4
4
|
* Swarm Module
|
|
5
5
|
* Provides functionality for managing swarms, agents, teams, roles, and vacancies
|
|
@@ -185,5 +185,11 @@ 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>;
|
|
188
194
|
};
|
|
189
195
|
export default codeboltSwarm;
|
package/dist/modules/swarm.js
CHANGED
|
@@ -442,6 +442,20 @@ 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');
|
|
445
459
|
}
|
|
446
460
|
};
|
|
447
461
|
exports.default = codeboltSwarm;
|
|
@@ -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
|
+
];
|