agentool 0.2.0

Rust toolkit for AI agents: JSON Schema-defined tools for workspace files, search, web, Markdown, Git, memory, human-in-the-loop hooks, and todos.
Documentation
# Cargo publish workflow
# 推送 v* 标签时:全 feature 下 fmt / clippy / test,通过后 cargo publish。
# 发版前务必将 Cargo.toml 的 version 与标签一致(例如标签 v0.2.1 对应 version = "0.2.1")。

name: Cargo Publish

on:
  push:
    tags:
      - 'v*'

permissions:
  contents: read

jobs:
  common-test:
    name: Tests & Checks
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Validate version matches
        shell: bash
        run: |
          tag_version="${GITHUB_REF_NAME#v}"
          cargo_version="$(python -c 'import tomllib; from pathlib import Path; print(tomllib.load(Path("Cargo.toml").open("rb"))["package"]["version"])')"

          if [ "$cargo_version" != "$tag_version" ]; then
            echo "::error title=Version mismatch::Cargo.toml version '$cargo_version' does not match tag '$GITHUB_REF_NAME'"
            exit 1
          fi

      - name: Setup Rust toolchain
        uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy

      - name: Cache Cargo dependencies
        uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.toml') }}

      - name: Check code formatting
        run: cargo fmt --all -- --check

      - name: Run Clippy checks
        run: cargo clippy --all-targets --all-features -- -D warnings

      - name: Run tests
        run: cargo test --all-features

  publish-cargo:
    name: Publish to crates.io
    needs: common-test
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Setup Rust toolchain
        uses: dtolnay/rust-toolchain@stable

      - name: Cache Cargo dependencies
        uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.toml') }}

      - name: Publish to crates.io
        run: cargo publish --token ${{ secrets.CARGO_ACCESS_TOKEN }}