import { z } from 'zod'; export declare const zodHexAddress: z.ZodString; export declare const zodHexData: z.ZodString; export declare const zodPositiveChainId: z.ZodNumber; /** * Tool context types — defined locally to avoid trust boundary violations. * Uses structural typing so callers can pass the actual implementations. */ /** Minimal decoded intent — structural supertype of the protocol layer's DecodedIntent union */ export interface ToolDecodedIntent { protocol: string; chainId: number; to: `0x${string}`; selector?: `0x${string}`; action?: string; args?: Record; rawData?: `0x${string}`; reason?: string; } /** Minimal signer interface needed by MCP tools */ export interface ToolSigner { getAddress(): Promise<`0x${string}`>; signTransaction(tx: Record): Promise<`0x${string}`>; signTypedData(params: Record): Promise<{ v: number; r: `0x${string}`; s: `0x${string}`; }>; healthCheck(): Promise; } /** Policy evaluation result */ export interface ToolPolicyEvaluation { allowed: boolean; violations: string[]; } /** Minimal policy engine interface needed by MCP tools (V2 — intent-aware) */ export interface ToolPolicyEngine { evaluate(request: { chainId: number; to: `0x${string}`; selector?: `0x${string}`; amountWei?: bigint; deadline?: number; intent?: ToolDecodedIntent; }): ToolPolicyEvaluation; } /** Protocol dispatcher interface for calldata decoding */ export interface ToolDispatcher { dispatch(chainId: number, to: `0x${string}`, data: `0x${string}`): ToolDecodedIntent; } /** Audit entry fields that callers provide (timestamp and traceId auto-generated) */ export interface ToolAuditInput { service: string; action: string; who: string; what: string; why: string; result: 'approved' | 'denied' | 'error'; details?: Record; } /** Minimal audit logger interface needed by MCP tools */ export interface ToolAuditLogger { log(entry: ToolAuditInput): unknown; } /** RPC provider interface for on-chain reads and broadcast */ export interface ToolRpcProvider { getBalance(chainId: number, address: `0x${string}`): Promise; getErc20Balance(chainId: number, token: `0x${string}`, owner: `0x${string}`): Promise; getTransactionCount(chainId: number, address: `0x${string}`): Promise; estimateGas(chainId: number, tx: { from: `0x${string}`; to: `0x${string}`; value?: bigint; data?: `0x${string}`; }): Promise; getGasPrice(chainId: number): Promise; estimateFeesPerGas(chainId: number): Promise<{ maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; }>; getNativeCurrencySymbol(chainId: number): string; sendRawTransaction(chainId: number, signedTx: `0x${string}`): Promise<`0x${string}`>; } /** Full context passed to each MCP tool */ export interface ToolContext { signer: ToolSigner; policyEngine: ToolPolicyEngine; auditLogger: ToolAuditLogger; dispatcher?: ToolDispatcher; rpcProvider?: ToolRpcProvider; }