@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.
Files changed (124) hide show
  1. package/dist/core/Codebolt.d.ts +29 -5
  2. package/dist/core/Codebolt.js +58 -0
  3. package/dist/core/websocket.js +15 -17
  4. package/dist/index.d.ts +2 -0
  5. package/dist/index.js +6 -3
  6. package/dist/modules/dynamicPanel.d.ts +106 -0
  7. package/dist/modules/dynamicPanel.js +122 -0
  8. package/dist/modules/mcp.js +3 -0
  9. package/dist/modules/swarm.d.ts +8 -2
  10. package/dist/modules/swarm.js +14 -0
  11. package/dist/tools/actionBlock/action-block-start.js +1 -4
  12. package/dist/tools/actionPlan/action-plan-create.js +1 -2
  13. package/dist/tools/completion/attempt-completion.d.ts +25 -0
  14. package/dist/tools/completion/attempt-completion.js +45 -0
  15. package/dist/tools/completion/index.d.ts +3 -0
  16. package/dist/tools/completion/index.js +9 -0
  17. package/dist/tools/index.d.ts +6 -3
  18. package/dist/tools/index.js +11 -4
  19. package/dist/tools/job/index.d.ts +3 -1
  20. package/dist/tools/job/index.js +5 -1
  21. package/dist/tools/job/job-remove-dependency.d.ts +28 -0
  22. package/dist/tools/job/job-remove-dependency.js +86 -0
  23. package/dist/tools/requirementPlan/requirement-plan-review.js +1 -1
  24. package/dist/tools/thread/thread-create-background.js +1 -1
  25. package/dist/tools/utils/schema-validator.d.ts +1 -0
  26. package/dist/tools/utils/schema-validator.js +13 -1
  27. package/dist/types/job.d.ts +1 -1
  28. package/package.json +2 -2
  29. package/dist/modules/codeboltEvent.d.ts +0 -57
  30. package/dist/modules/codeboltEvent.js +0 -217
  31. package/dist/tools/browser/browser-action.d.ts +0 -56
  32. package/dist/tools/browser/browser-action.js +0 -265
  33. package/dist/tools/codeboltEvent/event-add-running-agent.d.ts +0 -25
  34. package/dist/tools/codeboltEvent/event-add-running-agent.js +0 -69
  35. package/dist/tools/codeboltEvent/event-check-background-agent-completion.d.ts +0 -19
  36. package/dist/tools/codeboltEvent/event-check-background-agent-completion.js +0 -64
  37. package/dist/tools/codeboltEvent/event-get-running-agent-count.d.ts +0 -19
  38. package/dist/tools/codeboltEvent/event-get-running-agent-count.js +0 -55
  39. package/dist/tools/codeboltEvent/event-on-background-agent-completion.d.ts +0 -19
  40. package/dist/tools/codeboltEvent/event-on-background-agent-completion.js +0 -56
  41. package/dist/tools/codeboltEvent/event-wait-for-external-event.d.ts +0 -19
  42. package/dist/tools/codeboltEvent/event-wait-for-external-event.js +0 -55
  43. package/dist/tools/codeboltEvent/index.d.ts +0 -19
  44. package/dist/tools/codeboltEvent/index.js +0 -33
  45. package/dist/tools/event/event-add-running-agent.d.ts +0 -32
  46. package/dist/tools/event/event-add-running-agent.js +0 -77
  47. package/dist/tools/event/event-check-agent-event.d.ts +0 -19
  48. package/dist/tools/event/event-check-agent-event.js +0 -63
  49. package/dist/tools/event/event-check-completion.d.ts +0 -19
  50. package/dist/tools/event/event-check-completion.js +0 -73
  51. package/dist/tools/event/event-check-grouped-completion.d.ts +0 -19
  52. package/dist/tools/event/event-check-grouped-completion.js +0 -63
  53. package/dist/tools/event/event-get-running-count.d.ts +0 -19
  54. package/dist/tools/event/event-get-running-count.js +0 -55
  55. package/dist/tools/event/event-on-agent-event.d.ts +0 -19
  56. package/dist/tools/event/event-on-agent-event.js +0 -63
  57. package/dist/tools/event/event-on-completion.d.ts +0 -19
  58. package/dist/tools/event/event-on-completion.js +0 -73
  59. package/dist/tools/event/event-on-grouped-completion.d.ts +0 -19
  60. package/dist/tools/event/event-on-grouped-completion.js +0 -63
  61. package/dist/tools/event/event-wait-any.d.ts +0 -19
  62. package/dist/tools/event/event-wait-any.js +0 -66
  63. package/dist/tools/event/index.d.ts +0 -25
  64. package/dist/tools/event/index.js +0 -48
  65. package/dist/tools/git/git-action.d.ts +0 -48
  66. package/dist/tools/git/git-action.js +0 -279
  67. package/dist/tools/kvStore/kv-store-create-instance.d.ts +0 -26
  68. package/dist/tools/kvStore/kv-store-create-instance.js +0 -79
  69. package/dist/tools/kvStore/kv-store-get.d.ts +0 -30
  70. package/dist/tools/kvStore/kv-store-get.js +0 -80
  71. package/dist/tools/kvStore/kv-store-set.d.ts +0 -38
  72. package/dist/tools/kvStore/kv-store-set.js +0 -86
  73. package/dist/tools/memoryIngestion/mi-create-pipeline.d.ts +0 -44
  74. package/dist/tools/memoryIngestion/mi-create-pipeline.js +0 -114
  75. package/dist/tools/memoryIngestion/mi-list.d.ts +0 -22
  76. package/dist/tools/memoryIngestion/mi-list.js +0 -66
  77. package/dist/tools/orchestration/agent-details.d.ts +0 -15
  78. package/dist/tools/orchestration/agent-details.js +0 -98
  79. package/dist/tools/orchestration/agent-find.d.ts +0 -18
  80. package/dist/tools/orchestration/agent-find.js +0 -125
  81. package/dist/tools/orchestration/agent-list.d.ts +0 -13
  82. package/dist/tools/orchestration/agent-list.js +0 -106
  83. package/dist/tools/orchestration/agent-management.d.ts +0 -44
  84. package/dist/tools/orchestration/agent-management.js +0 -250
  85. package/dist/tools/orchestration/agent-start.d.ts +0 -18
  86. package/dist/tools/orchestration/agent-start.js +0 -90
  87. package/dist/tools/orchestration/index.d.ts +0 -49
  88. package/dist/tools/orchestration/index.js +0 -102
  89. package/dist/tools/orchestration/task-assign.d.ts +0 -18
  90. package/dist/tools/orchestration/task-assign.js +0 -84
  91. package/dist/tools/orchestration/task-create.d.ts +0 -20
  92. package/dist/tools/orchestration/task-create.js +0 -97
  93. package/dist/tools/orchestration/task-delete.d.ts +0 -16
  94. package/dist/tools/orchestration/task-delete.js +0 -77
  95. package/dist/tools/orchestration/task-execute.d.ts +0 -18
  96. package/dist/tools/orchestration/task-execute.js +0 -84
  97. package/dist/tools/orchestration/task-get.d.ts +0 -16
  98. package/dist/tools/orchestration/task-get.js +0 -89
  99. package/dist/tools/orchestration/task-list.d.ts +0 -13
  100. package/dist/tools/orchestration/task-list.js +0 -74
  101. package/dist/tools/orchestration/task-management.d.ts +0 -52
  102. package/dist/tools/orchestration/task-management.js +0 -231
  103. package/dist/tools/orchestration/task-update.d.ts +0 -22
  104. package/dist/tools/orchestration/task-update.js +0 -96
  105. package/dist/tools/orchestration/thread-create-background.d.ts +0 -18
  106. package/dist/tools/orchestration/thread-create-background.js +0 -94
  107. package/dist/tools/orchestration/thread-create-start.d.ts +0 -16
  108. package/dist/tools/orchestration/thread-create-start.js +0 -85
  109. package/dist/tools/orchestration/thread-create.d.ts +0 -16
  110. package/dist/tools/orchestration/thread-create.js +0 -85
  111. package/dist/tools/orchestration/thread-delete.d.ts +0 -16
  112. package/dist/tools/orchestration/thread-delete.js +0 -77
  113. package/dist/tools/orchestration/thread-get-messages.d.ts +0 -24
  114. package/dist/tools/orchestration/thread-get-messages.js +0 -122
  115. package/dist/tools/orchestration/thread-get.d.ts +0 -16
  116. package/dist/tools/orchestration/thread-get.js +0 -85
  117. package/dist/tools/orchestration/thread-list.d.ts +0 -16
  118. package/dist/tools/orchestration/thread-list.js +0 -85
  119. package/dist/tools/orchestration/thread-start.d.ts +0 -16
  120. package/dist/tools/orchestration/thread-start.js +0 -82
  121. package/dist/tools/orchestration/thread-update-status.d.ts +0 -18
  122. package/dist/tools/orchestration/thread-update-status.js +0 -89
  123. package/dist/tools/orchestration/thread-update.d.ts +0 -18
  124. package/dist/tools/orchestration/thread-update.js +0 -89
