@codebolt/codeboltjs 4.0.3 → 5.0.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.
- package/dist/core/Codebolt.d.ts +42 -7
- package/dist/core/Codebolt.js +40 -0
- package/dist/modules/actionPlan.d.ts +68 -0
- package/dist/modules/actionPlan.js +125 -0
- package/dist/modules/chat.d.ts +1 -1
- package/dist/modules/task.d.ts +3 -6
- package/dist/modules/task.js +11 -42
- package/package.json +1 -1
package/dist/core/Codebolt.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ declare class Codebolt {
|
|
|
11
11
|
private isReady;
|
|
12
12
|
private readyPromise;
|
|
13
13
|
private readyHandlers;
|
|
14
|
+
private messageQueue;
|
|
15
|
+
private messageResolvers;
|
|
14
16
|
/**
|
|
15
17
|
* @constructor
|
|
16
18
|
* @description Initializes the websocket connection.
|
|
@@ -114,7 +116,7 @@ declare class Codebolt {
|
|
|
114
116
|
chat: {
|
|
115
117
|
getChatHistory: (threadId: string) => Promise<import("@codebolt/types/sdk").ChatMessage>;
|
|
116
118
|
setRequestHandler: (handler: (request: any, response: (data: any) => void) => Promise<void> | void) => void;
|
|
117
|
-
sendMessage: (message: string, payload
|
|
119
|
+
sendMessage: (message: string, payload?: any) => void;
|
|
118
120
|
waitforReply: (message: string) => Promise<import("@codebolt/types/sdk").UserMessage>;
|
|
119
121
|
processStarted: (onStopClicked?: (message: any) => void) => {
|
|
120
122
|
stopProcess: () => void;
|
|
@@ -254,12 +256,9 @@ declare class Codebolt {
|
|
|
254
256
|
getTasks: (filters?: import("../types/libFunctionTypes").TaskFilterOptions) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetTaskListResponse>;
|
|
255
257
|
getTasksByAgent: (agentId: string) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetTaskListResponse>;
|
|
256
258
|
getTasksByCategory: (category: string) => Promise<import("node_modules/@codebolt/types/dist/wstypes/app-to-agent-ws/taskServiceResponses").GetTaskListResponse>;
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
getAttachedTodos: (taskId: string) => Promise<any>;
|
|
261
|
-
getAttachedJsonMemory: (taskId: string) => Promise<any>;
|
|
262
|
-
getAttachedMarkdownMemory: (taskId: string) => Promise<any>;
|
|
259
|
+
attachMemoryToTask: (taskId: string, memoryId: string) => Promise<any>;
|
|
260
|
+
getAttachedMemoryForTask: (taskId: string) => Promise<any>;
|
|
261
|
+
createTaskGroup: (groupName: string, description: string) => Promise<any>;
|
|
263
262
|
};
|
|
264
263
|
vectordb: {
|
|
265
264
|
getVector: (key: string) => Promise<import("@codebolt/types/sdk").GetVectorResponse>;
|
|
@@ -325,6 +324,29 @@ declare class Codebolt {
|
|
|
325
324
|
list: (filters?: Record<string, unknown>) => Promise<import("../modules/memory").ListMemoryResponse>;
|
|
326
325
|
};
|
|
327
326
|
};
|
|
327
|
+
actionPlan: {
|
|
328
|
+
getAllPlans: () => Promise<any>;
|
|
329
|
+
getPlanDetail: (planId: string) => Promise<any>;
|
|
330
|
+
getActionPlanDetail: (planId: string) => Promise<any>;
|
|
331
|
+
createActionPlan: (payload: {
|
|
332
|
+
name: string;
|
|
333
|
+
description?: string;
|
|
334
|
+
agentId?: string;
|
|
335
|
+
agentName?: string;
|
|
336
|
+
status?: string;
|
|
337
|
+
planId?: string;
|
|
338
|
+
}) => Promise<any>;
|
|
339
|
+
updateActionPlan: (planId: string, updateData: any) => Promise<any>;
|
|
340
|
+
addTaskToActionPlan: (planId: string, task: {
|
|
341
|
+
name: string;
|
|
342
|
+
description?: string;
|
|
343
|
+
priority?: string;
|
|
344
|
+
taskType?: string;
|
|
345
|
+
[key: string]: any;
|
|
346
|
+
}) => Promise<any>;
|
|
347
|
+
startTaskStep: (planId: string, taskId: string) => Promise<any>;
|
|
348
|
+
startTaskStepWithListener: (planId: string, taskId: string, onResponse: (response: any) => void) => () => void;
|
|
349
|
+
};
|
|
328
350
|
/**
|
|
329
351
|
* User message utilities for accessing current user message and context
|
|
330
352
|
*/
|
|
@@ -357,6 +379,19 @@ declare class Codebolt {
|
|
|
357
379
|
* @returns {void}
|
|
358
380
|
*/
|
|
359
381
|
onReady(handler: () => void | Promise<void>): void;
|
|
382
|
+
/**
|
|
383
|
+
* Waits for and returns the next incoming message.
|
|
384
|
+
* If a message is already in the queue, returns it immediately.
|
|
385
|
+
* Otherwise, waits for the next message to arrive.
|
|
386
|
+
* @returns {Promise<FlatUserMessage>} A promise that resolves with the next message
|
|
387
|
+
*/
|
|
388
|
+
getMessage(): Promise<FlatUserMessage>;
|
|
389
|
+
/**
|
|
390
|
+
* Handles an incoming message by either resolving a waiting promise
|
|
391
|
+
* or adding it to the queue if no promises are waiting.
|
|
392
|
+
* @private
|
|
393
|
+
*/
|
|
394
|
+
private handleIncomingMessage;
|
|
360
395
|
/**
|
|
361
396
|
* Sets up a listener for incoming messages with a direct handler function.
|
|
362
397
|
* @param {Function} handler - The handler function to call when a message is received.
|
package/dist/core/Codebolt.js
CHANGED
|
@@ -28,6 +28,7 @@ const mcp_1 = __importDefault(require("../modules/mcp"));
|
|
|
28
28
|
const memory_1 = __importDefault(require("../modules/memory"));
|
|
29
29
|
const agent_1 = __importDefault(require("../modules/agent"));
|
|
30
30
|
const utils_1 = __importDefault(require("../modules/utils"));
|
|
31
|
+
const actionPlan_1 = __importDefault(require("../modules/actionPlan"));
|
|
31
32
|
const notificationfunctions_1 = require("../notificationfunctions");
|
|
32
33
|
const user_message_manager_1 = require("../modules/user-message-manager");
|
|
33
34
|
const user_message_utilities_1 = require("../modules/user-message-utilities");
|
|
@@ -44,6 +45,8 @@ class Codebolt {
|
|
|
44
45
|
this.websocket = null;
|
|
45
46
|
this.isReady = false;
|
|
46
47
|
this.readyHandlers = [];
|
|
48
|
+
this.messageQueue = [];
|
|
49
|
+
this.messageResolvers = [];
|
|
47
50
|
this.fs = fs_1.default;
|
|
48
51
|
this.git = git_1.default;
|
|
49
52
|
this.llm = llm_1.default;
|
|
@@ -69,6 +72,7 @@ class Codebolt {
|
|
|
69
72
|
this.utils = utils_1.default;
|
|
70
73
|
this.notify = notificationfunctions_1.notificationFunctions;
|
|
71
74
|
this.memory = memory_1.default;
|
|
75
|
+
this.actionPlan = actionPlan_1.default;
|
|
72
76
|
/**
|
|
73
77
|
* User message utilities for accessing current user message and context
|
|
74
78
|
*/
|
|
@@ -144,6 +148,39 @@ class Codebolt {
|
|
|
144
148
|
this.readyHandlers.push(handler);
|
|
145
149
|
}
|
|
146
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* Waits for and returns the next incoming message.
|
|
153
|
+
* If a message is already in the queue, returns it immediately.
|
|
154
|
+
* Otherwise, waits for the next message to arrive.
|
|
155
|
+
* @returns {Promise<FlatUserMessage>} A promise that resolves with the next message
|
|
156
|
+
*/
|
|
157
|
+
getMessage() {
|
|
158
|
+
// If there are queued messages, return the first one
|
|
159
|
+
if (this.messageQueue.length > 0) {
|
|
160
|
+
const message = this.messageQueue.shift();
|
|
161
|
+
return Promise.resolve(message);
|
|
162
|
+
}
|
|
163
|
+
// Otherwise, create a new promise that will be resolved when a message arrives
|
|
164
|
+
return new Promise((resolve) => {
|
|
165
|
+
this.messageResolvers.push(resolve);
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Handles an incoming message by either resolving a waiting promise
|
|
170
|
+
* or adding it to the queue if no promises are waiting.
|
|
171
|
+
* @private
|
|
172
|
+
*/
|
|
173
|
+
handleIncomingMessage(message) {
|
|
174
|
+
if (this.messageResolvers.length > 0) {
|
|
175
|
+
// If there are waiting resolvers, resolve the first one
|
|
176
|
+
const resolver = this.messageResolvers.shift();
|
|
177
|
+
resolver(message);
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
// Otherwise, add to the queue
|
|
181
|
+
this.messageQueue.push(message);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
147
184
|
/**
|
|
148
185
|
* Sets up a listener for incoming messages with a direct handler function.
|
|
149
186
|
* @param {Function} handler - The handler function to call when a message is received.
|
|
@@ -180,6 +217,9 @@ class Codebolt {
|
|
|
180
217
|
};
|
|
181
218
|
// Automatically save the user message globally
|
|
182
219
|
user_message_manager_1.userMessageManager.saveMessage(userMessage);
|
|
220
|
+
// Handle the message in the queue system
|
|
221
|
+
this.handleIncomingMessage(userMessage);
|
|
222
|
+
// Call the original handler
|
|
183
223
|
const result = await handler(userMessage);
|
|
184
224
|
// Send processStoped with optional message
|
|
185
225
|
const message = {
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
declare const codeboltActionPlan: {
|
|
2
|
+
/**
|
|
3
|
+
* Get all action plans
|
|
4
|
+
* @returns Promise with all action plans
|
|
5
|
+
*/
|
|
6
|
+
getAllPlans: () => Promise<any>;
|
|
7
|
+
/**
|
|
8
|
+
* Get action plan detail by ID
|
|
9
|
+
* @param planId - The ID of the action plan
|
|
10
|
+
* @returns Promise with action plan details
|
|
11
|
+
*/
|
|
12
|
+
getPlanDetail: (planId: string) => Promise<any>;
|
|
13
|
+
/**
|
|
14
|
+
* Get action plan detail by ID (alternative method)
|
|
15
|
+
* @param planId - The ID of the action plan
|
|
16
|
+
* @returns Promise with action plan details
|
|
17
|
+
*/
|
|
18
|
+
getActionPlanDetail: (planId: string) => Promise<any>;
|
|
19
|
+
/**
|
|
20
|
+
* Create a new action plan
|
|
21
|
+
* @param payload - Action plan creation data (name, description, agentId, agentName, status, planId)
|
|
22
|
+
* @returns Promise with created action plan
|
|
23
|
+
*/
|
|
24
|
+
createActionPlan: (payload: {
|
|
25
|
+
name: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
agentId?: string;
|
|
28
|
+
agentName?: string;
|
|
29
|
+
status?: string;
|
|
30
|
+
planId?: string;
|
|
31
|
+
}) => Promise<any>;
|
|
32
|
+
/**
|
|
33
|
+
* Update an existing action plan
|
|
34
|
+
* @param planId - The ID of the action plan to update
|
|
35
|
+
* @param updateData - Data to update in the action plan
|
|
36
|
+
* @returns Promise with updated action plan
|
|
37
|
+
*/
|
|
38
|
+
updateActionPlan: (planId: string, updateData: any) => Promise<any>;
|
|
39
|
+
/**
|
|
40
|
+
* Add a task to an action plan
|
|
41
|
+
* @param planId - The ID of the action plan
|
|
42
|
+
* @param task - Task data to add (name, description, priority, taskType, etc.)
|
|
43
|
+
* @returns Promise with added task and updated action plan
|
|
44
|
+
*/
|
|
45
|
+
addTaskToActionPlan: (planId: string, task: {
|
|
46
|
+
name: string;
|
|
47
|
+
description?: string;
|
|
48
|
+
priority?: string;
|
|
49
|
+
taskType?: string;
|
|
50
|
+
[key: string]: any;
|
|
51
|
+
}) => Promise<any>;
|
|
52
|
+
/**
|
|
53
|
+
* Start/execute a task step in an action plan
|
|
54
|
+
* @param planId - The ID of the action plan
|
|
55
|
+
* @param taskId - The ID of the task to start
|
|
56
|
+
* @returns Promise with task execution status
|
|
57
|
+
*/
|
|
58
|
+
startTaskStep: (planId: string, taskId: string) => Promise<any>;
|
|
59
|
+
/**
|
|
60
|
+
* Start/execute a task step in an action plan with event listener
|
|
61
|
+
* @param planId - The ID of the action plan
|
|
62
|
+
* @param taskId - The ID of the task to start
|
|
63
|
+
* @param onResponse - Callback function that will be called when receiving responses for this task
|
|
64
|
+
* @returns Cleanup function to remove the event listener
|
|
65
|
+
*/
|
|
66
|
+
startTaskStepWithListener: (planId: string, taskId: string, onResponse: (response: any) => void) => () => void;
|
|
67
|
+
};
|
|
68
|
+
export default codeboltActionPlan;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const websocket_1 = __importDefault(require("../core/websocket"));
|
|
7
|
+
const enum_1 = require("@codebolt/types/enum");
|
|
8
|
+
const codeboltActionPlan = {
|
|
9
|
+
/**
|
|
10
|
+
* Get all action plans
|
|
11
|
+
* @returns Promise with all action plans
|
|
12
|
+
*/
|
|
13
|
+
getAllPlans: () => {
|
|
14
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({
|
|
15
|
+
"type": enum_1.EventType.ACTION_PLAN,
|
|
16
|
+
"action": enum_1.ActionPlanAction.GETALL_ACTION_PLAN,
|
|
17
|
+
}, enum_1.ActionPlanResponseType.GETALL_ACTION_PLAN_RESPONSE);
|
|
18
|
+
},
|
|
19
|
+
/**
|
|
20
|
+
* Get action plan detail by ID
|
|
21
|
+
* @param planId - The ID of the action plan
|
|
22
|
+
* @returns Promise with action plan details
|
|
23
|
+
*/
|
|
24
|
+
getPlanDetail: (planId) => {
|
|
25
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({
|
|
26
|
+
"type": enum_1.EventType.ACTION_PLAN,
|
|
27
|
+
"action": enum_1.ActionPlanAction.GET_PLAN_DETAIL,
|
|
28
|
+
message: { planId }
|
|
29
|
+
}, enum_1.ActionPlanResponseType.GET_PLAN_DETAIL_RESPONSE);
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* Get action plan detail by ID (alternative method)
|
|
33
|
+
* @param planId - The ID of the action plan
|
|
34
|
+
* @returns Promise with action plan details
|
|
35
|
+
*/
|
|
36
|
+
getActionPlanDetail: (planId) => {
|
|
37
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({
|
|
38
|
+
"type": enum_1.EventType.ACTION_PLAN,
|
|
39
|
+
"action": enum_1.ActionPlanAction.GET_ACTION_PLAN_DETAIL,
|
|
40
|
+
message: { planId }
|
|
41
|
+
}, enum_1.ActionPlanResponseType.GET_ACTION_PLAN_DETAIL_RESPONSE);
|
|
42
|
+
},
|
|
43
|
+
/**
|
|
44
|
+
* Create a new action plan
|
|
45
|
+
* @param payload - Action plan creation data (name, description, agentId, agentName, status, planId)
|
|
46
|
+
* @returns Promise with created action plan
|
|
47
|
+
*/
|
|
48
|
+
createActionPlan: (payload) => {
|
|
49
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({
|
|
50
|
+
"type": enum_1.EventType.ACTION_PLAN,
|
|
51
|
+
"action": enum_1.ActionPlanAction.CREATE_ACTION_PLAN,
|
|
52
|
+
message: payload
|
|
53
|
+
}, enum_1.ActionPlanResponseType.CREATE_ACTION_PLAN_RESPONSE);
|
|
54
|
+
},
|
|
55
|
+
/**
|
|
56
|
+
* Update an existing action plan
|
|
57
|
+
* @param planId - The ID of the action plan to update
|
|
58
|
+
* @param updateData - Data to update in the action plan
|
|
59
|
+
* @returns Promise with updated action plan
|
|
60
|
+
*/
|
|
61
|
+
updateActionPlan: (planId, updateData) => {
|
|
62
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({
|
|
63
|
+
"type": enum_1.EventType.ACTION_PLAN,
|
|
64
|
+
"action": enum_1.ActionPlanAction.UPDATE_ACTION_PLAN,
|
|
65
|
+
message: { planId, ...updateData }
|
|
66
|
+
}, enum_1.ActionPlanResponseType.UPDATE_ACTION_PLAN_RESPONSE);
|
|
67
|
+
},
|
|
68
|
+
/**
|
|
69
|
+
* Add a task to an action plan
|
|
70
|
+
* @param planId - The ID of the action plan
|
|
71
|
+
* @param task - Task data to add (name, description, priority, taskType, etc.)
|
|
72
|
+
* @returns Promise with added task and updated action plan
|
|
73
|
+
*/
|
|
74
|
+
addTaskToActionPlan: (planId, task) => {
|
|
75
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({
|
|
76
|
+
"type": enum_1.EventType.ACTION_PLAN,
|
|
77
|
+
"action": enum_1.ActionPlanAction.ADD_TASK_TO_ACTION_PLAN,
|
|
78
|
+
message: { planId, task }
|
|
79
|
+
}, enum_1.ActionPlanResponseType.ADD_TASK_TO_ACTION_PLAN_RESPONSE);
|
|
80
|
+
},
|
|
81
|
+
/**
|
|
82
|
+
* Start/execute a task step in an action plan
|
|
83
|
+
* @param planId - The ID of the action plan
|
|
84
|
+
* @param taskId - The ID of the task to start
|
|
85
|
+
* @returns Promise with task execution status
|
|
86
|
+
*/
|
|
87
|
+
startTaskStep: (planId, taskId) => {
|
|
88
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse({
|
|
89
|
+
"type": enum_1.EventType.ACTION_PLAN,
|
|
90
|
+
"action": enum_1.ActionPlanAction.START_TASK_STEP,
|
|
91
|
+
message: { planId, taskId }
|
|
92
|
+
}, enum_1.ActionPlanResponseType.START_TASK_STEP_RESPONSE);
|
|
93
|
+
},
|
|
94
|
+
/**
|
|
95
|
+
* Start/execute a task step in an action plan with event listener
|
|
96
|
+
* @param planId - The ID of the action plan
|
|
97
|
+
* @param taskId - The ID of the task to start
|
|
98
|
+
* @param onResponse - Callback function that will be called when receiving responses for this task
|
|
99
|
+
* @returns Cleanup function to remove the event listener
|
|
100
|
+
*/
|
|
101
|
+
startTaskStepWithListener: (planId, taskId, onResponse) => {
|
|
102
|
+
// Set up event listener
|
|
103
|
+
const listener = (response) => {
|
|
104
|
+
// Filter responses related to this specific task
|
|
105
|
+
if (response.type === enum_1.ActionPlanResponseType.START_TASK_STEP_RESPONSE) {
|
|
106
|
+
if ((response === null || response === void 0 ? void 0 : response.taskId) === taskId) {
|
|
107
|
+
onResponse(response);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
// Add the listener to the message manager
|
|
112
|
+
websocket_1.default.messageManager.on('message', listener);
|
|
113
|
+
// Send the request
|
|
114
|
+
websocket_1.default.messageManager.send({
|
|
115
|
+
"type": enum_1.EventType.ACTION_PLAN,
|
|
116
|
+
"action": enum_1.ActionPlanAction.START_TASK_STEP,
|
|
117
|
+
message: { planId, taskId }
|
|
118
|
+
});
|
|
119
|
+
// Return cleanup function to remove the listener
|
|
120
|
+
return () => {
|
|
121
|
+
websocket_1.default.messageManager.off('message', listener);
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
exports.default = codeboltActionPlan;
|
package/dist/modules/chat.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ declare const cbchat: {
|
|
|
18
18
|
* Sends a message through the WebSocket connection.
|
|
19
19
|
* @param {string} message - The message to be sent.
|
|
20
20
|
*/
|
|
21
|
-
sendMessage: (message: string, payload
|
|
21
|
+
sendMessage: (message: string, payload?: any) => void;
|
|
22
22
|
/**
|
|
23
23
|
* Waits for a reply to a sent message.
|
|
24
24
|
* @param {string} message - The message for which a reply is expected.
|
package/dist/modules/task.d.ts
CHANGED
|
@@ -176,12 +176,9 @@ declare const taskService: {
|
|
|
176
176
|
* @deprecated Use getTaskList instead
|
|
177
177
|
*/
|
|
178
178
|
getTasksByCategory: (category: string) => Promise<GetTaskListResponse>;
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
getAttachedTodos: (taskId: string) => Promise<any>;
|
|
183
|
-
getAttachedJsonMemory: (taskId: string) => Promise<any>;
|
|
184
|
-
getAttachedMarkdownMemory: (taskId: string) => Promise<any>;
|
|
179
|
+
attachMemoryToTask: (taskId: string, memoryId: string) => Promise<any>;
|
|
180
|
+
getAttachedMemoryForTask: (taskId: string) => Promise<any>;
|
|
181
|
+
createTaskGroup: (groupName: string, description: string) => Promise<any>;
|
|
185
182
|
};
|
|
186
183
|
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 };
|
|
187
184
|
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 };
|
package/dist/modules/task.js
CHANGED
|
@@ -437,68 +437,37 @@ const taskService = {
|
|
|
437
437
|
// This would need to be implemented as post-processing
|
|
438
438
|
return taskService.getTaskList();
|
|
439
439
|
},
|
|
440
|
-
|
|
440
|
+
attachMemoryToTask: (taskId, memoryId) => {
|
|
441
441
|
const requestId = (0, crypto_1.randomUUID)();
|
|
442
442
|
const event = {
|
|
443
443
|
type: 'taskEvent',
|
|
444
|
-
action: '
|
|
444
|
+
action: 'attachMemoryToTask',
|
|
445
445
|
requestId,
|
|
446
446
|
taskId,
|
|
447
447
|
memoryId
|
|
448
448
|
};
|
|
449
|
-
return websocket_1.default.messageManager.sendAndWaitForResponse(event, '
|
|
449
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse(event, 'attachMemoryToTaskResponse');
|
|
450
450
|
},
|
|
451
|
-
|
|
451
|
+
getAttachedMemoryForTask: (taskId) => {
|
|
452
452
|
const requestId = (0, crypto_1.randomUUID)();
|
|
453
453
|
const event = {
|
|
454
454
|
type: 'taskEvent',
|
|
455
|
-
action: '
|
|
455
|
+
action: 'getAttachedFromTaskMemory',
|
|
456
456
|
requestId,
|
|
457
457
|
taskId,
|
|
458
|
-
memoryId
|
|
459
|
-
};
|
|
460
|
-
return websocket_1.default.messageManager.sendAndWaitForResponse(event, 'attachJsonMemoryToTaskResponse');
|
|
461
|
-
},
|
|
462
|
-
attachToDoToTask: (taskId, todoId) => {
|
|
463
|
-
const requestId = (0, crypto_1.randomUUID)();
|
|
464
|
-
const event = {
|
|
465
|
-
type: 'taskEvent',
|
|
466
|
-
action: 'attachToDoToTask',
|
|
467
|
-
requestId,
|
|
468
|
-
taskId,
|
|
469
|
-
todoId
|
|
470
458
|
};
|
|
471
|
-
return websocket_1.default.messageManager.sendAndWaitForResponse(event, '
|
|
459
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse(event, 'getAttachedFromTaskMemoryResponse');
|
|
472
460
|
},
|
|
473
|
-
|
|
461
|
+
createTaskGroup: (groupName, description) => {
|
|
474
462
|
const requestId = (0, crypto_1.randomUUID)();
|
|
475
463
|
const event = {
|
|
476
464
|
type: 'taskEvent',
|
|
477
|
-
action: '
|
|
465
|
+
action: 'createTaskGroup',
|
|
478
466
|
requestId,
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
return websocket_1.default.messageManager.sendAndWaitForResponse(event, 'attachToDoToTaskResponse');
|
|
482
|
-
},
|
|
483
|
-
getAttachedJsonMemory: (taskId) => {
|
|
484
|
-
const requestId = (0, crypto_1.randomUUID)();
|
|
485
|
-
const event = {
|
|
486
|
-
type: 'taskEvent',
|
|
487
|
-
action: 'getAttachedJsonMemory',
|
|
488
|
-
requestId,
|
|
489
|
-
taskId,
|
|
490
|
-
};
|
|
491
|
-
return websocket_1.default.messageManager.sendAndWaitForResponse(event, 'getAttachedJsonMemoryResponse');
|
|
492
|
-
},
|
|
493
|
-
getAttachedMarkdownMemory: (taskId) => {
|
|
494
|
-
const requestId = (0, crypto_1.randomUUID)();
|
|
495
|
-
const event = {
|
|
496
|
-
type: 'taskEvent',
|
|
497
|
-
action: 'getAttachedMarkdownMemory',
|
|
498
|
-
requestId,
|
|
499
|
-
taskId,
|
|
467
|
+
groupName,
|
|
468
|
+
description
|
|
500
469
|
};
|
|
501
|
-
return websocket_1.default.messageManager.sendAndWaitForResponse(event, '
|
|
470
|
+
return websocket_1.default.messageManager.sendAndWaitForResponse(event, 'createTaskGroupResponse');
|
|
502
471
|
}
|
|
503
472
|
};
|
|
504
473
|
exports.default = taskService;
|