---
title: ui_protocol | CodeWeaver Docs
description: API reference for codeweaver.core.ui_protocol
url: "https://docs.knitli.com/api/core/ui_protocol"
type: static
generatedAt: "2026-04-17T17:21:08.259Z"
---

# ui_protocol
       [Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Fui_protocol%2F.%20I%20want%20to%20ask%20questions%20about%20it.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Fui_protocol%2F.%20I%20want%20to%20ask%20questions%20about%20it.)[View in Markdown](/codeweaver/api/core/ui_protocol.md)       [Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Fui_protocol%2F)[Share on X](https://x.com/intent/tweet?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Fui_protocol%2F&text=ui_protocol)[Share on Threads](https://threads.net/intent/post?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Fui_protocol%2F&text=ui_protocol)[Share on Bluesky](https://bsky.app/intent/compose?text=ui_protocol%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Fui_protocol%2F)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Fui_protocol%2F)[Share on Reddit](https://reddit.com/submit?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Fui_protocol%2F&title=ui_protocol)[Share on Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Fui_protocol%2F&t=ui_protocol)[Share on Email](mailto:?subject=ui_protocol&body=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Fui_protocol%2F)[Share on WhatsApp](https://wa.me/?text=ui_protocol%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Fui_protocol%2F)[Share on Telegram](https://t.me/share/url?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Fui_protocol%2F&text=ui_protocol)
# `codeweaver.core.ui_protocol`
[Section titled “codeweaver.core.ui_protocol”](#codeweavercoreui_protocol)
UI protocol for reporting progress and status to presentation layers.

Defines thin protocol layer over Rich primitives for dependency inversion. Rich provides the output primitives (Console, Progress), this provides the abstraction layer that enables correct dependency direction.

Key Design:

 - Protocol is thin wrapper over Rich concepts
 - Implementations use Rich primitives directly
 - Business logic depends on protocol (not Rich or CLI)
 - CLI/Server provide Rich-based implementations

## Class: `NoOpProgressReporter`
[Section titled “Class: NoOpProgressReporter”](#class-noopprogressreporter)
No-op implementation for non-interactive environments.

Used when:

 - Running in server/daemon mode without CLI
 - Testing without UI
 - Library usage scenarios

### Method: `complete_operation`
[Section titled “Method: complete_operation”](#method-complete_operation)

**

```
complete_operation()
```

No-op complete operation.

### Method: `report_error`
[Section titled “Method: report_error”](#method-report_error)

**

```
report_error()
```

No-op error report.

### Method: `report_progress`
[Section titled “Method: report_progress”](#method-report_progress)

**

```
report_progress()
```

No-op progress report.

### Method: `report_status`
[Section titled “Method: report_status”](#method-report_status)

**

```
report_status()
```

No-op status report.

### Method: `start_operation`
[Section titled “Method: start_operation”](#method-start_operation)

**

```
start_operation()
```

No-op start operation.

## Class: `ProgressReporter`
[Section titled “Class: ProgressReporter”](#class-progressreporter)
Protocol for reporting progress to UI layer.

Business logic (engine, server) depends on this protocol. Presentation layers (CLI, web UI) implement this protocol.

This inversion enables correct dependency direction:

 - Core defines protocol (no dependencies)
 - Business logic depends on protocol (depends on core)
 - UI layer implements protocol (depends on core + business logic)

### Method: `complete_operation`
[Section titled “Method: complete_operation”](#method-complete_operation-1)

**

```
complete_operation()
```

Signal completion of operation.

Args: operation: Operation identifier success: Whether operation succeeded message: Completion message

### Method: `report_error`
[Section titled “Method: report_error”](#method-report_error-1)

**

```
report_error()
```

Report error.

Args: error: Error to report recoverable: Whether the error is recoverable extra: Additional context

### Method: `report_progress`
[Section titled “Method: report_progress”](#method-report_progress-1)

**

```
report_progress()
```

Report progress update.

Args: phase: Current operation phase (e.g., “discovery”, “indexing”) current: Current progress count total: Total items to process extra: Additional context for the UI

### Method: `report_status`
[Section titled “Method: report_status”](#method-report_status-1)

**

```
report_status()
```

Report status message.

Args: message: Status message to display level: Message level (“debug”, “info”, “warning”, “error”) extra: Additional context

### Method: `start_operation`
[Section titled “Method: start_operation”](#method-start_operation-1)

**

```
start_operation()
```

Signal start of long-running operation.

Args: operation: Operation identifier description: Human-readable description

## Class: `RichConsoleProgressReporter`
[Section titled “Class: RichConsoleProgressReporter”](#class-richconsoleprogressreporter)
Rich Console-based implementation for server/non-CLI environments.

Uses Rich Console directly without CLI’s StatusDisplay. Suitable for:

 - Server/daemon mode (structured output to logs)
 - Simple CLI tools without full StatusDisplay
 - Testing with visible output

### Method: `complete_operation`
[Section titled “Method: complete_operation”](#method-complete_operation-2)

**

```
complete_operation()
```

Print operation completion.

### Method: `report_error`
[Section titled “Method: report_error”](#method-report_error-2)

**

```
report_error()
```

Print error with Rich formatting.

### Method: `report_progress`
[Section titled “Method: report_progress”](#method-report_progress-2)

**

```
report_progress()
```

Print progress using Rich Console.

### Method: `report_status`
[Section titled “Method: report_status”](#method-report_status-2)

**

```
report_status()
```

Print status with Rich formatting.

### Method: `start_operation`
[Section titled “Method: start_operation”](#method-start_operation-2)

**

```
start_operation()
```

Print operation start.