@study-lenses/tracing
    Preparing search index...

    Type Alias TracerModule

    The object every tracer package must export. Pass this to tracing(tracerModule) to get the four pre-bound API wrappers.

    // In a tracer package:
    const tracerModule: TracerModule = { id, langs, record, optionsSchema, verifyOptions };
    export default tracerModule;

    id is the cache-invalidation key — used to detect when a tracer has changed in chainable APIs (embody, embodify). Must be unique across your tracer ecosystem.

    langs declares which file extensions this tracer supports. Chainable APIs use it to decide whether to keep or discard the current code when switching tracers:

    • Empty array [] = universal tracer — compatible with any language
    • Intersection with previous tracer's langs = keep code
    • No intersection = discard code (incompatible language families)
    type TracerModule = {
        id: string;
        langs: Readonly<readonly string[]>;
        optionsSchema?: Readonly<Record<string, unknown>>;
        record: RecordFunction;
        verifyOptions?: (options: unknown) => void;
    }
    Index

    Properties

    id: string

    Unique tracer ID, e.g. 'js:klve' or 'txt:chars' — used as cache-invalidation key

    langs: Readonly<readonly string[]>

    Supported file extensions (without leading dot), e.g. ['js', 'mjs', 'cjs']. Use Object.freeze([...]) when defining. Use [] for universal tracers.

    optionsSchema?: Readonly<Record<string, unknown>>

    JSON Schema for tracer-specific options (omit if tracer has no options)

    The tracing function — receives code + fully resolved config, returns steps

    verifyOptions?: (options: unknown) => void

    Semantic validation for cross-field constraints — called after schema validation. Throw OptionsSemanticInvalidError if constraints are violated. Omit if no cross-field constraints exist.