UNPKG

atp-sdk

Version:

Official TypeScript SDK for Agent Trust Protocol™ - Build secure, verifiable, and trustworthy applications with decentralized identity, verifiable credentials, payment protocols (AP2/ACP), and robust access control

91 lines 3.66 kB
/** * ATP™ SDK - Agent Trust Protocol SDK * * A comprehensive TypeScript SDK for interacting with Agent Trust Protocol™ services * * @version 1.0.0 * @author Agent Trust Protocol™ Team * @license MIT */ // Simplified Agent API (3-line quick start!) export { Agent } from './simple-agent.js'; export { Agent as default } from './simple-agent.js'; // Main ATP Client export { ATPClient } from './client/atp.js'; // Service Clients export { BaseClient } from './client/base.js'; export { IdentityClient } from './client/identity.js'; export { CredentialsClient } from './client/credentials.js'; export { PermissionsClient } from './client/permissions.js'; export { AuditClient } from './client/audit.js'; export { GatewayClient } from './client/gateway.js'; export { PaymentsClient } from './client/payments.js'; // Multi-Protocol Support (NEW in v1.1.0) export { ProtocolDetector, BaseProtocolAdapter, MCPAdapter } from './protocols/index.js'; export { UniversalMonitor, SecurityEnforcer } from './monitoring/index.js'; // Utility Classes export { CryptoUtils } from './utils/crypto.js'; export { DIDUtils } from './utils/did.js'; export { JWTUtils } from './utils/jwt.js'; export { VersionManager, versionManager } from './utils/version-manager.js'; // ZKP Authentication Utilities (NEW - Agent-to-Agent Auth) export { // Core ZKP Functions generatePedersenCommitment, generateRandomBlinding, generateNonce, generateChallengeHash, createChallenge, isChallengeExpired, // Proof Generation createTrustLevelProof, createCredentialProof, createIdentityProof, createBehaviorCommitment, createBehaviorProof, // Proof Verification verifyTrustLevelProof, verifyCredentialProof, verifyIdentityProof, verifyBehaviorProof, // Auth Flow generateAuthResponse, verifyAuthResponse, // Behavior Tracking BehaviorMerkleTree } from './utils/zkp.js'; // ZKP Proof Type Enum (exported as value for use in comparisons) export { ZKProofType } from './types.js'; // Version information export const VERSION = '1.0.0'; export const PROTOCOL_VERSION = '1.0'; // Constants export const ATP_CONSTANTS = { DEFAULT_TIMEOUT: 30000, MAX_RETRIES: 3, RETRY_DELAY: 1000, DEFAULT_JWT_EXPIRY: '1h', DEFAULT_REFRESH_TOKEN_EXPIRY: '30d', SUPPORTED_DID_METHODS: ['atp', 'key', 'web'], SUPPORTED_NETWORKS: ['mainnet', 'testnet', 'local'], DEFAULT_NETWORK: 'mainnet' }; // Re-import for function implementations import { ATPClient } from './client/atp.js'; // Helper functions for quick SDK setup export function createATPClient(config) { return new ATPClient(config); } export function createQuickConfig(baseUrl, options) { return { baseUrl, timeout: options?.timeout || ATP_CONSTANTS.DEFAULT_TIMEOUT, retries: options?.retries || ATP_CONSTANTS.MAX_RETRIES, retryDelay: ATP_CONSTANTS.RETRY_DELAY, auth: options?.auth || {}, services: { identity: process.env.ATP_IDENTITY_URL || `${baseUrl}:3001`, credentials: process.env.ATP_CREDENTIALS_URL || `${baseUrl}:3002`, permissions: process.env.ATP_PERMISSIONS_URL || `${baseUrl}:3003`, audit: process.env.ATP_AUDIT_URL || `${baseUrl}:3005`, gateway: process.env.ATP_GATEWAY_URL || `${baseUrl}:3000` } }; } // SDK Metadata export const SDK_INFO = { name: 'atp-sdk', version: VERSION, protocolVersion: PROTOCOL_VERSION, description: 'Official TypeScript SDK for Agent Trust Protocol™', repository: 'https://github.com/atp/sdk', documentation: 'https://docs.atp.protocol', support: 'https://support.atp.protocol' }; //# sourceMappingURL=index.js.map