@codebolt/codeboltjs 5.0.7 → 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 (154) hide show
  1. package/dist/core/Codebolt.d.ts +331 -303
  2. package/dist/core/Codebolt.js +58 -0
  3. package/dist/core/websocket.js +15 -17
  4. package/dist/index.d.ts +67 -29
  5. package/dist/index.js +124 -9
  6. package/dist/modules/agentDeliberation.d.ts +1 -1
  7. package/dist/modules/agentDeliberation.js +9 -9
  8. package/dist/modules/agentEventQueue.d.ts +3 -3
  9. package/dist/modules/agentEventQueue.js +4 -4
  10. package/dist/modules/autoTesting.d.ts +1 -1
  11. package/dist/modules/autoTesting.js +19 -19
  12. package/dist/modules/backgroundChildThreads.js +22 -4
  13. package/dist/modules/codebaseSearch.d.ts +1 -1
  14. package/dist/modules/codemap.d.ts +1 -1
  15. package/dist/modules/contextAssembly.d.ts +1 -1
  16. package/dist/modules/contextRuleEngine.d.ts +1 -1
  17. package/dist/modules/dynamicPanel.d.ts +106 -0
  18. package/dist/modules/dynamicPanel.js +122 -0
  19. package/dist/modules/eventLog.d.ts +1 -1
  20. package/dist/modules/fileUpdateIntent.d.ts +1 -1
  21. package/dist/modules/groupFeedback.d.ts +2 -2
  22. package/dist/modules/groupFeedback.js +8 -8
  23. package/dist/modules/hook.d.ts +1 -1
  24. package/dist/modules/job.d.ts +1 -1
  25. package/dist/modules/knowledgeGraph.d.ts +1 -1
  26. package/dist/modules/kvStore.d.ts +1 -1
  27. package/dist/modules/mcp.js +6 -3
  28. package/dist/modules/memoryIngestion.d.ts +1 -1
  29. package/dist/modules/orchestrator.js +1 -1
  30. package/dist/modules/persistentMemory.d.ts +1 -1
  31. package/dist/modules/projectStructure.d.ts +1 -1
  32. package/dist/modules/projectStructureUpdateRequest.d.ts +1 -1
  33. package/dist/modules/reviewMergeRequest.d.ts +6 -2
  34. package/dist/modules/roadmap.d.ts +1 -1
  35. package/dist/modules/swarm.d.ts +8 -2
  36. package/dist/modules/swarm.js +14 -0
  37. package/dist/modules/user-message-manager.js +4 -4
  38. package/dist/tools/actionBlock/action-block-start.js +1 -4
  39. package/dist/tools/actionPlan/action-plan-create.js +1 -2
  40. package/dist/tools/completion/attempt-completion.d.ts +25 -0
  41. package/dist/tools/completion/attempt-completion.js +45 -0
  42. package/dist/tools/completion/index.d.ts +3 -0
  43. package/dist/tools/completion/index.js +9 -0
  44. package/dist/tools/index.d.ts +6 -3
  45. package/dist/tools/index.js +59 -57
  46. package/dist/tools/job/index.d.ts +3 -1
  47. package/dist/tools/job/index.js +5 -1
  48. package/dist/tools/job/job-remove-dependency.d.ts +28 -0
  49. package/dist/tools/job/job-remove-dependency.js +86 -0
  50. package/dist/tools/requirementPlan/requirement-plan-add-section.js +1 -1
  51. package/dist/tools/requirementPlan/requirement-plan-review.js +1 -1
  52. package/dist/tools/review/review-create.js +1 -1
  53. package/dist/tools/reviewMergeRequest/rmr-create.js +3 -2
  54. package/dist/tools/thread/thread-create-background.js +1 -1
  55. package/dist/tools/utils/schema-validator.d.ts +1 -0
  56. package/dist/tools/utils/schema-validator.js +13 -1
  57. package/dist/types/job.d.ts +1 -1
  58. package/package.json +2 -2
  59. package/dist/modules/codeboltEvent.d.ts +0 -57
  60. package/dist/modules/codeboltEvent.js +0 -217
  61. package/dist/tools/browser/browser-action.d.ts +0 -56
  62. package/dist/tools/browser/browser-action.js +0 -265
  63. package/dist/tools/codeboltEvent/event-add-running-agent.d.ts +0 -25
  64. package/dist/tools/codeboltEvent/event-add-running-agent.js +0 -69
  65. package/dist/tools/codeboltEvent/event-check-background-agent-completion.d.ts +0 -19
  66. package/dist/tools/codeboltEvent/event-check-background-agent-completion.js +0 -64
  67. package/dist/tools/codeboltEvent/event-get-running-agent-count.d.ts +0 -19
  68. package/dist/tools/codeboltEvent/event-get-running-agent-count.js +0 -55
  69. package/dist/tools/codeboltEvent/event-on-background-agent-completion.d.ts +0 -19
  70. package/dist/tools/codeboltEvent/event-on-background-agent-completion.js +0 -56
  71. package/dist/tools/codeboltEvent/event-wait-for-external-event.d.ts +0 -19
  72. package/dist/tools/codeboltEvent/event-wait-for-external-event.js +0 -55
  73. package/dist/tools/codeboltEvent/index.d.ts +0 -19
  74. package/dist/tools/codeboltEvent/index.js +0 -33
  75. package/dist/tools/event/event-add-running-agent.d.ts +0 -32
  76. package/dist/tools/event/event-add-running-agent.js +0 -77
  77. package/dist/tools/event/event-check-agent-event.d.ts +0 -19
  78. package/dist/tools/event/event-check-agent-event.js +0 -63
  79. package/dist/tools/event/event-check-completion.d.ts +0 -19
  80. package/dist/tools/event/event-check-completion.js +0 -73
  81. package/dist/tools/event/event-check-grouped-completion.d.ts +0 -19
  82. package/dist/tools/event/event-check-grouped-completion.js +0 -63
  83. package/dist/tools/event/event-get-running-count.d.ts +0 -19
  84. package/dist/tools/event/event-get-running-count.js +0 -55
  85. package/dist/tools/event/event-on-agent-event.d.ts +0 -19
  86. package/dist/tools/event/event-on-agent-event.js +0 -63
  87. package/dist/tools/event/event-on-completion.d.ts +0 -19
  88. package/dist/tools/event/event-on-completion.js +0 -73
  89. package/dist/tools/event/event-on-grouped-completion.d.ts +0 -19
  90. package/dist/tools/event/event-on-grouped-completion.js +0 -63
  91. package/dist/tools/event/event-wait-any.d.ts +0 -19
  92. package/dist/tools/event/event-wait-any.js +0 -66
  93. package/dist/tools/event/index.d.ts +0 -25
  94. package/dist/tools/event/index.js +0 -48
  95. package/dist/tools/git/git-action.d.ts +0 -48
  96. package/dist/tools/git/git-action.js +0 -279
  97. package/dist/tools/kvStore/kv-store-create-instance.d.ts +0 -26
  98. package/dist/tools/kvStore/kv-store-create-instance.js +0 -79
  99. package/dist/tools/kvStore/kv-store-get.d.ts +0 -30
  100. package/dist/tools/kvStore/kv-store-get.js +0 -80
  101. package/dist/tools/kvStore/kv-store-set.d.ts +0 -38
  102. package/dist/tools/kvStore/kv-store-set.js +0 -86
  103. package/dist/tools/memoryIngestion/mi-create-pipeline.d.ts +0 -44
  104. package/dist/tools/memoryIngestion/mi-create-pipeline.js +0 -114
  105. package/dist/tools/memoryIngestion/mi-list.d.ts +0 -22
  106. package/dist/tools/memoryIngestion/mi-list.js +0 -66
  107. package/dist/tools/orchestration/agent-details.d.ts +0 -15
  108. package/dist/tools/orchestration/agent-details.js +0 -98
  109. package/dist/tools/orchestration/agent-find.d.ts +0 -18
  110. package/dist/tools/orchestration/agent-find.js +0 -125
  111. package/dist/tools/orchestration/agent-list.d.ts +0 -13
  112. package/dist/tools/orchestration/agent-list.js +0 -106
  113. package/dist/tools/orchestration/agent-management.d.ts +0 -44
  114. package/dist/tools/orchestration/agent-management.js +0 -250
  115. package/dist/tools/orchestration/agent-start.d.ts +0 -18
  116. package/dist/tools/orchestration/agent-start.js +0 -90
  117. package/dist/tools/orchestration/index.d.ts +0 -49
  118. package/dist/tools/orchestration/index.js +0 -102
  119. package/dist/tools/orchestration/task-assign.d.ts +0 -18
  120. package/dist/tools/orchestration/task-assign.js +0 -84
  121. package/dist/tools/orchestration/task-create.d.ts +0 -20
  122. package/dist/tools/orchestration/task-create.js +0 -97
  123. package/dist/tools/orchestration/task-delete.d.ts +0 -16
  124. package/dist/tools/orchestration/task-delete.js +0 -77
  125. package/dist/tools/orchestration/task-execute.d.ts +0 -18
  126. package/dist/tools/orchestration/task-execute.js +0 -84
  127. package/dist/tools/orchestration/task-get.d.ts +0 -16
  128. package/dist/tools/orchestration/task-get.js +0 -89
  129. package/dist/tools/orchestration/task-list.d.ts +0 -13
  130. package/dist/tools/orchestration/task-list.js +0 -74
  131. package/dist/tools/orchestration/task-management.d.ts +0 -52
  132. package/dist/tools/orchestration/task-management.js +0 -231
  133. package/dist/tools/orchestration/task-update.d.ts +0 -22
  134. package/dist/tools/orchestration/task-update.js +0 -96
  135. package/dist/tools/orchestration/thread-create-background.d.ts +0 -18
  136. package/dist/tools/orchestration/thread-create-background.js +0 -94
  137. package/dist/tools/orchestration/thread-create-start.d.ts +0 -16
  138. package/dist/tools/orchestration/thread-create-start.js +0 -85
  139. package/dist/tools/orchestration/thread-create.d.ts +0 -16
  140. package/dist/tools/orchestration/thread-create.js +0 -85
  141. package/dist/tools/orchestration/thread-delete.d.ts +0 -16
  142. package/dist/tools/orchestration/thread-delete.js +0 -77
  143. package/dist/tools/orchestration/thread-get-messages.d.ts +0 -24
  144. package/dist/tools/orchestration/thread-get-messages.js +0 -122
  145. package/dist/tools/orchestration/thread-get.d.ts +0 -16
  146. package/dist/tools/orchestration/thread-get.js +0 -85
  147. package/dist/tools/orchestration/thread-list.d.ts +0 -16
  148. package/dist/tools/orchestration/thread-list.js +0 -85
  149. package/dist/tools/orchestration/thread-start.d.ts +0 -16
  150. package/dist/tools/orchestration/thread-start.js +0 -82
  151. package/dist/tools/orchestration/thread-update-status.d.ts +0 -18
  152. package/dist/tools/orchestration/thread-update-status.js +0 -89
  153. package/dist/tools/orchestration/thread-update.d.ts +0 -18
  154. package/dist/tools/orchestration/thread-update.js +0 -89
