@codebolt/codeboltjs 2.0.17 → 2.1.0

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 (78) hide show
  1. package/dist/core/Codebolt.d.ts +48 -53
  2. package/dist/core/messageManager.d.ts +0 -1
  3. package/dist/modules/chat.d.ts +1 -1
  4. package/dist/modules/codeparsers.js +24 -15
  5. package/dist/modules/codeutils.js +19 -9
  6. package/dist/modules/task.d.ts +1 -1
  7. package/dist/modules/terminal.d.ts +0 -1
  8. package/dist/notificationfunctions/agent.js +4 -4
  9. package/dist/notificationfunctions/browser.js +5 -5
  10. package/dist/notificationfunctions/chat.js +5 -5
  11. package/dist/notificationfunctions/codeutils.js +5 -5
  12. package/dist/notificationfunctions/crawler.js +5 -5
  13. package/dist/notificationfunctions/dbmemory.js +5 -5
  14. package/dist/notificationfunctions/fs.js +23 -23
  15. package/dist/notificationfunctions/git.js +25 -25
  16. package/dist/notificationfunctions/history.js +5 -5
  17. package/dist/notificationfunctions/llm.js +5 -5
  18. package/dist/notificationfunctions/mcp.js +9 -9
  19. package/dist/notificationfunctions/search.js +7 -7
  20. package/dist/notificationfunctions/system.js +3 -3
  21. package/dist/notificationfunctions/terminal.js +3 -3
  22. package/dist/notificationfunctions/todo.js +7 -7
  23. package/dist/notificationfunctions/utils.js +8 -8
  24. package/dist/types/InternalTypes.d.ts +0 -3
  25. package/dist/types/commonTypes.d.ts +2 -2
  26. package/dist/types/socketMessageTypes.d.ts +0 -2
  27. package/dist/types/socketMessageTypes.js +6 -7
  28. package/package.json +20 -26
  29. package/dist/utils/docutils.d.ts +0 -9
  30. package/dist/utils/docutils.js +0 -69
  31. package/dist/utils/mcpServer.d.ts +0 -481
  32. package/dist/utils/mcpServer.js +0 -779
  33. package/dist/utils/parse-source-code/index.d.ts +0 -9
  34. package/dist/utils/parse-source-code/index.js +0 -233
  35. package/dist/utils/parse-source-code/languageParser.d.ts +0 -2
  36. package/dist/utils/parse-source-code/languageParser.js +0 -137
  37. package/dist/utils/parse-source-code/queries/c-sharp.d.ts +0 -2
  38. package/dist/utils/parse-source-code/queries/c-sharp.js +0 -25
  39. package/dist/utils/parse-source-code/queries/c.d.ts +0 -2
  40. package/dist/utils/parse-source-code/queries/c.js +0 -17
  41. package/dist/utils/parse-source-code/queries/cpp.d.ts +0 -2
  42. package/dist/utils/parse-source-code/queries/cpp.js +0 -25
  43. package/dist/utils/parse-source-code/queries/go.d.ts +0 -2
  44. package/dist/utils/parse-source-code/queries/go.js +0 -29
  45. package/dist/utils/parse-source-code/queries/index.d.ts +0 -12
  46. package/dist/utils/parse-source-code/queries/index.js +0 -30
  47. package/dist/utils/parse-source-code/queries/java.d.ts +0 -2
  48. package/dist/utils/parse-source-code/queries/java.js +0 -17
  49. package/dist/utils/parse-source-code/queries/javascript.d.ts +0 -2
  50. package/dist/utils/parse-source-code/queries/javascript.js +0 -67
  51. package/dist/utils/parse-source-code/queries/php.d.ts +0 -2
  52. package/dist/utils/parse-source-code/queries/php.js +0 -17
  53. package/dist/utils/parse-source-code/queries/python.d.ts +0 -2
  54. package/dist/utils/parse-source-code/queries/python.js +0 -13
  55. package/dist/utils/parse-source-code/queries/ruby.d.ts +0 -2
  56. package/dist/utils/parse-source-code/queries/ruby.js +0 -54
  57. package/dist/utils/parse-source-code/queries/rust.d.ts +0 -2
  58. package/dist/utils/parse-source-code/queries/rust.js +0 -18
  59. package/dist/utils/parse-source-code/queries/swift.d.ts +0 -2
  60. package/dist/utils/parse-source-code/queries/swift.js +0 -47
  61. package/dist/utils/parse-source-code/queries/typescript.d.ts +0 -2
  62. package/dist/utils/parse-source-code/queries/typescript.js +0 -34
  63. package/dist/utils/parse-source-code/tree-sitter-c.wasm +0 -0
  64. package/dist/utils/parse-source-code/tree-sitter-c_sharp.wasm +0 -0
  65. package/dist/utils/parse-source-code/tree-sitter-cpp.wasm +0 -0
  66. package/dist/utils/parse-source-code/tree-sitter-go.wasm +0 -0
  67. package/dist/utils/parse-source-code/tree-sitter-java.wasm +0 -0
  68. package/dist/utils/parse-source-code/tree-sitter-javascript.wasm +0 -0
  69. package/dist/utils/parse-source-code/tree-sitter-php.wasm +0 -0
  70. package/dist/utils/parse-source-code/tree-sitter-python.wasm +0 -0
  71. package/dist/utils/parse-source-code/tree-sitter-ruby.wasm +0 -0
  72. package/dist/utils/parse-source-code/tree-sitter-rust.wasm +0 -0
  73. package/dist/utils/parse-source-code/tree-sitter-swift.wasm +0 -0
  74. package/dist/utils/parse-source-code/tree-sitter-tsx.wasm +0 -0
  75. package/dist/utils/parse-source-code/tree-sitter-typescript.wasm +0 -0
  76. package/dist/utils/parse-source-code/tree-sitter.wasm +0 -0
  77. package/dist/utils.d.ts +0 -2
  78. package/dist/utils.js +0 -10
