@codebolt/codeboltjs 2.2.1 → 2.2.3

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.
Files changed (72) hide show
  1. package/Readme.md +3 -0
  2. package/dist/core/Codebolt.d.ts +212 -165
  3. package/dist/core/Codebolt.js +267 -6
  4. package/dist/core/websocket.js +9 -11
  5. package/dist/index.d.ts +1 -1
  6. package/dist/modules/agent.d.ts +2 -16
  7. package/dist/modules/agent.js +15 -33
  8. package/dist/modules/browser.d.ts +1 -1
  9. package/dist/modules/browser.js +52 -51
  10. package/dist/modules/chat.d.ts +2 -2
  11. package/dist/modules/chat.js +20 -18
  12. package/dist/modules/codeutils.d.ts +1 -9
  13. package/dist/modules/codeutils.js +13 -111
  14. package/dist/modules/dbmemory.d.ts +3 -3
  15. package/dist/modules/dbmemory.js +8 -7
  16. package/dist/modules/debug.d.ts +1 -1
  17. package/dist/modules/fs.d.ts +59 -28
  18. package/dist/modules/fs.js +86 -45
  19. package/dist/modules/git.d.ts +1 -1
  20. package/dist/modules/git.js +31 -30
  21. package/dist/modules/history.d.ts +1 -1
  22. package/dist/modules/history.js +7 -6
  23. package/dist/modules/llm.d.ts +13 -20
  24. package/dist/modules/llm.js +16 -15
  25. package/dist/modules/mcp.d.ts +4 -4
  26. package/dist/modules/mcp.js +25 -25
  27. package/dist/modules/outputparsers.d.ts +22 -22
  28. package/dist/modules/outputparsers.js +7 -5
  29. package/dist/modules/project.d.ts +1 -1
  30. package/dist/modules/project.js +15 -13
  31. package/dist/modules/state.d.ts +1 -1
  32. package/dist/modules/state.js +16 -15
  33. package/dist/modules/task.d.ts +136 -92
  34. package/dist/modules/task.js +354 -205
  35. package/dist/modules/terminal.d.ts +1 -1
  36. package/dist/modules/terminal.js +12 -11
  37. package/dist/modules/tokenizer.d.ts +1 -1
  38. package/dist/modules/tokenizer.js +7 -6
  39. package/dist/modules/user-message-manager.d.ts +165 -0
  40. package/dist/modules/user-message-manager.js +308 -0
  41. package/dist/modules/user-message-utilities.d.ts +111 -0
  42. package/dist/modules/user-message-utilities.js +115 -0
  43. package/dist/modules/utils.d.ts +1 -1
  44. package/dist/modules/utils.js +4 -3
  45. package/dist/modules/vectordb.d.ts +1 -1
  46. package/dist/modules/vectordb.js +13 -12
  47. package/dist/notificationfunctions/agent.js +7 -6
  48. package/dist/notificationfunctions/browser.js +9 -8
  49. package/dist/notificationfunctions/chat.js +9 -8
  50. package/dist/notificationfunctions/codeutils.js +9 -8
  51. package/dist/notificationfunctions/crawler.js +9 -8
  52. package/dist/notificationfunctions/dbmemory.js +9 -8
  53. package/dist/notificationfunctions/fs.js +45 -44
  54. package/dist/notificationfunctions/git.d.ts +2 -2
  55. package/dist/notificationfunctions/git.js +111 -51
  56. package/dist/notificationfunctions/history.js +9 -8
  57. package/dist/notificationfunctions/llm.js +9 -8
  58. package/dist/notificationfunctions/mcp.js +17 -16
  59. package/dist/notificationfunctions/search.js +13 -12
  60. package/dist/notificationfunctions/system.js +5 -4
  61. package/dist/notificationfunctions/terminal.js +5 -4
  62. package/dist/notificationfunctions/todo.js +13 -12
  63. package/dist/types/commonTypes.d.ts +4 -0
  64. package/dist/types/index.d.ts +1 -1
  65. package/dist/types/libFunctionTypes.d.ts +918 -29
  66. package/dist/types/libFunctionTypes.js +33 -0
  67. package/dist/types/notificationFunctions/git.d.ts +40 -1
  68. package/dist/types/notificationFunctions/index.d.ts +1 -0
  69. package/dist/types/notificationFunctions/index.js +1 -0
  70. package/package.json +17 -25
  71. package/dist/modules/codeparsers.d.ts +0 -37
  72. package/dist/modules/codeparsers.js +0 -329
