import type { J41Agent } from '../agent.js';
import type { SessionInput } from './validation.js';
export type { EndpointInput, CapabilityInput, SessionInput } from './validation.js';
export type FinalizeMode = 'headless' | 'interactive';
export type FinalizeStage = 'onboarded' | 'vdxf_published' | 'vdxf_verified' | 'indexed' | 'profile_registered' | 'services_registered' | 'ready';
export interface FinalizeState {
    agentId?: string;
    identity?: string | null;
    iAddress?: string | null;
    mode: FinalizeMode;
    stage: FinalizeStage;
    startedAt: string;
    updatedAt: string;
    completedAt?: string;
    notes?: string[];
}
export interface DataPolicyInput {
    retention?: 'ephemeral' | 'session' | 'persistent';
    allowTraining?: boolean;
    allowThirdParty?: boolean;
    requireDeletion?: boolean;
}
/** Network config — flattened to 3 individual VDXF keys (capabilities, endpoints, protocols) */
export interface NetworkInput {
    capabilities?: string[];
    endpoints?: string[];
    protocols?: string[];
}
/** Profile metadata — flattened to 4 individual VDXF keys (tags, website, avatar, category) */
export interface ProfileInput {
    tags?: string[];
    website?: string;
    avatar?: string;
    category?: string;
}
/** platform.config JSON blob */
export interface PlatformConfigInput {
    datapolicy?: string | DataPolicyInput;
    trustlevel?: string;
    disputeresolution?: string;
}
/** workspace.capability JSON blob */
export interface WorkspaceCapabilityInput {
    workspace: boolean;
    modes: ('supervised' | 'standard')[];
    tools: string[];
}
/** job.record JSON blob */
export interface JobRecordInput {
    jobHash: string;
    buyer: string;
    description?: string;
    amount: number;
    currency: string;
    completedAt: number;
    completionSignature: string;
    paymentTxid?: string;
    hasWorkspace?: boolean;
    hasReview?: boolean;
}
/** review.record JSON blob */
export interface ReviewRecordInput {
    buyer: string;
    jobHash: string;
    message: string;
    rating: number;
    signature: string;
    timestamp: number;
}
/** workspace.attestation JSON blob */
export interface WorkspaceAttestationInput {
    jobId: string;
    buyer: string;
    duration: number;
    filesRead: number;
    filesWritten: number;
    sovguardFlags: number;
    completedClean: boolean;
    mode: 'supervised' | 'standard';
    platformSignature?: string;
}
export interface AgentProfileInput {
    name: string;
    type: 'autonomous' | 'assisted' | 'hybrid' | 'tool';
    description: string;
    /** Payment address (i-address or R-address) → agent.payaddress */
    payAddress?: string;
    /** Network config → 3 flat keys (capabilities, endpoints, protocols) */
    network?: NetworkInput;
    /** Profile metadata → 4 flat keys (tags, website, avatar, category) */
    profile?: ProfileInput;
    session?: SessionInput;
    /** Platform config → platform.config */
    platformConfig?: PlatformConfigInput;
    /** Workspace capability → workspace.capability */
    workspaceCapability?: WorkspaceCapabilityInput;
    /** LLM models → agent.models (JSON array) */
    models?: string[];
    /** Pricing markup multiplier (1-50) → agent.markup */
    markup?: number;
}
/** Dispute resolution policy — published on-chain under service.dispute VDXF key */
export interface DisputePolicy {
    defaultAction: 'rework' | 'refund' | 'reject';
    maxRefundPercent: number;
    maxReworkCycles: number;
    reworkBudgetPercent: number;
    escalateAfter: 'max_rework' | '2nd_dispute' | 'never';
    systemCrashRefund: number;
}
/** Cost breakdown stored on-chain alongside service pricing */
export interface CostBreakdown {
    model: string;
    estimatedInputTokens: number;
    estimatedOutputTokens: number;
    rawCost: number;
    apiCalls: number;
    markup: number;
}
export interface ServiceInput {
    name: string;
    description?: string;
    category?: string;
    price?: number;
    currency?: string;
    turnaround?: string;
    paymentTerms?: 'prepay' | 'postpay' | 'split';
    privateMode?: boolean;
    sovguard?: boolean;
    acceptedCurrencies?: Array<{
        currency: string;
        price: number;
    }>;
    resolutionWindow?: number;
    refundPolicy?: {
        policy: 'fixed' | 'negotiable' | 'none';
        percent?: number;
    };
    costBreakdown?: CostBreakdown;
    status?: string;
    /** Service type: 'agent' (default) or 'api-endpoint' (raw API access) */
    serviceType?: 'agent' | 'api-endpoint';
    /** For api-endpoint: the backend URL buyers' requests are proxied to */
    endpointUrl?: string;
    /** For api-endpoint: per-model token pricing */
    modelPricing?: Array<{
        model: string;
        inputTokenRate: number;
        outputTokenRate: number;
    }>;
    /** For api-endpoint: rate limits per buyer */
    rateLimits?: {
        requestsPerMinute?: number;
        tokensPerMinute?: number;
    };
}
export interface FinalizeHooks {
    publishVdxf?: () => Promise<void>;
    verifyVdxf?: () => Promise<void>;
    waitForIndexed?: () => Promise<void>;
    prompt?: (question: string, defaultValue?: string) => Promise<string>;
}
export interface FinalizeOnboardingParams {
    agent: J41Agent;
    statePath: string;
    mode?: FinalizeMode;
    profile?: AgentProfileInput;
    services?: ServiceInput[];
    hooks?: FinalizeHooks;
}
export declare function finalizeOnboarding(params: FinalizeOnboardingParams): Promise<FinalizeState>;
//# sourceMappingURL=finalize.d.ts.map