@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.
- package/Readme.md +3 -0
- package/dist/core/Codebolt.d.ts +212 -165
- package/dist/core/Codebolt.js +267 -6
- package/dist/core/websocket.js +9 -11
- package/dist/index.d.ts +1 -1
- package/dist/modules/agent.d.ts +2 -16
- package/dist/modules/agent.js +15 -33
- package/dist/modules/browser.d.ts +1 -1
- package/dist/modules/browser.js +52 -51
- package/dist/modules/chat.d.ts +2 -2
- package/dist/modules/chat.js +20 -18
- package/dist/modules/codeutils.d.ts +1 -9
- package/dist/modules/codeutils.js +13 -111
- package/dist/modules/dbmemory.d.ts +3 -3
- package/dist/modules/dbmemory.js +8 -7
- package/dist/modules/debug.d.ts +1 -1
- package/dist/modules/fs.d.ts +59 -28
- package/dist/modules/fs.js +86 -45
- package/dist/modules/git.d.ts +1 -1
- package/dist/modules/git.js +31 -30
- package/dist/modules/history.d.ts +1 -1
- package/dist/modules/history.js +7 -6
- package/dist/modules/llm.d.ts +13 -20
- package/dist/modules/llm.js +16 -15
- package/dist/modules/mcp.d.ts +4 -4
- package/dist/modules/mcp.js +25 -25
- package/dist/modules/outputparsers.d.ts +22 -22
- package/dist/modules/outputparsers.js +7 -5
- package/dist/modules/project.d.ts +1 -1
- package/dist/modules/project.js +15 -13
- package/dist/modules/state.d.ts +1 -1
- package/dist/modules/state.js +16 -15
- package/dist/modules/task.d.ts +136 -92
- package/dist/modules/task.js +354 -205
- package/dist/modules/terminal.d.ts +1 -1
- package/dist/modules/terminal.js +12 -11
- package/dist/modules/tokenizer.d.ts +1 -1
- package/dist/modules/tokenizer.js +7 -6
- package/dist/modules/user-message-manager.d.ts +165 -0
- package/dist/modules/user-message-manager.js +308 -0
- package/dist/modules/user-message-utilities.d.ts +111 -0
- package/dist/modules/user-message-utilities.js +115 -0
- package/dist/modules/utils.d.ts +1 -1
- package/dist/modules/utils.js +4 -3
- package/dist/modules/vectordb.d.ts +1 -1
- package/dist/modules/vectordb.js +13 -12
- package/dist/notificationfunctions/agent.js +7 -6
- package/dist/notificationfunctions/browser.js +9 -8
- package/dist/notificationfunctions/chat.js +9 -8
- package/dist/notificationfunctions/codeutils.js +9 -8
- package/dist/notificationfunctions/crawler.js +9 -8
- package/dist/notificationfunctions/dbmemory.js +9 -8
- package/dist/notificationfunctions/fs.js +45 -44
- package/dist/notificationfunctions/git.d.ts +2 -2
- package/dist/notificationfunctions/git.js +111 -51
- package/dist/notificationfunctions/history.js +9 -8
- package/dist/notificationfunctions/llm.js +9 -8
- package/dist/notificationfunctions/mcp.js +17 -16
- package/dist/notificationfunctions/search.js +13 -12
- package/dist/notificationfunctions/system.js +5 -4
- package/dist/notificationfunctions/terminal.js +5 -4
- package/dist/notificationfunctions/todo.js +13 -12
- package/dist/types/commonTypes.d.ts +4 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/libFunctionTypes.d.ts +918 -29
- package/dist/types/libFunctionTypes.js +33 -0
- package/dist/types/notificationFunctions/git.d.ts +40 -1
- package/dist/types/notificationFunctions/index.d.ts +1 -0
- package/dist/types/notificationFunctions/index.js +1 -0
- package/package.json +17 -25
- package/dist/modules/codeparsers.d.ts +0 -37
- package/dist/modules/codeparsers.js +0 -329
package/dist/modules/task.d.ts
CHANGED
|
@@ -1,138 +1,182 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CreateTaskOptions, UpdateTaskOptions, GetTaskListOptions, AddStepToTaskOptions, GetTaskDetailOptions, GetTaskMessagesOptions, SendSteeringMessageOptions, GetAllStepsOptions, GetActiveStepOptions, UpdateStepStatusOptions, CompleteStepOptions, DeleteTaskOptions, CompleteTaskOptions, StartTaskOptions, CanTaskStartOptions, GetTasksDependentOnOptions, GetTasksReadyToStartOptions, GetTaskDependencyChainOptions, GetTaskStatsOptions, MessageData, Position, FlowData, Step } from '@codebolt/types/agent-to-app-ws-schema';
|
|
2
|
+
import type { TaskResponse, TaskListResponse, StepResponse, StepListResponse, TaskMessagesResponse, ActiveStepResponse, SendSteeringMessageResponse, DeleteTaskResponse, CanTaskStartResponse, TaskStatsResponse, CreateTaskResponse, GetTaskListResponse, AddStepToTaskResponse, GetTaskDetailResponse, GetTaskMessagesResponse, GetAllStepsResponse, GetCurrentRunningStepResponse, UpdateStepStatusResponse, CompleteStepResponse, UpdateTaskResponse, CompleteTaskResponse, StartTaskResponse, GetTasksDependentOnResponse, GetTasksReadyToStartResponse, GetTaskDependencyChainResponse, GetTaskStatsResponse, Task, ExtendedTask, ExtendedStep, TaskMessage, TaskStats, TaskResponseMessageData as ResponseMessageData } from '@codebolt/types/app-to-agent-ws-schema';
|
|
3
|
+
import type { Task as LegacyTask, SubTask as LegacySubTask, TaskResponse as LegacyTaskResponse, TaskCreateOptions as LegacyTaskCreateOptions, TaskUpdateOptions as LegacyTaskUpdateOptions, AddSubTaskOptions, UpdateSubTaskOptions, TaskFilterOptions, TaskMarkdownImportOptions, TaskMarkdownExportOptions } from '../types';
|
|
2
4
|
/**
|
|
3
|
-
* Enhanced task
|
|
5
|
+
* Enhanced task service with comprehensive task and step management.
|
|
6
|
+
* This module provides a modern API for task management based on the new task service schemas.
|
|
4
7
|
*/
|
|
5
|
-
declare const
|
|
8
|
+
declare const taskService: {
|
|
6
9
|
/**
|
|
7
|
-
*
|
|
8
|
-
* @param {
|
|
9
|
-
* @returns {Promise<
|
|
10
|
+
* Creates a new task with comprehensive options.
|
|
11
|
+
* @param {CreateTaskOptions} options - The task creation parameters
|
|
12
|
+
* @returns {Promise<CreateTaskResponse>} A promise that resolves with the task creation response
|
|
10
13
|
*/
|
|
11
|
-
|
|
14
|
+
createTask: (options: CreateTaskOptions) => Promise<CreateTaskResponse>;
|
|
12
15
|
/**
|
|
13
|
-
*
|
|
14
|
-
* @param {string}
|
|
15
|
-
* @param {string}
|
|
16
|
-
* @returns {Promise<
|
|
16
|
+
* Creates a simple task with minimal parameters (legacy compatibility).
|
|
17
|
+
* @param {string} taskName - The task name
|
|
18
|
+
* @param {string} threadId - The thread ID (defaults to 'default-thread')
|
|
19
|
+
* @returns {Promise<CreateTaskResponse>} A promise that resolves with the task creation response
|
|
17
20
|
*/
|
|
18
|
-
|
|
21
|
+
createSimpleTask: (taskName: string, threadId?: string) => Promise<CreateTaskResponse>;
|
|
19
22
|
/**
|
|
20
|
-
* Retrieves
|
|
21
|
-
* @param {
|
|
22
|
-
* @returns {Promise<
|
|
23
|
+
* Retrieves a list of tasks with optional filtering.
|
|
24
|
+
* @param {GetTaskListOptions} options - Optional filters for tasks
|
|
25
|
+
* @returns {Promise<GetTaskListResponse>} A promise that resolves with the task list response
|
|
23
26
|
*/
|
|
24
|
-
|
|
27
|
+
getTaskList: (options?: GetTaskListOptions) => Promise<GetTaskListResponse>;
|
|
25
28
|
/**
|
|
26
|
-
* Retrieves
|
|
27
|
-
* @param {
|
|
28
|
-
* @returns {Promise<
|
|
29
|
+
* Retrieves detailed information about a specific task.
|
|
30
|
+
* @param {GetTaskDetailOptions} options - The task detail options
|
|
31
|
+
* @returns {Promise<GetTaskDetailResponse>} A promise that resolves with the task detail response
|
|
29
32
|
*/
|
|
30
|
-
|
|
33
|
+
getTaskDetail: (options: GetTaskDetailOptions) => Promise<GetTaskDetailResponse>;
|
|
31
34
|
/**
|
|
32
|
-
*
|
|
33
|
-
* @param {
|
|
34
|
-
* @returns {Promise<
|
|
35
|
+
* Adds a step to an existing task.
|
|
36
|
+
* @param {AddStepToTaskOptions} options - The step addition options
|
|
37
|
+
* @returns {Promise<AddStepToTaskResponse>} A promise that resolves with the step addition response
|
|
35
38
|
*/
|
|
36
|
-
|
|
39
|
+
addStepToTask: (options: AddStepToTaskOptions) => Promise<AddStepToTaskResponse>;
|
|
37
40
|
/**
|
|
38
|
-
* Retrieves
|
|
39
|
-
* @
|
|
41
|
+
* Retrieves messages for a specific task.
|
|
42
|
+
* @param {GetTaskMessagesOptions} options - The task messages options
|
|
43
|
+
* @returns {Promise<GetTaskMessagesResponse>} A promise that resolves with the task messages response
|
|
40
44
|
*/
|
|
41
|
-
|
|
45
|
+
getTaskMessages: (options: GetTaskMessagesOptions) => Promise<GetTaskMessagesResponse>;
|
|
42
46
|
/**
|
|
43
47
|
* Updates an existing task.
|
|
44
|
-
* @param {
|
|
45
|
-
* @
|
|
48
|
+
* @param {string} taskId - The task ID to update
|
|
49
|
+
* @param {UpdateTaskOptions} updates - The task update parameters
|
|
50
|
+
* @returns {Promise<UpdateTaskResponse>} A promise that resolves with the task update response
|
|
46
51
|
*/
|
|
47
|
-
updateTask: (
|
|
52
|
+
updateTask: (taskId: string, updates: UpdateTaskOptions) => Promise<UpdateTaskResponse>;
|
|
48
53
|
/**
|
|
49
|
-
* Updates
|
|
50
|
-
* @param {string} taskId - The task ID
|
|
51
|
-
* @param {string}
|
|
52
|
-
* @returns {Promise<
|
|
54
|
+
* Updates a task with simple name change (legacy compatibility).
|
|
55
|
+
* @param {string} taskId - The task ID
|
|
56
|
+
* @param {string} taskName - The new task name
|
|
57
|
+
* @returns {Promise<UpdateTaskResponse>} A promise that resolves with the task update response
|
|
53
58
|
*/
|
|
54
|
-
updateSimpleTask: (taskId: string,
|
|
59
|
+
updateSimpleTask: (taskId: string, taskName: string) => Promise<UpdateTaskResponse>;
|
|
55
60
|
/**
|
|
56
61
|
* Deletes a task.
|
|
57
|
-
* @param {string} taskId - The task ID to delete
|
|
58
|
-
* @returns {Promise<
|
|
62
|
+
* @param {string} taskId - The task ID to delete
|
|
63
|
+
* @returns {Promise<DeleteTaskResponse>} A promise that resolves with the task deletion response
|
|
59
64
|
*/
|
|
60
|
-
deleteTask: (taskId: string) => Promise<
|
|
65
|
+
deleteTask: (taskId: string) => Promise<DeleteTaskResponse>;
|
|
61
66
|
/**
|
|
62
|
-
*
|
|
63
|
-
* @param {
|
|
64
|
-
* @returns {Promise<
|
|
67
|
+
* Completes a task.
|
|
68
|
+
* @param {string} taskId - The task ID to complete
|
|
69
|
+
* @returns {Promise<CompleteTaskResponse>} A promise that resolves with the task completion response
|
|
65
70
|
*/
|
|
66
|
-
|
|
71
|
+
completeTask: (taskId: string) => Promise<CompleteTaskResponse>;
|
|
67
72
|
/**
|
|
68
|
-
*
|
|
69
|
-
* @param {
|
|
70
|
-
* @returns {Promise<
|
|
73
|
+
* Starts a task.
|
|
74
|
+
* @param {string} taskId - The task ID to start
|
|
75
|
+
* @returns {Promise<StartTaskResponse>} A promise that resolves with the task start response
|
|
71
76
|
*/
|
|
72
|
-
|
|
77
|
+
startTask: (taskId: string) => Promise<StartTaskResponse>;
|
|
73
78
|
/**
|
|
74
|
-
*
|
|
75
|
-
* @param {
|
|
76
|
-
* @
|
|
77
|
-
* @returns {Promise<TaskResponse>} A promise that resolves with the response from the delete subtask event.
|
|
79
|
+
* Retrieves all steps with optional filtering.
|
|
80
|
+
* @param {GetAllStepsOptions} options - Optional filters for steps
|
|
81
|
+
* @returns {Promise<GetAllStepsResponse>} A promise that resolves with the steps response
|
|
78
82
|
*/
|
|
79
|
-
|
|
83
|
+
getAllSteps: (options?: GetAllStepsOptions) => Promise<GetAllStepsResponse>;
|
|
80
84
|
/**
|
|
81
|
-
*
|
|
82
|
-
* @param {
|
|
83
|
-
* @returns {Promise<
|
|
85
|
+
* Gets the currently running step for a task or agent.
|
|
86
|
+
* @param {GetActiveStepOptions} options - Options for getting active step
|
|
87
|
+
* @returns {Promise<GetCurrentRunningStepResponse>} A promise that resolves with the active step response
|
|
84
88
|
*/
|
|
85
|
-
|
|
89
|
+
getCurrentRunningStep: (options?: GetActiveStepOptions) => Promise<GetCurrentRunningStepResponse>;
|
|
86
90
|
/**
|
|
87
|
-
*
|
|
88
|
-
* @param {
|
|
89
|
-
* @returns {Promise<
|
|
91
|
+
* Updates the status of a specific step.
|
|
92
|
+
* @param {UpdateStepStatusOptions} options - The step status update options
|
|
93
|
+
* @returns {Promise<UpdateStepStatusResponse>} A promise that resolves with the step update response
|
|
90
94
|
*/
|
|
91
|
-
|
|
95
|
+
updateStepStatus: (options: UpdateStepStatusOptions) => Promise<UpdateStepStatusResponse>;
|
|
92
96
|
/**
|
|
93
|
-
*
|
|
94
|
-
* @param {
|
|
95
|
-
* @
|
|
96
|
-
|
|
97
|
+
* Completes a specific step.
|
|
98
|
+
* @param {CompleteStepOptions} options - The step completion options
|
|
99
|
+
* @returns {Promise<CompleteStepResponse>} A promise that resolves with the step completion response
|
|
100
|
+
*/
|
|
101
|
+
completeStep: (options: CompleteStepOptions) => Promise<CompleteStepResponse>;
|
|
102
|
+
/**
|
|
103
|
+
* Sends a steering message to a running step.
|
|
104
|
+
* @param {SendSteeringMessageOptions} options - The steering message options
|
|
105
|
+
* @returns {Promise<SendSteeringMessageResponse>} A promise that resolves with the steering message response
|
|
106
|
+
*/
|
|
107
|
+
sendSteeringMessage: (options: SendSteeringMessageOptions) => Promise<SendSteeringMessageResponse>;
|
|
108
|
+
/**
|
|
109
|
+
* Checks if a task can start based on its dependencies.
|
|
110
|
+
* @param {string} taskId - The task ID to check
|
|
111
|
+
* @returns {Promise<CanTaskStartResponse>} A promise that resolves with the task start capability response
|
|
97
112
|
*/
|
|
98
|
-
|
|
113
|
+
canTaskStart: (taskId: string) => Promise<CanTaskStartResponse>;
|
|
99
114
|
/**
|
|
100
|
-
*
|
|
101
|
-
* @param {string} taskId - The
|
|
102
|
-
* @
|
|
103
|
-
* @param {boolean} completed - The new completion status.
|
|
104
|
-
* @returns {Promise<TaskResponse>} A promise that resolves with the response from the update subtask event.
|
|
115
|
+
* Gets tasks that depend on a specific task.
|
|
116
|
+
* @param {string} taskId - The task ID to check dependencies for
|
|
117
|
+
* @returns {Promise<GetTasksDependentOnResponse>} A promise that resolves with the dependent tasks response
|
|
105
118
|
*/
|
|
106
|
-
|
|
119
|
+
getTasksDependentOn: (taskId: string) => Promise<GetTasksDependentOnResponse>;
|
|
107
120
|
/**
|
|
108
|
-
*
|
|
109
|
-
* @param {
|
|
110
|
-
* @
|
|
111
|
-
* @returns {Promise<TaskResponse>} A promise that resolves with the response from the update task event.
|
|
121
|
+
* Gets tasks that are ready to start.
|
|
122
|
+
* @param {GetTasksReadyToStartOptions} options - Optional filters for ready tasks
|
|
123
|
+
* @returns {Promise<GetTasksReadyToStartResponse>} A promise that resolves with the ready tasks response
|
|
112
124
|
*/
|
|
113
|
-
|
|
125
|
+
getTasksReadyToStart: (options?: GetTasksReadyToStartOptions) => Promise<GetTasksReadyToStartResponse>;
|
|
114
126
|
/**
|
|
115
|
-
*
|
|
116
|
-
* @param {string} taskId - The task ID
|
|
117
|
-
* @
|
|
118
|
-
* @returns {Promise<TaskResponse>} A promise that resolves with the response from the update task event.
|
|
127
|
+
* Gets the dependency chain for a specific task.
|
|
128
|
+
* @param {string} taskId - The task ID to get dependency chain for
|
|
129
|
+
* @returns {Promise<GetTaskDependencyChainResponse>} A promise that resolves with the dependency chain response
|
|
119
130
|
*/
|
|
120
|
-
|
|
131
|
+
getTaskDependencyChain: (taskId: string) => Promise<GetTaskDependencyChainResponse>;
|
|
121
132
|
/**
|
|
122
|
-
*
|
|
123
|
-
* @param {
|
|
124
|
-
* @
|
|
125
|
-
* @returns {Promise<TaskResponse>} A promise that resolves with the response from the update task event.
|
|
133
|
+
* Gets task statistics.
|
|
134
|
+
* @param {GetTaskStatsOptions} options - Optional filters for task stats
|
|
135
|
+
* @returns {Promise<GetTaskStatsResponse>} A promise that resolves with the task stats response
|
|
126
136
|
*/
|
|
127
|
-
|
|
137
|
+
getTaskStats: (options?: GetTaskStatsOptions) => Promise<GetTaskStatsResponse>;
|
|
138
|
+
/**
|
|
139
|
+
* Utility function to toggle task completion status.
|
|
140
|
+
* @param {string} taskId - The task ID
|
|
141
|
+
* @param {boolean} completed - The new completion status
|
|
142
|
+
* @returns {Promise<UpdateTaskResponse>} A promise that resolves with the task update response
|
|
143
|
+
*/
|
|
144
|
+
toggleTaskCompletion: (taskId: string, completed: boolean) => Promise<UpdateTaskResponse>;
|
|
128
145
|
/**
|
|
129
146
|
* Utility function to create a quick task with minimal parameters.
|
|
130
|
-
* @param {string}
|
|
131
|
-
* @param {string}
|
|
132
|
-
* @
|
|
133
|
-
|
|
147
|
+
* @param {string} name - The task name
|
|
148
|
+
* @param {string} threadId - The thread ID (defaults to 'default-thread')
|
|
149
|
+
* @returns {Promise<CreateTaskResponse>} A promise that resolves with the task creation response
|
|
150
|
+
*/
|
|
151
|
+
createQuickTask: (name: string, threadId?: string) => Promise<CreateTaskResponse>;
|
|
152
|
+
/**
|
|
153
|
+
* Gets tasks started by a specific user
|
|
154
|
+
* @param {string} userId - The user ID
|
|
155
|
+
* @param {GetTaskListOptions} options - Optional filters for tasks
|
|
156
|
+
* @returns {Promise<GetTaskListResponse>} A promise that resolves with the task list response
|
|
157
|
+
*/
|
|
158
|
+
getTasksStartedByMe: (userId: string, options?: GetTaskListOptions) => Promise<GetTaskListResponse>;
|
|
159
|
+
/**
|
|
160
|
+
* Legacy function: Adds a task (mapped to createTask)
|
|
161
|
+
* @deprecated Use createTask instead
|
|
162
|
+
*/
|
|
163
|
+
addTask: (params: LegacyTaskCreateOptions) => Promise<CreateTaskResponse>;
|
|
164
|
+
/**
|
|
165
|
+
* Legacy function: Gets tasks (mapped to getTaskList)
|
|
166
|
+
* @deprecated Use getTaskList instead
|
|
167
|
+
*/
|
|
168
|
+
getTasks: (filters?: TaskFilterOptions) => Promise<GetTaskListResponse>;
|
|
169
|
+
/**
|
|
170
|
+
* Legacy function: Gets tasks by agent (mapped to getTaskList with threadId filter)
|
|
171
|
+
* @deprecated Use getTaskList with threadId filter instead
|
|
172
|
+
*/
|
|
173
|
+
getTasksByAgent: (agentId: string) => Promise<GetTaskListResponse>;
|
|
174
|
+
/**
|
|
175
|
+
* Legacy function: Gets tasks by category (use getTaskList with custom filtering)
|
|
176
|
+
* @deprecated Use getTaskList instead
|
|
134
177
|
*/
|
|
135
|
-
|
|
178
|
+
getTasksByCategory: (category: string) => Promise<GetTaskListResponse>;
|
|
136
179
|
};
|
|
137
|
-
export type { Task,
|
|
138
|
-
export
|
|
180
|
+
export type { Task, ExtendedTask, Step, ExtendedStep, TaskMessage, MessageData, ResponseMessageData, TaskStats, CreateTaskOptions, UpdateTaskOptions, GetTaskListOptions, AddStepToTaskOptions, GetTaskDetailOptions, GetTaskMessagesOptions, UpdateStepStatusOptions, CompleteStepOptions, SendSteeringMessageOptions, GetAllStepsOptions, GetActiveStepOptions, DeleteTaskOptions, CompleteTaskOptions, StartTaskOptions, CanTaskStartOptions, GetTasksDependentOnOptions, GetTasksReadyToStartOptions, GetTaskDependencyChainOptions, GetTaskStatsOptions, TaskResponse, TaskListResponse, StepResponse, StepListResponse, TaskMessagesResponse, ActiveStepResponse, SendSteeringMessageResponse, DeleteTaskResponse, CanTaskStartResponse, TaskStatsResponse, CreateTaskResponse, GetTaskListResponse, AddStepToTaskResponse, GetTaskDetailResponse, GetTaskMessagesResponse, GetAllStepsResponse, GetCurrentRunningStepResponse, UpdateStepStatusResponse, CompleteStepResponse, UpdateTaskResponse, CompleteTaskResponse, StartTaskResponse, GetTasksDependentOnResponse, GetTasksReadyToStartResponse, GetTaskDependencyChainResponse, GetTaskStatsResponse, Position, FlowData };
|
|
181
|
+
export type { LegacyTask as Task_Legacy, LegacySubTask as SubTask, LegacyTaskResponse as TaskResponse_Legacy, LegacyTaskCreateOptions as TaskCreateOptions_Legacy, LegacyTaskUpdateOptions as TaskUpdateOptions_Legacy, AddSubTaskOptions, UpdateSubTaskOptions, TaskFilterOptions, TaskMarkdownImportOptions, TaskMarkdownExportOptions };
|
|
182
|
+
export default taskService;
|