Plugin Validator — Kernel Protocol reference
Zod schemas for plugin validation data structures. These schemas align with the IPluginValidator contract interface.
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
TypeScript Usage
import { PluginMetadataSchema, ValidationErrorSchema, ValidationResultSchema, ValidationWarningSchema } from '@objectstack/spec/kernel';
import type { PluginMetadata, ValidationError, ValidationResult, ValidationWarning } from '@objectstack/spec/kernel';
// Validate data
const result = PluginMetadataSchema.parse(data);PluginMetadata
Plugin metadata for validation
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| name | string | ✅ | Unique plugin identifier |
| version | string | optional | Version (SemVer 2.0.0 — e.g. 1.0.0, 2.0.0-beta.1) |
| 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 |
ValidationError
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| field | string | ✅ | Field name that failed validation |
| message | string | ✅ | Human-readable error message |
| code | string | optional | Machine-readable error code |
ValidationResult
Properties
| 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 |
Nested Shape: ValidationResult.errors[number]
| Property | Type | Required | Description |
|---|---|---|---|
| field | string | ✅ | Field name that failed validation |
| message | string | ✅ | Human-readable error message |
| code | string | optional | Machine-readable error code |
Nested Shape: ValidationResult.warnings[number]
| Property | Type | Required | Description |
|---|---|---|---|
| field | string | ✅ | Field name with warning |
| message | string | ✅ | Human-readable warning message |
| code | string | optional | Machine-readable warning code |
ValidationWarning
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| field | string | ✅ | Field name with warning |
| message | string | ✅ | Human-readable warning message |
| code | string | optional | Machine-readable warning code |