@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.
Files changed (125) hide show
  1. package/dist/agentlib/agent.js +3 -7
  2. package/dist/agentlib/followupquestionbuilder.d.ts +75 -0
  3. package/dist/agentlib/followupquestionbuilder.js +193 -0
  4. package/dist/agentlib/llmoutputhandler.d.ts +102 -0
  5. package/dist/agentlib/llmoutputhandler.js +451 -0
  6. package/dist/agentlib/promptbuilder.d.ts +171 -17
  7. package/dist/agentlib/promptbuilder.js +367 -49
  8. package/dist/agentlib/systemprompt.js +3 -3
  9. package/dist/agentlib/usermessage.d.ts +1 -1
  10. package/dist/agentlib/usermessage.js +5 -1
  11. package/dist/core/Codebolt.d.ts +52 -20
  12. package/dist/core/Codebolt.js +43 -1
  13. package/dist/core/websocket.js +2 -1
  14. package/dist/modules/llm.d.ts +23 -3
  15. package/dist/modules/llm.js +20 -3
  16. package/dist/modules/project.d.ts +3 -3
  17. package/dist/modules/project.js +1 -1
  18. package/dist/modules/state.d.ts +5 -3
  19. package/dist/modules/state.js +2 -0
  20. package/dist/modules/task.d.ts +126 -11
  21. package/dist/modules/task.js +262 -20
  22. package/dist/notificationfunctions/agent.d.ts +48 -0
  23. package/dist/notificationfunctions/agent.js +115 -0
  24. package/dist/notificationfunctions/browser.d.ts +60 -0
  25. package/dist/notificationfunctions/browser.js +145 -0
  26. package/dist/notificationfunctions/chat.d.ts +53 -0
  27. package/dist/notificationfunctions/chat.js +125 -0
  28. package/dist/notificationfunctions/codeutils.d.ts +60 -0
  29. package/dist/notificationfunctions/codeutils.js +145 -0
  30. package/dist/notificationfunctions/crawler.d.ts +59 -0
  31. package/dist/notificationfunctions/crawler.js +159 -0
  32. package/dist/notificationfunctions/dbmemory.d.ts +50 -0
  33. package/dist/notificationfunctions/dbmemory.js +132 -0
  34. package/dist/notificationfunctions/fs.d.ts +125 -0
  35. package/dist/notificationfunctions/fs.js +472 -0
  36. package/dist/notificationfunctions/git.d.ts +174 -0
  37. package/dist/notificationfunctions/git.js +521 -0
  38. package/dist/notificationfunctions/history.d.ts +38 -0
  39. package/dist/notificationfunctions/history.js +97 -0
  40. package/dist/notificationfunctions/index.d.ts +79 -0
  41. package/dist/notificationfunctions/index.js +102 -0
  42. package/dist/notificationfunctions/llm.d.ts +39 -0
  43. package/dist/notificationfunctions/llm.js +99 -0
  44. package/dist/notificationfunctions/mcp.d.ts +67 -0
  45. package/dist/notificationfunctions/mcp.js +192 -0
  46. package/dist/notificationfunctions/search.d.ts +50 -0
  47. package/dist/notificationfunctions/search.js +146 -0
  48. package/dist/notificationfunctions/system.d.ts +25 -0
  49. package/dist/notificationfunctions/system.js +59 -0
  50. package/dist/notificationfunctions/terminal.d.ts +26 -0
  51. package/dist/notificationfunctions/terminal.js +64 -0
  52. package/dist/notificationfunctions/todo.d.ts +63 -0
  53. package/dist/notificationfunctions/todo.js +164 -0
  54. package/dist/notificationfunctions/utils.d.ts +81 -0
  55. package/dist/notificationfunctions/utils.js +177 -0
  56. package/dist/types/InternalTypes.d.ts +1 -0
  57. package/dist/types/commonTypes.d.ts +26 -3
  58. package/dist/types/index.d.ts +2 -2
  59. package/dist/types/libFunctionTypes.d.ts +80 -3
  60. package/dist/types/notificationFunctions/agent.d.ts +8 -0
  61. package/dist/types/notificationFunctions/agent.js +2 -0
  62. package/dist/types/notificationFunctions/browser.d.ts +10 -0
  63. package/dist/types/notificationFunctions/browser.js +2 -0
  64. package/dist/types/notificationFunctions/chat.d.ts +10 -0
  65. package/dist/types/notificationFunctions/chat.js +2 -0
  66. package/dist/types/notificationFunctions/codeutils.d.ts +10 -0
  67. package/dist/types/notificationFunctions/codeutils.js +2 -0
  68. package/dist/types/notificationFunctions/crawler.d.ts +10 -0
  69. package/dist/types/notificationFunctions/crawler.js +2 -0
  70. package/dist/types/notificationFunctions/dbmemory.d.ts +9 -0
  71. package/dist/types/notificationFunctions/dbmemory.js +2 -0
  72. package/dist/types/notificationFunctions/fs.d.ts +27 -0
  73. package/dist/types/notificationFunctions/fs.js +2 -0
  74. package/dist/types/notificationFunctions/git.d.ts +29 -0
  75. package/dist/types/notificationFunctions/git.js +2 -0
  76. package/dist/types/notificationFunctions/history.d.ts +10 -0
  77. package/dist/types/notificationFunctions/history.js +2 -0
  78. package/dist/types/notificationFunctions/index.d.ts +0 -0
  79. package/dist/types/notificationFunctions/index.js +1 -0
  80. package/dist/types/notificationFunctions/llm.d.ts +10 -0
  81. package/dist/types/notificationFunctions/llm.js +2 -0
  82. package/dist/types/notificationFunctions/mcp.d.ts +16 -0
  83. package/dist/types/notificationFunctions/mcp.js +2 -0
  84. package/dist/types/notificationFunctions/search.d.ts +11 -0
  85. package/dist/types/notificationFunctions/search.js +2 -0
  86. package/dist/types/notificationFunctions/system.d.ts +7 -0
  87. package/dist/types/notificationFunctions/system.js +2 -0
  88. package/dist/types/notificationFunctions/terminal.d.ts +7 -0
  89. package/dist/types/notificationFunctions/terminal.js +2 -0
  90. package/dist/types/notificationFunctions/todo.d.ts +11 -0
  91. package/dist/types/notificationFunctions/todo.js +2 -0
  92. package/dist/types/notifications/agent.d.ts +31 -0
  93. package/dist/types/notifications/agent.js +3 -0
  94. package/dist/types/notifications/browser.d.ts +53 -0
  95. package/dist/types/notifications/browser.js +3 -0
  96. package/dist/types/notifications/chat.d.ts +37 -0
  97. package/dist/types/notifications/chat.js +3 -0
  98. package/dist/types/notifications/codeutils.d.ts +55 -0
  99. package/dist/types/notifications/codeutils.js +3 -0
  100. package/dist/types/notifications/crawler.d.ts +55 -0
  101. package/dist/types/notifications/crawler.js +3 -0
  102. package/dist/types/notifications/dbmemory.d.ts +31 -0
  103. package/dist/types/notifications/dbmemory.js +3 -0
  104. package/dist/types/notifications/fs.d.ts +180 -0
  105. package/dist/types/notifications/fs.js +3 -0
  106. package/dist/types/notifications/git.d.ts +205 -0
  107. package/dist/types/notifications/git.js +3 -0
  108. package/dist/types/notifications/history.d.ts +32 -0
  109. package/dist/types/notifications/history.js +3 -0
  110. package/dist/types/notifications/llm.d.ts +45 -0
  111. package/dist/types/notifications/llm.js +2 -0
  112. package/dist/types/notifications/mcp.d.ts +63 -0
  113. package/dist/types/notifications/mcp.js +3 -0
  114. package/dist/types/notifications/search.d.ts +47 -0
  115. package/dist/types/notifications/search.js +3 -0
  116. package/dist/types/notifications/system.d.ts +20 -0
  117. package/dist/types/notifications/system.js +2 -0
  118. package/dist/types/notifications/terminal.d.ts +17 -0
  119. package/dist/types/notifications/terminal.js +2 -0
  120. package/dist/types/notifications/todo.d.ts +60 -0
  121. package/dist/types/notifications/todo.js +3 -0
  122. package/dist/types/socketMessageTypes.d.ts +3 -0
  123. package/dist/utils.d.ts +3 -0
  124. package/dist/utils.js +7 -1
  125. package/package.json +1 -1
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // ===== GIT NOTIFICATIONS =====
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,32 @@
1
+ export type SummarizePreviousConversationRequestNotification = {
2
+ toolUseId: string;
3
+ type: "historynotify";
4
+ action: "summarizeAllRequest";
5
+ data: {};
6
+ };
7
+ export type SummarizePreviousConversationResultNotification = {
8
+ toolUseId: string;
9
+ type: "historynotify";
10
+ action: "summarizeAllResult";
11
+ content: string | any;
12
+ isError?: boolean;
13
+ };
14
+ export type SummarizeCurentMessageRequestNotification = {
15
+ toolUseId: string;
16
+ type: "historynotify";
17
+ action: "summarizeRequest";
18
+ data: {
19
+ messages: {
20
+ role: string;
21
+ content: string;
22
+ }[];
23
+ depth: number;
24
+ };
25
+ };
26
+ export type SummarizeCurrentMessageResultNotification = {
27
+ toolUseId: string;
28
+ type: "historynotify";
29
+ action: "summarizeResult";
30
+ content: string | any;
31
+ isError?: boolean;
32
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // ===== HISTORY NOTIFICATIONS =====
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,45 @@
1
+ export type LLMRequestNotification = {
2
+ toolUseId: string;
3
+ type: "llmnotify";
4
+ action: "inferenceRequest";
5
+ data: {
6
+ messages?: any[];
7
+ tools?: any[];
8
+ tool_choice?: string;
9
+ full?: boolean;
10
+ llmrole?: string;
11
+ max_tokens?: number;
12
+ temperature?: number;
13
+ stream?: boolean;
14
+ prompt?: string;
15
+ };
16
+ };
17
+ export type LLMResponseNotification = {
18
+ toolUseId: string;
19
+ type: "llmnotify";
20
+ action: "inferenceResult";
21
+ content: string | any;
22
+ isError?: boolean;
23
+ };
24
+ export type LLMGetTokenCountRequestNotification = {
25
+ toolUseId: string;
26
+ type: "llmnotify";
27
+ action: "getTokenCountRequest";
28
+ data: {
29
+ text: string;
30
+ model?: string;
31
+ encoding?: string;
32
+ };
33
+ };
34
+ export type LLMGetTokenCountResponseNotification = {
35
+ toolUseId: string;
36
+ type: "llmnotify";
37
+ action: "getTokenCountResult";
38
+ content: string | any;
39
+ isError?: boolean;
40
+ data?: {
41
+ tokenCount: number;
42
+ model?: string;
43
+ encoding?: string;
44
+ };
45
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,63 @@
1
+ export type GetEnabledMCPServersRequestNotification = {
2
+ toolUseId: string;
3
+ type: "mcpnotify";
4
+ action: "getEnabledMCPServersRequest";
5
+ data: {};
6
+ };
7
+ export type GetEnabledMCPServersResultNotification = {
8
+ toolUseId: string;
9
+ type: "mcpnotify";
10
+ action: "getEnabledMCPServersResult";
11
+ content: string | any;
12
+ isError?: boolean;
13
+ };
14
+ export type ListToolsFromMCPServersRequestNotification = {
15
+ toolUseId: string;
16
+ type: "mcpnotify";
17
+ action: "listToolsFromMCPServersRequest";
18
+ data: {
19
+ toolboxes: string[];
20
+ };
21
+ };
22
+ export type ListToolsFromMCPServersResultNotification = {
23
+ toolUseId: string;
24
+ type: "mcpnotify";
25
+ action: "listToolsFromMCPServersResult";
26
+ content: string | any;
27
+ isError?: boolean;
28
+ };
29
+ export type GetToolsRequestNotification = {
30
+ toolUseId: string;
31
+ type: "mcpnotify";
32
+ action: "getToolsRequest";
33
+ data: {
34
+ tools: {
35
+ toolbox: string;
36
+ toolName: string;
37
+ }[];
38
+ };
39
+ };
40
+ export type GetToolsResultNotification = {
41
+ toolUseId: string;
42
+ type: "mcpnotify";
43
+ action: "getToolsResult";
44
+ content: string | any;
45
+ isError?: boolean;
46
+ };
47
+ export type ExecuteToolRequestNotification = {
48
+ toolUseId: string;
49
+ type: "mcpnotify";
50
+ action: "executeToolRequest";
51
+ data: {
52
+ toolbox: string;
53
+ toolName: string;
54
+ params: any;
55
+ };
56
+ };
57
+ export type ExecuteToolResultNotification = {
58
+ toolUseId: string;
59
+ type: "mcpnotify";
60
+ action: "executeToolResult";
61
+ content: string | any;
62
+ isError?: boolean;
63
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // ===== MCP NOTIFICATIONS =====
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,47 @@
1
+ export type SearchInitRequest = {
2
+ toolUseId: string;
3
+ type: "searchnotify";
4
+ action: "searchInitRequest";
5
+ data: {
6
+ engine?: string;
7
+ };
8
+ };
9
+ export type SearchRequest = {
10
+ toolUseId: string;
11
+ type: "searchnotify";
12
+ action: "searchRequest";
13
+ data: {
14
+ query: string;
15
+ };
16
+ };
17
+ export type GetFirstLinkRequest = {
18
+ toolUseId: string;
19
+ type: "searchnotify";
20
+ action: "getFirstLinkRequest";
21
+ data: {
22
+ query: string;
23
+ };
24
+ };
25
+ export type SearchInitResult = {
26
+ toolUseId: string;
27
+ type: "searchnotify";
28
+ action: "searchInitResult";
29
+ content: string | any;
30
+ isError?: boolean;
31
+ };
32
+ export type SearchResult = {
33
+ toolUseId: string;
34
+ type: "searchnotify";
35
+ action: "searchResult";
36
+ content: string | any;
37
+ isError?: boolean;
38
+ };
39
+ export type GetFirstLinkResult = {
40
+ toolUseId: string;
41
+ type: "searchnotify";
42
+ action: "getFirstLinkResult";
43
+ content: string | any;
44
+ isError?: boolean;
45
+ };
46
+ export type SearchNotification = SearchInitRequest | SearchRequest | GetFirstLinkRequest;
47
+ export type SearchResponseNotification = SearchInitResult | SearchResult | GetFirstLinkResult;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // ===== SEARCH NOTIFICATIONS =====
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,20 @@
1
+ export type agentInitNotification = {
2
+ toolUseId: string;
3
+ type: "chatnotify";
4
+ action: "processStartedRequest";
5
+ data: {
6
+ onStopClicked?: boolean;
7
+ };
8
+ };
9
+ export type agentCompletionNotification = {
10
+ toolUseId: string;
11
+ type: "chatnotify";
12
+ action: "processStoppedRequest";
13
+ data: {
14
+ sessionId?: string;
15
+ duration: string;
16
+ result: {
17
+ resultString: string;
18
+ };
19
+ };
20
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,17 @@
1
+ export type CommandExecutionRequestNotification = {
2
+ toolUseId: string;
3
+ type: "terminalnotify";
4
+ action: "executeCommandRequest";
5
+ data: {
6
+ command: string;
7
+ returnEmptyStringOnSuccess?: boolean;
8
+ executeInMain?: boolean;
9
+ };
10
+ };
11
+ export type CommandExecutionResponseNotification = {
12
+ toolUseId: string;
13
+ type: "terminalnotify";
14
+ action: "executeCommandResult";
15
+ content: string | any;
16
+ isError?: boolean;
17
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,60 @@
1
+ export type AddTodoRequestNotification = {
2
+ toolUseId: string;
3
+ type: "tasknotify";
4
+ action: "addTaskRequest";
5
+ data: {
6
+ title?: string;
7
+ agentId?: string;
8
+ description?: string;
9
+ phase?: string;
10
+ category?: string;
11
+ priority?: string;
12
+ tags?: string[];
13
+ };
14
+ };
15
+ export type AddTodoResponseNotification = {
16
+ toolUseId: string;
17
+ type: "tasknotify";
18
+ action: "addTaskResult";
19
+ content: string | any;
20
+ isError?: boolean;
21
+ };
22
+ export type GetTodoRequestNotification = {
23
+ toolUseId: string;
24
+ type: "tasknotify";
25
+ action: "getTasksRequest";
26
+ data: {
27
+ filters?: any;
28
+ };
29
+ };
30
+ export type GetTodoTasksResponseNotification = {
31
+ toolUseId: string;
32
+ type: "tasknotify";
33
+ action: "getTasksResult";
34
+ content: string | any;
35
+ isError?: boolean;
36
+ };
37
+ export type EditTodoTaskRequestNotification = {
38
+ toolUseId: string;
39
+ type: "tasknotify";
40
+ action: "updateTaskRequest";
41
+ data: {
42
+ taskId?: string;
43
+ title?: string;
44
+ description?: string;
45
+ phase?: string;
46
+ category?: string;
47
+ priority?: string;
48
+ tags?: string[];
49
+ status?: string;
50
+ };
51
+ };
52
+ export type EditTodoTaskResponseNotification = {
53
+ toolUseId: string;
54
+ type: "tasknotify";
55
+ action: "updateTaskResult";
56
+ content: string | any;
57
+ isError?: boolean;
58
+ };
59
+ export type TodoTaskNotification = AddTodoRequestNotification | GetTodoRequestNotification | EditTodoTaskRequestNotification;
60
+ export type TaskResponseNotification = AddTodoResponseNotification | GetTodoTasksResponseNotification | EditTodoTaskResponseNotification;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // ===== TASK NOTIFICATIONS =====
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -494,6 +494,7 @@ export interface MemoryClearResponse extends BaseWebSocketResponse {
494
494
  export interface AddTaskResponse extends BaseWebSocketResponse {
495
495
  type: 'addTaskResponse';
496
496
  task?: import('./commonTypes').Task;
497
+ data?: any;
497
498
  }
498
499
  export interface GetTasksResponse extends BaseWebSocketResponse {
499
500
  type: 'getTasksResponse';
@@ -679,6 +680,7 @@ export interface GetProjectPathResponse extends BaseWebSocketResponse {
679
680
  export interface GetProjectSettingsResponse extends BaseWebSocketResponse {
680
681
  type: 'getProjectSettingsResponse';
681
682
  projectSettings?: Record<string, any>;
683
+ data?: Record<string, any>;
682
684
  }
683
685
  export interface GetRepoMapResponse extends BaseWebSocketResponse {
684
686
  type: 'getRepoMapResponse';
@@ -687,6 +689,7 @@ export interface GetRepoMapResponse extends BaseWebSocketResponse {
687
689
  export interface GetProjectStateResponse extends BaseWebSocketResponse {
688
690
  type: 'getProjectStateResponse';
689
691
  projectState?: Record<string, any>;
692
+ data?: Record<string, any>;
690
693
  }
691
694
  export interface CrawlerResponse extends BaseWebSocketResponse {
692
695
  type: 'crawlerResponse';
package/dist/utils.d.ts CHANGED
@@ -3,4 +3,7 @@ export { TaskInstruction } from './agentlib/taskInstruction';
3
3
  export { UserMessage } from './agentlib/usermessage';
4
4
  export { SystemPrompt } from './agentlib/systemprompt';
5
5
  export { Agent } from './agentlib/agent';
6
+ export { InitialPromptBuilder } from './agentlib/promptbuilder';
7
+ export { LLMOutputHandler } from './agentlib/llmoutputhandler';
8
+ export { FollowUpPromptBuilder } from './agentlib/followupquestionbuilder';
6
9
  export { default as docutils } from './utils/docutils';
package/dist/utils.js CHANGED
@@ -3,7 +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
- exports.docutils = exports.Agent = exports.SystemPrompt = exports.UserMessage = exports.TaskInstruction = exports.MCPServer = void 0;
6
+ exports.docutils = exports.FollowUpPromptBuilder = exports.LLMOutputHandler = exports.InitialPromptBuilder = exports.Agent = exports.SystemPrompt = exports.UserMessage = exports.TaskInstruction = exports.MCPServer = void 0;
7
7
  var mcpServer_1 = require("./utils/mcpServer");
8
8
  Object.defineProperty(exports, "MCPServer", { enumerable: true, get: function () { return mcpServer_1.MCPServer; } });
9
9
  var taskInstruction_1 = require("./agentlib/taskInstruction");
@@ -14,5 +14,11 @@ var systemprompt_1 = require("./agentlib/systemprompt");
14
14
  Object.defineProperty(exports, "SystemPrompt", { enumerable: true, get: function () { return systemprompt_1.SystemPrompt; } });
15
15
  var agent_1 = require("./agentlib/agent");
16
16
  Object.defineProperty(exports, "Agent", { enumerable: true, get: function () { return agent_1.Agent; } });
17
+ var promptbuilder_1 = require("./agentlib/promptbuilder");
18
+ Object.defineProperty(exports, "InitialPromptBuilder", { enumerable: true, get: function () { return promptbuilder_1.InitialPromptBuilder; } });
19
+ var llmoutputhandler_1 = require("./agentlib/llmoutputhandler");
20
+ Object.defineProperty(exports, "LLMOutputHandler", { enumerable: true, get: function () { return llmoutputhandler_1.LLMOutputHandler; } });
21
+ var followupquestionbuilder_1 = require("./agentlib/followupquestionbuilder");
22
+ Object.defineProperty(exports, "FollowUpPromptBuilder", { enumerable: true, get: function () { return followupquestionbuilder_1.FollowUpPromptBuilder; } });
17
23
  var docutils_1 = require("./utils/docutils");
18
24
  Object.defineProperty(exports, "docutils", { enumerable: true, get: function () { return __importDefault(docutils_1).default; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebolt/codeboltjs",
3
- "version": "2.0.13",
3
+ "version": "2.0.15",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "author": "",