@@ -6,7 +6,9 @@
6
6
  * including command execution operations.
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.terminalNotifications = exports.CommandExecutionResponseNotify = exports.CommandExecutionRequestNotify = void 0;
9
+ exports.terminalNotifications = void 0;
10
+ exports.CommandExecutionRequestNotify = CommandExecutionRequestNotify;
11
+ exports.CommandExecutionResponseNotify = CommandExecutionResponseNotify;
10
12
  const utils_1 = require("./utils");
11
13
  // ===== COMMAND EXECUTION FUNCTIONS =====
12
14
  /**
@@ -33,7 +35,6 @@ function CommandExecutionRequestNotify(command, returnEmptyStringOnSuccess, exec
33
35
  };
34
36
  (0, utils_1.sendNotification)(notification, 'terminal-command-execution');
35
37
  }
36
- exports.CommandExecutionRequestNotify = CommandExecutionRequestNotify;
37
38
  /**
38
39
  * Sends a command execution response notification
39
40
  * @param content - The command execution result or error details
@@ -54,7 +55,6 @@ function CommandExecutionResponseNotify(content, isError = false, toolUseId) {
54
55
  };
55
56
  (0, utils_1.sendNotification)(notification, 'terminal-command-execution-response');
56
57
  }
57
- exports.CommandExecutionResponseNotify = CommandExecutionResponseNotify;
58
58
  /**
59
59
  * Terminal notification functions object
60
60
  */
@@ -6,7 +6,13 @@
6
6
  * including task operations and lifecycle management.
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.todoNotifications = exports.EditTodoTaskResponseNotify = exports.EditTodoTaskRequestNotify = exports.GetTodoResponseNotify = exports.GetTodoRequestNotify = exports.AddTodoResponseNotify = exports.AddTodoRequestNotify = void 0;
9
+ exports.todoNotifications = void 0;
10
+ exports.AddTodoRequestNotify = AddTodoRequestNotify;
11
+ exports.AddTodoResponseNotify = AddTodoResponseNotify;
12
+ exports.GetTodoRequestNotify = GetTodoRequestNotify;
13
+ exports.GetTodoResponseNotify = GetTodoResponseNotify;
14
+ exports.EditTodoTaskRequestNotify = EditTodoTaskRequestNotify;
15
+ exports.EditTodoTaskResponseNotify = EditTodoTaskResponseNotify;
10
16
  const utils_1 = require("./utils");
11
17
  // ===== ADD TODO FUNCTIONS =====
