import http from 'http'; import * as backtest_kit from 'backtest-kit'; import { IMCPPositionOpenCommand, IMCPPositionCloseCommand, IMCPAverageBuyCommand, IMCPSignalNotifyCommand, IMCPMessage } from 'backtest-kit'; interface ILogger { log(topic: string, ...args: any[]): void; debug(topic: string, ...args: any[]): void; info(topic: string, ...args: any[]): void; warn(topic: string, ...args: any[]): void; } /** * Attaches a custom logger to the internal `LoggerService`. * * By default the package logs to `console`. Pass your own {@link ILogger} implementation * to redirect output to an external logging system (Winston, Pino, Datadog, etc.). * * @param logger - Object with `log`, `debug`, `info`, and `warn` methods. * Each method receives a string topic followed by arbitrary arguments. * * @example * import winston from "winston"; * * setLogger({ * log: (topic, ...args) => winston.verbose(topic, ...args), * debug: (topic, ...args) => winston.debug(topic, ...args), * info: (topic, ...args) => winston.info(topic, ...args), * warn: (topic, ...args) => winston.warn(topic, ...args), * }); */ declare function setLogger(logger: ILogger): void; type CallbackFn = (error?: Error) => void; declare function serve(host?: string, port?: number, callback?: CallbackFn): () => void; declare function getRouter(): http.RequestListener; declare const GLOBAL_CONFIG: { CC_MCP_HOST: string; CC_MCP_PORT: number; CC_MCP_NAME: string; }; type Config = typeof GLOBAL_CONFIG; declare const getConfig: () => { CC_MCP_HOST: string; CC_MCP_PORT: number; CC_MCP_NAME: string; }; declare const setConfig: (config: Partial) => void; declare class LoggerService implements ILogger { private _commonLogger; log: (topic: string, ...args: any[]) => Promise; debug: (topic: string, ...args: any[]) => Promise; info: (topic: string, ...args: any[]) => Promise; warn: (topic: string, ...args: any[]) => Promise; setLogger: (logger: ILogger) => void; } declare class MCPPrivateService { private readonly loggerService; getStatus: (mcpName: string) => Promise; commitPositionOpen: (dto: IMCPPositionOpenCommand) => Promise; commitPositionClose: (dto: IMCPPositionCloseCommand) => Promise; commitAverageBuy: (dto: IMCPAverageBuyCommand) => Promise; commitSignalNotify: (dto: IMCPSignalNotifyCommand) => Promise; } declare class MCPPublicService { private readonly loggerService; private readonly mcpPrivateService; getStatus: () => Promise; commitPositionOpen: (dto: { symbol: string; position: "long" | "short"; note: string; }) => Promise; commitPositionClose: (dto: { symbol: string; note: string; }) => Promise; commitAverageBuy: (dto: { symbol: string; }) => Promise; commitSignalNotify: (dto: { symbol: string; note: string; }) => Promise; } declare class MCPCommandService { private readonly loggerService; getStatus: () => Promise; commitPositionOpen: (dto: { symbol: string; position: "long" | "short"; note: string; }) => Promise; commitPositionClose: (dto: { symbol: string; note: string; }) => Promise; commitAverageBuy: (dto: { symbol: string; }) => Promise; commitSignalNotify: (dto: { symbol: string; note: string; }) => Promise; } declare const ioc: { mcpCommandService: MCPCommandService; mcpPublicService: MCPPublicService; mcpPrivateService: MCPPrivateService; loggerService: LoggerService; }; export { getConfig, getRouter, ioc as lib, serve, setConfig, setLogger };