/** * @fileoverview Agent Identity Types * * Defines comprehensive agent identity types combining CAR classification, * decentralized identifiers (DIDs), capabilities, and attestations into * a unified identity model. * * @module @vorionsys/contracts/car/identity */ import { z } from 'zod'; import { type DomainCode } from './domains.js'; import { CapabilityLevel } from './levels.js'; import { CertificationTier, RuntimeTier } from './tiers.js'; import { type Attestation } from './attestation.js'; import { type ParsedCAR } from './car-string.js'; import { type SkillCode } from './skills.js'; /** * Maximum tier elevation allowed under supervision. * * A supervised agent can operate at most 2 tiers above its own * certification tier, and never above (supervisorTier - 1). */ export declare const MAX_SUPERVISION_ELEVATION = 2; /** @deprecated Use ParsedCAR instead */ export type ParsedACI = ParsedCAR; /** @deprecated Use parsedCARSchema instead */ export declare const parsedACISchema: z.ZodObject<{ car: z.ZodString; registry: z.ZodString; organization: z.ZodString; agentClass: z.ZodString; domains: z.ZodArray, "many">; domainsBitmask: z.ZodNumber; level: z.ZodNativeEnum; version: z.ZodString; extensions: z.ZodDefault>; }, "strip", z.ZodTypeAny, { version: string; level: CapabilityLevel; registry: string; organization: string; agentClass: string; domains: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[]; domainsBitmask: number; car: string; extensions: string[]; }, { version: string; level: CapabilityLevel; registry: string; organization: string; agentClass: string; domains: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[]; domainsBitmask: number; car: string; extensions?: string[] | undefined; }>; /** @deprecated Use carStringSchema instead */ export declare const aciStringSchema: z.ZodEffects; /** * Capability vector for queries and comparisons. * * Represents a set of capability requirements or grants that can be * compared against other vectors for authorization decisions. */ /** * Capability vector describes what an agent CAN DO. * * NOTE: Trust/certification tier is NOT included here because: * - Trust is computed at runtime from attestations * - The CAR is an immutable identifier, not a trust indicator * - Same agent can have different trust in different deployments * * Skills use bitmask encoding for efficient matching (see skills.ts). */ export interface CapabilityVector { /** Required/granted domains */ domains: readonly DomainCode[]; /** Domain bitmask for efficient queries */ domainsBitmask?: number; /** Minimum level required/granted */ level: CapabilityLevel; /** Optional skill codes for fine-grained matching */ skills?: readonly SkillCode[]; /** Skill bitmask for efficient queries */ skillsBitmask?: number; } /** * Zod schema for CapabilityVector validation. */ export declare const capabilityVectorSchema: z.ZodObject<{ domains: z.ZodArray, "many">; domainsBitmask: z.ZodOptional; level: z.ZodNativeEnum; skills: z.ZodOptional, "many">>; skillsBitmask: z.ZodOptional; }, "strip", z.ZodTypeAny, { level: CapabilityLevel; domains: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[]; skills?: ("TG" | "CW" | "CR" | "TD" | "TR" | "SM" | "DA" | "RS" | "QA" | "CA" | "DV" | "RV" | "WS" | "FO" | "AI" | "PL" | "CM" | "CS" | "AU" | "SC" | "GV")[] | undefined; domainsBitmask?: number | undefined; skillsBitmask?: number | undefined; }, { level: CapabilityLevel; domains: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[]; skills?: ("TG" | "CW" | "CR" | "TD" | "TR" | "SM" | "DA" | "RS" | "QA" | "CA" | "DV" | "RV" | "WS" | "FO" | "AI" | "PL" | "CM" | "CS" | "AU" | "SC" | "GV")[] | undefined; domainsBitmask?: number | undefined; skillsBitmask?: number | undefined; }>; /** * Metadata about an agent. */ export interface AgentMetadata { /** Human-readable description */ description?: string; /** Agent software version */ version?: string; /** Contact information (email, URL) */ contact?: string; /** Documentation URL */ documentation?: string; /** Support URL */ support?: string; /** Terms of service URL */ termsOfService?: string; /** Privacy policy URL */ privacyPolicy?: string; /** Organization name */ organization?: string; /** Organization logo URL */ logo?: string; /** Additional custom properties */ [key: string]: string | undefined; } /** * Zod schema for AgentMetadata validation. */ export declare const agentMetadataSchema: z.ZodObject<{ description: z.ZodOptional; version: z.ZodOptional; contact: z.ZodOptional; documentation: z.ZodOptional; support: z.ZodOptional; termsOfService: z.ZodOptional; privacyPolicy: z.ZodOptional; organization: z.ZodOptional; logo: z.ZodOptional; }, "strip", z.ZodOptional, z.objectOutputType<{ description: z.ZodOptional; version: z.ZodOptional; contact: z.ZodOptional; documentation: z.ZodOptional; support: z.ZodOptional; termsOfService: z.ZodOptional; privacyPolicy: z.ZodOptional; organization: z.ZodOptional; logo: z.ZodOptional; }, z.ZodOptional, "strip">, z.objectInputType<{ description: z.ZodOptional; version: z.ZodOptional; contact: z.ZodOptional; documentation: z.ZodOptional; support: z.ZodOptional; termsOfService: z.ZodOptional; privacyPolicy: z.ZodOptional; organization: z.ZodOptional; logo: z.ZodOptional; }, z.ZodOptional, "strip">>; /** * Context for supervised agent operations. * * When an agent operates under the supervision of a higher-tier agent, * it may be granted temporary tier elevation. The elevation is capped at * +2 tiers (MAX_SUPERVISION_ELEVATION) and can never exceed * (supervisor's tier - 1). */ export interface SupervisionContext { /** CAR string of the supervising agent */ supervisorCAR: string; /** DID of the supervising agent */ supervisorDID: string; /** Certification tier of the supervisor (determines elevation cap) */ supervisorTier: CertificationTier; /** Number of tiers to elevate (0 to MAX_SUPERVISION_ELEVATION) */ elevationTiers: number; /** When supervision was granted */ grantedAt: Date; /** When supervision expires */ expiresAt: Date; /** Heartbeat interval in milliseconds (0 = no heartbeat required) */ heartbeatIntervalMs: number; /** Last heartbeat timestamp (if heartbeat required) */ lastHeartbeat?: Date; /** Supervision scope description */ scope?: string; } /** * Zod schema for SupervisionContext validation. */ export declare const supervisionContextSchema: z.ZodObject<{ supervisorCAR: z.ZodEffects; supervisorDID: z.ZodString; supervisorTier: z.ZodNativeEnum; elevationTiers: z.ZodNumber; grantedAt: z.ZodDate; expiresAt: z.ZodDate; heartbeatIntervalMs: z.ZodNumber; lastHeartbeat: z.ZodOptional; scope: z.ZodOptional; }, "strip", z.ZodTypeAny, { expiresAt: Date; grantedAt: Date; supervisorCAR: string; supervisorDID: string; supervisorTier: CertificationTier; elevationTiers: number; heartbeatIntervalMs: number; scope?: string | undefined; lastHeartbeat?: Date | undefined; }, { expiresAt: Date; grantedAt: Date; supervisorCAR: string; supervisorDID: string; supervisorTier: CertificationTier; elevationTiers: number; heartbeatIntervalMs: number; scope?: string | undefined; lastHeartbeat?: Date | undefined; }>; /** * Checks if a supervision context is currently active (not expired, heartbeat OK). * * @param ctx - Supervision context to check * @returns True if supervision is active */ export declare function isSupervisionActive(ctx: SupervisionContext): boolean; /** * Calculates the effective supervised tier for an agent. * * The supervised tier is: min(baseTier + elevation, supervisorTier - 1, T7) * * @param baseTier - Agent's own certification tier * @param supervision - Active supervision context * @returns Effective tier under supervision (or baseTier if supervision inactive) */ export declare function calculateSupervisedTier(baseTier: CertificationTier, supervision: SupervisionContext): CertificationTier; /** * Validates whether a supervision elevation request is valid. * * @param supervisorTier - Supervisor's certification tier * @param subjectTier - Subject agent's certification tier * @param requestedElevation - Requested tier elevation (0-2) * @returns Validation result with reason if invalid */ export declare function validateSupervisionElevation(supervisorTier: CertificationTier, subjectTier: CertificationTier, requestedElevation: number): { valid: boolean; reason?: string; effectiveTier?: CertificationTier; }; /** * Optional references to other CARs that aren't resolved at creation time. * * These are "floating" because they can be set after identity creation * and may point to CARs that don't exist yet or are in other registries. */ export interface FloatingCARReferences { /** CAR of the supervising agent (if under supervision) */ supervisorCAR?: string; /** CAR of the parent agent (if this is a child/sub-agent) */ parentCAR?: string; /** CARs of agents this agent has delegated to */ delegatedCARs?: string[]; /** CARs of related agents (peers, collaborators) */ relatedCARs?: string[]; } /** * Zod schema for FloatingCARReferences validation. */ export declare const floatingCARReferencesSchema: z.ZodObject<{ supervisorCAR: z.ZodOptional>; parentCAR: z.ZodOptional>; delegatedCARs: z.ZodOptional, "many">>; relatedCARs: z.ZodOptional, "many">>; }, "strip", z.ZodTypeAny, { supervisorCAR?: string | undefined; parentCAR?: string | undefined; delegatedCARs?: string[] | undefined; relatedCARs?: string[] | undefined; }, { supervisorCAR?: string | undefined; parentCAR?: string | undefined; delegatedCARs?: string[] | undefined; relatedCARs?: string[] | undefined; }>; /** * Verification method in a DID document. */ export interface VerificationMethod { /** Verification method ID */ id: string; /** Type of verification method */ type: string; /** Controller DID */ controller: string; /** Public key in JWK format */ publicKeyJwk?: Record; /** Public key in multibase format */ publicKeyMultibase?: string; } /** * Service endpoint in a DID document. */ export interface ServiceEndpoint { /** Service ID */ id: string; /** Service type */ type: string; /** Service endpoint URL */ serviceEndpoint: string; /** Additional service properties */ [key: string]: unknown; } /** * Zod schema for VerificationMethod. */ export declare const verificationMethodSchema: z.ZodObject<{ id: z.ZodString; type: z.ZodString; controller: z.ZodString; publicKeyJwk: z.ZodOptional>; publicKeyMultibase: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: string; id: string; controller: string; publicKeyJwk?: Record | undefined; publicKeyMultibase?: string | undefined; }, { type: string; id: string; controller: string; publicKeyJwk?: Record | undefined; publicKeyMultibase?: string | undefined; }>; /** * Zod schema for ServiceEndpoint. */ export declare const serviceEndpointSchema: z.ZodObject<{ id: z.ZodString; type: z.ZodString; serviceEndpoint: z.ZodString; }, "strip", z.ZodUnknown, z.objectOutputType<{ id: z.ZodString; type: z.ZodString; serviceEndpoint: z.ZodString; }, z.ZodUnknown, "strip">, z.objectInputType<{ id: z.ZodString; type: z.ZodString; serviceEndpoint: z.ZodString; }, z.ZodUnknown, "strip">>; /** * Full agent identity combining CAR, DID, and capabilities. * * This is the comprehensive identity structure for an agent in the system, * containing all information needed for authentication, authorization, * and capability verification. */ export interface AgentIdentity { /** Full CAR string */ car: string; /** @deprecated Use car instead */ carId?: string; /** Parsed CAR components */ parsedCAR?: ParsedCAR; /** @deprecated Use parsedCAR instead */ parsedCarId?: ParsedCAR; /** Agent DID (Decentralized Identifier) */ did: string; /** Capability vector */ capabilities: CapabilityVector; /** Active attestations */ attestations: Attestation[]; /** Service endpoint URL for agent communication */ serviceEndpoint?: string; /** Additional service endpoints */ services?: ServiceEndpoint[]; /** Verification methods */ verificationMethods?: VerificationMethod[]; /** Agent metadata */ metadata?: AgentMetadata; /** Runtime tier in current deployment */ runtimeTier?: RuntimeTier; /** Active supervision context (if operating under a supervisor) */ supervision?: SupervisionContext; /** Floating references to other CAR identities */ floatingReferences?: FloatingCARReferences; /** Creation timestamp */ created: Date; /** Last update timestamp */ updated: Date; /** Whether the identity is currently active */ active: boolean; } /** * Zod schema for AgentIdentity validation. */ export declare const agentIdentitySchema: z.ZodObject<{ car: z.ZodEffects; carId: z.ZodOptional>; parsedCAR: z.ZodOptional, "many">; domainsBitmask: z.ZodNumber; level: z.ZodNativeEnum; version: z.ZodString; extensions: z.ZodDefault>; }, "strip", z.ZodTypeAny, { version: string; level: CapabilityLevel; registry: string; organization: string; agentClass: string; domains: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[]; domainsBitmask: number; car: string; extensions: string[]; }, { version: string; level: CapabilityLevel; registry: string; organization: string; agentClass: string; domains: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[]; domainsBitmask: number; car: string; extensions?: string[] | undefined; }>>; parsedCarId: z.ZodOptional, "many">; domainsBitmask: z.ZodNumber; level: z.ZodNativeEnum; version: z.ZodString; extensions: z.ZodDefault>; }, "strip", z.ZodTypeAny, { version: string; level: CapabilityLevel; registry: string; organization: string; agentClass: string; domains: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[]; domainsBitmask: number; car: string; extensions: string[]; }, { version: string; level: CapabilityLevel; registry: string; organization: string; agentClass: string; domains: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[]; domainsBitmask: number; car: string; extensions?: string[] | undefined; }>>; did: z.ZodString; capabilities: z.ZodObject<{ domains: z.ZodArray, "many">; domainsBitmask: z.ZodOptional; level: z.ZodNativeEnum; skills: z.ZodOptional, "many">>; skillsBitmask: z.ZodOptional; }, "strip", z.ZodTypeAny, { level: CapabilityLevel; domains: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[]; skills?: ("TG" | "CW" | "CR" | "TD" | "TR" | "SM" | "DA" | "RS" | "QA" | "CA" | "DV" | "RV" | "WS" | "FO" | "AI" | "PL" | "CM" | "CS" | "AU" | "SC" | "GV")[] | undefined; domainsBitmask?: number | undefined; skillsBitmask?: number | undefined; }, { level: CapabilityLevel; domains: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[]; skills?: ("TG" | "CW" | "CR" | "TD" | "TR" | "SM" | "DA" | "RS" | "QA" | "CA" | "DV" | "RV" | "WS" | "FO" | "AI" | "PL" | "CM" | "CS" | "AU" | "SC" | "GV")[] | undefined; domainsBitmask?: number | undefined; skillsBitmask?: number | undefined; }>; attestations: z.ZodArray; certificationTier: z.ZodNativeEnum; domains: z.ZodOptional, "many">>; issuedAt: z.ZodDate; expiresAt: z.ZodDate; status: z.ZodEnum<["active", "expired", "revoked", "suspended", "pending"]>; evidence: z.ZodOptional; auditReport: z.ZodOptional; trainingVerification: z.ZodOptional; complianceDocumentation: z.ZodOptional; }, "strip", z.ZodOptional, z.objectOutputType<{ testResults: z.ZodOptional; auditReport: z.ZodOptional; trainingVerification: z.ZodOptional; complianceDocumentation: z.ZodOptional; }, z.ZodOptional, "strip">, z.objectInputType<{ testResults: z.ZodOptional; auditReport: z.ZodOptional; trainingVerification: z.ZodOptional; complianceDocumentation: z.ZodOptional; }, z.ZodOptional, "strip">>>; proof: z.ZodOptional; challenge: z.ZodOptional; domain: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: string; created: string; verificationMethod: string; proofPurpose: string; jws: string; nonce?: string | undefined; domain?: string | undefined; challenge?: string | undefined; }, { type: string; created: string; verificationMethod: string; proofPurpose: string; jws: string; nonce?: string | undefined; domain?: string | undefined; challenge?: string | undefined; }>>; metadata: z.ZodOptional>; }, "strip", z.ZodTypeAny, { id: string; status: "active" | "suspended" | "pending" | "revoked" | "expired"; expiresAt: Date; scope: "security" | "full" | "training" | "domain" | "compliance" | "level" | "identity" | "supervision"; issuedAt: Date; issuer: string; subject: string; certificationTier: CertificationTier; proof?: { type: string; created: string; verificationMethod: string; proofPurpose: string; jws: string; nonce?: string | undefined; domain?: string | undefined; challenge?: string | undefined; } | undefined; metadata?: Record | undefined; domains?: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[] | undefined; evidence?: z.objectOutputType<{ testResults: z.ZodOptional; auditReport: z.ZodOptional; trainingVerification: z.ZodOptional; complianceDocumentation: z.ZodOptional; }, z.ZodOptional, "strip"> | undefined; }, { id: string; status: "active" | "suspended" | "pending" | "revoked" | "expired"; expiresAt: Date; scope: "security" | "full" | "training" | "domain" | "compliance" | "level" | "identity" | "supervision"; issuedAt: Date; issuer: string; subject: string; certificationTier: CertificationTier; proof?: { type: string; created: string; verificationMethod: string; proofPurpose: string; jws: string; nonce?: string | undefined; domain?: string | undefined; challenge?: string | undefined; } | undefined; metadata?: Record | undefined; domains?: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[] | undefined; evidence?: z.objectInputType<{ testResults: z.ZodOptional; auditReport: z.ZodOptional; trainingVerification: z.ZodOptional; complianceDocumentation: z.ZodOptional; }, z.ZodOptional, "strip"> | undefined; }>, "many">; serviceEndpoint: z.ZodOptional; services: z.ZodOptional, z.objectInputType<{ id: z.ZodString; type: z.ZodString; serviceEndpoint: z.ZodString; }, z.ZodUnknown, "strip">>, "many">>; verificationMethods: z.ZodOptional>; publicKeyMultibase: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: string; id: string; controller: string; publicKeyJwk?: Record | undefined; publicKeyMultibase?: string | undefined; }, { type: string; id: string; controller: string; publicKeyJwk?: Record | undefined; publicKeyMultibase?: string | undefined; }>, "many">>; metadata: z.ZodOptional; version: z.ZodOptional; contact: z.ZodOptional; documentation: z.ZodOptional; support: z.ZodOptional; termsOfService: z.ZodOptional; privacyPolicy: z.ZodOptional; organization: z.ZodOptional; logo: z.ZodOptional; }, "strip", z.ZodOptional, z.objectOutputType<{ description: z.ZodOptional; version: z.ZodOptional; contact: z.ZodOptional; documentation: z.ZodOptional; support: z.ZodOptional; termsOfService: z.ZodOptional; privacyPolicy: z.ZodOptional; organization: z.ZodOptional; logo: z.ZodOptional; }, z.ZodOptional, "strip">, z.objectInputType<{ description: z.ZodOptional; version: z.ZodOptional; contact: z.ZodOptional; documentation: z.ZodOptional; support: z.ZodOptional; termsOfService: z.ZodOptional; privacyPolicy: z.ZodOptional; organization: z.ZodOptional; logo: z.ZodOptional; }, z.ZodOptional, "strip">>>; runtimeTier: z.ZodOptional>; supervision: z.ZodOptional; supervisorDID: z.ZodString; supervisorTier: z.ZodNativeEnum; elevationTiers: z.ZodNumber; grantedAt: z.ZodDate; expiresAt: z.ZodDate; heartbeatIntervalMs: z.ZodNumber; lastHeartbeat: z.ZodOptional; scope: z.ZodOptional; }, "strip", z.ZodTypeAny, { expiresAt: Date; grantedAt: Date; supervisorCAR: string; supervisorDID: string; supervisorTier: CertificationTier; elevationTiers: number; heartbeatIntervalMs: number; scope?: string | undefined; lastHeartbeat?: Date | undefined; }, { expiresAt: Date; grantedAt: Date; supervisorCAR: string; supervisorDID: string; supervisorTier: CertificationTier; elevationTiers: number; heartbeatIntervalMs: number; scope?: string | undefined; lastHeartbeat?: Date | undefined; }>>; floatingReferences: z.ZodOptional>; parentCAR: z.ZodOptional>; delegatedCARs: z.ZodOptional, "many">>; relatedCARs: z.ZodOptional, "many">>; }, "strip", z.ZodTypeAny, { supervisorCAR?: string | undefined; parentCAR?: string | undefined; delegatedCARs?: string[] | undefined; relatedCARs?: string[] | undefined; }, { supervisorCAR?: string | undefined; parentCAR?: string | undefined; delegatedCARs?: string[] | undefined; relatedCARs?: string[] | undefined; }>>; created: z.ZodDate; updated: z.ZodDate; active: z.ZodBoolean; }, "strip", z.ZodTypeAny, { active: boolean; capabilities: { level: CapabilityLevel; domains: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[]; skills?: ("TG" | "CW" | "CR" | "TD" | "TR" | "SM" | "DA" | "RS" | "QA" | "CA" | "DV" | "RV" | "WS" | "FO" | "AI" | "PL" | "CM" | "CS" | "AU" | "SC" | "GV")[] | undefined; domainsBitmask?: number | undefined; skillsBitmask?: number | undefined; }; attestations: { id: string; status: "active" | "suspended" | "pending" | "revoked" | "expired"; expiresAt: Date; scope: "security" | "full" | "training" | "domain" | "compliance" | "level" | "identity" | "supervision"; issuedAt: Date; issuer: string; subject: string; certificationTier: CertificationTier; proof?: { type: string; created: string; verificationMethod: string; proofPurpose: string; jws: string; nonce?: string | undefined; domain?: string | undefined; challenge?: string | undefined; } | undefined; metadata?: Record | undefined; domains?: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[] | undefined; evidence?: z.objectOutputType<{ testResults: z.ZodOptional; auditReport: z.ZodOptional; trainingVerification: z.ZodOptional; complianceDocumentation: z.ZodOptional; }, z.ZodOptional, "strip"> | undefined; }[]; created: Date; updated: Date; car: string; did: string; metadata?: z.objectOutputType<{ description: z.ZodOptional; version: z.ZodOptional; contact: z.ZodOptional; documentation: z.ZodOptional; support: z.ZodOptional; termsOfService: z.ZodOptional; privacyPolicy: z.ZodOptional; organization: z.ZodOptional; logo: z.ZodOptional; }, z.ZodOptional, "strip"> | undefined; carId?: string | undefined; supervision?: { expiresAt: Date; grantedAt: Date; supervisorCAR: string; supervisorDID: string; supervisorTier: CertificationTier; elevationTiers: number; heartbeatIntervalMs: number; scope?: string | undefined; lastHeartbeat?: Date | undefined; } | undefined; serviceEndpoint?: string | undefined; parsedCAR?: { version: string; level: CapabilityLevel; registry: string; organization: string; agentClass: string; domains: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[]; domainsBitmask: number; car: string; extensions: string[]; } | undefined; parsedCarId?: { version: string; level: CapabilityLevel; registry: string; organization: string; agentClass: string; domains: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[]; domainsBitmask: number; car: string; extensions: string[]; } | undefined; services?: z.objectOutputType<{ id: z.ZodString; type: z.ZodString; serviceEndpoint: z.ZodString; }, z.ZodUnknown, "strip">[] | undefined; verificationMethods?: { type: string; id: string; controller: string; publicKeyJwk?: Record | undefined; publicKeyMultibase?: string | undefined; }[] | undefined; runtimeTier?: RuntimeTier | undefined; floatingReferences?: { supervisorCAR?: string | undefined; parentCAR?: string | undefined; delegatedCARs?: string[] | undefined; relatedCARs?: string[] | undefined; } | undefined; }, { active: boolean; capabilities: { level: CapabilityLevel; domains: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[]; skills?: ("TG" | "CW" | "CR" | "TD" | "TR" | "SM" | "DA" | "RS" | "QA" | "CA" | "DV" | "RV" | "WS" | "FO" | "AI" | "PL" | "CM" | "CS" | "AU" | "SC" | "GV")[] | undefined; domainsBitmask?: number | undefined; skillsBitmask?: number | undefined; }; attestations: { id: string; status: "active" | "suspended" | "pending" | "revoked" | "expired"; expiresAt: Date; scope: "security" | "full" | "training" | "domain" | "compliance" | "level" | "identity" | "supervision"; issuedAt: Date; issuer: string; subject: string; certificationTier: CertificationTier; proof?: { type: string; created: string; verificationMethod: string; proofPurpose: string; jws: string; nonce?: string | undefined; domain?: string | undefined; challenge?: string | undefined; } | undefined; metadata?: Record | undefined; domains?: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[] | undefined; evidence?: z.objectInputType<{ testResults: z.ZodOptional; auditReport: z.ZodOptional; trainingVerification: z.ZodOptional; complianceDocumentation: z.ZodOptional; }, z.ZodOptional, "strip"> | undefined; }[]; created: Date; updated: Date; car: string; did: string; metadata?: z.objectInputType<{ description: z.ZodOptional; version: z.ZodOptional; contact: z.ZodOptional; documentation: z.ZodOptional; support: z.ZodOptional; termsOfService: z.ZodOptional; privacyPolicy: z.ZodOptional; organization: z.ZodOptional; logo: z.ZodOptional; }, z.ZodOptional, "strip"> | undefined; carId?: string | undefined; supervision?: { expiresAt: Date; grantedAt: Date; supervisorCAR: string; supervisorDID: string; supervisorTier: CertificationTier; elevationTiers: number; heartbeatIntervalMs: number; scope?: string | undefined; lastHeartbeat?: Date | undefined; } | undefined; serviceEndpoint?: string | undefined; parsedCAR?: { version: string; level: CapabilityLevel; registry: string; organization: string; agentClass: string; domains: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[]; domainsBitmask: number; car: string; extensions?: string[] | undefined; } | undefined; parsedCarId?: { version: string; level: CapabilityLevel; registry: string; organization: string; agentClass: string; domains: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[]; domainsBitmask: number; car: string; extensions?: string[] | undefined; } | undefined; services?: z.objectInputType<{ id: z.ZodString; type: z.ZodString; serviceEndpoint: z.ZodString; }, z.ZodUnknown, "strip">[] | undefined; verificationMethods?: { type: string; id: string; controller: string; publicKeyJwk?: Record | undefined; publicKeyMultibase?: string | undefined; }[] | undefined; runtimeTier?: RuntimeTier | undefined; floatingReferences?: { supervisorCAR?: string | undefined; parentCAR?: string | undefined; delegatedCARs?: string[] | undefined; relatedCARs?: string[] | undefined; } | undefined; }>; /** * Lightweight summary of an agent identity. * * Used for listings, search results, and contexts where the full * identity is not needed. */ /** * Summarized agent identity for quick lookups. * * NOTE: certificationTier is OPTIONAL because it comes from attestations, * not the CAR. Use getHighestAttestationTier() to compute it. */ export interface AgentIdentitySummary { /** Full CAR string */ car: string; /** @deprecated Use car instead */ carId?: string; /** Agent DID */ did: string; /** Capability domains */ domains: readonly DomainCode[]; /** Capability level */ level: CapabilityLevel; /** * Certification tier from attestations (optional). * Compute from valid attestations; defaults to T0 if none. */ certificationTier?: CertificationTier; /** Runtime tier (if available) */ runtimeTier?: RuntimeTier; /** Agent name/description */ name?: string; /** Whether the agent is active */ active: boolean; } /** * Zod schema for AgentIdentitySummary. */ export declare const agentIdentitySummarySchema: z.ZodObject<{ car: z.ZodEffects; carId: z.ZodOptional>; did: z.ZodString; domains: z.ZodArray, "many">; level: z.ZodNativeEnum; certificationTier: z.ZodOptional>; runtimeTier: z.ZodOptional>; name: z.ZodOptional; active: z.ZodBoolean; }, "strip", z.ZodTypeAny, { active: boolean; level: CapabilityLevel; domains: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[]; car: string; did: string; name?: string | undefined; carId?: string | undefined; certificationTier?: CertificationTier | undefined; runtimeTier?: RuntimeTier | undefined; }, { active: boolean; level: CapabilityLevel; domains: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[]; car: string; did: string; name?: string | undefined; carId?: string | undefined; certificationTier?: CertificationTier | undefined; runtimeTier?: RuntimeTier | undefined; }>; /** * Options for registering a new agent identity. */ export interface AgentRegistrationOptions { /** CAR string or components */ car: string; /** @deprecated Use car instead */ carId?: string; /** Agent DID */ did: string; /** Service endpoint URL */ serviceEndpoint?: string; /** Additional services */ services?: ServiceEndpoint[]; /** Verification methods */ verificationMethods?: VerificationMethod[]; /** Agent metadata */ metadata?: AgentMetadata; /** Initial attestations */ attestations?: Attestation[]; } /** * Zod schema for AgentRegistrationOptions. */ export declare const agentRegistrationOptionsSchema: z.ZodObject<{ car: z.ZodEffects; carId: z.ZodOptional>; did: z.ZodString; serviceEndpoint: z.ZodOptional; services: z.ZodOptional, z.objectInputType<{ id: z.ZodString; type: z.ZodString; serviceEndpoint: z.ZodString; }, z.ZodUnknown, "strip">>, "many">>; verificationMethods: z.ZodOptional>; publicKeyMultibase: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: string; id: string; controller: string; publicKeyJwk?: Record | undefined; publicKeyMultibase?: string | undefined; }, { type: string; id: string; controller: string; publicKeyJwk?: Record | undefined; publicKeyMultibase?: string | undefined; }>, "many">>; metadata: z.ZodOptional; version: z.ZodOptional; contact: z.ZodOptional; documentation: z.ZodOptional; support: z.ZodOptional; termsOfService: z.ZodOptional; privacyPolicy: z.ZodOptional; organization: z.ZodOptional; logo: z.ZodOptional; }, "strip", z.ZodOptional, z.objectOutputType<{ description: z.ZodOptional; version: z.ZodOptional; contact: z.ZodOptional; documentation: z.ZodOptional; support: z.ZodOptional; termsOfService: z.ZodOptional; privacyPolicy: z.ZodOptional; organization: z.ZodOptional; logo: z.ZodOptional; }, z.ZodOptional, "strip">, z.objectInputType<{ description: z.ZodOptional; version: z.ZodOptional; contact: z.ZodOptional; documentation: z.ZodOptional; support: z.ZodOptional; termsOfService: z.ZodOptional; privacyPolicy: z.ZodOptional; organization: z.ZodOptional; logo: z.ZodOptional; }, z.ZodOptional, "strip">>>; attestations: z.ZodOptional; certificationTier: z.ZodNativeEnum; domains: z.ZodOptional, "many">>; issuedAt: z.ZodDate; expiresAt: z.ZodDate; status: z.ZodEnum<["active", "expired", "revoked", "suspended", "pending"]>; evidence: z.ZodOptional; auditReport: z.ZodOptional; trainingVerification: z.ZodOptional; complianceDocumentation: z.ZodOptional; }, "strip", z.ZodOptional, z.objectOutputType<{ testResults: z.ZodOptional; auditReport: z.ZodOptional; trainingVerification: z.ZodOptional; complianceDocumentation: z.ZodOptional; }, z.ZodOptional, "strip">, z.objectInputType<{ testResults: z.ZodOptional; auditReport: z.ZodOptional; trainingVerification: z.ZodOptional; complianceDocumentation: z.ZodOptional; }, z.ZodOptional, "strip">>>; proof: z.ZodOptional; challenge: z.ZodOptional; domain: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: string; created: string; verificationMethod: string; proofPurpose: string; jws: string; nonce?: string | undefined; domain?: string | undefined; challenge?: string | undefined; }, { type: string; created: string; verificationMethod: string; proofPurpose: string; jws: string; nonce?: string | undefined; domain?: string | undefined; challenge?: string | undefined; }>>; metadata: z.ZodOptional>; }, "strip", z.ZodTypeAny, { id: string; status: "active" | "suspended" | "pending" | "revoked" | "expired"; expiresAt: Date; scope: "security" | "full" | "training" | "domain" | "compliance" | "level" | "identity" | "supervision"; issuedAt: Date; issuer: string; subject: string; certificationTier: CertificationTier; proof?: { type: string; created: string; verificationMethod: string; proofPurpose: string; jws: string; nonce?: string | undefined; domain?: string | undefined; challenge?: string | undefined; } | undefined; metadata?: Record | undefined; domains?: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[] | undefined; evidence?: z.objectOutputType<{ testResults: z.ZodOptional; auditReport: z.ZodOptional; trainingVerification: z.ZodOptional; complianceDocumentation: z.ZodOptional; }, z.ZodOptional, "strip"> | undefined; }, { id: string; status: "active" | "suspended" | "pending" | "revoked" | "expired"; expiresAt: Date; scope: "security" | "full" | "training" | "domain" | "compliance" | "level" | "identity" | "supervision"; issuedAt: Date; issuer: string; subject: string; certificationTier: CertificationTier; proof?: { type: string; created: string; verificationMethod: string; proofPurpose: string; jws: string; nonce?: string | undefined; domain?: string | undefined; challenge?: string | undefined; } | undefined; metadata?: Record | undefined; domains?: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[] | undefined; evidence?: z.objectInputType<{ testResults: z.ZodOptional; auditReport: z.ZodOptional; trainingVerification: z.ZodOptional; complianceDocumentation: z.ZodOptional; }, z.ZodOptional, "strip"> | undefined; }>, "many">>; }, "strip", z.ZodTypeAny, { car: string; did: string; metadata?: z.objectOutputType<{ description: z.ZodOptional; version: z.ZodOptional; contact: z.ZodOptional; documentation: z.ZodOptional; support: z.ZodOptional; termsOfService: z.ZodOptional; privacyPolicy: z.ZodOptional; organization: z.ZodOptional; logo: z.ZodOptional; }, z.ZodOptional, "strip"> | undefined; carId?: string | undefined; attestations?: { id: string; status: "active" | "suspended" | "pending" | "revoked" | "expired"; expiresAt: Date; scope: "security" | "full" | "training" | "domain" | "compliance" | "level" | "identity" | "supervision"; issuedAt: Date; issuer: string; subject: string; certificationTier: CertificationTier; proof?: { type: string; created: string; verificationMethod: string; proofPurpose: string; jws: string; nonce?: string | undefined; domain?: string | undefined; challenge?: string | undefined; } | undefined; metadata?: Record | undefined; domains?: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[] | undefined; evidence?: z.objectOutputType<{ testResults: z.ZodOptional; auditReport: z.ZodOptional; trainingVerification: z.ZodOptional; complianceDocumentation: z.ZodOptional; }, z.ZodOptional, "strip"> | undefined; }[] | undefined; serviceEndpoint?: string | undefined; services?: z.objectOutputType<{ id: z.ZodString; type: z.ZodString; serviceEndpoint: z.ZodString; }, z.ZodUnknown, "strip">[] | undefined; verificationMethods?: { type: string; id: string; controller: string; publicKeyJwk?: Record | undefined; publicKeyMultibase?: string | undefined; }[] | undefined; }, { car: string; did: string; metadata?: z.objectInputType<{ description: z.ZodOptional; version: z.ZodOptional; contact: z.ZodOptional; documentation: z.ZodOptional; support: z.ZodOptional; termsOfService: z.ZodOptional; privacyPolicy: z.ZodOptional; organization: z.ZodOptional; logo: z.ZodOptional; }, z.ZodOptional, "strip"> | undefined; carId?: string | undefined; attestations?: { id: string; status: "active" | "suspended" | "pending" | "revoked" | "expired"; expiresAt: Date; scope: "security" | "full" | "training" | "domain" | "compliance" | "level" | "identity" | "supervision"; issuedAt: Date; issuer: string; subject: string; certificationTier: CertificationTier; proof?: { type: string; created: string; verificationMethod: string; proofPurpose: string; jws: string; nonce?: string | undefined; domain?: string | undefined; challenge?: string | undefined; } | undefined; metadata?: Record | undefined; domains?: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[] | undefined; evidence?: z.objectInputType<{ testResults: z.ZodOptional; auditReport: z.ZodOptional; trainingVerification: z.ZodOptional; complianceDocumentation: z.ZodOptional; }, z.ZodOptional, "strip"> | undefined; }[] | undefined; serviceEndpoint?: string | undefined; services?: z.objectInputType<{ id: z.ZodString; type: z.ZodString; serviceEndpoint: z.ZodString; }, z.ZodUnknown, "strip">[] | undefined; verificationMethods?: { type: string; id: string; controller: string; publicKeyJwk?: Record | undefined; publicKeyMultibase?: string | undefined; }[] | undefined; }>; /** * Criteria for matching agent identities. */ export interface AgentMatchCriteria { /** Required domains (all must be present) */ requiredDomains?: readonly DomainCode[]; /** Minimum capability level */ minLevel?: CapabilityLevel; /** Minimum certification tier */ minCertificationTier?: CertificationTier; /** Minimum runtime tier */ minRuntimeTier?: RuntimeTier; /** Required skills (all must be present) */ requiredSkills?: readonly SkillCode[]; /** Must be active */ mustBeActive?: boolean; /** Must have valid attestations */ mustHaveValidAttestations?: boolean; /** Organization filter */ organization?: string; /** Registry filter */ registry?: string; } /** * Zod schema for AgentMatchCriteria. */ export declare const agentMatchCriteriaSchema: z.ZodObject<{ requiredDomains: z.ZodOptional, "many">>; minLevel: z.ZodOptional>; minCertificationTier: z.ZodOptional>; minRuntimeTier: z.ZodOptional>; requiredSkills: z.ZodOptional, "many">>; mustBeActive: z.ZodOptional; mustHaveValidAttestations: z.ZodOptional; organization: z.ZodOptional; registry: z.ZodOptional; }, "strip", z.ZodTypeAny, { registry?: string | undefined; organization?: string | undefined; minCertificationTier?: CertificationTier | undefined; requiredDomains?: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[] | undefined; minLevel?: CapabilityLevel | undefined; minRuntimeTier?: RuntimeTier | undefined; requiredSkills?: ("TG" | "CW" | "CR" | "TD" | "TR" | "SM" | "DA" | "RS" | "QA" | "CA" | "DV" | "RV" | "WS" | "FO" | "AI" | "PL" | "CM" | "CS" | "AU" | "SC" | "GV")[] | undefined; mustBeActive?: boolean | undefined; mustHaveValidAttestations?: boolean | undefined; }, { registry?: string | undefined; organization?: string | undefined; minCertificationTier?: CertificationTier | undefined; requiredDomains?: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z")[] | undefined; minLevel?: CapabilityLevel | undefined; minRuntimeTier?: RuntimeTier | undefined; requiredSkills?: ("TG" | "CW" | "CR" | "TD" | "TR" | "SM" | "DA" | "RS" | "QA" | "CA" | "DV" | "RV" | "WS" | "FO" | "AI" | "PL" | "CM" | "CS" | "AU" | "SC" | "GV")[] | undefined; mustBeActive?: boolean | undefined; mustHaveValidAttestations?: boolean | undefined; }>; /** * Creates an agent identity from registration options. * * @param options - Registration options * @param parsedCAR - Pre-parsed CAR (optional) * @returns New agent identity */ export declare function createAgentIdentity(options: AgentRegistrationOptions, parsedCAR?: ParsedCAR): AgentIdentity; /** * Creates a summary from a full agent identity. * * @param identity - Full agent identity * @returns Agent identity summary */ /** * Converts an AgentIdentity to a summary view. * * @param identity - Full agent identity * @returns Summarized view */ export declare function toAgentIdentitySummary(identity: AgentIdentity): AgentIdentitySummary; /** * Checks if an agent identity matches given criteria. * * @param identity - Agent identity to check * @param criteria - Matching criteria * @returns True if the identity matches all criteria */ export declare function matchesAgentCriteria(identity: AgentIdentity, criteria: AgentMatchCriteria): boolean; /** * Compares two capability vectors. * * NOTE: Certification tier is NOT compared here because it's not part * of CapabilityVector. Trust comes from attestations at runtime. * Use separate attestation comparison if needed. * * @param a - First capability vector * @param b - Second capability vector * @returns True if a satisfies or exceeds b (domains + level only) */ export declare function capabilityVectorSatisfies(a: CapabilityVector, b: CapabilityVector): boolean; /** * Type guard to check if a value is a valid CapabilityVector. */ export declare function isCapabilityVector(value: unknown): value is CapabilityVector; /** * Type guard to check if a value is a valid AgentIdentity. */ export declare function isAgentIdentity(value: unknown): value is AgentIdentity; /** * Type guard to check if a value is a valid AgentIdentitySummary. */ export declare function isAgentIdentitySummary(value: unknown): value is AgentIdentitySummary;