@codebolt/codeboltjs 2.0.13 → 2.0.16
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/messageManager.d.ts +0 -1
- package/dist/core/messageManager.js +4 -2
- package/dist/core/websocket.js +27 -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 +3 -1
|
@@ -0,0 +1,521 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Git Notification Functions
|
|
4
|
+
*
|
|
5
|
+
* This module provides functions for sending git-related notifications,
|
|
6
|
+
* including version control operations.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.gitNotifications = exports.GitCloneResponseNotify = exports.GitCloneRequestNotify = exports.GitRemoteAddResponseNotify = exports.GitRemoteAddRequestNotify = exports.GitDiffResponseNotify = exports.GitDiffRequestNotify = exports.GitLogsResponseNotify = exports.GitLogsRequestNotify = exports.GitBranchResponseNotify = exports.GitBranchRequestNotify = exports.GitCheckoutResponseNotify = exports.GitCheckoutRequestNotify = exports.GitCommitResponseNotify = exports.GitCommitRequestNotify = exports.GitAddResponseNotify = exports.GitAddRequestNotify = exports.GitStatusResponseNotify = exports.GitStatusRequestNotify = exports.GitPushResponseNotify = exports.GitPushRequestNotify = exports.GitPullResponseNotify = exports.GitPullRequestNotify = exports.GitInitResponseNotify = exports.GitInitRequestNotify = void 0;
|
|
10
|
+
const utils_1 = require("./utils");
|
|
11
|
+
// ===== GIT INIT FUNCTIONS =====
|
|
12
|
+
/**
|
|
13
|
+
* Sends a git init request notification
|
|
14
|
+
* @param path - Optional path where to initialize the git repository
|
|
15
|
+
* @param toolUseId - Optional custom toolUseId, will be generated if not provided
|
|
16
|
+
*/
|
|
17
|
+
function GitInitRequestNotify(path, toolUseId) {
|
|
18
|
+
const notification = {
|
|
19
|
+
toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
|
|
20
|
+
type: "gitnotify",
|
|
21
|
+
action: "initRequest",
|
|
22
|
+
data: {
|
|
23
|
+
path: path
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
(0, utils_1.sendNotification)(notification, 'git-init');
|
|
27
|
+
}
|
|
28
|
+
exports.GitInitRequestNotify = GitInitRequestNotify;
|
|
29
|
+
/**
|
|
30
|
+
* Sends a git init response notification
|
|
31
|
+
* @param content - The response content (success message or error details)
|
|
32
|
+
* @param isError - Whether this is an error response
|
|
33
|
+
* @param toolUseId - The toolUseId from the original request
|
|
34
|
+
*/
|
|
35
|
+
function GitInitResponseNotify(content, isError = false, toolUseId) {
|
|
36
|
+
if (!toolUseId) {
|
|
37
|
+
console.error('[GitNotifications] toolUseId is required for response notifications');
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const notification = {
|
|
41
|
+
toolUseId,
|
|
42
|
+
type: "gitnotify",
|
|
43
|
+
action: "initResult",
|
|
44
|
+
content,
|
|
45
|
+
isError
|
|
46
|
+
};
|
|
47
|
+
(0, utils_1.sendNotification)(notification, 'git-init-response');
|
|
48
|
+
}
|
|
49
|
+
exports.GitInitResponseNotify = GitInitResponseNotify;
|
|
50
|
+
// ===== GIT PULL FUNCTIONS =====
|
|
51
|
+
/**
|
|
52
|
+
* Sends a git pull request notification
|
|
53
|
+
* @param path - Optional path where to perform the git pull
|
|
54
|
+
* @param toolUseId - Optional custom toolUseId, will be generated if not provided
|
|
55
|
+
*/
|
|
56
|
+
function GitPullRequestNotify(path, toolUseId) {
|
|
57
|
+
const notification = {
|
|
58
|
+
toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
|
|
59
|
+
type: "gitnotify",
|
|
60
|
+
action: "pullRequest",
|
|
61
|
+
data: {
|
|
62
|
+
path: path
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
(0, utils_1.sendNotification)(notification, 'git-pull');
|
|
66
|
+
}
|
|
67
|
+
exports.GitPullRequestNotify = GitPullRequestNotify;
|
|
68
|
+
/**
|
|
69
|
+
* Sends a git pull response notification
|
|
70
|
+
* @param content - The response content (success message or error details)
|
|
71
|
+
* @param isError - Whether this is an error response
|
|
72
|
+
* @param toolUseId - The toolUseId from the original request
|
|
73
|
+
*/
|
|
74
|
+
function GitPullResponseNotify(content, isError = false, toolUseId) {
|
|
75
|
+
if (!toolUseId) {
|
|
76
|
+
console.error('[GitNotifications] toolUseId is required for response notifications');
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const notification = {
|
|
80
|
+
toolUseId,
|
|
81
|
+
type: "gitnotify",
|
|
82
|
+
action: "pullResult",
|
|
83
|
+
content,
|
|
84
|
+
isError
|
|
85
|
+
};
|
|
86
|
+
(0, utils_1.sendNotification)(notification, 'git-pull-response');
|
|
87
|
+
}
|
|
88
|
+
exports.GitPullResponseNotify = GitPullResponseNotify;
|
|
89
|
+
// ===== GIT PUSH FUNCTIONS =====
|
|
90
|
+
/**
|
|
91
|
+
* Sends a git push request notification
|
|
92
|
+
* @param path - Optional path where to perform the git push
|
|
93
|
+
* @param toolUseId - Optional custom toolUseId, will be generated if not provided
|
|
94
|
+
*/
|
|
95
|
+
function GitPushRequestNotify(path, toolUseId) {
|
|
96
|
+
const notification = {
|
|
97
|
+
toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
|
|
98
|
+
type: "gitnotify",
|
|
99
|
+
action: "pushRequest",
|
|
100
|
+
data: {
|
|
101
|
+
path: path
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
(0, utils_1.sendNotification)(notification, 'git-push');
|
|
105
|
+
}
|
|
106
|
+
exports.GitPushRequestNotify = GitPushRequestNotify;
|
|
107
|
+
/**
|
|
108
|
+
* Sends a git push response notification
|
|
109
|
+
* @param content - The response content (success message or error details)
|
|
110
|
+
* @param isError - Whether this is an error response
|
|
111
|
+
* @param toolUseId - The toolUseId from the original request
|
|
112
|
+
*/
|
|
113
|
+
function GitPushResponseNotify(content, isError = false, toolUseId) {
|
|
114
|
+
if (!toolUseId) {
|
|
115
|
+
console.error('[GitNotifications] toolUseId is required for response notifications');
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
const notification = {
|
|
119
|
+
toolUseId,
|
|
120
|
+
type: "gitnotify",
|
|
121
|
+
action: "pushResult",
|
|
122
|
+
content,
|
|
123
|
+
isError
|
|
124
|
+
};
|
|
125
|
+
(0, utils_1.sendNotification)(notification, 'git-push-response');
|
|
126
|
+
}
|
|
127
|
+
exports.GitPushResponseNotify = GitPushResponseNotify;
|
|
128
|
+
// ===== GIT STATUS FUNCTIONS =====
|
|
129
|
+
/**
|
|
130
|
+
* Sends a git status request notification
|
|
131
|
+
* @param path - Optional path where to check git status
|
|
132
|
+
* @param toolUseId - Optional custom toolUseId, will be generated if not provided
|
|
133
|
+
*/
|
|
134
|
+
function GitStatusRequestNotify(path, toolUseId) {
|
|
135
|
+
const notification = {
|
|
136
|
+
toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
|
|
137
|
+
type: "gitnotify",
|
|
138
|
+
action: "statusRequest",
|
|
139
|
+
data: {
|
|
140
|
+
path: path
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
(0, utils_1.sendNotification)(notification, 'git-status');
|
|
144
|
+
}
|
|
145
|
+
exports.GitStatusRequestNotify = GitStatusRequestNotify;
|
|
146
|
+
/**
|
|
147
|
+
* Sends a git status response notification
|
|
148
|
+
* @param content - The response content (status information or error details)
|
|
149
|
+
* @param isError - Whether this is an error response
|
|
150
|
+
* @param toolUseId - The toolUseId from the original request
|
|
151
|
+
*/
|
|
152
|
+
function GitStatusResponseNotify(content, isError = false, toolUseId) {
|
|
153
|
+
if (!toolUseId) {
|
|
154
|
+
console.error('[GitNotifications] toolUseId is required for response notifications');
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const notification = {
|
|
158
|
+
toolUseId,
|
|
159
|
+
type: "gitnotify",
|
|
160
|
+
action: "statusResult",
|
|
161
|
+
content,
|
|
162
|
+
isError
|
|
163
|
+
};
|
|
164
|
+
(0, utils_1.sendNotification)(notification, 'git-status-response');
|
|
165
|
+
}
|
|
166
|
+
exports.GitStatusResponseNotify = GitStatusResponseNotify;
|
|
167
|
+
// ===== GIT ADD FUNCTIONS =====
|
|
168
|
+
/**
|
|
169
|
+
* Sends a git add request notification
|
|
170
|
+
* @param path - Optional path where to perform git add
|
|
171
|
+
* @param files - Optional array of files to add
|
|
172
|
+
* @param toolUseId - Optional custom toolUseId, will be generated if not provided
|
|
173
|
+
*/
|
|
174
|
+
function GitAddRequestNotify(path, files, toolUseId) {
|
|
175
|
+
const notification = {
|
|
176
|
+
toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
|
|
177
|
+
type: "gitnotify",
|
|
178
|
+
action: "addRequest",
|
|
179
|
+
data: {
|
|
180
|
+
path: path,
|
|
181
|
+
files: files
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
(0, utils_1.sendNotification)(notification, 'git-add');
|
|
185
|
+
}
|
|
186
|
+
exports.GitAddRequestNotify = GitAddRequestNotify;
|
|
187
|
+
/**
|
|
188
|
+
* Sends a git add response notification
|
|
189
|
+
* @param content - The response content (success message or error details)
|
|
190
|
+
* @param isError - Whether this is an error response
|
|
191
|
+
* @param toolUseId - The toolUseId from the original request
|
|
192
|
+
*/
|
|
193
|
+
function GitAddResponseNotify(content, isError = false, toolUseId) {
|
|
194
|
+
if (!toolUseId) {
|
|
195
|
+
console.error('[GitNotifications] toolUseId is required for response notifications');
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
const notification = {
|
|
199
|
+
toolUseId,
|
|
200
|
+
type: "gitnotify",
|
|
201
|
+
action: "addResult",
|
|
202
|
+
content,
|
|
203
|
+
isError
|
|
204
|
+
};
|
|
205
|
+
(0, utils_1.sendNotification)(notification, 'git-add-response');
|
|
206
|
+
}
|
|
207
|
+
exports.GitAddResponseNotify = GitAddResponseNotify;
|
|
208
|
+
// ===== GIT COMMIT FUNCTIONS =====
|
|
209
|
+
/**
|
|
210
|
+
* Sends a git commit request notification
|
|
211
|
+
* @param path - Optional path where to perform git commit
|
|
212
|
+
* @param message - Optional commit message
|
|
213
|
+
* @param toolUseId - Optional custom toolUseId, will be generated if not provided
|
|
214
|
+
*/
|
|
215
|
+
function GitCommitRequestNotify(path, message, toolUseId) {
|
|
216
|
+
const notification = {
|
|
217
|
+
toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
|
|
218
|
+
type: "gitnotify",
|
|
219
|
+
action: "commitRequest",
|
|
220
|
+
data: {
|
|
221
|
+
path: path,
|
|
222
|
+
message: message
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
(0, utils_1.sendNotification)(notification, 'git-commit');
|
|
226
|
+
}
|
|
227
|
+
exports.GitCommitRequestNotify = GitCommitRequestNotify;
|
|
228
|
+
/**
|
|
229
|
+
* Sends a git commit response notification
|
|
230
|
+
* @param content - The response content (commit information or error details)
|
|
231
|
+
* @param isError - Whether this is an error response
|
|
232
|
+
* @param toolUseId - The toolUseId from the original request
|
|
233
|
+
*/
|
|
234
|
+
function GitCommitResponseNotify(content, isError = false, toolUseId) {
|
|
235
|
+
if (!toolUseId) {
|
|
236
|
+
console.error('[GitNotifications] toolUseId is required for response notifications');
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
const notification = {
|
|
240
|
+
toolUseId,
|
|
241
|
+
type: "gitnotify",
|
|
242
|
+
action: "commitResult",
|
|
243
|
+
content,
|
|
244
|
+
isError
|
|
245
|
+
};
|
|
246
|
+
(0, utils_1.sendNotification)(notification, 'git-commit-response');
|
|
247
|
+
}
|
|
248
|
+
exports.GitCommitResponseNotify = GitCommitResponseNotify;
|
|
249
|
+
// ===== GIT CHECKOUT FUNCTIONS =====
|
|
250
|
+
/**
|
|
251
|
+
* Sends a git checkout request notification
|
|
252
|
+
* @param path - Optional path where to perform git checkout
|
|
253
|
+
* @param branchName - Optional branch name to checkout
|
|
254
|
+
* @param toolUseId - Optional custom toolUseId, will be generated if not provided
|
|
255
|
+
*/
|
|
256
|
+
function GitCheckoutRequestNotify(path, branchName, toolUseId) {
|
|
257
|
+
const notification = {
|
|
258
|
+
toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
|
|
259
|
+
type: "gitnotify",
|
|
260
|
+
action: "checkoutRequest",
|
|
261
|
+
data: {
|
|
262
|
+
path: path,
|
|
263
|
+
branchName: branchName
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
(0, utils_1.sendNotification)(notification, 'git-checkout');
|
|
267
|
+
}
|
|
268
|
+
exports.GitCheckoutRequestNotify = GitCheckoutRequestNotify;
|
|
269
|
+
/**
|
|
270
|
+
* Sends a git checkout response notification
|
|
271
|
+
* @param content - The response content (checkout information or error details)
|
|
272
|
+
* @param isError - Whether this is an error response
|
|
273
|
+
* @param toolUseId - The toolUseId from the original request
|
|
274
|
+
*/
|
|
275
|
+
function GitCheckoutResponseNotify(content, isError = false, toolUseId) {
|
|
276
|
+
if (!toolUseId) {
|
|
277
|
+
console.error('[GitNotifications] toolUseId is required for response notifications');
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
const notification = {
|
|
281
|
+
toolUseId,
|
|
282
|
+
type: "gitnotify",
|
|
283
|
+
action: "checkoutResult",
|
|
284
|
+
content,
|
|
285
|
+
isError
|
|
286
|
+
};
|
|
287
|
+
(0, utils_1.sendNotification)(notification, 'git-checkout-response');
|
|
288
|
+
}
|
|
289
|
+
exports.GitCheckoutResponseNotify = GitCheckoutResponseNotify;
|
|
290
|
+
// ===== GIT BRANCH FUNCTIONS =====
|
|
291
|
+
/**
|
|
292
|
+
* Sends a git branch request notification
|
|
293
|
+
* @param path - Optional path where to perform git branch operation
|
|
294
|
+
* @param branchName - Optional branch name to create or list
|
|
295
|
+
* @param toolUseId - Optional custom toolUseId, will be generated if not provided
|
|
296
|
+
*/
|
|
297
|
+
function GitBranchRequestNotify(path, branchName, toolUseId) {
|
|
298
|
+
const notification = {
|
|
299
|
+
toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
|
|
300
|
+
type: "gitnotify",
|
|
301
|
+
action: "branchRequest",
|
|
302
|
+
data: {
|
|
303
|
+
path: path,
|
|
304
|
+
branchName: branchName
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
(0, utils_1.sendNotification)(notification, 'git-branch');
|
|
308
|
+
}
|
|
309
|
+
exports.GitBranchRequestNotify = GitBranchRequestNotify;
|
|
310
|
+
/**
|
|
311
|
+
* Sends a git branch response notification
|
|
312
|
+
* @param content - The response content (branch information or error details)
|
|
313
|
+
* @param isError - Whether this is an error response
|
|
314
|
+
* @param toolUseId - The toolUseId from the original request
|
|
315
|
+
*/
|
|
316
|
+
function GitBranchResponseNotify(content, isError = false, toolUseId) {
|
|
317
|
+
if (!toolUseId) {
|
|
318
|
+
console.error('[GitNotifications] toolUseId is required for response notifications');
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
const notification = {
|
|
322
|
+
toolUseId,
|
|
323
|
+
type: "gitnotify",
|
|
324
|
+
action: "branchResult",
|
|
325
|
+
content,
|
|
326
|
+
isError
|
|
327
|
+
};
|
|
328
|
+
(0, utils_1.sendNotification)(notification, 'git-branch-response');
|
|
329
|
+
}
|
|
330
|
+
exports.GitBranchResponseNotify = GitBranchResponseNotify;
|
|
331
|
+
// ===== GIT LOGS FUNCTIONS =====
|
|
332
|
+
/**
|
|
333
|
+
* Sends a git logs request notification
|
|
334
|
+
* @param path - Optional path where to get git logs
|
|
335
|
+
* @param toolUseId - Optional custom toolUseId, will be generated if not provided
|
|
336
|
+
*/
|
|
337
|
+
function GitLogsRequestNotify(path, toolUseId) {
|
|
338
|
+
const notification = {
|
|
339
|
+
toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
|
|
340
|
+
type: "gitnotify",
|
|
341
|
+
action: "logsRequest",
|
|
342
|
+
data: {
|
|
343
|
+
path: path
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
(0, utils_1.sendNotification)(notification, 'git-logs');
|
|
347
|
+
}
|
|
348
|
+
exports.GitLogsRequestNotify = GitLogsRequestNotify;
|
|
349
|
+
/**
|
|
350
|
+
* Sends a git logs response notification
|
|
351
|
+
* @param content - The response content (log information or error details)
|
|
352
|
+
* @param isError - Whether this is an error response
|
|
353
|
+
* @param toolUseId - The toolUseId from the original request
|
|
354
|
+
*/
|
|
355
|
+
function GitLogsResponseNotify(content, isError = false, toolUseId) {
|
|
356
|
+
if (!toolUseId) {
|
|
357
|
+
console.error('[GitNotifications] toolUseId is required for response notifications');
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
const notification = {
|
|
361
|
+
toolUseId,
|
|
362
|
+
type: "gitnotify",
|
|
363
|
+
action: "logsResult",
|
|
364
|
+
content,
|
|
365
|
+
isError
|
|
366
|
+
};
|
|
367
|
+
(0, utils_1.sendNotification)(notification, 'git-logs-response');
|
|
368
|
+
}
|
|
369
|
+
exports.GitLogsResponseNotify = GitLogsResponseNotify;
|
|
370
|
+
// ===== GIT DIFF FUNCTIONS =====
|
|
371
|
+
/**
|
|
372
|
+
* Sends a git diff request notification
|
|
373
|
+
* @param path - Optional path where to get git diff
|
|
374
|
+
* @param toolUseId - Optional custom toolUseId, will be generated if not provided
|
|
375
|
+
*/
|
|
376
|
+
function GitDiffRequestNotify(path, toolUseId) {
|
|
377
|
+
const notification = {
|
|
378
|
+
toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
|
|
379
|
+
type: "gitnotify",
|
|
380
|
+
action: "diffRequest",
|
|
381
|
+
data: {
|
|
382
|
+
path: path
|
|
383
|
+
}
|
|
384
|
+
};
|
|
385
|
+
(0, utils_1.sendNotification)(notification, 'git-diff');
|
|
386
|
+
}
|
|
387
|
+
exports.GitDiffRequestNotify = GitDiffRequestNotify;
|
|
388
|
+
/**
|
|
389
|
+
* Sends a git diff response notification
|
|
390
|
+
* @param content - The response content (diff information or error details)
|
|
391
|
+
* @param isError - Whether this is an error response
|
|
392
|
+
* @param toolUseId - The toolUseId from the original request
|
|
393
|
+
*/
|
|
394
|
+
function GitDiffResponseNotify(content, isError = false, toolUseId) {
|
|
395
|
+
if (!toolUseId) {
|
|
396
|
+
console.error('[GitNotifications] toolUseId is required for response notifications');
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
const notification = {
|
|
400
|
+
toolUseId,
|
|
401
|
+
type: "gitnotify",
|
|
402
|
+
action: "diffResult",
|
|
403
|
+
content,
|
|
404
|
+
isError
|
|
405
|
+
};
|
|
406
|
+
(0, utils_1.sendNotification)(notification, 'git-diff-response');
|
|
407
|
+
}
|
|
408
|
+
exports.GitDiffResponseNotify = GitDiffResponseNotify;
|
|
409
|
+
// ===== GIT REMOTE ADD FUNCTIONS =====
|
|
410
|
+
/**
|
|
411
|
+
* Sends a git remote add request notification
|
|
412
|
+
* @param remoteName - Name of the remote to add
|
|
413
|
+
* @param remoteUrl - URL of the remote repository
|
|
414
|
+
* @param path - Optional path where to add the remote
|
|
415
|
+
* @param toolUseId - Optional custom toolUseId, will be generated if not provided
|
|
416
|
+
*/
|
|
417
|
+
function GitRemoteAddRequestNotify(remoteName, remoteUrl, path, toolUseId) {
|
|
418
|
+
const notification = {
|
|
419
|
+
toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
|
|
420
|
+
type: "gitnotify",
|
|
421
|
+
action: "remoteAddRequest",
|
|
422
|
+
data: {
|
|
423
|
+
path: path,
|
|
424
|
+
remoteName: remoteName,
|
|
425
|
+
remoteUrl: remoteUrl
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
(0, utils_1.sendNotification)(notification, 'git-remote-add');
|
|
429
|
+
}
|
|
430
|
+
exports.GitRemoteAddRequestNotify = GitRemoteAddRequestNotify;
|
|
431
|
+
/**
|
|
432
|
+
* Sends a git remote add response notification
|
|
433
|
+
* @param content - The response content (success message or error details)
|
|
434
|
+
* @param isError - Whether this is an error response
|
|
435
|
+
* @param toolUseId - The toolUseId from the original request
|
|
436
|
+
*/
|
|
437
|
+
function GitRemoteAddResponseNotify(content, isError = false, toolUseId) {
|
|
438
|
+
if (!toolUseId) {
|
|
439
|
+
console.error('[GitNotifications] toolUseId is required for response notifications');
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
const notification = {
|
|
443
|
+
toolUseId,
|
|
444
|
+
type: "gitnotify",
|
|
445
|
+
action: "remoteAddResult",
|
|
446
|
+
content,
|
|
447
|
+
isError
|
|
448
|
+
};
|
|
449
|
+
(0, utils_1.sendNotification)(notification, 'git-remote-add-response');
|
|
450
|
+
}
|
|
451
|
+
exports.GitRemoteAddResponseNotify = GitRemoteAddResponseNotify;
|
|
452
|
+
// ===== GIT CLONE FUNCTIONS =====
|
|
453
|
+
/**
|
|
454
|
+
* Sends a git clone request notification
|
|
455
|
+
* @param repoUrl - URL of the repository to clone
|
|
456
|
+
* @param targetPath - Optional target path for the cloned repository
|
|
457
|
+
* @param toolUseId - Optional custom toolUseId, will be generated if not provided
|
|
458
|
+
*/
|
|
459
|
+
function GitCloneRequestNotify(repoUrl, targetPath, toolUseId) {
|
|
460
|
+
const notification = {
|
|
461
|
+
toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
|
|
462
|
+
type: "gitnotify",
|
|
463
|
+
action: "cloneRequest",
|
|
464
|
+
data: {
|
|
465
|
+
repoUrl: repoUrl,
|
|
466
|
+
targetPath: targetPath
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
(0, utils_1.sendNotification)(notification, 'git-clone');
|
|
470
|
+
}
|
|
471
|
+
exports.GitCloneRequestNotify = GitCloneRequestNotify;
|
|
472
|
+
/**
|
|
473
|
+
* Sends a git clone response notification
|
|
474
|
+
* @param content - The response content (clone information or error details)
|
|
475
|
+
* @param isError - Whether this is an error response
|
|
476
|
+
* @param toolUseId - The toolUseId from the original request
|
|
477
|
+
*/
|
|
478
|
+
function GitCloneResponseNotify(content, isError = false, toolUseId) {
|
|
479
|
+
if (!toolUseId) {
|
|
480
|
+
console.error('[GitNotifications] toolUseId is required for response notifications');
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
483
|
+
const notification = {
|
|
484
|
+
toolUseId,
|
|
485
|
+
type: "gitnotify",
|
|
486
|
+
action: "cloneResult",
|
|
487
|
+
content,
|
|
488
|
+
isError
|
|
489
|
+
};
|
|
490
|
+
(0, utils_1.sendNotification)(notification, 'git-clone-response');
|
|
491
|
+
}
|
|
492
|
+
exports.GitCloneResponseNotify = GitCloneResponseNotify;
|
|
493
|
+
/**
|
|
494
|
+
* Git notification functions object
|
|
495
|
+
*/
|
|
496
|
+
exports.gitNotifications = {
|
|
497
|
+
GitInitRequestNotify,
|
|
498
|
+
GitInitResponseNotify,
|
|
499
|
+
GitPullRequestNotify,
|
|
500
|
+
GitPullResponseNotify,
|
|
501
|
+
GitPushRequestNotify,
|
|
502
|
+
GitPushResponseNotify,
|
|
503
|
+
GitStatusRequestNotify,
|
|
504
|
+
GitStatusResponseNotify,
|
|
505
|
+
GitAddRequestNotify,
|
|
506
|
+
GitAddResponseNotify,
|
|
507
|
+
GitCommitRequestNotify,
|
|
508
|
+
GitCommitResponseNotify,
|
|
509
|
+
GitCheckoutRequestNotify,
|
|
510
|
+
GitCheckoutResponseNotify,
|
|
511
|
+
GitBranchRequestNotify,
|
|
512
|
+
GitBranchResponseNotify,
|
|
513
|
+
GitLogsRequestNotify,
|
|
514
|
+
GitLogsResponseNotify,
|
|
515
|
+
GitDiffRequestNotify,
|
|
516
|
+
GitDiffResponseNotify,
|
|
517
|
+
GitRemoteAddRequestNotify,
|
|
518
|
+
GitRemoteAddResponseNotify,
|
|
519
|
+
GitCloneRequestNotify,
|
|
520
|
+
GitCloneResponseNotify
|
|
521
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* History Notification Functions
|
|
3
|
+
*
|
|
4
|
+
* This module provides functions for sending history-related notifications,
|
|
5
|
+
* including conversation summarization operations.
|
|
6
|
+
*/
|
|
7
|
+
import { SummarizePreviousConversationRequestNotification, SummarizeCurentMessageRequestNotification } from '../types/notifications/history';
|
|
8
|
+
import { HistoryNotifications } from '../types/notificationFunctions/history';
|
|
9
|
+
/**
|
|
10
|
+
* Sends a summarize previous conversation request notification
|
|
11
|
+
* @param data - Optional data object (currently empty but may be extended)
|
|
12
|
+
* @param toolUseId - Optional custom toolUseId, will be generated if not provided
|
|
13
|
+
*/
|
|
14
|
+
export declare function summarizePreviousConversation(data?: SummarizePreviousConversationRequestNotification['data'], toolUseId?: string): void;
|
|
15
|
+
/**
|
|
16
|
+
* Sends a summarize previous conversation result notification
|
|
17
|
+
* @param content - The summarization result or error details
|
|
18
|
+
* @param isError - Whether this is an error response
|
|
19
|
+
* @param toolUseId - The toolUseId from the original request
|
|
20
|
+
*/
|
|
21
|
+
export declare function sendSummarizePreviousResult(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
22
|
+
/**
|
|
23
|
+
* Sends a summarize current message request notification
|
|
24
|
+
* @param data - Summarization data containing messages and depth
|
|
25
|
+
* @param toolUseId - Optional custom toolUseId, will be generated if not provided
|
|
26
|
+
*/
|
|
27
|
+
export declare function summarizeCurrentMessage(data: SummarizeCurentMessageRequestNotification['data'], toolUseId?: string): void;
|
|
28
|
+
/**
|
|
29
|
+
* Sends a summarize current message result notification
|
|
30
|
+
* @param content - The summarization result or error details
|
|
31
|
+
* @param isError - Whether this is an error response
|
|
32
|
+
* @param toolUseId - The toolUseId from the original request
|
|
33
|
+
*/
|
|
34
|
+
export declare function sendSummarizeCurrentResult(content: string | any, isError?: boolean, toolUseId?: string): void;
|
|
35
|
+
/**
|
|
36
|
+
* History notification functions object
|
|
37
|
+
*/
|
|
38
|
+
export declare const historyNotifications: HistoryNotifications;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* History Notification Functions
|
|
4
|
+
*
|
|
5
|
+
* This module provides functions for sending history-related notifications,
|
|
6
|
+
* including conversation summarization operations.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.historyNotifications = exports.sendSummarizeCurrentResult = exports.summarizeCurrentMessage = exports.sendSummarizePreviousResult = exports.summarizePreviousConversation = void 0;
|
|
10
|
+
const utils_1 = require("./utils");
|
|
11
|
+
// ===== SUMMARIZE PREVIOUS CONVERSATION FUNCTIONS =====
|
|
12
|
+
/**
|
|
13
|
+
* Sends a summarize previous conversation request notification
|
|
14
|
+
* @param data - Optional data object (currently empty but may be extended)
|
|
15
|
+
* @param toolUseId - Optional custom toolUseId, will be generated if not provided
|
|
16
|
+
*/
|
|
17
|
+
function summarizePreviousConversation(data = {}, toolUseId) {
|
|
18
|
+
const notification = {
|
|
19
|
+
toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
|
|
20
|
+
type: "historynotify",
|
|
21
|
+
action: "summarizeAllRequest",
|
|
22
|
+
data
|
|
23
|
+
};
|
|
24
|
+
(0, utils_1.sendNotification)(notification, 'history-summarize-previous');
|
|
25
|
+
}
|
|
26
|
+
exports.summarizePreviousConversation = summarizePreviousConversation;
|
|
27
|
+
/**
|
|
28
|
+
* Sends a summarize previous conversation result notification
|
|
29
|
+
* @param content - The summarization result or error details
|
|
30
|
+
* @param isError - Whether this is an error response
|
|
31
|
+
* @param toolUseId - The toolUseId from the original request
|
|
32
|
+
*/
|
|
33
|
+
function sendSummarizePreviousResult(content, isError = false, toolUseId) {
|
|
34
|
+
if (!toolUseId) {
|
|
35
|
+
console.error('[HistoryNotifications] toolUseId is required for response notifications');
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const notification = {
|
|
39
|
+
toolUseId,
|
|
40
|
+
type: "historynotify",
|
|
41
|
+
action: "summarizeAllResult",
|
|
42
|
+
content,
|
|
43
|
+
isError
|
|
44
|
+
};
|
|
45
|
+
(0, utils_1.sendNotification)(notification, 'history-summarize-previous-result');
|
|
46
|
+
}
|
|
47
|
+
exports.sendSummarizePreviousResult = sendSummarizePreviousResult;
|
|
48
|
+
// ===== SUMMARIZE CURRENT MESSAGE FUNCTIONS =====
|
|
49
|
+
/**
|
|
50
|
+
* Sends a summarize current message request notification
|
|
51
|
+
* @param data - Summarization data containing messages and depth
|
|
52
|
+
* @param toolUseId - Optional custom toolUseId, will be generated if not provided
|
|
53
|
+
*/
|
|
54
|
+
function summarizeCurrentMessage(data, toolUseId) {
|
|
55
|
+
// Validate required fields
|
|
56
|
+
if (!(0, utils_1.validateRequiredFields)(data, ['messages', 'depth'], 'history-summarize-current')) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const notification = {
|
|
60
|
+
toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
|
|
61
|
+
type: "historynotify",
|
|
62
|
+
action: "summarizeRequest",
|
|
63
|
+
data
|
|
64
|
+
};
|
|
65
|
+
(0, utils_1.sendNotification)(notification, 'history-summarize-current');
|
|
66
|
+
}
|
|
67
|
+
exports.summarizeCurrentMessage = summarizeCurrentMessage;
|
|
68
|
+
/**
|
|
69
|
+
* Sends a summarize current message result notification
|
|
70
|
+
* @param content - The summarization result or error details
|
|
71
|
+
* @param isError - Whether this is an error response
|
|
72
|
+
* @param toolUseId - The toolUseId from the original request
|
|
73
|
+
*/
|
|
74
|
+
function sendSummarizeCurrentResult(content, isError = false, toolUseId) {
|
|
75
|
+
if (!toolUseId) {
|
|
76
|
+
console.error('[HistoryNotifications] toolUseId is required for response notifications');
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const notification = {
|
|
80
|
+
toolUseId,
|
|
81
|
+
type: "historynotify",
|
|
82
|
+
action: "summarizeResult",
|
|
83
|
+
content,
|
|
84
|
+
isError
|
|
85
|
+
};
|
|
86
|
+
(0, utils_1.sendNotification)(notification, 'history-summarize-current-result');
|
|
87
|
+
}
|
|
88
|
+
exports.sendSummarizeCurrentResult = sendSummarizeCurrentResult;
|
|
89
|
+
/**
|
|
90
|
+
* History notification functions object
|
|
91
|
+
*/
|
|
92
|
+
exports.historyNotifications = {
|
|
93
|
+
summarizePreviousConversation,
|
|
94
|
+
sendSummarizePreviousResult,
|
|
95
|
+
summarizeCurrentMessage,
|
|
96
|
+
sendSummarizeCurrentResult
|
|
97
|
+
};
|