/**
 * Shared tool argument metadata for LangGraph, LangChain, and other OpenLit-style traces.
 */
import type { AgentToolDefinition, Span } from '../types';
/** Attributes + spanAttributes (latter wins) for SDKs that put fields on spanAttributes (e.g. CrewAI). */
export declare function mergedSpanAttributes(s: Span): Record<string, any>;
export declare function getToolArgumentDefinitionFromAttrs(attributes: Record<string, any>): any;
export declare function getToolDescriptionFromAttrs(attributes: Record<string, any>): string | undefined;
export declare function getAgentDescriptionFromAttrs(attributes: Record<string, any>): string | undefined;
/**
 * When the SDK does not emit a schema, infer parameter names from a Python-ish repr or JSON tool input string.
 * e.g. "{'stock': 'TCS'}" -> ["stock"]
 */
export declare function inferArgumentDefinationFromInput(inputVal: unknown): string[] | undefined;
/**
 * Prefer actual input object keys when the runtime value is a plain object (avoids "[object Object]" stringification).
 */
export declare function inferArgumentDefinationFromInputValue(inputVal: unknown): string[] | undefined;
/**
 * When the trace has no `gen_ai.tool.definition` / parameters, infer parameter names from input;
 * for multiple parameters, shape `argument` as `{ param1: value | '', ... }` so consumers see real
 * keys (e.g. pulse evaluation `extractArgumentNames`). When a schema is present on the span, keep
 * the raw `input` as `argument`.
 */
export declare function buildToolArgumentFieldForLangChainEnrichment(input: unknown, definitionFromAttrs: unknown, inferredParamNames: string[] | undefined): unknown;
/**
 * Single place for LangChain `argument` / `argument_defination` shaping (getTools enrichment and
 * {@link collectAgentToolDefinitions} output for agents).
 */
export declare function enrichToolArgumentFieldsForLangChainFromSpan(input: unknown, attributes: Record<string, any>): {
    argument: unknown;
    argument_defination?: any;
};
/**
 * CrewAI system prompts use a schema-shaped `Tool Arguments:` line, e.g.
 * `{'stock_symbol': {'description': None, 'type': 'str'}}` — only **top-level** keys are tool parameters;
 * nested `description` / `type` must not appear in `argument_defination`.
 */
export declare function inferTopLevelKeysFromToolArgumentsSchemaRepr(s: string): string[] | undefined;
/**
 * Tool name + I/O + argument fields from standard gen_ai.tool.* / workflow fallbacks.
 */
export declare function extractOpenLitStyleToolFieldsFromSpan(s: Span): {
    name: string;
    description?: string;
    input: any;
    output: any;
    argument: any;
    argument_defination: any;
};
/** Payload from parallel message JSON (e.g. AutoGen ToolCallRequestEvent) keyed by tool call id. */
export interface ToolCallMessageDetails {
    name?: string;
    arguments?: any;
    output?: any;
}
export type OpenLitStyleToolFields = ReturnType<typeof extractOpenLitStyleToolFieldsFromSpan>;
/**
 * Merge tool call payloads from message JSON when span attrs omit input/output.
 * Matches {@link extractOpenLitStyleToolFieldsFromSpan} + message merge used for {@link Tool} extraction.
 */
export declare function mergeToolCallMessageDetailsIntoOpenLitFields(span: Span, details: ToolCallMessageDetails | undefined, fields: OpenLitStyleToolFields): OpenLitStyleToolFields;
export interface CollectAgentToolDefinitionsOptions {
    /** Merge message-JSON tool payloads (e.g. by gen_ai.tool.call.id) when span attrs omit I/O. */
    mergeMessageDetails?: (span: Span) => ToolCallMessageDetails | undefined;
    /** Final display name (e.g. ToolCallAnalyzer + message fallback), aligned with getTools. */
    resolveToolDisplayName?: (span: Span, merged: OpenLitStyleToolFields, details: ToolCallMessageDetails | undefined) => string;
}
export declare function isSpanDescendantOf(spanId: string, ancestorId: string, spanById: Map<string, Span>): boolean;
/** Tool spans under this agent (recursive descendants), ordered by span start time. */
export declare function collectAgentToolDefinitions(agentSpanId: string, spans: Span[], spanById: Map<string, Span>, isToolSpan: (s: Span) => boolean, options?: CollectAgentToolDefinitionsOptions): AgentToolDefinition[];
//# sourceMappingURL=toolArgumentFields.d.ts.map