nader-test-agentkit
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

@layr-labs/agentkit

Core interfaces and types for the EigenLayer AgentKit framework. This package provides the foundation for building verifiable AI agents with zkTLS proofs.

Installation

npm install @layr-labs/agentkit
# or
yarn add @layr-labs/agentkit
# or
pnpm add @layr-labs/agentkit

Features

  • Type definitions for zkTLS proofs and verifiable operations
  • Interface definitions for verifiable inference adapters
  • Interface definitions for verifiable logging adapters
  • Common error types and utilities

Usage

Implementing a Verifiable Inference Adapter

import { 
  IVerifiableInferenceAdapter, 
  VerifiableInferenceResult,
  Proof,
  GenerateTextOptions
} from '@layr-labs/agentkit';

class MyInferenceAdapter implements IVerifiableInferenceAdapter {
  async generateText(
    prompt: string,
    options?: GenerateTextOptions
  ): Promise<VerifiableInferenceResult> {
    // Implementation here
  }

  async verifyProof(proof: Proof): Promise<boolean> {
    // Implementation here
  }
}

Implementing a Verifiable Logging Adapter

import {
  IVerifiableLoggingAdapter,
  VerifiableLogEntry,
  Proof,
  LoggingOptions
} from '@layr-labs/agentkit';

class MyLoggingAdapter implements IVerifiableLoggingAdapter {
  async log(
    data: unknown,
    options?: LoggingOptions
  ): Promise<VerifiableLogEntry> {
    // Implementation here
  }

  async verifyProof(proof: Proof): Promise<boolean> {
    // Implementation here
  }

  async getLogEntry(id: string): Promise<VerifiableLogEntry | null> {
    // Implementation here
  }

  async queryLogs(options: Record<string, unknown>): Promise<VerifiableLogEntry[]> {
    // Implementation here
  }
}

API Reference

Types

Proof

Represents a cryptographic proof that can be verified.

interface Proof {
  type: string;
  data: unknown;
  timestamp: number;
  metadata?: Record<string, unknown>;
}

VerifiableInferenceResult<T = string>

Result of a verifiable inference operation.

interface VerifiableInferenceResult<T = string> {
  content: T;
  proof: Proof;
}

Interfaces

IVerifiableInferenceAdapter

Interface for adapters that provide verifiable inference capabilities.

IVerifiableLoggingAdapter

Interface for adapters that provide verifiable logging capabilities.

Error Types

ProofVerificationError

Thrown when proof verification fails.

ProofGenerationError

Thrown when proof generation fails.

Contributing

Please read the contributing guidelines in the root of the monorepo for details on our code of conduct and the process for submitting pull requests.

License

MIT License - see the LICENSE file for details.

Package Sidebar

Install

npm i nader-test-agentkit

Weekly Downloads

4

Version

0.0.4

License

MIT

Unpacked Size

24.7 kB

Total Files

24

Last publish

Collaborators

  • dabit3