Variable MarkdownFileBaseConst

MarkdownFileBase: new (
    markdownName: keyof IMarkdownTarget,
) => {
    _baseDir: string;
    _filePath: string;
    _stream: WriteStream | null;
    "[WAIT_FOR_INIT_SYMBOL]": () => Promise<void> & functools_kit.ISingleshotClearable;
    "[WRITE_SAFE_SYMBOL]": (line: string) => Promise<symbol | void>;
    dump(data: string, options: IMarkdownDumpOptions): Promise<void>;
    markdownName: MarkdownName;
    waitForInit(): Promise<void>;
}

JSONL-based markdown adapter with append-only writes.

Features:

  • Writes markdown reports as JSONL entries to a single file per markdown type
  • Stream-based writes with backpressure handling
  • 15-second timeout protection for write operations
  • Automatic directory creation
  • Error handling via exitEmitter
  • Search metadata for filtering (symbol, strategy, exchange, frame, signalId)

File format: ./dump/markdown/{markdownName}.jsonl Each line contains: markdownName, data, symbol, strategyName, exchangeName, frameName, signalId, timestamp

Use this adapter for centralized logging and post-processing with JSONL tools.

Type declaration

    • new (
          markdownName: keyof IMarkdownTarget,
      ): {
          _baseDir: string;
          _filePath: string;
          _stream: WriteStream | null;
          "[WAIT_FOR_INIT_SYMBOL]": () => Promise<void> & functools_kit.ISingleshotClearable;
          "[WRITE_SAFE_SYMBOL]": (line: string) => Promise<symbol | void>;
          dump(data: string, options: IMarkdownDumpOptions): Promise<void>;
          markdownName: MarkdownName;
          waitForInit(): Promise<void>;
      }
    • Parameters

      • markdownName: keyof IMarkdownTarget

      Returns {
          _baseDir: string;
          _filePath: string;
          _stream: WriteStream | null;
          "[WAIT_FOR_INIT_SYMBOL]": () => Promise<void> & functools_kit.ISingleshotClearable;
          "[WRITE_SAFE_SYMBOL]": (line: string) => Promise<symbol | void>;
          dump(data: string, options: IMarkdownDumpOptions): Promise<void>;
          markdownName: MarkdownName;
          waitForInit(): Promise<void>;
      }

      • _baseDir: string

        Base directory for all JSONL markdown files

      • _filePath: string

        Absolute path to the JSONL file for this markdown type

      • _stream: WriteStream | null

        WriteStream instance for append-only writes, null until initialized

      • [WAIT_FOR_INIT_SYMBOL]: () => Promise<void> & functools_kit.ISingleshotClearable

        Singleshot initialization function that creates directory and stream. Protected by singleshot to ensure one-time execution. Sets up error handler that emits to exitEmitter.

      • [WRITE_SAFE_SYMBOL]: (line: string) => Promise<symbol | void>

        Timeout-protected write function with backpressure handling. Waits for drain event if write buffer is full. Times out after 15 seconds and returns TIMEOUT_SYMBOL.

      • dump:function
        • Writes markdown content to JSONL file with metadata. Appends a single line with JSON object containing:

          • markdownName: Type of report
          • data: Markdown content
          • Search flags: symbol, strategyName, exchangeName, frameName, signalId
          • timestamp: Current timestamp in milliseconds

          Parameters

          Returns Promise<void>

          Error if stream not initialized or write timeout exceeded

      • ReadonlymarkdownName: MarkdownName
      • waitForInit:function
        • Initializes the JSONL file and write stream. Safe to call multiple times - singleshot ensures one-time execution.

          Returns Promise<void>

          Promise that resolves when initialization is complete