@loglayer/transport-pretty-terminal 1.0.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,11 +1,13 @@
1
1
  // src/PrettyTerminalTransport.ts
2
2
  import { LoggerlessTransport } from "@loglayer/transport";
3
- import chalk5 from "chalk";
3
+ import chalk7 from "chalk";
4
4
 
5
- // src/LogRenderer.ts
5
+ // src/views/SimpleView.ts
6
+ import wrap from "wrap-ansi";
7
+
8
+ // src/views/utils.ts
6
9
  import chalk2 from "chalk";
7
10
  import truncate from "cli-truncate";
8
- import wrap from "wrap-ansi";
9
11
 
10
12
  // src/vendor/prettyjson.js
11
13
  import chalk from "chalk";
@@ -201,193 +203,204 @@ function render(data, options, indentation) {
201
203
  return renderToArray(data, options, indentation).join("\n");
202
204
  }
203
205
 
204
- // src/LogRenderer.ts
205
- var LogRenderer = class {
206
- /** Current terminal width in characters */
207
- termWidth;
208
- /** Maximum depth for displaying nested objects inline */
209
- maxInlineDepth;
210
- /** Maximum length for inline data before truncating */
211
- maxInlineLength;
212
- /** Whether arrays are currently collapsed in detail view */
213
- isArraysCollapsed = false;
214
- /** Color and formatting config for simple log view */
215
- simpleViewConfig;
216
- /** Color and formatting config for detailed view */
217
- detailedViewConfig;
218
- /** Current scroll position in detailed view */
219
- detailViewScrollPos = 0;
220
- /** Cached content lines for detailed view */
221
- detailViewContent = [];
222
- /**
223
- * Creates a new LogRenderer instance.
224
- *
225
- * @param simpleViewConfig - Configuration for simple log view
226
- * @param detailedViewConfig - Configuration for detailed view
227
- * @param maxInlineDepth - Maximum depth for inline object display
228
- * @param maxInlineLength - Maximum length before truncation
229
- */
230
- constructor(simpleViewConfig, detailedViewConfig, maxInlineDepth, maxInlineLength) {
231
- this.simpleViewConfig = simpleViewConfig;
232
- this.detailedViewConfig = detailedViewConfig;
233
- this.maxInlineDepth = maxInlineDepth;
234
- this.maxInlineLength = maxInlineLength;
235
- this.termWidth = process.stdout.columns || 80;
236
- process.stdout.on("resize", () => {
237
- this.termWidth = process.stdout.columns || 80;
238
- });
239
- }
240
- /**
241
- * Gets the appropriate color for a log level.
242
- * Handles both simple and detailed view color schemes.
243
- *
244
- * @param level - Log level (trace, debug, info, etc.)
245
- * @param isDetailView - Whether to use detailed view colors
246
- * @returns Chalk instance for the color
247
- */
248
- getLevelColor(level, isDetailView = false) {
249
- const colors = isDetailView ? this.detailedViewConfig.colors : this.simpleViewConfig.colors;
250
- return colors[level] || chalk2.white;
251
- }
252
- /**
253
- * Formats a timestamp into a human-readable string.
254
- * Format: HH:MM:SS.mmm
255
- *
256
- * @param timestamp - Unix timestamp in milliseconds
257
- * @returns Formatted and colored timestamp string
258
- */
259
- formatTimestamp(timestamp) {
260
- const date = new Date(timestamp);
261
- return this.simpleViewConfig.logIdColor(
262
- `${date.getHours().toString().padStart(2, "0")}:${date.getMinutes().toString().padStart(2, "0")}:${date.getSeconds().toString().padStart(2, "0")}.${date.getMilliseconds().toString().padStart(3, "0")}`
263
- );
264
- }
265
- /**
266
- * Formats structured data for inline display.
267
- * Handles nested objects, arrays, and primitive values.
268
- * Truncates output to maintain readability.
269
- *
270
- * @param data - Data to format
271
- * @returns Formatted string with color coding
272
- */
273
- formatInlineData(data) {
274
- if (!data) return "";
275
- const formatValue = (value) => {
276
- if (typeof value === "string") return value;
277
- if (typeof value === "number" || typeof value === "boolean") return value.toString();
278
- if (value === null) return "null";
279
- if (value === void 0) return "undefined";
280
- if (Array.isArray(value)) return "[...]";
281
- if (typeof value === "object") return "{...}";
282
- return value.toString();
283
- };
284
- const pairs = [];
285
- const traverse = (obj, prefix = "", depth = 0) => {
286
- if (depth >= this.maxInlineDepth) return;
287
- for (const [key, value] of Object.entries(obj)) {
288
- const fullKey = prefix ? `${prefix}.${key}` : key;
289
- if (value && typeof value === "object" && !Array.isArray(value)) {
290
- traverse(value, fullKey, depth + 1);
206
+ // src/views/utils.ts
207
+ function formatTimestamp(timestamp, colorFn) {
208
+ const date = new Date(timestamp);
209
+ return colorFn(
210
+ `${date.getHours().toString().padStart(2, "0")}:${date.getMinutes().toString().padStart(2, "0")}:${date.getSeconds().toString().padStart(2, "0")}.${date.getMilliseconds().toString().padStart(3, "0")}`
211
+ );
212
+ }
213
+ function getLevelColor(level, colors) {
214
+ return colors[level] || chalk2.white;
215
+ }
216
+ function formatValue(value, expanded = false) {
217
+ if (typeof value === "string") return value;
218
+ if (typeof value === "number" || typeof value === "boolean") return value.toString();
219
+ if (value === null) return "null";
220
+ if (value === void 0) return "undefined";
221
+ if (Array.isArray(value)) return expanded ? JSON.stringify(value) : "[...]";
222
+ if (typeof value === "object") return expanded ? JSON.stringify(value) : "{...}";
223
+ return value.toString();
224
+ }
225
+ function formatInlineData(data, config, maxDepth, maxLength, expanded = false) {
226
+ if (!data) return "";
227
+ const pairs = [];
228
+ const traverse = (obj, prefix = "", depth = 0) => {
229
+ if (!expanded && depth >= maxDepth) return;
230
+ for (const [key, value] of Object.entries(obj)) {
231
+ const fullKey = prefix ? `${prefix}.${key}` : key;
232
+ if (value && typeof value === "object" && !Array.isArray(value)) {
233
+ if (expanded) {
234
+ pairs.push(`${config.dataKeyColor(fullKey)}=${config.dataValueColor(JSON.stringify(value))}`);
291
235
  } else {
292
- pairs.push(
293
- `${this.simpleViewConfig.dataKeyColor(fullKey)}=${this.simpleViewConfig.dataValueColor(formatValue(value))}`
294
- );
236
+ traverse(value, fullKey, depth + 1);
295
237
  }
238
+ } else {
239
+ pairs.push(`${config.dataKeyColor(fullKey)}=${config.dataValueColor(formatValue(value, expanded))}`);
296
240
  }
297
- };
298
- traverse(data);
299
- const result = pairs.join(" ");
300
- return truncate(result, this.maxInlineLength);
241
+ }
242
+ };
243
+ traverse(data);
244
+ const result = pairs.join(" ");
245
+ return expanded ? result : truncate(result, maxLength);
246
+ }
247
+
248
+ // src/views/SimpleView.ts
249
+ var SimpleView = class {
250
+ termWidth;
251
+ config;
252
+ constructor(config) {
253
+ this.config = config;
254
+ this.termWidth = process.stdout.columns || 80;
255
+ }
256
+ updateTerminalWidth(width) {
257
+ this.termWidth = width;
301
258
  }
302
259
  /**
303
- * Renders a single log line in simple view format.
304
- * Format: [timestamp] LEVEL [id] message data
305
- *
306
- * @param entry - Log entry to render
260
+ * Renders a single log entry based on the current view mode
307
261
  */
308
262
  renderLogLine(entry) {
309
- const levelColor = this.getLevelColor(entry.level);
310
- const timestamp = this.formatTimestamp(entry.timestamp);
263
+ const levelColor = getLevelColor(entry.level, this.config.config.colors);
311
264
  const chevron = levelColor(`\u25B6 ${entry.level.toUpperCase()} `);
312
- const logId = this.simpleViewConfig.logIdColor(`[${entry.id}]`);
313
- const message = entry.message;
314
- const data = entry.data ? this.formatInlineData(JSON.parse(entry.data)) : "";
315
- const line = `${timestamp} ${chevron}${logId} ${message}${data ? ` ${data}` : ""}`;
316
- console.log(wrap(line, this.termWidth, { hard: true }));
265
+ const message = entry.message || "(no message)";
266
+ const timestamp = formatTimestamp(entry.timestamp, this.config.config.logIdColor);
267
+ switch (this.config.viewMode) {
268
+ case "condensed": {
269
+ const condensedLine = `${timestamp} ${chevron}${message}`;
270
+ console.log(wrap(condensedLine, this.termWidth, { hard: true }));
271
+ break;
272
+ }
273
+ case "full": {
274
+ const logId = this.config.config.logIdColor(`[${entry.id}]`);
275
+ const fullData = entry.data ? formatInlineData(
276
+ JSON.parse(entry.data),
277
+ this.config.config,
278
+ this.config.maxInlineDepth,
279
+ this.config.maxInlineLength,
280
+ true
281
+ ) : "";
282
+ const expandedLine = `${timestamp} ${chevron}${logId} ${message}${fullData ? ` ${fullData}` : ""}`;
283
+ console.log(wrap(expandedLine, this.termWidth, { hard: true }));
284
+ break;
285
+ }
286
+ default: {
287
+ const logId = this.config.config.logIdColor(`[${entry.id}]`);
288
+ const normalData = entry.data ? formatInlineData(
289
+ JSON.parse(entry.data),
290
+ this.config.config,
291
+ this.config.maxInlineDepth,
292
+ this.config.maxInlineLength
293
+ ) : "";
294
+ const normalLine = `${timestamp} ${chevron}${logId} ${message}${normalData ? ` ${normalData}` : ""}`;
295
+ console.log(wrap(normalLine, this.termWidth, { hard: true }));
296
+ break;
297
+ }
298
+ }
299
+ }
300
+ render() {
301
+ throw new Error("SimpleView.render() should not be called directly. Use renderLogLine() instead.");
302
+ }
303
+ };
304
+
305
+ // src/views/DetailView.ts
306
+ import chalk3 from "chalk";
307
+ import wrap2 from "wrap-ansi";
308
+ var DetailView = class {
309
+ termWidth;
310
+ config;
311
+ detailViewContent = [];
312
+ constructor(config) {
313
+ this.config = config;
314
+ this.termWidth = process.stdout.columns || 80;
315
+ }
316
+ updateTerminalWidth(width) {
317
+ this.termWidth = width;
317
318
  }
318
319
  /**
319
- * Formats a compact single-line version of a log entry.
320
- * Used for showing context in detailed view.
321
- *
322
- * @param entry - Log entry to render
323
- * @param prefix - Optional prefix (e.g., "←" for previous entry)
324
- * @returns Formatted log line
320
+ * Formats a compact single-line version of a log entry
325
321
  */
326
322
  formatCompactLogLine(entry, prefix = "") {
327
323
  if (!entry) return "";
328
- const levelColor = this.getLevelColor(entry.level, true);
329
- const logId = this.detailedViewConfig.logIdColor(`[${entry.id}]`);
324
+ const levelColor = getLevelColor(entry.level, this.config.config.colors);
325
+ const logId = this.config.config.logIdColor(`[${entry.id}]`);
330
326
  const line = `${prefix}${levelColor(entry.level.toUpperCase())} ${logId} ${entry.message}`;
331
- return this.detailedViewConfig.separatorColor(wrap(line, this.termWidth, { hard: true }));
327
+ return this.config.config.separatorColor(wrap2(line, this.termWidth, { hard: true }));
332
328
  }
333
329
  /**
334
- * Renders the detailed view of a log entry.
335
- * Shows full entry details with context and formatted data.
336
- *
337
- * @param entry - Log entry to show in detail
338
- * @param prevEntry - Previous entry for context
339
- * @param nextEntry - Next entry for context
340
- * @param scrollPos - Current scroll position
330
+ * Formats a timestamp into a human-readable relative time
341
331
  */
342
- renderDetailView(entry, prevEntry, nextEntry, scrollPos = 0) {
332
+ formatRelativeTime(timestamp) {
333
+ const now = /* @__PURE__ */ new Date();
334
+ const diffMs = now.getTime() - timestamp.getTime();
335
+ const diffSecs = Math.floor(diffMs / 1e3);
336
+ const diffMins = Math.floor(diffSecs / 60);
337
+ const diffHours = Math.floor(diffMins / 60);
338
+ const diffDays = Math.floor(diffHours / 24);
339
+ if (diffSecs < 60) return `${diffSecs}s ago`;
340
+ if (diffMins < 60) return `${diffMins}m ago`;
341
+ if (diffHours < 24) return `${diffHours}h ago`;
342
+ if (diffDays === 1) return "yesterday";
343
+ if (diffDays < 30) return `${diffDays}d ago`;
344
+ return timestamp.toLocaleDateString();
345
+ }
346
+ render() {
343
347
  console.clear();
344
- if (this.isJsonView) {
345
- if (entry.data) {
346
- console.log(JSON.stringify(JSON.parse(entry.data)));
348
+ if (this.config.isJsonView) {
349
+ if (this.config.entry.data) {
350
+ console.log(JSON.stringify(JSON.parse(this.config.entry.data)));
347
351
  } else {
348
352
  console.log("{}");
349
353
  }
350
354
  console.log(`
351
- ${this.detailedViewConfig.separatorColor("TAB to return to detailed view")}`);
355
+ ${this.config.config.separatorColor("TAB to return to detailed view")}`);
352
356
  return;
353
357
  }
354
358
  const headerContent = [];
355
- if (prevEntry) {
356
- const prevLine = this.formatCompactLogLine(prevEntry, "\u2190 ");
359
+ if (this.config.prevEntry) {
360
+ const prevLine = this.formatCompactLogLine(this.config.prevEntry, "\u2190 ");
357
361
  headerContent.push(prevLine);
358
- headerContent.push(this.detailedViewConfig.separatorColor("\u2500".repeat(this.termWidth)));
362
+ headerContent.push(this.config.config.separatorColor("\u2500".repeat(this.termWidth)));
359
363
  }
360
364
  const footerContent = [];
361
- if (nextEntry) {
362
- footerContent.push(this.detailedViewConfig.separatorColor("\u2500".repeat(this.termWidth)));
363
- const nextLine = this.formatCompactLogLine(nextEntry, "\u2192 ");
365
+ if (this.config.nextEntry) {
366
+ footerContent.push(this.config.config.separatorColor("\u2500".repeat(this.termWidth)));
367
+ const nextLine = this.formatCompactLogLine(this.config.nextEntry, "\u2192 ");
364
368
  footerContent.push(nextLine);
365
369
  }
366
370
  footerContent.push("");
367
- footerContent.push(
368
- this.detailedViewConfig.separatorColor("TAB to exit \u2022 \u2191/\u2193 scroll \u2022 Q/W page up/down \u2022 J raw JSON")
369
- );
370
- footerContent.push(this.detailedViewConfig.separatorColor("\u2190/\u2192 navigate \u2022 A/S first/last log \u2022 C toggle arrays"));
371
+ footerContent.push(this.config.config.separatorColor("\u2191/\u2193 scroll \u2022 Q/W page up/down \u2022 J raw JSON"));
372
+ footerContent.push(this.config.config.separatorColor("\u2190/\u2192 navigate \u2022 A/S first/last log \u2022 C toggle arrays"));
371
373
  const mainContent = [];
372
- const levelColor = this.getLevelColor(entry.level, true);
373
- const header = levelColor(`=== Log Detail [${entry.id}] ===`);
374
+ const levelColor = getLevelColor(this.config.entry.level, this.config.config.colors);
375
+ let headerText = `=== Log Detail [${this.config.entry.id}] (${this.config.currentLogIndex} / ${this.config.totalLogs})`;
376
+ if (this.config.filterText) {
377
+ headerText += ` [Filter: ${this.config.filterText}]`;
378
+ }
379
+ headerText += " ===";
380
+ const header = levelColor(headerText);
374
381
  mainContent.push(header);
375
- const timestamp = new Date(entry.timestamp);
376
- const isoTime = timestamp.toISOString();
382
+ const timestamp = new Date(this.config.entry.timestamp);
383
+ const isoTime = formatTimestamp(this.config.entry.timestamp, this.config.config.dataValueColor);
377
384
  const relativeTime = this.formatRelativeTime(timestamp);
385
+ mainContent.push(`${this.config.config.labelColor("Timestamp:")} ${isoTime} (${relativeTime})`);
378
386
  mainContent.push(
379
- `${this.detailedViewConfig.labelColor("Timestamp:")} ${this.detailedViewConfig.dataValueColor(isoTime)} (${relativeTime})`
380
- );
381
- mainContent.push(`${this.detailedViewConfig.labelColor("Level:")} ${levelColor.bold(entry.level.toUpperCase())}`);
382
- mainContent.push(
383
- `${this.detailedViewConfig.labelColor("Message:")} ${this.detailedViewConfig.dataValueColor(entry.message)}`
387
+ `${this.config.config.labelColor("Level:")} ${levelColor.bold(this.config.entry.level.toUpperCase())}`
384
388
  );
385
- if (entry.data) {
386
- mainContent.push(this.detailedViewConfig.labelColor("\nData:"));
387
- const jsonLines = render(JSON.parse(entry.data), {
388
- ...this.detailedViewConfig.jsonColors,
389
+ if (this.config.entry.message) {
390
+ mainContent.push(
391
+ `${this.config.config.labelColor("Message:")} ${this.config.config.dataValueColor(this.config.entry.message)}`
392
+ );
393
+ } else {
394
+ mainContent.push(
395
+ `${this.config.config.labelColor("Message:")} ${this.config.config.dataValueColor.dim("(no message)")}`
396
+ );
397
+ }
398
+ if (this.config.entry.data) {
399
+ mainContent.push(this.config.config.labelColor("\nData:"));
400
+ const jsonLines = render(JSON.parse(this.config.entry.data), {
401
+ ...this.config.config.jsonColors,
389
402
  defaultIndentation: 2,
390
- collapseArrays: this.isArraysCollapsed
403
+ collapseArrays: this.config.isArraysCollapsed
391
404
  }).split("\n");
392
405
  mainContent.push(...jsonLines);
393
406
  }
@@ -395,36 +408,34 @@ ${this.detailedViewConfig.separatorColor("TAB to return to detailed view")}`);
395
408
  const headerHeight = headerContent.length;
396
409
  const footerHeight = footerContent.length;
397
410
  const scrollIndicatorLines = 2;
398
- const bufferSpace = 2;
411
+ const bufferSpace = 4;
399
412
  const availableHeight = Math.max(
400
413
  0,
401
414
  process.stdout.rows - headerHeight - footerHeight - scrollIndicatorLines - bufferSpace
402
415
  );
403
- this.detailViewScrollPos = Math.max(0, Math.min(scrollPos, mainContent.length - availableHeight));
404
416
  for (const line of headerContent) {
405
417
  console.log(line);
406
418
  }
407
- if (this.detailViewScrollPos > 0) {
408
- console.log(chalk2.dim("\u2191 More content above"));
419
+ if (this.config.scrollPos > 0) {
420
+ console.log(chalk3.dim("\u2191 More content above"));
409
421
  }
410
- const startIndex = this.detailViewScrollPos;
422
+ const startIndex = this.config.scrollPos;
411
423
  const visibleContent = mainContent.slice(startIndex, startIndex + availableHeight);
412
424
  for (const line of visibleContent) {
413
425
  console.log(line);
414
426
  }
415
- if (this.detailViewScrollPos + availableHeight < mainContent.length) {
416
- console.log(chalk2.dim("\u2193 More content below"));
427
+ if (this.config.scrollPos + availableHeight < mainContent.length) {
428
+ console.log(chalk3.dim("\u2193 More content below"));
417
429
  }
418
430
  for (const line of footerContent) {
419
431
  console.log(line);
420
432
  }
421
433
  }
422
434
  /**
423
- * Updates the scroll position in detailed view
424
- * @param delta - Number of lines to scroll (positive for down, negative for up)
435
+ * Gets the maximum scroll position based on current content and window size
425
436
  */
426
- scrollDetailView(delta) {
427
- const headerHeight = 2;
437
+ getMaxScrollPosition() {
438
+ const headerHeight = this.config.prevEntry ? 2 : 0;
428
439
  const footerHeight = 5;
429
440
  const scrollIndicatorLines = 2;
430
441
  const bufferSpace = 2;
@@ -432,100 +443,219 @@ ${this.detailedViewConfig.separatorColor("TAB to return to detailed view")}`);
432
443
  0,
433
444
  process.stdout.rows - headerHeight - footerHeight - scrollIndicatorLines - bufferSpace
434
445
  );
435
- const maxScroll = Math.max(0, this.detailViewContent.length - availableHeight);
436
- this.detailViewScrollPos = Math.max(0, Math.min(maxScroll, this.detailViewScrollPos + delta));
446
+ return Math.max(0, this.detailViewContent.length - availableHeight);
437
447
  }
438
- /**
439
- * Gets the current scroll position
440
- */
441
- getDetailViewScrollPos() {
442
- return this.detailViewScrollPos;
448
+ };
449
+
450
+ // src/views/SelectionView.ts
451
+ import chalk4 from "chalk";
452
+ import wrap3 from "wrap-ansi";
453
+ var SelectionView = class {
454
+ termWidth;
455
+ config;
456
+ constructor(config) {
457
+ this.config = config;
458
+ this.termWidth = process.stdout.columns || 80;
443
459
  }
444
- /**
445
- * Renders the interactive selection view.
446
- * Shows a scrollable list of logs with current selection.
447
- *
448
- * Features:
449
- * - Pagination for large log sets
450
- * - Active filter display
451
- * - Scroll indicators
452
- * - Selected item highlighting
453
- *
454
- * @param logs - Array of log entries to display
455
- * @param selectedIndex - Index of currently selected log
456
- * @param filterText - Current filter text (if any)
457
- * @param newLogCount - Number of new logs since last render (optional)
458
- */
459
- renderSelectionView(logs, selectedIndex, filterText, newLogCount = 0) {
460
+ updateTerminalWidth(width) {
461
+ this.termWidth = width;
462
+ }
463
+ render() {
460
464
  console.clear();
461
- const headerHeight = filterText ? 2 : 0;
465
+ const headerHeight = this.config.filterText ? 2 : 0;
462
466
  const footerHeight = 2;
463
467
  const availableHeight = process.stdout.rows - headerHeight - footerHeight;
464
- if (filterText) {
465
- console.log(chalk2.cyan("Filter:"), chalk2.white(filterText));
466
- console.log(chalk2.dim("\u2500".repeat(this.termWidth)));
468
+ if (this.config.filterText) {
469
+ console.log(chalk4.cyan("Filter:"), chalk4.white(this.config.filterText));
470
+ console.log(chalk4.dim("\u2500".repeat(this.termWidth)));
467
471
  }
468
- if (logs.length === 0) {
469
- console.log(chalk2.yellow("No matching logs found"));
472
+ if (this.config.logs.length === 0) {
473
+ console.log(chalk4.yellow("No matching logs found"));
470
474
  } else {
471
475
  const visibleLines = Math.min(availableHeight, 20);
472
476
  const bottomPadding = 2;
473
- let startIdx = Math.max(0, selectedIndex - (visibleLines - bottomPadding - 1));
474
- const endIdx = Math.min(logs.length, startIdx + visibleLines);
475
- if (endIdx - startIdx < visibleLines && endIdx < logs.length) {
477
+ let startIdx = Math.max(0, this.config.selectedIndex - (visibleLines - bottomPadding - 1));
478
+ const endIdx = Math.min(this.config.logs.length, startIdx + visibleLines);
479
+ if (endIdx - startIdx < visibleLines && endIdx < this.config.logs.length) {
476
480
  startIdx = Math.max(0, endIdx - visibleLines);
477
481
  }
478
482
  if (startIdx > 0) {
479
- console.log(chalk2.dim(" \u2191 More logs above"));
483
+ console.log(chalk4.dim(" \u2191 More logs above"));
480
484
  }
481
- logs.slice(startIdx, endIdx).forEach((entry, index) => {
485
+ this.config.logs.slice(startIdx, endIdx).forEach((entry, index) => {
482
486
  const actualIndex = startIdx + index;
483
- const isSelected = actualIndex === selectedIndex;
484
- const prefix = isSelected ? this.simpleViewConfig.selectorColor("\u25BA ") : " ";
485
- const timestamp = this.formatTimestamp(entry.timestamp);
486
- const levelColor = this.getLevelColor(entry.level);
487
+ const isSelected = actualIndex === this.config.selectedIndex;
488
+ const prefix = isSelected ? this.config.config.selectorColor("\u25BA ") : " ";
489
+ const timestamp = formatTimestamp(entry.timestamp, this.config.config.logIdColor);
490
+ const levelColor = getLevelColor(entry.level, this.config.config.colors);
487
491
  const chevron = levelColor(`${entry.level.toUpperCase()} `);
488
- const logId = chalk2.dim(`[${entry.id}]`);
492
+ const logId = chalk4.dim(`[${entry.id}]`);
489
493
  const message = entry.message;
490
- const data = entry.data ? this.formatInlineData(JSON.parse(entry.data)) : "";
491
- const mainLine = `${prefix}${timestamp} ${chevron}${logId} ${message}`;
492
- console.log(wrap(mainLine, this.termWidth - 2, { hard: true }));
493
- if (data) {
494
- const wrappedData = wrap(data, this.termWidth - (isSelected ? 6 : 2), { hard: true });
495
- const indentedLines = wrappedData.split("\n").map((line) => isSelected ? ` ${line}` : line);
496
- console.log(indentedLines.join("\n"));
494
+ const data = entry.data ? ` ${formatInlineData(JSON.parse(entry.data), this.config.config, 0, 0, true)}` : "";
495
+ const mainLine = `${prefix}${timestamp} ${chevron}${logId} ${message}${data}`;
496
+ const wrappedText = wrap3(mainLine, this.termWidth - 2, { hard: true });
497
+ if (isSelected) {
498
+ const lines = wrappedText.split("\n");
499
+ console.log(lines[0]);
500
+ for (const line of lines.slice(1)) {
501
+ console.log(` ${this.config.config.selectorColor("\u2502")} ${line}`);
502
+ }
503
+ } else {
504
+ console.log(wrappedText);
497
505
  }
498
506
  });
499
- if (endIdx < logs.length || newLogCount > 0) {
500
- const moreLogsText = newLogCount > 0 ? this.simpleViewConfig.selectorColor(
501
- ` \u2193 ${newLogCount} new log${newLogCount === 1 ? "" : "s"} available (press \u2193 to view)`
502
- ) : chalk2.dim(" \u2193 More logs below");
507
+ if (endIdx < this.config.logs.length || this.config.newLogCount > 0) {
508
+ const moreLogsText = this.config.newLogCount > 0 ? this.config.config.selectorColor(
509
+ ` \u2193 ${this.config.newLogCount} new log${this.config.newLogCount === 1 ? "" : "s"} available (press \u2193 to view)`
510
+ ) : chalk4.dim(" \u2193 More logs below");
503
511
  console.log(moreLogsText);
504
512
  }
505
513
  }
506
- console.log(chalk2.dim("\nType to filter \u2022 Enter to view details \u2022 TAB to exit"));
514
+ console.log(chalk4.dim("\nType to filter \u2022 Enter to view details \u2022 TAB to exit"));
507
515
  }
516
+ };
517
+
518
+ // src/LogRenderer.ts
519
+ var LogRenderer = class {
520
+ /** Current terminal width in characters */
521
+ termWidth;
522
+ /** Maximum depth for displaying nested objects inline */
523
+ maxInlineDepth;
524
+ /** Maximum length for inline data before truncating */
525
+ maxInlineLength;
526
+ /** Whether arrays are currently collapsed in detail view */
527
+ isArraysCollapsed = true;
528
+ /** Current view mode in simple mode */
529
+ viewMode = "full";
530
+ /** Color and formatting config for simple log view */
531
+ simpleViewConfig;
532
+ /** Color and formatting config for detailed view */
533
+ detailedViewConfig;
534
+ /** Whether we're showing raw JSON view */
535
+ isJsonView = false;
536
+ /** Current scroll position in detailed view */
537
+ detailViewScrollPos = 0;
538
+ /** View instances */
539
+ simpleView;
540
+ detailView = null;
541
+ selectionView = null;
508
542
  /**
509
- * Formats a timestamp into a human-readable relative time
510
- * @param timestamp - Date to format
511
- * @returns Formatted relative time string
543
+ * Creates a new LogRenderer instance.
544
+ *
545
+ * @param simpleViewConfig - Configuration for simple log view
546
+ * @param detailedViewConfig - Configuration for detailed view
547
+ * @param maxInlineDepth - Maximum depth for inline object display
548
+ * @param maxInlineLength - Maximum length before truncation
512
549
  */
513
- formatRelativeTime(timestamp) {
514
- const now = /* @__PURE__ */ new Date();
515
- const diffMs = now.getTime() - timestamp.getTime();
516
- const diffSecs = Math.floor(diffMs / 1e3);
517
- const diffMins = Math.floor(diffSecs / 60);
518
- const diffHours = Math.floor(diffMins / 60);
519
- const diffDays = Math.floor(diffHours / 24);
520
- if (diffSecs < 60) return `${diffSecs}s ago`;
521
- if (diffMins < 60) return `${diffMins}m ago`;
522
- if (diffHours < 24) return `${diffHours}h ago`;
523
- if (diffDays === 1) return "yesterday";
524
- if (diffDays < 30) return `${diffDays}d ago`;
525
- return timestamp.toLocaleDateString();
550
+ constructor(simpleViewConfig, detailedViewConfig, maxInlineDepth, maxInlineLength) {
551
+ this.simpleViewConfig = simpleViewConfig;
552
+ this.detailedViewConfig = detailedViewConfig;
553
+ this.maxInlineDepth = maxInlineDepth;
554
+ this.maxInlineLength = maxInlineLength;
555
+ this.termWidth = process.stdout.columns || 80;
556
+ this.simpleView = new SimpleView({
557
+ viewMode: this.viewMode,
558
+ maxInlineDepth: this.maxInlineDepth,
559
+ maxInlineLength: this.maxInlineLength,
560
+ config: this.simpleViewConfig
561
+ });
562
+ this.detailView = null;
563
+ this.selectionView = null;
564
+ process.stdout.on("resize", () => {
565
+ this.termWidth = process.stdout.columns || 80;
566
+ this.simpleView.updateTerminalWidth(this.termWidth);
567
+ if (this.detailView) {
568
+ this.detailView.updateTerminalWidth(this.termWidth);
569
+ }
570
+ if (this.selectionView) {
571
+ this.selectionView.updateTerminalWidth(this.termWidth);
572
+ }
573
+ });
574
+ }
575
+ /**
576
+ * Renders a single log line in simple view format.
577
+ * Format: [timestamp] LEVEL [id] message data
578
+ * Condensed Format: [timestamp] LEVEL message
579
+ * Expanded Format: [timestamp] LEVEL [id] message full_data
580
+ *
581
+ * @param entry - Log entry to render
582
+ */
583
+ renderLogLine(entry) {
584
+ this.simpleView.renderLogLine(entry);
585
+ }
586
+ /**
587
+ * Renders the detailed view of a log entry.
588
+ * Shows full entry details with context and formatted data.
589
+ *
590
+ * @param entry - Log entry to show in detail
591
+ * @param prevEntry - Previous entry for context
592
+ * @param nextEntry - Next entry for context
593
+ * @param scrollPos - Current scroll position
594
+ * @param currentLogIndex - Current log index (optional)
595
+ * @param totalLogs - Total logs count (optional)
596
+ * @param filterText - Current filter text (if any)
597
+ */
598
+ renderDetailView(entry, prevEntry, nextEntry, scrollPos = 0, currentLogIndex, totalLogs, filterText = "") {
599
+ const config = {
600
+ entry,
601
+ prevEntry,
602
+ nextEntry,
603
+ scrollPos,
604
+ isArraysCollapsed: this.isArraysCollapsed,
605
+ isJsonView: this.isJsonView,
606
+ currentLogIndex: currentLogIndex ?? (prevEntry ? 2 : nextEntry ? 1 : 1),
607
+ // Use provided index or fallback
608
+ totalLogs: totalLogs ?? 1,
609
+ // Use provided total or fallback
610
+ filterText,
611
+ config: this.detailedViewConfig
612
+ };
613
+ if (!this.detailView) {
614
+ this.detailView = new DetailView(config);
615
+ } else {
616
+ this.detailView = new DetailView(config);
617
+ }
618
+ this.detailView.render();
619
+ }
620
+ /**
621
+ * Updates the scroll position in detailed view
622
+ * @param delta - Number of lines to scroll
623
+ */
624
+ scrollDetailView(delta) {
625
+ if (!this.detailView) return;
626
+ const maxScroll = this.detailView.getMaxScrollPosition();
627
+ this.detailViewScrollPos = Math.max(0, Math.min(maxScroll, this.detailViewScrollPos + delta));
628
+ }
629
+ /**
630
+ * Gets the current scroll position
631
+ */
632
+ getDetailViewScrollPos() {
633
+ return this.detailViewScrollPos;
634
+ }
635
+ /**
636
+ * Renders the selection view with a list of logs.
637
+ * Shows filtered logs with selection highlight and data preview.
638
+ *
639
+ * @param logs - Array of logs to display
640
+ * @param selectedIndex - Index of currently selected log
641
+ * @param filterText - Current filter text (if any)
642
+ * @param newLogCount - Number of new logs available
643
+ */
644
+ renderSelectionView(logs, selectedIndex, filterText, newLogCount) {
645
+ const config = {
646
+ logs,
647
+ selectedIndex,
648
+ filterText,
649
+ newLogCount,
650
+ config: this.detailedViewConfig
651
+ };
652
+ if (!this.selectionView) {
653
+ this.selectionView = new SelectionView(config);
654
+ } else {
655
+ this.selectionView = new SelectionView(config);
656
+ }
657
+ this.selectionView.render();
526
658
  }
527
- /** Whether we're showing raw JSON view */
528
- isJsonView = false;
529
659
  /**
530
660
  * Toggles JSON view state
531
661
  */
@@ -544,6 +674,35 @@ ${this.detailedViewConfig.separatorColor("TAB to return to detailed view")}`);
544
674
  toggleArrayCollapse() {
545
675
  this.isArraysCollapsed = !this.isArraysCollapsed;
546
676
  }
677
+ /**
678
+ * Cycles through view modes: full -> truncated -> condensed
679
+ */
680
+ cycleViewMode() {
681
+ switch (this.viewMode) {
682
+ case "full":
683
+ this.viewMode = "truncated";
684
+ break;
685
+ case "truncated":
686
+ this.viewMode = "condensed";
687
+ break;
688
+ case "condensed":
689
+ this.viewMode = "full";
690
+ break;
691
+ }
692
+ this.simpleView = new SimpleView({
693
+ viewMode: this.viewMode,
694
+ maxInlineDepth: this.maxInlineDepth,
695
+ maxInlineLength: this.maxInlineLength,
696
+ config: this.simpleViewConfig
697
+ });
698
+ return this.viewMode;
699
+ }
700
+ /**
701
+ * Gets current view mode
702
+ */
703
+ getViewMode() {
704
+ return this.viewMode;
705
+ }
547
706
  };
548
707
 
549
708
  // src/LogStorage.ts
@@ -636,6 +795,34 @@ var LogStorage = class {
636
795
  const pattern = `%${searchText}%`;
637
796
  return this.db.prepare(query).all(pattern, pattern, pattern);
638
797
  }
798
+ /**
799
+ * Gets the total number of logs in the database.
800
+ * Uses an efficient COUNT query instead of loading all logs.
801
+ *
802
+ * @returns Total number of log entries
803
+ */
804
+ getLogCount() {
805
+ const result = this.db.prepare("SELECT COUNT(*) as count FROM logs").get();
806
+ return result.count;
807
+ }
808
+ /**
809
+ * Gets the total number of logs matching a search query.
810
+ * Uses an efficient COUNT query instead of loading all logs.
811
+ *
812
+ * @param searchText - Text to search for
813
+ * @returns Number of matching log entries
814
+ */
815
+ getFilteredLogCount(searchText) {
816
+ const query = `
817
+ SELECT COUNT(*) as count FROM logs
818
+ WHERE id LIKE ?
819
+ OR message LIKE ?
820
+ OR data LIKE ?
821
+ `;
822
+ const pattern = `%${searchText}%`;
823
+ const result = this.db.prepare(query).get(pattern, pattern, pattern);
824
+ return result.count;
825
+ }
639
826
  /**
640
827
  * Closes the database connection and performs cleanup.
641
828
  * Should be called when the application exits or the transport is destroyed.
@@ -646,7 +833,7 @@ var LogStorage = class {
646
833
  };
647
834
 
648
835
  // src/UIManager.ts
649
- import chalk3 from "chalk";
836
+ import chalk5 from "chalk";
650
837
  import keypress from "keypress";
651
838
  var UIManager = class {
652
839
  /**
@@ -655,11 +842,15 @@ var UIManager = class {
655
842
  *
656
843
  * @param renderer - Instance for handling log display
657
844
  * @param storage - Instance for log persistence
845
+ * @param disableInteractiveMode - Whether to disable interactive mode
658
846
  */
659
- constructor(renderer, storage) {
847
+ constructor(renderer, storage, disableInteractiveMode = false) {
660
848
  this.renderer = renderer;
661
849
  this.storage = storage;
662
- this.setupKeyboardHandling();
850
+ this.isInteractiveDisabled = disableInteractiveMode;
851
+ if (!this.isInteractiveDisabled) {
852
+ this.setupKeyboardHandling();
853
+ }
663
854
  process.stdout.on("resize", () => {
664
855
  this.termWidth = process.stdout.columns || 80;
665
856
  if (this.isDetailView) {
@@ -678,6 +869,8 @@ var UIManager = class {
678
869
  isDetailView = false;
679
870
  /** Whether log streaming is paused */
680
871
  isPaused = false;
872
+ /** Whether interactive mode is disabled */
873
+ isInteractiveDisabled;
681
874
  /** Buffer for logs received while paused */
682
875
  pauseBuffer = [];
683
876
  /** Buffer for new logs in selection mode */
@@ -753,13 +946,22 @@ var UIManager = class {
753
946
  this.detailViewPollInterval = null;
754
947
  return;
755
948
  }
756
- const currentLogs = this.storage.getAllLogs();
757
- if (currentLogs.length > this.logs.length && this.selectedIndex === this.logs.length - 1) {
758
- this.logs = currentLogs;
949
+ const totalCount = this.filterText ? this.storage.getFilteredLogCount(this.filterText) : this.storage.getLogCount();
950
+ if (totalCount !== this.logs.length) {
951
+ const storedLogs = this.filterText ? this.storage.searchLogs(this.filterText) : this.storage.getAllLogs();
952
+ this.logs = storedLogs;
759
953
  const entry = this.logs[this.selectedIndex];
760
954
  const prevEntry = this.selectedIndex > 0 ? this.logs[this.selectedIndex - 1] : null;
761
955
  const nextEntry = this.selectedIndex < this.logs.length - 1 ? this.logs[this.selectedIndex + 1] : null;
762
- this.renderer.renderDetailView(entry, prevEntry, nextEntry, this.renderer.getDetailViewScrollPos());
956
+ this.renderer.renderDetailView(
957
+ entry,
958
+ prevEntry,
959
+ nextEntry,
960
+ this.renderer.getDetailViewScrollPos(),
961
+ this.selectedIndex + 1,
962
+ totalCount,
963
+ this.filterText
964
+ );
763
965
  }
764
966
  }, 2e3);
765
967
  }
@@ -770,18 +972,22 @@ var UIManager = class {
770
972
  * @private
771
973
  */
772
974
  updateFilteredLogs() {
773
- const storedLogs = this.filterText ? this.storage.searchLogs(this.filterText) : this.storage.getAllLogs();
774
- this.logs = storedLogs.slice(0, storedLogs.length - this.selectionBuffer.length);
775
- if (this.logs.length > 0) {
776
- this.selectedIndex = Math.min(this.selectedIndex, Math.max(0, this.logs.length - 1));
777
- } else {
778
- this.selectedIndex = 0;
975
+ const totalCount = this.filterText ? this.storage.getFilteredLogCount(this.filterText) : this.storage.getLogCount();
976
+ const effectiveCount = totalCount - this.selectionBuffer.length;
977
+ if (effectiveCount !== this.logs.length) {
978
+ const storedLogs = this.filterText ? this.storage.searchLogs(this.filterText) : this.storage.getAllLogs();
979
+ this.logs = storedLogs.slice(0, storedLogs.length - this.selectionBuffer.length);
980
+ if (this.logs.length > 0) {
981
+ this.selectedIndex = Math.min(this.selectedIndex, Math.max(0, this.logs.length - 1));
982
+ } else {
983
+ this.selectedIndex = 0;
984
+ }
779
985
  }
780
986
  }
781
987
  updateNewLogsNotification() {
782
988
  if (!this.isSelectionMode || !this.selectionBuffer.length) return;
783
989
  process.stdout.write(`\x1B[2A\r${" ".repeat(this.termWidth)}\r`);
784
- const notification = chalk3.dim(
990
+ const notification = chalk5.dim(
785
991
  `${this.selectionBuffer.length} new log${this.selectionBuffer.length === 1 ? "" : "s"} available (press \u2193 to view)`
786
992
  );
787
993
  process.stdout.write(`${notification}
@@ -796,6 +1002,10 @@ var UIManager = class {
796
1002
  */
797
1003
  handleNewLog(entry) {
798
1004
  this.storage.store(entry);
1005
+ if (this.isInteractiveDisabled) {
1006
+ this.renderer.renderLogLine(entry);
1007
+ return;
1008
+ }
799
1009
  if (this.isSelectionMode) {
800
1010
  this.selectionBuffer.push(entry);
801
1011
  this.renderer.renderSelectionView(this.logs, this.selectedIndex, this.filterText, this.selectionBuffer.length);
@@ -804,7 +1014,7 @@ var UIManager = class {
804
1014
  if (!this.isDetailView) {
805
1015
  if (this.isPaused) {
806
1016
  this.pauseBuffer.push(entry);
807
- process.stdout.write(`\r${chalk3.yellow(`\u23F8 Paused (${this.pauseBuffer.length} new logs)`)}${" ".repeat(20)}`);
1017
+ process.stdout.write(`\r${chalk5.yellow(`\u23F8 Paused (${this.pauseBuffer.length} new logs)`)}${" ".repeat(20)}`);
808
1018
  } else {
809
1019
  this.renderer.renderLogLine(entry);
810
1020
  }
@@ -845,24 +1055,39 @@ var UIManager = class {
845
1055
  }
846
1056
  this.pauseBuffer = [];
847
1057
  } else if (this.isPaused) {
848
- process.stdout.write(`\r${chalk3.yellow("\u23F8 Paused (0 new logs)")}${" ".repeat(20)}`);
1058
+ process.stdout.write(`\r${chalk5.yellow("\u23F8 Paused (0 new logs)")}${" ".repeat(20)}`);
849
1059
  }
850
1060
  return;
851
1061
  }
852
- if (!this.isSelectionMode && !this.isDetailView && key?.name === "tab") {
853
- if (this.isPaused) {
854
- this.isPaused = false;
855
- this.pauseBuffer = [];
856
- process.stdout.write(`\r${" ".repeat(50)}\r`);
857
- }
1062
+ if (!this.isSelectionMode && !this.isDetailView && (key?.name === "up" || key?.name === "down")) {
858
1063
  this.isSelectionMode = true;
859
1064
  this.filterText = "";
860
- this.updateFilteredLogs();
861
- this.selectedIndex = Math.max(0, this.logs.length - 1);
1065
+ this.isPaused = true;
1066
+ const storedLogs = this.storage.getAllLogs();
1067
+ this.logs = storedLogs;
1068
+ this.selectedIndex = key.name === "up" ? Math.max(0, this.logs.length - 1) : Math.max(0, this.logs.length - 1);
862
1069
  this.renderer.renderSelectionView(this.logs, this.selectedIndex, this.filterText, this.selectionBuffer.length);
863
1070
  this.startSelectionViewPolling();
864
1071
  return;
865
1072
  }
1073
+ if (!this.isSelectionMode && !this.isDetailView && ch === "c") {
1074
+ const newMode = this.renderer.cycleViewMode();
1075
+ console.clear();
1076
+ const logs = this.storage.getAllLogs();
1077
+ for (const entry of logs) {
1078
+ this.renderer.renderLogLine(entry);
1079
+ }
1080
+ const modeDescriptions = {
1081
+ full: "Full view enabled (all data shown without truncation)",
1082
+ truncated: "Truncated view enabled (timestamp, ID, level, message, truncated data)",
1083
+ condensed: "Condensed view enabled (timestamp, level and message only)"
1084
+ };
1085
+ process.stdout.write(`\r${chalk5.cyan(`\u2139 ${modeDescriptions[newMode]}`)}${" ".repeat(20)}`);
1086
+ setTimeout(() => {
1087
+ process.stdout.write(`\r${" ".repeat(100)}\r`);
1088
+ }, 3e3);
1089
+ return;
1090
+ }
866
1091
  if (this.isSelectionMode) {
867
1092
  if (key) {
868
1093
  switch (key.name) {
@@ -898,7 +1123,15 @@ var UIManager = class {
898
1123
  const selectedEntry = this.logs[this.selectedIndex];
899
1124
  const prevEntry = this.selectedIndex > 0 ? this.logs[this.selectedIndex - 1] : null;
900
1125
  const nextEntry = this.selectedIndex < this.logs.length - 1 ? this.logs[this.selectedIndex + 1] : null;
901
- this.renderer.renderDetailView(selectedEntry, prevEntry, nextEntry);
1126
+ this.renderer.renderDetailView(
1127
+ selectedEntry,
1128
+ prevEntry,
1129
+ nextEntry,
1130
+ 0,
1131
+ this.selectedIndex + 1,
1132
+ this.logs.length,
1133
+ this.filterText
1134
+ );
902
1135
  this.startDetailViewPolling();
903
1136
  }
904
1137
  return;
@@ -918,16 +1151,23 @@ var UIManager = class {
918
1151
  }
919
1152
  case "tab": {
920
1153
  this.isSelectionMode = false;
1154
+ this.isPaused = false;
921
1155
  if (this.selectionViewPollInterval) {
922
1156
  clearInterval(this.selectionViewPollInterval);
923
1157
  this.selectionViewPollInterval = null;
924
1158
  }
925
1159
  this.filterText = "";
926
1160
  console.clear();
927
- const logs = [...this.storage.getAllLogs()].reverse();
1161
+ const logs = this.storage.getAllLogs();
928
1162
  for (const entry of logs) {
929
1163
  this.renderer.renderLogLine(entry);
930
1164
  }
1165
+ if (this.selectionBuffer.length > 0) {
1166
+ for (const entry of this.selectionBuffer) {
1167
+ this.renderer.renderLogLine(entry);
1168
+ }
1169
+ this.selectionBuffer = [];
1170
+ }
931
1171
  return;
932
1172
  }
933
1173
  }
@@ -947,7 +1187,15 @@ var UIManager = class {
947
1187
  const entry = this.logs[this.selectedIndex];
948
1188
  const prevEntry = this.selectedIndex > 0 ? this.logs[this.selectedIndex - 1] : null;
949
1189
  const nextEntry = this.selectedIndex < this.logs.length - 1 ? this.logs[this.selectedIndex + 1] : null;
950
- this.renderer.renderDetailView(entry, prevEntry, nextEntry, this.renderer.getDetailViewScrollPos());
1190
+ this.renderer.renderDetailView(
1191
+ entry,
1192
+ prevEntry,
1193
+ nextEntry,
1194
+ this.renderer.getDetailViewScrollPos(),
1195
+ this.selectedIndex + 1,
1196
+ this.logs.length,
1197
+ this.filterText
1198
+ );
951
1199
  break;
952
1200
  }
953
1201
  case "down": {
@@ -955,7 +1203,15 @@ var UIManager = class {
955
1203
  const entry = this.logs[this.selectedIndex];
956
1204
  const prevEntry = this.selectedIndex > 0 ? this.logs[this.selectedIndex - 1] : null;
957
1205
  const nextEntry = this.selectedIndex < this.logs.length - 1 ? this.logs[this.selectedIndex + 1] : null;
958
- this.renderer.renderDetailView(entry, prevEntry, nextEntry, this.renderer.getDetailViewScrollPos());
1206
+ this.renderer.renderDetailView(
1207
+ entry,
1208
+ prevEntry,
1209
+ nextEntry,
1210
+ this.renderer.getDetailViewScrollPos(),
1211
+ this.selectedIndex + 1,
1212
+ this.logs.length,
1213
+ this.filterText
1214
+ );
959
1215
  break;
960
1216
  }
961
1217
  case "left": {
@@ -964,7 +1220,15 @@ var UIManager = class {
964
1220
  const entry = this.logs[this.selectedIndex];
965
1221
  const prevEntry = this.selectedIndex > 0 ? this.logs[this.selectedIndex - 1] : null;
966
1222
  const nextEntry = this.selectedIndex < this.logs.length - 1 ? this.logs[this.selectedIndex + 1] : null;
967
- this.renderer.renderDetailView(entry, prevEntry, nextEntry);
1223
+ this.renderer.renderDetailView(
1224
+ entry,
1225
+ prevEntry,
1226
+ nextEntry,
1227
+ 0,
1228
+ this.selectedIndex + 1,
1229
+ this.logs.length,
1230
+ this.filterText
1231
+ );
968
1232
  }
969
1233
  break;
970
1234
  }
@@ -974,7 +1238,15 @@ var UIManager = class {
974
1238
  const entry = this.logs[this.selectedIndex];
975
1239
  const prevEntry = this.selectedIndex > 0 ? this.logs[this.selectedIndex - 1] : null;
976
1240
  const nextEntry = this.selectedIndex < this.logs.length - 1 ? this.logs[this.selectedIndex + 1] : null;
977
- this.renderer.renderDetailView(entry, prevEntry, nextEntry);
1241
+ this.renderer.renderDetailView(
1242
+ entry,
1243
+ prevEntry,
1244
+ nextEntry,
1245
+ 0,
1246
+ this.selectedIndex + 1,
1247
+ this.logs.length,
1248
+ this.filterText
1249
+ );
978
1250
  }
979
1251
  break;
980
1252
  }
@@ -984,7 +1256,15 @@ var UIManager = class {
984
1256
  const entry = this.logs[this.selectedIndex];
985
1257
  const prevEntry = this.selectedIndex > 0 ? this.logs[this.selectedIndex - 1] : null;
986
1258
  const nextEntry = this.selectedIndex < this.logs.length - 1 ? this.logs[this.selectedIndex + 1] : null;
987
- this.renderer.renderDetailView(entry, prevEntry, nextEntry, this.renderer.getDetailViewScrollPos());
1259
+ this.renderer.renderDetailView(
1260
+ entry,
1261
+ prevEntry,
1262
+ nextEntry,
1263
+ this.renderer.getDetailViewScrollPos(),
1264
+ this.selectedIndex + 1,
1265
+ this.logs.length,
1266
+ this.filterText
1267
+ );
988
1268
  break;
989
1269
  }
990
1270
  this.isDetailView = false;
@@ -1011,7 +1291,14 @@ var UIManager = class {
1011
1291
  const entry = this.logs[this.selectedIndex];
1012
1292
  const prevEntry = this.selectedIndex > 0 ? this.logs[this.selectedIndex - 1] : null;
1013
1293
  const nextEntry = this.selectedIndex < this.logs.length - 1 ? this.logs[this.selectedIndex + 1] : null;
1014
- this.renderer.renderDetailView(entry, prevEntry, nextEntry, this.renderer.getDetailViewScrollPos());
1294
+ this.renderer.renderDetailView(
1295
+ entry,
1296
+ prevEntry,
1297
+ nextEntry,
1298
+ this.renderer.getDetailViewScrollPos(),
1299
+ this.selectedIndex + 1,
1300
+ this.logs.length
1301
+ );
1015
1302
  break;
1016
1303
  }
1017
1304
  case "q": {
@@ -1019,7 +1306,14 @@ var UIManager = class {
1019
1306
  const entry = this.logs[this.selectedIndex];
1020
1307
  const prevEntry = this.selectedIndex > 0 ? this.logs[this.selectedIndex - 1] : null;
1021
1308
  const nextEntry = this.selectedIndex < this.logs.length - 1 ? this.logs[this.selectedIndex + 1] : null;
1022
- this.renderer.renderDetailView(entry, prevEntry, nextEntry, this.renderer.getDetailViewScrollPos());
1309
+ this.renderer.renderDetailView(
1310
+ entry,
1311
+ prevEntry,
1312
+ nextEntry,
1313
+ this.renderer.getDetailViewScrollPos(),
1314
+ this.selectedIndex + 1,
1315
+ this.logs.length
1316
+ );
1023
1317
  break;
1024
1318
  }
1025
1319
  case "a": {
@@ -1028,7 +1322,7 @@ var UIManager = class {
1028
1322
  const entry = this.logs[this.selectedIndex];
1029
1323
  const prevEntry = null;
1030
1324
  const nextEntry = this.logs.length > 1 ? this.logs[1] : null;
1031
- this.renderer.renderDetailView(entry, prevEntry, nextEntry);
1325
+ this.renderer.renderDetailView(entry, prevEntry, nextEntry, 0, 1, this.logs.length);
1032
1326
  }
1033
1327
  break;
1034
1328
  }
@@ -1039,7 +1333,7 @@ var UIManager = class {
1039
1333
  const entry = this.logs[this.selectedIndex];
1040
1334
  const prevEntry = lastIndex > 0 ? this.logs[lastIndex - 1] : null;
1041
1335
  const nextEntry = null;
1042
- this.renderer.renderDetailView(entry, prevEntry, nextEntry);
1336
+ this.renderer.renderDetailView(entry, prevEntry, nextEntry, 0, this.logs.length, this.logs.length);
1043
1337
  }
1044
1338
  break;
1045
1339
  }
@@ -1048,7 +1342,14 @@ var UIManager = class {
1048
1342
  const entry = this.logs[this.selectedIndex];
1049
1343
  const prevEntry = this.selectedIndex > 0 ? this.logs[this.selectedIndex - 1] : null;
1050
1344
  const nextEntry = this.selectedIndex < this.logs.length - 1 ? this.logs[this.selectedIndex + 1] : null;
1051
- this.renderer.renderDetailView(entry, prevEntry, nextEntry, this.renderer.getDetailViewScrollPos());
1345
+ this.renderer.renderDetailView(
1346
+ entry,
1347
+ prevEntry,
1348
+ nextEntry,
1349
+ this.renderer.getDetailViewScrollPos(),
1350
+ this.selectedIndex + 1,
1351
+ this.logs.length
1352
+ );
1052
1353
  break;
1053
1354
  }
1054
1355
  case "j": {
@@ -1056,7 +1357,7 @@ var UIManager = class {
1056
1357
  const entry = this.logs[this.selectedIndex];
1057
1358
  const prevEntry = this.selectedIndex > 0 ? this.logs[this.selectedIndex - 1] : null;
1058
1359
  const nextEntry = this.selectedIndex < this.logs.length - 1 ? this.logs[this.selectedIndex + 1] : null;
1059
- this.renderer.renderDetailView(entry, prevEntry, nextEntry);
1360
+ this.renderer.renderDetailView(entry, prevEntry, nextEntry, 0, this.selectedIndex + 1, this.logs.length);
1060
1361
  break;
1061
1362
  }
1062
1363
  }
@@ -1066,287 +1367,287 @@ var UIManager = class {
1066
1367
  };
1067
1368
 
1068
1369
  // src/themes.ts
1069
- import chalk4 from "chalk";
1370
+ import chalk6 from "chalk";
1070
1371
  var moonlight = {
1071
1372
  simpleView: {
1072
1373
  colors: {
1073
- trace: chalk4.rgb(114, 135, 153),
1374
+ trace: chalk6.rgb(114, 135, 153),
1074
1375
  // Muted blue-grey for less important info
1075
- debug: chalk4.rgb(130, 170, 255),
1376
+ debug: chalk6.rgb(130, 170, 255),
1076
1377
  // Soft blue that pops but doesn't strain
1077
- info: chalk4.rgb(195, 232, 141),
1378
+ info: chalk6.rgb(195, 232, 141),
1078
1379
  // Sage green for good readability
1079
- warn: chalk4.rgb(255, 203, 107),
1380
+ warn: chalk6.rgb(255, 203, 107),
1080
1381
  // Warm yellow, less harsh than pure yellow
1081
- error: chalk4.rgb(247, 118, 142),
1382
+ error: chalk6.rgb(247, 118, 142),
1082
1383
  // Soft red that stands out without being aggressive
1083
- fatal: chalk4.bgRgb(247, 118, 142).white
1384
+ fatal: chalk6.bgRgb(247, 118, 142).white
1084
1385
  // Inverted soft red for maximum visibility
1085
1386
  },
1086
- logIdColor: chalk4.rgb(84, 98, 117),
1387
+ logIdColor: chalk6.rgb(84, 98, 117),
1087
1388
  // Darker blue-grey for secondary information
1088
- dataValueColor: chalk4.rgb(209, 219, 231),
1389
+ dataValueColor: chalk6.rgb(209, 219, 231),
1089
1390
  // Light grey-blue for primary content
1090
- dataKeyColor: chalk4.rgb(130, 170, 255),
1391
+ dataKeyColor: chalk6.rgb(130, 170, 255),
1091
1392
  // Matching debug blue for consistency
1092
- selectorColor: chalk4.rgb(137, 221, 255)
1393
+ selectorColor: chalk6.rgb(137, 221, 255)
1093
1394
  // Ice blue for selection indicators
1094
1395
  },
1095
1396
  detailedView: {
1096
1397
  colors: {
1097
- trace: chalk4.rgb(114, 135, 153),
1098
- debug: chalk4.rgb(130, 170, 255),
1099
- info: chalk4.rgb(195, 232, 141),
1100
- warn: chalk4.rgb(255, 203, 107),
1101
- error: chalk4.rgb(247, 118, 142),
1102
- fatal: chalk4.bgRgb(247, 118, 142).white
1398
+ trace: chalk6.rgb(114, 135, 153),
1399
+ debug: chalk6.rgb(130, 170, 255),
1400
+ info: chalk6.rgb(195, 232, 141),
1401
+ warn: chalk6.rgb(255, 203, 107),
1402
+ error: chalk6.rgb(247, 118, 142),
1403
+ fatal: chalk6.bgRgb(247, 118, 142).white
1103
1404
  },
1104
- logIdColor: chalk4.rgb(84, 98, 117),
1105
- dataValueColor: chalk4.rgb(209, 219, 231),
1106
- dataKeyColor: chalk4.rgb(130, 170, 255),
1107
- selectorColor: chalk4.rgb(137, 221, 255),
1405
+ logIdColor: chalk6.rgb(84, 98, 117),
1406
+ dataValueColor: chalk6.rgb(209, 219, 231),
1407
+ dataKeyColor: chalk6.rgb(130, 170, 255),
1408
+ selectorColor: chalk6.rgb(137, 221, 255),
1108
1409
  // Ice blue for selection indicators
1109
- headerColor: chalk4.rgb(137, 221, 255),
1110
- labelColor: chalk4.rgb(137, 221, 255).bold,
1111
- separatorColor: chalk4.rgb(84, 98, 117),
1410
+ headerColor: chalk6.rgb(137, 221, 255),
1411
+ labelColor: chalk6.rgb(137, 221, 255).bold,
1412
+ separatorColor: chalk6.rgb(84, 98, 117),
1112
1413
  jsonColors: {
1113
- keysColor: chalk4.rgb(130, 170, 255),
1114
- dashColor: chalk4.rgb(209, 219, 231),
1115
- numberColor: chalk4.rgb(247, 140, 108),
1116
- stringColor: chalk4.rgb(195, 232, 141),
1117
- multilineStringColor: chalk4.rgb(195, 232, 141),
1118
- positiveNumberColor: chalk4.rgb(195, 232, 141),
1119
- negativeNumberColor: chalk4.rgb(247, 118, 142),
1120
- booleanColor: chalk4.rgb(255, 203, 107),
1121
- nullUndefinedColor: chalk4.rgb(114, 135, 153),
1122
- dateColor: chalk4.rgb(199, 146, 234)
1414
+ keysColor: chalk6.rgb(130, 170, 255),
1415
+ dashColor: chalk6.rgb(209, 219, 231),
1416
+ numberColor: chalk6.rgb(247, 140, 108),
1417
+ stringColor: chalk6.rgb(195, 232, 141),
1418
+ multilineStringColor: chalk6.rgb(195, 232, 141),
1419
+ positiveNumberColor: chalk6.rgb(195, 232, 141),
1420
+ negativeNumberColor: chalk6.rgb(247, 118, 142),
1421
+ booleanColor: chalk6.rgb(255, 203, 107),
1422
+ nullUndefinedColor: chalk6.rgb(114, 135, 153),
1423
+ dateColor: chalk6.rgb(199, 146, 234)
1123
1424
  }
1124
1425
  }
1125
1426
  };
1126
1427
  var sunlight = {
1127
1428
  simpleView: {
1128
1429
  colors: {
1129
- trace: chalk4.rgb(110, 110, 110),
1430
+ trace: chalk6.rgb(110, 110, 110),
1130
1431
  // Dark grey for subtle information
1131
- debug: chalk4.rgb(32, 96, 159),
1432
+ debug: chalk6.rgb(32, 96, 159),
1132
1433
  // Deep blue for strong contrast on white
1133
- info: chalk4.rgb(35, 134, 54),
1434
+ info: chalk6.rgb(35, 134, 54),
1134
1435
  // Forest green, easier on the eyes than bright green
1135
- warn: chalk4.rgb(176, 95, 0),
1436
+ warn: chalk6.rgb(176, 95, 0),
1136
1437
  // Brown-orange for natural warning color
1137
- error: chalk4.rgb(191, 0, 0),
1438
+ error: chalk6.rgb(191, 0, 0),
1138
1439
  // Deep red for clear visibility on light backgrounds
1139
- fatal: chalk4.bgRgb(191, 0, 0).white
1440
+ fatal: chalk6.bgRgb(191, 0, 0).white
1140
1441
  // White on deep red for critical issues
1141
1442
  },
1142
- logIdColor: chalk4.rgb(110, 110, 110),
1143
- dataValueColor: chalk4.rgb(0, 0, 0),
1144
- dataKeyColor: chalk4.rgb(32, 96, 159),
1145
- selectorColor: chalk4.rgb(0, 91, 129)
1443
+ logIdColor: chalk6.rgb(110, 110, 110),
1444
+ dataValueColor: chalk6.rgb(0, 0, 0),
1445
+ dataKeyColor: chalk6.rgb(32, 96, 159),
1446
+ selectorColor: chalk6.rgb(0, 91, 129)
1146
1447
  // Deep blue for strong contrast
1147
1448
  },
1148
1449
  detailedView: {
1149
1450
  colors: {
1150
- trace: chalk4.rgb(110, 110, 110),
1151
- debug: chalk4.rgb(32, 96, 159),
1152
- info: chalk4.rgb(35, 134, 54),
1153
- warn: chalk4.rgb(176, 95, 0),
1154
- error: chalk4.rgb(191, 0, 0),
1155
- fatal: chalk4.bgRgb(191, 0, 0).white
1451
+ trace: chalk6.rgb(110, 110, 110),
1452
+ debug: chalk6.rgb(32, 96, 159),
1453
+ info: chalk6.rgb(35, 134, 54),
1454
+ warn: chalk6.rgb(176, 95, 0),
1455
+ error: chalk6.rgb(191, 0, 0),
1456
+ fatal: chalk6.bgRgb(191, 0, 0).white
1156
1457
  },
1157
- logIdColor: chalk4.rgb(110, 110, 110),
1158
- dataValueColor: chalk4.rgb(0, 0, 0),
1159
- dataKeyColor: chalk4.rgb(32, 96, 159),
1160
- selectorColor: chalk4.rgb(0, 91, 129),
1458
+ logIdColor: chalk6.rgb(110, 110, 110),
1459
+ dataValueColor: chalk6.rgb(0, 0, 0),
1460
+ dataKeyColor: chalk6.rgb(32, 96, 159),
1461
+ selectorColor: chalk6.rgb(0, 91, 129),
1161
1462
  // Deep blue for strong contrast
1162
- headerColor: chalk4.rgb(0, 91, 129),
1163
- labelColor: chalk4.rgb(0, 91, 129).bold,
1164
- separatorColor: chalk4.rgb(110, 110, 110),
1463
+ headerColor: chalk6.rgb(0, 91, 129),
1464
+ labelColor: chalk6.rgb(0, 91, 129).bold,
1465
+ separatorColor: chalk6.rgb(110, 110, 110),
1165
1466
  jsonColors: {
1166
- keysColor: chalk4.rgb(32, 96, 159),
1167
- dashColor: chalk4.rgb(0, 0, 0),
1168
- numberColor: chalk4.rgb(170, 55, 49),
1169
- stringColor: chalk4.rgb(35, 134, 54),
1170
- multilineStringColor: chalk4.rgb(35, 134, 54),
1171
- positiveNumberColor: chalk4.rgb(46, 125, 50),
1172
- negativeNumberColor: chalk4.rgb(183, 28, 28),
1173
- booleanColor: chalk4.rgb(176, 95, 0),
1174
- nullUndefinedColor: chalk4.rgb(110, 110, 110),
1175
- dateColor: chalk4.rgb(123, 31, 162)
1467
+ keysColor: chalk6.rgb(32, 96, 159),
1468
+ dashColor: chalk6.rgb(0, 0, 0),
1469
+ numberColor: chalk6.rgb(170, 55, 49),
1470
+ stringColor: chalk6.rgb(35, 134, 54),
1471
+ multilineStringColor: chalk6.rgb(35, 134, 54),
1472
+ positiveNumberColor: chalk6.rgb(46, 125, 50),
1473
+ negativeNumberColor: chalk6.rgb(183, 28, 28),
1474
+ booleanColor: chalk6.rgb(176, 95, 0),
1475
+ nullUndefinedColor: chalk6.rgb(110, 110, 110),
1476
+ dateColor: chalk6.rgb(123, 31, 162)
1176
1477
  }
1177
1478
  }
1178
1479
  };
1179
1480
  var neon = {
1180
1481
  simpleView: {
1181
1482
  colors: {
1182
- trace: chalk4.rgb(108, 108, 255),
1483
+ trace: chalk6.rgb(108, 108, 255),
1183
1484
  // Electric blue
1184
- debug: chalk4.rgb(255, 82, 246),
1485
+ debug: chalk6.rgb(255, 82, 246),
1185
1486
  // Hot pink
1186
- info: chalk4.rgb(0, 255, 163),
1487
+ info: chalk6.rgb(0, 255, 163),
1187
1488
  // Cyber green
1188
- warn: chalk4.rgb(255, 231, 46),
1489
+ warn: chalk6.rgb(255, 231, 46),
1189
1490
  // Electric yellow
1190
- error: chalk4.rgb(255, 53, 91),
1491
+ error: chalk6.rgb(255, 53, 91),
1191
1492
  // Neon red
1192
- fatal: chalk4.bgRgb(255, 53, 91).rgb(0, 255, 163)
1493
+ fatal: chalk6.bgRgb(255, 53, 91).rgb(0, 255, 163)
1193
1494
  // Neon red bg with cyber green text
1194
1495
  },
1195
- logIdColor: chalk4.rgb(187, 134, 252),
1496
+ logIdColor: chalk6.rgb(187, 134, 252),
1196
1497
  // Bright purple
1197
- dataValueColor: chalk4.rgb(255, 255, 255),
1498
+ dataValueColor: chalk6.rgb(255, 255, 255),
1198
1499
  // Pure white
1199
- dataKeyColor: chalk4.rgb(0, 255, 240),
1500
+ dataKeyColor: chalk6.rgb(0, 255, 240),
1200
1501
  // Cyan
1201
- selectorColor: chalk4.rgb(0, 255, 240)
1502
+ selectorColor: chalk6.rgb(0, 255, 240)
1202
1503
  // Electric cyan for cyberpunk feel
1203
1504
  },
1204
1505
  detailedView: {
1205
1506
  colors: {
1206
- trace: chalk4.rgb(108, 108, 255),
1207
- debug: chalk4.rgb(255, 82, 246),
1208
- info: chalk4.rgb(0, 255, 163),
1209
- warn: chalk4.rgb(255, 231, 46),
1210
- error: chalk4.rgb(255, 53, 91),
1211
- fatal: chalk4.bgRgb(255, 53, 91).rgb(0, 255, 163)
1507
+ trace: chalk6.rgb(108, 108, 255),
1508
+ debug: chalk6.rgb(255, 82, 246),
1509
+ info: chalk6.rgb(0, 255, 163),
1510
+ warn: chalk6.rgb(255, 231, 46),
1511
+ error: chalk6.rgb(255, 53, 91),
1512
+ fatal: chalk6.bgRgb(255, 53, 91).rgb(0, 255, 163)
1212
1513
  },
1213
- logIdColor: chalk4.rgb(187, 134, 252),
1214
- dataValueColor: chalk4.rgb(255, 255, 255),
1215
- dataKeyColor: chalk4.rgb(0, 255, 240),
1216
- selectorColor: chalk4.rgb(0, 255, 240),
1514
+ logIdColor: chalk6.rgb(187, 134, 252),
1515
+ dataValueColor: chalk6.rgb(255, 255, 255),
1516
+ dataKeyColor: chalk6.rgb(0, 255, 240),
1517
+ selectorColor: chalk6.rgb(0, 255, 240),
1217
1518
  // Electric cyan for cyberpunk feel
1218
- headerColor: chalk4.rgb(255, 82, 246),
1219
- labelColor: chalk4.rgb(255, 82, 246).bold,
1220
- separatorColor: chalk4.rgb(108, 108, 255),
1519
+ headerColor: chalk6.rgb(255, 82, 246),
1520
+ labelColor: chalk6.rgb(255, 82, 246).bold,
1521
+ separatorColor: chalk6.rgb(108, 108, 255),
1221
1522
  jsonColors: {
1222
- keysColor: chalk4.rgb(0, 255, 240),
1223
- dashColor: chalk4.rgb(255, 255, 255),
1224
- numberColor: chalk4.rgb(255, 82, 246),
1225
- stringColor: chalk4.rgb(0, 255, 163),
1226
- multilineStringColor: chalk4.rgb(0, 255, 163),
1227
- positiveNumberColor: chalk4.rgb(0, 255, 163),
1228
- negativeNumberColor: chalk4.rgb(255, 53, 91),
1229
- booleanColor: chalk4.rgb(255, 231, 46),
1230
- nullUndefinedColor: chalk4.rgb(108, 108, 255),
1231
- dateColor: chalk4.rgb(187, 134, 252)
1523
+ keysColor: chalk6.rgb(0, 255, 240),
1524
+ dashColor: chalk6.rgb(255, 255, 255),
1525
+ numberColor: chalk6.rgb(255, 82, 246),
1526
+ stringColor: chalk6.rgb(0, 255, 163),
1527
+ multilineStringColor: chalk6.rgb(0, 255, 163),
1528
+ positiveNumberColor: chalk6.rgb(0, 255, 163),
1529
+ negativeNumberColor: chalk6.rgb(255, 53, 91),
1530
+ booleanColor: chalk6.rgb(255, 231, 46),
1531
+ nullUndefinedColor: chalk6.rgb(108, 108, 255),
1532
+ dateColor: chalk6.rgb(187, 134, 252)
1232
1533
  }
1233
1534
  }
1234
1535
  };
1235
1536
  var nature = {
1236
1537
  simpleView: {
1237
1538
  colors: {
1238
- trace: chalk4.rgb(121, 85, 72),
1539
+ trace: chalk6.rgb(121, 85, 72),
1239
1540
  // Wooden brown
1240
- debug: chalk4.rgb(46, 125, 50),
1541
+ debug: chalk6.rgb(46, 125, 50),
1241
1542
  // Forest green
1242
- info: chalk4.rgb(0, 105, 92),
1543
+ info: chalk6.rgb(0, 105, 92),
1243
1544
  // Deep teal
1244
- warn: chalk4.rgb(175, 115, 0),
1545
+ warn: chalk6.rgb(175, 115, 0),
1245
1546
  // Golden amber
1246
- error: chalk4.rgb(183, 28, 28),
1547
+ error: chalk6.rgb(183, 28, 28),
1247
1548
  // Autumn red
1248
- fatal: chalk4.bgRgb(183, 28, 28).rgb(255, 250, 240)
1549
+ fatal: chalk6.bgRgb(183, 28, 28).rgb(255, 250, 240)
1249
1550
  // Red bg with soft white
1250
1551
  },
1251
- logIdColor: chalk4.rgb(93, 64, 55),
1552
+ logIdColor: chalk6.rgb(93, 64, 55),
1252
1553
  // Deep bark brown
1253
- dataValueColor: chalk4.rgb(27, 27, 27),
1554
+ dataValueColor: chalk6.rgb(27, 27, 27),
1254
1555
  // Near black
1255
- dataKeyColor: chalk4.rgb(56, 142, 60),
1556
+ dataKeyColor: chalk6.rgb(56, 142, 60),
1256
1557
  // Leaf green
1257
- selectorColor: chalk4.rgb(0, 105, 92)
1558
+ selectorColor: chalk6.rgb(0, 105, 92)
1258
1559
  // Deep teal for natural feel
1259
1560
  },
1260
1561
  detailedView: {
1261
1562
  colors: {
1262
- trace: chalk4.rgb(121, 85, 72),
1263
- debug: chalk4.rgb(46, 125, 50),
1264
- info: chalk4.rgb(0, 105, 92),
1265
- warn: chalk4.rgb(175, 115, 0),
1266
- error: chalk4.rgb(183, 28, 28),
1267
- fatal: chalk4.bgRgb(183, 28, 28).rgb(255, 250, 240)
1563
+ trace: chalk6.rgb(121, 85, 72),
1564
+ debug: chalk6.rgb(46, 125, 50),
1565
+ info: chalk6.rgb(0, 105, 92),
1566
+ warn: chalk6.rgb(175, 115, 0),
1567
+ error: chalk6.rgb(183, 28, 28),
1568
+ fatal: chalk6.bgRgb(183, 28, 28).rgb(255, 250, 240)
1268
1569
  },
1269
- logIdColor: chalk4.rgb(93, 64, 55),
1270
- dataValueColor: chalk4.rgb(27, 27, 27),
1271
- dataKeyColor: chalk4.rgb(56, 142, 60),
1272
- selectorColor: chalk4.rgb(0, 105, 92),
1570
+ logIdColor: chalk6.rgb(93, 64, 55),
1571
+ dataValueColor: chalk6.rgb(27, 27, 27),
1572
+ dataKeyColor: chalk6.rgb(56, 142, 60),
1573
+ selectorColor: chalk6.rgb(0, 105, 92),
1273
1574
  // Deep teal for natural feel
1274
- headerColor: chalk4.rgb(0, 77, 64),
1275
- labelColor: chalk4.rgb(0, 77, 64).bold,
1276
- separatorColor: chalk4.rgb(121, 85, 72),
1575
+ headerColor: chalk6.rgb(0, 77, 64),
1576
+ labelColor: chalk6.rgb(0, 77, 64).bold,
1577
+ separatorColor: chalk6.rgb(121, 85, 72),
1277
1578
  jsonColors: {
1278
- keysColor: chalk4.rgb(56, 142, 60),
1279
- dashColor: chalk4.rgb(27, 27, 27),
1280
- numberColor: chalk4.rgb(230, 81, 0),
1281
- stringColor: chalk4.rgb(0, 105, 92),
1282
- multilineStringColor: chalk4.rgb(0, 105, 92),
1283
- positiveNumberColor: chalk4.rgb(46, 125, 50),
1284
- negativeNumberColor: chalk4.rgb(183, 28, 28),
1285
- booleanColor: chalk4.rgb(175, 115, 0),
1286
- nullUndefinedColor: chalk4.rgb(121, 85, 72),
1287
- dateColor: chalk4.rgb(123, 31, 162)
1579
+ keysColor: chalk6.rgb(56, 142, 60),
1580
+ dashColor: chalk6.rgb(27, 27, 27),
1581
+ numberColor: chalk6.rgb(230, 81, 0),
1582
+ stringColor: chalk6.rgb(0, 105, 92),
1583
+ multilineStringColor: chalk6.rgb(0, 105, 92),
1584
+ positiveNumberColor: chalk6.rgb(46, 125, 50),
1585
+ negativeNumberColor: chalk6.rgb(183, 28, 28),
1586
+ booleanColor: chalk6.rgb(175, 115, 0),
1587
+ nullUndefinedColor: chalk6.rgb(121, 85, 72),
1588
+ dateColor: chalk6.rgb(123, 31, 162)
1288
1589
  }
1289
1590
  }
1290
1591
  };
1291
1592
  var pastel = {
1292
1593
  simpleView: {
1293
1594
  colors: {
1294
- trace: chalk4.rgb(179, 189, 203),
1595
+ trace: chalk6.rgb(179, 189, 203),
1295
1596
  // Soft slate blue
1296
- debug: chalk4.rgb(189, 178, 255),
1597
+ debug: chalk6.rgb(189, 178, 255),
1297
1598
  // Gentle lavender
1298
- info: chalk4.rgb(170, 236, 205),
1599
+ info: chalk6.rgb(170, 236, 205),
1299
1600
  // Mint green
1300
- warn: chalk4.rgb(255, 223, 186),
1601
+ warn: chalk6.rgb(255, 223, 186),
1301
1602
  // Peach
1302
- error: chalk4.rgb(255, 188, 188),
1603
+ error: chalk6.rgb(255, 188, 188),
1303
1604
  // Soft coral
1304
- fatal: chalk4.bgRgb(255, 188, 188).rgb(76, 40, 40)
1605
+ fatal: chalk6.bgRgb(255, 188, 188).rgb(76, 40, 40)
1305
1606
  // Coral bg with deep brown
1306
1607
  },
1307
- logIdColor: chalk4.rgb(203, 195, 227),
1608
+ logIdColor: chalk6.rgb(203, 195, 227),
1308
1609
  // Dusty lavender
1309
- dataValueColor: chalk4.rgb(236, 236, 236),
1610
+ dataValueColor: chalk6.rgb(236, 236, 236),
1310
1611
  // Soft white
1311
- dataKeyColor: chalk4.rgb(186, 207, 255),
1612
+ dataKeyColor: chalk6.rgb(186, 207, 255),
1312
1613
  // Baby blue
1313
- selectorColor: chalk4.rgb(189, 178, 255)
1614
+ selectorColor: chalk6.rgb(189, 178, 255)
1314
1615
  // Soft lavender for gentle highlighting
1315
1616
  },
1316
1617
  detailedView: {
1317
1618
  colors: {
1318
- trace: chalk4.rgb(179, 189, 203),
1319
- debug: chalk4.rgb(189, 178, 255),
1320
- info: chalk4.rgb(170, 236, 205),
1321
- warn: chalk4.rgb(255, 223, 186),
1322
- error: chalk4.rgb(255, 188, 188),
1323
- fatal: chalk4.bgRgb(255, 188, 188).rgb(76, 40, 40)
1619
+ trace: chalk6.rgb(179, 189, 203),
1620
+ debug: chalk6.rgb(189, 178, 255),
1621
+ info: chalk6.rgb(170, 236, 205),
1622
+ warn: chalk6.rgb(255, 223, 186),
1623
+ error: chalk6.rgb(255, 188, 188),
1624
+ fatal: chalk6.bgRgb(255, 188, 188).rgb(76, 40, 40)
1324
1625
  },
1325
- logIdColor: chalk4.rgb(203, 195, 227),
1326
- dataValueColor: chalk4.rgb(236, 236, 236),
1327
- dataKeyColor: chalk4.rgb(186, 207, 255),
1328
- selectorColor: chalk4.rgb(189, 178, 255),
1626
+ logIdColor: chalk6.rgb(203, 195, 227),
1627
+ dataValueColor: chalk6.rgb(236, 236, 236),
1628
+ dataKeyColor: chalk6.rgb(186, 207, 255),
1629
+ selectorColor: chalk6.rgb(189, 178, 255),
1329
1630
  // Soft lavender for gentle highlighting
1330
- headerColor: chalk4.rgb(255, 198, 255),
1631
+ headerColor: chalk6.rgb(255, 198, 255),
1331
1632
  // Cotton candy pink
1332
- labelColor: chalk4.rgb(255, 198, 255).bold,
1333
- separatorColor: chalk4.rgb(179, 189, 203),
1633
+ labelColor: chalk6.rgb(255, 198, 255).bold,
1634
+ separatorColor: chalk6.rgb(179, 189, 203),
1334
1635
  jsonColors: {
1335
- keysColor: chalk4.rgb(186, 207, 255),
1636
+ keysColor: chalk6.rgb(186, 207, 255),
1336
1637
  // Baby blue
1337
- dashColor: chalk4.rgb(236, 236, 236),
1638
+ dashColor: chalk6.rgb(236, 236, 236),
1338
1639
  // Soft white
1339
- numberColor: chalk4.rgb(255, 198, 255),
1640
+ numberColor: chalk6.rgb(255, 198, 255),
1340
1641
  // Cotton candy pink
1341
- stringColor: chalk4.rgb(170, 236, 205),
1642
+ stringColor: chalk6.rgb(170, 236, 205),
1342
1643
  // Mint green
1343
- multilineStringColor: chalk4.rgb(170, 236, 205),
1344
- positiveNumberColor: chalk4.rgb(170, 236, 205),
1345
- negativeNumberColor: chalk4.rgb(255, 188, 188),
1346
- booleanColor: chalk4.rgb(255, 223, 186),
1644
+ multilineStringColor: chalk6.rgb(170, 236, 205),
1645
+ positiveNumberColor: chalk6.rgb(170, 236, 205),
1646
+ negativeNumberColor: chalk6.rgb(255, 188, 188),
1647
+ booleanColor: chalk6.rgb(255, 223, 186),
1347
1648
  // Peach
1348
- nullUndefinedColor: chalk4.rgb(179, 189, 203),
1349
- dateColor: chalk4.rgb(189, 178, 255)
1649
+ nullUndefinedColor: chalk6.rgb(179, 189, 203),
1650
+ dateColor: chalk6.rgb(189, 178, 255)
1350
1651
  // Gentle lavender
1351
1652
  }
1352
1653
  }
@@ -1387,70 +1688,70 @@ var PrettyTerminalTransport = class _PrettyTerminalTransport extends LoggerlessT
1387
1688
  const logFile = config.logFile;
1388
1689
  const simpleViewConfig = {
1389
1690
  colors: {
1390
- trace: chalk5.gray,
1691
+ trace: chalk7.gray,
1391
1692
  // Lowest level, used for verbose output
1392
- debug: chalk5.blue,
1693
+ debug: chalk7.blue,
1393
1694
  // Debug information
1394
- info: chalk5.green,
1695
+ info: chalk7.green,
1395
1696
  // Normal operation
1396
- warn: chalk5.yellow,
1697
+ warn: chalk7.yellow,
1397
1698
  // Warning conditions
1398
- error: chalk5.red,
1699
+ error: chalk7.red,
1399
1700
  // Error conditions
1400
- fatal: chalk5.bgRed.white,
1701
+ fatal: chalk7.bgRed.white,
1401
1702
  // Critical errors
1402
1703
  ...theme.simpleView.colors
1403
1704
  },
1404
- logIdColor: theme.simpleView.logIdColor || chalk5.dim,
1405
- dataValueColor: theme.simpleView.dataValueColor || chalk5.white,
1406
- dataKeyColor: theme.simpleView.dataKeyColor || chalk5.dim,
1407
- selectorColor: theme.simpleView.selectorColor || chalk5.cyan
1705
+ logIdColor: theme.simpleView.logIdColor || chalk7.dim,
1706
+ dataValueColor: theme.simpleView.dataValueColor || chalk7.white,
1707
+ dataKeyColor: theme.simpleView.dataKeyColor || chalk7.dim,
1708
+ selectorColor: theme.simpleView.selectorColor || chalk7.cyan
1408
1709
  };
1409
1710
  const detailedViewConfig = {
1410
1711
  colors: {
1411
- trace: chalk5.gray,
1412
- debug: chalk5.blue,
1413
- info: chalk5.green,
1414
- warn: chalk5.yellow,
1415
- error: chalk5.red,
1416
- fatal: chalk5.bgRed.white,
1712
+ trace: chalk7.gray,
1713
+ debug: chalk7.blue,
1714
+ info: chalk7.green,
1715
+ warn: chalk7.yellow,
1716
+ error: chalk7.red,
1717
+ fatal: chalk7.bgRed.white,
1417
1718
  ...theme.detailedView?.colors
1418
1719
  },
1419
- logIdColor: theme.detailedView?.logIdColor || chalk5.dim,
1420
- dataValueColor: theme.detailedView?.dataValueColor || chalk5.white,
1421
- dataKeyColor: theme.detailedView?.dataKeyColor || chalk5.dim,
1422
- selectorColor: theme.detailedView?.selectorColor || chalk5.cyan,
1423
- headerColor: theme.detailedView?.headerColor || chalk5.cyan,
1424
- labelColor: theme.detailedView?.labelColor || chalk5.cyan.bold,
1425
- separatorColor: theme.detailedView?.separatorColor || chalk5.dim,
1720
+ logIdColor: theme.detailedView?.logIdColor || chalk7.dim,
1721
+ dataValueColor: theme.detailedView?.dataValueColor || chalk7.white,
1722
+ dataKeyColor: theme.detailedView?.dataKeyColor || chalk7.dim,
1723
+ selectorColor: theme.detailedView?.selectorColor || chalk7.cyan,
1724
+ headerColor: theme.detailedView?.headerColor || chalk7.cyan,
1725
+ labelColor: theme.detailedView?.labelColor || chalk7.cyan.bold,
1726
+ separatorColor: theme.detailedView?.separatorColor || chalk7.dim,
1426
1727
  // JSON formatting colors for detailed data view
1427
1728
  jsonColors: {
1428
- keysColor: chalk5.yellow,
1729
+ keysColor: chalk7.yellow,
1429
1730
  // Object property names
1430
- dashColor: chalk5.white,
1731
+ dashColor: chalk7.white,
1431
1732
  // Array bullets
1432
- numberColor: chalk5.yellow,
1733
+ numberColor: chalk7.yellow,
1433
1734
  // Default number color
1434
- stringColor: chalk5.white,
1735
+ stringColor: chalk7.white,
1435
1736
  // Single-line strings
1436
- multilineStringColor: chalk5.white,
1737
+ multilineStringColor: chalk7.white,
1437
1738
  // Multi-line strings
1438
- positiveNumberColor: chalk5.green,
1739
+ positiveNumberColor: chalk7.green,
1439
1740
  // Numbers > 0
1440
- negativeNumberColor: chalk5.red,
1741
+ negativeNumberColor: chalk7.red,
1441
1742
  // Numbers < 0
1442
- booleanColor: chalk5.cyan,
1743
+ booleanColor: chalk7.cyan,
1443
1744
  // true/false values
1444
- nullUndefinedColor: chalk5.grey,
1745
+ nullUndefinedColor: chalk7.grey,
1445
1746
  // null/undefined
1446
- dateColor: chalk5.magenta,
1747
+ dateColor: chalk7.magenta,
1447
1748
  // Date objects
1448
1749
  ...theme.detailedView?.jsonColors
1449
1750
  }
1450
1751
  };
1451
1752
  this.storage = new LogStorage(logFile);
1452
1753
  this.renderer = new LogRenderer(simpleViewConfig, detailedViewConfig, maxInlineDepth, maxInlineLength);
1453
- this.uiManager = new UIManager(this.renderer, this.storage);
1754
+ this.uiManager = new UIManager(this.renderer, this.storage, config.disableInteractiveMode);
1454
1755
  _PrettyTerminalTransport.instance = this;
1455
1756
  }
1456
1757
  /**
@@ -1508,13 +1809,13 @@ var PrettyTerminalTransport = class _PrettyTerminalTransport extends LoggerlessT
1508
1809
  };
1509
1810
 
1510
1811
  // src/index.ts
1511
- import * as chalk6 from "chalk";
1812
+ import * as chalk8 from "chalk";
1512
1813
  function getPrettyTerminal(config = {}) {
1513
1814
  return PrettyTerminalTransport.getInstance(config);
1514
1815
  }
1515
1816
  export {
1516
1817
  PrettyTerminalTransport,
1517
- chalk6 as chalk,
1818
+ chalk8 as chalk,
1518
1819
  getPrettyTerminal,
1519
1820
  moonlight,
1520
1821
  nature,