/**
 * Middleware Types
 *
 * Core types for the conversation middleware pipeline.
 * Inspired by Mistral Vibe's elegant middleware architecture.
 */
// ============================================================================
// Middleware Actions
// ============================================================================
/**
 * Actions that middleware can return to control conversation flow
 */
export var MiddlewareAction;
(function (MiddlewareAction) {
    /** Continue normal execution */
    MiddlewareAction["CONTINUE"] = "continue";
    /** Stop the conversation immediately */
    MiddlewareAction["STOP"] = "stop";
    /** Trigger context compaction */
    MiddlewareAction["COMPACT"] = "compact";
    /** Inject a message into the conversation */
    MiddlewareAction["INJECT_MESSAGE"] = "inject_message";
})(MiddlewareAction || (MiddlewareAction = {}));
// ============================================================================
// Helper Functions
// ============================================================================
/**
 * Create a default "continue" result
 */
export function continueResult() {
    return { action: MiddlewareAction.CONTINUE };
}
/**
 * Create a "stop" result with reason
 */
export function stopResult(reason, message) {
    return {
        action: MiddlewareAction.STOP,
        reason,
        message,
    };
}
/**
 * Create a "compact" result
 */
export function compactResult(reason, metadata) {
    return {
        action: MiddlewareAction.COMPACT,
        reason,
        metadata,
    };
}
/**
 * Create an "inject message" result
 */
export function injectMessageResult(message, reason) {
    return {
        action: MiddlewareAction.INJECT_MESSAGE,
        message,
        reason,
    };
}
/**
 * Create initial conversation stats
 */
export function createInitialStats() {
    return {
        turns: 0,
        totalTokens: 0,
        promptTokens: 0,
        completionTokens: 0,
        sessionCost: 0,
        toolCalls: 0,
        successfulToolCalls: 0,
        failedToolCalls: 0,
        startTime: new Date(),
        durationMs: 0,
    };
}
/**
 * Default model info (conservative estimates)
 */
export function defaultModelInfo() {
    return {
        name: 'unknown',
        maxContextTokens: 128000,
        inputPricePerMillion: 0.15,
        outputPricePerMillion: 0.60,
    };
}
//# sourceMappingURL=types.js.map