Skip to content

IDE & Copilot

The Purple8 IDE is a full browser-based development environment built into the platform. It has two AI modes: Edit Mode and Agent Mode.

Edit Mode

Edit Mode provides inline completions and actions at the cursor — similar to GitHub Copilot but context-aware of your entire generated project.

Inline completion

bash
POST /api/ide/copilot/edit/complete
json
{
  "file_path": "app/routers/users.py",
  "cursor_line": 42,
  "cursor_col": 8,
  "context_before": "def create_user(db: Session, user: UserCreate):\n    ",
  "context_after": "\n    db.add(db_user)\n    db.commit()",
  "project_name": "my-api"
}

Named actions

bash
POST /api/ide/copilot/edit/action
json
{
  "action": "add-tests",
  "file_path": "app/routers/users.py",
  "project_name": "my-api"
}

Available actions: explain · refactor · add-tests · add-docstrings · fix-lint · optimise

Suggestions

bash
POST /api/ide/copilot/edit/suggest

Returns a list of improvement suggestions for a selected code block.

Agent Mode

Agent Mode is a conversational AI that understands your entire project — files, history, errors, and the decisions the build agents made.

bash
POST /api/ide/copilot/agent/chat/stream   # streaming (recommended)
POST /api/ide/copilot/agent/chat          # synchronous
json
{
  "session_id": "ide_abc123",
  "message": "Why is my auth middleware returning 403 for valid tokens?",
  "file_context": ["app/middleware/auth.py", "app/routers/users.py"]
}

Agent Mode can:

  • Explain why code was written a certain way (it has access to the build agent's reasoning)
  • Debug errors with full project context
  • Refactor across multiple files at once
  • Answer architecture questions with reference to the actual implementation

Quick actions

Single-shot actions without starting a session:

bash
POST /api/ide/copilot/quick/explain   # explain selected code
POST /api/ide/copilot/quick/fix       # fix a lint error or exception traceback

Sandbox execution

The IDE runs code in an isolated Docker sandbox — never on the host.

bash
POST /api/sandbox/sessions            # create a sandbox
POST /api/sandbox/sessions/{id}/launch  # run a command

{
  "command": "pytest tests/ -v --tb=short",
  "cwd": "/workspace"
}

Available runtimes: python3.12 · node20

Sandboxes are pre-warmed (4 Python + 4 Node pools) so there's no cold-start delay.

Purple8 Builder is proprietary software. All rights reserved.