Metadata-Version: 2.4
Name: harness-unity-bridge
Version: 0.3.0
Summary: Control Unity Editor from DeepSeek Harness — run tests, compile, get logs, build, and more via a file-based bridge
License: Apache-2.0
Project-URL: Homepage, https://github.com/WarrenMondeville/harness-unity-bridge
Project-URL: Repository, https://github.com/WarrenMondeville/harness-unity-bridge
Project-URL: Issues, https://github.com/WarrenMondeville/harness-unity-bridge/issues
Project-URL: Changelog, https://github.com/WarrenMondeville/harness-unity-bridge/releases
Project-URL: PyPI, https://pypi.org/project/harness-unity-bridge/
Keywords: unity,deepseek,deepseek-harness,harness,game-development,unity-editor,automation,testing,bridge,cli,ai-agent
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Games/Entertainment
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: flake8>=6.0; extra == "dev"

# Harness Unity Bridge

[![PyPI](https://img.shields.io/pypi/v/harness-unity-bridge)](https://pypi.org/project/harness-unity-bridge/)
[![Python 3.8+](https://img.shields.io/pypi/pyversions/harness-unity-bridge)](https://pypi.org/project/harness-unity-bridge/)
[![CI](https://github.com/WarrenMondeville/harness-unity-bridge/actions/workflows/test-skill.yml/badge.svg)](https://github.com/WarrenMondeville/harness-unity-bridge/actions/workflows/test-skill.yml)
[![codecov](https://codecov.io/gh/WarrenMondeville/harness-unity-bridge/graph/badge.svg?token=3PHF2GXHON)](https://codecov.io/gh/WarrenMondeville/harness-unity-bridge)
[![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://github.com/WarrenMondeville/harness-unity-bridge/blob/main/LICENSE)
[![Unity 2021.3+](https://img.shields.io/badge/Unity-2021.3%2B-black.svg)](https://unity.com/)
[![PyPI Downloads](https://img.shields.io/pypi/dm/harness-unity-bridge)](https://pypi.org/project/harness-unity-bridge/)

> File-based bridge enabling DeepSeek Harness to control Unity Editor operations in a running editor instance.

## Why Harness Unity Bridge?

- **Zero config** — No network setup, no port conflicts. Just install and go.
- **Deterministic CLI** — Tested Python script handles UUIDs, polling, retries, and cleanup so DeepSeek Harness doesn't have to.
- **Multi-project** — Each Unity project gets its own `.harness-unity-bridge/` directory. Work on multiple projects simultaneously.
- **Full editor control** — Run tests, compile, check logs, refresh assets, build, and control Play Mode.
- **Cross-platform** — macOS, Linux, and Windows support.

## Installation

**Install the CLI:**

```bash
pip install harness-unity-bridge
harness-unity-bridge install-skill
```

Or use the one-line installer:

```bash
# macOS / Linux / Git Bash
curl -sSL https://raw.githubusercontent.com/WarrenMondeville/harness-unity-bridge/main/install.sh | bash

# Windows (PowerShell)
irm https://raw.githubusercontent.com/WarrenMondeville/harness-unity-bridge/main/install.ps1 | iex
```

**Add the Unity package** (in Unity Editor):

`Window > Package Manager > + > Add package from git URL...`

```
https://github.com/WarrenMondeville/harness-unity-bridge.git?path=package
```

## Quick Start

Open DeepSeek Harness in your Unity project directory and ask naturally:

```
"Run the Unity tests"
"Check for compilation errors"
"Show me the error logs"
"Build for Android"
```

Or use the CLI directly:

```bash
harness-unity-bridge run-tests --mode EditMode
harness-unity-bridge compile
harness-unity-bridge get-console-logs --limit 10
harness-unity-bridge get-status
harness-unity-bridge build --target Android
```

## Commands

| Command | Description |
|---------|-------------|
| `run-tests` | Execute EditMode or PlayMode tests with optional filters |
| `compile` | Trigger script compilation and report errors |
| `get-console-logs` | Retrieve Unity console output (filter by Log/Warning/Error) |
| `get-status` | Check editor state — compilation, play mode, updating |
| `refresh` | Force asset database refresh |
| `play` / `pause` / `step` | Control Play Mode — enter, pause, step frames |
| `build` | Build project with direct pipeline or custom method |

## How It Works

```
DeepSeek Harness  -->  harness-unity-bridge CLI  -->  .harness-unity-bridge/command.json
                                                  |
                                            Unity Editor
                                                  |
DeepSeek Harness  <--  harness-unity-bridge CLI  <--  .harness-unity-bridge/response-{id}.json
```

1. DeepSeek Harness (or you) runs a `harness-unity-bridge` command
2. The CLI writes a JSON command with a unique UUID
3. Unity Editor polls for and executes the command
4. The CLI polls for the response with exponential backoff
5. Results are formatted and displayed; response files are cleaned up

All file I/O is atomic (temp file + rename) to prevent corruption. The CLI handles file locking, retries, and stale file cleanup automatically.

## Updating

```bash
harness-unity-bridge update
```

## Documentation

- [Installation Options](https://github.com/WarrenMondeville/harness-unity-bridge/blob/main/docs/INSTALLATION.md) — Alternative installation methods
- [Usage Guide](https://github.com/WarrenMondeville/harness-unity-bridge/blob/main/docs/USAGE.md) — Command formats and response details
- [Architecture](https://github.com/WarrenMondeville/harness-unity-bridge/blob/main/docs/ARCHITECTURE.md) — Project structure and design
- [Command Reference](https://github.com/WarrenMondeville/harness-unity-bridge/blob/main/skill/references/COMMANDS.md) — Complete command specification

## License

[Apache 2.0](https://github.com/WarrenMondeville/harness-unity-bridge/blob/main/LICENSE)
