Principle:A5c ai Babysitter Unified Plugin Generation
| Knowledge Sources | |
|---|---|
| Domains | Plugin_Generation, Version_Management |
| Last Updated | 2026-10-23 00:00 GMT |
Overview
A method for resolving a single unified plugin version from a source of truth and managing output directories for multi-target plugin generation.
Description
Unified Plugin Generation is the principle of maintaining one version for a plugin that compiles to multiple harness targets. The version is resolved from versions.json (preferred) or the compiler package.json (fallback), ensuring all generated targets share the same version.
The output directory management ensures a clean state before generation — the target directory is cleared and recreated, with a safety check that it resides under the project root.
Usage
Use this principle when generating harness-specific plugins from a unified source definition where version consistency across targets is required.
Theoretical Basis
The version resolution is a priority chain:
version = versions.json.sdkVersion
|| compiler.package.json.version
|| throw("no version found")
// Sync plugin.json version to match
plugin.json.version = version
// Clean output directory (safety: must be under ROOT)
resetOutputDir(targetDir) // rmSync + mkdirSync
Key property: The version is resolved once and used for all targets, preventing version drift between harness-specific plugin packages.