12
18
  /**
@@ -37,7 +43,6 @@ function AddTodoRequestNotify(title, agentId, description, phase, category, prio
37
43
  };
38
44
  (0, utils_1.sendNotification)(notification, 'todo-add-task');
39
45
  }
40
- exports.AddTodoRequestNotify = AddTodoRequestNotify;
41
46
  /**
42
47
  * Sends an add todo response notification
43
48
  * @param content - The response content or error details
@@ -58,7 +63,6 @@ function AddTodoResponseNotify(content, isError = false, toolUseId) {
58
63
  };
59
64
  (0, utils_1.sendNotification)(notification, 'todo-add-task-response');
60
65
  }
61
- exports.AddTodoResponseNotify = AddTodoResponseNotify;
62
66
  // ===== GET TODO FUNCTIONS =====
63
67
  /**
64
68
  * Sends a get todo request notification
@@ -76,7 +80,6 @@ function GetTodoRequestNotify(filters, toolUseId) {
76
80
  };
77
81
  (0, utils_1.sendNotification)(notification, 'todo-get-tasks');
78
82
  }
79
- exports.GetTodoRequestNotify = GetTodoRequestNotify;
80
83
  /**
81
84
  * Sends a get todo response notification
82
85
  * @param content - The response content or error details
@@ -97,7 +100,6 @@ function GetTodoResponseNotify(content, isError = false, toolUseId) {
97
100
  };
98
101
  (0, utils_1.sendNotification)(notification, 'todo-get-tasks-response');
99
102
  }
100
- exports.GetTodoResponseNotify = GetTodoResponseNotify;
101
103
  // ===== EDIT TODO TASK FUNCTIONS =====
102
104
  /**
103
105
  * Sends an edit todo task request notification
@@ -129,7 +131,6 @@ function EditTodoTaskRequestNotify(taskId, title, description, phase, category,
129
131
  };
130
132
  (0, utils_1.sendNotification)(notification, 'todo-edit-task');
131
133
  }
132
- exports.EditTodoTaskRequestNotify = EditTodoTaskRequestNotify;
133
134
  /**
134
135
  * Sends an edit todo task response notification
135
136
  * @param content - The response content or error details
@@ -150,7 +151,6 @@ function EditTodoTaskResponseNotify(content, isError = false, toolUseId) {
150
151
  };
151
152
  (0, utils_1.sendNotification)(notification, 'todo-edit-task-response');
152
153
  }
153
- exports.EditTodoTaskResponseNotify = EditTodoTaskResponseNotify;
154
154
  /**
155
155
  * Todo notification functions object
156
156
  */
@@ -3,7 +3,14 @@ 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
- exports.safeStringify = exports.createSuccessResponse = exports.createErrorResponse = exports.validateRequiredFields = exports.sendNotification = exports.validateNotificationStructure = exports.generateToolUseId = exports.NotificationErrorCodes = exports.NotificationError = void 0;
6
+ exports.NotificationErrorCodes = exports.NotificationError = void 0;
7
+ exports.generateToolUseId = generateToolUseId;
8
+ exports.validateNotificationStructure = validateNotificationStructure;
9
+ exports.sendNotification = sendNotification;
10
+ exports.validateRequiredFields = validateRequiredFields;
11
+ exports.createErrorResponse = createErrorResponse;
12
+ exports.createSuccessResponse = createSuccessResponse;
13
+ exports.safeStringify = safeStringify;
7
14
  const websocket_1 = __importDefault(require("../core/websocket"));
8
15
  /**
9
16
  * Error class for notification-related errors
@@ -38,7 +45,6 @@ function generateToolUseId() {
38
45
  const randomString = Math.random().toString(36).substr(2, 9);
39
46
  return `tool_${timestamp}_${randomString}`;
40
47
  }
41
- exports.generateToolUseId = generateToolUseId;
42
48
  /**
43
49
  * Validates the basic structure of a notification
44
50
  * @param notification The notification to validate
@@ -60,7 +66,6 @@ function validateNotificationStructure(notification) {
60
66
  }
61
67
  return true;
62
68
  }
63
- exports.validateNotificationStructure = validateNotificationStructure;
64
69
  /**
65
70
  * Sends a notification through the WebSocket connection
66
71
  * This is a fire-and-forget operation that handles errors gracefully
@@ -101,7 +106,6 @@ function sendNotification(notification, category = 'unknown') {
101
106
  console.error('[NotificationFunctions]', notificationError.message, notification);
102
107
  }
103
108
  }
104
- exports.sendNotification = sendNotification;
105
109
  /**
106
110
  * Validates that required data fields are present and not empty
107
111
  * @param data The data object to validate
@@ -122,7 +126,6 @@ function validateRequiredFields(data, requiredFields, category = 'unknown') {
122
126
  }
123
127
  return true;
124
128
  }
125
- exports.validateRequiredFields = validateRequiredFields;
126
129
  /**
127
130
  * Creates a standardized error response notification
128
131
  * @param toolUseId The toolUseId to use for the response
@@ -140,7 +143,6 @@ function createErrorResponse(toolUseId, type, action, error) {
140
143
  isError: true
141
144
  };
142
145
  }
143
- exports.createErrorResponse = createErrorResponse;
144
146
  /**
145
147
  * Creates a standardized success response notification
146
148
  * @param toolUseId The toolUseId to use for the response
@@ -158,7 +160,6 @@ function createSuccessResponse(toolUseId, type, action, content) {
158
160
  isError: false
159
161
  };
160
162
  }
161
- exports.createSuccessResponse = createSuccessResponse;
162
163
  /**
163
164
  * Utility function to safely stringify objects for logging
164
165
  * @param obj The object to stringify
@@ -174,4 +175,3 @@ function safeStringify(obj, maxLength = 200) {
174
175
  return '[Object - could not stringify]';
175
176
  }
176
177
  }
177
- exports.safeStringify = safeStringify;
@@ -8,9 +8,6 @@
8
8
  * - Module-specific types
9
9
  * - WebSocket management types
10
10
  */
