11import "reflect-metadata" ;
2- import { ICommand , MessageType , MessageRole , MessageKind , type ChatMessage , type MessageContent , trimContent , isEmptyContent } from "scorpio.ai" ;
2+ import { ICommand , MessageType , MessageRole , MessageKind , type MessageContent , trimContent , isEmptyContent } from "scorpio.ai" ;
33import { SessionManager , SessionService , ChannelMessageArgs , ChannelSessionHandler } from "channel.base" ;
44import { type StructuredToolInterface } from "@langchain/core/tools" ;
55import { config } from "../Core/Config" ;
@@ -21,7 +21,6 @@ export interface ChannelRouteArgs extends ChannelMessageArgs {
2121 headless ?: boolean ;
2222 agentTools ?: StructuredToolInterface [ ] ;
2323 toolWhitelist ?: string [ ] ;
24- onMessage ?: ( msg : ChatMessage ) => void ;
2524 onComplete ?: ( error ?: any ) => void ;
2625}
2726
@@ -50,9 +49,7 @@ class SbotSession extends SessionService {
5049 }
5150
5251 protected async onProcessStart ( query : MessageContent , args : ChannelRouteArgs , messageType : MessageType ) : Promise < string | void > {
53- if ( ! args . headless ) {
54- await this . getChannel ( args ) . onProcessStart ( query , this . argsWithQueue ( args ) , messageType ) ;
55- }
52+ await this . getChannel ( args ) . onProcessStart ( query , this . argsWithQueue ( args ) , messageType ) ;
5653 const channelName = config . getChannel ( args . channelId ) ?. name ;
5754 return [ args . channelType , channelName ?? args . channelId , this . threadId ] . filter ( Boolean ) . join ( '/' ) ;
5855 }
@@ -79,9 +76,7 @@ class SbotSession extends SessionService {
7976 }
8077
8178 protected async onProcessEnd ( query : MessageContent , args : ChannelRouteArgs , messageType : MessageType , error ?: any ) : Promise < void > {
82- if ( ! args . headless ) {
83- await this . getChannel ( args ) . onProcessEnd ( query , this . argsWithQueue ( args ) , messageType , error ) ;
84- }
79+ await this . getChannel ( args ) . onProcessEnd ( query , this . argsWithQueue ( args ) , messageType , error ) ;
8580 if ( args . onComplete ) {
8681 args . onComplete ( error ) ;
8782 }
0 commit comments