Plugin Loading
Plugin Loading protocol schemas
Plugin Loading Protocol
What remains of this module is the observational half: the lifecycle
event a loader would emit (PluginLoadingEventSchema) and the per-plugin
state it would track (PluginLoadingStateSchema).
The configuration half — PluginLoadingConfigSchema and the ten member
schemas it combined, reached from authored metadata as manifest.loading —
was REMOVED in v17 per ADR-0049 enforce-or-remove (#4914). See the block
below.
Source: packages/spec/src/kernel/plugin-loading.zod.ts
TypeScript Usage
import { PluginLoadingEventSchema, PluginLoadingStateSchema } from '@objectstack/spec/kernel';
import type { PluginLoadingEvent, PluginLoadingState } from '@objectstack/spec/kernel';
// Validate data
const result = PluginLoadingEventSchema.parse(data);PluginLoadingEvent
Plugin loading lifecycle event
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| type | Enum<'load-started' | 'load-completed' | 'load-failed' | 'init-started' | 'init-completed' | 'init-failed' | 'preload-started' | 'preload-completed' | 'cache-hit' | … +5 more> | ✅ | |
| pluginId | string | ✅ | |
| timestamp | integer | ✅ | |
| durationMs | integer | optional | |
| metadata | Record<string, any> | optional | |
| error | { message: string; code?: string; stack?: string } | optional |
Allowed Values: PluginLoadingEvent.type
load-startedload-completedload-failedinit-startedinit-completedinit-failedpreload-startedpreload-completedcache-hitcache-misshot-reloaddynamic-loaddynamic-unloaddynamic-discover
PluginLoadingState
Plugin loading state
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| pluginId | string | ✅ | |
| state | Enum<'pending' | 'loading' | 'loaded' | 'initializing' | 'ready' | 'failed' | 'reloading' | 'unloading' | 'unloaded'> | ✅ | |
| progress | number | ✅ | |
| startedAt | integer | optional | |
| completedAt | integer | optional | |
| lastError | string | optional | |
| retryCount | integer | ✅ |