Module private_lock

Module private_lock 

Source
Expand description

Private lockfile management for user-level dependencies and patches.

The private lockfile (agpm.private.lock) tracks:

  1. Private dependencies: Full LockedResource entries from agpm.private.toml
  2. Private patches: Patches from agpm.private.toml applied to project dependencies

This separation allows team members to have different private configurations without causing lockfile conflicts in the shared agpm.lock.

§Structure

The private lockfile uses the same array-based format as agpm.lock:

version = 1

# Full private dependency entries (is_private = true)
[[agents]]
name = "my-private-agent"
source = "private-repo"
path = "agents/private.md"
checksum = "sha256:..."
installed_at = ".claude/agents/private/my-private-agent.md"
is_private = true

§Usage

§Splitting a lockfile

After dependency resolution, split the combined lockfile into public and private parts:

use agpm_cli::lockfile::{LockFile, PrivateLockFile};
use std::path::Path;

let combined_lockfile = LockFile::new();
// ... resolve dependencies ...

// Split into public and private parts
let (public_lock, private_lock) = combined_lockfile.split_by_privacy();

// Save each to appropriate file
public_lock.save(Path::new("agpm.lock"))?;
private_lock.save(Path::new("."))?;

§Loading and merging

When loading, merge the private lockfile back into the main lockfile:

use agpm_cli::lockfile::{LockFile, PrivateLockFile};
use std::path::Path;

let mut lockfile = LockFile::load(Path::new("agpm.lock"))?;
if let Some(private_lock) = PrivateLockFile::load(Path::new("."))? {
    lockfile.merge_private(&private_lock);
}

Structs§

PrivateLockFile
Private lockfile tracking user-level dependencies.