@@ -1,250 +0,0 @@
1
- "use strict";
2
- /**
3
- * Agent Management Tool - Manages agents
4
- * Wraps the SDK's codeboltAgent methods
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.AgentManagementTool = void 0;
11
- const types_1 = require("../types");
12
- const base_tool_1 = require("../base-tool");
13
- const agent_1 = __importDefault(require("../../modules/agent"));
14
- const enum_1 = require("@codebolt/types/enum");
15
- function isAgentToolFunctionDescriptor(x) {
16
- if (!x || typeof x !== 'object')
17
- return false;
18
- const maybe = x;
19
- if (maybe.type !== 'function')
20
- return false;
21
- const fn = maybe.function;
22
- if (!fn || typeof fn !== 'object')
23
- return false;
24
- const fnRec = fn;
25
- return typeof fnRec.name === 'string';
26
- }
27
- class AgentManagementToolInvocation extends base_tool_1.BaseToolInvocation {
28
- constructor(params) {
29
- super(params);
30
- }
31
- async execute() {
32
- var _a;
33
- try {
34
- const action = this.params.action;
35
- let response;
36
- let successMessage;
37
- switch (action) {
38
- case 'find':
39
- if (!this.params.task) {
40
- return this.createError("'task' is required for find action");
41
- }
42
- // findAgent requires all 5 arguments
43
- response = await agent_1.default.findAgent(this.params.task, this.params.max_results || 3, [], // agents filter
44
- enum_1.AgentLocation.ALL, enum_1.FilterUsing.USE_VECTOR_DB);
45
- successMessage = `Found agents for task: ${this.params.task}`;
46
- break;
47
- case 'start':
48
- if (!this.params.agent_id) {
49
- return this.createError("'agent_id' is required for start action");
50
- }
51
- if (!this.params.task) {
52
- return this.createError("'task' is required for start action");
53
- }
54
- response = await agent_1.default.startAgent(this.params.agent_id, this.params.task);
55
- successMessage = `Started agent ${this.params.agent_id} with task`;
56
- break;
57
- case 'list':
58
- response = await agent_1.default.getAgentsList();
59
- successMessage = 'Retrieved agent list';
60
- break;
61
- case 'details':
62
- response = await agent_1.default.getAgentsDetail(this.params.agent_list || []);
63
- successMessage = 'Retrieved agent details';
64
- break;
65
- default:
66
- return this.createError(`Unknown action: ${action}`);
67
- }
68
- // Check for errors with strict type checking
69
- if (response && response.success === false) {
70
- const errorMsg = typeof response.error === 'string'
71
- ? response.error
72
- : (response.error && typeof response.error === 'object' && 'message' in response.error)
73
- ? String(response.error.message)
74
- : 'Agent operation failed';
75
- return {
76
- llmContent: `Agent ${action} failed: ${errorMsg}`,
77
- returnDisplay: `Error: ${errorMsg}`,
78
- error: {
79
- message: errorMsg,
80
- type: types_1.ToolErrorType.AGENT_NOT_FOUND,
81
- },
82
- };
83
- }
84
- // Format output with strict type checking
85
- let output = successMessage;
86
- if (action === 'find') {
87
- const findResponse = response;
88
- if (findResponse.agents && Array.isArray(findResponse.agents)) {
89
- output += `\n\nMatching Agents (${findResponse.agents.length}):\n`;
90
- for (const agent of findResponse.agents) {
91
- // findAgent commonly returns the same tool/function descriptor shape as listAgents
92
- const agentId = isAgentToolFunctionDescriptor(agent)
93
- ? agent.function.name
94
- : (agent && typeof agent === 'object' && ('id' in agent || 'name' in agent))
95
- ? String(agent.id || agent.name)
96
- : 'Unknown';
97
- const agentDesc = isAgentToolFunctionDescriptor(agent)
98
- ? (agent.function.description || 'No description')
99
- : (agent && typeof agent === 'object' && 'description' in agent)
100
- ? String(agent.description || 'No description')
101
- : 'No description';
102
- output += `- ${agentId}: ${agentDesc}\n`;
103
- if (agent && typeof agent === 'object' && 'score' in agent && typeof agent.score === 'number') {
104
- output += ` Score: ${(agent.score).toFixed(2)}\n`;
105
- }
106
- }
107
- }
108
- }
109
- else if (action === 'list') {
110
- const listResponse = response;
111
- if (listResponse.agents && Array.isArray(listResponse.agents)) {
112
- output += `\n\nAvailable Agents (${listResponse.agents.length}):\n`;
113
- for (const agent of listResponse.agents) {
114
- const agentId = isAgentToolFunctionDescriptor(agent)
115
- ? agent.function.name
116
- : (agent && typeof agent === 'object' && ('id' in agent || 'name' in agent))
117
- ? String(agent.id || agent.name)
118
- : 'Unknown';
119
- const agentDesc = isAgentToolFunctionDescriptor(agent)
120
- ? (agent.function.description || 'No description')
121
- : (agent && typeof agent === 'object' && 'description' in agent)
122
- ? String(agent.description || 'No description')
123
- : 'No description';
124
- output += `- ${agentId}: ${agentDesc}\n`;
125
- }
126
- }
127
- }
128
- else if (action === 'details') {
129
- const detailResponse = response;
130
- const agents = (_a = detailResponse.payload) === null || _a === void 0 ? void 0 : _a.agents;
131
- if (agents && Array.isArray(agents)) {
132
- output += `\n\nAgent Details:\n`;
133
- for (const agent of agents) {
134
- if (agent && typeof agent === 'object') {
135
- const agentId = ('id' in agent || 'name' in agent)
136
- ? String(agent.id || agent.name)
137
- : 'Unknown';
138
- output += `\n--- ${agentId} ---\n`;
139
- const agentDesc = ('description' in agent)
140
- ? String(agent.description || 'N/A')
141
- : 'N/A';
142
- output += `Description: ${agentDesc}\n`;
143
- if ('capabilities' in agent && Array.isArray(agent.capabilities)) {
144
- const capabilities = agent.capabilities;
145
- output += `Capabilities: ${capabilities.map(c => String(c)).join(', ')}\n`;
146
- }
147
- if ('status' in agent) {
148
- output += `Status: ${String(agent.status)}\n`;
149
- }
150
- }
151
- }
152
- }
153
- }
154
- else if (action === 'start') {
155
- const startResponse = response;
156
- output += `\n\nAgent started successfully.`;
157
- if (startResponse.result !== undefined) {
158
- output += `\nResult: ${typeof startResponse.result === 'string' ? startResponse.result : JSON.stringify(startResponse.result, null, 2)}`;
159
- }
160
- }
161
- return {
162
- llmContent: output,
163
- returnDisplay: successMessage,
164
- };
165
- }
166
- catch (error) {
167
- const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
168
- return {
169
- llmContent: `Error executing agent ${this.params.action}: ${errorMessage}`,
170
- returnDisplay: `Error: ${errorMessage}`,
171
- error: {
172
- message: errorMessage,
173
- type: types_1.ToolErrorType.EXECUTION_FAILED,
174
- },
175
- };
176
- }
177
- }
178
- createError(message) {
179
- return {
180
- llmContent: `Error: ${message}`,
181
- returnDisplay: `Error: ${message}`,
182
- error: {
183
- message,
184
- type: types_1.ToolErrorType.INVALID_TOOL_PARAMS,
185
- },
186
- };
187
- }
188
- }
189
- /**
190
- * Implementation of the AgentManagement tool logic
191
- */
192
- class AgentManagementTool extends base_tool_1.BaseDeclarativeTool {
193
- constructor() {
194
- super(AgentManagementTool.Name, 'AgentManagement', `Manages agents - find agents for tasks, start agents, list available agents, and get agent details. Use this for multi-agent coordination.`, types_1.Kind.Other, {
195
- properties: {
196
- action: {
197
- description: "The agent action: 'find', 'start', 'list', or 'details'.",
198
- type: 'string',
199
- enum: ['find', 'start', 'list', 'details'],
200
- },
201
- task: {
202
- description: 'Task description (required for find/start).',
203
- type: 'string',
204
- },
205
- agent_id: {
206
- description: 'Agent ID (required for start).',
207
- type: 'string',
208
- },
209
- agent_list: {
210
- description: 'List of agent IDs (for details).',
211
- type: 'array',
212
- items: { type: 'string' },
213
- },
214
- max_results: {
215
- description: 'Maximum number of results (for find, default: 3).',
216
- type: 'number',
217
- },
218
- },
219
- required: ['action'],
220
- type: 'object',
221
- });
222
- }
223
- validateToolParamValues(params) {
224
- const validActions = ['find', 'start', 'list', 'details'];
225
- if (!validActions.includes(params.action)) {
226
- return `Invalid action: ${params.action}. Must be one of: ${validActions.join(', ')}`;
227
- }
228
- switch (params.action) {
229
- case 'find':
230
- if (!params.task) {
231
- return "'task' is required for find action";
232
- }
233
- break;
234
- case 'start':
235
- if (!params.agent_id) {
236
- return "'agent_id' is required for start action";
237
- }
238
- if (!params.task) {
239
- return "'task' is required for start action";
240
- }
241
- break;
242
- }
243
- return null;
244
- }
245
- createInvocation(params) {
246
- return new AgentManagementToolInvocation(params);
247
- }
248
- }
249
- exports.AgentManagementTool = AgentManagementTool;
250
- AgentManagementTool.Name = 'agent_management';
@@ -1,18 +0,0 @@
1
- /**
2
- * Agent Start Tool - Starts an agent with a task
3
- * Wraps the SDK's codeboltAgent.startAgent() method
4
- */
5
- import type { ToolInvocation, ToolResult } from '../types';
6
- import { BaseDeclarativeTool } from '../base-tool';
7
- export interface AgentStartParams {
8
- /** The agent ID to start */
9
- agent_id: string;
10
- /** The task for the agent */
11
- task: string;
12
- }
13
- export declare class AgentStartTool extends BaseDeclarativeTool<AgentStartParams, ToolResult> {
14
- static readonly Name: string;
15
- constructor();
16
- protected validateToolParamValues(params: AgentStartParams): string | null;
17
- protected createInvocation(params: AgentStartParams): ToolInvocation<AgentStartParams, ToolResult>;
18
- }
@@ -1,90 +0,0 @@
1
- "use strict";
2
- /**
3
- * Agent Start Tool - Starts an agent with a task
4
- * Wraps the SDK's codeboltAgent.startAgent() 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.AgentStartTool = void 0;
11
- const types_1 = require("../types");
12
- const base_tool_1 = require("../base-tool");
13
- const agent_1 = __importDefault(require("../../modules/agent"));
14
- class AgentStartInvocation extends base_tool_1.BaseToolInvocation {
15
- constructor(params) {
16
- super(params);
17
- }
18
- async execute() {
19
- try {
20
- const response = await agent_1.default.startAgent(this.params.agent_id, this.params.task);
21
- if (response && response.success === false) {
22
- const errorMsg = typeof response.error === 'string'
23
- ? response.error
24
- : (response.error && typeof response.error === 'object' && 'message' in response.error)
25
- ? String(response.error.message)
26
- : 'Agent start failed';
27
- return {
28
- llmContent: `Agent start failed: ${errorMsg}`,
29
- returnDisplay: `Error: ${errorMsg}`,
30
- error: {
31
- message: errorMsg,
32
- type: types_1.ToolErrorType.AGENT_NOT_FOUND,
33
- },
34
- };
35
- }
36
- let output = `Started agent ${this.params.agent_id} with task`;
37
- output += `\n\nAgent started successfully.`;
38
- if (response.result !== undefined) {
39
- output += `\nResult: ${typeof response.result === 'string' ? response.result : JSON.stringify(response.result, null, 2)}`;
40
- }
41
- return {
42
- llmContent: output,
43
- returnDisplay: `Started agent ${this.params.agent_id} with task`,
44
- };
45
- }
46
- catch (error) {
47
- const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
48
- return {
49
- llmContent: `Error starting agent: ${errorMessage}`,
50
- returnDisplay: `Error: ${errorMessage}`,
51
- error: {
52
- message: errorMessage,
53
- type: types_1.ToolErrorType.EXECUTION_FAILED,
54
- },
55
- };
56
- }
57
- }
58
- }
59
- class AgentStartTool extends base_tool_1.BaseDeclarativeTool {
60
- constructor() {
61
- super(AgentStartTool.Name, 'AgentStart', 'Starts an agent with a specific task.', types_1.Kind.Execute, {
62
- properties: {
63
- agent_id: {
64
- description: 'The ID of the agent to start.',
65
- type: 'string',
66
- },
67
- task: {
68
- description: 'The task for the agent to execute.',
69
- type: 'string',
70
- },
71
- },
72
- required: ['agent_id', 'task'],
73
- type: 'object',
74
- });
75
- }
76
- validateToolParamValues(params) {
77
- if (!params.agent_id || params.agent_id.trim() === '') {
78
- return "'agent_id' is required for agent start";
79
- }
80
- if (!params.task || params.task.trim() === '') {
81
- return "'task' is required for agent start";
82
- }
83
- return null;
84
- }
85
- createInvocation(params) {
86
- return new AgentStartInvocation(params);
87
- }
88
- }
89
- exports.AgentStartTool = AgentStartTool;
90
- AgentStartTool.Name = 'agent_start';
@@ -1,49 +0,0 @@
1
- /**
2
- * Orchestration tools - Individual tools for task, agent, and thread management
3
- */
4
- export { TaskCreateTool, type TaskCreateParams } from './task-create';
5
- export { TaskUpdateTool, type TaskUpdateParams } from './task-update';
6
- export { TaskDeleteTool, type TaskDeleteParams } from './task-delete';
7
- export { TaskListTool, type TaskListParams } from './task-list';
8
- export { TaskGetTool, type TaskGetParams } from './task-get';
9
- export { TaskAssignTool, type TaskAssignParams } from './task-assign';
10
- export { TaskExecuteTool, type TaskExecuteParams } from './task-execute';
11
- export { AgentFindTool, type AgentFindParams } from './agent-find';
12
- export { AgentStartTool, type AgentStartParams } from './agent-start';
13
- export { AgentListTool, type AgentListParams } from './agent-list';
14
- export { AgentDetailsTool, type AgentDetailsParams } from './agent-details';
15
- export { ThreadCreateTool, type ThreadCreateParams } from './thread-create';
16
- export { ThreadCreateStartTool, type ThreadCreateStartParams } from './thread-create-start';
17
- export { ThreadCreateBackgroundTool, type ThreadCreateBackgroundParams } from './thread-create-background';
18
- export { ThreadListTool, type ThreadListParams } from './thread-list';
19
- export { ThreadGetTool, type ThreadGetParams } from './thread-get';
20
- export { ThreadStartTool, type ThreadStartParams } from './thread-start';
21
- export { ThreadUpdateTool, type ThreadUpdateParams } from './thread-update';
22
- export { ThreadDeleteTool, type ThreadDeleteParams } from './thread-delete';
23
- export { ThreadGetMessagesTool, type ThreadGetMessagesParams } from './thread-get-messages';
24
- export { ThreadUpdateStatusTool, type ThreadUpdateStatusParams } from './thread-update-status';
25
- import { TaskCreateTool } from './task-create';
26
- import { TaskUpdateTool } from './task-update';
27
- import { TaskDeleteTool } from './task-delete';
28
- import { TaskListTool } from './task-list';
29
- import { TaskGetTool } from './task-get';
30
- import { TaskAssignTool } from './task-assign';
31
- import { TaskExecuteTool } from './task-execute';
32
- import { AgentFindTool } from './agent-find';
33
- import { AgentStartTool } from './agent-start';
34
- import { AgentListTool } from './agent-list';
35
- import { AgentDetailsTool } from './agent-details';
36
- import { ThreadCreateTool } from './thread-create';
37
- import { ThreadCreateStartTool } from './thread-create-start';
38
- import { ThreadCreateBackgroundTool } from './thread-create-background';
39
- import { ThreadListTool } from './thread-list';
40
- import { ThreadGetTool } from './thread-get';
41
- import { ThreadStartTool } from './thread-start';
42
- import { ThreadUpdateTool } from './thread-update';
43
- import { ThreadDeleteTool } from './thread-delete';
44
- import { ThreadGetMessagesTool } from './thread-get-messages';
45
- import { ThreadUpdateStatusTool } from './thread-update-status';
46
- /**
47
- * All orchestration tools
48
- */
49
- export declare const orchestrationTools: (TaskCreateTool | TaskUpdateTool | TaskDeleteTool | TaskListTool | TaskGetTool | TaskAssignTool | TaskExecuteTool | AgentFindTool | AgentStartTool | AgentListTool | AgentDetailsTool | ThreadCreateTool | ThreadCreateStartTool | ThreadCreateBackgroundTool | ThreadListTool | ThreadGetTool | ThreadStartTool | ThreadUpdateTool | ThreadDeleteTool | ThreadGetMessagesTool | ThreadUpdateStatusTool)[];
@@ -1,102 +0,0 @@
1
- "use strict";
2
- /**
3
- * Orchestration tools - Individual tools for task, agent, and thread management
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.orchestrationTools = exports.ThreadUpdateStatusTool = exports.ThreadGetMessagesTool = exports.ThreadDeleteTool = exports.ThreadUpdateTool = exports.ThreadStartTool = exports.ThreadGetTool = exports.ThreadListTool = exports.ThreadCreateBackgroundTool = exports.ThreadCreateStartTool = exports.ThreadCreateTool = exports.AgentDetailsTool = exports.AgentListTool = exports.AgentStartTool = exports.AgentFindTool = exports.TaskExecuteTool = exports.TaskAssignTool = exports.TaskGetTool = exports.TaskListTool = exports.TaskDeleteTool = exports.TaskUpdateTool = exports.TaskCreateTool = void 0;
7
- // Task tools
8
- var task_create_1 = require("./task-create");
9
- Object.defineProperty(exports, "TaskCreateTool", { enumerable: true, get: function () { return task_create_1.TaskCreateTool; } });
10
- var task_update_1 = require("./task-update");
11
- Object.defineProperty(exports, "TaskUpdateTool", { enumerable: true, get: function () { return task_update_1.TaskUpdateTool; } });
12
- var task_delete_1 = require("./task-delete");
13
- Object.defineProperty(exports, "TaskDeleteTool", { enumerable: true, get: function () { return task_delete_1.TaskDeleteTool; } });
14
- var task_list_1 = require("./task-list");
15
- Object.defineProperty(exports, "TaskListTool", { enumerable: true, get: function () { return task_list_1.TaskListTool; } });
16
- var task_get_1 = require("./task-get");
17
- Object.defineProperty(exports, "TaskGetTool", { enumerable: true, get: function () { return task_get_1.TaskGetTool; } });
18
- var task_assign_1 = require("./task-assign");
19
- Object.defineProperty(exports, "TaskAssignTool", { enumerable: true, get: function () { return task_assign_1.TaskAssignTool; } });
20
- var task_execute_1 = require("./task-execute");
21
- Object.defineProperty(exports, "TaskExecuteTool", { enumerable: true, get: function () { return task_execute_1.TaskExecuteTool; } });
22
- // Agent tools
23
- var agent_find_1 = require("./agent-find");
24
- Object.defineProperty(exports, "AgentFindTool", { enumerable: true, get: function () { return agent_find_1.AgentFindTool; } });
25
- var agent_start_1 = require("./agent-start");
26
- Object.defineProperty(exports, "AgentStartTool", { enumerable: true, get: function () { return agent_start_1.AgentStartTool; } });
27
- var agent_list_1 = require("./agent-list");
28
- Object.defineProperty(exports, "AgentListTool", { enumerable: true, get: function () { return agent_list_1.AgentListTool; } });
29
- var agent_details_1 = require("./agent-details");
30
- Object.defineProperty(exports, "AgentDetailsTool", { enumerable: true, get: function () { return agent_details_1.AgentDetailsTool; } });
31
- // Thread tools
32
- var thread_create_1 = require("./thread-create");
33
- Object.defineProperty(exports, "ThreadCreateTool", { enumerable: true, get: function () { return thread_create_1.ThreadCreateTool; } });
34
- var thread_create_start_1 = require("./thread-create-start");
35
- Object.defineProperty(exports, "ThreadCreateStartTool", { enumerable: true, get: function () { return thread_create_start_1.ThreadCreateStartTool; } });
36
- var thread_create_background_1 = require("./thread-create-background");
37
- Object.defineProperty(exports, "ThreadCreateBackgroundTool", { enumerable: true, get: function () { return thread_create_background_1.ThreadCreateBackgroundTool; } });
38
- var thread_list_1 = require("./thread-list");
39
- Object.defineProperty(exports, "ThreadListTool", { enumerable: true, get: function () { return thread_list_1.ThreadListTool; } });
40
- var thread_get_1 = require("./thread-get");
41
- Object.defineProperty(exports, "ThreadGetTool", { enumerable: true, get: function () { return thread_get_1.ThreadGetTool; } });
42
- var thread_start_1 = require("./thread-start");
43
- Object.defineProperty(exports, "ThreadStartTool", { enumerable: true, get: function () { return thread_start_1.ThreadStartTool; } });
44
- var thread_update_1 = require("./thread-update");
45
- Object.defineProperty(exports, "ThreadUpdateTool", { enumerable: true, get: function () { return thread_update_1.ThreadUpdateTool; } });
46
- var thread_delete_1 = require("./thread-delete");
47
- Object.defineProperty(exports, "ThreadDeleteTool", { enumerable: true, get: function () { return thread_delete_1.ThreadDeleteTool; } });
48
- var thread_get_messages_1 = require("./thread-get-messages");
49
- Object.defineProperty(exports, "ThreadGetMessagesTool", { enumerable: true, get: function () { return thread_get_messages_1.ThreadGetMessagesTool; } });
50
- var thread_update_status_1 = require("./thread-update-status");
51
- Object.defineProperty(exports, "ThreadUpdateStatusTool", { enumerable: true, get: function () { return thread_update_status_1.ThreadUpdateStatusTool; } });
52
- // Create instances for convenience
53
- const task_create_2 = require("./task-create");
54
- const task_update_2 = require("./task-update");
55
- const task_delete_2 = require("./task-delete");
56
- const task_list_2 = require("./task-list");
57
- const task_get_2 = require("./task-get");
58
- const task_assign_2 = require("./task-assign");
59
- const task_execute_2 = require("./task-execute");
60
- const agent_find_2 = require("./agent-find");
61
- const agent_start_2 = require("./agent-start");
62
- const agent_list_2 = require("./agent-list");
63
- const agent_details_2 = require("./agent-details");
64
- const thread_create_2 = require("./thread-create");
65
- const thread_create_start_2 = require("./thread-create-start");
66
- const thread_create_background_2 = require("./thread-create-background");
67
- const thread_list_2 = require("./thread-list");
68
- const thread_get_2 = require("./thread-get");
69
- const thread_start_2 = require("./thread-start");
70
- const thread_update_2 = require("./thread-update");
71
- const thread_delete_2 = require("./thread-delete");
72
- const thread_get_messages_2 = require("./thread-get-messages");
73
- const thread_update_status_2 = require("./thread-update-status");
74
- /**
75
- * All orchestration tools
76
- */
77
- exports.orchestrationTools = [
78
- // Task tools
79
- new task_create_2.TaskCreateTool(),
80
- new task_update_2.TaskUpdateTool(),
81
- new task_delete_2.TaskDeleteTool(),
82
- new task_list_2.TaskListTool(),
83
- new task_get_2.TaskGetTool(),
84
- new task_assign_2.TaskAssignTool(),
85
- new task_execute_2.TaskExecuteTool(),
86
- // Agent tools
87
- new agent_find_2.AgentFindTool(),
88
- new agent_start_2.AgentStartTool(),
89
- new agent_list_2.AgentListTool(),
90
- new agent_details_2.AgentDetailsTool(),
91
- // Thread tools
92
- new thread_create_2.ThreadCreateTool(),
93
- new thread_create_start_2.ThreadCreateStartTool(),
94
- new thread_create_background_2.ThreadCreateBackgroundTool(),
95
- new thread_list_2.ThreadListTool(),
96
- new thread_get_2.ThreadGetTool(),
97
- new thread_start_2.ThreadStartTool(),
98
- new thread_update_2.ThreadUpdateTool(),
99
- new thread_delete_2.ThreadDeleteTool(),
100
- new thread_get_messages_2.ThreadGetMessagesTool(),
101
- new thread_update_status_2.ThreadUpdateStatusTool(),
102
- ];
@@ -1,18 +0,0 @@
1
- /**
2
- * Task Assign Tool - Assigns an agent to a task
3
- * Wraps the SDK's taskService.assignAgentToTask() method
4
- */
5
- import type { ToolInvocation, ToolResult } from '../types';
6
- import { BaseDeclarativeTool } from '../base-tool';
7
- export interface TaskAssignParams {
8
- /** The task ID to assign */
9
- task_id: string;
10
- /** The agent ID to assign to the task */
11
- agent_id: string;
12
- }
13
- export declare class TaskAssignTool extends BaseDeclarativeTool<TaskAssignParams, ToolResult> {
14
- static readonly Name: string;
15
- constructor();
16
- protected validateToolParamValues(params: TaskAssignParams): string | null;
17
- protected createInvocation(params: TaskAssignParams): ToolInvocation<TaskAssignParams, ToolResult>;
18
- }
@@ -1,84 +0,0 @@
1
- "use strict";
2
- /**
3
- * Task Assign Tool - Assigns an agent to a task
4
- * Wraps the SDK's taskService.assignAgentToTask() 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.TaskAssignTool = 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 TaskAssignInvocation 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.assignAgentToTask(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 assignment failed';
26
- return {
27
- llmContent: `Task assignment 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: `Assigned agent ${this.params.agent_id} to task ${this.params.task_id}`,
37
- returnDisplay: `Assigned agent ${this.params.agent_id} to 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 assigning agent to 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 TaskAssignTool extends base_tool_1.BaseDeclarativeTool {
54
- constructor() {
55
- super(TaskAssignTool.Name, 'TaskAssign', 'Assigns an agent to a task.', types_1.Kind.Other, {
56
- properties: {
57
- task_id: {
58
- description: 'The ID of the task.',
59
- type: 'string',
60
- },
61
- agent_id: {
62
- description: 'The ID of the agent to assign.',
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 assign";
73
- }
74
- if (!params.agent_id || params.agent_id.trim() === '') {
75
- return "'agent_id' is required for task assign";
76
- }
77
- return null;
78
- }
79
- createInvocation(params) {
80
- return new TaskAssignInvocation(params);
81
- }
82
- }
83
- exports.TaskAssignTool = TaskAssignTool;
84
- TaskAssignTool.Name = 'task_assign';
@@ -1,20 +0,0 @@
1
- /**
2
- * Task Create Tool - Creates a new task
3
- * Wraps the SDK's taskService.createTask() method
4
- */
5
- import type { ToolInvocation, ToolResult } from '../types';
6
- import { BaseDeclarativeTool } from '../base-tool';
7
- export interface TaskCreateParams {
8
- /** Task title/name */
9
- title: string;
10
- /** Task description */
11
- description?: string;
12
- /** Thread ID for the task */
13
- thread_id?: string;
14
- }
15
- export declare class TaskCreateTool extends BaseDeclarativeTool<TaskCreateParams, ToolResult> {
16
- static readonly Name: string;
17
- constructor();
18
- protected validateToolParamValues(params: TaskCreateParams): string | null;
19
- protected createInvocation(params: TaskCreateParams): ToolInvocation<TaskCreateParams, ToolResult>;
20
- }