kcode-rust-libs-v2 1.2.0

Create, edit, validate, and publish complete agent-authored Rust library snapshots
Documentation
# API

```rust
pub struct File {
    pub path: String,
    pub contents: String,
}

pub struct Lib {
    pub files: Vec<File>,
    // private fields
}

pub fn create(
    root: impl AsRef<Path>,
    name: &str,
    crates_io_token: impl AsRef<str>,
) -> Result<Lib>;

pub fn open(
    root: impl AsRef<Path>,
    name: &str,
    crates_io_token: impl AsRef<str>,
) -> Result<Lib>;

pub fn docs(root: impl AsRef<Path>, name: &str) -> Result<(String, String)>;

impl Lib {
    pub fn write(&mut self) -> Result<()>;
    pub fn check(&self) -> Result<()>;
    pub fn publish(&self) -> Result<()>;
}
```

- `create` creates a minimal Rust 2024 library at version `0.1.0`.
- `open` returns the complete UTF-8 source, excluding `Cargo.lock`. It automatically migrates a valid library stored by `kcode-rust-libs` v1.
- `docs` returns the package version and `Documentation.md`.
- `write` commits `files` as the complete replacement. Omitted files are deleted. Reopen after a `stale_snapshot` error.
- `check` formats a disposable copy of the current in-memory source before
  validating it. Formatting differences that rustfmt can repair are not check
  failures.
- `publish` rechecks and publishes the automatically formatted disposable
  source.

`root` is the managed-libraries directory. The token is the crates.io registry token used only by `publish`.