@@ -0,0 +1,111 @@
1
+ /**
2
+ * @fileoverview User Message Utilities for CodeBolt
3
+ * @description Provides utilities for accessing current user message and context
4
+ */
5
+ /**
6
+ * User message utilities for accessing current user message and context
7
+ */
8
+ export declare const userMessageUtilities: {
9
+ /**
10
+ * Get the current user message object
11
+ * @returns Current UserMessage or undefined
12
+ */
13
+ getCurrent: () => import("@codebolt/types/sdk").FlatUserMessage | undefined;
14
+ /**
15
+ * Get the user message text content
16
+ * @returns Message text string
17
+ */
18
+ getText: () => string;
19
+ /**
20
+ * Get mentioned MCPs from current message
21
+ * @returns Array of MCP tools
22
+ */
23
+ getMentionedMCPs: () => string[];
24
+ /**
25
+ * Get mentioned files from current message
26
+ * @returns Array of file paths
27
+ */
28
+ getMentionedFiles: () => string[];
29
+ /**
30
+ * Get mentioned folders from current message
31
+ * @returns Array of folder paths
32
+ */
33
+ getMentionedFolders: () => string[];
34
+ /**
35
+ * Get mentioned agents from current message
36
+ * @returns Array of agent objects
37
+ */
38
+ getMentionedAgents: () => any[];
39
+ /**
40
+ * Get remix prompt from current message
41
+ * @returns Remix prompt string or undefined
42
+ */
43
+ getRemixPrompt: () => string | undefined;
44
+ /**
45
+ * Get uploaded images from current message
46
+ * @returns Array of image objects
47
+ */
48
+ getUploadedImages: () => any[];
49
+ /**
50
+ * Get current file path
51
+ * @returns Current file path or undefined
52
+ */
53
+ getCurrentFile: () => string | undefined;
54
+ /**
55
+ * Get text selection from current message
56
+ * @returns Selected text or undefined
57
+ */
58
+ getSelection: () => string | undefined;
59
+ /**
60
+ * Get message ID
61
+ * @returns Message ID or undefined
62
+ */
63
+ getMessageId: () => string | undefined;
64
+ /**
65
+ * Get thread ID
66
+ * @returns Thread ID or undefined
67
+ */
68
+ getThreadId: () => string | undefined;
69
+ /**
70
+ * Get processing configuration
71
+ * @returns Processing configuration object
72
+ */
73
+ getProcessingConfig: () => import("@codebolt/types/sdk").AgentProcessingConfig;
74
+ /**
75
+ * Check if a processing type is enabled
76
+ * @param type Processing type to check
77
+ * @returns Whether the processing type is enabled
78
+ */
79
+ isProcessingEnabled: (type: "processMentionedMCPs" | "processRemixPrompt" | "processMentionedFiles" | "processMentionedAgents") => boolean;
80
+ /**
81
+ * Set session data
82
+ * @param key Session data key
83
+ * @param value Session data value
84
+ */
85
+ setSessionData: (key: string, value: any) => void;
86
+ /**
87
+ * Get session data
88
+ * @param key Session data key
89
+ * @returns Session data value
90
+ */
91
+ getSessionData: (key: string) => any;
92
+ /**
93
+ * Get message timestamp
94
+ * @returns Timestamp when message was received
95
+ */
96
+ getTimestamp: () => string | undefined;
97
+ /**
98
+ * Check if there's a current message
99
+ * @returns Whether there's a current message
100
+ */
101
+ hasMessage: () => boolean;
102
+ /**
103
+ * Update processing configuration
104
+ * @param config New processing configuration
105
+ */
106
+ updateProcessingConfig: (config: any) => void;
107
+ /**
108
+ * Clear current user message
109
+ */
110
+ clear: () => void;
111
+ };
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview User Message Utilities for CodeBolt
4
+ * @description Provides utilities for accessing current user message and context
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.userMessageUtilities = void 0;
8
+ const user_message_manager_1 = require("./user-message-manager");
9
+ /**
10
+ * User message utilities for accessing current user message and context
11
+ */
12
+ exports.userMessageUtilities = {
13
+ /**
14
+ * Get the current user message object
15
+ * @returns Current UserMessage or undefined
16
+ */
17
+ getCurrent: () => user_message_manager_1.userMessageManager.getMessage(),
18
+ /**
19
+ * Get the user message text content
20
+ * @returns Message text string
21
+ */
22
+ getText: () => user_message_manager_1.userMessageManager.getMessageText(),
23
+ /**
24
+ * Get mentioned MCPs from current message
25
+ * @returns Array of MCP tools
26
+ */
27
+ getMentionedMCPs: () => user_message_manager_1.userMessageManager.getMentionedMCPs(),
28
+ /**
29
+ * Get mentioned files from current message
30
+ * @returns Array of file paths
31
+ */
32
+ getMentionedFiles: () => user_message_manager_1.userMessageManager.getMentionedFiles(),
33
+ /**
34
+ * Get mentioned folders from current message
35
+ * @returns Array of folder paths
36
+ */
37
+ getMentionedFolders: () => user_message_manager_1.userMessageManager.getMentionedFolders(),
38
+ /**
39
+ * Get mentioned agents from current message
40
+ * @returns Array of agent objects
41
+ */
42
+ getMentionedAgents: () => user_message_manager_1.userMessageManager.getMentionedAgents(),
43
+ /**
44
+ * Get remix prompt from current message
45
+ * @returns Remix prompt string or undefined
46
+ */
47
+ getRemixPrompt: () => user_message_manager_1.userMessageManager.getRemixPrompt(),
48
+ /**
49
+ * Get uploaded images from current message
50
+ * @returns Array of image objects
51
+ */
52
+ getUploadedImages: () => user_message_manager_1.userMessageManager.getUploadedImages(),
53
+ /**
54
+ * Get current file path
55
+ * @returns Current file path or undefined
56
+ */
57
+ getCurrentFile: () => user_message_manager_1.userMessageManager.getCurrentFile(),
58
+ /**
59
+ * Get text selection from current message
60
+ * @returns Selected text or undefined
61
+ */
62
+ getSelection: () => user_message_manager_1.userMessageManager.getSelection(),
63
+ /**
64
+ * Get message ID
65
+ * @returns Message ID or undefined
66
+ */
67
+ getMessageId: () => user_message_manager_1.userMessageManager.getMessageId(),
68
+ /**
69
+ * Get thread ID
70
+ * @returns Thread ID or undefined
71
+ */
72
+ getThreadId: () => user_message_manager_1.userMessageManager.getThreadId(),
73
+ /**
74
+ * Get processing configuration
75
+ * @returns Processing configuration object
76
+ */
77
+ getProcessingConfig: () => user_message_manager_1.userMessageManager.getConfig(),
78
+ /**
79
+ * Check if a processing type is enabled
80
+ * @param type Processing type to check
81
+ * @returns Whether the processing type is enabled
82
+ */
83
+ isProcessingEnabled: (type) => user_message_manager_1.userMessageManager.isProcessingEnabled(type),
84
+ /**
85
+ * Set session data
86
+ * @param key Session data key
87
+ * @param value Session data value
88
+ */
89
+ setSessionData: (key, value) => user_message_manager_1.userMessageManager.setSessionData(key, value),
90
+ /**
91
+ * Get session data
92
+ * @param key Session data key
93
+ * @returns Session data value
94
+ */
95
+ getSessionData: (key) => user_message_manager_1.userMessageManager.getSessionData(key),
96
+ /**
97
+ * Get message timestamp
98
+ * @returns Timestamp when message was received
99
+ */
100
+ getTimestamp: () => user_message_manager_1.userMessageManager.getTimestamp(),
101
+ /**
102
+ * Check if there's a current message
103
+ * @returns Whether there's a current message
104
+ */
105
+ hasMessage: () => user_message_manager_1.userMessageManager.hasMessage(),
106
+ /**
107
+ * Update processing configuration
108
+ * @param config New processing configuration
109
+ */
110
+ updateProcessingConfig: (config) => user_message_manager_1.userMessageManager.updateConfig(config),
111
+ /**
112
+ * Clear current user message
113
+ */
114
+ clear: () => user_message_manager_1.userMessageManager.clear()
115
+ };
@@ -1,4 +1,4 @@
1
- import { FsEditFileAndApplyDiffResponse } from '../types/socketMessageTypes';
1
+ import { FsEditFileAndApplyDiffResponse } from '@codebolt/types/sdk';
2
2
  declare const cbutils: {
3
3
  /**
4
4
  * Edits a file and applies a diff with AI assistance.
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const enum_1 = require("@codebolt/types/enum");
6
7
  const websocket_1 = __importDefault(require("../core/websocket"));
7
8
  const cbutils = {
8
9
  /**
@@ -16,8 +17,8 @@ const cbutils = {
16
17
  */
17
18
  editFileAndApplyDiff: (filePath, diff, diffIdentifier, prompt, applyModel) => {
18
19
  return websocket_1.default.messageManager.sendAndWaitForResponse({
19
- "type": "fsEvent",
20
- "action": "editFileAndApplyDiff",
20
+ "type": enum_1.EventType.FS_EVENT,
21
+ "action": enum_1.FSAction.EDIT_FILE_AND_APPLY_DIFF,
21
22
  message: {
22
23
  filePath,
23
24
  diff,
@@ -25,7 +26,7 @@ const cbutils = {
25
26
  prompt,
26
27
  applyModel
27
28
  }
28
- }, "editFileAndApplyDiffResponse");
29
+ }, enum_1.FSResponseType.EDIT_FILE_AND_APPLY_DIFF_RESPONSE);
29
30
  }
