# API Reference

Full API reference for `@kya-os/mcp-i-core` package.

> **Note:** This reference is being updated. For complete API signatures, see the TypeScript type definitions in `src/index.ts` which exports all public interfaces.

## Installation

```bash
npm install @kya-os/mcp-i-core
# or
pnpm add @kya-os/mcp-i-core
```

## Core Exports

### Runtime

- **MCPIRuntimeBase** - Provider-based runtime class for MCP-I operations

### Delegation (W3C VC-based)

- **DelegationCredentialIssuer** - Issues W3C Verifiable Credentials for delegations
- **DelegationCredentialVerifier** - Verifies delegation credentials with DID resolution
- **StatusList2021Manager** - Manages StatusList2021 credentials for revocation
- **DelegationGraphManager** - Manages delegation relationships and chains
- **CascadingRevocationManager** - Handles cascading revocation through delegation chains

### Services

- **ToolProtectionService** - Manages tool-level delegation requirements
- **PolicyService** - Evaluates access policies
- **CryptoService** - Cryptographic operations (JWS, signatures)
- **ProofVerifier** - Verifies detached proofs
- **OAuthService** - OAuth 2.0 with PKCE support
- **AccessControlApiService** - AgentShield API integration

### Providers (Abstract)

- **CryptoProvider** - Cryptographic operations interface
- **IdentityProvider** - Agent identity management
- **ClockProvider** - Time operations
- **FetchProvider** - Network operations
- **StorageProvider** - Key-value storage
- **NonceCacheProvider** - Replay attack prevention

### Memory Providers (Testing)

- **MemoryStorageProvider** - In-memory storage
- **MemoryNonceCacheProvider** - In-memory nonce cache
- **MemoryIdentityProvider** - In-memory identity storage
- **MemoryStatusListStorage** - In-memory status list storage
- **MemoryDelegationGraphStorage** - In-memory delegation graph

### Utilities

- **SchemaVerifier** - JSON Schema draft-07 compliance verification
- **BitstringManager** - StatusList2021 bitstring operations
- **UserDidManager** - User DID generation and management
- **createDidKeyResolver** - did:key resolution utilities

### Error Types

- **DelegationRequiredError** - Thrown when delegation is required
- **OAuthRequiredError** - Thrown when OAuth authorization is needed
- **ProofVerificationError** - Proof verification failures

## Usage Examples

See the main [README.md](../README.md) for usage examples and the [TypeScript definitions](../src/index.ts) for complete type signatures.

## Related Documentation

- [W3C VC Delegation Guide](./W3C_VC_DELEGATION_GUIDE.md)
- [StatusList2021 Guide](./STATUSLIST2021_GUIDE.md)
- [Compliance Matrix](./COMPLIANCE_MATRIX.md)
