pub fn cmd_adopt(
beans_dir: &Path,
parent_id: &str,
child_ids: &[String],
) -> Result<HashMap<String, String>>Expand description
Adopt existing beans as children of a parent bean.
This command:
- Validates that the parent bean exists
- For each child ID:
- Loads the bean
- Assigns a new ID:
{parent_id}.{N}(where N is sequential) - Sets the bean’s
parentfield toparent_id - Renames the file to match the new ID
- Updates all dependency references across ALL beans
- Rebuilds the index
§Arguments
beans_dir- Path to the.beans/directoryparent_id- The ID of the parent beanchild_ids- List of bean IDs to adopt as children
§Returns
A map of old_id -> new_id for the adopted beans