@dexwox-labs/a2a-core
Version:
Core types, validation and telemetry for Google's Agent-to-Agent (A2A) protocol - shared foundation for client and server implementations
37 lines (34 loc) • 965 B
text/typescript
/**
* @module Validation
* @description Validation utilities for the A2A protocol
*
* This module exports validation utilities for the A2A protocol, including
* schema validators, type guards, and utilities for working with JSON Schema.
* It also re-exports the Zod library for convenience.
*
* @example
* ```typescript
* import { validateMessage, isTask, z } from '@dexwox-labs/a2a-core/validation';
*
* // Validate a message
* const result = validateMessage({
* parts: [{ type: 'text', content: 'Hello, world!' }]
* });
*
* // Check if an object is a task
* if (isTask(someObject)) {
* console.log('Task status:', someObject.status);
* }
*
* // Use Zod directly
* const schema = z.object({
* name: z.string(),
* age: z.number().positive()
* });
* ```
*/
// Export all validators and schema utilities
export * from './validators';
export * from './schema-utils';
// Re-export Zod for convenience
export { z } from 'zod';