@codebolt/codeboltjs 2.0.12 → 2.0.15
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/Readme.md +138 -4
- package/dist/agentlib/agent.js +3 -7
- package/dist/agentlib/followupquestionbuilder.d.ts +75 -0
- package/dist/agentlib/followupquestionbuilder.js +193 -0
- package/dist/agentlib/llmoutputhandler.d.ts +102 -0
- package/dist/agentlib/llmoutputhandler.js +451 -0
- package/dist/agentlib/promptbuilder.d.ts +171 -17
- package/dist/agentlib/promptbuilder.js +367 -49
- package/dist/agentlib/systemprompt.js +3 -3
- package/dist/agentlib/usermessage.d.ts +1 -1
- package/dist/agentlib/usermessage.js +5 -1
- package/dist/core/Codebolt.d.ts +342 -0
- package/dist/core/Codebolt.js +201 -0
- package/dist/core/websocket.js +2 -1
- package/dist/index.d.ts +4 -300
- package/dist/index.js +11 -137
- package/dist/modules/llm.d.ts +23 -3
- package/dist/modules/llm.js +20 -3
- package/dist/modules/project.d.ts +3 -3
- package/dist/modules/project.js +1 -1
- package/dist/modules/state.d.ts +5 -3
- package/dist/modules/state.js +2 -0
- package/dist/modules/task.d.ts +126 -11
- package/dist/modules/task.js +262 -20
- package/dist/notificationfunctions/agent.d.ts +48 -0
- package/dist/notificationfunctions/agent.js +115 -0
- package/dist/notificationfunctions/browser.d.ts +60 -0
- package/dist/notificationfunctions/browser.js +145 -0
- package/dist/notificationfunctions/chat.d.ts +53 -0
- package/dist/notificationfunctions/chat.js +125 -0
- package/dist/notificationfunctions/codeutils.d.ts +60 -0
- package/dist/notificationfunctions/codeutils.js +145 -0
- package/dist/notificationfunctions/crawler.d.ts +59 -0
- package/dist/notificationfunctions/crawler.js +159 -0
- package/dist/notificationfunctions/dbmemory.d.ts +50 -0
- package/dist/notificationfunctions/dbmemory.js +132 -0
- package/dist/notificationfunctions/fs.d.ts +125 -0
- package/dist/notificationfunctions/fs.js +472 -0
- package/dist/notificationfunctions/git.d.ts +174 -0
- package/dist/notificationfunctions/git.js +521 -0
- package/dist/notificationfunctions/history.d.ts +38 -0
- package/dist/notificationfunctions/history.js +97 -0
- package/dist/notificationfunctions/index.d.ts +79 -0
- package/dist/notificationfunctions/index.js +102 -0
- package/dist/notificationfunctions/llm.d.ts +39 -0
- package/dist/notificationfunctions/llm.js +99 -0
- package/dist/notificationfunctions/mcp.d.ts +67 -0
- package/dist/notificationfunctions/mcp.js +192 -0
- package/dist/notificationfunctions/search.d.ts +50 -0
- package/dist/notificationfunctions/search.js +146 -0
- package/dist/notificationfunctions/system.d.ts +25 -0
- package/dist/notificationfunctions/system.js +59 -0
- package/dist/notificationfunctions/terminal.d.ts +26 -0
- package/dist/notificationfunctions/terminal.js +64 -0
- package/dist/notificationfunctions/todo.d.ts +63 -0
- package/dist/notificationfunctions/todo.js +164 -0
- package/dist/notificationfunctions/utils.d.ts +81 -0
- package/dist/notificationfunctions/utils.js +177 -0
- package/dist/types/InternalTypes.d.ts +1 -0
- package/dist/types/commonTypes.d.ts +26 -3
- package/dist/types/index.d.ts +15 -0
- package/dist/types/index.js +15 -0
- package/dist/types/libFunctionTypes.d.ts +110 -4
- package/dist/types/notificationFunctions/agent.d.ts +8 -0
- package/dist/types/notificationFunctions/agent.js +2 -0
- package/dist/types/notificationFunctions/browser.d.ts +10 -0
- package/dist/types/notificationFunctions/browser.js +2 -0
- package/dist/types/notificationFunctions/chat.d.ts +10 -0
- package/dist/types/notificationFunctions/chat.js +2 -0
- package/dist/types/notificationFunctions/codeutils.d.ts +10 -0
- package/dist/types/notificationFunctions/codeutils.js +2 -0
- package/dist/types/notificationFunctions/crawler.d.ts +10 -0
- package/dist/types/notificationFunctions/crawler.js +2 -0
- package/dist/types/notificationFunctions/dbmemory.d.ts +9 -0
- package/dist/types/notificationFunctions/dbmemory.js +2 -0
- package/dist/types/notificationFunctions/fs.d.ts +27 -0
- package/dist/types/notificationFunctions/fs.js +2 -0
- package/dist/types/notificationFunctions/git.d.ts +29 -0
- package/dist/types/notificationFunctions/git.js +2 -0
- package/dist/types/notificationFunctions/history.d.ts +10 -0
- package/dist/types/notificationFunctions/history.js +2 -0
- package/dist/types/notificationFunctions/index.d.ts +0 -0
- package/dist/types/notificationFunctions/index.js +1 -0
- package/dist/types/notificationFunctions/llm.d.ts +10 -0
- package/dist/types/notificationFunctions/llm.js +2 -0
- package/dist/types/notificationFunctions/mcp.d.ts +16 -0
- package/dist/types/notificationFunctions/mcp.js +2 -0
- package/dist/types/notificationFunctions/search.d.ts +11 -0
- package/dist/types/notificationFunctions/search.js +2 -0
- package/dist/types/notificationFunctions/system.d.ts +7 -0
- package/dist/types/notificationFunctions/system.js +2 -0
- package/dist/types/notificationFunctions/terminal.d.ts +7 -0
- package/dist/types/notificationFunctions/terminal.js +2 -0
- package/dist/types/notificationFunctions/todo.d.ts +11 -0
- package/dist/types/notificationFunctions/todo.js +2 -0
- package/dist/types/notifications/agent.d.ts +31 -0
- package/dist/types/notifications/agent.js +3 -0
- package/dist/types/notifications/browser.d.ts +53 -0
- package/dist/types/notifications/browser.js +3 -0
- package/dist/types/notifications/chat.d.ts +37 -0
- package/dist/types/notifications/chat.js +3 -0
- package/dist/types/notifications/codeutils.d.ts +55 -0
- package/dist/types/notifications/codeutils.js +3 -0
- package/dist/types/notifications/crawler.d.ts +55 -0
- package/dist/types/notifications/crawler.js +3 -0
- package/dist/types/notifications/dbmemory.d.ts +31 -0
- package/dist/types/notifications/dbmemory.js +3 -0
- package/dist/types/notifications/fs.d.ts +180 -0
- package/dist/types/notifications/fs.js +3 -0
- package/dist/types/notifications/git.d.ts +205 -0
- package/dist/types/notifications/git.js +3 -0
- package/dist/types/notifications/history.d.ts +32 -0
- package/dist/types/notifications/history.js +3 -0
- package/dist/types/notifications/llm.d.ts +45 -0
- package/dist/types/notifications/llm.js +2 -0
- package/dist/types/notifications/mcp.d.ts +63 -0
- package/dist/types/notifications/mcp.js +3 -0
- package/dist/types/notifications/search.d.ts +47 -0
- package/dist/types/notifications/search.js +3 -0
- package/dist/types/notifications/system.d.ts +20 -0
- package/dist/types/notifications/system.js +2 -0
- package/dist/types/notifications/terminal.d.ts +17 -0
- package/dist/types/notifications/terminal.js +2 -0
- package/dist/types/notifications/todo.d.ts +60 -0
- package/dist/types/notifications/todo.js +3 -0
- package/dist/types/socketMessageTypes.d.ts +3 -0
- package/dist/utils.d.ts +3 -0
- package/dist/utils.js +7 -1
- package/package.json +1 -1
|
@@ -0,0 +1,177 @@
|
|
|
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
|
+
exports.safeStringify = exports.createSuccessResponse = exports.createErrorResponse = exports.validateRequiredFields = exports.sendNotification = exports.validateNotificationStructure = exports.generateToolUseId = exports.NotificationErrorCodes = exports.NotificationError = void 0;
|
|
7
|
+
const websocket_1 = __importDefault(require("../core/websocket"));
|
|
8
|
+
/**
|
|
9
|
+
* Error class for notification-related errors
|
|
10
|
+
*/
|
|
11
|
+
class NotificationError extends Error {
|
|
12
|
+
constructor(message, code, category, originalError) {
|
|
13
|
+
super(message);
|
|
14
|
+
this.code = code;
|
|
15
|
+
this.category = category;
|
|
16
|
+
this.originalError = originalError;
|
|
17
|
+
this.name = 'NotificationError';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.NotificationError = NotificationError;
|
|
21
|
+
/**
|
|
22
|
+
* Error codes for notification operations
|
|
23
|
+
*/
|
|
24
|
+
var NotificationErrorCodes;
|
|
25
|
+
(function (NotificationErrorCodes) {
|
|
26
|
+
NotificationErrorCodes["CONNECTION_NOT_READY"] = "CONNECTION_NOT_READY";
|
|
27
|
+
NotificationErrorCodes["INVALID_DATA"] = "INVALID_DATA";
|
|
28
|
+
NotificationErrorCodes["TIMEOUT"] = "TIMEOUT";
|
|
29
|
+
NotificationErrorCodes["WEBSOCKET_ERROR"] = "WEBSOCKET_ERROR";
|
|
30
|
+
NotificationErrorCodes["VALIDATION_FAILED"] = "VALIDATION_FAILED";
|
|
31
|
+
})(NotificationErrorCodes || (exports.NotificationErrorCodes = NotificationErrorCodes = {}));
|
|
32
|
+
/**
|
|
33
|
+
* Generates a unique toolUseId for notifications
|
|
34
|
+
* @returns {string} A unique identifier in the format 'tool_timestamp_randomstring'
|
|
35
|
+
*/
|
|
36
|
+
function generateToolUseId() {
|
|
37
|
+
const timestamp = Date.now();
|
|
38
|
+
const randomString = Math.random().toString(36).substr(2, 9);
|
|
39
|
+
return `tool_${timestamp}_${randomString}`;
|
|
40
|
+
}
|
|
41
|
+
exports.generateToolUseId = generateToolUseId;
|
|
42
|
+
/**
|
|
43
|
+
* Validates the basic structure of a notification
|
|
44
|
+
* @param notification The notification to validate
|
|
45
|
+
* @returns {boolean} True if the notification has required fields
|
|
46
|
+
*/
|
|
47
|
+
function validateNotificationStructure(notification) {
|
|
48
|
+
if (!notification) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
// Check required fields
|
|
52
|
+
if (!notification.toolUseId || typeof notification.toolUseId !== 'string') {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
if (!notification.type || typeof notification.type !== 'string') {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
if (!notification.action || typeof notification.action !== 'string') {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
exports.validateNotificationStructure = validateNotificationStructure;
|
|
64
|
+
/**
|
|
65
|
+
* Sends a notification through the WebSocket connection
|
|
66
|
+
* This is a fire-and-forget operation that handles errors gracefully
|
|
67
|
+
* @param notification The notification to send
|
|
68
|
+
* @param category The category of notification for error reporting
|
|
69
|
+
*/
|
|
70
|
+
function sendNotification(notification, category = 'unknown') {
|
|
71
|
+
try {
|
|
72
|
+
// Generate toolUseId if not provided
|
|
73
|
+
if (!notification.toolUseId) {
|
|
74
|
+
notification.toolUseId = generateToolUseId();
|
|
75
|
+
}
|
|
76
|
+
// Validate notification structure
|
|
77
|
+
if (!validateNotificationStructure(notification)) {
|
|
78
|
+
const error = new NotificationError(`Invalid notification structure for ${category}`, NotificationErrorCodes.VALIDATION_FAILED, category);
|
|
79
|
+
console.error('[NotificationFunctions]', error.message, notification);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
// Check if WebSocket is ready
|
|
83
|
+
if (!websocket_1.default.isInitialized) {
|
|
84
|
+
const warning = `WebSocket not ready, ${category} notification may not be sent`;
|
|
85
|
+
console.warn('[NotificationFunctions]', warning, notification);
|
|
86
|
+
// Still attempt to send - the message manager will handle the error
|
|
87
|
+
}
|
|
88
|
+
// Send via WebSocket (fire and forget)
|
|
89
|
+
websocket_1.default.messageManager.send(notification);
|
|
90
|
+
// Log successful send (only in debug mode to avoid spam)
|
|
91
|
+
if (process.env.NODE_ENV === 'development' || process.env.DEBUG) {
|
|
92
|
+
console.log(`[NotificationFunctions] Sent ${category} notification:`, {
|
|
93
|
+
toolUseId: notification.toolUseId,
|
|
94
|
+
type: notification.type,
|
|
95
|
+
action: notification.action
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
const notificationError = new NotificationError(`Failed to send ${category} notification: ${error instanceof Error ? error.message : 'Unknown error'}`, NotificationErrorCodes.WEBSOCKET_ERROR, category, error instanceof Error ? error : undefined);
|
|
101
|
+
console.error('[NotificationFunctions]', notificationError.message, notification);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
exports.sendNotification = sendNotification;
|
|
105
|
+
/**
|
|
106
|
+
* Validates that required data fields are present and not empty
|
|
107
|
+
* @param data The data object to validate
|
|
108
|
+
* @param requiredFields Array of field names that must be present
|
|
109
|
+
* @param category The category for error reporting
|
|
110
|
+
* @returns {boolean} True if all required fields are present
|
|
111
|
+
*/
|
|
112
|
+
function validateRequiredFields(data, requiredFields, category = 'unknown') {
|
|
113
|
+
if (!data || typeof data !== 'object') {
|
|
114
|
+
console.error(`[NotificationFunctions] Invalid data object for ${category}:`, data);
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
for (const field of requiredFields) {
|
|
118
|
+
if (!(field in data) || data[field] === null || data[field] === undefined || data[field] === '') {
|
|
119
|
+
console.error(`[NotificationFunctions] Missing required field '${field}' for ${category}:`, data);
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
exports.validateRequiredFields = validateRequiredFields;
|
|
126
|
+
/**
|
|
127
|
+
* Creates a standardized error response notification
|
|
128
|
+
* @param toolUseId The toolUseId to use for the response
|
|
129
|
+
* @param type The notification type
|
|
130
|
+
* @param action The response action
|
|
131
|
+
* @param error The error that occurred
|
|
132
|
+
* @returns A standardized error response notification
|
|
133
|
+
*/
|
|
134
|
+
function createErrorResponse(toolUseId, type, action, error) {
|
|
135
|
+
return {
|
|
136
|
+
toolUseId,
|
|
137
|
+
type,
|
|
138
|
+
action,
|
|
139
|
+
content: error instanceof Error ? error.message : error,
|
|
140
|
+
isError: true
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
exports.createErrorResponse = createErrorResponse;
|
|
144
|
+
/**
|
|
145
|
+
* Creates a standardized success response notification
|
|
146
|
+
* @param toolUseId The toolUseId to use for the response
|
|
147
|
+
* @param type The notification type
|
|
148
|
+
* @param action The response action
|
|
149
|
+
* @param content The success content
|
|
150
|
+
* @returns A standardized success response notification
|
|
151
|
+
*/
|
|
152
|
+
function createSuccessResponse(toolUseId, type, action, content) {
|
|
153
|
+
return {
|
|
154
|
+
toolUseId,
|
|
155
|
+
type,
|
|
156
|
+
action,
|
|
157
|
+
content,
|
|
158
|
+
isError: false
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
exports.createSuccessResponse = createSuccessResponse;
|
|
162
|
+
/**
|
|
163
|
+
* Utility function to safely stringify objects for logging
|
|
164
|
+
* @param obj The object to stringify
|
|
165
|
+
* @param maxLength Maximum length of the resulting string
|
|
166
|
+
* @returns A safe string representation
|
|
167
|
+
*/
|
|
168
|
+
function safeStringify(obj, maxLength = 200) {
|
|
169
|
+
try {
|
|
170
|
+
const str = JSON.stringify(obj);
|
|
171
|
+
return str.length > maxLength ? str.substring(0, maxLength) + '...' : str;
|
|
172
|
+
}
|
|
173
|
+
catch (error) {
|
|
174
|
+
return '[Object - could not stringify]';
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
exports.safeStringify = safeStringify;
|
|
@@ -86,11 +86,34 @@ export interface AgentDetail {
|
|
|
86
86
|
status: string;
|
|
87
87
|
unique_id: string;
|
|
88
88
|
}
|
|
89
|
+
export interface SubTask {
|
|
90
|
+
id: string;
|
|
91
|
+
title: string;
|
|
92
|
+
description?: string;
|
|
93
|
+
completed: boolean;
|
|
94
|
+
requirements?: string[];
|
|
95
|
+
}
|
|
89
96
|
export interface Task {
|
|
90
|
-
id
|
|
91
|
-
title
|
|
97
|
+
id: string;
|
|
98
|
+
title: string;
|
|
92
99
|
description?: string;
|
|
93
|
-
|
|
100
|
+
phase?: string;
|
|
101
|
+
category?: string;
|
|
102
|
+
agentId: string;
|
|
103
|
+
subtasks: SubTask[];
|
|
104
|
+
completed: boolean;
|
|
105
|
+
createdAt?: Date;
|
|
106
|
+
updatedAt?: Date;
|
|
107
|
+
priority?: 'low' | 'medium' | 'high';
|
|
108
|
+
tags?: string[];
|
|
109
|
+
}
|
|
110
|
+
export interface TaskResponse {
|
|
111
|
+
success: boolean;
|
|
112
|
+
data?: Task | Task[] | SubTask | string[] | string;
|
|
113
|
+
message?: string;
|
|
114
|
+
error?: string;
|
|
115
|
+
agentId?: string;
|
|
116
|
+
count?: number;
|
|
94
117
|
}
|
|
95
118
|
export interface VectorItem {
|
|
96
119
|
id: string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codebolt Types - Essential type exports for the codeboltjs library
|
|
3
|
+
*
|
|
4
|
+
* This file provides easy access to all user-facing types exported by the library.
|
|
5
|
+
* Users can import types from here for better organization.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import type { Message, ToolCall, APIResponse } from 'codeboltjs/types';
|
|
10
|
+
* // or
|
|
11
|
+
* import type { LLMChatOptions, BrowserScreenshotOptions } from 'codeboltjs/types';
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export type { Message, ToolCall, Tool, UserMessage, LLMInferenceParams, APIResponse, CodeboltConfig, ProgressCallback, ErrorCallback, SuccessCallback, CompletionCallback, OpenAIMessage, OpenAITool, ConversationEntry, ToolResult, ToolDetails, UserMessageContent, CodeboltAPI, ReadFileOptions, WriteFileOptions, ListFilesOptions, SearchFilesOptions, GrepSearchOptions, BrowserNavigationOptions, BrowserScreenshotOptions, BrowserElementSelector, TerminalExecuteOptions, GitCommitOptions, GitLogOptions, LLMChatOptions, VectorAddOptions, VectorQueryOptions, AgentMessageHandler, AgentConfiguration, MemorySetOptions, MemoryGetOptions, TaskCreateOptions, TaskUpdateOptions, AddSubTaskOptions, UpdateSubTaskOptions, TaskFilterOptions, TaskMarkdownImportOptions, TaskMarkdownExportOptions, CodeAnalysisOptions, CodeParseOptions, DebugLogOptions, ProjectInfo, CrawlerOptions, MCPExecuteOptions, MCPConfigureOptions, StateUpdateOptions, ChatSendOptions, ChatHistoryOptions, NotificationOptions, PaginationOptions, FilterOptions, AsyncOperationOptions, APIEventMap } from './libFunctionTypes';
|
|
15
|
+
export type { GitFileStatus, StatusResult, CommitSummary, DiffResult, AgentFunction, AgentDetail, Agent, Task, SubTask, TaskResponse, VectorItem, VectorQueryResult, FileEntry, SearchMatch, SearchResult, BrowserElement, CodeIssue, CodeAnalysis, CodeMatcher, MCPTool, MCPServer, ASTNode, Notification, DeepPartial, DeepRequired, Optional, Required } from './commonTypes';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Codebolt Types - Essential type exports for the codeboltjs library
|
|
4
|
+
*
|
|
5
|
+
* This file provides easy access to all user-facing types exported by the library.
|
|
6
|
+
* Users can import types from here for better organization.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import type { Message, ToolCall, APIResponse } from 'codeboltjs/types';
|
|
11
|
+
* // or
|
|
12
|
+
* import type { LLMChatOptions, BrowserScreenshotOptions } from 'codeboltjs/types';
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -166,6 +166,40 @@ export interface UserMessageContent {
|
|
|
166
166
|
/** The text content */
|
|
167
167
|
text: string;
|
|
168
168
|
}
|
|
169
|
+
/**
|
|
170
|
+
* User message received from the Codebolt platform
|
|
171
|
+
* This is a simplified, user-friendly version of the internal message format
|
|
172
|
+
*/
|
|
173
|
+
export interface UserMessage {
|
|
174
|
+
type: string;
|
|
175
|
+
/** The user's message content */
|
|
176
|
+
userMessage: string;
|
|
177
|
+
/** Current file being worked on */
|
|
178
|
+
currentFile: string;
|
|
179
|
+
/** Files mentioned in the message */
|
|
180
|
+
mentionedFiles: string[];
|
|
181
|
+
/** Full file paths mentioned */
|
|
182
|
+
mentionedFullPaths: string[];
|
|
183
|
+
/** MCPs mentioned */
|
|
184
|
+
mentionedMCPs: string[];
|
|
185
|
+
/** Folders mentioned */
|
|
186
|
+
mentionedFolders: string[];
|
|
187
|
+
/** Images uploaded with the message */
|
|
188
|
+
uploadedImages: string[];
|
|
189
|
+
/** Selected agent information */
|
|
190
|
+
selectedAgent: {
|
|
191
|
+
id: string;
|
|
192
|
+
name: string;
|
|
193
|
+
};
|
|
194
|
+
/** Unique message identifier */
|
|
195
|
+
messageId: string;
|
|
196
|
+
/** Thread identifier */
|
|
197
|
+
threadId: string;
|
|
198
|
+
/** Any text selection in the editor */
|
|
199
|
+
selection?: any;
|
|
200
|
+
remixPrompt?: string;
|
|
201
|
+
mentionedAgents?: [];
|
|
202
|
+
}
|
|
169
203
|
/**
|
|
170
204
|
* Interface for codebolt API functionality
|
|
171
205
|
*/
|
|
@@ -177,6 +211,9 @@ export interface CodeboltAPI {
|
|
|
177
211
|
getTools: (mcps: any[]) => Promise<{
|
|
178
212
|
data: OpenAITool[];
|
|
179
213
|
}>;
|
|
214
|
+
executeTool: (toolboxName: string, actualToolName: string, toolInput: any) => Promise<{
|
|
215
|
+
data: any;
|
|
216
|
+
}>;
|
|
180
217
|
};
|
|
181
218
|
fs: {
|
|
182
219
|
readFile: (filepath: string) => Promise<string>;
|
|
@@ -190,6 +227,9 @@ export interface CodeboltAPI {
|
|
|
190
227
|
projectPath: string;
|
|
191
228
|
}>;
|
|
192
229
|
};
|
|
230
|
+
chat: {
|
|
231
|
+
sendMessage: (message: string, metadata: any) => Promise<void>;
|
|
232
|
+
};
|
|
193
233
|
}
|
|
194
234
|
export interface ReadFileOptions {
|
|
195
235
|
/** File path to read */
|
|
@@ -330,7 +370,7 @@ export interface VectorQueryOptions {
|
|
|
330
370
|
minScore?: number;
|
|
331
371
|
}
|
|
332
372
|
export interface AgentMessageHandler {
|
|
333
|
-
(userMessage:
|
|
373
|
+
(userMessage: UserMessage): void | Promise<void> | any | Promise<any>;
|
|
334
374
|
}
|
|
335
375
|
export interface AgentConfiguration {
|
|
336
376
|
/** Agent name */
|
|
@@ -359,26 +399,92 @@ export interface MemoryGetOptions {
|
|
|
359
399
|
export interface TaskCreateOptions {
|
|
360
400
|
/** Task title */
|
|
361
401
|
title: string;
|
|
402
|
+
/** Agent ID for task organization */
|
|
403
|
+
agentId?: string;
|
|
362
404
|
/** Task description */
|
|
363
405
|
description?: string;
|
|
406
|
+
/** Task phase */
|
|
407
|
+
phase?: string;
|
|
408
|
+
/** Task category */
|
|
409
|
+
category?: string;
|
|
364
410
|
/** Task priority */
|
|
365
411
|
priority?: 'low' | 'medium' | 'high';
|
|
366
|
-
/** Due date */
|
|
367
|
-
dueDate?: Date | string;
|
|
368
412
|
/** Associated tags */
|
|
369
413
|
tags?: string[];
|
|
370
414
|
}
|
|
371
415
|
export interface TaskUpdateOptions {
|
|
372
416
|
/** Task ID */
|
|
373
|
-
|
|
417
|
+
taskId: string;
|
|
374
418
|
/** New title */
|
|
375
419
|
title?: string;
|
|
376
420
|
/** New description */
|
|
377
421
|
description?: string;
|
|
422
|
+
/** New phase */
|
|
423
|
+
phase?: string;
|
|
424
|
+
/** New category */
|
|
425
|
+
category?: string;
|
|
378
426
|
/** Completion status */
|
|
379
427
|
completed?: boolean;
|
|
380
428
|
/** New priority */
|
|
381
429
|
priority?: 'low' | 'medium' | 'high';
|
|
430
|
+
/** New tags */
|
|
431
|
+
tags?: string[];
|
|
432
|
+
/** New agent ID */
|
|
433
|
+
agentId?: string;
|
|
434
|
+
}
|
|
435
|
+
export interface AddSubTaskOptions {
|
|
436
|
+
/** Parent task ID */
|
|
437
|
+
taskId: string;
|
|
438
|
+
/** Subtask title */
|
|
439
|
+
title: string;
|
|
440
|
+
/** Subtask description */
|
|
441
|
+
description?: string;
|
|
442
|
+
/** Subtask requirements */
|
|
443
|
+
requirements?: string[];
|
|
444
|
+
}
|
|
445
|
+
export interface UpdateSubTaskOptions {
|
|
446
|
+
/** Parent task ID */
|
|
447
|
+
taskId: string;
|
|
448
|
+
/** Subtask ID */
|
|
449
|
+
subtaskId: string;
|
|
450
|
+
/** New title */
|
|
451
|
+
title?: string;
|
|
452
|
+
/** New description */
|
|
453
|
+
description?: string;
|
|
454
|
+
/** Completion status */
|
|
455
|
+
completed?: boolean;
|
|
456
|
+
/** New requirements */
|
|
457
|
+
requirements?: string[];
|
|
458
|
+
}
|
|
459
|
+
export interface TaskFilterOptions {
|
|
460
|
+
/** Filter by agent ID */
|
|
461
|
+
agentId?: string;
|
|
462
|
+
/** Filter by category */
|
|
463
|
+
category?: string;
|
|
464
|
+
/** Filter by phase */
|
|
465
|
+
phase?: string;
|
|
466
|
+
/** Filter by priority */
|
|
467
|
+
priority?: 'low' | 'medium' | 'high';
|
|
468
|
+
/** Filter by completion status */
|
|
469
|
+
completed?: boolean;
|
|
470
|
+
}
|
|
471
|
+
export interface TaskMarkdownImportOptions {
|
|
472
|
+
/** Markdown content to import */
|
|
473
|
+
markdown: string;
|
|
474
|
+
/** Agent ID for imported tasks */
|
|
475
|
+
agentId?: string;
|
|
476
|
+
/** Phase for imported tasks */
|
|
477
|
+
phase?: string;
|
|
478
|
+
/** Category for imported tasks */
|
|
479
|
+
category?: string;
|
|
480
|
+
}
|
|
481
|
+
export interface TaskMarkdownExportOptions {
|
|
482
|
+
/** Filter by phase */
|
|
483
|
+
phase?: string;
|
|
484
|
+
/** Filter by agent ID */
|
|
485
|
+
agentId?: string;
|
|
486
|
+
/** Filter by category */
|
|
487
|
+
category?: string;
|
|
382
488
|
}
|
|
383
489
|
export interface CodeAnalysisOptions {
|
|
384
490
|
/** File or directory path */
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for agent notification functions
|
|
3
|
+
*/
|
|
4
|
+
export interface AgentNotifications {
|
|
5
|
+
StartSubagentTaskRequestNotify(parentAgentId: string, subagentId: string, task: string, priority?: string, dependencies?: string[], toolUseId?: string): void;
|
|
6
|
+
StartSubagentTaskResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
7
|
+
SubagentTaskCompletedNotify(parentAgentId: string, subagentId: string, taskId: string, result: any, status: string, toolUseId?: string): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { WebFetchResponseNotification, WebSearchResponseNotification } from '../notifications/browser';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for browser notification functions
|
|
4
|
+
*/
|
|
5
|
+
export interface BrowserNotifications {
|
|
6
|
+
WebFetchRequestNotify(url: string, method?: string, headers?: Record<string, string>, body?: any, timeout?: number, toolUseId?: string): void;
|
|
7
|
+
WebFetchResponseNotify(content: string | any, isError?: boolean, toolUseId?: string, data?: WebFetchResponseNotification['data']): void;
|
|
8
|
+
WebSearchRequestNotify(query: string, maxResults?: number, searchEngine?: string, filters?: any, toolUseId?: string): void;
|
|
9
|
+
WebSearchResponseNotify(content: string | any, isError?: boolean, toolUseId?: string, data?: WebSearchResponseNotification['data']): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AgentTextResponseNotification, GetChatHistoryRequestNotification } from '../notifications/chat';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for chat notification functions
|
|
4
|
+
*/
|
|
5
|
+
export interface ChatNotifications {
|
|
6
|
+
UserMessageRequestNotify(message: string, payload?: any, toolUseId?: string): void;
|
|
7
|
+
AgentTextResponseNotify(content: string | any, isError?: boolean, toolUseId?: string, data?: AgentTextResponseNotification['data']): void;
|
|
8
|
+
GetChatHistoryRequestNotify(data?: GetChatHistoryRequestNotification['data'], toolUseId?: string): void;
|
|
9
|
+
GetChatHistoryResultNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GrepSearchResponseNotification, GlobSearchResponseNotification } from '../notifications/codeutils';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for code utils notification functions
|
|
4
|
+
*/
|
|
5
|
+
export interface CodeutilsNotifications {
|
|
6
|
+
GrepSearchRequestNotify(pattern: string, filePath?: string, recursive?: boolean, ignoreCase?: boolean, maxResults?: number, toolUseId?: string): void;
|
|
7
|
+
GrepSearchResponseNotify(content: string | any, isError?: boolean, toolUseId?: string, data?: GrepSearchResponseNotification['data']): void;
|
|
8
|
+
GlobSearchRequestNotify(pattern: string, basePath?: string, maxDepth?: number, includeDirectories?: boolean, toolUseId?: string): void;
|
|
9
|
+
GlobSearchResponseNotify(content: string | any, isError?: boolean, toolUseId?: string, data?: GlobSearchResponseNotification['data']): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CrawlerSearchResponseNotification, CrawlerStartResponseNotification } from '../notifications/crawler';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for crawler notification functions
|
|
4
|
+
*/
|
|
5
|
+
export interface CrawlerNotifications {
|
|
6
|
+
CrawlerSearchRequestNotify(url: string, searchQuery?: string, maxDepth?: number, maxPages?: number, includeSubdomains?: boolean, followRedirects?: boolean, toolUseId?: string): void;
|
|
7
|
+
CrawlerSearchResponseNotify(content: string | any, isError?: boolean, toolUseId?: string, data?: CrawlerSearchResponseNotification['data']): void;
|
|
8
|
+
CrawlerStartRequestNotify(startUrl: string, options?: any, toolUseId?: string): void;
|
|
9
|
+
CrawlerStartResponseNotify(content: string | any, isError?: boolean, toolUseId?: string, data?: CrawlerStartResponseNotification['data']): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for database memory notification functions
|
|
3
|
+
*/
|
|
4
|
+
export interface DbmemoryNotifications {
|
|
5
|
+
AddMemoryRequestNotify(key: string, value: any, toolUseId?: string): void;
|
|
6
|
+
AddMemoryResultNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
7
|
+
GetMemoryRequestNotify(key: string, toolUseId?: string): void;
|
|
8
|
+
GetMemoryResultNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for file system notification functions
|
|
3
|
+
*/
|
|
4
|
+
export interface FsNotifications {
|
|
5
|
+
FileCreateRequestNotify(fileName: string, source: string, filePath: string, toolUseId?: string): void;
|
|
6
|
+
FileCreateResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
7
|
+
FolderCreateRequestNotify(folderName: string, folderPath: string, toolUseId?: string): void;
|
|
8
|
+
FolderCreateResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
9
|
+
FileReadRequestNotify(filePath: string, startLine?: string, endLine?: string, toolUseId?: string): void;
|
|
10
|
+
FileReadResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
11
|
+
FileEditRequestNotify(fileName: string, filePath: string, newContent: string, toolUseId?: string): void;
|
|
12
|
+
FileEditResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
13
|
+
FileDeleteRequestNotify(fileName: string, filePath: string, toolUseId?: string): void;
|
|
14
|
+
FileDeleteResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
15
|
+
FolderDeleteRequestNotify(folderName: string, folderPath: string, toolUseId?: string): void;
|
|
16
|
+
FolderDeleteResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
17
|
+
ListDirectoryRequestNotify(dirPath: string, toolUseId?: string): void;
|
|
18
|
+
ListDirectoryResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
19
|
+
WriteToFileRequestNotify(filePath: string, text: string, toolUseId?: string): void;
|
|
20
|
+
WriteToFileResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
21
|
+
AppendToFileRequestNotify(filePath: string, text: string, toolUseId?: string): void;
|
|
22
|
+
AppendToFileResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
23
|
+
CopyFileRequestNotify(sourceFile: string, destinationFile: string, toolUseId?: string): void;
|
|
24
|
+
CopyFileResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
25
|
+
MoveFileRequestNotify(sourceFile: string, destinationFile: string, toolUseId?: string): void;
|
|
26
|
+
MoveFileResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for git notification functions
|
|
3
|
+
*/
|
|
4
|
+
export interface GitNotifications {
|
|
5
|
+
GitInitRequestNotify(path?: string, toolUseId?: string): void;
|
|
6
|
+
GitInitResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
7
|
+
GitPullRequestNotify(path?: string, toolUseId?: string): void;
|
|
8
|
+
GitPullResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
9
|
+
GitPushRequestNotify(path?: string, toolUseId?: string): void;
|
|
10
|
+
GitPushResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
11
|
+
GitStatusRequestNotify(path?: string, toolUseId?: string): void;
|
|
12
|
+
GitStatusResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
13
|
+
GitAddRequestNotify(path?: string, files?: string[], toolUseId?: string): void;
|
|
14
|
+
GitAddResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
15
|
+
GitCommitRequestNotify(path?: string, message?: string, toolUseId?: string): void;
|
|
16
|
+
GitCommitResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
17
|
+
GitCheckoutRequestNotify(path?: string, branchName?: string, toolUseId?: string): void;
|
|
18
|
+
GitCheckoutResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
19
|
+
GitBranchRequestNotify(path?: string, branchName?: string, toolUseId?: string): void;
|
|
20
|
+
GitBranchResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
21
|
+
GitLogsRequestNotify(path?: string, toolUseId?: string): void;
|
|
22
|
+
GitLogsResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
23
|
+
GitDiffRequestNotify(path?: string, toolUseId?: string): void;
|
|
24
|
+
GitDiffResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
25
|
+
GitRemoteAddRequestNotify(remoteName: string, remoteUrl: string, path?: string, toolUseId?: string): void;
|
|
26
|
+
GitRemoteAddResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
27
|
+
GitCloneRequestNotify(repoUrl: string, targetPath?: string, toolUseId?: string): void;
|
|
28
|
+
GitCloneResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SummarizePreviousConversationRequestNotification, SummarizeCurentMessageRequestNotification } from '../notifications/history';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for history notification functions
|
|
4
|
+
*/
|
|
5
|
+
export interface HistoryNotifications {
|
|
6
|
+
summarizePreviousConversation(data?: SummarizePreviousConversationRequestNotification['data'], toolUseId?: string): void;
|
|
7
|
+
sendSummarizePreviousResult(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
8
|
+
summarizeCurrentMessage(data: SummarizeCurentMessageRequestNotification['data'], toolUseId?: string): void;
|
|
9
|
+
sendSummarizeCurrentResult(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
10
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LLMRequestNotification, LLMGetTokenCountRequestNotification, LLMGetTokenCountResponseNotification } from '../notifications/llm';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for LLM notification functions
|
|
4
|
+
*/
|
|
5
|
+
export interface LlmNotifications {
|
|
6
|
+
sendInferenceRequest(data: LLMRequestNotification['data'], toolUseId?: string): void;
|
|
7
|
+
sendInferenceResponse(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
8
|
+
getTokenCount(data: LLMGetTokenCountRequestNotification['data'], toolUseId?: string): void;
|
|
9
|
+
sendTokenCountResponse(content: string | any, isError?: boolean, toolUseId?: string, data?: LLMGetTokenCountResponseNotification['data']): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for MCP notification functions
|
|
3
|
+
*/
|
|
4
|
+
export interface McpNotifications {
|
|
5
|
+
GetEnabledMCPServersRequestNotify(toolUseId?: string): void;
|
|
6
|
+
GetEnabledMCPServersResultNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
7
|
+
ListToolsFromMCPServersRequestNotify(toolboxes: string[], toolUseId?: string): void;
|
|
8
|
+
ListToolsFromMCPServersResultNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
9
|
+
GetToolsRequestNotify(tools: {
|
|
10
|
+
toolbox: string;
|
|
11
|
+
toolName: string;
|
|
12
|
+
}[], toolUseId?: string): void;
|
|
13
|
+
GetToolsResultNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
14
|
+
ExecuteToolRequestNotify(toolbox: string, toolName: string, params: any, toolUseId?: string): void;
|
|
15
|
+
ExecuteToolResultNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for search notification functions
|
|
3
|
+
*/
|
|
4
|
+
export interface SearchNotifications {
|
|
5
|
+
SearchInitRequestNotify(engine?: string, toolUseId?: string): void;
|
|
6
|
+
SearchInitResultNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
7
|
+
SearchRequestNotify(query: string, toolUseId?: string): void;
|
|
8
|
+
SearchResultNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
9
|
+
GetFirstLinkRequestNotify(query: string, toolUseId?: string): void;
|
|
10
|
+
GetFirstLinkResultNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
11
|
+
}
|