|
| 1 | +--- |
| 2 | +title: Plugin Capability |
| 3 | +description: Plugin Capability protocol schemas |
| 4 | +--- |
| 5 | + |
| 6 | +# Plugin Capability |
| 7 | + |
| 8 | +<Callout type="info"> |
| 9 | +**Source:** `packages/spec/src/system/plugin-capability.zod.ts` |
| 10 | +</Callout> |
| 11 | + |
| 12 | +## TypeScript Usage |
| 13 | + |
| 14 | +```typescript |
| 15 | +import { CapabilityConformanceLevelSchema, ExtensionPointSchema, PluginCapabilitySchema, PluginCapabilityManifestSchema, PluginDependencySchema, PluginInterfaceSchema, ProtocolFeatureSchema, ProtocolReferenceSchema, ProtocolVersionSchema } from '@objectstack/spec/system'; |
| 16 | +import type { CapabilityConformanceLevel, ExtensionPoint, PluginCapability, PluginCapabilityManifest, PluginDependency, PluginInterface, ProtocolFeature, ProtocolReference, ProtocolVersion } from '@objectstack/spec/system'; |
| 17 | + |
| 18 | +// Validate data |
| 19 | +const result = CapabilityConformanceLevelSchema.parse(data); |
| 20 | +``` |
| 21 | + |
| 22 | +--- |
| 23 | + |
| 24 | +## CapabilityConformanceLevel |
| 25 | + |
| 26 | +Level of protocol conformance |
| 27 | + |
| 28 | +### Allowed Values |
| 29 | + |
| 30 | +* `full` |
| 31 | +* `partial` |
| 32 | +* `experimental` |
| 33 | +* `deprecated` |
| 34 | + |
| 35 | +--- |
| 36 | + |
| 37 | +## ExtensionPoint |
| 38 | + |
| 39 | +### Properties |
| 40 | + |
| 41 | +| Property | Type | Required | Description | |
| 42 | +| :--- | :--- | :--- | :--- | |
| 43 | +| **id** | `string` | ✅ | Unique extension point identifier | |
| 44 | +| **name** | `string` | ✅ | | |
| 45 | +| **description** | `string` | optional | | |
| 46 | +| **type** | `Enum<'action' \| 'hook' \| 'widget' \| 'provider' \| 'transformer' \| 'validator' \| 'decorator'>` | ✅ | | |
| 47 | +| **contract** | `object` | optional | | |
| 48 | +| **cardinality** | `Enum<'single' \| 'multiple'>` | optional | Whether multiple extensions can register to this point | |
| 49 | + |
| 50 | +--- |
| 51 | + |
| 52 | +## PluginCapability |
| 53 | + |
| 54 | +### Properties |
| 55 | + |
| 56 | +| Property | Type | Required | Description | |
| 57 | +| :--- | :--- | :--- | :--- | |
| 58 | +| **protocol** | `object` | ✅ | | |
| 59 | +| **conformance** | `Enum<'full' \| 'partial' \| 'experimental' \| 'deprecated'>` | optional | Level of protocol conformance | |
| 60 | +| **implementedFeatures** | `string[]` | optional | List of implemented feature names | |
| 61 | +| **features** | `object[]` | optional | | |
| 62 | +| **metadata** | `Record<string, any>` | optional | | |
| 63 | +| **certified** | `boolean` | optional | Has passed official conformance tests | |
| 64 | +| **certificationDate** | `string` | optional | | |
| 65 | + |
| 66 | +--- |
| 67 | + |
| 68 | +## PluginCapabilityManifest |
| 69 | + |
| 70 | +### Properties |
| 71 | + |
| 72 | +| Property | Type | Required | Description | |
| 73 | +| :--- | :--- | :--- | :--- | |
| 74 | +| **implements** | `object[]` | optional | List of protocols this plugin conforms to | |
| 75 | +| **provides** | `object[]` | optional | Services/APIs this plugin offers to others | |
| 76 | +| **requires** | `object[]` | optional | Required plugins and their capabilities | |
| 77 | +| **extensionPoints** | `object[]` | optional | Points where other plugins can extend this plugin | |
| 78 | +| **extensions** | `object[]` | optional | Extensions contributed to other plugins | |
| 79 | + |
| 80 | +--- |
| 81 | + |
| 82 | +## PluginDependency |
| 83 | + |
| 84 | +### Properties |
| 85 | + |
| 86 | +| Property | Type | Required | Description | |
| 87 | +| :--- | :--- | :--- | :--- | |
| 88 | +| **pluginId** | `string` | ✅ | Required plugin identifier | |
| 89 | +| **version** | `string` | ✅ | Semantic version constraint | |
| 90 | +| **optional** | `boolean` | optional | | |
| 91 | +| **reason** | `string` | optional | | |
| 92 | +| **requiredCapabilities** | `string[]` | optional | Protocol IDs the dependency must support | |
| 93 | + |
| 94 | +--- |
| 95 | + |
| 96 | +## PluginInterface |
| 97 | + |
| 98 | +### Properties |
| 99 | + |
| 100 | +| Property | Type | Required | Description | |
| 101 | +| :--- | :--- | :--- | :--- | |
| 102 | +| **id** | `string` | ✅ | Unique interface identifier | |
| 103 | +| **name** | `string` | ✅ | | |
| 104 | +| **description** | `string` | optional | | |
| 105 | +| **version** | `object` | ✅ | Semantic version of the protocol | |
| 106 | +| **methods** | `object[]` | ✅ | | |
| 107 | +| **events** | `object[]` | optional | | |
| 108 | +| **stability** | `Enum<'stable' \| 'beta' \| 'alpha' \| 'experimental'>` | optional | | |
| 109 | + |
| 110 | +--- |
| 111 | + |
| 112 | +## ProtocolFeature |
| 113 | + |
| 114 | +### Properties |
| 115 | + |
| 116 | +| Property | Type | Required | Description | |
| 117 | +| :--- | :--- | :--- | :--- | |
| 118 | +| **name** | `string` | ✅ | Feature identifier within the protocol | |
| 119 | +| **enabled** | `boolean` | optional | | |
| 120 | +| **description** | `string` | optional | | |
| 121 | +| **sinceVersion** | `string` | optional | Version when this feature was added | |
| 122 | +| **deprecatedSince** | `string` | optional | Version when deprecated | |
| 123 | + |
| 124 | +--- |
| 125 | + |
| 126 | +## ProtocolReference |
| 127 | + |
| 128 | +### Properties |
| 129 | + |
| 130 | +| Property | Type | Required | Description | |
| 131 | +| :--- | :--- | :--- | :--- | |
| 132 | +| **id** | `string` | ✅ | Unique protocol identifier (e.g., com.objectstack.protocol.storage.v1) | |
| 133 | +| **label** | `string` | ✅ | | |
| 134 | +| **version** | `object` | ✅ | Semantic version of the protocol | |
| 135 | +| **specification** | `string` | optional | URL or path to protocol specification | |
| 136 | +| **description** | `string` | optional | | |
| 137 | + |
| 138 | +--- |
| 139 | + |
| 140 | +## ProtocolVersion |
| 141 | + |
| 142 | +Semantic version of the protocol |
| 143 | + |
| 144 | +### Properties |
| 145 | + |
| 146 | +| Property | Type | Required | Description | |
| 147 | +| :--- | :--- | :--- | :--- | |
| 148 | +| **major** | `integer` | ✅ | | |
| 149 | +| **minor** | `integer` | ✅ | | |
| 150 | +| **patch** | `integer` | ✅ | | |
| 151 | + |
0 commit comments