xdharness 1.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- xdharness-1.0.1/LICENSE +21 -0
- xdharness-1.0.1/PKG-INFO +210 -0
- xdharness-1.0.1/README.md +181 -0
- xdharness-1.0.1/pyproject.toml +57 -0
- xdharness-1.0.1/setup.cfg +4 -0
- xdharness-1.0.1/setup.py +3 -0
- xdharness-1.0.1/xdh.py +2746 -0
- xdharness-1.0.1/xdharness.egg-info/PKG-INFO +210 -0
- xdharness-1.0.1/xdharness.egg-info/SOURCES.txt +11 -0
- xdharness-1.0.1/xdharness.egg-info/dependency_links.txt +1 -0
- xdharness-1.0.1/xdharness.egg-info/entry_points.txt +3 -0
- xdharness-1.0.1/xdharness.egg-info/requires.txt +2 -0
- xdharness-1.0.1/xdharness.egg-info/top_level.txt +1 -0
xdharness-1.0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 PwnedBytes0x1
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
xdharness-1.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: xdharness
|
|
3
|
+
Version: 1.0.1
|
|
4
|
+
Summary: xdh (xdharness) - Autonomous Terminal Agent Harness & TUI for Android Termux, Linux, macOS, and Windows
|
|
5
|
+
Author-email: PwnedBytes0x1 <pwnedbytes@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/PwnedBytes0x1/xdh
|
|
8
|
+
Project-URL: Documentation, https://github.com/PwnedBytes0x1/xdh/tree/main/docs/wiki
|
|
9
|
+
Project-URL: Repository, https://github.com/PwnedBytes0x1/xdh.git
|
|
10
|
+
Project-URL: Issues, https://github.com/PwnedBytes0x1/xdh/issues
|
|
11
|
+
Keywords: ai,agent,terminal,tui,cli,llm,termux,developer-tools,prompt-toolkit,rich
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Topic :: Software Development :: User Interfaces
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Environment :: Console
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: prompt_toolkit>=3.0.36
|
|
27
|
+
Requires-Dist: rich>=13.0.0
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
|
|
30
|
+
<div align="center">
|
|
31
|
+
|
|
32
|
+
# ⚡ xdh (xdharness)
|
|
33
|
+
|
|
34
|
+
**Autonomous Terminal Agent Harness & TUI**
|
|
35
|
+
*Cross-platform intelligence for Android Termux, Linux, macOS, and Windows*
|
|
36
|
+
|
|
37
|
+
[](https://github.com/PwnedBytes0x1/xdh/releases)
|
|
38
|
+
[](LICENSE)
|
|
39
|
+
[](https://python.org)
|
|
40
|
+
[](https://github.com/PwnedBytes0x1/xdh)
|
|
41
|
+
|
|
42
|
+
[Features](#-features) • [Installation](#-installation) • [Quick Start](#-quick-start) • [Slash Commands](#-slash-commands) • [Documentation & Wiki](#-documentation--wiki) • [Architecture](#-architecture) • [Contributing](#-contributing)
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
## 🌟 Highlights
|
|
49
|
+
|
|
50
|
+
`xdh` is a lightweight, high-performance terminal agent harness and Text User Interface (TUI) built for autonomous code generation, system exploration, and agentic workflows. Designed with first-class support for **Android Termux** as well as standard desktop operating systems.
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
██╗ ██╗██████╗ ██╗ ██╗
|
|
54
|
+
╚██╗██╔╝██╔══██╗██║ ██║
|
|
55
|
+
╚███╔╝ ██║ ██║███████║
|
|
56
|
+
██╔██╗ ██║ ██║██╔══██║
|
|
57
|
+
██╔╝ ██╗██████╔╝██║ ██║ xdharness v1.0.1
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## 🚀 Features
|
|
63
|
+
|
|
64
|
+
- 🖥️ **3-Segment Layout**: Real-time context header (tokens, RAM, latency, provider/model), scrollable history viewport with collapsible blocks, and dynamic multi-line composer.
|
|
65
|
+
- 🔄 **Multi-Provider Failover**: Native streaming integration with OpenAI, OpenRouter, Anthropic, DeepSeek, Groq, Ollama, LM Studio, and more. Automatically fails over to backup providers on rate limits (429) or server errors (5xx).
|
|
66
|
+
- 🛠️ **Autonomous Agent Tools**:
|
|
67
|
+
- `bash_run`: Sandboxed execution with timeout and output capture.
|
|
68
|
+
- `read_file` & `write_file`: Atomic file read/write with automatic backup generation.
|
|
69
|
+
- `edit_file`: Smart fuzzy matching and targeted block replacement.
|
|
70
|
+
- `diff_files` & `/apply`: Unified diff generator and staged hunk applicator.
|
|
71
|
+
- `web_search` & `web_fetch`: DuckDuckGo query integration and readable text extraction.
|
|
72
|
+
- `bg_task`: Background task runner with detached output streams.
|
|
73
|
+
- `tree_view`: Directory visualizer with gitignore-awareness.
|
|
74
|
+
- 🎨 **7 Curated Color Palettes**: `tokyo_night`, `dracula`, `catppuccin`, `monokai`, `nord`, `cyberpunk`, and `gruvbox`.
|
|
75
|
+
- 📱 **Mobile & Termux First**: Smooth step-scroll animation for touch gestures, compact mini-banners for narrow viewports (<70 cols), and zero heavy C-extension dependencies.
|
|
76
|
+
- 🧠 **Context Optimization**: Automatic message history compaction when nearing token capacity thresholds.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 📦 Installation
|
|
81
|
+
|
|
82
|
+
### From Source (Git)
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
git clone https://github.com/PwnedBytes0x1/xdh.git
|
|
86
|
+
cd xdh
|
|
87
|
+
pip install -r requirements.txt
|
|
88
|
+
pip install -e .
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Direct Execution
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
python3 -m xdh --version
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Termux Quick Setup
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
pkg update && pkg install python git -y
|
|
101
|
+
git clone https://github.com/PwnedBytes0x1/xdh.git
|
|
102
|
+
cd xdh
|
|
103
|
+
pip install -r requirements.txt
|
|
104
|
+
ln -s $(pwd)/xdh.py $PREFIX/bin/xdh
|
|
105
|
+
chmod +x $PREFIX/bin/xdh
|
|
106
|
+
xdh
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## ⚡ Quick Start
|
|
112
|
+
|
|
113
|
+
1. **Launch `xdh`**:
|
|
114
|
+
```bash
|
|
115
|
+
xdh
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
2. **Configure Your Provider & Key**:
|
|
119
|
+
Type `/settings` inside the interface or edit `~/.xdharness/config.json`. You can switch providers dynamically:
|
|
120
|
+
```text
|
|
121
|
+
xdh ❯ /provider openrouter
|
|
122
|
+
xdh ❯ /model anthropic/claude-3.5-sonnet
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
3. **Interact**:
|
|
126
|
+
Type plain language prompts to instruct the agent to inspect files, execute tests, refactor code, or run background builds.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## ⌨️ Slash Commands
|
|
131
|
+
|
|
132
|
+
| Command | Description | Example |
|
|
133
|
+
| :--- | :--- | :--- |
|
|
134
|
+
| `/settings` | Open interactive settings & quick toggles | `/settings theme dracula` |
|
|
135
|
+
| `/provider` | Switch active provider | `/provider openai` |
|
|
136
|
+
| `/model` | Switch model for active provider | `/model gpt-4o` |
|
|
137
|
+
| `/theme` | Switch color theme palette | `/theme catppuccin` |
|
|
138
|
+
| `/tools` | Enable or disable agent function tools | `/tools on` or `/tools off` |
|
|
139
|
+
| `/thinking` | Toggle live thought/reasoning token streaming | `/thinking on` |
|
|
140
|
+
| `/diff` | Inspect staged file diffs proposed by agent | `/diff` |
|
|
141
|
+
| `/apply` | Apply pending unified diffs to files | `/apply` |
|
|
142
|
+
| `/tasks` | List, inspect, or kill background tasks | `/tasks list` / `/tasks logs <id>` |
|
|
143
|
+
| `/git` | Execute git status, diff, or commit directly | `/git status` |
|
|
144
|
+
| `/scratch` | Access or update persistent scratchpad memo | `/scratch set <notes>` |
|
|
145
|
+
| `/tree` | Print directory tree of current workspace | `/tree` |
|
|
146
|
+
| `/index` | Build or query workspace keyword index | `/index build` |
|
|
147
|
+
| `/copy` | Copy last response or code block to clipboard | `/copy` |
|
|
148
|
+
| `/undo` | Roll back latest file edit from backups | `/undo` |
|
|
149
|
+
| `/clear` | Clear viewport history (or `Ctrl+L`) | `/clear` |
|
|
150
|
+
| `/help` | Show command reference table | `/help` |
|
|
151
|
+
| `/exit` | Save session state and exit (or `Ctrl+Q`) | `/exit` |
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## ⌨️ Keybindings
|
|
156
|
+
|
|
157
|
+
- **`Tab`**: Auto-complete slash command / accept ghost suggestion.
|
|
158
|
+
- **`Right Arrow`**: Accept ghost suggestion at line end.
|
|
159
|
+
- **`Up / Down`**: Navigate history or smooth-scroll conversation viewport.
|
|
160
|
+
- **`Ctrl+T`**: Cycle color themes dynamically.
|
|
161
|
+
- **`Ctrl+P`**: Cycle configured AI providers.
|
|
162
|
+
- **`Ctrl+O`**: Toggle block collapse (compact vs expanded summary).
|
|
163
|
+
- **`Ctrl+L`**: Clear current viewport.
|
|
164
|
+
- **`Ctrl+C`**: Interrupt running generation / exit.
|
|
165
|
+
- **`Ctrl+Q`**: Save session and quit.
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## 📚 Documentation & Wiki
|
|
170
|
+
|
|
171
|
+
Detailed guides and specifications are organized in [`docs/wiki/`](docs/wiki/):
|
|
172
|
+
|
|
173
|
+
- 🏠 **[Home & Overview](docs/wiki/Home.md)**: Product overview and architecture.
|
|
174
|
+
- 🚀 **[Getting Started & Installation](docs/wiki/Getting-Started.md)**: Step-by-step setup across Termux, Linux, macOS, and Windows.
|
|
175
|
+
- ⚙️ **[Configuration & Providers](docs/wiki/Configuration.md)**: API keys, model parameters, custom endpoints, and auto-failover.
|
|
176
|
+
- 🛠️ **[Tools & Workflows](docs/wiki/Tools-and-Capabilities.md)**: Deep dive into diff generation, sandbox execution, web search, and tasks.
|
|
177
|
+
- 🎨 **[Theming & UI Customization](docs/wiki/Theming.md)**: Theme reference and customizing styles.
|
|
178
|
+
- 🔌 **[Extensibility & Architecture](docs/wiki/Architecture.md)**: Harness internals, compaction, streaming protocols, and lifecycle.
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## 🏗️ Architecture
|
|
183
|
+
|
|
184
|
+
```mermaid
|
|
185
|
+
flowchart TD
|
|
186
|
+
User([User Terminal / Touch]) --> UI[XDHApp TUI Container]
|
|
187
|
+
UI --> Layout[3-Segment Layout: Header, Viewport, Composer]
|
|
188
|
+
UI --> Engine[XDHarness Core Engine]
|
|
189
|
+
Engine --> ProviderRouter[Provider Router & Failover]
|
|
190
|
+
ProviderRouter --> LLM[Streaming API / Ollama / OpenAI / OpenRouter]
|
|
191
|
+
Engine --> ToolManager[Autonomous Tool Execution Engine]
|
|
192
|
+
ToolManager --> Filesystem[(Filesystem & Atomic Backups)]
|
|
193
|
+
ToolManager --> Shell[Subprocess Shell & BG Tasks]
|
|
194
|
+
ToolManager --> Web[DuckDuckGo / Web Fetcher]
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## 🤝 Contributing & Community
|
|
200
|
+
|
|
201
|
+
Contributions are welcome! Please review our community guidelines before getting started:
|
|
202
|
+
- 📜 **[Code of Conduct](CODE_OF_CONDUCT.md)**
|
|
203
|
+
- 💡 **[Contributing Guide](CONTRIBUTING.md)**
|
|
204
|
+
- 🔒 **[Security Policy](SECURITY.md)**
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## 📄 License
|
|
209
|
+
|
|
210
|
+
This project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for details.
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# ⚡ xdh (xdharness)
|
|
4
|
+
|
|
5
|
+
**Autonomous Terminal Agent Harness & TUI**
|
|
6
|
+
*Cross-platform intelligence for Android Termux, Linux, macOS, and Windows*
|
|
7
|
+
|
|
8
|
+
[](https://github.com/PwnedBytes0x1/xdh/releases)
|
|
9
|
+
[](LICENSE)
|
|
10
|
+
[](https://python.org)
|
|
11
|
+
[](https://github.com/PwnedBytes0x1/xdh)
|
|
12
|
+
|
|
13
|
+
[Features](#-features) • [Installation](#-installation) • [Quick Start](#-quick-start) • [Slash Commands](#-slash-commands) • [Documentation & Wiki](#-documentation--wiki) • [Architecture](#-architecture) • [Contributing](#-contributing)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
## 🌟 Highlights
|
|
20
|
+
|
|
21
|
+
`xdh` is a lightweight, high-performance terminal agent harness and Text User Interface (TUI) built for autonomous code generation, system exploration, and agentic workflows. Designed with first-class support for **Android Termux** as well as standard desktop operating systems.
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
██╗ ██╗██████╗ ██╗ ██╗
|
|
25
|
+
╚██╗██╔╝██╔══██╗██║ ██║
|
|
26
|
+
╚███╔╝ ██║ ██║███████║
|
|
27
|
+
██╔██╗ ██║ ██║██╔══██║
|
|
28
|
+
██╔╝ ██╗██████╔╝██║ ██║ xdharness v1.0.1
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 🚀 Features
|
|
34
|
+
|
|
35
|
+
- 🖥️ **3-Segment Layout**: Real-time context header (tokens, RAM, latency, provider/model), scrollable history viewport with collapsible blocks, and dynamic multi-line composer.
|
|
36
|
+
- 🔄 **Multi-Provider Failover**: Native streaming integration with OpenAI, OpenRouter, Anthropic, DeepSeek, Groq, Ollama, LM Studio, and more. Automatically fails over to backup providers on rate limits (429) or server errors (5xx).
|
|
37
|
+
- 🛠️ **Autonomous Agent Tools**:
|
|
38
|
+
- `bash_run`: Sandboxed execution with timeout and output capture.
|
|
39
|
+
- `read_file` & `write_file`: Atomic file read/write with automatic backup generation.
|
|
40
|
+
- `edit_file`: Smart fuzzy matching and targeted block replacement.
|
|
41
|
+
- `diff_files` & `/apply`: Unified diff generator and staged hunk applicator.
|
|
42
|
+
- `web_search` & `web_fetch`: DuckDuckGo query integration and readable text extraction.
|
|
43
|
+
- `bg_task`: Background task runner with detached output streams.
|
|
44
|
+
- `tree_view`: Directory visualizer with gitignore-awareness.
|
|
45
|
+
- 🎨 **7 Curated Color Palettes**: `tokyo_night`, `dracula`, `catppuccin`, `monokai`, `nord`, `cyberpunk`, and `gruvbox`.
|
|
46
|
+
- 📱 **Mobile & Termux First**: Smooth step-scroll animation for touch gestures, compact mini-banners for narrow viewports (<70 cols), and zero heavy C-extension dependencies.
|
|
47
|
+
- 🧠 **Context Optimization**: Automatic message history compaction when nearing token capacity thresholds.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 📦 Installation
|
|
52
|
+
|
|
53
|
+
### From Source (Git)
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
git clone https://github.com/PwnedBytes0x1/xdh.git
|
|
57
|
+
cd xdh
|
|
58
|
+
pip install -r requirements.txt
|
|
59
|
+
pip install -e .
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Direct Execution
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
python3 -m xdh --version
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Termux Quick Setup
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pkg update && pkg install python git -y
|
|
72
|
+
git clone https://github.com/PwnedBytes0x1/xdh.git
|
|
73
|
+
cd xdh
|
|
74
|
+
pip install -r requirements.txt
|
|
75
|
+
ln -s $(pwd)/xdh.py $PREFIX/bin/xdh
|
|
76
|
+
chmod +x $PREFIX/bin/xdh
|
|
77
|
+
xdh
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## ⚡ Quick Start
|
|
83
|
+
|
|
84
|
+
1. **Launch `xdh`**:
|
|
85
|
+
```bash
|
|
86
|
+
xdh
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
2. **Configure Your Provider & Key**:
|
|
90
|
+
Type `/settings` inside the interface or edit `~/.xdharness/config.json`. You can switch providers dynamically:
|
|
91
|
+
```text
|
|
92
|
+
xdh ❯ /provider openrouter
|
|
93
|
+
xdh ❯ /model anthropic/claude-3.5-sonnet
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
3. **Interact**:
|
|
97
|
+
Type plain language prompts to instruct the agent to inspect files, execute tests, refactor code, or run background builds.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## ⌨️ Slash Commands
|
|
102
|
+
|
|
103
|
+
| Command | Description | Example |
|
|
104
|
+
| :--- | :--- | :--- |
|
|
105
|
+
| `/settings` | Open interactive settings & quick toggles | `/settings theme dracula` |
|
|
106
|
+
| `/provider` | Switch active provider | `/provider openai` |
|
|
107
|
+
| `/model` | Switch model for active provider | `/model gpt-4o` |
|
|
108
|
+
| `/theme` | Switch color theme palette | `/theme catppuccin` |
|
|
109
|
+
| `/tools` | Enable or disable agent function tools | `/tools on` or `/tools off` |
|
|
110
|
+
| `/thinking` | Toggle live thought/reasoning token streaming | `/thinking on` |
|
|
111
|
+
| `/diff` | Inspect staged file diffs proposed by agent | `/diff` |
|
|
112
|
+
| `/apply` | Apply pending unified diffs to files | `/apply` |
|
|
113
|
+
| `/tasks` | List, inspect, or kill background tasks | `/tasks list` / `/tasks logs <id>` |
|
|
114
|
+
| `/git` | Execute git status, diff, or commit directly | `/git status` |
|
|
115
|
+
| `/scratch` | Access or update persistent scratchpad memo | `/scratch set <notes>` |
|
|
116
|
+
| `/tree` | Print directory tree of current workspace | `/tree` |
|
|
117
|
+
| `/index` | Build or query workspace keyword index | `/index build` |
|
|
118
|
+
| `/copy` | Copy last response or code block to clipboard | `/copy` |
|
|
119
|
+
| `/undo` | Roll back latest file edit from backups | `/undo` |
|
|
120
|
+
| `/clear` | Clear viewport history (or `Ctrl+L`) | `/clear` |
|
|
121
|
+
| `/help` | Show command reference table | `/help` |
|
|
122
|
+
| `/exit` | Save session state and exit (or `Ctrl+Q`) | `/exit` |
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## ⌨️ Keybindings
|
|
127
|
+
|
|
128
|
+
- **`Tab`**: Auto-complete slash command / accept ghost suggestion.
|
|
129
|
+
- **`Right Arrow`**: Accept ghost suggestion at line end.
|
|
130
|
+
- **`Up / Down`**: Navigate history or smooth-scroll conversation viewport.
|
|
131
|
+
- **`Ctrl+T`**: Cycle color themes dynamically.
|
|
132
|
+
- **`Ctrl+P`**: Cycle configured AI providers.
|
|
133
|
+
- **`Ctrl+O`**: Toggle block collapse (compact vs expanded summary).
|
|
134
|
+
- **`Ctrl+L`**: Clear current viewport.
|
|
135
|
+
- **`Ctrl+C`**: Interrupt running generation / exit.
|
|
136
|
+
- **`Ctrl+Q`**: Save session and quit.
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## 📚 Documentation & Wiki
|
|
141
|
+
|
|
142
|
+
Detailed guides and specifications are organized in [`docs/wiki/`](docs/wiki/):
|
|
143
|
+
|
|
144
|
+
- 🏠 **[Home & Overview](docs/wiki/Home.md)**: Product overview and architecture.
|
|
145
|
+
- 🚀 **[Getting Started & Installation](docs/wiki/Getting-Started.md)**: Step-by-step setup across Termux, Linux, macOS, and Windows.
|
|
146
|
+
- ⚙️ **[Configuration & Providers](docs/wiki/Configuration.md)**: API keys, model parameters, custom endpoints, and auto-failover.
|
|
147
|
+
- 🛠️ **[Tools & Workflows](docs/wiki/Tools-and-Capabilities.md)**: Deep dive into diff generation, sandbox execution, web search, and tasks.
|
|
148
|
+
- 🎨 **[Theming & UI Customization](docs/wiki/Theming.md)**: Theme reference and customizing styles.
|
|
149
|
+
- 🔌 **[Extensibility & Architecture](docs/wiki/Architecture.md)**: Harness internals, compaction, streaming protocols, and lifecycle.
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## 🏗️ Architecture
|
|
154
|
+
|
|
155
|
+
```mermaid
|
|
156
|
+
flowchart TD
|
|
157
|
+
User([User Terminal / Touch]) --> UI[XDHApp TUI Container]
|
|
158
|
+
UI --> Layout[3-Segment Layout: Header, Viewport, Composer]
|
|
159
|
+
UI --> Engine[XDHarness Core Engine]
|
|
160
|
+
Engine --> ProviderRouter[Provider Router & Failover]
|
|
161
|
+
ProviderRouter --> LLM[Streaming API / Ollama / OpenAI / OpenRouter]
|
|
162
|
+
Engine --> ToolManager[Autonomous Tool Execution Engine]
|
|
163
|
+
ToolManager --> Filesystem[(Filesystem & Atomic Backups)]
|
|
164
|
+
ToolManager --> Shell[Subprocess Shell & BG Tasks]
|
|
165
|
+
ToolManager --> Web[DuckDuckGo / Web Fetcher]
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## 🤝 Contributing & Community
|
|
171
|
+
|
|
172
|
+
Contributions are welcome! Please review our community guidelines before getting started:
|
|
173
|
+
- 📜 **[Code of Conduct](CODE_OF_CONDUCT.md)**
|
|
174
|
+
- 💡 **[Contributing Guide](CONTRIBUTING.md)**
|
|
175
|
+
- 🔒 **[Security Policy](SECURITY.md)**
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## 📄 License
|
|
180
|
+
|
|
181
|
+
This project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for details.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "xdharness"
|
|
7
|
+
version = "1.0.1"
|
|
8
|
+
description = "xdh (xdharness) - Autonomous Terminal Agent Harness & TUI for Android Termux, Linux, macOS, and Windows"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
|
+
authors = [
|
|
14
|
+
{ name = "PwnedBytes0x1", email = "pwnedbytes@gmail.com" }
|
|
15
|
+
]
|
|
16
|
+
keywords = [
|
|
17
|
+
"ai",
|
|
18
|
+
"agent",
|
|
19
|
+
"terminal",
|
|
20
|
+
"tui",
|
|
21
|
+
"cli",
|
|
22
|
+
"llm",
|
|
23
|
+
"termux",
|
|
24
|
+
"developer-tools",
|
|
25
|
+
"prompt-toolkit",
|
|
26
|
+
"rich"
|
|
27
|
+
]
|
|
28
|
+
classifiers = [
|
|
29
|
+
"Development Status :: 5 - Production/Stable",
|
|
30
|
+
"Intended Audience :: Developers",
|
|
31
|
+
"Topic :: Software Development :: User Interfaces",
|
|
32
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
33
|
+
"Operating System :: OS Independent",
|
|
34
|
+
"Programming Language :: Python :: 3",
|
|
35
|
+
"Programming Language :: Python :: 3.10",
|
|
36
|
+
"Programming Language :: Python :: 3.11",
|
|
37
|
+
"Programming Language :: Python :: 3.12",
|
|
38
|
+
"Programming Language :: Python :: 3.13",
|
|
39
|
+
"Environment :: Console",
|
|
40
|
+
]
|
|
41
|
+
dependencies = [
|
|
42
|
+
"prompt_toolkit>=3.0.36",
|
|
43
|
+
"rich>=13.0.0",
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
[project.urls]
|
|
47
|
+
Homepage = "https://github.com/PwnedBytes0x1/xdh"
|
|
48
|
+
Documentation = "https://github.com/PwnedBytes0x1/xdh/tree/main/docs/wiki"
|
|
49
|
+
Repository = "https://github.com/PwnedBytes0x1/xdh.git"
|
|
50
|
+
Issues = "https://github.com/PwnedBytes0x1/xdh/issues"
|
|
51
|
+
|
|
52
|
+
[project.scripts]
|
|
53
|
+
xdh = "xdh:main"
|
|
54
|
+
xdharness = "xdh:main"
|
|
55
|
+
|
|
56
|
+
[tool.setuptools]
|
|
57
|
+
py-modules = ["xdh"]
|
xdharness-1.0.1/setup.py
ADDED