82 lines
2.4 KiB
YAML
82 lines
2.4 KiB
YAML
# BlackRoad Agent Task Runner
|
|
# Triggered by the autonomy orchestrator to execute marketplace tasks
|
|
# This is the ACTUAL autonomy - Claude Code runs tasks dispatched by the daemon
|
|
|
|
name: Agent Task Runner
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
task_id:
|
|
description: 'Task ID from marketplace'
|
|
required: true
|
|
type: string
|
|
priority:
|
|
description: 'Task priority'
|
|
required: false
|
|
type: string
|
|
default: 'medium'
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
issues: write
|
|
|
|
jobs:
|
|
execute-task:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Fetch task details
|
|
id: task
|
|
run: |
|
|
echo "Task ID: ${{ inputs.task_id }}"
|
|
echo "Priority: ${{ inputs.priority }}"
|
|
|
|
# In production, this would fetch from the task marketplace API
|
|
# For now, we acknowledge the task
|
|
echo "task_id=${{ inputs.task_id }}" >> $GITHUB_OUTPUT
|
|
echo "status=claimed" >> $GITHUB_OUTPUT
|
|
|
|
- name: Install Claude Code
|
|
run: |
|
|
npm install -g @anthropic-ai/claude-code || echo "Claude Code not available in CI yet"
|
|
|
|
- name: Execute task with Claude
|
|
env:
|
|
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
TASK_ID: ${{ inputs.task_id }}
|
|
run: |
|
|
echo "Executing task: $TASK_ID"
|
|
|
|
# This is where Claude Code would execute the task
|
|
# claude --print "Execute task $TASK_ID: [task description]" --allowedTools "Edit,Write,Bash"
|
|
|
|
# For now, create a placeholder result
|
|
echo "Task $TASK_ID acknowledged by GitHub Actions runner"
|
|
echo "Runner: $(hostname)"
|
|
echo "Time: $(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
|
|
|
- name: Report completion
|
|
if: success()
|
|
run: |
|
|
echo "Task ${{ inputs.task_id }} completed successfully"
|
|
# In production: POST to /api/tasks/$TASK_ID/complete
|
|
|
|
- name: Report failure
|
|
if: failure()
|
|
run: |
|
|
echo "Task ${{ inputs.task_id }} failed"
|
|
# In production: POST to /api/tasks/$TASK_ID/release
|