@codebolt/codeboltjs 2.0.13 → 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/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 +52 -20
- package/dist/core/Codebolt.js +43 -1
- package/dist/core/websocket.js +2 -1
- 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 +2 -2
- package/dist/types/libFunctionTypes.d.ts +80 -3
- 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,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Database Memory Notification Functions
|
|
4
|
+
*
|
|
5
|
+
* This module provides functions for sending database memory-related notifications,
|
|
6
|
+
* including knowledge storage and retrieval operations.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.dbmemoryNotifications = exports.GetMemoryResultNotify = exports.GetMemoryRequestNotify = exports.AddMemoryResultNotify = exports.AddMemoryRequestNotify = void 0;
|
|
10
|
+
const utils_1 = require("./utils");
|
|
11
|
+
/**
|
|
12
|
+
* Sends a request to add knowledge to memory
|
|
13
|
+
*
|
|
14
|
+
* @param key - The memory key
|
|
15
|
+
* @param value - The memory value
|
|
16
|
+
* @param toolUseId - Optional custom toolUseId, will be generated if not provided
|
|
17
|
+
*
|
|
18
|
+
* Requirements: 6.1 - WHEN I call `codebolt.notify.dbmemory.AddMemoryRequestNotify()` THEN the system SHALL send an AddMemoryRequestNotification via WebSocket
|
|
19
|
+
*/
|
|
20
|
+
function AddMemoryRequestNotify(key, value, toolUseId) {
|
|
21
|
+
// Validate required fields
|
|
22
|
+
if (!(0, utils_1.validateRequiredFields)({ key }, ['key'], 'dbmemory.AddMemoryRequestNotify')) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
// Validate that value is provided (can be any type including null, but not undefined)
|
|
26
|
+
if (value === undefined) {
|
|
27
|
+
console.error('[NotificationFunctions] Value is required for dbmemory.AddMemoryRequestNotify');
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
// Create the notification
|
|
31
|
+
const notification = {
|
|
32
|
+
toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
|
|
33
|
+
type: "dbmemorynotify",
|
|
34
|
+
action: "addKnowledgeRequest",
|
|
35
|
+
data: {
|
|
36
|
+
key: key,
|
|
37
|
+
value: value
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
// Send the notification
|
|
41
|
+
(0, utils_1.sendNotification)(notification, 'dbmemory.AddMemoryRequestNotify');
|
|
42
|
+
}
|
|
43
|
+
exports.AddMemoryRequestNotify = AddMemoryRequestNotify;
|
|
44
|
+
/**
|
|
45
|
+
* Sends a result response for an add memory operation
|
|
46
|
+
*
|
|
47
|
+
* @param content - The response content (string or any object)
|
|
48
|
+
* @param isError - Whether this is an error response (default: false)
|
|
49
|
+
* @param toolUseId - Optional custom toolUseId, will be generated if not provided
|
|
50
|
+
*
|
|
51
|
+
* Requirements: 6.2 - WHEN I call `codebolt.notify.dbmemory.AddMemoryResultNotify()` THEN the system SHALL send an AddMemoryResultNotification via WebSocket
|
|
52
|
+
*/
|
|
53
|
+
function AddMemoryResultNotify(content, isError = false, toolUseId) {
|
|
54
|
+
// Validate content is provided
|
|
55
|
+
if (content === null || content === undefined) {
|
|
56
|
+
console.error('[NotificationFunctions] Content is required for dbmemory.AddMemoryResultNotify');
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
// Create the notification
|
|
60
|
+
const notification = {
|
|
61
|
+
toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
|
|
62
|
+
type: "dbmemorynotify",
|
|
63
|
+
action: "addKnowledgeResult",
|
|
64
|
+
content: content,
|
|
65
|
+
isError: isError
|
|
66
|
+
};
|
|
67
|
+
// Send the notification
|
|
68
|
+
(0, utils_1.sendNotification)(notification, 'dbmemory.AddMemoryResultNotify');
|
|
69
|
+
}
|
|
70
|
+
exports.AddMemoryResultNotify = AddMemoryResultNotify;
|
|
71
|
+
/**
|
|
72
|
+
* Sends a request to get knowledge from memory
|
|
73
|
+
*
|
|
74
|
+
* @param key - The memory key to retrieve
|
|
75
|
+
* @param toolUseId - Optional custom toolUseId, will be generated if not provided
|
|
76
|
+
*
|
|
77
|
+
* Requirements: 6.3 - WHEN I call `codebolt.notify.dbmemory.GetMemoryRequestNotify()` THEN the system SHALL send a GetMemoryRequestNotification via WebSocket
|
|
78
|
+
*/
|
|
79
|
+
function GetMemoryRequestNotify(key, toolUseId) {
|
|
80
|
+
// Validate required fields
|
|
81
|
+
if (!(0, utils_1.validateRequiredFields)({ key }, ['key'], 'dbmemory.GetMemoryRequestNotify')) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
// Create the notification
|
|
85
|
+
const notification = {
|
|
86
|
+
toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
|
|
87
|
+
type: "dbmemorynotify",
|
|
88
|
+
action: "getKnowledgeRequest",
|
|
89
|
+
data: {
|
|
90
|
+
key: key
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
// Send the notification
|
|
94
|
+
(0, utils_1.sendNotification)(notification, 'dbmemory.GetMemoryRequestNotify');
|
|
95
|
+
}
|
|
96
|
+
exports.GetMemoryRequestNotify = GetMemoryRequestNotify;
|
|
97
|
+
/**
|
|
98
|
+
* Sends a result response for a get memory operation
|
|
99
|
+
*
|
|
100
|
+
* @param content - The response content (string or any object)
|
|
101
|
+
* @param isError - Whether this is an error response (default: false)
|
|
102
|
+
* @param toolUseId - Optional custom toolUseId, will be generated if not provided
|
|
103
|
+
*
|
|
104
|
+
* Requirements: 6.4 - WHEN I call `codebolt.notify.dbmemory.GetMemoryResultNotify()` THEN the system SHALL send a GetMemoryResultNotification via WebSocket
|
|
105
|
+
*/
|
|
106
|
+
function GetMemoryResultNotify(content, isError = false, toolUseId) {
|
|
107
|
+
// Validate content is provided
|
|
108
|
+
if (content === null || content === undefined) {
|
|
109
|
+
console.error('[NotificationFunctions] Content is required for dbmemory.GetMemoryResultNotify');
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
// Create the notification
|
|
113
|
+
const notification = {
|
|
114
|
+
toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
|
|
115
|
+
type: "dbmemorynotify",
|
|
116
|
+
action: "getKnowledgeResult",
|
|
117
|
+
content: content,
|
|
118
|
+
isError: isError
|
|
119
|
+
};
|
|
120
|
+
// Send the notification
|
|
121
|
+
(0, utils_1.sendNotification)(notification, 'dbmemory.GetMemoryResultNotify');
|
|
122
|
+
}
|
|
123
|
+
exports.GetMemoryResultNotify = GetMemoryResultNotify;
|
|
124
|
+
/**
|
|
125
|
+
* Database memory notification functions object
|
|
126
|
+
*/
|
|
127
|
+
exports.dbmemoryNotifications = {
|
|
128
|
+
AddMemoryRequestNotify,
|
|
129
|
+
AddMemoryResultNotify,
|
|
130
|
+
GetMemoryRequestNotify,
|
|
131
|
+
GetMemoryResultNotify
|
|
132
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File System Notification Functions
|
|
3
|
+
*
|
|
4
|
+
* This module provides functions for sending file system-related notifications,
|
|
5
|
+
* including file and folder operations like create, read, edit, delete, etc.
|
|
6
|
+
*/
|
|
7
|
+
import { FsNotifications } from '../types/notificationFunctions/fs';
|
|
8
|
+
/**
|
|
9
|
+
* Sends a request to create a file
|
|
10
|
+
* Requirements: 7.1
|
|
11
|
+
*/
|
|
12
|
+
export declare function FileCreateRequestNotify(fileName: string, source: string, filePath: string, toolUseId?: string): void;
|
|
13
|
+
/**
|
|
14
|
+
* Sends a response to a file creation request
|
|
15
|
+
* Requirements: 7.2
|
|
16
|
+
*/
|
|
17
|
+
export declare function FileCreateResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
18
|
+
/**
|
|
19
|
+
* Sends a request to create a folder
|
|
20
|
+
* Requirements: 7.3
|
|
21
|
+
*/
|
|
22
|
+
export declare function FolderCreateRequestNotify(folderName: string, folderPath: string, toolUseId?: string): void;
|
|
23
|
+
/**
|
|
24
|
+
* Sends a response to a folder creation request
|
|
25
|
+
* Requirements: 7.4
|
|
26
|
+
*/
|
|
27
|
+
export declare function FolderCreateResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
28
|
+
/**
|
|
29
|
+
* Sends a request to read a file
|
|
30
|
+
* Requirements: 7.4
|
|
31
|
+
*/
|
|
32
|
+
export declare function FileReadRequestNotify(filePath: string, startLine?: string, endLine?: string, toolUseId?: string): void;
|
|
33
|
+
/**
|
|
34
|
+
* Sends a response to a file read request
|
|
35
|
+
* Requirements: 7.4
|
|
36
|
+
*/
|
|
37
|
+
export declare function FileReadResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
38
|
+
/**
|
|
39
|
+
* Sends a request to edit a file
|
|
40
|
+
* Requirements: 7.5
|
|
41
|
+
*/
|
|
42
|
+
export declare function FileEditRequestNotify(fileName: string, filePath: string, newContent: string, toolUseId?: string): void;
|
|
43
|
+
/**
|
|
44
|
+
* Sends a response to a file edit request
|
|
45
|
+
* Requirements: 7.5
|
|
46
|
+
*/
|
|
47
|
+
export declare function FileEditResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
48
|
+
/**
|
|
49
|
+
* Sends a request to delete a file
|
|
50
|
+
* Requirements: 7.6
|
|
51
|
+
*/
|
|
52
|
+
export declare function FileDeleteRequestNotify(fileName: string, filePath: string, toolUseId?: string): void;
|
|
53
|
+
/**
|
|
54
|
+
* Sends a response to a file delete request
|
|
55
|
+
* Requirements: 7.6
|
|
56
|
+
*/
|
|
57
|
+
export declare function FileDeleteResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
58
|
+
/**
|
|
59
|
+
* Sends a request to delete a folder
|
|
60
|
+
* Requirements: 7.6
|
|
61
|
+
*/
|
|
62
|
+
export declare function FolderDeleteRequestNotify(folderName: string, folderPath: string, toolUseId?: string): void;
|
|
63
|
+
/**
|
|
64
|
+
* Sends a response to a folder delete request
|
|
65
|
+
* Requirements: 7.6
|
|
66
|
+
*/
|
|
67
|
+
export declare function FolderDeleteResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void; /**
|
|
68
|
+
*
|
|
69
|
+
Sends a request to list directory contents
|
|
70
|
+
* Requirements: 7.7
|
|
71
|
+
*/
|
|
72
|
+
export declare function ListDirectoryRequestNotify(dirPath: string, toolUseId?: string): void;
|
|
73
|
+
/**
|
|
74
|
+
* Sends a response to a directory listing request
|
|
75
|
+
* Requirements: 7.7
|
|
76
|
+
*/
|
|
77
|
+
export declare function ListDirectoryResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
78
|
+
/**
|
|
79
|
+
* Sends a request to write to a file
|
|
80
|
+
* Requirements: 7.8
|
|
81
|
+
*/
|
|
82
|
+
export declare function WriteToFileRequestNotify(filePath: string, text: string, toolUseId?: string): void;
|
|
83
|
+
/**
|
|
84
|
+
* Sends a response to a write to file request
|
|
85
|
+
* Requirements: 7.8
|
|
86
|
+
*/
|
|
87
|
+
export declare function WriteToFileResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
88
|
+
/**
|
|
89
|
+
* Sends a request to append to a file
|
|
90
|
+
* Requirements: 7.9
|
|
91
|
+
*/
|
|
92
|
+
export declare function AppendToFileRequestNotify(filePath: string, text: string, toolUseId?: string): void;
|
|
93
|
+
/**
|
|
94
|
+
* Sends a response to an append to file request
|
|
95
|
+
* Requirements: 7.9
|
|
96
|
+
*/
|
|
97
|
+
export declare function AppendToFileResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void; /**
|
|
98
|
+
|
|
99
|
+
* Sends a request to copy a file
|
|
100
|
+
* Requirements: 7.10
|
|
101
|
+
*/
|
|
102
|
+
export declare function CopyFileRequestNotify(sourceFile: string, destinationFile: string, toolUseId?: string): void;
|
|
103
|
+
/**
|
|
104
|
+
* Sends a response to a file copy request
|
|
105
|
+
* Requirements: 7.10
|
|
106
|
+
*/
|
|
107
|
+
export declare function CopyFileResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
108
|
+
/**
|
|
109
|
+
* Sends a request to move a file
|
|
110
|
+
* Requirements: 7.11
|
|
111
|
+
*/
|
|
112
|
+
export declare function MoveFileRequestNotify(sourceFile: string, destinationFile: string, toolUseId?: string): void;
|
|
113
|
+
/**
|
|
114
|
+
* Sends a response to a file move request
|
|
115
|
+
* Requirements: 7.11
|
|
116
|
+
*/
|
|
117
|
+
export declare function MoveFileResponseNotify(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
118
|
+
/**
|
|
119
|
+
* File system notification functions object
|
|
120
|
+
*/
|
|
121
|
+
export declare const fsNotifications: FsNotifications;
|
|
122
|
+
/**
|
|
123
|
+
* Default export
|
|
124
|
+
*/
|
|
125
|
+
export default fsNotifications;
|