@@ -1,94 +0,0 @@
1
- "use strict";
2
- /**
3
- * Thread Create Background Tool - Creates a thread in the background
4
- * Wraps the SDK's threadService.createThreadInBackground() 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.ThreadCreateBackgroundTool = void 0;
11
- const types_1 = require("../types");
12
- const base_tool_1 = require("../base-tool");
13
- const thread_1 = __importDefault(require("../../modules/thread"));
14
- class ThreadCreateBackgroundInvocation extends base_tool_1.BaseToolInvocation {
15
- constructor(params) {
16
- super(params);
17
- }
18
- async execute() {
19
- var _a;
20
- try {
21
- // Include groupId in options if provided
22
- const optionsWithGroup = {
23
- ...this.params.options,
24
- groupId: this.params.groupId,
25
- };
26
- const response = await thread_1.default.createThreadInBackground(optionsWithGroup);
27
- if (response && !response.success && response.success !== undefined) {
28
- const errorMsg = typeof response.error === 'string'
29
- ? response.error
30
- : ((_a = response.error) === null || _a === void 0 ? void 0 : _a.message) || 'Thread creation in background failed';
31
- return {
32
- llmContent: `Thread creation in background failed: ${errorMsg}`,
33
- returnDisplay: `Error: ${errorMsg}`,
34
- error: {
35
- message: errorMsg,
36
- type: types_1.ToolErrorType.EXECUTION_FAILED,
37
- },
38
- };
39
- }
40
- const resp = response;
41
- let output = 'Created thread in background successfully';
42
- if (resp.threadId) {
43
- output += `\n\nThread ID: ${resp.threadId}`;
44
- }
45
- if (this.params.groupId) {
46
- output += `\nGroup ID: ${this.params.groupId}`;
47
- }
48
- return {
49
- llmContent: output,
50
- returnDisplay: 'Thread created in background successfully',
51
- };
52
- }
53
- catch (error) {
54
- const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
55
- return {
56
- llmContent: `Error creating thread in background: ${errorMessage}`,
57
- returnDisplay: `Error: ${errorMessage}`,
58
- error: {
59
- message: errorMessage,
60
- type: types_1.ToolErrorType.EXECUTION_FAILED,
61
- },
62
- };
63
- }
64
- }
65
- }
66
- class ThreadCreateBackgroundTool extends base_tool_1.BaseDeclarativeTool {
67
- constructor() {
68
- super(ThreadCreateBackgroundTool.Name, 'ThreadCreateBackground', 'Creates a thread in the background and resolves when the agent starts or fails.', types_1.Kind.Execute, {
69
- properties: {
70
- options: {
71
- description: 'Thread creation options object containing thread parameters.',
72
- type: 'object',
73
- },
74
- groupId: {
75
- description: 'Optional group ID for organizing threads.',
76
- type: 'string',
77
- },
78
- },
79
- required: ['options'],
80
- type: 'object',
81
- });
82
- }
83
- validateToolParamValues(params) {
84
- if (!params.options || typeof params.options !== 'object') {
85
- return "'options' is required and must be an object";
86
- }
87
- return null;
88
- }
89
- createInvocation(params) {
90
- return new ThreadCreateBackgroundInvocation(params);
91
- }
92
- }
93
- exports.ThreadCreateBackgroundTool = ThreadCreateBackgroundTool;
94
- ThreadCreateBackgroundTool.Name = 'thread_create_background';
@@ -1,16 +0,0 @@
1
- /**
2
- * Thread Create Start Tool - Creates and immediately starts a new thread
3
- * Wraps the SDK's threadService.createAndStartThread() method
4
- */
5
- import type { ToolInvocation, ToolResult } from '../types';
6
- import { BaseDeclarativeTool } from '../base-tool';
7
- export interface ThreadCreateStartParams {
8
- /** Thread creation and start options */
9
- options: Record<string, any>;
10
- }
11
- export declare class ThreadCreateStartTool extends BaseDeclarativeTool<ThreadCreateStartParams, ToolResult> {
12
- static readonly Name: string;
13
- constructor();
14
- protected validateToolParamValues(params: ThreadCreateStartParams): string | null;
15
- protected createInvocation(params: ThreadCreateStartParams): ToolInvocation<ThreadCreateStartParams, ToolResult>;
16
- }
@@ -1,85 +0,0 @@
1
- "use strict";
2
- /**
3
- * Thread Create Start Tool - Creates and immediately starts a new thread
4
- * Wraps the SDK's threadService.createAndStartThread() 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.ThreadCreateStartTool = void 0;
11
- const types_1 = require("../types");
12
- const base_tool_1 = require("../base-tool");
13
- const thread_1 = __importDefault(require("../../modules/thread"));
14
- class ThreadCreateStartInvocation extends base_tool_1.BaseToolInvocation {
15
- constructor(params) {
16
- super(params);
17
- }
18
- async execute() {
19
- var _a;
20
- try {
21
- const response = await thread_1.default.createAndStartThread(this.params.options);
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) || 'Thread creation and start failed';
26
- return {
27
- llmContent: `Thread creation and start failed: ${errorMsg}`,
28
- returnDisplay: `Error: ${errorMsg}`,
29
- error: {
30
- message: errorMsg,
31
- type: types_1.ToolErrorType.EXECUTION_FAILED,
32
- },
33
- };
34
- }
35
- const resp = response;
36
- let output = 'Created and started thread successfully';
37
- if (resp.threadId) {
38
- output += `\n\nThread ID: ${resp.threadId}`;
39
- }
40
- if (resp.thread) {
41
- output += `\n\nThread: ${JSON.stringify(resp.thread, null, 2)}`;
42
- }
43
- return {
44
- llmContent: output,
45
- returnDisplay: 'Thread created and started successfully',
46
- };
47
- }
48
- catch (error) {
49
- const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
50
- return {
51
- llmContent: `Error creating and starting thread: ${errorMessage}`,
52
- returnDisplay: `Error: ${errorMessage}`,
53
- error: {
54
- message: errorMessage,
55
- type: types_1.ToolErrorType.EXECUTION_FAILED,
56
- },
57
- };
58
- }
59
- }
60
- }
61
- class ThreadCreateStartTool extends base_tool_1.BaseDeclarativeTool {
62
- constructor() {
63
- super(ThreadCreateStartTool.Name, 'ThreadCreateStart', 'Creates and immediately starts a new thread with the specified options.', types_1.Kind.Execute, {
64
- properties: {
65
- options: {
66
- description: 'Thread creation and start options object containing thread parameters.',
67
- type: 'object',
68
- },
69
- },
70
- required: ['options'],
71
- type: 'object',
72
- });
73
- }
74
- validateToolParamValues(params) {
75
- if (!params.options || typeof params.options !== 'object') {
76
- return "'options' is required and must be an object";
77
- }
78
- return null;
79
- }
80
- createInvocation(params) {
81
- return new ThreadCreateStartInvocation(params);
82
- }
83
- }
84
- exports.ThreadCreateStartTool = ThreadCreateStartTool;
85
- ThreadCreateStartTool.Name = 'thread_create_start';
@@ -1,16 +0,0 @@
1
- /**
2
- * Thread Create Tool - Creates a new thread
3
- * Wraps the SDK's threadService.createThread() method
4
- */
5
- import type { ToolInvocation, ToolResult } from '../types';
6
- import { BaseDeclarativeTool } from '../base-tool';
7
- export interface ThreadCreateParams {
8
- /** Thread creation options */
9
- options: Record<string, any>;
10
- }
11
- export declare class ThreadCreateTool extends BaseDeclarativeTool<ThreadCreateParams, ToolResult> {
12
- static readonly Name: string;
13
- constructor();
14
- protected validateToolParamValues(params: ThreadCreateParams): string | null;
15
- protected createInvocation(params: ThreadCreateParams): ToolInvocation<ThreadCreateParams, ToolResult>;
16
- }
@@ -1,85 +0,0 @@
1
- "use strict";
2
- /**
3
- * Thread Create Tool - Creates a new thread
4
- * Wraps the SDK's threadService.createThread() 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.ThreadCreateTool = void 0;
11
- const types_1 = require("../types");
12
- const base_tool_1 = require("../base-tool");
13
- const thread_1 = __importDefault(require("../../modules/thread"));
14
- class ThreadCreateInvocation extends base_tool_1.BaseToolInvocation {
15
- constructor(params) {
16
- super(params);
17
- }
18
- async execute() {
19
- var _a;
20
- try {
21
- const response = await thread_1.default.createThread(this.params.options);
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) || 'Thread creation failed';
26
- return {
27
- llmContent: `Thread creation failed: ${errorMsg}`,
28
- returnDisplay: `Error: ${errorMsg}`,
29
- error: {
30
- message: errorMsg,
31
- type: types_1.ToolErrorType.EXECUTION_FAILED,
32
- },
33
- };
34
- }
35
- const resp = response;
36
- let output = 'Created thread successfully';
37
- if (resp.threadId) {
38
- output += `\n\nThread ID: ${resp.threadId}`;
39
- }
40
- if (resp.thread) {
41
- output += `\n\nThread: ${JSON.stringify(resp.thread, null, 2)}`;
42
- }
43
- return {
44
- llmContent: output,
45
- returnDisplay: 'Thread created successfully',
46
- };
47
- }
48
- catch (error) {
49
- const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
50
- return {
51
- llmContent: `Error creating thread: ${errorMessage}`,
52
- returnDisplay: `Error: ${errorMessage}`,
53
- error: {
54
- message: errorMessage,
55
- type: types_1.ToolErrorType.EXECUTION_FAILED,
56
- },
57
- };
58
- }
59
- }
60
- }
61
- class ThreadCreateTool extends base_tool_1.BaseDeclarativeTool {
62
- constructor() {
63
- super(ThreadCreateTool.Name, 'ThreadCreate', 'Creates a new thread with the specified options.', types_1.Kind.Edit, {
64
- properties: {
65
- options: {
66
- description: 'Thread creation options object containing thread parameters.',
67
- type: 'object',
68
- },
69
- },
70
- required: ['options'],
71
- type: 'object',
72
- });
73
- }
74
- validateToolParamValues(params) {
75
- if (!params.options || typeof params.options !== 'object') {
76
- return "'options' is required and must be an object";
77
- }
78
- return null;
79
- }
80
- createInvocation(params) {
81
- return new ThreadCreateInvocation(params);
82
- }
83
- }
84
- exports.ThreadCreateTool = ThreadCreateTool;
85
- ThreadCreateTool.Name = 'thread_create';
@@ -1,16 +0,0 @@
1
- /**
2
- * Thread Delete Tool - Deletes a thread
3
- * Wraps the SDK's threadService.deleteThread() method
4
- */
5
- import type { ToolInvocation, ToolResult } from '../types';
6
- import { BaseDeclarativeTool } from '../base-tool';
7
- export interface ThreadDeleteParams {
8
- /** The thread ID to delete */
9
- threadId: string;
10
- }
11
- export declare class ThreadDeleteTool extends BaseDeclarativeTool<ThreadDeleteParams, ToolResult> {
12
- static readonly Name: string;
13
- constructor();
14
- protected validateToolParamValues(params: ThreadDeleteParams): string | null;
15
- protected createInvocation(params: ThreadDeleteParams): ToolInvocation<ThreadDeleteParams, ToolResult>;
16
- }
@@ -1,77 +0,0 @@
1
- "use strict";
2
- /**
3
- * Thread Delete Tool - Deletes a thread
4
- * Wraps the SDK's threadService.deleteThread() 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.ThreadDeleteTool = void 0;
11
- const types_1 = require("../types");
12
- const base_tool_1 = require("../base-tool");
13
- const thread_1 = __importDefault(require("../../modules/thread"));
14
- class ThreadDeleteInvocation extends base_tool_1.BaseToolInvocation {
15
- constructor(params) {
16
- super(params);
17
- }
18
- async execute() {
19
- var _a;
20
- try {
21
- const response = await thread_1.default.deleteThread(this.params.threadId);
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) || 'Thread deletion failed';
26
- return {
27
- llmContent: `Thread deletion failed: ${errorMsg}`,
28
- returnDisplay: `Error: ${errorMsg}`,
29
- error: {
30
- message: errorMsg,
31
- type: types_1.ToolErrorType.EXECUTION_FAILED,
32
- },
33
- };
34
- }
35
- return {
36
- llmContent: `Deleted thread: ${this.params.threadId}`,
37
- returnDisplay: `Deleted thread: ${this.params.threadId}`,
38
- };
39
- }
40
- catch (error) {
41
- const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
42
- return {
43
- llmContent: `Error deleting thread: ${errorMessage}`,
44
- returnDisplay: `Error: ${errorMessage}`,
45
- error: {
46
- message: errorMessage,
47
- type: types_1.ToolErrorType.EXECUTION_FAILED,
48
- },
49
- };
50
- }
51
- }
52
- }
53
- class ThreadDeleteTool extends base_tool_1.BaseDeclarativeTool {
54
- constructor() {
55
- super(ThreadDeleteTool.Name, 'ThreadDelete', 'Deletes a thread by its ID.', types_1.Kind.Delete, {
56
- properties: {
57
- threadId: {
58
- description: 'The ID of the thread to delete.',
59
- type: 'string',
60
- },
61
- },
62
- required: ['threadId'],
63
- type: 'object',
64
- });
65
- }
66
- validateToolParamValues(params) {
67
- if (!params.threadId || params.threadId.trim() === '') {
68
- return "'threadId' is required";
69
- }
70
- return null;
71
- }
72
- createInvocation(params) {
73
- return new ThreadDeleteInvocation(params);
74
- }
75
- }
76
- exports.ThreadDeleteTool = ThreadDeleteTool;
77
- ThreadDeleteTool.Name = 'thread_delete';
@@ -1,24 +0,0 @@
1
- /**
2
- * Thread Get Messages Tool - Retrieves messages for a specific thread
3
- * Wraps the SDK's threadService.getThreadMessages() method
4
- */
5
- import type { ToolInvocation, ToolResult } from '../types';
6
- import { BaseDeclarativeTool } from '../base-tool';
7
- export interface ThreadGetMessagesParams {
8
- /** The thread ID to get messages for */
9
- threadId: string;
10
- /** Optional limit on number of messages */
11
- limit?: number;
12
- /** Optional offset for pagination */
13
- offset?: number;
14
- /** Optional: include only messages before this timestamp */
15
- before?: string;
16
- /** Optional: include only messages after this timestamp */
17
- after?: string;
18
- }
19
- export declare class ThreadGetMessagesTool extends BaseDeclarativeTool<ThreadGetMessagesParams, ToolResult> {
20
- static readonly Name: string;
21
- constructor();
22
- protected validateToolParamValues(params: ThreadGetMessagesParams): string | null;
23
- protected createInvocation(params: ThreadGetMessagesParams): ToolInvocation<ThreadGetMessagesParams, ToolResult>;
24
- }
@@ -1,122 +0,0 @@
1
- "use strict";
2
- /**
3
- * Thread Get Messages Tool - Retrieves messages for a specific thread
4
- * Wraps the SDK's threadService.getThreadMessages() 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.ThreadGetMessagesTool = void 0;
11
- const types_1 = require("../types");
12
- const base_tool_1 = require("../base-tool");
13
- const thread_1 = __importDefault(require("../../modules/thread"));
14
- class ThreadGetMessagesInvocation extends base_tool_1.BaseToolInvocation {
15
- constructor(params) {
16
- super(params);
17
- }
18
- async execute() {
19
- var _a, _b;
20
- try {
21
- const options = {
22
- taskId: this.params.threadId,
23
- };
24
- if (this.params.limit !== undefined) {
25
- options.limit = this.params.limit;
26
- }
27
- if (this.params.offset !== undefined) {
28
- options.offset = this.params.offset;
29
- }
30
- if (this.params.before !== undefined) {
31
- options.before = this.params.before;
32
- }
33
- if (this.params.after !== undefined) {
34
- options.after = this.params.after;
35
- }
36
- const response = await thread_1.default.getThreadMessages(options);
37
- if (response && !response.success && response.success !== undefined) {
38
- const errorMsg = typeof response.error === 'string'
39
- ? response.error
40
- : ((_a = response.error) === null || _a === void 0 ? void 0 : _a.message) || 'Failed to retrieve thread messages';
41
- return {
42
- llmContent: `Failed to retrieve thread messages: ${errorMsg}`,
43
- returnDisplay: `Error: ${errorMsg}`,
44
- error: {
45
- message: errorMsg,
46
- type: types_1.ToolErrorType.EXECUTION_FAILED,
47
- },
48
- };
49
- }
50
- const resp = response;
51
- let output = `Messages for thread: ${this.params.threadId}`;
52
- if (resp.messages) {
53
- output += `\n\nMessages (${resp.messages.length}):\n${JSON.stringify(resp.messages, null, 2)}`;
54
- }
55
- else {
56
- output += `\n\nResponse: ${JSON.stringify(resp, null, 2)}`;
57
- }
58
- return {
59
- llmContent: output,
60
- returnDisplay: `Retrieved ${((_b = resp.messages) === null || _b === void 0 ? void 0 : _b.length) || 0} messages`,
61
- };
62
- }
63
- catch (error) {
64
- const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
65
- return {
66
- llmContent: `Error retrieving thread messages: ${errorMessage}`,
67
- returnDisplay: `Error: ${errorMessage}`,
68
- error: {
69
- message: errorMessage,
70
- type: types_1.ToolErrorType.EXECUTION_FAILED,
71
- },
72
- };
73
- }
74
- }
75
- }
76
- class ThreadGetMessagesTool extends base_tool_1.BaseDeclarativeTool {
77
- constructor() {
78
- super(ThreadGetMessagesTool.Name, 'ThreadGetMessages', 'Retrieves messages for a specific thread with optional pagination.', types_1.Kind.Read, {
79
- properties: {
80
- threadId: {
81
- description: 'The ID of the thread to get messages for.',
82
- type: 'string',
83
- },
84
- limit: {
85
- description: 'Optional limit on number of messages to retrieve.',
86
- type: 'number',
87
- },
88
- offset: {
89
- description: 'Optional offset for pagination.',
90
- type: 'number',
91
- },
92
- before: {
93
- description: 'Optional: include only messages before this timestamp.',
94
- type: 'string',
95
- },
96
- after: {
97
- description: 'Optional: include only messages after this timestamp.',
98
- type: 'string',
99
- },
100
- },
101
- required: ['threadId'],
102
- type: 'object',
103
- });
104
- }
105
- validateToolParamValues(params) {
106
- if (!params.threadId || params.threadId.trim() === '') {
107
- return "'threadId' is required";
108
- }
109
- if (params.limit !== undefined && params.limit < 0) {
110
- return "'limit' must be a non-negative number";
111
- }
112
- if (params.offset !== undefined && params.offset < 0) {
113
- return "'offset' must be a non-negative number";
114
- }
115
- return null;
116
- }
117
- createInvocation(params) {
118
- return new ThreadGetMessagesInvocation(params);
119
- }
120
- }
121
- exports.ThreadGetMessagesTool = ThreadGetMessagesTool;
122
- ThreadGetMessagesTool.Name = 'thread_get_messages';
@@ -1,16 +0,0 @@
1
- /**
2
- * Thread Get Tool - Retrieves detailed information about a specific thread
3
- * Wraps the SDK's threadService.getThreadDetail() method
4
- */
5
- import type { ToolInvocation, ToolResult } from '../types';
6
- import { BaseDeclarativeTool } from '../base-tool';
7
- export interface ThreadGetParams {
8
- /** The thread ID to retrieve */
9
- threadId: string;
10
- }
11
- export declare class ThreadGetTool extends BaseDeclarativeTool<ThreadGetParams, ToolResult> {
12
- static readonly Name: string;
13
- constructor();
14
- protected validateToolParamValues(params: ThreadGetParams): string | null;
15
- protected createInvocation(params: ThreadGetParams): ToolInvocation<ThreadGetParams, ToolResult>;
16
- }
@@ -1,85 +0,0 @@
1
- "use strict";
2
- /**
3
- * Thread Get Tool - Retrieves detailed information about a specific thread
4
- * Wraps the SDK's threadService.getThreadDetail() 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.ThreadGetTool = void 0;
11
- const types_1 = require("../types");
12
- const base_tool_1 = require("../base-tool");
13
- const thread_1 = __importDefault(require("../../modules/thread"));
14
- class ThreadGetInvocation extends base_tool_1.BaseToolInvocation {
15
- constructor(params) {
16
- super(params);
17
- }
18
- async execute() {
19
- var _a;
20
- try {
21
- const response = await thread_1.default.getThreadDetail({ taskId: this.params.threadId });
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) || 'Failed to retrieve thread details';
26
- return {
27
- llmContent: `Failed to retrieve thread details: ${errorMsg}`,
28
- returnDisplay: `Error: ${errorMsg}`,
29
- error: {
30
- message: errorMsg,
31
- type: types_1.ToolErrorType.EXECUTION_FAILED,
32
- },
33
- };
34
- }
35
- const resp = response;
36
- let output = `Thread details for: ${this.params.threadId}`;
37
- if (resp.thread) {
38
- output += `\n\nThread: ${JSON.stringify(resp.thread, null, 2)}`;
39
- }
40
- else {
41
- output += `\n\nResponse: ${JSON.stringify(resp, null, 2)}`;
42
- }
43
- return {
44
- llmContent: output,
45
- returnDisplay: `Retrieved thread: ${this.params.threadId}`,
46
- };
47
- }
48
- catch (error) {
49
- const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
50
- return {
51
- llmContent: `Error retrieving thread details: ${errorMessage}`,
52
- returnDisplay: `Error: ${errorMessage}`,
53
- error: {
54
- message: errorMessage,
55
- type: types_1.ToolErrorType.EXECUTION_FAILED,
56
- },
57
- };
58
- }
59
- }
60
- }
61
- class ThreadGetTool extends base_tool_1.BaseDeclarativeTool {
62
- constructor() {
63
- super(ThreadGetTool.Name, 'ThreadGet', 'Retrieves detailed information about a specific thread.', types_1.Kind.Read, {
64
- properties: {
65
- threadId: {
66
- description: 'The ID of the thread to retrieve.',
67
- type: 'string',
68
- },
69
- },
70
- required: ['threadId'],
71
- type: 'object',
72
- });
73
- }
74
- validateToolParamValues(params) {
75
- if (!params.threadId || params.threadId.trim() === '') {
76
- return "'threadId' is required";
77
- }
78
- return null;
79
- }
80
- createInvocation(params) {
81
- return new ThreadGetInvocation(params);
82
- }
83
- }
84
- exports.ThreadGetTool = ThreadGetTool;
85
- ThreadGetTool.Name = 'thread_get';
@@ -1,16 +0,0 @@
1
- /**
2
- * Thread List Tool - Retrieves a list of threads
3
- * Wraps the SDK's threadService.getThreadList() method
4
- */
5
- import type { ToolInvocation, ToolResult } from '../types';
6
- import { BaseDeclarativeTool } from '../base-tool';
7
- export interface ThreadListParams {
8
- /** Optional filtering options */
9
- options?: Record<string, any>;
10
- }
11
- export declare class ThreadListTool extends BaseDeclarativeTool<ThreadListParams, ToolResult> {
12
- static readonly Name: string;
13
- constructor();
14
- protected validateToolParamValues(params: ThreadListParams): string | null;
15
- protected createInvocation(params: ThreadListParams): ToolInvocation<ThreadListParams, ToolResult>;
16
- }