Metadata-Version: 2.4
Name: omnyx-windsurf
Version: 0.1.5
Summary: Omnyx personality adaptation for Windsurf IDE via MCP
License: MIT
Requires-Python: >=3.10
Requires-Dist: click>=8.1.0
Requires-Dist: mcp>=1.0.0
Requires-Dist: platformdirs>=4.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: requests>=2.31.0
Provides-Extra: dev
Requires-Dist: black; extra == 'dev'
Requires-Dist: mypy; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Description-Content-Type: text/markdown

# Omnyx Windsurf Plugin

Personality-driven adaptation for [Windsurf](https://codeium.com/windsurf) IDE via MCP (Model Context Protocol) and settings injection.

## Installation

```bash
cd omnyx-windsurf
pip install -e .
```

## How It Works

Windsurf supports **MCP (Model Context Protocol)** — an open standard for extending AI capabilities. This plugin provides:

1. **MCP Server** — Windsurf connects to `omnyx-windsurf` as an MCP tool
2. **Settings Injection** — Modifies `.windsurfrc` with personality-driven configurations
3. **Cascade Context** — Injects personality context into every AI interaction

## Architecture

```
┌──────────────┐     ┌──────────────┐     ┌─────────────────┐
│   Windsurf   │◄───►│ omnyx-windsurf│◄───►│  Omnyx Backend  │
│    IDE       │ MCP │   MCP Server  │     │  (/api/agentic) │
│              │     │               │     │                 │
│ • Cascade    │     │ • Personality │     │                 │
│ • Settings   │     │   analysis    │     │                 │
│ • Config     │     │ • Autonomy    │     │                 │
│   files      │     │   mapping     │     │                 │
└──────────────┘     └──────────────┘     └─────────────────┘
```

## Setup

### Quick Setup (One Command)

```bash
omnyx-windsurf setup --api-key omx_your_key_here --auto-configure
```

Then restart Windsurf IDE.

### Manual Setup (Step by Step)

**Step 1:** Configure Omnyx
```bash
omnyx-windsurf setup --api-key omx_...
```

**Step 2:** Configure Windsurf
```bash
omnyx-windsurf configure-windsurf
```

**Step 3:** Restart Windsurf IDE

### Where Config Files Go

The plugin creates/modifies these files:

**MCP Config:**
- macOS: `~/Library/Application Support/Windsurf/mcp_config.json`
- Linux: `~/.config/Windsurf/mcp_config.json`
- Windows: `%APPDATA%\Windsurf\mcp_config.json`

**Windsurf Settings:**
- All platforms: `~/.windsurfrc`

This creates/modifies:
```json
// .windsurfrc
{
  "omnyx.enabled": true,
  "omnyx.autonomy_level": "adaptive",
  "omnyx.planning_mode": "detailed",
  "omnyx.verbosity": "profile_based",
  "omnyx.test_generation": "comprehensive",
  "omnyx.cascade.context_injection": true
}
```

## Usage

### Important: Manual Invocation Required

Unlike Hermes (which auto-intercepts every prompt), Windsurf requires **explicit** tool calls via `@omnyx`:

```
@omnyx get_profile                      # Check your profile
@omnyx adapt_task "Build a React app"   # Get task adaptation
```

**Why?** MCP (Model Context Protocol) doesn't expose pre-prompt hooks. Windsurf must actively call the tool.

### System Prompt Injection

When you call `@omnyx adapt_task`, the plugin:
1. Sends your task to Omnyx backend
2. Receives personality-adapted settings
3. Updates `.windsurfrc` with `cascade.system_prompt_prefix`
4. Cascade reads this and adjusts future behavior

**Note**: System prompt affects Cascade's style but doesn't auto-send subsequent prompts to Omnyx.

## MCP Tools Provided

The plugin exposes these MCP tools to Windsurf:

### `omnyx_get_profile`
Get current personality profile and confidence score.

**Returns:**
```json
{
  "confidence": 0.82,
  "autonomy_level": "checkpointed",
  "planning_style": "detailed",
  "communication_style": "thorough",
  "last_updated": "2024-01-15T10:30:00Z"
}
```

### `omnyx_adapt_task`
Get autonomy configuration for a specific task.

**Input:**
```json
{
  "task_description": "Build user authentication",
  "estimated_scope": "medium",
  "file_context": ["src/auth.py", "src/models.py"]
}
```

**Returns:**
```json
{
  "autonomy": "checkpointed",
  "planning_depth": "detailed",
  "test_coverage": "comprehensive",
  "cascade_instructions": "[Context: User prefers comprehensive solutions]"
}
```

### `omnyx_get_suggestions`
Retrieve pending personalization suggestions.

### `omnyx_accept_suggestion` / `omnyx_dismiss_suggestion`
Manage suggestion workflow.

## Privacy Modes

Configure via `.windsurfrc` or CLI:

```bash
# Mode 1: Full context (default)
omnyx-windsurf config --privacy-mode raw_prompts

# Mode 2: Task only (no file contents)
omnyx-windsurf config --privacy-mode task_only

# Mode 3: Paused
omnyx-windsurf config --privacy-mode paused
```

## Commands

```bash
omnyx-windsurf setup --api-key omx_...     # Initial configuration
omnyx-windsurf configure-windsurf          # Install MCP config
omnyx-windsurf status                      # Show profile and connection
omnyx-windsurf mcp                         # Start MCP server (for Windsurf)
omnyx-windsurf config                      # View/change settings
omnyx-windsurf check "task description"    # Test adaptation
omnyx-windsurf forget                      # Clear all data
```

## Integration with .windsurfrc

The plugin modifies `.windsurfrc` to inject context:

```json
{
  "cascade.system_prompt": "[Omnyx: User prefers detailed explanations with trade-off analysis. Confidence: 82%]",
  
  "omnyx.autonomy": {
    "level": "checkpointed",
    "checkpoint_frequency": "major_decisions"
  },
  
  "omnyx.style": {
    "verbosity": "high",
    "warmth": "medium",
    "structure": "detailed"
  },
  
  "omnyx.testing": {
    "coverage": "comprehensive",
    "include_edge_cases": true
  }
}
```

## Development

```bash
# Run MCP server directly for testing
omnyx-windsurf mcp --debug

# Test task adaptation
omnyx-windsurf check "Refactor authentication module"
```

## Differences from omnyx-devin

| Aspect | omnyx-devin (Cognition) | omnyx-windsurf |
|--------|------------------------|----------------|
| **Integration** | Requires vendor support | ✅ MCP protocol (works now) |
| **Config method** | API calls | `.windsurfrc` settings |
| **Context** | Task descriptions | Files + workspace context |
| **Real-time** | Batch | ✅ Live via MCP |
| **UI injection** | None | ✅ Cascade system prompt |
