@@ -25,78 +25,22 @@ import {chatSummary} from './modules/history'
2525import codeboltTools from './modules/mcp' ;
2626import cbagent from './modules/agent' ;
2727import cbutils from './modules/utils' ;
28- import type { ChatMessageFromUser , LLMResponse , UserMessage } from './types/cliWebSocketInterfaces ' ;
28+ import type { ChatMessageFromUser , LLMResponse , UserMessage } from './types/socketMessageTypes ' ;
2929import { userInfo } from 'os' ;
3030
31- /**
32- * Represents a message in the conversation with roles and content.
33- */
34- export interface Message {
35- /** The role of the message sender: user, assistant, tool, or system */
36- role : 'user' | 'assistant' | 'tool' | 'system' ;
37- /** The content of the message, can be an array of content blocks or a string */
38- content : any [ ] | string ;
39- /** Optional ID for tool calls */
40- tool_call_id ?: string ;
41- /** Optional tool calls for assistant messages */
42- tool_calls ?: ToolCall [ ] ;
43- /** Additional properties that might be present */
44- [ key : string ] : any ;
45- }
46-
47- /**
48- * Represents a tool call in OpenAI format
49- */
50- export interface ToolCall {
51- /** Unique identifier for this tool call */
52- id : string ;
53- /** The type of tool call */
54- type : 'function' ;
55- /** Function call details */
56- function : {
57- /** Name of the function to call */
58- name : string ;
59- /** Arguments for the function call as JSON string */
60- arguments : string ;
61- } ;
62- }
63-
64- /**
65- * Represents a tool definition in OpenAI format
66- */
67- export interface Tool {
68- /** The type of tool */
69- type : 'function' ;
70- /** Function definition */
71- function : {
72- /** Name of the function */
73- name : string ;
74- /** Description of what the function does */
75- description ?: string ;
76- /** JSON schema for the function parameters */
77- parameters ?: any ;
78- } ;
79- }
80-
81- /**
82- * LLM inference request parameters
83- */
84- export interface LLMInferenceParams {
85- /** Array of messages in the conversation */
86- messages : Message [ ] ;
87- /** Available tools for the model to use */
88- tools ?: Tool [ ] ;
89- /** How the model should use tools */
90- tool_choice ?: 'auto' | 'none' | 'required' | { type : 'function' ; function : { name : string } } ;
91- /** The LLM role to determine which model to use */
92- llmrole : string ;
93- /** Maximum number of tokens to generate */
94- max_tokens ?: number ;
95- /** Temperature for response generation */
96- temperature ?: number ;
97- /** Whether to stream the response */
98- stream ?: boolean ;
99- }
31+ // Re-export public API types for user convenience
32+ export type {
33+ Message ,
34+ ToolCall ,
35+ Tool ,
36+ LLMInferenceParams ,
37+ APIResponse ,
38+ CodeboltConfig ,
39+ ProgressCallback ,
40+ ErrorCallback ,
41+ SuccessCallback ,
42+ CompletionCallback
43+ } from './types/libFunctionTypes' ;
10044
10145/**
10246 * @class Codebolt
0 commit comments