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

    Function tracing

    • Validates a TracerModule and returns all four API wrappers pre-bound to it.

      Parameters

      Returns Readonly<
          {
              embodify: EmbodifyChain;
              embody: EmbodyChain;
              trace: (code: string, config?: unknown) => Promise<readonly StepCore[]>;
              tracify: Promise<TracifyResult> | TracifyClosure;
          },
      >

      Frozen object with all four pre-bound API wrappers:

      • trace(code, config?) — positional args, throws on error
      • tracify({ code, config? }) — keyed args with partial application, returns Result
      • embody — chainable builder with tracer pre-set, throws on error
      • embodify({ code?, config? }) — immutable chainable builder, returns Result

      Validation happens once at call time — before any wrapper is invoked. If the TracerModule is invalid, tracing() throws immediately with a TracerInvalidError listing all violations. Wrappers are never returned in an invalid state.

      The returned trace is the curried form: (code, config?) => Promise<StepCore[]>. The returned tracify is a closure with the tracer pre-set. The returned embody is a chain with the tracer pre-set. The returned embodify is a chain with the tracer pre-set.

      if tracerModule does not satisfy the contract

      const api = tracing(myTracer);
      const steps = await api.trace('hello');
      const result = await api.tracify({ code: 'hello', config: {} });