import type { PeerId } from './peer-id.js'; import type { PeerOffering } from './capability.js'; import type { ServiceUnitBillingModelsV1 } from './billing.js'; import { WELL_KNOWN_SERVICE_API_PROTOCOLS, type ServiceApiProtocol } from './service-api.js'; export declare const METADATA_VERSION = 12; /** Oldest announced metadata version buyers still accept from sellers. */ export declare const MIN_SUPPORTED_METADATA_VERSION = 10; export declare const SERVICE_UNIT_BILLING_METADATA_VERSION = 11; export declare const SERVICE_CAPABILITIES_METADATA_VERSION = 12; export declare const WELL_KNOWN_SERVICE_CATEGORIES: readonly ["privacy", "legal", "uncensored", "coding", "finance", "tee"]; export { WELL_KNOWN_SERVICE_API_PROTOCOLS }; export type { ServiceApiProtocol }; export interface TokenPricingUsdPerMillion { inputUsdPerMillion: number; outputUsdPerMillion: number; cachedInputUsdPerMillion?: number; } export declare const SERVICE_CAPABILITY_MODALITIES: readonly ["text", "image", "audio", "video", "pdf"]; export type ServiceCapabilityModality = (typeof SERVICE_CAPABILITY_MODALITIES)[number]; export declare const VIDEO_INPUT_KINDS: readonly ["first_frame", "last_frame", "reference_image", "video", "reference_video", "audio"]; export type VideoInputKind = (typeof VIDEO_INPUT_KINDS)[number]; /** * Values a video model accepts. Absent lists mean the seller did not announce * that option; buyers must not guess from absence. `inputs` is the complete * list of accepted media inputs (empty means text only), and `requiredInputs` * must be supplied on every create. */ export interface VideoOptions { durationsSeconds?: number[]; resolutions?: string[]; aspectRatios?: string[]; inputs?: VideoInputKind[]; requiredInputs?: VideoInputKind[]; audio?: boolean; } /** * Per-service model capability hints announced by sellers. Every field is * optional: absent means unknown, so buyers fall back to their own defaults. */ export interface ServiceCapabilities { /** Options accepted by a native video model. */ video?: VideoOptions; /** Total context window in tokens. */ contextWindow?: number; /** Maximum output tokens per response. */ maxOutputTokens?: number; /** Supported input modalities. */ inputs?: ServiceCapabilityModality[]; /** Produced output modalities (e.g. `["image"]` for image services). */ outputs?: ServiceCapabilityModality[]; /** Supports extended thinking / reasoning effort. */ reasoning?: boolean; /** Supports tool use / function calling. */ toolUse?: boolean; /** Supports structured output / JSON schema responses. */ structuredOutput?: boolean; /** * Request-body parameter names the service accepts beyond the protocol's * required fields, e.g. `["background", "output_format", "seed"]` for an * image service. A hint for buyers, not an enforced contract. */ supportedParameters?: string[]; } /** Ceiling for announced contextWindow / maxOutputTokens (fits the u32 wire field). */ export declare const MAX_CAPABILITY_TOKEN_COUNT = 1000000000; export declare const MAX_CAPABILITY_SUPPORTED_PARAMETERS = 32; export declare const MAX_CAPABILITY_PARAMETER_LENGTH = 32; export declare const MAX_VIDEO_OPTION_VALUES = 64; export declare const MAX_VIDEO_OPTION_LENGTH = 32; /** * Field-level validation for one service's capability entry. Shared by the * announce-time metadata validator and provider config parsing so the two * can never drift: anything config parsing accepts must also announce. */ export declare function validateServiceCapabilityFields(caps: ServiceCapabilities): string[]; export interface ProviderAnnouncement { provider: string; services: string[]; defaultPricing: TokenPricingUsdPerMillion; servicePricing?: Record; serviceCategories?: Record; serviceApiProtocols?: Record; serviceUnitBillingModels?: ServiceUnitBillingModelsV1; serviceCapabilities?: Record; maxConcurrency: number; currentLoad: number; } export type DomainVerificationMethod = "dns-txt" | "https-well-known"; export interface DomainVerificationClaim { /** ASCII hostname only, lower-case, with no scheme, path, or port. */ domain: string; /** Accepted proof transports. When omitted, clients may try every known method. */ methods?: DomainVerificationMethod[]; } export interface GithubVerificationClaim { /** GitHub username, lower-case. */ username: string; /** * Public repository holding the proof file, lower-case. Defaults to the * profile repository `/` when omitted. */ repository?: string; } export interface PeerVerifications { /** * Domain ownership claims. Clients verify by checking a matching DNS TXT * record at `_antseed.` or a well-known proof at * `https:///.well-known/antseed.json`. */ domains?: DomainVerificationClaim[]; /** * GitHub account ownership claims. Clients verify by fetching * `https://raw.githubusercontent.com///HEAD/antseed.json` * — the username in the URL path binds the proof to the account. */ github?: GithubVerificationClaim[]; } export interface PeerMetadata { peerId: PeerId; version: number; displayName?: string; publicAddress?: string; providers: ProviderAnnouncement[]; offerings?: PeerOffering[]; region: string; timestamp: number; stakeAmountUSDC?: number; onChainChannelCount?: number; onChainGhostCount?: number; /** Protocol capabilities supported by this peer. */ capabilities?: string[]; /** * On-chain seller contract that fronts this peer (e.g. a DiemStakingProxy). * Buyers resolve `seller = sellerContract` for channel flows and verify the * binding by calling `sellerContract.isOperator(peerAddress)` on-chain. * Stored as 40 lowercase hex chars (no `0x` prefix) matching `peerId` format. */ sellerContract?: string; /** Optional external ownership claims announced by this peer. */ verifications?: PeerVerifications; /** * Buyer-local observation time for this metadata fetch. Not signed and not * encoded in metadata; used only for diagnostics/freshness decisions. */ resolvedAtMs?: number; /** * Seller HTTP Date header observed during metadata fetch, in Unix ms. Not * signed and not encoded in metadata. When present, buyers can judge the * signed timestamp using the seller's wall clock instead of their own, which * keeps discovery working for users whose local desktop clock is wrong. */ serverDateMs?: number; signature: string; } //# sourceMappingURL=peer-metadata.d.ts.map