/**
 * Context Warning Middleware
 *
 * Replaces inline `contextManager.shouldWarn()` checks in the agent executor.
 *
 * @module agent/middleware
 */
export class ContextWarningMiddleware {
    contextManager;
    name = 'context-warning';
    priority = 30;
    constructor(contextManager) {
        this.contextManager = contextManager;
    }
    beforeTurn(context) {
        const warning = this.contextManager.shouldWarn(context.messages);
        if (warning.warn) {
            return {
                action: 'warn',
                message: warning.message,
            };
        }
        return { action: 'continue' };
    }
}
//# sourceMappingURL=context-warning.js.map