import { EasbotClient } from '@easbot/sdk'; import { z } from 'zod'; import { EmbeddingModel, LanguageModel, RerankingModel } from 'ai'; interface ErrorInfo { name?: string; code: string; message: string; source?: string; details?: Record; timestamp: string | number; stack?: string; } declare enum AgentCapability { TEXT_PROCESSING = "text_processing", CODE_GENERATION = "code_generation", DATA_ANALYSIS = "data_analysis", TASK_EXECUTION = "task_execution", WORKFLOW_MANAGEMENT = "workflow_management", MONITORING = "monitoring", COMMUNICATION = "communication" } declare enum TaskPriority { LOW = 0, NORMAL = 1, HIGH = 2, URGENT = 3, CRITICAL = 4 } declare enum TaskStatus { PENDING = "pending", RUNNING = "running", PAUSED = "paused", COMPLETED = "completed", FAILED = "failed", CANCELLED = "cancelled", TIMEOUT = "timeout", SKIPPED = "skipped" } declare enum Protocol { HTTP = "http", WEBSOCKET = "websocket", GRPC = "grpc", TCP = "tcp", UDP = "udp" } declare enum HTTPMethod { GET = "GET", POST = "POST", PUT = "PUT", DELETE = "DELETE", PATCH = "PATCH", HEAD = "HEAD", OPTIONS = "OPTIONS" } declare enum HTTPStatusCode { OK = 200, CREATED = 201, NO_CONTENT = 204, BAD_REQUEST = 400, UNAUTHORIZED = 401, FORBIDDEN = 403, NOT_FOUND = 404, METHOD_NOT_ALLOWED = 405, INTERNAL_SERVER_ERROR = 500, SERVICE_UNAVAILABLE = 503 } interface HTTPRequestConfig { method: HTTPMethod; url: string; headers?: Record; query?: Record; body?: any; timeout?: number; retries?: number; } interface HTTPResponseConfig { statusCode: HTTPStatusCode; headers?: Record; body?: any; statusText?: string; duration?: number; } declare enum WebSocketState { CONNECTING = "connecting", OPEN = "open", CLOSING = "closing", CLOSED = "closed", ERROR = "error" } declare enum WebSocketMessageType { TEXT = "text", BINARY = "binary", JSON = "json", PING = "ping", PONG = "pong" } interface WebSocketConnectionConfig { url: string; protocols?: string[]; headers?: Record; pingInterval?: number; pongTimeout?: number; reconnect?: boolean; reconnectInterval?: number; maxReconnectAttempts?: number; } interface WebSocketMessage { type: WebSocketMessageType; data: any; timestamp: string | number; id?: string; } interface WebSocketEvent { type: 'open' | 'close' | 'error' | 'message'; data?: any; timestamp: string | number; } interface ApiResponse { code: number; data: T; msg: string; timestamp?: string | number; error?: ErrorDetails; } interface ApiResult { code: number; data?: T; msg?: string; header?: Record; } interface ErrorDetails { code: string; message: string; details?: any; timestamp: string | number; } interface PageResult { list: T[]; pageNo: number; pageSize: number; total?: number; } interface PageParams { autoCount?: boolean; pageNo: number; pageSize: number; } interface UploadFileParams { data?: Record; name?: string; file: File | Blob; filename?: string; [key: string]: any; } interface UploadFileResult { id: string; name: string; path: string; size: number; type: string; uploadTime: string; } interface OAuth2Token { access_token: string; refresh_token: string; token_type: string; expires_in: number; scope: string[]; } interface AuthInfo { userId: string; username: string; email: string; roles: string[]; permissions: string[]; token: OAuth2Token; } declare enum HttpStatus { OK = 200, CREATED = 201, NO_CONTENT = 204, BAD_REQUEST = 400, UNAUTHORIZED = 401, FORBIDDEN = 403, NOT_FOUND = 404, METHOD_NOT_ALLOWED = 405, REQUEST_TIMEOUT = 408, CONFLICT = 409, UNPROCESSABLE_ENTITY = 422, TOO_MANY_REQUESTS = 429, INSUFFICIENT_STORAGE = 507, INTERNAL_SERVER_ERROR = 500, NOT_IMPLEMENTED = 501, BAD_GATEWAY = 502, SERVICE_UNAVAILABLE = 503, GATEWAY_TIMEOUT = 504, HTTP_VERSION_NOT_SUPPORTED = 505 } interface ErrorResponse extends ApiResult { error?: ErrorInfo; } type ErrorMessageMode = 'none' | 'modal' | 'message' | undefined; type SuccessMessageMode = ErrorMessageMode; interface RetryRequest { isOpenRetry: boolean; count: number; waitTime: number; } interface RequestOptions { joinParamsToUrl?: boolean; formatDate?: boolean; isTransformResponse?: boolean; isReturnNativeResponse?: boolean; joinPrefix?: boolean; apiUrl?: string; urlPrefix?: string; errorMessageMode?: ErrorMessageMode; successMessageMode?: SuccessMessageMode; joinTime?: boolean; ignoreCancelToken?: boolean; withToken?: boolean; retryRequest?: RetryRequest; } interface SortingField { field: string; order: 'asc' | 'desc'; } interface FilterExpression { field: string; op: string; value?: any[]; type?: string; format?: string; } interface FilterRule { logic?: 'and' | 'or'; group?: string; rules?: FilterRule[]; expressions?: FilterExpression[]; } declare class ApiResponseBuilder { static success(data: T, message?: string, code?: number): ApiResult; static pageSuccess(list: T[], pageNo: number, pageSize: number, total?: number, message?: string): ApiResult>; static error(code: number, message: string, error?: ErrorInfo): ErrorResponse; static businessError(businessCode: string, message: string, httpCode?: number): ErrorResponse; } declare enum AgentState { INITIALIZING = "initializing", IDLE = "idle", RUNNING = "running", SUSPENDED = "suspended", STOPPING = "stopping", STOPPED = "stopped", ERROR = "error" } interface AgentQuery { state?: AgentState | 'all'; page?: number; limit?: number; search?: string; } interface AgentCreate { name: string; description?: string; config?: Record; capabilities?: AgentCapability[]; enabled?: boolean; } interface AgentUpdate { name?: string; description?: string; config?: Record; capabilities?: AgentCapability[]; enabled?: boolean; } interface AgentExecute { task: string; parameters?: Record; context?: Record; timeout?: number; priority?: 'low' | 'normal' | 'high' | 'urgent'; } interface AgentStatistics { totalExecutions: number; successfulExecutions: number; failedExecutions: number; averageExecutionTime: number; totalExecutionTime: number; uptime: number; memoryUsage: { used: number; total: number; peak: number; }; lastExecution?: { task: string; status: 'success' | 'failed' | 'timeout'; duration: number; timestamp: string | number; }; } interface AgentExecutionResult extends ApiResult { agentId: string; task: string; status: 'running' | 'completed' | 'failed' | 'timeout' | 'cancelled'; result?: any; error?: string; startTime: string; endTime?: string; duration?: number; logs?: string[]; metadata?: Record; } interface AgentStatusInfo { id: string; name: string; state: AgentState; uptime: number; currentTask?: { id: string; name: string; state: string; progress: number; startTime: string; }; timestamp: string | number; } interface AgentStatusInfo { id: string; name: string; status: AgentState; uptime: number; currentTask?: { id: string; name: string; state: string; progress: number; startTime: string; }; resourceUsage: { cpu: number; memory: { used: number; total: number; percentage: number; }; network?: { bytesIn: number; bytesOut: number; }; }; health: { overall: 'healthy' | 'degraded' | 'unhealthy'; checks: { connectivity: boolean; responsiveness: boolean; errorRate: number; }; }; lastActivity: string; } interface AgentAction { force?: boolean; graceful?: boolean; timeout?: number; } declare enum SessionStatus { ACTIVE = "active", INACTIVE = "inactive", CLOSED = "closed" } interface SessionQuery { status?: SessionStatus | 'all'; agentId?: string; userId?: string; page?: number; limit?: number; search?: string; startDate?: string; endDate?: string; } interface SessionCreate { agentId?: string; title: string; description?: string; metadata?: Record; config?: Record; } interface SessionUpdate { title?: string; description?: string; metadata?: Record; config?: Record; } interface SessionInfo { id: string; title: string; description?: string; status: SessionStatus; agentId?: string; userId?: string; createdAt: string; updatedAt: string; lastActivityAt: string; closedAt?: string; metadata: Record; config: Record; statistics?: SessionStatistics; } interface SessionStatistics { messageCount: number; totalTokens: number; averageResponseTime: number; duration: number; errorCount: number; } declare enum MessageType$1 { TEXT = "text", IMAGE = "image", FILE = "file", AUDIO = "audio", VIDEO = "video", SYSTEM = "system" } declare enum MessageSender { USER = "user", AGENT = "agent", SYSTEM = "system" } interface MessageSend { content: string; type?: MessageType$1; metadata?: Record; attachments?: MessageAttachment[]; } interface MessageAttachment { id: string; name: string; type: string; size: number; url: string; metadata?: Record; } interface SessionMessage { id: string; sessionId: string; sender: MessageSender; senderId?: string; content: string; type: MessageType$1; timestamp: string | number; metadata: Record; attachments?: MessageAttachment[]; reactions?: MessageReaction[]; replyTo?: string; } interface MessageReaction { emoji: string; count: number; userIds: string[]; } interface MessageQuery { type?: MessageType$1; sender?: MessageSender; startDate?: string; endDate?: string; page?: number; limit?: number; search?: string; } interface TaskQuery { status?: TaskStatus | 'all'; priority?: TaskPriority; agentId?: string; createdBy?: string; page?: number; limit?: number; search?: string; } interface TaskCreate { title: string; description?: string; type?: string; priority?: TaskPriority; agentId?: string; config?: Record; metadata?: Record; } interface TaskUpdate { title?: string; description?: string; priority?: TaskPriority; status?: TaskStatus; config?: Record; metadata?: Record; } interface TaskInfo { id: string; title: string; description?: string; type?: string; priority: TaskPriority; status: TaskStatus; agentId?: string; createdBy?: string; createdAt: string; updatedAt: string; startedAt?: string; completedAt?: string; config: Record; metadata: Record; result?: any; error?: string; } interface TaskLog { id: string; taskId: string; level: 'debug' | 'info' | 'warn' | 'error'; message: string; timestamp: string | number; metadata?: Record; } interface TaskStep { id: string; taskId: string; name: string; status: 'pending' | 'running' | 'completed' | 'failed'; startTime?: string; endTime?: string; output?: any; error?: string; } interface TaskExecutionResult { taskId: string; success: boolean; result?: any; error?: string; startTime: string; endTime: string; duration: number; steps: TaskStep[]; logs: TaskLog[]; } interface AgentModel { modelId: string; providerId: string; } type AgentPromptPart = { type: 'text'; text: string; } | { type: 'image'; image: string | URL | Uint8Array; mime?: string; } | { type: 'file'; data: string | URL | Uint8Array; mime?: string; } | { type: 'memory'; status: 'pending' | 'processing' | 'completed' | 'failed' | 'skipped'; time: { start: number; end?: number; }; result?: string; error?: string; reason?: string; } | { type: 'command'; command: string; arguments?: string; local?: boolean; metadata?: Record; }; interface AgentInput { source: string; title: string; agent?: string; model?: AgentModel; tools?: Record; system?: string; parts: AgentPromptPart[]; metadata?: Record; } interface AgentResult { title: string; output: string; metadata: AgentResultMetadata; } interface AgentResultMetadata { sessionId?: string; [key: string]: unknown; } type AgentCallback = (result: AgentResult) => Promise; interface AgentToolCall { name: string; status: 'completed' | 'error'; output?: unknown; error?: string; } interface AgentMessage { role: 'user' | 'assistant'; text?: string; thinking?: string; tools?: AgentToolCall[]; metadata: { sessionId: string; messageId: string; timestamp: number; tokens?: { input: number; output: number; total: number; }; sessionStatus?: 'idle' | 'busy' | 'retry' | 'error'; error?: string; }; } type RunMode = 'ephemeral' | 'persistent'; type TransportType = 'stdio' | 'http' | 'websocket' | 'cli'; type SubAgentStatus = 'idle' | 'starting' | 'running' | 'busy' | 'stopping' | 'stopped' | 'error'; interface SubAgentInput extends AgentInput { agent: string; sessionId?: string; syncMessages?: boolean; config?: Partial; } interface SubAgentResult extends AgentResult { userMessage?: unknown; assistantMessage?: unknown; } interface ISubAgentRunner { run(input: SubAgentInput): Promise; } interface SubAgentConfig { name: string; role: string; transport: TransportType; runMode: RunMode; uri?: string; command?: string; args?: string[]; env?: Record; timeout?: number; maxConcurrent?: number; cwd?: string; mcpServers?: string[]; agentConfig?: { model?: AgentModel; system?: string; tools?: Record; }; } interface SubAgentInstance { id: string; config: SubAgentConfig; status: SubAgentStatus; sessionId?: string; process?: unknown; createdAt: number; lastActiveAt: number; error?: string; } interface SubAgentEvent { type: 'start' | 'message' | 'delta' | 'complete' | 'error' | 'interrupt'; instanceId: string; data?: unknown; error?: Error; timestamp: number; } interface SubAgentEvent { type: 'start' | 'message' | 'delta' | 'complete' | 'error' | 'interrupt'; instanceId: string; data?: unknown; error?: Error; timestamp: number; } interface SubAgentExecuteOptions { onMessage?: (message: AgentMessage) => Promise | void; } interface SubAgentHandler { start(config: SubAgentConfig): Promise; stop(): Promise; isRunning(): boolean; execute(input: SubAgentInput, options?: SubAgentExecuteOptions): Promise; interrupt(): Promise; checkHealth?(): Promise; } type LocalAgentInput = AgentInput; type LocalAgentResult = AgentResult; type GatewayMessagePromptPart = AgentPromptPart; type MessageType = 'input' | 'output' | 'system' | 'control'; type PlatformType = 'telegram' | 'discord' | 'slack' | 'feishu' | 'wechat' | 'weixin' | 'webchat' | 'signal' | 'nostr' | 'dingtalk' | 'whatsapp' | 'tui' | 'api' | 'web' | 'desktop'; interface GatewayMessage { id: string; sessionId: string; type: MessageType; content: GatewayMessagePromptPart[]; metadata: MessageMetadata; timestamp: number; } interface MessageMetadata { channel: ChannelInfo; context?: MessageContext; agent?: string; [key: string]: unknown; } interface ChannelInfo { platform: PlatformType; channelId: string; userId?: string; chatId?: string; chatType?: string; chatTitle?: string; [key: string]: unknown; } interface ChannelPluginInfo { id: string; platform: PlatformType; name: string; version?: string; } interface ChannelListResponse { channels: ChannelPluginInfo[]; total: number; } interface MessageContext { replyTo?: string; threadId?: string; conversationId?: string; [key: string]: unknown; } interface AgentInfo { id?: string; name?: string; model?: string; [key: string]: unknown; } interface GatewayMessageReceiveInput { id: string; sessionId: string; type: MessageType; content: string | GatewayMessagePromptPart[]; channel?: { platform?: string; channelId?: string; chatId?: string; userId?: string; chatType?: string; chatTitle?: string; }; replyToMessageId?: string; timestamp?: number; processorId?: string; agent?: string; } interface GatewayMessageSendInput { id: string; sessionId: string; type: MessageType; content?: GatewayMessagePromptPart[]; channel: { platform: string; channelId: string; }; proactive: boolean; replyToMessageId?: string; timestamp: number; processorId?: string; agent?: string; } interface GatewayMessageDeliveredInput { id: string; sessionId: string; channel: { platform: string; channelId: string; }; timestamp: number; } interface GatewayMessageReadInput { id: string; sessionId: string; channel: { platform: string; channelId: string; }; timestamp: number; } interface MessageStorage { store(msg: GatewayMessageReceiveInput): Promise; updateStatus(id: string, status: string, metadata?: Record): Promise; } interface IGlobal { Path: { home: string; data: string; cache: string; config: string; state: string; log: string; bin: string; }; } interface GatewayConfig { server?: { enabled?: boolean; port?: number; hostname?: string; [key: string]: unknown; }; [key: string]: unknown; } interface GatewayServerConfig { port: number; hostname: string; [key: string]: unknown; } interface IInstance { directory: string; worktree: string; } type GatewayHookHandler = (event: { name: string; data?: unknown; }) => Promise | void; interface IHookRegistry { on(event: string, handler: GatewayHookHandler): void; off(event: string, handler: GatewayHookHandler): void; emit(event: { name: string; data?: unknown; }): Promise; } interface ILocalAgentRunner { run(input: AgentInput): Promise; } interface ILocalAgentRunner { run(input: LocalAgentInput): Promise; } interface AgentAdapter { subAgentRunner: ISubAgentRunner; localAgentRunner: ILocalAgentRunner; hookRegistry: { triggerEvent(event: string, input: T, context?: Record): Promise<{ success: boolean; output: T; modified: boolean; }>; }; global: IGlobal; instance: IInstance; sdk: EasbotClient; } interface IGatewayServer { start(): Promise; stop(): Promise; getStatus(): { running: boolean; port?: number; hostname?: string; connections?: number; }; } type gateway_AgentAdapter = AgentAdapter; type gateway_AgentInfo = AgentInfo; type gateway_ChannelInfo = ChannelInfo; type gateway_ChannelListResponse = ChannelListResponse; type gateway_ChannelPluginInfo = ChannelPluginInfo; type gateway_GatewayConfig = GatewayConfig; type gateway_GatewayHookHandler = GatewayHookHandler; type gateway_GatewayMessage = GatewayMessage; type gateway_GatewayMessageDeliveredInput = GatewayMessageDeliveredInput; type gateway_GatewayMessagePromptPart = GatewayMessagePromptPart; type gateway_GatewayMessageReadInput = GatewayMessageReadInput; type gateway_GatewayMessageReceiveInput = GatewayMessageReceiveInput; type gateway_GatewayMessageSendInput = GatewayMessageSendInput; type gateway_GatewayServerConfig = GatewayServerConfig; type gateway_IGatewayServer = IGatewayServer; type gateway_IGlobal = IGlobal; type gateway_IHookRegistry = IHookRegistry; type gateway_IInstance = IInstance; type gateway_ILocalAgentRunner = ILocalAgentRunner; type gateway_LocalAgentInput = LocalAgentInput; type gateway_LocalAgentResult = LocalAgentResult; type gateway_MessageContext = MessageContext; type gateway_MessageMetadata = MessageMetadata; type gateway_MessageStorage = MessageStorage; type gateway_MessageType = MessageType; type gateway_PlatformType = PlatformType; declare namespace gateway { export type { gateway_AgentAdapter as AgentAdapter, gateway_AgentInfo as AgentInfo, gateway_ChannelInfo as ChannelInfo, gateway_ChannelListResponse as ChannelListResponse, gateway_ChannelPluginInfo as ChannelPluginInfo, gateway_GatewayConfig as GatewayConfig, gateway_GatewayHookHandler as GatewayHookHandler, gateway_GatewayMessage as GatewayMessage, gateway_GatewayMessageDeliveredInput as GatewayMessageDeliveredInput, gateway_GatewayMessagePromptPart as GatewayMessagePromptPart, gateway_GatewayMessageReadInput as GatewayMessageReadInput, gateway_GatewayMessageReceiveInput as GatewayMessageReceiveInput, gateway_GatewayMessageSendInput as GatewayMessageSendInput, gateway_GatewayServerConfig as GatewayServerConfig, gateway_IGatewayServer as IGatewayServer, gateway_IGlobal as IGlobal, gateway_IHookRegistry as IHookRegistry, gateway_IInstance as IInstance, gateway_ILocalAgentRunner as ILocalAgentRunner, gateway_LocalAgentInput as LocalAgentInput, gateway_LocalAgentResult as LocalAgentResult, gateway_MessageContext as MessageContext, gateway_MessageMetadata as MessageMetadata, gateway_MessageStorage as MessageStorage, gateway_MessageType as MessageType, gateway_PlatformType as PlatformType }; } type ShellFunction = (input: Uint8Array) => Uint8Array; type ShellExpression = { toString(): string; } | Array | string | { raw: string; } | ReadableStream; interface EasbotShell { (strings: TemplateStringsArray, ...expressions: ShellExpression[]): EasbotShellPromise; braces(pattern: string): string[]; escape(input: string): string; env(newEnv?: Record): EasbotShell; cwd(newCwd?: string): EasbotShell; nothrow(): EasbotShell; throws(shouldThrow: boolean): EasbotShell; } interface EasbotShellPromise extends Promise { readonly stdin: WritableStream; cwd(newCwd: string): this; env(newEnv: Record | undefined): this; quiet(): this; lines(): AsyncIterable; text(encoding?: BufferEncoding): Promise; json(): Promise; arrayBuffer(): Promise; blob(): Promise; nothrow(): this; throws(shouldThrow: boolean): this; } interface EasbotShellOutput { readonly stdout: Buffer; readonly stderr: Buffer; readonly exitCode: number; text(encoding?: BufferEncoding): string; json(): unknown; arrayBuffer(): ArrayBuffer; bytes(): Uint8Array; blob(): Blob; } type EasbotShellError = Error & EasbotShellOutput; type AskInput = { permission: string; patterns: string[]; always: string[]; metadata: Record; }; type ToolContext = { sessionId: string; messageId: string; agent: string; directory: string; worktree: string; abort: AbortSignal; metadata(input: { title?: string; metadata?: Record; }): void; ask(input: AskInput): Promise; }; type ToolFunction = { description: string; args: Record; execute(args: Record, context: ToolContext): Promise; }; interface ToolDefinition { description: string; args: Record; execute?: (args: Record, context: ToolContext) => Promise; } declare function createTool>(input: { description: string; args: Args; execute(args: z.infer>, context: ToolContext): Promise; }): ToolDefinition & { args: Args; }; declare const toolSchema: typeof z; declare function buildToolArgs>(schema: T): z.ZodObject; interface ITool { id: string; name: string; description: string; args: Record; execute(args: Record, context: ToolContext): Promise; } interface EmbeddingConfig { provider: 'easbot-local' | 'local' | 'openai' | 'ollama'; model: string; batchSize?: number; } declare const DEFAULT_EMBEDDING_CONFIG: EmbeddingConfig; interface LlmConfig { provider: string; model: string; temperature?: number; maxTokens?: number; } interface GraphLlmConfig extends LlmConfig { entityExtractionPrompt?: string; relationExtractionPrompt?: string; } interface RerankLlmConfig extends LlmConfig { topK?: number; } interface HybridSearchConfig { enabled: boolean; vectorWeight: number; textWeight: number; } interface SearchConfig { maxResults: number; minScore: number; hybrid: HybridSearchConfig; } declare const DEFAULT_SEARCH_CONFIG: SearchConfig; interface SyncConfig { onBoot: boolean; onSearch: boolean; onSessionStart: boolean; intervalMs: number; } declare const DEFAULT_SYNC_CONFIG: SyncConfig; interface DatabaseConfig { path: string; walMode?: boolean; } interface IndexerConfig { batchSize: number; ignorePatterns: string[]; incremental: boolean; } declare const DEFAULT_INDEXER_CONFIG: IndexerConfig; type Language = 'ts' | 'tsx' | 'js' | 'py' | 'rs' | 'go' | 'c' | 'cpp' | 'csharp' | 'java' | 'scala' | 'ruby' | 'php' | 'zig'; interface ParserConfig { languages?: Language[]; lazyLoad?: boolean; } declare const DEFAULT_PARSER_CONFIG: ParserConfig; interface TokenizerConfig { dictPath?: string[]; } interface BaseKnowledgeConfig { workspaceDir: string; logDir?: string; database: DatabaseConfig; embedding?: EmbeddingConfig; search: SearchConfig; indexer?: IndexerConfig; tokenizer?: TokenizerConfig; } interface MemoryKnowledgeConfig extends BaseKnowledgeConfig { workspaceDir: string; sessionsDir?: string; archiveDays?: number; shortTermMaxRounds?: number; } interface MemoryKnowledgeConfigWithModels extends MemoryKnowledgeConfig { embeddingLlm?: EmbeddingModel; graphLlm?: LanguageModel; } type NoteKnowledgeSource = string; interface NoteKnowledgeConfig extends BaseKnowledgeConfig { vectorDims: number; chunkSize: number; chunkOverlap: number; minChunkLength?: number; extraPaths?: string[]; sources?: NoteKnowledgeSource[]; sync?: SyncConfig; graph?: GraphLlmConfig; rerank?: RerankLlmConfig; } declare const DEFAULT_NOTE_CHUNK_CONFIG: { readonly chunkSize: 1024; readonly chunkOverlap: 102; readonly minChunkLength: 100; }; interface NoteKnowledgeConfigWithModels extends NoteKnowledgeConfig { embeddingLlm: EmbeddingModel; graphLlm?: LanguageModel; rerankLlm?: RerankingModel; } interface CodebaseKnowledgeConfig extends BaseKnowledgeConfig { parser: ParserConfig; embedding: EmbeddingConfig; sync?: SyncConfig; } interface CodebaseKnowledgeConfigWithModels extends CodebaseKnowledgeConfig { embeddingLlm: EmbeddingModel; graphLlm?: LanguageModel; } declare function getDefaultDatabasePath(xdgData: string, dbName: string): string; declare function getWorkspaceDatabasePath(workspaceDir: string, dbName: string): string; type KnowledgeSearchSource = 'vector' | 'fts' | 'graph' | 'hybrid' | 'reranked'; interface KnowledgeSearchOptions { maxResults?: number; minScore?: number; vectorWeight?: number; textWeight?: number; enableFts?: boolean; includeEdges?: boolean; edgesLimit?: number; candidateChunkIds?: number[]; enableEmbedding?: boolean; } interface BaseSearchResult { score: number; originalScore?: number; snippet: string; } declare const GRAPH_ENTITY_TYPE_DEFINITIONS: readonly [{ readonly type: "person"; readonly rule: "A human individual, role holder, or named actor."; }, { readonly type: "organization"; readonly rule: "A company, team, institution, or formal group."; }, { readonly type: "location"; readonly rule: "A place, region, site, facility, or spatial scope."; }, { readonly type: "concept"; readonly rule: "An abstract idea, theme, method, policy, or principle."; }, { readonly type: "object"; readonly rule: "A tangible or digital thing, product, artifact, or resource."; }, { readonly type: "document"; readonly rule: "A report, note, page, paper, guideline, or formal text artifact."; }, { readonly type: "process"; readonly rule: "A workflow, procedure, lifecycle, or repeatable sequence of steps."; }, { readonly type: "task"; readonly rule: "A specific action item, issue, requirement, or objective."; }, { readonly type: "metric"; readonly rule: "A measurable quantity, KPI, target value, or indicator."; }, { readonly type: "time"; readonly rule: "A date, period, schedule marker, deadline, or temporal reference."; }, { readonly type: "event"; readonly rule: "A notable milestone, release, incident, meeting, or time-bounded activity."; }, { readonly type: "keyword"; readonly rule: "A compact fallback term when no stronger category applies."; }]; declare const GRAPH_RELATION_TYPE_DEFINITIONS: readonly [{ readonly type: "is_a"; readonly rule: "Source is a subtype or instance of target."; }, { readonly type: "part_of"; readonly rule: "Source is a component/subset of target."; }, { readonly type: "has_attribute"; readonly rule: "Source has target as a key property or characteristic."; }, { readonly type: "located_in"; readonly rule: "Source is physically or logically located in target."; }, { readonly type: "occurs_in"; readonly rule: "Source event/process happens during or within target context/time/place."; }, { readonly type: "causes"; readonly rule: "Source contributes to or causes target."; }, { readonly type: "influences"; readonly rule: "Source affects target without strict causality."; }, { readonly type: "owned_by"; readonly rule: "Source belongs to or is controlled by target."; }, { readonly type: "member_of"; readonly rule: "Source person/entity is a member of target group."; }, { readonly type: "uses"; readonly rule: "Source uses target as a dependency or tool."; }, { readonly type: "depends_on"; readonly rule: "Source requires target to work or complete."; }, { readonly type: "related_to"; readonly rule: "Weak but useful semantic relation when others do not fit."; }, { readonly type: "defines"; readonly rule: "Source document or concept defines target entity."; }, { readonly type: "referenced_in"; readonly rule: "Source entity is referenced or mentioned in target document."; }, { readonly type: "used_by"; readonly rule: "Source entity is used by target process or concept."; }, { readonly type: "relates_to"; readonly rule: "Source concept is semantically related to target concept."; }]; type PromptPart = { type: 'text'; text: string; } | { type: 'file'; url: string; filename?: string; source?: string; mime?: string; }; export { type AgentAction, type AgentAdapter, type AgentCallback, AgentCapability, type AgentCreate, type AgentExecute, type AgentExecutionResult, type AgentInfo, type AgentInput, type AgentMessage, type AgentModel, type AgentPromptPart, type AgentQuery, type AgentResult, type AgentResultMetadata, AgentState, type AgentStatistics, type AgentStatusInfo, type AgentToolCall, type AgentUpdate, type ApiResponse, ApiResponseBuilder, type ApiResult, type AskInput, type AuthInfo, type BaseKnowledgeConfig, type BaseSearchResult, type ChannelInfo, type ChannelListResponse, type ChannelPluginInfo, type CodebaseKnowledgeConfig, type CodebaseKnowledgeConfigWithModels, DEFAULT_EMBEDDING_CONFIG, DEFAULT_INDEXER_CONFIG, DEFAULT_NOTE_CHUNK_CONFIG, DEFAULT_PARSER_CONFIG, DEFAULT_SEARCH_CONFIG, DEFAULT_SYNC_CONFIG, type DatabaseConfig, type EasbotShell, type EasbotShellError, type EasbotShellOutput, type EasbotShellPromise, type EmbeddingConfig, type ErrorDetails, type ErrorMessageMode, type ErrorResponse, type FilterExpression, type FilterRule, GRAPH_ENTITY_TYPE_DEFINITIONS, GRAPH_RELATION_TYPE_DEFINITIONS, type GatewayConfig, type GatewayHookHandler, type GatewayMessage, type GatewayMessageDeliveredInput, type GatewayMessagePromptPart, type GatewayMessageReadInput, type GatewayMessageReceiveInput, type GatewayMessageSendInput, type GatewayServerConfig, gateway as GatewayTypes, type GraphLlmConfig, HTTPMethod, type HTTPRequestConfig, type HTTPResponseConfig, HTTPStatusCode, HttpStatus, type HybridSearchConfig, type IGatewayServer, type IGlobal, type IHookRegistry, type IInstance, type ISubAgentRunner, type ITool, type IndexerConfig, type KnowledgeSearchOptions, type KnowledgeSearchSource, type Language, type LlmConfig, type MemoryKnowledgeConfig, type MemoryKnowledgeConfigWithModels, type MessageAttachment, type MessageContext, type MessageMetadata, type MessageQuery, type MessageReaction, type MessageSend, MessageSender, type MessageStorage, MessageType$1 as MessageType, type NoteKnowledgeConfig, type NoteKnowledgeConfigWithModels, type NoteKnowledgeSource, type OAuth2Token, type PageParams, type PageResult, type ParserConfig, type PlatformType, type PromptPart, Protocol, type RequestOptions, type RerankLlmConfig, type RetryRequest, type RunMode, type SearchConfig, type SessionCreate, type SessionInfo, type SessionMessage, type SessionQuery, type SessionStatistics, SessionStatus, type SessionUpdate, type ShellExpression, type ShellFunction, type SortingField, type SubAgentConfig, type SubAgentEvent, type SubAgentExecuteOptions, type SubAgentHandler, type SubAgentInput, type SubAgentInstance, type SubAgentResult, type SubAgentStatus, type SuccessMessageMode, type SyncConfig, type TaskCreate, type TaskExecutionResult, type TaskInfo, type TaskLog, TaskPriority, type TaskQuery, TaskStatus, type TaskStep, type TaskUpdate, type ToolContext, type ToolDefinition, type ToolFunction, type TransportType, type UploadFileParams, type UploadFileResult, type WebSocketConnectionConfig, type WebSocketEvent, type WebSocketMessage, WebSocketMessageType, WebSocketState, buildToolArgs, createTool, getDefaultDatabasePath, getWorkspaceDatabasePath, toolSchema };