eigenlayer-agentkit
Version:
Core interfaces and types for EigenLayer AgentKit
128 lines (96 loc) • 2.75 kB
Markdown
Core interfaces and types for the EigenLayer AgentKit framework. This package provides the foundation for building verifiable AI agents with zkTLS proofs.
```bash
npm install eigenlayer-agentkit
yarn add eigenlayer-agentkit
pnpm add eigenlayer-agentkit
```
- 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
```typescript
import {
IVerifiableInferenceAdapter,
VerifiableInferenceResult,
Proof,
GenerateTextOptions
} from 'eigenlayer-agentkit';
class MyInferenceAdapter implements IVerifiableInferenceAdapter {
async generateText(
prompt: string,
options?: GenerateTextOptions
): Promise<VerifiableInferenceResult> {
// Implementation here
}
async verifyProof(proof: Proof): Promise<boolean> {
// Implementation here
}
}
```
```typescript
import {
IVerifiableLoggingAdapter,
VerifiableLogEntry,
Proof,
LoggingOptions
} from 'eigenlayer-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
}
}
```
Represents a cryptographic proof that can be verified.
```typescript
interface Proof {
type: string;
data: unknown;
timestamp: number;
metadata?: Record<string, unknown>;
}
```
Result of a verifiable inference operation.
```typescript
interface VerifiableInferenceResult<T = string> {
content: T;
proof: Proof;
}
```
Interface for adapters that provide verifiable inference capabilities.
Interface for adapters that provide verifiable logging capabilities.
Thrown when proof verification fails.
Thrown when proof generation fails.
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.
MIT License - see the LICENSE file for details.