@codebolt/agent 5.0.6 → 5.0.7

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.
@@ -6,9 +6,17 @@
6
6
  * - API interfaces exposed to library users
7
7
  * - Configuration options for library functions
8
8
  * - User-facing data structures
9
+ *
10
+ * Note: Core message and tool types are imported from @codebolt/types/sdk.
11
+ * Local extensions are provided for backward compatibility.
9
12
  */
13
+ import type { MessageObject, ToolCall as SDKToolCall, ToolChoice, LLMCompletion } from '@codebolt/types/sdk';
14
+ import type { ToolResult as AgentToolResult } from '@codebolt/types/agent';
15
+ export type { MessageObject, ToolChoice, LLMCompletion };
16
+ export type { AgentToolResult };
10
17
  /**
11
18
  * Represents a message in the conversation with roles and content.
19
+ * Extended version with looser typing for backward compatibility.
12
20
  */
13
21
  export interface Message {
14
22
  /** The role of the message sender: user, assistant, tool, or system */
@@ -24,22 +32,12 @@ export interface Message {
24
32
  }
25
33
  /**
26
34
  * Represents a tool call in OpenAI format
35
+ * Re-exported from SDK with same structure
27
36
  */
28
- export interface ToolCall {
29
- /** Unique identifier for this tool call */
30
- id: string;
31
- /** The type of tool call */
32
- type: 'function';
33
- /** Function call details */
34
- function: {
35
- /** Name of the function to call */
36
- name: string;
37
- /** Arguments for the function call as JSON string */
38
- arguments: string;
39
- };
40
- }
37
+ export type ToolCall = SDKToolCall;
41
38
  /**
42
39
  * Represents a tool definition in OpenAI format
40
+ * Extended with looser parameter typing for flexibility
43
41
  */
44
42
  export interface Tool {
45
43
  /** The type of tool */
@@ -56,6 +54,7 @@ export interface Tool {
56
54
  }
57
55
  /**
58
56
  * LLM inference request parameters
57
+ * Local version with required llmrole for backward compatibility
59
58
  */
60
59
  export interface LLMInferenceParams {
61
60
  /** Array of messages in the conversation */
@@ -63,12 +62,7 @@ export interface LLMInferenceParams {
63
62
  /** Available tools for the model to use */
64
63
  tools?: Tool[];
65
64
  /** How the model should use tools */
66
- tool_choice?: 'auto' | 'none' | 'required' | {
67
- type: 'function';
68
- function: {
69
- name: string;
70
- };
71
- };
65
+ tool_choice?: ToolChoice;
72
66
  /** The LLM role to determine which model to use */
73
67
  llmrole: string;
74
68
  /** Maximum number of tokens to generate */
@@ -7,5 +7,8 @@
7
7
  * - API interfaces exposed to library users
8
8
  * - Configuration options for library functions
9
9
  * - User-facing data structures
10
+ *
11
+ * Note: Core message and tool types are imported from @codebolt/types/sdk.
12
+ * Local extensions are provided for backward compatibility.
10
13
  */
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,16 +1,16 @@
1
1
  /**
2
2
  * Processor types and interfaces for the Unified Agent Framework
3
- * @deprecated Use specific processor type files instead
3
+ * @deprecated Use types from @codebolt/types/agent instead
4
4
  *
5
5
  * This file is kept for backward compatibility.
6
- * New code should import from the specific processor type files:
7
- * - './processorTypes/messageModifierTypes'
8
- * - './processorTypes/preInferenceProcessorTypes'
9
- * - './processorTypes/postInferenceTypes'
10
- * - './processorTypes/preToolCallProcessorTypes'
11
- * - './processorTypes/postToolCallProcessorTypes'
6
+ * New code should import from @codebolt/types/agent:
7
+ * - MessageModifier, MessageModifierOptions
8
+ * - PreInferenceProcessor, PostInferenceProcessor
9
+ * - PreToolCallProcessor, PostToolCallProcessor
10
+ * - ProcessedMessage, ToolCall, ToolResult
12
11
  */
13
- export * from './processorTypes';
12
+ import type { ToolResult } from '@codebolt/types/agent';
13
+ export type { ToolResult };
14
14
  export interface ToolCall {
15
15
  id: string;
16
16
  function: {
@@ -1,34 +1,17 @@
1
1
  "use strict";
2
2
  /**
3
3
  * Processor types and interfaces for the Unified Agent Framework
4
- * @deprecated Use specific processor type files instead
4
+ * @deprecated Use types from @codebolt/types/agent instead
5
5
  *
6
6
  * This file is kept for backward compatibility.
7
- * New code should import from the specific processor type files:
8
- * - './processorTypes/messageModifierTypes'
9
- * - './processorTypes/preInferenceProcessorTypes'
10
- * - './processorTypes/postInferenceTypes'
11
- * - './processorTypes/preToolCallProcessorTypes'
12
- * - './processorTypes/postToolCallProcessorTypes'
7
+ * New code should import from @codebolt/types/agent:
8
+ * - MessageModifier, MessageModifierOptions
9
+ * - PreInferenceProcessor, PostInferenceProcessor
10
+ * - PreToolCallProcessor, PostToolCallProcessor
11
+ * - ProcessedMessage, ToolCall, ToolResult
13
12
  */
14
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
15
- if (k2 === undefined) k2 = k;
16
- var desc = Object.getOwnPropertyDescriptor(m, k);
17
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
18
- desc = { enumerable: true, get: function() { return m[k]; } };
19
- }
20
- Object.defineProperty(o, k2, desc);
21
- }) : (function(o, m, k, k2) {
22
- if (k2 === undefined) k2 = k;
23
- o[k2] = m[k];
24
- }));
25
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
- };
28
13
  Object.defineProperty(exports, "__esModule", { value: true });
29
14
  exports.BaseProcessor = void 0;
30
- // Re-export all processor types from their specific modules
31
- __exportStar(require("./processorTypes"), exports);
32
15
  // Base processor class
33
16
  class BaseProcessor {
34
17
  constructor(options) {
@@ -169,11 +169,20 @@ class ResponseExecutor {
169
169
  });
170
170
  }
171
171
  else if (item.toolName == "codebolt--thread_management") {
172
+ codeboltjs_1.default.chat.sendMessage(JSON.stringify({
173
+ title: item.toolInput.title || item.toolInput.task || 'Background Thread',
174
+ description: item.toolInput.description || item.toolInput.task || '',
175
+ userMessage: item.toolInput.task || item.toolInput.userMessage || '',
176
+ selectedAgent: item.toolInput.selectedAgent,
177
+ isGrouped: item.toolInput.isGrouped,
178
+ groupId: item.toolInput.groupId,
179
+ }));
172
180
  const response = await codeboltjs_1.default.thread.createThreadInBackground({
173
181
  title: item.toolInput.title || item.toolInput.task || 'Background Thread',
174
182
  description: item.toolInput.description || item.toolInput.task || '',
175
183
  userMessage: item.toolInput.task || item.toolInput.userMessage || '',
176
184
  selectedAgent: item.toolInput.selectedAgent,
185
+ isGrouped: item.toolInput.isGrouped,
177
186
  groupId: item.toolInput.groupId,
178
187
  });
179
188
  toolResults.push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebolt/agent",
3
- "version": "5.0.6",
3
+ "version": "5.0.7",
4
4
  "description": "CodeBolt Agent utilities for building and managing AI agents",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -30,19 +30,21 @@
30
30
  "dependencies": {
31
31
  "js-yaml": "^4.1.0",
32
32
  "zod": "^3.22.4",
33
- "@codebolt/types": "5.0.6"
33
+ "@codebolt/types": "5.0.7"
34
34
  },
35
35
  "peerDependencies": {
36
- "@codebolt/codeboltjs": "5.0.6"
36
+ "@codebolt/codeboltjs": "5.0.7"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/js-yaml": "^4.0.9",
40
40
  "@types/node": "^20.14.2",
41
41
  "@types/uri-templates": "^0.1.34",
42
42
  "@types/ws": "^8.5.10",
43
+ "typedoc": "0.28.16",
44
+ "typedoc-plugin-markdown": "4.9.0",
43
45
  "typescript": "^5.4.5",
44
- "@codebolt/codeboltjs": "5.0.6",
45
- "@codebolt/types": "5.0.6"
46
+ "@codebolt/types": "5.0.7",
47
+ "@codebolt/codeboltjs": "5.0.7"
46
48
  },
47
49
  "exports": {
48
50
  "./builder": {
@@ -71,6 +73,9 @@
71
73
  "clean": "rm -rf dist",
72
74
  "dev": "tsc --watch",
73
75
  "test": "echo \"No tests yet, but build passes\" && exit 0",
74
- "lint:test": "eslint src/**/*.ts && tsc --noEmit"
76
+ "lint:test": "eslint src/**/*.ts && tsc --noEmit",
77
+ "docs": "node script/gen-docusaurus-agent-types.js",
78
+ "docs:clean": "node script/gen-docusaurus-agent-types.js --clean",
79
+ "docs:watch": "node script/gen-docusaurus-agent-types.js --watch"
75
80
  }
76
81
  }