Type Definitions

Complete TypeScript type definitions for Agent-Pass core interfaces and data structures.

Agent Identity Types
Core identity and DID-related type definitions
interface AgentIdentity {
  did: string;                    // Agent's decentralized identifier
  publicKey: string;              // Public key for signature verification  
  controllerDid: string;          // Controller's DID for delegation
}

interface AgentConfig {
  name: string;                   // Human-readable agent name
  version?: string;               // Agent version identifier
  capabilities: string[];         // Array of capability URIs
  constraints?: AgentConstraints;  // Optional usage constraints
}

interface AgentConstraints {
  timeLimit?: string;             // "24h", "7d", etc.
  ipRange?: string;               // CIDR notation
  rateLimits?: {
    requestsPerMinute?: number;
    dataProcessingMB?: number;
  };
  allowedDomains?: string[];      // Permitted target domains
}
Cryptographic Types
Key management and signature-related types
interface KeyPair {
  publicKey: string;              // Base64 encoded public key
  privateKey: string;             // Base64 encoded private key (secure storage)
  keyType: 'Ed25519' | 'secp256k1'; // Supported key algorithms
}

interface SignatureProof {
  type: string;                   // Signature type identifier
  created: string;                // ISO 8601 timestamp
  verificationMethod: string;     // DID + key reference
  proofPurpose: string;           // "authentication" | "assertionMethod"
  jws: string;                    // JSON Web Signature
}

interface ChallengeRequest {
  challenge: string;              // Random challenge string
  domain: string;                 // Target domain for verification
  expiresAt: string;              // Challenge expiration time
}

TypeScript Integration

Install the Agent-Pass TypeScript definitions for full type safety and IntelliSense support in your IDE.

npm install @agent-pass/types