@codebolt/codeboltjs 2.2.2 → 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.
@@ -1,6 +1,7 @@
1
1
  import WebSocket from 'ws';
2
2
  import { type NotificationFunctions } from '../notificationfunctions';
3
3
  import type { FlatUserMessage } from '@codebolt/types/sdk';
4
+ import { RawMessageForAgent, ProviderInitVars } from '@codebolt/types/provider';
4
5
  /**
5
6
  * @class Codebolt
6
7
  * @description This class provides a unified interface to interact with various modules.
@@ -224,6 +225,36 @@ declare class Codebolt {
224
225
  getProjectState: () => Promise<import("@codebolt/types/sdk").GetProjectStateResponse>;
225
226
  updateProjectState: (key: string, value: any) => Promise<import("@codebolt/types/sdk").UpdateProjectStateResponse>;
226
227
  };
228
+ task: {
229
+ createTask: (options: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").CreateTaskOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").CreateTaskResponse>;
230
+ createSimpleTask: (taskName: string, threadId?: string) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").CreateTaskResponse>;
231
+ getTaskList: (options?: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").GetTaskListOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetTaskListResponse>;
232
+ getTaskDetail: (options: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").GetTaskDetailOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetTaskDetailResponse>;
233
+ addStepToTask: (options: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").AddStepToTaskOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").AddStepToTaskResponse>;
234
+ getTaskMessages: (options: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").GetTaskMessagesOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetTaskMessagesResponse>;
235
+ updateTask: (taskId: string, updates: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").UpdateTaskOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").UpdateTaskResponse>;
236
+ updateSimpleTask: (taskId: string, taskName: string) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").UpdateTaskResponse>;
237
+ deleteTask: (taskId: string) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").DeleteTaskResponse>;
238
+ completeTask: (taskId: string) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").CompleteTaskResponse>;
239
+ startTask: (taskId: string) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").StartTaskResponse>;
240
+ getAllSteps: (options?: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").GetAllStepsOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetAllStepsResponse>;
241
+ getCurrentRunningStep: (options?: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").GetActiveStepOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetCurrentRunningStepResponse>;
242
+ updateStepStatus: (options: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").UpdateStepStatusOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").UpdateStepStatusResponse>;
243
+ completeStep: (options: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").CompleteStepOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").CompleteStepResponse>;
244
+ sendSteeringMessage: (options: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").SendSteeringMessageOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").SendSteeringMessageResponse>;
245
+ canTaskStart: (taskId: string) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").CanTaskStartResponse>;
246
+ getTasksDependentOn: (taskId: string) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetTasksDependentOnResponse>;
247
+ getTasksReadyToStart: (options?: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").GetTasksReadyToStartOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetTasksReadyToStartResponse>;
248
+ getTaskDependencyChain: (taskId: string) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetTaskDependencyChainResponse>;
249
+ getTaskStats: (options?: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").GetTaskStatsOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetTaskStatsResponse>;
250
+ toggleTaskCompletion: (taskId: string, completed: boolean) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").UpdateTaskResponse>;
251
+ createQuickTask: (name: string, threadId?: string) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").CreateTaskResponse>;
252
+ getTasksStartedByMe: (userId: string, options?: import("node_modules/@codebolt/types/dist/wstypes/agent-to-app-ws/actions/taskEventSchemas").GetTaskListOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetTaskListResponse>;
253
+ addTask: (params: import("../types/libFunctionTypes").TaskCreateOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").CreateTaskResponse>;
254
+ getTasks: (filters?: import("../types/libFunctionTypes").TaskFilterOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetTaskListResponse>;
255
+ getTasksByAgent: (agentId: string) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetTaskListResponse>;
256
+ getTasksByCategory: (category: string) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetTaskListResponse>;
257
+ };
227
258
  vectordb: {
228
259
  getVector: (key: string) => Promise<import("@codebolt/types/sdk").GetVectorResponse>;
229
260
  addVectorItem: (item: any) => Promise<import("@codebolt/types/sdk").AddVectorItemResponse>;
@@ -306,22 +337,25 @@ declare class Codebolt {
306
337
  * @returns {void}
307
338
  */
308
339
  onMessage(handler: (userMessage: FlatUserMessage) => void | Promise<void> | any | Promise<any>): void;
309
- onRawMessage(handler: (userMessage: FlatUserMessage) => void | Promise<void> | any | Promise<any>): void;
340
+ onRawMessage(handler: (userMessage: RawMessageForAgent) => void | Promise<void> | any | Promise<any>): void;
310
341
  /**
311
342
  * Sets up a listener for provider start events.
312
343
  * @param {Function} handler - The handler function to call when provider starts.
313
344
  * @returns {void}
314
345
  */
