1- import type { StructuredChunk } from 'n8n-workflow' ;
1+ import {
2+ type StructuredChunk ,
3+ type JINA_AI_TOOL_NODE_TYPE ,
4+ type SEAR_XNG_TOOL_NODE_TYPE ,
5+ type INode ,
6+ INodeSchema ,
7+ } from 'n8n-workflow' ;
28import { z } from 'zod' ;
39import { Z } from 'zod-class' ;
410
@@ -28,6 +34,8 @@ export const PROVIDER_CREDENTIAL_TYPE_MAP: Record<
2834 google : 'googlePalmApi' ,
2935} ;
3036
37+ export type ChatHubAgentTool = typeof JINA_AI_TOOL_NODE_TYPE | typeof SEAR_XNG_TOOL_NODE_TYPE ;
38+
3139/**
3240 * Chat Hub conversation model configuration
3341 */
@@ -107,6 +115,7 @@ export const emptyChatModelsResponse: ChatModelsResponse = {
107115 anthropic : { models : [ ] } ,
108116 google : { models : [ ] } ,
109117 n8n : { models : [ ] } ,
118+ // eslint-disable-next-line @typescript-eslint/naming-convention
110119 'custom-agent' : { models : [ ] } ,
111120} ;
112121
@@ -122,6 +131,7 @@ export class ChatHubSendMessageRequest extends Z.class({
122131 name : z . string ( ) ,
123132 } ) ,
124133 ) ,
134+ tools : z . array ( INodeSchema ) ,
125135} ) { }
126136
127137export class ChatHubRegenerateMessageRequest extends Z . class ( {
@@ -153,6 +163,7 @@ export class ChatHubUpdateConversationRequest extends Z.class({
153163 model : z . string ( ) . max ( 64 ) . optional ( ) ,
154164 workflowId : z . string ( ) . max ( 36 ) . optional ( ) ,
155165 agentId : z . string ( ) . uuid ( ) . optional ( ) ,
166+ tools : z . array ( INodeSchema ) . optional ( ) ,
156167} ) { }
157168
158169export type ChatHubMessageType = 'human' | 'ai' | 'system' | 'tool' | 'generic' ;
@@ -174,6 +185,7 @@ export interface ChatHubSessionDto {
174185 agentName : string | null ;
175186 createdAt : string ;
176187 updatedAt : string ;
188+ tools : INode [ ] ;
177189}
178190
179191export interface ChatHubMessageDto {
@@ -216,6 +228,7 @@ export interface ChatHubAgentDto {
216228 credentialId : string | null ;
217229 provider : ChatHubLLMProvider ;
218230 model : string ;
231+ tools : INode [ ] ;
219232 createdAt : string ;
220233 updatedAt : string ;
221234}
@@ -227,6 +240,7 @@ export class ChatHubCreateAgentRequest extends Z.class({
227240 credentialId : z . string ( ) ,
228241 provider : chatHubProviderSchema . exclude ( [ 'n8n' , 'custom-agent' ] ) ,
229242 model : z . string ( ) . max ( 64 ) ,
243+ tools : z . array ( INodeSchema ) ,
230244} ) { }
231245
232246export class ChatHubUpdateAgentRequest extends Z . class ( {
@@ -236,6 +250,7 @@ export class ChatHubUpdateAgentRequest extends Z.class({
236250 credentialId : z . string ( ) . optional ( ) ,
237251 provider : chatHubProviderSchema . optional ( ) ,
238252 model : z . string ( ) . max ( 64 ) . optional ( ) ,
253+ tools : z . array ( INodeSchema ) . optional ( ) ,
239254} ) { }
240255
241256export interface EnrichedStructuredChunk extends StructuredChunk {
0 commit comments