diff --git a/.a0proj/memory/index.faiss b/.a0proj/memory/index.faiss index 137b266..731d491 100644 Binary files a/.a0proj/memory/index.faiss and b/.a0proj/memory/index.faiss differ diff --git a/.a0proj/memory/index.faiss.sha256 b/.a0proj/memory/index.faiss.sha256 index db2384d..e87d7f7 100644 --- a/.a0proj/memory/index.faiss.sha256 +++ b/.a0proj/memory/index.faiss.sha256 @@ -1 +1 @@ -c2a292d7913ab63077b072cdabe7bccf0f64dbf3824975001b58539db4f3bf5d \ No newline at end of file +8e95e0e8cec343042859ef1896dffae2d6bfba986fa2daeaf86600f62e39f71c \ No newline at end of file diff --git a/.a0proj/memory/index.pkl b/.a0proj/memory/index.pkl index 85be656..d1fe0d0 100644 Binary files a/.a0proj/memory/index.pkl and b/.a0proj/memory/index.pkl differ diff --git a/.a0proj/variables.env b/.a0proj/variables.env index 3645c2a..f19a66a 100644 --- a/.a0proj/variables.env +++ b/.a0proj/variables.env @@ -1,3 +1,3 @@ -EMBEDDING_MODEL=mxbai-embed-large:latest +EMBEDDING_MODEL=BAAI/bge-m3 OLLAMA_HOST=http://ares.moon-dragon.us:11435 LLM_MODEL=qwen3.5:9b diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index f1f5a25..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,150 +0,0 @@ -name: CI Pipeline - -on: - push: - branches: [ master, develop ] - pull_request: - branches: [ master ] - -env: - CARGO_TERM_COLOR: always - RUST_BACKTRACE: 1 - -jobs: - fmt: - name: Code Format - runs-on: linux - container: node:18 - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: dtolnay/rust-toolchain@stable - with: - components: rustfmt - - name: Check formatting - run: cargo fmt --all -- --check - - clippy: - name: Clippy Lints - runs-on: linux - container: node:18 - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Install system dependencies - run: | - apt-get update - apt-get install -y libsystemd-dev pkg-config - - uses: dtolnay/rust-toolchain@stable - with: - components: clippy - - name: Cache cargo - uses: Swatinem/rust-cache@v2 - - name: Run clippy - run: cargo clippy --all-targets --all-features -- -D warnings - - test: - name: Unit Tests - runs-on: linux - container: node:18 - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Install system dependencies - run: | - apt-get update - apt-get install -y libsystemd-dev pkg-config - - uses: dtolnay/rust-toolchain@stable - - name: Cache cargo - uses: Swatinem/rust-cache@v2 - - name: Run tests - run: cargo test --all-features - - audit: - name: Security Audit - runs-on: linux - container: node:18 - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Install system dependencies - run: | - apt-get update - apt-get install -y libsystemd-dev pkg-config - - uses: dtolnay/rust-toolchain@stable - - name: Run cargo-audit - run: | - cargo install cargo-audit - cargo audit - - build-deb: - name: Build Debian Package - runs-on: linux - container: node:18-bookworm - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: dtolnay/rust-toolchain@stable - - name: Install build dependencies - run: | - apt-get update - apt-get install -y build-essential debhelper cargo rustc libsystemd-dev pkg-config - - name: Build Debian package - run: dpkg-buildpackage -us -uc -b - - build-rpm: - name: Build RPM Package - runs-on: linux - container: linux-patch-api-rpm:latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: dtolnay/rust-toolchain@stable - - name: Install RPM build tools - run: | - dnf install -y rpm-build gcc cargo rust systemd-devel pkg-config - - name: Build release binary - run: cargo build --release - - name: Build RPM package - run: ./build-rpm.sh - - build-apk: - name: Build Alpine Package - runs-on: linux - container: node:18-alpine - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Install Rust toolchain - run: | - apk add --no-cache curl - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable - source $HOME/.cargo/env - - name: Install build dependencies - run: | - apk add --no-cache musl-dev openssl-dev git abuild gcc elogind-dev - - name: Build APK package - run: ./build-alpine.sh - - build-arch: - name: Build Arch Package - runs-on: linux - container: linux-patch-api-arch:latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Install build dependencies - run: | - pacman -Syu --noconfirm rust cargo systemd git base-devel - - name: Build release binary - run: cargo build --release - - name: Build Arch package - run: ./build-arch.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 86146b1..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,182 +0,0 @@ -name: Release Pipeline - -on: - push: - tags: [ 'v*' ] - -env: - CARGO_TERM_COLOR: always - RUST_BACKTRACE: 1 - -jobs: - build-deb: - name: Build Debian Package - runs-on: linux - container: node:18-bookworm - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: dtolnay/rust-toolchain@stable - - name: Install build dependencies - run: | - apt-get update - apt-get install -y build-essential debhelper cargo rustc libsystemd-dev pkg-config - - name: Build Debian package - run: dpkg-buildpackage -us -uc -b - - name: Copy .deb to workspace - run: cp ../linux-patch-api_*.deb . - - name: Upload to Gitea Release - env: - GITEA_TOKEN: ${{ secrets.giteatoken }} - GITEA_API: https://gitea.moon-dragon.us/api/v1 - run: | - TAG_NAME=${GITHUB_REF#refs/tags/} - echo "Tag: $TAG_NAME" - FILE=$(ls linux-patch-api_*.deb 2>/dev/null | head -1) - [ -z "$FILE" ] && echo "No .deb file found" && exit 0 - echo "File: $FILE" - RELEASE_ID=$(curl -s -H "Authorization: token $GITEA_TOKEN" "$GITEA_API/repos/echo/linux_patch_api/releases/tags/$TAG_NAME" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2) - echo "Release ID: $RELEASE_ID" - if [ -z "$RELEASE_ID" ]; then - echo "Creating release..." - RESPONSE=$(curl -s -X POST -H "Authorization: token $GITEA_TOKEN" -H "Content-Type: application/json" -d "{\"tag_name\": \"$TAG_NAME\", \"name\": \"$TAG_NAME\"}" "$GITEA_API/repos/echo/linux_patch_api/releases") - RELEASE_ID=$(echo "$RESPONSE" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2) - echo "Created release ID: $RELEASE_ID" - fi - if [ -n "$RELEASE_ID" ]; then - echo "Uploading $FILE to release $RELEASE_ID..." - UPLOAD_RESPONSE=$(curl -s -w "\nHTTP_CODE:%{http_code}" -X POST -H "Authorization: token $GITEA_TOKEN" -F "attachment=@$FILE" "$GITEA_API/repos/echo/linux_patch_api/releases/$RELEASE_ID/assets?name=$(basename $FILE)") - HTTP_CODE=$(echo "$UPLOAD_RESPONSE" | grep "HTTP_CODE:" | cut -d: -f2) - echo "HTTP Code: $HTTP_CODE" - echo "Response: $UPLOAD_RESPONSE" - if [ "$HTTP_CODE" != "201" ] && [ "$HTTP_CODE" != "200" ]; then echo "ERROR: Upload failed with HTTP $HTTP_CODE" && exit 1; fi - echo "Successfully uploaded $FILE" - else echo "ERROR: Could not get release ID" && exit 1; fi - - build-rpm: - name: Build RPM Package - runs-on: linux - container: linux-patch-api-rpm:latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: dtolnay/rust-toolchain@stable - - name: Install RPM build tools - run: | - dnf install -y rpm-build gcc cargo rust systemd-devel pkg-config - - name: Build release binary - run: cargo build --release - - name: Build RPM package - run: ./build-rpm.sh - - name: Upload to Gitea Release - env: - GITEA_TOKEN: ${{ secrets.giteatoken }} - GITEA_API: https://gitea.moon-dragon.us/api/v1 - run: | - TAG_NAME=${GITHUB_REF#refs/tags/} - echo "Tag: $TAG_NAME" - FILE=$(ls ~/rpmbuild/RPMS/x86_64/*.rpm 2>/dev/null | head -1) - [ -z "$FILE" ] && echo "No .rpm file found" && exit 0 - echo "File: $FILE" - RELEASE_ID=$(curl -s -H "Authorization: token $GITEA_TOKEN" "$GITEA_API/repos/echo/linux_patch_api/releases/tags/$TAG_NAME" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2) - echo "Release ID: $RELEASE_ID" - if [ -z "$RELEASE_ID" ]; then - RESPONSE=$(curl -s -X POST -H "Authorization: token $GITEA_TOKEN" -H "Content-Type: application/json" -d "{\"tag_name\": \"$TAG_NAME\", \"name\": \"$TAG_NAME\"}" "$GITEA_API/repos/echo/linux_patch_api/releases") - RELEASE_ID=$(echo "$RESPONSE" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2) - fi - if [ -n "$RELEASE_ID" ]; then - echo "Uploading $FILE to release $RELEASE_ID..." - UPLOAD_RESPONSE=$(curl -s -w "\nHTTP_CODE:%{http_code}" -X POST -H "Authorization: token $GITEA_TOKEN" -F "attachment=@$FILE" "$GITEA_API/repos/echo/linux_patch_api/releases/$RELEASE_ID/assets?name=$(basename $FILE)") - HTTP_CODE=$(echo "$UPLOAD_RESPONSE" | grep "HTTP_CODE:" | cut -d: -f2) - echo "HTTP Code: $HTTP_CODE" - echo "Response: $UPLOAD_RESPONSE" - if [ "$HTTP_CODE" != "201" ] && [ "$HTTP_CODE" != "200" ]; then echo "ERROR: Upload failed" && exit 1; fi - echo "Successfully uploaded $FILE" - else echo "ERROR: No release ID" && exit 1; fi - - build-apk: - name: Build Alpine Package - runs-on: linux - container: node:18-alpine - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Install Rust toolchain - run: | - apk add --no-cache curl - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable - source $HOME/.cargo/env - - name: Install build dependencies - run: | - apk add --no-cache musl-dev openssl-dev git abuild gcc elogind-dev - - name: Build APK package - run: ./build-alpine.sh - - name: Upload to Gitea Release - env: - GITEA_TOKEN: ${{ secrets.giteatoken }} - GITEA_API: https://gitea.moon-dragon.us/api/v1 - run: | - TAG_NAME=${GITHUB_REF#refs/tags/} - echo "Tag: $TAG_NAME" - FILE=$(ls releases/*.apk 2>/dev/null | head -1) - [ -z "$FILE" ] && echo "No .apk file found" && exit 0 - echo "File: $FILE" - RELEASE_ID=$(curl -s -H "Authorization: token $GITEA_TOKEN" "$GITEA_API/repos/echo/linux_patch_api/releases/tags/$TAG_NAME" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2) - echo "Release ID: $RELEASE_ID" - if [ -z "$RELEASE_ID" ]; then - RESPONSE=$(curl -s -X POST -H "Authorization: token $GITEA_TOKEN" -H "Content-Type: application/json" -d "{\"tag_name\": \"$TAG_NAME\", \"name\": \"$TAG_NAME\"}" "$GITEA_API/repos/echo/linux_patch_api/releases") - RELEASE_ID=$(echo "$RESPONSE" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2) - fi - if [ -n "$RELEASE_ID" ]; then - echo "Uploading $FILE to release $RELEASE_ID..." - UPLOAD_RESPONSE=$(curl -s -w "\nHTTP_CODE:%{http_code}" -X POST -H "Authorization: token $GITEA_TOKEN" -F "attachment=@$FILE" "$GITEA_API/repos/echo/linux_patch_api/releases/$RELEASE_ID/assets?name=$(basename $FILE)") - HTTP_CODE=$(echo "$UPLOAD_RESPONSE" | grep "HTTP_CODE:" | cut -d: -f2) - echo "HTTP Code: $HTTP_CODE" - echo "Response: $UPLOAD_RESPONSE" - if [ "$HTTP_CODE" != "201" ] && [ "$HTTP_CODE" != "200" ]; then echo "ERROR: Upload failed" && exit 1; fi - echo "Successfully uploaded $FILE" - else echo "ERROR: No release ID" && exit 1; fi - - build-arch: - name: Build Arch Package - runs-on: linux - container: linux-patch-api-arch:latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Install build dependencies - run: | - pacman -Syu --noconfirm rust cargo systemd git base-devel - - name: Build release binary - run: cargo build --release - - name: Build Arch package - run: ./build-arch.sh - - name: Upload to Gitea Release - env: - GITEA_TOKEN: ${{ secrets.giteatoken }} - GITEA_API: https://gitea.moon-dragon.us/api/v1 - run: | - TAG_NAME=${GITHUB_REF#refs/tags/} - echo "Tag: $TAG_NAME" - FILE=$(ls releases/*.pkg.tar.zst 2>/dev/null | head -1) - [ -z "$FILE" ] && echo "No .pkg.tar.zst file found" && exit 0 - echo "File: $FILE" - RELEASE_ID=$(curl -s -H "Authorization: token $GITEA_TOKEN" "$GITEA_API/repos/echo/linux_patch_api/releases/tags/$TAG_NAME" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2) - echo "Release ID: $RELEASE_ID" - if [ -z "$RELEASE_ID" ]; then - RESPONSE=$(curl -s -X POST -H "Authorization: token $GITEA_TOKEN" -H "Content-Type: application/json" -d "{\"tag_name\": \"$TAG_NAME\", \"name\": \"$TAG_NAME\"}" "$GITEA_API/repos/echo/linux_patch_api/releases") - RELEASE_ID=$(echo "$RESPONSE" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2) - fi - if [ -n "$RELEASE_ID" ]; then - echo "Uploading $FILE to release $RELEASE_ID..." - UPLOAD_RESPONSE=$(curl -s -w "\nHTTP_CODE:%{http_code}" -X POST -H "Authorization: token $GITEA_TOKEN" -F "attachment=@$FILE" "$GITEA_API/repos/echo/linux_patch_api/releases/$RELEASE_ID/assets?name=$(basename $FILE)") - HTTP_CODE=$(echo "$UPLOAD_RESPONSE" | grep "HTTP_CODE:" | cut -d: -f2) - echo "HTTP Code: $HTTP_CODE" - echo "Response: $UPLOAD_RESPONSE" - if [ "$HTTP_CODE" != "201" ] && [ "$HTTP_CODE" != "200" ]; then echo "ERROR: Upload failed" && exit 1; fi - echo "Successfully uploaded $FILE" - else echo "ERROR: No release ID" && exit 1; fi