/** * A middleware from MDA's perspective: an object carrying optional lifecycle and * wrap hooks. Kept structural so the wrapper works across `createMiddleware` * objects and class-based `AgentMiddleware` instances alike. */ export interface ManagedMiddleware { [key: string]: unknown; } /** * Wrap a middleware so every hook sees `runtime.identity` (…) without changing * its name, schema, registered tools, or class. * * A `Proxy` intercepts only the hook properties: lifecycle hooks * (`beforeAgent`/`beforeModel`/`afterModel`/`afterAgent`, in either function or * `{ hook, canJumpTo }` form) get their `runtime` argument augmented, and the * `wrap*` hooks get `request.runtime` augmented. Every other property and method * — including the middleware brand, `name`, and `stateSchema` — passes through, * preserving hook detection, `instanceof`, and framework wiring. Hooks are bound * to the original instance so class-based middleware keep their `this`. */ export declare function withManagedMiddleware(middleware: T): T; /** Wrap every middleware in a list with {@link withManagedMiddleware}. */ export declare function wrapMiddlewareWithManagedRuntime(middleware: readonly T[]): T[]; //# sourceMappingURL=managed-middleware.d.ts.map