Skip to content

Latest commit

Β 

History

History
245 lines (191 loc) Β· 7.66 KB

File metadata and controls

245 lines (191 loc) Β· 7.66 KB

Autensa Mission Control API Integration

πŸš€ New API-Based Integration

This skill now includes proper REST API integration discovered through testing. The API works at http://localhost:4000 and allows real-time Mission Control interaction without database locking or service stopping.

Quick Start

1. Install Dependencies

cd /Users/nimbletenthousand/.openclaw/skills/autensa-opencloser-mission-control
npm install

2. Test API Connection

npm run api-test
# or
node autensa-api.js test

3. Setup Complete Project Board

npm run api-setup -- "Project Name" "Project description"
# or
node autensa-api.js setup "Anniversary Gifts SEO" "Comprehensive SEO strategy for affiliate site"

4. List Tasks & Agents

# List all tasks
npm run api-list
# or
node autensa-api.js list

# List available agents
npm run api-agents
# or
node autensa-api.js agents

API Commands

Complete Board Setup

node autensa-api.js setup "Social Media Campaign" "Q2 campaign targeting tech entrepreneurs"

Creates:

  • Orchestrator task (assigned to Planning Agent)
  • 6 balanced tasks across strategy, content, technical, research, execution, review
  • Intelligent agent assignment based on task content
  • Returns Mission Control URL immediately

Task Management

# Create single task
node autensa-api.js create "Mobile Optimization" "Implement mobile SEO improvements"

# Update existing task
node autensa-api.js update "Content Calendar" "Add video content planning"

# Search tasks
node autensa-api.js search "seo"

Monitoring

# List tasks in default workspace
node autensa-api.js workspace

# Test API connectivity
node autensa-api.js test

API Endpoints Discovered

Working Endpoints:

  • GET /api/tasks - List all tasks
  • POST /api/tasks - Create new tasks
  • GET /api/tasks/:id - Get specific task
  • PUT /api/tasks/:id - Update task status
  • GET /api/agents - List available agents
  • GET /api/workspaces - List workspaces

Validation Rules (Learned from Testing):

  • Priority must be: "low", "normal", "high", or "urgent" (NOT "medium")
  • Status must be: "planning", "inbox", "assigned", "in_progress", "done"
  • Required fields: title, workspace_id, status, priority

Intelligent Agent Assignment

The API integration includes smart agent matching:

Agent Matching Logic:

  1. Content tasks β†’ Content/Writer agents
  2. Technical tasks β†’ Technical/Engineer agents
  3. Research tasks β†’ Research/Analyst agents
  4. Strategy tasks β†’ Planning/Strategy agents
  5. Marketing tasks β†’ Marketing/Social agents

Example:

  • Task: "Mobile SEO Optimization" β†’ Technical agent
  • Task: "Content Calendar Creation" β†’ Content agent
  • Task: "Keyword Research" β†’ Research agent
  • Task: "Project Strategy" β†’ Planning agent

Complete Board Setup Workflow

When User Says "Fill Up My Board":

  1. Gather requirements - Ask about project goals
  2. Fetch agents - Get available agents via /api/agents
  3. Create orchestrator - High priority task for coordination
  4. Create balanced tasks - 6 tasks across different specialties
  5. Assign agents intelligently - Match tasks to appropriate agents
  6. Provide URL - Give Mission Control URL: http://localhost:4000
  7. Enable updates - Allow "Update [task] with [details]" requests

Example Output:

πŸš€ Setting up complete board for: Social Media Campaign
πŸ“ Description: Q2 campaign targeting tech entrepreneurs
────────────────────────────────────────────────────────────

1. Creating orchestrator task...
βœ… Created orchestrator: Social Media Campaign Project Orchestration

2. Creating 6 project tasks...
βœ… Created: Social Media Campaign - Strategy & Planning
βœ… Created: Social Media Campaign - Research & Analysis  
βœ… Created: Social Media Campaign - Content Development
βœ… Created: Social Media Campaign - Technical Implementation
βœ… Created: Social Media Campaign - Execution & Delivery
βœ… Created: Social Media Campaign - Review & Optimization

🎯 Project Board Setup Complete!
==================================================
Project: Social Media Campaign
Total Tasks: 7
Mission Control URL: http://localhost:4000
Workspace ID: c4e9bcfa-4e42-4872-9390-abd42fdebccc

πŸš€ Next Steps:
1. Visit http://localhost:4000 to see all tasks
2. Review agent assignments in Mission Control UI
3. Monitor progress through the dashboard
4. Request updates via: "Update [task title] with [new details]"

Integration with OpenClaw

Sample Agent Responses:

// When user requests board setup
async function handleBoardSetup(projectName, description) {
  const api = new AutensaAPIManager();
  const summary = await api.setupCompleteBoard(projectName, description);
  
  return `🎯 I've set up a complete board for "${projectName}" with ${summary.totalTasks} tasks!
  
β€’ **Mission Control URL**: ${summary.missionControlUrl}
β€’ **Tasks Created**: ${summary.tasksByPriority.high} high priority, ${summary.tasksByPriority.normal} normal priority

You can now:
1. Visit ${summary.missionControlUrl} to see all tasks
2. Review agent assignments
3. Request updates: "Update [task] with [details]"
4. Monitor progress in real-time`;
}

// When user requests task update
async function handleTaskUpdate(taskTitle, updateText) {
  const api = new AutensaAPIManager();
  const updated = await api.updateTaskByTitle(taskTitle, {
    description: updateText
  });
  
  return `βœ… Updated task "${updated.title}" successfully!
  
The task now includes: "${updateText}"

You can see this update in Mission Control immediately: ${api.baseUrl.replace('/api', '')}`;
}

Environment Variables

# Override API URL
export MISSION_CONTROL_API_URL=http://localhost:4000

# Use custom workspace
export MISSION_CONTROL_WORKSPACE_ID=your-workspace-id

# Run with custom URL
MISSION_CONTROL_API_URL=http://localhost:4000 node autensa-api.js test

Troubleshooting

API Connection Issues:

# Test basic connectivity
curl http://localhost:4000/api/tasks

# Check if Mission Control is running
ps aux | grep mission-control

# Verify API endpoint
curl http://localhost:4000/api/agents

Common Errors:

  • "Cannot connect" - Mission Control not running at http://localhost:4000
  • "Validation failed" - Invalid priority or status values
  • "Task not found" - Task title doesn't match exactly

Validation Checklist:

  • βœ… Mission Control running at http://localhost:4000
  • βœ… Priority is low, normal, high, or urgent
  • βœ… Status is planning, inbox, assigned, in_progress, or done
  • βœ… Workspace ID exists (default: c4e9bcfa-4e42-4872-9390-abd42fdebccc)

Why API is Better

βœ… Advantages over Database Access:

  1. No service interruption - Mission Control keeps running
  2. Real-time updates - UI updates immediately
  3. No database locking - Concurrent access works
  4. Proper validation - API enforces rules
  5. Better architecture - Uses intended interface

βœ… Successfully Tested:

  • Creating tasks via POST /api/tasks
  • Updating tasks via PUT /api/tasks/:id
  • Fetching agents via GET /api/agents
  • Listing tasks via GET /api/tasks

Next Steps

  1. Test the API - Run node autensa-api.js test
  2. Setup a project - Try node autensa-api.js setup "Test Project" "Testing API"
  3. Verify in UI - Check http://localhost:4000
  4. Request updates - Try "Update [task] with [details]"

The API integration provides the proper, sustainable way to work with Mission Control without the database locking issues!