Libraries¶
Amplifier's supporting libraries provide higher-level functionality on top of the kernel. These are application-layer concerns, not kernel mechanisms.
Library Overview¶
| Library | Purpose | Repository |
|---|---|---|
| amplifier-profiles | Profile loading and inheritance | GitHub |
| amplifier-collections | Collection discovery and management | GitHub |
| amplifier-config | Three-scope configuration | GitHub |
| amplifier-module-resolution | Module source resolution | GitHub |
Architecture Position¶
┌─────────────────────────────────────────────────────────────┐
│ Application (amplifier-app-cli) │
│ Uses libraries to resolve configuration │
└──────┬────────────────────────────────┬─────────────────────┘
│ │
▼ ▼
┌──────────────────┐ ┌──────────────────┐
│ amplifier- │ │ amplifier- │
│ profiles │◄────────►│ collections │
└──────────────────┘ └──────────────────┘
│ │
▼ ▼
┌──────────────────┐ ┌──────────────────┐
│ amplifier- │ │ amplifier- │
│ config │ │ module-resolution│
└──────────────────┘ └──────────────────┘
│ │
└────────────────┬───────────────┘
│
▼
┌──────────────────┐
│ amplifier-core │
│ (kernel) │
└──────────────────┘
Libraries are not part of the kernel. They implement application-layer policies for:
- Where to find profiles
- How inheritance works
- Configuration scope resolution
- Module source resolution strategies
Quick Reference¶
Profiles Library
Load and compile profiles to Mount Plans. Handles inheritance, overlays, and @mentions.
Collections Library
Discover and manage collections. Convention-based resource discovery.
Config Library
Three-scope configuration management. Deep merge semantics.
Module Resolution
Resolve module IDs to sources. Git, file, and package strategies.
Design Philosophy¶
These libraries follow the same principles as the kernel:
- Mechanism, not policy: Provide APIs; apps decide how to use them
- Composable: Libraries can be used independently
- Swappable: Apps can provide their own implementations
- Testable: Clear interfaces enable mocking
Shared Utilities¶
Some utilities are shared across libraries:
Deep Merge¶
Module List Merge¶
from amplifier_profiles import merge_module_lists
merged = merge_module_lists(base_modules, overlay_modules)
These are canonical implementations used consistently across the ecosystem.