@codebolt/codeboltjs 2.2.4 → 4.0.2
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 +117 -111
- package/dist/modules/agent.d.ts +1 -1
- package/dist/modules/memory.d.ts +39 -0
- package/dist/modules/memory.js +106 -0
- package/dist/modules/task.d.ts +6 -0
- package/dist/modules/task.js +63 -0
- package/dist/modules/todo.d.ts +1 -0
- package/dist/modules/todo.js +9 -0
- package/dist/modules/user-message-utilities.d.ts +2 -2
- package/package.json +16 -15
package/dist/core/Codebolt.d.ts
CHANGED
|
@@ -35,19 +35,19 @@ declare class Codebolt {
|
|
|
35
35
|
*/
|
|
36
36
|
get ready(): boolean;
|
|
37
37
|
fs: {
|
|
38
|
-
createFile: (fileName: string, source: string, filePath: string) => Promise<
|
|
39
|
-
createFolder: (folderName: string, folderPath: string) => Promise<
|
|
40
|
-
readFile: (filePath: string) => Promise<
|
|
41
|
-
updateFile: (filename: string, filePath: string, newContent: string) => Promise<
|
|
42
|
-
deleteFile: (filename: string, filePath: string) => Promise<
|
|
43
|
-
deleteFolder: (foldername: string, folderpath: string) => Promise<
|
|
44
|
-
listFile: (folderPath: string, isRecursive?: boolean) => Promise<
|
|
45
|
-
listCodeDefinitionNames: (path: string) => Promise<
|
|
46
|
-
searchFiles: (path: string, regex: string, filePattern: string) => Promise<
|
|
38
|
+
createFile: (fileName: string, source: string, filePath: string) => Promise<FlatUserMessage>;
|
|
39
|
+
createFolder: (folderName: string, folderPath: string) => Promise<FlatUserMessage>;
|
|
40
|
+
readFile: (filePath: string) => Promise<FlatUserMessage>;
|
|
41
|
+
updateFile: (filename: string, filePath: string, newContent: string) => Promise<FlatUserMessage>;
|
|
42
|
+
deleteFile: (filename: string, filePath: string) => Promise<FlatUserMessage>;
|
|
43
|
+
deleteFolder: (foldername: string, folderpath: string) => Promise<FlatUserMessage>;
|
|
44
|
+
listFile: (folderPath: string, isRecursive?: boolean) => Promise<FlatUserMessage>;
|
|
45
|
+
listCodeDefinitionNames: (path: string) => Promise<FlatUserMessage>;
|
|
46
|
+
searchFiles: (path: string, regex: string, filePattern: string) => Promise<FlatUserMessage>;
|
|
47
47
|
writeToFile: (relPath: string, newContent: string) => Promise<any>;
|
|
48
|
-
grepSearch: (path: string, query: string, includePattern?: string, excludePattern?: string, caseSensitive?: boolean) => Promise<
|
|
49
|
-
fileSearch: (query: string) => Promise<
|
|
50
|
-
editFileWithDiff: (targetFile: string, codeEdit: string, diffIdentifier: string, prompt: string, applyModel?: string) => Promise<
|
|
48
|
+
grepSearch: (path: string, query: string, includePattern?: string, excludePattern?: string, caseSensitive?: boolean) => Promise<FlatUserMessage>;
|
|
49
|
+
fileSearch: (query: string) => Promise<FlatUserMessage>;
|
|
50
|
+
editFileWithDiff: (targetFile: string, codeEdit: string, diffIdentifier: string, prompt: string, applyModel?: string) => Promise<FlatUserMessage>;
|
|
51
51
|
readManyFiles: (params: {
|
|
52
52
|
paths: string[];
|
|
53
53
|
include?: string[];
|
|
@@ -59,7 +59,7 @@ declare class Codebolt {
|
|
|
59
59
|
include_metadata?: boolean;
|
|
60
60
|
separator_format?: string;
|
|
61
61
|
notifyUser?: boolean;
|
|
62
|
-
}) => Promise<
|
|
62
|
+
}) => Promise<FlatUserMessage>;
|
|
63
63
|
listDirectory: (params: {
|
|
64
64
|
path: string;
|
|
65
65
|
ignore?: string[];
|
|
@@ -67,55 +67,55 @@ declare class Codebolt {
|
|
|
67
67
|
detailed?: boolean;
|
|
68
68
|
limit?: number;
|
|
69
69
|
notifyUser?: boolean;
|
|
70
|
-
}) => Promise<
|
|
70
|
+
}) => Promise<FlatUserMessage>;
|
|
71
71
|
};
|
|
72
72
|
git: {
|
|
73
|
-
init: (path: string) => Promise<
|
|
74
|
-
pull: () => Promise<
|
|
75
|
-
push: () => Promise<
|
|
76
|
-
status: () => Promise<
|
|
77
|
-
addAll: () => Promise<
|
|
78
|
-
commit: (message: string) => Promise<
|
|
79
|
-
checkout: (branch: string) => Promise<
|
|
80
|
-
branch: (branch: string) => Promise<
|
|
81
|
-
logs: (path: string) => Promise<
|
|
82
|
-
diff: (commitHash: string) => Promise<
|
|
73
|
+
init: (path: string) => Promise<FlatUserMessage>;
|
|
74
|
+
pull: () => Promise<FlatUserMessage>;
|
|
75
|
+
push: () => Promise<FlatUserMessage>;
|
|
76
|
+
status: () => Promise<FlatUserMessage>;
|
|
77
|
+
addAll: () => Promise<FlatUserMessage>;
|
|
78
|
+
commit: (message: string) => Promise<FlatUserMessage>;
|
|
79
|
+
checkout: (branch: string) => Promise<FlatUserMessage>;
|
|
80
|
+
branch: (branch: string) => Promise<FlatUserMessage>;
|
|
81
|
+
logs: (path: string) => Promise<FlatUserMessage>;
|
|
82
|
+
diff: (commitHash: string) => Promise<FlatUserMessage>;
|
|
83
83
|
};
|
|
84
84
|
llm: {
|
|
85
|
-
inference: (params:
|
|
86
|
-
completion:
|
|
85
|
+
inference: (params: FlatUserMessage) => Promise<{
|
|
86
|
+
completion: FlatUserMessage;
|
|
87
87
|
}>;
|
|
88
88
|
getModelConfig: (modelId?: string) => Promise<{
|
|
89
|
-
config:
|
|
89
|
+
config: FlatUserMessage | null;
|
|
90
90
|
success: boolean;
|
|
91
91
|
error?: string;
|
|
92
92
|
}>;
|
|
93
93
|
};
|
|
94
94
|
browser: {
|
|
95
|
-
newPage: () => Promise<
|
|
96
|
-
getUrl: () => Promise<
|
|
97
|
-
goToPage: (url: string) => Promise<
|
|
98
|
-
screenshot: () => Promise<
|
|
99
|
-
getHTML: () => Promise<
|
|
100
|
-
getMarkdown: () => Promise<
|
|
95
|
+
newPage: () => Promise<FlatUserMessage>;
|
|
96
|
+
getUrl: () => Promise<FlatUserMessage>;
|
|
97
|
+
goToPage: (url: string) => Promise<FlatUserMessage>;
|
|
98
|
+
screenshot: () => Promise<FlatUserMessage>;
|
|
99
|
+
getHTML: () => Promise<FlatUserMessage>;
|
|
100
|
+
getMarkdown: () => Promise<FlatUserMessage>;
|
|
101
101
|
getPDF: () => void;
|
|
102
102
|
pdfToText: () => void;
|
|
103
|
-
getContent: () => Promise<
|
|
104
|
-
getSnapShot: () => Promise<
|
|
105
|
-
getBrowserInfo: () => Promise<
|
|
106
|
-
extractText: () => Promise<
|
|
103
|
+
getContent: () => Promise<FlatUserMessage>;
|
|
104
|
+
getSnapShot: () => Promise<FlatUserMessage>;
|
|
105
|
+
getBrowserInfo: () => Promise<FlatUserMessage>;
|
|
106
|
+
extractText: () => Promise<FlatUserMessage>;
|
|
107
107
|
close: () => void;
|
|
108
|
-
scroll: (direction: string, pixels: string) => Promise<
|
|
109
|
-
type: (elementid: string, text: string) => Promise<
|
|
110
|
-
click: (elementid: string) => Promise<
|
|
111
|
-
enter: () => Promise<
|
|
112
|
-
search: (elementid: string, query: string) => Promise<
|
|
108
|
+
scroll: (direction: string, pixels: string) => Promise<FlatUserMessage>;
|
|
109
|
+
type: (elementid: string, text: string) => Promise<FlatUserMessage>;
|
|
110
|
+
click: (elementid: string) => Promise<FlatUserMessage>;
|
|
111
|
+
enter: () => Promise<FlatUserMessage>;
|
|
112
|
+
search: (elementid: string, query: string) => Promise<FlatUserMessage>;
|
|
113
113
|
};
|
|
114
114
|
chat: {
|
|
115
|
-
getChatHistory: (threadId: string) => Promise<
|
|
115
|
+
getChatHistory: (threadId: string) => Promise<FlatUserMessage>;
|
|
116
116
|
setRequestHandler: (handler: (request: any, response: (data: any) => void) => Promise<void> | void) => void;
|
|
117
117
|
sendMessage: (message: string, payload: any) => void;
|
|
118
|
-
waitforReply: (message: string) => Promise<
|
|
118
|
+
waitforReply: (message: string) => Promise<FlatUserMessage>;
|
|
119
119
|
processStarted: (onStopClicked?: (message: any) => void) => {
|
|
120
120
|
stopProcess: () => void;
|
|
121
121
|
cleanup: () => void;
|
|
@@ -150,8 +150,8 @@ declare class Codebolt {
|
|
|
150
150
|
eventNames(): (string | symbol)[];
|
|
151
151
|
};
|
|
152
152
|
executeCommand: (command: string, returnEmptyStringOnSuccess?: boolean) => Promise<any>;
|
|
153
|
-
executeCommandRunUntilError: (command: string, executeInMain?: boolean) => Promise<
|
|
154
|
-
sendManualInterrupt(): Promise<
|
|
153
|
+
executeCommandRunUntilError: (command: string, executeInMain?: boolean) => Promise<FlatUserMessage>;
|
|
154
|
+
sendManualInterrupt(): Promise<FlatUserMessage>;
|
|
155
155
|
executeCommandWithStream(command: string, executeInMain?: boolean): {
|
|
156
156
|
cleanup?: () => void;
|
|
157
157
|
[EventEmitter.captureRejectionSymbol]?<K>(error: Error, event: string | symbol, ...args: any[]): void;
|
|
@@ -174,9 +174,9 @@ declare class Codebolt {
|
|
|
174
174
|
};
|
|
175
175
|
codeutils: {
|
|
176
176
|
getAllFilesAsMarkDown: () => Promise<string>;
|
|
177
|
-
performMatch: (matcherDefinition: object, problemPatterns: any[], problems?: any[]) => Promise<
|
|
178
|
-
getMatcherList: () => Promise<
|
|
179
|
-
matchDetail: (matcher: string) => Promise<
|
|
177
|
+
performMatch: (matcherDefinition: object, problemPatterns: any[], problems?: any[]) => Promise<FlatUserMessage>;
|
|
178
|
+
getMatcherList: () => Promise<FlatUserMessage>;
|
|
179
|
+
matchDetail: (matcher: string) => Promise<FlatUserMessage>;
|
|
180
180
|
};
|
|
181
181
|
crawler: {
|
|
182
182
|
start: () => void;
|
|
@@ -208,102 +208,108 @@ declare class Codebolt {
|
|
|
208
208
|
parseWarnings: (output: import("../modules/outputparsers").ParsableOutput) => string[];
|
|
209
209
|
};
|
|
210
210
|
project: {
|
|
211
|
-
getProjectSettings: () => Promise<
|
|
212
|
-
getProjectPath: () => Promise<
|
|
213
|
-
getRepoMap: (message: any) => Promise<
|
|
211
|
+
getProjectSettings: () => Promise<FlatUserMessage>;
|
|
212
|
+
getProjectPath: () => Promise<FlatUserMessage>;
|
|
213
|
+
getRepoMap: (message: any) => Promise<FlatUserMessage>;
|
|
214
214
|
runProject: () => void;
|
|
215
215
|
getEditorFileStatus: () => Promise<any>;
|
|
216
216
|
};
|
|
217
217
|
dbmemory: {
|
|
218
|
-
addKnowledge: (key: string, value:
|
|
219
|
-
getKnowledge: (key: string) => Promise<
|
|
218
|
+
addKnowledge: (key: string, value: FlatUserMessage) => Promise<FlatUserMessage>;
|
|
219
|
+
getKnowledge: (key: string) => Promise<FlatUserMessage>;
|
|
220
220
|
};
|
|
221
221
|
cbstate: {
|
|
222
222
|
getApplicationState: () => Promise<import("../types/commonTypes").ApplicationState>;
|
|
223
|
-
addToAgentState: (key: string, value: string) => Promise<
|
|
224
|
-
getAgentState: () => Promise<
|
|
225
|
-
getProjectState: () => Promise<
|
|
226
|
-
updateProjectState: (key: string, value: any) => Promise<
|
|
223
|
+
addToAgentState: (key: string, value: string) => Promise<FlatUserMessage>;
|
|
224
|
+
getAgentState: () => Promise<FlatUserMessage>;
|
|
225
|
+
getProjectState: () => Promise<FlatUserMessage>;
|
|
226
|
+
updateProjectState: (key: string, value: any) => Promise<FlatUserMessage>;
|
|
227
227
|
};
|
|
228
228
|
task: {
|
|
229
|
-
createTask: (options:
|
|
230
|
-
createSimpleTask: (taskName: string, threadId?: string) => Promise<
|
|
231
|
-
getTaskList: (options?:
|
|
232
|
-
getTaskDetail: (options:
|
|
233
|
-
addStepToTask: (options:
|
|
234
|
-
getTaskMessages: (options:
|
|
235
|
-
updateTask: (taskId: string, updates:
|
|
236
|
-
updateSimpleTask: (taskId: string, taskName: string) => Promise<
|
|
237
|
-
deleteTask: (taskId: string) => Promise<
|
|
238
|
-
completeTask: (taskId: string) => Promise<
|
|
239
|
-
startTask: (taskId: string) => Promise<
|
|
240
|
-
getAllSteps: (options?:
|
|
241
|
-
getCurrentRunningStep: (options?:
|
|
242
|
-
updateStepStatus: (options:
|
|
243
|
-
completeStep: (options:
|
|
244
|
-
sendSteeringMessage: (options:
|
|
245
|
-
canTaskStart: (taskId: string) => Promise<
|
|
246
|
-
getTasksDependentOn: (taskId: string) => Promise<
|
|
247
|
-
getTasksReadyToStart: (options?:
|
|
248
|
-
getTaskDependencyChain: (taskId: string) => Promise<
|
|
249
|
-
getTaskStats: (options?:
|
|
250
|
-
toggleTaskCompletion: (taskId: string, completed: boolean) => Promise<
|
|
251
|
-
createQuickTask: (name: string, threadId?: string) => Promise<
|
|
252
|
-
getTasksStartedByMe: (userId: string, options?:
|
|
253
|
-
addTask: (params: import("../types/libFunctionTypes").TaskCreateOptions) => Promise<
|
|
254
|
-
getTasks: (filters?: import("../types/libFunctionTypes").TaskFilterOptions) => Promise<
|
|
255
|
-
getTasksByAgent: (agentId: string) => Promise<
|
|
256
|
-
getTasksByCategory: (category: string) => Promise<
|
|
229
|
+
createTask: (options: FlatUserMessage) => Promise<FlatUserMessage>;
|
|
230
|
+
createSimpleTask: (taskName: string, threadId?: string) => Promise<FlatUserMessage>;
|
|
231
|
+
getTaskList: (options?: FlatUserMessage) => Promise<FlatUserMessage>;
|
|
232
|
+
getTaskDetail: (options: FlatUserMessage) => Promise<FlatUserMessage>;
|
|
233
|
+
addStepToTask: (options: FlatUserMessage) => Promise<FlatUserMessage>;
|
|
234
|
+
getTaskMessages: (options: FlatUserMessage) => Promise<FlatUserMessage>;
|
|
235
|
+
updateTask: (taskId: string, updates: FlatUserMessage) => Promise<FlatUserMessage>;
|
|
236
|
+
updateSimpleTask: (taskId: string, taskName: string) => Promise<FlatUserMessage>;
|
|
237
|
+
deleteTask: (taskId: string) => Promise<FlatUserMessage>;
|
|
238
|
+
completeTask: (taskId: string) => Promise<FlatUserMessage>;
|
|
239
|
+
startTask: (taskId: string) => Promise<FlatUserMessage>;
|
|
240
|
+
getAllSteps: (options?: FlatUserMessage) => Promise<FlatUserMessage>;
|
|
241
|
+
getCurrentRunningStep: (options?: FlatUserMessage) => Promise<FlatUserMessage>;
|
|
242
|
+
updateStepStatus: (options: FlatUserMessage) => Promise<FlatUserMessage>;
|
|
243
|
+
completeStep: (options: FlatUserMessage) => Promise<FlatUserMessage>;
|
|
244
|
+
sendSteeringMessage: (options: FlatUserMessage) => Promise<FlatUserMessage>;
|
|
245
|
+
canTaskStart: (taskId: string) => Promise<FlatUserMessage>;
|
|
246
|
+
getTasksDependentOn: (taskId: string) => Promise<FlatUserMessage>;
|
|
247
|
+
getTasksReadyToStart: (options?: FlatUserMessage) => Promise<FlatUserMessage>;
|
|
248
|
+
getTaskDependencyChain: (taskId: string) => Promise<FlatUserMessage>;
|
|
249
|
+
getTaskStats: (options?: FlatUserMessage) => Promise<FlatUserMessage>;
|
|
250
|
+
toggleTaskCompletion: (taskId: string, completed: boolean) => Promise<FlatUserMessage>;
|
|
251
|
+
createQuickTask: (name: string, threadId?: string) => Promise<FlatUserMessage>;
|
|
252
|
+
getTasksStartedByMe: (userId: string, options?: FlatUserMessage) => Promise<FlatUserMessage>;
|
|
253
|
+
addTask: (params: import("../types/libFunctionTypes").TaskCreateOptions) => Promise<FlatUserMessage>;
|
|
254
|
+
getTasks: (filters?: import("../types/libFunctionTypes").TaskFilterOptions) => Promise<FlatUserMessage>;
|
|
255
|
+
getTasksByAgent: (agentId: string) => Promise<FlatUserMessage>;
|
|
256
|
+
getTasksByCategory: (category: string) => Promise<FlatUserMessage>;
|
|
257
|
+
attachJsonMemoryToTask: (taskId: string, memoryId: string) => Promise<any>;
|
|
258
|
+
attachMarktownMemoryJToTask: (taskId: string, memoryId: string) => Promise<any>;
|
|
259
|
+
attachToDoToTask: (taskId: string, todoId: string) => Promise<any>;
|
|
260
|
+
getAttachedTodos: (taskId: string) => Promise<any>;
|
|
261
|
+
getAttachedJsonMemory: (taskId: string) => Promise<any>;
|
|
262
|
+
getAttachedMarkdownMemory: (taskId: string) => Promise<any>;
|
|
257
263
|
};
|
|
258
264
|
vectordb: {
|
|
259
|
-
getVector: (key: string) => Promise<
|
|
260
|
-
addVectorItem: (item: any) => Promise<
|
|
261
|
-
queryVectorItem: (key: string) => Promise<
|
|
262
|
-
queryVectorItems: (items: [], dbPath: string) => Promise<
|
|
265
|
+
getVector: (key: string) => Promise<FlatUserMessage>;
|
|
266
|
+
addVectorItem: (item: any) => Promise<FlatUserMessage>;
|
|
267
|
+
queryVectorItem: (key: string) => Promise<FlatUserMessage>;
|
|
268
|
+
queryVectorItems: (items: [], dbPath: string) => Promise<FlatUserMessage>;
|
|
263
269
|
};
|
|
264
270
|
debug: {
|
|
265
|
-
debug: (log: string, type: import("../modules/debug").logType) => Promise<
|
|
266
|
-
openDebugBrowser: (url: string, port: number) => Promise<
|
|
271
|
+
debug: (log: string, type: import("../modules/debug").logType) => Promise<FlatUserMessage>;
|
|
272
|
+
openDebugBrowser: (url: string, port: number) => Promise<FlatUserMessage>;
|
|
267
273
|
};
|
|
268
274
|
tokenizer: {
|
|
269
|
-
addToken: (key: string) => Promise<
|
|
270
|
-
getToken: (key: string) => Promise<
|
|
275
|
+
addToken: (key: string) => Promise<FlatUserMessage>;
|
|
276
|
+
getToken: (key: string) => Promise<FlatUserMessage>;
|
|
271
277
|
};
|
|
272
278
|
chatSummary: {
|
|
273
|
-
summarizeAll: () => Promise<
|
|
279
|
+
summarizeAll: () => Promise<FlatUserMessage>;
|
|
274
280
|
summarize: (messages: {
|
|
275
281
|
role: string;
|
|
276
282
|
content: string;
|
|
277
|
-
}[], depth: number) => Promise<
|
|
283
|
+
}[], depth: number) => Promise<FlatUserMessage>;
|
|
278
284
|
};
|
|
279
285
|
mcp: {
|
|
280
|
-
getEnabledMCPServers: () => Promise<
|
|
281
|
-
getLocalMCPServers: () => Promise<
|
|
282
|
-
getMentionedMCPServers: (userMessage:
|
|
283
|
-
searchAvailableMCPServers: (query: string) => Promise<
|
|
284
|
-
listMcpFromServers: (toolBoxes: string[]) => Promise<
|
|
285
|
-
configureMCPServer: (name: string, config:
|
|
286
|
+
getEnabledMCPServers: () => Promise<FlatUserMessage>;
|
|
287
|
+
getLocalMCPServers: () => Promise<FlatUserMessage>;
|
|
288
|
+
getMentionedMCPServers: (userMessage: FlatUserMessage) => Promise<FlatUserMessage>;
|
|
289
|
+
searchAvailableMCPServers: (query: string) => Promise<FlatUserMessage>;
|
|
290
|
+
listMcpFromServers: (toolBoxes: string[]) => Promise<FlatUserMessage>;
|
|
291
|
+
configureMCPServer: (name: string, config: FlatUserMessage) => Promise<FlatUserMessage>;
|
|
286
292
|
getTools: (tools: {
|
|
287
293
|
toolbox: string;
|
|
288
294
|
toolName: string;
|
|
289
|
-
}[]) => Promise<
|
|
290
|
-
executeTool: (toolbox: string, toolName: string, params:
|
|
295
|
+
}[]) => Promise<FlatUserMessage>;
|
|
296
|
+
executeTool: (toolbox: string, toolName: string, params: FlatUserMessage) => Promise<FlatUserMessage>;
|
|
291
297
|
};
|
|
292
298
|
agent: {
|
|
293
|
-
findAgent: (task: string, maxResult: number | undefined, agents: never[] | undefined, agentLocaltion:
|
|
294
|
-
startAgent: (agentId: string, task: string) => Promise<
|
|
295
|
-
getAgentsList: (type?:
|
|
296
|
-
getAgentsDetail: (agentList?: never[]) => Promise<
|
|
299
|
+
findAgent: (task: string, maxResult: number | undefined, agents: never[] | undefined, agentLocaltion: FlatUserMessage, getFrom: FlatUserMessage) => Promise<FlatUserMessage>;
|
|
300
|
+
startAgent: (agentId: string, task: string) => Promise<FlatUserMessage>;
|
|
301
|
+
getAgentsList: (type?: FlatUserMessage) => Promise<FlatUserMessage>;
|
|
302
|
+
getAgentsDetail: (agentList?: never[]) => Promise<FlatUserMessage>;
|
|
297
303
|
};
|
|
298
304
|
utils: {
|
|
299
|
-
editFileAndApplyDiff: (filePath: string, diff: string, diffIdentifier: string, prompt: string, applyModel?: string) => Promise<
|
|
305
|
+
editFileAndApplyDiff: (filePath: string, diff: string, diffIdentifier: string, prompt: string, applyModel?: string) => Promise<FlatUserMessage>;
|
|
300
306
|
};
|
|
301
307
|
notify: NotificationFunctions;
|
|
302
308
|
/**
|
|
303
309
|
* User message utilities for accessing current user message and context
|
|
304
310
|
*/
|
|
305
311
|
userMessage: {
|
|
306
|
-
getCurrent: () =>
|
|
312
|
+
getCurrent: () => any;
|
|
307
313
|
getText: () => string;
|
|
308
314
|
getMentionedMCPs: () => string[];
|
|
309
315
|
getMentionedFiles: () => string[];
|
|
@@ -315,7 +321,7 @@ declare class Codebolt {
|
|
|
315
321
|
getSelection: () => string | undefined;
|
|
316
322
|
getMessageId: () => string | undefined;
|
|
317
323
|
getThreadId: () => string | undefined;
|
|
318
|
-
getProcessingConfig: () =>
|
|
324
|
+
getProcessingConfig: () => AgentProcessingConfig;
|
|
319
325
|
isProcessingEnabled: (type: "processMentionedMCPs" | "processRemixPrompt" | "processMentionedFiles" | "processMentionedAgents") => boolean;
|
|
320
326
|
setSessionData: (key: string, value: any) => void;
|
|
321
327
|
getSessionData: (key: string) => any;
|
package/dist/modules/agent.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare const codeboltAgent: {
|
|
|
6
6
|
* @param {string} task - The task for which an agent is needed.
|
|
7
7
|
* @returns {Promise<FindAgentByTaskResponse>} A promise that resolves with the agent details.
|
|
8
8
|
*/
|
|
9
|
-
findAgent: (task: string, maxResult: number | undefined, agents: never[] | undefined, agentLocaltion: AgentLocation
|
|
9
|
+
findAgent: (task: string, maxResult: number | undefined, agents: never[] | undefined, agentLocaltion: AgentLocation, getFrom: FilterUsing.USE_VECTOR_DB) => Promise<FindAgentByTaskResponse>;
|
|
10
10
|
/**
|
|
11
11
|
* Starts an agent for the specified task.
|
|
12
12
|
* @param {string} task - The task for which the agent should be started.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface BaseMemoryResponse {
|
|
2
|
+
requestId: string;
|
|
3
|
+
success?: boolean;
|
|
4
|
+
message?: string;
|
|
5
|
+
error?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SaveMemoryResponse extends BaseMemoryResponse {
|
|
8
|
+
type: 'saveMemoryResponse';
|
|
9
|
+
memoryId?: string;
|
|
10
|
+
data?: unknown;
|
|
11
|
+
}
|
|
12
|
+
export interface UpdateMemoryResponse extends BaseMemoryResponse {
|
|
13
|
+
type: 'updateMemoryResponse';
|
|
14
|
+
memoryId?: string;
|
|
15
|
+
data?: unknown;
|
|
16
|
+
}
|
|
17
|
+
export interface DeleteMemoryResponse extends BaseMemoryResponse {
|
|
18
|
+
type: 'deleteMemoryResponse';
|
|
19
|
+
}
|
|
20
|
+
export interface ListMemoryResponse extends BaseMemoryResponse {
|
|
21
|
+
type: 'listMemoryResponse';
|
|
22
|
+
items?: unknown[];
|
|
23
|
+
}
|
|
24
|
+
export type MemoryServiceResponse = SaveMemoryResponse | UpdateMemoryResponse | DeleteMemoryResponse | ListMemoryResponse;
|
|
25
|
+
declare const cbmemory: {
|
|
26
|
+
json: {
|
|
27
|
+
save: (json: any) => Promise<SaveMemoryResponse>;
|
|
28
|
+
update: (memoryId: string, json: any) => Promise<UpdateMemoryResponse>;
|
|
29
|
+
delete: (memoryId: string) => Promise<DeleteMemoryResponse>;
|
|
30
|
+
list: (filters?: Record<string, unknown>) => Promise<ListMemoryResponse>;
|
|
31
|
+
};
|
|
32
|
+
markdown: {
|
|
33
|
+
save: (markdown: string, metadata?: Record<string, unknown>) => Promise<SaveMemoryResponse>;
|
|
34
|
+
update: (memoryId: string, markdown: string, metadata?: Record<string, unknown>) => Promise<UpdateMemoryResponse>;
|
|
35
|
+
delete: (memoryId: string) => Promise<DeleteMemoryResponse>;
|
|
36
|
+
list: (filters?: Record<string, unknown>) => Promise<ListMemoryResponse>;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export default cbmemory;
|
|
@@ -0,0 +1,106 @@
|
|
|
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
|
+
const crypto_1 = require("crypto");
|
|
8
|
+
const cbmemory = {
|
|
9
|
+
json: {
|
|
10
|
+
save: (json) => {
|
|
11
|
+
const requestId = (0, crypto_1.randomUUID)();
|
|
12
|
+
const event = {
|
|
13
|
+
type: 'memoryEvent',
|
|
14
|
+
action: 'saveMemory',
|
|
15
|
+
requestId,
|
|
16
|
+
format: 'json',
|
|
17
|
+
json
|
|
18
|
+
};
|
|
19
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse(event, 'saveMemoryResponse');
|
|
20
|
+
},
|
|
21
|
+
update: (memoryId, json) => {
|
|
22
|
+
const requestId = (0, crypto_1.randomUUID)();
|
|
23
|
+
const event = {
|
|
24
|
+
type: 'memoryEvent',
|
|
25
|
+
action: 'updateMemory',
|
|
26
|
+
requestId,
|
|
27
|
+
format: 'json',
|
|
28
|
+
memoryId,
|
|
29
|
+
json
|
|
30
|
+
};
|
|
31
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse(event, 'updateMemoryResponse');
|
|
32
|
+
},
|
|
33
|
+
delete: (memoryId) => {
|
|
34
|
+
const requestId = (0, crypto_1.randomUUID)();
|
|
35
|
+
const event = {
|
|
36
|
+
type: 'memoryEvent',
|
|
37
|
+
action: 'deleteMemory',
|
|
38
|
+
requestId,
|
|
39
|
+
format: 'json',
|
|
40
|
+
memoryId
|
|
41
|
+
};
|
|
42
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse(event, 'deleteMemoryResponse');
|
|
43
|
+
},
|
|
44
|
+
list: (filters = {}) => {
|
|
45
|
+
const requestId = (0, crypto_1.randomUUID)();
|
|
46
|
+
const event = {
|
|
47
|
+
type: 'memoryEvent',
|
|
48
|
+
action: 'listMemory',
|
|
49
|
+
requestId,
|
|
50
|
+
format: 'json',
|
|
51
|
+
filters
|
|
52
|
+
};
|
|
53
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse(event, 'listMemoryResponse');
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
markdown: {
|
|
57
|
+
save: (markdown, metadata = {}) => {
|
|
58
|
+
const requestId = (0, crypto_1.randomUUID)();
|
|
59
|
+
const event = {
|
|
60
|
+
type: 'memoryEvent',
|
|
61
|
+
action: 'saveMemory',
|
|
62
|
+
requestId,
|
|
63
|
+
format: 'markdown',
|
|
64
|
+
markdown,
|
|
65
|
+
metadata
|
|
66
|
+
};
|
|
67
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse(event, 'saveMemoryResponse');
|
|
68
|
+
},
|
|
69
|
+
update: (memoryId, markdown, metadata = {}) => {
|
|
70
|
+
const requestId = (0, crypto_1.randomUUID)();
|
|
71
|
+
const event = {
|
|
72
|
+
type: 'memoryEvent',
|
|
73
|
+
action: 'updateMemory',
|
|
74
|
+
requestId,
|
|
75
|
+
format: 'markdown',
|
|
76
|
+
memoryId,
|
|
77
|
+
markdown,
|
|
78
|
+
metadata
|
|
79
|
+
};
|
|
80
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse(event, 'updateMemoryResponse');
|
|
81
|
+
},
|
|
82
|
+
delete: (memoryId) => {
|
|
83
|
+
const requestId = (0, crypto_1.randomUUID)();
|
|
84
|
+
const event = {
|
|
85
|
+
type: 'memoryEvent',
|
|
86
|
+
action: 'deleteMemory',
|
|
87
|
+
requestId,
|
|
88
|
+
format: 'markdown',
|
|
89
|
+
memoryId
|
|
90
|
+
};
|
|
91
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse(event, 'deleteMemoryResponse');
|
|
92
|
+
},
|
|
93
|
+
list: (filters = {}) => {
|
|
94
|
+
const requestId = (0, crypto_1.randomUUID)();
|
|
95
|
+
const event = {
|
|
96
|
+
type: 'memoryEvent',
|
|
97
|
+
action: 'listMemory',
|
|
98
|
+
requestId,
|
|
99
|
+
format: 'markdown',
|
|
100
|
+
filters
|
|
101
|
+
};
|
|
102
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse(event, 'listMemoryResponse');
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
exports.default = cbmemory;
|
package/dist/modules/task.d.ts
CHANGED
|
@@ -176,6 +176,12 @@ declare const taskService: {
|
|
|
176
176
|
* @deprecated Use getTaskList instead
|
|
177
177
|
*/
|
|
178
178
|
getTasksByCategory: (category: string) => Promise<GetTaskListResponse>;
|
|
179
|
+
attachJsonMemoryToTask: (taskId: string, memoryId: string) => Promise<any>;
|
|
180
|
+
attachMarktownMemoryJToTask: (taskId: string, memoryId: string) => Promise<any>;
|
|
181
|
+
attachToDoToTask: (taskId: string, todoId: string) => Promise<any>;
|
|
182
|
+
getAttachedTodos: (taskId: string) => Promise<any>;
|
|
183
|
+
getAttachedJsonMemory: (taskId: string) => Promise<any>;
|
|
184
|
+
getAttachedMarkdownMemory: (taskId: string) => Promise<any>;
|
|
179
185
|
};
|
|
180
186
|
export type { Task, ExtendedTask, Step, ExtendedStep, TaskMessage, MessageData, ResponseMessageData, TaskStats, CreateTaskOptions, UpdateTaskOptions, GetTaskListOptions, AddStepToTaskOptions, GetTaskDetailOptions, GetTaskMessagesOptions, UpdateStepStatusOptions, CompleteStepOptions, SendSteeringMessageOptions, GetAllStepsOptions, GetActiveStepOptions, DeleteTaskOptions, CompleteTaskOptions, StartTaskOptions, CanTaskStartOptions, GetTasksDependentOnOptions, GetTasksReadyToStartOptions, GetTaskDependencyChainOptions, GetTaskStatsOptions, TaskResponse, TaskListResponse, StepResponse, StepListResponse, TaskMessagesResponse, ActiveStepResponse, SendSteeringMessageResponse, DeleteTaskResponse, CanTaskStartResponse, TaskStatsResponse, CreateTaskResponse, GetTaskListResponse, AddStepToTaskResponse, GetTaskDetailResponse, GetTaskMessagesResponse, GetAllStepsResponse, GetCurrentRunningStepResponse, UpdateStepStatusResponse, CompleteStepResponse, UpdateTaskResponse, CompleteTaskResponse, StartTaskResponse, GetTasksDependentOnResponse, GetTasksReadyToStartResponse, GetTaskDependencyChainResponse, GetTaskStatsResponse, Position, FlowData };
|
|
181
187
|
export type { LegacyTask as Task_Legacy, LegacySubTask as SubTask, LegacyTaskResponse as TaskResponse_Legacy, LegacyTaskCreateOptions as TaskCreateOptions_Legacy, LegacyTaskUpdateOptions as TaskUpdateOptions_Legacy, AddSubTaskOptions, UpdateSubTaskOptions, TaskFilterOptions, TaskMarkdownImportOptions, TaskMarkdownExportOptions };
|
package/dist/modules/task.js
CHANGED
|
@@ -436,6 +436,69 @@ const taskService = {
|
|
|
436
436
|
// Note: The new API doesn't have category filtering built-in
|
|
437
437
|
// This would need to be implemented as post-processing
|
|
438
438
|
return taskService.getTaskList();
|
|
439
|
+
},
|
|
440
|
+
attachJsonMemoryToTask: (taskId, memoryId) => {
|
|
441
|
+
const requestId = (0, crypto_1.randomUUID)();
|
|
442
|
+
const event = {
|
|
443
|
+
type: 'taskEvent',
|
|
444
|
+
action: 'attachJsonMemoryToTask',
|
|
445
|
+
requestId,
|
|
446
|
+
taskId,
|
|
447
|
+
memoryId
|
|
448
|
+
};
|
|
449
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse(event, 'attachJsonMemoryToTaskResponse');
|
|
450
|
+
},
|
|
451
|
+
attachMarktownMemoryJToTask: (taskId, memoryId) => {
|
|
452
|
+
const requestId = (0, crypto_1.randomUUID)();
|
|
453
|
+
const event = {
|
|
454
|
+
type: 'taskEvent',
|
|
455
|
+
action: 'attachMarktownMemoryJToTask',
|
|
456
|
+
requestId,
|
|
457
|
+
taskId,
|
|
458
|
+
memoryId
|
|
459
|
+
};
|
|
460
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse(event, 'attachJsonMemoryToTaskResponse');
|
|
461
|
+
},
|
|
462
|
+
attachToDoToTask: (taskId, todoId) => {
|
|
463
|
+
const requestId = (0, crypto_1.randomUUID)();
|
|
464
|
+
const event = {
|
|
465
|
+
type: 'taskEvent',
|
|
466
|
+
action: 'attachToDoToTask',
|
|
467
|
+
requestId,
|
|
468
|
+
taskId,
|
|
469
|
+
todoId
|
|
470
|
+
};
|
|
471
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse(event, 'attachToDoToTaskResponse');
|
|
472
|
+
},
|
|
473
|
+
getAttachedTodos: (taskId) => {
|
|
474
|
+
const requestId = (0, crypto_1.randomUUID)();
|
|
475
|
+
const event = {
|
|
476
|
+
type: 'taskEvent',
|
|
477
|
+
action: 'attachToDoToTask',
|
|
478
|
+
requestId,
|
|
479
|
+
taskId,
|
|
480
|
+
};
|
|
481
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse(event, 'attachToDoToTaskResponse');
|
|
482
|
+
},
|
|
483
|
+
getAttachedJsonMemory: (taskId) => {
|
|
484
|
+
const requestId = (0, crypto_1.randomUUID)();
|
|
485
|
+
const event = {
|
|
486
|
+
type: 'taskEvent',
|
|
487
|
+
action: 'getAttachedJsonMemory',
|
|
488
|
+
requestId,
|
|
489
|
+
taskId,
|
|
490
|
+
};
|
|
491
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse(event, 'getAttachedJsonMemoryResponse');
|
|
492
|
+
},
|
|
493
|
+
getAttachedMarkdownMemory: (taskId) => {
|
|
494
|
+
const requestId = (0, crypto_1.randomUUID)();
|
|
495
|
+
const event = {
|
|
496
|
+
type: 'taskEvent',
|
|
497
|
+
action: 'getAttachedMarkdownMemory',
|
|
498
|
+
requestId,
|
|
499
|
+
taskId,
|
|
500
|
+
};
|
|
501
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse(event, 'getAttachedMarkdownMemoryResponse');
|
|
439
502
|
}
|
|
440
503
|
};
|
|
441
504
|
exports.default = taskService;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -10,7 +10,7 @@ export declare const userMessageUtilities: {
|
|
|
10
10
|
* Get the current user message object
|
|
11
11
|
* @returns Current UserMessage or undefined
|
|
12
12
|
*/
|
|
13
|
-
getCurrent: () =>
|
|
13
|
+
getCurrent: () => any;
|
|
14
14
|
/**
|
|
15
15
|
* Get the user message text content
|
|
16
16
|
* @returns Message text string
|
|
@@ -70,7 +70,7 @@ export declare const userMessageUtilities: {
|
|
|
70
70
|
* Get processing configuration
|
|
71
71
|
* @returns Processing configuration object
|
|
72
72
|
*/
|
|
73
|
-
getProcessingConfig: () =>
|
|
73
|
+
getProcessingConfig: () => AgentProcessingConfig;
|
|
74
74
|
/**
|
|
75
75
|
* Check if a processing type is enabled
|
|
76
76
|
* @param type Processing type to check
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codebolt/codeboltjs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "",
|
|
@@ -9,18 +9,9 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"dist/**/*",
|
|
11
11
|
"README.md",
|
|
12
|
-
"LICENSE"
|
|
12
|
+
"LICENSE",
|
|
13
|
+
"package.json"
|
|
13
14
|
],
|
|
14
|
-
"scripts": {
|
|
15
|
-
"build": "tsc && node script/copy-wasm.js",
|
|
16
|
-
"build:webpack": "webpack",
|
|
17
|
-
"build:all": "npm run build && npm run build:webpack",
|
|
18
|
-
"build:docs": "typedoc --plugin typedoc-plugin-missing-exports",
|
|
19
|
-
"build:jsondocs": "typedoc --plugin typedoc-plugin-missing-exports --json out.json --pretty",
|
|
20
|
-
"test": "echo \"Integration tests require WebSocket server - skipping for release\" && exit 0",
|
|
21
|
-
"clean": "powershell -Command \"Remove-Item -Path 'dist' -Recurse -Force -ErrorAction SilentlyContinue; Remove-Item -Path 'build' -Recurse -Force -ErrorAction SilentlyContinue\"",
|
|
22
|
-
"lint": "eslint src/**/*.ts && tsc --noEmit"
|
|
23
|
-
},
|
|
24
15
|
"repository": {
|
|
25
16
|
"type": "git",
|
|
26
17
|
"url": "git+https://github.com/codeboltai/codeboltjs.git",
|
|
@@ -32,7 +23,6 @@
|
|
|
32
23
|
"access": "public"
|
|
33
24
|
},
|
|
34
25
|
"dependencies": {
|
|
35
|
-
"@codebolt/types": "workspace:*",
|
|
36
26
|
"@types/uuid": "^10.0.0",
|
|
37
27
|
"buffer": "^6.0.3",
|
|
38
28
|
"execa": "^9.5.2",
|
|
@@ -44,7 +34,8 @@
|
|
|
44
34
|
"util": "^0.12.5",
|
|
45
35
|
"uuid": "^11.1.0",
|
|
46
36
|
"ws": "^8.18.3",
|
|
47
|
-
"yargs": "^17.7.2"
|
|
37
|
+
"yargs": "^17.7.2",
|
|
38
|
+
"@codebolt/types": "1.0.21"
|
|
48
39
|
},
|
|
49
40
|
"devDependencies": {
|
|
50
41
|
"@types/events": "^3.0.3",
|
|
@@ -70,5 +61,15 @@
|
|
|
70
61
|
"types": "./dist/index.d.ts",
|
|
71
62
|
"default": "./dist/index.js"
|
|
72
63
|
}
|
|
64
|
+
},
|
|
65
|
+
"scripts": {
|
|
66
|
+
"build": "tsc && 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:jsondocs": "typedoc --plugin typedoc-plugin-missing-exports --json out.json --pretty",
|
|
71
|
+
"test": "echo \"Integration tests require WebSocket server - skipping for release\" && exit 0",
|
|
72
|
+
"clean": "powershell -Command \"Remove-Item -Path 'dist' -Recurse -Force -ErrorAction SilentlyContinue; Remove-Item -Path 'build' -Recurse -Force -ErrorAction SilentlyContinue\"",
|
|
73
|
+
"lint": "eslint src/**/*.ts && tsc --noEmit"
|
|
73
74
|
}
|
|
74
|
-
}
|
|
75
|
+
}
|