import { A as AgentPayload, P as PackResult, E as EncryptedPayload, j as AgentPrivatePayload } from '../types-DJHPGJSX.js'; export { c as A2AAgentCard, d as A2ASkillExecution, e as A2ATask, f as A2ATaskStatus, g as AGENT_CATEGORIES, h as AgentCategory, i as AgentPricing, k as AgentPublicPayload, b as AgentReputation, a as AgentReview, l as AgentSearchQuery, m as AgentSearchResult, n as AgentSubscription, o as AgentXConfig, p as AgentXContracts, q as AgentXError, r as AgentXErrorCode, J as JSONSchema, s as JSONSchemaProperty, M as McpConnection, t as McpTransport, O as OnChainAgentMetadata, u as PricingType, R as RegisteredAgent, S as SkillDef, v as SkillExecutionMode, w as SkillExecutionRemote, x as SubscriptionRequired, y as SubscriptionStatus, U as UnpackResult } from '../types-DJHPGJSX.js'; import { IPFSUploader, IPFSUploadResult } from '../ipfs/index.js'; export { bytesToHex, hexToBytes } from '@noble/ciphers/utils.js'; declare function randomBytes(length: number): Uint8Array; /** * Encrypt with AES-256-GCM. * Wire format: base64( IV[12] || ciphertext || authTag[16] ) */ declare function aesEncrypt(plaintext: string, keyHex: string): string; /** * Decrypt AES-256-GCM. */ declare function aesDecrypt(encryptedBase64: string, keyHex: string): string; /** * Encrypt with AES-256-GCM — master-key wire format. * Layout: base64( IV[12] || authTag[16] || ciphertext ). * Kept byte-for-byte compatible with the Gateway's legacy at-rest key * encryption (`gateway/src/lib/crypto.ts`) so existing stored rows decrypt * unchanged. New code should prefer `aesEncrypt`/`aesDecrypt` unless data * written in this layout must be read. */ declare function encryptWithKey(plaintext: string, keyHex: string): string; /** * Decrypt AES-256-GCM — master-key wire format * (base64( IV[12] || authTag[16] || ciphertext )). */ declare function decryptWithKey(encryptedBase64: string, keyHex: string): string; /** * Generate a cryptographically random AES-256 key (hex, 64 chars). */ declare function generateAesKey(): string; /** * Encrypt data with recipient's secp256k1 public key (ECIES). * * @param dataHex The data to encrypt (hex, e.g. AES key) * @param publicKey Recipient's public key (hex, 04-prefixed uncompressed or 02/03 compressed) */ declare function eciesEncrypt(dataHex: string, publicKey: string): string; /** * Decrypt ECIES ciphertext with recipient's secp256k1 private key. */ declare function eciesDecrypt(dataHex: string, privateKey: string): string; /** * Encrypt an Agent's private payload with AES-256-GCM. */ declare function encryptPayload(payload: AgentPrivatePayload, keyHex?: string): EncryptedPayload; /** * Decrypt an EncryptedPayload. */ declare function decryptPayload(encrypted: EncryptedPayload, keyHex: string): AgentPrivatePayload; /** * Pack an AgentPayload for publishing. * 1. Split public/private * 2. AES-256-GCM encrypt private part * 3. ECIES wrap AES key with creator's public key */ declare function packAgentForPublish(agent: AgentPayload, publicKey: string, aesKeyHex?: string): PackResult; interface PublishAgentConfig { /** Agent payload to publish */ agent: AgentPayload; /** Creator's secp256k1 public key (hex) */ publicKey: string; /** IPFS uploader instance with Pinata JWT configured */ uploader: IPFSUploader; /** Optional AES key (auto-generated if not provided) */ aesKeyHex?: string; /** Agent name for IPFS metadata */ agentName?: string; } interface PublishAgentResult { /** AES encryption key (hex) */ aesKeyHex: string; /** ECIES-encrypted AES key for on-chain storage */ eciesEncryptedKeyHex: string; /** CID of the encrypted private payload on IPFS */ encryptedCid: string; /** Public IPFS gateway URL to the encrypted payload */ encryptedUrl: string; /** CID of the public metadata on IPFS */ publicCid: string; /** Public IPFS gateway URL to the public metadata */ publicUrl: string; /** Full PackResult (compatible with existing code) */ pack: PackResult; /** Raw IPFS upload results */ uploads: { encrypted: IPFSUploadResult; public: IPFSUploadResult; }; } /** * Full publish pipeline: encrypt + upload to IPFS. * * Usage: * const uploader = new IPFSUploader({ pinataJwt: '...' }) * const result = await publishAgent({ agent, publicKey, uploader }) * // result.encryptedCid → IPFS CID to mint as on-chain tokenURI */ declare function publishAgent(config: PublishAgentConfig): Promise; /** * Unpack an Agent: * 1. ECIES decrypt the AES key (private key) * 2. AES-256-GCM decrypt the payload */ declare function unpackAgent(encryptedPayload: EncryptedPayload, eciesEncryptedKey: string, privateKey: string): AgentPrivatePayload; /** * Generate a secp256k1 keypair compatible with Ethereum wallets. */ declare function generateKeyPair(): { privateKey: string; publicKey: string; }; /** * Derive public key from private key (hex). */ declare function getPublicKey(privateKey: string): string; export { AgentPayload, AgentPrivatePayload, EncryptedPayload, PackResult, type PublishAgentConfig, type PublishAgentResult, aesDecrypt, aesEncrypt, decryptPayload, decryptWithKey, eciesDecrypt, eciesEncrypt, encryptPayload, encryptWithKey, generateAesKey, generateKeyPair, getPublicKey, packAgentForPublish, publishAgent, randomBytes, unpackAgent };