| name | implementation-plugins-hooks |
| description | Implement plugin manifests, marketplaces, installation registries, dependency and policy checks, cache lifecycle, component loading, and the complete hook event protocol. Use when implementing extension packaging, plugin updates, or lifecycle interception around runtime events. |
Implementation Plugins and Hooks
Preserve packaging and interception boundaries
A plugin is an attributed, versioned contribution bundle; a marketplace is a trust and materialization source; a hook is an event-scoped interceptor with explicit authority. Keep installation intent, installed registry entries, cached material, active session contributions, and plugin-owned durable data as distinct state.
Use the architecture diagram to inspect marketplace-to-session loading and hook dispatch. Read plugin lifecycle for schemas, source policy, dependencies, installation, versioning, cleanup, and component loading. Read hook protocol for all events, matcher semantics, input/output schemas, process and HTTP execution, ordering, blocking effects, async behavior, and failure handling. Requirement identifiers PLUG-*, MARKET-*, and HOOK-* are stable implementation anchors.
Plugin workflow
- Resolve marketplace intent and policy before network or filesystem materialization.
- Load a marketplace from a validated local or cache-root location, validate every plugin entry, and preserve structured errors per entry.
- Resolve the root plugin and dependency graph in postorder. Cross-market dependencies require explicit trust from the root marketplace and never confer transitive trust.
- Record enabled intent, materialize immutable versioned content, and update the scope-aware installed registry. A background update affects the next session, not the active snapshot.
- Load manifest and standard component directories with canonical-path deduplication, source attribution, and component-level failure isolation.