UNPKG

vibelogger

Version:

AI-Native Logging for LLM Agent Development - TypeScript/Node.js Implementation

89 lines 2.18 kB
/** * TypeScript type definitions for VibeCoding Logger * * These types define the core interfaces while maintaining JSON compatibility * with the Python implementation. The JSON field names use snake_case to match * the Python version, while TypeScript code uses camelCase. */ /** * Log levels supported by VibeCoding Logger */ export declare enum LogLevel { DEBUG = "DEBUG", INFO = "INFO", WARNING = "WARNING", ERROR = "ERROR", CRITICAL = "CRITICAL" } /** * Environment information captured with each log entry * JSON field names match Python implementation */ export interface EnvironmentInfo { node_version: string; os: string; platform: string; architecture: string; runtime: string; } /** * Core log entry structure - matches Python JSON output exactly * All field names use snake_case for JSON compatibility */ export interface LogEntry { timestamp: string; level: LogLevel; correlation_id: string; operation: string; message: string; context: Record<string, any>; environment: EnvironmentInfo; source?: string; stack_trace?: string; human_note?: string; ai_todo?: string; } /** * Configuration options for VibeCoding Logger * Uses camelCase for TypeScript code, converted to snake_case in JSON */ export interface VibeLoggerConfig { correlationId?: string; logFile?: string; autoSave?: boolean; maxFileSizeMb?: number; keepLogsInMemory?: boolean; maxMemoryLogs?: number; createDirs?: boolean; } /** * Options for individual log calls */ export interface LogOptions { context?: Record<string, any>; humanNote?: string; aiTodo?: string; includeStack?: boolean; } /** * Exception information extracted from errors */ export interface ErrorInfo { message: string; name: string; stack?: string; originalError: any; } /** * Runtime environment detection */ export type RuntimeEnvironment = 'node' | 'browser' | 'deno' | 'bun' | 'unknown'; /** * File operation result */ export interface FileOperationResult { success: boolean; error?: string; rotated?: boolean; } //# sourceMappingURL=types.d.ts.map