import { Agent } from 'agents'; import { Hono } from 'hono'; import { SSEStreamingApi } from 'hono/streaming'; import { BlankEnv } from 'hono/types'; import { MCPClientManager } from 'agents/mcp/client'; type MCPClientConnection = MCPClientManager["mcpConnections"][string]; type ConstructorType = new (...args: any[]) => T; interface InstrumentedProperties { _activeStreams: Set; _mcpConnections?: Map; _fiberRouter?: Hono; } /** * Mixin factory that adds instruments the Agent class with observability capabilities * allowing it to be viewed in the Fiberplane agents playground * * Usage: * ```typescript * export class MyCoreAgent extends Agent { * // Your agent implementation * } * * // Creates a new class that extends MyCoreAgent with observability features * const MyAgent = withInstrumentation(MyCoreAgent); * ``` */ declare function withInstrumentation>(BaseClass: ConstructorType): ConstructorType; interface FiberplaneEntryWrapperOptions { customPath?: string; } /** * Creates a fetch handler that serves the Fiberplane app */ declare function fiberplane(userFetch: (request: Request, env: E, ctx: ExecutionContext) => Promise, options?: FiberplaneEntryWrapperOptions): (request: Request, env: E, ctx: ExecutionContext) => Promise; export { type ConstructorType, fiberplane, withInstrumentation };