/** * Wrap an async function so it emits `graph_start` / `graph_end` events around * its execution. `durationMs` is measured in wall time. If the wrapped * function throws, `graph_end` still fires before the error propagates. * * Use ONLY for actual LangGraph compiled state machines (Opportunity graph, * Negotiation graph, etc). For logical groupings of inline work, use * `tracePhase` — it has a distinct visual in the trace UI so users can tell * "this is a graph" from "this is a phase". */ export declare function traceGraph(name: string, fn: () => Promise): Promise; /** * Wrap an async function so it emits `phase_start` / `phase_end` events around * its execution. Phases are logical groupings of inline async work — they * share container semantics with graphs (they can host agents) but render * differently in the trace UI to make it clear they're NOT LangGraph state * machines. */ export declare function tracePhase(name: string, fn: () => Promise): Promise; /** * Wrap an async function so it emits `agent_start` / `agent_end` events. The * optional `summarize` callback produces a short string shown in the trace * panel; receives the wrapped function's resolved value. */ export declare function traceAgent(name: string, fn: () => Promise, summarize?: (value: T) => string | undefined): Promise; /** * Method decorator. Wraps the decorated async method in `traceGraph(name, ...)`. * Use on class methods that represent a logical "graph" (a sub-flow with * internal agent calls). * * @example * class RefinePhase { * @TraceGraph("Refine") * async run() { ... } * } */ export declare const TraceGraph: (name: string) => (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void; /** * Method decorator. Wraps the decorated async method in `traceAgent(name, ...)`. * Use on class methods that represent a single agent step (one LLM call, * one summarization, etc). * * @example * class ChatSummary { * @TraceAgent("Chat summary") * async run() { ... } * } */ export declare const TraceAgent: (name: string) => (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void; /** * Method decorator. Wraps the decorated async method in `tracePhase(name, ...)`. * Use for logical groupings of inline work that aren't LangGraph state machines. * * @example * class RefinePhase { * @TracePhase("Refine") * async run() { ... } * } */ export declare const TracePhase: (name: string) => (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;