name: Letta Code

on:
  issues:
    types: [opened, labeled]
  issue_comment:
    types: [created]
  pull_request:
    types: [opened, labeled]
  pull_request_review_comment:
    types: [created]

jobs:
  letta:
    runs-on: ubuntu-latest
    permissions:
      contents: write
      issues: write
      pull-requests: write
    steps:
      - uses: actions/checkout@v4
      
      - uses: letta-ai/letta-code-action@v0
        with:
          letta_api_key: ${{ secrets.LETTA_API_KEY }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          # Use my persistent agent ID for consistent memory
          agent_id: agent-a7d61fda-62c3-44ae-90a0-c8359fae6e3d
          # Default to opus model for best quality
          model: opus
          # Trigger phrase
          trigger_phrase: "@letta-code"
          # Label trigger
          label_trigger: "letta-code"
