mnemo_cards/.forgejo/workflows/agent-documentation.yml
2025-11-21 14:13:03 +03:00

86 lines
2.4 KiB
YAML

name: AI Agent - Documentation Update
on:
workflow_dispatch:
inputs:
component:
description: 'Component to document'
required: true
type: choice
options:
- web_v2
- backend
- common
llm_model:
description: 'LLM Model'
required: true
default: 'auto'
type: choice
options:
- auto
- composer-1
- sonnet-4.5
- sonnet-4.5-thinking
- gemini-3-pro
- gpt-5
- gpt-5.1
- gpt-5-high
- gpt-5.1-high
- gpt-5-codex
- gpt-5-codex-high
- gpt-5.1-codex
- gpt-5.1-codex-high
- opus-4.1
- grok
jobs:
update-docs:
runs-on: ubuntu-latest
container: code.mnemo-cards.online/cinnabarflower/cards/agent:latest
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Configure Git
run: |
git config --global user.name "AI Agent"
git config --global user.email "ai-agent@mnemo-cards.com"
- name: Install Dependencies
run: |
COMPONENT="${{ inputs.component }}"
if [ "$COMPONENT" = "web_v2" ]; then
cd mnemo_cards_web_v2
flutter pub get
elif [ "$COMPONENT" = "backend" ]; then
cd mnemo_cards_backend
dart pub get
elif [ "$COMPONENT" = "common" ]; then
cd mnemo_cards_common
dart pub get
fi
- name: Run Documentation Agent
env:
CURSOR_API_KEY: ${{ secrets.CURSOR_API_KEY }}
CURSOR_MODEL: ${{ inputs.llm_model }}
PROJECT_ROOT: ${{ github.workspace }}
run: |
# Verify cursor-agent is accessible
if ! command -v cursor-agent &> /dev/null; then
echo "❌ cursor-agent not found in PATH"
# Try to find it in common locations
if [ -f "$HOME/.local/bin/cursor-agent" ]; then
export PATH="$HOME/.local/bin:$PATH"
elif [ -f "$HOME/.cursor/bin/cursor-agent" ]; then
export PATH="$HOME/.cursor/bin:$PATH"
fi
fi
cd ${{ github.workspace }}
python3 tools/agent/doc_updater.py ${{ inputs.component }} --model ${{ inputs.llm_model }}