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

    Function embodify

    • Creates an immutable chainable builder with optional initial state.

      Accumulate state through EmbodifyChain.set; execute through EmbodifyChain.trace. Each .set() returns a NEW chain — state is never mutated. Errors from .trace() are returned as { ok: false } — never thrown.

      Parameters

      • input: EmbodifyInput = {}

        Initial state fields (all optional). { tracer?, code?, config? }

      Returns EmbodifyChain

      A new EmbodifyChain with the provided initial state

      No validation at creation — .trace() handles all validation. This means you can create a chain with no fields and populate them via .set() before tracing.

      const chain = await embodify({ tracer: myTracer })
      .set({ code: 'hello' })
      .trace();

      if (chain.ok) console.log(chain.steps);

      // Re-trace with new code — chain is immutable, original unaffected
      const chain2 = await chain.set({ code: 'world' }).trace();