/**
 * Step resolver — dependency ordering and template variable resolution.
 *
 * Pure functions: steps + context in → ordered execution plan out.
 * No I/O, no side effects, no Neo4j.
 *
 *   STEPS (unordered)
 *     │
 *     v
 *   resolveOrder()  ──→  Kahn's algorithm (topological sort)
 *     │                    ├─ cycle detected → CyclicDependencyError
 *     │                    └─ position tiebreak for independent steps
 *     v
 *   ORDERED STEPS
 *     │
 *     v
 *   resolveTemplates()  ──→  {{key.path}} substitution
 *     │                        ├─ JSON parse: object → pass-through, array → {_items}, else {_raw}
 *     │                        └─ unresolved → UnresolvedTemplateError
 *     v
 *   RESOLVED PARAMS
 */
interface StepBase {
    stepId: string;
    dependsOn?: string[];
    onFailure?: "abort" | "skip" | "retry";
    retryLimit?: number;
    outputKey?: string;
    timeout?: number;
    position: number;
    label: string;
}
export interface ToolStepDefinition extends StepBase {
    type: "tool";
    plugin: string;
    tool: string;
    params?: Record<string, unknown>;
}
export type StepDefinition = ToolStepDefinition;
/**
 * Topological sort with position-based tiebreaking.
 * Returns steps in execution order. Throws on cycles.
 */
export declare function resolveOrder(steps: StepDefinition[]): StepDefinition[];
/**
 * Parse a step's MCP tool response text into a structured output.
 * If the text is valid JSON: objects are returned directly, arrays are
 * wrapped as { _items: array }. Non-object/array JSON and unparseable
 * text are wrapped as { _raw: text }.
 */
export declare function parseStepOutput(text: string): Record<string, unknown>;
/**
 * Resolve all {{template.variables}} in a params object.
 * Context is a map of outputKey → parsed step output.
 *
 * Throws UnresolvedTemplateError if any variable cannot be resolved.
 */
export declare function resolveTemplates(params: Record<string, unknown>, context: Record<string, Record<string, unknown>>): Record<string, unknown>;
/**
 * Resolve template variables in a single string value.
 * Supports full replacement: "{{a.b}}" → value of a.b
 * Supports interpolation: "Hello {{name}}" → "Hello John"
 */
export declare function resolveStringTemplate(template: string, context: Record<string, Record<string, unknown>>): unknown;
export {};
//# sourceMappingURL=step-resolver.d.ts.map