11
- /// <reference types="node" />
12
- /// <reference types="node" />
13
- /// <reference types="node" />
14
11
  import { EventEmitter } from 'events';
15
12
  import WebSocket from 'ws';
16
13
  import type { PendingRequest } from './commonTypes';
@@ -243,8 +243,8 @@ export interface CodeboltError extends Error {
243
243
  }
244
244
  export declare class CodeboltError extends Error {
245
245
  code?: string | undefined;
246
- details?: any;
247
- constructor(message: string, code?: string | undefined, details?: any);
246
+ details?: any | undefined;
247
+ constructor(message: string, code?: string | undefined, details?: any | undefined);
248
248
  }
249
249
  export interface FileEntry {
250
250
  name: string;
@@ -6,8 +6,6 @@
6
6
  * - Outgoing response types (from server to client)
7
7
  * - WebSocket communication protocols
8
8
  */
9
- /// <reference types="node" />
10
- /// <reference types="node" />
11
9
  export interface BaseWebSocketMessage {
12
10
  type: string;
13
11
  messageId?: string;
@@ -8,30 +8,30 @@
8
8
  * - WebSocket communication protocols
9
9
  */
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.isFsServiceResponse = exports.isGitResponse = exports.isBrowserResponse = exports.isErrorResponse = exports.isFailureResponse = exports.isSuccessResponse = void 0;
11
+ exports.isSuccessResponse = isSuccessResponse;
12
+ exports.isFailureResponse = isFailureResponse;
13
+ exports.isErrorResponse = isErrorResponse;
14
+ exports.isBrowserResponse = isBrowserResponse;
15
+ exports.isGitResponse = isGitResponse;
16
+ exports.isFsServiceResponse = isFsServiceResponse;
12
17
  // ================================
13
18
  // Type Guards
14
19
  // ================================
15
20
  function isSuccessResponse(response) {
16
21
  return 'success' in response && response.success === true;
17
22
  }
18
- exports.isSuccessResponse = isSuccessResponse;
19
23
  function isFailureResponse(response) {
20
24
  return 'success' in response && response.success === false;
21
25
  }
22
- exports.isFailureResponse = isFailureResponse;
23
26
  function isErrorResponse(response) {
24
27
  return response.type === 'error';
25
28
  }
26
- exports.isErrorResponse = isErrorResponse;
27
29
  function isBrowserResponse(response) {
28
30
  return response.type.includes('browser') || response.type.includes('screenshot') || response.type.includes('Content');
29
31
  }
30
- exports.isBrowserResponse = isBrowserResponse;
31
32
  function isGitResponse(response) {
32
33
  return response.type.startsWith('git');
33
34
  }
34
- exports.isGitResponse = isGitResponse;
35
35
  function isFsServiceResponse(response) {
36
36
  return response.type.includes('readFileResponse') ||
37
37
  response.type.includes('writeToFileResponse') ||
@@ -48,4 +48,3 @@ function isFsServiceResponse(response) {
48
48
  response.type.includes('editFileAndApplyDiffResponse') ||
49
49
  response.type.includes('fsExecuteToolResponse');
50
50
  }
51
- exports.isFsServiceResponse = isFsServiceResponse;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebolt/codeboltjs",
3
- "version": "2.0.17",
3
+ "version": "2.1.0",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "author": "",
@@ -11,50 +11,34 @@
11
11
  "README.md",
12
12
  "LICENSE"
13
13
  ],
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": "jest fs.test.js",
21
- "clean": "rm -rf dist build",
22
- "prepublishOnly": "npm run clean && npm run build"
23
- },
24
14
  "repository": {
25
15
  "type": "git",
26
- "url": "git+https://github.com/codeboltai/codeboltjs.git"
16
+ "url": "git+https://github.com/codeboltai/codeboltjs.git",
17
+ "directory": "packages/codeboltjs"
27
18
  },
28
19
  "license": "MIT",
29
20
  "homepage": "https://codeboltai.github.io",
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
30
24
  "dependencies": {
31
25
  "@codebolt/globby": "^1.0.1",
32
26
  "@codebolt/types": "^1.0.10",
33
- "@modelcontextprotocol/sdk": "^1.4.1",
34
- "@types/pdf-parse": "^1.1.5",
35
27
  "@types/uuid": "^10.0.0",
36
28
  "buffer": "^6.0.3",
37
29
  "execa": "^9.5.2",
38
- "file-type": "^19.6.0",
39
- "fuse.js": "^7.0.0",
40
30
  "js-yaml": "^4.1.0",
41
- "load-esm": "^1.0.1",
42
- "mcp-proxy": "^2.4.0",
43
31
  "os-browserify": "^0.3.0",
44
32
  "path-browserify": "^1.0.1",
45
- "pdf-parse": "^1.1.1",
46
33
  "stream-browserify": "^3.0.0",
47
- "strict-event-emitter-types": "^2.0.0",
48
34
  "timers": "^0.1.1",
49
- "undici": "^7.4.0",
50
- "uri-templates": "^0.2.0",
51
35
  "util": "^0.12.5",
52
36
  "uuid": "^11.1.0",
53
- "web-tree-sitter": "^0.24.1",
54
37
  "ws": "^8.17.0",
55
38
  "yargs": "^17.7.2",
56
- "zod": "^3.24.1",
57
- "zod-to-json-schema": "^3.24.1"
39
+ "@codebolt/codeparser": "1.1.0",
40
+ "@codebolt/mcp": "1.1.0",
41
+ "@codebolt/utils": "1.1.0"
58
42
  },
59
43
  "devDependencies": {
60
44
  "@types/events": "^3.0.3",
@@ -84,5 +68,15 @@
84
68
  "types": "./dist/utils.d.ts",
85
69
  "default": "./dist/utils.js"
86
70
  }
71
+ },
72
+ "scripts": {
73
+ "build": "tsc && node script/copy-wasm.js",
74
+ "build:webpack": "webpack",
75
+ "build:all": "npm run build && npm run build:webpack",
76
+ "build:docs": "typedoc --plugin typedoc-plugin-missing-exports",
77
+ "build:jsondocs": "typedoc --plugin typedoc-plugin-missing-exports --json out.json --pretty",
78
+ "test": "echo \"Integration tests require WebSocket server - skipping for release\" && exit 0",
79
+ "clean": "rm -rf dist build",
80
+ "lint": "tsc --noEmit"
87
81
  }
