@automagent/schema
v0.3.0
Published
JSON Schema definition, TypeScript types, and validator for Automagent agent definitions
Maintainers
Readme
@automagent/schema
JSON Schema definition, TypeScript types, and validator for Automagent agent definitions.
Installation
npm install @automagent/schemaUsage
Validate an agent definition
import { validate } from '@automagent/schema';
const result = validate({
name: 'my-agent',
model: { provider: 'anthropic', name: 'claude-sonnet-4-5-20250514' },
instructions: 'You are a helpful assistant.',
});
if (!result.valid) {
console.error(result.errors);
}TypeScript types
import type { AgentDefinition, ModelConfig, ToolDefinition } from '@automagent/schema';Access the raw JSON Schema
import schema from '@automagent/schema/v1.schema.json';What's included
v1.schema.json— JSON Schema foragent.yamlcompose.schema.json— JSON Schema for agent composition- TypeScript types:
AgentDefinition,ModelConfig,ToolDefinition,ValidationResult validate()— Ajv-based validator function
License
Apache-2.0