315
- onProviderStart(handler: (initvars: {
316
- type: string;
317
- environmentName: string;
318
- }) => void | Promise<void> | any | Promise<any>): void;
346
+ onProviderStart(handler: (initvars: ProviderInitVars) => void | Promise<void> | any | Promise<any>): void;
319
347
  /**
320
348
  * Sets up a listener for provider agent start events.
321
349
  * @param {Function} handler - The handler function to call when provider agent starts.
322
350
  * @returns {void}
323
351
  */
324
352
  onProviderAgentStart(handler: (userMessage: any) => void | Promise<void> | any | Promise<any>): void;
353
+ /**
354
+ * Sets up a listener for provider stop events.
355
+ * @param {Function} handler - The handler function to call when provider stops.
356
+ * @returns {void}
357
+ */
358
+ onProviderStop(handler: (initvars: ProviderInitVars) => void | Promise<void> | any | Promise<any>): void;
325
359
  /**
326
360
  * Sets up a listener for get diff files events.
327
361
  * @param {Function} handler - The handler function to call when diff files are requested.
@@ -19,7 +19,7 @@ const project_1 = __importDefault(require("../modules/project"));
19
19
  const git_1 = __importDefault(require("../modules/git"));
20
20
  const dbmemory_1 = __importDefault(require("../modules/dbmemory"));
21
21
  const state_1 = __importDefault(require("../modules/state"));
22
- // import task from '../modules/task';
22
+ const task_1 = __importDefault(require("../modules/task"));
23
23
  const vectordb_1 = __importDefault(require("../modules/vectordb"));
24
24
  const debug_1 = __importDefault(require("../modules/debug"));
25
25
  const tokenizer_1 = __importDefault(require("../modules/tokenizer"));
@@ -58,7 +58,7 @@ class Codebolt {
58
58
  this.project = project_1.default;
59
59
  this.dbmemory = dbmemory_1.default;
60
60
  this.cbstate = state_1.default;
61
- // taskplaner = task;
61
+ this.task = task_1.default;
62
62
  this.vectordb = vectordb_1.default;
63
63
  this.debug = debug_1.default;
64
64
  this.tokenizer = tokenizer_1.default;
@@ -224,12 +224,12 @@ class Codebolt {
224
224
  onProviderStart(handler) {
225
225
  this.waitForReady().then(() => {
226
226
  const handleProviderStart = async (response) => {
227
- console.log("Provider start event received");
228
227
  if (response.type === "providerStart") {
229
228
  try {
230
229
  const result = await handler(response || {});
231
230
  const message = {
232
- "type": "providerStartResponse"
231
+ "type": "remoteProviderEvent",
232
+ "action": "providerStartResponse"
233
233
  };
234
234
  if (result !== undefined && result !== null) {
235
235
  message.message = result;
@@ -263,7 +263,8 @@ class Codebolt {
263
263
  try {
264
264
  const result = await handler(response.userMessage);
265
265
  const message = {
266
- "type": "providerAgentStartResponse"
266
+ "type": "remoteProviderEvent",
267
+ "action": "providerAgentStartResponse"
267
268
  };
268
269
  if (result !== undefined && result !== null) {
269
270
  message.message = result;
@@ -273,7 +274,8 @@ class Codebolt {
273
274
  catch (error) {
274
275
  console.error('Error in provider agent start handler:', error);
275
276
  websocket_1.default.messageManager.send({
276
- "type": "providerAgentStartResponse",
277
+ "type": "remoteProviderEvent",
278
+ "action": "providerAgentStartResponse",
277
279
  "error": error instanceof Error ? error.message : "Unknown error occurred"
278
280
  });
279
281
  }
@@ -284,6 +286,41 @@ class Codebolt {
284
286
  console.error('Failed to set up provider agent start handler:', error);
285
287
  });
286
288
  }
289
+ /**
290
+ * Sets up a listener for provider stop events.
291
+ * @param {Function} handler - The handler function to call when provider stops.
292
+ * @returns {void}
293
+ */
294
+ onProviderStop(handler) {
295
+ this.waitForReady().then(() => {
296
+ const handleProviderStop = async (response) => {
297
+ if (response.type === "providerStop") {
298
+ try {
299
+ const result = await handler(response || {});
300
+ const message = {
301
+ "type": "remoteProviderEvent",
302
+ "action": "providerStopResponse",
303
+ };
304
+ if (result !== undefined && result !== null) {
305
+ message.message = result;
306
+ }
307
+ websocket_1.default.messageManager.send(message);
308
+ }
309
+ catch (error) {
310
+ console.error('Error in provider stop handler:', error);
311
+ websocket_1.default.messageManager.send({
312
+ "type": "remoteProviderEvent",
313
+ "action": "providerStopResponse",
314
+ "error": error instanceof Error ? error.message : "Unknown error occurred"
315
+ });
316
+ }
317
+ }
318
+ };
319
+ websocket_1.default.messageManager.on('message', handleProviderStop);
320
+ }).catch(error => {
321
+ console.error('Failed to set up provider stop handler:', error);
322
+ });
323
+ }
287
324
  /**
288
325
  * Sets up a listener for get diff files events.
289
326
  * @param {Function} handler - The handler function to call when diff files are requested.
@@ -293,10 +330,17 @@ class Codebolt {
293
330
  this.waitForReady().then(() => {
294
331
  const handleGetDiffFiles = async (response) => {
295
332
  console.log("Get diff files event received");
296
- if (response.type === "getDiffFiles") {
333
+ if (response.type === "providerGetDiffFiles") {
297
334
  try {
298
335
  const result = await handler();
299
- websocket_1.default.messageManager.send(result);
336
+ const message = {
337
+ "type": "remoteProviderEvent",
338
+ "action": "providerDiffFilesResponse",
339
+ };
340
+ if (result !== undefined && result !== null) {
341
+ message.message = result;
342
+ }
343
+ websocket_1.default.messageManager.send(message);
300
344
  }
301
345
  catch (error) {
302
346
  console.error('Error in get diff files handler:', error);
@@ -1 +1,182 @@
1
- export {};
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';
4
+ /**
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.
7
+ */
8
+ declare const taskService: {
9
+ /**
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
13
+ */
14
+ createTask: (options: CreateTaskOptions) => Promise<CreateTaskResponse>;
15
+ /**
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
20
+ */
21
+ createSimpleTask: (taskName: string, threadId?: string) => Promise<CreateTaskResponse>;
22
+ /**
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
26
+ */
27
+ getTaskList: (options?: GetTaskListOptions) => Promise<GetTaskListResponse>;
28
+ /**
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
32
+ */
33
+ getTaskDetail: (options: GetTaskDetailOptions) => Promise<GetTaskDetailResponse>;
34
+ /**
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
38
+ */
39
+ addStepToTask: (options: AddStepToTaskOptions) => Promise<AddStepToTaskResponse>;
40
+ /**
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
44
+ */
45
+ getTaskMessages: (options: GetTaskMessagesOptions) => Promise<GetTaskMessagesResponse>;
46
+ /**
47
+ * Updates an existing task.
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
51
+ */
52
+ updateTask: (taskId: string, updates: UpdateTaskOptions) => Promise<UpdateTaskResponse>;
53
+ /**
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
58
+ */
59
+ updateSimpleTask: (taskId: string, taskName: string) => Promise<UpdateTaskResponse>;
60
+ /**
61
+ * Deletes a task.
62
+ * @param {string} taskId - The task ID to delete
63
+ * @returns {Promise<DeleteTaskResponse>} A promise that resolves with the task deletion response
64
+ */
65
+ deleteTask: (taskId: string) => Promise<DeleteTaskResponse>;
66
+ /**
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
70
+ */
71
+ completeTask: (taskId: string) => Promise<CompleteTaskResponse>;
72
+ /**
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
76
+ */
77
+ startTask: (taskId: string) => Promise<StartTaskResponse>;
78
+ /**
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
82
+ */
83
+ getAllSteps: (options?: GetAllStepsOptions) => Promise<GetAllStepsResponse>;
84
+ /**
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
88
+ */
89
+ getCurrentRunningStep: (options?: GetActiveStepOptions) => Promise<GetCurrentRunningStepResponse>;
90
+ /**
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
94
+ */
95
+ updateStepStatus: (options: UpdateStepStatusOptions) => Promise<UpdateStepStatusResponse>;
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
112
+ */
113
+ canTaskStart: (taskId: string) => Promise<CanTaskStartResponse>;
114
+ /**
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
118
+ */
119
+ getTasksDependentOn: (taskId: string) => Promise<GetTasksDependentOnResponse>;
120
+ /**
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
124
+ */
125
+ getTasksReadyToStart: (options?: GetTasksReadyToStartOptions) => Promise<GetTasksReadyToStartResponse>;
126
+ /**
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
130
+ */
131
+ getTaskDependencyChain: (taskId: string) => Promise<GetTaskDependencyChainResponse>;
132
+ /**
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
136
+ */
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>;
145
+ /**
146
+ * Utility function to create a quick task with minimal parameters.
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
177
+ */
178
+ getTasksByCategory: (category: string) => Promise<GetTaskListResponse>;
179
+ };
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;