88
- }
82
+ }
@@ -1,9 +0,0 @@
1
- declare const docutils: {
2
- /**
3
- * Converts a PDF document to text.
4
- * @param pdf_path - The file path to the PDF document to be converted.
5
- * @returns {Promise<string>} A promise that resolves with the converted text.
6
- */
7
- pdf_to_text: (pdf_path: string) => Promise<string>;
8
- };
9
- export default docutils;
@@ -1,69 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- /**
30
- * A module for document utility functions.
31
- */
32
- const fs = __importStar(require("fs"));
33
- const pdf_parse_1 = __importDefault(require("pdf-parse"));
34
- const docutils = {
35
- /**
36
- * Converts a PDF document to text.
37
- * @param pdf_path - The file path to the PDF document to be converted.
38
- * @returns {Promise<string>} A promise that resolves with the converted text.
39
- */
40
- pdf_to_text: (pdf_path) => {
41
- return new Promise((resolve, reject) => {
42
- try {
43
- // Check if file exists
44
- if (!fs.existsSync(pdf_path)) {
45
- return reject(new Error(`PDF file not found at path: ${pdf_path}`));
46
- }
47
- // Read the PDF file as buffer
48
- const dataBuffer = fs.readFileSync(pdf_path);
49
- // Parse the PDF document
50
- (0, pdf_parse_1.default)(dataBuffer)
51
- .then((data) => {
52
- resolve(data.text);
53
- })
54
- .catch((error) => {
55
- reject(new Error(`Error parsing PDF: ${error.message}`));
56
- });
57
- }
58
- catch (error) {
59
- if (error instanceof Error) {
60
- reject(new Error(`Error processing PDF: ${error.message}`));
61
- }
62
- else {
63
- reject(new Error('Unknown error processing PDF'));
64
- }
65
- }
66
- });
67
- }
68
- };
69
- exports.default = docutils;