LemonCore. Update. ConfigMigrator
(lemon_core v0.1.0)
View Source
Detects and migrates deprecated configuration sections.
Deprecated sections
| Old section | New location |
|---|---|
[agent] fields | [defaults] (provider, model, thinking_level) or [runtime] |
[agents.<id>] | [profiles.<id>] |
[agent.tools.*] | [runtime.tools.*] |
[tools.*] | [runtime.tools.*] |
Usage
# Check what would be migrated (dry run):
{:needs_migration, issues} = ConfigMigrator.check(path)
# Apply migration:
:ok = ConfigMigrator.migrate!(path)
Summary
Functions
Returns the backup path for a given config path.
Checks the config at path for deprecated sections.
Applies automated config migration to path in-place.
Types
@type issue() :: String.t()
Functions
Returns the backup path for a given config path.
Checks the config at path for deprecated sections.
Returns:
:ok— config is clean, no migration needed.{:needs_migration, issues}— deprecated sections found;issuesdescribes each one.{:error, reason}— could not read or parse the file.
Applies automated config migration to path in-place.
Creates a backup at <path>.pre-update-bak before writing.
Returns :ok on success, {:error, reason} on failure.