import type { AgentProfile } from '@tangle-network/agent-interface';
import { ValidationError } from './errors';
export type AgentProfileCellSchemaVersion = 'agent-profile-cell/v1';
export type AgentProfileJson = string | number | boolean | null | AgentProfileJson[] | {
    [key: string]: AgentProfileJson;
};
export type AgentProfileDimensionValue = string | number | boolean | null;
export interface AgentProfileSource {
    /** Runtime/profile contract being fingerprinted, e.g. `agent-interface-profile`. */
    kind: string;
    /** sha256 over the canonical source profile object. */
    hash: string;
}
export interface AgentProfileSourceInput {
    kind: string;
    /** Precomputed sha256 for callers that already sign their profile artifact. */
    hash?: string;
    /** Full canonical runtime profile; hashed and then discarded from the cell. */
    profile?: AgentProfileJson;
}
export interface AgentProfileHarness {
    id: string;
    version?: string;
    hash?: string;
}
export interface AgentProfileCellInput {
    profileId: string;
    sourceProfile: AgentProfileSourceInput;
    harness?: AgentProfileHarness;
    model?: string;
    promptHash?: string;
    dimensions?: Record<string, AgentProfileDimensionValue>;
}
export interface AgentProfileCell {
    schemaVersion: AgentProfileCellSchemaVersion;
    cellId: string;
    profileId: string;
    sourceProfile: AgentProfileSource;
    harness?: AgentProfileHarness;
    model?: string;
    promptHash?: string;
    dimensions?: Record<string, AgentProfileDimensionValue>;
}
export declare class AgentProfileCellValidationError extends ValidationError {
    readonly path: string;
    constructor(message: string, path?: string);
}
export declare function buildAgentProfileCell(input: AgentProfileCellInput): Promise<AgentProfileCell>;
export declare function agentProfileCellHashMaterial(cell: AgentProfileCell): Omit<AgentProfileCell, 'cellId'>;
export declare function verifyAgentProfileCell(cell: AgentProfileCell): Promise<boolean>;
export declare function validateAgentProfileCell(input: unknown): AgentProfileCell;
export declare function requireAgentProfileCell(record: {
    runId: string;
    agentProfile?: AgentProfileCell;
}): AgentProfileCell;
export declare function agentProfileCellKey(record: {
    runId: string;
    agentProfile?: AgentProfileCell;
}): string;
export declare function assertRunAgentProfileCell(record: {
    runId: string;
    model: string;
    promptHash: string;
    agentProfile?: AgentProfileCell;
}): Promise<AgentProfileCell>;
export declare function groupRunsByAgentProfileCell<T extends {
    runId: string;
    agentProfile?: AgentProfileCell;
}>(records: readonly T[]): Map<string, T[]>;
/** Canonical `sourceProfile.kind` values. Two products fingerprinting the
 *  same canonical profile MUST use the same kind for their cells to share
 *  `sourceProfile.hash`. Extend rather than create new strings — adding a
 *  new kind is a deliberate cross-product schema change. */
export declare const AGENT_PROFILE_KINDS: {
    /** A profile declared via `defineAgentProfile(...)` from
     *  `@tangle-network/agent-interface`. The default kind for router-backed
     *  and sandbox-backed products. */
    readonly AGENT_INTERFACE_PROFILE: "agent-interface-profile";
};
export type AgentProfileKind = (typeof AGENT_PROFILE_KINDS)[keyof typeof AGENT_PROFILE_KINDS];
/** Canonicalize an arbitrary value into `AgentProfileJson` by JSON
 *  round-trip. Throws when the value contains anything not representable
 *  as JSON (functions, BigInt, cycles) — non-portable profiles fail loud
 *  rather than silently dropping fields. */
export declare function toAgentProfileJson(value: unknown): AgentProfileJson;
/** Canonical AgentProfile shape required when deriving a stable cell id. */
export type AgentInterfaceProfileLike = AgentProfile & {
    name: string;
    version: string;
};
/** Higher-level helper that hard-codes the canonical
 *  `agent-interface-profile` kind plus the JSON canonicalization. Equivalent
 *  to calling `buildAgentProfileCell` with `profileId = \`${name}@${version}\``
 *  and `sourceProfile = { kind: AGENT_INTERFACE_PROFILE, profile: <round-tripped> }`.
 *
 *  Use this from any product consuming an agent-interface `AgentProfile`; the
 *  manual `buildAgentProfileCell` call is reserved for advanced cases
 *  (custom kinds, pre-computed source hashes, alternate profileId
 *  conventions). */
export declare function buildAgentInterfaceProfileCell(profile: AgentInterfaceProfileLike, input: Omit<AgentProfileCellInput, 'profileId' | 'sourceProfile'>): Promise<AgentProfileCell>;
//# sourceMappingURL=agent-profile-cell.d.ts.map