30
31
  };
31
32
  exports.default = cbutils;
@@ -1,4 +1,4 @@
1
- import { AddVectorItemResponse, GetVectorResponse, QueryVectorItemResponse } from '../types/socketMessageTypes';
1
+ import { AddVectorItemResponse, GetVectorResponse, QueryVectorItemResponse } from '@codebolt/types/sdk';
2
2
  declare const VectorDB: {
3
3
  /**
4
4
  * Retrieves a vector from the vector database based on the provided key.
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const enum_1 = require("@codebolt/types/enum");
6
7
  const websocket_1 = __importDefault(require("../core/websocket"));
7
8
  const VectorDB = {
8
9
  /**
@@ -13,12 +14,12 @@ const VectorDB = {
13
14
  */
14
15
  getVector: async (key) => {
15
16
  return websocket_1.default.messageManager.sendAndWaitForResponse({
16
- "type": "vectordbEvent",
17
- "action": "getVector",
17
+ "type": enum_1.EventType.VECTOR_DB_EVENT,
18
+ "action": enum_1.VectorDBAction.GET_VECTOR,
18
19
  "message": {
19
20
  item: key
20
21
  },
21
- }, "getVectorResponse");
22
+ }, enum_1.VectorDBResponseType.GET_VECTOR_RESPONSE);
22
23
  },
