This document explains how licenses are managed and distributed across the monorepo.
All packages in this monorepo use the Elastic License 2.0 with Supplemental Terms. The license files are automatically synchronized from the root directory to all publishable packages during the build process.
LICENSE.md- The main Elastic License 2.0 with Supplemental TermsSUPPLEMENTAL_TERMS.md- Additional terms that supplement the Elastic License
These are the authoritative versions - all changes should be made to these root files only.
The following packages automatically receive copies of both license files:
agents-cliagents-apiagents-uipackages/agents-corepackages/agents-sdkpackages/create-agents
License files are automatically copied during:
- Build process (
pnpm build) - via prebuild hook - Package preparation (
pnpm prepack) - before publishing - Manual sync (
pnpm sync:licenses) - on demand
The scripts/sync-licenses.mjs script:
- Reads
LICENSE.mdandSUPPLEMENTAL_TERMS.mdfrom the root - Adds auto-generated headers indicating files are copied
- Writes them to all target packages
- Validates all copies were successful
-
Edit the root files only:
# Edit the main license vim LICENSE.md # Edit supplemental terms vim SUPPLEMENTAL_TERMS.md
-
Sync to all packages:
pnpm sync:licenses
-
Verify the sync:
# Check that all packages received the updates ls packages/*/LICENSE.md agents-*/LICENSE.md ls packages/*/SUPPLEMENTAL_TERMS.md agents-*/SUPPLEMENTAL_TERMS.md
LICENSE.md or SUPPLEMENTAL_TERMS.md is missing from the root.
When publishing packages via changesets:
- The prebuild hook automatically runs
sync:licenses - Both
LICENSE.mdandSUPPLEMENTAL_TERMS.mdare included in the published package - The
filesfield in each package.json ensures both files are packaged
Run manually: pnpm sync:licenses
Ensure both root files exist:
ls LICENSE.md SUPPLEMENTAL_TERMS.mdCheck the package.json files array includes both:
"files": [
"dist",
"README.md",
"LICENSE.md",
"SUPPLEMENTAL_TERMS.md"
]When adding a new publishable package:
- Add the package path to
targetPackagesinscripts/sync-licenses.mjs - Include both license files in the package.json
filesarray - Run
pnpm sync:licensesto copy the files
The license sync is integrated into the build pipeline:
- Turbo includes
sync:licensesas a dependency of thebuildtask - This ensures licenses are always up-to-date before building or publishing