/** * Feature-Path Logging Utilities * * Purpose: * - Provide shared helpers for feature-path diagnostics across message prep, * LLM request/response logging, and tool lifecycle tracing. * * Key Features: * - Canonical category helper for dual-category migration logging. * - Raw-payload log gating using existing per-category logger controls. * - Recursive sensitive-field redaction for structured payloads. * - Safe truncation of oversized string values to limit log bloat. * * Implementation Notes: * - Uses core logger category filtering (`shouldLogForCategory`) for gating. * - Redaction is key-name based and preserves object structure where possible. * - Circular object references are replaced with a stable marker. * * Recent Changes: * - 2026-02-28: Added shared feature-path logging helpers and redaction utilities. */ import { type LogLevel } from './logger.js'; /** * Redact sensitive values and truncate overlong strings in structured log payloads. */ export declare function sanitizeRawPayloadForLog(payload: unknown, options?: { maxStringLength?: number; }): unknown; /** * Returns true when a raw logging category is enabled for the given level. */ export declare function shouldEmitRawLog(category: 'llm.request.raw' | 'llm.response.raw', level?: LogLevel): boolean; /** * Emit to a canonical category and optional migration aliases. */ export declare function emitAliasedCategoryLog(level: LogLevel, canonicalCategory: string, message: string, data?: Record, aliases?: string[]): void; /** * Build a standard correlation envelope for feature-path logs. */ export declare function buildFeaturePathCorrelation(values: { worldId?: string; chatId?: string | null; agentId?: string; messageId?: string; turnId?: string; runId?: string; toolCallId?: string; toolName?: string; }): Record; export declare function mergeFeaturePathData(correlation: Record, data?: Record): Record;