23
24
  /**
24
25
  * Adds a new vector item to the vector database.
@@ -29,12 +30,12 @@ const VectorDB = {
29
30
  */
30
31
  addVectorItem: async (item) => {
31
32
  return websocket_1.default.messageManager.sendAndWaitForResponse({
32
- "type": "vectordbEvent",
33
- "action": "addVectorItem",
33
+ "type": enum_1.EventType.VECTOR_DB_EVENT,
34
+ "action": enum_1.VectorDBAction.ADD_VECTOR_ITEM,
34
35
  "message": {
35
36
  item: item
36
37
  },
37
- }, "addVectorItemResponse");
38
+ }, enum_1.VectorDBResponseType.ADD_VECTOR_ITEM_RESPONSE);
38
39
  },
39
40
  /**
40
41
  * Queries a vector item from the vector database based on the provided key.
@@ -44,12 +45,12 @@ const VectorDB = {
44
45
  */
45
46
  queryVectorItem: async (key) => {
46
47
  return websocket_1.default.messageManager.sendAndWaitForResponse({
47
- "type": "vectordbEvent",
48
- "action": "queryVectorItem",
48
+ "type": enum_1.EventType.VECTOR_DB_EVENT,
49
+ "action": enum_1.VectorDBAction.QUERY_VECTOR_ITEM,
49
50
  "message": {
50
51
  item: key
51
52
  },
52
- }, "qeryVectorItemResponse");
53
+ }, enum_1.VectorDBResponseType.QUERY_VECTOR_ITEM_RESPONSE);
53
54
  },
