/** * Local-file POC source — the analyze-file flow. * * Reads a log file (typically a fluentd/k8s/docker-wrapped JSONL dump, * e.g. a CloudWatch export) and normalizes it for pattern extraction. * * The normalization is the measured requirement from the engine * handoff §20: wrapped JSON must be pre-extracted before templating — * fed raw, the templater tokenizes the wrapper (mangled names, no * welds); pre-extracted, patterns come out clean and welds hold. * * Mechanism: when the file sniffs as wrapped JSONL, each line is * parsed and handed to `extractPatterns` as an OBJECT. The existing * `coerceToLine` descent unwraps the `log`/`message` payload for the * templater, and `extractEnrichmentFromEnvelope` keeps the container * attribution (kubernetes.container_name / pod labels) that the * container-keyed change rows need — the MCP-native equivalent of the * engine-side `\t` + sourcePattern contract. * * Byte accounting: `totalBytes` counts the UNWRAPPED payload bytes * (what the templater analyses); `rawBytes` keeps the on-disk wrapped * size (what a vendor would bill on) and travels to * RenderInput.rawIngestBytes. */ import type { LocalSourceResult } from './local-source.js'; /** Hard input cap — refuse above rather than OOM. */ export declare const MAX_FILE_BYTES: number; /** * Above this size, the single file is SAMPLED strided across its length rather * than fed whole to the engine. Feeding a 70MB file whole timed out the engine * (120s cap in dev-cli), and a contiguous read under-covers a time-ordered * file's pattern space (F8/F15). 24MB processes in well under the engine * timeout and, sampled strided, spans the whole file. */ export declare const SINGLE_FILE_SAMPLE_BYTES: number; export interface FileSourceResult extends LocalSourceResult { /** What extractPatterns should consume: objects when wrapped * (envelope-aware path), raw strings otherwise. */ records: unknown[]; /** On-disk bytes (wrapped size) — the billable figure. */ rawBytes: number; /** True when the wrapped-JSON normalization path was taken. */ normalized: boolean; } declare function isWrappedLine(line: string): Record | null; declare function containerOf(rec: Record): string; declare function payloadOf(rec: Record): string; export declare function sampleFromFile(path: string): Promise; /** Exported for tests. */ export declare const _internals: { isWrappedLine: typeof isWrappedLine; containerOf: typeof containerOf; payloadOf: typeof payloadOf; }; export {};