Plugin Capability
Plugin Capability protocol schemas
Defines the standard way plugins declare their capabilities, implementations,
and conformance levels to ensure interoperability across vendors.
Based on the Protocol-Oriented Architecture pattern similar to:
- Kubernetes CRDs (Custom Resource Definitions)
- OSGi Service Registry
- Eclipse Extension Points
Source: packages/spec/src/kernel/plugin-capability.zod.ts
import { CapabilityConformanceLevelSchema, ExtensionPointSchema, PluginCapabilitySchema, PluginCapabilityManifestSchema, PluginDependencySchema, PluginInterfaceSchema, ProtocolFeatureSchema, ProtocolReferenceSchema, ProtocolVersionSchema } from '@objectstack/spec/kernel';
import type { CapabilityConformanceLevel, ExtensionPoint, PluginCapability, PluginCapabilityManifest, PluginDependency, PluginInterface, ProtocolFeature, ProtocolReference, ProtocolVersion } from '@objectstack/spec/kernel';
// Validate data
const result = CapabilityConformanceLevelSchema.parse(data);
Level of protocol conformance
full
partial
experimental
deprecated
| Property | Type | Required | Description |
|---|
| id | string | ✅ | Unique extension point identifier |
| name | string | ✅ | |
| description | string | optional | |
| type | Enum<'action' | 'hook' | 'widget' | 'provider' | 'transformer' | 'validator' | 'decorator'> | ✅ | |
| contract | { input?: string; output?: string; signature?: string } | optional | |
| cardinality | Enum<'single' | 'multiple'> | ✅ | Whether multiple extensions can register to this point |
| Property | Type | Required | Description |
|---|
| protocol | { id: string; label: string; version: object; specification?: string; … } | ✅ | |
| conformance | Enum<'full' | 'partial' | 'experimental' | 'deprecated'> | ✅ | Level of protocol conformance |
| implementedFeatures | string[] | optional | List of implemented feature names |
| features | { name: string; enabled: boolean; description?: string; sinceVersion?: string; … }[] | optional | |
| metadata | Record<string, any> | optional | |
| certified | boolean | ✅ | Has passed official conformance tests |
| certificationDate | string | optional | |
| Property | Type | Required | Description |
|---|
| implements | { protocol: object; conformance: Enum<'full' | 'partial' | 'experimental' | 'deprecated'>; implementedFeatures?: string[]; features?: object[]; … }[] | optional | List of protocols this plugin conforms to |
| provides | { id: string; name: string; description?: string; version: object; … }[] | optional | Services/APIs this plugin offers to others |
| requires | { pluginId: string; version: string; optional: boolean; reason?: string; … }[] | optional | Required plugins and their capabilities |
| extensionPoints | { id: string; name: string; description?: string; type: Enum<'action' | 'hook' | 'widget' | 'provider' | 'transformer' | 'validator' | 'decorator'>; … }[] | optional | Points where other plugins can extend this plugin |
| extensions | { targetPluginId: string; extensionPointId: string; implementation: string; priority: integer }[] | optional | Extensions contributed to other plugins |
| Property | Type | Required | Description |
|---|
| pluginId | string | ✅ | Required plugin identifier |
| version | string | ✅ | Semantic version constraint |
| optional | boolean | ✅ | |
| reason | string | optional | |
| requiredCapabilities | string[] | optional | Protocol IDs the dependency must support |
| Property | Type | Required | Description |
|---|
| id | string | ✅ | Unique interface identifier |
| name | string | ✅ | |
| description | string | optional | |
| version | { major: integer; minor: integer; patch: integer } | ✅ | Semantic version of the protocol |
| methods | { name: string; description?: string; parameters?: object[]; returnType?: string; … }[] | ✅ | |
| events | { name: string; description?: string; payload?: string }[] | optional | |
| stability | Enum<'stable' | 'beta' | 'alpha' | 'experimental'> | ✅ | |
| Property | Type | Required | Description |
|---|
| name | string | ✅ | Feature identifier within the protocol |
| enabled | boolean | ✅ | |
| description | string | optional | |
| sinceVersion | string | optional | Version when this feature was added |
| deprecatedSince | string | optional | Version when deprecated |
| Property | Type | Required | Description |
|---|
| id | string | ✅ | Unique protocol identifier (e.g., com.objectstack.protocol.storage.v1) |
| label | string | ✅ | |
| version | { major: integer; minor: integer; patch: integer } | ✅ | Semantic version of the protocol |
| specification | string | optional | URL or path to protocol specification |
| description | string | optional | |
Semantic version of the protocol
| Property | Type | Required | Description |
|---|
| major | integer | ✅ | |
| minor | integer | ✅ | |
| patch | integer | ✅ | |