@codebolt/codeboltjs 5.0.8 → 5.0.9
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 +29 -5
- package/dist/core/Codebolt.js +58 -0
- package/dist/core/websocket.js +15 -17
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -3
- package/dist/modules/dynamicPanel.d.ts +106 -0
- package/dist/modules/dynamicPanel.js +122 -0
- package/dist/modules/mcp.js +3 -0
- package/dist/modules/swarm.d.ts +8 -2
- package/dist/modules/swarm.js +14 -0
- package/dist/tools/actionBlock/action-block-start.js +1 -4
- package/dist/tools/actionPlan/action-plan-create.js +1 -2
- package/dist/tools/completion/attempt-completion.d.ts +25 -0
- package/dist/tools/completion/attempt-completion.js +45 -0
- package/dist/tools/completion/index.d.ts +3 -0
- package/dist/tools/completion/index.js +9 -0
- package/dist/tools/index.d.ts +6 -3
- package/dist/tools/index.js +11 -4
- package/dist/tools/job/index.d.ts +3 -1
- package/dist/tools/job/index.js +5 -1
- package/dist/tools/job/job-remove-dependency.d.ts +28 -0
- package/dist/tools/job/job-remove-dependency.js +86 -0
- package/dist/tools/requirementPlan/requirement-plan-review.js +1 -1
- package/dist/tools/thread/thread-create-background.js +1 -1
- package/dist/tools/utils/schema-validator.d.ts +1 -0
- package/dist/tools/utils/schema-validator.js +13 -1
- package/dist/types/job.d.ts +1 -1
- package/package.json +2 -2
- package/dist/modules/codeboltEvent.d.ts +0 -57
- package/dist/modules/codeboltEvent.js +0 -217
- package/dist/tools/browser/browser-action.d.ts +0 -56
- package/dist/tools/browser/browser-action.js +0 -265
- package/dist/tools/codeboltEvent/event-add-running-agent.d.ts +0 -25
- package/dist/tools/codeboltEvent/event-add-running-agent.js +0 -69
- package/dist/tools/codeboltEvent/event-check-background-agent-completion.d.ts +0 -19
- package/dist/tools/codeboltEvent/event-check-background-agent-completion.js +0 -64
- package/dist/tools/codeboltEvent/event-get-running-agent-count.d.ts +0 -19
- package/dist/tools/codeboltEvent/event-get-running-agent-count.js +0 -55
- package/dist/tools/codeboltEvent/event-on-background-agent-completion.d.ts +0 -19
- package/dist/tools/codeboltEvent/event-on-background-agent-completion.js +0 -56
- package/dist/tools/codeboltEvent/event-wait-for-external-event.d.ts +0 -19
- package/dist/tools/codeboltEvent/event-wait-for-external-event.js +0 -55
- package/dist/tools/codeboltEvent/index.d.ts +0 -19
- package/dist/tools/codeboltEvent/index.js +0 -33
- package/dist/tools/event/event-add-running-agent.d.ts +0 -32
- package/dist/tools/event/event-add-running-agent.js +0 -77
- package/dist/tools/event/event-check-agent-event.d.ts +0 -19
- package/dist/tools/event/event-check-agent-event.js +0 -63
- package/dist/tools/event/event-check-completion.d.ts +0 -19
- package/dist/tools/event/event-check-completion.js +0 -73
- package/dist/tools/event/event-check-grouped-completion.d.ts +0 -19
- package/dist/tools/event/event-check-grouped-completion.js +0 -63
- package/dist/tools/event/event-get-running-count.d.ts +0 -19
- package/dist/tools/event/event-get-running-count.js +0 -55
- package/dist/tools/event/event-on-agent-event.d.ts +0 -19
- package/dist/tools/event/event-on-agent-event.js +0 -63
- package/dist/tools/event/event-on-completion.d.ts +0 -19
- package/dist/tools/event/event-on-completion.js +0 -73
- package/dist/tools/event/event-on-grouped-completion.d.ts +0 -19
- package/dist/tools/event/event-on-grouped-completion.js +0 -63
- package/dist/tools/event/event-wait-any.d.ts +0 -19
- package/dist/tools/event/event-wait-any.js +0 -66
- package/dist/tools/event/index.d.ts +0 -25
- package/dist/tools/event/index.js +0 -48
- package/dist/tools/git/git-action.d.ts +0 -48
- package/dist/tools/git/git-action.js +0 -279
- package/dist/tools/kvStore/kv-store-create-instance.d.ts +0 -26
- package/dist/tools/kvStore/kv-store-create-instance.js +0 -79
- package/dist/tools/kvStore/kv-store-get.d.ts +0 -30
- package/dist/tools/kvStore/kv-store-get.js +0 -80
- package/dist/tools/kvStore/kv-store-set.d.ts +0 -38
- package/dist/tools/kvStore/kv-store-set.js +0 -86
- package/dist/tools/memoryIngestion/mi-create-pipeline.d.ts +0 -44
- package/dist/tools/memoryIngestion/mi-create-pipeline.js +0 -114
- package/dist/tools/memoryIngestion/mi-list.d.ts +0 -22
- package/dist/tools/memoryIngestion/mi-list.js +0 -66
- package/dist/tools/orchestration/agent-details.d.ts +0 -15
- package/dist/tools/orchestration/agent-details.js +0 -98
- package/dist/tools/orchestration/agent-find.d.ts +0 -18
- package/dist/tools/orchestration/agent-find.js +0 -125
- package/dist/tools/orchestration/agent-list.d.ts +0 -13
- package/dist/tools/orchestration/agent-list.js +0 -106
- package/dist/tools/orchestration/agent-management.d.ts +0 -44
- package/dist/tools/orchestration/agent-management.js +0 -250
- package/dist/tools/orchestration/agent-start.d.ts +0 -18
- package/dist/tools/orchestration/agent-start.js +0 -90
- package/dist/tools/orchestration/index.d.ts +0 -49
- package/dist/tools/orchestration/index.js +0 -102
- package/dist/tools/orchestration/task-assign.d.ts +0 -18
- package/dist/tools/orchestration/task-assign.js +0 -84
- package/dist/tools/orchestration/task-create.d.ts +0 -20
- package/dist/tools/orchestration/task-create.js +0 -97
- package/dist/tools/orchestration/task-delete.d.ts +0 -16
- package/dist/tools/orchestration/task-delete.js +0 -77
- package/dist/tools/orchestration/task-execute.d.ts +0 -18
- package/dist/tools/orchestration/task-execute.js +0 -84
- package/dist/tools/orchestration/task-get.d.ts +0 -16
- package/dist/tools/orchestration/task-get.js +0 -89
- package/dist/tools/orchestration/task-list.d.ts +0 -13
- package/dist/tools/orchestration/task-list.js +0 -74
- package/dist/tools/orchestration/task-management.d.ts +0 -52
- package/dist/tools/orchestration/task-management.js +0 -231
- package/dist/tools/orchestration/task-update.d.ts +0 -22
- package/dist/tools/orchestration/task-update.js +0 -96
- package/dist/tools/orchestration/thread-create-background.d.ts +0 -18
- package/dist/tools/orchestration/thread-create-background.js +0 -94
- package/dist/tools/orchestration/thread-create-start.d.ts +0 -16
- package/dist/tools/orchestration/thread-create-start.js +0 -85
- package/dist/tools/orchestration/thread-create.d.ts +0 -16
- package/dist/tools/orchestration/thread-create.js +0 -85
- package/dist/tools/orchestration/thread-delete.d.ts +0 -16
- package/dist/tools/orchestration/thread-delete.js +0 -77
- package/dist/tools/orchestration/thread-get-messages.d.ts +0 -24
- package/dist/tools/orchestration/thread-get-messages.js +0 -122
- package/dist/tools/orchestration/thread-get.d.ts +0 -16
- package/dist/tools/orchestration/thread-get.js +0 -85
- package/dist/tools/orchestration/thread-list.d.ts +0 -16
- package/dist/tools/orchestration/thread-list.js +0 -85
- package/dist/tools/orchestration/thread-start.d.ts +0 -16
- package/dist/tools/orchestration/thread-start.js +0 -82
- package/dist/tools/orchestration/thread-update-status.d.ts +0 -18
- package/dist/tools/orchestration/thread-update-status.js +0 -89
- package/dist/tools/orchestration/thread-update.d.ts +0 -18
- package/dist/tools/orchestration/thread-update.js +0 -89
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Task Create Tool - Creates a new task
|
|
4
|
-
* Wraps the SDK's taskService.createTask() method
|
|
5
|
-
*/
|
|
6
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
-
};
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.TaskCreateTool = void 0;
|
|
11
|
-
const types_1 = require("../types");
|
|
12
|
-
const base_tool_1 = require("../base-tool");
|
|
13
|
-
const task_1 = __importDefault(require("../../modules/task"));
|
|
14
|
-
class TaskCreateInvocation extends base_tool_1.BaseToolInvocation {
|
|
15
|
-
constructor(params) {
|
|
16
|
-
super(params);
|
|
17
|
-
}
|
|
18
|
-
async execute() {
|
|
19
|
-
var _a;
|
|
20
|
-
try {
|
|
21
|
-
const response = await task_1.default.createTask({
|
|
22
|
-
name: this.params.title,
|
|
23
|
-
description: this.params.description,
|
|
24
|
-
threadId: this.params.thread_id || '',
|
|
25
|
-
});
|
|
26
|
-
if (response && !response.success && response.success !== undefined) {
|
|
27
|
-
const errorMsg = typeof response.error === 'string'
|
|
28
|
-
? response.error
|
|
29
|
-
: ((_a = response.error) === null || _a === void 0 ? void 0 : _a.message) || 'Task creation failed';
|
|
30
|
-
return {
|
|
31
|
-
llmContent: `Task creation failed: ${errorMsg}`,
|
|
32
|
-
returnDisplay: `Error: ${errorMsg}`,
|
|
33
|
-
error: {
|
|
34
|
-
message: errorMsg,
|
|
35
|
-
type: types_1.ToolErrorType.EXECUTION_FAILED,
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
let output = `Created task: ${this.params.title}`;
|
|
40
|
-
const resp = response;
|
|
41
|
-
if (resp.task) {
|
|
42
|
-
output += `\n\nTask ID: ${resp.task.id || resp.taskId}`;
|
|
43
|
-
}
|
|
44
|
-
else if (resp.taskId) {
|
|
45
|
-
output += `\n\nTask ID: ${resp.taskId}`;
|
|
46
|
-
}
|
|
47
|
-
return {
|
|
48
|
-
llmContent: output,
|
|
49
|
-
returnDisplay: `Created task: ${this.params.title}`,
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
catch (error) {
|
|
53
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
54
|
-
return {
|
|
55
|
-
llmContent: `Error creating task: ${errorMessage}`,
|
|
56
|
-
returnDisplay: `Error: ${errorMessage}`,
|
|
57
|
-
error: {
|
|
58
|
-
message: errorMessage,
|
|
59
|
-
type: types_1.ToolErrorType.EXECUTION_FAILED,
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
class TaskCreateTool extends base_tool_1.BaseDeclarativeTool {
|
|
66
|
-
constructor() {
|
|
67
|
-
super(TaskCreateTool.Name, 'TaskCreate', 'Creates a new task.', types_1.Kind.Other, {
|
|
68
|
-
properties: {
|
|
69
|
-
title: {
|
|
70
|
-
description: 'The title/name of the task.',
|
|
71
|
-
type: 'string',
|
|
72
|
-
},
|
|
73
|
-
description: {
|
|
74
|
-
description: 'The description of the task.',
|
|
75
|
-
type: 'string',
|
|
76
|
-
},
|
|
77
|
-
thread_id: {
|
|
78
|
-
description: 'The thread ID for the task.',
|
|
79
|
-
type: 'string',
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
required: ['title'],
|
|
83
|
-
type: 'object',
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
validateToolParamValues(params) {
|
|
87
|
-
if (!params.title || params.title.trim() === '') {
|
|
88
|
-
return "'title' is required for task create";
|
|
89
|
-
}
|
|
90
|
-
return null;
|
|
91
|
-
}
|
|
92
|
-
createInvocation(params) {
|
|
93
|
-
return new TaskCreateInvocation(params);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
exports.TaskCreateTool = TaskCreateTool;
|
|
97
|
-
TaskCreateTool.Name = 'task_create';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Task Delete Tool - Deletes a task
|
|
3
|
-
* Wraps the SDK's taskService.deleteTask() method
|
|
4
|
-
*/
|
|
5
|
-
import type { ToolInvocation, ToolResult } from '../types';
|
|
6
|
-
import { BaseDeclarativeTool } from '../base-tool';
|
|
7
|
-
export interface TaskDeleteParams {
|
|
8
|
-
/** The task ID to delete */
|
|
9
|
-
task_id: string;
|
|
10
|
-
}
|
|
11
|
-
export declare class TaskDeleteTool extends BaseDeclarativeTool<TaskDeleteParams, ToolResult> {
|
|
12
|
-
static readonly Name: string;
|
|
13
|
-
constructor();
|
|
14
|
-
protected validateToolParamValues(params: TaskDeleteParams): string | null;
|
|
15
|
-
protected createInvocation(params: TaskDeleteParams): ToolInvocation<TaskDeleteParams, ToolResult>;
|
|
16
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Task Delete Tool - Deletes a task
|
|
4
|
-
* Wraps the SDK's taskService.deleteTask() method
|
|
5
|
-
*/
|
|
6
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
-
};
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.TaskDeleteTool = void 0;
|
|
11
|
-
const types_1 = require("../types");
|
|
12
|
-
const base_tool_1 = require("../base-tool");
|
|
13
|
-
const task_1 = __importDefault(require("../../modules/task"));
|
|
14
|
-
class TaskDeleteInvocation extends base_tool_1.BaseToolInvocation {
|
|
15
|
-
constructor(params) {
|
|
16
|
-
super(params);
|
|
17
|
-
}
|
|
18
|
-
async execute() {
|
|
19
|
-
var _a;
|
|
20
|
-
try {
|
|
21
|
-
const response = await task_1.default.deleteTask(this.params.task_id);
|
|
22
|
-
if (response && !response.success && response.success !== undefined) {
|
|
23
|
-
const errorMsg = typeof response.error === 'string'
|
|
24
|
-
? response.error
|
|
25
|
-
: ((_a = response.error) === null || _a === void 0 ? void 0 : _a.message) || 'Task deletion failed';
|
|
26
|
-
return {
|
|
27
|
-
llmContent: `Task deletion failed: ${errorMsg}`,
|
|
28
|
-
returnDisplay: `Error: ${errorMsg}`,
|
|
29
|
-
error: {
|
|
30
|
-
message: errorMsg,
|
|
31
|
-
type: types_1.ToolErrorType.TASK_NOT_FOUND,
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
return {
|
|
36
|
-
llmContent: `Deleted task: ${this.params.task_id}`,
|
|
37
|
-
returnDisplay: `Deleted task: ${this.params.task_id}`,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
42
|
-
return {
|
|
43
|
-
llmContent: `Error deleting task: ${errorMessage}`,
|
|
44
|
-
returnDisplay: `Error: ${errorMessage}`,
|
|
45
|
-
error: {
|
|
46
|
-
message: errorMessage,
|
|
47
|
-
type: types_1.ToolErrorType.EXECUTION_FAILED,
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
class TaskDeleteTool extends base_tool_1.BaseDeclarativeTool {
|
|
54
|
-
constructor() {
|
|
55
|
-
super(TaskDeleteTool.Name, 'TaskDelete', 'Deletes a task.', types_1.Kind.Delete, {
|
|
56
|
-
properties: {
|
|
57
|
-
task_id: {
|
|
58
|
-
description: 'The ID of the task to delete.',
|
|
59
|
-
type: 'string',
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
required: ['task_id'],
|
|
63
|
-
type: 'object',
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
validateToolParamValues(params) {
|
|
67
|
-
if (!params.task_id || params.task_id.trim() === '') {
|
|
68
|
-
return "'task_id' is required for task delete";
|
|
69
|
-
}
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
createInvocation(params) {
|
|
73
|
-
return new TaskDeleteInvocation(params);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
exports.TaskDeleteTool = TaskDeleteTool;
|
|
77
|
-
TaskDeleteTool.Name = 'task_delete';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Task Execute Tool - Executes a task with an agent
|
|
3
|
-
* Wraps the SDK's taskService.executeTaskWithAgent() method
|
|
4
|
-
*/
|
|
5
|
-
import type { ToolInvocation, ToolResult } from '../types';
|
|
6
|
-
import { BaseDeclarativeTool } from '../base-tool';
|
|
7
|
-
export interface TaskExecuteParams {
|
|
8
|
-
/** The task ID to execute */
|
|
9
|
-
task_id: string;
|
|
10
|
-
/** The agent ID to execute the task with */
|
|
11
|
-
agent_id: string;
|
|
12
|
-
}
|
|
13
|
-
export declare class TaskExecuteTool extends BaseDeclarativeTool<TaskExecuteParams, ToolResult> {
|
|
14
|
-
static readonly Name: string;
|
|
15
|
-
constructor();
|
|
16
|
-
protected validateToolParamValues(params: TaskExecuteParams): string | null;
|
|
17
|
-
protected createInvocation(params: TaskExecuteParams): ToolInvocation<TaskExecuteParams, ToolResult>;
|
|
18
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Task Execute Tool - Executes a task with an agent
|
|
4
|
-
* Wraps the SDK's taskService.executeTaskWithAgent() method
|
|
5
|
-
*/
|
|
6
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
-
};
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.TaskExecuteTool = void 0;
|
|
11
|
-
const types_1 = require("../types");
|
|
12
|
-
const base_tool_1 = require("../base-tool");
|
|
13
|
-
const task_1 = __importDefault(require("../../modules/task"));
|
|
14
|
-
class TaskExecuteInvocation extends base_tool_1.BaseToolInvocation {
|
|
15
|
-
constructor(params) {
|
|
16
|
-
super(params);
|
|
17
|
-
}
|
|
18
|
-
async execute() {
|
|
19
|
-
var _a;
|
|
20
|
-
try {
|
|
21
|
-
const response = await task_1.default.executeTaskWithAgent(this.params.task_id, this.params.agent_id);
|
|
22
|
-
if (response && !response.success && response.success !== undefined) {
|
|
23
|
-
const errorMsg = typeof response.error === 'string'
|
|
24
|
-
? response.error
|
|
25
|
-
: ((_a = response.error) === null || _a === void 0 ? void 0 : _a.message) || 'Task execution failed';
|
|
26
|
-
return {
|
|
27
|
-
llmContent: `Task execution failed: ${errorMsg}`,
|
|
28
|
-
returnDisplay: `Error: ${errorMsg}`,
|
|
29
|
-
error: {
|
|
30
|
-
message: errorMsg,
|
|
31
|
-
type: types_1.ToolErrorType.TASK_NOT_FOUND,
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
return {
|
|
36
|
-
llmContent: `Executing task ${this.params.task_id} with agent ${this.params.agent_id}`,
|
|
37
|
-
returnDisplay: `Executing task ${this.params.task_id} with agent ${this.params.agent_id}`,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
42
|
-
return {
|
|
43
|
-
llmContent: `Error executing task: ${errorMessage}`,
|
|
44
|
-
returnDisplay: `Error: ${errorMessage}`,
|
|
45
|
-
error: {
|
|
46
|
-
message: errorMessage,
|
|
47
|
-
type: types_1.ToolErrorType.EXECUTION_FAILED,
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
class TaskExecuteTool extends base_tool_1.BaseDeclarativeTool {
|
|
54
|
-
constructor() {
|
|
55
|
-
super(TaskExecuteTool.Name, 'TaskExecute', 'Executes a task with a specific agent.', types_1.Kind.Execute, {
|
|
56
|
-
properties: {
|
|
57
|
-
task_id: {
|
|
58
|
-
description: 'The ID of the task to execute.',
|
|
59
|
-
type: 'string',
|
|
60
|
-
},
|
|
61
|
-
agent_id: {
|
|
62
|
-
description: 'The ID of the agent to execute the task with.',
|
|
63
|
-
type: 'string',
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
required: ['task_id', 'agent_id'],
|
|
67
|
-
type: 'object',
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
validateToolParamValues(params) {
|
|
71
|
-
if (!params.task_id || params.task_id.trim() === '') {
|
|
72
|
-
return "'task_id' is required for task execute";
|
|
73
|
-
}
|
|
74
|
-
if (!params.agent_id || params.agent_id.trim() === '') {
|
|
75
|
-
return "'agent_id' is required for task execute";
|
|
76
|
-
}
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
createInvocation(params) {
|
|
80
|
-
return new TaskExecuteInvocation(params);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
exports.TaskExecuteTool = TaskExecuteTool;
|
|
84
|
-
TaskExecuteTool.Name = 'task_execute';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Task Get Tool - Gets details of a specific task
|
|
3
|
-
* Wraps the SDK's taskService.getTaskDetail() method
|
|
4
|
-
*/
|
|
5
|
-
import type { ToolInvocation, ToolResult } from '../types';
|
|
6
|
-
import { BaseDeclarativeTool } from '../base-tool';
|
|
7
|
-
export interface TaskGetParams {
|
|
8
|
-
/** The task ID to get details for */
|
|
9
|
-
task_id: string;
|
|
10
|
-
}
|
|
11
|
-
export declare class TaskGetTool extends BaseDeclarativeTool<TaskGetParams, ToolResult> {
|
|
12
|
-
static readonly Name: string;
|
|
13
|
-
constructor();
|
|
14
|
-
protected validateToolParamValues(params: TaskGetParams): string | null;
|
|
15
|
-
protected createInvocation(params: TaskGetParams): ToolInvocation<TaskGetParams, ToolResult>;
|
|
16
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Task Get Tool - Gets details of a specific task
|
|
4
|
-
* Wraps the SDK's taskService.getTaskDetail() method
|
|
5
|
-
*/
|
|
6
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
-
};
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.TaskGetTool = void 0;
|
|
11
|
-
const types_1 = require("../types");
|
|
12
|
-
const base_tool_1 = require("../base-tool");
|
|
13
|
-
const task_1 = __importDefault(require("../../modules/task"));
|
|
14
|
-
class TaskGetInvocation extends base_tool_1.BaseToolInvocation {
|
|
15
|
-
constructor(params) {
|
|
16
|
-
super(params);
|
|
17
|
-
}
|
|
18
|
-
async execute() {
|
|
19
|
-
var _a;
|
|
20
|
-
try {
|
|
21
|
-
const response = await task_1.default.getTaskDetail({ taskId: this.params.task_id });
|
|
22
|
-
if (response && !response.success && response.success !== undefined) {
|
|
23
|
-
const errorMsg = typeof response.error === 'string'
|
|
24
|
-
? response.error
|
|
25
|
-
: ((_a = response.error) === null || _a === void 0 ? void 0 : _a.message) || 'Task retrieval failed';
|
|
26
|
-
return {
|
|
27
|
-
llmContent: `Task retrieval failed: ${errorMsg}`,
|
|
28
|
-
returnDisplay: `Error: ${errorMsg}`,
|
|
29
|
-
error: {
|
|
30
|
-
message: errorMsg,
|
|
31
|
-
type: types_1.ToolErrorType.TASK_NOT_FOUND,
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
let output = `Retrieved task: ${this.params.task_id}`;
|
|
36
|
-
const resp = response;
|
|
37
|
-
if (resp.task) {
|
|
38
|
-
const task = resp.task;
|
|
39
|
-
output += `\n\nTask Details:\n`;
|
|
40
|
-
output += `ID: ${task.id}\n`;
|
|
41
|
-
output += `Title: ${task.title || task.name || 'N/A'}\n`;
|
|
42
|
-
output += `Description: ${task.description || 'N/A'}\n`;
|
|
43
|
-
output += `Status: ${task.status || 'pending'}\n`;
|
|
44
|
-
if (task.assignedTo)
|
|
45
|
-
output += `Assigned To: ${task.assignedTo}\n`;
|
|
46
|
-
}
|
|
47
|
-
return {
|
|
48
|
-
llmContent: output,
|
|
49
|
-
returnDisplay: `Retrieved task: ${this.params.task_id}`,
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
catch (error) {
|
|
53
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
54
|
-
return {
|
|
55
|
-
llmContent: `Error getting task: ${errorMessage}`,
|
|
56
|
-
returnDisplay: `Error: ${errorMessage}`,
|
|
57
|
-
error: {
|
|
58
|
-
message: errorMessage,
|
|
59
|
-
type: types_1.ToolErrorType.EXECUTION_FAILED,
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
class TaskGetTool extends base_tool_1.BaseDeclarativeTool {
|
|
66
|
-
constructor() {
|
|
67
|
-
super(TaskGetTool.Name, 'TaskGet', 'Retrieves details of a specific task.', types_1.Kind.Read, {
|
|
68
|
-
properties: {
|
|
69
|
-
task_id: {
|
|
70
|
-
description: 'The ID of the task to retrieve.',
|
|
71
|
-
type: 'string',
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
required: ['task_id'],
|
|
75
|
-
type: 'object',
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
validateToolParamValues(params) {
|
|
79
|
-
if (!params.task_id || params.task_id.trim() === '') {
|
|
80
|
-
return "'task_id' is required for task get";
|
|
81
|
-
}
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
createInvocation(params) {
|
|
85
|
-
return new TaskGetInvocation(params);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
exports.TaskGetTool = TaskGetTool;
|
|
89
|
-
TaskGetTool.Name = 'task_get';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Task List Tool - Lists all tasks
|
|
3
|
-
* Wraps the SDK's taskService.getTaskList() method
|
|
4
|
-
*/
|
|
5
|
-
import type { ToolInvocation, ToolResult } from '../types';
|
|
6
|
-
import { BaseDeclarativeTool } from '../base-tool';
|
|
7
|
-
export interface TaskListParams {
|
|
8
|
-
}
|
|
9
|
-
export declare class TaskListTool extends BaseDeclarativeTool<TaskListParams, ToolResult> {
|
|
10
|
-
static readonly Name: string;
|
|
11
|
-
constructor();
|
|
12
|
-
protected createInvocation(params: TaskListParams): ToolInvocation<TaskListParams, ToolResult>;
|
|
13
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Task List Tool - Lists all tasks
|
|
4
|
-
* Wraps the SDK's taskService.getTaskList() method
|
|
5
|
-
*/
|
|
6
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
-
};
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.TaskListTool = void 0;
|
|
11
|
-
const types_1 = require("../types");
|
|
12
|
-
const base_tool_1 = require("../base-tool");
|
|
13
|
-
const task_1 = __importDefault(require("../../modules/task"));
|
|
14
|
-
class TaskListInvocation extends base_tool_1.BaseToolInvocation {
|
|
15
|
-
constructor(params) {
|
|
16
|
-
super(params);
|
|
17
|
-
}
|
|
18
|
-
async execute() {
|
|
19
|
-
var _a;
|
|
20
|
-
try {
|
|
21
|
-
const response = await task_1.default.getTaskList({});
|
|
22
|
-
if (response && !response.success && response.success !== undefined) {
|
|
23
|
-
const errorMsg = typeof response.error === 'string'
|
|
24
|
-
? response.error
|
|
25
|
-
: ((_a = response.error) === null || _a === void 0 ? void 0 : _a.message) || 'Task list retrieval failed';
|
|
26
|
-
return {
|
|
27
|
-
llmContent: `Task list retrieval failed: ${errorMsg}`,
|
|
28
|
-
returnDisplay: `Error: ${errorMsg}`,
|
|
29
|
-
error: {
|
|
30
|
-
message: errorMsg,
|
|
31
|
-
type: types_1.ToolErrorType.EXECUTION_FAILED,
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
let output = 'Retrieved task list';
|
|
36
|
-
const resp = response;
|
|
37
|
-
if (resp.tasks) {
|
|
38
|
-
output += `\n\nTasks (${resp.tasks.length}):\n`;
|
|
39
|
-
for (const task of resp.tasks) {
|
|
40
|
-
output += `- [${task.status || 'pending'}] ${task.title || task.name || task.id}: ${task.description || ''}\n`;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return {
|
|
44
|
-
llmContent: output,
|
|
45
|
-
returnDisplay: 'Retrieved task list',
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
catch (error) {
|
|
49
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
50
|
-
return {
|
|
51
|
-
llmContent: `Error listing tasks: ${errorMessage}`,
|
|
52
|
-
returnDisplay: `Error: ${errorMessage}`,
|
|
53
|
-
error: {
|
|
54
|
-
message: errorMessage,
|
|
55
|
-
type: types_1.ToolErrorType.EXECUTION_FAILED,
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
class TaskListTool extends base_tool_1.BaseDeclarativeTool {
|
|
62
|
-
constructor() {
|
|
63
|
-
super(TaskListTool.Name, 'TaskList', 'Retrieves a list of all tasks.', types_1.Kind.Read, {
|
|
64
|
-
properties: {},
|
|
65
|
-
required: [],
|
|
66
|
-
type: 'object',
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
createInvocation(params) {
|
|
70
|
-
return new TaskListInvocation(params);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
exports.TaskListTool = TaskListTool;
|
|
74
|
-
TaskListTool.Name = 'task_list';
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Task Management Tool - Manages tasks
|
|
3
|
-
* Wraps the SDK's taskService methods
|
|
4
|
-
*/
|
|
5
|
-
import type { ToolInvocation, ToolResult } from '../types';
|
|
6
|
-
import { BaseDeclarativeTool } from '../base-tool';
|
|
7
|
-
/**
|
|
8
|
-
* Supported task actions
|
|
9
|
-
*/
|
|
10
|
-
export type TaskActionType = 'create' | 'update' | 'delete' | 'list' | 'get' | 'assign_agent' | 'execute';
|
|
11
|
-
/**
|
|
12
|
-
* Parameters for the TaskManagement tool
|
|
13
|
-
*/
|
|
14
|
-
export interface TaskManagementToolParams {
|
|
15
|
-
/**
|
|
16
|
-
* The task action to perform
|
|
17
|
-
*/
|
|
18
|
-
action: TaskActionType;
|
|
19
|
-
/**
|
|
20
|
-
* Task ID (required for update, delete, get, assign_agent, execute)
|
|
21
|
-
*/
|
|
22
|
-
task_id?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Task title (for create)
|
|
25
|
-
*/
|
|
26
|
-
title?: string;
|
|
27
|
-
/**
|
|
28
|
-
* Task description (for create/update)
|
|
29
|
-
*/
|
|
30
|
-
description?: string;
|
|
31
|
-
/**
|
|
32
|
-
* Task status (for update)
|
|
33
|
-
*/
|
|
34
|
-
status?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Agent ID (for assign_agent/execute)
|
|
37
|
-
*/
|
|
38
|
-
agent_id?: string;
|
|
39
|
-
/**
|
|
40
|
-
* Thread ID (for create)
|
|
41
|
-
*/
|
|
42
|
-
thread_id?: string;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Implementation of the TaskManagement tool logic
|
|
46
|
-
*/
|
|
47
|
-
export declare class TaskManagementTool extends BaseDeclarativeTool<TaskManagementToolParams, ToolResult> {
|
|
48
|
-
static readonly Name: string;
|
|
49
|
-
constructor();
|
|
50
|
-
protected validateToolParamValues(params: TaskManagementToolParams): string | null;
|
|
51
|
-
protected createInvocation(params: TaskManagementToolParams): ToolInvocation<TaskManagementToolParams, ToolResult>;
|
|
52
|
-
}
|