| title | Plugin Validator |
|---|---|
| description | Plugin Validator protocol schemas |
{/*
Plugin Validator Protocol
Zod schemas for plugin validation data structures.
These schemas align with the IPluginValidator contract interface.
Following ObjectStack "Zod First" principle - all data structures
must have Zod schemas for runtime validation and JSON Schema generation.
**Source:** `packages/spec/src/kernel/plugin-validator.zod.ts`import { PluginMetadata, ValidationError, ValidationResult, ValidationWarning } from '@objectstack/spec/kernel';
import type { PluginMetadata, ValidationError, ValidationResult, ValidationWarning } from '@objectstack/spec/kernel';
// Validate data
const result = PluginMetadata.parse(data);Plugin metadata for validation
| Property | Type | Required | Description |
|---|---|---|---|
| name | string |
✅ | Unique plugin identifier |
| version | string |
optional | Semantic version (e.g., 1.0.0) |
| dependencies | string[] |
optional | Array of plugin names this plugin depends on (hard — a missing name fails the boot) |
| optionalDependencies | string[] |
optional | Plugin names hoisted ahead when composed, skipped when absent (order-if-present, ADR-0116) |
| requiresServices | string[] |
optional | Service names the plugin resolves synchronously during init(); validated by the kernel before Phase 1 (ADR-0116) |
| providesServices | string[] |
optional | Service names the plugin's init() unconditionally registers (ADR-0116) |
| signature | string |
optional | Cryptographic signature for plugin verification |
| Property | Type | Required | Description |
|---|---|---|---|
| field | string |
✅ | Field name that failed validation |
| message | string |
✅ | Human-readable error message |
| code | string |
optional | Machine-readable error code |
| Property | Type | Required | Description |
|---|---|---|---|
| valid | boolean |
✅ | Whether the plugin passed validation |
| errors | { field: string; message: string; code?: string }[] |
optional | Validation errors |
| warnings | { field: string; message: string; code?: string }[] |
optional | Validation warnings |
| Property | Type | Required | Description |
|---|---|---|---|
| field | string |
✅ | Field name with warning |
| message | string |
✅ | Human-readable warning message |
| code | string |
optional | Machine-readable warning code |