@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
53 lines • 1.9 kB
JavaScript
;
/**
* @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()
* });
* ```
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.z = void 0;
// Export all validators and schema utilities
__exportStar(require("./validators"), exports);
__exportStar(require("./schema-utils"), exports);
// Re-export Zod for convenience
var zod_1 = require("zod");
Object.defineProperty(exports, "z", { enumerable: true, get: function () { return zod_1.z; } });
//# sourceMappingURL=index.js.map