/** * Gonka Adapter — Governance layer for decentralized GPU inference networks * * Replaces Gonka's primitive allowlist.csv + manual governance votes with * APS delegation chains: automatic expiry, monotonic narrowing, cascade * revocation, signed receipts for off-chain devshard settlement. * * No Gonka SDK dependency. All types are local interfaces. */ import type { Delegation, ActionReceipt, SignedPassport } from '../types/passport.js'; export interface GonkaInferenceRequest { model: string; prompt: string; maxTokens?: number; hostAddress?: string; epochId?: number; devshardId?: string; } export interface GonkaHostConfig { passport: SignedPassport; delegation: Delegation; privateKey: string; allowedModels?: string[]; maxInferencesPerEpoch?: number; onReceipt?: (r: ActionReceipt) => void; onDenied?: (info: { host: string; reason: string; }) => void; } export interface GonkaInferenceReceipt { receipt: ActionReceipt; model: string; epochId?: number; devshardId?: string; inferenceHash: string; } export interface GonkaHostVerification { authorized: boolean; reason: string; scope: string; hostAddress: string; model: string; } /** Verify a host has authority to serve inference for a model */ export declare function verifyGonkaHost(hostAddress: string, model: string, config: GonkaHostConfig): GonkaHostVerification; /** Govern an inference request -- check delegation, model, rate limits */ export declare function governGonkaInference(request: GonkaInferenceRequest, execute: (req: GonkaInferenceRequest) => Promise<{ response: string; tokensUsed: number; }>, config: GonkaHostConfig): Promise<{ result: { response: string; tokensUsed: number; }; receipt: GonkaInferenceReceipt; } | { denied: true; reason: string; receipt: ActionReceipt; }>; /** Create a devshard session receipt (off-chain proof for settlement) */ export declare function createDevshardReceipt(devshardId: string, inferenceCount: number, totalTokens: number, participants: string[], config: Pick): ActionReceipt; /** Convert APS delegation to Gonka-compatible allowlist entry */ export declare function delegationToAllowlistEntry(delegation: Delegation, passport: SignedPassport): { address: string; model: string; scope: string[]; expiresAtBlock?: number; }; /** Convert Gonka epoch timing to APS delegation expiry */ export declare function epochToDelegationExpiry(currentEpoch: number, epochDurationBlocks: number, epochsValid: number): Date; /** Validate PoC (Proof-of-Compute) participation receipt */ export declare function verifyPoCParticipation(hostAddress: string, epochId: number, weight: number, config: Pick): ActionReceipt; //# sourceMappingURL=gonka.d.ts.map