/** * Decomposition output types — the structured result the StrategyDecomposer emits after reasoning * over a free-text strategy idea. * * Critical design choices: * * 1. EVERY emitted leaf carries a `status: "verified" | "missing" | "needs_research"`. The * decomposer is forbidden to emit a leaf without calling `verify_policy_id` first. After * parsing the agent's response, a post-check downgrades the overall `simulationReady` flag * to false if ANY leaf isn't `verified`. This is the "100% accuracy" rule the user requested. * * 2. Topology is explicit: `homeChain` (where shares are minted, must be a Lucidly factory chain) * is distinct from `positionChains` (where capital lives, can be ANY EVM chain with bridge * support + leaves). `bridgeEdges` captures the cross-chain capital flows so the UI + simulator * can show "step 2: bridge USDC mainnet → HyperEVM via CCIP". * * 3. The shape is designed to flow directly into the SimulatorClient.simulatePlan() input: each * verified leaf has the {target, calldata, value} fields the simulator needs (calldata being * optional at this stage — encoded after the user provides params). * * 4. Confidence is a 0..1 score with a documented breakdown so the UI can render a confidence * bar and tell the user *why* it's not 1.0 (e.g., "two leaves marked needs_research"). */ import { z } from "zod"; export declare const LeafStatusSchema: z.ZodEnum<{ verified: "verified"; missing: "missing"; needs_research: "needs_research"; }>; export type LeafStatus = z.infer; /** Single Merkle-gated leaf the decomposer has emitted, with its verification status. */ export declare const DecomposedLeafSchema: z.ZodObject<{ policyId: z.ZodNullable; protocol: z.ZodString; selector: z.ZodString; target: z.ZodNullable; decoderAndSanitizer: z.ZodOptional>; status: z.ZodEnum<{ verified: "verified"; missing: "missing"; needs_research: "needs_research"; }>; rationale: z.ZodString; calldata: z.ZodOptional>; value: z.ZodOptional>; }, z.core.$strip>; export type DecomposedLeaf = z.infer; /** Bridge edge — a cross-chain capital flow the decomposer identified. */ export declare const DecomposedBridgeEdgeSchema: z.ZodObject<{ fromChain: z.ZodNumber; toChain: z.ZodNumber; rail: z.ZodString; asset: z.ZodString; senderLeaves: z.ZodArray; protocol: z.ZodString; selector: z.ZodString; target: z.ZodNullable; decoderAndSanitizer: z.ZodOptional>; status: z.ZodEnum<{ verified: "verified"; missing: "missing"; needs_research: "needs_research"; }>; rationale: z.ZodString; calldata: z.ZodOptional>; value: z.ZodOptional>; }, z.core.$strip>>; finality: z.ZodString; rationale: z.ZodString; }, z.core.$strip>; export type DecomposedBridgeEdge = z.infer; /** A leg = a contiguous sequence of leaves on a single chain that share a purpose. */ export declare const DecomposedLegSchema: z.ZodObject<{ chain: z.ZodNumber; chainName: z.ZodString; kind: z.ZodEnum<{ onchain: "onchain"; api: "api"; }>; purpose: z.ZodString; leaves: z.ZodArray; protocol: z.ZodString; selector: z.ZodString; target: z.ZodNullable; decoderAndSanitizer: z.ZodOptional>; status: z.ZodEnum<{ verified: "verified"; missing: "missing"; needs_research: "needs_research"; }>; rationale: z.ZodString; calldata: z.ZodOptional>; value: z.ZodOptional>; }, z.core.$strip>>; rationale: z.ZodString; }, z.core.$strip>; export type DecomposedLeg = z.infer; export declare const DecompositionConfidenceBreakdownSchema: z.ZodObject<{ archetypeMatch: z.ZodNumber; leafCoverage: z.ZodNumber; bridgeCoverage: z.ZodNumber; }, z.core.$strip>; export type DecompositionConfidenceBreakdown = z.infer; export declare const DecompositionResultSchema: z.ZodObject<{ apiVersion: z.ZodLiteral<"1">; requestId: z.ZodNullable; originalPrompt: z.ZodString; planId: z.ZodString; displayName: z.ZodString; archetype: z.ZodEnum<{ leveraged_carry: "leveraged_carry"; lp_hedge: "lp_hedge"; yield_basket: "yield_basket"; delta_neutral: "delta_neutral"; other: "other"; }>; nearestCorpusRef: z.ZodNullable; summary: z.ZodString; homeChain: z.ZodNumber; positionChains: z.ZodArray; bridgeEdges: z.ZodArray; protocol: z.ZodString; selector: z.ZodString; target: z.ZodNullable; decoderAndSanitizer: z.ZodOptional>; status: z.ZodEnum<{ verified: "verified"; missing: "missing"; needs_research: "needs_research"; }>; rationale: z.ZodString; calldata: z.ZodOptional>; value: z.ZodOptional>; }, z.core.$strip>>; finality: z.ZodString; rationale: z.ZodString; }, z.core.$strip>>; legs: z.ZodArray; purpose: z.ZodString; leaves: z.ZodArray; protocol: z.ZodString; selector: z.ZodString; target: z.ZodNullable; decoderAndSanitizer: z.ZodOptional>; status: z.ZodEnum<{ verified: "verified"; missing: "missing"; needs_research: "needs_research"; }>; rationale: z.ZodString; calldata: z.ZodOptional>; value: z.ZodOptional>; }, z.core.$strip>>; rationale: z.ZodString; }, z.core.$strip>>; confidence: z.ZodNumber; confidenceBreakdown: z.ZodObject<{ archetypeMatch: z.ZodNumber; leafCoverage: z.ZodNumber; bridgeCoverage: z.ZodNumber; }, z.core.$strip>; warnings: z.ZodArray; simulationReady: z.ZodBoolean; ifMissing: z.ZodArray; detail: z.ZodString; suggestedLink: z.ZodOptional>; }, z.core.$strip>>; riskFactors: z.ZodRecord; citations: z.ZodArray; detail: z.ZodString; }, z.core.$strip>>; generatedAt: z.ZodString; }, z.core.$strip>; export type DecompositionResult = z.infer; /** Compute the post-parse simulationReady + confidenceBreakdown from a candidate result. * Used both inside the decomposer (to overwrite the agent's claimed values with verified ones) * and by callers who want to re-check a result after editing it. */ export declare function recomputeReadiness(result: DecompositionResult): { simulationReady: boolean; confidence: number; confidenceBreakdown: DecompositionConfidenceBreakdown; }; /** Lint a DecompositionResult: returns a list of warning strings that the agent missed. * Doesn't throw — just surfaces what the post-parse check found. */ export declare function lintDecomposition(result: DecompositionResult): string[];