54
55
  /**
55
56
  * Queries a vector item from the vector database based on the provided key.
@@ -59,13 +60,13 @@ const VectorDB = {
59
60
  */
60
61
  queryVectorItems: async (items, dbPath) => {
61
62
  return websocket_1.default.messageManager.sendAndWaitForResponse({
62
- "type": "vectordbEvent",
63
- "action": "queryVectorItems",
63
+ "type": enum_1.EventType.VECTOR_DB_EVENT,
64
+ "action": enum_1.VectorDBAction.QUERY_VECTOR_ITEMS,
64
65
  "message": {
65
66
  items,
66
67
  dbPath
67
68
  },
68
- }, "qeryVectorItemsResponse");
69
+ }, enum_1.VectorDBResponseType.QUERY_VECTOR_ITEMS_RESPONSE);
69
70
  },
70
71
  };
71
72
  exports.default = VectorDB;
@@ -11,6 +11,7 @@ exports.StartSubagentTaskRequestNotify = StartSubagentTaskRequestNotify;
11
11
  exports.StartSubagentTaskResponseNotify = StartSubagentTaskResponseNotify;
12
12
  exports.SubagentTaskCompletedNotify = SubagentTaskCompletedNotify;
13
13
  const utils_1 = require("./utils");
14
+ const enum_1 = require("@codebolt/types/enum");
14
15
  /**
15
16
  * Sends a request to start a subagent task
16
17
  *
@@ -31,8 +32,8 @@ function StartSubagentTaskRequestNotify(parentAgentId, subagentId, task, priorit
31
32
  // Create the notification
32
33
  const notification = {
33
34
  toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
34
- type: "agentnotify",
35
- action: "startSubagentTaskRequest",
35
+ type: enum_1.NotificationEventType.AGENT_NOTIFY,
36
+ action: enum_1.AgentNotificationAction.START_SUBAGENT_TASK_REQUEST,
36
37
  data: {
37
38
  parentAgentId: parentAgentId,
38
39
  subagentId: subagentId,
@@ -62,8 +63,8 @@ function StartSubagentTaskResponseNotify(content, isError = false, toolUseId) {
62
63
  // Create the notification
63
64
  const notification = {
64
65
  toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
65
- type: "agentnotify",
66
- action: "startSubagentTaskResult",
66
+ type: enum_1.NotificationEventType.AGENT_NOTIFY,
67
+ action: enum_1.AgentNotificationAction.START_SUBAGENT_TASK_RESULT,
67
68
  content: content,
68
69
  isError: isError
69
70
  };
@@ -90,8 +91,8 @@ function SubagentTaskCompletedNotify(parentAgentId, subagentId, taskId, result,
90
91
  // Create the notification
91
92
  const notification = {
92
93
  toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
93
- type: "agentnotify",
94
- action: "subagentTaskCompleted",
94
+ type: enum_1.NotificationEventType.AGENT_NOTIFY,
95
+ action: enum_1.AgentNotificationAction.SUBAGENT_TASK_COMPLETED,
95
96
  data: {
96
97
  parentAgentId: parentAgentId,
97
98
  subagentId: subagentId,
@@ -12,6 +12,7 @@ exports.WebFetchResponseNotify = WebFetchResponseNotify;
12
12
  exports.WebSearchRequestNotify = WebSearchRequestNotify;
13
13
  exports.WebSearchResponseNotify = WebSearchResponseNotify;
14
14
  const utils_1 = require("./utils");
15
+ const enum_1 = require("@codebolt/types/enum");
15
16
  /**
16
17
  * Sends a web fetch request notification
17
18
  *
@@ -32,8 +33,8 @@ function WebFetchRequestNotify(url, method, headers, body, timeout, toolUseId) {
32
33
  // Create the notification
33
34
  const notification = {
34
35
  toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
35
- type: "browsernotify",
36
- action: "webFetchRequest",
36
+ type: enum_1.NotificationEventType.BROWSER_NOTIFY,
37
+ action: enum_1.BrowserNotificationAction.WEB_FETCH_REQUEST,
37
38
  data: {
38
39
  url: url,
39
40
  method: method,
@@ -64,8 +65,8 @@ function WebFetchResponseNotify(content, isError = false, toolUseId, data) {
64
65
  // Create the notification
65
66
  const notification = {
66
67
  toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
67
- type: "browsernotify",
68
- action: "webFetchResult",
68
+ type: enum_1.NotificationEventType.BROWSER_NOTIFY,
69
+ action: enum_1.BrowserNotificationAction.WEB_FETCH_RESULT,
69
70
  content: content,
70
71
  isError: isError,
71
72
  data: data
@@ -92,8 +93,8 @@ function WebSearchRequestNotify(query, maxResults, searchEngine, filters, toolUs
92
93
  // Create the notification
93
94
  const notification = {
94
95
  toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
95
- type: "browsernotify",
96
- action: "webSearchRequest",
96
+ type: enum_1.NotificationEventType.BROWSER_NOTIFY,
97
+ action: enum_1.BrowserNotificationAction.WEB_SEARCH_REQUEST,
97
98
  data: {
98
99
  query: query,
99
100
  maxResults: maxResults,
@@ -123,8 +124,8 @@ function WebSearchResponseNotify(content, isError = false, toolUseId, data) {
123
124
  // Create the notification
124
125
  const notification = {
125
126
  toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
126
- type: "browsernotify",
127
- action: "webSearchResult",
127
+ type: enum_1.NotificationEventType.BROWSER_NOTIFY,
128
+ action: enum_1.BrowserNotificationAction.WEB_SEARCH_RESULT,
128
129
  content: content,
129
130
  isError: isError,
130
131
  data: data
@@ -12,6 +12,7 @@ exports.AgentTextResponseNotify = AgentTextResponseNotify;
12
12
  exports.GetChatHistoryRequestNotify = GetChatHistoryRequestNotify;
13
13
  exports.GetChatHistoryResultNotify = GetChatHistoryResultNotify;
14
14
  const utils_1 = require("./utils");
15
+ const enum_1 = require("@codebolt/types/enum");
15
16
  /**
16
17
  * Sends a user message request
17
18
  *
@@ -29,8 +30,8 @@ function UserMessageRequestNotify(message, payload, toolUseId) {
29
30
  // Create the notification
30
31
  const notification = {
31
32
  toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
32
- type: "chatnotify",
33
- action: "sendMessageRequest",
33
+ type: enum_1.NotificationEventType.CHAT_NOTIFY,
34
+ action: enum_1.ChatNotificationAction.SEND_MESSAGE_REQUEST,
34
35
  data: {
35
36
  message: message,
36
37
  payload: payload
@@ -58,8 +59,8 @@ function AgentTextResponseNotify(content, isError = false, toolUseId, data) {
58
59
  // Create the notification
59
60
  const notification = {
60
61
  toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
61
- type: "chatnotify",
62
- action: "agentTextResponse",
62
+ type: enum_1.NotificationEventType.CHAT_NOTIFY,
63
+ action: enum_1.ChatNotificationAction.AGENT_TEXT_RESPONSE,
63
64
  content: content,
64
65
  isError: isError,
65
66
  data: data
@@ -79,8 +80,8 @@ function GetChatHistoryRequestNotify(data, toolUseId) {
79
80
  // Create the notification
80
81
  const notification = {
81
82
  toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
82
- type: "chatnotify",
83
- action: "getChatHistoryRequest",
83
+ type: enum_1.NotificationEventType.CHAT_NOTIFY,
84
+ action: enum_1.ChatNotificationAction.GET_CHAT_HISTORY_REQUEST,
84
85
  data: data || {}
85
86
  };
86
87
  // Send the notification
@@ -104,8 +105,8 @@ function GetChatHistoryResultNotify(content, isError = false, toolUseId) {
104
105
  // Create the notification
105
106
  const notification = {
106
107
  toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
107
- type: "chatnotify",
108
- action: "getChatHistoryResult",
108
+ type: enum_1.NotificationEventType.CHAT_NOTIFY,
109
+ action: enum_1.ChatNotificationAction.GET_CHAT_HISTORY_RESULT,
109
110
  content: content,
110
111
  isError: isError
111
112
  };
@@ -12,6 +12,7 @@ exports.GrepSearchResponseNotify = GrepSearchResponseNotify;
12
12
  exports.GlobSearchRequestNotify = GlobSearchRequestNotify;
13
13
  exports.GlobSearchResponseNotify = GlobSearchResponseNotify;
14
14
  const utils_1 = require("./utils");
15
+ const enum_1 = require("@codebolt/types/enum");
15
16
  /**
16
17
  * Sends a grep search request
17
18
  *
@@ -32,8 +33,8 @@ function GrepSearchRequestNotify(pattern, filePath, recursive, ignoreCase, maxRe
32
33
  // Create the notification
33
34
  const notification = {
34
35
  toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
35
- type: "codeutilsnotify",
36
- action: "grepSearchRequest",
36
+ type: enum_1.NotificationEventType.CODEUTILS_NOTIFY,
37
+ action: enum_1.CodeUtilsNotificationAction.GREP_SEARCH_REQUEST,
37
38
  data: {
38
39
  pattern: pattern,
39
40
  filePath: filePath,
@@ -64,8 +65,8 @@ function GrepSearchResponseNotify(content, isError = false, toolUseId, data) {
64
65
  // Create the notification
65
66
  const notification = {
66
67
  toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
67
- type: "codeutilsnotify",
68
- action: "grepSearchResult",
68
+ type: enum_1.NotificationEventType.CODEUTILS_NOTIFY,
69
+ action: enum_1.CodeUtilsNotificationAction.GREP_SEARCH_RESULT,
69
70
  content: content,
70
71
  isError: isError,
71
72
  data: data
@@ -92,8 +93,8 @@ function GlobSearchRequestNotify(pattern, basePath, maxDepth, includeDirectories
92
93
  // Create the notification
93
94
  const notification = {
94
95
  toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
95
- type: "codeutilsnotify",
96
- action: "globSearchRequest",
96
+ type: enum_1.NotificationEventType.CODEUTILS_NOTIFY,
97
+ action: enum_1.CodeUtilsNotificationAction.GLOB_SEARCH_REQUEST,
97
98
  data: {
98
99
  pattern: pattern,
99
100
  basePath: basePath,
@@ -123,8 +124,8 @@ function GlobSearchResponseNotify(content, isError = false, toolUseId, data) {
123
124
  // Create the notification
124
125
  const notification = {
125
126
  toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
126
- type: "codeutilsnotify",
127
- action: "globSearchResult",
127
+ type: enum_1.NotificationEventType.CODEUTILS_NOTIFY,
128
+ action: enum_1.CodeUtilsNotificationAction.GLOB_SEARCH_RESULT,
128
129
  content: content,
129
130
  isError: isError,
130
131
  data: data
@@ -12,6 +12,7 @@ exports.CrawlerSearchResponseNotify = CrawlerSearchResponseNotify;
12
12
  exports.CrawlerStartRequestNotify = CrawlerStartRequestNotify;
13
13
  exports.CrawlerStartResponseNotify = CrawlerStartResponseNotify;
14
14
  const utils_1 = require("./utils");
15
+ const enum_1 = require("@codebolt/types/enum");
15
16
  /**
16
17
  * Sends a request to perform a crawler search
17
18
  *
@@ -41,8 +42,8 @@ function CrawlerSearchRequestNotify(url, searchQuery, maxDepth, maxPages, includ
41
42
  // Create the notification
42
43
  const notification = {
43
44
  toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
44
- type: "crawlernotify",
45
- action: "crawlerSearchRequest",
45
+ type: enum_1.NotificationEventType.CRAWLER_NOTIFY,
46
+ action: enum_1.CrawlerNotificationAction.CRAWLER_SEARCH_REQUEST,
46
47
  data: {
47
48
  url: url,
48
49
  searchQuery: searchQuery,
@@ -74,8 +75,8 @@ function CrawlerSearchResponseNotify(content, isError = false, toolUseId, data)
74
75
  // Create the notification
75
76
  const notification = {
76
77
  toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
77
- type: "crawlernotify",
78
- action: "crawlerSearchResult",
78
+ type: enum_1.NotificationEventType.CRAWLER_NOTIFY,
79
+ action: enum_1.CrawlerNotificationAction.CRAWLER_SEARCH_RESULT,
79
80
  content: content,
80
81
  isError: isError,
81
82
  data: data
@@ -108,8 +109,8 @@ function CrawlerStartRequestNotify(startUrl, options, toolUseId) {
108
109
  // Create the notification
109
110
  const notification = {
110
111
  toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
111
- type: "crawlernotify",
112
- action: "crawlerStartRequest",
112
+ type: enum_1.NotificationEventType.CRAWLER_NOTIFY,
113
+ action: enum_1.CrawlerNotificationAction.CRAWLER_START_REQUEST,
113
114
  data: {
114
115
  startUrl: startUrl,
115
116
  options: options
@@ -137,8 +138,8 @@ function CrawlerStartResponseNotify(content, isError = false, toolUseId, data) {
137
138
  // Create the notification
138
139
  const notification = {
139
140
  toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
140
- type: "crawlernotify",
141
- action: "crawlerStartResult",
141
+ type: enum_1.NotificationEventType.CRAWLER_NOTIFY,
142
+ action: enum_1.CrawlerNotificationAction.CRAWLER_START_RESULT,
142
143
  content: content,
143
144
  isError: isError,
144
145
  data: data
@@ -12,6 +12,7 @@ exports.AddMemoryResultNotify = AddMemoryResultNotify;
12
12
  exports.GetMemoryRequestNotify = GetMemoryRequestNotify;
13
13
  exports.GetMemoryResultNotify = GetMemoryResultNotify;
14
14
  const utils_1 = require("./utils");
15
+ const enum_1 = require("@codebolt/types/enum");
15
16
  /**
16
17
  * Sends a request to add knowledge to memory
17
18
  *
@@ -34,8 +35,8 @@ function AddMemoryRequestNotify(key, value, toolUseId) {
34
35
  // Create the notification
35
36
  const notification = {
36
37
  toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
37
- type: "dbmemorynotify",
38
- action: "addKnowledgeRequest",
38
+ type: enum_1.NotificationEventType.DBMEMORY_NOTIFY,
39
+ action: enum_1.DbMemoryNotificationAction.ADD_KNOWLEDGE_REQUEST,
39
40
  data: {
40
41
  key: key,
41
42
  value: value
@@ -62,8 +63,8 @@ function AddMemoryResultNotify(content, isError = false, toolUseId) {
62
63
  // Create the notification
63
64
  const notification = {
64
65
  toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
65
- type: "dbmemorynotify",
66
- action: "addKnowledgeResult",
66
+ type: enum_1.NotificationEventType.DBMEMORY_NOTIFY,
67
+ action: enum_1.DbMemoryNotificationAction.ADD_KNOWLEDGE_RESULT,
67
68
  content: content,
68
69
  isError: isError
69
70
  };
@@ -86,8 +87,8 @@ function GetMemoryRequestNotify(key, toolUseId) {
86
87
  // Create the notification
87
88
  const notification = {
88
89
  toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
89
- type: "dbmemorynotify",
90
- action: "getKnowledgeRequest",
90
+ type: enum_1.NotificationEventType.DBMEMORY_NOTIFY,
91
+ action: enum_1.DbMemoryNotificationAction.GET_KNOWLEDGE_REQUEST,
91
92
  data: {
92
93
  key: key
93
94
  }
@@ -113,8 +114,8 @@ function GetMemoryResultNotify(content, isError = false, toolUseId) {
113
114
  // Create the notification
114
115
  const notification = {
115
116
  toolUseId: toolUseId || (0, utils_1.generateToolUseId)(),
116
- type: "dbmemorynotify",
117
- action: "getKnowledgeResult",
117
+ type: enum_1.NotificationEventType.DBMEMORY_NOTIFY,
118
+ action: enum_1.DbMemoryNotificationAction.GET_KNOWLEDGE_RESULT,
118
119
  content: content,
119
120
  isError: isError
120
121
  };